@lvce-editor/source-control-worker 3.17.1 → 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
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
|
}
|