sunrize 2.3.5 → 2.4.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sunrize",
3
3
  "productName": "Sunrize X3D Editor",
4
- "version": "2.3.5",
4
+ "version": "2.4.0",
5
5
  "description": "Sunrize — A Multi-Platform X3D Editor",
6
6
  "main": "src/main.js",
7
7
  "bin": {
@@ -83,23 +83,23 @@
83
83
  "url": "https://patreon.com/X_ITE"
84
84
  },
85
85
  "devDependencies": {
86
- "@electron-forge/cli": "^7.11.2",
87
- "@electron-forge/maker-deb": "^7.11.2",
88
- "@electron-forge/maker-dmg": "^7.11.2",
89
- "@electron-forge/maker-rpm": "^7.11.2",
90
- "@electron-forge/maker-squirrel": "^7.11.2",
91
- "@electron-forge/maker-zip": "^7.11.2",
92
- "@electron-forge/publisher-github": "^7.11.2",
86
+ "@electron-forge/cli": "^8.0.1",
87
+ "@electron-forge/maker-deb": "^8.0.1",
88
+ "@electron-forge/maker-dmg": "^8.0.1",
89
+ "@electron-forge/maker-rpm": "^8.0.1",
90
+ "@electron-forge/maker-squirrel": "^8.0.1",
91
+ "@electron-forge/maker-zip": "^8.0.1",
92
+ "@electron-forge/publisher-github": "^8.0.1",
93
93
  "@eslint/js": "^10.0.1",
94
- "eslint": "^10.11.0",
95
- "globals": "^17.12.0",
94
+ "eslint": "^10.12.0",
95
+ "globals": "^17.13.0",
96
96
  "shell-tools": "^1.1.9"
97
97
  },
98
98
  "dependencies": {
99
99
  "@vscode/codicons": "^0.0.45",
100
100
  "capitalize": "^2.0.4",
101
101
  "console": "^0.7.2",
102
- "electron": "^44.4.3",
102
+ "electron": "^44.5.1",
103
103
  "electron-prompt": "^1.7.0",
104
104
  "electron-squirrel-startup": "^1.0.1",
105
105
  "electron-tabs": "^1.0.4",
@@ -108,7 +108,7 @@
108
108
  "jquery-ui-dist": "^1.13.3",
109
109
  "jstree": "^3.3.17",
110
110
  "material-icons": "^1.13.14",
111
- "material-symbols": "^0.47.4",
111
+ "material-symbols": "^0.47.6",
112
112
  "md5": "^2.3.0",
113
113
  "mime-types": "^3.0.2",
114
114
  "monaco-editor": "^0.55.1",
@@ -118,7 +118,7 @@
118
118
  "string-similarity": "^4.0.4",
119
119
  "tweakpane": "^4.0.5",
120
120
  "update-electron-app": "^3.3.0",
121
- "x_ite": "^16.4.0",
121
+ "x_ite": "^16.4.2",
122
122
  "x_ite-off-parser": "^1.3.0",
123
123
  "x_ite-sog-parser": "^2.1.0",
124
124
  "x_ite-spz-parser": "^2.1.0",
@@ -97,7 +97,7 @@ module .exports = class Application
97
97
  electron .ipcMain .on ("current-file", (event, currentFile) => this .currentFile = currentFile);
98
98
  electron .ipcMain .on ("add-recent-location", (event, fileURL) => this .addRecentLocation (fileURL));
99
99
  electron .ipcMain .on ("update-menu", (event, options) => this .updateMenu (options));
100
- electron .ipcMain .on ("context-menu", (event, id, menu) => this .contextMenu (id, menu));
100
+ electron .ipcMain .on ("context-menu", (event, ... args) => this .contextMenu (... args));
101
101
 
102
102
  electron .ipcMain .handle ("open-files", async (event, urls) => this .openFiles (urls));
103
103
  electron .ipcMain .handle ("file-path", async (event, options) => await this .showDialog (options));
@@ -966,11 +966,11 @@ module .exports = class Application
966
966
  this .createWindow ();
967
967
  }
968
968
 
