@painekillers/tree-builder-viewer 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/viewer.js +12 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@painekillers/tree-builder-viewer",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -9,4 +9,4 @@
9
9
  "dependencies": {
10
10
  "@painekillers/tree-builder-core": "^1.0.0"
11
11
  }
12
- }
12
+ }
package/viewer.js CHANGED
@@ -40,6 +40,7 @@ export default class Viewer {
40
40
  #enabled = false
41
41
 
42
42
  recurse = true
43
+ strategy = "First"
43
44
  /*
44
45
  Null: No recursion
45
46
  False: Creates fake nodes when encountering recursion
@@ -546,7 +547,8 @@ export default class Viewer {
546
547
  root.addEventListener("click", () => {
547
548
  this.#bridge.calculateLayout(
548
549
  result.entry.value.id,
549
- this.recurse
550
+ this.recurse,
551
+ this.strategy
550
552
  )
551
553
 
552
554
  this.#bridge.calculateDraw(
@@ -661,8 +663,13 @@ export default class Viewer {
661
663
  )
662
664
  }
663
665
 
664
- updateUi() {
665
- Object.values(this.#uiUpdates).forEach(callback => callback())
666
+ updateUi(updateTheme = false) {
667
+ this.#uiUpdates.updateSearchResults()
668
+
669
+ if (updateTheme) {
670
+ this.#uiUpdates.updateThemeButtons()
671
+ this.#uiUpdates.updateThemeMenu()
672
+ }
666
673
  }
667
674
 
668
675
  setRoot(root) {
@@ -676,7 +683,8 @@ export default class Viewer {
676
683
 
677
684
  this.#bridge.calculateLayout(
678
685
  root,
679
- this.recurse
686
+ this.recurse,
687
+ this.strategy
680
688
  )
681
689
  }
682
690