@lvce-editor/explorer-view 5.23.0 → 5.24.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 +24 -85
- package/package.json +1 -1
|
@@ -150,6 +150,7 @@ const Rename$2 = 4;
|
|
|
150
150
|
const Remove = 5;
|
|
151
151
|
|
|
152
152
|
const Text = 12;
|
|
153
|
+
const Reference = 100;
|
|
153
154
|
|
|
154
155
|
const Button$3 = 'event.button';
|
|
155
156
|
const ClientX = 'event.clientX';
|
|
@@ -677,7 +678,7 @@ const callbacks = Object.create(null);
|
|
|
677
678
|
const get$2 = id => {
|
|
678
679
|
return callbacks[id];
|
|
679
680
|
};
|
|
680
|
-
const remove$
|
|
681
|
+
const remove$2 = id => {
|
|
681
682
|
delete callbacks[id];
|
|
682
683
|
};
|
|
683
684
|
class JsonRpcError extends Error {
|
|
@@ -830,7 +831,7 @@ const resolve = (id, response) => {
|
|
|
830
831
|
return;
|
|
831
832
|
}
|
|
832
833
|
fn(response);
|
|
833
|
-
remove$
|
|
834
|
+
remove$2(id);
|
|
834
835
|
};
|
|
835
836
|
const E_COMMAND_NOT_FOUND = 'E_COMMAND_NOT_FOUND';
|
|
836
837
|
const getErrorType = prettyError => {
|
|
@@ -1244,7 +1245,7 @@ const set$6 = (id, rpc) => {
|
|
|
1244
1245
|
const get$1 = id => {
|
|
1245
1246
|
return rpcs[id];
|
|
1246
1247
|
};
|
|
1247
|
-
const remove$
|
|
1248
|
+
const remove$1 = id => {
|
|
1248
1249
|
delete rpcs[id];
|
|
1249
1250
|
};
|
|
1250
1251
|
|
|
@@ -1274,7 +1275,7 @@ const create$1 = rpcId => {
|
|
|
1274
1275
|
set$6(rpcId, mockRpc);
|
|
1275
1276
|
// @ts-ignore
|
|
1276
1277
|
mockRpc[Symbol.dispose] = () => {
|
|
1277
|
-
remove$
|
|
1278
|
+
remove$1(rpcId);
|
|
1278
1279
|
};
|
|
1279
1280
|
// @ts-ignore
|
|
1280
1281
|
return mockRpc;
|
|
@@ -1286,88 +1287,12 @@ const create$1 = rpcId => {
|
|
|
1286
1287
|
};
|
|
1287
1288
|
|
|
1288
1289
|
const {
|
|
1289
|
-
dispose,
|
|
1290
|
-
invoke: invoke$4,
|
|
1291
|
-
invokeAndTransfer: invokeAndTransfer$1,
|
|
1292
|
-
registerMockRpc,
|
|
1293
1290
|
set: set$5
|
|
1294
1291
|
} = create$1(FileSystemWorker$1);
|
|
1295
|
-
const remove$1 = async dirent => {
|
|
1296
|
-
return invoke$4('FileSystem.remove', dirent);
|
|
1297
|
-
};
|
|
1298
|
-
const readDirWithFileTypes$1 = async uri => {
|
|
1299
|
-
return invoke$4('FileSystem.readDirWithFileTypes', uri);
|
|
1300
|
-
};
|
|
1301
|
-
const getPathSeparator$2 = async root => {
|
|
1302
|
-
return invoke$4('FileSystem.getPathSeparator', root);
|
|
1303
|
-
};
|
|
1304
|
-
const getRealPath$1 = async path => {
|
|
1305
|
-
return invoke$4('FileSystem.getRealPath', path);
|
|
1306
|
-
};
|
|
1307
|
-
const stat$1 = async dirent => {
|
|
1308
|
-
return invoke$4('FileSystem.stat', dirent);
|
|
1309
|
-
};
|
|
1310
|
-
const createFile = async uri => {
|
|
1311
|
-
return invoke$4('FileSystem.writeFile', uri, '');
|
|
1312
|
-
};
|
|
1313
|
-
const readFile = async uri => {
|
|
1314
|
-
return invoke$4('FileSystem.readFile', uri);
|
|
1315
|
-
};
|
|
1316
|
-
const writeFile$1 = async (uri, content) => {
|
|
1317
|
-
return invoke$4('FileSystem.writeFile', uri, content);
|
|
1318
|
-
};
|
|
1319
|
-
const mkdir$1 = async uri => {
|
|
1320
|
-
return invoke$4('FileSystem.mkdir', uri);
|
|
1321
|
-
};
|
|
1322
|
-
const rename$2 = async (oldUri, newUri) => {
|
|
1323
|
-
return invoke$4('FileSystem.rename', oldUri, newUri);
|
|
1324
|
-
};
|
|
1325
|
-
const copy$2 = async (oldUri, newUri) => {
|
|
1326
|
-
return invoke$4('FileSystem.copy', oldUri, newUri);
|
|
1327
|
-
};
|
|
1328
|
-
const exists = async uri => {
|
|
1329
|
-
return invoke$4('FileSystem.exists', uri);
|
|
1330
|
-
};
|
|
1331
|
-
const getFolderSize = async uri => {
|
|
1332
|
-
return invoke$4('FileSystem.getFolderSize', uri);
|
|
1333
|
-
};
|
|
1334
|
-
const readFileAsBlob = async uri => {
|
|
1335
|
-
return invoke$4('FileSystem.readFileAsBlob', uri);
|
|
1336
|
-
};
|
|
1337
|
-
const appendFile = async (uri, text) => {
|
|
1338
|
-
return invoke$4('FileSystem.appendFile', uri, text);
|
|
1339
|
-
};
|
|
1340
|
-
const watchFile = async (watchId, uri, rpcId) => {
|
|
1341
|
-
await invoke$4('FileSystem.watchFile', watchId, uri, rpcId);
|
|
1342
|
-
};
|
|
1343
|
-
const unwatchFile = async watchId => {
|
|
1344
|
-
await invoke$4('FileSystem.unwatchFile', watchId);
|
|
1345
|
-
};
|
|
1346
1292
|
|
|
1347
1293
|
const FileSystemWorker = {
|
|
1348
1294
|
__proto__: null,
|
|
1349
|
-
|
|
1350
|
-
copy: copy$2,
|
|
1351
|
-
createFile,
|
|
1352
|
-
dispose,
|
|
1353
|
-
exists,
|
|
1354
|
-
getFolderSize,
|
|
1355
|
-
getPathSeparator: getPathSeparator$2,
|
|
1356
|
-
getRealPath: getRealPath$1,
|
|
1357
|
-
invoke: invoke$4,
|
|
1358
|
-
invokeAndTransfer: invokeAndTransfer$1,
|
|
1359
|
-
mkdir: mkdir$1,
|
|
1360
|
-
readDirWithFileTypes: readDirWithFileTypes$1,
|
|
1361
|
-
readFile,
|
|
1362
|
-
readFileAsBlob,
|
|
1363
|
-
registerMockRpc,
|
|
1364
|
-
remove: remove$1,
|
|
1365
|
-
rename: rename$2,
|
|
1366
|
-
set: set$5,
|
|
1367
|
-
stat: stat$1,
|
|
1368
|
-
unwatchFile,
|
|
1369
|
-
watchFile,
|
|
1370
|
-
writeFile: writeFile$1
|
|
1295
|
+
set: set$5
|
|
1371
1296
|
};
|
|
1372
1297
|
|
|
1373
1298
|
const {
|
|
@@ -1838,6 +1763,10 @@ const mergeTrees = (a, b) => {
|
|
|
1838
1763
|
};
|
|
1839
1764
|
};
|
|
1840
1765
|
|
|
1766
|
+
const openUri = async (uri, focus) => {
|
|
1767
|
+
await invoke$2(/* Main.openAbsolutePath */'Main.openUri', /* absolutePath */uri, /* focus */focus);
|
|
1768
|
+
};
|
|
1769
|
+
|
|
1841
1770
|
const refreshWorkspace = async () => {
|
|
1842
1771
|
// TODO maybe pass an application id to this?
|
|
1843
1772
|
try {
|
|
@@ -2050,6 +1979,9 @@ const acceptCreate = async (state, newDirentType) => {
|
|
|
2050
1979
|
const dirents = newItems;
|
|
2051
1980
|
const newFocusedIndex = getIndex(newItems, absolutePath);
|
|
2052
1981
|
await refreshWorkspace();
|
|
1982
|
+
if (newDirentType === File) {
|
|
1983
|
+
await openUri(absolutePath, true);
|
|
1984
|
+
}
|
|
2053
1985
|
return {
|
|
2054
1986
|
...state,
|
|
2055
1987
|
editingIndex: -1,
|
|
@@ -2546,6 +2478,7 @@ const NavigateChild = 7;
|
|
|
2546
2478
|
const NavigateParent = 8;
|
|
2547
2479
|
const RemoveChild = 9;
|
|
2548
2480
|
const NavigateSibling = 10;
|
|
2481
|
+
const SetReferenceNodeUid = 11;
|
|
2549
2482
|
|
|
2550
2483
|
const isKey = key => {
|
|
2551
2484
|
return key !== 'type' && key !== 'childCount';
|
|
@@ -2613,6 +2546,16 @@ const compareNodes = (oldNode, newNode) => {
|
|
|
2613
2546
|
if (oldNode.type !== newNode.type) {
|
|
2614
2547
|
return null;
|
|
2615
2548
|
}
|
|
2549
|
+
// Handle reference nodes - special handling for uid changes
|
|
2550
|
+
if (oldNode.type === Reference) {
|
|
2551
|
+
if (oldNode.uid !== newNode.uid) {
|
|
2552
|
+
patches.push({
|
|
2553
|
+
type: SetReferenceNodeUid,
|
|
2554
|
+
uid: newNode.uid
|
|
2555
|
+
});
|
|
2556
|
+
}
|
|
2557
|
+
return patches;
|
|
2558
|
+
}
|
|
2616
2559
|
// Handle text nodes
|
|
2617
2560
|
if (oldNode.type === Text && newNode.type === Text) {
|
|
2618
2561
|
if (oldNode.text !== newNode.text) {
|
|
@@ -3713,10 +3656,6 @@ const handleClickDirectory = async (state, dirent, index, keepFocus) => {
|
|
|
3713
3656
|
};
|
|
3714
3657
|
};
|
|
3715
3658
|
|
|
3716
|
-
const openUri = async (uri, focus) => {
|
|
3717
|
-
await invoke$2(/* Main.openAbsolutePath */'Main.openUri', /* absolutePath */uri, /* focus */focus);
|
|
3718
|
-
};
|
|
3719
|
-
|
|
3720
3659
|
const handleClickFile = async (state, dirent, index, keepFocus = false) => {
|
|
3721
3660
|
await openUri(dirent.path, !keepFocus);
|
|
3722
3661
|
return {
|