@mt-gloss/ui 0.1.134 → 0.1.136
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-WBmqrmdI.js → COMMITS-B_qGBoy7.js} +171 -183
- package/composites-panels.js +622 -663
- package/index.js +2 -2
- package/lib/composites/panels/coordinator/settingsBufferSchemas.d.ts +4 -9
- package/lib/composites/panels/index.d.ts +2 -0
- package/lib/composites/panels/shells/MetricInfoShell.d.ts +29 -0
- package/lib/composites/panels/shells/SettingsShell.d.ts +16 -14
- package/lib/composites/panels/shells/index.d.ts +2 -0
- package/lib/composites/panels/shells/settings/GhostSlotPill.d.ts +7 -0
- package/lib/composites/panels/shells/settings/SlotsControls.d.ts +6 -1
- package/lib/composites/panels/shells/settings/index.d.ts +6 -4
- package/package.json +1 -1
- package/ui.css +1 -1
- package/lib/composites/panels/shells/settings/ColorControls.d.ts +0 -13
- package/lib/composites/panels/shells/settings/ThresholdControls.d.ts +0 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { motion as
|
|
3
|
-
import
|
|
4
|
-
import { z as
|
|
1
|
+
import { jsx as s, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { motion as se } from "framer-motion";
|
|
3
|
+
import Z, { useSyncExternalStore as le, useState as A, useRef as O, useMemo as $, 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 K } from "zod";
|
|
5
5
|
const de = "(prefers-reduced-motion: reduce)";
|
|
6
6
|
function J() {
|
|
7
7
|
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(de);
|
|
@@ -34,38 +34,38 @@ function ge({
|
|
|
34
34
|
activeTab: n,
|
|
35
35
|
onSelect: t,
|
|
36
36
|
reduced: r,
|
|
37
|
-
labels:
|
|
37
|
+
labels: i,
|
|
38
38
|
ariaLabel: a = "Settings dimensions"
|
|
39
39
|
}) {
|
|
40
40
|
const c = ee(), o = r ?? c;
|
|
41
41
|
if (e.length < 2) return null;
|
|
42
|
-
const p = (d) =>
|
|
42
|
+
const p = (d) => i?.[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
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ s(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
48
|
role: "tablist",
|
|
49
49
|
"aria-label": a,
|
|
50
50
|
className: "settings-tab-strip",
|
|
51
51
|
children: e.map((d, m) => {
|
|
52
|
-
const
|
|
52
|
+
const b = n === d;
|
|
53
53
|
return /* @__PURE__ */ N(
|
|
54
54
|
"button",
|
|
55
55
|
{
|
|
56
56
|
role: "tab",
|
|
57
57
|
type: "button",
|
|
58
58
|
id: `settings-tab-${d}`,
|
|
59
|
-
"aria-selected":
|
|
59
|
+
"aria-selected": b,
|
|
60
60
|
"aria-controls": `settings-tabpanel-${d}`,
|
|
61
|
-
tabIndex:
|
|
62
|
-
className: `settings-tab-strip__tab${
|
|
61
|
+
tabIndex: b ? 0 : -1,
|
|
62
|
+
className: `settings-tab-strip__tab${b ? " settings-tab-strip__tab--active" : ""}`,
|
|
63
63
|
onClick: () => t(d),
|
|
64
|
-
onKeyDown: (
|
|
64
|
+
onKeyDown: (L) => u(L, m),
|
|
65
65
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
/* @__PURE__ */ s("span", { className: "settings-tab-strip__label", children: p(d) }),
|
|
67
|
+
b && !o && /* @__PURE__ */ s(
|
|
68
|
+
se.span,
|
|
69
69
|
{
|
|
70
70
|
layoutId: "settings-active-tab-indicator",
|
|
71
71
|
"data-layout-id": "settings-active-tab-indicator",
|
|
@@ -94,18 +94,18 @@ function Q(e, n) {
|
|
|
94
94
|
return t ? t.zoneKey : U(e, n);
|
|
95
95
|
}
|
|
96
96
|
function he(e, n, t) {
|
|
97
|
-
const r = [...e], [
|
|
98
|
-
return r.splice(t, 0,
|
|
97
|
+
const r = [...e], [i] = r.splice(n, 1);
|
|
98
|
+
return r.splice(t, 0, i), r;
|
|
99
99
|
}
|
|
100
100
|
function ve(e) {
|
|
101
101
|
return e.map((n) => `${n.zoneKey}:${n.items.map((t) => t.id).join(",")}`).join("|");
|
|
102
102
|
}
|
|
103
103
|
function ye(e) {
|
|
104
|
-
const [n, t] =
|
|
104
|
+
const [n, t] = A(
|
|
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,
|
|
108
|
+
), [r, i] = A(null), [a, c] = A(null), o = O(null), p = O(e.onZoneChange);
|
|
109
109
|
p.current = e.onZoneChange;
|
|
110
110
|
const u = $(
|
|
111
111
|
() => ve(e.zones),
|
|
@@ -122,17 +122,17 @@ function ye(e) {
|
|
|
122
122
|
(l) => {
|
|
123
123
|
const g = l.active.id;
|
|
124
124
|
let S = null, y = null;
|
|
125
|
-
for (const
|
|
126
|
-
const P =
|
|
125
|
+
for (const _ of n) {
|
|
126
|
+
const P = _.items.find((f) => f.id === g);
|
|
127
127
|
if (P) {
|
|
128
|
-
S = P, y =
|
|
128
|
+
S = P, y = _.zoneKey;
|
|
129
129
|
break;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
o.current = y,
|
|
132
|
+
o.current = y, i(S), c(y);
|
|
133
133
|
},
|
|
134
134
|
[n]
|
|
135
|
-
),
|
|
135
|
+
), b = T(
|
|
136
136
|
(l) => {
|
|
137
137
|
if (!l.over) {
|
|
138
138
|
c(o.current);
|
|
@@ -142,30 +142,30 @@ function ye(e) {
|
|
|
142
142
|
c(g);
|
|
143
143
|
},
|
|
144
144
|
[n]
|
|
145
|
-
),
|
|
145
|
+
), L = T(
|
|
146
146
|
(l) => {
|
|
147
147
|
const { active: g, over: S } = l, y = () => {
|
|
148
|
-
o.current = null,
|
|
148
|
+
o.current = null, i(null), c(null);
|
|
149
149
|
};
|
|
150
150
|
if (!S) {
|
|
151
151
|
y();
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
const
|
|
155
|
-
if (!
|
|
154
|
+
const _ = U(n, g.id), P = Q(n, S.id);
|
|
155
|
+
if (!_ || !P) {
|
|
156
156
|
y();
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
159
|
let f = n.map((I) => ({ ...I, items: [...I.items] }));
|
|
160
|
-
if (
|
|
161
|
-
const I = f.findIndex((D) => D.zoneKey ===
|
|
160
|
+
if (_ === P) {
|
|
161
|
+
const I = f.findIndex((D) => D.zoneKey === _), E = f[I], h = E.items.findIndex((D) => D.id === g.id), C = E.items.findIndex((D) => D.id === S.id), k = C >= 0 ? C : Math.max(0, E.items.length - 1);
|
|
162
162
|
f[I] = {
|
|
163
163
|
...E,
|
|
164
|
-
items: he(E.items, h,
|
|
164
|
+
items: he(E.items, h, k)
|
|
165
165
|
};
|
|
166
166
|
} else {
|
|
167
|
-
const I = f.findIndex((v) => v.zoneKey ===
|
|
168
|
-
if (!
|
|
167
|
+
const I = f.findIndex((v) => v.zoneKey === _), E = f.findIndex((v) => v.zoneKey === P), h = f[I], C = f[E], k = h.items.find((v) => v.id === g.id);
|
|
168
|
+
if (!k) {
|
|
169
169
|
y();
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
@@ -175,23 +175,23 @@ function ye(e) {
|
|
|
175
175
|
const v = x[x.length - 1];
|
|
176
176
|
x = x.slice(0, C.maxItems - 1), j = [...D, v];
|
|
177
177
|
}
|
|
178
|
-
const q = Math.min(oe, x.length),
|
|
178
|
+
const q = Math.min(oe, x.length), ie = [
|
|
179
179
|
...x.slice(0, q),
|
|
180
|
-
|
|
180
|
+
k,
|
|
181
181
|
...x.slice(q)
|
|
182
182
|
];
|
|
183
|
-
f[I] = { ...h, items: j }, f[E] = { ...C, items:
|
|
183
|
+
f[I] = { ...h, items: j }, f[E] = { ...C, items: ie };
|
|
184
184
|
}
|
|
185
185
|
t(f), p.current?.(f), y();
|
|
186
186
|
},
|
|
187
187
|
[n]
|
|
188
|
-
),
|
|
188
|
+
), H = T(
|
|
189
189
|
(l) => ({
|
|
190
190
|
id: l,
|
|
191
191
|
"data-zone-key": l
|
|
192
192
|
}),
|
|
193
193
|
[]
|
|
194
|
-
),
|
|
194
|
+
), B = T(
|
|
195
195
|
(l) => {
|
|
196
196
|
const g = U(n, l.id) ?? "";
|
|
197
197
|
return {
|
|
@@ -206,14 +206,14 @@ function ye(e) {
|
|
|
206
206
|
zones: n,
|
|
207
207
|
activeZone: a,
|
|
208
208
|
activeItem: r,
|
|
209
|
-
getZoneProps:
|
|
210
|
-
getItemProps:
|
|
209
|
+
getZoneProps: H,
|
|
210
|
+
getItemProps: B,
|
|
211
211
|
handleDragStart: m,
|
|
212
|
-
handleDragOver:
|
|
213
|
-
handleDragEnd:
|
|
212
|
+
handleDragOver: b,
|
|
213
|
+
handleDragEnd: L
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
|
-
let
|
|
216
|
+
let R = null, F = null, M = !1;
|
|
217
217
|
const Ie = [
|
|
218
218
|
"DndContext",
|
|
219
219
|
"DragOverlay",
|
|
@@ -232,13 +232,13 @@ function Ce(e, n) {
|
|
|
232
232
|
const t = [], r = e ?? {};
|
|
233
233
|
for (const a of Ie)
|
|
234
234
|
r[a] === void 0 && t.push(`@dnd-kit/core:${a}`);
|
|
235
|
-
const
|
|
235
|
+
const i = n ?? {};
|
|
236
236
|
for (const a of Ee)
|
|
237
|
-
|
|
237
|
+
i[a] === void 0 && t.push(`@dnd-kit/sortable:${a}`);
|
|
238
238
|
return t.length === 0 ? { ok: !0 } : { ok: !1, missing: t };
|
|
239
239
|
}
|
|
240
240
|
function Se() {
|
|
241
|
-
return
|
|
241
|
+
return R ? Promise.resolve(R) : M ? Promise.resolve(null) : F || (F = (async () => {
|
|
242
242
|
try {
|
|
243
243
|
const [e, n, t] = await Promise.all([
|
|
244
244
|
import("@dnd-kit/core"),
|
|
@@ -247,21 +247,21 @@ function Se() {
|
|
|
247
247
|
"SortableZones: @dnd-kit/utilities failed to load; drag-overlay positioning will fall back (items may teleport instead of slide)."
|
|
248
248
|
), {}))
|
|
249
249
|
]), r = Ce(e, n);
|
|
250
|
-
return r.ok ? (
|
|
250
|
+
return r.ok ? (R = {
|
|
251
251
|
core: e,
|
|
252
252
|
sortable: n,
|
|
253
253
|
utilities: t
|
|
254
|
-
},
|
|
254
|
+
}, R) : (M = !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 {
|
|
258
|
-
return
|
|
258
|
+
return M = !0, null;
|
|
259
259
|
}
|
|
260
|
-
})(),
|
|
260
|
+
})(), F);
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
const { zones: n, onZoneChange: t, renderZone: r, renderItem:
|
|
264
|
-
return
|
|
262
|
+
function _e(e) {
|
|
263
|
+
const { zones: n, onZoneChange: t, renderZone: r, renderItem: i, renderDragOverlay: a } = e, c = ye({ zones: n, onZoneChange: t }), [o, p] = Z.useState(R);
|
|
264
|
+
return Z.useEffect(() => {
|
|
265
265
|
if (o) return;
|
|
266
266
|
let u = !0;
|
|
267
267
|
return Se().then((d) => {
|
|
@@ -269,43 +269,43 @@ function be(e) {
|
|
|
269
269
|
}), () => {
|
|
270
270
|
u = !1;
|
|
271
271
|
};
|
|
272
|
-
}, [o]), o ? /* @__PURE__ */
|
|
272
|
+
}, [o]), o ? /* @__PURE__ */ s(
|
|
273
273
|
ne,
|
|
274
274
|
{
|
|
275
275
|
state: c,
|
|
276
276
|
modules: o,
|
|
277
277
|
renderZone: r,
|
|
278
|
-
renderItem:
|
|
278
|
+
renderItem: i,
|
|
279
279
|
renderDragOverlay: a
|
|
280
280
|
}
|
|
281
|
-
) : /* @__PURE__ */
|
|
282
|
-
const d = u.items.map((m) => /* @__PURE__ */
|
|
283
|
-
return /* @__PURE__ */
|
|
281
|
+
) : /* @__PURE__ */ s("div", { "data-sortable-zones-passive": "true", children: c.zones.map((u) => {
|
|
282
|
+
const d = u.items.map((m) => /* @__PURE__ */ s(Z.Fragment, { children: i(m) }, m.id));
|
|
283
|
+
return /* @__PURE__ */ s("div", { ...c.getZoneProps(u.zoneKey), children: r(u.zoneKey, u.items, d) }, u.zoneKey);
|
|
284
284
|
}) });
|
|
285
285
|
}
|
|
286
|
-
|
|
286
|
+
_e.displayName = "SortableZones";
|
|
287
287
|
function ne({
|
|
288
288
|
state: e,
|
|
289
289
|
modules: n,
|
|
290
290
|
renderZone: t,
|
|
291
291
|
renderItem: r,
|
|
292
|
-
renderDragOverlay:
|
|
292
|
+
renderDragOverlay: i
|
|
293
293
|
}) {
|
|
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,
|
|
294
|
+
const { core: a, sortable: c, utilities: o } = n, { DndContext: p, DragOverlay: u, useSensors: d, useSensor: m, useDroppable: b, PointerSensor: L, KeyboardSensor: H, closestCenter: B } = a, { SortableContext: l, verticalListSortingStrategy: g } = c, S = d(
|
|
295
|
+
m(L, { activationConstraint: { distance: 5 } }),
|
|
296
|
+
m(H)
|
|
297
|
+
), y = p, _ = u, P = l;
|
|
298
298
|
return /* @__PURE__ */ N(
|
|
299
299
|
y,
|
|
300
300
|
{
|
|
301
301
|
sensors: S,
|
|
302
|
-
collisionDetection:
|
|
302
|
+
collisionDetection: B,
|
|
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 I = f.items.map((h) => h.id), E = f.items.map((h) => /* @__PURE__ */
|
|
308
|
+
const I = f.items.map((h) => h.id), E = f.items.map((h) => /* @__PURE__ */ s(
|
|
309
309
|
te,
|
|
310
310
|
{
|
|
311
311
|
id: h.id,
|
|
@@ -315,30 +315,30 @@ function ne({
|
|
|
315
315
|
},
|
|
316
316
|
h.id
|
|
317
317
|
));
|
|
318
|
-
return /* @__PURE__ */
|
|
318
|
+
return /* @__PURE__ */ s(
|
|
319
319
|
re,
|
|
320
320
|
{
|
|
321
321
|
zoneKey: f.zoneKey,
|
|
322
322
|
zoneProps: e.getZoneProps(f.zoneKey),
|
|
323
|
-
useDroppable:
|
|
324
|
-
children: /* @__PURE__ */
|
|
323
|
+
useDroppable: b,
|
|
324
|
+
children: /* @__PURE__ */ s(P, { items: I, strategy: g, children: t(f.zoneKey, f.items, E) })
|
|
325
325
|
},
|
|
326
326
|
f.zoneKey
|
|
327
327
|
);
|
|
328
328
|
}),
|
|
329
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ s(_, { children: e.activeItem ? i?.(e.activeItem) ?? r(e.activeItem) : null })
|
|
330
330
|
]
|
|
331
331
|
}
|
|
332
332
|
);
|
|
333
333
|
}
|
|
334
334
|
ne.displayName = "SortableZonesInner";
|
|
335
335
|
function te({ id: e, useSortable: n, cssHelper: t, children: r }) {
|
|
336
|
-
const { attributes:
|
|
336
|
+
const { attributes: i, listeners: a, setNodeRef: c, transform: o, transition: p, isDragging: u } = n({ id: e }), d = {
|
|
337
337
|
transform: t?.Transform?.toString(o) ?? void 0,
|
|
338
338
|
transition: p,
|
|
339
339
|
opacity: u ? 0.5 : 1
|
|
340
340
|
};
|
|
341
|
-
return /* @__PURE__ */
|
|
341
|
+
return /* @__PURE__ */ s("div", { ref: c, style: d, "data-sortable-item-id": e, ...i, ...a, children: r });
|
|
342
342
|
}
|
|
343
343
|
te.displayName = "SortableItem";
|
|
344
344
|
function re({
|
|
@@ -347,12 +347,12 @@ function re({
|
|
|
347
347
|
useDroppable: t,
|
|
348
348
|
children: r
|
|
349
349
|
}) {
|
|
350
|
-
const { setNodeRef:
|
|
351
|
-
return /* @__PURE__ */
|
|
350
|
+
const { setNodeRef: i, isOver: a } = t({ id: e });
|
|
351
|
+
return /* @__PURE__ */ s("div", { ref: i, "data-zone-is-over": a || void 0, ...n, children: r });
|
|
352
352
|
}
|
|
353
353
|
re.displayName = "ZoneDroppable";
|
|
354
354
|
const V = ae(null);
|
|
355
|
-
function
|
|
355
|
+
function be() {
|
|
356
356
|
const e = W(V);
|
|
357
357
|
if (!e)
|
|
358
358
|
throw new Error(
|
|
@@ -363,31 +363,19 @@ function _e() {
|
|
|
363
363
|
function Pe() {
|
|
364
364
|
return W(V);
|
|
365
365
|
}
|
|
366
|
-
const De =
|
|
367
|
-
function
|
|
368
|
-
if (e === "threshold") {
|
|
369
|
-
const t = De.safeParse(n);
|
|
370
|
-
return t.success ? t.data : 80;
|
|
371
|
-
}
|
|
366
|
+
const De = K.number().min(7).max(90), xe = K.array(K.string().min(1)).max(3);
|
|
367
|
+
function Ne(e, n) {
|
|
372
368
|
if (e === "timeframe") {
|
|
373
|
-
const t =
|
|
369
|
+
const t = De.safeParse(n);
|
|
374
370
|
return t.success ? t.data : 30;
|
|
375
371
|
}
|
|
376
|
-
if (e === "accent") {
|
|
377
|
-
const t = Ne.safeParse(n);
|
|
378
|
-
return t.success ? t.data : null;
|
|
379
|
-
}
|
|
380
372
|
if (e === "slots") {
|
|
381
|
-
const t =
|
|
373
|
+
const t = xe.safeParse(n);
|
|
382
374
|
return t.success ? t.data : [];
|
|
383
375
|
}
|
|
384
|
-
if (e === "thresholdEnabled" || e === "accentEnabled") {
|
|
385
|
-
const t = we.safeParse(n);
|
|
386
|
-
return t.success ? t.data : !1;
|
|
387
|
-
}
|
|
388
376
|
return n;
|
|
389
377
|
}
|
|
390
|
-
const
|
|
378
|
+
const Oe = {
|
|
391
379
|
activePanelId: null,
|
|
392
380
|
activeTrigger: null,
|
|
393
381
|
bellCutoutOpen: !1,
|
|
@@ -398,7 +386,7 @@ const Le = {
|
|
|
398
386
|
lastClose: null,
|
|
399
387
|
pendingSideEffects: []
|
|
400
388
|
}, Y = /* @__PURE__ */ new Set(["settings"]);
|
|
401
|
-
function
|
|
389
|
+
function we(e, n) {
|
|
402
390
|
if (e == null || e.kind !== n.kind) return !1;
|
|
403
391
|
switch (e.kind) {
|
|
404
392
|
case "bell":
|
|
@@ -413,7 +401,7 @@ function Re(e, n) {
|
|
|
413
401
|
return e.action === n.action && e.blockedCardId === n.blockedCardId && e.activeCardId === n.activeCardId;
|
|
414
402
|
}
|
|
415
403
|
}
|
|
416
|
-
function
|
|
404
|
+
function Te(e, n) {
|
|
417
405
|
switch (n.type) {
|
|
418
406
|
case "OPEN_PANEL": {
|
|
419
407
|
if (e.activePanelId && e.isDirty)
|
|
@@ -431,7 +419,7 @@ function ke(e, n) {
|
|
|
431
419
|
}
|
|
432
420
|
]
|
|
433
421
|
};
|
|
434
|
-
if (e.activePanelId === n.panelId &&
|
|
422
|
+
if (e.activePanelId === n.panelId && we(e.activeTrigger, n.trigger))
|
|
435
423
|
return e;
|
|
436
424
|
const t = e.activePanelId != null ? [
|
|
437
425
|
{
|
|
@@ -456,12 +444,12 @@ function ke(e, n) {
|
|
|
456
444
|
case "CLOSE_PANEL": {
|
|
457
445
|
if (e.activePanelId == null)
|
|
458
446
|
return e;
|
|
459
|
-
const t = e.activePanelId, r = e.activeTrigger?.cardId ?? null,
|
|
447
|
+
const t = e.activePanelId, r = e.activeTrigger?.cardId ?? null, i = r != null ? e.bufferByCard[r] : void 0, a = e.isDirty ? n.reason === "apply-button" ? r != null && i != null ? [
|
|
460
448
|
{
|
|
461
449
|
type: "COMMIT_BUFFER",
|
|
462
|
-
payload: { cardId: r, delta:
|
|
450
|
+
payload: { cardId: r, delta: i }
|
|
463
451
|
}
|
|
464
|
-
] : [{ type: "COMMIT_BUFFER" }] : [{ type: "DISCARD_BUFFER" }] : [], c = r != null &&
|
|
452
|
+
] : [{ type: "COMMIT_BUFFER" }] : [{ type: "DISCARD_BUFFER" }] : [], c = r != null && i != null ? (() => {
|
|
465
453
|
const o = { ...e.bufferByCard };
|
|
466
454
|
return delete o[r], o;
|
|
467
455
|
})() : e.bufferByCard;
|
|
@@ -501,12 +489,12 @@ function ke(e, n) {
|
|
|
501
489
|
{ type: "INVALID_DISPATCH", reason: "no-buffer-panel" }
|
|
502
490
|
]
|
|
503
491
|
};
|
|
504
|
-
const t = e.bufferByCard[n.cardId], r = t == null,
|
|
505
|
-
if (!r && t.changes[n.key] ===
|
|
492
|
+
const t = e.bufferByCard[n.cardId], r = t == null, i = Ne(n.key, n.value);
|
|
493
|
+
if (!r && t.changes[n.key] === i)
|
|
506
494
|
return e;
|
|
507
495
|
const c = { kind: "settings", changes: {
|
|
508
496
|
...t?.kind === "settings" ? t.changes : {},
|
|
509
|
-
[n.key]:
|
|
497
|
+
[n.key]: i
|
|
510
498
|
} }, o = { ...e.bufferByCard, [n.cardId]: c }, p = r ? [
|
|
511
499
|
{
|
|
512
500
|
type: "SCHEDULE_TIMER",
|
|
@@ -523,8 +511,8 @@ function ke(e, n) {
|
|
|
523
511
|
case "CLEAR_BUFFER": {
|
|
524
512
|
if (e.bufferByCard[n.cardId] == null)
|
|
525
513
|
return e;
|
|
526
|
-
const r = Object.keys(e.bufferByCard).length === 1,
|
|
527
|
-
delete
|
|
514
|
+
const r = Object.keys(e.bufferByCard).length === 1, i = { ...e.bufferByCard };
|
|
515
|
+
delete i[n.cardId];
|
|
528
516
|
const a = r && e.isDirty ? [
|
|
529
517
|
{
|
|
530
518
|
type: "SCHEDULE_TIMER",
|
|
@@ -534,7 +522,7 @@ function ke(e, n) {
|
|
|
534
522
|
] : [];
|
|
535
523
|
return {
|
|
536
524
|
...e,
|
|
537
|
-
bufferByCard:
|
|
525
|
+
bufferByCard: i,
|
|
538
526
|
pendingSideEffects: [...e.pendingSideEffects, ...a]
|
|
539
527
|
};
|
|
540
528
|
}
|
|
@@ -575,11 +563,11 @@ function ke(e, n) {
|
|
|
575
563
|
return e;
|
|
576
564
|
}
|
|
577
565
|
}
|
|
578
|
-
function
|
|
566
|
+
function Le(e) {
|
|
579
567
|
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
568
|
}
|
|
581
|
-
function
|
|
582
|
-
const [e, n] = ce(
|
|
569
|
+
function Re() {
|
|
570
|
+
const [e, n] = ce(Te, Oe), t = O([]), r = O(null);
|
|
583
571
|
w(() => () => {
|
|
584
572
|
r.current != null && (window.clearTimeout(r.current), r.current = null);
|
|
585
573
|
}, []), w(() => {
|
|
@@ -612,25 +600,25 @@ function Ae() {
|
|
|
612
600
|
c
|
|
613
601
|
];
|
|
614
602
|
}, [e.lastClose]);
|
|
615
|
-
const
|
|
616
|
-
() =>
|
|
603
|
+
const i = $(
|
|
604
|
+
() => Le(e),
|
|
617
605
|
[e.activePanelId, e.bellCutoutOpen, e.isDirty]
|
|
618
606
|
), a = T(() => t.current.slice(), []);
|
|
619
|
-
return { state: e, surfaceState:
|
|
607
|
+
return { state: e, surfaceState: i, dispatch: n, getCloseLog: a };
|
|
620
608
|
}
|
|
621
|
-
function
|
|
622
|
-
const n =
|
|
609
|
+
function We({ children: e }) {
|
|
610
|
+
const n = Re(), t = $(
|
|
623
611
|
() => n,
|
|
624
612
|
// Re-publish only when one of the four coordinator fields changes identity.
|
|
625
613
|
// dispatch + getCloseLog are stable. state + surfaceState change on dispatch.
|
|
626
614
|
[n.state, n.surfaceState, n.dispatch, n.getCloseLog]
|
|
627
615
|
);
|
|
628
|
-
return /* @__PURE__ */
|
|
616
|
+
return /* @__PURE__ */ s(V.Provider, { value: t, children: e });
|
|
629
617
|
}
|
|
630
|
-
function
|
|
618
|
+
function ke({ title: e, onClose: n, titleId: t }) {
|
|
631
619
|
return /* @__PURE__ */ N("div", { className: "gloss-panel-chrome-v2__header", children: [
|
|
632
|
-
e != null && /* @__PURE__ */
|
|
633
|
-
/* @__PURE__ */
|
|
620
|
+
e != null && /* @__PURE__ */ s("span", { id: t, className: "gloss-panel-chrome-v2__title", children: e }),
|
|
621
|
+
/* @__PURE__ */ s(
|
|
634
622
|
"button",
|
|
635
623
|
{
|
|
636
624
|
id: "panel-close",
|
|
@@ -643,8 +631,8 @@ function He({ title: e, onClose: n, titleId: t }) {
|
|
|
643
631
|
)
|
|
644
632
|
] });
|
|
645
633
|
}
|
|
646
|
-
function
|
|
647
|
-
return /* @__PURE__ */
|
|
634
|
+
function Fe({ children: e }) {
|
|
635
|
+
return /* @__PURE__ */ s(
|
|
648
636
|
"div",
|
|
649
637
|
{
|
|
650
638
|
"data-panel-stage": !0,
|
|
@@ -654,24 +642,24 @@ function Be({ children: e }) {
|
|
|
654
642
|
}
|
|
655
643
|
);
|
|
656
644
|
}
|
|
657
|
-
function
|
|
658
|
-
return /* @__PURE__ */
|
|
645
|
+
function Ae({ children: e }) {
|
|
646
|
+
return /* @__PURE__ */ s("div", { className: "gloss-panel-chrome-v2__navigation", children: e });
|
|
659
647
|
}
|
|
660
|
-
function
|
|
661
|
-
return /* @__PURE__ */
|
|
648
|
+
function He({ children: e }) {
|
|
649
|
+
return /* @__PURE__ */ s("div", { className: "gloss-panel-chrome-v2__body", children: e });
|
|
662
650
|
}
|
|
663
|
-
function
|
|
651
|
+
function Be({ left: e, right: n }) {
|
|
664
652
|
return /* @__PURE__ */ N("div", { className: "gloss-panel-chrome-v2__footer", children: [
|
|
665
|
-
/* @__PURE__ */
|
|
666
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ s("div", { className: "gloss-panel-chrome-v2__footer-left", children: e }),
|
|
654
|
+
/* @__PURE__ */ s("div", { className: "gloss-panel-chrome-v2__footer-right", children: n })
|
|
667
655
|
] });
|
|
668
656
|
}
|
|
669
|
-
function
|
|
657
|
+
function Ze({
|
|
670
658
|
children: e,
|
|
671
659
|
onClose: n,
|
|
672
660
|
title: t,
|
|
673
661
|
variant: r = "no-stage",
|
|
674
|
-
stage:
|
|
662
|
+
stage: i,
|
|
675
663
|
navigation: a,
|
|
676
664
|
footer: c
|
|
677
665
|
}) {
|
|
@@ -688,12 +676,12 @@ function Ue({
|
|
|
688
676
|
"aria-label": u ? void 0 : "Panel",
|
|
689
677
|
className: `gloss-panel-chrome-v2 gloss-panel-chrome-v2--${r}${o ? " gloss-panel-chrome-v2--headerless" : ""}`,
|
|
690
678
|
children: [
|
|
691
|
-
!o && /* @__PURE__ */
|
|
692
|
-
r === "with-stage" && /* @__PURE__ */
|
|
693
|
-
a != null && /* @__PURE__ */
|
|
694
|
-
/* @__PURE__ */
|
|
695
|
-
c != null && /* @__PURE__ */
|
|
696
|
-
o && /* @__PURE__ */
|
|
679
|
+
!o && /* @__PURE__ */ s(ke, { title: t, onClose: n, titleId: p }),
|
|
680
|
+
r === "with-stage" && /* @__PURE__ */ s(Fe, { children: i }),
|
|
681
|
+
a != null && /* @__PURE__ */ s(Ae, { children: a }),
|
|
682
|
+
/* @__PURE__ */ s(He, { children: e }),
|
|
683
|
+
c != null && /* @__PURE__ */ s(Be, { left: c.left, right: c.right }),
|
|
684
|
+
o && /* @__PURE__ */ s(
|
|
697
685
|
"button",
|
|
698
686
|
{
|
|
699
687
|
id: "panel-close",
|
|
@@ -708,45 +696,45 @@ function Ue({
|
|
|
708
696
|
}
|
|
709
697
|
);
|
|
710
698
|
}
|
|
711
|
-
function
|
|
699
|
+
function Xe({ isOpen: e }) {
|
|
712
700
|
const n = Pe();
|
|
713
|
-
return /* @__PURE__ */
|
|
714
|
-
|
|
701
|
+
return /* @__PURE__ */ s(
|
|
702
|
+
Ze,
|
|
715
703
|
{
|
|
716
704
|
variant: "no-stage",
|
|
717
705
|
title: "Notifications",
|
|
718
706
|
onClose: () => n?.dispatch({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
719
|
-
children: /* @__PURE__ */
|
|
707
|
+
children: /* @__PURE__ */ s(
|
|
720
708
|
"div",
|
|
721
709
|
{
|
|
722
710
|
"data-shell": "notification-center",
|
|
723
711
|
"data-panel": "notification-center",
|
|
724
712
|
"aria-hidden": !e,
|
|
725
|
-
children: /* @__PURE__ */
|
|
713
|
+
children: /* @__PURE__ */ s("p", { children: "No notifications" })
|
|
726
714
|
}
|
|
727
715
|
)
|
|
728
716
|
}
|
|
729
717
|
);
|
|
730
718
|
}
|
|
731
|
-
const
|
|
719
|
+
const Me = {
|
|
732
720
|
position: "relative",
|
|
733
721
|
pointerEvents: "auto"
|
|
734
722
|
};
|
|
735
|
-
function
|
|
723
|
+
function Ke({ children: e, onClose: n, footer: t, title: r, variant: i = "default" }) {
|
|
736
724
|
const a = `panel-close-${X().replace(/:/g, "-")}`;
|
|
737
725
|
return /* @__PURE__ */ N(
|
|
738
726
|
"div",
|
|
739
727
|
{
|
|
740
728
|
"data-chrome": "panel",
|
|
741
|
-
"data-chrome-variant":
|
|
729
|
+
"data-chrome-variant": i,
|
|
742
730
|
role: "dialog",
|
|
743
731
|
"aria-modal": "true",
|
|
744
|
-
className:
|
|
745
|
-
style:
|
|
732
|
+
className: i === "merged-stage" ? "gloss-panel-chrome gloss-panel-chrome--merged-stage" : "gloss-panel-chrome",
|
|
733
|
+
style: Me,
|
|
746
734
|
children: [
|
|
747
735
|
/* @__PURE__ */ N("div", { className: "gloss-panel-chrome__header", children: [
|
|
748
|
-
r != null && /* @__PURE__ */
|
|
749
|
-
/* @__PURE__ */
|
|
736
|
+
r != null && /* @__PURE__ */ s("span", { className: "gloss-panel-chrome__title", children: r }),
|
|
737
|
+
/* @__PURE__ */ s(
|
|
750
738
|
"button",
|
|
751
739
|
{
|
|
752
740
|
id: a,
|
|
@@ -758,13 +746,13 @@ function Ve({ children: e, onClose: n, footer: t, title: r, variant: s = "defaul
|
|
|
758
746
|
}
|
|
759
747
|
)
|
|
760
748
|
] }),
|
|
761
|
-
/* @__PURE__ */
|
|
762
|
-
t != null && /* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ s("div", { className: "gloss-panel-chrome__body", children: e }),
|
|
750
|
+
t != null && /* @__PURE__ */ s("div", { className: "gloss-panel-chrome__footer", children: t })
|
|
763
751
|
]
|
|
764
752
|
}
|
|
765
753
|
);
|
|
766
754
|
}
|
|
767
|
-
function
|
|
755
|
+
function Ue(e) {
|
|
768
756
|
if (process.env.NODE_ENV === "production" || !e || !e.parentElement) return;
|
|
769
757
|
const n = e.parentElement, t = window.getComputedStyle(n);
|
|
770
758
|
t.perspective === "none" && console.warn(
|
|
@@ -775,12 +763,12 @@ function ze(e) {
|
|
|
775
763
|
n
|
|
776
764
|
);
|
|
777
765
|
}
|
|
778
|
-
function
|
|
766
|
+
function $e({ isOpen: e, children: n }) {
|
|
779
767
|
const t = ee(), r = O(null);
|
|
780
768
|
G(() => {
|
|
781
|
-
|
|
769
|
+
Ue(r.current);
|
|
782
770
|
}, []);
|
|
783
|
-
const [
|
|
771
|
+
const [i, a] = A(!1);
|
|
784
772
|
w(() => {
|
|
785
773
|
if (!e) {
|
|
786
774
|
a(!1);
|
|
@@ -791,10 +779,10 @@ function je({ isOpen: e, children: n }) {
|
|
|
791
779
|
}, [e]);
|
|
792
780
|
const c = [
|
|
793
781
|
"gloss-panel-mount",
|
|
794
|
-
|
|
782
|
+
i ? "has-panel" : "",
|
|
795
783
|
t ? "reduced-motion" : ""
|
|
796
784
|
].filter(Boolean).join(" ");
|
|
797
|
-
return /* @__PURE__ */
|
|
785
|
+
return /* @__PURE__ */ s(
|
|
798
786
|
"div",
|
|
799
787
|
{
|
|
800
788
|
ref: r,
|
|
@@ -805,7 +793,7 @@ function je({ isOpen: e, children: n }) {
|
|
|
805
793
|
}
|
|
806
794
|
);
|
|
807
795
|
}
|
|
808
|
-
const
|
|
796
|
+
const Ve = {
|
|
809
797
|
position: "fixed",
|
|
810
798
|
top: 0,
|
|
811
799
|
left: 0,
|
|
@@ -816,7 +804,7 @@ const qe = {
|
|
|
816
804
|
overflow: "visible",
|
|
817
805
|
pointerEvents: "none",
|
|
818
806
|
zIndex: 55
|
|
819
|
-
},
|
|
807
|
+
}, ze = {
|
|
820
808
|
position: "fixed",
|
|
821
809
|
top: "var(--tb-h, 60px)",
|
|
822
810
|
left: 0,
|
|
@@ -830,9 +818,9 @@ const qe = {
|
|
|
830
818
|
pointerEvents: "none",
|
|
831
819
|
background: "rgba(0, 0, 0, 0.04)"
|
|
832
820
|
};
|
|
833
|
-
function
|
|
834
|
-
const { state: n, dispatch: t, getCloseLog: r } =
|
|
835
|
-
n.activePanelId && !
|
|
821
|
+
function Ge({ panelComponents: e }) {
|
|
822
|
+
const { state: n, dispatch: t, getCloseLog: r } = be(), i = n.activePanelId ? e[n.activePanelId] : null;
|
|
823
|
+
n.activePanelId && !i && process.env.NODE_ENV !== "production" && console.error(
|
|
836
824
|
"[panels] No panel component registered for activePanelId:",
|
|
837
825
|
n.activePanelId
|
|
838
826
|
), w(() => {
|
|
@@ -858,26 +846,26 @@ function nn({ panelComponents: e }) {
|
|
|
858
846
|
o.__panelsHostHandle?.dispatch === t && delete o.__panelsHostHandle;
|
|
859
847
|
};
|
|
860
848
|
}, [t, r]);
|
|
861
|
-
const c = n.activePanelId != null &&
|
|
862
|
-
return /* @__PURE__ */ N("div", { "data-panel-host": "true", style:
|
|
863
|
-
c && /* @__PURE__ */
|
|
849
|
+
const c = n.activePanelId != null && i != null;
|
|
850
|
+
return /* @__PURE__ */ N("div", { "data-panel-host": "true", style: Ve, children: [
|
|
851
|
+
c && /* @__PURE__ */ s(
|
|
864
852
|
"div",
|
|
865
853
|
{
|
|
866
854
|
"data-panel-scrim": "true",
|
|
867
|
-
style:
|
|
855
|
+
style: ze
|
|
868
856
|
}
|
|
869
857
|
),
|
|
870
|
-
/* @__PURE__ */
|
|
871
|
-
|
|
858
|
+
/* @__PURE__ */ s($e, { isOpen: c, children: c && /* @__PURE__ */ s(
|
|
859
|
+
Ke,
|
|
872
860
|
{
|
|
873
861
|
isOpen: !0,
|
|
874
862
|
onClose: () => t({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
875
|
-
children: /* @__PURE__ */ i
|
|
863
|
+
children: /* @__PURE__ */ s(i, { isOpen: !0 })
|
|
876
864
|
}
|
|
877
865
|
) })
|
|
878
866
|
] });
|
|
879
867
|
}
|
|
880
|
-
const
|
|
868
|
+
const Je = {
|
|
881
869
|
"apply-button": !0,
|
|
882
870
|
// the ONLY commit reason
|
|
883
871
|
"cancel-button": !1,
|
|
@@ -895,25 +883,25 @@ const tn = {
|
|
|
895
883
|
// 260524 panel-x-axis-transitions — viewport shrank past targetSection
|
|
896
884
|
};
|
|
897
885
|
export {
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
886
|
+
Je as C,
|
|
887
|
+
Xe as N,
|
|
888
|
+
We as P,
|
|
889
|
+
_e as S,
|
|
902
890
|
ye as a,
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
891
|
+
be as b,
|
|
892
|
+
Ge as c,
|
|
893
|
+
Re as d,
|
|
894
|
+
Le as e,
|
|
907
895
|
ge as f,
|
|
908
896
|
ee as g,
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
897
|
+
Ze as h,
|
|
898
|
+
Oe as i,
|
|
899
|
+
$e as j,
|
|
900
|
+
ke as k,
|
|
901
|
+
Fe as l,
|
|
902
|
+
Ae as m,
|
|
903
|
+
He as n,
|
|
904
|
+
Be as o,
|
|
905
|
+
Te as r,
|
|
918
906
|
Pe as u
|
|
919
907
|
};
|