@lvce-editor/extension-management-worker 4.78.2 → 4.78.3

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.
@@ -2275,6 +2275,11 @@ const getExtensionAbsolutePath = (id, isWeb, isBuiltin, path, relativePath, orig
2275
2275
  }
2276
2276
  return new URL(relativePath, path + '/').href;
2277
2277
  }
2278
+ if (path.startsWith('file://')) {
2279
+ const baseUrl = path.endsWith('/') ? path : `${path}/`;
2280
+ const absolutePath = new URL(relativePath, baseUrl).pathname;
2281
+ return new URL('/remote' + absolutePath, origin).href;
2282
+ }
2278
2283
  if (!path.startsWith('/')) {
2279
2284
  path = '/' + path;
2280
2285
  }
@@ -2307,10 +2312,12 @@ const getUrlPrefix = (platform, extensionPath) => {
2307
2312
  if (platform === Web) {
2308
2313
  return extensionPath;
2309
2314
  }
2310
- if (extensionPath.startsWith('/')) {
2311
- return `/remote${extensionPath}`;
2315
+ const withoutPrefix = extensionPath.startsWith('file://') ? extensionPath.slice('file://'.length) : extensionPath;
2316
+ const normalized = withoutPrefix.replaceAll('\\', '/');
2317
+ if (normalized.startsWith('/')) {
2318
+ return `/remote${normalized}`;
2312
2319
  }
2313
- return `/remote/${extensionPath}`;
2320
+ return `/remote/${normalized}`;
2314
2321
  };
2315
2322
 
2316
2323
  /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
@@ -5960,10 +5967,12 @@ const getRemoteUrl = uri => {
5960
5967
  if (uri.startsWith('http://') || uri.startsWith('https://')) {
5961
5968
  return uri;
5962
5969
  }
5963
- if (uri.startsWith('/')) {
5964
- return `/remote${uri}`;
5970
+ const withoutPrefix = uri.startsWith('file://') ? uri.slice('file://'.length) : uri;
5971
+ const normalized = withoutPrefix.replaceAll('\\', '/');
5972
+ if (normalized.startsWith('/')) {
5973
+ return `/remote${normalized}`;
5965
5974
  }
5966
- return `/remote/${uri}`;
5975
+ return `/remote/${normalized}`;
5967
5976
  };
5968
5977
 
5969
5978
  const getLanguagesFromExtension = (extension, platform) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-management-worker",
3
- "version": "4.78.2",
3
+ "version": "4.78.3",
4
4
  "description": "Webworker for the Extension Management functionality in Lvce Editor.",
5
5
  "keywords": [
6
6
  "web-worker"