@lvce-editor/iframe-worker 5.32.0 → 5.33.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.
- package/dist/iframeWorkerMain.js +16 -22
- package/package.json +1 -1
package/dist/iframeWorkerMain.js
CHANGED
|
@@ -303,22 +303,11 @@ class IpcChildWithModuleWorker extends Ipc {
|
|
|
303
303
|
const wrap$f = global => {
|
|
304
304
|
return new IpcChildWithModuleWorker(global);
|
|
305
305
|
};
|
|
306
|
-
const withResolvers = () => {
|
|
307
|
-
let _resolve;
|
|
308
|
-
const promise = new Promise(resolve => {
|
|
309
|
-
_resolve = resolve;
|
|
310
|
-
});
|
|
311
|
-
return {
|
|
312
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
313
|
-
resolve: _resolve,
|
|
314
|
-
promise
|
|
315
|
-
};
|
|
316
|
-
};
|
|
317
306
|
const waitForFirstMessage = async port => {
|
|
318
307
|
const {
|
|
319
308
|
resolve,
|
|
320
309
|
promise
|
|
321
|
-
} = withResolvers();
|
|
310
|
+
} = Promise.withResolvers();
|
|
322
311
|
port.addEventListener('message', resolve, {
|
|
323
312
|
once: true
|
|
324
313
|
});
|
|
@@ -397,7 +386,7 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
397
386
|
const {
|
|
398
387
|
resolve,
|
|
399
388
|
promise
|
|
400
|
-
} = withResolvers();
|
|
389
|
+
} = Promise.withResolvers();
|
|
401
390
|
const listenerMap = Object.create(null);
|
|
402
391
|
const cleanup = value => {
|
|
403
392
|
for (const event of Object.keys(eventMap)) {
|
|
@@ -508,7 +497,7 @@ const registerPromise = () => {
|
|
|
508
497
|
promise
|
|
509
498
|
};
|
|
510
499
|
};
|
|
511
|
-
const create$2
|
|
500
|
+
const create$2 = (method, params) => {
|
|
512
501
|
const {
|
|
513
502
|
id,
|
|
514
503
|
promise
|
|
@@ -698,7 +687,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
698
687
|
}
|
|
699
688
|
};
|
|
700
689
|
};
|
|
701
|
-
const create$1$
|
|
690
|
+
const create$1$2 = (message, error) => {
|
|
702
691
|
return {
|
|
703
692
|
jsonrpc: Two,
|
|
704
693
|
id: message.id,
|
|
@@ -709,7 +698,7 @@ const getErrorResponse = (message, error, preparePrettyError, logError) => {
|
|
|
709
698
|
const prettyError = preparePrettyError(error);
|
|
710
699
|
logError(error, prettyError);
|
|
711
700
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
712
|
-
return create$1$
|
|
701
|
+
return create$1$2(message, errorProperty);
|
|
713
702
|
};
|
|
714
703
|
const create$5 = (message, result) => {
|
|
715
704
|
return {
|
|
@@ -800,7 +789,7 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
800
789
|
const {
|
|
801
790
|
message,
|
|
802
791
|
promise
|
|
803
|
-
} = create$2
|
|
792
|
+
} = create$2(method, params);
|
|
804
793
|
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
805
794
|
ipc.sendAndTransfer(message);
|
|
806
795
|
} else {
|
|
@@ -887,7 +876,7 @@ const listen$1 = async (module, options) => {
|
|
|
887
876
|
const ipc = module.wrap(rawIpc);
|
|
888
877
|
return ipc;
|
|
889
878
|
};
|
|
890
|
-
const create$
|
|
879
|
+
const create$a = async ({
|
|
891
880
|
commandMap,
|
|
892
881
|
messagePort,
|
|
893
882
|
isMessagePortOpen
|
|
@@ -905,9 +894,9 @@ const create$8 = async ({
|
|
|
905
894
|
};
|
|
906
895
|
const MessagePortRpcParent = {
|
|
907
896
|
__proto__: null,
|
|
908
|
-
create: create$
|
|
897
|
+
create: create$a
|
|
909
898
|
};
|
|
910
|
-
const create$
|
|
899
|
+
const create$1$1 = async ({
|
|
911
900
|
commandMap
|
|
912
901
|
}) => {
|
|
913
902
|
// TODO create a commandMap per rpc instance
|
|
@@ -919,7 +908,7 @@ const create$2 = async ({
|
|
|
919
908
|
};
|
|
920
909
|
const WebWorkerRpcClient = {
|
|
921
910
|
__proto__: null,
|
|
922
|
-
create: create$
|
|
911
|
+
create: create$1$1
|
|
923
912
|
};
|
|
924
913
|
|
|
925
914
|
const RendererWorker = 1;
|
|
@@ -1854,6 +1843,10 @@ const create3 = async ({
|
|
|
1854
1843
|
};
|
|
1855
1844
|
};
|
|
1856
1845
|
|
|
1846
|
+
const executeCommand = (method, ...params) => {
|
|
1847
|
+
return invoke$4('ExecuteExternalCommand.executeExternalCommand', method, ...params);
|
|
1848
|
+
};
|
|
1849
|
+
|
|
1857
1850
|
const getSecret = async key => {
|
|
1858
1851
|
return invoke('WebView.getSecret', key);
|
|
1859
1852
|
};
|
|
@@ -1904,7 +1897,8 @@ const commandMap = {
|
|
|
1904
1897
|
'WebView.getSecret': getSecret,
|
|
1905
1898
|
'WebView.getWebViewInfo': getWebViewInfo,
|
|
1906
1899
|
'WebView.registerInterceptor': registerInterceptor,
|
|
1907
|
-
'WebView.unregisterInterceptor': unregisterInterceptor
|
|
1900
|
+
'WebView.unregisterInterceptor': unregisterInterceptor,
|
|
1901
|
+
'WebView.executeExternalCommand': executeCommand
|
|
1908
1902
|
};
|
|
1909
1903
|
|
|
1910
1904
|
const listen = async () => {
|