@lvce-editor/shared-process 0.23.2 → 0.23.3
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 +3 -3
- package/src/parts/ElectronWebContentsView/ElectronWebContentsView.ipc.js +8 -0
- package/src/parts/ElectronWebContentsView/ElectronWebContentsView.js +15 -0
- package/src/parts/ElectronWebContentsViewFunctions/ElectronWebContentsViewFunctions.ipc.js +20 -0
- package/src/parts/ElectronWebContentsViewFunctions/ElectronWebContentsViewViewFunctions.js +50 -0
- package/src/parts/ExtensionInstallFromFile/ExtensionInstallFromFile.js +1 -0
- package/src/parts/Module/Module.js +2 -0
- package/src/parts/ModuleId/ModuleId.js +2 -0
- package/src/parts/ModuleMap/ModuleMap.js +17 -0
- package/src/parts/ParseUrlGithub/ParseUrlGithub.js +9 -0
- 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.23.
|
|
3
|
+
"version": "0.23.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lvce-editor/assert": "^1.2.0",
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.23.
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.23.3",
|
|
22
22
|
"@lvce-editor/ipc": "^2.1.0",
|
|
23
23
|
"@lvce-editor/json-rpc": "^1.0.0",
|
|
24
24
|
"@lvce-editor/jsonc-parser": "^1.1.0",
|
|
25
25
|
"@lvce-editor/pretty-error": "^1.5.0",
|
|
26
|
-
"@lvce-editor/pty-host": "0.23.
|
|
26
|
+
"@lvce-editor/pty-host": "0.23.3",
|
|
27
27
|
"@lvce-editor/verror": "^1.1.2",
|
|
28
28
|
"@lvce-editor/web-socket-server": "^1.1.0",
|
|
29
29
|
"debug": "^4.3.4",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as ElectronWebContentsView from './ElectronWebContentsView.js'
|
|
2
|
+
|
|
3
|
+
export const name = 'ElectronWebContentsView'
|
|
4
|
+
|
|
5
|
+
export const Commands = {
|
|
6
|
+
createWebContentsView: ElectronWebContentsView.createWebContentsView,
|
|
7
|
+
disposeWebContentsView: ElectronWebContentsView.disposeWebContentsView,
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as ElectronWebContents from '../ElectronWebContents/ElectronWebContents.js'
|
|
2
|
+
import * as ParentIpc from '../ParentIpc/ParentIpc.js'
|
|
3
|
+
|
|
4
|
+
export const createWebContentsView = async (ipc, restoreId, fallthroughKeyBindings) => {
|
|
5
|
+
const webContentsId = await ParentIpc.invoke('ElectronWebContentsView.createWebContentsView', restoreId)
|
|
6
|
+
// TODO get window id from renderer worker
|
|
7
|
+
await ParentIpc.invoke('ElectronWebContentsView.attachEventListeners', webContentsId)
|
|
8
|
+
console.log({ webContentsId })
|
|
9
|
+
return webContentsId
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const disposeWebContentsView = async (id) => {
|
|
13
|
+
await ParentIpc.invoke('ElectronWebContentsView.disposeWebContentsView', id)
|
|
14
|
+
await ElectronWebContents.dispose(id)
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as ElectronWebContentsViewFunctions from './ElectronWebContentsViewViewFunctions.js'
|
|
2
|
+
|
|
3
|
+
export const name = 'ElectronWebContentsViewFunctions'
|
|
4
|
+
|
|
5
|
+
export const Commands = {
|
|
6
|
+
resizeBrowserView: ElectronWebContentsViewFunctions.resizeBrowserView,
|
|
7
|
+
setIframeSrc: ElectronWebContentsViewFunctions.setIframeSrc,
|
|
8
|
+
focus: ElectronWebContentsViewFunctions.focus,
|
|
9
|
+
openDevtools: ElectronWebContentsViewFunctions.openDevtools,
|
|
10
|
+
reload: ElectronWebContentsViewFunctions.reload,
|
|
11
|
+
forward: ElectronWebContentsViewFunctions.forward,
|
|
12
|
+
backward: ElectronWebContentsViewFunctions.backward,
|
|
13
|
+
cancelNavigation: ElectronWebContentsViewFunctions.cancelNavigation,
|
|
14
|
+
show: ElectronWebContentsViewFunctions.show,
|
|
15
|
+
hide: ElectronWebContentsViewFunctions.hide,
|
|
16
|
+
inspectElement: ElectronWebContentsViewFunctions.inspectElement,
|
|
17
|
+
copyImageAt: ElectronWebContentsViewFunctions.copyImageAt,
|
|
18
|
+
setFallthroughKeyBindings: ElectronWebContentsViewFunctions.setFallthroughKeyBindings,
|
|
19
|
+
getStats: ElectronWebContentsViewFunctions.getStats,
|
|
20
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as ParentIpc from '../ParentIpc/ParentIpc.js'
|
|
2
|
+
import * as ElectronWebContents from '../ElectronWebContents/ElectronWebContents.js'
|
|
3
|
+
|
|
4
|
+
export const resizeBrowserView = (id, x, y, width, height) => {
|
|
5
|
+
return ParentIpc.invoke('ElectronBrowserViewFunctions.resizeBrowserView', id, x, y, width, height)
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const setIframeSrc = async (id, iframeSrc) => {
|
|
9
|
+
return ParentIpc.invoke('ElectronBrowserViewFunctions.setIframeSrc', id, iframeSrc)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const callFunction = (id, functionName) => {
|
|
13
|
+
return ParentIpc.invoke('ElectronWebContents.callFunction', id, functionName)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const focus = ElectronWebContents.focus
|
|
17
|
+
|
|
18
|
+
export const openDevtools = ElectronWebContents.openDevtools
|
|
19
|
+
|
|
20
|
+
export const reload = ElectronWebContents.reload
|
|
21
|
+
|
|
22
|
+
export const forward = ElectronWebContents.forward
|
|
23
|
+
|
|
24
|
+
export const backward = ElectronWebContents.backward
|
|
25
|
+
|
|
26
|
+
export const cancelNavigation = (id) => {
|
|
27
|
+
return ParentIpc.invoke('ElectronBrowserViewFunctions.cancelNavigation', id)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const show = (id) => {
|
|
31
|
+
return ParentIpc.invoke('ElectronBrowserViewFunctions.show', id)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const hide = (id) => {
|
|
35
|
+
return ParentIpc.invoke('ElectronBrowserViewFunctions.hide', id)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const inspectElement = ElectronWebContents.inspectElement
|
|
39
|
+
|
|
40
|
+
export const copyImageAt = (id, x, y) => {
|
|
41
|
+
return ParentIpc.invoke('ElectronBrowserViewFunctions.copyImageAt', id, x, y)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const setFallthroughKeyBindings = (fallthroughKeyBindings) => {
|
|
45
|
+
return ParentIpc.invoke('ElectronBrowserViewFunctions.setFallthroughKeyBindings', fallthroughKeyBindings)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const getStats = (id) => {
|
|
49
|
+
return ParentIpc.invoke('ElectronWebContents.getStats', id)
|
|
50
|
+
}
|
|
@@ -28,6 +28,7 @@ export const install = async ({ path }) => {
|
|
|
28
28
|
}
|
|
29
29
|
const outDir = Path.join(extensionsPath, id)
|
|
30
30
|
await FileSystem.remove(outDir)
|
|
31
|
+
await FileSystem.mkdir(Path.dirname(outDir))
|
|
31
32
|
await FileSystem.rename(cachedExtensionPath, outDir)
|
|
32
33
|
} catch (error) {
|
|
33
34
|
throw new VError(error, `Failed to install ${path}`)
|
|
@@ -142,6 +142,8 @@ export const load = (moduleId) => {
|
|
|
142
142
|
return import('../HandleMessagePortForExtensionHostHelperProcess/HandleMessagePortForExtensionHostHelperProcess.ipc.js')
|
|
143
143
|
case ModuleId.ElectronWebContents:
|
|
144
144
|
return import('../ElectronWebContents/ElectronWebContents.ipc.js')
|
|
145
|
+
case ModuleId.ElectronWebContentsView:
|
|
146
|
+
return import('../ElectronWebContentsView/ElectronWebContentsView.ipc.js')
|
|
145
147
|
default:
|
|
146
148
|
throw new Error(`module ${moduleId} not found`)
|
|
147
149
|
}
|
|
@@ -70,3 +70,5 @@ export const GetElectronFileResponse = 63
|
|
|
70
70
|
export const HandleRemoteRequest = 64
|
|
71
71
|
export const HandleMessagePortForExtensionHostHelperProcess = 65
|
|
72
72
|
export const ElectronWebContents = 66
|
|
73
|
+
export const ElectronWebContentsView = 67
|
|
74
|
+
export const ElectronWebContentsViewFunctions = 68
|
|
@@ -151,6 +151,20 @@ export const getModuleId = (commandId) => {
|
|
|
151
151
|
case 'ElectronBrowserViewFunctions.setFallthroughKeyBindings':
|
|
152
152
|
case 'ElectronBrowserViewFunctions.getStats':
|
|
153
153
|
return ModuleId.ElectronBrowserViewFunctions
|
|
154
|
+
case 'ElectronWebContentsViewFunctions.resizeBrowserView':
|
|
155
|
+
case 'ElectronWebContentsViewFunctions.setIframeSrc':
|
|
156
|
+
case 'ElectronWebContentsViewFunctions.focus':
|
|
157
|
+
case 'ElectronWebContentsViewFunctions.openDevtools':
|
|
158
|
+
case 'ElectronWebContentsViewFunctions.reload':
|
|
159
|
+
case 'ElectronWebContentsViewFunctions.forward':
|
|
160
|
+
case 'ElectronWebContentsViewFunctions.backward':
|
|
161
|
+
case 'ElectronWebContentsViewFunctions.cancelNavigation':
|
|
162
|
+
case 'ElectronWebContentsViewFunctions.hide':
|
|
163
|
+
case 'ElectronWebContentsViewFunctions.inspectElement':
|
|
164
|
+
case 'ElectronWebContentsViewFunctions.copyImageAt':
|
|
165
|
+
case 'ElectronWebContentsViewFunctions.setFallthroughKeyBindings':
|
|
166
|
+
case 'ElectronWebContentsViewFunctions.getStats':
|
|
167
|
+
return ModuleId.ElectronWebContentsViewFunctions
|
|
154
168
|
case 'FileSystem.chmod':
|
|
155
169
|
case 'FileSystem.copy':
|
|
156
170
|
case 'FileSystem.createFile':
|
|
@@ -304,6 +318,9 @@ export const getModuleId = (commandId) => {
|
|
|
304
318
|
case 'ElectronWebContents.handleContextMenu':
|
|
305
319
|
case 'ElectronWebContents.handlePageTitleUpdated':
|
|
306
320
|
return ModuleId.ElectronWebContents
|
|
321
|
+
case 'ElectronWebContentsView.createWebContentsView':
|
|
322
|
+
case 'ElectronWebContentsView.disposeWebContentsView':
|
|
323
|
+
return ModuleId.ElectronWebContentsView
|
|
307
324
|
default:
|
|
308
325
|
throw new CommandNotFoundError(commandId)
|
|
309
326
|
}
|
|
@@ -39,6 +39,15 @@ export const parseUrlGithub = (input) => {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
+
|
|
43
|
+
if (input.includes('/releases/download')) {
|
|
44
|
+
return {
|
|
45
|
+
type: ExtensionInstallType.Url,
|
|
46
|
+
options: {
|
|
47
|
+
url: input,
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
}
|
|
42
51
|
return {
|
|
43
52
|
type: ExtensionInstallType.ParsingError,
|
|
44
53
|
options: {
|
|
@@ -61,11 +61,11 @@ export const getSetupName = () => {
|
|
|
61
61
|
return 'Lvce-Setup'
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export const version = '0.23.
|
|
64
|
+
export const version = '0.23.3'
|
|
65
65
|
|
|
66
|
-
export const commit = '
|
|
66
|
+
export const commit = '75d963e'
|
|
67
67
|
|
|
68
|
-
export const date = '2024-02-
|
|
68
|
+
export const date = '2024-02-22T17:44:04.000Z'
|
|
69
69
|
|
|
70
70
|
export const getVersion = () => {
|
|
71
71
|
return version
|