three-cad-viewer 1.7.1 → 1.7.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.
@@ -54956,7 +54956,7 @@ class TreeView {
54956
54956
  var lbl = tag("span", ["tcv_tree_label"]);
54957
54957
  lbl.innerHTML = model.name;
54958
54958
  lbl.id = model.id;
54959
-
54959
+
54960
54960
  lbl.addEventListener("mousedown", (e) => {
54961
54961
  e.preventDefault();
54962
54962
  e.stopPropagation();
@@ -55109,8 +55109,13 @@ class TreeView {
55109
55109
  // eslint-disable-next-line no-unused-vars
55110
55110
  var observer = new MutationObserver((_mutuations) => {
55111
55111
  if (this.container.contains(tree)) {
55112
- if (collapse > 0 && collapse < 3) {
55113
- this.collapseNodes(collapse);
55112
+ // keep a group with one element expanded
55113
+ if ((this.tree.children.length === 1) && (this.tree.children[0].type === "leaf")) {
55114
+ this.expandNodes();
55115
+ } else {
55116
+ if (collapse > 0 && collapse < 3) {
55117
+ this.collapseNodes(collapse);
55118
+ }
55114
55119
  }
55115
55120
  observer.disconnect();
55116
55121
  }
@@ -57695,7 +57700,7 @@ class Camera {
57695
57700
  }
57696
57701
  }
57697
57702
 
57698
- const version="1.7.1";
57703
+ const version="1.7.2";
57699
57704
 
57700
57705
  class Viewer {
57701
57706
  /**
@@ -58467,8 +58472,8 @@ class Viewer {
58467
58472
 
58468
58473
  const theme =
58469
58474
  this.theme === "dark" ||
58470
- (this.theme === "browser" &&
58471
- window.matchMedia("(prefers-color-scheme: dark)").matches)
58475
+ (this.theme === "browser" &&
58476
+ window.matchMedia("(prefers-color-scheme: dark)").matches)
58472
58477
  ? "dark"
58473
58478
  : "light";
58474
58479
 
@@ -58501,6 +58506,9 @@ class Viewer {
58501
58506
  );
58502
58507
 
58503
58508
  this.display.autoCollapse();
58509
+ if (this.treeview.tree.children.length === 1) {
58510
+ this.treeview.expandNodes();
58511
+ }
58504
58512
 
58505
58513
  //
58506
58514
  // show the rendering