@aswin.dev/editor 0.6.3 → 0.7.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 (158) hide show
  1. package/dist/AccessibilityPanel-CvQGLdu6.js +108 -0
  2. package/dist/AiChatSidebar-B3SJIKG_.js +229 -0
  3. package/dist/AiFeatureMenu-BLLKoOos.js +63 -0
  4. package/dist/BlockA11yBadge-CXDLqkcJ.js +34 -0
  5. package/dist/CloudEditor-BCz1ZTYC.js +1172 -0
  6. package/dist/CollaboratorBar-DuPYW5iF.js +95 -0
  7. package/dist/CommentsSidebar-B1pvJdqF.js +441 -0
  8. package/dist/CountdownBlock-BNSj1jvJ.js +92 -0
  9. package/dist/CountdownToolbar-ClJr2GzL.js +210 -0
  10. package/dist/DesignReferenceSidebar-B8V_F2yF.js +276 -0
  11. package/dist/LoadingTrack-B0CWFHXQ.js +10 -0
  12. package/dist/ModuleBrowserModal-DrUFMTDx.js +206 -0
  13. package/dist/ModulePreviewCanvas-CHdOwV_4.js +106 -0
  14. package/dist/NumberWithSuffix-DkXUez9t.js +422 -0
  15. package/dist/ParagraphEditor-D75wl3BX.js +695 -0
  16. package/dist/RichTextEditorContent-DYkIauIk.js +137 -0
  17. package/dist/SaveModuleDialog-FZ9lxY7_.js +123 -0
  18. package/dist/SnapshotHistory-BR3eV120.js +127 -0
  19. package/dist/TemplateScoringPanel-4GTNHej5.js +256 -0
  20. package/dist/TestEmailModal--ue5w9fT.js +94 -0
  21. package/dist/TitleEditor-fStSADI-.js +172 -0
  22. package/dist/TplModal-BwSfxIHf.js +44 -0
  23. package/dist/_plugin-vue_export-helper-B0hnzhyu.js +8 -0
  24. package/dist/accessibility-e8JYu_zd.js +27 -0
  25. package/dist/blockTypeIcons-BcTrDjmH.js +126 -0
  26. package/dist/bundle-stats.json +10 -0
  27. package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js +97 -0
  28. package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js.map +1 -0
  29. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js +59 -0
  30. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +1 -0
  31. package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js +33 -0
  32. package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js.map +1 -0
  33. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +1143 -0
  34. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +1 -0
  35. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js +51 -0
  36. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +1 -0
  37. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +93 -0
  38. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +1 -0
  39. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +212 -0
  40. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +1 -0
  41. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +195 -0
  42. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +1 -0
  43. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +107 -0
  44. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +1 -0
  45. package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js +423 -0
  46. package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js.map +1 -0
  47. package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js +544 -0
  48. package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js.map +1 -0
  49. package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js +106 -0
  50. package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js.map +1 -0
  51. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js +119 -0
  52. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +1 -0
  53. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js +171 -0
  54. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +1 -0
  55. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +22 -0
  56. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +1 -0
  57. package/dist/cdn/chunks/de-Ce-LbJ2J.js +89 -0
  58. package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +1 -0
  59. package/dist/cdn/chunks/de-D8CnZxV9.js +523 -0
  60. package/dist/cdn/chunks/de-D8CnZxV9.js.map +1 -0
  61. package/dist/cdn/chunks/de-RQrZR56a.js +209 -0
  62. package/dist/cdn/chunks/de-RQrZR56a.js.map +1 -0
  63. package/dist/cdn/chunks/draggable-Bcb86AsV.js +11572 -0
  64. package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
  65. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +19 -0
  66. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +1 -0
  67. package/dist/cdn/chunks/en-8FHaQv4V.js +523 -0
  68. package/dist/cdn/chunks/en-8FHaQv4V.js.map +1 -0
  69. package/dist/cdn/chunks/en-Bl1ecfRF.js +209 -0
  70. package/dist/cdn/chunks/en-Bl1ecfRF.js.map +1 -0
  71. package/dist/cdn/chunks/en-DiCWK5fG.js +89 -0
  72. package/dist/cdn/chunks/en-DiCWK5fG.js.map +1 -0
  73. package/dist/cdn/chunks/extensions-DIxF31tA.js +598 -0
  74. package/dist/cdn/chunks/extensions-DIxF31tA.js.map +1 -0
  75. package/dist/cdn/chunks/features-DEMb13KS.js +6814 -0
  76. package/dist/cdn/chunks/features-DEMb13KS.js.map +1 -0
  77. package/dist/cdn/chunks/icons-CsLTcirh.js +700 -0
  78. package/dist/cdn/chunks/icons-CsLTcirh.js.map +1 -0
  79. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +3279 -0
  80. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +1 -0
  81. package/dist/cdn/chunks/media-library-CVaNvhpM.js +6014 -0
  82. package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +1 -0
  83. package/dist/cdn/chunks/pusher-CDbNlZBE.js +2508 -0
  84. package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +1 -0
  85. package/dist/cdn/chunks/quality-BaBfc54_.js +1456 -0
  86. package/dist/cdn/chunks/quality-BaBfc54_.js.map +1 -0
  87. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
  88. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
  89. package/dist/cdn/chunks/renderer-CUxvx7ro.js +548 -0
  90. package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +1 -0
  91. package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
  92. package/dist/cdn/chunks/src-CRaqN-p8.js +497 -0
  93. package/dist/cdn/chunks/src-CRaqN-p8.js.map +1 -0
  94. package/dist/cdn/chunks/styleConstants-DP1VOca8.js +57 -0
  95. package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +1 -0
  96. package/dist/cdn/chunks/styles-BHJULjNR.js +2947 -0
  97. package/dist/cdn/chunks/styles-BHJULjNR.js.map +1 -0
  98. package/dist/cdn/chunks/tiptap-ZhwKyFp7.js +14654 -0
  99. package/dist/cdn/chunks/tiptap-ZhwKyFp7.js.map +1 -0
  100. package/dist/cdn/editor.css +2 -0
  101. package/dist/cdn/editor.js +250 -0
  102. package/dist/cdn/editor.js.map +1 -0
  103. package/dist/check-Da05j8yl.js +7 -0
  104. package/dist/chevron-down-R2uY34iD.js +7 -0
  105. package/dist/circle-alert-DZuGWPX-.js +25 -0
  106. package/dist/clock-CRp2sIub.js +12 -0
  107. package/dist/cloud-DEk_b4CR.js +1733 -0
  108. package/dist/createLucideIcon-C3pa2siy.js +43 -0
  109. package/dist/de-Brqvgr43.js +521 -0
  110. package/dist/de-DCaaCE5s.js +207 -0
  111. package/dist/dist-B1IR0bpH.js +326 -0
  112. package/dist/dist-BFawx6IS.js +519 -0
  113. package/dist/dist-BaQIYPsn.js +35 -0
  114. package/dist/dist-Cp0zXPAD.js +189 -0
  115. package/dist/dist-D6uC2xhi.js +5 -0
  116. package/dist/dist-D90y8dvT.js +2082 -0
  117. package/dist/dist-DDJIWTRY.js +776 -0
  118. package/dist/dist-DJmnUmW9.js +362 -0
  119. package/dist/dist-DjviJBCi.js +74 -0
  120. package/dist/dist-KoBJjK1G.js +61 -0
  121. package/dist/dist-aRzjfSRN.js +35 -0
  122. package/dist/dist-iLBdeBDR.js +10658 -0
  123. package/dist/dist-us-RpCWN.js +47 -0
  124. package/dist/dist-wzMIGj-D.js +5 -0
  125. package/dist/emojiData-PQyVa4bU.js +17 -0
  126. package/dist/en-DXCyK4-X.js +207 -0
  127. package/dist/en-WDVp87TE.js +521 -0
  128. package/dist/extensions-CUcl9Ok4.js +799 -0
  129. package/dist/formatRelativeTime-BOEf47hq.js +12 -0
  130. package/dist/image-up-MBZKKg9p.js +23 -0
  131. package/dist/index.d.ts +275 -0
  132. package/dist/info-CJEC7piy.js +19 -0
  133. package/dist/keys-ciNfSSGj.js +10 -0
  134. package/dist/liquid.browser-CdMv1BTn.js +3277 -0
  135. package/dist/loader-circle-DsY5Yg33.js +7 -0
  136. package/dist/message-circle-yElBbR2C.js +7 -0
  137. package/dist/readableTextColor-CY3SiRnt.js +30 -0
  138. package/dist/refresh-cw-CE_AGtn8.js +29 -0
  139. package/dist/rolldown-runtime-BZGGJVDF.js +20 -0
  140. package/dist/scan-line-D0vcUekt.js +25 -0
  141. package/dist/send-DH4oDQqC.js +10 -0
  142. package/dist/shield-check-CfJgs2Hd.js +10 -0
  143. package/dist/sparkles-CvRXGqFs.js +23 -0
  144. package/dist/style.css +2 -0
  145. package/dist/styleConstants-fWzlIIwN.js +55 -0
  146. package/dist/styles-DEXEkBvg.js +3176 -0
  147. package/dist/templatical-editor.js +249 -0
  148. package/dist/text-align-start-BT9VUDxK.js +43 -0
  149. package/dist/timeouts-BSGxjuUF.js +4 -0
  150. package/dist/trash-2-DbP2Y6t2.js +25 -0
  151. package/dist/triangle-alert-aOXceTSe.js +17 -0
  152. package/dist/useCloudI18n-BuIwR6OE.js +23 -0
  153. package/dist/useEditorCore-C6ost42Q.js +9342 -0
  154. package/dist/useI18n-lb2DHDiu.js +17 -0
  155. package/dist/useMergeTag-CBwKnnNB.js +34 -0
  156. package/dist/vue.runtime.esm-bundler-DpvJL-nX.js +5775 -0
  157. package/dist/x-u2oVmjN_.js +10 -0
  158. package/package.json +1 -1
