@templatical/editor 0.16.3 → 0.16.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/{AiChatSidebar-EaPCeDXr.js → AiChatSidebar-CYAbVB2G.js} +7 -7
- package/dist/{AiFeatureMenu-CcGRd1xE.js → AiFeatureMenu-B1oEJebq.js} +4 -4
- package/dist/{BlockIssueBadge-CZYgn-qg.js → BlockIssueBadge-BLytBabN.js} +2 -2
- package/dist/{CloudEditor-CUIWUMp5.js → CloudEditor-D6KNL6VU.js} +15 -15
- package/dist/{CollaboratorBar-DmxqeBYZ.js → CollaboratorBar-C_EhXQ5R.js} +2 -2
- package/dist/{ColorPicker-Gs4BMVog.js → ColorPicker-CppJgX_T.js} +58 -59
- package/dist/{CommentsSidebar-DDKiFsSq.js → CommentsSidebar-C_XLBbo3.js} +8 -8
- package/dist/{CountdownToolbar-92w1YySJ.js → CountdownToolbar-D5GaA_lt.js} +53 -67
- package/dist/{DesignReferenceSidebar-D6TfC176.js → DesignReferenceSidebar-Bh9uAZ4B.js} +5 -5
- package/dist/{IssuesPanel-CQQipLQP.js → IssuesPanel-DltSuU6H.js} +5 -5
- package/dist/{MergeTagSuggestion-DrT3LiZ4.js → MergeTagSuggestion-jIpT_jmz.js} +7 -5
- package/dist/{ModuleBrowserModal-DsehjLvh.js → ModuleBrowserModal-CXy8Bbv9.js} +6 -6
- package/dist/{ModulePreviewCanvas-BBfuS8VW.js → ModulePreviewCanvas-CJC9kyZN.js} +1 -1
- package/dist/{NumberWithSuffix-BxSRfI8b.js → NumberWithSuffix-DNi-v4l1.js} +1 -1
- package/dist/{ParagraphEditor-vgvQxicC.js → ParagraphEditor-nk5Vvr7M.js} +57 -58
- package/dist/{RichTextEditorContent-Dza2oPvh.js → RichTextEditorContent-DBaCrvH0.js} +13 -13
- package/dist/{SaveModuleDialog-DNWGCHlS.js → SaveModuleDialog-CYu5PhBz.js} +24 -23
- package/dist/{SnapshotHistory-BLmnNLg1.js → SnapshotHistory-B38ImqMO.js} +6 -6
- package/dist/{TemplateScoringPanel-C8VOC6gn.js → TemplateScoringPanel-ZhObHWeb.js} +10 -10
- package/dist/{TestEmailModal-D6v1hgY2.js → TestEmailModal-DbstIzEf.js} +3 -3
- package/dist/{TitleEditor-DPdzOQpq.js → TitleEditor-CmfkOHJT.js} +18 -18
- package/dist/ToggleSwitch-DUNuUPsZ.js +37 -0
- package/dist/{TplModal-DObT0uxf.js → TplModal-BXnx3sLr.js} +4 -4
- package/dist/{blockTypeIcons-B9f5fH_5.js → blockTypeIcons-BVIEw0XJ.js} +2 -2
- package/dist/bundle-stats.json +6 -6
- package/dist/{ca-B3eR47lE.js → ca-DI1ViqMa.js} +2 -1
- package/dist/cdn/chunks/{AiFeatureMenu-CyUCHd9I.js → AiFeatureMenu-CuIg4yrB.js} +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-CyUCHd9I.js.map → AiFeatureMenu-CuIg4yrB.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-BAa_dI-c.js → BlockIssueBadge-BHEl_Hs7.js} +4 -4
- package/dist/cdn/chunks/{BlockIssueBadge-BAa_dI-c.js.map → BlockIssueBadge-BHEl_Hs7.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-ClfgLU48.js → CloudEditor-1Ms0w691.js} +130 -130
- package/dist/cdn/chunks/{CloudEditor-ClfgLU48.js.map → CloudEditor-1Ms0w691.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-DCc5SL0P.js → CollaboratorBar-C0a5P64z.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-DCc5SL0P.js.map → CollaboratorBar-C0a5P64z.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-Pi-1fR8c.js → ColorPicker-bsMmT-_B.js} +144 -144
- package/dist/cdn/chunks/ColorPicker-bsMmT-_B.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-Bj7aoBUU.js → CountdownBlock-8053oz4k.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-Bj7aoBUU.js.map → CountdownBlock-8053oz4k.js.map} +1 -1
- package/dist/cdn/chunks/CountdownToolbar-DQ_zrorh.js +198 -0
- package/dist/cdn/chunks/CountdownToolbar-DQ_zrorh.js.map +1 -0
- package/dist/cdn/chunks/{IssuesPanel-BXLVRo-c.js → IssuesPanel-CwQ376nf.js} +7 -7
- package/dist/cdn/chunks/{IssuesPanel-BXLVRo-c.js.map → IssuesPanel-CwQ376nf.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagSuggestion-jesxS7An.js → MergeTagSuggestion-rpZ6Ol-i.js} +8 -6
- package/dist/cdn/chunks/MergeTagSuggestion-rpZ6Ol-i.js.map +1 -0
- package/dist/cdn/chunks/{ModuleBrowserModal-C7BkJvzf.js → ModuleBrowserModal-DUegB2Jk.js} +8 -8
- package/dist/cdn/chunks/{ModuleBrowserModal-C7BkJvzf.js.map → ModuleBrowserModal-DUegB2Jk.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-BJn-ZHlC.js → ModulePreviewCanvas-f4h8r9Lh.js} +32 -32
- package/dist/cdn/chunks/{ModulePreviewCanvas-BJn-ZHlC.js.map → ModulePreviewCanvas-f4h8r9Lh.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-CkOxH3F7.js → NumberWithSuffix-Bu_nHJuD.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-CkOxH3F7.js.map → NumberWithSuffix-Bu_nHJuD.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-4cMKKC-V.js → ParagraphEditor-IpZsg8qo.js} +75 -75
- package/dist/cdn/chunks/ParagraphEditor-IpZsg8qo.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-7RZe4tbj.js → RichTextEditorContent-DDnqZ9cB.js} +6 -6
- package/dist/cdn/chunks/{RichTextEditorContent-7RZe4tbj.js.map → RichTextEditorContent-DDnqZ9cB.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-mr9A4j6G.js → SaveModuleDialog-CVA5HPCi.js} +31 -30
- package/dist/cdn/chunks/SaveModuleDialog-CVA5HPCi.js.map +1 -0
- package/dist/cdn/chunks/{TitleEditor-Cqw2jvuc.js → TitleEditor-DU8wm0Rh.js} +9 -9
- package/dist/cdn/chunks/TitleEditor-DU8wm0Rh.js.map +1 -0
- package/dist/cdn/chunks/ToggleSwitch-OrmX_w18.js +39 -0
- package/dist/cdn/chunks/ToggleSwitch-OrmX_w18.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-B_xRBxSU.js → blockTypeIcons-Dm5Oosjp.js} +7 -7
- package/dist/cdn/chunks/{blockTypeIcons-B_xRBxSU.js.map → blockTypeIcons-Dm5Oosjp.js.map} +1 -1
- package/dist/cdn/chunks/{ca-B3eR47lE.js → ca-DI1ViqMa.js} +3 -2
- package/dist/cdn/chunks/ca-DI1ViqMa.js.map +1 -0
- package/dist/cdn/chunks/{de-Cy8FB-Ii.js → de-q9lTCMre.js} +3 -2
- package/dist/cdn/chunks/de-q9lTCMre.js.map +1 -0
- package/dist/cdn/chunks/{en-Bu-zS_5o.js → en-CR4LItrX.js} +3 -2
- package/dist/cdn/chunks/en-CR4LItrX.js.map +1 -0
- package/dist/cdn/chunks/{es-CD3ZD6hK.js → es-CEt-lrGd.js} +3 -2
- package/dist/cdn/chunks/es-CEt-lrGd.js.map +1 -0
- package/dist/cdn/chunks/{extensions-Btyx_IMf.js → extensions-BGUoo2a5.js} +29 -29
- package/dist/cdn/chunks/{extensions-Btyx_IMf.js.map → extensions-BGUoo2a5.js.map} +1 -1
- package/dist/cdn/chunks/{features-Dwb5aTLg.js → features-BSpDuFFR.js} +145 -126
- package/dist/cdn/chunks/features-BSpDuFFR.js.map +1 -0
- package/dist/cdn/chunks/{icons-Dhqh5lYQ.js → icons-k3XVoRvc.js} +26 -26
- package/dist/cdn/chunks/{icons-Dhqh5lYQ.js.map → icons-k3XVoRvc.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-DRodsf2D.js → media-library-iDq3otm6.js} +451 -451
- package/dist/cdn/chunks/{media-library-DRodsf2D.js.map → media-library-iDq3otm6.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-CgICL-CQ.js → pt-BR-DvBHY0AA.js} +3 -2
- package/dist/cdn/chunks/pt-BR-DvBHY0AA.js.map +1 -0
- package/dist/cdn/chunks/{quality-A_V2Iqu_.js → quality-Bb7vN32U.js} +512 -512
- package/dist/cdn/chunks/{quality-A_V2Iqu_.js.map → quality-Bb7vN32U.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-BM_-zceB.js → renderer-cOvtk8HM.js} +20 -17
- package/dist/cdn/chunks/{renderer-BM_-zceB.js.map → renderer-cOvtk8HM.js.map} +1 -1
- package/dist/cdn/chunks/{src-DSomxPI-.js → src-Ddp969zE.js} +6 -6
- package/dist/cdn/chunks/{src-DSomxPI-.js.map → src-Ddp969zE.js.map} +1 -1
- package/dist/cdn/chunks/{styles--UXn88wH.js → styles-CW_gRVVR.js} +893 -891
- package/dist/cdn/chunks/styles-CW_gRVVR.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +51 -51
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-D1zYtCPK.js → check-Cg6Mc2pP.js} +1 -1
- package/dist/{chevron-down-ByXpufZD.js → chevron-down-dClfxKrJ.js} +1 -1
- package/dist/{circle-alert-CjcAORUw.js → circle-alert-Bhzm-fNA.js} +1 -1
- package/dist/{clock-5lWLadUn.js → clock-m7TwQw4b.js} +1 -1
- package/dist/{createLucideIcon-Bh9xOmlW.js → createLucideIcon-FSF4peHQ.js} +2 -2
- package/dist/{de-Cy8FB-Ii.js → de-q9lTCMre.js} +2 -1
- package/dist/{en-Bu-zS_5o.js → en-CR4LItrX.js} +2 -1
- package/dist/{es-CD3ZD6hK.js → es-CEt-lrGd.js} +2 -1
- package/dist/{extensions-B2poxDIo.js → extensions-Cjd-VAII.js} +1 -1
- package/dist/{image-up-Bj_nes3f.js → image-up-CDEgJqwA.js} +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/{info-BhSQCxBV.js → info-BNP8yGsK.js} +1 -1
- package/dist/{list-checks-CgxyUg7i.js → list-checks-jepi4iYr.js} +1 -1
- package/dist/{loader-circle-DFU0HPAa.js → loader-circle-BT38qSm3.js} +1 -1
- package/dist/{message-circle-BEBsCHnk.js → message-circle-BAHcL9S-.js} +1 -1
- package/dist/{pt-BR-CgICL-CQ.js → pt-BR-DvBHY0AA.js} +2 -1
- package/dist/{refresh-cw--lvWGy0_.js → refresh-cw-as5Bmg4X.js} +1 -1
- package/dist/{scan-line-QgyDIgn_.js → scan-line-IAMjPtRw.js} +1 -1
- package/dist/{send-BMyisUim.js → send-DvMay6bt.js} +1 -1
- package/dist/{shield-check-C49M20le.js → shield-check-YYDhGroE.js} +1 -1
- package/dist/{sparkles-DV7Dman6.js → sparkles-CCwQMMMZ.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-CPt6RYEc.js → styles-DJfTblY7.js} +764 -762
- package/dist/templatical-editor.js +9 -9
- package/dist/{text-align-start-BMU70uAm.js → text-align-start-BwsA6QzC.js} +11 -11
- package/dist/{trash-2-B6M659Ey.js → trash-2-CRBDolnR.js} +1 -1
- package/dist/{triangle-alert-D1lzx6ds.js → triangle-alert-B2g0ALvq.js} +1 -1
- package/dist/{upload-3A1oZtOR.js → upload-BKg6hDRW.js} +1 -1
- package/dist/{useEditorCore-CSfeEwCj.js → useEditorCore-DnOG2a_b.js} +656 -656
- package/dist/usePopoverPosition-B3Byo68F.js +281 -0
- package/dist/{x-CG_NV3nP.js → x-Ctg_250T.js} +1 -1
- package/package.json +8 -8
- package/dist/cdn/chunks/ColorPicker-Pi-1fR8c.js.map +0 -1
- package/dist/cdn/chunks/CountdownToolbar-B1oniVq1.js +0 -212
- package/dist/cdn/chunks/CountdownToolbar-B1oniVq1.js.map +0 -1
- package/dist/cdn/chunks/MergeTagSuggestion-jesxS7An.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-4cMKKC-V.js.map +0 -1
- package/dist/cdn/chunks/SaveModuleDialog-mr9A4j6G.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-Cqw2jvuc.js.map +0 -1
- package/dist/cdn/chunks/ca-B3eR47lE.js.map +0 -1
- package/dist/cdn/chunks/de-Cy8FB-Ii.js.map +0 -1
- package/dist/cdn/chunks/en-Bu-zS_5o.js.map +0 -1
- package/dist/cdn/chunks/es-CD3ZD6hK.js.map +0 -1
- package/dist/cdn/chunks/features-Dwb5aTLg.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-CgICL-CQ.js.map +0 -1
- package/dist/cdn/chunks/styles--UXn88wH.js.map +0 -1
- package/dist/color-DhoxCSMv.js +0 -259
- package/dist/usePopoverRoot-C1j0D7cc.js +0 -8
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { E as e, I as t, L as n, Y as r, Z as i, b as a, et as o, nt as s, s as c, v as l, x as u } from "./vue.runtime.esm-bundler-B0xoGkDv.js";
|
|
2
|
+
import { _ as d, a as f, d as p, i as m, l as h, n as g, o as _, r as v, s as y, t as b, u as x } from "./dist-DYv_Pttj.js";
|
|
3
|
+
import { A as S } from "./keys-BbDgCU6K.js";
|
|
4
|
+
//#region ../../node_modules/.pnpm/@vueuse+core@14.3.0_vue@3.5.40_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
|
|
5
|
+
var C = g ? window : void 0;
|
|
6
|
+
g && window.document, g && window.navigator, g && window.location;
|
|
7
|
+
function w(e) {
|
|
8
|
+
let t = o(e);
|
|
9
|
+
return t?.$el ?? t;
|
|
10
|
+
}
|
|
11
|
+
function T(...e) {
|
|
12
|
+
let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = c(() => {
|
|
13
|
+
let t = h(o(e[0])).filter((e) => e != null);
|
|
14
|
+
return t.every((e) => typeof e != "string") ? t : void 0;
|
|
15
|
+
});
|
|
16
|
+
return d(() => [
|
|
17
|
+
n.value?.map((e) => w(e)) ?? [C].filter((e) => e != null),
|
|
18
|
+
h(o(n.value ? e[1] : e[0])),
|
|
19
|
+
h(s(n.value ? e[2] : e[1])),
|
|
20
|
+
o(n.value ? e[3] : e[2])
|
|
21
|
+
], ([e, n, r, i], a, o) => {
|
|
22
|
+
if (!e?.length || !n?.length || !r?.length) return;
|
|
23
|
+
let s = m(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
|
|
24
|
+
o(() => {
|
|
25
|
+
c.forEach((e) => e());
|
|
26
|
+
});
|
|
27
|
+
}, { flush: "post" });
|
|
28
|
+
}
|
|
29
|
+
var E = !1;
|
|
30
|
+
function D(e, t, n = {}) {
|
|
31
|
+
let { window: r = C, ignore: i = [], capture: a = !0, detectIframe: s = !1, controls: c = !1 } = n;
|
|
32
|
+
if (!r) return c ? {
|
|
33
|
+
stop: f,
|
|
34
|
+
cancel: f,
|
|
35
|
+
trigger: f
|
|
36
|
+
} : f;
|
|
37
|
+
if (v && !E) {
|
|
38
|
+
E = !0;
|
|
39
|
+
let e = { passive: !0 };
|
|
40
|
+
Array.from(r.document.body.children).forEach((t) => t.addEventListener("click", f, e)), r.document.documentElement.addEventListener("click", f, e);
|
|
41
|
+
}
|
|
42
|
+
let l = !0, u = (e) => o(i).some((t) => {
|
|
43
|
+
if (typeof t == "string") return Array.from(r.document.querySelectorAll(t)).some((t) => t === e.target || e.composedPath().includes(t));
|
|
44
|
+
{
|
|
45
|
+
let n = w(t);
|
|
46
|
+
return n && (e.target === n || e.composedPath().includes(n));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
function d(e) {
|
|
50
|
+
let t = o(e);
|
|
51
|
+
return t && t.$.subTree.shapeFlag === 16;
|
|
52
|
+
}
|
|
53
|
+
function p(e, t) {
|
|
54
|
+
let n = o(e), r = n.$.subTree && n.$.subTree.children;
|
|
55
|
+
return r == null || !Array.isArray(r) ? !1 : r.some((e) => e.el === t.target || t.composedPath().includes(e.el));
|
|
56
|
+
}
|
|
57
|
+
let m = (n) => {
|
|
58
|
+
let r = w(e);
|
|
59
|
+
if (n.target != null && !(!(r instanceof Element) && d(e) && p(e, n)) && !(!r || r === n.target || n.composedPath().includes(r))) {
|
|
60
|
+
if ("detail" in n && n.detail === 0 && (l = !u(n)), !l) {
|
|
61
|
+
l = !0;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
t(n);
|
|
65
|
+
}
|
|
66
|
+
}, h = !1, g = [
|
|
67
|
+
T(r, "click", (e) => {
|
|
68
|
+
h || (h = !0, setTimeout(() => {
|
|
69
|
+
h = !1;
|
|
70
|
+
}, 0), m(e));
|
|
71
|
+
}, {
|
|
72
|
+
passive: !0,
|
|
73
|
+
capture: a
|
|
74
|
+
}),
|
|
75
|
+
T(r, "pointerdown", (t) => {
|
|
76
|
+
let n = w(e);
|
|
77
|
+
l = !u(t) && !!(n && !t.composedPath().includes(n));
|
|
78
|
+
}, { passive: !0 }),
|
|
79
|
+
s && T(r, "blur", (n) => {
|
|
80
|
+
setTimeout(() => {
|
|
81
|
+
let i = w(e), a = r.document.activeElement;
|
|
82
|
+
for (; a?.shadowRoot;) a = a.shadowRoot.activeElement;
|
|
83
|
+
a?.tagName === "IFRAME" && !i?.contains(r.document.activeElement) && t(n);
|
|
84
|
+
}, 0);
|
|
85
|
+
}, { passive: !0 })
|
|
86
|
+
].filter(Boolean), _ = () => g.forEach((e) => e());
|
|
87
|
+
return c ? {
|
|
88
|
+
stop: _,
|
|
89
|
+
cancel: () => {
|
|
90
|
+
l = !1;
|
|
91
|
+
},
|
|
92
|
+
trigger: (e) => {
|
|
93
|
+
l = !0, m(e), l = !1;
|
|
94
|
+
}
|
|
95
|
+
} : _;
|
|
96
|
+
}
|
|
97
|
+
function O() {
|
|
98
|
+
let t = i(!1), n = l();
|
|
99
|
+
return n && e(() => {
|
|
100
|
+
t.value = !0;
|
|
101
|
+
}, n), t;
|
|
102
|
+
}
|
|
103
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
104
|
+
function k(e) {
|
|
105
|
+
let t = O();
|
|
106
|
+
return c(() => (t.value, !!e()));
|
|
107
|
+
}
|
|
108
|
+
function A(e, n, r = {}) {
|
|
109
|
+
let { window: i = C, ...a } = r, s, l = /* @__PURE__ */ k(() => i && "MutationObserver" in i), u = () => {
|
|
110
|
+
s &&= (s.disconnect(), void 0);
|
|
111
|
+
}, d = t(c(() => {
|
|
112
|
+
let t = h(o(e)).map(w).filter(_);
|
|
113
|
+
return new Set(t);
|
|
114
|
+
}), (e) => {
|
|
115
|
+
u(), l.value && e.size && (s = new MutationObserver(n), e.forEach((e) => s.observe(e, a)));
|
|
116
|
+
}, {
|
|
117
|
+
immediate: !0,
|
|
118
|
+
flush: "post"
|
|
119
|
+
}), f = () => s?.takeRecords(), m = () => {
|
|
120
|
+
d(), u();
|
|
121
|
+
};
|
|
122
|
+
return p(m), {
|
|
123
|
+
isSupported: l,
|
|
124
|
+
stop: m,
|
|
125
|
+
takeRecords: f
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
var j = Symbol("vueuse-ssr-width");
|
|
129
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
130
|
+
function M() {
|
|
131
|
+
let e = a() ? b(j, null) : null;
|
|
132
|
+
return typeof e == "number" ? e : void 0;
|
|
133
|
+
}
|
|
134
|
+
function N(e, t = {}) {
|
|
135
|
+
let { window: r = C, ssrWidth: a = /* @__PURE__ */ M() } = t, s = /* @__PURE__ */ k(() => r && "matchMedia" in r && typeof r.matchMedia == "function"), l = i(typeof a == "number"), u = i(), d = i(!1);
|
|
136
|
+
return n(() => {
|
|
137
|
+
if (l.value) {
|
|
138
|
+
l.value = !s.value, d.value = o(e).split(",").some((e) => {
|
|
139
|
+
let t = e.includes("not all"), n = e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), r = e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), i = !!(n || r);
|
|
140
|
+
return n && i && (i = a >= y(n[1])), r && i && (i = a <= y(r[1])), t ? !i : i;
|
|
141
|
+
});
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
s.value && (u.value = r.matchMedia(o(e)), d.value = u.value.matches);
|
|
145
|
+
}), T(u, "change", (e) => {
|
|
146
|
+
d.value = e.matches;
|
|
147
|
+
}, { passive: !0 }), c(() => d.value);
|
|
148
|
+
}
|
|
149
|
+
function P(e, t = {}) {
|
|
150
|
+
let n = i(!1), r = i(null), a = 0, o = !0;
|
|
151
|
+
if (g) {
|
|
152
|
+
let i = typeof t == "function" ? { onDrop: t } : t, c = i.multiple ?? !0, l = i.preventDefaultForUnhandled ?? !1, u = (e) => {
|
|
153
|
+
let t = Array.from(e.dataTransfer?.files ?? []);
|
|
154
|
+
return t.length === 0 ? null : c ? t : [t[0]];
|
|
155
|
+
}, d = (e) => {
|
|
156
|
+
let t = s(i.dataTypes);
|
|
157
|
+
return typeof t == "function" ? t(e) : !t?.length || e.length !== 0 && e.every((e) => t.some((t) => e.includes(t)));
|
|
158
|
+
}, f = (e) => {
|
|
159
|
+
if (i.checkValidity) return i.checkValidity(e);
|
|
160
|
+
let t = d(Array.from(e ?? []).map((e) => e.type)), n = c || e.length <= 1;
|
|
161
|
+
return t && n;
|
|
162
|
+
}, p = () => /^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent) && !("chrome" in window), m = (e, t) => {
|
|
163
|
+
let s = e.dataTransfer?.items;
|
|
164
|
+
if (o = (s && f(s)) ?? !1, l && e.preventDefault(), !p() && !o) {
|
|
165
|
+
e.dataTransfer && (e.dataTransfer.dropEffect = "none");
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "copy");
|
|
169
|
+
let c = u(e);
|
|
170
|
+
switch (t) {
|
|
171
|
+
case "enter":
|
|
172
|
+
var d;
|
|
173
|
+
a += 1, n.value = !0, (d = i.onEnter) == null || d.call(i, null, e);
|
|
174
|
+
break;
|
|
175
|
+
case "over":
|
|
176
|
+
var m;
|
|
177
|
+
(m = i.onOver) == null || m.call(i, null, e);
|
|
178
|
+
break;
|
|
179
|
+
case "leave":
|
|
180
|
+
var h;
|
|
181
|
+
--a, a === 0 && (n.value = !1), (h = i.onLeave) == null || h.call(i, null, e);
|
|
182
|
+
break;
|
|
183
|
+
case "drop":
|
|
184
|
+
if (a = 0, n.value = !1, o) {
|
|
185
|
+
var g;
|
|
186
|
+
r.value = c, (g = i.onDrop) == null || g.call(i, c, e);
|
|
187
|
+
}
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
T(e, "dragenter", (e) => m(e, "enter")), T(e, "dragover", (e) => m(e, "over")), T(e, "dragleave", (e) => m(e, "leave")), T(e, "drop", (e) => m(e, "drop"));
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
files: r,
|
|
195
|
+
isOverDropZone: n
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function F(e, n, r = {}) {
|
|
199
|
+
let { window: i = C, ...a } = r, s, l = /* @__PURE__ */ k(() => i && "ResizeObserver" in i), u = () => {
|
|
200
|
+
s &&= (s.disconnect(), void 0);
|
|
201
|
+
}, d = t(c(() => {
|
|
202
|
+
let t = o(e);
|
|
203
|
+
return Array.isArray(t) ? t.map((e) => w(e)) : [w(t)];
|
|
204
|
+
}), (e) => {
|
|
205
|
+
if (u(), l.value && i) {
|
|
206
|
+
s = new ResizeObserver(n);
|
|
207
|
+
for (let t of e) t && s.observe(t, a);
|
|
208
|
+
}
|
|
209
|
+
}, {
|
|
210
|
+
immediate: !0,
|
|
211
|
+
flush: "post"
|
|
212
|
+
}), f = () => {
|
|
213
|
+
u(), d();
|
|
214
|
+
};
|
|
215
|
+
return p(f), {
|
|
216
|
+
isSupported: l,
|
|
217
|
+
stop: f
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function I(e, n = {}) {
|
|
221
|
+
let { reset: r = !0, windowResize: a = !0, windowScroll: o = !0, immediate: s = !0, updateTiming: c = "sync" } = n, l = i(0), u = i(0), d = i(0), f = i(0), p = i(0), m = i(0), h = i(0), g = i(0);
|
|
222
|
+
function _() {
|
|
223
|
+
let t = w(e);
|
|
224
|
+
if (!t) {
|
|
225
|
+
r && (l.value = 0, u.value = 0, d.value = 0, f.value = 0, p.value = 0, m.value = 0, h.value = 0, g.value = 0);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
let n = t.getBoundingClientRect();
|
|
229
|
+
l.value = n.height, u.value = n.bottom, d.value = n.left, f.value = n.right, p.value = n.top, m.value = n.width, h.value = n.x, g.value = n.y;
|
|
230
|
+
}
|
|
231
|
+
function v() {
|
|
232
|
+
c === "sync" ? _() : c === "next-frame" && requestAnimationFrame(() => _());
|
|
233
|
+
}
|
|
234
|
+
return F(e, v), t(() => w(e), (e) => !e && v()), A(e, v, { attributeFilter: ["style", "class"] }), o && T("scroll", v, {
|
|
235
|
+
capture: !0,
|
|
236
|
+
passive: !0
|
|
237
|
+
}), a && T("resize", v, { passive: !0 }), x(() => {
|
|
238
|
+
s && v();
|
|
239
|
+
}), {
|
|
240
|
+
height: l,
|
|
241
|
+
bottom: u,
|
|
242
|
+
left: d,
|
|
243
|
+
right: f,
|
|
244
|
+
top: p,
|
|
245
|
+
width: m,
|
|
246
|
+
x: h,
|
|
247
|
+
y: g,
|
|
248
|
+
update: v
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/utils/color.ts
|
|
253
|
+
function L(e) {
|
|
254
|
+
let t = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e.trim());
|
|
255
|
+
if (!t) return e;
|
|
256
|
+
let n = (e) => Number(e).toString(16).padStart(2, "0");
|
|
257
|
+
return `#${n(t[1])}${n(t[2])}${n(t[3])}`;
|
|
258
|
+
}
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region src/composables/usePopoverRoot.ts
|
|
261
|
+
function R() {
|
|
262
|
+
return u(S, r(null));
|
|
263
|
+
}
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region src/composables/usePopoverPosition.ts
|
|
266
|
+
function z() {
|
|
267
|
+
let e = R();
|
|
268
|
+
function t(t) {
|
|
269
|
+
let n = e.value?.getBoundingClientRect();
|
|
270
|
+
return n ? {
|
|
271
|
+
top: t.top - n.top,
|
|
272
|
+
left: t.left - n.left
|
|
273
|
+
} : {
|
|
274
|
+
top: t.top,
|
|
275
|
+
left: t.left
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
return { toLocal: t };
|
|
279
|
+
}
|
|
280
|
+
//#endregion
|
|
281
|
+
export { P as a, N as c, D as i, R as n, I as o, L as r, T as s, z as t };
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@templatical/editor",
|
|
3
3
|
"description": "Vue 3 visual drag-and-drop email editor powered by Templatical",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.5",
|
|
5
5
|
"bugs": "https://github.com/templatical/sdk/issues",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@lucide/vue": "^1.
|
|
7
|
+
"@lucide/vue": "^1.25.0",
|
|
8
8
|
"@tiptap/core": "^3.28.0",
|
|
9
9
|
"@tiptap/extension-color": "^3.28.0",
|
|
10
10
|
"@tiptap/extension-font-family": "^3.28.0",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"vue": "^3.5.40",
|
|
33
33
|
"vue-draggable-plus": "^0.6.1",
|
|
34
34
|
"vue-tsc": "^3.3.7",
|
|
35
|
-
"@templatical/core": "0.16.
|
|
36
|
-
"@templatical/quality": "0.16.
|
|
37
|
-
"@templatical/types": "0.16.
|
|
35
|
+
"@templatical/core": "0.16.5",
|
|
36
|
+
"@templatical/quality": "0.16.5",
|
|
37
|
+
"@templatical/types": "0.16.5"
|
|
38
38
|
},
|
|
39
39
|
"exports": {
|
|
40
40
|
".": {
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"license": "SEE LICENSE IN LICENSE",
|
|
63
63
|
"module": "./dist/templatical-editor.js",
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@templatical/
|
|
66
|
-
"@templatical/
|
|
67
|
-
"@templatical/renderer": "0.16.
|
|
65
|
+
"@templatical/quality": "0.16.5",
|
|
66
|
+
"@templatical/media-library": "0.16.5",
|
|
67
|
+
"@templatical/renderer": "0.16.5"
|
|
68
68
|
},
|
|
69
69
|
"peerDependenciesMeta": {
|
|
70
70
|
"@templatical/renderer": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker-Pi-1fR8c.js","names":["css","hueCss","saturationCss"],"sources":["../../../src/constants/styleConstants.ts","../../../../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/utils/math.js","../../../../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/utils/convert.js","../../../../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/utils/compare.js","../../../../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/utils/dom.js","../../../../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/components/slider.js","../../../../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/components/hue.js","../../../../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/components/saturation.js","../../../../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/styles/color-picker.js","../../../../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/styles/hue.js","../../../../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/styles/saturation.js","../../../../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/components/color-picker.js","../../../../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/entrypoints/hex.js","../../../../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/hex-color-picker.js","../../../src/components/ColorPicker.vue","../../../src/components/ColorPicker.vue"],"sourcesContent":["export const labelClass =\n \"tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\";\n\nexport const inputClass =\n \"tpl:w-full tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-sm tpl:border tpl:rounded-[var(--tpl-radius-sm)] tpl:shadow-xs tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)] placeholder:tpl:text-[var(--tpl-text-dim)]\";\n\nexport const inputGroupInputClass =\n \"tpl:w-full tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-sm tpl:border tpl:rounded-l-[var(--tpl-radius-sm)] tpl:rounded-r-none tpl:border-r-0 tpl:shadow-xs tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)] placeholder:tpl:text-[var(--tpl-text-dim)]\";\n\nexport const inputSuffixClass =\n \"tpl:flex tpl:items-center tpl:px-2.5 tpl:text-xs tpl:border tpl:border-l-0 tpl:text-[var(--tpl-text-dim)] tpl:bg-[var(--tpl-bg-hover)] tpl:border-[var(--tpl-border)] tpl:rounded-r-[var(--tpl-radius-sm)]\";\n\nexport const colorInputClass =\n \"tpl:w-10 tpl:shrink-0 tpl:h-10 tpl:p-0.5 tpl:border tpl:rounded-[var(--tpl-radius-sm)] tpl:cursor-pointer tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]\";\n\nexport const colorTextClass =\n \"tpl:flex-1 tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-mono tpl:border tpl:rounded-[var(--tpl-radius-sm)] tpl:shadow-xs tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)]\";\n\nexport const btnClass =\n \"tpl:flex-1 tpl:px-2.5 tpl:py-[7px] tpl:text-sm tpl:font-medium tpl:cursor-pointer tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:text-[var(--tpl-text-muted)] tpl:bg-transparent tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)]\";\n\nexport const btnActiveClass =\n \"tpl:flex-1 tpl:px-2.5 tpl:py-[7px] tpl:text-sm tpl:font-medium tpl:cursor-pointer tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)]\";\n\nexport const cardClass =\n \"tpl:rounded-[var(--tpl-radius)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-4 tpl:border tpl:border-[var(--tpl-border)] tpl:transition-colors tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)]\";\n\nexport const outlineBtnClass =\n \"tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:border tpl:cursor-pointer tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:text-[var(--tpl-primary)] tpl:bg-transparent tpl:border-[var(--tpl-primary)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary)] hover:tpl:text-[var(--tpl-bg)]\";\n\nexport const removeItemBtnClass =\n \"tpl:flex tpl:size-8 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]\";\n\nexport const addItemBtnClass =\n \"tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]\";\n\nexport const monoTextareaClass =\n \"tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-150 tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]\";\n\nexport const headerBtnClass =\n \"tpl-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3.5 tpl:py-2 tpl:text-sm tpl:font-medium tpl:whitespace-nowrap tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary)] hover:tpl:text-[var(--tpl-bg)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50\";\n\n// Rich text toolbar presets\nexport const FONT_SIZE_OPTIONS = [\n \"10px\",\n \"12px\",\n \"14px\",\n \"16px\",\n \"18px\",\n \"20px\",\n \"24px\",\n \"28px\",\n \"32px\",\n \"36px\",\n \"48px\",\n \"64px\",\n];\n\nexport const LINE_HEIGHT_OPTIONS = [\n \"1\",\n \"1.2\",\n \"1.4\",\n \"1.5\",\n \"1.6\",\n \"1.8\",\n \"2\",\n \"2.5\",\n];\n\nexport const LETTER_SPACING_OPTIONS = [\n { label: \"Normal\", value: \"normal\" },\n { label: \"-0.5px\", value: \"-0.5px\" },\n { label: \"0.5px\", value: \"0.5px\" },\n { label: \"1px\", value: \"1px\" },\n { label: \"1.5px\", value: \"1.5px\" },\n { label: \"2px\", value: \"2px\" },\n { label: \"3px\", value: \"3px\" },\n];\n\n// Default color constants\nexport const DEFAULT_TEXT_COLOR = \"#000000\";\nexport const DEFAULT_BG_COLOR = \"#ffffff\";\nexport const DEFAULT_HIGHLIGHT_COLOR = \"#ffff00\";\nexport const DEFAULT_TABLE_ROW_BG = \"#f2f2f2\";\n","// Clamps a value between an upper and lower bound.\n// We use ternary operators because it makes the minified code\n// 2 times shorter then `Math.min(Math.max(a,b),c)`\nexport const clamp = (number, min = 0, max = 1) => {\n return number > max ? max : number < min ? min : number;\n};\nexport const round = (number, digits = 0, base = Math.pow(10, digits)) => {\n return Math.round(base * number) / base;\n};\n//# sourceMappingURL=math.js.map","import { round } from './math.js';\n/**\n * Valid CSS <angle> units.\n * https://developer.mozilla.org/en-US/docs/Web/CSS/angle\n */\nconst angleUnits = {\n grad: 360 / 400,\n turn: 360,\n rad: 360 / (Math.PI * 2)\n};\nexport const hexToHsva = (hex) => rgbaToHsva(hexToRgba(hex));\nexport const hexToRgba = (hex) => {\n if (hex[0] === '#')\n hex = hex.substring(1);\n if (hex.length < 6) {\n return {\n r: parseInt(hex[0] + hex[0], 16),\n g: parseInt(hex[1] + hex[1], 16),\n b: parseInt(hex[2] + hex[2], 16),\n a: hex.length === 4 ? round(parseInt(hex[3] + hex[3], 16) / 255, 2) : 1\n };\n }\n return {\n r: parseInt(hex.substring(0, 2), 16),\n g: parseInt(hex.substring(2, 4), 16),\n b: parseInt(hex.substring(4, 6), 16),\n a: hex.length === 8 ? round(parseInt(hex.substring(6, 8), 16) / 255, 2) : 1\n };\n};\nexport const parseHue = (value, unit = 'deg') => {\n return Number(value) * (angleUnits[unit] || 1);\n};\nexport const hslaStringToHsva = (hslString) => {\n const matcher = /hsla?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hslString);\n if (!match)\n return { h: 0, s: 0, v: 0, a: 1 };\n return hslaToHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n l: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1)\n });\n};\nexport const hslStringToHsva = hslaStringToHsva;\nexport const hslaToHsva = ({ h, s, l, a }) => {\n s *= (l < 50 ? l : 100 - l) / 100;\n return {\n h: h,\n s: s > 0 ? ((2 * s) / (l + s)) * 100 : 0,\n v: l + s,\n a\n };\n};\nexport const hsvaToHex = (hsva) => rgbaToHex(hsvaToRgba(hsva));\nexport const hsvaToHsla = ({ h, s, v, a }) => {\n const hh = ((200 - s) * v) / 100;\n return {\n h: round(h),\n s: round(hh > 0 && hh < 200 ? ((s * v) / 100 / (hh <= 100 ? hh : 200 - hh)) * 100 : 0),\n l: round(hh / 2),\n a: round(a, 2)\n };\n};\nexport const hsvaToHsvString = (hsva) => {\n const { h, s, v } = roundHsva(hsva);\n return `hsv(${h}, ${s}%, ${v}%)`;\n};\nexport const hsvaToHsvaString = (hsva) => {\n const { h, s, v, a } = roundHsva(hsva);\n return `hsva(${h}, ${s}%, ${v}%, ${a})`;\n};\nexport const hsvaToHslString = (hsva) => {\n const { h, s, l } = hsvaToHsla(hsva);\n return `hsl(${h}, ${s}%, ${l}%)`;\n};\nexport const hsvaToHslaString = (hsva) => {\n const { h, s, l, a } = hsvaToHsla(hsva);\n return `hsla(${h}, ${s}%, ${l}%, ${a})`;\n};\nexport const hsvaToRgba = ({ h, s, v, a }) => {\n h = (h / 360) * 6;\n s = s / 100;\n v = v / 100;\n const hh = Math.floor(h), b = v * (1 - s), c = v * (1 - (h - hh) * s), d = v * (1 - (1 - h + hh) * s), module = hh % 6;\n return {\n r: round([v, c, b, b, d, v][module] * 255),\n g: round([d, v, v, c, b, b][module] * 255),\n b: round([b, b, d, v, v, c][module] * 255),\n a: round(a, 2)\n };\n};\nexport const hsvaToRgbString = (hsva) => {\n const { r, g, b } = hsvaToRgba(hsva);\n return `rgb(${r}, ${g}, ${b})`;\n};\nexport const hsvaToRgbaString = (hsva) => {\n const { r, g, b, a } = hsvaToRgba(hsva);\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n};\nexport const hsvaStringToHsva = (hsvString) => {\n const matcher = /hsva?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hsvString);\n if (!match)\n return { h: 0, s: 0, v: 0, a: 1 };\n return roundHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n v: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1)\n });\n};\nexport const hsvStringToHsva = hsvaStringToHsva;\nexport const rgbaStringToHsva = (rgbaString) => {\n const matcher = /rgba?\\(?\\s*(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(rgbaString);\n if (!match)\n return { h: 0, s: 0, v: 0, a: 1 };\n return rgbaToHsva({\n r: Number(match[1]) / (match[2] ? 100 / 255 : 1),\n g: Number(match[3]) / (match[4] ? 100 / 255 : 1),\n b: Number(match[5]) / (match[6] ? 100 / 255 : 1),\n a: match[7] === undefined ? 1 : Number(match[7]) / (match[8] ? 100 : 1)\n });\n};\nexport const rgbStringToHsva = rgbaStringToHsva;\nconst format = (number) => {\n const hex = number.toString(16);\n return hex.length < 2 ? '0' + hex : hex;\n};\nexport const rgbaToHex = ({ r, g, b, a }) => {\n const alphaHex = a < 1 ? format(round(a * 255)) : '';\n return '#' + format(r) + format(g) + format(b) + alphaHex;\n};\nexport const rgbaToHsva = ({ r, g, b, a }) => {\n const max = Math.max(r, g, b);\n const delta = max - Math.min(r, g, b);\n // prettier-ignore\n const hh = delta\n ? max === r\n ? (g - b) / delta\n : max === g\n ? 2 + (b - r) / delta\n : 4 + (r - g) / delta\n : 0;\n return {\n h: round(60 * (hh < 0 ? hh + 6 : hh)),\n s: round(max ? (delta / max) * 100 : 0),\n v: round((max / 255) * 100),\n a\n };\n};\nexport const roundHsva = (hsva) => ({\n h: round(hsva.h),\n s: round(hsva.s),\n v: round(hsva.v),\n a: round(hsva.a, 2)\n});\nexport const rgbaToRgb = ({ r, g, b }) => ({ r, g, b });\nexport const hslaToHsl = ({ h, s, l }) => ({ h, s, l });\nexport const hsvaToHsv = (hsva) => {\n const { h, s, v } = roundHsva(hsva);\n return { h, s, v };\n};\n//# sourceMappingURL=convert.js.map","import { hexToRgba } from './convert.js';\nexport const equalColorObjects = (first, second) => {\n if (first === second)\n return true;\n for (const prop in first) {\n // The following allows for a type-safe calling of this function (first & second have to be HSL, HSV, or RGB)\n // with type-unsafe iterating over object keys. TS does not allow this without an index (`[key: string]: number`)\n // on an object to define how iteration is normally done. To ensure extra keys are not allowed on our types,\n // we must cast our object to unknown (as RGB demands `r` be a key, while `Record<string, x>` does not care if\n // there is or not), and then as a type TS can iterate over.\n if (first[prop] !==\n second[prop])\n return false;\n }\n return true;\n};\nexport const equalColorString = (first, second) => {\n return first.replace(/\\s/g, '') === second.replace(/\\s/g, '');\n};\nexport const equalHex = (first, second) => {\n if (first.toLowerCase() === second.toLowerCase())\n return true;\n // To compare colors like `#FFF` and `ffffff` we convert them into RGB objects\n return equalColorObjects(hexToRgba(first), hexToRgba(second));\n};\n//# sourceMappingURL=compare.js.map","const cache = {};\nexport const tpl = (html) => {\n let template = cache[html];\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = html;\n cache[html] = template;\n }\n return template;\n};\nexport const fire = (target, type, detail) => {\n target.dispatchEvent(new CustomEvent(type, {\n bubbles: true,\n detail\n }));\n};\n//# sourceMappingURL=dom.js.map","import { fire, tpl } from '../utils/dom.js';\nimport { clamp } from '../utils/math.js';\nlet hasTouched = false;\n// Check if an event was triggered by touch\nconst isTouch = (e) => 'touches' in e;\n// Prevent mobile browsers from handling mouse events (conflicting with touch ones).\n// If we detected a touch interaction before, we prefer reacting to touch events only.\nconst isValid = (event) => {\n if (hasTouched && !isTouch(event))\n return false;\n if (!hasTouched)\n hasTouched = isTouch(event);\n return true;\n};\nconst pointerMove = (target, event) => {\n const pointer = isTouch(event) ? event.touches[0] : event;\n const rect = target.el.getBoundingClientRect();\n fire(target.el, 'move', target.getMove({\n x: clamp((pointer.pageX - (rect.left + window.pageXOffset)) / rect.width),\n y: clamp((pointer.pageY - (rect.top + window.pageYOffset)) / rect.height)\n }));\n};\nconst keyMove = (target, event) => {\n // We use `keyCode` instead of `key` to reduce the size of the library.\n const keyCode = event.keyCode;\n // Ignore all keys except arrow ones, Page Up, Page Down, Home and End.\n if (keyCode > 40 || (target.xy && keyCode < 37) || keyCode < 33)\n return;\n // Do not scroll page by keys when color picker element has focus.\n event.preventDefault();\n // Send relative offset to the parent component.\n fire(target.el, 'move', target.getMove({\n x: keyCode === 39 // Arrow Right\n ? 0.01\n : keyCode === 37 // Arrow Left\n ? -0.01\n : keyCode === 34 // Page Down\n ? 0.05\n : keyCode === 33 // Page Up\n ? -0.05\n : keyCode === 35 // End\n ? 1\n : keyCode === 36 // Home\n ? -1\n : 0,\n y: keyCode === 40 // Arrow down\n ? 0.01\n : keyCode === 38 // Arrow Up\n ? -0.01\n : 0\n }, true));\n};\nexport class Slider {\n constructor(root, part, aria, xy) {\n const template = tpl(`<div role=\"slider\" tabindex=\"0\" part=\"${part}\" ${aria}><div part=\"${part}-pointer\"></div></div>`);\n root.appendChild(template.content.cloneNode(true));\n const el = root.querySelector(`[part=${part}]`);\n el.addEventListener('mousedown', this);\n el.addEventListener('touchstart', this);\n el.addEventListener('keydown', this);\n this.el = el;\n this.xy = xy;\n this.nodes = [el.firstChild, el];\n }\n set dragging(state) {\n const toggleEvent = state ? document.addEventListener : document.removeEventListener;\n toggleEvent(hasTouched ? 'touchmove' : 'mousemove', this);\n toggleEvent(hasTouched ? 'touchend' : 'mouseup', this);\n }\n handleEvent(event) {\n switch (event.type) {\n case 'mousedown':\n case 'touchstart':\n event.preventDefault();\n // event.button is 0 in mousedown for left button activation\n if (!isValid(event) || (!hasTouched && event.button != 0))\n return;\n this.el.focus();\n pointerMove(this, event);\n this.dragging = true;\n break;\n case 'mousemove':\n case 'touchmove':\n event.preventDefault();\n pointerMove(this, event);\n break;\n case 'mouseup':\n case 'touchend':\n this.dragging = false;\n break;\n case 'keydown':\n keyMove(this, event);\n break;\n }\n }\n style(styles) {\n styles.forEach((style, i) => {\n for (const p in style) {\n this.nodes[i].style.setProperty(p, style[p]);\n }\n });\n }\n}\n//# sourceMappingURL=slider.js.map","import { Slider } from './slider.js';\nimport { hsvaToHslString } from '../utils/convert.js';\nimport { clamp, round } from '../utils/math.js';\nexport class Hue extends Slider {\n constructor(root) {\n super(root, 'hue', 'aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"', false);\n }\n update({ h }) {\n this.h = h;\n this.style([\n {\n left: `${(h / 360) * 100}%`,\n color: hsvaToHslString({ h, s: 100, v: 100, a: 1 })\n }\n ]);\n this.el.setAttribute('aria-valuenow', `${round(h)}`);\n }\n getMove(offset, key) {\n // Hue measured in degrees of the color circle ranging from 0 to 360\n return { h: key ? clamp(this.h + offset.x * 360, 0, 360) : 360 * offset.x };\n }\n}\n//# sourceMappingURL=hue.js.map","import { Slider } from './slider.js';\nimport { hsvaToHslString } from '../utils/convert.js';\nimport { clamp, round } from '../utils/math.js';\nexport class Saturation extends Slider {\n constructor(root) {\n super(root, 'saturation', 'aria-label=\"Color\"', true);\n }\n update(hsva) {\n this.hsva = hsva;\n this.style([\n {\n top: `${100 - hsva.v}%`,\n left: `${hsva.s}%`,\n color: hsvaToHslString(hsva)\n },\n {\n 'background-color': hsvaToHslString({ h: hsva.h, s: 100, v: 100, a: 1 })\n }\n ]);\n this.el.setAttribute('aria-valuetext', `Saturation ${round(hsva.s)}%, Brightness ${round(hsva.v)}%`);\n }\n getMove(offset, key) {\n // Saturation and brightness always fit into [0, 100] range\n return {\n s: key ? clamp(this.hsva.s + offset.x * 100, 0, 100) : offset.x * 100,\n v: key ? clamp(this.hsva.v - offset.y * 100, 0, 100) : Math.round(100 - offset.y * 100)\n };\n }\n}\n//# sourceMappingURL=saturation.js.map","export default `:host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:\"\";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}`;\n//# sourceMappingURL=color-picker.js.map","export default `[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}`;\n//# sourceMappingURL=hue.js.map","export default `[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}`;\n//# sourceMappingURL=saturation.js.map","import { equalColorObjects } from '../utils/compare.js';\nimport { fire, tpl } from '../utils/dom.js';\nimport { Hue } from './hue.js';\nimport { Saturation } from './saturation.js';\nimport css from '../styles/color-picker.js';\nimport hueCss from '../styles/hue.js';\nimport saturationCss from '../styles/saturation.js';\nconst $isSame = Symbol('same');\nconst $color = Symbol('color');\nconst $hsva = Symbol('hsva');\nconst $update = Symbol('update');\nconst $parts = Symbol('parts');\nexport const $css = Symbol('css');\nexport const $sliders = Symbol('sliders');\nexport class ColorPicker extends HTMLElement {\n static get observedAttributes() {\n return ['color'];\n }\n get [$css]() {\n return [css, hueCss, saturationCss];\n }\n get [$sliders]() {\n return [Saturation, Hue];\n }\n get color() {\n return this[$color];\n }\n set color(newColor) {\n if (!this[$isSame](newColor)) {\n const newHsva = this.colorModel.toHsva(newColor);\n this[$update](newHsva);\n this[$color] = newColor;\n }\n }\n constructor() {\n super();\n const template = tpl(`<style>${this[$css].join('')}</style>`);\n const root = this.attachShadow({ mode: 'open' });\n root.appendChild(template.content.cloneNode(true));\n root.addEventListener('move', this);\n this[$parts] = this[$sliders].map((slider) => new slider(root));\n }\n connectedCallback() {\n // A user may set a property on an _instance_ of an element,\n // before its prototype has been connected to this class.\n // If so, we need to run it through the proper class setter.\n if (this.hasOwnProperty('color')) {\n const value = this.color;\n delete this['color'];\n this.color = value;\n }\n else if (!this.color) {\n this.color = this.colorModel.defaultColor;\n }\n }\n attributeChangedCallback(_attr, _oldVal, newVal) {\n const color = this.colorModel.fromAttr(newVal);\n if (!this[$isSame](color)) {\n this.color = color;\n }\n }\n handleEvent(event) {\n // Merge the current HSV color object with updated params.\n const oldHsva = this[$hsva];\n const newHsva = { ...oldHsva, ...event.detail };\n this[$update](newHsva);\n let newColor;\n if (!equalColorObjects(newHsva, oldHsva) &&\n !this[$isSame]((newColor = this.colorModel.fromHsva(newHsva)))) {\n this[$color] = newColor;\n fire(this, 'color-changed', { value: newColor });\n }\n }\n [$isSame](color) {\n return this.color && this.colorModel.equal(color, this.color);\n }\n [$update](hsva) {\n this[$hsva] = hsva;\n this[$parts].forEach((part) => part.update(hsva));\n }\n}\n//# sourceMappingURL=color-picker.js.map","import { ColorPicker } from '../components/color-picker.js';\nimport { hexToHsva, hsvaToHex } from '../utils/convert.js';\nimport { equalHex } from '../utils/compare.js';\nconst colorModel = {\n defaultColor: '#000',\n toHsva: hexToHsva,\n fromHsva: ({ h, s, v }) => hsvaToHex({ h, s, v, a: 1 }),\n equal: equalHex,\n fromAttr: (color) => color\n};\nexport class HexBase extends ColorPicker {\n get colorModel() {\n return colorModel;\n }\n}\n//# sourceMappingURL=hex.js.map","import { HexBase } from './lib/entrypoints/hex.js';\n/**\n * A color picker custom element that uses HEX format.\n *\n * @element hex-color-picker\n *\n * @prop {string} color - Selected color in HEX format.\n * @attr {string} color - Selected color in HEX format.\n *\n * @fires color-changed - Event fired when color property changes.\n *\n * @csspart hue - A hue selector container.\n * @csspart saturation - A saturation selector container\n * @csspart hue-pointer - A hue pointer element.\n * @csspart saturation-pointer - A saturation pointer element.\n */\nexport class HexColorPicker extends HexBase {\n}\ncustomElements.define('hex-color-picker', HexColorPicker);\n//# sourceMappingURL=hex-color-picker.js.map","<script setup lang=\"ts\">\nimport { computed, inject, ref } from \"vue\";\nimport { onClickOutside } from \"@vueuse/core\";\nimport { X } from \"@lucide/vue\";\nimport { useI18n } from \"../composables/useI18n\";\nimport { usePopoverRoot } from \"../composables/usePopoverRoot\";\nimport { colorTextClass } from \"../constants/styleConstants\";\nimport { normalizeColorToHex } from \"../utils/color\";\nimport { THEME_STYLES_KEY, UI_THEME_KEY } from \"../keys\";\nimport \"vanilla-colorful\";\n\nconst props = withDefaults(\n defineProps<{\n modelValue: string;\n placeholder?: string;\n /**\n * Color the picker wheel opens on while the field is unset. It only\n * positions the wheel — it never paints the swatch or fills the input,\n * so an unset field still reads as \"not set\".\n */\n seedColor?: string;\n swatchOnly?: boolean;\n disabled?: boolean;\n /**\n * Swatch trigger size. `\"md\"` (40px) is the default for sidebar panels;\n * `\"sm\"` (32px) matches the compact rich-text floating toolbar controls.\n */\n size?: \"sm\" | \"md\";\n /**\n * Accessible label (and hover title) for the swatch trigger. Falls back to\n * the generic \"pick color\" label. Set it when several pickers sit side by\n * side and must be told apart (e.g. text color vs highlight in the toolbar).\n */\n ariaLabel?: string;\n }>(),\n {\n placeholder: \"\",\n seedColor: \"#ffffff\",\n swatchOnly: false,\n disabled: false,\n size: \"md\",\n ariaLabel: \"\",\n },\n);\n\nconst emit = defineEmits<{\n (e: \"update:modelValue\", value: string): void;\n}>();\n\nconst { t } = useI18n();\n\nconst open = ref(false);\nconst popoverRef = ref<HTMLElement>();\nconst swatchRef = ref<HTMLElement>();\n\n// Whether the picker emitted a real change during the current pointer gesture.\n// vanilla-colorful only fires `color-changed` when the chosen color differs\n// from the one the wheel was seeded with — so picking a color equal to the\n// seed emits nothing. When the field is still unset after such a no-change\n// pick, we commit the seed ourselves on pointerup so the value persists\n// (otherwise e.g. white on an empty background can never be set — issue #282).\nconst pickerTouched = ref(false);\n\nonClickOutside(\n popoverRef,\n () => {\n open.value = false;\n },\n { ignore: [swatchRef] },\n);\n\nconst isUnset = computed(() => !props.modelValue);\n\n// vanilla-colorful and the hex field are hex-only, but a stored value read back\n// from the DOM (e.g. a TipTap textStyle/highlight color) can be `rgb(...)`. Show\n// and seed the wheel with the hex form; the raw value still drives unset/emit.\nconst displayValue = computed(() => normalizeColorToHex(props.modelValue));\n\n// The color handed to the wheel: the stored value, or the seed when unset.\nconst seed = computed(() =>\n normalizeColorToHex(props.modelValue || props.seedColor),\n);\n\n// The clear (×) sits inside whichever hex field is active — the inline field in\n// full mode, or the popover field in swatch-only mode — shown only when a value\n// is set. Not gated on swatchOnly: each field renders only in its own mode.\nconst showClear = computed(() => !props.disabled && !isUnset.value);\n\nfunction onPickerChange(e: Event): void {\n pickerTouched.value = true;\n emit(\"update:modelValue\", (e as CustomEvent).detail.value);\n}\n\nfunction onPickerPointerDown(): void {\n pickerTouched.value = false;\n}\n\nfunction onPickerPointerUp(): void {\n // A deliberate pick equal to the seed fires no `color-changed`; commit it.\n if (!pickerTouched.value && isUnset.value) {\n emit(\"update:modelValue\", seed.value);\n }\n}\n\nfunction onTextInput(e: Event): void {\n emit(\"update:modelValue\", (e.target as HTMLInputElement).value);\n}\n\nfunction clear(): void {\n emit(\"update:modelValue\", \"\");\n}\n\n// The popover teleports to the shared popover root so it escapes any clipping /\n// overflow-hidden ancestor (e.g. the link dialog's card, where clicking the\n// clipped wheel landed on the backdrop and closed the modal). Position is\n// captured from the swatch on open and applied as `fixed`.\nconst popoverRoot = usePopoverRoot();\nconst themeStyles = inject(THEME_STYLES_KEY, null);\nconst tplUiTheme = inject(UI_THEME_KEY, null);\nconst popoverPosition = ref({ top: 0, left: 0 });\n\nfunction toggleOpen(): void {\n if (props.disabled) return;\n if (!open.value) {\n const rect = swatchRef.value?.getBoundingClientRect();\n if (rect) {\n const PICKER_HEIGHT = 240; // wheel + hue slider + padding, approx\n const gap = 8;\n // Open below the swatch, or flip above when it would overflow the viewport\n // bottom — the popover is `fixed`, so it can't scroll into view otherwise.\n const fitsBelow = rect.bottom + gap + PICKER_HEIGHT <= window.innerHeight;\n popoverPosition.value = {\n top: fitsBelow\n ? rect.bottom + gap\n : Math.max(gap, rect.top - PICKER_HEIGHT - gap),\n left: rect.left,\n };\n }\n }\n open.value = !open.value;\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'tpl:flex tpl:items-center tpl:gap-2 tpl:relative',\n disabled && 'tpl:opacity-60 tpl:cursor-not-allowed',\n ]\"\n >\n <button\n ref=\"swatchRef\"\n type=\"button\"\n :disabled=\"disabled\"\n :aria-label=\"ariaLabel || t.colorPicker.pickColor\"\n :title=\"ariaLabel || undefined\"\n :aria-expanded=\"open\"\n :class=\"[\n 'tpl:shrink-0 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-0.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]',\n disabled ? 'tpl:cursor-not-allowed' : 'tpl:cursor-pointer',\n open\n ? 'tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]'\n : !disabled && 'hover:tpl:border-[var(--tpl-text-dim)]',\n size === 'sm' ? 'tpl:size-8' : 'tpl:size-10',\n ]\"\n @click=\"toggleOpen\"\n >\n <span\n class=\"tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]\"\n :class=\"{ 'tpl-color-swatch-empty': isUnset }\"\n :style=\"isUnset ? undefined : { backgroundColor: displayValue }\"\n />\n </button>\n <div v-if=\"!swatchOnly\" class=\"tpl:relative tpl:flex-1\">\n <input\n type=\"text\"\n :class=\"[colorTextClass, 'tpl:w-full']\"\n :style=\"showClear ? { paddingRight: '2.25rem' } : undefined\"\n :value=\"displayValue\"\n :placeholder=\"placeholder || t.colorPicker.notSet\"\n :disabled=\"disabled\"\n :aria-label=\"t.colorPicker.hexValue\"\n @input=\"onTextInput\"\n />\n <button\n v-if=\"showClear\"\n type=\"button\"\n :aria-label=\"t.colorPicker.clear\"\n :title=\"t.colorPicker.clear\"\n class=\"tpl:absolute tpl:right-2 tpl:top-1/2 tpl:flex tpl:size-6 tpl:-translate-y-1/2 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)]\"\n @click=\"clear\"\n >\n <X :size=\"14\" :stroke-width=\"1.5\" />\n </button>\n </div>\n <Teleport :to=\"popoverRoot\" :disabled=\"!popoverRoot\">\n <Transition\n enter-active-class=\"tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]\"\n enter-from-class=\"tpl:opacity-0 tpl:scale-95 tpl:translate-y-1\"\n enter-to-class=\"tpl:opacity-100 tpl:scale-100 tpl:translate-y-0\"\n leave-active-class=\"tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]\"\n leave-from-class=\"tpl:opacity-100 tpl:scale-100 tpl:translate-y-0\"\n leave-to-class=\"tpl:opacity-0 tpl:scale-95 tpl:translate-y-1\"\n >\n <div\n v-if=\"open\"\n ref=\"popoverRef\"\n :data-tpl-theme=\"tplUiTheme\"\n class=\"tpl-color-popover tpl:fixed tpl:z-modal tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-3 tpl:shadow-lg\"\n :style=\"{\n top: `${popoverPosition.top}px`,\n left: `${popoverPosition.left}px`,\n ...themeStyles,\n }\"\n >\n <hex-color-picker\n :color=\"seed\"\n :aria-label=\"t.colorPicker.pickColor\"\n @color-changed=\"onPickerChange\"\n @pointerdown=\"onPickerPointerDown\"\n @pointerup=\"onPickerPointerUp\"\n @keydown.escape=\"open = false\"\n />\n <!-- Swatch-only mode has no inline field beside the swatch, so the\n popover carries the manual hex field (+ inline × clear) — the same\n control as the full-mode sidebar field. It commits on change/Enter,\n NOT @input: in the rich-text toolbar every emit calls\n editor.chain().focus().setColor(), and focusing the canvas mid-type\n would steal focus after the first character. Shown even when unset\n so a first color can be typed; the × appears only once a value is set. -->\n <div v-if=\"swatchOnly\" class=\"tpl:relative tpl:mt-2\">\n <input\n type=\"text\"\n :class=\"[colorTextClass, 'tpl:w-full']\"\n :style=\"showClear ? { paddingRight: '2.25rem' } : undefined\"\n :value=\"displayValue\"\n :placeholder=\"placeholder || t.colorPicker.notSet\"\n :disabled=\"disabled\"\n :aria-label=\"t.colorPicker.hexValue\"\n @change=\"onTextInput\"\n @keydown.enter.prevent=\"\n ($event.target as HTMLInputElement).blur()\n \"\n />\n <button\n v-if=\"showClear\"\n type=\"button\"\n :aria-label=\"t.colorPicker.clear\"\n :title=\"t.colorPicker.clear\"\n class=\"tpl:absolute tpl:right-2 tpl:top-1/2 tpl:flex tpl:size-6 tpl:-translate-y-1/2 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)]\"\n @click=\"clear\"\n >\n <X :size=\"14\" :stroke-width=\"1.5\" />\n </button>\n </div>\n </div>\n </Transition>\n </Teleport>\n </div>\n</template>\n\n<style>\nhex-color-picker {\n --hcp-width: 200px;\n}\n\nhex-color-picker::part(hue) {\n border-radius: var(--tpl-radius-sm, 7px);\n}\n\nhex-color-picker::part(saturation) {\n border-radius: var(--tpl-radius-sm, 7px) var(--tpl-radius-sm, 7px) 0 0;\n}\n\n/* Unset swatch: paper with a single thin diagonal slash = \"no color set\".\n A neutral non-color signal — never Signal Amber (intent) or Danger. */\n.tpl-color-swatch-empty {\n background-color: var(--tpl-bg);\n background-image: linear-gradient(\n to top right,\n transparent calc(50% - 0.75px),\n var(--tpl-text-dim) calc(50% - 0.75px),\n var(--tpl-text-dim) calc(50% + 0.75px),\n transparent calc(50% + 0.75px)\n );\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, inject, ref } from \"vue\";\nimport { onClickOutside } from \"@vueuse/core\";\nimport { X } from \"@lucide/vue\";\nimport { useI18n } from \"../composables/useI18n\";\nimport { usePopoverRoot } from \"../composables/usePopoverRoot\";\nimport { colorTextClass } from \"../constants/styleConstants\";\nimport { normalizeColorToHex } from \"../utils/color\";\nimport { THEME_STYLES_KEY, UI_THEME_KEY } from \"../keys\";\nimport \"vanilla-colorful\";\n\nconst props = withDefaults(\n defineProps<{\n modelValue: string;\n placeholder?: string;\n /**\n * Color the picker wheel opens on while the field is unset. It only\n * positions the wheel — it never paints the swatch or fills the input,\n * so an unset field still reads as \"not set\".\n */\n seedColor?: string;\n swatchOnly?: boolean;\n disabled?: boolean;\n /**\n * Swatch trigger size. `\"md\"` (40px) is the default for sidebar panels;\n * `\"sm\"` (32px) matches the compact rich-text floating toolbar controls.\n */\n size?: \"sm\" | \"md\";\n /**\n * Accessible label (and hover title) for the swatch trigger. Falls back to\n * the generic \"pick color\" label. Set it when several pickers sit side by\n * side and must be told apart (e.g. text color vs highlight in the toolbar).\n */\n ariaLabel?: string;\n }>(),\n {\n placeholder: \"\",\n seedColor: \"#ffffff\",\n swatchOnly: false,\n disabled: false,\n size: \"md\",\n ariaLabel: \"\",\n },\n);\n\nconst emit = defineEmits<{\n (e: \"update:modelValue\", value: string): void;\n}>();\n\nconst { t } = useI18n();\n\nconst open = ref(false);\nconst popoverRef = ref<HTMLElement>();\nconst swatchRef = ref<HTMLElement>();\n\n// Whether the picker emitted a real change during the current pointer gesture.\n// vanilla-colorful only fires `color-changed` when the chosen color differs\n// from the one the wheel was seeded with — so picking a color equal to the\n// seed emits nothing. When the field is still unset after such a no-change\n// pick, we commit the seed ourselves on pointerup so the value persists\n// (otherwise e.g. white on an empty background can never be set — issue #282).\nconst pickerTouched = ref(false);\n\nonClickOutside(\n popoverRef,\n () => {\n open.value = false;\n },\n { ignore: [swatchRef] },\n);\n\nconst isUnset = computed(() => !props.modelValue);\n\n// vanilla-colorful and the hex field are hex-only, but a stored value read back\n// from the DOM (e.g. a TipTap textStyle/highlight color) can be `rgb(...)`. Show\n// and seed the wheel with the hex form; the raw value still drives unset/emit.\nconst displayValue = computed(() => normalizeColorToHex(props.modelValue));\n\n// The color handed to the wheel: the stored value, or the seed when unset.\nconst seed = computed(() =>\n normalizeColorToHex(props.modelValue || props.seedColor),\n);\n\n// The clear (×) sits inside whichever hex field is active — the inline field in\n// full mode, or the popover field in swatch-only mode — shown only when a value\n// is set. Not gated on swatchOnly: each field renders only in its own mode.\nconst showClear = computed(() => !props.disabled && !isUnset.value);\n\nfunction onPickerChange(e: Event): void {\n pickerTouched.value = true;\n emit(\"update:modelValue\", (e as CustomEvent).detail.value);\n}\n\nfunction onPickerPointerDown(): void {\n pickerTouched.value = false;\n}\n\nfunction onPickerPointerUp(): void {\n // A deliberate pick equal to the seed fires no `color-changed`; commit it.\n if (!pickerTouched.value && isUnset.value) {\n emit(\"update:modelValue\", seed.value);\n }\n}\n\nfunction onTextInput(e: Event): void {\n emit(\"update:modelValue\", (e.target as HTMLInputElement).value);\n}\n\nfunction clear(): void {\n emit(\"update:modelValue\", \"\");\n}\n\n// The popover teleports to the shared popover root so it escapes any clipping /\n// overflow-hidden ancestor (e.g. the link dialog's card, where clicking the\n// clipped wheel landed on the backdrop and closed the modal). Position is\n// captured from the swatch on open and applied as `fixed`.\nconst popoverRoot = usePopoverRoot();\nconst themeStyles = inject(THEME_STYLES_KEY, null);\nconst tplUiTheme = inject(UI_THEME_KEY, null);\nconst popoverPosition = ref({ top: 0, left: 0 });\n\nfunction toggleOpen(): void {\n if (props.disabled) return;\n if (!open.value) {\n const rect = swatchRef.value?.getBoundingClientRect();\n if (rect) {\n const PICKER_HEIGHT = 240; // wheel + hue slider + padding, approx\n const gap = 8;\n // Open below the swatch, or flip above when it would overflow the viewport\n // bottom — the popover is `fixed`, so it can't scroll into view otherwise.\n const fitsBelow = rect.bottom + gap + PICKER_HEIGHT <= window.innerHeight;\n popoverPosition.value = {\n top: fitsBelow\n ? rect.bottom + gap\n : Math.max(gap, rect.top - PICKER_HEIGHT - gap),\n left: rect.left,\n };\n }\n }\n open.value = !open.value;\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'tpl:flex tpl:items-center tpl:gap-2 tpl:relative',\n disabled && 'tpl:opacity-60 tpl:cursor-not-allowed',\n ]\"\n >\n <button\n ref=\"swatchRef\"\n type=\"button\"\n :disabled=\"disabled\"\n :aria-label=\"ariaLabel || t.colorPicker.pickColor\"\n :title=\"ariaLabel || undefined\"\n :aria-expanded=\"open\"\n :class=\"[\n 'tpl:shrink-0 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-0.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]',\n disabled ? 'tpl:cursor-not-allowed' : 'tpl:cursor-pointer',\n open\n ? 'tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]'\n : !disabled && 'hover:tpl:border-[var(--tpl-text-dim)]',\n size === 'sm' ? 'tpl:size-8' : 'tpl:size-10',\n ]\"\n @click=\"toggleOpen\"\n >\n <span\n class=\"tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]\"\n :class=\"{ 'tpl-color-swatch-empty': isUnset }\"\n :style=\"isUnset ? undefined : { backgroundColor: displayValue }\"\n />\n </button>\n <div v-if=\"!swatchOnly\" class=\"tpl:relative tpl:flex-1\">\n <input\n type=\"text\"\n :class=\"[colorTextClass, 'tpl:w-full']\"\n :style=\"showClear ? { paddingRight: '2.25rem' } : undefined\"\n :value=\"displayValue\"\n :placeholder=\"placeholder || t.colorPicker.notSet\"\n :disabled=\"disabled\"\n :aria-label=\"t.colorPicker.hexValue\"\n @input=\"onTextInput\"\n />\n <button\n v-if=\"showClear\"\n type=\"button\"\n :aria-label=\"t.colorPicker.clear\"\n :title=\"t.colorPicker.clear\"\n class=\"tpl:absolute tpl:right-2 tpl:top-1/2 tpl:flex tpl:size-6 tpl:-translate-y-1/2 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)]\"\n @click=\"clear\"\n >\n <X :size=\"14\" :stroke-width=\"1.5\" />\n </button>\n </div>\n <Teleport :to=\"popoverRoot\" :disabled=\"!popoverRoot\">\n <Transition\n enter-active-class=\"tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]\"\n enter-from-class=\"tpl:opacity-0 tpl:scale-95 tpl:translate-y-1\"\n enter-to-class=\"tpl:opacity-100 tpl:scale-100 tpl:translate-y-0\"\n leave-active-class=\"tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]\"\n leave-from-class=\"tpl:opacity-100 tpl:scale-100 tpl:translate-y-0\"\n leave-to-class=\"tpl:opacity-0 tpl:scale-95 tpl:translate-y-1\"\n >\n <div\n v-if=\"open\"\n ref=\"popoverRef\"\n :data-tpl-theme=\"tplUiTheme\"\n class=\"tpl-color-popover tpl:fixed tpl:z-modal tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-3 tpl:shadow-lg\"\n :style=\"{\n top: `${popoverPosition.top}px`,\n left: `${popoverPosition.left}px`,\n ...themeStyles,\n }\"\n >\n <hex-color-picker\n :color=\"seed\"\n :aria-label=\"t.colorPicker.pickColor\"\n @color-changed=\"onPickerChange\"\n @pointerdown=\"onPickerPointerDown\"\n @pointerup=\"onPickerPointerUp\"\n @keydown.escape=\"open = false\"\n />\n <!-- Swatch-only mode has no inline field beside the swatch, so the\n popover carries the manual hex field (+ inline × clear) — the same\n control as the full-mode sidebar field. It commits on change/Enter,\n NOT @input: in the rich-text toolbar every emit calls\n editor.chain().focus().setColor(), and focusing the canvas mid-type\n would steal focus after the first character. Shown even when unset\n so a first color can be typed; the × appears only once a value is set. -->\n <div v-if=\"swatchOnly\" class=\"tpl:relative tpl:mt-2\">\n <input\n type=\"text\"\n :class=\"[colorTextClass, 'tpl:w-full']\"\n :style=\"showClear ? { paddingRight: '2.25rem' } : undefined\"\n :value=\"displayValue\"\n :placeholder=\"placeholder || t.colorPicker.notSet\"\n :disabled=\"disabled\"\n :aria-label=\"t.colorPicker.hexValue\"\n @change=\"onTextInput\"\n @keydown.enter.prevent=\"\n ($event.target as HTMLInputElement).blur()\n \"\n />\n <button\n v-if=\"showClear\"\n type=\"button\"\n :aria-label=\"t.colorPicker.clear\"\n :title=\"t.colorPicker.clear\"\n class=\"tpl:absolute tpl:right-2 tpl:top-1/2 tpl:flex tpl:size-6 tpl:-translate-y-1/2 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)]\"\n @click=\"clear\"\n >\n <X :size=\"14\" :stroke-width=\"1.5\" />\n </button>\n </div>\n </div>\n </Transition>\n </Teleport>\n </div>\n</template>\n\n<style>\nhex-color-picker {\n --hcp-width: 200px;\n}\n\nhex-color-picker::part(hue) {\n border-radius: var(--tpl-radius-sm, 7px);\n}\n\nhex-color-picker::part(saturation) {\n border-radius: var(--tpl-radius-sm, 7px) var(--tpl-radius-sm, 7px) 0 0;\n}\n\n/* Unset swatch: paper with a single thin diagonal slash = \"no color set\".\n A neutral non-color signal — never Signal Amber (intent) or Danger. */\n.tpl-color-swatch-empty {\n background-color: var(--tpl-bg);\n background-image: linear-gradient(\n to top right,\n transparent calc(50% - 0.75px),\n var(--tpl-text-dim) calc(50% - 0.75px),\n var(--tpl-text-dim) calc(50% + 0.75px),\n transparent calc(50% + 0.75px)\n );\n}\n</style>\n"],"x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13],"mappings":";;;AAAA,IAAa,IACX,qFAEW,IACX,yZAEW,IACX,6bAEW,IACX,8MAKW,IACX,4XAQW,IACX,yOAKW,IACX,+VAEW,IACX,sWAEW,IACX,gXAEW,IACX,mXAGW,IAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEa,IAAsB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEa,IAAyB;CACpC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAS,OAAO;CAAQ;CACjC;EAAE,OAAO;EAAO,OAAO;CAAM;CAC7B;EAAE,OAAO;EAAS,OAAO;CAAQ;CACjC;EAAE,OAAO;EAAO,OAAO;CAAM;CAC7B;EAAE,OAAO;EAAO,OAAO;CAAM;AAC/B,GAGa,IAAqB,WACrB,IAAmB,WACnB,IAA0B,WAC1B,IAAuB,WChFvB,KAAS,GAAQ,IAAM,GAAG,IAAM,MAClC,IAAS,IAAM,IAAM,IAAS,IAAM,IAAM,GAExC,KAAS,GAAQ,IAAS,GAAG,IAAgB,MAAI,MACnD,KAAK,MAAM,IAAO,CAAM,IAAI;ACC9B,OAAO,KAAK,KAAK;AAE1B,IAAa,KAAa,MAAQ,GAAW,EAAU,CAAG,CAAC,GAC9C,KAAa,OAClB,EAAI,OAAO,QACX,IAAM,EAAI,UAAU,CAAC,IACrB,EAAI,SAAS,IACN;CACH,GAAG,SAAS,EAAI,KAAK,EAAI,IAAI,EAAE;CAC/B,GAAG,SAAS,EAAI,KAAK,EAAI,IAAI,EAAE;CAC/B,GAAG,S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