969
- contextMenu (id, menu)
969
+ contextMenu (id, menu, menuId)
970
970
  {
971
971
  const contextMenu = electron .Menu .buildFromTemplate (this .addMenuItemHandlers (id, this .filterSeparators (menu)));
972
972
 
973
- contextMenu .on ("menu-will-close", () => this .mainWindow .webContents .send (`${id}-will-close`));
973
+ contextMenu .on ("menu-will-close", () => this .mainWindow .webContents .send ("context-menu-will-close", menuId));
974
974
 
975
975
  contextMenu .popup ({ window: this .mainWindow });
976
976
  }
@@ -955,7 +955,7 @@ module .exports = class Document extends Interface
955
955
  grid ._visible .addInterest ("updateMenu", this);
956
956
  tool .getValue () .getField ("isActive") .addInterest ("handleUndoForGrid", this, typeName);
957
957
 
958
- UndoManager .shared .beginUndo (_ ("Change Visibility of %s"), typeName);
958
+ UndoManager .shared .beginUndo (_("Change Visibility of %s"), typeName);
959
959
 
960
960
  if (visible)
961
961
  {
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  const
4
- Tabs = require ("../Controls/Tabs"),
5
- Console = require ("../Editors/Console"),
6
- $ = require ("jquery"),
7
- _ = require ("./GetText");
4
+ Tabs = require ("../Controls/Tabs"),
5
+ Console = require ("../Editors/Console"),
6
+ RouteGraph = require ("../Editors/RouteGraph"),
7
+ $ = require ("jquery"),
8
+ _ = require ("./GetText");
8
9
 
9
10
  module .exports = class Footer extends Tabs
10
11
  {
@@ -26,11 +27,15 @@ module .exports = class Footer extends Tabs
26
27
  this .addIconTextTab ("animation-editor","animation", _("Animation Editor"))
27
28
  .find (".material-icons") .css ("color", "hsl(246, 40%, 48%)");
28
29
 
30
+ this .addIconTextTab ("route-graph","route", _("Route Graph"))
31
+ .find (".material-icons") .css ("color", "hsl(281, 40%, 48%)");
32
+
29
33
  $("<div></div>")
30
34
  .addClass (["toolbar", "vertical-toolbar"])
31
35
  .appendTo (this .element);
32
36
 
33
- this .console = new Console (this .getPanel ("console"));
37
+ this .console = new Console (this .getPanel ("console"));
38
+ this .routeGraph = new RouteGraph (this .getPanel ("route-graph"));
34
39
  }
35
40
 
36
41
  initTab (panel)
@@ -131,7 +131,9 @@ module .exports = new class Tabs
131
131
  this .forwardToActiveTab ("document");
132
132
  this .forwardToActiveTab ("script-editor");
133
133
  this .forwardToActiveTab ("animation-members-list");
134
+ this .forwardToActiveTab ("route-graph");
134
135
  this .forwardToActiveTab ("outline-editor");
136
+ this .forwardToActiveTab ("context-menu-will-close");
135
137
 
136
138
  // Restore tabs.
137
139
  this .restoreTabs (this .config .activeTab);
@@ -325,8 +327,8 @@ module .exports = new class Tabs
325
327
 
326
328
  const menu = [
327
329
  {
328
- label: tab .url .startsWith ("file:") ? _("Copy Path") : _("Copy URL"),
329
- visible: !tab .url .startsWith ("id:"),
330
+ label: tab .url .startsWith ("file:") || tab .url .startsWith ("id:") ? _("Copy Path") : _("Copy URL"),
331
+ enabled: !tab .url .startsWith ("id:"),
330
332
  args: ["menuCopyURL", tab .getPosition ()],
331
333
  },
332
334
  {
@@ -339,7 +341,7 @@ module .exports = new class Tabs
339
341
  default: return _("Reveal File in File Manager");
340
342
  }
341
343
  })(),
342
- visible: tab .url .startsWith ("file:"),
344
+ enabled: tab .url .startsWith ("file:"),
343
345
  args: ["menuShowItemInFolder", tab .getPosition ()],
344
346
  },
