From ccf022454781aac18dbe2d326157079ef8ba830c Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 31 Jan 2023 12:34:52 +0800 Subject: [PATCH 1/3] feat: add supports for set link --- .../src/components/EditorBubbleMenu.vue | 10 ++- .../components/EditorLinkBubbleMenuItems.vue | 85 +++++++++++++++++++ 2 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 packages/editor/src/components/EditorLinkBubbleMenuItems.vue diff --git a/packages/editor/src/components/EditorBubbleMenu.vue b/packages/editor/src/components/EditorBubbleMenu.vue index 477eb45..3bddcf3 100644 --- a/packages/editor/src/components/EditorBubbleMenu.vue +++ b/packages/editor/src/components/EditorBubbleMenu.vue @@ -5,6 +5,7 @@ import type { PropType } from "vue"; import { BubbleMenu, Editor } from "@tiptap/vue-3"; import type { MenuItem } from "@/types"; import { VTooltip } from "floating-vue"; +import EditorLinkBubbleMenuItems from "./EditorLinkBubbleMenuItems.vue"; defineProps({ editor: { @@ -29,13 +30,20 @@ defineProps({ + +
+
+
+ + diff --git a/packages/editor/src/components/EditorLinkBubbleMenuItems.vue b/packages/editor/src/components/EditorLinkBubbleMenuItems.vue new file mode 100644 index 0000000..bac97f9 --- /dev/null +++ b/packages/editor/src/components/EditorLinkBubbleMenuItems.vue @@ -0,0 +1,85 @@ + + + From 884248c4b770c9cb6ead56d974892e207a1f0037 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 31 Jan 2023 13:26:23 +0800 Subject: [PATCH 2/3] feat: add supports for open link --- .../src/components/EditorLinkBubbleMenuItems.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/editor/src/components/EditorLinkBubbleMenuItems.vue b/packages/editor/src/components/EditorLinkBubbleMenuItems.vue index bac97f9..4cd5588 100644 --- a/packages/editor/src/components/EditorLinkBubbleMenuItems.vue +++ b/packages/editor/src/components/EditorLinkBubbleMenuItems.vue @@ -4,6 +4,7 @@ import { computed, type PropType } from "vue"; import { VTooltip, Dropdown as VDropdown } from "floating-vue"; import MdiLinkVariant from "~icons/mdi/link-variant"; import MdiLinkVariantOff from "~icons/mdi/link-variant-off"; +import MdiShare from "~icons/mdi/share"; const props = defineProps({ editor: { @@ -82,4 +83,14 @@ function handleUnSetLink() { > + + + + From b723062adcefb8a89ba51a11a070dc981bd9b4b9 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 31 Jan 2023 15:17:52 +0800 Subject: [PATCH 3/3] perf: disable auto link --- example/src/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/src/App.vue b/example/src/App.vue index 00097e3..f48ee71 100644 --- a/example/src/App.vue +++ b/example/src/App.vue @@ -108,7 +108,7 @@ const editor = useEditor({ ExtensionTaskList, ExtensionTaskItem, ExtensionLink.configure({ - autolink: true, + autolink: false, openOnClick: false, }), ExtensionTextAlign.configure({