sunrize 1.3.4 → 1.3.5

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.4",
4
+ "version": "1.3.5",
5
5
  "description": "A Multi-Platform X3D Editor",
6
6
  "main": "src/main.js",
7
7
  "bin": {
@@ -14,12 +14,14 @@
14
14
  "scripts": {
15
15
  "start": "electron .",
16
16
  "development": "SUNRISE_ENVIRONMENT=DEVELOPMENT electron .",
17
- "package": "node build/package.js",
18
- "premake": "npm i -D electron",
19
- "make": "electron-forge make",
20
- "postmake": "npm i -P electron",
21
17
  "release": "node build/release.js",
22
18
  "download": "node build/download.js",
19
+ "premake": "npm i -D electron",
20
+ "make": "env PATH=\"$(pwd)/build/wine-proxy:$PATH\" electron-forge make",
21
+ "postmake": "npm i -P electron",
22
+ "pregithub": "npm i -D electron",
23
+ "github": "env PATH=\"$(pwd)/build/wine-proxy:$PATH\" electron-forge publish",
24
+ "postgithub": "npm i -P electron",
23
25
  "predocs": "rm -f -r docs/_site/",
24
26
  "docs": "cd docs && bundle exec jekyll serve --incremental --host=`ipconfig getifaddr en0`",
25
27
  "docs-install": "cd docs && bundle install",
@@ -68,15 +70,17 @@
68
70
  "devDependencies": {
69
71
  "@electron-forge/cli": "^7.2.0",
70
72
  "@electron-forge/maker-deb": "^7.2.0",
73
+ "@electron-forge/maker-dmg": "^7.2.0",
71
74
  "@electron-forge/maker-rpm": "^7.2.0",
72
75
  "@electron-forge/maker-squirrel": "^7.2.0",
73
76
  "@electron-forge/maker-zip": "^7.2.0",
77
+ "@electron-forge/publisher-github": "^7.2.0",
74
78
  "shell-tools": "^1.1.7"
75
79
  },
76
80
  "dependencies": {
77
81
  "capitalize": "^2.0.4",
78
82
  "console": "^0.7.2",
79
- "electron": "^28.0.0",
83
+ "electron": "^28.1.0",
80
84
  "electron-prompt": "^1.7.0",
81
85
  "electron-squirrel-startup": "^1.0.0",
82
86
  "electron-tabs": "^1.0.2",
@@ -93,34 +97,45 @@
93
97
  "qtip2": "^3.0.3",
94
98
  "spectrum-colorpicker2": "^2.0.10",
95
99
  "string-similarity": "^4.0.4",
96
- "x_ite": "^9.1.10"
100
+ "update-electron-app": "^3.0.0",
101
+ "x_ite": "^9.1.11"
97
102
  },
98
103
  "config": {
99
104
  "forge": {
100
105
  "packagerConfig": {
101
106
  "icon": "./src/assets/images/icon.png",
102
- "extendInfo": "./src/assets/Info.plist"
107
+ "dir": "./src",
108
+ "ignore": "^/(?!src|package\\.json|node_modules)",
109
+ "certificateFile": "./build/certificate.pfx",
110
+ "certificatePassword": "CREATE3000",
111
+ "extendInfo": "./src/assets/Info.plist",
112
+ "osxSign": {}
103
113
  },
104
114
  "makers": [
105
115
  {
106
- "name": "@electron-forge/maker-squirrel",
107
- "config": {
108
- "name": "Sunrize"
109
- }
116
+ "name": "@electron-forge/maker-squirrel"
110
117
  },
111
118
  {
112
- "name": "@electron-forge/maker-zip",
113
- "platforms": [
114
- "darwin"
115
- ]
119
+ "name": "@electron-forge/maker-dmg"
116
120
  },
117
121
  {
118
- "name": "@electron-forge/maker-deb",
119
- "config": {}
122
+ "name": "@electron-forge/maker-deb"
120
123
  },
121
124
  {
122
- "name": "@electron-forge/maker-rpm",
123
- "config": {}
125
+ "name": "@electron-forge/maker-rpm"
126
+ }
127
+ ],
128
+ "publishers": [
129
+ {
130
+ "name": "@electron-forge/publisher-github",
131
+ "config": {
132
+ "repository": {
133
+ "owner": "create3000",
134
+ "name": "sunrize"
135
+ },
136
+ "prerelease": false,
137
+ "draft": false
138
+ }
124
139
  }
125
140
  ]
126
141
  }
@@ -13,8 +13,6 @@ const
13
13
  DataStorage = require ("../Application/DataStorage"),
14
14
  _ = require ("../Application/GetText");
15
15
 
16
- // Use electron@15.3
17
-
18
16
  const localStorage = new LocalStorage (path .join (electron .app .getPath ("userData"), "Global Storage"));
19
17
 
20
18
  module .exports = class Application
@@ -27,10 +25,22 @@ module .exports = class Application
27
25
 
28
26
  static run ()
29
27
  {
30
- if (electron .app .requestSingleInstanceLock ())
31
- new this ();
32
- else
28
+ if (require ("electron-squirrel-startup"))
29
+ {
30
+ electron .app .quit ();
31
+ return;
32
+ }
33
+
34
+ if (!electron .app .requestSingleInstanceLock ())
35
+ {
33
36
  electron .app .quit ();
37
+ return;
38
+ }
39
+
40
+ if (process .platform === "win32")
41
+ require ("update-electron-app") .updateElectronApp ();
42
+
43
+ new Application ();
34
44
  }
35
45
 
36
46
  constructor ()
@@ -90,6 +100,7 @@ module .exports = class Application
90
100
  await this .createWindow ();
91
101
 
92
102
  this .openFiles (process .argv .slice (electron .app .isPackaged ? 1 : 2)
103
+ .filter (filePath => fs .existsSync (filePath) && fs .lstatSync (filePath) .isFile ())
93
104
  .map (filePath => url .pathToFileURL (filePath) .href));
94
105
 
95
106
  this .openFiles (this .receivedFiles);
@@ -632,9 +643,9 @@ module .exports = class Application
632
643
  submenu: [
633
644
  {
634
645
  label: "Learn More",
635
- click: async () =>
646
+ click: () =>
636
647
  {
637
- await electron .shell .openExternal ("https://create3000.github.io/x_ite/");
648
+ electron .shell .openExternal ("https://create3000.github.io/x_ite/");
638
649
  },
639
650
  },
640
651
  ],
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ const
4
+ $ = require ("jquery"),
5
+ Editor = require ("../Undo/Editor"),
6
+ UndoManager = require ("../Undo/UndoManager"),
7
+ _ = require ("../Application/GetText");
8
+
9
+ require ("./Popover");
10
+ require ("../Bits/Validate");
11
+
12
+ $.fn.exportNodePopover = function (node, oldExportedName)
13
+ {
14
+ // Create content.
15
+
16
+ const scene = node .getExecutionContext ();
17
+
18
+ const nameInput = $("<input></input>")
19
+ .attr ("placeholder", _ ("Enter exported name"))
20
+ .val (oldExportedName ?? scene .getUniqueExportName (node .getName ()));
21
+
22
+ // Create tooltip.
23
+
24
+ const tooltip = this .popover ({
25
+ content: nameInput,
26
+ events: {
27
+ show: (event, api) =>
28
+ {
29
+ nameInput .validate (Editor .Id, () =>
30
+ {
31
+ $ .beep ();
32
+ nameInput .highlight ();
33
+ })
34
+ .on ("keydown.exportNodePopover", event =>
35
+ {
36
+ if (event .key !== "Enter")
37
+ return;
38
+
39
+ event .preventDefault ();
40
+
41
+ api .toggle (false);
42
+
43
+ if (!nameInput .val ())
44
+ return;
45
+
46
+ if (oldExportedName && oldExportedName === nameInput .val ())
47
+ return;
48
+
49
+ const exportedName = scene .getUniqueExportName (nameInput .val ());
50
+
51
+ Editor .updateExportedNode (scene, exportedName, oldExportedName, node);
52
+ });
53
+
54
+ setTimeout (() => nameInput .trigger ("select"), 1);
55
+ },
56
+ },
57
+ })
58
+
59
+ return this;
60
+ };
61
+
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ const
4
+ $ = require ("jquery"),
5
+ Editor = require ("../Undo/Editor"),
6
+ UndoManager = require ("../Undo/UndoManager"),
7
+ _ = require ("../Application/GetText");
8
+
9
+ require ("./Popover");
10
+ require ("../Bits/Validate");
11
+
12
+ $.fn.importNodePopover = function (inlineNode, exportedName, oldImportedName)
13
+ {
14
+ // Create content.
15
+
16
+ const executionContext = inlineNode .getExecutionContext ();
17
+
18
+ const nameInput = $("<input></input>")
19
+ .attr ("placeholder", _ ("Enter imported name"))
20
+ .val (oldImportedName ?? executionContext .getUniqueImportName (exportedName));
21
+
22
+ // Create tooltip.
23
+
24
+ const tooltip = this .popover ({
25
+ content: nameInput,
26
+ events: {
27
+ show: (event, api) =>
28
+ {
29
+ nameInput .validate (Editor .Id, () =>
30
+ {
31
+ $ .beep ();
32
+ nameInput .highlight ();
33
+ })
34
+ .on ("keydown.importNodePopover", event =>
35
+ {
36
+ if (event .key !== "Enter")
37
+ return;
38
+
39
+ event .preventDefault ();
40
+
41
+ api .toggle (false);
42
+
43
+ if (!nameInput .val ())
44
+ return;
45
+
46
+ if (oldImportedName && oldImportedName === nameInput .val ())
47
+ return;
48
+
49
+ const importedName = executionContext .getUniqueImportName (nameInput .val ());
50
+
51
+ Editor .updateImportedNode (executionContext, inlineNode, exportedName, importedName, oldImportedName);
52
+ });
53
+
54
+ setTimeout (() => nameInput .trigger ("select"), 1);
55
+ },
56
+ },
57
+ })
58
+
59
+ return this;
60
+ };
61
+
@@ -1,94 +1,94 @@
1
- "use strict"
1
+ "use strict";
2
2
 
3
3
  const
4
4
  $ = require ("jquery"),
5
5
  X3D = require ("../X3D"),
6
6
  Editor = require ("../Undo/Editor"),
7
7
  UndoManager = require ("../Undo/UndoManager"),
8
- _ = require ("../Application/GetText")
8
+ _ = require ("../Application/GetText");
9
9
 
10
- require ("../Bits/Validate")
10
+ require ("../Bits/Validate");
11
11
 
12
12
  $.fn.renameNodeInput = function (node)
13
13
  {
14
- this .off ("keydown.renameNodeInput")
15
-
16
- this .val (node ? node .getName () : "")
14
+ this
15
+ .off ("keydown.renameNodeInput")
16
+ .val (node ? node .getName () : "");
17
17
 
18
18
  this .validate (Editor .Id, () =>
19
19
  {
20
- $ .beep ()
21
- this .highlight ()
20
+ $ .beep ();
21
+ this .highlight ();
22
22
  })
23
23
  .on ("keydown.renameNodeInput", (event) =>
24
24
  {
25
25
  if (!node)
26
- return
26
+ return;
27
27
 
28
28
  if (event .key !== "Enter")
29
- return
29
+ return;
30
30
 
31
- event .preventDefault ()
31
+ event .preventDefault ();
32
32
 
33
- let name = this .val ()
33
+ let name = this .val ();
34
34
 
35
35
  if (name === node .getName ())
36
- return
36
+ return;
37
37
 
38
- const executionContext = node .getExecutionContext ()
38
+ const executionContext = node .getExecutionContext ();
39
39
 
40
40
  if (node instanceof X3D .X3DProtoDeclarationNode)
41
41
  {
42
42
  if (!name)
43
- return
43
+ return;
44
44
 
45
45
  if (node .isExternProto)
46
46
  {
47
- name = executionContext .getUniqueExternProtoName (name)
47
+ name = executionContext .getUniqueExternProtoName (name);
48
48
 
49
- const externproto = node
49
+ const externproto = node;
50
50
 
51
- UndoManager .shared .beginUndo (_ ("Update Extern Proto Declaration »%s«"), name)
51
+ UndoManager .shared .beginUndo (_ ("Update Extern Proto Declaration »%s«"), name);
52
52
 
53
- Editor .updateExternProtoDeclaration (executionContext, name, externproto)
53
+ Editor .updateExternProtoDeclaration (executionContext, name, externproto);
54
54
 
55
55
  if (!executionContext .protos .get (name))
56
56
  {
57
- const available = Editor .getNextAvailableProtoNode (executionContext, externproto)
57
+ const available = Editor .getNextAvailableProtoNode (executionContext, externproto);
58
58
 
59
59
  if (available)
60
- Editor .replaceProtoNodes (executionContext, available, externproto)
60
+ Editor .replaceProtoNodes (executionContext, available, externproto);
61
61
  }
62
62
 
63
- UndoManager .shared .endUndo ()
63
+ UndoManager .shared .endUndo ();
64
64
  }
65
65
  else
66
66
  {
67
- name = executionContext .getUniqueProtoName (name)
67
+ name = executionContext .getUniqueProtoName (name);
68
68
 
69
- const proto = node
69
+ const proto = node;
70
70
 
71
- UndoManager .shared .beginUndo (_ ("Update Proto Declaration »%s«"), name)
71
+ UndoManager .shared .beginUndo (_ ("Update Proto Declaration »%s«"), name);
72
72
 
73
- Editor .updateProtoDeclaration (executionContext, name, proto)
73
+ Editor .updateProtoDeclaration (executionContext, name, proto);
74
74
 
75
- const available = Editor .getNextAvailableProtoNode (executionContext, proto)
75
+ const available = Editor .getNextAvailableProtoNode (executionContext, proto);
76
76
 
77
77
  if (available)
78
- Editor .replaceProtoNodes (executionContext, available, proto)
78
+ Editor .replaceProtoNodes (executionContext, available, proto);
79
79
 
80
- UndoManager .shared .endUndo ()
80
+ UndoManager .shared .endUndo ();
81
81
  }
82
82
  }
83
83
  else
84
84
  {
85
85
  if (name)
86
- Editor .updateNamedNode (executionContext, executionContext .getUniqueName (name), node)
86
+ Editor .updateNamedNode (executionContext, executionContext .getUniqueName (name), node);
87
87
  else
88
- Editor .removeNamedNode (executionContext, node)
88
+ Editor .removeNamedNode (executionContext, node);
89
89
  }
90
90
  })
91
91
 
92
- return this
93
- }
92
+ return this;
93
+ };
94
94