@salesforcedevs/docs-components 0.54.0 → 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.
Files changed (44) hide show
  1. package/lwc.config.json +6 -2
  2. package/package.json +12 -4
  3. package/src/modules/README.md +41 -0
  4. package/src/modules/doc/amfReference/amfReference.css +5 -0
  5. package/src/modules/doc/amfReference/amfReference.html +47 -0
  6. package/src/modules/doc/amfReference/amfReference.ts +1309 -0
  7. package/src/modules/doc/amfReference/constants.ts +76 -0
  8. package/src/modules/doc/amfReference/types.ts +133 -0
  9. package/src/modules/doc/amfReference/utils.ts +669 -0
  10. package/src/modules/doc/amfTopic/amfTopic.css +1 -0
  11. package/src/modules/doc/amfTopic/amfTopic.html +3 -0
  12. package/src/modules/doc/amfTopic/amfTopic.ts +94 -0
  13. package/src/modules/doc/amfTopic/types.ts +54 -0
  14. package/src/modules/doc/amfTopic/utils.ts +130 -0
  15. package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +4 -3
  16. package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +1 -1
  17. package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +17 -1
  18. package/src/modules/doc/breadcrumbs/breadcrumbs.css +11 -3
  19. package/src/modules/doc/breadcrumbs/breadcrumbs.html +12 -2
  20. package/src/modules/doc/breadcrumbs/breadcrumbs.ts +50 -9
  21. package/src/modules/doc/content/content.css +35 -11
  22. package/src/modules/doc/content/content.ts +18 -3
  23. package/src/modules/doc/contentCallout/contentCallout.css +4 -4
  24. package/src/modules/doc/contentCallout/contentCallout.ts +5 -0
  25. package/src/modules/doc/contentLayout/contentLayout.css +98 -0
  26. package/src/modules/doc/contentLayout/contentLayout.html +48 -0
  27. package/src/modules/doc/contentLayout/contentLayout.ts +287 -0
  28. package/src/modules/doc/header/header.css +1 -1
  29. package/src/modules/doc/header/header.ts +5 -5
  30. package/src/modules/doc/headingAnchor/headingAnchor.css +1 -1
  31. package/src/modules/doc/headingContent/headingContent.css +5 -1
  32. package/src/modules/doc/phase/phase.css +3 -3
  33. package/src/modules/doc/phase/phase.ts +1 -1
  34. package/src/modules/doc/xmlContent/types.ts +114 -0
  35. package/src/modules/doc/xmlContent/utils.ts +161 -0
  36. package/src/modules/doc/xmlContent/xmlContent.css +32 -0
  37. package/src/modules/doc/xmlContent/xmlContent.html +39 -0
  38. package/src/modules/doc/xmlContent/xmlContent.ts +651 -0
  39. package/src/modules/docBaseElements/lightningElementWithState/lightningElementWithState.ts +93 -0
  40. package/src/modules/docHelpers/amfStyle/amfStyle.css +390 -0
  41. package/src/modules/docHelpers/phaseContentLayout/phaseContentLayout.css +39 -0
  42. package/src/modules/{helpers → docHelpers}/status/status.css +0 -0
  43. package/src/modules/docUtils/SearchSyncer/SearchSyncer.ts +85 -0
  44. package/LICENSE +0 -12
@@ -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
+ // TODO: Better type here
25
+ children?: ({
26
+ id: string;
27
+ label?: string;
28
+ method: string;
29
+ domId: string;
30
+ } & {
31
+ name: string;
32
+ label: string;
33
+ })[];
34
+ isExpanded?: boolean;
35
+ }
36
+
37
+ export type AmfModel = Json;
38
+
39
+ export interface AmfParser {
40
+ parse(): void;
41
+ parsedModel: any;
42
+ }
43
+
44
+ export interface AmfModelRecord {
45
+ model: AmfModel;
46
+ parser: AmfParser;
47
+ parsedModel: Json;
48
+ }
49
+
50
+ export type DocPhase = "pilot" | "dev-preview" | "beta";
51
+
52
+ export type DocPhaseEntry = {
53
+ phase: DocPhase;
54
+ title: string;
55
+ body: string;
56
+ };
57
+
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 {
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
+ }