sunrize 2.4.1 → 2.5.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.
Files changed (49) hide show
  1. package/package.json +7 -7
  2. package/src/Application/Application.js +22 -2
  3. package/src/Application/Dashboard.js +21 -19
  4. package/src/Application/DataStorage.js +10 -37
  5. package/src/Application/Document.js +149 -22
  6. package/src/Application/Footer.js +62 -16
  7. package/src/Application/Hierarchy.js +1 -1
  8. package/src/Application/Interface.js +1 -1
  9. package/src/Application/Sidebar.js +12 -9
  10. package/src/Application/Tabs.js +79 -11
  11. package/src/Controls/Splitter.js +146 -19
  12. package/src/Controls/Tabs.js +17 -12
  13. package/src/Editors/AnimationEditor.js +83 -59
  14. package/src/Editors/AnimationMemberList.js +37 -6
  15. package/src/Editors/BrowserFrame.js +17 -10
  16. package/src/Editors/Console.js +12 -14
  17. package/src/Editors/NodeList.js +35 -0
  18. package/src/Editors/OutlineEditor.js +24 -22
  19. package/src/Editors/OutlineView.js +85 -61
  20. package/src/Editors/Panel.js +6 -3
  21. package/src/Editors/RouteGraph.js +22 -65
  22. package/src/Editors/SceneProperties.js +9 -5
  23. package/src/Editors/ScriptEditor.js +37 -23
  24. package/src/Editors/VideoRecorder.js +145 -0
  25. package/src/Tools/Core/X3DBaseTool.js +12 -11
  26. package/src/Tools/Core/X3DImportedNodeInstanceTool.js +52 -0
  27. package/src/Tools/Core/X3DPrototypeInstanceTool.js +6 -6
  28. package/src/Tools.js +0 -3
  29. package/src/Undo/Editor.js +19 -16
  30. package/src/Undo/UndoManager.js +1 -1
  31. package/src/assets/fonts/Roboto/OFL.txt +93 -0
  32. package/src/assets/fonts/Roboto/README.txt +118 -0
  33. package/src/assets/fonts/Roboto/Roboto-Italic-VariableFont_wdth,wght.ttf +0 -0
  34. package/src/assets/fonts/Roboto/Roboto-VariableFont_wdth,wght.ttf +0 -0
  35. package/src/assets/fonts/Roboto_Mono/OFL.txt +93 -0
  36. package/src/assets/fonts/Roboto_Mono/README.txt +77 -0
  37. package/src/assets/fonts/Roboto_Mono/RobotoMono-Italic-VariableFont_wght.ttf +0 -0
  38. package/src/assets/fonts/Roboto_Mono/RobotoMono-VariableFont_wght.ttf +0 -0
  39. package/src/assets/html/application.html +38 -13
  40. package/src/assets/html/window.html +6 -7
  41. package/src/assets/themes/default.css +186 -176
  42. package/src/assets/themes/{system-colors.css → definitions.css} +155 -173
  43. package/src/assets/themes/fonts.css +45 -0
  44. package/src/assets/themes/media-template.css +3 -2
  45. package/src/assets/themes/media.css +3 -2
  46. package/src/assets/themes/prompt-template.css +5 -1
  47. package/src/assets/themes/prompt.css +5 -1
  48. package/src/assets/html/application-template.html +0 -164
  49. package/src/assets/html/window-template.html +0 -39
@@ -530,31 +530,31 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
530
530
  {
531
531
  label: _("Add Instance"),
532
532
  visible: local,
533
- args: ["addImportedNodeClone", element .attr ("id")],
533
+ args: ["addImportedNodeInstance", element .attr ("id")],
534
534
  },
535
535
  { type: "separator" },
536
536
  {
537
537
  label: _("Cut"),
538
- visible: local && element .hasClass ("proxy"),
538
+ visible: local && element .hasClass ("instance"),
539
539
  accelerator: "CmdOrCtrl+X",
540
540
  args: ["cutNodes"],
541
541
  },
