@lvce-editor/explorer-view 5.10.0 → 5.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/explorerViewWorkerMain.js +62 -58
- package/package.json +1 -1
|
@@ -243,8 +243,8 @@ const getModuleNotFoundError = stderr => {
|
|
|
243
243
|
const messageIndex = lines.findIndex(isModuleNotFoundMessage);
|
|
244
244
|
const message = lines[messageIndex];
|
|
245
245
|
return {
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
code: ERR_MODULE_NOT_FOUND,
|
|
247
|
+
message
|
|
248
248
|
};
|
|
249
249
|
};
|
|
250
250
|
const isModuleNotFoundError = stderr => {
|
|
@@ -267,14 +267,14 @@ const isUnhelpfulNativeModuleError = stderr => {
|
|
|
267
267
|
const getNativeModuleErrorMessage = stderr => {
|
|
268
268
|
const message = getMessageCodeBlock(stderr);
|
|
269
269
|
return {
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
code: E_INCOMPATIBLE_NATIVE_MODULE,
|
|
271
|
+
message: `Incompatible native node module: ${message}`
|
|
272
272
|
};
|
|
273
273
|
};
|
|
274
274
|
const getModuleSyntaxError = () => {
|
|
275
275
|
return {
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON,
|
|
277
|
+
message: `ES Modules are not supported in electron`
|
|
278
278
|
};
|
|
279
279
|
};
|
|
280
280
|
const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
@@ -293,8 +293,8 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
|
293
293
|
rest
|
|
294
294
|
} = getDetails(lines);
|
|
295
295
|
return {
|
|
296
|
-
message: actualMessage,
|
|
297
296
|
code: '',
|
|
297
|
+
message: actualMessage,
|
|
298
298
|
stack: rest
|
|
299
299
|
};
|
|
300
300
|
};
|
|
@@ -304,8 +304,8 @@ class IpcError extends VError {
|
|
|
304
304
|
if (stdout || stderr) {
|
|
305
305
|
// @ts-ignore
|
|
306
306
|
const {
|
|
307
|
-
message,
|
|
308
307
|
code,
|
|
308
|
+
message,
|
|
309
309
|
stack
|
|
310
310
|
} = getHelpfulChildProcessError(stdout, stderr);
|
|
311
311
|
const cause = new Error(message);
|
|
@@ -366,8 +366,8 @@ const wrap$f = global => {
|
|
|
366
366
|
};
|
|
367
367
|
const waitForFirstMessage = async port => {
|
|
368
368
|
const {
|
|
369
|
-
|
|
370
|
-
|
|
369
|
+
promise,
|
|
370
|
+
resolve
|
|
371
371
|
} = Promise.withResolvers();
|
|
372
372
|
port.addEventListener('message', resolve, {
|
|
373
373
|
once: true
|
|
@@ -387,8 +387,8 @@ const listen$6 = async () => {
|
|
|
387
387
|
const type = firstMessage.params[0];
|
|
388
388
|
if (type === 'message-port') {
|
|
389
389
|
parentIpc.send({
|
|
390
|
-
jsonrpc: '2.0',
|
|
391
390
|
id: firstMessage.id,
|
|
391
|
+
jsonrpc: '2.0',
|
|
392
392
|
result: null
|
|
393
393
|
});
|
|
394
394
|
parentIpc.dispose();
|
|
@@ -445,8 +445,8 @@ const removeListener = (emitter, type, callback) => {
|
|
|
445
445
|
};
|
|
446
446
|
const getFirstEvent = (eventEmitter, eventMap) => {
|
|
447
447
|
const {
|
|
448
|
-
|
|
449
|
-
|
|
448
|
+
promise,
|
|
449
|
+
resolve
|
|
450
450
|
} = Promise.withResolvers();
|
|
451
451
|
const listenerMap = Object.create(null);
|
|
452
452
|
const cleanup = value => {
|
|
@@ -458,8 +458,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
458
458
|
for (const [event, type] of Object.entries(eventMap)) {
|
|
459
459
|
const listener = event => {
|
|
460
460
|
cleanup({
|
|
461
|
-
|
|
462
|
-
|
|
461
|
+
event,
|
|
462
|
+
type
|
|
463
463
|
});
|
|
464
464
|
};
|
|
465
465
|
addListener(eventEmitter, event, listener);
|
|
@@ -469,8 +469,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
469
469
|
};
|
|
470
470
|
const Message$1 = 3;
|
|
471
471
|
const create$5$1 = async ({
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
isMessagePortOpen,
|
|
473
|
+
messagePort
|
|
474
474
|
}) => {
|
|
475
475
|
if (!isMessagePort(messagePort)) {
|
|
476
476
|
throw new IpcError('port must be of type MessagePort');
|
|
@@ -483,8 +483,8 @@ const create$5$1 = async ({
|
|
|
483
483
|
});
|
|
484
484
|
messagePort.start();
|
|
485
485
|
const {
|
|
486
|
-
|
|
487
|
-
|
|
486
|
+
event,
|
|
487
|
+
type
|
|
488
488
|
} = await eventPromise;
|
|
489
489
|
if (type !== Message$1) {
|
|
490
490
|
throw new IpcError('Failed to wait for ipc message');
|
|
@@ -1045,8 +1045,6 @@ const createMockRpc = ({
|
|
|
1045
1045
|
return mockRpc;
|
|
1046
1046
|
};
|
|
1047
1047
|
|
|
1048
|
-
const Text = 12;
|
|
1049
|
-
|
|
1050
1048
|
const Button$3 = 'event.button';
|
|
1051
1049
|
const ClientX = 'event.clientX';
|
|
1052
1050
|
const ClientY = 'event.clientY';
|
|
@@ -1062,31 +1060,10 @@ const ShiftKey = 'event.shiftKey';
|
|
|
1062
1060
|
const TargetName = 'event.target.name';
|
|
1063
1061
|
const TargetValue = 'event.target.value';
|
|
1064
1062
|
|
|
1065
|
-
const Enter = 3;
|
|
1066
|
-
const Escape = 8;
|
|
1067
|
-
const Space = 9;
|
|
1068
|
-
const End = 255;
|
|
1069
|
-
const Home = 12;
|
|
1070
|
-
const LeftArrow = 13;
|
|
1071
|
-
const UpArrow = 14;
|
|
1072
|
-
const RightArrow = 15;
|
|
1073
|
-
const DownArrow = 16;
|
|
1074
|
-
const Delete$1 = 18;
|
|
1075
|
-
const KeyA = 29;
|
|
1076
|
-
const KeyC = 31;
|
|
1077
|
-
const KeyV = 50;
|
|
1078
|
-
const KeyX = 52;
|
|
1079
|
-
const F2 = 58;
|
|
1080
|
-
const Star = 131;
|
|
1081
|
-
|
|
1082
|
-
const CtrlCmd = 1 << 11 >>> 0;
|
|
1083
|
-
const Shift = 1 << 10 >>> 0;
|
|
1084
|
-
const Alt = 1 << 9 >>> 0;
|
|
1085
|
-
|
|
1086
1063
|
const FileSystemWorker$1 = 209;
|
|
1064
|
+
const IconThemeWorker = 7009;
|
|
1087
1065
|
const RendererWorker = 1;
|
|
1088
1066
|
const SourceControlWorker = 66;
|
|
1089
|
-
const IconThemeWorker = 7009;
|
|
1090
1067
|
|
|
1091
1068
|
const FocusElementByName = 'Viewlet.focusElementByName';
|
|
1092
1069
|
const FocusSelector = 'Viewlet.focusSelector';
|
|
@@ -1107,6 +1084,10 @@ const get$1 = id => {
|
|
|
1107
1084
|
|
|
1108
1085
|
const create$2 = rpcId => {
|
|
1109
1086
|
return {
|
|
1087
|
+
async dispose() {
|
|
1088
|
+
const rpc = get$1(rpcId);
|
|
1089
|
+
await rpc.dispose();
|
|
1090
|
+
},
|
|
1110
1091
|
// @ts-ignore
|
|
1111
1092
|
invoke(method, ...params) {
|
|
1112
1093
|
const rpc = get$1(rpcId);
|
|
@@ -1121,19 +1102,15 @@ const create$2 = rpcId => {
|
|
|
1121
1102
|
},
|
|
1122
1103
|
set(rpc) {
|
|
1123
1104
|
set$6(rpcId, rpc);
|
|
1124
|
-
},
|
|
1125
|
-
async dispose() {
|
|
1126
|
-
const rpc = get$1(rpcId);
|
|
1127
|
-
await rpc.dispose();
|
|
1128
1105
|
}
|
|
1129
1106
|
};
|
|
1130
1107
|
};
|
|
1131
1108
|
|
|
1132
1109
|
const {
|
|
1110
|
+
dispose,
|
|
1133
1111
|
invoke: invoke$4,
|
|
1134
1112
|
invokeAndTransfer: invokeAndTransfer$1,
|
|
1135
|
-
set: set$5
|
|
1136
|
-
dispose
|
|
1113
|
+
set: set$5
|
|
1137
1114
|
} = create$2(FileSystemWorker$1);
|
|
1138
1115
|
const remove$1 = async dirent => {
|
|
1139
1116
|
return invoke$4('FileSystem.remove', dirent);
|
|
@@ -1219,7 +1196,8 @@ const FileSystemWorker = {
|
|
|
1219
1196
|
|
|
1220
1197
|
const {
|
|
1221
1198
|
invoke: invoke$3,
|
|
1222
|
-
set: set$4
|
|
1199
|
+
set: set$4
|
|
1200
|
+
} = create$2(IconThemeWorker);
|
|
1223
1201
|
const getIcons = async iconRequests => {
|
|
1224
1202
|
// @ts-ignore
|
|
1225
1203
|
return invoke$3('IconTheme.getIcons', iconRequests);
|
|
@@ -1228,7 +1206,8 @@ const getIcons = async iconRequests => {
|
|
|
1228
1206
|
const {
|
|
1229
1207
|
invoke: invoke$2,
|
|
1230
1208
|
invokeAndTransfer,
|
|
1231
|
-
set: set$3
|
|
1209
|
+
set: set$3
|
|
1210
|
+
} = create$2(RendererWorker);
|
|
1232
1211
|
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1233
1212
|
number(uid);
|
|
1234
1213
|
number(menuId);
|
|
@@ -1263,7 +1242,8 @@ const sendMessagePortToSourceControlWorker = async port => {
|
|
|
1263
1242
|
|
|
1264
1243
|
const {
|
|
1265
1244
|
invoke: invoke$1,
|
|
1266
|
-
set: set$2
|
|
1245
|
+
set: set$2
|
|
1246
|
+
} = create$2(SourceControlWorker);
|
|
1267
1247
|
|
|
1268
1248
|
const toCommandId = key => {
|
|
1269
1249
|
const dotIndex = key.indexOf('.');
|
|
@@ -1834,7 +1814,7 @@ const Copy = 'Copy';
|
|
|
1834
1814
|
const CopyPath = 'Copy Path';
|
|
1835
1815
|
const CopyRelativePath = 'Copy Relative Path';
|
|
1836
1816
|
const Cut = 'Cut';
|
|
1837
|
-
const Delete = 'Delete';
|
|
1817
|
+
const Delete$1 = 'Delete';
|
|
1838
1818
|
const FileNameCannotStartWithSlash = 'A file or folder name cannot start with a slash.';
|
|
1839
1819
|
const FileOrFolderAlreadyExists = 'A file or folder **{PH1}** already exists at this location. Please choose a different name.';
|
|
1840
1820
|
const FileOrFolderNameMustBeProvider = 'A file or folder name must be provided.';
|
|
@@ -1883,7 +1863,7 @@ const rename = () => {
|
|
|
1883
1863
|
return i18nString(Rename);
|
|
1884
1864
|
};
|
|
1885
1865
|
const deleteItem = () => {
|
|
1886
|
-
return i18nString(Delete);
|
|
1866
|
+
return i18nString(Delete$1);
|
|
1887
1867
|
};
|
|
1888
1868
|
const refresh$1 = () => {
|
|
1889
1869
|
return i18nString(RefreshExplorer);
|
|
@@ -2457,6 +2437,29 @@ const Viewlet = 'Viewlet';
|
|
|
2457
2437
|
const Welcome = 'Welcome';
|
|
2458
2438
|
const WelcomeMessage = 'WelcomeMessage';
|
|
2459
2439
|
|
|
2440
|
+
const Text = 12;
|
|
2441
|
+
|
|
2442
|
+
const Enter = 3;
|
|
2443
|
+
const Escape = 8;
|
|
2444
|
+
const Space = 9;
|
|
2445
|
+
const End = 255;
|
|
2446
|
+
const Home = 12;
|
|
2447
|
+
const LeftArrow = 13;
|
|
2448
|
+
const UpArrow = 14;
|
|
2449
|
+
const RightArrow = 15;
|
|
2450
|
+
const DownArrow = 16;
|
|
2451
|
+
const Delete = 18;
|
|
2452
|
+
const KeyA = 29;
|
|
2453
|
+
const KeyC = 31;
|
|
2454
|
+
const KeyV = 50;
|
|
2455
|
+
const KeyX = 52;
|
|
2456
|
+
const F2 = 58;
|
|
2457
|
+
const Star = 131;
|
|
2458
|
+
|
|
2459
|
+
const CtrlCmd = 1 << 11 >>> 0;
|
|
2460
|
+
const Shift = 1 << 10 >>> 0;
|
|
2461
|
+
const Alt = 1 << 9 >>> 0;
|
|
2462
|
+
|
|
2460
2463
|
const mergeClassNames = (...classNames) => {
|
|
2461
2464
|
return classNames.filter(Boolean).join(' ');
|
|
2462
2465
|
};
|
|
@@ -2625,8 +2628,9 @@ const ListItem = 22;
|
|
|
2625
2628
|
const Slash = '/';
|
|
2626
2629
|
|
|
2627
2630
|
// TODO parentUid might ot be needed
|
|
2628
|
-
const create = (id, uri, x, y, width, height, args, parentUid, platform = 0) => {
|
|
2631
|
+
const create = (id, uri, x, y, width, height, args, parentUid, platform = 0, assetDir = '') => {
|
|
2629
2632
|
const state = {
|
|
2633
|
+
assetDir,
|
|
2630
2634
|
confirmDelete: false,
|
|
2631
2635
|
confirmPaste: false,
|
|
2632
2636
|
cutItems: [],
|
|
@@ -2685,8 +2689,8 @@ const create = (id, uri, x, y, width, height, args, parentUid, platform = 0) =>
|
|
|
2685
2689
|
};
|
|
2686
2690
|
|
|
2687
2691
|
// TODO parentUid might ot be needed
|
|
2688
|
-
const create2 = (uid, uri, x, y, width, height, args, parentUid, platform = 0) => {
|
|
2689
|
-
return create(uid, uri, x, y, width, height, args, parentUid, platform);
|
|
2692
|
+
const create2 = (uid, uri, x, y, width, height, args, parentUid, platform = 0, assetDir = '') => {
|
|
2693
|
+
return create(uid, uri, x, y, width, height, args, parentUid, platform, assetDir);
|
|
2690
2694
|
};
|
|
2691
2695
|
|
|
2692
2696
|
const isEqual$6 = (oldState, newState) => {
|
|
@@ -3071,7 +3075,7 @@ const getKeyBindings = () => {
|
|
|
3071
3075
|
when: FocusExplorerEditBox
|
|
3072
3076
|
}, {
|
|
3073
3077
|
command: 'Explorer.removeDirent',
|
|
3074
|
-
key: Delete
|
|
3078
|
+
key: Delete,
|
|
3075
3079
|
when: FocusExplorer
|
|
3076
3080
|
}, {
|
|
3077
3081
|
command: 'Explorer.focusNone',
|