@mt-gloss/ui 0.1.83 → 0.1.85
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-BUj_vdP8.js +292 -0
- package/{Expandable-Deyl6mWK.js → Expandable-D00kXkfM.js} +2099 -2093
- package/catalog.js +2 -2
- package/composites-panels.js +2 -2
- package/index.js +200 -199
- package/lib/composites/panels/coordinator/coordinator.d.ts +5 -0
- package/lib/composites/panels/coordinator/types.d.ts +40 -5
- package/lib/primitives/dashboard/MetricCard/CardShell.d.ts +1 -1
- package/lib/primitives/dashboard/MetricCard/types/cardShellProps.d.ts +8 -0
- package/lib/primitives/dashboard/MetricCard/types/shared.d.ts +2 -0
- package/lib/primitives/dashboard/PageChip/types.d.ts +3 -1
- package/package.json +1 -1
- package/COMMITS-or4m2o8k.js +0 -219
|
@@ -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
|
-
}
|
|
@@ -17,6 +17,6 @@ import { CardShellProps } from './types';
|
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
19
|
export declare const CardShell: {
|
|
20
|
-
({ contentSlot, children, colSpan, isStale, isRetrying, beta, disabled, style, accentRing, onGraph, onDetails, onCustomize, onRemove, onWhatsThis, onExpand, onShrink, onMove, onReplace, onNavigate, onRetry, onRefresh, enableQuickSettings, onUpdateTimeframe, instanceTimeframe, cardTitle, quickConfigSlot, isStackedGroup, onUpdateStackedTimeframes, instanceStackedTimeframes, isGraphActive, isTableActive, isGraphCard, canExpand, anchorX, extensionOverflow, cardRef: externalCardRef, hovered, forceHide, resizePhase, outgoingSnapshot, isFlipped, onFlipChange, }: CardShellProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
({ contentSlot, children, colSpan, isStale, isRetrying, beta, disabled, style, accentRing, onGraph, onDetails, onCustomize, onRemove, onWhatsThis, onExpand, onShrink, onMove, onReplace, onNavigate, onRetry, onRefresh, enableQuickSettings, onUpdateTimeframe, instanceTimeframe, cardTitle, quickConfigSlot, isStackedGroup, onUpdateStackedTimeframes, instanceStackedTimeframes, isGraphActive, isTableActive, isGraphCard, canExpand, anchorX, extensionOverflow, cardRef: externalCardRef, hovered, forceHide, resizePhase, outgoingSnapshot, isFlipped, onFlipChange, clickShadowSlot, }: CardShellProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
displayName: string;
|
|
22
22
|
};
|
|
@@ -129,4 +129,12 @@ export interface CardShellProps {
|
|
|
129
129
|
resizePhase?: import('../useResizeChoreography').ChoreographyPhase;
|
|
130
130
|
/** Phase 11.2 — outgoing composition snapshot (B-path). Rendered above live content during 'outgoing'; fades out on 'incoming'. */
|
|
131
131
|
outgoingSnapshot?: ReactNode;
|
|
132
|
+
/**
|
|
133
|
+
* Quick 260511-6xk T3 — optional transparent click-proxy region rendered
|
|
134
|
+
* at card-root level (above the front-face z-layer). Consumer renders this
|
|
135
|
+
* when the ActionStrip is visible to extend the strip's click area upward
|
|
136
|
+
* into the card body without repositioning the strip. The consumer owns
|
|
137
|
+
* z-index, sizing, and click routing; CardShell only renders the slot.
|
|
138
|
+
*/
|
|
139
|
+
clickShadowSlot?: ReactNode;
|
|
132
140
|
}
|
|
@@ -30,6 +30,8 @@ export type SlotCapacity = 1 | 3 | 5;
|
|
|
30
30
|
/** Base props shared by all MetricCard variants. */
|
|
31
31
|
export interface BaseMetricCardProps {
|
|
32
32
|
label: string;
|
|
33
|
+
/** Optional ReactNode rendered alongside the label in zone-a (geo badge, beta chip, etc.). */
|
|
34
|
+
labelAdornment?: import('react').ReactNode;
|
|
33
35
|
value?: number | string | null;
|
|
34
36
|
valueFormat?: ValueFormat;
|
|
35
37
|
trend?: TrendData | null;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
1
|
+
import { RefObject, ReactNode } from 'react';
|
|
2
2
|
/** Describes a single page entry in the dropdown list. */
|
|
3
3
|
export interface PageInfo {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
6
6
|
named: boolean;
|
|
7
7
|
cardCount: number;
|
|
8
|
+
/** Optional trailing decoration (geo badge, etc.). Rendered after the page name. */
|
|
9
|
+
icon?: ReactNode;
|
|
8
10
|
}
|
|
9
11
|
/** Props for the PageChip corner navigation element. */
|
|
10
12
|
export interface PageChipProps {
|
package/package.json
CHANGED
package/COMMITS-or4m2o8k.js
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import { jsx as a, jsxs as u, Fragment as I } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as h, useContext as p, useReducer as g, useRef as i, useEffect as r, useMemo as f, useCallback as v, useLayoutEffect as C } from "react";
|
|
3
|
-
const c = h(null);
|
|
4
|
-
function m() {
|
|
5
|
-
const e = p(c);
|
|
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 O() {
|
|
13
|
-
return p(c);
|
|
14
|
-
}
|
|
15
|
-
const S = {
|
|
16
|
-
activePanelId: null,
|
|
17
|
-
lastClose: null,
|
|
18
|
-
pendingSideEffects: []
|
|
19
|
-
};
|
|
20
|
-
function _(e, n) {
|
|
21
|
-
switch (n.type) {
|
|
22
|
-
case "OPEN_PANEL":
|
|
23
|
-
return n.panelId === "notification-center" && e.activePanelId === null ? {
|
|
24
|
-
activePanelId: "notification-center",
|
|
25
|
-
lastClose: null,
|
|
26
|
-
// reset lastClose on fresh open
|
|
27
|
-
pendingSideEffects: e.pendingSideEffects
|
|
28
|
-
// preserve any draining queue
|
|
29
|
-
} : n.panelId === "notification-center" && e.activePanelId === "notification-center" ? e : {
|
|
30
|
-
...e,
|
|
31
|
-
pendingSideEffects: [
|
|
32
|
-
...e.pendingSideEffects,
|
|
33
|
-
{
|
|
34
|
-
type: "INVALID_DISPATCH",
|
|
35
|
-
reason: `panel-not-supported-in-P1:${n.panelId}`
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
};
|
|
39
|
-
case "CLOSE_PANEL":
|
|
40
|
-
return e.activePanelId === null ? e : {
|
|
41
|
-
activePanelId: null,
|
|
42
|
-
lastClose: { panelId: e.activePanelId, reason: n.reason },
|
|
43
|
-
pendingSideEffects: e.pendingSideEffects
|
|
44
|
-
};
|
|
45
|
-
case "DRAIN_SIDE_EFFECTS":
|
|
46
|
-
return e.pendingSideEffects.length === 0 ? e : {
|
|
47
|
-
...e,
|
|
48
|
-
pendingSideEffects: []
|
|
49
|
-
};
|
|
50
|
-
default:
|
|
51
|
-
return e;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function y(e) {
|
|
55
|
-
return e.activePanelId === "notification-center" ? "notif-center" : (e.activePanelId != null, "idle");
|
|
56
|
-
}
|
|
57
|
-
function N() {
|
|
58
|
-
const [e, n] = g(_, S), t = i([]);
|
|
59
|
-
i(null), r(() => {
|
|
60
|
-
if (e.pendingSideEffects.length !== 0) {
|
|
61
|
-
for (const o of e.pendingSideEffects)
|
|
62
|
-
o.type === "SCHEDULE_TIMER" ? window.setTimeout(() => n(o.action), Math.max(0, o.ms)) : o.type === "INVALID_DISPATCH" && process.env.NODE_ENV !== "production" && console.warn("[panels] INVALID_DISPATCH:", o.reason);
|
|
63
|
-
n({ type: "DRAIN_SIDE_EFFECTS" });
|
|
64
|
-
}
|
|
65
|
-
}, [e.pendingSideEffects]), r(() => {
|
|
66
|
-
if (!e.lastClose) return;
|
|
67
|
-
const o = {
|
|
68
|
-
panelId: e.lastClose.panelId,
|
|
69
|
-
reason: e.lastClose.reason,
|
|
70
|
-
at: Date.now(),
|
|
71
|
-
note: e.lastClose.reason === "nav-escape-hatch" ? "F21: backdrop-click OR page-nav escape" : void 0
|
|
72
|
-
};
|
|
73
|
-
t.current = [
|
|
74
|
-
...t.current.slice(-99),
|
|
75
|
-
o
|
|
76
|
-
];
|
|
77
|
-
}, [e.lastClose]);
|
|
78
|
-
const l = f(
|
|
79
|
-
() => y(e),
|
|
80
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
81
|
-
[e.activePanelId]
|
|
82
|
-
), s = v(() => t.current.slice(), []);
|
|
83
|
-
return { state: e, surfaceState: l, dispatch: n, getCloseLog: s };
|
|
84
|
-
}
|
|
85
|
-
function k({ children: e }) {
|
|
86
|
-
const n = N(), t = f(
|
|
87
|
-
() => n,
|
|
88
|
-
// Re-publish only when one of the four coordinator fields changes identity.
|
|
89
|
-
// dispatch + getCloseLog are stable. state + surfaceState change on dispatch.
|
|
90
|
-
[n.state, n.surfaceState, n.dispatch, n.getCloseLog]
|
|
91
|
-
);
|
|
92
|
-
return /* @__PURE__ */ a(c.Provider, { value: t, children: e });
|
|
93
|
-
}
|
|
94
|
-
const x = {
|
|
95
|
-
position: "relative",
|
|
96
|
-
pointerEvents: "auto"
|
|
97
|
-
};
|
|
98
|
-
function L({ children: e, onClose: n, isOpen: t = !0 }) {
|
|
99
|
-
return /* @__PURE__ */ u(
|
|
100
|
-
"div",
|
|
101
|
-
{
|
|
102
|
-
"data-chrome": "panel",
|
|
103
|
-
"data-open": t ? "true" : "false",
|
|
104
|
-
role: "dialog",
|
|
105
|
-
"aria-modal": "true",
|
|
106
|
-
className: "gloss-panel-chrome",
|
|
107
|
-
style: x,
|
|
108
|
-
children: [
|
|
109
|
-
/* @__PURE__ */ a("div", { className: "gloss-panel-chrome__header", children: /* @__PURE__ */ a(
|
|
110
|
-
"button",
|
|
111
|
-
{
|
|
112
|
-
id: "panel-close",
|
|
113
|
-
type: "button",
|
|
114
|
-
"aria-label": "Close panel",
|
|
115
|
-
className: "gloss-panel-chrome__close",
|
|
116
|
-
onClick: n,
|
|
117
|
-
children: "×"
|
|
118
|
-
}
|
|
119
|
-
) }),
|
|
120
|
-
/* @__PURE__ */ a("div", { className: "gloss-panel-chrome__body", children: e })
|
|
121
|
-
]
|
|
122
|
-
}
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
const b = {
|
|
126
|
-
position: "fixed",
|
|
127
|
-
top: 0,
|
|
128
|
-
left: 0,
|
|
129
|
-
right: 0,
|
|
130
|
-
height: "var(--tb-h, 60px)",
|
|
131
|
-
perspective: "1200px",
|
|
132
|
-
perspectiveOrigin: "center bottom",
|
|
133
|
-
overflow: "visible",
|
|
134
|
-
pointerEvents: "none",
|
|
135
|
-
zIndex: 55
|
|
136
|
-
}, w = {
|
|
137
|
-
position: "fixed",
|
|
138
|
-
top: "var(--tb-h, 60px)",
|
|
139
|
-
left: 0,
|
|
140
|
-
right: 0,
|
|
141
|
-
bottom: 0,
|
|
142
|
-
zIndex: 1,
|
|
143
|
-
pointerEvents: "auto",
|
|
144
|
-
background: "rgba(0, 0, 0, 0.04)"
|
|
145
|
-
};
|
|
146
|
-
function H({ panelComponents: e }) {
|
|
147
|
-
const { state: n, dispatch: t, getCloseLog: l } = m(), s = n.activePanelId ? e[n.activePanelId] : null;
|
|
148
|
-
n.activePanelId && !s && process.env.NODE_ENV !== "production" && console.error(
|
|
149
|
-
"[panels] No panel component registered for activePanelId:",
|
|
150
|
-
n.activePanelId
|
|
151
|
-
), r(() => {
|
|
152
|
-
if (n.activePanelId == null) return;
|
|
153
|
-
function d(P) {
|
|
154
|
-
P.key === "Escape" && t({ type: "CLOSE_PANEL", reason: "escape-key" });
|
|
155
|
-
}
|
|
156
|
-
return document.addEventListener("keydown", d), () => {
|
|
157
|
-
document.removeEventListener("keydown", d);
|
|
158
|
-
};
|
|
159
|
-
}, [n.activePanelId, t]);
|
|
160
|
-
const o = i(n);
|
|
161
|
-
C(() => {
|
|
162
|
-
o.current = n;
|
|
163
|
-
}), r(() => {
|
|
164
|
-
if (process.env.NODE_ENV !== "production")
|
|
165
|
-
return window.__panelsHostHandle = {
|
|
166
|
-
dispatch: t,
|
|
167
|
-
getState: () => o.current,
|
|
168
|
-
getCloseLog: l
|
|
169
|
-
}, () => {
|
|
170
|
-
delete window.__panelsHostHandle;
|
|
171
|
-
};
|
|
172
|
-
}, [t, l]);
|
|
173
|
-
const E = v(() => {
|
|
174
|
-
t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
|
|
175
|
-
}, [t]);
|
|
176
|
-
return /* @__PURE__ */ a("div", { "data-panel-host": "true", style: b, children: n.activePanelId != null && s != null && /* @__PURE__ */ u(I, { children: [
|
|
177
|
-
/* @__PURE__ */ a(
|
|
178
|
-
"div",
|
|
179
|
-
{
|
|
180
|
-
"data-panel-scrim": "true",
|
|
181
|
-
style: w,
|
|
182
|
-
onClick: E
|
|
183
|
-
}
|
|
184
|
-
),
|
|
185
|
-
/* @__PURE__ */ a(
|
|
186
|
-
L,
|
|
187
|
-
{
|
|
188
|
-
isOpen: !0,
|
|
189
|
-
onClose: () => t({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
190
|
-
children: /* @__PURE__ */ a(s, { isOpen: !0 })
|
|
191
|
-
}
|
|
192
|
-
)
|
|
193
|
-
] }) });
|
|
194
|
-
}
|
|
195
|
-
const R = {
|
|
196
|
-
"apply-button": !0,
|
|
197
|
-
// the ONLY commit reason
|
|
198
|
-
"cancel-button": !1,
|
|
199
|
-
"header-x": !1,
|
|
200
|
-
"escape-key": !1,
|
|
201
|
-
"page-nav": !1,
|
|
202
|
-
"mutex-handoff": !1,
|
|
203
|
-
"ghost-anchor": !1,
|
|
204
|
-
"viewport-collapse": !1,
|
|
205
|
-
unmount: !1,
|
|
206
|
-
"nav-escape-hatch": !1
|
|
207
|
-
};
|
|
208
|
-
export {
|
|
209
|
-
R as C,
|
|
210
|
-
k as P,
|
|
211
|
-
O as a,
|
|
212
|
-
H as b,
|
|
213
|
-
L as c,
|
|
214
|
-
N as d,
|
|
215
|
-
y as e,
|
|
216
|
-
S as i,
|
|
217
|
-
_ as r,
|
|
218
|
-
m as u
|
|
219
|
-
};
|