@lvce-editor/extension-management-worker 1.20.0 → 2.0.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.
|
@@ -1840,10 +1840,9 @@ const getWebExtensions = async assetDir => {
|
|
|
1840
1840
|
}
|
|
1841
1841
|
};
|
|
1842
1842
|
|
|
1843
|
-
const getAllExtensions = async assetDir => {
|
|
1844
|
-
const state = get$1();
|
|
1843
|
+
const getAllExtensions = async (assetDir, platform) => {
|
|
1845
1844
|
const meta = getDynamicWebExtensions();
|
|
1846
|
-
if (
|
|
1845
|
+
if (platform === Web) {
|
|
1847
1846
|
const webExtensions = await getWebExtensions(assetDir);
|
|
1848
1847
|
return [...webExtensions, ...meta];
|
|
1849
1848
|
}
|
|
@@ -1851,8 +1850,8 @@ const getAllExtensions = async assetDir => {
|
|
|
1851
1850
|
return [...local, ...meta];
|
|
1852
1851
|
};
|
|
1853
1852
|
|
|
1854
|
-
const getColorThemeJson$2 = async (colorThemeId, assetDir) => {
|
|
1855
|
-
const extensions = await getAllExtensions(assetDir);
|
|
1853
|
+
const getColorThemeJson$2 = async (colorThemeId, assetDir, platform) => {
|
|
1854
|
+
const extensions = await getAllExtensions(assetDir, platform);
|
|
1856
1855
|
const colorThemeUri = getColorThemeUri(extensions, colorThemeId);
|
|
1857
1856
|
if (!colorThemeUri) {
|
|
1858
1857
|
return {};
|
|
@@ -1874,7 +1873,7 @@ const getColorThemeJson = (colorThemeId, platform, assetDir) => {
|
|
|
1874
1873
|
if (platform === Web) {
|
|
1875
1874
|
return getColorThemeJson$1(colorThemeId, assetDir);
|
|
1876
1875
|
}
|
|
1877
|
-
return getColorThemeJson$2(colorThemeId, assetDir);
|
|
1876
|
+
return getColorThemeJson$2(colorThemeId, assetDir, platform);
|
|
1878
1877
|
};
|
|
1879
1878
|
|
|
1880
1879
|
const getColorThemeCssFromJson = async (colorThemeId, colorThemeJson) => {
|
|
@@ -1905,14 +1904,14 @@ const getColorThemeNamesFromExtensions = async extensions => {
|
|
|
1905
1904
|
return colorThemeNames;
|
|
1906
1905
|
};
|
|
1907
1906
|
|
|
1908
|
-
const getColorThemeNames = async assetDir => {
|
|
1909
|
-
const extensions = await getAllExtensions(assetDir);
|
|
1907
|
+
const getColorThemeNames = async (assetDir, platform) => {
|
|
1908
|
+
const extensions = await getAllExtensions(assetDir, platform);
|
|
1910
1909
|
const colorThemeNames = getColorThemeNamesFromExtensions(extensions);
|
|
1911
1910
|
return colorThemeNames;
|
|
1912
1911
|
};
|
|
1913
1912
|
|
|
1914
|
-
const getExtension = async (id, assetDir) => {
|
|
1915
|
-
const allExtensions = await getAllExtensions(assetDir);
|
|
1913
|
+
const getExtension = async (id, assetDir, platform) => {
|
|
1914
|
+
const allExtensions = await getAllExtensions(assetDir, platform);
|
|
1916
1915
|
for (const extension of allExtensions) {
|
|
1917
1916
|
if (extension.id === id) {
|
|
1918
1917
|
return extension;
|
|
@@ -2110,7 +2109,7 @@ const getLanguagesFromExtension = (extension, platform) => {
|
|
|
2110
2109
|
|
|
2111
2110
|
const getLanguages = async (platform, assetDir) => {
|
|
2112
2111
|
try {
|
|
2113
|
-
const extensions = await getAllExtensions(assetDir);
|
|
2112
|
+
const extensions = await getAllExtensions(assetDir, platform);
|
|
2114
2113
|
const languages = extensions.flatMap(extension => getLanguagesFromExtension(extension, platform));
|
|
2115
2114
|
return languages;
|
|
2116
2115
|
} catch (error) {
|