@salesforcedevs/docs-components 1.27.24 → 1.28.1-mti
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/.npmrc +1 -0
- package/lwc.config.json +1 -0
- package/package.json +29 -28
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +1 -1
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.ts +11 -0
- package/src/modules/doc/mtIndicator/mtIndicator.css +167 -0
- package/src/modules/doc/mtIndicator/mtIndicator.html +48 -0
- package/src/modules/doc/mtIndicator/mtIndicator.ts +19 -0
- package/src/modules/doc/redocReference/redocReference.ts +11 -1
- package/LICENSE +0 -12
package/.npmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//registry.npmjs.org/:_authToken=${SFDOCS_NPM_AUTH_TOKEN}
|
package/lwc.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
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.28.1-mti",
|
|
4
|
+
"description": "Docs Lightning web components for DSC",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": "20.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": "4629fdd9ca18a13480044ad43515b91945d16aad",
|
|
29
|
+
"stableVersion": "1.28.0"
|
|
30
|
+
}
|
|
@@ -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;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
|
|
4
|
+
:host {
|
|
5
|
+
display: block;
|
|
6
|
+
--doc-mt-indicator-bg: var(--neutral-90, #e5e5e5);
|
|
7
|
+
--doc-mt-indicator-height: 44px;
|
|
8
|
+
--doc-mt-indicator-padding-x-left: 40px;
|
|
9
|
+
--doc-mt-indicator-padding-x-right: var(--dx-g-spacing-lg);
|
|
10
|
+
--doc-mt-indicator-icon-size: 18.4615px;
|
|
11
|
+
--doc-mt-indicator-close-color: #747474;
|
|
12
|
+
--doc-mt-indicator-primary-bg: #0176d3;
|
|
13
|
+
--doc-mt-indicator-primary-bg-hover: #0160b3;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.doc-mt-indicator {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: flex-start;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
width: 100%;
|
|
21
|
+
margin: 0;
|
|
22
|
+
min-height: var(--doc-mt-indicator-height);
|
|
23
|
+
padding: 0 var(--doc-mt-indicator-padding-x-right) 0
|
|
24
|
+
var(--doc-mt-indicator-padding-x-left);
|
|
25
|
+
background: var(--doc-mt-indicator-bg);
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.doc-mt-indicator .icon-wrap,
|
|
30
|
+
.doc-mt-indicator .main,
|
|
31
|
+
.doc-mt-indicator .content,
|
|
32
|
+
.doc-mt-indicator .actions,
|
|
33
|
+
.doc-mt-indicator .close-wrap {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.doc-mt-indicator .icon-wrap,
|
|
39
|
+
.doc-mt-indicator .close-wrap {
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
width: calc(var(--doc-mt-indicator-icon-size) + var(--dx-g-spacing-sm));
|
|
42
|
+
min-height: 32px;
|
|
43
|
+
align-self: flex-start;
|
|
44
|
+
justify-content: flex-start;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.doc-mt-indicator .icon-wrap dx-icon {
|
|
48
|
+
--dx-c-icon-size: var(--doc-mt-indicator-icon-size);
|
|
49
|
+
width: var(--doc-mt-indicator-icon-size);
|
|
50
|
+
height: var(--doc-mt-indicator-icon-size);
|
|
51
|
+
padding: 12px 8px 0 0;
|
|
52
|
+
box-sizing: content-box;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.doc-mt-indicator .main {
|
|
56
|
+
flex: 1 1 0;
|
|
57
|
+
min-width: 0;
|
|
58
|
+
align-self: flex-start;
|
|
59
|
+
padding: 6px 0;
|
|
60
|
+
gap: var(--dx-g-spacing-md);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.doc-mt-indicator .content {
|
|
64
|
+
flex: 0 1 auto;
|
|
65
|
+
min-width: 0;
|
|
66
|
+
max-width: 100%;
|
|
67
|
+
min-height: 32px;
|
|
68
|
+
align-items: flex-start;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.doc-mt-indicator .message {
|
|
72
|
+
margin: 0;
|
|
73
|
+
padding: 6px 0;
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
font-weight: 400;
|
|
76
|
+
line-height: 20px;
|
|
77
|
+
color: var(--dx-g-neutral-30, #444);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.doc-mt-indicator .message a {
|
|
81
|
+
color: var(--dx-g-cloud-blue-vibrant-50);
|
|
82
|
+
text-decoration: underline;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.doc-mt-indicator .message a:hover {
|
|
86
|
+
opacity: 0.9;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.doc-mt-indicator .actions {
|
|
90
|
+
flex-shrink: 0;
|
|
91
|
+
min-height: 32px;
|
|
92
|
+
gap: var(--dx-g-spacing-smd);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.doc-mt-indicator .primary-btn {
|
|
96
|
+
--dx-c-button-primary-color: var(--doc-mt-indicator-primary-bg);
|
|
97
|
+
--dx-c-button-primary-color-hover: var(--doc-mt-indicator-primary-bg-hover);
|
|
98
|
+
--dx-c-button-vertical-spacing: 0;
|
|
99
|
+
--dx-c-button-horizontal-spacing: var(--dx-g-spacing-md);
|
|
100
|
+
min-width: min(144px, 100%);
|
|
101
|
+
height: 32px;
|
|
102
|
+
border-radius: var(--dx-g-spacing-xs);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.doc-mt-indicator .primary-btn::part(container) {
|
|
106
|
+
min-width: min(144px, 100%);
|
|
107
|
+
width: 100%;
|
|
108
|
+
height: 32px;
|
|
109
|
+
padding: 0 var(--dx-g-spacing-md);
|
|
110
|
+
border-radius: var(--dx-g-spacing-xs);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.doc-mt-indicator .close-wrap {
|
|
114
|
+
align-self: flex-start;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
align-items: center;
|
|
117
|
+
width: 52px;
|
|
118
|
+
height: 44px;
|
|
119
|
+
padding: 12px 8px 18px;
|
|
120
|
+
margin-left: auto;
|
|
121
|
+
box-sizing: border-box;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.doc-mt-indicator .close-wrap .close-btn {
|
|
125
|
+
width: 100%;
|
|
126
|
+
height: 100%;
|
|
127
|
+
--dx-c-button-custom-color: var(--doc-mt-indicator-close-color);
|
|
128
|
+
--dx-c-button-custom-color-hover: var(--doc-mt-indicator-close-color);
|
|
129
|
+
--dx-c-button-custom-background: transparent;
|
|
130
|
+
--dx-c-button-custom-background-hover: rgb(0 0 0 / 5%);
|
|
131
|
+
--dx-c-button-custom-border: none;
|
|
132
|
+
--dx-c-button-custom-border-hover: none;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@media (max-width: 1279px) {
|
|
136
|
+
:host {
|
|
137
|
+
--doc-mt-indicator-padding-x-left: 32px;
|
|
138
|
+
--doc-mt-indicator-padding-x-right: var(--dx-g-spacing-md);
|
|
139
|
+
}
|
|
140
|
+
.doc-mt-indicator {
|
|
141
|
+
min-height: 78px;
|
|
142
|
+
flex-wrap: wrap;
|
|
143
|
+
align-content: space-between;
|
|
144
|
+
padding: 0 var(--doc-mt-indicator-padding-x-right) 0 0;
|
|
145
|
+
}
|
|
146
|
+
.doc-mt-indicator .main {
|
|
147
|
+
flex-wrap: wrap;
|
|
148
|
+
gap: var(--dx-g-spacing-2xs);
|
|
149
|
+
}
|
|
150
|
+
.doc-mt-indicator .actions {
|
|
151
|
+
flex: 0 0 100%;
|
|
152
|
+
width: 100%;
|
|
153
|
+
}
|
|
154
|
+
.doc-mt-indicator .close-wrap {
|
|
155
|
+
min-height: 44px;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@media (max-width: 768px) {
|
|
160
|
+
:host {
|
|
161
|
+
--doc-mt-indicator-padding-x-left: 24px;
|
|
162
|
+
--doc-mt-indicator-padding-x-right: var(--dx-g-spacing-sm);
|
|
163
|
+
}
|
|
164
|
+
.doc-mt-indicator {
|
|
165
|
+
min-height: 44px;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template lwc:if={showBanner}>
|
|
3
|
+
<div class="doc-mt-indicator" part="container">
|
|
4
|
+
<div class="icon-wrap" part="icon-wrap">
|
|
5
|
+
<dx-icon symbol="info" part="icon" color="#747474"></dx-icon>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="main" part="main">
|
|
8
|
+
<div class="content" part="content">
|
|
9
|
+
<p class="message dx-text-body-4" part="message">
|
|
10
|
+
This text was translated using Salesforce's machine translation system. More details can be found
|
|
11
|
+
<a
|
|
12
|
+
href="https://help.salesforce.com/s/articleView?id=sf.machine_translation.htm"
|
|
13
|
+
target="_blank"
|
|
14
|
+
rel="noopener noreferrer"
|
|
15
|
+
part="message-link"
|
|
16
|
+
>
|
|
17
|
+
here
|
|
18
|
+
</a>
|
|
19
|
+
</p>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="actions" part="actions">
|
|
22
|
+
<template lwc:if={showButton}>
|
|
23
|
+
<dx-button
|
|
24
|
+
class="primary-btn"
|
|
25
|
+
href={enUsHref}
|
|
26
|
+
variant="primary"
|
|
27
|
+
size="small"
|
|
28
|
+
part="button"
|
|
29
|
+
>
|
|
30
|
+
Switch to English
|
|
31
|
+
</dx-button>
|
|
32
|
+
</template>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="close-wrap" part="close-wrap">
|
|
36
|
+
<dx-button
|
|
37
|
+
class="close-btn"
|
|
38
|
+
variant="icon-only"
|
|
39
|
+
icon-symbol="close"
|
|
40
|
+
icon-color="#747474"
|
|
41
|
+
aria-label="Close"
|
|
42
|
+
onclick={handleCloseClick}
|
|
43
|
+
part="close"
|
|
44
|
+
></dx-button>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
|
|
3
|
+
export default class MtIndicator extends LightningElement {
|
|
4
|
+
@api enUsHref = "";
|
|
5
|
+
|
|
6
|
+
private _dismissed = false;
|
|
7
|
+
|
|
8
|
+
get showBanner(): boolean {
|
|
9
|
+
return !this._dismissed;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get showButton(): boolean {
|
|
13
|
+
return !!this.enUsHref;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
handleCloseClick() {
|
|
17
|
+
this._dismissed = true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -68,6 +68,16 @@ export default class RedocReference extends LightningElement {
|
|
|
68
68
|
this._parentDocPhaseInfo = value;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
/** Optional origin URL for the footer MFE (e.g. wp-json endpoint). Passed through to dx-footer. */
|
|
72
|
+
@api origin: string | null = null;
|
|
73
|
+
|
|
74
|
+
/** When origin is provided, pass it to the footer; otherwise use dx-footer's default. */
|
|
75
|
+
get effectiveFooterOrigin(): string {
|
|
76
|
+
return (
|
|
77
|
+
this.origin ?? `${window.location.origin}/developer/en-us/wp-json`
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
71
81
|
connectedCallback(): void {
|
|
72
82
|
window.addEventListener("scroll", this.handleScrollAndResize);
|
|
73
83
|
window.addEventListener("resize", this.handleScrollAndResize);
|
|
@@ -338,7 +348,7 @@ export default class RedocReference extends LightningElement {
|
|
|
338
348
|
// Appends footer component to container
|
|
339
349
|
private insertFooter(container: HTMLElement): void {
|
|
340
350
|
const footerElement = createElement("dx-footer", { is: DxFooter });
|
|
341
|
-
Object.assign(footerElement, { variant: "no-signup" });
|
|
351
|
+
Object.assign(footerElement, { variant: "no-signup", mfeConfigOrigin: this.effectiveFooterOrigin });
|
|
342
352
|
container.appendChild(footerElement);
|
|
343
353
|
}
|
|
344
354
|
|
package/LICENSE
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
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.
|