@salesforcedevs/docs-components 0.56.2-comp-flex-ref-1 → 0.56.2-example
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 +10 -2
- package/package.json +18 -12
- package/src/modules/doc/{amfReference/utils.ts → amfModelParser/amfModelParser.ts} +10 -5
- package/src/modules/doc/amfReference/amfReference.css +23 -3
- package/src/modules/doc/amfReference/amfReference.html +34 -21
- package/src/modules/doc/amfReference/amfReference.ts +386 -102
- package/src/modules/doc/amfReference/types.ts +5 -12
- package/src/modules/doc/amfTopic/amfTopic.css +20 -0
- package/src/modules/doc/amfTopic/amfTopic.ts +35 -18
- package/src/modules/doc/amfTopic/types.ts +15 -13
- package/src/modules/doc/amfTopic/utils.ts +12 -6
- 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 +22 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.css +9 -1
- package/src/modules/doc/breadcrumbs/breadcrumbs.html +44 -34
- package/src/modules/doc/breadcrumbs/breadcrumbs.ts +62 -23
- package/src/modules/doc/componentPlayground/componentPlayground.css +22 -0
- package/src/modules/doc/componentPlayground/componentPlayground.html +20 -0
- package/src/modules/doc/componentPlayground/componentPlayground.ts +42 -0
- package/src/modules/doc/content/content.css +70 -76
- package/src/modules/doc/content/content.html +1 -0
- package/src/modules/doc/content/content.ts +26 -47
- package/src/modules/doc/contentCallout/contentCallout.css +15 -7
- package/src/modules/doc/contentCallout/contentCallout.html +13 -4
- package/src/modules/doc/contentCallout/contentCallout.ts +14 -2
- package/src/modules/doc/contentLayout/contentLayout.css +1 -100
- package/src/modules/doc/contentLayout/contentLayout.html +30 -17
- package/src/modules/doc/contentLayout/contentLayout.ts +315 -70
- package/src/modules/doc/doDont/doDont.css +47 -0
- package/src/modules/doc/doDont/doDont.html +27 -0
- package/src/modules/doc/doDont/doDont.ts +17 -0
- package/src/modules/doc/header/header.css +65 -36
- package/src/modules/doc/header/header.html +41 -139
- package/src/modules/doc/header/header.ts +54 -76
- package/src/modules/doc/heading/heading.css +16 -37
- package/src/modules/doc/heading/heading.html +4 -4
- package/src/modules/doc/heading/heading.ts +12 -10
- package/src/modules/doc/headingAnchor/headingAnchor.css +2 -2
- package/src/modules/doc/headingAnchor/headingAnchor.ts +2 -2
- package/src/modules/doc/headingContent/headingContent.css +6 -8
- package/src/modules/doc/headingContent/headingContent.html +9 -15
- package/src/modules/doc/headingContent/headingContent.ts +2 -14
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.css +1 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +68 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.ts +256 -0
- package/src/modules/doc/overview/overview.css +40 -0
- package/src/modules/doc/overview/overview.html +34 -0
- package/src/modules/doc/overview/overview.ts +12 -0
- package/src/modules/doc/phase/phase.css +18 -3
- package/src/modules/doc/phase/phase.html +15 -3
- package/src/modules/doc/phase/phase.ts +44 -8
- package/src/modules/doc/specificationContent/specificationContent.css +36 -0
- package/src/modules/doc/specificationContent/specificationContent.html +167 -0
- package/src/modules/doc/specificationContent/specificationContent.ts +127 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.html +20 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.scoped.css +16 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.ts +16 -0
- package/src/modules/doc/toc/toc.ts +1 -1
- package/src/modules/doc/versionPicker/versionPicker.css +64 -0
- package/src/modules/doc/versionPicker/versionPicker.html +38 -0
- package/src/modules/doc/versionPicker/versionPicker.ts +65 -0
- package/src/modules/doc/xmlContent/types.ts +12 -3
- package/src/modules/doc/xmlContent/utils.ts +17 -12
- package/src/modules/doc/xmlContent/xmlContent.css +32 -3
- package/src/modules/doc/xmlContent/xmlContent.html +41 -15
- package/src/modules/doc/xmlContent/xmlContent.ts +310 -96
- package/src/modules/docHelpers/amfStyle/amfStyle.css +10 -45
- package/src/modules/docHelpers/contentLayoutStyle/contentLayoutStyle.css +131 -0
- package/src/modules/docHelpers/imgStyle/imgStyle.css +59 -0
- package/src/modules/docHelpers/status/status.css +1 -1
- package/src/modules/docUtils/{SearchSyncer/SearchSyncer.ts → searchSyncer/searchSyncer.ts} +1 -0
- package/src/modules/docUtils/utils/__mocks__/coveo.analytics.ts +16 -0
- package/src/modules/docUtils/utils/coveo.analytics.d.ts +10 -0
- package/src/modules/docUtils/utils/utils.ts +32 -0
- package/src/modules/docBaseElements/lightningElementWithState/lightningElementWithState.ts +0 -93
- package/src/modules/docHelpers/phaseContentLayout/phaseContentLayout.css +0 -39
|
@@ -24,6 +24,7 @@ export type TreeNode = {
|
|
|
24
24
|
name: string;
|
|
25
25
|
children?: Array<TreeNode>;
|
|
26
26
|
isExpanded?: boolean;
|
|
27
|
+
parent?: TreeNode;
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
type DropdownOption = {
|
|
@@ -34,6 +35,9 @@ type DropdownOption = {
|
|
|
34
35
|
export type DocVersion = DropdownOption & {
|
|
35
36
|
releaseVersion: string;
|
|
36
37
|
url: string;
|
|
38
|
+
link?: {
|
|
39
|
+
href: string;
|
|
40
|
+
};
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
export type DocLanguage = DropdownOption & {
|
|
@@ -57,12 +61,15 @@ export type ApiDocLanguage = {
|
|
|
57
61
|
|
|
58
62
|
export interface Header extends Element {
|
|
59
63
|
subtitle: string;
|
|
64
|
+
headerHref: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type SiderbarFooter = {
|
|
60
68
|
bailHref: string;
|
|
61
69
|
bailLabel: string;
|
|
62
70
|
languages: Array<DocLanguage>;
|
|
63
|
-
language
|
|
64
|
-
|
|
65
|
-
}
|
|
71
|
+
language?: string;
|
|
72
|
+
};
|
|
66
73
|
|
|
67
74
|
export type ApiNavItem = {
|
|
68
75
|
children: Array<ApiNavItem>;
|
|
@@ -109,3 +116,5 @@ export type ContentApiOptions = {
|
|
|
109
116
|
version: string;
|
|
110
117
|
language: string;
|
|
111
118
|
};
|
|
119
|
+
|
|
120
|
+
export type TocMap = { [key: string]: TreeNode };
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
DocumentData,
|
|
9
9
|
DocLanguage,
|
|
10
10
|
DocVersion,
|
|
11
|
-
TreeNode
|
|
11
|
+
TreeNode,
|
|
12
|
+
TocMap
|
|
12
13
|
} from "./types";
|
|
13
14
|
import { Language } from "typings/custom";
|
|
14
15
|
import { getLanguageDisplayTextById } from "dxUtils/language";
|
|
@@ -86,7 +87,9 @@ export class FetchContent {
|
|
|
86
87
|
return json;
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
private normalizeToc(
|
|
90
|
+
private normalizeToc(
|
|
91
|
+
apiToc: Array<ApiNavItem>
|
|
92
|
+
): {
|
|
90
93
|
tocMap: { [key: string]: TreeNode };
|
|
91
94
|
normalizedToc: Array<TreeNode>;
|
|
92
95
|
} {
|
|
@@ -100,26 +103,26 @@ export class FetchContent {
|
|
|
100
103
|
|
|
101
104
|
private normalizeNavItem(
|
|
102
105
|
navItem: ApiNavItem,
|
|
103
|
-
tocMap:
|
|
106
|
+
tocMap: TocMap,
|
|
107
|
+
parentNavItem?: TreeNode
|
|
104
108
|
): TreeNode {
|
|
105
109
|
const name = this.calculateNavItemName(navItem, tocMap);
|
|
106
110
|
const node: TreeNode = {
|
|
107
111
|
label: navItem.text,
|
|
108
|
-
name
|
|
112
|
+
name,
|
|
113
|
+
parent: parentNavItem
|
|
109
114
|
};
|
|
115
|
+
|
|
110
116
|
if (name) {
|
|
111
117
|
tocMap[name] = node;
|
|
112
118
|
}
|
|
113
119
|
node.children = navItem.children?.map((child) =>
|
|
114
|
-
this.normalizeNavItem(child, tocMap)
|
|
120
|
+
this.normalizeNavItem(child, tocMap, node)
|
|
115
121
|
);
|
|
116
122
|
return node;
|
|
117
123
|
}
|
|
118
124
|
|
|
119
|
-
private calculateNavItemName(
|
|
120
|
-
navItem: ApiNavItem,
|
|
121
|
-
tocMap: { [key: string]: TreeNode }
|
|
122
|
-
): string {
|
|
125
|
+
private calculateNavItemName(navItem: ApiNavItem, tocMap: TocMap): string {
|
|
123
126
|
let href = navItem.a_attr?.href || "";
|
|
124
127
|
if (href.includes("#")) {
|
|
125
128
|
const [pathUrl] = href.split("#");
|
|
@@ -144,11 +147,13 @@ export class FetchContent {
|
|
|
144
147
|
}
|
|
145
148
|
|
|
146
149
|
private normalizeLanguage(language: ApiDocLanguage): DocLanguage {
|
|
147
|
-
|
|
148
150
|
return (
|
|
149
151
|
language && {
|
|
150
|
-
label:
|
|
151
|
-
|
|
152
|
+
label:
|
|
153
|
+
getLanguageDisplayTextById(
|
|
154
|
+
this.languages,
|
|
155
|
+
language.locale
|
|
156
|
+
) || language.label,
|
|
152
157
|
id: language.locale,
|
|
153
158
|
code: language.code,
|
|
154
159
|
url: language.url
|
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
--button-primary-color-hover: var(--dx-g-blue-vibrant-40);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
doc-content-layout {
|
|
7
|
+
--dx-c-content-sidebar-sticky-top: var(--dx-g-global-header-height);
|
|
8
|
+
--dx-c-sidebar-height: calc(100vh - var(--dx-g-global-header-height));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
doc-breadcrumbs {
|
|
12
|
+
--dx-c-popover-z-index: 5;
|
|
13
|
+
|
|
14
|
+
display: block;
|
|
15
|
+
margin-bottom: var(--dx-g-spacing-md);
|
|
16
|
+
}
|
|
17
|
+
|
|
6
18
|
dx-dropdown {
|
|
7
19
|
--dx-c-dropdown-option-font-size: var(--dx-g-text-sm);
|
|
8
20
|
}
|
|
@@ -19,7 +31,24 @@ dx-dropdown > dx-button:hover {
|
|
|
19
31
|
--border-color: var(--button-primary-color-hover);
|
|
20
32
|
}
|
|
21
33
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
doc-phase {
|
|
35
|
+
--doc-c-phase-top: var(--dx-g-global-header-height);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media screen and (max-width: 768px) {
|
|
39
|
+
doc-content-layout {
|
|
40
|
+
--dx-g-doc-header-main-nav-height: 41px;
|
|
41
|
+
--dx-g-doc-header-height: calc(
|
|
42
|
+
var(--dx-g-doc-header-main-nav-height) + 40px
|
|
43
|
+
);
|
|
44
|
+
--dx-c-content-sidebar-sticky-top: calc(
|
|
45
|
+
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
doc-phase {
|
|
50
|
+
--doc-c-phase-top: calc(
|
|
51
|
+
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
|
|
52
|
+
);
|
|
53
|
+
}
|
|
25
54
|
}
|
|
@@ -1,34 +1,60 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<doc-content-layout
|
|
3
|
-
if
|
|
3
|
+
lwc:if={displayContent}
|
|
4
|
+
lwc:ref="docContentLayout"
|
|
4
5
|
coveo-organization-id={coveoOrganizationId}
|
|
5
6
|
coveo-public-access-token={coveoPublicAccessToken}
|
|
6
|
-
coveo-
|
|
7
|
+
coveo-analytics-token={coveoAnalyticsToken}
|
|
8
|
+
coveo-search-hub={coveoSearchHub}
|
|
7
9
|
coveo-advanced-query-config={coveoAdvancedQueryConfig}
|
|
8
|
-
sidebar-header=
|
|
10
|
+
sidebar-header={docTitle}
|
|
9
11
|
sidebar-content={sidebarContent}
|
|
10
12
|
sidebar-value={sidebarValue}
|
|
11
13
|
onselect={handleSelect}
|
|
12
14
|
use-old-sidebar={useOldSidebar}
|
|
15
|
+
onlangchange={handleLanguageChange}
|
|
16
|
+
languages={sidebarFooterContent.languages}
|
|
17
|
+
language={sidebarFooterContent.language}
|
|
18
|
+
bail-href={sidebarFooterContent.bailHref}
|
|
19
|
+
bail-label={sidebarFooterContent.bailLabel}
|
|
20
|
+
show-footer={enableFooter}
|
|
13
21
|
>
|
|
14
|
-
<
|
|
15
|
-
|
|
22
|
+
<doc-phase
|
|
23
|
+
slot="version-banner"
|
|
24
|
+
lwc:if={showVersionBanner}
|
|
25
|
+
doc-phase-info={oldVersionInfo}
|
|
26
|
+
icon-name="warning"
|
|
27
|
+
dismissible="true"
|
|
28
|
+
ondismissphase={handleDismissVersionBanner}
|
|
29
|
+
></doc-phase>
|
|
30
|
+
<div lwc:if={showVersionPicker} slot="sidebar-header">
|
|
31
|
+
<doc-version-picker
|
|
16
32
|
data-type="version"
|
|
17
|
-
|
|
18
|
-
analytics-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{version.releaseVersion}
|
|
25
|
-
</dx-button>
|
|
26
|
-
</dx-dropdown>
|
|
33
|
+
analytics-event="custEv_ctaLinkClick"
|
|
34
|
+
analytics-payload={ANALYTICS_PAYLOAD}
|
|
35
|
+
versions={versionOptions}
|
|
36
|
+
selected-version={version}
|
|
37
|
+
latest-version={latestVersion}
|
|
38
|
+
hide-badge={previewVersion}
|
|
39
|
+
></doc-version-picker>
|
|
27
40
|
</div>
|
|
41
|
+
<doc-breadcrumbs
|
|
42
|
+
lwc:if={showBreadcrumbs}
|
|
43
|
+
breadcrumbs={breadcrumbs}
|
|
44
|
+
pixel-per-character={breadcrumbPixelPerCharacter}
|
|
45
|
+
></doc-breadcrumbs>
|
|
28
46
|
<doc-content
|
|
29
47
|
docs-data={docContent}
|
|
30
48
|
page-reference={pageReference}
|
|
31
49
|
onnavclick={handleNavClick}
|
|
32
50
|
></doc-content>
|
|
33
51
|
</doc-content-layout>
|
|
52
|
+
<div lwc:if={display404}>
|
|
53
|
+
<dx-error
|
|
54
|
+
image="https://a.sfdcstatic.com/developer-website/images/404.svg"
|
|
55
|
+
code="404"
|
|
56
|
+
header="Beep boop. That did not compute."
|
|
57
|
+
subtitle="The document you're looking for doesn't seem to exist."
|
|
58
|
+
></dx-error>
|
|
59
|
+
</div>
|
|
34
60
|
</template>
|