@lvce-editor/renderer-process 9.6.0 → 9.8.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.
@@ -720,14 +720,16 @@ const unwrapJsonRpcResult = responseMessage => {
720
720
  }
721
721
  throw new JsonRpcError('unexpected response message');
722
722
  };
723
- const create$1$1 = (message, error) => {
724
- return {
725
- jsonrpc: Two,
726
- id: message.id,
727
- error
728
- };
729
- };
730
723
  const E_COMMAND_NOT_FOUND = 'E_COMMAND_NOT_FOUND';
724
+ const getType$2 = prettyError => {
725
+ if (prettyError && prettyError.type) {
726
+ return prettyError.type;
727
+ }
728
+ if (prettyError && prettyError.constructor && prettyError.constructor.name) {
729
+ return prettyError.constructor.name;
730
+ }
731
+ return undefined;
732
+ };
731
733
  const getErrorProperty = (error, prettyError) => {
732
734
  if (error && error.code === E_COMMAND_NOT_FOUND) {
733
735
  return {
@@ -742,11 +744,19 @@ const getErrorProperty = (error, prettyError) => {
742
744
  data: {
743
745
  stack: prettyError.stack,
744
746
  codeFrame: prettyError.codeFrame,
745
- type: prettyError.type,
746
- code: prettyError.code
747
+ type: getType$2(prettyError),
748
+ code: prettyError.code,
749
+ name: prettyError.name
747
750
  }
748
751
  };
749
752
  };
753
+ const create$1$1 = (message, error) => {
754
+ return {
755
+ jsonrpc: Two,
756
+ id: message.id,
757
+ error
758
+ };
759
+ };
750
760
  const getErrorResponse = (message, error, preparePrettyError, logError) => {
751
761
  const prettyError = preparePrettyError(error);
752
762
  logError(error, prettyError);
@@ -907,24 +917,7 @@ const getModule$1 = method => {
907
917
  }
908
918
  };
909
919
 
910
- const hasFlag = key => {
911
- if (typeof location === 'undefined' || typeof document === 'undefined') {
912
- return false;
913
- }
914
- const configElement = document.getElementById('Config');
915
- if (!configElement) {
916
- return false;
917
- }
918
- const text = configElement.textContent;
919
- if (!text) {
920
- return false;
921
- }
922
- const config = JSON.parse(text);
923
- const result = config[key];
924
- return result;
925
- };
926
-
927
- const shouldLaunchMultipleWorkers = hasFlag('prelaunchWorkers');
920
+ const shouldLaunchMultipleWorkers = true;
928
921
 
929
922
  const ipcs = Object.create(null);
930
923
  const set$6 = (name, ipc) => {
@@ -944,7 +937,7 @@ const create$L = async ({
944
937
  method,
945
938
  ...options
946
939
  }) => {
947
- if (shouldLaunchMultipleWorkers && options.name && has(options.name)) {
940
+ if (options.name && has(options.name)) {
948
941
  if (!options.id) {
949
942
  throw new Error('id is required');
950
943
  }
@@ -1571,10 +1564,9 @@ const hydrate$1 = async () => {
1571
1564
  };
1572
1565
 
1573
1566
  const launchWorkers = () => {
1574
- if (shouldLaunchMultipleWorkers) {
1567
+ {
1575
1568
  return Promise.all([hydrate$4(), hydrate$3(), hydrate$1(), hydrate$2()]);
1576
1569
  }
1577
- return hydrate$4();
1578
1570
  };
1579
1571
 
1580
1572
  const Alert = 'alert';
@@ -5754,9 +5746,7 @@ const setIframeCsp = ($Iframe, csp) => {
5754
5746
  };
5755
5747
 
5756
5748
  const setIframeSandBox = ($Iframe, sandbox) => {
5757
- for (const element of sandbox) {
5758
- $Iframe.sandbox.add(element);
5759
- }
5749
+ $Iframe.sandbox.add(...sandbox);
5760
5750
  };
5761
5751
 
5762
5752
  const setIframeSrc = ($Iframe, src, srcDoc = '') => {
@@ -5818,7 +5808,7 @@ const load = async uid => {
5818
5808
  };
5819
5809
 
5820
5810
  // TODO rename to sendMessage
5821
- const setPort$2 = (uid, port, origin) => {
5811
+ const setPort$2 = (uid, port, origin, portType) => {
5822
5812
  const $Iframe = get(uid);
5823
5813
  // TODO use jsonrpc invoke
5824
5814
  const {
@@ -5830,7 +5820,7 @@ const setPort$2 = (uid, port, origin) => {
5830
5820
  contentWindow.postMessage({
5831
5821
  jsonrpc: '2.0',
5832
5822
  method: 'setPort',
5833
- params: [port]
5823
+ params: [port, portType]
5834
5824
  }, origin, [port]);
5835
5825
  };
5836
5826
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "9.6.0",
3
+ "version": "9.8.0",
4
4
  "description": "",
5
5
  "main": "dist/diffWorkerMain.js",
6
6
  "type": "module",