@salesforcedevs/docs-components 0.0.0

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 (67) hide show
  1. package/LICENSE +12 -0
  2. package/lwc.config.json +20 -0
  3. package/package.json +28 -0
  4. package/src/modules/README.md +41 -0
  5. package/src/modules/doc/amfReference/amfReference.css +5 -0
  6. package/src/modules/doc/amfReference/amfReference.html +47 -0
  7. package/src/modules/doc/amfReference/amfReference.ts +1361 -0
  8. package/src/modules/doc/amfReference/constants.ts +76 -0
  9. package/src/modules/doc/amfReference/types.ts +133 -0
  10. package/src/modules/doc/amfReference/utils.ts +669 -0
  11. package/src/modules/doc/amfTopic/amfTopic.css +1 -0
  12. package/src/modules/doc/amfTopic/amfTopic.html +3 -0
  13. package/src/modules/doc/amfTopic/amfTopic.ts +94 -0
  14. package/src/modules/doc/amfTopic/types.ts +54 -0
  15. package/src/modules/doc/amfTopic/utils.ts +130 -0
  16. package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +51 -0
  17. package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +5 -0
  18. package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +64 -0
  19. package/src/modules/doc/breadcrumbs/breadcrumbs.css +27 -0
  20. package/src/modules/doc/breadcrumbs/breadcrumbs.html +60 -0
  21. package/src/modules/doc/breadcrumbs/breadcrumbs.ts +187 -0
  22. package/src/modules/doc/content/content.css +399 -0
  23. package/src/modules/doc/content/content.html +6 -0
  24. package/src/modules/doc/content/content.ts +378 -0
  25. package/src/modules/doc/contentCallout/contentCallout.css +56 -0
  26. package/src/modules/doc/contentCallout/contentCallout.html +15 -0
  27. package/src/modules/doc/contentCallout/contentCallout.ts +58 -0
  28. package/src/modules/doc/contentLayout/contentLayout.css +98 -0
  29. package/src/modules/doc/contentLayout/contentLayout.html +50 -0
  30. package/src/modules/doc/contentLayout/contentLayout.ts +322 -0
  31. package/src/modules/doc/contentMedia/contentMedia.css +49 -0
  32. package/src/modules/doc/contentMedia/contentMedia.html +23 -0
  33. package/src/modules/doc/contentMedia/contentMedia.ts +34 -0
  34. package/src/modules/doc/header/header.css +103 -0
  35. package/src/modules/doc/header/header.html +153 -0
  36. package/src/modules/doc/header/header.ts +142 -0
  37. package/src/modules/doc/heading/heading.css +54 -0
  38. package/src/modules/doc/heading/heading.html +14 -0
  39. package/src/modules/doc/heading/heading.ts +65 -0
  40. package/src/modules/doc/headingAnchor/headingAnchor.css +33 -0
  41. package/src/modules/doc/headingAnchor/headingAnchor.html +19 -0
  42. package/src/modules/doc/headingAnchor/headingAnchor.ts +43 -0
  43. package/src/modules/doc/headingContent/headingContent.css +53 -0
  44. package/src/modules/doc/headingContent/headingContent.html +13 -0
  45. package/src/modules/doc/headingContent/headingContent.ts +30 -0
  46. package/src/modules/doc/nav/nav.css +14 -0
  47. package/src/modules/doc/nav/nav.html +12 -0
  48. package/src/modules/doc/nav/nav.ts +39 -0
  49. package/src/modules/doc/phase/phase.css +55 -0
  50. package/src/modules/doc/phase/phase.html +28 -0
  51. package/src/modules/doc/phase/phase.ts +57 -0
  52. package/src/modules/doc/toc/toc.css +31 -0
  53. package/src/modules/doc/toc/toc.html +127 -0
  54. package/src/modules/doc/toc/toc.ts +27 -0
  55. package/src/modules/doc/toolbar/toolbar.css +8 -0
  56. package/src/modules/doc/toolbar/toolbar.html +34 -0
  57. package/src/modules/doc/toolbar/toolbar.ts +79 -0
  58. package/src/modules/doc/xmlContent/types.ts +114 -0
  59. package/src/modules/doc/xmlContent/utils.ts +161 -0
  60. package/src/modules/doc/xmlContent/xmlContent.css +32 -0
  61. package/src/modules/doc/xmlContent/xmlContent.html +40 -0
  62. package/src/modules/doc/xmlContent/xmlContent.ts +659 -0
  63. package/src/modules/docBaseElements/lightningElementWithState/lightningElementWithState.ts +93 -0
  64. package/src/modules/docHelpers/amfStyle/amfStyle.css +355 -0
  65. package/src/modules/docHelpers/phaseContentLayout/phaseContentLayout.css +39 -0
  66. package/src/modules/docHelpers/status/status.css +22 -0
  67. package/src/modules/docUtils/SearchSyncer/SearchSyncer.ts +85 -0
