@salesforcedevs/docs-components 1.31.0-md-alpha → 1.31.0-md-alpha1
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
|
@@ -9,8 +9,7 @@ import { buildDocLinkClickHandler } from "dxUtils/analytics";
|
|
|
9
9
|
import ContentActionToolbar from "doc/contentActionToolbar";
|
|
10
10
|
|
|
11
11
|
const CONTENT_ACTION_TOOLBAR_TAG = "doc-content-action-toolbar";
|
|
12
|
-
const
|
|
13
|
-
const FALLBACK_HEADING_SELECTOR = "h1, h2, h3, h4, h5, h6";
|
|
12
|
+
const HEADING_SELECTOR = "h1, h2, h3, h4, h5, h6";
|
|
14
13
|
const CONTENT_BODY_SELECTOR = ".content-body-container .content-body";
|
|
15
14
|
|
|
16
15
|
type AnchorMap = { [key: string]: { intersect: boolean; id: string } };
|
|
@@ -288,8 +287,8 @@ export default class ContentLayout extends LightningElement {
|
|
|
288
287
|
|
|
289
288
|
/**
|
|
290
289
|
* Inserts the content action toolbar into the slotted content immediately
|
|
291
|
-
* after the first
|
|
292
|
-
*
|
|
290
|
+
* after the first heading (any level) found inside the content body. This is
|
|
291
|
+
* the page's H1 when present, otherwise the first heading in document order.
|
|
293
292
|
*/
|
|
294
293
|
protected updateContentActionToolbar(): void {
|
|
295
294
|
if (!this.showContentActionToolbar || !this.sidebarValue) {
|
|
@@ -306,11 +305,10 @@ export default class ContentLayout extends LightningElement {
|
|
|
306
305
|
return;
|
|
307
306
|
}
|
|
308
307
|
|
|
309
|
-
const heading =
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
)) as HTMLElement | null;
|
|
308
|
+
const heading = querySelector(
|
|
309
|
+
HEADING_SELECTOR,
|
|
310
|
+
contentBody
|
|
311
|
+
) as HTMLElement | null;
|
|
314
312
|
|
|
315
313
|
if (!heading) {
|
|
316
314
|
return;
|