@lvce-editor/explorer-view 7.18.0 → 7.19.1
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 +22 -12
- package/package.json +1 -1
|
@@ -2251,7 +2251,7 @@ const openUri = async (uri, focus, options) => {
|
|
|
2251
2251
|
type: 'editor',
|
|
2252
2252
|
uri
|
|
2253
2253
|
},
|
|
2254
|
-
|
|
2254
|
+
focus,
|
|
2255
2255
|
preview: options.preview ?? false
|
|
2256
2256
|
});
|
|
2257
2257
|
return;
|
|
@@ -4251,7 +4251,7 @@ const getKeyBindings = () => {
|
|
|
4251
4251
|
key: Delete$1,
|
|
4252
4252
|
when: FocusExplorer
|
|
4253
4253
|
}, {
|
|
4254
|
-
command: 'Explorer.
|
|
4254
|
+
command: 'Explorer.handleEscape',
|
|
4255
4255
|
key: Escape,
|
|
4256
4256
|
when: FocusExplorer
|
|
4257
4257
|
}, {
|
|
@@ -4262,10 +4262,6 @@ const getKeyBindings = () => {
|
|
|
4262
4262
|
command: 'Explorer.handleClickCurrent',
|
|
4263
4263
|
key: Enter,
|
|
4264
4264
|
when: FocusExplorer
|
|
4265
|
-
}, {
|
|
4266
|
-
command: 'Explorer.handleEscape',
|
|
4267
|
-
key: Escape,
|
|
4268
|
-
when: FocusExplorer
|
|
4269
4265
|
}, {
|
|
4270
4266
|
command: 'Explorer.selectAll',
|
|
4271
4267
|
key: CtrlCmd | KeyA,
|
|
@@ -5215,11 +5211,12 @@ const handleContextMenuAtIndex = async (state, index, x, y) => {
|
|
|
5215
5211
|
number(x);
|
|
5216
5212
|
number(y);
|
|
5217
5213
|
const {
|
|
5214
|
+
focusedIndex,
|
|
5218
5215
|
items,
|
|
5219
5216
|
uid
|
|
5220
5217
|
} = state;
|
|
5221
5218
|
const contextMenuItem = items[index];
|
|
5222
|
-
const newItems = contextMenuItem && !contextMenuItem.selected ? items.map(item => ({
|
|
5219
|
+
const newItems = contextMenuItem && index !== focusedIndex && !contextMenuItem.selected ? items.map(item => ({
|
|
5223
5220
|
...item,
|
|
5224
5221
|
selected: false
|
|
5225
5222
|
})) : items;
|
|
@@ -5315,9 +5312,12 @@ const handleCut = async state => {
|
|
|
5315
5312
|
}
|
|
5316
5313
|
const files = dirents.map(dirent => dirent.path);
|
|
5317
5314
|
await writeNativeFiles('cut', files);
|
|
5315
|
+
await invoke$2('Focus.setFocus', FocusExplorer);
|
|
5318
5316
|
return {
|
|
5319
5317
|
...state,
|
|
5320
5318
|
cutItems: files,
|
|
5319
|
+
focus: List,
|
|
5320
|
+
focused: true,
|
|
5321
5321
|
pasteShouldMove: true
|
|
5322
5322
|
};
|
|
5323
5323
|
};
|
|
@@ -5343,7 +5343,16 @@ const handleDragEnd = state => {
|
|
|
5343
5343
|
};
|
|
5344
5344
|
|
|
5345
5345
|
const handleDragLeave = state => {
|
|
5346
|
-
|
|
5346
|
+
const {
|
|
5347
|
+
dropTargets
|
|
5348
|
+
} = state;
|
|
5349
|
+
if (dropTargets.length === 0) {
|
|
5350
|
+
return state;
|
|
5351
|
+
}
|
|
5352
|
+
return {
|
|
5353
|
+
...state,
|
|
5354
|
+
dropTargets: []
|
|
5355
|
+
};
|
|
5347
5356
|
};
|
|
5348
5357
|
|
|
5349
5358
|
const canBeDroppedInto = dirent => {
|
|
@@ -6114,7 +6123,7 @@ const handleDrop = async (state, x, y, fileIds, fileList) => {
|
|
|
6114
6123
|
|
|
6115
6124
|
const handleEscape = async state => {
|
|
6116
6125
|
return {
|
|
6117
|
-
...state,
|
|
6126
|
+
...focusNone(state),
|
|
6118
6127
|
cutItems: []
|
|
6119
6128
|
};
|
|
6120
6129
|
};
|
|
@@ -6750,9 +6759,10 @@ const openInIntegratedTerminal = async state => {
|
|
|
6750
6759
|
return state;
|
|
6751
6760
|
};
|
|
6752
6761
|
|
|
6753
|
-
const confirmDelete = async
|
|
6762
|
+
const confirmDelete = async items => {
|
|
6754
6763
|
// TODO use i18n string
|
|
6755
|
-
const
|
|
6764
|
+
const names = items.map(item => `"${item.name}"`).join(', ');
|
|
6765
|
+
const message = items.length === 1 ? `Are you sure you want to delete "${items[0].path}"?` : `Are you sure you want to delete ${names}?`;
|
|
6756
6766
|
const result = await confirm(message);
|
|
6757
6767
|
return result;
|
|
6758
6768
|
};
|
|
@@ -6776,7 +6786,7 @@ const removeDirent = async state => {
|
|
|
6776
6786
|
}
|
|
6777
6787
|
const toRemove = getPaths(selectedItems);
|
|
6778
6788
|
if (confirmDelete$1) {
|
|
6779
|
-
const confirmed = await confirmDelete(
|
|
6789
|
+
const confirmed = await confirmDelete(selectedItems);
|
|
6780
6790
|
if (!confirmed) {
|
|
6781
6791
|
return state;
|
|
6782
6792
|
}
|