@salesforcedevs/docs-components 1.30.1-node22-2 → 1.30.1
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/lwc.config.json +3 -0
- package/package.json +3 -7
- package/src/modules/doc/amfReference/amfReference.html +1 -0
- package/src/modules/doc/amfReference/amfReference.ts +54 -10
- package/src/modules/doc/amfReference/types.ts +5 -0
- package/src/modules/doc/banner/banner.css +88 -0
- package/src/modules/doc/banner/banner.html +47 -0
- package/src/modules/doc/banner/banner.ts +73 -0
- package/src/modules/doc/contentActionToolbar/contentActionToolbar.css +31 -0
- package/src/modules/doc/contentActionToolbar/contentActionToolbar.html +53 -0
- package/src/modules/doc/contentActionToolbar/contentActionToolbar.ts +151 -0
- package/src/modules/doc/contentActionToolbar/contentActionToolbarMocks.ts +48 -0
- package/src/modules/doc/contentLayout/contentLayout.html +1 -1
- package/src/modules/doc/contentLayout/contentLayout.ts +103 -2
- package/src/modules/doc/header/header.html +0 -1
- package/src/modules/doc/localeBanner/localeBanner.css +3 -0
- package/src/modules/doc/localeBanner/localeBanner.html +9 -0
- package/src/modules/doc/localeBanner/localeBanner.ts +195 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +5 -2
- package/src/modules/doc/redocReference/redocReference.ts +157 -2
- package/src/modules/doc/xmlContent/xmlContent.html +1 -1
- package/src/modules/doc/xmlContent/xmlContent.ts +28 -1
|
@@ -322,8 +322,10 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
-
private handlePopState = (event: PopStateEvent): void =>
|
|
325
|
+
private handlePopState = (event: PopStateEvent): void => {
|
|
326
326
|
this.updatePageReference(this.getReferenceFromUrl(), event);
|
|
327
|
+
this.handleLocaleReload();
|
|
328
|
+
};
|
|
327
329
|
|
|
328
330
|
handleDismissVersionBanner() {
|
|
329
331
|
this.showVersionBanner = false;
|
|
@@ -598,6 +600,31 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
598
600
|
"docs",
|
|
599
601
|
this.pageReferenceToString(this.pageReference)
|
|
600
602
|
);
|
|
603
|
+
this.handleLocaleReload();
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/* This method reloads the page as locale banner context is not available in developer-website. */
|
|
607
|
+
private handleLocaleReload(): void {
|
|
608
|
+
const targetLocale = this.language?.id;
|
|
609
|
+
if (!targetLocale) {
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
const currentPath = window.location.pathname;
|
|
614
|
+
const localePattern = /atlas\.[a-z]{2}-[a-z]{2}\./;
|
|
615
|
+
|
|
616
|
+
if (localePattern.test(currentPath)) {
|
|
617
|
+
const newPath = currentPath.replace(
|
|
618
|
+
localePattern,
|
|
619
|
+
`atlas.${targetLocale}.`
|
|
620
|
+
);
|
|
621
|
+
const newUrl =
|
|
622
|
+
window.location.origin +
|
|
623
|
+
newPath +
|
|
624
|
+
window.location.search +
|
|
625
|
+
window.location.hash;
|
|
626
|
+
window.location.href = newUrl;
|
|
627
|
+
}
|
|
601
628
|
}
|
|
602
629
|
|
|
603
630
|
private updateHighlighting(searchParam: string): void {
|