345
347
  { type: "separator" },
@@ -394,8 +396,14 @@ module .exports = new class Tabs
394
396
  },
395
397
  ];
396
398
 
397
- electron .ipcRenderer .send ("context-menu", "tabs-menu", menu);
398
- electron .ipcRenderer .once ("tabs-menu-will-close", () => $(tab .element) .trigger ("blur"));
399
+ const menuId = Math .random ();
400
+
401
+ electron .ipcRenderer .send ("context-menu", "tabs-menu", menu, menuId);
402
+ electron .ipcRenderer .once ("context-menu-will-close", (event, id) =>
403
+ {
404
+ if (id === menuId)
405
+ $(tab .element) .trigger ("blur");
406
+ });
399
407
  }
400
408
 
401
409
  menuCopyURL (position)
@@ -15,7 +15,4 @@ X3DUOM .find ("ConcreteNodes") .append (X_ITE .find ("ConcreteNode"));
15
15
  X3DUOM .find ("AbstractNodeType[name=X3DOneSidedMaterialNode]")
16
16
  .append (X3DUOM .find ("field[name=emissiveColor]") .first () .clone ());
17
17
 
18
- // detune fix
19
- X3DUOM .find ("field[name=detune]") .removeAttr ("minInclusive");
20
-
21
18
  module .exports = X3DUOM;
@@ -21,7 +21,7 @@ module .exports = class Tabs extends Interface
21
21
 
22
22
  this .element .tabs ();
23
23
  this .element .tabs ("option", "classes.ui-tabs", this .orientation);
24
- this .element .on ("tabsactivate", () => this .tabActivated ());
24
+ this .element .on ("tabsactivate", () => this .activateTab ());
25
25
  }
26
26
 
27
27
  addTabs () { }
@@ -31,12 +31,12 @@ module .exports = class Tabs extends Interface
31
31
  this .config .file .setDefaultValues (Object .assign ({ active: 0 }, defaults));
32
32
 
33
33
  if (this .element .tabs ("option", "active") === this .config .file .active)
34
- this .tabActivated ();
34
+ this .activateTab ();
35
35
  else
36
36
  this .element .tabs ("option", "active", this .config .file .active);
37
37
  }
38
38
 
39
- tabActivated ()
39
+ activateTab ()
40
40
  {
41
41
  const
42
42
  active = this .element .tabs ("option", "active"),
@@ -48,6 +48,7 @@ module .exports = class Tabs extends Interface
48
48
  return;
49
49
 
50
50
  panel .data ("Tabs.initialized", true);
51
+
51
52
  this .initTab (panel);
52
53
  }
53
54
 
@@ -16,10 +16,14 @@ require ("../Bits/Validate");
16
16
 
17
17
  module .exports = class AnimationEditor extends Interface
