@vizel/vue 0.0.1-alpha.1 → 0.0.1-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -7
- package/dist/index.js +69 -61
- package/dist/index10.js +80 -127
- package/dist/index11.js +55 -24
- package/dist/index12.js +28 -8
- package/dist/index13.js +60 -75
- package/dist/index14.js +98 -124
- package/dist/index15.js +9 -31
- package/dist/index16.js +184 -14
- package/dist/index17.js +14 -77
- package/dist/index18.js +28 -113
- package/dist/index19.js +128 -14
- package/dist/index2.js +73 -82
- package/dist/index20.js +24 -46
- package/dist/index21.js +10 -41
- package/dist/index22.js +12 -10
- package/dist/index23.js +89 -14
- package/dist/index24.js +130 -33
- package/dist/index25.js +34 -45
- package/dist/index26.js +19 -22
- package/dist/index27.js +77 -8
- package/dist/index28.js +118 -44
- package/dist/index29.js +18 -20
- package/dist/index3.js +49 -56
- package/dist/index30.js +50 -13
- package/dist/index31.js +41 -2
- package/dist/index32.js +36 -2
- package/dist/index33.js +46 -2
- package/dist/index34.js +22 -2
- package/dist/index35.js +8 -2
- package/dist/index36.js +44 -2
- package/dist/index37.js +21 -2
- package/dist/index38.js +13 -2
- package/dist/index39.js +15 -2
- package/dist/index4.js +236 -30
- package/dist/index40.js +2 -2
- package/dist/index41.js +1 -1
- package/dist/index42.js +1 -1
- package/dist/index43.js +1 -1
- package/dist/index44.js +1 -1
- package/dist/index45.js +1 -1
- package/dist/index46.js +1 -1
- package/dist/index47.js +1 -1
- package/dist/index5.js +78 -70
- package/dist/index51.js +1 -1
- package/dist/index52.js +4 -0
- package/dist/index53.js +4 -0
- package/dist/index54.js +4 -0
- package/dist/index55.js +4 -0
- package/dist/index56.js +4 -0
- package/dist/index57.js +4 -0
- package/dist/index58.js +4 -0
- package/dist/index59.js +4 -0
- package/dist/index6.js +72 -103
- package/dist/index60.js +4 -0
- package/dist/index7.js +62 -11
- package/dist/index8.js +57 -186
- package/dist/index9.js +2 -35
- package/package.json +25 -32
package/dist/index.d.ts
CHANGED
|
@@ -32,11 +32,10 @@ declare const __VLS_component: DefineComponent<__VLS_PublicProps, {
|
|
|
32
32
|
editor: Editor | null;
|
|
33
33
|
getEditor: () => Editor | null;
|
|
34
34
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
35
|
-
|
|
36
|
-
blur: (args_0: {
|
|
35
|
+
focus: (args_0: {
|
|
37
36
|
editor: Editor;
|
|
38
37
|
}) => any;
|
|
39
|
-
|
|
38
|
+
blur: (args_0: {
|
|
40
39
|
editor: Editor;
|
|
41
40
|
}) => any;
|
|
42
41
|
create: (args_0: {
|
|
@@ -48,13 +47,13 @@ editor: Editor;
|
|
|
48
47
|
selectionUpdate: (args_0: {
|
|
49
48
|
editor: Editor;
|
|
50
49
|
}) => any;
|
|
50
|
+
destroy: () => any;
|
|
51
51
|
"update:markdown": (value: string) => any;
|
|
52
52
|
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
53
|
-
|
|
54
|
-
onBlur?: (args_0: {
|
|
53
|
+
onFocus?: (args_0: {
|
|
55
54
|
editor: Editor;
|
|
56
55
|
}) => any;
|
|
57
|
-
|
|
56
|
+
onBlur?: (args_0: {
|
|
58
57
|
editor: Editor;
|
|
59
58
|
}) => any;
|
|
60
59
|
onCreate?: (args_0: {
|
|
@@ -66,6 +65,7 @@ editor: Editor;
|
|
|
66
65
|
onSelectionUpdate?: (args_0: {
|
|
67
66
|
editor: Editor;
|
|
68
67
|
}) => any;
|
|
68
|
+
onDestroy?: () => any;
|
|
69
69
|
"onUpdate:markdown"?: (value: string) => any;
|
|
70
70
|
}>, {
|
|
71
71
|
transformDiagramsOnImport: boolean;
|
|
@@ -92,8 +92,8 @@ onClick?: () => any;
|
|
|
92
92
|
declare const __VLS_component_4: DefineComponent<VizelIconProviderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<VizelIconProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
93
93
|
|
|
94
94
|
declare const __VLS_component_5: DefineComponent<VizelPortalProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<VizelPortalProps> & Readonly<{}>, {
|
|
95
|
-
disabled: boolean;
|
|
96
95
|
layer: VizelPortalLayer;
|
|
96
|
+
disabled: boolean;
|
|
97
97
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
98
98
|
|
|
99
99
|
declare const __VLS_component_6: DefineComponent<VizelProviderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<VizelProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
package/dist/index.js
CHANGED
|
@@ -1,63 +1,71 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import {
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
1
|
+
import "./index2.js";
|
|
2
|
+
import "./index3.js";
|
|
3
|
+
import "./index4.js";
|
|
4
|
+
import "./index5.js";
|
|
5
|
+
import "./index6.js";
|
|
6
|
+
import "./index7.js";
|
|
7
|
+
import "./index8.js";
|
|
8
|
+
import "./index9.js";
|
|
9
|
+
import { default as p } from "./index10.js";
|
|
10
|
+
import { default as d } from "./index11.js";
|
|
11
|
+
import { default as x } from "./index12.js";
|
|
12
|
+
import { default as n } from "./index13.js";
|
|
13
|
+
import { default as S } from "./index14.js";
|
|
14
|
+
import { default as c } from "./index15.js";
|
|
15
|
+
import { default as v } from "./index16.js";
|
|
16
|
+
import { useVizelContext as E, useVizelContextSafe as I } from "./index17.js";
|
|
17
|
+
import { default as C } from "./index18.js";
|
|
18
|
+
import { default as T } from "./index19.js";
|
|
19
|
+
import { default as D } from "./index20.js";
|
|
20
|
+
import { provideVizelIcons as A, useVizelIconContext as L } from "./index21.js";
|
|
21
|
+
import { default as R } from "./index22.js";
|
|
22
|
+
import { default as j } from "./index23.js";
|
|
23
|
+
import { default as F } from "./index24.js";
|
|
24
|
+
import { default as H } from "./index25.js";
|
|
25
|
+
import { default as K } from "./index26.js";
|
|
26
|
+
import { default as Q } from "./index27.js";
|
|
27
|
+
import { default as W } from "./index28.js";
|
|
28
|
+
import { default as Y } from "./index29.js";
|
|
29
|
+
import { default as _ } from "./index30.js";
|
|
30
|
+
import { default as ee } from "./index31.js";
|
|
31
|
+
import { createVizelSlashMenuRenderer as re } from "./index32.js";
|
|
32
|
+
import { useVizelAutoSave as le } from "./index33.js";
|
|
33
|
+
import { useVizelEditor as ie } from "./index34.js";
|
|
34
|
+
import { useVizelEditorState as ue } from "./index35.js";
|
|
35
|
+
import { useVizelMarkdown as pe } from "./index36.js";
|
|
36
|
+
import { useVizelState as de } from "./index37.js";
|
|
37
|
+
import { useVizelTheme as xe, useVizelThemeSafe as ze } from "./index38.js";
|
|
30
38
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
39
|
+
p as Vizel,
|
|
40
|
+
d as VizelBubbleMenu,
|
|
41
|
+
x as VizelBubbleMenuButton,
|
|
42
|
+
n as VizelBubbleMenuColorPicker,
|
|
43
|
+
S as VizelBubbleMenuDefault,
|
|
44
|
+
c as VizelBubbleMenuDivider,
|
|
45
|
+
v as VizelColorPicker,
|
|
46
|
+
C as VizelEditor,
|
|
47
|
+
T as VizelEmbedView,
|
|
48
|
+
D as VizelIcon,
|
|
49
|
+
R as VizelIconProvider,
|
|
50
|
+
j as VizelLinkEditor,
|
|
51
|
+
F as VizelNodeSelector,
|
|
52
|
+
H as VizelPortal,
|
|
53
|
+
K as VizelProvider,
|
|
54
|
+
Q as VizelSaveIndicator,
|
|
55
|
+
W as VizelSlashMenu,
|
|
56
|
+
Y as VizelSlashMenuEmpty,
|
|
57
|
+
_ as VizelSlashMenuItem,
|
|
58
|
+
ee as VizelThemeProvider,
|
|
59
|
+
re as createVizelSlashMenuRenderer,
|
|
60
|
+
A as provideVizelIcons,
|
|
61
|
+
le as useVizelAutoSave,
|
|
62
|
+
E as useVizelContext,
|
|
63
|
+
I as useVizelContextSafe,
|
|
64
|
+
ie as useVizelEditor,
|
|
65
|
+
ue as useVizelEditorState,
|
|
66
|
+
L as useVizelIconContext,
|
|
67
|
+
pe as useVizelMarkdown,
|
|
68
|
+
de as useVizelState,
|
|
69
|
+
xe as useVizelTheme,
|
|
70
|
+
ze as useVizelThemeSafe
|
|
63
71
|
};
|
package/dist/index10.js
CHANGED
|
@@ -1,135 +1,88 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { defineComponent as B, mergeModels as m, useModel as M, useSlots as g, watch as y, createElementBlock as h, openBlock as n, normalizeClass as C, createBlock as s, createCommentVNode as f, renderSlot as c, unref as a, withCtx as z } from "vue";
|
|
2
|
+
import { getVizelMarkdown as b, setVizelMarkdown as D } from "@vizel/core";
|
|
3
|
+
import { useVizelEditor as E } from "./index34.js";
|
|
4
|
+
import p from "./index11.js";
|
|
5
|
+
import U from "./index18.js";
|
|
6
|
+
const F = /* @__PURE__ */ B({
|
|
7
|
+
__name: "Vizel",
|
|
8
|
+
props: /* @__PURE__ */ m({
|
|
9
|
+
initialContent: {},
|
|
10
|
+
initialMarkdown: {},
|
|
11
|
+
transformDiagramsOnImport: { type: Boolean, default: !0 },
|
|
12
|
+
placeholder: {},
|
|
13
|
+
editable: { type: Boolean, default: !0 },
|
|
14
|
+
autofocus: { type: [Boolean, String, Number], default: !1 },
|
|
15
|
+
features: {},
|
|
16
16
|
class: {},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
17
|
+
showBubbleMenu: { type: Boolean, default: !0 },
|
|
18
|
+
enableEmbed: { type: Boolean, default: !1 }
|
|
19
|
+
}, {
|
|
20
|
+
markdown: {},
|
|
21
|
+
markdownModifiers: {}
|
|
22
|
+
}),
|
|
23
|
+
emits: /* @__PURE__ */ m(["update", "create", "destroy", "selectionUpdate", "focus", "blur"], ["update:markdown"]),
|
|
24
|
+
setup(r, { expose: k, emit: v }) {
|
|
25
|
+
const o = r, l = v, i = M(r, "markdown"), w = g();
|
|
26
|
+
let d = !1;
|
|
27
|
+
const t = E({
|
|
28
|
+
...o.initialContent !== void 0 && { initialContent: o.initialContent },
|
|
29
|
+
...o.initialMarkdown !== void 0 && { initialMarkdown: o.initialMarkdown },
|
|
30
|
+
transformDiagramsOnImport: o.transformDiagramsOnImport,
|
|
31
|
+
...o.placeholder !== void 0 && { placeholder: o.placeholder },
|
|
32
|
+
editable: o.editable,
|
|
33
|
+
autofocus: o.autofocus,
|
|
34
|
+
...o.features !== void 0 && { features: o.features },
|
|
35
|
+
onUpdate: (e) => {
|
|
36
|
+
l("update", e), !d && i.value !== void 0 && (i.value = b(e.editor));
|
|
37
|
+
},
|
|
38
|
+
onCreate: (e) => l("create", e),
|
|
39
|
+
onDestroy: () => l("destroy"),
|
|
40
|
+
onSelectionUpdate: (e) => l("selectionUpdate", e),
|
|
41
|
+
onFocus: (e) => l("focus", e),
|
|
42
|
+
onBlur: (e) => l("blur", e)
|
|
29
43
|
});
|
|
30
|
-
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
], -1)
|
|
50
|
-
])], 10, N)) : e.data.type === "oembed" && e.data.html ? (i(), d("div", {
|
|
51
|
-
key: 1,
|
|
52
|
-
ref_key: "containerRef",
|
|
53
|
-
ref: v,
|
|
54
|
-
class: s(c.value),
|
|
55
|
-
"data-embed-type": "oembed",
|
|
56
|
-
"data-embed-provider": e.data.provider
|
|
44
|
+
return y(i, (e) => {
|
|
45
|
+
if (e === void 0 || !t.value) return;
|
|
46
|
+
const u = b(t.value);
|
|
47
|
+
e !== u && (d = !0, D(t.value, e, {
|
|
48
|
+
transformDiagrams: o.transformDiagramsOnImport
|
|
49
|
+
}), d = !1);
|
|
50
|
+
}), k({
|
|
51
|
+
/** The underlying Tiptap editor instance */
|
|
52
|
+
get editor() {
|
|
53
|
+
return t.value;
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* Get the underlying Tiptap editor instance
|
|
57
|
+
* @deprecated Use the `editor` property instead
|
|
58
|
+
*/
|
|
59
|
+
getEditor: () => t.value
|
|
60
|
+
}), (e, u) => (n(), h("div", {
|
|
61
|
+
class: C(["vizel-root", e.$props.class]),
|
|
62
|
+
"data-vizel-root": ""
|
|
57
63
|
}, [
|
|
58
|
-
a(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, null,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
href: e.data.url,
|
|
70
|
-
target: "_blank",
|
|
71
|
-
rel: "noopener noreferrer",
|
|
72
|
-
class: s(["vizel-embed-card", b.value ? "vizel-embed-card-horizontal" : ""])
|
|
73
|
-
}, [
|
|
74
|
-
b.value ? (i(), d("img", {
|
|
75
|
-
key: 0,
|
|
76
|
-
src: e.data.image,
|
|
77
|
-
alt: "",
|
|
78
|
-
class: "vizel-embed-card-image",
|
|
79
|
-
loading: "lazy"
|
|
80
|
-
}, null, 8, L)) : o("", !0),
|
|
81
|
-
a("div", M, [
|
|
82
|
-
e.data.siteName || e.data.favicon ? (i(), d("div", S, [
|
|
83
|
-
e.data.favicon ? (i(), d("img", {
|
|
84
|
-
key: 0,
|
|
85
|
-
src: e.data.favicon,
|
|
86
|
-
alt: "",
|
|
87
|
-
class: "vizel-embed-card-favicon"
|
|
88
|
-
}, null, 8, R)) : o("", !0),
|
|
89
|
-
e.data.siteName ? (i(), d("span", H, r(e.data.siteName), 1)) : o("", !0)
|
|
90
|
-
])) : o("", !0),
|
|
91
|
-
e.data.title ? (i(), d("div", T, r(e.data.title), 1)) : o("", !0),
|
|
92
|
-
e.data.description ? (i(), d("div", j, r(e.data.description), 1)) : o("", !0),
|
|
93
|
-
a("div", q, r(z.value), 1)
|
|
94
|
-
])
|
|
95
|
-
], 10, E)
|
|
96
|
-
], 10, B)) : e.data.type === "title" && e.data.title ? (i(), d("div", {
|
|
97
|
-
key: 3,
|
|
98
|
-
class: s(c.value),
|
|
99
|
-
"data-embed-type": "title",
|
|
100
|
-
"data-embed-provider": e.data.provider
|
|
101
|
-
}, [
|
|
102
|
-
a("a", {
|
|
103
|
-
href: e.data.url,
|
|
104
|
-
target: "_blank",
|
|
105
|
-
rel: "noopener noreferrer",
|
|
106
|
-
class: "vizel-embed-link"
|
|
107
|
-
}, [
|
|
108
|
-
a("span", I, [
|
|
109
|
-
f(k, { name: "link" })
|
|
110
|
-
]),
|
|
111
|
-
a("span", P, r(e.data.title), 1)
|
|
112
|
-
], 8, D)
|
|
113
|
-
], 10, A)) : (i(), d("div", {
|
|
114
|
-
key: 4,
|
|
115
|
-
class: s(c.value),
|
|
116
|
-
"data-embed-type": "link",
|
|
117
|
-
"data-embed-provider": e.data.provider
|
|
118
|
-
}, [
|
|
119
|
-
a("a", {
|
|
120
|
-
href: e.data.url,
|
|
121
|
-
target: "_blank",
|
|
122
|
-
rel: "noopener noreferrer",
|
|
123
|
-
class: "vizel-embed-link"
|
|
124
|
-
}, [
|
|
125
|
-
a("span", F, [
|
|
126
|
-
f(k, { name: "link" })
|
|
64
|
+
a(t) ? (n(), s(U, {
|
|
65
|
+
key: 0,
|
|
66
|
+
editor: a(t)
|
|
67
|
+
}, null, 8, ["editor"])) : f("", !0),
|
|
68
|
+
r.showBubbleMenu && a(t) && a(w)["bubble-menu"] ? (n(), s(p, {
|
|
69
|
+
key: 1,
|
|
70
|
+
editor: a(t),
|
|
71
|
+
"enable-embed": r.enableEmbed ?? !1
|
|
72
|
+
}, {
|
|
73
|
+
default: z(() => [
|
|
74
|
+
c(e.$slots, "bubble-menu", { editor: a(t) })
|
|
127
75
|
]),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
76
|
+
_: 3
|
|
77
|
+
}, 8, ["editor", "enable-embed"])) : r.showBubbleMenu && a(t) ? (n(), s(p, {
|
|
78
|
+
key: 2,
|
|
79
|
+
editor: a(t),
|
|
80
|
+
"enable-embed": r.enableEmbed ?? !1
|
|
81
|
+
}, null, 8, ["editor", "enable-embed"])) : f("", !0),
|
|
82
|
+
c(e.$slots, "default", { editor: a(t) })
|
|
83
|
+
], 2));
|
|
131
84
|
}
|
|
132
85
|
});
|
|
133
86
|
export {
|
|
134
|
-
|
|
87
|
+
F as default
|
|
135
88
|
};
|
package/dist/index11.js
CHANGED
|
@@ -1,30 +1,61 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
__name: "
|
|
1
|
+
import { defineComponent as b, useSlots as v, ref as g, computed as h, watch as w, onBeforeUnmount as k, createElementBlock as B, createCommentVNode as a, openBlock as s, normalizeClass as E, renderSlot as S, createBlock as D, unref as z } from "vue";
|
|
2
|
+
import { BubbleMenuPlugin as K } from "@vizel/core";
|
|
3
|
+
import C from "./index14.js";
|
|
4
|
+
import { useVizelContextSafe as M } from "./index17.js";
|
|
5
|
+
const $ = /* @__PURE__ */ b({
|
|
6
|
+
__name: "VizelBubbleMenu",
|
|
7
7
|
props: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
editor: {},
|
|
9
|
+
class: {},
|
|
10
|
+
showDefaultMenu: { type: Boolean, default: !0 },
|
|
11
|
+
pluginKey: { default: "vizelBubbleMenu" },
|
|
12
|
+
updateDelay: { default: 100 },
|
|
13
|
+
shouldShow: {},
|
|
14
|
+
enableEmbed: { type: Boolean }
|
|
13
15
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
setup(u) {
|
|
17
|
+
const n = u, r = v(), i = g(null), d = M(), t = h(() => n.editor ?? d?.());
|
|
18
|
+
function o(e) {
|
|
19
|
+
e.key === "Escape" && t.value && !t.value.view.state.selection.empty && (e.preventDefault(), t.value.commands.setTextSelection(t.value.view.state.selection.to));
|
|
20
|
+
}
|
|
21
|
+
return w(
|
|
22
|
+
[t, i],
|
|
23
|
+
([e, l], [, m]) => {
|
|
24
|
+
if (!(e && l)) return;
|
|
25
|
+
m && (e.unregisterPlugin(n.pluginKey), document.removeEventListener("keydown", o));
|
|
26
|
+
const c = K({
|
|
27
|
+
pluginKey: n.pluginKey,
|
|
28
|
+
editor: e,
|
|
29
|
+
element: l,
|
|
30
|
+
updateDelay: n.updateDelay,
|
|
31
|
+
...n.shouldShow && {
|
|
32
|
+
shouldShow: ({ editor: f, from: p, to: y }) => n.shouldShow?.({ editor: f, from: p, to: y }) ?? !1
|
|
33
|
+
},
|
|
34
|
+
options: {
|
|
35
|
+
placement: "top"
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
e.registerPlugin(c), document.addEventListener("keydown", o);
|
|
39
|
+
},
|
|
40
|
+
{ immediate: !0 }
|
|
41
|
+
), k(() => {
|
|
42
|
+
t.value && t.value.unregisterPlugin(n.pluginKey), document.removeEventListener("keydown", o);
|
|
43
|
+
}), (e, l) => t.value ? (s(), B("div", {
|
|
44
|
+
key: 0,
|
|
45
|
+
ref_key: "menuRef",
|
|
46
|
+
ref: i,
|
|
47
|
+
class: E(["vizel-bubble-menu", e.$props.class]),
|
|
48
|
+
"data-vizel-bubble-menu": "",
|
|
49
|
+
style: { visibility: "hidden" }
|
|
50
|
+
}, [
|
|
51
|
+
z(r).default ? S(e.$slots, "default", { key: 0 }) : u.showDefaultMenu ? (s(), D(C, {
|
|
52
|
+
key: 1,
|
|
53
|
+
editor: t.value,
|
|
54
|
+
"enable-embed": n.enableEmbed
|
|
55
|
+
}, null, 8, ["editor", "enable-embed"])) : a("", !0)
|
|
56
|
+
], 2)) : a("", !0);
|
|
26
57
|
}
|
|
27
58
|
});
|
|
28
59
|
export {
|
|
29
|
-
|
|
60
|
+
$ as default
|
|
30
61
|
};
|
package/dist/index12.js
CHANGED
|
@@ -1,14 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
__name: "VizelIconProvider",
|
|
1
|
+
import { defineComponent as n, createElementBlock as o, openBlock as c, normalizeClass as d, renderSlot as r } from "vue";
|
|
2
|
+
const u = ["disabled", "aria-pressed", "title", "data-active", "data-action"], v = /* @__PURE__ */ n({
|
|
3
|
+
__name: "VizelBubbleMenuButton",
|
|
5
4
|
props: {
|
|
6
|
-
|
|
5
|
+
isActive: { type: Boolean },
|
|
6
|
+
disabled: { type: Boolean },
|
|
7
|
+
title: {},
|
|
8
|
+
class: {},
|
|
9
|
+
action: {}
|
|
7
10
|
},
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
emits: ["click"],
|
|
12
|
+
setup(t, { emit: a }) {
|
|
13
|
+
const s = t, l = a;
|
|
14
|
+
return (e, i) => (c(), o("button", {
|
|
15
|
+
type: "button",
|
|
16
|
+
disabled: t.disabled,
|
|
17
|
+
"aria-pressed": t.isActive,
|
|
18
|
+
class: d([
|
|
19
|
+
"vizel-bubble-menu-button",
|
|
20
|
+
{ "is-active": t.isActive },
|
|
21
|
+
e.$props.class
|
|
22
|
+
]),
|
|
23
|
+
title: t.title,
|
|
24
|
+
"data-active": t.isActive || void 0,
|
|
25
|
+
"data-action": s.action,
|
|
26
|
+
onClick: i[0] || (i[0] = (b) => l("click"))
|
|
27
|
+
}, [
|
|
28
|
+
r(e.$slots, "default")
|
|
29
|
+
], 10, u));
|
|
10
30
|
}
|
|
11
31
|
});
|
|
12
32
|
export {
|
|
13
|
-
|
|
33
|
+
v as default
|
|
14
34
|
};
|