@salesforcedevs/docs-components 1.2.19 → 1.2.20-alpha

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.2.19",
3
+ "version": "1.2.20-alpha",
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": "5083a781c4f6fb193f72e6ef53ccfabfa41044c4"
27
+ "gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
28
28
  }
@@ -615,6 +615,18 @@ export default class DocXmlContent extends LightningElementWithState<{
615
615
  return [item];
616
616
  }
617
617
 
618
+ dropVersionFromDocId(docId: string): string {
619
+ const docIdElemets = docId.split(".");
620
+ const filteredDocId = docIdElemets.filter((docIdElement) => {
621
+ const versionRegex = /^[0-9]+$/;
622
+ if (versionRegex.test(docIdElement)) {
623
+ return "";
624
+ }
625
+ return docIdElement;
626
+ });
627
+ return filteredDocId.join(".");
628
+ }
629
+
618
630
  addMetatags(): void {
619
631
  const div = document.createElement("div");
620
632
  div.innerHTML = this.docContent;
@@ -646,6 +658,9 @@ export default class DocXmlContent extends LightningElementWithState<{
646
658
  'link[rel="canonical"]'
647
659
  );
648
660
  if (metadescription) {
661
+ this.pageReference.docId = this.pageReference.docId
662
+ ? this.dropVersionFromDocId(this.pageReference.docId)
663
+ : this.pageReference.docId;
649
664
  metadescription.setAttribute(
650
665
  "href",
651
666
  window.location.protocol +
package/LICENSE DELETED
@@ -1,12 +0,0 @@
1
- Copyright (c) 2020, Salesforce.com, Inc.
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
-
6
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
-
8
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
-
10
- * Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.