@lvce-editor/embeds-process 1.2.0 → 1.3.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
CHANGED
|
@@ -15,6 +15,8 @@ export const commandMap = {
|
|
|
15
15
|
'ElectronWebContentsView.resizeBrowserView': ElectronWebContentsView.resizeWebContentsView,
|
|
16
16
|
'ElectronWebContentsView.setIframeSrc': ElectronWebContentsView.setIframeSrc,
|
|
17
17
|
'ElectronWebContentsView.setIframeSrcFallback': ElectronWebContentsView.setIframeSrcFallback,
|
|
18
|
+
'ElectronWebContentsView.setFallthroughKeyBindings': ElectronWebContentsView.setFallthroughKeyBindings,
|
|
19
|
+
'ElectronWebContentsView.handleKeyBinding': ElectronWebContentsView.handleKeyBinding,
|
|
18
20
|
'ElectronWebContentsView.show': ElectronWebContentsView.show,
|
|
19
21
|
'ElectronWebContents.handleDidNavigate': ElectronWebContentsView.handleDidNavigate,
|
|
20
22
|
'ElectronWebContents.handleTitleUpdated': ElectronWebContentsView.handleTitleUpdated,
|
|
@@ -4,27 +4,13 @@ import * as ElectronWebContentsViewIpcState from '../ElectronWebContentsViewIpcS
|
|
|
4
4
|
import * as JsonRpc from '../JsonRpc/JsonRpc.js'
|
|
5
5
|
import * as ParentIpc from '../ParentIpc/ParentIpc.js'
|
|
6
6
|
|
|
7
|
-
export const createWebContentsView = async (
|
|
8
|
-
ipc,
|
|
9
|
-
restoreId,
|
|
10
|
-
fallthroughKeyBindings,
|
|
11
|
-
) => {
|
|
7
|
+
export const createWebContentsView = async (ipc, restoreId, fallthroughKeyBindings) => {
|
|
12
8
|
Assert.number(restoreId)
|
|
13
|
-
const webContentsId = await ParentIpc.invoke(
|
|
14
|
-
'ElectronWebContentsView.createWebContentsView',
|
|
15
|
-
restoreId,
|
|
16
|
-
)
|
|
9
|
+
const webContentsId = await ParentIpc.invoke('ElectronWebContentsView.createWebContentsView', restoreId)
|
|
17
10
|
ElectronWebContentsViewIpcState.add(webContentsId, ipc)
|
|
18
11
|
// TODO get window id from renderer worker
|
|
19
|
-
await ParentIpc.invoke(
|
|
20
|
-
|
|
21
|
-
webContentsId,
|
|
22
|
-
)
|
|
23
|
-
await ParentIpc.invoke(
|
|
24
|
-
'ElectronWebContentsViewFunctions.setBackgroundColor',
|
|
25
|
-
webContentsId,
|
|
26
|
-
'white',
|
|
27
|
-
)
|
|
12
|
+
await ParentIpc.invoke('ElectronWebContentsView.attachEventListeners', webContentsId)
|
|
13
|
+
await ParentIpc.invoke('ElectronWebContentsViewFunctions.setBackgroundColor', webContentsId, 'white')
|
|
28
14
|
return webContentsId
|
|
29
15
|
}
|
|
30
16
|
|
|
@@ -34,35 +20,23 @@ export const disposeWebContentsView = async (id) => {
|
|
|
34
20
|
}
|
|
35
21
|
|
|
36
22
|
export const resizeWebContentsView = async (id, ...args) => {
|
|
37
|
-
return ParentIpc.invoke(
|
|
38
|
-
'ElectronWebContentsViewFunctions.resizeBrowserView',
|
|
39
|
-
id,
|
|
40
|
-
...args,
|
|
41
|
-
)
|
|
23
|
+
return ParentIpc.invoke('ElectronWebContentsViewFunctions.resizeBrowserView', id, ...args)
|
|
42
24
|
}
|
|
43
25
|
|
|
44
26
|
export const setIframeSrc = async (id, ...args) => {
|
|
45
|
-
return ParentIpc.invoke(
|
|
46
|
-
'ElectronWebContentsViewFunctions.setIframeSrc',
|
|
47
|
-
id,
|
|
48
|
-
...args,
|
|
49
|
-
)
|
|
27
|
+
return ParentIpc.invoke('ElectronWebContentsViewFunctions.setIframeSrc', id, ...args)
|
|
50
28
|
}
|
|
51
29
|
|
|
52
30
|
export const setIframeSrcFallback = async (id, ...args) => {
|
|
53
|
-
return ParentIpc.invoke(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
)
|
|
31
|
+
return ParentIpc.invoke('ElectronWebContentsViewFunctions.setIframeSrcFallback', id, ...args)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const setFallthroughKeyBindings = async (id, ...args) => {
|
|
35
|
+
return ParentIpc.invoke('ElectronWebContentsViewFunctions.setFallthroughKeyBindings', id, ...args)
|
|
58
36
|
}
|
|
59
37
|
|
|
60
38
|
export const getStats = async (id, ...args) => {
|
|
61
|
-
return ParentIpc.invoke(
|
|
62
|
-
'ElectronWebContentsViewFunctions.getStats',
|
|
63
|
-
id,
|
|
64
|
-
...args,
|
|
65
|
-
)
|
|
39
|
+
return ParentIpc.invoke('ElectronWebContentsViewFunctions.getStats', id, ...args)
|
|
66
40
|
}
|
|
67
41
|
|
|
68
42
|
export const show = async (id, ...args) => {
|
|
@@ -79,21 +53,15 @@ const forwardIpcEvent =
|
|
|
79
53
|
JsonRpc.send(ipc, key, id, ...args)
|
|
80
54
|
}
|
|
81
55
|
|
|
82
|
-
export const handleDidNavigate = forwardIpcEvent(
|
|
83
|
-
|
|
84
|
-
)
|
|
56
|
+
export const handleDidNavigate = forwardIpcEvent('ElectronWebContentsView.handleDidNavigate')
|
|
57
|
+
|
|
58
|
+
export const handleTitleUpdated = forwardIpcEvent('ElectronWebContentsView.handleTitleUpdated')
|
|
85
59
|
|
|
86
|
-
export const
|
|
87
|
-
'ElectronWebContentsView.handleTitleUpdated',
|
|
88
|
-
)
|
|
60
|
+
export const handleWillNavigate = forwardIpcEvent('ElectronWebContentsView.handleWillNavigate')
|
|
89
61
|
|
|
90
|
-
export const
|
|
91
|
-
'ElectronWebContentsView.handleWillNavigate',
|
|
92
|
-
)
|
|
62
|
+
export const handleContextMenu = forwardIpcEvent('ElectronWebContentsView.handleContextMenu')
|
|
93
63
|
|
|
94
|
-
export const
|
|
95
|
-
'ElectronWebContentsView.handleContextMenu',
|
|
96
|
-
)
|
|
64
|
+
export const handleKeyBinding = forwardIpcEvent('ElectronWebContentsView.handleKeyBinding')
|
|
97
65
|
|
|
98
66
|
export const handleBrowserViewDestroyed = (id, ...args) => {
|
|
99
67
|
// TODO send to embeds worker?
|