@lvce-editor/extension-detail-view 7.14.1 → 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,
@@ -4196,7 +4230,10 @@ const getExtension$1 = async (id, platform) => {
4196
4230
  const getExtensionNew = async id => {
4197
4231
  try {
4198
4232
  const rpc = get$2(ExtensionManagementWorker);
4199
- return await rpc.invoke('Extensions.getExtension', id);
4233
+ const extension = await rpc.invoke('Extensions.getExtension', id);
4234
+ if (extension) {
4235
+ return extension;
4236
+ }
4200
4237
  } catch {
4201
4238
  // ignore
4202
4239
  }
@@ -5474,12 +5511,13 @@ const handleImageContextMenu = async (state, eventX, eventY) => {
5474
5511
  return state;
5475
5512
  };
5476
5513
 
5514
+ const markdownImageErrorNode = {
5515
+ childCount: 1,
5516
+ className: MarkdownImageError,
5517
+ type: Span
5518
+ };
5477
5519
  const getMarkdownImageErrorVirtualDom = () => {
5478
- return [{
5479
- childCount: 1,
5480
- className: MarkdownImageError,
5481
- type: Span
5482
- }, text(imageCannotBeLoaded())];
5520
+ return [markdownImageErrorNode, text(imageCannotBeLoaded())];
5483
5521
  };
5484
5522
 
5485
5523
  const isMatchingImageSrc = (nodeSrc, failedSrc) => {
@@ -6182,22 +6220,24 @@ const getChangelogVirtualDom = changelogDom => {
6182
6220
  // TODO set tabpanel role
6183
6221
  return [{
6184
6222
  childCount: 1,
6185
- className: `${ExtensionDetailPanel} ${Changelog$1}`,
6223
+ className: mergeClassNames(ExtensionDetailPanel, Changelog$1),
6186
6224
  role: Panel,
6187
6225
  type: Div
6188
6226
  }, ...changelogDom];
6189
6227
  };
6190
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
+ };
6191
6239
  const getAdditionalDetailsEntryVirtualDom = (heading, items, renderer) => {
6192
- return [{
6193
- childCount: 2,
6194
- className: AdditionalDetailsEntry,
6195
- type: Div
6196
- }, {
6197
- childCount: 1,
6198
- className: AdditionalDetailsTitle,
6199
- type: Div
6200
- }, text(heading), ...renderer(items)];
6240
+ return [additionalDetailsEntryNode, additionalDetailsTitleNode, text(heading), ...renderer(items)];
6201
6241
  };
6202
6242
 
6203
6243
  const getCategoryVirtualDom = category => {
@@ -6312,15 +6352,16 @@ const getMoreInfoVirtualDom = items => {
6312
6352
  }, ...items.flatMap(getMoreInfoEntryVirtualDom)];
6313
6353
  };
6314
6354
 
6355
+ const resourceIconNode = {
6356
+ childCount: 1,
6357
+ className: ResourceIcon,
6358
+ type: Div
6359
+ };
6315
6360
  const getIconDom = icon => {
6316
6361
  if (!icon) {
6317
6362
  return [];
6318
6363
  }
6319
- return [{
6320
- childCount: 1,
6321
- className: ResourceIcon,
6322
- type: Div
6323
- }, {
6364
+ return [resourceIconNode, {
6324
6365
  childCount: 0,
6325
6366
  className: mergeClassNames(MaskIcon, `MaskIcon${icon}`),
6326
6367
  type: Div
@@ -6370,31 +6411,35 @@ const getResourcesVirtualDom = resources => {
6370
6411
  }, ...resources.flatMap(getResourceVirtualDom)];
6371
6412
  };
6372
6413
 
6414
+ const Focusable = 0;
6415
+
6416
+ const asideNode = {
6417
+ childCount: 1,
6418
+ className: Aside,
6419
+ type: Aside$1
6420
+ };
6373
6421
  const getAdditionalDetailsVirtualDom = (showAdditionalDetails, firstHeading, entries, secondHeading, secondEntries, thirdHeading, categories, fourthHeading, resources) => {
6374
6422
  if (!showAdditionalDetails) {
6375
6423
  return [];
6376
6424
  }
6377
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)];
6378
6426
  const childCount = 1 + (secondEntries.length > 0 ? 1 : 0) + (categories.length > 0 ? 1 : 0) + 1;
6379
- return [{
6380
- childCount: 1,
6381
- className: Aside,
6382
- type: Aside$1
6383
- }, {
6427
+ return [asideNode, {
6384
6428
  childCount: childCount,
6385
6429
  className: AdditionalDetails,
6386
6430
  onContextMenu: HandleAdditionalDetailContextMenu,
6387
- tabIndex: 0,
6431
+ tabIndex: Focusable,
6388
6432
  type: Div
6389
6433
  }, ...sections];
6390
6434
  };
6391
6435
 
6436
+ const noReadmeNode = {
6437
+ childCount: 1,
6438
+ className: Markdown,
6439
+ type: Div
6440
+ };
6392
6441
  const getNoReadmeVirtualDom = () => {
6393
- return [{
6394
- childCount: 1,
6395
- className: Markdown,
6396
- type: Div
6397
- }, text(noReadmeFound())];
6442
+ return [noReadmeNode, text(noReadmeFound())];
6398
6443
  };
6399
6444
 
6400
6445
  const getChildCount = (additionalDetails, scrollToTopEnabled) => {
@@ -6442,18 +6487,20 @@ const getFeatureListVirtualDom = features => {
6442
6487
  childCount: features.length,
6443
6488
  className: FeaturesList,
6444
6489
  onClick: HandleFeaturesClick,
6490
+ role: None$3,
6445
6491
  // TODO use either list or tabs role
6446
6492
  type: Div
6447
6493
  }, ...features.flatMap(getFeatureListItemVirtualDom)];
6448
6494
  };
6449
6495
 
6496
+ const featuresNode$1 = {
6497
+ childCount: 1,
6498
+ className: Features$1,
6499
+ type: Div
6500
+ };
6450
6501
  const getFeaturesEmptyVirtualDom = () => {
6451
6502
  const none$1 = none();
6452
- return [{
6453
- childCount: 1,
6454
- className: Features$1,
6455
- type: Div
6456
- }, text(none$1)];
6503
+ return [featuresNode$1, text(none$1)];
6457
6504
  };
6458
6505
 
6459
6506
  const sash = {
@@ -6461,63 +6508,76 @@ const sash = {
6461
6508
  className: mergeClassNames(Sash, SashVertical),
6462
6509
  type: Div
6463
6510
  };
6511
+ const featuresNode = {
6512
+ childCount: 3,
6513
+ className: Features$1,
6514
+ type: Div
6515
+ };
6464
6516
  const getFeaturesVirtualDom = (features, selectedFeature, state) => {
6465
6517
  if (features.length === 0) {
6466
6518
  return getFeaturesEmptyVirtualDom();
6467
6519
  }
6468
6520
  const fn = getFeatureVirtualDomHandler(selectedFeature);
6469
6521
  const featureVirtualDom = fn(state);
6470
- return [{
6471
- childCount: 3,
6472
- className: Features$1,
6473
- type: Div
6474
- }, ...getFeatureListVirtualDom(features), sash, ...featureVirtualDom];
6522
+ return [featuresNode, ...getFeatureListVirtualDom(features), sash, ...featureVirtualDom];
6475
6523
  };
6476
6524
 
6477
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;
6478
6534
  switch (selectedTab) {
6479
6535
  case Changelog:
6480
6536
  return getChangelogVirtualDom(changelogDom);
6481
6537
  case Details:
6482
- 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);
6483
6539
  case Features:
6484
- return getFeaturesVirtualDom(state.features, state.selectedFeature, state);
6540
+ return getFeaturesVirtualDom(features, selectedFeature, state);
6485
6541
  default:
6486
6542
  return [];
6487
6543
  }
6488
6544
  };
6489
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
+ };
6490
6562
  const getExtensionDetailErrorVirtualDom = (title, message) => {
6491
6563
  return [{
6492
6564
  childCount: 1,
6493
6565
  className: mergeClassNames(Viewlet, ExtensionDetail, ExtensionDetailError),
6494
6566
  type: Div
6495
- }, {
6496
- childCount: 3,
6497
- className: ExtensionDetailErrorCard,
6498
- role: 'alert',
6499
- type: Div
6500
- }, {
6567
+ }, extensionDetailErrorCardNode, {
6501
6568
  childCount: 0,
6502
6569
  className: mergeClassNames(MaskIcon, MaskIconWarning, ExtensionDetailErrorIcon),
6503
6570
  type: Div
6504
- }, {
6505
- childCount: 1,
6506
- className: ExtensionDetailErrorTitle,
6507
- type: H1
6508
- }, text(title), {
6509
- childCount: 1,
6510
- className: ExtensionDetailErrorMessage,
6511
- type: P
6512
- }, text(message)];
6571
+ }, extensionDetailErrorTitleNode, text(title), extensionDetailErrorMessageNode, text(message)];
6513
6572
  };
