@salesforcedevs/docs-components 0.56.2-seo-test15 → 0.56.2-seo-test16

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.56.2-seo-test15",
3
+ "version": "0.56.2-seo-test16",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -885,7 +885,14 @@ export default class AmfReference extends LightningElement {
885
885
  const urlPath = referenceUrl.substring(
886
886
  indexOfQueryParam >= 0 ? indexOfQueryParam : referenceUrl.length
887
887
  );
888
- return this.parseParams(urlPath).meta as string;
888
+ const meta = this.parseParams(urlPath).meta as string;
889
+ // Always get the meta query param encoded and decode it and store it for internal use
890
+ // This has 2 advantages,
891
+ // 1. Supports backward compatible meta query param, so there is no need for redirects.
892
+ // 2. Supports Prerender and Coveo for their crawling.
893
+ const encodedMeta = meta && this.getUrlEncoded(meta);
894
+ const decodedMeta = encodedMeta && decodeURIComponent(encodedMeta);
895
+ return decodedMeta || "";
889
896
  }
890
897
 
891
898
  /**
@@ -934,10 +941,6 @@ export default class AmfReference extends LightningElement {
934
941
  let type = "";
935
942
  if (this.isSpecBasedReference(referenceId)) {
936
943
  meta = this.getMetaFromUrl(referenceUrl);
937
- // Always get the meta query param encoded and decode it and store it for internal use
938
- // This has 2 advantages,
939
- // 1. Supports backward compatible meta query param, so there is no need for redirects.
940
- // 2. Supports Prerender and Coveo for their crawling.
941
944
  if (meta) {
942
945
  if (meta.includes(":")) {
943
946
  const metaInfo = meta.split(":");
@@ -1226,18 +1229,16 @@ export default class AmfReference extends LightningElement {
1226
1229
  this.isSpecBasedReference(urlReferenceId);
1227
1230
  if (specBasedReference) {
1228
1231
  const metaVal = this.getMetaFromUrl(name);
1229
- const encodedMeta = this.getUrlEncoded(metaVal);
1230
- const decodedMeta = decodeURIComponent(encodedMeta);
1231
1232
  const currentSelectedMeta = this.selectedTopic
1232
1233
  ? this.selectedTopic.meta
1233
1234
  : "";
1234
1235
 
1235
- if (decodedMeta && decodedMeta === currentSelectedMeta) {
1236
+ if (metaVal && metaVal === currentSelectedMeta) {
1236
1237
  // selecting the same nav item, skip update
1237
1238
  return;
1238
1239
  }
1239
1240
 
1240
- const metadata = this.metadata[decodedMeta];
1241
+ const metadata = this.metadata[metaVal];
1241
1242
  if (metadata) {
1242
1243
  const {
1243
1244
  parentReferencePath,
@@ -1252,12 +1253,9 @@ export default class AmfReference extends LightningElement {
1252
1253
  amfId,
1253
1254
  type,
1254
1255
  elementId,
1255
- decodedMeta
1256
- );
1257
- this.updateUrlWithSelected(
1258
- parentReferencePath,
1259
- decodedMeta
1256
+ metaVal
1260
1257
  );
1258
+ this.updateUrlWithSelected(parentReferencePath, metaVal);
1261
1259
  this.updateNavTitleMetaTag(metadata.navTitle);
1262
1260
  } else {
1263
1261
  if (this.isParentReferencePath(name)) {