@lvce-editor/extension-detail-view 3.27.0 → 3.29.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.
|
@@ -935,8 +935,6 @@ const terminate = () => {
|
|
|
935
935
|
globalThis.close();
|
|
936
936
|
};
|
|
937
937
|
|
|
938
|
-
const assetDir = '';
|
|
939
|
-
|
|
940
938
|
const {
|
|
941
939
|
get: get$1,
|
|
942
940
|
set: set$1,
|
|
@@ -944,7 +942,7 @@ const {
|
|
|
944
942
|
wrapCommand
|
|
945
943
|
} = create$2();
|
|
946
944
|
|
|
947
|
-
const create$1 = (uid, uri, x, y, width, height, platform, assetDir
|
|
945
|
+
const create$1 = (uid, uri, x, y, width, height, platform, assetDir) => {
|
|
948
946
|
const state = {
|
|
949
947
|
description: '',
|
|
950
948
|
iconSrc: '',
|
|
@@ -964,9 +962,10 @@ const create$1 = (uid, uri, x, y, width, height, platform, assetDir$1) => {
|
|
|
964
962
|
baseUrl: '',
|
|
965
963
|
features: [],
|
|
966
964
|
folderSize: 0,
|
|
967
|
-
assetDir: assetDir
|
|
965
|
+
assetDir: assetDir || '',
|
|
968
966
|
platform,
|
|
969
|
-
settingsButtonEnabled: false
|
|
967
|
+
settingsButtonEnabled: false,
|
|
968
|
+
builtinExtensionsBadgeEnabled: true
|
|
970
969
|
};
|
|
971
970
|
set$1(uid, state, state);
|
|
972
971
|
};
|
|
@@ -1485,6 +1484,7 @@ const handleTabsClick = (state, name) => {
|
|
|
1485
1484
|
|
|
1486
1485
|
const initialize = async () => {
|
|
1487
1486
|
// TODO create connection to file system worker
|
|
1487
|
+
// TODO create direct connection to markdown worker
|
|
1488
1488
|
};
|
|
1489
1489
|
|
|
1490
1490
|
const isLanguageBasicsExtension = extension => {
|
|
@@ -1582,6 +1582,26 @@ const getBaseUrl = (extensionPath, platform) => {
|
|
|
1582
1582
|
}
|
|
1583
1583
|
};
|
|
1584
1584
|
|
|
1585
|
+
const getCategories = () => {
|
|
1586
|
+
return [{
|
|
1587
|
+
id: 'themes',
|
|
1588
|
+
label: 'Themes'
|
|
1589
|
+
}];
|
|
1590
|
+
};
|
|
1591
|
+
|
|
1592
|
+
const getEntries = () => {
|
|
1593
|
+
return [{
|
|
1594
|
+
key: 'Identifier',
|
|
1595
|
+
value: 'abc'
|
|
1596
|
+
}, {
|
|
1597
|
+
key: 'Version',
|
|
1598
|
+
value: '1.9.5'
|
|
1599
|
+
}, {
|
|
1600
|
+
key: 'Last Updated',
|
|
1601
|
+
value: 'n/a'
|
|
1602
|
+
}];
|
|
1603
|
+
};
|
|
1604
|
+
|
|
1585
1605
|
const getExtensionIdFromUri = uri => {
|
|
1586
1606
|
const id = uri.slice('extension-detail://'.length);
|
|
1587
1607
|
return id;
|
|
@@ -1640,6 +1660,32 @@ const getFolderSize = async uri => {
|
|
|
1640
1660
|
}
|
|
1641
1661
|
};
|
|
1642
1662
|
|
|
1663
|
+
const getResources = () => {
|
|
1664
|
+
return [{
|
|
1665
|
+
label: 'Marketplace',
|
|
1666
|
+
url: '#'
|
|
1667
|
+
}, {
|
|
1668
|
+
label: 'Issues',
|
|
1669
|
+
url: '#'
|
|
1670
|
+
}, {
|
|
1671
|
+
label: 'Repository',
|
|
1672
|
+
url: '#'
|
|
1673
|
+
}, {
|
|
1674
|
+
label: 'License',
|
|
1675
|
+
url: '#'
|
|
1676
|
+
}];
|
|
1677
|
+
};
|
|
1678
|
+
|
|
1679
|
+
const getSecondEntries = () => {
|
|
1680
|
+
return [{
|
|
1681
|
+
key: 'Published',
|
|
1682
|
+
value: 'n/a'
|
|
1683
|
+
}, {
|
|
1684
|
+
key: 'Last Released',
|
|
1685
|
+
value: 'n/a'
|
|
1686
|
+
}];
|
|
1687
|
+
};
|
|
1688
|
+
|
|
1643
1689
|
const Small$1 = 1;
|
|
1644
1690
|
const Normal$1 = 2;
|
|
1645
1691
|
const Large$1 = 3;
|
|
@@ -1733,40 +1779,10 @@ const loadContent = async (state, platform, savedState) => {
|
|
|
1733
1779
|
const features = getFeatures(selectedFeature, extension);
|
|
1734
1780
|
const extensionUri = extension.uri || extension.path;
|
|
1735
1781
|
const folderSize = await getFolderSize(extensionUri);
|
|
1736
|
-
const entries =
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
key: 'Version',
|
|
1741
|
-
value: '1.9.5'
|
|
1742
|
-
}, {
|
|
1743
|
-
key: 'Last Updated',
|
|
1744
|
-
value: 'n/a'
|
|
1745
|
-
}];
|
|
1746
|
-
const secondEntries = [{
|
|
1747
|
-
key: 'Published',
|
|
1748
|
-
value: 'n/a'
|
|
1749
|
-
}, {
|
|
1750
|
-
key: 'Last Released',
|
|
1751
|
-
value: 'n/a'
|
|
1752
|
-
}];
|
|
1753
|
-
const categories = [{
|
|
1754
|
-
id: 'themes',
|
|
1755
|
-
label: 'Themes'
|
|
1756
|
-
}];
|
|
1757
|
-
const resources = [{
|
|
1758
|
-
label: 'Marketplace',
|
|
1759
|
-
url: '#'
|
|
1760
|
-
}, {
|
|
1761
|
-
label: 'Issues',
|
|
1762
|
-
url: '#'
|
|
1763
|
-
}, {
|
|
1764
|
-
label: 'Repository',
|
|
1765
|
-
url: '#'
|
|
1766
|
-
}, {
|
|
1767
|
-
label: 'License',
|
|
1768
|
-
url: '#'
|
|
1769
|
-
}];
|
|
1782
|
+
const entries = getEntries();
|
|
1783
|
+
const secondEntries = getSecondEntries();
|
|
1784
|
+
const categories = getCategories();
|
|
1785
|
+
const resources = getResources();
|
|
1770
1786
|
return {
|
|
1771
1787
|
...state,
|
|
1772
1788
|
selectedTab,
|
|
@@ -1854,6 +1870,7 @@ const ExtensionDetailHeaderActions = 'ExtensionDetailHeaderActions';
|
|
|
1854
1870
|
const ExtensionDetailHeaderDetails = 'ExtensionDetailHeaderDetails';
|
|
1855
1871
|
const ExtensionDetailIcon = 'ExtensionDetailIcon';
|
|
1856
1872
|
const ExtensionDetailName = 'ExtensionDetailName';
|
|
1873
|
+
const ExtensionDetailNameBadge = 'ExtensionDetailNameBadge';
|
|
1857
1874
|
const ExtensionDetailPanel = 'ExtensionDetailPanel';
|
|
1858
1875
|
const SettingsButton = 'SettingsButton';
|
|
1859
1876
|
const SettingsIcon = 'SettingsIcon';
|
|
@@ -1882,6 +1899,13 @@ const TableCell = 'TableCell';
|
|
|
1882
1899
|
const TableHeading = 'TableHeading';
|
|
1883
1900
|
const Viewlet = 'Viewlet';
|
|
1884
1901
|
|
|
1902
|
+
const getBadge = (extension, state) => {
|
|
1903
|
+
if (extension?.builtin && state.builtinExtensionsBadgeEnabled) {
|
|
1904
|
+
return 'builtin';
|
|
1905
|
+
}
|
|
1906
|
+
return '';
|
|
1907
|
+
};
|
|
1908
|
+
|
|
1885
1909
|
const BYTE_UNITS = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
1886
1910
|
const BIBYTE_UNITS = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
|
|
1887
1911
|
const BIT_UNITS = ['b', 'kbit', 'Mbit', 'Gbit', 'Tbit', 'Pbit', 'Ebit', 'Zbit', 'Ybit'];
|
|
@@ -2086,7 +2110,8 @@ const getMoreInfoEntryValueVirtualDom = item => {
|
|
|
2086
2110
|
const {
|
|
2087
2111
|
value,
|
|
2088
2112
|
onClick,
|
|
2089
|
-
code
|
|
2113
|
+
code,
|
|
2114
|
+
title
|
|
2090
2115
|
} = item;
|
|
2091
2116
|
const type = getTag(onClick, code);
|
|
2092
2117
|
const className = getClassName(onClick, code);
|
|
@@ -2094,7 +2119,8 @@ const getMoreInfoEntryValueVirtualDom = item => {
|
|
|
2094
2119
|
type: type,
|
|
2095
2120
|
className,
|
|
2096
2121
|
childCount: 1,
|
|
2097
|
-
onClick
|
|
2122
|
+
onClick,
|
|
2123
|
+
title
|
|
2098
2124
|
}, text(value)];
|
|
2099
2125
|
};
|
|
2100
2126
|
|
|
@@ -2161,14 +2187,7 @@ const getAdditionalDetailsVirtualDom = (showAdditionalDetails, firstHeading, ent
|
|
|
2161
2187
|
}, ...getAdditionalDetailsEntryVirtualDom(firstHeading, entries, getMoreInfoVirtualDom), ...getAdditionalDetailsEntryVirtualDom(secondHeading, secondEntries, getMoreInfoVirtualDom), ...getAdditionalDetailsEntryVirtualDom(thirdHeading, categories, getCategoriesDom), ...getAdditionalDetailsEntryVirtualDom(fourthHeading, resources, getResourcesVirtualDom)];
|
|
2162
2188
|
};
|
|
2163
2189
|
|
|
2164
|
-
const
|
|
2165
|
-
return [{
|
|
2166
|
-
id: 'themes',
|
|
2167
|
-
label: 'Themes'
|
|
2168
|
-
}];
|
|
2169
|
-
};
|
|
2170
|
-
|
|
2171
|
-
const getInstallationEntries = (displaySize, extensionId, extensionVersion) => {
|
|
2190
|
+
const getInstallationEntries = (displaySize, extensionId, extensionVersion, extensionUri) => {
|
|
2172
2191
|
const entries = [{
|
|
2173
2192
|
key: 'Identifier',
|
|
2174
2193
|
value: extensionId,
|
|
@@ -2185,7 +2204,8 @@ const getInstallationEntries = (displaySize, extensionId, extensionVersion) => {
|
|
|
2185
2204
|
}, {
|
|
2186
2205
|
key: 'Size',
|
|
2187
2206
|
value: displaySize,
|
|
2188
|
-
onClick: HandleClickSize
|
|
2207
|
+
onClick: HandleClickSize,
|
|
2208
|
+
title: extensionUri
|
|
2189
2209
|
}];
|
|
2190
2210
|
return entries;
|
|
2191
2211
|
};
|
|
@@ -2207,25 +2227,9 @@ const getMarketplaceEntries = () => {
|
|
|
2207
2227
|
}];
|
|
2208
2228
|
};
|
|
2209
2229
|
|
|
2210
|
-
const
|
|
2211
|
-
return [{
|
|
2212
|
-
label: 'Marketplace',
|
|
2213
|
-
url: '#'
|
|
2214
|
-
}, {
|
|
2215
|
-
label: 'Issues',
|
|
2216
|
-
url: '#'
|
|
2217
|
-
}, {
|
|
2218
|
-
label: 'Repository',
|
|
2219
|
-
url: '#'
|
|
2220
|
-
}, {
|
|
2221
|
-
label: 'License',
|
|
2222
|
-
url: '#'
|
|
2223
|
-
}];
|
|
2224
|
-
};
|
|
2225
|
-
|
|
2226
|
-
const getDetailsVirtualDom = async (sanitizedReadmeHtml, displaySize, extensionId, extensionVersion, width) => {
|
|
2230
|
+
const getDetailsVirtualDom = async (sanitizedReadmeHtml, displaySize, extensionId, extensionVersion, width, extensionUri) => {
|
|
2227
2231
|
const firstHeading = installation();
|
|
2228
|
-
const entries = getInstallationEntries(displaySize, extensionId, extensionVersion);
|
|
2232
|
+
const entries = getInstallationEntries(displaySize, extensionId, extensionVersion, extensionUri);
|
|
2229
2233
|
const secondHeading = marketplace();
|
|
2230
2234
|
const secondEntries = getMarketplaceEntries();
|
|
2231
2235
|
const thirdHeading = categories();
|
|
@@ -2620,7 +2624,7 @@ const getFeaturesVirtualDom = async (features, themesHtml, selectedFeature, exte
|
|
|
2620
2624
|
const getExtensionDetailContentVirtualDom = async (sanitizedReadmeHtml, themesHtml, selectedTab, features, displaySize, extensionId, extensionVersion, selectedFeature, extension, width) => {
|
|
2621
2625
|
switch (selectedTab) {
|
|
2622
2626
|
case Details:
|
|
2623
|
-
return await getDetailsVirtualDom(sanitizedReadmeHtml, displaySize, extensionId, extensionVersion, width);
|
|
2627
|
+
return await getDetailsVirtualDom(sanitizedReadmeHtml, displaySize, extensionId, extensionVersion, width, extension.uri || extension.path || '');
|
|
2624
2628
|
case Features$1:
|
|
2625
2629
|
return await getFeaturesVirtualDom(features, themesHtml, selectedFeature, extension);
|
|
2626
2630
|
case Changelog$1:
|
|
@@ -2678,9 +2682,14 @@ const getExtensionDetailHeaderActionsVirtualDom = (buttonDefs, settingsButtonEna
|
|
|
2678
2682
|
};
|
|
2679
2683
|
|
|
2680
2684
|
const getNameBadgeVirtualDom = badge => {
|
|
2681
|
-
{
|
|
2685
|
+
if (!badge) {
|
|
2682
2686
|
return [];
|
|
2683
2687
|
}
|
|
2688
|
+
return [{
|
|
2689
|
+
type: VirtualDomElements.Span,
|
|
2690
|
+
className: ExtensionDetailNameBadge,
|
|
2691
|
+
childCount: 1
|
|
2692
|
+
}, text(badge)];
|
|
2684
2693
|
};
|
|
2685
2694
|
|
|
2686
2695
|
const getExtensionDetailNameVirtualDom = (name, badge) => {
|
|
@@ -2688,7 +2697,7 @@ const getExtensionDetailNameVirtualDom = (name, badge) => {
|
|
|
2688
2697
|
type: VirtualDomElements.Div,
|
|
2689
2698
|
className: ExtensionDetailName,
|
|
2690
2699
|
childCount: badge ? 2 : 1
|
|
2691
|
-
}, text(name), ...getNameBadgeVirtualDom()];
|
|
2700
|
+
}, text(name), ...getNameBadgeVirtualDom(badge)];
|
|
2692
2701
|
};
|
|
2693
2702
|
|
|
2694
2703
|
const getExtensionDetailHeaderVirtualDom = (name, iconSrc, description, badge, buttonDefs, settingsButtonEnabled) => {
|
|
@@ -2797,7 +2806,7 @@ const getExtensionDetailVirtualDom = async (newState, sanitizedReadmeHtml, selec
|
|
|
2797
2806
|
iconSrc,
|
|
2798
2807
|
description
|
|
2799
2808
|
} = newState;
|
|
2800
|
-
const badge =
|
|
2809
|
+
const badge = getBadge(extension, newState);
|
|
2801
2810
|
const {
|
|
2802
2811
|
settingsButtonEnabled
|
|
2803
2812
|
} = newState;
|