@aswin.dev/editor 0.6.3 → 0.7.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.
- package/README.md +3 -3
- package/dist/AccessibilityPanel-COL6Wm7p.js +108 -0
- package/dist/AiChatSidebar-DWGPVtvC.js +229 -0
- package/dist/AiFeatureMenu-duUFSfDf.js +63 -0
- package/dist/BlockA11yBadge-Qs6HtXid.js +34 -0
- package/dist/CloudEditor-CFldoCOb.js +1207 -0
- package/dist/CollaboratorBar-Bw-lbt61.js +95 -0
- package/dist/CommentsSidebar-BaD5F53-.js +436 -0
- package/dist/CountdownBlock-DaYGxKqo.js +92 -0
- package/dist/CountdownToolbar-Dg4F8MTk.js +210 -0
- package/dist/DesignReferenceSidebar-BSH7uNP_.js +276 -0
- package/dist/LoadingTrack-Ba2pfF57.js +10 -0
- package/dist/ModuleBrowserModal-6phxZSKI.js +206 -0
- package/dist/ModulePreviewCanvas-BW8L3eQX.js +108 -0
- package/dist/NumberWithSuffix-BpUzQOJt.js +422 -0
- package/dist/ParagraphEditor-DNSzAB-I.js +695 -0
- package/dist/RichTextEditorContent-CrqPQdnk.js +137 -0
- package/dist/SaveModuleDialog-zMQTpez7.js +123 -0
- package/dist/SnapshotHistory-Do-A5rYU.js +122 -0
- package/dist/TemplateScoringPanel-CS7o62zS.js +256 -0
- package/dist/TestEmailModal-DGj_9V1u.js +94 -0
- package/dist/TitleEditor-C7IDnAoS.js +172 -0
- package/dist/TplModal-BAsVzcTb.js +44 -0
- package/dist/_plugin-vue_export-helper-BVAJ4lgT.js +8 -0
- package/dist/accessibility-BU09xZrQ.js +27 -0
- package/dist/blockTypeIcons-C6LDKvmd.js +140 -0
- package/dist/bundle-stats.json +10 -0
- package/dist/check-DJrpDKO_.js +7 -0
- package/dist/chevron-down-C5oBUhT8.js +7 -0
- package/dist/chevron-right-BqCptpdp.js +10 -0
- package/dist/circle-alert-ZQQc98HC.js +25 -0
- package/dist/clock-ik2pRJKG.js +12 -0
- package/dist/cloud-6ZmAvF0j.js +1791 -0
- package/dist/createLucideIcon-ClREiSx3.js +43 -0
- package/dist/de-DWcgp-7T.js +729 -0
- package/dist/de-GOtR9DwW.js +207 -0
- package/dist/dist-BUzw1buG.js +35 -0
- package/dist/dist-BZyY-SS4.js +74 -0
- package/dist/dist-BadNx4qo.js +5 -0
- package/dist/dist-BesOh2mk.js +35 -0
- package/dist/dist-Bz3M4RXG.js +2082 -0
- package/dist/dist-C04s_fLA.js +563 -0
- package/dist/dist-C3T2AKtB.js +776 -0
- package/dist/dist-C9ckKEZL.js +519 -0
- package/dist/dist-CBItRG-Z.js +47 -0
- package/dist/dist-COSzWQUs.js +5 -0
- package/dist/dist-CivF9P8b.js +382 -0
- package/dist/dist-DXa1uAMh.js +10658 -0
- package/dist/dist-DtiDUrX-.js +189 -0
- package/dist/dist-Dzt5foyL.js +61 -0
- package/dist/emojiData-DrBuvEoP.js +17 -0
- package/dist/en-Cxd4fhNm.js +729 -0
- package/dist/en-dFFQVzNn.js +207 -0
- package/dist/extensions-D__hOlV1.js +799 -0
- package/dist/formatRelativeTime-BhhO8yCl.js +12 -0
- package/dist/image-up-DT7gcJLN.js +23 -0
- package/dist/index.d.ts +352 -0
- package/dist/info-BSPGcsSM.js +19 -0
- package/dist/keys-CvX8D-8C.js +10 -0
- package/dist/liquid.browser-BvCyLQII.js +3277 -0
- package/dist/loader-circle-Balo8p3d.js +7 -0
- package/dist/message-circle-B39qAHxs.js +7 -0
- package/dist/pencil-BZJPNYWR.js +10 -0
- package/dist/readableTextColor-DVuzNX1y.js +30 -0
- package/dist/refresh-cw-DwDqGUM0.js +29 -0
- package/dist/rolldown-runtime-BZGGJVDF.js +20 -0
- package/dist/scan-line-CzfFJO1o.js +25 -0
- package/dist/send-D2eSo4GH.js +10 -0
- package/dist/shield-check-jkpgcC0-.js +10 -0
- package/dist/sparkles-Chm5CZfb.js +23 -0
- package/dist/style.css +2 -0
- package/dist/styleConstants-34eUKPOZ.js +55 -0
- package/dist/styles-B4tjX5SP.js +5224 -0
- package/dist/templatical-editor.js +312 -0
- package/dist/text-align-start-CzBnJsW8.js +43 -0
- package/dist/timeouts-BSGxjuUF.js +4 -0
- package/dist/trash-2-CtK2apEH.js +25 -0
- package/dist/triangle-alert-KpDVNbpn.js +17 -0
- package/dist/useCloudI18n-DOKSZql1.js +23 -0
- package/dist/useEditorCore-wslttMH-.js +9517 -0
- package/dist/useI18n-C2xQZ6K9.js +17 -0
- package/dist/useMergeTag-DX0XG5V9.js +34 -0
- package/dist/vue.runtime.esm-bundler-CjauPXjj.js +5775 -0
- package/dist/x-BkaOMosX.js +10 -0
- package/package.json +10 -10
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import { At as e, C as t, F as n, Ft as r, I as i, N as a, R as o, U as s, _ as c, et as l, f as u, g as d, h as f, jt as p, m, st as h, t as ee, u as g, v as _, x as v } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
2
|
+
import { t as y } from "./dist-CivF9P8b.js";
|
|
3
|
+
import { t as te } from "./useI18n-C2xQZ6K9.js";
|
|
4
|
+
import { h as b, i as x, m as S, p as C, u as w } from "./styleConstants-34eUKPOZ.js";
|
|
5
|
+
//#region ../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/utils/math.js
|
|
6
|
+
var T = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, E = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n;
|
|
7
|
+
360 / (Math.PI * 2);
|
|
8
|
+
var ne = (e) => j(D(e)), D = (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 ? E(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 ? E(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
|
|
18
|
+
}), O = (e) => ae(ie(e)), re = ({ h: e, s: t, v: n, a: r }) => {
|
|
19
|
+
let i = (200 - t) * n / 100;
|
|
20
|
+
return {
|
|
21
|
+
h: E(e),
|
|
22
|
+
s: E(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
|
|
23
|
+
l: E(i / 2),
|
|
24
|
+
a: E(r, 2)
|
|
25
|
+
};
|
|
26
|
+
}, k = (e) => {
|
|
27
|
+
let { h: t, s: n, l: r } = re(e);
|
|
28
|
+
return `hsl(${t}, ${n}%, ${r}%)`;
|
|
29
|
+
}, ie = ({ 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: E([
|
|
34
|
+
n,
|
|
35
|
+
o,
|
|
36
|
+
a,
|
|
37
|
+
a,
|
|
38
|
+
s,
|
|
39
|
+
n
|
|
40
|
+
][c] * 255),
|
|
41
|
+
g: E([
|
|
42
|
+
s,
|
|
43
|
+
n,
|
|
44
|
+
n,
|
|
45
|
+
o,
|
|
46
|
+
a,
|
|
47
|
+
a
|
|
48
|
+
][c] * 255),
|
|
49
|
+
b: E([
|
|
50
|
+
a,
|
|
51
|
+
a,
|
|
52
|
+
s,
|
|
53
|
+
n,
|
|
54
|
+
n,
|
|
55
|
+
o
|
|
56
|
+
][c] * 255),
|
|
57
|
+
a: E(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(E(r * 255)) : "";
|
|
64
|
+
return "#" + A(e) + A(t) + A(n) + i;
|
|
65
|
+
}, j = ({ 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: E(60 * (o < 0 ? o + 6 : o)),
|
|
69
|
+
s: E(i ? a / i * 100 : 0),
|
|
70
|
+
v: E(i / 255 * 100),
|
|
71
|
+
a: r
|
|
72
|
+
};
|
|
73
|
+
}, M = (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
|
+
}, oe = (e, t) => e.toLowerCase() === t.toLowerCase() ? !0 : M(D(e), D(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: T((n.pageX - (r.left + window.pageXOffset)) / r.width),
|
|
89
|
+
y: T((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: k({
|
|
141
|
+
h: e,
|
|
142
|
+
s: 100,
|
|
143
|
+
v: 100,
|
|
144
|
+
a: 1
|
|
145
|
+
})
|
|
146
|
+
}]), this.el.setAttribute("aria-valuenow", `${E(e)}`);
|
|
147
|
+
}
|
|
148
|
+
getMove(e, t) {
|
|
149
|
+
return { h: t ? T(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: k(e)
|
|
160
|
+
}, { "background-color": k({
|
|
161
|
+
h: e.h,
|
|
162
|
+
s: 100,
|
|
163
|
+
v: 100,
|
|
164
|
+
a: 1
|
|
165
|
+
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${E(e.s)}%, Brightness ${E(e.v)}%`);
|
|
166
|
+
}
|
|
167
|
+
getMove(e, t) {
|
|
168
|
+
return {
|
|
169
|
+
s: t ? T(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
|
|
170
|
+
v: t ? T(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
|
+
!M(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: ne,
|
|
229
|
+
fromHsva: ({ h: e, s: t, v: n }) => O({
|
|
230
|
+
h: e,
|
|
231
|
+
s: t,
|
|
232
|
+
v: n,
|
|
233
|
+
a: 1
|
|
234
|
+
}),
|
|
235
|
+
equal: oe,
|
|
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__ */ t({
|
|
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 r = t, i = n, { t: o } = te(), u = l(!1), d = l(), b = l();
|
|
272
|
+
y(d, () => {
|
|
273
|
+
u.value = !1;
|
|
274
|
+
}, { ignore: [b] });
|
|
275
|
+
let x = m({
|
|
276
|
+
get: () => r.modelValue || "#000000",
|
|
277
|
+
set: (e) => i("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, r) => (a(), _("div", { class: e(["tpl:flex tpl:gap-2 tpl:relative tpl:w-full tpl:min-w-0", t.disabled && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
|
|
286
|
+
f("button", {
|
|
287
|
+
ref_key: "swatchRef",
|
|
288
|
+
ref: b,
|
|
289
|
+
type: "button",
|
|
290
|
+
disabled: t.disabled,
|
|
291
|
+
"aria-label": h(o).colorPicker.pickColor,
|
|
292
|
+
"aria-expanded": u.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
|
+
u.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: r[0] ||= (e) => !t.disabled && (u.value = !u.value)
|
|
300
|
+
}, [f("span", {
|
|
301
|
+
class: "tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]",
|
|
302
|
+
style: p({ backgroundColor: x.value })
|
|
303
|
+
}, null, 4)], 10, de),
|
|
304
|
+
t.swatchOnly ? c("", !0) : (a(), _("input", {
|
|
305
|
+
key: 0,
|
|
306
|
+
type: "text",
|
|
307
|
+
class: e(h(w)),
|
|
308
|
+
value: t.modelValue,
|
|
309
|
+
placeholder: t.placeholder,
|
|
310
|
+
disabled: t.disabled,
|
|
311
|
+
"aria-label": h(o).colorPicker.hexValue,
|
|
312
|
+
onInput: C
|
|
313
|
+
}, null, 42, fe)),
|
|
314
|
+
v(ee, {
|
|
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: s(() => [u.value ? (a(), _("div", {
|
|
323
|
+
key: 0,
|
|
324
|
+
ref_key: "popoverRef",
|
|
325
|
+
ref: d,
|
|
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
|
+
}, [f("hex-color-picker", {
|
|
328
|
+
color: x.value,
|
|
329
|
+
"aria-label": h(o).colorPicker.pickColor,
|
|
330
|
+
onColorChanged: S,
|
|
331
|
+
onKeydown: r[1] ||= g((e) => u.value = !1, ["escape"])
|
|
332
|
+
}, null, 40, pe)], 512)) : c("", !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__ */ t({
|
|
343
|
+
__name: "SlidingPillSelect",
|
|
344
|
+
props: {
|
|
345
|
+
options: {},
|
|
346
|
+
modelValue: {}
|
|
347
|
+
},
|
|
348
|
+
emits: ["update:modelValue"],
|
|
349
|
+
setup(e, { emit: t }) {
|
|
350
|
+
let i = e, s = t, l = m(() => i.options.findIndex((e) => e.value === i.modelValue)), f = m(() => `translateX(${Math.max(l.value, 0) * 100}%)`);
|
|
351
|
+
return (t, i) => (a(), _("div", {
|
|
352
|
+
role: "radiogroup",
|
|
353
|
+
class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
|
|
354
|
+
style: p({
|
|
355
|
+
gridTemplateColumns: `repeat(${e.options.length}, 1fr)`,
|
|
356
|
+
backgroundColor: "var(--tpl-bg-hover)"
|
|
357
|
+
})
|
|
358
|
+
}, [l.value >= 0 ? (a(), _("div", {
|
|
359
|
+
key: 0,
|
|
360
|
+
class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
|
|
361
|
+
style: p({
|
|
362
|
+
left: "4px",
|
|
363
|
+
width: `calc((100% - 8px) / ${e.options.length})`,
|
|
364
|
+
transform: f.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)) : c("", !0), (a(!0), _(u, null, n(e.options, (t) => (a(), _("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: p({
|
|
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) => s("update:modelValue", t.value)
|
|
381
|
+
}, [t.icon ? (a(), d(o(t.icon), {
|
|
382
|
+
key: 0,
|
|
383
|
+
size: 14,
|
|
384
|
+
"stroke-width": 2
|
|
385
|
+
})) : (a(), _("span", ge, r(t.label), 1))], 12, he))), 128))], 4));
|
|
386
|
+
}
|
|
387
|
+
}), ve = { class: "tpl:mb-3.5" }, ye = /* @__PURE__ */ t({
|
|
388
|
+
__name: "FieldRow",
|
|
389
|
+
props: { label: {} },
|
|
390
|
+
setup(t) {
|
|
391
|
+
return (n, o) => (a(), _("div", ve, [t.label ? (a(), _("label", {
|
|
392
|
+
key: 0,
|
|
393
|
+
class: e(h(b))
|
|
394
|
+
}, r(t.label), 3)) : c("", !0), i(n.$slots, "default")]));
|
|
395
|
+
}
|
|
396
|
+
}), be = { class: "tpl:flex tpl:items-stretch" }, xe = [
|
|
397
|
+
"value",
|
|
398
|
+
"min",
|
|
399
|
+
"max"
|
|
400
|
+
], Se = /* @__PURE__ */ t({
|
|
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 i = n;
|
|
411
|
+
return (n, o) => (a(), _("div", be, [f("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) => i("update:modelValue", Number(e.target.value))
|
|
418
|
+
}, null, 42, xe), f("span", { class: e(h(S)) }, r(t.suffix), 3)]));
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
//#endregion
|
|
422
|
+
export { me as i, ye as n, _e as r, Se as t };
|