wunderbaum 0.0.8 → 0.0.9

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
  * Wunderbaum - util
3
3
  * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
4
- * v0.0.8, Fri, 23 Sep 2022 20:47:29 GMT (https://github.com/mar10/wunderbaum)
4
+ * v0.0.9, Mon, 31 Oct 2022 17:06:10 GMT (https://github.com/mar10/wunderbaum)
5
5
  */
6
6
  /** @module util */
7
7
  /** Readable names for `MouseEvent.button` */
@@ -707,7 +707,7 @@ var util = /*#__PURE__*/Object.freeze({
707
707
  /*!
708
708
  * Wunderbaum - types
709
709
  * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
710
- * v0.0.8, Fri, 23 Sep 2022 20:47:29 GMT (https://github.com/mar10/wunderbaum)
710
+ * v0.0.9, Mon, 31 Oct 2022 17:06:10 GMT (https://github.com/mar10/wunderbaum)
711
711
  */
712
712
  /** Possible values for `setModified()`. */
713
713
  var ChangeType;
@@ -759,7 +759,7 @@ var NavigationOptions;
759
759
  /*!
760
760
  * Wunderbaum - wb_extension_base
761
761
  * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
762
- * v0.0.8, Fri, 23 Sep 2022 20:47:29 GMT (https://github.com/mar10/wunderbaum)
762
+ * v0.0.9, Mon, 31 Oct 2022 17:06:10 GMT (https://github.com/mar10/wunderbaum)
763
763
  */
764
764
  class WunderbaumExtension {
765
765
  constructor(tree, id, defaults) {
@@ -1050,7 +1050,7 @@ function debounce(func, wait = 0, options = {}) {
1050
1050
  /*!
1051
1051
  * Wunderbaum - ext-filter
1052
1052
  * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
1053
- * v0.0.8, Fri, 23 Sep 2022 20:47:29 GMT (https://github.com/mar10/wunderbaum)
1053
+ * v0.0.9, Mon, 31 Oct 2022 17:06:10 GMT (https://github.com/mar10/wunderbaum)
1054
1054
  */
1055
1055
  const START_MARKER = "\uFFF7";
1056
1056
  const END_MARKER = "\uFFF8";
@@ -1355,7 +1355,7 @@ function _markFuzzyMatchedChars(text, matches, escapeTitles = true) {
1355
1355
  /*!
1356
1356
  * Wunderbaum - ext-keynav
1357
1357
  * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
1358
- * v0.0.8, Fri, 23 Sep 2022 20:47:29 GMT (https://github.com/mar10/wunderbaum)
1358
+ * v0.0.9, Mon, 31 Oct 2022 17:06:10 GMT (https://github.com/mar10/wunderbaum)
1359
1359
  */
1360
1360
  const QUICKSEARCH_DELAY = 500;
1361
1361
  class KeynavExtension extends WunderbaumExtension {
@@ -1453,7 +1453,8 @@ class KeynavExtension extends WunderbaumExtension {
1453
1453
  if (!node.expanded && (node.children || node.lazy)) {
1454
1454
  eventName = "Add"; // expand
1455
1455
  }
1456
- else if (navModeOption === NavigationOptions.startRow) {
1456
+ else if (navModeOption === NavigationOptions.startCell ||
1457
+ navModeOption === NavigationOptions.startRow) {
1457
1458
  tree.setCellNav();
1458
1459
  return;
1459
1460
  }
@@ -1606,17 +1607,31 @@ class KeynavExtension extends WunderbaumExtension {
1606
1607
  }
1607
1608
  handled = true;
1608
1609
  break;
1610
+ case "Home": // Generated by FN + ArrowLeft on Mac
1611
+ case "Meta+ArrowLeft":
1612
+ tree.setFocus(); // Blur prev. input if any
1613
+ if (!isColspan && tree.activeColIdx > 0) {
1614
+ tree.setColumn(0);
1615
+ }
1616
+ handled = true;
1617
+ break;
1618
+ case "End": // Generated by FN + ArrowRight on Mac
1619
+ case "Meta+ArrowRight":
1620
+ tree.setFocus(); // Blur prev. input if any
1621
+ if (!isColspan && tree.activeColIdx < tree.columns.length - 1) {
1622
+ tree.setColumn(tree.columns.length - 1);
1623
+ }
1624
+ handled = true;
1625
+ break;
1609
1626
  case "ArrowDown":
1610
1627
  case "ArrowUp":
1611
1628
  case "Backspace":
1612
- case "End":
1613
- case "Home":
1614
- case "Control+End":
1615
- case "Control+Home":
1629
+ case "Control+End": // Generated by FN + Control + ArrowRight on Mac
1630
+ case "Control+Home": // Generated by FN + Control + Arrowleft on Mac
1616
1631
  case "Meta+ArrowDown":
1617
1632
  case "Meta+ArrowUp":
1618
- case "PageDown":
1619
- case "PageUp":
1633
+ case "PageDown": // Generated by FN + ArrowDown on Mac
1634
+ case "PageUp": // Generated by FN + ArrowUp on Mac
1620
1635
  node.navigate(eventName, { activate: activate, event: event });
1621
1636
  // if (isCellEditMode) {
1622
1637
  // this._getEmbeddedInputElem(null, true); // set focus to input
@@ -1637,7 +1652,7 @@ class KeynavExtension extends WunderbaumExtension {
1637
1652
  /*!
1638
1653
  * Wunderbaum - ext-logger
1639
1654
  * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
1640
- * v0.0.8, Fri, 23 Sep 2022 20:47:29 GMT (https://github.com/mar10/wunderbaum)
1655
+ * v0.0.9, Mon, 31 Oct 2022 17:06:10 GMT (https://github.com/mar10/wunderbaum)
1641
1656
  */
1642
1657
  class LoggerExtension extends WunderbaumExtension {
1643
1658
  constructor(tree) {
@@ -1677,7 +1692,7 @@ class LoggerExtension extends WunderbaumExtension {
1677
1692
  /*!
1678
1693
  * Wunderbaum - common
1679
1694
  * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
1680
- * v0.0.8, Fri, 23 Sep 2022 20:47:29 GMT (https://github.com/mar10/wunderbaum)
1695
+ * v0.0.9, Mon, 31 Oct 2022 17:06:10 GMT (https://github.com/mar10/wunderbaum)
1681
1696
  */
1682
1697
  const DEFAULT_DEBUGLEVEL = 4; // Replaced by rollup script
1683
1698
  /**
@@ -1917,7 +1932,7 @@ function inflateSourceData(source) {
1917
1932
  /*!
1918
1933
  * Wunderbaum - ext-dnd
1919
1934
  * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
1920
- * v0.0.8, Fri, 23 Sep 2022 20:47:29 GMT (https://github.com/mar10/wunderbaum)
1935
+ * v0.0.9, Mon, 31 Oct 2022 17:06:10 GMT (https://github.com/mar10/wunderbaum)
1921
1936
  */
1922
1937
  const nodeMimeType = "application/x-wunderbaum-node";
1923
1938
  class DndExtension extends WunderbaumExtension {
@@ -2061,6 +2076,11 @@ class DndExtension extends WunderbaumExtension {
2061
2076
  if (e.type === "dragstart") {
2062
2077
  // Set a default definition of allowed effects
2063
2078
  e.dataTransfer.effectAllowed = dndOpts.effectAllowed; //"copyMove"; // "all";
2079
+ if (srcNode.isEditing()) {
2080
+ srcNode.logDebug("Prevented dragging node in edit mode.");
2081
+ e.preventDefault();
2082
+ return false;
2083
+ }
2064
2084
  // Let user cancel the drag operation, override effectAllowed, etc.:
2065
2085
  const res = srcNode._callEvent("dnd.dragStart", { event: e });
2066
2086
  if (!res) {
@@ -2185,7 +2205,7 @@ class DndExtension extends WunderbaumExtension {
2185
2205
  /*!
2186
2206
  * Wunderbaum - drag_observer
2187
2207
  * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
2188
- * v0.0.8, Fri, 23 Sep 2022 20:47:29 GMT (https://github.com/mar10/wunderbaum)
2208
+ * v0.0.9, Mon, 31 Oct 2022 17:06:10 GMT (https://github.com/mar10/wunderbaum)
2189
2209
  */
2190
2210
  /**
2191
2211
  * Convert mouse- and touch events to 'dragstart', 'drag', and 'dragstop'.
@@ -2204,8 +2224,10 @@ class DragObserver {
2204
2224
  this.dragging = false;
2205
2225
  // TODO: touch events
2206
2226
  this.events = ["mousedown", "mouseup", "mousemove", "keydown"];
2207
- assert(opts.root);
2208
- this.opts = extend({ thresh: 5 }, opts);
2227
+ if (!opts.root) {
2228
+ throw new Error("Missing `root` option.");
2229
+ }
2230
+ this.opts = Object.assign({ thresh: 5 }, opts);
2209
2231
  this.root = opts.root;
2210
2232
  this._handler = this.handleEvent.bind(this);
2211
2233
  this.events.forEach((type) => {
@@ -2319,7 +2341,7 @@ class DragObserver {
2319
2341
  /*!
2320
2342
  * Wunderbaum - ext-grid
2321
2343
  * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
2322
- * v0.0.8, Fri, 23 Sep 2022 20:47:29 GMT (https://github.com/mar10/wunderbaum)
2344
+ * v0.0.9, Mon, 31 Oct 2022 17:06:10 GMT (https://github.com/mar10/wunderbaum)
2323
2345
  */
2324
2346
  class GridExtension extends WunderbaumExtension {
2325
2347
  constructor(tree) {
@@ -2356,7 +2378,7 @@ class GridExtension extends WunderbaumExtension {
2356
2378
  /*!
2357
2379
  * Wunderbaum - deferred
2358
2380
  * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
2359
- * v0.0.8, Fri, 23 Sep 2022 20:47:29 GMT (https://github.com/mar10/wunderbaum)
2381
+ * v0.0.9, Mon, 31 Oct 2022 17:06:10 GMT (https://github.com/mar10/wunderbaum)
2360
2382
  */
2361
2383
  /**
2362
2384
  * Implement a ES6 Promise, that exposes a resolve() and reject() method.
@@ -2409,7 +2431,7 @@ class Deferred {
2409
2431
  /*!
2410
2432
  * Wunderbaum - wunderbaum_node
2411
2433
  * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
2412
- * v0.0.8, Fri, 23 Sep 2022 20:47:29 GMT (https://github.com/mar10/wunderbaum)
2434
+ * v0.0.9, Mon, 31 Oct 2022 17:06:10 GMT (https://github.com/mar10/wunderbaum)
2413
2435
  */
2414
2436
  /** Top-level properties that can be passed with `data`. */
2415
2437
  const NODE_PROPS = new Set([
@@ -2520,6 +2542,35 @@ class WunderbaumNode {
2520
2542
  toString() {
2521
2543
  return `WunderbaumNode@${this.key}<'${this.title}'>`;
2522
2544
  }
2545
+ /**
2546
+ * Iterate all descendant nodes depth-first, pre-order using `for ... of ...` syntax.
2547
+ * More concise, but slightly slower than {@link WunderbaumNode.visit}.
2548
+ *
2549
+ * Example:
2550
+ * ```js
2551
+ * for(const n of node) {
2552
+ * ...
2553
+ * }
2554
+ * ```
2555
+ */
2556
+ *[Symbol.iterator]() {
2557
+ // let node: WunderbaumNode | null = this;
2558
+ const cl = this.children;
2559
+ if (cl) {
2560
+ for (let i = 0, l = cl.length; i < l; i++) {
2561
+ const n = cl[i];
2562
+ yield n;
2563
+ if (n.children) {
2564
+ yield* n;
2565
+ }
2566
+ }
2567
+ // Slower:
2568
+ // for (let node of this.children) {
2569
+ // yield node;
2570
+ // yield* node : 0;
2571
+ // }
2572
+ }
2573
+ }
2523
2574
  // /** Return an option value. */
2524
2575
  // protected _getOpt(
2525
2576
  // name: string,
@@ -2824,6 +2875,57 @@ class WunderbaumNode {
2824
2875
  findRelatedNode(where, includeHidden = false) {
2825
2876
  return this.tree.findRelatedNode(this, where, includeHidden);
2826
2877
  }
2878
+ /**
2879
+ * Iterator version of {@link WunderbaumNode.format}.
2880
+ */
2881
+ *format_iter(name_cb, connectors) {
2882
+ connectors !== null && connectors !== void 0 ? connectors : (connectors = [" ", " | ", " ╰─ ", " ├─ "]);
2883
+ name_cb !== null && name_cb !== void 0 ? name_cb : (name_cb = (node) => "" + node);
2884
+ function _is_last(node) {
2885
+ const ca = node.parent.children;
2886
+ return node === ca[ca.length - 1];
2887
+ }
2888
+ const _format_line = (node) => {
2889
+ // https://www.measurethat.net/Benchmarks/Show/12196/0/arr-unshift-vs-push-reverse-small-array
2890
+ const parts = [name_cb(node)];
2891
+ parts.unshift(connectors[_is_last(node) ? 2 : 3]);
2892
+ let p = node.parent;
2893
+ while (p && p !== this) {
2894
+ // `this` is the top node
2895
+ parts.unshift(connectors[_is_last(p) ? 0 : 1]);
2896
+ p = p.parent;
2897
+ }
2898
+ return parts.join("");
2899
+ };
2900
+ yield name_cb(this);
2901
+ for (let node of this) {
2902
+ yield _format_line(node);
2903
+ }
2904
+ }
2905
+ /**
2906
+ * Return multiline string representation of a node/subnode hierarchy.
2907
+ * Mostly useful for debugging.
2908
+ *
2909
+ * Example:
2910
+ * ```js
2911
+ * console.info(tree.getActiveNode().format((n)=>n.title));
2912
+ * ```
2913
+ * logs
2914
+ * ```
2915
+ * Books
2916
+ * ├─ Art of War
2917
+ * ╰─ Don Quixote
2918
+ * ...
2919
+ * ```
2920
+ * @see {@link WunderbaumNode.format_iter}
2921
+ */
2922
+ format(name_cb, connectors) {
2923
+ const a = [];
2924
+ for (let line of this.format_iter(name_cb, connectors)) {
2925
+ a.push(line);
2926
+ }
2927
+ return a.join("\n");
2928
+ }
2827
2929
  /** Return the `<span class='wb-col'>` element with a given index or id.
2828
2930
  * @returns {WunderbaumNode | null}
2829
2931
  */
@@ -3078,7 +3180,10 @@ class WunderbaumNode {
3078
3180
  const tree = this.tree;
3079
3181
  level !== null && level !== void 0 ? level : (level = this.getLevel());
3080
3182
  // Let caller modify the parsed JSON response:
3081
- this._callEvent("receive", { response: source });
3183
+ const res = this._callEvent("receive", { response: source });
3184
+ if (res != null) {
3185
+ source = res;
3186
+ }
3082
3187
  if (isArray(source)) {
3083
3188
  source = { children: source };
3084
3189
  }
@@ -3475,13 +3580,15 @@ class WunderbaumNode {
3475
3580
  renderColInfosById: renderColInfosById,
3476
3581
  };
3477
3582
  }
3478
- _createIcon(parentElem, replaceChild) {
3583
+ _createIcon(parentElem, replaceChild, showLoading) {
3479
3584
  let iconSpan;
3480
3585
  let icon = this.getOption("icon");
3481
3586
  if (this._errorInfo) {
3482
3587
  icon = iconMap.error;
3483
3588
  }
3484
- else if (this._isLoading) {
3589
+ else if (this._isLoading && showLoading) {
3590
+ // Status nodes, or nodes without expander (< minExpandLevel) should
3591
+ // display the 'loading' status with the i.wb-icon span
3485
3592
  icon = iconMap.loading;
3486
3593
  }
3487
3594
  if (icon === false) {
@@ -3576,7 +3683,9 @@ class WunderbaumNode {
3576
3683
  nodeElem.appendChild(expanderSpan);
3577
3684
  ofsTitlePx += ICON_WIDTH;
3578
3685
  }
3579
- iconSpan = this._createIcon(nodeElem);
3686
+ // Render the icon (show a 'loading' icon if we do not have an expander that
3687
+ // we would prefer).
3688
+ iconSpan = this._createIcon(nodeElem, null, !expanderSpan);
3580
3689
  if (iconSpan) {
3581
3690
  ofsTitlePx += ICON_WIDTH;
3582
3691
  }
@@ -3734,7 +3843,10 @@ class WunderbaumNode {
3734
3843
  rowDiv.classList.add(...typeInfo.classes);
3735
3844
  }
3736
3845
  if (expanderSpan) {
3737
- if (this.isExpandable(false)) {
3846
+ if (this._isLoading) {
3847
+ expanderSpan.className = "wb-expander " + iconMap.loading;
3848
+ }
3849
+ else if (this.isExpandable(false)) {
3738
3850
  if (this.expanded) {
3739
3851
  expanderSpan.className = "wb-expander " + iconMap.expanderExpanded;
3740
3852
  }
@@ -3742,9 +3854,6 @@ class WunderbaumNode {
3742
3854
  expanderSpan.className = "wb-expander " + iconMap.expanderCollapsed;
3743
3855
  }
3744
3856
  }
3745
- else if (this._isLoading) {
3746
- expanderSpan.className = "wb-expander " + iconMap.loading;
3747
- }
3748
3857
  else if (this.lazy && this.children == null) {
3749
3858
  expanderSpan.className = "wb-expander " + iconMap.expanderLazy;
3750
3859
  }
@@ -3769,7 +3878,7 @@ class WunderbaumNode {
3769
3878
  // Update icon (if not opts.isNew, which would rebuild markup anyway)
3770
3879
  const iconSpan = nodeElem.querySelector("i.wb-icon");
3771
3880
  if (iconSpan) {
3772
- this._createIcon(nodeElem, iconSpan);
3881
+ this._createIcon(nodeElem, iconSpan, !expanderSpan);
3773
3882
  }
3774
3883
  }
3775
3884
  }
@@ -3778,11 +3887,14 @@ class WunderbaumNode {
3778
3887
  *
3779
3888
  * `options.change` defaults to ChangeType.data, which updates the title,
3780
3889
  * icon, and status. It also triggers the `render` event, that lets the user
3781
- * create or update the content of embeded cell elements.<br>
3890
+ * create or update the content of embeded cell elements.
3782
3891
  *
3783
3892
  * If only the status or other class-only modifications have changed,
3784
3893
  * `options.change` should be set to ChangeType.status instead for best
3785
3894
  * efficiency.
3895
+ *
3896
+ * Calling `setModified` instead may be a better alternative.
3897
+ * @see {@link WunderbaumNode.setModified}
3786
3898
  */
3787
3899
  render(options) {
3788
3900
  // this.log("render", options);
@@ -4082,8 +4194,13 @@ class WunderbaumNode {
4082
4194
  this._errorInfo = null;
4083
4195
  break;
4084
4196
  case "loading":
4085
- // If this is the invisible root, add a visible top-level node
4086
- if (!this.parent) {
4197
+ this._isLoading = true;
4198
+ this._errorInfo = null;
4199
+ if (this.parent) {
4200
+ this.setModified(ChangeType.status);
4201
+ }
4202
+ else {
4203
+ // If this is the invisible root, add a visible top-level node
4087
4204
  _setStatusNode({
4088
4205
  statusNodeType: status,
4089
4206
  title: tree.options.strings.loading +
@@ -4093,8 +4210,6 @@ class WunderbaumNode {
4093
4210
  tooltip: details,
4094
4211
  });
4095
4212
  }
4096
- this._isLoading = true;
4097
- this._errorInfo = null;
4098
4213
  // this.render();
4099
4214
  break;
4100
4215
  case "error":
@@ -4157,7 +4272,7 @@ class WunderbaumNode {
4157
4272
  this.parent.triggerModifyChild(operation, this, extra);
4158
4273
  }
4159
4274
  /**
4160
- * Call fn(node) for all child nodes in hierarchical order (depth-first).
4275
+ * Call `callback(node)` for all child nodes in hierarchical order (depth-first, pre-order).
4161
4276
  *
4162
4277
  * Stop iteration, if fn() returns false. Skip current branch, if fn()
4163
4278
  * returns "skip".<br>
@@ -4166,6 +4281,7 @@ class WunderbaumNode {
4166
4281
  * @param {function} callback the callback function.
4167
4282
  * Return false to stop iteration, return "skip" to skip this node and
4168
4283
  * its children only.
4284
+ * @see {@link WunderbaumNode.*[Symbol.iterator]}, {@link Wunderbaum.visit}.
4169
4285
  */
4170
4286
  visit(callback, includeSelf = false) {
4171
4287
  let i, l, res = true, children = this.children;
@@ -4236,7 +4352,7 @@ WunderbaumNode.sequence = 0;
4236
4352
  /*!
4237
4353
  * Wunderbaum - ext-edit
4238
4354
  * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
4239
- * v0.0.8, Fri, 23 Sep 2022 20:47:29 GMT (https://github.com/mar10/wunderbaum)
4355
+ * v0.0.9, Mon, 31 Oct 2022 17:06:10 GMT (https://github.com/mar10/wunderbaum)
4240
4356
  */
4241
4357
  // const START_MARKER = "\uFFF7";
4242
4358
  class EditExtension extends WunderbaumExtension {
@@ -4529,8 +4645,8 @@ class EditExtension extends WunderbaumExtension {
4529
4645
  * https://github.com/mar10/wunderbaum
4530
4646
  *
4531
4647
  * Released under the MIT license.
4532
- * @version v0.0.8
4533
- * @date Fri, 23 Sep 2022 20:47:29 GMT
4648
+ * @version v0.0.9
4649
+ * @date Mon, 31 Oct 2022 17:06:10 GMT
4534
4650
  */
4535
4651
  class WbSystemRoot extends WunderbaumNode {
4536
4652
  constructor(tree) {
@@ -4917,6 +5033,20 @@ class Wunderbaum {
4917
5033
  }
4918
5034
  return null;
4919
5035
  }
5036
+ /**
5037
+ * Iterate all descendant nodes depth-first, pre-order using `for ... of ...` syntax.
5038
+ * More concise, but slightly slower than {@link Wunderbaum.visit}.
5039
+ *
5040
+ * Example:
5041
+ * ```js
5042
+ * for(const node of tree) {
5043
+ * ...
5044
+ * }
5045
+ * ```
5046
+ */
5047
+ *[Symbol.iterator]() {
5048
+ yield* this.root;
5049
+ }
4920
5050
  /** @internal */
4921
5051
  _registerExtension(extension) {
4922
5052
  this.extensionList.push(extension);
@@ -4931,8 +5061,8 @@ class Wunderbaum {
4931
5061
  }
4932
5062
  /** Add node to tree's bookkeeping data structures. */
4933
5063
  _registerNode(node) {
4934
- let key = node.key;
4935
- assert(key != null && !this.keyMap.has(key));
5064
+ const key = node.key;
5065
+ assert(key != null && !this.keyMap.has(key), `Missing or duplicate key: '${key}'.`);
4936
5066
  this.keyMap.set(key, node);
4937
5067
  let rk = node.refKey;
4938
5068
  if (rk) {
@@ -5510,6 +5640,35 @@ class Wunderbaum {
5510
5640
  }
5511
5641
  return res;
5512
5642
  }
5643
+ /**
5644
+ * Iterator version of {@link Wunderbaum.format}.
5645
+ */
5646
+ *format_iter(name_cb, connectors) {
5647
+ return this.root.format_iter(name_cb, connectors);
5648
+ }
5649
+ /**
5650
+ * Return multiline string representation of the node hierarchy.
5651
+ * Mostly useful for debugging.
5652
+ *
5653
+ * Example:
5654
+ * ```js
5655
+ * console.info(tree.format((n)=>n.title));
5656
+ * ```
5657
+ * logs
5658
+ * ```
5659
+ * Playground
5660
+ * ├─ Books
5661
+ * | ├─ Art of War
5662
+ * | ╰─ Don Quixote
5663
+ * ├─ Music
5664
+ * ...
5665
+ * ```
5666
+ *
5667
+ * @see {@link Wunderbaum.format_iter} and {@link WunderbaumNode.format}.
5668
+ */
5669
+ format(name_cb, connectors) {
5670
+ return this.root.format(name_cb, connectors);
5671
+ }
5513
5672
  /**
5514
5673
  * Return the active cell (`span.wb-col`) of the currently active node or null.
5515
5674
  */
@@ -6236,7 +6395,8 @@ class Wunderbaum {
6236
6395
  return modified;
6237
6396
  }
6238
6397
  /**
6239
- * Call callback(node) for all nodes in hierarchical order (depth-first).
6398
+ * Call `callback(node)` for all nodes in hierarchical order (depth-first, pre-order).
6399
+ * @see {@link Wunderbaum.*[Symbol.iterator]}, {@link WunderbaumNode.visit}.
6240
6400
  *
6241
6401
  * @param {function} callback the callback function.
6242
6402
  * Return false to stop iteration, return "skip" to skip this node and
@@ -6459,7 +6619,7 @@ class Wunderbaum {
6459
6619
  }
6460
6620
  Wunderbaum.sequence = 0;
6461
6621
  /** Wunderbaum release version number "MAJOR.MINOR.PATCH". */
6462
- Wunderbaum.version = "v0.0.8"; // Set to semver by 'grunt release'
6622
+ Wunderbaum.version = "v0.0.9"; // Set to semver by 'grunt release'
6463
6623
  /** Expose some useful methods of the util.ts module as `Wunderbaum.util`. */
6464
6624
  Wunderbaum.util = util;
6465
6625