@lvce-editor/embeds-process 1.0.0 → 1.2.0

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