@lvce-editor/extension-detail-view 5.11.0 → 5.13.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.
|
@@ -19,6 +19,7 @@ const ContentSecurityPolicy = 'ContentSecurityPolicy';
|
|
|
19
19
|
const Copy = 'Copy';
|
|
20
20
|
const CopyImage = 'Copy Image';
|
|
21
21
|
const CopyImageUrl = 'Copy Image Url';
|
|
22
|
+
const CopyLink = 'Copy Link';
|
|
22
23
|
const Details$1 = 'Details';
|
|
23
24
|
const Disable$1 = 'Disable';
|
|
24
25
|
const Elements = 'Elements';
|
|
@@ -78,6 +79,9 @@ const marketplace = () => {
|
|
|
78
79
|
const categories = () => {
|
|
79
80
|
return i18nString(Categories$1);
|
|
80
81
|
};
|
|
82
|
+
const copyLink = () => {
|
|
83
|
+
return i18nString(CopyLink);
|
|
84
|
+
};
|
|
81
85
|
const resources = () => {
|
|
82
86
|
return i18nString(Resources$1);
|
|
83
87
|
};
|
|
@@ -1150,6 +1154,12 @@ const getType = value => {
|
|
|
1150
1154
|
return Unknown;
|
|
1151
1155
|
}
|
|
1152
1156
|
};
|
|
1157
|
+
const number = value => {
|
|
1158
|
+
const type = getType(value);
|
|
1159
|
+
if (type !== Number$1) {
|
|
1160
|
+
throw new AssertionError('expected value to be of type number');
|
|
1161
|
+
}
|
|
1162
|
+
};
|
|
1153
1163
|
const string = value => {
|
|
1154
1164
|
const type = getType(value);
|
|
1155
1165
|
if (type !== String) {
|
|
@@ -2250,6 +2260,14 @@ const {
|
|
|
2250
2260
|
invoke: invoke$1,
|
|
2251
2261
|
invokeAndTransfer,
|
|
2252
2262
|
set: set$5} = create$7(RendererWorker);
|
|
2263
|
+
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
2264
|
+
number(uid);
|
|
2265
|
+
number(menuId);
|
|
2266
|
+
number(x);
|
|
2267
|
+
number(y);
|
|
2268
|
+
// @ts-ignore
|
|
2269
|
+
await invoke$1('ContextMenu.show2', uid, menuId, x, y, args);
|
|
2270
|
+
};
|
|
2253
2271
|
const setColorTheme$1 = async id => {
|
|
2254
2272
|
// @ts-ignore
|
|
2255
2273
|
return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
@@ -3030,19 +3048,19 @@ const readFileAsBlob = async uri => {
|
|
|
3030
3048
|
return invoke('FileSystem.readFileAsBlob', uri);
|
|
3031
3049
|
};
|
|
3032
3050
|
|
|
3033
|
-
const getImageCopyUrl = iconSrc => {
|
|
3034
|
-
|
|
3035
|
-
// @ts-ignore
|
|
3036
|
-
const prefix = `${location.protocol}//${location.host}`;
|
|
3051
|
+
const getImageCopyUrl = (iconSrc, locationProtocol, locationHost) => {
|
|
3052
|
+
const prefix = `${locationProtocol}//${locationHost}`;
|
|
3037
3053
|
const absoluteIconSrc = `${prefix}${iconSrc}`;
|
|
3038
3054
|
return absoluteIconSrc;
|
|
3039
3055
|
};
|
|
3040
3056
|
|
|
3041
3057
|
const copyImage = async state => {
|
|
3042
3058
|
const {
|
|
3043
|
-
iconSrc
|
|
3059
|
+
iconSrc,
|
|
3060
|
+
locationHost,
|
|
3061
|
+
locationProtocol
|
|
3044
3062
|
} = state;
|
|
3045
|
-
const absoluteIconSrc = getImageCopyUrl(iconSrc);
|
|
3063
|
+
const absoluteIconSrc = getImageCopyUrl(iconSrc, locationProtocol, locationHost);
|
|
3046
3064
|
const blob = await readFileAsBlob(absoluteIconSrc);
|
|
3047
3065
|
await writeClipboardImage(blob);
|
|
3048
3066
|
return state;
|
|
@@ -3050,9 +3068,11 @@ const copyImage = async state => {
|
|
|
3050
3068
|
|
|
3051
3069
|
const copyImageUrl = async state => {
|
|
3052
3070
|
const {
|
|
3053
|
-
iconSrc
|
|
3071
|
+
iconSrc,
|
|
3072
|
+
locationHost,
|
|
3073
|
+
locationProtocol
|
|
3054
3074
|
} = state;
|
|
3055
|
-
const absoluteIconSrc = getImageCopyUrl(iconSrc);
|
|
3075
|
+
const absoluteIconSrc = getImageCopyUrl(iconSrc, locationProtocol, locationHost);
|
|
3056
3076
|
await writeText(absoluteIconSrc);
|
|
3057
3077
|
return state;
|
|
3058
3078
|
};
|
|
@@ -3106,6 +3126,7 @@ const create = (uid, uri, x, y, width, height, platform, assetDir) => {
|
|
|
3106
3126
|
importTime: 0,
|
|
3107
3127
|
installationEntries: [],
|
|
3108
3128
|
jsonValidation: [],
|
|
3129
|
+
locationHost: '',
|
|
3109
3130
|
locationProtocol: '',
|
|
3110
3131
|
marketplaceEntries: [],
|
|
3111
3132
|
name: '',
|
|
@@ -3214,6 +3235,21 @@ const getMenuEntries2 = (state, props) => {
|
|
|
3214
3235
|
if (props.menuId === ExtensionDetailIconContextMenu$3) {
|
|
3215
3236
|
return getMenuEntriesImage();
|
|
3216
3237
|
}
|
|
3238
|
+
if (props.menuId === ExtensionDetailReadme && props.href) {
|
|
3239
|
+
return [{
|
|
3240
|
+
args: [props.href],
|
|
3241
|
+
command: 'ExtensionDetail.copyReadmeLink',
|
|
3242
|
+
flags: None$2,
|
|
3243
|
+
id: 'copyLink',
|
|
3244
|
+
label: copyLink()
|
|
3245
|
+
}, {
|
|
3246
|
+
args: [],
|
|
3247
|
+
command: 'ExtensionDetail.executeCopy',
|
|
3248
|
+
flags: None$2,
|
|
3249
|
+
id: 'copy',
|
|
3250
|
+
label: copy$1()
|
|
3251
|
+
}];
|
|
3252
|
+
}
|
|
3217
3253
|
return [{
|
|
3218
3254
|
args: [],
|
|
3219
3255
|
command: 'ExtensionDetail.executeCopy',
|
|
@@ -3308,7 +3344,19 @@ const getMenus = () => {
|
|
|
3308
3344
|
}];
|
|
3309
3345
|
};
|
|
3310
3346
|
|
|
3311
|
-
const
|
|
3347
|
+
const show2 = async (uid, menuId, x, y, args) => {
|
|
3348
|
+
await showContextMenu2(uid, menuId, x, y, args);
|
|
3349
|
+
};
|
|
3350
|
+
|
|
3351
|
+
const handleAdditionalDetailContextMenu = async (state, x, y, nodeName, href) => {
|
|
3352
|
+
const {
|
|
3353
|
+
uid
|
|
3354
|
+
} = state;
|
|
3355
|
+
await show2(uid, ExtensionDetailReadme, x, y, {
|
|
3356
|
+
href,
|
|
3357
|
+
menuId: ExtensionDetailReadme,
|
|
3358
|
+
nodeName
|
|
3359
|
+
});
|
|
3312
3360
|
return state;
|
|
3313
3361
|
};
|
|
3314
3362
|
|
|
@@ -3553,11 +3601,6 @@ const handleIconError = state => {
|
|
|
3553
3601
|
};
|
|
3554
3602
|
};
|
|
3555
3603
|
|
|
3556
|
-
const show2 = async (uid, menuId, x, y, args) => {
|
|
3557
|
-
// @ts-ignore
|
|
3558
|
-
await invoke$1('ContextMenu.show2', uid, menuId, x, y, args);
|
|
3559
|
-
};
|
|
3560
|
-
|
|
3561
3604
|
const ExtensionDetailIconContextMenu = 4091;
|
|
3562
3605
|
|
|
3563
3606
|
const handleImageContextMenu = async (state, eventX, eventY) => {
|
|
@@ -4465,6 +4508,7 @@ const loadContent = async (state, platform, savedState, isTest = false) => {
|
|
|
4465
4508
|
const readmeContent = hasReadme ? await loadReadmeContent(readmeUrl) : noReadmeFound();
|
|
4466
4509
|
const baseUrl = getBaseUrl(extension.path, platform);
|
|
4467
4510
|
const locationProtocol = location.protocol;
|
|
4511
|
+
const locationHost = location.host;
|
|
4468
4512
|
const readmeHtml = await renderMarkdown(readmeContent, {
|
|
4469
4513
|
baseUrl,
|
|
4470
4514
|
commit,
|
|
@@ -4524,6 +4568,7 @@ const loadContent = async (state, platform, savedState, isTest = false) => {
|
|
|
4524
4568
|
hasReadme,
|
|
4525
4569
|
iconSrc,
|
|
4526
4570
|
installationEntries,
|
|
4571
|
+
locationHost,
|
|
4527
4572
|
locationProtocol,
|
|
4528
4573
|
marketplaceEntries,
|
|
4529
4574
|
name,
|
|
@@ -4555,9 +4600,11 @@ const openUrl = async uri => {
|
|
|
4555
4600
|
|
|
4556
4601
|
const openImageInNewTab = async state => {
|
|
4557
4602
|
const {
|
|
4558
|
-
iconSrc
|
|
4603
|
+
iconSrc,
|
|
4604
|
+
locationHost,
|
|
4605
|
+
locationProtocol
|
|
4559
4606
|
} = state;
|
|
4560
|
-
const absoluteIconSrc = getImageCopyUrl(iconSrc);
|
|
4607
|
+
const absoluteIconSrc = getImageCopyUrl(iconSrc, locationProtocol, locationHost);
|
|
4561
4608
|
await openUrl(absoluteIconSrc);
|
|
4562
4609
|
return state;
|
|
4563
4610
|
};
|
|
@@ -5137,7 +5184,7 @@ const render2 = (uid, diffResult) => {
|
|
|
5137
5184
|
const renderEventListeners = () => {
|
|
5138
5185
|
return [{
|
|
5139
5186
|
name: HandleAdditionalDetailContextMenu,
|
|
5140
|
-
params: ['handleAdditionalDetailsContextMenu'],
|
|
5187
|
+
params: ['handleAdditionalDetailsContextMenu', ClientX, ClientY, 'event.target.nodeName', 'event.target.href'],
|
|
5141
5188
|
preventDefault: true
|
|
5142
5189
|
}, {
|
|
5143
5190
|
name: HandleClickCategory,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/extension-detail-view",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.0",
|
|
4
4
|
"description": "Extension Detail View Worker",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"main": "dist/extensionDetailViewWorkerMain.js",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@lvce-editor/constants": "^1.
|
|
14
|
+
"@lvce-editor/constants": "^1.42.0"
|
|
15
15
|
}
|
|
16
16
|
}
|