@lvce-editor/extension-detail-view 4.12.0 → 4.14.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.
|
@@ -321,7 +321,8 @@ const ClientX = 'event.clientX';
|
|
|
321
321
|
const ClientY = 'event.clientY';
|
|
322
322
|
const TargetHref = 'event.target.href';
|
|
323
323
|
const TargetName = 'event.target.name';
|
|
324
|
-
|
|
324
|
+
|
|
325
|
+
const ExtensionDetailReadme = 20;
|
|
325
326
|
|
|
326
327
|
const DebugWorker = 55;
|
|
327
328
|
const ExtensionHostWorker = 44;
|
|
@@ -446,6 +447,8 @@ const getActivationEventsVirtualDom = state => {
|
|
|
446
447
|
const Text = 1;
|
|
447
448
|
const Code = 2;
|
|
448
449
|
const Link = 7;
|
|
450
|
+
const CodeList = 8;
|
|
451
|
+
const CheckMark = 9;
|
|
449
452
|
|
|
450
453
|
const getCommandTableEntry = command => {
|
|
451
454
|
// TODO watch out for command being null/undefined/number/string/array
|
|
@@ -507,6 +510,41 @@ const getTableHeadingVirtualDom = heading => {
|
|
|
507
510
|
}, text(heading)];
|
|
508
511
|
};
|
|
509
512
|
|
|
513
|
+
const getCheckedText = checked => {
|
|
514
|
+
if (checked) {
|
|
515
|
+
return 'yes';
|
|
516
|
+
}
|
|
517
|
+
return 'no';
|
|
518
|
+
};
|
|
519
|
+
const getCellCheckMarkVirtualDom = (value, props) => {
|
|
520
|
+
const {
|
|
521
|
+
checked
|
|
522
|
+
} = props;
|
|
523
|
+
const checkedText = getCheckedText(checked);
|
|
524
|
+
return [{
|
|
525
|
+
type: Td,
|
|
526
|
+
className: TableCell,
|
|
527
|
+
childCount: 1
|
|
528
|
+
}, text(checkedText)];
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
const getListItemDom = item => {
|
|
532
|
+
return [{
|
|
533
|
+
type: Code$2,
|
|
534
|
+
childCount: 1
|
|
535
|
+
}, text(item)];
|
|
536
|
+
};
|
|
537
|
+
const getCellCodeListVirtualDom = (value, props) => {
|
|
538
|
+
const {
|
|
539
|
+
listItems
|
|
540
|
+
} = props;
|
|
541
|
+
return [{
|
|
542
|
+
type: Td,
|
|
543
|
+
className: TableCell,
|
|
544
|
+
childCount: listItems.length
|
|
545
|
+
}, ...listItems.flatMap(getListItemDom)];
|
|
546
|
+
};
|
|
547
|
+
|
|
510
548
|
const getCellCodeVirtualDom = (value, props) => {
|
|
511
549
|
const tdClassName = props?.className ? `${TableCell} ${props.className}` : TableCell;
|
|
512
550
|
return [{
|
|
@@ -559,6 +597,10 @@ const getCellRenderer = type => {
|
|
|
559
597
|
return getCellTextVirtualDom;
|
|
560
598
|
case Link:
|
|
561
599
|
return getCellLinkVirtualDom;
|
|
600
|
+
case CodeList:
|
|
601
|
+
return getCellCodeListVirtualDom;
|
|
602
|
+
case CheckMark:
|
|
603
|
+
return getCellCheckMarkVirtualDom;
|
|
562
604
|
default:
|
|
563
605
|
throw new Error(`unexpected cell type ${type}`);
|
|
564
606
|
}
|
|
@@ -836,7 +878,32 @@ const getJsonValidationVirtualDom = state => {
|
|
|
836
878
|
};
|
|
837
879
|
|
|
838
880
|
const getProgrammingLanguageTableEntry = programmingLanguage => {
|
|
839
|
-
|
|
881
|
+
const {
|
|
882
|
+
id,
|
|
883
|
+
configuration,
|
|
884
|
+
extensions
|
|
885
|
+
} = programmingLanguage;
|
|
886
|
+
const name = ''; // TODO
|
|
887
|
+
const snippets = ''; // TODO
|
|
888
|
+
return [{
|
|
889
|
+
type: Text,
|
|
890
|
+
value: id
|
|
891
|
+
}, {
|
|
892
|
+
type: Text,
|
|
893
|
+
value: name
|
|
894
|
+
}, {
|
|
895
|
+
type: CodeList,
|
|
896
|
+
value: '',
|
|
897
|
+
listItems: extensions
|
|
898
|
+
}, {
|
|
899
|
+
type: CheckMark,
|
|
900
|
+
value: '',
|
|
901
|
+
checked: Boolean(configuration)
|
|
902
|
+
}, {
|
|
903
|
+
type: CheckMark,
|
|
904
|
+
value: '',
|
|
905
|
+
checked: Boolean(snippets)
|
|
906
|
+
}];
|
|
840
907
|
};
|
|
841
908
|
|
|
842
909
|
const getFeatureDetailsProgrammingLanguages = async extension => {
|
|
@@ -3022,7 +3089,7 @@ const getWebViewVirtualDom = webView => {
|
|
|
3022
3089
|
return [{
|
|
3023
3090
|
type: Div,
|
|
3024
3091
|
className: FeatureWebView,
|
|
3025
|
-
childCount:
|
|
3092
|
+
childCount: 4
|
|
3026
3093
|
}, 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)];
|
|
3027
3094
|
};
|
|
3028
3095
|
|
|
@@ -3337,7 +3404,7 @@ const isEqual$2 = (oldState, newState) => {
|
|
|
3337
3404
|
};
|
|
3338
3405
|
|
|
3339
3406
|
const isEqual$1 = (oldState, newState) => {
|
|
3340
|
-
return oldState.activationEvents === newState.activationEvents && oldState.badge === newState.badge && oldState.buttons === newState.buttons && oldState.categories === newState.categories && oldState.changelogVirtualDom === newState.changelogVirtualDom && oldState.commands === newState.commands && oldState.description === newState.description && oldState.detailsVirtualDom === newState.detailsVirtualDom && oldState.disabled === newState.disabled && oldState.displaySize === newState.displaySize && oldState.extensionId === newState.extensionId && oldState.extensionVersion === newState.extensionVersion && oldState.jsonValidation === newState.jsonValidation && oldState.selectedFeature === newState.selectedFeature && oldState.selectedTab === newState.selectedTab && oldState.settings === newState.settings && oldState.showSideBar === newState.showSideBar && oldState.sizeValue === newState.sizeValue && oldState.themesMarkdownDom === newState.themesMarkdownDom && oldState.webViews === newState.webViews;
|
|
3407
|
+
return oldState.activationEvents === newState.activationEvents && oldState.badge === newState.badge && oldState.buttons === newState.buttons && oldState.categories === newState.categories && oldState.changelogVirtualDom === newState.changelogVirtualDom && oldState.commands === newState.commands && oldState.description === newState.description && oldState.detailsVirtualDom === newState.detailsVirtualDom && oldState.disabled === newState.disabled && oldState.displaySize === newState.displaySize && oldState.extensionId === newState.extensionId && oldState.extensionVersion === newState.extensionVersion && oldState.features === newState.features && oldState.jsonValidation === newState.jsonValidation && oldState.selectedFeature === newState.selectedFeature && oldState.selectedTab === newState.selectedTab && oldState.settings === newState.settings && oldState.showSideBar === newState.showSideBar && oldState.sizeValue === newState.sizeValue && oldState.themesMarkdownDom === newState.themesMarkdownDom && oldState.webViews === newState.webViews;
|
|
3341
3408
|
};
|
|
3342
3409
|
|
|
3343
3410
|
const User = 1;
|
|
@@ -3708,6 +3775,12 @@ const handleReadmeClick = async (state, nodeName, href) => {
|
|
|
3708
3775
|
return state;
|
|
3709
3776
|
};
|
|
3710
3777
|
|
|
3778
|
+
const handleReadmeContextMenu = async (state, x, y, nodeName, href) => {
|
|
3779
|
+
await show(ExtensionDetailReadme, x, y);
|
|
3780
|
+
// TODO
|
|
3781
|
+
return state;
|
|
3782
|
+
};
|
|
3783
|
+
|
|
3711
3784
|
const handleScroll = (state, scrollTop, scrollSource = Script) => {
|
|
3712
3785
|
const newScrollTop = Math.max(0, scrollTop);
|
|
3713
3786
|
return {
|
|
@@ -5102,7 +5175,7 @@ const renderEventListeners = () => {
|
|
|
5102
5175
|
params: ['handleIconError']
|
|
5103
5176
|
}, {
|
|
5104
5177
|
name: HandleReadmeContextMenu,
|
|
5105
|
-
params: ['handleReadmeContextMenu', ClientX, ClientY,
|
|
5178
|
+
params: ['handleReadmeContextMenu', ClientX, ClientY, 'event.target.nodeName', TargetHref]
|
|
5106
5179
|
}, {
|
|
5107
5180
|
name: HandleImageContextMenu,
|
|
5108
5181
|
params: ['handleImageContextMenu', ClientX, ClientY],
|
|
@@ -5182,6 +5255,7 @@ const commandMap = {
|
|
|
5182
5255
|
'ExtensionDetail.getMenuEntries': getMenuEntries,
|
|
5183
5256
|
'ExtensionDetail.getMenus': getMenus,
|
|
5184
5257
|
'ExtensionDetail.handleClickCategory': wrapCommand(handleClickCategory),
|
|
5258
|
+
'ExtensionDetail.handleReadmeContextMenu': wrapCommand(handleReadmeContextMenu),
|
|
5185
5259
|
'ExtensionDetail.handleAdditionalDetailsContextMenu': wrapCommand(handleAdditionalDetailContextMenu),
|
|
5186
5260
|
'ExtensionDetail.handleClickDisable': wrapCommand(handleClickDisable),
|
|
5187
5261
|
'ExtensionDetail.handleClickEnable': wrapCommand(handleClickEnable),
|