From 1550f582be92bc10c68b8a229470115a02aaf69f Mon Sep 17 00:00:00 2001 From: Simon Backx Date: Fri, 8 Jul 2022 11:03:19 +0200 Subject: [PATCH] Added blockquotes --- apps/comments-ui/package.json | 1 + apps/comments-ui/src/index.css | 6 ++++++ apps/comments-ui/src/utils/editor.js | 4 +++- apps/comments-ui/yarn.lock | 5 +++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/comments-ui/package.json b/apps/comments-ui/package.json index 31d3f81cfd..da1e5757e1 100644 --- a/apps/comments-ui/package.json +++ b/apps/comments-ui/package.json @@ -10,6 +10,7 @@ "@testing-library/react": "12.1.2", "@testing-library/user-event": "14.0.0", "@tiptap/core": "^2.0.0-beta.182", + "@tiptap/extension-blockquote": "^2.0.0-beta.29", "@tiptap/extension-document": "^2.0.0-beta.17", "@tiptap/extension-link": "^2.0.0-beta.43", "@tiptap/extension-paragraph": "^2.0.0-beta.26", diff --git a/apps/comments-ui/src/index.css b/apps/comments-ui/src/index.css index 42d13bedfa..85ad5d41b5 100644 --- a/apps/comments-ui/src/index.css +++ b/apps/comments-ui/src/index.css @@ -27,6 +27,12 @@ body { text-decoration: underline; } +/* Blockquotes */ +.gh-comment-content blockquote { + border-left: 3px solid rgba(13,13,13,.1); + padding-left: 1rem; +} + /* The following lines are needed for the editor */ /* Placeholder */ diff --git a/apps/comments-ui/src/utils/editor.js b/apps/comments-ui/src/utils/editor.js index b8f0145daa..313ab3a7b5 100644 --- a/apps/comments-ui/src/utils/editor.js +++ b/apps/comments-ui/src/utils/editor.js @@ -3,6 +3,7 @@ import Text from '@tiptap/extension-text'; import Link from '@tiptap/extension-link'; import Paragraph from '@tiptap/extension-paragraph'; import Document from '@tiptap/extension-document'; +import Blockquote from '@tiptap/extension-blockquote'; export function getEditorConfig({placeholder, autofocus = false, content = ''}) { return { @@ -15,7 +16,8 @@ export function getEditorConfig({placeholder, autofocus = false, content = ''}) }), Placeholder.configure({ placeholder - }) + }), + Blockquote.configure({}) ], content, autofocus, diff --git a/apps/comments-ui/yarn.lock b/apps/comments-ui/yarn.lock index 4c1c4f4d02..42ad7a3d86 100644 --- a/apps/comments-ui/yarn.lock +++ b/apps/comments-ui/yarn.lock @@ -1751,6 +1751,11 @@ prosemirror-transform "1.6.0" prosemirror-view "1.26.2" +"@tiptap/extension-blockquote@^2.0.0-beta.29": + version "2.0.0-beta.29" + resolved "https://registry.yarnpkg.com/@tiptap/extension-blockquote/-/extension-blockquote-2.0.0-beta.29.tgz#6f1c4b17efa6457c7776f32d0807e96d848d4389" + integrity sha512-zMYT5TtpKWav9VhTn4JLyMvXmhEdbD6on0MdhcTjRm0I5ugyR4ZbJwh2aelM7G9DZVYzB8jZU18OSDJmo7Af7w== + "@tiptap/extension-bubble-menu@^2.0.0-beta.61": version "2.0.0-beta.61" resolved "https://registry.yarnpkg.com/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.0.0-beta.61.tgz#cc61ce8b094fdbcec58f44f0fa39172a726c024c"