sunrize 1.0.91 → 1.1.1
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 +14 -12
- package/src/{sunrize/Application → Application}/Application.js +175 -37
- package/src/{sunrize/Application → Application}/Dashboard.js +10 -11
- package/src/{sunrize/Application → Application}/DataStorage.js +1 -1
- package/src/{sunrize/Application → Application}/Document.js +81 -132
- package/src/{sunrize/Application → Application}/Footer.js +5 -3
- package/src/{sunrize/Application → Application}/Interface.js +52 -19
- package/src/{sunrize/Application → Application}/Selection.js +8 -17
- package/src/{sunrize/Application → Application}/Sidebar.js +9 -4
- package/src/{sunrize/Application → Application}/Tabs.js +16 -5
- package/src/{sunrize/Application → Application}/Template.js +22 -7
- package/src/Application/Window.js +13 -0
- package/src/{sunrize/Bits → Bits}/Beep.js +1 -1
- package/src/Components/Grouping/StaticGroup.js +86 -0
- package/src/{sunrize/Controls → Controls}/AddPrototypePopover.js +1 -1
- package/src/{sunrize/Controls → Controls}/Dialog.js +6 -6
- package/src/{sunrize/Controls → Controls}/EditUserDefinedFieldPopover.js +25 -4
- package/src/{sunrize/Controls → Controls}/Splitter.js +3 -3
- package/src/{sunrize/Controls → Controls}/Tabs.js +4 -4
- package/src/{sunrize/Editors → Editors}/BrowserSize.js +8 -8
- package/src/{sunrize/Editors → Editors}/Console.js +5 -6
- package/src/{sunrize/Editors → Editors}/Library.js +6 -8
- package/src/{sunrize/Editors → Editors}/NodeList.js +2 -2
- package/src/{sunrize/Editors → Editors}/OutlineEditor.js +4 -7
- package/src/{sunrize/Editors → Editors}/OutlineRouteGraph.js +8 -33
- package/src/{sunrize/Editors → Editors}/OutlineView.js +219 -25
- package/src/{sunrize/Editors → Editors}/SceneProperties.js +4 -4
- package/src/{sunrize/Editors → Editors}/ScriptEditor.js +2 -2
- package/src/{sunrize/Tools → Tools}/CADGeometry/CADAssemblyTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/CADGeometry/CADFaceTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/CADGeometry/CADLayerTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/CADGeometry/CADPartTool.js +1 -1
- package/src/Tools/Core/ToolColors.js +35 -0
- package/src/Tools/Core/X3DChildNodeTool.js +29 -0
- package/src/Tools/Core/X3DNodeTool.js +218 -0
- package/src/Tools/EnvironmentalSensor/ProximitySensorTool.js +12 -0
- package/src/Tools/EnvironmentalSensor/TransformSensorTool.js +12 -0
- package/src/Tools/EnvironmentalSensor/VisibilitySensorTool.js +12 -0
- package/src/Tools/EnvironmentalSensor/X3DEnvironmentalSensorNodeTool.js +24 -0
- package/src/Tools/EnvironmentalSensor/X3DEnvironmentalSensorNodeTool.x3d +93 -0
- package/src/{sunrize/Tools → Tools}/Geospatial/GeoLODTool.js +2 -3
- package/src/{sunrize/Tools → Tools}/Geospatial/GeoLocationTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/Geospatial/GeoTransformTool.js +1 -1
- package/src/Tools/Geospatial/GeoViewpointTool.js +22 -0
- package/src/Tools/Grouping/BooleanSwitch.x3d +61 -0
- package/src/{sunrize/Tools → Tools}/Grouping/GroupTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/Grouping/StaticGroupTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/Grouping/SwitchTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/Grouping/TransformTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/Grouping/TransformTool.x3d +3 -3
- package/src/{sunrize/Tools → Tools}/Grouping/X3DBoundedObjectTool.js +9 -22
- package/src/{sunrize/Tools → Tools}/Grouping/X3DBoundedObjectTool.x3d +135 -58
- package/src/Tools/Grouping/X3DTransformNodeTool.js +19 -0
- package/src/{sunrize/Tools → Tools}/HAnim/HAnimHumanoidTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/HAnim/HAnimJointTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/HAnim/HAnimSegmentTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/HAnim/HAnimSiteTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/Layout/LayoutGroupTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/Layout/ScreenGroupTool.js +1 -1
- package/src/Tools/Lighting/DirectionalLightTool.js +18 -0
- package/src/Tools/Lighting/PointLightTool.js +18 -0
- package/src/Tools/Lighting/SpotLightTool.js +24 -0
- package/src/Tools/Lighting/X3DLightNodeTool.js +25 -0
- package/src/Tools/Lighting/X3DLightNodeTool.x3d +405 -0
- package/src/{sunrize/Tools → Tools}/Navigation/BillboardTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/Navigation/CollisionTool.js +3 -3
- package/src/{sunrize/Tools → Tools}/Navigation/LODTool.js +1 -1
- package/src/Tools/Navigation/OrthoViewpointTool.js +19 -0
- package/src/Tools/Navigation/ViewpointTool.js +17 -0
- package/src/Tools/Navigation/X3DViewpointNodeTool.js +26 -0
- package/src/Tools/Navigation/X3DViewpointNodeTool.x3d +189 -0
- package/src/{sunrize/Tools → Tools}/Networking/AnchorTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/Networking/InlineTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/ParticleSystems/ParticleSystemTool.js +1 -1
- package/src/{sunrize/Tools → Tools}/Picking/PickableGroupTool.js +1 -1
- package/src/Tools/RigidBodyPhysics/CollidableOffsetTool.js +7 -0
- package/src/Tools/RigidBodyPhysics/CollidableShapeTool.js +7 -0
- package/src/{sunrize/Tools/RigidBodyPhysics/CollidableShapeTool.js → Tools/RigidBodyPhysics/X3DNBodyCollidableNodeTool.js} +5 -5
- package/src/{sunrize/Tools → Tools}/Shape/ShapeTool.js +1 -1
- package/src/Tools/Sound/SoundTool.js +33 -0
- package/src/Tools/Sound/SoundTool.x3d +270 -0
- package/src/Tools/TextureProjector/TextureProjectorParallelTool.js +23 -0
- package/src/Tools/TextureProjector/TextureProjectorTool.js +23 -0
- package/src/Tools/TextureProjector/X3DTextureProjectorNodeTool.js +33 -0
- package/src/Tools/TextureProjector/X3DTextureProjectorNodeTool.x3d +431 -0
- package/src/{sunrize/Tools → Tools}/VolumeRendering/X3DVolumeDataNodeTool.js +1 -1
- package/src/Tools.js +34 -0
- package/src/{sunrize/Undo → Undo}/Editor.js +25 -13
- package/src/{sunrize/X3D.js → X3D.js} +1 -1
- package/src/{html → assets/html}/application.js +1 -1
- package/src/{html/document-template.html → assets/html/window-template.html} +3 -3
- package/src/{html/document.js → assets/html/window.js} +1 -1
- package/src/{themes → assets/themes}/default-template.css +20 -158
- package/src/assets/themes/prompt-template.css +48 -0
- package/src/assets/themes/system-colors.css +169 -0
- package/src/main.js +1 -1
- package/src/html/application.html +0 -71
- package/src/html/document.html +0 -36
- package/src/sunrize/Components/Grouping/StaticGroup.js +0 -94
- package/src/sunrize/Tools/Core/ToolColors.js +0 -33
- package/src/sunrize/Tools/Core/X3DNodeTool.js +0 -164
- package/src/sunrize/Tools/Grouping/X3DTransformNodeTool.js +0 -56
- package/src/sunrize/Tools/RigidBodyPhysics/CollidableOffsetTool.js +0 -36
- package/src/sunrize/Tools.js +0 -3
- package/src/themes/default.css +0 -1442
- /package/src/{sunrize/Application → Application}/ActionKeys.js +0 -0
- /package/src/{sunrize/Application → Application}/CSS.js +0 -0
- /package/src/{sunrize/Application → Application}/GetText.js +0 -0
- /package/src/{sunrize/Application → Application}/Traverse.js +0 -0
- /package/src/{sunrize/Bits → Bits}/Algorithm.js +0 -0
- /package/src/{sunrize/Bits → Bits}/Highlight.js +0 -0
- /package/src/{sunrize/Bits → Bits}/Validate.js +0 -0
- /package/src/{sunrize/Controls → Controls}/Popover.js +0 -0
- /package/src/{sunrize/Controls → Controls}/RenameNodeInput.js +0 -0
- /package/src/{sunrize/Controls → Controls}/RenameNodePopover.js +0 -0
- /package/src/{sunrize/Editors → Editors}/AnimationEditor.js +0 -0
- /package/src/{sunrize/Editors → Editors}/FileManager.js +0 -0
- /package/src/{sunrize/Editors → Editors}/NodeInspector.js +0 -0
- /package/src/{sunrize/Editors → Editors}/Primitives.js +0 -0
- /package/src/{sunrize/Editors → Editors}/Units.js +0 -0
- /package/src/{sunrize/Fields → Fields}/MFStringTextArea.js +0 -0
- /package/src/{sunrize/Fields → Fields}/SFStringInput.js +0 -0
- /package/src/{sunrize/Fields.js → Fields.js} +0 -0
- /package/src/{sunrize/Tools → Tools}/Core/X3DPrototypeInstanceTool.js +0 -0
- /package/src/{sunrize/Tools → Tools}/Grouping/Vector.x3d +0 -0
- /package/src/{sunrize/Tools → Tools}/Layering/LayerTool.js +0 -0
- /package/src/{sunrize/Tools → Tools}/Layering/X3DLayerNodeTool.js +0 -0
- /package/src/{sunrize/Tools → Tools}/Layout/LayoutLayerTool.js +0 -0
- /package/src/{sunrize/Tools → Tools}/Shaders/ToolShader.x3d +0 -0
- /package/src/{sunrize/Tools → Tools}/VolumeRendering/IsoSurfaceVolumeDataTool.js +0 -0
- /package/src/{sunrize/Tools → Tools}/VolumeRendering/SegmentedVolumeDataTool.js +0 -0
- /package/src/{sunrize/Tools → Tools}/VolumeRendering/VolumeDataTool.js +0 -0
- /package/src/{sunrize/Undo → Undo}/UndoManager.js +0 -0
- /package/src/{audio → assets/audio}/Tink.mp3 +0 -0
- /package/src/{html → assets/html}/application-template.html +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/AccessTypes.xcf +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/initializeOnly.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOnly.0.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOnly.1.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOnly.2.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOnly.active.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOnly.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOutput.0.0.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOutput.0.1.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOutput.0.2.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOutput.1.0.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOutput.1.1.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOutput.1.2.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOutput.2.0.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOutput.2.1.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOutput.2.2.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/inputOutput.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/outputOnly.0.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/outputOnly.1.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/outputOnly.2.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/outputOnly.active.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/AccessTypes/outputOnly.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFBool.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFColor.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFColorRGBA.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFDouble.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFFloat.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFImage.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFInt32.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFMatrix3d.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFMatrix3f.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFMatrix4d.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFMatrix4f.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFNode.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFRotation.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFString.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFTime.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFVec2d.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFVec2f.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFVec3d.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFVec3f.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFVec4d.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/MFVec4f.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFBool.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFColor.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFColorRGBA.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFDouble.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFFloat.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFImage.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFInt32.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFMatrix3d.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFMatrix3f.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFMatrix4d.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFMatrix4f.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFNode.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFRotation.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFString.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFTime.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFVec2d.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFVec2f.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFVec3d.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFVec3f.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFVec4d.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/SFVec4f.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/Unkown.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Fields/none.png +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Node/ExportedNode.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Node/ExternProto.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Node/ImportedNode.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Node/NULL.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Node/Prototype.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Node/Route.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Node/SharedNode.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Node/X3DBaseNode.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Node/X3DExecutionContext.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Values/Bell.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Values/FALSE.svg +0 -0
- /package/src/{images → assets/images}/OutlineEditor/Values/TRUE.svg +0 -0
- /package/src/{images → assets/images}/icon.icns +0 -0
- /package/src/{images → assets/images}/icon.ico +0 -0
- /package/src/{images → assets/images}/icon.png +0 -0
- /package/src/{images → assets/images}/icon.svg +0 -0
- /package/src/{images → assets/images}/icons/arrow.svg +0 -0
- /package/src/{images → assets/images}/icons/hand.svg +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sunrize",
|
|
3
3
|
"productName": "Sunrize X3D Editor",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"description": "A Multi-Platform X3D Editor",
|
|
6
6
|
"main": "src/main.js",
|
|
7
7
|
"bin": {
|
|
@@ -56,32 +56,34 @@
|
|
|
56
56
|
}
|
|
57
57
|
],
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@electron-forge/cli": "^6.
|
|
60
|
-
"@electron-forge/maker-deb": "^6.
|
|
61
|
-
"@electron-forge/maker-rpm": "^6.
|
|
62
|
-
"@electron-forge/maker-squirrel": "^6.
|
|
63
|
-
"@electron-forge/maker-zip": "^6.
|
|
59
|
+
"@electron-forge/cli": "^6.4.1",
|
|
60
|
+
"@electron-forge/maker-deb": "^6.4.1",
|
|
61
|
+
"@electron-forge/maker-rpm": "^6.4.1",
|
|
62
|
+
"@electron-forge/maker-squirrel": "^6.4.1",
|
|
63
|
+
"@electron-forge/maker-zip": "^6.4.1"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"capitalize": "^2.0.4",
|
|
67
67
|
"console": "^0.7.2",
|
|
68
68
|
"css-element-queries": "^1.2.3",
|
|
69
|
-
"electron": "^
|
|
69
|
+
"electron": "^26.1.0",
|
|
70
|
+
"electron-prompt": "^1.7.0",
|
|
70
71
|
"electron-squirrel-startup": "^1.0.0",
|
|
71
72
|
"electron-tabs": "^1.0.1",
|
|
72
73
|
"fullname": "^4.0.1",
|
|
73
|
-
"jquery": "^3.7.
|
|
74
|
+
"jquery": "^3.7.1",
|
|
74
75
|
"jquery-ui-dist": "^1.13.2",
|
|
75
76
|
"jstree": "^3.3.15",
|
|
76
|
-
"material-icons": "^1.13.
|
|
77
|
-
"material-symbols": "^0.
|
|
77
|
+
"material-icons": "^1.13.10",
|
|
78
|
+
"material-symbols": "^0.11.0",
|
|
78
79
|
"md5": "^2.3.0",
|
|
79
80
|
"monaco-editor": "^0.41.0",
|
|
80
|
-
"node-
|
|
81
|
+
"node-clipboardy": "^1.0.3",
|
|
82
|
+
"node-localstorage": "^3.0.5",
|
|
81
83
|
"qtip2": "^3.0.3",
|
|
82
84
|
"spectrum-colorpicker2": "^2.0.10",
|
|
83
85
|
"string-similarity": "^4.0.4",
|
|
84
|
-
"x_ite": "^8.
|
|
86
|
+
"x_ite": "^8.12.0"
|
|
85
87
|
},
|
|
86
88
|
"config": {
|
|
87
89
|
"forge": {
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const
|
|
4
4
|
electron = require ("electron"),
|
|
5
|
+
prompt = require ("electron-prompt"),
|
|
6
|
+
clipboardy = require ("node-clipboardy"),
|
|
5
7
|
url = require ("url"),
|
|
6
8
|
path = require ("path"),
|
|
7
9
|
fs = require ("fs"),
|
|
@@ -18,6 +20,8 @@ const localStorage = new LocalStorage (path .join (electron .app .getPath ("user
|
|
|
18
20
|
module .exports = class Application
|
|
19
21
|
{
|
|
20
22
|
config = new DataStorage (localStorage, "Sunrize.Application.")
|
|
23
|
+
mainMenu = [ ]
|
|
24
|
+
openURLValue = ""
|
|
21
25
|
exportPath = new Map ()
|
|
22
26
|
|
|
23
27
|
static run ()
|
|
@@ -35,12 +39,13 @@ module .exports = class Application
|
|
|
35
39
|
|
|
36
40
|
process .env .ELECTRON_DISABLE_SECURITY_WARNINGS = "true"
|
|
37
41
|
|
|
38
|
-
this .
|
|
42
|
+
this .menuOptions = {
|
|
43
|
+
defaultEditMenu: false,
|
|
39
44
|
undoLabel: _ ("Undo"),
|
|
40
45
|
redoLabel: _ ("Redo"),
|
|
41
46
|
}
|
|
42
47
|
|
|
43
|
-
this .config .
|
|
48
|
+
this .config .setDefaultValues ({
|
|
44
49
|
position: [undefined, undefined],
|
|
45
50
|
size: [1100, 680],
|
|
46
51
|
maximized: false,
|
|
@@ -55,9 +60,10 @@ module .exports = class Application
|
|
|
55
60
|
timings: false,
|
|
56
61
|
})
|
|
57
62
|
|
|
58
|
-
Template .create (path .join (__dirname, "
|
|
59
|
-
Template .create (path .join (__dirname, "
|
|
60
|
-
Template .create (path .join (__dirname, "
|
|
63
|
+
Template .create (path .join (__dirname, "../assets/html/application-template.html"))
|
|
64
|
+
Template .create (path .join (__dirname, "../assets/html/window-template.html"))
|
|
65
|
+
Template .create (path .join (__dirname, "../assets/themes/default-template.css"))
|
|
66
|
+
Template .create (path .join (__dirname, "../assets/themes/prompt-template.css"))
|
|
61
67
|
|
|
62
68
|
this .setup ()
|
|
63
69
|
}
|
|
@@ -75,7 +81,7 @@ module .exports = class Application
|
|
|
75
81
|
electron .ipcMain .on ("title", (event, title) => this .title = title)
|
|
76
82
|
electron .ipcMain .on ("current-file", (event, currentFile) => this .currentFile = currentFile)
|
|
77
83
|
electron .ipcMain .on ("save-file", (event, filePath) => this .saveFile (filePath))
|
|
78
|
-
electron .ipcMain .on ("change-menu", (event, object) => this .
|
|
84
|
+
electron .ipcMain .on ("change-menu", (event, object) => this .updateMenu (object))
|
|
79
85
|
electron .ipcMain .on ("context-menu", (event, id, menu) => this .contextMenu (id, menu))
|
|
80
86
|
|
|
81
87
|
electron .ipcMain .handle ("file-path", async (event, basename) => await this .showSaveDialog (basename))
|
|
@@ -83,7 +89,7 @@ module .exports = class Application
|
|
|
83
89
|
|
|
84
90
|
this .fullname = await require ("fullname") ()
|
|
85
91
|
|
|
86
|
-
await this .
|
|
92
|
+
await this .updateMenu ()
|
|
87
93
|
await this .createWindow ()
|
|
88
94
|
|
|
89
95
|
this .openFiles (process .argv .slice (2) .map (filePath => url .pathToFileURL (filePath) .href))
|
|
@@ -111,21 +117,28 @@ module .exports = class Application
|
|
|
111
117
|
this .mainWindow .title = `${title} · Sunrize`
|
|
112
118
|
}
|
|
113
119
|
|
|
114
|
-
|
|
120
|
+
pushMenu (menu)
|
|
115
121
|
{
|
|
116
|
-
|
|
122
|
+
this .mainMenu .push (menu)
|
|
123
|
+
electron .Menu .setApplicationMenu (menu)
|
|
124
|
+
}
|
|
117
125
|
|
|
118
|
-
|
|
126
|
+
popMenu ()
|
|
127
|
+
{
|
|
128
|
+
this .mainMenu .pop ()
|
|
129
|
+
electron .Menu .setApplicationMenu (this .mainMenu .at (-1))
|
|
119
130
|
}
|
|
120
131
|
|
|
121
|
-
|
|
132
|
+
updateMenu (object = { })
|
|
122
133
|
{
|
|
134
|
+
Object .assign (this .menuOptions, object)
|
|
135
|
+
|
|
123
136
|
const exportPath = this .exportPath .get (this .currentFile)
|
|
124
137
|
|
|
125
138
|
const menu = electron .Menu .buildFromTemplate ([
|
|
126
139
|
{
|
|
127
|
-
label: "Sunrize",
|
|
128
140
|
role: "appMenu",
|
|
141
|
+
label: "Sunrize",
|
|
129
142
|
},
|
|
130
143
|
{
|
|
131
144
|
role: "fileMenu",
|
|
@@ -152,6 +165,43 @@ module .exports = class Application
|
|
|
152
165
|
this .openFiles (response .filePaths .map (filePath => url .pathToFileURL (filePath) .href))
|
|
153
166
|
},
|
|
154
167
|
},
|
|
168
|
+
{
|
|
169
|
+
label: _ ("Open URL..."),
|
|
170
|
+
accelerator: "Shift+CmdOrCtrl+O",
|
|
171
|
+
click: async () =>
|
|
172
|
+
{
|
|
173
|
+
const clipboard = await this .clipboard ()
|
|
174
|
+
|
|
175
|
+
this .pushMenu (electron .Menu .buildFromTemplate ([
|
|
176
|
+
{
|
|
177
|
+
role: "appMenu",
|
|
178
|
+
label: "Sunrize",
|
|
179
|
+
},
|
|
180
|
+
{ role: "editMenu" },
|
|
181
|
+
]))
|
|
182
|
+
|
|
183
|
+
const response = await prompt ({
|
|
184
|
+
title: "Open URL...",
|
|
185
|
+
label: "Enter URL for opening in new tab:",
|
|
186
|
+
type: "input",
|
|
187
|
+
value: clipboard .match (/^(?:https?|file|ftp|smb):\/\/.+/) ? clipboard : this .openURLValue,
|
|
188
|
+
inputAttrs: {
|
|
189
|
+
type: "url",
|
|
190
|
+
placeholder: "https://example.org",
|
|
191
|
+
},
|
|
192
|
+
width: 500,
|
|
193
|
+
customStylesheet: path .join (__dirname, "../assets/themes/prompt.css"),
|
|
194
|
+
},
|
|
195
|
+
this .mainWindow)
|
|
196
|
+
|
|
197
|
+
this .popMenu ()
|
|
198
|
+
|
|
199
|
+
if (response === null)
|
|
200
|
+
return
|
|
201
|
+
|
|
202
|
+
this .openFiles ([this .openURLValue = response])
|
|
203
|
+
},
|
|
204
|
+
},
|
|
155
205
|
{
|
|
156
206
|
role: "recentdocuments",
|
|
157
207
|
submenu: [
|
|
@@ -248,7 +298,7 @@ module .exports = class Application
|
|
|
248
298
|
|
|
249
299
|
this .mainWindow .webContents .send ("export-as", response .filePath)
|
|
250
300
|
|
|
251
|
-
this .
|
|
301
|
+
this .updateMenu ()
|
|
252
302
|
},
|
|
253
303
|
},
|
|
254
304
|
{ type: "separator" },
|
|
@@ -266,22 +316,23 @@ module .exports = class Application
|
|
|
266
316
|
},
|
|
267
317
|
],
|
|
268
318
|
},
|
|
319
|
+
this .menuOptions .defaultEditMenu ? { role: "editMenu" } :
|
|
269
320
|
{
|
|
270
321
|
role: "editMenu",
|
|
271
322
|
submenu: [
|
|
272
323
|
{
|
|
273
|
-
label: this .
|
|
324
|
+
label: this .menuOptions .undoLabel,
|
|
274
325
|
accelerator: "CmdOrCtrl+Z",
|
|
275
|
-
enabled: this .
|
|
326
|
+
enabled: this .menuOptions .undoLabel !== _ ("Undo"),
|
|
276
327
|
click: () =>
|
|
277
328
|
{
|
|
278
329
|
this .mainWindow .webContents .send ("undo")
|
|
279
330
|
},
|
|
280
331
|
},
|
|
281
332
|
{
|
|
282
|
-
label: this .
|
|
333
|
+
label: this .menuOptions .redoLabel,
|
|
283
334
|
accelerator: "Shift+CmdOrCtrl+Z",
|
|
284
|
-
enabled: this .
|
|
335
|
+
enabled: this .menuOptions .redoLabel !== _ ("Redo"),
|
|
285
336
|
click: () =>
|
|
286
337
|
{
|
|
287
338
|
this .mainWindow .webContents .send ("redo")
|
|
@@ -320,6 +371,11 @@ module .exports = class Application
|
|
|
320
371
|
this .mainWindow .webContents .send ("delete")
|
|
321
372
|
},
|
|
322
373
|
},
|
|
374
|
+
],
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
label: _ ("Selection"),
|
|
378
|
+
submenu: [
|
|
323
379
|
{
|
|
324
380
|
label: _ ("Select All"),
|
|
325
381
|
accelerator: "CmdOrCtrl+A",
|
|
@@ -328,11 +384,6 @@ module .exports = class Application
|
|
|
328
384
|
this .mainWindow .webContents .send ("select-all")
|
|
329
385
|
},
|
|
330
386
|
},
|
|
331
|
-
],
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
label: _ ("Selection"),
|
|
335
|
-
submenu: [
|
|
336
387
|
{
|
|
337
388
|
label: _ ("Deselect All"),
|
|
338
389
|
accelerator: "Shift+CmdOrCtrl+A",
|
|
@@ -342,6 +393,28 @@ module .exports = class Application
|
|
|
342
393
|
},
|
|
343
394
|
},
|
|
344
395
|
{ type: "separator" },
|
|
396
|
+
{
|
|
397
|
+
label: _ ("Hide Unselected Objects"),
|
|
398
|
+
click: () =>
|
|
399
|
+
{
|
|
400
|
+
this .mainWindow .webContents .send ("hide-unselected-objects")
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
label: _ ("Show Selected Objects"),
|
|
405
|
+
click: () =>
|
|
406
|
+
{
|
|
407
|
+
this .mainWindow .webContents .send ("show-selected-objects")
|
|
408
|
+
},
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
label: _ ("Show All Objects"),
|
|
412
|
+
click: () =>
|
|
413
|
+
{
|
|
414
|
+
this .mainWindow .webContents .send ("show-all-objects")
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
{ type: "separator" },
|
|
345
418
|
{
|
|
346
419
|
label: _ ("Remove Empty Groups"),
|
|
347
420
|
click: () =>
|
|
@@ -366,6 +439,14 @@ module .exports = class Application
|
|
|
366
439
|
role: "toggleDevTools",
|
|
367
440
|
visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
|
|
368
441
|
},
|
|
442
|
+
{
|
|
443
|
+
label: "Reload Tab",
|
|
444
|
+
visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
|
|
445
|
+
click: () =>
|
|
446
|
+
{
|
|
447
|
+
this .mainWindow .webContents .send ("reload")
|
|
448
|
+
},
|
|
449
|
+
},
|
|
369
450
|
{
|
|
370
451
|
label: "Toggle Tab Developer Tools",
|
|
371
452
|
visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
|
|
@@ -534,19 +615,28 @@ module .exports = class Application
|
|
|
534
615
|
},
|
|
535
616
|
{
|
|
536
617
|
role: "help",
|
|
537
|
-
submenu: [
|
|
618
|
+
submenu: [
|
|
619
|
+
{
|
|
620
|
+
label: "Learn More",
|
|
621
|
+
click: async () =>
|
|
622
|
+
{
|
|
623
|
+
await electron .shell .openExternal ("https://create3000.github.io/x_ite/")
|
|
624
|
+
},
|
|
625
|
+
},
|
|
626
|
+
],
|
|
538
627
|
},
|
|
539
628
|
])
|
|
540
629
|
|
|
541
|
-
|
|
630
|
+
this .mainMenu [0] = menu
|
|
542
631
|
|
|
543
|
-
this .mainMenu
|
|
632
|
+
if (this .mainMenu .length === 1)
|
|
633
|
+
electron .Menu .setApplicationMenu (menu)
|
|
544
634
|
}
|
|
545
635
|
|
|
546
636
|
async createWindow ()
|
|
547
637
|
{
|
|
548
638
|
const window = new electron .BrowserWindow ({
|
|
549
|
-
icon: path .join (__dirname, "
|
|
639
|
+
icon: path .join (__dirname, "../assets/images/icon.png"),
|
|
550
640
|
x: this .config .position [0],
|
|
551
641
|
y: this .config .position [1],
|
|
552
642
|
width: Math .max (this .config .getDefaultValue ("size") [0] / 4, this .config .size [0]),
|
|
@@ -556,7 +646,7 @@ module .exports = class Application
|
|
|
556
646
|
backgroundColor: electron .nativeTheme .shouldUseDarkColors ? "rgb(28, 28, 30)" : "rgb(242, 242, 247)",
|
|
557
647
|
show: false,
|
|
558
648
|
webPreferences: {
|
|
559
|
-
preload: path .join (__dirname, "
|
|
649
|
+
preload: path .join (__dirname, "../assets/html/application.js"),
|
|
560
650
|
nodeIntegration: true,
|
|
561
651
|
contextIsolation: false,
|
|
562
652
|
webviewTag: true,
|
|
@@ -580,7 +670,7 @@ module .exports = class Application
|
|
|
580
670
|
|
|
581
671
|
window .setFullScreen (this .config .fullscreen)
|
|
582
672
|
|
|
583
|
-
await window .loadFile (path .join (__dirname, "
|
|
673
|
+
await window .loadFile (path .join (__dirname, "../assets/html/application.html"))
|
|
584
674
|
}
|
|
585
675
|
|
|
586
676
|
activate ()
|
|
@@ -631,13 +721,28 @@ module .exports = class Application
|
|
|
631
721
|
|
|
632
722
|
async showOpenDialog (defaultPath)
|
|
633
723
|
{
|
|
634
|
-
|
|
724
|
+
this .pushMenu (electron .Menu .buildFromTemplate ([
|
|
725
|
+
{
|
|
726
|
+
role: "appMenu",
|
|
727
|
+
label: "Sunrize",
|
|
728
|
+
},
|
|
729
|
+
{ role: "editMenu" },
|
|
730
|
+
]))
|
|
731
|
+
|
|
732
|
+
const response = await electron .dialog .showOpenDialog ({
|
|
635
733
|
defaultPath: defaultPath,
|
|
636
734
|
properties: ["openFile", "multiSelections"],
|
|
637
|
-
filters
|
|
638
|
-
{
|
|
735
|
+
filters: [
|
|
736
|
+
{
|
|
737
|
+
name: "X3D Document",
|
|
738
|
+
extensions: ["x3d", "x3dz", "x3dj", "x3djz", "x3dv", "x3dvz", "wrl", "wrz", "wrl.gz", "vrml", "gltf", "glb", "obj", "stl", "ply", "svg"],
|
|
739
|
+
},
|
|
639
740
|
],
|
|
640
741
|
})
|
|
742
|
+
|
|
743
|
+
this .popMenu ()
|
|
744
|
+
|
|
745
|
+
return response
|
|
641
746
|
}
|
|
642
747
|
|
|
643
748
|
saveFile (filePath)
|
|
@@ -647,7 +752,15 @@ module .exports = class Application
|
|
|
647
752
|
|
|
648
753
|
async showSaveDialog (defaultPath)
|
|
649
754
|
{
|
|
650
|
-
|
|
755
|
+
this .pushMenu (electron .Menu .buildFromTemplate ([
|
|
756
|
+
{
|
|
757
|
+
role: "appMenu",
|
|
758
|
+
label: "Sunrize",
|
|
759
|
+
},
|
|
760
|
+
{ role: "editMenu" },
|
|
761
|
+
]))
|
|
762
|
+
|
|
763
|
+
const response = await electron .dialog .showSaveDialog ({
|
|
651
764
|
defaultPath: defaultPath,
|
|
652
765
|
properties: ["createDirectory", "showOverwriteConfirmation"],
|
|
653
766
|
filters : [
|
|
@@ -659,17 +772,33 @@ module .exports = class Application
|
|
|
659
772
|
{ name: "X3D VRML Classic Document GZipped", extensions: ["x3dvz"] },
|
|
660
773
|
],
|
|
661
774
|
})
|
|
775
|
+
|
|
776
|
+
this .popMenu ()
|
|
777
|
+
|
|
778
|
+
return response
|
|
662
779
|
}
|
|
663
780
|
|
|
664
781
|
async showExportDialog (defaultPath)
|
|
665
782
|
{
|
|
666
|
-
|
|
783
|
+
this .pushMenu (electron .Menu .buildFromTemplate ([
|
|
784
|
+
{
|
|
785
|
+
role: "appMenu",
|
|
786
|
+
label: "Sunrize",
|
|
787
|
+
},
|
|
788
|
+
{ role: "editMenu" },
|
|
789
|
+
]))
|
|
790
|
+
|
|
791
|
+
const response = await electron .dialog .showSaveDialog ({
|
|
667
792
|
defaultPath: defaultPath,
|
|
668
793
|
properties: ["createDirectory", "showOverwriteConfirmation"],
|
|
669
794
|
filters : [
|
|
670
795
|
{ name: "HTML Document", extensions: ["html"] },
|
|
671
796
|
],
|
|
672
797
|
})
|
|
798
|
+
|
|
799
|
+
this .popMenu ()
|
|
800
|
+
|
|
801
|
+
return response
|
|
673
802
|
}
|
|
674
803
|
|
|
675
804
|
maximize ()
|
|
@@ -715,15 +844,24 @@ module .exports = class Application
|
|
|
715
844
|
}
|
|
716
845
|
}
|
|
717
846
|
|
|
847
|
+
async clipboard ()
|
|
848
|
+
{
|
|
849
|
+
try
|
|
850
|
+
{
|
|
851
|
+
return await clipboardy .read ()
|
|
852
|
+
}
|
|
853
|
+
catch
|
|
854
|
+
{
|
|
855
|
+
return ""
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
|
|
718
859
|
quit ()
|
|
719
860
|
{
|
|
720
861
|
if (!this .applicationShouldQuitAfterLastWindowClosed)
|
|
721
862
|
return
|
|
722
863
|
|
|
723
|
-
Template .
|
|
724
|
-
Template .remove (path .join (__dirname, "../../html/document-template.html"))
|
|
725
|
-
Template .remove (path .join (__dirname, "../../themes/default-template.css"))
|
|
726
|
-
|
|
864
|
+
Template .removeAll ()
|
|
727
865
|
electron .app .quit ()
|
|
728
866
|
}
|
|
729
867
|
}
|
|
@@ -4,7 +4,6 @@ const
|
|
|
4
4
|
$ = require ("jquery"),
|
|
5
5
|
X3D = require ("../X3D"),
|
|
6
6
|
Interface = require ("./Interface"),
|
|
7
|
-
Box3 = X3D .require ("standard/Math/Geometry/Box3"),
|
|
8
7
|
_ = require ("./GetText")
|
|
9
8
|
|
|
10
9
|
module .exports = class Dashboard extends Interface
|
|
@@ -40,7 +39,7 @@ module .exports = class Dashboard extends Interface
|
|
|
40
39
|
.css ({ position: "relative", left: "-1px", "font-weight": "bold" })
|
|
41
40
|
.text ("play_arrow")
|
|
42
41
|
.appendTo (this .toolbar)
|
|
43
|
-
.on ("click", () => this .play (!this .
|
|
42
|
+
.on ("click", () => this .play (!this .fileConfig .play))
|
|
44
43
|
|
|
45
44
|
$("<span></span>") .addClass ("separator") .appendTo (this .toolbar)
|
|
46
45
|
|
|
@@ -61,19 +60,19 @@ module .exports = class Dashboard extends Interface
|
|
|
61
60
|
|
|
62
61
|
configure ()
|
|
63
62
|
{
|
|
64
|
-
this .
|
|
63
|
+
this .fileConfig .setDefaultValues ({
|
|
65
64
|
pointer: "hand",
|
|
66
65
|
play: false,
|
|
67
66
|
})
|
|
68
67
|
|
|
69
|
-
this [this .
|
|
70
|
-
this .play (this .
|
|
68
|
+
this [this .fileConfig .pointer] ()
|
|
69
|
+
this .play (this .fileConfig .play)
|
|
71
70
|
this .straighten (this .browser .getBrowserOption ("StraightenHorizon"))
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
hand ()
|
|
75
74
|
{
|
|
76
|
-
this .
|
|
75
|
+
this .fileConfig .pointer = "hand"
|
|
77
76
|
|
|
78
77
|
if (this .handButton .hasClass ("active"))
|
|
79
78
|
return
|
|
@@ -84,7 +83,7 @@ module .exports = class Dashboard extends Interface
|
|
|
84
83
|
|
|
85
84
|
arrow ()
|
|
86
85
|
{
|
|
87
|
-
this .
|
|
86
|
+
this .fileConfig .pointer = "arrow"
|
|
88
87
|
|
|
89
88
|
if (this .arrowButton .hasClass ("active"))
|
|
90
89
|
return
|
|
@@ -95,7 +94,7 @@ module .exports = class Dashboard extends Interface
|
|
|
95
94
|
|
|
96
95
|
play (value)
|
|
97
96
|
{
|
|
98
|
-
this .
|
|
97
|
+
this .fileConfig .play = value
|
|
99
98
|
|
|
100
99
|
if (value)
|
|
101
100
|
{
|
|
@@ -112,7 +111,7 @@ module .exports = class Dashboard extends Interface
|
|
|
112
111
|
viewAll ()
|
|
113
112
|
{
|
|
114
113
|
const
|
|
115
|
-
outlineEditor = require ("./
|
|
114
|
+
outlineEditor = require ("./Window") .sidebar .outlineEditor,
|
|
116
115
|
selection = outlineEditor .sceneGraph .find (".node.selected")
|
|
117
116
|
|
|
118
117
|
if (selection .length)
|
|
@@ -120,7 +119,7 @@ module .exports = class Dashboard extends Interface
|
|
|
120
119
|
const
|
|
121
120
|
layerNode = this .browser .getActiveLayer (),
|
|
122
121
|
viewpointNode = this .browser .getActiveViewpoint (),
|
|
123
|
-
bbox = new Box3 (),
|
|
122
|
+
bbox = new X3D .Box3 (),
|
|
124
123
|
straighten = this .browser .getBrowserOption ("StraightenHorizon")
|
|
125
124
|
|
|
126
125
|
for (const element of selection)
|
|
@@ -134,7 +133,7 @@ module .exports = class Dashboard extends Interface
|
|
|
134
133
|
|
|
135
134
|
const modelMatrix = outlineEditor .getModelMatrix ($(element), false)
|
|
136
135
|
|
|
137
|
-
bbox .add (node .getBBox (new Box3 ()) .multRight (modelMatrix))
|
|
136
|
+
bbox .add (node .getBBox (new X3D .Box3 ()) .multRight (modelMatrix))
|
|
138
137
|
}
|
|
139
138
|
catch
|
|
140
139
|
{ }
|