@lvce-editor/extension-host-worker 3.3.0 → 3.5.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.
@@ -3153,7 +3153,8 @@ const createWebView3 = async ({
3153
3153
  isGitpod,
3154
3154
  platform,
3155
3155
  assetDir,
3156
- webViewScheme
3156
+ webViewScheme,
3157
+ useNewWebViewHandler
3157
3158
  }) => {
3158
3159
  await invoke('WebView.create3', {
3159
3160
  id,
@@ -3161,7 +3162,26 @@ const createWebView3 = async ({
3161
3162
  isGitpod,
3162
3163
  platform,
3163
3164
  assetDir,
3164
- webViewScheme
3165
+ webViewScheme,
3166
+ useNewWebViewHandler
3167
+ });
3168
+ };
3169
+
3170
+ const createWebViewWorkerRpc = async (rpcInfo, port) => {
3171
+ // TODO this function is called from the iframe worker to create a direct
3172
+ // connection between a webview/iframe and it's webworker. For this to work
3173
+ // the iframe worker creates a messagechannel and sends one messageport to the webview
3174
+ // and the other messageport to the webworker. This enables direct communication via
3175
+ // the two message ports
3176
+
3177
+ // TODO have a way so that the worker already includes the webview api and the extension
3178
+ // host subworker doesn't need to import the other file
3179
+ await invokeAndTransfer$1('IpcParent.create', {
3180
+ method: ModuleWorkerAndWorkaroundForChromeDevtoolsBug,
3181
+ url: extensionHostSubWorkerUrl,
3182
+ name: rpcInfo.name,
3183
+ raw: true,
3184
+ port
3165
3185
  });
3166
3186
  };
3167
3187
 
@@ -3704,6 +3724,14 @@ const registerChangeListener = () => {
3704
3724
  // TODO
3705
3725
  };
3706
3726
 
3727
+ const getRpcInfo = rpcId => {
3728
+ const info = get$3(rpcId);
3729
+ if (!info) {
3730
+ throw new Error(`Rpc not found ${rpcId}`);
3731
+ }
3732
+ return info;
3733
+ };
3734
+
3707
3735
  const handleBeforeUnload = () => {
3708
3736
  // TODO save all webviews in localstorage
3709
3737
  // cannot use indexeddb during unload
@@ -4425,7 +4453,6 @@ const textSearch = async (scheme, root, query) => {
4425
4453
  };
4426
4454
 
4427
4455
  const commandMap = {
4428
- 'WebView.create3': createWebView3,
4429
4456
  'ExtensionHost.launchIframeWorker': launchIframeWorker,
4430
4457
  'ExtensionHostRename.executeprepareRenameProvider': executeprepareRenameProvider,
4431
4458
  'ExtensionHostRename.executeRenameProvider': executeRenameProvider,
@@ -4440,6 +4467,9 @@ const commandMap = {
4440
4467
  'SearchFileWithHtml.searchFileWithHtml': searchFile,
4441
4468
  'TextSearchFetch.textSearch': textSearch$1,
4442
4469
  'TextSearchHtml.textSearch': textSearch,
4470
+ 'WebView.create3': createWebView3,
4471
+ 'WebView.createWebViewWorkerRpc': createWebViewWorkerRpc,
4472
+ 'WebView.getRpcInfo': getRpcInfo,
4443
4473
  ['ExtensionHostDebug.evaluate']: evaluate,
4444
4474
  ['ExtensionHostDebug.getProperties']: getProperties,
4445
4475
  ['ExtensionHostDebug.listProcesses']: listProcesses,
@@ -4453,8 +4483,8 @@ const commandMap = {
4453
4483
  ['ExtensionHostDebug.stepOver']: stepOver,
4454
4484
  ['ExtensionHostWebView.create']: createWebView,
4455
4485
  ['ExtensionHostWebView.dispose']: disposeWebView,
4456
- ['ExtensionHostWebView.load']: loadWebView,
4457
4486
  ['ExtensionHostWebView.getWebViewInfo']: getWebViewInfo,
4487
+ ['ExtensionHostWebView.load']: loadWebView,
4458
4488
  ['HandleBeforeUnload.handleBeforeUnload']: handleBeforeUnload,
4459
4489
  ['HandleMessagePort.handleMessagePort']: handleMessagePort,
4460
4490
  ['SaveState.saveState']: saveState,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-host-worker",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "description": "Webworker for the extension host functionality in Lvce Editor.",
5
5
  "main": "dist/extensionHostWorkerMain.js",
6
6
  "type": "module",