sunrize 2.1.9 → 2.1.11

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.
Files changed (58) hide show
  1. package/package.json +13 -5
  2. package/src/Application/ActionKeys.js +1 -1
  3. package/src/Application/DataStorage.js +1 -1
  4. package/src/Application/Document.js +1 -1
  5. package/src/Application/Footer.js +15 -15
  6. package/src/Application/Hierarchy.js +1 -1
  7. package/src/Application/Registry.js +1 -1
  8. package/src/Application/Selection.js +1 -1
  9. package/src/Application/Sidebar.js +16 -16
  10. package/src/Application/Tabs.js +2 -2
  11. package/src/Bits/MimeTypes.js +1 -1
  12. package/src/Controls/AnimationPropertiesPopover.js +3 -3
  13. package/src/Controls/Dialog.js +2 -2
  14. package/src/Controls/EditNodePopover.js +1 -1
  15. package/src/Controls/EditUserDefinedFieldPopover.js +1 -1
  16. package/src/Controls/ExportNodePopover.js +1 -1
  17. package/src/Controls/ImportNodePopover.js +1 -1
  18. package/src/Controls/RenameNodeInput.js +1 -1
  19. package/src/Controls/Splitter.js +2 -2
  20. package/src/Controls/Tabs.js +25 -25
  21. package/src/Controls/TexturePreviewPopover.js +3 -3
  22. package/src/Controls/VideoPreviewPopover.js +3 -3
  23. package/src/Editors/AnimationEditor.js +10 -10
  24. package/src/Editors/AnimationMemberList.js +1 -1
  25. package/src/Editors/FileManager.js +7 -7
  26. package/src/Editors/Library.js +2 -2
  27. package/src/Editors/OutlineEditor.js +37 -37
  28. package/src/Editors/OutlineRouteGraph.js +2 -2
  29. package/src/Editors/OutlineView.js +97 -97
  30. package/src/Editors/Panel.js +10 -10
  31. package/src/Editors/SceneProperties.js +8 -8
  32. package/src/Editors/ScriptEditor.js +7 -7
  33. package/src/Editors/Units.js +1 -1
  34. package/src/Parser/AudioParser.js +1 -1
  35. package/src/Parser/ImageParser.js +1 -1
  36. package/src/Parser/VideoParser.js +1 -1
  37. package/src/Tools/CADGeometry/CADAssemblyTool.js +4 -4
  38. package/src/Tools/CADGeometry/CADFaceTool.js +4 -4
  39. package/src/Tools/CADGeometry/CADLayerTool.js +4 -4
  40. package/src/Tools/CADGeometry/CADPartTool.js +4 -4
  41. package/src/Tools/Core/X3DBaseTool.js +1 -1
  42. package/src/Tools/Core/X3DNodeTool.js +1 -1
  43. package/src/Tools/Core/X3DPrototypeInstanceTool.js +1 -1
  44. package/src/Tools/Grouping/GroupTool.js +1 -1
  45. package/src/Tools/Grouping/StaticGroupTool.js +4 -4
  46. package/src/Tools/Grouping/SwitchTool.js +4 -4
  47. package/src/Tools/Grouping/TransformTool.js +4 -4
  48. package/src/Tools/HAnim/HAnimHumanoidTool.js +4 -4
  49. package/src/Tools/HAnim/HAnimJointTool.js +4 -4
  50. package/src/Tools/HAnim/HAnimSegmentTool.js +4 -4
  51. package/src/Tools/HAnim/HAnimSiteTool.js +4 -4
  52. package/src/Tools/Layering/LayerTool.js +3 -3
  53. package/src/Tools/Layering/ViewportTool.js +1 -1
  54. package/src/Tools/Networking/AnchorTool.js +4 -4
  55. package/src/Tools/Networking/InlineGeometryTool.js +1 -1
  56. package/src/Tools/Networking/InlineTool.js +4 -4
  57. package/src/Undo/Editor.js +68 -68
  58. package/src/Undo/UndoManager.js +1 -1
@@ -1,4 +1,4 @@
1
- "use strict"
1
+ "use strict";
2
2
 
3
3
  const
4
4
  $ = require ("jquery"),
@@ -9,7 +9,7 @@ const
9
9
  X3D = require ("../X3D"),
10
10
  Traverse = require ("x3d-traverse"),
11
11
  UndoManager = require ("./UndoManager"),
12
- _ = require ("../Application/GetText")
12
+ _ = require ("../Application/GetText");
13
13
 
14
14
  module .exports = class Editor
