@lvce-editor/explorer-view 7.3.0 → 7.5.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 +37 -29
- package/package.json +1 -1
|
@@ -3966,6 +3966,9 @@ const getNewDirentsForNewDirent = async (items, focusedIndex, type, root) => {
|
|
|
3966
3966
|
setSize: 1,
|
|
3967
3967
|
type
|
|
3968
3968
|
};
|
|
3969
|
+
if (type === EditingFolder) {
|
|
3970
|
+
return [newDirent, ...items];
|
|
3971
|
+
}
|
|
3969
3972
|
return [...items, newDirent];
|
|
3970
3973
|
}
|
|
3971
3974
|
const focusedItem = items[focusedIndex];
|
|
@@ -4006,7 +4009,7 @@ const getNewDirentType = editingType => {
|
|
|
4006
4009
|
}
|
|
4007
4010
|
};
|
|
4008
4011
|
|
|
4009
|
-
const newDirent = async (state, editingType) => {
|
|
4012
|
+
const newDirent = async (state, editingType, editingIcon = '') => {
|
|
4010
4013
|
// TODO do it like vscode, select position between folders and files
|
|
4011
4014
|
const {
|
|
4012
4015
|
editingIndex,
|
|
@@ -4023,6 +4026,7 @@ const newDirent = async (state, editingType) => {
|
|
|
4023
4026
|
const newEditingIndex = newDirents.findIndex(item => item.type === EditingFile || item.type === EditingFolder);
|
|
4024
4027
|
return {
|
|
4025
4028
|
...state,
|
|
4029
|
+
editingIcon,
|
|
4026
4030
|
editingIndex: newEditingIndex,
|
|
4027
4031
|
editingType,
|
|
4028
4032
|
editingValue: '',
|
|
@@ -4037,8 +4041,38 @@ const newFile = state => {
|
|
|
4037
4041
|
return newDirent(state, CreateFile);
|
|
4038
4042
|
};
|
|
4039
4043
|
|
|
4040
|
-
const
|
|
4041
|
-
|
|
4044
|
+
const getEditingIcon = async (editingType, value, direntType) => {
|
|
4045
|
+
if (editingType === CreateFile) {
|
|
4046
|
+
return invoke$2('IconTheme.getFileIcon', {
|
|
4047
|
+
name: value
|
|
4048
|
+
});
|
|
4049
|
+
}
|
|
4050
|
+
if (editingType === Rename$1) {
|
|
4051
|
+
if (direntType === File || direntType === EditingFile) {
|
|
4052
|
+
return invoke$2('IconTheme.getFileIcon', {
|
|
4053
|
+
name: value
|
|
4054
|
+
});
|
|
4055
|
+
}
|
|
4056
|
+
if (direntType !== undefined && [Directory, EditingFolder, EditingDirectoryExpanded].includes(direntType)) {
|
|
4057
|
+
return invoke$2('IconTheme.getFolderIcon', {
|
|
4058
|
+
name: value
|
|
4059
|
+
});
|
|
4060
|
+
}
|
|
4061
|
+
}
|
|
4062
|
+
if (editingType === CreateFolder) {
|
|
4063
|
+
return invoke$2('IconTheme.getFolderIcon', {
|
|
4064
|
+
name: value
|
|
4065
|
+
});
|
|
4066
|
+
}
|
|
4067
|
+
return '';
|
|
4068
|
+
};
|
|
4069
|
+
|
|
4070
|
+
const newFolder = async state => {
|
|
4071
|
+
if (state.editingIndex !== -1) {
|
|
4072
|
+
return state;
|
|
4073
|
+
}
|
|
4074
|
+
const editingIcon = await getEditingIcon(CreateFolder, '');
|
|
4075
|
+
return newDirent(state, CreateFolder, editingIcon);
|
|
4042
4076
|
};
|
|
4043
4077
|
|
|
4044
4078
|
const isExpanded = item => {
|
|
@@ -6896,32 +6930,6 @@ const selectUp = state => {
|
|
|
6896
6930
|
};
|
|
6897
6931
|
};
|
|
6898
6932
|
|
|
6899
|
-
const getEditingIcon = async (editingType, value, direntType) => {
|
|
6900
|
-
if (editingType === CreateFile) {
|
|
6901
|
-
return invoke$2('IconTheme.getFileIcon', {
|
|
6902
|
-
name: value
|
|
6903
|
-
});
|
|
6904
|
-
}
|
|
6905
|
-
if (editingType === Rename$1) {
|
|
6906
|
-
if (direntType === File || direntType === EditingFile) {
|
|
6907
|
-
return invoke$2('IconTheme.getFileIcon', {
|
|
6908
|
-
name: value
|
|
6909
|
-
});
|
|
6910
|
-
}
|
|
6911
|
-
if (direntType !== undefined && [Directory, EditingFolder, EditingDirectoryExpanded].includes(direntType)) {
|
|
6912
|
-
return invoke$2('IconTheme.getFolderIcon', {
|
|
6913
|
-
name: value
|
|
6914
|
-
});
|
|
6915
|
-
}
|
|
6916
|
-
}
|
|
6917
|
-
if (editingType === CreateFolder) {
|
|
6918
|
-
return invoke$2('IconTheme.getFolderIcon', {
|
|
6919
|
-
name: value
|
|
6920
|
-
});
|
|
6921
|
-
}
|
|
6922
|
-
return '';
|
|
6923
|
-
};
|
|
6924
|
-
|
|
6925
6933
|
const updateEditingValue = async (state, value, inputSource = User) => {
|
|
6926
6934
|
const {
|
|
6927
6935
|
editingIndex,
|