@salesforcedevs/docs-components 1.20.2 → 1.20.5

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.20.2",
3
+ "version": "1.20.5",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -25,5 +25,9 @@
25
25
  "@types/lodash.orderby": "4.6.9",
26
26
  "@types/lodash.uniqby": "4.7.9"
27
27
  },
28
- "gitHead": "10311f28b3791b85639bde33ade200feb8ccd06d"
28
+ "gitHead": "0e3af2211cf15d8c1679afc69cf502643806222d",
29
+ "volta": {
30
+ "node": "20.19.0",
31
+ "yarn": "1.22.19"
32
+ }
29
33
  }
@@ -269,13 +269,28 @@ export default class ContentLayout extends LightningElement {
269
269
  });
270
270
 
271
271
  // Adjusting the right nav bar on scroll.
272
+ // setting maxheight to make the RNB scrollable based on different parent elements
272
273
  if (rightNavBarEl) {
273
- rightNavBarEl.style.top = docPhaseEl
274
- ? `${
275
- totalHeaderHeight +
276
- docPhaseEl.getBoundingClientRect().height
277
- }px`
278
- : `${totalHeaderHeight}px`;
274
+ const docPhaseElHeight = docPhaseEl
275
+ ? docPhaseEl.getBoundingClientRect().height
276
+ : 0;
277
+ const viewportHeight = window.innerHeight;
278
+ const maxHeight =
279
+ viewportHeight -
280
+ (docPhaseElHeight + totalHeaderHeight + 24); //added some margin of dx-toc
281
+
282
+ rightNavBarEl.style.top = `${
283
+ totalHeaderHeight + docPhaseElHeight
284
+ }px`;
285
+
286
+ const toc = rightNavBarEl.querySelector("dx-toc");
287
+ const listContainer = toc?.shadowRoot?.querySelector(
288
+ ".toc"
289
+ ) as HTMLElement;
290
+
291
+ if (listContainer) {
292
+ listContainer.style.maxHeight = `${maxHeight}px`;
293
+ }
279
294
  }
280
295
 
281
296
  // If doc phase element exists, we need to account for its sticky position. Mobile should include the sidebar height (since it becomes sticky aswell).