@salesforcedevs/docs-components 1.3.126 → 1.3.127

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.3.126",
3
+ "version": "1.3.127",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -24,5 +24,5 @@
24
24
  "@types/lodash.orderby": "^4.6.7",
25
25
  "@types/lodash.uniqby": "^4.7.7"
26
26
  },
27
- "gitHead": "a2651830cfd3ed7af0373f7792acd852d903fe0b"
27
+ "gitHead": "74db03edcd4920e328787e4174126ba6ee39a1dc"
28
28
  }
@@ -402,3 +402,10 @@ samp,
402
402
  mark {
403
403
  background-color: var(--dx-g-yellow-vibrant-90);
404
404
  }
405
+
406
+ /* offset page jump link due to fixed header */
407
+ [id] {
408
+ scroll-margin-top: calc(
409
+ var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
410
+ );
411
+ }
@@ -40,6 +40,13 @@ dx-toc {
40
40
  display: block;
41
41
  }
42
42
 
43
+ /* offset page jump link due to fixed header */
44
+ ::slotted(doc-heading) {
45
+ scroll-margin-top: calc(
46
+ var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
47
+ );
48
+ }
49
+
43
50
  .content {
44
51
  display: flex;
45
52
  position: relative;
@@ -156,28 +156,7 @@ export default class DocXmlContent extends LightningElementWithState<{
156
156
  ));
157
157
 
158
158
  if (anchorEl) {
159
- const globalNavHeader = document.querySelector(
160
- ".global-nav-container"
161
- ) as HTMLElement;
162
- const docHeader = document.querySelector(
163
- "doc-header"
164
- ) as HTMLElement;
165
- const headerHeight = globalNavHeader.offsetHeight;
166
- const docHeaderHeight = docHeader.offsetHeight;
167
- const rect = anchorEl.getBoundingClientRect();
168
-
169
- // Calculate the scroll position required to bring the element into view
170
- const scrollTop =
171
- window.pageYOffset || document.documentElement.scrollTop;
172
- const scrollX = rect.left + window.pageXOffset;
173
- const scrollY =
174
- rect.top + scrollTop - (headerHeight + docHeaderHeight); // subtract the header height from the top position
175
-
176
- // Scroll to the calculated position
177
- window.scrollTo({
178
- top: scrollY,
179
- left: scrollX
180
- });
159
+ anchorEl.scrollIntoView();
181
160
 
182
161
  this.setState({ internalLinkClicked: false });
183
162
  }