@salesforcedevs/docs-components
Advanced tools
Comparing version 1.3.296 to 1.3.300-amf-fix-alpha
{ | ||
"name": "@salesforcedevs/docs-components", | ||
"version": "1.3.296", | ||
"version": "1.3.300-amf-fix-alpha", | ||
"description": "Docs Lightning web components for DSC", | ||
@@ -27,3 +27,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "7a3e47bb11802dbded4c5bd3814b408cbeedecd7" | ||
"gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad" | ||
} |
@@ -12,3 +12,2 @@ import { LightningElement, api } from "lwc"; | ||
import { Json } from "typings/custom"; | ||
const TABLE_SIZE_MATCH = "769px"; | ||
@@ -19,3 +18,3 @@ | ||
private amf: Json; | ||
private type: string | undefined; | ||
private type: any; | ||
@@ -32,3 +31,3 @@ @api | ||
) { | ||
this.amf = value && clone(value.amf); | ||
this.amf = value && this.clone(value.amf); | ||
} | ||
@@ -39,3 +38,3 @@ if ( | ||
) { | ||
this.type = value && clone(value.type); | ||
this.type = value && this.getTypeCloned(value.type); | ||
} | ||
@@ -50,2 +49,48 @@ | ||
cloneWithWorker(value) { | ||
return new Promise((resolve, reject) => { | ||
const worker = new Worker("./cloneAmfObject.ts"); | ||
worker.onmessage = (event) => { | ||
resolve(event.data); | ||
worker.terminate(); | ||
}; | ||
worker.onerror = (error) => { | ||
reject(error); | ||
worker.terminate(); | ||
}; | ||
worker.postMessage(value); | ||
}); | ||
} | ||
/** | ||
* 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 { | ||
// return JSON.parse(JSON.stringify(value)); | ||
// } | ||
async clone(value: any) { | ||
try { | ||
const clonedObject = await this.cloneWithWorker(value); | ||
return clonedObject; | ||
} catch (error) { | ||
console.error("Error cloning value:", error); | ||
return null; | ||
} | ||
} | ||
async getTypeCloned(value: any) { | ||
const typeObj = await this.clone(value.type); | ||
if (typeObj) { | ||
return typeObj; | ||
} | ||
return ""; | ||
} | ||
update(): void { | ||
@@ -113,11 +158,1 @@ if (!this.model) { | ||
} | ||
/** | ||
* 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 { | ||
return JSON.parse(JSON.stringify(value)); | ||
} |
@@ -115,12 +115,19 @@ import { LightningElement, api } from "lwc"; | ||
if (!this.observer) { | ||
this.observer = new ResizeObserver((entries) => { | ||
const [nav] = entries; | ||
if (this.navWidth === nav.contentRect.width) { | ||
return; | ||
} | ||
this.navWidth = nav.contentRect.width; | ||
this.updateDropdownOptionAmount(); | ||
}); | ||
try { | ||
this.observer = new ResizeObserver((entries) => { | ||
const [nav] = entries; | ||
if (this.navWidth === nav.contentRect.width) { | ||
return; | ||
} | ||
this.navWidth = nav.contentRect.width; | ||
this.updateDropdownOptionAmount(); | ||
}); | ||
this.observer.observe(this.template.querySelector("nav")!); | ||
this.observer.observe(this.template.querySelector("nav")!); | ||
} catch (error) { | ||
console.error( | ||
"Error occured while setting up ResizeObserver on breadcrumbs", | ||
error | ||
); | ||
} | ||
} | ||
@@ -127,0 +134,0 @@ } |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
6561
255526
2