sunrize 1.10.3 → 1.11.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.
@@ -9,20 +9,18 @@ const
9
9
 
10
10
  module .exports = class NodeList extends Interface
11
11
  {
12
- constructor (element, filter = () => true, callback = Function .prototype)
12
+ constructor (element, { filter = () => true, callback = Function .prototype })
13
13
  {
14
14
  super ("Sunrize.NodeList.");
15
15
 
16
16
  this .nodeList = element;
17
+ this .list = $("<ul></ul>") .appendTo (this .nodeList);
17
18
  this .filter = filter;
18
19
  this .callback = callback;
19
20
  this .executionContext = null;
20
21
  this .node = null;
21
22
  this .nodes = [ ];
22
23
 
23
- this .list = $("<ul></ul>")
24
- .appendTo (this .nodeList);
25
-
26
24
  this .setup ();
27
25
  }
28
26
 
@@ -61,16 +59,23 @@ module .exports = class NodeList extends Interface
61
59
 
62
60
  for (const node of this .nodes)
63
61
  {
64
- const listItem = $("<li></li>")
62
+ const
63
+ typeNameElement = $("<span></span>") .addClass ("type-name") .text (node .getTypeName ()),
64
+ nameElement = $("<span></span>") .addClass ("name") .text (this .getName (node));
65
+
66
+ const listItem = $("<li></li>") .appendTo (this .list);
67
+
68
+ $("<div></div>")
69
+ .addClass ("item")
65
70
  .append ($("<img></img>") .addClass ("icon") .attr ("src", "../images/OutlineEditor/Node/X3DBaseNode.svg"))
66
- .append ($("<span></span>") .addClass ("type-name") .text (node .getTypeName ()))
71
+ .append (typeNameElement)
67
72
  .append (document .createTextNode (" "))
68
- .append ($("<span></span>") .addClass ("name") .text (this .getName (node)))
73
+ .append (nameElement)
69
74
  .on ("click", () => this .setNode (node))
70
- .appendTo (this .list);
75
+ .appendTo (listItem);
71
76
 
72
- node .typeName_changed .addInterest ("set_typeName", this, listItem, node);
73
- node .name_changed .addInterest ("set_name", this, listItem, node);
77
+ node .typeName_changed .addInterest ("set_typeName", this, typeNameElement, node);
78
+ node .name_changed .addInterest ("set_name", this, nameElement, node);
74
79
  }
75
80
 
76
81
  this .nodeList .scrollTop (scrollTop);
@@ -92,7 +97,7 @@ module .exports = class NodeList extends Interface
92
97
 
93
98
  getNodes ()
94
99
  {
95
- return Array .from (this .executionContext .traverse (Traverse .PROTO_DECLARATIONS | Traverse .PROTO_DECLARATION_BODY | Traverse .ROOT_NODES), node => node instanceof X3D .SFNode ? node .getValue () : node);
100
+ return Array .from (this .executionContext .traverse (Traverse .PROTO_DECLARATIONS | Traverse .PROTO_DECLARATION_BODY | Traverse .ROOT_NODES), node => node instanceof X3D .SFNode ? node .getValue () .valueOf () : node .valueOf ());
96
101
  }
97
102
 
98
103
  getName (node)
@@ -110,13 +115,13 @@ module .exports = class NodeList extends Interface
110
115
  return name;
111
116
  }
112
117
 
113
- set_typeName (listItem, node)
118
+ set_typeName (element, node)
114
119
  {
115
- listItem .find (".type-name") .text (node .getTypeName ());
120
+ element .text (node .getTypeName ());
116
121
  }
117
122
 
118
- set_name (listItem, node)
123
+ set_name (element, node)
119
124
  {
120
- listItem .find (".name") .text (node .getName ());
125
+ element .text (this .getName (node));
121
126
  }
122
127
  };
@@ -21,7 +21,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
21
21
 
22
22
  element .on ("contextmenu", (event) => this .showContextMenu (event));
23
23
 
24
- electron .ipcRenderer .on ("outline-editor", (event, key, ...args) => this [key] (...args));
24
+ electron .ipcRenderer .on ("outline-editor", (event, key, ... args) => this [key] (... args));
25
25
 
26
26
  electron .ipcRenderer .on ("transform-to-zero", () => this .transformToZero ());
27
27
  electron .ipcRenderer .on ("remove-empty-groups", () => this .removeEmptyGroups ());
