@ixfx/components 0.15.4 → 0.16.0

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.
Files changed (101) hide show
  1. package/bundle/index.d.ts +1223 -48
  2. package/bundle/index.js +875 -700
  3. package/dist/ac-text.d.ts +1 -1
  4. package/dist/{ac-token-Cq7lsYf-.d.ts → ac-token-qEs3FsQv.d.ts} +1 -1
  5. package/dist/ac-token.d.ts +1 -1
  6. package/dist/colour-picker.d.ts +1 -1
  7. package/dist/crumb-navigation-BbqfmkYs.d.ts +147 -0
  8. package/dist/crumb-navigation-YnFVFqrx.js +1290 -0
  9. package/dist/crumbs.d.ts +2 -115
  10. package/dist/crumbs.js +1 -1179
  11. package/dist/{data-grid-CbiubdG2.d.ts → data-grid-CIG2DVip.d.ts} +58 -9
  12. package/dist/{data-grid-Dx3l3dxw.js → data-grid-rMkLX2qo.js} +630 -215
  13. package/dist/data-grid.d.ts +3 -3
  14. package/dist/data-grid.js +1 -1
  15. package/dist/{detail-list-ClkMV0SN.d.ts → detail-list-6iMTNP4N.d.ts} +35 -5
  16. package/dist/{detail-list-q8bs67BM.js → detail-list-C4pDSoI8.js} +218 -7
  17. package/dist/detail-list.d.ts +4 -4
  18. package/dist/detail-list.js +1 -1
  19. package/dist/{flat-list-0xTZdXzh.d.ts → flat-list-JPgQSmLW.d.ts} +28 -5
  20. package/dist/flat-list.d.ts +2 -2
  21. package/dist/flat-list.js +123 -4
  22. package/dist/{grid-list-y6dWJYu3.js → grid-list-CdEkScn-.js} +276 -75
  23. package/dist/{grid-list-BnWJUIBC.d.ts → grid-list-D6n7WH8l.d.ts} +128 -22
  24. package/dist/grid-list.d.ts +3 -3
  25. package/dist/grid-list.js +1 -1
  26. package/dist/{grouped-item-lister-Bhyo-dkH.d.ts → grouped-item-lister-DETte0Dh.d.ts} +1 -1
  27. package/dist/grouped-item-lister.d.ts +1 -1
  28. package/dist/{icon-DR_3rSyZ.d.ts → icon-CDGprSdE.d.ts} +1 -1
  29. package/dist/icons.d.ts +2 -2
  30. package/dist/incr-search.d.ts +1 -1
  31. package/dist/index-9ttcdwlL.d.ts +71 -0
  32. package/dist/{index-BAuqR9El.d.ts → index-Bx0BXPxI.d.ts} +52 -6
  33. package/dist/index-CYRc6Dah.d.ts +475 -0
  34. package/dist/{index-garxxqgV.d.ts → index-CYndvTWH.d.ts} +1 -1
  35. package/dist/{index-BUB5SICW.d.ts → index-CoqtMSd9.d.ts} +1 -1
  36. package/dist/{index-Bz3loIAf.d.ts → index-DN2BWctP.d.ts} +1 -1
  37. package/dist/{index-BPTuCRGb.d.ts → index-Dr80Zdl6.d.ts} +2 -2
  38. package/dist/{index-cnaRPQPp.d.ts → index-DxyyVqzA.d.ts} +2 -2
  39. package/dist/{index-CJ5fshD3.d.ts → index-UvnoZUAo.d.ts} +1 -1
  40. package/dist/index.d.ts +380 -33
  41. package/dist/index.js +2247 -866
  42. package/dist/{labelled-input-base-Dp_9KP0G.d.ts → labelled-input-base-DiTme1JO.d.ts} +1 -1
  43. package/dist/labelled-radial-input.d.ts +2 -2
  44. package/dist/labelled-range-input.d.ts +1 -1
  45. package/dist/labelled-slider-input.d.ts +1 -1
  46. package/dist/list-group-header.d.ts +1 -1
  47. package/dist/{list-native-drag-controller-O2Nruqpi.d.ts → list-native-drag-controller-D_UrXipS.d.ts} +1 -1
  48. package/dist/{list-selection-controller-BeE70lbB.js → list-selection-controller-5L0Nj9tR.js} +87 -2
  49. package/dist/{menu-item-B0zqw2xp.d.ts → menu-item-bF6narIz.d.ts} +1 -1
  50. package/dist/menu.d.ts +2 -2
  51. package/dist/miller-BFRfn0ve.js +2237 -0
  52. package/dist/miller.d.ts +4 -437
  53. package/dist/miller.js +1 -1815
  54. package/dist/panel.d.ts +1 -1
  55. package/dist/pending-BGidHppL.js +91 -0
  56. package/dist/scroll-hover-guard-Cjw6179Q.js +35 -0
  57. package/dist/{split-layout-C5SYbDrq.d.ts → split-layout-CophkNeU.d.ts} +42 -4
  58. package/dist/{split-layout-Deoxy47d.js → split-layout-DTY4PJRp.js} +251 -19
  59. package/dist/split-layout.d.ts +1 -1
  60. package/dist/split-layout.js +1 -1
  61. package/dist/sunburst-tree.d.ts +2 -0
  62. package/dist/sunburst-tree.js +2 -0
  63. package/dist/sunbursttree-list-B_VxOHlo.js +1556 -0
  64. package/dist/sunbursttree-list-D6j5BxVQ.d.ts +303 -0
  65. package/dist/{tab-list-wC0xNz1b.d.ts → tab-list-Df371rqw.d.ts} +1 -1
  66. package/dist/tabs.d.ts +1 -1
  67. package/dist/{titlebar-B5zSTZnF.d.ts → titlebar-Tqu-VvMU.d.ts} +1 -1
  68. package/dist/titlebar.d.ts +1 -1
  69. package/dist/tree-CftHwtEb.js +146 -0
  70. package/dist/{tree-D8VxvR9u.js → tree-Crdpl4nc.js} +275 -47
  71. package/dist/{tree-component-C6UHO-w9.d.ts → tree-component-DgfkxmVY.d.ts} +19 -8
  72. package/dist/tree.d.ts +3 -3
  73. package/dist/tree.js +1 -1
  74. package/dist/types-LU1u0CB8.d.ts +87 -0
  75. package/dist/vertical-list-1V1Vg2O5.js +1993 -0
  76. package/dist/{vertical-list-B8FoU-pU.d.ts → vertical-list-BPDmZx6T.d.ts} +31 -3
  77. package/dist/vertical-list.d.ts +3 -3
  78. package/dist/vertical-list.js +1 -1789
  79. package/dist/view-state-controller-BdyXWUUM.js +305 -0
  80. package/docs-user/README.md +3 -0
  81. package/docs-user/crumbs.md +27 -0
  82. package/docs-user/data-grid.md +77 -5
  83. package/docs-user/detail-list.md +54 -0
  84. package/docs-user/dock.md +54 -12
  85. package/docs-user/flat-list.md +27 -0
  86. package/docs-user/grid-list.md +64 -11
  87. package/docs-user/hyperbolic-tree.md +31 -4
  88. package/docs-user/icicle-tree.md +36 -0
  89. package/docs-user/index.json +17 -2
  90. package/docs-user/llms.txt +3 -0
  91. package/docs-user/miller.md +52 -21
  92. package/docs-user/multicol-list.md +50 -8
  93. package/docs-user/split-layout.md +45 -17
  94. package/docs-user/sunburst-tree.md +223 -0
  95. package/docs-user/tree.md +46 -7
  96. package/docs-user/treemap.md +32 -0
  97. package/docs-user/twosplit-layout.md +22 -0
  98. package/docs-user/user-catalog.md +1 -1
  99. package/docs-user/vertical-list.md +55 -7
  100. package/llms.txt +3 -0
  101. package/package.json +5 -1
