@salesforcedevs/docs-components 0.18.0 → 0.19.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -14,5 +14,5 @@
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
- "gitHead": "d211c35163de06a1f77f0450391639278661a481"
17
+ "gitHead": "d5a5baab1cef348d1846d92deed55022ce5dd60b"
18
18
  }
@@ -5,16 +5,16 @@ import { DocPhaseInfo } from "typings/custom";
5
5
  import { toJson } from "utils/normalizers";
6
6
 
7
7
  export default class Phase extends LightningElement {
8
- _docPhaseInfo!: DocPhaseInfo;
8
+ _docPhaseInfo: DocPhaseInfo | null = null;
9
9
 
10
10
  isBodyHidden = false;
11
11
 
12
12
  get docPhaseTitle() {
13
- return this.docPhaseInfo.title;
13
+ return this.docPhaseInfo?.title;
14
14
  }
15
15
 
16
16
  @api
17
- get docPhaseInfo(): DocPhaseInfo {
17
+ get docPhaseInfo(): DocPhaseInfo | null {
18
18
  return this._docPhaseInfo;
19
19
  }
20
20
 
@@ -23,7 +23,7 @@ export default class Phase extends LightningElement {
23
23
  }
24
24
 
25
25
  get hideBodyText() {
26
- return this.isBodyHidden ? "Show" : "Hide"
26
+ return this.isBodyHidden ? "Show" : "Hide";
27
27
  }
28
28
 
29
29
  get className() {
@@ -45,7 +45,7 @@ export default class Phase extends LightningElement {
45
45
  renderedCallback() {
46
46
  const phaseBodyContainer =
47
47
  this.template.querySelector(".doc-phase-body");
48
- if (phaseBodyContainer) {
48
+ if (phaseBodyContainer && this.docPhaseInfo) {
49
49
  // eslint-disable-next-line @lwc/lwc/no-inner-html
50
50
  phaseBodyContainer.innerHTML = this.docPhaseInfo.body;
51
51
  }