@lvce-editor/extension-detail-view 5.7.0 → 5.9.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.
@@ -247,22 +247,22 @@ const invalidLink = () => {
247
247
  const getActivationEntry = value => {
248
248
  if (typeof value !== 'string') {
249
249
  return {
250
+ errorMessage: propertyMustBeOfTypeString(),
250
251
  isValid: false,
251
- stringValue: JSON.stringify(value),
252
- errorMessage: propertyMustBeOfTypeString()
252
+ stringValue: JSON.stringify(value)
253
253
  };
254
254
  }
255
255
  if (!value) {
256
256
  return {
257
+ errorMessage: stringMustNotBeEmpty(),
257
258
  isValid: false,
258
- stringValue: '',
259
- errorMessage: stringMustNotBeEmpty()
259
+ stringValue: ''
260
260
  };
261
261
  }
262
262
  return {
263
+ errorMessage: '',
263
264
  isValid: true,
264
- stringValue: value,
265
- errorMessage: ''
265
+ stringValue: value
266
266
  };
267
267
  };
268
268
  const getActivationEntries = activation => {
@@ -273,8 +273,8 @@ const getActivationEventsDetails = async extension => {
273
273
  const activationEvents = extension.activation || [];
274
274
  const activationEntries = getActivationEntries(activationEvents);
275
275
  return {
276
- activationEvents,
277
- activationEntries
276
+ activationEntries,
277
+ activationEvents
278
278
  };
279
279
  };
280
280
 
@@ -410,25 +410,25 @@ const TableHeading = 'TableHeading';
410
410
  const Viewlet = 'Viewlet';
411
411
 
412
412
  const li = {
413
- type: Li,
414
- childCount: 1
413
+ childCount: 1,
414
+ type: Li
415
415
  };
416
416
  const code = {
417
- type: Code$2,
418
- childCount: 1
417
+ childCount: 1,
418
+ type: Code$2
419
419
  };
420
420
  const getActivationEventVirtualDom = event => {
421
421
  const {
422
- stringValue,
423
422
  errorMessage,
424
- isValid
423
+ isValid,
424
+ stringValue
425
425
  } = event;
426
426
  if (!isValid) {
427
427
  return [{
428
- type: Li,
429
428
  childCount: 1,
429
+ className: 'ListItem ListItemInvalid',
430
430
  title: errorMessage,
431
- className: 'ListItem ListItemInvalid'
431
+ type: Li
432
432
  }, code, text(stringValue)];
433
433
  }
434
434
  return [li, code, text(stringValue)];
@@ -436,20 +436,20 @@ const getActivationEventVirtualDom = event => {
436
436
 
437
437
  const getFeatureContentHeadingVirtualDom = heading => {
438
438
  return [{
439
- type: H1,
440
- childCount: 1
439
+ childCount: 1,
440
+ type: H1
441
441
  }, text(heading)];
442
442
  };
443
443
 
444
444
  const getFeatureActivationEventsVirtualDom = activationEvents$1 => {
445
445
  const heading = activationEvents();
446
446
  return [{
447
- type: Div,
447
+ childCount: 2,
448
448
  className: FeatureContent,
449
- childCount: 2
449
+ type: Div
450
450
  }, ...getFeatureContentHeadingVirtualDom(heading), {
451
- type: Ul,
452
- childCount: activationEvents$1.length
451
+ childCount: activationEvents$1.length,
452
+ type: Ul
453
453
  }, ...activationEvents$1.flatMap(getActivationEventVirtualDom)];
454
454
  };
455
455
 
@@ -506,20 +506,20 @@ const getFeatureCommandsEmptyVirtualDom = () => {
506
506
  const heading = commands$1();
507
507
  const emptyCommandsArray$1 = emptyCommandsArray();
508
508
  return [{
509
- type: Div,
509
+ childCount: 2,
510
510
  className: FeatureContent,
511
- childCount: 2
511
+ type: Div
512
512
  }, ...getFeatureContentHeadingVirtualDom(heading), {
513
- type: P,
514
- childCount: 1
513
+ childCount: 1,
514
+ type: P
515
515
  }, text(emptyCommandsArray$1)];
516
516
  };
517
517
 
518
518
  const getTableHeadingVirtualDom = heading => {
519
519
  return [{
520
- type: Th,
520
+ childCount: 1,
521
521
  className: TableHeading,
522
- childCount: 1
522
+ type: Th
523
523
  }, text(heading)];
524
524
  };
525
525
 
@@ -535,16 +535,16 @@ const getCellCheckMarkVirtualDom = (value, props) => {
535
535
  } = props;
536
536
  const checkedText = getCheckedText(checked);
537
537
  return [{
538
- type: Td,
538
+ childCount: 1,
539
539
  className: TableCell,
540
- childCount: 1
540
+ type: Td
541
541
  }, text(checkedText)];
542
542
  };
543
543
 
544
544
  const getListItemDom = item => {
545
545
  return [{
546
- type: Code$2,
547
- childCount: 1
546
+ childCount: 1,
547
+ type: Code$2
548
548
  }, text(item)];
549
549
  };
550
550
  const getCellCodeListVirtualDom = (value, props) => {
@@ -552,24 +552,24 @@ const getCellCodeListVirtualDom = (value, props) => {
552
552
  listItems
553
553
  } = props;
554
554
  return [{
555
- type: Td,
555
+ childCount: listItems.length,
556
556
  className: TableCell,
557
- childCount: listItems.length
557
+ type: Td
558
558
  }, ...listItems.flatMap(getListItemDom)];
559
559
  };
560
560
 
561
561
  const getCellCodeVirtualDom = (value, props) => {
562
562
  const tdClassName = props?.className ? `${TableCell} ${props.className}` : TableCell;
563
563
  return [{
564
- type: Td,
565
- className: tdClassName,
566
564
  childCount: 1,
565
+ className: tdClassName,
566
+ type: Td,
567
567
  ...(props?.title ? {
568
568
  title: props.title
569
569
  } : {})
570
570
  }, {
571
- type: Code$2,
572
- childCount: 1
571
+ childCount: 1,
572
+ type: Code$2
573
573
  }, text(value)];
574
574
  };
575
575
 
@@ -584,24 +584,24 @@ const getTitleProps = title => {
584
584
  const getCellLinkVirtualDom = (value, props) => {
585
585
  const tdClassName = props?.className ? `${TableCell} ${props.className}` : TableCell;
586
586
  return [{
587
- type: Td,
588
- className: tdClassName,
589
587
  childCount: 1,
588
+ className: tdClassName,
589
+ type: Td,
590
590
  ...getTitleProps(props?.title)
591
591
  }, {
592
- type: A,
592
+ childCount: 1,
593
593
  className: Link$1,
594
594
  href: props?.href,
595
- childCount: 1
595
+ type: A
596
596
  }, text(value)];
597
597
  };
598
598
 
599
599
  const getCellTextVirtualDom = (value, props) => {
600
600
  const tdClassName = props?.className ? `${TableCell} ${props.className}` : TableCell;
601
601
  return [{
602
- type: Td,
603
- className: tdClassName,
604
602
  childCount: 1,
603
+ className: tdClassName,
604
+ type: Td,
605
605
  ...(props?.title ? {
606
606
  title: props.title
607
607
  } : {})
@@ -610,16 +610,16 @@ const getCellTextVirtualDom = (value, props) => {
610
610
 
611
611
  const getCellRenderer = type => {
612
612
  switch (type) {
613
+ case CheckMark:
614
+ return getCellCheckMarkVirtualDom;
613
615
  case Code:
614
616
  return getCellCodeVirtualDom;
615
- case Text:
616
- return getCellTextVirtualDom;
617
- case Link:
618
- return getCellLinkVirtualDom;
619
617
  case CodeList:
620
618
  return getCellCodeListVirtualDom;
621
- case CheckMark:
622
- return getCellCheckMarkVirtualDom;
619
+ case Link:
620
+ return getCellLinkVirtualDom;
621
+ case Text:
622
+ return getCellTextVirtualDom;
623
623
  default:
624
624
  throw new Error(`unexpected cell type ${type}`);
625
625
  }
@@ -627,8 +627,8 @@ const getCellRenderer = type => {
627
627
 
628
628
  const getCellVirtualDom = entry => {
629
629
  const {
630
- value,
631
630
  type,
631
+ value,
632
632
  ...props
633
633
  } = entry;
634
634
  const fn = getCellRenderer(type);
@@ -637,8 +637,8 @@ const getCellVirtualDom = entry => {
637
637
 
638
638
  const getTableRowVirtualDom = entries => {
639
639
  return [{
640
- type: Tr,
641
- childCount: entries.length
640
+ childCount: entries.length,
641
+ type: Tr
642
642
  }, ...entries.flatMap(getCellVirtualDom)];
643
643
  };
644
644
 
@@ -648,18 +648,18 @@ const getTableVirtualDom = tableInfo => {
648
648
  rows
649
649
  } = tableInfo;
650
650
  return [{
651
- type: Table$1,
651
+ childCount: 2,
652
652
  className: Table,
653
- childCount: 2
653
+ type: Table$1
654
654
  }, {
655
- type: THead,
656
- childCount: 1
655
+ childCount: 1,
656
+ type: THead
657
657
  }, {
658
- type: Tr,
659
- childCount: headings.length
658
+ childCount: headings.length,
659
+ type: Tr
660
660
  }, ...headings.flatMap(getTableHeadingVirtualDom), {
661
- type: TBody,
662
- childCount: rows.length
661
+ childCount: rows.length,
662
+ type: TBody
663
663
  }, ...rows.flatMap(getTableRowVirtualDom)];
664
664
  };
665
665
 
@@ -671,9 +671,9 @@ const getFeatureCommandsVirtualDom = commands => {
671
671
  const heading = commands$1();
672
672
  const tableInfo = getCommandTableEntries(commands);
673
673
  return [{
674
- type: Div,
674
+ childCount: 2,
675
675
  className: FeatureContent,
676
- childCount: 2
676
+ type: Div
677
677
  }, ...getFeatureContentHeadingVirtualDom(heading), ...getTableVirtualDom(tableInfo)];
678
678
  };
679
679
 
@@ -763,46 +763,46 @@ const getJsonValidationInfos = async (extensionUri, validations) => {
763
763
  } = validation;
764
764
  if (typeof schema !== 'string') {
765
765
  validationInfos.push({
766
+ errorMessage: propertyMustBeOfTypeString(),
767
+ fileMatch,
766
768
  isValid: false,
767
- stringValue: JSON.stringify(schema),
768
769
  schemaUrl: '',
769
- errorMessage: propertyMustBeOfTypeString(),
770
- fileMatch
770
+ stringValue: JSON.stringify(schema)
771
771
  });
772
772
  } else if (schema && !schemaLinkUrl) {
773
773
  validationInfos.push({
774
+ errorMessage: invalidLink(),
775
+ fileMatch,
774
776
  isValid: false,
775
- stringValue: schema,
776
777
  schemaUrl: schemaLinkUrl,
777
- errorMessage: invalidLink(),
778
- fileMatch
778
+ stringValue: schema
779
779
  });
780
780
  } else if (schemaLinkUrl) {
781
781
  // TODO maybe better use filesystem.exists
782
782
  if (await existsJson(schemaLinkUrl)) {
783
783
  validationInfos.push({
784
+ errorMessage: '',
785
+ fileMatch,
784
786
  isValid: true,
785
- stringValue: schema,
786
787
  schemaUrl: schemaLinkUrl,
787
- errorMessage: '',
788
- fileMatch
788
+ stringValue: schema
789
789
  });
790
790
  } else {
791
791
  validationInfos.push({
792
+ errorMessage: schemaNotFound(),
793
+ fileMatch,
792
794
  isValid: false,
793
- stringValue: schema,
794
795
  schemaUrl: schemaLinkUrl,
795
- errorMessage: schemaNotFound(),
796
- fileMatch
796
+ stringValue: schema
797
797
  });
798
798
  }
799
799
  } else {
800
800
  validationInfos.push({
801
+ errorMessage: '',
802
+ fileMatch,
801
803
  isValid: true,
802
- stringValue: schema,
803
804
  schemaUrl: schemaLinkUrl,
804
- errorMessage: '',
805
- fileMatch
805
+ stringValue: schema
806
806
  });
807
807
  }
808
808
  }
@@ -811,22 +811,22 @@ const getJsonValidationInfos = async (extensionUri, validations) => {
811
811
 
812
812
  const getJsonValidationTableEntry = validationInfo => {
813
813
  const {
814
- isValid,
815
814
  errorMessage,
815
+ fileMatch,
816
+ isValid,
816
817
  schemaUrl,
817
- stringValue,
818
- fileMatch
818
+ stringValue
819
819
  } = validationInfo;
820
820
  if (!isValid && schemaUrl) {
821
821
  return [{
822
822
  type: Code,
823
823
  value: fileMatch
824
824
  }, {
825
- type: Link,
826
- value: stringValue,
827
- href: schemaUrl,
828
825
  className: TableCellInvalid,
829
- title: errorMessage
826
+ href: schemaUrl,
827
+ title: errorMessage,
828
+ type: Link,
829
+ value: stringValue
830
830
  }];
831
831
  }
832
832
  if (!isValid) {
@@ -834,10 +834,10 @@ const getJsonValidationTableEntry = validationInfo => {
834
834
  type: Text,
835
835
  value: fileMatch
836
836
  }, {
837
- type: Text,
838
- value: stringValue,
839
837
  className: TableCellInvalid,
840
- title: errorMessage
838
+ title: errorMessage,
839
+ type: Text,
840
+ value: stringValue
841
841
  }];
842
842
  }
843
843
  if (schemaUrl) {
@@ -845,9 +845,9 @@ const getJsonValidationTableEntry = validationInfo => {
845
845
  type: Code,
846
846
  value: fileMatch
847
847
  }, {
848
+ href: schemaUrl,
848
849
  type: Link,
849
- value: stringValue,
850
- href: schemaUrl
850
+ value: stringValue
851
851
  }];
852
852
  }
853
853
  return [{
@@ -884,9 +884,9 @@ const getJsonValidationTableEntries = rows => {
884
884
  };
885
885
 
886
886
  const parentNode$1 = {
887
- type: Div,
887
+ childCount: 2,
888
888
  className: FeatureContent,
889
- childCount: 2
889
+ type: Div
890
890
  };
891
891
  const getFeatureJsonValidationVirtualDom = jsonValidation$1 => {
892
892
  const heading = jsonValidation();
@@ -900,9 +900,9 @@ const getJsonValidationVirtualDom = state => {
900
900
 
901
901
  const getProgrammingLanguageTableEntry = programmingLanguage => {
902
902
  const {
903
- id,
904
903
  configuration,
905
- extensions
904
+ extensions,
905
+ id
906
906
  } = programmingLanguage;
907
907
  const name = ''; // TODO
908
908
  const snippets = ''; // TODO
@@ -913,17 +913,17 @@ const getProgrammingLanguageTableEntry = programmingLanguage => {
913
913
  type: Text,
914
914
  value: name
915
915
  }, {
916
+ listItems: extensions,
916
917
  type: CodeList,
917
- value: '',
918
- listItems: extensions
918
+ value: ''
919
919
  }, {
920
+ checked: Boolean(configuration),
920
921
  type: CheckMark,
921
- value: '',
922
- checked: Boolean(configuration)
922
+ value: ''
923
923
  }, {
924
+ checked: Boolean(snippets),
924
925
  type: CheckMark,
925
- value: '',
926
- checked: Boolean(snippets)
926
+ value: ''
927
927
  }];
928
928
  };
929
929
 
@@ -962,9 +962,9 @@ const getFeatureProgrammingLanguagesVirtualDom = programmingLanguages$1 => {
962
962
  const heading = programmingLanguages();
963
963
  const tableInfo = getProgrammingLanguagesTableEntries(programmingLanguages$1);
964
964
  return [{
965
- type: Div,
965
+ childCount: 2,
966
966
  className: FeatureContent,
967
- childCount: 2
967
+ type: Div
968
968
  }, ...getFeatureContentHeadingVirtualDom(heading), ...getTableVirtualDom(tableInfo)];
969
969
  };
970
970
 
@@ -984,14 +984,14 @@ class FeatureNotFoundError extends Error {
984
984
 
985
985
  const getFeatureUnsupportedVirtualDom = state => {
986
986
  return [{
987
- type: Div,
988
- childCount: 2
987
+ childCount: 2,
988
+ type: Div
989
989
  }, {
990
- type: H1,
991
- childCount: 1
990
+ childCount: 1,
991
+ type: H1
992
992
  }, text(unsupportedFeature()), {
993
- type: P,
994
- childCount: 1
993
+ childCount: 1,
994
+ type: P
995
995
  }, text(selectedFeatureUnknownOrUnsupported())];
996
996
  };
997
997
 
@@ -2318,8 +2318,9 @@ const openUrl$1 = async uri => {
2318
2318
  /* eslint-disable unicorn/prefer-export-from */
2319
2319
 
2320
2320
  const {
2321
- set: set$4,
2322
- getRuntimeStatus: getRuntimeStatus$1} = ExtensionHost;
2321
+ getRuntimeStatus: getRuntimeStatus$1,
2322
+ set: set$4
2323
+ } = ExtensionHost;
2323
2324
 
2324
2325
  const getRuntimeStatus = async extensionId => {
2325
2326
  // @ts-ignore
@@ -2331,15 +2332,15 @@ const getRuntimeStatus = async extensionId => {
2331
2332
  const getRuntimeStatusDetails = async extension => {
2332
2333
  const {
2333
2334
  activationEvent,
2334
- status,
2335
2335
  activationTime,
2336
- importTime
2336
+ importTime,
2337
+ status
2337
2338
  } = await getRuntimeStatus(extension.id);
2338
2339
  return {
2339
- wasActivatedByEvent: activationEvent,
2340
2340
  activationTime,
2341
+ importTime,
2341
2342
  status,
2342
- importTime
2343
+ wasActivatedByEvent: activationEvent
2343
2344
  };
2344
2345
  };
2345
2346
 
@@ -2364,17 +2365,17 @@ const getActivationTimeVirtualDom = (importTime$1, activationTime$1) => {
2364
2365
  const formattedImportTime = formatTime(importTime$1);
2365
2366
  const formattedTime = formatTime(activationTime$1);
2366
2367
  return [{
2367
- type: Dt,
2368
- childCount: 1
2368
+ childCount: 1,
2369
+ type: Dt
2369
2370
  }, text(importTime()), {
2370
- type: Dd,
2371
- childCount: 1
2371
+ childCount: 1,
2372
+ type: Dd
2372
2373
  }, text(formattedImportTime), {
2373
- type: Dt,
2374
- childCount: 1
2374
+ childCount: 1,
2375
+ type: Dt
2375
2376
  }, text(activationTime()), {
2376
- type: Dd,
2377
- childCount: 1
2377
+ childCount: 1,
2378
+ type: Dd
2378
2379
  }, text(formattedTime)];
2379
2380
  };
2380
2381
 
@@ -2388,28 +2389,28 @@ const getStatusMessage = statusType => {
2388
2389
  switch (statusType) {
2389
2390
  case Activated:
2390
2391
  return 'activated';
2391
- case None$1:
2392
- return 'none';
2393
2392
  case Activating:
2394
2393
  return 'Activating';
2395
2394
  case Error$1:
2396
2395
  return 'error';
2397
2396
  case Importing:
2398
2397
  return 'importing';
2398
+ case None$1:
2399
+ return 'none';
2399
2400
  default:
2400
2401
  return 'unknown';
2401
2402
  }
2402
2403
  };
2403
2404
 
2404
2405
  const key = {
2405
- type: Dt,
2406
2406
  childCount: 1,
2407
- className: 'RuntimeStatusDefinitionListKey'
2407
+ className: 'RuntimeStatusDefinitionListKey',
2408
+ type: Dt
2408
2409
  };
2409
2410
  const value = {
2410
- type: Dd,
2411
+ childCount: 1,
2411
2412
  className: 'RuntimeStatusDefinitionListValue',
2412
- childCount: 1
2413
+ type: Dd
2413
2414
  };
2414
2415
  const getStatusVirtualDom = status$1 => {
2415
2416
  const statusKey = status();
@@ -2427,20 +2428,20 @@ const getChildCount$1 = (status, activationTime, importTime) => {
2427
2428
  };
2428
2429
  const getRuntimeStatusVirtualDom = state => {
2429
2430
  const {
2430
- status,
2431
2431
  activationTime,
2432
- importTime
2432
+ importTime,
2433
+ status
2433
2434
  } = state;
2434
2435
  const heading = runtimeStatus();
2435
2436
  const childCount = getChildCount$1(status, activationTime, importTime);
2436
2437
  return [{
2437
- type: Div,
2438
+ childCount: 2,
2438
2439
  className: FeatureContent,
2439
- childCount: 2
2440
+ type: Div
2440
2441
  }, ...getFeatureContentHeadingVirtualDom(heading), {
2441
- type: Dl,
2442
+ childCount,
2442
2443
  className: 'RuntimeStatusDefinitionList',
2443
- childCount
2444
+ type: Dl
2444
2445
  }, ...getStatusVirtualDom(status), ...getActivationTimeVirtualDom(activationTime, importTime)];
2445
2446
  };
2446
2447
 
@@ -2487,9 +2488,9 @@ const getFeatureSettingsVirtualDom = rows => {
2487
2488
  const heading = settings();
2488
2489
  const tableInfo = getSettingsTableEntries(rows);
2489
2490
  return [{
2490
- type: Div,
2491
+ childCount: 2,
2491
2492
  className: FeatureContent,
2492
- childCount: 2
2493
+ type: Div
2493
2494
  }, ...getFeatureContentHeadingVirtualDom(heading), ...getTableVirtualDom(tableInfo)];
2494
2495
  };
2495
2496
 
@@ -2534,26 +2535,27 @@ const WebViews = 'WebViews';
2534
2535
 
2535
2536
  const getScrollToTopVirtualDom = scrollToTopButtonEnabled => {
2536
2537
  return [{
2537
- type: Button$1,
2538
- className: ScrollToTopButton,
2538
+ ariaLabel: scrollToTop(),
2539
2539
  childCount: 1,
2540
+ className: ScrollToTopButton,
2541
+ name: ScrollToTop,
2540
2542
  onClick: HandleClickScrollToTop,
2541
- ariaLabel: scrollToTop(),
2542
- name: ScrollToTop
2543
+ type: Button$1
2543
2544
  }, {
2544
- type: Div,
2545
- className: mergeClassNames(MaskIcon, MaskIconChevronUp),
2546
2545
  childCount: 0,
2547
- role: None$3
2546
+ className: mergeClassNames(MaskIcon, MaskIconChevronUp),
2547
+ role: None$3,
2548
+ type: Div
2548
2549
  }];
2549
2550
  };
2550
2551
 
2551
2552
  /* eslint-disable unicorn/prefer-export-from */
2552
2553
 
2553
2554
  const {
2554
- set: set$3,
2555
2555
  getVirtualDom,
2556
- render} = MarkdownWorker;
2556
+ render,
2557
+ set: set$3
2558
+ } = MarkdownWorker;
2557
2559
 
2558
2560
  const getMarkdownVirtualDom = async (html, options) => {
2559
2561
  string(html);
@@ -2563,9 +2565,9 @@ const getMarkdownVirtualDom = async (html, options) => {
2563
2565
  const extraDom = getScrollToTopVirtualDom();
2564
2566
  return [{
2565
2567
  ...firstNode,
2566
- onScroll: HandleReadmeScroll,
2567
2568
  childCount: firstNode.childCount + 1,
2568
2569
  onClick: HandleReadmeClick,
2570
+ onScroll: HandleReadmeScroll,
2569
2571
  onSelectionChange: HandleSelectionChange
2570
2572
  }, ...extraDom, ...rest];
2571
2573
  }
@@ -2653,9 +2655,8 @@ const getCacheInternal = async cacheName => {
2653
2655
  const twoWeeks = 14 * 24 * 60 * 60 * 1000;
2654
2656
  // @ts-ignore
2655
2657
  const bucket = await navigator.storageBuckets.open(bucketName, {
2656
- quota: 20 * 1024 * 1024,
2657
- // 20MB
2658
- expires: Date.now() + twoWeeks
2658
+ expires: Date.now() + twoWeeks,
2659
+ quota: 20 * 1024 * 1024 // 20MB
2659
2660
  });
2660
2661
  const cache = await bucket.caches.open(cacheName);
2661
2662
  return cache;
@@ -2684,8 +2685,8 @@ const set$2 = async (key, value) => {
2684
2685
  const cache = await getCache(cacheName);
2685
2686
  await cache.put(key, new Response(value, {
2686
2687
  headers: {
2687
- 'Content-Type': 'application/markdown',
2688
- 'Content-Length': `${value.length}`
2688
+ 'Content-Length': `${value.length}`,
2689
+ 'Content-Type': 'application/markdown'
2689
2690
  }
2690
2691
  }));
2691
2692
  };
@@ -2766,13 +2767,13 @@ const getFeatureThemesVirtualDom = themesDom => {
2766
2767
  const childCount = getVirtualDomChildCount(themesDom);
2767
2768
  const heading = theme();
2768
2769
  return [{
2769
- type: Div,
2770
+ childCount: 2,
2770
2771
  className: FeatureContent,
2771
- childCount: 2
2772
+ type: Div
2772
2773
  }, ...getFeatureContentHeadingVirtualDom(heading), {
2773
- type: Div,
2774
+ childCount,
2774
2775
  className: DefaultMarkdown,
2775
- childCount
2776
+ type: Div
2776
2777
  }, ...themesDom];
2777
2778
  };
2778
2779
 
@@ -2782,16 +2783,16 @@ const getThemeVirtualDom = state => {
2782
2783
 
2783
2784
  const toWebView = rawWebView => {
2784
2785
  const {
2785
- id,
2786
- selector,
2787
2786
  contentSecurityPolicy,
2788
- elements
2787
+ elements,
2788
+ id,
2789
+ selector
2789
2790
  } = rawWebView;
2790
2791
  return {
2791
- id,
2792
- selectorString: JSON.stringify(selector),
2793
2792
  contentSecurityPolicyString: JSON.stringify(contentSecurityPolicy),
2794
- elementsString: JSON.stringify(elements, null, 2)
2793
+ elementsString: JSON.stringify(elements, null, 2),
2794
+ id,
2795
+ selectorString: JSON.stringify(selector)
2795
2796
  };
2796
2797
  };
2797
2798
 
@@ -2815,47 +2816,47 @@ const featureWebViewsEnabled = extension => {
2815
2816
  };
2816
2817
 
2817
2818
  const heading = {
2818
- type: H2,
2819
+ childCount: 1,
2819
2820
  className: DefinitionListItemHeading,
2820
- childCount: 1
2821
+ type: H2
2821
2822
  };
2822
2823
  const pre = {
2823
- type: Pre,
2824
+ childCount: 1,
2824
2825
  className: DefinitionListItemValue,
2825
- childCount: 1
2826
+ type: Pre
2826
2827
  };
2827
2828
  const item = {
2828
- type: Div,
2829
+ childCount: 2,
2829
2830
  className: DefinitionListItem,
2830
- childCount: 2
2831
+ type: Div
2831
2832
  };
2832
2833
  const getWebViewVirtualDom = webView => {
2833
2834
  const {
2834
- id,
2835
- selectorString,
2836
2835
  contentSecurityPolicyString,
2837
- elementsString
2836
+ elementsString,
2837
+ id,
2838
+ selectorString
2838
2839
  } = webView;
2839
2840
  const textId = id$1();
2840
2841
  const textSelector = selector();
2841
2842
  const textContentSecurityPolicy = contentSecurityPolicy();
2842
2843
  const textElements = elements();
2843
2844
  return [{
2844
- type: Div,
2845
+ childCount: 4,
2845
2846
  className: FeatureWebView,
2846
- childCount: 4
2847
+ type: Div
2847
2848
  }, 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)];
2848
2849
  };
2849
2850
 
2850
2851
  const getFeatureWebViewsVirtualDom = webViews$1 => {
2851
2852
  const heading = webViews();
2852
2853
  return [{
2853
- type: Div,
2854
+ childCount: 2,
2854
2855
  className: FeatureContent,
2855
- childCount: 2
2856
+ type: Div
2856
2857
  }, ...getFeatureContentHeadingVirtualDom(heading), {
2857
- type: Div,
2858
- childCount: webViews$1.length
2858
+ childCount: webViews$1.length,
2859
+ type: Div
2859
2860
  }, ...webViews$1.flatMap(getWebViewVirtualDom)];
2860
2861
  };
2861
2862
 
@@ -2865,60 +2866,60 @@ const getWebViewsVirtualDom = state => {
2865
2866
 
2866
2867
  const registerAllFeatures = () => {
2867
2868
  register$1({
2868
- id: Theme,
2869
- getLabel: theme,
2870
- isEnabled: featureThemeEnabled,
2871
2869
  getDetails: getThemeDetails,
2872
- getVirtualDom: getThemeVirtualDom
2870
+ getLabel: theme,
2871
+ getVirtualDom: getThemeVirtualDom,
2872
+ id: Theme,
2873
+ isEnabled: featureThemeEnabled
2873
2874
  });
2874
2875
  register$1({
2875
- id: Commands,
2876
- getLabel: commands$1,
2877
- isEnabled: featureCommandsEnabled,
2878
2876
  getDetails: getCommandsDetails,
2879
- getVirtualDom: getCommandsVirtualDom
2877
+ getLabel: commands$1,
2878
+ getVirtualDom: getCommandsVirtualDom,
2879
+ id: Commands,
2880
+ isEnabled: featureCommandsEnabled
2880
2881
  });
2881
2882
  register$1({
2882
- id: Settings,
2883
- getLabel: settings,
2884
- isEnabled: featureSettingsEnabled,
2885
2883
  getDetails: getSettingsDetails,
2886
- getVirtualDom: getSettingsVirtualDom
2884
+ getLabel: settings,
2885
+ getVirtualDom: getSettingsVirtualDom,
2886
+ id: Settings,
2887
+ isEnabled: featureSettingsEnabled
2887
2888
  });
2888
2889
  register$1({
2889
- id: JsonValidation,
2890
- getLabel: jsonValidation,
2891
- isEnabled: featureJsonValidationEnabled,
2892
2890
  getDetails: getJsonValidationDetails,
2893
- getVirtualDom: getJsonValidationVirtualDom
2891
+ getLabel: jsonValidation,
2892
+ getVirtualDom: getJsonValidationVirtualDom,
2893
+ id: JsonValidation,
2894
+ isEnabled: featureJsonValidationEnabled
2894
2895
  });
2895
2896
  register$1({
2896
- id: ProgrammingLanguages,
2897
- getLabel: programmingLanguages,
2898
- isEnabled: featureProgrammingLanguagesEnabled,
2899
2897
  getDetails: getFeatureDetailsProgrammingLanguages,
2900
- getVirtualDom: getProgrammingLanguagesVirtualDom
2898
+ getLabel: programmingLanguages,
2899
+ getVirtualDom: getProgrammingLanguagesVirtualDom,
2900
+ id: ProgrammingLanguages,
2901
+ isEnabled: featureProgrammingLanguagesEnabled
2901
2902
  });
2902
2903
  register$1({
2903
- id: WebViews,
2904
- getLabel: webViews,
2905
- isEnabled: featureWebViewsEnabled,
2906
2904
  getDetails: getWebViewsDetails,
2907
- getVirtualDom: getWebViewsVirtualDom
2905
+ getLabel: webViews,
2906
+ getVirtualDom: getWebViewsVirtualDom,
2907
+ id: WebViews,
2908
+ isEnabled: featureWebViewsEnabled
2908
2909
  });
2909
2910
  register$1({
2910
- id: ActivationEvents,
2911
- getLabel: activationEvents,
2912
- isEnabled: featureActivationEventsEnabled,
2913
2911
  getDetails: getActivationEventsDetails,
2914
- getVirtualDom: getActivationEventsVirtualDom
2912
+ getLabel: activationEvents,
2913
+ getVirtualDom: getActivationEventsVirtualDom,
2914
+ id: ActivationEvents,
2915
+ isEnabled: featureActivationEventsEnabled
2915
2916
  });
2916
2917
  register$1({
2917
- id: RuntimeStatus,
2918
- getLabel: runtimeStatus,
2919
- isEnabled: featureRuntimeStatusEnabled,
2920
2918
  getDetails: getRuntimeStatusDetails,
2921
- getVirtualDom: getRuntimeStatusVirtualDom
2919
+ getLabel: runtimeStatus,
2920
+ getVirtualDom: getRuntimeStatusVirtualDom,
2921
+ id: RuntimeStatus,
2922
+ isEnabled: featureRuntimeStatusEnabled
2922
2923
  });
2923
2924
  };
2924
2925
 
@@ -2955,10 +2956,11 @@ const create$1 = () => {
2955
2956
  wrapCommand(fn) {
2956
2957
  const wrapped = async (uid, ...args) => {
2957
2958
  const {
2959
+ oldState,
2958
2960
  newState
2959
2961
  } = states[uid];
2960
2962
  const newerState = await fn(newState, ...args);
2961
- if (newState === newerState) {
2963
+ if (oldState === newerState || newState === newerState) {
2962
2964
  return;
2963
2965
  }
2964
2966
  const latest = states[uid];
@@ -3016,10 +3018,11 @@ const writeText = async text => {
3016
3018
  /* eslint-disable unicorn/prefer-export-from */
3017
3019
 
3018
3020
  const {
3019
- set: set$1,
3020
3021
  exists,
3022
+ invoke,
3021
3023
  readFile: readFile$1,
3022
- invoke} = FileSystemWorker;
3024
+ set: set$1
3025
+ } = FileSystemWorker;
3023
3026
  const readFileAsBlob = async uri => {
3024
3027
  // TODO maybe readAsObjectUrl?
3025
3028
  // @ts-ignore
@@ -3059,13 +3062,13 @@ const copyReadmeLink = async (state, href) => {
3059
3062
  };
3060
3063
 
3061
3064
  const {
3065
+ dispose: dispose$1,
3062
3066
  get,
3067
+ getCommandIds,
3068
+ registerCommands,
3063
3069
  set,
3064
- dispose: dispose$1,
3065
3070
  wrapCommand,
3066
- wrapGetter,
3067
- getCommandIds,
3068
- registerCommands
3071
+ wrapGetter
3069
3072
  } = create$1();
3070
3073
 
3071
3074
  const create = (uid, uri, x, y, width, height, platform, assetDir) => {
@@ -3120,6 +3123,7 @@ const create = (uid, uri, x, y, width, height, platform, assetDir) => {
3120
3123
  settingsButtonEnabled: false,
3121
3124
  showAdditionalDetailsBreakpoint: 700,
3122
3125
  showSideBar: true,
3126
+ showSizeLink: false,
3123
3127
  sideBarWidth: 0,
3124
3128
  sizeOnDisk: 0,
3125
3129
  sizeValue: 0,
@@ -3130,8 +3134,7 @@ const create = (uid, uri, x, y, width, height, platform, assetDir) => {
3130
3134
  uri,
3131
3135
  wasActivatedByEvent: '',
3132
3136
  webViews: [],
3133
- width,
3134
- showSizeLink: false
3137
+ width
3135
3138
  };
3136
3139
  set(uid, state, state);
3137
3140
  };
@@ -3165,8 +3168,8 @@ const numbers = [RenderItems, RenderFocus, RenderScrollTop, RenderCss];
3165
3168
 
3166
3169
  const diff2 = uid => {
3167
3170
  const {
3168
- oldState,
3169
- newState
3171
+ newState,
3172
+ oldState
3170
3173
  } = get(uid);
3171
3174
  const diffResult = [];
3172
3175
  for (let i = 0; i < modules.length; i++) {
@@ -3191,17 +3194,17 @@ const executeCopy = async state => {
3191
3194
 
3192
3195
  const getMenuEntriesImage = (state, props) => {
3193
3196
  return [{
3194
- id: 'copyImage',
3195
- label: copyImage$1(),
3196
- flags: None$2,
3197
+ args: [],
3197
3198
  command: 'ExtensionDetail.copyImage',
3198
- args: []
3199
- }, {
3200
- id: 'copyImage',
3201
- label: copyImageUrl$1(),
3202
3199
  flags: None$2,
3200
+ id: 'copyImage',
3201
+ label: copyImage$1()
3202
+ }, {
3203
+ args: [],
3203
3204
  command: 'ExtensionDetail.copyImageUrl',
3204
- args: []
3205
+ flags: None$2,
3206
+ id: 'copyImage',
3207
+ label: copyImageUrl$1()
3205
3208
  }];
3206
3209
  };
3207
3210
 
@@ -3210,21 +3213,21 @@ const getMenuEntries2 = (state, props) => {
3210
3213
  return getMenuEntriesImage();
3211
3214
  }
3212
3215
  return [{
3213
- id: 'copy',
3214
- label: copy$1(),
3215
- flags: None$2,
3216
+ args: [],
3216
3217
  command: 'ExtensionDetail.executeCopy',
3217
- args: []
3218
+ flags: None$2,
3219
+ id: 'copy',
3220
+ label: copy$1()
3218
3221
  }];
3219
3222
  };
3220
3223
 
3221
3224
  const None = 0;
3222
3225
 
3223
3226
  const getCopyMenuEntry = () => ({
3224
- id: 'copy',
3225
- label: copy$1(),
3227
+ command: 'ClipBoard.execCopy',
3226
3228
  flags: None,
3227
- command: 'ClipBoard.execCopy'
3229
+ id: 'copy',
3230
+ label: copy$1()
3228
3231
  });
3229
3232
 
3230
3233
  const getImageMenuEntries = props => {
@@ -3232,17 +3235,17 @@ const getImageMenuEntries = props => {
3232
3235
  return [];
3233
3236
  }
3234
3237
  return [{
3235
- id: 'openImageInNewTab',
3236
- label: openImageInNewTab$1(),
3237
- flags: None,
3238
+ args: [props.url || ''],
3238
3239
  command: 'Open.openUrl',
3239
- args: [props.url || '']
3240
- }, {
3241
- id: 'saveImageAs',
3242
- label: saveImageAs(),
3243
3240
  flags: None,
3241
+ id: 'openImageInNewTab',
3242
+ label: openImageInNewTab$1()
3243
+ }, {
3244
+ args: ['image.png', props.url || ''],
3244
3245
  command: 'SaveFileAs.saveFileAs',
3245
- args: ['image.png', props.url || '']
3246
+ flags: None,
3247
+ id: 'saveImageAs',
3248
+ label: saveImageAs()
3246
3249
  }];
3247
3250
  };
3248
3251
 
@@ -3251,11 +3254,11 @@ const getLinkMenuEntries = props => {
3251
3254
  return [];
3252
3255
  }
3253
3256
  return [{
3254
- id: 'openInNewTab',
3255
- label: openInNewTab(),
3256
- flags: None,
3257
+ args: [props.url || ''],
3257
3258
  command: 'Open.openUrl',
3258
- args: [props.url || '']
3259
+ flags: None,
3260
+ id: 'openInNewTab',
3261
+ label: openInNewTab()
3259
3262
  }];
3260
3263
  };
3261
3264
 
@@ -3267,39 +3270,39 @@ const getMenuIds = () => {
3267
3270
  };
3268
3271
 
3269
3272
  const getMenuEntriesReadme = () => [{
3270
- id: 'copy',
3271
- label: copy$1(),
3272
- flags: None$2,
3273
+ args: [],
3273
3274
  command: 'ExtensionDetail.copyReadmeText',
3274
- args: []
3275
+ flags: None$2,
3276
+ id: 'copy',
3277
+ label: copy$1()
3275
3278
  }];
3276
3279
 
3277
3280
  const ExtensionDetailIconContextMenu$1 = 4091;
3278
3281
  const getMenus = () => {
3279
3282
  return [{
3280
- id: ExtensionDetailReadme,
3281
- entries: getMenuEntriesReadme()
3283
+ entries: getMenuEntriesReadme(),
3284
+ id: ExtensionDetailReadme
3282
3285
  }, {
3283
- id: ExtensionDetailIconContextMenu$1,
3284
3286
  entries: [{
3285
- id: 'openImageInNewTab',
3286
- label: openImageInNewTab$1(),
3287
- flags: None,
3287
+ args: [],
3288
3288
  command: 'ExtensionDetail.openImageInNewTab',
3289
- args: []
3290
- }, {
3291
- id: 'copyImage',
3292
- label: copyImage$1(),
3293
3289
  flags: None,
3294
- command: 'ExtensionDetail.copyImage',
3295
- args: []
3290
+ id: 'openImageInNewTab',
3291
+ label: openImageInNewTab$1()
3296
3292
  }, {
3297
- id: 'copyImageUrl',
3298
- label: copyImageUrl$1(),
3293
+ args: [],
3294
+ command: 'ExtensionDetail.copyImage',
3299
3295
  flags: None,
3296
+ id: 'copyImage',
3297
+ label: copyImage$1()
3298
+ }, {
3299
+ args: [],
3300
3300
  command: 'ExtensionDetail.copyImageUrl',
3301
- args: []
3302
- }]
3301
+ flags: None,
3302
+ id: 'copyImageUrl',
3303
+ label: copyImageUrl$1()
3304
+ }],
3305
+ id: ExtensionDetailIconContextMenu$1
3303
3306
  }];
3304
3307
  };
3305
3308
 
@@ -3364,25 +3367,25 @@ const getExtension = async (id, platform) => {
3364
3367
 
3365
3368
  const getExtensionDetailButtons = (hasColorTheme, isBuiltin, isDisabled) => {
3366
3369
  const allActions = [{
3367
- label: setColorTheme$2(),
3368
- onClick: HandleClickSetColorTheme,
3369
3370
  enabled: hasColorTheme,
3370
- name: SetColorTheme
3371
+ label: setColorTheme$2(),
3372
+ name: SetColorTheme,
3373
+ onClick: HandleClickSetColorTheme
3371
3374
  }, {
3372
- label: enable(),
3373
- onClick: HandleClickEnable,
3374
3375
  enabled: isDisabled,
3375
- name: Enable
3376
+ label: enable(),
3377
+ name: Enable,
3378
+ onClick: HandleClickEnable
3376
3379
  }, {
3377
- label: disable(),
3378
- onClick: HandleClickDisable,
3379
3380
  enabled: !isDisabled,
3380
- name: Disable
3381
+ label: disable(),
3382
+ name: Disable,
3383
+ onClick: HandleClickDisable
3381
3384
  }, {
3382
- label: uninstall(),
3383
- onClick: HandleClickUninstall,
3384
3385
  enabled: !isBuiltin,
3385
- name: Uninstall
3386
+ label: uninstall(),
3387
+ name: Uninstall,
3388
+ onClick: HandleClickUninstall
3386
3389
  }];
3387
3390
  const filteredButtons = allActions.filter(button => button.enabled);
3388
3391
  return filteredButtons;
@@ -3391,8 +3394,8 @@ const getExtensionDetailButtons = (hasColorTheme, isBuiltin, isDisabled) => {
3391
3394
  const updateExtensionStatus = async (state, updateFunction) => {
3392
3395
  const {
3393
3396
  extensionId,
3394
- platform,
3395
- hasColorTheme
3397
+ hasColorTheme,
3398
+ platform
3396
3399
  } = state;
3397
3400
  const error = await updateFunction(extensionId);
3398
3401
  if (error) {
@@ -3403,8 +3406,8 @@ const updateExtensionStatus = async (state, updateFunction) => {
3403
3406
  const buttons = getExtensionDetailButtons(hasColorTheme, false, disabled);
3404
3407
  return {
3405
3408
  ...state,
3406
- disabled: extension?.disabled,
3407
- buttons
3409
+ buttons,
3410
+ disabled: extension?.disabled
3408
3411
  };
3409
3412
  };
3410
3413
 
@@ -3425,9 +3428,9 @@ const selectFeature = async (state, name) => {
3425
3428
  return state;
3426
3429
  }
3427
3430
  const {
3428
- features,
3429
- extension,
3430
3431
  baseUrl,
3432
+ extension,
3433
+ features,
3431
3434
  locationProtocol
3432
3435
  } = state;
3433
3436
  const newFeatures = features.map(feature => {
@@ -3447,8 +3450,8 @@ const selectFeature = async (state, name) => {
3447
3450
  return {
3448
3451
  ...state,
3449
3452
  ...partialNewState,
3450
- selectedFeature: name,
3451
- features: newFeatures
3453
+ features: newFeatures,
3454
+ selectedFeature: name
3452
3455
  };
3453
3456
  };
3454
3457
 
@@ -3536,8 +3539,8 @@ const extensionTheme = assetDir => {
3536
3539
 
3537
3540
  const handleIconError = state => {
3538
3541
  const {
3539
- iconSrc,
3540
- assetDir
3542
+ assetDir,
3543
+ iconSrc
3541
3544
  } = state;
3542
3545
  if (iconSrc === extensionDefaultIcon(assetDir)) {
3543
3546
  return state;
@@ -3585,9 +3588,9 @@ const handleReadmeContextMenu = async (state, x, y, nodeName, href) => {
3585
3588
  } = state;
3586
3589
  // TODO maybe also pass other args
3587
3590
  await show2(uid, ExtensionDetailReadme, x, y, {
3591
+ href,
3588
3592
  menuId: ExtensionDetailReadme,
3589
- nodeName,
3590
- href
3593
+ nodeName
3591
3594
  });
3592
3595
  // TODO
3593
3596
  return state;
@@ -3643,10 +3646,10 @@ const loadChangelogContent = async path => {
3643
3646
 
3644
3647
  const selectTabChangelog = async state => {
3645
3648
  const {
3646
- extension,
3647
3649
  baseUrl,
3648
- tabs,
3649
- locationProtocol
3650
+ extension,
3651
+ locationProtocol,
3652
+ tabs
3650
3653
  } = state;
3651
3654
  const changelogContent = await loadChangelogContent(extension.path); // TODO use uri
3652
3655
  const changelogMarkdownHtml = await renderMarkdown(changelogContent, {
@@ -3662,8 +3665,8 @@ const selectTabChangelog = async state => {
3662
3665
  });
3663
3666
  return {
3664
3667
  ...state,
3665
- selectedTab: Changelog,
3666
3668
  changelogVirtualDom: changelogDom,
3669
+ selectedTab: Changelog,
3667
3670
  tabs: newTabs
3668
3671
  };
3669
3672
  };
@@ -3690,9 +3693,9 @@ const loadReadmeContent = async readmeUrl => {
3690
3693
  const selectTabDetails = async state => {
3691
3694
  const {
3692
3695
  baseUrl,
3696
+ locationProtocol,
3693
3697
  readmeUrl,
3694
- tabs,
3695
- locationProtocol
3698
+ tabs
3696
3699
  } = state;
3697
3700
  const readmeContent = await loadReadmeContent(readmeUrl);
3698
3701
  const readmeHtml = await renderMarkdown(readmeContent, {
@@ -3709,20 +3712,20 @@ const selectTabDetails = async state => {
3709
3712
  });
3710
3713
  return {
3711
3714
  ...state,
3712
- selectedTab: Details,
3713
3715
  detailsVirtualDom: detailsDom,
3716
+ selectedTab: Details,
3714
3717
  tabs: newTabs
3715
3718
  };
3716
3719
  };
3717
3720
 
3718
3721
  const selectTabFeatures = async state => {
3719
3722
  const {
3720
- extension,
3721
3723
  baseUrl,
3722
- selectedFeature,
3724
+ extension,
3723
3725
  features,
3724
- tabs,
3725
- locationProtocol
3726
+ locationProtocol,
3727
+ selectedFeature,
3728
+ tabs
3726
3729
  } = state;
3727
3730
  if (features.length === 0) {
3728
3731
  return state;
@@ -3736,23 +3739,36 @@ const selectTabFeatures = async state => {
3736
3739
  selected: tab.name === Features
3737
3740
  };
3738
3741
  });
3742
+ const newFeatures = features.map(feature => {
3743
+ if (feature.id === actualSelectedFeature) {
3744
+ return {
3745
+ ...feature,
3746
+ selected: true
3747
+ };
3748
+ }
3749
+ return {
3750
+ ...feature,
3751
+ selected: false
3752
+ };
3753
+ });
3739
3754
  return {
3740
3755
  ...state,
3741
- selectedTab: Features,
3756
+ ...partialNewState,
3757
+ features: newFeatures,
3742
3758
  selectedFeature: features[0].id || '',
3743
- tabs: newTabs,
3744
- ...partialNewState
3759
+ selectedTab: Features,
3760
+ tabs: newTabs
3745
3761
  };
3746
3762
  };
3747
3763
 
3748
3764
  const getSelectTabHandler = name => {
3749
3765
  switch (name) {
3766
+ case Changelog:
3767
+ return selectTabChangelog;
3750
3768
  case Details:
3751
3769
  return selectTabDetails;
3752
3770
  case Features:
3753
3771
  return selectTabFeatures;
3754
- case Changelog:
3755
- return selectTabChangelog;
3756
3772
  default:
3757
3773
  return selectTabDefault;
3758
3774
  }
@@ -3773,27 +3789,26 @@ const getSizeEntries = (showSizeLink, displaySize, extensionUri) => {
3773
3789
  }
3774
3790
  return [{
3775
3791
  key: size(),
3776
- value: displaySize,
3777
3792
  onClick: HandleClickSize,
3778
- title: extensionUri
3793
+ title: extensionUri,
3794
+ value: displaySize
3779
3795
  }];
3780
3796
  };
3781
3797
 
3782
3798
  const getInstallationEntries = (displaySize, extensionId, extensionVersion, extensionUri, showSizeLink) => {
3783
3799
  const entries = [{
3800
+ code: true,
3784
3801
  key: identifier(),
3785
- value: extensionId,
3786
3802
  odd: true,
3787
- code: true
3803
+ value: extensionId
3788
3804
  }, {
3805
+ code: true,
3789
3806
  key: version(),
3790
- value: extensionVersion,
3791
- code: true
3807
+ value: extensionVersion
3792
3808
  }, {
3793
3809
  key: lastUpdated(),
3794
- value: 'n/a',
3795
- // TODO get this from somewhere
3796
- odd: true
3810
+ odd: true,
3811
+ value: 'n/a' // TODO get this from somewhere
3797
3812
  }, ...getSizeEntries(showSizeLink, displaySize, extensionUri)];
3798
3813
  return entries;
3799
3814
  };
@@ -3802,8 +3817,8 @@ const hideSizeLink = state => {
3802
3817
  const {
3803
3818
  displaySize,
3804
3819
  extensionId,
3805
- extensionVersion,
3806
- extensionUri
3820
+ extensionUri,
3821
+ extensionVersion
3807
3822
  } = state;
3808
3823
  const newShowSizeLink = false;
3809
3824
  const installationEntries = getInstallationEntries(displaySize, extensionId, extensionVersion, extensionUri, newShowSizeLink);
@@ -3904,8 +3919,8 @@ const getRemoteSrc = uri => {
3904
3919
 
3905
3920
  const getBaseUrl = (extensionPath, platform) => {
3906
3921
  switch (platform) {
3907
- case Remote:
3908
3922
  case Electron:
3923
+ case Remote:
3909
3924
  return getRemoteSrc(extensionPath + '/');
3910
3925
  default:
3911
3926
  return extensionPath;
@@ -3951,20 +3966,20 @@ const getSideBarWidth = width => {
3951
3966
 
3952
3967
  const getTabs = (selectedTab, hasReadme, hasFeatures, hasChangelog) => {
3953
3968
  const tabs = [{
3969
+ enabled: hasReadme,
3954
3970
  label: details(),
3955
3971
  name: Details,
3956
- selected: selectedTab === Details,
3957
- enabled: hasReadme
3972
+ selected: selectedTab === Details
3958
3973
  }, {
3974
+ enabled: hasFeatures,
3959
3975
  label: features$1(),
3960
3976
  name: Features,
3961
- selected: selectedTab === Features,
3962
- enabled: hasFeatures
3977
+ selected: selectedTab === Features
3963
3978
  }, {
3979
+ enabled: hasChangelog,
3964
3980
  label: changelog(),
3965
3981
  name: Changelog,
3966
- selected: selectedTab === Changelog,
3967
- enabled: hasChangelog
3982
+ selected: selectedTab === Changelog
3968
3983
  }];
3969
3984
  return tabs;
3970
3985
  };
@@ -4271,8 +4286,8 @@ const getMarketplaceEntries = isBuiltin => {
4271
4286
  }
4272
4287
  return [{
4273
4288
  key: published(),
4274
- value: 'n/a',
4275
- odd: true
4289
+ odd: true,
4290
+ value: 'n/a'
4276
4291
  }, {
4277
4292
  key: lastReleased(),
4278
4293
  value: 'n/a'
@@ -4284,21 +4299,26 @@ const getLicenseLink = extension => {
4284
4299
  return '#';
4285
4300
  };
4286
4301
 
4287
- const getRepositoryLinkRaw = extension => {
4288
- if (extension && hasProperty(extension, 'repository') && typeof extension.repository === 'string') {
4289
- return extension.repository; // TODO watch out for javascript: or other invalid links or path traversal
4290
- }
4291
- return '';
4292
- };
4293
4302
  const ensureValidLink = link => {
4294
4303
  if (!link) {
4295
4304
  return '';
4296
4305
  }
4297
- const parsed = new URL(link);
4298
- if (parsed.protocol !== 'https:') {
4306
+ try {
4307
+ const parsed = new URL(link);
4308
+ if (parsed.protocol !== 'https:') {
4309
+ return '';
4310
+ }
4311
+ return link;
4312
+ } catch {
4299
4313
  return '';
4300
4314
  }
4301
- return link;
4315
+ };
4316
+
4317
+ const getRepositoryLinkRaw = extension => {
4318
+ if (extension && hasProperty(extension, 'repository') && typeof extension.repository === 'string') {
4319
+ return extension.repository; // TODO watch out for javascript: or other invalid links or path traversal
4320
+ }
4321
+ return '';
4302
4322
  };
4303
4323
  const getRepositoryLink = extension => {
4304
4324
  const raw = getRepositoryLinkRaw(extension);
@@ -4314,21 +4334,21 @@ const getResources = (isBuiltin, extension) => {
4314
4334
  const licenseLink = getLicenseLink();
4315
4335
  // TODO
4316
4336
  return [{
4337
+ icon: 'LinkExternal',
4317
4338
  label: marketplace(),
4318
- url: '#',
4319
- icon: 'LinkExternal'
4339
+ url: '#'
4320
4340
  }, {
4341
+ icon: 'LinkExternal',
4321
4342
  label: issues(),
4322
- url: '#',
4323
- icon: 'LinkExternal'
4343
+ url: '#'
4324
4344
  }, {
4345
+ icon: 'Repo',
4325
4346
  label: repository(),
4326
- url: repositoryLink,
4327
- icon: 'Repo'
4347
+ url: repositoryLink
4328
4348
  }, {
4349
+ icon: 'LinkExternal',
4329
4350
  label: license(),
4330
- url: licenseLink,
4331
- icon: 'LinkExternal'
4351
+ url: licenseLink
4332
4352
  }];
4333
4353
  };
4334
4354
 
@@ -4383,10 +4403,10 @@ const restoreState = savedState => {
4383
4403
  const readmeScrollTop = getSavedReadmeScrollTop(savedState);
4384
4404
  const changelogScrollTop = getSavedChangelogScrollTop(savedState);
4385
4405
  return {
4386
- selectedFeature,
4387
- selectedTab,
4406
+ changelogScrollTop,
4388
4407
  readmeScrollTop,
4389
- changelogScrollTop
4408
+ selectedFeature,
4409
+ selectedTab
4390
4410
  };
4391
4411
  };
4392
4412
 
@@ -4395,8 +4415,8 @@ const loadContent = async (state, platform, savedState, isTest = false) => {
4395
4415
  savedState = undefined;
4396
4416
  }
4397
4417
  const {
4398
- width,
4399
- uri
4418
+ uri,
4419
+ width
4400
4420
  } = state;
4401
4421
  const id = getExtensionIdFromUri(uri);
4402
4422
  const extension = await getExtension(id, platform);
@@ -4435,10 +4455,10 @@ const loadContent = async (state, platform, savedState, isTest = false) => {
4435
4455
  const buttons = getExtensionDetailButtons(hasColorTheme, isBuiltin, disabled);
4436
4456
  const size = getViewletSize(width);
4437
4457
  const {
4438
- selectedFeature,
4439
- selectedTab,
4458
+ changelogScrollTop,
4440
4459
  readmeScrollTop,
4441
- changelogScrollTop
4460
+ selectedFeature,
4461
+ selectedTab
4442
4462
  } = restoreState(savedState);
4443
4463
  const features = getFeatures(selectedFeature || Theme, extension);
4444
4464
  const hasFeatures = features.length > 0;
@@ -4447,12 +4467,12 @@ const loadContent = async (state, platform, savedState, isTest = false) => {
4447
4467
  const sizeValue = getViewletSize(width || 0);
4448
4468
  const showSizeLink = platform !== Web$1;
4449
4469
  const {
4470
+ categories,
4471
+ displaySize,
4472
+ folderSize,
4450
4473
  installationEntries,
4451
4474
  marketplaceEntries,
4452
- displaySize,
4453
- categories,
4454
- resources,
4455
- folderSize
4475
+ resources
4456
4476
  } = await loadSideBarContent(extensionId, extensionVersion, extensionUri, isBuiltin, extension, showSizeLink);
4457
4477
  const padding = getPadding(width);
4458
4478
  const sideBarWidth = getSideBarWidth(width);
@@ -4525,16 +4545,16 @@ const createCss = object => {
4525
4545
 
4526
4546
  const renderCss = (oldState, newState) => {
4527
4547
  const {
4528
- uid,
4529
4548
  paddingLeft,
4530
4549
  paddingRight,
4531
- sideBarWidth
4550
+ sideBarWidth,
4551
+ uid
4532
4552
  } = newState;
4533
4553
  const css = createCss({
4554
+ ExtensionDetailMaxWidth: 1250,
4534
4555
  ExtensionDetailPaddingLeft: paddingLeft,
4535
4556
  ExtensionDetailPaddingRight: paddingRight,
4536
- ExtensionDetailSideBarWidth: sideBarWidth,
4537
- ExtensionDetailMaxWidth: 1250
4557
+ ExtensionDetailSideBarWidth: sideBarWidth
4538
4558
  });
4539
4559
  return ['Viewlet.setCss', uid, css];
4540
4560
  };
@@ -4543,21 +4563,21 @@ const getChangelogVirtualDom = changelogDom => {
4543
4563
  // const notImplemented = ExtensionDetailStrings.notImplemented()
4544
4564
  // TODO set tabpanel role
4545
4565
  return [{
4546
- type: Div,
4566
+ childCount: 1,
4547
4567
  className: Changelog$1,
4548
- childCount: 1
4568
+ type: Div
4549
4569
  }, ...changelogDom];
4550
4570
  };
4551
4571
 
4552
4572
  const getAdditionalDetailsEntryVirtualDom = (heading, items, renderer) => {
4553
4573
  return [{
4554
- type: Div,
4574
+ childCount: 2,
4555
4575
  className: AdditionalDetailsEntry,
4556
- childCount: 2
4576
+ type: Div
4557
4577
  }, {
4558
- type: Div,
4578
+ childCount: 1,
4559
4579
  className: AdditionalDetailsTitle,
4560
- childCount: 1
4580
+ type: Div
4561
4581
  }, text(heading), ...renderer(items)];
4562
4582
  };
4563
4583
 
@@ -4567,26 +4587,26 @@ const getCategoryVirtualDom = category => {
4567
4587
  label
4568
4588
  } = category;
4569
4589
  return [{
4570
- type: Button$1,
4571
- className: Category,
4572
4590
  childCount: 1,
4591
+ className: Category,
4592
+ name: id,
4573
4593
  onClick: HandleClickCategory,
4574
- name: id
4594
+ type: Button$1
4575
4595
  }, text(label)];
4576
4596
  };
4577
4597
 
4578
4598
  const getCategoriesDom = categories => {
4579
4599
  return [{
4580
- type: Div,
4600
+ childCount: categories.length,
4581
4601
  className: Categories,
4582
- childCount: categories.length
4602
+ type: Div
4583
4603
  }, ...categories.flatMap(getCategoryVirtualDom)];
4584
4604
  };
4585
4605
 
4586
4606
  const parentNode = {
4587
- type: Dt,
4607
+ childCount: 1,
4588
4608
  className: MoreInfoEntryKey,
4589
- childCount: 1
4609
+ type: Dt
4590
4610
  };
4591
4611
  const getMoreInfoEntryKeyVirtualDom = item => {
4592
4612
  const {
@@ -4629,32 +4649,32 @@ const getExtraProps = (title, onClick) => {
4629
4649
  };
4630
4650
  const getMoreInfoEntryValueVirtualDom = item => {
4631
4651
  const {
4632
- value,
4633
- onClick,
4634
4652
  code,
4635
- title
4653
+ onClick,
4654
+ title,
4655
+ value
4636
4656
  } = item;
4637
4657
  const type = getMoreInfoEntryValueTag(onClick, code);
4638
4658
  const className = getMoreInfoEntryValueClassName(onClick, code);
4639
4659
  const extraProps = getExtraProps(title, onClick);
4640
4660
  return [{
4641
- type,
4642
- className,
4643
4661
  childCount: 1,
4662
+ className,
4644
4663
  onClick,
4664
+ type,
4645
4665
  ...extraProps
4646
4666
  }, text(value)];
4647
4667
  };
4648
4668
 
4649
4669
  const parentNodeEven = {
4650
- type: Div,
4670
+ childCount: 2,
4651
4671
  className: MoreInfoEntry,
4652
- childCount: 2
4672
+ type: Div
4653
4673
  };
4654
4674
  const parentNodeOdd = {
4655
- type: Div,
4675
+ childCount: 2,
4656
4676
  className: mergeClassNames(MoreInfoEntry, MoreInfoEntryOdd),
4657
- childCount: 2
4677
+ type: Div
4658
4678
  };
4659
4679
  const getMoreInfoEntryVirtualDom = item => {
4660
4680
  const {
@@ -4666,9 +4686,9 @@ const getMoreInfoEntryVirtualDom = item => {
4666
4686
 
4667
4687
  const getMoreInfoVirtualDom = items => {
4668
4688
  return [{
4669
- type: Dl,
4689
+ childCount: items.length,
4670
4690
  className: MoreInfo,
4671
- childCount: items.length
4691
+ type: Dl
4672
4692
  }, ...items.flatMap(getMoreInfoEntryVirtualDom)];
4673
4693
  };
4674
4694
 
@@ -4677,38 +4697,38 @@ const getIconDom = icon => {
4677
4697
  return [];
4678
4698
  }
4679
4699
  return [{
4680
- type: Div,
4700
+ childCount: 1,
4681
4701
  className: ResourceIcon,
4682
- childCount: 1
4702
+ type: Div
4683
4703
  }, {
4684
- type: Div,
4704
+ childCount: 0,
4685
4705
  className: mergeClassNames(MaskIcon, `MaskIcon${icon}`),
4686
- childCount: 0
4706
+ type: Div
4687
4707
  }];
4688
4708
  };
4689
4709
  const getResourceLinkVirtualDom = resource => {
4690
4710
  const {
4711
+ icon,
4691
4712
  label,
4692
- url,
4693
- icon
4713
+ url
4694
4714
  } = resource;
4695
4715
  const iconDom = getIconDom(icon);
4696
4716
  const iconDomCount = iconDom.length > 0 ? 1 : 0;
4697
4717
  return [{
4698
- type: A,
4699
- className: Resource,
4700
4718
  childCount: 1 + iconDomCount,
4701
- target: '_blank',
4719
+ className: Resource,
4720
+ href: url,
4702
4721
  rel: 'noopener noreferrer',
4703
- href: url
4722
+ target: '_blank',
4723
+ type: A
4704
4724
  }, ...iconDom, text(label)];
4705
4725
  };
4706
4726
 
4707
4727
  const resourceNode = {
4708
- // TODO use link with url
4709
- type: Div,
4728
+ childCount: 1,
4710
4729
  className: Resource,
4711
- childCount: 1
4730
+ // TODO use link with url
4731
+ type: Div
4712
4732
  };
4713
4733
  const getResourceVirtualDom = resource => {
4714
4734
  const {
@@ -4723,9 +4743,9 @@ const getResourceVirtualDom = resource => {
4723
4743
 
4724
4744
  const getResourcesVirtualDom = resources => {
4725
4745
  return [{
4726
- type: Div,
4746
+ childCount: resources.length,
4727
4747
  className: Resources,
4728
- childCount: resources.length
4748
+ type: Div
4729
4749
  }, ...resources.flatMap(getResourceVirtualDom)];
4730
4750
  };
4731
4751
 
@@ -4734,23 +4754,23 @@ const getAdditionalDetailsVirtualDom = (showAdditionalDetails, firstHeading, ent
4734
4754
  return [];
4735
4755
  }
4736
4756
  return [{
4737
- type: Aside$1,
4757
+ childCount: 1,
4738
4758
  className: Aside,
4739
- childCount: 1
4759
+ type: Aside$1
4740
4760
  }, {
4741
- type: Div,
4761
+ childCount: 4,
4742
4762
  className: AdditionalDetails,
4763
+ onClick: HandleAdditionalDetailContextMenu,
4743
4764
  tabIndex: 0,
4744
- childCount: 4,
4745
- onClick: HandleAdditionalDetailContextMenu
4765
+ type: Div
4746
4766
  }, ...getAdditionalDetailsEntryVirtualDom(firstHeading, entries, getMoreInfoVirtualDom), ...getAdditionalDetailsEntryVirtualDom(secondHeading, secondEntries, getMoreInfoVirtualDom), ...getAdditionalDetailsEntryVirtualDom(thirdHeading, categories, getCategoriesDom), ...getAdditionalDetailsEntryVirtualDom(fourthHeading, resources, getResourcesVirtualDom)];
4747
4767
  };
4748
4768
 
4749
4769
  const getNoReadmeVirtualDom = () => {
4750
4770
  return [{
4751
- type: Div,
4752
4771
  childCount: 1,
4753
- className: Markdown
4772
+ className: Markdown,
4773
+ type: Div
4754
4774
  }, text(noReadmeFound())];
4755
4775
  };
4756
4776
 
@@ -4770,53 +4790,53 @@ const getDetailsVirtualDom = (sanitizedReadmeHtml, width, scrollToTopButtonEnabl
4770
4790
  const childCount = getChildCount(showAdditionalDetails);
4771
4791
  const contentDom = hasReadme ? sanitizedReadmeHtml : getNoReadmeVirtualDom();
4772
4792
  const dom = [{
4773
- type: Div,
4774
- className: ExtensionDetailPanel,
4775
4793
  childCount: childCount,
4776
- role: Panel
4794
+ className: ExtensionDetailPanel,
4795
+ role: Panel,
4796
+ type: Div
4777
4797
  }, ...contentDom, ...getAdditionalDetailsVirtualDom(showAdditionalDetails, firstHeading, installationEntries, secondHeading, marketplaceEntries, thirdHeading, categories$1, fourthHeading, resources$1)];
4778
4798
  return dom;
4779
4799
  };
4780
4800
 
4781
4801
  const getFeatureListItemVirtualDom = feature => {
4782
4802
  const {
4803
+ id,
4783
4804
  label,
4784
- selected,
4785
- id
4805
+ selected
4786
4806
  } = feature;
4787
4807
  const className = selected ? 'Feature FeatureSelected' : Feature;
4788
4808
  return [{
4789
- // TODO use role list item or tab
4790
- type: Button$1,
4791
- name: id,
4809
+ childCount: 1,
4792
4810
  className,
4793
- childCount: 1
4811
+ name: id,
4812
+ // TODO use role list item or tab
4813
+ type: Button$1
4794
4814
  }, text(label)];
4795
4815
  };
4796
4816
 
4797
4817
  const getFeatureListVirtualDom = features => {
4798
4818
  return [{
4799
- // TODO use either list or tabs role
4800
- type: Div,
4801
- className: FeaturesList,
4802
4819
  childCount: features.length,
4803
- onClick: HandleFeaturesClick
4820
+ className: FeaturesList,
4821
+ onClick: HandleFeaturesClick,
4822
+ // TODO use either list or tabs role
4823
+ type: Div
4804
4824
  }, ...features.flatMap(getFeatureListItemVirtualDom)];
4805
4825
  };
4806
4826
 
4807
4827
  const getFeaturesEmptyVirtualDom = () => {
4808
4828
  const none$1 = none();
4809
4829
  return [{
4810
- type: Div,
4830
+ childCount: 1,
4811
4831
  className: Features$1,
4812
- childCount: 1
4832
+ type: Div
4813
4833
  }, text(none$1)];
4814
4834
  };
4815
4835
 
4816
4836
  const sash = {
4817
- type: Div,
4837
+ childCount: 0,
4818
4838
  className: mergeClassNames(Sash, SashVertical),
4819
- childCount: 0
4839
+ type: Div
4820
4840
  };
4821
4841
  const getFeaturesVirtualDom = (features, selectedFeature, state) => {
4822
4842
  if (features.length === 0) {
@@ -4825,20 +4845,20 @@ const getFeaturesVirtualDom = (features, selectedFeature, state) => {
4825
4845
  const fn = getFeatureVirtualDomHandler(selectedFeature);
4826
4846
  const featureVirtualDom = fn(state);
4827
4847
  return [{
4828
- type: Div,
4848
+ childCount: 3,
4829
4849
  className: Features$1,
4830
- childCount: 3
4850
+ type: Div
4831
4851
  }, ...getFeatureListVirtualDom(features), sash, ...featureVirtualDom];
4832
4852
  };
4833
4853
 
4834
4854
  const getExtensionDetailContentVirtualDom = (sanitizedReadmeHtml, selectedTab, width, scrollToTopButtonEnabled, categories, resources, breakpoint, changelogDom, state) => {
4835
4855
  switch (selectedTab) {
4856
+ case Changelog:
4857
+ return getChangelogVirtualDom(changelogDom);
4836
4858
  case Details:
4837
4859
  return getDetailsVirtualDom(sanitizedReadmeHtml, width, scrollToTopButtonEnabled, categories, resources, breakpoint, state.installationEntries, state.marketplaceEntries, state.hasReadme, state.showSideBar);
4838
4860
  case Features:
4839
4861
  return getFeaturesVirtualDom(state.features, state.selectedFeature, state);
4840
- case Changelog:
4841
- return getChangelogVirtualDom(changelogDom);
4842
4862
  default:
4843
4863
  return [];
4844
4864
  }
@@ -4846,19 +4866,19 @@ const getExtensionDetailContentVirtualDom = (sanitizedReadmeHtml, selectedTab, w
4846
4866
 
4847
4867
  const getExtensionDetailDescriptionVirtualDom = description => {
4848
4868
  return [{
4849
- type: Div,
4869
+ childCount: 1,
4850
4870
  className: ExtensionDetailDescription,
4851
- childCount: 1
4871
+ type: Div
4852
4872
  }, text(description)];
4853
4873
  };
4854
4874
 
4855
4875
  const getButtonVirtualDom = (message, onClick, name) => {
4856
4876
  return [{
4857
- type: Button$1,
4877
+ childCount: 1,
4858
4878
  className: mergeClassNames(Button, ButtonPrimary),
4859
- onClick,
4860
4879
  name,
4861
- childCount: 1
4880
+ onClick,
4881
+ type: Button$1
4862
4882
  }, text(message)];
4863
4883
  };
4864
4884
 
@@ -4867,17 +4887,17 @@ const getSettingsButtonVirtualDom = enabled => {
4867
4887
  return [];
4868
4888
  }
4869
4889
  return [{
4870
- type: Button$1,
4890
+ childCount: 1,
4871
4891
  className: SettingsButton,
4892
+ name: Settings,
4872
4893
  onClick: HandleClickSettings,
4873
- childCount: 1,
4874
4894
  title: 'Settings',
4875
- name: Settings
4895
+ type: Button$1
4876
4896
  }, {
4877
- type: Span,
4878
- className: SettingsIcon,
4879
4897
  childCount: 0,
4880
- text: '⚙️'
4898
+ className: SettingsIcon,
4899
+ text: '⚙️',
4900
+ type: Span
4881
4901
  }];
4882
4902
  };
4883
4903
 
@@ -4886,22 +4906,22 @@ const getExtensionDetailHeaderActionsVirtualDom = (buttonDefs, settingsButtonEna
4886
4906
  const buttons = enabledButtons.flatMap(btn => getButtonVirtualDom(btn.label, btn.onClick, btn.name));
4887
4907
  const settingsButton = getSettingsButtonVirtualDom(settingsButtonEnabled);
4888
4908
  const dom = [{
4889
- type: Div,
4909
+ childCount: enabledButtons.length + settingsButton.length,
4890
4910
  className: ExtensionDetailHeaderActions,
4891
- childCount: enabledButtons.length + settingsButton.length
4911
+ type: Div
4892
4912
  }, ...buttons, ...settingsButton];
4893
4913
  return dom;
4894
4914
  };
4895
4915
 
4896
4916
  const getExtensionDetailIconVirtualDom = iconSrc => {
4897
4917
  return {
4898
- type: Img,
4899
- className: ExtensionDetailIcon,
4900
4918
  alt: '',
4901
4919
  childCount: 0,
4920
+ className: ExtensionDetailIcon,
4902
4921
  draggable: false,
4903
4922
  onContextMenu: HandleImageContextMenu,
4904
- src: iconSrc
4923
+ src: iconSrc,
4924
+ type: Img
4905
4925
  };
4906
4926
  };
4907
4927
 
@@ -4910,29 +4930,29 @@ const getNameBadgeVirtualDom = badge => {
4910
4930
  return [];
4911
4931
  }
4912
4932
  return [{
4913
- type: Span,
4933
+ childCount: 1,
4914
4934
  className: ExtensionDetailNameBadge,
4915
- childCount: 1
4935
+ type: Span
4916
4936
  }, text(badge)];
4917
4937
  };
4918
4938
 
4919
4939
  const getExtensionDetailNameVirtualDom = (name, badge) => {
4920
4940
  return [{
4921
- type: Div,
4941
+ childCount: badge ? 2 : 1,
4922
4942
  className: ExtensionDetailName,
4923
- childCount: badge ? 2 : 1
4943
+ type: Div
4924
4944
  }, text(name), ...getNameBadgeVirtualDom(badge)];
4925
4945
  };
4926
4946
 
4927
4947
  const getExtensionDetailHeaderVirtualDom = (name, iconSrc, description, badge, buttonDefs, settingsButtonEnabled) => {
4928
4948
  const dom = [{
4929
- type: Div,
4949
+ childCount: 2,
4930
4950
  className: ExtensionDetailHeader,
4931
- childCount: 2
4951
+ type: Div
4932
4952
  }, getExtensionDetailIconVirtualDom(iconSrc), {
4933
- type: Div,
4953
+ childCount: 3,
4934
4954
  className: ExtensionDetailHeaderDetails,
4935
- childCount: 3
4955
+ type: Div
4936
4956
  }, ...getExtensionDetailNameVirtualDom(name, badge), ...getExtensionDetailDescriptionVirtualDom(description), ...getExtensionDetailHeaderActionsVirtualDom(buttonDefs, settingsButtonEnabled)];
4937
4957
  return dom;
4938
4958
  };
@@ -4946,41 +4966,41 @@ const getTabClassName = isSelected => {
4946
4966
  const getTabVirtualDom = tab => {
4947
4967
  const {
4948
4968
  label,
4949
- selected,
4950
- name
4969
+ name,
4970
+ selected
4951
4971
  } = tab;
4952
4972
  const className = getTabClassName(selected);
4953
4973
  const ariaSelected = selected;
4954
4974
  return [{
4955
- type: Button$1,
4956
- role: Tab,
4957
- name,
4958
- className,
4975
+ ariaSelected,
4959
4976
  childCount: 1,
4977
+ className,
4978
+ name,
4979
+ role: Tab,
4960
4980
  tabIndex: -1,
4961
- ariaSelected
4981
+ type: Button$1
4962
4982
  }, text(label)];
4963
4983
  };
4964
4984
 
4965
4985
  const getTabsVirtualDom = tabs => {
4966
4986
  return [{
4967
- type: Div,
4968
- className: ExtensionDetailTabs,
4969
4987
  childCount: tabs.length,
4970
- role: TabList,
4988
+ className: ExtensionDetailTabs,
4971
4989
  onClick: HandleTabsClick,
4972
- tabIndex: 0
4990
+ role: TabList,
4991
+ tabIndex: 0,
4992
+ type: Div
4973
4993
  }, ...tabs.flatMap(getTabVirtualDom)];
4974
4994
  };
4975
4995
 
4976
4996
  const getClassNames = size => {
4977
4997
  switch (size) {
4978
- case Small:
4979
- return Small$1;
4980
- case Normal:
4981
- return Normal$1;
4982
4998
  case Large:
4983
4999
  return Large$1;
5000
+ case Normal:
5001
+ return Normal$1;
5002
+ case Small:
5003
+ return Small$1;
4984
5004
  default:
4985
5005
  return '';
4986
5006
  }
@@ -5011,9 +5031,9 @@ const getExtensionDetailVirtualDom = (newState, selectedTab) => {
5011
5031
  const width = newState?.width || 500;
5012
5032
  const sizeClass = getClassNames(sizeValue);
5013
5033
  const dom = [{
5014
- type: Div,
5034
+ childCount: 3,
5015
5035
  className: mergeClassNames(Viewlet, ExtensionDetail, sizeClass),
5016
- childCount: 3
5036
+ type: Div
5017
5037
  }, ...getExtensionDetailHeaderVirtualDom(name, iconSrc, description, badge, buttons, settingsButtonEnabled), ...getTabsVirtualDom(tabs), ...getExtensionDetailContentVirtualDom(detailsVirtualDom, selectedTab, width, scrollToTopButtonEnabled, categories, resources, showAdditionalDetailsBreakpoint, changelogVirtualDom, newState)];
5018
5038
  return dom;
5019
5039
  };
@@ -5040,10 +5060,10 @@ const renderScrollTop = (oldState, newState) => {
5040
5060
  const selector = '.ExtensionDetailPanel .Markdown';
5041
5061
  const property = 'scrollTop';
5042
5062
  const {
5043
- uid,
5044
- readmeScrollTop,
5045
5063
  changelogScrollTop,
5046
- selectedTab
5064
+ readmeScrollTop,
5065
+ selectedTab,
5066
+ uid
5047
5067
  } = newState;
5048
5068
  const scrollTop = getScrollTop(selectedTab, readmeScrollTop, changelogScrollTop);
5049
5069
  if (scrollTop === -1) {
@@ -5054,14 +5074,14 @@ const renderScrollTop = (oldState, newState) => {
5054
5074
 
5055
5075
  const getRenderer = diffType => {
5056
5076
  switch (diffType) {
5057
- case RenderItems:
5058
- return renderDom;
5077
+ case RenderCss:
5078
+ return renderCss;
5059
5079
  case RenderFocus:
5060
5080
  return renderFocus;
5081
+ case RenderItems:
5082
+ return renderDom;
5061
5083
  case RenderScrollTop:
5062
5084
  return renderScrollTop;
5063
- case RenderCss:
5064
- return renderCss;
5065
5085
  default:
5066
5086
  throw new Error('unknown renderer');
5067
5087
  }
@@ -5081,15 +5101,14 @@ const applyRender = (oldState, newState, diffResult) => {
5081
5101
 
5082
5102
  const render2 = (uid, diffResult) => {
5083
5103
  const {
5084
- oldState,
5085
- newState
5104
+ newState,
5105
+ oldState
5086
5106
  } = get(uid);
5087
5107
  set(uid, newState, newState);
5088
5108
  const commands = applyRender(oldState, newState, diffResult);
5089
5109
  return commands;
5090
5110
  };
5091
5111
 
5092
- // @ts-nocheck
5093
5112
  const renderEventListeners = () => {
5094
5113
  return [{
5095
5114
  name: HandleAdditionalDetailContextMenu,
@@ -5154,25 +5173,25 @@ const resize = (state, dimensions) => {
5154
5173
  return {
5155
5174
  ...state,
5156
5175
  ...dimensions,
5157
- showSideBar,
5158
5176
  paddingLeft: padding,
5159
5177
  paddingRight: padding,
5178
+ showSideBar,
5160
5179
  sideBarWidth
5161
5180
  };
5162
5181
  };
5163
5182
 
5164
5183
  const saveState = state => {
5165
5184
  const {
5166
- selectedTab,
5167
- selectedFeature,
5185
+ changelogScrollTop,
5168
5186
  readmeScrollTop,
5169
- changelogScrollTop
5187
+ selectedFeature,
5188
+ selectedTab
5170
5189
  } = state;
5171
5190
  return {
5172
- selectedTab,
5173
- selectedFeature,
5191
+ changelogScrollTop,
5174
5192
  readmeScrollTop,
5175
- changelogScrollTop
5193
+ selectedFeature,
5194
+ selectedTab
5176
5195
  };
5177
5196
  };
5178
5197