@templatical/editor 0.16.3 → 0.16.5
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-EaPCeDXr.js → AiChatSidebar-CYAbVB2G.js} +7 -7
- package/dist/{AiFeatureMenu-CcGRd1xE.js → AiFeatureMenu-B1oEJebq.js} +4 -4
- package/dist/{BlockIssueBadge-CZYgn-qg.js → BlockIssueBadge-BLytBabN.js} +2 -2
- package/dist/{CloudEditor-CUIWUMp5.js → CloudEditor-D6KNL6VU.js} +15 -15
- package/dist/{CollaboratorBar-DmxqeBYZ.js → CollaboratorBar-C_EhXQ5R.js} +2 -2
- package/dist/{ColorPicker-Gs4BMVog.js → ColorPicker-CppJgX_T.js} +58 -59
- package/dist/{CommentsSidebar-DDKiFsSq.js → CommentsSidebar-C_XLBbo3.js} +8 -8
- package/dist/{CountdownToolbar-92w1YySJ.js → CountdownToolbar-D5GaA_lt.js} +53 -67
- package/dist/{DesignReferenceSidebar-D6TfC176.js → DesignReferenceSidebar-Bh9uAZ4B.js} +5 -5
- package/dist/{IssuesPanel-CQQipLQP.js → IssuesPanel-DltSuU6H.js} +5 -5
- package/dist/{MergeTagSuggestion-DrT3LiZ4.js → MergeTagSuggestion-jIpT_jmz.js} +7 -5
- package/dist/{ModuleBrowserModal-DsehjLvh.js → ModuleBrowserModal-CXy8Bbv9.js} +6 -6
- package/dist/{ModulePreviewCanvas-BBfuS8VW.js → ModulePreviewCanvas-CJC9kyZN.js} +1 -1
- package/dist/{NumberWithSuffix-BxSRfI8b.js → NumberWithSuffix-DNi-v4l1.js} +1 -1
- package/dist/{ParagraphEditor-vgvQxicC.js → ParagraphEditor-nk5Vvr7M.js} +57 -58
- package/dist/{RichTextEditorContent-Dza2oPvh.js → RichTextEditorContent-DBaCrvH0.js} +13 -13
- package/dist/{SaveModuleDialog-DNWGCHlS.js → SaveModuleDialog-CYu5PhBz.js} +24 -23
- package/dist/{SnapshotHistory-BLmnNLg1.js → SnapshotHistory-B38ImqMO.js} +6 -6
- package/dist/{TemplateScoringPanel-C8VOC6gn.js → TemplateScoringPanel-ZhObHWeb.js} +10 -10
- package/dist/{TestEmailModal-D6v1hgY2.js → TestEmailModal-DbstIzEf.js} +3 -3
- package/dist/{TitleEditor-DPdzOQpq.js → TitleEditor-CmfkOHJT.js} +18 -18
- package/dist/ToggleSwitch-DUNuUPsZ.js +37 -0
- package/dist/{TplModal-DObT0uxf.js → TplModal-BXnx3sLr.js} +4 -4
- package/dist/{blockTypeIcons-B9f5fH_5.js → blockTypeIcons-BVIEw0XJ.js} +2 -2
- package/dist/bundle-stats.json +6 -6
- package/dist/{ca-B3eR47lE.js → ca-DI1ViqMa.js} +2 -1
- package/dist/cdn/chunks/{AiFeatureMenu-CyUCHd9I.js → AiFeatureMenu-CuIg4yrB.js} +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-CyUCHd9I.js.map → AiFeatureMenu-CuIg4yrB.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-BAa_dI-c.js → BlockIssueBadge-BHEl_Hs7.js} +4 -4
- package/dist/cdn/chunks/{BlockIssueBadge-BAa_dI-c.js.map → BlockIssueBadge-BHEl_Hs7.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-ClfgLU48.js → CloudEditor-1Ms0w691.js} +130 -130
- package/dist/cdn/chunks/{CloudEditor-ClfgLU48.js.map → CloudEditor-1Ms0w691.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-DCc5SL0P.js → CollaboratorBar-C0a5P64z.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-DCc5SL0P.js.map → CollaboratorBar-C0a5P64z.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-Pi-1fR8c.js → ColorPicker-bsMmT-_B.js} +144 -144
- package/dist/cdn/chunks/ColorPicker-bsMmT-_B.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-Bj7aoBUU.js → CountdownBlock-8053oz4k.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-Bj7aoBUU.js.map → CountdownBlock-8053oz4k.js.map} +1 -1
- package/dist/cdn/chunks/CountdownToolbar-DQ_zrorh.js +198 -0
- package/dist/cdn/chunks/CountdownToolbar-DQ_zrorh.js.map +1 -0
- package/dist/cdn/chunks/{IssuesPanel-BXLVRo-c.js → IssuesPanel-CwQ376nf.js} +7 -7
- package/dist/cdn/chunks/{IssuesPanel-BXLVRo-c.js.map → IssuesPanel-CwQ376nf.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-C7BkJvzf.js → ModuleBrowserModal-DUegB2Jk.js} +8 -8
- package/dist/cdn/chunks/{ModuleBrowserModal-C7BkJvzf.js.map → ModuleBrowserModal-DUegB2Jk.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-BJn-ZHlC.js → ModulePreviewCanvas-f4h8r9Lh.js} +32 -32
- package/dist/cdn/chunks/{ModulePreviewCanvas-BJn-ZHlC.js.map → ModulePreviewCanvas-f4h8r9Lh.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-CkOxH3F7.js → NumberWithSuffix-Bu_nHJuD.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-CkOxH3F7.js.map → NumberWithSuffix-Bu_nHJuD.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-4cMKKC-V.js → ParagraphEditor-IpZsg8qo.js} +75 -75
- package/dist/cdn/chunks/ParagraphEditor-IpZsg8qo.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-7RZe4tbj.js → RichTextEditorContent-DDnqZ9cB.js} +6 -6
- package/dist/cdn/chunks/{RichTextEditorContent-7RZe4tbj.js.map → RichTextEditorContent-DDnqZ9cB.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-mr9A4j6G.js → SaveModuleDialog-CVA5HPCi.js} +31 -30
- package/dist/cdn/chunks/SaveModuleDialog-CVA5HPCi.js.map +1 -0
- package/dist/cdn/chunks/{TitleEditor-Cqw2jvuc.js → TitleEditor-DU8wm0Rh.js} +9 -9
- package/dist/cdn/chunks/TitleEditor-DU8wm0Rh.js.map +1 -0
- package/dist/cdn/chunks/ToggleSwitch-OrmX_w18.js +39 -0
- package/dist/cdn/chunks/ToggleSwitch-OrmX_w18.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-B_xRBxSU.js → blockTypeIcons-Dm5Oosjp.js} +7 -7
- package/dist/cdn/chunks/{blockTypeIcons-B_xRBxSU.js.map → blockTypeIcons-Dm5Oosjp.js.map} +1 -1
- package/dist/cdn/chunks/{ca-B3eR47lE.js → ca-DI1ViqMa.js} +3 -2
- package/dist/cdn/chunks/ca-DI1ViqMa.js.map +1 -0
- package/dist/cdn/chunks/{de-Cy8FB-Ii.js → de-q9lTCMre.js} +3 -2
- package/dist/cdn/chunks/de-q9lTCMre.js.map +1 -0
- package/dist/cdn/chunks/{en-Bu-zS_5o.js → en-CR4LItrX.js} +3 -2
- package/dist/cdn/chunks/en-CR4LItrX.js.map +1 -0
- package/dist/cdn/chunks/{es-CD3ZD6hK.js → es-CEt-lrGd.js} +3 -2
- package/dist/cdn/chunks/es-CEt-lrGd.js.map +1 -0
- package/dist/cdn/chunks/{extensions-Btyx_IMf.js → extensions-BGUoo2a5.js} +29 -29
- package/dist/cdn/chunks/{extensions-Btyx_IMf.js.map → extensions-BGUoo2a5.js.map} +1 -1
- package/dist/cdn/chunks/{features-Dwb5aTLg.js → features-BSpDuFFR.js} +145 -126
- package/dist/cdn/chunks/features-BSpDuFFR.js.map +1 -0
- package/dist/cdn/chunks/{icons-Dhqh5lYQ.js → icons-k3XVoRvc.js} +26 -26
- package/dist/cdn/chunks/{icons-Dhqh5lYQ.js.map → icons-k3XVoRvc.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-DRodsf2D.js → media-library-iDq3otm6.js} +451 -451
- package/dist/cdn/chunks/{media-library-DRodsf2D.js.map → media-library-iDq3otm6.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-CgICL-CQ.js → pt-BR-DvBHY0AA.js} +3 -2
- package/dist/cdn/chunks/pt-BR-DvBHY0AA.js.map +1 -0
- package/dist/cdn/chunks/{quality-A_V2Iqu_.js → quality-Bb7vN32U.js} +512 -512
- package/dist/cdn/chunks/{quality-A_V2Iqu_.js.map → quality-Bb7vN32U.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-BM_-zceB.js → renderer-cOvtk8HM.js} +20 -17
- package/dist/cdn/chunks/{renderer-BM_-zceB.js.map → renderer-cOvtk8HM.js.map} +1 -1
- package/dist/cdn/chunks/{src-DSomxPI-.js → src-Ddp969zE.js} +6 -6
- package/dist/cdn/chunks/{src-DSomxPI-.js.map → src-Ddp969zE.js.map} +1 -1
- package/dist/cdn/chunks/{styles--UXn88wH.js → styles-CW_gRVVR.js} +893 -891
- package/dist/cdn/chunks/styles-CW_gRVVR.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +51 -51
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-D1zYtCPK.js → check-Cg6Mc2pP.js} +1 -1
- package/dist/{chevron-down-ByXpufZD.js → chevron-down-dClfxKrJ.js} +1 -1
- package/dist/{circle-alert-CjcAORUw.js → circle-alert-Bhzm-fNA.js} +1 -1
- package/dist/{clock-5lWLadUn.js → clock-m7TwQw4b.js} +1 -1
- package/dist/{createLucideIcon-Bh9xOmlW.js → createLucideIcon-FSF4peHQ.js} +2 -2
- package/dist/{de-Cy8FB-Ii.js → de-q9lTCMre.js} +2 -1
- package/dist/{en-Bu-zS_5o.js → en-CR4LItrX.js} +2 -1
- package/dist/{es-CD3ZD6hK.js → es-CEt-lrGd.js} +2 -1
- package/dist/{extensions-B2poxDIo.js → extensions-Cjd-VAII.js} +1 -1
- package/dist/{image-up-Bj_nes3f.js → image-up-CDEgJqwA.js} +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/{info-BhSQCxBV.js → info-BNP8yGsK.js} +1 -1
- package/dist/{list-checks-CgxyUg7i.js → list-checks-jepi4iYr.js} +1 -1
- package/dist/{loader-circle-DFU0HPAa.js → loader-circle-BT38qSm3.js} +1 -1
- package/dist/{message-circle-BEBsCHnk.js → message-circle-BAHcL9S-.js} +1 -1
- package/dist/{pt-BR-CgICL-CQ.js → pt-BR-DvBHY0AA.js} +2 -1
- package/dist/{refresh-cw--lvWGy0_.js → refresh-cw-as5Bmg4X.js} +1 -1
- package/dist/{scan-line-QgyDIgn_.js → scan-line-IAMjPtRw.js} +1 -1
- package/dist/{send-BMyisUim.js → send-DvMay6bt.js} +1 -1
- package/dist/{shield-check-C49M20le.js → shield-check-YYDhGroE.js} +1 -1
- package/dist/{sparkles-DV7Dman6.js → sparkles-CCwQMMMZ.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-CPt6RYEc.js → styles-DJfTblY7.js} +764 -762
- package/dist/templatical-editor.js +9 -9
- package/dist/{text-align-start-BMU70uAm.js → text-align-start-BwsA6QzC.js} +11 -11
- package/dist/{trash-2-B6M659Ey.js → trash-2-CRBDolnR.js} +1 -1
- package/dist/{triangle-alert-D1lzx6ds.js → triangle-alert-B2g0ALvq.js} +1 -1
- package/dist/{upload-3A1oZtOR.js → upload-BKg6hDRW.js} +1 -1
- package/dist/{useEditorCore-CSfeEwCj.js → useEditorCore-DnOG2a_b.js} +656 -656
- package/dist/usePopoverPosition-B3Byo68F.js +281 -0
- package/dist/{x-CG_NV3nP.js → x-Ctg_250T.js} +1 -1
- package/package.json +8 -8
- package/dist/cdn/chunks/ColorPicker-Pi-1fR8c.js.map +0 -1
- package/dist/cdn/chunks/CountdownToolbar-B1oniVq1.js +0 -212
- package/dist/cdn/chunks/CountdownToolbar-B1oniVq1.js.map +0 -1
- package/dist/cdn/chunks/MergeTagSuggestion-jesxS7An.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-4cMKKC-V.js.map +0 -1
- package/dist/cdn/chunks/SaveModuleDialog-mr9A4j6G.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-Cqw2jvuc.js.map +0 -1
- package/dist/cdn/chunks/ca-B3eR47lE.js.map +0 -1
- package/dist/cdn/chunks/de-Cy8FB-Ii.js.map +0 -1
- package/dist/cdn/chunks/en-Bu-zS_5o.js.map +0 -1
- package/dist/cdn/chunks/es-CD3ZD6hK.js.map +0 -1
- package/dist/cdn/chunks/features-Dwb5aTLg.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-CgICL-CQ.js.map +0 -1
- package/dist/cdn/chunks/styles--UXn88wH.js.map +0 -1
- package/dist/color-DhoxCSMv.js +0 -259
- package/dist/usePopoverRoot-C1j0D7cc.js +0 -8
|
@@ -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 { ot as f } from "./features-BSpDuFFR.js";
|
|
3
|
+
import { n as p, r as m } from "./icons-k3XVoRvc.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-C0a5P64z.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollaboratorBar-
|
|
1
|
+
{"version":3,"file":"CollaboratorBar-C0a5P64z.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"}
|
|
@@ -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-BSpDuFFR.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-bsMmT-_B.js.map
|