@lvce-editor/extension-detail-view 3.33.0 → 3.34.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.
- package/dist/extensionDetailViewWorkerMain.js +292 -206
- package/package.json +1 -1
|
@@ -945,36 +945,44 @@ const {
|
|
|
945
945
|
const create$1 = (uid, uri, x, y, width, height, platform, assetDir) => {
|
|
946
946
|
const state = {
|
|
947
947
|
assetDir: assetDir || '',
|
|
948
|
+
activationEvents: [],
|
|
948
949
|
baseUrl: '',
|
|
949
950
|
builtinExtensionsBadgeEnabled: true,
|
|
950
951
|
categories: [],
|
|
951
952
|
changelogVirtualDom: [],
|
|
953
|
+
commands: [],
|
|
952
954
|
description: '',
|
|
953
955
|
detailsVirtualDom: [],
|
|
954
956
|
displaySize: '',
|
|
955
957
|
entries: [],
|
|
956
958
|
extension: {},
|
|
959
|
+
extensionId: '',
|
|
960
|
+
extensionVersion: '',
|
|
957
961
|
features: [],
|
|
958
962
|
featuresVirtualDom: [],
|
|
959
963
|
folderSize: 0,
|
|
964
|
+
hasColorTheme: false,
|
|
960
965
|
iconSrc: '',
|
|
966
|
+
isBuiltin: false,
|
|
967
|
+
jsonValidation: [],
|
|
961
968
|
name: '',
|
|
962
969
|
platform,
|
|
970
|
+
programmingLanguages: [],
|
|
963
971
|
readmeScrollTop: 0,
|
|
964
972
|
resources: [],
|
|
965
973
|
scrollToTopButtonEnabled: false,
|
|
966
974
|
secondEntries: [],
|
|
967
975
|
selectedFeature: '',
|
|
968
|
-
themesMarkdownDom: [],
|
|
969
976
|
selectedTab: '',
|
|
977
|
+
settings: [],
|
|
970
978
|
settingsButtonEnabled: false,
|
|
971
979
|
showAdditionalDetailsBreakpoint: 600,
|
|
972
980
|
sizeOnDisk: 0,
|
|
981
|
+
sizeValue: 0,
|
|
982
|
+
themesMarkdownDom: [],
|
|
973
983
|
uri,
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
isBuiltin: false,
|
|
977
|
-
sizeValue: 0
|
|
984
|
+
webViews: [],
|
|
985
|
+
width
|
|
978
986
|
};
|
|
979
987
|
set$1(uid, state, state);
|
|
980
988
|
};
|
|
@@ -1206,40 +1214,80 @@ const handleClickDisable = async state => {
|
|
|
1206
1214
|
return state;
|
|
1207
1215
|
};
|
|
1208
1216
|
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1217
|
+
const Text$1 = 1;
|
|
1218
|
+
const Code$2 = 2;
|
|
1219
|
+
|
|
1220
|
+
const getCommandTableEntry = command => {
|
|
1221
|
+
// TODO watch out for command being null/undefined/number/string/array
|
|
1213
1222
|
const {
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1223
|
+
id,
|
|
1224
|
+
label
|
|
1225
|
+
} = command;
|
|
1226
|
+
return [{
|
|
1227
|
+
type: Code$2,
|
|
1228
|
+
value: id
|
|
1229
|
+
}, {
|
|
1230
|
+
type: Text$1,
|
|
1231
|
+
value: label
|
|
1232
|
+
}];
|
|
1233
|
+
};
|
|
1234
|
+
|
|
1235
|
+
const getFeatureDetailsCommand = extension => {
|
|
1236
|
+
const commands = extension.commands || [];
|
|
1237
|
+
const rows = commands.map(getCommandTableEntry);
|
|
1228
1238
|
return {
|
|
1229
|
-
|
|
1230
|
-
selectedFeature: name,
|
|
1231
|
-
features: newFeatures
|
|
1239
|
+
commands: rows
|
|
1232
1240
|
};
|
|
1233
1241
|
};
|
|
1234
1242
|
|
|
1235
|
-
const
|
|
1236
|
-
|
|
1243
|
+
const getJsonValidationTableEntry = validation => {
|
|
1244
|
+
const {
|
|
1245
|
+
fileMatch,
|
|
1246
|
+
schema
|
|
1247
|
+
} = validation;
|
|
1248
|
+
return [{
|
|
1249
|
+
type: Code$2,
|
|
1250
|
+
value: fileMatch
|
|
1251
|
+
}, {
|
|
1252
|
+
type: Code$2,
|
|
1253
|
+
value: schema
|
|
1254
|
+
}];
|
|
1237
1255
|
};
|
|
1238
1256
|
|
|
1239
|
-
const
|
|
1257
|
+
const getFeatureDetailsJsonValidation = extension => {
|
|
1258
|
+
const validations = extension.jsonValidation || [];
|
|
1259
|
+
const rows = validations.map(getJsonValidationTableEntry);
|
|
1240
1260
|
return {
|
|
1241
|
-
|
|
1242
|
-
|
|
1261
|
+
jsonValidation: rows
|
|
1262
|
+
};
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
const getFeatureDetailsProgrammingLanguages = extension => {
|
|
1266
|
+
return {
|
|
1267
|
+
programmingLanguages: []
|
|
1268
|
+
};
|
|
1269
|
+
};
|
|
1270
|
+
|
|
1271
|
+
const getSettingsTableEntry = setting => {
|
|
1272
|
+
const {
|
|
1273
|
+
id,
|
|
1274
|
+
label
|
|
1275
|
+
} = setting;
|
|
1276
|
+
// TODO watch out for null/undefined/number/string/array
|
|
1277
|
+
return [{
|
|
1278
|
+
type: Text$1,
|
|
1279
|
+
value: id
|
|
1280
|
+
}, {
|
|
1281
|
+
type: Text$1,
|
|
1282
|
+
value: label
|
|
1283
|
+
}];
|
|
1284
|
+
};
|
|
1285
|
+
|
|
1286
|
+
const getFeatureDetailsSettings = extension => {
|
|
1287
|
+
const settings = extension.settings || [];
|
|
1288
|
+
const rows = settings.map(getSettingsTableEntry);
|
|
1289
|
+
return {
|
|
1290
|
+
settings: rows
|
|
1243
1291
|
};
|
|
1244
1292
|
};
|
|
1245
1293
|
|
|
@@ -1333,6 +1381,168 @@ const {
|
|
|
1333
1381
|
set,
|
|
1334
1382
|
setColorTheme: setColorTheme$1} = RendererWorker;
|
|
1335
1383
|
|
|
1384
|
+
const getMarkdownVirtualDom = async html => {
|
|
1385
|
+
string(html);
|
|
1386
|
+
const dom = await getMarkdownDom(html);
|
|
1387
|
+
return dom;
|
|
1388
|
+
};
|
|
1389
|
+
|
|
1390
|
+
const getThemeItemMarkdown = (heading, items) => {
|
|
1391
|
+
let markdown = '';
|
|
1392
|
+
if (items.length > 0) {
|
|
1393
|
+
markdown += `### ${heading}`;
|
|
1394
|
+
markdown += '\n\n';
|
|
1395
|
+
for (const item of items) {
|
|
1396
|
+
markdown += `- ${item.label}`;
|
|
1397
|
+
markdown += '\n';
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
return markdown;
|
|
1401
|
+
};
|
|
1402
|
+
|
|
1403
|
+
const getColorThemeMarkdown = themes => {
|
|
1404
|
+
const heading = 'Color Themes';
|
|
1405
|
+
return getThemeItemMarkdown(heading, themes);
|
|
1406
|
+
};
|
|
1407
|
+
const getIconThemeMarkdown = iconThemes => {
|
|
1408
|
+
const heading = 'File Icon Themes';
|
|
1409
|
+
return getThemeItemMarkdown(heading, iconThemes);
|
|
1410
|
+
};
|
|
1411
|
+
const getProductIconThemeMarkdown = iconThemes => {
|
|
1412
|
+
const heading = 'Product Icon Themes';
|
|
1413
|
+
return getThemeItemMarkdown(heading, iconThemes);
|
|
1414
|
+
};
|
|
1415
|
+
const getThemeMarkdown = (themes, iconThemes, productIconThemes) => {
|
|
1416
|
+
let markdown = '';
|
|
1417
|
+
markdown += getColorThemeMarkdown(themes);
|
|
1418
|
+
markdown += getIconThemeMarkdown(iconThemes);
|
|
1419
|
+
markdown += getProductIconThemeMarkdown(productIconThemes);
|
|
1420
|
+
return markdown;
|
|
1421
|
+
};
|
|
1422
|
+
|
|
1423
|
+
const renderMarkdown = async (markdown, options = {}) => {
|
|
1424
|
+
const html = await renderMarkdown$1(markdown, options);
|
|
1425
|
+
return html;
|
|
1426
|
+
};
|
|
1427
|
+
|
|
1428
|
+
const getFeatureDetailsTheme = async (extension, baseUrl) => {
|
|
1429
|
+
// Only generate theme markdown when the selected feature is actually "Theme"
|
|
1430
|
+
const {
|
|
1431
|
+
colorThemes,
|
|
1432
|
+
iconThemes,
|
|
1433
|
+
productIconThemes
|
|
1434
|
+
} = extension;
|
|
1435
|
+
const markdown = getThemeMarkdown(colorThemes || [], iconThemes || [], productIconThemes || []);
|
|
1436
|
+
const rendered = await renderMarkdown(markdown, {
|
|
1437
|
+
baseUrl
|
|
1438
|
+
});
|
|
1439
|
+
const themesMarkdownDom = await getMarkdownVirtualDom(rendered);
|
|
1440
|
+
return {
|
|
1441
|
+
themesMarkdownDom
|
|
1442
|
+
};
|
|
1443
|
+
};
|
|
1444
|
+
|
|
1445
|
+
const toWebView = rawWebView => {
|
|
1446
|
+
const {
|
|
1447
|
+
id,
|
|
1448
|
+
selector,
|
|
1449
|
+
contentSecurityPolicy,
|
|
1450
|
+
elements
|
|
1451
|
+
} = rawWebView;
|
|
1452
|
+
return {
|
|
1453
|
+
id,
|
|
1454
|
+
selectorString: JSON.stringify(selector),
|
|
1455
|
+
contentSecurityPolicyString: JSON.stringify(contentSecurityPolicy),
|
|
1456
|
+
elementsString: JSON.stringify(elements, null, 2)
|
|
1457
|
+
};
|
|
1458
|
+
};
|
|
1459
|
+
|
|
1460
|
+
const getWebViews = extension => {
|
|
1461
|
+
const rawWebViews = extension.webViews || [];
|
|
1462
|
+
return rawWebViews.map(toWebView);
|
|
1463
|
+
};
|
|
1464
|
+
|
|
1465
|
+
const getFeatureDetailsWebView = extension => {
|
|
1466
|
+
const webViews = getWebViews(extension);
|
|
1467
|
+
return {
|
|
1468
|
+
webViews
|
|
1469
|
+
};
|
|
1470
|
+
};
|
|
1471
|
+
|
|
1472
|
+
const Changelog$1 = 'Changelog';
|
|
1473
|
+
const Commands = 'Commands';
|
|
1474
|
+
const Details = 'Details';
|
|
1475
|
+
const Features$1 = 'Features';
|
|
1476
|
+
const JsonValidation = 'JsonValidation';
|
|
1477
|
+
const ProgrammingLanguages = 'ProgrammingLanguages';
|
|
1478
|
+
const Settings = 'Settings';
|
|
1479
|
+
const WebViews = 'WebViews';
|
|
1480
|
+
const Theme = 'Theme';
|
|
1481
|
+
const SetColorTheme = 'SetColorTheme';
|
|
1482
|
+
const Disable = 'Disable';
|
|
1483
|
+
const Uninstall = 'Uninstall';
|
|
1484
|
+
|
|
1485
|
+
const getFeatureDetailsHandler = featureName => {
|
|
1486
|
+
switch (featureName) {
|
|
1487
|
+
case Commands:
|
|
1488
|
+
return getFeatureDetailsCommand;
|
|
1489
|
+
case JsonValidation:
|
|
1490
|
+
return getFeatureDetailsJsonValidation;
|
|
1491
|
+
case ProgrammingLanguages:
|
|
1492
|
+
return getFeatureDetailsProgrammingLanguages;
|
|
1493
|
+
case Settings:
|
|
1494
|
+
return getFeatureDetailsSettings;
|
|
1495
|
+
case WebViews:
|
|
1496
|
+
return getFeatureDetailsWebView;
|
|
1497
|
+
case Theme:
|
|
1498
|
+
return getFeatureDetailsTheme;
|
|
1499
|
+
default:
|
|
1500
|
+
throw new Error(`unknown feature details handler: ${featureName}`);
|
|
1501
|
+
}
|
|
1502
|
+
};
|
|
1503
|
+
|
|
1504
|
+
const selectFeature = async (state, name) => {
|
|
1505
|
+
if (!name) {
|
|
1506
|
+
return state;
|
|
1507
|
+
}
|
|
1508
|
+
const {
|
|
1509
|
+
features,
|
|
1510
|
+
extension,
|
|
1511
|
+
baseUrl
|
|
1512
|
+
} = state;
|
|
1513
|
+
const newFeatures = features.map(feature => {
|
|
1514
|
+
if (feature.id === name) {
|
|
1515
|
+
return {
|
|
1516
|
+
...feature,
|
|
1517
|
+
selected: true
|
|
1518
|
+
};
|
|
1519
|
+
}
|
|
1520
|
+
return {
|
|
1521
|
+
...feature,
|
|
1522
|
+
selected: false
|
|
1523
|
+
};
|
|
1524
|
+
});
|
|
1525
|
+
const fn = getFeatureDetailsHandler(name);
|
|
1526
|
+
const partialNewState = await fn(extension, baseUrl);
|
|
1527
|
+
return {
|
|
1528
|
+
...state,
|
|
1529
|
+
...partialNewState,
|
|
1530
|
+
selectedFeature: name,
|
|
1531
|
+
features: newFeatures
|
|
1532
|
+
};
|
|
1533
|
+
};
|
|
1534
|
+
|
|
1535
|
+
const handleClickFeatures = async (state, name) => {
|
|
1536
|
+
return selectFeature(state, name);
|
|
1537
|
+
};
|
|
1538
|
+
|
|
1539
|
+
const handleClickScrollToTop = state => {
|
|
1540
|
+
return {
|
|
1541
|
+
...state,
|
|
1542
|
+
readmeScrollTop: 0
|
|
1543
|
+
};
|
|
1544
|
+
};
|
|
1545
|
+
|
|
1336
1546
|
const setColorTheme = id => {
|
|
1337
1547
|
return setColorTheme$1(id);
|
|
1338
1548
|
};
|
|
@@ -1396,25 +1606,6 @@ const handleIconError = state => {
|
|
|
1396
1606
|
};
|
|
1397
1607
|
};
|
|
1398
1608
|
|
|
1399
|
-
const Changelog$1 = 'Changelog';
|
|
1400
|
-
const Commands = 'Commands';
|
|
1401
|
-
const Details = 'Details';
|
|
1402
|
-
const Features$1 = 'Features';
|
|
1403
|
-
const JsonValidation = 'JsonValidation';
|
|
1404
|
-
const ProgrammingLanguages = 'ProgrammingLanguages';
|
|
1405
|
-
const Settings = 'Settings';
|
|
1406
|
-
const WebViews = 'WebViews';
|
|
1407
|
-
const Theme = 'Theme';
|
|
1408
|
-
const SetColorTheme = 'SetColorTheme';
|
|
1409
|
-
const Disable = 'Disable';
|
|
1410
|
-
const Uninstall = 'Uninstall';
|
|
1411
|
-
|
|
1412
|
-
const getMarkdownVirtualDom = async html => {
|
|
1413
|
-
string(html);
|
|
1414
|
-
const dom = await getMarkdownDom(html);
|
|
1415
|
-
return dom;
|
|
1416
|
-
};
|
|
1417
|
-
|
|
1418
1609
|
const readFile = async uri => {
|
|
1419
1610
|
return readFile$1(uri);
|
|
1420
1611
|
};
|
|
@@ -1445,11 +1636,6 @@ const loadChangelogContent = async path => {
|
|
|
1445
1636
|
}
|
|
1446
1637
|
};
|
|
1447
1638
|
|
|
1448
|
-
const renderMarkdown = async (markdown, options = {}) => {
|
|
1449
|
-
const html = await renderMarkdown$1(markdown, options);
|
|
1450
|
-
return html;
|
|
1451
|
-
};
|
|
1452
|
-
|
|
1453
1639
|
const selectTabChangelog = async state => {
|
|
1454
1640
|
const {
|
|
1455
1641
|
extension,
|
|
@@ -1504,64 +1690,19 @@ const selectTabDetails = async state => {
|
|
|
1504
1690
|
};
|
|
1505
1691
|
};
|
|
1506
1692
|
|
|
1507
|
-
const getThemeItemMarkdown = (heading, items) => {
|
|
1508
|
-
let markdown = '';
|
|
1509
|
-
if (items.length > 0) {
|
|
1510
|
-
markdown += `### ${heading}`;
|
|
1511
|
-
markdown += '\n\n';
|
|
1512
|
-
for (const item of items) {
|
|
1513
|
-
markdown += `- ${item.label}`;
|
|
1514
|
-
markdown += '\n';
|
|
1515
|
-
}
|
|
1516
|
-
}
|
|
1517
|
-
return markdown;
|
|
1518
|
-
};
|
|
1519
|
-
|
|
1520
|
-
const getColorThemeMarkdown = themes => {
|
|
1521
|
-
const heading = 'Color Themes';
|
|
1522
|
-
return getThemeItemMarkdown(heading, themes);
|
|
1523
|
-
};
|
|
1524
|
-
const getIconThemeMarkdown = iconThemes => {
|
|
1525
|
-
const heading = 'File Icon Themes';
|
|
1526
|
-
return getThemeItemMarkdown(heading, iconThemes);
|
|
1527
|
-
};
|
|
1528
|
-
const getProductIconThemeMarkdown = iconThemes => {
|
|
1529
|
-
const heading = 'Product Icon Themes';
|
|
1530
|
-
return getThemeItemMarkdown(heading, iconThemes);
|
|
1531
|
-
};
|
|
1532
|
-
const getThemeMarkdown = (themes, iconThemes, productIconThemes) => {
|
|
1533
|
-
let markdown = '';
|
|
1534
|
-
markdown += getColorThemeMarkdown(themes);
|
|
1535
|
-
markdown += getIconThemeMarkdown(iconThemes);
|
|
1536
|
-
markdown += getProductIconThemeMarkdown(productIconThemes);
|
|
1537
|
-
return markdown;
|
|
1538
|
-
};
|
|
1539
|
-
|
|
1540
1693
|
const selectTabFeatures = async state => {
|
|
1541
1694
|
const {
|
|
1542
1695
|
extension,
|
|
1543
1696
|
baseUrl,
|
|
1544
1697
|
selectedFeature
|
|
1545
1698
|
} = state;
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
if (!selectedFeature || selectedFeature === Theme) {
|
|
1550
|
-
const {
|
|
1551
|
-
colorThemes,
|
|
1552
|
-
iconThemes,
|
|
1553
|
-
productIconThemes
|
|
1554
|
-
} = extension;
|
|
1555
|
-
const markdown = getThemeMarkdown(colorThemes || [], iconThemes || [], productIconThemes || []);
|
|
1556
|
-
const rendered = await renderMarkdown(markdown, {
|
|
1557
|
-
baseUrl
|
|
1558
|
-
});
|
|
1559
|
-
themesMarkdownDom = await getMarkdownVirtualDom(rendered);
|
|
1560
|
-
}
|
|
1699
|
+
const actualSelectedFeature = selectedFeature || Theme;
|
|
1700
|
+
const fn = getFeatureDetailsHandler(actualSelectedFeature);
|
|
1701
|
+
const partialNewState = await fn(extension, baseUrl);
|
|
1561
1702
|
return {
|
|
1562
1703
|
...state,
|
|
1563
1704
|
selectedTab: Features$1,
|
|
1564
|
-
|
|
1705
|
+
...partialNewState
|
|
1565
1706
|
};
|
|
1566
1707
|
};
|
|
1567
1708
|
|
|
@@ -1969,6 +2110,8 @@ const loadContent = async (state, platform, savedState) => {
|
|
|
1969
2110
|
const sizeValue = getViewletSize(width || 0);
|
|
1970
2111
|
const isBuiltin = extension?.builtin;
|
|
1971
2112
|
const hasColorTheme = hasColorThemes(extension);
|
|
2113
|
+
const extensionId = extension?.id || 'n/a';
|
|
2114
|
+
const extensionVersion = extension?.version || 'n/a';
|
|
1972
2115
|
return {
|
|
1973
2116
|
...state,
|
|
1974
2117
|
baseUrl,
|
|
@@ -1988,7 +2131,9 @@ const loadContent = async (state, platform, savedState) => {
|
|
|
1988
2131
|
secondEntries,
|
|
1989
2132
|
selectedTab,
|
|
1990
2133
|
sizeOnDisk: size,
|
|
1991
|
-
sizeValue
|
|
2134
|
+
sizeValue,
|
|
2135
|
+
extensionId,
|
|
2136
|
+
extensionVersion
|
|
1992
2137
|
};
|
|
1993
2138
|
};
|
|
1994
2139
|
|
|
@@ -2006,21 +2151,27 @@ const Span = 8;
|
|
|
2006
2151
|
const Table$1 = 9;
|
|
2007
2152
|
const TBody = 10;
|
|
2008
2153
|
const Td = 11;
|
|
2009
|
-
const Text
|
|
2154
|
+
const Text = 12;
|
|
2010
2155
|
const Th = 13;
|
|
2011
2156
|
const THead = 14;
|
|
2012
2157
|
const Tr = 15;
|
|
2013
2158
|
const Img = 17;
|
|
2014
2159
|
const H2 = 22;
|
|
2160
|
+
const Dd = 43;
|
|
2161
|
+
const Dl = 44;
|
|
2015
2162
|
const Pre = 51;
|
|
2016
2163
|
const A = 53;
|
|
2017
|
-
const Code$
|
|
2164
|
+
const Code$1 = 65;
|
|
2165
|
+
const Dt = 67;
|
|
2018
2166
|
const VirtualDomElements = {
|
|
2019
2167
|
__proto__: null,
|
|
2020
2168
|
A,
|
|
2021
2169
|
Button: Button$1,
|
|
2022
|
-
Code: Code$
|
|
2170
|
+
Code: Code$1,
|
|
2171
|
+
Dd,
|
|
2023
2172
|
Div,
|
|
2173
|
+
Dl,
|
|
2174
|
+
Dt,
|
|
2024
2175
|
H1,
|
|
2025
2176
|
H2,
|
|
2026
2177
|
Img,
|
|
@@ -2034,7 +2185,7 @@ const VirtualDomElements = {
|
|
|
2034
2185
|
Tr};
|
|
2035
2186
|
const text = data => {
|
|
2036
2187
|
return {
|
|
2037
|
-
type: Text
|
|
2188
|
+
type: Text,
|
|
2038
2189
|
text: data,
|
|
2039
2190
|
childCount: 0
|
|
2040
2191
|
};
|
|
@@ -2049,7 +2200,7 @@ const ButtonPrimary = 'ButtonPrimary';
|
|
|
2049
2200
|
const Categories = 'Categories';
|
|
2050
2201
|
const Category = 'Category';
|
|
2051
2202
|
const Changelog = 'Changelog';
|
|
2052
|
-
const Code
|
|
2203
|
+
const Code = 'Code';
|
|
2053
2204
|
const DefaultMarkdown = 'DefaultMarkdown';
|
|
2054
2205
|
const DefinitionListItem = 'DefinitionListItem';
|
|
2055
2206
|
const DefinitionListItemHeading = 'DefinitionListItemHeading';
|
|
@@ -2181,7 +2332,7 @@ const getCategoriesDom = categories => {
|
|
|
2181
2332
|
};
|
|
2182
2333
|
|
|
2183
2334
|
const parentNode$1 = {
|
|
2184
|
-
type: VirtualDomElements.
|
|
2335
|
+
type: VirtualDomElements.Dt,
|
|
2185
2336
|
className: MoreInfoEntryKey,
|
|
2186
2337
|
childCount: 1
|
|
2187
2338
|
};
|
|
@@ -2199,14 +2350,14 @@ const getTag = (onClick, code) => {
|
|
|
2199
2350
|
if (code) {
|
|
2200
2351
|
return VirtualDomElements.Code;
|
|
2201
2352
|
}
|
|
2202
|
-
return VirtualDomElements.
|
|
2353
|
+
return VirtualDomElements.Dd;
|
|
2203
2354
|
};
|
|
2204
2355
|
const getClassName = (onClick, code) => {
|
|
2205
2356
|
if (onClick) {
|
|
2206
2357
|
return mergeClassNames(MoreInfoEntryValue, Link);
|
|
2207
2358
|
}
|
|
2208
2359
|
if (code) {
|
|
2209
|
-
return mergeClassNames(MoreInfoEntryValue, Code
|
|
2360
|
+
return mergeClassNames(MoreInfoEntryValue, Code);
|
|
2210
2361
|
}
|
|
2211
2362
|
return MoreInfoEntryValue;
|
|
2212
2363
|
};
|
|
@@ -2229,12 +2380,12 @@ const getMoreInfoEntryValueVirtualDom = item => {
|
|
|
2229
2380
|
};
|
|
2230
2381
|
|
|
2231
2382
|
const parentNodeEven = {
|
|
2232
|
-
type: VirtualDomElements.
|
|
2383
|
+
type: VirtualDomElements.Dt,
|
|
2233
2384
|
className: MoreInfoEntry,
|
|
2234
2385
|
childCount: 2
|
|
2235
2386
|
};
|
|
2236
2387
|
const parentNodeOdd = {
|
|
2237
|
-
type: VirtualDomElements.
|
|
2388
|
+
type: VirtualDomElements.Dt,
|
|
2238
2389
|
className: mergeClassNames(MoreInfoEntry, MoreInfoEntryOdd),
|
|
2239
2390
|
childCount: 2
|
|
2240
2391
|
};
|
|
@@ -2248,7 +2399,7 @@ const getMoreInfoEntryVirtualDom = item => {
|
|
|
2248
2399
|
|
|
2249
2400
|
const getMoreInfoVirtualDom = items => {
|
|
2250
2401
|
return [{
|
|
2251
|
-
type: VirtualDomElements.
|
|
2402
|
+
type: VirtualDomElements.Dl,
|
|
2252
2403
|
className: MoreInfo,
|
|
2253
2404
|
childCount: items.length
|
|
2254
2405
|
}, ...items.flatMap(getMoreInfoEntryVirtualDom)];
|
|
@@ -2368,24 +2519,6 @@ const getDetailsVirtualDom = (sanitizedReadmeHtml, displaySize, extensionId, ext
|
|
|
2368
2519
|
return dom;
|
|
2369
2520
|
};
|
|
2370
2521
|
|
|
2371
|
-
const Text = 1;
|
|
2372
|
-
const Code = 2;
|
|
2373
|
-
|
|
2374
|
-
const getCommandTableEntry = command => {
|
|
2375
|
-
// TODO watch out for command being null/undefined/number/string/array
|
|
2376
|
-
const {
|
|
2377
|
-
id,
|
|
2378
|
-
label
|
|
2379
|
-
} = command;
|
|
2380
|
-
return [{
|
|
2381
|
-
type: Code,
|
|
2382
|
-
value: id
|
|
2383
|
-
}, {
|
|
2384
|
-
type: Text,
|
|
2385
|
-
value: label
|
|
2386
|
-
}];
|
|
2387
|
-
};
|
|
2388
|
-
|
|
2389
2522
|
const getCommandTableEntries = extension => {
|
|
2390
2523
|
const commands = extension.commands || [];
|
|
2391
2524
|
const rows = commands.map(getCommandTableEntry);
|
|
@@ -2433,9 +2566,9 @@ const getCellTextVirtualDom = value => {
|
|
|
2433
2566
|
|
|
2434
2567
|
const getCellRenderer = type => {
|
|
2435
2568
|
switch (type) {
|
|
2436
|
-
case Code:
|
|
2569
|
+
case Code$2:
|
|
2437
2570
|
return getCellCodeVirtualDom;
|
|
2438
|
-
case Text:
|
|
2571
|
+
case Text$1:
|
|
2439
2572
|
return getCellTextVirtualDom;
|
|
2440
2573
|
default:
|
|
2441
2574
|
throw new Error(`unexpected cell type ${type}`);
|
|
@@ -2490,20 +2623,6 @@ const getFeatureCommandsVirtualDom = extension => {
|
|
|
2490
2623
|
}, ...getFeatureContentHeadingVirtualDom(heading), ...getTableVirtualDom(tableInfo)];
|
|
2491
2624
|
};
|
|
2492
2625
|
|
|
2493
|
-
const getJsonValidationTableEntry = validation => {
|
|
2494
|
-
const {
|
|
2495
|
-
fileMatch,
|
|
2496
|
-
schema
|
|
2497
|
-
} = validation;
|
|
2498
|
-
return [{
|
|
2499
|
-
type: Code,
|
|
2500
|
-
value: fileMatch
|
|
2501
|
-
}, {
|
|
2502
|
-
type: Code,
|
|
2503
|
-
value: schema
|
|
2504
|
-
}];
|
|
2505
|
-
};
|
|
2506
|
-
|
|
2507
2626
|
const getJsonValidationTableEntries = extension => {
|
|
2508
2627
|
const validations = extension.jsonValidation || [];
|
|
2509
2628
|
const rows = validations.map(getJsonValidationTableEntry);
|
|
@@ -2546,21 +2665,6 @@ const getFeatureProgrammingLanguagesVirtualDom = () => {
|
|
|
2546
2665
|
}, ...getFeatureContentHeadingVirtualDom(heading)];
|
|
2547
2666
|
};
|
|
2548
2667
|
|
|
2549
|
-
const getSettingsTableEntry = setting => {
|
|
2550
|
-
const {
|
|
2551
|
-
id,
|
|
2552
|
-
label
|
|
2553
|
-
} = setting;
|
|
2554
|
-
// TODO watch out for null/undefined/number/string/array
|
|
2555
|
-
return [{
|
|
2556
|
-
type: Text,
|
|
2557
|
-
value: id
|
|
2558
|
-
}, {
|
|
2559
|
-
type: Text,
|
|
2560
|
-
value: label
|
|
2561
|
-
}];
|
|
2562
|
-
};
|
|
2563
|
-
|
|
2564
2668
|
const getSettingsTableEntries = extension => {
|
|
2565
2669
|
const settings = extension.settings || [];
|
|
2566
2670
|
const rows = settings.map(getSettingsTableEntry);
|
|
@@ -2609,26 +2713,6 @@ const getFeatureThemesVirtualDom = themesDom => {
|
|
|
2609
2713
|
}, ...themesDom];
|
|
2610
2714
|
};
|
|
2611
2715
|
|
|
2612
|
-
const toWebView = rawWebView => {
|
|
2613
|
-
const {
|
|
2614
|
-
id,
|
|
2615
|
-
selector,
|
|
2616
|
-
contentSecurityPolicy,
|
|
2617
|
-
elements
|
|
2618
|
-
} = rawWebView;
|
|
2619
|
-
return {
|
|
2620
|
-
id,
|
|
2621
|
-
selectorString: JSON.stringify(selector),
|
|
2622
|
-
contentSecurityPolicyString: JSON.stringify(contentSecurityPolicy),
|
|
2623
|
-
elementsString: JSON.stringify(elements, null, 2)
|
|
2624
|
-
};
|
|
2625
|
-
};
|
|
2626
|
-
|
|
2627
|
-
const getWebViews = extension => {
|
|
2628
|
-
const rawWebViews = extension.webViews || [];
|
|
2629
|
-
return rawWebViews.map(toWebView);
|
|
2630
|
-
};
|
|
2631
|
-
|
|
2632
2716
|
const heading = {
|
|
2633
2717
|
type: VirtualDomElements.H2,
|
|
2634
2718
|
className: DefinitionListItemHeading,
|
|
@@ -2913,36 +2997,38 @@ const getExtensionDetailVirtualDom = (newState, selectedTab) => {
|
|
|
2913
2997
|
// 2. view model
|
|
2914
2998
|
// 3. virtual dom
|
|
2915
2999
|
// 4. dom
|
|
2916
|
-
const themesHtml = newState.themesMarkdownDom;
|
|
2917
|
-
const selectedFeature = newState?.selectedFeature || '';
|
|
2918
|
-
const extension = newState?.extension || {};
|
|
2919
|
-
const features = getFeatures(selectedFeature, extension);
|
|
2920
|
-
const extensionId = newState?.extension?.id || 'n/a';
|
|
2921
|
-
const extensionVersion = newState?.extension?.version || 'n/a';
|
|
2922
3000
|
const {
|
|
2923
|
-
displaySize
|
|
3001
|
+
displaySize,
|
|
3002
|
+
themesMarkdownDom,
|
|
3003
|
+
selectedFeature,
|
|
3004
|
+
extension,
|
|
3005
|
+
sizeValue,
|
|
3006
|
+
isBuiltin,
|
|
3007
|
+
categories,
|
|
3008
|
+
resources,
|
|
3009
|
+
showAdditionalDetailsBreakpoint,
|
|
3010
|
+
scrollToTopButtonEnabled,
|
|
3011
|
+
hasColorTheme,
|
|
3012
|
+
builtinExtensionsBadgeEnabled,
|
|
3013
|
+
settingsButtonEnabled,
|
|
3014
|
+
name,
|
|
3015
|
+
iconSrc,
|
|
3016
|
+
description,
|
|
3017
|
+
detailsVirtualDom,
|
|
3018
|
+
features,
|
|
3019
|
+
extensionId,
|
|
3020
|
+
extensionVersion
|
|
2924
3021
|
} = newState;
|
|
2925
3022
|
const width = newState?.width || 500;
|
|
2926
3023
|
const tabs = getTabs(selectedTab);
|
|
2927
|
-
const {
|
|
2928
|
-
sizeValue
|
|
2929
|
-
} = newState;
|
|
2930
3024
|
const sizeClass = getClassNames(sizeValue);
|
|
2931
|
-
const buttonDefs = getExtensionDetailButtons(
|
|
2932
|
-
const
|
|
2933
|
-
name,
|
|
2934
|
-
iconSrc,
|
|
2935
|
-
description
|
|
2936
|
-
} = newState;
|
|
2937
|
-
const badge = getBadge(newState.isBuiltin, newState.builtinExtensionsBadgeEnabled); // TODO compute in loadContent
|
|
2938
|
-
const {
|
|
2939
|
-
settingsButtonEnabled
|
|
2940
|
-
} = newState;
|
|
3025
|
+
const buttonDefs = getExtensionDetailButtons(hasColorTheme, isBuiltin);
|
|
3026
|
+
const badge = getBadge(isBuiltin, builtinExtensionsBadgeEnabled); // TODO compute in loadContent
|
|
2941
3027
|
const dom = [{
|
|
2942
3028
|
type: VirtualDomElements.Div,
|
|
2943
3029
|
className: mergeClassNames(Viewlet, ExtensionDetail, sizeClass),
|
|
2944
3030
|
childCount: 3
|
|
2945
|
-
}, ...getExtensionDetailHeaderVirtualDom(name, iconSrc, description, badge, buttonDefs, settingsButtonEnabled), ...getTabsVirtualDom(tabs), ...getExtensionDetailContentVirtualDom(
|
|
3031
|
+
}, ...getExtensionDetailHeaderVirtualDom(name, iconSrc, description, badge, buttonDefs, settingsButtonEnabled), ...getTabsVirtualDom(tabs), ...getExtensionDetailContentVirtualDom(detailsVirtualDom, themesMarkdownDom, selectedTab, features, displaySize, extensionId, extensionVersion, selectedFeature, extension, width, scrollToTopButtonEnabled, categories, resources, showAdditionalDetailsBreakpoint)];
|
|
2946
3032
|
return dom;
|
|
2947
3033
|
};
|
|
2948
3034
|
|