sunrize 1.3.5 → 1.4.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sunrize",
3
3
  "productName": "Sunrize X3D Editor",
4
- "version": "1.3.5",
4
+ "version": "1.4.0",
5
5
  "description": "A Multi-Platform X3D Editor",
6
6
  "main": "src/main.js",
7
7
  "bin": {
@@ -15,6 +15,7 @@
15
15
  "start": "electron .",
16
16
  "development": "SUNRISE_ENVIRONMENT=DEVELOPMENT electron .",
17
17
  "release": "node build/release.js",
18
+ "x3duom": "sh build/x3duom.sh",
18
19
  "download": "node build/download.js",
19
20
  "premake": "npm i -D electron",
20
21
  "make": "env PATH=\"$(pwd)/build/wine-proxy:$PATH\" electron-forge make",
@@ -80,7 +81,7 @@
80
81
  "dependencies": {
81
82
  "capitalize": "^2.0.4",
82
83
  "console": "^0.7.2",
83
- "electron": "^28.1.0",
84
+ "electron": "^28.1.1",
84
85
  "electron-prompt": "^1.7.0",
85
86
  "electron-squirrel-startup": "^1.0.0",
86
87
  "electron-tabs": "^1.0.2",
@@ -89,7 +90,7 @@
89
90
  "jquery-ui-dist": "^1.13.2",
90
91
  "jstree": "^3.3.16",
91
92
  "material-icons": "^1.13.12",
92
- "material-symbols": "^0.14.2",
93
+ "material-symbols": "^0.14.3",
93
94
  "md5": "^2.3.0",
94
95
  "monaco-editor": "^0.45.0",
95
96
  "node-clipboardy": "^1.0.3",
@@ -98,7 +99,7 @@
98
99
  "spectrum-colorpicker2": "^2.0.10",
99
100
  "string-similarity": "^4.0.4",
100
101
  "update-electron-app": "^3.0.0",
101
- "x_ite": "^9.1.11"
102
+ "x_ite": "^9.2.0"
102
103
  },
103
104
  "config": {
104
105
  "forge": {
@@ -171,7 +171,7 @@ module .exports = class Document extends Interface
171
171
  }
172
172
  catch (error)
173
173
  {
174
- console .log (error);
174
+ // console .error (error);
175
175
  }
176
176
  }
177
177
 
@@ -1083,8 +1083,11 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1083
1083
  if (field .getAccessType () === X3D .X3DConstants .outputOnly)
1084
1084
  return;
1085
1085
 
1086
- boolean .addClass ("pointer") .on ("click", () =>
1086
+ boolean .addClass ("pointer") .on ("click", event =>
1087
1087
  {
1088
+ event .preventDefault ();
1089
+ event .stopImmediatePropagation ();
1090
+
1088
1091
  Editor .setFieldValue (node .getExecutionContext (), node, field, !field .getValue ());
1089
1092
  });
1090
1093
  }
@@ -1158,8 +1161,11 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1158
1161
  if (field .getAccessType () === X3D .X3DConstants .outputOnly)
1159
1162
  return;
1160
1163
 
1161
- time .addClass ("pointer") .on ("click", () =>
1164
+ time .addClass ("pointer") .on ("click", event =>
1162
1165
  {
1166
+ event .preventDefault ();
1167
+ event .stopImmediatePropagation ();
1168
+
1163
1169
  Editor .setFieldValue (node .getExecutionContext (), node, field, Date .now () / 1000);
1164
1170
  });
1165
1171
  }
@@ -1452,14 +1458,13 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1452
1458
  const
1453
1459
  element = $(event .currentTarget) .closest (".field", this .sceneGraph),
1454
1460
  node = this .getNode (element),
1455
- field = this .getField (element)
1461
+ field = this .getField (element);
1456
1462
 
1457
- // Block default href.
1458
- event .preventDefault ()
1459
- event .stopImmediatePropagation ()
1463
+ event .preventDefault ();
1464
+ event .stopImmediatePropagation ();
1460
1465
 
1461
1466
  if (!this .isEditable (element .parent ()))
1462
- return
1467
+ return;
1463
1468
 
1464
1469
  if (event .ctrlKey || event .metaKey)
1465
1470
  {
@@ -1467,7 +1472,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1467
1472
  {
1468
1473
  case "input":
1469
1474
  {
1470
- const routes = field .getInputRoutes ()
1475
+ const routes = field .getInputRoutes ();
1471
1476
 
1472
1477
  switch (routes .size)
1473
1478
  {
@@ -1481,16 +1486,16 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1481
1486
  {
1482
1487
  // Delete route.
1483
1488
 
1484
- Editor .deleteRoute (route .getExecutionContext (), route .sourceNode, route .sourceField, route .destinationNode, route .destinationField)
1489
+ Editor .deleteRoute (route .getExecutionContext (), route .sourceNode, route .sourceField, route .destinationNode, route .destinationField);
1485
1490
  }
1486
1491
 
1487
- break
1492
+ break;
1488
1493
  }
1489
1494
  default:
1490
1495
  {
1491
- element .data ("full-expanded", true)
1492
- element .jstree ("open_node", element)
1493
- break
1496
+ element .data ("full-expanded", true);
1497
+ element .jstree ("open_node", element);
1498
+ break;
1494
1499
  }
1495
1500
  }
1496
1501
 
@@ -1498,7 +1503,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1498
1503
  }
1499
1504
  case "output":
1500
1505
  {
1501
- const routes = field .getOutputRoutes ()
1506
+ const routes = field .getOutputRoutes ();
1502
1507
 
1503
1508
  switch (routes .size)
1504
1509
  {
@@ -1512,20 +1517,20 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1512
1517
  {
1513
1518
  // Delete route.
1514
1519
 
1515
- Editor .deleteRoute (route .getExecutionContext (), route .sourceNode, route .sourceField, route .destinationNode, route .destinationField)
1520
+ Editor .deleteRoute (route .getExecutionContext (), route .sourceNode, route .sourceField, route .destinationNode, route .destinationField);
1516
1521
  }
1517
1522
 
1518
- break
1523
+ break;
1519
1524
  }
1520
1525
  default:
1521
1526
  {
1522
- element .data ("full-expanded", true)
1523
- element .jstree ("open_node", element)
1524
- break
1527
+ element .data ("full-expanded", true);
1528
+ element .jstree ("open_node", element);
1529
+ break;
1525
1530
  }
1526
1531
  }
1527
1532
 
1528
- break
1533
+ break;
1529
1534
  }
1530
1535
  }
