@mt-gloss/ui 0.1.103 → 0.1.105
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-Dm8qIHaq.js → COMMITS-kaUvc5jL.js} +227 -141
- package/composites-panels.js +462 -368
- package/index.js +31 -30
- package/lib/composites/panels/PanelSlot.d.ts +14 -3
- package/lib/composites/panels/coordinator/settingsBufferSchemas.d.ts +13 -0
- package/lib/composites/panels/coordinator/types.d.ts +6 -0
- package/lib/composites/panels/shells/SettingsShell.d.ts +6 -1
- package/lib/composites/panels/shells/settings/ColorControls.d.ts +9 -0
- package/lib/composites/panels/shells/settings/SlotsControls.d.ts +2 -0
- package/lib/composites/panels/shells/settings/ThresholdControls.d.ts +6 -0
- package/lib/composites/panels/shells/settings/TimeframeControls.d.ts +6 -0
- package/lib/composites/panels/shells/settings/index.d.ts +12 -0
- package/lib/primitives/dashboard/SettingsTabStrip/SettingsTabStrip.d.ts +17 -0
- package/lib/primitives/dashboard/SettingsTabStrip/index.d.ts +6 -0
- package/lib/primitives/dashboard/SettingsTabStrip/types.d.ts +12 -0
- package/lib/primitives/dashboard/index.d.ts +1 -0
- package/package.json +1 -1
- package/ui.css +1 -1
|
@@ -1,28 +1,128 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as c, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { motion as L } from "framer-motion";
|
|
3
|
+
import { useSyncExternalStore as O, createContext as T, useContext as S, useReducer as w, useRef as g, useEffect as d, useMemo as m, useCallback as I, useLayoutEffect as _, useState as N } from "react";
|
|
4
|
+
import { z as v } from "zod";
|
|
5
|
+
const x = "(prefers-reduced-motion: reduce)";
|
|
6
|
+
function b() {
|
|
7
|
+
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(x);
|
|
8
|
+
}
|
|
9
|
+
function H(e) {
|
|
10
|
+
const n = b();
|
|
11
|
+
return n ? (n.addEventListener("change", e), () => {
|
|
12
|
+
n.removeEventListener("change", e);
|
|
13
|
+
}) : () => {
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function A() {
|
|
17
|
+
const e = b();
|
|
18
|
+
return e ? e.matches : !1;
|
|
19
|
+
}
|
|
20
|
+
function F() {
|
|
21
|
+
return !1;
|
|
22
|
+
}
|
|
23
|
+
function P() {
|
|
24
|
+
return O(H, A, F);
|
|
25
|
+
}
|
|
26
|
+
const R = {
|
|
27
|
+
threshold: "Threshold",
|
|
28
|
+
timeframe: "Timeframe",
|
|
29
|
+
slots: "Slots",
|
|
30
|
+
color: "Color"
|
|
31
|
+
};
|
|
32
|
+
function k({
|
|
33
|
+
dimensions: e,
|
|
34
|
+
activeTab: n,
|
|
35
|
+
onSelect: t,
|
|
36
|
+
reduced: r,
|
|
37
|
+
labels: l,
|
|
38
|
+
ariaLabel: a = "Settings dimensions"
|
|
39
|
+
}) {
|
|
40
|
+
const s = P(), i = r ?? s;
|
|
41
|
+
if (e.length < 2) return null;
|
|
42
|
+
const u = (o) => l?.[o] ?? R[o], E = (o, f) => {
|
|
43
|
+
o.key === "ArrowRight" ? (o.preventDefault(), t(e[(f + 1) % e.length])) : o.key === "ArrowLeft" ? (o.preventDefault(), t(e[(f - 1 + e.length) % e.length])) : o.key === "Home" ? (o.preventDefault(), t(e[0])) : o.key === "End" && (o.preventDefault(), t(e[e.length - 1]));
|
|
44
|
+
};
|
|
45
|
+
return /* @__PURE__ */ c(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
role: "tablist",
|
|
49
|
+
"aria-label": a,
|
|
50
|
+
className: "settings-tab-strip",
|
|
51
|
+
children: e.map((o, f) => {
|
|
52
|
+
const p = n === o;
|
|
53
|
+
return /* @__PURE__ */ C(
|
|
54
|
+
"button",
|
|
55
|
+
{
|
|
56
|
+
role: "tab",
|
|
57
|
+
type: "button",
|
|
58
|
+
id: `settings-tab-${o}`,
|
|
59
|
+
"aria-selected": p,
|
|
60
|
+
"aria-controls": `settings-tabpanel-${o}`,
|
|
61
|
+
tabIndex: p ? 0 : -1,
|
|
62
|
+
className: `settings-tab-strip__tab${p ? " settings-tab-strip__tab--active" : ""}`,
|
|
63
|
+
onClick: () => t(o),
|
|
64
|
+
onKeyDown: (D) => E(D, f),
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ c("span", { className: "settings-tab-strip__label", children: u(o) }),
|
|
67
|
+
p && !i && /* @__PURE__ */ c(
|
|
68
|
+
L.span,
|
|
69
|
+
{
|
|
70
|
+
layoutId: "settings-active-tab-indicator",
|
|
71
|
+
"data-layout-id": "settings-active-tab-indicator",
|
|
72
|
+
className: "settings-tab-strip__indicator",
|
|
73
|
+
"aria-hidden": "true",
|
|
74
|
+
transition: { type: "spring", stiffness: 380, damping: 30 }
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
o
|
|
80
|
+
);
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
k.displayName = "SettingsTabStrip";
|
|
86
|
+
const h = T(null);
|
|
87
|
+
function B() {
|
|
88
|
+
const e = S(h);
|
|
6
89
|
if (!e)
|
|
7
90
|
throw new Error(
|
|
8
91
|
"[panels] usePanelContext must be used inside <PanelProvider>. See @mt-gloss/ui/composites/panels."
|
|
9
92
|
);
|
|
10
93
|
return e;
|
|
11
94
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
95
|
+
function ie() {
|
|
96
|
+
return S(h);
|
|
97
|
+
}
|
|
98
|
+
const M = v.number().min(0).max(100), U = v.number().min(7).max(90), V = v.enum(["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"]);
|
|
99
|
+
function K(e, n) {
|
|
100
|
+
if (e === "threshold") {
|
|
101
|
+
const t = M.safeParse(n);
|
|
102
|
+
return t.success ? t.data : 80;
|
|
103
|
+
}
|
|
104
|
+
if (e === "timeframe") {
|
|
105
|
+
const t = U.safeParse(n);
|
|
106
|
+
return t.success ? t.data : 30;
|
|
107
|
+
}
|
|
108
|
+
if (e === "accent") {
|
|
109
|
+
const t = V.safeParse(n);
|
|
110
|
+
return t.success ? t.data : null;
|
|
111
|
+
}
|
|
112
|
+
return n;
|
|
14
113
|
}
|
|
15
|
-
const
|
|
114
|
+
const j = {
|
|
16
115
|
activePanelId: null,
|
|
17
116
|
activeTrigger: null,
|
|
18
117
|
bellCutoutOpen: !1,
|
|
19
118
|
isDirty: !1,
|
|
119
|
+
dirtySessionCount: 0,
|
|
20
120
|
lockHint: null,
|
|
21
121
|
bufferByCard: {},
|
|
22
122
|
lastClose: null,
|
|
23
123
|
pendingSideEffects: []
|
|
24
|
-
},
|
|
25
|
-
function
|
|
124
|
+
}, y = /* @__PURE__ */ new Set(["settings"]);
|
|
125
|
+
function q(e, n) {
|
|
26
126
|
if (e == null || e.kind !== n.kind) return !1;
|
|
27
127
|
switch (e.kind) {
|
|
28
128
|
case "bell":
|
|
@@ -33,9 +133,11 @@ function b(e, n) {
|
|
|
33
133
|
return e.sectionIndex === n.sectionIndex && e.cellPosition.row === n.cellPosition.row && e.cellPosition.col === n.cellPosition.col;
|
|
34
134
|
case "manage-pages-action":
|
|
35
135
|
return e.global === n.global && e.align === n.align;
|
|
136
|
+
case "layout-action-blocked":
|
|
137
|
+
return e.action === n.action && e.blockedCardId === n.blockedCardId && e.activeCardId === n.activeCardId;
|
|
36
138
|
}
|
|
37
139
|
}
|
|
38
|
-
function
|
|
140
|
+
function z(e, n) {
|
|
39
141
|
switch (n.type) {
|
|
40
142
|
case "OPEN_PANEL": {
|
|
41
143
|
if (e.activePanelId && e.isDirty)
|
|
@@ -53,7 +155,7 @@ function T(e, n) {
|
|
|
53
155
|
}
|
|
54
156
|
]
|
|
55
157
|
};
|
|
56
|
-
if (e.activePanelId === n.panelId &&
|
|
158
|
+
if (e.activePanelId === n.panelId && q(e.activeTrigger, n.trigger))
|
|
57
159
|
return e;
|
|
58
160
|
const t = e.activePanelId != null ? [
|
|
59
161
|
{
|
|
@@ -67,6 +169,8 @@ function T(e, n) {
|
|
|
67
169
|
activePanelId: n.panelId,
|
|
68
170
|
activeTrigger: n.trigger,
|
|
69
171
|
isDirty: !1,
|
|
172
|
+
dirtySessionCount: 0,
|
|
173
|
+
// Phase 16 P2 CC-17 — fresh open starts a clean session
|
|
70
174
|
bellCutoutOpen: r ? !1 : e.bellCutoutOpen,
|
|
71
175
|
lastClose: null,
|
|
72
176
|
// reset on fresh open
|
|
@@ -76,25 +180,27 @@ function T(e, n) {
|
|
|
76
180
|
case "CLOSE_PANEL": {
|
|
77
181
|
if (e.activePanelId == null)
|
|
78
182
|
return e;
|
|
79
|
-
const t = e.activePanelId, r = e.activeTrigger?.cardId ?? null,
|
|
183
|
+
const t = e.activePanelId, r = e.activeTrigger?.cardId ?? null, l = r != null ? e.bufferByCard[r] : void 0, a = e.isDirty ? n.reason === "apply-button" ? r != null && l != null ? [
|
|
80
184
|
{
|
|
81
185
|
type: "COMMIT_BUFFER",
|
|
82
|
-
payload: { cardId: r, delta:
|
|
186
|
+
payload: { cardId: r, delta: l }
|
|
83
187
|
}
|
|
84
|
-
] : [{ type: "COMMIT_BUFFER" }] : [{ type: "DISCARD_BUFFER" }] : [],
|
|
85
|
-
const
|
|
86
|
-
return delete
|
|
188
|
+
] : [{ type: "COMMIT_BUFFER" }] : [{ type: "DISCARD_BUFFER" }] : [], s = r != null && l != null ? (() => {
|
|
189
|
+
const i = { ...e.bufferByCard };
|
|
190
|
+
return delete i[r], i;
|
|
87
191
|
})() : e.bufferByCard;
|
|
88
192
|
return {
|
|
89
193
|
...e,
|
|
90
194
|
activePanelId: null,
|
|
91
195
|
activeTrigger: null,
|
|
92
196
|
isDirty: !1,
|
|
197
|
+
dirtySessionCount: 0,
|
|
198
|
+
// Phase 16 P2 CC-17 — session ends on panel close (apply or discard)
|
|
93
199
|
lockHint: null,
|
|
94
200
|
// closing clears any active lockHint (dirty-buffer condition gone)
|
|
95
|
-
bufferByCard:
|
|
201
|
+
bufferByCard: s,
|
|
96
202
|
lastClose: { panelId: t, reason: n.reason },
|
|
97
|
-
pendingSideEffects: [...e.pendingSideEffects, ...
|
|
203
|
+
pendingSideEffects: [...e.pendingSideEffects, ...a]
|
|
98
204
|
};
|
|
99
205
|
}
|
|
100
206
|
case "OPEN_BELL_CUTOUT":
|
|
@@ -111,7 +217,7 @@ function T(e, n) {
|
|
|
111
217
|
case "CLOSE_BELL_CUTOUT":
|
|
112
218
|
return e.bellCutoutOpen ? { ...e, bellCutoutOpen: !1 } : e;
|
|
113
219
|
case "SET_BUFFER_VALUE": {
|
|
114
|
-
if (e.activePanelId == null || !
|
|
220
|
+
if (e.activePanelId == null || !y.has(e.activePanelId))
|
|
115
221
|
return {
|
|
116
222
|
...e,
|
|
117
223
|
pendingSideEffects: [
|
|
@@ -119,13 +225,13 @@ function T(e, n) {
|
|
|
119
225
|
{ type: "INVALID_DISPATCH", reason: "no-buffer-panel" }
|
|
120
226
|
]
|
|
121
227
|
};
|
|
122
|
-
const t = e.bufferByCard[n.cardId], r = t == null;
|
|
123
|
-
if (!r && t.changes[n.key] ===
|
|
228
|
+
const t = e.bufferByCard[n.cardId], r = t == null, l = K(n.key, n.value);
|
|
229
|
+
if (!r && t.changes[n.key] === l)
|
|
124
230
|
return e;
|
|
125
|
-
const
|
|
231
|
+
const s = { kind: "settings", changes: {
|
|
126
232
|
...t?.kind === "settings" ? t.changes : {},
|
|
127
|
-
[n.key]:
|
|
128
|
-
} },
|
|
233
|
+
[n.key]: l
|
|
234
|
+
} }, i = { ...e.bufferByCard, [n.cardId]: s }, u = r ? [
|
|
129
235
|
{
|
|
130
236
|
type: "SCHEDULE_TIMER",
|
|
131
237
|
ms: 0,
|
|
@@ -134,16 +240,16 @@ function T(e, n) {
|
|
|
134
240
|
] : [];
|
|
135
241
|
return {
|
|
136
242
|
...e,
|
|
137
|
-
bufferByCard:
|
|
138
|
-
pendingSideEffects: [...e.pendingSideEffects, ...
|
|
243
|
+
bufferByCard: i,
|
|
244
|
+
pendingSideEffects: [...e.pendingSideEffects, ...u]
|
|
139
245
|
};
|
|
140
246
|
}
|
|
141
247
|
case "CLEAR_BUFFER": {
|
|
142
248
|
if (e.bufferByCard[n.cardId] == null)
|
|
143
249
|
return e;
|
|
144
|
-
const r = Object.keys(e.bufferByCard).length === 1,
|
|
145
|
-
delete
|
|
146
|
-
const
|
|
250
|
+
const r = Object.keys(e.bufferByCard).length === 1, l = { ...e.bufferByCard };
|
|
251
|
+
delete l[n.cardId];
|
|
252
|
+
const a = r && e.isDirty ? [
|
|
147
253
|
{
|
|
148
254
|
type: "SCHEDULE_TIMER",
|
|
149
255
|
ms: 0,
|
|
@@ -152,20 +258,20 @@ function T(e, n) {
|
|
|
152
258
|
] : [];
|
|
153
259
|
return {
|
|
154
260
|
...e,
|
|
155
|
-
bufferByCard:
|
|
156
|
-
pendingSideEffects: [...e.pendingSideEffects, ...
|
|
261
|
+
bufferByCard: l,
|
|
262
|
+
pendingSideEffects: [...e.pendingSideEffects, ...a]
|
|
157
263
|
};
|
|
158
264
|
}
|
|
159
265
|
case "BUFFER_BECOMES_DIRTY":
|
|
160
|
-
return e.activePanelId == null || !
|
|
266
|
+
return e.activePanelId == null || !y.has(e.activePanelId) ? {
|
|
161
267
|
...e,
|
|
162
268
|
pendingSideEffects: [
|
|
163
269
|
...e.pendingSideEffects,
|
|
164
270
|
{ type: "INVALID_DISPATCH", reason: "no-buffer-panel" }
|
|
165
271
|
]
|
|
166
|
-
} : e.isDirty ? e : { ...e, isDirty: !0 };
|
|
272
|
+
} : e.isDirty ? e : { ...e, isDirty: !0, dirtySessionCount: e.dirtySessionCount + 1 };
|
|
167
273
|
case "BUFFER_BECOMES_CLEAN":
|
|
168
|
-
return e.isDirty ? { ...e, isDirty: !1 } : e;
|
|
274
|
+
return e.isDirty ? { ...e, isDirty: !1, dirtySessionCount: 0 } : e;
|
|
169
275
|
case "SET_LOCK_HINT":
|
|
170
276
|
return {
|
|
171
277
|
...e,
|
|
@@ -193,33 +299,33 @@ function T(e, n) {
|
|
|
193
299
|
return e;
|
|
194
300
|
}
|
|
195
301
|
}
|
|
196
|
-
function
|
|
302
|
+
function Y(e) {
|
|
197
303
|
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";
|
|
198
304
|
}
|
|
199
|
-
function
|
|
200
|
-
const [e, n] =
|
|
201
|
-
|
|
305
|
+
function $() {
|
|
306
|
+
const [e, n] = w(z, j), t = g([]), r = g(null);
|
|
307
|
+
d(() => () => {
|
|
202
308
|
r.current != null && (window.clearTimeout(r.current), r.current = null);
|
|
203
|
-
}, []),
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
206
|
-
for (const
|
|
207
|
-
|
|
208
|
-
r.current = null, n(
|
|
209
|
-
}, Math.max(0,
|
|
309
|
+
}, []), d(() => {
|
|
310
|
+
const s = e.pendingSideEffects.length;
|
|
311
|
+
if (s !== 0) {
|
|
312
|
+
for (const i of e.pendingSideEffects)
|
|
313
|
+
i.type === "SCHEDULE_TIMER" ? (r.current != null && window.clearTimeout(r.current), r.current = window.setTimeout(() => {
|
|
314
|
+
r.current = null, n(i.action);
|
|
315
|
+
}, Math.max(0, i.ms))) : i.type === "SET_LOCK_HINT" ? n({ type: "SET_LOCK_HINT", hint: i.hint }) : i.type === "HANDOFF_CLOSE" ? t.current = [
|
|
210
316
|
...t.current.slice(-99),
|
|
211
317
|
{
|
|
212
|
-
panelId:
|
|
318
|
+
panelId: i.previousPanelId,
|
|
213
319
|
reason: "mutex-handoff",
|
|
214
320
|
at: Date.now(),
|
|
215
321
|
note: "F22: mutex-handoff synthetic close-log entry"
|
|
216
322
|
}
|
|
217
|
-
] :
|
|
218
|
-
n({ type: "DRAIN_SIDE_EFFECTS", count:
|
|
323
|
+
] : i.type === "INVALID_DISPATCH" && process.env.NODE_ENV !== "production" && console.warn("[panels] INVALID_DISPATCH:", i.reason);
|
|
324
|
+
n({ type: "DRAIN_SIDE_EFFECTS", count: s });
|
|
219
325
|
}
|
|
220
|
-
}, [e.pendingSideEffects, n]),
|
|
326
|
+
}, [e.pendingSideEffects, n]), d(() => {
|
|
221
327
|
if (!e.lastClose) return;
|
|
222
|
-
const
|
|
328
|
+
const s = {
|
|
223
329
|
panelId: e.lastClose.panelId,
|
|
224
330
|
reason: e.lastClose.reason,
|
|
225
331
|
at: Date.now(),
|
|
@@ -227,60 +333,39 @@ function w() {
|
|
|
227
333
|
};
|
|
228
334
|
t.current = [
|
|
229
335
|
...t.current.slice(-99),
|
|
230
|
-
|
|
336
|
+
s
|
|
231
337
|
];
|
|
232
338
|
}, [e.lastClose]);
|
|
233
|
-
const
|
|
234
|
-
() =>
|
|
339
|
+
const l = m(
|
|
340
|
+
() => Y(e),
|
|
235
341
|
[e.activePanelId, e.bellCutoutOpen, e.isDirty]
|
|
236
|
-
),
|
|
237
|
-
return { state: e, surfaceState:
|
|
342
|
+
), a = I(() => t.current.slice(), []);
|
|
343
|
+
return { state: e, surfaceState: l, dispatch: n, getCloseLog: a };
|
|
238
344
|
}
|
|
239
|
-
function
|
|
240
|
-
const n =
|
|
345
|
+
function le({ children: e }) {
|
|
346
|
+
const n = $(), t = m(
|
|
241
347
|
() => n,
|
|
242
348
|
// Re-publish only when one of the four coordinator fields changes identity.
|
|
243
349
|
// dispatch + getCloseLog are stable. state + surfaceState change on dispatch.
|
|
244
350
|
[n.state, n.surfaceState, n.dispatch, n.getCloseLog]
|
|
245
351
|
);
|
|
246
|
-
return /* @__PURE__ */
|
|
247
|
-
}
|
|
248
|
-
const N = "(prefers-reduced-motion: reduce)";
|
|
249
|
-
function y() {
|
|
250
|
-
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(N);
|
|
352
|
+
return /* @__PURE__ */ c(h.Provider, { value: t, children: e });
|
|
251
353
|
}
|
|
252
|
-
|
|
253
|
-
const n = y();
|
|
254
|
-
return n ? (n.addEventListener("change", e), () => {
|
|
255
|
-
n.removeEventListener("change", e);
|
|
256
|
-
}) : () => {
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
function H() {
|
|
260
|
-
const e = y();
|
|
261
|
-
return e ? e.matches : !1;
|
|
262
|
-
}
|
|
263
|
-
function F() {
|
|
264
|
-
return !1;
|
|
265
|
-
}
|
|
266
|
-
function R() {
|
|
267
|
-
return _(x, H, F);
|
|
268
|
-
}
|
|
269
|
-
const B = {
|
|
354
|
+
const Q = {
|
|
270
355
|
position: "relative",
|
|
271
356
|
pointerEvents: "auto"
|
|
272
357
|
};
|
|
273
|
-
function
|
|
274
|
-
return /* @__PURE__ */
|
|
358
|
+
function W({ children: e, onClose: n, footer: t }) {
|
|
359
|
+
return /* @__PURE__ */ C(
|
|
275
360
|
"div",
|
|
276
361
|
{
|
|
277
362
|
"data-chrome": "panel",
|
|
278
363
|
role: "dialog",
|
|
279
364
|
"aria-modal": "true",
|
|
280
365
|
className: "gloss-panel-chrome",
|
|
281
|
-
style:
|
|
366
|
+
style: Q,
|
|
282
367
|
children: [
|
|
283
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ c("div", { className: "gloss-panel-chrome__header", children: /* @__PURE__ */ c(
|
|
284
369
|
"button",
|
|
285
370
|
{
|
|
286
371
|
id: "panel-close",
|
|
@@ -291,13 +376,13 @@ function A({ children: e, onClose: n, footer: t }) {
|
|
|
291
376
|
children: "×"
|
|
292
377
|
}
|
|
293
378
|
) }),
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
t != null && /* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ c("div", { className: "gloss-panel-chrome__body", children: e }),
|
|
380
|
+
t != null && /* @__PURE__ */ c("div", { className: "gloss-panel-chrome__footer", children: t })
|
|
296
381
|
]
|
|
297
382
|
}
|
|
298
383
|
);
|
|
299
384
|
}
|
|
300
|
-
function
|
|
385
|
+
function G(e) {
|
|
301
386
|
if (process.env.NODE_ENV === "production" || !e || !e.parentElement) return;
|
|
302
387
|
const n = e.parentElement, t = window.getComputedStyle(n);
|
|
303
388
|
t.perspective === "none" && console.warn(
|
|
@@ -308,37 +393,37 @@ function k(e) {
|
|
|
308
393
|
n
|
|
309
394
|
);
|
|
310
395
|
}
|
|
311
|
-
function
|
|
312
|
-
const t =
|
|
313
|
-
|
|
314
|
-
|
|
396
|
+
function J({ isOpen: e, children: n }) {
|
|
397
|
+
const t = P(), r = g(null);
|
|
398
|
+
_(() => {
|
|
399
|
+
G(r.current);
|
|
315
400
|
}, []);
|
|
316
|
-
const [
|
|
317
|
-
|
|
401
|
+
const [l, a] = N(!1);
|
|
402
|
+
d(() => {
|
|
318
403
|
if (!e) {
|
|
319
|
-
|
|
404
|
+
a(!1);
|
|
320
405
|
return;
|
|
321
406
|
}
|
|
322
|
-
const
|
|
323
|
-
return () => cancelAnimationFrame(
|
|
407
|
+
const i = requestAnimationFrame(() => a(!0));
|
|
408
|
+
return () => cancelAnimationFrame(i);
|
|
324
409
|
}, [e]);
|
|
325
|
-
const
|
|
410
|
+
const s = [
|
|
326
411
|
"gloss-panel-mount",
|
|
327
|
-
|
|
412
|
+
l ? "has-panel" : "",
|
|
328
413
|
t ? "reduced-motion" : ""
|
|
329
414
|
].filter(Boolean).join(" ");
|
|
330
|
-
return /* @__PURE__ */
|
|
415
|
+
return /* @__PURE__ */ c(
|
|
331
416
|
"div",
|
|
332
417
|
{
|
|
333
418
|
ref: r,
|
|
334
|
-
className:
|
|
419
|
+
className: s,
|
|
335
420
|
"data-mount": "panel",
|
|
336
421
|
"data-open": e ? "true" : "false",
|
|
337
422
|
children: n
|
|
338
423
|
}
|
|
339
424
|
);
|
|
340
425
|
}
|
|
341
|
-
const
|
|
426
|
+
const X = {
|
|
342
427
|
position: "fixed",
|
|
343
428
|
top: 0,
|
|
344
429
|
left: 0,
|
|
@@ -349,7 +434,7 @@ const U = {
|
|
|
349
434
|
overflow: "visible",
|
|
350
435
|
pointerEvents: "none",
|
|
351
436
|
zIndex: 55
|
|
352
|
-
},
|
|
437
|
+
}, Z = {
|
|
353
438
|
position: "fixed",
|
|
354
439
|
top: "var(--tb-h, 60px)",
|
|
355
440
|
left: 0,
|
|
@@ -365,57 +450,57 @@ const U = {
|
|
|
365
450
|
pointerEvents: "none",
|
|
366
451
|
background: "rgba(0, 0, 0, 0.04)"
|
|
367
452
|
};
|
|
368
|
-
function
|
|
369
|
-
const { state: n, dispatch: t, getCloseLog: r } =
|
|
370
|
-
n.activePanelId && !
|
|
453
|
+
function oe({ panelComponents: e }) {
|
|
454
|
+
const { state: n, dispatch: t, getCloseLog: r } = B(), l = n.activePanelId ? e[n.activePanelId] : null;
|
|
455
|
+
n.activePanelId && !l && process.env.NODE_ENV !== "production" && console.error(
|
|
371
456
|
"[panels] No panel component registered for activePanelId:",
|
|
372
457
|
n.activePanelId
|
|
373
|
-
),
|
|
458
|
+
), d(() => {
|
|
374
459
|
if (n.activePanelId == null) return;
|
|
375
|
-
function
|
|
376
|
-
|
|
460
|
+
function u(E) {
|
|
461
|
+
E.key === "Escape" && t({ type: "CLOSE_PANEL", reason: "escape-key" });
|
|
377
462
|
}
|
|
378
|
-
return document.addEventListener("keydown",
|
|
379
|
-
document.removeEventListener("keydown",
|
|
463
|
+
return document.addEventListener("keydown", u), () => {
|
|
464
|
+
document.removeEventListener("keydown", u);
|
|
380
465
|
};
|
|
381
466
|
}, [n.activePanelId, t]);
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
}),
|
|
467
|
+
const a = g(n);
|
|
468
|
+
_(() => {
|
|
469
|
+
a.current = n;
|
|
470
|
+
}), d(() => {
|
|
386
471
|
if (process.env.NODE_ENV === "production") return;
|
|
387
|
-
const
|
|
388
|
-
return
|
|
472
|
+
const u = window;
|
|
473
|
+
return u.__panelsHostHandle && console.warn("[panels] multiple PanelHost/PanelHostShell instances mounted; dev handle is unreliable"), u.__panelsHostHandle = {
|
|
389
474
|
dispatch: t,
|
|
390
|
-
getState: () =>
|
|
475
|
+
getState: () => a.current,
|
|
391
476
|
getCloseLog: r
|
|
392
477
|
}, () => {
|
|
393
|
-
|
|
478
|
+
u.__panelsHostHandle?.dispatch === t && delete u.__panelsHostHandle;
|
|
394
479
|
};
|
|
395
480
|
}, [t, r]);
|
|
396
|
-
const
|
|
481
|
+
const s = I(() => {
|
|
397
482
|
t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
|
|
398
|
-
}, [t]),
|
|
399
|
-
return /* @__PURE__ */
|
|
400
|
-
|
|
483
|
+
}, [t]), i = n.activePanelId != null && l != null;
|
|
484
|
+
return /* @__PURE__ */ C("div", { "data-panel-host": "true", style: X, children: [
|
|
485
|
+
i && /* @__PURE__ */ c(
|
|
401
486
|
"div",
|
|
402
487
|
{
|
|
403
488
|
"data-panel-scrim": "true",
|
|
404
|
-
style:
|
|
405
|
-
onClick:
|
|
489
|
+
style: Z,
|
|
490
|
+
onClick: s
|
|
406
491
|
}
|
|
407
492
|
),
|
|
408
|
-
/* @__PURE__ */
|
|
409
|
-
|
|
493
|
+
/* @__PURE__ */ c(J, { isOpen: i, children: i && /* @__PURE__ */ c(
|
|
494
|
+
W,
|
|
410
495
|
{
|
|
411
496
|
isOpen: !0,
|
|
412
497
|
onClose: () => t({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
413
|
-
children: /* @__PURE__ */
|
|
498
|
+
children: /* @__PURE__ */ c(l, { isOpen: !0 })
|
|
414
499
|
}
|
|
415
500
|
) })
|
|
416
501
|
] });
|
|
417
502
|
}
|
|
418
|
-
const
|
|
503
|
+
const ae = {
|
|
419
504
|
"apply-button": !0,
|
|
420
505
|
// the ONLY commit reason
|
|
421
506
|
"cancel-button": !1,
|
|
@@ -429,16 +514,17 @@ const Q = {
|
|
|
429
514
|
"nav-escape-hatch": !1
|
|
430
515
|
};
|
|
431
516
|
export {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
517
|
+
ae as C,
|
|
518
|
+
le as P,
|
|
519
|
+
k as S,
|
|
520
|
+
B as a,
|
|
521
|
+
oe as b,
|
|
522
|
+
W as c,
|
|
523
|
+
$ as d,
|
|
524
|
+
Y as e,
|
|
525
|
+
P as f,
|
|
526
|
+
J as g,
|
|
527
|
+
j as i,
|
|
528
|
+
z as r,
|
|
529
|
+
ie as u
|
|
444
530
|
};
|