@kerfjs/ui 5.0.0-beta.129 → 5.0.0-beta.130
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/ai/component-catalog.json +14 -9
- package/ai/component-composition-rules.json +1 -1
- package/ai/component-composition.d.ts +17 -0
- package/ai/component-composition.json +4 -3
- package/ai/component-composition.schema.json +326 -80
- package/ai/component-props-overlay.json +8568 -628
- package/ai/component-props-overlay.schema.json +15 -1
- package/ai/component-props.json +6221 -2069
- package/ai/component-props.schema.json +7 -0
- package/ai/components/radio-group.md +5 -1
- package/ai/components/state-banner.md +1 -1
- package/ai/components/surface-scaffold.md +3 -2
- package/ai/components/tab-bar.md +1 -1
- package/ai/components/toolbar-control-group.md +1 -1
- package/ai/public-api-signatures-v1.md +205 -42
- package/ai/skill.md +21 -8
- package/ai/view-document.schema.json +140 -86
- package/ai/webawesome-jsx-signatures-v1.md +1 -1
- package/dist/browser/column-explorer.js +5 -1
- package/dist/browser/radio-group.js +1 -0
- package/dist/catalog-resources.d.ts +2 -2
- package/dist/catalog.d.ts +2 -2
- package/dist/catalog.js +5 -5
- package/dist/{chunk-E2MTHHLS.js → chunk-2FA3SX57.js} +2 -2
- package/dist/{chunk-E2MTHHLS.js.map → chunk-2FA3SX57.js.map} +1 -1
- package/dist/{chunk-ZC4KSRAF.js → chunk-4CYCJ3NY.js} +6 -4
- package/dist/chunk-4CYCJ3NY.js.map +1 -0
- package/dist/{chunk-IMXLOMTF.js → chunk-76BLSFEA.js} +30 -12
- package/dist/chunk-76BLSFEA.js.map +1 -0
- package/dist/{chunk-IR32NI2O.js → chunk-ALBFHXMZ.js} +3 -3
- package/dist/chunk-ALBFHXMZ.js.map +1 -0
- package/dist/{chunk-3ZWYGGEC.js → chunk-ASU4ODOH.js} +38 -7
- package/dist/chunk-ASU4ODOH.js.map +1 -0
- package/dist/chunk-BMUYZKXW.js +155 -0
- package/dist/chunk-BMUYZKXW.js.map +1 -0
- package/dist/{chunk-GQUDCWOD.js → chunk-D2KHQNJ6.js} +49 -23
- package/dist/chunk-D2KHQNJ6.js.map +1 -0
- package/dist/{chunk-34FWYJX6.js → chunk-ECJHCPBN.js} +8 -2
- package/dist/chunk-ECJHCPBN.js.map +1 -0
- package/dist/{chunk-DBCDYBZP.js → chunk-HHEBNP6Z.js} +2 -2
- package/dist/{chunk-DBCDYBZP.js.map → chunk-HHEBNP6Z.js.map} +1 -1
- package/dist/{chunk-3ZKUXWAV.js → chunk-IPYQYLSX.js} +16 -9
- package/dist/chunk-IPYQYLSX.js.map +1 -0
- package/dist/{chunk-SJEPM5ZU.js → chunk-LETAE6SX.js} +2 -2
- package/dist/{chunk-SJEPM5ZU.js.map → chunk-LETAE6SX.js.map} +1 -1
- package/dist/chunk-MVWR5WRX.js +99 -0
- package/dist/chunk-MVWR5WRX.js.map +1 -0
- package/dist/{chunk-6T7AX365.js → chunk-OSL4LQ7T.js} +52 -23
- package/dist/chunk-OSL4LQ7T.js.map +1 -0
- package/dist/{chunk-OHT2AXER.js → chunk-QSJAIXLM.js} +19 -3
- package/dist/chunk-QSJAIXLM.js.map +1 -0
- package/dist/{chunk-UQ4FRQ6M.js → chunk-R4JK2C6D.js} +13 -3
- package/dist/chunk-R4JK2C6D.js.map +1 -0
- package/dist/{chunk-5A2DN3LR.js → chunk-SGYBIKQA.js} +3 -1
- package/dist/chunk-SGYBIKQA.js.map +1 -0
- package/dist/{chunk-K3C35KGR.js → chunk-XO5IOPM5.js} +2 -2
- package/dist/{chunk-K3C35KGR.js.map → chunk-XO5IOPM5.js.map} +1 -1
- package/dist/collapsible-panel.d.ts +2 -2
- package/dist/collapsible-panel.js +2 -2
- package/dist/column-explorer.d.ts +5 -1
- package/dist/column-explorer.js +5 -1
- package/dist/column-track.d.ts +3 -1
- package/dist/column-track.js +1 -1
- package/dist/editor.d.ts +87 -2
- package/dist/editor.js +2249 -1320
- package/dist/editor.js.map +1 -1
- package/dist/index.js +12 -12
- package/dist/list-detail-dialog.d.ts +2 -2
- package/dist/list-detail-dialog.js +4 -4
- package/dist/list-header.d.ts +47 -5
- package/dist/list-header.js +1 -1
- package/dist/message-composer.js +1 -1
- package/dist/{nav-stack-vQ3ieerq.d.ts → nav-stack-DKrvqFjA.d.ts} +1 -1
- package/dist/nav-stack.d.ts +2 -2
- package/dist/nav-stack.js +1 -1
- package/dist/{panel-toolbar-vg6Ir5Dy.d.ts → panel-toolbar-CEcHHDkn.d.ts} +8 -0
- package/dist/radio-group.d.ts +19 -2
- package/dist/radio-group.js +3 -1
- package/dist/split-view.d.ts +2 -2
- package/dist/split-view.js +1 -1
- package/dist/styles/column-track.css +7 -2
- package/dist/styles/components/actions/toolbar-control-group/toolbar-control-group.css +11 -4
- package/dist/styles/components/collections/list-header/list-header.css +50 -0
- package/dist/styles/components/collections/list-item/list-item.css +6 -1
- package/dist/styles/components/collections/tree-list/tree-list.css +3 -2
- package/dist/styles/components/forms/radio-group/radio-group.css +107 -0
- package/dist/styles/components/layout/column-track/column-track.css +7 -2
- package/dist/styles/components/surfaces/surface-scaffold/surface-scaffold.css +30 -1
- package/dist/styles/editor/editor.css +0 -23
- package/dist/styles/list-header.css +50 -0
- package/dist/styles/list-item.css +6 -1
- package/dist/styles/radio-group.css +107 -0
- package/dist/styles/surface-scaffold.css +30 -1
- package/dist/styles/toolbar-control-group.css +11 -4
- package/dist/styles/tree-list.css +3 -2
- package/dist/surface-scaffold-register.js +1 -1
- package/dist/surface-scaffold.d.ts +46 -11
- package/dist/surface-scaffold.js +2 -2
- package/dist/toolbar-control-group.d.ts +10 -1
- package/dist/toolbar-control-group.js +1 -1
- package/dist/tree-list.d.ts +7 -1
- package/dist/tree-list.js +1 -1
- package/dist/view-runtime.d.ts +9 -0
- package/dist/view-runtime.js +8 -0
- package/dist/view-runtime.js.map +1 -0
- package/dist/wire-catalog.d.ts +2 -2
- package/dist/wire-catalog.js +1 -1
- package/dist/wire-search-fields.js +1 -1
- package/dist/wire-tab-bars.d.ts +10 -0
- package/dist/wire-tab-bars.js +1 -1
- package/dist/wire-tag-fields.js +1 -1
- package/dist/wire-workbench.d.ts +17 -1
- package/dist/wire-workbench.js +1 -1
- package/dist/workbench-dialog.d.ts +2 -2
- package/dist/workbench-dialog.js +4 -4
- package/dist/workbench.d.ts +10 -2
- package/dist/workbench.js +1 -1
- package/docs/accessibility.md +1 -1
- package/docs/column-explorer.md +4 -0
- package/docs/component-contract.md +10 -4
- package/docs/component-integration.md +7 -3
- package/docs/component-selection.md +2 -1
- package/docs/design/sketch/Kerf-UI.sketch +0 -0
- package/docs/design/sketch/coverage.md +7 -6
- package/docs/design/sketch/forms/README.md +5 -4
- package/docs/design/sketch/unified/pages/forms.png +0 -0
- package/docs/design/templates/radio-group/tiles-dark.svg +1 -0
- package/docs/design/templates/radio-group/tiles.svg +1 -0
- package/docs/design/templates/radio-group-dark.svg +1 -1
- package/docs/design/templates/radio-group.svg +1 -1
- package/docs/editor-host.md +90 -5
- package/docs/interaction-conventions.md +2 -0
- package/docs/layout.md +1 -1
- package/docs/surface-scaffold.md +49 -2
- package/docs/tree-list.md +10 -0
- package/docs/workbench.md +16 -0
- package/evaluator/firefox-app-data.d.mts +4 -0
- package/evaluator/firefox-app-data.mjs +35 -0
- package/evaluator/index.mjs +19 -5
- package/llms.txt +20 -4
- package/package.json +8 -1
- package/props/component-props.d.mts +3 -0
- package/view/cli.mjs +36 -5
- package/view/contract.mjs +3 -0
- package/view/generate.mjs +8 -7
- package/view/index.d.mts +14 -0
- package/view/project-types-worker.mjs +55 -0
- package/view/project-types.d.mts +43 -0
- package/view/project-types.mjs +618 -0
- package/view/type-expression.d.mts +15 -0
- package/view/type-expression.mjs +162 -0
- package/view/types.mjs +4 -0
- package/view/validate.mjs +20 -1
- package/vite-editor.d.mts +31 -3
- package/vite-editor.mjs +168 -4
- package/dist/chunk-34FWYJX6.js.map +0 -1
- package/dist/chunk-3ZKUXWAV.js.map +0 -1
- package/dist/chunk-3ZWYGGEC.js.map +0 -1
- package/dist/chunk-5A2DN3LR.js.map +0 -1
- package/dist/chunk-6T7AX365.js.map +0 -1
- package/dist/chunk-BMOZSNDU.js +0 -133
- package/dist/chunk-BMOZSNDU.js.map +0 -1
- package/dist/chunk-GQUDCWOD.js.map +0 -1
- package/dist/chunk-IMXLOMTF.js.map +0 -1
- package/dist/chunk-IR32NI2O.js.map +0 -1
- package/dist/chunk-MLDO7WLA.js +0 -82
- package/dist/chunk-MLDO7WLA.js.map +0 -1
- package/dist/chunk-OHT2AXER.js.map +0 -1
- package/dist/chunk-UQ4FRQ6M.js.map +0 -1
- package/dist/chunk-ZC4KSRAF.js.map +0 -1
|
@@ -122,7 +122,11 @@ function wireWorkbenchOverlays(root, findWorkbench, panels, exclusive = false) {
|
|
|
122
122
|
const active2 = responsive(element);
|
|
123
123
|
if (active2 && !inlineState.has(panel)) {
|
|
124
124
|
inlineState.set(panel, panel.collapsed.peek());
|
|
125
|
-
adapt(
|
|
125
|
+
adapt(
|
|
126
|
+
panel,
|
|
127
|
+
element,
|
|
128
|
+
!(panel.keepFocusedOpen && element.contains(ownerDocument.activeElement))
|
|
129
|
+
);
|
|
126
130
|
} else if (!active2 && inlineState.has(panel)) {
|
|
127
131
|
const remembered = inlineState.get(panel);
|
|
128
132
|
inlineState.delete(panel);
|
|
@@ -133,6 +137,10 @@ function wireWorkbenchOverlays(root, findWorkbench, panels, exclusive = false) {
|
|
|
133
137
|
rendered.dataset.responsiveOverlayActive = "true";
|
|
134
138
|
outOfFlow.delete(rendered);
|
|
135
139
|
}
|
|
140
|
+
if (panel.overlay && rendered) {
|
|
141
|
+
const overlay = overlaid(rendered);
|
|
142
|
+
if (panel.overlay.peek() !== overlay) panel.overlay.value = overlay;
|
|
143
|
+
}
|
|
136
144
|
}
|
|
137
145
|
if (!workbench) return;
|
|
138
146
|
const active = (key) => {
|
|
@@ -483,7 +491,15 @@ function wireWorkbench(root, {
|
|
|
483
491
|
}
|
|
484
492
|
const overlayPanels = keys.flatMap((key) => {
|
|
485
493
|
const collapsed = panels[key]?.collapsed;
|
|
486
|
-
return collapsed ? [
|
|
494
|
+
return collapsed ? [
|
|
495
|
+
{
|
|
496
|
+
key,
|
|
497
|
+
collapsed,
|
|
498
|
+
keepOpenOn: panels[key]?.keepOpenOn,
|
|
499
|
+
keepFocusedOpen: panels[key]?.keepFocusedOpen,
|
|
500
|
+
overlay: panels[key]?.overlay
|
|
501
|
+
}
|
|
502
|
+
] : [];
|
|
487
503
|
});
|
|
488
504
|
if (dismissOverlays && overlayPanels.length > 0) {
|
|
489
505
|
const selector2 = `[data-component="workbench"][id=${quoted(id)}]`;
|
|
@@ -505,4 +521,4 @@ function wireWorkbench(root, {
|
|
|
505
521
|
|
|
506
522
|
export { wireWorkbench };
|
|
507
523
|
|
|
508
|
-
//# sourceMappingURL=chunk-
|
|
524
|
+
//# sourceMappingURL=chunk-QSJAIXLM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/layout/workbench/internal/workbench-overlays.ts","../src/components/layout/workbench/wiring/wire-workbench.ts"],"names":["active","element","panel","inside","effect","selector"],"mappings":";;;;;AAuBA,IAAM,eAAA,GAAqD;AAAA,EACzD,QAAA,EAAU,uCAAA;AAAA,EACV,SAAA,EAAW,wCAAA;AAAA,EACX,YAAA,EAAc;AAChB,CAAA;AAGA,IAAM,aAAA,GAAgB,gDAAA;AAEtB,IAAM,cAAA,GAAoD;AAAA,EACxD,QAAA,EAAU,MAAA;AAAA,EACV,SAAA,EAAW,OAAA;AAAA,EACX,YAAA,EAAc;AAChB,CAAA;AAEA,IAAM,SAAA,GACJ,iJAAA;AAUF,IAAM,UAAA,GAAa,CAAC,OAAA,KAClB,CAAC,GAAG,OAAA,CAAQ,gBAAA,CAA8B,SAAS,CAAC,CAAA,CAAE,MAAA;AAAA,EACpD,CAAC,OAAA,KACC,OAAO,QAAQ,eAAA,KAAoB,UAAA,IACnC,QAAQ,eAAA;AACZ,CAAA;AAyCK,SAAS,qBAAA,CACd,IA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G;AAAA;AACxB,QAEF,EAAC;AAAA,EACP,CAAC,CAAA;AACD,EAAA,IAAI,eAAA,IAAmB,aAAA,CAAc,MAAA,GAAS,CAAA,EAAG;AAC/C,IAAA,MAAMC,SAAAA,GAAW,CAAA,gCAAA,EAAmC,MAAA,CAAO,EAAE,CAAC,CAAA,CAAA,CAAA;AAC9D,IAAA,SAAA,CAAU,IAAA;AAAA,MACR,qBAAA;AAAA,QACE,IAAA;AAAA,QACA,MACE,KAAK,OAAA,CAAQA,SAAQ,IACjB,IAAA,GACA,IAAA,CAAK,cAA2BA,SAAQ,CAAA;AAAA,QAC9C,aAAA;AAAA,QACA;AAAA;AACF,KACF;AAAA,EACF;AAEA,EAAA,OAAO,MAAM;AACX,IAAA,UAAA,IAAa;AACb,IAAA,UAAA,GAAa,MAAA;AACb,IAAA,KAAA,MAAW,OAAA,IAAW,SAAA,CAAU,MAAA,CAAO,CAAC,GAAG,OAAA,EAAQ;AAAA,EACrD,CAAA;AACF","file":"chunk-QSJAIXLM.js","sourcesContent":["// The transient-overlay behavior `wireWorkbench` gives Workbench panels that\n// present as overlays: a responsive overlay starts collapsed when its\n// breakpoint begins to apply, an open overlay takes focus and keeps Tab inside\n// it, and it closes on Escape or a press outside it. It mirrors `wireSidebar`'s\n// compact overlay (the ARIA dialog pattern). Internal.\n\nimport { effect, type Signal } from 'kerfjs';\n\nimport { realmOf } from '../../../../shared/dom/realm.js';\nimport type { WorkbenchPanelKey } from '../model/workbench-resize.js';\n\n/** A Workbench panel whose app-owned `collapsed` signal the wiring may write. */\nexport interface WorkbenchOverlayPanel {\n key: WorkbenchPanelKey;\n collapsed: Signal<boolean>;\n keepOpenOn?: (target: Node) => boolean;\n /** Stay open as the overlay when it holds focus as its breakpoint begins. */\n keepFocusedOpen?: boolean;\n /** Kept equal to whether the panel presents as an overlay. */\n overlay?: Signal<boolean>;\n}\n\n/** Each panel's own element, never a nested Workbench's. */\nconst PANEL_SELECTORS: Record<WorkbenchPanelKey, string> = {\n leftRail: ':scope > [data-workbench-rail=\"left\"]',\n rightRail: ':scope > [data-workbench-rail=\"right\"]',\n bottomDrawer: ':scope > .kui-workbench__center > [data-workbench-drawer]',\n};\n\n/** Any Workbench panel element: a rail or the bottom drawer. */\nconst PANEL_ELEMENT = '[data-workbench-rail], [data-workbench-drawer]';\n\nconst RESTORE_PANELS: Record<WorkbenchPanelKey, string> = {\n leftRail: 'left',\n rightRail: 'right',\n bottomDrawer: 'bottom',\n};\n\nconst FOCUSABLE =\n 'a[href],area[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * The panel's focusable controls, in tab order. Only an open panel is ever\n * asked. The selector drops disabled controls and `tabindex=\"-1\"`; a\n * rendered control the CSS hides (the separator of a panel whose responsive\n * overlay breakpoint applies is `display: none`) is dropped too, or Tab would\n * wrap from a control focus can never reach. Where `checkVisibility` is\n * missing, every matched control counts.\n */\nconst focusables = (element: HTMLElement): HTMLElement[] =>\n [...element.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (control) =>\n typeof control.checkVisibility !== 'function' ||\n control.checkVisibility(),\n );\n\n/**\n * Wire transient overlay behavior for the given panels of the Workbench that\n * `findWorkbench` returns (looked up on use, so the Workbench may render after\n * wire-up). The app still owns each `collapsed` signal; this wiring only\n * writes it:\n *\n * - When a panel's `responsiveOverlayAt` breakpoint begins to apply (at\n * wire-up, on first render, or on a crossing), its inline collapsed state is\n * remembered and the panel collapses, so no overlay covers the work area\n * until the user opens it — unless the panel sets `keepFocusedOpen` and\n * holds focus: then it stays open as the overlay, keeping its focus. When the breakpoint stops applying (or on\n * disposal) the remembered state comes back. These presentation changes\n * skip the collapse motion.\n * - A panel that opens while it presents as an overlay takes focus: its\n * first focusable control (else the panel itself) is focused, without\n * scrolling its sliding content. While an overlay is open, Tab and\n * Shift+Tab cycle through the controls of the overlay that holds focus\n * (else the most recently opened one) and never reach the work area it\n * covers — the ARIA dialog pattern `wireSidebar`'s compact overlay follows.\n * Inline panels are left alone.\n * - Escape closes the open overlay panel that holds focus, else the most\n * recently opened one; a press that starts and ends outside an open overlay\n * panel closes it. Static `presentation: \"overlay\"` panels are included.\n * - Focus stranded in a panel that closes — however it closed, including\n * through the app's own control inside it — returns to the control that\n * had it when the panel opened, else to the panel's restore control, else\n * to a control outside it whose `aria-controls` names the panel (or an\n * element inside it). The last covers a panel that was already open at\n * wire-up, which has no recorded opener. Focus a press inside the panel\n * dropped to the body counts as stranded too: Safari and macOS WebKit\n * never focus a clicked button, so pressing the panel's own close control\n * blurs the focused control before the click closes the panel. Focus the\n * user has since moved to any element is left where it is.\n * - With `exclusive`, a panel that opens while it presents as an overlay\n * closes every other open overlay panel, so overlays never cover each\n * other's controls. Inline panels are never closed by it.\n *\n * Returns a disposer.\n */\nexport function wireWorkbenchOverlays(\n root: HTMLElement,\n findWorkbench: () => HTMLElement | null,\n panels: readonly WorkbenchOverlayPanel[],\n exclusive = false,\n): () => void {\n const ownerDocument = root.ownerDocument;\n const view = realmOf(root);\n const disposers: Array<() => void> = [];\n // Open panels, most recently opened last, and each one's opener: the\n // control that had focus when it opened.\n const openOrder: WorkbenchOverlayPanel[] = [];\n const openers = new Map<WorkbenchOverlayPanel, HTMLElement>();\n // The open panel the latest press started in while focus was inside it,\n // until focus next lands anywhere. Safari and macOS WebKit never focus a\n // clicked button, so pressing a panel's own close control blurs the focused\n // control to the body before the click closes the panel; this is how the\n // close still counts as leaving focus stranded in it.\n let pressedFocus: WorkbenchOverlayPanel | undefined;\n /**\n * The `aria-controls` control a click just activated, kept for a couple of\n * frames: the toggle a panel opens or closes from, even once the app's\n * render has removed it.\n */\n let activated: HTMLElement | undefined;\n\n const panelElement = (panel: WorkbenchOverlayPanel): HTMLElement | null =>\n findWorkbench()?.querySelector<HTMLElement>(PANEL_SELECTORS[panel.key]) ??\n null;\n /**\n * Each panel element's computed \"out of flow\" state, so a mutation or a\n * press does not force a document-wide style recalculation to read it. Its\n * inputs are the Workbench's inline size (the container queries), the root\n * font size (rem breakpoints), and the panel's own presentation attributes:\n * a ResizeObserver callback clears every entry, and a presentation attribute\n * change, whoever writes it, clears that panel's entry. A re-rendered panel\n * is a new element and is measured afresh. Without a ResizeObserver to\n * report a breakpoint crossing, nothing is cached.\n */\n let outOfFlow = new WeakMap<HTMLElement, boolean>();\n /** Whether the panel's responsive overlay breakpoint currently applies. */\n const responsive = (element: HTMLElement): boolean => {\n if (\n element.dataset.presentation !== 'inline' ||\n !element.hasAttribute('data-responsive-overlay-at')\n )\n return false;\n const cached = outOfFlow.get(element);\n if (cached !== undefined) return cached;\n const absolute =\n globalThis.getComputedStyle(element).position === 'absolute';\n if (resizeObserver) outOfFlow.set(element, absolute);\n return absolute;\n };\n const overlaid = (element: HTMLElement): boolean =>\n element.dataset.presentation === 'overlay' || responsive(element);\n\n /** Where focus goes when a panel it was in closes. */\n const restoreTarget = (\n panel: WorkbenchOverlayPanel,\n element: HTMLElement | null,\n ): HTMLElement | undefined => {\n const opener = openers.get(panel);\n // An opener inside another panel that has closed since (an exclusive\n // overlay closes the one it was opened from) would strand focus there too.\n if (\n opener?.isConnected &&\n !element?.contains(opener) &&\n !panels.some(\n (other) =>\n other.collapsed.peek() && panelElement(other)?.contains(opener),\n )\n )\n return opener;\n const side = RESTORE_PANELS[panel.key];\n const restore = findWorkbench()\n ?.querySelector<HTMLElement>(\n `.kui-workbench__restore[data-panel=\"${side}\"]`,\n )\n ?.querySelector<HTMLElement>(FOCUSABLE);\n return restore ?? (element ? controller(element) : undefined);\n };\n /**\n * A control outside the panel that names it, or an element inside it, in\n * its `aria-controls`: the app's toggle for a panel with no opener.\n */\n const controller = (element: HTMLElement): HTMLElement | undefined => {\n const ids = new Set(\n [element, ...element.querySelectorAll('[id]')].map((node) => node.id),\n );\n ids.delete('');\n return [\n ...ownerDocument.querySelectorAll<HTMLElement>('[aria-controls]'),\n ].find(\n (control) =>\n !element.contains(control) &&\n control.matches(FOCUSABLE) &&\n control\n .getAttribute('aria-controls')!\n .split(/\\s+/)\n .some((id) => ids.has(id)),\n );\n };\n /** Whether a control's `aria-controls` (always present) names panel `id`. */\n const namesPanel = (control: Element, id: string): boolean =>\n control.getAttribute('aria-controls')!.split(/\\s+/).includes(id);\n /** The panel's own control for itself: its toggle inside it. */\n const controlInside = (element: HTMLElement): HTMLElement | undefined =>\n [...element.querySelectorAll<HTMLElement>('[aria-controls]')].find(\n (control) =>\n control.matches(FOCUSABLE) && namesPanel(control, element.id),\n );\n const rescueFocus = (panel: WorkbenchOverlayPanel): void => {\n const element = panelElement(panel);\n const target = restoreTarget(panel, element);\n if (target) {\n target.focus();\n return;\n }\n // An app that renders its restore control after this write has not\n // produced it yet; look again once the current batch settles.\n globalThis.queueMicrotask(() => {\n if (!panel.collapsed.peek()) return;\n const later = restoreTarget(panel, panelElement(panel));\n const active = ownerDocument.activeElement;\n if (later) later.focus();\n else if (active instanceof HTMLElement && element?.contains(active))\n active.blur();\n });\n };\n\n /**\n * A presentation-driven write: no collapse motion, because nothing the user\n * did moved the panel. The app's render has normally applied the new state\n * by the time the write returns, so the content's transition is suspended\n * across one style flush.\n */\n const adapt = (\n panel: WorkbenchOverlayPanel,\n element: HTMLElement,\n collapsed: boolean,\n ): void => {\n if (panel.collapsed.peek() === collapsed) return;\n const stranded = collapsed && element.contains(ownerDocument.activeElement);\n panel.collapsed.value = collapsed;\n // Every Workbench panel renders its content wrapper, and never with a\n // style of its own, so the attribute goes again once the flush is done.\n const content = element.querySelector<HTMLElement>(\n ':scope > .kui-workbench__panel-content',\n )!;\n content.style.transition = 'none';\n void globalThis.getComputedStyle(content).transform;\n content.removeAttribute('style');\n // The collapse effect has normally returned the focus already; on\n // disposal, after the effects are gone, this is what returns it.\n if (stranded && element.contains(ownerDocument.activeElement))\n rescueFocus(panel);\n };\n\n // The inline collapsed state of each panel whose responsive overlay\n // currently applies, restored when it stops applying.\n const inlineState = new Map<WorkbenchOverlayPanel, boolean>();\n // The Workbench's measured width, for numeric thresholds; cleared with the\n // presentation cache, and when the Workbench element changes.\n let measuredWidth: { workbench: HTMLElement; width: number } | undefined;\n const workbenchWidth = (workbench: HTMLElement): number => {\n if (measuredWidth?.workbench === workbench) return measuredWidth.width;\n const width = workbench.getBoundingClientRect().width;\n if (resizeObserver) measuredWidth = { workbench, width };\n return width;\n };\n const sync = (): void => {\n const workbench = findWorkbench();\n let width: number | undefined;\n for (const panel of panels) {\n const element = panelElement(panel);\n if (!element) continue;\n // CSS container queries cannot take a runtime pixel value. For a\n // numeric threshold the same measured Workbench width drives the CSS\n // presentation hook and the collapsed-state transition below.\n const at = Number(element.dataset.responsiveOverlayAt);\n const customActive =\n element.dataset.responsiveOverlayAt !== undefined &&\n Number.isFinite(at) &&\n at > 0 &&\n element.dataset.presentation === 'inline' &&\n (width ??= workbenchWidth(workbench!)) <= at;\n if (customActive) {\n if (element.dataset.responsiveOverlayActive !== 'true') {\n element.dataset.responsiveOverlayActive = 'true';\n outOfFlow.delete(element);\n }\n } else if (element.hasAttribute('data-responsive-overlay-active')) {\n element.removeAttribute('data-responsive-overlay-active');\n outOfFlow.delete(element);\n }\n const active = responsive(element);\n if (active && !inlineState.has(panel)) {\n inlineState.set(panel, panel.collapsed.peek());\n // A panel that opts in and holds focus (the user is working in it)\n // stays open as the overlay, so narrowing keeps the field in hand.\n adapt(\n panel,\n element,\n !(\n panel.keepFocusedOpen &&\n element.contains(ownerDocument.activeElement)\n ),\n );\n } else if (!active && inlineState.has(panel)) {\n const remembered = inlineState.get(panel)!;\n inlineState.delete(panel);\n adapt(panel, element, remembered);\n }\n // A signal write can patch or replace the panel synchronously. Preserve\n // the measured presentation marker on the rendered element too.\n const rendered = panelElement(panel);\n if (\n rendered &&\n customActive &&\n rendered.dataset.responsiveOverlayActive !== 'true'\n ) {\n rendered.dataset.responsiveOverlayActive = 'true';\n outOfFlow.delete(rendered);\n }\n // Last, after any collapse above, so a toggle that renders from it\n // reads the panel's settled presentation.\n if (panel.overlay && rendered) {\n const overlay = overlaid(rendered);\n if (panel.overlay.peek() !== overlay) panel.overlay.value = overlay;\n }\n }\n if (!workbench) return;\n // A direct root attribute limits style invalidation to overlay changes.\n // Descendant :has() selectors on the Workbench caused every ordinary\n // work-area mutation to restyle the entire center subtree.\n const active = (key: WorkbenchPanelKey): HTMLElement | null => {\n const element = workbench.querySelector<HTMLElement>(\n PANEL_SELECTORS[key],\n );\n return element?.dataset.responsiveOverlayActive === 'true'\n ? element\n : null;\n };\n const left = active('leftRail');\n const right = active('rightRail');\n const drawer = active('bottomDrawer');\n const railOpen = [left, right].some(\n (element) => element && element.dataset.collapsed !== 'true',\n );\n const markers = [\n left && 'left',\n right && 'right',\n drawer && 'drawer',\n railOpen && 'rail-open',\n (railOpen || (drawer && drawer.dataset.collapsed !== 'true')) && 'open',\n ]\n .filter(Boolean)\n .join(' ');\n if (markers) {\n if (workbench.dataset.numericOverlays !== markers)\n workbench.dataset.numericOverlays = markers;\n } else if (workbench.hasAttribute('data-numeric-overlays'))\n workbench.removeAttribute('data-numeric-overlays');\n };\n\n // The Workbench is its own breakpoint container, so its size is what moves a\n // panel across the breakpoint. It may render after wire-up or be replaced,\n // and the app may change a presentation, so both are observed too.\n let observed: HTMLElement | null = null;\n const resizeObserver =\n typeof globalThis.ResizeObserver === 'function'\n ? new globalThis.ResizeObserver(() => {\n outOfFlow = new WeakMap();\n measuredWidth = undefined;\n sync();\n })\n : undefined;\n /** Observe the current Workbench; whether it changed. */\n const track = (): boolean => {\n const workbench = findWorkbench();\n if (workbench === observed) return false;\n if (observed) resizeObserver?.unobserve(observed);\n observed = workbench;\n if (workbench) resizeObserver?.observe(workbench);\n return true;\n };\n // Only a mutation that can change a panel's presentation re-syncs: a new\n // Workbench, a panel element added or removed, or a presentation attribute\n // change on a panel. Other renders below root (a CollapsiblePanel's\n // `data-collapsed`, a list's rows) are skipped, so they never force style.\n const isPanel = (node: Node): boolean =>\n node instanceof HTMLElement && node.matches(PANEL_ELEMENT);\n const hasPanel = (nodes: NodeList): boolean => {\n for (const node of nodes) if (isPanel(node)) return true;\n return false;\n };\n const mutationObserver = new view.MutationObserver((records) => {\n let relevant = track();\n for (const record of records) {\n if (record.type === 'attributes') {\n if (!isPanel(record.target)) continue;\n if (record.attributeName !== 'data-collapsed')\n outOfFlow.delete(record.target as HTMLElement);\n relevant = true;\n } else if (\n !relevant &&\n (hasPanel(record.addedNodes) || hasPanel(record.removedNodes))\n )\n relevant = true;\n }\n if (relevant) sync();\n });\n mutationObserver.observe(root, {\n attributes: true,\n attributeFilter: [\n 'data-presentation',\n 'data-responsive-overlay-at',\n 'data-responsive-overlay-active',\n 'data-collapsed',\n ],\n childList: true,\n subtree: true,\n });\n // The breakpoints are in rem, so a root font-size change (a text-size\n // setting applied after load) moves a panel across them without resizing\n // the Workbench. A 1rem probe outside the app's tree reports that change.\n const remProbe = ownerDocument.createElement('div');\n remProbe.setAttribute('aria-hidden', 'true');\n remProbe.style.cssText =\n 'position:absolute;width:1rem;height:0;overflow:hidden;visibility:hidden;pointer-events:none';\n if (resizeObserver) {\n ownerDocument.body.append(remProbe);\n resizeObserver.observe(remProbe);\n }\n disposers.push(() => {\n mutationObserver.disconnect();\n resizeObserver?.disconnect();\n remProbe.remove();\n });\n track();\n sync();\n\n for (const panel of panels) {\n let previous = panel.collapsed.peek();\n if (!previous) openOrder.push(panel);\n disposers.push(\n effect(() => {\n const collapsed = panel.collapsed.value;\n if (collapsed === previous) return;\n previous = collapsed;\n const index = openOrder.indexOf(panel);\n if (index >= 0) openOrder.splice(index, 1);\n if (collapsed) {\n // Whatever closed the panel — Escape, an outside press, a\n // breakpoint, or the app's own control inside it — focus left in\n // it would be stranded in a hidden panel. So would focus that a\n // press inside it dropped to the body (see `pressedFocus`).\n const active = ownerDocument.activeElement;\n const element = panelElement(panel);\n if (\n element?.contains(active) ||\n // The panel's own control closed it (focused or not), so hand\n // focus to the control that reopens it.\n (activated !== undefined && element?.contains(activated)) ||\n (pressedFocus === panel &&\n (active === null || active === ownerDocument.body))\n )\n rescueFocus(panel);\n return;\n }\n openOrder.push(panel);\n const element = panelElement(panel);\n const active = ownerDocument.activeElement;\n if (\n active instanceof HTMLElement &&\n active !== ownerDocument.body &&\n !element?.contains(active)\n )\n openers.set(panel, active);\n else openers.delete(panel);\n // A focused toggle the app's render removes as the panel opens — a\n // Workbench toolbar toggle leaves the work-area toolbar for the\n // panel's own — would drop focus to the body. Hand it to the panel's\n // own control for it, so a keyboard user keeps their place. The\n // render may land before this effect (the toggle is gone already, so\n // the activated control stands in for the opener) or after it, in a\n // microtask or a later frame.\n const toggle =\n openers.get(panel) ??\n (activated && element && namesPanel(activated, element.id)\n ? activated\n : undefined);\n if (toggle) {\n const handOff = (frames: number): void => {\n const focused = ownerDocument.activeElement;\n if (panel.collapsed.peek()) return;\n if (toggle.isConnected) {\n if (toggle === focused && frames > 0)\n view.requestAnimationFrame(() => handOff(frames - 1));\n return;\n }\n if (focused !== null && focused !== ownerDocument.body) return;\n const current = panelElement(panel);\n if (current) controlInside(current)?.focus({ preventScroll: true });\n };\n globalThis.queueMicrotask(() => handOff(5));\n }\n if (!element || !overlaid(element)) return;\n // Opening an overlay closes the others. Their collapse effects run\n // after this one, by which time focus has moved into this panel, so\n // none of them hands it back to an opener.\n if (exclusive)\n for (const [other] of openOverlays())\n if (other !== panel) other.collapsed.value = true;\n // An overlay covers the work area, so focus moves in with it rather\n // than staying on a control it may cover. Without preventScroll the\n // browser scrolls the panel's clipped, still-sliding content to reveal\n // the target, which then unwinds as the slide finishes.\n (focusables(element)[0] ?? element).focus({ preventScroll: true });\n // The app's render may show the panel after this effect (its render\n // effect runs later, or in a later frame), so the focus above can\n // land on a still-hidden panel and do nothing. The Workbench's own\n // toggle recovers through the hand-off once it is removed; a\n // persistent toggle outside the Workbench never is, so retry for a\n // few frames until the overlay can take focus. Only focus left on\n // the opener or the body is moved, never focus the person moved.\n const opener = openers.get(panel);\n const focusIn = (frames: number): void => {\n const current = panelElement(panel);\n const focused = ownerDocument.activeElement;\n if (\n panel.collapsed.peek() ||\n !current ||\n current.contains(focused) ||\n !overlaid(current) ||\n (focused !== null &&\n focused !== ownerDocument.body &&\n focused !== opener)\n )\n return;\n focusables(current)[0]?.focus({ preventScroll: true });\n if (current.contains(ownerDocument.activeElement)) return;\n if (frames > 0) view.requestAnimationFrame(() => focusIn(frames - 1));\n else current.focus({ preventScroll: true });\n };\n if (!element.contains(ownerDocument.activeElement))\n view.requestAnimationFrame(() => focusIn(8));\n }),\n );\n }\n\n /** The open overlay panels with their elements, most recent last. */\n const openOverlays = (): Array<[WorkbenchOverlayPanel, HTMLElement]> =>\n openOrder.flatMap((panel): Array<[WorkbenchOverlayPanel, HTMLElement]> => {\n const element = panelElement(panel);\n return !panel.collapsed.peek() && element && overlaid(element)\n ? [[panel, element]]\n : [];\n });\n\n const inAllowedPortal = (\n panel: WorkbenchOverlayPanel,\n path: EventTarget[],\n ): boolean => {\n const keepOpenOn = panel.keepOpenOn;\n return Boolean(\n keepOpenOn &&\n path.some((target) => target instanceof Node && keepOpenOn(target)),\n );\n };\n\n const onKeydown = (event: KeyboardEvent): void => {\n if (\n (event.key !== 'Escape' && event.key !== 'Tab') ||\n event.defaultPrevented\n )\n return;\n const open = openOverlays();\n if (open.length === 0) return;\n // A dialog or menu launched from a panel owns its own keyboard handling.\n if (open.some(([panel]) => inAllowedPortal(panel, event.composedPath())))\n return;\n const active = ownerDocument.activeElement;\n const [panel, element] =\n open.find(([, candidate]) => candidate.contains(active)) ??\n open[open.length - 1]!;\n if (event.key === 'Escape') {\n event.preventDefault();\n // The collapse effect returns focus stranded inside it.\n panel.collapsed.value = true;\n return;\n }\n // Tab stays inside the open overlay: it wraps at either end, and focus\n // that is somewhere else (the app moved it, or the panel had no control\n // to take it when it opened) comes back in.\n const items = focusables(element);\n if (items.length === 0) return;\n const first = items[0]!;\n const last = items[items.length - 1]!;\n const inside = element.contains(active);\n if (event.shiftKey && (!inside || active === first)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && (!inside || active === last)) {\n event.preventDefault();\n first.focus();\n }\n };\n\n // An outside press closes an open overlay when it both starts and ends\n // outside it. Deciding at the click lets an app toggle that closes the panel\n // run first, and a press that opens a panel never closes it.\n let pressed: WorkbenchOverlayPanel[] = [];\n const inside = (\n panel: WorkbenchOverlayPanel,\n element: HTMLElement,\n path: EventTarget[],\n ): boolean => path.includes(element) || inAllowedPortal(panel, path);\n const onPointerdown = (event: PointerEvent): void => {\n const path = event.composedPath();\n pressed = openOverlays()\n .filter(([panel, element]) => !inside(panel, element, path))\n .map(([panel]) => panel);\n // Before the press's default action moves focus: the open panel it\n // started in, when focus was inside that panel too.\n const active = ownerDocument.activeElement;\n pressedFocus = panels.find((panel) => {\n if (panel.collapsed.peek()) return false;\n const element = panelElement(panel);\n return !!element && path.includes(element) && element.contains(active);\n });\n };\n // Focus landing anywhere is a deliberate move the rescue must not undo.\n const onFocusin = (): void => {\n pressedFocus = undefined;\n };\n const onClick = (event: MouseEvent): void => {\n const candidates = pressed;\n pressed = [];\n const path = event.composedPath();\n for (const [panel, element] of openOverlays())\n if (candidates.includes(panel) && !inside(panel, element, path))\n panel.collapsed.value = true;\n };\n const onActivate = (event: MouseEvent): void => {\n const target = event.target;\n const control =\n target instanceof Element\n ? target.closest<HTMLElement>('[aria-controls]')\n : null;\n // Recorded whether or not it took focus: Safari and macOS WebKit never\n // focus a clicked button.\n if (!control) return;\n activated = control;\n // The collapse effect may run after the click's dispatch (the app can\n // batch its write), so keep the control for a couple of frames.\n view.requestAnimationFrame(() =>\n view.requestAnimationFrame(() => {\n if (activated === control) activated = undefined;\n }),\n );\n };\n ownerDocument.addEventListener('keydown', onKeydown);\n ownerDocument.addEventListener('pointerdown', onPointerdown, true);\n ownerDocument.addEventListener('click', onActivate, true);\n ownerDocument.addEventListener('click', onClick);\n ownerDocument.addEventListener('focusin', onFocusin, true);\n disposers.push(() => {\n ownerDocument.removeEventListener('keydown', onKeydown);\n ownerDocument.removeEventListener('pointerdown', onPointerdown, true);\n ownerDocument.removeEventListener('click', onActivate, true);\n ownerDocument.removeEventListener('click', onClick);\n ownerDocument.removeEventListener('focusin', onFocusin, true);\n });\n\n return () => {\n for (const dispose of disposers.splice(0)) dispose();\n for (const panel of panels)\n panelElement(panel)?.removeAttribute('data-responsive-overlay-active');\n // After every observer and effect is gone, so handing the inline state\n // back cannot re-enter the wiring.\n for (const [panel, remembered] of inlineState) {\n const element = panelElement(panel);\n if (element) adapt(panel, element, remembered);\n else panel.collapsed.value = remembered;\n }\n inlineState.clear();\n };\n}\n","import { effect, type ReadonlySignal, type Signal } from 'kerfjs';\n\nimport type { DeviceClass } from '../../../../shared/environment/device-class.js';\nimport {\n type ResizeLimit,\n wireResizeHandles,\n} from '../../resizable-region/wiring/resize-wiring.js';\nimport {\n wireWorkbenchOverlays,\n type WorkbenchOverlayPanel,\n} from '../internal/workbench-overlays.js';\nimport {\n type WorkbenchPanelKey,\n workbenchRegionId,\n} from '../model/workbench-resize.js';\n\nexport type { WorkbenchPanelKey };\n\n/** Minimal `localStorage`-shaped store, so the persistence hook is testable. */\nexport interface WorkbenchStorage {\n getItem(key: string): string | null;\n setItem(key: string, value: string): void;\n}\n\n/** One Workbench panel's app-owned state. */\nexport interface WireWorkbenchPanel {\n /**\n * The app-owned size signal a `resizable` panel renders as its `size`.\n * `wireWorkbench` writes each committed resize here; collapsing never\n * touches it, so an expanded panel returns at the size it had. Omit it for\n * a panel that is not resizable.\n */\n size?: Signal<number>;\n /**\n * When set with `size`, the size is loaded from and saved to `storage`\n * under this key, so the panel remembers the user's size.\n */\n storageKey?: string;\n /**\n * The app-owned signal the panel renders as its `collapsed`. With it (and\n * `dismissOverlays`, on by default) `wireWorkbench` treats the panel as a\n * transient overlay while it presents as one: it collapses when its\n * `responsiveOverlayAt` breakpoint begins to apply and gets its inline state\n * back when the breakpoint stops applying, an open overlay takes focus and\n * keeps Tab inside it, and it closes on Escape or a press outside it.\n */\n collapsed?: Signal<boolean>;\n /**\n * Treat presses in a portal surface launched by this panel (for example a\n * body-level menu or dialog) as inside it. The predicate receives each Node\n * in the press's composed path; return true for the portal root. Ordinary\n * presses outside the panel and its allowed surfaces still dismiss it.\n */\n keepOpenOn?: (target: Node) => boolean;\n /**\n * Keep the panel open as the overlay when its `responsiveOverlayAt`\n * breakpoint begins to apply while it holds focus, instead of collapsing\n * it: a narrowing window then never takes away the field the user is\n * editing. An inspector or form panel opts in; a navigator usually does not.\n */\n keepFocusedOpen?: boolean;\n /**\n * An app-owned signal `wireWorkbench` keeps equal to whether the panel\n * presents as an overlay right now, whether through `presentation:\n * \"overlay\"` or its `responsiveOverlayAt` breakpoint. Render it as the\n * panel's `overlaid`, so the panel's toggle can show its `overlayLabel`.\n * Written only with `collapsed` and `dismissOverlays`.\n */\n overlay?: Signal<boolean>;\n}\n\n/** A resize the user made, after `wireWorkbench` wrote it to the size signal. */\nexport interface WorkbenchResize {\n panel: WorkbenchPanelKey;\n size: number;\n source: 'keyboard' | 'pointer';\n}\n\nexport interface WireWorkbenchOptions {\n /** The `id` the `Workbench` was rendered with. */\n id: string;\n /**\n * The wired panels, keyed like the `Workbench` props. Render a panel given\n * a `size` with `resizable` and `size={panel.size.value}`, and one given a\n * `collapsed` signal with `collapsed={panel.collapsed.value}`.\n */\n panels: Partial<Record<WorkbenchPanelKey, WireWorkbenchPanel>>;\n /**\n * When provided, resizing is suspended while `deviceClass.compact` is true —\n * the classes where rails become overlay drawers or are replaced.\n */\n deviceClass?: ReadonlySignal<DeviceClass>;\n /** Persistence store (default `globalThis.localStorage`, if present). */\n storage?: WorkbenchStorage;\n /** Keyboard step in px (default 16). */\n step?: number;\n /** Shift+arrow step in px (default 64). */\n largeStep?: number;\n /** Called after each committed resize. */\n onResize?: (change: WorkbenchResize) => void;\n /**\n * Treat the panels given a `collapsed` signal as transient overlays while\n * they present as overlays (default `true`), like `wireSidebar`'s compact\n * overlay: a panel whose `responsiveOverlayAt` breakpoint begins to apply\n * starts collapsed, with no collapse motion (unless its `keepFocusedOpen`\n * holds it open), and gets its inline collapsed\n * state back when the breakpoint stops applying (and on disposal); an open\n * overlay panel, responsive or `presentation: \"overlay\"`, closes on Escape\n * or a press that starts and ends outside it. A panel that opens as an\n * overlay takes focus on its first focusable control, and while it is open\n * Tab and Shift+Tab cycle through its controls instead of reaching the\n * work area it covers (the ARIA dialog pattern of `wireSidebar`'s compact\n * overlay); inline panels never move focus. Focus stranded in a closing\n * panel — however it closed, the app's own control inside it included —\n * returns to the control that had it when the panel opened, else to the\n * panel's restore control, else to a control outside the panel whose\n * `aria-controls` names it (each panel's `id` is its region id, e.g.\n * `studio-left-rail`) — the fallback for a panel already open at wire-up.\n * An opener inside a panel that has closed since is skipped. `false` leaves\n * every `collapsed` write and all focus handling to the app.\n */\n dismissOverlays?: boolean;\n /**\n * Keep overlays exclusive (default `true`), like `wireSidebar`'s\n * `exclusiveCompact`: when a panel opens while it presents as an overlay,\n * every other open overlay panel — rails and the bottom drawer alike —\n * closes, so one overlay never covers another's controls. Panels presenting\n * inline are never closed by it. Applies only with `dismissOverlays`.\n */\n exclusiveOverlays?: boolean;\n}\n\nfunction defaultStorage(): WorkbenchStorage | undefined {\n try {\n return globalThis.localStorage ?? undefined;\n } catch {\n return undefined;\n }\n}\n\n/** A stored size, or undefined when the stored text is not a usable size. */\nfunction storedSize(text: string | null) {\n if (text === null) return undefined;\n const size = Number(text);\n return Number.isFinite(size) && size > 0 ? Math.round(size) : undefined;\n}\n\n/** A double-quoted CSS attribute-selector value. */\nconst quoted = (value: string) =>\n `\"${value.replaceAll('\\\\', '\\\\\\\\').replaceAll('\"', '\\\\\"')}\"`;\n\nconst px = (value: string) => Number.parseFloat(value) || 0;\n\n/**\n * The largest size a resizable panel may take while the work area keeps its\n * minimum: for a rail, its minimum width (the Workbench's `mainMinSize`,\n * rendered as `data-main-min-size`) — the Workbench width, less that minimum,\n * the other in-flow rails as shown, and the rail's own safe-area extent and\n * border; for the bottom drawer, its minimum height (`mainMinHeight`, rendered\n * as `data-main-min-height`) — the work-area column's height, less that\n * minimum and the drawer's own safe-area extent and border. A panel the\n * container has already squeezed is held at the size it shows, so it can\n * shrink but not grow. Without layout (no box yet) or a minimum, the panel's\n * own maximum stands.\n */\nconst mainRoomLimit: ResizeLimit = (region, { max }) => {\n const horizontal = region.dataset.axis === 'horizontal';\n // A rail's parent is the Workbench; the drawer's is the work-area column.\n const container = region.parentElement;\n const workbench = horizontal ? container : container?.parentElement;\n const mainMin = Number(\n horizontal\n ? workbench?.dataset.mainMinSize\n : workbench?.dataset.mainMinHeight,\n );\n if (!container || !(mainMin > 0)) return max;\n const box = container.getBoundingClientRect();\n const room = horizontal ? box.width : box.height;\n if (room <= 0) return max;\n let others = 0;\n if (horizontal)\n for (const rail of container.children) {\n if (\n rail === region ||\n !rail.matches('.kui-workbench__rail') ||\n globalThis.getComputedStyle(rail).position === 'absolute'\n )\n continue;\n others += rail.getBoundingClientRect().width;\n }\n const style = globalThis.getComputedStyle(region);\n const size = px(region.style.getPropertyValue('--kui-resizable-region-size'));\n const border =\n style.boxSizing === 'border-box'\n ? 0\n : horizontal\n ? px(style.borderInlineStartWidth) + px(style.borderInlineEndWidth)\n : px(style.borderBlockStartWidth) + px(style.borderBlockEndWidth);\n // The track is the size plus the panel's safe-area extent (its flex basis).\n const extent = px(style.flexBasis) - size + border;\n return Math.floor(room - Math.min(mainMin, room) - others - extent);\n};\n\n/**\n * Wire a `Workbench`'s panels. For `resizable` panels given a `size` signal:\n * pointer drags and arrow / Shift+arrow / Home / End on each panel's\n * separator, clamped to the panel's limits and to the room that leaves the\n * work area its minimum width and height, committed to the app-owned size signals.\n * Optional persistence loads and saves each size; optional `deviceClass`\n * suspends resizing on compact classes. Collapse stays the app's `collapsed`\n * flag and never changes a size. For panels given a `collapsed` signal,\n * overlays are transient (`dismissOverlays`): a responsive overlay starts\n * collapsed, an open overlay takes focus and keeps Tab inside it, it closes\n * on Escape or an outside press, and\n * opening one overlay closes the others (`exclusiveOverlays`). Returns a disposer. See `docs/23-app-layouts.md` §3.3.\n */\nexport function wireWorkbench(\n root: HTMLElement,\n {\n id,\n panels,\n deviceClass,\n storage = defaultStorage(),\n step,\n largeStep,\n onResize,\n dismissOverlays = true,\n exclusiveOverlays = true,\n }: WireWorkbenchOptions,\n): () => void {\n const keys = Object.keys(panels) as WorkbenchPanelKey[];\n const entries = keys.flatMap((key) => {\n const size = panels[key]?.size;\n return size\n ? [\n {\n key,\n size,\n storageKey: panels[key]!.storageKey,\n regionId: workbenchRegionId(id, key),\n },\n ]\n : [];\n });\n const byRegion = new Map(entries.map((entry) => [entry.regionId, entry]));\n const disposers: Array<() => void> = [];\n\n // Seed from storage before any effect runs, so the first render after\n // wire-up already has the remembered size; then mirror every size change.\n for (const { size, storageKey } of entries) {\n if (!storageKey || !storage) continue;\n const seed = storedSize(storage.getItem(storageKey));\n if (seed !== undefined) size.value = seed;\n disposers.push(\n effect(() => {\n storage.setItem(storageKey, String(size.value));\n }),\n );\n }\n\n // Each panel is matched by its own region id, so this wiring never drives a\n // ResizableRegion or another Workbench below the same root.\n const selector = entries\n .map(\n ({ regionId }) =>\n `[data-resizable=\"true\"][data-region-id=${quoted(regionId)}]`,\n )\n .join(', ');\n const start = () =>\n wireResizeHandles(\n root,\n {\n step,\n largeStep,\n onCommit: ({ id: regionId, size, source }) => {\n // The selector only matches configured panels.\n const entry = byRegion.get(regionId)!;\n entry.size.value = size;\n onResize?.({ panel: entry.key, size, source });\n },\n },\n selector,\n mainRoomLimit,\n );\n\n let stopResize: (() => void) | undefined;\n if (selector) {\n if (deviceClass) {\n disposers.push(\n effect(() => {\n const compact = deviceClass.value.compact;\n stopResize?.();\n stopResize = compact ? undefined : start();\n }),\n );\n } else {\n stopResize = start();\n }\n }\n\n const overlayPanels = keys.flatMap((key): WorkbenchOverlayPanel[] => {\n const collapsed = panels[key]?.collapsed;\n return collapsed\n ? [\n {\n key,\n collapsed,\n keepOpenOn: panels[key]?.keepOpenOn,\n keepFocusedOpen: panels[key]?.keepFocusedOpen,\n overlay: panels[key]?.overlay,\n },\n ]\n : [];\n });\n if (dismissOverlays && overlayPanels.length > 0) {\n const selector = `[data-component=\"workbench\"][id=${quoted(id)}]`;\n disposers.push(\n wireWorkbenchOverlays(\n root,\n () =>\n root.matches(selector)\n ? root\n : root.querySelector<HTMLElement>(selector),\n overlayPanels,\n exclusiveOverlays,\n ),\n );\n }\n\n return () => {\n stopResize?.();\n stopResize = undefined;\n for (const dispose of disposers.splice(0)) dispose();\n };\n}\n"]}
|
|
@@ -34,6 +34,7 @@ var KEYBOARD_INSET_PROPERTY = "--_kui-dialog-surface-keyboard-inset";
|
|
|
34
34
|
var DIVIDER_SHOWN = "var(--_kui-dialog-surface-header-divider-color)";
|
|
35
35
|
var SCROLL_THRESHOLD = 1;
|
|
36
36
|
var states = /* @__PURE__ */ new WeakMap();
|
|
37
|
+
var staleCloses = /* @__PURE__ */ new WeakSet();
|
|
37
38
|
var installed = /* @__PURE__ */ new WeakSet();
|
|
38
39
|
var stackOrders = /* @__PURE__ */ new WeakMap();
|
|
39
40
|
var isSurface = (target) => target instanceof Element && target.matches(SURFACE);
|
|
@@ -187,12 +188,16 @@ function openDialog(dialog) {
|
|
|
187
188
|
if (embedded(dialog)) return;
|
|
188
189
|
installDialogSurfaces(dialog.ownerDocument);
|
|
189
190
|
const closing = states.get(dialog);
|
|
190
|
-
if (closing?.closing) {
|
|
191
|
+
if (closing?.closing && dialog.open) {
|
|
191
192
|
closing.closing = false;
|
|
192
193
|
runMotion(dialog, "enter");
|
|
193
194
|
return;
|
|
194
195
|
}
|
|
195
196
|
if (dialog.open) return;
|
|
197
|
+
if (closing?.closing) {
|
|
198
|
+
settle(dialog);
|
|
199
|
+
staleCloses.add(dialog);
|
|
200
|
+
}
|
|
196
201
|
dialog.showModal();
|
|
197
202
|
const state = {
|
|
198
203
|
owned: /* @__PURE__ */ new Map(),
|
|
@@ -337,7 +342,12 @@ function installDialogSurfaces(doc = document) {
|
|
|
337
342
|
doc.addEventListener(
|
|
338
343
|
"close",
|
|
339
344
|
(event) => {
|
|
340
|
-
if (isSurface(event.target))
|
|
345
|
+
if (!isSurface(event.target)) return;
|
|
346
|
+
if (staleCloses.delete(event.target)) {
|
|
347
|
+
event.stopImmediatePropagation();
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
settle(event.target);
|
|
341
351
|
},
|
|
342
352
|
true
|
|
343
353
|
);
|
|
@@ -345,4 +355,4 @@ function installDialogSurfaces(doc = document) {
|
|
|
345
355
|
|
|
346
356
|
export { closeDialog, installDialogSurfaces, openDialog, syncDialogStack, watchOwnedStyles, wireDialogStack };
|
|
347
357
|
|
|
348
|
-
//# sourceMappingURL=chunk-
|
|
358
|
+
//# sourceMappingURL=chunk-R4JK2C6D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/dom/owned-styles.ts","../src/components/surfaces/surface-scaffold/internal/dialog-surface-controller.ts"],"names":[],"mappings":";;;;AAKO,SAAS,kBAAA,CACd,SACA,KAAA,EACM;AACN,EAAA,KAAA,MAAW,CAAC,QAAA,EAAU,KAAK,CAAA,IAAK,KAAA;AAC9B,IAAA,IAAI,OAAA,CAAQ,KAAA,CAAM,gBAAA,CAAiB,QAAQ,CAAA,KAAM,KAAA;AAC/C,MAAA,OAAA,CAAQ,KAAA,CAAM,WAAA,CAAY,QAAA,EAAU,KAAK,CAAA;AAC/C;AAsBO,SAAS,gBAAA,CACd,OAAA,EACA,KAAA,EACA,OAAA,GAA8B,EAAC,EACb;AAClB,EAAA,MAAM,WAAW,IAAA,CAAK,OAAA,CAAQ,OAAO,CAAA,EAAE,iBAAkB,MAAM;AAC7D,IAAA,OAAA,CAAQ,aAAA,IAAgB;AACxB,IAAA,kBAAA,CAAmB,SAAS,KAAK,CAAA;AACjC,IAAA,OAAA,CAAQ,YAAA,IAAe;AAAA,EACzB,CAAC,CAAA;AACD,EAAA,QAAA,CAAS,QAAQ,OAAA,EAAS;AAAA,IACxB,UAAA,EAAY,I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QAAA,YAAA,CAAa,QAAQ,cAAc,CAAA;AAAA,MACrC;AAAA,IACF,CAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,GAAA,CAAI,gBAAA;AAAA,IACF,QAAA;AAAA,IACA,CAAC,KAAA,KAAU;AACT,MAAA,IAAI,CAAC,SAAA,CAAU,KAAA,CAAM,MAAM,CAAA,EAAG;AAC9B,MAAA,KAAA,CAAM,cAAA,EAAe;AACrB,MAAA,YAAA,CAAa,KAAA,CAAM,QAAQ,QAAQ,CAAA;AAAA,IACrC,CAAA;AAAA,IACA;AAAA,GACF;AAKA,EAAA,GAAA,CAAI,gBAAA;AAAA,IACF,OAAA;AAAA,IACA,CAAC,KAAA,KAAU;AACT,MAAA,IAAI,CAAC,SAAA,CAAU,KAAA,CAAM,MAAM,CAAA,EAAG;AAC9B,MAAA,IAAI,WAAA,CAAY,MAAA,CAAO,KAAA,CAAM,MAAM,CAAA,EAAG;AACpC,QAAA,KAAA,CAAM,wBAAA,EAAyB;AAC/B,QAAA;AAAA,MACF;AACA,MAAA,MAAA,CAAO,MAAM,MAAM,CAAA;AAAA,IACrB,CAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-R4JK2C6D.js","sourcesContent":["// KF-Z6T0RS: the \"restore owned inline styles after a morph\" observer that\n// DialogSurface's controller and wirePinnablePopover both need.\nimport { realmOf } from './realm.js';\n\n/** Re-apply every owned inline style property `element` no longer carries. */\nexport function restoreOwnedStyles(\n element: HTMLElement,\n owned: ReadonlyMap<string, string>,\n): void {\n for (const [property, value] of owned)\n if (element.style.getPropertyValue(property) !== value)\n element.style.setProperty(property, value);\n}\n\nexport interface OwnedStylesOptions {\n /** Further attributes whose change should also run `onChange`. */\n readonly attributes?: readonly string[];\n /** Also watch child replacement (`subtree` adds descendants). */\n readonly childList?: boolean;\n readonly subtree?: boolean;\n /** Runs before the owned styles are restored (e.g. to adopt a resize). */\n readonly beforeRestore?: () => void;\n /** Runs after the owned styles are restored (e.g. to follow new chrome). */\n readonly afterRestore?: () => void;\n}\n\n/**\n * Keep the inline style properties a controller owns on `element` across an\n * application re-render: when a morph rewrites `style` (or the other watched\n * attributes or children), restore every entry of `owned`. `owned` is read\n * live, so the caller keeps adding and removing entries. Returns the\n * observer; disconnect it on teardown. The observer comes from `element`'s\n * own realm, per the package's realm convention.\n */\nexport function watchOwnedStyles(\n element: HTMLElement,\n owned: ReadonlyMap<string, string>,\n options: OwnedStylesOptions = {},\n): MutationObserver {\n const observer = new (realmOf(element).MutationObserver)(() => {\n options.beforeRestore?.();\n restoreOwnedStyles(element, owned);\n options.afterRestore?.();\n });\n observer.observe(element, {\n attributes: true,\n attributeFilter: ['style', ...(options.attributes ?? [])],\n childList: options.childList ?? false,\n subtree: options.subtree ?? false,\n });\n return observer;\n}\n","import { watchOwnedStyles } from '../../../../shared/dom/owned-styles.js';\nimport { realmOf } from '../../../../shared/dom/realm.js';\nimport { syncSheetHandleValues, wireSheetHandle } from './sheet-handle.js';\n\n/** What asked an open DialogSurface to close. */\nexport type DialogCloseSource = 'close-button' | 'escape' | 'backdrop';\n\n/** The detail of a DialogSurface's cancelable `kui-request-close` event. */\nexport interface DialogRequestCloseDetail {\n readonly source: DialogCloseSource;\n}\n\nconst SURFACE = 'dialog.kui-dialog-surface';\n\n/** An embedded DialogSurface sits in flow, always shown: never opened or closed. */\nconst embedded = (dialog: HTMLDialogElement): boolean =>\n dialog.dataset.presentation === 'embedded';\n\n/** The attribute marking a running enter, exit, or pulse animation. */\nexport const DIALOG_MOTION_ATTRIBUTE = 'data-kui-dialog-motion';\n\n/** The panel variable a floating header's body clearance reads. */\nexport const HEADER_BLOCK_SIZE_PROPERTY =\n '--_kui-dialog-surface-header-block-size';\n\n/** The panel variable a floating footer's body clearance reads. */\nexport const FOOTER_BLOCK_SIZE_PROPERTY =\n '--_kui-dialog-surface-footer-block-size';\n\n/**\n * The panel variable a floating header's divider reads: set while content\n * is scrolled away beneath the header, unset (no divider) otherwise.\n */\nexport const HEADER_DIVIDER_PROPERTY = '--_kui-dialog-surface-header-divider';\n\n/** The panel variable holding a resized sheet's visible height. */\nexport const SHEET_HEIGHT_PROPERTY = '--_kui-dialog-surface-sheet-height';\n\n/** The panel variable holding the virtual keyboard's overlap. */\nexport const KEYBOARD_INSET_PROPERTY = '--_kui-dialog-surface-keyboard-inset';\n\n/** The value published while the divider shows: the color the CSS owns. */\nconst DIVIDER_SHOWN = 'var(--_kui-dialog-surface-header-divider-color)';\n\n/**\n * Scroll distance, in px, that counts as \"away from the top\": a scroller at\n * rest can report a fractional offset.\n */\nconst SCROLL_THRESHOLD = 1;\n\ntype Motion = 'enter' | 'exit' | 'pulse';\n\ninterface OpenState {\n /** Panel variables the controller owns while open, restored after a morph. */\n readonly owned: Map<string, string>;\n readonly stop: (() => void)[];\n motionTimer: number | undefined;\n closing: boolean;\n}\n\nconst states = new WeakMap<HTMLDialogElement, OpenState>();\n// Dialogs reopened after their exit closed them but before the browser\n// delivered that close event (a later task). The one stale event is stopped.\nconst staleCloses = new WeakSet<HTMLDialogElement>();\nconst installed = new WeakSet<Document>();\nconst stackOrders = new WeakMap<ParentNode, HTMLDialogElement[]>();\n\nconst isSurface = (target: EventTarget | null): target is HTMLDialogElement =>\n target instanceof Element && target.matches(SURFACE);\n\n/**\n * The layout viewport's bottom band a virtual keyboard covers: what the\n * visual viewport no longer shows below itself. Zero while pinch-zoomed (the\n * visual viewport then shrinks for another reason) and wherever the keyboard\n * resizes the layout viewport instead (`interactive-widget=resizes-content`).\n */\nexport function keyboardInset(\n viewport: Pick<VisualViewport, 'height' | 'offsetTop' | 'scale'>,\n layoutHeight: number,\n): number {\n if (viewport.scale > 1.01) return 0;\n const inset = Math.round(layoutHeight - viewport.height - viewport.offsetTop);\n return inset > 0 ? inset : 0;\n}\n\n/** The longest running animation on the panel, in ms (0 when none runs). */\nfunction motionDuration(dialog: HTMLElement): number {\n const style = globalThis.getComputedStyle(dialog);\n if (!style.animationName || style.animationName === 'none') return 0;\n return Math.max(\n 0,\n ...style.animationDuration.split(',').map((part) => {\n const value = parseFloat(part);\n return part.trim().endsWith('ms') ? value : value * 1000;\n }),\n );\n}\n\n/**\n * Mark a motion while its keyframes run, then finish it. A timer, not\n * `animationend`, ends it, so an application re-render that drops the marker\n * mid-animation still closes the dialog.\n */\nfunction runMotion(\n dialog: HTMLDialogElement,\n motion: Motion,\n done?: () => void,\n): void {\n const state = states.get(dialog);\n const view = realmOf(dialog);\n if (state) view.clearTimeout(state.motionTimer);\n dialog.setAttribute(DIALOG_MOTION_ATTRIBUTE, motion);\n const finish = () => {\n done?.();\n if (dialog.getAttribute(DIALOG_MOTION_ATTRIBUTE) === motion)\n dialog.removeAttribute(DIALOG_MOTION_ATTRIBUTE);\n };\n const duration = motionDuration(dialog);\n if (duration === 0 || !state) finish();\n else state.motionTimer = view.setTimeout(finish, duration);\n}\n\n/** Set (or, with `null`, clear) a panel variable the controller owns. */\nfunction own(\n dialog: HTMLDialogElement,\n property: string,\n value: string | null,\n): void {\n const owned = states.get(dialog)?.owned;\n if (value === null) {\n owned?.delete(property);\n dialog.style.removeProperty(property);\n return;\n }\n owned?.set(property, value);\n if (dialog.style.getPropertyValue(property) !== value)\n dialog.style.setProperty(property, value);\n}\n\n/** Watch an open dialog: owned state, chrome sizes, divider, and sheet. */\nfunction follow(dialog: HTMLDialogElement, state: OpenState): void {\n const sheet = dialog.getAttribute('data-presentation') === 'bottom-sheet';\n // Layout sizes, not boxes: the panel opens scaled while its enter motion\n // runs. A resize observation reports the exact border box; until the first\n // one, `offsetHeight` stands in.\n const blockSizes = new WeakMap<Element, number>();\n const sizes = new (realmOf(dialog).ResizeObserver)((entries) => {\n for (const entry of entries) {\n const box = entry.borderBoxSize?.[0];\n if (box) blockSizes.set(entry.target, box.blockSize);\n }\n measure();\n });\n const blockSize = (element: HTMLElement) =>\n `${blockSizes.get(element) ?? element.offsetHeight}px`;\n let header: HTMLElement | null = null;\n let footer: HTMLElement | null = null;\n let handle: HTMLElement | null = null;\n let unwireHandle: (() => void) | undefined;\n const measure = () => {\n own(dialog, HEADER_BLOCK_SIZE_PROPERTY, header ? blockSize(header) : null);\n own(dialog, FOOTER_BLOCK_SIZE_PROPERTY, footer ? blockSize(footer) : null);\n };\n // The header, footer, and grabber the template renders; a re-render may\n // replace them.\n const track = () => {\n const nextHeader = dialog.querySelector<HTMLElement>(\n ':scope > .kui-dialog-surface__header',\n );\n const nextFooter = dialog.querySelector<HTMLElement>(\n ':scope > .kui-dialog-surface__footer',\n );\n if (nextHeader !== header || nextFooter !== footer) {\n sizes.disconnect();\n header = nextHeader;\n footer = nextFooter;\n for (const element of [header, footer])\n if (element) sizes.observe(element);\n measure();\n }\n const nextHandle = dialog.querySelector<HTMLElement>(\n ':scope > .kui-dialog-surface__sheet-handle',\n );\n if (nextHandle !== handle) {\n unwireHandle?.();\n unwireHandle = undefined;\n handle = nextHandle;\n if (handle) {\n unwireHandle = wireSheetHandle(handle, {\n panel: dialog,\n host: dialog,\n property: SHEET_HEIGHT_PROPERTY,\n enabled: () => true,\n publish: (value) => own(dialog, SHEET_HEIGHT_PROPERTY, value),\n });\n syncSheetHandleValues(handle, dialog);\n }\n }\n };\n track();\n // An application re-render morphs the panel back to its rendered\n // attributes and may replace its chrome: restore the owned variables and\n // follow the new elements.\n const restore = watchOwnedStyles(dialog, state.owned, {\n childList: true,\n afterRestore: track,\n });\n // A floating header's divider shows while a scroller reaching beneath it\n // is scrolled away from its top. `scroll` does not bubble: capture it.\n const scrolled = new Set<Element>();\n const onScroll = (event: Event) => {\n const scroller = event.target as Element;\n const floating =\n dialog.getAttribute('data-header-presentation') === 'floating';\n if (\n floating &&\n header &&\n scroller.scrollTop > SCROLL_THRESHOLD &&\n scroller.getBoundingClientRect().top <=\n header.getBoundingClientRect().bottom\n )\n scrolled.add(scroller);\n else scrolled.delete(scroller);\n for (const element of scrolled)\n if (!element.isConnected) scrolled.delete(element);\n own(\n dialog,\n HEADER_DIVIDER_PROPERTY,\n scrolled.size > 0 ? DIVIDER_SHOWN : null,\n );\n };\n dialog.addEventListener('scroll', onScroll, { capture: true, passive: true });\n state.stop.push(() => {\n sizes.disconnect();\n restore.disconnect();\n unwireHandle?.();\n dialog.removeEventListener('scroll', onScroll, { capture: true });\n });\n // A bottom sheet keeps its content above a virtual keyboard.\n const viewport = dialog.ownerDocument.defaultView?.visualViewport;\n if (sheet && viewport) {\n const publish = () => {\n const inset = keyboardInset(viewport, globalThis.innerHeight);\n own(dialog, KEYBOARD_INSET_PROPERTY, inset > 0 ? `${inset}px` : null);\n };\n viewport.addEventListener('resize', publish);\n viewport.addEventListener('scroll', publish);\n state.stop.push(() => {\n viewport.removeEventListener('resize', publish);\n viewport.removeEventListener('scroll', publish);\n });\n publish();\n }\n}\n\n/** Stop following a closed dialog and drop the state it owned. */\nfunction settle(dialog: HTMLDialogElement): void {\n const state = states.get(dialog);\n if (!state) return;\n states.delete(dialog);\n realmOf(dialog).clearTimeout(state.motionTimer);\n for (const stop of state.stop) stop();\n for (const property of state.owned.keys())\n dialog.style.removeProperty(property);\n dialog.removeAttribute(DIALOG_MOTION_ATTRIBUTE);\n}\n\n/**\n * Open a DialogSurface as a modal dialog: in the top layer, the rest of the\n * page inert, focus on its `autofocus` element or else the panel. It plays\n * its enter motion and, with the controller installed here, keeps its\n * measured chrome, sheet height, and keyboard clearance across application\n * re-renders. Opening an open dialog does nothing, and so does opening an\n * `embedded` one, which is always shown in flow.\n */\nexport function openDialog(dialog: HTMLDialogElement): void {\n if (embedded(dialog)) return;\n installDialogSurfaces(dialog.ownerDocument);\n const closing = states.get(dialog);\n if (closing?.closing && dialog.open) {\n // The latest request wins: reopening during the exit motion keeps it open.\n closing.closing = false;\n runMotion(dialog, 'enter');\n return;\n }\n if (dialog.open) return;\n if (closing?.closing) {\n // KF-C0RV1G: the exit motion already closed it, but the browser has not\n // yet delivered its close event. Drop that state and open afresh; the\n // close listener stops the stale event.\n settle(dialog);\n staleCloses.add(dialog);\n }\n dialog.showModal();\n const state: OpenState = {\n owned: new Map(),\n stop: [],\n motionTimer: undefined,\n closing: false,\n };\n states.set(dialog, state);\n if (!dialog.querySelector('[autofocus]'))\n dialog.focus({ preventScroll: true });\n follow(dialog, state);\n runMotion(dialog, 'enter');\n}\n\n/**\n * Close an open DialogSurface after its exit motion. The application's own\n * close is never refused: no `kui-request-close` is dispatched. The native\n * `close` event fires once it has closed. An `embedded` one never closes.\n */\nexport function closeDialog(dialog: HTMLDialogElement): void {\n const state = states.get(dialog);\n if (!dialog.open || embedded(dialog)) return;\n if (!state) {\n dialog.close();\n return;\n }\n if (state.closing) return;\n state.closing = true;\n runMotion(dialog, 'exit', () => dialog.close());\n}\n\n/**\n * Reconcile one controlled stack after rendering its DialogSurface layers.\n * Opening back-to-front establishes native top-layer order; unchanged layers\n * keep their DOM nodes and focus. The application owns `stack.open` and handles\n * `kui-request-close` to update that state before calling this again.\n */\nexport function syncDialogStack(root: ParentNode): void {\n const layers = [\n ...root.querySelectorAll<HTMLDialogElement>(\n 'dialog.kui-dialog-surface[data-stack-position]',\n ),\n ];\n const desired = layers\n .filter((dialog) => dialog.getAttribute('data-stack-open') === 'true')\n .sort(\n (a, b) =>\n Number(a.getAttribute('data-stack-position')) -\n Number(b.getAttribute('data-stack-position')),\n );\n const positions = desired.map((dialog) =>\n Number(dialog.getAttribute('data-stack-position')),\n );\n const active = desired.filter(\n (dialog) => dialog.getAttribute('data-stack-active') === 'true',\n );\n if (\n positions.some(\n (position, index) =>\n !Number.isInteger(position) ||\n position < 1 ||\n (index > 0 && position === positions[index - 1]),\n ) ||\n (desired.length > 0 &&\n (active.length !== 1 || active[0] !== desired[desired.length - 1]))\n )\n throw new RangeError(\n 'DialogSurface stack needs one frontmost active layer and unique positions',\n );\n\n const previous = stackOrders.get(root) ?? [];\n let prefix = 0;\n while (\n prefix < previous.length &&\n prefix < desired.length &&\n previous[prefix] === desired[prefix] &&\n desired[prefix]!.open\n )\n prefix += 1;\n for (const dialog of previous.slice(prefix).reverse()) {\n if (dialog.open) dialog.close();\n settle(dialog);\n }\n for (const dialog of desired.slice(prefix)) openDialog(dialog);\n stackOrders.set(root, desired);\n const top = desired[desired.length - 1];\n if (top && !top.contains(top.ownerDocument.activeElement))\n top.focus({ preventScroll: true });\n}\n\n/** Follow a controlled stack's render updates until the returned stop runs. */\nexport function wireDialogStack(root: ParentNode): () => void {\n const observer = new (realmOf(root as Node).MutationObserver)(() =>\n syncDialogStack(root),\n );\n observer.observe(root as Node, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\n 'data-stack-open',\n 'data-stack-active',\n 'data-stack-position',\n 'data-stack-count',\n ],\n });\n syncDialogStack(root);\n return () => {\n observer.disconnect();\n for (const dialog of (stackOrders.get(root) ?? []).reverse()) {\n if (dialog.open) dialog.close();\n settle(dialog);\n }\n stackOrders.delete(root);\n };\n}\n\n/**\n * A person asked to close the dialog: dispatch the cancelable\n * `kui-request-close`; refused, the panel pulses, otherwise it closes.\n */\nfunction requestClose(\n dialog: HTMLDialogElement,\n source: DialogCloseSource,\n): void {\n const allowed = dialog.dispatchEvent(\n new CustomEvent<DialogRequestCloseDetail>('kui-request-close', {\n bubbles: true,\n cancelable: true,\n detail: { source },\n }),\n );\n if (allowed) {\n if (!dialog.hasAttribute('data-stack-position')) closeDialog(dialog);\n } else runMotion(dialog, 'pulse');\n}\n\nconst outside = (dialog: HTMLElement, event: MouseEvent): boolean => {\n const box = dialog.getBoundingClientRect();\n return (\n event.clientX < box.left ||\n event.clientX > box.right ||\n event.clientY < box.top ||\n event.clientY > box.bottom\n );\n};\n\n/**\n * Wire every DialogSurface in `doc`: the close button and any element with\n * `data-dialog-close`, Escape, and a press on the backdrop (closing with\n * `lightDismiss`, pulsing without) ask to close through `kui-request-close`;\n * a closed dialog stops being followed. `openDialog` installs this itself;\n * the `surface-scaffold/register` entry installs it for the document.\n * Idempotent per document.\n */\nexport function installDialogSurfaces(doc: Document = document): void {\n if (installed.has(doc)) return;\n installed.add(doc);\n // A backdrop press starts and ends outside the panel; a drag out of the\n // panel (a text selection) is not one.\n let pressedOutside: HTMLDialogElement | null = null;\n doc.addEventListener(\n 'pointerdown',\n (event) => {\n pressedOutside =\n isSurface(event.target) && outside(event.target, event)\n ? event.target\n : null;\n },\n true,\n );\n doc.addEventListener(\n 'click',\n (event) => {\n const target = event.target as Element;\n const dialog = target.closest?.<HTMLDialogElement>(SURFACE);\n if (!dialog?.open || embedded(dialog)) return;\n if (target === dialog) {\n if (pressedOutside !== dialog || !outside(dialog, event)) return;\n if (dialog.hasAttribute('data-light-dismiss'))\n requestClose(dialog, 'backdrop');\n else runMotion(dialog, 'pulse');\n return;\n }\n const closer = target.closest('[data-dialog-close]');\n if (closer && closer.closest(SURFACE) === dialog) {\n event.preventDefault();\n requestClose(dialog, 'close-button');\n }\n },\n true,\n );\n // Escape fires `cancel`; the dialog closes through the same request.\n doc.addEventListener(\n 'cancel',\n (event) => {\n if (!isSurface(event.target)) return;\n event.preventDefault();\n requestClose(event.target, 'escape');\n },\n true,\n );\n // However it closed (including an engine closing it past a refused\n // Escape), stop following it. The close event of an exit that a reopen\n // overtook is stale (KF-C0RV1G): stop it so the application does not tear\n // the reopened dialog down.\n doc.addEventListener(\n 'close',\n (event) => {\n if (!isSurface(event.target)) return;\n if (staleCloses.delete(event.target)) {\n event.stopImmediatePropagation();\n return;\n }\n settle(event.target);\n },\n true,\n );\n}\n"]}
|
|
@@ -201,9 +201,11 @@ function ToolbarControlGroup({
|
|
|
201
201
|
avatarImage ? `--kui-toolbar-avatar-image:url(${JSON.stringify(avatarImage)})` : "",
|
|
202
202
|
growBasis ? `--kui-toolbar-group-grow-basis:${growBasis}` : ""
|
|
203
203
|
].filter(Boolean);
|
|
204
|
+
const relocationKey = relocateOnCollapse && label && rootAttributes["data-key"] === void 0 ? { "data-key": `kui-relocated:${label}` } : {};
|
|
204
205
|
const group = /* @__PURE__ */ jsxs(
|
|
205
206
|
"div",
|
|
206
207
|
{
|
|
208
|
+
...relocationKey,
|
|
207
209
|
...filterDataAttributes(rootAttributes, TOOLBAR_CONTROL_GROUP_PROTECTED),
|
|
208
210
|
class: `kui-toolbar-control-group ${className}`.trim(),
|
|
209
211
|
"data-component": "toolbar-control-group",
|
|
@@ -260,4 +262,4 @@ function ToolbarControlGroup({
|
|
|
260
262
|
|
|
261
263
|
export { ToolbarActionLink, ToolbarButton, ToolbarControlGroup, isRelocatableGroup };
|
|
262
264
|
|
|
263
|
-
//# sourceMappingURL=chunk-
|
|
265
|
+
//# sourceMappingURL=chunk-SGYBIKQA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/toolbar/panel-toolbar-group.ts","../src/components/actions/toolbar-control-group/toolbar-control-group.tsx"],"names":[],"mappings":";;;;;;;AAIA,IAAM,uCAAuB,MAAA,CAAO,GAAA;AAAA,EAClC;AACF,CAAA;AAEO,SAAS,qBAAqB,KAAA,EAA2B;AAC9D,EAAA,MAAA,CAAO,eAAe,KAAA,EAAO,oBAAA,EAAsB,EAAE,KAAA,EAAO,MAAM,CAAA;AAClE,EAAA,OAAO,KAAA;AACT;AAEO,SAAS,mBAAmB,KAAA,EAAmC;AACpE,EAAA,OACE,UAAA,CAAW,KAAK,CAAA,IACf,KAAA,CACC,oBACF,CAAA,KAAM,IAAA;AAEV;ACiDA,IAAM,6BAAA,uBAAoC,GAAA,CAAI;AAAA,EAC5C,iBAAA;AAAA,EACA,WAAA;AAAA,EACA,wBAAA;AAAA,EACA,gBAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,wBAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,iBAAA;AAAA,EACA,sBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AAAA,EACA,sBAAA;AAAA,EACA,oBAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA,aAAA;AAAA,EACA,WAAA;AAAA,EACA,aAA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AAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAM,yCAAA;AAAA,YACN,aAAA,EAAY,MAAA;AAAA,YAEZ,8BAAC,cAAA,EAAA,EAAe;AAAA;AAAA,SAClB,GACE;AAAA;AAAA;AAAA,GACN;AAEF,EAAA,MAAM,aAAA,GAAgB,uBACpB,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,KAAA;AAAA,wBACA,MAAA,EAAA,EAAK,KAAA,EAAM,wCAAA,EAAyC,IAAA,EAAK,UACvD,QAAA,EAAA,SAAA,EACH;AAAA,GAAA,EACF,CAAA,GAEA,KAAA;AAEF,EAAA,OAAO,kBAAA,GACH,oBAAA,CAAqB,aAAa,CAAA,GAClC,aAAA;AACN","file":"chunk-SGYBIKQA.js","sourcesContent":["import { isSafeHtml, type SafeHtml } from 'kerfjs';\n\n// A render-time annotation, shared across separately bundled UI subpaths.\n// It never appears in the DOM or changes the group's visual treatment.\nconst RELOCATE_ON_COLLAPSE = Symbol.for(\n '@kerfjs/ui.ToolbarControlGroup.relocateOnCollapse',\n);\n\nexport function markRelocatableGroup(group: SafeHtml): SafeHtml {\n Object.defineProperty(group, RELOCATE_ON_COLLAPSE, { value: true });\n return group;\n}\n\nexport function isRelocatableGroup(value: unknown): value is SafeHtml {\n return (\n isSafeHtml(value) &&\n (value as SafeHtml & { [RELOCATE_ON_COLLAPSE]?: boolean })[\n RELOCATE_ON_COLLAPSE\n ] === true\n );\n}\n","import { badgeText } from '../../../shared/content/badge-text.js';\nimport type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport type { CssLength } from '../../../shared/styles/css-values.js';\nimport type { SemanticTone } from '../../../shared/styles/semantic-tone.js';\nimport { markRelocatableGroup } from '../../../shared/toolbar/panel-toolbar-group.js';\nimport { Badge } from '../../feedback/badge/badge.js';\nimport { LoadingSpinner } from '../../feedback/loading-spinner/loading-spinner.js';\nimport type { ButtonLabel } from '../button/button.js';\n\nexport type ToolbarControlGroupAppearance = 'contained' | 'borderless';\nexport type ToolbarControlGroupTone = 'default' | 'dark';\n/** Surface material: the opaque `solid` fill (default) or translucent `glass`. */\nexport type ToolbarControlGroupMaterial = 'solid' | 'glass';\n/** Quiet palette for a contained, single decorative icon tile. */\nexport type ToolbarControlGroupTileTone =\n 'neutral' | 'brand' | 'success' | 'warning' | 'danger';\nexport type ToolbarControlGroupButtonAppearance = 'plain' | 'push';\nexport type ToolbarControlGroupShape = 'pill' | 'rounded';\nexport type ToolbarControlGroupSize = 'default' | 'compact';\nexport type ToolbarControlGroupDensity =\n | 'default'\n | 'compact'\n | /** @deprecated Use default. */ 'comfortable'\n | /** @deprecated Use compact. */ 'tight';\nexport type ToolbarControlGroupContent =\n 'icon' | 'text' | 'mixed' | 'avatar' | 'search';\nexport type ToolbarControlGroupFocusRing = 'control' | 'outline' | 'halo';\nexport type ToolbarControlGroupSelectedChrome =\n 'raised' | 'filled' | 'outline' | 'none';\nexport type ToolbarControlGroupSelectedTone = 'brand' | 'neutral' | 'pop';\nexport type ToolbarControlGroupOverflow = 'visible' | 'scroll' | 'wrap';\nexport type ToolbarControlGroupExpandedOverflow = 'clip' | 'visible';\nexport type ToolbarControlGroupMenuInset =\n | 'none'\n | 'compact'\n | 'default'\n | /** @deprecated Use default. */ 'standard'\n | /** @deprecated Use none. */ 'list-zero';\nexport type ToolbarControlGroupVisibility =\n | 'always'\n | 'compact-only'\n | 'hide-collapsed-tiny'\n | 'yield-to-expanded-sibling'\n | 'yield-to-priority-row';\nexport type ToolbarControlGroupSizing = 'content' | 'grow' | 'fill';\nexport type ToolbarControlGroupPlacement = 'start' | 'end';\n\nexport interface ToolbarActionLinkProps {\n href: string;\n label: string;\n icon?: KerfUiContent;\n /** Optional machine-readable detail hidden visually but included in the default accessible name. */\n detail?: string;\n /** Override the accessible name when surrounding context is needed. */\n ariaLabel?: string;\n /** Open in a new tab with a safe rel and announce that behavior. */\n external?: boolean;\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n /** Application `data-*` metadata on the root, such as a row key or an\n * editor node marker; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst TOOLBAR_ACTION_LINK_PROTECTED = new Set([\n 'data-appearance',\n 'data-busy',\n 'data-button-appearance',\n 'data-component',\n 'data-content',\n 'data-density',\n 'data-expanded',\n 'data-expanded-overflow',\n 'data-focus-ring',\n 'data-hide-below',\n 'data-material',\n 'data-menu-inset',\n 'data-nested-dropdown',\n 'data-overflow',\n 'data-placement',\n 'data-scrim',\n 'data-selected-chrome',\n 'data-selected-tone',\n 'data-shape',\n 'data-show-below',\n 'data-single',\n 'data-size',\n 'data-sizing',\n 'data-tile-tone',\n 'data-tone',\n 'data-visibility',\n]);\n\n/** A semantic anchor with ToolbarControlGroup-owned action geometry. */\nexport function ToolbarActionLink({\n href,\n label,\n icon,\n detail,\n ariaLabel,\n external = false,\n className = '',\n slot,\n rootAttributes = {},\n}: ToolbarActionLinkProps) {\n const accessibleLabel =\n ariaLabel ??\n `${label}${detail ? `, ${detail}` : ''}${external ? ' (opens in new tab)' : ''}`;\n return (\n <a\n {...filterDataAttributes(rootAttributes, TOOLBAR_ACTION_LINK_PROTECTED)}\n class={`kui-toolbar-action-link ${className}`.trim()}\n data-component=\"toolbar-action-link\"\n href={href}\n target={external ? '_blank' : undefined}\n rel={external ? 'noopener noreferrer' : undefined}\n aria-label={accessibleLabel}\n slot={slot}\n >\n {icon}\n <span>{label}</span>\n {detail ? <code aria-hidden=\"true\">{detail}</code> : null}\n </a>\n );\n}\n\n/**\n * A ToolbarButton's content: a labeled button (its text names it), or an\n * icon-only control named by `ariaLabel`. In an avatar group\n * (`content=\"avatar\"`) the button shows the group's `avatarImage`, so it\n * takes only `ariaLabel` (KF-CFWFAE).\n */\nexport type ToolbarButtonContent =\n | {\n /** The visible label, after the icon. */\n children: ButtonLabel;\n /** A leading icon, such as a `LucideIcon`; it is decorative. */\n icon?: KerfUiContent;\n /** Override the accessible name when the label is not enough. */\n ariaLabel?: string;\n }\n | {\n children?: undefined;\n /**\n * The icon of an icon-only control; omitted in an avatar group, whose\n * avatar image the button shows.\n */\n icon?: KerfUiContent;\n /** The accessible name of an icon-only or avatar control. */\n ariaLabel: string;\n };\n\nexport type ToolbarButtonProps = ToolbarButtonContent & {\n /** The `data-action` name a delegated handler dispatches on. */\n action?: string;\n /** A toggle's state, reported as `aria-pressed`; unset for a plain action. */\n pressed?: boolean;\n /**\n * The id of a native `popover` element this button opens or closes (the\n * Popover API's invoker; KF-PAMQNM).\n */\n popoverTarget?: string;\n /** What the button does to its `popoverTarget`; the browser default is `toggle`. */\n popoverTargetAction?: 'toggle' | 'show' | 'hide';\n /** The kind of popup the button opens, reported as `aria-haspopup`. */\n ariaHasPopup?: 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';\n disabled?: boolean;\n /** Native hover text that says more than the accessible name. */\n title?: string;\n /** `none` keeps this pressed control looking like its neighbors. */\n selectedChrome?: 'none';\n /**\n * A count, short text, or `true` for a text-free dot over the button's\n * top-trailing corner, such as how many workers are live. A count of 0 (or\n * less) and empty text show no badge. The badge is decorative\n * (`aria-hidden`): put its meaning in `ariaLabel` (or the visible label)\n * and `title` yourself, for example \"Workers, 2 live\".\n */\n badge?: number | string | true;\n /** The badge's tone (default `danger`). */\n badgeTone?: SemanticTone;\n /**\n * The largest count shown in full; a larger count shows as `{badgeMax}+`\n * (default 99, so 100 shows \"99+\"). Text badges are shown as given.\n */\n badgeMax?: number;\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n /** Application `data-*` metadata on the root, such as a row key or an\n * editor node marker; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n};\n\nconst TOOLBAR_BUTTON_PROTECTED = new Set([\n ...TOOLBAR_ACTION_LINK_PROTECTED,\n 'data-action',\n]);\n\n// KF-5ZEYKP: the group's native button as a component, so view documents,\n// the editor, and generated code can place it.\n/**\n * A native button in a ToolbarControlGroup: the group owns its geometry,\n * focus ring, pressed chrome, and busy state, exactly as for a hand-written\n * `<button type=\"button\">`.\n */\nexport function ToolbarButton({\n children,\n icon,\n ariaLabel,\n action,\n pressed,\n popoverTarget,\n popoverTargetAction,\n ariaHasPopup,\n disabled = false,\n title,\n selectedChrome,\n badge,\n badgeTone = 'danger',\n badgeMax = 99,\n className = '',\n slot,\n rootAttributes = {},\n}: ToolbarButtonProps) {\n const shownBadge = badgeText(badge, badgeMax);\n return (\n <button\n {...filterDataAttributes(rootAttributes, TOOLBAR_BUTTON_PROTECTED)}\n type=\"button\"\n class={`kui-toolbar-button ${className}`.trim()}\n data-component=\"toolbar-button\"\n data-action={action}\n data-selected-chrome={selectedChrome}\n aria-label={ariaLabel}\n aria-pressed={pressed === undefined ? undefined : String(pressed)}\n aria-haspopup={ariaHasPopup}\n popoverTarget={popoverTarget}\n popoverTargetAction={popoverTargetAction}\n title={title}\n disabled={disabled}\n slot={slot}\n >\n {icon}\n {children}\n {badge === true ? (\n <Badge tone={badgeTone} size=\"dot\" placement=\"corner\" ariaHidden />\n ) : shownBadge === undefined ? null : (\n <Badge\n tone={badgeTone}\n appearance=\"solid\"\n size=\"compact\"\n placement=\"corner\"\n ariaHidden\n >\n {shownBadge}\n </Badge>\n )}\n </button>\n );\n}\n\n// KF-HDQTVV: a count of 0 (or less) and empty text hide the badge; a count\n// past `max` collapses to `{max}+`.\n\nexport interface ToolbarControlGroupProps {\n children: KerfUiContent;\n label?: string;\n className?: string;\n expanded?: boolean;\n single?: boolean;\n appearance?: ToolbarControlGroupAppearance;\n tone?: ToolbarControlGroupTone;\n /**\n * `glass` paints the group on the translucent chrome material (backdrop\n * blur and saturation) with a specular edge and a soft shadow, for a group\n * floating over imagery or a clear toolbar. Controls take the normal text\n * color so they keep AA over any content; the fill turns opaque under\n * reduced transparency, increased contrast, static effects, or without\n * backdrop-filter support. A borderless group has no surface and ignores it.\n */\n material?: ToolbarControlGroupMaterial;\n /** Quiet fill, matching border and foreground for a contained single group whose only child is a decorative SVG. Ignored for interactive or mixed content. */\n tileTone?: ToolbarControlGroupTileTone;\n buttonAppearance?: ToolbarControlGroupButtonAppearance;\n /** Corner shape: fully round `pill` (default) or a softer `rounded` rectangle. */\n shape?: ToolbarControlGroupShape;\n size?: ToolbarControlGroupSize;\n density?: ToolbarControlGroupDensity;\n content?: ToolbarControlGroupContent;\n /** Whether controls paint focus individually or the group paints an outline/halo on focus-within. */\n focusRing?: ToolbarControlGroupFocusRing;\n /**\n * Chrome a pressed (`aria-pressed=\"true\"`) control paints. `none` keeps a\n * pressed control looking like its neighbors, for an icon-state toggle whose\n * glyph already shows the state (an empty or filled star); hover and the\n * focus ring are unchanged. One control can opt out alone with\n * `data-selected-chrome=\"none\"` on its own button.\n */\n selectedChrome?: ToolbarControlGroupSelectedChrome;\n selectedTone?: ToolbarControlGroupSelectedTone;\n /** Size a nested Web Awesome dropdown trigger as part of this group. */\n nestedDropdown?: boolean;\n /** Configure the nested dropdown menu inset without consumer ::part() CSS. */\n menuInset?: ToolbarControlGroupMenuInset;\n /** Keep an overlong row inside the available width by scrolling or wrapping. */\n overflow?: ToolbarControlGroupOverflow;\n /** Let app-owned anchored surfaces extend outside an expanded search group. Collapsed searches retain their clipping. */\n expandedOverflow?: ToolbarControlGroupExpandedOverflow;\n /**\n * Responsive visibility owned by the enclosing Toolbar container.\n * `yield-to-expanded-sibling` hides this group in a 480px-or-narrower\n * Toolbar while another group in any of its zones is expanded, including\n * a group relocated there from a collapsed panel.\n * `yield-to-priority-row` hides this trailing group exactly while its\n * Toolbar's `responsive=\"trailing-priority\"` row is active (an expanded\n * trailing sibling at the Toolbar's `responsiveAt` width), so the app never\n * restates that breakpoint with `hideBelow`.\n */\n visibility?: ToolbarControlGroupVisibility;\n /** Hide below this Toolbar content width; requires wireToolbarVisibility. */\n hideBelow?: CssLength;\n /** Show only below this Toolbar content width; requires wireToolbarVisibility. */\n showBelow?: CssLength;\n /** Intrinsic (default), grow from a basis, or occupy a full wrapping row. */\n sizing?: ToolbarControlGroupSizing;\n /** Place this group at the end of its flex row in a wrapping Toolbar zone. */\n placement?: ToolbarControlGroupPlacement;\n /** CSS length used as the minimum width and flex basis for `sizing=\"grow\"`; defaults to 19rem. */\n growBasis?: string;\n /**\n * Move this group into the work-area toolbar when its panel collapses.\n * A labeled relocatable group is keyed by its `label` (a `data-key`\n * `rootAttributes` overrides it), so it keeps its DOM node, and a focused\n * control keeps focus, when the relocated set changes around it. Give\n * relocatable groups in one panel distinct labels.\n */\n relocateOnCollapse?: boolean;\n /** Add contrast behind photo-backed avatar content. */\n scrim?: boolean;\n /** Block the group's controls and show a spinner without changing its dimensions. */\n busy?: boolean;\n /** Announced status while busy; defaults to “Working”. */\n busyLabel?: string;\n /**\n * Avatar image URL. A single-control group paints it on the group; a\n * multi-control group paints it only on the pressed selection highlight.\n */\n avatarImage?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n /** Application `data-*` metadata on the root, such as a row key or an\n * editor node marker; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst TOOLBAR_CONTROL_GROUP_PROTECTED = new Set([\n 'data-appearance',\n 'data-busy',\n 'data-button-appearance',\n 'data-component',\n 'data-content',\n 'data-density',\n 'data-expanded',\n 'data-expanded-overflow',\n 'data-focus-ring',\n 'data-hide-below',\n 'data-material',\n 'data-menu-inset',\n 'data-nested-dropdown',\n 'data-overflow',\n 'data-placement',\n 'data-scrim',\n 'data-selected-chrome',\n 'data-selected-tone',\n 'data-shape',\n 'data-show-below',\n 'data-single',\n 'data-size',\n 'data-sizing',\n 'data-tile-tone',\n 'data-tone',\n 'data-visibility',\n]);\n\nexport function ToolbarControlGroup({\n children,\n label,\n className = '',\n expanded = false,\n single = false,\n appearance = 'contained',\n tone = 'default',\n material = 'solid',\n tileTone,\n buttonAppearance = 'plain',\n shape = 'pill',\n size = 'default',\n density = 'default',\n content = 'icon',\n focusRing = 'control',\n selectedChrome = 'raised',\n selectedTone = 'brand',\n nestedDropdown = false,\n menuInset = 'default',\n overflow = 'visible',\n expandedOverflow = 'clip',\n visibility = 'always',\n hideBelow,\n showBelow,\n sizing = 'content',\n placement = 'start',\n growBasis,\n relocateOnCollapse = false,\n scrim = false,\n busy = false,\n busyLabel = 'Working',\n avatarImage,\n slot,\n rootAttributes = {},\n}: ToolbarControlGroupProps) {\n const inlineStyles = [\n avatarImage\n ? `--kui-toolbar-avatar-image:url(${JSON.stringify(avatarImage)})`\n : '',\n growBasis ? `--kui-toolbar-group-grow-basis:${growBasis}` : '',\n ].filter(Boolean);\n // KF-KHTDC2: a stable key lets the morph keep a relocated group's node,\n // and its focus, when groups before it join or leave the relocated set.\n const relocationKey =\n relocateOnCollapse && label && rootAttributes['data-key'] === undefined\n ? { 'data-key': `kui-relocated:${label}` }\n : {};\n const group = (\n <div\n {...relocationKey}\n {...filterDataAttributes(rootAttributes, TOOLBAR_CONTROL_GROUP_PROTECTED)}\n class={`kui-toolbar-control-group ${className}`.trim()}\n data-component=\"toolbar-control-group\"\n role={label ? 'group' : undefined}\n aria-label={label}\n data-appearance={appearance}\n data-tone={tone}\n data-material={material === 'glass' ? 'glass' : undefined}\n data-tile-tone={tileTone}\n data-button-appearance={buttonAppearance}\n data-expanded={String(expanded)}\n data-single={String(single)}\n data-shape={shape}\n data-size={size}\n data-density={\n density === 'comfortable'\n ? 'default'\n : density === 'tight'\n ? 'compact'\n : density\n }\n data-content={content}\n data-focus-ring={focusRing}\n data-selected-chrome={selectedChrome}\n data-selected-tone={selectedTone}\n data-nested-dropdown={String(nestedDropdown)}\n data-menu-inset={\n menuInset === 'standard'\n ? 'default'\n : menuInset === 'list-zero'\n ? 'none'\n : menuInset\n }\n data-overflow={overflow}\n data-expanded-overflow={\n expandedOverflow === 'visible' ? 'visible' : undefined\n }\n data-visibility={visibility}\n data-hide-below={hideBelow}\n data-show-below={showBelow}\n data-sizing={sizing}\n data-placement={placement}\n data-scrim={String(scrim)}\n data-busy={String(busy)}\n aria-busy={busy ? 'true' : undefined}\n inert={busy}\n style={inlineStyles.length ? inlineStyles.join(';') : undefined}\n slot={slot}\n >\n {children}\n {busy ? (\n <span\n class=\"kui-toolbar-control-group__busy-spinner\"\n aria-hidden=\"true\"\n >\n <LoadingSpinner />\n </span>\n ) : null}\n </div>\n );\n const renderedGroup = busy ? (\n <>\n {group}\n <span class=\"kui-toolbar-control-group__busy-status\" role=\"status\">\n {busyLabel}\n </span>\n </>\n ) : (\n group\n );\n return relocateOnCollapse\n ? markRelocatableGroup(renderedGroup)\n : renderedGroup;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolbarText } from './chunk-JAC6AVZN.js';
|
|
2
2
|
import { paneConfigProps } from './chunk-EI55KWHP.js';
|
|
3
|
-
import { ToolbarControlGroup } from './chunk-
|
|
3
|
+
import { ToolbarControlGroup } from './chunk-SGYBIKQA.js';
|
|
4
4
|
import { Pane } from './chunk-KACJOE2N.js';
|
|
5
5
|
import { scrollEdgeAttributes } from './chunk-IRC5N7FA.js';
|
|
6
6
|
import { Toolbar } from './chunk-WEQNPYVA.js';
|
|
@@ -215,4 +215,4 @@ function NavStack({
|
|
|
215
215
|
|
|
216
216
|
export { NavStack };
|
|
217
217
|
|
|
218
|
-
//# sourceMappingURL=chunk-
|
|
218
|
+
//# sourceMappingURL=chunk-XO5IOPM5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/navigation/nav-stack/nav-stack.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAsNA,IAAM,uBAAA,GAA0B;AAAA,EAC9B,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAEA,IAAM,8BAAA,GAAiC;AAAA,EACrC,WAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAEA,SAAS,UAAA,CAAW,SAAwB,MAAA,EAAqB;AAC/D,EAAA,uBACE,GAAA;AA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,CAAK;AAAA;AAAA,gBAGR,IAAA,CAAK;AAAA;AAAA,SAGV,CAAA,EACH,CAAA;AAAA,QACC,0BACC,GAAA,CAAC,QAAA,EAAA,EAAO,KAAA,EAAM,uBAAA,EAAwB,yBAAqB,IAAA,EACzD,QAAA,kBAAA,GAAA;AAAA,UAAC,OAAA;AAAA,UAAA;AAAA,YACC,QAAA,EAAS,QAAA;AAAA,YACT,OAAO,MAAA,CAAO,KAAA;AAAA,YACd,SAAS,MAAA,CAAO,OAAA;AAAA,YAChB,cAAc,MAAA,CAAO,YAAA;AAAA,YACrB,aAAa,MAAA,CAAO,WAAA;AAAA,YACpB,YAAY,MAAA,CAAO,UAAA;AAAA,YACnB,cAAc,MAAA,CAAO,YAAA;AAAA,YACrB,aAAA,EACE,OAAO,aAAA,IAAiB,8BAAA;AAAA,YAE1B,SAAS,MAAA,CAAO,OAAA;AAAA,YAChB,QAAQ,MAAA,CAAO,MAAA;AAAA,YACf,UAAU,MAAA,CAAO;AAAA;AAAA,SACnB,EACF;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-K3C35KGR.js","sourcesContent":["import { ChevronLeft } from 'lucide';\n\nimport type { NavPane } from '../../../composition/panels/nav-pane.js';\nimport type { PanelBottomToolbar } from '../../../composition/panels/panel-toolbar.js';\nimport type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport {\n type ScrollEdge,\n scrollEdgeAttributes,\n} from '../../../shared/layout/scroll-edge.js';\nimport type { CssColor } from '../../../shared/styles/css-values.js';\nimport {\n joinStyles,\n type SurfaceTint,\n surfaceTintAttributes,\n type SurfaceTintScheme,\n} from '../../../shared/styles/surface-tint.js';\nimport { Toolbar, type ToolbarConfig } from '../../actions/toolbar/toolbar.js';\nimport { ToolbarControlGroup } from '../../actions/toolbar-control-group/toolbar-control-group.js';\nimport {\n type HeadingLevel,\n ToolbarText,\n type ToolbarTextSize,\n} from '../../actions/toolbar-text/toolbar-text.js';\nimport { List, type ListConfig } from '../../collections/list/list.js';\nimport { paneConfigProps } from '../../layout/pane/model/pane-config-props.js';\nimport { Pane } from '../../layout/pane/pane.js';\nimport { LucideIcon } from '../../media/lucide-icon/lucide-icon.js';\n\n/**\n * One entry in a {@link NavStack}. The app owns the stack as an array (usually a\n * signal); `NavStack` renders it and `wireNavStack` animates the transitions.\n */\nexport interface NavStackView extends NavPane<\n NavStackViewToolbar,\n PanelBottomToolbar\n> {\n /** Stable identity for keyed reconcile and transition direction. */\n key: string;\n}\n\n/** Per-view top toolbar. The stack supplies its back control before `leading`. */\nexport interface NavStackViewToolbar extends NavStackToolbarConfig {\n title?: string;\n leading?: KerfUiContent;\n center?: KerfUiContent;\n trailing?: KerfUiContent;\n}\n\n/** A view's structured bottom toolbar; it cross-fades on navigation. */\nexport type NavStackViewBottomToolbar = PanelBottomToolbar;\n\n/**\n * The top toolbar's configuration. Its `ToolbarConfig` forwards to the real\n * `Toolbar` the stack renders; by default that toolbar draws no divider and\n * claims the top and side safe-area edges the stack still touches.\n */\nexport interface NavStackToolbarConfig extends ToolbarConfig {\n /** Accessible name of the top toolbar (default: none). */\n label?: string;\n /**\n * Size of the view title's `ToolbarText`. Default `xlarge` at the root,\n * where the title is the page heading, and `large` once a back control\n * shares the bar.\n */\n titleSize?: ToolbarTextSize;\n /** Expose the view title as a heading at this level (default: a plain span). */\n headingLevel?: HeadingLevel;\n}\n\n/**\n * How a {@link NavStack}'s top chrome relates to the active view: `docked`\n * above it, or `overlay` laid over its top edge on the translucent chrome\n * material, so the view's content scrolls visibly beneath it.\n * `clear` lays it over\n * the same edge fully transparent, for chrome over imagery: legibility comes\n * from glass control groups or a scrim, and with `scrollEdge=\"material\"` the\n * chrome material fades in once content scrolls beneath it.\n */\nexport type NavStackChromePresentation = 'docked' | 'overlay' | 'clear';\n\n/**\n * How a {@link NavStack}'s bottom toolbar relates to the active view:\n * `docked` below it, or `overlay` laid over its bottom edge on the\n * translucent chrome material, so the view's content scrolls visibly beneath\n * it.\n * `clear` lays it over\n * the same edge fully transparent, for chrome over imagery: legibility comes\n * from glass control groups or a scrim, and with `scrollEdge=\"material\"` the\n * chrome material fades in once content scrolls beneath\n * it, until the view scrolls to its end.\n */\nexport type NavStackBottomToolbarPresentation = 'docked' | 'overlay' | 'clear';\n\nexport interface NavStackProps {\n id: string;\n /** Accessible name for the stack region. */\n label: string;\n /** The stack, root first; the last entry is the active top view. */\n views: NavStackView[];\n /** Accessible label for the icon-only back control (default \"Back\"). */\n backLabel?: string;\n /** The back control's icon (default a chevron-left `LucideIcon`). */\n backIcon?: KerfUiContent;\n /**\n * Visible text beside the back icon, such as the previous view's title\n * (default: icon only). When set, the text names the control and\n * `backLabel` is not used.\n */\n backText?: string;\n /** The top toolbar's configuration, forwarded to its `Toolbar`. */\n toolbarConfig?: NavStackToolbarConfig;\n /** Persistent last group in every view's top toolbar, supplied by a hosting panel. */\n panelToggle?: KerfUiContent;\n /** Hide the top toolbar entirely (rare — a fully custom-chrome view). */\n hideToolbar?: boolean;\n /** Optional persistent bottom toolbar used when the active view does not provide one. */\n bottomToolbar?: NavStackViewBottomToolbar;\n /**\n * Stack chrome separator. `auto` (default) draws both available edges\n * against a sunken active Pane and otherwise follows `chromeDividers`;\n * `hidden` suppresses the stack-owned edges.\n */\n separator?: 'auto' | 'hidden';\n /**\n * The line under the top chrome and over the bottom toolbar, where they\n * meet the active view. `scroll` (default) shows the chrome's line only\n * while the view's content is scrolled beneath it, and the bottom\n * toolbar's only while more content lies below — never when the content\n * fits — once `wireScrollDividers` (`@kerfjs/ui/wire-scroll-dividers`) is\n * wired above the stack; unwired, neither shows. `always` shows both\n * without the wiring; `none` neither, even when wired. The line is drawn\n * inside the chrome, so no state moves the chrome or the content. A\n * A sunken active Pane still draws the separator unless\n * `separator=\"hidden\"`. A `toolbarConfig.dividerSides` edge is the Toolbar's\n * own and is unaffected.\n */\n chromeDividers?: 'scroll' | 'always' | 'none';\n /**\n * `docked` (default) gives the top chrome its own band above the active\n * view. `overlay` lays the chrome over the view's top edge on the\n * translucent chrome material (`--kui-chrome-material`, opaque under\n * `prefers-reduced-transparency`, `prefers-contrast: more`, forced colors,\n * or without `backdrop-filter`), so content scrolls visibly beneath it, as\n * an iOS navigation bar does. `wireNavStack` measures the live chrome and\n * hands its height (top safe area included) to the viewport as the\n * block-start `--kui-edge-inset-*` context, so every view clears it with no\n * prop: a plain view, a sole `Pane`'s content (or header), and a nested\n * layout all pad and `scroll-padding` by it, so the first item, and anything\n * focused or scrolled into view, rests clear of the bar. Until then, and\n * with `hideToolbar`, the chrome stays docked. An untoned `ToolbarText` in\n * the chrome lifts its title and description to AA over the content passing\n * beneath it; keep any other quiet copy in the view. With `clear`, the\n * stack's own back control sits in a glass control group\n * (`material=\"glass\"`), so it stays legible over imagery.\n */\n chromePresentation?: NavStackChromePresentation;\n /**\n * `docked` (default) gives the bottom toolbar its own band below the\n * active view. `overlay` lays it over the view's bottom edge on the\n * translucent chrome material (opaque under the same preferences as\n * `chromePresentation`), so content scrolls visibly beneath it, as under\n * an iOS toolbar. `wireNavStack` measures the live bottom toolbar (never a\n * cross-fading copy) and hands its height (bottom safe area included) to\n * the viewport as the block-end `--kui-edge-inset-*` context, so a plain\n * view, a sole `Pane`'s content (or footer), and a nested layout rest their\n * last item, and anything focused or scrolled into view, clear of it. Until\n * then, and while no bottom toolbar is shown, it stays docked. Independent\n * of `chromePresentation`, which governs only the top chrome. An untoned\n * `ToolbarText` in the toolbar lifts to AA over the content beneath it.\n */\n bottomToolbarPresentation?: NavStackBottomToolbarPresentation;\n /**\n * For `clear` chrome or bottom toolbar, `material` fades the chrome\n * material in while the active view's content lies beneath it (default\n * `none`).\n */\n scrollEdge?: ScrollEdge;\n /**\n * The scroll distance, in CSS pixels, over which the scroll edge fades in\n * (default 60).\n */\n scrollEdgeDistance?: number;\n /**\n * Paint the stack, its docked chrome and bottom toolbar, and every view in\n * an app-chosen color (a `@kerfjs/ui/css-values` color builder) instead of\n * the surface. Overlay chrome keeps the chrome material; one view's own\n * color goes in its `pane: { background }`. Forced colors paint `Canvas`.\n */\n background?: CssColor;\n /**\n * A scoped tint (`{ color, scheme }`) for the stack, its chrome, bottom toolbar, and views: its surfaces and every\n * descendant re-derive their surface and text tokens from the app's color\n * in the declared scheme, with lightness clamped to keep text at WCAG AA.\n */\n tint?: SurfaceTint;\n /**\n * Scope this surface and its subtree to the light or dark palette, whatever\n * the page's scheme (a light card on a dark page). A `tint` already sets\n * its scheme; pass `scheme` alone for the plain palette, or with a tint\n * only when they agree.\n */\n scheme?: SurfaceTintScheme;\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n /** Application `data-*` metadata on the root, such as a row key or an\n * editor node marker; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst DEFAULT_SAFE_AREA_EDGES = [\n 'block-start',\n 'inline-start',\n 'inline-end',\n] as const;\n\nconst DEFAULT_BOTTOM_SAFE_AREA_EDGES = [\n 'block-end',\n 'inline-start',\n 'inline-end',\n] as const;\n\nfunction chromeList(content: KerfUiContent, config?: ListConfig) {\n return (\n <List\n dividerSides={config?.dividerSides}\n gap={config?.gap}\n hAlign={config?.hAlign}\n vAlign={config?.vAlign}\n textInsets={config?.textInsets}\n controlInsets={config?.controlInsets}\n >\n {content}\n </List>\n );\n}\n\n// Markers the component writes; data-key is not one of them on the root\n// (only inner rows use it), so an app row key passes through.\nconst NAV_STACK_PROTECTED = new Set([\n 'data-background',\n 'data-bottom-toolbar-material',\n 'data-bottom-toolbar-presentation',\n 'data-chrome-dividers',\n 'data-chrome-material',\n 'data-chrome-presentation',\n 'data-component',\n 'data-depth',\n 'data-kui-tint',\n 'data-kui-tint-accent',\n 'data-nav-active',\n 'data-nav-key',\n 'data-nav-stack-id',\n 'data-separator',\n]);\n\n/**\n * A navigation stack (iOS-style push/pop). Renders every entry stacked, the last\n * one active; `@kerfjs/ui/wire-nav-stack`'s `wireNavStack` slides the content and\n * cross-fades the chrome across a change. Its top chrome is a real `Toolbar`: the\n * back control and title lead, the active view's `toolbar` fills the zones,\n * and `toolbarConfig` supplies defaults. A single-pane\n * layout is a `NavStack` with one entry. See `docs/23-app-layouts.md` §3.1.\n */\nexport function NavStack({\n id,\n label,\n views,\n backLabel = 'Back',\n backIcon,\n backText,\n toolbarConfig = {},\n panelToggle,\n hideToolbar = false,\n bottomToolbar,\n separator = 'auto',\n chromeDividers = 'scroll',\n chromePresentation = 'docked',\n bottomToolbarPresentation = 'docked',\n scrollEdge = 'none',\n scrollEdgeDistance,\n background,\n tint,\n scheme,\n className = '',\n slot,\n rootAttributes = {},\n}: NavStackProps) {\n const tinted = surfaceTintAttributes(tint, scheme);\n const topIndex = views.length - 1;\n const top = views[topIndex];\n const topToolbar = top?.toolbar;\n const bottom = top?.bottomToolbar ?? bottomToolbar;\n const canPop = views.length > 1;\n const topDensity = topToolbar?.density ?? toolbarConfig.density;\n // With a back control, the title centers on the bar (iOS-style) unless the\n // view owns the center zone; at the root it leads and fills, left-aligned.\n const centerTitle = canPop && topToolbar?.center === undefined;\n const title = (\n <ToolbarText\n text={topToolbar?.title ?? ''}\n size={\n topToolbar?.titleSize ??\n toolbarConfig.titleSize ??\n (canPop ? 'large' : 'xlarge')\n }\n headingLevel={topToolbar?.headingLevel ?? toolbarConfig.headingLevel}\n fill={!centerTitle}\n />\n );\n return (\n <section\n {...filterDataAttributes(rootAttributes, NAV_STACK_PROTECTED)}\n class={`kui-nav-stack ${tinted.className} ${className}`\n .replace(/\\s+/g, ' ')\n .trim()}\n id={id}\n data-component=\"nav-stack\"\n data-nav-stack-id={id}\n data-depth={String(views.length)}\n data-separator={separator}\n data-chrome-dividers={\n chromeDividers === 'always' || chromeDividers === 'none'\n ? chromeDividers\n : undefined\n }\n data-chrome-presentation={\n chromePresentation !== 'docked' && !hideToolbar ? 'overlay' : undefined\n }\n data-chrome-material={\n chromePresentation === 'clear' && !hideToolbar ? 'clear' : undefined\n }\n data-bottom-toolbar-presentation={\n bottomToolbarPresentation !== 'docked' ? 'overlay' : undefined\n }\n data-bottom-toolbar-material={\n bottomToolbarPresentation === 'clear' ? 'clear' : undefined\n }\n {...scrollEdgeAttributes(\n scrollEdge,\n scrollEdgeDistance,\n (chromePresentation === 'clear' && !hideToolbar) ||\n bottomToolbarPresentation === 'clear',\n )}\n data-background={background === undefined ? undefined : ''}\n data-kui-tint={tinted['data-kui-tint']}\n data-kui-tint-accent={tinted['data-kui-tint-accent']}\n data-kui-scheme={tinted['data-kui-scheme']}\n style={joinStyles(\n background === undefined\n ? undefined\n : `--_kui-nav-stack-background:${background}`,\n tinted.style,\n )}\n aria-label={label}\n slot={slot}\n >\n {!hideToolbar && (\n <div class=\"kui-nav-stack__chrome\" data-nav-stack-chrome>\n <Toolbar\n label={topToolbar?.label ?? toolbarConfig.label}\n density={topDensity}\n dividerSides={\n topToolbar?.dividerSides ?? toolbarConfig.dividerSides\n }\n centerAlign={\n centerTitle\n ? 'balanced'\n : (topToolbar?.centerAlign ?? toolbarConfig.centerAlign)\n }\n responsive={topToolbar?.responsive ?? toolbarConfig.responsive}\n responsiveAt={\n topToolbar?.responsiveAt ?? toolbarConfig.responsiveAt\n }\n safeAreaEdges={\n topToolbar?.safeAreaEdges ??\n toolbarConfig.safeAreaEdges ??\n DEFAULT_SAFE_AREA_EDGES\n }\n leading={\n <>\n {canPop && (\n <ToolbarControlGroup\n content={backText ? 'mixed' : 'icon'}\n size={topDensity === 'compact' ? 'compact' : 'default'}\n material={\n chromePresentation === 'clear' ? 'glass' : undefined\n }\n single\n >\n <button\n type=\"button\"\n class=\"kui-nav-stack__back\"\n data-nav-back\n aria-label={backText ? undefined : backLabel}\n >\n {backIcon ?? (\n <LucideIcon\n icon={ChevronLeft}\n name=\"chevron-left\"\n className=\"kui-nav-stack__back-icon\"\n />\n )}\n {backText ? <span>{backText}</span> : null}\n </button>\n </ToolbarControlGroup>\n )}\n {topToolbar?.leading}\n {centerTitle ? null : title}\n </>\n }\n center={centerTitle ? title : topToolbar?.center}\n trailing={\n <>\n {topToolbar?.trailing}\n {panelToggle}\n </>\n }\n />\n </div>\n )}\n <div class=\"kui-nav-stack__viewport\" data-nav-stack-viewport>\n {views.map((view, index) => (\n <article\n class=\"kui-nav-stack__view\"\n data-key={view.key}\n data-nav-key={view.key}\n data-nav-active={String(index === topIndex)}\n aria-hidden={String(index !== topIndex)}\n >\n {view.pane ||\n view.header !== undefined ||\n view.footer !== undefined ? (\n <Pane\n {...paneConfigProps(view.pane)}\n header={\n view.header === undefined ? undefined : (\n <div data-nav-stack-header>\n {chromeList(view.header, view.headerList)}\n </div>\n )\n }\n footer={\n view.footer === undefined ? undefined : (\n <div data-nav-stack-footer>\n {chromeList(view.footer, view.footerList)}\n </div>\n )\n }\n >\n {view.content}\n </Pane>\n ) : (\n view.content\n )}\n </article>\n ))}\n </div>\n {bottom && (\n <footer class=\"kui-nav-stack__bottom\" data-nav-stack-bottom>\n <Toolbar\n position=\"footer\"\n label={bottom.label}\n density={bottom.density}\n dividerSides={bottom.dividerSides}\n centerAlign={bottom.centerAlign}\n responsive={bottom.responsive}\n responsiveAt={bottom.responsiveAt}\n safeAreaEdges={\n bottom.safeAreaEdges ?? DEFAULT_BOTTOM_SAFE_AREA_EDGES\n }\n leading={bottom.leading}\n center={bottom.center}\n trailing={bottom.trailing}\n />\n </footer>\n )}\n </section>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/navigation/nav-stack/nav-stack.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAsNA,IAAM,uBAAA,GAA0B;AAAA,EAC9B,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAEA,IAAM,8BAAA,GAAiC;AAAA,EACrC,WAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAEA,SAAS,UAAA,CAAW,SAAwB,MAAA,EAAqB;AAC/D,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,M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AK;AAAA;AAAA,SAGV,CAAA,EACH,CAAA;AAAA,QACC,0BACC,GAAA,CAAC,QAAA,EAAA,EAAO,KAAA,EAAM,uBAAA,EAAwB,yBAAqB,IAAA,EACzD,QAAA,kBAAA,GAAA;AAAA,UAAC,OAAA;AAAA,UAAA;AAAA,YACC,QAAA,EAAS,QAAA;AAAA,YACT,OAAO,MAAA,CAAO,KAAA;AAAA,YACd,SAAS,MAAA,CAAO,OAAA;AAAA,YAChB,cAAc,MAAA,CAAO,YAAA;AAAA,YACrB,aAAa,MAAA,CAAO,WAAA;AAAA,YACpB,YAAY,MAAA,CAAO,UAAA;AAAA,YACnB,cAAc,MAAA,CAAO,YAAA;AAAA,YACrB,aAAA,EACE,OAAO,aAAA,IAAiB,8BAAA;AAAA,YAE1B,SAAS,MAAA,CAAO,OAAA;AAAA,YAChB,QAAQ,MAAA,CAAO,MAAA;AAAA,YACf,UAAU,MAAA,CAAO;AAAA;AAAA,SACnB,EACF;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-XO5IOPM5.js","sourcesContent":["import { ChevronLeft } from 'lucide';\n\nimport type { NavPane } from '../../../composition/panels/nav-pane.js';\nimport type { PanelBottomToolbar } from '../../../composition/panels/panel-toolbar.js';\nimport type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport {\n type ScrollEdge,\n scrollEdgeAttributes,\n} from '../../../shared/layout/scroll-edge.js';\nimport type { CssColor } from '../../../shared/styles/css-values.js';\nimport {\n joinStyles,\n type SurfaceTint,\n surfaceTintAttributes,\n type SurfaceTintScheme,\n} from '../../../shared/styles/surface-tint.js';\nimport { Toolbar, type ToolbarConfig } from '../../actions/toolbar/toolbar.js';\nimport { ToolbarControlGroup } from '../../actions/toolbar-control-group/toolbar-control-group.js';\nimport {\n type HeadingLevel,\n ToolbarText,\n type ToolbarTextSize,\n} from '../../actions/toolbar-text/toolbar-text.js';\nimport { List, type ListConfig } from '../../collections/list/list.js';\nimport { paneConfigProps } from '../../layout/pane/model/pane-config-props.js';\nimport { Pane } from '../../layout/pane/pane.js';\nimport { LucideIcon } from '../../media/lucide-icon/lucide-icon.js';\n\n/**\n * One entry in a {@link NavStack}. The app owns the stack as an array (usually a\n * signal); `NavStack` renders it and `wireNavStack` animates the transitions.\n */\nexport interface NavStackView extends NavPane<\n NavStackViewToolbar,\n PanelBottomToolbar\n> {\n /** Stable identity for keyed reconcile and transition direction. */\n key: string;\n}\n\n/** Per-view top toolbar. The stack supplies its back control before `leading`. */\nexport interface NavStackViewToolbar extends NavStackToolbarConfig {\n title?: string;\n leading?: KerfUiContent;\n center?: KerfUiContent;\n trailing?: KerfUiContent;\n}\n\n/** A view's structured bottom toolbar; it cross-fades on navigation. */\nexport type NavStackViewBottomToolbar = PanelBottomToolbar;\n\n/**\n * The top toolbar's configuration. Its `ToolbarConfig` forwards to the real\n * `Toolbar` the stack renders; by default that toolbar draws no divider and\n * claims the top and side safe-area edges the stack still touches.\n */\nexport interface NavStackToolbarConfig extends ToolbarConfig {\n /** Accessible name of the top toolbar (default: none). */\n label?: string;\n /**\n * Size of the view title's `ToolbarText`. Default `xlarge` at the root,\n * where the title is the page heading, and `large` once a back control\n * shares the bar.\n */\n titleSize?: ToolbarTextSize;\n /** Expose the view title as a heading at this level (default: a plain span). */\n headingLevel?: HeadingLevel;\n}\n\n/**\n * How a {@link NavStack}'s top chrome relates to the active view: `docked`\n * above it, or `overlay` laid over its top edge on the translucent chrome\n * material, so the view's content scrolls visibly beneath it.\n * `clear` lays it over\n * the same edge fully transparent, for chrome over imagery: legibility comes\n * from glass control groups or a scrim, and with `scrollEdge=\"material\"` the\n * chrome material fades in once content scrolls beneath it.\n */\nexport type NavStackChromePresentation = 'docked' | 'overlay' | 'clear';\n\n/**\n * How a {@link NavStack}'s bottom toolbar relates to the active view:\n * `docked` below it, or `overlay` laid over its bottom edge on the\n * translucent chrome material, so the view's content scrolls visibly beneath\n * it.\n * `clear` lays it over\n * the same edge fully transparent, for chrome over imagery: legibility comes\n * from glass control groups or a scrim, and with `scrollEdge=\"material\"` the\n * chrome material fades in once content scrolls beneath\n * it, until the view scrolls to its end.\n */\nexport type NavStackBottomToolbarPresentation = 'docked' | 'overlay' | 'clear';\n\nexport interface NavStackProps {\n id: string;\n /** Accessible name for the stack region. */\n label: string;\n /** The stack, root first; the last entry is the active top view. */\n views: NavStackView[];\n /** Accessible label for the icon-only back control (default \"Back\"). */\n backLabel?: string;\n /** The back control's icon (default a chevron-left `LucideIcon`). */\n backIcon?: KerfUiContent;\n /**\n * Visible text beside the back icon, such as the previous view's title\n * (default: icon only). When set, the text names the control and\n * `backLabel` is not used.\n */\n backText?: string;\n /** The top toolbar's configuration, forwarded to its `Toolbar`. */\n toolbarConfig?: NavStackToolbarConfig;\n /** Persistent last group in every view's top toolbar, supplied by a hosting panel. */\n panelToggle?: KerfUiContent;\n /** Hide the top toolbar entirely (rare — a fully custom-chrome view). */\n hideToolbar?: boolean;\n /** Optional persistent bottom toolbar used when the active view does not provide one. */\n bottomToolbar?: NavStackViewBottomToolbar;\n /**\n * Stack chrome separator. `auto` (default) draws both available edges\n * against a sunken active Pane and otherwise follows `chromeDividers`;\n * `hidden` suppresses the stack-owned edges.\n */\n separator?: 'auto' | 'hidden';\n /**\n * The line under the top chrome and over the bottom toolbar, where they\n * meet the active view. `scroll` (default) shows the chrome's line only\n * while the view's content is scrolled beneath it, and the bottom\n * toolbar's only while more content lies below — never when the content\n * fits — once `wireScrollDividers` (`@kerfjs/ui/wire-scroll-dividers`) is\n * wired above the stack; unwired, neither shows. `always` shows both\n * without the wiring; `none` neither, even when wired. The line is drawn\n * inside the chrome, so no state moves the chrome or the content. A\n * A sunken active Pane still draws the separator unless\n * `separator=\"hidden\"`. A `toolbarConfig.dividerSides` edge is the Toolbar's\n * own and is unaffected.\n */\n chromeDividers?: 'scroll' | 'always' | 'none';\n /**\n * `docked` (default) gives the top chrome its own band above the active\n * view. `overlay` lays the chrome over the view's top edge on the\n * translucent chrome material (`--kui-chrome-material`, opaque under\n * `prefers-reduced-transparency`, `prefers-contrast: more`, forced colors,\n * or without `backdrop-filter`), so content scrolls visibly beneath it, as\n * an iOS navigation bar does. `wireNavStack` measures the live chrome and\n * hands its height (top safe area included) to the viewport as the\n * block-start `--kui-edge-inset-*` context, so every view clears it with no\n * prop: a plain view, a sole `Pane`'s content (or header), and a nested\n * layout all pad and `scroll-padding` by it, so the first item, and anything\n * focused or scrolled into view, rests clear of the bar. Until then, and\n * with `hideToolbar`, the chrome stays docked. An untoned `ToolbarText` in\n * the chrome lifts its title and description to AA over the content passing\n * beneath it; keep any other quiet copy in the view. With `clear`, the\n * stack's own back control sits in a glass control group\n * (`material=\"glass\"`), so it stays legible over imagery.\n */\n chromePresentation?: NavStackChromePresentation;\n /**\n * `docked` (default) gives the bottom toolbar its own band below the\n * active view. `overlay` lays it over the view's bottom edge on the\n * translucent chrome material (opaque under the same preferences as\n * `chromePresentation`), so content scrolls visibly beneath it, as under\n * an iOS toolbar. `wireNavStack` measures the live bottom toolbar (never a\n * cross-fading copy) and hands its height (bottom safe area included) to\n * the viewport as the block-end `--kui-edge-inset-*` context, so a plain\n * view, a sole `Pane`'s content (or footer), and a nested layout rest their\n * last item, and anything focused or scrolled into view, clear of it. Until\n * then, and while no bottom toolbar is shown, it stays docked. Independent\n * of `chromePresentation`, which governs only the top chrome. An untoned\n * `ToolbarText` in the toolbar lifts to AA over the content beneath it.\n */\n bottomToolbarPresentation?: NavStackBottomToolbarPresentation;\n /**\n * For `clear` chrome or bottom toolbar, `material` fades the chrome\n * material in while the active view's content lies beneath it (default\n * `none`).\n */\n scrollEdge?: ScrollEdge;\n /**\n * The scroll distance, in CSS pixels, over which the scroll edge fades in\n * (default 60).\n */\n scrollEdgeDistance?: number;\n /**\n * Paint the stack, its docked chrome and bottom toolbar, and every view in\n * an app-chosen color (a `@kerfjs/ui/css-values` color builder) instead of\n * the surface. Overlay chrome keeps the chrome material; one view's own\n * color goes in its `pane: { background }`. Forced colors paint `Canvas`.\n */\n background?: CssColor;\n /**\n * A scoped tint (`{ color, scheme }`) for the stack, its chrome, bottom toolbar, and views: its surfaces and every\n * descendant re-derive their surface and text tokens from the app's color\n * in the declared scheme, with lightness clamped to keep text at WCAG AA.\n */\n tint?: SurfaceTint;\n /**\n * Scope this surface and its subtree to the light or dark palette, whatever\n * the page's scheme (a light card on a dark page). A `tint` already sets\n * its scheme; pass `scheme` alone for the plain palette, or with a tint\n * only when they agree.\n */\n scheme?: SurfaceTintScheme;\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n /** Application `data-*` metadata on the root, such as a row key or an\n * editor node marker; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst DEFAULT_SAFE_AREA_EDGES = [\n 'block-start',\n 'inline-start',\n 'inline-end',\n] as const;\n\nconst DEFAULT_BOTTOM_SAFE_AREA_EDGES = [\n 'block-end',\n 'inline-start',\n 'inline-end',\n] as const;\n\nfunction chromeList(content: KerfUiContent, config?: ListConfig) {\n return (\n <List\n dividerSides={config?.dividerSides}\n gap={config?.gap}\n hAlign={config?.hAlign}\n vAlign={config?.vAlign}\n textInsets={config?.textInsets}\n controlInsets={config?.controlInsets}\n >\n {content}\n </List>\n );\n}\n\n// Markers the component writes; data-key is not one of them on the root\n// (only inner rows use it), so an app row key passes through.\nconst NAV_STACK_PROTECTED = new Set([\n 'data-background',\n 'data-bottom-toolbar-material',\n 'data-bottom-toolbar-presentation',\n 'data-chrome-dividers',\n 'data-chrome-material',\n 'data-chrome-presentation',\n 'data-component',\n 'data-depth',\n 'data-kui-tint',\n 'data-kui-tint-accent',\n 'data-nav-active',\n 'data-nav-key',\n 'data-nav-stack-id',\n 'data-separator',\n]);\n\n/**\n * A navigation stack (iOS-style push/pop). Renders every entry stacked, the last\n * one active; `@kerfjs/ui/wire-nav-stack`'s `wireNavStack` slides the content and\n * cross-fades the chrome across a change. Its top chrome is a real `Toolbar`: the\n * back control and title lead, the active view's `toolbar` fills the zones,\n * and `toolbarConfig` supplies defaults. A single-pane\n * layout is a `NavStack` with one entry. See `docs/23-app-layouts.md` §3.1.\n */\nexport function NavStack({\n id,\n label,\n views,\n backLabel = 'Back',\n backIcon,\n backText,\n toolbarConfig = {},\n panelToggle,\n hideToolbar = false,\n bottomToolbar,\n separator = 'auto',\n chromeDividers = 'scroll',\n chromePresentation = 'docked',\n bottomToolbarPresentation = 'docked',\n scrollEdge = 'none',\n scrollEdgeDistance,\n background,\n tint,\n scheme,\n className = '',\n slot,\n rootAttributes = {},\n}: NavStackProps) {\n const tinted = surfaceTintAttributes(tint, scheme);\n const topIndex = views.length - 1;\n const top = views[topIndex];\n const topToolbar = top?.toolbar;\n const bottom = top?.bottomToolbar ?? bottomToolbar;\n const canPop = views.length > 1;\n const topDensity = topToolbar?.density ?? toolbarConfig.density;\n // With a back control, the title centers on the bar (iOS-style) unless the\n // view owns the center zone; at the root it leads and fills, left-aligned.\n const centerTitle = canPop && topToolbar?.center === undefined;\n const title = (\n <ToolbarText\n text={topToolbar?.title ?? ''}\n size={\n topToolbar?.titleSize ??\n toolbarConfig.titleSize ??\n (canPop ? 'large' : 'xlarge')\n }\n headingLevel={topToolbar?.headingLevel ?? toolbarConfig.headingLevel}\n fill={!centerTitle}\n />\n );\n return (\n <section\n {...filterDataAttributes(rootAttributes, NAV_STACK_PROTECTED)}\n class={`kui-nav-stack ${tinted.className} ${className}`\n .replace(/\\s+/g, ' ')\n .trim()}\n id={id}\n data-component=\"nav-stack\"\n data-nav-stack-id={id}\n data-depth={String(views.length)}\n data-separator={separator}\n data-chrome-dividers={\n chromeDividers === 'always' || chromeDividers === 'none'\n ? chromeDividers\n : undefined\n }\n data-chrome-presentation={\n chromePresentation !== 'docked' && !hideToolbar ? 'overlay' : undefined\n }\n data-chrome-material={\n chromePresentation === 'clear' && !hideToolbar ? 'clear' : undefined\n }\n data-bottom-toolbar-presentation={\n bottomToolbarPresentation !== 'docked' ? 'overlay' : undefined\n }\n data-bottom-toolbar-material={\n bottomToolbarPresentation === 'clear' ? 'clear' : undefined\n }\n {...scrollEdgeAttributes(\n scrollEdge,\n scrollEdgeDistance,\n (chromePresentation === 'clear' && !hideToolbar) ||\n bottomToolbarPresentation === 'clear',\n )}\n data-background={background === undefined ? undefined : ''}\n data-kui-tint={tinted['data-kui-tint']}\n data-kui-tint-accent={tinted['data-kui-tint-accent']}\n data-kui-scheme={tinted['data-kui-scheme']}\n style={joinStyles(\n background === undefined\n ? undefined\n : `--_kui-nav-stack-background:${background}`,\n tinted.style,\n )}\n aria-label={label}\n slot={slot}\n >\n {!hideToolbar && (\n <div class=\"kui-nav-stack__chrome\" data-nav-stack-chrome>\n <Toolbar\n label={topToolbar?.label ?? toolbarConfig.label}\n density={topDensity}\n dividerSides={\n topToolbar?.dividerSides ?? toolbarConfig.dividerSides\n }\n centerAlign={\n centerTitle\n ? 'balanced'\n : (topToolbar?.centerAlign ?? toolbarConfig.centerAlign)\n }\n responsive={topToolbar?.responsive ?? toolbarConfig.responsive}\n responsiveAt={\n topToolbar?.responsiveAt ?? toolbarConfig.responsiveAt\n }\n safeAreaEdges={\n topToolbar?.safeAreaEdges ??\n toolbarConfig.safeAreaEdges ??\n DEFAULT_SAFE_AREA_EDGES\n }\n leading={\n <>\n {canPop && (\n <ToolbarControlGroup\n content={backText ? 'mixed' : 'icon'}\n size={topDensity === 'compact' ? 'compact' : 'default'}\n material={\n chromePresentation === 'clear' ? 'glass' : undefined\n }\n single\n >\n <button\n type=\"button\"\n class=\"kui-nav-stack__back\"\n data-nav-back\n aria-label={backText ? undefined : backLabel}\n >\n {backIcon ?? (\n <LucideIcon\n icon={ChevronLeft}\n name=\"chevron-left\"\n className=\"kui-nav-stack__back-icon\"\n />\n )}\n {backText ? <span>{backText}</span> : null}\n </button>\n </ToolbarControlGroup>\n )}\n {topToolbar?.leading}\n {centerTitle ? null : title}\n </>\n }\n center={centerTitle ? title : topToolbar?.center}\n trailing={\n <>\n {topToolbar?.trailing}\n {panelToggle}\n </>\n }\n />\n </div>\n )}\n <div class=\"kui-nav-stack__viewport\" data-nav-stack-viewport>\n {views.map((view, index) => (\n <article\n class=\"kui-nav-stack__view\"\n data-key={view.key}\n data-nav-key={view.key}\n data-nav-active={String(index === topIndex)}\n aria-hidden={String(index !== topIndex)}\n >\n {view.pane ||\n view.header !== undefined ||\n view.footer !== undefined ? (\n <Pane\n {...paneConfigProps(view.pane)}\n header={\n view.header === undefined ? undefined : (\n <div data-nav-stack-header>\n {chromeList(view.header, view.headerList)}\n </div>\n )\n }\n footer={\n view.footer === undefined ? undefined : (\n <div data-nav-stack-footer>\n {chromeList(view.footer, view.footerList)}\n </div>\n )\n }\n >\n {view.content}\n </Pane>\n ) : (\n view.content\n )}\n </article>\n ))}\n </div>\n {bottom && (\n <footer class=\"kui-nav-stack__bottom\" data-nav-stack-bottom>\n <Toolbar\n position=\"footer\"\n label={bottom.label}\n density={bottom.density}\n dividerSides={bottom.dividerSides}\n centerAlign={bottom.centerAlign}\n responsive={bottom.responsive}\n responsiveAt={bottom.responsiveAt}\n safeAreaEdges={\n bottom.safeAreaEdges ?? DEFAULT_BOTTOM_SAFE_AREA_EDGES\n }\n leading={bottom.leading}\n center={bottom.center}\n trailing={bottom.trailing}\n />\n </footer>\n )}\n </section>\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SafeHtml } from 'kerfjs';
|
|
2
|
-
import { P as PanelSide, a as PanelToolbar, b as PanelChromePlacement, c as PanelBottomToolbar, d as PanelToggle } from './panel-toolbar-
|
|
3
|
-
export { e as collapsiblePanelToggleIcon } from './panel-toolbar-
|
|
2
|
+
import { P as PanelSide, a as PanelToolbar, b as PanelChromePlacement, c as PanelBottomToolbar, d as PanelToggle } from './panel-toolbar-CEcHHDkn.js';
|
|
3
|
+
export { e as collapsiblePanelToggleIcon } from './panel-toolbar-CEcHHDkn.js';
|
|
4
4
|
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
5
5
|
import { R as RootDataAttributes } from './extension-attributes-IJ4decoa.js';
|
|
6
6
|
import { ToolbarConfig } from './toolbar.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { collapsiblePanelToggleIcon, composedPanelBody, relocatedPanelGroups, groupSizeFor } from './chunk-
|
|
2
|
-
export { collapsiblePanelToggleIcon } from './chunk-
|
|
1
|
+
import { collapsiblePanelToggleIcon, composedPanelBody, relocatedPanelGroups, groupSizeFor } from './chunk-IPYQYLSX.js';
|
|
2
|
+
export { collapsiblePanelToggleIcon } from './chunk-IPYQYLSX.js';
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
@@ -44,10 +44,14 @@ interface ColumnExplorerProps {
|
|
|
44
44
|
preview?: SafeHtml;
|
|
45
45
|
/** ColumnTrack's layout: `scroll` (default) or `paged` for a phone. */
|
|
46
46
|
layout?: 'scroll' | 'paged';
|
|
47
|
+
/** ColumnTrack inline clearance; none clips columns at the explorer edges. */
|
|
48
|
+
inset?: 'default' | 'none';
|
|
47
49
|
/** Each column's minimum width (ColumnTrack's default 250px). */
|
|
48
50
|
minColumnWidth?: CssLength;
|
|
49
51
|
/** How much of the next column a paged layout shows. */
|
|
50
52
|
peek?: CssLength;
|
|
53
|
+
/** Show a quiet parent heading in every column, starting with this root name. */
|
|
54
|
+
rootHeading?: string;
|
|
51
55
|
/** Row density: `default` or `compact`. */
|
|
52
56
|
density?: 'default' | 'compact' | /** @deprecated Use default. */ 'standard';
|
|
53
57
|
className?: string;
|
|
@@ -62,6 +66,6 @@ interface ColumnExplorerProps {
|
|
|
62
66
|
* its children. The application owns the nodes and the chosen path and
|
|
63
67
|
* handles `action`; wire the keyboard with `wireColumnExplorer`.
|
|
64
68
|
*/
|
|
65
|
-
declare function ColumnExplorer({ id, label, nodes, path, action, preview, layout, minColumnWidth, peek, density, className, rootAttributes, slot, }: ColumnExplorerProps): SafeHtml;
|
|
69
|
+
declare function ColumnExplorer({ id, label, nodes, path, action, preview, layout, inset, minColumnWidth, peek, rootHeading, density, className, rootAttributes, slot, }: ColumnExplorerProps): SafeHtml;
|
|
66
70
|
|
|
67
71
|
export { ColumnExplorer, type ColumnExplorerProps, type ExplorerColumn, explorerChosen, explorerColumns };
|