@templatical/editor 0.17.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiChatSidebar-LxCHMdcj.js → AiChatSidebar-DAQTFuvi.js} +2 -2
- package/dist/{AiFeatureMenu-Cr8pLXMj.js → AiFeatureMenu-aFSO20PR.js} +3 -3
- package/dist/{BlockIssueBadge-BQ1yB1me.js → BlockIssueBadge-BQmq1bxn.js} +2 -2
- package/dist/{CloudEditor-qzoNS8K4.js → CloudEditor-D0K-m1GA.js} +15 -13
- package/dist/{CollaboratorBar-BkfR0CyD.js → CollaboratorBar-CJO3l6Dt.js} +2 -2
- package/dist/ColorPicker-BsgpTJqK.js +552 -0
- package/dist/{CommentsSidebar-Cl93TN96.js → CommentsSidebar-BYMVucZh.js} +4 -4
- package/dist/{CountdownBlock-DbXfzwae.js → CountdownBlock-Bn5w7C-p.js} +1 -1
- package/dist/{CountdownToolbar-BqaMWRyB.js → CountdownToolbar-PJI3ffi1.js} +3 -3
- package/dist/{DesignReferenceSidebar-jVrdS8wW.js → DesignReferenceSidebar-QfAV8XT9.js} +13 -14
- package/dist/{IssuesPanel-Bq3yXg6M.js → IssuesPanel-CTjRgz8w.js} +2 -2
- package/dist/{ModuleBrowserModal-XEHfEO0O.js → ModuleBrowserModal-BNalLx0k.js} +7 -7
- package/dist/{ModulePreviewCanvas-BM8XUgbc.js → ModulePreviewCanvas-BwObwisa.js} +2 -2
- package/dist/{NumberWithSuffix-9FG7mNnn.js → NumberWithSuffix-D3BKz66W.js} +1 -1
- package/dist/{ParagraphEditor-Cs47wU1V.js → ParagraphEditor-Cf75UfSo.js} +42 -42
- package/dist/{RichTextEditorContent-DCzmVeyb.js → RichTextEditorContent-MdaLz6Q3.js} +5 -5
- package/dist/{SaveModuleDialog-BgOS9vCQ.js → SaveModuleDialog-MTjwiF9D.js} +6 -6
- package/dist/{SnapshotHistory-CLfYzwv9.js → SnapshotHistory-C_Y1LzAY.js} +4 -4
- package/dist/{TemplateScoringPanel-CMrfa9Rd.js → TemplateScoringPanel-DikuKc6i.js} +3 -3
- package/dist/{TestEmailModal-DTLfATNt.js → TestEmailModal-BW8aTtzf.js} +3 -3
- package/dist/{TitleEditor-Bq9S0C8Z.js → TitleEditor-CCUkbRN0.js} +7 -7
- package/dist/{TplModal-BW0FAtYe.js → TplModal-DoOwUKlT.js} +3 -3
- package/dist/{blockTypeIcons-CvSfLeyV.js → blockTypeIcons-BlPKjD7M.js} +1 -1
- package/dist/bundle-stats.json +7 -7
- package/dist/{ca-CSl--oWR.js → ca-DbWoy4rG.js} +2 -1
- package/dist/cdn/chunks/{AiFeatureMenu-B0zH66nO.js → AiFeatureMenu-RwJiaPXZ.js} +5 -5
- package/dist/cdn/chunks/{AiFeatureMenu-B0zH66nO.js.map → AiFeatureMenu-RwJiaPXZ.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-yD4pKsU9.js → BlockIssueBadge-DM-TDKbr.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-yD4pKsU9.js.map → BlockIssueBadge-DM-TDKbr.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-Da-aSmw5.js → CloudEditor-Dufl354p.js} +132 -130
- package/dist/cdn/chunks/CloudEditor-Dufl354p.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-DixaFis-.js → CollaboratorBar-xsU20iPl.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-DixaFis-.js.map → CollaboratorBar-xsU20iPl.js.map} +1 -1
- package/dist/{ColorPicker-DfzDyNKe.js → cdn/chunks/ColorPicker-y_obnw4o.js} +234 -157
- package/dist/cdn/chunks/ColorPicker-y_obnw4o.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-jgBPbI1p.js → CountdownBlock-sHsRMe1q.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-jgBPbI1p.js.map → CountdownBlock-sHsRMe1q.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-DrmZwvIH.js → CountdownToolbar-Ckc_jEi-.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-DrmZwvIH.js.map → CountdownToolbar-Ckc_jEi-.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-CpyhXg9M.js → IssuesPanel-DF5Ajuna.js} +7 -7
- package/dist/cdn/chunks/{IssuesPanel-CpyhXg9M.js.map → IssuesPanel-DF5Ajuna.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-DPQLFTti.js → ModuleBrowserModal-DG4AVFjH.js} +8 -8
- package/dist/cdn/chunks/{ModuleBrowserModal-DPQLFTti.js.map → ModuleBrowserModal-DG4AVFjH.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-Csc6M0RA.js → ModulePreviewCanvas-Bc_PcJuc.js} +24 -24
- package/dist/cdn/chunks/{ModulePreviewCanvas-Csc6M0RA.js.map → ModulePreviewCanvas-Bc_PcJuc.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-YmcsBmCd.js → NumberWithSuffix-8fOO-LC_.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-YmcsBmCd.js.map → NumberWithSuffix-8fOO-LC_.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DR5AcHB0.js → ParagraphEditor-BkafKSju.js} +107 -107
- package/dist/cdn/chunks/{ParagraphEditor-DR5AcHB0.js.map → ParagraphEditor-BkafKSju.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-52c2EuCT.js → RichTextEditorContent-BthhzOZS.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-52c2EuCT.js.map → RichTextEditorContent-BthhzOZS.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-dpRlVrrQ.js → SaveModuleDialog-DhsfYf2n.js} +4 -4
- package/dist/cdn/chunks/{SaveModuleDialog-dpRlVrrQ.js.map → SaveModuleDialog-DhsfYf2n.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DtQTPAg3.js → TitleEditor-DLv9cXba.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-DtQTPAg3.js.map → TitleEditor-DLv9cXba.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-B0ktHdUG.js → blockTypeIcons-B0uibGX7.js} +7 -7
- package/dist/cdn/chunks/{blockTypeIcons-B0ktHdUG.js.map → blockTypeIcons-B0uibGX7.js.map} +1 -1
- package/dist/cdn/chunks/{ca-CSl--oWR.js → ca-DbWoy4rG.js} +3 -2
- package/dist/cdn/chunks/{ca-CSl--oWR.js.map → ca-DbWoy4rG.js.map} +1 -1
- package/dist/cdn/chunks/{de-ZaffrKDP.js → de-CgGOnerg.js} +3 -2
- package/dist/cdn/chunks/{de-ZaffrKDP.js.map → de-CgGOnerg.js.map} +1 -1
- package/dist/cdn/chunks/{en-CHuXeJDt.js → en-DrUV9xth.js} +3 -2
- package/dist/cdn/chunks/{en-CHuXeJDt.js.map → en-DrUV9xth.js.map} +1 -1
- package/dist/{es-CaC8VQjO.js → cdn/chunks/es-DwbKjU7q.js} +4 -1
- package/dist/cdn/chunks/{es-CaC8VQjO.js.map → es-DwbKjU7q.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-CiewgCtw.js → extensions-DLHvZ0UH.js} +19 -19
- package/dist/cdn/chunks/{extensions-CiewgCtw.js.map → extensions-DLHvZ0UH.js.map} +1 -1
- package/dist/cdn/chunks/{features-DLu_D-6j.js → features-Cnfv4QAY.js} +1442 -1295
- package/dist/cdn/chunks/features-Cnfv4QAY.js.map +1 -0
- package/dist/cdn/chunks/{icons-B03IY-pm.js → icons-DbcM69bb.js} +2 -2
- package/dist/cdn/chunks/{icons-B03IY-pm.js.map → icons-DbcM69bb.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-CYF18RNk.js → media-library-DpSMwHd4.js} +524 -524
- package/dist/cdn/chunks/{media-library-CYF18RNk.js.map → media-library-DpSMwHd4.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-C74zfEWH.js → pt-BR-Bcc5Tjed.js} +3 -2
- package/dist/cdn/chunks/{pt-BR-C74zfEWH.js.map → pt-BR-Bcc5Tjed.js.map} +1 -1
- package/dist/cdn/chunks/{quality-LmsngN2B.js → quality-D9QqkRcU.js} +77 -77
- package/dist/cdn/chunks/{quality-LmsngN2B.js.map → quality-D9QqkRcU.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-DAeNIQqa.js → renderer-BsLQZNXU.js} +14 -14
- package/dist/cdn/chunks/{renderer-DAeNIQqa.js.map → renderer-BsLQZNXU.js.map} +1 -1
- package/dist/cdn/chunks/{src-CModhUDN.js → src-zu1ehVNN.js} +6 -6
- package/dist/cdn/chunks/{src-CModhUDN.js.map → src-zu1ehVNN.js.map} +1 -1
- package/dist/cdn/chunks/{styles-hd_LBGaF.js → styles-Dx-jXeCd.js} +184 -184
- package/dist/cdn/chunks/{styles-hd_LBGaF.js.map → styles-Dx-jXeCd.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +55 -52
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{cloud-BogxOeZu.js → cloud-B-RebwxI.js} +5 -5
- package/dist/{de-ZaffrKDP.js → de-CgGOnerg.js} +2 -1
- package/dist/{dist-DoRIUsfz.js → dist-BJbqgyPn.js} +108 -94
- package/dist/{en-CHuXeJDt.js → en-DrUV9xth.js} +2 -1
- package/dist/{cdn/chunks/es-CaC8VQjO.js → es-DwbKjU7q.js} +2 -3
- package/dist/{extensions-DhgbhfBX.js → extensions-BCA9pyer.js} +11 -11
- package/dist/index.d.ts +68 -0
- package/dist/keys-DFaIbGR8.js +10 -0
- package/dist/{pt-BR-C74zfEWH.js → pt-BR-Bcc5Tjed.js} +2 -1
- package/dist/style.css +1 -1
- package/dist/{styles-BWC0jc5-.js → styles-64uLkPJV.js} +136 -136
- package/dist/templatical-editor.js +15 -12
- package/dist/{upload-BKg6hDRW.js → upload-y4gxiFp5.js} +3 -2
- package/dist/{useCloudI18n-CIKI0hCd.js → useCloudI18n-PCDOC2kz.js} +1 -1
- package/dist/{useEditorCore-FLMIhtv1.js → useEditorCore-ea9OrrH3.js} +870 -764
- package/dist/{useI18n-0EU_JVe7.js → useI18n-BNMzZTM5.js} +1 -1
- package/dist/{useMergeTag-C7v6MVah.js → useMergeTag-DfEY0eK5.js} +5 -5
- package/dist/{usePopoverPosition-BDqqnMeo.js → usePopoverPosition-F9STHRIr.js} +33 -6
- package/package.json +7 -7
- package/dist/cdn/chunks/CloudEditor-Da-aSmw5.js.map +0 -1
- package/dist/cdn/chunks/ColorPicker-O6xXCPEg.js +0 -471
- package/dist/cdn/chunks/ColorPicker-O6xXCPEg.js.map +0 -1
- package/dist/cdn/chunks/features-DLu_D-6j.js.map +0 -1
- package/dist/keys-WVNarXg8.js +0 -10
- package/dist/timeouts-Bmi_yePw.js +0 -4
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { i as ie, n as ae, r as m, t as oe } from "./usePopoverPosition-BDqqnMeo.js";
|
|
4
|
-
import { F as se, L as ce } from "./keys-WVNarXg8.js";
|
|
5
|
-
import { t as le } from "./useI18n-0EU_JVe7.js";
|
|
6
|
-
import { t as h } from "./x-Ctg_250T.js";
|
|
1
|
+
import { M as e, P as t, T as n, V as r, Z as i, c as a, d as o, f as s, g as c, h as l, it as u, l as ee, m as te, n as ne, ot as d, p as f, st as p, u as re, x as m, y as h } from "./draggable-D840DIZB.js";
|
|
2
|
+
import { H as ie, Ht as ae, Lt as g, Rt as oe, V as se, Xt as ce, fn as le, gn as ue, lt as de, mn as fe, zt as pe } from "./features-Cnfv4QAY.js";
|
|
7
3
|
//#region src/constants/styleConstants.ts
|
|
8
|
-
var
|
|
4
|
+
var _ = "tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]", v = "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)]", y = "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)]", b = "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)]", x = "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)]", S = "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)]", C = "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)]", w = "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)]", T = "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)]", E = "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", D = [
|
|
9
5
|
"10px",
|
|
10
6
|
"12px",
|
|
11
7
|
"14px",
|
|
@@ -18,7 +14,7 @@ var g = "tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-te
|
|
|
18
14
|
"36px",
|
|
19
15
|
"48px",
|
|
20
16
|
"64px"
|
|
21
|
-
],
|
|
17
|
+
], O = [
|
|
22
18
|
"1",
|
|
23
19
|
"1.2",
|
|
24
20
|
"1.4",
|
|
@@ -27,7 +23,7 @@ var g = "tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-te
|
|
|
27
23
|
"1.8",
|
|
28
24
|
"2",
|
|
29
25
|
"2.5"
|
|
30
|
-
],
|
|
26
|
+
], k = [
|
|
31
27
|
{
|
|
32
28
|
label: "Normal",
|
|
33
29
|
value: "normal"
|
|
@@ -56,9 +52,9 @@ var g = "tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-te
|
|
|
56
52
|
label: "3px",
|
|
57
53
|
value: "3px"
|
|
58
54
|
}
|
|
59
|
-
],
|
|
55
|
+
], A = "#000000", j = "#ffffff", me = "#ffff00", M = "#f2f2f2", N = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, P = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n;
|
|
60
56
|
360 / (Math.PI * 2);
|
|
61
|
-
var F = (e) =>
|
|
57
|
+
var F = (e) => V(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
|
|
62
58
|
r: parseInt(e[0] + e[0], 16),
|
|
63
59
|
g: parseInt(e[1] + e[1], 16),
|
|
64
60
|
b: parseInt(e[2] + e[2], 16),
|
|
@@ -68,7 +64,7 @@ var F = (e) => fe(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
68
64
|
g: parseInt(e.substring(2, 4), 16),
|
|
69
65
|
b: parseInt(e.substring(4, 6), 16),
|
|
70
66
|
a: e.length === 8 ? P(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
|
|
71
|
-
}), L = (e) =>
|
|
67
|
+
}), L = (e) => ge(he(e)), R = ({ h: e, s: t, v: n, a: r }) => {
|
|
72
68
|
let i = (200 - t) * n / 100;
|
|
73
69
|
return {
|
|
74
70
|
h: P(e),
|
|
@@ -79,7 +75,7 @@ var F = (e) => fe(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
79
75
|
}, z = (e) => {
|
|
80
76
|
let { h: t, s: n, l: r } = R(e);
|
|
81
77
|
return `hsl(${t}, ${n}%, ${r}%)`;
|
|
82
|
-
},
|
|
78
|
+
}, he = ({ h: e, s: t, v: n, a: r }) => {
|
|
83
79
|
e = e / 360 * 6, t /= 100, n /= 100;
|
|
84
80
|
let i = Math.floor(e), a = n * (1 - t), o = n * (1 - (e - i) * t), s = n * (1 - (1 - e + i) * t), c = i % 6;
|
|
85
81
|
return {
|
|
@@ -112,10 +108,10 @@ var F = (e) => fe(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
112
108
|
}, B = (e) => {
|
|
113
109
|
let t = e.toString(16);
|
|
114
110
|
return t.length < 2 ? "0" + t : t;
|
|
115
|
-
},
|
|
111
|
+
}, ge = ({ r: e, g: t, b: n, a: r }) => {
|
|
116
112
|
let i = r < 1 ? B(P(r * 255)) : "";
|
|
117
113
|
return "#" + B(e) + B(t) + B(n) + i;
|
|
118
|
-
},
|
|
114
|
+
}, V = ({ r: e, g: t, b: n, a: r }) => {
|
|
119
115
|
let i = Math.max(e, t, n), a = i - Math.min(e, t, n), o = a ? i === e ? (t - n) / a : i === t ? 2 + (n - e) / a : 4 + (e - t) / a : 0;
|
|
120
116
|
return {
|
|
121
117
|
h: P(60 * (o < 0 ? o + 6 : o)),
|
|
@@ -123,58 +119,58 @@ var F = (e) => fe(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
123
119
|
v: P(i / 255 * 100),
|
|
124
120
|
a: r
|
|
125
121
|
};
|
|
126
|
-
},
|
|
122
|
+
}, H = (e, t) => {
|
|
127
123
|
if (e === t) return !0;
|
|
128
124
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
129
125
|
return !0;
|
|
130
|
-
},
|
|
131
|
-
let t =
|
|
132
|
-
return t || (t = document.createElement("template"), t.innerHTML = e,
|
|
133
|
-
},
|
|
126
|
+
}, U = (e, t) => e.toLowerCase() === t.toLowerCase() || H(I(e), I(t)), W = {}, G = (e) => {
|
|
127
|
+
let t = W[e];
|
|
128
|
+
return t || (t = document.createElement("template"), t.innerHTML = e, W[e] = t), t;
|
|
129
|
+
}, K = (e, t, n) => {
|
|
134
130
|
e.dispatchEvent(new CustomEvent(t, {
|
|
135
131
|
bubbles: !0,
|
|
136
132
|
detail: n
|
|
137
133
|
}));
|
|
138
|
-
},
|
|
139
|
-
let n =
|
|
140
|
-
|
|
134
|
+
}, q = !1, J = (e) => "touches" in e, _e = (e) => q && !J(e) ? !1 : (q ||= J(e), !0), Y = (e, t) => {
|
|
135
|
+
let n = J(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
|
|
136
|
+
K(e.el, "move", e.getMove({
|
|
141
137
|
x: N((n.pageX - (r.left + window.pageXOffset)) / r.width),
|
|
142
138
|
y: N((n.pageY - (r.top + window.pageYOffset)) / r.height)
|
|
143
139
|
}));
|
|
144
|
-
},
|
|
140
|
+
}, ve = (e, t) => {
|
|
145
141
|
let n = t.keyCode;
|
|
146
|
-
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(),
|
|
142
|
+
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), K(e.el, "move", e.getMove({
|
|
147
143
|
x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
|
|
148
144
|
y: n === 40 ? .01 : n === 38 ? -.01 : 0
|
|
149
145
|
}, !0)));
|
|
150
|
-
},
|
|
146
|
+
}, ye = class {
|
|
151
147
|
constructor(e, t, n, r) {
|
|
152
|
-
let i =
|
|
148
|
+
let i = G(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
|
|
153
149
|
e.appendChild(i.content.cloneNode(!0));
|
|
154
150
|
let a = e.querySelector(`[part=${t}]`);
|
|
155
151
|
a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
|
|
156
152
|
}
|
|
157
153
|
set dragging(e) {
|
|
158
154
|
let t = e ? document.addEventListener : document.removeEventListener;
|
|
159
|
-
t(
|
|
155
|
+
t(q ? "touchmove" : "mousemove", this), t(q ? "touchend" : "mouseup", this);
|
|
160
156
|
}
|
|
161
157
|
handleEvent(e) {
|
|
162
158
|
switch (e.type) {
|
|
163
159
|
case "mousedown":
|
|
164
160
|
case "touchstart":
|
|
165
|
-
if (e.preventDefault(), !
|
|
166
|
-
this.el.focus(),
|
|
161
|
+
if (e.preventDefault(), !_e(e) || !q && e.button != 0) return;
|
|
162
|
+
this.el.focus(), Y(this, e), this.dragging = !0;
|
|
167
163
|
break;
|
|
168
164
|
case "mousemove":
|
|
169
165
|
case "touchmove":
|
|
170
|
-
e.preventDefault(),
|
|
166
|
+
e.preventDefault(), Y(this, e);
|
|
171
167
|
break;
|
|
172
168
|
case "mouseup":
|
|
173
169
|
case "touchend":
|
|
174
170
|
this.dragging = !1;
|
|
175
171
|
break;
|
|
176
172
|
case "keydown":
|
|
177
|
-
|
|
173
|
+
ve(this, e);
|
|
178
174
|
break;
|
|
179
175
|
}
|
|
180
176
|
}
|
|
@@ -183,7 +179,7 @@ var F = (e) => fe(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
183
179
|
for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
|
|
184
180
|
});
|
|
185
181
|
}
|
|
186
|
-
},
|
|
182
|
+
}, be = class extends ye {
|
|
187
183
|
constructor(e) {
|
|
188
184
|
super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
|
|
189
185
|
}
|
|
@@ -201,7 +197,7 @@ var F = (e) => fe(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
201
197
|
getMove(e, t) {
|
|
202
198
|
return { h: t ? N(this.h + e.x * 360, 0, 360) : 360 * e.x };
|
|
203
199
|
}
|
|
204
|
-
},
|
|
200
|
+
}, xe = class extends ye {
|
|
205
201
|
constructor(e) {
|
|
206
202
|
super(e, "saturation", "aria-label=\"Color\"", !0);
|
|
207
203
|
}
|
|
@@ -223,33 +219,33 @@ var F = (e) => fe(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
223
219
|
v: t ? N(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
|
|
224
220
|
};
|
|
225
221
|
}
|
|
226
|
-
},
|
|
222
|
+
}, Se = ":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)}", Ce = "[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}", we = "[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}", X = Symbol("same"), Z = Symbol("color"), Te = Symbol("hsva"), Q = Symbol("update"), Ee = Symbol("parts"), De = Symbol("css"), $ = Symbol("sliders"), Oe = class extends HTMLElement {
|
|
227
223
|
static get observedAttributes() {
|
|
228
224
|
return ["color"];
|
|
229
225
|
}
|
|
230
|
-
get [
|
|
226
|
+
get [De]() {
|
|
231
227
|
return [
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
228
|
+
Se,
|
|
229
|
+
Ce,
|
|
230
|
+
we
|
|
235
231
|
];
|
|
236
232
|
}
|
|
237
233
|
get [$]() {
|
|
238
|
-
return [
|
|
234
|
+
return [xe, be];
|
|
239
235
|
}
|
|
240
236
|
get color() {
|
|
241
|
-
return this[
|
|
237
|
+
return this[Z];
|
|
242
238
|
}
|
|
243
239
|
set color(e) {
|
|
244
|
-
if (!this[
|
|
240
|
+
if (!this[X](e)) {
|
|
245
241
|
let t = this.colorModel.toHsva(e);
|
|
246
|
-
this[Q](t), this[
|
|
242
|
+
this[Q](t), this[Z] = e;
|
|
247
243
|
}
|
|
248
244
|
}
|
|
249
245
|
constructor() {
|
|
250
246
|
super();
|
|
251
|
-
let e =
|
|
252
|
-
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[
|
|
247
|
+
let e = G(`<style>${this[De].join("")}</style>`), t = this.attachShadow({ mode: "open" });
|
|
248
|
+
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[Ee] = this[$].map((e) => new e(t));
|
|
253
249
|
}
|
|
254
250
|
connectedCallback() {
|
|
255
251
|
if (this.hasOwnProperty("color")) {
|
|
@@ -259,24 +255,24 @@ var F = (e) => fe(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
259
255
|
}
|
|
260
256
|
attributeChangedCallback(e, t, n) {
|
|
261
257
|
let r = this.colorModel.fromAttr(n);
|
|
262
|
-
this[
|
|
258
|
+
this[X](r) || (this.color = r);
|
|
263
259
|
}
|
|
264
260
|
handleEvent(e) {
|
|
265
|
-
let t = this[
|
|
261
|
+
let t = this[Te], n = {
|
|
266
262
|
...t,
|
|
267
263
|
...e.detail
|
|
268
264
|
};
|
|
269
265
|
this[Q](n);
|
|
270
266
|
let r;
|
|
271
|
-
!
|
|
267
|
+
!H(n, t) && !this[X](r = this.colorModel.fromHsva(n)) && (this[Z] = r, K(this, "color-changed", { value: r }));
|
|
272
268
|
}
|
|
273
|
-
[
|
|
269
|
+
[X](e) {
|
|
274
270
|
return this.color && this.colorModel.equal(e, this.color);
|
|
275
271
|
}
|
|
276
272
|
[Q](e) {
|
|
277
|
-
this[
|
|
273
|
+
this[Te] = e, this[Ee].forEach((t) => t.update(e));
|
|
278
274
|
}
|
|
279
|
-
},
|
|
275
|
+
}, ke = {
|
|
280
276
|
defaultColor: "#000",
|
|
281
277
|
toHsva: F,
|
|
282
278
|
fromHsva: ({ h: e, s: t, v: n }) => L({
|
|
@@ -285,38 +281,49 @@ var F = (e) => fe(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
285
281
|
v: n,
|
|
286
282
|
a: 1
|
|
287
283
|
}),
|
|
288
|
-
equal:
|
|
284
|
+
equal: U,
|
|
289
285
|
fromAttr: (e) => e
|
|
290
|
-
},
|
|
286
|
+
}, Ae = class extends Oe {
|
|
291
287
|
get colorModel() {
|
|
292
|
-
return
|
|
288
|
+
return ke;
|
|
293
289
|
}
|
|
294
|
-
}
|
|
295
|
-
customElements.define("hex-color-picker",
|
|
290
|
+
};
|
|
291
|
+
customElements.define("hex-color-picker", class extends Ae {});
|
|
296
292
|
//#endregion
|
|
297
293
|
//#region src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
298
|
-
var
|
|
294
|
+
var je = [
|
|
299
295
|
"disabled",
|
|
300
296
|
"aria-label",
|
|
301
297
|
"title",
|
|
302
298
|
"aria-expanded"
|
|
303
|
-
],
|
|
299
|
+
], Me = {
|
|
304
300
|
key: 0,
|
|
305
301
|
class: "tpl:relative tpl:flex-1"
|
|
306
|
-
},
|
|
302
|
+
}, Ne = [
|
|
307
303
|
"value",
|
|
308
304
|
"placeholder",
|
|
309
305
|
"disabled",
|
|
310
306
|
"aria-label"
|
|
311
|
-
],
|
|
312
|
-
|
|
307
|
+
], Pe = ["aria-label", "title"], Fe = ["data-tpl-theme"], Ie = ["aria-label"], Le = [
|
|
308
|
+
"aria-label",
|
|
309
|
+
"title",
|
|
310
|
+
"aria-checked",
|
|
311
|
+
"tabindex"
|
|
312
|
+
], Re = [
|
|
313
|
+
"aria-label",
|
|
314
|
+
"title",
|
|
315
|
+
"aria-checked",
|
|
316
|
+
"tabindex",
|
|
317
|
+
"onClick"
|
|
318
|
+
], ze = ["color", "aria-label"], Be = {
|
|
319
|
+
key: 2,
|
|
313
320
|
class: "tpl:relative tpl:mt-2"
|
|
314
|
-
},
|
|
321
|
+
}, Ve = [
|
|
315
322
|
"value",
|
|
316
323
|
"placeholder",
|
|
317
324
|
"disabled",
|
|
318
325
|
"aria-label"
|
|
319
|
-
],
|
|
326
|
+
], He = ["aria-label", "title"], Ue = /* @__PURE__ */ m({
|
|
320
327
|
__name: "ColorPicker",
|
|
321
328
|
props: {
|
|
322
329
|
modelValue: {},
|
|
@@ -331,93 +338,129 @@ var De = [
|
|
|
331
338
|
default: !1
|
|
332
339
|
},
|
|
333
340
|
size: { default: "md" },
|
|
334
|
-
ariaLabel: { default: "" }
|
|
341
|
+
ariaLabel: { default: "" },
|
|
342
|
+
presets: { default: void 0 },
|
|
343
|
+
allowCustom: {
|
|
344
|
+
type: Boolean,
|
|
345
|
+
default: void 0
|
|
346
|
+
}
|
|
335
347
|
},
|
|
336
348
|
emits: ["update:modelValue"],
|
|
337
|
-
setup(
|
|
338
|
-
let
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}, { ignore: [
|
|
342
|
-
let
|
|
343
|
-
function
|
|
344
|
-
|
|
349
|
+
setup(m, { emit: _ }) {
|
|
350
|
+
let v = m, y = _, { t: b } = ae(), S = i(!1), C = i(), w = i(), T = i(!1);
|
|
351
|
+
ue(C, () => {
|
|
352
|
+
S.value = !1;
|
|
353
|
+
}, { ignore: [w] });
|
|
354
|
+
let E = s(() => !v.modelValue), D = s(() => oe(v.modelValue)), O = s(() => oe(v.modelValue || v.seedColor)), k = s(() => !v.disabled && !E.value), A = n(ce, pe), j = s(() => [...new Set(v.presets ?? A.presets)]), me = s(() => v.allowCustom ?? A.allowCustom), M = s(() => j.value.length > 0), N = s(() => me.value || !M.value), P = s(() => g(v.modelValue));
|
|
355
|
+
function F(e) {
|
|
356
|
+
return P.value !== "" && g(e) === P.value;
|
|
345
357
|
}
|
|
346
|
-
function
|
|
347
|
-
|
|
358
|
+
function I(e) {
|
|
359
|
+
y("update:modelValue", e);
|
|
348
360
|
}
|
|
349
|
-
|
|
350
|
-
|
|
361
|
+
let L = s(() => M.value && !N.value);
|
|
362
|
+
function R(e) {
|
|
363
|
+
return L.value ? e + 1 : e;
|
|
351
364
|
}
|
|
352
|
-
|
|
353
|
-
|
|
365
|
+
let z = s(() => {
|
|
366
|
+
if (L.value && E.value) return 0;
|
|
367
|
+
let e = j.value.findIndex((e) => F(e));
|
|
368
|
+
return e === -1 ? 0 : R(e);
|
|
369
|
+
});
|
|
370
|
+
function he() {
|
|
371
|
+
return z.value === 0 ? 0 : -1;
|
|
372
|
+
}
|
|
373
|
+
function B(e) {
|
|
374
|
+
return R(e) === z.value ? 0 : -1;
|
|
375
|
+
}
|
|
376
|
+
function ge(e) {
|
|
377
|
+
if (![
|
|
378
|
+
"ArrowRight",
|
|
379
|
+
"ArrowDown",
|
|
380
|
+
"ArrowLeft",
|
|
381
|
+
"ArrowUp"
|
|
382
|
+
].includes(e.key)) return;
|
|
383
|
+
let t = Array.from(e.currentTarget.querySelectorAll("[role=\"radio\"]")), n = e.target.closest("[role=\"radio\"]"), r = n ? t.indexOf(n) : -1;
|
|
384
|
+
r !== -1 && (t[(r + (e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus(), e.preventDefault());
|
|
385
|
+
}
|
|
386
|
+
function V(e) {
|
|
387
|
+
T.value = !0, y("update:modelValue", e.detail.value);
|
|
354
388
|
}
|
|
355
|
-
function
|
|
356
|
-
|
|
389
|
+
function H() {
|
|
390
|
+
T.value = !1;
|
|
357
391
|
}
|
|
358
|
-
|
|
392
|
+
function U() {
|
|
393
|
+
!T.value && E.value && y("update:modelValue", O.value);
|
|
394
|
+
}
|
|
395
|
+
function W(e) {
|
|
396
|
+
y("update:modelValue", e.target.value);
|
|
397
|
+
}
|
|
398
|
+
function G() {
|
|
399
|
+
y("update:modelValue", "");
|
|
400
|
+
}
|
|
401
|
+
let K = ie(), { toLocal: q } = se(), J = n(le, null), _e = n(fe, null), Y = i({
|
|
359
402
|
top: 0,
|
|
360
403
|
left: 0
|
|
361
404
|
});
|
|
362
|
-
function
|
|
363
|
-
if (!
|
|
364
|
-
if (!
|
|
365
|
-
let e =
|
|
405
|
+
function ve() {
|
|
406
|
+
if (!v.disabled) {
|
|
407
|
+
if (!S.value) {
|
|
408
|
+
let e = w.value?.getBoundingClientRect();
|
|
366
409
|
if (e) {
|
|
367
410
|
let t = e.bottom + 8 + 240 <= window.innerHeight ? e.bottom + 8 : Math.max(8, e.top - 240 - 8);
|
|
368
|
-
|
|
411
|
+
Y.value = q({
|
|
369
412
|
top: t,
|
|
370
413
|
left: e.left
|
|
371
414
|
});
|
|
372
415
|
}
|
|
373
416
|
}
|
|
374
|
-
|
|
417
|
+
S.value = !S.value;
|
|
375
418
|
}
|
|
376
419
|
}
|
|
377
|
-
return (
|
|
378
|
-
|
|
420
|
+
return (n, i) => (e(), c("div", { class: d(["tpl:flex tpl:items-center tpl:gap-2 tpl:relative", m.disabled && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
|
|
421
|
+
f("button", {
|
|
379
422
|
ref_key: "swatchRef",
|
|
380
|
-
ref:
|
|
423
|
+
ref: w,
|
|
381
424
|
type: "button",
|
|
382
|
-
disabled:
|
|
383
|
-
"aria-label":
|
|
384
|
-
title:
|
|
385
|
-
"aria-expanded":
|
|
386
|
-
class:
|
|
425
|
+
disabled: m.disabled,
|
|
426
|
+
"aria-label": m.ariaLabel || u(b).colorPicker.pickColor,
|
|
427
|
+
title: m.ariaLabel || void 0,
|
|
428
|
+
"aria-expanded": S.value,
|
|
429
|
+
class: d([
|
|
387
430
|
"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)]",
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
431
|
+
m.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
|
|
432
|
+
S.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !m.disabled && "hover:tpl:border-[var(--tpl-text-dim)]",
|
|
433
|
+
m.size === "sm" ? "tpl:size-8" : "tpl:size-10"
|
|
391
434
|
]),
|
|
392
|
-
onClick:
|
|
393
|
-
}, [
|
|
394
|
-
class:
|
|
395
|
-
style:
|
|
396
|
-
}, null, 6)], 10,
|
|
397
|
-
|
|
435
|
+
onClick: ve
|
|
436
|
+
}, [f("span", {
|
|
437
|
+
class: d(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", { "tpl-color-swatch-empty": E.value }]),
|
|
438
|
+
style: p(E.value ? void 0 : { backgroundColor: D.value })
|
|
439
|
+
}, null, 6)], 10, je),
|
|
440
|
+
!m.swatchOnly && N.value ? (e(), c("div", Me, [f("input", {
|
|
398
441
|
type: "text",
|
|
399
|
-
class:
|
|
400
|
-
style:
|
|
401
|
-
value:
|
|
402
|
-
placeholder:
|
|
403
|
-
disabled:
|
|
404
|
-
"aria-label":
|
|
405
|
-
onInput:
|
|
406
|
-
}, null, 46,
|
|
442
|
+
class: d([u(x), "tpl:w-full"]),
|
|
443
|
+
style: p(k.value ? { paddingRight: "2.25rem" } : void 0),
|
|
444
|
+
value: D.value,
|
|
445
|
+
placeholder: m.placeholder || u(b).colorPicker.notSet,
|
|
446
|
+
disabled: m.disabled,
|
|
447
|
+
"aria-label": u(b).colorPicker.hexValue,
|
|
448
|
+
onInput: W
|
|
449
|
+
}, null, 46, Ne), k.value ? (e(), c("button", {
|
|
407
450
|
key: 0,
|
|
408
451
|
type: "button",
|
|
409
|
-
"aria-label":
|
|
410
|
-
title:
|
|
452
|
+
"aria-label": u(b).colorPicker.clear,
|
|
453
|
+
title: u(b).colorPicker.clear,
|
|
411
454
|
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)]",
|
|
412
|
-
onClick:
|
|
413
|
-
}, [
|
|
455
|
+
onClick: G
|
|
456
|
+
}, [h(u(de), {
|
|
414
457
|
size: 14,
|
|
415
458
|
"stroke-width": 1.5
|
|
416
|
-
})], 8,
|
|
417
|
-
(
|
|
418
|
-
to:
|
|
419
|
-
disabled: !
|
|
420
|
-
}, [
|
|
459
|
+
})], 8, Pe)) : l("", !0)])) : l("", !0),
|
|
460
|
+
(e(), te(o, {
|
|
461
|
+
to: u(K),
|
|
462
|
+
disabled: !u(K)
|
|
463
|
+
}, [h(ne, {
|
|
421
464
|
"enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
422
465
|
"enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
|
|
423
466
|
"enter-to-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
@@ -425,49 +468,83 @@ var De = [
|
|
|
425
468
|
"leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
426
469
|
"leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
|
|
427
470
|
}, {
|
|
428
|
-
default: r(() => [
|
|
471
|
+
default: r(() => [S.value ? (e(), c("div", {
|
|
429
472
|
key: 0,
|
|
430
473
|
ref_key: "popoverRef",
|
|
431
|
-
ref:
|
|
432
|
-
"data-tpl-theme":
|
|
474
|
+
ref: C,
|
|
475
|
+
"data-tpl-theme": u(_e),
|
|
433
476
|
class: "tpl-color-popover tpl:absolute 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",
|
|
434
|
-
style:
|
|
435
|
-
top: `${
|
|
436
|
-
left: `${
|
|
437
|
-
...
|
|
477
|
+
style: p({
|
|
478
|
+
top: `${Y.value.top}px`,
|
|
479
|
+
left: `${Y.value.left}px`,
|
|
480
|
+
...u(J)
|
|
438
481
|
})
|
|
439
|
-
}, [
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
482
|
+
}, [
|
|
483
|
+
M.value ? (e(), c("div", {
|
|
484
|
+
key: 0,
|
|
485
|
+
role: "radiogroup",
|
|
486
|
+
"aria-label": u(b).colorPicker.presetColors,
|
|
487
|
+
class: d(["tpl:flex tpl:flex-wrap tpl:gap-1.5", N.value && "tpl:mb-2"]),
|
|
488
|
+
onKeydown: ge
|
|
489
|
+
}, [L.value ? (e(), c("button", {
|
|
490
|
+
key: 0,
|
|
491
|
+
type: "button",
|
|
492
|
+
role: "radio",
|
|
493
|
+
"aria-label": u(b).colorPicker.clear,
|
|
494
|
+
title: u(b).colorPicker.clear,
|
|
495
|
+
"aria-checked": E.value,
|
|
496
|
+
tabindex: he(),
|
|
497
|
+
class: d(["tpl-color-swatch-empty tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:focus-visible:ring-2 tpl:focus-visible:ring-[var(--tpl-primary)] tpl:focus-visible:ring-offset-1 tpl:focus-visible:ring-offset-[var(--tpl-bg-elevated)]", E.value ? "tpl:ring-2 tpl:ring-[var(--tpl-primary)] tpl:ring-offset-1 tpl:ring-offset-[var(--tpl-bg-elevated)]" : "hover:tpl:border-[var(--tpl-text-dim)]"]),
|
|
498
|
+
onClick: G
|
|
499
|
+
}, null, 10, Le)) : l("", !0), (e(!0), c(re, null, t(j.value, (t, n) => (e(), c("button", {
|
|
500
|
+
key: t,
|
|
501
|
+
type: "button",
|
|
502
|
+
role: "radio",
|
|
503
|
+
"aria-label": t,
|
|
504
|
+
title: t,
|
|
505
|
+
"aria-checked": F(t),
|
|
506
|
+
tabindex: B(n),
|
|
507
|
+
style: p({ backgroundColor: t }),
|
|
508
|
+
class: d(["tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:focus-visible:ring-2 tpl:focus-visible:ring-[var(--tpl-primary)] tpl:focus-visible:ring-offset-1 tpl:focus-visible:ring-offset-[var(--tpl-bg-elevated)]", F(t) ? "tpl:ring-2 tpl:ring-[var(--tpl-primary)] tpl:ring-offset-1 tpl:ring-offset-[var(--tpl-bg-elevated)]" : "hover:tpl:border-[var(--tpl-text-dim)]"]),
|
|
509
|
+
onClick: (e) => I(t)
|
|
510
|
+
}, null, 14, Re))), 128))], 42, Ie)) : l("", !0),
|
|
511
|
+
N.value ? (e(), c("hex-color-picker", {
|
|
512
|
+
key: 1,
|
|
513
|
+
color: O.value,
|
|
514
|
+
"aria-label": u(b).colorPicker.pickColor,
|
|
515
|
+
onColorChanged: V,
|
|
516
|
+
onPointerdown: H,
|
|
517
|
+
onPointerup: U,
|
|
518
|
+
onKeydown: i[0] ||= a((e) => S.value = !1, ["escape"])
|
|
519
|
+
}, null, 40, ze)) : l("", !0),
|
|
520
|
+
m.swatchOnly && N.value ? (e(), c("div", Be, [f("input", {
|
|
521
|
+
type: "text",
|
|
522
|
+
class: d([u(x), "tpl:w-full"]),
|
|
523
|
+
style: p(k.value ? { paddingRight: "2.25rem" } : void 0),
|
|
524
|
+
value: D.value,
|
|
525
|
+
placeholder: m.placeholder || u(b).colorPicker.notSet,
|
|
526
|
+
disabled: m.disabled,
|
|
527
|
+
"aria-label": u(b).colorPicker.hexValue,
|
|
528
|
+
onChange: W,
|
|
529
|
+
onKeydown: i[1] ||= a(ee((e) => e.target.blur(), ["prevent"]), ["enter"])
|
|
530
|
+
}, null, 46, Ve), k.value ? (e(), c("button", {
|
|
531
|
+
key: 0,
|
|
532
|
+
type: "button",
|
|
533
|
+
"aria-label": u(b).colorPicker.clear,
|
|
534
|
+
title: u(b).colorPicker.clear,
|
|
535
|
+
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)]",
|
|
536
|
+
onClick: G
|
|
537
|
+
}, [h(u(de), {
|
|
538
|
+
size: 14,
|
|
539
|
+
"stroke-width": 1.5
|
|
540
|
+
})], 8, He)) : l("", !0)])) : l("", !0)
|
|
541
|
+
], 12, Fe)) : l("", !0)]),
|
|
467
542
|
_: 1
|
|
468
543
|
})], 8, ["to", "disabled"]))
|
|
469
544
|
], 2));
|
|
470
545
|
}
|
|
471
546
|
});
|
|
472
547
|
//#endregion
|
|
473
|
-
export {
|
|
548
|
+
export { C as _, A as a, O as c, E as d, v as f, T as g, _ as h, M as i, w as l, b as m, j as n, D as o, y as p, me as r, k as s, Ue as t, S as u };
|
|
549
|
+
|
|
550
|
+
//# sourceMappingURL=ColorPicker-y_obnw4o.js.map
|