@salesforcedevs/docs-components 0.69.1-miles → 0.70.1-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "0.69.1-miles",
3
+ "version": "0.70.1-alpha.0",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -29,7 +29,7 @@
29
29
  <div class="content-body-container">
30
30
  <div class="content-body">
31
31
  <doc-breadcrumbs
32
- if:true={showBreadcrumbs}
32
+ if:true={breadcrumbs}
33
33
  breadcrumbs={breadcrumbs}
34
34
  ></doc-breadcrumbs>
35
35
  <slot onslotchange={onSlotChange}></slot>
@@ -38,7 +38,7 @@ export default class ContentLayout extends LightningElement {
38
38
  return this._breadcrumbs;
39
39
  }
40
40
 
41
- set breadcrumbs(value): [] {
41
+ set breadcrumbs(value) {
42
42
  if (value) {
43
43
  this._breadcrumbs = toJson(value);
44
44
  }
@@ -111,10 +111,6 @@ export default class ContentLayout extends LightningElement {
111
111
  return window.location.pathname;
112
112
  }
113
113
 
114
- get showBreadcrumbs(): boolean {
115
- return this.breadcrumbs != null && (this.breadcrumbs as any[]).length > 1;
116
- }
117
-
118
114
  connectedCallback(): void {
119
115
  const hasParentHighlightListener = closest(
120
116
  "doc-xml-content",
@@ -587,8 +587,9 @@ export default class DocXmlContent extends LightningElementWithState<{
587
587
  }
588
588
 
589
589
  const currentNode = this.tocMap[contentDocumentId];
590
+
590
591
 
591
- if(currentNode.parent) {
592
+ if(currentNode?.parent) {
592
593
  this.breadcrumbs = this.nodeToBreadcrumb(currentNode);
593
594
  } else {
594
595
  this.breadcrumbs = [];
@@ -604,11 +605,8 @@ export default class DocXmlContent extends LightningElementWithState<{
604
605
  label: node.label
605
606
  };
606
607
 
607
- if(node.parent) {
608
- return [
609
- ...this.nodeToBreadcrumb(node.parent),
610
- item
611
- ];
608
+ if (node.parent) {
609
+ return [...this.nodeToBreadcrumb(node.parent), item];
612
610
  }
613
611
 
614
612
  return [item];