@templatical/editor 0.15.1 → 0.16.1

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 (176) hide show
  1. package/README.md +1 -1
  2. package/dist/{AiChatSidebar-BIKvYREk.js → AiChatSidebar-EaPCeDXr.js} +14 -14
  3. package/dist/{AiFeatureMenu-CU6kTMTf.js → AiFeatureMenu-Rb8G3EBo.js} +7 -7
  4. package/dist/{BlockIssueBadge-B3xVgMTh.js → BlockIssueBadge-CZYgn-qg.js} +5 -5
  5. package/dist/{CloudEditor-DRPxvUEj.js → CloudEditor-D88gLBXp.js} +25 -25
  6. package/dist/{CollaboratorBar-DMSjd3HZ.js → CollaboratorBar-dxCD8jSi.js} +4 -4
  7. package/dist/ColorPicker-CAgMCX3A.js +442 -0
  8. package/dist/{CommentsSidebar-D_tSGvTX.js → CommentsSidebar-DDKiFsSq.js} +13 -13
  9. package/dist/{CountdownBlock-apiYUhkQ.js → CountdownBlock-173fiO5Z.js} +3 -3
  10. package/dist/{CountdownToolbar-CS0axcjz.js → CountdownToolbar-8XVTOuGX.js} +4 -4
  11. package/dist/{DesignReferenceSidebar-DWYK9nTk.js → DesignReferenceSidebar-D6TfC176.js} +11 -11
  12. package/dist/{IssuesPanel-CR1MPaDE.js → IssuesPanel-CQQipLQP.js} +8 -8
  13. package/dist/{LoadingTrack-DsecR8Rw.js → LoadingTrack-KIcREPlS.js} +1 -1
  14. package/dist/{MergeTagSuggestion-CH2SUxBo.js → MergeTagSuggestion-DrT3LiZ4.js} +4 -4
  15. package/dist/{ModuleBrowserModal-BOzleijA.js → ModuleBrowserModal-l4_RCC8m.js} +11 -11
  16. package/dist/{ModulePreviewCanvas-Cg99Pbde.js → ModulePreviewCanvas-BqYAr4fz.js} +3 -3
  17. package/dist/NumberWithSuffix-Di-cDy_m.js +89 -0
  18. package/dist/{ParagraphEditor-8jnzoL0A.js → ParagraphEditor-DIQ1jmSP.js} +230 -195
  19. package/dist/{RichTextEditorContent-BqLHIZY7.js → RichTextEditorContent-DkTJ6KK8.js} +56 -45
  20. package/dist/{SaveModuleDialog-Cy2XyjYT.js → SaveModuleDialog-DPo3Raon.js} +8 -8
  21. package/dist/{SnapshotHistory-cfxmOsJu.js → SnapshotHistory-m7brKV7C.js} +10 -10
  22. package/dist/{TemplateScoringPanel-CZ62rGHz.js → TemplateScoringPanel-C8VOC6gn.js} +15 -15
  23. package/dist/{TestEmailModal-sr1MaMVX.js → TestEmailModal-BE9sFEIl.js} +6 -6
  24. package/dist/{TitleEditor-CvGTprIg.js → TitleEditor-BATN-k-Q.js} +38 -35
  25. package/dist/{TplModal-BtKB-0Bx.js → TplModal-DHBcZ1gq.js} +5 -5
  26. package/dist/{blockTypeIcons-BxEbbev5.js → blockTypeIcons-wRchKKx0.js} +7 -7
  27. package/dist/bundle-stats.json +7 -7
  28. package/dist/ca-B3eR47lE.js +559 -0
  29. package/dist/cdn/chunks/{AiFeatureMenu-fDUpv_-s.js → AiFeatureMenu-W7VQFAwq.js} +6 -6
  30. package/dist/cdn/chunks/{AiFeatureMenu-fDUpv_-s.js.map → AiFeatureMenu-W7VQFAwq.js.map} +1 -1
  31. package/dist/cdn/chunks/{BlockIssueBadge-Byce0j0W.js → BlockIssueBadge-ww2vNIfJ.js} +5 -5
  32. package/dist/cdn/chunks/{BlockIssueBadge-Byce0j0W.js.map → BlockIssueBadge-ww2vNIfJ.js.map} +1 -1
  33. package/dist/cdn/chunks/{CloudEditor-B4m8ldiE.js → CloudEditor-BVSJ1kvB.js} +161 -161
  34. package/dist/cdn/chunks/{CloudEditor-B4m8ldiE.js.map → CloudEditor-BVSJ1kvB.js.map} +1 -1
  35. package/dist/cdn/chunks/{CollaboratorBar-LnLmjxw_.js → CollaboratorBar-BFrAua9a.js} +4 -4
  36. package/dist/cdn/chunks/{CollaboratorBar-LnLmjxw_.js.map → CollaboratorBar-BFrAua9a.js.map} +1 -1
  37. package/dist/cdn/chunks/ColorPicker-DmxMDn-t.js +439 -0
  38. package/dist/cdn/chunks/ColorPicker-DmxMDn-t.js.map +1 -0
  39. package/dist/cdn/chunks/{CountdownBlock-DxTuMRBM.js → CountdownBlock-MC-mhtQD.js} +3 -3
  40. package/dist/cdn/chunks/{CountdownBlock-DxTuMRBM.js.map → CountdownBlock-MC-mhtQD.js.map} +1 -1
  41. package/dist/cdn/chunks/{CountdownToolbar-DUrVfQZH.js → CountdownToolbar-dXyr7tz-.js} +5 -5
  42. package/dist/cdn/chunks/{CountdownToolbar-DUrVfQZH.js.map → CountdownToolbar-dXyr7tz-.js.map} +1 -1
  43. package/dist/cdn/chunks/{IssuesPanel-CHl90k4h.js → IssuesPanel-CTxSgViL.js} +8 -8
  44. package/dist/cdn/chunks/{IssuesPanel-CHl90k4h.js.map → IssuesPanel-CTxSgViL.js.map} +1 -1
  45. package/dist/cdn/chunks/{MergeTagSuggestion-BsCAo4Co.js → MergeTagSuggestion-jesxS7An.js} +3 -3
  46. package/dist/cdn/chunks/{MergeTagSuggestion-BsCAo4Co.js.map → MergeTagSuggestion-jesxS7An.js.map} +1 -1
  47. package/dist/cdn/chunks/{ModuleBrowserModal-DW0iQW0J.js → ModuleBrowserModal-B5sCsrud.js} +9 -9
  48. package/dist/cdn/chunks/{ModuleBrowserModal-DW0iQW0J.js.map → ModuleBrowserModal-B5sCsrud.js.map} +1 -1
  49. package/dist/cdn/chunks/{ModulePreviewCanvas-Cxo8v8t1.js → ModulePreviewCanvas-DGTGo8kg.js} +11 -11
  50. package/dist/cdn/chunks/{ModulePreviewCanvas-Cxo8v8t1.js.map → ModulePreviewCanvas-DGTGo8kg.js.map} +1 -1
  51. package/dist/cdn/chunks/NumberWithSuffix-tAHfui6k.js +91 -0
  52. package/dist/cdn/chunks/NumberWithSuffix-tAHfui6k.js.map +1 -0
  53. package/dist/cdn/chunks/{ParagraphEditor-iG5cDjH0.js → ParagraphEditor-CB5FGRs3.js} +213 -179
  54. package/dist/cdn/chunks/ParagraphEditor-CB5FGRs3.js.map +1 -0
  55. package/dist/cdn/chunks/{RichTextEditorContent-DQpgeGMj.js → RichTextEditorContent-CPelbtck.js} +53 -42
  56. package/dist/cdn/chunks/RichTextEditorContent-CPelbtck.js.map +1 -0
  57. package/dist/cdn/chunks/{SaveModuleDialog-sJQXg2Mh.js → SaveModuleDialog-7f9uUUEC.js} +6 -6
  58. package/dist/cdn/chunks/{SaveModuleDialog-sJQXg2Mh.js.map → SaveModuleDialog-7f9uUUEC.js.map} +1 -1
  59. package/dist/cdn/chunks/{TitleEditor-C8qIn9Oi.js → TitleEditor-C0mYpgs4.js} +46 -43
  60. package/dist/cdn/chunks/TitleEditor-C0mYpgs4.js.map +1 -0
  61. package/dist/cdn/chunks/{blockTypeIcons-DySnOpPo.js → blockTypeIcons-BtxaUtlx.js} +5 -5
  62. package/dist/cdn/chunks/{blockTypeIcons-DySnOpPo.js.map → blockTypeIcons-BtxaUtlx.js.map} +1 -1
  63. package/dist/cdn/chunks/ca-B3eR47lE.js +561 -0
  64. package/dist/cdn/chunks/ca-B3eR47lE.js.map +1 -0
  65. package/dist/cdn/chunks/ca-CNRWAMHI.js +89 -0
  66. package/dist/cdn/chunks/ca-CNRWAMHI.js.map +1 -0
  67. package/dist/{de-LsV0u1tP.js → cdn/chunks/de-Cy8FB-Ii.js} +7 -1
  68. package/dist/cdn/chunks/de-Cy8FB-Ii.js.map +1 -0
  69. package/dist/cdn/chunks/{draggable-kG-D5Xsm.js → draggable-D840DIZB.js} +52 -39
  70. package/dist/cdn/chunks/draggable-D840DIZB.js.map +1 -0
  71. package/dist/{en-Bb8X1bOs.js → cdn/chunks/en-Bu-zS_5o.js} +7 -1
  72. package/dist/cdn/chunks/en-Bu-zS_5o.js.map +1 -0
  73. package/dist/cdn/chunks/es-CD3ZD6hK.js +561 -0
  74. package/dist/cdn/chunks/es-CD3ZD6hK.js.map +1 -0
  75. package/dist/cdn/chunks/es-OgkdMZGX.js +89 -0
  76. package/dist/cdn/chunks/es-OgkdMZGX.js.map +1 -0
  77. package/dist/cdn/chunks/{extensions-C2pTX899.js → extensions-BJ7vaBol.js} +28 -28
  78. package/dist/cdn/chunks/{extensions-C2pTX899.js.map → extensions-BJ7vaBol.js.map} +1 -1
  79. package/dist/cdn/chunks/{features-CHE3YjQE.js → features-CgbSSCgv.js} +602 -566
  80. package/dist/cdn/chunks/features-CgbSSCgv.js.map +1 -0
  81. package/dist/cdn/chunks/{icons-M4uqBV-_.js → icons-Dlx5MT1V.js} +2 -2
  82. package/dist/cdn/chunks/{icons-M4uqBV-_.js.map → icons-Dlx5MT1V.js.map} +1 -1
  83. package/dist/cdn/chunks/{media-library-Bqr15VN2.js → media-library-BMlykZGq.js} +104 -104
  84. package/dist/cdn/chunks/{media-library-Bqr15VN2.js.map → media-library-BMlykZGq.js.map} +1 -1
  85. package/dist/{pt-BR-BwJY_cvb.js → cdn/chunks/pt-BR-CgICL-CQ.js} +7 -1
  86. package/dist/cdn/chunks/pt-BR-CgICL-CQ.js.map +1 -0
  87. package/dist/cdn/chunks/quality-DsVgXk_j.js +2180 -0
  88. package/dist/cdn/chunks/quality-DsVgXk_j.js.map +1 -0
  89. package/dist/cdn/chunks/{renderer-CyzTR1Vq.js → renderer-DPvEtVGO.js} +35 -38
  90. package/dist/cdn/chunks/renderer-DPvEtVGO.js.map +1 -0
  91. package/dist/cdn/chunks/{src-q-SBgWx7.js → src-CAdirukY.js} +109 -112
  92. package/dist/cdn/chunks/{src-q-SBgWx7.js.map → src-CAdirukY.js.map} +1 -1
  93. package/dist/cdn/chunks/{styles-PWISdaws.js → styles-D7u4vCpH.js} +877 -856
  94. package/dist/cdn/chunks/styles-D7u4vCpH.js.map +1 -0
  95. package/dist/cdn/chunks/{tiptap-DF9PEiqH.js → tiptap-zpXk5mN4.js} +3278 -4992
  96. package/dist/cdn/chunks/tiptap-zpXk5mN4.js.map +1 -0
  97. package/dist/cdn/editor.css +1 -1
  98. package/dist/cdn/editor.js +75 -73
  99. package/dist/cdn/editor.js.map +1 -1
  100. package/dist/{check-rl7ok6uJ.js → check-D1zYtCPK.js} +1 -1
  101. package/dist/{chevron-down-BKe__NOD.js → chevron-down-ByXpufZD.js} +1 -1
  102. package/dist/{circle-alert-C8xmpMsK.js → circle-alert-CjcAORUw.js} +1 -1
  103. package/dist/{clock-BW4JuDCN.js → clock-5lWLadUn.js} +1 -1
  104. package/dist/{cloud-BQusL53H.js → cloud-BogxOeZu.js} +2 -2
  105. package/dist/{createLucideIcon-Dx-EjR9r.js → createLucideIcon-Bh9xOmlW.js} +3 -3
  106. package/dist/{cdn/chunks/de-LsV0u1tP.js → de-Cy8FB-Ii.js} +5 -3
  107. package/dist/dist-BE9m_i60.js +5 -0
  108. package/dist/{dist-BFmE-7hB.js → dist-BPPeDw62.js} +2 -2
  109. package/dist/{dist-BsCGIDSt.js → dist-BReUTadj.js} +4 -4
  110. package/dist/dist-BXR1aBJV.js +5 -0
  111. package/dist/{dist-CRsjOQM-.js → dist-Bm07Z3Es.js} +2 -2
  112. package/dist/{dist-BEWiuOMi.js → dist-CFOQvhSC.js} +3 -3
  113. package/dist/{dist-B5Sov3sS.js → dist-CHLoeloJ.js} +2 -2
  114. package/dist/{dist-COG3IdPK.js → dist-D1WmF8BF.js} +2 -2
  115. package/dist/{dist-itdjZraK.js → dist-D9g4CSnm.js} +1 -1
  116. package/dist/{dist-BMoa33wT.js → dist-DGEaAAIb.js} +2 -2
  117. package/dist/{dist-CTT6WYJ6.js → dist-DYv_Pttj.js} +2 -2
  118. package/dist/{dist-CQZxDvFw.js → dist-DcKlLQ8d.js} +2 -2
  119. package/dist/{dist-SXJJ2v41.js → dist-DhY2di4U.js} +2 -2
  120. package/dist/{dist-BibU4HNl.js → dist-DoRIUsfz.js} +2 -3
  121. package/dist/dist-i_Z7t67A.js +2594 -0
  122. package/dist/{cdn/chunks/en-Bb8X1bOs.js → en-Bu-zS_5o.js} +5 -3
  123. package/dist/es-CD3ZD6hK.js +559 -0
  124. package/dist/{extensions-DwaZAqm6.js → extensions-B2poxDIo.js} +8 -8
  125. package/dist/{image-up-BwBCmQ4P.js → image-up-Bj_nes3f.js} +1 -1
  126. package/dist/{info-TCn7uWR5.js → info-BhSQCxBV.js} +1 -1
  127. package/dist/{keys-Cv8-8GsD.js → keys-BbDgCU6K.js} +1 -1
  128. package/dist/{list-checks-CSrOWNgq.js → list-checks-CgxyUg7i.js} +1 -1
  129. package/dist/{loader-circle-BLmicnPG.js → loader-circle-DFU0HPAa.js} +1 -1
  130. package/dist/{message-circle-C9hHMQCI.js → message-circle-BEBsCHnk.js} +1 -1
  131. package/dist/{cdn/chunks/pt-BR-BwJY_cvb.js → pt-BR-CgICL-CQ.js} +5 -3
  132. package/dist/{refresh-cw-D1JQ1LNa.js → refresh-cw--lvWGy0_.js} +1 -1
  133. package/dist/{runtime-dom.esm-bundler-BzuoCyNp.js → runtime-dom.esm-bundler-GdMI8WqG.js} +6 -7
  134. package/dist/{scan-line-DgijVq9y.js → scan-line-QgyDIgn_.js} +1 -1
  135. package/dist/{send-DjPdq69F.js → send-BMyisUim.js} +1 -1
  136. package/dist/{shield-check-Bqluu8FS.js → shield-check-C49M20le.js} +1 -1
  137. package/dist/{sparkles-M4azPVSP.js → sparkles-DV7Dman6.js} +1 -1
  138. package/dist/style.css +1 -1
  139. package/dist/{styles-B2OrgEnn.js → styles-B-yhoJnH.js} +537 -516
  140. package/dist/templatical-editor.js +62 -60
  141. package/dist/{text-align-start-CMya5pCQ.js → text-align-start-BMU70uAm.js} +1 -1
  142. package/dist/{trash-2-C-81rkLS.js → trash-2-B6M659Ey.js} +1 -1
  143. package/dist/{triangle-alert-BuRWnynk.js → triangle-alert-D1lzx6ds.js} +1 -1
  144. package/dist/{upload-CWBIoLd4.js → upload-3A1oZtOR.js} +1 -1
  145. package/dist/{useAliveFlag-CECL_OUb.js → useAliveFlag-C43EhZFY.js} +1 -1
  146. package/dist/{useCloudI18n-AKCy98qD.js → useCloudI18n-WbfVWq5k.js} +2 -2
  147. package/dist/{useEditorCore-DJeOXVxQ.js → useEditorCore-CV1ct_17.js} +628 -591
  148. package/dist/{useI18n-C-TDeJBt.js → useI18n-eR1yVW0v.js} +2 -2
  149. package/dist/{useMergeTag-DSrBY0-2.js → useMergeTag-C3GfSktg.js} +3 -3
  150. package/dist/usePopoverRoot-C1j0D7cc.js +8 -0
  151. package/dist/{vue.runtime.esm-bundler-l0XAqiyv.js → vue.runtime.esm-bundler-B0xoGkDv.js} +84 -70
  152. package/dist/{x-CQSvXnGR.js → x-CG_NV3nP.js} +1 -1
  153. package/package.json +23 -23
  154. package/dist/NumberWithSuffix-CrA6quxx.js +0 -445
  155. package/dist/cdn/chunks/NumberWithSuffix-CnSRmUMK.js +0 -444
  156. package/dist/cdn/chunks/NumberWithSuffix-CnSRmUMK.js.map +0 -1
  157. package/dist/cdn/chunks/ParagraphEditor-iG5cDjH0.js.map +0 -1
  158. package/dist/cdn/chunks/RichTextEditorContent-DQpgeGMj.js.map +0 -1
  159. package/dist/cdn/chunks/TitleEditor-C8qIn9Oi.js.map +0 -1
  160. package/dist/cdn/chunks/de-LsV0u1tP.js.map +0 -1
  161. package/dist/cdn/chunks/draggable-kG-D5Xsm.js.map +0 -1
  162. package/dist/cdn/chunks/en-Bb8X1bOs.js.map +0 -1
  163. package/dist/cdn/chunks/features-CHE3YjQE.js.map +0 -1
  164. package/dist/cdn/chunks/pt-BR-BwJY_cvb.js.map +0 -1
  165. package/dist/cdn/chunks/quality-DJZ_fqc2.js +0 -2176
  166. package/dist/cdn/chunks/quality-DJZ_fqc2.js.map +0 -1
  167. package/dist/cdn/chunks/renderer-CyzTR1Vq.js.map +0 -1
  168. package/dist/cdn/chunks/styleConstants-lGobwiLH.js +0 -57
  169. package/dist/cdn/chunks/styleConstants-lGobwiLH.js.map +0 -1
  170. package/dist/cdn/chunks/styles-PWISdaws.js.map +0 -1
  171. package/dist/cdn/chunks/tiptap-DF9PEiqH.js.map +0 -1
  172. package/dist/dist-CNLKj9wa.js +0 -5
  173. package/dist/dist-CNXDNYQn.js +0 -4311
  174. package/dist/dist-Cqa6aeAJ.js +0 -5
  175. package/dist/styleConstants-lGobwiLH.js +0 -55
  176. package/dist/usePopoverRoot-DKUDnr55.js +0 -8
