@salesforcedevs/docs-components 1.29.0-alpha1 → 1.29.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/LICENSE +12 -0
- package/lwc.config.json +2 -1
- package/package.json +28 -28
- package/src/modules/doc/amfReference/amfReference.ts +52 -10
- package/src/modules/doc/amfReference/types.ts +5 -0
- package/src/modules/doc/banner/banner.css +88 -0
- package/src/modules/doc/banner/banner.html +47 -0
- package/src/modules/doc/banner/banner.ts +73 -0
- package/src/modules/doc/contentLayout/contentLayout.html +1 -1
- package/src/modules/doc/contentLayout/contentLayout.ts +42 -0
- package/src/modules/doc/header/header.html +0 -1
- package/src/modules/doc/localeBanner/localeBanner.css +3 -0
- package/src/modules/doc/localeBanner/localeBanner.html +9 -0
- package/src/modules/doc/localeBanner/localeBanner.ts +195 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +5 -2
- package/src/modules/doc/redocReference/redocReference.ts +157 -121
- package/src/modules/doc/xmlContent/xmlContent.html +1 -1
- package/src/modules/doc/xmlContent/xmlContent.ts +28 -1
- package/src/modules/doc/apiPlayground/apiPlayground.css +0 -186
- package/src/modules/doc/apiPlayground/apiPlayground.html +0 -136
- package/src/modules/doc/apiPlayground/apiPlayground.ts +0 -240
- package/src/modules/docUtils/apiRequestExecutor/apiRequestExecutor.ts +0 -96
- package/src/modules/docUtils/openApiParser/openApiParser.ts +0 -187
package/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2020, Salesforce.com, Inc.
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
|
|
8
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
+
|
|
10
|
+
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/lwc.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
2
|
+
"name": "@salesforcedevs/docs-components",
|
|
3
|
+
"version": "1.29.0",
|
|
4
|
+
"description": "Docs Lightning web components for DSC",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": "22.x"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@api-components/amf-helper-mixin": "4.5.29",
|
|
15
|
+
"classnames": "2.5.1",
|
|
16
|
+
"dompurify": "3.2.4",
|
|
17
|
+
"kagekiri": "1.4.2",
|
|
18
|
+
"lodash.orderby": "4.6.0",
|
|
19
|
+
"lodash.uniqby": "4.7.0",
|
|
20
|
+
"query-string": "7.1.3",
|
|
21
|
+
"sentence-case": "3.0.4"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/classnames": "2.3.1",
|
|
25
|
+
"@types/lodash.orderby": "4.6.9",
|
|
26
|
+
"@types/lodash.uniqby": "4.7.9"
|
|
27
|
+
},
|
|
28
|
+
"gitHead": "0dce435f5845187b50577dc005de80ddc3002b9d"
|
|
29
|
+
}
|
|
@@ -37,6 +37,7 @@ type NavigationItem = {
|
|
|
37
37
|
isExpanded: boolean;
|
|
38
38
|
children: ParsedMarkdownTopic[];
|
|
39
39
|
isChildrenLoading: boolean;
|
|
40
|
+
showForwardArrow?: boolean;
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
export default class AmfReference extends LightningElement {
|
|
@@ -204,6 +205,7 @@ export default class AmfReference extends LightningElement {
|
|
|
204
205
|
|
|
205
206
|
_boundOnApiNavigationChanged;
|
|
206
207
|
_boundUpdateSelectedItemFromUrlQuery;
|
|
208
|
+
_boundOnPageShow;
|
|
207
209
|
|
|
208
210
|
constructor() {
|
|
209
211
|
super();
|
|
@@ -212,6 +214,7 @@ export default class AmfReference extends LightningElement {
|
|
|
212
214
|
this.onApiNavigationChanged.bind(this);
|
|
213
215
|
this._boundUpdateSelectedItemFromUrlQuery =
|
|
214
216
|
this.updateSelectedItemFromUrlQuery.bind(this);
|
|
217
|
+
this._boundOnPageShow = this.onPageShow.bind(this);
|
|
215
218
|
}
|
|
216
219
|
|
|
217
220
|
connectedCallback(): void {
|
|
@@ -223,6 +226,7 @@ export default class AmfReference extends LightningElement {
|
|
|
223
226
|
"popstate",
|
|
224
227
|
this._boundUpdateSelectedItemFromUrlQuery
|
|
225
228
|
);
|
|
229
|
+
window.addEventListener("pageshow", this._boundOnPageShow);
|
|
226
230
|
}
|
|
227
231
|
|
|
228
232
|
disconnectedCallback(): void {
|
|
@@ -234,6 +238,22 @@ export default class AmfReference extends LightningElement {
|
|
|
234
238
|
"popstate",
|
|
235
239
|
this._boundUpdateSelectedItemFromUrlQuery
|
|
236
240
|
);
|
|
241
|
+
window.removeEventListener("pageshow", this._boundOnPageShow);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* On bfcache restore, reset the sidebar selection so the tree re-syncs
|
|
246
|
+
* its highlighted tile with the current URL.
|
|
247
|
+
*/
|
|
248
|
+
protected onPageShow(event: PageTransitionEvent): void {
|
|
249
|
+
if (!event.persisted) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const currentPath = window.location.pathname;
|
|
253
|
+
this.selectedSidebarValue = "";
|
|
254
|
+
Promise.resolve().then(() => {
|
|
255
|
+
this.selectedSidebarValue = currentPath;
|
|
256
|
+
});
|
|
237
257
|
}
|
|
238
258
|
|
|
239
259
|
renderedCallback(): void {
|
|
@@ -443,16 +463,21 @@ export default class AmfReference extends LightningElement {
|
|
|
443
463
|
let navItemChildren = [] as ParsedMarkdownTopic[];
|
|
444
464
|
let isChildrenLoading = false;
|
|
445
465
|
if (amfConfig.referenceType !== REFERENCE_TYPES.markdown) {
|
|
446
|
-
if (amfConfig.
|
|
447
|
-
|
|
448
|
-
(
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
466
|
+
if (amfConfig.amf) {
|
|
467
|
+
if (amfConfig.isSelected) {
|
|
468
|
+
const amfPromise = this.fetchAmf(amfConfig).then(
|
|
469
|
+
(amfJson) => {
|
|
470
|
+
this.updateModel(amfConfig.id, amfJson);
|
|
471
|
+
this.assignNavigationItemsFromAmf(
|
|
472
|
+
amfConfig,
|
|
473
|
+
index
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
this.amfFetchPromiseMap[amfConfig.id] = amfPromise;
|
|
478
|
+
}
|
|
479
|
+
isChildrenLoading = true;
|
|
454
480
|
}
|
|
455
|
-
isChildrenLoading = true;
|
|
456
481
|
} else {
|
|
457
482
|
const isExpandChildrenEnabled = this.isExpandChildrenEnabled(
|
|
458
483
|
amfConfig.id
|
|
@@ -473,13 +498,30 @@ export default class AmfReference extends LightningElement {
|
|
|
473
498
|
amfConfig.isSelected ||
|
|
474
499
|
this.isExpandChildrenEnabled(amfConfig.id),
|
|
475
500
|
children: navItemChildren,
|
|
476
|
-
isChildrenLoading
|
|
501
|
+
isChildrenLoading,
|
|
502
|
+
showForwardArrow: this.resolveNavRenderWith(amfConfig)
|
|
477
503
|
};
|
|
478
504
|
this.parentReferenceUrls.push(amfConfig.href);
|
|
479
505
|
}
|
|
480
506
|
this.navigation = navAmfOrder;
|
|
481
507
|
}
|
|
482
508
|
|
|
509
|
+
/**
|
|
510
|
+
* Determines whether the sidebar tile should render a forward arrow for
|
|
511
|
+
* this reference. Honors `redoc` set on the config, and also infers it
|
|
512
|
+
* for non-markdown references that have no AMF URL (i.e. those rendered
|
|
513
|
+
* by Redoc).
|
|
514
|
+
*/
|
|
515
|
+
private resolveNavRenderWith(amfConfig: AmfConfig): boolean {
|
|
516
|
+
if (amfConfig.renderWith) {
|
|
517
|
+
return amfConfig.renderWith === "redoc";
|
|
518
|
+
}
|
|
519
|
+
return (
|
|
520
|
+
amfConfig.referenceType !== REFERENCE_TYPES.markdown &&
|
|
521
|
+
!amfConfig.amf
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
|
|
483
525
|
/**
|
|
484
526
|
* Returns a boolean indicating whether the children should be expanded or not.
|
|
485
527
|
*/
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
|
|
4
|
+
:host {
|
|
5
|
+
display: block;
|
|
6
|
+
|
|
7
|
+
--doc-banner-padding-left: var(--dx-g-spacing-2xl);
|
|
8
|
+
--doc-banner-padding-right: var(--dx-g-spacing-lg);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.container {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: flex-start;
|
|
14
|
+
background: var(--dx-g-gray-90);
|
|
15
|
+
padding: 0 var(--doc-banner-padding-right) 0 var(--doc-banner-padding-left);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.icon {
|
|
19
|
+
--dx-c-icon-size: var(--dx-g-icon-size-lg);
|
|
20
|
+
|
|
21
|
+
flex-shrink: 0;
|
|
22
|
+
margin-top: var(--dx-g-spacing-smd);
|
|
23
|
+
margin-right: var(--dx-g-spacing-sm);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.main {
|
|
27
|
+
flex: 1;
|
|
28
|
+
min-width: 0;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-wrap: wrap;
|
|
31
|
+
align-items: flex-start;
|
|
32
|
+
column-gap: var(--dx-g-spacing-md);
|
|
33
|
+
padding: calc((var(--dx-g-spacing-xs) + var(--dx-g-spacing-sm)) / 2) 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.message {
|
|
37
|
+
flex: 0 1 auto;
|
|
38
|
+
font-size: var(--dx-g-text-sm);
|
|
39
|
+
color: var(--dx-g-gray-10);
|
|
40
|
+
padding: calc((var(--dx-g-spacing-xs) + var(--dx-g-spacing-sm)) / 2) 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.message a {
|
|
44
|
+
color: var(--dx-g-cloud-blue-vibrant-50);
|
|
45
|
+
text-decoration: underline;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.actions {
|
|
49
|
+
flex: 0 0 auto;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
gap: var(--dx-g-spacing-smd);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.actions dx-button {
|
|
56
|
+
--dx-c-button-font-size: var(--dx-g-text-sm);
|
|
57
|
+
--dx-c-button-font-weight: var(--dx-g-font-normal);
|
|
58
|
+
|
|
59
|
+
flex: 0 0 auto;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.close {
|
|
63
|
+
--dx-c-icon-size: var(--dx-g-icon-size-lg);
|
|
64
|
+
|
|
65
|
+
flex-shrink: 0;
|
|
66
|
+
align-self: flex-start;
|
|
67
|
+
width: calc(var(--dx-g-spacing-3xl) + var(--dx-g-spacing-xs));
|
|
68
|
+
height: calc(var(--dx-g-spacing-2xl) + var(--dx-g-spacing-xs));
|
|
69
|
+
margin-left: auto;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@media (max-width: 1279px) {
|
|
77
|
+
:host {
|
|
78
|
+
--doc-banner-padding-left: var(--dx-g-spacing-xl);
|
|
79
|
+
--doc-banner-padding-right: var(--dx-g-spacing-md);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@media (max-width: 768px) {
|
|
84
|
+
:host {
|
|
85
|
+
--doc-banner-padding-left: var(--dx-g-spacing-lg);
|
|
86
|
+
--doc-banner-padding-right: var(--dx-g-spacing-sm);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template lwc:if={showBanner}>
|
|
3
|
+
<div class="container" part="container">
|
|
4
|
+
<dx-icon
|
|
5
|
+
class="icon"
|
|
6
|
+
symbol="info"
|
|
7
|
+
size="override"
|
|
8
|
+
color="gray-50"
|
|
9
|
+
part="icon"
|
|
10
|
+
></dx-icon>
|
|
11
|
+
<div class="main">
|
|
12
|
+
<div class="message" part="message" lwc:dom="manual"></div>
|
|
13
|
+
<div class="actions" part="actions">
|
|
14
|
+
<template lwc:if={hasPrimaryButton}>
|
|
15
|
+
<dx-button
|
|
16
|
+
href={buttonHref}
|
|
17
|
+
variant="primary"
|
|
18
|
+
size="small"
|
|
19
|
+
part="button"
|
|
20
|
+
>
|
|
21
|
+
{buttonLabel}
|
|
22
|
+
</dx-button>
|
|
23
|
+
</template>
|
|
24
|
+
<template lwc:if={hasSecondaryAction}>
|
|
25
|
+
<dx-button
|
|
26
|
+
variant="inline"
|
|
27
|
+
onclick={handleSecondaryClick}
|
|
28
|
+
part="secondary"
|
|
29
|
+
>
|
|
30
|
+
{secondaryLabel}
|
|
31
|
+
</dx-button>
|
|
32
|
+
</template>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<dx-button
|
|
36
|
+
class="close"
|
|
37
|
+
variant="icon-only"
|
|
38
|
+
icon-symbol="close"
|
|
39
|
+
icon-size="override"
|
|
40
|
+
icon-color="gray-50"
|
|
41
|
+
aria-label="Close"
|
|
42
|
+
onclick={handleCloseClick}
|
|
43
|
+
part="close"
|
|
44
|
+
></dx-button>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
</template>
|
|
@@ -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
|
+
}
|
|
@@ -28,6 +28,35 @@ const HIGHLIGHTABLE_SELECTOR = [
|
|
|
28
28
|
].join(",");
|
|
29
29
|
export const OBSERVER_ATTACH_WAIT_TIME = 500;
|
|
30
30
|
|
|
31
|
+
const DEFAULT_READING_TIME_LOCALE = "en-us";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Localized "minute read" templates. `{minutes}` is replaced with the rounded
|
|
35
|
+
* reading-time value. Only displayed when reading time is greater than 1, so
|
|
36
|
+
* plural forms are always appropriate. Keys match the locales declared in
|
|
37
|
+
* sfdocs (and the doc-locale-banner) so that a localized document automatically
|
|
38
|
+
* gets a localized reading-time label.
|
|
39
|
+
*/
|
|
40
|
+
export const READING_TIME_LABELS: Record<string, string> = {
|
|
41
|
+
"en-us": "{minutes} minute read",
|
|
42
|
+
"ja-jp": "読了時間 {minutes} 分",
|
|
43
|
+
"zh-cn": "阅读时间 {minutes} 分钟",
|
|
44
|
+
"zh-tw": "閱讀時間 {minutes} 分鐘",
|
|
45
|
+
"fr-fr": "Lecture de {minutes} minutes",
|
|
46
|
+
"de-de": "{minutes} Minuten Lesezeit",
|
|
47
|
+
"it-it": "{minutes} minuti di lettura",
|
|
48
|
+
"ko-kr": "읽는 데 {minutes}분",
|
|
49
|
+
"pt-br": "{minutes} minutos de leitura",
|
|
50
|
+
"es-mx": "{minutes} minutos de lectura",
|
|
51
|
+
"es-es": "{minutes} minutos de lectura",
|
|
52
|
+
"ru-ru": "Время чтения: {minutes} мин",
|
|
53
|
+
"fi-fi": "{minutes} minuutin lukuaika",
|
|
54
|
+
"da-dk": "{minutes} minutters læsning",
|
|
55
|
+
"sv-se": "{minutes} minuters läsning",
|
|
56
|
+
"nl-nl": "{minutes} minuten leestijd",
|
|
57
|
+
"nb-no": "{minutes} minutters lesetid"
|
|
58
|
+
};
|
|
59
|
+
|
|
31
60
|
export default class ContentLayout extends LightningElement {
|
|
32
61
|
@api sidebarValue!: string;
|
|
33
62
|
@api sidebarHeader!: string;
|
|
@@ -173,6 +202,19 @@ export default class ContentLayout extends LightningElement {
|
|
|
173
202
|
return this.readingTime != null && this.readingTime > 1;
|
|
174
203
|
}
|
|
175
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Localized "X minute read" string for the current document language.
|
|
207
|
+
* Falls back to the default (en-us) template when the language is missing
|
|
208
|
+
* or has no translation.
|
|
209
|
+
*/
|
|
210
|
+
get readingTimeLabel(): string {
|
|
211
|
+
const localeKey = (this.language || "").toLowerCase();
|
|
212
|
+
const template =
|
|
213
|
+
READING_TIME_LABELS[localeKey] ||
|
|
214
|
+
READING_TIME_LABELS[DEFAULT_READING_TIME_LOCALE];
|
|
215
|
+
return template.replace("{minutes}", String(this.readingTime));
|
|
216
|
+
}
|
|
217
|
+
|
|
176
218
|
/** When origin is provided, pass it to the footer; otherwise use dx-footer's default. */
|
|
177
219
|
get effectiveFooterOrigin(): string {
|
|
178
220
|
return (
|