@vizel/vue 0.0.1-alpha.1
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 +87 -0
- package/dist/index.d.ts +981 -0
- package/dist/index.js +63 -0
- package/dist/index10.js +135 -0
- package/dist/index11.js +30 -0
- package/dist/index12.js +14 -0
- package/dist/index13.js +91 -0
- package/dist/index14.js +134 -0
- package/dist/index15.js +37 -0
- package/dist/index16.js +21 -0
- package/dist/index17.js +79 -0
- package/dist/index18.js +120 -0
- package/dist/index19.js +21 -0
- package/dist/index2.js +88 -0
- package/dist/index20.js +52 -0
- package/dist/index21.js +43 -0
- package/dist/index22.js +12 -0
- package/dist/index23.js +16 -0
- package/dist/index24.js +37 -0
- package/dist/index25.js +48 -0
- package/dist/index26.js +24 -0
- package/dist/index27.js +10 -0
- package/dist/index28.js +46 -0
- package/dist/index29.js +23 -0
- package/dist/index3.js +61 -0
- package/dist/index30.js +15 -0
- package/dist/index31.js +4 -0
- package/dist/index32.js +4 -0
- package/dist/index33.js +4 -0
- package/dist/index34.js +4 -0
- package/dist/index35.js +4 -0
- package/dist/index36.js +4 -0
- package/dist/index37.js +4 -0
- package/dist/index38.js +4 -0
- package/dist/index39.js +4 -0
- package/dist/index4.js +34 -0
- package/dist/index40.js +4 -0
- package/dist/index41.js +4 -0
- package/dist/index42.js +4 -0
- package/dist/index43.js +4 -0
- package/dist/index44.js +4 -0
- package/dist/index45.js +4 -0
- package/dist/index46.js +4 -0
- package/dist/index47.js +4 -0
- package/dist/index48.js +4 -0
- package/dist/index49.js +4 -0
- package/dist/index5.js +76 -0
- package/dist/index50.js +4 -0
- package/dist/index51.js +4 -0
- package/dist/index6.js +108 -0
- package/dist/index7.js +15 -0
- package/dist/index8.js +191 -0
- package/dist/index9.js +35 -0
- package/package.json +63 -0
package/dist/index39.js
ADDED
package/dist/index4.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
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",
|
|
4
|
+
props: {
|
|
5
|
+
isActive: { type: Boolean },
|
|
6
|
+
disabled: { type: Boolean },
|
|
7
|
+
title: {},
|
|
8
|
+
class: {},
|
|
9
|
+
action: {}
|
|
10
|
+
},
|
|
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));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
v as default
|
|
34
|
+
};
|
package/dist/index40.js
ADDED
package/dist/index41.js
ADDED
package/dist/index42.js
ADDED
package/dist/index43.js
ADDED
package/dist/index44.js
ADDED
package/dist/index45.js
ADDED
package/dist/index46.js
ADDED
package/dist/index47.js
ADDED
package/dist/index48.js
ADDED
package/dist/index49.js
ADDED
package/dist/index5.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defineComponent as w, ref as i, computed as n, watch as b, onMounted as x, onUnmounted as z, createElementBlock as d, openBlock as a, normalizeClass as h, createElementVNode as R, createCommentVNode as V, normalizeStyle as E, createBlock as v, createVNode as H } from "vue";
|
|
2
|
+
import { VIZEL_TEXT_COLORS as L, VIZEL_HIGHLIGHT_COLORS as T, getVizelRecentColors as B, addVizelRecentColor as f } from "@vizel/core";
|
|
3
|
+
import O from "./index8.js";
|
|
4
|
+
import m from "./index11.js";
|
|
5
|
+
const S = ["data-type"], I = ["title", "data-action"], $ = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "vizel-color-picker-dropdown"
|
|
8
|
+
}, Z = /* @__PURE__ */ w({
|
|
9
|
+
__name: "VizelBubbleMenuColorPicker",
|
|
10
|
+
props: {
|
|
11
|
+
editor: {},
|
|
12
|
+
type: {},
|
|
13
|
+
colors: {},
|
|
14
|
+
class: {},
|
|
15
|
+
allowCustomColor: { type: Boolean, default: !0 },
|
|
16
|
+
showRecentColors: { type: Boolean, default: !0 }
|
|
17
|
+
},
|
|
18
|
+
setup(C) {
|
|
19
|
+
const e = C, o = i(!1), c = i([]), s = i(null), g = n(() => e.colors ?? (e.type === "textColor" ? L : T)), r = n(() => e.type === "textColor" ? e.editor.getAttributes("textStyle").color : e.editor.getAttributes("highlight").color), l = n(() => e.type === "textColor"), y = n(() => l.value ? ["inherit"] : ["transparent"]);
|
|
20
|
+
b(o, (t) => {
|
|
21
|
+
t && e.showRecentColors && (c.value = B(e.type));
|
|
22
|
+
});
|
|
23
|
+
function _(t) {
|
|
24
|
+
e.type === "textColor" ? t === "inherit" ? e.editor.chain().focus().unsetColor().run() : (e.editor.chain().focus().setColor(t).run(), f(e.type, t)) : t === "transparent" ? e.editor.chain().focus().unsetHighlight().run() : (e.editor.chain().focus().toggleHighlight({ color: t }).run(), f(e.type, t)), o.value = !1;
|
|
25
|
+
}
|
|
26
|
+
function u(t) {
|
|
27
|
+
s.value && !s.value.contains(t.target) && (o.value = !1);
|
|
28
|
+
}
|
|
29
|
+
x(() => {
|
|
30
|
+
document.addEventListener("mousedown", u);
|
|
31
|
+
}), z(() => {
|
|
32
|
+
document.removeEventListener("mousedown", u);
|
|
33
|
+
});
|
|
34
|
+
function k() {
|
|
35
|
+
return l.value ? { color: r.value || "inherit" } : { "--highlight-color": r.value || "transparent" };
|
|
36
|
+
}
|
|
37
|
+
return (t, p) => (a(), d("div", {
|
|
38
|
+
ref_key: "containerRef",
|
|
39
|
+
ref: s,
|
|
40
|
+
class: h(["vizel-color-picker", t.$props.class]),
|
|
41
|
+
"data-type": e.type
|
|
42
|
+
}, [
|
|
43
|
+
R("button", {
|
|
44
|
+
type: "button",
|
|
45
|
+
class: h(["vizel-bubble-menu-button", "vizel-color-picker-trigger", { "has-color": r.value }]),
|
|
46
|
+
title: l.value ? "Text Color" : "Highlight",
|
|
47
|
+
"data-action": e.type,
|
|
48
|
+
style: E(k()),
|
|
49
|
+
onClick: p[0] || (p[0] = (N) => o.value = !o.value)
|
|
50
|
+
}, [
|
|
51
|
+
l.value ? (a(), v(m, {
|
|
52
|
+
key: 0,
|
|
53
|
+
name: "textColor"
|
|
54
|
+
})) : (a(), v(m, {
|
|
55
|
+
key: 1,
|
|
56
|
+
name: "highlighter"
|
|
57
|
+
}))
|
|
58
|
+
], 14, I),
|
|
59
|
+
o.value ? (a(), d("div", $, [
|
|
60
|
+
H(O, {
|
|
61
|
+
colors: g.value,
|
|
62
|
+
value: r.value,
|
|
63
|
+
label: l.value ? "Text color palette" : "Highlight color palette",
|
|
64
|
+
"allow-custom-color": e.allowCustomColor,
|
|
65
|
+
"recent-colors": c.value,
|
|
66
|
+
"show-recent-colors": e.showRecentColors,
|
|
67
|
+
"none-values": y.value,
|
|
68
|
+
onChange: _
|
|
69
|
+
}, null, 8, ["colors", "value", "label", "allow-custom-color", "recent-colors", "show-recent-colors", "none-values"])
|
|
70
|
+
])) : V("", !0)
|
|
71
|
+
], 10, S));
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
export {
|
|
75
|
+
Z as default
|
|
76
|
+
};
|
package/dist/index50.js
ADDED
package/dist/index51.js
ADDED
package/dist/index6.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
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 "./index29.js";
|
|
3
|
+
import a from "./index4.js";
|
|
4
|
+
import c from "./index5.js";
|
|
5
|
+
import d from "./index11.js";
|
|
6
|
+
import S from "./index13.js";
|
|
7
|
+
import z from "./index14.js";
|
|
8
|
+
const D = /* @__PURE__ */ $({
|
|
9
|
+
__name: "VizelBubbleMenuDefault",
|
|
10
|
+
props: {
|
|
11
|
+
editor: {},
|
|
12
|
+
class: {},
|
|
13
|
+
enableEmbed: { type: Boolean }
|
|
14
|
+
},
|
|
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, {
|
|
18
|
+
key: 0,
|
|
19
|
+
editor: e.editor,
|
|
20
|
+
"enable-embed": e.enableEmbed,
|
|
21
|
+
onClose: t[0] || (t[0] = (n) => s.value = !1)
|
|
22
|
+
}, null, 8, ["editor", "enable-embed"])) : (u(), _("div", {
|
|
23
|
+
key: 1,
|
|
24
|
+
class: y(["vizel-bubble-menu-toolbar", g.$props.class])
|
|
25
|
+
}, [
|
|
26
|
+
i(z, {
|
|
27
|
+
editor: e.editor
|
|
28
|
+
}, null, 8, ["editor"]),
|
|
29
|
+
i(a, {
|
|
30
|
+
action: "bold",
|
|
31
|
+
"is-active": m.value,
|
|
32
|
+
title: "Bold (Cmd+B)",
|
|
33
|
+
onClick: t[1] || (t[1] = (n) => e.editor.chain().focus().toggleBold().run())
|
|
34
|
+
}, {
|
|
35
|
+
default: r(() => [
|
|
36
|
+
i(d, { name: "bold" })
|
|
37
|
+
]),
|
|
38
|
+
_: 1
|
|
39
|
+
}, 8, ["is-active"]),
|
|
40
|
+
i(a, {
|
|
41
|
+
action: "italic",
|
|
42
|
+
"is-active": f.value,
|
|
43
|
+
title: "Italic (Cmd+I)",
|
|
44
|
+
onClick: t[2] || (t[2] = (n) => e.editor.chain().focus().toggleItalic().run())
|
|
45
|
+
}, {
|
|
46
|
+
default: r(() => [
|
|
47
|
+
i(d, { name: "italic" })
|
|
48
|
+
]),
|
|
49
|
+
_: 1
|
|
50
|
+
}, 8, ["is-active"]),
|
|
51
|
+
i(a, {
|
|
52
|
+
action: "strike",
|
|
53
|
+
"is-active": k.value,
|
|
54
|
+
title: "Strikethrough",
|
|
55
|
+
onClick: t[3] || (t[3] = (n) => e.editor.chain().focus().toggleStrike().run())
|
|
56
|
+
}, {
|
|
57
|
+
default: r(() => [
|
|
58
|
+
i(d, { name: "strikethrough" })
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
}, 8, ["is-active"]),
|
|
62
|
+
i(a, {
|
|
63
|
+
action: "underline",
|
|
64
|
+
"is-active": p.value,
|
|
65
|
+
title: "Underline (Cmd+U)",
|
|
66
|
+
onClick: t[4] || (t[4] = (n) => e.editor.chain().focus().toggleUnderline().run())
|
|
67
|
+
}, {
|
|
68
|
+
default: r(() => [
|
|
69
|
+
i(d, { name: "underline" })
|
|
70
|
+
]),
|
|
71
|
+
_: 1
|
|
72
|
+
}, 8, ["is-active"]),
|
|
73
|
+
i(a, {
|
|
74
|
+
action: "code",
|
|
75
|
+
"is-active": C.value,
|
|
76
|
+
title: "Code (Cmd+E)",
|
|
77
|
+
onClick: t[5] || (t[5] = (n) => e.editor.chain().focus().toggleCode().run())
|
|
78
|
+
}, {
|
|
79
|
+
default: r(() => [
|
|
80
|
+
i(d, { name: "code" })
|
|
81
|
+
]),
|
|
82
|
+
_: 1
|
|
83
|
+
}, 8, ["is-active"]),
|
|
84
|
+
i(a, {
|
|
85
|
+
action: "link",
|
|
86
|
+
"is-active": b.value,
|
|
87
|
+
title: "Link (Cmd+K)",
|
|
88
|
+
onClick: t[6] || (t[6] = (n) => s.value = !0)
|
|
89
|
+
}, {
|
|
90
|
+
default: r(() => [
|
|
91
|
+
i(d, { name: "link" })
|
|
92
|
+
]),
|
|
93
|
+
_: 1
|
|
94
|
+
}, 8, ["is-active"]),
|
|
95
|
+
i(c, {
|
|
96
|
+
editor: e.editor,
|
|
97
|
+
type: "textColor"
|
|
98
|
+
}, null, 8, ["editor"]),
|
|
99
|
+
i(c, {
|
|
100
|
+
editor: e.editor,
|
|
101
|
+
type: "highlight"
|
|
102
|
+
}, null, 8, ["editor"])
|
|
103
|
+
], 2));
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
export {
|
|
107
|
+
D as default
|
|
108
|
+
};
|
package/dist/index7.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineComponent as s, createElementBlock as l, openBlock as n, normalizeClass as r } from "vue";
|
|
2
|
+
const c = /* @__PURE__ */ s({
|
|
3
|
+
__name: "VizelBubbleMenuDivider",
|
|
4
|
+
props: {
|
|
5
|
+
class: {}
|
|
6
|
+
},
|
|
7
|
+
setup(o) {
|
|
8
|
+
return (e, a) => (n(), l("span", {
|
|
9
|
+
class: r(["vizel-bubble-menu-divider", e.$props.class])
|
|
10
|
+
}, null, 2));
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
c as default
|
|
15
|
+
};
|
package/dist/index8.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { defineComponent as U, computed as k, ref as C, watch as N, onMounted as F, createElementBlock as s, openBlock as i, normalizeClass as _, createCommentVNode as b, createElementVNode as u, Fragment as B, renderList as M, normalizeStyle as z, createVNode as V } from "vue";
|
|
2
|
+
import { isVizelValidHexColor as S, normalizeVizelHexColor as g } from "@vizel/core";
|
|
3
|
+
import x from "./index11.js";
|
|
4
|
+
const G = ["aria-label"], P = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "vizel-color-picker-section"
|
|
7
|
+
}, j = { class: "vizel-color-picker-recent" }, q = ["aria-selected", "aria-label", "tabindex", "data-color", "onClick", "onKeydown"], J = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "vizel-color-picker-none"
|
|
10
|
+
}, Q = { class: "vizel-color-picker-section" }, T = { class: "vizel-color-picker-grid" }, W = ["aria-selected", "aria-label", "tabindex", "data-color", "onClick", "onKeydown"], X = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "vizel-color-picker-none"
|
|
13
|
+
}, Y = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "vizel-color-picker-input-row"
|
|
16
|
+
}, Z = ["value"], D = ["disabled"], $ = 4, te = /* @__PURE__ */ U({
|
|
17
|
+
__name: "VizelColorPicker",
|
|
18
|
+
props: {
|
|
19
|
+
colors: {},
|
|
20
|
+
value: {},
|
|
21
|
+
modelValue: {},
|
|
22
|
+
label: { default: "Color palette" },
|
|
23
|
+
class: {},
|
|
24
|
+
allowCustomColor: { type: Boolean, default: !0 },
|
|
25
|
+
recentColors: { default: () => [] },
|
|
26
|
+
showRecentColors: { type: Boolean, default: !0 },
|
|
27
|
+
noneValues: { default: () => ["transparent", "inherit"] }
|
|
28
|
+
},
|
|
29
|
+
emits: ["change", "update:modelValue"],
|
|
30
|
+
setup(d, { emit: H }) {
|
|
31
|
+
const a = d, f = H, c = k(() => a.modelValue ?? a.value), r = C(""), v = C(-1), p = C([]), I = C(null), m = k(() => [
|
|
32
|
+
...a.showRecentColors ? a.recentColors : [],
|
|
33
|
+
...a.colors.map((e) => e.color)
|
|
34
|
+
]);
|
|
35
|
+
N(
|
|
36
|
+
() => m.value.length,
|
|
37
|
+
(e) => {
|
|
38
|
+
p.value.length > e && (p.value.length = e);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
const y = k(() => a.showRecentColors ? a.recentColors.length : 0);
|
|
42
|
+
function h(e) {
|
|
43
|
+
return a.noneValues.includes(e);
|
|
44
|
+
}
|
|
45
|
+
function w(e) {
|
|
46
|
+
f("change", e), f("update:modelValue", e), r.value = "";
|
|
47
|
+
}
|
|
48
|
+
function R() {
|
|
49
|
+
const e = g(r.value);
|
|
50
|
+
S(e) && (f("change", e), f("update:modelValue", e), r.value = "");
|
|
51
|
+
}
|
|
52
|
+
function O(e) {
|
|
53
|
+
e.key === "Enter" && (e.preventDefault(), R());
|
|
54
|
+
}
|
|
55
|
+
function K(e, n) {
|
|
56
|
+
const l = m.value.length;
|
|
57
|
+
if (l === 0) return;
|
|
58
|
+
let t = n, o = !1;
|
|
59
|
+
switch (e.key) {
|
|
60
|
+
case "ArrowRight":
|
|
61
|
+
t = (n + 1) % l, o = !0;
|
|
62
|
+
break;
|
|
63
|
+
case "ArrowLeft":
|
|
64
|
+
t = (n - 1 + l) % l, o = !0;
|
|
65
|
+
break;
|
|
66
|
+
case "ArrowDown":
|
|
67
|
+
t = Math.min(n + $, l - 1), o = !0;
|
|
68
|
+
break;
|
|
69
|
+
case "ArrowUp":
|
|
70
|
+
t = Math.max(n - $, 0), o = !0;
|
|
71
|
+
break;
|
|
72
|
+
case "Home":
|
|
73
|
+
t = 0, o = !0;
|
|
74
|
+
break;
|
|
75
|
+
case "End":
|
|
76
|
+
t = l - 1, o = !0;
|
|
77
|
+
break;
|
|
78
|
+
case "Enter":
|
|
79
|
+
case " ": {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
const E = m.value[n];
|
|
82
|
+
E && w(E);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
o && (e.preventDefault(), v.value = t, p.value[t]?.focus());
|
|
87
|
+
}
|
|
88
|
+
N(
|
|
89
|
+
c,
|
|
90
|
+
(e) => {
|
|
91
|
+
e && !h(e) ? r.value = e : r.value = "";
|
|
92
|
+
},
|
|
93
|
+
{ immediate: !0 }
|
|
94
|
+
), F(() => {
|
|
95
|
+
const e = c.value ? m.value.indexOf(c.value) : -1;
|
|
96
|
+
e >= 0 ? v.value = e : m.value.length > 0 && (v.value = 0);
|
|
97
|
+
});
|
|
98
|
+
const A = k(() => S(g(r.value))), L = k(
|
|
99
|
+
() => A.value ? g(r.value) : void 0
|
|
100
|
+
);
|
|
101
|
+
return (e, n) => (i(), s("div", {
|
|
102
|
+
class: _(["vizel-color-picker-content", e.$props.class]),
|
|
103
|
+
role: "listbox",
|
|
104
|
+
"aria-label": a.label
|
|
105
|
+
}, [
|
|
106
|
+
d.showRecentColors && a.recentColors && a.recentColors.length > 0 ? (i(), s("div", P, [
|
|
107
|
+
n[1] || (n[1] = u("div", { class: "vizel-color-picker-label" }, "Recent", -1)),
|
|
108
|
+
u("div", j, [
|
|
109
|
+
(i(!0), s(B, null, M(d.recentColors, (l, t) => (i(), s("button", {
|
|
110
|
+
key: l,
|
|
111
|
+
ref_for: !0,
|
|
112
|
+
ref: (o) => {
|
|
113
|
+
p.value[t] = o;
|
|
114
|
+
},
|
|
115
|
+
type: "button",
|
|
116
|
+
role: "option",
|
|
117
|
+
"aria-selected": c.value === l,
|
|
118
|
+
"aria-label": l,
|
|
119
|
+
tabindex: v.value === t ? 0 : -1,
|
|
120
|
+
class: _(["vizel-color-picker-swatch", { "is-active": c.value === l }]),
|
|
121
|
+
style: z({ backgroundColor: h(l) ? "transparent" : l }),
|
|
122
|
+
"data-color": l,
|
|
123
|
+
onClick: (o) => w(l),
|
|
124
|
+
onKeydown: (o) => K(o, t)
|
|
125
|
+
}, [
|
|
126
|
+
h(l) ? (i(), s("span", J, [
|
|
127
|
+
V(x, { name: "x" })
|
|
128
|
+
])) : b("", !0)
|
|
129
|
+
], 46, q))), 128))
|
|
130
|
+
])
|
|
131
|
+
])) : b("", !0),
|
|
132
|
+
u("div", Q, [
|
|
133
|
+
u("div", T, [
|
|
134
|
+
(i(!0), s(B, null, M(d.colors, (l, t) => (i(), s("button", {
|
|
135
|
+
key: l.color,
|
|
136
|
+
ref_for: !0,
|
|
137
|
+
ref: (o) => {
|
|
138
|
+
p.value[y.value + t] = o;
|
|
139
|
+
},
|
|
140
|
+
type: "button",
|
|
141
|
+
role: "option",
|
|
142
|
+
"aria-selected": c.value === l.color,
|
|
143
|
+
"aria-label": l.name,
|
|
144
|
+
tabindex: v.value === y.value + t ? 0 : -1,
|
|
145
|
+
class: _(["vizel-color-picker-swatch", { "is-active": c.value === l.color }]),
|
|
146
|
+
style: z({ backgroundColor: h(l.color) ? "transparent" : l.color }),
|
|
147
|
+
"data-color": l.color,
|
|
148
|
+
onClick: (o) => w(l.color),
|
|
149
|
+
onKeydown: (o) => K(o, y.value + t)
|
|
150
|
+
}, [
|
|
151
|
+
h(l.color) ? (i(), s("span", X, [
|
|
152
|
+
V(x, { name: "x" })
|
|
153
|
+
])) : b("", !0)
|
|
154
|
+
], 46, W))), 128))
|
|
155
|
+
])
|
|
156
|
+
]),
|
|
157
|
+
d.allowCustomColor ? (i(), s("div", Y, [
|
|
158
|
+
u("span", {
|
|
159
|
+
class: "vizel-color-picker-preview",
|
|
160
|
+
style: z({ backgroundColor: L.value || "transparent" }),
|
|
161
|
+
"aria-hidden": "true"
|
|
162
|
+
}, null, 4),
|
|
163
|
+
u("input", {
|
|
164
|
+
ref_key: "inputRef",
|
|
165
|
+
ref: I,
|
|
166
|
+
type: "text",
|
|
167
|
+
class: "vizel-color-picker-input",
|
|
168
|
+
placeholder: "#000000",
|
|
169
|
+
value: r.value,
|
|
170
|
+
maxlength: "7",
|
|
171
|
+
"aria-label": "Custom color hex value",
|
|
172
|
+
onInput: n[0] || (n[0] = (l) => r.value = l.target.value),
|
|
173
|
+
onKeydown: O
|
|
174
|
+
}, null, 40, Z),
|
|
175
|
+
u("button", {
|
|
176
|
+
type: "button",
|
|
177
|
+
class: "vizel-color-picker-apply",
|
|
178
|
+
disabled: !A.value,
|
|
179
|
+
title: "Apply",
|
|
180
|
+
"aria-label": "Apply custom color",
|
|
181
|
+
onClick: R
|
|
182
|
+
}, [
|
|
183
|
+
V(x, { name: "check" })
|
|
184
|
+
], 8, D)
|
|
185
|
+
])) : b("", !0)
|
|
186
|
+
], 10, G));
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
export {
|
|
190
|
+
te as default
|
|
191
|
+
};
|
package/dist/index9.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
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 "./index23.js";
|
|
3
|
+
const x = /* @__PURE__ */ d({
|
|
4
|
+
__name: "VizelEditor",
|
|
5
|
+
props: {
|
|
6
|
+
editor: {},
|
|
7
|
+
class: {}
|
|
8
|
+
},
|
|
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;
|
|
14
|
+
}
|
|
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);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
x as default
|
|
35
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vizel/vue",
|
|
3
|
+
"version": "0.0.1-alpha.1",
|
|
4
|
+
"description": "Vue 3 components for Vizel block-based Markdown editor",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"vue",
|
|
7
|
+
"vue3",
|
|
8
|
+
"tiptap",
|
|
9
|
+
"editor",
|
|
10
|
+
"markdown",
|
|
11
|
+
"wysiwyg",
|
|
12
|
+
"rich-text",
|
|
13
|
+
"block-editor"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "Seiji Kohara",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/seijikohara/vizel.git",
|
|
20
|
+
"directory": "packages/vue"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/seijikohara/vizel",
|
|
23
|
+
"bugs": "https://github.com/seijikohara/vizel/issues",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"module": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"import": "./dist/index.js",
|
|
36
|
+
"default": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist"
|
|
45
|
+
],
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "vite build",
|
|
48
|
+
"typecheck": "vue-tsc --noEmit"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@iconify/vue": "^5",
|
|
52
|
+
"@vizel/core": "^0.0.1-alpha.1"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"vue": "^3.4"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@vitejs/plugin-vue": "^6",
|
|
59
|
+
"vite": "^7",
|
|
60
|
+
"vite-plugin-dts": "^4",
|
|
61
|
+
"vue-tsc": "^3"
|
|
62
|
+
}
|
|
63
|
+
}
|