@mt-gloss/ui 0.1.118 → 0.1.120
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-BxJQwv4H.js → COMMITS-8eHelQHO.js} +283 -177
- package/composites-panels.js +596 -669
- package/index.d.ts +1 -1
- package/index.js +47 -46
- package/lib/composites/dashboard/BellPopover/BellPopover.d.ts +12 -0
- package/lib/composites/panels/PanelSlot.d.ts +3 -3
- package/lib/composites/panels/index.d.ts +1 -0
- package/lib/composites/panels/shells/CatalogAddShell.d.ts +5 -5
- package/lib/composites/panels/shells/CatalogReplaceShell.d.ts +5 -2
- package/lib/composites/panels/shells/NotificationCenterShell.d.ts +2 -0
- package/lib/composites/panels/shells/PageMgmtShell.d.ts +7 -2
- package/package.json +1 -1
- package/ui.css +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { motion as
|
|
3
|
-
import M, { useSyncExternalStore as
|
|
4
|
-
import { z as
|
|
1
|
+
import { jsx as i, jsxs as N } from "react/jsx-runtime";
|
|
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";
|
|
4
|
+
import { z as T } from "zod";
|
|
5
5
|
const ce = "(prefers-reduced-motion: reduce)";
|
|
6
6
|
function G() {
|
|
7
7
|
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(ce);
|
|
@@ -21,7 +21,7 @@ function fe() {
|
|
|
21
21
|
return !1;
|
|
22
22
|
}
|
|
23
23
|
function J() {
|
|
24
|
-
return
|
|
24
|
+
return ie(de, ue, fe);
|
|
25
25
|
}
|
|
26
26
|
const pe = {
|
|
27
27
|
threshold: "Threshold",
|
|
@@ -35,37 +35,37 @@ function me({
|
|
|
35
35
|
onSelect: t,
|
|
36
36
|
reduced: r,
|
|
37
37
|
labels: o,
|
|
38
|
-
ariaLabel:
|
|
38
|
+
ariaLabel: a = "Settings dimensions"
|
|
39
39
|
}) {
|
|
40
40
|
const c = J(), s = r ?? c;
|
|
41
41
|
if (e.length < 2) return null;
|
|
42
|
-
const p = (
|
|
43
|
-
|
|
42
|
+
const p = (d) => o?.[d] ?? pe[d], u = (d, m) => {
|
|
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
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ i(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
48
|
role: "tablist",
|
|
49
|
-
"aria-label":
|
|
49
|
+
"aria-label": a,
|
|
50
50
|
className: "settings-tab-strip",
|
|
51
|
-
children: e.map((
|
|
52
|
-
const _ = n ===
|
|
53
|
-
return /* @__PURE__ */
|
|
51
|
+
children: e.map((d, m) => {
|
|
52
|
+
const _ = n === d;
|
|
53
|
+
return /* @__PURE__ */ N(
|
|
54
54
|
"button",
|
|
55
55
|
{
|
|
56
56
|
role: "tab",
|
|
57
57
|
type: "button",
|
|
58
|
-
id: `settings-tab-${
|
|
58
|
+
id: `settings-tab-${d}`,
|
|
59
59
|
"aria-selected": _,
|
|
60
|
-
"aria-controls": `settings-tabpanel-${
|
|
60
|
+
"aria-controls": `settings-tabpanel-${d}`,
|
|
61
61
|
tabIndex: _ ? 0 : -1,
|
|
62
62
|
className: `settings-tab-strip__tab${_ ? " settings-tab-strip__tab--active" : ""}`,
|
|
63
|
-
onClick: () => t(
|
|
64
|
-
onKeyDown: (
|
|
63
|
+
onClick: () => t(d),
|
|
64
|
+
onKeyDown: (R) => u(R, m),
|
|
65
65
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
_ && !s && /* @__PURE__ */
|
|
68
|
-
|
|
66
|
+
/* @__PURE__ */ i("span", { className: "settings-tab-strip__label", children: p(d) }),
|
|
67
|
+
_ && !s && /* @__PURE__ */ i(
|
|
68
|
+
se.span,
|
|
69
69
|
{
|
|
70
70
|
layoutId: "settings-active-tab-indicator",
|
|
71
71
|
"data-layout-id": "settings-active-tab-indicator",
|
|
@@ -76,7 +76,7 @@ function me({
|
|
|
76
76
|
)
|
|
77
77
|
]
|
|
78
78
|
},
|
|
79
|
-
|
|
79
|
+
d
|
|
80
80
|
);
|
|
81
81
|
})
|
|
82
82
|
}
|
|
@@ -102,101 +102,101 @@ function he(e) {
|
|
|
102
102
|
}
|
|
103
103
|
function ve(e) {
|
|
104
104
|
const [n, t] = H(
|
|
105
|
-
() => e.zones.map((
|
|
106
|
-
`useSortableZones: zone "${
|
|
107
|
-
), { ...
|
|
108
|
-
), [r, o] = H(null), [
|
|
105
|
+
() => e.zones.map((l) => l.maxItems !== void 0 && l.items.length > l.maxItems ? (process.env.NODE_ENV !== "production" && console.warn(
|
|
106
|
+
`useSortableZones: zone "${l.zoneKey}" exceeds maxItems (${l.items.length} > ${l.maxItems}); trimming to cap.`
|
|
107
|
+
), { ...l, items: l.items.slice(0, l.maxItems) }) : l)
|
|
108
|
+
), [r, o] = H(null), [a, c] = H(null), s = w(null), p = w(e.onZoneChange);
|
|
109
109
|
p.current = e.onZoneChange;
|
|
110
110
|
const u = V(
|
|
111
111
|
() => he(e.zones),
|
|
112
112
|
[e.zones]
|
|
113
|
-
),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
e.zones.map((
|
|
117
|
-
`useSortableZones: zone "${
|
|
118
|
-
), { ...
|
|
113
|
+
), d = w(u);
|
|
114
|
+
L(() => {
|
|
115
|
+
d.current !== u && (d.current = u, !r && t(
|
|
116
|
+
e.zones.map((l) => l.maxItems !== void 0 && l.items.length > l.maxItems ? (process.env.NODE_ENV !== "production" && console.warn(
|
|
117
|
+
`useSortableZones: zone "${l.zoneKey}" exceeds maxItems (${l.items.length} > ${l.maxItems}); trimming to cap.`
|
|
118
|
+
), { ...l, items: l.items.slice(0, l.maxItems) }) : l)
|
|
119
119
|
));
|
|
120
120
|
}, [u, e.zones, r]);
|
|
121
121
|
const m = O(
|
|
122
|
-
(
|
|
123
|
-
const g =
|
|
124
|
-
let
|
|
122
|
+
(l) => {
|
|
123
|
+
const g = l.active.id;
|
|
124
|
+
let S = null, y = null;
|
|
125
125
|
for (const b of n) {
|
|
126
126
|
const P = b.items.find((f) => f.id === g);
|
|
127
127
|
if (P) {
|
|
128
|
-
|
|
128
|
+
S = P, y = b.zoneKey;
|
|
129
129
|
break;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
s.current =
|
|
132
|
+
s.current = y, o(S), c(y);
|
|
133
133
|
},
|
|
134
134
|
[n]
|
|
135
135
|
), _ = O(
|
|
136
|
-
(
|
|
137
|
-
if (!
|
|
136
|
+
(l) => {
|
|
137
|
+
if (!l.over) {
|
|
138
138
|
c(s.current);
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
|
-
const g = Q(n,
|
|
141
|
+
const g = Q(n, l.over.id);
|
|
142
142
|
c(g);
|
|
143
143
|
},
|
|
144
144
|
[n]
|
|
145
|
-
),
|
|
146
|
-
(
|
|
147
|
-
const { active: g, over:
|
|
145
|
+
), R = O(
|
|
146
|
+
(l) => {
|
|
147
|
+
const { active: g, over: S } = l, y = () => {
|
|
148
148
|
s.current = null, o(null), c(null);
|
|
149
149
|
};
|
|
150
|
-
if (!
|
|
151
|
-
|
|
150
|
+
if (!S) {
|
|
151
|
+
y();
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
const b = U(n, g.id), P = Q(n,
|
|
154
|
+
const b = U(n, g.id), P = Q(n, S.id);
|
|
155
155
|
if (!b || !P) {
|
|
156
|
-
|
|
156
|
+
y();
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
let f = n.map((
|
|
159
|
+
let f = n.map((E) => ({ ...E, items: [...E.items] }));
|
|
160
160
|
if (b === P) {
|
|
161
|
-
const
|
|
162
|
-
f[
|
|
163
|
-
...
|
|
164
|
-
items: ge(
|
|
161
|
+
const E = f.findIndex((D) => D.zoneKey === b), I = f[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
|
+
f[E] = {
|
|
163
|
+
...I,
|
|
164
|
+
items: ge(I.items, h, A)
|
|
165
165
|
};
|
|
166
166
|
} else {
|
|
167
|
-
const
|
|
167
|
+
const E = f.findIndex((v) => v.zoneKey === b), I = f.findIndex((v) => v.zoneKey === P), h = f[E], C = f[I], A = h.items.find((v) => v.id === g.id);
|
|
168
168
|
if (!A) {
|
|
169
|
-
|
|
169
|
+
y();
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
const D = h.items.filter((v) => v.id !== g.id), z =
|
|
173
|
-
let j = D, x = [...
|
|
174
|
-
if (
|
|
172
|
+
const D = h.items.filter((v) => v.id !== g.id), z = C.items.findIndex((v) => v.id === S.id), re = z >= 0 ? z : C.items.length;
|
|
173
|
+
let j = D, x = [...C.items];
|
|
174
|
+
if (C.maxItems !== void 0 && x.length >= C.maxItems) {
|
|
175
175
|
const v = x[x.length - 1];
|
|
176
|
-
x = x.slice(0,
|
|
176
|
+
x = x.slice(0, C.maxItems - 1), j = [...D, v];
|
|
177
177
|
}
|
|
178
178
|
const q = Math.min(re, x.length), oe = [
|
|
179
179
|
...x.slice(0, q),
|
|
180
180
|
A,
|
|
181
181
|
...x.slice(q)
|
|
182
182
|
];
|
|
183
|
-
f[
|
|
183
|
+
f[E] = { ...h, items: j }, f[I] = { ...C, items: oe };
|
|
184
184
|
}
|
|
185
|
-
t(f), p.current?.(f),
|
|
185
|
+
t(f), p.current?.(f), y();
|
|
186
186
|
},
|
|
187
187
|
[n]
|
|
188
188
|
), B = O(
|
|
189
|
-
(
|
|
190
|
-
id:
|
|
191
|
-
"data-zone-key":
|
|
189
|
+
(l) => ({
|
|
190
|
+
id: l,
|
|
191
|
+
"data-zone-key": l
|
|
192
192
|
}),
|
|
193
193
|
[]
|
|
194
194
|
), Z = O(
|
|
195
|
-
(
|
|
196
|
-
const g = U(n,
|
|
195
|
+
(l) => {
|
|
196
|
+
const g = U(n, l.id) ?? "";
|
|
197
197
|
return {
|
|
198
|
-
id:
|
|
199
|
-
"data-item-id":
|
|
198
|
+
id: l.id,
|
|
199
|
+
"data-item-id": l.id,
|
|
200
200
|
"data-zone-key": g
|
|
201
201
|
};
|
|
202
202
|
},
|
|
@@ -204,17 +204,17 @@ function ve(e) {
|
|
|
204
204
|
);
|
|
205
205
|
return {
|
|
206
206
|
zones: n,
|
|
207
|
-
activeZone:
|
|
207
|
+
activeZone: a,
|
|
208
208
|
activeItem: r,
|
|
209
209
|
getZoneProps: B,
|
|
210
210
|
getItemProps: Z,
|
|
211
211
|
handleDragStart: m,
|
|
212
212
|
handleDragOver: _,
|
|
213
|
-
handleDragEnd:
|
|
213
|
+
handleDragEnd: R
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
|
-
let
|
|
217
|
-
const
|
|
216
|
+
let k = null, F = null, K = !1;
|
|
217
|
+
const ye = [
|
|
218
218
|
"DndContext",
|
|
219
219
|
"DragOverlay",
|
|
220
220
|
"useSensors",
|
|
@@ -223,22 +223,22 @@ const Ee = [
|
|
|
223
223
|
"PointerSensor",
|
|
224
224
|
"KeyboardSensor",
|
|
225
225
|
"closestCenter"
|
|
226
|
-
],
|
|
226
|
+
], Ee = [
|
|
227
227
|
"SortableContext",
|
|
228
228
|
"useSortable",
|
|
229
229
|
"verticalListSortingStrategy"
|
|
230
230
|
];
|
|
231
|
-
function
|
|
231
|
+
function Ie(e, n) {
|
|
232
232
|
const t = [], r = e ?? {};
|
|
233
|
-
for (const
|
|
234
|
-
r[
|
|
233
|
+
for (const a of ye)
|
|
234
|
+
r[a] === void 0 && t.push(`@dnd-kit/core:${a}`);
|
|
235
235
|
const o = n ?? {};
|
|
236
|
-
for (const
|
|
237
|
-
o[
|
|
236
|
+
for (const a of Ee)
|
|
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
|
|
241
|
-
return
|
|
240
|
+
function Ce() {
|
|
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([
|
|
244
244
|
import("@dnd-kit/core"),
|
|
@@ -246,12 +246,12 @@ function Se() {
|
|
|
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 =
|
|
250
|
-
return r.ok ? (
|
|
249
|
+
]), r = Ie(e, n);
|
|
250
|
+
return r.ok ? (k = {
|
|
251
251
|
core: e,
|
|
252
252
|
sortable: n,
|
|
253
253
|
utilities: t
|
|
254
|
-
},
|
|
254
|
+
}, k) : (K = !0, process.env.NODE_ENV !== "production" && console.error(
|
|
255
255
|
`SortableZones: @dnd-kit shape mismatch — missing exports: ${r.missing.join(", ")}. Check installed versions against optionalDependencies in @mt-gloss/ui.`
|
|
256
256
|
), null);
|
|
257
257
|
} catch {
|
|
@@ -259,31 +259,31 @@ function Se() {
|
|
|
259
259
|
}
|
|
260
260
|
})(), F);
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
const { zones: n, onZoneChange: t, renderZone: r, renderItem: o, renderDragOverlay:
|
|
262
|
+
function Se(e) {
|
|
263
|
+
const { zones: n, onZoneChange: t, renderZone: r, renderItem: o, renderDragOverlay: a } = e, c = ve({ zones: n, onZoneChange: t }), [s, p] = M.useState(k);
|
|
264
264
|
return M.useEffect(() => {
|
|
265
265
|
if (s) return;
|
|
266
266
|
let u = !0;
|
|
267
|
-
return
|
|
268
|
-
u && p(
|
|
267
|
+
return Ce().then((d) => {
|
|
268
|
+
u && p(d);
|
|
269
269
|
}), () => {
|
|
270
270
|
u = !1;
|
|
271
271
|
};
|
|
272
|
-
}, [s]), s ? /* @__PURE__ */
|
|
272
|
+
}, [s]), s ? /* @__PURE__ */ i(
|
|
273
273
|
ee,
|
|
274
274
|
{
|
|
275
275
|
state: c,
|
|
276
276
|
modules: s,
|
|
277
277
|
renderZone: r,
|
|
278
278
|
renderItem: o,
|
|
279
|
-
renderDragOverlay:
|
|
279
|
+
renderDragOverlay: a
|
|
280
280
|
}
|
|
281
|
-
) : /* @__PURE__ */
|
|
282
|
-
const
|
|
283
|
-
return /* @__PURE__ */
|
|
281
|
+
) : /* @__PURE__ */ i("div", { "data-sortable-zones-passive": "true", children: c.zones.map((u) => {
|
|
282
|
+
const d = u.items.map((m) => /* @__PURE__ */ i(M.Fragment, { children: o(m) }, m.id));
|
|
283
|
+
return /* @__PURE__ */ i("div", { ...c.getZoneProps(u.zoneKey), children: r(u.zoneKey, u.items, d) }, u.zoneKey);
|
|
284
284
|
}) });
|
|
285
285
|
}
|
|
286
|
-
|
|
286
|
+
Se.displayName = "SortableZones";
|
|
287
287
|
function ee({
|
|
288
288
|
state: e,
|
|
289
289
|
modules: n,
|
|
@@ -291,21 +291,21 @@ function ee({
|
|
|
291
291
|
renderItem: r,
|
|
292
292
|
renderDragOverlay: o
|
|
293
293
|
}) {
|
|
294
|
-
const { core:
|
|
295
|
-
m(
|
|
294
|
+
const { core: a, sortable: c, utilities: s } = n, { DndContext: p, DragOverlay: u, useSensors: d, useSensor: m, useDroppable: _, PointerSensor: R, KeyboardSensor: B, closestCenter: Z } = a, { SortableContext: l, verticalListSortingStrategy: g } = c, S = d(
|
|
295
|
+
m(R, { activationConstraint: { distance: 5 } }),
|
|
296
296
|
m(B)
|
|
297
|
-
),
|
|
298
|
-
return /* @__PURE__ */
|
|
299
|
-
|
|
297
|
+
), y = p, b = u, P = l;
|
|
298
|
+
return /* @__PURE__ */ N(
|
|
299
|
+
y,
|
|
300
300
|
{
|
|
301
|
-
sensors:
|
|
301
|
+
sensors: S,
|
|
302
302
|
collisionDetection: Z,
|
|
303
303
|
onDragStart: e.handleDragStart,
|
|
304
304
|
onDragOver: e.handleDragOver,
|
|
305
305
|
onDragEnd: e.handleDragEnd,
|
|
306
306
|
children: [
|
|
307
307
|
e.zones.map((f) => {
|
|
308
|
-
const
|
|
308
|
+
const E = f.items.map((h) => h.id), I = f.items.map((h) => /* @__PURE__ */ i(
|
|
309
309
|
ne,
|
|
310
310
|
{
|
|
311
311
|
id: h.id,
|
|
@@ -315,30 +315,30 @@ function ee({
|
|
|
315
315
|
},
|
|
316
316
|
h.id
|
|
317
317
|
));
|
|
318
|
-
return /* @__PURE__ */
|
|
318
|
+
return /* @__PURE__ */ i(
|
|
319
319
|
te,
|
|
320
320
|
{
|
|
321
321
|
zoneKey: f.zoneKey,
|
|
322
322
|
zoneProps: e.getZoneProps(f.zoneKey),
|
|
323
323
|
useDroppable: _,
|
|
324
|
-
children: /* @__PURE__ */
|
|
324
|
+
children: /* @__PURE__ */ i(P, { items: E, strategy: g, children: t(f.zoneKey, f.items, I) })
|
|
325
325
|
},
|
|
326
326
|
f.zoneKey
|
|
327
327
|
);
|
|
328
328
|
}),
|
|
329
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ i(b, { children: e.activeItem ? o?.(e.activeItem) ?? r(e.activeItem) : null })
|
|
330
330
|
]
|
|
331
331
|
}
|
|
332
332
|
);
|
|
333
333
|
}
|
|
334
334
|
ee.displayName = "SortableZonesInner";
|
|
335
335
|
function ne({ id: e, useSortable: n, cssHelper: t, children: r }) {
|
|
336
|
-
const { attributes: o, listeners:
|
|
336
|
+
const { attributes: o, listeners: a, setNodeRef: c, transform: s, transition: p, isDragging: u } = n({ id: e }), d = {
|
|
337
337
|
transform: t?.Transform?.toString(s) ?? void 0,
|
|
338
338
|
transition: p,
|
|
339
339
|
opacity: u ? 0.5 : 1
|
|
340
340
|
};
|
|
341
|
-
return /* @__PURE__ */
|
|
341
|
+
return /* @__PURE__ */ i("div", { ref: c, style: d, "data-sortable-item-id": e, ...o, ...a, children: r });
|
|
342
342
|
}
|
|
343
343
|
ne.displayName = "SortableItem";
|
|
344
344
|
function te({
|
|
@@ -347,8 +347,8 @@ function te({
|
|
|
347
347
|
useDroppable: t,
|
|
348
348
|
children: r
|
|
349
349
|
}) {
|
|
350
|
-
const { setNodeRef: o, isOver:
|
|
351
|
-
return /* @__PURE__ */
|
|
350
|
+
const { setNodeRef: o, isOver: a } = t({ id: e });
|
|
351
|
+
return /* @__PURE__ */ i("div", { ref: o, "data-zone-is-over": a || void 0, ...n, children: r });
|
|
352
352
|
}
|
|
353
353
|
te.displayName = "ZoneDroppable";
|
|
354
354
|
const $ = le(null);
|
|
@@ -360,25 +360,25 @@ function be() {
|
|
|
360
360
|
);
|
|
361
361
|
return e;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function _e() {
|
|
364
364
|
return W($);
|
|
365
365
|
}
|
|
366
|
-
const
|
|
367
|
-
function
|
|
366
|
+
const Pe = T.number().min(0).max(100), De = T.number().min(7).max(90), xe = T.enum(["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"]), Ne = T.array(T.string().min(1)).max(3), Oe = T.boolean();
|
|
367
|
+
function we(e, n) {
|
|
368
368
|
if (e === "threshold") {
|
|
369
|
-
const t =
|
|
369
|
+
const t = Pe.safeParse(n);
|
|
370
370
|
return t.success ? t.data : 80;
|
|
371
371
|
}
|
|
372
372
|
if (e === "timeframe") {
|
|
373
|
-
const t =
|
|
373
|
+
const t = De.safeParse(n);
|
|
374
374
|
return t.success ? t.data : 30;
|
|
375
375
|
}
|
|
376
376
|
if (e === "accent") {
|
|
377
|
-
const t =
|
|
377
|
+
const t = xe.safeParse(n);
|
|
378
378
|
return t.success ? t.data : null;
|
|
379
379
|
}
|
|
380
380
|
if (e === "slots") {
|
|
381
|
-
const t =
|
|
381
|
+
const t = Ne.safeParse(n);
|
|
382
382
|
return t.success ? t.data : [];
|
|
383
383
|
}
|
|
384
384
|
if (e === "thresholdEnabled" || e === "accentEnabled") {
|
|
@@ -387,7 +387,7 @@ function Ne(e, n) {
|
|
|
387
387
|
}
|
|
388
388
|
return n;
|
|
389
389
|
}
|
|
390
|
-
const
|
|
390
|
+
const Le = {
|
|
391
391
|
activePanelId: null,
|
|
392
392
|
activeTrigger: null,
|
|
393
393
|
bellCutoutOpen: !1,
|
|
@@ -398,7 +398,7 @@ const Te = {
|
|
|
398
398
|
lastClose: null,
|
|
399
399
|
pendingSideEffects: []
|
|
400
400
|
}, Y = /* @__PURE__ */ new Set(["settings"]);
|
|
401
|
-
function
|
|
401
|
+
function Te(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 we(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 Re(e, n) {
|
|
417
417
|
switch (n.type) {
|
|
418
418
|
case "OPEN_PANEL": {
|
|
419
419
|
if (e.activePanelId && e.isDirty)
|
|
@@ -431,7 +431,7 @@ function Le(e, n) {
|
|
|
431
431
|
}
|
|
432
432
|
]
|
|
433
433
|
};
|
|
434
|
-
if (e.activePanelId === n.panelId &&
|
|
434
|
+
if (e.activePanelId === n.panelId && Te(e.activeTrigger, n.trigger))
|
|
435
435
|
return e;
|
|
436
436
|
const t = e.activePanelId != null ? [
|
|
437
437
|
{
|
|
@@ -456,7 +456,7 @@ function Le(e, n) {
|
|
|
456
456
|
case "CLOSE_PANEL": {
|
|
457
457
|
if (e.activePanelId == null)
|
|
458
458
|
return e;
|
|
459
|
-
const t = e.activePanelId, r = e.activeTrigger?.cardId ?? null, o = r != null ? e.bufferByCard[r] : void 0,
|
|
459
|
+
const t = e.activePanelId, r = e.activeTrigger?.cardId ?? null, o = r != null ? e.bufferByCard[r] : void 0, a = e.isDirty ? n.reason === "apply-button" ? r != null && o != null ? [
|
|
460
460
|
{
|
|
461
461
|
type: "COMMIT_BUFFER",
|
|
462
462
|
payload: { cardId: r, delta: o }
|
|
@@ -476,7 +476,7 @@ function Le(e, n) {
|
|
|
476
476
|
// closing clears any active lockHint (dirty-buffer condition gone)
|
|
477
477
|
bufferByCard: c,
|
|
478
478
|
lastClose: { panelId: t, reason: n.reason },
|
|
479
|
-
pendingSideEffects: [...e.pendingSideEffects, ...
|
|
479
|
+
pendingSideEffects: [...e.pendingSideEffects, ...a]
|
|
480
480
|
};
|
|
481
481
|
}
|
|
482
482
|
case "OPEN_BELL_CUTOUT":
|
|
@@ -501,7 +501,7 @@ function Le(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 = we(n.key, n.value);
|
|
505
505
|
if (!r && t.changes[n.key] === o)
|
|
506
506
|
return e;
|
|
507
507
|
const c = { kind: "settings", changes: {
|
|
@@ -525,7 +525,7 @@ function Le(e, n) {
|
|
|
525
525
|
return e;
|
|
526
526
|
const r = Object.keys(e.bufferByCard).length === 1, o = { ...e.bufferByCard };
|
|
527
527
|
delete o[n.cardId];
|
|
528
|
-
const
|
|
528
|
+
const a = r && e.isDirty ? [
|
|
529
529
|
{
|
|
530
530
|
type: "SCHEDULE_TIMER",
|
|
531
531
|
ms: 0,
|
|
@@ -535,7 +535,7 @@ function Le(e, n) {
|
|
|
535
535
|
return {
|
|
536
536
|
...e,
|
|
537
537
|
bufferByCard: o,
|
|
538
|
-
pendingSideEffects: [...e.pendingSideEffects, ...
|
|
538
|
+
pendingSideEffects: [...e.pendingSideEffects, ...a]
|
|
539
539
|
};
|
|
540
540
|
}
|
|
541
541
|
case "BUFFER_BECOMES_DIRTY":
|
|
@@ -575,14 +575,14 @@ function Le(e, n) {
|
|
|
575
575
|
return e;
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function ke(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(
|
|
583
|
-
|
|
581
|
+
function Ae() {
|
|
582
|
+
const [e, n] = ae(Re, Le), t = w([]), r = w(null);
|
|
583
|
+
L(() => () => {
|
|
584
584
|
r.current != null && (window.clearTimeout(r.current), r.current = null);
|
|
585
|
-
}, []),
|
|
585
|
+
}, []), L(() => {
|
|
586
586
|
const c = e.pendingSideEffects.length;
|
|
587
587
|
if (c !== 0) {
|
|
588
588
|
for (const s of e.pendingSideEffects)
|
|
@@ -599,7 +599,7 @@ function ke() {
|
|
|
599
599
|
] : s.type === "INVALID_DISPATCH" && process.env.NODE_ENV !== "production" && console.warn("[panels] INVALID_DISPATCH:", s.reason);
|
|
600
600
|
n({ type: "DRAIN_SIDE_EFFECTS", count: c });
|
|
601
601
|
}
|
|
602
|
-
}, [e.pendingSideEffects, n]),
|
|
602
|
+
}, [e.pendingSideEffects, n]), L(() => {
|
|
603
603
|
if (!e.lastClose) return;
|
|
604
604
|
const c = {
|
|
605
605
|
panelId: e.lastClose.panelId,
|
|
@@ -613,26 +613,125 @@ function ke() {
|
|
|
613
613
|
];
|
|
614
614
|
}, [e.lastClose]);
|
|
615
615
|
const o = V(
|
|
616
|
-
() =>
|
|
616
|
+
() => ke(e),
|
|
617
617
|
[e.activePanelId, e.bellCutoutOpen, e.isDirty]
|
|
618
|
-
),
|
|
619
|
-
return { state: e, surfaceState: o, dispatch: n, getCloseLog:
|
|
618
|
+
), a = O(() => t.current.slice(), []);
|
|
619
|
+
return { state: e, surfaceState: o, dispatch: n, getCloseLog: a };
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
const n =
|
|
621
|
+
function Ge({ children: e }) {
|
|
622
|
+
const n = Ae(), 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.
|
|
626
626
|
[n.state, n.surfaceState, n.dispatch, n.getCloseLog]
|
|
627
627
|
);
|
|
628
|
-
return /* @__PURE__ */
|
|
628
|
+
return /* @__PURE__ */ i($.Provider, { value: t, children: e });
|
|
629
|
+
}
|
|
630
|
+
function Fe({ title: e, onClose: n }) {
|
|
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 }),
|
|
633
|
+
/* @__PURE__ */ i(
|
|
634
|
+
"button",
|
|
635
|
+
{
|
|
636
|
+
id: "panel-close",
|
|
637
|
+
type: "button",
|
|
638
|
+
"aria-label": "Close panel",
|
|
639
|
+
className: "gloss-panel-chrome-v2__close",
|
|
640
|
+
onClick: n,
|
|
641
|
+
children: "×"
|
|
642
|
+
}
|
|
643
|
+
)
|
|
644
|
+
] });
|
|
645
|
+
}
|
|
646
|
+
function He({ children: e }) {
|
|
647
|
+
return /* @__PURE__ */ i(
|
|
648
|
+
"div",
|
|
649
|
+
{
|
|
650
|
+
"data-panel-stage": !0,
|
|
651
|
+
"aria-hidden": "true",
|
|
652
|
+
className: "gloss-panel-chrome-v2__stage",
|
|
653
|
+
children: e
|
|
654
|
+
}
|
|
655
|
+
);
|
|
656
|
+
}
|
|
657
|
+
function Be({ children: e }) {
|
|
658
|
+
return /* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__navigation", children: e });
|
|
659
|
+
}
|
|
660
|
+
function Ze({ children: e }) {
|
|
661
|
+
return /* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__body", children: e });
|
|
662
|
+
}
|
|
663
|
+
function Me({ left: e, right: n }) {
|
|
664
|
+
return /* @__PURE__ */ N("div", { className: "gloss-panel-chrome-v2__footer", children: [
|
|
665
|
+
/* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__footer-left", children: e }),
|
|
666
|
+
/* @__PURE__ */ i("div", { className: "gloss-panel-chrome-v2__footer-right", children: n })
|
|
667
|
+
] });
|
|
668
|
+
}
|
|
669
|
+
function Ke({
|
|
670
|
+
children: e,
|
|
671
|
+
onClose: n,
|
|
672
|
+
title: t,
|
|
673
|
+
variant: r = "no-stage",
|
|
674
|
+
stage: o,
|
|
675
|
+
navigation: a,
|
|
676
|
+
footer: c
|
|
677
|
+
}) {
|
|
678
|
+
const s = t == null && r === "with-stage";
|
|
679
|
+
return /* @__PURE__ */ N(
|
|
680
|
+
"div",
|
|
681
|
+
{
|
|
682
|
+
"data-chrome": "panel-v2",
|
|
683
|
+
"data-chrome-variant": r,
|
|
684
|
+
"data-headerless": s || void 0,
|
|
685
|
+
role: "dialog",
|
|
686
|
+
"aria-modal": "true",
|
|
687
|
+
className: `gloss-panel-chrome-v2 gloss-panel-chrome-v2--${r}${s ? " gloss-panel-chrome-v2--headerless" : ""}`,
|
|
688
|
+
children: [
|
|
689
|
+
!s && /* @__PURE__ */ i(Fe, { title: t, onClose: n }),
|
|
690
|
+
r === "with-stage" && /* @__PURE__ */ i(He, { children: o }),
|
|
691
|
+
a != null && /* @__PURE__ */ i(Be, { children: a }),
|
|
692
|
+
/* @__PURE__ */ i(Ze, { children: e }),
|
|
693
|
+
c != null && /* @__PURE__ */ i(Me, { left: c.left, right: c.right }),
|
|
694
|
+
s && /* @__PURE__ */ i(
|
|
695
|
+
"button",
|
|
696
|
+
{
|
|
697
|
+
id: "panel-close",
|
|
698
|
+
type: "button",
|
|
699
|
+
"aria-label": "Close panel",
|
|
700
|
+
className: "gloss-panel-chrome-v2__close gloss-panel-chrome-v2__close--floating",
|
|
701
|
+
onClick: n,
|
|
702
|
+
children: "×"
|
|
703
|
+
}
|
|
704
|
+
)
|
|
705
|
+
]
|
|
706
|
+
}
|
|
707
|
+
);
|
|
708
|
+
}
|
|
709
|
+
function Je({ isOpen: e }) {
|
|
710
|
+
const n = _e();
|
|
711
|
+
return /* @__PURE__ */ i(
|
|
712
|
+
Ke,
|
|
713
|
+
{
|
|
714
|
+
variant: "no-stage",
|
|
715
|
+
title: "Notifications",
|
|
716
|
+
onClose: () => n?.dispatch({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
717
|
+
children: /* @__PURE__ */ i(
|
|
718
|
+
"div",
|
|
719
|
+
{
|
|
720
|
+
"data-shell": "notification-center",
|
|
721
|
+
"data-panel": "notification-center",
|
|
722
|
+
"aria-hidden": !e,
|
|
723
|
+
children: /* @__PURE__ */ i("p", { children: "No notifications" })
|
|
724
|
+
}
|
|
725
|
+
)
|
|
726
|
+
}
|
|
727
|
+
);
|
|
629
728
|
}
|
|
630
|
-
const
|
|
729
|
+
const Ue = {
|
|
631
730
|
position: "relative",
|
|
632
731
|
pointerEvents: "auto"
|
|
633
732
|
};
|
|
634
|
-
function
|
|
635
|
-
return /* @__PURE__ */
|
|
733
|
+
function Ve({ children: e, onClose: n, footer: t, title: r, variant: o = "default" }) {
|
|
734
|
+
return /* @__PURE__ */ N(
|
|
636
735
|
"div",
|
|
637
736
|
{
|
|
638
737
|
"data-chrome": "panel",
|
|
@@ -640,11 +739,11 @@ function Fe({ children: e, onClose: n, footer: t, title: r, variant: o = "defaul
|
|
|
640
739
|
role: "dialog",
|
|
641
740
|
"aria-modal": "true",
|
|
642
741
|
className: o === "merged-stage" ? "gloss-panel-chrome gloss-panel-chrome--merged-stage" : "gloss-panel-chrome",
|
|
643
|
-
style:
|
|
742
|
+
style: Ue,
|
|
644
743
|
children: [
|
|
645
|
-
/* @__PURE__ */
|
|
646
|
-
r != null && /* @__PURE__ */
|
|
647
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ N("div", { className: "gloss-panel-chrome__header", children: [
|
|
745
|
+
r != null && /* @__PURE__ */ i("span", { className: "gloss-panel-chrome__title", children: r }),
|
|
746
|
+
/* @__PURE__ */ i(
|
|
648
747
|
"button",
|
|
649
748
|
{
|
|
650
749
|
id: "panel-close",
|
|
@@ -656,13 +755,13 @@ function Fe({ children: e, onClose: n, footer: t, title: r, variant: o = "defaul
|
|
|
656
755
|
}
|
|
657
756
|
)
|
|
658
757
|
] }),
|
|
659
|
-
/* @__PURE__ */
|
|
660
|
-
t != null && /* @__PURE__ */
|
|
758
|
+
/* @__PURE__ */ i("div", { className: "gloss-panel-chrome__body", children: e }),
|
|
759
|
+
t != null && /* @__PURE__ */ i("div", { className: "gloss-panel-chrome__footer", children: t })
|
|
661
760
|
]
|
|
662
761
|
}
|
|
663
762
|
);
|
|
664
763
|
}
|
|
665
|
-
function
|
|
764
|
+
function $e(e) {
|
|
666
765
|
if (process.env.NODE_ENV === "production" || !e || !e.parentElement) return;
|
|
667
766
|
const n = e.parentElement, t = window.getComputedStyle(n);
|
|
668
767
|
t.perspective === "none" && console.warn(
|
|
@@ -673,18 +772,18 @@ function He(e) {
|
|
|
673
772
|
n
|
|
674
773
|
);
|
|
675
774
|
}
|
|
676
|
-
function
|
|
677
|
-
const t = J(), r =
|
|
775
|
+
function ze({ isOpen: e, children: n }) {
|
|
776
|
+
const t = J(), r = w(null);
|
|
678
777
|
X(() => {
|
|
679
|
-
|
|
778
|
+
$e(r.current);
|
|
680
779
|
}, []);
|
|
681
|
-
const [o,
|
|
682
|
-
|
|
780
|
+
const [o, a] = H(!1);
|
|
781
|
+
L(() => {
|
|
683
782
|
if (!e) {
|
|
684
|
-
|
|
783
|
+
a(!1);
|
|
685
784
|
return;
|
|
686
785
|
}
|
|
687
|
-
const s = requestAnimationFrame(() =>
|
|
786
|
+
const s = requestAnimationFrame(() => a(!0));
|
|
688
787
|
return () => cancelAnimationFrame(s);
|
|
689
788
|
}, [e]);
|
|
690
789
|
const c = [
|
|
@@ -692,7 +791,7 @@ function Be({ isOpen: e, children: n }) {
|
|
|
692
791
|
o ? "has-panel" : "",
|
|
693
792
|
t ? "reduced-motion" : ""
|
|
694
793
|
].filter(Boolean).join(" ");
|
|
695
|
-
return /* @__PURE__ */
|
|
794
|
+
return /* @__PURE__ */ i(
|
|
696
795
|
"div",
|
|
697
796
|
{
|
|
698
797
|
ref: r,
|
|
@@ -703,7 +802,7 @@ function Be({ isOpen: e, children: n }) {
|
|
|
703
802
|
}
|
|
704
803
|
);
|
|
705
804
|
}
|
|
706
|
-
const
|
|
805
|
+
const je = {
|
|
707
806
|
position: "fixed",
|
|
708
807
|
top: 0,
|
|
709
808
|
left: 0,
|
|
@@ -714,7 +813,7 @@ const Ze = {
|
|
|
714
813
|
overflow: "visible",
|
|
715
814
|
pointerEvents: "none",
|
|
716
815
|
zIndex: 55
|
|
717
|
-
},
|
|
816
|
+
}, qe = {
|
|
718
817
|
position: "fixed",
|
|
719
818
|
top: "var(--tb-h, 60px)",
|
|
720
819
|
left: 0,
|
|
@@ -730,12 +829,12 @@ const Ze = {
|
|
|
730
829
|
pointerEvents: "none",
|
|
731
830
|
background: "rgba(0, 0, 0, 0.04)"
|
|
732
831
|
};
|
|
733
|
-
function
|
|
832
|
+
function en({ panelComponents: e }) {
|
|
734
833
|
const { state: n, dispatch: t, getCloseLog: r } = be(), o = n.activePanelId ? e[n.activePanelId] : null;
|
|
735
834
|
n.activePanelId && !o && process.env.NODE_ENV !== "production" && console.error(
|
|
736
835
|
"[panels] No panel component registered for activePanelId:",
|
|
737
836
|
n.activePanelId
|
|
738
|
-
),
|
|
837
|
+
), L(() => {
|
|
739
838
|
if (n.activePanelId == null) return;
|
|
740
839
|
function p(u) {
|
|
741
840
|
u.key === "Escape" && t({ type: "CLOSE_PANEL", reason: "escape-key" });
|
|
@@ -744,15 +843,15 @@ function qe({ panelComponents: e }) {
|
|
|
744
843
|
document.removeEventListener("keydown", p);
|
|
745
844
|
};
|
|
746
845
|
}, [n.activePanelId, t]);
|
|
747
|
-
const
|
|
846
|
+
const a = w(n);
|
|
748
847
|
X(() => {
|
|
749
|
-
|
|
750
|
-
}),
|
|
848
|
+
a.current = n;
|
|
849
|
+
}), L(() => {
|
|
751
850
|
if (process.env.NODE_ENV === "production") return;
|
|
752
851
|
const p = window;
|
|
753
852
|
return p.__panelsHostHandle && console.warn("[panels] multiple PanelHost/PanelHostShell instances mounted; dev handle is unreliable"), p.__panelsHostHandle = {
|
|
754
853
|
dispatch: t,
|
|
755
|
-
getState: () =>
|
|
854
|
+
getState: () => a.current,
|
|
756
855
|
getCloseLog: r
|
|
757
856
|
}, () => {
|
|
758
857
|
p.__panelsHostHandle?.dispatch === t && delete p.__panelsHostHandle;
|
|
@@ -761,26 +860,26 @@ function qe({ panelComponents: e }) {
|
|
|
761
860
|
const c = O(() => {
|
|
762
861
|
t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
|
|
763
862
|
}, [t]), s = n.activePanelId != null && o != null;
|
|
764
|
-
return /* @__PURE__ */
|
|
765
|
-
s && /* @__PURE__ */
|
|
863
|
+
return /* @__PURE__ */ N("div", { "data-panel-host": "true", style: je, children: [
|
|
864
|
+
s && /* @__PURE__ */ i(
|
|
766
865
|
"div",
|
|
767
866
|
{
|
|
768
867
|
"data-panel-scrim": "true",
|
|
769
|
-
style:
|
|
868
|
+
style: qe,
|
|
770
869
|
onClick: c
|
|
771
870
|
}
|
|
772
871
|
),
|
|
773
|
-
/* @__PURE__ */
|
|
774
|
-
|
|
872
|
+
/* @__PURE__ */ i(ze, { isOpen: s, children: s && /* @__PURE__ */ i(
|
|
873
|
+
Ve,
|
|
775
874
|
{
|
|
776
875
|
isOpen: !0,
|
|
777
876
|
onClose: () => t({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
778
|
-
children: /* @__PURE__ */
|
|
877
|
+
children: /* @__PURE__ */ i(o, { isOpen: !0 })
|
|
779
878
|
}
|
|
780
879
|
) })
|
|
781
880
|
] });
|
|
782
881
|
}
|
|
783
|
-
const
|
|
882
|
+
const nn = {
|
|
784
883
|
"apply-button": !0,
|
|
785
884
|
// the ONLY commit reason
|
|
786
885
|
"cancel-button": !1,
|
|
@@ -796,19 +895,26 @@ const Qe = {
|
|
|
796
895
|
// Phase 11.6 D-19 — R9 drag-start auto-close discards buffer
|
|
797
896
|
};
|
|
798
897
|
export {
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
898
|
+
nn as C,
|
|
899
|
+
Je as N,
|
|
900
|
+
Ge as P,
|
|
901
|
+
Se as S,
|
|
802
902
|
ve as a,
|
|
803
903
|
be as b,
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
904
|
+
en as c,
|
|
905
|
+
Ve as d,
|
|
906
|
+
Ae as e,
|
|
907
|
+
ke as f,
|
|
808
908
|
me as g,
|
|
809
909
|
J as h,
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
910
|
+
Le as i,
|
|
911
|
+
Ke as j,
|
|
912
|
+
ze as k,
|
|
913
|
+
Fe as l,
|
|
914
|
+
He as m,
|
|
915
|
+
Be as n,
|
|
916
|
+
Ze as o,
|
|
917
|
+
Me as p,
|
|
918
|
+
Re as r,
|
|
919
|
+
_e as u
|
|
814
920
|
};
|