@lvce-editor/shared-process 0.24.1 → 0.24.2

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/shared-process",
3
- "version": "0.24.1",
3
+ "version": "0.24.2",
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.24.1",
21
+ "@lvce-editor/extension-host-helper-process": "0.24.2",
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.1",
25
25
  "@lvce-editor/pretty-error": "^1.5.0",
26
- "@lvce-editor/pty-host": "0.24.1",
26
+ "@lvce-editor/pty-host": "0.24.2",
27
27
  "@lvce-editor/verror": "^1.1.2",
28
28
  "@lvce-editor/web-socket-server": "^1.1.0",
29
29
  "debug": "^4.3.4",
@@ -38,7 +38,7 @@
38
38
  "optionalDependencies": {
39
39
  "@lvce-editor/ripgrep": "^1.0.2",
40
40
  "extract-zip": "^2.0.1",
41
- "open": "^10.0.3",
41
+ "open": "^10.0.4",
42
42
  "tail": "^2.2.6",
43
43
  "tmp-promise": "^3.0.3",
44
44
  "trash": "^8.1.1"
@@ -1,4 +1,4 @@
1
- const state = {
1
+ export const state = {
2
2
  ipcMap: Object.create(null),
3
3
  }
4
4
 
@@ -41,7 +41,7 @@ export const handleWindowOpen = (webContentsId, url) => {
41
41
  const forwardEvent = (method, webContentsId, ...params) => {
42
42
  const ipc = ElectronBrowserViewIpcState.get(webContentsId)
43
43
  if (!ipc) {
44
- console.log('no ipc', { webContentsId })
44
+ console.log(`[shared-process] no ipc for webcontents ${webContentsId}`)
45
45
  return
46
46
  }
47
47
  ipc.send({
@@ -67,6 +67,10 @@ export const handleTitleUpdated = (...args) => {
67
67
  return forwardEvent('handleTitleUpdated', ...args)
68
68
  }
69
69
 
70
+ export const handleKeyBinding = (...args) => {
71
+ forwardEvent('handleKeyBinding', ...args)
72
+ }
73
+
70
74
  export const handleBrowserViewDestroyed = (id) => {
71
75
  ElectronBrowserViewState.remove(id)
72
76
  ElectronBrowserViewIpcState.remove(id)
@@ -1,8 +1,11 @@
1
1
  import * as ElectronBrowserViewIpcState from '../ElectronBrowserViewIpcState/ElectronBrowserViewIpcState.js'
2
2
  import * as ElectronWebContents from '../ElectronWebContents/ElectronWebContents.js'
3
3
  import * as ParentIpc from '../ParentIpc/ParentIpc.js'
4
+ import * as Assert from '../Assert/Assert.js'
4
5
 
5
6
  export const createWebContentsView = async (ipc, restoreId, fallthroughKeyBindings) => {
7
+ Assert.object(ipc)
8
+ Assert.number(restoreId)
6
9
  const webContentsId = await ParentIpc.invoke('ElectronWebContentsView.createWebContentsView', restoreId)
7
10
  ElectronBrowserViewIpcState.add(webContentsId, ipc)
8
11
  // TODO get window id from renderer worker
@@ -61,11 +61,11 @@ export const getSetupName = () => {
61
61
  return 'Lvce-Setup'
62
62
  }
63
63
 
64
- export const version = '0.24.1'
64
+ export const version = '0.24.2'
65
65
 
66
- export const commit = 'fa2b07a'
66
+ export const commit = '2e025bb'
67
67
 
68
- export const date = '2024-02-24T13:53:58.000Z'
68
+ export const date = '2024-02-27T21:45:27.000Z'
69
69
 
70
70
  export const getVersion = () => {
71
71
  return version
@@ -12,6 +12,7 @@ const METHODS_THAT_REQUIRE_SOCKET = new Set([
12
12
  'GetWindowId.getWindowId',
13
13
  'HandleMessagePortForExtensionHostHelperProcess.handleMessagePortForExtensionHostHelperProcess',
14
14
  'ElectronBrowserView.createBrowserView',
15
+ 'ElectronWebContentsView.createWebContentsView',
15
16
  ])
16
17
 
17
18
  export const requiresSocket = (method) => {