6514
6573
 
6574
+ const extensionDetailDescriptionNode = {
6575
+ childCount: 1,
6576
+ className: ExtensionDetailDescription,
6577
+ type: Div
6578
+ };
6515
6579
  const getExtensionDetailDescriptionVirtualDom = description => {
6516
- return [{
6517
- childCount: 1,
6518
- className: ExtensionDetailDescription,
6519
- type: Div
6520
- }, text(description)];
6580
+ return [extensionDetailDescriptionNode, text(description)];
6521
6581
  };
6522
6582
 
6523
6583
  const className = mergeClassNames(Button, ButtonPrimary);
@@ -6538,23 +6598,25 @@ const getButtonVirtualDom = (message, onClick, name, onMouseEnter, onMouseLeave)
6538
6598
  return [button, text(message)];
6539
6599
  };
6540
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
+ };
6541
6615
  const getSettingsButtonVirtualDom = enabled => {
6542
6616
  if (!enabled) {
6543
6617
  return [];
6544
6618
  }
6545
- return [{
6546
- childCount: 1,
6547
- className: SettingsButton,
6548
- name: Settings,
6549
- onClick: HandleClickSettings,
6550
- title: 'Settings',
6551
- type: Button$1
6552
- }, {
6553
- childCount: 0,
6554
- className: SettingsIcon,
6555
- text: '⚙️',
6556
- type: Span
6557
- }];
6619
+ return [settingsButtonNode, settingsIconNode];
6558
6620
  };
