@mt-gloss/ui 0.1.99 → 0.1.101

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" }] : [], l = r != null && i != null ? (() => {
85
- const c = { ...e.bufferByCard };
86
- return delete c[r], c;
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: l,
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
- } }, l = { ...e.bufferByCard, [n.cardId]: o }, c = r ? [
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: l,
138
- pendingSideEffects: [...e.pendingSideEffects, ...c]
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
- if (e.pendingSideEffects.length !== 0) {
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 l = {
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
- l
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 c = requestAnimationFrame(() => o(!0));
319
- return () => cancelAnimationFrame(c);
322
+ const l = requestAnimationFrame(() => o(!0));
323
+ return () => cancelAnimationFrame(l);
320
324
  }, [e]);
321
- const l = [
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: l,
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 l = v(() => {
396
+ const c = v(() => {
393
397
  t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
394
- }, [t]), c = n.activePanelId != null && i != null;
398
+ }, [t]), l = n.activePanelId != null && i != null;
395
399
  return /* @__PURE__ */ E("div", { "data-panel-host": "true", style: U, children: [
396
- c && /* @__PURE__ */ a(
400
+ l && /* @__PURE__ */ a(
397
401
  "div",
398
402
  {
399
403
  "data-panel-scrim": "true",
400
404
  style: V,
401
- onClick: l
405
+ onClick: c
402
406
  }
403
407
  ),
404
- /* @__PURE__ */ a(M, { isOpen: c, children: c && /* @__PURE__ */ a(
408
+ /* @__PURE__ */ a(M, { isOpen: l, children: l && /* @__PURE__ */ a(
405
409
  A,
406
410
  {
407
411
  isOpen: !0,
@@ -1,5 +1,5 @@
1
- import { u as I, f as q, a as Z, g as N, c as w } from "./COMMITS-K4Al1_wQ.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-K4Al1_wQ.js";
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 }) {