sunrize 1.0.32 → 1.0.34

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.32",
4
+ "version": "1.0.34",
5
5
  "description": "A Multi Platform X3D Editor",
6
6
  "homepage": "https://create3000.github.io/sunrize/",
7
7
  "author": "Holger Seelig",
@@ -59,7 +59,7 @@
59
59
  "qtip2": "^3.0.3",
60
60
  "spectrum-colorpicker2": "^2.0.10",
61
61
  "string-similarity": "^4.0.4",
62
- "x_ite": "^8.7.3"
62
+ "x_ite": "^8.7.4"
63
63
  },
64
64
  "main": "src/main.js",
65
65
  "bin": {
@@ -1540,7 +1540,8 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1540
1540
  const element = $(event .target)
1541
1541
  .closest ("li, .scene-graph", this .sceneGraph)
1542
1542
 
1543
- element .removeClass (["drag-before", "drag-into", "drag-after"])
1543
+ element .find ("> .item") .addBack ()
1544
+ .removeClass (["drag-before", "drag-into", "drag-after"])
1544
1545
  }
1545
1546
 
1546
1547
  onDrop (event)
@@ -1937,6 +1938,11 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1937
1938
  }
1938
1939
  }
1939
1940
 
1941
+ onDragEnd ()
1942
+ {
1943
+ // console .log ("onDragEnd")
1944
+ }
1945
+
1940
1946
  getUndoDescriptionForNode (dropEffect, node)
1941
1947
  {
1942
1948
  if (Array .isArray (node))
@@ -50,6 +50,7 @@ module .exports = class OutlineView extends Interface
50
50
  .on ("dragenter dragover", this .onDragEnter .bind (this))
51
51
  .on ("dragleave dragend drop", this .onDragLeave .bind (this))
52
52
  .on ("drop", this .onDrop .bind (this))
53
+ .on ("dragend", this .onDragEnd .bind (this))
53
54
  .appendTo (this .treeView)
54
55
 
55
56
  electron .ipcRenderer .on ("deselect-all", () => this .deselectAll ())
@@ -2258,7 +2259,7 @@ module .exports = class OutlineView extends Interface
2258
2259
  {
2259
2260
  const single = new (field .getSingleType ()) ()
2260
2261
 
2261
- textarea .val (field .map (value =>
2262
+ textarea .val ([... field] .map (value =>
2262
2263
  {
2263
2264
  single .setValue (value)
2264
2265
 
@@ -2279,7 +2280,7 @@ module .exports = class OutlineView extends Interface
2279
2280
  }
2280
2281
  default:
2281
2282
  {
2282
- textarea .val (field .map (value => value .toString ({ scene: node .getExecutionContext () })) .join (",\n"))
2283
+ textarea .val ([... field] .map (value => value .toString ({ scene: node .getExecutionContext () })) .join (",\n"))
2283
2284
  break
2284
2285
  }
2285
2286
  }
@@ -2869,6 +2870,8 @@ module .exports = class OutlineView extends Interface
2869
2870
 
2870
2871
  onDrop (event) { }
2871
2872
 
2873
+ onDragEnd (event) { }
2874
+
2872
2875
  expandTo (object)
2873
2876
  {
2874
2877
  let flags = Traverse .ROOT_NODES
@@ -371,7 +371,7 @@ module .exports = new class SceneProperties extends Dialog
371
371
  else
372
372
  UndoManager .shared .beginUndo (_ ("Remove Meta Data »%s«"), oldKey)
373
373
 
374
- const metaData = Array .from (this .metaData .table .find ("tr")) .map ((element) =>
374
+ const metaData = Array .from (this .metaData .table .find ("tr")) .map (element =>
375
375
  {
376
376
  const
377
377
  inputs = $(element) .find ("input"),
@@ -402,8 +402,8 @@ module .exports = new class SceneProperties extends Dialog
402
402
  getDefaultUnit (category)
403
403
  {
404
404
  const
405
- units = Units .filter (units => units .category === category) [0] .units,
406
- unit = units .filter (unit => unit .conversionFactor === 1) [0]
405
+ units = Units .find (units => units .category === category) .units,
406
+ unit = units .find (unit => unit .conversionFactor === 1)
407
407
 
408
408
  return unit
409
409
  }
@@ -419,8 +419,8 @@ module .exports = new class SceneProperties extends Dialog
419
419
  name .val (this .getDefaultUnit (category) .name)
420
420
 
421
421
  const
422
- units = Units .filter (units => units .category === category) [0] .units,
423
- unit = units .filter (unit => unit .name === name .val ()) [0]
422
+ units = Units .find (units => units .category === category) .units,
423
+ unit = units .find (unit => unit .name === name .val ())
424
424
 
425
425
  if (unit)
426
426
  conversionFactor .val (unit .conversionFactor)
@@ -28,7 +28,7 @@ module .exports = class Editor
28
28
  const
29
29
  externprotos = new Set (objects .filter (o => o instanceof X3D .X3DExternProtoDeclaration)),
30
30
  protos = new Set (objects .filter (o => o instanceof X3D .X3DProtoDeclaration)),
31
- nodes = new X3D .MFNode (...objects .filter (o => o .getType () .includes (X3D .X3DConstants .X3DNode)))
31
+ nodes = new X3D .MFNode (... objects .filter (o => o .getType () .includes (X3D .X3DConstants .X3DNode)))
32
32
 
33
33
  const
34
34
  browser = executionContext .getBrowser (),
@@ -80,7 +80,7 @@ module .exports = class Editor
80
80
  }
81
81
  })
82
82
 
83
- const routes = [...childRoutes] .filter (route => children .has (route .getSourceNode ()) && children .has (route .getDestinationNode ()))
83
+ const routes = [... childRoutes] .filter (route => children .has (route .getSourceNode ()) && children .has (route .getDestinationNode ()))
84
84
 
85
85
  // Store world url.
86
86
 
@@ -125,8 +125,8 @@ module .exports = class Editor
125
125
  const
126
126
  browser = executionContext .getBrowser (),
127
127
  scene = browser .createScene (),
128
- externprotos = new Map (executionContext .externprotos .map (p => [p .getName (), p])),
129
- protos = new Map (executionContext .protos .map (p => [p .getName (), p])),
128
+ externprotos = new Map ([... executionContext .externprotos] .map (p => [p .getName (), p])),
129
+ protos = new Map ([... executionContext .protos] .map (p => [p .getName (), p])),
130
130
  rootNodes = executionContext .rootNodes .copy ()
131
131
 
132
132
  try
@@ -164,8 +164,8 @@ module .exports = class Editor
164
164
  // Remove protos that already exists in context.
165
165
 
166
166
  const
167
- nodes = executionContext .rootNodes .slice (rootNodes .length) .map (n => n .getValue ()),
168
- newProtos = executionContext .protos .slice (protos .length),
167
+ nodes = [... executionContext .rootNodes] .slice (rootNodes .length) .map (n => n .getValue ()),
168
+ newProtos = [... executionContext .protos] .slice (protos .length),
169
169
  updatedExternProtos = new Map (),
170
170
  updatedProtos = new Map (),
171
171
  removedProtoNodes = new Set ()
@@ -901,7 +901,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) })}
901
901
  static addProtoDeclaration (executionContext, name, undoManager = UndoManager .shared)
902
902
  {
903
903
  const
904
- oldProtos = new Map (executionContext .protos .map (p => [p .getName (), p])),
904
+ oldProtos = new Map ([... executionContext .protos] .map (p => [p .getName (), p])),
905
905
  proto = new X3D .X3DProtoDeclaration (executionContext)
906
906
 
907
907
  undoManager .beginUndo (_ ("Add Proto Declaration »%s«"), name)
@@ -957,7 +957,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) })}
957
957
  */
