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.
- package/package.json +5 -5
- package/src/Application/Application.js +2 -7
- package/src/Application/Dashboard.js +10 -10
- package/src/Application/DataStorage.js +177 -177
- package/src/Application/Document.js +72 -127
- package/src/Application/Interface.js +4 -0
- package/src/Application/Tabs.js +3 -3
- package/src/Controls/Dialog.js +3 -1
- package/src/Editors/BrowserFrame.js +171 -0
- package/src/Editors/OutlineEditor.js +149 -123
- package/src/Editors/OutlineRouteGraph.js +493 -493
- package/src/Editors/OutlineView.js +102 -64
- package/src/Editors/SceneProperties.js +137 -136
- package/src/Editors/ScriptEditor.js +1 -1
- package/src/Tools/Core/X3DNodeTool.js +66 -12
- package/src/Tools/Grids/AngleGridTool.js +0 -5
- package/src/Tools/Grids/AngleGridTool.x3d +1 -0
- package/src/Tools/Grids/AxonometricGrid.x3d +5 -5
- package/src/Tools/Grids/AxonometricGridTool.js +0 -5
- package/src/Tools/Grids/AxonometricGridTool.x3d +1 -0
- package/src/Tools/Grids/GridTool.js +0 -5
- package/src/Tools/Grids/GridTool.x3d +1 -0
- package/src/Tools/Grids/X3DGridNodeTool.js +131 -84
- package/src/Tools/Grouping/X3DTransformNodeTool.js +19 -21
- package/src/Tools/Grouping/X3DTransformNodeTool.x3d +20 -15
- package/src/Tools/Layering/X3DActiveLayerNodeTool.js +16 -21
- package/src/Tools/Lighting/DirectionalLightTool.js +32 -1
- package/src/Tools/Lighting/X3DLightNodeTool.x3d +4 -21
- package/src/Tools/Shaders/TextureShader.x3d +16 -3
- package/src/Tools/SnapTool/{SnapSourceTool.js → SnapSource.js} +2 -7
- package/src/Tools/SnapTool/SnapTarget.js +650 -0
- package/src/Tools/SnapTool/SnapTool.x3d +28 -27
- package/src/Tools/SnapTool/X3DSnapNodeTool.js +16 -15
- package/src/Tools/Sound/SoundTool.x3d +4 -21
- package/src/Tools/TextureProjection/X3DTextureProjectorNodeTool.x3d +19 -26
- package/src/Undo/Editor.js +185 -46
- package/src/assets/Info.plist +56 -56
- package/src/assets/themes/default-template.css +1 -0
- package/src/assets/themes/default.css +1 -0
- package/src/Editors/BrowserSize.js +0 -101
- 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.
|
|
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.
|
|
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.
|
|
93
|
+
"material-symbols": "^0.16.0",
|
|
94
94
|
"md5": "^2.3.0",
|
|
95
|
-
"monaco-editor": "^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.
|
|
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
|
|
619
|
+
label: _("Browser Frame..."),
|
|
620
620
|
click: () =>
|
|
621
621
|
{
|
|
622
|
-
this .mainWindow .webContents .send ("browser-
|
|
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
|
-
|
|
85
|
+
hand ()
|
|
86
86
|
{
|
|
87
|
-
this .config .file .pointer = "
|
|
87
|
+
this .config .file .pointer = "hand";
|
|
88
88
|
|
|
89
|
-
if (this .
|
|
89
|
+
if (this .handButton .hasClass ("active"))
|
|
90
90
|
return;
|
|
91
91
|
|
|
92
|
-
this .
|
|
93
|
-
this .
|
|
92
|
+
this .arrowButton .removeClass ("active");
|
|
93
|
+
this .handButton .addClass ("active");
|
|
94
94
|
|
|
95
95
|
this .browser .addBrowserEvent ();
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
arrow ()
|
|
99
99
|
{
|
|
100
|
-
this .config .file .pointer = "
|
|
100
|
+
this .config .file .pointer = "arrow";
|
|
101
101
|
|
|
102
|
-
if (this .
|
|
102
|
+
if (this .arrowButton .hasClass ("active"))
|
|
103
103
|
return;
|
|
104
104
|
|
|
105
|
-
this .
|
|
106
|
-
this .
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
storages = new WeakMap (),
|
|
6
|
+
namespaces = new WeakMap (),
|
|
7
|
+
defaults = new WeakMap ()
|
|
8
8
|
|
|
9
9
|
const handler =
|
|
10
10
|
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
}
|