@@ -0,0 +1,93 @@
1
+ import { LightningElement, track } from "lwc";
2
+
3
+ /**
4
+ * This is a helper class for when you want your LWC component to have state
5
+ * that is automatically tracked _along with_ its previous state, in a React-
6
+ * like fashion, so that you can compare current state with previous state
7
+ * after a render (like React's `commponentDidUpdate`). One benefit of doing
8
+ * things this way is that you can put all of your reactions to state changes
9
+ * in one place, in `renderedCallback`, rather than having them in various
10
+ * places throughout the component.
11
+ *
12
+ * The API consists in `this.prevState`, `this.state`, and `this.setState`.
13
+ *
14
+ * Usage:
15
+ *
16
+ * ```
17
+ * type MyState = {
18
+ * isFetchingContent: boolean;
19
+ * };
20
+ *
21
+ * class MyFetchingComponent extends LightningElementWithState<MyState> {
22
+ * constructor() {
23
+ * // `this.state` can only be initialized once
24
+ * this.state = {
25
+ * isFetchingContent: false
26
+ * };
27
+ * }
28
+ *
29
+ * // Queued for execution whenever a `setState` call completes
30
+ * renderedCallback() {
31
+ * if (this.prevState.isFetchingContent && !this.state.isFetchingContent) {
32
+ * // Do something knowing that we just finished fetching.
33
+ * notifyFetchSuccessful();
34
+ * }
35
+ * }
36
+ *
37
+ * fetchSomething() {
38
+ * this.setState({
39
+ * isFetchingContent: true
40
+ * });
41
+ *
42
+ * fetch(whatever).then(() => {
43
+ * this.setState({
44
+ * isFetching: false
45
+ * }
46
+ * });
47
+ * }
48
+ * }
49
+ * ```
50
+ */
51
+ export abstract class LightningElementWithState<
52
+ T extends { [key: string]: unknown }
53
+ > extends LightningElement {
54
+ private _prevState = {} as T;
55
+ @track private _state = {} as T;
56
+
57
+ private _didInitializeState = false;
58
+
59
+ protected get prevState(): T {
60
+ return Object.freeze({
61
+ ...this._prevState
62
+ });
63
+ }
64
+
65
+ protected get state(): T {
66
+ return Object.freeze({
67
+ ...this._state
68
+ });
69
+ }
70
+
71
+ protected set state(initialState: T) {
72
+ if (!this._didInitializeState) {
73
+ this._state = {
74
+ ...initialState
75
+ };
76
+ this._didInitializeState = true;
77
+ } else {
78
+ throw new Error(
79
+ "To mutate state after initialization, use `this.setState`."
80
+ );
81
+ }
82
+ }
83
+
84
+ protected setState = (state: Partial<T>): void => {
85
+ this._prevState = {
86
+ ...this._state
87
+ };
88
+ this._state = {
89
+ ...this._state,
90
+ ...state
91
+ };
92
+ };
93
+ }
@@ -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,39 @@
1
+ doc-phase::part(container) {
2
+ margin-bottom: var(--dx-g-spacing-sm);
3
+ padding-left: var(--dx-g-spacing-mlg);
4
+ padding-right: var(--dx-g-spacing-lg);
5
+ width: auto;
6
+ }
7
+
8
+ .doc-phase-wrapper {
9
+ position: sticky;
10
+ top: 0;
11
+ z-index: 4;
12
+ }
13
+
14
+ @media screen and (max-width: 800px) {
15
+ doc-phase::part(container) {
16
+ margin-bottom: 0;
17
+ }
18
+ }
19
+
20
+ @media screen and (min-width: 1024px) and (max-width: 1496px) {
21
+ doc-phase::part(container) {
22
+ padding-right: var(--dx-g-spacing-3xl);
23
+ }
24
+ }
25
+
26
+ @media screen and (min-width: 1496px) {
27
+ doc-phase::part(container) {
28
+ margin-right: calc(
29
+ var(--dx-g-page-padding-horizontal) - var(--dx-g-spacing-lg)
30
+ );
31
+ }
32
+ }
33
+
34
+ @media screen and (max-width: 768px) {
35
+ /* We are giving top value because there is one more sticky item(lnb) with height 40px */
36
+ .doc-phase-wrapper {
37
+ top: 40px;
38
+ }
39
+ }
@@ -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(254, 243, 217);
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,85 @@
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
+ this.target = undefined;
51
+ this.callbacks.onSearchChange = undefined;
52
+ this.callbacks.onUrlChange = undefined;
53
+ };
54
+
55
+ private handleSearchChange = (event: Event): void => {
56
+ if (this.shouldStopPropagation) {
57
+ event.stopPropagation();
58
+ }
59
+
60
+ const { detail: searchTerm } = event as CustomEvent<string>;
61
+ const fullUrl = new URL(window.location.href);
62
+ const { searchParams } = fullUrl;
63
+
64
+ if (searchTerm) {
65
+ searchParams.set(this.searchParam, searchTerm);
66
+ } else {
67
+ searchParams.delete(this.searchParam);
68
+ }
69
+
70
+ const nextSearchString = searchParams.toString();
71
+
72
+ if (this.callbacks.onSearchChange) {
73
+ this.callbacks.onSearchChange(nextSearchString);
74
+ }
75
+
76
+ fullUrl.search = nextSearchString;
77
+ this.historyMethod({}, "", fullUrl.toString());
78
+ };
79
+
80
+ private handlePopState = (): void => {
81
+ if (this.callbacks.onUrlChange) {
82
+ this.callbacks.onUrlChange(window.location.search);
83
+ }
84
+ };
85
+ }