@salesforcedevs/docs-components
Advanced tools
Comparing version 1.3.304-ww-fix-alpha1 to 1.3.319-alpha.0
{ | ||
"name": "@salesforcedevs/docs-components", | ||
"version": "1.3.304-ww-fix-alpha1", | ||
"version": "1.3.319-alpha.0", | ||
"description": "Docs Lightning web components for DSC", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -1478,6 +1478,14 @@ import { LightningElement, api, track } from "lwc"; | ||
// Adding stringify inside try/catch | ||
let amfModelString = ""; | ||
try { | ||
amfModelString = JSON.stringify(this.amfMap[referenceId].model); | ||
} catch (error) { | ||
console.error(`Error stringifying amf model: ${error}`); | ||
} | ||
// This updates the component in the content section. | ||
this.topicModel = { | ||
type, | ||
amf: this.amfMap[referenceId].model, | ||
amf: amfModelString, | ||
parser: this.amfMap[referenceId].parser, | ||
@@ -1484,0 +1492,0 @@ id: amfId |
@@ -98,3 +98,3 @@ import { Json, DocPhaseInfo } from "typings/custom"; | ||
type: string; | ||
amf: AmfModel; | ||
amf: string; | ||
parser: AmfParser; | ||
@@ -101,0 +101,0 @@ } |
@@ -30,3 +30,7 @@ import { LightningElement, api } from "lwc"; | ||
) { | ||
this.amf = value && clone(value.amf); | ||
try { | ||
this.amf = value && JSON.parse(value.amf); | ||
} catch (error) { | ||
console.error(`Error parsing amf model: ${error}`); | ||
} | ||
} | ||
@@ -37,3 +41,3 @@ if ( | ||
) { | ||
this.type = value && clone(value.type); | ||
this.type = value && value.type; | ||
} | ||
@@ -110,18 +114,1 @@ | ||
} | ||
/** | ||
* The underlying web components we use from api-console mutate their models we pass in. | ||
* Since LWC makes them Read Only, we need to copy them before passing to the Web Component. | ||
* @param value JSON Serializable object to clone. | ||
* @returns A copy of Value. One that has been serialized and parsed via JSON. (Functions, Regex, etc are not preserved.) | ||
*/ | ||
function clone(value: any): any { | ||
const worker = new Worker("./worker.js"); | ||
worker.postMessage(value); | ||
return new Promise((resolve) => { | ||
worker.addEventListener("message", (event) => { | ||
resolve(event.data); | ||
worker.terminate(); | ||
}); | ||
}); | ||
} |
@@ -54,4 +54,4 @@ import { Json } from "typings/custom"; | ||
type: string; | ||
amf: AmfModel; | ||
amf: string; | ||
parser: AmfModelParser; | ||
} |
@@ -6,3 +6,3 @@ import { LightningElement, api } from "lwc"; | ||
export default class ContentCallout extends LightningElement { | ||
@api title!: string; | ||
@api header!: string; | ||
@api variant!: CalloutVariant; | ||
@@ -9,0 +9,0 @@ cardVariant?: string; |
@@ -346,4 +346,6 @@ /* eslint-disable @lwc/lwc/no-document-query */ | ||
for (const headingElement of headingElements as any) { | ||
// Sometimes elements hash is not being set when slot content is wrapped with div | ||
// Sometimes elements hash and header is not being set when slot content is wrapped with div | ||
headingElement.hash = headingElement.attributes.hash?.nodeValue; | ||
headingElement.header = | ||
headingElement.attributes.header?.nodeValue; | ||
} | ||
@@ -365,3 +367,3 @@ | ||
id: headingElement.id, | ||
label: headingElement.title | ||
label: headingElement.header | ||
}; | ||
@@ -368,0 +370,0 @@ tocOptions.push(tocItem); |
@@ -16,3 +16,3 @@ import { LightningElement, api } from "lwc"; | ||
export default class Heading extends LightningElement { | ||
@api title: string = ""; | ||
@api header: string = ""; | ||
@api hash: string | null = null; | ||
@@ -19,0 +19,0 @@ |
@@ -9,3 +9,3 @@ import { LightningElement, api } from "lwc"; | ||
@api iconSymbol?: IconSymbol; | ||
@api title: string = ""; | ||
@api header: string = ""; | ||
@api urlText: string = ""; | ||
@@ -26,3 +26,3 @@ | ||
try { | ||
if (this.title && this.urlText) { | ||
if (this.header && this.urlText) { | ||
const [hostUrl] = window.location.href.split("#"); | ||
@@ -29,0 +29,0 @@ const url = `${hostUrl}#${this.urlText}`; |
import { LightningElement, api } from "lwc"; | ||
export default class HeadingContent extends LightningElement { | ||
@api title: string = ""; | ||
@api header: string = ""; | ||
@api hash: string | null = null; | ||
@@ -21,3 +21,3 @@ | ||
try { | ||
if (this.title && this.hash) { | ||
if (this.header && this.hash) { | ||
const [hostUrl] = window.location.href.split("#"); | ||
@@ -24,0 +24,0 @@ const url = `${hostUrl}#${this.hash}`; |
@@ -6,3 +6,3 @@ import { LightningElement, api } from "lwc"; | ||
@api docPhaseInfo!: DocPhaseInfo; | ||
@api title!: string; | ||
@api header!: string; | ||
@api description!: string; | ||
@@ -9,0 +9,0 @@ @api primaryLink!: Link; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
254492
75
6530