@salesforcedevs/docs-components 1.3.304-async-fix-alpha1 → 1.3.319
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/LICENSE +12 -0
- package/package.json +3 -4
- package/src/modules/doc/amfReference/amfReference.ts +9 -1
- package/src/modules/doc/amfReference/types.ts +1 -1
- package/src/modules/doc/amfTopic/amfTopic.ts +6 -14
- package/src/modules/doc/amfTopic/types.ts +1 -1
- package/src/modules/doc/amfTopic/worker.ts +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.319",
|
|
4
4
|
"description": "Docs Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -17,13 +17,12 @@
|
|
|
17
17
|
"lodash.orderby": "^4.6.0",
|
|
18
18
|
"lodash.uniqby": "^4.7.0",
|
|
19
19
|
"query-string": "^7.1.3",
|
|
20
|
-
"sentence-case": "^3.0.4"
|
|
21
|
-
"yieldable-json": "^2.0.1"
|
|
20
|
+
"sentence-case": "^3.0.4"
|
|
22
21
|
},
|
|
23
22
|
"devDependencies": {
|
|
24
23
|
"@types/classnames": "^2.2.10",
|
|
25
24
|
"@types/lodash.orderby": "^4.6.7",
|
|
26
25
|
"@types/lodash.uniqby": "^4.7.7"
|
|
27
26
|
},
|
|
28
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "11298c74de6a1f33153b9c6e8dbb1bcd5851ce59"
|
|
29
28
|
}
|
|
@@ -1475,10 +1475,18 @@ export default class AmfReference extends LightningElement {
|
|
|
1475
1475
|
// update topic view
|
|
1476
1476
|
const { referenceId, amfId, type } = this.selectedTopic!;
|
|
1477
1477
|
|
|
1478
|
+
// Adding stringify inside try/catch
|
|
1479
|
+
let amfModelString = "";
|
|
1480
|
+
try {
|
|
1481
|
+
amfModelString = JSON.stringify(this.amfMap[referenceId].model);
|
|
1482
|
+
} catch (error) {
|
|
1483
|
+
console.error(`Error stringifying amf model: ${error}`);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1478
1486
|
// This updates the component in the content section.
|
|
1479
1487
|
this.topicModel = {
|
|
1480
1488
|
type,
|
|
1481
|
-
amf:
|
|
1489
|
+
amf: amfModelString,
|
|
1482
1490
|
parser: this.amfMap[referenceId].parser,
|
|
1483
1491
|
id: amfId
|
|
1484
1492
|
};
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
} from "./utils";
|
|
10
10
|
import type { TopicModel } from "./types";
|
|
11
11
|
import { Json } from "typings/custom";
|
|
12
|
-
import { parse, stringify } from "yieldable-json";
|
|
13
12
|
|
|
14
13
|
const TABLE_SIZE_MATCH = "769px";
|
|
15
14
|
|
|
@@ -28,13 +27,17 @@ export default class AmfTopic extends LightningElement {
|
|
|
28
27
|
!this.amf ||
|
|
29
28
|
(value && this._model && value.amf !== this._model?.amf)
|
|
30
29
|
) {
|
|
31
|
-
|
|
30
|
+
try {
|
|
31
|
+
this.amf = value && JSON.parse(value.amf);
|
|
32
|
+
} catch (error) {
|
|
33
|
+
console.error(`Error parsing amf model: ${error}`);
|
|
34
|
+
}
|
|
32
35
|
}
|
|
33
36
|
if (
|
|
34
37
|
!this.type ||
|
|
35
38
|
(value && this._model && value.type !== this._model?.type)
|
|
36
39
|
) {
|
|
37
|
-
this.type = value &&
|
|
40
|
+
this.type = value && value.type;
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
this._model = value;
|
|
@@ -106,14 +109,3 @@ export default class AmfTopic extends LightningElement {
|
|
|
106
109
|
}
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* The underlying web components we use from api-console mutate their models we pass in.
|
|
112
|
-
* Since LWC makes them Read Only, we need to copy them before passing to the Web Component.
|
|
113
|
-
* @param value JSON Serializable object to clone.
|
|
114
|
-
* @returns A copy of Value. One that has been serialized and parsed via JSON. (Functions, Regex, etc are not preserved.)
|
|
115
|
-
*/
|
|
116
|
-
async function clone(value: any): any {
|
|
117
|
-
const parsedValue = await parse(stringify(value));
|
|
118
|
-
return parsedValue;
|
|
119
|
-
}
|