From 35296f78fe7ee7fe565af9d537c37c54fd73372f Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 15 Jan 2025 12:02:26 +0100 Subject: [PATCH 01/10] enh(ui): smart picker button at the end of line * Show a `+` button that opens the smart picker. * Show the button when the cursor is at the end of the line. * Do not show the button if the smart picker is already open. * Remove the placeholder text. * Tab navigation to the smart picker works. Signed-off-by: Max --- src/components/Assistant.vue | 1 + src/components/Editor.vue | 6 ++- src/components/Editor/SmartPickerMenu.vue | 62 +++++++++++++++++++++++ src/extensions/RichText.js | 7 --- 4 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 src/components/Editor/SmartPickerMenu.vue diff --git a/src/components/Assistant.vue b/src/components/Assistant.vue index 2dbfeea89ad..011c21a4d97 100644 --- a/src/components/Assistant.vue +++ b/src/components/Assistant.vue @@ -5,6 +5,7 @@ + ref="contentWrapper"> + + + + + + diff --git a/src/extensions/RichText.js b/src/extensions/RichText.js index cf71f42c71b..bcacc24879f 100644 --- a/src/extensions/RichText.js +++ b/src/extensions/RichText.js @@ -35,7 +35,6 @@ import Mention from './../extensions/Mention.js' import Search from './../extensions/Search.js' import OrderedList from './../nodes/OrderedList.js' import Paragraph from './../nodes/Paragraph.js' -import Placeholder from '@tiptap/extension-placeholder' import Preview from './../nodes/Preview.js' import Table from './../nodes/Table.js' import TaskItem from './../nodes/TaskItem.js' @@ -45,7 +44,6 @@ import TrailingNode from './../nodes/TrailingNode.js' /* eslint-enable import/no-named-as-default */ import { Strong, Italic, Strike, Link, Underline } from './../marks/index.js' -import { translate as t } from '@nextcloud/l10n' const lowlight = createLowlight(common) lowlight.registerAlias('plaintext', 'mermaid') @@ -112,11 +110,6 @@ export default Extension.create({ relativePath: this.options.relativePath, }), LinkBubble, - this.options.editing - ? Placeholder.configure({ - placeholder: t('text', 'Start writing, or try \'/\' to add, \'@\' to mention…'), - }) - : null, TrailingNode, ] const additionalExtensionNames = this.options.extensions.map(e => e.name) From d5d2503fa0267e56bbed6121610dab226995b1d6 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 15 Jan 2025 15:12:40 +0100 Subject: [PATCH 02/10] enh(ui): show smart picker button when cursor is not eol. Signed-off-by: Max --- src/components/Editor/SmartPickerMenu.vue | 29 ++++++++++++++++------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/components/Editor/SmartPickerMenu.vue b/src/components/Editor/SmartPickerMenu.vue index 251d3812f79..0d1b6b41a77 100644 --- a/src/components/Editor/SmartPickerMenu.vue +++ b/src/components/Editor/SmartPickerMenu.vue @@ -5,6 +5,7 @@