@templatical/editor 0.19.0 → 0.20.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-DAQTFuvi.js → AiChatSidebar-ChrE6pUq.js} +7 -7
- package/dist/{AiFeatureMenu-aFSO20PR.js → AiFeatureMenu-DkQ9HhQ6.js} +4 -4
- package/dist/{BlockIssueBadge-BQmq1bxn.js → BlockIssueBadge-B4QjePax.js} +2 -2
- package/dist/{CloudEditor-D0K-m1GA.js → CloudEditor-CfX-aMiV.js} +15 -15
- package/dist/{CollaboratorBar-CJO3l6Dt.js → CollaboratorBar-DTibhQ1j.js} +2 -2
- package/dist/{ColorPicker-BsgpTJqK.js → ColorPicker-4vDYhdGe.js} +1 -1
- package/dist/{CommentsSidebar-BYMVucZh.js → CommentsSidebar-D-o5Stlg.js} +8 -8
- package/dist/{CountdownToolbar-PJI3ffi1.js → CountdownToolbar-D7yQqnA2.js} +2 -2
- package/dist/{DesignReferenceSidebar-QfAV8XT9.js → DesignReferenceSidebar-DnO6ZdwS.js} +5 -5
- package/dist/{IssuesPanel-CTjRgz8w.js → IssuesPanel-X_vkNGrs.js} +5 -5
- package/dist/{ModuleBrowserModal-BNalLx0k.js → ModuleBrowserModal-AJt--JPh.js} +6 -6
- package/dist/{ModulePreviewCanvas-BwObwisa.js → ModulePreviewCanvas-BKYOcVCh.js} +1 -1
- package/dist/{NumberWithSuffix-D3BKz66W.js → NumberWithSuffix-Bf3rNxza.js} +1 -1
- package/dist/{ParagraphEditor-Cf75UfSo.js → ParagraphEditor-C5ixOIYb.js} +7 -7
- package/dist/{RichTextEditorContent-MdaLz6Q3.js → RichTextEditorContent-DwhDnMsG.js} +3 -3
- package/dist/{SaveModuleDialog-MTjwiF9D.js → SaveModuleDialog-B4QX9eiv.js} +3 -3
- package/dist/{SnapshotHistory-C_Y1LzAY.js → SnapshotHistory-DaVueFv6.js} +5 -5
- package/dist/{TemplateScoringPanel-DikuKc6i.js → TemplateScoringPanel-B0UHoTLx.js} +10 -10
- package/dist/{TestEmailModal-BW8aTtzf.js → TestEmailModal-BkauxF7j.js} +3 -3
- package/dist/{TitleEditor-CCUkbRN0.js → TitleEditor-n6WDVDjW.js} +4 -4
- package/dist/{TplModal-DoOwUKlT.js → TplModal-BDDyvT-C.js} +1 -1
- package/dist/{blockTypeIcons-BlPKjD7M.js → blockTypeIcons-4D0aFXNg.js} +2 -2
- package/dist/bundle-stats.json +5 -5
- package/dist/cdn/chunks/{AiFeatureMenu-RwJiaPXZ.js → AiFeatureMenu-CIBHAGSz.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-RwJiaPXZ.js.map → AiFeatureMenu-CIBHAGSz.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-DM-TDKbr.js → BlockIssueBadge-CxMiLo3p.js} +4 -4
- package/dist/cdn/chunks/{BlockIssueBadge-DM-TDKbr.js.map → BlockIssueBadge-CxMiLo3p.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-Dufl354p.js → CloudEditor-CEa3Xgqh.js} +131 -131
- package/dist/cdn/chunks/{CloudEditor-Dufl354p.js.map → CloudEditor-CEa3Xgqh.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-xsU20iPl.js → CollaboratorBar-Bk1gD02G.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-xsU20iPl.js.map → CollaboratorBar-Bk1gD02G.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-y_obnw4o.js → ColorPicker-ll8pynws.js} +179 -179
- package/dist/cdn/chunks/ColorPicker-ll8pynws.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-sHsRMe1q.js → CountdownBlock-eGUE7hhw.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-sHsRMe1q.js.map → CountdownBlock-eGUE7hhw.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-Ckc_jEi-.js → CountdownToolbar-C1bkSjUR.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-Ckc_jEi-.js.map → CountdownToolbar-C1bkSjUR.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-DF5Ajuna.js → IssuesPanel-Csasylf_.js} +5 -5
- package/dist/cdn/chunks/{IssuesPanel-DF5Ajuna.js.map → IssuesPanel-Csasylf_.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-DG4AVFjH.js → ModuleBrowserModal-DznWWtBI.js} +7 -7
- package/dist/cdn/chunks/{ModuleBrowserModal-DG4AVFjH.js.map → ModuleBrowserModal-DznWWtBI.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-Bc_PcJuc.js → ModulePreviewCanvas-D-h7fr87.js} +20 -20
- package/dist/cdn/chunks/{ModulePreviewCanvas-Bc_PcJuc.js.map → ModulePreviewCanvas-D-h7fr87.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-8fOO-LC_.js → NumberWithSuffix-Dt-0odUN.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-8fOO-LC_.js.map → NumberWithSuffix-Dt-0odUN.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-BkafKSju.js → ParagraphEditor-v0_XEL-v.js} +18 -18
- package/dist/cdn/chunks/{ParagraphEditor-BkafKSju.js.map → ParagraphEditor-v0_XEL-v.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-BthhzOZS.js → RichTextEditorContent-NQExNsaV.js} +4 -4
- package/dist/cdn/chunks/{RichTextEditorContent-BthhzOZS.js.map → RichTextEditorContent-NQExNsaV.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-DhsfYf2n.js → SaveModuleDialog-BpFhTi-k.js} +5 -5
- package/dist/cdn/chunks/{SaveModuleDialog-DhsfYf2n.js.map → SaveModuleDialog-BpFhTi-k.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DLv9cXba.js → TitleEditor-CS-_MzYs.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-DLv9cXba.js.map → TitleEditor-CS-_MzYs.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-B0uibGX7.js → blockTypeIcons-B0Hjh42a.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-B0uibGX7.js.map → blockTypeIcons-B0Hjh42a.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-DLHvZ0UH.js → extensions-Di3hdIRT.js} +22 -22
- package/dist/cdn/chunks/{extensions-DLHvZ0UH.js.map → extensions-Di3hdIRT.js.map} +1 -1
- package/dist/cdn/chunks/{features-Cnfv4QAY.js → features-CLIZ7Q-Y.js} +1490 -1447
- package/dist/cdn/chunks/features-CLIZ7Q-Y.js.map +1 -0
- package/dist/cdn/chunks/{icons-DbcM69bb.js → icons-GX40Qm2W.js} +2 -2
- package/dist/cdn/chunks/{icons-DbcM69bb.js.map → icons-GX40Qm2W.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-DpSMwHd4.js → media-library-yYAkAagU.js} +80 -80
- package/dist/cdn/chunks/{media-library-DpSMwHd4.js.map → media-library-yYAkAagU.js.map} +1 -1
- package/dist/cdn/chunks/{pusher-CIwiKF8H.js → pusher-R0v5p99W.js} +27 -22
- package/dist/cdn/chunks/pusher-R0v5p99W.js.map +1 -0
- package/dist/cdn/chunks/quality-DffYv9j5.js +2180 -0
- package/dist/cdn/chunks/{quality-D9QqkRcU.js.map → quality-DffYv9j5.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-BsLQZNXU.js → renderer-DpBGiXOg.js} +13 -13
- package/dist/cdn/chunks/{renderer-BsLQZNXU.js.map → renderer-DpBGiXOg.js.map} +1 -1
- package/dist/cdn/chunks/{src-zu1ehVNN.js → src-9K6uFiuK.js} +4 -4
- package/dist/cdn/chunks/{src-zu1ehVNN.js.map → src-9K6uFiuK.js.map} +1 -1
- package/dist/cdn/chunks/{styles-Dx-jXeCd.js → styles-DHSmjlpX.js} +837 -833
- package/dist/cdn/chunks/styles-DHSmjlpX.js.map +1 -0
- package/dist/cdn/editor.js +11 -11
- package/dist/{check-Cg6Mc2pP.js → check-Bl4J_tYV.js} +1 -1
- package/dist/{chevron-down-dClfxKrJ.js → chevron-down-COEcl2iP.js} +1 -1
- package/dist/{circle-alert-Bhzm-fNA.js → circle-alert-CvHi5etc.js} +1 -1
- package/dist/{clock-m7TwQw4b.js → clock-CZZw62e8.js} +1 -1
- package/dist/{createLucideIcon-FSF4peHQ.js → createLucideIcon-_peTZQtY.js} +2 -2
- package/dist/{image-up-CDEgJqwA.js → image-up-D26rNdfX.js} +1 -1
- package/dist/{info-BNP8yGsK.js → info-CE3JSTqk.js} +1 -1
- package/dist/{list-checks-jepi4iYr.js → list-checks-BQsLrtBB.js} +1 -1
- package/dist/{loader-circle-BT38qSm3.js → loader-circle-s9Rh5lLd.js} +1 -1
- package/dist/{message-circle-BAHcL9S-.js → message-circle-CI62d690.js} +1 -1
- package/dist/{refresh-cw-as5Bmg4X.js → refresh-cw-DlYfl65Y.js} +1 -1
- package/dist/{scan-line-IAMjPtRw.js → scan-line-CHadrYVb.js} +1 -1
- package/dist/{send-DvMay6bt.js → send-CbP40otC.js} +1 -1
- package/dist/{shield-check-YYDhGroE.js → shield-check-Bnj9aRoJ.js} +1 -1
- package/dist/{sparkles-CCwQMMMZ.js → sparkles-CncWT57a.js} +1 -1
- package/dist/{styles-64uLkPJV.js → styles-DkF_-uX8.js} +658 -654
- package/dist/templatical-editor.js +4 -4
- package/dist/{text-align-start-BwsA6QzC.js → text-align-start-B458vzYw.js} +1 -1
- package/dist/{trash-2-CRBDolnR.js → trash-2-DO0yjSU1.js} +1 -1
- package/dist/{triangle-alert-B2g0ALvq.js → triangle-alert-C18_ima6.js} +1 -1
- package/dist/{upload-y4gxiFp5.js → upload-DsCd2zTR.js} +1 -1
- package/dist/{useEditorCore-ea9OrrH3.js → useEditorCore-kKUemYY6.js} +910 -867
- package/dist/{x-Ctg_250T.js → x-BCFQuE_q.js} +1 -1
- package/package.json +10 -10
- package/dist/cdn/chunks/ColorPicker-y_obnw4o.js.map +0 -1
- package/dist/cdn/chunks/features-Cnfv4QAY.js.map +0 -1
- package/dist/cdn/chunks/pusher-CIwiKF8H.js.map +0 -1
- package/dist/cdn/chunks/quality-D9QqkRcU.js +0 -2180
- package/dist/cdn/chunks/styles-Dx-jXeCd.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
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 {
|
|
2
|
+
import { Bt as ie, H as ae, Rt as g, Ut as oe, V as se, Zt as ce, _n as le, hn as ue, lt as de, pn as fe, zt as _ } from "./features-CLIZ7Q-Y.js";
|
|
3
3
|
//#region src/constants/styleConstants.ts
|
|
4
|
-
var
|
|
4
|
+
var v = "tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]", y = "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)]", b = "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)]", x = "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)]", S = "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)]", C = "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)]", w = "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)]", T = "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)]", E = "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)]", D = "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", O = [
|
|
5
5
|
"10px",
|
|
6
6
|
"12px",
|
|
7
7
|
"14px",
|
|
@@ -14,7 +14,7 @@ var _ = "tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-te
|
|
|
14
14
|
"36px",
|
|
15
15
|
"48px",
|
|
16
16
|
"64px"
|
|
17
|
-
],
|
|
17
|
+
], k = [
|
|
18
18
|
"1",
|
|
19
19
|
"1.2",
|
|
20
20
|
"1.4",
|
|
@@ -23,7 +23,7 @@ var _ = "tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-te
|
|
|
23
23
|
"1.8",
|
|
24
24
|
"2",
|
|
25
25
|
"2.5"
|
|
26
|
-
],
|
|
26
|
+
], A = [
|
|
27
27
|
{
|
|
28
28
|
label: "Normal",
|
|
29
29
|
value: "normal"
|
|
@@ -52,34 +52,34 @@ var _ = "tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-te
|
|
|
52
52
|
label: "3px",
|
|
53
53
|
value: "3px"
|
|
54
54
|
}
|
|
55
|
-
],
|
|
55
|
+
], j = "#000000", M = "#ffffff", N = "#ffff00", P = "#f2f2f2", F = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, I = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n;
|
|
56
56
|
360 / (Math.PI * 2);
|
|
57
|
-
var
|
|
57
|
+
var L = (e) => he(R(e)), R = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
|
|
58
58
|
r: parseInt(e[0] + e[0], 16),
|
|
59
59
|
g: parseInt(e[1] + e[1], 16),
|
|
60
60
|
b: parseInt(e[2] + e[2], 16),
|
|
61
|
-
a: e.length === 4 ?
|
|
61
|
+
a: e.length === 4 ? I(parseInt(e[3] + e[3], 16) / 255, 2) : 1
|
|
62
62
|
} : {
|
|
63
63
|
r: parseInt(e.substring(0, 2), 16),
|
|
64
64
|
g: parseInt(e.substring(2, 4), 16),
|
|
65
65
|
b: parseInt(e.substring(4, 6), 16),
|
|
66
|
-
a: e.length === 8 ?
|
|
67
|
-
}),
|
|
66
|
+
a: e.length === 8 ? I(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
|
|
67
|
+
}), z = (e) => me(pe(e)), B = ({ h: e, s: t, v: n, a: r }) => {
|
|
68
68
|
let i = (200 - t) * n / 100;
|
|
69
69
|
return {
|
|
70
|
-
h:
|
|
71
|
-
s:
|
|
72
|
-
l:
|
|
73
|
-
a:
|
|
70
|
+
h: I(e),
|
|
71
|
+
s: I(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
|
|
72
|
+
l: I(i / 2),
|
|
73
|
+
a: I(r, 2)
|
|
74
74
|
};
|
|
75
|
-
},
|
|
76
|
-
let { h: t, s: n, l: r } =
|
|
75
|
+
}, V = (e) => {
|
|
76
|
+
let { h: t, s: n, l: r } = B(e);
|
|
77
77
|
return `hsl(${t}, ${n}%, ${r}%)`;
|
|
78
|
-
},
|
|
78
|
+
}, pe = ({ h: e, s: t, v: n, a: r }) => {
|
|
79
79
|
e = e / 360 * 6, t /= 100, n /= 100;
|
|
80
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;
|
|
81
81
|
return {
|
|
82
|
-
r:
|
|
82
|
+
r: I([
|
|
83
83
|
n,
|
|
84
84
|
o,
|
|
85
85
|
a,
|
|
@@ -87,7 +87,7 @@ var F = (e) => V(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.leng
|
|
|
87
87
|
s,
|
|
88
88
|
n
|
|
89
89
|
][c] * 255),
|
|
90
|
-
g:
|
|
90
|
+
g: I([
|
|
91
91
|
s,
|
|
92
92
|
n,
|
|
93
93
|
n,
|
|
@@ -95,7 +95,7 @@ var F = (e) => V(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.leng
|
|
|
95
95
|
a,
|
|
96
96
|
a
|
|
97
97
|
][c] * 255),
|
|
98
|
-
b:
|
|
98
|
+
b: I([
|
|
99
99
|
a,
|
|
100
100
|
a,
|
|
101
101
|
s,
|
|
@@ -103,74 +103,74 @@ var F = (e) => V(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.leng
|
|
|
103
103
|
n,
|
|
104
104
|
o
|
|
105
105
|
][c] * 255),
|
|
106
|
-
a:
|
|
106
|
+
a: I(r, 2)
|
|
107
107
|
};
|
|
108
|
-
},
|
|
108
|
+
}, H = (e) => {
|
|
109
109
|
let t = e.toString(16);
|
|
110
110
|
return t.length < 2 ? "0" + t : t;
|
|
111
|
-
},
|
|
112
|
-
let i = r < 1 ?
|
|
113
|
-
return "#" +
|
|
114
|
-
},
|
|
111
|
+
}, me = ({ r: e, g: t, b: n, a: r }) => {
|
|
112
|
+
let i = r < 1 ? H(I(r * 255)) : "";
|
|
113
|
+
return "#" + H(e) + H(t) + H(n) + i;
|
|
114
|
+
}, he = ({ r: e, g: t, b: n, a: r }) => {
|
|
115
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;
|
|
116
116
|
return {
|
|
117
|
-
h:
|
|
118
|
-
s:
|
|
119
|
-
v:
|
|
117
|
+
h: I(60 * (o < 0 ? o + 6 : o)),
|
|
118
|
+
s: I(i ? a / i * 100 : 0),
|
|
119
|
+
v: I(i / 255 * 100),
|
|
120
120
|
a: r
|
|
121
121
|
};
|
|
122
|
-
},
|
|
122
|
+
}, U = (e, t) => {
|
|
123
123
|
if (e === t) return !0;
|
|
124
124
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
125
125
|
return !0;
|
|
126
|
-
},
|
|
127
|
-
let t =
|
|
128
|
-
return t || (t = document.createElement("template"), t.innerHTML = e,
|
|
129
|
-
},
|
|
126
|
+
}, W = (e, t) => e.toLowerCase() === t.toLowerCase() || U(R(e), R(t)), G = {}, K = (e) => {
|
|
127
|
+
let t = G[e];
|
|
128
|
+
return t || (t = document.createElement("template"), t.innerHTML = e, G[e] = t), t;
|
|
129
|
+
}, q = (e, t, n) => {
|
|
130
130
|
e.dispatchEvent(new CustomEvent(t, {
|
|
131
131
|
bubbles: !0,
|
|
132
132
|
detail: n
|
|
133
133
|
}));
|
|
134
|
-
},
|
|
135
|
-
let n =
|
|
136
|
-
|
|
137
|
-
x:
|
|
138
|
-
y:
|
|
134
|
+
}, J = !1, Y = (e) => "touches" in e, ge = (e) => J && !Y(e) ? !1 : (J ||= Y(e), !0), X = (e, t) => {
|
|
135
|
+
let n = Y(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
|
|
136
|
+
q(e.el, "move", e.getMove({
|
|
137
|
+
x: F((n.pageX - (r.left + window.pageXOffset)) / r.width),
|
|
138
|
+
y: F((n.pageY - (r.top + window.pageYOffset)) / r.height)
|
|
139
139
|
}));
|
|
140
|
-
},
|
|
140
|
+
}, _e = (e, t) => {
|
|
141
141
|
let n = t.keyCode;
|
|
142
|
-
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(),
|
|
142
|
+
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), q(e.el, "move", e.getMove({
|
|
143
143
|
x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
|
|
144
144
|
y: n === 40 ? .01 : n === 38 ? -.01 : 0
|
|
145
145
|
}, !0)));
|
|
146
|
-
},
|
|
146
|
+
}, ve = class {
|
|
147
147
|
constructor(e, t, n, r) {
|
|
148
|
-
let i =
|
|
148
|
+
let i = K(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
|
|
149
149
|
e.appendChild(i.content.cloneNode(!0));
|
|
150
150
|
let a = e.querySelector(`[part=${t}]`);
|
|
151
151
|
a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
|
|
152
152
|
}
|
|
153
153
|
set dragging(e) {
|
|
154
154
|
let t = e ? document.addEventListener : document.removeEventListener;
|
|
155
|
-
t(
|
|
155
|
+
t(J ? "touchmove" : "mousemove", this), t(J ? "touchend" : "mouseup", this);
|
|
156
156
|
}
|
|
157
157
|
handleEvent(e) {
|
|
158
158
|
switch (e.type) {
|
|
159
159
|
case "mousedown":
|
|
160
160
|
case "touchstart":
|
|
161
|
-
if (e.preventDefault(), !
|
|
162
|
-
this.el.focus(),
|
|
161
|
+
if (e.preventDefault(), !ge(e) || !J && e.button != 0) return;
|
|
162
|
+
this.el.focus(), X(this, e), this.dragging = !0;
|
|
163
163
|
break;
|
|
164
164
|
case "mousemove":
|
|
165
165
|
case "touchmove":
|
|
166
|
-
e.preventDefault(),
|
|
166
|
+
e.preventDefault(), X(this, e);
|
|
167
167
|
break;
|
|
168
168
|
case "mouseup":
|
|
169
169
|
case "touchend":
|
|
170
170
|
this.dragging = !1;
|
|
171
171
|
break;
|
|
172
172
|
case "keydown":
|
|
173
|
-
|
|
173
|
+
_e(this, e);
|
|
174
174
|
break;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
@@ -179,25 +179,25 @@ var F = (e) => V(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.leng
|
|
|
179
179
|
for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
-
},
|
|
182
|
+
}, ye = class extends ve {
|
|
183
183
|
constructor(e) {
|
|
184
184
|
super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
|
|
185
185
|
}
|
|
186
186
|
update({ h: e }) {
|
|
187
187
|
this.h = e, this.style([{
|
|
188
188
|
left: `${e / 360 * 100}%`,
|
|
189
|
-
color:
|
|
189
|
+
color: V({
|
|
190
190
|
h: e,
|
|
191
191
|
s: 100,
|
|
192
192
|
v: 100,
|
|
193
193
|
a: 1
|
|
194
194
|
})
|
|
195
|
-
}]), this.el.setAttribute("aria-valuenow", `${
|
|
195
|
+
}]), this.el.setAttribute("aria-valuenow", `${I(e)}`);
|
|
196
196
|
}
|
|
197
197
|
getMove(e, t) {
|
|
198
|
-
return { h: t ?
|
|
198
|
+
return { h: t ? F(this.h + e.x * 360, 0, 360) : 360 * e.x };
|
|
199
199
|
}
|
|
200
|
-
},
|
|
200
|
+
}, be = class extends ve {
|
|
201
201
|
constructor(e) {
|
|
202
202
|
super(e, "saturation", "aria-label=\"Color\"", !0);
|
|
203
203
|
}
|
|
@@ -205,47 +205,47 @@ var F = (e) => V(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.leng
|
|
|
205
205
|
this.hsva = e, this.style([{
|
|
206
206
|
top: `${100 - e.v}%`,
|
|
207
207
|
left: `${e.s}%`,
|
|
208
|
-
color:
|
|
209
|
-
}, { "background-color":
|
|
208
|
+
color: V(e)
|
|
209
|
+
}, { "background-color": V({
|
|
210
210
|
h: e.h,
|
|
211
211
|
s: 100,
|
|
212
212
|
v: 100,
|
|
213
213
|
a: 1
|
|
214
|
-
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${
|
|
214
|
+
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${I(e.s)}%, Brightness ${I(e.v)}%`);
|
|
215
215
|
}
|
|
216
216
|
getMove(e, t) {
|
|
217
217
|
return {
|
|
218
|
-
s: t ?
|
|
219
|
-
v: t ?
|
|
218
|
+
s: t ? F(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
|
|
219
|
+
v: t ? F(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
|
-
},
|
|
222
|
+
}, xe = ":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)}", Se = "[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}", Ce = "[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}", Z = Symbol("same"), Q = Symbol("color"), we = Symbol("hsva"), $ = Symbol("update"), Te = Symbol("parts"), Ee = Symbol("css"), De = Symbol("sliders"), Oe = class extends HTMLElement {
|
|
223
223
|
static get observedAttributes() {
|
|
224
224
|
return ["color"];
|
|
225
225
|
}
|
|
226
|
-
get [
|
|
226
|
+
get [Ee]() {
|
|
227
227
|
return [
|
|
228
|
+
xe,
|
|
228
229
|
Se,
|
|
229
|
-
Ce
|
|
230
|
-
we
|
|
230
|
+
Ce
|
|
231
231
|
];
|
|
232
232
|
}
|
|
233
|
-
get [
|
|
234
|
-
return [
|
|
233
|
+
get [De]() {
|
|
234
|
+
return [be, ye];
|
|
235
235
|
}
|
|
236
236
|
get color() {
|
|
237
|
-
return this[
|
|
237
|
+
return this[Q];
|
|
238
238
|
}
|
|
239
239
|
set color(e) {
|
|
240
|
-
if (!this[
|
|
240
|
+
if (!this[Z](e)) {
|
|
241
241
|
let t = this.colorModel.toHsva(e);
|
|
242
|
-
this[
|
|
242
|
+
this[$](t), this[Q] = e;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
constructor() {
|
|
246
246
|
super();
|
|
247
|
-
let e =
|
|
248
|
-
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[
|
|
247
|
+
let e = K(`<style>${this[Ee].join("")}</style>`), t = this.attachShadow({ mode: "open" });
|
|
248
|
+
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[Te] = this[De].map((e) => new e(t));
|
|
249
249
|
}
|
|
250
250
|
connectedCallback() {
|
|
251
251
|
if (this.hasOwnProperty("color")) {
|
|
@@ -255,33 +255,33 @@ var F = (e) => V(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.leng
|
|
|
255
255
|
}
|
|
256
256
|
attributeChangedCallback(e, t, n) {
|
|
257
257
|
let r = this.colorModel.fromAttr(n);
|
|
258
|
-
this[
|
|
258
|
+
this[Z](r) || (this.color = r);
|
|
259
259
|
}
|
|
260
260
|
handleEvent(e) {
|
|
261
|
-
let t = this[
|
|
261
|
+
let t = this[we], n = {
|
|
262
262
|
...t,
|
|
263
263
|
...e.detail
|
|
264
264
|
};
|
|
265
|
-
this[
|
|
265
|
+
this[$](n);
|
|
266
266
|
let r;
|
|
267
|
-
!
|
|
267
|
+
!U(n, t) && !this[Z](r = this.colorModel.fromHsva(n)) && (this[Q] = r, q(this, "color-changed", { value: r }));
|
|
268
268
|
}
|
|
269
|
-
[
|
|
269
|
+
[Z](e) {
|
|
270
270
|
return this.color && this.colorModel.equal(e, this.color);
|
|
271
271
|
}
|
|
272
|
-
[
|
|
273
|
-
this[
|
|
272
|
+
[$](e) {
|
|
273
|
+
this[we] = e, this[Te].forEach((t) => t.update(e));
|
|
274
274
|
}
|
|
275
275
|
}, ke = {
|
|
276
276
|
defaultColor: "#000",
|
|
277
|
-
toHsva:
|
|
278
|
-
fromHsva: ({ h: e, s: t, v: n }) =>
|
|
277
|
+
toHsva: L,
|
|
278
|
+
fromHsva: ({ h: e, s: t, v: n }) => z({
|
|
279
279
|
h: e,
|
|
280
280
|
s: t,
|
|
281
281
|
v: n,
|
|
282
282
|
a: 1
|
|
283
283
|
}),
|
|
284
|
-
equal:
|
|
284
|
+
equal: W,
|
|
285
285
|
fromAttr: (e) => e
|
|
286
286
|
}, Ae = class extends Oe {
|
|
287
287
|
get colorModel() {
|
|
@@ -346,34 +346,34 @@ var je = [
|
|
|
346
346
|
}
|
|
347
347
|
},
|
|
348
348
|
emits: ["update:modelValue"],
|
|
349
|
-
setup(m, { emit:
|
|
350
|
-
let
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}, { ignore: [
|
|
354
|
-
let
|
|
355
|
-
function
|
|
356
|
-
return
|
|
357
|
-
}
|
|
358
|
-
function I(e) {
|
|
359
|
-
y("update:modelValue", e);
|
|
349
|
+
setup(m, { emit: v }) {
|
|
350
|
+
let y = m, b = v, { t: x } = oe(), C = i(!1), w = i(), T = i(), E = i(!1);
|
|
351
|
+
le(w, () => {
|
|
352
|
+
C.value = !1;
|
|
353
|
+
}, { ignore: [T] });
|
|
354
|
+
let D = s(() => !y.modelValue), O = s(() => _(y.modelValue)), k = s(() => _(y.modelValue || y.seedColor)), A = s(() => !y.disabled && !D.value), j = n(ce, ie), M = s(() => [...new Set(y.presets ?? j.presets)]), N = s(() => y.allowCustom ?? j.allowCustom), P = s(() => M.value.length > 0), F = s(() => N.value || !P.value), I = s(() => g(y.modelValue));
|
|
355
|
+
function L(e) {
|
|
356
|
+
return I.value !== "" && g(e) === I.value;
|
|
360
357
|
}
|
|
361
|
-
let L = s(() => M.value && !N.value);
|
|
362
358
|
function R(e) {
|
|
363
|
-
|
|
359
|
+
b("update:modelValue", e);
|
|
364
360
|
}
|
|
365
|
-
let z = s(() =>
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
361
|
+
let z = s(() => P.value && !F.value);
|
|
362
|
+
function B(e) {
|
|
363
|
+
return z.value ? e + 1 : e;
|
|
364
|
+
}
|
|
365
|
+
let V = s(() => {
|
|
366
|
+
if (z.value && D.value) return 0;
|
|
367
|
+
let e = M.value.findIndex((e) => L(e));
|
|
368
|
+
return e === -1 ? 0 : B(e);
|
|
369
369
|
});
|
|
370
|
-
function
|
|
371
|
-
return
|
|
370
|
+
function pe() {
|
|
371
|
+
return V.value === 0 ? 0 : -1;
|
|
372
372
|
}
|
|
373
|
-
function
|
|
374
|
-
return
|
|
373
|
+
function H(e) {
|
|
374
|
+
return B(e) === V.value ? 0 : -1;
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function me(e) {
|
|
377
377
|
if (![
|
|
378
378
|
"ArrowRight",
|
|
379
379
|
"ArrowDown",
|
|
@@ -383,83 +383,83 @@ var je = [
|
|
|
383
383
|
let t = Array.from(e.currentTarget.querySelectorAll("[role=\"radio\"]")), n = e.target.closest("[role=\"radio\"]"), r = n ? t.indexOf(n) : -1;
|
|
384
384
|
r !== -1 && (t[(r + (e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus(), e.preventDefault());
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
|
|
388
|
-
}
|
|
389
|
-
function H() {
|
|
390
|
-
T.value = !1;
|
|
386
|
+
function he(e) {
|
|
387
|
+
E.value = !0, b("update:modelValue", e.detail.value);
|
|
391
388
|
}
|
|
392
389
|
function U() {
|
|
393
|
-
|
|
390
|
+
E.value = !1;
|
|
391
|
+
}
|
|
392
|
+
function W() {
|
|
393
|
+
!E.value && D.value && b("update:modelValue", k.value);
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
|
|
395
|
+
function G(e) {
|
|
396
|
+
b("update:modelValue", e.target.value);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
|
|
398
|
+
function K() {
|
|
399
|
+
b("update:modelValue", "");
|
|
400
400
|
}
|
|
401
|
-
let
|
|
401
|
+
let q = ae(), { toLocal: J } = se(), Y = n(fe, null), ge = n(ue, null), X = i({
|
|
402
402
|
top: 0,
|
|
403
403
|
left: 0
|
|
404
404
|
});
|
|
405
|
-
function
|
|
406
|
-
if (!
|
|
407
|
-
if (!
|
|
408
|
-
let e =
|
|
405
|
+
function _e() {
|
|
406
|
+
if (!y.disabled) {
|
|
407
|
+
if (!C.value) {
|
|
408
|
+
let e = T.value?.getBoundingClientRect();
|
|
409
409
|
if (e) {
|
|
410
410
|
let t = e.bottom + 8 + 240 <= window.innerHeight ? e.bottom + 8 : Math.max(8, e.top - 240 - 8);
|
|
411
|
-
|
|
411
|
+
X.value = J({
|
|
412
412
|
top: t,
|
|
413
413
|
left: e.left
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
|
|
417
|
+
C.value = !C.value;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
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
421
|
f("button", {
|
|
422
422
|
ref_key: "swatchRef",
|
|
423
|
-
ref:
|
|
423
|
+
ref: T,
|
|
424
424
|
type: "button",
|
|
425
425
|
disabled: m.disabled,
|
|
426
|
-
"aria-label": m.ariaLabel || u(
|
|
426
|
+
"aria-label": m.ariaLabel || u(x).colorPicker.pickColor,
|
|
427
427
|
title: m.ariaLabel || void 0,
|
|
428
|
-
"aria-expanded":
|
|
428
|
+
"aria-expanded": C.value,
|
|
429
429
|
class: d([
|
|
430
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)]",
|
|
431
431
|
m.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
|
|
432
|
-
|
|
432
|
+
C.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !m.disabled && "hover:tpl:border-[var(--tpl-text-dim)]",
|
|
433
433
|
m.size === "sm" ? "tpl:size-8" : "tpl:size-10"
|
|
434
434
|
]),
|
|
435
|
-
onClick:
|
|
435
|
+
onClick: _e
|
|
436
436
|
}, [f("span", {
|
|
437
|
-
class: d(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", { "tpl-color-swatch-empty":
|
|
438
|
-
style: p(
|
|
437
|
+
class: d(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", { "tpl-color-swatch-empty": D.value }]),
|
|
438
|
+
style: p(D.value ? void 0 : { backgroundColor: O.value })
|
|
439
439
|
}, null, 6)], 10, je),
|
|
440
|
-
!m.swatchOnly &&
|
|
440
|
+
!m.swatchOnly && F.value ? (e(), c("div", Me, [f("input", {
|
|
441
441
|
type: "text",
|
|
442
|
-
class: d([u(
|
|
443
|
-
style: p(
|
|
444
|
-
value:
|
|
445
|
-
placeholder: m.placeholder || u(
|
|
442
|
+
class: d([u(S), "tpl:w-full"]),
|
|
443
|
+
style: p(A.value ? { paddingRight: "2.25rem" } : void 0),
|
|
444
|
+
value: O.value,
|
|
445
|
+
placeholder: m.placeholder || u(x).colorPicker.notSet,
|
|
446
446
|
disabled: m.disabled,
|
|
447
|
-
"aria-label": u(
|
|
448
|
-
onInput:
|
|
449
|
-
}, null, 46, Ne),
|
|
447
|
+
"aria-label": u(x).colorPicker.hexValue,
|
|
448
|
+
onInput: G
|
|
449
|
+
}, null, 46, Ne), A.value ? (e(), c("button", {
|
|
450
450
|
key: 0,
|
|
451
451
|
type: "button",
|
|
452
|
-
"aria-label": u(
|
|
453
|
-
title: u(
|
|
452
|
+
"aria-label": u(x).colorPicker.clear,
|
|
453
|
+
title: u(x).colorPicker.clear,
|
|
454
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)]",
|
|
455
|
-
onClick:
|
|
455
|
+
onClick: K
|
|
456
456
|
}, [h(u(de), {
|
|
457
457
|
size: 14,
|
|
458
458
|
"stroke-width": 1.5
|
|
459
459
|
})], 8, Pe)) : l("", !0)])) : l("", !0),
|
|
460
460
|
(e(), te(o, {
|
|
461
|
-
to: u(
|
|
462
|
-
disabled: !u(
|
|
461
|
+
to: u(q),
|
|
462
|
+
disabled: !u(q)
|
|
463
463
|
}, [h(ne, {
|
|
464
464
|
"enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
465
465
|
"enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
|
|
@@ -468,72 +468,72 @@ var je = [
|
|
|
468
468
|
"leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
469
469
|
"leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
|
|
470
470
|
}, {
|
|
471
|
-
default: r(() => [
|
|
471
|
+
default: r(() => [C.value ? (e(), c("div", {
|
|
472
472
|
key: 0,
|
|
473
473
|
ref_key: "popoverRef",
|
|
474
|
-
ref:
|
|
475
|
-
"data-tpl-theme": u(
|
|
474
|
+
ref: w,
|
|
475
|
+
"data-tpl-theme": u(ge),
|
|
476
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",
|
|
477
477
|
style: p({
|
|
478
|
-
top: `${
|
|
479
|
-
left: `${
|
|
480
|
-
...u(
|
|
478
|
+
top: `${X.value.top}px`,
|
|
479
|
+
left: `${X.value.left}px`,
|
|
480
|
+
...u(Y)
|
|
481
481
|
})
|
|
482
482
|
}, [
|
|
483
|
-
|
|
483
|
+
P.value ? (e(), c("div", {
|
|
484
484
|
key: 0,
|
|
485
485
|
role: "radiogroup",
|
|
486
|
-
"aria-label": u(
|
|
487
|
-
class: d(["tpl:flex tpl:flex-wrap tpl:gap-1.5",
|
|
488
|
-
onKeydown:
|
|
489
|
-
}, [
|
|
486
|
+
"aria-label": u(x).colorPicker.presetColors,
|
|
487
|
+
class: d(["tpl:flex tpl:flex-wrap tpl:gap-1.5", F.value && "tpl:mb-2"]),
|
|
488
|
+
onKeydown: me
|
|
489
|
+
}, [z.value ? (e(), c("button", {
|
|
490
490
|
key: 0,
|
|
491
491
|
type: "button",
|
|
492
492
|
role: "radio",
|
|
493
|
-
"aria-label": u(
|
|
494
|
-
title: u(
|
|
495
|
-
"aria-checked":
|
|
496
|
-
tabindex:
|
|
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)]",
|
|
498
|
-
onClick:
|
|
499
|
-
}, null, 10, Le)) : l("", !0), (e(!0), c(re, null, t(
|
|
493
|
+
"aria-label": u(x).colorPicker.clear,
|
|
494
|
+
title: u(x).colorPicker.clear,
|
|
495
|
+
"aria-checked": D.value,
|
|
496
|
+
tabindex: pe(),
|
|
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)]", D.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: K
|
|
499
|
+
}, null, 10, Le)) : l("", !0), (e(!0), c(re, null, t(M.value, (t, n) => (e(), c("button", {
|
|
500
500
|
key: t,
|
|
501
501
|
type: "button",
|
|
502
502
|
role: "radio",
|
|
503
503
|
"aria-label": t,
|
|
504
504
|
title: t,
|
|
505
|
-
"aria-checked":
|
|
506
|
-
tabindex:
|
|
505
|
+
"aria-checked": L(t),
|
|
506
|
+
tabindex: H(n),
|
|
507
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)]",
|
|
509
|
-
onClick: (e) =>
|
|
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)]", L(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) => R(t)
|
|
510
510
|
}, null, 14, Re))), 128))], 42, Ie)) : l("", !0),
|
|
511
|
-
|
|
511
|
+
F.value ? (e(), c("hex-color-picker", {
|
|
512
512
|
key: 1,
|
|
513
|
-
color:
|
|
514
|
-
"aria-label": u(
|
|
515
|
-
onColorChanged:
|
|
516
|
-
onPointerdown:
|
|
517
|
-
onPointerup:
|
|
518
|
-
onKeydown: i[0] ||= a((e) =>
|
|
513
|
+
color: k.value,
|
|
514
|
+
"aria-label": u(x).colorPicker.pickColor,
|
|
515
|
+
onColorChanged: he,
|
|
516
|
+
onPointerdown: U,
|
|
517
|
+
onPointerup: W,
|
|
518
|
+
onKeydown: i[0] ||= a((e) => C.value = !1, ["escape"])
|
|
519
519
|
}, null, 40, ze)) : l("", !0),
|
|
520
|
-
m.swatchOnly &&
|
|
520
|
+
m.swatchOnly && F.value ? (e(), c("div", Be, [f("input", {
|
|
521
521
|
type: "text",
|
|
522
|
-
class: d([u(
|
|
523
|
-
style: p(
|
|
524
|
-
value:
|
|
525
|
-
placeholder: m.placeholder || u(
|
|
522
|
+
class: d([u(S), "tpl:w-full"]),
|
|
523
|
+
style: p(A.value ? { paddingRight: "2.25rem" } : void 0),
|
|
524
|
+
value: O.value,
|
|
525
|
+
placeholder: m.placeholder || u(x).colorPicker.notSet,
|
|
526
526
|
disabled: m.disabled,
|
|
527
|
-
"aria-label": u(
|
|
528
|
-
onChange:
|
|
527
|
+
"aria-label": u(x).colorPicker.hexValue,
|
|
528
|
+
onChange: G,
|
|
529
529
|
onKeydown: i[1] ||= a(ee((e) => e.target.blur(), ["prevent"]), ["enter"])
|
|
530
|
-
}, null, 46, Ve),
|
|
530
|
+
}, null, 46, Ve), A.value ? (e(), c("button", {
|
|
531
531
|
key: 0,
|
|
532
532
|
type: "button",
|
|
533
|
-
"aria-label": u(
|
|
534
|
-
title: u(
|
|
533
|
+
"aria-label": u(x).colorPicker.clear,
|
|
534
|
+
title: u(x).colorPicker.clear,
|
|
535
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:
|
|
536
|
+
onClick: K
|
|
537
537
|
}, [h(u(de), {
|
|
538
538
|
size: 14,
|
|
539
539
|
"stroke-width": 1.5
|
|
@@ -545,6 +545,6 @@ var je = [
|
|
|
545
545
|
}
|
|
546
546
|
});
|
|
547
547
|
//#endregion
|
|
548
|
-
export {
|
|
548
|
+
export { w as _, j as a, k as c, D as d, y as f, E as g, v as h, P as i, T as l, x as m, M as n, O as o, b as p, N as r, A as s, Ue as t, C as u };
|
|
549
549
|
|
|
550
|
-
//# sourceMappingURL=ColorPicker-
|
|
550
|
+
//# sourceMappingURL=ColorPicker-ll8pynws.js.map
|