@mt-gloss/ui 0.1.84 → 0.1.86
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-6U31xb_s.js +303 -0
- package/composites-panels.js +64 -31
- package/index.js +1 -1
- package/lib/composites/panels/PanelChrome.d.ts +3 -1
- package/lib/composites/panels/coordinator/coordinator.d.ts +5 -0
- package/lib/composites/panels/coordinator/types.d.ts +40 -5
- package/lib/composites/panels/index.d.ts +1 -0
- package/lib/composites/panels/shells/SettingsShell.d.ts +2 -0
- package/lib/composites/panels/shells/index.d.ts +4 -0
- package/package.json +1 -1
- package/ui.css +1 -1
- package/COMMITS-or4m2o8k.js +0 -219
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { jsx as i, jsxs as f, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as I, useContext as p, useReducer as S, useRef as s, useEffect as c, useMemo as E, useCallback as C, useLayoutEffect as _ } from "react";
|
|
3
|
+
const u = I(null);
|
|
4
|
+
function h() {
|
|
5
|
+
const e = p(u);
|
|
6
|
+
if (!e)
|
|
7
|
+
throw new Error(
|
|
8
|
+
"[panels] usePanelContext must be used inside <PanelProvider>. See @mt-gloss/ui/composites/panels."
|
|
9
|
+
);
|
|
10
|
+
return e;
|
|
11
|
+
}
|
|
12
|
+
function w() {
|
|
13
|
+
return p(u);
|
|
14
|
+
}
|
|
15
|
+
const y = {
|
|
16
|
+
activePanelId: null,
|
|
17
|
+
activeTrigger: null,
|
|
18
|
+
bellCutoutOpen: !1,
|
|
19
|
+
isDirty: !1,
|
|
20
|
+
lockHint: null,
|
|
21
|
+
lastClose: null,
|
|
22
|
+
pendingSideEffects: []
|
|
23
|
+
}, P = /* @__PURE__ */ new Set(["settings"]);
|
|
24
|
+
function O(e, n) {
|
|
25
|
+
return e == null ? !1 : JSON.stringify(e) === JSON.stringify(n);
|
|
26
|
+
}
|
|
27
|
+
function m(e, n) {
|
|
28
|
+
switch (n.type) {
|
|
29
|
+
case "OPEN_PANEL": {
|
|
30
|
+
if (e.activePanelId && e.isDirty)
|
|
31
|
+
return {
|
|
32
|
+
...e,
|
|
33
|
+
pendingSideEffects: [
|
|
34
|
+
...e.pendingSideEffects,
|
|
35
|
+
{
|
|
36
|
+
type: "SET_LOCK_HINT",
|
|
37
|
+
hint: {
|
|
38
|
+
blockedTrigger: n.trigger,
|
|
39
|
+
activeCardId: e.activeTrigger?.cardId ?? null,
|
|
40
|
+
expiresAt: Date.now() + 4e3
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
};
|
|
45
|
+
if (e.activePanelId === n.panelId && O(e.activeTrigger, n.trigger))
|
|
46
|
+
return e;
|
|
47
|
+
const t = e.activePanelId != null ? [
|
|
48
|
+
{
|
|
49
|
+
type: "HANDOFF_CLOSE",
|
|
50
|
+
reason: "mutex-handoff",
|
|
51
|
+
previousPanelId: e.activePanelId
|
|
52
|
+
}
|
|
53
|
+
] : [], l = n.panelId === "notification-center" && e.bellCutoutOpen;
|
|
54
|
+
return {
|
|
55
|
+
...e,
|
|
56
|
+
activePanelId: n.panelId,
|
|
57
|
+
activeTrigger: n.trigger,
|
|
58
|
+
isDirty: !1,
|
|
59
|
+
bellCutoutOpen: l ? !1 : e.bellCutoutOpen,
|
|
60
|
+
lastClose: null,
|
|
61
|
+
// reset on fresh open
|
|
62
|
+
pendingSideEffects: [...e.pendingSideEffects, ...t]
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
case "CLOSE_PANEL": {
|
|
66
|
+
if (e.activePanelId == null)
|
|
67
|
+
return e;
|
|
68
|
+
const t = e.activePanelId, l = e.isDirty ? n.reason === "apply-button" ? [{ type: "COMMIT_BUFFER" }] : [{ type: "DISCARD_BUFFER" }] : [];
|
|
69
|
+
return {
|
|
70
|
+
...e,
|
|
71
|
+
activePanelId: null,
|
|
72
|
+
activeTrigger: null,
|
|
73
|
+
isDirty: !1,
|
|
74
|
+
lockHint: null,
|
|
75
|
+
// closing clears any active lockHint (dirty-buffer condition gone)
|
|
76
|
+
lastClose: { panelId: t, reason: n.reason },
|
|
77
|
+
pendingSideEffects: [...e.pendingSideEffects, ...l]
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
case "OPEN_BELL_CUTOUT":
|
|
81
|
+
return e.bellCutoutOpen ? e : e.activePanelId === "notification-center" ? {
|
|
82
|
+
...e,
|
|
83
|
+
activePanelId: null,
|
|
84
|
+
activeTrigger: null,
|
|
85
|
+
bellCutoutOpen: !0,
|
|
86
|
+
pendingSideEffects: [
|
|
87
|
+
...e.pendingSideEffects,
|
|
88
|
+
{ type: "AUTO_CLOSE_NOTIF_CENTER" }
|
|
89
|
+
]
|
|
90
|
+
} : { ...e, bellCutoutOpen: !0 };
|
|
91
|
+
case "CLOSE_BELL_CUTOUT":
|
|
92
|
+
return e.bellCutoutOpen ? { ...e, bellCutoutOpen: !1 } : e;
|
|
93
|
+
case "BUFFER_BECOMES_DIRTY":
|
|
94
|
+
return e.activePanelId == null || !P.has(e.activePanelId) ? {
|
|
95
|
+
...e,
|
|
96
|
+
pendingSideEffects: [
|
|
97
|
+
...e.pendingSideEffects,
|
|
98
|
+
{ type: "INVALID_DISPATCH", reason: "no-buffer-panel" }
|
|
99
|
+
]
|
|
100
|
+
} : e.isDirty ? e : { ...e, isDirty: !0 };
|
|
101
|
+
case "BUFFER_BECOMES_CLEAN":
|
|
102
|
+
return e.isDirty ? { ...e, isDirty: !1 } : e;
|
|
103
|
+
case "SET_LOCK_HINT":
|
|
104
|
+
return {
|
|
105
|
+
...e,
|
|
106
|
+
lockHint: n.hint,
|
|
107
|
+
pendingSideEffects: [
|
|
108
|
+
...e.pendingSideEffects,
|
|
109
|
+
{
|
|
110
|
+
type: "SCHEDULE_TIMER",
|
|
111
|
+
ms: Math.max(0, n.hint.expiresAt - Date.now()),
|
|
112
|
+
action: { type: "CLEAR_LOCK_HINT" }
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
};
|
|
116
|
+
case "CLEAR_LOCK_HINT":
|
|
117
|
+
return e.lockHint == null ? e : { ...e, lockHint: null };
|
|
118
|
+
case "DRAIN_SIDE_EFFECTS":
|
|
119
|
+
return e.pendingSideEffects.length === 0 ? e : {
|
|
120
|
+
...e,
|
|
121
|
+
pendingSideEffects: []
|
|
122
|
+
};
|
|
123
|
+
default:
|
|
124
|
+
return e;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function L(e) {
|
|
128
|
+
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";
|
|
129
|
+
}
|
|
130
|
+
function N() {
|
|
131
|
+
const [e, n] = S(m, y), t = s([]), l = s(null);
|
|
132
|
+
c(() => {
|
|
133
|
+
if (e.pendingSideEffects.length !== 0) {
|
|
134
|
+
for (const r of e.pendingSideEffects)
|
|
135
|
+
r.type === "SCHEDULE_TIMER" ? (l.current != null && window.clearTimeout(l.current), l.current = window.setTimeout(() => {
|
|
136
|
+
l.current = null, n(r.action);
|
|
137
|
+
}, Math.max(0, r.ms))) : r.type === "SET_LOCK_HINT" ? n({ type: "SET_LOCK_HINT", hint: r.hint }) : r.type === "HANDOFF_CLOSE" ? t.current = [
|
|
138
|
+
...t.current.slice(-99),
|
|
139
|
+
{
|
|
140
|
+
panelId: r.previousPanelId,
|
|
141
|
+
reason: "mutex-handoff",
|
|
142
|
+
at: Date.now(),
|
|
143
|
+
note: "F22: mutex-handoff synthetic close-log entry"
|
|
144
|
+
}
|
|
145
|
+
] : r.type === "INVALID_DISPATCH" && process.env.NODE_ENV !== "production" && console.warn("[panels] INVALID_DISPATCH:", r.reason);
|
|
146
|
+
n({ type: "DRAIN_SIDE_EFFECTS" });
|
|
147
|
+
}
|
|
148
|
+
}, [e.pendingSideEffects]), c(() => {
|
|
149
|
+
if (!e.lastClose) return;
|
|
150
|
+
const r = {
|
|
151
|
+
panelId: e.lastClose.panelId,
|
|
152
|
+
reason: e.lastClose.reason,
|
|
153
|
+
at: Date.now(),
|
|
154
|
+
note: e.lastClose.reason === "nav-escape-hatch" ? "F21: backdrop-click OR page-nav escape" : void 0
|
|
155
|
+
};
|
|
156
|
+
t.current = [
|
|
157
|
+
...t.current.slice(-99),
|
|
158
|
+
r
|
|
159
|
+
];
|
|
160
|
+
}, [e.lastClose]);
|
|
161
|
+
const o = E(
|
|
162
|
+
() => L(e),
|
|
163
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
164
|
+
[e.activePanelId, e.bellCutoutOpen, e.isDirty]
|
|
165
|
+
), a = C(() => t.current.slice(), []);
|
|
166
|
+
return { state: e, surfaceState: o, dispatch: n, getCloseLog: a };
|
|
167
|
+
}
|
|
168
|
+
function F({ children: e }) {
|
|
169
|
+
const n = N(), t = E(
|
|
170
|
+
() => n,
|
|
171
|
+
// Re-publish only when one of the four coordinator fields changes identity.
|
|
172
|
+
// dispatch + getCloseLog are stable. state + surfaceState change on dispatch.
|
|
173
|
+
[n.state, n.surfaceState, n.dispatch, n.getCloseLog]
|
|
174
|
+
);
|
|
175
|
+
return /* @__PURE__ */ i(u.Provider, { value: t, children: e });
|
|
176
|
+
}
|
|
177
|
+
const T = {
|
|
178
|
+
position: "relative",
|
|
179
|
+
pointerEvents: "auto"
|
|
180
|
+
};
|
|
181
|
+
function D({ children: e, onClose: n, isOpen: t = !0, footer: l }) {
|
|
182
|
+
return /* @__PURE__ */ f(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
"data-chrome": "panel",
|
|
186
|
+
"data-open": t ? "true" : "false",
|
|
187
|
+
role: "dialog",
|
|
188
|
+
"aria-modal": "true",
|
|
189
|
+
className: "gloss-panel-chrome",
|
|
190
|
+
style: T,
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ i("div", { className: "gloss-panel-chrome__header", children: /* @__PURE__ */ i(
|
|
193
|
+
"button",
|
|
194
|
+
{
|
|
195
|
+
id: "panel-close",
|
|
196
|
+
type: "button",
|
|
197
|
+
"aria-label": "Close panel",
|
|
198
|
+
className: "gloss-panel-chrome__close",
|
|
199
|
+
onClick: n,
|
|
200
|
+
children: "×"
|
|
201
|
+
}
|
|
202
|
+
) }),
|
|
203
|
+
/* @__PURE__ */ i("div", { className: "gloss-panel-chrome__body", children: e }),
|
|
204
|
+
l != null && /* @__PURE__ */ i("div", { className: "gloss-panel-chrome__footer", children: l })
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
const b = {
|
|
210
|
+
position: "fixed",
|
|
211
|
+
top: 0,
|
|
212
|
+
left: 0,
|
|
213
|
+
right: 0,
|
|
214
|
+
height: "var(--tb-h, 60px)",
|
|
215
|
+
perspective: "1200px",
|
|
216
|
+
perspectiveOrigin: "center bottom",
|
|
217
|
+
overflow: "visible",
|
|
218
|
+
pointerEvents: "none",
|
|
219
|
+
zIndex: 55
|
|
220
|
+
}, x = {
|
|
221
|
+
position: "fixed",
|
|
222
|
+
top: "var(--tb-h, 60px)",
|
|
223
|
+
left: 0,
|
|
224
|
+
right: 0,
|
|
225
|
+
bottom: 0,
|
|
226
|
+
zIndex: 1,
|
|
227
|
+
pointerEvents: "auto",
|
|
228
|
+
background: "rgba(0, 0, 0, 0.04)"
|
|
229
|
+
};
|
|
230
|
+
function R({ panelComponents: e }) {
|
|
231
|
+
const { state: n, dispatch: t, getCloseLog: l } = h(), o = n.activePanelId ? e[n.activePanelId] : null;
|
|
232
|
+
n.activePanelId && !o && process.env.NODE_ENV !== "production" && console.error(
|
|
233
|
+
"[panels] No panel component registered for activePanelId:",
|
|
234
|
+
n.activePanelId
|
|
235
|
+
), c(() => {
|
|
236
|
+
if (n.activePanelId == null) return;
|
|
237
|
+
function d(g) {
|
|
238
|
+
g.key === "Escape" && t({ type: "CLOSE_PANEL", reason: "escape-key" });
|
|
239
|
+
}
|
|
240
|
+
return document.addEventListener("keydown", d), () => {
|
|
241
|
+
document.removeEventListener("keydown", d);
|
|
242
|
+
};
|
|
243
|
+
}, [n.activePanelId, t]);
|
|
244
|
+
const a = s(n);
|
|
245
|
+
_(() => {
|
|
246
|
+
a.current = n;
|
|
247
|
+
}), c(() => {
|
|
248
|
+
if (process.env.NODE_ENV !== "production")
|
|
249
|
+
return window.__panelsHostHandle = {
|
|
250
|
+
dispatch: t,
|
|
251
|
+
getState: () => a.current,
|
|
252
|
+
getCloseLog: l
|
|
253
|
+
}, () => {
|
|
254
|
+
delete window.__panelsHostHandle;
|
|
255
|
+
};
|
|
256
|
+
}, [t, l]);
|
|
257
|
+
const r = C(() => {
|
|
258
|
+
t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
|
|
259
|
+
}, [t]);
|
|
260
|
+
return /* @__PURE__ */ i("div", { "data-panel-host": "true", style: b, children: n.activePanelId != null && o != null && /* @__PURE__ */ f(v, { children: [
|
|
261
|
+
/* @__PURE__ */ i(
|
|
262
|
+
"div",
|
|
263
|
+
{
|
|
264
|
+
"data-panel-scrim": "true",
|
|
265
|
+
style: x,
|
|
266
|
+
onClick: r
|
|
267
|
+
}
|
|
268
|
+
),
|
|
269
|
+
/* @__PURE__ */ i(
|
|
270
|
+
D,
|
|
271
|
+
{
|
|
272
|
+
isOpen: !0,
|
|
273
|
+
onClose: () => t({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
274
|
+
children: /* @__PURE__ */ i(o, { isOpen: !0 })
|
|
275
|
+
}
|
|
276
|
+
)
|
|
277
|
+
] }) });
|
|
278
|
+
}
|
|
279
|
+
const k = {
|
|
280
|
+
"apply-button": !0,
|
|
281
|
+
// the ONLY commit reason
|
|
282
|
+
"cancel-button": !1,
|
|
283
|
+
"header-x": !1,
|
|
284
|
+
"escape-key": !1,
|
|
285
|
+
"page-nav": !1,
|
|
286
|
+
"mutex-handoff": !1,
|
|
287
|
+
"ghost-anchor": !1,
|
|
288
|
+
"viewport-collapse": !1,
|
|
289
|
+
unmount: !1,
|
|
290
|
+
"nav-escape-hatch": !1
|
|
291
|
+
};
|
|
292
|
+
export {
|
|
293
|
+
k as C,
|
|
294
|
+
F as P,
|
|
295
|
+
w as a,
|
|
296
|
+
R as b,
|
|
297
|
+
D as c,
|
|
298
|
+
N as d,
|
|
299
|
+
L as e,
|
|
300
|
+
y as i,
|
|
301
|
+
m as r,
|
|
302
|
+
h as u
|
|
303
|
+
};
|
package/composites-panels.js
CHANGED
|
@@ -1,30 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as
|
|
3
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
-
import { useEffect as l, useRef as
|
|
1
|
+
import { a as i, u, c as p } from "./COMMITS-6U31xb_s.js";
|
|
2
|
+
import { C as I, b as N, P as k, e as O, i as w, r as A, d as H } from "./COMMITS-6U31xb_s.js";
|
|
3
|
+
import { jsxs as c, jsx as r, Fragment as f } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect as l, useRef as m, useLayoutEffect as g, useCallback as P } from "react";
|
|
5
|
+
function S({ isOpen: n }) {
|
|
6
|
+
const t = i()?.state.activeTrigger, o = t?.kind === "card-overflow" ? t.cardId : null;
|
|
7
|
+
return n ? /* @__PURE__ */ c("div", { "data-shell": "settings", children: [
|
|
8
|
+
/* @__PURE__ */ r("p", { style: { margin: 0, fontSize: 14, color: "#495057" }, children: o ? `Settings for card: ${o}` : "Settings" }),
|
|
9
|
+
/* @__PURE__ */ r("p", { style: { margin: "8px 0 0", fontSize: 12, color: "#adb5bd" }, children: "Configuration options coming soon." })
|
|
10
|
+
] }) : null;
|
|
11
|
+
}
|
|
5
12
|
const v = {
|
|
6
13
|
position: "fixed",
|
|
7
14
|
inset: 0,
|
|
8
15
|
pointerEvents: "none",
|
|
9
16
|
zIndex: 55
|
|
10
|
-
},
|
|
17
|
+
}, y = {
|
|
11
18
|
position: "absolute",
|
|
12
19
|
inset: 0,
|
|
13
20
|
zIndex: 1,
|
|
14
21
|
pointerEvents: "auto",
|
|
15
22
|
background: "rgba(0, 0, 0, 0.04)"
|
|
16
23
|
};
|
|
17
|
-
function
|
|
18
|
-
const { state: n, dispatch: e, getCloseLog: t } =
|
|
24
|
+
function _() {
|
|
25
|
+
const { state: n, dispatch: e, getCloseLog: t } = u();
|
|
19
26
|
l(() => {
|
|
20
27
|
if (n.activePanelId == null) return;
|
|
21
|
-
function s(
|
|
22
|
-
|
|
28
|
+
function s(d) {
|
|
29
|
+
d.key === "Escape" && e({ type: "CLOSE_PANEL", reason: "escape-key" });
|
|
23
30
|
}
|
|
24
31
|
return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
|
|
25
32
|
}, [n.activePanelId, e]);
|
|
26
|
-
const o =
|
|
27
|
-
|
|
33
|
+
const o = m(n);
|
|
34
|
+
g(() => {
|
|
28
35
|
o.current = n;
|
|
29
36
|
}), l(() => {
|
|
30
37
|
if (process.env.NODE_ENV !== "production")
|
|
@@ -43,40 +50,66 @@ function S() {
|
|
|
43
50
|
"div",
|
|
44
51
|
{
|
|
45
52
|
"data-panel-scrim": "true",
|
|
46
|
-
style:
|
|
53
|
+
style: y,
|
|
47
54
|
onClick: a
|
|
48
55
|
}
|
|
49
56
|
) });
|
|
50
57
|
}
|
|
51
|
-
function
|
|
52
|
-
const e =
|
|
58
|
+
function b({ panelComponents: n }) {
|
|
59
|
+
const e = i();
|
|
53
60
|
if (e == null) return null;
|
|
54
61
|
const { state: t, dispatch: o } = e;
|
|
55
62
|
if (t.activePanelId == null) return null;
|
|
56
63
|
const a = n[t.activePanelId];
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
if (a == null)
|
|
65
|
+
return process.env.NODE_ENV !== "production" && console.error(
|
|
66
|
+
"[panels] No panel component registered for activePanelId:",
|
|
67
|
+
t.activePanelId
|
|
68
|
+
), null;
|
|
69
|
+
const s = t.activePanelId === "settings" ? /* @__PURE__ */ c(f, { children: [
|
|
70
|
+
/* @__PURE__ */ r(
|
|
71
|
+
"button",
|
|
72
|
+
{
|
|
73
|
+
id: "settings-cancel",
|
|
74
|
+
type: "button",
|
|
75
|
+
className: "gloss-panel-chrome__footer-btn",
|
|
76
|
+
onClick: () => o({ type: "CLOSE_PANEL", reason: "cancel-button" }),
|
|
77
|
+
children: "Cancel"
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ r(
|
|
81
|
+
"button",
|
|
82
|
+
{
|
|
83
|
+
id: "settings-apply",
|
|
84
|
+
type: "button",
|
|
85
|
+
className: "gloss-panel-chrome__footer-btn gloss-panel-chrome__footer-btn--primary",
|
|
86
|
+
onClick: () => o({ type: "CLOSE_PANEL", reason: "apply-button" }),
|
|
87
|
+
children: "Apply"
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] }) : null;
|
|
91
|
+
return /* @__PURE__ */ r(
|
|
92
|
+
p,
|
|
62
93
|
{
|
|
63
94
|
isOpen: !0,
|
|
64
95
|
onClose: () => o({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
96
|
+
footer: s,
|
|
65
97
|
children: /* @__PURE__ */ r(a, { isOpen: !0 })
|
|
66
98
|
}
|
|
67
99
|
);
|
|
68
100
|
}
|
|
69
101
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
w as
|
|
79
|
-
|
|
80
|
-
u as
|
|
81
|
-
|
|
102
|
+
I as COMMITS,
|
|
103
|
+
p as PanelChrome,
|
|
104
|
+
N as PanelHost,
|
|
105
|
+
_ as PanelHostShell,
|
|
106
|
+
k as PanelProvider,
|
|
107
|
+
b as PanelSlot,
|
|
108
|
+
S as SettingsShell,
|
|
109
|
+
O as deriveSurfaceState,
|
|
110
|
+
w as initialState,
|
|
111
|
+
A as reducer,
|
|
112
|
+
u as usePanelContext,
|
|
113
|
+
i as usePanelContextOptional,
|
|
114
|
+
H as usePanelCoordinator
|
|
82
115
|
};
|
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import F, { useRef as P, useEffect as A, useState as E, useCallback as C, useId
|
|
|
6
6
|
import { motion as G, useMotionValue as tt, AnimatePresence as at, useDragControls as nt } from "framer-motion";
|
|
7
7
|
import { B as rt, a as X, b as ce, U as fe } from "./UIContext-DP6JGCto.js";
|
|
8
8
|
import { c as Wo, u as Vo } from "./UIContext-DP6JGCto.js";
|
|
9
|
-
import { C as Uo, c as Yo, b as Zo, P as qo, e as Qo, i as Xo, r as Jo, u as el, a as tl, d as al } from "./COMMITS-
|
|
9
|
+
import { C as Uo, c as Yo, b as Zo, P as qo, e as Qo, i as Xo, r as Jo, u as el, a as tl, d as al } from "./COMMITS-6U31xb_s.js";
|
|
10
10
|
import { createPortal as st } from "react-dom";
|
|
11
11
|
import { DEFAULT_MARKET_PRESETS as rl, DEFAULT_PINNED as sl, PERIOD_OPTIONS as il, ROLLING_OPTIONS as ol, TODAY_PRESET as ll, findPreset as cl, formatDateRange as dl, formatMarketDates as ul, formatTrend as ml, formatValue as gl, generateMarketId as pl, getAllPresets as hl, getDateRangeForPreset as fl, getPresetLabel as bl, isInRange as vl, isMarketActive as yl, isSameDay as wl, normalizePresetId as _l, toUppercasePresetId as Cl } from "@mt-gloss/utils";
|
|
12
12
|
import it from "@mui/icons-material/AccessTime";
|
|
@@ -3,5 +3,7 @@ export interface PanelChromeProps {
|
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
isOpen?: boolean;
|
|
6
|
+
/** P2 — optional footer slot. Notification-center keeps null (no footer). */
|
|
7
|
+
footer?: ReactNode;
|
|
6
8
|
}
|
|
7
|
-
export declare function PanelChrome({ children, onClose, isOpen }: PanelChromeProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function PanelChrome({ children, onClose, isOpen, footer }: PanelChromeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { PanelAction, PanelState } from './types';
|
|
2
2
|
export declare const initialState: PanelState;
|
|
3
|
+
/**
|
|
4
|
+
* Set of PanelIds that support the dirty-buffer flow.
|
|
5
|
+
* Only 'settings' in P2; future panels added here when P6+ wires buffer-becomes-dirty.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PANELS_WITH_BUFFER: Set<string>;
|
|
3
8
|
export declare function reducer(state: PanelState, action: PanelAction): PanelState;
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
* derivation in P1 reaches `'idle'` + `'notif-center'` only; other branches return
|
|
10
10
|
* `'idle'` with a TODO until P2 extends the reducer to full 7-state.
|
|
11
11
|
*
|
|
12
|
+
* P2 reach: full 7-state machine. All PanelIds supported. PanelState gains
|
|
13
|
+
* activeTrigger, bellCutoutOpen, isDirty, lockHint. PanelAction gains 6 new
|
|
14
|
+
* variants. SideEffect gains 5 new variants.
|
|
15
|
+
*
|
|
12
16
|
* Plan refs:
|
|
13
17
|
* F1 — exhaustive types ship Day 1
|
|
14
18
|
* F4 — `lastClose` carries `{ panelId, reason }` so closeLog pump can append
|
|
@@ -48,9 +52,15 @@ export interface CloseLogEntry {
|
|
|
48
52
|
* F21 — When `reason === 'nav-escape-hatch'`, the same enum literal fires for
|
|
49
53
|
* both backdrop-click AND page-nav escape. Future analytics MUST inspect this
|
|
50
54
|
* note before attributing UX intent.
|
|
55
|
+
* F22 — When `reason === 'mutex-handoff'`, synthetic close-log entry from pump 1.
|
|
51
56
|
*/
|
|
52
57
|
note?: string;
|
|
53
58
|
}
|
|
59
|
+
export interface LockHint {
|
|
60
|
+
blockedTrigger: TriggerContext;
|
|
61
|
+
activeCardId: string | null;
|
|
62
|
+
expiresAt: number;
|
|
63
|
+
}
|
|
54
64
|
export type SideEffect = {
|
|
55
65
|
type: 'SCHEDULE_TIMER';
|
|
56
66
|
ms: number;
|
|
@@ -58,9 +68,26 @@ export type SideEffect = {
|
|
|
58
68
|
} | {
|
|
59
69
|
type: 'INVALID_DISPATCH';
|
|
60
70
|
reason: string;
|
|
71
|
+
} | {
|
|
72
|
+
type: 'SET_LOCK_HINT';
|
|
73
|
+
hint: LockHint;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'HANDOFF_CLOSE';
|
|
76
|
+
reason: CloseReason;
|
|
77
|
+
previousPanelId: PanelId;
|
|
78
|
+
} | {
|
|
79
|
+
type: 'COMMIT_BUFFER';
|
|
80
|
+
} | {
|
|
81
|
+
type: 'DISCARD_BUFFER';
|
|
82
|
+
} | {
|
|
83
|
+
type: 'AUTO_CLOSE_NOTIF_CENTER';
|
|
61
84
|
};
|
|
62
85
|
export interface PanelState {
|
|
63
86
|
activePanelId: PanelId | null;
|
|
87
|
+
activeTrigger: TriggerContext | null;
|
|
88
|
+
bellCutoutOpen: boolean;
|
|
89
|
+
isDirty: boolean;
|
|
90
|
+
lockHint: LockHint | null;
|
|
64
91
|
lastClose: {
|
|
65
92
|
panelId: PanelId;
|
|
66
93
|
reason: CloseReason;
|
|
@@ -74,11 +101,19 @@ export type PanelAction = {
|
|
|
74
101
|
} | {
|
|
75
102
|
type: 'CLOSE_PANEL';
|
|
76
103
|
reason: CloseReason;
|
|
104
|
+
} | {
|
|
105
|
+
type: 'OPEN_BELL_CUTOUT';
|
|
106
|
+
} | {
|
|
107
|
+
type: 'CLOSE_BELL_CUTOUT';
|
|
108
|
+
} | {
|
|
109
|
+
type: 'BUFFER_BECOMES_DIRTY';
|
|
110
|
+
} | {
|
|
111
|
+
type: 'BUFFER_BECOMES_CLEAN';
|
|
112
|
+
} | {
|
|
113
|
+
type: 'SET_LOCK_HINT';
|
|
114
|
+
hint: LockHint;
|
|
115
|
+
} | {
|
|
116
|
+
type: 'CLEAR_LOCK_HINT';
|
|
77
117
|
} | {
|
|
78
118
|
type: 'DRAIN_SIDE_EFFECTS';
|
|
79
119
|
};
|
|
80
|
-
export interface LockHint {
|
|
81
|
-
blockedTrigger: TriggerContext;
|
|
82
|
-
activeCardId: string | null;
|
|
83
|
-
expiresAt: number;
|
|
84
|
-
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* `composites-panels.js` matching existing `internals` + `catalog` pattern.
|
|
9
9
|
*/
|
|
10
10
|
export { PanelProvider, usePanelContext, usePanelContextOptional } from './PanelProvider';
|
|
11
|
+
export { SettingsShell } from './shells/SettingsShell';
|
|
11
12
|
export { PanelHost } from './PanelHost';
|
|
12
13
|
export { PanelHostShell } from './PanelHostShell';
|
|
13
14
|
export { PanelSlot } from './PanelSlot';
|