1531
1536
  }
@@ -1533,7 +1538,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1533
1538
  {
1534
1539
  const
1535
1540
  sceneElement = element .closest (".scene", this .sceneGraph),
1536
- executionContext = this .getNode (sceneElement)
1541
+ executionContext = this .getNode (sceneElement);
1537
1542
 
1538
1543
  switch (type)
1539
1544
  {
@@ -1542,29 +1547,32 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1542
1547
  if (this .connector)
1543
1548
  {
1544
1549
  if (this .connector .type === type)
1545
- break
1550
+ break;
1546
1551
 
1547
1552
  if (this .connector .executionContext !== executionContext)
1548
- break
1553
+ break;
1549
1554
 
1550
1555
  if (this .connector .field .getType () !== field .getType ())
1551
- break
1556
+ break;
1557
+
1558
+ if (this .connector .node .getField (this .connector .field .getName ()) .getFieldInterests () .has (node .getField (field .getName ())))
1559
+ break;
1552
1560
 
1553
1561
  // Add route.
1554
1562
 
1555
- Editor .addRoute (executionContext, this .connector .node, this .connector .field .getName (), node, field .getName ())
1563
+ Editor .addRoute (executionContext, this .connector .node, this .connector .field .getName (), node, field .getName ());
1556
1564
 
1557
1565
  if (event .shiftKey)
1558
- break
1566
+ break;
1559
1567
 
1560
1568
  this .connector .element .find (".access-type img.active.output.activated")
1561
- .removeClass ("activated")
1569
+ .removeClass ("activated");
1562
1570
 
1563
- delete this .connector
1571
+ delete this .connector;
1564
1572
  }
1565
1573
  else
1566
1574
  {
1567
- this .connector = { type: type, executionContext: executionContext, node: node, field: field, element: element }
1575
+ this .connector = { type, executionContext, node, field, element };
1568
1576
  }
1569
1577
 
1570
1578
  break
@@ -1574,32 +1582,35 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1574
1582
  if (this .connector)
1575
1583
  {
1576
1584
  if (this .connector .type === type)
1577
- break
1585
+ break;
1578
1586
 
1579
1587
  if (this .connector .executionContext !== executionContext)
1580
- break
1588
+ break;
1581
1589
 
1582
1590
  if (this .connector .field .getType () !== field .getType ())
1583
- break
1591
+ break;
1592
+
1593
+ if (node .getField (field .getName ()) .getFieldInterests () .has (this .connector .node .getField (this .connector .field .getName ())))
1594
+ break;
1584
1595
 
1585
1596
  // Add route.
1586
1597
 
1587
- Editor .addRoute (executionContext, node, field .getName (), this .connector .node, this .connector .field .getName ())
1598
+ Editor .addRoute (executionContext, node, field .getName (), this .connector .node, this .connector .field .getName ());
1588
1599
 
1589
1600
  if (event .shiftKey)
1590
- break
1601
+ break;
1591
1602
 
1592
1603
  this .connector .element .find (".access-type img.active.input.activated")
1593
- .removeClass ("activated")
1604
+ .removeClass ("activated");
1594
1605
 
1595
- delete this .connector
1606
+ delete this .connector;
1596
1607
  }
1597
1608
  else
1598
1609
  {
1599
- this .connector = { type: type, executionContext: executionContext, node: node, field: field, element: element }
1610
+ this .connector = { type, executionContext, node, field, element };
1600
1611
  }
1601
1612
 
1602
- break
1613
+ break;
1603
1614
  }
1604
1615
  }
