@lvce-editor/extension-host-worker 3.19.0 → 3.21.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.
@@ -3679,7 +3679,7 @@ const getWebExtensions = async () => {
3679
3679
  const getSharedProcessExtensions = () => {
3680
3680
  return invoke$2(/* ExtensionManagement.getExtensions */'ExtensionManagement.getExtensions');
3681
3681
  };
3682
- const getExtensions$1 = async () => {
3682
+ const doGetExtensions = async () => {
3683
3683
  if (platform === Web) {
3684
3684
  const webExtensions = await getWebExtensions();
3685
3685
  return webExtensions;
@@ -3693,6 +3693,10 @@ const getExtensions$1 = async () => {
3693
3693
  return extensions;
3694
3694
  };
3695
3695
 
3696
+ const getExtensions$1 = async () => {
3697
+ return doGetExtensions();
3698
+ };
3699
+
3696
3700
  const cache = Object.create(null);
3697
3701
  const id = 1;
3698
3702
  const get = () => {
@@ -4706,6 +4710,26 @@ const getFiles = () => {
4706
4710
  return state$2.files;
4707
4711
  };
4708
4712
 
4713
+ const getExtensionColorThemeNames = extension => {
4714
+ return extension.colorThemes || [];
4715
+ };
4716
+ const getColorThemeId = colorTheme => {
4717
+ return colorTheme.id;
4718
+ };
4719
+
4720
+ // TODO should send names to renderer worker or names with ids?
4721
+ const getColorThemeNamesFromExtensions = async extensions => {
4722
+ const colorThemes = extensions.flatMap(getExtensionColorThemeNames);
4723
+ const colorThemeNames = colorThemes.map(getColorThemeId);
4724
+ return colorThemeNames;
4725
+ };
4726
+
4727
+ const getColorThemeNames = async () => {
4728
+ const extensions = await getExtensions();
4729
+ const colorThemeNames = getColorThemeNamesFromExtensions(extensions);
4730
+ return colorThemeNames;
4731
+ };
4732
+
4709
4733
  const findMatchingIconThemeExtension = (extensions, iconThemeId) => {
4710
4734
  for (const extension of extensions) {
4711
4735
  if (extension && extension.iconThemes) {
@@ -4726,7 +4750,7 @@ const getIconThemeUrl = iconThemeId => {
4726
4750
  return `${assetDir}/extensions/builtin.${iconThemeId}/icon-theme.json`;
4727
4751
  };
4728
4752
 
4729
- const getIconThemeJson = async iconThemeId => {
4753
+ const getIconThemeJson$1 = async iconThemeId => {
4730
4754
  if (platform === Web) {
4731
4755
  const url = getIconThemeUrl(iconThemeId);
4732
4756
  const json = await getJson(url);
@@ -4761,6 +4785,10 @@ const getIconThemeJson = async iconThemeId => {
4761
4785
  };
4762
4786
  };
4763
4787
 
4788
+ const getIconThemeJson = async iconThemeId => {
4789
+ return getIconThemeJson$1(iconThemeId);
4790
+ };
4791
+
4764
4792
  const getRpcInfo = rpcId => {
4765
4793
  const info = get$7(rpcId);
4766
4794
  if (!info) {
@@ -5353,6 +5381,7 @@ const commandMap = {
5353
5381
  'BulkReplacement.applyBulkReplacement': applyBulkReplacement,
5354
5382
  'ColorTheme.getColorThemeCssFromJson': getColorThemeCssFromJson,
5355
5383
  'ColorTheme.getColorThemeJson': getColorThemeJson,
5384
+ 'ColorTheme.getColorThemeNames': getColorThemeNames,
5356
5385
  'ColorTheme.hydrate': hydrate$1,
5357
5386
  'ExtensionHost.launchIframeWorker': launchIframeWorker,
5358
5387
  'ExtensionHostRename.executeprepareRenameProvider': executeprepareRenameProvider,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-host-worker",
3
- "version": "3.19.0",
3
+ "version": "3.21.0",
4
4
  "description": "Webworker for the extension host functionality in Lvce Editor.",
5
5
  "main": "dist/extensionHostWorkerMain.js",
6
6
  "type": "module",