@salesforcedevs/docs-components 1.27.19 → 1.27.21

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.27.19",
3
+ "version": "1.27.21",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -25,5 +25,5 @@
25
25
  "@types/lodash.orderby": "4.6.9",
26
26
  "@types/lodash.uniqby": "4.7.9"
27
27
  },
28
- "gitHead": "e8a07ec5b69da0c6e7f65c2da19e6d6a64573047"
28
+ "gitHead": "bb47c49e52267b9068ff826a16f39364f49e3086"
29
29
  }
@@ -18,6 +18,7 @@
18
18
  language={language}
19
19
  show-footer={enableFooter}
20
20
  empty-state-message={emptyStateMessage}
21
+ origin={origin}
21
22
  >
22
23
  <doc-phase
23
24
  slot="doc-phase"
@@ -50,6 +50,9 @@ export default class AmfReference extends LightningElement {
50
50
  @api languages!: OptionWithLink[];
51
51
  @api language!: string;
52
52
  @api hideFooter = false;
53
+
54
+ /** Optional origin URL for the footer MFE (e.g. wp-json endpoint). Passed through to dx-footer-mfe. */
55
+ @api origin: string | null = null;
53
56
  @track navigation = [] as NavigationItem[];
54
57
  @track versions: Array<ReferenceVersion> = [];
55
58
  @track showVersionBanner = false;
@@ -66,7 +66,10 @@
66
66
  </div>
67
67
  </div>
68
68
  <div lwc:if={showFooter} class="footer-container">
69
- <dx-footer variant="no-signup"></dx-footer>
69
+ <dx-footer
70
+ variant="no-signup"
71
+ mfe-config-origin={effectiveFooterOrigin}
72
+ ></dx-footer>
70
73
  </div>
71
74
  </div>
72
75
  </div>
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @lwc/lwc/no-document-query */
2
2
  import { LightningElement, api, track } from "lwc";
3
3
  import { closest } from "kagekiri";
4
- import { toJson } from "dxUtils/normalizers";
4
+ import { toJson, normalizeBoolean } from "dxUtils/normalizers";
5
5
  import { highlightTerms } from "dxUtils/highlight";
6
6
  import { SearchSyncer } from "docUtils/searchSyncer";
7
7
  import type { OptionWithLink } from "typings/custom";
@@ -43,7 +43,14 @@ export default class ContentLayout extends LightningElement {
43
43
  @api emptyStateMessage?: string;
44
44
 
45
45
  // This is needed for now to prevent failing snapshot tests due to links in the footer
46
- @api showFooter = false;
46
+ @api
47
+ get showFooter() {
48
+ return this._showFooter;
49
+ }
50
+ set showFooter(value) {
51
+ this._showFooter = normalizeBoolean(value);
52
+ }
53
+ private _showFooter = false;
47
54
 
48
55
  @api readingTime?: number;
49
56
 
@@ -56,6 +63,9 @@ export default class ContentLayout extends LightningElement {
56
63
  /** Optional Twitter "via" handle (e.g. SalesforceDevs) passed through to doc-social-share. */
57
64
  @api shareTwitterVia: string | null = null;
58
65
 
66
+ /** Optional origin URL for the footer MFE (e.g. wp-json endpoint). Passed through to dx-footer. */
67
+ @api origin: string | null = null;
68
+
59
69
  @api
60
70
  get breadcrumbs() {
61
71
  return this._breadcrumbs;
@@ -163,6 +173,13 @@ export default class ContentLayout extends LightningElement {
163
173
  return this.readingTime != null && this.readingTime > 1;
164
174
  }
165
175
 
176
+ /** When origin is provided, pass it to the footer; otherwise use dx-footer's default. */
177
+ get effectiveFooterOrigin(): string {
178
+ return (
179
+ this.origin ?? `${window.location.origin}/developer/en-us/wp-json`
180
+ );
181
+ }
182
+
166
183
  connectedCallback(): void {
167
184
  const hasParentHighlightListener = closest(
168
185
  "doc-xml-content",
@@ -13,6 +13,7 @@
13
13
  bail-label={sidebarFooterContent.bailLabel}
14
14
  show-footer={enableFooter}
15
15
  reading-time={computedReadingTime}
16
+ origin={origin}
16
17
  >
17
18
  <doc-phase
18
19
  slot="version-banner"
@@ -45,6 +45,9 @@ export default class DocXmlContent extends LightningElementWithState<{
45
45
  /** Optional Twitter "via" handle (e.g. SalesforceDevs) for social share. */
46
46
  @api twitterVia: string | null = null;
47
47
 
48
+ /** Optional origin URL for the footer MFE (e.g. wp-json endpoint). Passed through to dx-footer-mfe. */
49
+ @api origin: string | null = null;
50
+
48
51
  @api
49
52
  get allLanguages(): Array<Language> {
50
53
  return this._allLanguages;