@salesforcedevs/docs-components 0.7.0 → 0.7.59-sppage-alpha2

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 (102) hide show
  1. package/lwc.config.json +17 -3
  2. package/package.json +16 -6
  3. package/src/modules/README.md +41 -0
  4. package/src/modules/doc/amfModelParser/amfModelParser.ts +674 -0
  5. package/src/modules/doc/amfReference/amfReference.css +25 -0
  6. package/src/modules/doc/amfReference/amfReference.html +60 -0
  7. package/src/modules/doc/amfReference/amfReference.ts +1494 -0
  8. package/src/modules/doc/amfReference/constants.ts +76 -0
  9. package/src/modules/doc/amfReference/types.ts +125 -0
  10. package/src/modules/doc/amfTopic/amfTopic.css +21 -0
  11. package/src/modules/doc/amfTopic/amfTopic.html +3 -0
  12. package/src/modules/doc/amfTopic/amfTopic.ts +111 -0
  13. package/src/modules/doc/amfTopic/types.ts +56 -0
  14. package/src/modules/doc/amfTopic/utils.ts +136 -0
  15. package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +51 -0
  16. package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +5 -0
  17. package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +71 -0
  18. package/src/modules/doc/breadcrumbs/breadcrumbs.css +27 -0
  19. package/src/modules/doc/breadcrumbs/breadcrumbs.html +58 -0
  20. package/src/modules/doc/breadcrumbs/breadcrumbs.ts +192 -0
  21. package/src/modules/doc/content/content.css +94 -70
  22. package/src/modules/doc/content/content.ts +233 -169
  23. package/src/modules/doc/contentCallout/contentCallout.css +17 -23
  24. package/src/modules/doc/contentCallout/contentCallout.html +13 -4
  25. package/src/modules/doc/contentCallout/contentCallout.ts +16 -3
  26. package/src/modules/doc/contentLayout/contentLayout.css +131 -0
  27. package/src/modules/doc/contentLayout/contentLayout.html +64 -0
  28. package/src/modules/doc/contentLayout/contentLayout.ts +610 -0
  29. package/src/modules/doc/doDont/doDont.css +47 -0
  30. package/src/modules/doc/doDont/doDont.html +27 -0
  31. package/src/modules/doc/doDont/doDont.ts +17 -0
  32. package/src/modules/doc/header/header.css +70 -37
  33. package/src/modules/doc/header/header.html +40 -135
  34. package/src/modules/doc/header/header.ts +29 -78
  35. package/src/modules/doc/heading/heading.css +33 -0
  36. package/src/modules/doc/heading/heading.html +14 -0
  37. package/src/modules/doc/heading/heading.ts +67 -0
  38. package/src/modules/doc/headingAnchor/headingAnchor.css +33 -0
  39. package/src/modules/doc/headingAnchor/headingAnchor.html +19 -0
  40. package/src/modules/doc/headingAnchor/headingAnchor.ts +43 -0
  41. package/src/modules/doc/headingContent/headingContent.css +53 -0
  42. package/src/modules/doc/headingContent/headingContent.html +13 -0
  43. package/src/modules/doc/headingContent/headingContent.ts +30 -0
  44. package/src/modules/doc/overview/overview.css +40 -0
  45. package/src/modules/doc/overview/overview.html +34 -0
  46. package/src/modules/doc/overview/overview.ts +12 -0
  47. package/src/modules/doc/phase/phase.css +70 -0
  48. package/src/modules/doc/phase/phase.html +38 -0
  49. package/src/modules/doc/phase/phase.ts +93 -0
  50. package/src/modules/doc/specificationContent/specificationContent.css +3 -0
  51. package/src/modules/doc/specificationContent/specificationContent.html +99 -0
  52. package/src/modules/doc/specificationContent/specificationContent.ts +56 -0
  53. package/src/modules/doc/sprigSurvey/sprigSurvey.html +20 -0
  54. package/src/modules/doc/sprigSurvey/sprigSurvey.scoped.css +16 -0
  55. package/src/modules/doc/sprigSurvey/sprigSurvey.ts +16 -0
  56. package/src/modules/doc/toc/toc.ts +1 -1
  57. package/src/modules/doc/versionPicker/versionPicker.css +64 -0
  58. package/src/modules/doc/versionPicker/versionPicker.html +38 -0
  59. package/src/modules/doc/versionPicker/versionPicker.ts +65 -0
  60. package/src/modules/doc/xmlContent/types.ts +120 -0
  61. package/src/modules/doc/xmlContent/utils.ts +163 -0
  62. package/src/modules/doc/xmlContent/xmlContent.css +54 -0
  63. package/src/modules/doc/xmlContent/xmlContent.html +52 -0
  64. package/src/modules/doc/xmlContent/xmlContent.ts +780 -0
  65. package/src/modules/docHelpers/amfStyle/amfStyle.css +355 -0
  66. package/src/modules/docHelpers/imgStyle/imgStyle.css +59 -0
  67. package/src/modules/docHelpers/status/status.css +22 -0
  68. package/src/modules/docUtils/searchSyncer/searchSyncer.ts +86 -0
  69. package/src/modules/docUtils/utils/utils.ts +32 -0
  70. package/LICENSE +0 -12
  71. package/src/modules/doc/content/__tests__/content.test.ts +0 -120
  72. package/src/modules/doc/content/__tests__/mockDocContent.ts +0 -292
  73. package/src/modules/doc/content/__tests__/mockPageReference.ts +0 -8
  74. package/src/modules/doc/content/content.stories.ts +0 -108
  75. package/src/modules/doc/contentCallout/__tests__/contentCallout.test.ts +0 -80
  76. package/src/modules/doc/contentCallout/__tests__/mockProps.ts +0 -14
  77. package/src/modules/doc/contentCallout/contentCallout.stories.ts +0 -29
  78. package/src/modules/doc/contentMedia/__tests__/contentMedia.test.ts +0 -97
  79. package/src/modules/doc/contentMedia/contentMedia.stories.ts +0 -113
  80. package/src/modules/doc/header/__tests__/coveoConfig.ts +0 -12
  81. package/src/modules/doc/header/__tests__/header.test.ts +0 -434
  82. package/src/modules/doc/header/__tests__/mockNavDevelopers.ts +0 -427
  83. package/src/modules/doc/header/__tests__/mockNavs.ts +0 -115
  84. package/src/modules/doc/header/__tests__/mockProps.ts +0 -149
  85. package/src/modules/doc/header/header.stories.ts +0 -160
  86. package/src/modules/doc/nav/__tests__/mockAvailableLanguages.ts +0 -8
  87. package/src/modules/doc/nav/__tests__/mockAvailableVersions.ts +0 -122
  88. package/src/modules/doc/nav/__tests__/mockPageReference.ts +0 -8
  89. package/src/modules/doc/nav/__tests__/mockPdfUrl.ts +0 -1
  90. package/src/modules/doc/nav/__tests__/mockSelectedLanguage.ts +0 -8
  91. package/src/modules/doc/nav/__tests__/mockSelectedVersion.ts +0 -8
  92. package/src/modules/doc/nav/__tests__/mockToc.ts +0 -146
  93. package/src/modules/doc/nav/__tests__/nav.test.ts +0 -58
  94. package/src/modules/doc/toc/__tests__/mockPageReference.ts +0 -8
  95. package/src/modules/doc/toc/__tests__/mockToc.ts +0 -146
  96. package/src/modules/doc/toc/__tests__/toc.test.ts +0 -29
  97. package/src/modules/doc/toolbar/__tests__/mockAvailableLanguages.ts +0 -8
  98. package/src/modules/doc/toolbar/__tests__/mockAvailableVersions.ts +0 -122
  99. package/src/modules/doc/toolbar/__tests__/mockPdfUrl.ts +0 -1
  100. package/src/modules/doc/toolbar/__tests__/mockSelectedLanguage.ts +0 -8
  101. package/src/modules/doc/toolbar/__tests__/mockSelectedVersion.ts +0 -8
  102. package/src/modules/doc/toolbar/__tests__/toolbar.test.ts +0 -44
