@salesforcedevs/docs-components 1.3.304-async-fix-alpha1 → 1.3.319-alpha.0
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 +2 -3
- 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/contentCallout/contentCallout.html +1 -1
- package/src/modules/doc/contentCallout/contentCallout.ts +1 -1
- package/src/modules/doc/contentLayout/contentLayout.html +1 -1
- package/src/modules/doc/contentLayout/contentLayout.ts +4 -2
- package/src/modules/doc/heading/heading.html +4 -4
- package/src/modules/doc/heading/heading.ts +1 -1
- package/src/modules/doc/headingAnchor/headingAnchor.ts +2 -2
- package/src/modules/doc/headingContent/headingContent.html +2 -2
- package/src/modules/doc/headingContent/headingContent.ts +2 -2
- package/src/modules/doc/overview/overview.html +2 -2
- package/src/modules/doc/overview/overview.ts +1 -1
- package/src/modules/doc/amfTopic/worker.ts +0 -3
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-alpha.0",
|
|
4
4
|
"description": "Docs Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -17,8 +17,7 @@
|
|
|
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",
|
|
@@ -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
|
-
}
|
|
@@ -3,7 +3,7 @@ import cx from "classnames";
|
|
|
3
3
|
import { CalloutVariant, LightningSlotElement } from "typings/custom";
|
|
4
4
|
|
|
5
5
|
export default class ContentCallout extends LightningElement {
|
|
6
|
-
@api
|
|
6
|
+
@api header!: string;
|
|
7
7
|
@api variant!: CalloutVariant;
|
|
8
8
|
cardVariant?: string;
|
|
9
9
|
iconName?: string;
|
|
@@ -343,8 +343,10 @@ export default class ContentLayout extends LightningElement {
|
|
|
343
343
|
);
|
|
344
344
|
|
|
345
345
|
for (const headingElement of headingElements as any) {
|
|
346
|
-
// Sometimes elements hash is not being set when slot content is wrapped with div
|
|
346
|
+
// Sometimes elements hash and header is not being set when slot content is wrapped with div
|
|
347
347
|
headingElement.hash = headingElement.attributes.hash?.nodeValue;
|
|
348
|
+
headingElement.header =
|
|
349
|
+
headingElement.attributes.header?.nodeValue;
|
|
348
350
|
}
|
|
349
351
|
|
|
350
352
|
const tocOptions = [];
|
|
@@ -361,7 +363,7 @@ export default class ContentLayout extends LightningElement {
|
|
|
361
363
|
const tocItem = {
|
|
362
364
|
anchor: `#${headingElement.hash}`,
|
|
363
365
|
id: headingElement.id,
|
|
364
|
-
label: headingElement.
|
|
366
|
+
label: headingElement.header
|
|
365
367
|
};
|
|
366
368
|
tocOptions.push(tocItem);
|
|
367
369
|
this.tocOptionIdsSet.add(headingElement.id);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<h1 class={className} if:true={isAriaLevelOne}>
|
|
3
|
-
<doc-heading-content
|
|
3
|
+
<doc-heading-content header={header} hash={hash}></doc-heading-content>
|
|
4
4
|
</h1>
|
|
5
5
|
<h2 class={className} if:true={isAriaLevelTwo}>
|
|
6
|
-
<doc-heading-content
|
|
6
|
+
<doc-heading-content header={header} hash={hash}></doc-heading-content>
|
|
7
7
|
</h2>
|
|
8
8
|
<h3 class={className} if:true={isAriaLevelThree}>
|
|
9
|
-
<doc-heading-content
|
|
9
|
+
<doc-heading-content header={header} hash={hash}></doc-heading-content>
|
|
10
10
|
</h3>
|
|
11
11
|
<h4 class={className} if:true={isAriaLevelFour}>
|
|
12
|
-
<doc-heading-content
|
|
12
|
+
<doc-heading-content header={header} hash={hash}></doc-heading-content>
|
|
13
13
|
</h4>
|
|
14
14
|
</template>
|
|
@@ -13,7 +13,7 @@ export const displayLevels = Object.values(ariaDisplayLevels);
|
|
|
13
13
|
|
|
14
14
|
// @ts-ignore: Really Dark Magic (TM) to do with ariaLevel needing explicit getter/setters
|
|
15
15
|
export default class Heading extends LightningElement {
|
|
16
|
-
@api
|
|
16
|
+
@api header: string = "";
|
|
17
17
|
@api hash: string | null = null;
|
|
18
18
|
|
|
19
19
|
@api
|
|
@@ -6,7 +6,7 @@ export default class HeadingAnchor extends LightningElement {
|
|
|
6
6
|
@api iconSize?: IconSize = "override";
|
|
7
7
|
@api iconSprite?: IconSprite = "utility";
|
|
8
8
|
@api iconSymbol?: IconSymbol;
|
|
9
|
-
@api
|
|
9
|
+
@api header: string = "";
|
|
10
10
|
@api urlText: string = "";
|
|
11
11
|
|
|
12
12
|
label: string = "Copy link to clipboard";
|
|
@@ -22,7 +22,7 @@ export default class HeadingAnchor extends LightningElement {
|
|
|
22
22
|
}, 2000);
|
|
23
23
|
|
|
24
24
|
try {
|
|
25
|
-
if (this.
|
|
25
|
+
if (this.header && this.urlText) {
|
|
26
26
|
const [hostUrl] = window.location.href.split("#");
|
|
27
27
|
const url = `${hostUrl}#${this.urlText}`;
|
|
28
28
|
await navigator.clipboard.writeText(url);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<template if:false={hash}>{
|
|
2
|
+
<template if:false={hash}>{header}</template>
|
|
3
3
|
<template if:true={hash}>
|
|
4
|
-
<span class="title">{
|
|
4
|
+
<span class="title">{header} </span>
|
|
5
5
|
<dx-tooltip placement="top" label={label}>
|
|
6
6
|
<span class="button-container">
|
|
7
7
|
<button onclick={copy} aria-label="copy">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
|
|
3
3
|
export default class HeadingContent extends LightningElement {
|
|
4
|
-
@api
|
|
4
|
+
@api header: string = "";
|
|
5
5
|
@api hash: string | null = null;
|
|
6
6
|
|
|
7
7
|
label: string = "Copy link to clipboard";
|
|
@@ -18,7 +18,7 @@ export default class HeadingContent extends LightningElement {
|
|
|
18
18
|
}, 2000);
|
|
19
19
|
|
|
20
20
|
try {
|
|
21
|
-
if (this.
|
|
21
|
+
if (this.header && this.hash) {
|
|
22
22
|
const [hostUrl] = window.location.href.split("#");
|
|
23
23
|
const url = `${hostUrl}#${this.hash}`;
|
|
24
24
|
await navigator.clipboard.writeText(url);
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<div class="content">
|
|
11
11
|
<dx-group-text
|
|
12
12
|
class="description"
|
|
13
|
-
|
|
13
|
+
header={header}
|
|
14
14
|
body={description}
|
|
15
15
|
size="large"
|
|
16
16
|
title-aria-level="1"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
</div>
|
|
21
21
|
<div>
|
|
22
22
|
<dx-group-text
|
|
23
|
-
|
|
23
|
+
header={featuresListTitle}
|
|
24
24
|
size="medium"
|
|
25
25
|
class="features"
|
|
26
26
|
></dx-group-text>
|
|
@@ -3,7 +3,7 @@ import { DocPhaseInfo, FeatureItem, Link } from "typings/custom";
|
|
|
3
3
|
|
|
4
4
|
export default class Overview extends LightningElement {
|
|
5
5
|
@api docPhaseInfo!: DocPhaseInfo;
|
|
6
|
-
@api
|
|
6
|
+
@api header!: string;
|
|
7
7
|
@api description!: string;
|
|
8
8
|
@api primaryLink!: Link;
|
|
9
9
|
@api secondaryLink!: Link;
|