sunrize 1.5.13 → 1.6.0

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 (41) hide show
  1. package/package.json +5 -5
  2. package/src/Application/Application.js +2 -7
  3. package/src/Application/Dashboard.js +10 -10
  4. package/src/Application/DataStorage.js +177 -177
  5. package/src/Application/Document.js +72 -127
  6. package/src/Application/Interface.js +4 -0
  7. package/src/Application/Tabs.js +3 -3
  8. package/src/Controls/Dialog.js +3 -1
  9. package/src/Editors/BrowserFrame.js +171 -0
  10. package/src/Editors/OutlineEditor.js +149 -123
  11. package/src/Editors/OutlineRouteGraph.js +493 -493
  12. package/src/Editors/OutlineView.js +102 -64
  13. package/src/Editors/SceneProperties.js +137 -136
  14. package/src/Editors/ScriptEditor.js +1 -1
  15. package/src/Tools/Core/X3DNodeTool.js +66 -12
  16. package/src/Tools/Grids/AngleGridTool.js +0 -5
  17. package/src/Tools/Grids/AngleGridTool.x3d +1 -0
  18. package/src/Tools/Grids/AxonometricGrid.x3d +5 -5
  19. package/src/Tools/Grids/AxonometricGridTool.js +0 -5
  20. package/src/Tools/Grids/AxonometricGridTool.x3d +1 -0
  21. package/src/Tools/Grids/GridTool.js +0 -5
  22. package/src/Tools/Grids/GridTool.x3d +1 -0
  23. package/src/Tools/Grids/X3DGridNodeTool.js +131 -84
  24. package/src/Tools/Grouping/X3DTransformNodeTool.js +19 -21
  25. package/src/Tools/Grouping/X3DTransformNodeTool.x3d +20 -15
  26. package/src/Tools/Layering/X3DActiveLayerNodeTool.js +16 -21
  27. package/src/Tools/Lighting/DirectionalLightTool.js +32 -1
  28. package/src/Tools/Lighting/X3DLightNodeTool.x3d +4 -21
  29. package/src/Tools/Shaders/TextureShader.x3d +16 -3
  30. package/src/Tools/SnapTool/{SnapSourceTool.js → SnapSource.js} +2 -7
  31. package/src/Tools/SnapTool/SnapTarget.js +650 -0
  32. package/src/Tools/SnapTool/SnapTool.x3d +28 -27
  33. package/src/Tools/SnapTool/X3DSnapNodeTool.js +16 -15
  34. package/src/Tools/Sound/SoundTool.x3d +4 -21
  35. package/src/Tools/TextureProjection/X3DTextureProjectorNodeTool.x3d +19 -26
  36. package/src/Undo/Editor.js +185 -46
  37. package/src/assets/Info.plist +56 -56
  38. package/src/assets/themes/default-template.css +1 -0
  39. package/src/assets/themes/default.css +1 -0
  40. package/src/Editors/BrowserSize.js +0 -101
  41. package/src/Tools/SnapTool/SnapTargetTool.js +0 -20
@@ -52,6 +52,8 @@ module .exports = class OutlineView extends Interface
52
52
  .on ("dragend", this .onDragEnd .bind (this))
53
53
  .appendTo (this .treeView);
54
54
 
55
+ this .browser ._activeLayer .addInterest ("updateActiveLayer", this);
56
+
55
57
  electron .ipcRenderer .on ("deselect-all", () => this .deselectAll ());
56
58
  electron .ipcRenderer .on ("hide-unselected-objects", () => this .hideUnselectedObjects ());
57
59
  electron .ipcRenderer .on ("show-selected-objects", () => this .showSelectedObjects ());
@@ -259,16 +261,19 @@ module .exports = class OutlineView extends Interface
259
261
  child .find (".node .name")
260
262
  .on ("mouseenter", this .updateNodeTitle .bind (this));
261
263
 
262
- child .find (".visibility")
264
+ child .find (".toggle-visibility")
263
265
  .on ("click", this .toggleVisibility .bind (this));
264
266
 
265
- child .find (".tool")
267
+ child .find (".toggle-tool")
266
268
  .on ("click", this .toggleTool .bind (this));
