sunrize 1.0.11 → 1.0.13

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": "1.0.11",
4
+ "version": "1.0.13",
5
5
  "description": "A Multi Platform X3D Editor",
6
6
  "homepage": "https://create3000.github.io/sunrize/",
7
7
  "author": "Holger Seelig",
@@ -35,11 +35,11 @@
35
35
  ],
36
36
  "devDependencies": {
37
37
  "@electron-forge/cli": "^6.0.5",
38
- "@electron-forge/maker-deb": "^6.0.5",
39
- "@electron-forge/maker-rpm": "^6.0.5",
38
+ "@electron-forge/maker-deb": "^6.1.0",
39
+ "@electron-forge/maker-rpm": "^6.1.0",
40
40
  "@electron-forge/maker-squirrel": "^6.0.5",
41
41
  "@electron-forge/maker-zip": "^6.0.5",
42
- "electron": "^23.1.2"
42
+ "electron": "^23.2.0"
43
43
  },
44
44
  "dependencies": {
45
45
  "capitalize": "^2.0.4",
@@ -50,14 +50,15 @@
50
50
  "jquery": "^3.6.4",
51
51
  "jquery-ui-dist": "^1.13.2",
52
52
  "jstree": "^3.3.15",
53
- "material-icons": "^1.13.2",
54
- "material-symbols": "^0.5.0",
53
+ "material-icons": "^1.13.3",
54
+ "material-symbols": "^0.5.3",
55
55
  "md5": "^2.3.0",
56
56
  "monaco-editor": "^0.36.1",
57
57
  "node-localstorage": "^2.2.1",
58
58
  "qtip2": "^3.0.3",
59
59
  "spectrum-colorpicker2": "^2.0.10",
60
- "x_ite": "latest"
60
+ "string-similarity": "^4.0.4",
61
+ "x_ite": "^8.6.13"
61
62
  },
62
63
  "main": "src/main.js",
63
64
  "bin": {
@@ -122,7 +122,14 @@ module .exports = new class Tabs
122
122
  this .openTabs (openTabs, false)
123
123
 
124
124
  if (this .tabs .getTabs () .length)
125
- this .getTabByURL (activeTab)?.activate ()
125
+ {
126
+ const tab = this .getTabByURL (activeTab)
127
+
128
+ if (tab)
129
+ tab .activate ()
130
+ else
131
+ this .tabs .getTabByPosition (0) .activate ()
132
+ }
126
133
  else
127
134
  this .openTabs ()
128
135
  }
@@ -63,7 +63,7 @@ module .exports = class Splitter extends Interface
63
63
 
64
64
  get position ()
65
65
  {
66
- this .config .file .position
66
+ return this .config .file .position
67
67
  }
68
68
 
