@salesforcedevs/docs-components 1.28.7-alpha.9 → 1.29.0-aitoolbar-alpha

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.
@@ -0,0 +1,73 @@
1
+ import { LightningElement, api } from "lwc";
2
+
3
+ const BANNER_STORAGE_PREFIX = "doc-banner-";
4
+
5
+ export default class Banner extends LightningElement {
6
+ @api message = "";
7
+
8
+ @api buttonLabel = "";
9
+
10
+ @api buttonHref = "";
11
+
12
+ @api secondaryLabel = "";
13
+
14
+ @api dismissStorageKey = "";
15
+
16
+ private _dismissed = false;
17
+
18
+ connectedCallback() {
19
+ if (this.dismissStorageKey && window?.sessionStorage) {
20
+ this._dismissed =
21
+ window.sessionStorage.getItem(
22
+ `${BANNER_STORAGE_PREFIX}${this.dismissStorageKey}`
23
+ ) === "true";
24
+ }
25
+ }
26
+
27
+ renderedCallback() {
28
+ if (this.message) {
29
+ const messageElement = this.template.querySelector(".message");
30
+ if (messageElement) {
31
+ messageElement.innerHTML = this.message;
32
+ }
33
+ }
34
+ }
35
+
36
+ get showBanner(): boolean {
37
+ return !this._dismissed;
38
+ }
39
+
40
+ get hasPrimaryButton(): boolean {
41
+ return !!(this.buttonLabel && this.buttonHref);
42
+ }
43
+
44
+ get hasSecondaryAction(): boolean {
45
+ return !!this.secondaryLabel;
46
+ }
47
+
48
+ private dismissBanner() {
49
+ if (this.dismissStorageKey && window?.sessionStorage) {
50
+ window.sessionStorage.setItem(
51
+ `${BANNER_STORAGE_PREFIX}${this.dismissStorageKey}`,
52
+ "true"
53
+ );
54
+ }
55
+ this._dismissed = true;
56
+ this.dispatchEvent(
57
+ new CustomEvent("dismissbanner", {
58
+ bubbles: true,
59
+ composed: true
60
+ })
61
+ );
62
+ }
63
+
64
+ @api
65
+ handleSecondaryClick() {
66
+ this.dismissBanner();
67
+ }
68
+
69
+ @api
70
+ handleCloseClick() {
71
+ this.dismissBanner();
72
+ }
73
+ }
@@ -1,34 +1,21 @@
1
1
  <template>
2
2
  <div class="content">
3
- <template lwc:if={showDataCloudSidebar}>
4
- <dx-sidebar
5
- class="is-sticky left-nav-bar"
6
- trees={sidebarContent}
7
- value={sidebarValue}
8
- header={sidebarHeader}
9
- ontogglesidebar={onToggleSidebar}
10
- >
11
- <slot name="sidebar-header" slot="version-picker"></slot>
12
- </dx-sidebar>
13
- </template>
14
- <template lwc:if={showOldSidebar}>
15
- <dx-sidebar-old
16
- class="is-sticky left-nav-bar"
17
- trees={sidebarContent}
18
- value={sidebarValue}
19
- header={sidebarHeader}
20
- ontogglesidebar={onToggleSidebar}
21
- languages={languages}
22
- language={language}
23
- bail-href={bailHref}
24
- bail-label={bailLabel}
25
- dev-center={devCenter}
26
- brand={brand}
27
- empty-state-message={emptyStateMessage}
28
- >
29
- <slot name="sidebar-header" slot="version-picker"></slot>
30
- </dx-sidebar-old>
31
- </template>
3
+ <dx-sidebar-old
4
+ class="is-sticky left-nav-bar"
5
+ trees={sidebarContent}
6
+ value={sidebarValue}
7
+ header={sidebarHeader}
8
+ ontogglesidebar={onToggleSidebar}
9
+ languages={languages}
10
+ language={language}
11
+ bail-href={bailHref}
12
+ bail-label={bailLabel}
13
+ dev-center={devCenter}
14
+ brand={brand}
15
+ empty-state-message={emptyStateMessage}
16
+ >
17
+ <slot name="sidebar-header" slot="version-picker"></slot>
18
+ </dx-sidebar-old>
32
19
  <div class="content-body-doc-phase-container">
33
20
  <div class="doc-phase-wrapper">
