@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.
Files changed (135) hide show
  1. package/dist/{AiChatSidebar-BWIzNePR.js → AiChatSidebar-ChrE6pUq.js} +10 -10
  2. package/dist/{AiFeatureMenu-IoLW8c6m.js → AiFeatureMenu-DkQ9HhQ6.js} +7 -7
  3. package/dist/{BlockIssueBadge-FbyZBJlf.js → BlockIssueBadge-B4QjePax.js} +4 -4
  4. package/dist/{CloudEditor-txLsdvcR.js → CloudEditor-CfX-aMiV.js} +24 -22
  5. package/dist/{CollaboratorBar-CpLOFt43.js → CollaboratorBar-DTibhQ1j.js} +3 -3
  6. package/dist/ColorPicker-4vDYhdGe.js +552 -0
  7. package/dist/{CommentsSidebar-C8xFu9qy.js → CommentsSidebar-D-o5Stlg.js} +12 -12
  8. package/dist/{CountdownBlock-CaU40Htk.js → CountdownBlock-Bn5w7C-p.js} +1 -1
  9. package/dist/{CountdownToolbar-CBbGAxmF.js → CountdownToolbar-D7yQqnA2.js} +3 -3
  10. package/dist/{DesignReferenceSidebar-BWZgqmT-.js → DesignReferenceSidebar-DnO6ZdwS.js} +10 -10
  11. package/dist/{IssuesPanel-CBzfmzRM.js → IssuesPanel-X_vkNGrs.js} +7 -7
  12. package/dist/{ModuleBrowserModal-C9qHpjaS.js → ModuleBrowserModal-AJt--JPh.js} +9 -9
  13. package/dist/{ModulePreviewCanvas-xEMWMJwf.js → ModulePreviewCanvas-BKYOcVCh.js} +2 -2
  14. package/dist/{NumberWithSuffix-BreqtON_.js → NumberWithSuffix-Bf3rNxza.js} +1 -1
  15. package/dist/{ParagraphEditor-iRJI_YbA.js → ParagraphEditor-C5ixOIYb.js} +46 -46
  16. package/dist/{RichTextEditorContent-DkXai9qP.js → RichTextEditorContent-DwhDnMsG.js} +7 -7
  17. package/dist/{SaveModuleDialog-DqDmk0rO.js → SaveModuleDialog-B4QX9eiv.js} +7 -7
  18. package/dist/{SnapshotHistory-BVe5aCHi.js → SnapshotHistory-DaVueFv6.js} +8 -8
  19. package/dist/{TemplateScoringPanel-CRqt9-T5.js → TemplateScoringPanel-B0UHoTLx.js} +77 -77
  20. package/dist/{TestEmailModal-jpy4hnYZ.js → TestEmailModal-BkauxF7j.js} +4 -4
  21. package/dist/{TitleEditor-Bf6Jv2qI.js → TitleEditor-n6WDVDjW.js} +9 -9
  22. package/dist/{TplModal-DAtccv6o.js → TplModal-BDDyvT-C.js} +3 -3
  23. package/dist/{blockTypeIcons-CnlwyvkL.js → blockTypeIcons-4D0aFXNg.js} +2 -2
  24. package/dist/bundle-stats.json +6 -6
  25. package/dist/{ca-CSl--oWR.js → ca-DbWoy4rG.js} +2 -1
  26. package/dist/cdn/chunks/{AiFeatureMenu-B4oJlFQI.js → AiFeatureMenu-CIBHAGSz.js} +5 -5
  27. package/dist/cdn/chunks/{AiFeatureMenu-B4oJlFQI.js.map → AiFeatureMenu-CIBHAGSz.js.map} +1 -1
  28. package/dist/cdn/chunks/{BlockIssueBadge-C7Ts7bT7.js → BlockIssueBadge-CxMiLo3p.js} +4 -4
  29. package/dist/cdn/chunks/{BlockIssueBadge-C7Ts7bT7.js.map → BlockIssueBadge-CxMiLo3p.js.map} +1 -1
  30. package/dist/cdn/chunks/{CloudEditor-BRO-2CcF.js → CloudEditor-CEa3Xgqh.js} +133 -131
  31. package/dist/cdn/chunks/CloudEditor-CEa3Xgqh.js.map +1 -0
  32. package/dist/cdn/chunks/{CollaboratorBar-BsWOjOCS.js → CollaboratorBar-Bk1gD02G.js} +3 -3
  33. package/dist/cdn/chunks/{CollaboratorBar-BsWOjOCS.js.map → CollaboratorBar-Bk1gD02G.js.map} +1 -1
  34. package/dist/cdn/chunks/ColorPicker-ll8pynws.js +550 -0
  35. package/dist/cdn/chunks/ColorPicker-ll8pynws.js.map +1 -0
  36. package/dist/cdn/chunks/{CountdownBlock-BUGxk8GI.js → CountdownBlock-eGUE7hhw.js} +4 -4
  37. package/dist/cdn/chunks/{CountdownBlock-BUGxk8GI.js.map → CountdownBlock-eGUE7hhw.js.map} +1 -1
  38. package/dist/cdn/chunks/{CountdownToolbar-C8tWWfGw.js → CountdownToolbar-C1bkSjUR.js} +4 -4
  39. package/dist/cdn/chunks/{CountdownToolbar-C8tWWfGw.js.map → CountdownToolbar-C1bkSjUR.js.map} +1 -1
  40. package/dist/cdn/chunks/{IssuesPanel-C5izyrbm.js → IssuesPanel-Csasylf_.js} +7 -7
  41. package/dist/cdn/chunks/{IssuesPanel-C5izyrbm.js.map → IssuesPanel-Csasylf_.js.map} +1 -1
  42. package/dist/cdn/chunks/{ModuleBrowserModal-DySKXKFF.js → ModuleBrowserModal-DznWWtBI.js} +8 -8
  43. package/dist/cdn/chunks/{ModuleBrowserModal-DySKXKFF.js.map → ModuleBrowserModal-DznWWtBI.js.map} +1 -1
  44. package/dist/cdn/chunks/{ModulePreviewCanvas-qqEvLBp2.js → ModulePreviewCanvas-D-h7fr87.js} +8 -8
  45. package/dist/cdn/chunks/{ModulePreviewCanvas-qqEvLBp2.js.map → ModulePreviewCanvas-D-h7fr87.js.map} +1 -1
  46. package/dist/cdn/chunks/{NumberWithSuffix-DttdbXsh.js → NumberWithSuffix-Dt-0odUN.js} +2 -2
  47. package/dist/cdn/chunks/{NumberWithSuffix-DttdbXsh.js.map → NumberWithSuffix-Dt-0odUN.js.map} +1 -1
  48. package/dist/cdn/chunks/{ParagraphEditor-CQJ23PXU.js → ParagraphEditor-v0_XEL-v.js} +110 -110
  49. package/dist/cdn/chunks/{ParagraphEditor-CQJ23PXU.js.map → ParagraphEditor-v0_XEL-v.js.map} +1 -1
  50. package/dist/cdn/chunks/{RichTextEditorContent-C4vxiXng.js → RichTextEditorContent-NQExNsaV.js} +5 -5
  51. package/dist/cdn/chunks/{RichTextEditorContent-C4vxiXng.js.map → RichTextEditorContent-NQExNsaV.js.map} +1 -1
  52. package/dist/cdn/chunks/{SaveModuleDialog-D5eddgzd.js → SaveModuleDialog-BpFhTi-k.js} +5 -5
  53. package/dist/cdn/chunks/{SaveModuleDialog-D5eddgzd.js.map → SaveModuleDialog-BpFhTi-k.js.map} +1 -1
  54. package/dist/cdn/chunks/{TitleEditor-5TkwDrPL.js → TitleEditor-CS-_MzYs.js} +8 -8
  55. package/dist/cdn/chunks/{TitleEditor-5TkwDrPL.js.map → TitleEditor-CS-_MzYs.js.map} +1 -1
  56. package/dist/cdn/chunks/{blockTypeIcons-CbmN4aSw.js → blockTypeIcons-B0Hjh42a.js} +7 -7
  57. package/dist/cdn/chunks/{blockTypeIcons-CbmN4aSw.js.map → blockTypeIcons-B0Hjh42a.js.map} +1 -1
  58. package/dist/cdn/chunks/{ca-CSl--oWR.js → ca-DbWoy4rG.js} +3 -2
  59. package/dist/cdn/chunks/{ca-CSl--oWR.js.map → ca-DbWoy4rG.js.map} +1 -1
  60. package/dist/{de-ZaffrKDP.js → cdn/chunks/de-CgGOnerg.js} +4 -1
  61. package/dist/cdn/chunks/{de-ZaffrKDP.js.map → de-CgGOnerg.js.map} +1 -1
  62. package/dist/cdn/chunks/{en-CHuXeJDt.js → en-DrUV9xth.js} +3 -2
  63. package/dist/cdn/chunks/{en-CHuXeJDt.js.map → en-DrUV9xth.js.map} +1 -1
  64. package/dist/{es-CaC8VQjO.js → cdn/chunks/es-DwbKjU7q.js} +4 -1
  65. package/dist/cdn/chunks/{es-CaC8VQjO.js.map → es-DwbKjU7q.js.map} +1 -1
  66. package/dist/cdn/chunks/{extensions-B3M4IqhZ.js → extensions-Di3hdIRT.js} +25 -25
  67. package/dist/cdn/chunks/{extensions-B3M4IqhZ.js.map → extensions-Di3hdIRT.js.map} +1 -1
  68. package/dist/cdn/chunks/{features-HBwOEo4D.js → features-CLIZ7Q-Y.js} +1129 -1002
  69. package/dist/cdn/chunks/features-CLIZ7Q-Y.js.map +1 -0
  70. package/dist/cdn/chunks/{icons-D4vTsN4p.js → icons-GX40Qm2W.js} +2 -2
  71. package/dist/cdn/chunks/{icons-D4vTsN4p.js.map → icons-GX40Qm2W.js.map} +1 -1
  72. package/dist/cdn/chunks/{media-library-CfExuiSG.js → media-library-yYAkAagU.js} +537 -537
  73. package/dist/cdn/chunks/{media-library-CfExuiSG.js.map → media-library-yYAkAagU.js.map} +1 -1
  74. package/dist/cdn/chunks/{pt-BR-C74zfEWH.js → pt-BR-Bcc5Tjed.js} +3 -2
  75. package/dist/cdn/chunks/{pt-BR-C74zfEWH.js.map → pt-BR-Bcc5Tjed.js.map} +1 -1
  76. package/dist/cdn/chunks/{pusher-CIwiKF8H.js → pusher-R0v5p99W.js} +27 -22
  77. package/dist/cdn/chunks/pusher-R0v5p99W.js.map +1 -0
  78. package/dist/cdn/chunks/quality-DffYv9j5.js +2180 -0
  79. package/dist/cdn/chunks/{quality-nh1R42eb.js.map → quality-DffYv9j5.js.map} +1 -1
  80. package/dist/cdn/chunks/{renderer-BLvlUayY.js → renderer-DpBGiXOg.js} +16 -16
  81. package/dist/cdn/chunks/{renderer-BLvlUayY.js.map → renderer-DpBGiXOg.js.map} +1 -1
  82. package/dist/cdn/chunks/{src-Cks4RrLL.js → src-9K6uFiuK.js} +6 -6
  83. package/dist/cdn/chunks/{src-Cks4RrLL.js.map → src-9K6uFiuK.js.map} +1 -1
  84. package/dist/cdn/chunks/{styles-CPCN13az.js → styles-DHSmjlpX.js} +820 -816
  85. package/dist/cdn/chunks/styles-DHSmjlpX.js.map +1 -0
  86. package/dist/cdn/editor.css +1 -1
  87. package/dist/cdn/editor.js +54 -52
  88. package/dist/cdn/editor.js.map +1 -1
  89. package/dist/{check-Cg6Mc2pP.js → check-Bl4J_tYV.js} +1 -1
  90. package/dist/{chevron-down-dClfxKrJ.js → chevron-down-COEcl2iP.js} +1 -1
  91. package/dist/{circle-alert-Bhzm-fNA.js → circle-alert-CvHi5etc.js} +1 -1
  92. package/dist/{clock-m7TwQw4b.js → clock-CZZw62e8.js} +1 -1
  93. package/dist/{cloud-BogxOeZu.js → cloud-B-RebwxI.js} +5 -5
  94. package/dist/{createLucideIcon-FSF4peHQ.js → createLucideIcon-_peTZQtY.js} +2 -2
  95. package/dist/{cdn/chunks/de-ZaffrKDP.js → de-CgGOnerg.js} +2 -3
  96. package/dist/{dist-DoRIUsfz.js → dist-BJbqgyPn.js} +108 -94
  97. package/dist/{en-CHuXeJDt.js → en-DrUV9xth.js} +2 -1
  98. package/dist/{cdn/chunks/es-CaC8VQjO.js → es-DwbKjU7q.js} +2 -3
  99. package/dist/{extensions-gpFdCinj.js → extensions-BCA9pyer.js} +11 -11
  100. package/dist/{image-up-CDEgJqwA.js → image-up-D26rNdfX.js} +1 -1
  101. package/dist/index.d.ts +31 -0
  102. package/dist/{info-BNP8yGsK.js → info-CE3JSTqk.js} +1 -1
  103. package/dist/keys-DFaIbGR8.js +10 -0
  104. package/dist/{list-checks-jepi4iYr.js → list-checks-BQsLrtBB.js} +1 -1
  105. package/dist/{loader-circle-BT38qSm3.js → loader-circle-s9Rh5lLd.js} +1 -1
  106. package/dist/{message-circle-BAHcL9S-.js → message-circle-CI62d690.js} +1 -1
  107. package/dist/{pt-BR-C74zfEWH.js → pt-BR-Bcc5Tjed.js} +2 -1
  108. package/dist/{refresh-cw-as5Bmg4X.js → refresh-cw-DlYfl65Y.js} +1 -1
  109. package/dist/{scan-line-IAMjPtRw.js → scan-line-CHadrYVb.js} +1 -1
  110. package/dist/{send-DvMay6bt.js → send-CbP40otC.js} +1 -1
  111. package/dist/{shield-check-YYDhGroE.js → shield-check-Bnj9aRoJ.js} +1 -1
  112. package/dist/{sparkles-CCwQMMMZ.js → sparkles-CncWT57a.js} +1 -1
  113. package/dist/style.css +1 -1
  114. package/dist/{styles-CJ6WmkYL.js → styles-DkF_-uX8.js} +677 -673
  115. package/dist/templatical-editor.js +14 -12
  116. package/dist/{text-align-start-BwsA6QzC.js → text-align-start-B458vzYw.js} +1 -1
  117. package/dist/{trash-2-CRBDolnR.js → trash-2-DO0yjSU1.js} +1 -1
  118. package/dist/{triangle-alert-B2g0ALvq.js → triangle-alert-C18_ima6.js} +1 -1
  119. package/dist/{upload-y4gxiFp5.js → upload-DsCd2zTR.js} +1 -1
  120. package/dist/{useCloudI18n-DIn74fK2.js → useCloudI18n-PCDOC2kz.js} +1 -1
  121. package/dist/{useEditorCore-LJJNXXqC.js → useEditorCore-kKUemYY6.js} +1047 -961
  122. package/dist/{useI18n-OaMLWqhY.js → useI18n-BNMzZTM5.js} +1 -1
  123. package/dist/{useMergeTag-CZMgwVvr.js → useMergeTag-DfEY0eK5.js} +5 -5
  124. package/dist/{usePopoverPosition-QDY09q9H.js → usePopoverPosition-F9STHRIr.js} +33 -6
  125. package/dist/{x-Ctg_250T.js → x-BCFQuE_q.js} +1 -1
  126. package/package.json +10 -10
  127. package/dist/ColorPicker-BXCcUYsZ.js +0 -473
  128. package/dist/cdn/chunks/CloudEditor-BRO-2CcF.js.map +0 -1
  129. package/dist/cdn/chunks/ColorPicker-DEtVX4gN.js +0 -471
  130. package/dist/cdn/chunks/ColorPicker-DEtVX4gN.js.map +0 -1
  131. package/dist/cdn/chunks/features-HBwOEo4D.js.map +0 -1
  132. package/dist/cdn/chunks/pusher-CIwiKF8H.js.map +0 -1
  133. package/dist/cdn/chunks/quality-nh1R42eb.js +0 -2180
  134. package/dist/cdn/chunks/styles-CPCN13az.js.map +0 -1
  135. package/dist/keys-DAxnnmXs.js +0 -10
