@lvce-editor/extension-detail-view 4.2.0 → 4.4.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.
|
@@ -251,6 +251,10 @@ const Ul = 60;
|
|
|
251
251
|
const Code$2 = 65;
|
|
252
252
|
const Dt = 67;
|
|
253
253
|
|
|
254
|
+
const ClientX = 'event.clientX';
|
|
255
|
+
const ClientY = 'event.clientY';
|
|
256
|
+
const TargetName = 'event.target.name';
|
|
257
|
+
|
|
254
258
|
const DebugWorker = 55;
|
|
255
259
|
const ExtensionHostWorker = 44;
|
|
256
260
|
const FileSystemWorker$1 = 209;
|
|
@@ -302,6 +306,7 @@ const FeaturesList = 'FeaturesList';
|
|
|
302
306
|
const FeatureWebView = 'FeatureWebView';
|
|
303
307
|
const Large$1 = 'Large';
|
|
304
308
|
const Link = 'Link';
|
|
309
|
+
const Markdown = 'Markdown';
|
|
305
310
|
const MoreInfo = 'MoreInfo';
|
|
306
311
|
const MoreInfoEntry = 'MoreInfoEntry';
|
|
307
312
|
const MoreInfoEntryKey = 'MoreInfoEntryKey';
|
|
@@ -3456,7 +3461,8 @@ const selectTabDetails = async state => {
|
|
|
3456
3461
|
} = state;
|
|
3457
3462
|
const readmeContent = await loadReadmeContent(readmeUrl);
|
|
3458
3463
|
const readmeHtml = await renderMarkdown(readmeContent, {
|
|
3459
|
-
baseUrl
|
|
3464
|
+
baseUrl,
|
|
3465
|
+
linksExternal: true
|
|
3460
3466
|
});
|
|
3461
3467
|
const detailsDom = await getMarkdownVirtualDom(readmeHtml);
|
|
3462
3468
|
const newTabs = tabs.map(tab => {
|
|
@@ -3971,6 +3977,7 @@ const getInstallationEntries = (displaySize, extensionId, extensionVersion, exte
|
|
|
3971
3977
|
}, {
|
|
3972
3978
|
key: lastUpdated(),
|
|
3973
3979
|
value: 'n/a',
|
|
3980
|
+
// TODO get this from somewhere
|
|
3974
3981
|
odd: true
|
|
3975
3982
|
}, {
|
|
3976
3983
|
key: size(),
|
|
@@ -4105,7 +4112,8 @@ const loadContent = async (state, platform, savedState, isTest = false) => {
|
|
|
4105
4112
|
const readmeContent = hasReadme ? await loadReadmeContent(readmeUrl) : noReadmeFound();
|
|
4106
4113
|
const baseUrl = getBaseUrl(extension.path, platform);
|
|
4107
4114
|
const readmeHtml = await renderMarkdown(readmeContent, {
|
|
4108
|
-
baseUrl
|
|
4115
|
+
baseUrl,
|
|
4116
|
+
linksExternal: true
|
|
4109
4117
|
});
|
|
4110
4118
|
const detailsVirtualDom = await getMarkdownVirtualDom(readmeHtml, {
|
|
4111
4119
|
scrollToTopEnabled: true
|
|
@@ -4194,8 +4202,6 @@ const openImageInNewTab = async state => {
|
|
|
4194
4202
|
return state;
|
|
4195
4203
|
};
|
|
4196
4204
|
|
|
4197
|
-
/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
|
|
4198
|
-
|
|
4199
4205
|
const createCss = object => {
|
|
4200
4206
|
const inner = Object.entries(object).map(([key, value]) => ` --${key}: ${value}px;`).join('\n');
|
|
4201
4207
|
const full = `:root {\n${inner}\n}`;
|
|
@@ -4296,6 +4302,14 @@ const getMoreInfoEntryValueTag = (onClick, code) => {
|
|
|
4296
4302
|
return Dd;
|
|
4297
4303
|
};
|
|
4298
4304
|
|
|
4305
|
+
const getExtraProps = title => {
|
|
4306
|
+
if (title) {
|
|
4307
|
+
return {
|
|
4308
|
+
title
|
|
4309
|
+
};
|
|
4310
|
+
}
|
|
4311
|
+
return {};
|
|
4312
|
+
};
|
|
4299
4313
|
const getMoreInfoEntryValueVirtualDom = item => {
|
|
4300
4314
|
const {
|
|
4301
4315
|
value,
|
|
@@ -4305,12 +4319,13 @@ const getMoreInfoEntryValueVirtualDom = item => {
|
|
|
4305
4319
|
} = item;
|
|
4306
4320
|
const type = getMoreInfoEntryValueTag(onClick, code);
|
|
4307
4321
|
const className = getMoreInfoEntryValueClassName(onClick, code);
|
|
4322
|
+
const extraProps = getExtraProps(title);
|
|
4308
4323
|
return [{
|
|
4309
4324
|
type,
|
|
4310
4325
|
className,
|
|
4311
4326
|
childCount: 1,
|
|
4312
4327
|
onClick,
|
|
4313
|
-
|
|
4328
|
+
...extraProps
|
|
4314
4329
|
}, text(value)];
|
|
4315
4330
|
};
|
|
4316
4331
|
|
|
@@ -4394,7 +4409,7 @@ const getDetailsVirtualDom = (sanitizedReadmeHtml, width, scrollToTopButtonEnabl
|
|
|
4394
4409
|
const contentDom = hasReadme ? sanitizedReadmeHtml : [{
|
|
4395
4410
|
type: Div,
|
|
4396
4411
|
childCount: 1,
|
|
4397
|
-
className:
|
|
4412
|
+
className: Markdown
|
|
4398
4413
|
}, text(noReadmeFound())];
|
|
4399
4414
|
const dom = [{
|
|
4400
4415
|
type: Div,
|
|
@@ -4719,16 +4734,16 @@ const render2 = (uid, diffResult) => {
|
|
|
4719
4734
|
const renderEventListeners = () => {
|
|
4720
4735
|
return [{
|
|
4721
4736
|
name: HandleClickCategory,
|
|
4722
|
-
params: ['handleClickCategory',
|
|
4737
|
+
params: ['handleClickCategory', TargetName]
|
|
4723
4738
|
}, {
|
|
4724
4739
|
name: HandleIconError,
|
|
4725
4740
|
params: ['handleIconError']
|
|
4726
4741
|
}, {
|
|
4727
4742
|
name: HandleReadmeContextMenu,
|
|
4728
|
-
params: ['handleReadmeContextMenu',
|
|
4743
|
+
params: ['handleReadmeContextMenu', ClientX, ClientY, 'event.target.href', 'event.target.src']
|
|
4729
4744
|
}, {
|
|
4730
4745
|
name: HandleImageContextMenu,
|
|
4731
|
-
params: ['handleImageContextMenu',
|
|
4746
|
+
params: ['handleImageContextMenu', ClientX, ClientY],
|
|
4732
4747
|
preventDefault: true
|
|
4733
4748
|
}, {
|
|
4734
4749
|
name: HandleReadmeScroll,
|
|
@@ -4736,13 +4751,13 @@ const renderEventListeners = () => {
|
|
|
4736
4751
|
passive: true
|
|
4737
4752
|
}, {
|
|
4738
4753
|
name: HandleTabsClick,
|
|
4739
|
-
params: ['handleTabsClick',
|
|
4754
|
+
params: ['handleTabsClick', TargetName]
|
|
4740
4755
|
}, {
|
|
4741
4756
|
name: HandleFeaturesClick,
|
|
4742
|
-
params: ['handleFeaturesClick',
|
|
4757
|
+
params: ['handleFeaturesClick', TargetName]
|
|
4743
4758
|
}, {
|
|
4744
4759
|
name: HandleClickSize,
|
|
4745
|
-
params: ['handleClickSize',
|
|
4760
|
+
params: ['handleClickSize', TargetName]
|
|
4746
4761
|
}, {
|
|
4747
4762
|
name: HandleClickDisable,
|
|
4748
4763
|
params: ['handleClickDisable']
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/extension-detail-view",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Extension Detail View Worker",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,5 +9,8 @@
|
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"author": "Lvce Editor",
|
|
11
11
|
"type": "module",
|
|
12
|
-
"main": "dist/extensionDetailViewWorkerMain.js"
|
|
12
|
+
"main": "dist/extensionDetailViewWorkerMain.js",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@lvce-editor/constants": "^1.28.0"
|
|
15
|
+
}
|
|
13
16
|
}
|