@@ -1605,7 +1605,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1605
1605
  {
1606
1606
  const node = this .objects .get (nodeId);
1607
1607
 
1608
- UndoManager .shared .beginUndo (_("Determine Bounding Box From Scratch"));
1608
+ UndoManager .shared .beginUndo (_("Determine Bounding Box from Scratch"));
1609
1609
 
1610
1610
  Editor .setFieldValue (node .getExecutionContext (), node, node ._bboxSize, new X3D .Vector3 (-1, -1, -1));
1611
1611
  Editor .setFieldValue (node .getExecutionContext (), node, node ._bboxCenter, new X3D .Vector3 ());
@@ -2116,7 +2116,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
2116
2116
  {
2117
2117
  Editor .setFieldValue (this .browser .currentScene, node, node ._startTime, Date .now () / 1000);
2118
2118
 
2119
- node ._isEvenLive = true;
2119
+ node ._evenLive = true;
2120
2120
  }
2121
2121
  }
2122
2122
 
@@ -2146,7 +2146,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
2146
2146
  Editor .setFieldValue (this .browser .currentScene, node, node ._loop, !node ._loop .getValue ());
2147
2147
 
2148
2148
  if (node ._loop .getValue () && node ._startTime .getValue () >= node ._stopTime .getValue ())
2149
- node ._isEvenLive = true;
2149
+ node ._evenLive = true;
2150
2150
  }
2151
2151
 
2152
2152
  addBooleanField (button)
@@ -18,8 +18,10 @@ module .exports = class OutlineRouteGraph extends OutlineView
18
18
  {
19
19
  super .colorScheme (shouldUseDarkColors);
20
20
 
21
- this .routeColor = window .getComputedStyle ($("body") [0]) .getPropertyValue ("--system-gray1");
22
- this .routeSelectedColor = window .getComputedStyle ($("body") [0]) .getPropertyValue ("--system-red");
21
+ const style = window .getComputedStyle ($("body") [0]);
22
+
23
+ this .routeColor = style .getPropertyValue ("--system-gray0");
24
+ this .routeSelectedColor = style .getPropertyValue ("--system-red");
23
25
 
24
26
  this .requestUpdateRouteGraph ();
25
27
  }
@@ -1394,7 +1394,7 @@ module .exports = class OutlineView extends Interface
1394
1394
  buttons .slice (-3) .forEach (button => button .hide ());
1395
1395
 
1396
1396
  if (!node ._isActive .getValue ())
1397
- node ._isEvenLive = false;
1397
+ node ._evenLive = false;
1398
1398
  }
1399
1399
 
1400
1400
  isInParents (parent, node)
@@ -16,12 +16,12 @@ const
16
16
  monacoLoader = require ("monaco-editor/min/vs/loader.js"),
17
17
  _ = require ("../Application/GetText");
18
18
 
19
+ require ("../Controls/RenameNodeInput");
20
+
19
21
  monacoLoader .require .config ({
20
22
  baseUrl: url .pathToFileURL (path .resolve (path .dirname (require .resolve ("monaco-editor/package.json")), "min")) + "/",
21
23
  });
22
24
 
23
- require ("../Controls/RenameNodeInput");
24
-
25
25
  module .exports = class ScriptEditor extends Interface
26
26
  {
27
27
  constructor (element)
@@ -112,16 +112,21 @@ module .exports = class ScriptEditor extends Interface
112
112
  this .hSplitter = new Splitter (this .verticalSplitterLeft, "horizontal");
113
113
 
114
114
  this .nodeListElement = $("<div></div>")
115
- .addClass ("node-list")
115
+ .addClass (["alternating", "node-list"])
116
116
  .appendTo (this .horizontalSplitterTop);
117
117
 
118
118
  this .nodeName = $("<input></input>")
119
119
  .addClass ("node-name")
120
+ .attr ("title", _("Rename node."))
120
121
  .attr ("placeholder", _("Enter node name."))
121
122
  .appendTo (this .horizontalSplitterTop)
122
- .renameNodeInput (null, null);
123
+ .renameNodeInput (null);
123
124
 
124
- this .nodeList = new NodeList (this .nodeListElement, node => node .getTypeName () .match (/^(?:Script|ShaderPart)$/), node => this .setNode (node));
125
+ this .nodeList = new NodeList (this .nodeListElement,
126
+ {
127
+ filter: node => node .getTypeName () .match (/^(?:Script|ShaderPart)$/),
128
+ callback: node => this .setNode (node),
129
+ });
125
130
 
126
131
  this .consoleElement = $("<div></div>")
127
132
  .attr ("id", "script-editor-console")
@@ -130,7 +135,7 @@ module .exports = class ScriptEditor extends Interface
130
135
 
131
136
  this .console = new Console (this .consoleElement);
132
137
 
133
- electron .ipcRenderer .on ("script-editor", (event, key, ...args) => this [key] (...args));
138
+ electron .ipcRenderer .on ("script-editor", (event, key, ... args) => this [key] (... args));
134
139
 
135
140
  // Setup.
136
141
 
@@ -233,7 +238,7 @@ module .exports = class ScriptEditor extends Interface
233
238
  }
