sunrize 1.11.12 → 1.11.14

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": "1.11.12",
4
+ "version": "1.11.14",
5
5
  "description": "A Multi-Platform X3D Editor",
6
6
  "main": "src/main.js",
7
7
  "bin": {
@@ -88,10 +88,10 @@
88
88
  "shell-tools": "^1.1.9"
89
89
  },
90
90
  "dependencies": {
91
- "@vscode/codicons": "^0.0.43",
91
+ "@vscode/codicons": "^0.0.44",
92
92
  "capitalize": "^2.0.4",
93
93
  "console": "^0.7.2",
94
- "electron": "^39.2.6",
94
+ "electron": "^39.2.7",
95
95
  "electron-prompt": "^1.7.0",
96
96
  "electron-squirrel-startup": "^1.0.1",
97
97
  "electron-tabs": "^1.0.4",
@@ -100,7 +100,7 @@
100
100
  "jquery-ui-dist": "^1.13.3",
101
101
  "jstree": "^3.3.17",
102
102
  "material-icons": "^1.13.14",
103
- "material-symbols": "^0.40.1",
103
+ "material-symbols": "^0.40.2",
104
104
  "md5": "^2.3.0",
105
105
  "mime-types": "^3.0.2",
106
106
  "monaco-editor": "^0.55.1",
@@ -109,8 +109,8 @@
109
109
  "spectrum-colorpicker2": "^2.0.10",
110
110
  "string-similarity": "^4.0.4",
111
111
  "tweakpane": "^3.1.10",
112
- "update-electron-app": "^3.1.1",
113
- "x_ite": "^12.2.1",
112
+ "update-electron-app": "^3.1.2",
113
+ "x_ite": "^12.2.3",
114
114
  "x3d-traverse": "^1.0.22"
115
115
  }
116
116
  }
@@ -67,8 +67,6 @@ module .exports = class Document extends Interface
67
67
  .on ("focusin", () => this .onfocus ())
68
68
  .on ("focusout", () => this .onfocus ());
69
69
 
70
- $(window) .on ("keydown", event => this .onkeydown (event));
71
-
72
70
  // File Menu
73
71
 
74
72
  electron .ipcRenderer .on ("open-files", (event, urls) => this .loadURL (urls [0])); // DEBUG
@@ -94,10 +92,6 @@ module .exports = class Document extends Interface
94
92
 
95
93
  electron .ipcRenderer .on ("delete", () => this .delete ());
96
94
 
97
- // Selection Menu
98
-
99
- electron .ipcRenderer .on ("select-all", () => this .selectAll ());
100
-
101
95
  // View Menu
102
96
 
103
97
  electron .ipcRenderer .on ("primitive-quality", (event, value) => this .setPrimitiveQuality (value));
@@ -168,9 +162,12 @@ module .exports = class Document extends Interface
168
162
  // Connect for Snap Target and Snap Source.
169
163
 
170
164
  $(this .browser .element)
171
- .on ("mousedown", event => this .onmousedown (event))
172
- .on ("mouseup", event => this .onsnaptool (event))
173
- .on ("mouseup", event => this .onselect (event));
165
+ .on ("mousedown", event => this .onmousedown (event))
166
+ .on ("mouseup", event => this .onsnaptool (event))
167
+ .on ("mouseup", event => this .onselect (event))
168
+ .on ("contextmenu", event => this .showBrowserContextMenu (event));
169
+
170
+ electron .ipcRenderer .on ("document", (event, key, ... args) => this [key] (... args));
174
171
 
175
172
  // Load components.
176
173
 
@@ -356,28 +353,6 @@ module .exports = class Document extends Interface
356
353
  return true;
357
354
  }
358
355
 
359
- // Menu Accelerators
360
-
361
- onkeydown (event)
362
- {
363
- switch (event .key)
364
- {
365
- case "a":
366
- {
367
- if (this .activeElementIsInputOrOutput ())
368
- break;
369
-
370
- if (ActionKeys .value === ActionKeys .CommandOrControl)
371
- {
372
- this .selectAll ();
373
- return false;
374
- }
375
-
376
- break;
377
- }
378
- }
379
- }
380
-
381
356
  /*
382
357
  * File Menu
383
358
  */
@@ -661,15 +636,6 @@ Viewpoint {
661
636
  this .sidebar .outlineEditor .deleteNodes ();
662
637
  }
663
638
 
664
- /*
665
- * Selection Menu
666
- */
667
-
668
- selectAll ()
669
- {
670
- this .sidebar .outlineEditor .selectAll ();
671
- }
672
-
673
639
  /*
674
640
  * View Menu
675
641
  */
