@lvce-editor/main-area-worker 9.54.1 → 9.54.2
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/mainAreaWorkerMain.js +32 -21
- package/package.json +1 -1
|
@@ -4107,8 +4107,6 @@ const getIconsCached = (dirents, fileIconCache) => {
|
|
|
4107
4107
|
return dirents.map(dirent => fileIconCache[dirent]);
|
|
4108
4108
|
};
|
|
4109
4109
|
|
|
4110
|
-
const ExtensionDetailScheme$1 = 'extension-detail://';
|
|
4111
|
-
const RunningExtensionsScheme$1 = 'running-extensions://';
|
|
4112
4110
|
const getBasename = uri => {
|
|
4113
4111
|
const lastSlashIndex = uri.lastIndexOf('/');
|
|
4114
4112
|
if (lastSlashIndex === -1) {
|
|
@@ -4119,7 +4117,7 @@ const getBasename = uri => {
|
|
|
4119
4117
|
const getMissingTabs = (tabs, fileIconCache) => {
|
|
4120
4118
|
const missingTabs = [];
|
|
4121
4119
|
for (const tab of tabs) {
|
|
4122
|
-
if (tab.uri && !
|
|
4120
|
+
if (tab.uri && !getFileIcon(tab.uri) && !(tab.uri in fileIconCache)) {
|
|
4123
4121
|
missingTabs.push(tab);
|
|
4124
4122
|
}
|
|
4125
4123
|
}
|
|
@@ -5609,40 +5607,53 @@ const getAllTabs$1 = layout => {
|
|
|
5609
5607
|
return allTabs;
|
|
5610
5608
|
};
|
|
5611
5609
|
|
|
5610
|
+
const updateLayoutIcons = (layout, fileIconCache, preserveExisting) => {
|
|
5611
|
+
const {
|
|
5612
|
+
groups
|
|
5613
|
+
} = layout;
|
|
5614
|
+
return {
|
|
5615
|
+
...layout,
|
|
5616
|
+
groups: groups.map(group => ({
|
|
5617
|
+
...group,
|
|
5618
|
+
tabs: group.tabs.map(tab => {
|
|
5619
|
+
const {
|
|
5620
|
+
icon: existingIcon
|
|
5621
|
+
} = tab;
|
|
5622
|
+
const uri = tab.uri || '';
|
|
5623
|
+
const builtInIcon = getFileIcon(uri);
|
|
5624
|
+
let icon = fileIconCache[uri];
|
|
5625
|
+
if (preserveExisting && !(uri in fileIconCache)) {
|
|
5626
|
+
icon = existingIcon;
|
|
5627
|
+
}
|
|
5628
|
+
if (builtInIcon) {
|
|
5629
|
+
icon = builtInIcon;
|
|
5630
|
+
}
|
|
5631
|
+
return {
|
|
5632
|
+
...tab,
|
|
5633
|
+
icon
|
|
5634
|
+
};
|
|
5635
|
+
})
|
|
5636
|
+
}))
|
|
5637
|
+
};
|
|
5638
|
+
};
|
|
5612
5639
|
const loadFileIcons = async state => {
|
|
5613
5640
|
const {
|
|
5614
5641
|
fileIconCache,
|
|
5615
5642
|
layout
|
|
5616
5643
|
} = state;
|
|
5617
|
-
const {
|
|
5618
|
-
groups
|
|
5619
|
-
} = layout;
|
|
5620
5644
|
try {
|
|
5621
5645
|
const allTabs = getAllTabs$1(layout);
|
|
5622
5646
|
const {
|
|
5623
5647
|
newFileIconCache
|
|
5624
5648
|
} = await getFileIconsForTabs(allTabs, fileIconCache);
|
|
5625
|
-
|
|
5626
|
-
// Update tabs with their icons
|
|
5627
|
-
const updatedLayout = {
|
|
5628
|
-
...layout,
|
|
5629
|
-
groups: groups.map(group => ({
|
|
5630
|
-
...group,
|
|
5631
|
-
tabs: group.tabs.map(tab => ({
|
|
5632
|
-
...tab,
|
|
5633
|
-
icon: newFileIconCache[tab.uri || '']
|
|
5634
|
-
}))
|
|
5635
|
-
}))
|
|
5636
|
-
};
|
|
5637
5649
|
return {
|
|
5638
5650
|
fileIconCache: newFileIconCache,
|
|
5639
|
-
updatedLayout
|
|
5651
|
+
updatedLayout: updateLayoutIcons(layout, newFileIconCache, false)
|
|
5640
5652
|
};
|
|
5641
5653
|
} catch {
|
|
5642
|
-
// If icon request fails, continue without icons
|
|
5643
5654
|
return {
|
|
5644
5655
|
fileIconCache,
|
|
5645
|
-
updatedLayout: layout
|
|
5656
|
+
updatedLayout: updateLayoutIcons(layout, fileIconCache, true)
|
|
5646
5657
|
};
|
|
5647
5658
|
}
|
|
5648
5659
|
};
|