542
542
  {
543
543
  label: _("Copy"),
544
- visible: local && element .hasClass ("proxy"),
544
+ visible: local && element .hasClass ("instance"),
545
545
  accelerator: "CmdOrCtrl+C",
546
546
  args: ["copyNodes"],
547
547
  },
548
548
  {
549
549
  label: _("Delete"),
550
- visible: local && element .hasClass ("proxy"),
550
+ visible: local && element .hasClass ("instance"),
551
551
  accelerator: "CmdOrCtrl+Backspace",
552
552
  args: ["deleteNodes"],
553
553
  },
554
554
  { type: "separator" },
555
555
  ];
556
556
 
557
- if (local && element .hasClass ("proxy") && innerNode .getType () .includes (X3D .X3DConstants .X3DChildNode))
557
+ if (local && element .hasClass ("instance") && innerNode .getType () .includes (X3D .X3DConstants .X3DChildNode))
558
558
  this .addChildNodeMenu (menu, element, parentNodeElement, executionContext, node);
559
559
  }
560
560
 
@@ -654,10 +654,6 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
654
654
  menu .push ({
655
655
  label: _("Add Parent Group"),
656
656
  submenu: [
657
- {
658
- label: "Transform",
659
- args: ["addParentGroup", element .attr ("id"), executionContext .getId (), node .getId (), "Grouping", "Transform", "children"],
660
- },
661
657
  {
662
658
  label: "Group",
663
659
  args: ["addParentGroup", element .attr ("id"), executionContext .getId (), node .getId (), "Grouping", "Group", "children"],
@@ -670,6 +666,10 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
670
666
  label: "Switch",
671
667
  args: ["addParentGroup", element .attr ("id"), executionContext .getId (), node .getId (), "Grouping", "Switch", "children"],
672
668
  },
669
+ {
670
+ label: "Transform",
671
+ args: ["addParentGroup", element .attr ("id"), executionContext .getId (), node .getId (), "Grouping", "Transform", "children"],
672
+ },
673
673
  { type: "separator" },
674
674
  {
675
675
  label: "Billboard",
@@ -932,16 +932,16 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
932
932
  Editor .removeImportedNode (importedNode .getExecutionContext (), importedNode .getImportedName ());
933
933
  }
934
934
 
935
- addImportedNodeClone (id)
935
+ addImportedNodeInstance (id)
936
936
  {
937
937
  const
938
938
  element = $(`#${id}`),
939
939
  importedNode = this .objects .get (parseInt (element .attr ("imported-node-id"))),
940
940
  executionContext = importedNode .getExecutionContext ();
941
941
 
942
- UndoManager .shared .beginUndo (_("Add Clone of Imported Node »%s«"), importedNode .getImportedName ());
942
+ UndoManager .shared .beginUndo (_("Add Instance of Imported Node »%s«"), importedNode .getImportedName ());
943
943
 
944
- Editor .appendValueToArray (executionContext, executionContext, executionContext .rootNodes, importedNode .getExportedNode ());
944
+ Editor .appendValueToArray (executionContext, executionContext, executionContext .rootNodes, importedNode .getInstance ());
945
945
 
946
946
  UndoManager .shared .endUndo ();
947
947
  }
@@ -967,8 +967,8 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
967
967
  async copyNodes ()
968
968
  {
969
969
  const
970
- primary = $(":is(.node, .proto, .externproto, .imported-node.proxy).primary"),
971
- selected = this .sceneGraph .find (":is(.node, .proto, .externproto, .imported-node.proxy).manually"),
970
+ primary = $(":is(.node, .proto, .externproto, .imported-node.instance).primary"),
971
+ selected = this .sceneGraph .find (":is(.node, .proto, .externproto, .imported-node.instance).manually"),
972
972
  selection = selected .filter (primary) .length ? selected : primary,
973
973
  ids = selection .map (function () { return this .id; }) .get (),
974
974
  elements = ids .map (id => $(`#${id}`)),
@@ -1119,8 +1119,8 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1119
1119
  deleteNodes ()
1120
1120
  {
1121
1121
  const
1122
- primary = $(".node.primary, .imported-node.proxy.primary"),
1123
- selected = this .sceneGraph .find (".node.manually, .imported-node.proxy.manually"),
1122
+ primary = $(".node.primary, .imported-node.instance.primary"),
1123
+ selected = this .sceneGraph .find (".node.manually, .imported-node.instance.manually"),
1124
1124
  selection = !primary .length || selected .filter (primary) .length ? selected : primary,
1125
1125
  ids = selection .map (function () { return this .id; }) .get ();
1126
1126
 
@@ -1252,8 +1252,8 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1252
1252
  if (field .getType () === X3D .X3DConstants .MFNode)
1253
1253
  {
1254
1254
  const
1255
- selectedNodes = Array .from (this .sceneGraph .find (":is(.node, .imported-node.proxy):is(.manually,.primary)"), e => this .getNode ($(e))),
1256
- selectedElements = Array .from (this .sceneGraph .find (":is(.node, .imported-node.proxy).manually"), e => $(e)),
1255
+ selectedNodes = Array .from (this .sceneGraph .find (":is(.node, .imported-node.instance):is(.manually,.primary)"), e => this .getNode ($(e))),
1256
+ selectedElements = Array .from (this .sceneGraph .find (":is(.node, .imported-node.instance).manually"), e => $(e)),
1257
1257
  destinationModelMatrix = this .getModelMatrix (parentNodeElement);
1258
1258
 
1259
1259
  // Add other selected nodes.
@@ -1843,7 +1843,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1843
1843
  executionContext = this .objects .get (executionContextId),
1844
1844
  childNode = this .objects .get (nodeId),
1845
1845
  defaultDirectory = $.try (() => path .dirname (url .fileURLToPath (executionContext .getWorldURL ()))),
1846
- defaultPath = childNode .getName () && defaultDirectory ? path .join (defaultDirectory, `${childNode .getName ()}.x3d`) : defaultDirectory,
1846
+ defaultPath = childNode .getDisplayName () && defaultDirectory ? path .join (defaultDirectory, `${childNode .getDisplayName ()}.x3d`) : defaultDirectory,
1847
1847
  response = await electron .ipcRenderer .invoke ("file-path", { type: "save", defaultPath });
1848
1848
 
1849
1849
  if (response .canceled)
@@ -3157,7 +3157,9 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
3157
3157
  event .originalEvent .dataTransfer .dropEffect = "move";
3158
3158
 
3159
3159
  if (sourceIndex == destinationIndex || sourceIndex + 1 == destinationIndex)
3160
- { }
3160
+ {
3161
+ ;
3162
+ }
3161
3163
  else if (sourceIndex < destinationIndex)
3162
3164
  {
3163
3165
  for (let i = sourceIndex + 1; i < destinationIndex; ++ i)
@@ -3255,7 +3257,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
3255
3257
  {
3256
3258
  destinationElement .addClass ("drag-into");
3257
3259
  }
3258
- else if (destinationElement .is (".node, .imported-node.proxy"))
3260
+ else if (destinationElement .is (".node, .imported-node.instance"))
3259
3261
  {
3260
3262
  const
3261
3263
  item = destinationElement .find ("> .item"),
@@ -3669,7 +3671,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
3669
3671
 
3670
3672
  if (destinationElement .data ("dropEffect") ?.match (/copy|move/))
3671
3673
  {
3672
- if (!(sourceNode instanceof X3D .X3DImportedNodeProxy))
3674
+ if (!(sourceNode instanceof X3D .X3DImportedNodeInstance))
3673
3675
  {
3674
3676
  if (sourceNode ?.getType () .some (type => this .transformLikeNodes .has (type)))
3675
3677
  {
@@ -34,7 +34,7 @@ module .exports = class OutlineView extends Interface
34
34
  expandInlineNodes: true,
35
35
  });
36
36
 
37
- this .treeView = $("<div><div/>")
37
+ this .treeView = $("<div></div>")
38
38
  .attr ("tabindex", "0")
39
39
  .addClass ("tree-view")
40
40
  .appendTo (this .outlineEditor);
@@ -43,7 +43,7 @@ module .exports = class OutlineView extends Interface
43
43
 
44
44
  this .resizeObserver .observe (this .treeView [0]);
45
45
 
46
- this .sceneGraph = $("<div><div/>")
46
+ this .sceneGraph = $("<div></div>")
47
47
  .addClass (["tree", "scene-graph", "scene"])
48
48
  .on ("dragenter dragover", this .onDragEnter .bind (this))
49
49
  .on ("dragleave dragend drop", this .onDragLeave .bind (this))
@@ -223,7 +223,7 @@ module .exports = class OutlineView extends Interface
223
223
 
224
224
  child
225
225
  .jstree ()
226
- .off ("keypress.jstree dblclick.jstree")
226
+ .off ("keypress.jstree keydown.jstree dblclick.jstree")
227
227
  .on ("before_open.jstree", this .nodeBeforeOpen .bind (this))
228
228
  .on ("close_node.jstree", this .nodeCloseNode .bind (this))
229
229
  .appendTo (parent)
@@ -240,7 +240,7 @@ module .exports = class OutlineView extends Interface
240
240
  .on ("dblclick", this .activateNode .bind (this));
241
241
 
242
242
  child .find (".jstree-ocl")
243
- .addClass ("material-icons")
243
+ .addClass ("material-symbols-outlined")
244
244
  .text ("arrow_right")
245
245
  .on ("click", this .selectExpander .bind (this))
246
246
  .on ("dblclick", this .activateExpander .bind (this));
@@ -552,7 +552,7 @@ module .exports = class OutlineView extends Interface
552
552
  .appendTo (ul);
553
553
 
554
554
  for (const [index, importedNode] of importedNodes .entries ())
555
- ul .append (this .createImportedNodeElement (["imported-node"], parent, scene, importedNode .getExportedNode (), index));
555
+ ul .append (this .createImportedNodeElement (["imported-node"], parent, scene, importedNode .getInstance (), index));
556
556
 
557
557
  // Added to prevent bug, that last route is not drawn right.
558
558
  $("<li></li>")
@@ -783,7 +783,7 @@ module .exports = class OutlineView extends Interface
783
783
 
784
784
  child
785
785
  .jstree ()
786
- .off ("keypress.jstree dblclick.jstree")
786
+ .off ("keypress.jstree keydown.jstree dblclick.jstree")
787
787
  .on ("before_open.jstree", this .fieldBeforeOpen .bind (this))
788
788
  .on ("close_node.jstree", this .fieldCloseNode .bind (this))
789
789
  .appendTo (parent)
@@ -800,7 +800,7 @@ module .exports = class OutlineView extends Interface
800
800
  .on ("dblclick", this .activateField .bind (this));
801
801
 
802
802
  child .find (".jstree-ocl")
803
- .addClass ("material-icons")
803
+ .addClass ("material-symbols-outlined")
804
804
  .text ("arrow_right")
805
805
  .on ("click", this .selectExpander .bind (this))
806
806
  .on ("dblclick", this .activateExpander .bind (this));
@@ -982,8 +982,8 @@ module .exports = class OutlineView extends Interface
982
982
 
983
983
  createNodeElement (type, parent, node, index)
984
984
  {
985
- if (node instanceof X3D .X3DImportedNodeProxy)
986
- return this .createImportedNodeElement (["imported-node", "proxy"], parent, node .getExecutionContext (), node, index);
985
+ if (node instanceof X3D .X3DImportedNodeInstance)
986
+ return this .createImportedNodeElement (["imported-node", "instance"], parent, node .getExecutionContext (), node, index);
987
987
 
988
988
  if (node)
989
989
  {
@@ -1193,7 +1193,7 @@ module .exports = class OutlineView extends Interface
1193
1193
  .attr ("order", "5")
1194
1194
  .attr ("title", node ._isActive .getValue () && !node ._isPaused .getValue () ? _("Pause timer.") : _("Start timer."))
1195
1195
  .attr ("action", "play-node")
1196
- .addClass (["button", "material-icons"])
1196
+ .addClass (["button", "material-symbols-outlined", "fill"])
1197
1197
  .addClass (node ._isPaused .getValue () ? "on" : "off")
1198
1198
  .text (node ._isActive .getValue () ? "pause" : "play_arrow"));
1199
1199
 
@@ -1201,7 +1201,7 @@ module .exports = class OutlineView extends Interface
1201
1201
  .attr ("order", "6")
1202
1202
  .attr ("title", _("Stop timer."))
1203
1203
  .attr ("action", "stop-node")
1204
- .addClass (["button", "material-icons"])
1204
+ .addClass (["button", "material-symbols-outlined", "fill"])
1205
1205
  .addClass (node ._isActive .getValue () ? "on" : "off")
1206
1206
  .text ("stop"));
1207
1207
 
@@ -1211,7 +1211,7 @@ module .exports = class OutlineView extends Interface
1211
1211
  .attr ("order", "7")
1212
1212
  .attr ("title", _("Toggle loop."))
1213
1213
  .attr ("action", "loop-node")
1214
- .addClass (["button", "material-icons"])
1214
+ .addClass (["button", "material-symbols-outlined"])
1215
1215
  .addClass (node ._loop .getValue () ? "on" : "off")
1216
1216
  .text ("repeat"));
1217
1217
  }
@@ -1238,7 +1238,7 @@ module .exports = class OutlineView extends Interface
1238
1238
  .attr ("title", "Load now.")
1239
1239
  .attr ("action", "reload-node")
1240
1240
  .addClass (["button", "material-symbols-outlined", className])
1241
- .text ("autorenew"));
1241
+ .text ("refresh"));
1242
1242
 
1243
1243
  continue;
1244
1244
  }
@@ -1453,7 +1453,7 @@ module .exports = class OutlineView extends Interface
1453
1453
 
1454
1454
  const classes = type;
1455
1455
 
1456
- if (importedNode .getExportedNode () .getSharedNode ())
1456
+ if ($.try (() => node .getInnerNode ()))
1457
1457
  {
1458
1458
  const selection = require ("../Application/Selection");
1459
1459
 
@@ -1485,9 +1485,13 @@ module .exports = class OutlineView extends Interface
1485
1485
  .addClass ("name")
1486
1486
  .appendTo (child);
1487
1487
 
1488
+ const loaded = node .getImportedNode () .getInlineNode () .checkLoadState () === X3D .X3DConstants .COMPLETE_STATE;
1489
+
1488
1490
  $("<span></span>")
1489
1491
  .addClass ("node-type-name")
1490
- .text (node .getTypeName ())
1492
+ .text (type .includes ("instance") || loaded
1493
+ ? node .getTypeName ()
1494
+ : node .getImportedNode () .getTypeName ())
1491
1495
  .appendTo (name);
1492
1496
 
1493
1497
  name .append (document .createTextNode (" "));
@@ -2271,7 +2275,7 @@ module .exports = class OutlineView extends Interface
2271
2275
 
2272
2276
  child
2273
2277
  .jstree ()
2274
- .off ("keypress.jstree dblclick.jstree")
2278
+ .off ("keypress.jstree keydown.jstree dblclick.jstree")
2275
2279
  .on ("before_open.jstree", this .nodeBeforeOpen .bind (this))
2276
2280
  .on ("close_node.jstree", this .nodeCloseNode .bind (this))
2277
2281
  .appendTo (parent)
@@ -2288,7 +2292,7 @@ module .exports = class OutlineView extends Interface
2288
2292
  .on ("dblclick", this .activateNode .bind (this));
2289
2293
 
2290
2294
  child .find (".jstree-ocl")
2291
- .addClass ("material-icons")
2295
+ .addClass ("material-symbols-outlined")
2292
2296
  .text ("arrow_right")
2293
2297
  .on ("click", this .selectExpander .bind (this))
2294
2298
  .on ("dblclick", this .activateExpander .bind (this));
@@ -2354,7 +2358,7 @@ module .exports = class OutlineView extends Interface
2354
2358
 
2355
2359
  child
2356
2360
  .jstree ()
2357
- .off ("keypress.jstree dblclick.jstree")
2361
+ .off ("keypress.jstree keydown.jstree dblclick.jstree")
2358
2362
  .on ("before_open.jstree", this .nodeBeforeOpen .bind (this))
2359
2363
  .on ("close_node.jstree", this .nodeCloseNode .bind (this))
2360
2364
  .appendTo (parent)
@@ -2371,7 +2375,7 @@ module .exports = class OutlineView extends Interface
2371
2375
  .on ("dblclick", this .activateNode .bind (this));
2372
2376
 
2373
2377
  child .find (".jstree-ocl")
2374
- .addClass ("material-icons")
2378
+ .addClass ("material-symbols-outlined")
2375
2379
  .text ("arrow_right")
2376
2380
  .on ("click", this .selectExpander .bind (this))
2377
2381
  .on ("dblclick", this .activateExpander .bind (this));
@@ -2459,7 +2463,7 @@ module .exports = class OutlineView extends Interface
2459
2463
 
2460
2464
  child
2461
2465
  .jstree ()
2462
- .off ("keypress.jstree dblclick.jstree")
2466
+ .off ("keypress.jstree keydown.jstree dblclick.jstree")
2463
2467
  .appendTo (parent)
2464
2468
  .hide ();
2465
2469
 
@@ -2471,7 +2475,7 @@ module .exports = class OutlineView extends Interface
2471
2475
  .on ("click", this .selectNone .bind (this));
2472
2476
 
2473
2477
  child .find (".jstree-ocl")
2474
- .addClass ("material-icons")
2478
+ .addClass ("material-symbols-outlined")
2475
2479
  .text ("arrow_right")
2476
2480
  .on ("click", this .selectExpander .bind (this))
2477
2481
  .on ("dblclick", this .activateExpander .bind (this));
@@ -2572,7 +2576,7 @@ module .exports = class OutlineView extends Interface
2572
2576
 
2573
2577
  child
2574
2578
  .jstree ()
2575
- .off ("keypress.jstree dblclick.jstree")
2579
+ .off ("keypress.jstree keydown.jstree dblclick.jstree")
2576
2580
  .appendTo (parent)
2577
2581
  .hide ();
2578
2582
 
@@ -2584,7 +2588,7 @@ module .exports = class OutlineView extends Interface
2584
2588
  .on ("click", this .selectNone .bind (this));
2585
2589
 
2586
2590
  child .find (".jstree-ocl")
2587
- .addClass ("material-icons")
2591
+ .addClass ("material-symbols-outlined")
2588
2592
  .text ("arrow_right")
2589
2593
  .on ("click", this .selectExpander .bind (this))
2590
2594
  .on ("dblclick", this .activateExpander .bind (this));
@@ -2613,7 +2617,7 @@ module .exports = class OutlineView extends Interface
2613
2617
  }
2614
2618
  else
2615
2619
  {
2616
- textarea .attr ("disabled", "disabled");
2620
+ textarea .attr ("disabled", "");
2617
2621
  }
2618
2622
 
2619
2623
  this .connectArrayField (textarea, node, field, false);
@@ -2691,21 +2695,13 @@ module .exports = class OutlineView extends Interface
2691
2695
  {
2692
2696
  case "input":
2693
2697
  {
2694
- const sourceNodeName = route .getSourceNode () instanceof X3D .X3DNode
2695
- ? route .getSourceNode () .getName ()
2696
- : route .getSourceNode () .getImportedName ();
2697
-
2698
- connectorDescription .text (util .format (_("Route from %s<%s>.%s"), route .getSourceNode () .getTypeName (), sourceNodeName || _("unnamed"), route .sourceField));
2698
+ connectorDescription .text (util .format (_("Route from %s<%s>.%s"), route .getSourceNode () .getTypeName (), route .getSourceNode () .getName () || _("unnamed"), route .sourceField));
2699
2699
 
2700
2700
  break;
2701
2701
  }
2702
2702
  case "output":
2703
2703
  {
2704
- const destinationNodeName = route .getDestinationNode () instanceof X3D .X3DNode
2705
- ? route .getDestinationNode () .getName ()
2706
- : route .getDestinationNode () .getImportedName ();
2707
-
2708
- connectorDescription .text (util .format (_("Route to %s<%s>.%s"), route .getDestinationNode () .getTypeName (), destinationNodeName || _("unnamed"), route .destinationField));
2704
+ connectorDescription .text (util .format (_("Route to %s<%s>.%s"), route .getDestinationNode () .getTypeName (), route .getDestinationNode () .getName () || _("unnamed"), route .destinationField));
2709
2705
 
2710
2706
  break;
2711
2707
  }
@@ -2908,7 +2904,7 @@ module .exports = class OutlineView extends Interface
2908
2904
  {
2909
2905
  const ids = [parseInt (element .attr ("node-id"))];
2910
2906
 
2911
- if (this .getNode (element) instanceof X3D .X3DImportedNodeProxy)
2907
+ if (this .getNode (element) instanceof X3D .X3DImportedNodeInstance)
2912
2908
  {
2913
2909
  // Close nodes.
2914
2910
 
@@ -2922,9 +2918,9 @@ module .exports = class OutlineView extends Interface
2922
2918
  ?? this .executionContext;
2923
2919
 
2924
2920
  const importedNode = executionContext .importedNodes
2925
- .find (importedNode => $.try (() => importedNode .getExportedNode () .getInnerNode () .getId ()) === ids [0]);
2921
+ .find (importedNode => $.try (() => importedNode .getInstance () .getInnerNode () .getId ()) === ids [0]);
2926
2922
 
2927
- ids .push (importedNode ?.getExportedNode () .getId ());
2923
+ ids .push (importedNode ?.getInstance () .getId ());
2928
2924
  }
2929
2925
 
2930
2926
  for (const id of ids)
@@ -3571,8 +3567,7 @@ module .exports = class OutlineView extends Interface
3571
3567
  selected = element .hasClass ("manually"),
3572
3568
  selectedElements = this .sceneGraph .find (".primary, .selected"),
3573
3569
  node = this .getNode (element),
3574
- elements = $(`:is(.node, .imported-node)[node-id='${node ?.getId ()}']`),
3575
- importedNodes = element .closest (".imported-nodes") .length;
3570
+ elements = $(`:is(.node, .imported-node)[node-id='${node ?.getId ()}']`);
3576
3571
 
3577
3572
  selectedElements .removeClass ("primary");
3578
3573
 
@@ -3598,21 +3593,18 @@ module .exports = class OutlineView extends Interface
3598
3593
  element .addClass (["primary", "manually", "selected"]);
3599
3594
  }
3600
3595
 
3601
- if (!importedNodes)
3596
+ if (elements .filter (".manually") .length)
3602
3597
  {
3603
- if (elements .filter (".manually") .length)
3604
- {
3605
- if (target)
3606
- hierarchy .target (node);
3598
+ if (target)
3599
+ hierarchy .target (node);
3607
3600
 
3608
- selection .add (node);
3609
- hierarchy .add (node);
3610
- }
3611
- else
3612
- {
3613
- selection .remove (node);
3614
- hierarchy .remove (node);
3615
- }
3601
+ selection .add (node);
3602
+ hierarchy .add (node);
3603
+ }
3604
+ else
3605
+ {
3606
+ selection .remove (node);
3607
+ hierarchy .remove (node);
3616
3608
  }
3617
3609
  }
3618
3610
  else
@@ -3621,14 +3613,11 @@ module .exports = class OutlineView extends Interface
3621
3613
  element .addClass (["primary", "manually"]);
3622
3614
  elements .addClass ("selected");
3623
3615
 
3624
- if (!importedNodes)
3625
- {
3626
- if (target)
3627
- hierarchy .target (node);
3616
+ if (target)
3617
+ hierarchy .target (node);
3628
3618
 
3629
- selection .set (node);
3630
- hierarchy .set (node);
3631
- }
3619
+ selection .set (node);
3620
+ hierarchy .set (node);
3632
3621
  }
3633
3622
 
3634
3623
  // Prevent update tree view.
@@ -3963,6 +3952,28 @@ module .exports = class OutlineView extends Interface
3963
3952
 
3964
3953
  onDragEnd (event) { }
3965
3954
 
3955
+ findNode (node, add = false)
3956
+ {
3957
+ const id = node .getId ();
3958
+
3959
+ this .expandTo (node, { expandObject: true, expandInlineNodes: true, expandAll: true });
3960
+
3961
+ const elements = Array .from (this .sceneGraph .find (`.node[node-id=${id}], .imported-node[node-id=${id}]`));
3962
+
3963
+ if (!elements .length)
3964
+ return;
3965
+
3966
+ for (const [i, element] of elements .entries ())
3967
+ {
3968
+ if ($(element) .is (".node, .imported-node"))
3969
+ this .selectNodeElement ($(element), { add: add || i > 0, target: true });
3970
+ }
3971
+
3972
+ // Scroll element into view.
3973
+
3974
+ elements [0] ?.scrollIntoView ({ block: "center", inline: "start", behavior: "smooth" });
3975
+ }
3976
+
3966
3977
  expandTo (object, { expandExternProtoDeclarations = false, expandInlineNodes = false, expandPrototypeInstances = false, expandObject = false, expandAll = false } = { })
3967
3978
  {
3968
3979
  let flags = Traverse .NONE;
@@ -3983,6 +3994,17 @@ module .exports = class OutlineView extends Interface
3983
3994
 
3984
3995
  flags |= Traverse .IMPORTED_NODES;
3985
3996
 
3997
+ if (this .expandToFlags (object, flags, expandObject, expandAll))
3998
+ return;
3999
+
4000
+ if (!(object instanceof X3D .X3DImportedNodeInstance))
4001
+ return;
4002
+
4003
+ this .expandToFlags (object .getImportedNode (), flags, expandObject, expandAll);
4004
+ }
4005
+
4006
+ expandToFlags (object, flags, expandObject, expandAll)
4007
+ {
3986
4008
  for (const hierarchy of this .executionContext .find (object, flags))
3987
4009
  {
3988
4010
  hierarchy .shift (); // execution context
@@ -3994,8 +4016,10 @@ module .exports = class OutlineView extends Interface
3994
4016
  this .expandHierarchy (hierarchy, this .sceneGraph, this .executionContext);
3995
4017
 
3996
4018
  if (!expandAll)
3997
- break;
4019
+ return true;
3998
4020
  }
4021
+
4022
+ return false;
3999
4023
  }
4000
4024
 
4001
4025
  expandHierarchy (hierarchy, parent, parentObject)
@@ -4047,7 +4071,7 @@ module .exports = class OutlineView extends Interface
4047
4071
  }
4048
4072
  default: // X3DBaseNode
4049
4073
  {
4050
- const element = parent .find (`:is(.node, .imported-node.proxy, .externproto, .proto, .scene)[node-id="${object .getId ()}"]`);
4074
+ const element = parent .find (`:is(.node, .imported-node.instance, .externproto, .proto, .scene)[node-id="${object .getId ()}"]`);
4051
4075
 
4052
4076
  if (!element .length)
4053
4077
  break;
@@ -19,14 +19,14 @@ module .exports = new class Panel extends Interface
19
19
  this .container = $(this .pane .element) .parent ();
20
20
  this .selection = require ("../Application/Selection");
21
21
 
22
- this .container .hide () .appendTo ($("#browser-pane"));
22
+ this .container .hide () .appendTo ($("#browser-panel"));
23
23
 
24
24
  this .container .css ({
25
25
  "z-index": "3000",
26
26
  "overflow": "unset",
27
27
  "width": "fit-content",
28
28
  "top": "unset",
29
- "right": "calc(var(--toolbar-width) + 8px)",
29
+ "right": "calc(var(--toolbar-size) + 8px)",
30
30
  "bottom": this .container .css ("top"),
31
31
  });
32
32
 
@@ -117,7 +117,10 @@ module .exports = new class Panel extends Interface
117
117
  {
118
118
  this .removeNode (this .node);
119
119
 
120
- this .node = node;
120
+ if (node instanceof X3D .X3DImportedNodeInstance)
121
+ this .node = node .getInnerNode ();
122
+ else
123
+ this .node = node;
121
124
 
122
125
  this .addNode (this .node);
123
126
  }