@bimetal/tree-svelte-components 1.0.0-rc.2 → 1.0.0-rc.3

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/dist/Tree.svelte CHANGED
@@ -25,6 +25,7 @@
25
25
  title = undefined,
26
26
  tag = undefined,
27
27
  ariaLabel = undefined,
28
+ showUndoRedo = true,
28
29
  onError = undefined,
29
30
  onSelectionChange = undefined,
30
31
  onCheckedChange = undefined,
@@ -52,6 +53,9 @@
52
53
  tag?: string;
53
54
  /** Accessible name for the `role="tree"` list. Falls back to `title`, else the locale label. */
54
55
  ariaLabel?: string;
56
+ /** Show the undo/redo button pair in the toolbar (default true). UI-only — the
57
+ * controller's undo()/redo() + keyboard shortcuts stay active when hidden. */
58
+ showUndoRedo?: boolean;
55
59
  /** Surfaces infrastructure errors (a domain rejection becomes an undo toast). */
56
60
  onError?: (err: unknown) => void;
57
61
  /** OBSERVE hook (standalone only): fires when the selection changes (ordered selected node ids). */
@@ -143,8 +147,10 @@
143
147
  <button class="bm-tree__btn" type="button" disabled={snap.focusId === null} onclick={(e) => snap.focusId && ctrl.openEdit(snap.focusId, rect(e))}>{snap.config.locale.rename}</button>
144
148
  <button class="bm-tree__btn" type="button" disabled={snap.focusId === null} onclick={() => ctrl.voidDeleteSelection()}>{snap.config.locale.delete}</button>
145
149
  <button class="bm-tree__btn" type="button" disabled={snap.focusId === null} onclick={() => snap.focusId && ctrl.voidDuplicate(snap.focusId)}>{snap.config.locale.duplicate}</button>
146
- <button class="bm-tree__btn" type="button" onclick={() => ctrl.voidUndo()}>↶ {snap.config.locale.undo}</button>
147
- <button class="bm-tree__btn" type="button" onclick={() => ctrl.voidRedo()}>↷ {snap.config.locale.redo}</button>
150
+ {#if showUndoRedo}
151
+ <button class="bm-tree__btn bm-tree__btn--undo" type="button" aria-label={snap.config.locale.undo} title={snap.config.locale.undo} disabled={!snap.canUndo} onclick={() => ctrl.voidUndo()}>↶</button>
152
+ <button class="bm-tree__btn bm-tree__btn--redo" type="button" aria-label={snap.config.locale.redo} title={snap.config.locale.redo} disabled={!snap.canRedo} onclick={() => ctrl.voidRedo()}>↷</button>
153
+ {/if}
148
154
  <button class="bm-tree__btn" type="button" onclick={() => ctrl.expandAll()}>{snap.config.locale.expandAll}</button>
149
155
  <button class="bm-tree__btn" type="button" onclick={() => ctrl.collapseAll()}>{snap.config.locale.collapseAll}</button>
150
156
  <input class="bm-tree__search" type="search" placeholder={snap.config.locale.search} value={snap.filterQuery}
@@ -24,6 +24,9 @@ type $$ComponentProps = {
24
24
  tag?: string;
25
25
  /** Accessible name for the `role="tree"` list. Falls back to `title`, else the locale label. */
26
26
  ariaLabel?: string;
27
+ /** Show the undo/redo button pair in the toolbar (default true). UI-only — the
28
+ * controller's undo()/redo() + keyboard shortcuts stay active when hidden. */
29
+ showUndoRedo?: boolean;
27
30
  /** Surfaces infrastructure errors (a domain rejection becomes an undo toast). */
28
31
  onError?: (err: unknown) => void;
29
32
  /** OBSERVE hook (standalone only): fires when the selection changes (ordered selected node ids). */
@@ -1 +1 @@
1
- {"version":3,"file":"Tree.svelte.d.ts","sourceRoot":"","sources":["../src/Tree.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAA0B,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAOlH,KAAK,gBAAgB,GAAI;IACtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;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tD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yEAAyE;IACzE,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACpB,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;mFAC+E;IAC/E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iFAAiF;IACjF,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,oGAAoG;IACpG,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7D;8EAC0E;IAC1E,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1D,4DAA4D;IAC5D,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;CACrC,CAAC;AA8JJ,QAAA,MAAM,IAAI,sDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bimetal/tree-svelte-components",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.3",
4
4
  "description": "Default Svelte 5 tree / treeview — multi-select, expand/collapse, tri-state checkboxes, drag-reorder, rename, undo, theming. A thin binding over the canonical tree controller.",
5
5
  "type": "module",
6
6
  "svelte": "./dist/index.js",
@@ -27,11 +27,11 @@
27
27
  "prepublishOnly": "npm run build"
28
28
  },
29
29
  "dependencies": {
30
- "@bimetal/svelte": "^1.0.0-rc.2",
31
- "@bimetal/tree-data": "^1.0.0-rc.2",
32
- "@bimetal/tree-headless": "^1.0.0-rc.2",
33
- "@bimetal/tree-themes": "^1.0.0-rc.2",
34
- "@bimetal/a11y-dom": "^1.0.0-rc.2"
30
+ "@bimetal/svelte": "^1.0.0-rc.3",
31
+ "@bimetal/tree-data": "^1.0.0-rc.3",
32
+ "@bimetal/tree-headless": "^1.0.0-rc.3",
33
+ "@bimetal/tree-themes": "^1.0.0-rc.3",
34
+ "@bimetal/a11y-dom": "^1.0.0-rc.3"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "svelte": "^5.46.4"