@salesforcedevs/docs-components 1.30.1-node22-2 → 1.32.0-alpha.10
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/lwc.config.json +2 -0
- package/package.json +3 -7
- 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.css +7 -0
- package/src/modules/doc/contentLayout/contentLayout.html +35 -16
- package/src/modules/doc/contentLayout/contentLayout.ts +44 -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 +15 -1
- package/src/modules/doc/redocReference/redocReference.ts +6 -2
- package/src/modules/doc/xmlContent/xmlContent.html +2 -1
- package/src/modules/doc/xmlContent/xmlContent.ts +28 -12
package/lwc.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0-alpha.10",
|
|
4
4
|
"description": "Docs Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": "
|
|
9
|
-
},
|
|
10
|
-
"volta": {
|
|
11
|
-
"node": "22.22.0",
|
|
12
|
-
"yarn": "1.22.22"
|
|
8
|
+
"node": "20.x"
|
|
13
9
|
},
|
|
14
10
|
"publishConfig": {
|
|
15
11
|
"access": "public"
|
|
@@ -29,5 +25,5 @@
|
|
|
29
25
|
"@types/lodash.orderby": "4.6.9",
|
|
30
26
|
"@types/lodash.uniqby": "4.7.9"
|
|
31
27
|
},
|
|
32
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "f81270b339009dc62f6b32c40a3ac11911b22104"
|
|
33
29
|
}
|
|
@@ -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
|
+
}
|
|
@@ -1 +1,8 @@
|
|
|
1
1
|
@import "docHelpers/contentLayoutStyle";
|
|
2
|
+
|
|
3
|
+
/* Reserve sidebar space during load so layout doesn't shift when dx-sidebar or dx-sidebar-old renders. */
|
|
4
|
+
.sidebar-placeholder {
|
|
5
|
+
flex-shrink: 0;
|
|
6
|
+
width: var(--dx-c-sidebar-width, 337px);
|
|
7
|
+
min-height: var(--dx-c-sidebar-height);
|
|
8
|
+
}
|
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="content">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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>
|
|
32
|
+
<template lwc:if={showSidebarPlaceholder}>
|
|
33
|
+
<div
|
|
34
|
+
class="sidebar-placeholder is-sticky left-nav-bar"
|
|
35
|
+
aria-hidden="true"
|
|
36
|
+
></div>
|
|
37
|
+
</template>
|
|
19
38
|
<div class="content-body-doc-phase-container">
|
|
20
39
|
<div class="doc-phase-wrapper">
|
|
21
40
|
<slot name="doc-phase"></slot>
|
|
@@ -1,6 +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 { fetchHasResults } from "dxUtils/data360Search";
|
|
4
5
|
import { toJson, normalizeBoolean } from "dxUtils/normalizers";
|
|
5
6
|
import { highlightTerms } from "dxUtils/highlight";
|
|
6
7
|
import { SearchSyncer } from "docUtils/searchSyncer";
|
|
@@ -42,6 +43,15 @@ export default class ContentLayout extends LightningElement {
|
|
|
42
43
|
@api brand: any;
|
|
43
44
|
@api emptyStateMessage?: string;
|
|
44
45
|
|
|
46
|
+
@api
|
|
47
|
+
get enableDataCloudSearch() {
|
|
48
|
+
return this._enableDataCloudSearch;
|
|
49
|
+
}
|
|
50
|
+
set enableDataCloudSearch(value) {
|
|
51
|
+
this._enableDataCloudSearch = normalizeBoolean(value);
|
|
52
|
+
}
|
|
53
|
+
private _enableDataCloudSearch = false;
|
|
54
|
+
|
|
45
55
|
// This is needed for now to prevent failing snapshot tests due to links in the footer
|
|
46
56
|
@api
|
|
47
57
|
get showFooter() {
|
|
@@ -108,9 +118,35 @@ export default class ContentLayout extends LightningElement {
|
|
|
108
118
|
);
|
|
109
119
|
}
|
|
110
120
|
|
|
121
|
+
/** Show Data 360 sidebar only when not using old sidebar and the page has searchable results. */
|
|
122
|
+
protected get showDataCloudSidebar(): boolean {
|
|
123
|
+
return (
|
|
124
|
+
this.enableDataCloudSearch &&
|
|
125
|
+
!this.useOldSidebar &&
|
|
126
|
+
this.hasDataCloudResults === true
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Show legacy sidebar when explicitly requested or when Data 360 has no results. Don't show until we know (avoids flash). */
|
|
131
|
+
protected get showOldSidebar(): boolean {
|
|
132
|
+
return (
|
|
133
|
+
this.useOldSidebar === true ||
|
|
134
|
+
!this.enableDataCloudSearch ||
|
|
135
|
+
this.hasDataCloudResults === false
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** Show a space-holding placeholder while we're deciding which sidebar to show (avoids layout shift). */
|
|
140
|
+
protected get showSidebarPlaceholder(): boolean {
|
|
141
|
+
return !this.showDataCloudSidebar && !this.showOldSidebar;
|
|
142
|
+
}
|
|
143
|
+
|
|
111
144
|
@track
|
|
112
145
|
protected _sidebarContent: unknown;
|
|
113
146
|
|
|
147
|
+
@track
|
|
148
|
+
protected hasDataCloudResults: boolean | null = null;
|
|
149
|
+
|
|
114
150
|
protected _breadcrumbs = null;
|
|
115
151
|
|
|
116
152
|
@track
|
|
@@ -181,6 +217,11 @@ export default class ContentLayout extends LightningElement {
|
|
|
181
217
|
}
|
|
182
218
|
|
|
183
219
|
connectedCallback(): void {
|
|
220
|
+
if (this.enableDataCloudSearch && !this.useOldSidebar) {
|
|
221
|
+
fetchHasResults().then((hasResults: boolean) => {
|
|
222
|
+
this.hasDataCloudResults = hasResults;
|
|
223
|
+
});
|
|
224
|
+
}
|
|
184
225
|
const hasParentHighlightListener = closest(
|
|
185
226
|
"doc-xml-content",
|
|
186
227
|
this.template.host
|
|
@@ -257,7 +298,9 @@ export default class ContentLayout extends LightningElement {
|
|
|
257
298
|
We have to account for the global nav changing height due to animations.
|
|
258
299
|
*/
|
|
259
300
|
adjustNavPosition = () => {
|
|
260
|
-
const sidebarEl =
|
|
301
|
+
const sidebarEl =
|
|
302
|
+
this.template.querySelector("dx-sidebar") ||
|
|
303
|
+
this.template.querySelector("dx-sidebar-old");
|
|
261
304
|
const globalNavEl = document.querySelector(
|
|
262
305
|
"hgf-c360nav"
|
|
263
306
|
) as HTMLElement;
|
|
@@ -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,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="content">
|
|
3
3
|
<dx-sidebar-old
|
|
4
|
+
lwc:if={useOldSidebar}
|
|
4
5
|
class="is-sticky left-nav-bar"
|
|
5
6
|
trees={sidebarContent}
|
|
6
7
|
value={sidebarValue}
|
|
@@ -15,6 +16,16 @@
|
|
|
15
16
|
>
|
|
16
17
|
<slot name="sidebar-header" slot="version-picker"></slot>
|
|
17
18
|
</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>
|
|
18
29
|
<div class="content-body-doc-phase-container">
|
|
19
30
|
<div class="doc-phase-wrapper">
|
|
20
31
|
<slot name="doc-phase"></slot>
|
|
@@ -57,7 +68,10 @@
|
|
|
57
68
|
</div>
|
|
58
69
|
</div>
|
|
59
70
|
<div lwc:if={showFooter} class="footer-container">
|
|
60
|
-
<dx-footer
|
|
71
|
+
<dx-footer
|
|
72
|
+
variant="no-signup"
|
|
73
|
+
mfe-config-origin={effectiveFooterOrigin}
|
|
74
|
+
></dx-footer>
|
|
61
75
|
</div>
|
|
62
76
|
</div>
|
|
63
77
|
</div>
|
|
@@ -212,7 +212,8 @@ export default class RedocReference extends LightningElement {
|
|
|
212
212
|
const currentUrl = window.location;
|
|
213
213
|
const existingParams = currentUrl.search + currentUrl.hash;
|
|
214
214
|
|
|
215
|
-
|
|
215
|
+
// Use replaceState to avoid creating a new history entry when the user visits /references without any reference ID
|
|
216
|
+
window.history.replaceState(
|
|
216
217
|
{},
|
|
217
218
|
"",
|
|
218
219
|
`${parentReferencePath}${existingParams}`
|
|
@@ -348,7 +349,10 @@ export default class RedocReference extends LightningElement {
|
|
|
348
349
|
// Appends footer component to container
|
|
349
350
|
private insertFooter(container: HTMLElement): void {
|
|
350
351
|
const footerElement = createElement("dx-footer", { is: DxFooter });
|
|
351
|
-
Object.assign(footerElement, {
|
|
352
|
+
Object.assign(footerElement, {
|
|
353
|
+
variant: "no-signup",
|
|
354
|
+
mfeConfigOrigin: this.effectiveFooterOrigin
|
|
355
|
+
});
|
|
352
356
|
container.appendChild(footerElement);
|
|
353
357
|
}
|
|
354
358
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<doc-content-layout
|
|
3
3
|
lwc:if={displayContent}
|
|
4
4
|
lwc:ref="docContentLayout"
|
|
5
|
+
enable-data-cloud-search
|
|
5
6
|
sidebar-header={docTitle}
|
|
6
7
|
sidebar-content={sidebarContent}
|
|
7
8
|
sidebar-value={sidebarValue}
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
</doc-content-layout>
|
|
54
55
|
<div lwc:if={display404}>
|
|
55
56
|
<dx-error
|
|
56
|
-
image="https://developer.salesforce.com/ns-assets/
|
|
57
|
+
image="https://developer.salesforce.com/ns-assets/404.svg"
|
|
57
58
|
code="404"
|
|
58
59
|
header="Beep boop. That did not compute."
|
|
59
60
|
subtitle="The document you're looking for doesn't seem to exist."
|
|
@@ -254,17 +254,6 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
254
254
|
return this.pageReference.deliverable;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
private get useOldSidebar(): boolean {
|
|
258
|
-
// Coveo is enabled and the version is greater than 51 (within the latest 3 versions)
|
|
259
|
-
// TODO: we need a better fix for version number check
|
|
260
|
-
return !(
|
|
261
|
-
!this.version?.releaseVersion ||
|
|
262
|
-
(this.version?.releaseVersion &&
|
|
263
|
-
parseInt(this.version.releaseVersion.replace("v", ""), 10) >=
|
|
264
|
-
53)
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
257
|
private get pageHeader(): Header {
|
|
269
258
|
if (!this._pageHeader) {
|
|
270
259
|
this._pageHeader = document.querySelector("doc-header")!;
|
|
@@ -322,8 +311,10 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
322
311
|
};
|
|
323
312
|
}
|
|
324
313
|
|
|
325
|
-
private handlePopState = (event: PopStateEvent): void =>
|
|
314
|
+
private handlePopState = (event: PopStateEvent): void => {
|
|
326
315
|
this.updatePageReference(this.getReferenceFromUrl(), event);
|
|
316
|
+
this.handleLocaleReload();
|
|
317
|
+
};
|
|
327
318
|
|
|
328
319
|
handleDismissVersionBanner() {
|
|
329
320
|
this.showVersionBanner = false;
|
|
@@ -598,6 +589,31 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
598
589
|
"docs",
|
|
599
590
|
this.pageReferenceToString(this.pageReference)
|
|
600
591
|
);
|
|
592
|
+
this.handleLocaleReload();
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/* This method reloads the page as locale banner context is not available in developer-website. */
|
|
596
|
+
private handleLocaleReload(): void {
|
|
597
|
+
const targetLocale = this.language?.id;
|
|
598
|
+
if (!targetLocale) {
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
const currentPath = window.location.pathname;
|
|
603
|
+
const localePattern = /atlas\.[a-z]{2}-[a-z]{2}\./;
|
|
604
|
+
|
|
605
|
+
if (localePattern.test(currentPath)) {
|
|
606
|
+
const newPath = currentPath.replace(
|
|
607
|
+
localePattern,
|
|
608
|
+
`atlas.${targetLocale}.`
|
|
609
|
+
);
|
|
610
|
+
const newUrl =
|
|
611
|
+
window.location.origin +
|
|
612
|
+
newPath +
|
|
613
|
+
window.location.search +
|
|
614
|
+
window.location.hash;
|
|
615
|
+
window.location.href = newUrl;
|
|
616
|
+
}
|
|
601
617
|
}
|
|
602
618
|
|
|
603
619
|
private updateHighlighting(searchParam: string): void {
|