@salesforcedevs/docs-components 1.28.5-redoc-alpha2 → 1.28.5-redoc-alpha4

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": "1.28.5-redoc-alpha2",
3
+ "version": "1.28.5-redoc-alpha4",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -13,7 +13,6 @@
13
13
  onclick={onLinkClick}
14
14
  class="dev-center-content"
15
15
  >
16
- <dx-icon symbol="back"></dx-icon>
17
16
  <dx-icon
18
17
  class="brand-icon"
19
18
  lwc:if={devCenter.icon}
@@ -84,18 +84,18 @@ export default class RedocReference extends LightningElement {
84
84
  * Project title (same value passed to `<doc-header>` as `subtitle`). Used
85
85
  * inside the Redoc-rendered UI to label the parent project.
86
86
  */
87
- @api projectTitle: string | null = null;
87
+ @api projectTitle: string | null = "All Reference";
88
88
 
89
89
  private _specTitle: string | null = null;
90
90
 
91
91
  /** Title of the currently selected spec, shown beneath the project title. */
92
92
  @api
93
93
  get specTitle(): string | null {
94
- return this._specTitle;
94
+ return this._specTitle || this.getSelectedReference()?.title || null;
95
95
  }
96
96
 
97
97
  set specTitle(value: string | null) {
98
- this._specTitle = value || this.getSelectedReference()?.title || null;
98
+ this._specTitle = value || null;
99
99
  }
100
100
 
101
101
  /**
@@ -152,13 +152,7 @@ export default class RedocReference extends LightningElement {
152
152
  }
153
153
 
154
154
  private getRedocContainer(): HTMLElement | null {
155
- // Prefer the slotted container in the consumer's light DOM so this
156
- // component composes inside shadow trees; fall back to a global
157
- // `.redoc-container` for legacy page-level integrations.
158
- return (
159
- this.querySelector<HTMLElement>(".redoc-container") ||
160
- document.querySelector<HTMLElement>(".redoc-container")
161
- );
155
+ return document.querySelector(".redoc-container");
162
156
  }
163
157
 
164
158
  private getSelectedReference(): ReferenceItem | null {
@@ -399,11 +393,7 @@ export default class RedocReference extends LightningElement {
399
393
  const wrapper = document.createElement("div");
400
394
  wrapper.className = "redoc-project-header";
401
395
 
402
- /* TODO:
403
- * Uncomment when doc-header is dropped with Vision state UX.
404
- * if(this.projectTitle) {
405
- */
406
- if (this.specTitle) {
396
+ if (this.projectTitle) {
407
397
  const backLink = document.createElement("a");
408
398
  backLink.className = "redoc-project-back";
409
399
  backLink.href = "#";
@@ -419,20 +409,19 @@ export default class RedocReference extends LightningElement {
419
409
 
420
410
  const label = document.createElement("span");
421
411
  label.className = "redoc-project-title";
422
- label.textContent = this.specTitle;
412
+ label.textContent = this.projectTitle;
423
413
 
424
414
  backLink.appendChild(icon);
425
415
  backLink.appendChild(label);
426
416
  wrapper.appendChild(backLink);
427
417
  }
428
418
 
429
- // TODO: Uncomment when we we have vision state UX with no doc-header
430
- // if (this.specTitle) {
431
- // const specEl = document.createElement("h2");
432
- // specEl.className = "redoc-spec-title";
433
- // specEl.textContent = this.specTitle;
434
- // wrapper.appendChild(specEl);
435
- // }
419
+ if (this.specTitle) {
420
+ const specEl = document.createElement("h2");
421
+ specEl.className = "redoc-spec-title dx-text-display-7";
422
+ specEl.textContent = this.specTitle;
423
+ wrapper.appendChild(specEl);
424
+ }
436
425
 
437
426
  return wrapper;
438
427
  }