@lvce-editor/iframe-worker 6.2.0 → 6.4.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 +369 -569
- package/package.json +1 -1
package/dist/iframeWorkerMain.js
CHANGED
|
@@ -61,7 +61,7 @@ class AssertionError extends Error {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
const Object$1 = 1;
|
|
64
|
-
const Number = 2;
|
|
64
|
+
const Number$1 = 2;
|
|
65
65
|
const Array$1 = 3;
|
|
66
66
|
const String = 4;
|
|
67
67
|
const Boolean = 5;
|
|
@@ -71,7 +71,7 @@ const Unknown = 8;
|
|
|
71
71
|
const getType = value => {
|
|
72
72
|
switch (typeof value) {
|
|
73
73
|
case 'number':
|
|
74
|
-
return Number;
|
|
74
|
+
return Number$1;
|
|
75
75
|
case 'function':
|
|
76
76
|
return Function;
|
|
77
77
|
case 'string':
|
|
@@ -96,12 +96,6 @@ const object = value => {
|
|
|
96
96
|
throw new AssertionError('expected value to be of type object');
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
const number = value => {
|
|
100
|
-
const type = getType(value);
|
|
101
|
-
if (type !== Number) {
|
|
102
|
-
throw new AssertionError('expected value to be of type number');
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
99
|
|
|
106
100
|
const isMessagePort = value => {
|
|
107
101
|
return value && value instanceof MessagePort;
|
|
@@ -231,8 +225,8 @@ const getModuleNotFoundError = stderr => {
|
|
|
231
225
|
const messageIndex = lines.findIndex(isModuleNotFoundMessage);
|
|
232
226
|
const message = lines[messageIndex];
|
|
233
227
|
return {
|
|
234
|
-
|
|
235
|
-
|
|
228
|
+
code: ERR_MODULE_NOT_FOUND,
|
|
229
|
+
message
|
|
236
230
|
};
|
|
237
231
|
};
|
|
238
232
|
const isModuleNotFoundError = stderr => {
|
|
@@ -255,14 +249,14 @@ const isUnhelpfulNativeModuleError = stderr => {
|
|
|
255
249
|
const getNativeModuleErrorMessage = stderr => {
|
|
256
250
|
const message = getMessageCodeBlock(stderr);
|
|
257
251
|
return {
|
|
258
|
-
|
|
259
|
-
|
|
252
|
+
code: E_INCOMPATIBLE_NATIVE_MODULE,
|
|
253
|
+
message: `Incompatible native node module: ${message}`
|
|
260
254
|
};
|
|
261
255
|
};
|
|
262
256
|
const getModuleSyntaxError = () => {
|
|
263
257
|
return {
|
|
264
|
-
|
|
265
|
-
|
|
258
|
+
code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON,
|
|
259
|
+
message: `ES Modules are not supported in electron`
|
|
266
260
|
};
|
|
267
261
|
};
|
|
268
262
|
const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
@@ -281,8 +275,8 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
|
281
275
|
rest
|
|
282
276
|
} = getDetails(lines);
|
|
283
277
|
return {
|
|
284
|
-
message: actualMessage,
|
|
285
278
|
code: '',
|
|
279
|
+
message: actualMessage,
|
|
286
280
|
stack: rest
|
|
287
281
|
};
|
|
288
282
|
};
|
|
@@ -292,8 +286,8 @@ class IpcError extends VError {
|
|
|
292
286
|
if (stdout || stderr) {
|
|
293
287
|
// @ts-ignore
|
|
294
288
|
const {
|
|
295
|
-
message,
|
|
296
289
|
code,
|
|
290
|
+
message,
|
|
297
291
|
stack
|
|
298
292
|
} = getHelpfulChildProcessError(stdout, stderr);
|
|
299
293
|
const cause = new Error(message);
|
|
@@ -354,8 +348,8 @@ const wrap$f = global => {
|
|
|
354
348
|
};
|
|
355
349
|
const waitForFirstMessage = async port => {
|
|
356
350
|
const {
|
|
357
|
-
|
|
358
|
-
|
|
351
|
+
promise,
|
|
352
|
+
resolve
|
|
359
353
|
} = Promise.withResolvers();
|
|
360
354
|
port.addEventListener('message', resolve, {
|
|
361
355
|
once: true
|
|
@@ -375,8 +369,8 @@ const listen$6 = async () => {
|
|
|
375
369
|
const type = firstMessage.params[0];
|
|
376
370
|
if (type === 'message-port') {
|
|
377
371
|
parentIpc.send({
|
|
378
|
-
jsonrpc: '2.0',
|
|
379
372
|
id: firstMessage.id,
|
|
373
|
+
jsonrpc: '2.0',
|
|
380
374
|
result: null
|
|
381
375
|
});
|
|
382
376
|
parentIpc.dispose();
|
|
@@ -433,8 +427,8 @@ const removeListener = (emitter, type, callback) => {
|
|
|
433
427
|
};
|
|
434
428
|
const getFirstEvent = (eventEmitter, eventMap) => {
|
|
435
429
|
const {
|
|
436
|
-
|
|
437
|
-
|
|
430
|
+
promise,
|
|
431
|
+
resolve
|
|
438
432
|
} = Promise.withResolvers();
|
|
439
433
|
const listenerMap = Object.create(null);
|
|
440
434
|
const cleanup = value => {
|
|
@@ -446,8 +440,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
446
440
|
for (const [event, type] of Object.entries(eventMap)) {
|
|
447
441
|
const listener = event => {
|
|
448
442
|
cleanup({
|
|
449
|
-
|
|
450
|
-
|
|
443
|
+
event,
|
|
444
|
+
type
|
|
451
445
|
});
|
|
452
446
|
};
|
|
453
447
|
addListener(eventEmitter, event, listener);
|
|
@@ -457,8 +451,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
457
451
|
};
|
|
458
452
|
const Message$1 = 3;
|
|
459
453
|
const create$5$1 = async ({
|
|
460
|
-
|
|
461
|
-
|
|
454
|
+
isMessagePortOpen,
|
|
455
|
+
messagePort
|
|
462
456
|
}) => {
|
|
463
457
|
if (!isMessagePort(messagePort)) {
|
|
464
458
|
throw new IpcError('port must be of type MessagePort');
|
|
@@ -471,8 +465,8 @@ const create$5$1 = async ({
|
|
|
471
465
|
});
|
|
472
466
|
messagePort.start();
|
|
473
467
|
const {
|
|
474
|
-
|
|
475
|
-
|
|
468
|
+
event,
|
|
469
|
+
type
|
|
476
470
|
} = await eventPromise;
|
|
477
471
|
if (type !== Message$1) {
|
|
478
472
|
throw new IpcError('Failed to wait for ipc message');
|
|
@@ -512,56 +506,14 @@ const IpcParentWithMessagePort$1 = {
|
|
|
512
506
|
wrap: wrap$5
|
|
513
507
|
};
|
|
514
508
|
|
|
515
|
-
const Two = '2.0';
|
|
516
|
-
const create$4$1 = (method, params) => {
|
|
517
|
-
return {
|
|
518
|
-
jsonrpc: Two,
|
|
519
|
-
method,
|
|
520
|
-
params
|
|
521
|
-
};
|
|
522
|
-
};
|
|
509
|
+
const Two$1 = '2.0';
|
|
523
510
|
const callbacks = Object.create(null);
|
|
524
|
-
const
|
|
525
|
-
callbacks[id] = fn;
|
|
526
|
-
};
|
|
527
|
-
const get$2 = id => {
|
|
511
|
+
const get$3 = id => {
|
|
528
512
|
return callbacks[id];
|
|
529
513
|
};
|
|
530
|
-
const remove$
|
|
514
|
+
const remove$2 = id => {
|
|
531
515
|
delete callbacks[id];
|
|
532
516
|
};
|
|
533
|
-
let id = 0;
|
|
534
|
-
const create$3$1 = () => {
|
|
535
|
-
return ++id;
|
|
536
|
-
};
|
|
537
|
-
const registerPromise = () => {
|
|
538
|
-
const id = create$3$1();
|
|
539
|
-
const {
|
|
540
|
-
resolve,
|
|
541
|
-
promise
|
|
542
|
-
} = Promise.withResolvers();
|
|
543
|
-
set$4(id, resolve);
|
|
544
|
-
return {
|
|
545
|
-
id,
|
|
546
|
-
promise
|
|
547
|
-
};
|
|
548
|
-
};
|
|
549
|
-
const create$2$1 = (method, params) => {
|
|
550
|
-
const {
|
|
551
|
-
id,
|
|
552
|
-
promise
|
|
553
|
-
} = registerPromise();
|
|
554
|
-
const message = {
|
|
555
|
-
jsonrpc: Two,
|
|
556
|
-
method,
|
|
557
|
-
params,
|
|
558
|
-
id
|
|
559
|
-
};
|
|
560
|
-
return {
|
|
561
|
-
message,
|
|
562
|
-
promise
|
|
563
|
-
};
|
|
564
|
-
};
|
|
565
517
|
class JsonRpcError extends Error {
|
|
566
518
|
constructor(message) {
|
|
567
519
|
super(message);
|
|
@@ -705,14 +657,14 @@ const warn = (...args) => {
|
|
|
705
657
|
console.warn(...args);
|
|
706
658
|
};
|
|
707
659
|
const resolve = (id, response) => {
|
|
708
|
-
const fn = get$
|
|
660
|
+
const fn = get$3(id);
|
|
709
661
|
if (!fn) {
|
|
710
662
|
console.log(response);
|
|
711
663
|
warn(`callback ${id} may already be disposed`);
|
|
712
664
|
return;
|
|
713
665
|
}
|
|
714
666
|
fn(response);
|
|
715
|
-
remove$
|
|
667
|
+
remove$2(id);
|
|
716
668
|
};
|
|
717
669
|
const E_COMMAND_NOT_FOUND = 'E_COMMAND_NOT_FOUND';
|
|
718
670
|
const getErrorType = prettyError => {
|
|
@@ -757,7 +709,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
757
709
|
};
|
|
758
710
|
const create$1$1 = (id, error) => {
|
|
759
711
|
return {
|
|
760
|
-
jsonrpc: Two,
|
|
712
|
+
jsonrpc: Two$1,
|
|
761
713
|
id,
|
|
762
714
|
error
|
|
763
715
|
};
|
|
@@ -768,20 +720,20 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
768
720
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
769
721
|
return create$1$1(id, errorProperty);
|
|
770
722
|
};
|
|
771
|
-
const create$
|
|
723
|
+
const create$6 = (message, result) => {
|
|
772
724
|
return {
|
|
773
|
-
jsonrpc: Two,
|
|
725
|
+
jsonrpc: Two$1,
|
|
774
726
|
id: message.id,
|
|
775
727
|
result: result ?? null
|
|
776
728
|
};
|
|
777
729
|
};
|
|
778
730
|
const getSuccessResponse = (message, result) => {
|
|
779
731
|
const resultProperty = result ?? null;
|
|
780
|
-
return create$
|
|
732
|
+
return create$6(message, resultProperty);
|
|
781
733
|
};
|
|
782
734
|
const getErrorResponseSimple = (id, error) => {
|
|
783
735
|
return {
|
|
784
|
-
jsonrpc: Two,
|
|
736
|
+
jsonrpc: Two$1,
|
|
785
737
|
id,
|
|
786
738
|
error: {
|
|
787
739
|
code: Custom,
|
|
@@ -868,29 +820,6 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
868
820
|
}
|
|
869
821
|
throw new JsonRpcError('unexpected message');
|
|
870
822
|
};
|
|
871
|
-
const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
872
|
-
const {
|
|
873
|
-
message,
|
|
874
|
-
promise
|
|
875
|
-
} = create$2$1(method, params);
|
|
876
|
-
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
877
|
-
ipc.sendAndTransfer(message);
|
|
878
|
-
} else {
|
|
879
|
-
ipc.send(message);
|
|
880
|
-
}
|
|
881
|
-
const responseMessage = await promise;
|
|
882
|
-
return unwrapJsonRpcResult(responseMessage);
|
|
883
|
-
};
|
|
884
|
-
const send = (transport, method, ...params) => {
|
|
885
|
-
const message = create$4$1(method, params);
|
|
886
|
-
transport.send(message);
|
|
887
|
-
};
|
|
888
|
-
const invoke$5 = (ipc, method, ...params) => {
|
|
889
|
-
return invokeHelper(ipc, method, params, false);
|
|
890
|
-
};
|
|
891
|
-
const invokeAndTransfer$4 = (ipc, method, ...params) => {
|
|
892
|
-
return invokeHelper(ipc, method, params, true);
|
|
893
|
-
};
|
|
894
823
|
|
|
895
824
|
class CommandNotFoundError extends Error {
|
|
896
825
|
constructor(command) {
|
|
@@ -913,24 +842,87 @@ const execute = (command, ...args) => {
|
|
|
913
842
|
return fn(...args);
|
|
914
843
|
};
|
|
915
844
|
|
|
845
|
+
const Two = '2.0';
|
|
846
|
+
const create$t = (method, params) => {
|
|
847
|
+
return {
|
|
848
|
+
jsonrpc: Two,
|
|
849
|
+
method,
|
|
850
|
+
params
|
|
851
|
+
};
|
|
852
|
+
};
|
|
853
|
+
const create$s = (id, method, params) => {
|
|
854
|
+
const message = {
|
|
855
|
+
id,
|
|
856
|
+
jsonrpc: Two,
|
|
857
|
+
method,
|
|
858
|
+
params
|
|
859
|
+
};
|
|
860
|
+
return message;
|
|
861
|
+
};
|
|
862
|
+
let id = 0;
|
|
863
|
+
const create$r = () => {
|
|
864
|
+
return ++id;
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
/* eslint-disable n/no-unsupported-features/es-syntax */
|
|
868
|
+
|
|
869
|
+
const registerPromise = map => {
|
|
870
|
+
const id = create$r();
|
|
871
|
+
const {
|
|
872
|
+
promise,
|
|
873
|
+
resolve
|
|
874
|
+
} = Promise.withResolvers();
|
|
875
|
+
map[id] = resolve;
|
|
876
|
+
return {
|
|
877
|
+
id,
|
|
878
|
+
promise
|
|
879
|
+
};
|
|
880
|
+
};
|
|
881
|
+
|
|
882
|
+
// @ts-ignore
|
|
883
|
+
const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer) => {
|
|
884
|
+
const {
|
|
885
|
+
id,
|
|
886
|
+
promise
|
|
887
|
+
} = registerPromise(callbacks);
|
|
888
|
+
const message = create$s(id, method, params);
|
|
889
|
+
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
890
|
+
ipc.sendAndTransfer(message);
|
|
891
|
+
} else {
|
|
892
|
+
ipc.send(message);
|
|
893
|
+
}
|
|
894
|
+
const responseMessage = await promise;
|
|
895
|
+
return unwrapJsonRpcResult(responseMessage);
|
|
896
|
+
};
|
|
916
897
|
const createRpc = ipc => {
|
|
898
|
+
const callbacks = Object.create(null);
|
|
899
|
+
ipc._resolve = (id, response) => {
|
|
900
|
+
const fn = callbacks[id];
|
|
901
|
+
if (!fn) {
|
|
902
|
+
console.warn(`callback ${id} may already be disposed`);
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
fn(response);
|
|
906
|
+
delete callbacks[id];
|
|
907
|
+
};
|
|
917
908
|
const rpc = {
|
|
909
|
+
async dispose() {
|
|
910
|
+
await ipc?.dispose();
|
|
911
|
+
},
|
|
912
|
+
invoke(method, ...params) {
|
|
913
|
+
return invokeHelper(callbacks, ipc, method, params, false);
|
|
914
|
+
},
|
|
915
|
+
invokeAndTransfer(method, ...params) {
|
|
916
|
+
return invokeHelper(callbacks, ipc, method, params, true);
|
|
917
|
+
},
|
|
918
918
|
// @ts-ignore
|
|
919
919
|
ipc,
|
|
920
920
|
/**
|
|
921
921
|
* @deprecated
|
|
922
922
|
*/
|
|
923
923
|
send(method, ...params) {
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
invoke(method, ...params) {
|
|
927
|
-
return invoke$5(ipc, method, ...params);
|
|
928
|
-
},
|
|
929
|
-
invokeAndTransfer(method, ...params) {
|
|
930
|
-
return invokeAndTransfer$4(ipc, method, ...params);
|
|
931
|
-
},
|
|
932
|
-
async dispose() {
|
|
933
|
-
await ipc?.dispose();
|
|
924
|
+
const message = create$t(method, params);
|
|
925
|
+
ipc.send(message);
|
|
934
926
|
}
|
|
935
927
|
};
|
|
936
928
|
return rpc;
|
|
@@ -947,7 +939,7 @@ const logError = () => {
|
|
|
947
939
|
const handleMessage = event => {
|
|
948
940
|
const actualRequiresSocket = event?.target?.requiresSocket || requiresSocket;
|
|
949
941
|
const actualExecute = event?.target?.execute || execute;
|
|
950
|
-
return handleJsonRpcMessage(event.target, event.data, actualExecute,
|
|
942
|
+
return handleJsonRpcMessage(event.target, event.data, actualExecute, event.target._resolve, preparePrettyError, logError, actualRequiresSocket);
|
|
951
943
|
};
|
|
952
944
|
const handleIpc = ipc => {
|
|
953
945
|
if ('addEventListener' in ipc) {
|
|
@@ -967,14 +959,14 @@ const listen$1 = async (module, options) => {
|
|
|
967
959
|
};
|
|
968
960
|
const create$e = async ({
|
|
969
961
|
commandMap,
|
|
970
|
-
|
|
971
|
-
|
|
962
|
+
isMessagePortOpen,
|
|
963
|
+
messagePort
|
|
972
964
|
}) => {
|
|
973
965
|
// TODO create a commandMap per rpc instance
|
|
974
966
|
register$4(commandMap);
|
|
975
967
|
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
976
|
-
|
|
977
|
-
|
|
968
|
+
isMessagePortOpen,
|
|
969
|
+
messagePort
|
|
978
970
|
});
|
|
979
971
|
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
980
972
|
handleIpc(ipc);
|
|
@@ -987,13 +979,14 @@ const MessagePortRpcParent = {
|
|
|
987
979
|
};
|
|
988
980
|
const create$5 = async ({
|
|
989
981
|
commandMap,
|
|
982
|
+
isMessagePortOpen = true,
|
|
990
983
|
messagePort
|
|
991
984
|
}) => {
|
|
992
985
|
// TODO create a commandMap per rpc instance
|
|
993
986
|
register$4(commandMap);
|
|
994
987
|
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
995
|
-
|
|
996
|
-
|
|
988
|
+
isMessagePortOpen,
|
|
989
|
+
messagePort
|
|
997
990
|
});
|
|
998
991
|
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
999
992
|
handleIpc(ipc);
|
|
@@ -1014,8 +1007,9 @@ const PlainMessagePortRpcParent = {
|
|
|
1014
1007
|
__proto__: null,
|
|
1015
1008
|
create: create$4
|
|
1016
1009
|
};
|
|
1017
|
-
const create$3 = async ({
|
|
1010
|
+
const create$3$1 = async ({
|
|
1018
1011
|
commandMap,
|
|
1012
|
+
isMessagePortOpen,
|
|
1019
1013
|
send
|
|
1020
1014
|
}) => {
|
|
1021
1015
|
const {
|
|
@@ -1025,14 +1019,15 @@ const create$3 = async ({
|
|
|
1025
1019
|
await send(port1);
|
|
1026
1020
|
return create$5({
|
|
1027
1021
|
commandMap,
|
|
1022
|
+
isMessagePortOpen,
|
|
1028
1023
|
messagePort: port2
|
|
1029
1024
|
});
|
|
1030
1025
|
};
|
|
1031
1026
|
const TransferMessagePortRpcParent = {
|
|
1032
1027
|
__proto__: null,
|
|
1033
|
-
create: create$3
|
|
1028
|
+
create: create$3$1
|
|
1034
1029
|
};
|
|
1035
|
-
const create$
|
|
1030
|
+
const create$2$1 = async ({
|
|
1036
1031
|
commandMap
|
|
1037
1032
|
}) => {
|
|
1038
1033
|
// TODO create a commandMap per rpc instance
|
|
@@ -1044,7 +1039,7 @@ const create$6 = async ({
|
|
|
1044
1039
|
};
|
|
1045
1040
|
const WebWorkerRpcClient = {
|
|
1046
1041
|
__proto__: null,
|
|
1047
|
-
create: create$
|
|
1042
|
+
create: create$2$1
|
|
1048
1043
|
};
|
|
1049
1044
|
const createMockRpc = ({
|
|
1050
1045
|
commandMap
|
|
@@ -1059,470 +1054,88 @@ const createMockRpc = ({
|
|
|
1059
1054
|
return command(...params);
|
|
1060
1055
|
};
|
|
1061
1056
|
const mockRpc = {
|
|
1057
|
+
invocations,
|
|
1062
1058
|
invoke,
|
|
1063
|
-
invokeAndTransfer: invoke
|
|
1064
|
-
invocations
|
|
1059
|
+
invokeAndTransfer: invoke
|
|
1065
1060
|
};
|
|
1066
1061
|
return mockRpc;
|
|
1067
1062
|
};
|
|
1068
1063
|
|
|
1069
|
-
const Script = 2;
|
|
1070
|
-
|
|
1071
|
-
const DebugWorker = 55;
|
|
1072
1064
|
const ExtensionHostWorker = 44;
|
|
1073
1065
|
const RendererWorker$1 = 1;
|
|
1074
1066
|
|
|
1067
|
+
const SetDom2 = 'Viewlet.setDom2';
|
|
1068
|
+
|
|
1075
1069
|
const rpcs$1 = Object.create(null);
|
|
1076
|
-
const set$
|
|
1077
|
-
if (rpcs$1[id]) {
|
|
1078
|
-
throw new Error(`rpc with id ${id} is already registered`);
|
|
1079
|
-
}
|
|
1070
|
+
const set$4 = (id, rpc) => {
|
|
1080
1071
|
rpcs$1[id] = rpc;
|
|
1081
1072
|
};
|
|
1082
|
-
const get$
|
|
1073
|
+
const get$2 = id => {
|
|
1083
1074
|
return rpcs$1[id];
|
|
1084
1075
|
};
|
|
1076
|
+
const remove$1 = id => {
|
|
1077
|
+
delete rpcs$1[id];
|
|
1078
|
+
};
|
|
1085
1079
|
|
|
1086
|
-
|
|
1080
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
1081
|
+
const create$3 = rpcId => {
|
|
1087
1082
|
return {
|
|
1088
1083
|
async dispose() {
|
|
1089
|
-
const rpc = get$
|
|
1084
|
+
const rpc = get$2(rpcId);
|
|
1090
1085
|
await rpc.dispose();
|
|
1091
1086
|
},
|
|
1092
1087
|
// @ts-ignore
|
|
1093
1088
|
invoke(method, ...params) {
|
|
1094
|
-
const rpc = get$
|
|
1089
|
+
const rpc = get$2(rpcId);
|
|
1095
1090
|
// @ts-ignore
|
|
1096
1091
|
return rpc.invoke(method, ...params);
|
|
1097
1092
|
},
|
|
1098
1093
|
// @ts-ignore
|
|
1099
1094
|
invokeAndTransfer(method, ...params) {
|
|
1100
|
-
const rpc = get$
|
|
1095
|
+
const rpc = get$2(rpcId);
|
|
1101
1096
|
// @ts-ignore
|
|
1102
1097
|
return rpc.invokeAndTransfer(method, ...params);
|
|
1103
1098
|
},
|
|
1099
|
+
registerMockRpc(commandMap) {
|
|
1100
|
+
const mockRpc = createMockRpc({
|
|
1101
|
+
commandMap
|
|
1102
|
+
});
|
|
1103
|
+
set$4(rpcId, mockRpc);
|
|
1104
|
+
// @ts-ignore
|
|
1105
|
+
mockRpc[Symbol.dispose] = () => {
|
|
1106
|
+
remove$1(rpcId);
|
|
1107
|
+
};
|
|
1108
|
+
// @ts-ignore
|
|
1109
|
+
return mockRpc;
|
|
1110
|
+
},
|
|
1104
1111
|
set(rpc) {
|
|
1105
|
-
set$
|
|
1112
|
+
set$4(rpcId, rpc);
|
|
1106
1113
|
}
|
|
1107
1114
|
};
|
|
1108
1115
|
};
|
|
1109
1116
|
|
|
1110
1117
|
const {
|
|
1111
1118
|
invoke: invoke$4,
|
|
1112
|
-
invokeAndTransfer: invokeAndTransfer$
|
|
1113
|
-
set: set$
|
|
1114
|
-
} = create$
|
|
1119
|
+
invokeAndTransfer: invokeAndTransfer$2,
|
|
1120
|
+
set: set$3
|
|
1121
|
+
} = create$3(ExtensionHostWorker);
|
|
1115
1122
|
|
|
1116
1123
|
const {
|
|
1117
|
-
dispose,
|
|
1118
1124
|
invoke: invoke$3,
|
|
1119
|
-
invokeAndTransfer: invokeAndTransfer$
|
|
1120
|
-
set: set$
|
|
1121
|
-
} = create$
|
|
1122
|
-
const searchFileHtml = async uri => {
|
|
1123
|
-
return invoke$3('ExtensionHost.searchFileWithHtml', uri);
|
|
1124
|
-
};
|
|
1125
|
-
const getFilePathElectron = async file => {
|
|
1126
|
-
return invoke$3('FileSystemHandle.getFilePathElectron', file);
|
|
1127
|
-
};
|
|
1128
|
-
/**
|
|
1129
|
-
* @deprecated
|
|
1130
|
-
*/
|
|
1131
|
-
const showContextMenu = async (x, y, id, ...args) => {
|
|
1132
|
-
return invoke$3('ContextMenu.show', x, y, id, ...args);
|
|
1133
|
-
};
|
|
1134
|
-
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1135
|
-
number(uid);
|
|
1136
|
-
number(menuId);
|
|
1137
|
-
number(x);
|
|
1138
|
-
number(y);
|
|
1139
|
-
// @ts-ignore
|
|
1140
|
-
await invoke$3('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1141
|
-
};
|
|
1142
|
-
const getElectronVersion = async () => {
|
|
1143
|
-
return invoke$3('Process.getElectronVersion');
|
|
1144
|
-
};
|
|
1145
|
-
const applyBulkReplacement = async bulkEdits => {
|
|
1146
|
-
await invoke$3('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
1147
|
-
};
|
|
1148
|
-
const setColorTheme = async id => {
|
|
1149
|
-
// @ts-ignore
|
|
1150
|
-
return invoke$3(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1151
|
-
};
|
|
1152
|
-
const getNodeVersion = async () => {
|
|
1153
|
-
return invoke$3('Process.getNodeVersion');
|
|
1154
|
-
};
|
|
1155
|
-
const getChromeVersion = async () => {
|
|
1156
|
-
return invoke$3('Process.getChromeVersion');
|
|
1157
|
-
};
|
|
1158
|
-
const getV8Version = async () => {
|
|
1159
|
-
return invoke$3('Process.getV8Version');
|
|
1160
|
-
};
|
|
1161
|
-
const getFileHandles = async fileIds => {
|
|
1162
|
-
const files = await invoke$3('FileSystemHandle.getFileHandles', fileIds);
|
|
1163
|
-
return files;
|
|
1164
|
-
};
|
|
1165
|
-
const setWorkspacePath = async path => {
|
|
1166
|
-
await invoke$3('Workspace.setPath', path);
|
|
1167
|
-
};
|
|
1168
|
-
const registerWebViewInterceptor = async (id, port) => {
|
|
1169
|
-
await invokeAndTransfer$2('WebView.registerInterceptor', id, port);
|
|
1170
|
-
};
|
|
1171
|
-
const unregisterWebViewInterceptor = async id => {
|
|
1172
|
-
await invoke$3('WebView.unregisterInterceptor', id);
|
|
1173
|
-
};
|
|
1174
|
-
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1175
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1176
|
-
// @ts-ignore
|
|
1177
|
-
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1178
|
-
};
|
|
1179
|
-
const sendMessagePortToErrorWorker = async (port, rpcId) => {
|
|
1180
|
-
const command = 'Errors.handleMessagePort';
|
|
1181
|
-
// @ts-ignore
|
|
1182
|
-
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
1183
|
-
};
|
|
1184
|
-
const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
|
|
1185
|
-
const command = 'Markdown.handleMessagePort';
|
|
1186
|
-
// @ts-ignore
|
|
1187
|
-
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
|
|
1188
|
-
};
|
|
1189
|
-
const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
|
|
1190
|
-
const command = 'IconTheme.handleMessagePort';
|
|
1191
|
-
// @ts-ignore
|
|
1192
|
-
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
|
|
1193
|
-
};
|
|
1194
|
-
const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
|
|
1195
|
-
const command = 'FileSystem.handleMessagePort';
|
|
1196
|
-
// @ts-ignore
|
|
1197
|
-
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
|
|
1198
|
-
};
|
|
1199
|
-
const readFile$1 = async uri => {
|
|
1200
|
-
return invoke$3('FileSystem.readFile', uri);
|
|
1201
|
-
};
|
|
1202
|
-
const getWebViewSecret = async key => {
|
|
1203
|
-
// @ts-ignore
|
|
1204
|
-
return invoke$3('WebView.getSecret', key);
|
|
1205
|
-
};
|
|
1206
|
-
const setWebViewPort = async (uid, port, origin, portType) => {
|
|
1207
|
-
return invokeAndTransfer$2('WebView.setPort', uid, port, origin, portType);
|
|
1208
|
-
};
|
|
1209
|
-
const setFocus = key => {
|
|
1210
|
-
return invoke$3('Focus.setFocus', key);
|
|
1211
|
-
};
|
|
1212
|
-
const getFileIcon = async options => {
|
|
1213
|
-
return invoke$3('IconTheme.getFileIcon', options);
|
|
1214
|
-
};
|
|
1215
|
-
const getColorThemeNames = async () => {
|
|
1216
|
-
return invoke$3('ColorTheme.getColorThemeNames');
|
|
1217
|
-
};
|
|
1218
|
-
const disableExtension = async id => {
|
|
1219
|
-
// @ts-ignore
|
|
1220
|
-
return invoke$3('ExtensionManagement.disable', id);
|
|
1221
|
-
};
|
|
1222
|
-
const enableExtension = async id => {
|
|
1223
|
-
// @ts-ignore
|
|
1224
|
-
return invoke$3('ExtensionManagement.enable', id);
|
|
1225
|
-
};
|
|
1226
|
-
const handleDebugChange = async params => {
|
|
1227
|
-
// @ts-ignore
|
|
1228
|
-
return invoke$3('Run And Debug.handleChange', params);
|
|
1229
|
-
};
|
|
1230
|
-
const getFolderIcon = async options => {
|
|
1231
|
-
return invoke$3('IconTheme.getFolderIcon', options);
|
|
1232
|
-
};
|
|
1233
|
-
const handleWorkspaceRefresh = async () => {
|
|
1234
|
-
return invoke$3('Layout.handleWorkspaceRefresh');
|
|
1235
|
-
};
|
|
1236
|
-
const closeWidget = async widgetId => {
|
|
1237
|
-
return invoke$3('Viewlet.closeWidget', widgetId);
|
|
1238
|
-
};
|
|
1125
|
+
invokeAndTransfer: invokeAndTransfer$1,
|
|
1126
|
+
set: set$2
|
|
1127
|
+
} = create$3(RendererWorker$1);
|
|
1239
1128
|
const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
1240
1129
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1241
|
-
await invokeAndTransfer$
|
|
1242
|
-
};
|
|
1243
|
-
const sendMessagePortToSearchProcess = async port => {
|
|
1244
|
-
await invokeAndTransfer$2('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
1245
|
-
};
|
|
1246
|
-
const confirm = async (message, options) => {
|
|
1247
|
-
// @ts-ignore
|
|
1248
|
-
const result = await invoke$3('ConfirmPrompt.prompt', message, options);
|
|
1249
|
-
return result;
|
|
1250
|
-
};
|
|
1251
|
-
const getRecentlyOpened = async () => {
|
|
1252
|
-
return invoke$3(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
1253
|
-
};
|
|
1254
|
-
const getKeyBindings = async () => {
|
|
1255
|
-
return invoke$3('KeyBindingsInitial.getKeyBindings');
|
|
1256
|
-
};
|
|
1257
|
-
const writeClipBoardText = async text => {
|
|
1258
|
-
await invoke$3('ClipBoard.writeText', /* text */text);
|
|
1259
|
-
};
|
|
1260
|
-
const readClipBoardText = async () => {
|
|
1261
|
-
return invoke$3('ClipBoard.readText');
|
|
1262
|
-
};
|
|
1263
|
-
const writeClipBoardImage = async blob => {
|
|
1264
|
-
// @ts-ignore
|
|
1265
|
-
await invoke$3('ClipBoard.writeImage', /* text */blob);
|
|
1266
|
-
};
|
|
1267
|
-
const searchFileMemory = async uri => {
|
|
1268
|
-
// @ts-ignore
|
|
1269
|
-
return invoke$3('ExtensionHost.searchFileWithMemory', uri);
|
|
1270
|
-
};
|
|
1271
|
-
const searchFileFetch = async uri => {
|
|
1272
|
-
return invoke$3('ExtensionHost.searchFileWithFetch', uri);
|
|
1273
|
-
};
|
|
1274
|
-
const showMessageBox = async options => {
|
|
1275
|
-
return invoke$3('ElectronDialog.showMessageBox', options);
|
|
1276
|
-
};
|
|
1277
|
-
const handleDebugResumed = async params => {
|
|
1278
|
-
await invoke$3('Run And Debug.handleResumed', params);
|
|
1279
|
-
};
|
|
1280
|
-
const openWidget = async name => {
|
|
1281
|
-
await invoke$3('Viewlet.openWidget', name);
|
|
1282
|
-
};
|
|
1283
|
-
const getIcons = async requests => {
|
|
1284
|
-
const icons = await invoke$3('IconTheme.getIcons', requests);
|
|
1285
|
-
return icons;
|
|
1286
|
-
};
|
|
1287
|
-
const activateByEvent = event => {
|
|
1288
|
-
return invoke$3('ExtensionHostManagement.activateByEvent', event);
|
|
1289
|
-
};
|
|
1290
|
-
const setAdditionalFocus = focusKey => {
|
|
1291
|
-
// @ts-ignore
|
|
1292
|
-
return invoke$3('Focus.setAdditionalFocus', focusKey);
|
|
1293
|
-
};
|
|
1294
|
-
const getActiveEditorId = () => {
|
|
1295
|
-
// @ts-ignore
|
|
1296
|
-
return invoke$3('GetActiveEditor.getActiveEditorId');
|
|
1297
|
-
};
|
|
1298
|
-
const getWorkspacePath = () => {
|
|
1299
|
-
return invoke$3('Workspace.getPath');
|
|
1300
|
-
};
|
|
1301
|
-
const sendMessagePortToRendererProcess = async port => {
|
|
1302
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1303
|
-
// @ts-ignore
|
|
1304
|
-
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
1305
|
-
};
|
|
1306
|
-
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
1307
|
-
const command = 'TextMeasurement.handleMessagePort';
|
|
1308
|
-
// @ts-ignore
|
|
1309
|
-
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
|
|
1310
|
-
};
|
|
1311
|
-
const sendMessagePortToSourceControlWorker = async port => {
|
|
1312
|
-
const command = 'SourceControl.handleMessagePort';
|
|
1313
|
-
// @ts-ignore
|
|
1314
|
-
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
|
|
1315
|
-
};
|
|
1316
|
-
const sendMessagePortToSharedProcess = async port => {
|
|
1317
|
-
const command = 'HandleElectronMessagePort.handleElectronMessagePort';
|
|
1318
|
-
// @ts-ignore
|
|
1319
|
-
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, 0);
|
|
1320
|
-
};
|
|
1321
|
-
const sendMessagePortToFileSystemProcess = async (port, rpcId) => {
|
|
1322
|
-
const command = 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess';
|
|
1323
|
-
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
|
|
1324
|
-
};
|
|
1325
|
-
const sendMessagePortToIframeWorker = async (port, rpcId) => {
|
|
1326
|
-
const command = 'Iframes.handleMessagePort';
|
|
1327
|
-
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToIframeWorker', port, command, rpcId);
|
|
1328
|
-
};
|
|
1329
|
-
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
1330
|
-
const command = 'Extensions.handleMessagePort';
|
|
1331
|
-
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1332
|
-
};
|
|
1333
|
-
const getPreference = async key => {
|
|
1334
|
-
return await invoke$3('Preferences.get', key);
|
|
1335
|
-
};
|
|
1336
|
-
const getAllExtensions = async () => {
|
|
1337
|
-
return invoke$3('ExtensionManagement.getAllExtensions');
|
|
1338
|
-
};
|
|
1339
|
-
const rerenderEditor = async key => {
|
|
1340
|
-
// @ts-ignore
|
|
1341
|
-
return invoke$3('Editor.rerender', key);
|
|
1342
|
-
};
|
|
1343
|
-
const handleDebugPaused = async params => {
|
|
1344
|
-
await invoke$3('Run And Debug.handlePaused', params);
|
|
1345
|
-
};
|
|
1346
|
-
const openUri = async (uri, focus, options) => {
|
|
1347
|
-
await invoke$3('Main.openUri', uri, focus, options);
|
|
1348
|
-
};
|
|
1349
|
-
const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
1350
|
-
await invokeAndTransfer$2(
|
|
1351
|
-
// @ts-ignore
|
|
1352
|
-
'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
|
|
1353
|
-
};
|
|
1354
|
-
const handleDebugScriptParsed = async script => {
|
|
1355
|
-
await invoke$3('Run And Debug.handleScriptParsed', script);
|
|
1356
|
-
};
|
|
1357
|
-
const getWindowId = async () => {
|
|
1358
|
-
return invoke$3('GetWindowId.getWindowId');
|
|
1359
|
-
};
|
|
1360
|
-
const getBlob = async uri => {
|
|
1361
|
-
// @ts-ignore
|
|
1362
|
-
return invoke$3('FileSystem.getBlob', uri);
|
|
1363
|
-
};
|
|
1364
|
-
const getExtensionCommands = async () => {
|
|
1365
|
-
return invoke$3('ExtensionHost.getCommands');
|
|
1366
|
-
};
|
|
1367
|
-
const showErrorDialog = async errorInfo => {
|
|
1368
|
-
// @ts-ignore
|
|
1369
|
-
await invoke$3('ErrorHandling.showErrorDialog', errorInfo);
|
|
1370
|
-
};
|
|
1371
|
-
const getFolderSize = async uri => {
|
|
1372
|
-
// @ts-ignore
|
|
1373
|
-
return await invoke$3('FileSystem.getFolderSize', uri);
|
|
1374
|
-
};
|
|
1375
|
-
const getExtension = async id => {
|
|
1376
|
-
// @ts-ignore
|
|
1377
|
-
return invoke$3('ExtensionManagement.getExtension', id);
|
|
1378
|
-
};
|
|
1379
|
-
const getMarkdownDom = async html => {
|
|
1380
|
-
// @ts-ignore
|
|
1381
|
-
return invoke$3('Markdown.getVirtualDom', html);
|
|
1382
|
-
};
|
|
1383
|
-
const renderMarkdown = async (markdown, options) => {
|
|
1384
|
-
// @ts-ignore
|
|
1385
|
-
return invoke$3('Markdown.renderMarkdown', markdown, options);
|
|
1386
|
-
};
|
|
1387
|
-
const openNativeFolder = async uri => {
|
|
1388
|
-
// @ts-ignore
|
|
1389
|
-
await invoke$3('OpenNativeFolder.openNativeFolder', uri);
|
|
1390
|
-
};
|
|
1391
|
-
const uninstallExtension = async id => {
|
|
1392
|
-
return invoke$3('ExtensionManagement.uninstall', id);
|
|
1393
|
-
};
|
|
1394
|
-
const installExtension = async id => {
|
|
1395
|
-
// @ts-ignore
|
|
1396
|
-
return invoke$3('ExtensionManagement.install', id);
|
|
1397
|
-
};
|
|
1398
|
-
const openExtensionSearch = async () => {
|
|
1399
|
-
// @ts-ignore
|
|
1400
|
-
return invoke$3('SideBar.openViewlet', 'Extensions');
|
|
1401
|
-
};
|
|
1402
|
-
const setExtensionsSearchValue = async searchValue => {
|
|
1403
|
-
// @ts-ignore
|
|
1404
|
-
return invoke$3('Extensions.handleInput', searchValue, Script);
|
|
1405
|
-
};
|
|
1406
|
-
const openExternal = async uri => {
|
|
1407
|
-
// @ts-ignore
|
|
1408
|
-
await invoke$3('Open.openExternal', uri);
|
|
1409
|
-
};
|
|
1410
|
-
const openUrl = async uri => {
|
|
1411
|
-
// @ts-ignore
|
|
1412
|
-
await invoke$3('Open.openUrl', uri);
|
|
1413
|
-
};
|
|
1414
|
-
const getAllPreferences = async () => {
|
|
1415
|
-
// @ts-ignore
|
|
1416
|
-
return invoke$3('Preferences.getAll');
|
|
1417
|
-
};
|
|
1418
|
-
const showSaveFilePicker = async () => {
|
|
1419
|
-
// @ts-ignore
|
|
1420
|
-
return invoke$3('FilePicker.showSaveFilePicker');
|
|
1421
|
-
};
|
|
1422
|
-
const getLogsDir = async () => {
|
|
1423
|
-
// @ts-ignore
|
|
1424
|
-
return invoke$3('PlatformPaths.getLogsDir');
|
|
1425
|
-
};
|
|
1426
|
-
const measureTextBlockHeight = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
|
|
1427
|
-
return invoke$3(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
|
|
1428
|
-
};
|
|
1429
|
-
const registerMockRpc = commandMap => {
|
|
1430
|
-
const mockRpc = createMockRpc({
|
|
1431
|
-
commandMap
|
|
1432
|
-
});
|
|
1433
|
-
set$1(mockRpc);
|
|
1434
|
-
return mockRpc;
|
|
1130
|
+
await invokeAndTransfer$1('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1435
1131
|
};
|
|
1436
1132
|
|
|
1437
1133
|
const RendererWorker = {
|
|
1438
1134
|
__proto__: null,
|
|
1439
|
-
activateByEvent,
|
|
1440
|
-
applyBulkReplacement,
|
|
1441
|
-
closeWidget,
|
|
1442
|
-
confirm,
|
|
1443
|
-
disableExtension,
|
|
1444
|
-
dispose,
|
|
1445
|
-
enableExtension,
|
|
1446
|
-
getActiveEditorId,
|
|
1447
|
-
getAllExtensions,
|
|
1448
|
-
getAllPreferences,
|
|
1449
|
-
getBlob,
|
|
1450
|
-
getChromeVersion,
|
|
1451
|
-
getColorThemeNames,
|
|
1452
|
-
getElectronVersion,
|
|
1453
|
-
getExtension,
|
|
1454
|
-
getExtensionCommands,
|
|
1455
|
-
getFileHandles,
|
|
1456
|
-
getFileIcon,
|
|
1457
|
-
getFilePathElectron,
|
|
1458
|
-
getFolderIcon,
|
|
1459
|
-
getFolderSize,
|
|
1460
|
-
getIcons,
|
|
1461
|
-
getKeyBindings,
|
|
1462
|
-
getLogsDir,
|
|
1463
|
-
getMarkdownDom,
|
|
1464
|
-
getNodeVersion,
|
|
1465
|
-
getPreference,
|
|
1466
|
-
getRecentlyOpened,
|
|
1467
|
-
getV8Version,
|
|
1468
|
-
getWebViewSecret,
|
|
1469
|
-
getWindowId,
|
|
1470
|
-
getWorkspacePath,
|
|
1471
|
-
handleDebugChange,
|
|
1472
|
-
handleDebugPaused,
|
|
1473
|
-
handleDebugResumed,
|
|
1474
|
-
handleDebugScriptParsed,
|
|
1475
|
-
handleWorkspaceRefresh,
|
|
1476
|
-
installExtension,
|
|
1477
1135
|
invoke: invoke$3,
|
|
1478
|
-
invokeAndTransfer: invokeAndTransfer$
|
|
1479
|
-
measureTextBlockHeight,
|
|
1480
|
-
openExtensionSearch,
|
|
1481
|
-
openExternal,
|
|
1482
|
-
openNativeFolder,
|
|
1483
|
-
openUri,
|
|
1484
|
-
openUrl,
|
|
1485
|
-
openWidget,
|
|
1486
|
-
readClipBoardText,
|
|
1487
|
-
readFile: readFile$1,
|
|
1488
|
-
registerMockRpc,
|
|
1489
|
-
registerWebViewInterceptor,
|
|
1490
|
-
renderMarkdown,
|
|
1491
|
-
rerenderEditor,
|
|
1492
|
-
searchFileFetch,
|
|
1493
|
-
searchFileHtml,
|
|
1494
|
-
searchFileMemory,
|
|
1495
|
-
sendMessagePortToEditorWorker,
|
|
1496
|
-
sendMessagePortToErrorWorker,
|
|
1136
|
+
invokeAndTransfer: invokeAndTransfer$1,
|
|
1497
1137
|
sendMessagePortToExtensionHostWorker,
|
|
1498
|
-
|
|
1499
|
-
sendMessagePortToFileSystemProcess,
|
|
1500
|
-
sendMessagePortToFileSystemWorker,
|
|
1501
|
-
sendMessagePortToIconThemeWorker,
|
|
1502
|
-
sendMessagePortToIframeWorker,
|
|
1503
|
-
sendMessagePortToMarkdownWorker,
|
|
1504
|
-
sendMessagePortToRendererProcess,
|
|
1505
|
-
sendMessagePortToSearchProcess,
|
|
1506
|
-
sendMessagePortToSharedProcess,
|
|
1507
|
-
sendMessagePortToSourceControlWorker,
|
|
1508
|
-
sendMessagePortToSyntaxHighlightingWorker,
|
|
1509
|
-
sendMessagePortToTextMeasurementWorker,
|
|
1510
|
-
set: set$1,
|
|
1511
|
-
setAdditionalFocus,
|
|
1512
|
-
setColorTheme,
|
|
1513
|
-
setExtensionsSearchValue,
|
|
1514
|
-
setFocus,
|
|
1515
|
-
setWebViewPort,
|
|
1516
|
-
setWorkspacePath,
|
|
1517
|
-
showContextMenu,
|
|
1518
|
-
showContextMenu2,
|
|
1519
|
-
showErrorDialog,
|
|
1520
|
-
showMessageBox,
|
|
1521
|
-
showSaveFilePicker,
|
|
1522
|
-
uninstallExtension,
|
|
1523
|
-
unregisterWebViewInterceptor,
|
|
1524
|
-
writeClipBoardImage,
|
|
1525
|
-
writeClipBoardText
|
|
1138
|
+
set: set$2
|
|
1526
1139
|
};
|
|
1527
1140
|
|
|
1528
1141
|
const getCredentialLess = locationHost => {
|
|
@@ -1837,7 +1450,7 @@ const getWebViewTitle = webView => {
|
|
|
1837
1450
|
const state = {
|
|
1838
1451
|
id: 0
|
|
1839
1452
|
};
|
|
1840
|
-
const create$
|
|
1453
|
+
const create$2 = () => {
|
|
1841
1454
|
return ++state.id;
|
|
1842
1455
|
};
|
|
1843
1456
|
|
|
@@ -1858,15 +1471,15 @@ const invoke$1 = async (method, ...params) => {
|
|
|
1858
1471
|
// @ts-ignore
|
|
1859
1472
|
return invoke$3('WebView.compatRendererProcessInvoke', method, ...params);
|
|
1860
1473
|
};
|
|
1861
|
-
const invokeAndTransfer
|
|
1474
|
+
const invokeAndTransfer = async (method, ...params) => {
|
|
1862
1475
|
// @ts-ignore
|
|
1863
|
-
return invokeAndTransfer$
|
|
1476
|
+
return invokeAndTransfer$1('WebView.compatRendererProcessInvokeAndTransfer', method, ...params);
|
|
1864
1477
|
};
|
|
1865
1478
|
|
|
1866
1479
|
const WebView = 'lvce-oss-webview';
|
|
1867
1480
|
|
|
1868
1481
|
const setPort = async (uid, port, origin, portType) => {
|
|
1869
|
-
await invokeAndTransfer
|
|
1482
|
+
await invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
|
|
1870
1483
|
};
|
|
1871
1484
|
|
|
1872
1485
|
const invoke = async (method, ...params) => {
|
|
@@ -1877,7 +1490,7 @@ const invoke = async (method, ...params) => {
|
|
|
1877
1490
|
const registerProtocol = async () => {
|
|
1878
1491
|
await invoke('WebViewServer.registerProtocol');
|
|
1879
1492
|
};
|
|
1880
|
-
const create = async (previewServerId, useNewWebViewHandler) => {
|
|
1493
|
+
const create$1 = async (previewServerId, useNewWebViewHandler) => {
|
|
1881
1494
|
await invoke('WebViewServer.create', previewServerId, useNewWebViewHandler);
|
|
1882
1495
|
};
|
|
1883
1496
|
const start = async (previewServerId, webViewPort) => {
|
|
@@ -1895,7 +1508,7 @@ const setHandler = async (previewServerId, frameAncestors, webViewRoot, contentS
|
|
|
1895
1508
|
|
|
1896
1509
|
const register$3 = async (previewServerId, webViewPort, frameAncestors, webViewRoot, csp, iframeContent, webViewId, remotePathPrefix, useNewWebViewHandler) => {
|
|
1897
1510
|
await registerProtocol();
|
|
1898
|
-
await create(previewServerId, useNewWebViewHandler); // TODO move this up
|
|
1511
|
+
await create$1(previewServerId, useNewWebViewHandler); // TODO move this up
|
|
1899
1512
|
|
|
1900
1513
|
// TODO send info to electron which domain maps to which webview root.
|
|
1901
1514
|
// for example, video-preview maps to domain lvce-oss-webview://video-preview
|
|
@@ -1911,7 +1524,7 @@ const register$2 = async (previewServerId, webViewPort, frameAncestors, webViewR
|
|
|
1911
1524
|
// TODO pass webview root, so that only these resources can be accessed
|
|
1912
1525
|
// TODO pass csp configuration to server
|
|
1913
1526
|
// TODO pass coop / coep configuration to server
|
|
1914
|
-
await create(previewServerId, useNewWebViewHandler); // TODO move this up
|
|
1527
|
+
await create$1(previewServerId, useNewWebViewHandler); // TODO move this up
|
|
1915
1528
|
await start(previewServerId, webViewPort); // TODO move this up
|
|
1916
1529
|
await (useNewWebViewHandler ? setInfo2({
|
|
1917
1530
|
contentSecurityPolicy: csp,
|
|
@@ -1993,7 +1606,7 @@ const create2 = async ({
|
|
|
1993
1606
|
port1,
|
|
1994
1607
|
port2
|
|
1995
1608
|
} = getPortTuple();
|
|
1996
|
-
const portId = create$
|
|
1609
|
+
const portId = create$2();
|
|
1997
1610
|
const remotePathPrefix = '/remote';
|
|
1998
1611
|
await register(previewServerId, webViewPort, frameAncestors, webViewRoot, csp, iframeContent, platform, webViewId, remotePathPrefix);
|
|
1999
1612
|
await invoke$1('WebView.create', id, iframeSrc, sandbox, iframeCsp, credentialless, permissionPolicyString, frameTitle);
|
|
@@ -2005,7 +1618,7 @@ const create2 = async ({
|
|
|
2005
1618
|
const origin = getWebViewOrigin(webViewPort, platform, webViewScheme, webViewId);
|
|
2006
1619
|
const portType = '';
|
|
2007
1620
|
await setPort(id, port1, origin, portType);
|
|
2008
|
-
await invokeAndTransfer$
|
|
1621
|
+
await invokeAndTransfer$2('ExtensionHostWebView.create', webViewId, port2, uri, id, origin, webView);
|
|
2009
1622
|
const savedState = await getSavedWebViewState(webViewId);
|
|
2010
1623
|
await invoke$4('ExtensionHostWebView.load', webViewId, savedState);
|
|
2011
1624
|
return {
|
|
@@ -2028,12 +1641,7 @@ const createAndLoadWebView = async (id, iframeSrc, sandbox, iframeCsp, credentia
|
|
|
2028
1641
|
|
|
2029
1642
|
const createSecondaryWebViewConnection = async (uid, origin, port) => {
|
|
2030
1643
|
const portType = 'application';
|
|
2031
|
-
await invokeAndTransfer$
|
|
2032
|
-
};
|
|
2033
|
-
|
|
2034
|
-
const invokeAndTransfer = async (method, ...params) => {
|
|
2035
|
-
// @ts-ignore
|
|
2036
|
-
return invokeAndTransfer$2(method, ...params);
|
|
1644
|
+
await invokeAndTransfer$1('WebView.setPort', uid, port, origin, portType);
|
|
2037
1645
|
};
|
|
2038
1646
|
|
|
2039
1647
|
const createWebViewConnection = async (uid, origin) => {
|
|
@@ -2047,7 +1655,7 @@ const createWebViewConnection = async (uid, origin) => {
|
|
|
2047
1655
|
messagePort: port2
|
|
2048
1656
|
});
|
|
2049
1657
|
const portType = 'test';
|
|
2050
|
-
await invokeAndTransfer('WebView.setPort', uid, port1, origin, portType);
|
|
1658
|
+
await invokeAndTransfer$1('WebView.setPort', uid, port1, origin, portType);
|
|
2051
1659
|
// TODO dispose rpc to avoid memory leak
|
|
2052
1660
|
const rpc = await rpcPromise;
|
|
2053
1661
|
return rpc;
|
|
@@ -2084,10 +1692,10 @@ const getProtocol = uri => {
|
|
|
2084
1692
|
};
|
|
2085
1693
|
|
|
2086
1694
|
const rpcs = Object.create(null);
|
|
2087
|
-
const set = (id, rpc) => {
|
|
1695
|
+
const set$1 = (id, rpc) => {
|
|
2088
1696
|
rpcs[id] = rpc;
|
|
2089
1697
|
};
|
|
2090
|
-
const get = id => {
|
|
1698
|
+
const get$1 = id => {
|
|
2091
1699
|
return rpcs[id];
|
|
2092
1700
|
};
|
|
2093
1701
|
const getAll$1 = () => {
|
|
@@ -2103,7 +1711,7 @@ const getAll$1 = () => {
|
|
|
2103
1711
|
|
|
2104
1712
|
const getRemoteUrlForWebView = async options => {
|
|
2105
1713
|
object(options);
|
|
2106
|
-
const webView = get(options.id);
|
|
1714
|
+
const webView = get$1(options.id);
|
|
2107
1715
|
object(webView);
|
|
2108
1716
|
const rpcPromise = createWebViewConnection(webView.webViewUid, webView.origin);
|
|
2109
1717
|
const blobPromise = invoke$3('FileSystem.getBlob', options.uri);
|
|
@@ -2156,7 +1764,7 @@ const getWebViewWorkerRpc2 = async rpcInfo => {
|
|
|
2156
1764
|
const rpc = await TransferMessagePortRpcParent.create({
|
|
2157
1765
|
commandMap: commandMap$1,
|
|
2158
1766
|
async send(port) {
|
|
2159
|
-
await invokeAndTransfer$
|
|
1767
|
+
await invokeAndTransfer$2('WebView.createWebViewWorkerRpc2', rpcInfo, port);
|
|
2160
1768
|
}
|
|
2161
1769
|
});
|
|
2162
1770
|
// TODO
|
|
@@ -2227,7 +1835,7 @@ const createWebWorkerRpc2 = async (rpcInfo, webView, savedState, uri, portId, we
|
|
|
2227
1835
|
webViewId: webView.id,
|
|
2228
1836
|
webViewUid
|
|
2229
1837
|
};
|
|
2230
|
-
set(portId, webViewInfo);
|
|
1838
|
+
set$1(portId, webViewInfo);
|
|
2231
1839
|
|
|
2232
1840
|
// TODO this connection might not be needed
|
|
2233
1841
|
await createWebViewConnection(webViewUid, origin);
|
|
@@ -2273,7 +1881,7 @@ const getWebViewWorkerRpc = async rpcInfo => {
|
|
|
2273
1881
|
isMessagePortOpen: true,
|
|
2274
1882
|
messagePort: port2
|
|
2275
1883
|
});
|
|
2276
|
-
await invokeAndTransfer$
|
|
1884
|
+
await invokeAndTransfer$2('WebView.createWebViewWorkerRpc', rpcInfo, port1);
|
|
2277
1885
|
const rpc = await rpcPromise;
|
|
2278
1886
|
// TODO rpc module should start the port
|
|
2279
1887
|
port2.start();
|
|
@@ -2291,7 +1899,7 @@ const createWebViewRpc$1 = async (rpcInfo, webView, savedState, uri, portId, web
|
|
|
2291
1899
|
webViewId: webView.id,
|
|
2292
1900
|
webViewUid
|
|
2293
1901
|
};
|
|
2294
|
-
set(portId, webViewInfo);
|
|
1902
|
+
set$1(portId, webViewInfo);
|
|
2295
1903
|
await rpc.invoke('LoadFile.loadFile', rpcInfo.url);
|
|
2296
1904
|
|
|
2297
1905
|
// TODO this connection might not be needed
|
|
@@ -2402,7 +2010,7 @@ const create3 = async ({
|
|
|
2402
2010
|
|
|
2403
2011
|
// TODO remove this
|
|
2404
2012
|
await invoke$2('ExtensionHostManagement.activateByEvent', `onWebView:${webViewId}`);
|
|
2405
|
-
const portId = create$
|
|
2013
|
+
const portId = create$2();
|
|
2406
2014
|
const remotePathPrefix = '/remote';
|
|
2407
2015
|
await register(previewServerId, webViewPort, frameAncestors, webViewRoot, csp, iframeContent, platform, webViewId, remotePathPrefix, useNewWebViewHandler);
|
|
2408
2016
|
await createAndLoadWebView(id, iframeSrc, sandbox, iframeCsp, credentialless, permissionPolicyString, frameTitle);
|
|
@@ -2415,7 +2023,7 @@ const create3 = async ({
|
|
|
2415
2023
|
} = getPortTuple();
|
|
2416
2024
|
const portType = '';
|
|
2417
2025
|
await setPort(id, port1, origin, portType);
|
|
2418
|
-
await invokeAndTransfer$
|
|
2026
|
+
await invokeAndTransfer$2('ExtensionHostWebView.create', webViewId, port2, uri, id, origin, webView);
|
|
2419
2027
|
}
|
|
2420
2028
|
const savedState = await getSavedWebViewState(webViewId);
|
|
2421
2029
|
if (hasOldRpc) {
|
|
@@ -2431,6 +2039,133 @@ const create3 = async ({
|
|
|
2431
2039
|
};
|
|
2432
2040
|
};
|
|
2433
2041
|
|
|
2042
|
+
const toCommandId = key => {
|
|
2043
|
+
const dotIndex = key.indexOf('.');
|
|
2044
|
+
return key.slice(dotIndex + 1);
|
|
2045
|
+
};
|
|
2046
|
+
const create = () => {
|
|
2047
|
+
const states = Object.create(null);
|
|
2048
|
+
const commandMapRef = {};
|
|
2049
|
+
return {
|
|
2050
|
+
clear() {
|
|
2051
|
+
for (const key of Object.keys(states)) {
|
|
2052
|
+
delete states[key];
|
|
2053
|
+
}
|
|
2054
|
+
},
|
|
2055
|
+
diff(uid, modules, numbers) {
|
|
2056
|
+
const {
|
|
2057
|
+
newState,
|
|
2058
|
+
oldState
|
|
2059
|
+
} = states[uid];
|
|
2060
|
+
const diffResult = [];
|
|
2061
|
+
for (let i = 0; i < modules.length; i++) {
|
|
2062
|
+
const fn = modules[i];
|
|
2063
|
+
if (!fn(oldState, newState)) {
|
|
2064
|
+
diffResult.push(numbers[i]);
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2067
|
+
return diffResult;
|
|
2068
|
+
},
|
|
2069
|
+
dispose(uid) {
|
|
2070
|
+
delete states[uid];
|
|
2071
|
+
},
|
|
2072
|
+
get(uid) {
|
|
2073
|
+
return states[uid];
|
|
2074
|
+
},
|
|
2075
|
+
getCommandIds() {
|
|
2076
|
+
const keys = Object.keys(commandMapRef);
|
|
2077
|
+
const ids = keys.map(toCommandId);
|
|
2078
|
+
return ids;
|
|
2079
|
+
},
|
|
2080
|
+
getKeys() {
|
|
2081
|
+
return Object.keys(states).map(key => {
|
|
2082
|
+
return Number.parseInt(key);
|
|
2083
|
+
});
|
|
2084
|
+
},
|
|
2085
|
+
registerCommands(commandMap) {
|
|
2086
|
+
Object.assign(commandMapRef, commandMap);
|
|
2087
|
+
},
|
|
2088
|
+
set(uid, oldState, newState) {
|
|
2089
|
+
states[uid] = {
|
|
2090
|
+
newState,
|
|
2091
|
+
oldState
|
|
2092
|
+
};
|
|
2093
|
+
},
|
|
2094
|
+
wrapCommand(fn) {
|
|
2095
|
+
const wrapped = async (uid, ...args) => {
|
|
2096
|
+
const {
|
|
2097
|
+
newState,
|
|
2098
|
+
oldState
|
|
2099
|
+
} = states[uid];
|
|
2100
|
+
const newerState = await fn(newState, ...args);
|
|
2101
|
+
if (oldState === newerState || newState === newerState) {
|
|
2102
|
+
return;
|
|
2103
|
+
}
|
|
2104
|
+
const latestOld = states[uid];
|
|
2105
|
+
const latestNew = {
|
|
2106
|
+
...latestOld.newState,
|
|
2107
|
+
...newerState
|
|
2108
|
+
};
|
|
2109
|
+
states[uid] = {
|
|
2110
|
+
newState: latestNew,
|
|
2111
|
+
oldState: latestOld.oldState
|
|
2112
|
+
};
|
|
2113
|
+
};
|
|
2114
|
+
return wrapped;
|
|
2115
|
+
},
|
|
2116
|
+
wrapGetter(fn) {
|
|
2117
|
+
const wrapped = (uid, ...args) => {
|
|
2118
|
+
const {
|
|
2119
|
+
newState
|
|
2120
|
+
} = states[uid];
|
|
2121
|
+
return fn(newState, ...args);
|
|
2122
|
+
};
|
|
2123
|
+
return wrapped;
|
|
2124
|
+
}
|
|
2125
|
+
};
|
|
2126
|
+
};
|
|
2127
|
+
|
|
2128
|
+
const {
|
|
2129
|
+
diff,
|
|
2130
|
+
get,
|
|
2131
|
+
getCommandIds,
|
|
2132
|
+
set,
|
|
2133
|
+
wrapCommand} = create();
|
|
2134
|
+
|
|
2135
|
+
// TODO parentUid might ot be needed
|
|
2136
|
+
const create4 = (id, uri, x, y, width, height, args, parentUid, platform = 0, assetDir = '') => {
|
|
2137
|
+
const state = {
|
|
2138
|
+
credentialless: true,
|
|
2139
|
+
csp: '',
|
|
2140
|
+
height,
|
|
2141
|
+
id,
|
|
2142
|
+
iframeSrc: '',
|
|
2143
|
+
origin: '',
|
|
2144
|
+
portId: 0,
|
|
2145
|
+
previewServerId: 1,
|
|
2146
|
+
sandbox: [],
|
|
2147
|
+
srcDoc: '',
|
|
2148
|
+
uri,
|
|
2149
|
+
width,
|
|
2150
|
+
x: x - 1,
|
|
2151
|
+
y
|
|
2152
|
+
};
|
|
2153
|
+
set(state.id, state, state);
|
|
2154
|
+
};
|
|
2155
|
+
|
|
2156
|
+
const isEqual = (oldState, newState) => {
|
|
2157
|
+
return oldState.iframeSrc === newState.iframeSrc;
|
|
2158
|
+
};
|
|
2159
|
+
|
|
2160
|
+
const RenderItems = 1;
|
|
2161
|
+
|
|
2162
|
+
const modules = [isEqual];
|
|
2163
|
+
const numbers = [RenderItems];
|
|
2164
|
+
|
|
2165
|
+
const diff2 = uid => {
|
|
2166
|
+
return diff(uid, modules, numbers);
|
|
2167
|
+
};
|
|
2168
|
+
|
|
2434
2169
|
const executeCommand = (method, ...params) => {
|
|
2435
2170
|
// @ts-ignore
|
|
2436
2171
|
return invoke$2('ExecuteExternalCommand.executeExternalCommand', method, ...params);
|
|
@@ -2460,7 +2195,7 @@ const handleMessagePort2 = async (port, rpcId) => {
|
|
|
2460
2195
|
messagePort: port
|
|
2461
2196
|
});
|
|
2462
2197
|
if (rpcId) {
|
|
2463
|
-
set$
|
|
2198
|
+
set$4(rpcId, rpc);
|
|
2464
2199
|
}
|
|
2465
2200
|
};
|
|
2466
2201
|
|
|
@@ -2472,7 +2207,67 @@ const initialize = async platform => {
|
|
|
2472
2207
|
await sendMessagePortToExtensionHostWorker(port, 0);
|
|
2473
2208
|
}
|
|
2474
2209
|
});
|
|
2475
|
-
set$
|
|
2210
|
+
set$3(rpc);
|
|
2211
|
+
};
|
|
2212
|
+
|
|
2213
|
+
const loadContent = async (state, savedState) => {
|
|
2214
|
+
// TODO load webview props and register protocol
|
|
2215
|
+
return {
|
|
2216
|
+
...state
|
|
2217
|
+
};
|
|
2218
|
+
};
|
|
2219
|
+
|
|
2220
|
+
const Div = 4;
|
|
2221
|
+
const Text = 12;
|
|
2222
|
+
|
|
2223
|
+
const text = data => {
|
|
2224
|
+
return {
|
|
2225
|
+
childCount: 0,
|
|
2226
|
+
text: data,
|
|
2227
|
+
type: Text
|
|
2228
|
+
};
|
|
2229
|
+
};
|
|
2230
|
+
|
|
2231
|
+
const renderItems = (oldState, newState) => {
|
|
2232
|
+
const {
|
|
2233
|
+
id
|
|
2234
|
+
} = newState;
|
|
2235
|
+
const dom = [{
|
|
2236
|
+
childCount: 1,
|
|
2237
|
+
type: Div
|
|
2238
|
+
}, text('hllo world')];
|
|
2239
|
+
return [SetDom2, id, dom];
|
|
2240
|
+
};
|
|
2241
|
+
|
|
2242
|
+
const getRenderer = diffType => {
|
|
2243
|
+
switch (diffType) {
|
|
2244
|
+
case RenderItems:
|
|
2245
|
+
return renderItems;
|
|
2246
|
+
default:
|
|
2247
|
+
throw new Error('unknown renderer');
|
|
2248
|
+
}
|
|
2249
|
+
};
|
|
2250
|
+
|
|
2251
|
+
const applyRender = (oldState, newState, diffResult) => {
|
|
2252
|
+
const commands = [];
|
|
2253
|
+
for (const item of diffResult) {
|
|
2254
|
+
const fn = getRenderer(item);
|
|
2255
|
+
const result = fn(oldState, newState);
|
|
2256
|
+
if (result.length > 0) {
|
|
2257
|
+
commands.push(result);
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
return commands;
|
|
2261
|
+
};
|
|
2262
|
+
|
|
2263
|
+
const render2 = (uid, diffResult) => {
|
|
2264
|
+
const {
|
|
2265
|
+
newState,
|
|
2266
|
+
oldState
|
|
2267
|
+
} = get(uid);
|
|
2268
|
+
set(uid, newState, newState);
|
|
2269
|
+
const commands = applyRender(oldState, newState, diffResult);
|
|
2270
|
+
return commands;
|
|
2476
2271
|
};
|
|
2477
2272
|
|
|
2478
2273
|
const saveState = async () => {
|
|
@@ -2505,10 +2300,15 @@ const commandMap = {
|
|
|
2505
2300
|
'Iframes.initialize': initialize,
|
|
2506
2301
|
'WebView.create2': create2,
|
|
2507
2302
|
'WebView.create3': create3,
|
|
2303
|
+
'WebView.create4': create4,
|
|
2304
|
+
'WebView.diff2': diff2,
|
|
2508
2305
|
'WebView.executeExternalCommand': executeCommand,
|
|
2306
|
+
'WebView.getCommandIds': getCommandIds,
|
|
2509
2307
|
'WebView.getSecret': getSecret,
|
|
2510
2308
|
'WebView.getWebViewInfo': getWebViewInfo,
|
|
2309
|
+
'WebView.loadContent': wrapCommand(loadContent),
|
|
2511
2310
|
'WebView.registerInterceptor': registerInterceptor,
|
|
2311
|
+
'WebView.render2': render2,
|
|
2512
2312
|
'WebView.saveState': saveState,
|
|
2513
2313
|
'WebView.unregisterInterceptor': unregisterInterceptor
|
|
2514
2314
|
};
|
|
@@ -2517,7 +2317,7 @@ const listen = async () => {
|
|
|
2517
2317
|
const rpc = await WebWorkerRpcClient.create({
|
|
2518
2318
|
commandMap: commandMap
|
|
2519
2319
|
});
|
|
2520
|
-
set$
|
|
2320
|
+
set$2(rpc);
|
|
2521
2321
|
};
|
|
2522
2322
|
|
|
2523
2323
|
const main = async () => {
|