@lvce-editor/extension-detail-view 3.43.0 → 3.45.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.
|
@@ -26,7 +26,7 @@ const Installation = 'Installation';
|
|
|
26
26
|
const JsonValidation$1 = 'Json Validation';
|
|
27
27
|
const Label = 'Label';
|
|
28
28
|
const Marketplace = 'Marketplace';
|
|
29
|
-
const None$
|
|
29
|
+
const None$2 = 'None';
|
|
30
30
|
const OpenImageInNewTab = 'Open Image in New Tab';
|
|
31
31
|
const OpenInNewTab = 'Open in New Tab';
|
|
32
32
|
const ProgrammingLanguages$1 = 'Programming Languages';
|
|
@@ -69,7 +69,7 @@ const features$1 = () => {
|
|
|
69
69
|
return i18nString(Features$2);
|
|
70
70
|
};
|
|
71
71
|
const none = () => {
|
|
72
|
-
return i18nString(None$
|
|
72
|
+
return i18nString(None$2);
|
|
73
73
|
};
|
|
74
74
|
const openInNewTab = () => {
|
|
75
75
|
return i18nString(OpenInNewTab);
|
|
@@ -146,11 +146,13 @@ const featureActivationEventsEnabled = extension => {
|
|
|
146
146
|
return Array.isArray(extension.activation);
|
|
147
147
|
};
|
|
148
148
|
|
|
149
|
+
const None$1 = 'none';
|
|
149
150
|
const Panel = 'panel';
|
|
150
151
|
const Tab$1 = 'tab';
|
|
151
152
|
const TabList = 'tablist';
|
|
152
153
|
const AriaRoles = {
|
|
153
154
|
__proto__: null,
|
|
155
|
+
None: None$1,
|
|
154
156
|
Panel,
|
|
155
157
|
Tab: Tab$1,
|
|
156
158
|
TabList};
|
|
@@ -688,10 +690,15 @@ const getScrollToTopVirtualDom = scrollToTopButtonEnabled => {
|
|
|
688
690
|
return [{
|
|
689
691
|
type: VirtualDomElements.Button,
|
|
690
692
|
className: ScrollToTopButton,
|
|
691
|
-
childCount:
|
|
693
|
+
childCount: 1,
|
|
692
694
|
onClick: HandleClickScrollToTop,
|
|
693
695
|
ariaLabel: scrollToTop(),
|
|
694
696
|
name: ScrollToTop
|
|
697
|
+
}, {
|
|
698
|
+
type: VirtualDomElements.Div,
|
|
699
|
+
className: 'MaskIcon MaskIconChevronUp',
|
|
700
|
+
childCount: 0,
|
|
701
|
+
role: AriaRoles.None
|
|
695
702
|
}];
|
|
696
703
|
};
|
|
697
704
|
|
|
@@ -2163,7 +2170,7 @@ const User = 1;
|
|
|
2163
2170
|
const Script = 2;
|
|
2164
2171
|
|
|
2165
2172
|
const isEqual = (oldState, newState) => {
|
|
2166
|
-
return newState.scrollSource === User || oldState.readmeScrollTop === newState.readmeScrollTop;
|
|
2173
|
+
return newState.scrollSource === User || oldState.readmeScrollTop === newState.readmeScrollTop && oldState.selectedTab === newState.selectedTab;
|
|
2167
2174
|
};
|
|
2168
2175
|
|
|
2169
2176
|
const RenderFocus = 2;
|
|
@@ -3542,10 +3549,29 @@ const renderFocus = (oldState, newState) => {
|
|
|
3542
3549
|
return ['Viewlet.focusElementByName', ''];
|
|
3543
3550
|
};
|
|
3544
3551
|
|
|
3552
|
+
const getScrollTop = (selectedTab, readmeScrollTop, changelogScrollTop) => {
|
|
3553
|
+
if (selectedTab === Details) {
|
|
3554
|
+
return readmeScrollTop;
|
|
3555
|
+
}
|
|
3556
|
+
if (selectedTab === Changelog) {
|
|
3557
|
+
return changelogScrollTop;
|
|
3558
|
+
}
|
|
3559
|
+
return -1;
|
|
3560
|
+
};
|
|
3545
3561
|
const renderScrollTop = (oldState, newState) => {
|
|
3546
3562
|
const selector = '.ExtensionDetailPanel .Markdown';
|
|
3547
3563
|
const property = 'scrollTop';
|
|
3548
|
-
|
|
3564
|
+
const {
|
|
3565
|
+
uid,
|
|
3566
|
+
readmeScrollTop,
|
|
3567
|
+
changelogScrollTop,
|
|
3568
|
+
selectedTab
|
|
3569
|
+
} = newState;
|
|
3570
|
+
const scrollTop = getScrollTop(selectedTab, readmeScrollTop, changelogScrollTop);
|
|
3571
|
+
if (scrollTop === -1) {
|
|
3572
|
+
return [];
|
|
3573
|
+
}
|
|
3574
|
+
return ['Viewlet.setProperty', uid, selector, property, scrollTop];
|
|
3549
3575
|
};
|
|
3550
3576
|
|
|
3551
3577
|
const getRenderer = diffType => {
|
|
@@ -3565,7 +3591,10 @@ const applyRender = (oldState, newState, diffResult) => {
|
|
|
3565
3591
|
const commands = [];
|
|
3566
3592
|
for (const item of diffResult) {
|
|
3567
3593
|
const fn = getRenderer(item);
|
|
3568
|
-
|
|
3594
|
+
const instanceCommands = fn(oldState, newState);
|
|
3595
|
+
if (instanceCommands.length > 0) {
|
|
3596
|
+
commands.push(instanceCommands);
|
|
3597
|
+
}
|
|
3569
3598
|
}
|
|
3570
3599
|
return commands;
|
|
3571
3600
|
};
|