@lvce-editor/explorer-view 5.21.0 → 5.23.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.
@@ -1389,7 +1389,6 @@ const showContextMenu2 = async (uid, menuId, x, y, args) => {
1389
1389
  number(menuId);
1390
1390
  number(x);
1391
1391
  number(y);
1392
- // @ts-ignore
1393
1392
  await invoke$2('ContextMenu.show2', uid, menuId, x, y, args);
1394
1393
  };
1395
1394
  const getFileHandles$1 = async fileIds => {
@@ -1398,16 +1397,13 @@ const getFileHandles$1 = async fileIds => {
1398
1397
  };
1399
1398
  const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
1400
1399
  const command = 'IconTheme.handleMessagePort';
1401
- // @ts-ignore
1402
1400
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
1403
1401
  };
1404
1402
  const sendMessagePortToFileSystemWorker$1 = async (port, rpcId) => {
1405
1403
  const command = 'FileSystem.handleMessagePort';
1406
- // @ts-ignore
1407
1404
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
1408
1405
  };
1409
1406
  const confirm = async (message, options) => {
1410
- // @ts-ignore
1411
1407
  const result = await invoke$2('ConfirmPrompt.prompt', message, options);
1412
1408
  return result;
1413
1409
  };
@@ -1416,7 +1412,6 @@ const writeClipBoardText = async text => {
1416
1412
  };
1417
1413
  const sendMessagePortToSourceControlWorker = async port => {
1418
1414
  const command = 'SourceControl.handleMessagePort';
1419
- // @ts-ignore
1420
1415
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
1421
1416
  };
1422
1417
 
@@ -2921,6 +2916,9 @@ const wrapListItemCommand = fn => {
2921
2916
  newState
2922
2917
  } = get(id);
2923
2918
  const updatedState = await fn(newState, ...args);
2919
+ if (newState === updatedState) {
2920
+ return;
2921
+ }
2924
2922
  const {
2925
2923
  cutItems,
2926
2924
  decorations,
@@ -3852,10 +3850,18 @@ const getNewDirentsForNewDirent = async (items, focusedIndex, type, root) => {
3852
3850
  const parentIndex = focusedIndex;
3853
3851
  const itemsBeforeParent = items.slice(0, parentIndex);
3854
3852
  const itemsAfterChildren = items.slice(parentIndex + updatedChildren.length);
3855
- const updatedParent = {
3853
+ let updatedParent = {
3856
3854
  ...items[parentIndex],
3857
3855
  setSize: (items[parentIndex]?.setSize || 0) + 1
3858
3856
  };
3857
+
3858
+ // If the parent is a closed Directory, expand it
3859
+ if (updatedParent.type === Directory) {
3860
+ updatedParent = {
3861
+ ...updatedParent,
3862
+ type: DirectoryExpanded
3863
+ };
3864
+ }
3859
3865
  return [...itemsBeforeParent, updatedParent, ...updatedChildren, ...itemsAfterChildren];
3860
3866
  };
3861
3867
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/explorer-view",
3
- "version": "5.21.0",
3
+ "version": "5.23.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",