@mt-gloss/ui 0.1.127 → 0.1.128

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.
@@ -889,8 +889,10 @@ const tn = {
889
889
  "viewport-collapse": !1,
890
890
  unmount: !1,
891
891
  "nav-escape-hatch": !1,
892
- "drag-start": !1
892
+ "drag-start": !1,
893
893
  // Phase 11.6 D-19 — R9 drag-start auto-close discards buffer
894
+ "section-hidden": !1
895
+ // 260524 panel-x-axis-transitions — viewport shrank past targetSection
894
896
  };
895
897
  export {
896
898
  tn as C,
@@ -1,5 +1,5 @@
1
- import { u as M, g as he, h as Y, f as we, S as Te, b as Pe, j as Ae } from "./COMMITS-DlJB1KcF.js";
2
- import { C as zt, N as Ht, n as Ut, o as Bt, k as Yt, c as Vt, m as Kt, P as qt, l as Qt, e as Wt, i as Gt, r as jt, d as Zt } from "./COMMITS-DlJB1KcF.js";
1
+ import { u as M, g as he, h as Y, f as we, S as Te, b as Pe, j as Ae } from "./COMMITS-WBmqrmdI.js";
2
+ import { C as zt, N as Ht, n as Ut, o as Bt, k as Yt, c as Vt, m as Kt, P as qt, l as Qt, e as Wt, i as Gt, r as jt, d as Zt } from "./COMMITS-WBmqrmdI.js";
3
3
  import { jsx as a, jsxs as f, Fragment as V } from "react/jsx-runtime";
4
4
  import H, { useState as A, useRef as K, createContext as fe, useContext as ge, useMemo as le, useEffect as F, useCallback as L, useLayoutEffect as xe } from "react";
5
5
  import { useSensors as ke, useSensor as ie, PointerSensor as De, KeyboardSensor as Le, DndContext as Me, closestCenter as Oe } from "@dnd-kit/core";
@@ -1295,30 +1295,34 @@ function Mt() {
1295
1295
  ) });
1296
1296
  }
1297
1297
  const at = 700;
1298
- function st(e) {
1299
- const [t, r] = A(null), l = K(null);
1298
+ function st(e, t) {
1299
+ const [r, l] = A(null), n = K(null);
1300
1300
  return F(() => {
1301
1301
  if (e != null) {
1302
- l.current != null && (clearTimeout(l.current), l.current = null), r(null);
1302
+ n.current != null && (clearTimeout(n.current), n.current = null), l(null);
1303
1303
  return;
1304
1304
  }
1305
- return l.current = setTimeout(() => {
1306
- r(null), l.current = null;
1305
+ if (t) {
1306
+ n.current != null && (clearTimeout(n.current), n.current = null), l(null);
1307
+ return;
1308
+ }
1309
+ return n.current = setTimeout(() => {
1310
+ l(null), n.current = null;
1307
1311
  }, at), () => {
1308
- l.current != null && (clearTimeout(l.current), l.current = null);
1312
+ n.current != null && (clearTimeout(n.current), n.current = null);
1309
1313
  };
1310
- }, [e]), F(() => {
1311
- e != null && r(e);
1312
- }, [e]), e != null ? { panelId: e, isOpen: !0 } : t != null ? { panelId: t, isOpen: !1 } : { panelId: null, isOpen: !1 };
1314
+ }, [e, t]), F(() => {
1315
+ e != null && l(e);
1316
+ }, [e]), e != null ? { panelId: e, isOpen: !0 } : r != null ? { panelId: r, isOpen: !1 } : { panelId: null, isOpen: !1 };
1313
1317
  }
1314
1318
  function Ot({ panelComponents: e, children: t }) {
1315
- const r = M(), l = st(r?.state.activePanelId ?? null);
1316
- if (r == null || l.panelId == null) return null;
1317
- const n = l.panelId, i = l.isOpen, u = e?.[n];
1318
- return u == null && t == null ? (process.env.NODE_ENV !== "production" && console.error(
1319
+ const r = M(), l = r?.state.lastClose?.reason === "section-hidden", n = st(r?.state.activePanelId ?? null, l);
1320
+ if (r == null || n.panelId == null) return null;
1321
+ const i = n.panelId, u = n.isOpen, o = e?.[i];
1322
+ return o == null && t == null ? (process.env.NODE_ENV !== "production" && console.error(
1319
1323
  "[panels] No panel component registered for activePanelId:",
1320
- n
1321
- ), null) : /* @__PURE__ */ a(Ae, { isOpen: i, children: u != null ? /* @__PURE__ */ a(u, { isOpen: i }) : t });
1324
+ i
1325
+ ), null) : /* @__PURE__ */ a(Ae, { isOpen: u, children: o != null ? /* @__PURE__ */ a(o, { isOpen: u }) : t });
1322
1326
  }
1323
1327
  function pe(e) {
1324
1328
  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;
package/index.js CHANGED
@@ -4,8 +4,8 @@ import { jsxs as f, jsx as r, Fragment as L } from "react/jsx-runtime";
4
4
  import * as $ from "react";
5
5
  import I, { useRef as M, useEffect as E, useState as A, useCallback as C, useId as Ne, forwardRef as Ge, useMemo as ce, useLayoutEffect as ke, createContext as He, useContext as We } from "react";
6
6
  import { motion as B, useMotionValue as Ve, AnimatePresence as je, useDragControls as Ke } from "framer-motion";
7
- import { u as Ue } from "./COMMITS-DlJB1KcF.js";
8
- import { N as Nl, C as kl, c as Sl, P as Dl, f as xl, S as Tl, e as Rl, i as Ml, r as Pl, b as Al, d as El, a as Fl } from "./COMMITS-DlJB1KcF.js";
7
+ import { u as Ue } from "./COMMITS-WBmqrmdI.js";
8
+ import { N as Nl, C as kl, c as Sl, P as Dl, f as xl, S as Tl, e as Rl, i as Ml, r as Pl, b as Al, d as El, a as Fl } from "./COMMITS-WBmqrmdI.js";
9
9
  import { createPortal as Se } from "react-dom";
10
10
  import { B as Ye, U as de } from "./UIContext-Dm0GYHFT.js";
11
11
  import { a as Ll, u as Ol } from "./UIContext-Dm0GYHFT.js";
@@ -23,7 +23,7 @@
23
23
  * page-nav escape; spike enum has no `BACKDROP_CLICK` literal.
24
24
  */
25
25
  export type PanelId = 'settings' | 'catalog-add' | 'catalog-replace' | 'page-management' | 'notification-center';
26
- export type CloseReason = 'cancel-button' | 'apply-button' | 'header-x' | 'escape-key' | 'page-nav' | 'mutex-handoff' | 'ghost-anchor' | 'viewport-collapse' | 'unmount' | 'nav-escape-hatch' | 'drag-start';
26
+ export type CloseReason = 'cancel-button' | 'apply-button' | 'header-x' | 'escape-key' | 'page-nav' | 'mutex-handoff' | 'ghost-anchor' | 'viewport-collapse' | 'unmount' | 'nav-escape-hatch' | 'drag-start' | 'section-hidden';
27
27
  export type SurfaceState = 'idle' | 'bell-cutout-only' | 'panel-clean' | 'panel-dirty' | 'panel-clean+cutout' | 'panel-dirty+cutout' | 'notif-center';
28
28
  export type TriggerContext = {
29
29
  kind: 'bell';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mt-gloss/ui",
3
- "version": "0.1.127",
3
+ "version": "0.1.128",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "restricted"