234
239
  else
235
240
  {
236
- this .nodeName .renameNodeInput (null, null);
241
+ this .nodeName .renameNodeInput (null);
237
242
  this .applyButton .hide ();
238
243
  this .monaco ?.detach ();
239
244
 
@@ -13,6 +13,11 @@ const
13
13
 
14
14
  module .exports = class Editor
15
15
  {
16
+ /**
17
+ * Shard UndoManager
18
+ */
19
+ static get undoManager () { return UndoManager .shared; }
20
+
16
21
  /**
17
22
  * X3D Id
18
23
  */
@@ -1729,7 +1734,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
1729
1734
  sourceNode = sourceNode .valueOf ();
1730
1735
  destinationNode = destinationNode .valueOf ();
1731
1736
 
1732
- undoManager .beginUndo (_("Add Route From %s »%s« TO %s »%s«"), sourceNode .getTypeName (), sourceField, destinationNode .getTypeName (), destinationField);
1737
+ undoManager .beginUndo (_("Add Route from %s »%s« to %s »%s«"), sourceNode .getTypeName (), sourceField, destinationNode .getTypeName (), destinationField);
1733
1738
 
1734
1739
  try
1735
1740
  {
@@ -1791,7 +1796,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
1791
1796
  sourceNode = sourceNode .valueOf ();
1792
1797
  destinationNode = destinationNode .valueOf ();
1793
1798
 
1794
- undoManager .beginUndo (_("Delete Route From %s »%s« TO %s »%s«"), sourceNode .getTypeName (), sourceField, destinationNode .getTypeName (), destinationField);
1799
+ undoManager .beginUndo (_("Delete Route from %s »%s« to %s »%s«"), sourceNode .getTypeName (), sourceField, destinationNode .getTypeName (), destinationField);
1795
1800
 
1796
1801
  executionContext .deleteRoute (sourceNode .valueOf (), sourceField, destinationNode .valueOf (), destinationField);
1797
1802
 
@@ -112,9 +112,9 @@ module .exports = class UndoManager
112
112
  *
113
113
  * @param {...string} args description
114
114
  */
115
- beginUndo (...args)
115
+ beginUndo (... args)
116
116
  {
117
- this .undoStack .push (util .format (...args));
117
+ this .undoStack .push (util .format (... args));
118
118
  }
119
119
 
120
120
  endUndo ()
package/src/X3D.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- const X3D = require ("x_ite/x_ite.min.js");
3
+ const X3D = require ("x_ite");
4
4
 
5
5
  X3D .TYPE_SCRIPT_PATH = require .resolve ("x_ite/x_ite.d.ts");
6
6
  X3D .X3DUOM_PATH = require .resolve ("x_ite/X3DUOM.xml");
@@ -7,6 +7,11 @@ html {
7
7
  height: 100%;
8
8
  }
9
9
 
10
+ body {
11
+ --input-height: 20px;
12
+ --scrollbar-width: 14px;
13
+ }
14
+
10
15
  body {
11
16
  overflow: hidden;
12
17
  height: 100%;
@@ -37,8 +42,8 @@ body {
37
42
  /* Scrollbars */
38
43
 
39
44
  ::-webkit-scrollbar {
40
- width: 14px;
41
- height: 14px;
45
+ width: var(--scrollbar-width);
46
+ height: var(--scrollbar-width);
42
47
  }
43
48
 
44
49
  ::-webkit-scrollbar-track, /* Track */
@@ -96,6 +101,13 @@ th, td,
96
101
  color: var(--text-color);
97
102
  }
98
103
 
104
+ select option {
105
+ font-family: var(--sans-serif);
106
+ font-size: var(--font-size);
107
+ color: var(--text-color);
108
+ background: var(--background-color);
109
+ }
110
+
99
111
  .ui-widget label {
100
112
  position: relative;
101
113
  top: -2px;
@@ -452,6 +464,10 @@ body.light .qtip-tipsy {
452
464
  padding: 8px;
453
465
  }
454
466
 
467
+ .qtip span {
468
+ display: block;
469
+ }
470
+
455
471
  .qtip input,
456
472
  .qtip select,
457
473
  .qtip button {
@@ -460,23 +476,35 @@ body.light .qtip-tipsy {
460
476
  background: var(--background-color);
461
477
  border: 1px solid var(--system-gray7);
462
478
  filter: opacity(80%);
479
+ margin: 2px 0;
480
+ }
481
+
482
+ .qtip input[type=checkbox] {
483
+ display: inline-block;
484
+ width: auto;
485
+ margin: 4px 0 0 0;
463
486
  }
464
487
 
465
- .qtip .qtip-content > div > * {
466
- margin: 0.3em 0em;
488
+ .qtip label {
489
+ display: inline-block;
490
+ width: auto;
491
+ position: relative;
492
+ margin-left: 5px !important;
493
+ top: -2px;
494
+ margin: 4px 0 0 0;
467
495
  }
468
496
 
469
497
  .qtip .qtip-content > div:first-child {
470
- margin-top: 0em;
498
+ margin-top: 0;
471
499
  }
472
500
 
473
501
  .qtip .qtip-content > div:last-child {
474
- margin-bottom: 0em;
502
+ margin-bottom: 0;
475
503
  }
476
504
 
477
505
  .qtip select:hover,
478
506
  .qtip button:hover {
479
- background-color: var(--system-gray4);
507
+ background-color: var(--system-gray8);
480
508
  color: var(--system-gray0);
481
509
  }
482
510
 
@@ -548,7 +576,8 @@ body.light .qtip-tipsy {
548
576
  font-size: var(--font-size);
549
577
  }
550
578
 
551
- .horizontal-toolbar .input {
579
+ .horizontal-toolbar .input,
580
+ .horizontal-toolbar .select {
552
581
  display: inline-block;
553
582
  position: relative;
554
583
  top: -3px;
@@ -593,6 +622,7 @@ body.light .qtip-tipsy {
593
622
  .horizontal-toolbar .material-symbols-outlined.disabled,
594
623
  .horizontal-toolbar .text.disabled,
595
624
  .horizontal-toolbar .input.disabled,
625
+ .horizontal-toolbar .select.disabled,
596
626
  .vertical-toolbar .material-icons.disabled,
597
627
  .vertical-toolbar .material-symbols-outlined.disabled {
598
628
  pointer-events: none;
@@ -876,6 +906,16 @@ body.dark .ui-widget .library-list .component {
876
906
  color: var(--system-gray0);
877
907
  }
878
908
 
909
+ .node-list .button.disabled {
910
+ pointer-events: none;
911
+ color: var(--system-gray3);
912
+ }
913
+
914
+ .node-list .bold {
915
+ font-weight: bold;
916
+ color: var(--system-brown);
917
+ }
918
+
879
919
  /* Footer */
880
920
 
881
921
  #footer {
@@ -1025,8 +1065,6 @@ body.dark .ui-widget .library-list .component {
1025
1065
  /* Script Editor */
1026
1066
 
1027
1067
  .script-editor {
1028
- --input-height: 20px;
1029
-
1030
1068
  box-sizing: border-box;
1031
1069
  }
1032
1070
 
@@ -1074,8 +1112,6 @@ body.dark .ui-widget .library-list .component {
1074
1112
  /* Animation Editor */
1075
1113
 
1076
1114
  .animation-editor {
1077
- --input-height: 20px;
1078
-
1079
1115
  box-sizing: border-box;
1080
1116
  }
1081
1117
 
@@ -1103,6 +1139,17 @@ body.dark .ui-widget .library-list .component {
1103
1139
  border-left: 1px solid var(--border-color);
1104
1140
  }
1105
1141
 
1142
+ .animation-editor .pointer {
1143
+ cursor: pointer;
1144
+ }
1145
+
1146
+ .animation-editor .scrollbar {
1147
+ position: absolute;
1148
+ bottom: 0;
1149
+ height: var(--scrollbar-width);
1150
+ background: var(--scrollbar-thumb-color);
1151
+ }
1152
+
1106
1153
  .animation-editor .node-list {
1107
1154
  bottom: var(--input-height);
1108
1155
  border-bottom: 1px solid var(--border-color);
@@ -2,23 +2,25 @@
2
2
 
3
3
  @media (prefers-color-scheme: light) {
4
4
  body {
5
+ color-scheme: light;
6
+
5
7
  /* Colors */
6
8
 
7
- --system-red: rgb(255, 59, 48);
8
- --system-orange: rgb(255, 149, 0);
9
- --system-yellow: rgb(255, 214, 10);
9
+ --system-red: rgb(255, 56, 60);
10
+ --system-orange: rgb(255, 141, 40);
11
+ --system-yellow: rgb(255, 204, 0);
10
12
  --system-green: rgb(52, 199, 89);
11
- --system-mint: rgb(0, 199, 190);
12
- --system-teal: rgb(48, 176, 199);
13
- --system-cyan: rgb(50, 173, 230);
14
- --system-blue: rgb(0, 122, 255);
13
+ --system-mint: rgb(0, 200, 179);
14
+ --system-teal: rgb(0, 195, 208);
15
+ --system-cyan: rgb(0, 192, 232);
16
+ --system-blue: rgb(0, 136, 255);
15
17
  --system-indigo: rgb(88, 86, 214);
16
- --system-purple: rgb(175, 82, 222);
18
+ --system-purple: rgb(97, 85, 245);
17
19
  --system-pink: rgb(255, 45, 85);
18
- --system-brown: rgb(162, 132, 94);
20
+ --system-brown: rgb(172, 127, 94);
19
21
 
20
22
  --system-gray0: rgb(72, 72, 77);
21
- --system-gray1: rgb(122, 122, 127);
23
+ --system-gray1: rgb(142, 142, 147);
22
24
  --system-gray2: rgb(174, 174, 178);
23
25
  --system-gray3: rgb(199, 199, 204);
24
26
  --system-gray4: rgb(209, 209, 214);
@@ -30,6 +32,7 @@
30
32
  --selection-color: black;
31
33
  --selection-background-color: rgb(246, 196, 197);
32
34
  --scrollbar-thumb-color: rgba(0, 0, 0, 0.2);
35
+ --selection-range: rgba(0, 0, 0, 0.05);
33
36
  }
34
37
 
35
38
  /* TweakPanel colors */
@@ -64,20 +67,22 @@
64
67
 
65
68
  @media (prefers-color-scheme: dark) {
66
69
  body {
70
+ color-scheme: dark;
71
+
67
72
  /* Colors */
68
73
 
69
- --system-red: rgb(255, 69, 58);
70
- --system-orange: rgb(255, 159, 10);
71
- --system-yellow: rgb(255, 214, 10);
74
+ --system-red: rgb(255, 66, 69);
75
+ --system-orange: rgb(255, 146, 48);
76
+ --system-yellow: rgb(255, 214, 0);
72
77
  --system-green: rgb(48, 209, 88);
73
- --system-mint: rgb(102, 212, 207);
74
- --system-teal: rgb(64, 200, 224);
75
- --system-cyan: rgb(100, 210, 255);
76
- --system-blue: rgb(10, 132, 255);
77
- --system-indigo: rgb(94, 92, 230);
78
- --system-purple: rgb(191, 90, 242);
78
+ --system-mint: rgb(0, 218, 195);
79
+ --system-teal: rgb(0, 210, 224);
80
+ --system-cyan: rgb(60, 211, 254);
81
+ --system-blue: rgb(0, 145, 255);
82
+ --system-indigo: rgb(107, 93, 255);
83
+ --system-purple: rgb(219, 52, 242);
79
84
  --system-pink: rgb(255, 55, 95);
80
- --system-brown: rgb(172, 142, 104);
85
+ --system-brown: rgb(183, 138, 102);
81
86
 
82
87
  --system-gray0: rgb(204, 204, 209);
83
88
  --system-gray1: rgb(142, 142, 147);
@@ -92,6 +97,7 @@
92
97
  --selection-color: white;
93
98
  --selection-background-color: rgb(167, 118, 119);
94
99
  --scrollbar-thumb-color: rgba(255, 255, 255, 0.2);
100
+ --selection-range: rgba(255, 255, 255, 0.05);
95
101
  }
96
102
 
97
103
  /* TweakPanel colors */
@@ -125,8 +131,8 @@ body {
125
131
  /* Special Colors */
126
132
 
127
133
  --sidebar-background-color: rgb(208, 219, 231);
128
- --tint-color1: rgba(255, 255, 255, 0.3);
129
- --tint-color2: rgba(255, 255, 255, 0.5);
134
+ --tint-color1: rgba(255, 255, 255, 0.5);
135
+ --tint-color2: rgba(255, 255, 255, 1);
130
136
  }
131
137
 
132
138
  @media (prefers-color-scheme: dark) {