@lvce-editor/explorer-view 2.49.0 → 2.51.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/explorerViewWorkerMain.js +50 -32
- package/package.json +1 -1
|
@@ -431,7 +431,7 @@ const create$4 = (method, params) => {
|
|
|
431
431
|
};
|
|
432
432
|
};
|
|
433
433
|
const callbacks = Object.create(null);
|
|
434
|
-
const set$
|
|
434
|
+
const set$2 = (id, fn) => {
|
|
435
435
|
callbacks[id] = fn;
|
|
436
436
|
};
|
|
437
437
|
const get$2 = id => {
|
|
@@ -450,7 +450,7 @@ const registerPromise = () => {
|
|
|
450
450
|
resolve,
|
|
451
451
|
promise
|
|
452
452
|
} = Promise.withResolvers();
|
|
453
|
-
set$
|
|
453
|
+
set$2(id, resolve);
|
|
454
454
|
return {
|
|
455
455
|
id,
|
|
456
456
|
promise
|
|
@@ -664,18 +664,18 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
664
664
|
}
|
|
665
665
|
};
|
|
666
666
|
};
|
|
667
|
-
const create$1$1 = (
|
|
667
|
+
const create$1$1 = (id, error) => {
|
|
668
668
|
return {
|
|
669
669
|
jsonrpc: Two,
|
|
670
|
-
id
|
|
670
|
+
id,
|
|
671
671
|
error
|
|
672
672
|
};
|
|
673
673
|
};
|
|
674
|
-
const getErrorResponse = (
|
|
674
|
+
const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
675
675
|
const prettyError = preparePrettyError(error);
|
|
676
676
|
logError(error, prettyError);
|
|
677
677
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
678
|
-
return create$1$1(
|
|
678
|
+
return create$1$1(id, errorProperty);
|
|
679
679
|
};
|
|
680
680
|
const create$5 = (message, result) => {
|
|
681
681
|
return {
|
|
@@ -688,12 +688,27 @@ const getSuccessResponse = (message, result) => {
|
|
|
688
688
|
const resultProperty = result ?? null;
|
|
689
689
|
return create$5(message, resultProperty);
|
|
690
690
|
};
|
|
691
|
+
const getErrorResponseSimple = (id, error) => {
|
|
692
|
+
return {
|
|
693
|
+
jsonrpc: Two,
|
|
694
|
+
id,
|
|
695
|
+
error: {
|
|
696
|
+
code: Custom,
|
|
697
|
+
// @ts-ignore
|
|
698
|
+
message: error.message,
|
|
699
|
+
data: error
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
};
|
|
691
703
|
const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
|
|
692
704
|
try {
|
|
693
705
|
const result = requiresSocket(message.method) ? await execute(message.method, ipc, ...message.params) : await execute(message.method, ...message.params);
|
|
694
706
|
return getSuccessResponse(message, result);
|
|
695
707
|
} catch (error) {
|
|
696
|
-
|
|
708
|
+
if (ipc.canUseSimpleErrorResponse) {
|
|
709
|
+
return getErrorResponseSimple(message.id, error);
|
|
710
|
+
}
|
|
711
|
+
return getErrorResponse(message.id, error, preparePrettyError, logError);
|
|
697
712
|
}
|
|
698
713
|
};
|
|
699
714
|
const defaultPreparePrettyError = error => {
|
|
@@ -748,7 +763,7 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
748
763
|
try {
|
|
749
764
|
ipc.send(response);
|
|
750
765
|
} catch (error) {
|
|
751
|
-
const errorResponse = getErrorResponse(message, error, preparePrettyError, logError);
|
|
766
|
+
const errorResponse = getErrorResponse(message.id, error, preparePrettyError, logError);
|
|
752
767
|
ipc.send(errorResponse);
|
|
753
768
|
}
|
|
754
769
|
return;
|
|
@@ -779,7 +794,7 @@ const send = (transport, method, ...params) => {
|
|
|
779
794
|
const message = create$4(method, params);
|
|
780
795
|
transport.send(message);
|
|
781
796
|
};
|
|
782
|
-
const invoke$
|
|
797
|
+
const invoke$2 = (ipc, method, ...params) => {
|
|
783
798
|
return invokeHelper(ipc, method, params, false);
|
|
784
799
|
};
|
|
785
800
|
const invokeAndTransfer = (ipc, method, ...params) => {
|
|
@@ -812,7 +827,7 @@ const createRpc = ipc => {
|
|
|
812
827
|
send(ipc, method, ...params);
|
|
813
828
|
},
|
|
814
829
|
invoke(method, ...params) {
|
|
815
|
-
return invoke$
|
|
830
|
+
return invoke$2(ipc, method, ...params);
|
|
816
831
|
},
|
|
817
832
|
invokeAndTransfer(method, ...params) {
|
|
818
833
|
return invokeAndTransfer(ipc, method, ...params);
|
|
@@ -874,7 +889,7 @@ const Copy$2 = 3;
|
|
|
874
889
|
const Rename$2 = 4;
|
|
875
890
|
|
|
876
891
|
const rpcs = Object.create(null);
|
|
877
|
-
const set$
|
|
892
|
+
const set$f = (id, rpc) => {
|
|
878
893
|
rpcs[id] = rpc;
|
|
879
894
|
};
|
|
880
895
|
const get$1 = id => {
|
|
@@ -898,19 +913,22 @@ const create$2 = rpcId => {
|
|
|
898
913
|
return rpc.invokeAndTransfer(method, ...params);
|
|
899
914
|
},
|
|
900
915
|
set(rpc) {
|
|
901
|
-
set$
|
|
916
|
+
set$f(rpcId, rpc);
|
|
917
|
+
},
|
|
918
|
+
async dispose() {
|
|
919
|
+
const rpc = get$1(rpcId);
|
|
920
|
+
await rpc.dispose();
|
|
902
921
|
}
|
|
903
922
|
};
|
|
904
923
|
};
|
|
905
924
|
const RendererWorker$1 = 1;
|
|
906
925
|
const {
|
|
907
|
-
invoke: invoke$
|
|
908
|
-
set: set$2
|
|
909
|
-
} = create$2(RendererWorker$1);
|
|
926
|
+
invoke: invoke$3,
|
|
927
|
+
set: set$3} = create$2(RendererWorker$1);
|
|
910
928
|
const RendererWorker = {
|
|
911
929
|
__proto__: null,
|
|
912
|
-
invoke: invoke$
|
|
913
|
-
set: set$
|
|
930
|
+
invoke: invoke$3,
|
|
931
|
+
set: set$3
|
|
914
932
|
};
|
|
915
933
|
|
|
916
934
|
const {
|
|
@@ -1252,6 +1270,15 @@ const resolveSymbolicLinks = async (uri, rawDirents) => {
|
|
|
1252
1270
|
return resolvedDirents;
|
|
1253
1271
|
};
|
|
1254
1272
|
|
|
1273
|
+
const getChildDirentsRaw = async uri => {
|
|
1274
|
+
const rawDirents = await readDirWithFileTypes(uri);
|
|
1275
|
+
array(rawDirents);
|
|
1276
|
+
if (hasSymbolicLinks(rawDirents)) {
|
|
1277
|
+
return resolveSymbolicLinks(uri, rawDirents);
|
|
1278
|
+
}
|
|
1279
|
+
return rawDirents;
|
|
1280
|
+
};
|
|
1281
|
+
|
|
1255
1282
|
const RE_CHARACTERS = /^[a-zA-Z.-]+$/;
|
|
1256
1283
|
const compareStringNumeric = (a, b) => {
|
|
1257
1284
|
if (RE_CHARACTERS.test(a) && RE_CHARACTERS.test(b)) {
|
|
@@ -1317,14 +1344,6 @@ const toDisplayDirents = (pathSeparator, rawDirents, parentDirentPath, parentDir
|
|
|
1317
1344
|
return result;
|
|
1318
1345
|
};
|
|
1319
1346
|
|
|
1320
|
-
const getChildDirentsRaw = async uri => {
|
|
1321
|
-
const rawDirents = await readDirWithFileTypes(uri);
|
|
1322
|
-
array(rawDirents);
|
|
1323
|
-
if (hasSymbolicLinks(rawDirents)) {
|
|
1324
|
-
return resolveSymbolicLinks(uri, rawDirents);
|
|
1325
|
-
}
|
|
1326
|
-
return rawDirents;
|
|
1327
|
-
};
|
|
1328
1347
|
const getChildDirents = async (pathSeparator, parentDirentPath, parentDirentDepth, excluded = []) => {
|
|
1329
1348
|
string(pathSeparator);
|
|
1330
1349
|
// TODO use event/actor based code instead, this is impossible to cancel right now
|
|
@@ -3641,7 +3660,6 @@ const handleKeyDown = (state, key) => {
|
|
|
3641
3660
|
}
|
|
3642
3661
|
|
|
3643
3662
|
// @ts-ignore
|
|
3644
|
-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
3645
3663
|
timeout = setTimeout(async () => {
|
|
3646
3664
|
await invoke$1('Explorer.cancelTypeAhead');
|
|
3647
3665
|
}, focusWordTimeout);
|
|
@@ -4380,6 +4398,12 @@ const WelcomeMessage = 'WelcomeMessage';
|
|
|
4380
4398
|
const mergeClassNames = (...classNames) => {
|
|
4381
4399
|
return classNames.filter(Boolean).join(' ');
|
|
4382
4400
|
};
|
|
4401
|
+
const px = value => {
|
|
4402
|
+
return `${value}px`;
|
|
4403
|
+
};
|
|
4404
|
+
const position = (x, y) => {
|
|
4405
|
+
return `${x}px ${y}px`;
|
|
4406
|
+
};
|
|
4383
4407
|
const Text = 12;
|
|
4384
4408
|
const text = data => {
|
|
4385
4409
|
return {
|
|
@@ -4388,12 +4412,6 @@ const text = data => {
|
|
|
4388
4412
|
childCount: 0
|
|
4389
4413
|
};
|
|
4390
4414
|
};
|
|
4391
|
-
const px = value => {
|
|
4392
|
-
return `${value}px`;
|
|
4393
|
-
};
|
|
4394
|
-
const position = (x, y) => {
|
|
4395
|
-
return `${x}px ${y}px`;
|
|
4396
|
-
};
|
|
4397
4415
|
|
|
4398
4416
|
const Button$1 = 1;
|
|
4399
4417
|
const Div = 4;
|