15
15
  {
@@ -21,7 +21,7 @@ module .exports = class Editor
21
21
  /**
22
22
  * X3D Id
23
23
  */
24
- static Id = /(?:^[^\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f]{1}[^\x00-\x20\x22\x23\x27\x2c\x2e\x5b\x5c\x5d\x7b\x7d\x7f]*$|^$)/
24
+ static Id = /(?:^[^\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f]{1}[^\x00-\x20\x22\x23\x27\x2c\x2e\x5b\x5c\x5d\x7b\x7d\x7f]*$|^$)/;
25
25
 
26
26
  /**
27
27
  *
@@ -83,7 +83,7 @@ module .exports = class Editor
83
83
 
84
84
  // Determine protos.
85
85
 
86
- const protoNodes = new Set ()
86
+ const protoNodes = new Set ();
87
87
 
88
88
  for (const object of Traverse .traverse (objects, Traverse .PROTO_DECLARATIONS | Traverse .PROTO_DECLARATION_BODY | Traverse .ROOT_NODES | Traverse .PROTOTYPE_INSTANCES))
89
89
  {
@@ -436,19 +436,19 @@ module .exports = class Editor
436
436
  {
437
437
  case ".x3d":
438
438
  default:
439
- return scene .toXMLString ()
439
+ return scene .toXMLString ();
440
440
  case ".x3dz":
441
- return zlib .gzipSync (scene .toXMLString ({ style: "CLEAN" }))
441
+ return zlib .gzipSync (scene .toXMLString ({ style: "CLEAN" }));
442
442
  case ".x3dv":
443
- return scene .toVRMLString ()
443
+ return scene .toVRMLString ();
444
444
  case ".x3dvz":
445
- return zlib .gzipSync (scene .toVRMLString ({ style: "CLEAN" }))
445
+ return zlib .gzipSync (scene .toVRMLString ({ style: "CLEAN" }));
446
446
  case ".x3dj":
447
- return scene .toJSONString ()
447
+ return scene .toJSONString ();
448
448
  case ".x3djz":
449
- return zlib .gzipSync (scene .toJSONString ({ style: "CLEAN" }))
449
+ return zlib .gzipSync (scene .toJSONString ({ style: "CLEAN" }));
450
450
  case ".html":
451
- return this .getHTML (scene)
451
+ return this .getHTML (scene);
452
452
  }
453
453
  }
454
454
 
@@ -535,7 +535,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
535
535
  <p>Made with <a href="https://create3000.github.io/sunrize/" target="_blank">Sunrize X3D Editor</a>. If local files are not loaded <a href="https://create3000.github.io/x_ite/setup-a-localhost-server">consider setup a localhost server</a> or use <a href="https://create3000.github.io/x_ite/dom-integration">DOM integration methods</a>.</p>
536
536
  </body>
537
537
  </html>
538
- `
538
+ `;
539
539
  }
540
540
 
541
541
  static absoluteURL = new RegExp ("^(?:[a-z]+:|//)", "i");
@@ -550,7 +550,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
550
550
  */
551
551
  static rewriteURLs (executionContext, objects, oldWorldURL, newWorldURL, undoManager = UndoManager .shared)
552
552
  {
553
- undoManager .beginUndo (_("Rewrite URLs"))
553
+ undoManager .beginUndo (_("Rewrite URLs"));
554
554
 
555
555
  for (const object of Traverse .traverse (objects, Traverse .EXTERNPROTO_DECLARATIONS | Traverse .PROTO_DECLARATIONS | Traverse .PROTO_DECLARATION_BODY | Traverse .ROOT_NODES))
556
556
  {
@@ -637,19 +637,19 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
637
637
  static isParentContext (parentContext, childContext)
638
638
  {
639
639
  if (parentContext === childContext)
640
- return false
640
+ return false;
641
641
 
642
- let executionContext = childContext
642
+ let executionContext = childContext;
643
643
 
644
644
  while (!(executionContext instanceof X3D .X3DScene))
645
645
  {
646
646
  if (executionContext === parentContext)
647
- return true
647
+ return true;
648
648
 
649
- executionContext = executionContext .getExecutionContext ()
649
+ executionContext = executionContext .getExecutionContext ();
650
650
  }
651
651
 
652
- return executionContext === parentContext
652
+ return executionContext === parentContext;
653
653
  }
654
654
 
655
655
  /**
@@ -860,15 +860,15 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
860
860
  const
861
861
  unit = scene .getUnit (category),
862
862
  oldName = unit .name,
863
- oldConversionFactor = unit .conversionFactor
863
+ oldConversionFactor = unit .conversionFactor;
864
864
 
865
- undoManager .beginUndo (_("Update Unit Category »%s«"), category)
865
+ undoManager .beginUndo (_("Update Unit Category »%s«"), category);
866
866
 
867
- scene .updateUnit (category, name, conversionFactor)
867
+ scene .updateUnit (category, name, conversionFactor);
868
868
 
869
869
  undoManager .registerUndo (() =>
870
870
  {
871
- this .updateUnit (scene, category, oldName, oldConversionFactor, undoManager)
871
+ this .updateUnit (scene, category, oldName, oldConversionFactor, undoManager);
872
872
  });
873
873
 
874
874
  undoManager .endUndo ();
@@ -1179,23 +1179,23 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
1179
1179
  {
1180
1180
  const
1181
1181
  oldProtos = new Map (Array .from (executionContext .protos, p => [p .getName (), p])),
1182
- proto = new X3D .X3DProtoDeclaration (executionContext)
1182
+ proto = new X3D .X3DProtoDeclaration (executionContext);
1183
1183
 
1184
- undoManager .beginUndo (_("Add Proto Declaration »%s«"), name)
1184
+ undoManager .beginUndo (_("Add Proto Declaration »%s«"), name);
1185
1185
 
1186
- proto .setup ()
1187
- executionContext .updateProtoDeclaration (name, proto)
1186
+ proto .setup ();
1187
+ executionContext .updateProtoDeclaration (name, proto);
1188
1188
 
1189
1189
  undoManager .registerUndo (() =>
1190
1190
  {
1191
- this .setProtoDeclarations (executionContext, oldProtos, undoManager)
1191
+ this .setProtoDeclarations (executionContext, oldProtos, undoManager);
1192
1192
  });
1193
1193
 
1194
- this .requestUpdateInstances (executionContext, undoManager)
1194
+ this .requestUpdateInstances (executionContext, undoManager);
1195
1195
 
1196
1196
  undoManager .endUndo ();
1197
1197
 
1198
- return proto
1198
+ return proto;
1199
1199
  }
1200
1200
 
1201
1201
  /**
@@ -1207,21 +1207,21 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
1207
1207
  */
1208
1208
  static updateProtoDeclaration (executionContext, name, proto, undoManager = UndoManager .shared)
1209
1209
  {
1210
- const oldName = proto .getName ()
1210
+ const oldName = proto .getName ();
1211
1211
 
1212
- undoManager .beginUndo (_("Update Proto Declaration »%s«"), name)
1212
+ undoManager .beginUndo (_("Update Proto Declaration »%s«"), name);
1213
1213
 
1214
- executionContext .updateProtoDeclaration (name, proto)
1214
+ executionContext .updateProtoDeclaration (name, proto);
1215
1215
 
1216
1216
  undoManager .registerUndo (() =>
1217
1217
  {
1218
1218
  if (oldName)
1219
- this .updateProtoDeclaration (executionContext, oldName, proto, undoManager)
1219
+ this .updateProtoDeclaration (executionContext, oldName, proto, undoManager);
1220
1220
  else
1221
- this .removeProtoDeclaration (executionContext, name, undoManager)
1221
+ this .removeProtoDeclaration (executionContext, name, undoManager);
1222
1222
  });
1223
1223
 
1224
- this .requestUpdateInstances (executionContext, undoManager)
1224
+ this .requestUpdateInstances (executionContext, undoManager);
1225
1225
 
1226
1226
  undoManager .endUndo ();
1227
1227
  }
@@ -1234,18 +1234,18 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
1234
1234
  */
1235
1235
  static removeProtoDeclaration (executionContext, name, undoManager = UndoManager .shared)
1236
1236
  {
1237
- const oldProtos = new Map (Array .from (executionContext .protos, p => [p .getName (), p]))
1237
+ const oldProtos = new Map (Array .from (executionContext .protos, p => [p .getName (), p]));
1238
1238
 
1239
- undoManager .beginUndo (_("Remove Proto Declaration »%s«"), name)
1239
+ undoManager .beginUndo (_("Remove Proto Declaration »%s«"), name);
1240
1240
 
1241
- executionContext .removeProtoDeclaration (name)
1241
+ executionContext .removeProtoDeclaration (name);
1242
1242
 
1243
1243
  undoManager .registerUndo (() =>
1244
1244
  {
1245
- this .setProtoDeclarations (executionContext, oldProtos, undoManager)
1245
+ this .setProtoDeclarations (executionContext, oldProtos, undoManager);
1246
1246
  });
1247
1247
 
1248
- this .requestUpdateInstances (executionContext, undoManager)
1248
+ this .requestUpdateInstances (executionContext, undoManager);
1249
1249
 
1250
1250
  undoManager .endUndo ();
1251
1251
  }
@@ -1541,39 +1541,39 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
1541
1541
  */
1542
1542
  static getNextAvailableProtoNode (executionContext, protoNode)
1543
1543
  {
1544
- const name = protoNode instanceof X3D .X3DProtoDeclarationNode ? protoNode .getName () : protoNode
1544
+ const name = protoNode instanceof X3D .X3DProtoDeclarationNode ? protoNode .getName () : protoNode;
1545
1545
 
1546
1546
  if (protoNode instanceof X3D .X3DProtoDeclaration)
1547
1547
  {
1548
- const externproto = executionContext .externprotos .get (name)
1548
+ const externproto = executionContext .externprotos .get (name);
1549
1549
 
1550
1550
  if (externproto)
1551
- return externproto
1551
+ return externproto;
1552
1552
  }
1553
1553
 
1554
- const proto = executionContext .getOuterNode ()
1554
+ const proto = executionContext .getOuterNode ();
1555
1555
 
1556
1556
  if (!(proto instanceof X3D .X3DProtoDeclaration))
1557
- return null
1557
+ return null;
1558
1558
 
1559
- executionContext = proto .getExecutionContext ()
1559
+ executionContext = proto .getExecutionContext ();
1560
1560
 
1561
- const index = executionContext .protos .indexOf (proto)
1561
+ const index = executionContext .protos .indexOf (proto);
1562
1562
 
1563
1563
  for (let i = 0; i < index; ++ i)
1564
1564
  {
1565
- const proto = executionContext .protos [i]
1565
+ const proto = executionContext .protos [i];
1566
1566
 
1567
1567
  if (proto .getName () === name)
1568
- return proto
1568
+ return proto;
1569
1569
  }
1570
1570
 
1571
- const externproto = executionContext .externprotos .get (name)
1571
+ const externproto = executionContext .externprotos .get (name);
1572
1572
 
1573
1573
  if (externproto)
1574
- return externproto
1574
+ return externproto;
1575
1575
 
1576
- return this .getNextAvailableProtoNode (executionContext, name)
1576
+ return this .getNextAvailableProtoNode (executionContext, name);
1577
1577
  }
1578
1578
 
1579
1579
  /**
@@ -2422,22 +2422,22 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
2422
2422
  static addReference (proto, protoField, node, field, undoManager = UndoManager .shared)
2423
2423
  {
2424
2424
  node = node .valueOf ();
2425
- field = typeof field === "string" ? node .getField (field) : field
2425
+ field = typeof field === "string" ? node .getField (field) : field;
2426
2426
 
2427
2427
  const
2428
2428
  instance = node .getType () .includes (X3D .X3DConstants .X3DPrototypeInstance),
2429
- name = field .getName ()
2429
+ name = field .getName ();
2430
2430
 
2431
- undoManager .beginUndo (_("Add Reference from »%s« to »%s«"), protoField .getName (), field .getName ())
2431
+ undoManager .beginUndo (_("Add Reference from »%s« to »%s«"), protoField .getName (), field .getName ());
2432
2432
 
2433
- field .addReference (protoField)
2433
+ field .addReference (protoField);
2434
2434
 
2435
2435
  undoManager .registerUndo (() =>
2436
2436
  {
2437
- this .removeReference (proto, protoField, node, instance ? name : field, undoManager)
2437
+ this .removeReference (proto, protoField, node, instance ? name : field, undoManager);
2438
2438
  });
2439
2439
 
2440
- this .requestUpdateInstances (proto, undoManager)
2440
+ this .requestUpdateInstances (proto, undoManager);
2441
2441
 
2442
2442
  undoManager .endUndo ();
2443
2443
  }
@@ -2452,22 +2452,22 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
2452
2452
  static removeReference (proto, protoField, node, field, undoManager = UndoManager .shared)
2453
2453
  {
2454
2454
  node = node .valueOf ();
2455
- field = typeof field === "string" ? node .getField (field) : field
2455
+ field = typeof field === "string" ? node .getField (field) : field;
2456
2456
 
2457
2457
  const
2458
2458
  instance = node .getType () .includes (X3D .X3DConstants .X3DPrototypeInstance),
2459
- name = field .getName ()
2459
+ name = field .getName ();
2460
2460
 
2461
- undoManager .beginUndo (_("Remove Reference from »%s« to »%s«"), protoField .getName (), field .getName ())
2461
+ undoManager .beginUndo (_("Remove Reference from »%s« to »%s«"), protoField .getName (), field .getName ());
2462
2462
 
2463
- field .removeReference (protoField)
2463
+ field .removeReference (protoField);
2464
2464
 
2465
2465
  undoManager .registerUndo (() =>
2466
2466
  {
2467
- this .addReference (proto, protoField, node, instance ? name : field, undoManager)
2467
+ this .addReference (proto, protoField, node, instance ? name : field, undoManager);
2468
2468
  });
2469
2469
 
2470
- this .requestUpdateInstances (proto, undoManager)
2470
+ this .requestUpdateInstances (proto, undoManager);
2471
2471
 
2472
2472
  undoManager .endUndo ();
2473
2473
  }
@@ -2860,7 +2860,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
2860
2860
  {
2861
2861
  case X3D .X3DConstants .DirectionalLight:
2862
2862
  return new X3D .Box3 (X3D .Vector3 .ONE, innerNode .getMetaData ("DirectionalLight/location", new X3D .Vector3 ()))
2863
- .multLeft (new X3D .Matrix4 () .setRotation (X3D .Rotation4 .fromVectors (X3D .Vector3 .Z_AXIS, innerNode ._direction .getValue ())))
2863
+ .multLeft (X3D .Matrix4 .fromRotation (X3D .Rotation4 .fromVectors (X3D .Vector3 .Z_AXIS, innerNode ._direction .getValue ())))
2864
2864
  .multRight (modelMatrix);
2865
2865
  case X3D .X3DConstants .PointLight:
2866
2866
  return new X3D .Box3 (X3D .Vector3 .ONE, innerNode ._location .getValue ())
@@ -2869,7 +2869,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
2869
2869
  case X3D .X3DConstants .Sound:
2870
2870
  case X3D .X3DConstants .X3DTextureProjectorNode:
2871
2871
  return new X3D .Box3 (X3D .Vector3 .ONE, innerNode ._location .getValue ())
2872
- .multLeft (new X3D .Matrix4 () .setRotation (X3D .Rotation4 .fromVectors (X3D .Vector3 .Z_AXIS, innerNode ._direction .getValue ())))
2872
+ .multLeft (X3D .Matrix4 .fromRotation (X3D .Rotation4 .fromVectors (X3D .Vector3 .Z_AXIS, innerNode ._direction .getValue ())))
2873
2873
  .multRight (modelMatrix);
2874
2874
  case X3D .X3DConstants .X3DBoundedObject:
2875
2875
  return innerNode .getBBox (new X3D .Box3 ()) .multRight (modelMatrix);
@@ -2881,7 +2881,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
2881
2881
  .multRight (modelMatrix);
2882
2882
  case X3D .X3DConstants .X3DViewpointNode:
2883
2883
  return new X3D .Box3 (X3D .Vector3 .ONE, innerNode ._position .getValue ())
2884
- .multLeft (new X3D .Matrix4 () .setRotation (innerNode ._orientation .getValue ()))
2884
+ .multLeft (X3D .Matrix4 .fromRotation (innerNode ._orientation .getValue ()))
2885
2885
  .multRight (modelMatrix);
2886
2886
  case X3D .X3DConstants .X3DLayerNode:
2887
2887
  return innerNode .getBBox (new X3D .Box3 ());
@@ -3032,7 +3032,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
3032
3032
  {
3033
3033
  const
3034
3034
  node = object instanceof X3D .SFNode ? object .getValue () : object,
3035
- fields = node instanceof X3D .X3DExecutionContext ? [node .getRootNodes ()] : node .getFields ()
3035
+ fields = node instanceof X3D .X3DExecutionContext ? [node .getRootNodes ()] : node .getFields ();
3036
3036
 
3037
3037
  for (const field of fields)
3038
3038
  {
@@ -53,7 +53,7 @@ module .exports = class UndoManager
53
53
  if (this .undoIndex < 0)
54
54
  this .undoLabel = _("Undo");
55
55
  else
56
- this .undoLabel = util .format (_("Undo %s"), this .undoList [this .undoIndex] .description)
56
+ this .undoLabel = util .format (_("Undo %s"), this .undoList [this .undoIndex] .description);
57
57
 
58
58
  this .redoLabel = util .format (_("Redo %s"), undoItem .description);
59
59