@salesforcedevs/docs-components 1.37.1-remediation.1 → 1.38.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 (38) hide show
  1. package/LICENSE +12 -0
  2. package/lwc.config.json +0 -1
  3. package/package.json +2 -2
  4. package/src/modules/doc/amfReference/amfReference.css +3 -4
  5. package/src/modules/doc/amfReference/amfReference.html +2 -2
  6. package/src/modules/doc/amfTopic/amfTopic.css +1 -2
  7. package/src/modules/doc/banner/banner.css +3 -3
  8. package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +4 -4
  9. package/src/modules/doc/breadcrumbs/breadcrumbs.css +2 -8
  10. package/src/modules/doc/content/content.css +15 -23
  11. package/src/modules/doc/contentActionToolbar/contentActionToolbar.css +1 -1
  12. package/src/modules/doc/contentCallout/contentCallout.css +10 -82
  13. package/src/modules/doc/contentCallout/contentCallout.html +5 -1
  14. package/src/modules/doc/contentCallout/contentCallout.ts +8 -2
  15. package/src/modules/doc/contentMedia/contentMedia.css +3 -3
  16. package/src/modules/doc/doDont/doDont.css +2 -2
  17. package/src/modules/doc/header/header.css +8 -11
  18. package/src/modules/doc/heading/heading.css +4 -15
  19. package/src/modules/doc/overview/overview.css +1 -2
  20. package/src/modules/doc/phase/phase.css +1 -20
  21. package/src/modules/doc/phase/phase.html +2 -0
  22. package/src/modules/doc/phase/phase.ts +5 -1
  23. package/src/modules/doc/redocReference/redocReference.css +2 -2
  24. package/src/modules/doc/redocReference/redocReference.ts +374 -23
  25. package/src/modules/doc/socialShare/socialShare.css +4 -4
  26. package/src/modules/doc/specificationContent/specificationContent.css +1 -1
  27. package/src/modules/doc/unifiedContentLayout/unifiedContentLayout.css +2 -4
  28. package/src/modules/doc/unifiedContentLayout/unifiedContentLayout.html +8 -0
  29. package/src/modules/doc/unifiedContentLayout/unifiedContentLayout.ts +75 -46
  30. package/src/modules/doc/xmlContent/xmlContent.css +7 -8
  31. package/src/modules/doc/xmlContent/xmlContent.html +2 -2
  32. package/src/modules/docHelpers/amfStyle/amfStyle.css +41 -123
  33. package/src/modules/docHelpers/contentLayoutStyle/contentLayoutStyle.css +6 -9
  34. package/src/modules/docHelpers/status/status.css +6 -2
  35. package/src/modules/docUtils/utils/utils.ts +22 -2
  36. package/src/modules/doc/versionPicker/versionPicker.css +0 -64
  37. package/src/modules/doc/versionPicker/versionPicker.html +0 -40
  38. package/src/modules/doc/versionPicker/versionPicker.ts +0 -65
@@ -1,6 +1,12 @@
1
- import { LightningElement, api } from "lwc";
1
+ import { LightningElement, api, track } from "lwc";
2
2
  import { toJson } from "dxUtils/normalizers";
3
- import type { OptionWithLink, TreeNode } from "typings/custom";
3
+ import type { VersionedNode } from "dxUtils/topicVersion";
4
+ import {
5
+ findTopicVersionForCurrentPage,
6
+ latestHrefForCurrentPage
7
+ } from "dxUtils/topicVersion";
8
+ import { oldVersionDocInfo } from "docUtils/utils";
9
+ import type { DocPhaseInfo, OptionWithLink, TreeNode } from "typings/custom";
4
10
 
5
11
  /**
6
12
  * Per-topic type emitted by the docs content-type parser
@@ -10,61 +16,48 @@ import type { OptionWithLink, TreeNode } from "typings/custom";
10
16
  */
11
17
  const TOPIC_TYPE_SPEC = "spec";
12
18
 