@@ -0,0 +1,303 @@
1
+ import { C as TreeItemDblClickEvent, E as TreeSearchHost, M as TreeDataModel, a as TreeComponent, i as TreeCollapseEvent, j as TreeTickleEvent, k as TreeSelectEvent, n as TreeActivateEvent, o as TreeComponentEventMap, x as TreeItemClickEvent, y as TreeExpandEvent } from "./tree-component-DgfkxmVY.js";
2
+ import { a as TreeItem, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-Jky6oNAp.js";
3
+ import { a as ViewStateBase, t as GetViewStateOptions } from "./types-LU1u0CB8.js";
4
+ import "./index-9ttcdwlL.js";
5
+ import { S as ListSearchController } from "./index-Dr80Zdl6.js";
6
+ import { LitElement, PropertyValues } from "lit";
7
+ import { CommandRegistry } from "@clinth/ui-commands";
8
+ //#region src/sunburst-tree/types.d.ts
9
+ /**
10
+ * Value accessor — returns the magnitude of a node, branches included.
11
+ *
12
+ * A child's arc is its share of its parent's value:
13
+ * `child / max(parent, Σ siblings)`. When children sum to less than their
14
+ * parent, the remainder shows as an unfilled gap — which is what makes
15
+ * progressively-arriving data fill in visibly. When they sum to more, they're
16
+ * scaled to fit.
17
+ *
18
+ * Return `undefined` (or a negative / non-finite number) for "unknown": the
19
+ * node then uses the sum of its loaded children's values, or `1` for a leaf
20
+ * or not-yet-loaded node.
21
+ *
22
+ * Default: `item => item.weight`.
23
+ */
24
+ type SunburstValueAccessor = (item: TreeItem, node: TreeNode) => number | undefined;
25
+ /** Formats a node's value for the centre readout. */
26
+ type SunburstValueFormatter = (value: number, node: TreeNode) => string;
27
+ /**
28
+ * Pointer/keyboard gesture mapping (subset of `TreeInteractionMode`).
29
+ * - `'implicit'` — click selects + zooms; single selection follows the pointer.
30
+ * - `'standard'` — click selects + zooms; Ctrl/Cmd+click toggles, Shift+click range-selects.
31
+ * - `'manual'` — click only zooms; selection is driven via `select()`/`deselect()`/`clearSelection()`.
32
+ *
33
+ * `checked` is deliberately unsupported — a checkbox per arc does not hold up
34
+ * at small arc sizes.
35
+ */
36
+ type SunburstInteractionMode = `implicit` | `standard` | `manual`;
37
+ /**
38
+ * A node positioned in the absolute (unzoomed) layout produced by
39
+ * `computeSunburstLayout()`. Angles are fractions of a full turn, clockwise
40
+ * from 12 o'clock; the true root spans `0..1`.
41
+ */
42
+ type SunburstLayoutNode = {
43
+ /** Key path from the true root, joined with {@link SUNBURST_PATH_SEPARATOR}. */
44
+ readonly id: string;
45
+ readonly node: TreeNode;
46
+ readonly parentId: string | undefined;
47
+ /** Depth from the true root (root is `0`). */
48
+ readonly depth: number;
49
+ /** Start angle, fraction of a turn (0–1). */
50
+ readonly x0: number;
51
+ /** End angle, fraction of a turn (0–1). */
52
+ readonly x1: number;
53
+ /** Resolved value (accessor result, or fallback). */
54
+ readonly value: number;
55
+ /** 0-based position among siblings. */
56
+ readonly index: number;
57
+ /** Number of siblings (for `aria-setsize`). */
58
+ readonly setSize: number;
59
+ readonly hasChildren: boolean;
60
+ };
61
+ /** Absolute layout, keyed by id, in ring-major (breadth-first) order. */
62
+ type SunburstLayout = ReadonlyMap<string, SunburstLayoutNode>;
63
+ type ComputeSunburstLayoutOptions = {
64
+ valueAccessor?: SunburstValueAccessor;
65
+ /**
66
+ * Deepest absolute depth (root is `0`) to lay out. Nodes below it get no
67
+ * position. Defaults to no limit.
68
+ */
69
+ maxDepth?: number;
70
+ };
71
+ /**
72
+ * The zoom window the absolute layout is projected through: the zoom node's
73
+ * angular span becomes the full circle, and its depth becomes the centre.
74
+ */
75
+ type SunburstView = {
76
+ readonly x0: number;
77
+ readonly x1: number;
78
+ /** Absolute depth of the zoom node. */
79
+ readonly depth: number;
80
+ };
81
+ /**
82
+ * Everything that's animated about one arc, in screen terms. Interpolated
83
+ * per frame between the displayed state and the target state.
84
+ */
85
+ type SunburstArcVisual = {
86
+ /** Start angle, fraction of a turn (0–1) of the zoomed view. */
87
+ readonly a0: number;
88
+ /** End angle, fraction of a turn (0–1) of the zoomed view. */
89
+ readonly a1: number;
90
+ /**
91
+ * Ring index relative to the zoom node: `0` is the first ring, `-1` the
92
+ * centre disc, `≤ -2` collapsed into the centre. Fractional mid-animation.
93
+ */
94
+ readonly depth: number;
95
+ /** Hue offset in degrees (added to `--sunbursttree-hue-start`). */
96
+ readonly hue: number;
97
+ /** Sibling-position tone offset, `-0.5..0.5`. */
98
+ readonly shade: number;
99
+ readonly opacity: number;
100
+ };
101
+ /** Ring geometry in SVG user units (CSS px). */
102
+ type SunburstRings = {
103
+ /** Radius of the centre disc. */
104
+ readonly center: number;
105
+ /** Width of each ring. */
106
+ readonly ring: number;
107
+ };
108
+ /** Where to draw an arc's label, if it fits. */
109
+ type SunburstLabelPlacement = {
110
+ readonly kind: `straight`;
111
+ readonly x: number;
112
+ readonly y: number;
113
+ /** Rotation in degrees, applied about (x, y). */
114
+ readonly rotate: number;
115
+ readonly text: string;
116
+ } | {
117
+ readonly kind: `curved`;
118
+ /** Guide path for `<textPath>`: an arc along the ring's middle, drawn so text reads upright. */
119
+ readonly path: string;
120
+ readonly text: string;
121
+ };
122
+ /** Ids are key paths; keys only need to be unique among siblings. */
123
+ declare const SUNBURST_PATH_SEPARATOR = "";
124
+ //#endregion
125
+ //#region src/sunburst-tree/sunburst-view-state.d.ts
126
+ /**
127
+ * Pure helpers behind `ixfx-sunbursttree-list` view state. Arcs are
128
+ * identified by key *path* (keys need only be unique among siblings), so live
129
+ * selection follows its path across data changes; saved keys — which are
130
+ * bare `item.key`s — resolve to the first node, depth-first, carrying them.
131
+ * See `docs/infra-view-state.md`.
132
+ */
133
+ /** `ixfx-sunbursttree-list` view state: `selected`, `focus`, plus the zoom path. */
134
+ type SunburstViewState = ViewStateBase & {
135
+ /**
136
+ * Keys from the root's children down to the centre node; `[]` = the full
137
+ * tree. A path because keys are only unique among siblings, and so a
138
+ * lazily-loaded tree can be opened down to it, one load at a time.
139
+ */
140
+ readonly zoom?: readonly string[];
141
+ };
142
+ //#endregion
143
+ //#region src/sunburst-tree/sunbursttree-list.d.ts
144
+ /** Fired when the zoom root changes. `node` is `undefined` on zoom-out to the full tree. */
145
+ type SunburstZoomDetail = {
146
+ readonly node: TreeNode | undefined;
147
+ /** Absolute depth of the zoom node (root's children are depth 0); `-1` when fully zoomed out. */
148
+ readonly depth: number;
149
+ };
150
+ type SunburstZoomEvent = CustomEvent<SunburstZoomDetail>;
151
+ interface SunburstTreeListElementEventMap extends TreeComponentEventMap {
152
+ 'select': TreeSelectEvent;
153
+ 'tickle': TreeTickleEvent;
154
+ 'activate': TreeActivateEvent;
155
+ 'item-click': TreeItemClickEvent;
156
+ 'item-dblclick': TreeItemDblClickEvent;
157
+ 'expand': TreeExpandEvent;
158
+ 'collapse': TreeCollapseEvent;
159
+ 'zoom': SunburstZoomEvent;
160
+ }
161
+ /**
162
+ * `ixfx-sunbursttree-list` — a zoomable sunburst over weighted tree data.
163
+ *
164
+ * The zoom node is the centre disc; each ring outward is one generation,
165
+ * each arc's angle its share of its parent's value. Every data, weighting or
166
+ * zoom change animates from what's on screen to the new layout. Hues come
167
+ * from the ring around the centre; descendants take tones of their
168
+ * first-ring ancestor's hue.
169
+ *
170
+ * Implements `TreeComponent`. Deliberate differences from `ixfx-tree-list`:
171
+ * - **Expand/collapse is reinterpreted as zoom.** `expand` fires on zoom-in,
172
+ * `collapse` on zoom-out.
173
+ * - **`interactionMode` drops `checked`**; **`exclusivity` is ignored**.
174
+ * - **`filterPredicate` dims** non-matching arcs instead of hiding them.
175
+ * - **Reassigning `root` keeps zoom and selection** where the same key paths
176
+ * still exist, so streamed or immutably-rebuilt data animates in place.
177
+ */
178
+ declare class SunburstTreeListElement extends LitElement implements TreeComponent, TreeSearchHost {
179
+ #private;
180
+ static shadowRootOptions: {
181
+ delegatesFocus: boolean;
182
+ clonable?: boolean;
183
+ customElementRegistry?: CustomElementRegistry | null;
184
+ mode: ShadowRootMode;
185
+ serializable?: boolean;
186
+ slotAssignment?: SlotAssignmentMode;
187
+ };
188
+ root: TreeNode | undefined;
189
+ model: TreeDataModel | undefined;
190
+ /** Callback to lazily load children for a node. Superseded by `model` when both are set. */
191
+ loadChildren: LoadChildrenCallback | undefined;
192
+ /** Accepted for `TreeComponent` compatibility but ignored. */
193
+ exclusivity: TreeExclusivity;
194
+ selectionFilter: TreeSelectionFilter;
195
+ /** Gesture mapping. `checked` is unsupported. */
196
+ interactionMode: SunburstInteractionMode;
197
+ /** How many rings render around the centre. */
198
+ maxDepth: number;
199
+ /** Radius of the centre disc as a fraction of the overall radius (0–0.9). */
200
+ centerRatio: number;
201
+ /** Arcs whose outer edge is shorter than this (px) aren't drawn. */
202
+ minArcLength: number;
203
+ /** Hide in-arc labels (the centre readout still shows). */
204
+ disableLabels: boolean;
205
+ /**
206
+ * Curve labels to follow their ring (`<textPath>`) instead of drawing them
207
+ * straight. Arcs too narrow for that still get straight radial labels.
208
+ */
209
+ curvedLabels: boolean;
210
+ /** Duration (ms) of data, weighting and zoom transitions. `0` snaps. Respects `prefers-reduced-motion`. */
211
+ animationDuration: number;
212
+ /**
213
+ * Node value. Swap it to change weighting scheme — the chart animates to
214
+ * the new layout without rebuilding anything. Default: `item.weight`.
215
+ * See `SunburstValueAccessor` for how missing values fall back.
216
+ */
217
+ valueAccessor: SunburstValueAccessor;
218
+ /** Formats values for the centre readout. */
219
+ valueFormatter: SunburstValueFormatter;
220
+ selectedNode: TreeNode | undefined;
221
+ private _selectedNodes;
222
+ get selectedNodes(): ReadonlySet<TreeNode>;
223
+ filterPredicate: TreeFilterPredicate | undefined;
224
+ disableKeyboardNavigation: boolean;
225
+ registry: CommandRegistry<unknown> | undefined;
226
+ /** Space-separated subset of `navigate select filter`. See `docs/infra-incremental.md`. */
227
+ searchModes: string | undefined;
228
+ /** Current zoom root. `undefined` when showing the full tree. Pure view-state. */
229
+ get focusedNode(): TreeNode | undefined;
230
+ /** Id (key path) of the zoom node; `undefined` = the true root. */
231
+ private _zoomId;
232
+ /**
233
+ * Whether restoring a saved zoom may call `loadChildren` / `model` to load
234
+ * the nodes along its path (one at a time). Default `true`.
235
+ */
236
+ restoreLoads: boolean;
237
+ private _size;
238
+ readonly search: ListSearchController<{
239
+ node: TreeNode;
240
+ depth: number;
241
+ }>;
242
+ private tickled;
243
+ /** Set by every update request except animation frames — triggers a re-layout. */
244
+ private _layoutDirty;
245
+ private _ticking;
246
+ requestUpdate(...args: Parameters<LitElement[`requestUpdate`]>): void;
247
+ connectedCallback(): void;
248
+ disconnectedCallback(): void;
249
+ protected willUpdate(changed: PropertyValues): void;
250
+ protected updated(changed: PropertyValues): void;
251
+ /**
252
+ * Snapshot selection, zoom path and keyboard cursor as plain JSON, keyed by
253
+ * `item.key`. Includes pending state for keys not currently loaded.
254
+ */
255
+ getViewState(options?: GetViewStateOptions<SunburstViewState>): SunburstViewState;
256
+ /**
257
+ * Apply saved view state. Fields present replace the current ones; keys
258
+ * that aren't loaded yet are applied as they appear — including via
259
+ * `loadChildren` / `model` down a saved zoom path when `restoreLoads`.
260
+ */
261
+ setViewState(state: Partial<SunburstViewState>): void;
262
+ clearPendingViewState(): void;
263
+ select(node: TreeNode): void;
264
+ deselect(node: TreeNode): void;
265
+ clearSelection(): void;
266
+ selectAll(): void;
267
+ deselectAll(): void;
268
+ selectMany(nodes: Iterable<TreeNode>): void;
269
+ /**
270
+ * Zoom so `node` becomes the centre, its children the first ring. Fires
271
+ * `zoom` and `expand` (or `collapse` when `node` is an ancestor of the
272
+ * current centre). Pure view-state — `root` is never mutated.
273
+ */
274
+ zoomTo(node: TreeNode): void;
275
+ /** Zoom out one level: the centre's parent becomes the centre. */
276
+ zoomUp(): void;
277
+ /** Zoom all the way out to the full tree. */
278
+ zoomOut(): void;
279
+ /** Zoom to reveal the node at `keys` (path from the root's children), then select it. */
280
+ navigateTo(keys: readonly string[]): boolean;
281
+ /** Zoom + select the first node (depth-first) matching `predicate`. */
282
+ navigateToNode(predicate: (node: TreeNode) => boolean): boolean;
283
+ /** Zoom to reveal the first node with `key` and move the cursor to it, without selecting. */
284
+ revealKey(key: string): boolean;
285
+ /** Arcs currently drawn (centre excluded), ring-major, depth from the root's children. */
286
+ getNodes(): ReadonlyArray<{
287
+ node: TreeNode;
288
+ depth: number;
289
+ }>;
290
+ protected render(): import("lit").TemplateResult<1>;
291
+ static styles: import("lit").CSSResult[];
292
+ }
293
+ declare global {
294
+ interface HTMLElementTagNameMap {
295
+ 'ixfx-sunbursttree-list': SunburstTreeListElement;
296
+ }
297
+ }
298
+ interface SunburstTreeListElement {
299
+ addEventListener: (<K extends keyof SunburstTreeListElementEventMap>(type: K, listener: (this: SunburstTreeListElement, event: SunburstTreeListElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);
300
+ removeEventListener: (<K extends keyof SunburstTreeListElementEventMap>(type: K, listener: (this: SunburstTreeListElement, event: SunburstTreeListElementEventMap[K]) => void, options?: boolean | EventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void);
301
+ }
302
+ //#endregion
303
+ export { SunburstViewState as a, SunburstArcVisual as c, SunburstLayout as d, SunburstLayoutNode as f, SunburstView as g, SunburstValueFormatter as h, SunburstZoomEvent as i, SunburstInteractionMode as l, SunburstValueAccessor as m, SunburstTreeListElementEventMap as n, ComputeSunburstLayoutOptions as o, SunburstRings as p, SunburstZoomDetail as r, SUNBURST_PATH_SEPARATOR as s, SunburstTreeListElement as t, SunburstLabelPlacement as u };
@@ -1,4 +1,4 @@
1
- import "./icon-DR_3rSyZ.js";
1
+ import "./icon-CDGprSdE.js";
2
2
  import { LitElement, PropertyValues } from "lit";
3
3
  import { CommandRegistry } from "@clinth/ui-commands";
4
4
  //#region src/tabs/tab-list-item.d.ts
package/dist/tabs.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as TabListReorderDetail, i as TabListElement, n as TabListChangeEvent, o as TabListReorderEvent, r as TabListDragMode, t as TabListChangeDetail } from "./tab-list-wC0xNz1b.js";
1
+ import { a as TabListReorderDetail, i as TabListElement, n as TabListChangeEvent, o as TabListReorderEvent, r as TabListDragMode, t as TabListChangeDetail } from "./tab-list-Df371rqw.js";
2
2
  export { TabListChangeDetail, TabListChangeEvent, TabListDragMode, TabListElement, TabListReorderDetail, TabListReorderEvent };
@@ -1,4 +1,4 @@
1
- import "./icon-DR_3rSyZ.js";
1
+ import "./icon-CDGprSdE.js";
2
2
  import { LitElement } from "lit";
3
3
  //#region src/titlebar/titlebar.d.ts
4
4
  type TitlebarOrientation = `horizontal` | `vertical`;
@@ -1,2 +1,2 @@
1
- import { a as TitlebarToggleDetail, c as TitlebarVariant, i as TitlebarOrientation, n as TitlebarElement, o as TitlebarToggleEvent, r as TitlebarElementEventMap, s as TitlebarToggleInteraction, t as TitlebarCloseEvent } from "./titlebar-B5zSTZnF.js";
1
+ import { a as TitlebarToggleDetail, c as TitlebarVariant, i as TitlebarOrientation, n as TitlebarElement, o as TitlebarToggleEvent, r as TitlebarElementEventMap, s as TitlebarToggleInteraction, t as TitlebarCloseEvent } from "./titlebar-Tqu-VvMU.js";
2
2
  export { TitlebarCloseEvent, TitlebarElement, TitlebarElementEventMap, TitlebarOrientation, TitlebarToggleDetail, TitlebarToggleEvent, TitlebarToggleInteraction, TitlebarVariant };
@@ -0,0 +1,146 @@
1
+ import { a as capKeys, i as capFlags, n as EMPTY_KEYS } from "./pending-BGidHppL.js";
2
+ //#region src/common/view-state/tree.ts
3
+ /**
4
+ * - live expanded keys that are no longer loaded → pending `true`
5
+ * - pending keys that are now loaded → applied (`true` opens, `false` closes)
6
+ * - pending-open keys whose node can't open yet (`canOpen` false: children
7
+ * unloaded) stay pending and are listed in `needsLoad`
8
+ */
9
+ function reconcileExpansion(live, pending, has, canOpen) {
10
+ let nextLive;
11
+ let nextPending;
12
+ const needsLoad = [];
13
+ for (const key of live) {
14
+ if (has(key)) continue;
15
+ nextLive ??= new Set(live);
16
+ nextLive.delete(key);
17
+ nextPending ??= new Map(pending);
18
+ nextPending.set(key, true);
19
+ }
20
+ for (const [key, open] of pending) {
21
+ if (!has(key)) continue;
22
+ if (open && !canOpen(key)) {
23
+ needsLoad.push(key);
24
+ continue;
25
+ }
26
+ nextPending ??= new Map(pending);
27
+ nextPending.delete(key);
28
+ if (open !== (nextLive ?? live).has(key)) {
29
+ nextLive ??= new Set(live);
30
+ if (open) nextLive.add(key);
31
+ else nextLive.delete(key);
32
+ }
33
+ }
34
+ return {
35
+ live: nextLive ?? live,
36
+ pending: nextPending ? capFlags(nextPending) : pending,
37
+ needsLoad,
38
+ changed: nextLive !== void 0 || nextPending !== void 0
39
+ };
40
+ }
41
+ /**
42
+ * Re-key the node selection onto the current tree: selected nodes are swapped
43
+ * for the loaded node with the same key, or go pending when the key is gone;
44
+ * pending keys that resolve (and pass `canSelect`) are selected. With
45
+ * `single`, at most one node stays selected (a restored key wins).
46
+ */
47
+ function reconcileSelection(selected, pending, nodeByKey, canSelect, single) {
48
+ if (selected.size === 0 && pending.size === 0) return {
49
+ selected,
50
+ pending,
51
+ restored: false,
52
+ changed: false
53
+ };
54
+ const next = /* @__PURE__ */ new Set();
55
+ const nextPending = /* @__PURE__ */ new Set();
56
+ let changed = false;
57
+ for (const node of selected) {
58
+ const current = nodeByKey(node.item.key);
59
+ if (current) {
60
+ next.add(current);
61
+ if (current !== node) changed = true;
62
+ } else {
63
+ nextPending.add(node.item.key);
64
+ changed = true;
65
+ }
66
+ }
67
+ let restored;
68
+ for (const key of pending) {
69
+ const node = nodeByKey(key);
70
+ if (node && canSelect(node)) {
71
+ next.add(node);
72
+ restored = node;
73
+ changed = true;
74
+ } else nextPending.add(key);
75
+ }
76
+ if (!changed) return {
77
+ selected,
78
+ pending,
79
+ restored: false,
80
+ changed: false
81
+ };
82
+ let finalSelected = next;
83
+ let finalPending = nextPending;
84
+ if (single && next.size > 0) {
85
+ finalSelected = /* @__PURE__ */ new Set([restored ?? [...next].at(-1)]);
86
+ finalPending = EMPTY_KEYS;
87
+ }
88
+ return {
89
+ selected: finalSelected,
90
+ pending: capKeys(finalPending),
91
+ restored: restored !== void 0,
92
+ changed: true
93
+ };
94
+ }
95
+ /**
96
+ * Keyboard cursor: a cursor key that left the data goes pending (`clear`);
97
+ * a pending key that is now visible is applied (`apply`).
98
+ */
99
+ function reconcileCursor(cursor, pending, has, isVisible) {
100
+ let nextPending = pending;
101
+ let clear = false;
102
+ if (cursor !== void 0 && !has(cursor)) {
103
+ nextPending ??= cursor;
104
+ clear = true;
105
+ }
106
+ if (nextPending !== void 0 && isVisible(nextPending)) return {
107
+ clear,
108
+ apply: nextPending,
109
+ pending: void 0
110
+ };
111
+ return {
112
+ clear,
113
+ apply: void 0,
114
+ pending: nextPending
115
+ };
116
+ }
117
+ /** Sanitise a JSON zoom / centre path: strings only, `undefined` when not an array. */
118
+ function pathFromJson(value) {
119
+ return Array.isArray(value) ? value.filter((k) => typeof k === `string`) : void 0;
120
+ }
121
+ /**
122
+ * Follow `keys` from the children of `root`. When the walk reaches a node
123
+ * whose children aren't loaded, reports it as `load` if `canLoad` allows.
124
+ */
125
+ function resolveKeyPath(root, keys, canLoad) {
126
+ if (!root) return { status: `missing` };
127
+ const nodes = [];
128
+ let current = root;
129
+ for (const key of keys) {
130
+ if (current.children === void 0) return canLoad(current) ? {
131
+ status: `load`,
132
+ node: current,
133
+ depth: nodes.length - 1
134
+ } : { status: `missing` };
135
+ const next = current.children.find((c) => c.item.key === key);
136
+ if (!next) return { status: `missing` };
137
+ nodes.push(next);
138
+ current = next;
139
+ }
140
+ return {
141
+ status: `found`,
142
+ nodes
143
+ };
144
+ }
145
+ //#endregion
146
+ export { resolveKeyPath as a, reconcileSelection as i, reconcileCursor as n, reconcileExpansion as r, pathFromJson as t };