@lvce-editor/extension-host-worker 4.16.0 → 5.0.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.
@@ -755,8 +755,6 @@ const setConfigurations = preferences => {
755
755
  state$b.configuration = preferences;
756
756
  };
757
757
 
758
- const RendererWorker = 1;
759
-
760
758
  const rpcs$2 = Object.create(null);
761
759
  const set$9 = (id, rpc) => {
762
760
  rpcs$2[id] = rpc;
@@ -765,17 +763,13 @@ const get$a = id => {
765
763
  return rpcs$2[id];
766
764
  };
767
765
 
768
- const invoke$2 = (method, ...params) => {
769
- const rpc = get$a(RendererWorker);
770
- return rpc.invoke(method, ...params);
771
- };
772
- const send$1 = (method, ...params) => {
773
- const rpc = get$a(RendererWorker);
774
- return rpc.send(method, ...params);
775
- };
776
- const invokeAndTransfer$2 = (method, ...params) => {
777
- const rpc = get$a(RendererWorker);
778
- return rpc.invokeAndTransfer(method, ...params);
766
+ const RendererWorker = 1;
767
+ const DebugWorker = 55;
768
+
769
+ // TODO use invoke
770
+ const send$1 = async (method, ...params) => {
771
+ const rpc = get$a(DebugWorker);
772
+ rpc.send(method, ...params);
779
773
  };
780
774
 
781
775
  const state$a = {
@@ -798,7 +792,6 @@ const registerDebugProvider = debugProvider => {
798
792
  const start = async (protocol, path) => {
799
793
  try {
800
794
  const handlePaused = params => {
801
- console.log('send paused', params);
802
795
  send$1('Debug.paused', params);
803
796
  };
804
797
  const handleResumed = () => {
@@ -934,6 +927,15 @@ const {
934
927
  }
935
928
  });
936
929
 
930
+ const invoke$2 = (method, ...params) => {
931
+ const rpc = get$a(RendererWorker);
932
+ return rpc.invoke(method, ...params);
933
+ };
934
+ const invokeAndTransfer$2 = (method, ...params) => {
935
+ const rpc = get$a(RendererWorker);
936
+ return rpc.invokeAndTransfer(method, ...params);
937
+ };
938
+
937
939
  const showInformationMessage = message => {
938
940
  string(message);
939
941
  const result = invoke$2('ExtensionHostDialog.showInformationMessage', message);
@@ -2508,6 +2510,7 @@ const createRpc = ({
2508
2510
  }) => {
2509
2511
  try {
2510
2512
  if (execute && !commandMap) {
2513
+ // eslint-disable-next-line no-console
2511
2514
  console.info(`[extension-host-worker] The rpc execute function is deprecated. Use the commandMap property instead.`);
2512
2515
  }
2513
2516
  commandMap ||= {};
@@ -3118,7 +3121,8 @@ const getWebExtensionManifest = async (path, manifestPath) => {
3118
3121
  const manifest = await getJson(manifestPath);
3119
3122
  return {
3120
3123
  ...manifest,
3121
- path
3124
+ path,
3125
+ uri: path
3122
3126
  };
3123
3127
  } catch (error) {
3124
3128
  const id = interExtensionId(path);
@@ -3141,6 +3145,7 @@ const addWebExtension = async path => {
3141
3145
  };
3142
3146
 
3143
3147
  const applyBulkReplacement = async (files, ranges, replacement) => {
3148
+ // eslint-disable-next-line no-console
3144
3149
  console.log({
3145
3150
  files,
3146
3151
  ranges,
@@ -4923,14 +4928,17 @@ const getWebViews = async () => {
4923
4928
  const handleBeforeUnload = () => {
4924
4929
  // TODO save all webviews in localstorage
4925
4930
  // cannot use indexeddb during unload
4926
- console.log('before unload');
4931
+ // console.log('before unload')
4927
4932
  };
4928
4933
 
4929
- const handleMessagePort = async port => {
4930
- await MessagePortRpcClient.create({
4934
+ const handleMessagePort = async (port, rpcId) => {
4935
+ const rpc = await MessagePortRpcClient.create({
4931
4936
  messagePort: port,
4932
4937
  commandMap: {}
4933
4938
  });
4939
+ if (rpcId) {
4940
+ set$9(rpcId, rpc);
4941
+ }
4934
4942
  };
4935
4943
 
4936
4944
  const handleIconThemeChange = async () => {
@@ -5040,9 +5048,6 @@ const getValues = async storeId => {
5040
5048
  const db = await getDbMemoized();
5041
5049
  const tx = db.transaction(storeId, 'readwrite');
5042
5050
  const [objects] = await Promise.all([tx.store.getAll(), tx.done]);
5043
- console.log({
5044
- objects
5045
- });
5046
5051
  return objects;
5047
5052
  } catch (error) {
5048
5053
  throw new VError(error, 'Failed to get values from indexed db');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-host-worker",
3
- "version": "4.16.0",
3
+ "version": "5.0.0",
4
4
  "description": "Webworker for the extension host functionality in Lvce Editor.",
5
5
  "keywords": [
6
6
  "web-worker"