@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.
@@ -4,7 +4,7 @@
4
4
  "description": "Controls whether source control actions use a split button.",
5
5
  "heading": "Split Button",
6
6
  "id": "sourceControl.splitButtonEnabled",
7
- "type": 3,
7
+ "type": "boolean",
8
8
  "value": "false"
9
9
  }
10
10
  ]
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/source-control-worker",
3
- "version": "3.17.1",
3
+ "version": "3.18.0",
4
4
  "description": "Source Control Worker",
5
5
  "keywords": [
6
6
  "Lvce Editor"