@templatical/editor 0.16.4 → 0.17.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-CYAbVB2G.js → AiChatSidebar-LxCHMdcj.js} +1 -1
- package/dist/{AiFeatureMenu-BPCkrHAS.js → AiFeatureMenu-zwSmx9ZW.js} +3 -3
- package/dist/{BlockIssueBadge-BLytBabN.js → BlockIssueBadge-BQ1yB1me.js} +2 -2
- package/dist/{CloudEditor-v8ARYaFW.js → CloudEditor-5ahgKRX8.js} +11 -10
- package/dist/{CollaboratorBar-BQzKZ2zo.js → CollaboratorBar-6PtX-1AS.js} +2 -2
- package/dist/{ColorPicker-Cab6U2sH.js → ColorPicker-DfzDyNKe.js} +57 -58
- package/dist/{CommentsSidebar-C_XLBbo3.js → CommentsSidebar-Cl93TN96.js} +3 -3
- package/dist/{CountdownBlock-173fiO5Z.js → CountdownBlock-DbXfzwae.js} +1 -1
- package/dist/{CountdownToolbar-q3umZ7TZ.js → CountdownToolbar-BqaMWRyB.js} +3 -3
- package/dist/{DesignReferenceSidebar-Bh9uAZ4B.js → DesignReferenceSidebar-jVrdS8wW.js} +2 -2
- package/dist/{IssuesPanel-DltSuU6H.js → IssuesPanel-Bq3yXg6M.js} +2 -2
- package/dist/{MergeTagSuggestion-DrT3LiZ4.js → MergeTagSuggestion-jIpT_jmz.js} +7 -5
- package/dist/{ModuleBrowserModal-CzzChPmN.js → ModuleBrowserModal-B5IH3-1I.js} +7 -7
- package/dist/{ModulePreviewCanvas-C0Q2n3FL.js → ModulePreviewCanvas-CYOLWoZ9.js} +2 -2
- package/dist/{NumberWithSuffix-Bhm2ByHs.js → NumberWithSuffix-9FG7mNnn.js} +1 -1
- package/dist/{ParagraphEditor-BhsBi8p8.js → ParagraphEditor-duWYA6Vv.js} +38 -39
- package/dist/{RichTextEditorContent-ef0fdj6e.js → RichTextEditorContent-DCzmVeyb.js} +13 -13
- package/dist/{SaveModuleDialog-BNN3dcxD.js → SaveModuleDialog-BPUly5h3.js} +6 -6
- package/dist/{SnapshotHistory-tWvgMCe6.js → SnapshotHistory-CmwU3nlN.js} +4 -4
- package/dist/{TemplateScoringPanel-ZhObHWeb.js → TemplateScoringPanel-CMrfa9Rd.js} +3 -3
- package/dist/{TestEmailModal-EdwEcsrD.js → TestEmailModal-zfomMz9i.js} +3 -3
- package/dist/{TitleEditor-DdvRepBq.js → TitleEditor-v0gtezZE.js} +18 -18
- package/dist/{TplModal-Niu4Y96-.js → TplModal-eGFG7k-y.js} +4 -4
- package/dist/{blockTypeIcons-DHcYPMB8.js → blockTypeIcons-Dd0w4T0I.js} +1 -1
- package/dist/bundle-stats.json +7 -7
- package/dist/{ca-DI1ViqMa.js → ca-CSl--oWR.js} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-AoUwsqor.js → AiFeatureMenu-CtXsam7G.js} +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-AoUwsqor.js.map → AiFeatureMenu-CtXsam7G.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-DZU3CfEN.js → BlockIssueBadge-DR7cpDfQ.js} +4 -4
- package/dist/cdn/chunks/{BlockIssueBadge-DZU3CfEN.js.map → BlockIssueBadge-DR7cpDfQ.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-BrZLF_m1.js → CloudEditor-YC5y3AwC.js} +131 -130
- package/dist/cdn/chunks/CloudEditor-YC5y3AwC.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-BAC56ez6.js → CollaboratorBar-BOD2j8Kl.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-BAC56ez6.js.map → CollaboratorBar-BOD2j8Kl.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-DLEoT419.js → ColorPicker-CPMWLHpa.js} +144 -144
- package/dist/cdn/chunks/ColorPicker-CPMWLHpa.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-BOF9aTXF.js → CountdownBlock-BmGqb7Zi.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-BOF9aTXF.js.map → CountdownBlock-BmGqb7Zi.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-C9bQ5k4E.js → CountdownToolbar-BBwsdGbV.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-C9bQ5k4E.js.map → CountdownToolbar-BBwsdGbV.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-CHwYahKK.js → IssuesPanel-G0z-j3JS.js} +7 -7
- package/dist/cdn/chunks/{IssuesPanel-CHwYahKK.js.map → IssuesPanel-G0z-j3JS.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-iSXXpAUk.js → ModuleBrowserModal-DiLTY0ec.js} +8 -8
- package/dist/cdn/chunks/{ModuleBrowserModal-iSXXpAUk.js.map → ModuleBrowserModal-DiLTY0ec.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-DIy0MZj2.js → ModulePreviewCanvas-CdV5mEQ6.js} +32 -32
- package/dist/cdn/chunks/{ModulePreviewCanvas-DIy0MZj2.js.map → ModulePreviewCanvas-CdV5mEQ6.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-vPdOG2lO.js → NumberWithSuffix-lqQlf0Uk.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-vPdOG2lO.js.map → NumberWithSuffix-lqQlf0Uk.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-D7znI_X1.js → ParagraphEditor-BYoZfURd.js} +75 -75
- package/dist/cdn/chunks/ParagraphEditor-BYoZfURd.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-DVwGHbO6.js → RichTextEditorContent-BnPRnXxy.js} +6 -6
- package/dist/cdn/chunks/{RichTextEditorContent-DVwGHbO6.js.map → RichTextEditorContent-BnPRnXxy.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-D2_qPtE9.js → SaveModuleDialog-C9hUeWyG.js} +20 -20
- package/dist/cdn/chunks/{SaveModuleDialog-D2_qPtE9.js.map → SaveModuleDialog-C9hUeWyG.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-CKjZ6Cgp.js → TitleEditor-wFvnU3Jr.js} +9 -9
- package/dist/cdn/chunks/TitleEditor-wFvnU3Jr.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-BKecgdgr.js → blockTypeIcons-DNMvDz5B.js} +7 -7
- package/dist/cdn/chunks/{blockTypeIcons-BKecgdgr.js.map → blockTypeIcons-DNMvDz5B.js.map} +1 -1
- package/dist/cdn/chunks/{ca-DI1ViqMa.js → ca-CSl--oWR.js} +2 -2
- package/dist/cdn/chunks/ca-CSl--oWR.js.map +1 -0
- package/dist/cdn/chunks/{de-q9lTCMre.js → de-ZaffrKDP.js} +2 -2
- package/dist/cdn/chunks/de-ZaffrKDP.js.map +1 -0
- package/dist/cdn/chunks/{en-CR4LItrX.js → en-CHuXeJDt.js} +2 -2
- package/dist/cdn/chunks/en-CHuXeJDt.js.map +1 -0
- package/dist/cdn/chunks/{es-CEt-lrGd.js → es-CaC8VQjO.js} +2 -2
- package/dist/cdn/chunks/es-CaC8VQjO.js.map +1 -0
- package/dist/cdn/chunks/{extensions-OZTN_skA.js → extensions-DxcxIlwT.js} +29 -29
- package/dist/cdn/chunks/{extensions-OZTN_skA.js.map → extensions-DxcxIlwT.js.map} +1 -1
- package/dist/cdn/chunks/{features-Bo7H8WNI.js → features-B3qgDBHf.js} +727 -677
- package/dist/cdn/chunks/features-B3qgDBHf.js.map +1 -0
- package/dist/cdn/chunks/{icons-BrNSrnyT.js → icons-kiMqh99T.js} +2 -2
- package/dist/cdn/chunks/{icons-BrNSrnyT.js.map → icons-kiMqh99T.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-Cec5DMR3.js → media-library-C5ogiZ4f.js} +451 -451
- package/dist/cdn/chunks/{media-library-Cec5DMR3.js.map → media-library-C5ogiZ4f.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-DvBHY0AA.js → pt-BR-C74zfEWH.js} +2 -2
- package/dist/cdn/chunks/pt-BR-C74zfEWH.js.map +1 -0
- package/dist/cdn/chunks/{quality-Dd2iYgRf.js → quality-BftAn_AJ.js} +512 -512
- package/dist/cdn/chunks/{quality-Dd2iYgRf.js.map → quality-BftAn_AJ.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-Br-qXdnQ.js → renderer-Cdlo4MVX.js} +16 -16
- package/dist/cdn/chunks/{renderer-Br-qXdnQ.js.map → renderer-Cdlo4MVX.js.map} +1 -1
- package/dist/cdn/chunks/{src-BH8PABpF.js → src-GBA8oUL2.js} +6 -6
- package/dist/cdn/chunks/{src-BH8PABpF.js.map → src-GBA8oUL2.js.map} +1 -1
- package/dist/cdn/chunks/{styles-nqo5BynI.js → styles-B6rdq9JB.js} +219 -219
- package/dist/cdn/chunks/styles-B6rdq9JB.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +53 -52
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{de-q9lTCMre.js → de-ZaffrKDP.js} +1 -1
- package/dist/{en-CR4LItrX.js → en-CHuXeJDt.js} +1 -1
- package/dist/{es-CEt-lrGd.js → es-CaC8VQjO.js} +1 -1
- package/dist/{extensions-B2poxDIo.js → extensions-B4lu0KkE.js} +3 -3
- package/dist/index.d.ts +56 -0
- package/dist/keys-WVNarXg8.js +10 -0
- package/dist/{pt-BR-DvBHY0AA.js → pt-BR-C74zfEWH.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-DN4J7w-C.js → styles-mBSbDYeX.js} +98 -98
- package/dist/templatical-editor.js +11 -10
- package/dist/{useCloudI18n-WbfVWq5k.js → useCloudI18n-CIKI0hCd.js} +1 -1
- package/dist/{useEditorCore-DBq2689h.js → useEditorCore-CaaHPKjm.js} +715 -684
- package/dist/{useI18n-eR1yVW0v.js → useI18n-0EU_JVe7.js} +1 -1
- package/dist/{useMergeTag-C3GfSktg.js → useMergeTag-C7v6MVah.js} +2 -2
- package/dist/usePopoverPosition-BDqqnMeo.js +281 -0
- package/package.json +7 -7
- package/dist/cdn/chunks/CloudEditor-BrZLF_m1.js.map +0 -1
- package/dist/cdn/chunks/ColorPicker-DLEoT419.js.map +0 -1
- package/dist/cdn/chunks/MergeTagSuggestion-jesxS7An.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-D7znI_X1.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-CKjZ6Cgp.js.map +0 -1
- package/dist/cdn/chunks/ca-DI1ViqMa.js.map +0 -1
- package/dist/cdn/chunks/de-q9lTCMre.js.map +0 -1
- package/dist/cdn/chunks/en-CR4LItrX.js.map +0 -1
- package/dist/cdn/chunks/es-CEt-lrGd.js.map +0 -1
- package/dist/cdn/chunks/features-Bo7H8WNI.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-DvBHY0AA.js.map +0 -1
- package/dist/cdn/chunks/styles-nqo5BynI.js.map +0 -1
- package/dist/color-DhoxCSMv.js +0 -259
- package/dist/keys-BbDgCU6K.js +0 -10
- package/dist/usePopoverRoot-C1j0D7cc.js +0 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { M as e, T as t, V as n, Z as r, c as i, d as a, f as o, g as s, h as c, it as l, l as ee, m as te, n as ne, ot as u, p as d, st as f, x as p, y as m } from "./draggable-D840DIZB.js";
|
|
2
|
-
import {
|
|
2
|
+
import { $ as h, Bt as re, H as ie, V as ae, dn as oe, ln as se, pn as ce, ut as g } from "./features-B3qgDBHf.js";
|
|
3
3
|
//#region src/constants/styleConstants.ts
|
|
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)]",
|
|
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)]", le = "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)]", x = "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)]", S = "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)]", C = "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)]", w = "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)]", T = "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", E = [
|
|
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
|
+
], D = [
|
|
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
|
+
], O = [
|
|
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
|
+
], k = "#000000", A = "#ffffff", j = "#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;
|
|
56
56
|
360 / (Math.PI * 2);
|
|
57
|
-
var
|
|
57
|
+
var F = (e) => fe(I(e)), I = (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 ? P(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 ? P(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
|
|
67
|
+
}), L = (e) => de(ue(e)), R = ({ 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: P(e),
|
|
71
|
+
s: P(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
|
|
72
|
+
l: P(i / 2),
|
|
73
|
+
a: P(r, 2)
|
|
74
74
|
};
|
|
75
|
-
},
|
|
76
|
-
let { h: t, s: n, l: r } =
|
|
75
|
+
}, z = (e) => {
|
|
76
|
+
let { h: t, s: n, l: r } = R(e);
|
|
77
77
|
return `hsl(${t}, ${n}%, ${r}%)`;
|
|
78
|
-
},
|
|
78
|
+
}, ue = ({ 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: P([
|
|
83
83
|
n,
|
|
84
84
|
o,
|
|
85
85
|
a,
|
|
@@ -87,7 +87,7 @@ var I = (e) => ue(L(e)), L = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
87
87
|
s,
|
|
88
88
|
n
|
|
89
89
|
][c] * 255),
|
|
90
|
-
g:
|
|
90
|
+
g: P([
|
|
91
91
|
s,
|
|
92
92
|
n,
|
|
93
93
|
n,
|
|
@@ -95,7 +95,7 @@ var I = (e) => ue(L(e)), L = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
95
95
|
a,
|
|
96
96
|
a
|
|
97
97
|
][c] * 255),
|
|
98
|
-
b:
|
|
98
|
+
b: P([
|
|
99
99
|
a,
|
|
100
100
|
a,
|
|
101
101
|
s,
|
|
@@ -103,74 +103,74 @@ var I = (e) => ue(L(e)), L = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
103
103
|
n,
|
|
104
104
|
o
|
|
105
105
|
][c] * 255),
|
|
106
|
-
a:
|
|
106
|
+
a: P(r, 2)
|
|
107
107
|
};
|
|
108
|
-
},
|
|
108
|
+
}, B = (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
|
+
}, de = ({ r: e, g: t, b: n, a: r }) => {
|
|
112
|
+
let i = r < 1 ? B(P(r * 255)) : "";
|
|
113
|
+
return "#" + B(e) + B(t) + B(n) + i;
|
|
114
|
+
}, fe = ({ 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: P(60 * (o < 0 ? o + 6 : o)),
|
|
118
|
+
s: P(i ? a / i * 100 : 0),
|
|
119
|
+
v: P(i / 255 * 100),
|
|
120
120
|
a: r
|
|
121
121
|
};
|
|
122
|
-
},
|
|
122
|
+
}, V = (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
|
+
}, pe = (e, t) => e.toLowerCase() === t.toLowerCase() || V(I(e), I(t)), H = {}, U = (e) => {
|
|
127
|
+
let t = H[e];
|
|
128
|
+
return t || (t = document.createElement("template"), t.innerHTML = e, H[e] = t), t;
|
|
129
|
+
}, W = (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
|
+
}, G = !1, K = (e) => "touches" in e, me = (e) => G && !K(e) ? !1 : (G ||= K(e), !0), q = (e, t) => {
|
|
135
|
+
let n = K(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
|
|
136
|
+
W(e.el, "move", e.getMove({
|
|
137
|
+
x: N((n.pageX - (r.left + window.pageXOffset)) / r.width),
|
|
138
|
+
y: N((n.pageY - (r.top + window.pageYOffset)) / r.height)
|
|
139
139
|
}));
|
|
140
|
-
},
|
|
140
|
+
}, he = (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(), W(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
|
+
}, J = class {
|
|
147
147
|
constructor(e, t, n, r) {
|
|
148
|
-
let i =
|
|
148
|
+
let i = U(`<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(G ? "touchmove" : "mousemove", this), t(G ? "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(), !me(e) || !G && e.button != 0) return;
|
|
162
|
+
this.el.focus(), q(this, e), this.dragging = !0;
|
|
163
163
|
break;
|
|
164
164
|
case "mousemove":
|
|
165
165
|
case "touchmove":
|
|
166
|
-
e.preventDefault(),
|
|
166
|
+
e.preventDefault(), q(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
|
+
he(this, e);
|
|
174
174
|
break;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
@@ -179,25 +179,25 @@ var I = (e) => ue(L(e)), L = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
179
179
|
for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
-
},
|
|
182
|
+
}, ge = class extends J {
|
|
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: z({
|
|
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", `${P(e)}`);
|
|
196
196
|
}
|
|
197
197
|
getMove(e, t) {
|
|
198
|
-
return { h: t ?
|
|
198
|
+
return { h: t ? N(this.h + e.x * 360, 0, 360) : 360 * e.x };
|
|
199
199
|
}
|
|
200
|
-
},
|
|
200
|
+
}, _e = class extends J {
|
|
201
201
|
constructor(e) {
|
|
202
202
|
super(e, "saturation", "aria-label=\"Color\"", !0);
|
|
203
203
|
}
|
|
@@ -205,47 +205,47 @@ var I = (e) => ue(L(e)), L = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
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: z(e)
|
|
209
|
+
}, { "background-color": z({
|
|
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 ${P(e.s)}%, Brightness ${P(e.v)}%`);
|
|
215
215
|
}
|
|
216
216
|
getMove(e, t) {
|
|
217
217
|
return {
|
|
218
|
-
s: t ?
|
|
219
|
-
v: t ?
|
|
218
|
+
s: t ? N(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
|
|
219
|
+
v: t ? N(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
|
-
},
|
|
222
|
+
}, ve = ":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)}", ye = "[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}", be = "[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}", Y = Symbol("same"), X = Symbol("color"), Z = Symbol("hsva"), Q = Symbol("update"), xe = Symbol("parts"), Se = Symbol("css"), $ = Symbol("sliders"), Ce = class extends HTMLElement {
|
|
223
223
|
static get observedAttributes() {
|
|
224
224
|
return ["color"];
|
|
225
225
|
}
|
|
226
|
-
get [
|
|
226
|
+
get [Se]() {
|
|
227
227
|
return [
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
ve,
|
|
229
|
+
ye,
|
|
230
|
+
be
|
|
231
231
|
];
|
|
232
232
|
}
|
|
233
|
-
get [
|
|
234
|
-
return [
|
|
233
|
+
get [$]() {
|
|
234
|
+
return [_e, ge];
|
|
235
235
|
}
|
|
236
236
|
get color() {
|
|
237
|
-
return this[
|
|
237
|
+
return this[X];
|
|
238
238
|
}
|
|
239
239
|
set color(e) {
|
|
240
|
-
if (!this[
|
|
240
|
+
if (!this[Y](e)) {
|
|
241
241
|
let t = this.colorModel.toHsva(e);
|
|
242
|
-
this[
|
|
242
|
+
this[Q](t), this[X] = 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 = U(`<style>${this[Se].join("")}</style>`), t = this.attachShadow({ mode: "open" });
|
|
248
|
+
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[xe] = this[$].map((e) => new e(t));
|
|
249
249
|
}
|
|
250
250
|
connectedCallback() {
|
|
251
251
|
if (this.hasOwnProperty("color")) {
|
|
@@ -255,64 +255,64 @@ var I = (e) => ue(L(e)), L = (e) => (e[0] === "#" && (e = e.substring(1)), e.len
|
|
|
255
255
|
}
|
|
256
256
|
attributeChangedCallback(e, t, n) {
|
|
257
257
|
let r = this.colorModel.fromAttr(n);
|
|
258
|
-
this[
|
|
258
|
+
this[Y](r) || (this.color = r);
|
|
259
259
|
}
|
|
260
260
|
handleEvent(e) {
|
|
261
|
-
let t = this[
|
|
261
|
+
let t = this[Z], n = {
|
|
262
262
|
...t,
|
|
263
263
|
...e.detail
|
|
264
264
|
};
|
|
265
|
-
this[
|
|
265
|
+
this[Q](n);
|
|
266
266
|
let r;
|
|
267
|
-
!
|
|
267
|
+
!V(n, t) && !this[Y](r = this.colorModel.fromHsva(n)) && (this[X] = r, W(this, "color-changed", { value: r }));
|
|
268
268
|
}
|
|
269
|
-
[
|
|
269
|
+
[Y](e) {
|
|
270
270
|
return this.color && this.colorModel.equal(e, this.color);
|
|
271
271
|
}
|
|
272
|
-
[
|
|
273
|
-
this[
|
|
272
|
+
[Q](e) {
|
|
273
|
+
this[Z] = e, this[xe].forEach((t) => t.update(e));
|
|
274
274
|
}
|
|
275
|
-
},
|
|
275
|
+
}, we = {
|
|
276
276
|
defaultColor: "#000",
|
|
277
|
-
toHsva:
|
|
278
|
-
fromHsva: ({ h: e, s: t, v: n }) =>
|
|
277
|
+
toHsva: F,
|
|
278
|
+
fromHsva: ({ h: e, s: t, v: n }) => L({
|
|
279
279
|
h: e,
|
|
280
280
|
s: t,
|
|
281
281
|
v: n,
|
|
282
282
|
a: 1
|
|
283
283
|
}),
|
|
284
|
-
equal:
|
|
284
|
+
equal: pe,
|
|
285
285
|
fromAttr: (e) => e
|
|
286
|
-
},
|
|
286
|
+
}, Te = class extends Ce {
|
|
287
287
|
get colorModel() {
|
|
288
|
-
return
|
|
288
|
+
return we;
|
|
289
289
|
}
|
|
290
290
|
};
|
|
291
|
-
customElements.define("hex-color-picker", class extends
|
|
291
|
+
customElements.define("hex-color-picker", class extends Te {});
|
|
292
292
|
//#endregion
|
|
293
293
|
//#region src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
294
|
-
var
|
|
294
|
+
var Ee = [
|
|
295
295
|
"disabled",
|
|
296
296
|
"aria-label",
|
|
297
297
|
"title",
|
|
298
298
|
"aria-expanded"
|
|
299
|
-
],
|
|
299
|
+
], De = {
|
|
300
300
|
key: 0,
|
|
301
301
|
class: "tpl:relative tpl:flex-1"
|
|
302
|
-
},
|
|
302
|
+
}, Oe = [
|
|
303
303
|
"value",
|
|
304
304
|
"placeholder",
|
|
305
305
|
"disabled",
|
|
306
306
|
"aria-label"
|
|
307
|
-
],
|
|
307
|
+
], ke = ["aria-label", "title"], Ae = ["data-tpl-theme"], je = ["color", "aria-label"], Me = {
|
|
308
308
|
key: 0,
|
|
309
309
|
class: "tpl:relative tpl:mt-2"
|
|
310
|
-
},
|
|
310
|
+
}, Ne = [
|
|
311
311
|
"value",
|
|
312
312
|
"placeholder",
|
|
313
313
|
"disabled",
|
|
314
314
|
"aria-label"
|
|
315
|
-
],
|
|
315
|
+
], Pe = ["aria-label", "title"], Fe = /* @__PURE__ */ p({
|
|
316
316
|
__name: "ColorPicker",
|
|
317
317
|
props: {
|
|
318
318
|
modelValue: {},
|
|
@@ -331,88 +331,88 @@ var Te = [
|
|
|
331
331
|
},
|
|
332
332
|
emits: ["update:modelValue"],
|
|
333
333
|
setup(p, { emit: _ }) {
|
|
334
|
-
let v = p, y = _, { t: b } =
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}, { ignore: [
|
|
338
|
-
let
|
|
339
|
-
function
|
|
340
|
-
|
|
334
|
+
let v = p, y = _, { t: b } = re(), x = r(!1), S = r(), C = r(), w = r(!1);
|
|
335
|
+
ce(S, () => {
|
|
336
|
+
x.value = !1;
|
|
337
|
+
}, { ignore: [C] });
|
|
338
|
+
let T = o(() => !v.modelValue), E = o(() => h(v.modelValue)), D = o(() => h(v.modelValue || v.seedColor)), O = o(() => !v.disabled && !T.value);
|
|
339
|
+
function k(e) {
|
|
340
|
+
w.value = !0, y("update:modelValue", e.detail.value);
|
|
341
341
|
}
|
|
342
|
-
function
|
|
343
|
-
|
|
342
|
+
function A() {
|
|
343
|
+
w.value = !1;
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
!
|
|
345
|
+
function j() {
|
|
346
|
+
!w.value && T.value && y("update:modelValue", D.value);
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function M(e) {
|
|
349
349
|
y("update:modelValue", e.target.value);
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function N() {
|
|
352
352
|
y("update:modelValue", "");
|
|
353
353
|
}
|
|
354
|
-
let F = ae(), I = t(
|
|
354
|
+
let P = ie(), { toLocal: F } = ae(), I = t(se, null), L = t(oe, null), R = r({
|
|
355
355
|
top: 0,
|
|
356
356
|
left: 0
|
|
357
357
|
});
|
|
358
358
|
function z() {
|
|
359
359
|
if (!v.disabled) {
|
|
360
|
-
if (!
|
|
361
|
-
let e =
|
|
360
|
+
if (!x.value) {
|
|
361
|
+
let e = C.value?.getBoundingClientRect();
|
|
362
362
|
if (e) {
|
|
363
|
-
let t = e.bottom + 8 + 240 <= window.innerHeight;
|
|
364
|
-
R.value = {
|
|
365
|
-
top: t
|
|
363
|
+
let t = e.bottom + 8 + 240 <= window.innerHeight ? e.bottom + 8 : Math.max(8, e.top - 240 - 8);
|
|
364
|
+
R.value = F({
|
|
365
|
+
top: t,
|
|
366
366
|
left: e.left
|
|
367
|
-
};
|
|
367
|
+
});
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
|
|
370
|
+
x.value = !x.value;
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
373
|
return (t, r) => (e(), s("div", { class: u(["tpl:flex tpl:items-center tpl:gap-2 tpl:relative", p.disabled && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
|
|
374
374
|
d("button", {
|
|
375
375
|
ref_key: "swatchRef",
|
|
376
|
-
ref:
|
|
376
|
+
ref: C,
|
|
377
377
|
type: "button",
|
|
378
378
|
disabled: p.disabled,
|
|
379
379
|
"aria-label": p.ariaLabel || l(b).colorPicker.pickColor,
|
|
380
380
|
title: p.ariaLabel || void 0,
|
|
381
|
-
"aria-expanded":
|
|
381
|
+
"aria-expanded": x.value,
|
|
382
382
|
class: u([
|
|
383
383
|
"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)]",
|
|
384
384
|
p.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
|
|
385
|
-
|
|
385
|
+
x.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !p.disabled && "hover:tpl:border-[var(--tpl-text-dim)]",
|
|
386
386
|
p.size === "sm" ? "tpl:size-8" : "tpl:size-10"
|
|
387
387
|
]),
|
|
388
388
|
onClick: z
|
|
389
389
|
}, [d("span", {
|
|
390
|
-
class: u(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", { "tpl-color-swatch-empty":
|
|
391
|
-
style: f(
|
|
392
|
-
}, null, 6)], 10,
|
|
393
|
-
p.swatchOnly ? c("", !0) : (e(), s("div",
|
|
390
|
+
class: u(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", { "tpl-color-swatch-empty": T.value }]),
|
|
391
|
+
style: f(T.value ? void 0 : { backgroundColor: E.value })
|
|
392
|
+
}, null, 6)], 10, Ee),
|
|
393
|
+
p.swatchOnly ? c("", !0) : (e(), s("div", De, [d("input", {
|
|
394
394
|
type: "text",
|
|
395
|
-
class: u([l(
|
|
396
|
-
style: f(
|
|
397
|
-
value:
|
|
395
|
+
class: u([l(le), "tpl:w-full"]),
|
|
396
|
+
style: f(O.value ? { paddingRight: "2.25rem" } : void 0),
|
|
397
|
+
value: E.value,
|
|
398
398
|
placeholder: p.placeholder || l(b).colorPicker.notSet,
|
|
399
399
|
disabled: p.disabled,
|
|
400
400
|
"aria-label": l(b).colorPicker.hexValue,
|
|
401
|
-
onInput:
|
|
402
|
-
}, null, 46,
|
|
401
|
+
onInput: M
|
|
402
|
+
}, null, 46, Oe), O.value ? (e(), s("button", {
|
|
403
403
|
key: 0,
|
|
404
404
|
type: "button",
|
|
405
405
|
"aria-label": l(b).colorPicker.clear,
|
|
406
406
|
title: l(b).colorPicker.clear,
|
|
407
407
|
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)]",
|
|
408
|
-
onClick:
|
|
408
|
+
onClick: N
|
|
409
409
|
}, [m(l(g), {
|
|
410
410
|
size: 14,
|
|
411
411
|
"stroke-width": 1.5
|
|
412
|
-
})], 8,
|
|
412
|
+
})], 8, ke)) : c("", !0)])),
|
|
413
413
|
(e(), te(a, {
|
|
414
|
-
to: l(
|
|
415
|
-
disabled: !l(
|
|
414
|
+
to: l(P),
|
|
415
|
+
disabled: !l(P)
|
|
416
416
|
}, [m(ne, {
|
|
417
417
|
"enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
418
418
|
"enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
|
|
@@ -421,51 +421,51 @@ var Te = [
|
|
|
421
421
|
"leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
422
422
|
"leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
|
|
423
423
|
}, {
|
|
424
|
-
default: n(() => [
|
|
424
|
+
default: n(() => [x.value ? (e(), s("div", {
|
|
425
425
|
key: 0,
|
|
426
426
|
ref_key: "popoverRef",
|
|
427
|
-
ref:
|
|
427
|
+
ref: S,
|
|
428
428
|
"data-tpl-theme": l(L),
|
|
429
|
-
class: "tpl-color-popover tpl:
|
|
429
|
+
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",
|
|
430
430
|
style: f({
|
|
431
431
|
top: `${R.value.top}px`,
|
|
432
432
|
left: `${R.value.left}px`,
|
|
433
433
|
...l(I)
|
|
434
434
|
})
|
|
435
435
|
}, [d("hex-color-picker", {
|
|
436
|
-
color:
|
|
436
|
+
color: D.value,
|
|
437
437
|
"aria-label": l(b).colorPicker.pickColor,
|
|
438
|
-
onColorChanged:
|
|
439
|
-
onPointerdown:
|
|
440
|
-
onPointerup:
|
|
441
|
-
onKeydown: r[0] ||= i((e) =>
|
|
442
|
-
}, null, 40,
|
|
438
|
+
onColorChanged: k,
|
|
439
|
+
onPointerdown: A,
|
|
440
|
+
onPointerup: j,
|
|
441
|
+
onKeydown: r[0] ||= i((e) => x.value = !1, ["escape"])
|
|
442
|
+
}, null, 40, je), p.swatchOnly ? (e(), s("div", Me, [d("input", {
|
|
443
443
|
type: "text",
|
|
444
|
-
class: u([l(
|
|
445
|
-
style: f(
|
|
446
|
-
value:
|
|
444
|
+
class: u([l(le), "tpl:w-full"]),
|
|
445
|
+
style: f(O.value ? { paddingRight: "2.25rem" } : void 0),
|
|
446
|
+
value: E.value,
|
|
447
447
|
placeholder: p.placeholder || l(b).colorPicker.notSet,
|
|
448
448
|
disabled: p.disabled,
|
|
449
449
|
"aria-label": l(b).colorPicker.hexValue,
|
|
450
|
-
onChange:
|
|
450
|
+
onChange: M,
|
|
451
451
|
onKeydown: r[1] ||= i(ee((e) => e.target.blur(), ["prevent"]), ["enter"])
|
|
452
|
-
}, null, 46,
|
|
452
|
+
}, null, 46, Ne), O.value ? (e(), s("button", {
|
|
453
453
|
key: 0,
|
|
454
454
|
type: "button",
|
|
455
455
|
"aria-label": l(b).colorPicker.clear,
|
|
456
456
|
title: l(b).colorPicker.clear,
|
|
457
457
|
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)]",
|
|
458
|
-
onClick:
|
|
458
|
+
onClick: N
|
|
459
459
|
}, [m(l(g), {
|
|
460
460
|
size: 14,
|
|
461
461
|
"stroke-width": 1.5
|
|
462
|
-
})], 8,
|
|
462
|
+
})], 8, Pe)) : c("", !0)])) : c("", !0)], 12, Ae)) : c("", !0)]),
|
|
463
463
|
_: 1
|
|
464
464
|
})], 8, ["to", "disabled"]))
|
|
465
465
|
], 2));
|
|
466
466
|
}
|
|
467
467
|
});
|
|
468
468
|
//#endregion
|
|
469
|
-
export {
|
|
469
|
+
export { S as _, k as a, D as c, T as d, v as f, w as g, _ as h, M as i, C as l, b as m, A as n, E as o, y as p, j as r, O as s, Fe as t, x as u };
|
|
470
470
|
|
|
471
|
-
//# sourceMappingURL=ColorPicker-
|
|
471
|
+
//# sourceMappingURL=ColorPicker-CPMWLHpa.js.map
|