@mt-gloss/ui 0.1.93 → 0.1.95
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-DAem0P4s.js → COMMITS-By42AA8m.js} +93 -77
- package/composites-panels.js +226 -53
- package/index.js +1 -1
- package/lib/composites/panels/asserter/domWalkAsserter.d.ts +17 -0
- package/lib/composites/panels/hooks/useTransitionToPanel.d.ts +2 -0
- package/lib/composites/panels/index.d.ts +9 -0
- package/lib/composites/panels/orchestrator/transitionToPanel.d.ts +21 -0
- package/lib/composites/panels/shells/SettingsShell.d.ts +9 -1
- package/lib/composites/panels/stage3d/CloneCard.d.ts +7 -0
- package/lib/composites/panels/stage3d/CloneStage.d.ts +5 -0
- package/package.json +1 -1
- package/ui.css +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
const f =
|
|
1
|
+
import { jsx as o, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as I, useContext as E, useReducer as P, useRef as d, useEffect as s, useMemo as v, useCallback as g, useSyncExternalStore as S, useLayoutEffect as C, useState as _ } from "react";
|
|
3
|
+
const f = I(null);
|
|
4
4
|
function y() {
|
|
5
5
|
const e = E(f);
|
|
6
6
|
if (!e)
|
|
@@ -9,7 +9,7 @@ function y() {
|
|
|
9
9
|
);
|
|
10
10
|
return e;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function j() {
|
|
13
13
|
return E(f);
|
|
14
14
|
}
|
|
15
15
|
const O = {
|
|
@@ -20,8 +20,8 @@ const O = {
|
|
|
20
20
|
lockHint: null,
|
|
21
21
|
lastClose: null,
|
|
22
22
|
pendingSideEffects: []
|
|
23
|
-
},
|
|
24
|
-
function
|
|
23
|
+
}, w = /* @__PURE__ */ new Set(["settings"]);
|
|
24
|
+
function L(e, n) {
|
|
25
25
|
if (e == null || e.kind !== n.kind) return !1;
|
|
26
26
|
switch (e.kind) {
|
|
27
27
|
case "bell":
|
|
@@ -34,7 +34,7 @@ function T(e, n) {
|
|
|
34
34
|
return e.global === n.global && e.align === n.align;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function N(e, n) {
|
|
38
38
|
switch (n.type) {
|
|
39
39
|
case "OPEN_PANEL": {
|
|
40
40
|
if (e.activePanelId && e.isDirty)
|
|
@@ -52,7 +52,7 @@ function D(e, n) {
|
|
|
52
52
|
}
|
|
53
53
|
]
|
|
54
54
|
};
|
|
55
|
-
if (e.activePanelId === n.panelId &&
|
|
55
|
+
if (e.activePanelId === n.panelId && L(e.activeTrigger, n.trigger))
|
|
56
56
|
return e;
|
|
57
57
|
const t = e.activePanelId != null ? [
|
|
58
58
|
{
|
|
@@ -101,7 +101,7 @@ function D(e, n) {
|
|
|
101
101
|
case "CLOSE_BELL_CUTOUT":
|
|
102
102
|
return e.bellCutoutOpen ? { ...e, bellCutoutOpen: !1 } : e;
|
|
103
103
|
case "BUFFER_BECOMES_DIRTY":
|
|
104
|
-
return e.activePanelId == null || !
|
|
104
|
+
return e.activePanelId == null || !w.has(e.activePanelId) ? {
|
|
105
105
|
...e,
|
|
106
106
|
pendingSideEffects: [
|
|
107
107
|
...e.pendingSideEffects,
|
|
@@ -134,11 +134,11 @@ function D(e, n) {
|
|
|
134
134
|
return e;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function T(e) {
|
|
138
138
|
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";
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
const [e, n] =
|
|
140
|
+
function D() {
|
|
141
|
+
const [e, n] = P(N, O), t = d([]), r = d(null);
|
|
142
142
|
s(() => () => {
|
|
143
143
|
r.current != null && (window.clearTimeout(r.current), r.current = null);
|
|
144
144
|
}, []), s(() => {
|
|
@@ -170,26 +170,47 @@ function w() {
|
|
|
170
170
|
l
|
|
171
171
|
];
|
|
172
172
|
}, [e.lastClose]);
|
|
173
|
-
const
|
|
174
|
-
() =>
|
|
173
|
+
const i = v(
|
|
174
|
+
() => T(e),
|
|
175
175
|
[e.activePanelId, e.bellCutoutOpen, e.isDirty]
|
|
176
|
-
), a =
|
|
177
|
-
return { state: e, surfaceState:
|
|
176
|
+
), a = g(() => t.current.slice(), []);
|
|
177
|
+
return { state: e, surfaceState: i, dispatch: n, getCloseLog: a };
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
const n =
|
|
179
|
+
function Y({ children: e }) {
|
|
180
|
+
const n = D(), t = v(
|
|
181
181
|
() => n,
|
|
182
182
|
// Re-publish only when one of the four coordinator fields changes identity.
|
|
183
183
|
// dispatch + getCloseLog are stable. state + surfaceState change on dispatch.
|
|
184
184
|
[n.state, n.surfaceState, n.dispatch, n.getCloseLog]
|
|
185
185
|
);
|
|
186
|
-
return /* @__PURE__ */
|
|
186
|
+
return /* @__PURE__ */ o(f.Provider, { value: t, children: e });
|
|
187
187
|
}
|
|
188
|
-
const x =
|
|
188
|
+
const x = "(prefers-reduced-motion: reduce)";
|
|
189
|
+
function h() {
|
|
190
|
+
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(x);
|
|
191
|
+
}
|
|
192
|
+
function H(e) {
|
|
193
|
+
const n = h();
|
|
194
|
+
return n ? (n.addEventListener("change", e), () => {
|
|
195
|
+
n.removeEventListener("change", e);
|
|
196
|
+
}) : () => {
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function b() {
|
|
200
|
+
const e = h();
|
|
201
|
+
return e ? e.matches : !1;
|
|
202
|
+
}
|
|
203
|
+
function A() {
|
|
204
|
+
return !1;
|
|
205
|
+
}
|
|
206
|
+
function R() {
|
|
207
|
+
return S(H, b, A);
|
|
208
|
+
}
|
|
209
|
+
const F = {
|
|
189
210
|
position: "relative",
|
|
190
211
|
pointerEvents: "auto"
|
|
191
212
|
};
|
|
192
|
-
function
|
|
213
|
+
function k({ children: e, onClose: n, footer: t }) {
|
|
193
214
|
return /* @__PURE__ */ p(
|
|
194
215
|
"div",
|
|
195
216
|
{
|
|
@@ -197,9 +218,9 @@ function H({ children: e, onClose: n, footer: t }) {
|
|
|
197
218
|
role: "dialog",
|
|
198
219
|
"aria-modal": "true",
|
|
199
220
|
className: "gloss-panel-chrome",
|
|
200
|
-
style:
|
|
221
|
+
style: F,
|
|
201
222
|
children: [
|
|
202
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ o("div", { className: "gloss-panel-chrome__header", children: /* @__PURE__ */ o(
|
|
203
224
|
"button",
|
|
204
225
|
{
|
|
205
226
|
id: "panel-close",
|
|
@@ -210,59 +231,54 @@ function H({ children: e, onClose: n, footer: t }) {
|
|
|
210
231
|
children: "×"
|
|
211
232
|
}
|
|
212
233
|
) }),
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
t != null && /* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ o("div", { className: "gloss-panel-chrome__body", children: e }),
|
|
235
|
+
t != null && /* @__PURE__ */ o("div", { className: "gloss-panel-chrome__footer", children: t })
|
|
215
236
|
]
|
|
216
237
|
}
|
|
217
238
|
);
|
|
218
239
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
function F() {
|
|
231
|
-
const e = C();
|
|
232
|
-
return e ? e.matches : !1;
|
|
233
|
-
}
|
|
234
|
-
function R() {
|
|
235
|
-
return !1;
|
|
236
|
-
}
|
|
237
|
-
function k() {
|
|
238
|
-
return S(A, F, R);
|
|
240
|
+
function M(e) {
|
|
241
|
+
if (process.env.NODE_ENV === "production" || !e || !e.parentElement) return;
|
|
242
|
+
const n = e.parentElement, t = window.getComputedStyle(n);
|
|
243
|
+
t.perspective === "none" && console.warn(
|
|
244
|
+
"[PanelMount] §2.7 violation: parent of .gloss-panel-mount has perspective:none. Rotated mount will render flat. Parent:",
|
|
245
|
+
n
|
|
246
|
+
), (t.overflow === "hidden" || t.overflowY === "hidden") && console.warn(
|
|
247
|
+
"[PanelMount] §2.9 violation: parent of .gloss-panel-mount has overflow:hidden. Rising panel will be clipped. Parent:",
|
|
248
|
+
n
|
|
249
|
+
);
|
|
239
250
|
}
|
|
240
|
-
function
|
|
241
|
-
const t =
|
|
251
|
+
function U({ isOpen: e, children: n }) {
|
|
252
|
+
const t = R(), r = d(null);
|
|
253
|
+
C(() => {
|
|
254
|
+
M(r.current);
|
|
255
|
+
}, []);
|
|
256
|
+
const [i, a] = _(!1);
|
|
242
257
|
s(() => {
|
|
243
258
|
if (!e) {
|
|
244
|
-
|
|
259
|
+
a(!1);
|
|
245
260
|
return;
|
|
246
261
|
}
|
|
247
|
-
const
|
|
248
|
-
return () => cancelAnimationFrame(
|
|
262
|
+
const u = requestAnimationFrame(() => a(!0));
|
|
263
|
+
return () => cancelAnimationFrame(u);
|
|
249
264
|
}, [e]);
|
|
250
|
-
const
|
|
265
|
+
const l = [
|
|
251
266
|
"gloss-panel-mount",
|
|
252
|
-
|
|
267
|
+
i ? "has-panel" : "",
|
|
253
268
|
t ? "reduced-motion" : ""
|
|
254
269
|
].filter(Boolean).join(" ");
|
|
255
|
-
return /* @__PURE__ */
|
|
270
|
+
return /* @__PURE__ */ o(
|
|
256
271
|
"div",
|
|
257
272
|
{
|
|
258
|
-
|
|
273
|
+
ref: r,
|
|
274
|
+
className: l,
|
|
259
275
|
"data-mount": "panel",
|
|
260
276
|
"data-open": e ? "true" : "false",
|
|
261
277
|
children: n
|
|
262
278
|
}
|
|
263
279
|
);
|
|
264
280
|
}
|
|
265
|
-
const
|
|
281
|
+
const B = {
|
|
266
282
|
position: "fixed",
|
|
267
283
|
top: 0,
|
|
268
284
|
left: 0,
|
|
@@ -273,7 +289,7 @@ const U = {
|
|
|
273
289
|
overflow: "visible",
|
|
274
290
|
pointerEvents: "none",
|
|
275
291
|
zIndex: 55
|
|
276
|
-
},
|
|
292
|
+
}, K = {
|
|
277
293
|
position: "fixed",
|
|
278
294
|
top: "var(--tb-h, 60px)",
|
|
279
295
|
left: 0,
|
|
@@ -290,21 +306,21 @@ const U = {
|
|
|
290
306
|
background: "rgba(0, 0, 0, 0.04)"
|
|
291
307
|
};
|
|
292
308
|
function z({ panelComponents: e }) {
|
|
293
|
-
const { state: n, dispatch: t, getCloseLog: r } = y(),
|
|
294
|
-
n.activePanelId && !
|
|
309
|
+
const { state: n, dispatch: t, getCloseLog: r } = y(), i = n.activePanelId ? e[n.activePanelId] : null;
|
|
310
|
+
n.activePanelId && !i && process.env.NODE_ENV !== "production" && console.error(
|
|
295
311
|
"[panels] No panel component registered for activePanelId:",
|
|
296
312
|
n.activePanelId
|
|
297
313
|
), s(() => {
|
|
298
314
|
if (n.activePanelId == null) return;
|
|
299
|
-
function c(
|
|
300
|
-
|
|
315
|
+
function c(m) {
|
|
316
|
+
m.key === "Escape" && t({ type: "CLOSE_PANEL", reason: "escape-key" });
|
|
301
317
|
}
|
|
302
318
|
return document.addEventListener("keydown", c), () => {
|
|
303
319
|
document.removeEventListener("keydown", c);
|
|
304
320
|
};
|
|
305
321
|
}, [n.activePanelId, t]);
|
|
306
322
|
const a = d(n);
|
|
307
|
-
|
|
323
|
+
C(() => {
|
|
308
324
|
a.current = n;
|
|
309
325
|
}), s(() => {
|
|
310
326
|
if (process.env.NODE_ENV === "production") return;
|
|
@@ -317,24 +333,24 @@ function z({ panelComponents: e }) {
|
|
|
317
333
|
c.__panelsHostHandle?.dispatch === t && delete c.__panelsHostHandle;
|
|
318
334
|
};
|
|
319
335
|
}, [t, r]);
|
|
320
|
-
const l =
|
|
336
|
+
const l = g(() => {
|
|
321
337
|
t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
|
|
322
|
-
}, [t]), u = n.activePanelId != null &&
|
|
323
|
-
return /* @__PURE__ */ p("div", { "data-panel-host": "true", style:
|
|
324
|
-
u && /* @__PURE__ */
|
|
338
|
+
}, [t]), u = n.activePanelId != null && i != null;
|
|
339
|
+
return /* @__PURE__ */ p("div", { "data-panel-host": "true", style: B, children: [
|
|
340
|
+
u && /* @__PURE__ */ o(
|
|
325
341
|
"div",
|
|
326
342
|
{
|
|
327
343
|
"data-panel-scrim": "true",
|
|
328
|
-
style:
|
|
344
|
+
style: K,
|
|
329
345
|
onClick: l
|
|
330
346
|
}
|
|
331
347
|
),
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
|
|
348
|
+
/* @__PURE__ */ o(U, { isOpen: u, children: u && /* @__PURE__ */ o(
|
|
349
|
+
k,
|
|
334
350
|
{
|
|
335
351
|
isOpen: !0,
|
|
336
352
|
onClose: () => t({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
337
|
-
children: /* @__PURE__ */ i
|
|
353
|
+
children: /* @__PURE__ */ o(i, { isOpen: !0 })
|
|
338
354
|
}
|
|
339
355
|
) })
|
|
340
356
|
] });
|
|
@@ -354,15 +370,15 @@ const Q = {
|
|
|
354
370
|
};
|
|
355
371
|
export {
|
|
356
372
|
Q as C,
|
|
357
|
-
|
|
358
|
-
|
|
373
|
+
Y as P,
|
|
374
|
+
j as a,
|
|
359
375
|
z as b,
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
376
|
+
k as c,
|
|
377
|
+
D as d,
|
|
378
|
+
T as e,
|
|
379
|
+
R as f,
|
|
380
|
+
U as g,
|
|
365
381
|
O as i,
|
|
366
|
-
|
|
382
|
+
N as r,
|
|
367
383
|
y as u
|
|
368
384
|
};
|
package/composites-panels.js
CHANGED
|
@@ -1,20 +1,36 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { C as
|
|
3
|
-
import {
|
|
4
|
-
import { useEffect as
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { a as h, f as S, u as b, g as N, c as A } from "./COMMITS-By42AA8m.js";
|
|
2
|
+
import { C as ee, b as ne, P as te, e as oe, i as re, r as se, d as ie } from "./COMMITS-By42AA8m.js";
|
|
3
|
+
import { jsx as a, jsxs as m, Fragment as I } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect as y, useRef as L, useLayoutEffect as C, useCallback as v } from "react";
|
|
5
|
+
function x({ children: e }) {
|
|
6
|
+
return /* @__PURE__ */ a("div", { className: "clone-stage", children: e });
|
|
7
|
+
}
|
|
8
|
+
function O({ span: e, rotating: n = !0, children: t }) {
|
|
9
|
+
const r = ["clone-card", `span-${e}`, n ? "rotating" : ""].filter(Boolean).join(" ");
|
|
10
|
+
return /* @__PURE__ */ a("div", { className: r, children: t });
|
|
11
|
+
}
|
|
12
|
+
function K({
|
|
13
|
+
isOpen: e,
|
|
14
|
+
cardSpan: n,
|
|
15
|
+
cardLabel: t = "Metric",
|
|
16
|
+
cardValue: r = "—"
|
|
17
|
+
}) {
|
|
18
|
+
const o = h()?.state.activeTrigger, i = o?.kind === "card-overflow" ? o.cardId : null, l = S(), c = o?.span;
|
|
19
|
+
return /* @__PURE__ */ m("div", { "data-shell": "settings", "aria-hidden": !e, children: [
|
|
20
|
+
/* @__PURE__ */ a(x, { children: /* @__PURE__ */ m(O, { span: n ?? c ?? 1, rotating: !l, children: [
|
|
21
|
+
/* @__PURE__ */ a("div", { style: { fontSize: 9, textTransform: "uppercase", letterSpacing: "0.06em", color: "#9ca3af", marginBottom: 6 }, children: t }),
|
|
22
|
+
/* @__PURE__ */ a("div", { style: { fontSize: 22, fontWeight: 700, color: "#111827", lineHeight: 1 }, children: r })
|
|
23
|
+
] }) }),
|
|
24
|
+
/* @__PURE__ */ a("p", { style: { margin: "12px 0 0", fontSize: 14, color: "#495057" }, children: i ? `Settings for card: ${i}` : "Settings" }),
|
|
9
25
|
/* @__PURE__ */ a("p", { style: { margin: "8px 0 0", fontSize: 12, color: "#adb5bd" }, children: "Configuration options coming soon." })
|
|
10
26
|
] });
|
|
11
27
|
}
|
|
12
|
-
const
|
|
28
|
+
const z = {
|
|
13
29
|
position: "fixed",
|
|
14
30
|
inset: 0,
|
|
15
31
|
pointerEvents: "none",
|
|
16
32
|
zIndex: 55
|
|
17
|
-
},
|
|
33
|
+
}, D = {
|
|
18
34
|
position: "absolute",
|
|
19
35
|
inset: 0,
|
|
20
36
|
zIndex: 1,
|
|
@@ -23,45 +39,45 @@ const y = {
|
|
|
23
39
|
pointerEvents: "none",
|
|
24
40
|
background: "rgba(0, 0, 0, 0.04)"
|
|
25
41
|
};
|
|
26
|
-
function
|
|
27
|
-
const { state: e, dispatch: n, getCloseLog: t } =
|
|
28
|
-
|
|
42
|
+
function G() {
|
|
43
|
+
const { state: e, dispatch: n, getCloseLog: t } = b();
|
|
44
|
+
y(() => {
|
|
29
45
|
if (e.activePanelId == null) return;
|
|
30
|
-
function
|
|
31
|
-
|
|
46
|
+
function o(i) {
|
|
47
|
+
i.key === "Escape" && n({ type: "CLOSE_PANEL", reason: "escape-key" });
|
|
32
48
|
}
|
|
33
|
-
return document.addEventListener("keydown",
|
|
49
|
+
return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
|
|
34
50
|
}, [e.activePanelId, n]);
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}),
|
|
51
|
+
const r = L(e);
|
|
52
|
+
C(() => {
|
|
53
|
+
r.current = e;
|
|
54
|
+
}), y(() => {
|
|
39
55
|
if (process.env.NODE_ENV === "production") return;
|
|
40
|
-
const
|
|
41
|
-
return
|
|
56
|
+
const o = window;
|
|
57
|
+
return o.__panelsHostHandle && console.warn("[panels] multiple PanelHost/PanelHostShell instances mounted; dev handle is unreliable"), o.__panelsHostHandle = {
|
|
42
58
|
dispatch: n,
|
|
43
|
-
getState: () =>
|
|
59
|
+
getState: () => r.current,
|
|
44
60
|
getCloseLog: t
|
|
45
61
|
}, () => {
|
|
46
|
-
|
|
62
|
+
o.__panelsHostHandle?.dispatch === n && delete window.__panelsHostHandle;
|
|
47
63
|
};
|
|
48
64
|
}, [n, t]);
|
|
49
65
|
const s = v(() => {
|
|
50
66
|
n({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
|
|
51
67
|
}, [n]);
|
|
52
|
-
return /* @__PURE__ */ a("div", { "data-panel-host": "true", style:
|
|
68
|
+
return /* @__PURE__ */ a("div", { "data-panel-host": "true", style: z, children: e.activePanelId != null && /* @__PURE__ */ a(
|
|
53
69
|
"div",
|
|
54
70
|
{
|
|
55
71
|
"data-panel-scrim": "true",
|
|
56
|
-
style:
|
|
72
|
+
style: D,
|
|
57
73
|
onClick: s
|
|
58
74
|
}
|
|
59
75
|
) });
|
|
60
76
|
}
|
|
61
|
-
function
|
|
62
|
-
const n =
|
|
77
|
+
function Q({ panelComponents: e }) {
|
|
78
|
+
const n = h();
|
|
63
79
|
if (n == null) return null;
|
|
64
|
-
const { state: t, dispatch:
|
|
80
|
+
const { state: t, dispatch: r } = n;
|
|
65
81
|
if (t.activePanelId == null) return null;
|
|
66
82
|
const s = e[t.activePanelId];
|
|
67
83
|
if (s == null)
|
|
@@ -69,14 +85,14 @@ function x({ panelComponents: e }) {
|
|
|
69
85
|
"[panels] No panel component registered for activePanelId:",
|
|
70
86
|
t.activePanelId
|
|
71
87
|
), null;
|
|
72
|
-
const
|
|
88
|
+
const o = t.activePanelId === "settings" ? /* @__PURE__ */ m(I, { children: [
|
|
73
89
|
/* @__PURE__ */ a(
|
|
74
90
|
"button",
|
|
75
91
|
{
|
|
76
92
|
id: "settings-cancel",
|
|
77
93
|
type: "button",
|
|
78
94
|
className: "gloss-panel-chrome__footer-btn",
|
|
79
|
-
onClick: () =>
|
|
95
|
+
onClick: () => r({ type: "CLOSE_PANEL", reason: "cancel-button" }),
|
|
80
96
|
children: "Cancel"
|
|
81
97
|
}
|
|
82
98
|
),
|
|
@@ -86,39 +102,196 @@ function x({ panelComponents: e }) {
|
|
|
86
102
|
id: "settings-apply",
|
|
87
103
|
type: "button",
|
|
88
104
|
className: "gloss-panel-chrome__footer-btn gloss-panel-chrome__footer-btn--primary",
|
|
89
|
-
onClick: () =>
|
|
105
|
+
onClick: () => r({ type: "CLOSE_PANEL", reason: "apply-button" }),
|
|
90
106
|
children: "Apply"
|
|
91
107
|
}
|
|
92
108
|
)
|
|
93
109
|
] }) : null;
|
|
94
|
-
return /* @__PURE__ */ a(
|
|
95
|
-
|
|
110
|
+
return /* @__PURE__ */ a(N, { isOpen: !0, children: /* @__PURE__ */ a(
|
|
111
|
+
A,
|
|
96
112
|
{
|
|
97
113
|
isOpen: !0,
|
|
98
|
-
onClose: () =>
|
|
99
|
-
footer:
|
|
114
|
+
onClose: () => r({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
115
|
+
footer: o,
|
|
100
116
|
children: /* @__PURE__ */ a(s, { isOpen: !0 })
|
|
101
117
|
}
|
|
102
118
|
) });
|
|
103
119
|
}
|
|
104
|
-
function
|
|
120
|
+
function P(e) {
|
|
105
121
|
return e === null ? null : e.kind === "manage-pages-action" ? `global-${e.align ?? "left"}` : e.kind === "card-overflow" || e.kind === "empty-cell" ? `section-${e.sectionIndex}` : null;
|
|
106
122
|
}
|
|
123
|
+
const T = 685, g = 627, k = "cubic-bezier(0.22, 1, 0.36, 1)", H = 200;
|
|
124
|
+
function w(e, n) {
|
|
125
|
+
if (typeof window > "u") return n;
|
|
126
|
+
const t = window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();
|
|
127
|
+
if (!t) return n;
|
|
128
|
+
const r = parseFloat(t);
|
|
129
|
+
return Number.isNaN(r) ? n : t.endsWith("s") && !t.endsWith("ms") ? r * 1e3 : r;
|
|
130
|
+
}
|
|
131
|
+
function M(e, n) {
|
|
132
|
+
return typeof window > "u" ? n : window.getComputedStyle(document.documentElement).getPropertyValue(e).trim() || n;
|
|
133
|
+
}
|
|
134
|
+
function d(e) {
|
|
135
|
+
e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
|
|
136
|
+
}
|
|
137
|
+
function R(e) {
|
|
138
|
+
const { mountEl: n, chromeEl: t, reducedMotion: r, onAssert: s } = e;
|
|
139
|
+
if (n == null || t == null) {
|
|
140
|
+
d(e), s?.({ branch: "slide-fallback-no-dom", timestamp: Date.now() });
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (r) {
|
|
144
|
+
e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), s?.({ branch: "slide-reduced-motion", timestamp: Date.now() });
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (typeof t.animate != "function") {
|
|
148
|
+
d(e), s?.({ branch: "slide-no-waapi", timestamp: Date.now() });
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const o = t.cloneNode(!0);
|
|
152
|
+
o.id = "panel-chrome-frozen", o.style.cssText = "position:absolute;left:8px;right:8px;top:8px;z-index:1;pointer-events:none;", n.appendChild(o), t.style.zIndex = "2", e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
|
|
153
|
+
const i = w("--panel-open-dur", T), l = M("--panel-easing", k), c = t.animate(
|
|
154
|
+
[{ transform: "translateY(100%)" }, { transform: "translateY(0)" }],
|
|
155
|
+
{ duration: i, easing: l, fill: "forwards" }
|
|
156
|
+
);
|
|
157
|
+
c.addEventListener(
|
|
158
|
+
"finish",
|
|
159
|
+
() => {
|
|
160
|
+
o.remove(), t.style.zIndex = "", c.cancel(), s?.({ branch: "slide-complete", frozen: "cleaned", timestamp: Date.now() });
|
|
161
|
+
},
|
|
162
|
+
{ once: !0 }
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
function F(e) {
|
|
166
|
+
const { mountEl: n, onAssert: t } = e;
|
|
167
|
+
if (n == null) {
|
|
168
|
+
e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), setTimeout(() => d(e), g), t?.({ branch: "handoff-fallback-no-mount", timestamp: Date.now() });
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const r = w("--panel-close-dur", g);
|
|
172
|
+
let s = !1, o = null;
|
|
173
|
+
const i = (c) => {
|
|
174
|
+
c.target !== n || c.propertyName !== "max-height" || s || (s = !0, o != null && clearTimeout(o), n.removeEventListener("transitionend", i), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), t?.({ branch: "handoff-complete", timestamp: Date.now() }));
|
|
175
|
+
}, l = () => {
|
|
176
|
+
s || (s = !0, n.removeEventListener("transitionend", i), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), t?.({ branch: "handoff-forced", timestamp: Date.now() }));
|
|
177
|
+
};
|
|
178
|
+
n.addEventListener("transitionend", i), e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), o = setTimeout(l, r + H);
|
|
179
|
+
}
|
|
180
|
+
function $(e) {
|
|
181
|
+
const { state: n, onAssert: t } = e;
|
|
182
|
+
if (n.activePanelId && n.isDirty) {
|
|
183
|
+
e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), t?.({ branch: "blocked-dirty", timestamp: Date.now() });
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const r = P(n.activeTrigger), s = P(e.trigger);
|
|
187
|
+
if (!!n.activePanelId && r != null && r === s) {
|
|
188
|
+
R(e);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (n.activePanelId) {
|
|
192
|
+
F(e);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
d(e), t?.({ branch: "fresh-open", timestamp: Date.now() });
|
|
196
|
+
}
|
|
197
|
+
function q() {
|
|
198
|
+
if (!(typeof window > "u"))
|
|
199
|
+
return window.__panelsAsserter;
|
|
200
|
+
}
|
|
201
|
+
function J() {
|
|
202
|
+
const e = h(), n = S();
|
|
203
|
+
return v(
|
|
204
|
+
(t, r) => {
|
|
205
|
+
if (!e)
|
|
206
|
+
return;
|
|
207
|
+
const s = typeof document < "u" ? document.querySelector('[data-mount="panel"]') : null, o = typeof document < "u" ? document.querySelector('[data-chrome="panel"]') : null, i = {
|
|
208
|
+
panelId: t,
|
|
209
|
+
trigger: r,
|
|
210
|
+
state: e.state,
|
|
211
|
+
dispatch: e.dispatch,
|
|
212
|
+
mountEl: s,
|
|
213
|
+
chromeEl: o,
|
|
214
|
+
reducedMotion: n,
|
|
215
|
+
onAssert: (l) => {
|
|
216
|
+
q()?.recordTransition?.(l);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
$(i);
|
|
220
|
+
},
|
|
221
|
+
[e, n]
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
let u = !1, f = null;
|
|
225
|
+
function E() {
|
|
226
|
+
const e = [];
|
|
227
|
+
let n = "cleaned";
|
|
228
|
+
document.querySelectorAll("#panel-chrome-frozen").length > 0 && (e.push("#panel-chrome-frozen"), n = "lingering");
|
|
229
|
+
const r = document.querySelectorAll(".gloss-panel-mount");
|
|
230
|
+
r.length > 1 && e.push(`mount-count=${r.length}`);
|
|
231
|
+
const s = r[0] ?? null, o = s ? s.querySelectorAll(".gloss-panel-chrome") : [];
|
|
232
|
+
o.length > 1 && e.push(`chrome-count=${o.length}`);
|
|
233
|
+
const i = o[0] ?? null;
|
|
234
|
+
if (i) {
|
|
235
|
+
const p = i.style.zIndex;
|
|
236
|
+
p !== "" && p !== "2" && e.push(`chrome-zindex=${p}`);
|
|
237
|
+
}
|
|
238
|
+
const l = s ? "present" : "absent", c = i ? "present" : "absent";
|
|
239
|
+
return {
|
|
240
|
+
valid: e.length === 0,
|
|
241
|
+
mount: l,
|
|
242
|
+
chrome: c,
|
|
243
|
+
frozen: n,
|
|
244
|
+
orphans: e,
|
|
245
|
+
timestamp: Date.now()
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function U() {
|
|
249
|
+
return {
|
|
250
|
+
enable: V,
|
|
251
|
+
disable: j,
|
|
252
|
+
isEnabled: () => u,
|
|
253
|
+
getLastReport: () => f,
|
|
254
|
+
recordTransition: (e) => {
|
|
255
|
+
u && (f = { ...e, ...E() });
|
|
256
|
+
},
|
|
257
|
+
assertOnce: () => {
|
|
258
|
+
const e = E();
|
|
259
|
+
return f = e, e;
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function V() {
|
|
264
|
+
if (u = !0, typeof window > "u") return;
|
|
265
|
+
const e = window;
|
|
266
|
+
e.__panelsAsserter || (e.__panelsAsserter = U(), console.info(
|
|
267
|
+
"[panels] Q12-12 asserter enabled. Inspect via window.__panelsAsserter.getLastReport()."
|
|
268
|
+
));
|
|
269
|
+
}
|
|
270
|
+
function j() {
|
|
271
|
+
u = !1;
|
|
272
|
+
}
|
|
107
273
|
export {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
274
|
+
ee as COMMITS,
|
|
275
|
+
O as CloneCard,
|
|
276
|
+
x as CloneStage,
|
|
277
|
+
A as PanelChrome,
|
|
278
|
+
ne as PanelHost,
|
|
279
|
+
G as PanelHostShell,
|
|
280
|
+
N as PanelMount,
|
|
281
|
+
te as PanelProvider,
|
|
282
|
+
Q as PanelSlot,
|
|
283
|
+
K as SettingsShell,
|
|
284
|
+
E as assertPanelDomShape,
|
|
285
|
+
oe as deriveSurfaceState,
|
|
286
|
+
j as disablePanelAsserter,
|
|
287
|
+
V as enablePanelAsserter,
|
|
288
|
+
re as initialState,
|
|
289
|
+
P as positionKey,
|
|
290
|
+
se as reducer,
|
|
291
|
+
$ as transitionToPanel,
|
|
292
|
+
b as usePanelContext,
|
|
293
|
+
h as usePanelContextOptional,
|
|
294
|
+
ie as usePanelCoordinator,
|
|
295
|
+
S as useReducedMotionPanel,
|
|
296
|
+
J as useTransitionToPanel
|
|
124
297
|
};
|
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-By42AA8m.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";
|