@lvce-editor/renderer-process 9.6.0 → 9.7.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);
@@ -5754,9 +5764,7 @@ const setIframeCsp = ($Iframe, csp) => {
5754
5764
  };
5755
5765
 
5756
5766
  const setIframeSandBox = ($Iframe, sandbox) => {
5757
- for (const element of sandbox) {
5758
- $Iframe.sandbox.add(element);
5759
- }
5767
+ $Iframe.sandbox.add(...sandbox);
5760
5768
  };
5761
5769
 
5762
5770
  const setIframeSrc = ($Iframe, src, srcDoc = '') => {
@@ -5818,7 +5826,7 @@ const load = async uid => {
5818
5826
  };
5819
5827
 
5820
5828
  // TODO rename to sendMessage
5821
- const setPort$2 = (uid, port, origin) => {
5829
+ const setPort$2 = (uid, port, origin, portType) => {
5822
5830
  const $Iframe = get(uid);
5823
5831
  // TODO use jsonrpc invoke
5824
5832
  const {
@@ -5830,7 +5838,7 @@ const setPort$2 = (uid, port, origin) => {
5830
5838
  contentWindow.postMessage({
5831
5839
  jsonrpc: '2.0',
5832
5840
  method: 'setPort',
5833
- params: [port]
5841
+ params: [port, portType]
5834
5842
  }, origin, [port]);
5835
5843
  };
5836
5844
 
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.7.0",
4
4
  "description": "",
5
5
  "main": "dist/diffWorkerMain.js",
6
6
  "type": "module",