@@ -1027,7 +993,7 @@ Viewpoint {
1027
993
  {
1028
994
  switch (ActionKeys .value)
1029
995
  {
1030
- case ActionKeys .None:
996
+ case ActionKeys .Shift:
1031
997
  {
1032
998
  if (this .#snapTarget ?._visible .getValue ())
1033
999
  break;
@@ -1039,7 +1005,7 @@ Viewpoint {
1039
1005
  this .#snapTarget .onmousedown (event, true);
1040
1006
  break;
1041
1007
  }
1042
- case ActionKeys .Option:
1008
+ case ActionKeys .Shift | ActionKeys .Option:
1043
1009
  {
1044
1010
  if (this .#snapSource ?._visible .getValue ())
1045
1011
  break;
@@ -1087,10 +1053,6 @@ Viewpoint {
1087
1053
  if (this .#pointer .distance (pointer) > this .browser .getRenderingProperty ("ContentScale"))
1088
1054
  return;
1089
1055
 
1090
- // Stop event propagation.
1091
-
1092
- event .preventDefault ();
1093
-
1094
1056
  // Select or deselect.
1095
1057
 
1096
1058
  const outlineEditor = this .sidebar .outlineEditor;
@@ -1262,4 +1224,43 @@ Viewpoint {
1262
1224
  menu .SnapTarget = this .#snapTarget ?._visible .getValue () ?? false;
1263
1225
  menu .SnapSource = this .#snapSource ?._visible .getValue () ?? false;
1264
1226
  }
1227
+
1228
+ /**
1229
+ * Context Menu
1230
+ */
1231
+
1232
+ showBrowserContextMenu (event)
1233
+ {
1234
+ if (event .shiftKey || event .ctrlKey || event .metaKey)
1235
+ return;
1236
+
1237
+ const
1238
+ activeLayer = this .browser .getActiveLayer (),
1239
+ viewpoints = activeLayer .getViewpoints () .get ();
1240
+
1241
+ const menu = [
1242
+ {
1243
+ label: _("Viewpoints"),
1244
+ submenu: viewpoints .filter ((_, index) => index > 0) .map ((viewpointNode, index) => ({
1245
+ label: `${viewpointNode ._description .getValue () || viewpointNode .getDisplayName () || `VP${index + 1}}`}`,
1246
+ args: ["bindViewpoint", index + 1],
1247
+ })),
1248
+ },
1249
+ ];
1250
+
1251
+ electron .ipcRenderer .send ("context-menu", "document", menu);
1252
+ }
1253
+
1254
+ bindViewpoint (index)
1255
+ {
1256
+ const
1257
+ activeLayer = this .browser .getActiveLayer (),
1258
+ viewpoints = activeLayer .getViewpoints () .get (),
1259
+ viewpointNode = viewpoints [index];
1260
+
1261
+ if (!viewpointNode)
1262
+ return;
1263
+
1264
+ viewpointNode ._set_bind = true;
1265
+ }
1265
1266
  };
@@ -108,6 +108,7 @@ module .exports = new class Tabs
108
108
  this .forwardToActiveTab ("move-selection-to-snap-target");
109
109
  this .forwardToActiveTab ("move-selection-center-to-snap-target");
110
110
 
111
+ this .forwardToActiveTab ("document");
111
112
  this .forwardToActiveTab ("script-editor");
112
113
  this .forwardToActiveTab ("animation-members-list");
113
114
  this .forwardToActiveTab ("outline-editor");
@@ -54,6 +54,7 @@ module .exports = class OutlineView extends Interface
54
54
  this .browser .getBrowserOptions () ._ColorSpace .addInterest ("updateSceneGraph", this);
55
55
  this .browser ._activeLayer .addInterest ("updateActiveLayer", this);
56
56
 
57
+ electron .ipcRenderer .on ("select-all", () => this .selectAll ());
57
58
  electron .ipcRenderer .on ("deselect-all", () => this .deselectAll ());
58
59
  electron .ipcRenderer .on ("hide-unselected-objects", () => this .hideUnselectedObjects ());
59
60
  electron .ipcRenderer .on ("show-selected-objects", () => this .showSelectedObjects ());
@@ -7,7 +7,7 @@ const
7
7
 
8
8
  class SnapSource extends X3DSnapNodeTool
9
9
  {
10
- toolModifiers = ActionKeys .Option;
10
+ toolModifiers = ActionKeys .Shift | ActionKeys .Option;
11
11
 
12
12
  async initializeTool ()
13
13
  {
@@ -7,6 +7,8 @@ const
7
7
 
8
8
  class SnapTarget extends X3DSnapNodeTool
9
9
  {
10
+ toolModifiers = ActionKeys .Shift;
11
+
10
12
  #transformTools = [ ];
11
13
  #changing = Symbol ();
12
14