wunderbaum 0.10.0 → 0.10.1

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.
@@ -294,7 +294,7 @@
294
294
  /*!
295
295
  * Wunderbaum - util
296
296
  * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
297
- * v0.10.0, Mon, 24 Jun 2024 19:17:59 GMT (https://github.com/mar10/wunderbaum)
297
+ * v0.10.1, Sat, 20 Jul 2024 13:53:46 GMT (https://github.com/mar10/wunderbaum)
298
298
  */
299
299
  /** @module util */
300
300
  /** Readable names for `MouseEvent.button` */
@@ -770,7 +770,7 @@
770
770
  function isArray(obj) {
771
771
  return Array.isArray(obj);
772
772
  }
773
- /** Return true if `obj` is of type `Object` and has no propertied. */
773
+ /** Return true if `obj` is of type `Object` and has no properties. */
774
774
  function isEmptyObject(obj) {
775
775
  return Object.keys(obj).length === 0 && obj.constructor === Object;
776
776
  }
@@ -949,7 +949,9 @@
949
949
  *
950
950
  * Example:
951
951
  * ```js
952
- * const width = util.toPixel("123px", 100);
952
+ * let x = undefined;
953
+ * let y = "123px";
954
+ * const width = util.toPixel(x, y, 100); // returns 123
953
955
  * ```
954
956
  */
955
957
  function toPixel(
@@ -969,11 +971,11 @@
969
971
  }
970
972
  throw new Error(`Expected a string like '123px': ${defaults}`);
971
973
  }
972
- /** Evaluate a boolean value using default if undefined.
974
+ /** Return the the boolean value of the first non-null element.
973
975
  * Example:
974
976
  * ```js
975
977
  * const opts = { flag: true };
976
- * const value = util.toBool(opts.flag, otherVar, false);
978
+ * const value = util.toBool(opts.foo, opts.flag, false); // returns true
977
979
  * ```
978
980
  */
