@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/index28.js
CHANGED
|
@@ -1,46 +1,120 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
1
|
+
import { defineComponent as A, useSlots as K, ref as C, computed as z, watch as $, nextTick as M, createElementBlock as u, openBlock as r, normalizeClass as O, Fragment as k, renderSlot as d, createBlock as _, unref as g, renderList as w, createElementVNode as T, toDisplayString as F } from "vue";
|
|
2
|
+
import { groupVizelSlashCommands as H } from "@vizel/core";
|
|
3
|
+
import L from "./index29.js";
|
|
4
|
+
import S from "./index30.js";
|
|
5
|
+
const N = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "vizel-slash-menu-group",
|
|
8
|
+
"data-vizel-slash-menu-group": ""
|
|
9
|
+
}, R = { class: "vizel-slash-menu-group-header" }, P = /* @__PURE__ */ A({
|
|
10
|
+
__name: "VizelSlashMenu",
|
|
11
|
+
props: {
|
|
12
|
+
items: {},
|
|
13
|
+
class: {},
|
|
14
|
+
showGroups: { type: Boolean, default: !0 },
|
|
15
|
+
groupOrder: {}
|
|
16
|
+
},
|
|
17
|
+
emits: ["command"],
|
|
18
|
+
setup(b, { expose: D, emit: G }) {
|
|
19
|
+
const m = b, B = G, p = K(), n = C(0), y = C([]), c = z(() => !m.showGroups || m.items.length <= 5 ? [{ name: "", items: m.items }] : H(m.items, m.groupOrder)), f = z(() => c.value.flatMap((e) => e.items));
|
|
20
|
+
$(
|
|
21
|
+
() => m.items,
|
|
22
|
+
() => {
|
|
23
|
+
n.value = 0, y.value = [];
|
|
24
|
+
}
|
|
25
|
+
), $(n, async (e) => {
|
|
26
|
+
await M();
|
|
27
|
+
const a = y.value[e];
|
|
28
|
+
a && a.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
29
|
+
});
|
|
30
|
+
function v(e) {
|
|
31
|
+
const a = f.value[e];
|
|
32
|
+
a && B("command", a);
|
|
33
|
+
}
|
|
34
|
+
function E() {
|
|
35
|
+
if (c.value.length <= 1) return;
|
|
36
|
+
let e = 0, a = 0;
|
|
37
|
+
for (let t = 0; t < c.value.length; t++) {
|
|
38
|
+
const s = c.value[t];
|
|
39
|
+
if (s) {
|
|
40
|
+
if (n.value < a + s.items.length) {
|
|
41
|
+
e = t;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
a += s.items.length;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const i = (e + 1) % c.value.length;
|
|
48
|
+
let l = 0;
|
|
49
|
+
for (let t = 0; t < i; t++) {
|
|
50
|
+
const s = c.value[t];
|
|
51
|
+
s && (l += s.items.length);
|
|
52
|
+
}
|
|
53
|
+
n.value = l;
|
|
54
|
+
}
|
|
55
|
+
function V(e) {
|
|
56
|
+
return e.key === "ArrowUp" ? (n.value = (n.value + f.value.length - 1) % f.value.length, !0) : e.key === "ArrowDown" ? (n.value = (n.value + 1) % f.value.length, !0) : e.key === "Enter" ? (v(n.value), !0) : e.key === "Tab" ? (e.preventDefault(), E(), !0) : !1;
|
|
57
|
+
}
|
|
58
|
+
D({
|
|
59
|
+
onKeyDown: V
|
|
60
|
+
});
|
|
61
|
+
function o(e, a) {
|
|
62
|
+
let i = 0;
|
|
63
|
+
for (let l = 0; l < e; l++) {
|
|
64
|
+
const t = c.value[l];
|
|
65
|
+
t && (i += t.items.length);
|
|
66
|
+
}
|
|
67
|
+
return i + a;
|
|
68
|
+
}
|
|
69
|
+
return (e, a) => (r(), u("div", {
|
|
70
|
+
class: O(["vizel-slash-menu", e.$props.class]),
|
|
71
|
+
"data-vizel-slash-menu": ""
|
|
72
|
+
}, [
|
|
73
|
+
f.value.length === 0 ? (r(), u(k, { key: 0 }, [
|
|
74
|
+
g(p).empty ? d(e.$slots, "empty", { key: 0 }) : (r(), _(L, { key: 1 }))
|
|
75
|
+
], 64)) : (r(!0), u(k, { key: 1 }, w(c.value, (i, l) => (r(), u(k, {
|
|
76
|
+
key: i.name || l
|
|
77
|
+
}, [
|
|
78
|
+
i.name ? (r(), u("div", N, [
|
|
79
|
+
T("div", R, F(i.name), 1),
|
|
80
|
+
(r(!0), u(k, null, w(i.items, (t, s) => (r(), u("div", {
|
|
81
|
+
key: t.title,
|
|
82
|
+
ref_for: !0,
|
|
83
|
+
ref: (h) => y.value[o(l, s)] = h
|
|
84
|
+
}, [
|
|
85
|
+
g(p).item ? d(e.$slots, "item", {
|
|
86
|
+
key: 0,
|
|
87
|
+
item: t,
|
|
88
|
+
isSelected: o(l, s) === n.value,
|
|
89
|
+
onClick: () => v(o(l, s))
|
|
90
|
+
}) : (r(), _(S, {
|
|
91
|
+
key: 1,
|
|
92
|
+
item: t,
|
|
93
|
+
"is-selected": o(l, s) === n.value,
|
|
94
|
+
onClick: (h) => v(o(l, s))
|
|
95
|
+
}, null, 8, ["item", "is-selected", "onClick"]))
|
|
96
|
+
]))), 128))
|
|
97
|
+
])) : (r(!0), u(k, { key: 1 }, w(i.items, (t, s) => (r(), u("div", {
|
|
98
|
+
key: t.title,
|
|
99
|
+
ref_for: !0,
|
|
100
|
+
ref: (h) => y.value[o(l, s)] = h
|
|
101
|
+
}, [
|
|
102
|
+
g(p).item ? d(e.$slots, "item", {
|
|
103
|
+
key: 0,
|
|
104
|
+
item: t,
|
|
105
|
+
isSelected: o(l, s) === n.value,
|
|
106
|
+
onClick: () => v(o(l, s))
|
|
107
|
+
}) : (r(), _(S, {
|
|
108
|
+
key: 1,
|
|
109
|
+
item: t,
|
|
110
|
+
"is-selected": o(l, s) === n.value,
|
|
111
|
+
onClick: (h) => v(o(l, s))
|
|
112
|
+
}, null, 8, ["item", "is-selected", "onClick"]))
|
|
113
|
+
]))), 128))
|
|
114
|
+
], 64))), 128))
|
|
115
|
+
], 2));
|
|
116
|
+
}
|
|
117
|
+
});
|
|
44
118
|
export {
|
|
45
|
-
|
|
119
|
+
P as default
|
|
46
120
|
};
|
package/dist/index29.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { defineComponent as a, useSlots as o, createElementBlock as s, openBlock as t, normalizeClass as n, renderSlot as r, unref as p, Fragment as m, createTextVNode as u } from "vue";
|
|
2
|
+
const f = /* @__PURE__ */ a({
|
|
3
|
+
__name: "VizelSlashMenuEmpty",
|
|
4
|
+
props: {
|
|
5
|
+
class: {}
|
|
6
|
+
},
|
|
7
|
+
setup(c) {
|
|
8
|
+
const l = o();
|
|
9
|
+
return (e, d) => (t(), s("div", {
|
|
10
|
+
class: n(["vizel-slash-menu-empty", e.$props.class]),
|
|
11
|
+
"data-vizel-slash-menu-empty": ""
|
|
12
|
+
}, [
|
|
13
|
+
p(l).default ? r(e.$slots, "default", { key: 0 }) : (t(), s(m, { key: 1 }, [
|
|
14
|
+
u("No results")
|
|
15
|
+
], 64))
|
|
16
|
+
], 2));
|
|
7
17
|
}
|
|
8
|
-
|
|
9
|
-
n && n !== t && n.off("transaction", o), n = t ?? null, n && n.on("transaction", o);
|
|
10
|
-
}
|
|
11
|
-
return u(
|
|
12
|
-
i,
|
|
13
|
-
(t) => {
|
|
14
|
-
r(t);
|
|
15
|
-
},
|
|
16
|
-
{ immediate: !0 }
|
|
17
|
-
), f(() => {
|
|
18
|
-
n && n.off("transaction", o);
|
|
19
|
-
}), e;
|
|
20
|
-
}
|
|
18
|
+
});
|
|
21
19
|
export {
|
|
22
|
-
|
|
20
|
+
f as default
|
|
23
21
|
};
|
package/dist/index3.js
CHANGED
|
@@ -1,61 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class: {},
|
|
10
|
-
showDefaultMenu: { type: Boolean, default: !0 },
|
|
11
|
-
pluginKey: { default: "vizelBubbleMenu" },
|
|
12
|
-
updateDelay: { default: 100 },
|
|
13
|
-
shouldShow: {},
|
|
14
|
-
enableEmbed: { type: Boolean }
|
|
1
|
+
import { Mark as r, markPasteRule as n, markInputRule as a, mergeAttributes as d } from "@tiptap/core";
|
|
2
|
+
var o = /(^|[^`])`([^`]+)`(?!`)$/, u = /(^|[^`])`([^`]+)`(?!`)/g;
|
|
3
|
+
r.create({
|
|
4
|
+
name: "code",
|
|
5
|
+
addOptions() {
|
|
6
|
+
return {
|
|
7
|
+
HTMLAttributes: {}
|
|
8
|
+
};
|
|
15
9
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
}, null, 8, ["editor", "enable-embed"])) : a("", !0)
|
|
56
|
-
], 2)) : a("", !0);
|
|
10
|
+
excludes: "_",
|
|
11
|
+
code: !0,
|
|
12
|
+
exitable: !0,
|
|
13
|
+
parseHTML() {
|
|
14
|
+
return [{ tag: "code" }];
|
|
15
|
+
},
|
|
16
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
17
|
+
return ["code", d(this.options.HTMLAttributes, e), 0];
|
|
18
|
+
},
|
|
19
|
+
markdownTokenName: "codespan",
|
|
20
|
+
parseMarkdown: (e, t) => t.applyMark("code", [{ type: "text", text: e.text || "" }]),
|
|
21
|
+
renderMarkdown: (e, t) => e.content ? `\`${t.renderChildren(e.content)}\`` : "",
|
|
22
|
+
addCommands() {
|
|
23
|
+
return {
|
|
24
|
+
setCode: () => ({ commands: e }) => e.setMark(this.name),
|
|
25
|
+
toggleCode: () => ({ commands: e }) => e.toggleMark(this.name),
|
|
26
|
+
unsetCode: () => ({ commands: e }) => e.unsetMark(this.name)
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
addKeyboardShortcuts() {
|
|
30
|
+
return {
|
|
31
|
+
"Mod-e": () => this.editor.commands.toggleCode()
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
addInputRules() {
|
|
35
|
+
return [
|
|
36
|
+
a({
|
|
37
|
+
find: o,
|
|
38
|
+
type: this.type
|
|
39
|
+
})
|
|
40
|
+
];
|
|
41
|
+
},
|
|
42
|
+
addPasteRules() {
|
|
43
|
+
return [
|
|
44
|
+
n({
|
|
45
|
+
find: u,
|
|
46
|
+
type: this.type
|
|
47
|
+
})
|
|
48
|
+
];
|
|
57
49
|
}
|
|
58
50
|
});
|
|
59
51
|
export {
|
|
60
|
-
|
|
52
|
+
o as inputRegex,
|
|
53
|
+
u as pasteRegex
|
|
61
54
|
};
|
package/dist/index30.js
CHANGED
|
@@ -1,15 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { defineComponent as r, createElementBlock as t, openBlock as s, normalizeClass as u, createElementVNode as l, createCommentVNode as k, createVNode as v, Fragment as c, renderList as z, unref as f, toDisplayString as n, createTextVNode as y } from "vue";
|
|
2
|
+
import { splitVizelTextByMatches as g } from "@vizel/core";
|
|
3
|
+
import x from "./index20.js";
|
|
4
|
+
const V = ["data-selected"], p = { class: "vizel-slash-menu-icon" }, S = { class: "vizel-slash-menu-text" }, _ = { class: "vizel-slash-menu-title" }, B = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "vizel-slash-menu-highlight"
|
|
7
|
+
}, C = { class: "vizel-slash-menu-description" }, M = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "vizel-slash-menu-shortcut"
|
|
10
|
+
}, E = /* @__PURE__ */ r({
|
|
11
|
+
__name: "VizelSlashMenuItem",
|
|
12
|
+
props: {
|
|
13
|
+
item: {},
|
|
14
|
+
isSelected: { type: Boolean },
|
|
15
|
+
class: {},
|
|
16
|
+
titleMatches: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["click"],
|
|
19
|
+
setup(e, { emit: o }) {
|
|
20
|
+
const m = o;
|
|
21
|
+
return (d, a) => (s(), t("button", {
|
|
22
|
+
type: "button",
|
|
23
|
+
class: u([
|
|
24
|
+
"vizel-slash-menu-item",
|
|
25
|
+
{ "is-selected": e.isSelected },
|
|
26
|
+
d.$props.class
|
|
27
|
+
]),
|
|
28
|
+
"data-selected": e.isSelected || void 0,
|
|
29
|
+
onClick: a[0] || (a[0] = (i) => m("click"))
|
|
30
|
+
}, [
|
|
31
|
+
l("span", p, [
|
|
32
|
+
v(x, {
|
|
33
|
+
name: e.item.icon
|
|
34
|
+
}, null, 8, ["name"])
|
|
35
|
+
]),
|
|
36
|
+
l("div", S, [
|
|
37
|
+
l("span", _, [
|
|
38
|
+
(s(!0), t(c, null, z(f(g)(e.item.title, e.titleMatches), (i, h) => (s(), t(c, { key: h }, [
|
|
39
|
+
i.highlight ? (s(), t("mark", B, n(i.text), 1)) : (s(), t(c, { key: 1 }, [
|
|
40
|
+
y(n(i.text), 1)
|
|
41
|
+
], 64))
|
|
42
|
+
], 64))), 128))
|
|
43
|
+
]),
|
|
44
|
+
l("span", C, n(e.item.description), 1)
|
|
45
|
+
]),
|
|
46
|
+
e.item.shortcut ? (s(), t("span", M, n(e.item.shortcut), 1)) : k("", !0)
|
|
47
|
+
], 10, V));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
12
50
|
export {
|
|
13
|
-
|
|
14
|
-
u as useVizelThemeSafe
|
|
51
|
+
E as default
|
|
15
52
|
};
|
package/dist/index31.js
CHANGED
|
@@ -1,4 +1,43 @@
|
|
|
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
|
+
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 "./index40.js";
|
|
4
|
+
const b = /* @__PURE__ */ i({
|
|
5
|
+
__name: "VizelThemeProvider",
|
|
6
|
+
props: {
|
|
7
|
+
defaultTheme: { default: g },
|
|
8
|
+
storageKey: { default: E },
|
|
9
|
+
targetSelector: {},
|
|
10
|
+
disableTransitionOnChange: { type: Boolean, default: !1 }
|
|
11
|
+
},
|
|
12
|
+
setup(m) {
|
|
13
|
+
const t = m, r = n(_(t.storageKey) ?? t.defaultTheme), o = n(v()), a = T(() => S(r.value, o.value));
|
|
14
|
+
function u(e) {
|
|
15
|
+
r.value = e, y(t.storageKey, e);
|
|
16
|
+
}
|
|
17
|
+
h(z, {
|
|
18
|
+
get theme() {
|
|
19
|
+
return r.value;
|
|
20
|
+
},
|
|
21
|
+
get resolvedTheme() {
|
|
22
|
+
return a.value;
|
|
23
|
+
},
|
|
24
|
+
get systemTheme() {
|
|
25
|
+
return o.value;
|
|
26
|
+
},
|
|
27
|
+
setTheme: u
|
|
28
|
+
});
|
|
29
|
+
let l = null;
|
|
30
|
+
return d(() => {
|
|
31
|
+
s(a.value, t.targetSelector, t.disableTransitionOnChange), l = V((e) => {
|
|
32
|
+
o.value = e;
|
|
33
|
+
});
|
|
34
|
+
}), c(a, (e) => {
|
|
35
|
+
s(e, t.targetSelector, t.disableTransitionOnChange);
|
|
36
|
+
}), f(() => {
|
|
37
|
+
l && l();
|
|
38
|
+
}), (e, C) => p(e.$slots, "default");
|
|
39
|
+
}
|
|
40
|
+
});
|
|
2
41
|
export {
|
|
3
|
-
|
|
42
|
+
b as default
|
|
4
43
|
};
|
package/dist/index32.js
CHANGED
|
@@ -1,4 +1,38 @@
|
|
|
1
|
-
import
|
|
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
|
+
}
|
|
2
36
|
export {
|
|
3
|
-
|
|
37
|
+
R as createVizelSlashMenuRenderer
|
|
4
38
|
};
|
package/dist/index33.js
CHANGED
|
@@ -1,4 +1,48 @@
|
|
|
1
|
-
import f from "
|
|
1
|
+
import { VIZEL_DEFAULT_AUTO_SAVE_OPTIONS as h, createVizelAutoSaveHandlers as f } from "@vizel/core";
|
|
2
|
+
import { reactive as i, onMounted as U, watch as S, onBeforeUnmount as C, computed as t } from "vue";
|
|
3
|
+
function A(o, u = {}) {
|
|
4
|
+
const r = { ...h, ...u }, a = i({
|
|
5
|
+
status: "saved",
|
|
6
|
+
hasUnsavedChanges: !1,
|
|
7
|
+
lastSaved: null,
|
|
8
|
+
error: null
|
|
9
|
+
});
|
|
10
|
+
let n = null, e = null;
|
|
11
|
+
const l = (s) => {
|
|
12
|
+
s.status !== void 0 && (a.status = s.status), s.hasUnsavedChanges !== void 0 && (a.hasUnsavedChanges = s.hasUnsavedChanges), s.lastSaved !== void 0 && (a.lastSaved = s.lastSaved), s.error !== void 0 && (a.error = s.error);
|
|
13
|
+
}, d = () => {
|
|
14
|
+
const s = o();
|
|
15
|
+
if (n && e && (n.off("update", e.handleUpdate), e.cancel()), n = s ?? null, !(n && r.enabled)) {
|
|
16
|
+
e = null;
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
e = f(() => n, r, l), n.on("update", e.handleUpdate);
|
|
20
|
+
};
|
|
21
|
+
U(() => {
|
|
22
|
+
d();
|
|
23
|
+
}), S(
|
|
24
|
+
() => o(),
|
|
25
|
+
() => {
|
|
26
|
+
d();
|
|
27
|
+
}
|
|
28
|
+
), C(() => {
|
|
29
|
+
n && e && (n.off("update", e.handleUpdate), e.cancel());
|
|
30
|
+
});
|
|
31
|
+
async function v() {
|
|
32
|
+
await e?.saveNow();
|
|
33
|
+
}
|
|
34
|
+
async function c() {
|
|
35
|
+
return await e?.restore() ?? null;
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
status: t(() => a.status),
|
|
39
|
+
hasUnsavedChanges: t(() => a.hasUnsavedChanges),
|
|
40
|
+
lastSaved: t(() => a.lastSaved),
|
|
41
|
+
error: t(() => a.error),
|
|
42
|
+
save: v,
|
|
43
|
+
restore: c
|
|
44
|
+
};
|
|
45
|
+
}
|
|
2
46
|
export {
|
|
3
|
-
|
|
47
|
+
A as useVizelAutoSave
|
|
4
48
|
};
|
package/dist/index34.js
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createVizelEditorInstance as l, registerVizelUploadEventHandler as d } from "@vizel/core";
|
|
2
|
+
import { shallowRef as u, onMounted as c, onBeforeUnmount as m } from "vue";
|
|
3
|
+
import { createVizelSlashMenuRenderer as p } from "./index32.js";
|
|
4
|
+
function E(o = {}) {
|
|
5
|
+
const { features: e, extensions: r = [], ...i } = o, a = typeof e?.image == "object" ? e.image : {}, t = u(null);
|
|
6
|
+
let n = null;
|
|
7
|
+
return c(() => {
|
|
8
|
+
const { editor: s } = l({
|
|
9
|
+
...i,
|
|
10
|
+
...e !== void 0 && { features: e },
|
|
11
|
+
extensions: r,
|
|
12
|
+
createSlashMenuRenderer: p
|
|
13
|
+
});
|
|
14
|
+
t.value = s, n = d({
|
|
15
|
+
getEditor: () => t.value,
|
|
16
|
+
getImageOptions: () => a
|
|
17
|
+
});
|
|
18
|
+
}), m(() => {
|
|
19
|
+
n?.(), t.value?.destroy();
|
|
20
|
+
}), t;
|
|
21
|
+
}
|
|
2
22
|
export {
|
|
3
|
-
|
|
23
|
+
E as useVizelEditor
|
|
4
24
|
};
|
package/dist/index35.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getVizelEditorState as o } from "@vizel/core";
|
|
2
|
+
import { computed as r } from "vue";
|
|
3
|
+
import { useVizelState as i } from "./index37.js";
|
|
4
|
+
function p(t) {
|
|
5
|
+
const e = i(t);
|
|
6
|
+
return r(() => (e.value, o(t())));
|
|
7
|
+
}
|
|
2
8
|
export {
|
|
3
|
-
|
|
9
|
+
p as useVizelEditorState
|
|
4
10
|
};
|
package/dist/index36.js
CHANGED
|
@@ -1,4 +1,46 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getVizelMarkdown as k, createVizelMarkdownSyncHandlers as p } from "@vizel/core";
|
|
2
|
+
import { ref as d, watch as w, onBeforeUnmount as M, computed as g } from "vue";
|
|
3
|
+
function y(o, f = {}) {
|
|
4
|
+
const { initialValue: s, ...m } = f, t = d(s ?? ""), a = d(!1);
|
|
5
|
+
let l = null;
|
|
6
|
+
const i = () => (l || (l = p(m)), l);
|
|
7
|
+
let r = !1;
|
|
8
|
+
w(
|
|
9
|
+
o,
|
|
10
|
+
(e) => {
|
|
11
|
+
if (!e || r) return;
|
|
12
|
+
const n = i();
|
|
13
|
+
s !== void 0 ? (n.setMarkdown(e, s), t.value = s) : t.value = k(e), r = !0;
|
|
14
|
+
const u = () => {
|
|
15
|
+
n.handleUpdate(e), a.value = n.isPending();
|
|
16
|
+
const c = () => {
|
|
17
|
+
n.isPending() ? requestAnimationFrame(c) : (t.value = n.getMarkdown(), a.value = !1);
|
|
18
|
+
};
|
|
19
|
+
requestAnimationFrame(c);
|
|
20
|
+
};
|
|
21
|
+
e.on("update", u);
|
|
22
|
+
},
|
|
23
|
+
{ immediate: !0 }
|
|
24
|
+
), M(() => {
|
|
25
|
+
l?.destroy();
|
|
26
|
+
});
|
|
27
|
+
const h = (e) => {
|
|
28
|
+
const n = o();
|
|
29
|
+
if (!n) return;
|
|
30
|
+
i().setMarkdown(n, e), t.value = e, a.value = !1;
|
|
31
|
+
}, v = () => {
|
|
32
|
+
const e = o();
|
|
33
|
+
if (!e) return;
|
|
34
|
+
const n = i();
|
|
35
|
+
n.flush(e), t.value = n.getMarkdown(), a.value = !1;
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
markdown: t,
|
|
39
|
+
setMarkdown: h,
|
|
40
|
+
isPending: g(() => a.value),
|
|
41
|
+
flush: v
|
|
42
|
+
};
|
|
43
|
+
}
|
|
2
44
|
export {
|
|
3
|
-
|
|
45
|
+
y as useVizelMarkdown
|
|
4
46
|
};
|
package/dist/index37.js
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
import f from "
|
|
1
|
+
import { ref as a, watch as u, onBeforeUnmount as f } from "vue";
|
|
2
|
+
function l(i) {
|
|
3
|
+
const e = a(0);
|
|
4
|
+
let n = null;
|
|
5
|
+
function o() {
|
|
6
|
+
e.value++;
|
|
7
|
+
}
|
|
8
|
+
function r(t) {
|
|
9
|
+
n && n !== t && n.off("transaction", o), n = t ?? null, n && n.on("transaction", o);
|
|
10
|
+
}
|
|
11
|
+
return u(
|
|
12
|
+
i,
|
|
13
|
+
(t) => {
|
|
14
|
+
r(t);
|
|
15
|
+
},
|
|
16
|
+
{ immediate: !0 }
|
|
17
|
+
), f(() => {
|
|
18
|
+
n && n.off("transaction", o);
|
|
19
|
+
}), e;
|
|
20
|
+
}
|
|
2
21
|
export {
|
|
3
|
-
|
|
22
|
+
l as useVizelState
|
|
4
23
|
};
|
package/dist/index38.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { inject as r } from "vue";
|
|
2
|
+
import { VIZEL_THEME_CONTEXT_KEY as t } from "./index40.js";
|
|
3
|
+
function o() {
|
|
4
|
+
const e = r(t);
|
|
5
|
+
if (!e)
|
|
6
|
+
throw new Error("useVizelTheme must be used within a VizelThemeProvider");
|
|
7
|
+
return e;
|
|
8
|
+
}
|
|
9
|
+
function u() {
|
|
10
|
+
return r(t, null);
|
|
11
|
+
}
|
|
2
12
|
export {
|
|
3
|
-
|
|
13
|
+
o as useVizelTheme,
|
|
14
|
+
u as useVizelThemeSafe
|
|
4
15
|
};
|