sunrize 2.4.1 → 2.5.1
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 +7 -7
- package/src/Application/Application.js +22 -2
- package/src/Application/Dashboard.js +21 -19
- package/src/Application/DataStorage.js +10 -37
- package/src/Application/Document.js +149 -22
- package/src/Application/Footer.js +62 -16
- package/src/Application/Hierarchy.js +1 -1
- package/src/Application/Interface.js +1 -1
- package/src/Application/Sidebar.js +12 -9
- package/src/Application/Tabs.js +79 -11
- package/src/Controls/Splitter.js +146 -19
- package/src/Controls/Tabs.js +17 -12
- package/src/Editors/AnimationEditor.js +83 -59
- package/src/Editors/AnimationMemberList.js +37 -6
- package/src/Editors/BrowserFrame.js +17 -10
- package/src/Editors/Console.js +12 -14
- package/src/Editors/NodeList.js +35 -0
- package/src/Editors/OutlineEditor.js +24 -22
- package/src/Editors/OutlineView.js +85 -61
- package/src/Editors/Panel.js +6 -3
- package/src/Editors/RouteGraph.js +22 -65
- package/src/Editors/SceneProperties.js +9 -5
- package/src/Editors/ScriptEditor.js +37 -23
- package/src/Editors/VideoRecorder.js +145 -0
- package/src/Tools/Core/X3DBaseTool.js +12 -11
- package/src/Tools/Core/X3DImportedNodeInstanceTool.js +52 -0
- package/src/Tools/Core/X3DPrototypeInstanceTool.js +6 -6
- package/src/Tools.js +0 -3
- package/src/Undo/Editor.js +19 -16
- package/src/Undo/UndoManager.js +1 -1
- package/src/assets/fonts/Roboto/OFL.txt +93 -0
- package/src/assets/fonts/Roboto/README.txt +118 -0
- package/src/assets/fonts/Roboto/Roboto-Italic-VariableFont_wdth,wght.ttf +0 -0
- package/src/assets/fonts/Roboto/Roboto-VariableFont_wdth,wght.ttf +0 -0
- package/src/assets/fonts/Roboto_Mono/OFL.txt +93 -0
- package/src/assets/fonts/Roboto_Mono/README.txt +77 -0
- package/src/assets/fonts/Roboto_Mono/RobotoMono-Italic-VariableFont_wght.ttf +0 -0
- package/src/assets/fonts/Roboto_Mono/RobotoMono-VariableFont_wght.ttf +0 -0
- package/src/assets/html/application.html +38 -13
- package/src/assets/html/window.html +6 -7
- package/src/assets/themes/default.css +186 -176
- package/src/assets/themes/{system-colors.css → definitions.css} +155 -173
- package/src/assets/themes/fonts.css +45 -0
- package/src/assets/themes/media-template.css +3 -2
- package/src/assets/themes/media.css +3 -2
- package/src/assets/themes/prompt-template.css +5 -1
- package/src/assets/themes/prompt.css +5 -1
- package/src/assets/html/application-template.html +0 -164
- package/src/assets/html/window-template.html +0 -39
|
@@ -58,12 +58,14 @@ module .exports = class RouteGraph extends Interface
|
|
|
58
58
|
.on ("sortupdate", (event, ui) => this .reorderPages (ui .item))
|
|
59
59
|
.appendTo (this .top);
|
|
60
60
|
|
|
61
|
+
// Toolbar
|
|
62
|
+
|
|
61
63
|
this .toolbar = $("<div></div>")
|
|
62
64
|
.addClass (["toolbar", "vertical-toolbar", "secondary-toolbar", "routing-toolbar"])
|
|
63
65
|
.appendTo (this .editor);
|
|
64
66
|
|
|
65
67
|
this .addPageButton = $("<span></span>")
|
|
66
|
-
.addClass ("material-
|
|
68
|
+
.addClass ("material-symbols-outlined")
|
|
67
69
|
.attr ("title", _("Add new logic page."))
|
|
68
70
|
.text ("add")
|
|
69
71
|
.appendTo (this .toolbar)
|
|
@@ -74,7 +76,7 @@ module .exports = class RouteGraph extends Interface
|
|
|
74
76
|
this .snapToGridButton = $("<span></span>")
|
|
75
77
|
.addClass ("material-symbols-outlined")
|
|
76
78
|
.attr ("title", _("Toggle snap to grid."))
|
|
77
|
-
.css (
|
|
79
|
+
.css ("scale", "0.9")
|
|
78
80
|
.text ("grid_4x4")
|
|
79
81
|
.appendTo (this .toolbar)
|
|
80
82
|
.on ("click", () => this .setSnapToGrid (!this .config .global .snapToGrid));
|
|
@@ -84,7 +86,7 @@ module .exports = class RouteGraph extends Interface
|
|
|
84
86
|
this .addConnectedNodesButton = $("<span></span>")
|
|
85
87
|
.addClass ("material-symbols-outlined")
|
|
86
88
|
.attr ("title", _("Toggle add connected nodes."))
|
|
87
|
-
.css (
|
|
89
|
+
.css ("scale", "0.8")
|
|
88
90
|
.text ("hub")
|
|
89
91
|
.appendTo (this .toolbar)
|
|
90
92
|
.on ("click", () => this .setAddConnectedNodes (!this .config .global .addConnectedNodes));
|
|
@@ -92,38 +94,29 @@ module .exports = class RouteGraph extends Interface
|
|
|
92
94
|
$("<span></span>") .addClass ("separator") .appendTo (this .toolbar);
|
|
93
95
|
|
|
94
96
|
this .zoomOutIcon = $("<span></span>")
|
|
95
|
-
.addClass ("material-
|
|
96
|
-
.attr ("title", _("Zoom
|
|
97
|
-
.css ("transform", "scale(1.5)")
|
|
98
|
-
.css ("margin-top", "13px")
|
|
99
|
-
.css ("margin-bottom", "15px")
|
|
97
|
+
.addClass ("material-symbols-outlined")
|
|
98
|
+
.attr ("title", _("Zoom timeline out. (-)"))
|
|
100
99
|
.text ("zoom_out")
|
|
101
100
|
.appendTo (this .toolbar)
|
|
102
101
|
.on ("click", () => this .zoomOut ());
|
|
103
102
|
|
|
104
103
|
this .zoomInIcon = $("<span></span>")
|
|
105
|
-
.addClass ("material-
|
|
106
|
-
.attr ("title", _("Zoom
|
|
107
|
-
.css ("transform", "scale(1.5)")
|
|
108
|
-
.css ("margin-bottom", "15px")
|
|
104
|
+
.addClass ("material-symbols-outlined")
|
|
105
|
+
.attr ("title", _("Zoom timeline in. (+)"))
|
|
109
106
|
.text ("zoom_in")
|
|
110
107
|
.appendTo (this .toolbar)
|
|
111
108
|
.on ("click", () => this .zoomIn ());
|
|
112
109
|
|
|
113
110
|
this .zoomFitIcon = $("<span></span>")
|
|
114
|
-
.addClass ("material-
|
|
115
|
-
.attr ("title", _("Zoom
|
|
116
|
-
.css ("transform", "scale(1.4)")
|
|
117
|
-
.css ("margin-bottom", "15px")
|
|
111
|
+
.addClass ("material-symbols-outlined")
|
|
112
|
+
.attr ("title", _("Zoom timeline to fit in window. (0)"))
|
|
118
113
|
.text ("fit_screen")
|
|
119
114
|
.appendTo (this .toolbar)
|
|
120
115
|
.on ("click", () => this .zoomFit ());
|
|
121
116
|
|
|
122
117
|
this .zoom100Icon = $("<span></span>")
|
|
123
|
-
.addClass ("material-
|
|
124
|
-
.attr ("title", _("Default
|
|
125
|
-
.css ("transform", "scale(1.4)")
|
|
126
|
-
.css ("margin-bottom", "15px")
|
|
118
|
+
.addClass ("material-symbols-outlined")
|
|
119
|
+
.attr ("title", _("Default timeline zoom. (1)"))
|
|
127
120
|
.text ("1x_mobiledata")
|
|
128
121
|
.appendTo (this .toolbar)
|
|
129
122
|
.on ("click", () => this .zoom100 ());
|
|
@@ -332,7 +325,7 @@ module .exports = class RouteGraph extends Interface
|
|
|
332
325
|
.attr ("title", title)
|
|
333
326
|
.text (title))
|
|
334
327
|
.append ($("<span></span>")
|
|
335
|
-
.addClass (["material-
|
|
328
|
+
.addClass (["material-symbols-outlined", "button"])
|
|
336
329
|
.text ("close")
|
|
337
330
|
.on ("click", () => this .closePage (index)))
|
|
338
331
|
.appendTo (this .tabs);
|
|
@@ -496,7 +489,7 @@ module .exports = class RouteGraph extends Interface
|
|
|
496
489
|
{
|
|
497
490
|
path .push (i);
|
|
498
491
|
|
|
499
|
-
this .getPathsFromNode (importedNode .
|
|
492
|
+
this .getPathsFromNode (importedNode .getInstance (), false, ids, path, paths, seen);
|
|
500
493
|
|
|
501
494
|
path .pop ();
|
|
502
495
|
}
|
|
@@ -645,7 +638,7 @@ module .exports = class RouteGraph extends Interface
|
|
|
645
638
|
{
|
|
646
639
|
path .push (i);
|
|
647
640
|
|
|
648
|
-
this .getIdsFromNode (importedNode .
|
|
641
|
+
this .getIdsFromNode (importedNode .getInstance (), false, paths, path, ids, seen);
|
|
649
642
|
|
|
650
643
|
path .pop ();
|
|
651
644
|
}
|
|
@@ -1155,7 +1148,7 @@ module .exports = class RouteGraph extends Interface
|
|
|
1155
1148
|
node .getPredefinedFields () .addInterest ("updateNodeElement", this, id);
|
|
1156
1149
|
node .getUserDefinedFields () .addInterest ("updateNodeElement", this, id);
|
|
1157
1150
|
|
|
1158
|
-
if (node instanceof X3D .
|
|
1151
|
+
if (node instanceof X3D .X3DImportedNodeInstance)
|
|
1159
1152
|
{
|
|
1160
1153
|
// These events are connected and must never be removed.
|
|
1161
1154
|
node .getImportedNode () .getInlineNode () .getLoadState () .addInterest ("updateNodeElement", this, id);
|
|
@@ -1181,7 +1174,7 @@ module .exports = class RouteGraph extends Interface
|
|
|
1181
1174
|
if (selected)
|
|
1182
1175
|
element .addClass ("selected");
|
|
1183
1176
|
|
|
1184
|
-
if (node instanceof X3D .
|
|
1177
|
+
if (node instanceof X3D .X3DImportedNodeInstance)
|
|
1185
1178
|
element .addClass ("imported-node");
|
|
1186
1179
|
|
|
1187
1180
|
const header = $("<div></div>")
|
|
@@ -1192,7 +1185,7 @@ module .exports = class RouteGraph extends Interface
|
|
|
1192
1185
|
.addClass ("icon")
|
|
1193
1186
|
.appendTo (header);
|
|
1194
1187
|
|
|
1195
|
-
if (node instanceof X3D .
|
|
1188
|
+
if (node instanceof X3D .X3DImportedNodeInstance)
|
|
1196
1189
|
icon .attr ("src", "../images/OutlineEditor/Node/ImportedNode.svg");
|
|
1197
1190
|
else
|
|
1198
1191
|
icon .attr ("src", "../images/OutlineEditor/Node/X3DBaseNode.svg");
|
|
@@ -1448,35 +1441,7 @@ module .exports = class RouteGraph extends Interface
|
|
|
1448
1441
|
|
|
1449
1442
|
findNode (id, add)
|
|
1450
1443
|
{
|
|
1451
|
-
|
|
1452
|
-
node = this .getNode (id),
|
|
1453
|
-
outlineEditor = this .outlineEditor;
|
|
1454
|
-
|
|
1455
|
-
outlineEditor .expandTo (node, { expandObject: true, expandInlineNodes: true, expandAll: true });
|
|
1456
|
-
|
|
1457
|
-
const elements = Array .from (outlineEditor .sceneGraph .find (`.node[node-id=${id}], .imported-node[node-id=${id}]`));
|
|
1458
|
-
|
|
1459
|
-
if (!elements .length)
|
|
1460
|
-
return;
|
|
1461
|
-
|
|
1462
|
-
for (const [i, element] of elements .entries ())
|
|
1463
|
-
{
|
|
1464
|
-
if ($(element) .is (".node"))
|
|
1465
|
-
outlineEditor .selectNodeElement ($(element), { add: add || i > 0, target: true });
|
|
1466
|
-
|
|
1467
|
-
else if ($(element) .is (".imported-node"))
|
|
1468
|
-
outlineEditor .selectPrimaryElement ($(element), { add: add || i > 0, target: true });
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
// Scroll element into view.
|
|
1472
|
-
// Hide scrollbars during scroll to prevent overlay issue.
|
|
1473
|
-
|
|
1474
|
-
outlineEditor .treeView .css ("overflow", "hidden");
|
|
1475
|
-
|
|
1476
|
-
elements [0] ?.scrollIntoView ({ block: "center", inline: "start", behavior: "smooth" });
|
|
1477
|
-
$(window) .scrollTop (0);
|
|
1478
|
-
|
|
1479
|
-
setTimeout (() => outlineEditor .treeView .css ("overflow", ""), 1000);
|
|
1444
|
+
this .outlineEditor .findNode (this .getNode (id), add);
|
|
1480
1445
|
}
|
|
1481
1446
|
|
|
1482
1447
|
selectNode (event, id)
|
|
@@ -1580,7 +1545,7 @@ module .exports = class RouteGraph extends Interface
|
|
|
1580
1545
|
node = this .getNode (id),
|
|
1581
1546
|
executionContext = node .getExecutionContext ();
|
|
1582
1547
|
|
|
1583
|
-
if (executionContext .importedNodes .find (importedNode => importedNode .
|
|
1548
|
+
if (executionContext .importedNodes .find (importedNode => importedNode .getInstance () === node))
|
|
1584
1549
|
continue;
|
|
1585
1550
|
|
|
1586
1551
|
this .removeNode (id);
|
|
@@ -2243,15 +2208,7 @@ module .exports = class RouteGraph extends Interface
|
|
|
2243
2208
|
{
|
|
2244
2209
|
context .fillStyle = selectedColor;
|
|
2245
2210
|
|
|
2246
|
-
|
|
2247
|
-
? route .getSourceNode () .getName ()
|
|
2248
|
-
: route .getSourceNode () .getImportedName ();
|
|
2249
|
-
|
|
2250
|
-
const destinationNodeName = route .getDestinationNode () instanceof X3D .X3DNode
|
|
2251
|
-
? route .getDestinationNode () .getName ()
|
|
2252
|
-
: route .getDestinationNode () .getImportedName ();
|
|
2253
|
-
|
|
2254
|
-
this .nodes .attr ("title", util .format (_("Route from %s<%s>.%s to %s<%s>.%s"), route .getSourceNode () .getTypeName (), sourceNodeName || _("unnamed"), route .sourceField, route .getDestinationNode () .getTypeName (), destinationNodeName || _("unnamed"), route .destinationField));
|
|
2211
|
+
this .nodes .attr ("title", util .format (_("Route from %s<%s>.%s to %s<%s>.%s"), route .getSourceNode () .getTypeName (), route .getSourceNode () .getName () || _("unnamed"), route .sourceField, route .getDestinationNode () .getTypeName (), route .getDestinationNode () .getName () || _("unnamed"), route .destinationField));
|
|
2255
2212
|
}
|
|
2256
2213
|
|
|
2257
2214
|
context .beginPath ();
|
|
@@ -83,9 +83,13 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
83
83
|
.width ("15px")
|
|
84
84
|
.append ($("<input></input>")
|
|
85
85
|
.attr ("type", "checkbox")
|
|
86
|
+
.attr ("id", `scene-properties-${component .name}`)
|
|
86
87
|
.attr ("component", component .name)
|
|
87
88
|
.on ("change", () => this .changeComponents ())))
|
|
88
|
-
.append ($("<td></td>")
|
|
89
|
+
.append ($("<td></td>")
|
|
90
|
+
.append ($("<label></label>")
|
|
91
|
+
.attr ("for", `scene-properties-${component .name}`)
|
|
92
|
+
.text (component .title)))
|
|
89
93
|
.append ($("<td></td>")
|
|
90
94
|
.width ("15px")
|
|
91
95
|
.append ($("<input></input>")
|
|
@@ -228,7 +232,7 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
228
232
|
.append ($("<span></span>") .text (_("Key")))
|
|
229
233
|
.append ($("<span></span>")
|
|
230
234
|
.attr ("title", "Sort column alphabetically.")
|
|
231
|
-
.addClass (["material-
|
|
235
|
+
.addClass (["material-symbols-outlined", "sort-key"])
|
|
232
236
|
.addClass (this .config .file .sortMetaData ? ["active"] : [ ])
|
|
233
237
|
.css ("font-size", "inherit")
|
|
234
238
|
.text ("sort_by_alpha"))
|
|
@@ -487,7 +491,7 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
487
491
|
.append ($("<span></span>")
|
|
488
492
|
.attr ("title", _("Drag to move key/value pair."))
|
|
489
493
|
.css ("font-size", "120%")
|
|
490
|
-
.addClass (["material-
|
|
494
|
+
.addClass (["material-symbols-outlined", "button", "drag"])
|
|
491
495
|
.addClass (this .config .file .sortMetaData ? ["disabled"] : [ ])
|
|
492
496
|
.text ("drag_handle")))
|
|
493
497
|
.append ($("<td></td>")
|
|
@@ -508,7 +512,7 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
508
512
|
.append ($("<span></span>")
|
|
509
513
|
.attr ("title", _("Delete key/value pair."))
|
|
510
514
|
.css ("font-size", "120%")
|
|
511
|
-
.addClass (["material-
|
|
515
|
+
.addClass (["material-symbols-outlined", "button"])
|
|
512
516
|
.text ("delete_forever")
|
|
513
517
|
.on ("click", (event) => this .removeMetaData (event, key))));
|
|
514
518
|
|
|
@@ -526,7 +530,7 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
526
530
|
.addClass ("open-link")
|
|
527
531
|
.attr ("title", _("Open link in web browser."))
|
|
528
532
|
.css ("font-size", "120%")
|
|
529
|
-
.addClass (["material-
|
|
533
|
+
.addClass (["material-symbols-outlined", "button"])
|
|
530
534
|
.text ("open_in_new")
|
|
531
535
|
.appendTo (column)
|
|
532
536
|
.on ("click", () => electron .shell .openExternal (match [1]));
|
|
@@ -24,10 +24,14 @@ monacoLoader .require .config ({
|
|
|
24
24
|
|
|
25
25
|
module .exports = class ScriptEditor extends Interface
|
|
26
26
|
{
|
|
27
|
+
maximizeSeparator = false;
|
|
28
|
+
|
|
27
29
|
constructor (element)
|
|
28
30
|
{
|
|
29
31
|
super (`Sunrize.ScriptEditor.${element .attr ("id")}.`);
|
|
30
32
|
|
|
33
|
+
const darwin = process .platform === "darwin";
|
|
34
|
+
|
|
31
35
|
this .scriptEditor = element;
|
|
32
36
|
|
|
33
37
|
this .verticalSplitter = $("<div></div>")
|
|
@@ -36,6 +40,7 @@ module .exports = class ScriptEditor extends Interface
|
|
|
36
40
|
.appendTo (this .scriptEditor);
|
|
37
41
|
|
|
38
42
|
this .verticalSplitterLeft = $("<div></div>")
|
|
43
|
+
.attr ("id", "script-editor-horizontal")
|
|
39
44
|
.addClass ("vertical-splitter-left")
|
|
40
45
|
.css ("width", "30%")
|
|
41
46
|
.appendTo (this .verticalSplitter);
|
|
@@ -47,14 +52,18 @@ module .exports = class ScriptEditor extends Interface
|
|
|
47
52
|
|
|
48
53
|
this .vSplitter = new Splitter (this .verticalSplitter, "vertical");
|
|
49
54
|
|
|
50
|
-
this .
|
|
55
|
+
this .vSplitter .snapToBorder = true;
|
|
56
|
+
|
|
57
|
+
this .vSplitter .handle .on ("position", () => this .splitterPosition ());
|
|
58
|
+
|
|
59
|
+
// Toolbar
|
|
51
60
|
|
|
52
61
|
this .toolbar = $("<div></div>")
|
|
53
62
|
.addClass (["toolbar", "vertical-toolbar", "secondary-toolbar", "script-editor-toolbar"])
|
|
54
63
|
.appendTo (this .scriptEditor);
|
|
55
64
|
|
|
56
65
|
this .toggleSidebarButton = $("<span></span>")
|
|
57
|
-
.addClass (
|
|
66
|
+
.addClass ("material-symbols-outlined")
|
|
58
67
|
.attr ("title", _("Toggle sidebar."))
|
|
59
68
|
.text ("dock_to_right")
|
|
60
69
|
.appendTo (this .toolbar)
|
|
@@ -63,15 +72,18 @@ module .exports = class ScriptEditor extends Interface
|
|
|
63
72
|
$("<span></span>") .addClass ("separator") .appendTo (this .toolbar);
|
|
64
73
|
|
|
65
74
|
this .createButton = $("<span></span>")
|
|
66
|
-
.addClass ("material-
|
|
67
|
-
.attr ("title", _("Create new Script
|
|
75
|
+
.addClass ("material-symbols-outlined")
|
|
76
|
+
.attr ("title", _("Create new Script or ComposedShader node."))
|
|
68
77
|
.text ("add")
|
|
69
78
|
.appendTo (this .toolbar)
|
|
70
79
|
.on ("click", () => this .create ());
|
|
71
80
|
|
|
72
81
|
this .applyButton = $("<span></span>")
|
|
73
|
-
.addClass ("material-
|
|
74
|
-
.
|
|
82
|
+
.addClass ("material-symbols-outlined")
|
|
83
|
+
.css ("scale", "0.8")
|
|
84
|
+
.attr ("title", darwin
|
|
85
|
+
? _("Save source code in url field. (⌘S)")
|
|
86
|
+
: _("Save source code in url field. (Ctrl+S)"))
|
|
75
87
|
.text ("check_circle")
|
|
76
88
|
.appendTo (this .toolbar)
|
|
77
89
|
.on ("click", () => this .apply (true));
|
|
@@ -79,23 +91,26 @@ module .exports = class ScriptEditor extends Interface
|
|
|
79
91
|
$("<span></span>") .addClass ("separator") .appendTo (this .toolbar);
|
|
80
92
|
|
|
81
93
|
this .directOutputButton = $("<span></span>")
|
|
82
|
-
.addClass ("material-
|
|
94
|
+
.addClass ("material-symbols-outlined")
|
|
95
|
+
.css ("scale", "0.8")
|
|
83
96
|
.attr ("title", _("Toggle direct output."))
|
|
84
97
|
.text ("radio_button_checked")
|
|
85
98
|
.appendTo (this .toolbar)
|
|
86
99
|
.on ("click", () => this .toggleDirectOutput ());
|
|
87
100
|
|
|
88
101
|
this .mustEvaluateButton = $("<span></span>")
|
|
89
|
-
.addClass ("material-
|
|
102
|
+
.addClass ("material-symbols-outlined")
|
|
103
|
+
.css ("scale", "0.8")
|
|
90
104
|
.attr ("title", _("Toggle must evaluate."))
|
|
91
105
|
.text ("priority_high")
|
|
92
106
|
.appendTo (this .toolbar)
|
|
93
107
|
.on ("click", () => this .toggleMustEvaluate ());
|
|
94
108
|
|
|
95
109
|
this .shaderTypeButton = $("<span></span>")
|
|
96
|
-
.addClass ("material-
|
|
110
|
+
.addClass ("material-symbols-outlined")
|
|
111
|
+
.css ("scale", "0.9")
|
|
97
112
|
.attr ("title", _("Change shader type."))
|
|
98
|
-
.text ("
|
|
113
|
+
.text ("change_history")
|
|
99
114
|
.appendTo (this .toolbar)
|
|
100
115
|
.on ("click", () => this .changeShaderType ());
|
|
101
116
|
|
|
@@ -843,7 +858,7 @@ module .exports = class ScriptEditor extends Interface
|
|
|
843
858
|
args: ["createScript"],
|
|
844
859
|
},
|
|
845
860
|
{
|
|
846
|
-
label: _("Create New
|
|
861
|
+
label: _("Create New ComposedShader"),
|
|
847
862
|
args: ["createShader"],
|
|
848
863
|
},
|
|
849
864
|
];
|
|
@@ -1035,10 +1050,14 @@ main ()
|
|
|
1035
1050
|
const menu = [
|
|
1036
1051
|
{
|
|
1037
1052
|
label: "VERTEX",
|
|
1053
|
+
type: "radio",
|
|
1054
|
+
checked: !this .node ._type .equals ("FRAGMENT"),
|
|
1038
1055
|
args: ["changeShaderTypeTo", "VERTEX"],
|
|
1039
1056
|
},
|
|
1040
1057
|
{
|
|
1041
1058
|
label: "FRAGMENT",
|
|
1059
|
+
type: "radio",
|
|
1060
|
+
checked: this .node ._type .equals ("FRAGMENT"),
|
|
1042
1061
|
args: ["changeShaderTypeTo", "FRAGMENT"],
|
|
1043
1062
|
},
|
|
1044
1063
|
];
|
|
@@ -1057,35 +1076,30 @@ main ()
|
|
|
1057
1076
|
{
|
|
1058
1077
|
case "VERTEX":
|
|
1059
1078
|
{
|
|
1060
|
-
this .shaderTypeButton .text ("
|
|
1079
|
+
this .shaderTypeButton .text ("change_history");
|
|
1061
1080
|
break;
|
|
1062
1081
|
}
|
|
1063
1082
|
case "FRAGMENT":
|
|
1064
1083
|
{
|
|
1065
|
-
this .shaderTypeButton .text ("
|
|
1084
|
+
this .shaderTypeButton .text ("grain");
|
|
1066
1085
|
break;
|
|
1067
1086
|
}
|
|
1068
1087
|
}
|
|
1069
1088
|
}
|
|
1070
1089
|
|
|
1071
|
-
|
|
1090
|
+
splitterPosition ()
|
|
1072
1091
|
{
|
|
1073
1092
|
if (this .vSplitter .position)
|
|
1074
|
-
this .toggleSidebarButton .addClass ("active");
|
|
1093
|
+
this .toggleSidebarButton .addClass (["active", "fill"]);
|
|
1075
1094
|
else
|
|
1076
|
-
this .toggleSidebarButton .removeClass ("active");
|
|
1095
|
+
this .toggleSidebarButton .removeClass (["active", "fill"]);
|
|
1077
1096
|
}
|
|
1078
1097
|
|
|
1079
1098
|
toggleSidebar ()
|
|
1080
1099
|
{
|
|
1081
1100
|
if (this .vSplitter .position)
|
|
1082
|
-
|
|
1083
|
-
this .config .file .vSplitterPosition = this .vSplitter .position;
|
|
1084
|
-
this .vSplitter .position = 0;
|
|
1085
|
-
}
|
|
1101
|
+
this .vSplitter .toggle ("minimize");
|
|
1086
1102
|
else
|
|
1087
|
-
|
|
1088
|
-
this .vSplitter .position = this .config .file .vSplitterPosition;
|
|
1089
|
-
}
|
|
1103
|
+
this .vSplitter .toggle ("restore");
|
|
1090
1104
|
}
|
|
1091
1105
|
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const
|
|
5
|
+
$ = require ("jquery"),
|
|
6
|
+
Interface = require ("../Application/Interface"),
|
|
7
|
+
electron = require ("electron"),
|
|
8
|
+
fs = require ("fs"),
|
|
9
|
+
_ = require ("../Application/GetText");
|
|
10
|
+
|
|
11
|
+
module .exports = class VideoRecorder extends Interface
|
|
12
|
+
{
|
|
13
|
+
static mimeTypes = [
|
|
14
|
+
["MP4", "video/mp4", "mp4"],
|
|
15
|
+
["WebM", "video/webm", "webm"],
|
|
16
|
+
["OGG", "video/ogg", "ogv"],
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
constructor (element)
|
|
20
|
+
{
|
|
21
|
+
super (`Sunrize.VideoRecorder.${element .attr ("id")}.`);
|
|
22
|
+
|
|
23
|
+
this .recorder = element;
|
|
24
|
+
|
|
25
|
+
this .left = $("<div></div>")
|
|
26
|
+
.addClass ("video-recorder-left")
|
|
27
|
+
.appendTo (this .recorder);
|
|
28
|
+
|
|
29
|
+
// Toolbar
|
|
30
|
+
|
|
31
|
+
this .toolbar = $("<div></div>")
|
|
32
|
+
.addClass (["toolbar", "vertical-toolbar", "secondary-toolbar", "video-recorder-toolbar"])
|
|
33
|
+
.appendTo (this .recorder);
|
|
34
|
+
|
|
35
|
+
this .setup ();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#desktop;
|
|
39
|
+
|
|
40
|
+
async initialize ()
|
|
41
|
+
{
|
|
42
|
+
this .#desktop = await electron .ipcRenderer .invoke ("path", "desktop");
|
|
43
|
+
|
|
44
|
+
// Toolbar
|
|
45
|
+
|
|
46
|
+
this .recordButton = $("<span></span>")
|
|
47
|
+
.addClass (["material-symbols-outlined"])
|
|
48
|
+
.attr ("title", _("Start recording."))
|
|
49
|
+
.text ("screen_record")
|
|
50
|
+
.on ("click", () => this .toggleRecord ())
|
|
51
|
+
.appendTo (this .toolbar);
|
|
52
|
+
|
|
53
|
+
this .settingsButton = $("<span></span>")
|
|
54
|
+
.addClass (["material-symbols-outlined"])
|
|
55
|
+
.attr ("title", _("Edit settings."))
|
|
56
|
+
.text ("settings")
|
|
57
|
+
.on ("click", () => this .showSettings ())
|
|
58
|
+
.appendTo (this .toolbar);
|
|
59
|
+
|
|
60
|
+
this .mimeTypeButton = $("<select></select>");
|
|
61
|
+
|
|
62
|
+
for (const [name, mimeType] of VideoRecorder .mimeTypes)
|
|
63
|
+
{
|
|
64
|
+
if (!MediaRecorder .isTypeSupported (mimeType))
|
|
65
|
+
continue;
|
|
66
|
+
|
|
67
|
+
$("<option></option>")
|
|
68
|
+
.text (name)
|
|
69
|
+
.val (mimeType)
|
|
70
|
+
.appendTo (this .mimeTypeButton);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
#record = false;
|
|
75
|
+
#timeoutId;
|
|
76
|
+
#mimeType;
|
|
77
|
+
#recorder;
|
|
78
|
+
#blob;
|
|
79
|
+
|
|
80
|
+
toggleRecord ()
|
|
81
|
+
{
|
|
82
|
+
if (this .#record)
|
|
83
|
+
this .stopRecord ();
|
|
84
|
+
else
|
|
85
|
+
this .startRecord ();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async startRecord ()
|
|
89
|
+
{
|
|
90
|
+
const stream = this .browser .getElement () .captureStream (30);
|
|
91
|
+
|
|
92
|
+
this .#timeoutId = setTimeout (() => this .stopRecord (), 60_000);
|
|
93
|
+
this .#mimeType = this .mimeTypeButton .val ();
|
|
94
|
+
this .#recorder = new MediaRecorder (stream, { mimeType: this .#mimeType });
|
|
95
|
+
|
|
96
|
+
const chunks = [ ];
|
|
97
|
+
|
|
98
|
+
this .#recorder .addEventListener ("dataavailable", event =>
|
|
99
|
+
{
|
|
100
|
+
if (event .data .size > 0)
|
|
101
|
+
chunks .push (event .data);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
this .#blob = new Promise (resolve =>
|
|
105
|
+
{
|
|
106
|
+
this .#recorder .addEventListener ("stop", () =>
|
|
107
|
+
{
|
|
108
|
+
resolve (new Blob (chunks, { type: this .#mimeType }));
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
this .#recorder .start ();
|
|
113
|
+
|
|
114
|
+
// Toggle State
|
|
115
|
+
|
|
116
|
+
this .#record = true;
|
|
117
|
+
|
|
118
|
+
this .recordButton .addClass ("active");
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async stopRecord ()
|
|
122
|
+
{
|
|
123
|
+
clearTimeout (this .#timeoutId);
|
|
124
|
+
|
|
125
|
+
this .#recorder .stop ();
|
|
126
|
+
|
|
127
|
+
const
|
|
128
|
+
suffix = VideoRecorder .mimeTypes .find (([, mimeType]) => mimeType === this .#mimeType) [2],
|
|
129
|
+
blob = await this .#blob,
|
|
130
|
+
buffer = Buffer .from (await blob .arrayBuffer ());
|
|
131
|
+
|
|
132
|
+
fs .writeFileSync (`${this .#desktop}/test.${suffix}`, buffer);
|
|
133
|
+
|
|
134
|
+
// Toggle State
|
|
135
|
+
|
|
136
|
+
this .#record = false;
|
|
137
|
+
|
|
138
|
+
this .recordButton .removeClass ("active");
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
showSettings ()
|
|
142
|
+
{
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
};
|
|
@@ -4,10 +4,10 @@ const handler =
|
|
|
4
4
|
{
|
|
5
5
|
get (target, key)
|
|
6
6
|
{
|
|
7
|
-
if (
|
|
8
|
-
return target
|
|
7
|
+
if (Reflect .has (target, key))
|
|
8
|
+
return Reflect .get (target, key);
|
|
9
9
|
|
|
10
|
-
const property = target .node
|
|
10
|
+
const property = Reflect .get (target .node, key);
|
|
11
11
|
|
|
12
12
|
if (typeof property === "function")
|
|
13
13
|
return property .bind (target .node);
|
|
@@ -16,24 +16,25 @@ const handler =
|
|
|
16
16
|
},
|
|
17
17
|
set (target, key, value)
|
|
18
18
|
{
|
|
19
|
-
if (
|
|
20
|
-
target
|
|
21
|
-
else
|
|
22
|
-
target .node [key] = value;
|
|
19
|
+
if (Reflect .has (target, key))
|
|
20
|
+
return Reflect .set (target, key, value);
|
|
23
21
|
|
|
24
|
-
return
|
|
22
|
+
return Reflect .set (target .node, key, value);
|
|
25
23
|
},
|
|
26
24
|
has (target, key)
|
|
27
25
|
{
|
|
28
|
-
return
|
|
26
|
+
return Reflect .has (target, key)
|
|
27
|
+
|| Reflect .has (target .node, key);
|
|
29
28
|
},
|
|
30
29
|
ownKeys (target)
|
|
31
30
|
{
|
|
32
|
-
return
|
|
31
|
+
return Array .from (new Set (Reflect .ownKeys (target)
|
|
32
|
+
.concat (Reflect .ownKeys (target .node))));
|
|
33
33
|
},
|
|
34
34
|
getOwnPropertyDescriptor (target, key)
|
|
35
35
|
{
|
|
36
|
-
return
|
|
36
|
+
return Reflect .getOwnPropertyDescriptor (target, key)
|
|
37
|
+
?? Reflect .getOwnPropertyDescriptor (target .node, key);
|
|
37
38
|
},
|
|
38
39
|
getPrototypeOf (target)
|
|
39
40
|
{
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const X3DNodeTool = require ("./X3DNodeTool");
|
|
4
|
+
|
|
5
|
+
class X3DImportedNodeInstanceTool extends X3DNodeTool
|
|
6
|
+
{
|
|
7
|
+
#tool;
|
|
8
|
+
|
|
9
|
+
constructor (node)
|
|
10
|
+
{
|
|
11
|
+
super (node);
|
|
12
|
+
|
|
13
|
+
node .typeName_changed .addInterest ("updateTool", this);
|
|
14
|
+
|
|
15
|
+
this .updateTool ();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
updateTool ()
|
|
19
|
+
{
|
|
20
|
+
try
|
|
21
|
+
{
|
|
22
|
+
this .#tool = this .node .getInnerNode () .addTool ();
|
|
23
|
+
|
|
24
|
+
this .#tool .toolPointing = false;
|
|
25
|
+
}
|
|
26
|
+
catch
|
|
27
|
+
{
|
|
28
|
+
this .#tool = null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
disposeTool ()
|
|
33
|
+
{
|
|
34
|
+
try
|
|
35
|
+
{
|
|
36
|
+
this .node .typeName_changed .removeInterest ("updateTool", this);
|
|
37
|
+
|
|
38
|
+
this .node .getInnerNode () .removeTool ();
|
|
39
|
+
}
|
|
40
|
+
catch
|
|
41
|
+
{ }
|
|
42
|
+
|
|
43
|
+
super .disposeTool ();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
getInnerNode ()
|
|
47
|
+
{
|
|
48
|
+
return this .#tool;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
module .exports = X3DImportedNodeInstanceTool;
|