@@ -1,445 +0,0 @@
1
- import { A as e, Dt as t, Et as n, N as r, O as i, Ot as a, R as o, Y as s, _ as c, c as l, d as u, h as d, j as f, l as p, nt as m, r as h, s as g, u as _ } from "./vue.runtime.esm-bundler-l0XAqiyv.js";
2
- import { s as v, t as y } from "./runtime-dom.esm-bundler-BzuoCyNp.js";
3
- import { t as b } from "./dist-BEWiuOMi.js";
4
- import { t as ee } from "./useI18n-C-TDeJBt.js";
5
- import { t as te } from "./x-CQSvXnGR.js";
6
- import { h as x, m as S, p as C, u as ne } from "./styleConstants-lGobwiLH.js";
7
- //#region ../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/utils/math.js
8
- var w = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, T = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n;
9
- 360 / (Math.PI * 2);
10
- var E = (e) => ae(D(e)), D = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
11
- r: parseInt(e[0] + e[0], 16),
12
- g: parseInt(e[1] + e[1], 16),
13
- b: parseInt(e[2] + e[2], 16),
14
- a: e.length === 4 ? T(parseInt(e[3] + e[3], 16) / 255, 2) : 1
15
- } : {
16
- r: parseInt(e.substring(0, 2), 16),
17
- g: parseInt(e.substring(2, 4), 16),
18
- b: parseInt(e.substring(4, 6), 16),
19
- a: e.length === 8 ? T(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
20
- }), O = (e) => ie(re(e)), k = ({ h: e, s: t, v: n, a: r }) => {
21
- let i = (200 - t) * n / 100;
22
- return {
23
- h: T(e),
24
- s: T(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
25
- l: T(i / 2),
26
- a: T(r, 2)
27
- };
28
- }, A = (e) => {
29
- let { h: t, s: n, l: r } = k(e);
30
- return `hsl(${t}, ${n}%, ${r}%)`;
31
- }, re = ({ h: e, s: t, v: n, a: r }) => {
32
- e = e / 360 * 6, t /= 100, n /= 100;
33
- 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;
34
- return {
35
- r: T([
36
- n,
37
- o,
38
- a,
39
- a,
40
- s,
41
- n
42
- ][c] * 255),
43
- g: T([
44
- s,
45
- n,
46
- n,
47
- o,
48
- a,
49
- a
50
- ][c] * 255),
51
- b: T([
52
- a,
53
- a,
54
- s,
55
- n,
56
- n,
57
- o
58
- ][c] * 255),
59
- a: T(r, 2)
60
- };
61
- }, j = (e) => {
62
- let t = e.toString(16);
63
- return t.length < 2 ? "0" + t : t;
64
- }, ie = ({ r: e, g: t, b: n, a: r }) => {
65
- let i = r < 1 ? j(T(r * 255)) : "";
66
- return "#" + j(e) + j(t) + j(n) + i;
67
- }, ae = ({ r: e, g: t, b: n, a: r }) => {
68
- 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;
69
- return {
70
- h: T(60 * (o < 0 ? o + 6 : o)),
71
- s: T(i ? a / i * 100 : 0),
72
- v: T(i / 255 * 100),
73
- a: r
74
- };
75
- }, M = (e, t) => {
76
- if (e === t) return !0;
77
- for (let n in e) if (e[n] !== t[n]) return !1;
78
- return !0;
79
- }, N = (e, t) => e.toLowerCase() === t.toLowerCase() || M(D(e), D(t)), P = {}, F = (e) => {
80
- let t = P[e];
81
- return t || (t = document.createElement("template"), t.innerHTML = e, P[e] = t), t;
82
- }, I = (e, t, n) => {
83
- e.dispatchEvent(new CustomEvent(t, {
84
- bubbles: !0,
85
- detail: n
86
- }));
87
- }, L = !1, R = (e) => "touches" in e, oe = (e) => L && !R(e) ? !1 : (L ||= R(e), !0), z = (e, t) => {
88
- let n = R(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
89
- I(e.el, "move", e.getMove({
90
- x: w((n.pageX - (r.left + window.pageXOffset)) / r.width),
91
- y: w((n.pageY - (r.top + window.pageYOffset)) / r.height)
92
- }));
93
- }, B = (e, t) => {
94
- let n = t.keyCode;
95
- n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), I(e.el, "move", e.getMove({
96
- x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
97
- y: n === 40 ? .01 : n === 38 ? -.01 : 0
98
- }, !0)));
99
- }, V = class {
100
- constructor(e, t, n, r) {
101
- let i = F(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
102
- e.appendChild(i.content.cloneNode(!0));
103
- let a = e.querySelector(`[part=${t}]`);
104
- a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
105
- }
106
- set dragging(e) {
107
- let t = e ? document.addEventListener : document.removeEventListener;
108
- t(L ? "touchmove" : "mousemove", this), t(L ? "touchend" : "mouseup", this);
109
- }
110
- handleEvent(e) {
111
- switch (e.type) {
112
- case "mousedown":
113
- case "touchstart":
114
- if (e.preventDefault(), !oe(e) || !L && e.button != 0) return;
115
- this.el.focus(), z(this, e), this.dragging = !0;
116
- break;
117
- case "mousemove":
118
- case "touchmove":
119
- e.preventDefault(), z(this, e);
120
- break;
121
- case "mouseup":
122
- case "touchend":
123
- this.dragging = !1;
124
- break;
125
- case "keydown":
126
- B(this, e);
127
- break;
128
- }
129
- }
130
- style(e) {
131
- e.forEach((e, t) => {
132
- for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
133
- });
134
- }
135
- }, H = class extends V {
136
- constructor(e) {
137
- super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
138
- }
139
- update({ h: e }) {
140
- this.h = e, this.style([{
141
- left: `${e / 360 * 100}%`,
142
- color: A({
143
- h: e,
144
- s: 100,
145
- v: 100,
146
- a: 1
147
- })
148
- }]), this.el.setAttribute("aria-valuenow", `${T(e)}`);
149
- }
150
- getMove(e, t) {
151
- return { h: t ? w(this.h + e.x * 360, 0, 360) : 360 * e.x };
152
- }
153
- }, U = class extends V {
154
- constructor(e) {
155
- super(e, "saturation", "aria-label=\"Color\"", !0);
156
- }
157
- update(e) {
158
- this.hsva = e, this.style([{
159
- top: `${100 - e.v}%`,
160
- left: `${e.s}%`,
161
- color: A(e)
162
- }, { "background-color": A({
163
- h: e.h,
164
- s: 100,
165
- v: 100,
166
- a: 1
167
- }) }]), this.el.setAttribute("aria-valuetext", `Saturation ${T(e.s)}%, Brightness ${T(e.v)}%`);
168
- }
169
- getMove(e, t) {
170
- return {
171
- s: t ? w(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
172
- v: t ? w(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
173
- };
174
- }
175
- }, W = ":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)}", G = "[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}", K = "[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}", q = Symbol("same"), J = Symbol("color"), Y = Symbol("hsva"), X = Symbol("update"), Z = Symbol("parts"), Q = Symbol("css"), $ = Symbol("sliders"), se = class extends HTMLElement {
176
- static get observedAttributes() {
177
- return ["color"];
178
- }
179
- get [Q]() {
180
- return [
181
- W,
182
- G,
183
- K
184
- ];
185
- }
186
- get [$]() {
187
- return [U, H];
188
- }
189
- get color() {
190
- return this[J];
191
- }
192
- set color(e) {
193
- if (!this[q](e)) {
194
- let t = this.colorModel.toHsva(e);
195
- this[X](t), this[J] = e;
196
- }
197
- }
198
- constructor() {
199
- super();
200
- let e = F(`<style>${this[Q].join("")}</style>`), t = this.attachShadow({ mode: "open" });
201
- t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[Z] = this[$].map((e) => new e(t));
202
- }
203
- connectedCallback() {
204
- if (this.hasOwnProperty("color")) {
205
- let e = this.color;
206
- delete this.color, this.color = e;
207
- } else this.color ||= this.colorModel.defaultColor;
208
- }
209
- attributeChangedCallback(e, t, n) {
210
- let r = this.colorModel.fromAttr(n);
211
- this[q](r) || (this.color = r);
212
- }
213
- handleEvent(e) {
214
- let t = this[Y], n = {
215
- ...t,
216
- ...e.detail
217
- };
218
- this[X](n);
219
- let r;
220
- !M(n, t) && !this[q](r = this.colorModel.fromHsva(n)) && (this[J] = r, I(this, "color-changed", { value: r }));
221
- }
222
- [q](e) {
223
- return this.color && this.colorModel.equal(e, this.color);
224
- }
225
- [X](e) {
226
- this[Y] = e, this[Z].forEach((t) => t.update(e));
227
- }
228
- }, ce = {
229
- defaultColor: "#000",
230
- toHsva: E,
231
- fromHsva: ({ h: e, s: t, v: n }) => O({
232
- h: e,
233
- s: t,
234
- v: n,
235
- a: 1
236
- }),
237
- equal: N,
238
- fromAttr: (e) => e
239
- }, le = class extends se {
240
- get colorModel() {
241
- return ce;
242
- }
243
- }, ue = class extends le {};
244
- customElements.define("hex-color-picker", ue);
245
- //#endregion
246
- //#region src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
247
- var de = [
248
- "disabled",
249
- "aria-label",
250
- "aria-expanded"
251
- ], fe = {
252
- key: 0,
253
- class: "tpl:relative tpl:flex-1"
254
- }, pe = [
255
- "value",
256
- "placeholder",
257
- "disabled",
258
- "aria-label"
259
- ], me = ["aria-label", "title"], he = ["color", "aria-label"], ge = /* @__PURE__ */ c({
260
- __name: "ColorPicker",
261
- props: {
262
- modelValue: {},
263
- placeholder: { default: "" },
264
- seedColor: { default: "#ffffff" },
265
- swatchOnly: {
266
- type: Boolean,
267
- default: !1
268
- },
269
- disabled: {
270
- type: Boolean,
271
- default: !1
272
- }
273
- },
274
- emits: ["update:modelValue"],
275
- setup(e, { emit: r }) {
276
- let a = e, c = r, { t: f } = ee(), p = s(!1), h = s(), x = s(), S = s(!1);
277
- b(h, () => {
278
- p.value = !1;
279
- }, { ignore: [x] });
280
- let C = g(() => !a.modelValue), w = g(() => a.modelValue || a.seedColor), T = g(() => !a.swatchOnly && !a.disabled && !C.value);
281
- function E(e) {
282
- S.value = !0, c("update:modelValue", e.detail.value);
283
- }
284
- function D() {
285
- S.value = !1;
286
- }
287
- function O() {
288
- !S.value && C.value && c("update:modelValue", w.value);
289
- }
290
- function k(e) {
291
- c("update:modelValue", e.target.value);
292
- }
293
- function A() {
294
- c("update:modelValue", "");
295
- }
296
- return (r, a) => (i(), u("div", { class: n(["tpl:flex tpl:items-center tpl:gap-2 tpl:relative", e.disabled && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
297
- l("button", {
298
- ref_key: "swatchRef",
299
- ref: x,
300
- type: "button",
301
- disabled: e.disabled,
302
- "aria-label": m(f).colorPicker.pickColor,
303
- "aria-expanded": p.value,
304
- class: n([
305
- "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)]",
306
- e.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
307
- p.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !e.disabled && "hover:tpl:border-[var(--tpl-text-dim)]",
308
- "tpl:size-10"
309
- ]),
310
- onClick: a[0] ||= (t) => !e.disabled && (p.value = !p.value)
311
- }, [l("span", {
312
- class: n(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", { "tpl-color-swatch-empty": C.value }]),
313
- style: t(C.value ? void 0 : { backgroundColor: e.modelValue })
314
- }, null, 6)], 10, de),
315
- e.swatchOnly ? _("", !0) : (i(), u("div", fe, [l("input", {
316
- type: "text",
317
- class: n([m(ne), "tpl:w-full"]),
318
- style: t(T.value ? { paddingRight: "2.25rem" } : void 0),
319
- value: e.modelValue,
320
- placeholder: e.placeholder || m(f).colorPicker.notSet,
321
- disabled: e.disabled,
322
- "aria-label": m(f).colorPicker.hexValue,
323
- onInput: k
324
- }, null, 46, pe), T.value ? (i(), u("button", {
325
- key: 0,
326
- type: "button",
327
- "aria-label": m(f).colorPicker.clear,
328
- title: m(f).colorPicker.clear,
329
- 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)]",
330
- onClick: A
331
- }, [d(m(te), {
332
- size: 14,
333
- "stroke-width": 1.5
334
- })], 8, me)) : _("", !0)])),
335
- d(y, {
336
- "enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
337
- "enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
338
- "enter-to-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
339
- "leave-active-class": "tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
340
- "leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
341
- "leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
342
- }, {
343
- default: o(() => [p.value ? (i(), u("div", {
344
- key: 0,
345
- ref_key: "popoverRef",
346
- ref: h,
347
- class: "tpl:absolute tpl:left-0 tpl:top-full tpl:z-50 tpl:mt-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-3 tpl:shadow-lg"
348
- }, [l("hex-color-picker", {
349
- color: w.value,
350
- "aria-label": m(f).colorPicker.pickColor,
351
- onColorChanged: E,
352
- onPointerdown: D,
353
- onPointerup: O,
354
- onKeydown: a[1] ||= v((e) => p.value = !1, ["escape"])
355
- }, null, 40, he)], 512)) : _("", !0)]),
356
- _: 1
357
- })
358
- ], 2));
359
- }
360
- }), _e = [
361
- "aria-checked",
362
- "aria-label",
363
- "title",
364
- "onClick"
365
- ], ve = { key: 1 }, ye = /* @__PURE__ */ c({
366
- __name: "SlidingPillSelect",
367
- props: {
368
- options: {},
369
- modelValue: {}
370
- },
371
- emits: ["update:modelValue"],
372
- setup(n, { emit: o }) {
373
- let s = n, c = o, l = g(() => s.options.findIndex((e) => e.value === s.modelValue)), d = g(() => `translateX(${Math.max(l.value, 0) * 100}%)`);
374
- return (o, s) => (i(), u("div", {
375
- role: "radiogroup",
376
- class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
377
- style: t({
378
- gridTemplateColumns: `repeat(${n.options.length}, 1fr)`,
379
- backgroundColor: "var(--tpl-bg-hover)"
380
- })
381
- }, [l.value >= 0 ? (i(), u("div", {
382
- key: 0,
383
- class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
384
- style: t({
385
- left: "4px",
386
- width: `calc((100% - 8px) / ${n.options.length})`,
387
- transform: d.value,
388
- backgroundColor: "var(--tpl-bg)",
389
- boxShadow: "var(--tpl-shadow)",
390
- transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
391
- })
392
- }, null, 4)) : _("", !0), (i(!0), u(h, null, e(n.options, (e) => (i(), u("button", {
393
- key: e.value,
394
- role: "radio",
395
- "aria-checked": n.modelValue === e.value,
396
- "aria-label": e.label,
397
- class: "tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:py-[5px] tpl:text-xs tpl:font-medium",
398
- style: t({
399
- color: n.modelValue === e.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
400
- transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
401
- }),
402
- title: e.label,
403
- onClick: (t) => c("update:modelValue", e.value)
404
- }, [e.icon ? (i(), p(r(e.icon), {
405
- key: 0,
406
- size: 14,
407
- "stroke-width": 2
408
- })) : (i(), u("span", ve, a(e.label), 1))], 12, _e))), 128))], 4));
409
- }
410
- }), be = { class: "tpl:mb-3.5" }, xe = /* @__PURE__ */ c({
411
- __name: "FieldRow",
412
- props: { label: {} },
413
- setup(e) {
414
- return (t, r) => (i(), u("div", be, [e.label ? (i(), u("label", {
415
- key: 0,
416
- class: n(m(x))
417
- }, a(e.label), 3)) : _("", !0), f(t.$slots, "default")]));
418
- }
419
- }), Se = { class: "tpl:flex tpl:items-stretch" }, Ce = [
420
- "value",
421
- "min",
422
- "max"
423
- ], we = /* @__PURE__ */ c({
424
- __name: "NumberWithSuffix",
425
- props: {
426
- modelValue: {},
427
- min: {},
428
- max: {},
429
- suffix: {}
430
- },
431
- emits: ["update:modelValue"],
432
- setup(e, { emit: t }) {
433
- let r = t;
434
- return (t, o) => (i(), u("div", Se, [l("input", {
435
- type: "number",
436
- class: n(m(C)),
437
- value: e.modelValue,
438
- min: e.min,
439
- max: e.max,
440
- onInput: o[0] ||= (e) => r("update:modelValue", Number(e.target.value))
441
- }, null, 42, Ce), l("span", { class: n(m(S)) }, a(e.suffix), 3)]));
442
- }
443
- });
444
- //#endregion
445
- export { ge as i, xe as n, ye as r, we as t };