@salesforcedevs/docs-components 1.19.6-alpha5 → 1.20.0-rnb-scroll
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/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0-rnb-scroll",
|
|
4
4
|
"description": "Docs Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": "20.x"
|
|
8
|
+
"node": "20.x",
|
|
9
|
+
"yarn": "1.22.19"
|
|
10
|
+
},
|
|
11
|
+
"volta": {
|
|
12
|
+
"node": "20.19.0",
|
|
13
|
+
"yarn": "1.22.19"
|
|
9
14
|
},
|
|
10
15
|
"publishConfig": {
|
|
11
16
|
"access": "public"
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="content">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
>
|
|
18
|
-
|
|
19
|
-
</dx-sidebar-old>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
3
|
+
<dx-sidebar-old
|
|
4
|
+
class="is-sticky left-nav-bar"
|
|
5
|
+
trees={sidebarContent}
|
|
6
|
+
value={sidebarValue}
|
|
7
|
+
header={sidebarHeader}
|
|
8
|
+
ontogglesidebar={onToggleSidebar}
|
|
9
|
+
languages={languages}
|
|
10
|
+
language={language}
|
|
11
|
+
bail-href={bailHref}
|
|
12
|
+
bail-label={bailLabel}
|
|
13
|
+
dev-center={devCenter}
|
|
14
|
+
brand={brand}
|
|
15
|
+
empty-state-message={emptyStateMessage}
|
|
16
|
+
>
|
|
17
|
+
<slot name="sidebar-header" slot="version-picker"></slot>
|
|
18
|
+
</dx-sidebar-old>
|
|
22
19
|
<div class="content-body-doc-phase-container">
|
|
23
20
|
<slot name="doc-phase"></slot>
|
|
24
21
|
<slot name="version-banner"></slot>
|
|
@@ -40,16 +40,6 @@ export default class ContentLayout extends LightningElement {
|
|
|
40
40
|
@api devCenter: any;
|
|
41
41
|
@api brand: any;
|
|
42
42
|
@api emptyStateMessage?: string;
|
|
43
|
-
_showSidebar = "true";
|
|
44
|
-
|
|
45
|
-
@api
|
|
46
|
-
set showSidebar(value) {
|
|
47
|
-
this._showSidebar = value;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
get showSidebar() {
|
|
51
|
-
return this._showSidebar;
|
|
52
|
-
}
|
|
53
43
|
|
|
54
44
|
// This is needed for now to prevent failing snapshot tests due to links in the footer
|
|
55
45
|
@api showFooter = false;
|
|
@@ -279,13 +269,24 @@ export default class ContentLayout extends LightningElement {
|
|
|
279
269
|
});
|
|
280
270
|
|
|
281
271
|
// Adjusting the right nav bar on scroll.
|
|
272
|
+
// setting maxheight to make the RNB scrollable based on different parent elements
|
|
282
273
|
if (rightNavBarEl) {
|
|
283
|
-
|
|
284
|
-
?
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
274
|
+
const docPhaseElHeight = docPhaseEl
|
|
275
|
+
? docPhaseEl.getBoundingClientRect().height
|
|
276
|
+
: 0;
|
|
277
|
+
const toc = rightNavBarEl.querySelector("dx-toc");
|
|
278
|
+
const listContainer = toc?.shadowRoot?.querySelector(
|
|
279
|
+
".toc"
|
|
280
|
+
) as HTMLElement;
|
|
281
|
+
const viewportHeight = window.innerHeight;
|
|
282
|
+
const maxHeight =
|
|
283
|
+
viewportHeight -
|
|
284
|
+
(docPhaseElHeight + totalHeaderHeight + 24); //added some margin of dx-toc
|
|
285
|
+
|
|
286
|
+
rightNavBarEl.style.top = `${
|
|
287
|
+
totalHeaderHeight + docPhaseElHeight
|
|
288
|
+
}px`;
|
|
289
|
+
listContainer.style.maxHeight = `${maxHeight}px`;
|
|
289
290
|
}
|
|
290
291
|
|
|
291
292
|
// If doc phase element exists, we need to account for its sticky position. Mobile should include the sidebar height (since it becomes sticky aswell).
|