979
981
  function toBool(
@@ -1140,7 +1142,7 @@
1140
1142
  /*!
1141
1143
  * Wunderbaum - types
1142
1144
  * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1143
- * v0.10.0, Mon, 24 Jun 2024 19:17:59 GMT (https://github.com/mar10/wunderbaum)
1145
+ * v0.10.1, Sat, 20 Jul 2024 13:53:46 GMT (https://github.com/mar10/wunderbaum)
1144
1146
  */
1145
1147
  /**
1146
1148
  * Possible values for {@link WunderbaumNode.update()} and {@link Wunderbaum.update()}.
@@ -1204,7 +1206,7 @@
1204
1206
  /*!
1205
1207
  * Wunderbaum - wb_extension_base
1206
1208
  * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1207
- * v0.10.0, Mon, 24 Jun 2024 19:17:59 GMT (https://github.com/mar10/wunderbaum)
1209
+ * v0.10.1, Sat, 20 Jul 2024 13:53:46 GMT (https://github.com/mar10/wunderbaum)
1208
1210
  */
1209
1211
  class WunderbaumExtension {
1210
1212
  constructor(tree, id, defaults) {
@@ -1263,7 +1265,7 @@
1263
1265
  /*!
1264
1266
  * Wunderbaum - ext-filter
1265
1267
  * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1266
- * v0.10.0, Mon, 24 Jun 2024 19:17:59 GMT (https://github.com/mar10/wunderbaum)
1268
+ * v0.10.1, Sat, 20 Jul 2024 13:53:46 GMT (https://github.com/mar10/wunderbaum)
1267
1269
  */
1268
1270
  const START_MARKER = "\uFFF7";
1269
1271
  const END_MARKER = "\uFFF8";
@@ -1290,6 +1292,7 @@
1290
1292
  const connectInput = this.getPluginOption("connectInput");
1291
1293
  if (connectInput) {
1292
1294
  this.queryInput = elemFromSelector(connectInput);
1295
+ assert(this.queryInput, `Invalid 'filter.connectInput' option: ${connectInput}.`);
1293
1296
  onEvent(this.queryInput, "input", debounce((e) => {
1294
1297
  // this.tree.log("query", e);
1295
1298
  this.filterNodes(this.queryInput.value.trim(), {});
@@ -1587,7 +1590,7 @@
1587
1590
  /*!
1588
1591
  * Wunderbaum - ext-keynav
1589
1592
  * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1590
- * v0.10.0, Mon, 24 Jun 2024 19:17:59 GMT (https://github.com/mar10/wunderbaum)
1593
+ * v0.10.1, Sat, 20 Jul 2024 13:53:46 GMT (https://github.com/mar10/wunderbaum)
1591
1594
  */
1592
1595
  const QUICKSEARCH_DELAY = 500;
1593
1596
  class KeynavExtension extends WunderbaumExtension {
@@ -1951,7 +1954,7 @@
1951
1954
  /*!
1952
1955
  * Wunderbaum - ext-logger
1953
1956
  * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1954
- * v0.10.0, Mon, 24 Jun 2024 19:17:59 GMT (https://github.com/mar10/wunderbaum)
1957
+ * v0.10.1, Sat, 20 Jul 2024 13:53:46 GMT (https://github.com/mar10/wunderbaum)
1955
1958
  */
1956
1959
  class LoggerExtension extends WunderbaumExtension {
1957
1960
  constructor(tree) {
@@ -1993,7 +1996,7 @@
1993
1996
  /*!
1994
1997
  * Wunderbaum - common
1995
1998
  * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1996
- * v0.10.0, Mon, 24 Jun 2024 19:17:59 GMT (https://github.com/mar10/wunderbaum)
1999
+ * v0.10.1, Sat, 20 Jul 2024 13:53:46 GMT (https://github.com/mar10/wunderbaum)
1997
2000
  */
1998
2001
  const DEFAULT_DEBUGLEVEL = 3; // Replaced by rollup script
1999
2002
  /**
@@ -2318,7 +2321,7 @@
2318
2321
  /*!
2319
2322
  * Wunderbaum - ext-dnd
2320
2323
  * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2321
- * v0.10.0, Mon, 24 Jun 2024 19:17:59 GMT (https://github.com/mar10/wunderbaum)
2324
+ * v0.10.1, Sat, 20 Jul 2024 13:53:46 GMT (https://github.com/mar10/wunderbaum)
2322
2325
  */
2323
2326
  const nodeMimeType = "application/x-wunderbaum-node";
2324
2327
  class DndExtension extends WunderbaumExtension {
@@ -2763,7 +2766,7 @@
2763
2766
  /*!
2764
2767
  * Wunderbaum - drag_observer
2765
2768
  * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2766
- * v0.10.0, Mon, 24 Jun 2024 19:17:59 GMT (https://github.com/mar10/wunderbaum)
2769
+ * v0.10.1, Sat, 20 Jul 2024 13:53:46 GMT (https://github.com/mar10/wunderbaum)
2767
2770
  */
2768
2771
  /**
2769
2772
  * Convert mouse- and touch events to 'dragstart', 'drag', and 'dragstop'.
@@ -2912,7 +2915,7 @@
2912
2915
  /*!
2913
2916
  * Wunderbaum - ext-grid
2914
2917
  * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2915
- * v0.10.0, Mon, 24 Jun 2024 19:17:59 GMT (https://github.com/mar10/wunderbaum)
2918
+ * v0.10.1, Sat, 20 Jul 2024 13:53:46 GMT (https://github.com/mar10/wunderbaum)
2916
2919
  */
2917
2920
  class GridExtension extends WunderbaumExtension {
2918
2921
  constructor(tree) {
@@ -3003,7 +3006,7 @@
3003
3006
  /*!
3004
3007
  * Wunderbaum - deferred
3005
3008
  * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
3006
- * v0.10.0, Mon, 24 Jun 2024 19:17:59 GMT (https://github.com/mar10/wunderbaum)
3009
+ * v0.10.1, Sat, 20 Jul 2024 13:53:46 GMT (https://github.com/mar10/wunderbaum)
3007
3010
  */
3008
3011
  /**
3009
3012
  * Implement a ES6 Promise, that exposes a resolve() and reject() method.
@@ -3056,7 +3059,7 @@
3056
3059
  /*!
3057
3060
  * Wunderbaum - wunderbaum_node
3058
3061
  * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
3059
- * v0.10.0, Mon, 24 Jun 2024 19:17:59 GMT (https://github.com/mar10/wunderbaum)
3062
+ * v0.10.1, Sat, 20 Jul 2024 13:53:46 GMT (https://github.com/mar10/wunderbaum)
3060
3063
  */
3061
3064
  /** WunderbaumNode properties that can be passed with source data.
3062
3065
  * (Any other source properties will be stored as `node.data.PROP`.)
@@ -5465,7 +5468,7 @@
5465
5468
  /*!
5466
5469
  * Wunderbaum - ext-edit
5467
5470
  * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
5468
- * v0.10.0, Mon, 24 Jun 2024 19:17:59 GMT (https://github.com/mar10/wunderbaum)
5471
+ * v0.10.1, Sat, 20 Jul 2024 13:53:46 GMT (https://github.com/mar10/wunderbaum)
5469
5472
  */
5470
5473
  // const START_MARKER = "\uFFF7";
5471
5474
  class EditExtension extends WunderbaumExtension {
@@ -5796,8 +5799,8 @@
5796
5799
  * https://github.com/mar10/wunderbaum
5797
5800
  *
5798
5801
  * Released under the MIT license.
5799
- * @version v0.10.0
5800
- * @date Mon, 24 Jun 2024 19:17:59 GMT
5802
+ * @version v0.10.1
5803
+ * @date Sat, 20 Jul 2024 13:53:46 GMT
5801
5804
  */
5802
5805
  // import "./wunderbaum.scss";
5803
5806
  class WbSystemRoot extends WunderbaumNode {
@@ -7677,6 +7680,7 @@
7677
7680
  // console.profileEnd(`_updateViewportImmediately()`)
7678
7681
  }
7679
7682
  if (this.options.connectTopBreadcrumb) {
7683
+ assert(this.options.connectTopBreadcrumb.textContent != null, `Invalid 'connectTopBreadcrumb' option (input element expected).`);
7680
7684
  let path = (_a = this.getTopmostVpNode(true)) === null || _a === void 0 ? void 0 : _a.getPath(false, "title", " > ");
7681
7685
  path = path ? path + " >" : "";
7682
7686
  this.options.connectTopBreadcrumb.textContent = path;
@@ -8046,7 +8050,7 @@
8046
8050
  }
8047
8051
  Wunderbaum.sequence = 0;
8048
8052
  /** Wunderbaum release version number "MAJOR.MINOR.PATCH". */
8049
- Wunderbaum.version = "v0.10.0"; // Set to semver by 'grunt release'
8053
+ Wunderbaum.version = "v0.10.1"; // Set to semver by 'grunt release'
8050
8054
  /** Expose some useful methods of the util.ts module as `Wunderbaum.util`. */
8051
8055
  Wunderbaum.util = util;
8052
8056