@lvce-editor/test-worker 10.10.0 → 10.12.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/api.d.ts +10 -1
- package/dist/testWorkerMain.js +174 -129
- package/package.json +2 -2
package/dist/api.d.ts
CHANGED
|
@@ -50,6 +50,11 @@ export interface FileSystemTmpDirOptions {
|
|
|
50
50
|
readonly scheme?: string;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
export interface SelectItem2Options {
|
|
54
|
+
readonly callbackCommand: string;
|
|
55
|
+
readonly label: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
53
58
|
interface Workspace {
|
|
54
59
|
readonly openTmpDir: () => Promise<string>;
|
|
55
60
|
readonly setPath: (path: string) => Promise<void>;
|
|
@@ -258,6 +263,8 @@ interface Extension {
|
|
|
258
263
|
|
|
259
264
|
interface ExtensionDetail {
|
|
260
265
|
readonly copyReadmeLink: (href: string) => Promise<void>;
|
|
266
|
+
readonly focusNextTab: () => Promise<void>;
|
|
267
|
+
readonly focusPreviousTab: () => Promise<void>;
|
|
261
268
|
readonly handleClickCategory: (categoryId: string) => Promise<void>;
|
|
262
269
|
readonly handleClickDisable: () => Promise<void>;
|
|
263
270
|
readonly handleClickEnable: () => Promise<void>;
|
|
@@ -266,6 +273,7 @@ interface ExtensionDetail {
|
|
|
266
273
|
readonly handleImageContextMenu: () => Promise<void>;
|
|
267
274
|
readonly handleReadmeContextMenu: (x: number, y: number, nodeName: string, href: string) => Promise<void>;
|
|
268
275
|
readonly handleScroll: (scrollTop: number) => Promise<void>;
|
|
276
|
+
readonly handleTabFocus: (tabName: string) => Promise<void>;
|
|
269
277
|
readonly hideSizeLink: () => Promise<void>;
|
|
270
278
|
readonly open: (extensionId: string) => Promise<void>;
|
|
271
279
|
readonly openCommands: () => Promise<void>;
|
|
@@ -426,6 +434,7 @@ interface QuickPick {
|
|
|
426
434
|
readonly selectCurrentIndex: () => Promise<void>;
|
|
427
435
|
readonly selectIndex: (index: number) => Promise<void>;
|
|
428
436
|
readonly selectItem: (label: string) => Promise<void>;
|
|
437
|
+
readonly selectItem2: ({ callbackCommand, label }: SelectItem2Options) => Promise<void>;
|
|
429
438
|
readonly setValue: (value: string) => Promise<void>;
|
|
430
439
|
}
|
|
431
440
|
|
|
@@ -496,12 +505,12 @@ interface SettingsView {
|
|
|
496
505
|
readonly clear: (searchValue: string) => Promise<void>;
|
|
497
506
|
readonly clearHistory: () => Promise<void>;
|
|
498
507
|
readonly handleClickFilterButton: (x: number, y: number) => Promise<void>;
|
|
499
|
-
readonly handleClickTab: (name: string) => Promise<void>;
|
|
500
508
|
readonly handleInput: (searchValue: string) => Promise<void>;
|
|
501
509
|
readonly handleScroll: (scrollTop: number) => Promise<void>;
|
|
502
510
|
readonly selectExtensions: () => Promise<void>;
|
|
503
511
|
readonly selectTab: (tabId: string) => Promise<void>;
|
|
504
512
|
readonly selectTextEditor: () => Promise<void>;
|
|
513
|
+
readonly selectWindow: () => Promise<void>;
|
|
505
514
|
readonly selectWorkspace: () => Promise<void>;
|
|
506
515
|
readonly show: () => Promise<void>;
|
|
507
516
|
readonly useNextSearchValue: () => Promise<void>;
|
package/dist/testWorkerMain.js
CHANGED
|
@@ -231,8 +231,8 @@ const getModuleNotFoundError = stderr => {
|
|
|
231
231
|
const messageIndex = lines.findIndex(isModuleNotFoundMessage);
|
|
232
232
|
const message = lines[messageIndex];
|
|
233
233
|
return {
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
code: ERR_MODULE_NOT_FOUND,
|
|
235
|
+
message
|
|
236
236
|
};
|
|
237
237
|
};
|
|
238
238
|
const isModuleNotFoundError = stderr => {
|
|
@@ -255,14 +255,14 @@ const isUnhelpfulNativeModuleError = stderr => {
|
|
|
255
255
|
const getNativeModuleErrorMessage = stderr => {
|
|
256
256
|
const message = getMessageCodeBlock(stderr);
|
|
257
257
|
return {
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
code: E_INCOMPATIBLE_NATIVE_MODULE,
|
|
259
|
+
message: `Incompatible native node module: ${message}`
|
|
260
260
|
};
|
|
261
261
|
};
|
|
262
262
|
const getModuleSyntaxError = () => {
|
|
263
263
|
return {
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON,
|
|
265
|
+
message: `ES Modules are not supported in electron`
|
|
266
266
|
};
|
|
267
267
|
};
|
|
268
268
|
const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
@@ -281,8 +281,8 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
|
281
281
|
rest
|
|
282
282
|
} = getDetails(lines);
|
|
283
283
|
return {
|
|
284
|
-
message: actualMessage,
|
|
285
284
|
code: '',
|
|
285
|
+
message: actualMessage,
|
|
286
286
|
stack: rest
|
|
287
287
|
};
|
|
288
288
|
};
|
|
@@ -292,8 +292,8 @@ class IpcError extends VError {
|
|
|
292
292
|
if (stdout || stderr) {
|
|
293
293
|
// @ts-ignore
|
|
294
294
|
const {
|
|
295
|
-
message,
|
|
296
295
|
code,
|
|
296
|
+
message,
|
|
297
297
|
stack
|
|
298
298
|
} = getHelpfulChildProcessError(stdout, stderr);
|
|
299
299
|
const cause = new Error(message);
|
|
@@ -354,8 +354,8 @@ const wrap$f = global => {
|
|
|
354
354
|
};
|
|
355
355
|
const waitForFirstMessage = async port => {
|
|
356
356
|
const {
|
|
357
|
-
|
|
358
|
-
|
|
357
|
+
promise,
|
|
358
|
+
resolve
|
|
359
359
|
} = Promise.withResolvers();
|
|
360
360
|
port.addEventListener('message', resolve, {
|
|
361
361
|
once: true
|
|
@@ -375,8 +375,8 @@ const listen$6 = async () => {
|
|
|
375
375
|
const type = firstMessage.params[0];
|
|
376
376
|
if (type === 'message-port') {
|
|
377
377
|
parentIpc.send({
|
|
378
|
-
jsonrpc: '2.0',
|
|
379
378
|
id: firstMessage.id,
|
|
379
|
+
jsonrpc: '2.0',
|
|
380
380
|
result: null
|
|
381
381
|
});
|
|
382
382
|
parentIpc.dispose();
|
|
@@ -433,8 +433,8 @@ const removeListener = (emitter, type, callback) => {
|
|
|
433
433
|
};
|
|
434
434
|
const getFirstEvent = (eventEmitter, eventMap) => {
|
|
435
435
|
const {
|
|
436
|
-
|
|
437
|
-
|
|
436
|
+
promise,
|
|
437
|
+
resolve
|
|
438
438
|
} = Promise.withResolvers();
|
|
439
439
|
const listenerMap = Object.create(null);
|
|
440
440
|
const cleanup = value => {
|
|
@@ -446,8 +446,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
446
446
|
for (const [event, type] of Object.entries(eventMap)) {
|
|
447
447
|
const listener = event => {
|
|
448
448
|
cleanup({
|
|
449
|
-
|
|
450
|
-
|
|
449
|
+
event,
|
|
450
|
+
type
|
|
451
451
|
});
|
|
452
452
|
};
|
|
453
453
|
addListener(eventEmitter, event, listener);
|
|
@@ -457,8 +457,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
457
457
|
};
|
|
458
458
|
const Message$1 = 3;
|
|
459
459
|
const create$5$1 = async ({
|
|
460
|
-
|
|
461
|
-
|
|
460
|
+
isMessagePortOpen,
|
|
461
|
+
messagePort
|
|
462
462
|
}) => {
|
|
463
463
|
if (!isMessagePort(messagePort)) {
|
|
464
464
|
throw new IpcError('port must be of type MessagePort');
|
|
@@ -471,8 +471,8 @@ const create$5$1 = async ({
|
|
|
471
471
|
});
|
|
472
472
|
messagePort.start();
|
|
473
473
|
const {
|
|
474
|
-
|
|
475
|
-
|
|
474
|
+
event,
|
|
475
|
+
type
|
|
476
476
|
} = await eventPromise;
|
|
477
477
|
if (type !== Message$1) {
|
|
478
478
|
throw new IpcError('Failed to wait for ipc message');
|
|
@@ -512,55 +512,13 @@ const IpcParentWithMessagePort$1 = {
|
|
|
512
512
|
wrap: wrap$5
|
|
513
513
|
};
|
|
514
514
|
|
|
515
|
-
const Two = '2.0';
|
|
516
|
-
const
|
|
517
|
-
return {
|
|
518
|
-
jsonrpc: Two,
|
|
519
|
-
method,
|
|
520
|
-
params
|
|
521
|
-
};
|
|
522
|
-
};
|
|
523
|
-
const callbacks = Object.create(null);
|
|
524
|
-
const set$3 = (id, fn) => {
|
|
525
|
-
callbacks[id] = fn;
|
|
526
|
-
};
|
|
515
|
+
const Two$1 = '2.0';
|
|
516
|
+
const callbacks$1 = Object.create(null);
|
|
527
517
|
const get$2 = id => {
|
|
528
|
-
return callbacks[id];
|
|
518
|
+
return callbacks$1[id];
|
|
529
519
|
};
|
|
530
520
|
const remove$1 = id => {
|
|
531
|
-
delete callbacks[id];
|
|
532
|
-
};
|
|
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$3(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
|
-
};
|
|
521
|
+
delete callbacks$1[id];
|
|
564
522
|
};
|
|
565
523
|
class JsonRpcError extends Error {
|
|
566
524
|
constructor(message) {
|
|
@@ -757,7 +715,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
757
715
|
};
|
|
758
716
|
const create$1$1 = (id, error) => {
|
|
759
717
|
return {
|
|
760
|
-
jsonrpc: Two,
|
|
718
|
+
jsonrpc: Two$1,
|
|
761
719
|
id,
|
|
762
720
|
error
|
|
763
721
|
};
|
|
@@ -768,20 +726,20 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
768
726
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
769
727
|
return create$1$1(id, errorProperty);
|
|
770
728
|
};
|
|
771
|
-
const create$
|
|
729
|
+
const create$3 = (message, result) => {
|
|
772
730
|
return {
|
|
773
|
-
jsonrpc: Two,
|
|
731
|
+
jsonrpc: Two$1,
|
|
774
732
|
id: message.id,
|
|
775
733
|
result: result ?? null
|
|
776
734
|
};
|
|
777
735
|
};
|
|
778
736
|
const getSuccessResponse = (message, result) => {
|
|
779
737
|
const resultProperty = result ?? null;
|
|
780
|
-
return create$
|
|
738
|
+
return create$3(message, resultProperty);
|
|
781
739
|
};
|
|
782
740
|
const getErrorResponseSimple = (id, error) => {
|
|
783
741
|
return {
|
|
784
|
-
jsonrpc: Two,
|
|
742
|
+
jsonrpc: Two$1,
|
|
785
743
|
id,
|
|
786
744
|
error: {
|
|
787
745
|
code: Custom,
|
|
@@ -868,29 +826,6 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
868
826
|
}
|
|
869
827
|
throw new JsonRpcError('unexpected message');
|
|
870
828
|
};
|
|
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$1 = (transport, method, ...params) => {
|
|
885
|
-
const message = create$4(method, params);
|
|
886
|
-
transport.send(message);
|
|
887
|
-
};
|
|
888
|
-
const invoke$2 = (ipc, method, ...params) => {
|
|
889
|
-
return invokeHelper(ipc, method, params, false);
|
|
890
|
-
};
|
|
891
|
-
const invokeAndTransfer$1 = (ipc, method, ...params) => {
|
|
892
|
-
return invokeHelper(ipc, method, params, true);
|
|
893
|
-
};
|
|
894
829
|
|
|
895
830
|
class CommandNotFoundError extends Error {
|
|
896
831
|
constructor(command) {
|
|
@@ -913,24 +848,87 @@ const execute$2 = (command, ...args) => {
|
|
|
913
848
|
return fn(...args);
|
|
914
849
|
};
|
|
915
850
|
|
|
851
|
+
const Two = '2.0';
|
|
852
|
+
const create$p = (method, params) => {
|
|
853
|
+
return {
|
|
854
|
+
jsonrpc: Two,
|
|
855
|
+
method,
|
|
856
|
+
params
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
const create$o = (id, method, params) => {
|
|
860
|
+
const message = {
|
|
861
|
+
id,
|
|
862
|
+
jsonrpc: Two,
|
|
863
|
+
method,
|
|
864
|
+
params
|
|
865
|
+
};
|
|
866
|
+
return message;
|
|
867
|
+
};
|
|
868
|
+
let id = 0;
|
|
869
|
+
const create$n = () => {
|
|
870
|
+
return ++id;
|
|
871
|
+
};
|
|
872
|
+
|
|
873
|
+
/* eslint-disable n/no-unsupported-features/es-syntax */
|
|
874
|
+
|
|
875
|
+
const registerPromise = map => {
|
|
876
|
+
const id = create$n();
|
|
877
|
+
const {
|
|
878
|
+
promise,
|
|
879
|
+
resolve
|
|
880
|
+
} = Promise.withResolvers();
|
|
881
|
+
map[id] = resolve;
|
|
882
|
+
return {
|
|
883
|
+
id,
|
|
884
|
+
promise
|
|
885
|
+
};
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
// @ts-ignore
|
|
889
|
+
const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer) => {
|
|
890
|
+
const {
|
|
891
|
+
id,
|
|
892
|
+
promise
|
|
893
|
+
} = registerPromise(callbacks);
|
|
894
|
+
const message = create$o(id, method, params);
|
|
895
|
+
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
896
|
+
ipc.sendAndTransfer(message);
|
|
897
|
+
} else {
|
|
898
|
+
ipc.send(message);
|
|
899
|
+
}
|
|
900
|
+
const responseMessage = await promise;
|
|
901
|
+
return unwrapJsonRpcResult(responseMessage);
|
|
902
|
+
};
|
|
916
903
|
const createRpc = ipc => {
|
|
904
|
+
const callbacks = Object.create(null);
|
|
905
|
+
ipc._resolve = (id, response) => {
|
|
906
|
+
const fn = callbacks[id];
|
|
907
|
+
if (!fn) {
|
|
908
|
+
console.warn(`callback ${id} may already be disposed`);
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
fn(response);
|
|
912
|
+
delete callbacks[id];
|
|
913
|
+
};
|
|
917
914
|
const rpc = {
|
|
915
|
+
async dispose() {
|
|
916
|
+
await ipc?.dispose();
|
|
917
|
+
},
|
|
918
|
+
invoke(method, ...params) {
|
|
919
|
+
return invokeHelper(callbacks, ipc, method, params, false);
|
|
920
|
+
},
|
|
921
|
+
invokeAndTransfer(method, ...params) {
|
|
922
|
+
return invokeHelper(callbacks, ipc, method, params, true);
|
|
923
|
+
},
|
|
918
924
|
// @ts-ignore
|
|
919
925
|
ipc,
|
|
920
926
|
/**
|
|
921
927
|
* @deprecated
|
|
922
928
|
*/
|
|
923
929
|
send(method, ...params) {
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
invoke(method, ...params) {
|
|
927
|
-
return invoke$2(ipc, method, ...params);
|
|
928
|
-
},
|
|
929
|
-
invokeAndTransfer(method, ...params) {
|
|
930
|
-
return invokeAndTransfer$1(ipc, method, ...params);
|
|
931
|
-
},
|
|
932
|
-
async dispose() {
|
|
933
|
-
await ipc?.dispose();
|
|
930
|
+
const message = create$p(method, params);
|
|
931
|
+
ipc.send(message);
|
|
934
932
|
}
|
|
935
933
|
};
|
|
936
934
|
return rpc;
|
|
@@ -947,7 +945,7 @@ const logError = () => {
|
|
|
947
945
|
const handleMessage = event => {
|
|
948
946
|
const actualRequiresSocket = event?.target?.requiresSocket || requiresSocket;
|
|
949
947
|
const actualExecute = event?.target?.execute || execute$2;
|
|
950
|
-
return handleJsonRpcMessage(event.target, event.data, actualExecute,
|
|
948
|
+
return handleJsonRpcMessage(event.target, event.data, actualExecute, event.target._resolve, preparePrettyError, logError, actualRequiresSocket);
|
|
951
949
|
};
|
|
952
950
|
const handleIpc = ipc => {
|
|
953
951
|
if ('addEventListener' in ipc) {
|
|
@@ -965,16 +963,16 @@ const listen$1 = async (module, options) => {
|
|
|
965
963
|
const ipc = module.wrap(rawIpc);
|
|
966
964
|
return ipc;
|
|
967
965
|
};
|
|
968
|
-
const create$
|
|
966
|
+
const create$g = async ({
|
|
969
967
|
commandMap,
|
|
970
|
-
|
|
971
|
-
|
|
968
|
+
isMessagePortOpen,
|
|
969
|
+
messagePort
|
|
972
970
|
}) => {
|
|
973
971
|
// TODO create a commandMap per rpc instance
|
|
974
972
|
register(commandMap);
|
|
975
973
|
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
976
|
-
|
|
977
|
-
|
|
974
|
+
isMessagePortOpen,
|
|
975
|
+
messagePort
|
|
978
976
|
});
|
|
979
977
|
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
980
978
|
handleIpc(ipc);
|
|
@@ -983,17 +981,18 @@ const create$e = async ({
|
|
|
983
981
|
};
|
|
984
982
|
const MessagePortRpcParent = {
|
|
985
983
|
__proto__: null,
|
|
986
|
-
create: create$
|
|
984
|
+
create: create$g
|
|
987
985
|
};
|
|
988
|
-
const create$
|
|
986
|
+
const create$7 = async ({
|
|
989
987
|
commandMap,
|
|
988
|
+
isMessagePortOpen = true,
|
|
990
989
|
messagePort
|
|
991
990
|
}) => {
|
|
992
991
|
// TODO create a commandMap per rpc instance
|
|
993
992
|
register(commandMap);
|
|
994
993
|
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
995
|
-
|
|
996
|
-
|
|
994
|
+
isMessagePortOpen,
|
|
995
|
+
messagePort
|
|
997
996
|
});
|
|
998
997
|
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
999
998
|
handleIpc(ipc);
|
|
@@ -1001,8 +1000,9 @@ const create$5 = async ({
|
|
|
1001
1000
|
messagePort.start();
|
|
1002
1001
|
return rpc;
|
|
1003
1002
|
};
|
|
1004
|
-
const create$
|
|
1003
|
+
const create$5 = async ({
|
|
1005
1004
|
commandMap,
|
|
1005
|
+
isMessagePortOpen,
|
|
1006
1006
|
send
|
|
1007
1007
|
}) => {
|
|
1008
1008
|
const {
|
|
@@ -1010,14 +1010,15 @@ const create$3 = async ({
|
|
|
1010
1010
|
port2
|
|
1011
1011
|
} = new MessageChannel();
|
|
1012
1012
|
await send(port1);
|
|
1013
|
-
return create$
|
|
1013
|
+
return create$7({
|
|
1014
1014
|
commandMap,
|
|
1015
|
+
isMessagePortOpen,
|
|
1015
1016
|
messagePort: port2
|
|
1016
1017
|
});
|
|
1017
1018
|
};
|
|
1018
1019
|
const TransferMessagePortRpcParent = {
|
|
1019
1020
|
__proto__: null,
|
|
1020
|
-
create: create$
|
|
1021
|
+
create: create$5
|
|
1021
1022
|
};
|
|
1022
1023
|
const create$2 = async ({
|
|
1023
1024
|
commandMap
|
|
@@ -1055,6 +1056,10 @@ const get$1 = id => {
|
|
|
1055
1056
|
|
|
1056
1057
|
const create$1 = rpcId => {
|
|
1057
1058
|
return {
|
|
1059
|
+
async dispose() {
|
|
1060
|
+
const rpc = get$1(rpcId);
|
|
1061
|
+
await rpc.dispose();
|
|
1062
|
+
},
|
|
1058
1063
|
// @ts-ignore
|
|
1059
1064
|
invoke(method, ...params) {
|
|
1060
1065
|
const rpc = get$1(rpcId);
|
|
@@ -1069,10 +1074,6 @@ const create$1 = rpcId => {
|
|
|
1069
1074
|
},
|
|
1070
1075
|
set(rpc) {
|
|
1071
1076
|
set$2(rpcId, rpc);
|
|
1072
|
-
},
|
|
1073
|
-
async dispose() {
|
|
1074
|
-
const rpc = get$1(rpcId);
|
|
1075
|
-
await rpc.dispose();
|
|
1076
1077
|
}
|
|
1077
1078
|
};
|
|
1078
1079
|
};
|
|
@@ -1080,7 +1081,8 @@ const create$1 = rpcId => {
|
|
|
1080
1081
|
const {
|
|
1081
1082
|
invoke: invoke$1,
|
|
1082
1083
|
invokeAndTransfer,
|
|
1083
|
-
set: set$1
|
|
1084
|
+
set: set$1
|
|
1085
|
+
} = create$1(RendererWorker);
|
|
1084
1086
|
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1085
1087
|
const command = 'HandleMessagePort.handleMessagePort';
|
|
1086
1088
|
// @ts-ignore
|
|
@@ -1104,13 +1106,18 @@ const createLazyRpc = rpcId => {
|
|
|
1104
1106
|
await rpcPromise;
|
|
1105
1107
|
};
|
|
1106
1108
|
return {
|
|
1107
|
-
setFactory(value) {
|
|
1108
|
-
factory = value;
|
|
1109
|
-
},
|
|
1110
1109
|
async invoke(method, ...params) {
|
|
1111
1110
|
await ensureRpc();
|
|
1112
1111
|
const rpc = get$1(rpcId);
|
|
1113
1112
|
return rpc.invoke(method, ...params);
|
|
1113
|
+
},
|
|
1114
|
+
async invokeAndTransfer(method, ...params) {
|
|
1115
|
+
await ensureRpc();
|
|
1116
|
+
const rpc = get$1(rpcId);
|
|
1117
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
1118
|
+
},
|
|
1119
|
+
setFactory(value) {
|
|
1120
|
+
factory = value;
|
|
1114
1121
|
}
|
|
1115
1122
|
};
|
|
1116
1123
|
};
|
|
@@ -2471,6 +2478,12 @@ const selectFeatures = async () => {
|
|
|
2471
2478
|
const selectChangelog = async () => {
|
|
2472
2479
|
await selectTab$1('Changelog');
|
|
2473
2480
|
};
|
|
2481
|
+
const focusNextTab = async () => {
|
|
2482
|
+
await invoke$1('ExtensionDetail.focusNextTab');
|
|
2483
|
+
};
|
|
2484
|
+
const focusPreviousTab = async () => {
|
|
2485
|
+
await invoke$1('ExtensionDetail.focusPreviousTab');
|
|
2486
|
+
};
|
|
2474
2487
|
const open$6 = extensionId => {
|
|
2475
2488
|
const uri = `extension-detail://${extensionId}`;
|
|
2476
2489
|
return invoke$1('Main.openUri', uri);
|
|
@@ -2510,10 +2523,15 @@ const handleScroll$1 = async scrollTop => {
|
|
|
2510
2523
|
const hideSizeLink = async () => {
|
|
2511
2524
|
return invoke$1('ExtensionDetail.hideSizeLink');
|
|
2512
2525
|
};
|
|
2526
|
+
const handleTabFocus = async tabName => {
|
|
2527
|
+
return invoke$1('ExtensionDetail.handleTabFocus', tabName);
|
|
2528
|
+
};
|
|
2513
2529
|
|
|
2514
2530
|
const ExtensionDetail = {
|
|
2515
2531
|
__proto__: null,
|
|
2516
2532
|
copyReadmeLink,
|
|
2533
|
+
focusNextTab,
|
|
2534
|
+
focusPreviousTab,
|
|
2517
2535
|
handleClickCategory,
|
|
2518
2536
|
handleClickDisable,
|
|
2519
2537
|
handleClickEnable,
|
|
@@ -2522,6 +2540,7 @@ const ExtensionDetail = {
|
|
|
2522
2540
|
handleImageContextMenu,
|
|
2523
2541
|
handleReadmeContextMenu,
|
|
2524
2542
|
handleScroll: handleScroll$1,
|
|
2543
|
+
handleTabFocus,
|
|
2525
2544
|
hideSizeLink,
|
|
2526
2545
|
open: open$6,
|
|
2527
2546
|
openCommands,
|
|
@@ -3232,6 +3251,21 @@ const Problems = {
|
|
|
3232
3251
|
viewAsTable
|
|
3233
3252
|
};
|
|
3234
3253
|
|
|
3254
|
+
const callbacks = Object.create(null);
|
|
3255
|
+
const registerCallbackCommand = async commandId => {
|
|
3256
|
+
const id = createId();
|
|
3257
|
+
const {
|
|
3258
|
+
promise,
|
|
3259
|
+
resolve
|
|
3260
|
+
} = Promise.withResolvers();
|
|
3261
|
+
callbacks[id] = resolve;
|
|
3262
|
+
// @ts-ignore
|
|
3263
|
+
await invoke$1(`Command.registerTestCommand`, commandId);
|
|
3264
|
+
return {
|
|
3265
|
+
promise
|
|
3266
|
+
};
|
|
3267
|
+
};
|
|
3268
|
+
|
|
3235
3269
|
const QuickPick$1 = 'QuickPick';
|
|
3236
3270
|
|
|
3237
3271
|
const open$1 = async () => {
|
|
@@ -3290,6 +3324,17 @@ const executeCommand = async label => {
|
|
|
3290
3324
|
// @ts-ignore
|
|
3291
3325
|
await invoke$1('QuickPick.selectItem', label);
|
|
3292
3326
|
};
|
|
3327
|
+
const selectItem2 = async ({
|
|
3328
|
+
callbackCommand,
|
|
3329
|
+
label
|
|
3330
|
+
}) => {
|
|
3331
|
+
const {
|
|
3332
|
+
promise
|
|
3333
|
+
} = await registerCallbackCommand(callbackCommand);
|
|
3334
|
+
// @ts-ignore
|
|
3335
|
+
invoke$1('QuickPick.selectItem', label);
|
|
3336
|
+
await promise;
|
|
3337
|
+
};
|
|
3293
3338
|
|
|
3294
3339
|
const QuickPick = {
|
|
3295
3340
|
__proto__: null,
|
|
@@ -3305,6 +3350,7 @@ const QuickPick = {
|
|
|
3305
3350
|
selectCurrentIndex,
|
|
3306
3351
|
selectIndex: selectIndex$3,
|
|
3307
3352
|
selectItem,
|
|
3353
|
+
selectItem2,
|
|
3308
3354
|
setValue: setValue$1
|
|
3309
3355
|
};
|
|
3310
3356
|
|
|
@@ -3550,10 +3596,6 @@ const handleInput$1 = async searchValue => {
|
|
|
3550
3596
|
// @ts-ignore
|
|
3551
3597
|
return invoke$1('Settings.handleInput', searchValue, Script);
|
|
3552
3598
|
};
|
|
3553
|
-
const handleClickTab = async name => {
|
|
3554
|
-
// @ts-ignore
|
|
3555
|
-
return invoke$1('Settings.handleClickTab', name);
|
|
3556
|
-
};
|
|
3557
3599
|
const usePreviousSearchValue = async () => {
|
|
3558
3600
|
// @ts-ignore
|
|
3559
3601
|
return invoke$1('Settings.usePreviousSearchValue');
|
|
@@ -3583,6 +3625,9 @@ const selectTextEditor = async () => {
|
|
|
3583
3625
|
const selectExtensions = async () => {
|
|
3584
3626
|
await selectTab('extensions');
|
|
3585
3627
|
};
|
|
3628
|
+
const selectWindow = async () => {
|
|
3629
|
+
await selectTab('window');
|
|
3630
|
+
};
|
|
3586
3631
|
const handleScroll = async scrollTop => {
|
|
3587
3632
|
// @ts-ignore
|
|
3588
3633
|
await invoke$1('Settings.handleScroll', scrollTop, Script);
|
|
@@ -3597,12 +3642,12 @@ const SettingsView = {
|
|
|
3597
3642
|
clear,
|
|
3598
3643
|
clearHistory,
|
|
3599
3644
|
handleClickFilterButton,
|
|
3600
|
-
handleClickTab,
|
|
3601
3645
|
handleInput: handleInput$1,
|
|
3602
3646
|
handleScroll,
|
|
3603
3647
|
selectExtensions,
|
|
3604
3648
|
selectTab,
|
|
3605
3649
|
selectTextEditor,
|
|
3650
|
+
selectWindow,
|
|
3606
3651
|
selectWorkspace,
|
|
3607
3652
|
show: show$1,
|
|
3608
3653
|
useNextSearchValue,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/test-worker",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.12.0",
|
|
4
4
|
"description": "Test Worker",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"main": "dist/testWorkerMain.js",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@lvce-editor/constants": "^
|
|
14
|
+
"@lvce-editor/constants": "^2.8.0"
|
|
15
15
|
},
|
|
16
16
|
"types": "dist/api.d.ts"
|
|
17
17
|
}
|