sunrize 2.7.1 → 2.7.2

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.7.1",
4
+ "version": "2.7.2",
5
5
  "description": "Sunrize — A Multi-Platform X3D Editor",
6
6
  "main": "src/main.js",
7
7
  "bin": {
@@ -106,7 +106,7 @@
106
106
  "@vscode/codicons": "^0.0.45",
107
107
  "capitalize": "^2.0.4",
108
108
  "console": "^0.7.2",
109
- "electron": "^45.3.3",
109
+ "electron": "^45.4.1",
110
110
  "electron-prompt": "^1.7.0",
111
111
  "electron-squirrel-startup": "^1.0.1",
112
112
  "electron-tabs": "^1.0.4",
@@ -124,7 +124,7 @@
124
124
  "string-similarity": "^4.0.4",
125
125
  "tweakpane": "^4.0.5",
126
126
  "update-electron-app": "^3.3.0",
127
- "x_ite": "^16.8.0",
127
+ "x_ite": "^16.8.1",
128
128
  "x_ite-off-parser": "^1.4.0",
129
129
  "x_ite-sog-parser": "^2.2.0",
130
130
  "x_ite-spz-parser": "^2.2.0",
@@ -571,7 +571,7 @@ module .exports = class Document extends Interface
571
571
  return;
572
572
  }
573
573
 
574
- fs .writeFile (this .filePath, Editor .getContents (scene, path .extname (this .filePath)), Function .prototype);
574
+ fs .writeFileSync (this .filePath, Editor .getContents (scene, path .extname (this .filePath)));
575
575
  }
576
576
  else
577
577
  {
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
 
3
3
  const
4
- $ = require ("jquery"),
5
- path = require ("path"),
6
- X3D = require ("../X3D"),
7
- Editor = require ("../Undo/Editor"),
8
- UndoManager = require("../Undo/UndoManager"),
9
- _ = require ("../Application/GetText");
4
+ $ = require ("jquery"),
5
+ path = require ("path"),
6
+ X3D = require ("../X3D"),
7
+ Editor = require ("../Undo/Editor");
10
8
 
11
9
  require ("./Popover");
12
10
 
@@ -22,6 +20,7 @@ $.fn.materialPreviewPopover = async function (node)
22
20
  .attr ("splashScreen", "false")
23
21
  .attr ("contextMenu", "false")
24
22
  .attr ("notifications", "false")
23
+ .attr ("contentScale", "auto")
25
24
  .attr ("colorSpace", node .getBrowser () .getBrowserOption ("ColorSpace"))
26
25
  .attr ("xrSessionMode", "NONE")
27
26
  .appendTo (preview);
@@ -46,6 +46,7 @@ $.fn.texturePreviewPopover = async function (node)
46
46
  .attr ("splashScreen", "false")
47
47
  .attr ("contextMenu", "false")
48
48
  .attr ("notifications", "false")
49
+ .attr ("contentScale", "auto")
49
50
  .attr ("colorSpace", node .getBrowser () .getBrowserOption ("ColorSpace"))
50
51
  .attr ("xrSessionMode", "NONE")
51
52
  .appendTo (preview);
@@ -219,6 +219,10 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
219
219
  accelerator: "CmdOrCtrl+Backspace",
220
220
  args: ["deleteNodes"],
221
221
  },
222
+ {
223
+ label: _("Add Clone"),
224
+ args: ["addClone", element .attr ("id"), executionContext .getId (), node .getId ()],
225
+ },
222
226
  {
223
227
  label: _("Unlink Clone"),
224
228
  enabled: node .getCloneCount () > 1,
@@ -1169,6 +1173,19 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1169
1173
  UndoManager .shared .endUndo ();
1170
1174
  }
1171
1175
 
1176
+ addClone (id, executionContextId, nodeId)
1177
+ {
1178
+ const
1179
+ executionContext = this .objects .get (executionContextId),
1180
+ node = this .objects .get (nodeId);
1181
+
1182
+ UndoManager .shared .beginUndo (_("Add Clone"));
1183
+
1184
+ Editor .appendValueToArray (executionContext, executionContext, executionContext .rootNodes, node);
1185
+
1186
+ UndoManager .shared .endUndo ();
1187
+ }
1188
+
1172
1189
  unlinkClone (id, executionContextId, nodeId)
