@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/index17.js
CHANGED
|
@@ -1,79 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "vizel-save-indicator-timestamp"
|
|
14
|
-
}, $ = /* @__PURE__ */ _({
|
|
15
|
-
__name: "VizelSaveIndicator",
|
|
16
|
-
props: {
|
|
17
|
-
status: {},
|
|
18
|
-
lastSaved: {},
|
|
19
|
-
showTimestamp: { type: Boolean, default: !0 },
|
|
20
|
-
class: {}
|
|
21
|
-
},
|
|
22
|
-
setup(u) {
|
|
23
|
-
const e = u, t = h("");
|
|
24
|
-
let n = null;
|
|
25
|
-
function r() {
|
|
26
|
-
e.lastSaved ? t.value = g(e.lastSaved) : t.value = "";
|
|
27
|
-
}
|
|
28
|
-
z(() => {
|
|
29
|
-
r(), n = setInterval(r, 1e4);
|
|
30
|
-
}), S(
|
|
31
|
-
() => e.lastSaved,
|
|
32
|
-
() => {
|
|
33
|
-
r();
|
|
34
|
-
}
|
|
35
|
-
), k(() => {
|
|
36
|
-
n && clearInterval(n);
|
|
37
|
-
});
|
|
38
|
-
const m = l(() => {
|
|
39
|
-
switch (e.status) {
|
|
40
|
-
case "saved":
|
|
41
|
-
return "Saved";
|
|
42
|
-
case "saving":
|
|
43
|
-
return "Saving...";
|
|
44
|
-
case "unsaved":
|
|
45
|
-
return "Unsaved";
|
|
46
|
-
case "error":
|
|
47
|
-
return "Error saving";
|
|
48
|
-
default:
|
|
49
|
-
return "";
|
|
50
|
-
}
|
|
51
|
-
}), p = l(() => e.showTimestamp && e.lastSaved && t.value && e.status === "saved");
|
|
52
|
-
return (f, x) => (a(), i("div", {
|
|
53
|
-
class: y(["vizel-save-indicator", `vizel-save-indicator--${e.status}`, f.$props.class]),
|
|
54
|
-
role: "status",
|
|
55
|
-
"aria-live": "polite",
|
|
56
|
-
"data-vizel-save-indicator": ""
|
|
57
|
-
}, [
|
|
58
|
-
c("span", w, [
|
|
59
|
-
e.status === "saved" ? (a(), o(s, {
|
|
60
|
-
key: 0,
|
|
61
|
-
name: "check"
|
|
62
|
-
})) : e.status === "saving" ? (a(), i("span", B, [
|
|
63
|
-
T(s, { name: "loader" })
|
|
64
|
-
])) : e.status === "unsaved" ? (a(), o(s, {
|
|
65
|
-
key: 2,
|
|
66
|
-
name: "circle"
|
|
67
|
-
})) : e.status === "error" ? (a(), o(s, {
|
|
68
|
-
key: 3,
|
|
69
|
-
name: "warning"
|
|
70
|
-
})) : v("", !0)
|
|
71
|
-
]),
|
|
72
|
-
c("span", V, d(m.value), 1),
|
|
73
|
-
p.value ? (a(), i("span", I, d(t.value), 1)) : v("", !0)
|
|
74
|
-
], 2));
|
|
75
|
-
}
|
|
76
|
-
});
|
|
1
|
+
import { inject as t, computed as i } from "vue";
|
|
2
|
+
const o = /* @__PURE__ */ Symbol("vizel-editor");
|
|
3
|
+
function r() {
|
|
4
|
+
const e = t(o);
|
|
5
|
+
if (!e)
|
|
6
|
+
throw new Error("useVizelContext must be used within a VizelProvider");
|
|
7
|
+
return i(() => e());
|
|
8
|
+
}
|
|
9
|
+
function u() {
|
|
10
|
+
return t(o, null);
|
|
11
|
+
}
|
|
77
12
|
export {
|
|
78
|
-
|
|
13
|
+
o as VIZEL_CONTEXT_KEY,
|
|
14
|
+
r as useVizelContext,
|
|
15
|
+
u as useVizelContextSafe
|
|
79
16
|
};
|
package/dist/index18.js
CHANGED
|
@@ -1,120 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
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",
|
|
1
|
+
import { defineComponent as d, ref as m, computed as f, watch as v, createElementBlock as u, createCommentVNode as C, openBlock as _, normalizeClass as w } from "vue";
|
|
2
|
+
import { useVizelContextSafe as E } from "./index17.js";
|
|
3
|
+
const x = /* @__PURE__ */ d({
|
|
4
|
+
__name: "VizelEditor",
|
|
11
5
|
props: {
|
|
12
|
-
|
|
13
|
-
class: {}
|
|
14
|
-
showGroups: { type: Boolean, default: !0 },
|
|
15
|
-
groupOrder: {}
|
|
6
|
+
editor: {},
|
|
7
|
+
class: {}
|
|
16
8
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
() => {
|
|
23
|
-
n.value = 0, y.value = [];
|
|
9
|
+
setup(a, { expose: c }) {
|
|
10
|
+
const l = a, t = m(null), p = E(), i = f(() => l.editor ?? p?.());
|
|
11
|
+
return c({
|
|
12
|
+
get container() {
|
|
13
|
+
return t.value;
|
|
24
14
|
}
|
|
25
|
-
),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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));
|
|
15
|
+
}), v(
|
|
16
|
+
() => [i.value, t.value],
|
|
17
|
+
([e, o], s) => {
|
|
18
|
+
const n = s?.[0], r = s?.[1];
|
|
19
|
+
n && r && n.view.dom.parentNode === r && r.removeChild(n.view.dom), e && o && (o.appendChild(e.view.dom), e.view.setProps({
|
|
20
|
+
editable: () => e?.isEditable ?? !1
|
|
21
|
+
}));
|
|
22
|
+
},
|
|
23
|
+
{ immediate: !0 }
|
|
24
|
+
), (e, o) => i.value ? (_(), u("div", {
|
|
25
|
+
key: 0,
|
|
26
|
+
ref_key: "containerRef",
|
|
27
|
+
ref: t,
|
|
28
|
+
class: w(e.$props.class),
|
|
29
|
+
"data-vizel-content": ""
|
|
30
|
+
}, null, 2)) : C("", !0);
|
|
116
31
|
}
|
|
117
32
|
});
|
|
118
33
|
export {
|
|
119
|
-
|
|
34
|
+
x as default
|
|
120
35
|
};
|
package/dist/index19.js
CHANGED
|
@@ -1,21 +1,135 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
|
|
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 "./index20.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",
|
|
4
14
|
props: {
|
|
5
|
-
|
|
15
|
+
data: {},
|
|
16
|
+
class: {},
|
|
17
|
+
selected: { type: Boolean }
|
|
6
18
|
},
|
|
7
|
-
setup(
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
+
}
|
|
29
|
+
});
|
|
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
|
|
12
57
|
}, [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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" })
|
|
127
|
+
]),
|
|
128
|
+
a("span", G, r(e.data.url), 1)
|
|
129
|
+
], 8, $)
|
|
130
|
+
], 10, U));
|
|
17
131
|
}
|
|
18
132
|
});
|
|
19
133
|
export {
|
|
20
|
-
|
|
134
|
+
O as default
|
|
21
135
|
};
|
package/dist/index2.js
CHANGED
|
@@ -1,88 +1,79 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
features: {},
|
|
16
|
-
class: {},
|
|
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));
|
|
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";
|
|
3
|
+
var d = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, i = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, l = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, u = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g;
|
|
4
|
+
a.create({
|
|
5
|
+
name: "bold",
|
|
6
|
+
addOptions() {
|
|
7
|
+
return {
|
|
8
|
+
HTMLAttributes: {}
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
parseHTML() {
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
tag: "strong"
|
|
37
15
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
onFocus: (e) => l("focus", e),
|
|
42
|
-
onBlur: (e) => l("blur", e)
|
|
43
|
-
});
|
|
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;
|
|
16
|
+
{
|
|
17
|
+
tag: "b",
|
|
18
|
+
getAttrs: (t) => t.style.fontWeight !== "normal" && null
|
|
54
19
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
20
|
+
{
|
|
21
|
+
style: "font-weight=400",
|
|
22
|
+
clearMark: (t) => t.type.name === this.name
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
style: "font-weight",
|
|
26
|
+
getAttrs: (t) => /^(bold(er)?|[5-9]\d{2,})$/.test(t) && null
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
},
|
|
30
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
31
|
+
return /* @__PURE__ */ n("strong", { ...o(this.options.HTMLAttributes, t), children: /* @__PURE__ */ n("slot", {}) });
|
|
32
|
+
},
|
|
33
|
+
markdownTokenName: "strong",
|
|
34
|
+
parseMarkdown: (t, e) => e.applyMark("bold", e.parseInline(t.tokens || [])),
|
|
35
|
+
renderMarkdown: (t, e) => `**${e.renderChildren(t)}**`,
|
|
36
|
+
addCommands() {
|
|
37
|
+
return {
|
|
38
|
+
setBold: () => ({ commands: t }) => t.setMark(this.name),
|
|
39
|
+
toggleBold: () => ({ commands: t }) => t.toggleMark(this.name),
|
|
40
|
+
unsetBold: () => ({ commands: t }) => t.unsetMark(this.name)
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
addKeyboardShortcuts() {
|
|
44
|
+
return {
|
|
45
|
+
"Mod-b": () => this.editor.commands.toggleBold(),
|
|
46
|
+
"Mod-B": () => this.editor.commands.toggleBold()
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
addInputRules() {
|
|
50
|
+
return [
|
|
51
|
+
s({
|
|
52
|
+
find: d,
|
|
53
|
+
type: this.type
|
|
54
|
+
}),
|
|
55
|
+
s({
|
|
56
|
+
find: l,
|
|
57
|
+
type: this.type
|
|
58
|
+
})
|
|
59
|
+
];
|
|
60
|
+
},
|
|
61
|
+
addPasteRules() {
|
|
62
|
+
return [
|
|
63
|
+
r({
|
|
64
|
+
find: i,
|
|
65
|
+
type: this.type
|
|
66
|
+
}),
|
|
67
|
+
r({
|
|
68
|
+
find: u,
|
|
69
|
+
type: this.type
|
|
70
|
+
})
|
|
71
|
+
];
|
|
84
72
|
}
|
|
85
73
|
});
|
|
86
74
|
export {
|
|
87
|
-
|
|
75
|
+
d as starInputRegex,
|
|
76
|
+
i as starPasteRegex,
|
|
77
|
+
l as underscoreInputRegex,
|
|
78
|
+
u as underscorePasteRegex
|
|
88
79
|
};
|
package/dist/index20.js
CHANGED
|
@@ -1,52 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}, C = { class: "vizel-slash-menu-description" }, M = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "vizel-slash-menu-shortcut"
|
|
10
|
-
}, E = /* @__PURE__ */ r({
|
|
11
|
-
__name: "VizelSlashMenuItem",
|
|
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 "./index21.js";
|
|
5
|
+
const g = /* @__PURE__ */ c({
|
|
6
|
+
__name: "VizelIcon",
|
|
12
7
|
props: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
name: {},
|
|
9
|
+
customIcons: {},
|
|
10
|
+
width: {},
|
|
11
|
+
height: {},
|
|
12
|
+
color: {}
|
|
17
13
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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));
|
|
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"]));
|
|
48
26
|
}
|
|
49
27
|
});
|
|
50
28
|
export {
|
|
51
|
-
|
|
29
|
+
g as default
|
|
52
30
|
};
|