@mt-gloss/ui 0.1.121 → 0.1.123
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-8eHelQHO.js → COMMITS-C1VHNgld.js} +130 -128
- package/composites-panels.js +393 -577
- package/index.js +2 -2
- package/lib/composites/panels/chrome-v2/PanelHeader.d.ts +5 -1
- package/lib/composites/panels/chrome-v2/index.d.ts +6 -0
- package/lib/composites/panels/shells/CatalogAddShell.d.ts +10 -1
- package/lib/composites/panels/shells/internals/catalog-mocks.d.ts +21 -14
- package/package.json +1 -1
- package/ui.css +1 -1
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { jsx as i, jsxs as N } from "react/jsx-runtime";
|
|
2
2
|
import { motion as se } from "framer-motion";
|
|
3
|
-
import M, { useSyncExternalStore as ie, useState as H, useRef as w, useMemo as V, useEffect as L, useCallback as O, createContext as le, useContext as W, useReducer as ae, useLayoutEffect as X } from "react";
|
|
3
|
+
import M, { useSyncExternalStore as ie, useState as H, useRef as w, useMemo as V, useEffect as L, useCallback as O, createContext as le, useContext as W, useReducer as ae, useId as ce, useLayoutEffect as X } from "react";
|
|
4
4
|
import { z as T } from "zod";
|
|
5
|
-
const
|
|
5
|
+
const de = "(prefers-reduced-motion: reduce)";
|
|
6
6
|
function G() {
|
|
7
|
-
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(
|
|
7
|
+
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(de);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function ue(e) {
|
|
10
10
|
const n = G();
|
|
11
11
|
return n ? (n.addEventListener("change", e), () => {
|
|
12
12
|
n.removeEventListener("change", e);
|
|
13
13
|
}) : () => {
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function fe() {
|
|
17
17
|
const e = G();
|
|
18
18
|
return e ? e.matches : !1;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function pe() {
|
|
21
21
|
return !1;
|
|
22
22
|
}
|
|
23
23
|
function J() {
|
|
24
|
-
return ie(
|
|
24
|
+
return ie(ue, fe, pe);
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const me = {
|
|
27
27
|
threshold: "Threshold",
|
|
28
28
|
timeframe: "Timeframe",
|
|
29
29
|
slots: "Slots",
|
|
30
30
|
color: "Color"
|
|
31
31
|
};
|
|
32
|
-
function
|
|
32
|
+
function ge({
|
|
33
33
|
dimensions: e,
|
|
34
34
|
activeTab: n,
|
|
35
35
|
onSelect: t,
|
|
@@ -39,7 +39,7 @@ function me({
|
|
|
39
39
|
}) {
|
|
40
40
|
const c = J(), s = r ?? c;
|
|
41
41
|
if (e.length < 2) return null;
|
|
42
|
-
const
|
|
42
|
+
const f = (d) => o?.[d] ?? me[d], u = (d, m) => {
|
|
43
43
|
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
44
|
};
|
|
45
45
|
return /* @__PURE__ */ i(
|
|
@@ -63,7 +63,7 @@ function me({
|
|
|
63
63
|
onClick: () => t(d),
|
|
64
64
|
onKeyDown: (R) => u(R, m),
|
|
65
65
|
children: [
|
|
66
|
-
/* @__PURE__ */ i("span", { className: "settings-tab-strip__label", children:
|
|
66
|
+
/* @__PURE__ */ i("span", { className: "settings-tab-strip__label", children: f(d) }),
|
|
67
67
|
_ && !s && /* @__PURE__ */ i(
|
|
68
68
|
se.span,
|
|
69
69
|
{
|
|
@@ -82,7 +82,7 @@ function me({
|
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
ge.displayName = "SettingsTabStrip";
|
|
86
86
|
function U(e, n) {
|
|
87
87
|
for (const t of e)
|
|
88
88
|
if (t.items.some((r) => r.id === n))
|
|
@@ -93,22 +93,22 @@ function Q(e, n) {
|
|
|
93
93
|
const t = e.find((r) => r.zoneKey === n);
|
|
94
94
|
return t ? t.zoneKey : U(e, n);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function he(e, n, t) {
|
|
97
97
|
const r = [...e], [o] = r.splice(n, 1);
|
|
98
98
|
return r.splice(t, 0, o), r;
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function ve(e) {
|
|
101
101
|
return e.map((n) => `${n.zoneKey}:${n.items.map((t) => t.id).join(",")}`).join("|");
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function ye(e) {
|
|
104
104
|
const [n, t] = H(
|
|
105
105
|
() => e.zones.map((l) => l.maxItems !== void 0 && l.items.length > l.maxItems ? (process.env.NODE_ENV !== "production" && console.warn(
|
|
106
106
|
`useSortableZones: zone "${l.zoneKey}" exceeds maxItems (${l.items.length} > ${l.maxItems}); trimming to cap.`
|
|
107
107
|
), { ...l, items: l.items.slice(0, l.maxItems) }) : l)
|
|
108
|
-
), [r, o] = H(null), [a, c] = H(null), s = w(null),
|
|
109
|
-
|
|
108
|
+
), [r, o] = H(null), [a, c] = H(null), s = w(null), f = w(e.onZoneChange);
|
|
109
|
+
f.current = e.onZoneChange;
|
|
110
110
|
const u = V(
|
|
111
|
-
() =>
|
|
111
|
+
() => ve(e.zones),
|
|
112
112
|
[e.zones]
|
|
113
113
|
), d = w(u);
|
|
114
114
|
L(() => {
|
|
@@ -123,7 +123,7 @@ function ve(e) {
|
|
|
123
123
|
const g = l.active.id;
|
|
124
124
|
let S = null, y = null;
|
|
125
125
|
for (const b of n) {
|
|
126
|
-
const P = b.items.find((
|
|
126
|
+
const P = b.items.find((p) => p.id === g);
|
|
127
127
|
if (P) {
|
|
128
128
|
S = P, y = b.zoneKey;
|
|
129
129
|
break;
|
|
@@ -156,15 +156,15 @@ function ve(e) {
|
|
|
156
156
|
y();
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
let
|
|
159
|
+
let p = n.map((E) => ({ ...E, items: [...E.items] }));
|
|
160
160
|
if (b === P) {
|
|
161
|
-
const E =
|
|
162
|
-
|
|
161
|
+
const E = p.findIndex((D) => D.zoneKey === b), I = p[E], h = I.items.findIndex((D) => D.id === g.id), C = I.items.findIndex((D) => D.id === S.id), A = C >= 0 ? C : Math.max(0, I.items.length - 1);
|
|
162
|
+
p[E] = {
|
|
163
163
|
...I,
|
|
164
|
-
items:
|
|
164
|
+
items: he(I.items, h, A)
|
|
165
165
|
};
|
|
166
166
|
} else {
|
|
167
|
-
const E =
|
|
167
|
+
const E = p.findIndex((v) => v.zoneKey === b), I = p.findIndex((v) => v.zoneKey === P), h = p[E], C = p[I], A = h.items.find((v) => v.id === g.id);
|
|
168
168
|
if (!A) {
|
|
169
169
|
y();
|
|
170
170
|
return;
|
|
@@ -180,9 +180,9 @@ function ve(e) {
|
|
|
180
180
|
A,
|
|
181
181
|
...x.slice(q)
|
|
182
182
|
];
|
|
183
|
-
|
|
183
|
+
p[E] = { ...h, items: j }, p[I] = { ...C, items: oe };
|
|
184
184
|
}
|
|
185
|
-
t(
|
|
185
|
+
t(p), f.current?.(p), y();
|
|
186
186
|
},
|
|
187
187
|
[n]
|
|
188
188
|
), B = O(
|
|
@@ -214,7 +214,7 @@ function ve(e) {
|
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
216
|
let k = null, F = null, K = !1;
|
|
217
|
-
const
|
|
217
|
+
const Ee = [
|
|
218
218
|
"DndContext",
|
|
219
219
|
"DragOverlay",
|
|
220
220
|
"useSensors",
|
|
@@ -223,21 +223,21 @@ const ye = [
|
|
|
223
223
|
"PointerSensor",
|
|
224
224
|
"KeyboardSensor",
|
|
225
225
|
"closestCenter"
|
|
226
|
-
],
|
|
226
|
+
], Ie = [
|
|
227
227
|
"SortableContext",
|
|
228
228
|
"useSortable",
|
|
229
229
|
"verticalListSortingStrategy"
|
|
230
230
|
];
|
|
231
|
-
function
|
|
231
|
+
function Ce(e, n) {
|
|
232
232
|
const t = [], r = e ?? {};
|
|
233
|
-
for (const a of
|
|
233
|
+
for (const a of Ee)
|
|
234
234
|
r[a] === void 0 && t.push(`@dnd-kit/core:${a}`);
|
|
235
235
|
const o = n ?? {};
|
|
236
|
-
for (const a of
|
|
236
|
+
for (const a of Ie)
|
|
237
237
|
o[a] === void 0 && t.push(`@dnd-kit/sortable:${a}`);
|
|
238
238
|
return t.length === 0 ? { ok: !0 } : { ok: !1, missing: t };
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function Se() {
|
|
241
241
|
return k ? Promise.resolve(k) : K ? Promise.resolve(null) : F || (F = (async () => {
|
|
242
242
|
try {
|
|
243
243
|
const [e, n, t] = await Promise.all([
|
|
@@ -246,7 +246,7 @@ function Ce() {
|
|
|
246
246
|
import("@dnd-kit/utilities").catch(() => (process.env.NODE_ENV !== "production" && console.warn(
|
|
247
247
|
"SortableZones: @dnd-kit/utilities failed to load; drag-overlay positioning will fall back (items may teleport instead of slide)."
|
|
248
248
|
), {}))
|
|
249
|
-
]), r =
|
|
249
|
+
]), r = Ce(e, n);
|
|
250
250
|
return r.ok ? (k = {
|
|
251
251
|
core: e,
|
|
252
252
|
sortable: n,
|
|
@@ -259,13 +259,13 @@ function Ce() {
|
|
|
259
259
|
}
|
|
260
260
|
})(), F);
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
const { zones: n, onZoneChange: t, renderZone: r, renderItem: o, renderDragOverlay: a } = e, c =
|
|
262
|
+
function be(e) {
|
|
263
|
+
const { zones: n, onZoneChange: t, renderZone: r, renderItem: o, renderDragOverlay: a } = e, c = ye({ zones: n, onZoneChange: t }), [s, f] = M.useState(k);
|
|
264
264
|
return M.useEffect(() => {
|
|
265
265
|
if (s) return;
|
|
266
266
|
let u = !0;
|
|
267
|
-
return
|
|
268
|
-
u &&
|
|
267
|
+
return Se().then((d) => {
|
|
268
|
+
u && f(d);
|
|
269
269
|
}), () => {
|
|
270
270
|
u = !1;
|
|
271
271
|
};
|
|
@@ -283,7 +283,7 @@ function Se(e) {
|
|
|
283
283
|
return /* @__PURE__ */ i("div", { ...c.getZoneProps(u.zoneKey), children: r(u.zoneKey, u.items, d) }, u.zoneKey);
|
|
284
284
|
}) });
|
|
285
285
|
}
|
|
286
|
-
|
|
286
|
+
be.displayName = "SortableZones";
|
|
287
287
|
function ee({
|
|
288
288
|
state: e,
|
|
289
289
|
modules: n,
|
|
@@ -291,10 +291,10 @@ function ee({
|
|
|
291
291
|
renderItem: r,
|
|
292
292
|
renderDragOverlay: o
|
|
293
293
|
}) {
|
|
294
|
-
const { core: a, sortable: c, utilities: s } = n, { DndContext:
|
|
294
|
+
const { core: a, sortable: c, utilities: s } = n, { DndContext: f, DragOverlay: u, useSensors: d, useSensor: m, useDroppable: _, PointerSensor: R, KeyboardSensor: B, closestCenter: Z } = a, { SortableContext: l, verticalListSortingStrategy: g } = c, S = d(
|
|
295
295
|
m(R, { activationConstraint: { distance: 5 } }),
|
|
296
296
|
m(B)
|
|
297
|
-
), y =
|
|
297
|
+
), y = f, b = u, P = l;
|
|
298
298
|
return /* @__PURE__ */ N(
|
|
299
299
|
y,
|
|
300
300
|
{
|
|
@@ -304,8 +304,8 @@ function ee({
|
|
|
304
304
|
onDragOver: e.handleDragOver,
|
|
305
305
|
onDragEnd: e.handleDragEnd,
|
|
306
306
|
children: [
|
|
307
|
-
e.zones.map((
|
|
308
|
-
const E =
|
|
307
|
+
e.zones.map((p) => {
|
|
308
|
+
const E = p.items.map((h) => h.id), I = p.items.map((h) => /* @__PURE__ */ i(
|
|
309
309
|
ne,
|
|
310
310
|
{
|
|
311
311
|
id: h.id,
|
|
@@ -318,12 +318,12 @@ function ee({
|
|
|
318
318
|
return /* @__PURE__ */ i(
|
|
319
319
|
te,
|
|
320
320
|
{
|
|
321
|
-
zoneKey:
|
|
322
|
-
zoneProps: e.getZoneProps(
|
|
321
|
+
zoneKey: p.zoneKey,
|
|
322
|
+
zoneProps: e.getZoneProps(p.zoneKey),
|
|
323
323
|
useDroppable: _,
|
|
324
|
-
children: /* @__PURE__ */ i(P, { items: E, strategy: g, children: t(
|
|
324
|
+
children: /* @__PURE__ */ i(P, { items: E, strategy: g, children: t(p.zoneKey, p.items, I) })
|
|
325
325
|
},
|
|
326
|
-
|
|
326
|
+
p.zoneKey
|
|
327
327
|
);
|
|
328
328
|
}),
|
|
329
329
|
/* @__PURE__ */ i(b, { children: e.activeItem ? o?.(e.activeItem) ?? r(e.activeItem) : null })
|
|
@@ -333,9 +333,9 @@ function ee({
|
|
|
333
333
|
}
|
|
334
334
|
ee.displayName = "SortableZonesInner";
|
|
335
335
|
function ne({ id: e, useSortable: n, cssHelper: t, children: r }) {
|
|
336
|
-
const { attributes: o, listeners: a, setNodeRef: c, transform: s, transition:
|
|
336
|
+
const { attributes: o, listeners: a, setNodeRef: c, transform: s, transition: f, isDragging: u } = n({ id: e }), d = {
|
|
337
337
|
transform: t?.Transform?.toString(s) ?? void 0,
|
|
338
|
-
transition:
|
|
338
|
+
transition: f,
|
|
339
339
|
opacity: u ? 0.5 : 1
|
|
340
340
|
};
|
|
341
341
|
return /* @__PURE__ */ i("div", { ref: c, style: d, "data-sortable-item-id": e, ...o, ...a, children: r });
|
|
@@ -352,7 +352,7 @@ function te({
|
|
|
352
352
|
}
|
|
353
353
|
te.displayName = "ZoneDroppable";
|
|
354
354
|
const $ = le(null);
|
|
355
|
-
function
|
|
355
|
+
function _e() {
|
|
356
356
|
const e = W($);
|
|
357
357
|
if (!e)
|
|
358
358
|
throw new Error(
|
|
@@ -360,34 +360,34 @@ function be() {
|
|
|
360
360
|
);
|
|
361
361
|
return e;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Pe() {
|
|
364
364
|
return W($);
|
|
365
365
|
}
|
|
366
|
-
const
|
|
367
|
-
function
|
|
366
|
+
const De = T.number().min(0).max(100), xe = T.number().min(7).max(90), Ne = T.enum(["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"]), Oe = T.array(T.string().min(1)).max(3), we = T.boolean();
|
|
367
|
+
function Le(e, n) {
|
|
368
368
|
if (e === "threshold") {
|
|
369
|
-
const t =
|
|
369
|
+
const t = De.safeParse(n);
|
|
370
370
|
return t.success ? t.data : 80;
|
|
371
371
|
}
|
|
372
372
|
if (e === "timeframe") {
|
|
373
|
-
const t =
|
|
373
|
+
const t = xe.safeParse(n);
|
|
374
374
|
return t.success ? t.data : 30;
|
|
375
375
|
}
|
|
376
376
|
if (e === "accent") {
|
|
377
|
-
const t =
|
|
377
|
+
const t = Ne.safeParse(n);
|
|
378
378
|
return t.success ? t.data : null;
|
|
379
379
|
}
|
|
380
380
|
if (e === "slots") {
|
|
381
|
-
const t =
|
|
381
|
+
const t = Oe.safeParse(n);
|
|
382
382
|
return t.success ? t.data : [];
|
|
383
383
|
}
|
|
384
384
|
if (e === "thresholdEnabled" || e === "accentEnabled") {
|
|
385
|
-
const t =
|
|
385
|
+
const t = we.safeParse(n);
|
|
386
386
|
return t.success ? t.data : !1;
|
|
387
387
|
}
|
|
388
388
|
return n;
|
|
389
389
|
}
|
|
390
|
-
const
|
|
390
|
+
const Te = {
|
|
391
391
|
activePanelId: null,
|
|
392
392
|
activeTrigger: null,
|
|
393
393
|
bellCutoutOpen: !1,
|
|
@@ -398,7 +398,7 @@ const Le = {
|
|
|
398
398
|
lastClose: null,
|
|
399
399
|
pendingSideEffects: []
|
|
400
400
|
}, Y = /* @__PURE__ */ new Set(["settings"]);
|
|
401
|
-
function
|
|
401
|
+
function Re(e, n) {
|
|
402
402
|
if (e == null || e.kind !== n.kind) return !1;
|
|
403
403
|
switch (e.kind) {
|
|
404
404
|
case "bell":
|
|
@@ -413,7 +413,7 @@ function Te(e, n) {
|
|
|
413
413
|
return e.action === n.action && e.blockedCardId === n.blockedCardId && e.activeCardId === n.activeCardId;
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function ke(e, n) {
|
|
417
417
|
switch (n.type) {
|
|
418
418
|
case "OPEN_PANEL": {
|
|
419
419
|
if (e.activePanelId && e.isDirty)
|
|
@@ -431,7 +431,7 @@ function Re(e, n) {
|
|
|
431
431
|
}
|
|
432
432
|
]
|
|
433
433
|
};
|
|
434
|
-
if (e.activePanelId === n.panelId &&
|
|
434
|
+
if (e.activePanelId === n.panelId && Re(e.activeTrigger, n.trigger))
|
|
435
435
|
return e;
|
|
436
436
|
const t = e.activePanelId != null ? [
|
|
437
437
|
{
|
|
@@ -501,13 +501,13 @@ function Re(e, n) {
|
|
|
501
501
|
{ type: "INVALID_DISPATCH", reason: "no-buffer-panel" }
|
|
502
502
|
]
|
|
503
503
|
};
|
|
504
|
-
const t = e.bufferByCard[n.cardId], r = t == null, o =
|
|
504
|
+
const t = e.bufferByCard[n.cardId], r = t == null, o = Le(n.key, n.value);
|
|
505
505
|
if (!r && t.changes[n.key] === o)
|
|
506
506
|
return e;
|
|
507
507
|
const c = { kind: "settings", changes: {
|
|
508
508
|
...t?.kind === "settings" ? t.changes : {},
|
|
509
509
|
[n.key]: o
|
|
510
|
-
} }, s = { ...e.bufferByCard, [n.cardId]: c },
|
|
510
|
+
} }, s = { ...e.bufferByCard, [n.cardId]: c }, f = r ? [
|
|
511
511
|
{
|
|
512
512
|
type: "SCHEDULE_TIMER",
|
|
513
513
|
ms: 0,
|
|
@@ -517,7 +517,7 @@ function Re(e, n) {
|
|
|
517
517
|
return {
|
|
518
518
|
...e,
|
|
519
519
|
bufferByCard: s,
|
|
520
|
-
pendingSideEffects: [...e.pendingSideEffects, ...
|
|
520
|
+
pendingSideEffects: [...e.pendingSideEffects, ...f]
|
|
521
521
|
};
|
|
522
522
|
}
|
|
523
523
|
case "CLEAR_BUFFER": {
|
|
@@ -575,11 +575,11 @@ function Re(e, n) {
|
|
|
575
575
|
return e;
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Ae(e) {
|
|
579
579
|
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";
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
const [e, n] = ae(
|
|
581
|
+
function Fe() {
|
|
582
|
+
const [e, n] = ae(ke, Te), t = w([]), r = w(null);
|
|
583
583
|
L(() => () => {
|
|
584
584
|
r.current != null && (window.clearTimeout(r.current), r.current = null);
|
|
585
585
|
}, []), L(() => {
|
|
@@ -613,13 +613,13 @@ function Ae() {
|
|
|
613
613
|
];
|
|
614
614
|
}, [e.lastClose]);
|
|
615
615
|
const o = V(
|
|
616
|
-
() =>
|
|
616
|
+
() => Ae(e),
|
|
617
617
|
[e.activePanelId, e.bellCutoutOpen, e.isDirty]
|
|
618
618
|
), a = O(() => t.current.slice(), []);
|
|
619
619
|
return { state: e, surfaceState: o, dispatch: n, getCloseLog: a };
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
const n =
|
|
621
|
+
function Je({ children: e }) {
|
|
622
|
+
const n = Fe(), t = V(
|
|
623
623
|
() => n,
|
|
624
624
|
// Re-publish only when one of the four coordinator fields changes identity.
|
|
625
625
|
// dispatch + getCloseLog are stable. state + surfaceState change on dispatch.
|
|
@@ -627,9 +627,9 @@ function Ge({ children: e }) {
|
|
|
627
627
|
);
|
|
628
628
|
return /* @__PURE__ */ i($.Provider, { value: t, children: e });
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function He({ title: e, onClose: n, titleId: t }) {
|
|
631
631
|
return /* @__PURE__ */ N("div", { className: "gloss-panel-chrome-v2__header", children: [
|
|
632
|
-
e != null && /* @__PURE__ */ i("span", { className: "gloss-panel-chrome-v2__title", children: e }),
|
|
632
|
+
e != null && /* @__PURE__ */ i("span", { id: t, className: "gloss-panel-chrome-v2__title", children: e }),
|
|
633
633
|
/* @__PURE__ */ i(
|
|
634
634
|
"button",
|
|
635
635
|
{
|
|
@@ -643,7 +643,7 @@ function Fe({ title: e, onClose: n }) {
|
|
|
643
643
|
)
|
|
644
644
|
] });
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function Be({ children: e }) {
|
|
647
647
|
return /* @__PURE__ */ i(
|
|
648
648
|
"div",
|
|
649
649
|
{
|
|
@@ -654,19 +654,19 @@ function He({ children: e }) {
|
|
|
654
654
|
}
|
|
655
655
|
);
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function Ze({ children: e }) {
|
|
658
658
|
return /* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__navigation", children: e });
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function Me({ children: e }) {
|
|
661
661
|
return /* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__body", children: e });
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function Ke({ left: e, right: n }) {
|
|
664
664
|
return /* @__PURE__ */ N("div", { className: "gloss-panel-chrome-v2__footer", children: [
|
|
665
665
|
/* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__footer-left", children: e }),
|
|
666
666
|
/* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__footer-right", children: n })
|
|
667
667
|
] });
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function Ue({
|
|
670
670
|
children: e,
|
|
671
671
|
onClose: n,
|
|
672
672
|
title: t,
|
|
@@ -675,7 +675,7 @@ function Ke({
|
|
|
675
675
|
navigation: a,
|
|
676
676
|
footer: c
|
|
677
677
|
}) {
|
|
678
|
-
const s = t == null && r === "with-stage";
|
|
678
|
+
const s = t == null && r === "with-stage", f = ce(), u = t != null;
|
|
679
679
|
return /* @__PURE__ */ N(
|
|
680
680
|
"div",
|
|
681
681
|
{
|
|
@@ -684,13 +684,15 @@ function Ke({
|
|
|
684
684
|
"data-headerless": s || void 0,
|
|
685
685
|
role: "dialog",
|
|
686
686
|
"aria-modal": "true",
|
|
687
|
+
"aria-labelledby": u ? f : void 0,
|
|
688
|
+
"aria-label": u ? void 0 : "Panel",
|
|
687
689
|
className: `gloss-panel-chrome-v2 gloss-panel-chrome-v2--${r}${s ? " gloss-panel-chrome-v2--headerless" : ""}`,
|
|
688
690
|
children: [
|
|
689
|
-
!s && /* @__PURE__ */ i(
|
|
690
|
-
r === "with-stage" && /* @__PURE__ */ i(
|
|
691
|
-
a != null && /* @__PURE__ */ i(
|
|
692
|
-
/* @__PURE__ */ i(
|
|
693
|
-
c != null && /* @__PURE__ */ i(
|
|
691
|
+
!s && /* @__PURE__ */ i(He, { title: t, onClose: n, titleId: f }),
|
|
692
|
+
r === "with-stage" && /* @__PURE__ */ i(Be, { children: o }),
|
|
693
|
+
a != null && /* @__PURE__ */ i(Ze, { children: a }),
|
|
694
|
+
/* @__PURE__ */ i(Me, { children: e }),
|
|
695
|
+
c != null && /* @__PURE__ */ i(Ke, { left: c.left, right: c.right }),
|
|
694
696
|
s && /* @__PURE__ */ i(
|
|
695
697
|
"button",
|
|
696
698
|
{
|
|
@@ -706,10 +708,10 @@ function Ke({
|
|
|
706
708
|
}
|
|
707
709
|
);
|
|
708
710
|
}
|
|
709
|
-
function
|
|
710
|
-
const n =
|
|
711
|
+
function en({ isOpen: e }) {
|
|
712
|
+
const n = Pe();
|
|
711
713
|
return /* @__PURE__ */ i(
|
|
712
|
-
|
|
714
|
+
Ue,
|
|
713
715
|
{
|
|
714
716
|
variant: "no-stage",
|
|
715
717
|
title: "Notifications",
|
|
@@ -726,11 +728,11 @@ function Je({ isOpen: e }) {
|
|
|
726
728
|
}
|
|
727
729
|
);
|
|
728
730
|
}
|
|
729
|
-
const
|
|
731
|
+
const Ve = {
|
|
730
732
|
position: "relative",
|
|
731
733
|
pointerEvents: "auto"
|
|
732
734
|
};
|
|
733
|
-
function
|
|
735
|
+
function $e({ children: e, onClose: n, footer: t, title: r, variant: o = "default" }) {
|
|
734
736
|
return /* @__PURE__ */ N(
|
|
735
737
|
"div",
|
|
736
738
|
{
|
|
@@ -739,7 +741,7 @@ function Ve({ children: e, onClose: n, footer: t, title: r, variant: o = "defaul
|
|
|
739
741
|
role: "dialog",
|
|
740
742
|
"aria-modal": "true",
|
|
741
743
|
className: o === "merged-stage" ? "gloss-panel-chrome gloss-panel-chrome--merged-stage" : "gloss-panel-chrome",
|
|
742
|
-
style:
|
|
744
|
+
style: Ve,
|
|
743
745
|
children: [
|
|
744
746
|
/* @__PURE__ */ N("div", { className: "gloss-panel-chrome__header", children: [
|
|
745
747
|
r != null && /* @__PURE__ */ i("span", { className: "gloss-panel-chrome__title", children: r }),
|
|
@@ -761,7 +763,7 @@ function Ve({ children: e, onClose: n, footer: t, title: r, variant: o = "defaul
|
|
|
761
763
|
}
|
|
762
764
|
);
|
|
763
765
|
}
|
|
764
|
-
function
|
|
766
|
+
function ze(e) {
|
|
765
767
|
if (process.env.NODE_ENV === "production" || !e || !e.parentElement) return;
|
|
766
768
|
const n = e.parentElement, t = window.getComputedStyle(n);
|
|
767
769
|
t.perspective === "none" && console.warn(
|
|
@@ -772,10 +774,10 @@ function $e(e) {
|
|
|
772
774
|
n
|
|
773
775
|
);
|
|
774
776
|
}
|
|
775
|
-
function
|
|
777
|
+
function je({ isOpen: e, children: n }) {
|
|
776
778
|
const t = J(), r = w(null);
|
|
777
779
|
X(() => {
|
|
778
|
-
|
|
780
|
+
ze(r.current);
|
|
779
781
|
}, []);
|
|
780
782
|
const [o, a] = H(!1);
|
|
781
783
|
L(() => {
|
|
@@ -802,7 +804,7 @@ function ze({ isOpen: e, children: n }) {
|
|
|
802
804
|
}
|
|
803
805
|
);
|
|
804
806
|
}
|
|
805
|
-
const
|
|
807
|
+
const qe = {
|
|
806
808
|
position: "fixed",
|
|
807
809
|
top: 0,
|
|
808
810
|
left: 0,
|
|
@@ -813,7 +815,7 @@ const je = {
|
|
|
813
815
|
overflow: "visible",
|
|
814
816
|
pointerEvents: "none",
|
|
815
817
|
zIndex: 55
|
|
816
|
-
},
|
|
818
|
+
}, Qe = {
|
|
817
819
|
position: "fixed",
|
|
818
820
|
top: "var(--tb-h, 60px)",
|
|
819
821
|
left: 0,
|
|
@@ -829,18 +831,18 @@ const je = {
|
|
|
829
831
|
pointerEvents: "none",
|
|
830
832
|
background: "rgba(0, 0, 0, 0.04)"
|
|
831
833
|
};
|
|
832
|
-
function
|
|
833
|
-
const { state: n, dispatch: t, getCloseLog: r } =
|
|
834
|
+
function nn({ panelComponents: e }) {
|
|
835
|
+
const { state: n, dispatch: t, getCloseLog: r } = _e(), o = n.activePanelId ? e[n.activePanelId] : null;
|
|
834
836
|
n.activePanelId && !o && process.env.NODE_ENV !== "production" && console.error(
|
|
835
837
|
"[panels] No panel component registered for activePanelId:",
|
|
836
838
|
n.activePanelId
|
|
837
839
|
), L(() => {
|
|
838
840
|
if (n.activePanelId == null) return;
|
|
839
|
-
function
|
|
841
|
+
function f(u) {
|
|
840
842
|
u.key === "Escape" && t({ type: "CLOSE_PANEL", reason: "escape-key" });
|
|
841
843
|
}
|
|
842
|
-
return document.addEventListener("keydown",
|
|
843
|
-
document.removeEventListener("keydown",
|
|
844
|
+
return document.addEventListener("keydown", f), () => {
|
|
845
|
+
document.removeEventListener("keydown", f);
|
|
844
846
|
};
|
|
845
847
|
}, [n.activePanelId, t]);
|
|
846
848
|
const a = w(n);
|
|
@@ -848,29 +850,29 @@ function en({ panelComponents: e }) {
|
|
|
848
850
|
a.current = n;
|
|
849
851
|
}), L(() => {
|
|
850
852
|
if (process.env.NODE_ENV === "production") return;
|
|
851
|
-
const
|
|
852
|
-
return
|
|
853
|
+
const f = window;
|
|
854
|
+
return f.__panelsHostHandle && console.warn("[panels] multiple PanelHost/PanelHostShell instances mounted; dev handle is unreliable"), f.__panelsHostHandle = {
|
|
853
855
|
dispatch: t,
|
|
854
856
|
getState: () => a.current,
|
|
855
857
|
getCloseLog: r
|
|
856
858
|
}, () => {
|
|
857
|
-
|
|
859
|
+
f.__panelsHostHandle?.dispatch === t && delete f.__panelsHostHandle;
|
|
858
860
|
};
|
|
859
861
|
}, [t, r]);
|
|
860
862
|
const c = O(() => {
|
|
861
863
|
t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
|
|
862
864
|
}, [t]), s = n.activePanelId != null && o != null;
|
|
863
|
-
return /* @__PURE__ */ N("div", { "data-panel-host": "true", style:
|
|
865
|
+
return /* @__PURE__ */ N("div", { "data-panel-host": "true", style: qe, children: [
|
|
864
866
|
s && /* @__PURE__ */ i(
|
|
865
867
|
"div",
|
|
866
868
|
{
|
|
867
869
|
"data-panel-scrim": "true",
|
|
868
|
-
style:
|
|
870
|
+
style: Qe,
|
|
869
871
|
onClick: c
|
|
870
872
|
}
|
|
871
873
|
),
|
|
872
|
-
/* @__PURE__ */ i(
|
|
873
|
-
|
|
874
|
+
/* @__PURE__ */ i(je, { isOpen: s, children: s && /* @__PURE__ */ i(
|
|
875
|
+
$e,
|
|
874
876
|
{
|
|
875
877
|
isOpen: !0,
|
|
876
878
|
onClose: () => t({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
@@ -879,7 +881,7 @@ function en({ panelComponents: e }) {
|
|
|
879
881
|
) })
|
|
880
882
|
] });
|
|
881
883
|
}
|
|
882
|
-
const
|
|
884
|
+
const tn = {
|
|
883
885
|
"apply-button": !0,
|
|
884
886
|
// the ONLY commit reason
|
|
885
887
|
"cancel-button": !1,
|
|
@@ -895,26 +897,26 @@ const nn = {
|
|
|
895
897
|
// Phase 11.6 D-19 — R9 drag-start auto-close discards buffer
|
|
896
898
|
};
|
|
897
899
|
export {
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
900
|
+
tn as C,
|
|
901
|
+
en as N,
|
|
902
|
+
Je as P,
|
|
903
|
+
be as S,
|
|
904
|
+
ye as a,
|
|
905
|
+
_e as b,
|
|
906
|
+
nn as c,
|
|
907
|
+
$e as d,
|
|
908
|
+
Fe as e,
|
|
909
|
+
Ae as f,
|
|
910
|
+
ge as g,
|
|
909
911
|
J as h,
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
912
|
+
Te as i,
|
|
913
|
+
Ue as j,
|
|
914
|
+
je as k,
|
|
915
|
+
He as l,
|
|
916
|
+
Be as m,
|
|
917
|
+
Ze as n,
|
|
918
|
+
Me as o,
|
|
919
|
+
Ke as p,
|
|
920
|
+
ke as r,
|
|
921
|
+
Pe as u
|
|
920
922
|
};
|