@salesforcedevs/docs-components 0.68.2 → 0.68.3-alpha.19
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": "0.68.
|
|
3
|
+
"version": "0.68.3-alpha.19+dc9e7409",
|
|
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": "dc9e74091d9f224cc819c9171fe8fb152bfd6a41"
|
|
28
28
|
}
|
|
@@ -78,6 +78,8 @@ export default class ContentLayout extends LightningElement {
|
|
|
78
78
|
private anchoredElements: AnchorMap = {};
|
|
79
79
|
private lastScrollPosition: number;
|
|
80
80
|
private observer?: IntersectionObserver;
|
|
81
|
+
private hasRendered: boolean = false;
|
|
82
|
+
|
|
81
83
|
private searchSyncer = new SearchSyncer({
|
|
82
84
|
callbacks: {
|
|
83
85
|
onUrlChange: (nextSearchString: string): void => {
|
|
@@ -125,6 +127,7 @@ export default class ContentLayout extends LightningElement {
|
|
|
125
127
|
this._scrollInterval = window.setInterval(() => {
|
|
126
128
|
this.saveScroll();
|
|
127
129
|
}, 1000);
|
|
130
|
+
|
|
128
131
|
|
|
129
132
|
}
|
|
130
133
|
|
|
@@ -138,7 +141,10 @@ export default class ContentLayout extends LightningElement {
|
|
|
138
141
|
this.attachInteractionObserver,
|
|
139
142
|
OBSERVER_ATTACH_WAIT_TIME
|
|
140
143
|
);
|
|
141
|
-
this.
|
|
144
|
+
if(!this.hasRendered) {
|
|
145
|
+
this.hasRendered = true;
|
|
146
|
+
this.restoreScroll();
|
|
147
|
+
}
|
|
142
148
|
}
|
|
143
149
|
|
|
144
150
|
disconnectedCallback(): void {
|
|
@@ -18,11 +18,6 @@ import { Breadcrumb, Language } from "typings/custom";
|
|
|
18
18
|
// TODO: Imitating from actual implementation as doc-content use it like this. We should refactor it later.
|
|
19
19
|
const handleContentError = (error): void => console.log(error);
|
|
20
20
|
|
|
21
|
-
const FIRST_CRUMB = {
|
|
22
|
-
href: "/docs",
|
|
23
|
-
label: "Documentation"
|
|
24
|
-
};
|
|
25
|
-
|
|
26
21
|
const PIXEL_PER_CHARACTER_MAP: { [key: string]: number } = {
|
|
27
22
|
default: 7.7,
|
|
28
23
|
"ja-jp": 12.5
|
|
@@ -581,6 +576,10 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
581
576
|
);
|
|
582
577
|
}
|
|
583
578
|
|
|
579
|
+
get showBreadcrumbs(): boolean {
|
|
580
|
+
return this.breadcrumbs && this.breadcrumbs.length > 0;
|
|
581
|
+
}
|
|
582
|
+
|
|
584
583
|
private buildBreadcrumbs(): void {
|
|
585
584
|
const { contentDocumentId } = this.pageReference;
|
|
586
585
|
if (!contentDocumentId) {
|
|
@@ -588,23 +587,29 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
588
587
|
}
|
|
589
588
|
|
|
590
589
|
const currentNode = this.tocMap[contentDocumentId];
|
|
591
|
-
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
if(currentNode?.parent) {
|
|
593
|
+
this.breadcrumbs = this.nodeToBreadcrumb(currentNode);
|
|
594
|
+
} else {
|
|
595
|
+
this.breadcrumbs = [];
|
|
596
|
+
}
|
|
592
597
|
}
|
|
593
598
|
|
|
594
|
-
private nodeToBreadcrumb(node
|
|
595
|
-
|
|
596
|
-
|
|
599
|
+
private nodeToBreadcrumb(node: TreeNode): Breadcrumb[] {
|
|
600
|
+
const item = {
|
|
601
|
+
href: this.pageReferenceToString({
|
|
602
|
+
...this.pageReference,
|
|
603
|
+
contentDocumentId: node.name
|
|
604
|
+
}),
|
|
605
|
+
label: node.label
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
if (node.parent) {
|
|
609
|
+
return [...this.nodeToBreadcrumb(node.parent), item];
|
|
597
610
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
{
|
|
601
|
-
href: this.pageReferenceToString({
|
|
602
|
-
...this.pageReference,
|
|
603
|
-
contentDocumentId: node.name
|
|
604
|
-
}),
|
|
605
|
-
label: node.label
|
|
606
|
-
}
|
|
607
|
-
];
|
|
611
|
+
|
|
612
|
+
return [item];
|
|
608
613
|
}
|
|
609
614
|
|
|
610
615
|
addMetatags(): void {
|