@salesforcedevs/docs-components 1.28.1-banner-0 → 1.28.1-banner-2
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.1-banner-
|
|
3
|
+
"version": "1.28.1-banner-2",
|
|
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": "
|
|
28
|
+
"gitHead": "4f8c415f6a58d0747a9e746a4b1717d85de32122"
|
|
29
29
|
}
|
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
--doc-banner-padding-left: var(--dx-g-spacing-2xl);
|
|
8
8
|
--doc-banner-padding-right: var(--dx-g-spacing-lg);
|
|
9
|
-
--doc-close-width: calc(var(--dx-g-spacing-3xl) + var(--dx-g-spacing-xs));
|
|
10
|
-
--doc-close-height: calc(var(--dx-g-spacing-2xl) + var(--dx-g-spacing-xs));
|
|
11
|
-
--doc-banner-spacing-16px: var(--dx-g-spacing-md);
|
|
12
9
|
}
|
|
13
10
|
|
|
14
11
|
.container {
|
|
@@ -16,14 +13,13 @@
|
|
|
16
13
|
align-items: flex-start;
|
|
17
14
|
background: var(--dx-g-gray-90);
|
|
18
15
|
padding: 0 var(--doc-banner-padding-right) 0 var(--doc-banner-padding-left);
|
|
16
|
+
height: calc(var(--dx-g-spacing-2xl) + var(--dx-g-spacing-xs));
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
.icon {
|
|
22
20
|
--dx-c-icon-size: var(--dx-g-icon-size-lg);
|
|
23
21
|
|
|
24
22
|
flex-shrink: 0;
|
|
25
|
-
width: var(--dx-g-icon-size-lg);
|
|
26
|
-
height: var(--dx-g-icon-size-lg);
|
|
27
23
|
margin-top: var(--dx-g-spacing-smd);
|
|
28
24
|
margin-right: var(--dx-g-spacing-sm);
|
|
29
25
|
}
|
|
@@ -34,7 +30,7 @@
|
|
|
34
30
|
display: flex;
|
|
35
31
|
flex-wrap: wrap;
|
|
36
32
|
align-items: flex-start;
|
|
37
|
-
column-gap: var(--
|
|
33
|
+
column-gap: var(--dx-g-spacing-md);
|
|
38
34
|
padding: calc((var(--dx-g-spacing-xs) + var(--dx-g-spacing-sm)) / 2) 0;
|
|
39
35
|
}
|
|
40
36
|
|
|
@@ -69,12 +65,13 @@
|
|
|
69
65
|
|
|
70
66
|
flex-shrink: 0;
|
|
71
67
|
align-self: flex-start;
|
|
72
|
-
width: var(--
|
|
73
|
-
height: var(--
|
|
68
|
+
width: calc(var(--dx-g-spacing-3xl) + var(--dx-g-spacing-xs));
|
|
69
|
+
height: calc(var(--dx-g-spacing-2xl) + var(--dx-g-spacing-xs));
|
|
74
70
|
margin-left: auto;
|
|
75
71
|
display: flex;
|
|
76
72
|
align-items: center;
|
|
77
73
|
justify-content: center;
|
|
74
|
+
cursor: pointer;
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
@media (max-width: 1279px) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LightningElement, api
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
2
|
|
|
3
3
|
const BANNER_STORAGE_PREFIX = "doc-banner-";
|
|
4
4
|
|
|
@@ -13,14 +13,10 @@ export default class Banner extends LightningElement {
|
|
|
13
13
|
|
|
14
14
|
@api dismissStorageKey = "";
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
private _dismissed = false;
|
|
17
17
|
|
|
18
18
|
connectedCallback() {
|
|
19
|
-
if (
|
|
20
|
-
this.dismissStorageKey &&
|
|
21
|
-
typeof window !== "undefined" &&
|
|
22
|
-
window.sessionStorage
|
|
23
|
-
) {
|
|
19
|
+
if (this.dismissStorageKey && window?.sessionStorage) {
|
|
24
20
|
this._dismissed =
|
|
25
21
|
window.sessionStorage.getItem(
|
|
26
22
|
`${BANNER_STORAGE_PREFIX}${this.dismissStorageKey}`
|
|
@@ -50,11 +46,7 @@ export default class Banner extends LightningElement {
|
|
|
50
46
|
}
|
|
51
47
|
|
|
52
48
|
private dismissBanner() {
|
|
53
|
-
if (
|
|
54
|
-
this.dismissStorageKey &&
|
|
55
|
-
typeof window !== "undefined" &&
|
|
56
|
-
window.sessionStorage
|
|
57
|
-
) {
|
|
49
|
+
if (this.dismissStorageKey && window?.sessionStorage) {
|
|
58
50
|
window.sessionStorage.setItem(
|
|
59
51
|
`${BANNER_STORAGE_PREFIX}${this.dismissStorageKey}`,
|
|
60
52
|
"true"
|
|
@@ -8,39 +8,177 @@ interface LocaleStrings {
|
|
|
8
8
|
secondaryLabel: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
const DEFAULT_LOCALE = "en-us";
|
|
12
|
+
|
|
11
13
|
const LOCALE_STRINGS: Record<string, LocaleStrings> = {
|
|
12
14
|
"en-us": {
|
|
13
15
|
messageText:
|
|
14
|
-
"This text
|
|
16
|
+
"This text has been translated using Salesforce machine translation system. More details {link}.",
|
|
15
17
|
linkUrl:
|
|
16
|
-
"https://help.salesforce.com/s/articleView?
|
|
18
|
+
"https://help.salesforce.com/s/articleView?id=000396076&type=1",
|
|
17
19
|
linkText: "here",
|
|
18
20
|
buttonLabel: "Switch to English",
|
|
19
21
|
secondaryLabel: "Not Now"
|
|
20
22
|
},
|
|
21
23
|
"ja-jp": {
|
|
22
24
|
messageText:
|
|
23
|
-
"
|
|
25
|
+
"この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細は{link}をご参照ください。",
|
|
24
26
|
linkUrl:
|
|
25
|
-
"https://help.salesforce.com/s/articleView?
|
|
27
|
+
"https://help.salesforce.com/s/articleView?id=000396076&type=1&language=ja",
|
|
26
28
|
linkText: "こちら",
|
|
27
29
|
buttonLabel: "英語に切り替える",
|
|
28
|
-
secondaryLabel: "
|
|
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å"
|
|
29
166
|
}
|
|
30
167
|
};
|
|
31
168
|
|
|
32
169
|
export default class LocaleBanner extends LightningElement {
|
|
33
|
-
@api locale =
|
|
170
|
+
@api locale = DEFAULT_LOCALE;
|
|
34
171
|
@api targetHref = "";
|
|
35
172
|
@api dismissStorageKey = "";
|
|
36
173
|
|
|
37
174
|
get localeData(): LocaleStrings {
|
|
38
|
-
return LOCALE_STRINGS[this.locale] || LOCALE_STRINGS[
|
|
175
|
+
return LOCALE_STRINGS[this.locale] || LOCALE_STRINGS[DEFAULT_LOCALE];
|
|
39
176
|
}
|
|
40
177
|
|
|
41
178
|
get bannerMessage(): string {
|
|
42
179
|
const data = this.localeData;
|
|
43
|
-
|
|
180
|
+
const link = `<a href="${data.linkUrl}">${data.linkText}</a>`;
|
|
181
|
+
return data.messageText.replace("{link}", link);
|
|
44
182
|
}
|
|
45
183
|
|
|
46
184
|
get bannerButtonLabel(): string {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
</doc-content-layout>
|
|
54
54
|
<div lwc:if={display404}>
|
|
55
55
|
<dx-error
|
|
56
|
-
image="https://
|
|
56
|
+
image="https://developer.salesforce.com/ns-assets/404.svg"
|
|
57
57
|
code="404"
|
|
58
58
|
header="Beep boop. That did not compute."
|
|
59
59
|
subtitle="The document you're looking for doesn't seem to exist."
|
|
@@ -603,6 +603,7 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
603
603
|
this.handleLocaleReload();
|
|
604
604
|
}
|
|
605
605
|
|
|
606
|
+
/* This method reloads the page as locale banner context is not available in developer-website. */
|
|
606
607
|
private handleLocaleReload(): void {
|
|
607
608
|
const targetLocale = this.language?.id;
|
|
608
609
|
if (!targetLocale) {
|