@tempots/beatui 0.73.0 → 0.74.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.
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +2 -2
- package/dist/json-schema/index.cjs.js +4 -4
- package/dist/json-schema/index.es.js +211 -196
- package/dist/types/components/json-schema/index.d.ts +1 -1
- package/dist/types/components/json-schema/widgets/widget-customization.d.ts +37 -0
- package/dist/{widget-customization-29Hl2gKT.js → widget-customization-Bo4XWiwB.js} +228 -204
- package/dist/widget-customization-dwsDMhwt.cjs +1 -0
- package/package.json +1 -1
- package/dist/widget-customization-BXiewbt-.cjs +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Value as p, prop as ot, computedOf as
|
|
2
|
-
import { F as mt, $ as ht, N as X, T as ft, U as bt, a as
|
|
3
|
-
import { C as
|
|
1
|
+
import { Value as p, prop as ot, computedOf as D, html as _, attr as u, svg as et, svgAttr as Y, on as $, Empty as A, When as j, Fragment as E, aria as R, emitValue as tt, Use as ct, input as it, emitValueAsNullableDate as nt, emitValueAsNullableDateTime as st, style as lt, Repeat as gt, emit as dt, emitValueAsNumber as B } from "@tempots/dom";
|
|
2
|
+
import { F as mt, $ as ht, N as X, T as ft, U as bt, a as yt } from "./deep-merge-CQQCMLwG.js";
|
|
3
|
+
import { C as V, b as U, a as wt, c as Q, T as xt, L as $t, d as rt, e as Mt } from "./translations-DQxouiBG.js";
|
|
4
4
|
import { AutoSelect as It, ElementRect as _t } from "@tempots/ui";
|
|
5
|
-
import { E as kt, P as
|
|
6
|
-
import { s as
|
|
5
|
+
import { E as kt, P as Tt } from "./notice-Cqq8g17n.js";
|
|
6
|
+
import { s as Ct } from "./use-form-B7A865EM.js";
|
|
7
7
|
function ut(t) {
|
|
8
8
|
if (typeof t != "string") return !1;
|
|
9
9
|
const e = t.startsWith("#") ? t.slice(1) : t;
|
|
@@ -45,7 +45,7 @@ function J(t, e, s) {
|
|
|
45
45
|
};
|
|
46
46
|
return `#${n(t)}${n(e)}${n(s)}`;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function H(t) {
|
|
49
49
|
const e = St(t);
|
|
50
50
|
if (!e) return null;
|
|
51
51
|
const s = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
|
|
@@ -56,11 +56,11 @@ function W(t) {
|
|
|
56
56
|
} : null;
|
|
57
57
|
}
|
|
58
58
|
function ie(t, e) {
|
|
59
|
-
const s =
|
|
59
|
+
const s = H(t), n = H(e);
|
|
60
60
|
if (!s || !n) return null;
|
|
61
61
|
const a = (l, g, h) => {
|
|
62
|
-
const [b, d,
|
|
63
|
-
return 0.2126 * b + 0.7152 * d + 0.0722 *
|
|
62
|
+
const [b, d, w] = [l, g, h].map((x) => (x = x / 255, x <= 0.03928 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4)));
|
|
63
|
+
return 0.2126 * b + 0.7152 * d + 0.0722 * w;
|
|
64
64
|
}, r = a(s.r, s.g, s.b), o = a(n.r, n.g, n.b), c = Math.max(r, o), i = Math.min(r, o);
|
|
65
65
|
return (c + 0.05) / (i + 0.05);
|
|
66
66
|
}
|
|
@@ -110,24 +110,24 @@ function Nt(t) {
|
|
|
110
110
|
/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
111
111
|
);
|
|
112
112
|
if (r) {
|
|
113
|
-
const l = parseFloat(r[1]), g = parseFloat(r[2]), h = parseFloat(r[3]), b = r[4] != null ? parseFloat(r[4]) : 1, [d,
|
|
114
|
-
return [d,
|
|
113
|
+
const l = parseFloat(r[1]), g = parseFloat(r[2]), h = parseFloat(r[3]), b = r[4] != null ? parseFloat(r[4]) : 1, [d, w, x] = pt(l, g / 100, h / 100);
|
|
114
|
+
return [d, w, x, b];
|
|
115
115
|
}
|
|
116
116
|
const o = t.match(
|
|
117
117
|
/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
118
118
|
);
|
|
119
119
|
if (o) {
|
|
120
|
-
const l = parseFloat(o[1]), g = parseFloat(o[2]) / 100, h = parseFloat(o[3]) / 100, b = o[4] != null ? parseFloat(o[4]) : 1, [d,
|
|
121
|
-
return [d,
|
|
120
|
+
const l = parseFloat(o[1]), g = parseFloat(o[2]) / 100, h = parseFloat(o[3]) / 100, b = o[4] != null ? parseFloat(o[4]) : 1, [d, w, x] = Lt(l, g, h);
|
|
121
|
+
return [d, w, x, b];
|
|
122
122
|
}
|
|
123
123
|
const c = t.match(
|
|
124
124
|
/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
125
125
|
);
|
|
126
126
|
if (c) {
|
|
127
|
-
const l = c[1], g = parseFloat(c[2]), h = parseFloat(c[3]), b = c[4] != null ? parseFloat(c[4]) : 1, d = l.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(l) / 100)) : Math.max(0, Math.min(1, parseFloat(l))), [
|
|
128
|
-
return [
|
|
127
|
+
const l = c[1], g = parseFloat(c[2]), h = parseFloat(c[3]), b = c[4] != null ? parseFloat(c[4]) : 1, d = l.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(l) / 100)) : Math.max(0, Math.min(1, parseFloat(l))), [w, x, y] = Et(d, g, h);
|
|
128
|
+
return [w, x, y, b];
|
|
129
129
|
}
|
|
130
|
-
const i =
|
|
130
|
+
const i = H(t);
|
|
131
131
|
return i ? [i.r, i.g, i.b, 1] : [0, 0, 0, 1];
|
|
132
132
|
}
|
|
133
133
|
function Rt(t, e, s, n) {
|
|
@@ -136,7 +136,7 @@ function Rt(t, e, s, n) {
|
|
|
136
136
|
Math.min(1, Math.round(n * 100) / 100)
|
|
137
137
|
)})`;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function Dt(t) {
|
|
140
140
|
let e = t + 1831565813;
|
|
141
141
|
return function() {
|
|
142
142
|
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
@@ -152,7 +152,7 @@ function pt(t, e, s) {
|
|
|
152
152
|
Math.round((i + r) * 255)
|
|
153
153
|
];
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Lt(t, e, s) {
|
|
156
156
|
t = (t % 360 + 360) % 360;
|
|
157
157
|
const n = e + s;
|
|
158
158
|
n > 1 && (e /= n, s /= n);
|
|
@@ -179,26 +179,26 @@ function Z(t, e, s) {
|
|
|
179
179
|
}
|
|
180
180
|
return [Math.round(r), Math.round(o * 100), Math.round(c * 100)];
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Bt(t, e, s) {
|
|
183
183
|
const [n] = Z(t, e, s), a = t / 255, r = e / 255, o = s / 255, c = Math.min(a, r, o), i = 1 - Math.max(a, r, o);
|
|
184
184
|
return [n, Math.round(c * 100), Math.round(i * 100)];
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function G(t) {
|
|
187
187
|
const e = t / 255;
|
|
188
188
|
return e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function K(t) {
|
|
191
191
|
const e = t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 0.4166666666666667) - 0.055;
|
|
192
192
|
return Math.round(Math.max(0, Math.min(1, e)) * 255);
|
|
193
193
|
}
|
|
194
|
-
function Vt(t, e, s) {
|
|
195
|
-
const n = s * Math.PI / 180, a = Math.cos(n) * e, r = Math.sin(n) * e, o = t + 0.3963377774 * a + 0.2158037573 * r, c = t - 0.1055613458 * a - 0.0638541728 * r, i = t - 0.0894841775 * a - 1.291485548 * r, l = o * o * o, g = c * c * c, h = i * i * i, b = 4.0767416621 * l - 3.3077115913 * g + 0.2309699292 * h, d = -1.2684380046 * l + 2.6097574011 * g - 0.3413193965 * h, y = -0.0041960863 * l - 0.7034186147 * g + 1.707614701 * h;
|
|
196
|
-
return [q(b), q(d), q(y)];
|
|
197
|
-
}
|
|
198
194
|
function Et(t, e, s) {
|
|
199
|
-
const n =
|
|
200
|
-
|
|
201
|
-
|
|
195
|
+
const n = s * Math.PI / 180, a = Math.cos(n) * e, r = Math.sin(n) * e, o = t + 0.3963377774 * a + 0.2158037573 * r, c = t - 0.1055613458 * a - 0.0638541728 * r, i = t - 0.0894841775 * a - 1.291485548 * r, l = o * o * o, g = c * c * c, h = i * i * i, b = 4.0767416621 * l - 3.3077115913 * g + 0.2309699292 * h, d = -1.2684380046 * l + 2.6097574011 * g - 0.3413193965 * h, w = -0.0041960863 * l - 0.7034186147 * g + 1.707614701 * h;
|
|
196
|
+
return [K(b), K(d), K(w)];
|
|
197
|
+
}
|
|
198
|
+
function Vt(t, e, s) {
|
|
199
|
+
const n = G(t), a = G(e), r = G(s), o = 0.4122214708 * n + 0.5363325363 * a + 0.0514459929 * r, c = 0.2119034982 * n + 0.6806995451 * a + 0.1073969566 * r, i = 0.0883024619 * n + 0.2817188376 * a + 0.6299787005 * r, l = Math.cbrt(o), g = Math.cbrt(c), h = Math.cbrt(i), b = 0.2104542553 * l + 0.793617785 * g - 0.0040720468 * h, d = 1.9779984951 * l - 2.428592205 * g + 0.4505937099 * h, w = 0.0259040371 * l + 0.7827717662 * g - 0.808675766 * h, x = Math.sqrt(d * d + w * w);
|
|
200
|
+
let y = Math.atan2(w, d) * 180 / Math.PI;
|
|
201
|
+
return y < 0 && (y += 360), [b, x, y];
|
|
202
202
|
}
|
|
203
203
|
function P(t, e, s, n, a, r) {
|
|
204
204
|
switch (a) {
|
|
@@ -221,16 +221,16 @@ function P(t, e, s, n, a, r) {
|
|
|
221
221
|
return `hsla(${o}, ${c}%, ${i}%, ${Math.round(n * 100) / 100})`;
|
|
222
222
|
}
|
|
223
223
|
case "hwb": {
|
|
224
|
-
const [o, c, i] =
|
|
224
|
+
const [o, c, i] = Bt(t, e, s);
|
|
225
225
|
return n < 1 ? `hwb(${o} ${c}% ${i}% / ${Math.round(n * 100) / 100})` : `hwb(${o} ${c}% ${i}%)`;
|
|
226
226
|
}
|
|
227
227
|
case "oklch": {
|
|
228
|
-
const [o, c, i] =
|
|
228
|
+
const [o, c, i] = Vt(t, e, s), l = (Math.round(o * 1e3) / 1e3).toFixed(3), g = (Math.round(c * 1e3) / 1e3).toFixed(3), h = (Math.round(i * 10) / 10).toFixed(1), b = Math.round(n * 100) / 100;
|
|
229
229
|
return r || n < 1 ? `oklch(${l} ${g} ${h} / ${b})` : `oklch(${l} ${g} ${h})`;
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function W(t, e) {
|
|
234
234
|
return e ? t === "rgb" ? "rgba" : t === "hsl" ? "hsla" : t : t === "rgba" ? "rgb" : t === "hsla" ? "hsl" : t;
|
|
235
235
|
}
|
|
236
236
|
async function Ut(t) {
|
|
@@ -261,27 +261,27 @@ function Pt(t) {
|
|
|
261
261
|
}
|
|
262
262
|
return "application/octet-stream";
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function Wt(t) {
|
|
265
265
|
const e = ht(t ?? ""), s = e.length, n = new Uint8Array(s);
|
|
266
266
|
for (let a = 0; a < s; a++) n[a] = e.charCodeAt(a);
|
|
267
267
|
return n;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function jt(t) {
|
|
270
270
|
const {
|
|
271
271
|
value: e,
|
|
272
272
|
onChange: s,
|
|
273
273
|
onInput: n,
|
|
274
274
|
...a
|
|
275
275
|
} = t, r = /* @__PURE__ */ new Map(), o = p.toSignal(e).map((g) => g.map((h, b) => {
|
|
276
|
-
const d = r.get(h),
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
const d = r.get(h), w = Wt(h ?? ""), x = d?.type || Pt(w), y = d?.name ?? `file-${b}`, I = w.buffer.slice(
|
|
277
|
+
w.byteOffset,
|
|
278
|
+
w.byteOffset + w.byteLength
|
|
279
279
|
), f = new Blob([I], { type: x });
|
|
280
|
-
return new File([f],
|
|
280
|
+
return new File([f], y, { type: x });
|
|
281
281
|
})), c = (g) => (h) => {
|
|
282
282
|
g && Ot(h).then((b) => {
|
|
283
|
-
for (const [d,
|
|
284
|
-
r.set(
|
|
283
|
+
for (const [d, w] of b.entries())
|
|
284
|
+
r.set(w, { name: h[d].name, type: h[d].type });
|
|
285
285
|
g(b);
|
|
286
286
|
});
|
|
287
287
|
}, i = c(s), l = c(n);
|
|
@@ -299,7 +299,7 @@ function le(t) {
|
|
|
299
299
|
onChange: n,
|
|
300
300
|
...a
|
|
301
301
|
} = t;
|
|
302
|
-
return
|
|
302
|
+
return jt({
|
|
303
303
|
...a,
|
|
304
304
|
maxFiles: 1,
|
|
305
305
|
value: p.map(e, (r) => r == null ? [] : [r]),
|
|
@@ -311,47 +311,47 @@ function le(t) {
|
|
|
311
311
|
}
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
const [s, n, a] = t, r = s << 16 ^ n << 8 ^ a, o =
|
|
314
|
+
function Ht(t, e) {
|
|
315
|
+
const [s, n, a] = t, r = s << 16 ^ n << 8 ^ a, o = Dt(r), c = 6 + Math.floor(o() * 5), i = 0.18 + o() * 0.06, l = [];
|
|
316
316
|
for (let d = 0; d < c; d++) {
|
|
317
|
-
const
|
|
318
|
-
l.push({ x:
|
|
317
|
+
const w = d / c * Math.PI * 2, x = e * (1 + (o() * 2 - 1) * i), y = Math.cos(w) * x, I = Math.sin(w) * x;
|
|
318
|
+
l.push({ x: y, y: I });
|
|
319
319
|
}
|
|
320
320
|
const g = (l[0].x + l[c - 1].x) / 2, h = (l[0].y + l[c - 1].y) / 2;
|
|
321
321
|
let b = `M ${g.toFixed(3)} ${h.toFixed(3)}`;
|
|
322
322
|
for (let d = 0; d < c; d++) {
|
|
323
|
-
const
|
|
324
|
-
b += ` Q ${
|
|
323
|
+
const w = l[d], x = l[(d + 1) % c], y = (w.x + x.x) / 2, I = (w.y + x.y) / 2;
|
|
324
|
+
b += ` Q ${w.x.toFixed(3)} ${w.y.toFixed(3)} ${y.toFixed(3)} ${I.toFixed(3)}`;
|
|
325
325
|
}
|
|
326
326
|
return b += " Z", b;
|
|
327
327
|
}
|
|
328
328
|
const ue = (t) => {
|
|
329
329
|
const { value: e, onBlur: s, onChange: n, onInput: a, displayValue: r, size: o, withAlpha: c } = t, i = p.map(o ?? 32, (m) => m), l = p.map(e, (m) => Nt(m ?? "#000000")), g = p.map(
|
|
330
330
|
l,
|
|
331
|
-
([m,
|
|
332
|
-
), h = p.map(l, ([, , , m]) => m), b = ot(p.get(h) ?? 1), d = p.map(c ?? !1, (m) => m),
|
|
331
|
+
([m, M, T]) => [m, M, T]
|
|
332
|
+
), h = p.map(l, ([, , , m]) => m), b = ot(p.get(h) ?? 1), d = p.map(c ?? !1, (m) => m), w = p.map(
|
|
333
333
|
t.colorTextFormat ?? "rgb",
|
|
334
334
|
(m) => m
|
|
335
|
-
), x =
|
|
335
|
+
), x = D(
|
|
336
336
|
g,
|
|
337
337
|
b,
|
|
338
|
-
|
|
338
|
+
w,
|
|
339
339
|
d
|
|
340
340
|
)(
|
|
341
|
-
([m,
|
|
342
|
-
),
|
|
341
|
+
([m, M, T], v, S, N) => P(m, M, T, v ?? 1, W(S, N), N)
|
|
342
|
+
), y = p.map(
|
|
343
343
|
t.colorTextFormat ?? "hex",
|
|
344
344
|
(m) => m
|
|
345
|
-
), I = p.map(i, (m) => `${-m / 2} ${-m / 2} ${m} ${m}`), f =
|
|
345
|
+
), I = p.map(i, (m) => `${-m / 2} ${-m / 2} ${m} ${m}`), f = D(
|
|
346
346
|
g,
|
|
347
347
|
i
|
|
348
|
-
)((m,
|
|
348
|
+
)((m, M) => Ht(m, M / 2)), F = D(
|
|
349
349
|
g,
|
|
350
350
|
b,
|
|
351
351
|
d
|
|
352
352
|
)(
|
|
353
|
-
([m,
|
|
354
|
-
),
|
|
353
|
+
([m, M, T], v, S) => S || v < 1 ? Rt(m, M, T, v) : J(m, M, T)
|
|
354
|
+
), C = _.div(
|
|
355
355
|
u.class("bc-color-swatch-input__control"),
|
|
356
356
|
u.class(
|
|
357
357
|
p.map(
|
|
@@ -360,7 +360,7 @@ const ue = (t) => {
|
|
|
360
360
|
)
|
|
361
361
|
),
|
|
362
362
|
u.style(
|
|
363
|
-
|
|
363
|
+
D(i)((m) => `min-width:${m + 2}px;height:${m + 2}px`)
|
|
364
364
|
),
|
|
365
365
|
// The SVG blob preview
|
|
366
366
|
et.svg(
|
|
@@ -371,33 +371,33 @@ const ue = (t) => {
|
|
|
371
371
|
// Invisible native input overlays the blob for picker and accessibility
|
|
372
372
|
_.input(
|
|
373
373
|
u.type("color"),
|
|
374
|
-
|
|
374
|
+
V(t),
|
|
375
375
|
// Native color input needs hex without alpha
|
|
376
|
-
u.value(p.map(g, ([m,
|
|
376
|
+
u.value(p.map(g, ([m, M, T]) => J(m, M, T))),
|
|
377
377
|
u.class(
|
|
378
378
|
"bc-input bc-color-swatch-input bc-color-swatch-input__native"
|
|
379
379
|
),
|
|
380
|
-
s != null ?
|
|
381
|
-
n != null ?
|
|
382
|
-
const
|
|
380
|
+
s != null ? $.blur(s) : A,
|
|
381
|
+
n != null ? $.change((m) => {
|
|
382
|
+
const M = m.target.value;
|
|
383
383
|
if (!n) return;
|
|
384
|
-
const { r:
|
|
385
|
-
p.get(
|
|
384
|
+
const { r: T, g: v, b: S } = H(M) ?? { r: 0, g: 0, b: 0 }, N = p.get(b) ?? 1, L = W(
|
|
385
|
+
p.get(y),
|
|
386
386
|
p.get(d)
|
|
387
|
-
), z = P(
|
|
387
|
+
), z = P(T, v, S, N, L, p.get(d));
|
|
388
388
|
n(z);
|
|
389
389
|
}) : A,
|
|
390
|
-
a != null ?
|
|
391
|
-
const
|
|
390
|
+
a != null ? $.input((m) => {
|
|
391
|
+
const M = m.target.value;
|
|
392
392
|
if (!a) return;
|
|
393
|
-
const { r:
|
|
394
|
-
p.get(
|
|
393
|
+
const { r: T, g: v, b: S } = H(M) ?? { r: 0, g: 0, b: 0 }, N = p.get(b) ?? 1, L = W(
|
|
394
|
+
p.get(y),
|
|
395
395
|
p.get(d)
|
|
396
|
-
), z = P(
|
|
396
|
+
), z = P(T, v, S, N, L, p.get(d));
|
|
397
397
|
a(z);
|
|
398
398
|
}) : A
|
|
399
399
|
)
|
|
400
|
-
), k =
|
|
400
|
+
), k = j(
|
|
401
401
|
d,
|
|
402
402
|
() => _.input(
|
|
403
403
|
u.type("range"),
|
|
@@ -407,23 +407,23 @@ const ue = (t) => {
|
|
|
407
407
|
u.step(0.01),
|
|
408
408
|
u.value(p.map(b, (m) => String(m ?? 1))),
|
|
409
409
|
u.disabled(t.disabled),
|
|
410
|
-
|
|
411
|
-
const
|
|
412
|
-
b.set(
|
|
413
|
-
const [
|
|
414
|
-
p.get(
|
|
410
|
+
$.input((m) => {
|
|
411
|
+
const M = parseFloat(m.target.value);
|
|
412
|
+
b.set(M);
|
|
413
|
+
const [T, v, S] = p.get(g), N = W(
|
|
414
|
+
p.get(y),
|
|
415
415
|
p.get(d)
|
|
416
|
-
),
|
|
417
|
-
a?.(
|
|
416
|
+
), L = P(T, v, S, M, N, p.get(d));
|
|
417
|
+
a?.(L);
|
|
418
418
|
}),
|
|
419
|
-
|
|
420
|
-
const
|
|
421
|
-
b.set(
|
|
422
|
-
const [
|
|
423
|
-
p.get(
|
|
419
|
+
$.change((m) => {
|
|
420
|
+
const M = parseFloat(m.target.value);
|
|
421
|
+
b.set(M);
|
|
422
|
+
const [T, v, S] = p.get(g), N = W(
|
|
423
|
+
p.get(y),
|
|
424
424
|
p.get(d)
|
|
425
|
-
),
|
|
426
|
-
n?.(
|
|
425
|
+
), L = P(T, v, S, M, N, p.get(d));
|
|
426
|
+
n?.(L);
|
|
427
427
|
})
|
|
428
428
|
)
|
|
429
429
|
);
|
|
@@ -432,10 +432,10 @@ const ue = (t) => {
|
|
|
432
432
|
...t,
|
|
433
433
|
// ensure our control does not try to grow
|
|
434
434
|
growInput: !1,
|
|
435
|
-
input:
|
|
435
|
+
input: C,
|
|
436
436
|
// If caller provided an `after`, append RGB before it
|
|
437
|
-
after:
|
|
438
|
-
|
|
437
|
+
after: E(
|
|
438
|
+
j(
|
|
439
439
|
r ?? !1,
|
|
440
440
|
() => _.span(u.class("bc-color-swatch-input__rgb"), x)
|
|
441
441
|
),
|
|
@@ -451,7 +451,7 @@ function Xt(t, e, s) {
|
|
|
451
451
|
function pe({ variant: t = "default", size: e = "md", roundedness: s = "lg" } = {}, ...n) {
|
|
452
452
|
return _.div(
|
|
453
453
|
u.class(
|
|
454
|
-
|
|
454
|
+
D(
|
|
455
455
|
t,
|
|
456
456
|
e,
|
|
457
457
|
s
|
|
@@ -483,17 +483,17 @@ const ge = ({
|
|
|
483
483
|
)
|
|
484
484
|
),
|
|
485
485
|
R.disabled(c),
|
|
486
|
-
|
|
486
|
+
j(
|
|
487
487
|
r,
|
|
488
488
|
() => _.input(
|
|
489
489
|
u.placeholder(n),
|
|
490
490
|
u.value(e),
|
|
491
491
|
u.class("bc-editable-text__input"),
|
|
492
492
|
It(),
|
|
493
|
-
|
|
493
|
+
$.keydown((i) => {
|
|
494
494
|
i.key === "Enter" ? r.set(!1) : i.key === "Escape" && (o.set(!0), r.set(!1));
|
|
495
495
|
}),
|
|
496
|
-
|
|
496
|
+
$.blur(
|
|
497
497
|
tt((i) => {
|
|
498
498
|
if (r.set(!1), o.value) {
|
|
499
499
|
o.set(!1);
|
|
@@ -504,11 +504,11 @@ const ge = ({
|
|
|
504
504
|
)
|
|
505
505
|
),
|
|
506
506
|
() => _.span(
|
|
507
|
-
|
|
507
|
+
$.click(() => {
|
|
508
508
|
p.get(c) || r.set(!0);
|
|
509
509
|
}),
|
|
510
510
|
u.class("bc-editable-text__display"),
|
|
511
|
-
|
|
511
|
+
j(
|
|
512
512
|
p.map(e, (i) => i != null && i.trim() !== ""),
|
|
513
513
|
() => _.span(u.class("bc-editable-text__text"), e),
|
|
514
514
|
() => _.span(
|
|
@@ -516,14 +516,14 @@ const ge = ({
|
|
|
516
516
|
n
|
|
517
517
|
)
|
|
518
518
|
),
|
|
519
|
-
|
|
519
|
+
j(
|
|
520
520
|
p.map(c, (i) => !i),
|
|
521
521
|
() => _.button(
|
|
522
522
|
u.type("button"),
|
|
523
523
|
u.class("bc-editable-text__edit-button"),
|
|
524
|
-
ct(
|
|
525
|
-
|
|
526
|
-
|
|
524
|
+
ct(wt, (i) => R.label(i.$.editLabel)),
|
|
525
|
+
$.click(() => r.set(!0)),
|
|
526
|
+
Q({ icon: "line-md/pencil", color: "neutral" })
|
|
527
527
|
)
|
|
528
528
|
)
|
|
529
529
|
)
|
|
@@ -534,14 +534,14 @@ const ge = ({
|
|
|
534
534
|
return U({
|
|
535
535
|
...t,
|
|
536
536
|
input: it.date(
|
|
537
|
-
|
|
537
|
+
V(t),
|
|
538
538
|
u.valueAsDate(e),
|
|
539
539
|
u.class("bc-input"),
|
|
540
|
-
s != null ?
|
|
541
|
-
n != null ?
|
|
542
|
-
a != null ?
|
|
540
|
+
s != null ? $.blur(tt(s)) : A,
|
|
541
|
+
n != null ? $.change(nt(n)) : A,
|
|
542
|
+
a != null ? $.input(nt(a)) : A
|
|
543
543
|
),
|
|
544
|
-
after: r != null ?
|
|
544
|
+
after: r != null ? E(c, r) : c
|
|
545
545
|
});
|
|
546
546
|
}, zt = (t) => {
|
|
547
547
|
const e = t.getFullYear(), s = t.getMonth() + 1, n = t.getDate(), a = t.getHours(), r = t.getMinutes(), o = t.getSeconds();
|
|
@@ -551,14 +551,14 @@ const ge = ({
|
|
|
551
551
|
return U({
|
|
552
552
|
...t,
|
|
553
553
|
input: it["datetime-local"](
|
|
554
|
-
|
|
554
|
+
V(t),
|
|
555
555
|
u.value(p.map(c, (l) => l ?? null)),
|
|
556
556
|
u.class("bc-input"),
|
|
557
|
-
s != null ?
|
|
558
|
-
n != null ?
|
|
559
|
-
a != null ?
|
|
557
|
+
s != null ? $.blur(tt(s)) : A,
|
|
558
|
+
n != null ? $.change(st(n)) : A,
|
|
559
|
+
a != null ? $.input(st(a)) : A
|
|
560
560
|
),
|
|
561
|
-
after: r != null ?
|
|
561
|
+
after: r != null ? E(i, r) : i
|
|
562
562
|
});
|
|
563
563
|
}, at = (t) => typeof t == "string" && t.trim() === "" ? null : t, Yt = (t) => t ?? "";
|
|
564
564
|
function O(t) {
|
|
@@ -571,13 +571,13 @@ function O(t) {
|
|
|
571
571
|
onChange: a != null ? (g) => a(at(g)) : void 0,
|
|
572
572
|
onInput: r != null ? (g) => r(at(g)) : void 0,
|
|
573
573
|
onBlur: n,
|
|
574
|
-
after: o != null ?
|
|
574
|
+
after: o != null ? E(l, o) : l
|
|
575
575
|
});
|
|
576
576
|
};
|
|
577
577
|
}
|
|
578
|
-
const he = O(kt), fe = O(xt), be = O(
|
|
578
|
+
const he = O(kt), fe = O(xt), be = O(Tt), ye = O(
|
|
579
579
|
ft
|
|
580
|
-
),
|
|
580
|
+
), we = ({
|
|
581
581
|
value: t,
|
|
582
582
|
onChange: e,
|
|
583
583
|
onInput: s,
|
|
@@ -590,60 +590,60 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
590
590
|
color: l = "primary",
|
|
591
591
|
tabIndex: g = 0
|
|
592
592
|
}) => {
|
|
593
|
-
const h = i ??
|
|
594
|
-
function b(
|
|
593
|
+
const h = i ?? Ct("switch");
|
|
594
|
+
function b(y, I) {
|
|
595
595
|
const f = [
|
|
596
596
|
"bc-switch",
|
|
597
597
|
`bc-switch--size-${I}`,
|
|
598
598
|
`bc-switch--${I}`
|
|
599
599
|
];
|
|
600
|
-
return
|
|
600
|
+
return y && f.push("bc-switch--disabled"), f.join(" ");
|
|
601
601
|
}
|
|
602
|
-
function d(
|
|
603
|
-
const I =
|
|
604
|
-
return f.set("--switch-track-on-bg", F.backgroundColor), f.set("--switch-track-on-label", F.textColor), f.set("--switch-track-on-bg-dark",
|
|
602
|
+
function d(y) {
|
|
603
|
+
const I = y ?? "primary", f = /* @__PURE__ */ new Map(), F = rt(I, "solid", "light"), C = rt(I, "solid", "dark");
|
|
604
|
+
return f.set("--switch-track-on-bg", F.backgroundColor), f.set("--switch-track-on-label", F.textColor), f.set("--switch-track-on-bg-dark", C.backgroundColor), f.set("--switch-track-on-label-dark", C.textColor), f.set(
|
|
605
605
|
"--switch-track-on-border-dark",
|
|
606
|
-
|
|
606
|
+
Mt(I, "dark")
|
|
607
607
|
), Array.from(f.entries()).map(([k, m]) => `${k}: ${m}`).join("; ");
|
|
608
608
|
}
|
|
609
|
-
const
|
|
609
|
+
const w = () => {
|
|
610
610
|
p.get(o) || (e?.(!p.get(t)), s?.(!p.get(t)));
|
|
611
|
-
}, x = (
|
|
612
|
-
p.get(o) || (
|
|
611
|
+
}, x = (y) => {
|
|
612
|
+
p.get(o) || (y.key === " " || y.key === "Enter") && (y.preventDefault(), w());
|
|
613
613
|
};
|
|
614
614
|
return _.div(
|
|
615
615
|
u.class(
|
|
616
|
-
|
|
616
|
+
D(
|
|
617
617
|
o ?? !1,
|
|
618
618
|
c
|
|
619
619
|
)(
|
|
620
|
-
(
|
|
620
|
+
(y, I) => b(y ?? !1, I ?? "md")
|
|
621
621
|
)
|
|
622
622
|
),
|
|
623
623
|
u.style(
|
|
624
|
-
|
|
625
|
-
(
|
|
624
|
+
D(l)(
|
|
625
|
+
(y) => d(y)
|
|
626
626
|
)
|
|
627
627
|
),
|
|
628
628
|
u.id(h),
|
|
629
629
|
u.role("switch"),
|
|
630
630
|
u.tabindex(
|
|
631
|
-
|
|
631
|
+
D(
|
|
632
632
|
o ?? !1,
|
|
633
633
|
g
|
|
634
|
-
)((
|
|
634
|
+
)((y, I) => y ? -1 : I ?? 0)
|
|
635
635
|
),
|
|
636
636
|
R.checked(t),
|
|
637
637
|
R.disabled(o),
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
n != null ?
|
|
638
|
+
$.click(w),
|
|
639
|
+
$.keydown(x),
|
|
640
|
+
n != null ? $.blur(n) : null,
|
|
641
641
|
_.div(
|
|
642
642
|
u.class("bc-switch__track"),
|
|
643
643
|
u.class(
|
|
644
644
|
p.map(
|
|
645
645
|
t,
|
|
646
|
-
(
|
|
646
|
+
(y) => y ? "bc-switch__track--on" : "bc-switch__track--off"
|
|
647
647
|
)
|
|
648
648
|
),
|
|
649
649
|
a != null ? _.div(
|
|
@@ -652,7 +652,7 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
652
652
|
u.class(
|
|
653
653
|
p.map(
|
|
654
654
|
t,
|
|
655
|
-
(
|
|
655
|
+
(y) => y ? "bc-switch__track-label--hidden" : "bc-switch__track-label--visible"
|
|
656
656
|
)
|
|
657
657
|
),
|
|
658
658
|
a
|
|
@@ -662,14 +662,14 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
662
662
|
u.class(
|
|
663
663
|
p.map(
|
|
664
664
|
t,
|
|
665
|
-
(
|
|
665
|
+
(y) => y ? "bc-switch__track-label--visible" : "bc-switch__track-label--hidden"
|
|
666
666
|
)
|
|
667
667
|
),
|
|
668
668
|
r
|
|
669
669
|
) : null,
|
|
670
670
|
_t(
|
|
671
|
-
(
|
|
672
|
-
|
|
671
|
+
(y) => ct(
|
|
672
|
+
$t,
|
|
673
673
|
({ direction: I }) => _.div(
|
|
674
674
|
u.class("bc-switch__thumb"),
|
|
675
675
|
u.class(
|
|
@@ -679,14 +679,14 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
679
679
|
)
|
|
680
680
|
),
|
|
681
681
|
lt.transform(
|
|
682
|
-
|
|
682
|
+
D(
|
|
683
683
|
t,
|
|
684
|
-
|
|
684
|
+
y,
|
|
685
685
|
c,
|
|
686
686
|
I
|
|
687
|
-
)((f, { width: F },
|
|
687
|
+
)((f, { width: F }, C, k) => {
|
|
688
688
|
const m = (() => {
|
|
689
|
-
switch (
|
|
689
|
+
switch (C) {
|
|
690
690
|
case "xs":
|
|
691
691
|
return 5;
|
|
692
692
|
case "sm":
|
|
@@ -698,8 +698,8 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
698
698
|
case "xl":
|
|
699
699
|
return 8;
|
|
700
700
|
}
|
|
701
|
-
})(),
|
|
702
|
-
return f ? `translateX(${
|
|
701
|
+
})(), M = k === "rtl" ? `calc((var(--spacing-base) * ${m}) - ${F}px)` : `calc(${F}px - (var(--spacing-base) * ${m}))`;
|
|
702
|
+
return f ? `translateX(${M})` : "translateX(0)";
|
|
703
703
|
})
|
|
704
704
|
)
|
|
705
705
|
)
|
|
@@ -707,7 +707,7 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
707
707
|
)
|
|
708
708
|
)
|
|
709
709
|
);
|
|
710
|
-
}, xe = O(bt),
|
|
710
|
+
}, xe = O(bt), Gt = "line-md:star-alt-filled", Kt = "line-md:star-alt", qt = (t) => {
|
|
711
711
|
const {
|
|
712
712
|
value: e,
|
|
713
713
|
onChange: s,
|
|
@@ -715,30 +715,30 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
715
715
|
max: a = 5,
|
|
716
716
|
fullColor: r = "yellow",
|
|
717
717
|
emptyColor: o = "neutral",
|
|
718
|
-
fullIcon: c =
|
|
719
|
-
emptyIcon: i =
|
|
718
|
+
fullIcon: c = Gt,
|
|
719
|
+
emptyIcon: i = Kt,
|
|
720
720
|
size: l = "md",
|
|
721
721
|
onBlur: g,
|
|
722
722
|
rounding: h = 1
|
|
723
723
|
} = t, b = () => {
|
|
724
724
|
const f = p.get(h);
|
|
725
725
|
return f > 0 ? f : 1;
|
|
726
|
-
}, d = (f) => Math.min(Math.max(f, 0), p.get(a)),
|
|
726
|
+
}, d = (f) => Math.min(Math.max(f, 0), p.get(a)), w = (f, F) => {
|
|
727
727
|
if (p.get(n ?? !1)) return;
|
|
728
|
-
const k = f.currentTarget.getBoundingClientRect(), m = (f.clientX - k.left) / k.width,
|
|
728
|
+
const k = f.currentTarget.getBoundingClientRect(), m = (f.clientX - k.left) / k.width, M = F - 1 + m, T = b(), v = Math.ceil(M / T) * T, S = d(v);
|
|
729
729
|
s?.(S);
|
|
730
730
|
}, x = (f) => {
|
|
731
731
|
if (p.get(n ?? !1)) return;
|
|
732
|
-
const F = b(),
|
|
732
|
+
const F = b(), C = p.get(e) ?? 0;
|
|
733
733
|
let k;
|
|
734
734
|
switch (f.key) {
|
|
735
735
|
case "ArrowRight":
|
|
736
736
|
case "ArrowUp":
|
|
737
|
-
k = d(
|
|
737
|
+
k = d(C + F);
|
|
738
738
|
break;
|
|
739
739
|
case "ArrowLeft":
|
|
740
740
|
case "ArrowDown":
|
|
741
|
-
k = d(
|
|
741
|
+
k = d(C - F);
|
|
742
742
|
break;
|
|
743
743
|
case "Home":
|
|
744
744
|
k = 0;
|
|
@@ -750,10 +750,10 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
752
|
f.preventDefault(), s?.(k);
|
|
753
|
-
},
|
|
753
|
+
}, y = p.map(l, (f) => `bc-icon--${f}`), I = ({ index: f, counter: F }) => _.span(
|
|
754
754
|
u.class("bc-rating-input__icon-container"),
|
|
755
|
-
u.class(
|
|
756
|
-
|
|
755
|
+
u.class(y),
|
|
756
|
+
Q(
|
|
757
757
|
{
|
|
758
758
|
icon: i,
|
|
759
759
|
size: l,
|
|
@@ -764,14 +764,14 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
764
764
|
),
|
|
765
765
|
_.span(
|
|
766
766
|
u.class("bc-rating-input__icon-clipper"),
|
|
767
|
-
u.class(
|
|
767
|
+
u.class(y),
|
|
768
768
|
lt.width(
|
|
769
|
-
p.map(e, (
|
|
770
|
-
const k = Math.floor(
|
|
771
|
-
return k > f ? "100%" : k < f ? "0%" : `${(
|
|
769
|
+
p.map(e, (C) => {
|
|
770
|
+
const k = Math.floor(C);
|
|
771
|
+
return k > f ? "100%" : k < f ? "0%" : `${(C - f) * 100}%`;
|
|
772
772
|
})
|
|
773
773
|
),
|
|
774
|
-
|
|
774
|
+
Q(
|
|
775
775
|
{
|
|
776
776
|
icon: c,
|
|
777
777
|
size: l,
|
|
@@ -781,8 +781,8 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
781
781
|
u.class("bc-rating-input__icon-full")
|
|
782
782
|
)
|
|
783
783
|
),
|
|
784
|
-
|
|
785
|
-
dt((
|
|
784
|
+
$.click(
|
|
785
|
+
dt((C) => w(C, F), {
|
|
786
786
|
preventDefault: !0,
|
|
787
787
|
stopPropagation: !0
|
|
788
788
|
})
|
|
@@ -795,7 +795,7 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
795
795
|
...t,
|
|
796
796
|
input: _.div(
|
|
797
797
|
// Common input attributes (id, required, invalid, custom classes, etc.)
|
|
798
|
-
|
|
798
|
+
V(t),
|
|
799
799
|
u.class("bc-rating-input"),
|
|
800
800
|
// ARIA slider semantics
|
|
801
801
|
u.role("slider"),
|
|
@@ -805,23 +805,23 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
805
805
|
R.valuemax(p.map(a, (f) => f ?? 0)),
|
|
806
806
|
R.valuenow(p.map(e, (f) => f ?? 0)),
|
|
807
807
|
R.valuetext(
|
|
808
|
-
|
|
808
|
+
D(
|
|
809
809
|
e,
|
|
810
810
|
a
|
|
811
811
|
)((f, F) => {
|
|
812
|
-
const
|
|
813
|
-
return `${String(
|
|
812
|
+
const C = f ?? 0, k = F ?? 0;
|
|
813
|
+
return `${String(C)} / ${String(k)}`;
|
|
814
814
|
})
|
|
815
815
|
),
|
|
816
816
|
// Keyboard & focus handlers
|
|
817
|
-
|
|
818
|
-
g != null ?
|
|
817
|
+
$.keydown(x),
|
|
818
|
+
g != null ? $.blur(g) : null,
|
|
819
819
|
gt(a, I)
|
|
820
820
|
)
|
|
821
821
|
});
|
|
822
|
-
},
|
|
822
|
+
}, $e = (t) => {
|
|
823
823
|
const { value: e, onChange: s, onInput: n, onBlur: a, after: r, disabled: o, ...c } = t, i = X(e, o, s ?? n);
|
|
824
|
-
return
|
|
824
|
+
return qt({
|
|
825
825
|
...c,
|
|
826
826
|
// Map null -> 0 for display so the control shows as empty when null
|
|
827
827
|
value: p.map(e, (l) => l ?? 0),
|
|
@@ -829,9 +829,9 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
829
829
|
onChange: s,
|
|
830
830
|
onInput: n,
|
|
831
831
|
onBlur: a,
|
|
832
|
-
after: r != null ?
|
|
832
|
+
after: r != null ? E(i, r) : i
|
|
833
833
|
});
|
|
834
|
-
},
|
|
834
|
+
}, Me = (t) => {
|
|
835
835
|
const { value: e, step: s, min: n, max: a, onBlur: r, onChange: o, onInput: c } = t;
|
|
836
836
|
return U({
|
|
837
837
|
...t,
|
|
@@ -839,16 +839,16 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
839
839
|
focusableSelector: 'input[type="range"]',
|
|
840
840
|
input: _.input(
|
|
841
841
|
u.type("range"),
|
|
842
|
-
|
|
842
|
+
V(t),
|
|
843
843
|
u.min(n),
|
|
844
844
|
u.max(a),
|
|
845
845
|
u.step(s),
|
|
846
846
|
// Using value as number to keep it in sync
|
|
847
847
|
u.valueAsNumber(e),
|
|
848
848
|
u.class("bc-input bc-slider-input"),
|
|
849
|
-
r != null ?
|
|
850
|
-
o != null ?
|
|
851
|
-
c != null ?
|
|
849
|
+
r != null ? $.blur(B(r)) : A,
|
|
850
|
+
o != null ? $.change(B(o)) : A,
|
|
851
|
+
c != null ? $.input(B(c)) : A
|
|
852
852
|
)
|
|
853
853
|
});
|
|
854
854
|
}, Ie = (t) => {
|
|
@@ -868,33 +868,33 @@ const he = O(kt), fe = O(xt), be = O(Ct), we = O(
|
|
|
868
868
|
after: l,
|
|
869
869
|
input: _.input(
|
|
870
870
|
u.type("range"),
|
|
871
|
-
|
|
871
|
+
V(t),
|
|
872
872
|
u.min(n),
|
|
873
873
|
u.max(a),
|
|
874
874
|
u.step(s),
|
|
875
875
|
u.valueAsNumber(i),
|
|
876
876
|
u.class("bc-input bc-slider-input"),
|
|
877
|
-
r != null ?
|
|
878
|
-
o != null ?
|
|
879
|
-
|
|
877
|
+
r != null ? $.blur(B(r)) : A,
|
|
878
|
+
o != null ? $.change(
|
|
879
|
+
B((g) => {
|
|
880
880
|
o(g);
|
|
881
881
|
})
|
|
882
882
|
) : A,
|
|
883
|
-
c != null ?
|
|
884
|
-
|
|
883
|
+
c != null ? $.input(
|
|
884
|
+
B((g) => {
|
|
885
885
|
c(g);
|
|
886
886
|
})
|
|
887
887
|
) : A
|
|
888
888
|
)
|
|
889
889
|
},
|
|
890
890
|
// Ensure container grows input naturally
|
|
891
|
-
|
|
891
|
+
E()
|
|
892
892
|
);
|
|
893
|
-
}, _e = O(
|
|
894
|
-
function
|
|
895
|
-
if (typeof t == "boolean") return
|
|
893
|
+
}, _e = O(yt), q = ["description", "comment", "notes", "text"];
|
|
894
|
+
function Qt(t) {
|
|
895
|
+
if (typeof t == "boolean") return q;
|
|
896
896
|
const e = t["x:ui"];
|
|
897
|
-
return e && Array.isArray(e.textAreaTriggers) ? [...
|
|
897
|
+
return e && Array.isArray(e.textAreaTriggers) ? [...q, ...e.textAreaTriggers] : q;
|
|
898
898
|
}
|
|
899
899
|
function Jt(t) {
|
|
900
900
|
if (typeof t == "boolean") return;
|
|
@@ -984,7 +984,7 @@ function Zt(t, e) {
|
|
|
984
984
|
return { widget: "url", source: "heuristics" };
|
|
985
985
|
if (r.includes("color"))
|
|
986
986
|
return { widget: "color", source: "heuristics" };
|
|
987
|
-
if (
|
|
987
|
+
if (Qt(t).some(
|
|
988
988
|
(c) => r.includes(c.toLowerCase())
|
|
989
989
|
))
|
|
990
990
|
return { widget: "textarea", source: "heuristics" };
|
|
@@ -1084,7 +1084,7 @@ class te {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
}
|
|
1086
1086
|
const ke = new te();
|
|
1087
|
-
function
|
|
1087
|
+
function Te(t, e, s) {
|
|
1088
1088
|
return {
|
|
1089
1089
|
name: t,
|
|
1090
1090
|
factory: e,
|
|
@@ -1094,7 +1094,7 @@ function Ce(t, e, s) {
|
|
|
1094
1094
|
...s
|
|
1095
1095
|
};
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1097
|
+
function Ce(t, e, s) {
|
|
1098
1098
|
return {
|
|
1099
1099
|
name: s?.name || `custom-${t}`,
|
|
1100
1100
|
factory: e,
|
|
@@ -1117,6 +1117,29 @@ function Fe(t, e, s, n) {
|
|
|
1117
1117
|
...n
|
|
1118
1118
|
};
|
|
1119
1119
|
}
|
|
1120
|
+
function Ae(t) {
|
|
1121
|
+
const e = t?.logPrefix ?? "WIDGET_DIAG", s = t?.filterFn ?? (() => !0);
|
|
1122
|
+
return {
|
|
1123
|
+
name: "__diagnostic-widget__",
|
|
1124
|
+
factory: () => null,
|
|
1125
|
+
displayName: "Diagnostic Widget (never matches)",
|
|
1126
|
+
priority: -1e3,
|
|
1127
|
+
// Very low priority, should never actually match
|
|
1128
|
+
matcher: (n) => {
|
|
1129
|
+
if (!s(n)) return !1;
|
|
1130
|
+
const a = n.definition, r = {
|
|
1131
|
+
name: n.name,
|
|
1132
|
+
path: n.path.map(String),
|
|
1133
|
+
type: a?.type,
|
|
1134
|
+
hasRegistry: n.widgetRegistry !== void 0,
|
|
1135
|
+
definition: a
|
|
1136
|
+
};
|
|
1137
|
+
return console.log(
|
|
1138
|
+
`[${e}] name="${r.name ?? "ROOT"}" path=[${r.path.join(", ")}] type="${r.type ?? "unknown"}" hasRegistry=${r.hasRegistry}`
|
|
1139
|
+
), t?.onProcess?.(r), !1;
|
|
1140
|
+
}
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1120
1143
|
export {
|
|
1121
1144
|
ie as A,
|
|
1122
1145
|
le as B,
|
|
@@ -1124,42 +1147,43 @@ export {
|
|
|
1124
1147
|
Nt as D,
|
|
1125
1148
|
ge as E,
|
|
1126
1149
|
Rt as F,
|
|
1127
|
-
|
|
1150
|
+
Dt as G,
|
|
1128
1151
|
pt as H,
|
|
1129
|
-
|
|
1152
|
+
Lt as I,
|
|
1130
1153
|
Z as J,
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1154
|
+
Bt as K,
|
|
1155
|
+
G as L,
|
|
1156
|
+
K as M,
|
|
1134
1157
|
de as N,
|
|
1135
|
-
|
|
1136
|
-
|
|
1158
|
+
Et as O,
|
|
1159
|
+
Vt as P,
|
|
1137
1160
|
P as Q,
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1161
|
+
qt as R,
|
|
1162
|
+
we as S,
|
|
1163
|
+
W as T,
|
|
1141
1164
|
ke as U,
|
|
1142
1165
|
Zt as V,
|
|
1143
1166
|
Jt as W,
|
|
1144
1167
|
te as X,
|
|
1168
|
+
Ae as Y,
|
|
1145
1169
|
ut as a,
|
|
1146
1170
|
St as b,
|
|
1147
|
-
|
|
1171
|
+
Ce as c,
|
|
1148
1172
|
Fe as d,
|
|
1149
1173
|
at as e,
|
|
1150
|
-
|
|
1174
|
+
Te as f,
|
|
1151
1175
|
Ut as g,
|
|
1152
|
-
|
|
1176
|
+
jt as h,
|
|
1153
1177
|
ce as i,
|
|
1154
1178
|
me as j,
|
|
1155
1179
|
he as k,
|
|
1156
1180
|
be as l,
|
|
1157
|
-
|
|
1181
|
+
ye as m,
|
|
1158
1182
|
Yt as n,
|
|
1159
1183
|
fe as o,
|
|
1160
1184
|
xe as p,
|
|
1161
|
-
|
|
1162
|
-
|
|
1185
|
+
$e as q,
|
|
1186
|
+
Me as r,
|
|
1163
1187
|
Ie as s,
|
|
1164
1188
|
_e as t,
|
|
1165
1189
|
pe as u,
|
|
@@ -1167,5 +1191,5 @@ export {
|
|
|
1167
1191
|
At as w,
|
|
1168
1192
|
vt as x,
|
|
1169
1193
|
J as y,
|
|
1170
|
-
|
|
1194
|
+
H as z
|
|
1171
1195
|
};
|