@mt-gloss/ui 0.1.137 → 0.1.139
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-B7dc_-m8.js → COMMITS-DEdHYT0E.js} +235 -179
- package/composites-panels.js +540 -463
- package/index.js +804 -852
- package/lib/composites/panels/stage3d/CloneStage.d.ts +11 -1
- package/package.json +1 -1
- package/ui.css +1 -1
|
@@ -1,7 +1,55 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { motion as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as i, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { motion as ie } from "framer-motion";
|
|
3
|
+
import B, { useSyncExternalStore as le, useState as F, 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
4
|
import { z as K } from "zod";
|
|
5
|
+
const We = {
|
|
6
|
+
forwardStaggerMs: 50,
|
|
7
|
+
reverseStaggerMs: 30,
|
|
8
|
+
springStiffness: 380,
|
|
9
|
+
springDamping: 32,
|
|
10
|
+
reverseVelocityMultiplier: 1.4
|
|
11
|
+
}, Xe = {
|
|
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
|
+
}, Ge = {
|
|
18
|
+
shiverCycles: 3,
|
|
19
|
+
shiverAmplitudePx: 2,
|
|
20
|
+
shiverDurationMs: 180,
|
|
21
|
+
validCellOpacity: 0.6
|
|
22
|
+
}, Je = {
|
|
23
|
+
materializeMs: 180,
|
|
24
|
+
dematerializeMs: 140,
|
|
25
|
+
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
26
|
+
dotStrokePx: 2,
|
|
27
|
+
dividerDashGapPx: 4
|
|
28
|
+
}, en = {
|
|
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
|
+
}, nn = !0, tn = {
|
|
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 rn() {
|
|
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",
|
|
@@ -93,22 +141,22 @@ function Q(e, n) {
|
|
|
93
141
|
const t = e.find((r) => r.zoneKey === n);
|
|
94
142
|
return t ? t.zoneKey : U(e, n);
|
|
95
143
|
}
|
|
96
|
-
function
|
|
97
|
-
const r = [...e], [
|
|
98
|
-
return r.splice(t, 0,
|
|
144
|
+
function ve(e, n, t) {
|
|
145
|
+
const r = [...e], [s] = r.splice(n, 1);
|
|
146
|
+
return r.splice(t, 0, s), r;
|
|
99
147
|
}
|
|
100
|
-
function
|
|
148
|
+
function he(e) {
|
|
101
149
|
return e.map((n) => `${n.zoneKey}:${n.items.map((t) => t.id).join(",")}`).join("|");
|
|
102
150
|
}
|
|
103
151
|
function ye(e) {
|
|
104
|
-
const [n, t] =
|
|
152
|
+
const [n, t] = F(
|
|
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] = F(null), [a, c] = F(null), o = O(null), p = O(e.onZoneChange);
|
|
109
157
|
p.current = e.onZoneChange;
|
|
110
|
-
const u =
|
|
111
|
-
() =>
|
|
158
|
+
const u = z(
|
|
159
|
+
() => he(e.zones),
|
|
112
160
|
[e.zones]
|
|
113
161
|
), d = O(u);
|
|
114
162
|
w(() => {
|
|
@@ -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,56 +190,56 @@ 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
207
|
let f = n.map((I) => ({ ...I, items: [...I.items] }));
|
|
160
|
-
if (
|
|
161
|
-
const I = f.findIndex((D) => D.zoneKey ===
|
|
208
|
+
if (b === P) {
|
|
209
|
+
const I = f.findIndex((D) => D.zoneKey === b), E = f[I], v = E.items.findIndex((D) => D.id === g.id), S = E.items.findIndex((D) => D.id === C.id), M = S >= 0 ? S : Math.max(0, E.items.length - 1);
|
|
162
210
|
f[I] = {
|
|
163
211
|
...E,
|
|
164
|
-
items:
|
|
212
|
+
items: ve(E.items, v, M)
|
|
165
213
|
};
|
|
166
214
|
} else {
|
|
167
|
-
const I = f.findIndex((
|
|
168
|
-
if (!
|
|
215
|
+
const I = f.findIndex((h) => h.zoneKey === b), E = f.findIndex((h) => h.zoneKey === P), v = f[I], S = f[E], M = v.items.find((h) => h.id === g.id);
|
|
216
|
+
if (!M) {
|
|
169
217
|
y();
|
|
170
218
|
return;
|
|
171
219
|
}
|
|
172
|
-
const D =
|
|
173
|
-
let j = D, x = [...
|
|
174
|
-
if (
|
|
175
|
-
const
|
|
176
|
-
x = x.slice(0,
|
|
220
|
+
const D = v.items.filter((h) => h.id !== g.id), $ = S.items.findIndex((h) => h.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) {
|
|
223
|
+
const h = x[x.length - 1];
|
|
224
|
+
x = x.slice(0, S.maxItems - 1), j = [...D, h];
|
|
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
|
+
M,
|
|
181
229
|
...x.slice(q)
|
|
182
230
|
];
|
|
183
|
-
f[I] = { ...
|
|
231
|
+
f[I] = { ...v, items: j }, f[E] = { ...S, items: se };
|
|
184
232
|
}
|
|
185
233
|
t(f), p.current?.(f), y();
|
|
186
234
|
},
|
|
187
235
|
[n]
|
|
188
|
-
),
|
|
236
|
+
), A = T(
|
|
189
237
|
(l) => ({
|
|
190
238
|
id: l,
|
|
191
239
|
"data-zone-key": l
|
|
192
240
|
}),
|
|
193
241
|
[]
|
|
194
|
-
),
|
|
242
|
+
), H = T(
|
|
195
243
|
(l) => {
|
|
196
244
|
const g = U(n, l.id) ?? "";
|
|
197
245
|
return {
|
|
@@ -206,14 +254,14 @@ function ye(e) {
|
|
|
206
254
|
zones: n,
|
|
207
255
|
activeZone: a,
|
|
208
256
|
activeItem: r,
|
|
209
|
-
getZoneProps:
|
|
210
|
-
getItemProps:
|
|
257
|
+
getZoneProps: A,
|
|
258
|
+
getItemProps: H,
|
|
211
259
|
handleDragStart: m,
|
|
212
|
-
handleDragOver:
|
|
213
|
-
handleDragEnd:
|
|
260
|
+
handleDragOver: _,
|
|
261
|
+
handleDragEnd: k
|
|
214
262
|
};
|
|
215
263
|
}
|
|
216
|
-
let
|
|
264
|
+
let L = null, R = null, Z = !1;
|
|
217
265
|
const Ie = [
|
|
218
266
|
"DndContext",
|
|
219
267
|
"DragOverlay",
|
|
@@ -228,17 +276,17 @@ const Ie = [
|
|
|
228
276
|
"useSortable",
|
|
229
277
|
"verticalListSortingStrategy"
|
|
230
278
|
];
|
|
231
|
-
function
|
|
279
|
+
function Se(e, n) {
|
|
232
280
|
const t = [], r = e ?? {};
|
|
233
281
|
for (const a of Ie)
|
|
234
282
|
r[a] === void 0 && t.push(`@dnd-kit/core:${a}`);
|
|
235
|
-
const
|
|
283
|
+
const s = n ?? {};
|
|
236
284
|
for (const a of Ee)
|
|
237
|
-
|
|
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 L ? Promise.resolve(L) : Z ? Promise.resolve(null) : R || (R = (async () => {
|
|
242
290
|
try {
|
|
243
291
|
const [e, n, t] = await Promise.all([
|
|
244
292
|
import("@dnd-kit/core"),
|
|
@@ -246,99 +294,99 @@ 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 ? (L = {
|
|
251
299
|
core: e,
|
|
252
300
|
sortable: n,
|
|
253
301
|
utilities: t
|
|
254
|
-
},
|
|
302
|
+
}, L) : (Z = !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 Z = !0, null;
|
|
259
307
|
}
|
|
260
|
-
})(),
|
|
308
|
+
})(), R);
|
|
261
309
|
}
|
|
262
|
-
function
|
|
263
|
-
const { zones: n, onZoneChange: t, renderZone: r, renderItem:
|
|
264
|
-
return
|
|
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] = B.useState(L);
|
|
312
|
+
return B.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(B.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(
|
|
296
|
-
m(
|
|
297
|
-
), y = p,
|
|
342
|
+
const { core: a, sortable: c, utilities: o } = n, { DndContext: p, DragOverlay: u, useSensors: d, useSensor: m, useDroppable: _, PointerSensor: k, KeyboardSensor: A, closestCenter: H } = a, { SortableContext: l, verticalListSortingStrategy: g } = c, C = d(
|
|
343
|
+
m(k, { activationConstraint: { distance: 5 } }),
|
|
344
|
+
m(A)
|
|
345
|
+
), y = p, b = u, P = l;
|
|
298
346
|
return /* @__PURE__ */ N(
|
|
299
347
|
y,
|
|
300
348
|
{
|
|
301
|
-
sensors:
|
|
302
|
-
collisionDetection:
|
|
349
|
+
sensors: C,
|
|
350
|
+
collisionDetection: H,
|
|
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 I = f.items.map((
|
|
356
|
+
const I = f.items.map((v) => v.id), E = f.items.map((v) => /* @__PURE__ */ i(
|
|
309
357
|
te,
|
|
310
358
|
{
|
|
311
|
-
id:
|
|
359
|
+
id: v.id,
|
|
312
360
|
useSortable: c.useSortable,
|
|
313
361
|
cssHelper: o.CSS,
|
|
314
|
-
children: r(
|
|
362
|
+
children: r(v)
|
|
315
363
|
},
|
|
316
|
-
|
|
364
|
+
v.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: I, strategy: g, children: t(f.zoneKey, f.items, E) })
|
|
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(
|
|
@@ -444,12 +492,12 @@ function Te(e, n) {
|
|
|
444
492
|
case "CLOSE_PANEL": {
|
|
445
493
|
if (e.activePanelId == null)
|
|
446
494
|
return e;
|
|
447
|
-
const t = e.activePanelId, r = e.activeTrigger?.cardId ?? null,
|
|
495
|
+
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
496
|
{
|
|
449
497
|
type: "COMMIT_BUFFER",
|
|
450
|
-
payload: { cardId: r, delta:
|
|
498
|
+
payload: { cardId: r, delta: s }
|
|
451
499
|
}
|
|
452
|
-
] : [{ type: "COMMIT_BUFFER" }] : [{ type: "DISCARD_BUFFER" }] : [], c = r != null &&
|
|
500
|
+
] : [{ type: "COMMIT_BUFFER" }] : [{ type: "DISCARD_BUFFER" }] : [], c = r != null && s != null ? (() => {
|
|
453
501
|
const o = { ...e.bufferByCard };
|
|
454
502
|
return delete o[r], o;
|
|
455
503
|
})() : e.bufferByCard;
|
|
@@ -489,12 +537,12 @@ function Te(e, n) {
|
|
|
489
537
|
{ type: "INVALID_DISPATCH", reason: "no-buffer-panel" }
|
|
490
538
|
]
|
|
491
539
|
};
|
|
492
|
-
const t = e.bufferByCard[n.cardId], r = t == null,
|
|
493
|
-
if (!r && t.changes[n.key] ===
|
|
540
|
+
const t = e.bufferByCard[n.cardId], r = t == null, s = Ne(n.key, n.value);
|
|
541
|
+
if (!r && t.changes[n.key] === s)
|
|
494
542
|
return e;
|
|
495
543
|
const c = { kind: "settings", changes: {
|
|
496
544
|
...t?.kind === "settings" ? t.changes : {},
|
|
497
|
-
[n.key]:
|
|
545
|
+
[n.key]: s
|
|
498
546
|
} }, o = { ...e.bufferByCard, [n.cardId]: c }, p = r ? [
|
|
499
547
|
{
|
|
500
548
|
type: "SCHEDULE_TIMER",
|
|
@@ -511,8 +559,8 @@ function Te(e, n) {
|
|
|
511
559
|
case "CLEAR_BUFFER": {
|
|
512
560
|
if (e.bufferByCard[n.cardId] == null)
|
|
513
561
|
return e;
|
|
514
|
-
const r = Object.keys(e.bufferByCard).length === 1,
|
|
515
|
-
delete
|
|
562
|
+
const r = Object.keys(e.bufferByCard).length === 1, s = { ...e.bufferByCard };
|
|
563
|
+
delete s[n.cardId];
|
|
516
564
|
const a = r && e.isDirty ? [
|
|
517
565
|
{
|
|
518
566
|
type: "SCHEDULE_TIMER",
|
|
@@ -522,7 +570,7 @@ function Te(e, n) {
|
|
|
522
570
|
] : [];
|
|
523
571
|
return {
|
|
524
572
|
...e,
|
|
525
|
-
bufferByCard:
|
|
573
|
+
bufferByCard: s,
|
|
526
574
|
pendingSideEffects: [...e.pendingSideEffects, ...a]
|
|
527
575
|
};
|
|
528
576
|
}
|
|
@@ -563,10 +611,10 @@ function Te(e, n) {
|
|
|
563
611
|
return e;
|
|
564
612
|
}
|
|
565
613
|
}
|
|
566
|
-
function
|
|
614
|
+
function ke(e) {
|
|
567
615
|
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
616
|
}
|
|
569
|
-
function
|
|
617
|
+
function Le() {
|
|
570
618
|
const [e, n] = ce(Te, Oe), t = O([]), r = O(null);
|
|
571
619
|
w(() => () => {
|
|
572
620
|
r.current != null && (window.clearTimeout(r.current), r.current = null);
|
|
@@ -600,25 +648,25 @@ function Re() {
|
|
|
600
648
|
c
|
|
601
649
|
];
|
|
602
650
|
}, [e.lastClose]);
|
|
603
|
-
const
|
|
604
|
-
() =>
|
|
651
|
+
const s = z(
|
|
652
|
+
() => ke(e),
|
|
605
653
|
[e.activePanelId, e.bellCutoutOpen, e.isDirty]
|
|
606
654
|
), a = T(() => t.current.slice(), []);
|
|
607
|
-
return { state: e, surfaceState:
|
|
655
|
+
return { state: e, surfaceState: s, dispatch: n, getCloseLog: a };
|
|
608
656
|
}
|
|
609
|
-
function
|
|
610
|
-
const n =
|
|
657
|
+
function on({ children: e }) {
|
|
658
|
+
const n = Le(), t = z(
|
|
611
659
|
() => n,
|
|
612
660
|
// Re-publish only when one of the four coordinator fields changes identity.
|
|
613
661
|
// dispatch + getCloseLog are stable. state + surfaceState change on dispatch.
|
|
614
662
|
[n.state, n.surfaceState, n.dispatch, n.getCloseLog]
|
|
615
663
|
);
|
|
616
|
-
return /* @__PURE__ */
|
|
664
|
+
return /* @__PURE__ */ i(V.Provider, { value: t, children: e });
|
|
617
665
|
}
|
|
618
|
-
function
|
|
666
|
+
function Me({ title: e, onClose: n, titleId: t }) {
|
|
619
667
|
return /* @__PURE__ */ N("div", { className: "gloss-panel-chrome-v2__header", children: [
|
|
620
|
-
e != null && /* @__PURE__ */
|
|
621
|
-
/* @__PURE__ */
|
|
668
|
+
e != null && /* @__PURE__ */ i("span", { id: t, className: "gloss-panel-chrome-v2__title", children: e }),
|
|
669
|
+
/* @__PURE__ */ i(
|
|
622
670
|
"button",
|
|
623
671
|
{
|
|
624
672
|
id: "panel-close",
|
|
@@ -631,8 +679,8 @@ function ke({ title: e, onClose: n, titleId: t }) {
|
|
|
631
679
|
)
|
|
632
680
|
] });
|
|
633
681
|
}
|
|
634
|
-
function
|
|
635
|
-
return /* @__PURE__ */
|
|
682
|
+
function Re({ children: e }) {
|
|
683
|
+
return /* @__PURE__ */ i(
|
|
636
684
|
"div",
|
|
637
685
|
{
|
|
638
686
|
"data-panel-stage": !0,
|
|
@@ -642,24 +690,24 @@ function Fe({ children: e }) {
|
|
|
642
690
|
}
|
|
643
691
|
);
|
|
644
692
|
}
|
|
645
|
-
function
|
|
646
|
-
return /* @__PURE__ */
|
|
693
|
+
function Fe({ children: e }) {
|
|
694
|
+
return /* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__navigation", children: e });
|
|
647
695
|
}
|
|
648
|
-
function
|
|
649
|
-
return /* @__PURE__ */
|
|
696
|
+
function Ae({ children: e }) {
|
|
697
|
+
return /* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__body", children: e });
|
|
650
698
|
}
|
|
651
|
-
function
|
|
699
|
+
function He({ left: e, right: n }) {
|
|
652
700
|
return /* @__PURE__ */ N("div", { className: "gloss-panel-chrome-v2__footer", children: [
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
/* @__PURE__ */
|
|
701
|
+
/* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__footer-left", children: e }),
|
|
702
|
+
/* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__footer-right", children: n })
|
|
655
703
|
] });
|
|
656
704
|
}
|
|
657
|
-
function
|
|
705
|
+
function Be({
|
|
658
706
|
children: e,
|
|
659
707
|
onClose: n,
|
|
660
708
|
title: t,
|
|
661
709
|
variant: r = "no-stage",
|
|
662
|
-
stage:
|
|
710
|
+
stage: s,
|
|
663
711
|
navigation: a,
|
|
664
712
|
footer: c
|
|
665
713
|
}) {
|
|
@@ -676,12 +724,12 @@ function Ze({
|
|
|
676
724
|
"aria-label": u ? void 0 : "Panel",
|
|
677
725
|
className: `gloss-panel-chrome-v2 gloss-panel-chrome-v2--${r}${o ? " gloss-panel-chrome-v2--headerless" : ""}`,
|
|
678
726
|
children: [
|
|
679
|
-
!o && /* @__PURE__ */
|
|
680
|
-
r === "with-stage" && /* @__PURE__ */
|
|
681
|
-
a != null && /* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
c != null && /* @__PURE__ */
|
|
684
|
-
o && /* @__PURE__ */
|
|
727
|
+
!o && /* @__PURE__ */ i(Me, { title: t, onClose: n, titleId: p }),
|
|
728
|
+
r === "with-stage" && /* @__PURE__ */ i(Re, { children: s }),
|
|
729
|
+
a != null && /* @__PURE__ */ i(Fe, { children: a }),
|
|
730
|
+
/* @__PURE__ */ i(Ae, { children: e }),
|
|
731
|
+
c != null && /* @__PURE__ */ i(He, { left: c.left, right: c.right }),
|
|
732
|
+
o && /* @__PURE__ */ i(
|
|
685
733
|
"button",
|
|
686
734
|
{
|
|
687
735
|
id: "panel-close",
|
|
@@ -696,45 +744,45 @@ function Ze({
|
|
|
696
744
|
}
|
|
697
745
|
);
|
|
698
746
|
}
|
|
699
|
-
function
|
|
747
|
+
function sn({ isOpen: e }) {
|
|
700
748
|
const n = Pe();
|
|
701
|
-
return /* @__PURE__ */
|
|
702
|
-
|
|
749
|
+
return /* @__PURE__ */ i(
|
|
750
|
+
Be,
|
|
703
751
|
{
|
|
704
752
|
variant: "no-stage",
|
|
705
753
|
title: "Notifications",
|
|
706
754
|
onClose: () => n?.dispatch({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
707
|
-
children: /* @__PURE__ */
|
|
755
|
+
children: /* @__PURE__ */ i(
|
|
708
756
|
"div",
|
|
709
757
|
{
|
|
710
758
|
"data-shell": "notification-center",
|
|
711
759
|
"data-panel": "notification-center",
|
|
712
760
|
"aria-hidden": !e,
|
|
713
|
-
children: /* @__PURE__ */
|
|
761
|
+
children: /* @__PURE__ */ i("p", { children: "No notifications" })
|
|
714
762
|
}
|
|
715
763
|
)
|
|
716
764
|
}
|
|
717
765
|
);
|
|
718
766
|
}
|
|
719
|
-
const
|
|
767
|
+
const Ze = {
|
|
720
768
|
position: "relative",
|
|
721
769
|
pointerEvents: "auto"
|
|
722
770
|
};
|
|
723
|
-
function Ke({ children: e, onClose: n, footer: t, title: r, variant:
|
|
771
|
+
function Ke({ children: e, onClose: n, footer: t, title: r, variant: s = "default" }) {
|
|
724
772
|
const a = `panel-close-${X().replace(/:/g, "-")}`;
|
|
725
773
|
return /* @__PURE__ */ N(
|
|
726
774
|
"div",
|
|
727
775
|
{
|
|
728
776
|
"data-chrome": "panel",
|
|
729
|
-
"data-chrome-variant":
|
|
777
|
+
"data-chrome-variant": s,
|
|
730
778
|
role: "dialog",
|
|
731
779
|
"aria-modal": "true",
|
|
732
|
-
className:
|
|
733
|
-
style:
|
|
780
|
+
className: s === "merged-stage" ? "gloss-panel-chrome gloss-panel-chrome--merged-stage" : "gloss-panel-chrome",
|
|
781
|
+
style: Ze,
|
|
734
782
|
children: [
|
|
735
783
|
/* @__PURE__ */ N("div", { className: "gloss-panel-chrome__header", children: [
|
|
736
|
-
r != null && /* @__PURE__ */
|
|
737
|
-
/* @__PURE__ */
|
|
784
|
+
r != null && /* @__PURE__ */ i("span", { className: "gloss-panel-chrome__title", children: r }),
|
|
785
|
+
/* @__PURE__ */ i(
|
|
738
786
|
"button",
|
|
739
787
|
{
|
|
740
788
|
id: a,
|
|
@@ -746,8 +794,8 @@ function Ke({ children: e, onClose: n, footer: t, title: r, variant: i = "defaul
|
|
|
746
794
|
}
|
|
747
795
|
)
|
|
748
796
|
] }),
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
t != null && /* @__PURE__ */
|
|
797
|
+
/* @__PURE__ */ i("div", { className: "gloss-panel-chrome__body", children: e }),
|
|
798
|
+
t != null && /* @__PURE__ */ i("div", { className: "gloss-panel-chrome__footer", children: t })
|
|
751
799
|
]
|
|
752
800
|
}
|
|
753
801
|
);
|
|
@@ -763,12 +811,12 @@ function Ue(e) {
|
|
|
763
811
|
n
|
|
764
812
|
);
|
|
765
813
|
}
|
|
766
|
-
function
|
|
814
|
+
function ze({ isOpen: e, children: n }) {
|
|
767
815
|
const t = ee(), r = O(null);
|
|
768
816
|
G(() => {
|
|
769
817
|
Ue(r.current);
|
|
770
818
|
}, []);
|
|
771
|
-
const [
|
|
819
|
+
const [s, a] = F(!1);
|
|
772
820
|
w(() => {
|
|
773
821
|
if (!e) {
|
|
774
822
|
a(!1);
|
|
@@ -779,10 +827,10 @@ function $e({ isOpen: e, children: n }) {
|
|
|
779
827
|
}, [e]);
|
|
780
828
|
const c = [
|
|
781
829
|
"gloss-panel-mount",
|
|
782
|
-
|
|
830
|
+
s ? "has-panel" : "",
|
|
783
831
|
t ? "reduced-motion" : ""
|
|
784
832
|
].filter(Boolean).join(" ");
|
|
785
|
-
return /* @__PURE__ */
|
|
833
|
+
return /* @__PURE__ */ i(
|
|
786
834
|
"div",
|
|
787
835
|
{
|
|
788
836
|
ref: r,
|
|
@@ -804,7 +852,7 @@ const Ve = {
|
|
|
804
852
|
overflow: "visible",
|
|
805
853
|
pointerEvents: "none",
|
|
806
854
|
zIndex: 55
|
|
807
|
-
},
|
|
855
|
+
}, $e = {
|
|
808
856
|
position: "fixed",
|
|
809
857
|
top: "var(--tb-h, 60px)",
|
|
810
858
|
left: 0,
|
|
@@ -818,9 +866,9 @@ const Ve = {
|
|
|
818
866
|
pointerEvents: "none",
|
|
819
867
|
background: "rgba(0, 0, 0, 0.04)"
|
|
820
868
|
};
|
|
821
|
-
function
|
|
822
|
-
const { state: n, dispatch: t, getCloseLog: r } =
|
|
823
|
-
n.activePanelId && !
|
|
869
|
+
function ln({ panelComponents: e }) {
|
|
870
|
+
const { state: n, dispatch: t, getCloseLog: r } = _e(), s = n.activePanelId ? e[n.activePanelId] : null;
|
|
871
|
+
n.activePanelId && !s && process.env.NODE_ENV !== "production" && console.error(
|
|
824
872
|
"[panels] No panel component registered for activePanelId:",
|
|
825
873
|
n.activePanelId
|
|
826
874
|
), w(() => {
|
|
@@ -846,26 +894,26 @@ function Ge({ panelComponents: e }) {
|
|
|
846
894
|
o.__panelsHostHandle?.dispatch === t && delete o.__panelsHostHandle;
|
|
847
895
|
};
|
|
848
896
|
}, [t, r]);
|
|
849
|
-
const c = n.activePanelId != null &&
|
|
897
|
+
const c = n.activePanelId != null && s != null;
|
|
850
898
|
return /* @__PURE__ */ N("div", { "data-panel-host": "true", style: Ve, children: [
|
|
851
|
-
c && /* @__PURE__ */
|
|
899
|
+
c && /* @__PURE__ */ i(
|
|
852
900
|
"div",
|
|
853
901
|
{
|
|
854
902
|
"data-panel-scrim": "true",
|
|
855
|
-
style:
|
|
903
|
+
style: $e
|
|
856
904
|
}
|
|
857
905
|
),
|
|
858
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ i(ze, { isOpen: c, children: c && /* @__PURE__ */ i(
|
|
859
907
|
Ke,
|
|
860
908
|
{
|
|
861
909
|
isOpen: !0,
|
|
862
910
|
onClose: () => t({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
863
|
-
children: /* @__PURE__ */ s
|
|
911
|
+
children: /* @__PURE__ */ i(s, { isOpen: !0 })
|
|
864
912
|
}
|
|
865
913
|
) })
|
|
866
914
|
] });
|
|
867
915
|
}
|
|
868
|
-
const
|
|
916
|
+
const an = {
|
|
869
917
|
"apply-button": !0,
|
|
870
918
|
// the ONLY commit reason
|
|
871
919
|
"cancel-button": !1,
|
|
@@ -883,25 +931,33 @@ const Je = {
|
|
|
883
931
|
// 260524 panel-x-axis-transitions — viewport shrank past targetSection
|
|
884
932
|
};
|
|
885
933
|
export {
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
934
|
+
an as C,
|
|
935
|
+
nn as H,
|
|
936
|
+
sn as N,
|
|
937
|
+
on as P,
|
|
938
|
+
be as S,
|
|
939
|
+
en as a,
|
|
940
|
+
tn as b,
|
|
941
|
+
We as c,
|
|
942
|
+
ye as d,
|
|
943
|
+
_e as e,
|
|
944
|
+
ln as f,
|
|
945
|
+
rn as g,
|
|
946
|
+
Le as h,
|
|
947
|
+
Te as i,
|
|
948
|
+
Oe as j,
|
|
900
949
|
ke as k,
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
950
|
+
ge as l,
|
|
951
|
+
ee as m,
|
|
952
|
+
Be as n,
|
|
953
|
+
ze as o,
|
|
954
|
+
Je as p,
|
|
955
|
+
Me as q,
|
|
956
|
+
Ge as r,
|
|
957
|
+
Xe as s,
|
|
958
|
+
Re as t,
|
|
959
|
+
Pe as u,
|
|
960
|
+
Fe as v,
|
|
961
|
+
Ae as w,
|
|
962
|
+
He as x
|
|
907
963
|
};
|