@mt-gloss/ui 0.1.99 → 0.1.100
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.
|
@@ -81,9 +81,9 @@ function T(e, n) {
|
|
|
81
81
|
type: "COMMIT_BUFFER",
|
|
82
82
|
payload: { cardId: r, delta: i }
|
|
83
83
|
}
|
|
84
|
-
] : [{ type: "COMMIT_BUFFER" }] : [{ type: "DISCARD_BUFFER" }] : [],
|
|
85
|
-
const
|
|
86
|
-
return delete
|
|
84
|
+
] : [{ type: "COMMIT_BUFFER" }] : [{ type: "DISCARD_BUFFER" }] : [], c = r != null && i != null ? (() => {
|
|
85
|
+
const l = { ...e.bufferByCard };
|
|
86
|
+
return delete l[r], l;
|
|
87
87
|
})() : e.bufferByCard;
|
|
88
88
|
return {
|
|
89
89
|
...e,
|
|
@@ -92,7 +92,7 @@ function T(e, n) {
|
|
|
92
92
|
isDirty: !1,
|
|
93
93
|
lockHint: null,
|
|
94
94
|
// closing clears any active lockHint (dirty-buffer condition gone)
|
|
95
|
-
bufferByCard:
|
|
95
|
+
bufferByCard: c,
|
|
96
96
|
lastClose: { panelId: t, reason: n.reason },
|
|
97
97
|
pendingSideEffects: [...e.pendingSideEffects, ...o]
|
|
98
98
|
};
|
|
@@ -125,7 +125,7 @@ function T(e, n) {
|
|
|
125
125
|
const o = { kind: "settings", changes: {
|
|
126
126
|
...t?.kind === "settings" ? t.changes : {},
|
|
127
127
|
[n.key]: n.value
|
|
128
|
-
} },
|
|
128
|
+
} }, c = { ...e.bufferByCard, [n.cardId]: o }, l = r ? [
|
|
129
129
|
{
|
|
130
130
|
type: "SCHEDULE_TIMER",
|
|
131
131
|
ms: 0,
|
|
@@ -134,8 +134,8 @@ function T(e, n) {
|
|
|
134
134
|
] : [];
|
|
135
135
|
return {
|
|
136
136
|
...e,
|
|
137
|
-
bufferByCard:
|
|
138
|
-
pendingSideEffects: [...e.pendingSideEffects, ...
|
|
137
|
+
bufferByCard: c,
|
|
138
|
+
pendingSideEffects: [...e.pendingSideEffects, ...l]
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
141
|
case "CLEAR_BUFFER": {
|
|
@@ -182,7 +182,10 @@ function T(e, n) {
|
|
|
182
182
|
case "CLEAR_LOCK_HINT":
|
|
183
183
|
return e.lockHint == null ? e : { ...e, lockHint: null };
|
|
184
184
|
case "DRAIN_SIDE_EFFECTS":
|
|
185
|
-
return e.pendingSideEffects.length === 0 ? e : {
|
|
185
|
+
return e.pendingSideEffects.length === 0 ? e : typeof n.count == "number" && n.count > 0 ? n.count >= e.pendingSideEffects.length ? { ...e, pendingSideEffects: [] } : {
|
|
186
|
+
...e,
|
|
187
|
+
pendingSideEffects: e.pendingSideEffects.slice(n.count)
|
|
188
|
+
} : {
|
|
186
189
|
...e,
|
|
187
190
|
pendingSideEffects: []
|
|
188
191
|
};
|
|
@@ -198,7 +201,8 @@ function w() {
|
|
|
198
201
|
u(() => () => {
|
|
199
202
|
r.current != null && (window.clearTimeout(r.current), r.current = null);
|
|
200
203
|
}, []), u(() => {
|
|
201
|
-
|
|
204
|
+
const c = e.pendingSideEffects.length;
|
|
205
|
+
if (c !== 0) {
|
|
202
206
|
for (const l of e.pendingSideEffects)
|
|
203
207
|
l.type === "SCHEDULE_TIMER" ? (r.current != null && window.clearTimeout(r.current), r.current = window.setTimeout(() => {
|
|
204
208
|
r.current = null, n(l.action);
|
|
@@ -211,11 +215,11 @@ function w() {
|
|
|
211
215
|
note: "F22: mutex-handoff synthetic close-log entry"
|
|
212
216
|
}
|
|
213
217
|
] : l.type === "INVALID_DISPATCH" && process.env.NODE_ENV !== "production" && console.warn("[panels] INVALID_DISPATCH:", l.reason);
|
|
214
|
-
n({ type: "DRAIN_SIDE_EFFECTS" });
|
|
218
|
+
n({ type: "DRAIN_SIDE_EFFECTS", count: c });
|
|
215
219
|
}
|
|
216
220
|
}, [e.pendingSideEffects, n]), u(() => {
|
|
217
221
|
if (!e.lastClose) return;
|
|
218
|
-
const
|
|
222
|
+
const c = {
|
|
219
223
|
panelId: e.lastClose.panelId,
|
|
220
224
|
reason: e.lastClose.reason,
|
|
221
225
|
at: Date.now(),
|
|
@@ -223,7 +227,7 @@ function w() {
|
|
|
223
227
|
};
|
|
224
228
|
t.current = [
|
|
225
229
|
...t.current.slice(-99),
|
|
226
|
-
|
|
230
|
+
c
|
|
227
231
|
];
|
|
228
232
|
}, [e.lastClose]);
|
|
229
233
|
const i = C(
|
|
@@ -315,10 +319,10 @@ function M({ isOpen: e, children: n }) {
|
|
|
315
319
|
o(!1);
|
|
316
320
|
return;
|
|
317
321
|
}
|
|
318
|
-
const
|
|
319
|
-
return () => cancelAnimationFrame(
|
|
322
|
+
const l = requestAnimationFrame(() => o(!0));
|
|
323
|
+
return () => cancelAnimationFrame(l);
|
|
320
324
|
}, [e]);
|
|
321
|
-
const
|
|
325
|
+
const c = [
|
|
322
326
|
"gloss-panel-mount",
|
|
323
327
|
i ? "has-panel" : "",
|
|
324
328
|
t ? "reduced-motion" : ""
|
|
@@ -327,7 +331,7 @@ function M({ isOpen: e, children: n }) {
|
|
|
327
331
|
"div",
|
|
328
332
|
{
|
|
329
333
|
ref: r,
|
|
330
|
-
className:
|
|
334
|
+
className: c,
|
|
331
335
|
"data-mount": "panel",
|
|
332
336
|
"data-open": e ? "true" : "false",
|
|
333
337
|
children: n
|
|
@@ -389,19 +393,19 @@ function z({ panelComponents: e }) {
|
|
|
389
393
|
s.__panelsHostHandle?.dispatch === t && delete s.__panelsHostHandle;
|
|
390
394
|
};
|
|
391
395
|
}, [t, r]);
|
|
392
|
-
const
|
|
396
|
+
const c = v(() => {
|
|
393
397
|
t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
|
|
394
|
-
}, [t]),
|
|
398
|
+
}, [t]), l = n.activePanelId != null && i != null;
|
|
395
399
|
return /* @__PURE__ */ E("div", { "data-panel-host": "true", style: U, children: [
|
|
396
|
-
|
|
400
|
+
l && /* @__PURE__ */ a(
|
|
397
401
|
"div",
|
|
398
402
|
{
|
|
399
403
|
"data-panel-scrim": "true",
|
|
400
404
|
style: V,
|
|
401
|
-
onClick:
|
|
405
|
+
onClick: c
|
|
402
406
|
}
|
|
403
407
|
),
|
|
404
|
-
/* @__PURE__ */ a(M, { isOpen:
|
|
408
|
+
/* @__PURE__ */ a(M, { isOpen: l, children: l && /* @__PURE__ */ a(
|
|
405
409
|
A,
|
|
406
410
|
{
|
|
407
411
|
isOpen: !0,
|
package/composites-panels.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as I, f as q, a as Z, g as N, c as w } from "./COMMITS-
|
|
2
|
-
import { C as Ve, b as qe, P as Be, e as He, i as Ue, r as Ye, d as Ke } from "./COMMITS-
|
|
1
|
+
import { u as I, f as q, a as Z, g as N, c as w } from "./COMMITS-Dm8qIHaq.js";
|
|
2
|
+
import { C as Ve, b as qe, P as Be, e as He, i as Ue, r as Ye, d as Ke } from "./COMMITS-Dm8qIHaq.js";
|
|
3
3
|
import { jsx as s, jsxs as h, Fragment as ee } from "react/jsx-runtime";
|
|
4
4
|
import { useState as y, useRef as B, createContext as H, useContext as U, useEffect as F, useLayoutEffect as te, useCallback as Y } from "react";
|
|
5
5
|
function ne({ children: e }) {
|
package/index.js
CHANGED
|
@@ -5,8 +5,8 @@ import * as B from "react";
|
|
|
5
5
|
import F, { useRef as P, useEffect as A, useState as I, useCallback as N, useId as Je, forwardRef as et, useMemo as re, useLayoutEffect as Ie, createContext as tt, useContext as at } from "react";
|
|
6
6
|
import { motion as G, useMotionValue as nt, AnimatePresence as rt, useDragControls as st } from "framer-motion";
|
|
7
7
|
import { createPortal as Ee } from "react-dom";
|
|
8
|
-
import { u as it } from "./COMMITS-
|
|
9
|
-
import { C as Jo, c as el, b as tl, P as al, e as nl, i as rl, r as sl, a as il, d as ol } from "./COMMITS-
|
|
8
|
+
import { u as it } from "./COMMITS-Dm8qIHaq.js";
|
|
9
|
+
import { C as Jo, c as el, b as tl, P as al, e as nl, i as rl, r as sl, a as il, d as ol } from "./COMMITS-Dm8qIHaq.js";
|
|
10
10
|
import { B as ot, a as X, b as ce, U as fe } from "./UIContext-DP6JGCto.js";
|
|
11
11
|
import { c as cl, u as dl } from "./UIContext-DP6JGCto.js";
|
|
12
12
|
import { DEFAULT_MARKET_PRESETS as ml, DEFAULT_PINNED as pl, PERIOD_OPTIONS as gl, ROLLING_OPTIONS as hl, TODAY_PRESET as fl, findPreset as bl, formatDateRange as vl, formatMarketDates as yl, formatTrend as wl, formatValue as _l, generateMarketId as Cl, getAllPresets as Nl, getDateRangeForPreset as Sl, getPresetLabel as kl, isInRange as Dl, isMarketActive as xl, isSameDay as Rl, normalizePresetId as Tl, toUppercasePresetId as Ml } from "@mt-gloss/utils";
|