267
269
 
268
- child .find (".bind")
270
+ child .find (".activate-layer")
271
+ .on ("click", this .activateLayer .bind (this));
272
+
273
+ child .find (".bind-node")
269
274
  .on ("click", this .bindNode .bind (this));
270
275
 
271
- child .find (".reload")
276
+ child .find (".reload-node")
272
277
  .on ("click", this .reloadNode .bind (this));
273
278
 
274
279
  // Expand children.
@@ -984,7 +989,7 @@ module .exports = class OutlineView extends Interface
984
989
  name .append (document .createTextNode (" "));
985
990
 
986
991
  $("<span></span>")
987
- .addClass (["visibility", "button", "material-symbols-outlined"])
992
+ .addClass (["toggle-visibility", "button", "material-symbols-outlined"])
988
993
  .addClass (node .isHidden () ? "off" : "")
989
994
  .attr ("title", "Toggle visibility.")
990
995
  .text (node .isHidden () ? "visibility_off" : "visibility")
@@ -996,7 +1001,7 @@ module .exports = class OutlineView extends Interface
996
1001
  name .append (document .createTextNode (" "));
997
1002
 
998
1003
  $("<span></span>")
999
- .addClass (["tool", "button", "material-symbols-outlined"])
1004
+ .addClass (["toggle-tool", "button", "material-symbols-outlined"])
1000
1005
  .addClass (node .valueOf () === node ? "off" : "")
1001
1006
  .attr ("title", _("Toggle display tool."))
1002
1007
  .text ("build_circle")
