@ixfx/components 0.13.5 → 0.13.7

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ixfx/components",
3
- "version": "0.13.5",
4
- "generated": "2026-10-04T12:58:50.843Z",
3
+ "version": "0.13.7",
4
+ "generated": "2026-10-05T21:23:39.070Z",
5
5
  "components": [
6
6
  {
7
7
  "name": "ac-text",
@@ -54,7 +54,11 @@ Inherited from theme:
54
54
  // Navigate to a node by key path (root-to-target keys, excluding root itself).
55
55
  // Only works with already-loaded children — returns false if any node along
56
56
  // the path has unloaded children or if a key is not found.
57
- navigateTo(keys: readonly string[]): boolean
57
+ navigateTo(keys: readonly string[], options?: { reveal?: 'edge' | 'center-if-hidden'; silent?: boolean }): boolean
58
+
59
+ // Re-sync after children arrays were patched in place (used by MillerTreeController.sync()):
60
+ // closes columns whose selected node was removed, then re-renders.
61
+ invalidateStructure(): void
58
62
 
59
63
  // Navigate to the first loaded node (breadth-first) matching a predicate.
60
64
  // Returns false if no match is found in the currently loaded tree.
@@ -398,11 +402,27 @@ type MillerTreeControllerOptions<T> = {
398
402
  // key and label are required. If isLeaf is omitted, it is inferred
399
403
  // from whether the TraversableTree node has any children.
400
404
  valueToItem: (value: T, node: TraversableTree<T>) => MillerItem;
405
+ // Installed as element.loadChildren by connect(). Defaults to a synchronous
406
+ // read from the source tree. sync() never touches it.
407
+ loadChildren?: LoadChildrenCallback;
401
408
  };
402
409
  ```
403
410
 
404
411
  ### Methods
405
412
 
413
+ ```typescript
414
+ // Re-derive children of already-loaded nodes from the source tree and patch them
415
+ // in place (arrays mutated, MillerNodes reused by key). viewRoot is reset only if
416
+ // its node was removed. Refreshes the element once.
417
+ sync(): void
418
+
419
+ // Lookups that avoid searching the source tree. Key paths are RELATIVE TO THE
420
+ // VIEW ROOT; identities outside a rebased view return false.
421
+ lookupByKey(key: string): TraversableTree<T> | undefined
422
+ navigateToKeyPath(keys: readonly string[], options?: TreeNavigateOptions): boolean
423
+ navigateToIdentity(identity: unknown, options?: TreeNavigateOptions): boolean
424
+ ```
425
+
406
426
  ```typescript
407
427
  // Wire up the controller — sets element.root and provides loadChildren callback.
408
428
  // Safe to call again after disconnect().
package/docs-user/tree.md CHANGED
@@ -46,6 +46,8 @@ type TreeNode = {
46
46
 
47
47
  `TreeNode` is **immutable** — structural changes always produce a new root. Never mutate a node in place; use `TreeDataModel` convenience methods or replace `root` directly.
48
48
 
49
+ **Incremental updates.** `TreeController.sync()` re-derives children of already-materialised nodes from the source tree and patches them in place (nodes are reused by key, so expansion and selection survive). `navigateToKeyPath(keys)`, `navigateToIdentity(id)` and `lookupByKey(key)` resolve targets without searching the source tree.
50
+
49
51
  **Escape hatch for in-place edits.** The component itself fills in `node.children` when lazy-loading, and `TreeController` does the same. If you must edit `node.children` or `node.item` (e.g. an icon) in place, call `el.invalidateStructure()` afterwards. It drops the cached whole-tree indexes (parent map, icon depths, filter matches, checkbox states) and re-renders. Visible rows are re-derived on every update, so ordinary expand / collapse never needs it.
50
52
 
51
53
  ---
@@ -248,7 +250,7 @@ they do without windowing and cover rows that are not rendered:
248
250
  is never missing.
249
251
  - **Incremental search**: `navigate`, `select` and `filter` modes search the whole tree.
250
252
  Match highlights are repainted as the window moves.
251
- - **`navigateTo` / `revealKey`**: expand ancestors and scroll to the row.
253
+ - **`navigateTo` / `revealKey`**: expand ancestors and scroll to the row. `navigateTo(keys, { reveal: 'center-if-hidden' })` centres the row only when it is off screen (arithmetic, no DOM measuring); `{ silent: true }` suppresses the `select` event. Otherwise `select` detail carries `origin: 'user' | 'programmatic'`.
252
254
  - **Drag and drop**: drop targets are computed from the layout, so auto-scroll while dragging works.
253
255
  - **Sticky headers**: found by arithmetic, with no per-row measuring.
254
256
 
@@ -817,7 +819,7 @@ interface TreeComponent extends EventTarget {
817
819
  select(node: TreeNode): void;
818
820
  deselect(node: TreeNode): void;
819
821
  clearSelection(): void;
820
- navigateTo(keys: readonly string[]): boolean;
822
+ navigateTo(keys: readonly string[], options?: { reveal?: 'edge' | 'center-if-hidden'; silent?: boolean }): boolean;
821
823
  navigateToNode(predicate: (node: TreeNode) => boolean): boolean;
822
824
  getNodes(): ReadonlyArray<{ node: TreeNode; depth: number }>;
823
825
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ixfx/components",
3
3
  "type": "module",
4
- "version": "0.13.5",
4
+ "version": "0.13.7",
5
5
  "packageManager": "pnpm@10.0.0",
6
6
  "description": "Web components for ixfx — Lit-based UI toolkit",
7
7
  "author": "Clint Heyer",