69
69
  /**
@@ -1,13 +1,14 @@
1
1
  "use strict"
2
2
 
3
3
  const
4
- $ = require ("jquery"),
5
- X3D = require ("../X3D"),
6
- Dialog = require ("../Controls/Dialog"),
7
- Editor = require ("../Undo/Editor"),
8
- UndoManager = require ("../Undo/UndoManager"),
9
- Primitives = require ("./Primitives"),
10
- _ = require ("../Application/GetText")
4
+ $ = require ("jquery"),
5
+ X3D = require ("../X3D"),
6
+ Dialog = require ("../Controls/Dialog"),
7
+ Editor = require ("../Undo/Editor"),
8
+ UndoManager = require ("../Undo/UndoManager"),
9
+ Primitives = require ("./Primitives"),
10
+ StringSimilarity = require ("string-similarity"),
11
+ _ = require ("../Application/GetText")
11
12
 
12
13
  module .exports = new class Library extends Dialog
13
14
  {
@@ -141,9 +142,7 @@ module .exports = new class Library extends Dialog
141
142
 
142
143
  updateNodes ()
143
144
  {
144
- const
145
- SupportedNodes = X3D .require ("x_ite/Configuration/SupportedNodes"),
146
- cmp = (a, b) => (a > b) - (a < b)
145
+ const cmp = (a, b) => (a > b) - (a < b)
147
146
 
148
147
  // Clear list.
149
148
 
@@ -154,7 +153,7 @@ module .exports = new class Library extends Dialog
154
153
  const input = this .input .val () .toLowerCase () .trim ()
155
154
 
156
155
  if (input)
157
- var filter = (Type) => Type .prototype .getTypeName () .toLowerCase () .includes (input)
156
+ var filter = (Type) => StringSimilarity .compareTwoStrings (Type .prototype .getTypeName () .toLowerCase (), input) > 0.4
158
157
  else
159
158
  var filter = () => true
160
159
 
@@ -214,7 +213,7 @@ module .exports = new class Library extends Dialog
214
213
  const input = this .input .val () .toLowerCase () .trim ()
215
214
 
216
215
  if (input)
217
- var filter = (object) => object .typeName .toLowerCase () .includes (input)
216
+ var filter = (object) => StringSimilarity .compareTwoStrings (object .typeName .toLowerCase (), input) > 0.4
218
217
  else
219
218
  var filter = () => true
220
219
 
@@ -2556,15 +2556,16 @@ module .exports = class OutlineView extends Interface
2556
2556
  return
2557
2557
 
2558
2558
  const
2559
- selection = require ("../Application/Selection"),
2560
- selected = element .hasClass ("selected"),
2561
- nodes = this .sceneGraph .find (".primary, .selected"),
2562
- node = this .getNode (element)
2559
+ selection = require ("../Application/Selection"),
2560
+ selected = element .hasClass ("selected"),
2561
+ selectedElements = this .sceneGraph .find (".primary, .selected"),
2562
+ node = this .getNode (element),
2563
+ elements = $(`.node[node-id=${node .getId ()}]`)
2563
2564
 
2564
- for (const element of nodes)
2565
+ for (const element of selectedElements)
2565
2566
  this .getNode ($(element)) .setUserData (_primary, false)
2566
2567
 
2567
- nodes .removeClass ("primary")
2568
+ selectedElements .removeClass ("primary")
2568
2569
 
2569
2570
  if (add)
2570
2571
  {
@@ -2572,9 +2573,14 @@ module .exports = class OutlineView extends Interface
2572
2573
  node .setUserData (_selected, !selected)
2573
2574
 
2574
2575
  if (selected)
2576
+ {
2575
2577
  element .removeClass ("selected") .addClass ("primary")
2578
+ }
2576
2579
  else
2580
+ {
2577
2581
  element .addClass (["primary", "selected"])
2582
+ elements .addClass ("selected")
2583
+ }
2578
2584
 
2579
2585
  if (selected)
2580
2586
  selection .remove (node)
@@ -2583,14 +2589,15 @@ module .exports = class OutlineView extends Interface
2583
2589
  }
2584
2590
  else
2585
2591
  {
2586
- for (const element of nodes)
2592
+ for (const element of selectedElements)
2587
2593
  this .getNode ($(element)) .setUserData (_selected, false)
2588
2594
 
2589
2595
  node .setUserData (_primary, true)
2590
2596
  node .setUserData (_selected, true)
2591
2597
 
2592
- nodes .removeClass ("selected")
2598
+ selectedElements .removeClass ("selected")
2593
2599
  element .addClass (["primary", "selected"])
2600
+ elements .addClass ("selected")
2594
2601
  selection .set (node)
2595
2602
  }
2596
2603
  }
@@ -39,6 +39,8 @@ module .exports = class ScriptEditor extends Interface
39
39
 
40
40
  this .vSplitter = new Splitter (this .verticalSplitter, "vertical")
41
41
 
42
+ this .vSplitter .splitter .on ("dblclick", () => this .closeLeftBar ())
43
+
42
44
  this .toolbar = $("<div></div>")
43
45
  .addClass (["toolbar", "vertical-toolbar", "script-editor-toolbar"])
44
46
  .appendTo (this .scriptEditor)
@@ -140,6 +142,8 @@ module .exports = class ScriptEditor extends Interface
140
142
  break
141
143
  }
142
144
  }
145
+
146
+ this .monaco .viewState = this .monaco .saveViewState ()
143
147
  }
144
148
 
145
149
  this .node = node
@@ -157,6 +161,8 @@ module .exports = class ScriptEditor extends Interface
157
161
  this .editor = editor .element .appendTo (this .verticalSplitterRight)
158
162
  this .monaco = editor .monaco
159
163
 
164
+ this .monaco .restoreViewState (this .monaco .viewState)
165
+
160
166
  this .node ._url .addFieldCallback (this, this .set_url .bind (this))
161
167
 
162
168
  switch (this .node .getTypeName ())
@@ -242,13 +248,15 @@ module .exports = class ScriptEditor extends Interface
242
248
  automaticLayout: true,
243
249
  wordWrap: "on",
244
250
  wrappingIndent: "indent",
251
+ minimap: { enabled: false },
245
252
  })
246
253
 
254
+ editor .viewState = editor .saveViewState ()
255
+
247
256
  element .on ("contextmenu", (event) => this .showContextMenu ())
248
257
  element .detach ()
249
258
 
250
259
  //this .debugFindActions (editor)
251
-
252
260
  this .editors .set (node, { element: element, monaco: editor })
253
261
 
254
262
  resolve (this .editors .get (node))
@@ -591,4 +599,18 @@ main ()
591
599
  }
592
600
  }
593
601
  }
602
+
603
+ closeLeftBar ()
604
+ {
605
+ if (this .config .file .vSplitterPosition !== undefined)
606
+ {
607
+ this .vSplitter .position = this .config .file .vSplitterPosition
608
+ this .config .file .vSplitterPosition = undefined
609
+ }
610
+ else
611
+ {
612
+ this .config .file .vSplitterPosition = this .vSplitter .position
613
+ this .vSplitter .position = 0
614
+ }
615
+ }
594
616
  }
@@ -5,9 +5,9 @@
5
5
  <meta name='created' content='Sat, 11 Mar 2023 10:55:09 GMT'/>
6
6
  <meta name='comment' content='Rise and Shine'/>
7
7
  <meta name='creator' content='Holger Seelig'/>
8
- <meta name='generator' content='Sunrize X3D Editor V1.0.11, https://create3000.github.io/sunrize/'/>
8
+ <meta name='generator' content='Sunrize X3D Editor V1.0.12, https://create3000.github.io/sunrize/'/>
9
9
  <meta name='identifier' content='file:///Users/holger/Desktop/X_ITE/sunrize/src/sunrize/Tools/Grouping/TransformTool.x3d'/>
10
- <meta name='modified' content='Sat, 11 Mar 2023 15:53:51 GMT'/>
10
+ <meta name='modified' content='Sat, 25 Mar 2023 22:06:22 GMT'/>
11
11
  </head>
12
12
  <Scene>
13
13
  <ProtoDeclare name='Tool'>
@@ -7,9 +7,9 @@
7
7
  <meta name='comment' content='Rise and Shine'/>
8
8
  <meta name='created' content='Fri, 29 Aug 2014 13:13:27 GMT'/>
9
9
  <meta name='creator' content='Holger Seelig'/>
10
- <meta name='generator' content='Sunrize X3D Editor V1.0.11, https://create3000.github.io/sunrize/'/>
10
+ <meta name='generator' content='Sunrize X3D Editor V1.0.12, https://create3000.github.io/sunrize/'/>
11
11
  <meta name='identifier' content='file:///Users/holger/Desktop/X_ITE/sunrize/src/sunrize/Tools/Grouping/X3DBoundedObjectTool.x3d'/>
12
- <meta name='modified' content='Sun, 19 Mar 2023 16:33:08 GMT'/>
12
+ <meta name='modified' content='Sat, 25 Mar 2023 22:06:07 GMT'/>
13
13
  </head>
14
14
  <Scene>
15
15
  <ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
@@ -23,7 +23,7 @@
23
23
  <field accessType='inputOutput' type='SFVec3f' name='rectangleSize' value='1 1 1'/>
24
24
  <field accessType='inputOutput' type='SFVec3f' name='rectangleCenter'/>
25
25
  <field accessType='inputOutput' type='SFInt32' name='bboxStyle' value='1'/>
26
- <field accessType='inputOutput' type='SFColor' name='bboxColor' value='0.35 1 0.7'/>
26
+ <field accessType='inputOutput' type='SFColor' name='bboxColor' value='1 1 1'/>
27
27
  <field accessType='inputOutput' type='SFVec3f' name='bboxSize' value='1 1 1'/>
28
28
  <field accessType='inputOutput' type='SFVec3f' name='bboxCenter'/>
29
29
  </ProtoInterface>
@@ -510,6 +510,11 @@ tr.disabled ~ tr > td > div {
510
510
  left: -3px;
511
511
  }
512
512
 
513
+ .small .material-symbols-outlined {
514
+ font-size: calc(var(--icon-size) + 3px);
515
+ left: -1px;
516
+ }
517
+
513
518
  .vertical-toolbar .separator {
514
519
  display: block;
515
520
  margin: 10px auto;