sunrize 2.3.5 → 2.4.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.
- package/package.json +13 -13
- package/src/Application/Application.js +3 -3
- package/src/Application/Document.js +1 -1
- package/src/Application/Footer.js +10 -5
- package/src/Application/Tabs.js +13 -5
- package/src/Bits/X3DUOM.js +0 -3
- package/src/Controls/Tabs.js +4 -3
- package/src/Editors/AnimationEditor.js +193 -180
- package/src/Editors/OutlineEditor.js +51 -55
- package/src/Editors/OutlineView.js +89 -53
- package/src/Editors/RouteGraph.js +2381 -0
- package/src/Tools/Grids/GridTool.js +6 -2
- package/src/Tools/Grids/X3DGridNodeTool.js +1 -1
- package/src/Tools/Rendering/X3DGeometryNodeTool.js +2 -3
- package/src/Tools/Text/TextTool.js +1 -14
- package/src/Tools.js +3 -0
- package/src/Undo/Editor.js +39 -10
- package/src/Undo/UndoManager.js +18 -7
- package/src/assets/X3DUOM.xml +11 -9
- package/src/assets/html/application-template.html +1 -1
- package/src/assets/html/application.html +1 -1
- package/src/assets/themes/default.css +361 -37
- package/src/assets/themes/system-colors.css +17 -3
|
@@ -528,7 +528,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
528
528
|
args: ["removeImportedNode", element .attr ("id")],
|
|
529
529
|
},
|
|
530
530
|
{
|
|
531
|
-
label: _("Add
|
|
531
|
+
label: _("Add Instance"),
|
|
532
532
|
visible: local,
|
|
533
533
|
args: ["addImportedNodeClone", element .attr ("id")],
|
|
534
534
|
},
|
|
@@ -1099,7 +1099,14 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
1099
1099
|
for (const node of nodes .filter (node => node))
|
|
1100
1100
|
{
|
|
1101
1101
|
this .expandTo (node);
|
|
1102
|
-
|
|
1102
|
+
|
|
1103
|
+
const
|
|
1104
|
+
containerField = $.try (() => node .getInnerNode () .getContainerField ()) ?? node .getContainerField (),
|
|
1105
|
+
field = targetField ?? $.try (() => targetNode ?.getField (containerField)) ?? executionContext .rootNodes;
|
|
1106
|
+
|
|
1107
|
+
const parentElement = $(`.field[field-id=${field .getId ()}] > .subtree > ul, .root-nodes[field-id=${field .getId ()}] > ul`);
|
|
1108
|
+
|
|
1109
|
+
this .selectNodeElement (parentElement .find (`> :is(.node, .imported-node)[node-id="${node .getId ()}"]`), { add: true });
|
|
1103
1110
|
}
|
|
1104
1111
|
}
|
|
1105
1112
|
// catch (error)
|
|
@@ -1604,18 +1611,20 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
1604
1611
|
|
|
1605
1612
|
// Create Inline node.
|
|
1606
1613
|
|
|
1614
|
+
let childNode;
|
|
1615
|
+
|
|
1607
1616
|
switch (nodes .length)
|
|
1608
1617
|
{
|
|
1609
1618
|
case 1:
|
|
1610
1619
|
{
|
|
1611
|
-
|
|
1620
|
+
childNode = nodes [0];
|
|
1612
1621
|
break;
|
|
1613
1622
|
}
|
|
1614
1623
|
default:
|
|
1615
1624
|
{
|
|
1616
1625
|
await Editor .addComponent (executionContext, "Grouping");
|
|
1617
1626
|
|
|
1618
|
-
|
|
1627
|
+
childNode = executionContext .createNode ("Group") .getValue ();
|
|
1619
1628
|
|
|
1620
1629
|
childNode ._children = nodes;
|
|
1621
1630
|
|
|
@@ -2603,9 +2612,9 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
2603
2612
|
case "Cylinder":
|
|
2604
2613
|
case "Sphere":
|
|
2605
2614
|
{
|
|
2606
|
-
this .browser .
|
|
2615
|
+
this .browser .finishEvents () .addFieldCallback (this .#endUndoSetFieldValueSymbol, () =>
|
|
2607
2616
|
{
|
|
2608
|
-
this .browser .
|
|
2617
|
+
this .browser .finishEvents () .removeFieldCallback (this .#endUndoSetFieldValueSymbol);
|
|
2609
2618
|
|
|
2610
2619
|
toolNode .getTransformTool () .transformGroups ();
|
|
2611
2620
|
toolNode .handleUndo (new X3D .SFBool ());
|
|
@@ -2618,9 +2627,9 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
2618
2627
|
}
|
|
2619
2628
|
case "Disk2D":
|
|
2620
2629
|
{
|
|
2621
|
-
this .browser .
|
|
2630
|
+
this .browser .finishEvents () .addFieldCallback (this .#endUndoSetFieldValueSymbol, () =>
|
|
2622
2631
|
{
|
|
2623
|
-
this .browser .
|
|
2632
|
+
this .browser .finishEvents () .removeFieldCallback (this .#endUndoSetFieldValueSymbol);
|
|
2624
2633
|
|
|
2625
2634
|
if (field .getName () === "innerRadius")
|
|
2626
2635
|
toolNode .getInnerRadiusTransformTool () .transformGroups ();
|
|
@@ -2652,9 +2661,9 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
2652
2661
|
{
|
|
2653
2662
|
// Sound, X3DEnvironmentalSensorNode, ...
|
|
2654
2663
|
|
|
2655
|
-
this .browser .
|
|
2664
|
+
this .browser .finishEvents () .addFieldCallback (this .#endUndoSetFieldValueSymbol, () =>
|
|
2656
2665
|
{
|
|
2657
|
-
this .browser .
|
|
2666
|
+
this .browser .finishEvents () .removeFieldCallback (this .#endUndoSetFieldValueSymbol);
|
|
2658
2667
|
|
|
2659
2668
|
innerTool .transformGroups ();
|
|
2660
2669
|
toolNode .handleUndo (new X3D .SFBool ());
|
|
@@ -3018,8 +3027,8 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
3018
3027
|
onDragStartNode (event)
|
|
3019
3028
|
{
|
|
3020
3029
|
const
|
|
3021
|
-
element = $(event .target) .closest (".node", this .sceneGraph),
|
|
3022
|
-
selected = this .sceneGraph .find (".node.manually"),
|
|
3030
|
+
element = $(event .target) .closest (".node, .imported-node", this .sceneGraph),
|
|
3031
|
+
selected = this .sceneGraph .find (".node.manually, .imported-node.manually"),
|
|
3023
3032
|
selection = selected .filter (element) .length ? selected : element,
|
|
3024
3033
|
ids = selection .map (function () { return this .id; }) .get ();
|
|
3025
3034
|
|
|
@@ -3049,22 +3058,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
3049
3058
|
|
|
3050
3059
|
onDragStartImportedNode (event)
|
|
3051
3060
|
{
|
|
3052
|
-
|
|
3053
|
-
element = $(event .target) .closest (".imported-node", this .sceneGraph),
|
|
3054
|
-
selected = this .sceneGraph .find (".imported-node.manually"),
|
|
3055
|
-
selection = selected .filter (element) .length ? selected : element,
|
|
3056
|
-
ids = selection .map (function () { return this .id; }) .get ();
|
|
3057
|
-
|
|
3058
|
-
if (element .closest (".imported-nodes") .length)
|
|
3059
|
-
{
|
|
3060
|
-
event .preventDefault ();
|
|
3061
|
-
}
|
|
3062
|
-
else
|
|
3063
|
-
{
|
|
3064
|
-
this .selectPrimaryElement (element);
|
|
3065
|
-
|
|
3066
|
-
event .originalEvent .dataTransfer .setData ("sunrize/imported-node", ids .join (","));
|
|
3067
|
-
}
|
|
3061
|
+
this .onDragStartNode (event);
|
|
3068
3062
|
}
|
|
3069
3063
|
|
|
3070
3064
|
onDragEnter (event)
|
|
@@ -3231,25 +3225,23 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
3231
3225
|
}
|
|
3232
3226
|
}
|
|
3233
3227
|
}
|
|
3234
|
-
else if (event .originalEvent .dataTransfer .types .includes ("sunrize/nodes")
|
|
3235
|
-
event .originalEvent .dataTransfer .types .includes ("sunrize/imported-node"))
|
|
3228
|
+
else if (event .originalEvent .dataTransfer .types .includes ("sunrize/nodes"))
|
|
3236
3229
|
{
|
|
3237
3230
|
const
|
|
3238
|
-
isImportedNode = event .originalEvent .dataTransfer .types .includes ("sunrize/imported-node"),
|
|
3239
3231
|
sourceElement = this .sceneGraph .find (".primary"),
|
|
3240
3232
|
sourceExecutionContextElement = sourceElement .closest (".scene", this .sceneGraph),
|
|
3241
3233
|
destinationExecutionContextElement = destinationElement .closest (".scene", this .sceneGraph),
|
|
3242
3234
|
sourceExecutionContext = this .getNode (sourceExecutionContextElement),
|
|
3243
3235
|
destinationExecutionContext = this .getNode (destinationExecutionContextElement);
|
|
3244
3236
|
|
|
3245
|
-
if (
|
|
3237
|
+
if (sourceExecutionContext !== destinationExecutionContext)
|
|
3246
3238
|
{
|
|
3247
3239
|
event .originalEvent .dataTransfer .dropEffect = "none";
|
|
3248
3240
|
}
|
|
3249
3241
|
else
|
|
3250
3242
|
{
|
|
3251
3243
|
if (event .altKey)
|
|
3252
|
-
event .originalEvent .dataTransfer .dropEffect =
|
|
3244
|
+
event .originalEvent .dataTransfer .dropEffect = "copy";
|
|
3253
3245
|
else if (event .ctrlKey)
|
|
3254
3246
|
event .originalEvent .dataTransfer .dropEffect = "link";
|
|
3255
3247
|
else
|
|
@@ -3500,12 +3492,9 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
3500
3492
|
}
|
|
3501
3493
|
}
|
|
3502
3494
|
}
|
|
3503
|
-
else if (event .originalEvent .dataTransfer .types .includes ("sunrize/nodes")
|
|
3504
|
-
event .originalEvent .dataTransfer .types .includes ("sunrize/imported-node"))
|
|
3495
|
+
else if (event .originalEvent .dataTransfer .types .includes ("sunrize/nodes"))
|
|
3505
3496
|
{
|
|
3506
|
-
const sourceElementsIds = event .originalEvent .dataTransfer .
|
|
3507
|
-
? event .originalEvent .dataTransfer .getData ("sunrize/imported-node") .split (",")
|
|
3508
|
-
: event .originalEvent .dataTransfer .getData ("sunrize/nodes") .split (",");
|
|
3497
|
+
const sourceElementsIds = event .originalEvent .dataTransfer .getData ("sunrize/nodes") .split (",");
|
|
3509
3498
|
|
|
3510
3499
|
const
|
|
3511
3500
|
destinationElement = $(event .target) .closest ("li, .scene", this .sceneGraph),
|
|
@@ -3540,11 +3529,11 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
3540
3529
|
|
|
3541
3530
|
if (sourceNode)
|
|
3542
3531
|
{
|
|
3543
|
-
UndoManager .shared .beginUndo (this .getUndoDescriptionForNode (destinationElement .data ("dropEffect"), sourceNode), sourceNode .getTypeName (), sourceNode .getDisplayName ());
|
|
3532
|
+
UndoManager .shared .beginUndo (this .getUndoDescriptionForNode (destinationElement .data ("dropEffect"), sourceNode, sourceElement), sourceNode .getTypeName (), sourceNode .getDisplayName ());
|
|
3544
3533
|
}
|
|
3545
3534
|
else
|
|
3546
3535
|
{
|
|
3547
|
-
UndoManager .shared .beginUndo (this .getUndoDescriptionForNode (destinationElement .data ("dropEffect"), sourceNode), "NULL");
|
|
3536
|
+
UndoManager .shared .beginUndo (this .getUndoDescriptionForNode (destinationElement .data ("dropEffect"), sourceNode, sourceElement), "NULL");
|
|
3548
3537
|
}
|
|
3549
3538
|
}
|
|
3550
3539
|
else
|
|
@@ -3585,8 +3574,8 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
3585
3574
|
{
|
|
3586
3575
|
const
|
|
3587
3576
|
sourceElement = $("#" + sourceElementId),
|
|
3588
|
-
sourceParentFieldElement = sourceElement .closest (".field, .scene", this .sceneGraph),
|
|
3589
|
-
sourceParentNodeElement = sourceParentFieldElement .closest (".node, .proto, .scene", this .sceneGraph),
|
|
3577
|
+
sourceParentFieldElement = sourceElement .closest (".field, .scene, .imported-nodes", this .sceneGraph),
|
|
3578
|
+
sourceParentNodeElement = sourceParentFieldElement .closest (".node, .proto, .scene, .imported-nodes", this .sceneGraph),
|
|
3590
3579
|
sourceParentNode = this .getNode (sourceParentNodeElement),
|
|
3591
3580
|
sourceParentField = sourceParentFieldElement .hasClass ("scene") ? sourceParentNode .rootNodes : this .getField (sourceParentFieldElement),
|
|
3592
3581
|
sourceExecutionContextElement = sourceElement .closest (".scene", this .sceneGraph),
|
|
@@ -3649,7 +3638,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
3649
3638
|
|
|
3650
3639
|
// Remove source node.
|
|
3651
3640
|
|
|
3652
|
-
if (destinationElement .data ("dropEffect") === "move")
|
|
3641
|
+
if (destinationElement .data ("dropEffect") === "move" && !sourceParentNodeElement .is (".imported-nodes"))
|
|
3653
3642
|
{
|
|
3654
3643
|
switch (sourceParentField .getType ())
|
|
3655
3644
|
{
|
|
@@ -3757,7 +3746,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
3757
3746
|
// console .log ("onDragEnd")
|
|
3758
3747
|
}
|
|
3759
3748
|
|
|
3760
|
-
getUndoDescriptionForNode (dropEffect, node)
|
|
3749
|
+
getUndoDescriptionForNode (dropEffect, node, element)
|
|
3761
3750
|
{
|
|
3762
3751
|
if (Array .isArray (node))
|
|
3763
3752
|
{
|
|
@@ -3770,22 +3759,29 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
3770
3759
|
}
|
|
3771
3760
|
else
|
|
3772
3761
|
{
|
|
3773
|
-
if (
|
|
3762
|
+
if (element .closest (".imported-nodes") .length)
|
|
3774
3763
|
{
|
|
3775
|
-
|
|
3776
|
-
{
|
|
3777
|
-
case "copy": return _("Copy Node %s »%s«");
|
|
3778
|
-
case "link": return _("Link Node %s »%s«");
|
|
3779
|
-
case "move": return _("Move Node %s »%s«");
|
|
3780
|
-
}
|
|
3764
|
+
return _("Add Node %s »%s«");
|
|
3781
3765
|
}
|
|
3782
3766
|
else
|
|
3783
3767
|
{
|
|
3784
|
-
|
|
3768
|
+
if (node ?.getDisplayName ())
|
|
3785
3769
|
{
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3770
|
+
switch (dropEffect)
|
|
3771
|
+
{
|
|
3772
|
+
case "copy": return _("Copy Node %s »%s«");
|
|
3773
|
+
case "link": return _("Link Node %s »%s«");
|
|
3774
|
+
case "move": return _("Move Node %s »%s«");
|
|
3775
|
+
}
|
|
3776
|
+
}
|
|
3777
|
+
else
|
|
3778
|
+
{
|
|
3779
|
+
switch (dropEffect)
|
|
3780
|
+
{
|
|
3781
|
+
case "copy": return _("Copy Node %s");
|
|
3782
|
+
case "link": return _("Link Node %s");
|
|
3783
|
+
case "move": return _("Move Node %s");
|
|
3784
|
+
}
|
|
3789
3785
|
}
|
|
3790
3786
|
}
|
|
3791
3787
|
}
|
|
@@ -64,8 +64,8 @@ module .exports = class OutlineView extends Interface
|
|
|
64
64
|
electron .ipcRenderer .on ("expand-prototype-instances", (event, value) => this .expandPrototypeInstances = value);
|
|
65
65
|
electron .ipcRenderer .on ("expand-inline-nodes", (event, value) => this .expandInlineNodes = value);
|
|
66
66
|
|
|
67
|
-
electron .ipcRenderer .on ("close",
|
|
68
|
-
$(window) .on ("
|
|
67
|
+
electron .ipcRenderer .on ("close", () => this .saveExpanded (this .config .file));
|
|
68
|
+
$(window) .on ("beforeunload", () => this .saveExpanded (this .config .file));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
get expandExternProtoDeclarations ()
|
|
@@ -133,7 +133,6 @@ module .exports = class OutlineView extends Interface
|
|
|
133
133
|
|
|
134
134
|
// Clear tree.
|
|
135
135
|
|
|
136
|
-
this .objects .clear ();
|
|
137
136
|
this .objects .set (this .executionContext .getId (), this .executionContext);
|
|
138
137
|
this .sceneGraph .empty ();
|
|
139
138
|
this .sceneGraph .attr ("node-id", this .executionContext .getId ());
|
|
@@ -248,7 +247,8 @@ module .exports = class OutlineView extends Interface
|
|
|
248
247
|
|
|
249
248
|
child .find (".jstree-node")
|
|
250
249
|
.wrapInner ("<div class=\"item no-select\"/>")
|
|
251
|
-
.find (".item")
|
|
250
|
+
.find (".item")
|
|
251
|
+
.append ("<div class=\"route-curves-wrapper\"><canvas class=\"route-curves\"></canvas></div>");
|
|
252
252
|
|
|
253
253
|
// Connect actions.
|
|
254
254
|
|
|
@@ -491,6 +491,7 @@ module .exports = class OutlineView extends Interface
|
|
|
491
491
|
parent .attr ("index", scene .rootNodes .length);
|
|
492
492
|
|
|
493
493
|
const child = $("<div></div>")
|
|
494
|
+
.attr ("field-id", scene .rootNodes .getId ())
|
|
494
495
|
.addClass (["root-nodes", "subtree"]);
|
|
495
496
|
|
|
496
497
|
if (!scene .rootNodes .length)
|
|
@@ -806,7 +807,8 @@ module .exports = class OutlineView extends Interface
|
|
|
806
807
|
|
|
807
808
|
child .find (".jstree-node")
|
|
808
809
|
.wrapInner ("<div class=\"item no-select\"/>")
|
|
809
|
-
.find (".item")
|
|
810
|
+
.find (".item")
|
|
811
|
+
.append ("<div class=\"route-curves-wrapper\"><canvas class=\"route-curves\"></canvas></div>");
|
|
810
812
|
|
|
811
813
|
child .find (".field .name, .field .icon, .special .name, .special .icon")
|
|
812
814
|
.on ("click", this .selectField .bind (this));
|
|
@@ -852,6 +854,8 @@ module .exports = class OutlineView extends Interface
|
|
|
852
854
|
this .expandNodeComplete (protos, scenes, elements);
|
|
853
855
|
}
|
|
854
856
|
|
|
857
|
+
#autoExpand = true;
|
|
858
|
+
|
|
855
859
|
expandNodeComplete (protos, scenes, elements)
|
|
856
860
|
{
|
|
857
861
|
this .requestUpdateRouteGraph ();
|
|
@@ -859,31 +863,34 @@ module .exports = class OutlineView extends Interface
|
|
|
859
863
|
|
|
860
864
|
// Auto expand SFNodes
|
|
861
865
|
|
|
862
|
-
|
|
866
|
+
if (this .#autoExpand)
|
|
863
867
|
{
|
|
864
|
-
const
|
|
865
|
-
element = $(e),
|
|
866
|
-
field = this .getField (element);
|
|
867
|
-
|
|
868
|
-
if (field .getValue ())
|
|
868
|
+
for (const e of elements .filter ("li[type-name=SFNode]"))
|
|
869
869
|
{
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
}
|
|
870
|
+
const
|
|
871
|
+
element = $(e),
|
|
872
|
+
field = this .getField (element);
|
|
874
873
|
|
|
875
|
-
|
|
874
|
+
if (field .getValue ())
|
|
875
|
+
{
|
|
876
|
+
element .data ("auto-expand", true);
|
|
877
|
+
element .jstree ("open_node", element);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
876
880
|
|
|
877
|
-
|
|
878
|
-
{
|
|
879
|
-
const
|
|
880
|
-
element = $(e),
|
|
881
|
-
field = this .getField (element);
|
|
881
|
+
// Auto expand MFNodes
|
|
882
882
|
|
|
883
|
-
|
|
883
|
+
for (const e of elements .filter ("li[type-name=MFNode]"))
|
|
884
884
|
{
|
|
885
|
-
|
|
886
|
-
|
|
885
|
+
const
|
|
886
|
+
element = $(e),
|
|
887
|
+
field = this .getField (element);
|
|
888
|
+
|
|
889
|
+
if (field .length && field .length <= this .autoExpandMaxChildren)
|
|
890
|
+
{
|
|
891
|
+
element .data ("auto-expand", true);
|
|
892
|
+
element .jstree ("open_node", element);
|
|
893
|
+
}
|
|
887
894
|
}
|
|
888
895
|
}
|
|
889
896
|
|
|
@@ -2288,7 +2295,8 @@ module .exports = class OutlineView extends Interface
|
|
|
2288
2295
|
|
|
2289
2296
|
child .find (".jstree-node")
|
|
2290
2297
|
.wrapInner ("<div class=\"item no-select\"/>")
|
|
2291
|
-
.find (".item")
|
|
2298
|
+
.find (".item")
|
|
2299
|
+
.append ("<div class=\"route-curves-wrapper\"><canvas class=\"route-curves\"></canvas></div>");
|
|
2292
2300
|
|
|
2293
2301
|
// Connect actions.
|
|
2294
2302
|
|
|
@@ -2370,7 +2378,8 @@ module .exports = class OutlineView extends Interface
|
|
|
2370
2378
|
|
|
2371
2379
|
child .find (".jstree-node")
|
|
2372
2380
|
.wrapInner ("<div class=\"item no-select\"/>")
|
|
2373
|
-
.find (".item")
|
|
2381
|
+
.find (".item")
|
|
2382
|
+
.append ("<div class=\"route-curves-wrapper\"><canvas class=\"route-curves\"></canvas></div>");
|
|
2374
2383
|
|
|
2375
2384
|
// Connect actions.
|
|
2376
2385
|
|
|
@@ -2456,8 +2465,10 @@ module .exports = class OutlineView extends Interface
|
|
|
2456
2465
|
|
|
2457
2466
|
child
|
|
2458
2467
|
.removeAttr ("tabindex")
|
|
2459
|
-
.find (".jstree-anchor
|
|
2460
|
-
.
|
|
2468
|
+
.find (".jstree-anchor")
|
|
2469
|
+
.removeAttr ("href")
|
|
2470
|
+
.removeAttr ("tabindex")
|
|
2471
|
+
.on ("click", this .selectNone .bind (this));
|
|
2461
2472
|
|
|
2462
2473
|
child .find (".jstree-ocl")
|
|
2463
2474
|
.addClass ("material-icons")
|
|
@@ -2467,7 +2478,8 @@ module .exports = class OutlineView extends Interface
|
|
|
2467
2478
|
|
|
2468
2479
|
child .find (".jstree-node")
|
|
2469
2480
|
.wrapInner ("<div class=\"item no-select\"/>")
|
|
2470
|
-
.find (".item")
|
|
2481
|
+
.find (".item")
|
|
2482
|
+
.append ("<div class=\"route-curves-wrapper\"><canvas class=\"route-curves\"></canvas></div>");
|
|
2471
2483
|
|
|
2472
2484
|
this .connectFieldActions (child);
|
|
2473
2485
|
|
|
@@ -2566,8 +2578,10 @@ module .exports = class OutlineView extends Interface
|
|
|
2566
2578
|
|
|
2567
2579
|
child
|
|
2568
2580
|
.removeAttr ("tabindex")
|
|
2569
|
-
.find (".jstree-anchor
|
|
2570
|
-
.
|
|
2581
|
+
.find (".jstree-anchor")
|
|
2582
|
+
.removeAttr ("href")
|
|
2583
|
+
.removeAttr ("tabindex")
|
|
2584
|
+
.on ("click", this .selectNone .bind (this));
|
|
2571
2585
|
|
|
2572
2586
|
child .find (".jstree-ocl")
|
|
2573
2587
|
.addClass ("material-icons")
|
|
@@ -2577,7 +2591,8 @@ module .exports = class OutlineView extends Interface
|
|
|
2577
2591
|
|
|
2578
2592
|
child .find (".jstree-node")
|
|
2579
2593
|
.wrapInner ("<div class=\"item no-select\"/>")
|
|
2580
|
-
.find (".item")
|
|
2594
|
+
.find (".item")
|
|
2595
|
+
.append ("<div class=\"route-curves-wrapper\"><canvas class=\"route-curves\"></canvas></div>");
|
|
2581
2596
|
|
|
2582
2597
|
this .connectFieldActions (child);
|
|
2583
2598
|
|
|
@@ -2926,7 +2941,7 @@ module .exports = class OutlineView extends Interface
|
|
|
2926
2941
|
|
|
2927
2942
|
fieldBeforeOpen (event, leaf)
|
|
2928
2943
|
{
|
|
2929
|
-
const element = $(
|
|
2944
|
+
const element = $(`#${leaf .node .id}`);
|
|
2930
2945
|
|
|
2931
2946
|
if (element .hasClass ("proto"))
|
|
2932
2947
|
{
|
|
@@ -3533,10 +3548,10 @@ module .exports = class OutlineView extends Interface
|
|
|
3533
3548
|
element = $(event .currentTarget) .closest (".node, .externproto, .proto, .imported-node, .exported-node"),
|
|
3534
3549
|
add = event .shiftKey || event .metaKey;
|
|
3535
3550
|
|
|
3536
|
-
if (element .is (".node"))
|
|
3551
|
+
if (element .is (".node, .imported-node"))
|
|
3537
3552
|
this .selectNodeElement (element, { add, target: true });
|
|
3538
3553
|
|
|
3539
|
-
else if (element .is (".externproto, .proto, .
|
|
3554
|
+
else if (element .is (".externproto, .proto, .exported-node"))
|
|
3540
3555
|
this .selectPrimaryElement (element, { add, target: true });
|
|
3541
3556
|
}
|
|
3542
3557
|
|
|
@@ -3544,7 +3559,7 @@ module .exports = class OutlineView extends Interface
|
|
|
3544
3559
|
|
|
3545
3560
|
selectNodeElement (element, { add = false, target = false } = { })
|
|
3546
3561
|
{
|
|
3547
|
-
if (!element .is (".node"))
|
|
3562
|
+
if (!element .is (".node, .imported-node"))
|
|
3548
3563
|
return;
|
|
3549
3564
|
|
|
3550
3565
|
if (!this .isEditable (element))
|
|
@@ -3556,7 +3571,8 @@ module .exports = class OutlineView extends Interface
|
|
|
3556
3571
|
selected = element .hasClass ("manually"),
|
|
3557
3572
|
selectedElements = this .sceneGraph .find (".primary, .selected"),
|
|
3558
3573
|
node = this .getNode (element),
|
|
3559
|
-
elements = $(
|
|
3574
|
+
elements = $(`:is(.node, .imported-node)[node-id='${node ?.getId ()}']`),
|
|
3575
|
+
importedNodes = element .closest (".imported-nodes") .length;
|
|
3560
3576
|
|
|
3561
3577
|
selectedElements .removeClass ("primary");
|
|
3562
3578
|
|
|
@@ -3578,21 +3594,25 @@ module .exports = class OutlineView extends Interface
|
|
|
3578
3594
|
}
|
|
3579
3595
|
else
|
|
3580
3596
|
{
|
|
3597
|
+
elements .addClass ("selected");
|
|
3581
3598
|
element .addClass (["primary", "manually", "selected"]);
|
|
3582
3599
|
}
|
|
3583
3600
|
|
|
3584
|
-
if (
|
|
3601
|
+
if (!importedNodes)
|
|
3585
3602
|
{
|
|
3586
|
-
if (
|
|
3587
|
-
|
|
3603
|
+
if (elements .filter (".manually") .length)
|
|
3604
|
+
{
|
|
3605
|
+
if (target)
|
|
3606
|
+
hierarchy .target (node);
|
|
3588
3607
|
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3608
|
+
selection .add (node);
|
|
3609
|
+
hierarchy .add (node);
|
|
3610
|
+
}
|
|
3611
|
+
else
|
|
3612
|
+
{
|
|
3613
|
+
selection .remove (node);
|
|
3614
|
+
hierarchy .remove (node);
|
|
3615
|
+
}
|
|
3596
3616
|
}
|
|
3597
3617
|
}
|
|
3598
3618
|
else
|
|
@@ -3601,11 +3621,14 @@ module .exports = class OutlineView extends Interface
|
|
|
3601
3621
|
element .addClass (["primary", "manually"]);
|
|
3602
3622
|
elements .addClass ("selected");
|
|
3603
3623
|
|
|
3604
|
-
if (
|
|
3605
|
-
|
|
3624
|
+
if (!importedNodes)
|
|
3625
|
+
{
|
|
3626
|
+
if (target)
|
|
3627
|
+
hierarchy .target (node);
|
|
3606
3628
|
|
|
3607
|
-
|
|
3608
|
-
|
|
3629
|
+
selection .set (node);
|
|
3630
|
+
hierarchy .set (node);
|
|
3631
|
+
}
|
|
3609
3632
|
}
|
|
3610
3633
|
|
|
3611
3634
|
// Prevent update tree view.
|
|
@@ -4083,7 +4106,7 @@ module .exports = class OutlineView extends Interface
|
|
|
4083
4106
|
if (element .data ("expanded"))
|
|
4084
4107
|
{
|
|
4085
4108
|
expanded .push ({
|
|
4086
|
-
path: path .join ("
|
|
4109
|
+
path: path .join (","),
|
|
4087
4110
|
fullExpanded: element .data ("full-expanded"),
|
|
4088
4111
|
});
|
|
4089
4112
|
}
|
|
@@ -4106,11 +4129,24 @@ module .exports = class OutlineView extends Interface
|
|
|
4106
4129
|
scrollLeft: 0,
|
|
4107
4130
|
});
|
|
4108
4131
|
|
|
4132
|
+
// Convert legacy ":" separator to ",". 2026-10-01
|
|
4133
|
+
this .config .file .expanded = this .config .file .expanded .map (row =>
|
|
4134
|
+
{
|
|
4135
|
+
if (row .path .match (/^\d+:/))
|
|
4136
|
+
row .path = row .path .split (":") .join (",");
|
|
4137
|
+
|
|
4138
|
+
return row;
|
|
4139
|
+
});
|
|
4140
|
+
|
|
4109
4141
|
for (const row of this .config .file .expanded)
|
|
4110
4142
|
expanded .set (row .path, row);
|
|
4111
4143
|
|
|
4144
|
+
this .#autoExpand = false;
|
|
4145
|
+
|
|
4112
4146
|
this .restoreExpandedNodes (this .sceneGraph .find ("> div > ul > li"), [ ], expanded);
|
|
4113
4147
|
|
|
4148
|
+
this .#autoExpand = true;
|
|
4149
|
+
|
|
4114
4150
|
this .treeView .scrollTop (this .config .file .scrollTop);
|
|
4115
4151
|
this .treeView .scrollLeft (this .config .file .scrollLeft);
|
|
4116
4152
|
}
|
|
@@ -4123,7 +4159,7 @@ module .exports = class OutlineView extends Interface
|
|
|
4123
4159
|
|
|
4124
4160
|
path .push (element .hasClass ("field") ? this .getField (element) .getName () : i);
|
|
4125
4161
|
|
|
4126
|
-
const data = expanded .get (path .join ("
|
|
4162
|
+
const data = expanded .get (path .join (","));
|
|
4127
4163
|
|
|
4128
4164
|
if (data)
|
|
4129
4165
|
{
|