@keenmate/svelte-treeview 5.0.0-rc04 → 5.0.0-rc06
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/CHANGELOG.md +35 -0
- package/README.md +9 -4
- package/ai/INDEX.txt +8 -5
- package/ai/advanced-patterns.txt +501 -487
- package/ai/basic-setup.txt +339 -336
- package/ai/events-callbacks.txt +386 -382
- package/ai/import-patterns.txt +271 -271
- package/ai/styling-theming.txt +354 -354
- package/ai/tree-editing.txt +477 -477
- package/ai/typescript-types.txt +388 -388
- package/dist/components/Node.svelte +61 -5
- package/dist/components/Tree.svelte +80 -25
- package/dist/components/Tree.svelte.d.ts +32 -14
- package/dist/constants.generated.d.ts +1 -1
- package/dist/constants.generated.js +1 -1
- package/dist/core/TreeController.svelte.d.ts +88 -22
- package/dist/core/TreeController.svelte.js +454 -108
- package/dist/core/navigation.d.ts +16 -0
- package/dist/index.d.ts +1 -1
- package/dist/ltree/ltree-node.svelte.d.ts +2 -0
- package/dist/ltree/ltree-node.svelte.js +3 -1
- package/dist/ltree/types.d.ts +2 -0
- package/dist/styles/main.scss +97 -1
- package/dist/styles.css +75 -0
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [5.0.0-rc06] - 2026-03-31
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **`showCheckboxes` prop**: Renders a checkbox before each selectable node with custom styling and indeterminate support.
|
|
14
|
+
- **`checkboxMode` prop** (`'independent'` | `'cascade'`): Controls whether checking a parent cascades to all descendants. Indeterminate state shown when partial.
|
|
15
|
+
- **`beforeCheckboxToggleCallback` interceptor**: Cancel or override checkbox toggles.
|
|
16
|
+
- **Three-level selection model**: Separated into `focusedNode` (single node, click/arrows), `highlightedPaths` (multi-select, Ctrl/Shift+click), and `selectedPaths` (checkbox data state). Highlight and checkbox state are independent — build a highlight selection, then check/uncheck all highlighted nodes with one checkbox click.
|
|
17
|
+
- **`onHighlightChange` event**: Fires when highlighted paths change (Ctrl+click, Shift+click, etc.).
|
|
18
|
+
- **Bulk checkbox via highlight**: When multiple nodes are highlighted and a checkbox in the highlight is clicked, all highlighted nodes toggle together.
|
|
19
|
+
- **Shift+Arrow/Home/End keyboard highlight**: Shift+ArrowDown/Up extends highlight range by one sibling, Shift+Home/End extends to first/last visible node.
|
|
20
|
+
- **PageUp/PageDown navigation**: Jumps 10 visible nodes forward/back. Shift+PageUp/PageDown extends highlight by 10 nodes.
|
|
21
|
+
- **`ltree-selected-highlight` CSS class**: Explorer-style blue background highlight. Customizable via `--ltree-highlight-bg` and `--ltree-highlight-color`.
|
|
22
|
+
- **Interaction example page** (`/examples/interaction`): Interactive demos for click behavior, checkboxes, multi-select, and keyboard navigation. All settings persisted to localStorage.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- **Keyboard navigation not working after node click**: Clicking a node now auto-focuses the tree container, so arrow keys work immediately without having to click the container separately.
|
|
26
|
+
- **Svelte proxy equality warning on checkbox toggle**: `_setFocusedNode` now compares by path instead of object identity to avoid `state_proxy_equality_mismatch`.
|
|
27
|
+
|
|
28
|
+
### Breaking
|
|
29
|
+
- **`selectedNode` → `focusedNode`**: Renamed prop and bindable. The single focused node (last clicked / arrow-keyed to).
|
|
30
|
+
- **`selectedPaths` repurposed**: Now represents checkbox-only data state. For click/highlight multi-select, use `highlightedPaths`.
|
|
31
|
+
- **`highlightedPaths` (new)**: Replaces old `selectedPaths` for Ctrl+click / Shift+click UI highlight.
|
|
32
|
+
- **`selectedNodeClass` → `highlightedNodeClass`**: CSS class applied to highlighted nodes.
|
|
33
|
+
- **`focusedNodeClass` (new)**: CSS class applied to the single focused node.
|
|
34
|
+
- **`onSelectionChange` repurposed**: Now fires on checkbox selection changes only. Use `onHighlightChange` for highlight changes.
|
|
35
|
+
- **`selectNode()` / `selectNodes()` deprecated**: Use `highlightNode()` / `highlightNodes()` instead.
|
|
36
|
+
|
|
37
|
+
## [5.0.0-rc05] - 2026-03-26
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
- **`clickBehavior` prop** (`'select'` | `'expand'` | `'expand-and-focus'`, default `'expand-and-focus'`): Controls what happens on node click. Replaces the boolean `shouldToggleOnNodeClick` prop. Matches canvas package's `ClickBehavior` type.
|
|
41
|
+
|
|
42
|
+
### Breaking
|
|
43
|
+
- **`shouldToggleOnNodeClick` removed**: Replace `shouldToggleOnNodeClick={true}` with `clickBehavior="expand-and-focus"` (default) and `shouldToggleOnNodeClick={false}` with `clickBehavior="select"`.
|
|
44
|
+
|
|
10
45
|
## [5.0.0-rc04] - 2026-03-12
|
|
11
46
|
|
|
12
47
|
### Added
|
package/README.md
CHANGED
|
@@ -6,9 +6,13 @@ A high-performance, feature-rich hierarchical tree view component for Svelte 5 w
|
|
|
6
6
|
|
|
7
7
|
Browse interactive code examples and the full API reference at **[svelte-treeview.keenmate.dev](https://svelte-treeview.keenmate.dev)**
|
|
8
8
|
|
|
9
|
-
## What's New in v5.0.0-
|
|
9
|
+
## What's New in v5.0.0-rc06
|
|
10
10
|
|
|
11
|
-
- **
|
|
11
|
+
- **Three-level selection**: `focusedNode` (click/arrows), `highlightedPaths` (Ctrl/Shift+click), `selectedPaths` (checkbox data state). Highlight and checkbox are independent — build a selection, then check/uncheck all at once.
|
|
12
|
+
- **`clickBehavior` prop**: `'select'` | `'expand'` | `'expand-and-focus'` (default). Replaces `shouldToggleOnNodeClick`.
|
|
13
|
+
- **`showCheckboxes` + `checkboxMode`**: Custom styled checkboxes with `'independent'` or `'cascade'` mode (parent toggles descendants, indeterminate state).
|
|
14
|
+
- **Shift+Arrow/Home/End/PageUp/PageDown**: Extends highlight range via keyboard, like file managers.
|
|
15
|
+
- **Pluggable keyboard navigation**: `TreeNavigation<T>` interface — each renderer provides its own spatial implementation. Override individual methods via `TreeNavigationOverrides<T>`.
|
|
12
16
|
- **Bulk subtree operations**: `insertBranch()`, `replaceBranch()`, `deleteBranch()` on TreeController — add, replace, or remove entire subtrees with a single emission.
|
|
13
17
|
- **Clipboard API**: `copyNodes()`, `cutNodes()`, `pasteNodes()`, `cancelCut()` on TreeController. Cut nodes are visually dimmed. Supports auto-handle and manual (server-driven) paste modes.
|
|
14
18
|
|
|
@@ -654,7 +658,8 @@ Without both requirements, no search indexing will occur.
|
|
|
654
658
|
| Prop | Type | Default | Description |
|
|
655
659
|
|------|------|---------|-------------|
|
|
656
660
|
| `expandLevel` | `number \| null` | `2` | Automatically expand nodes up to this level |
|
|
657
|
-
| `
|
|
661
|
+
| `clickBehavior` | `ClickBehavior` | `'expand-and-focus'` | Node click behavior: `'select'` (click selects, dblclick expands), `'expand'` (click expands only), `'expand-and-focus'` (click selects + expands) |
|
|
662
|
+
| `showCheckboxes` | `boolean` | `false` | Show selection checkboxes before each node. Clicking a checkbox toggles the node's selection (same as Ctrl+click). |
|
|
658
663
|
| `orderMember` | `string \| null` | `null` | Property name for sort order (enables before/after positioning in drag-drop) |
|
|
659
664
|
| `indexerBatchSize` | `number \| null` | `25` | Number of nodes to process per batch during search indexing |
|
|
660
665
|
| `indexerTimeout` | `number \| null` | `50` | Maximum time (ms) to wait for idle callback before forcing indexing |
|
|
@@ -867,7 +872,7 @@ All Tree props can be updated except snippets/templates, including:
|
|
|
867
872
|
- Callbacks: `sortCallback`, `getDisplayValueCallback`, `onNodeClicked`, etc.
|
|
868
873
|
- Visual: `bodyClass`, `selectedNodeClass`, `expandIconClass`, etc.
|
|
869
874
|
- Context menu: `contextMenuCallback`, `contextMenuXOffset`, `contextMenuYOffset`
|
|
870
|
-
- Behavior: `
|
|
875
|
+
- Behavior: `clickBehavior`, `shouldUseInternalSearchIndex`, etc.
|
|
871
876
|
|
|
872
877
|
### Debug Information
|
|
873
878
|
|
package/ai/INDEX.txt
CHANGED
|
@@ -195,12 +195,15 @@ Search → search-features.txt
|
|
|
195
195
|
searchNodes → search-features.txt
|
|
196
196
|
searchText → search-features.txt, basic-setup.txt
|
|
197
197
|
searchValueMember → search-features.txt, data-handling.txt
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
focusedNode → basic-setup.txt, events-callbacks.txt
|
|
199
|
+
highlightedNodeClass → styling-theming.txt
|
|
200
|
+
highlightedPaths → advanced-patterns.txt
|
|
201
|
+
highlightNode → advanced-patterns.txt
|
|
202
|
+
selectedPaths → advanced-patterns.txt (checkbox data state)
|
|
203
|
+
showCheckboxes → basic-setup.txt
|
|
204
|
+
checkboxMode → basic-setup.txt
|
|
202
205
|
shouldDisplayDebugInformation → basic-setup.txt, performance.txt
|
|
203
|
-
|
|
206
|
+
clickBehavior → basic-setup.txt, events-callbacks.txt
|
|
204
207
|
shouldUseInternalSearchIndex → search-features.txt
|
|
205
208
|
Snippets → basic-setup.txt, context-menu.txt
|
|
206
209
|
sortCallback → data-handling.txt, basic-setup.txt
|