13
- /**
14
- * Walks down the first-child chain and returns the first markdown content
15
- * page found, descending through nested content-less parents. Returns
16
- * undefined if the chain breaks on a spec or external link before reaching a
17
- * content page.
18
- */
19
- function firstChildContentPage(node: TreeNode): TreeNode | undefined {
20
- const firstChild = node.children?.[0];
21
- if (!firstChild) {
22
- return undefined;
23
- }
24
-
25
- const isSpec =
26
- (firstChild as { topicType?: string }).topicType === TOPIC_TYPE_SPEC;
27
- const isExternal = firstChild.link?.target === "_blank";
28
- if (isSpec || isExternal) {
29
- return undefined;
30
- }
31
-
32
- if (firstChild.link?.href) {
33
- return firstChild;
34
- }
35
-
36
- return firstChildContentPage(firstChild);
37
- }
38
-
39
19
  /**
40
20
  * Translates per-topic `topicType` into the generic `showForwardArrow` flag
41
- * that `dx-tree-tile` reads (spec topics get the forward arrow icon for Redoc),
42
- * and redirects content-less parent topics whose first child is a content page
21
+ * that `dx-tree-tile` reads (spec topics get the forward arrow icon for Redoc).
22
+ *
23
+ * Content-less parents are flagged with redirectToChild and left without a
24
+ * link. The tree selects the first markdown descendant. Copying that child's
25
+ * href onto the parent makes the parent win selection.
43
26
  */