1173
1190
  {
1174
1191
  const
@@ -1735,7 +1752,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1735
1752
  data = dataURL .substring (dataURL .indexOf (isData ? "," : ":") + 1),
1736
1753
  buffer = Buffer .from (data, isData && match [3] === "base64" ? "base64" : "utf8");
1737
1754
 
1738
- fs .writeFile (response .filePath, buffer, Function .prototype);
1755
+ fs .writeFileSync (response .filePath, buffer);
1739
1756
 
1740
1757
  // Add undo step.
1741
1758
 
@@ -113,10 +113,6 @@ module .exports = class OutlineRouteGraph extends OutlineView
113
113
 
114
114
  updateRouteGraph ()
115
115
  {
116
- const canvases = this .sceneGraph .find (".route-curves");
117
-
118
- canvases .css ("height", "");
119
-
120
116
  // Determine visible routes, those routes have a value of 2.
121
117
 
122
118
  const fields = new Map ();
@@ -132,6 +128,9 @@ module .exports = class OutlineRouteGraph extends OutlineView
132
128
  fields .set (route, (fields .get (route) ?? 0) + 1);
133
129
  }
134
130
 
131
+ this .sceneGraph .find (".field-routes, .single-route, .route-curves")
132
+ .css ("height", "");
133
+
135
134
  this .sceneGraph
136
135
  .find (".field-routes")
137
136
  .each ((i, canvas2d) => this .updateFieldRoutes ($(canvas2d), fields));
@@ -140,6 +139,8 @@ module .exports = class OutlineRouteGraph extends OutlineView
140
139
  .find (".single-route")
141
140
  .each ((i, canvas2d) => this .updateSingleRoute ($(canvas2d), fields));
142
141
 
142
+ const canvases = this .sceneGraph .find (".route-curves");
143
+
143
144
  this .updateRouteCurves (canvases, fields);
144
145
  }
145
146
 
@@ -1400,7 +1400,7 @@ module .exports = class OutlineView extends Interface
1400
1400
  .imported-node[node-id=${node .getId ()}],
1401
1401
  .exported-node[node-id=${node .getId ()}],
1402
1402
  .externproto[node-id=${node .getId ()}]`)
1403
- .find ("> .item .reload-node")
1403
+ .find ("> .item [action=reload-node]")
1404
1404
  .removeClass (["not-started-state", "in-progress-state", "complete-state", "failed-state"])
1405
1405
  .addClass (className);
1406
1406
  }
@@ -81,12 +81,6 @@ class X3DTransformNodeTool extends X3DChildNodeTool
81
81
 
82
82
  beginUndo ()
83
83
  {
84
- if (this .isHidden ())
85
- return false;
86
-
87
- if (!this ._visible .getValue ())
88
- return false;
89
-
90
84
  if (!this .tool .undo)
91
85
  return false;
92
86
 
@@ -135,12 +129,6 @@ class X3DTransformNodeTool extends X3DChildNodeTool
135
129
 
136
130
  transformGroups ()
137
131
  {
138
- if (this .isHidden ())
139
- return;
140
-
141
- if (!this ._visible .getValue ())
142
- return;
143
-
144
132
  if (this .tool .group === "NONE")
145
133
  return;
146
134
 
@@ -161,12 +149,6 @@ class X3DTransformNodeTool extends X3DChildNodeTool
161
149
  if (other === this)
162
150
  continue;
163
151
 
164
- if (other .isHidden ())
165
- continue;
166
-
167
- if (!other ._visible .getValue ())
168
- continue;
169
-
170
152
  if (other .tool .group !== this .tool .group)
171
153
  continue;
172
154
 
@@ -2011,22 +2011,6 @@ body.light .console-output .selected {
2011
2011
  font-size: smaller;
2012
2012
  }
2013
2013
 
2014
- .scene-graph .not-started-state {
2015
- color: var(--text-color);
2016
- }
2017
-
2018
- .scene-graph .in-progress-state {
2019
- color: var(--system-yellow);
2020
- }
2021
-
2022
- .scene-graph .complete-state {
2023
- color: var(--system-green);
2024
- }
2025
-
2026
- .scene-graph .failed-state {
2027
- color: var(--system-red);
2028
- }
2029
-
2030
2014
  /* make drag & drop work */
2031
2015
  .scene-graph .last {
2032
2016
  overflow: hidden;
@@ -2313,6 +2297,22 @@ body.light .console-output .selected {
2313
2297
  top: 4px;
2314
2298
  }
2315
2299
 
2300
+ .scene-graph .not-started-state {
2301
+ color: var(--text-color);
2302
+ }
2303
+
2304
+ .scene-graph .in-progress-state {
2305
+ color: var(--system-yellow);
2306
+ }
2307
+
2308
+ .scene-graph .complete-state {
2309
+ color: var(--system-green);
2310
+ }
2311
+
2312
+ .scene-graph .failed-state {
2313
+ color: var(--system-red);
2314
+ }
2315
+
2316
2316
  /* Spectrum Color Picker */
2317
2317
 
2318
2318
  .sp-container {