@lvce-editor/explorer-view 5.3.0 → 5.4.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.
|
@@ -4636,6 +4636,16 @@ const getWorkspacePath = () => {
|
|
|
4636
4636
|
return invoke$2('Workspace.getPath');
|
|
4637
4637
|
};
|
|
4638
4638
|
|
|
4639
|
+
const isValid = decoration => {
|
|
4640
|
+
return decoration && typeof decoration.decoration === 'string' && typeof decoration.uri === 'string';
|
|
4641
|
+
};
|
|
4642
|
+
const normalizeDecorations = decorations => {
|
|
4643
|
+
if (!decorations || !Array.isArray(decorations)) {
|
|
4644
|
+
return [];
|
|
4645
|
+
}
|
|
4646
|
+
return decorations.filter(isValid);
|
|
4647
|
+
};
|
|
4648
|
+
|
|
4639
4649
|
const getFileDecorations = async (scheme, root, maybeUris, decorationsEnabled) => {
|
|
4640
4650
|
try {
|
|
4641
4651
|
if (!decorationsEnabled) {
|
|
@@ -4649,7 +4659,8 @@ const getFileDecorations = async (scheme, root, maybeUris, decorationsEnabled) =
|
|
|
4649
4659
|
const providerId = providerIds.at(-1);
|
|
4650
4660
|
const uris = ensureUris(maybeUris);
|
|
4651
4661
|
const decorations = await invoke$1('SourceControl.getFileDecorations', providerId, uris);
|
|
4652
|
-
|
|
4662
|
+
const normalized = normalizeDecorations(decorations);
|
|
4663
|
+
return normalized;
|
|
4653
4664
|
} catch (error) {
|
|
4654
4665
|
console.error(error);
|
|
4655
4666
|
return [];
|
|
@@ -4840,6 +4851,10 @@ const handleWorkspaceChange = async state => {
|
|
|
4840
4851
|
return newState;
|
|
4841
4852
|
};
|
|
4842
4853
|
|
|
4854
|
+
const handleWorkspaceRefresh = async state => {
|
|
4855
|
+
return refresh(state);
|
|
4856
|
+
};
|
|
4857
|
+
|
|
4843
4858
|
const sendMessagePortToFileSystemWorker = async port => {
|
|
4844
4859
|
await sendMessagePortToFileSystemWorker$1(port, 0);
|
|
4845
4860
|
};
|
|
@@ -6128,6 +6143,7 @@ const commandMap = {
|
|
|
6128
6143
|
'Explorer.handleUpload': wrapListItemCommand(handleUpload),
|
|
6129
6144
|
'Explorer.handleWheel': wrapListItemCommand(handleWheel),
|
|
6130
6145
|
'Explorer.handleWorkspaceChange': wrapListItemCommand(handleWorkspaceChange),
|
|
6146
|
+
'Explorer.handleWorkspaceRefresh': wrapListItemCommand(handleWorkspaceRefresh),
|
|
6131
6147
|
'Explorer.loadContent': wrapListItemCommand(loadContent),
|
|
6132
6148
|
'Explorer.newFile': wrapListItemCommand(newFile),
|
|
6133
6149
|
'Explorer.newFolder': wrapListItemCommand(newFolder),
|