6559
6621
 
6560
6622
  const getExtensionDetailHeaderActionsVirtualDom = (buttonDefs, settingsButtonEnabled) => {
@@ -6606,33 +6668,37 @@ const getExtensionDetailMetadataVirtualDom = (downloadCount$1, rating$1) => {
6606
6668
  }, ...downloadCountDom, ...ratingDom];
6607
6669
  };
6608
6670
 
6671
+ const nameBadgeNode = {
6672
+ childCount: 1,
6673
+ className: ExtensionDetailNameBadge,
6674
+ type: Span
6675
+ };
6609
6676
  const getNameBadgeVirtualDom = badge => {
6610
6677
  if (!badge) {
6611
6678
  return [];
6612
6679
  }
6613
- return [{
6614
- childCount: 1,
6615
- className: ExtensionDetailNameBadge,
6616
- type: Span
6617
- }, text(badge)];
6680
+ return [nameBadgeNode, text(badge)];
6618
6681
  };
6619
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
+ };
6620
6697
  const getExtensionDetailNameWithBadgeVirtualDom = (name, badge) => {
6621
- return [{
6622
- childCount: 2,
6623
- className: ExtensionDetailName,
6624
- type: Div
6625
- }, {
6626
- childCount: 1,
6627
- type: Span
6628
- }, text(name), ...getNameBadgeVirtualDom(badge)];
6698
+ return [extensionDetailNameWithBadgeNode, extensionDetailNameTextNode, text(name), ...getNameBadgeVirtualDom(badge)];
6629
6699
  };
6630
6700
  const getExtensionDetailNameDefaultVirtualDom = name => {
6631
- return [{
6632
- childCount: 1,
6633
- className: ExtensionDetailName,
6634
- type: Div
6635
- }, text(name)];
6701
+ return [extensionDetailNameNode, text(name)];
6636
6702
  };
6637
6703
  const getExtensionDetailNameVirtualDom = (name, badge) => {
6638
6704
  if (badge) {
@@ -6641,13 +6707,14 @@ const getExtensionDetailNameVirtualDom = (name, badge) => {
6641
6707
  return getExtensionDetailNameDefaultVirtualDom(name);
6642
6708
  };
6643
6709
 
6710
+ const extensionDetailHeaderNode = {
6711
+ childCount: 2,
6712
+ className: ExtensionDetailHeader,
6713
+ type: Div
6714
+ };
6644
6715
  const getExtensionDetailHeaderVirtualDom = (name, iconSrc, description, badge, buttonDefs, settingsButtonEnabled, downloadCount = 'n/a', rating = 'n/a') => {
6645
6716
  const metadataDom = getExtensionDetailMetadataVirtualDom(downloadCount, rating);
6646
- const dom = [{
6647
- childCount: 2,
6648
- className: ExtensionDetailHeader,
6649
- type: Div
6650
- }, getExtensionDetailIconVirtualDom(iconSrc), {
6717
+ const dom = [extensionDetailHeaderNode, getExtensionDetailIconVirtualDom(iconSrc), {
6651
6718
  childCount: metadataDom.length > 0 ? 4 : 3,
6652
6719
  className: ExtensionDetailHeaderDetails,
6653
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.1",
3
+ "version": "7.15.0",
4
4
  "description": "Extension Detail View Worker",
5
5
  "repository": {
6
6
  "type": "git",