958
958
  static removeProtoDeclaration (executionContext, name, undoManager = UndoManager .shared)
959
959
  {
960
- const oldProtos = new Map (executionContext .protos .map (p => [p .getName (), p]))
960
+ const oldProtos = new Map ([... executionContext .protos] .map (p => [p .getName (), p]))
961
961
 
962
962
  undoManager .beginUndo (_ ("Remove Proto Declaration »%s«"), name)
963
963
 
@@ -981,7 +981,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) })}
981
981
  */
982
982
  static setProtoDeclarations (executionContext, protos, undoManager = UndoManager .shared)
983
983
  {
984
- const oldProtos = new Map (executionContext .protos .map (p => [p .getName (), p]))
984
+ const oldProtos = new Map ([... executionContext .protos] .map (p => [p .getName (), p]))
985
985
 
986
986
  undoManager .beginUndo (_ ("Update Proto Declarations"))
987
987
 
@@ -1063,7 +1063,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) })}
1063
1063
  static addExternProtoDeclaration (executionContext, name, undoManager = UndoManager .shared)
1064
1064
  {
1065
1065
  const
1066
- oldExternprotos = new Map (executionContext .externprotos .map (p => [p .getName (), p])),
1066
+ oldExternprotos = new Map ([... executionContext .externprotos] .map (p => [p .getName (), p])),
1067
1067
  externproto = new X3D .X3DExternProtoDeclaration (executionContext, new X3D .MFString ())
1068
1068
 
1069
1069
  undoManager .beginUndo (_ ("Add Extern Prototype Declaration »%s«"), name)
@@ -1119,7 +1119,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) })}
1119
1119
  */
1120
1120
  static removeExternProtoDeclaration (executionContext, name, undoManager = UndoManager .shared)
1121
1121
  {
1122
- const oldExternProtos = new Map (executionContext .externprotos .map (p => [p .getName (), p]))
1122
+ const oldExternProtos = new Map ([... executionContext .externprotos] .map (p => [p .getName (), p]))
1123
1123
 
1124
1124
  undoManager .beginUndo (_ ("Remove Extern Prototype Declaration »%s«"), name)
1125
1125
 
@@ -1143,7 +1143,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) })}
1143
1143
  */
1144
1144
  static setExternProtoDeclarations (executionContext, externprotos, undoManager = UndoManager .shared)
1145
1145
  {
1146
- const oldExternProtos = new Map (executionContext .externprotos .map (p => [p .getName (), p]))
1146
+ const oldExternProtos = new Map ([... executionContext .externprotos] .map (p => [p .getName (), p]))
1147
1147
 
1148
1148
  undoManager .beginUndo (_ ("Update Extern Prototype Declarations"))
1149
1149
 
@@ -1771,7 +1771,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) })}
1771
1771
  */
1772
1772
  static removeUserDefinedField (executionContext, node, field, undoManager = UndoManager .shared)
1773
1773
  {
1774
- const fields = node .getUserDefinedFields () .filter (f => f !== field)
1774
+ const fields = [... node .getUserDefinedFields ()] .filter (f => f !== field)
1775
1775
 
1776
1776
  undoManager .beginUndo (_ ("Remove Field »%s«"), field .getName ())
1777
1777