@lvce-editor/shared-process 0.21.0 → 0.21.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 +4 -4
- package/src/parts/ElectronContextMenu/ElectronContextMenu.js +6 -2
- package/src/parts/ElectronSafeStorage/ElectronSafeStorage.js +6 -3
- package/src/parts/ElectronWindow/ElectronWindow.js +7 -7
- package/src/parts/HandleUncaughtExceptionMonitor/HandleUncaughtExceptionMonitor.js +5 -0
- package/src/parts/HandleWindowAllClosed/HandleWindowAllClosed.js +1 -1
- package/src/parts/Main/Main.js +2 -3
- package/src/parts/Platform/Platform.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/code-frame": "^7.23.5",
|
|
21
|
-
"@lvce-editor/extension-host": "0.21.
|
|
22
|
-
"@lvce-editor/extension-host-helper-process": "0.21.
|
|
21
|
+
"@lvce-editor/extension-host": "0.21.1",
|
|
22
|
+
"@lvce-editor/extension-host-helper-process": "0.21.1",
|
|
23
23
|
"@lvce-editor/json-rpc": "^0.4.0",
|
|
24
24
|
"@lvce-editor/jsonc-parser": "^1.1.0",
|
|
25
25
|
"@lvce-editor/pretty-error": "^1.2.2",
|
|
26
|
-
"@lvce-editor/pty-host": "0.21.
|
|
26
|
+
"@lvce-editor/pty-host": "0.21.1",
|
|
27
27
|
"@lvce-editor/verror": "^1.1.2",
|
|
28
28
|
"debug": "^4.3.4",
|
|
29
29
|
"execa": "^8.0.1",
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import * as Assert from '../Assert/Assert.js'
|
|
1
2
|
import * as ParentIpc from '../ParentIpc/ParentIpc.js'
|
|
2
3
|
|
|
3
|
-
export const openContextMenu = (menuItems, x, y
|
|
4
|
-
|
|
4
|
+
export const openContextMenu = (menuItems, x, y) => {
|
|
5
|
+
Assert.array(menuItems)
|
|
6
|
+
Assert.number(x)
|
|
7
|
+
Assert.number(y)
|
|
8
|
+
return ParentIpc.invoke('ElectronContextMenu.openContextMenu', menuItems, x, y)
|
|
5
9
|
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import * as EncodingType from '../EncodingType/EncodingType.js'
|
|
1
2
|
import * as ParentIpc from '../ParentIpc/ParentIpc.js'
|
|
2
3
|
|
|
3
4
|
export const isEncryptionAvailable = () => {
|
|
4
5
|
return ParentIpc.invoke('ElectronSafeStorage.isEncryptionAvailable')
|
|
5
6
|
}
|
|
6
7
|
|
|
7
|
-
export const encryptString = (plainText) => {
|
|
8
|
-
|
|
8
|
+
export const encryptString = async (plainText) => {
|
|
9
|
+
const buffer = await ParentIpc.invoke('ElectronSafeStorage.encrypt', plainText)
|
|
10
|
+
return buffer.toString(EncodingType.Base64)
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export const decryptString = (encrypted) => {
|
|
12
|
-
|
|
14
|
+
const buffer = Buffer.from(encrypted, EncodingType.Base64)
|
|
15
|
+
return ParentIpc.invoke('ElectronSafeStorage.decrypt', buffer)
|
|
13
16
|
}
|
|
@@ -8,32 +8,32 @@ export const openNew = () => {
|
|
|
8
8
|
|
|
9
9
|
export const minimize = (windowId) => {
|
|
10
10
|
Assert.number(windowId)
|
|
11
|
-
return ParentIpc.invoke('ElectronWindow.
|
|
11
|
+
return ParentIpc.invoke('ElectronWindow.executeWindowFunction', windowId, 'minimize')
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export const toggleDevtools = (windowId) => {
|
|
15
15
|
Assert.number(windowId)
|
|
16
|
-
return ParentIpc.invoke('ElectronWindow.
|
|
16
|
+
return ParentIpc.invoke('ElectronWindow.executeWebContentsFunction', windowId, 'toggleDevTools')
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export const maximize = (windowId) => {
|
|
20
20
|
Assert.number(windowId)
|
|
21
|
-
return ParentIpc.invoke('ElectronWindow.
|
|
21
|
+
return ParentIpc.invoke('ElectronWindow.executeWindowFunction', windowId, 'maximize')
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export const unmaximize = (windowId) => {
|
|
25
25
|
Assert.number(windowId)
|
|
26
|
-
return ParentIpc.invoke('ElectronWindow.unmaximize')
|
|
26
|
+
return ParentIpc.invoke('ElectronWindow.executeWindowFunction', windowId, 'unmaximize')
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export const close = (windowId) => {
|
|
30
30
|
Assert.number(windowId)
|
|
31
|
-
return ParentIpc.invoke('ElectronWindow.
|
|
31
|
+
return ParentIpc.invoke('ElectronWindow.executeWindowFunction', windowId, 'close')
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export const reload = (windowId) => {
|
|
35
35
|
Assert.number(windowId)
|
|
36
|
-
return ParentIpc.invoke('ElectronWindow.
|
|
36
|
+
return ParentIpc.invoke('ElectronWindow.executeWindowFunction', windowId, 'reload')
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export const zoomIn = (windowId) => {
|
|
@@ -49,7 +49,7 @@ export const zoomReset = (windowId) => {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export const focus = (windowId) => {
|
|
52
|
-
return ParentIpc.invoke('ElectronWindow.
|
|
52
|
+
return ParentIpc.invoke('ElectronWindow.executeWebContentsFunction', windowId, 'focus')
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export const handleClose = (windowId) => {
|
package/src/parts/Main/Main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { setPriority } from 'node:os'
|
|
2
1
|
import * as Command from '../Command/Command.js'
|
|
2
|
+
import * as HandleUncaughtExceptionMonitor from '../HandleUncaughtExceptionMonitor/HandleUncaughtExceptionMonitor.js'
|
|
3
3
|
import * as Module from '../Module/Module.js'
|
|
4
4
|
import * as ParentIpc from '../ParentIpc/ParentIpc.js'
|
|
5
5
|
import * as ProcessListeners from '../ProcessListeners/ProcessListeners.js'
|
|
@@ -9,7 +9,6 @@ export const main = async () => {
|
|
|
9
9
|
Command.setLoad(Module.load)
|
|
10
10
|
process.on('disconnect', ProcessListeners.handleDisconnect)
|
|
11
11
|
process.on(Signal.SIGTERM, ProcessListeners.handleSigTerm)
|
|
12
|
-
process.on('uncaughtExceptionMonitor',
|
|
12
|
+
process.on('uncaughtExceptionMonitor', HandleUncaughtExceptionMonitor.handleUncaughtExceptionMonitor)
|
|
13
13
|
await ParentIpc.listen()
|
|
14
|
-
setPriority(process.pid, 19)
|
|
15
14
|
}
|
|
@@ -53,11 +53,11 @@ export const getSetupName = () => {
|
|
|
53
53
|
return 'Lvce-Setup'
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
export const version = '0.21.
|
|
56
|
+
export const version = '0.21.1'
|
|
57
57
|
|
|
58
|
-
export const commit = '
|
|
58
|
+
export const commit = '1aea3f8'
|
|
59
59
|
|
|
60
|
-
export const date = '2023-12-
|
|
60
|
+
export const date = '2023-12-12T20:15:17.000Z'
|
|
61
61
|
|
|
62
62
|
export const getVersion = () => {
|
|
63
63
|
return version
|