@salesforcedevs/docs-components 0.3.11 → 0.3.14-banner-alpha1
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 +12 -3
- package/package.json +17 -7
- package/src/modules/README.md +41 -0
- package/src/modules/doc/amfReference/amfReference.css +5 -0
- package/src/modules/doc/amfReference/amfReference.html +47 -0
- package/src/modules/doc/amfReference/amfReference.ts +1361 -0
- package/src/modules/doc/amfReference/constants.ts +76 -0
- package/src/modules/doc/amfReference/types.ts +133 -0
- package/src/modules/doc/amfReference/utils.ts +669 -0
- package/src/modules/doc/amfTopic/amfTopic.css +1 -0
- package/src/modules/doc/amfTopic/amfTopic.html +3 -0
- package/src/modules/doc/amfTopic/amfTopic.ts +94 -0
- package/src/modules/doc/amfTopic/types.ts +54 -0
- package/src/modules/doc/amfTopic/utils.ts +130 -0
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +51 -0
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +5 -0
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +64 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.css +27 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.html +60 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.ts +187 -0
- package/src/modules/doc/content/content.css +58 -102
- package/src/modules/doc/content/content.ts +261 -174
- package/src/modules/doc/contentCallout/contentCallout.css +7 -24
- package/src/modules/doc/contentCallout/contentCallout.html +4 -2
- package/src/modules/doc/contentCallout/contentCallout.ts +8 -2
- package/src/modules/doc/contentLayout/contentLayout.css +98 -0
- package/src/modules/doc/contentLayout/contentLayout.html +51 -0
- package/src/modules/doc/contentLayout/contentLayout.ts +322 -0
- package/src/modules/doc/header/header.css +103 -0
- package/src/modules/doc/header/header.html +160 -0
- package/src/modules/doc/header/header.ts +146 -0
- package/src/modules/doc/heading/heading.css +54 -0
- package/src/modules/doc/heading/heading.html +14 -0
- package/src/modules/doc/heading/heading.ts +65 -0
- package/src/modules/doc/headingAnchor/headingAnchor.css +33 -0
- package/src/modules/doc/headingAnchor/headingAnchor.html +19 -0
- package/src/modules/doc/headingAnchor/headingAnchor.ts +43 -0
- package/src/modules/doc/headingContent/headingContent.css +53 -0
- package/src/modules/doc/headingContent/headingContent.html +13 -0
- package/src/modules/doc/headingContent/headingContent.ts +30 -0
- package/src/modules/doc/phase/phase.css +55 -0
- package/src/modules/doc/phase/phase.html +28 -0
- package/src/modules/doc/phase/phase.ts +57 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.html +20 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.scoped.css +12 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.ts +16 -0
- package/src/modules/doc/toc/toc.html +3 -1
- package/src/modules/doc/toolbar/toolbar.ts +6 -6
- package/src/modules/doc/xmlContent/types.ts +114 -0
- package/src/modules/doc/xmlContent/utils.ts +161 -0
- package/src/modules/doc/xmlContent/xmlContent.css +32 -0
- package/src/modules/doc/xmlContent/xmlContent.html +40 -0
- package/src/modules/doc/xmlContent/xmlContent.ts +677 -0
- package/src/modules/docBaseElements/lightningElementWithState/lightningElementWithState.ts +93 -0
- package/src/modules/docHelpers/amfStyle/amfStyle.css +355 -0
- package/src/modules/docHelpers/phaseContentLayout/phaseContentLayout.css +39 -0
- package/src/modules/docHelpers/status/status.css +22 -0
- package/src/modules/docUtils/SearchSyncer/SearchSyncer.ts +85 -0
- package/LICENSE +0 -12
- package/src/modules/doc/container/__benchmarks__/container.benchmark.js +0 -43
- package/src/modules/doc/container/__mocks__/mockAvailableLanguages.js +0 -8
- package/src/modules/doc/container/__mocks__/mockAvailableVersions.js +0 -122
- package/src/modules/doc/container/__mocks__/mockContentFetchResponse.json +0 -5
- package/src/modules/doc/container/__mocks__/mockDocContent.js +0 -29
- package/src/modules/doc/container/__mocks__/mockNavigationFetchResponse.json +0 -4061
- package/src/modules/doc/container/__mocks__/mockPageReference.js +0 -8
- package/src/modules/doc/container/__mocks__/mockPdfUrl.js +0 -1
- package/src/modules/doc/container/__mocks__/mockSelectedLanguage.js +0 -8
- package/src/modules/doc/container/__mocks__/mockSelectedVersion.js +0 -8
- package/src/modules/doc/container/__mocks__/mockToc.js +0 -146
- package/src/modules/doc/container/__tests__/container.test.ts +0 -117
- package/src/modules/doc/container/container.css +0 -37
- package/src/modules/doc/container/container.html +0 -28
- package/src/modules/doc/container/container.stories.ts +0 -44
- package/src/modules/doc/container/container.ts +0 -367
- package/src/modules/doc/content/__tests__/content.test.ts +0 -99
- package/src/modules/doc/content/__tests__/mockDocContent.ts +0 -258
- package/src/modules/doc/content/__tests__/mockPageReference.ts +0 -8
- package/src/modules/doc/content/content.stories.ts +0 -82
- package/src/modules/doc/contentCallout/__tests__/contentCallout.test.ts +0 -80
- package/src/modules/doc/contentCallout/__tests__/mockProps.ts +0 -14
- package/src/modules/doc/contentCallout/contentCallout.stories.ts +0 -29
- package/src/modules/doc/contentMedia/__tests__/contentMedia.test.ts +0 -97
- package/src/modules/doc/contentMedia/contentMedia.stories.ts +0 -113
- package/src/modules/doc/landing/__tests__/landing.test.ts +0 -60
- package/src/modules/doc/landing/__tests__/mockFetch.json +0 -370
- package/src/modules/doc/landing/landing.css +0 -63
- package/src/modules/doc/landing/landing.html +0 -122
- package/src/modules/doc/landing/landing.stories.ts +0 -21
- package/src/modules/doc/landing/landing.ts +0 -222
- package/src/modules/doc/nav/__tests__/mockAvailableLanguages.ts +0 -8
- package/src/modules/doc/nav/__tests__/mockAvailableVersions.ts +0 -122
- package/src/modules/doc/nav/__tests__/mockPageReference.ts +0 -8
- package/src/modules/doc/nav/__tests__/mockPdfUrl.ts +0 -1
- package/src/modules/doc/nav/__tests__/mockSelectedLanguage.ts +0 -8
- package/src/modules/doc/nav/__tests__/mockSelectedVersion.ts +0 -8
- package/src/modules/doc/nav/__tests__/mockToc.ts +0 -146
- package/src/modules/doc/nav/__tests__/nav.test.ts +0 -58
- package/src/modules/doc/toc/__tests__/mockPageReference.ts +0 -8
- package/src/modules/doc/toc/__tests__/mockToc.ts +0 -146
- package/src/modules/doc/toc/__tests__/toc.test.ts +0 -29
- package/src/modules/doc/toolbar/__tests__/mockAvailableLanguages.ts +0 -8
- package/src/modules/doc/toolbar/__tests__/mockAvailableVersions.ts +0 -122
- package/src/modules/doc/toolbar/__tests__/mockPdfUrl.ts +0 -1
- package/src/modules/doc/toolbar/__tests__/mockSelectedLanguage.ts +0 -8
- package/src/modules/doc/toolbar/__tests__/mockSelectedVersion.ts +0 -8
- package/src/modules/doc/toolbar/__tests__/toolbar.test.ts +0 -44
|
@@ -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 };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Json } from "typings/custom";
|
|
2
|
+
|
|
3
|
+
export interface AmfTopicType {
|
|
4
|
+
referenceId: string;
|
|
5
|
+
parentReferencePath: string;
|
|
6
|
+
amfId: string;
|
|
7
|
+
elementId: string;
|
|
8
|
+
type: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface AmfMetadataTopic extends AmfTopicType {
|
|
12
|
+
meta: string;
|
|
13
|
+
identifier: string;
|
|
14
|
+
navTitle?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface AmfMetaTopicType extends AmfTopicType {
|
|
18
|
+
meta: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface NavItem {
|
|
22
|
+
name: string;
|
|
23
|
+
label: string;
|
|
24
|
+
children?: ({
|
|
25
|
+
id: string;
|
|
26
|
+
label?: string;
|
|
27
|
+
method: string;
|
|
28
|
+
domId: string;
|
|
29
|
+
} & {
|
|
30
|
+
name: string;
|
|
31
|
+
label: string;
|
|
32
|
+
})[];
|
|
33
|
+
isExpanded?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type AmfModel = Json;
|
|
37
|
+
|
|
38
|
+
export interface AmfParser {
|
|
39
|
+
parse(): void;
|
|
40
|
+
parsedModel: any;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface AmfModelRecord {
|
|
44
|
+
model: AmfModel;
|
|
45
|
+
parser: AmfParser;
|
|
46
|
+
parsedModel: Json;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type DocPhase = "pilot" | "dev-preview" | "beta";
|
|
50
|
+
|
|
51
|
+
export type DocPhaseEntry = {
|
|
52
|
+
phase: DocPhase;
|
|
53
|
+
title: string;
|
|
54
|
+
body: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type ReferenceType = "markdown" | "rest-raml" | "rest-oa2" | "rest-oa3";
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Represents parsed topic for the sidebar.
|
|
61
|
+
*/
|
|
62
|
+
export interface ParsedMarkdownTopic {
|
|
63
|
+
label: string;
|
|
64
|
+
name: string;
|
|
65
|
+
children: ParsedMarkdownTopic[];
|
|
66
|
+
link?: {
|
|
67
|
+
href: string;
|
|
68
|
+
target?: string;
|
|
69
|
+
};
|
|
70
|
+
isExpanded?: boolean;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface AmfConfig {
|
|
74
|
+
id: string;
|
|
75
|
+
version?: string;
|
|
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;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface ParsedTopicModel {
|
|
92
|
+
id: string;
|
|
93
|
+
label: string;
|
|
94
|
+
domId: string;
|
|
95
|
+
indent?: number;
|
|
96
|
+
methods?: {
|
|
97
|
+
id: string;
|
|
98
|
+
label?: string;
|
|
99
|
+
method: string;
|
|
100
|
+
domId: string;
|
|
101
|
+
}[];
|
|
102
|
+
}
|
|
103
|
+
export interface TopicModel {
|
|
104
|
+
id: string;
|
|
105
|
+
type: string;
|
|
106
|
+
amf: AmfModel;
|
|
107
|
+
parser: AmfParser;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface ReferenceVersion {
|
|
111
|
+
id: string;
|
|
112
|
+
label: string;
|
|
113
|
+
deprecated?: boolean;
|
|
114
|
+
selected?: boolean;
|
|
115
|
+
link: {
|
|
116
|
+
href: string;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface ReferenceSetConfig {
|
|
121
|
+
refId?: string;
|
|
122
|
+
versionToRefMap?: Map<string, Array<AmfConfig>>;
|
|
123
|
+
refList: Array<AmfConfig>;
|
|
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;
|
|
133
|
+
}
|