@lvce-editor/extension-detail-view 3.13.0 → 3.14.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.
|
@@ -846,6 +846,8 @@ const WebWorkerRpcClient = {
|
|
|
846
846
|
create: create$2
|
|
847
847
|
};
|
|
848
848
|
|
|
849
|
+
const assetDir = '';
|
|
850
|
+
|
|
849
851
|
const create$1 = () => {
|
|
850
852
|
const states = Object.create(null);
|
|
851
853
|
return {
|
|
@@ -866,7 +868,7 @@ const {
|
|
|
866
868
|
set: set$1
|
|
867
869
|
} = create$1();
|
|
868
870
|
|
|
869
|
-
const create = (uid, uri, width, height, platform) => {
|
|
871
|
+
const create = (uid, uri, width, height, platform, assetDir$1) => {
|
|
870
872
|
const state = {
|
|
871
873
|
description: '',
|
|
872
874
|
iconSrc: '',
|
|
@@ -885,7 +887,8 @@ const create = (uid, uri, width, height, platform) => {
|
|
|
885
887
|
extension: {},
|
|
886
888
|
baseUrl: '',
|
|
887
889
|
features: [],
|
|
888
|
-
folderSize: 0
|
|
890
|
+
folderSize: 0,
|
|
891
|
+
assetDir: assetDir$1 || assetDir
|
|
889
892
|
};
|
|
890
893
|
set$1(uid, state, state);
|
|
891
894
|
};
|
|
@@ -2512,22 +2515,27 @@ const handleClickUninstall = async state => {
|
|
|
2512
2515
|
return state;
|
|
2513
2516
|
};
|
|
2514
2517
|
|
|
2515
|
-
const
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
const
|
|
2519
|
-
|
|
2518
|
+
const extensionDefaultIcon = assetDir => {
|
|
2519
|
+
return `${assetDir}/icons/extensionDefaultIcon.png`;
|
|
2520
|
+
};
|
|
2521
|
+
const extensionLanguageBasics = assetDir => {
|
|
2522
|
+
return `${assetDir}/icons/language-icon.svg`;
|
|
2523
|
+
};
|
|
2524
|
+
const extensionTheme = assetDir => {
|
|
2525
|
+
return `${assetDir}/icons/theme-icon.png`;
|
|
2526
|
+
};
|
|
2520
2527
|
|
|
2521
2528
|
const handleIconError = state => {
|
|
2522
2529
|
const {
|
|
2523
|
-
iconSrc
|
|
2530
|
+
iconSrc,
|
|
2531
|
+
assetDir
|
|
2524
2532
|
} = state;
|
|
2525
|
-
if (iconSrc ===
|
|
2533
|
+
if (iconSrc === extensionDefaultIcon(assetDir)) {
|
|
2526
2534
|
return state;
|
|
2527
2535
|
}
|
|
2528
2536
|
return {
|
|
2529
2537
|
...state,
|
|
2530
|
-
iconSrc:
|
|
2538
|
+
iconSrc: extensionDefaultIcon(assetDir)
|
|
2531
2539
|
};
|
|
2532
2540
|
};
|
|
2533
2541
|
|
|
@@ -5128,18 +5136,18 @@ const Web = 1;
|
|
|
5128
5136
|
const Electron = 2;
|
|
5129
5137
|
const Remote = 3;
|
|
5130
5138
|
|
|
5131
|
-
const getIcon = (extension, platform) => {
|
|
5139
|
+
const getIcon = (extension, platform, assetDir) => {
|
|
5132
5140
|
if (!extension) {
|
|
5133
|
-
return
|
|
5141
|
+
return extensionDefaultIcon(assetDir);
|
|
5134
5142
|
}
|
|
5135
5143
|
if (!extension.path || !extension.icon) {
|
|
5136
5144
|
if (isLanguageBasicsExtension(extension)) {
|
|
5137
|
-
return
|
|
5145
|
+
return extensionLanguageBasics(assetDir);
|
|
5138
5146
|
}
|
|
5139
5147
|
if (isThemeExtension(extension)) {
|
|
5140
|
-
return
|
|
5148
|
+
return extensionTheme(assetDir);
|
|
5141
5149
|
}
|
|
5142
|
-
return
|
|
5150
|
+
return extensionDefaultIcon(assetDir);
|
|
5143
5151
|
}
|
|
5144
5152
|
if (platform === Remote || platform === Electron) {
|
|
5145
5153
|
if (extension.builtin) {
|
|
@@ -5263,7 +5271,8 @@ const loadReadmeContent = async path => {
|
|
|
5263
5271
|
const loadContent = async (state, platform, savedState) => {
|
|
5264
5272
|
const {
|
|
5265
5273
|
uri,
|
|
5266
|
-
width
|
|
5274
|
+
width,
|
|
5275
|
+
assetDir
|
|
5267
5276
|
} = state;
|
|
5268
5277
|
const id = uri.slice('extension-detail://'.length);
|
|
5269
5278
|
const extension = await getExtension(id, platform);
|
|
@@ -5274,7 +5283,7 @@ const loadContent = async (state, platform, savedState) => {
|
|
|
5274
5283
|
});
|
|
5275
5284
|
const sanitizedReadmeHtml = readmeHtml;
|
|
5276
5285
|
const normalizedReadmeHtml = sanitizedReadmeHtml;
|
|
5277
|
-
const iconSrc = getIcon(extension, platform);
|
|
5286
|
+
const iconSrc = getIcon(extension, platform, assetDir);
|
|
5278
5287
|
const description = getDescription(extension);
|
|
5279
5288
|
const name = getName(extension);
|
|
5280
5289
|
const size = getViewletSize(width);
|