1605
1616
  }
@@ -1611,19 +1622,18 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1611
1622
 
1612
1623
  const
1613
1624
  element = $(event .currentTarget) .closest (".route", this .sceneGraph),
1614
- field = this .getField (element)
1625
+ field = this .getField (element);
1615
1626
 
1616
- // Block default href.
1617
- event .preventDefault ()
1618
- event .stopImmediatePropagation ()
1627
+ event .preventDefault ();
1628
+ event .stopImmediatePropagation ();
1619
1629
 
1620
1630
  if (!this .isEditable (element .parent ()))
1621
- return
1631
+ return;
1622
1632
 
1623
1633
  if (!(event .ctrlKey || event .metaKey))
1624
- return
1634
+ return;
1625
1635
 
1626
- element .hide ()
1636
+ element .hide ();
1627
1637
 
1628
1638
  switch (type)
1629
1639
  {
@@ -1631,15 +1641,15 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1631
1641
  {
1632
1642
  const route = this .getRoute (element, field .getInputRoutes ())
1633
1643
 
1634
- Editor .deleteRoute (route .getExecutionContext (), route .sourceNode, route .sourceField, route .destinationNode, route .destinationField)
1635
- break
1644
+ Editor .deleteRoute (route .getExecutionContext (), route .sourceNode, route .sourceField, route .destinationNode, route .destinationField);
1645
+ break;
1636
1646
  }
1637
1647
  case "output":
1638
1648
  {
1639
- const route = this .getRoute (element, field .getOutputRoutes ())
1649
+ const route = this .getRoute (element, field .getOutputRoutes ());
1640
1650
 
1641
- Editor .deleteRoute (route .getExecutionContext (), route .sourceNode, route .sourceField, route .destinationNode, route .destinationField)
1642
- break
1651
+ Editor .deleteRoute (route .getExecutionContext (), route .sourceNode, route .sourceField, route .destinationNode, route .destinationField);
1652
+ break;
1643
1653
  }
1644
1654
  }
