@lvce-editor/extension-management-worker 1.16.0 → 1.17.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.
@@ -1383,6 +1383,7 @@ const get$2 = id => {
1383
1383
  const Web = 1;
1384
1384
  const Electron = 2;
1385
1385
  const Remote = 3;
1386
+ const Test = 4;
1386
1387
 
1387
1388
  const getUrlPrefix = (platform, extensionPath) => {
1388
1389
  if (extensionPath.startsWith('http://') || extensionPath.startsWith('https://')) {
@@ -1603,7 +1604,8 @@ const get$1 = () => {
1603
1604
  return state;
1604
1605
  };
1605
1606
 
1606
- const disableExtension = async (id, isTest) => {
1607
+ const disableExtension2 = async (id, platform) => {
1608
+ const isTest = platform === Test;
1607
1609
  const oldState = get$1();
1608
1610
  try {
1609
1611
  if (isTest) {
@@ -1622,11 +1624,14 @@ const disableExtension = async (id, isTest) => {
1622
1624
  }
1623
1625
  };
1624
1626
 
1625
- const enableExtension = async (id, isTest) => {
1627
+ const disableExtension = async (id, isTest) => {
1628
+ const oldState = get$1();
1629
+ return disableExtension2(id, oldState.platform);
1630
+ };
1631
+
1632
+ const enableExtension2 = async (id, platform) => {
1633
+ const isTest = platform === Test;
1626
1634
  const oldState = get$1();
1627
- const {
1628
- platform
1629
- } = oldState;
1630
1635
  if (platform === Remote || platform === Electron) {
1631
1636
  const disabledExtensionsJsonPath = await invoke$2('PlatformPaths.getBuiltinExtensionsJsonPath');
1632
1637
  const exists$1 = await exists(disabledExtensionsJsonPath);
@@ -1653,6 +1658,11 @@ const enableExtension = async (id, isTest) => {
1653
1658
  return undefined;
1654
1659
  };
1655
1660
 
1661
+ const enableExtension = async (id, isTest) => {
1662
+ const oldState = get$1();
1663
+ return enableExtension2(id, oldState.platform);
1664
+ };
1665
+
1656
1666
  /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
1657
1667
  const warn = (...args) => {
1658
1668
  console.warn(...args);
@@ -1817,12 +1827,18 @@ const getColorThemeUri = (extensions, colorThemeId) => {
1817
1827
  return '';
1818
1828
  };
1819
1829
 
1830
+ const getDynamicWebExtensions = () => {
1831
+ return state$1.webExtensions;
1832
+ };
1833
+
1820
1834
  const getAllExtensions = async () => {
1821
1835
  const state = get$1();
1836
+ const meta = getDynamicWebExtensions();
1822
1837
  if (state.platform === Web) {
1823
- return [];
1838
+ return [...meta];
1824
1839
  }
1825
- return invoke$1('ExtensionManagement.getAllExtensions');
1840
+ const local = await invoke$1('ExtensionManagement.getAllExtensions');
1841
+ return [...local, ...meta];
1826
1842
  };
1827
1843
 
1828
1844
  const getColorThemeJson$2 = async colorThemeId => {
@@ -1885,10 +1901,6 @@ const getColorThemeNames = async () => {
1885
1901
  return colorThemeNames;
1886
1902
  };
1887
1903
 
1888
- const getDynamicWebExtensions = async assetDir => {
1889
- return state$1.webExtensions;
1890
- };
1891
-
1892
1904
  const getExtension = async id => {
1893
1905
  const allExtensions = await getAllExtensions();
1894
1906
  for (const extension of allExtensions) {
@@ -2107,7 +2119,9 @@ const commandMap = {
2107
2119
  'Extensions.createWebViewWorkerRpc': createWebViewWorkerRpc,
2108
2120
  'Extensions.createWebViewWorkerRpc2': createWebViewWorkerRpc2,
2109
2121
  'Extensions.disable': disableExtension,
2122
+ 'Extensions.disable2': disableExtension2,
2110
2123
  'Extensions.enable': enableExtension,
2124
+ 'Extensions.enable2': enableExtension2,
2111
2125
  'Extensions.getAllExtensions': getAllExtensions,
2112
2126
  'Extensions.getColorThemeCss': getColorThemeCss,
2113
2127
  'Extensions.getColorThemeCssFromJson': getColorThemeCssFromJson,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-management-worker",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "description": "Webworker for the Extension Management functionality in Lvce Editor.",
5
5
  "keywords": [
6
6
  "web-worker"