@@ -0,0 +1,355 @@
1
+ :host {
2
+ --amf-sidebar-width: 275px;
3
+
4
+ /* h5 */
5
+ --amf-h5-font-family: var(--dx-g-font-display);
6
+ --amf-h5-font-size: 32px;
7
+ --amf-h5-font-weight: var(--dx-g-font-normal);
8
+ --amf-h5-font-color: var(--dx-g-blue-vibrant-20);
9
+ --amf-h5-line-height: var(--dx-g-spacing-2xl);
10
+ --amf-h5-margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-lg) 0;
11
+ --amf-h5-padding: 0;
12
+
13
+ /* h6 */
14
+ --amf-h6-font-family: var(--dx-g-font-display);
15
+ --amf-h6-font-size: var(--dx-g-text-xl);
16
+ --amf-h6-font-weight: var(--dx-g-font-normal);
17
+ --amf-h6-font-color: var(--dx-g-blue-vibrant-20);
18
+ --amf-h6-line-height: var(--dx-g-spacing-xl);
19
+ --amf-h6-margin: 32px 0 0 0;
20
+ --amf-h6-padding: 0;
21
+
22
+ /* h7 */
23
+ --amf-h7-font-family: var(--dx-g-font-display);
24
+ --amf-h7-font-size: var(--dx-g-text-lg);
25
+ --amf-h7-font-weight: var(--dx-g-font-normal);
26
+ --amf-h7-font-color: var(--dx-g-blue-vibrant-20);
27
+ --amf-h7-line-height: 28px;
28
+ --amf-h7-margin: var(--dx-g-spacing-lg) 0 0 0;
29
+ --amf-h7-padding: 0;
30
+
31
+ /* h8 */
32
+ --amf-h8-font-family: var(--dx-g-font-display);
33
+ --amf-h8-font-size: var(--dx-g-text-base);
34
+ --amf-h8-font-weight: var(--dx-g-font-normal);
35
+ --amf-h8-font-color: var(--dx-g-blue-vibrant-20);
36
+ --amf-h8-line-height: 20px;
37
+ --amf-h8-margin: var(--dx-g-spacing-lg) 0 var(--dx-g-spacing-md) 0;
38
+ --amf-h8-padding: 0;
39
+
40
+ /* h8 mod */
41
+ --amf-h8-mod-font-family: var(--dx-g-font-sans);
42
+ --amf-h8-mod-font-size: var(--dx-g-text-base);
43
+ --amf-h8-mod-font-weight: var(--dx-g-font-bold);
44
+ --amf-h8-mod-font-color: var(--dx-g-blue-vibrant-20);
45
+ --amf-h8-mod-line-height: 20px;
46
+ --amf-h8-mod-margin: var(--dx-g-spacing-lg) 0 var(--dx-g-spacing-md) 0;
47
+ --amf-h8-mod-padding: 0;
48
+ }
49
+
50
+ api-summary,
51
+ api-endpoint-documentation,
52
+ api-method-documentation,
53
+ api-documentation-document,
54
+ api-type-documentation,
55
+ api-security-documentation {
56
+ font-family: var(--dx-g-font-sans);
57
+
58
+ /* markdown styles */
59
+ --arc-font-body1-font-family: var(--dx-g-font-sans);
60
+ --arc-font-title-font-family: var(--amf-h6-font-family);
61
+ --arc-font-title-color: var(--amf-h6-font-color);
62
+ --markdown-styles-title-border-bottom-color: var(--dx-g-gray-90);
63
+
64
+ /* h2 */
65
+ --arc-font-title-font-size: var(--dx-g-text-xl);
66
+ --arc-font-title-line-height: var(--dx-g-spacing-xl);
67
+ --markdown-styles-h2-border-bottom: 0;
68
+ --markdown-styles-h2-border-top: 1px solid var(--dx-g-gray-90);
69
+ --arc-font-h2-margin: var(--dx-g-spacing-lg)
70
+ calc(-1 * var(--dx-g-spacing-2xl)) var(--dx-g-spacing-lg)
71
+ calc(-1 * var(--dx-g-spacing-2xl));
72
+ --arc-font-h2-padding: var(--dx-g-spacing-xl) var(--dx-g-spacing-2xl) 0
73
+ var(--dx-g-spacing-2xl);
74
+
75
+ /* h3 */
76
+ --arc-font-subhead-font-size: var(--amf-h8-font-size);
77
+ --arc-font-subhead-font-weight: var(--amf-h8-font-weight);
78
+ --arc-font-h3-margin: var(--amf-h8-margin);
79
+
80
+ /* p */
81
+ --arc-font-body1-font-size: var(--dx-g-text-sm);
82
+ --arc-font-body1-line-height: var(--dx-g-spacing-mlg);
83
+
84
+ /* code */
85
+ --arc-font-code-family: var(--dx-g-font-mono);
86
+
87
+ /* a */
88
+ --link-color: var(--dx-g-blue-vibrant-50);
89
+ --link-hover-color: var(--dx-g-blue-vibrant-50);
90
+
91
+ /* HTTP methods colors */
92
+ --method-display-selected-color: #fff;
93
+ --method-display-get-color: var(--dx-g-blue-vibrant-50);
94
+ --method-display-post-color: var(--dx-g-green-vibrant-40);
95
+ --method-display-put-color: var(--dx-g-yellow-vibrant-40);
96
+ --method-display-patch-color: var(--dx-g-teal-vibrant-40);
97
+ --method-display-delete-color: var(--dx-g-red-vibrant-40);
98
+
99
+ /* --method-display-options-color: var(--anypoint-color-teal3);
100
+ --method-display-head-color: var(--anypoint-color-futureGreen3);
101
+ HTTP methods colors in method documentation panel */
102
+ --http-method-label-border-radius: 4px;
103
+ --http-method-label-get-background-color: var(--dx-g-blue-vibrant-90);
104
+ --http-method-label-get-color: var(--dx-g-blue-vibrant-50);
105
+ --http-method-label-post-background-color: var(--dx-g-green-vibrant-90);
106
+ --http-method-label-post-color: var(--dx-g-green-vibrant-40);
107
+ --http-method-label-put-background-color: var(--dx-g-yellow-vibrant-90);
108
+ --http-method-label-put-color: var(--dx-g-yellow-vibrant-40);
109
+ --http-method-label-patch-background-color: var(--dx-g-teal-vibrant-90);
110
+ --http-method-label-patch-color: var(--dx-g-teal-vibrant-40);
111
+ --http-method-label-delete-background-color: var(
112
+ --dx-g-hot-orange-vibrant-90
113
+ );
114
+ --http-method-label-delete-color: var(--dx-g-red-vibrant-40);
115
+
116
+ /* --http-method-label-options-background-color: var(--method-display-options-color);
117
+ --http-method-label-options-color: #fff;
118
+ --http-method-label-head-background-color: var(--method-display-head-color);
119
+ --http-method-label-head-color: #fff; */
120
+ --http-method-label-padding: 2px 6px;
121
+ --http-method-label-font-size: 12px;
122
+ --http-method-label-font-weigth: var(--dx-g-font-bold);
123
+ --http-method-label-margin: 0 8px 0 0;
124
+
125
+ /* arc */
126
+ --arc-font-headline-font-family: var(--amf-h6-font-family);
127
+ --arc-font-headline-color: var(--amf-h6-font-color);
128
+ --arc-font-headline-font-size: var(--amf-h6-font-size);
129
+ --arc-font-headline-font-weight: var(--dx-g-font-bold);
130
+ --arc-font-headline-letter-spacing: -0.2px;
131
+ --arc-font-headline-line-height: var(--amf-h6-line-height);
132
+
133
+ /* api */
134
+ --api-parameters-document-title-border: 0;
135
+ --api-body-document-title-border: 0;
136
+ --api-type-document-trait-font-family: var(--dx-g-font-sans);
137
+ --api-type-document-union-button-active-background-color: transparent;
138
+ --api-type-document-union-button-active-color: var(--dx-g-blue-vibrant-20);
139
+ --api-type-document-union-button-background-color: transparent;
140
+ --api-type-document-union-button-color: var(--dx-g-blue-vibrant-50);
141
+ --api-type-document-media-button-border-color: transparent;
142
+ --property-shape-document-padding: 24px 0;
143
+ --property-shape-document-title-font-family: var(--dx-g-font-mono);
144
+ --property-shape-document-object-color: var(--dx-g-blue-vibrant-90);
145
+ --property-shape-document-array-color: var(--dx-g-blue-vibrant-90);
146
+ --property-shape-document-union-color: var(--dx-g-blue-vibrant-90);
147
+
148
+ /* anypoint button */
149
+ --anypoint-button-font-size: var(--dx-g-text-sm);
150
+ --anypoint-button-color: var(--dx-g-blue-vibrant-50);
151
+ --anypoint-button-text-transform: capitalize;
152
+ --anypoint-button-background-color: transparent;
153
+ --anypoint-button-hover-background-color: transparent;
154
+ --anypoint-button-active-background-color: transparent;
155
+ --anypoint-button-emphasis-low-focus-color: var(--dx-g-blue-vibrant-20);
156
+ --anypoint-button-emphasis-low-hover-background-color: transparent;
157
+ --anypoint-button-emphasis-low-focus-background-color: transparent;
158
+ --anypoint-button-emphasis-low-active-background-color: transparent;
159
+ --anypoint-button-emphasis-medium-focus-background-color: transparent;
160
+ --anypoint-button-emphasis-medium-focus-border-color: transparent;
161
+ --anypoint-button-emphasis-medium-hover-background-color: transparent;
162
+ --anypoint-button-emphasis-medium-active-background-color: transparent;
163
+ --anypoint-button-emphasis-high-background-color: transparent;
164
+ --anypoint-button-emphasis-high-hover-background-color: transparent;
165
+ --anypoint-button-emphasis-high-focus-background-color: transparent;
166
+ --anypoint-button-emphasis-high-active-background-color: transparent;
167
+
168
+ /* api example */
169
+ --api-example-accent-color: rgb(250 250 250);
170
+ --api-example-background-color: rgb(250 250 250);
171
+ --api-example-title-background-color: transparent;
172
+
173
+ /* code snippets */
174
+ --http-code-snippet-container-background-color: rgb(250 250 250);
175
+ --http-code-snippet-container-padding: var(--dx-g-spacing-md);
176
+
177
+ /* prism */
178
+
179
+ /* --code-operator-value-background-color */
180
+ }
181
+
182
+ api-endpoint-documentation {
183
+ --api-endpoint-documentation-h2-font-family: var(--amf-h8-font-family);
184
+ --api-endpoint-documentation-h2-font-color: var(--amf-h8-font-color);
185
+ --api-endpoint-documentation-h2-font-size: var(--amf-h8-font-size);
186
+ --api-endpoint-documentation-h2-font-weight: var(--amf-h8-font-weight);
187
+ --api-endpoint-documentation-h2-line-height: var(--amf-h8-line-height);
188
+ --api-endpoint-documentation-h2-margin: var(--amf-h8-margin);
189
+
190
+ /* url */
191
+ --api-method-documentation-url-font-family: var(--amf-h5-font-family);
192
+ --api-method-documentation-url-font-size: var(--amf-h5-font-size);
193
+ --api-method-documentation-url-font-weight: var(--amf-h5-font-weight);
194
+ --api-method-documentation-url-font-color: var(--amf-h5-font-color);
195
+ --api-method-documentation-url-line-height: var(--amf-h5-line-height);
196
+ --api-method-documentation-url-margin: var(--amf-h5-margin);
197
+ --api-method-documentation-url-padding: var(--amf-h5-padding);
198
+ --api-method-documentation-url-value-margin: 0;
199
+ --api-method-documentation-url-background-color: transparent;
200
+
201
+ /* method */
202
+ --api-endpoint-documentation-method-label-font-family: var(
203
+ --dx-g-font-display
204
+ );
205
+ --api-endpoint-documentation-method-label-font-size: var(--dx-g-text-xs);
206
+ --api-endpoint-documentation-method-label-font-weight: var(
207
+ --dx-g-font-bold
208
+ );
209
+
210
+ /* description */
211
+ --api-endpoint-documentation-description-color: rgb(24 24 24);
212
+ }
213
+
214
+ api-endpoint-documentation,
215
+ api-method-documentation {
216
+ --api-endpoint-documentation-method-value-font-family: var(
217
+ --dx-g-font-display
218
+ );
219
+ --api-endpoint-documentation-method-value-font-color: var(
220
+ --dx-g-blue-vibrant-20
221
+ );
222
+ --api-endpoint-documentation-method-value-font-size: var(--dx-g-text-base);
223
+ --api-endpoint-documentation-method-value-font-weight: var(
224
+ --dx-g-font-bold
225
+ );
226
+ --api-endpoint-documentation-method-value-line-height: 20px;
227
+ --api-method-documentation-summary-p-margin-bottom: var(--dx-g-spacing-md);
228
+ }
229
+
230
+ api-method-documentation {
231
+ --api-method-documentation-h2-font-family: var(--amf-h6-font-family);
232
+ --api-method-documentation-h2-font-size: var(--amf-h6-font-size);
233
+ --api-method-documentation-h2-font-weight: var(--amf-h6-font-weight);
234
+ --api-method-documentation-h2-line-height: var(--amf-h6-line-height);
235
+ --api-method-documentation-h2-font-color: var(--amf-h6-font-color);
236
+
237
+ /* method h3 */
238
+ --api-method-documentation-h3-font-family: var(--amf-h7-font-family);
239
+ --api-method-documentation-h3-font-size: var(--amf-h7-font-size);
240
+ --api-method-documentation-h3-font-weight: var(--amf-h7-font-weight);
241
+ --api-method-documentation-h3-line-height: var(--amf-h7-line-height);
242
+ --api-method-documentation-h3-font-color: var(--amf-h7-font-color);
243
+ --api-method-documentation-title-text-transform: none;
244
+
245
+ /* body h3 */
246
+ --api-body-document-h3-font-family: var(--amf-h7-font-family);
247
+ --api-body-document-h3-font-size: var(--amf-h7-font-size);
248
+ --api-body-document-h3-font-weight: var(--amf-h7-font-weight);
249
+ --api-body-document-h3-line-height: var(--amf-h7-line-height);
250
+ --api-body-document-h3-font-color: var(--amf-h7-font-color);
251
+
252
+ /* params h3 */
253
+ --api-parameters-document-h3-font-family: var(--amf-h7-font-family);
254
+ --api-parameters-document-h3-font-size: var(--amf-h7-font-size);
255
+ --api-parameters-document-h3-font-weight: var(--amf-h7-font-weight);
256
+ --api-parameters-document-h3-line-height: var(--amf-h7-line-height);
257
+ --api-parameters-document-h3-font-color: var(--amf-h7-font-color);
258
+
259
+ /* anypoint button */
260
+ --anypoint-button-font-family: var(--dx-g-font-display);
261
+ --anypoint-button-font-size: var(--dx-g-text-base);
262
+ --anypoint-button-background-color: transparent;
263
+ --anypoint-button-color: var(--dx-g-blue-vibrant-50);
264
+ --anypoint-button-text-transform: uppercase;
265
+
266
+ /* method documentation */
267
+ --api-method-documentation-http-method-label-font-size: var(--dx-g-text-xs);
268
+ --api-method-documentation-http-method-label-font-family: var(
269
+ --dx-g-font-display
270
+ );
271
+ --api-method-documentation-http-method-label-font-weight: var(
272
+ --dx-g-font-bold
273
+ );
274
+ --api-method-documentation-description-color: rgb(24 24 24);
275
+ --api-method-documentation-operation-id-color: var(--dx-g-gray-50);
276
+
277
+ /* body */
278
+ --api-body-document-description-color: rgb(24 24 24);
279
+ --api-body-document-media-type-selector-color: var(--dx-g-blue-vibrant-20);
280
+ --api-body-document-media-type-selector-font-size: var(
281
+ --amf-h8-mod-font-size
282
+ );
283
+ --api-body-document-media-type-selector-font-weight: var(
284
+ --amf-h8-mod-font-weight
285
+ );
286
+ --api-body-document-toggle-view-color: var(--dx-g-blue-vibrant-50);
287
+ --api-body-document-toggle-view-font-size: var(--amf-h8-mod-font-size);
288
+ --api-body-document-toggle-view-font-weight: var(--amf-h8-mod-font-weight);
289
+ --api-body-document-media-button-color: var(--dx-g-blue-vibrant-20);
290
+ --api-body-document-media-button-background-color: transparent;
291
+ --api-body-document-media-button-text-decoration: underline 2px;
292
+ --api-body-document-media-button-text-underline-offset: 4px;
293
+
294
+ /* resource */
295
+ --api-resource-example-document-button-color: var(--dx-g-blue-vibrant-50);
296
+ --api-resource-example-document-button-font-size: var(--dx-g-text-sm);
297
+ --api-resource-example-document-button-font-weight: var(--dx-g-font-normal);
298
+ --api-resource-example-document-button-active-outline: none;
299
+ --api-resource-example-document-button-active-text-decoration: underline 1px;
300
+ --api-resource-example-document-button-active-text-underline-offset: 3px;
301
+ --api-resource-example-document-button-active-background-color: transparent;
302
+ --api-resource-example-document-button-active-color: var(
303
+ --dx-g-blue-vibrant-20
304
+ );
305
+ }
306
+
307
+ api-summary::part(api-title) {
308
+ font-family: var(--dx-g-font-display);
309
+ font-size: var(--dx-g-text-3xl);
310
+ color: var(--dx-g-blue-vibrant-20);
311
+ line-height: var(--dx-g-text-4xl);
312
+ letter-spacing: -0.85px;
313
+ margin: var(--dx-g-spacing-sm) 0;
314
+ }
315
+
316
+ api-summary::part(api-title-label) {
317
+ display: none;
318
+ }
319
+
320
+ api-summary::part(api-version) {
321
+ font-family: var(--dx-g-font-display);
322
+ font-size: var(--dx-g-text-sm);
323
+ color: var(--dx-g-blue-vibrant-50);
324
+ }
325
+
326
+ api-summary::part(marked-description) {
327
+ margin: var(--dx-g-spacing-sm) 0;
328
+ }
329
+
330
+ api-summary::part(info-section) {
331
+ margin: 0;
332
+ }
333
+
334
+ api-summary::part(license-section) {
335
+ margin: 0;
336
+ }
337
+
338
+ api-summary::part(info-inline-desc) {
339
+ margin-bottom: var(--dx-g-spacing-md);
340
+ }
341
+
342
+ api-type-documentation::part(type-title) {
343
+ margin-top: var(--dx-g-spacing-lg);
344
+ margin-bottom: var(--dx-g-spacing-md);
345
+ }
346
+
347
+ api-security-documentation::part(security-title) {
348
+ font-family: var(--amf-h6-font-family);
349
+ font-size: var(--amf-h6-font-size);
350
+ font-weight: var(--amf-h6-font-weight);
351
+ color: var(--amf-h6-font-color);
352
+ line-height: var(--amf-h6-line-height);
353
+ margin: var(--amf-h6-margin);
354
+ padding: var(--amf-h6-padding);
355
+ }
@@ -0,0 +1,59 @@
1
+ img.content-image {
2
+ height: auto;
3
+ display: unset;
4
+ }
5
+
6
+ .image-framed {
7
+ border: 1px solid black;
8
+ }
9
+
10
+ .image-xxl,
11
+ .image-full {
12
+ max-width: 1000px;
13
+ width: 100%;
14
+ }
15
+
16
+ .image-xl {
17
+ max-width: 750px;
18
+ width: 100%;
19
+ }
20
+
21
+ .image-lg {
22
+ max-width: 660px;
23
+ width: 100%;
24
+ }
25
+
26
+ .image-md {
27
+ max-width: 500px;
28
+ width: 100%;
29
+ }
30
+
31
+ .image-sm {
32
+ max-width: 330px;
33
+ width: 100%;
34
+ }
35
+
36
+ .image-xs {
37
+ max-width: 250px;
38
+ width: 100%;
39
+ }
40
+
41
+ .image-xxs {
42
+ max-width: 125px;
43
+ width: 100%;
44
+ }
45
+
46
+ .image-icon-lg {
47
+ max-width: 32px;
48
+ width: 100%;
49
+ }
50
+
51
+ .image-icon-md {
52
+ max-width: 20px;
53
+ width: 100%;
54
+ }
55
+
56
+ .image-icon-sm {
57
+ max-width: 16px;
58
+ width: 100%;
59
+ }
@@ -0,0 +1,22 @@
1
+ :host {
2
+ --dx-status-icon-color: var(--dx-g-gray-10);
3
+ --doc-status-vertical-padding: var(--dx-g-spacing-md);
4
+ }
5
+
6
+ .doc-status-base {
7
+ border-left: 4px solid;
8
+ padding: var(--doc-status-vertical-padding);
9
+ }
10
+
11
+ .doc-status-container {
12
+ background-color: rgb(253 252 247);
13
+ border-color: var(--dx-g-yellow-vibrant-80);
14
+ }
15
+
16
+ .doc-status-title {
17
+ font-weight: var(--dx-g-font-bold);
18
+ }
19
+
20
+ .doc-status-icon {
21
+ margin-right: var(--dx-g-spacing-md);
22
+ }
@@ -0,0 +1,86 @@
1
+ export interface SearchSyncerConstructorArgs {
2
+ callbacks: {
3
+ onSearchChange?: (nextSearchString: string) => unknown;
4
+ onUrlChange?: (nextSearchString: string) => unknown;
5
+ };
6
+ eventName: string;
7
+ historyMethod?:
8
+ | typeof window.history.pushState
9
+ | typeof window.history.replaceState;
10
+ searchParam: string;
11
+ shouldStopPropagation?: boolean;
12
+ target: EventTarget;
13
+ }
14
+
15
+ export class SearchSyncer {
16
+ private callbacks: SearchSyncerConstructorArgs["callbacks"];
17
+ private eventName: SearchSyncerConstructorArgs["eventName"];
18
+ private historyMethod: SearchSyncerConstructorArgs["historyMethod"];
19
+ private searchParam: SearchSyncerConstructorArgs["searchParam"];
20
+ private shouldStopPropagation: SearchSyncerConstructorArgs["shouldStopPropagation"];
21
+ private target: SearchSyncerConstructorArgs["target"];
22
+
23
+ constructor({
24
+ callbacks = {},
25
+ eventName,
26
+ historyMethod = window.history.pushState,
27
+ searchParam,
28
+ shouldStopPropagation = true,
29
+ target
30
+ }: SearchSyncerConstructorArgs) {
31
+ this.callbacks = callbacks;
32
+ this.eventName = eventName;
33
+ this.historyMethod = historyMethod.bind(window.history);
34
+ this.searchParam = searchParam;
35
+ this.shouldStopPropagation = shouldStopPropagation;
36
+ this.target = target;
37
+ }
38
+
39
+ public init = (): void => {
40
+ this.target.addEventListener(this.eventName, this.handleSearchChange);
41
+ this.target.addEventListener("popstate", this.handlePopState);
42
+ };
43
+
44
+ public dispose = (): void => {
45
+ this.target.removeEventListener(
46
+ this.eventName,
47
+ this.handleSearchChange
48
+ );
49
+ this.target.removeEventListener("popstate", this.handlePopState);
50
+ // @ts-ignore
51
+ this.target = undefined;
52
+ this.callbacks.onSearchChange = undefined;
53
+ this.callbacks.onUrlChange = undefined;
54
+ };
55
+
56
+ private handleSearchChange = (event: Event): void => {
57
+ if (this.shouldStopPropagation) {
58
+ event.stopPropagation();
59
+ }
60
+
61
+ const { detail: searchTerm } = event as CustomEvent<string>;
62
+ const fullUrl = new URL(window.location.href);
63
+ const { searchParams } = fullUrl;
64
+
65
+ if (searchTerm) {
66
+ searchParams.set(this.searchParam, searchTerm);
67
+ } else {
68
+ searchParams.delete(this.searchParam);
69
+ }
70
+
71
+ const nextSearchString = searchParams.toString();
72
+
73
+ if (this.callbacks.onSearchChange) {
74
+ this.callbacks.onSearchChange(nextSearchString);
75
+ }
76
+
77
+ fullUrl.search = nextSearchString;
78
+ this.historyMethod({}, "", fullUrl.toString());
79
+ };
80
+
81
+ private handlePopState = (): void => {
82
+ if (this.callbacks.onUrlChange) {
83
+ this.callbacks.onUrlChange(window.location.search);
84
+ }
85
+ };
86
+ }
@@ -0,0 +1,32 @@
1
+ import { CoveoAnalyticsClient } from "coveo.analytics";
2
+
3
+ export const oldVersionDocInfo = (latestVersionLink: string) => {
4
+ return {
5
+ title: "Newer Version Available",
6
+ body: `This content describes an older version of this product.
7
+ <a style="font-weight: bold;" href="${latestVersionLink}">View Latest</a>`
8
+ };
9
+ };
10
+
11
+ export function logCoveoPageView(
12
+ coveoOrganizationId: string | undefined,
13
+ coveoAnalyticsToken: string | undefined
14
+ ) {
15
+ if (coveoOrganizationId && coveoAnalyticsToken) {
16
+ const ua = new CoveoAnalyticsClient({
17
+ token: coveoAnalyticsToken,
18
+ endpoint: `https://${coveoOrganizationId}.analytics.org.coveo.com`
19
+ });
20
+ const pathParts = window.location.pathname.split("/");
21
+ let contentType;
22
+ if (pathParts.length >= 2) {
23
+ contentType = pathParts[1];
24
+ }
25
+
26
+ ua.sendViewEvent({
27
+ contentIdKey: "@clickableuri",
28
+ contentType: contentType,
29
+ contentIdValue: window.location.href
30
+ });
31
+ }
32
+ }
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.
@@ -1,120 +0,0 @@
1
- import { createRenderComponent } from "utils/tests";
2
- import Content from "../content";
3
- import * as mockContent from "./mockDocContent";
4
- import mockPageReference from "./mockPageReference";
5
-
6
- const TAG = "doc-content";
7
- const render = createRenderComponent(TAG, Content);
8
-
9
- describe("doc-content", () => {
10
- it("renders the content", () => {
11
- const component = render({
12
- docsData: mockContent.content,
13
- pageReference: mockPageReference,
14
- _isStorybook: false
15
- });
16
- const contentEl = component.shadowRoot.querySelector(
17
- '[data-name="content"]'
18
- );
19
- expect(contentEl).not.toBeNull();
20
- });
21
-
22
- it("renders both with and wothout pagination buttons", () => {
23
- const c_buttons = render({
24
- docsData: mockContent.withButtons,
25
- pageReference: mockPageReference,
26
- showPaginationButtons: true,
27
- _isStorybook: false
28
- });
29
- const dx_buttons = c_buttons.shadowRoot.querySelectorAll("dx-button");
30
- expect(dx_buttons.length).toEqual(2);
31
-
32
- const c_no_buttons = render({
33
- docsData: mockContent.withButtons,
34
- pageReference: mockPageReference,
35
- _isStorybook: false
36
- });
37
- const empty_dx_buttons = c_no_buttons.shadowRoot.querySelectorAll(
38
- "dx-button"
39
- );
40
- expect(empty_dx_buttons.length).toEqual(0);
41
- });
42
-
43
- it("swaps out images", () => {
44
- const component = render({
45
- docsData: mockContent.withImages,
46
- pageReference: mockPageReference,
47
- _isStorybook: false
48
- });
49
- const contentEl = component.shadowRoot.querySelector(
50
- '[data-name="content"]'
51
- );
52
- expect(contentEl).not.toBeNull();
53
- const images = component.shadowRoot.querySelectorAll("img");
54
- expect(images.length).toEqual(3);
55
- const contentMediaEls = component.shadowRoot.querySelectorAll(
56
- "doc-content-media"
57
- );
58
- expect(contentMediaEls.length).toEqual(0);
59
- });
60
-
61
- it("swaps out iframes", () => {
62
- const component = render({
63
- docsData: mockContent.withVideos,
64
- pageReference: mockPageReference,
65
- _isStorybook: false
66
- });
67
- const contentEl = component.shadowRoot.querySelector(
68
- '[data-name="content"]'
69
- );
70
- expect(contentEl).not.toBeNull();
71
- const images = component.shadowRoot.querySelectorAll("iframe");
72
- expect(images.length).toEqual(0);
73
- const contentMediaEls = component.shadowRoot.querySelectorAll(
74
- "doc-content-media"
75
- );
76
- expect(contentMediaEls.length).toEqual(2);
77
- contentMediaEls.forEach((contentMedia) => {
78
- expect(contentMedia.contentType).toEqual("iframe");
79
- expect(contentMedia.mediaTitle).not.toBeUndefined();
80
- expect(contentMedia.contentSrc).toMatch(
81
- "https://play.vidyard.com/"
82
- );
83
- });
84
- });
85
-
86
- it("swaps out notes", () => {
87
- const component = render({
88
- docsData: mockContent.withNotes,
89
- pageReference: mockPageReference,
90
- _isStorybook: false
91
- });
92
- const contentEl = component.shadowRoot.querySelector(
93
- '[data-name="content"]'
94
- );
95
- expect(contentEl).not.toBeNull();
96
- const notes = component.shadowRoot.querySelectorAll(".message");
97
- expect(notes).toHaveLength(4);
98
- notes.forEach((note) => {
99
- const noteHeader = note.querySelector("doc-content-callout");
100
- expect(noteHeader).not.toBeNull();
101
- });
102
- });
103
-
104
- it("includes tables, lists, and code blocks in notes", () => {
105
- const component = render({
106
- docsData: mockContent.withNotes,
107
- pageReference: mockPageReference,
108
- _isStorybook: false
109
- });
110
- const contentEl = component.shadowRoot.querySelector(
111
- '[data-name="content"]'
112
- );
113
- expect(contentEl).not.toBeNull();
114
- const notes = component.shadowRoot.querySelectorAll(".message");
115
- expect(notes[0].querySelector("table")).not.toBeNull();
116
- expect(notes[1].querySelector("ul")).not.toBeNull();
117
- expect(notes[2].querySelector("ol")).not.toBeNull();
118
- expect(notes[3].querySelector("dx-code-block")).not.toBeNull();
119
- });
120
- });