1645
1655
  }
@@ -1654,11 +1664,11 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1654
1664
  element = $(event .target) .closest (".externproto", this .sceneGraph),
1655
1665
  selected = this .sceneGraph .find (".externproto.selected"),
1656
1666
  selection = selected .filter (element) .length ? selected : element,
1657
- ids = selection .map (function () { return this .id }) .get ()
1667
+ ids = selection .map (function () { return this .id }) .get ();
1658
1668
 
1659
- this .selectPrimaryElement (element)
1669
+ this .selectPrimaryElement (element);
1660
1670
 
1661
- event .originalEvent .dataTransfer .setData ("sunrize/externproto", ids .join (","))
1671
+ event .originalEvent .dataTransfer .setData ("sunrize/externproto", ids .join (","));
1662
1672
  }
1663
1673
 
1664
1674
  onDragStartProto (event)
@@ -1667,11 +1677,11 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1667
1677
  element = $(event .target) .closest (".proto", this .sceneGraph),
1668
1678
  selected = this .sceneGraph .find (".proto.selected"),
1669
1679
  selection = selected .filter (element) .length ? selected : element,
1670
- ids = selection .map (function () { return this .id }) .get ()
1680
+ ids = selection .map (function () { return this .id }) .get ();
1671
1681
 
1672
- this .selectPrimaryElement (element)
1682
+ this .selectPrimaryElement (element);
1673
1683
 
1674
- event .originalEvent .dataTransfer .setData ("sunrize/proto", ids .join (","))
1684
+ event .originalEvent .dataTransfer .setData ("sunrize/proto", ids .join (","));
1675
1685
  }
1676
1686
 
1677
1687
  onDragStartNode (event)
@@ -1680,11 +1690,11 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1680
1690
  element = $(event .target) .closest (".node", this .sceneGraph),
1681
1691
  selected = this .sceneGraph .find (".node.manually.selected"),
1682
1692
  selection = selected .filter (element) .length ? selected : element,
1683
- ids = selection .map (function () { return this .id }) .get ()
1693
+ ids = selection .map (function () { return this .id }) .get ();
1684
1694
 
1685
- this .selectPrimaryElement (element)
1695
+ this .selectPrimaryElement (element);
1686
1696
 
1687
- event .originalEvent .dataTransfer .setData ("sunrize/nodes", ids .join (","))
1697
+ event .originalEvent .dataTransfer .setData ("sunrize/nodes", ids .join (","));
1688
1698
  }
1689
1699
 
1690
1700
  onDragStartField (event)
@@ -1933,16 +1943,16 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1933
1943
 
1934
1944
  onDragLeave (event)
1935
1945
  {
1936
- event .preventDefault ()
1937
- event .stopPropagation ()
1946
+ event .preventDefault ();
1947
+ event .stopPropagation ();
1938
1948
 
1939
1949
  // Hide drop indicator.
1940
1950
 
1941
1951
  const element = $(event .target)
1942
- .closest ("li, .scene-graph", this .sceneGraph)
1952
+ .closest ("li, .scene-graph", this .sceneGraph);
1943
1953
 
1944
1954
  element .find ("> .item") .addBack ()
1945
- .removeClass (["drag-before", "drag-into", "drag-after"])
1955
+ .removeClass (["drag-before", "drag-into", "drag-after"]);
1946
1956
  }
1947
1957
 
1948
1958
  async onDrop (event)