@mt-gloss/ui 0.1.136 → 0.1.138
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/{COMMITS-B_qGBoy7.js → COMMITS-aGwevMtR.js} +254 -186
- package/{Expandable-DA4NFzCR.js → Expandable-G7SCUlMb.js} +740 -738
- package/catalog.js +2 -2
- package/composites-panels.js +762 -644
- package/index.js +804 -852
- package/lib/composites/panels/coordinator/settingsBufferSchemas.d.ts +9 -4
- package/lib/composites/panels/index.d.ts +0 -2
- package/lib/composites/panels/shells/SettingsShell.d.ts +14 -16
- package/lib/composites/panels/shells/index.d.ts +0 -2
- package/lib/composites/panels/shells/settings/ColorControls.d.ts +13 -0
- package/lib/composites/panels/shells/settings/SlotsControls.d.ts +1 -6
- package/lib/composites/panels/shells/settings/ThresholdControls.d.ts +10 -0
- package/lib/composites/panels/shells/settings/index.d.ts +4 -6
- package/lib/composites/panels/stage3d/CloneStage.d.ts +11 -1
- package/lib/facade/index.d.ts +0 -2
- package/lib/presets/PresetMenu/PresetMenu.d.ts +1 -0
- package/package.json +1 -1
- package/ui.css +1 -1
- package/lib/composites/panels/shells/MetricInfoShell.d.ts +0 -29
- package/lib/composites/panels/shells/settings/GhostSlotPill.d.ts +0 -7
|
@@ -1,7 +1,55 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { motion as
|
|
3
|
-
import Z, { useSyncExternalStore as le, useState as A, useRef as O, useMemo as
|
|
4
|
-
import { z as
|
|
1
|
+
import { jsx as i, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { motion as ie } from "framer-motion";
|
|
3
|
+
import Z, { useSyncExternalStore as le, useState as A, useRef as O, useMemo as z, useEffect as w, useCallback as T, createContext as ae, useContext as W, useReducer as ce, useId as X, useLayoutEffect as G } from "react";
|
|
4
|
+
import { z as L } from "zod";
|
|
5
|
+
const Je = {
|
|
6
|
+
forwardStaggerMs: 50,
|
|
7
|
+
reverseStaggerMs: 30,
|
|
8
|
+
springStiffness: 380,
|
|
9
|
+
springDamping: 32,
|
|
10
|
+
reverseVelocityMultiplier: 1.4
|
|
11
|
+
}, en = {
|
|
12
|
+
enterDurationMs: 220,
|
|
13
|
+
exitDurationMs: 140,
|
|
14
|
+
enterEasing: "cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
15
|
+
exitEasing: "cubic-bezier(0.4, 0, 1, 1)",
|
|
16
|
+
translateOffsetPx: 8
|
|
17
|
+
}, nn = {
|
|
18
|
+
shiverCycles: 3,
|
|
19
|
+
shiverAmplitudePx: 2,
|
|
20
|
+
shiverDurationMs: 180,
|
|
21
|
+
validCellOpacity: 0.6
|
|
22
|
+
}, tn = {
|
|
23
|
+
materializeMs: 180,
|
|
24
|
+
dematerializeMs: 140,
|
|
25
|
+
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
26
|
+
dotStrokePx: 2,
|
|
27
|
+
dividerDashGapPx: 4
|
|
28
|
+
}, rn = {
|
|
29
|
+
cascadeStaggerMs: 0,
|
|
30
|
+
cascadeSpringCapMs: 120,
|
|
31
|
+
swingEnterMs: 100,
|
|
32
|
+
swingEnterStyle: "opacity",
|
|
33
|
+
provisionalMs: 80,
|
|
34
|
+
provisionalStyle: "opacity",
|
|
35
|
+
shiverMs: 200,
|
|
36
|
+
shiverStyle: "color-flash"
|
|
37
|
+
}, on = !0, sn = {
|
|
38
|
+
rejectionFill: "var(--gloss-rejection-fill)",
|
|
39
|
+
rejectionStroke: "var(--gloss-rejection-stroke)",
|
|
40
|
+
validFill: "var(--gloss-valid-fill)",
|
|
41
|
+
validStroke: "var(--gloss-valid-stroke)",
|
|
42
|
+
validCellStroke: "var(--gloss-valid-cell-stroke)",
|
|
43
|
+
provisionalWash: "var(--gloss-provisional-wash)"
|
|
44
|
+
};
|
|
45
|
+
function ln() {
|
|
46
|
+
if (typeof window > "u") return "full";
|
|
47
|
+
try {
|
|
48
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "reduced" : "full";
|
|
49
|
+
} catch {
|
|
50
|
+
return "full";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
5
53
|
const de = "(prefers-reduced-motion: reduce)";
|
|
6
54
|
function J() {
|
|
7
55
|
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(de);
|
|
@@ -34,38 +82,38 @@ function ge({
|
|
|
34
82
|
activeTab: n,
|
|
35
83
|
onSelect: t,
|
|
36
84
|
reduced: r,
|
|
37
|
-
labels:
|
|
85
|
+
labels: s,
|
|
38
86
|
ariaLabel: a = "Settings dimensions"
|
|
39
87
|
}) {
|
|
40
88
|
const c = ee(), o = r ?? c;
|
|
41
89
|
if (e.length < 2) return null;
|
|
42
|
-
const p = (d) =>
|
|
90
|
+
const p = (d) => s?.[d] ?? me[d], u = (d, m) => {
|
|
43
91
|
d.key === "ArrowRight" ? (d.preventDefault(), t(e[(m + 1) % e.length])) : d.key === "ArrowLeft" ? (d.preventDefault(), t(e[(m - 1 + e.length) % e.length])) : d.key === "Home" ? (d.preventDefault(), t(e[0])) : d.key === "End" && (d.preventDefault(), t(e[e.length - 1]));
|
|
44
92
|
};
|
|
45
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ i(
|
|
46
94
|
"div",
|
|
47
95
|
{
|
|
48
96
|
role: "tablist",
|
|
49
97
|
"aria-label": a,
|
|
50
98
|
className: "settings-tab-strip",
|
|
51
99
|
children: e.map((d, m) => {
|
|
52
|
-
const
|
|
100
|
+
const _ = n === d;
|
|
53
101
|
return /* @__PURE__ */ N(
|
|
54
102
|
"button",
|
|
55
103
|
{
|
|
56
104
|
role: "tab",
|
|
57
105
|
type: "button",
|
|
58
106
|
id: `settings-tab-${d}`,
|
|
59
|
-
"aria-selected":
|
|
107
|
+
"aria-selected": _,
|
|
60
108
|
"aria-controls": `settings-tabpanel-${d}`,
|
|
61
|
-
tabIndex:
|
|
62
|
-
className: `settings-tab-strip__tab${
|
|
109
|
+
tabIndex: _ ? 0 : -1,
|
|
110
|
+
className: `settings-tab-strip__tab${_ ? " settings-tab-strip__tab--active" : ""}`,
|
|
63
111
|
onClick: () => t(d),
|
|
64
|
-
onKeyDown: (
|
|
112
|
+
onKeyDown: (k) => u(k, m),
|
|
65
113
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
|
|
68
|
-
|
|
114
|
+
/* @__PURE__ */ i("span", { className: "settings-tab-strip__label", children: p(d) }),
|
|
115
|
+
_ && !o && /* @__PURE__ */ i(
|
|
116
|
+
ie.span,
|
|
69
117
|
{
|
|
70
118
|
layoutId: "settings-active-tab-indicator",
|
|
71
119
|
"data-layout-id": "settings-active-tab-indicator",
|
|
@@ -94,8 +142,8 @@ function Q(e, n) {
|
|
|
94
142
|
return t ? t.zoneKey : U(e, n);
|
|
95
143
|
}
|
|
96
144
|
function he(e, n, t) {
|
|
97
|
-
const r = [...e], [
|
|
98
|
-
return r.splice(t, 0,
|
|
145
|
+
const r = [...e], [s] = r.splice(n, 1);
|
|
146
|
+
return r.splice(t, 0, s), r;
|
|
99
147
|
}
|
|
100
148
|
function ve(e) {
|
|
101
149
|
return e.map((n) => `${n.zoneKey}:${n.items.map((t) => t.id).join(",")}`).join("|");
|
|
@@ -105,9 +153,9 @@ function ye(e) {
|
|
|
105
153
|
() => e.zones.map((l) => l.maxItems !== void 0 && l.items.length > l.maxItems ? (process.env.NODE_ENV !== "production" && console.warn(
|
|
106
154
|
`useSortableZones: zone "${l.zoneKey}" exceeds maxItems (${l.items.length} > ${l.maxItems}); trimming to cap.`
|
|
107
155
|
), { ...l, items: l.items.slice(0, l.maxItems) }) : l)
|
|
108
|
-
), [r,
|
|
156
|
+
), [r, s] = A(null), [a, c] = A(null), o = O(null), p = O(e.onZoneChange);
|
|
109
157
|
p.current = e.onZoneChange;
|
|
110
|
-
const u =
|
|
158
|
+
const u = z(
|
|
111
159
|
() => ve(e.zones),
|
|
112
160
|
[e.zones]
|
|
113
161
|
), d = O(u);
|
|
@@ -121,18 +169,18 @@ function ye(e) {
|
|
|
121
169
|
const m = T(
|
|
122
170
|
(l) => {
|
|
123
171
|
const g = l.active.id;
|
|
124
|
-
let
|
|
125
|
-
for (const
|
|
126
|
-
const P =
|
|
172
|
+
let C = null, y = null;
|
|
173
|
+
for (const b of n) {
|
|
174
|
+
const P = b.items.find((f) => f.id === g);
|
|
127
175
|
if (P) {
|
|
128
|
-
|
|
176
|
+
C = P, y = b.zoneKey;
|
|
129
177
|
break;
|
|
130
178
|
}
|
|
131
179
|
}
|
|
132
|
-
o.current = y,
|
|
180
|
+
o.current = y, s(C), c(y);
|
|
133
181
|
},
|
|
134
182
|
[n]
|
|
135
|
-
),
|
|
183
|
+
), _ = T(
|
|
136
184
|
(l) => {
|
|
137
185
|
if (!l.over) {
|
|
138
186
|
c(o.current);
|
|
@@ -142,45 +190,45 @@ function ye(e) {
|
|
|
142
190
|
c(g);
|
|
143
191
|
},
|
|
144
192
|
[n]
|
|
145
|
-
),
|
|
193
|
+
), k = T(
|
|
146
194
|
(l) => {
|
|
147
|
-
const { active: g, over:
|
|
148
|
-
o.current = null,
|
|
195
|
+
const { active: g, over: C } = l, y = () => {
|
|
196
|
+
o.current = null, s(null), c(null);
|
|
149
197
|
};
|
|
150
|
-
if (!
|
|
198
|
+
if (!C) {
|
|
151
199
|
y();
|
|
152
200
|
return;
|
|
153
201
|
}
|
|
154
|
-
const
|
|
155
|
-
if (!
|
|
202
|
+
const b = U(n, g.id), P = Q(n, C.id);
|
|
203
|
+
if (!b || !P) {
|
|
156
204
|
y();
|
|
157
205
|
return;
|
|
158
206
|
}
|
|
159
|
-
let f = n.map((
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
f[
|
|
163
|
-
...
|
|
164
|
-
items: he(
|
|
207
|
+
let f = n.map((E) => ({ ...E, items: [...E.items] }));
|
|
208
|
+
if (b === P) {
|
|
209
|
+
const E = f.findIndex((D) => D.zoneKey === b), I = f[E], h = I.items.findIndex((D) => D.id === g.id), S = I.items.findIndex((D) => D.id === C.id), R = S >= 0 ? S : Math.max(0, I.items.length - 1);
|
|
210
|
+
f[E] = {
|
|
211
|
+
...I,
|
|
212
|
+
items: he(I.items, h, R)
|
|
165
213
|
};
|
|
166
214
|
} else {
|
|
167
|
-
const
|
|
168
|
-
if (!
|
|
215
|
+
const E = f.findIndex((v) => v.zoneKey === b), I = f.findIndex((v) => v.zoneKey === P), h = f[E], S = f[I], R = h.items.find((v) => v.id === g.id);
|
|
216
|
+
if (!R) {
|
|
169
217
|
y();
|
|
170
218
|
return;
|
|
171
219
|
}
|
|
172
|
-
const D = h.items.filter((v) => v.id !== g.id),
|
|
173
|
-
let j = D, x = [...
|
|
174
|
-
if (
|
|
220
|
+
const D = h.items.filter((v) => v.id !== g.id), $ = S.items.findIndex((v) => v.id === C.id), oe = $ >= 0 ? $ : S.items.length;
|
|
221
|
+
let j = D, x = [...S.items];
|
|
222
|
+
if (S.maxItems !== void 0 && x.length >= S.maxItems) {
|
|
175
223
|
const v = x[x.length - 1];
|
|
176
|
-
x = x.slice(0,
|
|
224
|
+
x = x.slice(0, S.maxItems - 1), j = [...D, v];
|
|
177
225
|
}
|
|
178
|
-
const q = Math.min(oe, x.length),
|
|
226
|
+
const q = Math.min(oe, x.length), se = [
|
|
179
227
|
...x.slice(0, q),
|
|
180
|
-
|
|
228
|
+
R,
|
|
181
229
|
...x.slice(q)
|
|
182
230
|
];
|
|
183
|
-
f[
|
|
231
|
+
f[E] = { ...h, items: j }, f[I] = { ...S, items: se };
|
|
184
232
|
}
|
|
185
233
|
t(f), p.current?.(f), y();
|
|
186
234
|
},
|
|
@@ -209,12 +257,12 @@ function ye(e) {
|
|
|
209
257
|
getZoneProps: H,
|
|
210
258
|
getItemProps: B,
|
|
211
259
|
handleDragStart: m,
|
|
212
|
-
handleDragOver:
|
|
213
|
-
handleDragEnd:
|
|
260
|
+
handleDragOver: _,
|
|
261
|
+
handleDragEnd: k
|
|
214
262
|
};
|
|
215
263
|
}
|
|
216
|
-
let
|
|
217
|
-
const
|
|
264
|
+
let M = null, F = null, K = !1;
|
|
265
|
+
const Ee = [
|
|
218
266
|
"DndContext",
|
|
219
267
|
"DragOverlay",
|
|
220
268
|
"useSensors",
|
|
@@ -223,22 +271,22 @@ const Ie = [
|
|
|
223
271
|
"PointerSensor",
|
|
224
272
|
"KeyboardSensor",
|
|
225
273
|
"closestCenter"
|
|
226
|
-
],
|
|
274
|
+
], Ie = [
|
|
227
275
|
"SortableContext",
|
|
228
276
|
"useSortable",
|
|
229
277
|
"verticalListSortingStrategy"
|
|
230
278
|
];
|
|
231
|
-
function
|
|
279
|
+
function Se(e, n) {
|
|
232
280
|
const t = [], r = e ?? {};
|
|
233
|
-
for (const a of Ie)
|
|
234
|
-
r[a] === void 0 && t.push(`@dnd-kit/core:${a}`);
|
|
235
|
-
const i = n ?? {};
|
|
236
281
|
for (const a of Ee)
|
|
237
|
-
|
|
282
|
+
r[a] === void 0 && t.push(`@dnd-kit/core:${a}`);
|
|
283
|
+
const s = n ?? {};
|
|
284
|
+
for (const a of Ie)
|
|
285
|
+
s[a] === void 0 && t.push(`@dnd-kit/sortable:${a}`);
|
|
238
286
|
return t.length === 0 ? { ok: !0 } : { ok: !1, missing: t };
|
|
239
287
|
}
|
|
240
|
-
function
|
|
241
|
-
return
|
|
288
|
+
function Ce() {
|
|
289
|
+
return M ? Promise.resolve(M) : K ? Promise.resolve(null) : F || (F = (async () => {
|
|
242
290
|
try {
|
|
243
291
|
const [e, n, t] = await Promise.all([
|
|
244
292
|
import("@dnd-kit/core"),
|
|
@@ -246,66 +294,66 @@ function Se() {
|
|
|
246
294
|
import("@dnd-kit/utilities").catch(() => (process.env.NODE_ENV !== "production" && console.warn(
|
|
247
295
|
"SortableZones: @dnd-kit/utilities failed to load; drag-overlay positioning will fall back (items may teleport instead of slide)."
|
|
248
296
|
), {}))
|
|
249
|
-
]), r =
|
|
250
|
-
return r.ok ? (
|
|
297
|
+
]), r = Se(e, n);
|
|
298
|
+
return r.ok ? (M = {
|
|
251
299
|
core: e,
|
|
252
300
|
sortable: n,
|
|
253
301
|
utilities: t
|
|
254
|
-
},
|
|
302
|
+
}, M) : (K = !0, process.env.NODE_ENV !== "production" && console.error(
|
|
255
303
|
`SortableZones: @dnd-kit shape mismatch — missing exports: ${r.missing.join(", ")}. Check installed versions against optionalDependencies in @mt-gloss/ui.`
|
|
256
304
|
), null);
|
|
257
305
|
} catch {
|
|
258
|
-
return
|
|
306
|
+
return K = !0, null;
|
|
259
307
|
}
|
|
260
308
|
})(), F);
|
|
261
309
|
}
|
|
262
|
-
function
|
|
263
|
-
const { zones: n, onZoneChange: t, renderZone: r, renderItem:
|
|
310
|
+
function be(e) {
|
|
311
|
+
const { zones: n, onZoneChange: t, renderZone: r, renderItem: s, renderDragOverlay: a } = e, c = ye({ zones: n, onZoneChange: t }), [o, p] = Z.useState(M);
|
|
264
312
|
return Z.useEffect(() => {
|
|
265
313
|
if (o) return;
|
|
266
314
|
let u = !0;
|
|
267
|
-
return
|
|
315
|
+
return Ce().then((d) => {
|
|
268
316
|
u && p(d);
|
|
269
317
|
}), () => {
|
|
270
318
|
u = !1;
|
|
271
319
|
};
|
|
272
|
-
}, [o]), o ? /* @__PURE__ */
|
|
320
|
+
}, [o]), o ? /* @__PURE__ */ i(
|
|
273
321
|
ne,
|
|
274
322
|
{
|
|
275
323
|
state: c,
|
|
276
324
|
modules: o,
|
|
277
325
|
renderZone: r,
|
|
278
|
-
renderItem:
|
|
326
|
+
renderItem: s,
|
|
279
327
|
renderDragOverlay: a
|
|
280
328
|
}
|
|
281
|
-
) : /* @__PURE__ */
|
|
282
|
-
const d = u.items.map((m) => /* @__PURE__ */
|
|
283
|
-
return /* @__PURE__ */
|
|
329
|
+
) : /* @__PURE__ */ i("div", { "data-sortable-zones-passive": "true", children: c.zones.map((u) => {
|
|
330
|
+
const d = u.items.map((m) => /* @__PURE__ */ i(Z.Fragment, { children: s(m) }, m.id));
|
|
331
|
+
return /* @__PURE__ */ i("div", { ...c.getZoneProps(u.zoneKey), children: r(u.zoneKey, u.items, d) }, u.zoneKey);
|
|
284
332
|
}) });
|
|
285
333
|
}
|
|
286
|
-
|
|
334
|
+
be.displayName = "SortableZones";
|
|
287
335
|
function ne({
|
|
288
336
|
state: e,
|
|
289
337
|
modules: n,
|
|
290
338
|
renderZone: t,
|
|
291
339
|
renderItem: r,
|
|
292
|
-
renderDragOverlay:
|
|
340
|
+
renderDragOverlay: s
|
|
293
341
|
}) {
|
|
294
|
-
const { core: a, sortable: c, utilities: o } = n, { DndContext: p, DragOverlay: u, useSensors: d, useSensor: m, useDroppable:
|
|
295
|
-
m(
|
|
342
|
+
const { core: a, sortable: c, utilities: o } = n, { DndContext: p, DragOverlay: u, useSensors: d, useSensor: m, useDroppable: _, PointerSensor: k, KeyboardSensor: H, closestCenter: B } = a, { SortableContext: l, verticalListSortingStrategy: g } = c, C = d(
|
|
343
|
+
m(k, { activationConstraint: { distance: 5 } }),
|
|
296
344
|
m(H)
|
|
297
|
-
), y = p,
|
|
345
|
+
), y = p, b = u, P = l;
|
|
298
346
|
return /* @__PURE__ */ N(
|
|
299
347
|
y,
|
|
300
348
|
{
|
|
301
|
-
sensors:
|
|
349
|
+
sensors: C,
|
|
302
350
|
collisionDetection: B,
|
|
303
351
|
onDragStart: e.handleDragStart,
|
|
304
352
|
onDragOver: e.handleDragOver,
|
|
305
353
|
onDragEnd: e.handleDragEnd,
|
|
306
354
|
children: [
|
|
307
355
|
e.zones.map((f) => {
|
|
308
|
-
const
|
|
356
|
+
const E = f.items.map((h) => h.id), I = f.items.map((h) => /* @__PURE__ */ i(
|
|
309
357
|
te,
|
|
310
358
|
{
|
|
311
359
|
id: h.id,
|
|
@@ -315,30 +363,30 @@ function ne({
|
|
|
315
363
|
},
|
|
316
364
|
h.id
|
|
317
365
|
));
|
|
318
|
-
return /* @__PURE__ */
|
|
366
|
+
return /* @__PURE__ */ i(
|
|
319
367
|
re,
|
|
320
368
|
{
|
|
321
369
|
zoneKey: f.zoneKey,
|
|
322
370
|
zoneProps: e.getZoneProps(f.zoneKey),
|
|
323
|
-
useDroppable:
|
|
324
|
-
children: /* @__PURE__ */
|
|
371
|
+
useDroppable: _,
|
|
372
|
+
children: /* @__PURE__ */ i(P, { items: E, strategy: g, children: t(f.zoneKey, f.items, I) })
|
|
325
373
|
},
|
|
326
374
|
f.zoneKey
|
|
327
375
|
);
|
|
328
376
|
}),
|
|
329
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ i(b, { children: e.activeItem ? s?.(e.activeItem) ?? r(e.activeItem) : null })
|
|
330
378
|
]
|
|
331
379
|
}
|
|
332
380
|
);
|
|
333
381
|
}
|
|
334
382
|
ne.displayName = "SortableZonesInner";
|
|
335
383
|
function te({ id: e, useSortable: n, cssHelper: t, children: r }) {
|
|
336
|
-
const { attributes:
|
|
384
|
+
const { attributes: s, listeners: a, setNodeRef: c, transform: o, transition: p, isDragging: u } = n({ id: e }), d = {
|
|
337
385
|
transform: t?.Transform?.toString(o) ?? void 0,
|
|
338
386
|
transition: p,
|
|
339
387
|
opacity: u ? 0.5 : 1
|
|
340
388
|
};
|
|
341
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ i("div", { ref: c, style: d, "data-sortable-item-id": e, ...s, ...a, children: r });
|
|
342
390
|
}
|
|
343
391
|
te.displayName = "SortableItem";
|
|
344
392
|
function re({
|
|
@@ -347,12 +395,12 @@ function re({
|
|
|
347
395
|
useDroppable: t,
|
|
348
396
|
children: r
|
|
349
397
|
}) {
|
|
350
|
-
const { setNodeRef:
|
|
351
|
-
return /* @__PURE__ */
|
|
398
|
+
const { setNodeRef: s, isOver: a } = t({ id: e });
|
|
399
|
+
return /* @__PURE__ */ i("div", { ref: s, "data-zone-is-over": a || void 0, ...n, children: r });
|
|
352
400
|
}
|
|
353
401
|
re.displayName = "ZoneDroppable";
|
|
354
402
|
const V = ae(null);
|
|
355
|
-
function
|
|
403
|
+
function _e() {
|
|
356
404
|
const e = W(V);
|
|
357
405
|
if (!e)
|
|
358
406
|
throw new Error(
|
|
@@ -363,19 +411,31 @@ function be() {
|
|
|
363
411
|
function Pe() {
|
|
364
412
|
return W(V);
|
|
365
413
|
}
|
|
366
|
-
const De =
|
|
367
|
-
function
|
|
368
|
-
if (e === "
|
|
414
|
+
const De = L.number().min(0).max(100), xe = L.number().min(7).max(90), Ne = L.enum(["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"]), Oe = L.array(L.string().min(1)).max(3), we = L.boolean();
|
|
415
|
+
function Te(e, n) {
|
|
416
|
+
if (e === "threshold") {
|
|
369
417
|
const t = De.safeParse(n);
|
|
418
|
+
return t.success ? t.data : 80;
|
|
419
|
+
}
|
|
420
|
+
if (e === "timeframe") {
|
|
421
|
+
const t = xe.safeParse(n);
|
|
370
422
|
return t.success ? t.data : 30;
|
|
371
423
|
}
|
|
424
|
+
if (e === "accent") {
|
|
425
|
+
const t = Ne.safeParse(n);
|
|
426
|
+
return t.success ? t.data : null;
|
|
427
|
+
}
|
|
372
428
|
if (e === "slots") {
|
|
373
|
-
const t =
|
|
429
|
+
const t = Oe.safeParse(n);
|
|
374
430
|
return t.success ? t.data : [];
|
|
375
431
|
}
|
|
432
|
+
if (e === "thresholdEnabled" || e === "accentEnabled") {
|
|
433
|
+
const t = we.safeParse(n);
|
|
434
|
+
return t.success ? t.data : !1;
|
|
435
|
+
}
|
|
376
436
|
return n;
|
|
377
437
|
}
|
|
378
|
-
const
|
|
438
|
+
const Le = {
|
|
379
439
|
activePanelId: null,
|
|
380
440
|
activeTrigger: null,
|
|
381
441
|
bellCutoutOpen: !1,
|
|
@@ -386,7 +446,7 @@ const Oe = {
|
|
|
386
446
|
lastClose: null,
|
|
387
447
|
pendingSideEffects: []
|
|
388
448
|
}, Y = /* @__PURE__ */ new Set(["settings"]);
|
|
389
|
-
function
|
|
449
|
+
function ke(e, n) {
|
|
390
450
|
if (e == null || e.kind !== n.kind) return !1;
|
|
391
451
|
switch (e.kind) {
|
|
392
452
|
case "bell":
|
|
@@ -401,7 +461,7 @@ function we(e, n) {
|
|
|
401
461
|
return e.action === n.action && e.blockedCardId === n.blockedCardId && e.activeCardId === n.activeCardId;
|
|
402
462
|
}
|
|
403
463
|
}
|
|
404
|
-
function
|
|
464
|
+
function Me(e, n) {
|
|
405
465
|
switch (n.type) {
|
|
406
466
|
case "OPEN_PANEL": {
|
|
407
467
|
if (e.activePanelId && e.isDirty)
|
|
@@ -419,7 +479,7 @@ function Te(e, n) {
|
|
|
419
479
|
}
|
|
420
480
|
]
|
|
421
481
|
};
|
|
422
|
-
if (e.activePanelId === n.panelId &&
|
|
482
|
+
if (e.activePanelId === n.panelId && ke(e.activeTrigger, n.trigger))
|
|
423
483
|
return e;
|
|
424
484
|
const t = e.activePanelId != null ? [
|
|
425
485
|
{
|
|
@@ -444,12 +504,12 @@ function Te(e, n) {
|
|
|
444
504
|
case "CLOSE_PANEL": {
|
|
445
505
|
if (e.activePanelId == null)
|
|
446
506
|
return e;
|
|
447
|
-
const t = e.activePanelId, r = e.activeTrigger?.cardId ?? null,
|
|
507
|
+
const t = e.activePanelId, r = e.activeTrigger?.cardId ?? null, s = r != null ? e.bufferByCard[r] : void 0, a = e.isDirty ? n.reason === "apply-button" ? r != null && s != null ? [
|
|
448
508
|
{
|
|
449
509
|
type: "COMMIT_BUFFER",
|
|
450
|
-
payload: { cardId: r, delta:
|
|
510
|
+
payload: { cardId: r, delta: s }
|
|
451
511
|
}
|
|
452
|
-
] : [{ type: "COMMIT_BUFFER" }] : [{ type: "DISCARD_BUFFER" }] : [], c = r != null &&
|
|
512
|
+
] : [{ type: "COMMIT_BUFFER" }] : [{ type: "DISCARD_BUFFER" }] : [], c = r != null && s != null ? (() => {
|
|
453
513
|
const o = { ...e.bufferByCard };
|
|
454
514
|
return delete o[r], o;
|
|
455
515
|
})() : e.bufferByCard;
|
|
@@ -489,12 +549,12 @@ function Te(e, n) {
|
|
|
489
549
|
{ type: "INVALID_DISPATCH", reason: "no-buffer-panel" }
|
|
490
550
|
]
|
|
491
551
|
};
|
|
492
|
-
const t = e.bufferByCard[n.cardId], r = t == null,
|
|
493
|
-
if (!r && t.changes[n.key] ===
|
|
552
|
+
const t = e.bufferByCard[n.cardId], r = t == null, s = Te(n.key, n.value);
|
|
553
|
+
if (!r && t.changes[n.key] === s)
|
|
494
554
|
return e;
|
|
495
555
|
const c = { kind: "settings", changes: {
|
|
496
556
|
...t?.kind === "settings" ? t.changes : {},
|
|
497
|
-
[n.key]:
|
|
557
|
+
[n.key]: s
|
|
498
558
|
} }, o = { ...e.bufferByCard, [n.cardId]: c }, p = r ? [
|
|
499
559
|
{
|
|
500
560
|
type: "SCHEDULE_TIMER",
|
|
@@ -511,8 +571,8 @@ function Te(e, n) {
|
|
|
511
571
|
case "CLEAR_BUFFER": {
|
|
512
572
|
if (e.bufferByCard[n.cardId] == null)
|
|
513
573
|
return e;
|
|
514
|
-
const r = Object.keys(e.bufferByCard).length === 1,
|
|
515
|
-
delete
|
|
574
|
+
const r = Object.keys(e.bufferByCard).length === 1, s = { ...e.bufferByCard };
|
|
575
|
+
delete s[n.cardId];
|
|
516
576
|
const a = r && e.isDirty ? [
|
|
517
577
|
{
|
|
518
578
|
type: "SCHEDULE_TIMER",
|
|
@@ -522,7 +582,7 @@ function Te(e, n) {
|
|
|
522
582
|
] : [];
|
|
523
583
|
return {
|
|
524
584
|
...e,
|
|
525
|
-
bufferByCard:
|
|
585
|
+
bufferByCard: s,
|
|
526
586
|
pendingSideEffects: [...e.pendingSideEffects, ...a]
|
|
527
587
|
};
|
|
528
588
|
}
|
|
@@ -563,11 +623,11 @@ function Te(e, n) {
|
|
|
563
623
|
return e;
|
|
564
624
|
}
|
|
565
625
|
}
|
|
566
|
-
function
|
|
626
|
+
function Re(e) {
|
|
567
627
|
return e.activePanelId === "notification-center" ? "notif-center" : e.activePanelId != null && e.bellCutoutOpen ? e.isDirty ? "panel-dirty+cutout" : "panel-clean+cutout" : e.activePanelId != null ? e.isDirty ? "panel-dirty" : "panel-clean" : e.bellCutoutOpen ? "bell-cutout-only" : "idle";
|
|
568
628
|
}
|
|
569
|
-
function
|
|
570
|
-
const [e, n] = ce(
|
|
629
|
+
function Fe() {
|
|
630
|
+
const [e, n] = ce(Me, Le), t = O([]), r = O(null);
|
|
571
631
|
w(() => () => {
|
|
572
632
|
r.current != null && (window.clearTimeout(r.current), r.current = null);
|
|
573
633
|
}, []), w(() => {
|
|
@@ -600,25 +660,25 @@ function Re() {
|
|
|
600
660
|
c
|
|
601
661
|
];
|
|
602
662
|
}, [e.lastClose]);
|
|
603
|
-
const
|
|
604
|
-
() =>
|
|
663
|
+
const s = z(
|
|
664
|
+
() => Re(e),
|
|
605
665
|
[e.activePanelId, e.bellCutoutOpen, e.isDirty]
|
|
606
666
|
), a = T(() => t.current.slice(), []);
|
|
607
|
-
return { state: e, surfaceState:
|
|
667
|
+
return { state: e, surfaceState: s, dispatch: n, getCloseLog: a };
|
|
608
668
|
}
|
|
609
|
-
function
|
|
610
|
-
const n =
|
|
669
|
+
function an({ children: e }) {
|
|
670
|
+
const n = Fe(), t = z(
|
|
611
671
|
() => n,
|
|
612
672
|
// Re-publish only when one of the four coordinator fields changes identity.
|
|
613
673
|
// dispatch + getCloseLog are stable. state + surfaceState change on dispatch.
|
|
614
674
|
[n.state, n.surfaceState, n.dispatch, n.getCloseLog]
|
|
615
675
|
);
|
|
616
|
-
return /* @__PURE__ */
|
|
676
|
+
return /* @__PURE__ */ i(V.Provider, { value: t, children: e });
|
|
617
677
|
}
|
|
618
|
-
function
|
|
678
|
+
function Ae({ title: e, onClose: n, titleId: t }) {
|
|
619
679
|
return /* @__PURE__ */ N("div", { className: "gloss-panel-chrome-v2__header", children: [
|
|
620
|
-
e != null && /* @__PURE__ */
|
|
621
|
-
/* @__PURE__ */
|
|
680
|
+
e != null && /* @__PURE__ */ i("span", { id: t, className: "gloss-panel-chrome-v2__title", children: e }),
|
|
681
|
+
/* @__PURE__ */ i(
|
|
622
682
|
"button",
|
|
623
683
|
{
|
|
624
684
|
id: "panel-close",
|
|
@@ -631,8 +691,8 @@ function ke({ title: e, onClose: n, titleId: t }) {
|
|
|
631
691
|
)
|
|
632
692
|
] });
|
|
633
693
|
}
|
|
634
|
-
function
|
|
635
|
-
return /* @__PURE__ */
|
|
694
|
+
function He({ children: e }) {
|
|
695
|
+
return /* @__PURE__ */ i(
|
|
636
696
|
"div",
|
|
637
697
|
{
|
|
638
698
|
"data-panel-stage": !0,
|
|
@@ -642,24 +702,24 @@ function Fe({ children: e }) {
|
|
|
642
702
|
}
|
|
643
703
|
);
|
|
644
704
|
}
|
|
645
|
-
function
|
|
646
|
-
return /* @__PURE__ */
|
|
705
|
+
function Be({ children: e }) {
|
|
706
|
+
return /* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__navigation", children: e });
|
|
647
707
|
}
|
|
648
|
-
function
|
|
649
|
-
return /* @__PURE__ */
|
|
708
|
+
function Ze({ children: e }) {
|
|
709
|
+
return /* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__body", children: e });
|
|
650
710
|
}
|
|
651
|
-
function
|
|
711
|
+
function Ke({ left: e, right: n }) {
|
|
652
712
|
return /* @__PURE__ */ N("div", { className: "gloss-panel-chrome-v2__footer", children: [
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
/* @__PURE__ */
|
|
713
|
+
/* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__footer-left", children: e }),
|
|
714
|
+
/* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__footer-right", children: n })
|
|
655
715
|
] });
|
|
656
716
|
}
|
|
657
|
-
function
|
|
717
|
+
function Ue({
|
|
658
718
|
children: e,
|
|
659
719
|
onClose: n,
|
|
660
720
|
title: t,
|
|
661
721
|
variant: r = "no-stage",
|
|
662
|
-
stage:
|
|
722
|
+
stage: s,
|
|
663
723
|
navigation: a,
|
|
664
724
|
footer: c
|
|
665
725
|
}) {
|
|
@@ -676,12 +736,12 @@ function Ze({
|
|
|
676
736
|
"aria-label": u ? void 0 : "Panel",
|
|
677
737
|
className: `gloss-panel-chrome-v2 gloss-panel-chrome-v2--${r}${o ? " gloss-panel-chrome-v2--headerless" : ""}`,
|
|
678
738
|
children: [
|
|
679
|
-
!o && /* @__PURE__ */
|
|
680
|
-
r === "with-stage" && /* @__PURE__ */
|
|
681
|
-
a != null && /* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
c != null && /* @__PURE__ */
|
|
684
|
-
o && /* @__PURE__ */
|
|
739
|
+
!o && /* @__PURE__ */ i(Ae, { title: t, onClose: n, titleId: p }),
|
|
740
|
+
r === "with-stage" && /* @__PURE__ */ i(He, { children: s }),
|
|
741
|
+
a != null && /* @__PURE__ */ i(Be, { children: a }),
|
|
742
|
+
/* @__PURE__ */ i(Ze, { children: e }),
|
|
743
|
+
c != null && /* @__PURE__ */ i(Ke, { left: c.left, right: c.right }),
|
|
744
|
+
o && /* @__PURE__ */ i(
|
|
685
745
|
"button",
|
|
686
746
|
{
|
|
687
747
|
id: "panel-close",
|
|
@@ -696,45 +756,45 @@ function Ze({
|
|
|
696
756
|
}
|
|
697
757
|
);
|
|
698
758
|
}
|
|
699
|
-
function
|
|
759
|
+
function cn({ isOpen: e }) {
|
|
700
760
|
const n = Pe();
|
|
701
|
-
return /* @__PURE__ */
|
|
702
|
-
|
|
761
|
+
return /* @__PURE__ */ i(
|
|
762
|
+
Ue,
|
|
703
763
|
{
|
|
704
764
|
variant: "no-stage",
|
|
705
765
|
title: "Notifications",
|
|
706
766
|
onClose: () => n?.dispatch({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
707
|
-
children: /* @__PURE__ */
|
|
767
|
+
children: /* @__PURE__ */ i(
|
|
708
768
|
"div",
|
|
709
769
|
{
|
|
710
770
|
"data-shell": "notification-center",
|
|
711
771
|
"data-panel": "notification-center",
|
|
712
772
|
"aria-hidden": !e,
|
|
713
|
-
children: /* @__PURE__ */
|
|
773
|
+
children: /* @__PURE__ */ i("p", { children: "No notifications" })
|
|
714
774
|
}
|
|
715
775
|
)
|
|
716
776
|
}
|
|
717
777
|
);
|
|
718
778
|
}
|
|
719
|
-
const
|
|
779
|
+
const ze = {
|
|
720
780
|
position: "relative",
|
|
721
781
|
pointerEvents: "auto"
|
|
722
782
|
};
|
|
723
|
-
function
|
|
783
|
+
function Ve({ children: e, onClose: n, footer: t, title: r, variant: s = "default" }) {
|
|
724
784
|
const a = `panel-close-${X().replace(/:/g, "-")}`;
|
|
725
785
|
return /* @__PURE__ */ N(
|
|
726
786
|
"div",
|
|
727
787
|
{
|
|
728
788
|
"data-chrome": "panel",
|
|
729
|
-
"data-chrome-variant":
|
|
789
|
+
"data-chrome-variant": s,
|
|
730
790
|
role: "dialog",
|
|
731
791
|
"aria-modal": "true",
|
|
732
|
-
className:
|
|
733
|
-
style:
|
|
792
|
+
className: s === "merged-stage" ? "gloss-panel-chrome gloss-panel-chrome--merged-stage" : "gloss-panel-chrome",
|
|
793
|
+
style: ze,
|
|
734
794
|
children: [
|
|
735
795
|
/* @__PURE__ */ N("div", { className: "gloss-panel-chrome__header", children: [
|
|
736
|
-
r != null && /* @__PURE__ */
|
|
737
|
-
/* @__PURE__ */
|
|
796
|
+
r != null && /* @__PURE__ */ i("span", { className: "gloss-panel-chrome__title", children: r }),
|
|
797
|
+
/* @__PURE__ */ i(
|
|
738
798
|
"button",
|
|
739
799
|
{
|
|
740
800
|
id: a,
|
|
@@ -746,13 +806,13 @@ function Ke({ children: e, onClose: n, footer: t, title: r, variant: i = "defaul
|
|
|
746
806
|
}
|
|
747
807
|
)
|
|
748
808
|
] }),
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
t != null && /* @__PURE__ */
|
|
809
|
+
/* @__PURE__ */ i("div", { className: "gloss-panel-chrome__body", children: e }),
|
|
810
|
+
t != null && /* @__PURE__ */ i("div", { className: "gloss-panel-chrome__footer", children: t })
|
|
751
811
|
]
|
|
752
812
|
}
|
|
753
813
|
);
|
|
754
814
|
}
|
|
755
|
-
function
|
|
815
|
+
function $e(e) {
|
|
756
816
|
if (process.env.NODE_ENV === "production" || !e || !e.parentElement) return;
|
|
757
817
|
const n = e.parentElement, t = window.getComputedStyle(n);
|
|
758
818
|
t.perspective === "none" && console.warn(
|
|
@@ -763,12 +823,12 @@ function Ue(e) {
|
|
|
763
823
|
n
|
|
764
824
|
);
|
|
765
825
|
}
|
|
766
|
-
function
|
|
826
|
+
function je({ isOpen: e, children: n }) {
|
|
767
827
|
const t = ee(), r = O(null);
|
|
768
828
|
G(() => {
|
|
769
|
-
|
|
829
|
+
$e(r.current);
|
|
770
830
|
}, []);
|
|
771
|
-
const [
|
|
831
|
+
const [s, a] = A(!1);
|
|
772
832
|
w(() => {
|
|
773
833
|
if (!e) {
|
|
774
834
|
a(!1);
|
|
@@ -779,10 +839,10 @@ function $e({ isOpen: e, children: n }) {
|
|
|
779
839
|
}, [e]);
|
|
780
840
|
const c = [
|
|
781
841
|
"gloss-panel-mount",
|
|
782
|
-
|
|
842
|
+
s ? "has-panel" : "",
|
|
783
843
|
t ? "reduced-motion" : ""
|
|
784
844
|
].filter(Boolean).join(" ");
|
|
785
|
-
return /* @__PURE__ */
|
|
845
|
+
return /* @__PURE__ */ i(
|
|
786
846
|
"div",
|
|
787
847
|
{
|
|
788
848
|
ref: r,
|
|
@@ -793,7 +853,7 @@ function $e({ isOpen: e, children: n }) {
|
|
|
793
853
|
}
|
|
794
854
|
);
|
|
795
855
|
}
|
|
796
|
-
const
|
|
856
|
+
const qe = {
|
|
797
857
|
position: "fixed",
|
|
798
858
|
top: 0,
|
|
799
859
|
left: 0,
|
|
@@ -804,7 +864,7 @@ const Ve = {
|
|
|
804
864
|
overflow: "visible",
|
|
805
865
|
pointerEvents: "none",
|
|
806
866
|
zIndex: 55
|
|
807
|
-
},
|
|
867
|
+
}, Qe = {
|
|
808
868
|
position: "fixed",
|
|
809
869
|
top: "var(--tb-h, 60px)",
|
|
810
870
|
left: 0,
|
|
@@ -818,9 +878,9 @@ const Ve = {
|
|
|
818
878
|
pointerEvents: "none",
|
|
819
879
|
background: "rgba(0, 0, 0, 0.04)"
|
|
820
880
|
};
|
|
821
|
-
function
|
|
822
|
-
const { state: n, dispatch: t, getCloseLog: r } =
|
|
823
|
-
n.activePanelId && !
|
|
881
|
+
function dn({ panelComponents: e }) {
|
|
882
|
+
const { state: n, dispatch: t, getCloseLog: r } = _e(), s = n.activePanelId ? e[n.activePanelId] : null;
|
|
883
|
+
n.activePanelId && !s && process.env.NODE_ENV !== "production" && console.error(
|
|
824
884
|
"[panels] No panel component registered for activePanelId:",
|
|
825
885
|
n.activePanelId
|
|
826
886
|
), w(() => {
|
|
@@ -846,26 +906,26 @@ function Ge({ panelComponents: e }) {
|
|
|
846
906
|
o.__panelsHostHandle?.dispatch === t && delete o.__panelsHostHandle;
|
|
847
907
|
};
|
|
848
908
|
}, [t, r]);
|
|
849
|
-
const c = n.activePanelId != null &&
|
|
850
|
-
return /* @__PURE__ */ N("div", { "data-panel-host": "true", style:
|
|
851
|
-
c && /* @__PURE__ */
|
|
909
|
+
const c = n.activePanelId != null && s != null;
|
|
910
|
+
return /* @__PURE__ */ N("div", { "data-panel-host": "true", style: qe, children: [
|
|
911
|
+
c && /* @__PURE__ */ i(
|
|
852
912
|
"div",
|
|
853
913
|
{
|
|
854
914
|
"data-panel-scrim": "true",
|
|
855
|
-
style:
|
|
915
|
+
style: Qe
|
|
856
916
|
}
|
|
857
917
|
),
|
|
858
|
-
/* @__PURE__ */
|
|
859
|
-
|
|
918
|
+
/* @__PURE__ */ i(je, { isOpen: c, children: c && /* @__PURE__ */ i(
|
|
919
|
+
Ve,
|
|
860
920
|
{
|
|
861
921
|
isOpen: !0,
|
|
862
922
|
onClose: () => t({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
863
|
-
children: /* @__PURE__ */ s
|
|
923
|
+
children: /* @__PURE__ */ i(s, { isOpen: !0 })
|
|
864
924
|
}
|
|
865
925
|
) })
|
|
866
926
|
] });
|
|
867
927
|
}
|
|
868
|
-
const
|
|
928
|
+
const un = {
|
|
869
929
|
"apply-button": !0,
|
|
870
930
|
// the ONLY commit reason
|
|
871
931
|
"cancel-button": !1,
|
|
@@ -883,25 +943,33 @@ const Je = {
|
|
|
883
943
|
// 260524 panel-x-axis-transitions — viewport shrank past targetSection
|
|
884
944
|
};
|
|
885
945
|
export {
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
946
|
+
un as C,
|
|
947
|
+
on as H,
|
|
948
|
+
cn as N,
|
|
949
|
+
an as P,
|
|
950
|
+
be as S,
|
|
951
|
+
rn as a,
|
|
952
|
+
sn as b,
|
|
953
|
+
Je as c,
|
|
954
|
+
ye as d,
|
|
955
|
+
_e as e,
|
|
956
|
+
dn as f,
|
|
957
|
+
ln as g,
|
|
958
|
+
Fe as h,
|
|
959
|
+
Me as i,
|
|
960
|
+
Le as j,
|
|
961
|
+
Re as k,
|
|
962
|
+
ge as l,
|
|
963
|
+
ee as m,
|
|
964
|
+
Ue as n,
|
|
965
|
+
je as o,
|
|
966
|
+
tn as p,
|
|
967
|
+
Ae as q,
|
|
968
|
+
nn as r,
|
|
969
|
+
en as s,
|
|
970
|
+
He as t,
|
|
971
|
+
Pe as u,
|
|
972
|
+
Be as v,
|
|
973
|
+
Ze as w,
|
|
974
|
+
Ke as x
|
|
907
975
|
};
|