@templatical/editor 0.16.1 → 0.16.3
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/{AiFeatureMenu-Rb8G3EBo.js → AiFeatureMenu-CcGRd1xE.js} +1 -1
- package/dist/{CloudEditor-D88gLBXp.js → CloudEditor-CUIWUMp5.js} +6 -6
- package/dist/{CollaboratorBar-dxCD8jSi.js → CollaboratorBar-DmxqeBYZ.js} +1 -1
- package/dist/ColorPicker-Gs4BMVog.js +474 -0
- package/dist/{CountdownToolbar-8XVTOuGX.js → CountdownToolbar-92w1YySJ.js} +2 -2
- package/dist/{ModuleBrowserModal-l4_RCC8m.js → ModuleBrowserModal-DsehjLvh.js} +4 -4
- package/dist/{ModulePreviewCanvas-BqYAr4fz.js → ModulePreviewCanvas-BBfuS8VW.js} +1 -1
- package/dist/{NumberWithSuffix-Di-cDy_m.js → NumberWithSuffix-BxSRfI8b.js} +1 -1
- package/dist/{ParagraphEditor-DIQ1jmSP.js → ParagraphEditor-vgvQxicC.js} +77 -87
- package/dist/{RichTextEditorContent-DkTJ6KK8.js → RichTextEditorContent-Dza2oPvh.js} +1 -1
- package/dist/{SaveModuleDialog-DPo3Raon.js → SaveModuleDialog-DNWGCHlS.js} +2 -2
- package/dist/{SnapshotHistory-m7brKV7C.js → SnapshotHistory-BLmnNLg1.js} +2 -2
- package/dist/{TestEmailModal-BE9sFEIl.js → TestEmailModal-D6v1hgY2.js} +2 -2
- package/dist/{TitleEditor-BATN-k-Q.js → TitleEditor-DPdzOQpq.js} +2 -2
- package/dist/{TplModal-DHBcZ1gq.js → TplModal-DObT0uxf.js} +1 -1
- package/dist/{blockTypeIcons-wRchKKx0.js → blockTypeIcons-B9f5fH_5.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-W7VQFAwq.js → AiFeatureMenu-CyUCHd9I.js} +8 -8
- package/dist/cdn/chunks/{AiFeatureMenu-W7VQFAwq.js.map → AiFeatureMenu-CyUCHd9I.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-ww2vNIfJ.js → BlockIssueBadge-BAa_dI-c.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-ww2vNIfJ.js.map → BlockIssueBadge-BAa_dI-c.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-BVSJ1kvB.js → CloudEditor-ClfgLU48.js} +159 -159
- package/dist/cdn/chunks/{CloudEditor-BVSJ1kvB.js.map → CloudEditor-ClfgLU48.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-BFrAua9a.js → CollaboratorBar-DCc5SL0P.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-BFrAua9a.js.map → CollaboratorBar-DCc5SL0P.js.map} +1 -1
- package/dist/cdn/chunks/ColorPicker-Pi-1fR8c.js +471 -0
- package/dist/cdn/chunks/ColorPicker-Pi-1fR8c.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-MC-mhtQD.js → CountdownBlock-Bj7aoBUU.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-MC-mhtQD.js.map → CountdownBlock-Bj7aoBUU.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-dXyr7tz-.js → CountdownToolbar-B1oniVq1.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-dXyr7tz-.js.map → CountdownToolbar-B1oniVq1.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-CTxSgViL.js → IssuesPanel-BXLVRo-c.js} +7 -7
- package/dist/cdn/chunks/{IssuesPanel-CTxSgViL.js.map → IssuesPanel-BXLVRo-c.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-B5sCsrud.js → ModuleBrowserModal-C7BkJvzf.js} +6 -6
- package/dist/cdn/chunks/{ModuleBrowserModal-B5sCsrud.js.map → ModuleBrowserModal-C7BkJvzf.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-DGTGo8kg.js → ModulePreviewCanvas-BJn-ZHlC.js} +10 -10
- package/dist/cdn/chunks/{ModulePreviewCanvas-DGTGo8kg.js.map → ModulePreviewCanvas-BJn-ZHlC.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-tAHfui6k.js → NumberWithSuffix-CkOxH3F7.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-tAHfui6k.js.map → NumberWithSuffix-CkOxH3F7.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-CB5FGRs3.js → ParagraphEditor-4cMKKC-V.js} +181 -190
- package/dist/cdn/chunks/ParagraphEditor-4cMKKC-V.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-CPelbtck.js → RichTextEditorContent-7RZe4tbj.js} +6 -6
- package/dist/cdn/chunks/{RichTextEditorContent-CPelbtck.js.map → RichTextEditorContent-7RZe4tbj.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-7f9uUUEC.js → SaveModuleDialog-mr9A4j6G.js} +4 -4
- package/dist/cdn/chunks/{SaveModuleDialog-7f9uUUEC.js.map → SaveModuleDialog-mr9A4j6G.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-C0mYpgs4.js → TitleEditor-Cqw2jvuc.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-C0mYpgs4.js.map → TitleEditor-Cqw2jvuc.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-BtxaUtlx.js → blockTypeIcons-B_xRBxSU.js} +8 -8
- package/dist/cdn/chunks/{blockTypeIcons-BtxaUtlx.js.map → blockTypeIcons-B_xRBxSU.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-BJ7vaBol.js → extensions-Btyx_IMf.js} +19 -19
- package/dist/cdn/chunks/{extensions-BJ7vaBol.js.map → extensions-Btyx_IMf.js.map} +1 -1
- package/dist/cdn/chunks/{features-CgbSSCgv.js → features-Dwb5aTLg.js} +18 -16
- package/dist/cdn/chunks/features-Dwb5aTLg.js.map +1 -0
- package/dist/cdn/chunks/{icons-Dlx5MT1V.js → icons-Dhqh5lYQ.js} +2 -2
- package/dist/cdn/chunks/{icons-Dlx5MT1V.js.map → icons-Dhqh5lYQ.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-BMlykZGq.js → media-library-DRodsf2D.js} +101 -101
- package/dist/cdn/chunks/{media-library-BMlykZGq.js.map → media-library-DRodsf2D.js.map} +1 -1
- package/dist/cdn/chunks/{quality-DsVgXk_j.js → quality-A_V2Iqu_.js} +435 -435
- package/dist/cdn/chunks/{quality-DsVgXk_j.js.map → quality-A_V2Iqu_.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-DPvEtVGO.js → renderer-BM_-zceB.js} +12 -12
- package/dist/cdn/chunks/renderer-BM_-zceB.js.map +1 -0
- package/dist/cdn/chunks/{src-CAdirukY.js → src-DSomxPI-.js} +4 -4
- package/dist/cdn/chunks/{src-CAdirukY.js.map → src-DSomxPI-.js.map} +1 -1
- package/dist/cdn/chunks/{styles-D7u4vCpH.js → styles--UXn88wH.js} +829 -829
- package/dist/cdn/chunks/{styles-D7u4vCpH.js.map → styles--UXn88wH.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +30 -30
- package/dist/{dist-CFOQvhSC.js → color-DhoxCSMv.js} +9 -1
- package/dist/style.css +1 -1
- package/dist/{styles-B-yhoJnH.js → styles-CPt6RYEc.js} +6 -6
- package/dist/templatical-editor.js +4 -4
- package/dist/{useEditorCore-CV1ct_17.js → useEditorCore-CSfeEwCj.js} +196 -202
- package/package.json +8 -8
- package/dist/ColorPicker-CAgMCX3A.js +0 -442
- package/dist/cdn/chunks/ColorPicker-DmxMDn-t.js +0 -439
- package/dist/cdn/chunks/ColorPicker-DmxMDn-t.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-CB5FGRs3.js.map +0 -1
- package/dist/cdn/chunks/features-CgbSSCgv.js.map +0 -1
- package/dist/cdn/chunks/renderer-DPvEtVGO.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { M as e, P as t, ct as n, f as r, g as i, h as a, it as o, m as s, p as c, st as l, u, x as d } from "./draggable-D840DIZB.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as p, r as m } from "./icons-
|
|
2
|
+
import { at as f } from "./features-Dwb5aTLg.js";
|
|
3
|
+
import { n as p, r as m } from "./icons-Dhqh5lYQ.js";
|
|
4
4
|
import { t as h } from "./readableTextColor-f8Kykfnh.js";
|
|
5
5
|
//#region src/cloud/components/CollaboratorBar.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var g = { class: "tpl-collaborator-bar tpl:flex tpl:items-center tpl:gap-2" }, _ = ["title"], v = {
|
|
@@ -48,4 +48,4 @@ var g = { class: "tpl-collaborator-bar tpl:flex tpl:items-center tpl:gap-2" }, _
|
|
|
48
48
|
//#endregion
|
|
49
49
|
export { S as default };
|
|
50
50
|
|
|
51
|
-
//# sourceMappingURL=CollaboratorBar-
|
|
51
|
+
//# sourceMappingURL=CollaboratorBar-DCc5SL0P.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollaboratorBar-
|
|
1
|
+
{"version":3,"file":"CollaboratorBar-DCc5SL0P.js","names":[],"sources":["../../../src/cloud/components/CollaboratorBar.vue","../../../src/cloud/components/CollaboratorBar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Collaborator } from \"@templatical/types\";\nimport { useCloudI18nStrict } from \"../../composables\";\nimport { Wifi, WifiOff } from \"@lucide/vue\";\nimport { computed } from \"vue\";\nimport { readableTextColor } from \"../../utils/readableTextColor\";\n\nconst props = defineProps<{\n collaborators: Collaborator[];\n isConnected: boolean;\n}>();\n\nconst { t: cloudT } = useCloudI18nStrict();\n\nconst maxVisible = 3;\n\nconst visibleCollaborators = computed(() =>\n props.collaborators.slice(0, maxVisible),\n);\n\nconst overflowCollaborators = computed(() =>\n props.collaborators.slice(maxVisible),\n);\n\nconst overflowCount = computed(() => overflowCollaborators.value.length);\n\nconst overflowNames = computed(() =>\n overflowCollaborators.value.map((c) => c.name).join(\"\\n\"),\n);\n\nfunction getInitials(name: string): string {\n const parts = name.trim().split(/\\s+/);\n if (parts.length >= 2) {\n return (\n parts[0].charAt(0) + parts[parts.length - 1].charAt(0)\n ).toUpperCase();\n }\n return name.charAt(0).toUpperCase();\n}\n</script>\n\n<template>\n <div class=\"tpl-collaborator-bar tpl:flex tpl:items-center tpl:gap-2\">\n <!-- Connection indicator -->\n <div\n class=\"tpl:flex tpl:items-center tpl:gap-1 tpl:text-[11px]\"\n :style=\"{\n color: isConnected ? 'var(--tpl-success)' : 'var(--tpl-text-muted)',\n }\"\n :title=\"\n isConnected\n ? cloudT.collaboration.connected\n : cloudT.collaboration.disconnected\n \"\n >\n <Wifi v-if=\"isConnected\" :size=\"12\" :stroke-width=\"2\" />\n <WifiOff v-else :size=\"12\" :stroke-width=\"2\" />\n </div>\n\n <!-- Avatar stack -->\n <div\n v-if=\"collaborators.length > 0\"\n class=\"tpl:flex tpl:items-center tpl:-space-x-1.5\"\n >\n <div\n v-for=\"collaborator in visibleCollaborators\"\n :key=\"collaborator.id\"\n class=\"tpl-collaborator-avatar tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[10px] tpl:font-bold tpl:transition-transform tpl:duration-150 tpl:hover:z-10 tpl:hover:scale-110 tpl:border-[var(--tpl-bg)]\"\n :style=\"{\n backgroundColor: collaborator.color,\n color: readableTextColor(collaborator.color),\n }\"\n :title=\"collaborator.name\"\n >\n {{ getInitials(collaborator.name) }}\n </div>\n <div\n v-if=\"overflowCount > 0\"\n class=\"tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[9px] tpl:font-bold tpl:border-[var(--tpl-bg)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]\"\n :title=\"overflowNames\"\n >\n +{{ overflowCount }}\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport type { Collaborator } from \"@templatical/types\";\nimport { useCloudI18nStrict } from \"../../composables\";\nimport { Wifi, WifiOff } from \"@lucide/vue\";\nimport { computed } from \"vue\";\nimport { readableTextColor } from \"../../utils/readableTextColor\";\n\nconst props = defineProps<{\n collaborators: Collaborator[];\n isConnected: boolean;\n}>();\n\nconst { t: cloudT } = useCloudI18nStrict();\n\nconst maxVisible = 3;\n\nconst visibleCollaborators = computed(() =>\n props.collaborators.slice(0, maxVisible),\n);\n\nconst overflowCollaborators = computed(() =>\n props.collaborators.slice(maxVisible),\n);\n\nconst overflowCount = computed(() => overflowCollaborators.value.length);\n\nconst overflowNames = computed(() =>\n overflowCollaborators.value.map((c) => c.name).join(\"\\n\"),\n);\n\nfunction getInitials(name: string): string {\n const parts = name.trim().split(/\\s+/);\n if (parts.length >= 2) {\n return (\n parts[0].charAt(0) + parts[parts.length - 1].charAt(0)\n ).toUpperCase();\n }\n return name.charAt(0).toUpperCase();\n}\n</script>\n\n<template>\n <div class=\"tpl-collaborator-bar tpl:flex tpl:items-center tpl:gap-2\">\n <!-- Connection indicator -->\n <div\n class=\"tpl:flex tpl:items-center tpl:gap-1 tpl:text-[11px]\"\n :style=\"{\n color: isConnected ? 'var(--tpl-success)' : 'var(--tpl-text-muted)',\n }\"\n :title=\"\n isConnected\n ? cloudT.collaboration.connected\n : cloudT.collaboration.disconnected\n \"\n >\n <Wifi v-if=\"isConnected\" :size=\"12\" :stroke-width=\"2\" />\n <WifiOff v-else :size=\"12\" :stroke-width=\"2\" />\n </div>\n\n <!-- Avatar stack -->\n <div\n v-if=\"collaborators.length > 0\"\n class=\"tpl:flex tpl:items-center tpl:-space-x-1.5\"\n >\n <div\n v-for=\"collaborator in visibleCollaborators\"\n :key=\"collaborator.id\"\n class=\"tpl-collaborator-avatar tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[10px] tpl:font-bold tpl:transition-transform tpl:duration-150 tpl:hover:z-10 tpl:hover:scale-110 tpl:border-[var(--tpl-bg)]\"\n :style=\"{\n backgroundColor: collaborator.color,\n color: readableTextColor(collaborator.color),\n }\"\n :title=\"collaborator.name\"\n >\n {{ getInitials(collaborator.name) }}\n </div>\n <div\n v-if=\"overflowCount > 0\"\n class=\"tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[9px] tpl:font-bold tpl:border-[var(--tpl-bg)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]\"\n :title=\"overflowNames\"\n >\n +{{ overflowCount }}\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;iCAcM,IAAa;;;;;;;EAPnB,IAAM,IAAQ,GAKR,EAAE,GAAG,MAAW,EAAmB,GAInC,IAAuB,QAC3B,EAAM,cAAc,MAAM,GAAG,CAAU,CACzC,GAEM,IAAwB,QAC5B,EAAM,cAAc,MAAM,CAAU,CACtC,GAEM,IAAgB,QAAe,EAAsB,MAAM,MAAM,GAEjE,IAAgB,QACpB,EAAsB,MAAM,KAAK,MAAM,EAAE,IAAI,CAAC,CAAC,KAAK,IAAI,CAC1D;EAEA,SAAS,EAAY,GAAsB;GACzC,IAAM,IAAQ,EAAK,KAAK,CAAC,CAAC,MAAM,KAAK;GAMrC,OALI,EAAM,UAAU,KAEhB,EAAM,EAAE,CAAC,OAAO,CAAC,IAAI,EAAM,EAAM,SAAS,EAAE,CAAC,OAAO,CAAC,EAAA,CACrD,YAAY,IAET,EAAK,OAAO,CAAC,CAAC,CAAC,YAAY;EACpC;yBAIE,EA0CM,OA1CN,GA0CM,CAxCJ,EAaM,OAAA;GAZJ,OAAM;GACL,OAAK,EAAA,EAAA,OAAmB,EAAA,cAAW,uBAAA,wBAAA,CAAA;GAGnC,OAAgB,EAAA,cAAwB,EAAA,CAAA,CAAM,CAAC,cAAc,YAAsB,EAAA,CAAA,CAAM,CAAC,cAAc;MAM7F,EAAA,eAAA,EAAA,GAAZ,EAAwD,EAAA,CAAA,GAAA;;GAA9B,MAAM;GAAK,gBAAc;cACnD,EAA+C,EAAA,CAAA,GAAA;;GAA9B,MAAM;GAAK,gBAAc;gBAKpC,EAAA,cAAc,SAAM,KAAA,EAAA,GAD5B,EAuBM,OAvBN,GAuBM,EAAA,EAAA,EAAA,GAnBJ,EAWM,GAAA,MAAA,EAVmB,EAAA,QAAhB,YADT,EAWM,OAAA;GATH,KAAK,EAAa;GACnB,OAAM;GACL,OAAK,EAAA;qBAA+B,EAAa;WAAwB,EAAA,CAAA,CAAiB,CAAC,EAAa,KAAK;;GAI7G,OAAO,EAAa;OAElB,EAAY,EAAa,IAAI,CAAA,GAAA,IAAA,CAAA,YAG1B,EAAA,QAAa,KAAA,EAAA,GADrB,EAMM,OAAA;;GAJJ,OAAM;GACL,OAAO,EAAA;KACT,OACE,EAAG,EAAA,KAAa,GAAA,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,471 @@
|
|
|
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 { Q as h, cn as re, fn as ie, k as ae, lt as g, un as oe, zt as se } from "./features-Dwb5aTLg.js";
|
|
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)]", x = "tpl:flex-1 tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-mono tpl:border tpl:rounded-[var(--tpl-radius-sm)] tpl:shadow-xs tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)]", S = "tpl:rounded-[var(--tpl-radius)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-4 tpl:border tpl:border-[var(--tpl-border)] tpl:transition-colors tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)]", C = "tpl:flex tpl:size-8 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]", w = "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]", T = "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-150 tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]", E = "tpl-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3.5 tpl:py-2 tpl:text-sm tpl:font-medium tpl:whitespace-nowrap tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary)] hover:tpl:text-[var(--tpl-bg)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50", D = [
|
|
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
|
+
], O = [
|
|
18
|
+
"1",
|
|
19
|
+
"1.2",
|
|
20
|
+
"1.4",
|
|
21
|
+
"1.5",
|
|
22
|
+
"1.6",
|
|
23
|
+
"1.8",
|
|
24
|
+
"2",
|
|
25
|
+
"2.5"
|
|
26
|
+
], k = [
|
|
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
|
+
], A = "#000000", j = "#ffffff", M = "#ffff00", N = "#f2f2f2", P = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, F = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n;
|
|
56
|
+
360 / (Math.PI * 2);
|
|
57
|
+
var I = (e) => ue(L(e)), L = (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 ? F(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 ? F(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
|
|
67
|
+
}), R = (e) => le(ce(e)), z = ({ h: e, s: t, v: n, a: r }) => {
|
|
68
|
+
let i = (200 - t) * n / 100;
|
|
69
|
+
return {
|
|
70
|
+
h: F(e),
|
|
71
|
+
s: F(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
|
|
72
|
+
l: F(i / 2),
|
|
73
|
+
a: F(r, 2)
|
|
74
|
+
};
|
|
75
|
+
}, B = (e) => {
|
|
76
|
+
let { h: t, s: n, l: r } = z(e);
|
|
77
|
+
return `hsl(${t}, ${n}%, ${r}%)`;
|
|
78
|
+
}, ce = ({ 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: F([
|
|
83
|
+
n,
|
|
84
|
+
o,
|
|
85
|
+
a,
|
|
86
|
+
a,
|
|
87
|
+
s,
|
|
88
|
+
n
|
|
89
|
+
][c] * 255),
|
|
90
|
+
g: F([
|
|
91
|
+
s,
|
|
92
|
+
n,
|
|
93
|
+
n,
|
|
94
|
+
o,
|
|
95
|
+
a,
|
|
96
|
+
a
|
|
97
|
+
][c] * 255),
|
|
98
|
+
b: F([
|
|
99
|
+
a,
|
|
100
|
+
a,
|
|
101
|
+
s,
|
|
102
|
+
n,
|
|
103
|
+
n,
|
|
104
|
+
o
|
|
105
|
+
][c] * 255),
|
|
106
|
+
a: F(r, 2)
|
|
107
|
+
};
|
|
108
|
+
}, V = (e) => {
|
|
109
|
+
let t = e.toString(16);
|
|
110
|
+
return t.length < 2 ? "0" + t : t;
|
|
111
|
+
}, le = ({ r: e, g: t, b: n, a: r }) => {
|
|
112
|
+
let i = r < 1 ? V(F(r * 255)) : "";
|
|
113
|
+
return "#" + V(e) + V(t) + V(n) + i;
|
|
114
|
+
}, ue = ({ 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: F(60 * (o < 0 ? o + 6 : o)),
|
|
118
|
+
s: F(i ? a / i * 100 : 0),
|
|
119
|
+
v: F(i / 255 * 100),
|
|
120
|
+
a: r
|
|
121
|
+
};
|
|
122
|
+
}, H = (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
|
+
}, de = (e, t) => e.toLowerCase() === t.toLowerCase() || H(L(e), L(t)), U = {}, W = (e) => {
|
|
127
|
+
let t = U[e];
|
|
128
|
+
return t || (t = document.createElement("template"), t.innerHTML = e, U[e] = t), t;
|
|
129
|
+
}, G = (e, t, n) => {
|
|
130
|
+
e.dispatchEvent(new CustomEvent(t, {
|
|
131
|
+
bubbles: !0,
|
|
132
|
+
detail: n
|
|
133
|
+
}));
|
|
134
|
+
}, K = !1, q = (e) => "touches" in e, fe = (e) => K && !q(e) ? !1 : (K ||= q(e), !0), J = (e, t) => {
|
|
135
|
+
let n = q(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
|
|
136
|
+
G(e.el, "move", e.getMove({
|
|
137
|
+
x: P((n.pageX - (r.left + window.pageXOffset)) / r.width),
|
|
138
|
+
y: P((n.pageY - (r.top + window.pageYOffset)) / r.height)
|
|
139
|
+
}));
|
|
140
|
+
}, pe = (e, t) => {
|
|
141
|
+
let n = t.keyCode;
|
|
142
|
+
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), G(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
|
+
}, Y = class {
|
|
147
|
+
constructor(e, t, n, r) {
|
|
148
|
+
let i = W(`<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(K ? "touchmove" : "mousemove", this), t(K ? "touchend" : "mouseup", this);
|
|
156
|
+
}
|
|
157
|
+
handleEvent(e) {
|
|
158
|
+
switch (e.type) {
|
|
159
|
+
case "mousedown":
|
|
160
|
+
case "touchstart":
|
|
161
|
+
if (e.preventDefault(), !fe(e) || !K && e.button != 0) return;
|
|
162
|
+
this.el.focus(), J(this, e), this.dragging = !0;
|
|
163
|
+
break;
|
|
164
|
+
case "mousemove":
|
|
165
|
+
case "touchmove":
|
|
166
|
+
e.preventDefault(), J(this, e);
|
|
167
|
+
break;
|
|
168
|
+
case "mouseup":
|
|
169
|
+
case "touchend":
|
|
170
|
+
this.dragging = !1;
|
|
171
|
+
break;
|
|
172
|
+
case "keydown":
|
|
173
|
+
pe(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
|
+
}, me = class extends Y {
|
|
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: B({
|
|
190
|
+
h: e,
|
|
191
|
+
s: 100,
|
|
192
|
+
v: 100,
|
|
193
|
+
a: 1
|
|
194
|
+
})
|
|
195
|
+
}]), this.el.setAttribute("aria-valuenow", `${F(e)}`);
|
|
196
|
+
}
|
|
197
|
+
getMove(e, t) {
|
|
198
|
+
return { h: t ? P(this.h + e.x * 360, 0, 360) : 360 * e.x };
|
|
199
|
+
}
|
|
200
|
+
}, he = class extends Y {
|
|
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: B(e)
|
|
209
|
+
}, { "background-color": B({
|
|
210
|
+
h: e.h,
|
|
211
|
+
s: 100,
|
|
212
|
+
v: 100,
|
|
213
|
+
a: 1
|
|
214
|
+
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${F(e.s)}%, Brightness ${F(e.v)}%`);
|
|
215
|
+
}
|
|
216
|
+
getMove(e, t) {
|
|
217
|
+
return {
|
|
218
|
+
s: t ? P(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
|
|
219
|
+
v: t ? P(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
}, ge = ":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)}", _e = "[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}", ve = "[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}", X = Symbol("same"), Z = Symbol("color"), Q = Symbol("hsva"), $ = Symbol("update"), ye = Symbol("parts"), be = Symbol("css"), xe = Symbol("sliders"), Se = class extends HTMLElement {
|
|
223
|
+
static get observedAttributes() {
|
|
224
|
+
return ["color"];
|
|
225
|
+
}
|
|
226
|
+
get [be]() {
|
|
227
|
+
return [
|
|
228
|
+
ge,
|
|
229
|
+
_e,
|
|
230
|
+
ve
|
|
231
|
+
];
|
|
232
|
+
}
|
|
233
|
+
get [xe]() {
|
|
234
|
+
return [he, me];
|
|
235
|
+
}
|
|
236
|
+
get color() {
|
|
237
|
+
return this[Z];
|
|
238
|
+
}
|
|
239
|
+
set color(e) {
|
|
240
|
+
if (!this[X](e)) {
|
|
241
|
+
let t = this.colorModel.toHsva(e);
|
|
242
|
+
this[$](t), this[Z] = e;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
constructor() {
|
|
246
|
+
super();
|
|
247
|
+
let e = W(`<style>${this[be].join("")}</style>`), t = this.attachShadow({ mode: "open" });
|
|
248
|
+
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[ye] = this[xe].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[X](r) || (this.color = r);
|
|
259
|
+
}
|
|
260
|
+
handleEvent(e) {
|
|
261
|
+
let t = this[Q], n = {
|
|
262
|
+
...t,
|
|
263
|
+
...e.detail
|
|
264
|
+
};
|
|
265
|
+
this[$](n);
|
|
266
|
+
let r;
|
|
267
|
+
!H(n, t) && !this[X](r = this.colorModel.fromHsva(n)) && (this[Z] = r, G(this, "color-changed", { value: r }));
|
|
268
|
+
}
|
|
269
|
+
[X](e) {
|
|
270
|
+
return this.color && this.colorModel.equal(e, this.color);
|
|
271
|
+
}
|
|
272
|
+
[$](e) {
|
|
273
|
+
this[Q] = e, this[ye].forEach((t) => t.update(e));
|
|
274
|
+
}
|
|
275
|
+
}, Ce = {
|
|
276
|
+
defaultColor: "#000",
|
|
277
|
+
toHsva: I,
|
|
278
|
+
fromHsva: ({ h: e, s: t, v: n }) => R({
|
|
279
|
+
h: e,
|
|
280
|
+
s: t,
|
|
281
|
+
v: n,
|
|
282
|
+
a: 1
|
|
283
|
+
}),
|
|
284
|
+
equal: de,
|
|
285
|
+
fromAttr: (e) => e
|
|
286
|
+
}, we = class extends Se {
|
|
287
|
+
get colorModel() {
|
|
288
|
+
return Ce;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
customElements.define("hex-color-picker", class extends we {});
|
|
292
|
+
//#endregion
|
|
293
|
+
//#region src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
294
|
+
var Te = [
|
|
295
|
+
"disabled",
|
|
296
|
+
"aria-label",
|
|
297
|
+
"title",
|
|
298
|
+
"aria-expanded"
|
|
299
|
+
], Ee = {
|
|
300
|
+
key: 0,
|
|
301
|
+
class: "tpl:relative tpl:flex-1"
|
|
302
|
+
}, De = [
|
|
303
|
+
"value",
|
|
304
|
+
"placeholder",
|
|
305
|
+
"disabled",
|
|
306
|
+
"aria-label"
|
|
307
|
+
], Oe = ["aria-label", "title"], ke = ["data-tpl-theme"], Ae = ["color", "aria-label"], je = {
|
|
308
|
+
key: 0,
|
|
309
|
+
class: "tpl:relative tpl:mt-2"
|
|
310
|
+
}, Me = [
|
|
311
|
+
"value",
|
|
312
|
+
"placeholder",
|
|
313
|
+
"disabled",
|
|
314
|
+
"aria-label"
|
|
315
|
+
], Ne = ["aria-label", "title"], Pe = /* @__PURE__ */ p({
|
|
316
|
+
__name: "ColorPicker",
|
|
317
|
+
props: {
|
|
318
|
+
modelValue: {},
|
|
319
|
+
placeholder: { default: "" },
|
|
320
|
+
seedColor: { default: "#ffffff" },
|
|
321
|
+
swatchOnly: {
|
|
322
|
+
type: Boolean,
|
|
323
|
+
default: !1
|
|
324
|
+
},
|
|
325
|
+
disabled: {
|
|
326
|
+
type: Boolean,
|
|
327
|
+
default: !1
|
|
328
|
+
},
|
|
329
|
+
size: { default: "md" },
|
|
330
|
+
ariaLabel: { default: "" }
|
|
331
|
+
},
|
|
332
|
+
emits: ["update:modelValue"],
|
|
333
|
+
setup(p, { emit: _ }) {
|
|
334
|
+
let v = p, y = _, { t: b } = se(), S = r(!1), C = r(), w = r(), T = r(!1);
|
|
335
|
+
ie(C, () => {
|
|
336
|
+
S.value = !1;
|
|
337
|
+
}, { ignore: [w] });
|
|
338
|
+
let E = o(() => !v.modelValue), D = o(() => h(v.modelValue)), O = o(() => h(v.modelValue || v.seedColor)), k = o(() => !v.disabled && !E.value);
|
|
339
|
+
function A(e) {
|
|
340
|
+
T.value = !0, y("update:modelValue", e.detail.value);
|
|
341
|
+
}
|
|
342
|
+
function j() {
|
|
343
|
+
T.value = !1;
|
|
344
|
+
}
|
|
345
|
+
function M() {
|
|
346
|
+
!T.value && E.value && y("update:modelValue", O.value);
|
|
347
|
+
}
|
|
348
|
+
function N(e) {
|
|
349
|
+
y("update:modelValue", e.target.value);
|
|
350
|
+
}
|
|
351
|
+
function P() {
|
|
352
|
+
y("update:modelValue", "");
|
|
353
|
+
}
|
|
354
|
+
let F = ae(), I = t(re, null), L = t(oe, null), R = r({
|
|
355
|
+
top: 0,
|
|
356
|
+
left: 0
|
|
357
|
+
});
|
|
358
|
+
function z() {
|
|
359
|
+
if (!v.disabled) {
|
|
360
|
+
if (!S.value) {
|
|
361
|
+
let e = w.value?.getBoundingClientRect();
|
|
362
|
+
if (e) {
|
|
363
|
+
let t = e.bottom + 8 + 240 <= window.innerHeight;
|
|
364
|
+
R.value = {
|
|
365
|
+
top: t ? e.bottom + 8 : Math.max(8, e.top - 240 - 8),
|
|
366
|
+
left: e.left
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
S.value = !S.value;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
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
|
+
d("button", {
|
|
375
|
+
ref_key: "swatchRef",
|
|
376
|
+
ref: w,
|
|
377
|
+
type: "button",
|
|
378
|
+
disabled: p.disabled,
|
|
379
|
+
"aria-label": p.ariaLabel || l(b).colorPicker.pickColor,
|
|
380
|
+
title: p.ariaLabel || void 0,
|
|
381
|
+
"aria-expanded": S.value,
|
|
382
|
+
class: u([
|
|
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
|
+
p.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
|
|
385
|
+
S.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !p.disabled && "hover:tpl:border-[var(--tpl-text-dim)]",
|
|
386
|
+
p.size === "sm" ? "tpl:size-8" : "tpl:size-10"
|
|
387
|
+
]),
|
|
388
|
+
onClick: z
|
|
389
|
+
}, [d("span", {
|
|
390
|
+
class: u(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", { "tpl-color-swatch-empty": E.value }]),
|
|
391
|
+
style: f(E.value ? void 0 : { backgroundColor: D.value })
|
|
392
|
+
}, null, 6)], 10, Te),
|
|
393
|
+
p.swatchOnly ? c("", !0) : (e(), s("div", Ee, [d("input", {
|
|
394
|
+
type: "text",
|
|
395
|
+
class: u([l(x), "tpl:w-full"]),
|
|
396
|
+
style: f(k.value ? { paddingRight: "2.25rem" } : void 0),
|
|
397
|
+
value: D.value,
|
|
398
|
+
placeholder: p.placeholder || l(b).colorPicker.notSet,
|
|
399
|
+
disabled: p.disabled,
|
|
400
|
+
"aria-label": l(b).colorPicker.hexValue,
|
|
401
|
+
onInput: N
|
|
402
|
+
}, null, 46, De), k.value ? (e(), s("button", {
|
|
403
|
+
key: 0,
|
|
404
|
+
type: "button",
|
|
405
|
+
"aria-label": l(b).colorPicker.clear,
|
|
406
|
+
title: l(b).colorPicker.clear,
|
|
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: P
|
|
409
|
+
}, [m(l(g), {
|
|
410
|
+
size: 14,
|
|
411
|
+
"stroke-width": 1.5
|
|
412
|
+
})], 8, Oe)) : c("", !0)])),
|
|
413
|
+
(e(), te(a, {
|
|
414
|
+
to: l(F),
|
|
415
|
+
disabled: !l(F)
|
|
416
|
+
}, [m(ne, {
|
|
417
|
+
"enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
418
|
+
"enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
|
|
419
|
+
"enter-to-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
420
|
+
"leave-active-class": "tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
421
|
+
"leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
422
|
+
"leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
|
|
423
|
+
}, {
|
|
424
|
+
default: n(() => [S.value ? (e(), s("div", {
|
|
425
|
+
key: 0,
|
|
426
|
+
ref_key: "popoverRef",
|
|
427
|
+
ref: C,
|
|
428
|
+
"data-tpl-theme": l(L),
|
|
429
|
+
class: "tpl-color-popover tpl:fixed tpl:z-modal tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-3 tpl:shadow-lg",
|
|
430
|
+
style: f({
|
|
431
|
+
top: `${R.value.top}px`,
|
|
432
|
+
left: `${R.value.left}px`,
|
|
433
|
+
...l(I)
|
|
434
|
+
})
|
|
435
|
+
}, [d("hex-color-picker", {
|
|
436
|
+
color: O.value,
|
|
437
|
+
"aria-label": l(b).colorPicker.pickColor,
|
|
438
|
+
onColorChanged: A,
|
|
439
|
+
onPointerdown: j,
|
|
440
|
+
onPointerup: M,
|
|
441
|
+
onKeydown: r[0] ||= i((e) => S.value = !1, ["escape"])
|
|
442
|
+
}, null, 40, Ae), p.swatchOnly ? (e(), s("div", je, [d("input", {
|
|
443
|
+
type: "text",
|
|
444
|
+
class: u([l(x), "tpl:w-full"]),
|
|
445
|
+
style: f(k.value ? { paddingRight: "2.25rem" } : void 0),
|
|
446
|
+
value: D.value,
|
|
447
|
+
placeholder: p.placeholder || l(b).colorPicker.notSet,
|
|
448
|
+
disabled: p.disabled,
|
|
449
|
+
"aria-label": l(b).colorPicker.hexValue,
|
|
450
|
+
onChange: N,
|
|
451
|
+
onKeydown: r[1] ||= i(ee((e) => e.target.blur(), ["prevent"]), ["enter"])
|
|
452
|
+
}, null, 46, Me), k.value ? (e(), s("button", {
|
|
453
|
+
key: 0,
|
|
454
|
+
type: "button",
|
|
455
|
+
"aria-label": l(b).colorPicker.clear,
|
|
456
|
+
title: l(b).colorPicker.clear,
|
|
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: P
|
|
459
|
+
}, [m(l(g), {
|
|
460
|
+
size: 14,
|
|
461
|
+
"stroke-width": 1.5
|
|
462
|
+
})], 8, Ne)) : c("", !0)])) : c("", !0)], 12, ke)) : c("", !0)]),
|
|
463
|
+
_: 1
|
|
464
|
+
})], 8, ["to", "disabled"]))
|
|
465
|
+
], 2));
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
//#endregion
|
|
469
|
+
export { C as _, A as a, O as c, E as d, v as f, T as g, _ as h, N as i, w as l, b as m, j as n, D as o, y as p, M as r, k as s, Pe as t, S as u };
|
|
470
|
+
|
|
471
|
+
//# sourceMappingURL=ColorPicker-Pi-1fR8c.js.map
|