@salesforcedevs/docs-components 1.3.304-amf-fix-alpha1 → 1.3.304-ww-fix-alpha1
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
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
import type { TopicModel } from "./types";
|
|
11
11
|
import { Json } from "typings/custom";
|
|
12
12
|
|
|
13
|
-
|
|
14
13
|
const TABLE_SIZE_MATCH = "769px";
|
|
15
14
|
|
|
16
15
|
export default class AmfTopic extends LightningElement {
|
|
@@ -24,24 +23,17 @@ export default class AmfTopic extends LightningElement {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
set model(value: TopicModel) {
|
|
27
|
-
const amfJsonObj = clone(value);
|
|
28
26
|
if (
|
|
29
27
|
!this.amf ||
|
|
30
|
-
(value &&
|
|
31
|
-
this._model &&
|
|
32
|
-
value.amf !== this._model?.amf &&
|
|
33
|
-
amfJsonObj?.amf)
|
|
28
|
+
(value && this._model && value.amf !== this._model?.amf)
|
|
34
29
|
) {
|
|
35
|
-
this.amf = value &&
|
|
30
|
+
this.amf = value && clone(value.amf);
|
|
36
31
|
}
|
|
37
32
|
if (
|
|
38
33
|
!this.type ||
|
|
39
|
-
(value &&
|
|
40
|
-
this._model &&
|
|
41
|
-
value.type !== this._model?.type &&
|
|
42
|
-
amfJsonObj?.type)
|
|
34
|
+
(value && this._model && value.type !== this._model?.type)
|
|
43
35
|
) {
|
|
44
|
-
this.type = value &&
|
|
36
|
+
this.type = value && clone(value.type);
|
|
45
37
|
}
|
|
46
38
|
|
|
47
39
|
this._model = value;
|
|
@@ -121,5 +113,12 @@ export default class AmfTopic extends LightningElement {
|
|
|
121
113
|
* @returns A copy of Value. One that has been serialized and parsed via JSON. (Functions, Regex, etc are not preserved.)
|
|
122
114
|
*/
|
|
123
115
|
function clone(value: any): any {
|
|
124
|
-
|
|
116
|
+
const worker = new Worker("./worker.js");
|
|
117
|
+
worker.postMessage(value);
|
|
118
|
+
return new Promise((resolve) => {
|
|
119
|
+
worker.addEventListener("message", (event) => {
|
|
120
|
+
resolve(event.data);
|
|
121
|
+
worker.terminate();
|
|
122
|
+
});
|
|
123
|
+
});
|
|
125
124
|
}
|