@vizel/vue 0.0.1-alpha.6 → 1.0.0

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/README.md CHANGED
@@ -5,7 +5,7 @@ Vue 3 components for Vizel block-based Markdown editor.
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @vizel/vue @vizel/core
8
+ npm install @vizel/vue
9
9
  ```
10
10
 
11
11
  ## Requirements
package/dist/index.d.ts CHANGED
@@ -26,6 +26,7 @@ import { VizelSlashMenuRendererOptions } from '@vizel/core';
26
26
  import { VizelTheme } from '@vizel/core';
27
27
  import { VizelThemeProviderOptions } from '@vizel/core';
28
28
  import { VizelThemeState } from '@vizel/core';
29
+ import { VizelToolbarAction } from '@vizel/core';
29
30
 
30
31
  declare const __VLS_component: DefineComponent<__VLS_PublicProps, {
31
32
  /** The underlying Tiptap editor instance */
@@ -72,9 +73,20 @@ transformDiagramsOnImport: boolean;
72
73
  editable: boolean;
73
74
  autofocus: boolean | "start" | "end" | "all" | number;
74
75
  enableEmbed: boolean;
76
+ showToolbar: boolean;
75
77
  showBubbleMenu: boolean;
76
78
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
77
79
 
80
+ declare const __VLS_component_10: DefineComponent<VizelToolbarProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<VizelToolbarProps> & Readonly<{}>, {
81
+ showDefaultToolbar: boolean;
82
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
83
+
84
+ declare const __VLS_component_11: DefineComponent<VizelToolbarButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
85
+ click: () => any;
86
+ }, string, PublicProps, Readonly<VizelToolbarButtonProps> & Readonly<{
87
+ onClick?: () => any;
88
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
89
+
78
90
  declare const __VLS_component_2: DefineComponent<VizelBubbleMenuProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<VizelBubbleMenuProps> & Readonly<{}>, {
79
91
  pluginKey: string;
80
92
  showDefaultMenu: boolean;
@@ -125,6 +137,9 @@ declare type __VLS_PublicProps = {
125
137
  declare function __VLS_template(): {
126
138
  attrs: Partial<{}>;
127
139
  slots: {
140
+ toolbar?(_: {
141
+ editor: Editor;
142
+ }): any;
128
143
  'bubble-menu'?(_: {
129
144
  editor: Editor;
130
145
  }): any;
@@ -136,6 +151,26 @@ declare function __VLS_template(): {
136
151
  rootEl: HTMLDivElement;
137
152
  };
138
153
 
154
+ declare function __VLS_template_10(): {
155
+ attrs: Partial<{}>;
156
+ slots: {
157
+ default?(_: {
158
+ editor: Editor;
159
+ }): any;
160
+ };
161
+ refs: {};
162
+ rootEl: any;
163
+ };
164
+
165
+ declare function __VLS_template_11(): {
166
+ attrs: Partial<{}>;
167
+ slots: {
168
+ default?(_: {}): any;
169
+ };
170
+ refs: {};
171
+ rootEl: HTMLButtonElement;
172
+ };
173
+
139
174
  declare function __VLS_template_2(): {
140
175
  attrs: Partial<{}>;
141
176
  slots: {
@@ -223,6 +258,10 @@ declare function __VLS_template_9(): {
223
258
 
224
259
  declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
225
260
 
261
+ declare type __VLS_TemplateResult_10 = ReturnType<typeof __VLS_template_10>;
262
+
263
+ declare type __VLS_TemplateResult_11 = ReturnType<typeof __VLS_template_11>;
264
+
226
265
  declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
227
266
 
228
267
  declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
@@ -245,6 +284,18 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
245
284
  };
246
285
  };
247
286
 
287
+ declare type __VLS_WithTemplateSlots_10<T, S> = T & {
288
+ new (): {
289
+ $slots: S;
290
+ };
291
+ };
292
+
293
+ declare type __VLS_WithTemplateSlots_11<T, S> = T & {
294
+ new (): {
295
+ $slots: S;
296
+ };
297
+ };
298
+
248
299
  declare type __VLS_WithTemplateSlots_2<T, S> = T & {
249
300
  new (): {
250
301
  $slots: S;
@@ -884,6 +935,8 @@ export declare interface VizelProps {
884
935
  features?: VizelFeatureOptions;
885
936
  /** Custom class name for the editor container */
886
937
  class?: string;
938
+ /** Whether to show the toolbar (default: false) */
939
+ showToolbar?: boolean;
887
940
  /** Whether to show the bubble menu (default: true) */
888
941
  showBubbleMenu?: boolean;
889
942
  /** Enable embed option in bubble menu link editor (requires Embed extension) */
@@ -978,4 +1031,50 @@ export declare const VizelThemeProvider: __VLS_WithTemplateSlots_9<typeof __VLS_
978
1031
  export declare interface VizelThemeProviderProps extends VizelThemeProviderOptions {
979
1032
  }
980
1033
 
1034
+ export declare const VizelToolbar: __VLS_WithTemplateSlots_10<typeof __VLS_component_10, __VLS_TemplateResult_10["slots"]>;
1035
+
1036
+ export declare const VizelToolbarButton: __VLS_WithTemplateSlots_11<typeof __VLS_component_11, __VLS_TemplateResult_11["slots"]>;
1037
+
1038
+ export declare interface VizelToolbarButtonProps {
1039
+ /** Whether the button is in active state */
1040
+ isActive?: boolean;
1041
+ /** Whether the button is disabled */
1042
+ disabled?: boolean;
1043
+ /** Tooltip title */
1044
+ title?: string;
1045
+ /** Custom class name */
1046
+ class?: string;
1047
+ /** Action identifier for testing */
1048
+ action?: string;
1049
+ }
1050
+
1051
+ export declare const VizelToolbarDefault: DefineComponent<VizelToolbarDefaultProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<VizelToolbarDefaultProps> & Readonly<{}>, {
1052
+ actions: VizelToolbarAction[];
1053
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
1054
+
1055
+ export declare interface VizelToolbarDefaultProps {
1056
+ /** The editor instance */
1057
+ editor: Editor;
1058
+ /** Custom class name */
1059
+ class?: string;
1060
+ /** Custom toolbar actions (defaults to vizelDefaultToolbarActions) */
1061
+ actions?: VizelToolbarAction[];
1062
+ }
1063
+
1064
+ export declare const VizelToolbarDivider: DefineComponent<VizelToolbarDividerProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<VizelToolbarDividerProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLSpanElement>;
1065
+
1066
+ export declare interface VizelToolbarDividerProps {
1067
+ /** Custom class name */
1068
+ class?: string;
1069
+ }
1070
+
1071
+ export declare interface VizelToolbarProps {
1072
+ /** Editor instance. Falls back to context if not provided. */
1073
+ editor?: Editor | null;
1074
+ /** Custom class name */
1075
+ class?: string;
1076
+ /** Whether to show the default toolbar (default: true). Set to false when using custom slot content. */
1077
+ showDefaultToolbar?: boolean;
1078
+ }
1079
+
981
1080
  export { }
package/dist/index.js CHANGED
@@ -7,16 +7,16 @@ import "./index7.js";
7
7
  import "./index8.js";
8
8
  import "./index9.js";
9
9
  import { default as p } from "./index10.js";
10
- import { default as d } from "./index11.js";
10
+ import { default as s } from "./index11.js";
11
11
  import { default as x } from "./index12.js";
12
12
  import { default as n } from "./index13.js";
13
13
  import { default as S } from "./index14.js";
14
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";
15
+ import { default as h } from "./index16.js";
16
+ import { useVizelContext as T, useVizelContextSafe as E } from "./index17.js";
17
+ import { default as P } from "./index18.js";
18
+ import { default as k } from "./index19.js";
19
+ import { default as w } from "./index20.js";
20
20
  import { provideVizelIcons as A, useVizelIconContext as L } from "./index21.js";
21
21
  import { default as R } from "./index22.js";
22
22
  import { default as j } from "./index23.js";
@@ -28,24 +28,28 @@ import { default as W } from "./index28.js";
28
28
  import { default as Y } from "./index29.js";
29
29
  import { default as _ } from "./index30.js";
30
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";
31
+ import { default as re } from "./index32.js";
32
+ import { default as le } from "./index33.js";
33
+ import { default as fe } from "./index34.js";
34
+ import { default as ue } from "./index35.js";
35
+ import { createVizelSlashMenuRenderer as pe } from "./index36.js";
36
+ import { useVizelAutoSave as se } from "./index37.js";
37
+ import { useVizelEditor as xe } from "./index38.js";
38
+ import { useVizelEditorState as ne } from "./index39.js";
39
+ import { useVizelMarkdown as Se } from "./index40.js";
40
+ import { useVizelState as ce } from "./index41.js";
41
+ import { useVizelTheme as he, useVizelThemeSafe as Be } from "./index42.js";
38
42
  export {
39
43
  p as Vizel,
40
- d as VizelBubbleMenu,
44
+ s as VizelBubbleMenu,
41
45
  x as VizelBubbleMenuButton,
42
46
  n as VizelBubbleMenuColorPicker,
43
47
  S as VizelBubbleMenuDefault,
44
48
  c as VizelBubbleMenuDivider,
45
- v as VizelColorPicker,
46
- C as VizelEditor,
47
- T as VizelEmbedView,
48
- D as VizelIcon,
49
+ h as VizelColorPicker,
50
+ P as VizelEditor,
51
+ k as VizelEmbedView,
52
+ w as VizelIcon,
49
53
  R as VizelIconProvider,
50
54
  j as VizelLinkEditor,
51
55
  F as VizelNodeSelector,
@@ -56,16 +60,20 @@ export {
56
60
  Y as VizelSlashMenuEmpty,
57
61
  _ as VizelSlashMenuItem,
58
62
  ee as VizelThemeProvider,
59
- re as createVizelSlashMenuRenderer,
63
+ re as VizelToolbar,
64
+ le as VizelToolbarButton,
65
+ fe as VizelToolbarDefault,
66
+ ue as VizelToolbarDivider,
67
+ pe as createVizelSlashMenuRenderer,
60
68
  A as provideVizelIcons,
61
- le as useVizelAutoSave,
62
- E as useVizelContext,
63
- I as useVizelContextSafe,
64
- ie as useVizelEditor,
65
- ue as useVizelEditorState,
69
+ se as useVizelAutoSave,
70
+ T as useVizelContext,
71
+ E as useVizelContextSafe,
72
+ xe as useVizelEditor,
73
+ ne as useVizelEditorState,
66
74
  L as useVizelIconContext,
67
- pe as useVizelMarkdown,
68
- de as useVizelState,
69
- xe as useVizelTheme,
70
- ze as useVizelThemeSafe
75
+ Se as useVizelMarkdown,
76
+ ce as useVizelState,
77
+ he as useVizelTheme,
78
+ Be as useVizelThemeSafe
71
79
  };
package/dist/index10.js CHANGED
@@ -1,11 +1,12 @@
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";
1
+ import { defineComponent as B, mergeModels as c, useModel as M, useSlots as g, watch as C, createElementBlock as z, openBlock as n, normalizeClass as $, createBlock as i, createCommentVNode as u, renderSlot as m, unref as t, withCtx as p } from "vue";
2
+ import { getVizelMarkdown as k, setVizelMarkdown as D } from "@vizel/core";
3
+ import { useVizelEditor as E } from "./index38.js";
4
+ import w from "./index11.js";
5
5
  import U from "./index18.js";
6
- const F = /* @__PURE__ */ B({
6
+ import v from "./index32.js";
7
+ const N = /* @__PURE__ */ B({
7
8
  __name: "Vizel",
8
- props: /* @__PURE__ */ m({
9
+ props: /* @__PURE__ */ c({
9
10
  initialContent: {},
10
11
  initialMarkdown: {},
11
12
  transformDiagramsOnImport: { type: Boolean, default: !0 },
@@ -14,26 +15,27 @@ const F = /* @__PURE__ */ B({
14
15
  autofocus: { type: [Boolean, String, Number], default: !1 },
15
16
  features: {},
16
17
  class: {},
18
+ showToolbar: { type: Boolean, default: !1 },
17
19
  showBubbleMenu: { type: Boolean, default: !0 },
18
20
  enableEmbed: { type: Boolean, default: !1 }
19
21
  }, {
20
22
  markdown: {},
21
23
  markdownModifiers: {}
22
24
  }),
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 },
25
+ emits: /* @__PURE__ */ c(["update", "create", "destroy", "selectionUpdate", "focus", "blur"], ["update:markdown"]),
26
+ setup(r, { expose: y, emit: h }) {
27
+ const a = r, l = h, d = M(r, "markdown"), f = g();
28
+ let s = !1;
29
+ const o = E({
30
+ ...a.initialContent !== void 0 && { initialContent: a.initialContent },
31
+ ...a.initialMarkdown !== void 0 && { initialMarkdown: a.initialMarkdown },
32
+ transformDiagramsOnImport: a.transformDiagramsOnImport,
33
+ ...a.placeholder !== void 0 && { placeholder: a.placeholder },
34
+ editable: a.editable,
35
+ autofocus: a.autofocus,
36
+ ...a.features !== void 0 && { features: a.features },
35
37
  onUpdate: (e) => {
36
- l("update", e), !d && i.value !== void 0 && (i.value = b(e.editor));
38
+ l("update", e), !s && d.value !== void 0 && (d.value = k(e.editor));
37
39
  },
38
40
  onCreate: (e) => l("create", e),
39
41
  onDestroy: () => l("destroy"),
@@ -41,48 +43,60 @@ const F = /* @__PURE__ */ B({
41
43
  onFocus: (e) => l("focus", e),
42
44
  onBlur: (e) => l("blur", e)
43
45
  });
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({
46
+ return C(d, (e) => {
47
+ if (e === void 0 || !o.value) return;
48
+ const b = k(o.value);
49
+ e !== b && (s = !0, D(o.value, e, {
50
+ transformDiagrams: a.transformDiagramsOnImport
51
+ }), s = !1);
52
+ }), y({
51
53
  /** The underlying Tiptap editor instance */
52
54
  get editor() {
53
- return t.value;
55
+ return o.value;
54
56
  },
55
57
  /**
56
58
  * Get the underlying Tiptap editor instance
57
59
  * @deprecated Use the `editor` property instead
58
60
  */
59
- getEditor: () => t.value
60
- }), (e, u) => (n(), h("div", {
61
- class: C(["vizel-root", e.$props.class]),
61
+ getEditor: () => o.value
62
+ }), (e, b) => (n(), z("div", {
63
+ class: $(["vizel-root", e.$props.class]),
62
64
  "data-vizel-root": ""
63
65
  }, [
64
- a(t) ? (n(), s(U, {
66
+ r.showToolbar && t(o) && t(f).toolbar ? (n(), i(v, {
65
67
  key: 0,
66
- editor: a(t)
67
- }, null, 8, ["editor"])) : f("", !0),
68
- r.showBubbleMenu && a(t) && a(w)["bubble-menu"] ? (n(), s(p, {
68
+ editor: t(o)
69
+ }, {
70
+ default: p(() => [
71
+ m(e.$slots, "toolbar", { editor: t(o) })
72
+ ]),
73
+ _: 3
74
+ }, 8, ["editor"])) : r.showToolbar && t(o) ? (n(), i(v, {
69
75
  key: 1,
70
- editor: a(t),
76
+ editor: t(o)
77
+ }, null, 8, ["editor"])) : u("", !0),
78
+ t(o) ? (n(), i(U, {
79
+ key: 2,
80
+ editor: t(o)
81
+ }, null, 8, ["editor"])) : u("", !0),
82
+ r.showBubbleMenu && t(o) && t(f)["bubble-menu"] ? (n(), i(w, {
83
+ key: 3,
84
+ editor: t(o),
71
85
  "enable-embed": r.enableEmbed ?? !1
72
86
  }, {
73
- default: z(() => [
74
- c(e.$slots, "bubble-menu", { editor: a(t) })
87
+ default: p(() => [
88
+ m(e.$slots, "bubble-menu", { editor: t(o) })
75
89
  ]),
76
90
  _: 3
77
- }, 8, ["editor", "enable-embed"])) : r.showBubbleMenu && a(t) ? (n(), s(p, {
78
- key: 2,
79
- editor: a(t),
91
+ }, 8, ["editor", "enable-embed"])) : r.showBubbleMenu && t(o) ? (n(), i(w, {
92
+ key: 4,
93
+ editor: t(o),
80
94
  "enable-embed": r.enableEmbed ?? !1
81
- }, null, 8, ["editor", "enable-embed"])) : f("", !0),
82
- c(e.$slots, "default", { editor: a(t) })
95
+ }, null, 8, ["editor", "enable-embed"])) : u("", !0),
96
+ m(e.$slots, "default", { editor: t(o) })
83
97
  ], 2));
84
98
  }
85
99
  });
86
100
  export {
87
- F as default
101
+ N as default
88
102
  };
package/dist/index14.js CHANGED
@@ -1,108 +1,112 @@
1
- import { defineComponent as $, computed as l, ref as A, createBlock as B, createElementBlock as _, openBlock as u, normalizeClass as y, createVNode as i, withCtx as r } from "vue";
2
- import { useVizelState as E } from "./index37.js";
1
+ import { defineComponent as A, computed as l, ref as B, createBlock as _, createElementBlock as y, openBlock as c, normalizeClass as E, createVNode as e, withCtx as r } from "vue";
2
+ import { useVizelState as S } from "./index41.js";
3
3
  import a from "./index12.js";
4
- import c from "./index13.js";
4
+ import v from "./index13.js";
5
+ import u from "./index15.js";
5
6
  import d from "./index20.js";
6
- import S from "./index23.js";
7
- import z from "./index24.js";
8
- const D = /* @__PURE__ */ $({
7
+ import z from "./index23.js";
8
+ import I from "./index24.js";
9
+ const M = /* @__PURE__ */ A({
9
10
  __name: "VizelBubbleMenuDefault",
10
11
  props: {
11
12
  editor: {},
12
13
  class: {},
13
14
  enableEmbed: { type: Boolean }
14
15
  },
15
- setup(v) {
16
- const e = v, o = E(() => e.editor), m = l(() => (o.value, e.editor.isActive("bold"))), f = l(() => (o.value, e.editor.isActive("italic"))), k = l(() => (o.value, e.editor.isActive("strike"))), p = l(() => (o.value, e.editor.isActive("underline"))), C = l(() => (o.value, e.editor.isActive("code"))), b = l(() => (o.value, e.editor.isActive("link"))), s = A(!1);
17
- return (g, t) => s.value ? (u(), B(S, {
16
+ setup(m) {
17
+ const i = m, o = S(() => i.editor), f = l(() => (o.value, i.editor.isActive("bold"))), k = l(() => (o.value, i.editor.isActive("italic"))), p = l(() => (o.value, i.editor.isActive("strike"))), C = l(() => (o.value, i.editor.isActive("underline"))), b = l(() => (o.value, i.editor.isActive("code"))), g = l(() => (o.value, i.editor.isActive("link"))), s = B(!1);
18
+ return ($, t) => s.value ? (c(), _(z, {
18
19
  key: 0,
19
- editor: e.editor,
20
- "enable-embed": e.enableEmbed,
20
+ editor: i.editor,
21
+ "enable-embed": i.enableEmbed,
21
22
  onClose: t[0] || (t[0] = (n) => s.value = !1)
22
- }, null, 8, ["editor", "enable-embed"])) : (u(), _("div", {
23
+ }, null, 8, ["editor", "enable-embed"])) : (c(), y("div", {
23
24
  key: 1,
24
- class: y(["vizel-bubble-menu-toolbar", g.$props.class])
25
+ class: E(["vizel-bubble-menu-toolbar", $.$props.class])
25
26
  }, [
26
- i(z, {
27
- editor: e.editor
27
+ e(I, {
28
+ editor: i.editor
28
29
  }, null, 8, ["editor"]),
29
- i(a, {
30
+ e(u),
31
+ e(a, {
30
32
  action: "bold",
31
- "is-active": m.value,
33
+ "is-active": f.value,
32
34
  title: "Bold (Cmd+B)",
33
- onClick: t[1] || (t[1] = (n) => e.editor.chain().focus().toggleBold().run())
35
+ onClick: t[1] || (t[1] = (n) => i.editor.chain().focus().toggleBold().run())
34
36
  }, {
35
37
  default: r(() => [
36
- i(d, { name: "bold" })
38
+ e(d, { name: "bold" })
37
39
  ]),
38
40
  _: 1
39
41
  }, 8, ["is-active"]),
40
- i(a, {
42
+ e(a, {
41
43
  action: "italic",
42
- "is-active": f.value,
44
+ "is-active": k.value,
43
45
  title: "Italic (Cmd+I)",
44
- onClick: t[2] || (t[2] = (n) => e.editor.chain().focus().toggleItalic().run())
46
+ onClick: t[2] || (t[2] = (n) => i.editor.chain().focus().toggleItalic().run())
45
47
  }, {
46
48
  default: r(() => [
47
- i(d, { name: "italic" })
49
+ e(d, { name: "italic" })
48
50
  ]),
49
51
  _: 1
50
52
  }, 8, ["is-active"]),
51
- i(a, {
53
+ e(a, {
52
54
  action: "strike",
53
- "is-active": k.value,
55
+ "is-active": p.value,
54
56
  title: "Strikethrough",
55
- onClick: t[3] || (t[3] = (n) => e.editor.chain().focus().toggleStrike().run())
57
+ onClick: t[3] || (t[3] = (n) => i.editor.chain().focus().toggleStrike().run())
56
58
  }, {
57
59
  default: r(() => [
58
- i(d, { name: "strikethrough" })
60
+ e(d, { name: "strikethrough" })
59
61
  ]),
60
62
  _: 1
61
63
  }, 8, ["is-active"]),
62
- i(a, {
64
+ e(a, {
63
65
  action: "underline",
64
- "is-active": p.value,
66
+ "is-active": C.value,
65
67
  title: "Underline (Cmd+U)",
66
- onClick: t[4] || (t[4] = (n) => e.editor.chain().focus().toggleUnderline().run())
68
+ onClick: t[4] || (t[4] = (n) => i.editor.chain().focus().toggleUnderline().run())
67
69
  }, {
68
70
  default: r(() => [
69
- i(d, { name: "underline" })
71
+ e(d, { name: "underline" })
70
72
  ]),
71
73
  _: 1
72
74
  }, 8, ["is-active"]),
73
- i(a, {
75
+ e(a, {
74
76
  action: "code",
75
- "is-active": C.value,
77
+ "is-active": b.value,
76
78
  title: "Code (Cmd+E)",
77
- onClick: t[5] || (t[5] = (n) => e.editor.chain().focus().toggleCode().run())
79
+ onClick: t[5] || (t[5] = (n) => i.editor.chain().focus().toggleCode().run())
78
80
  }, {
79
81
  default: r(() => [
80
- i(d, { name: "code" })
82
+ e(d, { name: "code" })
81
83
  ]),
82
84
  _: 1
83
85
  }, 8, ["is-active"]),
84
- i(a, {
86
+ e(u),
87
+ e(a, {
85
88
  action: "link",
86
- "is-active": b.value,
89
+ "is-active": g.value,
87
90
  title: "Link (Cmd+K)",
88
91
  onClick: t[6] || (t[6] = (n) => s.value = !0)
89
92
  }, {
90
93
  default: r(() => [
91
- i(d, { name: "link" })
94
+ e(d, { name: "link" })
92
95
  ]),
93
96
  _: 1
94
97
  }, 8, ["is-active"]),
95
- i(c, {
96
- editor: e.editor,
98
+ e(u),
99
+ e(v, {
100
+ editor: i.editor,
97
101
  type: "textColor"
98
102
  }, null, 8, ["editor"]),
99
- i(c, {
100
- editor: e.editor,
103
+ e(v, {
104
+ editor: i.editor,
101
105
  type: "highlight"
102
106
  }, null, 8, ["editor"])
103
107
  ], 2));
104
108
  }
105
109
  });
106
110
  export {
107
- D as default
111
+ M as default
108
112
  };
package/dist/index2.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Mark as a, markPasteRule as r, markInputRule as s, mergeAttributes as o } from "@tiptap/core";
2
- import { createElement as n } from "./index39.js";
2
+ import { createElement as n } from "./index43.js";
3
3
  var d = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, i = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, l = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, u = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g;
4
4
  a.create({
5
5
  name: "bold",
package/dist/index24.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as E, ref as i, computed as m, onMounted as V, onUnmounted as A, watch as $, nextTick as S, createElementBlock as r, openBlock as c, normalizeClass as D, createElementVNode as l, createCommentVNode as g, createVNode as d, toDisplayString as N, Fragment as L, renderList as R } from "vue";
2
2
  import { vizelDefaultNodeTypes as B, getVizelActiveNodeType as K } from "@vizel/core";
3
- import { useVizelState as M } from "./index37.js";
3
+ import { useVizelState as M } from "./index41.js";
4
4
  import u from "./index20.js";
5
5
  const I = ["aria-expanded", "aria-label"], O = { class: "vizel-node-selector-icon" }, U = { class: "vizel-node-selector-label" }, F = {
6
6
  class: "vizel-node-selector-chevron",
package/dist/index31.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as i, ref as n, computed as T, provide as h, onMounted as d, watch as c, onBeforeUnmount as f, renderSlot as p } from "vue";
2
2
  import { VIZEL_DEFAULT_THEME_STORAGE_KEY as E, VIZEL_DEFAULT_THEME as g, getStoredVizelTheme as _, getVizelSystemTheme as v, resolveVizelTheme as S, applyVizelTheme as s, createVizelSystemThemeListener as V, storeVizelTheme as y } from "@vizel/core";
3
- import { VIZEL_THEME_CONTEXT_KEY as z } from "./index60.js";
3
+ import { VIZEL_THEME_CONTEXT_KEY as z } from "./index68.js";
4
4
  const b = /* @__PURE__ */ i({
5
5
  __name: "VizelThemeProvider",
6
6
  props: {
package/dist/index32.js CHANGED
@@ -1,38 +1,30 @@
1
- import { handleVizelSuggestionEscape as m, createVizelSuggestionContainer as c } from "@vizel/core";
2
- import { ref as l, createApp as s, h as d } from "vue";
3
- import "@iconify/vue";
4
- import f from "./index28.js";
5
- function R(u = {}) {
6
- return {
7
- render: () => {
8
- let t = null, n = null;
9
- const r = l(null), o = l([]), a = l(null);
10
- return {
11
- onStart: (e) => {
12
- o.value = e.items, a.value = e.command, n = c(), t = s({
13
- setup() {
14
- return () => d(f, {
15
- items: o.value,
16
- ...u.className !== void 0 && { class: u.className },
17
- ref: r,
18
- onCommand: (i) => {
19
- a.value?.(i);
20
- }
21
- });
22
- }
23
- }), t.mount(n.menuContainer), n.updatePosition(e.clientRect);
24
- },
25
- onUpdate: (e) => {
26
- o.value = e.items, a.value = e.command, n?.updatePosition(e.clientRect);
27
- },
28
- onKeyDown: (e) => m(e.event) ? !0 : r.value?.onKeyDown(e.event) ?? !1,
29
- onExit: () => {
30
- t?.unmount(), n?.destroy(), t = null, n = null;
31
- }
32
- };
33
- }
34
- };
35
- }
1
+ import { defineComponent as s, computed as i, createElementBlock as u, createCommentVNode as r, openBlock as l, normalizeClass as c, renderSlot as m, createBlock as d } from "vue";
2
+ import { useVizelContextSafe as p } from "./index17.js";
3
+ import f from "./index34.js";
4
+ const z = /* @__PURE__ */ s({
5
+ __name: "VizelToolbar",
6
+ props: {
7
+ editor: {},
8
+ class: {},
9
+ showDefaultToolbar: { type: Boolean, default: !0 }
10
+ },
11
+ setup(o) {
12
+ const a = o, n = p(), e = i(() => a.editor ?? n?.() ?? null);
13
+ return (t, b) => e.value ? (l(), u("div", {
14
+ key: 0,
15
+ class: c(["vizel-toolbar", t.$props.class]),
16
+ role: "toolbar",
17
+ "aria-label": "Formatting"
18
+ }, [
19
+ m(t.$slots, "default", { editor: e.value }, () => [
20
+ o.showDefaultToolbar ? (l(), d(f, {
21
+ key: 0,
22
+ editor: e.value
23
+ }, null, 8, ["editor"])) : r("", !0)
24
+ ])
25
+ ], 2)) : r("", !0);
26
+ }
27
+ });
36
28
  export {
37
- R as createVizelSlashMenuRenderer
29
+ z as default
38
30
  };