@templatical/editor 0.18.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-BWIzNePR.js → AiChatSidebar-ChrE6pUq.js} +10 -10
- package/dist/{AiFeatureMenu-IoLW8c6m.js → AiFeatureMenu-DkQ9HhQ6.js} +7 -7
- package/dist/{BlockIssueBadge-FbyZBJlf.js → BlockIssueBadge-B4QjePax.js} +4 -4
- package/dist/{CloudEditor-txLsdvcR.js → CloudEditor-CfX-aMiV.js} +24 -22
- package/dist/{CollaboratorBar-CpLOFt43.js → CollaboratorBar-DTibhQ1j.js} +3 -3
- package/dist/ColorPicker-4vDYhdGe.js +552 -0
- package/dist/{CommentsSidebar-C8xFu9qy.js → CommentsSidebar-D-o5Stlg.js} +12 -12
- package/dist/{CountdownBlock-CaU40Htk.js → CountdownBlock-Bn5w7C-p.js} +1 -1
- package/dist/{CountdownToolbar-CBbGAxmF.js → CountdownToolbar-D7yQqnA2.js} +3 -3
- package/dist/{DesignReferenceSidebar-BWZgqmT-.js → DesignReferenceSidebar-DnO6ZdwS.js} +10 -10
- package/dist/{IssuesPanel-CBzfmzRM.js → IssuesPanel-X_vkNGrs.js} +7 -7
- package/dist/{ModuleBrowserModal-C9qHpjaS.js → ModuleBrowserModal-AJt--JPh.js} +9 -9
- package/dist/{ModulePreviewCanvas-xEMWMJwf.js → ModulePreviewCanvas-BKYOcVCh.js} +2 -2
- package/dist/{NumberWithSuffix-BreqtON_.js → NumberWithSuffix-Bf3rNxza.js} +1 -1
- package/dist/{ParagraphEditor-iRJI_YbA.js → ParagraphEditor-C5ixOIYb.js} +46 -46
- package/dist/{RichTextEditorContent-DkXai9qP.js → RichTextEditorContent-DwhDnMsG.js} +7 -7
- package/dist/{SaveModuleDialog-DqDmk0rO.js → SaveModuleDialog-B4QX9eiv.js} +7 -7
- package/dist/{SnapshotHistory-BVe5aCHi.js → SnapshotHistory-DaVueFv6.js} +8 -8
- package/dist/{TemplateScoringPanel-CRqt9-T5.js → TemplateScoringPanel-B0UHoTLx.js} +77 -77
- package/dist/{TestEmailModal-jpy4hnYZ.js → TestEmailModal-BkauxF7j.js} +4 -4
- package/dist/{TitleEditor-Bf6Jv2qI.js → TitleEditor-n6WDVDjW.js} +9 -9
- package/dist/{TplModal-DAtccv6o.js → TplModal-BDDyvT-C.js} +3 -3
- package/dist/{blockTypeIcons-CnlwyvkL.js → blockTypeIcons-4D0aFXNg.js} +2 -2
- package/dist/bundle-stats.json +6 -6
- package/dist/{ca-CSl--oWR.js → ca-DbWoy4rG.js} +2 -1
- package/dist/cdn/chunks/{AiFeatureMenu-B4oJlFQI.js → AiFeatureMenu-CIBHAGSz.js} +5 -5
- package/dist/cdn/chunks/{AiFeatureMenu-B4oJlFQI.js.map → AiFeatureMenu-CIBHAGSz.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-C7Ts7bT7.js → BlockIssueBadge-CxMiLo3p.js} +4 -4
- package/dist/cdn/chunks/{BlockIssueBadge-C7Ts7bT7.js.map → BlockIssueBadge-CxMiLo3p.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-BRO-2CcF.js → CloudEditor-CEa3Xgqh.js} +133 -131
- package/dist/cdn/chunks/CloudEditor-CEa3Xgqh.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-BsWOjOCS.js → CollaboratorBar-Bk1gD02G.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-BsWOjOCS.js.map → CollaboratorBar-Bk1gD02G.js.map} +1 -1
- package/dist/cdn/chunks/ColorPicker-ll8pynws.js +550 -0
- package/dist/cdn/chunks/ColorPicker-ll8pynws.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-BUGxk8GI.js → CountdownBlock-eGUE7hhw.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-BUGxk8GI.js.map → CountdownBlock-eGUE7hhw.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-C8tWWfGw.js → CountdownToolbar-C1bkSjUR.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-C8tWWfGw.js.map → CountdownToolbar-C1bkSjUR.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-C5izyrbm.js → IssuesPanel-Csasylf_.js} +7 -7
- package/dist/cdn/chunks/{IssuesPanel-C5izyrbm.js.map → IssuesPanel-Csasylf_.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-DySKXKFF.js → ModuleBrowserModal-DznWWtBI.js} +8 -8
- package/dist/cdn/chunks/{ModuleBrowserModal-DySKXKFF.js.map → ModuleBrowserModal-DznWWtBI.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-qqEvLBp2.js → ModulePreviewCanvas-D-h7fr87.js} +8 -8
- package/dist/cdn/chunks/{ModulePreviewCanvas-qqEvLBp2.js.map → ModulePreviewCanvas-D-h7fr87.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-DttdbXsh.js → NumberWithSuffix-Dt-0odUN.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-DttdbXsh.js.map → NumberWithSuffix-Dt-0odUN.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-CQJ23PXU.js → ParagraphEditor-v0_XEL-v.js} +110 -110
- package/dist/cdn/chunks/{ParagraphEditor-CQJ23PXU.js.map → ParagraphEditor-v0_XEL-v.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-C4vxiXng.js → RichTextEditorContent-NQExNsaV.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-C4vxiXng.js.map → RichTextEditorContent-NQExNsaV.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-D5eddgzd.js → SaveModuleDialog-BpFhTi-k.js} +5 -5
- package/dist/cdn/chunks/{SaveModuleDialog-D5eddgzd.js.map → SaveModuleDialog-BpFhTi-k.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-5TkwDrPL.js → TitleEditor-CS-_MzYs.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-5TkwDrPL.js.map → TitleEditor-CS-_MzYs.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-CbmN4aSw.js → blockTypeIcons-B0Hjh42a.js} +7 -7
- package/dist/cdn/chunks/{blockTypeIcons-CbmN4aSw.js.map → blockTypeIcons-B0Hjh42a.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/{de-ZaffrKDP.js → cdn/chunks/de-CgGOnerg.js} +4 -1
- 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-B3M4IqhZ.js → extensions-Di3hdIRT.js} +25 -25
- package/dist/cdn/chunks/{extensions-B3M4IqhZ.js.map → extensions-Di3hdIRT.js.map} +1 -1
- package/dist/cdn/chunks/{features-HBwOEo4D.js → features-CLIZ7Q-Y.js} +1129 -1002
- package/dist/cdn/chunks/features-CLIZ7Q-Y.js.map +1 -0
- package/dist/cdn/chunks/{icons-D4vTsN4p.js → icons-GX40Qm2W.js} +2 -2
- package/dist/cdn/chunks/{icons-D4vTsN4p.js.map → icons-GX40Qm2W.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-CfExuiSG.js → media-library-yYAkAagU.js} +537 -537
- package/dist/cdn/chunks/{media-library-CfExuiSG.js.map → media-library-yYAkAagU.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/{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-nh1R42eb.js.map → quality-DffYv9j5.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-BLvlUayY.js → renderer-DpBGiXOg.js} +16 -16
- package/dist/cdn/chunks/{renderer-BLvlUayY.js.map → renderer-DpBGiXOg.js.map} +1 -1
- package/dist/cdn/chunks/{src-Cks4RrLL.js → src-9K6uFiuK.js} +6 -6
- package/dist/cdn/chunks/{src-Cks4RrLL.js.map → src-9K6uFiuK.js.map} +1 -1
- package/dist/cdn/chunks/{styles-CPCN13az.js → styles-DHSmjlpX.js} +820 -816
- package/dist/cdn/chunks/styles-DHSmjlpX.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +54 -52
- package/dist/cdn/editor.js.map +1 -1
- 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/{cloud-BogxOeZu.js → cloud-B-RebwxI.js} +5 -5
- package/dist/{createLucideIcon-FSF4peHQ.js → createLucideIcon-_peTZQtY.js} +2 -2
- package/dist/{cdn/chunks/de-ZaffrKDP.js → de-CgGOnerg.js} +2 -3
- 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-gpFdCinj.js → extensions-BCA9pyer.js} +11 -11
- package/dist/{image-up-CDEgJqwA.js → image-up-D26rNdfX.js} +1 -1
- package/dist/index.d.ts +31 -0
- package/dist/{info-BNP8yGsK.js → info-CE3JSTqk.js} +1 -1
- package/dist/keys-DFaIbGR8.js +10 -0
- 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/{pt-BR-C74zfEWH.js → pt-BR-Bcc5Tjed.js} +2 -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/style.css +1 -1
- package/dist/{styles-CJ6WmkYL.js → styles-DkF_-uX8.js} +677 -673
- package/dist/templatical-editor.js +14 -12
- 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/{useCloudI18n-DIn74fK2.js → useCloudI18n-PCDOC2kz.js} +1 -1
- package/dist/{useEditorCore-LJJNXXqC.js → useEditorCore-kKUemYY6.js} +1047 -961
- package/dist/{useI18n-OaMLWqhY.js → useI18n-BNMzZTM5.js} +1 -1
- package/dist/{useMergeTag-CZMgwVvr.js → useMergeTag-DfEY0eK5.js} +5 -5
- package/dist/{usePopoverPosition-QDY09q9H.js → usePopoverPosition-F9STHRIr.js} +33 -6
- package/dist/{x-Ctg_250T.js → x-BCFQuE_q.js} +1 -1
- package/package.json +10 -10
- package/dist/ColorPicker-BXCcUYsZ.js +0 -473
- package/dist/cdn/chunks/CloudEditor-BRO-2CcF.js.map +0 -1
- package/dist/cdn/chunks/ColorPicker-DEtVX4gN.js +0 -471
- package/dist/cdn/chunks/ColorPicker-DEtVX4gN.js.map +0 -1
- package/dist/cdn/chunks/features-HBwOEo4D.js.map +0 -1
- package/dist/cdn/chunks/pusher-CIwiKF8H.js.map +0 -1
- package/dist/cdn/chunks/quality-nh1R42eb.js +0 -2180
- package/dist/cdn/chunks/styles-CPCN13az.js.map +0 -1
- package/dist/keys-DAxnnmXs.js +0 -10
|
@@ -0,0 +1,550 @@
|
|
|
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 { 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
|
+
//#region src/constants/styleConstants.ts
|
|
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
|
+
"10px",
|
|
6
|
+
"12px",
|
|
7
|
+
"14px",
|
|
8
|
+
"16px",
|
|
9
|
+
"18px",
|
|
10
|
+
"20px",
|
|
11
|
+
"24px",
|
|
12
|
+
"28px",
|
|
13
|
+
"32px",
|
|
14
|
+
"36px",
|
|
15
|
+
"48px",
|
|
16
|
+
"64px"
|
|
17
|
+
], k = [
|
|
18
|
+
"1",
|
|
19
|
+
"1.2",
|
|
20
|
+
"1.4",
|
|
21
|
+
"1.5",
|
|
22
|
+
"1.6",
|
|
23
|
+
"1.8",
|
|
24
|
+
"2",
|
|
25
|
+
"2.5"
|
|
26
|
+
], A = [
|
|
27
|
+
{
|
|
28
|
+
label: "Normal",
|
|
29
|
+
value: "normal"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: "-0.5px",
|
|
33
|
+
value: "-0.5px"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: "0.5px",
|
|
37
|
+
value: "0.5px"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: "1px",
|
|
41
|
+
value: "1px"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: "1.5px",
|
|
45
|
+
value: "1.5px"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: "2px",
|
|
49
|
+
value: "2px"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: "3px",
|
|
53
|
+
value: "3px"
|
|
54
|
+
}
|
|
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
|
+
360 / (Math.PI * 2);
|
|
57
|
+
var L = (e) => he(R(e)), R = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
|
|
58
|
+
r: parseInt(e[0] + e[0], 16),
|
|
59
|
+
g: parseInt(e[1] + e[1], 16),
|
|
60
|
+
b: parseInt(e[2] + e[2], 16),
|
|
61
|
+
a: e.length === 4 ? I(parseInt(e[3] + e[3], 16) / 255, 2) : 1
|
|
62
|
+
} : {
|
|
63
|
+
r: parseInt(e.substring(0, 2), 16),
|
|
64
|
+
g: parseInt(e.substring(2, 4), 16),
|
|
65
|
+
b: parseInt(e.substring(4, 6), 16),
|
|
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
|
+
let i = (200 - t) * n / 100;
|
|
69
|
+
return {
|
|
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
|
+
};
|
|
75
|
+
}, V = (e) => {
|
|
76
|
+
let { h: t, s: n, l: r } = B(e);
|
|
77
|
+
return `hsl(${t}, ${n}%, ${r}%)`;
|
|
78
|
+
}, pe = ({ h: e, s: t, v: n, a: r }) => {
|
|
79
|
+
e = e / 360 * 6, t /= 100, n /= 100;
|
|
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
|
+
return {
|
|
82
|
+
r: I([
|
|
83
|
+
n,
|
|
84
|
+
o,
|
|
85
|
+
a,
|
|
86
|
+
a,
|
|
87
|
+
s,
|
|
88
|
+
n
|
|
89
|
+
][c] * 255),
|
|
90
|
+
g: I([
|
|
91
|
+
s,
|
|
92
|
+
n,
|
|
93
|
+
n,
|
|
94
|
+
o,
|
|
95
|
+
a,
|
|
96
|
+
a
|
|
97
|
+
][c] * 255),
|
|
98
|
+
b: I([
|
|
99
|
+
a,
|
|
100
|
+
a,
|
|
101
|
+
s,
|
|
102
|
+
n,
|
|
103
|
+
n,
|
|
104
|
+
o
|
|
105
|
+
][c] * 255),
|
|
106
|
+
a: I(r, 2)
|
|
107
|
+
};
|
|
108
|
+
}, H = (e) => {
|
|
109
|
+
let t = e.toString(16);
|
|
110
|
+
return t.length < 2 ? "0" + t : t;
|
|
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
|
+
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
|
+
return {
|
|
117
|
+
h: I(60 * (o < 0 ? o + 6 : o)),
|
|
118
|
+
s: I(i ? a / i * 100 : 0),
|
|
119
|
+
v: I(i / 255 * 100),
|
|
120
|
+
a: r
|
|
121
|
+
};
|
|
122
|
+
}, U = (e, t) => {
|
|
123
|
+
if (e === t) return !0;
|
|
124
|
+
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
125
|
+
return !0;
|
|
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
|
+
e.dispatchEvent(new CustomEvent(t, {
|
|
131
|
+
bubbles: !0,
|
|
132
|
+
detail: n
|
|
133
|
+
}));
|
|
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
|
+
}));
|
|
140
|
+
}, _e = (e, t) => {
|
|
141
|
+
let n = t.keyCode;
|
|
142
|
+
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), q(e.el, "move", e.getMove({
|
|
143
|
+
x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
|
|
144
|
+
y: n === 40 ? .01 : n === 38 ? -.01 : 0
|
|
145
|
+
}, !0)));
|
|
146
|
+
}, ve = class {
|
|
147
|
+
constructor(e, t, n, r) {
|
|
148
|
+
let i = K(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
|
|
149
|
+
e.appendChild(i.content.cloneNode(!0));
|
|
150
|
+
let a = e.querySelector(`[part=${t}]`);
|
|
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
|
+
}
|
|
153
|
+
set dragging(e) {
|
|
154
|
+
let t = e ? document.addEventListener : document.removeEventListener;
|
|
155
|
+
t(J ? "touchmove" : "mousemove", this), t(J ? "touchend" : "mouseup", this);
|
|
156
|
+
}
|
|
157
|
+
handleEvent(e) {
|
|
158
|
+
switch (e.type) {
|
|
159
|
+
case "mousedown":
|
|
160
|
+
case "touchstart":
|
|
161
|
+
if (e.preventDefault(), !ge(e) || !J && e.button != 0) return;
|
|
162
|
+
this.el.focus(), X(this, e), this.dragging = !0;
|
|
163
|
+
break;
|
|
164
|
+
case "mousemove":
|
|
165
|
+
case "touchmove":
|
|
166
|
+
e.preventDefault(), X(this, e);
|
|
167
|
+
break;
|
|
168
|
+
case "mouseup":
|
|
169
|
+
case "touchend":
|
|
170
|
+
this.dragging = !1;
|
|
171
|
+
break;
|
|
172
|
+
case "keydown":
|
|
173
|
+
_e(this, e);
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
style(e) {
|
|
178
|
+
e.forEach((e, t) => {
|
|
179
|
+
for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}, ye = class extends ve {
|
|
183
|
+
constructor(e) {
|
|
184
|
+
super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
|
|
185
|
+
}
|
|
186
|
+
update({ h: e }) {
|
|
187
|
+
this.h = e, this.style([{
|
|
188
|
+
left: `${e / 360 * 100}%`,
|
|
189
|
+
color: V({
|
|
190
|
+
h: e,
|
|
191
|
+
s: 100,
|
|
192
|
+
v: 100,
|
|
193
|
+
a: 1
|
|
194
|
+
})
|
|
195
|
+
}]), this.el.setAttribute("aria-valuenow", `${I(e)}`);
|
|
196
|
+
}
|
|
197
|
+
getMove(e, t) {
|
|
198
|
+
return { h: t ? F(this.h + e.x * 360, 0, 360) : 360 * e.x };
|
|
199
|
+
}
|
|
200
|
+
}, be = class extends ve {
|
|
201
|
+
constructor(e) {
|
|
202
|
+
super(e, "saturation", "aria-label=\"Color\"", !0);
|
|
203
|
+
}
|
|
204
|
+
update(e) {
|
|
205
|
+
this.hsva = e, this.style([{
|
|
206
|
+
top: `${100 - e.v}%`,
|
|
207
|
+
left: `${e.s}%`,
|
|
208
|
+
color: V(e)
|
|
209
|
+
}, { "background-color": V({
|
|
210
|
+
h: e.h,
|
|
211
|
+
s: 100,
|
|
212
|
+
v: 100,
|
|
213
|
+
a: 1
|
|
214
|
+
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${I(e.s)}%, Brightness ${I(e.v)}%`);
|
|
215
|
+
}
|
|
216
|
+
getMove(e, t) {
|
|
217
|
+
return {
|
|
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
|
+
};
|
|
221
|
+
}
|
|
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
|
+
static get observedAttributes() {
|
|
224
|
+
return ["color"];
|
|
225
|
+
}
|
|
226
|
+
get [Ee]() {
|
|
227
|
+
return [
|
|
228
|
+
xe,
|
|
229
|
+
Se,
|
|
230
|
+
Ce
|
|
231
|
+
];
|
|
232
|
+
}
|
|
233
|
+
get [De]() {
|
|
234
|
+
return [be, ye];
|
|
235
|
+
}
|
|
236
|
+
get color() {
|
|
237
|
+
return this[Q];
|
|
238
|
+
}
|
|
239
|
+
set color(e) {
|
|
240
|
+
if (!this[Z](e)) {
|
|
241
|
+
let t = this.colorModel.toHsva(e);
|
|
242
|
+
this[$](t), this[Q] = e;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
constructor() {
|
|
246
|
+
super();
|
|
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
|
+
}
|
|
250
|
+
connectedCallback() {
|
|
251
|
+
if (this.hasOwnProperty("color")) {
|
|
252
|
+
let e = this.color;
|
|
253
|
+
delete this.color, this.color = e;
|
|
254
|
+
} else this.color ||= this.colorModel.defaultColor;
|
|
255
|
+
}
|
|
256
|
+
attributeChangedCallback(e, t, n) {
|
|
257
|
+
let r = this.colorModel.fromAttr(n);
|
|
258
|
+
this[Z](r) || (this.color = r);
|
|
259
|
+
}
|
|
260
|
+
handleEvent(e) {
|
|
261
|
+
let t = this[we], n = {
|
|
262
|
+
...t,
|
|
263
|
+
...e.detail
|
|
264
|
+
};
|
|
265
|
+
this[$](n);
|
|
266
|
+
let r;
|
|
267
|
+
!U(n, t) && !this[Z](r = this.colorModel.fromHsva(n)) && (this[Q] = r, q(this, "color-changed", { value: r }));
|
|
268
|
+
}
|
|
269
|
+
[Z](e) {
|
|
270
|
+
return this.color && this.colorModel.equal(e, this.color);
|
|
271
|
+
}
|
|
272
|
+
[$](e) {
|
|
273
|
+
this[we] = e, this[Te].forEach((t) => t.update(e));
|
|
274
|
+
}
|
|
275
|
+
}, ke = {
|
|
276
|
+
defaultColor: "#000",
|
|
277
|
+
toHsva: L,
|
|
278
|
+
fromHsva: ({ h: e, s: t, v: n }) => z({
|
|
279
|
+
h: e,
|
|
280
|
+
s: t,
|
|
281
|
+
v: n,
|
|
282
|
+
a: 1
|
|
283
|
+
}),
|
|
284
|
+
equal: W,
|
|
285
|
+
fromAttr: (e) => e
|
|
286
|
+
}, Ae = class extends Oe {
|
|
287
|
+
get colorModel() {
|
|
288
|
+
return ke;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
customElements.define("hex-color-picker", class extends Ae {});
|
|
292
|
+
//#endregion
|
|
293
|
+
//#region src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
294
|
+
var je = [
|
|
295
|
+
"disabled",
|
|
296
|
+
"aria-label",
|
|
297
|
+
"title",
|
|
298
|
+
"aria-expanded"
|
|
299
|
+
], Me = {
|
|
300
|
+
key: 0,
|
|
301
|
+
class: "tpl:relative tpl:flex-1"
|
|
302
|
+
}, Ne = [
|
|
303
|
+
"value",
|
|
304
|
+
"placeholder",
|
|
305
|
+
"disabled",
|
|
306
|
+
"aria-label"
|
|
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,
|
|
320
|
+
class: "tpl:relative tpl:mt-2"
|
|
321
|
+
}, Ve = [
|
|
322
|
+
"value",
|
|
323
|
+
"placeholder",
|
|
324
|
+
"disabled",
|
|
325
|
+
"aria-label"
|
|
326
|
+
], He = ["aria-label", "title"], Ue = /* @__PURE__ */ m({
|
|
327
|
+
__name: "ColorPicker",
|
|
328
|
+
props: {
|
|
329
|
+
modelValue: {},
|
|
330
|
+
placeholder: { default: "" },
|
|
331
|
+
seedColor: { default: "#ffffff" },
|
|
332
|
+
swatchOnly: {
|
|
333
|
+
type: Boolean,
|
|
334
|
+
default: !1
|
|
335
|
+
},
|
|
336
|
+
disabled: {
|
|
337
|
+
type: Boolean,
|
|
338
|
+
default: !1
|
|
339
|
+
},
|
|
340
|
+
size: { default: "md" },
|
|
341
|
+
ariaLabel: { default: "" },
|
|
342
|
+
presets: { default: void 0 },
|
|
343
|
+
allowCustom: {
|
|
344
|
+
type: Boolean,
|
|
345
|
+
default: void 0
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
emits: ["update:modelValue"],
|
|
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;
|
|
357
|
+
}
|
|
358
|
+
function R(e) {
|
|
359
|
+
b("update:modelValue", e);
|
|
360
|
+
}
|
|
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
|
+
});
|
|
370
|
+
function pe() {
|
|
371
|
+
return V.value === 0 ? 0 : -1;
|
|
372
|
+
}
|
|
373
|
+
function H(e) {
|
|
374
|
+
return B(e) === V.value ? 0 : -1;
|
|
375
|
+
}
|
|
376
|
+
function me(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 he(e) {
|
|
387
|
+
E.value = !0, b("update:modelValue", e.detail.value);
|
|
388
|
+
}
|
|
389
|
+
function U() {
|
|
390
|
+
E.value = !1;
|
|
391
|
+
}
|
|
392
|
+
function W() {
|
|
393
|
+
!E.value && D.value && b("update:modelValue", k.value);
|
|
394
|
+
}
|
|
395
|
+
function G(e) {
|
|
396
|
+
b("update:modelValue", e.target.value);
|
|
397
|
+
}
|
|
398
|
+
function K() {
|
|
399
|
+
b("update:modelValue", "");
|
|
400
|
+
}
|
|
401
|
+
let q = ae(), { toLocal: J } = se(), Y = n(fe, null), ge = n(ue, null), X = i({
|
|
402
|
+
top: 0,
|
|
403
|
+
left: 0
|
|
404
|
+
});
|
|
405
|
+
function _e() {
|
|
406
|
+
if (!y.disabled) {
|
|
407
|
+
if (!C.value) {
|
|
408
|
+
let e = T.value?.getBoundingClientRect();
|
|
409
|
+
if (e) {
|
|
410
|
+
let t = e.bottom + 8 + 240 <= window.innerHeight ? e.bottom + 8 : Math.max(8, e.top - 240 - 8);
|
|
411
|
+
X.value = J({
|
|
412
|
+
top: t,
|
|
413
|
+
left: e.left
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
C.value = !C.value;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
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", {
|
|
422
|
+
ref_key: "swatchRef",
|
|
423
|
+
ref: T,
|
|
424
|
+
type: "button",
|
|
425
|
+
disabled: m.disabled,
|
|
426
|
+
"aria-label": m.ariaLabel || u(x).colorPicker.pickColor,
|
|
427
|
+
title: m.ariaLabel || void 0,
|
|
428
|
+
"aria-expanded": C.value,
|
|
429
|
+
class: d([
|
|
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
|
+
m.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
|
|
432
|
+
C.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"
|
|
434
|
+
]),
|
|
435
|
+
onClick: _e
|
|
436
|
+
}, [f("span", {
|
|
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
|
+
}, null, 6)], 10, je),
|
|
440
|
+
!m.swatchOnly && F.value ? (e(), c("div", Me, [f("input", {
|
|
441
|
+
type: "text",
|
|
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
|
+
disabled: m.disabled,
|
|
447
|
+
"aria-label": u(x).colorPicker.hexValue,
|
|
448
|
+
onInput: G
|
|
449
|
+
}, null, 46, Ne), A.value ? (e(), c("button", {
|
|
450
|
+
key: 0,
|
|
451
|
+
type: "button",
|
|
452
|
+
"aria-label": u(x).colorPicker.clear,
|
|
453
|
+
title: u(x).colorPicker.clear,
|
|
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: K
|
|
456
|
+
}, [h(u(de), {
|
|
457
|
+
size: 14,
|
|
458
|
+
"stroke-width": 1.5
|
|
459
|
+
})], 8, Pe)) : l("", !0)])) : l("", !0),
|
|
460
|
+
(e(), te(o, {
|
|
461
|
+
to: u(q),
|
|
462
|
+
disabled: !u(q)
|
|
463
|
+
}, [h(ne, {
|
|
464
|
+
"enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
465
|
+
"enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
|
|
466
|
+
"enter-to-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
467
|
+
"leave-active-class": "tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
468
|
+
"leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
469
|
+
"leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
|
|
470
|
+
}, {
|
|
471
|
+
default: r(() => [C.value ? (e(), c("div", {
|
|
472
|
+
key: 0,
|
|
473
|
+
ref_key: "popoverRef",
|
|
474
|
+
ref: w,
|
|
475
|
+
"data-tpl-theme": u(ge),
|
|
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
|
+
style: p({
|
|
478
|
+
top: `${X.value.top}px`,
|
|
479
|
+
left: `${X.value.left}px`,
|
|
480
|
+
...u(Y)
|
|
481
|
+
})
|
|
482
|
+
}, [
|
|
483
|
+
P.value ? (e(), c("div", {
|
|
484
|
+
key: 0,
|
|
485
|
+
role: "radiogroup",
|
|
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
|
+
key: 0,
|
|
491
|
+
type: "button",
|
|
492
|
+
role: "radio",
|
|
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
|
+
key: t,
|
|
501
|
+
type: "button",
|
|
502
|
+
role: "radio",
|
|
503
|
+
"aria-label": t,
|
|
504
|
+
title: t,
|
|
505
|
+
"aria-checked": L(t),
|
|
506
|
+
tabindex: H(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)]", 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
|
+
}, null, 14, Re))), 128))], 42, Ie)) : l("", !0),
|
|
511
|
+
F.value ? (e(), c("hex-color-picker", {
|
|
512
|
+
key: 1,
|
|
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
|
+
}, null, 40, ze)) : l("", !0),
|
|
520
|
+
m.swatchOnly && F.value ? (e(), c("div", Be, [f("input", {
|
|
521
|
+
type: "text",
|
|
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
|
+
disabled: m.disabled,
|
|
527
|
+
"aria-label": u(x).colorPicker.hexValue,
|
|
528
|
+
onChange: G,
|
|
529
|
+
onKeydown: i[1] ||= a(ee((e) => e.target.blur(), ["prevent"]), ["enter"])
|
|
530
|
+
}, null, 46, Ve), A.value ? (e(), c("button", {
|
|
531
|
+
key: 0,
|
|
532
|
+
type: "button",
|
|
533
|
+
"aria-label": u(x).colorPicker.clear,
|
|
534
|
+
title: u(x).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: K
|
|
537
|
+
}, [h(u(de), {
|
|
538
|
+
size: 14,
|
|
539
|
+
"stroke-width": 1.5
|
|
540
|
+
})], 8, He)) : l("", !0)])) : l("", !0)
|
|
541
|
+
], 12, Fe)) : l("", !0)]),
|
|
542
|
+
_: 1
|
|
543
|
+
})], 8, ["to", "disabled"]))
|
|
544
|
+
], 2));
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
//#endregion
|
|
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
|
+
|
|
550
|
+
//# sourceMappingURL=ColorPicker-ll8pynws.js.map
|