@@ -1007,6 +1012,19 @@ module .exports = class OutlineView extends Interface
1007
1012
  {
1008
1013
  switch (type)
1009
1014
  {
1015
+ case X3D .X3DConstants .X3DLayerNode:
1016
+ {
1017
+ name .append (document .createTextNode (" "));
1018
+
1019
+ $("<span></span>")
1020
+ .addClass (["activate-layer", "button", "material-symbols-outlined"])
1021
+ .addClass (this .browser .getActiveLayer () === node ? "green" : "off")
1022
+ .attr ("title", _("Activate layer."))
1023
+ .text ("check_circle")
1024
+ .appendTo (name);
1025
+
1026
+ continue;
1027
+ }
1010
1028
  case X3D .X3DConstants .X3DBindableNode:
1011
1029
  {
1012
1030
  node ._isBound .addFieldCallback (this .#updateNodeBoundSymbol, this .updateNodeBound .bind (this, node));
@@ -1014,7 +1032,7 @@ module .exports = class OutlineView extends Interface
1014
1032
  name .append (document .createTextNode (" "));
1015
1033
 
1016
1034
  $("<span></span>")
1017
- .addClass (["bind", "button", "material-symbols-outlined"])
1035
+ .addClass (["bind-node", "button", "material-symbols-outlined"])
1018
1036
  .addClass (node ._isBound .getValue () ? "" : "off")
1019
1037
  .attr ("title", _("Bind node."))
1020
1038
  .text (node ._isBound .getValue () ? "radio_button_checked" : "radio_button_unchecked")
@@ -1037,7 +1055,7 @@ module .exports = class OutlineView extends Interface
1037
1055
  name .append (document .createTextNode (" "));
1038
1056
 
1039
1057
  $("<span></span>")
1040
- .addClass (["reload", "button", "material-symbols-outlined", className])
1058
+ .addClass (["reload-node", "button", "material-symbols-outlined", className])
1041
1059
  .attr ("title", "Load now.")
1042
1060
  .text ("autorenew")
1043
1061
  .appendTo (name);
@@ -1104,11 +1122,24 @@ module .exports = class OutlineView extends Interface
1104
1122
  .text (cloneCount > 1 ? `[${cloneCount}]` : "")
1105
1123
  }
1106
1124
 
1125
+ updateActiveLayer ()
1126
+ {
1127
+ this .sceneGraph .find (".activate-layer") .removeClass ("green") .addClass ("off");
1128
+
1129
+ if (!this .browser .getActiveLayer ())
1130
+ return;
1131
+
1132
+ this .sceneGraph .find (`.node[node-id=${this .browser .getActiveLayer () .getId ()}]`)
1133
+ .find ("> .item .activate-layer")
1134
+ .removeClass ("off")
1135
+ .addClass ("green");
1136
+ }
1137
+
1107
1138
  updateNodeBound (node)
1108
1139
  {
1109
1140
  this .sceneGraph
1110
1141
  .find (`.node[node-id=${node .getId ()}]`)
1111
- .find ("> .item .bind")
1142
+ .find ("> .item .bind-node")
1112
1143
  .removeClass ("off")
1113
1144
  .addClass (node ._isBound .getValue () ? "" : "off")
1114
1145
  .text (node ._isBound .getValue () ? "radio_button_checked" : "radio_button_unchecked");
@@ -1120,7 +1151,7 @@ module .exports = class OutlineView extends Interface
1120
1151
 
1121
1152
  this .sceneGraph
1122
1153
  .find (`.node[node-id=${node .getId ()}],.externproto[node-id=${node .getId ()}]`)
1123
- .find ("> .item .reload")
1154
+ .find ("> .item .reload-node")
1124
1155
  .removeClass (["not-started-state", "in-progress-state", "complete-state", "failed-state"])
1125
1156
  .addClass (className);
1126
1157
  }
@@ -1420,7 +1451,7 @@ module .exports = class OutlineView extends Interface
1420
1451
  {
1421
1452
  case X3D .X3DConstants .initializeOnly:
1422
1453
  {
1423
- break;
1454
+ break;
1424
1455
  }
1425
1456
  case X3D .X3DConstants .inputOnly:
1426
1457
  {
@@ -1504,7 +1535,7 @@ module .exports = class OutlineView extends Interface
1504
1535
  if (field .getOutputRoutes () .size)
1505
1536
  outputRoutesSelector .attr ("href", "#");
1506
1537
 
1507
- break;
1538
+ break;
1508
1539
  }
1509
1540
  }
1510
1541
 
@@ -1522,7 +1553,7 @@ module .exports = class OutlineView extends Interface
1522
1553
  {
1523
1554
  case X3D .X3DConstants .initializeOnly:
1524
1555
  {
1525
- break;
1556
+ break;
1526
1557
  }
1527
1558
  case X3D .X3DConstants .inputOnly:
1528
1559
  {
@@ -1531,7 +1562,7 @@ module .exports = class OutlineView extends Interface
1531
1562
  .attr ("src", this .getAccessTypeImage (field, "input"))
1532
1563
  .appendTo (accessType);
1533
1564
 
1534
- break;
1565
+ break;
1535
1566
  }
1536
1567
  case X3D .X3DConstants .outputOnly:
1537
1568
  {
@@ -1540,7 +1571,7 @@ module .exports = class OutlineView extends Interface
1540
1571
  .attr ("src", this .getAccessTypeImage (field, "output"))
1541
1572
  .appendTo (accessType);
1542
1573
 
1543
- break;
1574
+ break;
1544
1575
  }
1545
1576
  case X3D .X3DConstants .inputOutput:
1546
1577
  {
@@ -1679,11 +1710,11 @@ module .exports = class OutlineView extends Interface
1679
1710
  {
1680
1711
  case "input":
1681
1712
  {
1682
- return "../images/OutlineEditor/AccessTypes/inputOnly.active.png"
1713
+ return "../images/OutlineEditor/AccessTypes/inputOnly.active.png"
1683
1714
  }
1684
1715
  case "output":
1685
1716
  {
1686
- return "../images/OutlineEditor/AccessTypes/outputOnly.active.png"
1717
+ return "../images/OutlineEditor/AccessTypes/outputOnly.active.png"
1687
1718
  }
1688
1719
  }
1689
1720
  }
@@ -1695,15 +1726,15 @@ module .exports = class OutlineView extends Interface
1695
1726
  {
1696
1727
  switch (field .getInputRoutes () .size)
1697
1728
  {
1698
- case 0:
1699
- accessTypeImage += ".0"
1700
- break
1701
- case 1:
1702
- accessTypeImage += ".1"
1703
- break
1704
- default:
1705
- accessTypeImage += ".2"
1706
- break
1729
+ case 0:
1730
+ accessTypeImage += ".0"
1731
+ break
1732
+ case 1:
1733
+ accessTypeImage += ".1"
1734
+ break
1735
+ default:
1736
+ accessTypeImage += ".2"
1737
+ break
1707
1738
  }
1708
1739
  }
1709
1740
 
@@ -1711,15 +1742,15 @@ module .exports = class OutlineView extends Interface
1711
1742
  {
1712
1743
  switch (field .getOutputRoutes () .size)
1713
1744
  {
1714
- case 0:
1715
- accessTypeImage += ".0"
1716
- break
1717
- case 1:
1718
- accessTypeImage += ".1"
1719
- break
1720
- default:
1721
- accessTypeImage += ".2"
1722
- break
1745
+ case 0:
1746
+ accessTypeImage += ".0"
1747
+ break
1748
+ case 1:
1749
+ accessTypeImage += ".1"
1750
+ break
1751
+ default:
1752
+ accessTypeImage += ".2"
1753
+ break
1723
1754
  }
1724
1755
  }
1725
1756
 
@@ -1913,16 +1944,19 @@ module .exports = class OutlineView extends Interface
1913
1944
  child .find (".node .name")
1914
1945
  .on ("mouseenter", this .updateNodeTitle .bind (this));
1915
1946
 
1916
- child .find (".visibility")
1947
+ child .find (".toggle-visibility")
1917
1948
  .on ("click", this .toggleVisibility .bind (this))
1918
1949
 
1919
- child .find (".tool")
1950
+ child .find (".toggle-tool")
1920
1951
  .on ("click", this .toggleTool .bind (this))
1921
1952
 
1922
- child .find (".bind")
1953
+ child .find (".activate-layer")
1954
+ .on ("click", this .activateLayer .bind (this));
1955
+
1956
+ child .find (".bind-node")
1923
1957
  .on ("click", this .bindNode .bind (this))
1924
1958
 
1925
- child .find (".reload")
1959
+ child .find (".reload-node")
1926
1960
  .on ("click", this .reloadNode .bind (this))
1927
1961
 
1928
1962
  child .find ("area.input-selector")
@@ -2025,18 +2059,21 @@ module .exports = class OutlineView extends Interface
2025
2059
  }
2026
2060
 
2027
2061
  child .find (".node .name")
2028
- .on ("mouseenter", this .updateNodeTitle .bind (this));;
2062
+ .on ("mouseenter", this .updateNodeTitle .bind (this));
2029
2063
 
2030
- child .find (".visibility")
2064
+ child .find (".toggle-visibility")
2031
2065
  .on ("click", this .toggleVisibility .bind (this));
2032
2066
 
2033
- child .find (".tool")
2067
+ child .find (".toggle-tool")
2034
2068
  .on ("click", this .toggleTool .bind (this));
2035
2069
 
2036
- child .find (".bind")
2070
+ child .find (".activate-layer")
2071
+ .on ("click", this .activateLayer .bind (this));
2072
+
2073
+ child .find (".bind-node")
2037
2074
  .on ("click", this .bindNode .bind (this))
2038
2075
 
2039
- child .find (".reload")
2076
+ child .find (".reload-node")
2040
2077
  .on ("click", this .reloadNode .bind (this));
2041
2078
 
2042
2079
  child .find ("area.input-selector")
@@ -2895,7 +2932,7 @@ module .exports = class OutlineView extends Interface
2895
2932
  node .setHidden (hidden);
2896
2933
 
2897
2934
  this .sceneGraph .find (`.node[node-id=${node .getId ()}]`)
2898
- .find ("> .item .visibility")
2935
+ .find ("> .item .toggle-visibility")
2899
2936
  .removeClass ("off")
2900
2937
  .addClass (hidden ? "off" : "")
2901
2938
  .text (hidden ? "visibility_off" : "visibility");
@@ -2924,12 +2961,13 @@ module .exports = class OutlineView extends Interface
2924
2961
 
2925
2962
  node .setUserData (_changing, true);
2926
2963
 
2927
- this .sceneGraph .find (`.node[node-id=${node .getId ()}]`)
2928
- .find ("> .item .tool")
2964
+ this .sceneGraph .find (`.node[node-id=${node .getId ()}] > .item .toggle-tool`)
2929
2965
  .removeClass ("off")
2930
2966
  .addClass (tool ? "off" : "");
2931
2967
  }
2932
2968
 
2969
+ activateLayer (event) { }
2970
+
2933
2971
  bindNode (event)
2934
2972
  {
2935
2973
  event .preventDefault ();
@@ -2971,7 +3009,7 @@ module .exports = class OutlineView extends Interface
2971
3009
  node .setHidden (node .getType () .includes (X3D .X3DConstants .X3DShapeNode))
2972
3010
 
2973
3011
  this .sceneGraph .find (`.node[node-id=${node .getId ()}]`)
2974
- .find ("> .item .visibility")
3012
+ .find ("> .item .toggle-visibility")
2975
3013
  .removeClass ("off")
2976
3014
  .addClass (node .isHidden () ? "off" : "")
2977
3015
  .text (node .isHidden () ? "visibility_off" : "visibility")
@@ -2992,7 +3030,7 @@ module .exports = class OutlineView extends Interface
2992
3030
  node .setHidden (false)
2993
3031
 
2994
3032
  this .sceneGraph .find (`.node[node-id=${node .getId ()}]`)
2995
- .find ("> .item .visibility")
3033
+ .find ("> .item .toggle-visibility")
2996
3034
  .removeClass ("off")
2997
3035
  .text ("visibility")
2998
3036
  })
@@ -3010,7 +3048,7 @@ module .exports = class OutlineView extends Interface
3010
3048
  node .setHidden (false)
3011
3049
 
3012
3050
  this .sceneGraph .find (`.node[node-id=${node .getId ()}]`)
3013
- .find ("> .item .visibility")
3051
+ .find ("> .item .toggle-visibility")
3014
3052
  .removeClass ("off")
3015
3053
  .text ("visibility")
3016
3054
  })
