@vizel/vue 0.0.1-alpha.1 → 0.0.1-alpha.4

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.
Files changed (55) hide show
  1. package/dist/index.d.ts +7 -7
  2. package/dist/index.js +69 -61
  3. package/dist/index10.js +80 -127
  4. package/dist/index11.js +55 -24
  5. package/dist/index12.js +28 -8
  6. package/dist/index13.js +60 -75
  7. package/dist/index14.js +98 -124
  8. package/dist/index15.js +9 -31
  9. package/dist/index16.js +184 -14
  10. package/dist/index17.js +14 -77
  11. package/dist/index18.js +28 -113
  12. package/dist/index19.js +128 -14
  13. package/dist/index2.js +73 -82
  14. package/dist/index20.js +24 -46
  15. package/dist/index21.js +10 -41
  16. package/dist/index22.js +12 -10
  17. package/dist/index23.js +89 -14
  18. package/dist/index24.js +130 -33
  19. package/dist/index25.js +34 -45
  20. package/dist/index26.js +19 -22
  21. package/dist/index27.js +77 -8
  22. package/dist/index28.js +118 -44
  23. package/dist/index29.js +18 -20
  24. package/dist/index3.js +49 -56
  25. package/dist/index30.js +50 -13
  26. package/dist/index31.js +41 -2
  27. package/dist/index32.js +36 -2
  28. package/dist/index33.js +46 -2
  29. package/dist/index34.js +22 -2
  30. package/dist/index35.js +8 -2
  31. package/dist/index36.js +44 -2
  32. package/dist/index37.js +21 -2
  33. package/dist/index38.js +13 -2
  34. package/dist/index39.js +15 -2
  35. package/dist/index4.js +236 -30
  36. package/dist/index47.js +1 -1
  37. package/dist/index48.js +1 -1
  38. package/dist/index49.js +1 -1
  39. package/dist/index5.js +78 -70
  40. package/dist/index50.js +1 -1
  41. package/dist/index51.js +1 -1
  42. package/dist/index52.js +4 -0
  43. package/dist/index53.js +4 -0
  44. package/dist/index54.js +4 -0
  45. package/dist/index55.js +4 -0
  46. package/dist/index56.js +4 -0
  47. package/dist/index57.js +4 -0
  48. package/dist/index58.js +4 -0
  49. package/dist/index59.js +4 -0
  50. package/dist/index6.js +72 -103
  51. package/dist/index60.js +4 -0
  52. package/dist/index7.js +62 -11
  53. package/dist/index8.js +57 -186
  54. package/dist/index9.js +2 -35
  55. 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
