@lvce-editor/source-control-worker 3.17.0 → 3.18.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/settings.json +1 -1
- package/dist/sourceControlWorkerMain.js +19 -11
- package/package.json +1 -1
package/dist/settings.json
CHANGED
|
@@ -2038,6 +2038,18 @@ const getEnabledProviderIds = (scheme, root, assetDir, platform) => {
|
|
|
2038
2038
|
const getGroups$1 = (providerId, root, assetDir, platform) => {
|
|
2039
2039
|
return getGroups$2(providerId, root, assetDir, platform);
|
|
2040
2040
|
};
|
|
2041
|
+
const getIconDefinition = (icon, baseUri, platform) => {
|
|
2042
|
+
if (!URL.canParse(icon, baseUri)) {
|
|
2043
|
+
throw new Error('Invalid source control icon URL');
|
|
2044
|
+
}
|
|
2045
|
+
const uri = new URL(icon, baseUri).href;
|
|
2046
|
+
if (platform === Electron || platform === Remote) {
|
|
2047
|
+
const protocol = getProtocol(uri);
|
|
2048
|
+
const path = getPath(protocol, uri);
|
|
2049
|
+
return `/remote${path.startsWith('/') ? '' : '/'}${path}`;
|
|
2050
|
+
}
|
|
2051
|
+
return uri;
|
|
2052
|
+
};
|
|
2041
2053
|
const getIconDefinitions = async (providerIds, assetDir, platform) => {
|
|
2042
2054
|
try {
|
|
2043
2055
|
if (providerIds.length === 0) {
|
|
@@ -2053,15 +2065,7 @@ const getIconDefinitions = async (providerIds, assetDir, platform) => {
|
|
|
2053
2065
|
}
|
|
2054
2066
|
const icons = extension['source-control-icons'].filter(icon => typeof icon === 'string');
|
|
2055
2067
|
const baseUri = extension.uri.endsWith('/') ? extension.uri : `${extension.uri}/`;
|
|
2056
|
-
return icons.map(icon =>
|
|
2057
|
-
const uri = new URL(icon, baseUri).href;
|
|
2058
|
-
if (platform === Electron || platform === Remote) {
|
|
2059
|
-
const protocol = getProtocol(uri);
|
|
2060
|
-
const path = getPath(protocol, uri);
|
|
2061
|
-
return `/remote${path.startsWith('/') ? '' : '/'}${path}`;
|
|
2062
|
-
}
|
|
2063
|
-
return uri;
|
|
2064
|
-
});
|
|
2068
|
+
return icons.map(icon => getIconDefinition(icon, baseUri, platform));
|
|
2065
2069
|
} catch {
|
|
2066
2070
|
return [];
|
|
2067
2071
|
}
|
|
@@ -3914,6 +3918,9 @@ const getIconsDom = (icon, fileIcon) => {
|
|
|
3914
3918
|
if (icon === ChevronRight) {
|
|
3915
3919
|
return [chevron, getIconVirtualDom(icon)];
|
|
3916
3920
|
}
|
|
3921
|
+
if (!fileIcon) {
|
|
3922
|
+
return [];
|
|
3923
|
+
}
|
|
3917
3924
|
return [getFileIconVirtualDom(fileIcon)];
|
|
3918
3925
|
};
|
|
3919
3926
|
const createItemOther = item => {
|
|
@@ -3935,16 +3942,17 @@ const createItemOther = item => {
|
|
|
3935
3942
|
const dom = [];
|
|
3936
3943
|
const hasButtons = buttons.length;
|
|
3937
3944
|
const buttonsDom = getButtonsVirtualDom(buttons);
|
|
3945
|
+
const iconsDom = getIconsDom(icon, fileIcon);
|
|
3938
3946
|
const treeItemClassName = getTreeItemClassName(indent);
|
|
3939
3947
|
dom.push({
|
|
3940
3948
|
ariaPosInSet: posInSet,
|
|
3941
3949
|
ariaSetSize: setSize,
|
|
3942
|
-
childCount:
|
|
3950
|
+
childCount: 2 + (iconsDom.length > 0 ? 1 : 0) + (hasButtons ? 1 : 0),
|
|
3943
3951
|
className: treeItemClassName,
|
|
3944
3952
|
role: TreeItem$1,
|
|
3945
3953
|
title: file,
|
|
3946
3954
|
type: Div
|
|
3947
|
-
}, ...
|
|
3955
|
+
}, ...iconsDom);
|
|
3948
3956
|
const labelDom = {
|
|
3949
3957
|
childCount: 1,
|
|
3950
3958
|
className: labelClassName,
|