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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sunrize",
3
3
  "productName": "Sunrize X3D Editor",
4
- "version": "1.5.13",
4
+ "version": "1.6.0",
5
5
  "description": "A Multi-Platform X3D Editor",
6
6
  "main": "src/main.js",
7
7
  "bin": {
@@ -81,7 +81,7 @@
81
81
  "dependencies": {
82
82
  "capitalize": "^2.0.4",
83
83
  "console": "^0.7.2",
84
- "electron": "^29.0.1",
84
+ "electron": "^29.1.1",
85
85
  "electron-prompt": "^1.7.0",
86
86
  "electron-squirrel-startup": "^1.0.0",
87
87
  "electron-tabs": "^1.0.4",
@@ -90,9 +90,9 @@
90
90
  "jquery-ui-dist": "^1.13.2",
91
91
  "jstree": "^3.3.16",
92
92
  "material-icons": "^1.13.12",
93
- "material-symbols": "^0.15.0",
93
+ "material-symbols": "^0.16.0",
94
94
  "md5": "^2.3.0",
95
- "monaco-editor": "^0.46.0",
95
+ "monaco-editor": "^0.47.0",
96
96
  "node-clipboardy": "^1.0.3",
97
97
  "node-localstorage": "^3.0.5",
98
98
  "qtip2": "^3.0.3",
@@ -100,7 +100,7 @@
100
100
  "string-similarity": "^4.0.4",
101
101
  "tweakpane": "^3.1.10",
102
102
  "update-electron-app": "^3.0.0",
103
- "x_ite": "^9.2.7"
103
+ "x_ite": "^9.3.1"
104
104
  },
105
105
  "config": {
106
106
  "forge": {
@@ -616,10 +616,10 @@ module .exports = class Application
616
616
  label: "Layout",
617
617
  submenu: [
618
618
  {
619
- label: _("Browser Size..."),
619
+ label: _("Browser Frame..."),
620
620
  click: () =>
621
621
  {
622
- this .mainWindow .webContents .send ("browser-size");
622
+ this .mainWindow .webContents .send ("browser-frame");
623
623
  },
624
624
  },
625
625
  { type: "separator" },
@@ -665,7 +665,6 @@ module .exports = class Application
665
665
  label: _("Activate Snap Target"),
666
666
  type: "checkbox",
667
667
  checked: this .menuOptions .SnapTarget,
668
- visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
669
668
  click: () =>
670
669
  {
671
670
  this .mainWindow .webContents .send ("activate-snap-target", !this .menuOptions .SnapTarget);
@@ -675,7 +674,6 @@ module .exports = class Application
675
674
  label: _("Activate Snap Source"),
676
675
  type: "checkbox",
677
676
  checked: this .menuOptions .SnapSource,
678
- visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
679
677
  click: () =>
680
678
  {
681
679
  this .mainWindow .webContents .send ("activate-snap-source", !this .menuOptions .SnapSource);
@@ -683,7 +681,6 @@ module .exports = class Application
683
681
  },
684
682
  {
685
683
  label: _("Center Snap Target in Selection"),
686
- visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
687
684
  click: () =>
688
685
  {
689
686
  this .mainWindow .webContents .send ("center-snap-target-in-selection");
@@ -693,7 +690,6 @@ module .exports = class Application
693
690
  label: _("Move Selection to Snap Target"),
694
691
  accelerator: "CmdOrCtrl+M",
695
692
  enabled: this .menuOptions .SnapTarget,
696
- visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
697
693
  click: () =>
698
694
  {
699
695
  this .mainWindow .webContents .send ("move-selection-to-snap-target");
@@ -703,7 +699,6 @@ module .exports = class Application
703
699
  label: _("Move Selection Center to Snap Target"),
704
700
  accelerator: "Shift+CmdOrCtrl+M",
705
701
  enabled: this .menuOptions .SnapTarget,
706
- visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
707
702
  click: () =>
708
703
  {
709
704
  this .mainWindow .webContents .send ("move-selection-center-to-snap-target");
@@ -82,28 +82,28 @@ module .exports = class Dashboard extends Interface
82
82
  this .togglePanel (this .config .file .panel);
83
83
  }
84
84
 
85
- arrow ()
85
+ hand ()
86
86
  {
87
- this .config .file .pointer = "arrow";
87
+ this .config .file .pointer = "hand";
88
88
 
89
- if (this .arrowButton .hasClass ("active"))
89
+ if (this .handButton .hasClass ("active"))
90
90
  return;
91
91
 
92
- this .handButton .removeClass ("active");
93
- this .arrowButton .addClass ("active");
92
+ this .arrowButton .removeClass ("active");
93
+ this .handButton .addClass ("active");
94
94
 
95
95
  this .browser .addBrowserEvent ();
96
96
  }
97
97
 
98
- hand ()
98
+ arrow ()
99
99
  {
100
- this .config .file .pointer = "hand";
100
+ this .config .file .pointer = "arrow";
101
101
 
102
- if (this .handButton .hasClass ("active"))
102
+ if (this .arrowButton .hasClass ("active"))
103
103
  return;
104
104
 
105
- this .arrowButton .removeClass ("active");
106
- this .handButton .addClass ("active");
105
+ this .handButton .removeClass ("active");
106
+ this .arrowButton .addClass ("active");
107
107
 
108
108
  this .browser .addBrowserEvent ();
109
109
  }
@@ -2,188 +2,188 @@
2
2
  //"use strict"
3
3
 
4
4
  const
5
- storages = new WeakMap (),
6
- namespaces = new WeakMap (),
7
- defaults = new WeakMap ()
5
+ storages = new WeakMap (),
6
+ namespaces = new WeakMap (),
7
+ defaults = new WeakMap ()
8
8
 
9
9
  const handler =
10
10
  {
11
- get (target, key)
12
- {
13
- const property = target [key]
14
-
15
- if (property !== undefined)
16
- return property
17
-
18
- const
19
- storage = target .getStorage (),
20
- namespace = target .getNameSpace (),
21
- value = storage [namespace + key]
22
-
23
- if (value === undefined || value === "undefined" || value === null)
24
- return target .getDefaultValue (key)
25
-
26
- // Update timestamp.
27
- storage [namespace + key + ".#timeStamp"] = JSON .stringify (Date .now ())
28
-
29
- return JSON .parse (value)
30
- },
31
- set (target, key, value)
32
- {
33
- const
34
- storage = target .getStorage (),
35
- namespace = target .getNameSpace ()
36
-
37
- if (value === undefined)
38
- {
39
- storage .removeItem (namespace + key + ".#timeStamp")
40
- storage .removeItem (namespace + key)
41
- }
42
- else
43
- {
44
- storage [namespace + key + ".#timeStamp"] = JSON .stringify (Date .now ())
45
- storage [namespace + key] = JSON .stringify (value)
46
- }
47
-
48
- return true
49
- },
50
- has (target, key)
51
- {
52
- const value = target .getStorage () [target .getNameSpace () + key]
53
-
54
- return !(value === undefined || value === "undefined" || value === null)
55
- },
56
- ownKeys (target)
57
- {
58
- const
59
- storage = target .getStorage (),
60
- namespace = target .getNameSpace (),
61
- ownKeys = [ ]
62
-
63
- for (const key of Object .keys (storage))
64
- {
65
- if (key .startsWith (namespace) && !key .endsWith (".#timeStamp"))
66
- ownKeys .push (key .substring (namespace .length))
67
- }
68
-
69
- return ownKeys
70
- },
71
- getOwnPropertyDescriptor (target, key)
72
- {
73
- const
74
- storage = target .getStorage (),
75
- namespace = target .getNameSpace ()
76
-
77
- return Object .getOwnPropertyDescriptor (storage, namespace + key)
78
- },
11
+ get (target, key)
12
+ {
13
+ const property = target [key]
14
+
15
+ if (property !== undefined)
16
+ return property
17
+
18
+ const
19
+ storage = target .getStorage (),
20
+ namespace = target .getNameSpace (),
21
+ value = storage [namespace + key]
22
+
23
+ if (value === undefined || value === "undefined" || value === null)
24
+ return target .getDefaultValue (key)
25
+
26
+ // Update timestamp.
27
+ storage [namespace + key + ".#timeStamp"] = JSON .stringify (Date .now ())
28
+
29
+ return JSON .parse (value)
30
+ },
31
+ set (target, key, value)
32
+ {
33
+ const
34
+ storage = target .getStorage (),
35
+ namespace = target .getNameSpace ()
36
+
37
+ if (value === undefined)
38
+ {
39
+ storage .removeItem (namespace + key + ".#timeStamp")
40
+ storage .removeItem (namespace + key)
41
+ }
42
+ else
43
+ {
44
+ storage [namespace + key + ".#timeStamp"] = JSON .stringify (Date .now ())
45
+ storage [namespace + key] = JSON .stringify (value)
46
+ }
47
+
48
+ return true
49
+ },
50
+ has (target, key)
51
+ {
52
+ const value = target .getStorage () [target .getNameSpace () + key]
53
+
54
+ return !(value === undefined || value === "undefined" || value === null)
55
+ },
56
+ ownKeys (target)
57
+ {
58
+ const
59
+ storage = target .getStorage (),
60
+ namespace = target .getNameSpace (),
61
+ ownKeys = [ ]
62
+
63
+ for (const key of Object .keys (storage))
64
+ {
65
+ if (key .startsWith (namespace) && !key .endsWith (".#timeStamp"))
66
+ ownKeys .push (key .substring (namespace .length))
67
+ }
68
+
69
+ return ownKeys
70
+ },
71
+ getOwnPropertyDescriptor (target, key)
72
+ {
73
+ const
74
+ storage = target .getStorage (),
75
+ namespace = target .getNameSpace ()
76
+
77
+ return Object .getOwnPropertyDescriptor (storage, namespace + key)
78
+ },
79
79
  }
80
80
 
81
81
  module .exports = class DataStorage
82
82
  {
83
- constructor (storage, namespace)
84
- {
85
- this .target = this
86
-
87
- storages .set (this, storage)
88
- namespaces .set (this, namespace)
89
- defaults .set (this, { })
90
-
91
- return new Proxy (this, handler)
92
- }
93
-
94
- /**
95
- *
96
- * @returns
97
- */
98
- getStorage ()
99
- {
100
- return storages .get (this .target)
101
- }
102
-
103
- /**
104
- *
105
- * @returns string
106
- */
107
- getNameSpace ()
108
- {
109
- return namespaces .get (this .target)
110
- }
111
-
112
- /**
113
- *
114
- * @param {string} namespace
115
- * @returns DataStorage
116
- */
117
- addNameSpace (namespace)
118
- {
119
- return new DataStorage (this .getStorage (), this .getNameSpace () + namespace)
120
- }
121
-
122
- /**
123
- *
124
- * @param {object} object
125
- */
126
- setDefaultValues (object)
127
- {
128
- Object .assign (defaults .get (this .target), object)
129
- }
130
-
131
- /**
132
- *
133
- * @returns {object}
134
- */
135
- getDefaultValues ()
136
- {
137
- return Object .assign ({ }, defaults .get (this .target))
138
- }
139
-
140
- /**
141
- *
142
- * @param {string} key
143
- * @returns {any}
144
- */
145
- getDefaultValue (key)
146
- {
147
- const value = defaults .get (this .target) [key]
148
-
149
- return value === undefined ? undefined : JSON .parse (JSON .stringify (value))
150
- }
151
-
152
- /**
153
- *
154
- * @param {number} before
155
- */
156
- removeItems (before = Date .now ())
157
- {
158
- const
159
- storage = this .getStorage (),
160
- namespace = this .getNameSpace ()
161
-
162
- for (const key of Object .keys (storage))
163
- {
164
- if (key .startsWith (namespace) && !key .endsWith (".#timeStamp"))
165
- {
166
- const timeStamp = JSON .parse (storage [key + ".#timeStamp"])
167
-
168
- if (timeStamp < before)
169
- {
170
- storage .removeItem (key + ".#timeStamp")
171
- storage .removeItem (key)
172
- }
173
- }
174
- }
175
- }
176
-
177
- clear ()
178
- {
179
- const
180
- storage = this .getStorage (),
181
- namespace = this .getNameSpace ()
182
-
183
- for (const key of Object .keys (storage))
184
- {
185
- if (key .startsWith (namespace))
186
- storage .removeItem (key)
187
- }
188
- }
83
+ constructor (storage, namespace)
84
+ {
85
+ this .target = this
86
+
87
+ storages .set (this, storage)
88
+ namespaces .set (this, namespace)
89
+ defaults .set (this, { })
90
+
91
+ return new Proxy (this, handler)
92
+ }
93
+
94
+ /**
95
+ *
96
+ * @returns
97
+ */
98
+ getStorage ()
99
+ {
100
+ return storages .get (this .target)
101
+ }
102
+
103
+ /**
104
+ *
105
+ * @returns string
106
+ */
107
+ getNameSpace ()
108
+ {
109
+ return namespaces .get (this .target)
110
+ }
111
+
112
+ /**
113
+ *
114
+ * @param {string} namespace
115
+ * @returns DataStorage
116
+ */
117
+ addNameSpace (namespace)
118
+ {
119
+ return new DataStorage (this .getStorage (), this .getNameSpace () + namespace)
120
+ }
121
+
122
+ /**
123
+ *
124
+ * @param {object} object
125
+ */
126
+ setDefaultValues (object)
127
+ {
128
+ Object .assign (defaults .get (this .target), object)
129
+ }
130
+
131
+ /**
132
+ *
133
+ * @returns {object}
134
+ */
135
+ getDefaultValues ()
136
+ {
137
+ return Object .assign ({ }, defaults .get (this .target))
138
+ }
139
+
140
+ /**
141
+ *
142
+ * @param {string} key
143
+ * @returns {any}
144
+ */
145
+ getDefaultValue (key)
146
+ {
147
+ const value = defaults .get (this .target) [key]
148
+
149
+ return value === undefined ? undefined : JSON .parse (JSON .stringify (value))
150
+ }
151
+
152
+ /**
153
+ *
154
+ * @param {number} before
155
+ */
156
+ removeItems (before = Date .now ())
157
+ {
158
+ const
159
+ storage = this .getStorage (),
160
+ namespace = this .getNameSpace ()
161
+
162
+ for (const key of Object .keys (storage))
163
+ {
164
+ if (key .startsWith (namespace) && !key .endsWith (".#timeStamp"))
165
+ {
166
+ const timeStamp = JSON .parse (storage [key + ".#timeStamp"])
167
+
168
+ if (timeStamp < before)
169
+ {
170
+ storage .removeItem (key + ".#timeStamp")
171
+ storage .removeItem (key)
172
+ }
173
+ }
174
+ }
175
+ }
176
+
177
+ clear ()
178
+ {
179
+ const
180
+ storage = this .getStorage (),
181
+ namespace = this .getNameSpace ()
182
+
183
+ for (const key of Object .keys (storage))
184
+ {
185
+ if (key .startsWith (namespace))
186
+ storage .removeItem (key)
187
+ }
188
+ }
189
189
  }