@salesforcedevs/docs-components 0.54.0-alpha04 → 0.54.1-a01
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 +1 -2
- package/src/modules/doc/amfReference/amfReference.html +13 -5
- package/src/modules/doc/amfReference/amfReference.ts +799 -303
- package/src/modules/doc/amfReference/constants.ts +76 -0
- package/src/modules/doc/amfReference/types.ts +50 -5
- package/src/modules/doc/amfTopic/types.ts +1 -1
- package/src/modules/doc/amfTopic/utils.ts +20 -7
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +2 -1
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +1 -1
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +17 -1
- package/src/modules/doc/breadcrumbs/breadcrumbs.css +9 -1
- package/src/modules/doc/breadcrumbs/breadcrumbs.html +12 -2
- package/src/modules/doc/breadcrumbs/breadcrumbs.ts +49 -8
- package/src/modules/doc/content/content.css +31 -7
- package/src/modules/doc/content/content.ts +17 -2
- package/src/modules/doc/contentCallout/contentCallout.ts +5 -0
- package/src/modules/doc/contentLayout/contentLayout.css +8 -10
- package/src/modules/doc/contentLayout/contentLayout.html +2 -9
- package/src/modules/doc/contentLayout/contentLayout.ts +74 -29
- package/src/modules/doc/header/header.ts +3 -3
- package/src/modules/doc/headingContent/headingContent.css +4 -0
- package/src/modules/doc/xmlContent/types.ts +6 -11
- package/src/modules/doc/xmlContent/utils.ts +18 -20
- package/src/modules/doc/xmlContent/xmlContent.css +7 -0
- package/src/modules/doc/xmlContent/xmlContent.html +6 -1
- package/src/modules/doc/xmlContent/xmlContent.ts +132 -34
- package/src/modules/doc/amfReference/route-meta.ts +0 -22
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const NAVIGATION_ITEMS = [
|
|
2
|
+
{
|
|
3
|
+
label: "Summary",
|
|
4
|
+
name: "summary",
|
|
5
|
+
childrenPropertyName: undefined,
|
|
6
|
+
type: "summary"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
label: "Endpoints",
|
|
10
|
+
name: "endpoints",
|
|
11
|
+
childrenPropertyName: "endpoints",
|
|
12
|
+
type: "endpoint"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: "Documentation",
|
|
16
|
+
name: "documentation",
|
|
17
|
+
childrenPropertyName: "docs",
|
|
18
|
+
type: "documentation"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: "Types",
|
|
22
|
+
name: "types",
|
|
23
|
+
childrenPropertyName: "types",
|
|
24
|
+
type: "type"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: "Security",
|
|
28
|
+
name: "security",
|
|
29
|
+
childrenPropertyName: "security",
|
|
30
|
+
type: "security"
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
const URL_CONFIG = {
|
|
35
|
+
summary: {
|
|
36
|
+
urlIdentifer: "label"
|
|
37
|
+
},
|
|
38
|
+
endpoint: {
|
|
39
|
+
urlIdentifer: "path"
|
|
40
|
+
},
|
|
41
|
+
method: {
|
|
42
|
+
urlIdentifer: "label"
|
|
43
|
+
},
|
|
44
|
+
documentation: {
|
|
45
|
+
urlIdentifer: "label"
|
|
46
|
+
},
|
|
47
|
+
type: {
|
|
48
|
+
urlIdentifer: "label",
|
|
49
|
+
prefix: "type:"
|
|
50
|
+
},
|
|
51
|
+
security: {
|
|
52
|
+
urlIdentifer: "label",
|
|
53
|
+
prefix: "security:"
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const REFERENCE_TYPES = {
|
|
58
|
+
markdown: "markdown",
|
|
59
|
+
raml: "rest-raml",
|
|
60
|
+
oa2: "rest-oa2",
|
|
61
|
+
oa3: "rest-oa3"
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const oldReferenceIdNewReferenceIdMap: Record<string, string> = {
|
|
65
|
+
"commerce-api-assignments": "assignments",
|
|
66
|
+
"commerce-api-campaigns": "campaigns",
|
|
67
|
+
"commerce-api-catalogs": "catalogs",
|
|
68
|
+
"cdn-zones": "cdn-api-process-apis",
|
|
69
|
+
"inventory-impex": "impex",
|
|
70
|
+
"inventory-reservations": "inventory-reservation-service",
|
|
71
|
+
"shopper-login-and-api-access-service": "shopper-login",
|
|
72
|
+
"shopper-login-and-api-access-service-admin": "slas-admin",
|
|
73
|
+
"einstein-recommendations": "einstein-api-quick-start-guide"
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export { NAVIGATION_ITEMS, URL_CONFIG, oldReferenceIdNewReferenceIdMap };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Json } from "
|
|
1
|
+
import { Json } from "typings/custom";
|
|
2
2
|
|
|
3
3
|
export interface AmfTopicType {
|
|
4
4
|
referenceId: string;
|
|
5
|
+
parentReferencePath: string;
|
|
5
6
|
amfId: string;
|
|
6
7
|
elementId: string;
|
|
7
8
|
type: string;
|
|
@@ -10,6 +11,7 @@ export interface AmfTopicType {
|
|
|
10
11
|
export interface AmfMetadataTopic extends AmfTopicType {
|
|
11
12
|
meta: string;
|
|
12
13
|
identifier: string;
|
|
14
|
+
navTitle?: string;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export interface AmfMetaTopicType extends AmfTopicType {
|
|
@@ -20,7 +22,12 @@ export interface NavItem {
|
|
|
20
22
|
name: string;
|
|
21
23
|
label: string;
|
|
22
24
|
// TODO: Better type here
|
|
23
|
-
children?: ({
|
|
25
|
+
children?: ({
|
|
26
|
+
id: string;
|
|
27
|
+
label?: string;
|
|
28
|
+
method: string;
|
|
29
|
+
domId: string;
|
|
30
|
+
} & {
|
|
24
31
|
name: string;
|
|
25
32
|
label: string;
|
|
26
33
|
})[];
|
|
@@ -48,11 +55,37 @@ export type DocPhaseEntry = {
|
|
|
48
55
|
body: string;
|
|
49
56
|
};
|
|
50
57
|
|
|
51
|
-
export
|
|
58
|
+
export type ReferenceType = "markdown" | "rest-raml" | "rest-oa2" | "rest-oa3";
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Represents parsed topic for the sidebar.
|
|
62
|
+
*/
|
|
63
|
+
export interface ParsedMarkdownTopic {
|
|
64
|
+
label: string;
|
|
65
|
+
name: string;
|
|
66
|
+
children: ParsedMarkdownTopic[];
|
|
67
|
+
link?: {
|
|
68
|
+
href: string;
|
|
69
|
+
target?: string;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface AmfConfig {
|
|
52
74
|
id: string;
|
|
53
|
-
amf: string;
|
|
54
75
|
version?: string;
|
|
55
76
|
docPhase?: DocPhaseEntry;
|
|
77
|
+
title: string;
|
|
78
|
+
href: string;
|
|
79
|
+
referenceType: ReferenceType;
|
|
80
|
+
|
|
81
|
+
// determines if a reference config is the current active and selected one.
|
|
82
|
+
isSelected: boolean;
|
|
83
|
+
|
|
84
|
+
// required for spec based references
|
|
85
|
+
amf?: string;
|
|
86
|
+
|
|
87
|
+
// required for markdown based references
|
|
88
|
+
topic?: ParsedMarkdownTopic;
|
|
56
89
|
}
|
|
57
90
|
|
|
58
91
|
export interface ParsedTopicModel {
|
|
@@ -79,10 +112,22 @@ export interface ReferenceVersion {
|
|
|
79
112
|
label: string;
|
|
80
113
|
deprecated?: boolean;
|
|
81
114
|
selected?: boolean;
|
|
115
|
+
link: {
|
|
116
|
+
href: string;
|
|
117
|
+
};
|
|
82
118
|
}
|
|
83
119
|
|
|
84
120
|
export interface ReferenceSetConfig {
|
|
121
|
+
refId?: string;
|
|
85
122
|
versionToRefMap?: Map<string, Array<AmfConfig>>;
|
|
86
123
|
refList: Array<AmfConfig>;
|
|
87
|
-
versions
|
|
124
|
+
versions: Array<ReferenceVersion>;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface RouteMeta {
|
|
128
|
+
meta: string;
|
|
129
|
+
referenceId: string;
|
|
130
|
+
topicId: string;
|
|
131
|
+
//type is only for spec based references
|
|
132
|
+
type?: string;
|
|
88
133
|
}
|
|
@@ -6,8 +6,7 @@ import type {
|
|
|
6
6
|
ApiSummaryElement,
|
|
7
7
|
ApiTypeElement
|
|
8
8
|
} from "./types";
|
|
9
|
-
|
|
10
|
-
import { Json } from "@lwrjs/types";
|
|
9
|
+
import { Json } from "typings/custom";
|
|
11
10
|
|
|
12
11
|
export function createSummaryElement(amf: Json): HTMLElement {
|
|
13
12
|
const summaryElement: ApiSummaryElement = document.createElement(
|
|
@@ -78,7 +77,10 @@ export function createMethodElement(
|
|
|
78
77
|
* Creates a documentation element for Security AMF type
|
|
79
78
|
*
|
|
80
79
|
*/
|
|
81
|
-
export function createSecurityElement(
|
|
80
|
+
export function createSecurityElement(
|
|
81
|
+
amf: Json,
|
|
82
|
+
securityModel: Json
|
|
83
|
+
): HTMLElement {
|
|
82
84
|
const el: ApiSecurityElement = document.createElement(
|
|
83
85
|
"api-security-documentation"
|
|
84
86
|
) as ApiSecurityElement;
|
|
@@ -94,8 +96,14 @@ export function createSecurityElement(amf: Json, securityModel: Json): HTMLEleme
|
|
|
94
96
|
* @param {string} amfId Reference ID as passed in from amfConfig
|
|
95
97
|
* @param {string} selected Currently selected `@id`.
|
|
96
98
|
*/
|
|
97
|
-
export function createTypeElement(
|
|
98
|
-
|
|
99
|
+
export function createTypeElement(
|
|
100
|
+
amf: Json,
|
|
101
|
+
typeModel: Json,
|
|
102
|
+
mediaTypes: Json
|
|
103
|
+
): HTMLElement {
|
|
104
|
+
const el: ApiTypeElement = document.createElement(
|
|
105
|
+
"api-type-documentation"
|
|
106
|
+
) as ApiTypeElement;
|
|
99
107
|
el.setAttribute("exportparts", ["type-title"].join(","));
|
|
100
108
|
el.amf = amf;
|
|
101
109
|
el.type = typeModel;
|
|
@@ -109,8 +117,13 @@ export function createTypeElement(amf: Json, typeModel: Json, mediaTypes: Json):
|
|
|
109
117
|
* @param {string} amfId Reference ID as passed in from amfConfig
|
|
110
118
|
* @param {string} selected Currently selected `@id`.
|
|
111
119
|
*/
|
|
112
|
-
export function createDocumentationElement(
|
|
113
|
-
|
|
120
|
+
export function createDocumentationElement(
|
|
121
|
+
amf: Json,
|
|
122
|
+
docsModel: Json
|
|
123
|
+
): HTMLElement {
|
|
124
|
+
const el: ApiDocElement = document.createElement(
|
|
125
|
+
"api-documentation-document"
|
|
126
|
+
) as ApiDocElement;
|
|
114
127
|
el.amf = amf;
|
|
115
128
|
el.shape = docsModel;
|
|
116
129
|
return el;
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
:host {
|
|
5
5
|
display: flex;
|
|
6
6
|
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
7
8
|
width: fit-content;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
:host(.breadcrumb_long) {
|
|
11
12
|
/* ensure 30 character min-width */
|
|
12
|
-
min-width:
|
|
13
|
+
min-width: 200px;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
:host(.breadcrumb_back-arrow) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { track } from "dxUtils/analytics";
|
|
1
2
|
import { LightningElement, api } from "lwc";
|
|
2
|
-
import { BreadcrumbItemVariant } from "typings/custom";
|
|
3
|
+
import { AnalyticsPayload, BreadcrumbItemVariant } from "typings/custom";
|
|
3
4
|
|
|
4
5
|
const BREADCRUMB_LONG = "breadcrumb_long";
|
|
5
6
|
const BREADCRUMB_BACK_ARROW = "breadcrumb_back-arrow";
|
|
@@ -7,6 +8,8 @@ const BREADCRUMB_BACK_ARROW = "breadcrumb_back-arrow";
|
|
|
7
8
|
const LONG_LABEL_NUMBER = 30;
|
|
8
9
|
export default class BreadcrumbItem extends LightningElement {
|
|
9
10
|
@api href?: string;
|
|
11
|
+
@api analyticsEvent!: string;
|
|
12
|
+
@api analyticsBasePayload!: AnalyticsPayload;
|
|
10
13
|
|
|
11
14
|
@api
|
|
12
15
|
get label() {
|
|
@@ -46,4 +49,17 @@ export default class BreadcrumbItem extends LightningElement {
|
|
|
46
49
|
private get isBackArrowVariant(): boolean {
|
|
47
50
|
return this._variant === "back-arrow";
|
|
48
51
|
}
|
|
52
|
+
|
|
53
|
+
private onLinkClick(event: Event): void {
|
|
54
|
+
if (!this.analyticsEvent) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
track(event.target!, this.analyticsEvent, {
|
|
59
|
+
...this.analyticsBasePayload,
|
|
60
|
+
clickText: this.label,
|
|
61
|
+
itemTitle: this.label,
|
|
62
|
+
pageLocation: window.location.pathname
|
|
63
|
+
});
|
|
64
|
+
}
|
|
49
65
|
}
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
:host {
|
|
5
5
|
--dx-c-breadcrumbs-title-color: var(--dx-g-blue-vibrant-20);
|
|
6
6
|
--dx-c-breadcrumbs-breadcrumb-color: var(--dx-g-blue-vibrant-20);
|
|
7
|
+
|
|
8
|
+
font-family: var(--dx-g-font-sans);
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
nav {
|
|
10
12
|
display: flex;
|
|
11
13
|
align-items: center;
|
|
12
|
-
height: 100%;
|
|
13
14
|
position: relative;
|
|
14
15
|
gap: var(--dx-g-spacing-sm);
|
|
15
16
|
}
|
|
@@ -17,3 +18,10 @@ nav {
|
|
|
17
18
|
.breadcrumb-item_slash {
|
|
18
19
|
min-width: fit-content;
|
|
19
20
|
}
|
|
21
|
+
|
|
22
|
+
dx-dropdown {
|
|
23
|
+
--dx-c-dropdown-option-font-size: var(--dx-g-text-sm);
|
|
24
|
+
--dx-c-dropdown-option-label-color: var(
|
|
25
|
+
--dx-c-breadcrumbs-breadcrumb-color
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
<template if:false={renderSmallVariant}>
|
|
4
4
|
<template if:true={renderFirstCrumb}>
|
|
5
5
|
<doc-breadcrumb-item
|
|
6
|
+
analytics-event={analyticsEventName}
|
|
7
|
+
analytics-base-payload={analyticsBasePayload}
|
|
6
8
|
href={firstCrumb.href}
|
|
7
9
|
label={firstCrumb.label}
|
|
8
10
|
></doc-breadcrumb-item>
|
|
@@ -11,10 +13,14 @@
|
|
|
11
13
|
<template if:true={renderDropdown}>
|
|
12
14
|
<dx-dropdown
|
|
13
15
|
if:true={renderDropdown}
|
|
16
|
+
analytics-event={analyticsEventName}
|
|
17
|
+
analytics-base-payload={analyticsBasePayload}
|
|
14
18
|
options={dropdownOptions}
|
|
15
19
|
open-on-hover
|
|
16
20
|
placement="bottom"
|
|
17
|
-
|
|
21
|
+
suppress-gtm-nav-headings
|
|
22
|
+
variant="indented"
|
|
23
|
+
width="fit-content"
|
|
18
24
|
>
|
|
19
25
|
<dx-button
|
|
20
26
|
aria-label="Open Breadcrumbs Dropdown"
|
|
@@ -27,8 +33,10 @@
|
|
|
27
33
|
</template>
|
|
28
34
|
<template for:each={breadcrumbItems} for:item="breadcrumb">
|
|
29
35
|
<doc-breadcrumb-item
|
|
36
|
+
analytics-event={analyticsEventName}
|
|
37
|
+
analytics-base-payload={analyticsBasePayload}
|
|
30
38
|
href={breadcrumb.href}
|
|
31
|
-
key={breadcrumb.
|
|
39
|
+
key={breadcrumb.id}
|
|
32
40
|
label={breadcrumb.label}
|
|
33
41
|
></doc-breadcrumb-item>
|
|
34
42
|
<span class="breadcrumb-item_slash" key={breadcrumb.label}>
|
|
@@ -39,6 +47,8 @@
|
|
|
39
47
|
</template>
|
|
40
48
|
<template if:true={renderSmallVariant}>
|
|
41
49
|
<doc-breadcrumb-item
|
|
50
|
+
analytics-event={analyticsEventName}
|
|
51
|
+
analytics-base-payload={analyticsBasePayload}
|
|
42
52
|
href={lastLinkCrump.href}
|
|
43
53
|
label={lastLinkCrump.label}
|
|
44
54
|
variant="back-arrow"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
|
-
import { Breadcrumb,
|
|
2
|
+
import { Breadcrumb, OptionWithLink } from "typings/custom";
|
|
3
3
|
import { toJson } from "dxUtils/normalizers";
|
|
4
4
|
|
|
5
5
|
type BreadcrumbConfig = {
|
|
@@ -8,13 +8,23 @@ type BreadcrumbConfig = {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
const GAP = 8;
|
|
11
|
+
|
|
12
|
+
// Unit in pixels based on Salesforce Sans font-family.
|
|
11
13
|
const CONSTANTS = {
|
|
12
|
-
pixelPerCharacter: 7.
|
|
13
|
-
pixelPerCrumbSpace: GAP * 2 +
|
|
14
|
-
minWidthPerCrumb:
|
|
14
|
+
pixelPerCharacter: 7.7,
|
|
15
|
+
pixelPerCrumbSpace: GAP * 2 + 8.6,
|
|
16
|
+
minWidthPerCrumb: 200,
|
|
15
17
|
dropdownWidth: 32
|
|
16
18
|
};
|
|
17
19
|
|
|
20
|
+
export const ANALYTICS_EVENT_NAME = "custEv_breadcrumbClick";
|
|
21
|
+
export const ANALYTICS_BASE_PAYLOAD = {
|
|
22
|
+
elementType: "breadcrumb",
|
|
23
|
+
locationOnPage: "breadcrumb",
|
|
24
|
+
ctaClick: true,
|
|
25
|
+
pageLocation: window.location.pathname
|
|
26
|
+
};
|
|
27
|
+
|
|
18
28
|
export default class Breadcrumbs extends LightningElement {
|
|
19
29
|
@api ariaLabel: string = "Documentation Breadcrumbs";
|
|
20
30
|
|
|
@@ -22,15 +32,26 @@ export default class Breadcrumbs extends LightningElement {
|
|
|
22
32
|
get breadcrumbs(): Breadcrumb[] {
|
|
23
33
|
return this._breadcrumbs;
|
|
24
34
|
}
|
|
35
|
+
|
|
25
36
|
set breadcrumbs(value) {
|
|
26
|
-
this.
|
|
37
|
+
this.normalizeAndAssignBreadcrumbs(value);
|
|
27
38
|
this.calculateBreadcrumbsConfigs();
|
|
28
39
|
if (this.observer) {
|
|
29
40
|
this.updateDropdownOptionAmount();
|
|
30
41
|
}
|
|
31
42
|
}
|
|
32
43
|
|
|
44
|
+
@api
|
|
45
|
+
get pixelPerCharacter(): number {
|
|
46
|
+
return this._pixelPerCharacter;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
set pixelPerCharacter(value: number | string) {
|
|
50
|
+
this._pixelPerCharacter = +value;
|
|
51
|
+
}
|
|
52
|
+
|
|
33
53
|
private _breadcrumbs: Breadcrumb[] = [];
|
|
54
|
+
private _pixelPerCharacter = CONSTANTS.pixelPerCharacter;
|
|
34
55
|
private navWidth = 0;
|
|
35
56
|
private observer: ResizeObserver | null = null;
|
|
36
57
|
private breadcrumbConfigs: BreadcrumbConfig[] = [];
|
|
@@ -62,10 +83,10 @@ export default class Breadcrumbs extends LightningElement {
|
|
|
62
83
|
private get renderDropdown(): boolean {
|
|
63
84
|
return this.hasInternalBreadcrumbs && !!this.dropdownOptionAmount;
|
|
64
85
|
}
|
|
65
|
-
private get dropdownOptions():
|
|
86
|
+
private get dropdownOptions(): OptionWithLink[] {
|
|
66
87
|
return this.breadcrumbs!.slice(1, this.dropdownOptionAmount! + 1).map(
|
|
67
88
|
(link) => ({
|
|
68
|
-
id: link.
|
|
89
|
+
id: link.id!,
|
|
69
90
|
label: link.label,
|
|
70
91
|
link: { href: link.href! }
|
|
71
92
|
})
|
|
@@ -84,6 +105,14 @@ export default class Breadcrumbs extends LightningElement {
|
|
|
84
105
|
return this.breadcrumbs[this.breadcrumbs.length - 1];
|
|
85
106
|
}
|
|
86
107
|
|
|
108
|
+
private get analyticsEventName() {
|
|
109
|
+
return ANALYTICS_EVENT_NAME;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private get analyticsBasePayload() {
|
|
113
|
+
return ANALYTICS_BASE_PAYLOAD;
|
|
114
|
+
}
|
|
115
|
+
|
|
87
116
|
renderedCallback(): void {
|
|
88
117
|
if (!this.observer) {
|
|
89
118
|
this.observer = new ResizeObserver((entries) => {
|
|
@@ -103,6 +132,17 @@ export default class Breadcrumbs extends LightningElement {
|
|
|
103
132
|
this.observer?.disconnect();
|
|
104
133
|
}
|
|
105
134
|
|
|
135
|
+
private normalizeAndAssignBreadcrumbs(breadcrumbs?: Breadcrumb[] | string) {
|
|
136
|
+
if (!breadcrumbs) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
this._breadcrumbs = toJson(breadcrumbs).map((crumb: Breadcrumb) => ({
|
|
141
|
+
...crumb,
|
|
142
|
+
id: crumb.id || crumb.href
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
|
|
106
146
|
private updateDropdownOptionAmount(): void {
|
|
107
147
|
this.dropdownOptionAmount = this.breadcrumbConfigs.find(
|
|
108
148
|
({ minWidth }) => minWidth <= this.navWidth
|
|
@@ -135,7 +175,8 @@ export default class Breadcrumbs extends LightningElement {
|
|
|
135
175
|
(previousValue, element) =>
|
|
136
176
|
previousValue +
|
|
137
177
|
Math.min(
|
|
138
|
-
element.label.length *
|
|
178
|
+
element.label.length *
|
|
179
|
+
(this.pixelPerCharacter || CONSTANTS.pixelPerCharacter),
|
|
139
180
|
CONSTANTS.minWidthPerCrumb
|
|
140
181
|
),
|
|
141
182
|
(breadcrumbs.length - 1) * CONSTANTS.pixelPerCrumbSpace + offset
|
|
@@ -66,31 +66,47 @@ td > img.content-image:first-child:last-child[alt="No"] {
|
|
|
66
66
|
|
|
67
67
|
h1 {
|
|
68
68
|
font-family: var(--dx-g-font-display);
|
|
69
|
-
font-size:
|
|
69
|
+
font-size: var(--dx-g-text-4xl);
|
|
70
70
|
|
|
71
71
|
/* not registered */
|
|
72
72
|
color: var(--dx-g-blue-vibrant-20);
|
|
73
73
|
letter-spacing: -0.4px;
|
|
74
|
-
line-height:
|
|
74
|
+
line-height: 56px;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
h2 {
|
|
78
78
|
font-family: var(--dx-g-font-display);
|
|
79
|
-
font-size: var(--dx-g-text-
|
|
79
|
+
font-size: var(--dx-g-text-3xl);
|
|
80
80
|
color: var(--dx-g-blue-vibrant-20);
|
|
81
81
|
letter-spacing: -0.1px;
|
|
82
|
-
line-height: var(--dx-g-spacing-
|
|
82
|
+
line-height: var(--dx-g-spacing-3xl);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
h3 {
|
|
86
86
|
font-family: var(--dx-g-font-display);
|
|
87
|
-
font-size:
|
|
87
|
+
font-size: 32px;
|
|
88
88
|
color: var(--dx-g-blue-vibrant-20);
|
|
89
89
|
letter-spacing: -0.1px;
|
|
90
|
-
line-height: var(--dx-g-spacing-
|
|
90
|
+
line-height: var(--dx-g-spacing-2xl);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
h4 {
|
|
94
|
+
font-family: var(--dx-g-font-display);
|
|
95
|
+
font-size: var(--dx-g-text-xl);
|
|
96
|
+
color: var(--dx-g-blue-vibrant-20);
|
|
97
|
+
letter-spacing: 0;
|
|
98
|
+
line-height: var(--dx-g-spacing-xl);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
h5 {
|
|
102
|
+
font-family: var(--dx-g-font-display);
|
|
103
|
+
font-size: var(--dx-g-text-lg);
|
|
104
|
+
color: var(--dx-g-blue-vibrant-20);
|
|
105
|
+
letter-spacing: 0;
|
|
106
|
+
line-height: 28px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
h6 {
|
|
94
110
|
font-family: var(--dx-g-font-display);
|
|
95
111
|
font-size: var(--dx-g-text-base);
|
|
96
112
|
color: var(--dx-g-blue-vibrant-20);
|
|
@@ -116,6 +132,12 @@ p,
|
|
|
116
132
|
margin-bottom: var(--dx-g-spacing-md);
|
|
117
133
|
}
|
|
118
134
|
|
|
135
|
+
dd > p,
|
|
136
|
+
dd > .p {
|
|
137
|
+
margin-top: 0;
|
|
138
|
+
margin-bottom: 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
119
141
|
.li {
|
|
120
142
|
font-family: var(--dx-g-font-sans);
|
|
121
143
|
font-size: var(--dx-g-text-base);
|
|
@@ -175,7 +197,8 @@ a,
|
|
|
175
197
|
margin-right: var(--dx-g-spacing-lg);
|
|
176
198
|
}
|
|
177
199
|
|
|
178
|
-
.codeph
|
|
200
|
+
.codeph,
|
|
201
|
+
.filepath {
|
|
179
202
|
font-family: var(--dx-g-font-mono);
|
|
180
203
|
font-size: var(--dx-g-text-sm);
|
|
181
204
|
line-height: var(--dx-g-text-lg);
|
|
@@ -239,6 +262,7 @@ dd {
|
|
|
239
262
|
letter-spacing: 0;
|
|
240
263
|
line-height: var(--dx-g-spacing-lg);
|
|
241
264
|
margin-left: var(--dx-g-spacing-smd);
|
|
265
|
+
margin-bottom: var(--dx-g-spacing-md);
|
|
242
266
|
}
|
|
243
267
|
|
|
244
268
|
li {
|
|
@@ -150,11 +150,26 @@ export default class Content extends LightningElement {
|
|
|
150
150
|
is: ContentCallout
|
|
151
151
|
});
|
|
152
152
|
const detailEls = calloutEl.querySelectorAll(
|
|
153
|
-
"p, div.data, ol, ul,
|
|
153
|
+
"p, div.data, ol, ul, p+.codeSection, .mediaBd > span.ph"
|
|
154
154
|
);
|
|
155
155
|
detailEls.forEach((detailEl) => {
|
|
156
|
-
|
|
156
|
+
if (detailEl.innerHTML.trim() !== "") {
|
|
157
|
+
calloutCompEl.appendChild(detailEl);
|
|
158
|
+
}
|
|
157
159
|
});
|
|
160
|
+
|
|
161
|
+
let flag = 1;
|
|
162
|
+
for (let i = 0; i < detailEls.length; i++) {
|
|
163
|
+
flag &= detailEls[i].innerHTML.trim() === "";
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (flag) {
|
|
167
|
+
const codeEls = calloutEl.querySelectorAll(".codeSection");
|
|
168
|
+
codeEls.forEach((codeEl) => {
|
|
169
|
+
calloutCompEl.appendChild(codeEl);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
158
173
|
const type = calloutEl.querySelector("h4").textContent;
|
|
159
174
|
const typeLower = type.toLowerCase();
|
|
160
175
|
Object.assign(calloutCompEl, {
|
|
@@ -26,6 +26,11 @@ export default class ContentCallout extends LightningElement {
|
|
|
26
26
|
this.iconColor = "red-vibrant-50";
|
|
27
27
|
this.iconName = "alert";
|
|
28
28
|
break;
|
|
29
|
+
case "important":
|
|
30
|
+
this.cardVariant = "doc-status-container dx-callout-important";
|
|
31
|
+
this.iconColor = "gray-10";
|
|
32
|
+
this.iconName = "announcement";
|
|
33
|
+
break;
|
|
29
34
|
case "note":
|
|
30
35
|
default:
|
|
31
36
|
this.cardVariant = "dx-callout-note";
|
|
@@ -4,12 +4,19 @@
|
|
|
4
4
|
display: block;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
doc-breadcrumbs {
|
|
8
|
+
--dx-c-popover-z-index: 5;
|
|
9
|
+
|
|
10
|
+
display: block;
|
|
11
|
+
margin-bottom: var(--dx-g-spacing-2xl);
|
|
12
|
+
}
|
|
13
|
+
|
|
7
14
|
dx-sidebar,
|
|
8
15
|
dx-sidebar-old {
|
|
9
16
|
--dx-c-sidebar-height: 100%;
|
|
10
17
|
--dx-c-sidebar-vertical-padding: var(--dx-c-content-vertical-spacing);
|
|
11
18
|
|
|
12
|
-
z-index:
|
|
19
|
+
z-index: 6;
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
dx-toc {
|
|
@@ -56,11 +63,6 @@ dx-toc {
|
|
|
56
63
|
max-width: 275px;
|
|
57
64
|
}
|
|
58
65
|
|
|
59
|
-
dx-breadcrumbs {
|
|
60
|
-
display: block;
|
|
61
|
-
margin-bottom: var(--dx-g-spacing-2xl);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
66
|
@media screen and (max-width: 1024px) {
|
|
65
67
|
.right-nav-bar {
|
|
66
68
|
display: none;
|
|
@@ -68,10 +70,6 @@ dx-breadcrumbs {
|
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
@media screen and (max-width: 800px) {
|
|
71
|
-
dx-breadcrumbs {
|
|
72
|
-
display: none;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
73
|
.content-body {
|
|
76
74
|
margin-top: var(--dx-c-content-vertical-spacing);
|
|
77
75
|
}
|
|
@@ -28,17 +28,10 @@
|
|
|
28
28
|
<slot name="doc-phase"></slot>
|
|
29
29
|
<div class="content-body-container">
|
|
30
30
|
<div class="content-body">
|
|
31
|
-
<
|
|
31
|
+
<doc-breadcrumbs
|
|
32
32
|
if:true={breadcrumbs}
|
|
33
33
|
breadcrumbs={breadcrumbs}
|
|
34
|
-
|
|
35
|
-
hide-current-location
|
|
36
|
-
></dx-breadcrumbs>
|
|
37
|
-
<dx-breadcrumbs
|
|
38
|
-
if:false={breadcrumbs}
|
|
39
|
-
pathname={pathname}
|
|
40
|
-
hide-current-location
|
|
41
|
-
></dx-breadcrumbs>
|
|
34
|
+
></doc-breadcrumbs>
|
|
42
35
|
<slot onslotchange={onSlotChange}></slot>
|
|
43
36
|
</div>
|
|
44
37
|
<div class="right-nav-bar is-sticky">
|