@lvce-editor/extension-detail-view 3.11.0 → 3.12.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.
|
@@ -923,12 +923,15 @@ const Markdown = 'Markdown';
|
|
|
923
923
|
const MoreInfo = 'MoreInfo';
|
|
924
924
|
const MoreInfoEntry = 'MoreInfoEntry';
|
|
925
925
|
const MoreInfoEntryKey = 'MoreInfoEntryKey';
|
|
926
|
+
const MoreInfoEntryOdd = 'MoreInfoEntryOdd';
|
|
926
927
|
const MoreInfoEntryValue = 'MoreInfoEntryValue';
|
|
927
928
|
const Normal$1 = 'Normal';
|
|
928
929
|
const Resource = 'Resource';
|
|
929
930
|
const Resources = 'Resources';
|
|
930
931
|
const Small$1 = 'Small';
|
|
931
932
|
const Table$1 = 'Table';
|
|
933
|
+
const TableCell = 'TableCell';
|
|
934
|
+
const TableHeading = 'TableHeading';
|
|
932
935
|
const Viewlet = 'Viewlet';
|
|
933
936
|
|
|
934
937
|
const BYTE_UNITS = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
@@ -1149,7 +1152,7 @@ const parentNodeEven = {
|
|
|
1149
1152
|
};
|
|
1150
1153
|
const parentNodeOdd = {
|
|
1151
1154
|
type: Div$1,
|
|
1152
|
-
className: MoreInfoEntry + ' ' +
|
|
1155
|
+
className: MoreInfoEntry + ' ' + MoreInfoEntryOdd,
|
|
1153
1156
|
childCount: 2
|
|
1154
1157
|
};
|
|
1155
1158
|
const getMoreInfoEntryVirtualDom = item => {
|
|
@@ -1168,16 +1171,17 @@ const getMoreInfoVirtualDom = items => {
|
|
|
1168
1171
|
}, ...items.flatMap(getMoreInfoEntryVirtualDom)];
|
|
1169
1172
|
};
|
|
1170
1173
|
|
|
1174
|
+
const resourceNode = {
|
|
1175
|
+
// TODO use link with url
|
|
1176
|
+
type: Div$1,
|
|
1177
|
+
className: Resource,
|
|
1178
|
+
childCount: 1
|
|
1179
|
+
};
|
|
1171
1180
|
const getResourceVirtualDom = resource => {
|
|
1172
1181
|
const {
|
|
1173
1182
|
label
|
|
1174
1183
|
} = resource;
|
|
1175
|
-
return [
|
|
1176
|
-
// TODO use link with url
|
|
1177
|
-
type: Div$1,
|
|
1178
|
-
className: Resource,
|
|
1179
|
-
childCount: 1
|
|
1180
|
-
}, text(label)];
|
|
1184
|
+
return [resourceNode, text(label)];
|
|
1181
1185
|
};
|
|
1182
1186
|
|
|
1183
1187
|
const getResourcesVirtualDom = resources => {
|
|
@@ -1768,6 +1772,7 @@ const Elements = 'Elements';
|
|
|
1768
1772
|
const FileMatch = 'File Match';
|
|
1769
1773
|
const Id = 'ID';
|
|
1770
1774
|
const JsonValidation$1 = 'Json Validation';
|
|
1775
|
+
const Label = 'Label';
|
|
1771
1776
|
const OpenImageInNewTab = 'Open Image in New Tab';
|
|
1772
1777
|
const OpenInNewTab = 'Open in New Tab';
|
|
1773
1778
|
const ProgrammingLanguages$1 = 'Programming Languages';
|
|
@@ -1784,6 +1789,9 @@ const copy = () => {
|
|
|
1784
1789
|
const openInNewTab = () => {
|
|
1785
1790
|
return i18nString(OpenInNewTab);
|
|
1786
1791
|
};
|
|
1792
|
+
const label = () => {
|
|
1793
|
+
return i18nString(Label);
|
|
1794
|
+
};
|
|
1787
1795
|
const openImageInNewTab = () => {
|
|
1788
1796
|
return i18nString(OpenImageInNewTab);
|
|
1789
1797
|
};
|
|
@@ -1844,6 +1852,7 @@ const getCommandTableEntry = command => {
|
|
|
1844
1852
|
value: label
|
|
1845
1853
|
}];
|
|
1846
1854
|
};
|
|
1855
|
+
|
|
1847
1856
|
const getCommandTableEntries = extension => {
|
|
1848
1857
|
const commands = extension.commands || [];
|
|
1849
1858
|
const rows = commands.map(getCommandTableEntry);
|
|
@@ -1860,10 +1869,18 @@ const getFeatureContentHeadingVirtualDom = heading => {
|
|
|
1860
1869
|
}, text(heading)];
|
|
1861
1870
|
};
|
|
1862
1871
|
|
|
1872
|
+
const getTableHeadingVirtualDom = heading => {
|
|
1873
|
+
return [{
|
|
1874
|
+
type: Th,
|
|
1875
|
+
className: TableHeading,
|
|
1876
|
+
childCount: 1
|
|
1877
|
+
}, text(heading)];
|
|
1878
|
+
};
|
|
1879
|
+
|
|
1863
1880
|
const getCellCodeVirtualDom = value => {
|
|
1864
1881
|
return [{
|
|
1865
1882
|
type: Td,
|
|
1866
|
-
className:
|
|
1883
|
+
className: TableCell,
|
|
1867
1884
|
childCount: 1
|
|
1868
1885
|
}, {
|
|
1869
1886
|
type: Div$1,
|
|
@@ -1875,7 +1892,7 @@ const getCellCodeVirtualDom = value => {
|
|
|
1875
1892
|
const getCellTextVirtualDom = value => {
|
|
1876
1893
|
return [{
|
|
1877
1894
|
type: Td,
|
|
1878
|
-
className:
|
|
1895
|
+
className: TableCell,
|
|
1879
1896
|
childCount: 1
|
|
1880
1897
|
}, text(value)];
|
|
1881
1898
|
};
|
|
@@ -1900,20 +1917,13 @@ const getCellVirtualDom = entry => {
|
|
|
1900
1917
|
return fn(value);
|
|
1901
1918
|
};
|
|
1902
1919
|
|
|
1903
|
-
const getTableHeadingVirtualDom = heading => {
|
|
1904
|
-
return [{
|
|
1905
|
-
type: Th,
|
|
1906
|
-
className: 'TableHeading',
|
|
1907
|
-
childCount: 1
|
|
1908
|
-
}, text(heading)];
|
|
1909
|
-
};
|
|
1910
|
-
|
|
1911
1920
|
const getTableRowVirtualDom = entries => {
|
|
1912
1921
|
return [{
|
|
1913
1922
|
type: Tr,
|
|
1914
1923
|
childCount: entries.length
|
|
1915
1924
|
}, ...entries.flatMap(getCellVirtualDom)];
|
|
1916
1925
|
};
|
|
1926
|
+
|
|
1917
1927
|
const getTableVirtualDom = tableInfo => {
|
|
1918
1928
|
const {
|
|
1919
1929
|
headings,
|
|
@@ -1935,6 +1945,7 @@ const getTableVirtualDom = tableInfo => {
|
|
|
1935
1945
|
}, ...rows.flatMap(getTableRowVirtualDom)];
|
|
1936
1946
|
};
|
|
1937
1947
|
|
|
1948
|
+
// TODO have typed view-model
|
|
1938
1949
|
const getFeatureCommandsVirtualDom = extension => {
|
|
1939
1950
|
const heading = commands();
|
|
1940
1951
|
const tableInfo = getCommandTableEntries(extension);
|
|
@@ -2014,11 +2025,14 @@ const getSettingsTableEntry = setting => {
|
|
|
2014
2025
|
value: label
|
|
2015
2026
|
}];
|
|
2016
2027
|
};
|
|
2028
|
+
|
|
2017
2029
|
const getSettingsTableEntries = extension => {
|
|
2018
2030
|
const settings = extension.settings || [];
|
|
2019
2031
|
const rows = settings.map(getSettingsTableEntry);
|
|
2032
|
+
const textId = id();
|
|
2033
|
+
const textLabel = label();
|
|
2020
2034
|
return {
|
|
2021
|
-
headings: [
|
|
2035
|
+
headings: [textId, textLabel],
|
|
2022
2036
|
rows
|
|
2023
2037
|
};
|
|
2024
2038
|
};
|
|
@@ -2063,6 +2077,8 @@ const item = {
|
|
|
2063
2077
|
className: DefinitionListItem,
|
|
2064
2078
|
childCount: 2
|
|
2065
2079
|
};
|
|
2080
|
+
|
|
2081
|
+
// TODO move json stringify to view model
|
|
2066
2082
|
const getWebViewVirtualDom = webView => {
|
|
2067
2083
|
const {
|
|
2068
2084
|
id: id$1,
|
|
@@ -2264,7 +2280,13 @@ const getFeatures = (selectedFeature, extension) => {
|
|
|
2264
2280
|
if (!selectedFeature) {
|
|
2265
2281
|
selectedFeature = Theme;
|
|
2266
2282
|
}
|
|
2267
|
-
const
|
|
2283
|
+
const textTheme = theme();
|
|
2284
|
+
const textCommands = commands();
|
|
2285
|
+
const textJsonValidation = jsonValidation();
|
|
2286
|
+
const programmingLanguages$1 = programmingLanguages();
|
|
2287
|
+
const settings$1 = settings();
|
|
2288
|
+
const webViews$1 = webViews();
|
|
2289
|
+
const features = [...ifElseFeature(Theme, textTheme, hasThemes, selectedFeature, extension), ...ifElseFeature(Commands, textCommands, hasCommands, selectedFeature, extension), ...ifElseFeature(JsonValidation, textJsonValidation, hasJsonValidation, selectedFeature, extension), ...ifElseFeature(ProgrammingLanguages, programmingLanguages$1, hasProgrammingLanguages, selectedFeature, extension), ...ifElseFeature(Settings, settings$1, hasSettings, selectedFeature, extension), ...ifElseFeature(WebViews, webViews$1, hasWebViews, selectedFeature, extension)];
|
|
2268
2290
|
return features;
|
|
2269
2291
|
};
|
|
2270
2292
|
|