@lvce-editor/extension-detail-view 5.7.0 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensionDetailViewWorkerMain.js +474 -472
- package/package.json +2 -2
|
@@ -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
|
-
|
|
277
|
-
|
|
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
|
-
|
|
414
|
-
|
|
413
|
+
childCount: 1,
|
|
414
|
+
type: Li
|
|
415
415
|
};
|
|
416
416
|
const code = {
|
|
417
|
-
|
|
418
|
-
|
|
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
|
-
|
|
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
|
-
|
|
440
|
-
|
|
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
|
-
|
|
447
|
+
childCount: 2,
|
|
448
448
|
className: FeatureContent,
|
|
449
|
-
|
|
449
|
+
type: Div
|
|
450
450
|
}, ...getFeatureContentHeadingVirtualDom(heading), {
|
|
451
|
-
|
|
452
|
-
|
|
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
|
-
|
|
509
|
+
childCount: 2,
|
|
510
510
|
className: FeatureContent,
|
|
511
|
-
|
|
511
|
+
type: Div
|
|
512
512
|
}, ...getFeatureContentHeadingVirtualDom(heading), {
|
|
513
|
-
|
|
514
|
-
|
|
513
|
+
childCount: 1,
|
|
514
|
+
type: P
|
|
515
515
|
}, text(emptyCommandsArray$1)];
|
|
516
516
|
};
|
|
517
517
|
|
|
518
518
|
const getTableHeadingVirtualDom = heading => {
|
|
519
519
|
return [{
|
|
520
|
-
|
|
520
|
+
childCount: 1,
|
|
521
521
|
className: TableHeading,
|
|
522
|
-
|
|
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
|
-
|
|
538
|
+
childCount: 1,
|
|
539
539
|
className: TableCell,
|
|
540
|
-
|
|
540
|
+
type: Td
|
|
541
541
|
}, text(checkedText)];
|
|
542
542
|
};
|
|
543
543
|
|
|
544
544
|
const getListItemDom = item => {
|
|
545
545
|
return [{
|
|
546
|
-
|
|
547
|
-
|
|
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
|
-
|
|
555
|
+
childCount: listItems.length,
|
|
556
556
|
className: TableCell,
|
|
557
|
-
|
|
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
|
-
|
|
572
|
-
|
|
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
|
-
|
|
592
|
+
childCount: 1,
|
|
593
593
|
className: Link$1,
|
|
594
594
|
href: props?.href,
|
|
595
|
-
|
|
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
|
|
622
|
-
return
|
|
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
|
-
|
|
641
|
-
|
|
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
|
-
|
|
651
|
+
childCount: 2,
|
|
652
652
|
className: Table,
|
|
653
|
-
|
|
653
|
+
type: Table$1
|
|
654
654
|
}, {
|
|
655
|
-
|
|
656
|
-
|
|
655
|
+
childCount: 1,
|
|
656
|
+
type: THead
|
|
657
657
|
}, {
|
|
658
|
-
|
|
659
|
-
|
|
658
|
+
childCount: headings.length,
|
|
659
|
+
type: Tr
|
|
660
660
|
}, ...headings.flatMap(getTableHeadingVirtualDom), {
|
|
661
|
-
|
|
662
|
-
|
|
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
|
-
|
|
674
|
+
childCount: 2,
|
|
675
675
|
className: FeatureContent,
|
|
676
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
887
|
+
childCount: 2,
|
|
888
888
|
className: FeatureContent,
|
|
889
|
-
|
|
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
|
-
|
|
965
|
+
childCount: 2,
|
|
966
966
|
className: FeatureContent,
|
|
967
|
-
|
|
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
|
-
|
|
988
|
-
|
|
987
|
+
childCount: 2,
|
|
988
|
+
type: Div
|
|
989
989
|
}, {
|
|
990
|
-
|
|
991
|
-
|
|
990
|
+
childCount: 1,
|
|
991
|
+
type: H1
|
|
992
992
|
}, text(unsupportedFeature()), {
|
|
993
|
-
|
|
994
|
-
|
|
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
|
-
|
|
2322
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2368
|
-
|
|
2368
|
+
childCount: 1,
|
|
2369
|
+
type: Dt
|
|
2369
2370
|
}, text(importTime()), {
|
|
2370
|
-
|
|
2371
|
-
|
|
2371
|
+
childCount: 1,
|
|
2372
|
+
type: Dd
|
|
2372
2373
|
}, text(formattedImportTime), {
|
|
2373
|
-
|
|
2374
|
-
|
|
2374
|
+
childCount: 1,
|
|
2375
|
+
type: Dt
|
|
2375
2376
|
}, text(activationTime()), {
|
|
2376
|
-
|
|
2377
|
-
|
|
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
|
-
|
|
2411
|
+
childCount: 1,
|
|
2411
2412
|
className: 'RuntimeStatusDefinitionListValue',
|
|
2412
|
-
|
|
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
|
-
|
|
2438
|
+
childCount: 2,
|
|
2438
2439
|
className: FeatureContent,
|
|
2439
|
-
|
|
2440
|
+
type: Div
|
|
2440
2441
|
}, ...getFeatureContentHeadingVirtualDom(heading), {
|
|
2441
|
-
|
|
2442
|
+
childCount,
|
|
2442
2443
|
className: 'RuntimeStatusDefinitionList',
|
|
2443
|
-
|
|
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
|
-
|
|
2491
|
+
childCount: 2,
|
|
2491
2492
|
className: FeatureContent,
|
|
2492
|
-
|
|
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
|
-
|
|
2538
|
-
className: ScrollToTopButton,
|
|
2538
|
+
ariaLabel: scrollToTop(),
|
|
2539
2539
|
childCount: 1,
|
|
2540
|
+
className: ScrollToTopButton,
|
|
2541
|
+
name: ScrollToTop,
|
|
2540
2542
|
onClick: HandleClickScrollToTop,
|
|
2541
|
-
|
|
2542
|
-
name: ScrollToTop
|
|
2543
|
+
type: Button$1
|
|
2543
2544
|
}, {
|
|
2544
|
-
type: Div,
|
|
2545
|
-
className: mergeClassNames(MaskIcon, MaskIconChevronUp),
|
|
2546
2545
|
childCount: 0,
|
|
2547
|
-
|
|
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
|
|
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
|
-
|
|
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-
|
|
2688
|
-
'Content-
|
|
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
|
-
|
|
2770
|
+
childCount: 2,
|
|
2770
2771
|
className: FeatureContent,
|
|
2771
|
-
|
|
2772
|
+
type: Div
|
|
2772
2773
|
}, ...getFeatureContentHeadingVirtualDom(heading), {
|
|
2773
|
-
|
|
2774
|
+
childCount,
|
|
2774
2775
|
className: DefaultMarkdown,
|
|
2775
|
-
|
|
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
|
-
|
|
2819
|
+
childCount: 1,
|
|
2819
2820
|
className: DefinitionListItemHeading,
|
|
2820
|
-
|
|
2821
|
+
type: H2
|
|
2821
2822
|
};
|
|
2822
2823
|
const pre = {
|
|
2823
|
-
|
|
2824
|
+
childCount: 1,
|
|
2824
2825
|
className: DefinitionListItemValue,
|
|
2825
|
-
|
|
2826
|
+
type: Pre
|
|
2826
2827
|
};
|
|
2827
2828
|
const item = {
|
|
2828
|
-
|
|
2829
|
+
childCount: 2,
|
|
2829
2830
|
className: DefinitionListItem,
|
|
2830
|
-
|
|
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
|
-
|
|
2845
|
+
childCount: 4,
|
|
2845
2846
|
className: FeatureWebView,
|
|
2846
|
-
|
|
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
|
-
|
|
2854
|
+
childCount: 2,
|
|
2854
2855
|
className: FeatureContent,
|
|
2855
|
-
|
|
2856
|
+
type: Div
|
|
2856
2857
|
}, ...getFeatureContentHeadingVirtualDom(heading), {
|
|
2857
|
-
|
|
2858
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3169
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3214
|
-
label: copy$1(),
|
|
3215
|
-
flags: None$2,
|
|
3216
|
+
args: [],
|
|
3216
3217
|
command: 'ExtensionDetail.executeCopy',
|
|
3217
|
-
|
|
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
|
-
|
|
3225
|
-
label: copy$1(),
|
|
3227
|
+
command: 'ClipBoard.execCopy',
|
|
3226
3228
|
flags: None,
|
|
3227
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3255
|
-
label: openInNewTab(),
|
|
3256
|
-
flags: None,
|
|
3257
|
+
args: [props.url || ''],
|
|
3257
3258
|
command: 'Open.openUrl',
|
|
3258
|
-
|
|
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
|
-
|
|
3271
|
-
label: copy$1(),
|
|
3272
|
-
flags: None$2,
|
|
3273
|
+
args: [],
|
|
3273
3274
|
command: 'ExtensionDetail.copyReadmeText',
|
|
3274
|
-
|
|
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
|
-
|
|
3281
|
-
|
|
3283
|
+
entries: getMenuEntriesReadme(),
|
|
3284
|
+
id: ExtensionDetailReadme
|
|
3282
3285
|
}, {
|
|
3283
|
-
id: ExtensionDetailIconContextMenu$1,
|
|
3284
3286
|
entries: [{
|
|
3285
|
-
|
|
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
|
-
|
|
3295
|
-
|
|
3290
|
+
id: 'openImageInNewTab',
|
|
3291
|
+
label: openImageInNewTab$1()
|
|
3296
3292
|
}, {
|
|
3297
|
-
|
|
3298
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3371
|
+
label: setColorTheme$2(),
|
|
3372
|
+
name: SetColorTheme,
|
|
3373
|
+
onClick: HandleClickSetColorTheme
|
|
3371
3374
|
}, {
|
|
3372
|
-
label: enable(),
|
|
3373
|
-
onClick: HandleClickEnable,
|
|
3374
3375
|
enabled: isDisabled,
|
|
3375
|
-
|
|
3376
|
+
label: enable(),
|
|
3377
|
+
name: Enable,
|
|
3378
|
+
onClick: HandleClickEnable
|
|
3376
3379
|
}, {
|
|
3377
|
-
label: disable(),
|
|
3378
|
-
onClick: HandleClickDisable,
|
|
3379
3380
|
enabled: !isDisabled,
|
|
3380
|
-
|
|
3381
|
+
label: disable(),
|
|
3382
|
+
name: Disable,
|
|
3383
|
+
onClick: HandleClickDisable
|
|
3381
3384
|
}, {
|
|
3382
|
-
label: uninstall(),
|
|
3383
|
-
onClick: HandleClickUninstall,
|
|
3384
3385
|
enabled: !isBuiltin,
|
|
3385
|
-
|
|
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
|
-
|
|
3395
|
-
|
|
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
|
-
|
|
3407
|
-
|
|
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
|
-
|
|
3451
|
-
|
|
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
|
-
|
|
3540
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3724
|
+
extension,
|
|
3723
3725
|
features,
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
+
locationProtocol,
|
|
3727
|
+
selectedFeature,
|
|
3728
|
+
tabs
|
|
3726
3729
|
} = state;
|
|
3727
3730
|
if (features.length === 0) {
|
|
3728
3731
|
return state;
|
|
@@ -3738,8 +3741,8 @@ const selectTabFeatures = async state => {
|
|
|
3738
3741
|
});
|
|
3739
3742
|
return {
|
|
3740
3743
|
...state,
|
|
3741
|
-
selectedTab: Features,
|
|
3742
3744
|
selectedFeature: features[0].id || '',
|
|
3745
|
+
selectedTab: Features,
|
|
3743
3746
|
tabs: newTabs,
|
|
3744
3747
|
...partialNewState
|
|
3745
3748
|
};
|
|
@@ -3747,12 +3750,12 @@ const selectTabFeatures = async state => {
|
|
|
3747
3750
|
|
|
3748
3751
|
const getSelectTabHandler = name => {
|
|
3749
3752
|
switch (name) {
|
|
3753
|
+
case Changelog:
|
|
3754
|
+
return selectTabChangelog;
|
|
3750
3755
|
case Details:
|
|
3751
3756
|
return selectTabDetails;
|
|
3752
3757
|
case Features:
|
|
3753
3758
|
return selectTabFeatures;
|
|
3754
|
-
case Changelog:
|
|
3755
|
-
return selectTabChangelog;
|
|
3756
3759
|
default:
|
|
3757
3760
|
return selectTabDefault;
|
|
3758
3761
|
}
|
|
@@ -3773,27 +3776,26 @@ const getSizeEntries = (showSizeLink, displaySize, extensionUri) => {
|
|
|
3773
3776
|
}
|
|
3774
3777
|
return [{
|
|
3775
3778
|
key: size(),
|
|
3776
|
-
value: displaySize,
|
|
3777
3779
|
onClick: HandleClickSize,
|
|
3778
|
-
title: extensionUri
|
|
3780
|
+
title: extensionUri,
|
|
3781
|
+
value: displaySize
|
|
3779
3782
|
}];
|
|
3780
3783
|
};
|
|
3781
3784
|
|
|
3782
3785
|
const getInstallationEntries = (displaySize, extensionId, extensionVersion, extensionUri, showSizeLink) => {
|
|
3783
3786
|
const entries = [{
|
|
3787
|
+
code: true,
|
|
3784
3788
|
key: identifier(),
|
|
3785
|
-
value: extensionId,
|
|
3786
3789
|
odd: true,
|
|
3787
|
-
|
|
3790
|
+
value: extensionId
|
|
3788
3791
|
}, {
|
|
3792
|
+
code: true,
|
|
3789
3793
|
key: version(),
|
|
3790
|
-
value: extensionVersion
|
|
3791
|
-
code: true
|
|
3794
|
+
value: extensionVersion
|
|
3792
3795
|
}, {
|
|
3793
3796
|
key: lastUpdated(),
|
|
3794
|
-
|
|
3795
|
-
// TODO get this from somewhere
|
|
3796
|
-
odd: true
|
|
3797
|
+
odd: true,
|
|
3798
|
+
value: 'n/a' // TODO get this from somewhere
|
|
3797
3799
|
}, ...getSizeEntries(showSizeLink, displaySize, extensionUri)];
|
|
3798
3800
|
return entries;
|
|
3799
3801
|
};
|
|
@@ -3802,8 +3804,8 @@ const hideSizeLink = state => {
|
|
|
3802
3804
|
const {
|
|
3803
3805
|
displaySize,
|
|
3804
3806
|
extensionId,
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
+
extensionUri,
|
|
3808
|
+
extensionVersion
|
|
3807
3809
|
} = state;
|
|
3808
3810
|
const newShowSizeLink = false;
|
|
3809
3811
|
const installationEntries = getInstallationEntries(displaySize, extensionId, extensionVersion, extensionUri, newShowSizeLink);
|
|
@@ -3904,8 +3906,8 @@ const getRemoteSrc = uri => {
|
|
|
3904
3906
|
|
|
3905
3907
|
const getBaseUrl = (extensionPath, platform) => {
|
|
3906
3908
|
switch (platform) {
|
|
3907
|
-
case Remote:
|
|
3908
3909
|
case Electron:
|
|
3910
|
+
case Remote:
|
|
3909
3911
|
return getRemoteSrc(extensionPath + '/');
|
|
3910
3912
|
default:
|
|
3911
3913
|
return extensionPath;
|
|
@@ -3951,20 +3953,20 @@ const getSideBarWidth = width => {
|
|
|
3951
3953
|
|
|
3952
3954
|
const getTabs = (selectedTab, hasReadme, hasFeatures, hasChangelog) => {
|
|
3953
3955
|
const tabs = [{
|
|
3956
|
+
enabled: hasReadme,
|
|
3954
3957
|
label: details(),
|
|
3955
3958
|
name: Details,
|
|
3956
|
-
selected: selectedTab === Details
|
|
3957
|
-
enabled: hasReadme
|
|
3959
|
+
selected: selectedTab === Details
|
|
3958
3960
|
}, {
|
|
3961
|
+
enabled: hasFeatures,
|
|
3959
3962
|
label: features$1(),
|
|
3960
3963
|
name: Features,
|
|
3961
|
-
selected: selectedTab === Features
|
|
3962
|
-
enabled: hasFeatures
|
|
3964
|
+
selected: selectedTab === Features
|
|
3963
3965
|
}, {
|
|
3966
|
+
enabled: hasChangelog,
|
|
3964
3967
|
label: changelog(),
|
|
3965
3968
|
name: Changelog,
|
|
3966
|
-
selected: selectedTab === Changelog
|
|
3967
|
-
enabled: hasChangelog
|
|
3969
|
+
selected: selectedTab === Changelog
|
|
3968
3970
|
}];
|
|
3969
3971
|
return tabs;
|
|
3970
3972
|
};
|
|
@@ -4271,8 +4273,8 @@ const getMarketplaceEntries = isBuiltin => {
|
|
|
4271
4273
|
}
|
|
4272
4274
|
return [{
|
|
4273
4275
|
key: published(),
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
+
odd: true,
|
|
4277
|
+
value: 'n/a'
|
|
4276
4278
|
}, {
|
|
4277
4279
|
key: lastReleased(),
|
|
4278
4280
|
value: 'n/a'
|
|
@@ -4314,21 +4316,21 @@ const getResources = (isBuiltin, extension) => {
|
|
|
4314
4316
|
const licenseLink = getLicenseLink();
|
|
4315
4317
|
// TODO
|
|
4316
4318
|
return [{
|
|
4319
|
+
icon: 'LinkExternal',
|
|
4317
4320
|
label: marketplace(),
|
|
4318
|
-
url: '#'
|
|
4319
|
-
icon: 'LinkExternal'
|
|
4321
|
+
url: '#'
|
|
4320
4322
|
}, {
|
|
4323
|
+
icon: 'LinkExternal',
|
|
4321
4324
|
label: issues(),
|
|
4322
|
-
url: '#'
|
|
4323
|
-
icon: 'LinkExternal'
|
|
4325
|
+
url: '#'
|
|
4324
4326
|
}, {
|
|
4327
|
+
icon: 'Repo',
|
|
4325
4328
|
label: repository(),
|
|
4326
|
-
url: repositoryLink
|
|
4327
|
-
icon: 'Repo'
|
|
4329
|
+
url: repositoryLink
|
|
4328
4330
|
}, {
|
|
4331
|
+
icon: 'LinkExternal',
|
|
4329
4332
|
label: license(),
|
|
4330
|
-
url: licenseLink
|
|
4331
|
-
icon: 'LinkExternal'
|
|
4333
|
+
url: licenseLink
|
|
4332
4334
|
}];
|
|
4333
4335
|
};
|
|
4334
4336
|
|
|
@@ -4383,10 +4385,10 @@ const restoreState = savedState => {
|
|
|
4383
4385
|
const readmeScrollTop = getSavedReadmeScrollTop(savedState);
|
|
4384
4386
|
const changelogScrollTop = getSavedChangelogScrollTop(savedState);
|
|
4385
4387
|
return {
|
|
4386
|
-
|
|
4387
|
-
selectedTab,
|
|
4388
|
+
changelogScrollTop,
|
|
4388
4389
|
readmeScrollTop,
|
|
4389
|
-
|
|
4390
|
+
selectedFeature,
|
|
4391
|
+
selectedTab
|
|
4390
4392
|
};
|
|
4391
4393
|
};
|
|
4392
4394
|
|
|
@@ -4395,8 +4397,8 @@ const loadContent = async (state, platform, savedState, isTest = false) => {
|
|
|
4395
4397
|
savedState = undefined;
|
|
4396
4398
|
}
|
|
4397
4399
|
const {
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
+
uri,
|
|
4401
|
+
width
|
|
4400
4402
|
} = state;
|
|
4401
4403
|
const id = getExtensionIdFromUri(uri);
|
|
4402
4404
|
const extension = await getExtension(id, platform);
|
|
@@ -4435,10 +4437,10 @@ const loadContent = async (state, platform, savedState, isTest = false) => {
|
|
|
4435
4437
|
const buttons = getExtensionDetailButtons(hasColorTheme, isBuiltin, disabled);
|
|
4436
4438
|
const size = getViewletSize(width);
|
|
4437
4439
|
const {
|
|
4438
|
-
|
|
4439
|
-
selectedTab,
|
|
4440
|
+
changelogScrollTop,
|
|
4440
4441
|
readmeScrollTop,
|
|
4441
|
-
|
|
4442
|
+
selectedFeature,
|
|
4443
|
+
selectedTab
|
|
4442
4444
|
} = restoreState(savedState);
|
|
4443
4445
|
const features = getFeatures(selectedFeature || Theme, extension);
|
|
4444
4446
|
const hasFeatures = features.length > 0;
|
|
@@ -4447,12 +4449,12 @@ const loadContent = async (state, platform, savedState, isTest = false) => {
|
|
|
4447
4449
|
const sizeValue = getViewletSize(width || 0);
|
|
4448
4450
|
const showSizeLink = platform !== Web$1;
|
|
4449
4451
|
const {
|
|
4452
|
+
categories,
|
|
4453
|
+
displaySize,
|
|
4454
|
+
folderSize,
|
|
4450
4455
|
installationEntries,
|
|
4451
4456
|
marketplaceEntries,
|
|
4452
|
-
|
|
4453
|
-
categories,
|
|
4454
|
-
resources,
|
|
4455
|
-
folderSize
|
|
4457
|
+
resources
|
|
4456
4458
|
} = await loadSideBarContent(extensionId, extensionVersion, extensionUri, isBuiltin, extension, showSizeLink);
|
|
4457
4459
|
const padding = getPadding(width);
|
|
4458
4460
|
const sideBarWidth = getSideBarWidth(width);
|
|
@@ -4525,16 +4527,16 @@ const createCss = object => {
|
|
|
4525
4527
|
|
|
4526
4528
|
const renderCss = (oldState, newState) => {
|
|
4527
4529
|
const {
|
|
4528
|
-
uid,
|
|
4529
4530
|
paddingLeft,
|
|
4530
4531
|
paddingRight,
|
|
4531
|
-
sideBarWidth
|
|
4532
|
+
sideBarWidth,
|
|
4533
|
+
uid
|
|
4532
4534
|
} = newState;
|
|
4533
4535
|
const css = createCss({
|
|
4536
|
+
ExtensionDetailMaxWidth: 1250,
|
|
4534
4537
|
ExtensionDetailPaddingLeft: paddingLeft,
|
|
4535
4538
|
ExtensionDetailPaddingRight: paddingRight,
|
|
4536
|
-
ExtensionDetailSideBarWidth: sideBarWidth
|
|
4537
|
-
ExtensionDetailMaxWidth: 1250
|
|
4539
|
+
ExtensionDetailSideBarWidth: sideBarWidth
|
|
4538
4540
|
});
|
|
4539
4541
|
return ['Viewlet.setCss', uid, css];
|
|
4540
4542
|
};
|
|
@@ -4543,21 +4545,21 @@ const getChangelogVirtualDom = changelogDom => {
|
|
|
4543
4545
|
// const notImplemented = ExtensionDetailStrings.notImplemented()
|
|
4544
4546
|
// TODO set tabpanel role
|
|
4545
4547
|
return [{
|
|
4546
|
-
|
|
4548
|
+
childCount: 1,
|
|
4547
4549
|
className: Changelog$1,
|
|
4548
|
-
|
|
4550
|
+
type: Div
|
|
4549
4551
|
}, ...changelogDom];
|
|
4550
4552
|
};
|
|
4551
4553
|
|
|
4552
4554
|
const getAdditionalDetailsEntryVirtualDom = (heading, items, renderer) => {
|
|
4553
4555
|
return [{
|
|
4554
|
-
|
|
4556
|
+
childCount: 2,
|
|
4555
4557
|
className: AdditionalDetailsEntry,
|
|
4556
|
-
|
|
4558
|
+
type: Div
|
|
4557
4559
|
}, {
|
|
4558
|
-
|
|
4560
|
+
childCount: 1,
|
|
4559
4561
|
className: AdditionalDetailsTitle,
|
|
4560
|
-
|
|
4562
|
+
type: Div
|
|
4561
4563
|
}, text(heading), ...renderer(items)];
|
|
4562
4564
|
};
|
|
4563
4565
|
|
|
@@ -4567,26 +4569,26 @@ const getCategoryVirtualDom = category => {
|
|
|
4567
4569
|
label
|
|
4568
4570
|
} = category;
|
|
4569
4571
|
return [{
|
|
4570
|
-
type: Button$1,
|
|
4571
|
-
className: Category,
|
|
4572
4572
|
childCount: 1,
|
|
4573
|
+
className: Category,
|
|
4574
|
+
name: id,
|
|
4573
4575
|
onClick: HandleClickCategory,
|
|
4574
|
-
|
|
4576
|
+
type: Button$1
|
|
4575
4577
|
}, text(label)];
|
|
4576
4578
|
};
|
|
4577
4579
|
|
|
4578
4580
|
const getCategoriesDom = categories => {
|
|
4579
4581
|
return [{
|
|
4580
|
-
|
|
4582
|
+
childCount: categories.length,
|
|
4581
4583
|
className: Categories,
|
|
4582
|
-
|
|
4584
|
+
type: Div
|
|
4583
4585
|
}, ...categories.flatMap(getCategoryVirtualDom)];
|
|
4584
4586
|
};
|
|
4585
4587
|
|
|
4586
4588
|
const parentNode = {
|
|
4587
|
-
|
|
4589
|
+
childCount: 1,
|
|
4588
4590
|
className: MoreInfoEntryKey,
|
|
4589
|
-
|
|
4591
|
+
type: Dt
|
|
4590
4592
|
};
|
|
4591
4593
|
const getMoreInfoEntryKeyVirtualDom = item => {
|
|
4592
4594
|
const {
|
|
@@ -4629,32 +4631,32 @@ const getExtraProps = (title, onClick) => {
|
|
|
4629
4631
|
};
|
|
4630
4632
|
const getMoreInfoEntryValueVirtualDom = item => {
|
|
4631
4633
|
const {
|
|
4632
|
-
value,
|
|
4633
|
-
onClick,
|
|
4634
4634
|
code,
|
|
4635
|
-
|
|
4635
|
+
onClick,
|
|
4636
|
+
title,
|
|
4637
|
+
value
|
|
4636
4638
|
} = item;
|
|
4637
4639
|
const type = getMoreInfoEntryValueTag(onClick, code);
|
|
4638
4640
|
const className = getMoreInfoEntryValueClassName(onClick, code);
|
|
4639
4641
|
const extraProps = getExtraProps(title, onClick);
|
|
4640
4642
|
return [{
|
|
4641
|
-
type,
|
|
4642
|
-
className,
|
|
4643
4643
|
childCount: 1,
|
|
4644
|
+
className,
|
|
4644
4645
|
onClick,
|
|
4646
|
+
type,
|
|
4645
4647
|
...extraProps
|
|
4646
4648
|
}, text(value)];
|
|
4647
4649
|
};
|
|
4648
4650
|
|
|
4649
4651
|
const parentNodeEven = {
|
|
4650
|
-
|
|
4652
|
+
childCount: 2,
|
|
4651
4653
|
className: MoreInfoEntry,
|
|
4652
|
-
|
|
4654
|
+
type: Div
|
|
4653
4655
|
};
|
|
4654
4656
|
const parentNodeOdd = {
|
|
4655
|
-
|
|
4657
|
+
childCount: 2,
|
|
4656
4658
|
className: mergeClassNames(MoreInfoEntry, MoreInfoEntryOdd),
|
|
4657
|
-
|
|
4659
|
+
type: Div
|
|
4658
4660
|
};
|
|
4659
4661
|
const getMoreInfoEntryVirtualDom = item => {
|
|
4660
4662
|
const {
|
|
@@ -4666,9 +4668,9 @@ const getMoreInfoEntryVirtualDom = item => {
|
|
|
4666
4668
|
|
|
4667
4669
|
const getMoreInfoVirtualDom = items => {
|
|
4668
4670
|
return [{
|
|
4669
|
-
|
|
4671
|
+
childCount: items.length,
|
|
4670
4672
|
className: MoreInfo,
|
|
4671
|
-
|
|
4673
|
+
type: Dl
|
|
4672
4674
|
}, ...items.flatMap(getMoreInfoEntryVirtualDom)];
|
|
4673
4675
|
};
|
|
4674
4676
|
|
|
@@ -4677,38 +4679,38 @@ const getIconDom = icon => {
|
|
|
4677
4679
|
return [];
|
|
4678
4680
|
}
|
|
4679
4681
|
return [{
|
|
4680
|
-
|
|
4682
|
+
childCount: 1,
|
|
4681
4683
|
className: ResourceIcon,
|
|
4682
|
-
|
|
4684
|
+
type: Div
|
|
4683
4685
|
}, {
|
|
4684
|
-
|
|
4686
|
+
childCount: 0,
|
|
4685
4687
|
className: mergeClassNames(MaskIcon, `MaskIcon${icon}`),
|
|
4686
|
-
|
|
4688
|
+
type: Div
|
|
4687
4689
|
}];
|
|
4688
4690
|
};
|
|
4689
4691
|
const getResourceLinkVirtualDom = resource => {
|
|
4690
4692
|
const {
|
|
4693
|
+
icon,
|
|
4691
4694
|
label,
|
|
4692
|
-
url
|
|
4693
|
-
icon
|
|
4695
|
+
url
|
|
4694
4696
|
} = resource;
|
|
4695
4697
|
const iconDom = getIconDom(icon);
|
|
4696
4698
|
const iconDomCount = iconDom.length > 0 ? 1 : 0;
|
|
4697
4699
|
return [{
|
|
4698
|
-
type: A,
|
|
4699
|
-
className: Resource,
|
|
4700
4700
|
childCount: 1 + iconDomCount,
|
|
4701
|
-
|
|
4701
|
+
className: Resource,
|
|
4702
|
+
href: url,
|
|
4702
4703
|
rel: 'noopener noreferrer',
|
|
4703
|
-
|
|
4704
|
+
target: '_blank',
|
|
4705
|
+
type: A
|
|
4704
4706
|
}, ...iconDom, text(label)];
|
|
4705
4707
|
};
|
|
4706
4708
|
|
|
4707
4709
|
const resourceNode = {
|
|
4708
|
-
|
|
4709
|
-
type: Div,
|
|
4710
|
+
childCount: 1,
|
|
4710
4711
|
className: Resource,
|
|
4711
|
-
|
|
4712
|
+
// TODO use link with url
|
|
4713
|
+
type: Div
|
|
4712
4714
|
};
|
|
4713
4715
|
const getResourceVirtualDom = resource => {
|
|
4714
4716
|
const {
|
|
@@ -4723,9 +4725,9 @@ const getResourceVirtualDom = resource => {
|
|
|
4723
4725
|
|
|
4724
4726
|
const getResourcesVirtualDom = resources => {
|
|
4725
4727
|
return [{
|
|
4726
|
-
|
|
4728
|
+
childCount: resources.length,
|
|
4727
4729
|
className: Resources,
|
|
4728
|
-
|
|
4730
|
+
type: Div
|
|
4729
4731
|
}, ...resources.flatMap(getResourceVirtualDom)];
|
|
4730
4732
|
};
|
|
4731
4733
|
|
|
@@ -4734,23 +4736,23 @@ const getAdditionalDetailsVirtualDom = (showAdditionalDetails, firstHeading, ent
|
|
|
4734
4736
|
return [];
|
|
4735
4737
|
}
|
|
4736
4738
|
return [{
|
|
4737
|
-
|
|
4739
|
+
childCount: 1,
|
|
4738
4740
|
className: Aside,
|
|
4739
|
-
|
|
4741
|
+
type: Aside$1
|
|
4740
4742
|
}, {
|
|
4741
|
-
|
|
4743
|
+
childCount: 4,
|
|
4742
4744
|
className: AdditionalDetails,
|
|
4745
|
+
onClick: HandleAdditionalDetailContextMenu,
|
|
4743
4746
|
tabIndex: 0,
|
|
4744
|
-
|
|
4745
|
-
onClick: HandleAdditionalDetailContextMenu
|
|
4747
|
+
type: Div
|
|
4746
4748
|
}, ...getAdditionalDetailsEntryVirtualDom(firstHeading, entries, getMoreInfoVirtualDom), ...getAdditionalDetailsEntryVirtualDom(secondHeading, secondEntries, getMoreInfoVirtualDom), ...getAdditionalDetailsEntryVirtualDom(thirdHeading, categories, getCategoriesDom), ...getAdditionalDetailsEntryVirtualDom(fourthHeading, resources, getResourcesVirtualDom)];
|
|
4747
4749
|
};
|
|
4748
4750
|
|
|
4749
4751
|
const getNoReadmeVirtualDom = () => {
|
|
4750
4752
|
return [{
|
|
4751
|
-
type: Div,
|
|
4752
4753
|
childCount: 1,
|
|
4753
|
-
className: Markdown
|
|
4754
|
+
className: Markdown,
|
|
4755
|
+
type: Div
|
|
4754
4756
|
}, text(noReadmeFound())];
|
|
4755
4757
|
};
|
|
4756
4758
|
|
|
@@ -4770,53 +4772,53 @@ const getDetailsVirtualDom = (sanitizedReadmeHtml, width, scrollToTopButtonEnabl
|
|
|
4770
4772
|
const childCount = getChildCount(showAdditionalDetails);
|
|
4771
4773
|
const contentDom = hasReadme ? sanitizedReadmeHtml : getNoReadmeVirtualDom();
|
|
4772
4774
|
const dom = [{
|
|
4773
|
-
type: Div,
|
|
4774
|
-
className: ExtensionDetailPanel,
|
|
4775
4775
|
childCount: childCount,
|
|
4776
|
-
|
|
4776
|
+
className: ExtensionDetailPanel,
|
|
4777
|
+
role: Panel,
|
|
4778
|
+
type: Div
|
|
4777
4779
|
}, ...contentDom, ...getAdditionalDetailsVirtualDom(showAdditionalDetails, firstHeading, installationEntries, secondHeading, marketplaceEntries, thirdHeading, categories$1, fourthHeading, resources$1)];
|
|
4778
4780
|
return dom;
|
|
4779
4781
|
};
|
|
4780
4782
|
|
|
4781
4783
|
const getFeatureListItemVirtualDom = feature => {
|
|
4782
4784
|
const {
|
|
4785
|
+
id,
|
|
4783
4786
|
label,
|
|
4784
|
-
selected
|
|
4785
|
-
id
|
|
4787
|
+
selected
|
|
4786
4788
|
} = feature;
|
|
4787
4789
|
const className = selected ? 'Feature FeatureSelected' : Feature;
|
|
4788
4790
|
return [{
|
|
4789
|
-
|
|
4790
|
-
type: Button$1,
|
|
4791
|
-
name: id,
|
|
4791
|
+
childCount: 1,
|
|
4792
4792
|
className,
|
|
4793
|
-
|
|
4793
|
+
name: id,
|
|
4794
|
+
// TODO use role list item or tab
|
|
4795
|
+
type: Button$1
|
|
4794
4796
|
}, text(label)];
|
|
4795
4797
|
};
|
|
4796
4798
|
|
|
4797
4799
|
const getFeatureListVirtualDom = features => {
|
|
4798
4800
|
return [{
|
|
4799
|
-
// TODO use either list or tabs role
|
|
4800
|
-
type: Div,
|
|
4801
|
-
className: FeaturesList,
|
|
4802
4801
|
childCount: features.length,
|
|
4803
|
-
|
|
4802
|
+
className: FeaturesList,
|
|
4803
|
+
onClick: HandleFeaturesClick,
|
|
4804
|
+
// TODO use either list or tabs role
|
|
4805
|
+
type: Div
|
|
4804
4806
|
}, ...features.flatMap(getFeatureListItemVirtualDom)];
|
|
4805
4807
|
};
|
|
4806
4808
|
|
|
4807
4809
|
const getFeaturesEmptyVirtualDom = () => {
|
|
4808
4810
|
const none$1 = none();
|
|
4809
4811
|
return [{
|
|
4810
|
-
|
|
4812
|
+
childCount: 1,
|
|
4811
4813
|
className: Features$1,
|
|
4812
|
-
|
|
4814
|
+
type: Div
|
|
4813
4815
|
}, text(none$1)];
|
|
4814
4816
|
};
|
|
4815
4817
|
|
|
4816
4818
|
const sash = {
|
|
4817
|
-
|
|
4819
|
+
childCount: 0,
|
|
4818
4820
|
className: mergeClassNames(Sash, SashVertical),
|
|
4819
|
-
|
|
4821
|
+
type: Div
|
|
4820
4822
|
};
|
|
4821
4823
|
const getFeaturesVirtualDom = (features, selectedFeature, state) => {
|
|
4822
4824
|
if (features.length === 0) {
|
|
@@ -4825,20 +4827,20 @@ const getFeaturesVirtualDom = (features, selectedFeature, state) => {
|
|
|
4825
4827
|
const fn = getFeatureVirtualDomHandler(selectedFeature);
|
|
4826
4828
|
const featureVirtualDom = fn(state);
|
|
4827
4829
|
return [{
|
|
4828
|
-
|
|
4830
|
+
childCount: 3,
|
|
4829
4831
|
className: Features$1,
|
|
4830
|
-
|
|
4832
|
+
type: Div
|
|
4831
4833
|
}, ...getFeatureListVirtualDom(features), sash, ...featureVirtualDom];
|
|
4832
4834
|
};
|
|
4833
4835
|
|
|
4834
4836
|
const getExtensionDetailContentVirtualDom = (sanitizedReadmeHtml, selectedTab, width, scrollToTopButtonEnabled, categories, resources, breakpoint, changelogDom, state) => {
|
|
4835
4837
|
switch (selectedTab) {
|
|
4838
|
+
case Changelog:
|
|
4839
|
+
return getChangelogVirtualDom(changelogDom);
|
|
4836
4840
|
case Details:
|
|
4837
4841
|
return getDetailsVirtualDom(sanitizedReadmeHtml, width, scrollToTopButtonEnabled, categories, resources, breakpoint, state.installationEntries, state.marketplaceEntries, state.hasReadme, state.showSideBar);
|
|
4838
4842
|
case Features:
|
|
4839
4843
|
return getFeaturesVirtualDom(state.features, state.selectedFeature, state);
|
|
4840
|
-
case Changelog:
|
|
4841
|
-
return getChangelogVirtualDom(changelogDom);
|
|
4842
4844
|
default:
|
|
4843
4845
|
return [];
|
|
4844
4846
|
}
|
|
@@ -4846,19 +4848,19 @@ const getExtensionDetailContentVirtualDom = (sanitizedReadmeHtml, selectedTab, w
|
|
|
4846
4848
|
|
|
4847
4849
|
const getExtensionDetailDescriptionVirtualDom = description => {
|
|
4848
4850
|
return [{
|
|
4849
|
-
|
|
4851
|
+
childCount: 1,
|
|
4850
4852
|
className: ExtensionDetailDescription,
|
|
4851
|
-
|
|
4853
|
+
type: Div
|
|
4852
4854
|
}, text(description)];
|
|
4853
4855
|
};
|
|
4854
4856
|
|
|
4855
4857
|
const getButtonVirtualDom = (message, onClick, name) => {
|
|
4856
4858
|
return [{
|
|
4857
|
-
|
|
4859
|
+
childCount: 1,
|
|
4858
4860
|
className: mergeClassNames(Button, ButtonPrimary),
|
|
4859
|
-
onClick,
|
|
4860
4861
|
name,
|
|
4861
|
-
|
|
4862
|
+
onClick,
|
|
4863
|
+
type: Button$1
|
|
4862
4864
|
}, text(message)];
|
|
4863
4865
|
};
|
|
4864
4866
|
|
|
@@ -4867,17 +4869,17 @@ const getSettingsButtonVirtualDom = enabled => {
|
|
|
4867
4869
|
return [];
|
|
4868
4870
|
}
|
|
4869
4871
|
return [{
|
|
4870
|
-
|
|
4872
|
+
childCount: 1,
|
|
4871
4873
|
className: SettingsButton,
|
|
4874
|
+
name: Settings,
|
|
4872
4875
|
onClick: HandleClickSettings,
|
|
4873
|
-
childCount: 1,
|
|
4874
4876
|
title: 'Settings',
|
|
4875
|
-
|
|
4877
|
+
type: Button$1
|
|
4876
4878
|
}, {
|
|
4877
|
-
type: Span,
|
|
4878
|
-
className: SettingsIcon,
|
|
4879
4879
|
childCount: 0,
|
|
4880
|
-
|
|
4880
|
+
className: SettingsIcon,
|
|
4881
|
+
text: '⚙️',
|
|
4882
|
+
type: Span
|
|
4881
4883
|
}];
|
|
4882
4884
|
};
|
|
4883
4885
|
|
|
@@ -4886,22 +4888,22 @@ const getExtensionDetailHeaderActionsVirtualDom = (buttonDefs, settingsButtonEna
|
|
|
4886
4888
|
const buttons = enabledButtons.flatMap(btn => getButtonVirtualDom(btn.label, btn.onClick, btn.name));
|
|
4887
4889
|
const settingsButton = getSettingsButtonVirtualDom(settingsButtonEnabled);
|
|
4888
4890
|
const dom = [{
|
|
4889
|
-
|
|
4891
|
+
childCount: enabledButtons.length + settingsButton.length,
|
|
4890
4892
|
className: ExtensionDetailHeaderActions,
|
|
4891
|
-
|
|
4893
|
+
type: Div
|
|
4892
4894
|
}, ...buttons, ...settingsButton];
|
|
4893
4895
|
return dom;
|
|
4894
4896
|
};
|
|
4895
4897
|
|
|
4896
4898
|
const getExtensionDetailIconVirtualDom = iconSrc => {
|
|
4897
4899
|
return {
|
|
4898
|
-
type: Img,
|
|
4899
|
-
className: ExtensionDetailIcon,
|
|
4900
4900
|
alt: '',
|
|
4901
4901
|
childCount: 0,
|
|
4902
|
+
className: ExtensionDetailIcon,
|
|
4902
4903
|
draggable: false,
|
|
4903
4904
|
onContextMenu: HandleImageContextMenu,
|
|
4904
|
-
src: iconSrc
|
|
4905
|
+
src: iconSrc,
|
|
4906
|
+
type: Img
|
|
4905
4907
|
};
|
|
4906
4908
|
};
|
|
4907
4909
|
|
|
@@ -4910,29 +4912,29 @@ const getNameBadgeVirtualDom = badge => {
|
|
|
4910
4912
|
return [];
|
|
4911
4913
|
}
|
|
4912
4914
|
return [{
|
|
4913
|
-
|
|
4915
|
+
childCount: 1,
|
|
4914
4916
|
className: ExtensionDetailNameBadge,
|
|
4915
|
-
|
|
4917
|
+
type: Span
|
|
4916
4918
|
}, text(badge)];
|
|
4917
4919
|
};
|
|
4918
4920
|
|
|
4919
4921
|
const getExtensionDetailNameVirtualDom = (name, badge) => {
|
|
4920
4922
|
return [{
|
|
4921
|
-
|
|
4923
|
+
childCount: badge ? 2 : 1,
|
|
4922
4924
|
className: ExtensionDetailName,
|
|
4923
|
-
|
|
4925
|
+
type: Div
|
|
4924
4926
|
}, text(name), ...getNameBadgeVirtualDom(badge)];
|
|
4925
4927
|
};
|
|
4926
4928
|
|
|
4927
4929
|
const getExtensionDetailHeaderVirtualDom = (name, iconSrc, description, badge, buttonDefs, settingsButtonEnabled) => {
|
|
4928
4930
|
const dom = [{
|
|
4929
|
-
|
|
4931
|
+
childCount: 2,
|
|
4930
4932
|
className: ExtensionDetailHeader,
|
|
4931
|
-
|
|
4933
|
+
type: Div
|
|
4932
4934
|
}, getExtensionDetailIconVirtualDom(iconSrc), {
|
|
4933
|
-
|
|
4935
|
+
childCount: 3,
|
|
4934
4936
|
className: ExtensionDetailHeaderDetails,
|
|
4935
|
-
|
|
4937
|
+
type: Div
|
|
4936
4938
|
}, ...getExtensionDetailNameVirtualDom(name, badge), ...getExtensionDetailDescriptionVirtualDom(description), ...getExtensionDetailHeaderActionsVirtualDom(buttonDefs, settingsButtonEnabled)];
|
|
4937
4939
|
return dom;
|
|
4938
4940
|
};
|
|
@@ -4946,41 +4948,41 @@ const getTabClassName = isSelected => {
|
|
|
4946
4948
|
const getTabVirtualDom = tab => {
|
|
4947
4949
|
const {
|
|
4948
4950
|
label,
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
+
name,
|
|
4952
|
+
selected
|
|
4951
4953
|
} = tab;
|
|
4952
4954
|
const className = getTabClassName(selected);
|
|
4953
4955
|
const ariaSelected = selected;
|
|
4954
4956
|
return [{
|
|
4955
|
-
|
|
4956
|
-
role: Tab,
|
|
4957
|
-
name,
|
|
4958
|
-
className,
|
|
4957
|
+
ariaSelected,
|
|
4959
4958
|
childCount: 1,
|
|
4959
|
+
className,
|
|
4960
|
+
name,
|
|
4961
|
+
role: Tab,
|
|
4960
4962
|
tabIndex: -1,
|
|
4961
|
-
|
|
4963
|
+
type: Button$1
|
|
4962
4964
|
}, text(label)];
|
|
4963
4965
|
};
|
|
4964
4966
|
|
|
4965
4967
|
const getTabsVirtualDom = tabs => {
|
|
4966
4968
|
return [{
|
|
4967
|
-
type: Div,
|
|
4968
|
-
className: ExtensionDetailTabs,
|
|
4969
4969
|
childCount: tabs.length,
|
|
4970
|
-
|
|
4970
|
+
className: ExtensionDetailTabs,
|
|
4971
4971
|
onClick: HandleTabsClick,
|
|
4972
|
-
|
|
4972
|
+
role: TabList,
|
|
4973
|
+
tabIndex: 0,
|
|
4974
|
+
type: Div
|
|
4973
4975
|
}, ...tabs.flatMap(getTabVirtualDom)];
|
|
4974
4976
|
};
|
|
4975
4977
|
|
|
4976
4978
|
const getClassNames = size => {
|
|
4977
4979
|
switch (size) {
|
|
4978
|
-
case Small:
|
|
4979
|
-
return Small$1;
|
|
4980
|
-
case Normal:
|
|
4981
|
-
return Normal$1;
|
|
4982
4980
|
case Large:
|
|
4983
4981
|
return Large$1;
|
|
4982
|
+
case Normal:
|
|
4983
|
+
return Normal$1;
|
|
4984
|
+
case Small:
|
|
4985
|
+
return Small$1;
|
|
4984
4986
|
default:
|
|
4985
4987
|
return '';
|
|
4986
4988
|
}
|
|
@@ -5011,9 +5013,9 @@ const getExtensionDetailVirtualDom = (newState, selectedTab) => {
|
|
|
5011
5013
|
const width = newState?.width || 500;
|
|
5012
5014
|
const sizeClass = getClassNames(sizeValue);
|
|
5013
5015
|
const dom = [{
|
|
5014
|
-
|
|
5016
|
+
childCount: 3,
|
|
5015
5017
|
className: mergeClassNames(Viewlet, ExtensionDetail, sizeClass),
|
|
5016
|
-
|
|
5018
|
+
type: Div
|
|
5017
5019
|
}, ...getExtensionDetailHeaderVirtualDom(name, iconSrc, description, badge, buttons, settingsButtonEnabled), ...getTabsVirtualDom(tabs), ...getExtensionDetailContentVirtualDom(detailsVirtualDom, selectedTab, width, scrollToTopButtonEnabled, categories, resources, showAdditionalDetailsBreakpoint, changelogVirtualDom, newState)];
|
|
5018
5020
|
return dom;
|
|
5019
5021
|
};
|
|
@@ -5040,10 +5042,10 @@ const renderScrollTop = (oldState, newState) => {
|
|
|
5040
5042
|
const selector = '.ExtensionDetailPanel .Markdown';
|
|
5041
5043
|
const property = 'scrollTop';
|
|
5042
5044
|
const {
|
|
5043
|
-
uid,
|
|
5044
|
-
readmeScrollTop,
|
|
5045
5045
|
changelogScrollTop,
|
|
5046
|
-
|
|
5046
|
+
readmeScrollTop,
|
|
5047
|
+
selectedTab,
|
|
5048
|
+
uid
|
|
5047
5049
|
} = newState;
|
|
5048
5050
|
const scrollTop = getScrollTop(selectedTab, readmeScrollTop, changelogScrollTop);
|
|
5049
5051
|
if (scrollTop === -1) {
|
|
@@ -5054,14 +5056,14 @@ const renderScrollTop = (oldState, newState) => {
|
|
|
5054
5056
|
|
|
5055
5057
|
const getRenderer = diffType => {
|
|
5056
5058
|
switch (diffType) {
|
|
5057
|
-
case
|
|
5058
|
-
return
|
|
5059
|
+
case RenderCss:
|
|
5060
|
+
return renderCss;
|
|
5059
5061
|
case RenderFocus:
|
|
5060
5062
|
return renderFocus;
|
|
5063
|
+
case RenderItems:
|
|
5064
|
+
return renderDom;
|
|
5061
5065
|
case RenderScrollTop:
|
|
5062
5066
|
return renderScrollTop;
|
|
5063
|
-
case RenderCss:
|
|
5064
|
-
return renderCss;
|
|
5065
5067
|
default:
|
|
5066
5068
|
throw new Error('unknown renderer');
|
|
5067
5069
|
}
|
|
@@ -5081,8 +5083,8 @@ const applyRender = (oldState, newState, diffResult) => {
|
|
|
5081
5083
|
|
|
5082
5084
|
const render2 = (uid, diffResult) => {
|
|
5083
5085
|
const {
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
+
newState,
|
|
5087
|
+
oldState
|
|
5086
5088
|
} = get(uid);
|
|
5087
5089
|
set(uid, newState, newState);
|
|
5088
5090
|
const commands = applyRender(oldState, newState, diffResult);
|
|
@@ -5154,25 +5156,25 @@ const resize = (state, dimensions) => {
|
|
|
5154
5156
|
return {
|
|
5155
5157
|
...state,
|
|
5156
5158
|
...dimensions,
|
|
5157
|
-
showSideBar,
|
|
5158
5159
|
paddingLeft: padding,
|
|
5159
5160
|
paddingRight: padding,
|
|
5161
|
+
showSideBar,
|
|
5160
5162
|
sideBarWidth
|
|
5161
5163
|
};
|
|
5162
5164
|
};
|
|
5163
5165
|
|
|
5164
5166
|
const saveState = state => {
|
|
5165
5167
|
const {
|
|
5166
|
-
|
|
5167
|
-
selectedFeature,
|
|
5168
|
+
changelogScrollTop,
|
|
5168
5169
|
readmeScrollTop,
|
|
5169
|
-
|
|
5170
|
+
selectedFeature,
|
|
5171
|
+
selectedTab
|
|
5170
5172
|
} = state;
|
|
5171
5173
|
return {
|
|
5172
|
-
|
|
5173
|
-
selectedFeature,
|
|
5174
|
+
changelogScrollTop,
|
|
5174
5175
|
readmeScrollTop,
|
|
5175
|
-
|
|
5176
|
+
selectedFeature,
|
|
5177
|
+
selectedTab
|
|
5176
5178
|
};
|
|
5177
5179
|
};
|
|
5178
5180
|
|