@salesforcedevs/docs-components 1.3.109 → 1.3.114
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.
|
|
3
|
+
"version": "1.3.114",
|
|
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": "
|
|
27
|
+
"gitHead": "99105d6f04c069becae7f355830f55d9d3c45d1c"
|
|
28
28
|
}
|
|
@@ -149,6 +149,11 @@ export default class ContentLayout extends LightningElement {
|
|
|
149
149
|
this.attachInteractionObserver,
|
|
150
150
|
OBSERVER_ATTACH_WAIT_TIME
|
|
151
151
|
);
|
|
152
|
+
|
|
153
|
+
this.adjustNavPosition();
|
|
154
|
+
window.addEventListener("scroll", this.adjustNavPosition);
|
|
155
|
+
window.addEventListener("resize", this.adjustNavPosition);
|
|
156
|
+
|
|
152
157
|
if (!this.hasRendered) {
|
|
153
158
|
this.hasRendered = true;
|
|
154
159
|
this.restoreScroll();
|
|
@@ -161,6 +166,8 @@ export default class ContentLayout extends LightningElement {
|
|
|
161
166
|
"highlightedtermchange",
|
|
162
167
|
this.updateHighlighted
|
|
163
168
|
);
|
|
169
|
+
window.removeEventListener("scroll", this.adjustNavPosition);
|
|
170
|
+
window.removeEventListener("resize", this.adjustNavPosition);
|
|
164
171
|
this.searchSyncer.dispose();
|
|
165
172
|
this.clearRenderObserverTimer();
|
|
166
173
|
|
|
@@ -178,6 +185,61 @@ export default class ContentLayout extends LightningElement {
|
|
|
178
185
|
}
|
|
179
186
|
};
|
|
180
187
|
|
|
188
|
+
/*
|
|
189
|
+
This is a workaround for the global nav sticky header being decoupled from the doc header & doc phase.
|
|
190
|
+
We have to account for the global nav changing height due to animations.
|
|
191
|
+
*/
|
|
192
|
+
adjustNavPosition = () => {
|
|
193
|
+
const sidebarType = this.useOldSidebar
|
|
194
|
+
? "dx-sidebar-old"
|
|
195
|
+
: "dx-sidebar";
|
|
196
|
+
const sidebarEl = this.template.querySelector(sidebarType);
|
|
197
|
+
const globalNavEl = document.querySelector(
|
|
198
|
+
"hgf-c360nav"
|
|
199
|
+
) as HTMLElement;
|
|
200
|
+
const contextNavEl = document.querySelector(
|
|
201
|
+
"hgf-c360contextnav"
|
|
202
|
+
) as HTMLElement;
|
|
203
|
+
const docHeaderEl = document.querySelector(
|
|
204
|
+
".sticky-doc-header"
|
|
205
|
+
) as HTMLElement;
|
|
206
|
+
const docPhaseEl = document.querySelector("doc-phase") as HTMLElement;
|
|
207
|
+
|
|
208
|
+
if (!sidebarEl || !globalNavEl || !contextNavEl || !docHeaderEl) {
|
|
209
|
+
console.warn("One or more required elements are missing.");
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// sync with the browser to account for any reflows that may have happened
|
|
214
|
+
requestAnimationFrame(() => {
|
|
215
|
+
const globalNavHeight =
|
|
216
|
+
globalNavEl.offsetHeight + contextNavEl.offsetHeight;
|
|
217
|
+
const docHeaderHeight = docHeaderEl.offsetHeight;
|
|
218
|
+
sidebarEl.style.setProperty(
|
|
219
|
+
"--dx-c-content-sidebar-sticky-top",
|
|
220
|
+
`${globalNavHeight + docHeaderHeight}px`
|
|
221
|
+
);
|
|
222
|
+
docHeaderEl.style.setProperty(
|
|
223
|
+
"--dx-g-global-header-height",
|
|
224
|
+
`${globalNavHeight}px`
|
|
225
|
+
);
|
|
226
|
+
|
|
227
|
+
// If doc phase element exists, we need to account for its sticky position. Mobile should include the sidebar height (since it becomes sticky aswell).
|
|
228
|
+
if (docPhaseEl) {
|
|
229
|
+
docPhaseEl.style.setProperty(
|
|
230
|
+
"--doc-c-phase-top",
|
|
231
|
+
`${
|
|
232
|
+
window.innerWidth < 769
|
|
233
|
+
? globalNavHeight +
|
|
234
|
+
docHeaderHeight +
|
|
235
|
+
sidebarEl.offsetHeight
|
|
236
|
+
: globalNavHeight + docHeaderHeight
|
|
237
|
+
}px`
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
};
|
|
242
|
+
|
|
181
243
|
updateHighlighted = (event: Event): void =>
|
|
182
244
|
highlightTerms(
|
|
183
245
|
this.querySelectorAll(HIGHLIGHTABLE_SELECTOR),
|
|
@@ -84,10 +84,10 @@ header:not(.has-brand) > .header_l2 {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
.header_l2_group-title {
|
|
87
|
-
height: var(--dx-g-doc-header-main-nav-height);
|
|
88
87
|
margin-right: 0;
|
|
89
88
|
padding: var(--dx-g-spacing-smd)
|
|
90
89
|
var(--dx-g-global-header-padding-horizontal);
|
|
90
|
+
min-height: var(--dx-g-doc-header-main-nav-height);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
.header_l2_group-title .header_lang-dropdown {
|
|
@@ -8,7 +8,7 @@ import { track } from "dxUtils/analytics";
|
|
|
8
8
|
|
|
9
9
|
const TABLET_MATCH = "980px";
|
|
10
10
|
const MOBILE_MATCH = "880px";
|
|
11
|
-
const SMALL_MOBILE_MATCH = "
|
|
11
|
+
const SMALL_MOBILE_MATCH = "768px";
|
|
12
12
|
|
|
13
13
|
export default class Header extends HeaderBase {
|
|
14
14
|
@api langValuePath: string = "id"; // allows to override how language property is interpreted, follows valuePath dropdown api.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
if:true={loaded}
|
|
4
4
|
coveo-organization-id={coveoOrganizationId}
|
|
5
5
|
coveo-public-access-token={coveoPublicAccessToken}
|
|
6
|
-
coveo-search-hub=
|
|
6
|
+
coveo-search-hub={coveoSearchHub}
|
|
7
7
|
coveo-advanced-query-config={coveoAdvancedQueryConfig}
|
|
8
8
|
sidebar-header="Pages"
|
|
9
9
|
sidebar-content={sidebarContent}
|
|
@@ -32,6 +32,7 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
32
32
|
@api apiDomain = "https://developer.salesforce.com";
|
|
33
33
|
@api coveoOrganizationId!: string;
|
|
34
34
|
@api coveoPublicAccessToken!: string;
|
|
35
|
+
@api coveoSearchHub!: string;
|
|
35
36
|
|
|
36
37
|
@api
|
|
37
38
|
get allLanguages(): Array<Language> {
|
|
@@ -155,7 +156,29 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
155
156
|
));
|
|
156
157
|
|
|
157
158
|
if (anchorEl) {
|
|
158
|
-
|
|
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
|
+
});
|
|
181
|
+
|
|
159
182
|
this.setState({ internalLinkClicked: false });
|
|
160
183
|
}
|
|
161
184
|
|