@lvce-editor/explorer-view 5.23.0 → 5.25.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.
@@ -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$3 = id => {
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$3(id);
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$2 = id => {
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$2(rpcId);
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
- appendFile,
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 {
@@ -1414,6 +1339,9 @@ const sendMessagePortToSourceControlWorker = async port => {
1414
1339
  const command = 'SourceControl.handleMessagePort';
1415
1340
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
1416
1341
  };
1342
+ const openUri$1 = async (uri, focus, options) => {
1343
+ await invoke$2('Main.openUri', uri, focus, options);
1344
+ };
1417
1345
 
1418
1346
  const {
1419
1347
  invoke: invoke$1,
@@ -1838,6 +1766,10 @@ const mergeTrees = (a, b) => {
1838
1766
  };
1839
1767
  };
1840
1768
 
1769
+ const openUri = async (uri, focus) => {
1770
+ await openUri$1(uri, /* focus */focus);
1771
+ };
1772
+
1841
1773
  const refreshWorkspace = async () => {
1842
1774
  // TODO maybe pass an application id to this?
1843
1775
  try {
@@ -2050,6 +1982,9 @@ const acceptCreate = async (state, newDirentType) => {
2050
1982
  const dirents = newItems;
2051
1983
  const newFocusedIndex = getIndex(newItems, absolutePath);
2052
1984
  await refreshWorkspace();
1985
+ if (newDirentType === File) {
1986
+ await openUri(absolutePath, true);
1987
+ }
2053
1988
  return {
2054
1989
  ...state,
2055
1990
  editingIndex: -1,
@@ -2546,6 +2481,7 @@ const NavigateChild = 7;
2546
2481
  const NavigateParent = 8;
2547
2482
  const RemoveChild = 9;
2548
2483
  const NavigateSibling = 10;
2484
+ const SetReferenceNodeUid = 11;
2549
2485
 
2550
2486
  const isKey = key => {
2551
2487
  return key !== 'type' && key !== 'childCount';
@@ -2613,6 +2549,16 @@ const compareNodes = (oldNode, newNode) => {
2613
2549
  if (oldNode.type !== newNode.type) {
2614
2550
  return null;
2615
2551
  }
2552
+ // Handle reference nodes - special handling for uid changes
2553
+ if (oldNode.type === Reference) {
2554
+ if (oldNode.uid !== newNode.uid) {
2555
+ patches.push({
2556
+ type: SetReferenceNodeUid,
2557
+ uid: newNode.uid
2558
+ });
2559
+ }
2560
+ return patches;
2561
+ }
2616
2562
  // Handle text nodes
2617
2563
  if (oldNode.type === Text && newNode.type === Text) {
2618
2564
  if (oldNode.text !== newNode.text) {
@@ -3713,10 +3659,6 @@ const handleClickDirectory = async (state, dirent, index, keepFocus) => {
3713
3659
  };
3714
3660
  };
3715
3661
 
3716
- const openUri = async (uri, focus) => {
3717
- await invoke$2(/* Main.openAbsolutePath */'Main.openUri', /* absolutePath */uri, /* focus */focus);
3718
- };
3719
-
3720
3662
  const handleClickFile = async (state, dirent, index, keepFocus = false) => {
3721
3663
  await openUri(dirent.path, !keepFocus);
3722
3664
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/explorer-view",
3
- "version": "5.23.0",
3
+ "version": "5.25.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",