34
21
  <slot name="doc-phase"></slot>
@@ -56,7 +43,7 @@
56
43
  ></path>
57
44
  </g>
58
45
  </svg>
59
- {readingTime} minute read
46
+ {readingTimeLabel}
60
47
  </div>
61
48
  <div class="share-below-read" lwc:if={showSocialShare}>
62
49
  <doc-social-share
@@ -1,12 +1,15 @@
1
1
  /* eslint-disable @lwc/lwc/no-document-query */
2
- import { LightningElement, api, track } from "lwc";
3
- import { closest } from "kagekiri";
4
- import { fetchHasResults } from "dxUtils/dataCloudSearch";
2
+ import { LightningElement, api, createElement, track } from "lwc";
3
+ import { closest, querySelector } from "kagekiri";
5
4
  import { toJson, normalizeBoolean } from "dxUtils/normalizers";
6
5
  import { highlightTerms } from "dxUtils/highlight";
7
6
  import { SearchSyncer } from "docUtils/searchSyncer";
8
7
  import type { OptionWithLink } from "typings/custom";
9
8
  import { buildDocLinkClickHandler } from "dxUtils/analytics";
9
+ import AiToolbar from "doc/aiToolbar";
10
+
11
+ const AI_TOOLBAR_TAG = "doc-ai-toolbar";
12
+ const PAGE_HEADING_SELECTOR = "h1";
10
13
 
11
14
  type AnchorMap = { [key: string]: { intersect: boolean; id: string } };
12
15
 
@@ -29,6 +32,35 @@ const HIGHLIGHTABLE_SELECTOR = [
29
32
  ].join(",");
30
33
  export const OBSERVER_ATTACH_WAIT_TIME = 500;
31
34
 
