@salesforcedevs/dx-components 1.31.5 → 1.31.7-redoc-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.
- package/package.json +46 -47
- package/src/modules/dx/agentMiawUi/agentMiawUi.ts +2 -0
- package/src/modules/dx/globalHeader/globalHeader.ts +27 -25
- package/src/modules/dx/tree/treeHandler.ts +2 -1
- package/src/modules/dx/treeTile/treeTile.css +5 -0
- package/src/modules/dx/treeTile/treeTile.html +10 -0
- package/src/modules/dx/treeTile/treeTile.ts +4 -0
- package/LICENSE +0 -12
package/package.json
CHANGED
|
@@ -1,48 +1,47 @@
|
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
2
|
+
"name": "@salesforcedevs/dx-components",
|
|
3
|
+
"version": "1.31.7-redoc-alpha",
|
|
4
|
+
"description": "DX Lightning web components",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": "22.x"
|
|
8
|
+
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@coveo/headless": "3.22.2",
|
|
14
|
+
"@floating-ui/dom": "1.5.1",
|
|
15
|
+
"@optimizely/optimizely-sdk": "5.3.0",
|
|
16
|
+
"@shikijs/colorized-brackets": "^3.12.2",
|
|
17
|
+
"@types/throttle-debounce": "5.0.2",
|
|
18
|
+
"@vimeo/player": "2.22.0",
|
|
19
|
+
"classnames": "2.5.1",
|
|
20
|
+
"composed-offset-position": "0.0.4",
|
|
21
|
+
"coveo-search-ui": "2.10113.0",
|
|
22
|
+
"debounce": "1.2.1",
|
|
23
|
+
"js-cookie": "3.0.5",
|
|
24
|
+
"lodash.defaults": "4.2.0",
|
|
25
|
+
"lodash.get": "4.4.2",
|
|
26
|
+
"lodash.kebabcase": "4.1.1",
|
|
27
|
+
"memoize-one": "6.0.0",
|
|
28
|
+
"microtip": "0.2.2",
|
|
29
|
+
"shiki": "^3.12.2",
|
|
30
|
+
"throttle-debounce": "5.0.0",
|
|
31
|
+
"uuid": "9.0.1"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/classnames": "2.3.1",
|
|
35
|
+
"@types/debounce": "1.2.4",
|
|
36
|
+
"@types/js-cookie": "3.0.6",
|
|
37
|
+
"@types/lodash.defaults": "4.2.9",
|
|
38
|
+
"@types/lodash.get": "4.4.9",
|
|
39
|
+
"@types/lodash.kebabcase": "4.1.9",
|
|
40
|
+
"@types/luxon": "3.4.2",
|
|
41
|
+
"@types/uuid": "8.3.4",
|
|
42
|
+
"@types/vimeo__player": "2.18.3",
|
|
43
|
+
"eventsourcemock": "2.0.0",
|
|
44
|
+
"luxon": "3.4.4",
|
|
45
|
+
"msw": "^2.12.4"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -64,6 +64,7 @@ export default class AgentMiawUi extends LightningElement {
|
|
|
64
64
|
@api messagingUrl!: string;
|
|
65
65
|
@api deploymentDevName = "page_builder_miaw_ui";
|
|
66
66
|
@api richComponentVersion = "v1-stable";
|
|
67
|
+
@api isOnDigitalDomain = "true";
|
|
67
68
|
@api routingAttributes?: string;
|
|
68
69
|
/**
|
|
69
70
|
* JSON array of suggested prompt strings for the MIAW UI (e.g.
|
|
@@ -95,6 +96,7 @@ export default class AgentMiawUi extends LightningElement {
|
|
|
95
96
|
el.setAttribute("messaging-url", this.messagingUrl);
|
|
96
97
|
el.setAttribute("deployment-dev-name", this.deploymentDevName);
|
|
97
98
|
el.setAttribute("input-variant", "mini-sidebar");
|
|
99
|
+
el.setAttribute("is-on-digital-domain", this.isOnDigitalDomain);
|
|
98
100
|
el.setAttribute(
|
|
99
101
|
"rich-component-version",
|
|
100
102
|
this.richComponentVersion
|
|
@@ -1,22 +1,43 @@
|
|
|
1
1
|
import kebabCase from "lodash.kebabcase";
|
|
2
2
|
import { LightningElement, api } from "lwc";
|
|
3
3
|
|
|
4
|
-
const defaultDomain = "
|
|
4
|
+
const defaultDomain = ""; // empty domain means the header settings will be loaded from the same domain as the current page
|
|
5
5
|
const defaultLocale = "en-us";
|
|
6
6
|
const defaultHeaderSettingsBasePath = "/c/public/header-settings";
|
|
7
|
+
const defaultPropertyTitle = "Developers";
|
|
7
8
|
const headerSettingsJsonKeys = [
|
|
8
9
|
"regionSelectorOverride",
|
|
9
10
|
"contactLinksOverride"
|
|
10
11
|
];
|
|
11
12
|
|
|
12
13
|
export default class DevExNavigation extends LightningElement {
|
|
13
|
-
static renderMode = "light";
|
|
14
|
+
static renderMode = "light"; // Light DOM currently required due to other elements reading from this element's DOM; we should fix that and use existing nav CSS variables in those other elements (TODO)
|
|
14
15
|
|
|
15
16
|
@api locale: string = defaultLocale;
|
|
16
17
|
@api path: string = defaultHeaderSettingsBasePath;
|
|
17
18
|
@api domain: string = defaultDomain;
|
|
19
|
+
@api propertyTitle: string = defaultPropertyTitle; // used only as a fallback in the "barebones" nav
|
|
20
|
+
|
|
21
|
+
// Fallback basic nav config used when the header settings are not available
|
|
22
|
+
private get barebonesNavConfig() {
|
|
23
|
+
return {
|
|
24
|
+
headerSettings: {
|
|
25
|
+
origin: "",
|
|
26
|
+
contextNavEnabled: "true"
|
|
27
|
+
},
|
|
28
|
+
navItems: {
|
|
29
|
+
variation: "static",
|
|
30
|
+
propertyTitle: {
|
|
31
|
+
label: this.propertyTitle,
|
|
32
|
+
url: "/"
|
|
33
|
+
},
|
|
34
|
+
menuGroup: {}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
18
38
|
|
|
19
39
|
async connectedCallback(): Promise<void> {
|
|
40
|
+
let navConfig = null;
|
|
20
41
|
try {
|
|
21
42
|
const headerSettingsResponse = await fetch(
|
|
22
43
|
`${this.domain}${this.path}/${this.locale}.json`,
|
|
@@ -27,13 +48,12 @@ export default class DevExNavigation extends LightningElement {
|
|
|
27
48
|
}
|
|
28
49
|
);
|
|
29
50
|
if (headerSettingsResponse.ok) {
|
|
30
|
-
|
|
31
|
-
} else {
|
|
32
|
-
this.createBarebonesNav();
|
|
51
|
+
navConfig = await headerSettingsResponse.json();
|
|
33
52
|
}
|
|
34
53
|
} catch (ex) {
|
|
35
|
-
console.error(`
|
|
36
|
-
|
|
54
|
+
console.error(`Header settings error: ${ex}`);
|
|
55
|
+
} finally {
|
|
56
|
+
this.createFullNav(navConfig || this.barebonesNavConfig);
|
|
37
57
|
}
|
|
38
58
|
}
|
|
39
59
|
|
|
@@ -63,22 +83,4 @@ export default class DevExNavigation extends LightningElement {
|
|
|
63
83
|
containerEl.appendChild(hgfNav);
|
|
64
84
|
containerEl.appendChild(hgfNavContext);
|
|
65
85
|
}
|
|
66
|
-
|
|
67
|
-
private createBarebonesNav(): void {
|
|
68
|
-
const hgfNav = this.createGlobalNav({
|
|
69
|
-
origin: "",
|
|
70
|
-
contextNavEnabled: "true"
|
|
71
|
-
});
|
|
72
|
-
const hgfNavContext = this.createContextNav({
|
|
73
|
-
variation: "static",
|
|
74
|
-
propertyTitle: {
|
|
75
|
-
label: "Developers",
|
|
76
|
-
url: "/"
|
|
77
|
-
},
|
|
78
|
-
menuGroup: {}
|
|
79
|
-
});
|
|
80
|
-
const containerEl = this.refs.globalNavContainer as Element;
|
|
81
|
-
containerEl.appendChild(hgfNav);
|
|
82
|
-
containerEl.appendChild(hgfNavContext);
|
|
83
|
-
}
|
|
84
86
|
}
|
|
@@ -64,7 +64,8 @@ export class TreeHandler {
|
|
|
64
64
|
isExpanded: node.isExpanded || false,
|
|
65
65
|
isChildrenLoading: node.isChildrenLoading || false,
|
|
66
66
|
link: node.link,
|
|
67
|
-
method: node.method
|
|
67
|
+
method: node.method,
|
|
68
|
+
renderWith: node.renderWith
|
|
68
69
|
};
|
|
69
70
|
|
|
70
71
|
const mapItem = { node: convertedNode, parent };
|
|
@@ -37,6 +37,16 @@
|
|
|
37
37
|
value={methodText}
|
|
38
38
|
color={metadataBadgeColor}
|
|
39
39
|
></dx-metadata-badge>
|
|
40
|
+
<div
|
|
41
|
+
class="flex tile-icon tile-redoc-arrow"
|
|
42
|
+
if:true={showRedocArrow}
|
|
43
|
+
>
|
|
44
|
+
<dx-icon
|
|
45
|
+
sprite="utility"
|
|
46
|
+
symbol="forward"
|
|
47
|
+
size={iconSize}
|
|
48
|
+
></dx-icon>
|
|
49
|
+
</div>
|
|
40
50
|
</div>
|
|
41
51
|
</a>
|
|
42
52
|
</template>
|
|
@@ -52,6 +52,10 @@ export default class TreeTile extends LightningElement {
|
|
|
52
52
|
return this.treeNode.method && !this.hasChildren;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
private get showRedocArrow() {
|
|
56
|
+
return this.treeNode.renderWith === "redoc";
|
|
57
|
+
}
|
|
58
|
+
|
|
55
59
|
private get methodText() {
|
|
56
60
|
if (this.treeNode.method && this.treeNode.method in methodTextMap) {
|
|
57
61
|
return methodTextMap[this.treeNode.method];
|
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.
|