From 40c5262a9c2fcb8c89d7c464ccfdc3016f933eb3 Mon Sep 17 00:00:00 2001 From: Giuseppe Date: Sat, 21 Dec 2024 14:09:30 +0100 Subject: feature: WYSIWYG markdown for notes. Fixes #701 (#715) * #701 Improve note support : WYSIWYG markdown First implementation with a wysiwyg markdown editor. Update: - Add Lexical markdown editor - consistent rendering between card and preview - removed edit modal, replaced by preview with save action - simple markdown shortcut: underline, bold, italic etc... * #701 Improve note support : WYSIWYG markdown improved performance to not rerender all note card when one is updated * Use markdown shortcuts * Remove the alignment actions * Drop history buttons * Fix code and highlighting buttons * Remove the unneeded update markdown plugin * Remove underline support as it's not markdown native * - added ListPlugin because if absent, there's a bug where you can't escape a list with enter + enter - added codeblock plugin - added prose dark:prose-invert prose-p:m-0 like you said (there's room for improvement I think, don't took the time too deep dive in) and removed theme - Added a switch to show raw markdown - Added back the react markdown for card (SSR) * delete theme.ts * add theme back for code element to be more like prism theme from markdown-readonly * move the new editor back to the edit menu * move the bookmark markdown component into dashboard/bookmark * move the tooltip into its own component * move save button to toolbar * Better raw markdown --------- Co-authored-by: Giuseppe Lapenta Co-authored-by: Mohamed Bassem --- apps/web/lib/i18n/locales/en/translation.json | 50 ++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) (limited to 'apps/web/lib/i18n/locales/en') diff --git a/apps/web/lib/i18n/locales/en/translation.json b/apps/web/lib/i18n/locales/en/translation.json index 9f12487f..a871489a 100644 --- a/apps/web/lib/i18n/locales/en/translation.json +++ b/apps/web/lib/i18n/locales/en/translation.json @@ -187,7 +187,55 @@ "import_as_separate_bookmarks": "Import as separate Bookmarks", "placeholder": "Paste a link or an image, write a note or drag and drop an image in here ...", "new_item": "NEW ITEM", - "disabled_submissions": "Submissions are disabled" + "disabled_submissions": "Submissions are disabled", + "text_toolbar": { + "undo": "Undo", + "redo": "Redo", + "bold": "Bold", + "italic": "Italic", + "underline": "Underline", + "strikethrough": "Strikethrough", + "code": "Code", + "highlight": "Highlight", + "align_left": "Left Align", + "align_center": "Center Align", + "align_right": "Right Align", + "markdown_shortcuts": { + "label": "Markdown shortcuts", + "heading": { + "label": "Heading", + "example": "# H1, ## H2, ### H3" + }, + "bold": { + "label": "Bold", + "example": "**text** or CTRL+b" + }, + "italic": { + "label": "Italic", + "example": "*Italic* or _Italic_ or CTRL+i" + }, + "blockquote": { + "label": "Blockquote", + "example": "> Blockquote" + }, + "ordered_list": { + "label": "Ordered List", + "example": "1. List item" + }, + "unordered_list": { + "label": "Unordered List", + "example": "- List item" + }, + "inline_code": { + "label": "Inline Code", + "example": "`Code`" + }, + "block_code": { + "label": "Block Code", + "example": "``` + space" + } + } + } }, "toasts": { "bookmarks": { -- cgit v1.3-1-g0d28