@lvce-editor/output-view 1.7.0 → 1.9.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/outputViewWorkerMain.js +363 -379
- package/package.json +1 -1
|
@@ -368,9 +368,103 @@ const IpcChildWithModuleWorkerAndMessagePort$1 = {
|
|
|
368
368
|
listen: listen$6,
|
|
369
369
|
wrap: wrap$e
|
|
370
370
|
};
|
|
371
|
+
const addListener = (emitter, type, callback) => {
|
|
372
|
+
if ('addEventListener' in emitter) {
|
|
373
|
+
emitter.addEventListener(type, callback);
|
|
374
|
+
} else {
|
|
375
|
+
emitter.on(type, callback);
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
const removeListener = (emitter, type, callback) => {
|
|
379
|
+
if ('removeEventListener' in emitter) {
|
|
380
|
+
emitter.removeEventListener(type, callback);
|
|
381
|
+
} else {
|
|
382
|
+
emitter.off(type, callback);
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
const getFirstEvent = (eventEmitter, eventMap) => {
|
|
386
|
+
const {
|
|
387
|
+
resolve,
|
|
388
|
+
promise
|
|
389
|
+
} = Promise.withResolvers();
|
|
390
|
+
const listenerMap = Object.create(null);
|
|
391
|
+
const cleanup = value => {
|
|
392
|
+
for (const event of Object.keys(eventMap)) {
|
|
393
|
+
removeListener(eventEmitter, event, listenerMap[event]);
|
|
394
|
+
}
|
|
395
|
+
resolve(value);
|
|
396
|
+
};
|
|
397
|
+
for (const [event, type] of Object.entries(eventMap)) {
|
|
398
|
+
const listener = event => {
|
|
399
|
+
cleanup({
|
|
400
|
+
type,
|
|
401
|
+
event
|
|
402
|
+
});
|
|
403
|
+
};
|
|
404
|
+
addListener(eventEmitter, event, listener);
|
|
405
|
+
listenerMap[event] = listener;
|
|
406
|
+
}
|
|
407
|
+
return promise;
|
|
408
|
+
};
|
|
409
|
+
const Message$1 = 3;
|
|
410
|
+
const create$5$1 = async ({
|
|
411
|
+
messagePort,
|
|
412
|
+
isMessagePortOpen
|
|
413
|
+
}) => {
|
|
414
|
+
if (!isMessagePort(messagePort)) {
|
|
415
|
+
throw new IpcError('port must be of type MessagePort');
|
|
416
|
+
}
|
|
417
|
+
if (isMessagePortOpen) {
|
|
418
|
+
return messagePort;
|
|
419
|
+
}
|
|
420
|
+
const eventPromise = getFirstEvent(messagePort, {
|
|
421
|
+
message: Message$1
|
|
422
|
+
});
|
|
423
|
+
messagePort.start();
|
|
424
|
+
const {
|
|
425
|
+
type,
|
|
426
|
+
event
|
|
427
|
+
} = await eventPromise;
|
|
428
|
+
if (type !== Message$1) {
|
|
429
|
+
throw new IpcError('Failed to wait for ipc message');
|
|
430
|
+
}
|
|
431
|
+
if (event.data !== readyMessage) {
|
|
432
|
+
throw new IpcError('unexpected first message');
|
|
433
|
+
}
|
|
434
|
+
return messagePort;
|
|
435
|
+
};
|
|
436
|
+
const signal$1 = messagePort => {
|
|
437
|
+
messagePort.start();
|
|
438
|
+
};
|
|
439
|
+
class IpcParentWithMessagePort extends Ipc {
|
|
440
|
+
getData = getData$2;
|
|
441
|
+
send(message) {
|
|
442
|
+
this._rawIpc.postMessage(message);
|
|
443
|
+
}
|
|
444
|
+
sendAndTransfer(message) {
|
|
445
|
+
const transfer = getTransferrables(message);
|
|
446
|
+
this._rawIpc.postMessage(message, transfer);
|
|
447
|
+
}
|
|
448
|
+
dispose() {
|
|
449
|
+
this._rawIpc.close();
|
|
450
|
+
}
|
|
451
|
+
onMessage(callback) {
|
|
452
|
+
this._rawIpc.addEventListener('message', callback);
|
|
453
|
+
}
|
|
454
|
+
onClose(callback) {}
|
|
455
|
+
}
|
|
456
|
+
const wrap$5 = messagePort => {
|
|
457
|
+
return new IpcParentWithMessagePort(messagePort);
|
|
458
|
+
};
|
|
459
|
+
const IpcParentWithMessagePort$1 = {
|
|
460
|
+
__proto__: null,
|
|
461
|
+
create: create$5$1,
|
|
462
|
+
signal: signal$1,
|
|
463
|
+
wrap: wrap$5
|
|
464
|
+
};
|
|
371
465
|
|
|
372
466
|
const Two = '2.0';
|
|
373
|
-
const create$4 = (method, params) => {
|
|
467
|
+
const create$4$1 = (method, params) => {
|
|
374
468
|
return {
|
|
375
469
|
jsonrpc: Two,
|
|
376
470
|
method,
|
|
@@ -378,7 +472,7 @@ const create$4 = (method, params) => {
|
|
|
378
472
|
};
|
|
379
473
|
};
|
|
380
474
|
const callbacks = Object.create(null);
|
|
381
|
-
const set$
|
|
475
|
+
const set$5 = (id, fn) => {
|
|
382
476
|
callbacks[id] = fn;
|
|
383
477
|
};
|
|
384
478
|
const get$2 = id => {
|
|
@@ -397,7 +491,7 @@ const registerPromise = () => {
|
|
|
397
491
|
resolve,
|
|
398
492
|
promise
|
|
399
493
|
} = Promise.withResolvers();
|
|
400
|
-
set$
|
|
494
|
+
set$5(id, resolve);
|
|
401
495
|
return {
|
|
402
496
|
id,
|
|
403
497
|
promise
|
|
@@ -625,7 +719,7 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
625
719
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
626
720
|
return create$1$1(id, errorProperty);
|
|
627
721
|
};
|
|
628
|
-
const create$
|
|
722
|
+
const create$6 = (message, result) => {
|
|
629
723
|
return {
|
|
630
724
|
jsonrpc: Two,
|
|
631
725
|
id: message.id,
|
|
@@ -634,7 +728,7 @@ const create$5 = (message, result) => {
|
|
|
634
728
|
};
|
|
635
729
|
const getSuccessResponse = (message, result) => {
|
|
636
730
|
const resultProperty = result ?? null;
|
|
637
|
-
return create$
|
|
731
|
+
return create$6(message, resultProperty);
|
|
638
732
|
};
|
|
639
733
|
const getErrorResponseSimple = (id, error) => {
|
|
640
734
|
return {
|
|
@@ -739,10 +833,10 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
739
833
|
return unwrapJsonRpcResult(responseMessage);
|
|
740
834
|
};
|
|
741
835
|
const send = (transport, method, ...params) => {
|
|
742
|
-
const message = create$4(method, params);
|
|
836
|
+
const message = create$4$1(method, params);
|
|
743
837
|
transport.send(message);
|
|
744
838
|
};
|
|
745
|
-
const invoke = (ipc, method, ...params) => {
|
|
839
|
+
const invoke$1 = (ipc, method, ...params) => {
|
|
746
840
|
return invokeHelper(ipc, method, params, false);
|
|
747
841
|
};
|
|
748
842
|
const invokeAndTransfer = (ipc, method, ...params) => {
|
|
@@ -781,7 +875,7 @@ const createRpc = ipc => {
|
|
|
781
875
|
send(ipc, method, ...params);
|
|
782
876
|
},
|
|
783
877
|
invoke(method, ...params) {
|
|
784
|
-
return invoke(ipc, method, ...params);
|
|
878
|
+
return invoke$1(ipc, method, ...params);
|
|
785
879
|
},
|
|
786
880
|
invokeAndTransfer(method, ...params) {
|
|
787
881
|
return invokeAndTransfer(ipc, method, ...params);
|
|
@@ -822,7 +916,41 @@ const listen$1 = async (module, options) => {
|
|
|
822
916
|
const ipc = module.wrap(rawIpc);
|
|
823
917
|
return ipc;
|
|
824
918
|
};
|
|
919
|
+
const create$5 = async ({
|
|
920
|
+
commandMap,
|
|
921
|
+
messagePort
|
|
922
|
+
}) => {
|
|
923
|
+
// TODO create a commandMap per rpc instance
|
|
924
|
+
register(commandMap);
|
|
925
|
+
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
926
|
+
messagePort,
|
|
927
|
+
isMessagePortOpen: true
|
|
928
|
+
});
|
|
929
|
+
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
930
|
+
handleIpc(ipc);
|
|
931
|
+
const rpc = createRpc(ipc);
|
|
932
|
+
messagePort.start();
|
|
933
|
+
return rpc;
|
|
934
|
+
};
|
|
825
935
|
const create$3 = async ({
|
|
936
|
+
commandMap,
|
|
937
|
+
send
|
|
938
|
+
}) => {
|
|
939
|
+
const {
|
|
940
|
+
port1,
|
|
941
|
+
port2
|
|
942
|
+
} = new MessageChannel();
|
|
943
|
+
await send(port1);
|
|
944
|
+
return create$5({
|
|
945
|
+
commandMap,
|
|
946
|
+
messagePort: port2
|
|
947
|
+
});
|
|
948
|
+
};
|
|
949
|
+
const TransferMessagePortRpcParent = {
|
|
950
|
+
__proto__: null,
|
|
951
|
+
create: create$3
|
|
952
|
+
};
|
|
953
|
+
const create$4 = async ({
|
|
826
954
|
commandMap
|
|
827
955
|
}) => {
|
|
828
956
|
// TODO create a commandMap per rpc instance
|
|
@@ -834,7 +962,7 @@ const create$3 = async ({
|
|
|
834
962
|
};
|
|
835
963
|
const WebWorkerRpcClient = {
|
|
836
964
|
__proto__: null,
|
|
837
|
-
create: create$
|
|
965
|
+
create: create$4
|
|
838
966
|
};
|
|
839
967
|
|
|
840
968
|
const toCommandId$1 = key => {
|
|
@@ -933,12 +1061,12 @@ const Script = 2;
|
|
|
933
1061
|
|
|
934
1062
|
const {
|
|
935
1063
|
get: get$1,
|
|
936
|
-
set: set$
|
|
1064
|
+
set: set$4,
|
|
937
1065
|
wrapCommand,
|
|
938
1066
|
wrapGetter
|
|
939
1067
|
} = create$2();
|
|
940
1068
|
|
|
941
|
-
const create$1 = (id, uri, x, y, width, height,
|
|
1069
|
+
const create$1 = (id, uri, x, y, width, height, platform) => {
|
|
942
1070
|
const state = {
|
|
943
1071
|
uid: id,
|
|
944
1072
|
uri,
|
|
@@ -957,13 +1085,15 @@ const create$1 = (id, uri, x, y, width, height, workspaceUri) => {
|
|
|
957
1085
|
collapsedUris: [],
|
|
958
1086
|
selectedOption: '',
|
|
959
1087
|
smallWidthBreakPoint: 650,
|
|
960
|
-
workspaceUri,
|
|
1088
|
+
workspaceUri: '',
|
|
961
1089
|
options: [],
|
|
962
1090
|
error: '',
|
|
963
1091
|
errorCode: 0,
|
|
964
|
-
buttons: []
|
|
1092
|
+
buttons: [],
|
|
1093
|
+
filteredItems: [],
|
|
1094
|
+
platform
|
|
965
1095
|
};
|
|
966
|
-
set$
|
|
1096
|
+
set$4(id, state, state);
|
|
967
1097
|
};
|
|
968
1098
|
|
|
969
1099
|
const isEqual$1 = (oldState, newState) => {
|
|
@@ -1070,7 +1200,7 @@ const text = data => {
|
|
|
1070
1200
|
|
|
1071
1201
|
const FocusProblems = 19;
|
|
1072
1202
|
|
|
1073
|
-
const getKeyBindings
|
|
1203
|
+
const getKeyBindings = () => {
|
|
1074
1204
|
return [{
|
|
1075
1205
|
key: KeyCode.DownArrow,
|
|
1076
1206
|
command: 'Problems.focusNext',
|
|
@@ -1118,34 +1248,6 @@ const getKeyBindings$1 = () => {
|
|
|
1118
1248
|
}];
|
|
1119
1249
|
};
|
|
1120
1250
|
|
|
1121
|
-
const handleButtonClick = async (state, name) => {
|
|
1122
|
-
// TODO
|
|
1123
|
-
return {
|
|
1124
|
-
...state
|
|
1125
|
-
};
|
|
1126
|
-
};
|
|
1127
|
-
|
|
1128
|
-
const handleData = async state => {
|
|
1129
|
-
// TODO
|
|
1130
|
-
return {
|
|
1131
|
-
...state
|
|
1132
|
-
};
|
|
1133
|
-
};
|
|
1134
|
-
|
|
1135
|
-
const handleError = async state => {
|
|
1136
|
-
// TODO
|
|
1137
|
-
return {
|
|
1138
|
-
...state
|
|
1139
|
-
};
|
|
1140
|
-
};
|
|
1141
|
-
|
|
1142
|
-
const handleFilterInput = async (state, value) => {
|
|
1143
|
-
return {
|
|
1144
|
-
...state,
|
|
1145
|
-
filterValue: value
|
|
1146
|
-
};
|
|
1147
|
-
};
|
|
1148
|
-
|
|
1149
1251
|
const rpcs = Object.create(null);
|
|
1150
1252
|
const set$g = (id, rpc) => {
|
|
1151
1253
|
rpcs[id] = rpc;
|
|
@@ -1179,336 +1281,55 @@ const create = rpcId => {
|
|
|
1179
1281
|
}
|
|
1180
1282
|
};
|
|
1181
1283
|
};
|
|
1182
|
-
const
|
|
1284
|
+
const ExtensionHostWorker = 44;
|
|
1183
1285
|
const RendererWorker$1 = 1;
|
|
1286
|
+
const FileSystemWorker$1 = 209;
|
|
1184
1287
|
const {
|
|
1185
|
-
invoke: invoke$
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
return invoke$3('ExtensionHost.searchFileWithHtml', uri);
|
|
1192
|
-
};
|
|
1193
|
-
const getFilePathElectron = async file => {
|
|
1194
|
-
return invoke$3('FileSystemHandle.getFilePathElectron', file);
|
|
1195
|
-
};
|
|
1196
|
-
const showContextMenu = async (x, y, id, ...args) => {
|
|
1197
|
-
return invoke$3('ContextMenu.show', x, y, id, ...args);
|
|
1198
|
-
};
|
|
1199
|
-
const getElectronVersion = async () => {
|
|
1200
|
-
return invoke$3('Process.getElectronVersion');
|
|
1201
|
-
};
|
|
1202
|
-
const applyBulkReplacement = async bulkEdits => {
|
|
1203
|
-
await invoke$3('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
1204
|
-
};
|
|
1205
|
-
const setColorTheme = async id => {
|
|
1206
|
-
// @ts-ignore
|
|
1207
|
-
return invoke$3(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1208
|
-
};
|
|
1209
|
-
const getNodeVersion = async () => {
|
|
1210
|
-
return invoke$3('Process.getNodeVersion');
|
|
1211
|
-
};
|
|
1212
|
-
const getChromeVersion = async () => {
|
|
1213
|
-
return invoke$3('Process.getChromeVersion');
|
|
1214
|
-
};
|
|
1215
|
-
const getV8Version = async () => {
|
|
1216
|
-
return invoke$3('Process.getV8Version');
|
|
1217
|
-
};
|
|
1218
|
-
const getFileHandles = async fileIds => {
|
|
1219
|
-
const files = await invoke$3('FileSystemHandle.getFileHandles', fileIds);
|
|
1220
|
-
return files;
|
|
1221
|
-
};
|
|
1222
|
-
const setWorkspacePath = async path => {
|
|
1223
|
-
await invoke$3('Workspace.setPath', path);
|
|
1224
|
-
};
|
|
1225
|
-
const registerWebViewInterceptor = async (id, port) => {
|
|
1226
|
-
await invokeAndTransfer$3('WebView.registerInterceptor', id, port);
|
|
1227
|
-
};
|
|
1228
|
-
const unregisterWebViewInterceptor = async id => {
|
|
1229
|
-
await invoke$3('WebView.unregisterInterceptor', id);
|
|
1288
|
+
invoke: invoke$9,
|
|
1289
|
+
set: set$9} = create(ExtensionHostWorker);
|
|
1290
|
+
const ExtensionHost = {
|
|
1291
|
+
__proto__: null,
|
|
1292
|
+
invoke: invoke$9,
|
|
1293
|
+
set: set$9
|
|
1230
1294
|
};
|
|
1231
|
-
const
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1295
|
+
const {
|
|
1296
|
+
invoke: invoke$7,
|
|
1297
|
+
set: set$7} = create(FileSystemWorker$1);
|
|
1298
|
+
const readFile$1 = async uri => {
|
|
1299
|
+
return invoke$7('FileSystem.readFile', uri);
|
|
1235
1300
|
};
|
|
1236
|
-
const
|
|
1237
|
-
|
|
1238
|
-
// @ts-ignore
|
|
1239
|
-
await invokeAndTransfer$3('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
1301
|
+
const writeFile$1 = async (uri, content) => {
|
|
1302
|
+
return invoke$7('FileSystem.writeFile', uri, content);
|
|
1240
1303
|
};
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1304
|
+
const FileSystemWorker = {
|
|
1305
|
+
__proto__: null,
|
|
1306
|
+
readFile: readFile$1,
|
|
1307
|
+
set: set$7,
|
|
1308
|
+
writeFile: writeFile$1
|
|
1245
1309
|
};
|
|
1246
|
-
const
|
|
1310
|
+
const {
|
|
1311
|
+
invokeAndTransfer: invokeAndTransfer$3,
|
|
1312
|
+
set: set$3} = create(RendererWorker$1);
|
|
1313
|
+
const sendMessagePortToFileSystemWorker$2 = async (port, rpcId) => {
|
|
1247
1314
|
const command = 'FileSystem.handleMessagePort';
|
|
1248
1315
|
// @ts-ignore
|
|
1249
1316
|
await invokeAndTransfer$3('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
|
|
1250
1317
|
};
|
|
1251
|
-
const
|
|
1252
|
-
return invoke$3('FileSystem.readFile', uri);
|
|
1253
|
-
};
|
|
1254
|
-
const getWebViewSecret = async key => {
|
|
1255
|
-
// @ts-ignore
|
|
1256
|
-
return invoke$3('WebView.getSecret', key);
|
|
1257
|
-
};
|
|
1258
|
-
const setWebViewPort = async (uid, port, origin, portType) => {
|
|
1259
|
-
return invokeAndTransfer$3('WebView.setPort', uid, port, origin, portType);
|
|
1260
|
-
};
|
|
1261
|
-
const setFocus = key => {
|
|
1262
|
-
return invoke$3('Focus.setFocus', key);
|
|
1263
|
-
};
|
|
1264
|
-
const getFileIcon = async options => {
|
|
1265
|
-
return invoke$3('IconTheme.getFileIcon', options);
|
|
1266
|
-
};
|
|
1267
|
-
const getColorThemeNames = async () => {
|
|
1268
|
-
return invoke$3('ColorTheme.getColorThemeNames');
|
|
1269
|
-
};
|
|
1270
|
-
const disableExtension = async id => {
|
|
1271
|
-
return invoke$3('ExtensionManagement.disable', id);
|
|
1272
|
-
};
|
|
1273
|
-
const enableExtension = async id => {
|
|
1274
|
-
// @ts-ignore
|
|
1275
|
-
return invoke$3('ExtensionManagement.enable', id);
|
|
1276
|
-
};
|
|
1277
|
-
const handleDebugChange = async params => {
|
|
1278
|
-
// @ts-ignore
|
|
1279
|
-
return invoke$3('Run And Debug.handleChange', params);
|
|
1280
|
-
};
|
|
1281
|
-
const getFolderIcon = async options => {
|
|
1282
|
-
return invoke$3('IconTheme.getFolderIcon', options);
|
|
1283
|
-
};
|
|
1284
|
-
const closeWidget = async widgetId => {
|
|
1285
|
-
return invoke$3('Viewlet.closeWidget', widgetId);
|
|
1286
|
-
};
|
|
1287
|
-
const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
1318
|
+
const sendMessagePortToExtensionHostWorker$1 = async (port, rpcId = 0) => {
|
|
1288
1319
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1289
1320
|
await invokeAndTransfer$3('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1290
1321
|
};
|
|
1291
|
-
const sendMessagePortToSearchProcess = async port => {
|
|
1292
|
-
await invokeAndTransfer$3('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
1293
|
-
};
|
|
1294
|
-
const confirm = async (message, options) => {
|
|
1295
|
-
// @ts-ignore
|
|
1296
|
-
const result = await invoke$3('Confirmprompt.prompt', message, options);
|
|
1297
|
-
return result;
|
|
1298
|
-
};
|
|
1299
|
-
const getRecentlyOpened = async () => {
|
|
1300
|
-
return invoke$3(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
1301
|
-
};
|
|
1302
|
-
const getKeyBindings = async () => {
|
|
1303
|
-
return invoke$3('KeyBindingsInitial.getKeyBindings');
|
|
1304
|
-
};
|
|
1305
|
-
const writeClipBoardText = async text => {
|
|
1306
|
-
await invoke$3('ClipBoard.writeText', /* text */text);
|
|
1307
|
-
};
|
|
1308
|
-
const writeClipBoardImage = async blob => {
|
|
1309
|
-
// @ts-ignore
|
|
1310
|
-
await invoke$3('ClipBoard.writeImage', /* text */blob);
|
|
1311
|
-
};
|
|
1312
|
-
const searchFileMemory = async uri => {
|
|
1313
|
-
// @ts-ignore
|
|
1314
|
-
return invoke$3('ExtensionHost.searchFileWithMemory', uri);
|
|
1315
|
-
};
|
|
1316
|
-
const searchFileFetch = async uri => {
|
|
1317
|
-
return invoke$3('ExtensionHost.searchFileWithFetch', uri);
|
|
1318
|
-
};
|
|
1319
|
-
const showMessageBox = async options => {
|
|
1320
|
-
return invoke$3('ElectronDialog.showMessageBox', options);
|
|
1321
|
-
};
|
|
1322
|
-
const handleDebugResumed = async params => {
|
|
1323
|
-
await invoke$3('Run And Debug.handleResumed', params);
|
|
1324
|
-
};
|
|
1325
|
-
const openWidget = async name => {
|
|
1326
|
-
await invoke$3('Viewlet.openWidget', name);
|
|
1327
|
-
};
|
|
1328
|
-
const getIcons = async requests => {
|
|
1329
|
-
const icons = await invoke$3('IconTheme.getIcons', requests);
|
|
1330
|
-
return icons;
|
|
1331
|
-
};
|
|
1332
|
-
const activateByEvent = event => {
|
|
1333
|
-
return invoke$3('ExtensionHostManagement.activateByEvent', event);
|
|
1334
|
-
};
|
|
1335
|
-
const setAdditionalFocus = focusKey => {
|
|
1336
|
-
// @ts-ignore
|
|
1337
|
-
return invoke$3('Focus.setAdditionalFocus', focusKey);
|
|
1338
|
-
};
|
|
1339
|
-
const getActiveEditorId = () => {
|
|
1340
|
-
// @ts-ignore
|
|
1341
|
-
return invoke$3('GetActiveEditor.getActiveEditorId');
|
|
1342
|
-
};
|
|
1343
|
-
const getWorkspacePath = () => {
|
|
1344
|
-
return invoke$3('Workspace.getPath');
|
|
1345
|
-
};
|
|
1346
|
-
const sendMessagePortToRendererProcess = async port => {
|
|
1347
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1348
|
-
// @ts-ignore
|
|
1349
|
-
await invokeAndTransfer$3('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker$1);
|
|
1350
|
-
};
|
|
1351
|
-
const getPreference = async key => {
|
|
1352
|
-
return await invoke$3('Preferences.get', key);
|
|
1353
|
-
};
|
|
1354
|
-
const getAllExtensions = async () => {
|
|
1355
|
-
return invoke$3('ExtensionManagement.getAllExtensions');
|
|
1356
|
-
};
|
|
1357
|
-
const rerenderEditor = async key => {
|
|
1358
|
-
// @ts-ignore
|
|
1359
|
-
return invoke$3('Editor.rerender', key);
|
|
1360
|
-
};
|
|
1361
|
-
const handleDebugPaused = async params => {
|
|
1362
|
-
await invoke$3('Run And Debug.handlePaused', params);
|
|
1363
|
-
};
|
|
1364
|
-
const openUri = async (uri, focus, options) => {
|
|
1365
|
-
await invoke$3('Main.openUri', uri, focus, options);
|
|
1366
|
-
};
|
|
1367
|
-
const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
1368
|
-
await invokeAndTransfer$3(
|
|
1369
|
-
// @ts-ignore
|
|
1370
|
-
'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
|
|
1371
|
-
};
|
|
1372
|
-
const handleDebugScriptParsed = async script => {
|
|
1373
|
-
await invoke$3('Run And Debug.handleScriptParsed', script);
|
|
1374
|
-
};
|
|
1375
|
-
const getWindowId = async () => {
|
|
1376
|
-
return invoke$3('GetWindowId.getWindowId');
|
|
1377
|
-
};
|
|
1378
|
-
const getBlob = async uri => {
|
|
1379
|
-
// @ts-ignore
|
|
1380
|
-
return invoke$3('FileSystem.getBlob', uri);
|
|
1381
|
-
};
|
|
1382
|
-
const getExtensionCommands = async () => {
|
|
1383
|
-
return invoke$3('ExtensionHost.getCommands');
|
|
1384
|
-
};
|
|
1385
|
-
const showErrorDialog = async errorInfo => {
|
|
1386
|
-
// @ts-ignore
|
|
1387
|
-
await invoke$3('ErrorHandling.showErrorDialog', errorInfo);
|
|
1388
|
-
};
|
|
1389
|
-
const getFolderSize = async uri => {
|
|
1390
|
-
// @ts-ignore
|
|
1391
|
-
return await invoke$3('FileSystem.getFolderSize', uri);
|
|
1392
|
-
};
|
|
1393
|
-
const getExtension = async id => {
|
|
1394
|
-
// @ts-ignore
|
|
1395
|
-
return invoke$3('ExtensionManagement.getExtension', id);
|
|
1396
|
-
};
|
|
1397
|
-
const getMarkdownDom = async html => {
|
|
1398
|
-
// @ts-ignore
|
|
1399
|
-
return invoke$3('Markdown.getVirtualDom', html);
|
|
1400
|
-
};
|
|
1401
|
-
const renderMarkdown = async (markdown, options) => {
|
|
1402
|
-
// @ts-ignore
|
|
1403
|
-
return invoke$3('Markdown.renderMarkdown', markdown, options);
|
|
1404
|
-
};
|
|
1405
|
-
const openNativeFolder = async uri => {
|
|
1406
|
-
// @ts-ignore
|
|
1407
|
-
await invoke$3('OpenNativeFolder.openNativeFolder', uri);
|
|
1408
|
-
};
|
|
1409
|
-
const uninstallExtension = async id => {
|
|
1410
|
-
return invoke$3('ExtensionManagement.uninstall', id);
|
|
1411
|
-
};
|
|
1412
|
-
const installExtension = async id => {
|
|
1413
|
-
// @ts-ignore
|
|
1414
|
-
return invoke$3('ExtensionManagement.install', id);
|
|
1415
|
-
};
|
|
1416
|
-
const openExtensionSearch = async () => {
|
|
1417
|
-
// @ts-ignore
|
|
1418
|
-
return invoke$3('SideBar.openViewlet', 'Extensions');
|
|
1419
|
-
};
|
|
1420
|
-
const setExtensionsSearchValue = async searchValue => {
|
|
1421
|
-
// @ts-ignore
|
|
1422
|
-
return invoke$3('Extensions.handleInput', searchValue);
|
|
1423
|
-
};
|
|
1424
|
-
const openExternal = async uri => {
|
|
1425
|
-
// @ts-ignore
|
|
1426
|
-
await invoke$3('Open.openExternal', uri);
|
|
1427
|
-
};
|
|
1428
|
-
const openUrl = async uri => {
|
|
1429
|
-
// @ts-ignore
|
|
1430
|
-
await invoke$3('Open.openUrl', uri);
|
|
1431
|
-
};
|
|
1432
|
-
const getAllPreferences = async () => {
|
|
1433
|
-
// @ts-ignore
|
|
1434
|
-
return invoke$3('Preferences.getAll');
|
|
1435
|
-
};
|
|
1436
1322
|
const RendererWorker = {
|
|
1437
1323
|
__proto__: null,
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
enableExtension,
|
|
1445
|
-
getActiveEditorId,
|
|
1446
|
-
getAllExtensions,
|
|
1447
|
-
getAllPreferences,
|
|
1448
|
-
getBlob,
|
|
1449
|
-
getChromeVersion,
|
|
1450
|
-
getColorThemeNames,
|
|
1451
|
-
getElectronVersion,
|
|
1452
|
-
getExtension,
|
|
1453
|
-
getExtensionCommands,
|
|
1454
|
-
getFileHandles,
|
|
1455
|
-
getFileIcon,
|
|
1456
|
-
getFilePathElectron,
|
|
1457
|
-
getFolderIcon,
|
|
1458
|
-
getFolderSize,
|
|
1459
|
-
getIcons,
|
|
1460
|
-
getKeyBindings,
|
|
1461
|
-
getMarkdownDom,
|
|
1462
|
-
getNodeVersion,
|
|
1463
|
-
getPreference,
|
|
1464
|
-
getRecentlyOpened,
|
|
1465
|
-
getV8Version,
|
|
1466
|
-
getWebViewSecret,
|
|
1467
|
-
getWindowId,
|
|
1468
|
-
getWorkspacePath,
|
|
1469
|
-
handleDebugChange,
|
|
1470
|
-
handleDebugPaused,
|
|
1471
|
-
handleDebugResumed,
|
|
1472
|
-
handleDebugScriptParsed,
|
|
1473
|
-
installExtension,
|
|
1474
|
-
invoke: invoke$3,
|
|
1475
|
-
invokeAndTransfer: invokeAndTransfer$3,
|
|
1476
|
-
openExtensionSearch,
|
|
1477
|
-
openExternal,
|
|
1478
|
-
openNativeFolder,
|
|
1479
|
-
openUri,
|
|
1480
|
-
openUrl,
|
|
1481
|
-
openWidget,
|
|
1324
|
+
sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1,
|
|
1325
|
+
sendMessagePortToFileSystemWorker: sendMessagePortToFileSystemWorker$2,
|
|
1326
|
+
set: set$3};
|
|
1327
|
+
|
|
1328
|
+
const {
|
|
1329
|
+
set: set$2,
|
|
1482
1330
|
readFile,
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
rerenderEditor,
|
|
1486
|
-
searchFileFetch,
|
|
1487
|
-
searchFileHtml,
|
|
1488
|
-
searchFileMemory,
|
|
1489
|
-
sendMessagePortToEditorWorker,
|
|
1490
|
-
sendMessagePortToErrorWorker,
|
|
1491
|
-
sendMessagePortToExtensionHostWorker,
|
|
1492
|
-
sendMessagePortToFileSystemWorker,
|
|
1493
|
-
sendMessagePortToMarkdownWorker,
|
|
1494
|
-
sendMessagePortToRendererProcess,
|
|
1495
|
-
sendMessagePortToSearchProcess,
|
|
1496
|
-
sendMessagePortToSyntaxHighlightingWorker,
|
|
1497
|
-
set: set$3,
|
|
1498
|
-
setAdditionalFocus,
|
|
1499
|
-
setColorTheme,
|
|
1500
|
-
setExtensionsSearchValue,
|
|
1501
|
-
setFocus,
|
|
1502
|
-
setWebViewPort,
|
|
1503
|
-
setWorkspacePath,
|
|
1504
|
-
showContextMenu,
|
|
1505
|
-
showErrorDialog,
|
|
1506
|
-
showMessageBox,
|
|
1507
|
-
uninstallExtension,
|
|
1508
|
-
unregisterWebViewInterceptor,
|
|
1509
|
-
writeClipBoardImage,
|
|
1510
|
-
writeClipBoardText
|
|
1511
|
-
};
|
|
1331
|
+
writeFile
|
|
1332
|
+
} = FileSystemWorker;
|
|
1512
1333
|
|
|
1513
1334
|
const isFileNotFoundError = error => {
|
|
1514
1335
|
return error.message.includes('File not found');
|
|
@@ -1517,7 +1338,7 @@ const isFileNotFoundError = error => {
|
|
|
1517
1338
|
const loadLines = async uri => {
|
|
1518
1339
|
try {
|
|
1519
1340
|
// TODO use log stream, updating the output when the file is changed
|
|
1520
|
-
const content = await
|
|
1341
|
+
const content = await readFile(uri);
|
|
1521
1342
|
const lines = content.split('\n');
|
|
1522
1343
|
return {
|
|
1523
1344
|
error: '',
|
|
@@ -1540,6 +1361,90 @@ const loadLines = async uri => {
|
|
|
1540
1361
|
}
|
|
1541
1362
|
};
|
|
1542
1363
|
|
|
1364
|
+
const clear = async state => {
|
|
1365
|
+
const {
|
|
1366
|
+
selectedOption,
|
|
1367
|
+
options
|
|
1368
|
+
} = state;
|
|
1369
|
+
const option = options.find(option => option.id === selectedOption);
|
|
1370
|
+
if (!option) {
|
|
1371
|
+
return state;
|
|
1372
|
+
}
|
|
1373
|
+
const {
|
|
1374
|
+
uri
|
|
1375
|
+
} = option;
|
|
1376
|
+
await writeFile(uri, '');
|
|
1377
|
+
const {
|
|
1378
|
+
lines,
|
|
1379
|
+
code,
|
|
1380
|
+
error
|
|
1381
|
+
} = await loadLines(uri);
|
|
1382
|
+
return {
|
|
1383
|
+
...state,
|
|
1384
|
+
listItems: lines,
|
|
1385
|
+
error,
|
|
1386
|
+
errorCode: code
|
|
1387
|
+
};
|
|
1388
|
+
};
|
|
1389
|
+
|
|
1390
|
+
const Filter = 'filter';
|
|
1391
|
+
const Output$2 = 'output';
|
|
1392
|
+
const MainProcess = 'MainProcess';
|
|
1393
|
+
const SharedProcess = 'SharedProcess';
|
|
1394
|
+
const Clear = 'Clear';
|
|
1395
|
+
const Settings = 'Settings';
|
|
1396
|
+
const ScrollLock = 'ScrollLock';
|
|
1397
|
+
|
|
1398
|
+
const noop = async state => {
|
|
1399
|
+
return state;
|
|
1400
|
+
};
|
|
1401
|
+
const getClickHandler = name => {
|
|
1402
|
+
switch (name) {
|
|
1403
|
+
case Clear:
|
|
1404
|
+
return clear;
|
|
1405
|
+
default:
|
|
1406
|
+
return noop;
|
|
1407
|
+
}
|
|
1408
|
+
};
|
|
1409
|
+
|
|
1410
|
+
const handleButtonClick = async (state, name) => {
|
|
1411
|
+
const fn = getClickHandler(name);
|
|
1412
|
+
return fn(state);
|
|
1413
|
+
};
|
|
1414
|
+
|
|
1415
|
+
const handleData = async state => {
|
|
1416
|
+
// TODO
|
|
1417
|
+
return {
|
|
1418
|
+
...state
|
|
1419
|
+
};
|
|
1420
|
+
};
|
|
1421
|
+
|
|
1422
|
+
const handleError = async state => {
|
|
1423
|
+
// TODO
|
|
1424
|
+
return {
|
|
1425
|
+
...state
|
|
1426
|
+
};
|
|
1427
|
+
};
|
|
1428
|
+
|
|
1429
|
+
const filterItems = (items, filterValue) => {
|
|
1430
|
+
if (!filterValue) {
|
|
1431
|
+
return items;
|
|
1432
|
+
}
|
|
1433
|
+
return items.filter(item => item.includes(filterValue));
|
|
1434
|
+
};
|
|
1435
|
+
|
|
1436
|
+
const handleFilterInput = async (state, value) => {
|
|
1437
|
+
const {
|
|
1438
|
+
listItems
|
|
1439
|
+
} = state;
|
|
1440
|
+
const filteredItems = filterItems(listItems, value);
|
|
1441
|
+
return {
|
|
1442
|
+
...state,
|
|
1443
|
+
filterValue: value,
|
|
1444
|
+
filteredItems: filteredItems
|
|
1445
|
+
};
|
|
1446
|
+
};
|
|
1447
|
+
|
|
1543
1448
|
const handleSelect = async (state, id) => {
|
|
1544
1449
|
const {
|
|
1545
1450
|
options
|
|
@@ -1562,34 +1467,102 @@ const handleSelect = async (state, id) => {
|
|
|
1562
1467
|
};
|
|
1563
1468
|
};
|
|
1564
1469
|
|
|
1565
|
-
const
|
|
1470
|
+
const {
|
|
1471
|
+
sendMessagePortToExtensionHostWorker,
|
|
1472
|
+
sendMessagePortToFileSystemWorker: sendMessagePortToFileSystemWorker$1,
|
|
1473
|
+
set: set$1} = RendererWorker;
|
|
1474
|
+
|
|
1475
|
+
const sendMessagePortToExtensionHostWorker2 = async port => {
|
|
1476
|
+
await sendMessagePortToExtensionHostWorker(port);
|
|
1477
|
+
};
|
|
1478
|
+
|
|
1479
|
+
const createExtensionHostRpc = async () => {
|
|
1480
|
+
try {
|
|
1481
|
+
const rpc = await TransferMessagePortRpcParent.create({
|
|
1482
|
+
commandMap: {},
|
|
1483
|
+
send: sendMessagePortToExtensionHostWorker2
|
|
1484
|
+
});
|
|
1485
|
+
return rpc;
|
|
1486
|
+
} catch (error) {
|
|
1487
|
+
throw new VError(error, `Failed to create extension host rpc`);
|
|
1488
|
+
}
|
|
1489
|
+
};
|
|
1490
|
+
|
|
1491
|
+
const {
|
|
1492
|
+
set,
|
|
1493
|
+
invoke} = ExtensionHost;
|
|
1494
|
+
|
|
1495
|
+
const initializeExtensionHost = async () => {
|
|
1496
|
+
const extensionHostRpc = await createExtensionHostRpc();
|
|
1497
|
+
set(extensionHostRpc);
|
|
1498
|
+
};
|
|
1499
|
+
|
|
1500
|
+
const sendMessagePortToFileSystemWorker = async port => {
|
|
1501
|
+
await sendMessagePortToFileSystemWorker$1(port, 0);
|
|
1502
|
+
};
|
|
1503
|
+
|
|
1504
|
+
const createFileSystemWorkerRpc = async () => {
|
|
1505
|
+
try {
|
|
1506
|
+
const rpc = await TransferMessagePortRpcParent.create({
|
|
1507
|
+
commandMap: {},
|
|
1508
|
+
send: sendMessagePortToFileSystemWorker
|
|
1509
|
+
});
|
|
1510
|
+
return rpc;
|
|
1511
|
+
} catch (error) {
|
|
1512
|
+
throw new VError(error, `Failed to create file system worker rpc`);
|
|
1513
|
+
}
|
|
1514
|
+
};
|
|
1515
|
+
|
|
1516
|
+
const initializeFileSystemWorker = async () => {
|
|
1517
|
+
const rpc = await createFileSystemWorkerRpc();
|
|
1518
|
+
set$2(rpc);
|
|
1519
|
+
};
|
|
1520
|
+
|
|
1521
|
+
const initialize = async () => {
|
|
1522
|
+
await Promise.all([initializeFileSystemWorker(), initializeExtensionHost()]);
|
|
1523
|
+
};
|
|
1524
|
+
|
|
1525
|
+
const Web = 1;
|
|
1566
1526
|
|
|
1567
1527
|
const getSelectedItem = platform => {
|
|
1568
|
-
|
|
1528
|
+
if (platform === Web) {
|
|
1529
|
+
return '';
|
|
1530
|
+
}
|
|
1531
|
+
return MainProcess;
|
|
1569
1532
|
};
|
|
1570
1533
|
|
|
1571
1534
|
const loadButtons = () => {
|
|
1572
1535
|
return [{
|
|
1573
|
-
id:
|
|
1536
|
+
id: Clear,
|
|
1574
1537
|
label: 'Clear',
|
|
1575
1538
|
icon: 'MaskIconClearAll'
|
|
1576
1539
|
}, {
|
|
1577
|
-
id:
|
|
1540
|
+
id: ScrollLock,
|
|
1578
1541
|
label: 'Scroll Lock',
|
|
1579
1542
|
icon: 'MaskIconListFlat'
|
|
1580
1543
|
}, {
|
|
1581
|
-
id:
|
|
1544
|
+
id: Settings,
|
|
1582
1545
|
label: 'Settings',
|
|
1583
1546
|
icon: 'MaskIconListFlat'
|
|
1584
1547
|
}];
|
|
1585
1548
|
};
|
|
1586
1549
|
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
const
|
|
1550
|
+
const getExtensionOptions = async () => {
|
|
1551
|
+
try {
|
|
1552
|
+
// @ts-ignore
|
|
1553
|
+
const channels = await invoke('ExtensionHost.getOutputChannels');
|
|
1554
|
+
return channels;
|
|
1555
|
+
} catch {
|
|
1556
|
+
return [];
|
|
1557
|
+
}
|
|
1558
|
+
};
|
|
1591
1559
|
|
|
1560
|
+
// TODO load options from extensions
|
|
1592
1561
|
const loadOptions = async platform => {
|
|
1562
|
+
const extensionOptions = await getExtensionOptions();
|
|
1563
|
+
if (platform === Web) {
|
|
1564
|
+
return extensionOptions;
|
|
1565
|
+
}
|
|
1593
1566
|
return [{
|
|
1594
1567
|
id: MainProcess,
|
|
1595
1568
|
label: 'Main Process',
|
|
@@ -1598,7 +1571,7 @@ const loadOptions = async platform => {
|
|
|
1598
1571
|
id: SharedProcess,
|
|
1599
1572
|
label: 'Shared Process',
|
|
1600
1573
|
uri: 'file:///tmp/log-shared-process.txt'
|
|
1601
|
-
}];
|
|
1574
|
+
}, ...extensionOptions];
|
|
1602
1575
|
};
|
|
1603
1576
|
|
|
1604
1577
|
const isString = value => {
|
|
@@ -1610,15 +1583,28 @@ const getSavedCollapsedUris = savedState => {
|
|
|
1610
1583
|
}
|
|
1611
1584
|
return [];
|
|
1612
1585
|
};
|
|
1586
|
+
const getMatchingOpen = (options, id) => {
|
|
1587
|
+
return options.find(option => option.id === id) || options[0];
|
|
1588
|
+
};
|
|
1613
1589
|
const loadContent = async (state, savedState) => {
|
|
1590
|
+
const {
|
|
1591
|
+
platform
|
|
1592
|
+
} = state;
|
|
1614
1593
|
const collapsedUris = getSavedCollapsedUris(savedState);
|
|
1615
|
-
const
|
|
1616
|
-
const options = await loadOptions();
|
|
1594
|
+
const selectedId = getSelectedItem(platform);
|
|
1595
|
+
const options = await loadOptions(platform);
|
|
1596
|
+
const option = getMatchingOpen(options, selectedId);
|
|
1597
|
+
if (!option) {
|
|
1598
|
+
throw new Error('option not found');
|
|
1599
|
+
}
|
|
1600
|
+
const {
|
|
1601
|
+
uri
|
|
1602
|
+
} = option;
|
|
1617
1603
|
const {
|
|
1618
1604
|
lines,
|
|
1619
1605
|
error,
|
|
1620
1606
|
code
|
|
1621
|
-
} = await loadLines(
|
|
1607
|
+
} = await loadLines(uri);
|
|
1622
1608
|
const buttons = loadButtons();
|
|
1623
1609
|
return {
|
|
1624
1610
|
...state,
|
|
@@ -1627,8 +1613,9 @@ const loadContent = async (state, savedState) => {
|
|
|
1627
1613
|
errorCode: code,
|
|
1628
1614
|
inputSource: Script,
|
|
1629
1615
|
listItems: lines,
|
|
1616
|
+
filteredItems: lines,
|
|
1630
1617
|
options,
|
|
1631
|
-
selectedOption:
|
|
1618
|
+
selectedOption: selectedId,
|
|
1632
1619
|
buttons
|
|
1633
1620
|
};
|
|
1634
1621
|
};
|
|
@@ -1778,7 +1765,7 @@ const getOutputVirtualDom = (lines, errorCode, error) => {
|
|
|
1778
1765
|
};
|
|
1779
1766
|
|
|
1780
1767
|
const renderItems = (oldState, newState) => {
|
|
1781
|
-
const dom = getOutputVirtualDom(newState.
|
|
1768
|
+
const dom = getOutputVirtualDom(newState.filteredItems, newState.errorCode, newState.error);
|
|
1782
1769
|
return ['Viewlet.setDom2', dom];
|
|
1783
1770
|
};
|
|
1784
1771
|
|
|
@@ -1807,7 +1794,7 @@ const render2 = (uid, diffResult) => {
|
|
|
1807
1794
|
oldState,
|
|
1808
1795
|
newState
|
|
1809
1796
|
} = get$1(uid);
|
|
1810
|
-
set$
|
|
1797
|
+
set$4(uid, newState, newState);
|
|
1811
1798
|
const commands = applyRender(oldState, newState, diffResult);
|
|
1812
1799
|
return commands;
|
|
1813
1800
|
};
|
|
@@ -1963,7 +1950,7 @@ const commandMap = {
|
|
|
1963
1950
|
'Output.diff2': diff2,
|
|
1964
1951
|
'Output.focusIndex': wrapCommand(focusIndex),
|
|
1965
1952
|
'Output.getCommandIds': getCommandIds,
|
|
1966
|
-
'Output.getKeyBindings': getKeyBindings
|
|
1953
|
+
'Output.getKeyBindings': getKeyBindings,
|
|
1967
1954
|
'Output.handleData': wrapCommand(handleData),
|
|
1968
1955
|
'Output.handleError': wrapCommand(handleError),
|
|
1969
1956
|
'Output.initialize': initialize,
|
|
@@ -1982,15 +1969,12 @@ const commandMap = {
|
|
|
1982
1969
|
'Output.handleButtonClick': wrapCommand(handleButtonClick)
|
|
1983
1970
|
};
|
|
1984
1971
|
|
|
1985
|
-
const {
|
|
1986
|
-
set} = RendererWorker;
|
|
1987
|
-
|
|
1988
1972
|
const listen = async () => {
|
|
1989
1973
|
Object.assign(commandMapRef, commandMap);
|
|
1990
1974
|
const rpc = await WebWorkerRpcClient.create({
|
|
1991
1975
|
commandMap: commandMapRef
|
|
1992
1976
|
});
|
|
1993
|
-
set(rpc);
|
|
1977
|
+
set$1(rpc);
|
|
1994
1978
|
};
|
|
1995
1979
|
|
|
1996
1980
|
const main = async () => {
|