- destroy: () => any;
36
- blur: (args_0: {
35
+ focus: (args_0: {
37
36
  editor: Editor;
38
37
  }) => any;
39
- focus: (args_0: {
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
- onDestroy?: () => any;
54
- onBlur?: (args_0: {
53
+ onFocus?: (args_0: {
55
54
  editor: Editor;
56
55
  }) => any;
57
- onFocus?: (args_0: {
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 { default as r } from "./index2.js";
2
- import { default as l } from "./index3.js";
3
- import { default as f } from "./index4.js";
4
- import { default as u } from "./index5.js";
5
- import { default as s } from "./index6.js";
6
- import { default as V } from "./index7.js";
7
- import { default as z } from "./index8.js";
8
- import { default as n } from "./index9.js";
9
- import { default as S } from "./index10.js";
10
- import { default as c } from "./index11.js";
11
- import { default as v } from "./index12.js";
12
- import { default as E } from "./index13.js";
13
- import { default as P } from "./index14.js";
14
- import { default as k } from "./index15.js";
15
- import { default as w } from "./index16.js";
16
- import { default as y } from "./index17.js";
17
- import { default as L } from "./index18.js";
18
- import { default as R } from "./index19.js";
19
- import { default as j } from "./index20.js";
20
- import { default as F } from "./index21.js";
21
- import { provideVizelIcons as H, useVizelIconContext as J } from "./index22.js";
22
- import { useVizelContext as O, useVizelContextSafe as Q } from "./index23.js";
23
- import { createVizelSlashMenuRenderer as W } from "./index24.js";
24
- import { useVizelAutoSave as Y } from "./index25.js";
25
- import { useVizelEditor as _ } from "./index26.js";
26
- import { useVizelEditorState as ee } from "./index27.js";
27
- import { useVizelMarkdown as re } from "./index28.js";
28
- import { useVizelState as le } from "./index29.js";
29
- import { useVizelTheme as fe, useVizelThemeSafe as ie } from "./index30.js";
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
- r as Vizel,
32
- l as VizelBubbleMenu,
33
- f as VizelBubbleMenuButton,
34
- u as VizelBubbleMenuColorPicker,
35
- s as VizelBubbleMenuDefault,
36
- V as VizelBubbleMenuDivider,
37
- z as VizelColorPicker,
38
- n as VizelEditor,
39
- S as VizelEmbedView,
40
- c as VizelIcon,
41
- v as VizelIconProvider,
42
- E as VizelLinkEditor,
43
- P as VizelNodeSelector,
44
- k as VizelPortal,
45
- w as VizelProvider,
46
- y as VizelSaveIndicator,
47
- L as VizelSlashMenu,
48
- R as VizelSlashMenuEmpty,
49
- j as VizelSlashMenuItem,
50
- F as VizelThemeProvider,
51
- W as createVizelSlashMenuRenderer,
52
- H as provideVizelIcons,
53
- Y as useVizelAutoSave,
54
- O as useVizelContext,
55
- Q as useVizelContextSafe,
56
- _ as useVizelEditor,
57
- ee as useVizelEditorState,
58
- J as useVizelIconContext,
59
- re as useVizelMarkdown,
60
- le as useVizelState,
61
- fe as useVizelTheme,
62
- ie as useVizelThemeSafe
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 g, ref as w, computed as m, onMounted as p, watch as C, createElementBlock as d, openBlock as i, normalizeClass as s, createElementVNode as a, createCommentVNode as o, toDisplayString as r, createVNode as f } from "vue";
2
- import k from "./index11.js";
3
- const N = ["data-embed-provider"], x = ["data-embed-provider"], V = ["innerHTML"], B = ["data-embed-provider"], E = ["href"], L = ["src"], M = { class: "vizel-embed-card-content" }, S = {
4
- key: 0,
5
- class: "vizel-embed-card-site"
6
- }, R = ["src"], H = { key: 1 }, T = {
7
- key: 1,
8
- class: "vizel-embed-card-title"
9
- }, j = {
10
- key: 2,
11
- class: "vizel-embed-card-description"
12
- }, q = { class: "vizel-embed-card-url" }, A = ["data-embed-provider"], D = ["href"], I = { class: "vizel-embed-link-icon" }, P = { class: "vizel-embed-link-text" }, U = ["data-embed-provider"], $ = ["href"], F = { class: "vizel-embed-link-icon" }, G = { class: "vizel-embed-link-text" }, O = /* @__PURE__ */ g({
13
- __name: "VizelEmbedView",
14
- props: {
15
- data: {},
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
- selected: { type: Boolean }
18
- },
19
- setup(e) {
20
- const t = e, v = w(null), c = m(() => {
21
- const n = ["vizel-embed"];
22
- return t.data.loading && n.push("is-loading"), t.selected && n.push("ProseMirror-selectednode"), t.class && n.push(t.class), n.join(" ");
23
- }), y = m(() => ["youtube", "vimeo", "loom", "tiktok"].includes(t.data.provider ?? "")), b = m(() => !!t.data.image), z = m(() => {
24
- try {
25
- return new URL(t.data.url).hostname;
26
- } catch {
27
- return t.data.url;
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
- function h() {
31
- if (t.data.type === "oembed" && t.data.html && v.value) {
32
- const n = v.value.querySelectorAll("script");
33
- for (const l of n) {
34
- const u = document.createElement("script");
35
- l.src ? u.src = l.src : u.textContent = l.textContent, l.parentNode?.replaceChild(u, l);
36
- }
37
- t.data.provider === "twitter" && "twttr" in window && window.twttr?.widgets?.load?.();
38
- }
39
- }
40
- return p(h), C(() => [t.data.type, t.data.html], h), (n, l) => e.data.loading ? (i(), d("div", {
41
- key: 0,
42
- class: s(c.value),
43
- "data-embed-type": "loading",
44
- "data-embed-provider": e.data.provider
45
- }, [...l[0] || (l[0] = [
46
- a("div", { class: "vizel-embed-loading" }, [
47
- a("div", { class: "vizel-embed-loading-spinner" }),
48
- a("span", null, "Loading embed...")
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("div", {
59
- class: s(y.value ? "vizel-embed-video" : "vizel-embed-oembed"),
60
- innerHTML: e.data.html
61
- }, null, 10, V)
62
- ], 10, x)) : e.data.type === "ogp" ? (i(), d("div", {
63
- key: 2,
64
- class: s(c.value),
65
- "data-embed-type": "ogp",
66
- "data-embed-provider": e.data.provider
67
- }, [
68
- a("a", {
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
- a("span", G, r(e.data.url), 1)
129
- ], 8, $)
130
- ], 10, U));
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
- O as default
87
+ F as default
135
88
  };
package/dist/index11.js CHANGED
@@ -1,30 +1,61 @@
1
- import { defineComponent as c, computed as i, createBlock as r, openBlock as s, unref as m, mergeProps as l } from "vue";
2
- import { Icon as p } from "@iconify/vue";
3
- import { vizelDefaultIconIds as h } from "@vizel/core";
4
- import { useVizelIconContext as u } from "./index22.js";
5
- const g = /* @__PURE__ */ c({
6
- __name: "VizelIcon",
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
- name: {},
9
- customIcons: {},
10
- width: {},
11
- height: {},
12
- color: {}
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(e) {
15
- const o = e, { customIcons: t } = u(), n = i(
16
- () => o.customIcons?.[o.name] ?? t?.[o.name] ?? h[o.name]
17
- );
18
- return (a, d) => (s(), r(m(p), l({
19
- icon: n.value,
20
- style: { pointerEvents: "none" }
21
- }, {
22
- ...o.width !== void 0 && { width: o.width },
23
- ...o.height !== void 0 && { height: o.height },
24
- ...o.color !== void 0 && { color: o.color }
25
- }), null, 16, ["icon"]));
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
- g as default
60
+ $ as default
30
61
  };
package/dist/index12.js CHANGED
@@ -1,14 +1,34 @@
1
- import { defineComponent as r, renderSlot as n } from "vue";
2
- import { provideVizelIcons as s } from "./index22.js";
3
- const m = /* @__PURE__ */ r({
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
- icons: {}
5
+ isActive: { type: Boolean },
6
+ disabled: { type: Boolean },
7
+ title: {},
8
+ class: {},
9
+ action: {}
7
10
  },
8
- setup(o) {
9
- return s(o.icons), (e, p) => n(e.$slots, "default");
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
- m as default
33
+ v as default
14
34
  };