18
18
  {
19
+ #style = window .getComputedStyle ($("#animation-editor") [0]);
20
+
19
21
  constructor (element)
20
22
  {
21
23
  super (`Sunrize.AnimationEditor.${element .attr ("id")}.`);
22
24
 
25
+ const darwin = process .platform === "darwin";
26
+
23
27
  this .animationEditor = element;
24
28
 
25
29
  this .verticalSplitter = $("<div></div>")
@@ -83,21 +87,27 @@ module .exports = class AnimationEditor extends Interface
83
87
 
84
88
  this .cutFrameIcon = $("<span></span>")
85
89
  .addClass ("material-icons")
86
- .attr ("title", _("Cut selected keyframes."))
90
+ .attr ("title", darwin
91
+ ? _("Cut selected keyframes. (⌘X)")
92
+ : _("Cut selected keyframes. (Ctrl+X)"))
87
93
  .text ("content_cut")
88
94
  .appendTo (this .toolbar)
89
95
  .on ("click", () => this .cutKeyframes ());
90
96
 
91
97
  this .copyFrameIcon = $("<span></span>")
92
98
  .addClass ("material-icons")
93
- .attr ("title", _("Copy selected keyframes."))
99
+ .attr ("title", darwin
100
+ ? _("Copy selected keyframes. (⌘C)")
101
+ : _("Copy selected keyframes. (Ctrl+C)"))
94
102
  .text ("content_copy")
95
103
  .appendTo (this .toolbar)
96
104
  .on ("click", () => this .copyKeyframes ());
97
105
 
98
106
  this .pasteFrameIcon = $("<span></span>")
99
107
  .addClass ("material-icons")
100
- .attr ("title", _("Paste keyframes at current frame."))
108
+ .attr ("title", darwin
109
+ ? _("Paste keyframes at current frame. (⌘V)")
110
+ : _("Paste keyframes at current frame. (Ctrl+V)"))
101
111
  .text ("content_paste")
102
112
  .appendTo (this .toolbar)
103
113
  .on ("click", () => this .pasteKeyframes ());
@@ -113,7 +123,7 @@ module .exports = class AnimationEditor extends Interface
113
123
 
114
124
  this .toggleAnimationIcon = $("<span></span>")
115
125
  .addClass ("material-icons")
116
- .attr ("title", _("Start animation."))
126
+ .attr ("title", _("Start animation. (Space)"))
117
127
  .text ("play_arrow")
118
128
  .appendTo (this .toolbar)
119
129
  .on ("click", () => this .toggleAnimation ());
@@ -180,8 +190,8 @@ module .exports = class AnimationEditor extends Interface
180
190
 
181
191
  this .zoomOutIcon = $("<span></span>")
182
192
  .addClass ("material-icons")
183
- .attr ("title", _("Zoom timeline out."))
184
- .css ("transform", "scale(1.4)")
193
+ .attr ("title", _("Zoom timeline out. (-)"))
194
+ .css ("transform", "scale(1.5)")
185
195
  .css ("margin-bottom", "15px")
186
196
  .text ("zoom_out")
187
197
  .appendTo (this .navigation)
@@ -189,8 +199,8 @@ module .exports = class AnimationEditor extends Interface
189
199
 
190
200
  this .zoomInIcon = $("<span></span>")
191
201
  .addClass ("material-icons")
192
- .attr ("title", _("Zoom timeline in."))
193
- .css ("transform", "scale(1.4)")
202
+ .attr ("title", _("Zoom timeline in. (+)"))
203
+ .css ("transform", "scale(1.5)")
194
204
  .css ("margin-bottom", "15px")
195
205
  .text ("zoom_in")
196
206
  .appendTo (this .navigation)
@@ -198,7 +208,7 @@ module .exports = class AnimationEditor extends Interface
198
208
 
199
209
  this .zoomFitIcon = $("<span></span>")
200
210
  .addClass ("material-icons")
201
- .attr ("title", _("Zoom timeline to fit in window."))
211
+ .attr ("title", _("Zoom timeline to fit in window. (0)"))
202
212
  .css ("transform", "scale(1.4)")
203
213
  .css ("margin-bottom", "15px")
204
214
  .text ("fit_screen")
@@ -207,7 +217,7 @@ module .exports = class AnimationEditor extends Interface
207
217
 
208
218
  this .zoom100Icon = $("<span></span>")
209
219
  .addClass ("material-icons")
210
- .attr ("title", _("Default timeline zoom."))
220
+ .attr ("title", _("Default timeline zoom. (1)"))
211
221
  .css ("transform", "scale(1.4)")
212
222
  .css ("margin-bottom", "15px")
213
223
  .text ("1x_mobiledata")
@@ -406,6 +416,7 @@ module .exports = class AnimationEditor extends Interface
406
416
 
407
417
  this .setSelection (require ("../Application/Selection"));
408
418
  this .zoomFit ();
419
+ this .resizeTimeline ();
409
420
  this .requestDrawTimeline ();
410
421
 
411
422
  this .browser .nextFrame () .then (() => this .setCurrentFrame (0));
@@ -513,7 +524,7 @@ module .exports = class AnimationEditor extends Interface
513
524
  Editor .undoManager .endUndo ();
514
525
 
515
526
  // Wait until NodeList knows animation, to have it restored after reload.
516
- setTimeout (() => this .nodeList .setNode (animation));
527
+ this .browser .nextFrame () .then (() => this .nodeList .setNode (animation));
517
528
  }
518
529
 
519
530
  resizeAnimation (newDuration, newFrameRate, scaleKeyframes)
@@ -2013,80 +2024,83 @@ module .exports = class AnimationEditor extends Interface
2013
2024
  {
2014
2025
  case " ":
2015
2026
  {
2016
- this .toggleAnimation ();
2017
-
2018
2027
  event .preventDefault ();
2019
2028
  event .stopPropagation ();
2029
+
2030
+ this .toggleAnimation ();
2020
2031
  break;
2021
2032
  }
2022
2033
  case "ArrowLeft":
2023
2034
  {
2024
- this .previousFrame ();
2025
-
2026
2035
  event .preventDefault ();
2027
2036
  event .stopPropagation ();
2037
+
2038
+ this .previousFrame ();
2028
2039
  break;
2029
2040
  }
2030
2041
  case "ArrowRight":
2031
2042
  {
2032
- this .nextFrame ();
2033
-
2034
2043
  event .preventDefault ();
2035
2044
  event .stopPropagation ();
2045
+
2046
+ this .nextFrame ();
2036
2047
  break;
2037
2048
  }
2038
2049
  case "ArrowDown":
2039
2050
  {
2040
- this .firstFrame ();
2041
-
2042
2051
  event .preventDefault ();
2043
2052
  event .stopPropagation ();
2053
+
2054
+ this .firstFrame ();
2044
2055
  break;
2045
2056
  }
2046
2057
  case "ArrowUp":
2047
2058
  {
2048
- this .lastFrame ();
2049
-
2050
2059
  event .preventDefault ();
2051
2060
  event .stopPropagation ();
2061
+
2062
+ this .lastFrame ();
2052
2063
  break;
2053
2064
  }
2054
2065
  case "-":
2055
2066
  {
2056
- this .zoomOut ();
2057
-
2058
2067
  event .preventDefault ();
2059
2068
  event .stopPropagation ();
2069
+
2070
+ this .zoomOut ();
2060
2071
  break;
2061
2072
  }
2062
2073
  case "+":
2063
2074
  {
2064
- this .zoomIn ();
2065
-
2066
2075
  event .preventDefault ();
2067
2076
  event .stopPropagation ();
2077
+
2078
+ this .zoomIn ();
2068
2079
  break;
2069
2080
  }
2070
2081
  case "0":
2071
2082
  {
2072
- this .zoomFit ();
2073
-
2074
2083
  event .preventDefault ();
2075
2084
  event .stopPropagation ();
2085
+
2086
+ this .zoomFit ();
2076
2087
  break;
2077
2088
  }
2078
2089
  case "1":
2079
2090
  {
2080
- this .zoom100 ();
2081
-
2082
2091
  event .preventDefault ();
2083
2092
  event .stopPropagation ();
2093
+
2094
+ this .zoom100 ();
2084
2095
  break;
2085
2096
  }
2086
2097
  case "a":
2087
2098
  {
2088
2099
  if (event .metaKey || event .ctrlKey)
2089
2100
  {
2101
+ event .preventDefault ();
2102
+ event .stopPropagation ();
2103
+
2090
2104
  if (event .shiftKey)
2091
2105
  {
2092
2106
  this .setSelectedKeyframes ([ ]);
@@ -2096,9 +2110,6 @@ module .exports = class AnimationEditor extends Interface
2096
2110
  {
2097
2111
  this .setSelectionRange (0, this .getDuration ());
2098
2112
  }
2099
-
2100
- event .preventDefault ();
2101
- event .stopPropagation ();
2102
2113
  }
2103
2114
 
2104
2115
  break;
@@ -2107,10 +2118,10 @@ module .exports = class AnimationEditor extends Interface
2107
2118
  {
2108
2119
  if (event .metaKey || event .ctrlKey)
2109
2120
  {
2110
- this .cutKeyframes ();
2111
-
2112
2121
  event .preventDefault ();
2113
2122
  event .stopPropagation ();
2123
+
2124
+ this .cutKeyframes ();
2114
2125
  }
2115
2126
 
2116
2127
  break;
@@ -2119,10 +2130,10 @@ module .exports = class AnimationEditor extends Interface
2119
2130
  {
2120
2131
  if (event .metaKey || event .ctrlKey)
2121
2132
  {
2122
- this .copyKeyframes ();
2123
-
2124
2133
  event .preventDefault ();
2125
2134
  event .stopPropagation ();
2135
+
2136
+ this .copyKeyframes ();
2126
2137
  }
2127
2138
 
2128
2139
  break;
@@ -2131,20 +2142,20 @@ module .exports = class AnimationEditor extends Interface
2131
2142
  {
2132
2143
  if (event .metaKey || event .ctrlKey)
2133
2144
  {
2134
- this .pasteKeyframes ();
2135
-
2136
2145
  event .preventDefault ();
2137
2146
  event .stopPropagation ();
2147
+
2148
+ this .pasteKeyframes ();
2138
2149
  }
2139
2150
 
2140
2151
  break;
2141
2152
  }
2142
2153
  case "Backspace":
2143
2154
  {
2144
- this .deleteKeyframes ();
2145
-
2146
2155
  event .preventDefault ();
2147
2156
  event .stopPropagation ();
2157
+
2158
+ this .deleteKeyframes ();
2148
2159
  break;
2149
2160
  }
2150
2161
  }
@@ -2812,11 +2823,12 @@ module .exports = class AnimationEditor extends Interface
2812
2823
  {
2813
2824
  const
2814
2825
  tracksWidth = this .tracks .width (),
2815
- tracksHeight = this .tracks .height ();
2826
+ tracksHeight = this .tracks .height (),
2827
+ contentScale = window .devicePixelRatio;
2816
2828
 
2817
2829
  this .tracks
2818
- .prop ("width", tracksWidth)
2819
- .prop ("height", tracksHeight);
2830
+ .prop ("width", tracksWidth * contentScale)
2831
+ .prop ("height", tracksHeight * contentScale);
2820
2832
 
2821
2833
  this .timelineClip = new Path2D ();
2822
2834
  this .timelineClip .rect (this .getLeft () - this .FRAME_SIZE, 0, this .getWidth () + this .FRAME_SIZE * 2, tracksHeight);
@@ -2824,7 +2836,7 @@ module .exports = class AnimationEditor extends Interface
2824
2836
  this .drawTimeline ();
2825
2837
  }
2826
2838
 
2827
- #updateTracksId = undefined;
2839
+ #updateTracksId;
2828
2840
 
2829
2841
  requestDrawTimeline ()
2830
2842
  {
@@ -2833,8 +2845,6 @@ module .exports = class AnimationEditor extends Interface
2833
2845
  this .#updateTracksId = setTimeout (() => this .drawTimeline ());
2834
2846
  }
2835
2847
 
2836
- #style = window .getComputedStyle ($("body") [0]);
2837
-
2838
2848
  TRACK_PADDING = 8;
2839
2849
 
2840
2850
  drawTimeline ()
@@ -2842,8 +2852,11 @@ module .exports = class AnimationEditor extends Interface
2842
2852
  const
2843
2853
  context = this .tracks [0] .getContext ("2d"),
2844
2854
  tracksWidth = this .tracks .width (),
2845
- tracksHeight = this .tracks .height ();
2855
+ tracksHeight = this .tracks .height (),
2856
+ contentScale = window .devicePixelRatio;
2846
2857
 
2858
+ context .save ();
2859
+ context .scale (contentScale, contentScale);
2847
2860
  context .clearRect (0, 0, tracksWidth, tracksHeight);
2848
2861
 
2849
2862
  if (!this .animation)
@@ -3029,6 +3042,7 @@ module .exports = class AnimationEditor extends Interface
3029
3042
  context .fillRect (x - 1, 0, 3, tracksHeight);
3030
3043
 
3031
3044
  context .restore ();
3045
+ context .restore ();
3032
3046
  }
3033
3047
 
3034
3048
  #defaultIntegers = new X3D .MFInt32 ();