@@ -1,5 +1,5 @@
1
1
  import { W as e, x as t } from "./vue.runtime.esm-bundler-B0xoGkDv.js";
2
- import { L as n } from "./keys-DAxnnmXs.js";
2
+ import { R as n } from "./keys-DFaIbGR8.js";
3
3
  //#region src/composables/useI18n.ts
4
4
  function r(r) {
5
5
  let i = r ?? t(n, null);
@@ -1,14 +1,14 @@
1
1
  import { Y as e, x as t } from "./vue.runtime.esm-bundler-B0xoGkDv.js";
2
- import { A as n, T as r, r as i } from "./dist-DoRIUsfz.js";
3
- import { A as a, D as o, E as s, T as c, w as l } from "./keys-DAxnnmXs.js";
2
+ import { D as n, M as r, a as i } from "./dist-BJbqgyPn.js";
3
+ import { D as a, E as o, O as s, T as c, j as l } from "./keys-DFaIbGR8.js";
4
4
  //#region src/composables/useMergeTag.ts
5
5
  function u() {
6
- let u = t(l, []), d = t(o, i.liquid), f = t(a, null), p = t(c, !0), m = t(s, null), h = e(!1);
6
+ let u = t(c, []), d = t(s, i.liquid), f = t(l, null), p = t(o, !0), m = t(a, null), h = e(!1);
7
7
  function g(e) {
8
- return n(e, d);
8
+ return r(e, d);
9
9
  }
10
10
  function _(e) {
11
- return r(e, u);
11
+ return n(e, u);
12
12
  }
13
13
  async function v() {
14
14
  if (f) {
@@ -1,6 +1,6 @@
1
1
  import { E as e, I as t, L as n, Y as r, Z as i, b as a, et as o, nt as s, s as c, v as l, x as u } from "./vue.runtime.esm-bundler-B0xoGkDv.js";
2
2
  import { _ as d, a as f, d as p, i as m, l as h, n as g, o as _, r as v, s as y, t as b, u as x } from "./dist-DYv_Pttj.js";
3
- import { M as S } from "./keys-DAxnnmXs.js";
3
+ import { N as S } from "./keys-DFaIbGR8.js";
4
4
  //#region ../../node_modules/.pnpm/@vueuse+core@14.3.0_vue@3.5.40_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
5
5
  var C = g ? window : void 0;
6
6
  g && window.document, g && window.navigator, g && window.location;
@@ -249,22 +249,49 @@ function I(e, n = {}) {
249
249
  };
250
250
  }
251
251
  //#endregion
252
+ //#region src/utils/resolveColorsConfig.ts
253
+ var L = {
254
+ presets: [],
255
+ allowCustom: !0,
256
+ allowCustomIgnored: !1,
257
+ invalidPresets: []
258
+ }, R = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
259
+ function z(e, t = L) {
260
+ let n, r;
261
+ if (e?.presets === void 0) n = t.presets, r = [];
262
+ else {
263
+ n = [], r = [];
264
+ for (let t of e.presets) R.test(t) ? n.push(t) : r.push(t);
265
+ }
266
+ let i = e?.allowCustom ?? t.allowCustom, a = !i && n.length === 0;
267
+ return {
268
+ presets: n,
269
+ allowCustom: a ? !0 : i,
270
+ allowCustomIgnored: a,
271
+ invalidPresets: r
272
+ };
273
+ }
274
+ //#endregion
252
275
  //#region src/utils/color.ts
253
- function L(e) {
276
+ function B(e) {
254
277
  let t = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e.trim());
255
278
  if (!t) return e;
256
279
  let n = (e) => Number(e).toString(16).padStart(2, "0");
257
280
  return `#${n(t[1])}${n(t[2])}${n(t[3])}`;
258
281
  }
282
+ function V(e) {
283
+ let t = B(e), n = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(t);
284
+ return n ? `#${n[1]}${n[1]}${n[2]}${n[2]}${n[3]}${n[3]}`.toLowerCase() : /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : t;
285
+ }
259
286
  //#endregion
260
287
  //#region src/composables/usePopoverRoot.ts
261
- function R() {
288
+ function H() {
262
289
  return u(S, r(null));
263
290
  }
264
291
  //#endregion
265
292
  //#region src/composables/usePopoverPosition.ts
266
- function z() {
267
- let e = R();
293
+ function U() {
294
+ let e = H();
268
295
  function t(t) {
269
296
  let n = e.value?.getBoundingClientRect();
270
297
  return n ? {
@@ -278,4 +305,4 @@ function z() {
278
305
  return { toLocal: t };
279
306
  }
280
307
  //#endregion
281
- export { P as a, N as c, D as i, R as n, I as o, L as r, T as s, z as t };
308
+ export { L as a, P as c, N as d, B as i, I as l, H as n, z as o, V as r, D as s, U as t, T as u };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./createLucideIcon-FSF4peHQ.js";
1
+ import { t as e } from "./createLucideIcon-_peTZQtY.js";
2
2
  var t = e("x", [["path", {
3
3
  d: "M18 6 6 18",
4
4
  key: "1bl5f8"
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@templatical/editor",
3
3
  "description": "Vue 3 visual drag-and-drop email editor powered by Templatical",
4
- "version": "0.18.0",
4
+ "version": "0.20.0",
5
5
  "bugs": "https://github.com/templatical/sdk/issues",
6
6
  "devDependencies": {
7
- "@lucide/vue": "^1.25.0",
7
+ "@lucide/vue": "^1.26.0",
8
8
  "@tiptap/core": "^3.28.0",
9
9
  "@tiptap/extension-color": "^3.28.0",
10
10
  "@tiptap/extension-font-family": "^3.28.0",
@@ -22,7 +22,7 @@
22
22
  "@vue/test-utils": "^2.4.11",
23
23
  "@vueuse/core": "^14.3.0",
24
24
  "es-module-lexer": "^2.3.1",
25
- "happy-dom": "^20.11.0",
25
+ "happy-dom": "^20.11.1",
26
26
  "liquidjs": "^10.27.2",
27
27
  "tailwindcss": "^4.3.3",
28
28
  "typescript": "^6.0.3",
@@ -31,10 +31,10 @@
31
31
  "vitest": "^4.1.10",
32
32
  "vue": "^3.5.40",
33
33
  "vue-draggable-plus": "^0.6.1",
34
- "vue-tsc": "^3.3.7",
35
- "@templatical/core": "0.18.0",
36
- "@templatical/quality": "0.18.0",
37
- "@templatical/types": "0.18.0"
34
+ "vue-tsc": "^3.3.8",
35
+ "@templatical/core": "0.20.0",
36
+ "@templatical/quality": "0.20.0",
37
+ "@templatical/types": "0.20.0"
38
38
  },
39
39
  "exports": {
40
40
  ".": {
@@ -62,9 +62,9 @@
62
62
  "license": "SEE LICENSE IN LICENSE",
63
63
  "module": "./dist/templatical-editor.js",
64
64
  "peerDependencies": {
65
- "@templatical/media-library": "0.18.0",
66
- "@templatical/quality": "0.18.0",
67
- "@templatical/renderer": "0.18.0"
65
+ "@templatical/media-library": "0.20.0",
66
+ "@templatical/quality": "0.20.0",
67
+ "@templatical/renderer": "0.20.0"
68
68
  },
69
69
  "peerDependenciesMeta": {
70
70
  "@templatical/renderer": {
@@ -1,473 +0,0 @@
1
- import { Dt as e, Et as t, O as n, R as r, Y as i, _ as a, c as o, d as s, h as c, i as ee, l as te, nt as l, s as u, u as d, x as f } from "./vue.runtime.esm-bundler-B0xoGkDv.js";
2
- import { c as ne, s as p, t as re } from "./runtime-dom.esm-bundler-GdMI8WqG.js";
3
- import { i as ie, n as ae, r as m, t as oe } from "./usePopoverPosition-QDY09q9H.js";
4
- import { I as se, R as ce } from "./keys-DAxnnmXs.js";
5
- import { t as le } from "./useI18n-OaMLWqhY.js";
6
- import { t as h } from "./x-Ctg_250T.js";
7
- //#region src/constants/styleConstants.ts
8
- var g = "tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]", _ = "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)]", v = "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)]", y = "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)]", b = "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 = [
9
- "10px",
10
- "12px",
11
- "14px",
12
- "16px",
13
- "18px",
14
- "20px",
15
- "24px",
16
- "28px",
17
- "32px",
18
- "36px",
19
- "48px",
20
- "64px"
21
- ], D = [
22
- "1",
23
- "1.2",
24
- "1.4",
25
- "1.5",
26
- "1.6",
27
- "1.8",
28
- "2",
29
- "2.5"
30
- ], O = [
31
- {
32
- label: "Normal",
33
- value: "normal"
34
- },
35
- {
36
- label: "-0.5px",
37
- value: "-0.5px"
38
- },
39
- {
40
- label: "0.5px",
41
- value: "0.5px"
42
- },
43
- {
44
- label: "1px",
45
- value: "1px"
46
- },
47
- {
48
- label: "1.5px",
49
- value: "1.5px"
50
- },
51
- {
52
- label: "2px",
53
- value: "2px"
54
- },
55
- {
56
- label: "3px",
57
- value: "3px"
58
- }
59
- ], 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;
60
- 360 / (Math.PI * 2);
61
- var F = (e) => fe(I(e)), I = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
62
- r: parseInt(e[0] + e[0], 16),
63
- g: parseInt(e[1] + e[1], 16),
64
- b: parseInt(e[2] + e[2], 16),
65
- a: e.length === 4 ? P(parseInt(e[3] + e[3], 16) / 255, 2) : 1
66
- } : {
67
- r: parseInt(e.substring(0, 2), 16),
68
- g: parseInt(e.substring(2, 4), 16),
69
- b: parseInt(e.substring(4, 6), 16),
70
- a: e.length === 8 ? P(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
71
- }), L = (e) => de(ue(e)), R = ({ h: e, s: t, v: n, a: r }) => {
72
- let i = (200 - t) * n / 100;
73
- return {
74
- h: P(e),
75
- s: P(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
76
- l: P(i / 2),
77
- a: P(r, 2)
78
- };
79
- }, z = (e) => {
80
- let { h: t, s: n, l: r } = R(e);
81
- return `hsl(${t}, ${n}%, ${r}%)`;
82
- }, ue = ({ h: e, s: t, v: n, a: r }) => {
83
- e = e / 360 * 6, t /= 100, n /= 100;
84
- 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;
85
- return {
86
- r: P([
87
- n,
88
- o,
89
- a,
90
- a,
91
- s,
92
- n
93
- ][c] * 255),
94
- g: P([
95
- s,
96
- n,
97
- n,
98
- o,
99
- a,
100
- a
101
- ][c] * 255),
102
- b: P([
103
- a,
104
- a,
105
- s,
106
- n,
107
- n,
108
- o
109
- ][c] * 255),
110
- a: P(r, 2)
111
- };
112
- }, B = (e) => {
113
- let t = e.toString(16);
114
- return t.length < 2 ? "0" + t : t;
115
- }, de = ({ r: e, g: t, b: n, a: r }) => {
116
- let i = r < 1 ? B(P(r * 255)) : "";
117
- return "#" + B(e) + B(t) + B(n) + i;
118
- }, fe = ({ r: e, g: t, b: n, a: r }) => {
119
- 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;
120
- return {
121
- h: P(60 * (o < 0 ? o + 6 : o)),
122
- s: P(i ? a / i * 100 : 0),
123
- v: P(i / 255 * 100),
124
- a: r
125
- };
126
- }, V = (e, t) => {
127
- if (e === t) return !0;
128
- for (let n in e) if (e[n] !== t[n]) return !1;
129
- return !0;
130
- }, pe = (e, t) => e.toLowerCase() === t.toLowerCase() || V(I(e), I(t)), H = {}, U = (e) => {
131
- let t = H[e];
132
- return t || (t = document.createElement("template"), t.innerHTML = e, H[e] = t), t;
133
- }, W = (e, t, n) => {
134
- e.dispatchEvent(new CustomEvent(t, {
135
- bubbles: !0,
136
- detail: n
137
- }));
138
- }, G = !1, K = (e) => "touches" in e, me = (e) => G && !K(e) ? !1 : (G ||= K(e), !0), q = (e, t) => {
139
- let n = K(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
140
- W(e.el, "move", e.getMove({
141
- x: N((n.pageX - (r.left + window.pageXOffset)) / r.width),
142
- y: N((n.pageY - (r.top + window.pageYOffset)) / r.height)
143
- }));
144
- }, he = (e, t) => {
145
- let n = t.keyCode;
146
- n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), W(e.el, "move", e.getMove({
147
- x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
148
- y: n === 40 ? .01 : n === 38 ? -.01 : 0
149
- }, !0)));
150
- }, J = class {
151
- constructor(e, t, n, r) {
152
- let i = U(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
153
- e.appendChild(i.content.cloneNode(!0));
154
- let a = e.querySelector(`[part=${t}]`);
155
- a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
156
- }
157
- set dragging(e) {
158
- let t = e ? document.addEventListener : document.removeEventListener;
159
- t(G ? "touchmove" : "mousemove", this), t(G ? "touchend" : "mouseup", this);
160
- }
161
- handleEvent(e) {
162
- switch (e.type) {
163
- case "mousedown":
164
- case "touchstart":
165
- if (e.preventDefault(), !me(e) || !G && e.button != 0) return;
166
- this.el.focus(), q(this, e), this.dragging = !0;
167
- break;
168
- case "mousemove":
169
- case "touchmove":
170
- e.preventDefault(), q(this, e);
171
- break;
172
- case "mouseup":
173
- case "touchend":
174
- this.dragging = !1;
175
- break;
176
- case "keydown":
177
- he(this, e);
178
- break;
179
- }
180
- }
181
- style(e) {
182
- e.forEach((e, t) => {
183
- for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
184
- });
185
- }
186
- }, ge = class extends J {
187
- constructor(e) {
188
- super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
189
- }
190
- update({ h: e }) {
191
- this.h = e, this.style([{
192
- left: `${e / 360 * 100}%`,
193
- color: z({
194
- h: e,
195
- s: 100,
196
- v: 100,
197
- a: 1
198
- })
199
- }]), this.el.setAttribute("aria-valuenow", `${P(e)}`);
200
- }
201
- getMove(e, t) {
202
- return { h: t ? N(this.h + e.x * 360, 0, 360) : 360 * e.x };
203
- }
204
- }, _e = class extends J {
205
- constructor(e) {
206
- super(e, "saturation", "aria-label=\"Color\"", !0);
207
- }
208
- update(e) {
209
- this.hsva = e, this.style([{
210
- top: `${100 - e.v}%`,
211
- left: `${e.s}%`,
212
- color: z(e)
213
- }, { "background-color": z({
214
- h: e.h,
215
- s: 100,
216
- v: 100,
217
- a: 1
218
- }) }]), this.el.setAttribute("aria-valuetext", `Saturation ${P(e.s)}%, Brightness ${P(e.v)}%`);
219
- }
220
- getMove(e, t) {
221
- return {
222
- s: t ? N(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
223
- v: t ? N(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
224
- };
225
- }
226
- }, 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 {
227
- static get observedAttributes() {
228
- return ["color"];
229
- }
230
- get [Se]() {
231
- return [
232
- ve,
233
- ye,
234
- be
235
- ];
236
- }
237
- get [$]() {
238
- return [_e, ge];
239
- }
240
- get color() {
241
- return this[X];
242
- }
243
- set color(e) {
244
- if (!this[Y](e)) {
245
- let t = this.colorModel.toHsva(e);
246
- this[Q](t), this[X] = e;
247
- }
248
- }
249
- constructor() {
250
- super();
251
- let e = U(`<style>${this[Se].join("")}</style>`), t = this.attachShadow({ mode: "open" });
252
- t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[xe] = this[$].map((e) => new e(t));
253
- }
254
- connectedCallback() {
255
- if (this.hasOwnProperty("color")) {
256
- let e = this.color;
257
- delete this.color, this.color = e;
258
- } else this.color ||= this.colorModel.defaultColor;
259
- }
260
- attributeChangedCallback(e, t, n) {
261
- let r = this.colorModel.fromAttr(n);
262
- this[Y](r) || (this.color = r);
263
- }
264
- handleEvent(e) {
265
- let t = this[Z], n = {
266
- ...t,
267
- ...e.detail
268
- };
269
- this[Q](n);
270
- let r;
271
- !V(n, t) && !this[Y](r = this.colorModel.fromHsva(n)) && (this[X] = r, W(this, "color-changed", { value: r }));
272
- }
273
- [Y](e) {
274
- return this.color && this.colorModel.equal(e, this.color);
275
- }
276
- [Q](e) {
277
- this[Z] = e, this[xe].forEach((t) => t.update(e));
278
- }
279
- }, we = {
280
- defaultColor: "#000",
281
- toHsva: F,
282
- fromHsva: ({ h: e, s: t, v: n }) => L({
283
- h: e,
284
- s: t,
285
- v: n,
286
- a: 1
287
- }),
288
- equal: pe,
289
- fromAttr: (e) => e
290
- }, Te = class extends Ce {
291
- get colorModel() {
292
- return we;
293
- }
294
- }, Ee = class extends Te {};
295
- customElements.define("hex-color-picker", Ee);
296
- //#endregion
297
- //#region src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
298
- var De = [
299
- "disabled",
300
- "aria-label",
301
- "title",
302
- "aria-expanded"
303
- ], Oe = {
304
- key: 0,
305
- class: "tpl:relative tpl:flex-1"
306
- }, ke = [
307
- "value",
308
- "placeholder",
309
- "disabled",
310
- "aria-label"
311
- ], Ae = ["aria-label", "title"], je = ["data-tpl-theme"], Me = ["color", "aria-label"], Ne = {
312
- key: 0,
313
- class: "tpl:relative tpl:mt-2"
314
- }, Pe = [
315
- "value",
316
- "placeholder",
317
- "disabled",
318
- "aria-label"
319
- ], Fe = ["aria-label", "title"], Ie = /* @__PURE__ */ a({
320
- __name: "ColorPicker",
321
- props: {
322
- modelValue: {},
323
- placeholder: { default: "" },
324
- seedColor: { default: "#ffffff" },
325
- swatchOnly: {
326
- type: Boolean,
327
- default: !1
328
- },
329
- disabled: {
330
- type: Boolean,
331
- default: !1
332
- },
333
- size: { default: "md" },
334
- ariaLabel: { default: "" }
335
- },
336
- emits: ["update:modelValue"],
337
- setup(a, { emit: g }) {
338
- let _ = a, v = g, { t: y } = le(), x = i(!1), S = i(), C = i(), w = i(!1);
339
- ie(S, () => {
340
- x.value = !1;
341
- }, { ignore: [C] });
342
- let T = u(() => !_.modelValue), E = u(() => m(_.modelValue)), D = u(() => m(_.modelValue || _.seedColor)), O = u(() => !_.disabled && !T.value);
343
- function k(e) {
344
- w.value = !0, v("update:modelValue", e.detail.value);
345
- }
346
- function A() {
347
- w.value = !1;
348
- }
349
- function j() {
350
- !w.value && T.value && v("update:modelValue", D.value);
351
- }
352
- function M(e) {
353
- v("update:modelValue", e.target.value);
354
- }
355
- function N() {
356
- v("update:modelValue", "");
357
- }
358
- let P = ae(), { toLocal: F } = oe(), I = f(se, null), L = f(ce, null), R = i({
359
- top: 0,
360
- left: 0
361
- });
362
- function z() {
363
- if (!_.disabled) {
364
- if (!x.value) {
365
- let e = C.value?.getBoundingClientRect();
366
- if (e) {
367
- let t = e.bottom + 8 + 240 <= window.innerHeight ? e.bottom + 8 : Math.max(8, e.top - 240 - 8);
368
- R.value = F({
369
- top: t,
370
- left: e.left
371
- });
372
- }
373
- }
374
- x.value = !x.value;
375
- }
376
- }
377
- return (i, u) => (n(), s("div", { class: t(["tpl:flex tpl:items-center tpl:gap-2 tpl:relative", a.disabled && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
378
- o("button", {
379
- ref_key: "swatchRef",
380
- ref: C,
381
- type: "button",
382
- disabled: a.disabled,
383
- "aria-label": a.ariaLabel || l(y).colorPicker.pickColor,
384
- title: a.ariaLabel || void 0,
385
- "aria-expanded": x.value,
386
- class: t([
387
- "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)]",
388
- a.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
389
- x.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !a.disabled && "hover:tpl:border-[var(--tpl-text-dim)]",
390
- a.size === "sm" ? "tpl:size-8" : "tpl:size-10"
391
- ]),
392
- onClick: z
393
- }, [o("span", {
394
- class: t(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", { "tpl-color-swatch-empty": T.value }]),
395
- style: e(T.value ? void 0 : { backgroundColor: E.value })
396
- }, null, 6)], 10, De),
397
- a.swatchOnly ? d("", !0) : (n(), s("div", Oe, [o("input", {
398
- type: "text",
399
- class: t([l(b), "tpl:w-full"]),
400
- style: e(O.value ? { paddingRight: "2.25rem" } : void 0),
401
- value: E.value,
402
- placeholder: a.placeholder || l(y).colorPicker.notSet,
403
- disabled: a.disabled,
404
- "aria-label": l(y).colorPicker.hexValue,
405
- onInput: M
406
- }, null, 46, ke), O.value ? (n(), s("button", {
407
- key: 0,
408
- type: "button",
409
- "aria-label": l(y).colorPicker.clear,
410
- title: l(y).colorPicker.clear,
411
- 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)]",
412
- onClick: N
413
- }, [c(l(h), {
414
- size: 14,
415
- "stroke-width": 1.5
416
- })], 8, Ae)) : d("", !0)])),
417
- (n(), te(ee, {
418
- to: l(P),
419
- disabled: !l(P)
420
- }, [c(re, {
421
- "enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
422
- "enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
423
- "enter-to-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
424
- "leave-active-class": "tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
425
- "leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
426
- "leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
427
- }, {
428
- default: r(() => [x.value ? (n(), s("div", {
429
- key: 0,
430
- ref_key: "popoverRef",
431
- ref: S,
432
- "data-tpl-theme": l(L),
433
- 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",
434
- style: e({
435
- top: `${R.value.top}px`,
436
- left: `${R.value.left}px`,
437
- ...l(I)
438
- })
439
- }, [o("hex-color-picker", {
440
- color: D.value,
441
- "aria-label": l(y).colorPicker.pickColor,
442
- onColorChanged: k,
443
- onPointerdown: A,
444
- onPointerup: j,
445
- onKeydown: u[0] ||= p((e) => x.value = !1, ["escape"])
446
- }, null, 40, Me), a.swatchOnly ? (n(), s("div", Ne, [o("input", {
447
- type: "text",
448
- class: t([l(b), "tpl:w-full"]),
449
- style: e(O.value ? { paddingRight: "2.25rem" } : void 0),
450
- value: E.value,
451
- placeholder: a.placeholder || l(y).colorPicker.notSet,
452
- disabled: a.disabled,
453
- "aria-label": l(y).colorPicker.hexValue,
454
- onChange: M,
455
- onKeydown: u[1] ||= p(ne((e) => e.target.blur(), ["prevent"]), ["enter"])
456
- }, null, 46, Pe), O.value ? (n(), s("button", {
457
- key: 0,
458
- type: "button",
459
- "aria-label": l(y).colorPicker.clear,
460
- title: l(y).colorPicker.clear,
461
- 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)]",
462
- onClick: N
463
- }, [c(l(h), {
464
- size: 14,
465
- "stroke-width": 1.5
466
- })], 8, Fe)) : d("", !0)])) : d("", !0)], 12, je)) : d("", !0)]),
467
- _: 1
468
- })], 8, ["to", "disabled"]))
469
- ], 2));
470
- }
471
- });
472
- //#endregion
473
- export { S as _, k as a, D as c, T as d, _ as f, w as g, g as h, M as i, C as l, y as m, A as n, E as o, v as p, j as r, O as s, Ie as t, x as u };