@lvce-editor/extension-detail-view 5.2.0 → 5.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.
|
@@ -61,6 +61,7 @@ const SetColorTheme$1 = 'Set Color Theme';
|
|
|
61
61
|
const Settings$1 = 'Settings';
|
|
62
62
|
const Size = 'Size';
|
|
63
63
|
const Snippets = 'Snippets';
|
|
64
|
+
const Status = 'Status';
|
|
64
65
|
const StringMustNotBeEmpty = 'String must not be empty';
|
|
65
66
|
const Theme$1 = 'Theme';
|
|
66
67
|
const Uninstall$1 = 'Uninstall';
|
|
@@ -122,6 +123,9 @@ const fileMatch = () => {
|
|
|
122
123
|
const schema = () => {
|
|
123
124
|
return i18nString(Schema);
|
|
124
125
|
};
|
|
126
|
+
const status = () => {
|
|
127
|
+
return i18nString(Status);
|
|
128
|
+
};
|
|
125
129
|
const setColorTheme$3 = () => {
|
|
126
130
|
return i18nString(SetColorTheme$1);
|
|
127
131
|
};
|
|
@@ -2585,10 +2589,11 @@ const RendererWorker = {
|
|
|
2585
2589
|
writeClipBoardText: writeClipBoardText$1
|
|
2586
2590
|
};
|
|
2587
2591
|
|
|
2592
|
+
/* eslint-disable unicorn/prefer-export-from */
|
|
2593
|
+
|
|
2588
2594
|
const {
|
|
2589
2595
|
set: set$5,
|
|
2590
|
-
getRuntimeStatus: getRuntimeStatus$1
|
|
2591
|
-
} = ExtensionHost;
|
|
2596
|
+
getRuntimeStatus: getRuntimeStatus$1} = ExtensionHost;
|
|
2592
2597
|
|
|
2593
2598
|
const getRuntimeStatus = async extensionId => {
|
|
2594
2599
|
// @ts-ignore
|
|
@@ -2680,11 +2685,10 @@ const value = {
|
|
|
2680
2685
|
className: 'RuntimeStatusDefinitionListValue',
|
|
2681
2686
|
childCount: 1
|
|
2682
2687
|
};
|
|
2683
|
-
const getStatusVirtualDom = status => {
|
|
2684
|
-
const
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
value, text(`${statusString}`)];
|
|
2688
|
+
const getStatusVirtualDom = status$1 => {
|
|
2689
|
+
const statusKey = status();
|
|
2690
|
+
const statusValue = getStatusMessage(status$1);
|
|
2691
|
+
return [key, text(`${statusKey}: `), value, text(`${statusValue}`)];
|
|
2688
2692
|
};
|
|
2689
2693
|
|
|
2690
2694
|
const getChildCount$1 = (status, activationTime, importTime) => {
|
|
@@ -4542,12 +4546,28 @@ const getMarketplaceEntries = isBuiltin => {
|
|
|
4542
4546
|
}];
|
|
4543
4547
|
};
|
|
4544
4548
|
|
|
4545
|
-
const
|
|
4549
|
+
const getRepositoryLinkRaw = extension => {
|
|
4546
4550
|
if (extension && hasProperty(extension, 'repository') && typeof extension.repository === 'string') {
|
|
4547
4551
|
return extension.repository; // TODO watch out for javascript: or other invalid links or path traversal
|
|
4548
4552
|
}
|
|
4549
4553
|
return '';
|
|
4550
4554
|
};
|
|
4555
|
+
const ensureValidLink = link => {
|
|
4556
|
+
if (!link) {
|
|
4557
|
+
return '';
|
|
4558
|
+
}
|
|
4559
|
+
const parsed = new URL(link);
|
|
4560
|
+
if (parsed.protocol !== 'https:') {
|
|
4561
|
+
return '';
|
|
4562
|
+
}
|
|
4563
|
+
return link;
|
|
4564
|
+
};
|
|
4565
|
+
const getRepositoryLink = extension => {
|
|
4566
|
+
const raw = getRepositoryLinkRaw(extension);
|
|
4567
|
+
const validLink = ensureValidLink(raw);
|
|
4568
|
+
return validLink;
|
|
4569
|
+
};
|
|
4570
|
+
|
|
4551
4571
|
const getResources = (isBuiltin, extension) => {
|
|
4552
4572
|
if (isBuiltin) {
|
|
4553
4573
|
return [];
|
|
@@ -4559,10 +4579,10 @@ const getResources = (isBuiltin, extension) => {
|
|
|
4559
4579
|
url: '#'
|
|
4560
4580
|
}, {
|
|
4561
4581
|
label: issues(),
|
|
4562
|
-
url:
|
|
4582
|
+
url: '#'
|
|
4563
4583
|
}, {
|
|
4564
4584
|
label: repository(),
|
|
4565
|
-
url:
|
|
4585
|
+
url: repositoryLink
|
|
4566
4586
|
}, {
|
|
4567
4587
|
label: license(),
|
|
4568
4588
|
url: '#'
|
|
@@ -4915,8 +4935,19 @@ const resourceNode = {
|
|
|
4915
4935
|
};
|
|
4916
4936
|
const getResourceVirtualDom = resource => {
|
|
4917
4937
|
const {
|
|
4918
|
-
label
|
|
4938
|
+
label,
|
|
4939
|
+
url
|
|
4919
4940
|
} = resource;
|
|
4941
|
+
if (url && url !== '#') {
|
|
4942
|
+
return [{
|
|
4943
|
+
type: A,
|
|
4944
|
+
className: Resource,
|
|
4945
|
+
childCount: 1,
|
|
4946
|
+
target: '_blank',
|
|
4947
|
+
rel: 'noopener noreferrer',
|
|
4948
|
+
href: url
|
|
4949
|
+
}, text(label)];
|
|
4950
|
+
}
|
|
4920
4951
|
return [resourceNode, text(label)];
|
|
4921
4952
|
};
|
|
4922
4953
|
|