@lvce-editor/extension-detail-view 7.14.2 → 7.15.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.
@@ -325,6 +325,7 @@ const featureActivationEventsEnabled = extension => {
325
325
  return Array.isArray(extension.activation);
326
326
  };
327
327
 
328
+ const Alert = 'alert';
328
329
  const None$3 = 'none';
329
330
  const Panel = 'panel';
330
331
  const Tab = 'tab';
@@ -891,7 +892,7 @@ const getActivationEventVirtualDom = event => {
891
892
  if (!isValid) {
892
893
  return [{
893
894
  childCount: 1,
894
- className: 'ListItem ListItemInvalid',
895
+ className: mergeClassNames('ListItem', 'ListItemInvalid'),
895
896
  title: errorMessage,
896
897
  type: Li
897
898
  }, code, text(stringValue)];
@@ -899,27 +900,32 @@ const getActivationEventVirtualDom = event => {
899
900
  return [li, code, text(stringValue)];
900
901
  };
901
902
 
903
+ const featureContentHeadingNode = {
904
+ childCount: 1,
905
+ type: H1
906
+ };
902
907
  const getFeatureContentHeadingVirtualDom = heading => {
903
- return [{
904
- childCount: 1,
905
- type: H1
906
- }, text(heading)];
908
+ return [featureContentHeadingNode, text(heading)];
907
909
  };
908
910
 
911
+ const featureContentNode$7 = {
912
+ childCount: 2,
913
+ className: FeatureContent,
914
+ type: Div
915
+ };
909
916
  const getFeatureActivationEventsVirtualDom = activationEvents$1 => {
910
917
  const heading = activationEvents();
911
- return [{
912
- childCount: 2,
913
- className: FeatureContent,
914
- type: Div
915
- }, ...getFeatureContentHeadingVirtualDom(heading), {
918
+ return [featureContentNode$7, ...getFeatureContentHeadingVirtualDom(heading), {
916
919
  childCount: activationEvents$1.length,
917
920
  type: Ul
918
921
  }, ...activationEvents$1.flatMap(getActivationEventVirtualDom)];
919
922
  };
920
923
 
921
924
  const getActivationEventsVirtualDom = state => {
922
- return getFeatureActivationEventsVirtualDom(state.activationEntries);
925
+ const {
926
+ activationEntries
927
+ } = state;
928
+ return getFeatureActivationEventsVirtualDom(activationEntries);
923
929
  };
924
930
 
925
931
  const Text = 1;
@@ -967,27 +973,35 @@ const getCommandTableEntries = rows => {
967
973
  };
968
974
  };
969
975
 
976
+ const featureContentNode$6 = {
977
+ childCount: 2,
978
+ className: FeatureContent,
979
+ type: Div
980
+ };
981
+ const emptyCommandsNode = {
982
+ childCount: 1,
983
+ type: P
984
+ };
970
985
  const getFeatureCommandsEmptyVirtualDom = () => {
971
986
  const heading = commands$1();
972
987
  const emptyCommandsArray$1 = emptyCommandsArray();
973
- return [{
974
- childCount: 2,
975
- className: FeatureContent,
976
- type: Div
977
- }, ...getFeatureContentHeadingVirtualDom(heading), {
978
- childCount: 1,
979
- type: P
980
- }, text(emptyCommandsArray$1)];
988
+ return [featureContentNode$6, ...getFeatureContentHeadingVirtualDom(heading), emptyCommandsNode, text(emptyCommandsArray$1)];
981
989
  };
982
990
 
991
+ const tableHeadingNode = {
992
+ childCount: 1,
993
+ className: TableHeading,
994
+ type: Th
995
+ };
983
996
  const getTableHeadingVirtualDom = heading => {
984
- return [{
985
- childCount: 1,
986
- className: TableHeading,
987
- type: Th
988
- }, text(heading)];
997
+ return [tableHeadingNode, text(heading)];
989
998
  };
990
999
 
1000
+ const tableCellNode = {
1001
+ childCount: 1,
1002
+ className: TableCell,
1003
+ type: Td
1004
+ };
991
1005
  const getCheckedText = checked => {
992
1006
  if (checked) {
993
1007
  return 'yes';
@@ -999,18 +1013,15 @@ const getCellCheckMarkVirtualDom = (value, props) => {
999
1013
  checked
1000
1014
  } = props;
1001
1015
  const checkedText = getCheckedText(checked);
1002
- return [{
1003
- childCount: 1,
1004
- className: TableCell,
1005
- type: Td
1006
- }, text(checkedText)];
1016
+ return [tableCellNode, text(checkedText)];
1007
1017
  };
1008
1018
 
1019
+ const codeNode$1 = {
1020
+ childCount: 1,
1021
+ type: Code$2
1022
+ };
1009
1023
  const getListItemDom = item => {
1010
- return [{
1011
- childCount: 1,
1012
- type: Code$2
1013
- }, text(item)];
1024
+ return [codeNode$1, text(item)];
1014
1025
  };
1015
1026
  const getCellCodeListVirtualDom = (value, props) => {
1016
1027
  const {
@@ -1023,8 +1034,12 @@ const getCellCodeListVirtualDom = (value, props) => {
1023
1034
  }, ...listItems.flatMap(getListItemDom)];
1024
1035
  };
1025
1036
 
1037
+ const codeNode = {
1038
+ childCount: 1,
1039
+ type: Code$2
1040
+ };
1026
1041
  const getCellCodeVirtualDom = (value, props) => {
1027
- const tdClassName = props?.className ? `${TableCell} ${props.className}` : TableCell;
1042
+ const tdClassName = mergeClassNames(TableCell, props?.className || '');
1028
1043
  return [{
1029
1044
  childCount: 1,
1030
1045
  className: tdClassName,
@@ -1032,10 +1047,7 @@ const getCellCodeVirtualDom = (value, props) => {
1032
1047
  ...(props?.title && {
1033
1048
  title: props.title
1034
1049
  })
1035
- }, {
1036
- childCount: 1,
1037
- type: Code$2
1038
- }, text(value)];
1050
+ }, codeNode, text(value)];
1039
1051
  };
1040
1052
 
1041
1053
  const getTitleProps = title => {
@@ -1047,7 +1059,7 @@ const getTitleProps = title => {
1047
1059
  return {};
1048
1060
  };
1049
1061
  const getCellLinkVirtualDom = (value, props) => {
1050
- const tdClassName = props?.className ? `${TableCell} ${props.className}` : TableCell;
1062
+ const tdClassName = mergeClassNames(TableCell, props?.className || '');
1051
1063
  return [{
1052
1064
  childCount: 1,
1053
1065
  className: tdClassName,
@@ -1062,7 +1074,7 @@ const getCellLinkVirtualDom = (value, props) => {
1062
1074
  };
1063
1075
 
1064
1076
  const getCellTextVirtualDom = (value, props) => {
1065
- const tdClassName = props?.className ? `${TableCell} ${props.className}` : TableCell;
1077
+ const tdClassName = mergeClassNames(TableCell, props?.className || '');
1066
1078
  return [{
1067
1079
  childCount: 1,
1068
1080
  className: tdClassName,
@@ -1107,19 +1119,21 @@ const getTableRowVirtualDom = entries => {
1107
1119
  }, ...entries.flatMap(getCellVirtualDom)];
1108
1120
  };
1109
1121
 
1122
+ const tableNode = {
1123
+ childCount: 2,
1124
+ className: Table,
1125
+ type: Table$1
1126
+ };
1127
+ const tableHeadNode = {
1128
+ childCount: 1,
1129
+ type: THead
1130
+ };
1110
1131
  const getTableVirtualDom = tableInfo => {
1111
1132
  const {
1112
1133
  headings,
1113
1134
  rows
1114
1135
  } = tableInfo;
1115
- return [{
1116
- childCount: 2,
1117
- className: Table,
1118
- type: Table$1
1119
- }, {
1120
- childCount: 1,
1121
- type: THead
1122
- }, {
1136
+ return [tableNode, tableHeadNode, {
1123
1137
  childCount: headings.length,
1124
1138
  type: Tr
1125
1139
  }, ...headings.flatMap(getTableHeadingVirtualDom), {
@@ -1128,6 +1142,12 @@ const getTableVirtualDom = tableInfo => {
1128
1142
  }, ...rows.flatMap(getTableRowVirtualDom)];
1129
1143
  };
1130
1144
 
1145
+ const featureContentNode$5 = {
1146
+ childCount: 2,
1147
+ className: FeatureContent,
1148
+ type: Div
1149
+ };
1150
+
1131
1151
  // TODO have typed view-model
1132
1152
  const getFeatureCommandsVirtualDom = commands => {
1133
1153
  if (commands.length === 0) {
@@ -1135,15 +1155,14 @@ const getFeatureCommandsVirtualDom = commands => {
1135
1155
  }
1136
1156
  const heading = commands$1();
1137
1157
  const tableInfo = getCommandTableEntries(commands);
1138
- return [{
1139
- childCount: 2,
1140
- className: FeatureContent,
1141
- type: Div
1142
- }, ...getFeatureContentHeadingVirtualDom(heading), ...getTableVirtualDom(tableInfo)];
1158
+ return [featureContentNode$5, ...getFeatureContentHeadingVirtualDom(heading), ...getTableVirtualDom(tableInfo)];
1143
1159
  };
1144
1160
 
1145
1161
  const getCommandsVirtualDom = state => {
1146
- return getFeatureCommandsVirtualDom(state.commands);
1162
+ const {
1163
+ commands
1164
+ } = state;
1165
+ return getFeatureCommandsVirtualDom(commands);
1147
1166
  };
1148
1167
 
1149
1168
  const existsJson = async schemaUrl => {
@@ -1357,7 +1376,10 @@ const getFeatureJsonValidationVirtualDom = jsonValidation$1 => {
1357
1376
  };
1358
1377
 
1359
1378
  const getJsonValidationVirtualDom = state => {
1360
- return getFeatureJsonValidationVirtualDom(state.jsonValidation);
1379
+ const {
1380
+ jsonValidation
1381
+ } = state;
1382
+ return getFeatureJsonValidationVirtualDom(jsonValidation);
1361
1383
  };
1362
1384
 
1363
1385
  const getProgrammingLanguageTableEntry = programmingLanguage => {
@@ -1420,18 +1442,20 @@ const getProgrammingLanguagesTableEntries = rows => {
1420
1442
  };
1421
1443
  };
1422
1444
 
1445
+ const featureContentNode$4 = {
1446
+ childCount: 2,
1447
+ className: FeatureContent,
1448
+ type: Div
1449
+ };
1450
+ const emptyProgrammingLanguagesNode = {
1451
+ childCount: 1,
1452
+ type: P
1453
+ };
1423
1454
  const getFeatureProgrammingLanguagesVirtualDom = programmingLanguages$1 => {
1424
1455
  const heading = programmingLanguages();
1425
- const top = [{
1426
- childCount: 2,
1427
- className: FeatureContent,
1428
- type: Div
1429
- }, ...getFeatureContentHeadingVirtualDom(heading)];
1456
+ const top = [featureContentNode$4, ...getFeatureContentHeadingVirtualDom(heading)];
1430
1457
  if (programmingLanguages$1.length === 0) {
1431
- return [...top, {
1432
- childCount: 1,
1433
- type: P
1434
- }, text('Empty Array.')];
1458
+ return [...top, emptyProgrammingLanguagesNode, text('Empty Array.')];
1435
1459
  }
1436
1460
  const tableInfo = getProgrammingLanguagesTableEntries(programmingLanguages$1);
1437
1461
  return [...top, ...getTableVirtualDom(tableInfo)];
@@ -1451,17 +1475,20 @@ class FeatureNotFoundError extends Error {
1451
1475
  }
1452
1476
  }
1453
1477
 
1478
+ const unsupportedFeatureNode = {
1479
+ childCount: 2,
1480
+ type: Div
1481
+ };
1482
+ const unsupportedFeatureHeadingNode = {
1483
+ childCount: 1,
1484
+ type: H1
1485
+ };
1486
+ const unsupportedFeatureMessageNode = {
1487
+ childCount: 1,
1488
+ type: P
1489
+ };
1454
1490
  const getFeatureUnsupportedVirtualDom = state => {
1455
- return [{
1456
- childCount: 2,
1457
- type: Div
1458
- }, {
1459
- childCount: 1,
1460
- type: H1
1461
- }, text(unsupportedFeature()), {
1462
- childCount: 1,
1463
- type: P
1464
- }, text(selectedFeatureUnknownOrUnsupported())];
1491
+ return [unsupportedFeatureNode, unsupportedFeatureHeadingNode, text(unsupportedFeature()), unsupportedFeatureMessageNode, text(selectedFeatureUnknownOrUnsupported())];
1465
1492
  };
1466
1493
 
1467
1494
  const features = Object.create(null);
@@ -2801,7 +2828,6 @@ const getAllPreferences = async () => {
2801
2828
  return invoke$1('Preferences.getAll');
2802
2829
  };
2803
2830
 
2804
- /* eslint-disable unicorn/prefer-export-from */
2805
2831
  const {
2806
2832
  getRuntimeStatus: getRuntimeStatus$1,
2807
2833
  set: set$4
@@ -2840,25 +2866,21 @@ const formatTime = time => {
2840
2866
  return time.toFixed(2) + 'ms';
2841
2867
  };
2842
2868
 
2869
+ const definitionTermNode = {
2870
+ childCount: 1,
2871
+ type: Dt
2872
+ };
2873
+ const definitionDescriptionNode = {
2874
+ childCount: 1,
2875
+ type: Dd
2876
+ };
2843
2877
  const getActivationTimeVirtualDom = (importTime$1, activationTime$1) => {
2844
2878
  if (!activationTime$1 && !importTime$1) {
2845
2879
  return [];
2846
2880
  }
2847
2881
  const formattedImportTime = formatTime(importTime$1);
2848
2882
  const formattedTime = formatTime(activationTime$1);
2849
- return [{
2850
- childCount: 1,
2851
- type: Dt
2852
- }, text(importTime()), {
2853
- childCount: 1,
2854
- type: Dd
2855
- }, text(formattedImportTime), {
2856
- childCount: 1,
2857
- type: Dt
2858
- }, text(activationTime()), {
2859
- childCount: 1,
2860
- type: Dd
2861
- }, text(formattedTime)];
2883
+ return [definitionTermNode, text(importTime()), definitionDescriptionNode, text(formattedImportTime), definitionTermNode, text(activationTime()), definitionDescriptionNode, text(formattedTime)];
2862
2884
  };
2863
2885
 
2864
2886
  const None$1 = 0;
@@ -2900,6 +2922,11 @@ const getStatusVirtualDom = status$1 => {
2900
2922
  return [key, text(`${statusKey}: `), value, text(`${statusValue}`)];
2901
2923
  };
2902
2924
 
2925
+ const featureContentNode$3 = {
2926
+ childCount: 2,
2927
+ className: FeatureContent,
2928
+ type: Div
2929
+ };
2903
2930
  const getChildCount$1 = (status, activationTime, importTime) => {
2904
2931
  let childCount = 0;
2905
2932
  childCount += 2; // status
@@ -2916,11 +2943,7 @@ const getRuntimeStatusVirtualDom = state => {
2916
2943
  } = state;
2917
2944
  const heading = runtimeStatus();
2918
2945
  const childCount = getChildCount$1(status, displayedActivationTime, displayedImportTime);
2919
- return [{
2920
- childCount: 2,
2921
- className: FeatureContent,
2922
- type: Div
2923
- }, ...getFeatureContentHeadingVirtualDom(heading), {
2946
+ return [featureContentNode$3, ...getFeatureContentHeadingVirtualDom(heading), {
2924
2947
  childCount,
2925
2948
  className: 'RuntimeStatusDefinitionList',
2926
2949
  type: Dl
@@ -2966,18 +2989,22 @@ const getSettingsTableEntries = rows => {
2966
2989
  };
2967
2990
  };
2968
2991
 
2992
+ const featureContentNode$2 = {
2993
+ childCount: 2,
2994
+ className: FeatureContent,
2995
+ type: Div
2996
+ };
2969
2997
  const getFeatureSettingsVirtualDom = rows => {
2970
2998
  const heading = settings();
2971
2999
  const tableInfo = getSettingsTableEntries(rows);
2972
- return [{
2973
- childCount: 2,
2974
- className: FeatureContent,
2975
- type: Div
2976
- }, ...getFeatureContentHeadingVirtualDom(heading), ...getTableVirtualDom(tableInfo)];
3000
+ return [featureContentNode$2, ...getFeatureContentHeadingVirtualDom(heading), ...getTableVirtualDom(tableInfo)];
2977
3001
  };
2978
3002
 
2979
3003
  const getSettingsVirtualDom = state => {
2980
- return getFeatureSettingsVirtualDom(state.settings);
3004
+ const {
3005
+ settings
3006
+ } = state;
3007
+ return getFeatureSettingsVirtualDom(settings);
2981
3008
  };
2982
3009
 
2983
3010
  const HandleClickCategory = 1;
@@ -3054,7 +3081,6 @@ const getScrollToTopVirtualDom = scrollToTopButtonEnabled => {
3054
3081
  }];
3055
3082
  };
3056
3083
 
3057
- /* eslint-disable unicorn/prefer-export-from */
3058
3084
  const {
3059
3085
  getVirtualDom,
3060
3086
  render,
@@ -3271,14 +3297,15 @@ const getVirtualDomChildCount = dom => {
3271
3297
  return stack.length;
3272
3298
  };
3273
3299
 
3300
+ const featureContentNode$1 = {
3301
+ childCount: 2,
3302
+ className: FeatureContent,
3303
+ type: Div
3304
+ };
3274
3305
  const getFeatureThemesVirtualDom = themesDom => {
3275
3306
  const childCount = getVirtualDomChildCount(themesDom);
3276
3307
  const heading = theme();
3277
- return [{
3278
- childCount: 2,
3279
- className: FeatureContent,
3280
- type: Div
3281
- }, ...getFeatureContentHeadingVirtualDom(heading), {
3308
+ return [featureContentNode$1, ...getFeatureContentHeadingVirtualDom(heading), {
3282
3309
  childCount,
3283
3310
  className: DefaultMarkdown,
3284
3311
  type: Div
@@ -3286,7 +3313,10 @@ const getFeatureThemesVirtualDom = themesDom => {
3286
3313
  };
3287
3314
 
3288
3315
  const getThemeVirtualDom = state => {
3289
- return getFeatureThemesVirtualDom(state.themesMarkdownDom);
3316
+ const {
3317
+ themesMarkdownDom
3318
+ } = state;
3319
+ return getFeatureThemesVirtualDom(themesMarkdownDom);
3290
3320
  };
3291
3321
 
3292
3322
  const toWebView = rawWebView => {
@@ -3338,6 +3368,11 @@ const item = {
3338
3368
  className: DefinitionListItem,
3339
3369
  type: Div
3340
3370
  };
3371
+ const featureWebViewNode = {
3372
+ childCount: 4,
3373
+ className: FeatureWebView,
3374
+ type: Div
3375
+ };
3341
3376
  const getWebViewVirtualDom = webView => {
3342
3377
  const {
3343
3378
  contentSecurityPolicyString,
@@ -3349,27 +3384,27 @@ const getWebViewVirtualDom = webView => {
3349
3384
  const textSelector = selector();
3350
3385
  const textContentSecurityPolicy = contentSecurityPolicy();
3351
3386
  const textElements = elements();
3352
- return [{
3353
- childCount: 4,
3354
- className: FeatureWebView,
3355
- type: Div
3356
- }, item, heading, text(textId), pre, text(id), item, heading, text(textSelector), pre, text(selectorString), item, heading, text(textContentSecurityPolicy), pre, text(contentSecurityPolicyString), item, heading, text(textElements), pre, text(elementsString)];
3387
+ return [featureWebViewNode, item, heading, text(textId), pre, text(id), item, heading, text(textSelector), pre, text(selectorString), item, heading, text(textContentSecurityPolicy), pre, text(contentSecurityPolicyString), item, heading, text(textElements), pre, text(elementsString)];
3357
3388
  };
3358
3389
 
3390
+ const featureContentNode = {
3391
+ childCount: 2,
3392
+ className: FeatureContent,
3393
+ type: Div
3394
+ };
3359
3395
  const getFeatureWebViewsVirtualDom = webViews$1 => {
3360
3396
  const heading = webViews();
3361
- return [{
3362
- childCount: 2,
3363
- className: FeatureContent,
3364
- type: Div
3365
- }, ...getFeatureContentHeadingVirtualDom(heading), {
3397
+ return [featureContentNode, ...getFeatureContentHeadingVirtualDom(heading), {
3366
3398
  childCount: webViews$1.length,
3367
3399
  type: Div
3368
3400
  }, ...webViews$1.flatMap(getWebViewVirtualDom)];
3369
3401
  };
3370
3402
 
3371
3403
  const getWebViewsVirtualDom = state => {
3372
- return getFeatureWebViewsVirtualDom(state.webViews);
3404
+ const {
3405
+ webViews
3406
+ } = state;
3407
+ return getFeatureWebViewsVirtualDom(webViews);
3373
3408
  };
3374
3409
 
3375
3410
  const registerAllFeatures = () => {
@@ -3684,7 +3719,6 @@ const writeText = async text => {
3684
3719
  await writeText$1(text);
3685
3720
  };
3686
3721
 
3687
- /* eslint-disable unicorn/prefer-export-from */
3688
3722
  const {
3689
3723
  exists,
3690
3724
  invoke,
@@ -5477,12 +5511,13 @@ const handleImageContextMenu = async (state, eventX, eventY) => {
5477
5511
  return state;
5478
5512
  };
5479
5513
 
5514
+ const markdownImageErrorNode = {
5515
+ childCount: 1,
5516
+ className: MarkdownImageError,
5517
+ type: Span
5518
+ };
5480
5519
  const getMarkdownImageErrorVirtualDom = () => {
5481
- return [{
5482
- childCount: 1,
5483
- className: MarkdownImageError,
5484
- type: Span
5485
- }, text(imageCannotBeLoaded())];
5520
+ return [markdownImageErrorNode, text(imageCannotBeLoaded())];
5486
5521
  };
5487
5522
 
5488
5523
  const isMatchingImageSrc = (nodeSrc, failedSrc) => {
@@ -6185,22 +6220,24 @@ const getChangelogVirtualDom = changelogDom => {
6185
6220
  // TODO set tabpanel role
6186
6221
  return [{
6187
6222
  childCount: 1,
6188
- className: `${ExtensionDetailPanel} ${Changelog$1}`,
6223
+ className: mergeClassNames(ExtensionDetailPanel, Changelog$1),
6189
6224
  role: Panel,
6190
6225
  type: Div
6191
6226
  }, ...changelogDom];
6192
6227
  };
6193
6228
 
6229
+ const additionalDetailsEntryNode = {
6230
+ childCount: 2,
6231
+ className: AdditionalDetailsEntry,
6232
+ type: Div
6233
+ };
6234
+ const additionalDetailsTitleNode = {
6235
+ childCount: 1,
6236
+ className: AdditionalDetailsTitle,
6237
+ type: Div
6238
+ };
6194
6239
  const getAdditionalDetailsEntryVirtualDom = (heading, items, renderer) => {
6195
- return [{
6196
- childCount: 2,
6197
- className: AdditionalDetailsEntry,
6198
- type: Div
6199
- }, {
6200
- childCount: 1,
6201
- className: AdditionalDetailsTitle,
6202
- type: Div
6203
- }, text(heading), ...renderer(items)];
6240
+ return [additionalDetailsEntryNode, additionalDetailsTitleNode, text(heading), ...renderer(items)];
6204
6241
  };
6205
6242
 
6206
6243
  const getCategoryVirtualDom = category => {
@@ -6315,15 +6352,16 @@ const getMoreInfoVirtualDom = items => {
6315
6352
  }, ...items.flatMap(getMoreInfoEntryVirtualDom)];
6316
6353
  };
6317
6354
 
6355
+ const resourceIconNode = {
6356
+ childCount: 1,
6357
+ className: ResourceIcon,
6358
+ type: Div
6359
+ };
6318
6360
  const getIconDom = icon => {
6319
6361
  if (!icon) {
6320
6362
  return [];
6321
6363
  }
6322
- return [{
6323
- childCount: 1,
6324
- className: ResourceIcon,
6325
- type: Div
6326
- }, {
6364
+ return [resourceIconNode, {
6327
6365
  childCount: 0,
6328
6366
  className: mergeClassNames(MaskIcon, `MaskIcon${icon}`),
6329
6367
  type: Div
@@ -6373,31 +6411,35 @@ const getResourcesVirtualDom = resources => {
6373
6411
  }, ...resources.flatMap(getResourceVirtualDom)];
6374
6412
  };
6375
6413
 
6414
+ const Focusable = 0;
6415
+
6416
+ const asideNode = {
6417
+ childCount: 1,
6418
+ className: Aside,
6419
+ type: Aside$1
6420
+ };
6376
6421
  const getAdditionalDetailsVirtualDom = (showAdditionalDetails, firstHeading, entries, secondHeading, secondEntries, thirdHeading, categories, fourthHeading, resources) => {
6377
6422
  if (!showAdditionalDetails) {
6378
6423
  return [];
6379
6424
  }
6380
6425
  const sections = [...getAdditionalDetailsEntryVirtualDom(firstHeading, entries, getMoreInfoVirtualDom), ...(secondEntries.length > 0 ? getAdditionalDetailsEntryVirtualDom(secondHeading, secondEntries, getMoreInfoVirtualDom) : []), ...(categories.length > 0 ? getAdditionalDetailsEntryVirtualDom(thirdHeading, categories, getCategoriesDom) : []), ...getAdditionalDetailsEntryVirtualDom(fourthHeading, resources, getResourcesVirtualDom)];
6381
6426
  const childCount = 1 + (secondEntries.length > 0 ? 1 : 0) + (categories.length > 0 ? 1 : 0) + 1;
6382
- return [{
6383
- childCount: 1,
6384
- className: Aside,
6385
- type: Aside$1
6386
- }, {
6427
+ return [asideNode, {
6387
6428
  childCount: childCount,
6388
6429
  className: AdditionalDetails,
6389
6430
  onContextMenu: HandleAdditionalDetailContextMenu,
6390
- tabIndex: 0,
6431
+ tabIndex: Focusable,
6391
6432
  type: Div
6392
6433
  }, ...sections];
6393
6434
  };
6394
6435
 
6436
+ const noReadmeNode = {
6437
+ childCount: 1,
6438
+ className: Markdown,
6439
+ type: Div
6440
+ };
6395
6441
  const getNoReadmeVirtualDom = () => {
6396
- return [{
6397
- childCount: 1,
6398
- className: Markdown,
6399
- type: Div
6400
- }, text(noReadmeFound())];
6442
+ return [noReadmeNode, text(noReadmeFound())];
6401
6443
  };
6402
6444
 
6403
6445
  const getChildCount = (additionalDetails, scrollToTopEnabled) => {
@@ -6445,18 +6487,20 @@ const getFeatureListVirtualDom = features => {
6445
6487
  childCount: features.length,
6446
6488
  className: FeaturesList,
6447
6489
  onClick: HandleFeaturesClick,
6490
+ role: None$3,
6448
6491
  // TODO use either list or tabs role
6449
6492
  type: Div
6450
6493
  }, ...features.flatMap(getFeatureListItemVirtualDom)];
6451
6494
  };
6452
6495
 
6496
+ const featuresNode$1 = {
6497
+ childCount: 1,
6498
+ className: Features$1,
6499
+ type: Div
6500
+ };
6453
6501
  const getFeaturesEmptyVirtualDom = () => {
6454
6502
  const none$1 = none();
6455
- return [{
6456
- childCount: 1,
6457
- className: Features$1,
6458
- type: Div
6459
- }, text(none$1)];
6503
+ return [featuresNode$1, text(none$1)];
6460
6504
  };
6461
6505
 
6462
6506
  const sash = {
@@ -6464,63 +6508,76 @@ const sash = {
6464
6508
  className: mergeClassNames(Sash, SashVertical),
6465
6509
  type: Div
6466
6510
  };
6511
+ const featuresNode = {
6512
+ childCount: 3,
6513
+ className: Features$1,
6514
+ type: Div
6515
+ };
6467
6516
  const getFeaturesVirtualDom = (features, selectedFeature, state) => {
6468
6517
  if (features.length === 0) {
6469
6518
  return getFeaturesEmptyVirtualDom();
6470
6519
  }
6471
6520
  const fn = getFeatureVirtualDomHandler(selectedFeature);
6472
6521
  const featureVirtualDom = fn(state);
6473
- return [{
6474
- childCount: 3,
6475
- className: Features$1,
6476
- type: Div
6477
- }, ...getFeatureListVirtualDom(features), sash, ...featureVirtualDom];
6522
+ return [featuresNode, ...getFeatureListVirtualDom(features), sash, ...featureVirtualDom];
6478
6523
  };
6479
6524
 
6480
6525
  const getExtensionDetailContentVirtualDom = (sanitizedReadmeHtml, selectedTab, width, scrollToTopButtonEnabled, categories, resources, breakpoint, changelogDom, state) => {
6526
+ const {
6527
+ features,
6528
+ hasReadme,
6529
+ installationEntries,
6530
+ marketplaceEntries,
6531
+ selectedFeature,
6532
+ showSideBar
6533
+ } = state;
6481
6534
  switch (selectedTab) {
6482
6535
  case Changelog:
6483
6536
  return getChangelogVirtualDom(changelogDom);
6484
6537
  case Details:
6485
- return getDetailsVirtualDom(sanitizedReadmeHtml, width, scrollToTopButtonEnabled, categories, resources, breakpoint, state.installationEntries, state.marketplaceEntries, state.hasReadme, state.showSideBar);
6538
+ return getDetailsVirtualDom(sanitizedReadmeHtml, width, scrollToTopButtonEnabled, categories, resources, breakpoint, installationEntries, marketplaceEntries, hasReadme, showSideBar);
6486
6539
  case Features:
6487
- return getFeaturesVirtualDom(state.features, state.selectedFeature, state);
6540
+ return getFeaturesVirtualDom(features, selectedFeature, state);
6488
6541
  default:
6489
6542
  return [];
6490
6543
  }
6491
6544
  };
6492
6545
 
6546
+ const extensionDetailErrorCardNode = {
6547
+ childCount: 3,
6548
+ className: ExtensionDetailErrorCard,
6549
+ role: Alert,
6550
+ type: Div
6551
+ };
6552
+ const extensionDetailErrorTitleNode = {
6553
+ childCount: 1,
6554
+ className: ExtensionDetailErrorTitle,
6555
+ type: H1
6556
+ };
6557
+ const extensionDetailErrorMessageNode = {
6558
+ childCount: 1,
6559
+ className: ExtensionDetailErrorMessage,
6560
+ type: P
6561
+ };
6493
6562
  const getExtensionDetailErrorVirtualDom = (title, message) => {
6494
6563
  return [{
6495
6564
  childCount: 1,
6496
6565
  className: mergeClassNames(Viewlet, ExtensionDetail, ExtensionDetailError),
6497
6566
  type: Div
6498
- }, {
6499
- childCount: 3,
6500
- className: ExtensionDetailErrorCard,
6501
- role: 'alert',
6502
- type: Div
6503
- }, {
6567
+ }, extensionDetailErrorCardNode, {
6504
6568
  childCount: 0,
6505
6569
  className: mergeClassNames(MaskIcon, MaskIconWarning, ExtensionDetailErrorIcon),
6506
6570
  type: Div
6507
- }, {
6508
- childCount: 1,
6509
- className: ExtensionDetailErrorTitle,
6510
- type: H1
6511
- }, text(title), {
6512
- childCount: 1,
6513
- className: ExtensionDetailErrorMessage,
6514
- type: P
6515
- }, text(message)];
6571
+ }, extensionDetailErrorTitleNode, text(title), extensionDetailErrorMessageNode, text(message)];
6516
6572
  };
6517
6573
 
6574
+ const extensionDetailDescriptionNode = {
6575
+ childCount: 1,
6576
+ className: ExtensionDetailDescription,
6577
+ type: Div
6578
+ };
6518
6579
  const getExtensionDetailDescriptionVirtualDom = description => {
6519
- return [{
6520
- childCount: 1,
6521
- className: ExtensionDetailDescription,
6522
- type: Div
6523
- }, text(description)];
6580
+ return [extensionDetailDescriptionNode, text(description)];
6524
6581
  };
6525
6582
 
6526
6583
  const className = mergeClassNames(Button, ButtonPrimary);
@@ -6541,23 +6598,25 @@ const getButtonVirtualDom = (message, onClick, name, onMouseEnter, onMouseLeave)
6541
6598
  return [button, text(message)];
6542
6599
  };
6543
6600
 
6601
+ const settingsButtonNode = {
6602
+ childCount: 1,
6603
+ className: SettingsButton,
6604
+ name: Settings,
6605
+ onClick: HandleClickSettings,
6606
+ title: 'Settings',
6607
+ type: Button$1
6608
+ };
6609
+ const settingsIconNode = {
6610
+ childCount: 0,
6611
+ className: SettingsIcon,
6612
+ text: '⚙️',
6613
+ type: Span
6614
+ };
6544
6615
  const getSettingsButtonVirtualDom = enabled => {
6545
6616
  if (!enabled) {
6546
6617
  return [];
6547
6618
  }
6548
- return [{
6549
- childCount: 1,
6550
- className: SettingsButton,
6551
- name: Settings,
6552
- onClick: HandleClickSettings,
6553
- title: 'Settings',
6554
- type: Button$1
6555
- }, {
6556
- childCount: 0,
6557
- className: SettingsIcon,
6558
- text: '⚙️',
6559
- type: Span
6560
- }];
6619
+ return [settingsButtonNode, settingsIconNode];
6561
6620
  };
6562
6621
 
6563
6622
  const getExtensionDetailHeaderActionsVirtualDom = (buttonDefs, settingsButtonEnabled) => {
@@ -6609,33 +6668,37 @@ const getExtensionDetailMetadataVirtualDom = (downloadCount$1, rating$1) => {
6609
6668
  }, ...downloadCountDom, ...ratingDom];
6610
6669
  };
6611
6670
 
6671
+ const nameBadgeNode = {
6672
+ childCount: 1,
6673
+ className: ExtensionDetailNameBadge,
6674
+ type: Span
6675
+ };
6612
6676
  const getNameBadgeVirtualDom = badge => {
6613
6677
  if (!badge) {
6614
6678
  return [];
6615
6679
  }
6616
- return [{
6617
- childCount: 1,
6618
- className: ExtensionDetailNameBadge,
6619
- type: Span
6620
- }, text(badge)];
6680
+ return [nameBadgeNode, text(badge)];
6621
6681
  };
6622
6682
 
6683
+ const extensionDetailNameWithBadgeNode = {
6684
+ childCount: 2,
6685
+ className: ExtensionDetailName,
6686
+ type: Div
6687
+ };
6688
+ const extensionDetailNameTextNode = {
6689
+ childCount: 1,
6690
+ type: Span
6691
+ };
6692
+ const extensionDetailNameNode = {
6693
+ childCount: 1,
6694
+ className: ExtensionDetailName,
6695
+ type: Div
6696
+ };
6623
6697
  const getExtensionDetailNameWithBadgeVirtualDom = (name, badge) => {
6624
- return [{
6625
- childCount: 2,
6626
- className: ExtensionDetailName,
6627
- type: Div
6628
- }, {
6629
- childCount: 1,
6630
- type: Span
6631
- }, text(name), ...getNameBadgeVirtualDom(badge)];
6698
+ return [extensionDetailNameWithBadgeNode, extensionDetailNameTextNode, text(name), ...getNameBadgeVirtualDom(badge)];
6632
6699
  };
6633
6700
  const getExtensionDetailNameDefaultVirtualDom = name => {
6634
- return [{
6635
- childCount: 1,
6636
- className: ExtensionDetailName,
6637
- type: Div
6638
- }, text(name)];
6701
+ return [extensionDetailNameNode, text(name)];
6639
6702
  };
6640
6703
  const getExtensionDetailNameVirtualDom = (name, badge) => {
6641
6704
  if (badge) {
@@ -6644,13 +6707,14 @@ const getExtensionDetailNameVirtualDom = (name, badge) => {
6644
6707
  return getExtensionDetailNameDefaultVirtualDom(name);
6645
6708
  };
6646
6709
 
6710
+ const extensionDetailHeaderNode = {
6711
+ childCount: 2,
6712
+ className: ExtensionDetailHeader,
6713
+ type: Div
6714
+ };
6647
6715
  const getExtensionDetailHeaderVirtualDom = (name, iconSrc, description, badge, buttonDefs, settingsButtonEnabled, downloadCount = 'n/a', rating = 'n/a') => {
6648
6716
  const metadataDom = getExtensionDetailMetadataVirtualDom(downloadCount, rating);
6649
- const dom = [{
6650
- childCount: 2,
6651
- className: ExtensionDetailHeader,
6652
- type: Div
6653
- }, getExtensionDetailIconVirtualDom(iconSrc), {
6717
+ const dom = [extensionDetailHeaderNode, getExtensionDetailIconVirtualDom(iconSrc), {
6654
6718
  childCount: metadataDom.length > 0 ? 4 : 3,
6655
6719
  className: ExtensionDetailHeaderDetails,
6656
6720
  onContextMenu: HandleHeaderContextMenu,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-detail-view",
3
- "version": "7.14.2",
3
+ "version": "7.15.0",
4
4
  "description": "Extension Detail View Worker",
5
5
  "repository": {
6
6
  "type": "git",