@@ -0,0 +1,422 @@
1
+ import { Dt as e, F as t, L as n, M as r, Mt as i, Ot as a, P as o, Q as s, S as c, V as l, _ as u, b as d, d as f, g as p, h as m, it as h, l as ee, m as g, p as _, t as v } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
2
+ import { t as y } from "./dist-B1IR0bpH.js";
3
+ import { t as te } from "./useI18n-lb2DHDiu.js";
4
+ import { h as b, i as x, m as S, p as C, u as ne } from "./styleConstants-fWzlIIwN.js";
5
+ //#region ../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/utils/math.js
6
+ 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;
7
+ 360 / (Math.PI * 2);
8
+ var re = (e) => oe(E(e)), E = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
9
+ r: parseInt(e[0] + e[0], 16),
10
+ g: parseInt(e[1] + e[1], 16),
11
+ b: parseInt(e[2] + e[2], 16),
12
+ a: e.length === 4 ? T(parseInt(e[3] + e[3], 16) / 255, 2) : 1
13
+ } : {
14
+ r: parseInt(e.substring(0, 2), 16),
15
+ g: parseInt(e.substring(2, 4), 16),
16
+ b: parseInt(e.substring(4, 6), 16),
17
+ a: e.length === 8 ? T(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
18
+ }), D = (e) => ae(k(e)), ie = ({ h: e, s: t, v: n, a: r }) => {
19
+ let i = (200 - t) * n / 100;
20
+ return {
21
+ h: T(e),
22
+ s: T(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
23
+ l: T(i / 2),
24
+ a: T(r, 2)
25
+ };
26
+ }, O = (e) => {
27
+ let { h: t, s: n, l: r } = ie(e);
28
+ return `hsl(${t}, ${n}%, ${r}%)`;
29
+ }, k = ({ h: e, s: t, v: n, a: r }) => {
30
+ e = e / 360 * 6, t /= 100, n /= 100;
31
+ 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;
32
+ return {
33
+ r: T([
34
+ n,
35
+ o,
36
+ a,
37
+ a,
38
+ s,
39
+ n
40
+ ][c] * 255),
41
+ g: T([
42
+ s,
43
+ n,
44
+ n,
45
+ o,
46
+ a,
47
+ a
48
+ ][c] * 255),
49
+ b: T([
50
+ a,
51
+ a,
52
+ s,
53
+ n,
54
+ n,
55
+ o
56
+ ][c] * 255),
57
+ a: T(r, 2)
58
+ };
59
+ }, A = (e) => {
60
+ let t = e.toString(16);
61
+ return t.length < 2 ? "0" + t : t;
62
+ }, ae = ({ r: e, g: t, b: n, a: r }) => {
63
+ let i = r < 1 ? A(T(r * 255)) : "";
64
+ return "#" + A(e) + A(t) + A(n) + i;
65
+ }, oe = ({ r: e, g: t, b: n, a: r }) => {
66
+ 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;
67
+ return {
68
+ h: T(60 * (o < 0 ? o + 6 : o)),
69
+ s: T(i ? a / i * 100 : 0),
70
+ v: T(i / 255 * 100),
71
+ a: r
72
+ };
73
+ }, j = (e, t) => {
74
+ if (e === t) return !0;
75
+ for (let n in e) if (e[n] !== t[n]) return !1;
76
+ return !0;
77
+ }, M = (e, t) => e.toLowerCase() === t.toLowerCase() ? !0 : j(E(e), E(t)), N = {}, P = (e) => {
78
+ let t = N[e];
79
+ return t || (t = document.createElement("template"), t.innerHTML = e, N[e] = t), t;
80
+ }, F = (e, t, n) => {
81
+ e.dispatchEvent(new CustomEvent(t, {
82
+ bubbles: !0,
83
+ detail: n
84
+ }));
85
+ }, I = !1, L = (e) => "touches" in e, R = (e) => I && !L(e) ? !1 : (I ||= L(e), !0), z = (e, t) => {
86
+ let n = L(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
87
+ F(e.el, "move", e.getMove({
88
+ x: w((n.pageX - (r.left + window.pageXOffset)) / r.width),
89
+ y: w((n.pageY - (r.top + window.pageYOffset)) / r.height)
90
+ }));
91
+ }, B = (e, t) => {
92
+ let n = t.keyCode;
93
+ n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), F(e.el, "move", e.getMove({
94
+ x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
95
+ y: n === 40 ? .01 : n === 38 ? -.01 : 0
96
+ }, !0)));
97
+ }, V = class {
98
+ constructor(e, t, n, r) {
99
+ let i = P(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
100
+ e.appendChild(i.content.cloneNode(!0));
101
+ let a = e.querySelector(`[part=${t}]`);
102
+ a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
103
+ }
104
+ set dragging(e) {
105
+ let t = e ? document.addEventListener : document.removeEventListener;
106
+ t(I ? "touchmove" : "mousemove", this), t(I ? "touchend" : "mouseup", this);
107
+ }
108
+ handleEvent(e) {
109
+ switch (e.type) {
110
+ case "mousedown":
111
+ case "touchstart":
112
+ if (e.preventDefault(), !R(e) || !I && e.button != 0) return;
113
+ this.el.focus(), z(this, e), this.dragging = !0;
114
+ break;
115
+ case "mousemove":
116
+ case "touchmove":
117
+ e.preventDefault(), z(this, e);
118
+ break;
119
+ case "mouseup":
120
+ case "touchend":
121
+ this.dragging = !1;
122
+ break;
123
+ case "keydown":
124
+ B(this, e);
125
+ break;
126
+ }
127
+ }
128
+ style(e) {
129
+ e.forEach((e, t) => {
130
+ for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
131
+ });
132
+ }
133
+ }, H = class extends V {
134
+ constructor(e) {
135
+ super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
136
+ }
137
+ update({ h: e }) {
138
+ this.h = e, this.style([{
139
+ left: `${e / 360 * 100}%`,
140
+ color: O({
141
+ h: e,
142
+ s: 100,
143
+ v: 100,
144
+ a: 1
145
+ })
146
+ }]), this.el.setAttribute("aria-valuenow", `${T(e)}`);
147
+ }
148
+ getMove(e, t) {
149
+ return { h: t ? w(this.h + e.x * 360, 0, 360) : 360 * e.x };
150
+ }
151
+ }, U = class extends V {
152
+ constructor(e) {
153
+ super(e, "saturation", "aria-label=\"Color\"", !0);
154
+ }
155
+ update(e) {
156
+ this.hsva = e, this.style([{
157
+ top: `${100 - e.v}%`,
158
+ left: `${e.s}%`,
159
+ color: O(e)
160
+ }, { "background-color": O({
161
+ h: e.h,
162
+ s: 100,
163
+ v: 100,
164
+ a: 1
165
+ }) }]), this.el.setAttribute("aria-valuetext", `Saturation ${T(e.s)}%, Brightness ${T(e.v)}%`);
166
+ }
167
+ getMove(e, t) {
168
+ return {
169
+ s: t ? w(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
170
+ v: t ? w(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
171
+ };
172
+ }
173
+ }, 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 {
174
+ static get observedAttributes() {
175
+ return ["color"];
176
+ }
177
+ get [Q]() {
178
+ return [
179
+ W,
180
+ G,
181
+ K
182
+ ];
183
+ }
184
+ get [$]() {
185
+ return [U, H];
186
+ }
187
+ get color() {
188
+ return this[J];
189
+ }
190
+ set color(e) {
191
+ if (!this[q](e)) {
192
+ let t = this.colorModel.toHsva(e);
193
+ this[X](t), this[J] = e;
194
+ }
195
+ }
196
+ constructor() {
197
+ super();
198
+ let e = P(`<style>${this[Q].join("")}</style>`), t = this.attachShadow({ mode: "open" });
199
+ t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[Z] = this[$].map((e) => new e(t));
200
+ }
201
+ connectedCallback() {
202
+ if (this.hasOwnProperty("color")) {
203
+ let e = this.color;
204
+ delete this.color, this.color = e;
205
+ } else this.color ||= this.colorModel.defaultColor;
206
+ }
207
+ attributeChangedCallback(e, t, n) {
208
+ let r = this.colorModel.fromAttr(n);
209
+ this[q](r) || (this.color = r);
210
+ }
211
+ handleEvent(e) {
212
+ let t = this[Y], n = {
213
+ ...t,
214
+ ...e.detail
215
+ };
216
+ this[X](n);
217
+ let r;
218
+ !j(n, t) && !this[q](r = this.colorModel.fromHsva(n)) && (this[J] = r, F(this, "color-changed", { value: r }));
219
+ }
220
+ [q](e) {
221
+ return this.color && this.colorModel.equal(e, this.color);
222
+ }
223
+ [X](e) {
224
+ this[Y] = e, this[Z].forEach((t) => t.update(e));
225
+ }
226
+ }, ce = {
227
+ defaultColor: "#000",
228
+ toHsva: re,
229
+ fromHsva: ({ h: e, s: t, v: n }) => D({
230
+ h: e,
231
+ s: t,
232
+ v: n,
233
+ a: 1
234
+ }),
235
+ equal: M,
236
+ fromAttr: (e) => e
237
+ }, le = class extends se {
238
+ get colorModel() {
239
+ return ce;
240
+ }
241
+ }, ue = class extends le {};
242
+ customElements.define("hex-color-picker", ue);
243
+ //#endregion
244
+ //#region src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
245
+ var de = [
246
+ "disabled",
247
+ "aria-label",
248
+ "aria-expanded"
249
+ ], fe = [
250
+ "value",
251
+ "placeholder",
252
+ "disabled",
253
+ "aria-label"
254
+ ], pe = ["color", "aria-label"], me = /* @__PURE__ */ c({
255
+ __name: "ColorPicker",
256
+ props: {
257
+ modelValue: {},
258
+ placeholder: { default: x },
259
+ size: { default: "default" },
260
+ swatchOnly: {
261
+ type: Boolean,
262
+ default: !1
263
+ },
264
+ disabled: {
265
+ type: Boolean,
266
+ default: !1
267
+ }
268
+ },
269
+ emits: ["update:modelValue"],
270
+ setup(t, { emit: n }) {
271
+ let i = t, o = n, { t: c } = te(), f = s(!1), m = s(), b = s();
272
+ y(m, () => {
273
+ f.value = !1;
274
+ }, { ignore: [b] });
275
+ let x = _({
276
+ get: () => i.modelValue || "#000000",
277
+ set: (e) => o("update:modelValue", e)
278
+ });
279
+ function S(e) {
280
+ x.value = e.detail.value;
281
+ }
282
+ function C(e) {
283
+ x.value = e.target.value;
284
+ }
285
+ return (n, i) => (r(), u("div", { class: e(["tpl:flex tpl:gap-2 tpl:relative", t.disabled && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
286
+ g("button", {
287
+ ref_key: "swatchRef",
288
+ ref: b,
289
+ type: "button",
290
+ disabled: t.disabled,
291
+ "aria-label": h(c).colorPicker.pickColor,
292
+ "aria-expanded": f.value,
293
+ class: e([
294
+ "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)]",
295
+ t.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
296
+ f.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !t.disabled && "hover:tpl:border-[var(--tpl-text-dim)]",
297
+ t.size === "large" ? "tpl:size-12" : "tpl:size-10"
298
+ ]),
299
+ onClick: i[0] ||= (e) => !t.disabled && (f.value = !f.value)
300
+ }, [g("span", {
301
+ class: "tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]",
302
+ style: a({ backgroundColor: x.value })
303
+ }, null, 4)], 10, de),
304
+ t.swatchOnly ? p("", !0) : (r(), u("input", {
305
+ key: 0,
306
+ type: "text",
307
+ class: e(h(ne)),
308
+ value: t.modelValue,
309
+ placeholder: t.placeholder,
310
+ disabled: t.disabled,
311
+ "aria-label": h(c).colorPicker.hexValue,
312
+ onInput: C
313
+ }, null, 42, fe)),
314
+ d(v, {
315
+ "enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
316
+ "enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
317
+ "enter-to-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
318
+ "leave-active-class": "tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
319
+ "leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
320
+ "leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
321
+ }, {
322
+ default: l(() => [f.value ? (r(), u("div", {
323
+ key: 0,
324
+ ref_key: "popoverRef",
325
+ ref: m,
326
+ 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"
327
+ }, [g("hex-color-picker", {
328
+ color: x.value,
329
+ "aria-label": h(c).colorPicker.pickColor,
330
+ onColorChanged: S,
331
+ onKeydown: i[1] ||= ee((e) => f.value = !1, ["escape"])
332
+ }, null, 40, pe)], 512)) : p("", !0)]),
333
+ _: 1
334
+ })
335
+ ], 2));
336
+ }
337
+ }), he = [
338
+ "aria-checked",
339
+ "aria-label",
340
+ "title",
341
+ "onClick"
342
+ ], ge = { key: 1 }, _e = /* @__PURE__ */ c({
343
+ __name: "SlidingPillSelect",
344
+ props: {
345
+ options: {},
346
+ modelValue: {}
347
+ },
348
+ emits: ["update:modelValue"],
349
+ setup(e, { emit: t }) {
350
+ let s = e, c = t, l = _(() => s.options.findIndex((e) => e.value === s.modelValue)), d = _(() => `translateX(${Math.max(l.value, 0) * 100}%)`);
351
+ return (t, s) => (r(), u("div", {
352
+ role: "radiogroup",
353
+ class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
354
+ style: a({
355
+ gridTemplateColumns: `repeat(${e.options.length}, 1fr)`,
356
+ backgroundColor: "var(--tpl-bg-hover)"
357
+ })
358
+ }, [l.value >= 0 ? (r(), u("div", {
359
+ key: 0,
360
+ class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
361
+ style: a({
362
+ left: "4px",
363
+ width: `calc((100% - 8px) / ${e.options.length})`,
364
+ transform: d.value,
365
+ backgroundColor: "var(--tpl-bg)",
366
+ boxShadow: "var(--tpl-shadow)",
367
+ transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
368
+ })
369
+ }, null, 4)) : p("", !0), (r(!0), u(f, null, o(e.options, (t) => (r(), u("button", {
370
+ key: t.value,
371
+ role: "radio",
372
+ "aria-checked": e.modelValue === t.value,
373
+ "aria-label": t.label,
374
+ 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",
375
+ style: a({
376
+ color: e.modelValue === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
377
+ transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
378
+ }),
379
+ title: t.label,
380
+ onClick: (e) => c("update:modelValue", t.value)
381
+ }, [t.icon ? (r(), m(n(t.icon), {
382
+ key: 0,
383
+ size: 14,
384
+ "stroke-width": 2
385
+ })) : (r(), u("span", ge, i(t.label), 1))], 12, he))), 128))], 4));
386
+ }
387
+ }), ve = { class: "tpl:mb-3.5" }, ye = /* @__PURE__ */ c({
388
+ __name: "FieldRow",
389
+ props: { label: {} },
390
+ setup(n) {
391
+ return (a, o) => (r(), u("div", ve, [n.label ? (r(), u("label", {
392
+ key: 0,
393
+ class: e(h(b))
394
+ }, i(n.label), 3)) : p("", !0), t(a.$slots, "default")]));
395
+ }
396
+ }), be = { class: "tpl:flex tpl:items-stretch" }, xe = [
397
+ "value",
398
+ "min",
399
+ "max"
400
+ ], Se = /* @__PURE__ */ c({
401
+ __name: "NumberWithSuffix",
402
+ props: {
403
+ modelValue: {},
404
+ min: {},
405
+ max: {},
406
+ suffix: {}
407
+ },
408
+ emits: ["update:modelValue"],
409
+ setup(t, { emit: n }) {
410
+ let a = n;
411
+ return (n, o) => (r(), u("div", be, [g("input", {
412
+ type: "number",
413
+ class: e(h(C)),
414
+ value: t.modelValue,
415
+ min: t.min,
416
+ max: t.max,
417
+ onInput: o[0] ||= (e) => a("update:modelValue", Number(e.target.value))
418
+ }, null, 42, xe), g("span", { class: e(h(S)) }, i(t.suffix), 3)]));
419
+ }
420
+ });
421
+ //#endregion
422
+ export { me as i, ye as n, _e as r, Se as t };