@salesforcedevs/docs-components 1.20.6-sticky-banner → 1.20.6-sticky-banner2
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 +2 -3
- package/src/modules/doc/amfReference/amfReference.css +0 -12
- package/src/modules/doc/contentLayout/contentLayout.html +1 -1
- package/src/modules/doc/contentLayout/contentLayout.ts +21 -9
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +1 -1
- package/src/modules/doc/phase/phase.css +0 -1
- package/src/modules/doc/xmlContent/xmlContent.css +0 -10
- package/src/modules/docHelpers/contentLayoutStyle/contentLayoutStyle.css +5 -3
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "1.20.6-sticky-
|
|
3
|
+
"version": "1.20.6-sticky-banner2",
|
|
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"
|
|
9
|
-
"yarn": "1.22.19"
|
|
8
|
+
"node": "20.x"
|
|
10
9
|
},
|
|
11
10
|
"publishConfig": {
|
|
12
11
|
"access": "public"
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
doc-phase {
|
|
2
|
-
--doc-c-phase-top: calc(
|
|
3
|
-
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height) +
|
|
4
|
-
var(--dx-g-spacing-xl)
|
|
5
|
-
);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
1
|
/* We need to apply some borders when there are two doc phases */
|
|
9
2
|
doc-phase:not(:only-of-type)::part(container) {
|
|
10
3
|
border-top: 1px solid var(--dx-g-yellow-vibrant-90);
|
|
@@ -15,11 +8,6 @@ doc-phase:nth-child(2)::part(container) {
|
|
|
15
8
|
border-bottom: 1px solid var(--dx-g-yellow-vibrant-90);
|
|
16
9
|
}
|
|
17
10
|
|
|
18
|
-
/* We don't want second component to sticky as we need to handle different cases like position */
|
|
19
|
-
doc-phase:nth-child(2) {
|
|
20
|
-
position: static;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
11
|
.api-documentation {
|
|
24
12
|
margin-top: 48px;
|
|
25
13
|
}
|
|
@@ -217,15 +217,19 @@ export default class ContentLayout extends LightningElement {
|
|
|
217
217
|
".sticky-doc-header"
|
|
218
218
|
) as HTMLElement;
|
|
219
219
|
|
|
220
|
-
const docPhaseWrapper = this.template.querySelector(
|
|
221
|
-
|
|
220
|
+
const docPhaseWrapper = this.template.querySelector(
|
|
221
|
+
".doc-phase-wrapper"
|
|
222
|
+
) as HTMLElement;
|
|
223
|
+
const versionWrapper = this.template.querySelector(
|
|
224
|
+
".version-wrapper"
|
|
225
|
+
) as HTMLElement;
|
|
222
226
|
|
|
223
227
|
const docPhaseEl = (
|
|
224
228
|
docPhaseWrapper.querySelector("[name=doc-phase]")! as any
|
|
225
229
|
).assignedElements()[0] as HTMLSlotElement;
|
|
226
230
|
|
|
227
231
|
const verBannerEl = (
|
|
228
|
-
|
|
232
|
+
versionWrapper.querySelector("[name=version-banner]")! as any
|
|
229
233
|
).assignedElements()[0] as HTMLSlotElement;
|
|
230
234
|
|
|
231
235
|
if (!sidebarEl || !globalNavEl || !contextNavEl || !docHeaderEl) {
|
|
@@ -258,13 +262,16 @@ export default class ContentLayout extends LightningElement {
|
|
|
258
262
|
`${globalNavHeight}px`
|
|
259
263
|
);
|
|
260
264
|
|
|
261
|
-
const docPhaseElHeight =
|
|
265
|
+
const docPhaseElHeight =
|
|
266
|
+
docPhaseEl || verBannerEl
|
|
262
267
|
? (docPhaseEl || verBannerEl).getBoundingClientRect().height
|
|
263
268
|
: 0;
|
|
264
269
|
|
|
265
270
|
// Adjusting the doc section heading on scroll.
|
|
266
271
|
docHeadingEls.forEach((docHeadingEl) => {
|
|
267
|
-
(docHeadingEl as any).style.scrollMarginTop = `${
|
|
272
|
+
(docHeadingEl as any).style.scrollMarginTop = `${
|
|
273
|
+
totalHeaderHeight + docPhaseElHeight + 40
|
|
274
|
+
}px`;
|
|
268
275
|
});
|
|
269
276
|
|
|
270
277
|
// Adjusting the right nav bar on scroll.
|
|
@@ -289,15 +296,20 @@ export default class ContentLayout extends LightningElement {
|
|
|
289
296
|
}
|
|
290
297
|
}
|
|
291
298
|
|
|
292
|
-
const docPhaseTop =
|
|
299
|
+
const docPhaseTop =
|
|
300
|
+
window.innerWidth < 769
|
|
301
|
+
? globalNavHeight +
|
|
302
|
+
docHeaderHeight +
|
|
303
|
+
sidebarEl.getBoundingClientRect().height
|
|
304
|
+
: globalNavHeight + docHeaderHeight;
|
|
293
305
|
|
|
294
306
|
// If doc phase element exists, we need to account for its sticky position. Mobile should include the sidebar height (since it becomes sticky aswell).
|
|
295
307
|
// To handle sticky position for safari browser, position sticky given to wrapper class
|
|
296
308
|
if (docPhaseEl) {
|
|
297
309
|
docPhaseWrapper.style.top = `${docPhaseTop}px`;
|
|
298
|
-
} else if(verBannerEl) {
|
|
299
|
-
|
|
300
|
-
|
|
310
|
+
} else if (verBannerEl) {
|
|
311
|
+
versionWrapper.style.position = "sticky";
|
|
312
|
+
versionWrapper.style.top = `${docPhaseTop}px`;
|
|
301
313
|
}
|
|
302
314
|
});
|
|
303
315
|
};
|
|
@@ -31,10 +31,6 @@ dx-dropdown > dx-button:hover {
|
|
|
31
31
|
--border-color: var(--button-primary-color-hover);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
doc-phase {
|
|
35
|
-
--doc-c-phase-top: var(--dx-g-global-header-height);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
34
|
@media screen and (max-width: 768px) {
|
|
39
35
|
doc-content-layout {
|
|
40
36
|
--dx-g-doc-header-main-nav-height: 41px;
|
|
@@ -45,10 +41,4 @@ doc-phase {
|
|
|
45
41
|
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
|
|
46
42
|
);
|
|
47
43
|
}
|
|
48
|
-
|
|
49
|
-
doc-phase {
|
|
50
|
-
--doc-c-phase-top: calc(
|
|
51
|
-
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
44
|
}
|
|
@@ -60,15 +60,17 @@ dx-toc {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.doc-phase-wrapper,
|
|
63
|
-
.version-
|
|
63
|
+
.version-wrapper {
|
|
64
|
+
/* NOTE: If you are changing z-index value here, ensure it's less than z-index of dx-sidebar in contentLayout.css */
|
|
64
65
|
z-index: var(--dx-g-z-index-100);
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
.doc-phase-wrapper {
|
|
68
69
|
position: sticky;
|
|
69
70
|
}
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
|
|
72
|
+
/* We don't want second component to sticky */
|
|
73
|
+
.version-wrapper {
|
|
72
74
|
position: static;
|
|
73
75
|
}
|
|
74
76
|
|