44
- function decorateTopics(
45
- topics: Array<TreeNode & { topicType?: string }> | undefined
27
+ function decorateTopicsWithForwardArrow(
28
+ topics:
29
+ | Array<TreeNode & { topicType?: string; versions?: unknown }>
30
+ | undefined
46
31
  ): TreeNode[] | undefined {
47
32
  return topics?.map((topic) => {
48
- const { topicType, ...decorated } = topic;
33
+ const { topicType, versions, ...decorated } = topic;
49
34
  if (topicType === TOPIC_TYPE_SPEC) {
50
35
  decorated.showForwardArrow = true;
36
+ // Nested and standalone specs never get a sidebar picker; only the
37
+ // parent MD topic (when versioned) shows one.
38
+ } else if (Array.isArray(versions)) {
39
+ decorated.versions = versions.map(
40
+ (version: { children?: TreeNode[] }) =>
41
+ version.children
42
+ ? {
43
+ ...version,
44
+ children: decorateTopicsWithForwardArrow(
45
+ version.children
46
+ )
47
+ }
48
+ : version
49
+ );
51
50
  }
52
51
  if (decorated.children) {
53
- decorated.children = decorateTopics(decorated.children);
52
+ decorated.children = decorateTopicsWithForwardArrow(
53
+ decorated.children
54
+ );
54
55
  }
55
56
 
56
- /** Redirect a parent that has no content of its own to its first child
57
- * but only when that first child is itself a content page
58
- */
59
- const isContentlessParent =
60
- !!decorated.children?.length && !decorated.link?.href;
61
-
62
- if (isContentlessParent) {
57
+ // Flag a parent with no page of its own. Leave its link empty so the
58
+ // child's URL stays indexed to the child.
59
+ if (!!decorated.children?.length && !decorated.link?.href) {
63
60
  decorated.redirectToChild = true;
64
- const firstChild = firstChildContentPage(topic);
65
- if (firstChild?.link) {
66
- decorated.link = { ...firstChild.link };
67
- }
68
61
  }
69
62
 
70
63
  return decorated;
@@ -101,6 +94,9 @@ export default class UnifiedContentLayout extends LightningElement {
101
94
 
102
95
  private _docPhaseInfo: string | null = null;
103
96
  private _sidebarContent: unknown = null;
97
+ private _oldVersionInfo: DocPhaseInfo | null = null;
98
+
99
+ @track showVersionBanner = false;
104
100
 
105
101
  @api
106
102
  get docPhaseInfo(): string | null {
@@ -117,7 +113,40 @@ export default class UnifiedContentLayout extends LightningElement {
117
113
  }
118
114
 
119
115
  set sidebarContent(value: string) {
120
- this._sidebarContent = decorateTopics(toJson(value)?.topics);
116
+ const topics = decorateTopicsWithForwardArrow(toJson(value)?.topics);
117
+ this._sidebarContent = topics;
118
+ this.updateTopicVersionBanner(topics as VersionedNode[] | undefined);
119
+ }
120
+
121
+ get oldVersionInfo(): DocPhaseInfo | null {
122
+ return this._oldVersionInfo;
123
+ }
124
+
125
+ handleDismissVersionBanner(): void {
126
+ this.showVersionBanner = false;
127
+ }
128
+
129
+ /**
130
+ * Same banner references use when the reader is on an older version.
131
+ * Topic versions are not a separate page property: the sidebar tree
132
+ * carries each version's switching URL, and the current pathname says
133
+ * which one is open.
134
+ */
135
+ private updateTopicVersionBanner(
136
+ topics: VersionedNode[] | undefined
137
+ ): void {
138
+ const match = findTopicVersionForCurrentPage(topics);
139
+ const latest = match?.node.versions?.[0];
140
+ const latestHref = latestHrefForCurrentPage(match?.node.versions);
141
+
142
+ if (match && latest && match.version.id !== latest.id && latestHref) {
143
+ this._oldVersionInfo = oldVersionDocInfo(latestHref);
144
+ this.showVersionBanner = true;
145
+ return;
146
+ }
147
+
148
+ this._oldVersionInfo = null;
149
+ this.showVersionBanner = false;
121
150
  }
122
151
 
123
152
  private get enableFooter(): boolean {
@@ -1,9 +1,6 @@
1
1
  :host {
2
- --button-primary-color: var(--dx-g-blue-50, var(--dx-g-blue-vibrant-50));
3
- --button-primary-color-hover: var(
4
- --dx-g-blue-40,
5
- var(--dx-g-blue-vibrant-40)
6
- );
2
+ --button-primary-color: var(--dx-g-blue-vibrant-50);
3
+ --button-primary-color-hover: var(--dx-g-blue-vibrant-40);
7
4
  }
8
5
 
9
6
  doc-content-layout {
@@ -53,11 +50,13 @@ dx-dropdown > dx-button:hover {
53
50
  }
54
51
 
55
52
  @media screen and (max-width: 768px) {
56
- /* At this width the doc header is 41px (main nav) plus 40px. */
57
53
  doc-content-layout {
58
- --dx-c-doc-header-height: calc(41px + 40px);
54
+ --dx-g-doc-header-main-nav-height: 41px;
55
+ --dx-g-doc-header-height: calc(
56
+ var(--dx-g-doc-header-main-nav-height) + 40px
57
+ );
59
58
  --dx-c-content-sidebar-sticky-top: calc(
60
- var(--dx-g-global-header-height) + var(--dx-c-doc-header-height)
59
+ var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
61
60
  );
62
61
  }
63
62
  }
@@ -24,7 +24,7 @@
24
24
  ondismissphase={handleDismissVersionBanner}
25
25
  ></doc-phase>
26
26
  <div lwc:if={showVersionPicker} slot="sidebar-header">
27
- <doc-version-picker
27
+ <dx-version-picker
28
28
  data-type="version"
29
29
  analytics-event="custEv_linkClick"
30
30
  analytics-payload={ANALYTICS_PAYLOAD}
@@ -32,7 +32,7 @@
32
32
  selected-version={version}
33
33
  latest-version={latestVersion}
34
34
  hide-badge={previewVersion}
35
- ></doc-version-picker>
35
+ ></dx-version-picker>
36
36
  </div>
37
37
  <div class="breadcrumb-row" lwc:if={showBreadcrumbs}>
38
38
  <doc-breadcrumbs
@@ -5,7 +5,7 @@
5
5
  --amf-h5-font-family: var(--dx-g-font-display);
6
6
  --amf-h5-font-size: 32px;
7
7
  --amf-h5-font-weight: var(--dx-g-font-normal);
8
- --amf-h5-font-color: var(--dx-g-blue-20, var(--dx-g-blue-vibrant-20));
8
+ --amf-h5-font-color: var(--dx-g-blue-vibrant-20);
9
9
  --amf-h5-line-height: var(--dx-g-spacing-2xl);
10
10
  --amf-h5-margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-lg) 0;
11
11
  --amf-h5-padding: 0;
@@ -14,7 +14,7 @@
14
14
  --amf-h6-font-family: var(--dx-g-font-display);
15
15
  --amf-h6-font-size: var(--dx-g-text-xl);
16
16
  --amf-h6-font-weight: var(--dx-g-font-normal);
17
- --amf-h6-font-color: var(--dx-g-blue-20, var(--dx-g-blue-vibrant-20));
17
+ --amf-h6-font-color: var(--dx-g-blue-vibrant-20);
18
18
  --amf-h6-line-height: var(--dx-g-spacing-xl);
19
19
  --amf-h6-margin: 32px 0 0 0;
20
20
  --amf-h6-padding: 0;
@@ -23,7 +23,7 @@
23
23
  --amf-h7-font-family: var(--dx-g-font-display);
24
24
  --amf-h7-font-size: var(--dx-g-text-lg);
25
25
  --amf-h7-font-weight: var(--dx-g-font-normal);
26
- --amf-h7-font-color: var(--dx-g-blue-20, var(--dx-g-blue-vibrant-20));
26
+ --amf-h7-font-color: var(--dx-g-blue-vibrant-20);
27
27
  --amf-h7-line-height: 28px;
28
28
  --amf-h7-margin: var(--dx-g-spacing-lg) 0 0 0;
29
29
  --amf-h7-padding: 0;
@@ -32,7 +32,7 @@
32
32
  --amf-h8-font-family: var(--dx-g-font-display);
33
33
  --amf-h8-font-size: var(--dx-g-text-base);
34
34
  --amf-h8-font-weight: var(--dx-g-font-normal);
35
- --amf-h8-font-color: var(--dx-g-blue-20, var(--dx-g-blue-vibrant-20));
35
+ --amf-h8-font-color: var(--dx-g-blue-vibrant-20);
36
36
  --amf-h8-line-height: 20px;
37
37
  --amf-h8-margin: var(--dx-g-spacing-lg) 0 var(--dx-g-spacing-md) 0;
38
38
  --amf-h8-padding: 0;
@@ -41,7 +41,7 @@
41
41
  --amf-h8-mod-font-family: var(--dx-g-font-sans);
42
42
  --amf-h8-mod-font-size: var(--dx-g-text-base);
43
43
  --amf-h8-mod-font-weight: var(--dx-g-font-bold);
44
- --amf-h8-mod-font-color: var(--dx-g-blue-20, var(--dx-g-blue-vibrant-20));
44
+ --amf-h8-mod-font-color: var(--dx-g-blue-vibrant-20);
45
45
  --amf-h8-mod-line-height: 20px;
46
46
  --amf-h8-mod-margin: var(--dx-g-spacing-lg) 0 var(--dx-g-spacing-md) 0;
47
47
  --amf-h8-mod-padding: 0;
@@ -59,17 +59,13 @@ api-security-documentation {
59
59
  --arc-font-body1-font-family: var(--dx-g-font-sans);
60
60
  --arc-font-title-font-family: var(--amf-h6-font-family);
61
61
  --arc-font-title-color: var(--amf-h6-font-color);
62
- --markdown-styles-title-border-bottom-color: var(
63
- --dx-g-neutral-90,
64
- var(--dx-g-gray-90)
65
- );
62
+ --markdown-styles-title-border-bottom-color: var(--dx-g-gray-90);
66
63
 
67
64
  /* h2 */
68
65
  --arc-font-title-font-size: var(--dx-g-text-xl);
69
66
  --arc-font-title-line-height: var(--dx-g-spacing-xl);
70
67
  --markdown-styles-h2-border-bottom: 0;
71
- --markdown-styles-h2-border-top: 1px solid
72
- var(--dx-g-neutral-90, var(--dx-g-gray-90));
68
+ --markdown-styles-h2-border-top: 1px solid var(--dx-g-gray-90);
73
69
  --arc-font-h2-margin: var(--dx-g-spacing-lg)
74
70
  calc(-1 * var(--dx-g-spacing-2xl)) var(--dx-g-spacing-lg)
75
71
  calc(-1 * var(--dx-g-spacing-2xl));
@@ -89,76 +85,33 @@ api-security-documentation {
89
85
  --arc-font-code-family: var(--dx-g-font-mono);
90
86
 
91
87
  /* a */
92
- --link-color: var(--dx-g-blue-50, var(--dx-g-blue-vibrant-50));
93
- --link-hover-color: var(--dx-g-blue-50, var(--dx-g-blue-vibrant-50));
88
+ --link-color: var(--dx-g-blue-vibrant-50);
89
+ --link-hover-color: var(--dx-g-blue-vibrant-50);
94
90
 
95
91
  /* HTTP methods colors */
96
92
  --method-display-selected-color: #fff;
97
- --method-display-get-color: var(
98
- --dx-g-blue-50,
99
- var(--dx-g-blue-vibrant-50)
100
- );
101
- --method-display-post-color: var(
102
- --dx-g-green-40,
103
- var(--dx-g-green-vibrant-40)
104
- );
105
- --method-display-put-color: var(
106
- --dx-g-yellow-40,
107
- var(--dx-g-yellow-vibrant-40)
108
- );
109
- --method-display-patch-color: var(
110
- --dx-g-teal-40,
111
- var(--dx-g-teal-vibrant-40)
112
- );
113
- --method-display-delete-color: var(
114
- --dx-g-red-40,
115
- var(--dx-g-red-vibrant-40)
116
- );
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);
117
98
 
118
99
  /* --method-display-options-color: var(--anypoint-color-teal3);
119
100
  --method-display-head-color: var(--anypoint-color-futureGreen3);
120
101
  HTTP methods colors in method documentation panel */
121
102
  --http-method-label-border-radius: 4px;
122
- --http-method-label-get-background-color: var(
123
- --dx-g-blue-90,
124
- var(--dx-g-blue-vibrant-90)
125
- );
126
- --http-method-label-get-color: var(
127
- --dx-g-blue-50,
128
- var(--dx-g-blue-vibrant-50)
129
- );
130
- --http-method-label-post-background-color: var(
131
- --dx-g-green-90,
132
- var(--dx-g-green-vibrant-90)
133
- );
134
- --http-method-label-post-color: var(
135
- --dx-g-green-40,
136
- var(--dx-g-green-vibrant-40)
137
- );
138
- --http-method-label-put-background-color: var(
139
- --dx-g-yellow-90,
140
- var(--dx-g-yellow-vibrant-90)
141
- );
142
- --http-method-label-put-color: var(
143
- --dx-g-yellow-40,
144
- var(--dx-g-yellow-vibrant-40)
145
- );
146
- --http-method-label-patch-background-color: var(
147
- --dx-g-teal-90,
148
- var(--dx-g-teal-vibrant-90)
149
- );
150
- --http-method-label-patch-color: var(
151
- --dx-g-teal-40,
152
- var(--dx-g-teal-vibrant-40)
153
- );
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);
154
111
  --http-method-label-delete-background-color: var(
155
- --dx-g-hot-orange-90,
156
- var(--dx-g-hot-orange-vibrant-90)
157
- );
158
- --http-method-label-delete-color: var(
159
- --dx-g-red-40,
160
- var(--dx-g-red-vibrant-40)
112
+ --dx-g-hot-orange-vibrant-90
161
113
  );
114
+ --http-method-label-delete-color: var(--dx-g-red-vibrant-40);
162
115
 
163
116
  /* --http-method-label-options-background-color: var(--method-display-options-color);
164
117
  --http-method-label-options-color: #fff;
@@ -182,42 +135,24 @@ api-security-documentation {
182
135
  --api-body-document-title-border: 0;
183
136
  --api-type-document-trait-font-family: var(--dx-g-font-sans);
184
137
  --api-type-document-union-button-active-background-color: transparent;
185
- --api-type-document-union-button-active-color: var(
186
- --dx-g-blue-20,
187
- var(--dx-g-blue-vibrant-20)
188
- );
138
+ --api-type-document-union-button-active-color: var(--dx-g-blue-vibrant-20);
189
139
  --api-type-document-union-button-background-color: transparent;
190
- --api-type-document-union-button-color: var(
191
- --dx-g-blue-50,
192
- var(--dx-g-blue-vibrant-50)
193
- );
140
+ --api-type-document-union-button-color: var(--dx-g-blue-vibrant-50);
194
141
  --api-type-document-media-button-border-color: transparent;
195
142
  --property-shape-document-padding: 24px 0;
196
143
  --property-shape-document-title-font-family: var(--dx-g-font-mono);
197
- --property-shape-document-object-color: var(
198
- --dx-g-blue-90,
199
- var(--dx-g-blue-vibrant-90)
200
- );
201
- --property-shape-document-array-color: var(
202
- --dx-g-blue-90,
203
- var(--dx-g-blue-vibrant-90)
204
- );
205
- --property-shape-document-union-color: var(
206
- --dx-g-blue-90,
207
- var(--dx-g-blue-vibrant-90)
208
- );
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);
209
147
 
210
148
  /* anypoint button */
211
149
  --anypoint-button-font-size: var(--dx-g-text-sm);
212
- --anypoint-button-color: var(--dx-g-blue-50, var(--dx-g-blue-vibrant-50));
150
+ --anypoint-button-color: var(--dx-g-blue-vibrant-50);
213
151
  --anypoint-button-text-transform: capitalize;
214
152
  --anypoint-button-background-color: transparent;
215
153
  --anypoint-button-hover-background-color: transparent;
216
154
  --anypoint-button-active-background-color: transparent;
217
- --anypoint-button-emphasis-low-focus-color: var(
218
- --dx-g-blue-20,
219
- var(--dx-g-blue-vibrant-20)
220
- );
155
+ --anypoint-button-emphasis-low-focus-color: var(--dx-g-blue-vibrant-20);
221
156
  --anypoint-button-emphasis-low-hover-background-color: transparent;
222
157
  --anypoint-button-emphasis-low-focus-background-color: transparent;
223
158
  --anypoint-button-emphasis-low-active-background-color: transparent;
@@ -280,8 +215,7 @@ api-method-documentation {
280
215
  --dx-g-font-display
281
216
  );
282
217
  --api-endpoint-documentation-method-value-font-color: var(
283
- --dx-g-blue-20,
284
- var(--dx-g-blue-vibrant-20)
218
+ --dx-g-blue-vibrant-20
285
219
  );
286
220
  --api-endpoint-documentation-method-value-font-size: var(--dx-g-text-base);
287
221
  --api-endpoint-documentation-method-value-font-weight: var(
@@ -324,7 +258,7 @@ api-method-documentation {
324
258
  --anypoint-button-font-family: var(--dx-g-font-display);
325
259
  --anypoint-button-font-size: var(--dx-g-text-base);
326
260
  --anypoint-button-background-color: transparent;
327
- --anypoint-button-color: var(--dx-g-blue-50, var(--dx-g-blue-vibrant-50));
261
+ --anypoint-button-color: var(--dx-g-blue-vibrant-50);
328
262
  --anypoint-button-text-transform: uppercase;
329
263
 
330
264
  /* method documentation */
@@ -336,42 +270,27 @@ api-method-documentation {
336
270
  --dx-g-font-bold
337
271
  );
338
272
  --api-method-documentation-description-color: rgb(24 24 24);
339
- --api-method-documentation-operation-id-color: var(
340
- --dx-g-neutral-50,
341
- var(--dx-g-gray-50)
342
- );
273
+ --api-method-documentation-operation-id-color: var(--dx-g-gray-50);
343
274
 
344
275
  /* body */
345
276
  --api-body-document-description-color: rgb(24 24 24);
346
- --api-body-document-media-type-selector-color: var(
347
- --dx-g-blue-20,
348
- var(--dx-g-blue-vibrant-20)
349
- );
277
+ --api-body-document-media-type-selector-color: var(--dx-g-blue-vibrant-20);
350
278
  --api-body-document-media-type-selector-font-size: var(
351
279
  --amf-h8-mod-font-size
352
280
  );
353
281
  --api-body-document-media-type-selector-font-weight: var(
354
282
  --amf-h8-mod-font-weight
355
283
  );
356
- --api-body-document-toggle-view-color: var(
357
- --dx-g-blue-50,
358
- var(--dx-g-blue-vibrant-50)
359
- );
284
+ --api-body-document-toggle-view-color: var(--dx-g-blue-vibrant-50);
360
285
  --api-body-document-toggle-view-font-size: var(--amf-h8-mod-font-size);
361
286
  --api-body-document-toggle-view-font-weight: var(--amf-h8-mod-font-weight);
362
- --api-body-document-media-button-color: var(
363
- --dx-g-blue-20,
364
- var(--dx-g-blue-vibrant-20)
365
- );
287
+ --api-body-document-media-button-color: var(--dx-g-blue-vibrant-20);
366
288
  --api-body-document-media-button-background-color: transparent;
367
289
  --api-body-document-media-button-text-decoration: underline 2px;
368
290
  --api-body-document-media-button-text-underline-offset: 4px;
369
291
 
370
292
  /* resource */
371
- --api-resource-example-document-button-color: var(
372
- --dx-g-blue-50,
373
- var(--dx-g-blue-vibrant-50)
374
- );
293
+ --api-resource-example-document-button-color: var(--dx-g-blue-vibrant-50);
375
294
  --api-resource-example-document-button-font-size: var(--dx-g-text-sm);
376
295
  --api-resource-example-document-button-font-weight: var(--dx-g-font-normal);
377
296
  --api-resource-example-document-button-active-outline: none;
@@ -379,15 +298,14 @@ api-method-documentation {
379
298
  --api-resource-example-document-button-active-text-underline-offset: 3px;
380
299
  --api-resource-example-document-button-active-background-color: transparent;
381
300
  --api-resource-example-document-button-active-color: var(
382
- --dx-g-blue-20,
383
- var(--dx-g-blue-vibrant-20)
301
+ --dx-g-blue-vibrant-20
384
302
  );
385
303
  }
386
304
 
387
305
  api-summary::part(api-title) {
388
306
  font-family: var(--dx-g-font-display);
389
307
  font-size: var(--dx-g-text-3xl);
390
- color: var(--dx-g-blue-20, var(--dx-g-blue-vibrant-20));
308
+ color: var(--dx-g-blue-vibrant-20);
391
309
  line-height: var(--dx-g-text-4xl);
392
310
  letter-spacing: -0.85px;
393
311
  margin: var(--dx-g-spacing-sm) 0;
@@ -400,7 +318,7 @@ api-summary::part(api-title-label) {
400
318
  api-summary::part(api-version) {
401
319
  font-family: var(--dx-g-font-display);
402
320
  font-size: var(--dx-g-text-sm);
403
- color: var(--dx-g-blue-50, var(--dx-g-blue-vibrant-50));
321
+ color: var(--dx-g-blue-vibrant-50);
404
322
  }
405
323
 
406
324
  api-summary::part(marked-description) {
@@ -1,19 +1,16 @@
1
1
  :host {
2
2
  --dx-c-content-vertical-spacing: var(--dx-g-spacing-lg);
3
3
  --dx-c-content-sidebar-sticky-top: calc(
4
- var(--dx-g-global-header-height) +
5
- var(--dx-c-doc-header-height, var(--dx-g-doc-header-height))
4
+ var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
6
5
  );
7
6
  --dx-c-sidebar-height: calc(
8
7
  100vh -
9
8
  calc(
10
- var(--dx-g-global-header-height) +
11
- var(--dx-c-doc-header-height, var(--dx-g-doc-header-height))
9
+ var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
12
10
  )
13
11
  );
14
12
  --dx-c-content-scroll-margin-top: calc(
15
- var(--dx-g-global-header-height) +
16
- var(--dx-c-doc-header-height, var(--dx-g-doc-header-height)) +
13
+ var(--dx-g-global-header-height) + var(--dx-g-doc-header-height) +
17
14
  var(--dx-g-spacing-2xl)
18
15
  );
19
16
 
@@ -46,8 +43,8 @@ doc-breadcrumbs {
46
43
  align-items: center;
47
44
  gap: var(--dx-g-spacing-xs, 8px);
48
45
  margin-bottom: var(--dx-g-spacing-lg, 16px);
49
- color: var(--dx-g-neutral-30, var(--dx-g-gray-30, #3e3e3c));
50
- font-size: var(--dx-g-font-size-body-3, 14px);
46
+ color: var(--dx-g-gray-30, #3e3e3c);
47
+ font-size: var(--dx-g-font-size-sm, 14px);
51
48
  }
52
49
 
53
50
  .read svg {
@@ -91,7 +88,7 @@ dx-toc {
91
88
 
92
89
  .content-body-doc-phase-container {
93
90
  flex: 1;
94
- border-left: 1px solid var(--dx-g-neutral-90, var(--dx-g-gray-90));
91
+ border-left: 1px solid var(--dx-g-gray-90);
95
92
  min-width: 0;
96
93
  }
97
94
 
@@ -1,6 +1,5 @@
1
1
  :host {
2
- /* Deprecated: nothing reads it. Removed under plan 3.3. */
3
- --dx-status-icon-color: var(--dx-g-neutral-10, var(--dx-g-gray-10));
2
+ --dx-status-icon-color: var(--dx-g-gray-10);
4
3
  --doc-status-vertical-padding: var(--dx-g-spacing-md);
5
4
  }
6
5
 
@@ -9,6 +8,11 @@
9
8
  padding: var(--doc-status-vertical-padding);
10
9
  }
11
10
 
11
+ .doc-status-container {
12
+ background-color: rgb(253 252 247);
13
+ border-color: var(--dx-g-yellow-vibrant-80);
14
+ }
15
+
12
16
  .doc-status-title {
13
17
  font-weight: var(--dx-g-font-bold);
14
18
  }
@@ -1,10 +1,30 @@
1
1
  import { CoveoAnalyticsClient } from "coveo.analytics/dist/browser.mjs"; // This fix is required for Node 20 upgrade, so that Coveo analytics is loaded properly by LWR.
2
2
 
3
+ // Resolve against the current origin (version links are usually relative) and
4
+ // keep only http/https. Blocks executable schemes like javascript:/data: that
5
+ // would run when the innerHTML-rendered link is clicked.
6
+ // The link is already percent-encoded: location.pathname and AMF queries such
7
+ // as type%3A. encodeURI would encode "%" again (%20 -> %2520) and the View
8
+ // Latest href would 404. Escape only the quote that would close the attribute.
9
+ const toSafeHref = (link: string): string => {
10
+ try {
11
+ const { protocol } = new URL(link, window.location.origin);
12
+ if (protocol === "http:" || protocol === "https:") {
13
+ return link.replace(/"/g, "%22");
14
+ }
15
+ } catch {
16
+ // Fall through to the rejection below.
17
+ }
18
+ console.warn(`Blocked unsafe version link: ${link}`);
19
+ return "#";
20
+ };
21
+
3
22
  export const oldVersionDocInfo = (latestVersionLink: string) => {
23
+ const safeLink = toSafeHref(latestVersionLink);
4
24
  return {
5
25
  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>`
26
+ body: `This content describes an older version of this product.
27
+ <a style="font-weight: bold;" href="${safeLink}">View Latest</a>`
8
28
  };
9
29
  };
10
30
 
@@ -1,64 +0,0 @@
1
- @import "dxHelpers/reset";
2
-
3
- /* NOTE: doc-version-picker-width width variable is used by both dx-button and dx-dropdown to maintain a consistent width. */
4
- :host {
5
- --dx-c-dropdown-option-font-weight: normal;
6
- --dx-c-dropdown-option-label-color: var(--dx-g-gray-10);
7
- --popover-container-open-transform: translateY(4px);
8
- }
9
-
10
- .version-picker-container {
11
- padding: 8px var(--dx-g-spacing-lg) 8px
12
- var(--dx-g-global-header-padding-horizontal);
13
- border-top: 1px solid var(--dx-g-gray-90);
14
- border-bottom: 1px solid var(--dx-g-gray-90);
15
- }
16
-
17
- .version-picker-button {
18
- display: flex;
19
- width: var(--doc-version-picker-width, 296px);
20
- }
21
-
22
- .version-picker-button:hover,
23
- .version-picker-button:active,
24
- .version-picker-button:focus {
25
- --dx-c-button-secondary-color-hover: var(--dx-g-cloud-blue-vibrant-95);
26
- --dx-c-button-primary-color: var(--dx-g-blue-vibrant-40);
27
- }
28
-
29
- /**
30
- * NOTE: This CSS ensures the span inside the button stays within the parent's width, avoiding overflow.
31
- * Not keeping this in common component to ensure that existing functionality works as it is.
32
- */
33
- dx-button::part(content) {
34
- width: inherit;
35
- overflow: hidden;
36
- }
37
-
38
- .selected-version {
39
- display: flex;
40
- flex-direction: row;
41
- align-items: center;
42
- }
43
-
44
- .selected-version-label {
45
- flex: 1;
46
- overflow: hidden;
47
- text-align: left;
48
- text-overflow: ellipsis;
49
- white-space: nowrap;
50
- }
51
-
52
- dx-type-badge.latest-badge {
53
- --dx-c-type-badge-color: var(--dx-g-green-vibrant-40);
54
- --dx-c-type-badge-background: var(--dx-g-green-vibrant-95);
55
-
56
- margin-left: var(--dx-g-spacing-sm);
57
- }
58
-
59
- dx-type-badge.not-latest-badge {
60
- --dx-c-type-badge-color: var(--dx-g-red-vibrant-40);
61
- --dx-c-type-badge-background: var(--dx-g-red-vibrant-95);
62
-
63
- margin-left: var(--dx-g-spacing-sm);
64
- }