@lvce-editor/extension-host-worker 4.2.0 → 4.3.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.
@@ -3076,6 +3076,10 @@ const setup = ({
3076
3076
  global.vscode = api;
3077
3077
  };
3078
3078
 
3079
+ const state$6 = {
3080
+ webExtensions: []
3081
+ };
3082
+
3079
3083
  const cache = Object.create(null);
3080
3084
  const id = 1;
3081
3085
  const get$5 = () => {
@@ -3133,6 +3137,8 @@ const getWebManifestPath = path => {
3133
3137
  const addWebExtension = async path => {
3134
3138
  const manifestPath = getWebManifestPath(path);
3135
3139
  const manifest = await getWebExtensionManifest(path, manifestPath);
3140
+ // TODO avoid mutation if possible
3141
+ state$6.webExtensions.push(manifest);
3136
3142
  clear();
3137
3143
  return manifest;
3138
3144
  };
@@ -3510,13 +3516,13 @@ const storeId = 'lvce-keyvalue';
3510
3516
 
3511
3517
  // TODO high memory usage in idb because of transactionDoneMap
3512
3518
 
3513
- const state$6 = {
3519
+ const state$5 = {
3514
3520
  databases: Object.create(null),
3515
3521
  dbVersion: 2,
3516
3522
  cachedDb: undefined
3517
3523
  };
3518
3524
  const getDb$1 = async () => {
3519
- const db = await openDB(storeId, state$6.dbVersion, {
3525
+ const db = await openDB(storeId, state$5.dbVersion, {
3520
3526
  async upgrade(db, oldVersion) {
3521
3527
  if (!db.objectStoreNames.contains(storeId)) {
3522
3528
  await db.createObjectStore(storeId, {
@@ -3528,8 +3534,8 @@ const getDb$1 = async () => {
3528
3534
  return db;
3529
3535
  };
3530
3536
  const getDbMemoized$1 = async () => {
3531
- state$6.cachedDb ||= await getDb$1();
3532
- return state$6.cachedDb;
3537
+ state$5.cachedDb ||= await getDb$1();
3538
+ return state$5.cachedDb;
3533
3539
  };
3534
3540
 
3535
3541
  // TODO high memory usage in idb because of transactionDoneMap
@@ -3672,10 +3678,6 @@ const getColorThemeUri = (extensions, colorThemeId) => {
3672
3678
  return '';
3673
3679
  };
3674
3680
 
3675
- const state$5 = {
3676
- webExtensions: []
3677
- };
3678
-
3679
3681
  const getAssetDir = () => {
3680
3682
  // @ts-ignore
3681
3683
  if (typeof ASSET_DIR !== 'undefined') {
@@ -3699,7 +3701,7 @@ const getSharedProcessExtensions = () => {
3699
3701
  return invoke$2(/* ExtensionManagement.getExtensions */'ExtensionManagement.getExtensions');
3700
3702
  };
3701
3703
  const doGetExtensions = async () => {
3702
- const meta = state$5.webExtensions;
3704
+ const meta = state$6.webExtensions;
3703
3705
  if (platform === Web) {
3704
3706
  const webExtensions = await getWebExtensions();
3705
3707
  return [...webExtensions, ...meta];
@@ -4766,7 +4768,7 @@ const getIconThemeJson$1 = async iconThemeId => {
4766
4768
  extensionPath: `${assetDir}/extensions/builtin.${iconThemeId}`
4767
4769
  };
4768
4770
  }
4769
- for (const webExtension of state$5.webExtensions) {
4771
+ for (const webExtension of state$6.webExtensions) {
4770
4772
  if (webExtension.iconThemes) {
4771
4773
  for (const iconTheme of webExtension.iconThemes) {
4772
4774
  // TODO handle error when icon theme path is not of type string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-host-worker",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "Webworker for the extension host functionality in Lvce Editor.",
5
5
  "main": "dist/extensionHostWorkerMain.js",
6
6
  "type": "module",