@@ -3026,7 +3064,7 @@ module .exports = class OutlineView extends Interface
3026
3064
  node .setHidden (false)
3027
3065
 
3028
3066
  this .sceneGraph .find (`.node[node-id=${node .getId ()}]`)
3029
- .find ("> .item .visibility")
3067
+ .find ("> .item .toggle-visibility")
3030
3068
  .removeClass ("off")
3031
3069
  .text ("visibility")
3032
3070
  })
@@ -3269,18 +3307,18 @@ module .exports = class OutlineView extends Interface
3269
3307
  return this .objects .get (parseInt (element .attr ("field-id")));
3270
3308
  }
3271
3309
 
3272
- getRoute (element, routes)
3273
- {
3274
- const id = parseInt (element .attr ("route-id"));
3310
+ getRoute (element, routes)
3311
+ {
3312
+ const id = parseInt (element .attr ("route-id"));
3275
3313
 
3276
- for (const route of routes)
3277
- {
3278
- if (route .getId () === id)
3279
- return route;
3280
- }
3314
+ for (const route of routes)
3315
+ {
3316
+ if (route .getId () === id)
3317
+ return route;
3318
+ }
3281
3319
 
3282
- return null;
3283
- }
3320
+ return null;
3321
+ }
3284
3322
 
3285
3323
  onresize ()
3286
3324
  {
@@ -3336,7 +3374,7 @@ module .exports = class OutlineView extends Interface
3336
3374
 
3337
3375
  addUrlField (button) { }
3338
3376
 
3339
- removeFieldButtons (buttons)
3377
+ removeFieldButtons (buttons)
3340
3378
  {
3341
3379
  buttons .each ((i, e) => this .removeColorField ($(e)));
3342
3380
  }
@@ -3530,8 +3568,8 @@ module .exports = class OutlineView extends Interface
3530
3568
  if (element .data ("expanded"))
3531
3569
  {
3532
3570
  expanded .push ({
3533
- path: path .join (":"),
3534
- fullExpanded: element .data ("full-expanded"),
3571
+ path: path .join (":"),
3572
+ fullExpanded: element .data ("full-expanded"),
3535
3573
  });
3536
3574
  }
3537
3575