@salesforcedevs/docs-components 1.18.8-specfix-alpha → 1.18.9-rnb-scroll3

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.18.8-specfix-alpha",
3
+ "version": "1.18.9-rnb-scroll3",
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"
@@ -270,12 +270,14 @@ export default class ContentLayout extends LightningElement {
270
270
 
271
271
  // Adjusting the right nav bar on scroll.
272
272
  if (rightNavBarEl) {
273
- rightNavBarEl.style.top = docPhaseEl
274
- ? `${
275
- totalHeaderHeight +
276
- docPhaseEl.getBoundingClientRect().height
277
- }px`
278
- : `${totalHeaderHeight}px`;
273
+ const docPhaseElHeight = docPhaseEl ? docPhaseEl.getBoundingClientRect().height : 0;
274
+ const toc = rightNavBarEl.querySelector("dx-toc");
275
+ const listContainer = toc?.shadowRoot?.querySelector(".toc") as HTMLElement;
276
+ const viewportHeight = window.innerHeight;
277
+ const maxHeight = viewportHeight - (docPhaseElHeight + totalHeaderHeight);
278
+
279
+ rightNavBarEl.style.top = `${totalHeaderHeight + docPhaseElHeight}px`;
280
+ listContainer.style.maxHeight = `${maxHeight}px`;
279
281
  }
280
282
 
281
283
  // If doc phase element exists, we need to account for its sticky position. Mobile should include the sidebar height (since it becomes sticky aswell).
@@ -29,7 +29,7 @@
29
29
 
30
30
  .content-media-iframe {
31
31
  position: relative;
32
- padding-bottom: calc(var(--aspect-ratio, 0.5625) * 100%);
32
+ padding-bottom: calc(var(--aspect-ratio, 0.5626) * 100%);
33
33
  height: 0;
34
34
  }
35
35
 
@@ -1 +1,9 @@
1
1
  @import "docHelpers/contentLayoutStyle";
2
+
3
+ .fixed-right-nav-bar {
4
+ width: 180px;
5
+ }
6
+
7
+ .content-body-no-rnb {
8
+ max-width: 1220px;
9
+ }
@@ -19,7 +19,7 @@
19
19
  <slot name="doc-phase"></slot>
20
20
  <slot name="version-banner"></slot>
21
21
  <div class="content-body-container">
22
- <div class="content-body">
22
+ <div class={contentBodyClasses}>
23
23
  <doc-breadcrumbs
24
24
  lwc:if={showBreadcrumbs}
25
25
  breadcrumbs={breadcrumbs}
@@ -29,7 +29,7 @@
29
29
  lwc:if={shouldDisplayFeedback}
30
30
  ></doc-sprig-survey>
31
31
  </div>
32
- <div lwc:if={showToc} class="right-nav-bar is-sticky">
32
+ <div lwc:if={showToc} class={rightNavBarClasses}>
33
33
  <dx-toc
34
34
  header={tocTitle}
35
35
  options={tocOptions}
@@ -1,4 +1,5 @@
1
1
  import ContentLayout from "doc/contentLayout";
2
+ import cx from "classnames";
2
3
 
3
4
  const TOC_HEADER_TAG = "doc-heading";
4
5
  const RNB_BY_TAB = "docs-tab";
@@ -23,6 +24,18 @@ export default class LwcContentLayout extends ContentLayout {
23
24
  return this.rnbByTab;
24
25
  }
25
26
 
27
+ get rightNavBarClasses() {
28
+ return cx(
29
+ "right-nav-bar",
30
+ "is-sticky",
31
+ this.showTabBasedRNB && "fixed-right-nav-bar"
32
+ );
33
+ }
34
+
35
+ get contentBodyClasses() {
36
+ return cx("content-body", !this.showToc && "content-body-no-rnb");
37
+ }
38
+
26
39
  /**
27
40
  * Check if the main slot contains doc-specification-content
28
41
  * Uses caching to avoid repeated DOM queries
@@ -74,7 +74,7 @@ dx-toc {
74
74
 
75
75
  .content-body {
76
76
  margin: var(--dx-g-spacing-md) 0 0;
77
- max-width: 900px;
77
+ max-width: 1000px;
78
78
  flex: 1;
79
79
  width: 0;
80
80
  }