35
+ const DEFAULT_READING_TIME_LOCALE = "en-us";
36
+
37
+ /**
38
+ * Localized "minute read" templates. `{minutes}` is replaced with the rounded
39
+ * reading-time value. Only displayed when reading time is greater than 1, so
40
+ * plural forms are always appropriate. Keys match the locales declared in
41
+ * sfdocs (and the doc-locale-banner) so that a localized document automatically
42
+ * gets a localized reading-time label.
43
+ */
44
+ export const READING_TIME_LABELS: Record<string, string> = {
45
+ "en-us": "{minutes} minute read",
46
+ "ja-jp": "読了時間 {minutes} 分",
47
+ "zh-cn": "阅读时间 {minutes} 分钟",
48
+ "zh-tw": "閱讀時間 {minutes} 分鐘",
49
+ "fr-fr": "Lecture de {minutes} minutes",
50
+ "de-de": "{minutes} Minuten Lesezeit",
51
+ "it-it": "{minutes} minuti di lettura",
52
+ "ko-kr": "읽는 데 {minutes}분",
53
+ "pt-br": "{minutes} minutos de leitura",
54
+ "es-mx": "{minutes} minutos de lectura",
55
+ "es-es": "{minutes} minutos de lectura",
56
+ "ru-ru": "Время чтения: {minutes} мин",
57
+ "fi-fi": "{minutes} minuutin lukuaika",
58
+ "da-dk": "{minutes} minutters læsning",
59
+ "sv-se": "{minutes} minuters läsning",
60
+ "nl-nl": "{minutes} minuten leestijd",
61
+ "nb-no": "{minutes} minutters lesetid"
62
+ };
63
+
32
64
  export default class ContentLayout extends LightningElement {
33
65
  @api sidebarValue!: string;
34
66
  @api sidebarHeader!: string;
@@ -67,6 +99,17 @@ export default class ContentLayout extends LightningElement {
67
99
  /** Optional origin URL for the footer MFE (e.g. wp-json endpoint). Passed through to dx-footer. */
68
100
  @api origin: string | null = null;
69
101
 
102
+ /** Controls whether the AI toolbar is displayed. */
103
+ @api
104
+ get showAiToolbar() {
105
+ return this._showAiToolbar;
106
+ }
107
+ set showAiToolbar(value) {
108
+ this._showAiToolbar = normalizeBoolean(value);
109
+ this.updateAiToolbar();
110
+ }
111
+ private _showAiToolbar = false;
112
+
70
113
  @api
71
114
  get breadcrumbs() {
72
115
  return this._breadcrumbs;
@@ -109,24 +152,9 @@ export default class ContentLayout extends LightningElement {
109
152
  );
110
153
  }
111
154
 
112
- /** Show Data Cloud sidebar only when not using old sidebar and the page has searchable results. */
113
- protected get showDataCloudSidebar(): boolean {
114
- return !this.useOldSidebar && this.hasDataCloudResults === true;
115
- }
116
-
117
- /** Show legacy sidebar when explicitly requested or when Data Cloud has no results. Don't show until we know (avoids flash). */
118
- protected get showOldSidebar(): boolean {
119
- return (
120
- this.useOldSidebar === true || this.hasDataCloudResults === false
121
- );
122
- }
123
-
124
155
  @track
125
156
  protected _sidebarContent: unknown;
126
157
 
127
- @track
128
- protected hasDataCloudResults: boolean | null = null;
129
-
130
158
  protected _breadcrumbs = null;
131
159
 
132
160
  @track
@@ -139,6 +167,7 @@ export default class ContentLayout extends LightningElement {
139
167
  protected hasRendered: boolean = false;
140
168
  protected contentLoaded: boolean = false;
141
169
  protected sidebarOpen: boolean = false;
170
+ protected aiToolbarElement: HTMLElement | null = null;
142
171
 
143
172
  get shouldDisplayFeedback() {
144
173
  return this.contentLoaded && typeof Sprig !== "undefined";
@@ -189,6 +218,19 @@ export default class ContentLayout extends LightningElement {
189
218
  return this.readingTime != null && this.readingTime > 1;
190
219
  }
191
220
 
221
+ /**
222
+ * Localized "X minute read" string for the current document language.
223
+ * Falls back to the default (en-us) template when the language is missing
224
+ * or has no translation.
225
+ */
226
+ get readingTimeLabel(): string {
227
+ const localeKey = (this.language || "").toLowerCase();
228
+ const template =
229
+ READING_TIME_LABELS[localeKey] ||
230
+ READING_TIME_LABELS[DEFAULT_READING_TIME_LOCALE];
231
+ return template.replace("{minutes}", String(this.readingTime));
232
+ }
233
+
192
234
  /** When origin is provided, pass it to the footer; otherwise use dx-footer's default. */
193
235
  get effectiveFooterOrigin(): string {
194
236
  return (
@@ -197,11 +239,6 @@ export default class ContentLayout extends LightningElement {
197
239
  }
198
240
 
199
241
  connectedCallback(): void {
200
- if (!this.useOldSidebar) {
201
- fetchHasResults().then((hasResults: boolean) => {
202
- this.hasDataCloudResults = hasResults;
203
- });
204
- }
205
242
  const hasParentHighlightListener = closest(
206
243
  "doc-xml-content",
207
244
  this.template.host
@@ -236,6 +273,8 @@ export default class ContentLayout extends LightningElement {
236
273
  window.addEventListener("scroll", this.adjustNavPosition);
237
274
  window.addEventListener("resize", this.adjustNavPosition);
238
275
 
276
+ this.updateAiToolbar();
277
+
239
278
  if (!this.hasRendered) {
240
279
  this.hasRendered = true;
241
280
  this.restoreScroll();
@@ -245,6 +284,45 @@ export default class ContentLayout extends LightningElement {
245
284
  }
246
285
  }
247
286
 
287
+ /**
288
+ * Inserts the AI toolbar into the slotted content immediately after the
289
+ * first H1 found inside this layout.
290
+ */
291
+ protected updateAiToolbar(): void {
292
+ if (!this.showAiToolbar) {
293
+ this.removeAiToolbar();
294
+ return;
295
+ }
296
+
297
+ const heading = querySelector(
298
+ PAGE_HEADING_SELECTOR,
299
+ this.template.host
300
+ ) as HTMLElement | null;
301
+
302
+ if (!heading) {
303
+ return;
304
+ }
305
+
306
+ if (this.aiToolbarElement?.previousElementSibling === heading) {
307
+ return;
308
+ }
309
+
310
+ this.removeAiToolbar();
311
+
312
+ const toolbar = createElement(AI_TOOLBAR_TAG, {
313
+ is: AiToolbar
314
+ }) as unknown as HTMLElement;
315
+ heading.parentNode?.insertBefore(toolbar, heading.nextSibling);
316
+ this.aiToolbarElement = toolbar;
317
+ }
318
+
319
+ protected removeAiToolbar(): void {
320
+ if (this.aiToolbarElement) {
321
+ this.aiToolbarElement.remove();
322
+ this.aiToolbarElement = null;
323
+ }
324
+ }
325
+
248
326
  disconnectedCallback(): void {
249
327
  this.disconnectObserver();
250
328
  window.removeEventListener(
@@ -260,6 +338,8 @@ export default class ContentLayout extends LightningElement {
260
338
 
261
339
  // Remove link click handler
262
340
  this.template.removeEventListener("click", this.handleLinkClick);
341
+
342
+ this.removeAiToolbar();
263
343
  }
264
344
 
265
345
  restoreScroll() {
@@ -278,9 +358,7 @@ export default class ContentLayout extends LightningElement {
278
358
  We have to account for the global nav changing height due to animations.
279
359
  */
280
360
  adjustNavPosition = () => {
281
- const sidebarEl =
282
- this.template.querySelector("dx-sidebar") ||
283
- this.template.querySelector("dx-sidebar-old");
361
+ const sidebarEl = this.template.querySelector("dx-sidebar-old");
284
362
  const globalNavEl = document.querySelector(
285
363
  "hgf-c360nav"
286
364
  ) as HTMLElement;
@@ -504,6 +582,7 @@ export default class ContentLayout extends LightningElement {
504
582
 
505
583
  onSlotChange(): void {
506
584
  this.updateRNB();
585
+ this.updateAiToolbar();
507
586
  this.contentLoaded = true;
508
587
  }
509
588
 
@@ -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}
@@ -0,0 +1,3 @@
1
+ :host {
2
+ display: block;
3
+ }
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <doc-banner
3
+ message={bannerMessage}
4
+ button-label={bannerButtonLabel}
5
+ button-href={bannerButtonHref}
6
+ secondary-label={bannerSecondaryLabel}
7
+ dismiss-storage-key={dismissStorageKey}
8
+ ></doc-banner>
9
+ </template>
@@ -0,0 +1,195 @@
1
+ import { LightningElement, api } from "lwc";
2
+
3
+ interface LocaleStrings {
4
+ messageText: string;
5
+ linkUrl: string;
6
+ linkText: string;
7
+ buttonLabel: string;
8
+ secondaryLabel: string;
9
+ }
10
+
11
+ const DEFAULT_LOCALE = "en-us";
12
+
13
+ const LOCALE_STRINGS: Record<string, LocaleStrings> = {
14
+ "en-us": {
15
+ messageText:
16
+ "This text has been translated using Salesforce machine translation system. More details {link}.",
17
+ linkUrl:
18
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1",
19
+ linkText: "here",
20
+ buttonLabel: "Switch to English",
21
+ secondaryLabel: "Not Now"
22
+ },
23
+ "ja-jp": {
24
+ messageText:
25
+ "この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細は{link}をご参照ください。",
26
+ linkUrl:
27
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=ja",
28
+ linkText: "こちら",
29
+ buttonLabel: "英語に切り替える",
30
+ secondaryLabel: "今はしません"
31
+ },
32
+ "zh-cn": {
33
+ messageText:
34
+ "此文本已使用 Salesforce 机器翻译系统进行翻译。如需了解更多详情,请点击{link}。",
35
+ linkUrl:
36
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=zh_CN",
37
+ linkText: "此处",
38
+ buttonLabel: "切换为英语",
39
+ secondaryLabel: "而非现在"
40
+ },
41
+ "zh-tw": {
42
+ messageText:
43
+ "此文已使用 Salesforce 機器翻譯系統翻譯。更多詳細資料請參見{link}。",
44
+ linkUrl:
45
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=zh_TW",
46
+ linkText: "此處",
47
+ buttonLabel: "切換至英文",
48
+ secondaryLabel: "不要現在"
49
+ },
50
+ "fr-fr": {
51
+ messageText:
52
+ "Ce texte a été traduit à l’aide du système de traduction automatique de Salesforce. Plus de détails, consultez {link}.",
53
+ linkUrl:
54
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=fr",
55
+ linkText: "cette page",
56
+ buttonLabel: "Basculer vers la page en anglais",
57
+ secondaryLabel: "Pas maintenant"
58
+ },
59
+ "de-de": {
60
+ messageText:
61
+ "Dieser Text wurde mit dem maschinellen Übersetzungssystem von Salesforce übersetzt. Weitere Details finden Sie {link}.",
62
+ linkUrl:
63
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=de",
64
+ linkText: "hier",
65
+ buttonLabel: "Zu Englisch wechseln",
66
+ secondaryLabel: "Nicht jetzt"
67
+ },
68
+ "it-it": {
69
+ messageText:
70
+ "Questo testo è stato tradotto utilizzando il sistema di traduzione automatica di Salesforce. Ulteriori dettagli sono disponibili {link}.",
71
+ linkUrl:
72
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=it",
73
+ linkText: "qui",
74
+ buttonLabel: "Passa all'inglese",
75
+ secondaryLabel: "Non ora"
76
+ },
77
+ "ko-kr": {
78
+ messageText:
79
+ "본 텍스트는 Salesforce 기계 번역 시스템으로 번역되었습니다. 자세한 내용은 {link}를 참조하세요.",
80
+ linkUrl:
81
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=ko",
82
+ linkText: "여기",
83
+ buttonLabel: "영어로 전환",
84
+ secondaryLabel: "지금 안 함"
85
+ },
86
+ "pt-br": {
87
+ messageText:
88
+ "Este texto foi traduzido pelo sistema de tradução automática da Salesforce. Mais detalhes {link}.",
89
+ linkUrl:
90
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=pt_BR",
91
+ linkText: "aqui",
92
+ buttonLabel: "Alternar para inglês",
93
+ secondaryLabel: "Agora não"
94
+ },
95
+ "es-mx": {
96
+ messageText:
97
+ "Este texto se tradujo con el sistema de traducción automática de Salesforce. Obtenga más detalles {link}.",
98
+ linkUrl:
99
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=es_MX",
100
+ linkText: "aquí",
101
+ buttonLabel: "Cambiar a inglés",
102
+ secondaryLabel: "Ahora no"
103
+ },
104
+ "es-es": {
105
+ messageText:
106
+ "Este texto se ha traducido utilizando un sistema de traducción automática de Salesforce. Más información {link}.",
107
+ linkUrl:
108
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=es",
109
+ linkText: "aquí",
110
+ buttonLabel: "Cambiar a inglés",
111
+ secondaryLabel: "Ahora no"
112
+ },
113
+ "ru-ru": {
114
+ messageText:
115
+ "Данный текст был переведен при помощи системы машинного перевода Salesforce. Дополнительные сведения см. {link}.",
116
+ linkUrl:
117
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=ru",
118
+ linkText: "здесь",
119
+ buttonLabel: "Переключить на английский",
120
+ secondaryLabel: "Не сейчас"
121
+ },
122
+ "fi-fi": {
123
+ messageText:
124
+ "Tämä teksti on käännetty Salesforcen konekäännösjärjestelmän avulla. Katso lisätietoja {link}.",
125
+ linkUrl:
126
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=fi",
127
+ linkText: "täältä",
128
+ buttonLabel: "Vaihda englantiin",
129
+ secondaryLabel: "Ei nyt"
130
+ },
131
+ "da-dk": {
132
+ messageText:
133
+ "Denne tekst er oversat ved hjælp af Salesforce-maskinoversættelsessystem. Du finder flere detaljer {link}.",
134
+ linkUrl:
135
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=da",
136
+ linkText: "her",
137
+ buttonLabel: "Skift til engelsk",
138
+ secondaryLabel: "Ikke nu"
139
+ },
140
+ "sv-se": {
141
+ messageText:
142
+ "Den här texten har översatts med Salesforces maskinöversättningssystem. Mer information {link}.",
143
+ linkUrl:
144
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=sv",
145
+ linkText: "här",
146
+ buttonLabel: "Byt till engelska",
147
+ secondaryLabel: "Inte nu"
148
+ },
149
+ "nl-nl": {
150
+ messageText:
151
+ "Deze tekst werd vertaald aan de hand van het systeem voor automatische vertaling van Salesforce. U vindt {link} meer details.",
152
+ linkUrl:
153
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=nl_NL",
154
+ linkText: "hier",
155
+ buttonLabel: "Overschakelen op Engels",
156
+ secondaryLabel: "Niet nu"
157
+ },
158
+ "nb-no": {
159
+ messageText:
160
+ "Denne teksten er oversatt med Salesforce maskinoversettingssystem. Flere detaljer {link}.",
161
+ linkUrl:
162
+ "https://help.salesforce.com/s/articleView?id=000396076&type=1&language=no",
163
+ linkText: "her",
164
+ buttonLabel: "Bytt til engelsk",
165
+ secondaryLabel: "Ikke nå"
166
+ }
167
+ };
168
+
169
+ export default class LocaleBanner extends LightningElement {
170
+ @api locale = DEFAULT_LOCALE;
171
+ @api targetHref = "";
172
+ @api dismissStorageKey = "";
173
+
174
+ get localeData(): LocaleStrings {
175
+ return LOCALE_STRINGS[this.locale] || LOCALE_STRINGS[DEFAULT_LOCALE];
176
+ }
177
+
178
+ get bannerMessage(): string {
179
+ const data = this.localeData;
180
+ const link = `<a href="${data.linkUrl}">${data.linkText}</a>`;
181
+ return data.messageText.replace("{link}", link);
182
+ }
183
+
184
+ get bannerButtonLabel(): string {
185
+ return this.localeData.buttonLabel;
186
+ }
187
+
188
+ get bannerButtonHref(): string {
189
+ return this.targetHref;
190
+ }
191
+
192
+ get bannerSecondaryLabel(): string {
193
+ return this.localeData.secondaryLabel;
194
+ }
195
+ }
@@ -1,7 +1,6 @@
1
1
  <template>
2
2
  <div class="content">
3
3
  <dx-sidebar-old
4
- lwc:if={useOldSidebar}
5
4
  class="is-sticky left-nav-bar"
6
5
  trees={sidebarContent}
7
6
  value={sidebarValue}
@@ -16,16 +15,6 @@
16
15
  >
17
16
  <slot name="sidebar-header" slot="version-picker"></slot>
18
17
  </dx-sidebar-old>
19
- <dx-sidebar
20
- lwc:else
21
- class="is-sticky left-nav-bar"
22
- trees={sidebarContent}
23
- value={sidebarValue}
24
- header={sidebarHeader}
25
- ontogglesidebar={onToggleSidebar}
26
- >
27
- <slot name="sidebar-header" slot="version-picker"></slot>
28
- </dx-sidebar>
29
18
  <div class="content-body-doc-phase-container">
30
19
  <div class="doc-phase-wrapper">
31
20
  <slot name="doc-phase"></slot>
@@ -52,7 +41,7 @@
52
41
  ></path>
53
42
  </g>
54
43
  </svg>
55
- {readingTime} minute read
44
+ {readingTimeLabel}
56
45
  </div>
57
46
  <slot onslotchange={onSlotChange}></slot>
58
47
  <doc-sprig-survey
@@ -68,7 +57,10 @@
68
57
  </div>
69
58
  </div>
70
59
  <div lwc:if={showFooter} class="footer-container">
71
- <dx-footer variant="no-signup"></dx-footer>
60
+ <dx-footer
61
+ variant="no-signup"
62
+ mfe-config-origin={effectiveFooterOrigin}
63
+ ></dx-footer>
72
64
  </div>
73
65
  </div>
74
66
  </div>
@@ -1,3 +1,4 @@
1
+ import { api } from "lwc";
1
2
  import ContentLayout from "doc/contentLayout";
2
3
  import cx from "classnames";
3
4
 
@@ -15,6 +16,16 @@ export default class LwcContentLayout extends ContentLayout {
15
16
  private allTabsCache: any[] | null = null;
16
17
  private mainSlotCache: any = null;
17
18
 
19
+ /** Optional origin URL for the footer MFE (e.g. wp-json endpoint). Passed through to dx-footer. */
20
+ @api origin: string | null = null;
21
+
22
+ /** When origin is provided, pass it to the footer; otherwise use dx-footer's default. */
23
+ get effectiveFooterOrigin(): string {
24
+ return (
25
+ this.origin ?? `${window.location.origin}/developer/en-us/wp-json`
26
+ );
27
+ }
28
+
18
29
  private setRNBByTab() {
19
30
  const tabPanelListItem = this.getTabPanelList();
20
31
  this.rnbByTab = tabPanelListItem?.id === RNB_BY_TAB;