@redocly/theme 0.65.0-next.3 → 0.65.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Catalog/CatalogTags.js +1 -0
- package/lib/components/Catalog/variables.js +1 -0
- package/lib/components/Markdown/Markdown.js +92 -26
- package/lib/components/Markdown/styles/base-table.js +2 -1
- package/lib/components/Markdown/styles/heading-anchor.d.ts +1 -1
- package/lib/components/Markdown/styles/heading-anchor.js +1 -1
- package/lib/components/Search/variables.js +1 -3
- package/lib/core/constants/heading.d.ts +9 -0
- package/lib/core/constants/heading.js +13 -0
- package/lib/core/constants/index.d.ts +2 -0
- package/lib/core/constants/index.js +2 -0
- package/lib/core/constants/markdown.d.ts +1 -0
- package/lib/core/constants/markdown.js +5 -0
- package/lib/core/hooks/use-active-heading.js +2 -1
- package/lib/core/styles/palette.dark.js +27 -0
- package/lib/core/styles/palette.js +30 -0
- package/lib/icons/AiStarsGradientIcon/AiStarsGradientIcon.js +2 -2
- package/lib/layouts/CodeWalkthroughLayout.js +3 -1
- package/lib/layouts/DocumentationLayout.js +3 -1
- package/lib/markdoc/components/Heading/Heading.js +12 -24
- package/package.json +1 -1
- package/src/components/Catalog/CatalogTags.tsx +1 -0
- package/src/components/Catalog/variables.ts +1 -0
- package/src/components/Markdown/Markdown.tsx +102 -26
- package/src/components/Markdown/styles/base-table.ts +3 -1
- package/src/components/Markdown/styles/heading-anchor.ts +1 -1
- package/src/components/Search/variables.ts +3 -3
- package/src/core/constants/heading.ts +9 -0
- package/src/core/constants/index.ts +2 -0
- package/src/core/constants/markdown.ts +1 -0
- package/src/core/hooks/use-active-heading.ts +2 -1
- package/src/core/styles/palette.dark.ts +27 -0
- package/src/core/styles/palette.ts +30 -0
- package/src/icons/AiStarsGradientIcon/AiStarsGradientIcon.tsx +8 -2
- package/src/layouts/CodeWalkthroughLayout.tsx +3 -1
- package/src/layouts/DocumentationLayout.tsx +3 -1
- package/src/markdoc/components/Heading/Heading.tsx +36 -29
|
@@ -49,6 +49,7 @@ function CatalogTags({ items, itemsToShow = 1, showPlaceholder = false, showAvat
|
|
|
49
49
|
const CatalogTagsWrapper = styled_components_1.default.div `
|
|
50
50
|
display: flex;
|
|
51
51
|
flex-wrap: wrap;
|
|
52
|
+
row-gap: var(--catalog-tags-row-gap);
|
|
52
53
|
`;
|
|
53
54
|
const MoreTagsButton = styled_components_1.default.span `
|
|
54
55
|
font-size: var(--catalog-tags-more-button-font-size);
|
|
@@ -150,6 +150,7 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
150
150
|
*/
|
|
151
151
|
--catalog-tags-more-button-font-size: var(--font-size-base);
|
|
152
152
|
--catalog-tags-more-button-margin-left: 4px;
|
|
153
|
+
--catalog-tags-row-gap: var(--spacing-xxs);
|
|
153
154
|
--catalog-tags-placeholder-bg-color: var(--bg-color);
|
|
154
155
|
--catalog-tags-not-connected-font-size: var(--font-size-base);
|
|
155
156
|
--catalog-tags-not-connected-line-height: var(--line-height-base);
|
|
@@ -39,6 +39,7 @@ const utils_1 = require("../../core/utils");
|
|
|
39
39
|
const base_table_1 = require("../../components/Markdown/styles/base-table");
|
|
40
40
|
const links_1 = require("../../components/Markdown/styles/links");
|
|
41
41
|
const heading_anchor_1 = require("../../components/Markdown/styles/heading-anchor");
|
|
42
|
+
const constants_1 = require("../../core/constants");
|
|
42
43
|
exports.Markdown = styled_components_1.default.main.attrs(({ className }) => ({
|
|
43
44
|
'data-component-name': 'Markdown/Markdown',
|
|
44
45
|
className,
|
|
@@ -85,17 +86,82 @@ exports.Markdown = styled_components_1.default.main.attrs(({ className }) => ({
|
|
|
85
86
|
max-width: 100%;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
h2.md,
|
|
90
|
-
h3.md,
|
|
91
|
-
h4.md,
|
|
92
|
-
h5.md,
|
|
93
|
-
h6.md {
|
|
89
|
+
.${constants_1.HEADING_ANCHOR_CLASS} {
|
|
94
90
|
font-weight: var(--heading-font-weight);
|
|
95
91
|
font-family: var(--heading-font-family);
|
|
96
92
|
position: relative;
|
|
97
93
|
|
|
98
94
|
scroll-margin-top: calc(var(--navbar-height) + var(--banner-height));
|
|
95
|
+
${(0, heading_anchor_1.headingAnchorCss)(constants_1.ANCHOR_CLASS)};
|
|
96
|
+
|
|
97
|
+
h1, h2, h3, h4, h5, h6 {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: flex-start;
|
|
100
|
+
gap: var(--spacing-sm);
|
|
101
|
+
margin: 0;
|
|
102
|
+
font: inherit;
|
|
103
|
+
color: inherit;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.${constants_1.H1_CLASS} {
|
|
108
|
+
${(0, utils_1.typography)('h1')};
|
|
109
|
+
margin: var(--h1-margin-top) 0 var(--h1-margin-bottom) 0;
|
|
110
|
+
|
|
111
|
+
h1 code {
|
|
112
|
+
font-size: var(--h1-font-size);
|
|
113
|
+
line-height: var(--h1-code-line-height);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.${constants_1.H2_CLASS} {
|
|
118
|
+
${(0, utils_1.typography)('h2')};
|
|
119
|
+
margin: var(--h2-margin-top) 0 var(--h2-margin-bottom) 0;
|
|
120
|
+
|
|
121
|
+
h2 code {
|
|
122
|
+
font-size: var(--h2-font-size);
|
|
123
|
+
line-height: var(--h2-code-line-height);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.${constants_1.H3_CLASS} {
|
|
128
|
+
${(0, utils_1.typography)('h3')};
|
|
129
|
+
margin: var(--h3-margin-top) 0 var(--h3-margin-bottom) 0;
|
|
130
|
+
|
|
131
|
+
h3 code {
|
|
132
|
+
font-size: var(--h3-font-size);
|
|
133
|
+
line-height: var(--h3-code-line-height);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.${constants_1.H4_CLASS} {
|
|
138
|
+
${(0, utils_1.typography)('h4')};
|
|
139
|
+
margin: var(--h4-margin-top) 0 var(--h4-margin-bottom) 0;
|
|
140
|
+
|
|
141
|
+
h4 code {
|
|
142
|
+
font-size: var(--h4-font-size);
|
|
143
|
+
line-height: var(--h4-code-line-height);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.${constants_1.H5_CLASS} {
|
|
148
|
+
${(0, utils_1.typography)('h5')};
|
|
149
|
+
margin: var(--h5-margin-top) 0 var(--h5-margin-bottom) 0;
|
|
150
|
+
|
|
151
|
+
h5 code {
|
|
152
|
+
font-size: var(--h5-font-size);
|
|
153
|
+
line-height: var(--h5-code-line-height);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.${constants_1.H6_CLASS} {
|
|
158
|
+
${(0, utils_1.typography)('h6')};
|
|
159
|
+
margin: var(--h6-margin-top) 0 var(--h6-margin-bottom) 0;
|
|
160
|
+
|
|
161
|
+
h6 code {
|
|
162
|
+
font-size: var(--h6-font-size);
|
|
163
|
+
line-height: var(--h6-code-line-height);
|
|
164
|
+
}
|
|
99
165
|
}
|
|
100
166
|
|
|
101
167
|
strong {
|
|
@@ -139,71 +205,71 @@ exports.Markdown = styled_components_1.default.main.attrs(({ className }) => ({
|
|
|
139
205
|
margin: var(--md-paragraph-margin);
|
|
140
206
|
}
|
|
141
207
|
|
|
142
|
-
|
|
208
|
+
/**
|
|
209
|
+
* @deprecated Legacy styles for ejected Heading components that render h1-h6 as the root.
|
|
210
|
+
*
|
|
211
|
+
* Deprecated legacy heading styles start.
|
|
212
|
+
*/
|
|
213
|
+
h1.${constants_1.MARKDOWN_CLASS_NAME} {
|
|
143
214
|
${(0, utils_1.typography)('h1')};
|
|
144
215
|
margin: var(--h1-margin-top) 0 var(--h1-margin-bottom) 0;
|
|
145
|
-
${(0, heading_anchor_1.headingAnchorCss)()};
|
|
146
216
|
}
|
|
147
217
|
|
|
148
|
-
h2.
|
|
218
|
+
h2.${constants_1.MARKDOWN_CLASS_NAME} {
|
|
149
219
|
${(0, utils_1.typography)('h2')};
|
|
150
220
|
margin: var(--h2-margin-top) 0 var(--h2-margin-bottom) 0;
|
|
151
|
-
${(0, heading_anchor_1.headingAnchorCss)()};
|
|
152
221
|
}
|
|
153
222
|
|
|
154
|
-
h3.
|
|
223
|
+
h3.${constants_1.MARKDOWN_CLASS_NAME} {
|
|
155
224
|
${(0, utils_1.typography)('h3')};
|
|
156
225
|
margin: var(--h3-margin-top) 0 var(--h3-margin-bottom) 0;
|
|
157
|
-
${(0, heading_anchor_1.headingAnchorCss)()};
|
|
158
226
|
}
|
|
159
227
|
|
|
160
|
-
h4.
|
|
228
|
+
h4.${constants_1.MARKDOWN_CLASS_NAME} {
|
|
161
229
|
${(0, utils_1.typography)('h4')};
|
|
162
230
|
margin: var(--h4-margin-top) 0 var(--h4-margin-bottom) 0;
|
|
163
|
-
${(0, heading_anchor_1.headingAnchorCss)()};
|
|
164
231
|
}
|
|
165
232
|
|
|
166
|
-
h5.
|
|
233
|
+
h5.${constants_1.MARKDOWN_CLASS_NAME} {
|
|
167
234
|
${(0, utils_1.typography)('h5')};
|
|
168
235
|
margin: var(--h5-margin-top) 0 var(--h5-margin-bottom) 0;
|
|
169
|
-
${(0, heading_anchor_1.headingAnchorCss)()};
|
|
170
236
|
}
|
|
171
237
|
|
|
172
|
-
h6.
|
|
238
|
+
h6.${constants_1.MARKDOWN_CLASS_NAME} {
|
|
173
239
|
${(0, utils_1.typography)('h6')};
|
|
174
240
|
margin: var(--h6-margin-top) 0 var(--h6-margin-bottom) 0;
|
|
175
|
-
${(0, heading_anchor_1.headingAnchorCss)()};
|
|
176
241
|
}
|
|
177
242
|
|
|
178
|
-
h1.
|
|
243
|
+
h1.${constants_1.MARKDOWN_CLASS_NAME} code {
|
|
179
244
|
font-size: var(--h1-font-size);
|
|
180
245
|
line-height: var(--h1-code-line-height);
|
|
181
246
|
}
|
|
182
247
|
|
|
183
|
-
h2.
|
|
248
|
+
h2.${constants_1.MARKDOWN_CLASS_NAME} code {
|
|
184
249
|
font-size: var(--h2-font-size);
|
|
185
250
|
line-height: var(--h2-code-line-height);
|
|
186
251
|
}
|
|
187
252
|
|
|
188
|
-
h3.
|
|
253
|
+
h3.${constants_1.MARKDOWN_CLASS_NAME} code {
|
|
189
254
|
font-size: var(--h3-font-size);
|
|
190
255
|
line-height: var(--h3-code-line-height);
|
|
191
256
|
}
|
|
192
257
|
|
|
193
|
-
h4.
|
|
258
|
+
h4.${constants_1.MARKDOWN_CLASS_NAME} code {
|
|
194
259
|
font-size: var(--h4-font-size);
|
|
195
260
|
line-height: var(--h4-code-line-height);
|
|
196
261
|
}
|
|
197
262
|
|
|
198
|
-
h5.
|
|
263
|
+
h5.${constants_1.MARKDOWN_CLASS_NAME} code {
|
|
199
264
|
font-size: var(--h5-font-size);
|
|
200
265
|
line-height: var(--h5-code-line-height);
|
|
201
266
|
}
|
|
202
267
|
|
|
203
|
-
h6.
|
|
268
|
+
h6.${constants_1.MARKDOWN_CLASS_NAME} code {
|
|
204
269
|
font-size: var(--h6-font-size);
|
|
205
270
|
line-height: var(--h6-code-line-height);
|
|
206
271
|
}
|
|
272
|
+
/* Deprecated legacy heading styles end. */
|
|
207
273
|
|
|
208
274
|
code {
|
|
209
275
|
color: var(--inline-code-text-color);
|
|
@@ -267,8 +333,8 @@ exports.Markdown = styled_components_1.default.main.attrs(({ className }) => ({
|
|
|
267
333
|
}
|
|
268
334
|
}
|
|
269
335
|
|
|
270
|
-
ul.
|
|
271
|
-
ol.
|
|
336
|
+
ul.${constants_1.MARKDOWN_CLASS_NAME},
|
|
337
|
+
ol.${constants_1.MARKDOWN_CLASS_NAME} {
|
|
272
338
|
padding-left: var(--md-list-left-padding);
|
|
273
339
|
margin: var(--md-list-margin);
|
|
274
340
|
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.markdownBaseTableCss = void 0;
|
|
4
4
|
const styled_components_1 = require("styled-components");
|
|
5
|
+
const constants_1 = require("../../../core/constants");
|
|
5
6
|
exports.markdownBaseTableCss = (0, styled_components_1.css) `
|
|
6
7
|
.md-table-wrapper {
|
|
7
8
|
overflow-x: auto;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
table.
|
|
11
|
+
table.${constants_1.MARKDOWN_CLASS_NAME} {
|
|
11
12
|
width: 100%;
|
|
12
13
|
overflow: hidden;
|
|
13
14
|
word-break: keep-all;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { FlattenSimpleInterpolation } from 'styled-components';
|
|
2
|
-
export declare function headingAnchorCss(className
|
|
2
|
+
export declare function headingAnchorCss(className: string): FlattenSimpleInterpolation;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.headingAnchorCss = headingAnchorCss;
|
|
4
4
|
const styled_components_1 = require("styled-components");
|
|
5
|
-
function headingAnchorCss(className
|
|
5
|
+
function headingAnchorCss(className) {
|
|
6
6
|
return (0, styled_components_1.css) `
|
|
7
7
|
.${className}.before {
|
|
8
8
|
position: absolute;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.search = void 0;
|
|
4
4
|
const styled_components_1 = require("styled-components");
|
|
5
|
-
/* eslint-disable theme/no-raw-colors-in-styles */
|
|
6
5
|
exports.search = (0, styled_components_1.css) `
|
|
7
6
|
/**
|
|
8
7
|
* @tokens Search
|
|
@@ -148,7 +147,7 @@ exports.search = (0, styled_components_1.css) `
|
|
|
148
147
|
* @tokens AI Search
|
|
149
148
|
*/
|
|
150
149
|
|
|
151
|
-
--search-ai-gradient: linear-gradient(to right,
|
|
150
|
+
--search-ai-gradient: linear-gradient(to right, var(--search-ai-gradient-start-color, var(--search-ai-gradient-start-color-legacy)), var(--search-ai-gradient-end-color, var(--search-ai-gradient-end-color-legacy)));
|
|
152
151
|
|
|
153
152
|
--search-ai-response-padding: var(--spacing-lg);
|
|
154
153
|
--search-ai-response-gap: var(--spacing-sm);
|
|
@@ -264,5 +263,4 @@ exports.search = (0, styled_components_1.css) `
|
|
|
264
263
|
|
|
265
264
|
// @tokens End
|
|
266
265
|
`;
|
|
267
|
-
/* eslint-enable theme/no-raw-colors-in-styles */
|
|
268
266
|
//# sourceMappingURL=variables.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const HEADING_ANCHOR_CLASS = "heading-anchor";
|
|
2
|
+
export declare const ANCHOR_CLASS = "anchor";
|
|
3
|
+
export declare const HEADING_CLASS_PREFIX = "heading-level";
|
|
4
|
+
export declare const H1_CLASS = "heading-level-1";
|
|
5
|
+
export declare const H2_CLASS = "heading-level-2";
|
|
6
|
+
export declare const H3_CLASS = "heading-level-3";
|
|
7
|
+
export declare const H4_CLASS = "heading-level-4";
|
|
8
|
+
export declare const H5_CLASS = "heading-level-5";
|
|
9
|
+
export declare const H6_CLASS = "heading-level-6";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.H6_CLASS = exports.H5_CLASS = exports.H4_CLASS = exports.H3_CLASS = exports.H2_CLASS = exports.H1_CLASS = exports.HEADING_CLASS_PREFIX = exports.ANCHOR_CLASS = exports.HEADING_ANCHOR_CLASS = void 0;
|
|
4
|
+
exports.HEADING_ANCHOR_CLASS = 'heading-anchor';
|
|
5
|
+
exports.ANCHOR_CLASS = 'anchor';
|
|
6
|
+
exports.HEADING_CLASS_PREFIX = 'heading-level';
|
|
7
|
+
exports.H1_CLASS = `${exports.HEADING_CLASS_PREFIX}-1`;
|
|
8
|
+
exports.H2_CLASS = `${exports.HEADING_CLASS_PREFIX}-2`;
|
|
9
|
+
exports.H3_CLASS = `${exports.HEADING_CLASS_PREFIX}-3`;
|
|
10
|
+
exports.H4_CLASS = `${exports.HEADING_CLASS_PREFIX}-4`;
|
|
11
|
+
exports.H5_CLASS = `${exports.HEADING_CLASS_PREFIX}-5`;
|
|
12
|
+
exports.H6_CLASS = `${exports.HEADING_CLASS_PREFIX}-6`;
|
|
13
|
+
//# sourceMappingURL=heading.js.map
|
|
@@ -23,4 +23,6 @@ __exportStar(require("./breadcrumb"), exports);
|
|
|
23
23
|
__exportStar(require("./request-methods"), exports);
|
|
24
24
|
__exportStar(require("./mcp"), exports);
|
|
25
25
|
__exportStar(require("./feedback"), exports);
|
|
26
|
+
__exportStar(require("./heading"), exports);
|
|
27
|
+
__exportStar(require("./markdown"), exports);
|
|
26
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MARKDOWN_CLASS_NAME = "md";
|
|
@@ -4,6 +4,7 @@ exports.useActiveHeading = useActiveHeading;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const react_router_dom_1 = require("react-router-dom");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
|
+
const constants_1 = require("../constants");
|
|
7
8
|
function useActiveHeading(contentElement, displayedHeadings) {
|
|
8
9
|
const [heading, setHeading] = (0, react_1.useState)(undefined);
|
|
9
10
|
const [headingElements, setHeadingElements] = (0, react_1.useState)([]);
|
|
@@ -42,7 +43,7 @@ function useActiveHeading(contentElement, displayedHeadings) {
|
|
|
42
43
|
return headingElements.findIndex((item) => item.id === id);
|
|
43
44
|
}, [headingElements]);
|
|
44
45
|
const findHeaders = (allContent) => {
|
|
45
|
-
const allHeaders = allContent.querySelectorAll(
|
|
46
|
+
const allHeaders = allContent.querySelectorAll(`.${constants_1.HEADING_ANCHOR_CLASS}`);
|
|
46
47
|
const headers = Array.from(allHeaders);
|
|
47
48
|
if (displayedHeadingsRef.current && displayedHeadingsRef.current.length > 0) {
|
|
48
49
|
const displayedIds = displayedHeadingsRef.current.map((h) => h === null || h === void 0 ? void 0 : h.id).filter(Boolean);
|
|
@@ -22,6 +22,9 @@ function brandPaletteDark(palette) {
|
|
|
22
22
|
--color-brand-subtle-3: #55576166;
|
|
23
23
|
--color-brand-subtle-4: #6e6f7a66;
|
|
24
24
|
--text-color-on-color: #000000;
|
|
25
|
+
|
|
26
|
+
--search-ai-gradient-start-color: var(--color-brand-3);
|
|
27
|
+
--search-ai-gradient-end-color: var(--color-brand-7);
|
|
25
28
|
`;
|
|
26
29
|
case 'pink':
|
|
27
30
|
return (0, styled_components_1.css) `
|
|
@@ -41,6 +44,9 @@ function brandPaletteDark(palette) {
|
|
|
41
44
|
--color-brand-subtle-3: #85366866;
|
|
42
45
|
--color-brand-subtle-4: #a03a7b66;
|
|
43
46
|
--text-color-on-color: #ffffff;
|
|
47
|
+
|
|
48
|
+
--search-ai-gradient-start-color: var(--color-brand-5); // @presenter Color
|
|
49
|
+
--search-ai-gradient-end-color: var(--color-brand-8); // @presenter Color
|
|
44
50
|
`;
|
|
45
51
|
case 'coral':
|
|
46
52
|
return (0, styled_components_1.css) `
|
|
@@ -60,6 +66,9 @@ function brandPaletteDark(palette) {
|
|
|
60
66
|
--color-brand-subtle-3: #8b3c4266;
|
|
61
67
|
--color-brand-subtle-4: #a9434c66;
|
|
62
68
|
--text-color-on-color: #ffffff;
|
|
69
|
+
|
|
70
|
+
--search-ai-gradient-start-color: var(--color-brand-4); // @presenter Color
|
|
71
|
+
--search-ai-gradient-end-color: var(--color-brand-8); // @presenter Color
|
|
63
72
|
`;
|
|
64
73
|
case 'amber':
|
|
65
74
|
return (0, styled_components_1.css) `
|
|
@@ -79,6 +88,9 @@ function brandPaletteDark(palette) {
|
|
|
79
88
|
--color-brand-subtle-3: #93632f66;
|
|
80
89
|
--color-brand-subtle-4: #b6732a66;
|
|
81
90
|
--text-color-on-color: #ffffff;
|
|
91
|
+
|
|
92
|
+
--search-ai-gradient-start-color: var(--color-brand-5); // @presenter Color
|
|
93
|
+
--search-ai-gradient-end-color: var(--color-brand-8); // @presenter Color
|
|
82
94
|
`;
|
|
83
95
|
case 'jade':
|
|
84
96
|
return (0, styled_components_1.css) `
|
|
@@ -98,6 +110,9 @@ function brandPaletteDark(palette) {
|
|
|
98
110
|
--color-brand-subtle-3: #2b715e66;
|
|
99
111
|
--color-brand-subtle-4: #2b816b66;
|
|
100
112
|
--text-color-on-color: #ffffff;
|
|
113
|
+
|
|
114
|
+
--search-ai-gradient-start-color: var(--color-brand-4);
|
|
115
|
+
--search-ai-gradient-end-color: var(--color-brand-7);
|
|
101
116
|
`;
|
|
102
117
|
case 'cyan':
|
|
103
118
|
return (0, styled_components_1.css) `
|
|
@@ -117,6 +132,9 @@ function brandPaletteDark(palette) {
|
|
|
117
132
|
--color-brand-subtle-3: #246e7f66;
|
|
118
133
|
--color-brand-subtle-4: #1b809766;
|
|
119
134
|
--text-color-on-color: #ffffff;
|
|
135
|
+
|
|
136
|
+
--search-ai-gradient-start-color: var(--color-brand-4); // @presenter Color
|
|
137
|
+
--search-ai-gradient-end-color: var(--color-brand-8); // @presenter Color
|
|
120
138
|
`;
|
|
121
139
|
case 'ocean':
|
|
122
140
|
return (0, styled_components_1.css) `
|
|
@@ -136,6 +154,9 @@ function brandPaletteDark(palette) {
|
|
|
136
154
|
--color-brand-subtle-3: #2a679566;
|
|
137
155
|
--color-brand-subtle-4: #2277b966;
|
|
138
156
|
--text-color-on-color: #ffffff;
|
|
157
|
+
|
|
158
|
+
--search-ai-gradient-start-color: var(--color-brand-4); // @presenter Color
|
|
159
|
+
--search-ai-gradient-end-color: var(--color-brand-8); // @presenter Color
|
|
139
160
|
`;
|
|
140
161
|
case 'indigo':
|
|
141
162
|
return (0, styled_components_1.css) `
|
|
@@ -155,6 +176,9 @@ function brandPaletteDark(palette) {
|
|
|
155
176
|
--color-brand-subtle-3: #36498866;
|
|
156
177
|
--color-brand-subtle-4: #3952a466;
|
|
157
178
|
--text-color-on-color: #ffffff;
|
|
179
|
+
|
|
180
|
+
--search-ai-gradient-start-color: var(--color-brand-4); // @presenter Color
|
|
181
|
+
--search-ai-gradient-end-color: var(--color-brand-8); // @presenter Color
|
|
158
182
|
`;
|
|
159
183
|
case 'iris':
|
|
160
184
|
return (0, styled_components_1.css) `
|
|
@@ -174,6 +198,9 @@ function brandPaletteDark(palette) {
|
|
|
174
198
|
--color-brand-subtle-3: #43438580;
|
|
175
199
|
--color-brand-subtle-4: #4c4ca080;
|
|
176
200
|
--text-color-on-color: #ffffff;
|
|
201
|
+
|
|
202
|
+
--search-ai-gradient-start-color: var(--color-brand-4); // @presenter Color
|
|
203
|
+
--search-ai-gradient-end-color: var(--color-brand-8); // @presenter Color
|
|
177
204
|
`;
|
|
178
205
|
default:
|
|
179
206
|
return (0, styled_components_1.css) `
|
|
@@ -20,6 +20,9 @@ function brandPaletteLight(palette) {
|
|
|
20
20
|
--text-color-on-color: #ffffff; // @presenter Color
|
|
21
21
|
|
|
22
22
|
--link-color-primary-palette: var(--text-color-primary); // @presenter Color
|
|
23
|
+
|
|
24
|
+
--search-ai-gradient-start-color: var(--color-brand-10); // @presenter Color
|
|
25
|
+
--search-ai-gradient-end-color: var(--color-brand-7); // @presenter Color
|
|
23
26
|
`;
|
|
24
27
|
case 'pink':
|
|
25
28
|
return (0, styled_components_1.css) `
|
|
@@ -37,6 +40,9 @@ function brandPaletteLight(palette) {
|
|
|
37
40
|
--text-color-on-color: #ffffff; // @presenter Color
|
|
38
41
|
|
|
39
42
|
--link-color-primary-palette: var(--text-color-primary); // @presenter Color
|
|
43
|
+
|
|
44
|
+
--search-ai-gradient-start-color: var(--color-brand-7); // @presenter Color
|
|
45
|
+
--search-ai-gradient-end-color: var(--color-brand-4); // @presenter Color
|
|
40
46
|
`;
|
|
41
47
|
case 'coral':
|
|
42
48
|
return (0, styled_components_1.css) `
|
|
@@ -54,6 +60,9 @@ function brandPaletteLight(palette) {
|
|
|
54
60
|
--text-color-on-color: #ffffff; // @presenter Color
|
|
55
61
|
|
|
56
62
|
--link-color-primary-palette: var(--text-color-primary); // @presenter Color
|
|
63
|
+
|
|
64
|
+
--search-ai-gradient-start-color: var(--color-brand-8); // @presenter Color
|
|
65
|
+
--search-ai-gradient-end-color: var(--color-brand-4); // @presenter Color
|
|
57
66
|
`;
|
|
58
67
|
case 'amber':
|
|
59
68
|
return (0, styled_components_1.css) `
|
|
@@ -71,6 +80,9 @@ function brandPaletteLight(palette) {
|
|
|
71
80
|
--text-color-on-color: #ffffff; // @presenter Color
|
|
72
81
|
|
|
73
82
|
--link-color-primary-palette: var(--text-color-primary); // @presenter Color
|
|
83
|
+
|
|
84
|
+
--search-ai-gradient-start-color: var(--color-brand-7); // @presenter Color
|
|
85
|
+
--search-ai-gradient-end-color: var(--color-brand-4); // @presenter Color
|
|
74
86
|
`;
|
|
75
87
|
case 'jade':
|
|
76
88
|
return (0, styled_components_1.css) `
|
|
@@ -88,6 +100,9 @@ function brandPaletteLight(palette) {
|
|
|
88
100
|
--text-color-on-color: #ffffff; // @presenter Color
|
|
89
101
|
|
|
90
102
|
--link-color-primary-palette: var(--text-color-primary); // @presenter Color
|
|
103
|
+
|
|
104
|
+
--search-ai-gradient-start-color: var(--color-brand-8); // @presenter Color
|
|
105
|
+
--search-ai-gradient-end-color: var(--color-brand-5); // @presenter Color
|
|
91
106
|
`;
|
|
92
107
|
case 'cyan':
|
|
93
108
|
return (0, styled_components_1.css) `
|
|
@@ -105,6 +120,9 @@ function brandPaletteLight(palette) {
|
|
|
105
120
|
--text-color-on-color: #ffffff; // @presenter Color
|
|
106
121
|
|
|
107
122
|
--link-color-primary-palette: var(--text-color-primary); // @presenter Color
|
|
123
|
+
|
|
124
|
+
--search-ai-gradient-start-color: var(--color-brand-8); // @presenter Color
|
|
125
|
+
--search-ai-gradient-end-color: var(--color-brand-4); // @presenter Color
|
|
108
126
|
`;
|
|
109
127
|
case 'ocean':
|
|
110
128
|
return (0, styled_components_1.css) `
|
|
@@ -122,6 +140,9 @@ function brandPaletteLight(palette) {
|
|
|
122
140
|
--text-color-on-color: #ffffff; // @presenter Color
|
|
123
141
|
|
|
124
142
|
--link-color-primary-palette: var(--text-color-primary); // @presenter Color
|
|
143
|
+
|
|
144
|
+
--search-ai-gradient-start-color: var(--color-brand-8); // @presenter Color
|
|
145
|
+
--search-ai-gradient-end-color: var(--color-brand-4); // @presenter Color
|
|
125
146
|
`;
|
|
126
147
|
case 'indigo':
|
|
127
148
|
return (0, styled_components_1.css) `
|
|
@@ -139,6 +160,9 @@ function brandPaletteLight(palette) {
|
|
|
139
160
|
--text-color-on-color: #ffffff; // @presenter Color
|
|
140
161
|
|
|
141
162
|
--link-color-primary-palette: var(--text-color-primary); // @presenter Color
|
|
163
|
+
|
|
164
|
+
--search-ai-gradient-start-color: var(--color-brand-8); // @presenter Color
|
|
165
|
+
--search-ai-gradient-end-color: var(--color-brand-4); // @presenter Color
|
|
142
166
|
`;
|
|
143
167
|
case 'iris':
|
|
144
168
|
return (0, styled_components_1.css) `
|
|
@@ -156,6 +180,9 @@ function brandPaletteLight(palette) {
|
|
|
156
180
|
--text-color-on-color: #ffffff; // @presenter Color
|
|
157
181
|
|
|
158
182
|
--link-color-primary-palette: var(--text-color-primary); // @presenter Color
|
|
183
|
+
|
|
184
|
+
--search-ai-gradient-start-color: var(--color-brand-8); // @presenter Color
|
|
185
|
+
--search-ai-gradient-end-color: var(--color-brand-4); // @presenter Color
|
|
159
186
|
`;
|
|
160
187
|
default:
|
|
161
188
|
return (0, styled_components_1.css) `
|
|
@@ -202,6 +229,9 @@ function brandPaletteLight(palette) {
|
|
|
202
229
|
--link-color-primary-hover-legacy: var(--color-blue-7); // @presenter Color
|
|
203
230
|
--link-color-primary-pressed-legacy: var(--color-blue-8); // @presenter Color
|
|
204
231
|
--link-color-visited-legacy: var(--color-purple-7); // @presenter Color
|
|
232
|
+
|
|
233
|
+
--search-ai-gradient-start-color-legacy: #715efe; // @presenter Color
|
|
234
|
+
--search-ai-gradient-end-color-legacy: #ff5cdc; // @presenter Color
|
|
205
235
|
`;
|
|
206
236
|
}
|
|
207
237
|
}
|
|
@@ -68,8 +68,8 @@ const Icon = (props) => {
|
|
|
68
68
|
return (react_1.default.createElement("svg", Object.assign({ viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, restProps),
|
|
69
69
|
!isColorOverridden && (react_1.default.createElement("defs", null,
|
|
70
70
|
react_1.default.createElement("linearGradient", { id: "gradient", x1: "0", y1: "0", x2: "1", y2: "0" },
|
|
71
|
-
react_1.default.createElement("stop", { offset: "0%", stopColor: "
|
|
72
|
-
react_1.default.createElement("stop", { offset: "100%", stopColor: "
|
|
71
|
+
react_1.default.createElement("stop", { offset: "0%", stopColor: "var(--search-ai-gradient-start-color, var(--search-ai-gradient-start-color-legacy))" }),
|
|
72
|
+
react_1.default.createElement("stop", { offset: "100%", stopColor: "var(--search-ai-gradient-end-color, var(--search-ai-gradient-end-color-legacy))" })))),
|
|
73
73
|
react_1.default.createElement("path", { d: "M11.2597 9.12114C8.08498 8.40423 7.59322 7.91247 6.87631 4.73772C6.84346 4.59262 6.7143 4.48929 6.56505 4.48929C6.4158 4.48929 6.28664 4.59262 6.2538 4.73772C5.53657 7.91247 5.04513 8.40423 1.87038 9.12114C1.72495 9.1543 1.62163 9.28314 1.62163 9.43239C1.62163 9.58164 1.72495 9.71048 1.87038 9.74365C5.04513 10.4609 5.53657 10.9526 6.2538 14.1271C6.28664 14.2722 6.4158 14.3755 6.56505 14.3755C6.7143 14.3755 6.84346 14.2722 6.87631 14.1271C7.59354 10.9526 8.08498 10.4609 11.2597 9.74365C11.4052 9.71048 11.5082 9.58164 11.5082 9.43239C11.5082 9.28314 11.4048 9.1543 11.2597 9.12114Z", fill: fill }),
|
|
74
74
|
react_1.default.createElement("path", { d: "M14.1299 4.17834C12.4423 3.79725 12.2053 3.5603 11.8242 1.87294C11.7911 1.72752 11.6622 1.62451 11.513 1.62451C11.3637 1.62451 11.2349 1.72752 11.2017 1.87294C10.8206 3.5603 10.5837 3.79725 8.8963 4.17834C8.75088 4.21151 8.64787 4.34035 8.64787 4.4896C8.64787 4.63885 8.75088 4.76769 8.8963 4.80086C10.5837 5.18195 10.8206 5.4189 11.2017 7.10658C11.2349 7.25168 11.3637 7.35501 11.513 7.35501C11.6622 7.35501 11.7911 7.25168 11.8242 7.10658C12.2053 5.4189 12.4423 5.18195 14.1299 4.80086C14.275 4.76769 14.3784 4.63885 14.3784 4.4896C14.3784 4.34035 14.275 4.21151 14.1299 4.17834Z", fill: fill })));
|
|
75
75
|
};
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.CodeWalkthroughLayout = CodeWalkthroughLayout;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const constants_1 = require("../core/constants");
|
|
9
10
|
const utils_1 = require("../core/utils");
|
|
10
11
|
function CodeWalkthroughLayout({ className, children, }) {
|
|
11
12
|
return (react_1.default.createElement(LayoutWrapper, { "data-component-name": "Layout/CodeWalkthroughLayout", className: className },
|
|
@@ -66,7 +67,8 @@ const ContentWrapper = styled_components_1.default.section `
|
|
|
66
67
|
margin-right: auto;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
&:first-child > h1:first-child
|
|
70
|
+
&:first-child > h1:first-child,
|
|
71
|
+
&:first-child > .${constants_1.H1_CLASS}:first-child {
|
|
70
72
|
// disable margin top for h1 on the title heading
|
|
71
73
|
margin-top: 0;
|
|
72
74
|
}
|
|
@@ -7,6 +7,7 @@ exports.DocumentationLayout = DocumentationLayout;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const utils_1 = require("../core/utils");
|
|
10
|
+
const constants_1 = require("../core/constants");
|
|
10
11
|
const CodeSnippetContext_1 = require("../core/contexts/CodeSnippetContext");
|
|
11
12
|
const DocumentationLayoutTop_1 = require("../layouts/DocumentationLayoutTop");
|
|
12
13
|
const DocumentationLayoutBottom_1 = require("../layouts/DocumentationLayoutBottom");
|
|
@@ -41,7 +42,8 @@ const ContentWrapper = styled_components_1.default.section `
|
|
|
41
42
|
|
|
42
43
|
padding: var(--md-content-padding);
|
|
43
44
|
|
|
44
|
-
article:first-child > h1:first-child
|
|
45
|
+
article:first-child > h1:first-child,
|
|
46
|
+
article:first-child > .${constants_1.H1_CLASS}:first-child {
|
|
45
47
|
// disable margin top for h1 on the title heading
|
|
46
48
|
margin-top: 0;
|
|
47
49
|
}
|
|
@@ -45,6 +45,7 @@ const utils_1 = require("../../../core/utils");
|
|
|
45
45
|
const LinkIcon_1 = require("../../../icons/LinkIcon/LinkIcon");
|
|
46
46
|
const PageActions_1 = require("../../../components/PageActions/PageActions");
|
|
47
47
|
const hooks_1 = require("../../../core/hooks");
|
|
48
|
+
const constants_1 = require("../../../core/constants");
|
|
48
49
|
function renderWithSpanWrapper(children) {
|
|
49
50
|
const childrenArray = react_1.default.Children.toArray(children);
|
|
50
51
|
if (childrenArray.length === 0)
|
|
@@ -65,47 +66,34 @@ function renderWithSpanWrapper(children) {
|
|
|
65
66
|
middleChildren.length > 0 && react_1.default.createElement(StyledHeadingText, null, middleChildren),
|
|
66
67
|
isImage(last) && last));
|
|
67
68
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Class name for all MD tags
|
|
70
|
-
*/
|
|
71
|
-
const mdClassName = 'md';
|
|
72
69
|
function Heading({ level, id, children, 'data-source': dataSource, 'data-hash': dataHash, className, __idx, }) {
|
|
73
70
|
var _a, _b;
|
|
74
71
|
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
75
72
|
const { usePageProps } = (0, hooks_1.useThemeHooks)();
|
|
76
73
|
const pageProps = usePageProps();
|
|
77
74
|
const isMarkdownPage = ((_a = pageProps === null || pageProps === void 0 ? void 0 : pageProps.metadata) === null || _a === void 0 ? void 0 : _a.type) === 'markdown' || ((_b = pageProps === null || pageProps === void 0 ? void 0 : pageProps.metadata) === null || _b === void 0 ? void 0 : _b.type) === 'asciidoc';
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
linkEl,
|
|
88
|
-
react_1.default.createElement("span", null, renderWithSpanWrapper(children)),
|
|
89
|
-
isMarkdownPage && __idx === 0 ? react_1.default.createElement(PageActions_1.PageActions, { pageSlug: pathname }) : null));
|
|
75
|
+
const headingTextId = `${id}-heading-text`;
|
|
76
|
+
const linkEl = (react_1.default.createElement("a", { "aria-labelledby": headingTextId, href: `#${id}`, className: (0, utils_1.concatClassNames)(constants_1.ANCHOR_CLASS, 'before') },
|
|
77
|
+
react_1.default.createElement(LinkIcon_1.LinkIcon, { "aria-hidden": "true", focusable: "false", color: "--heading-anchor-color" })));
|
|
78
|
+
const headingText = (0, react_1.createElement)(`h${level}`, { id: headingTextId }, renderWithSpanWrapper(children));
|
|
79
|
+
return (react_1.default.createElement("div", { id: id, className: (0, utils_1.concatClassNames)(constants_1.HEADING_ANCHOR_CLASS, constants_1.MARKDOWN_CLASS_NAME, `${constants_1.HEADING_CLASS_PREFIX}-${level}`, className), "data-component-name": "Markdoc/Heading/Heading", "data-source": dataSource, "data-hash": dataHash },
|
|
80
|
+
react_1.default.createElement(HeadingContentWrapper, null,
|
|
81
|
+
linkEl,
|
|
82
|
+
headingText,
|
|
83
|
+
isMarkdownPage && __idx === 0 ? react_1.default.createElement(PageActions_1.PageActions, { pageSlug: pathname }) : null)));
|
|
90
84
|
}
|
|
91
85
|
const HeadingContentWrapper = styled_components_1.default.div `
|
|
92
86
|
display: flex;
|
|
93
87
|
gap: var(--spacing-xs);
|
|
94
88
|
|
|
95
|
-
& > .
|
|
89
|
+
& > .${constants_1.ANCHOR_CLASS} {
|
|
96
90
|
display: flex;
|
|
97
91
|
align-items: center;
|
|
98
92
|
height: 1lh;
|
|
99
93
|
}
|
|
100
94
|
|
|
101
|
-
& > span {
|
|
102
|
-
display: flex;
|
|
103
|
-
align-items: flex-start;
|
|
104
|
-
gap: var(--spacing-sm);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
95
|
&:has([data-component-name='PageActions/PageActions']:hover) {
|
|
108
|
-
&& .
|
|
96
|
+
&& .${constants_1.ANCHOR_CLASS} svg {
|
|
109
97
|
visibility: hidden;
|
|
110
98
|
}
|
|
111
99
|
}
|
package/package.json
CHANGED