@redocly/theme 0.50.1 → 0.51.0-next.1
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/PageNavigation/NextButton.js +1 -2
- package/lib/components/PageNavigation/PreviousButton.js +2 -2
- package/lib/components/Search/SearchDialog.js +5 -5
- package/lib/core/hooks/code-walkthrough/use-code-panel.js +4 -3
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +5 -0
- package/lib/core/hooks/use-theme-hooks.js +1 -0
- package/lib/core/types/hooks.d.ts +5 -1
- package/lib/core/types/index.d.ts +0 -1
- package/lib/core/types/index.js +0 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.js +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +3 -2
- package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.js +1 -2
- package/package.json +3 -3
- package/src/components/PageNavigation/NextButton.tsx +2 -2
- package/src/components/PageNavigation/PreviousButton.tsx +3 -2
- package/src/components/Search/SearchDialog.tsx +5 -5
- package/src/core/hooks/code-walkthrough/use-code-panel.ts +4 -3
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +5 -0
- package/src/core/hooks/use-theme-hooks.ts +1 -0
- package/src/core/types/hooks.ts +9 -2
- package/src/core/types/index.ts +0 -1
- package/src/markdoc/components/CodeWalkthrough/CodePanelHeader.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +3 -1
- package/src/markdoc/components/CodeWalkthrough/CodeWalkthrough.tsx +1 -2
- package/lib/core/types/api-functions.d.ts +0 -5
- package/lib/core/types/api-functions.js +0 -3
- package/src/core/types/api-functions.ts +0 -5
|
@@ -41,9 +41,8 @@ function NextButton({ nextPage, className }) {
|
|
|
41
41
|
return React.createElement("div", null, "\u00A0");
|
|
42
42
|
}
|
|
43
43
|
const nextPageText = nextPage.label || nextPage.routeSlug || '';
|
|
44
|
-
const defaultLabel = ((_b = navigation === null || navigation === void 0 ? void 0 : navigation.nextButton) === null || _b === void 0 ? void 0 : _b.text) || 'Next page';
|
|
45
44
|
const translationKey = 'page.nextButton';
|
|
46
|
-
const label = translate(translationKey, { defaultValue:
|
|
45
|
+
const label = ((_b = navigation === null || navigation === void 0 ? void 0 : navigation.nextButton) === null || _b === void 0 ? void 0 : _b.text) || translate(translationKey, { defaultValue: 'Next page' });
|
|
47
46
|
return (React.createElement(NextButtonWrapper, { "data-component-name": "PageNavigation/NextButton", "data-translation-key": translationKey },
|
|
48
47
|
React.createElement(NextPageLabel, null, label),
|
|
49
48
|
React.createElement(NextPageButton, { size: "large", to: nextPage.link, extraClass: className, variant: "link", icon: React.createElement(ArrowRightIcon_1.ArrowRightIcon, null), iconPosition: "right" }, nextPageText)));
|
|
@@ -18,9 +18,9 @@ function PreviousButton({ prevPage, className }) {
|
|
|
18
18
|
return react_1.default.createElement("div", null, "\u00A0");
|
|
19
19
|
}
|
|
20
20
|
const prevPageText = prevPage.label || prevPage.routeSlug || '';
|
|
21
|
-
const defaultLabel = ((_b = navigation === null || navigation === void 0 ? void 0 : navigation.previousButton) === null || _b === void 0 ? void 0 : _b.text) || 'Previous page';
|
|
22
21
|
const translationKey = 'page.previousButton';
|
|
23
|
-
const label =
|
|
22
|
+
const label = ((_b = navigation === null || navigation === void 0 ? void 0 : navigation.previousButton) === null || _b === void 0 ? void 0 : _b.text) ||
|
|
23
|
+
translate(translationKey, { defaultValue: 'Previous page' });
|
|
24
24
|
return (react_1.default.createElement(PreviousButtonWrapper, { "data-component-name": "PageNavigation/PreviousButton", "data-translation-key": translationKey },
|
|
25
25
|
react_1.default.createElement(PreviousPageLabel, null, label),
|
|
26
26
|
react_1.default.createElement(PreviousPageButton, { size: "large", to: prevPage.link, extraClass: className, variant: "link", icon: react_1.default.createElement(ArrowLeftIcon_1.ArrowLeftIcon, null), iconPosition: "left" }, prevPageText)));
|
|
@@ -46,8 +46,8 @@ const SpinnerLoader_1 = require("../../components/Loaders/SpinnerLoader");
|
|
|
46
46
|
const SettingsIcon_1 = require("../../icons/SettingsIcon/SettingsIcon");
|
|
47
47
|
const AiStarsIcon_1 = require("../../icons/AiStarsIcon/AiStarsIcon");
|
|
48
48
|
function SearchDialog({ onClose, className }) {
|
|
49
|
-
const { useTranslate, useCurrentProduct, useSearch, useProducts, useAiSearch,
|
|
50
|
-
const
|
|
49
|
+
const { useTranslate, useCurrentProduct, useSearch, useProducts, useAiSearch, useOtelTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
50
|
+
const otelTelemetry = useOtelTelemetry();
|
|
51
51
|
const products = useProducts();
|
|
52
52
|
const currentProduct = useCurrentProduct();
|
|
53
53
|
const [product, setProduct] = (0, react_1.useState)(currentProduct);
|
|
@@ -79,11 +79,11 @@ function SearchDialog({ onClose, className }) {
|
|
|
79
79
|
: undefined;
|
|
80
80
|
}
|
|
81
81
|
return (react_1.default.createElement(SearchItem_1.SearchItem, { key: `${index}-${item.document.id}`, item: item, product: itemProduct, onClick: () => {
|
|
82
|
-
|
|
82
|
+
otelTelemetry.send('search.result.clicked', {
|
|
83
83
|
query,
|
|
84
84
|
url: item.document.url,
|
|
85
|
-
total_results: results.length,
|
|
86
|
-
index,
|
|
85
|
+
total_results: results.length.toString(),
|
|
86
|
+
index: index.toString(),
|
|
87
87
|
search_engine: mode,
|
|
88
88
|
});
|
|
89
89
|
} }));
|
|
@@ -82,9 +82,10 @@ function getCodeLinesFromNode(node, activeStep, areConditionsMet, populateInputs
|
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
84
|
const shouldRenderChunk = areConditionsMet(node.condition);
|
|
85
|
-
const isHighlighted =
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
const isHighlighted = parentHighlighted ||
|
|
86
|
+
(activeStep != null &&
|
|
87
|
+
node.condition.steps.length > 0 &&
|
|
88
|
+
node.condition.steps.includes(activeStep));
|
|
88
89
|
return shouldRenderChunk
|
|
89
90
|
? node.children.flatMap((child) => getCodeLinesFromNode(child, activeStep, areConditionsMet, populateInputsWithValue, isHighlighted))
|
|
90
91
|
: [];
|
|
@@ -75,6 +75,11 @@ function useCodeWalkthroughControls(filters, inputs, toggles, enableDeepLink) {
|
|
|
75
75
|
};
|
|
76
76
|
const walkthroughContext = (0, react_1.useMemo)(() => {
|
|
77
77
|
const areConditionsMet = (conditions) => (0, utils_1.matchCodeWalkthroughConditions)(conditions, controlsState);
|
|
78
|
+
// reset controls
|
|
79
|
+
for (const control of Object.values(controlsState)) {
|
|
80
|
+
control.render = true;
|
|
81
|
+
control.value = control.value || defaultControlsValues[control.type];
|
|
82
|
+
}
|
|
78
83
|
for (const [id, control] of Object.entries(controlsState)) {
|
|
79
84
|
if (control && !areConditionsMet(control)) {
|
|
80
85
|
controlsState[id].render = false;
|
|
@@ -9,6 +9,7 @@ const fallbacks = {
|
|
|
9
9
|
}),
|
|
10
10
|
useSubmitFeedback: () => ({ submitFeedback: () => { } }),
|
|
11
11
|
useTelemetry: () => ({ telemetry: () => { } }),
|
|
12
|
+
useOtelTelemetry: () => ({ send: () => { } }),
|
|
12
13
|
useBreadcrumbs: () => [],
|
|
13
14
|
useCodeHighlight: () => ({ highlight: (rawContent) => rawContent }),
|
|
14
15
|
useUserMenu: () => ({}),
|
|
@@ -100,6 +100,9 @@ export type ThemeHooks = {
|
|
|
100
100
|
useTelemetry: () => {
|
|
101
101
|
send(action: TelemetryEvent, data: unknown): void;
|
|
102
102
|
};
|
|
103
|
+
useOtelTelemetry: () => {
|
|
104
|
+
send(action: OtelTelemetryEvent, data: unknown): void;
|
|
105
|
+
};
|
|
103
106
|
useUserTeams: () => string[];
|
|
104
107
|
usePageProps: <T extends Record<string, unknown>>() => PageProps & T;
|
|
105
108
|
useCodeHighlight: () => {
|
|
@@ -123,5 +126,6 @@ export type L10nConfig = {
|
|
|
123
126
|
name: string;
|
|
124
127
|
}[];
|
|
125
128
|
};
|
|
126
|
-
type TelemetryEvent = 'search_opened' | 'client_error_caught' | 'breadcrumb_clicked' | 'color_mode_switched' | 'sidebar_item_clicked' | 'sidebar_item_expanded' | 'sidebar_item_collapsed' | 'edit_page_link_clicked' | 'code_snippet_copied' | 'code_snippet_reported' | 'feedback_sent' | 'navbar_menu_item_clicked' | 'login_button_clicked' | 'login_provider_button_clicked' | 'logout_menu_item_clicked' | 'logo_clicked' | 'toc_item_clicked' | 'version_switched' | 'catalog_filter_changed' | 'catalog_item_clicked' | 'scorecard_link_clicked' | 'markdown_anchor_link_clicked' | 'back_to_catalog_button_clicked' | 'sidebar_drilldown_back_button_clicked' | 'footer_item_clicked' | 'request_api_access_button_clicked' | 'sidebar_samples_button_clicked' | 'change_layout_button_clicked' | 'version_picker_selection_change' | 'openapi_docs' | 'replay' | 'catalog_actions_button_clicked' | 'catalog_item_clicked' | 'filter_checkbox_toggled' | 'language_picker_locale_changed' | 'mobile_menu_button_close_clicked' | 'mobile_menu_button_open_clicked' | 'search_input_reset_button_clicked' | 'search_recent_remove_button_clicked' | 'product_picked'
|
|
129
|
+
type TelemetryEvent = 'search_opened' | 'client_error_caught' | 'breadcrumb_clicked' | 'color_mode_switched' | 'sidebar_item_clicked' | 'sidebar_item_expanded' | 'sidebar_item_collapsed' | 'edit_page_link_clicked' | 'code_snippet_copied' | 'code_snippet_reported' | 'feedback_sent' | 'navbar_menu_item_clicked' | 'login_button_clicked' | 'login_provider_button_clicked' | 'logout_menu_item_clicked' | 'logo_clicked' | 'toc_item_clicked' | 'version_switched' | 'catalog_filter_changed' | 'catalog_item_clicked' | 'scorecard_link_clicked' | 'markdown_anchor_link_clicked' | 'back_to_catalog_button_clicked' | 'sidebar_drilldown_back_button_clicked' | 'footer_item_clicked' | 'request_api_access_button_clicked' | 'sidebar_samples_button_clicked' | 'change_layout_button_clicked' | 'version_picker_selection_change' | 'openapi_docs' | 'replay' | 'catalog_actions_button_clicked' | 'catalog_item_clicked' | 'filter_checkbox_toggled' | 'language_picker_locale_changed' | 'mobile_menu_button_close_clicked' | 'mobile_menu_button_open_clicked' | 'search_input_reset_button_clicked' | 'search_recent_remove_button_clicked' | 'product_picked';
|
|
130
|
+
type OtelTelemetryEvent = 'page.viewed' | 'error' | 'search.ai.query' | 'search.query' | 'search.result.clicked';
|
|
127
131
|
export {};
|
package/lib/core/types/index.js
CHANGED
|
@@ -26,5 +26,4 @@ __exportStar(require("../../core/types/select"), exports);
|
|
|
26
26
|
__exportStar(require("../../core/types/sidebar"), exports);
|
|
27
27
|
__exportStar(require("../../core/types/filter"), exports);
|
|
28
28
|
__exportStar(require("../../core/types/user-menu"), exports);
|
|
29
|
-
__exportStar(require("../../core/types/api-functions"), exports);
|
|
30
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -61,7 +61,7 @@ function CodePanelHeader({ files, handleTabSwitch, activeTabName, onDownloadCode
|
|
|
61
61
|
if (!tab)
|
|
62
62
|
continue;
|
|
63
63
|
const { left: tabLeft, right: tabRight } = tab.getBoundingClientRect();
|
|
64
|
-
const visible = tabLeft
|
|
64
|
+
const visible = tabLeft >= wrapperLeft && tabRight <= wrapperRight;
|
|
65
65
|
if (!visible) {
|
|
66
66
|
hidden.push(renderableFiles[i]);
|
|
67
67
|
}
|
|
@@ -53,7 +53,8 @@ function CodeStep({ id, heading, stepKey, when, unless, children, }) {
|
|
|
53
53
|
// If the step is active during first render, scroll to it
|
|
54
54
|
// This is to ensure that the step is visible when the page is loaded
|
|
55
55
|
if (isActive) {
|
|
56
|
-
|
|
56
|
+
// Ensure scrollMarginTop calculated before step being scrolled.
|
|
57
|
+
setTimeout(handleActivateStep, 5);
|
|
57
58
|
}
|
|
58
59
|
// Ignore dependency array because we only need to run this once
|
|
59
60
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -84,7 +85,7 @@ function CodeStep({ id, heading, stepKey, when, unless, children, }) {
|
|
|
84
85
|
}
|
|
85
86
|
return null;
|
|
86
87
|
}
|
|
87
|
-
return (react_1.default.createElement(exports.StepWrapper, { "data-component-name": "Markdoc/CodeWalkthrough/CodeStep", ref: compRef, isActive: isActive, scrollMarginTop: scrollMarginTop, "data-step-key": stepKey, "data-step-active": isActive, onClick: handleActivateStep, onFocus: handleActivateStep, tabIndex: 0 },
|
|
88
|
+
return (react_1.default.createElement(exports.StepWrapper, { "data-component-name": "Markdoc/CodeWalkthrough/CodeStep", ref: compRef, isActive: isActive, scrollMarginTop: scrollMarginTop, "data-step-key": stepKey, "data-step-active": isActive, onClick: handleActivateStep, onFocus: handleActivateStep, tabIndex: 0, className: "code-step-wrapper" },
|
|
88
89
|
react_1.default.createElement(StepContent, { isActive: isActive },
|
|
89
90
|
heading ? react_1.default.createElement(StepHeading, null, heading) : null,
|
|
90
91
|
children)));
|
|
@@ -44,7 +44,6 @@ const contexts_1 = require("../../../core/contexts");
|
|
|
44
44
|
const CodePanel_1 = require("../../../markdoc/components/CodeWalkthrough/CodePanel");
|
|
45
45
|
const hooks_1 = require("../../../core/hooks");
|
|
46
46
|
const CodeFilters_1 = require("../../../markdoc/components/CodeWalkthrough/CodeFilters");
|
|
47
|
-
const CodeStep_1 = require("../../../markdoc/components/CodeWalkthrough/CodeStep");
|
|
48
47
|
function CodeWalkthrough(_a) {
|
|
49
48
|
var { children, steps, preview } = _a, attributes = __rest(_a, ["children", "steps", "preview"]);
|
|
50
49
|
// Steps are being modified causing the observer to be recreated in the useCodeWalkthrough hook
|
|
@@ -95,7 +94,7 @@ const ContentWrapper = styled_components_1.default.div `
|
|
|
95
94
|
min-height: 0;
|
|
96
95
|
max-width: var(--md-content-max-width);
|
|
97
96
|
|
|
98
|
-
& > *:not(
|
|
97
|
+
& > *:not(.code-step-wrapper) {
|
|
99
98
|
padding-left: var(--spacing-xl);
|
|
100
99
|
}
|
|
101
100
|
overflow-y: scroll;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0-next.1",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -59,8 +59,6 @@
|
|
|
59
59
|
"jest-styled-components": "7.2.0",
|
|
60
60
|
"jest-when": "3.6.0",
|
|
61
61
|
"json-schema-to-ts": "2.7.2",
|
|
62
|
-
"lodash.debounce": "4.0.8",
|
|
63
|
-
"lodash.throttle": "4.1.1",
|
|
64
62
|
"npm-run-all2": "5.0.2",
|
|
65
63
|
"react-refresh": "0.14.2",
|
|
66
64
|
"react-router-dom": "6.21.1",
|
|
@@ -82,6 +80,8 @@
|
|
|
82
80
|
"highlight-words-core": "1.2.2",
|
|
83
81
|
"hotkeys-js": "3.10.1",
|
|
84
82
|
"jszip": "3.10.1",
|
|
83
|
+
"lodash.debounce": "4.0.8",
|
|
84
|
+
"lodash.throttle": "4.1.1",
|
|
85
85
|
"react-calendar": "4.2.1",
|
|
86
86
|
"react-date-picker": "10.0.3",
|
|
87
87
|
"timeago.js": "4.0.2",
|
|
@@ -22,9 +22,9 @@ export function NextButton({ nextPage, className }: NextPageType): JSX.Element {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const nextPageText = nextPage.label || nextPage.routeSlug || '';
|
|
25
|
-
const defaultLabel = navigation?.nextButton?.text || 'Next page';
|
|
26
25
|
const translationKey = 'page.nextButton';
|
|
27
|
-
const label =
|
|
26
|
+
const label =
|
|
27
|
+
navigation?.nextButton?.text || translate(translationKey, { defaultValue: 'Next page' });
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
30
|
<NextButtonWrapper
|
|
@@ -22,9 +22,10 @@ export function PreviousButton({ prevPage, className }: PreviousPageType): JSX.E
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const prevPageText = prevPage.label || prevPage.routeSlug || '';
|
|
25
|
-
const defaultLabel = navigation?.previousButton?.text || 'Previous page';
|
|
26
25
|
const translationKey = 'page.previousButton';
|
|
27
|
-
const label =
|
|
26
|
+
const label =
|
|
27
|
+
navigation?.previousButton?.text ||
|
|
28
|
+
translate(translationKey, { defaultValue: 'Previous page' });
|
|
28
29
|
|
|
29
30
|
return (
|
|
30
31
|
<PreviousButtonWrapper
|
|
@@ -27,9 +27,9 @@ export type SearchDialogProps = {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export function SearchDialog({ onClose, className }: SearchDialogProps): JSX.Element {
|
|
30
|
-
const { useTranslate, useCurrentProduct, useSearch, useProducts, useAiSearch,
|
|
30
|
+
const { useTranslate, useCurrentProduct, useSearch, useProducts, useAiSearch, useOtelTelemetry } =
|
|
31
31
|
useThemeHooks();
|
|
32
|
-
const
|
|
32
|
+
const otelTelemetry = useOtelTelemetry();
|
|
33
33
|
const products = useProducts();
|
|
34
34
|
const currentProduct = useCurrentProduct();
|
|
35
35
|
const [product, setProduct] = useState(currentProduct);
|
|
@@ -88,11 +88,11 @@ export function SearchDialog({ onClose, className }: SearchDialogProps): JSX.Ele
|
|
|
88
88
|
item={item}
|
|
89
89
|
product={itemProduct}
|
|
90
90
|
onClick={() => {
|
|
91
|
-
|
|
91
|
+
otelTelemetry.send('search.result.clicked', {
|
|
92
92
|
query,
|
|
93
93
|
url: item.document.url,
|
|
94
|
-
total_results: results.length,
|
|
95
|
-
index,
|
|
94
|
+
total_results: results.length.toString(),
|
|
95
|
+
index: index.toString(),
|
|
96
96
|
search_engine: mode,
|
|
97
97
|
});
|
|
98
98
|
}}
|
|
@@ -145,9 +145,10 @@ function getCodeLinesFromNode(
|
|
|
145
145
|
const shouldRenderChunk = areConditionsMet(node.condition);
|
|
146
146
|
|
|
147
147
|
const isHighlighted =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
parentHighlighted ||
|
|
149
|
+
(activeStep != null &&
|
|
150
|
+
node.condition.steps.length > 0 &&
|
|
151
|
+
node.condition.steps.includes(activeStep));
|
|
151
152
|
|
|
152
153
|
return shouldRenderChunk
|
|
153
154
|
? node.children.flatMap((child) =>
|
|
@@ -155,6 +155,11 @@ export function useCodeWalkthroughControls(
|
|
|
155
155
|
const walkthroughContext = useMemo(() => {
|
|
156
156
|
const areConditionsMet = (conditions: CodeWalkthroughConditionsObject) =>
|
|
157
157
|
matchCodeWalkthroughConditions(conditions, controlsState);
|
|
158
|
+
// reset controls
|
|
159
|
+
for (const control of Object.values(controlsState)) {
|
|
160
|
+
control.render = true;
|
|
161
|
+
control.value = control.value || defaultControlsValues[control.type];
|
|
162
|
+
}
|
|
158
163
|
|
|
159
164
|
for (const [id, control] of Object.entries(controlsState)) {
|
|
160
165
|
if (control && !areConditionsMet(control)) {
|
|
@@ -11,6 +11,7 @@ const fallbacks = {
|
|
|
11
11
|
}),
|
|
12
12
|
useSubmitFeedback: () => ({ submitFeedback: () => {} }),
|
|
13
13
|
useTelemetry: () => ({ telemetry: () => {} }),
|
|
14
|
+
useOtelTelemetry: () => ({ send: () => {} }),
|
|
14
15
|
useBreadcrumbs: () => [],
|
|
15
16
|
useCodeHighlight: () => ({ highlight: (rawContent: string) => rawContent }),
|
|
16
17
|
useUserMenu: () => ({}),
|
package/src/core/types/hooks.ts
CHANGED
|
@@ -112,6 +112,7 @@ export type ThemeHooks = {
|
|
|
112
112
|
| undefined;
|
|
113
113
|
useCatalog: (config: CatalogConfig) => FilteredCatalog;
|
|
114
114
|
useTelemetry: () => { send(action: TelemetryEvent, data: unknown): void };
|
|
115
|
+
useOtelTelemetry: () => { send(action: OtelTelemetryEvent, data: unknown): void };
|
|
115
116
|
useUserTeams: () => string[];
|
|
116
117
|
usePageProps: <T extends Record<string, unknown>>() => PageProps & T;
|
|
117
118
|
useCodeHighlight: () => {
|
|
@@ -175,5 +176,11 @@ type TelemetryEvent =
|
|
|
175
176
|
| 'mobile_menu_button_open_clicked'
|
|
176
177
|
| 'search_input_reset_button_clicked'
|
|
177
178
|
| 'search_recent_remove_button_clicked'
|
|
178
|
-
| 'product_picked'
|
|
179
|
-
|
|
179
|
+
| 'product_picked';
|
|
180
|
+
|
|
181
|
+
type OtelTelemetryEvent =
|
|
182
|
+
| 'page.viewed'
|
|
183
|
+
| 'error'
|
|
184
|
+
| 'search.ai.query'
|
|
185
|
+
| 'search.query'
|
|
186
|
+
| 'search.result.clicked';
|
package/src/core/types/index.ts
CHANGED
|
@@ -10,4 +10,3 @@ export * from '@redocly/theme/core/types/select';
|
|
|
10
10
|
export * from '@redocly/theme/core/types/sidebar';
|
|
11
11
|
export * from '@redocly/theme/core/types/filter';
|
|
12
12
|
export * from '@redocly/theme/core/types/user-menu';
|
|
13
|
-
export * from '@redocly/theme/core/types/api-functions';
|
|
@@ -57,7 +57,7 @@ export function CodePanelHeader({
|
|
|
57
57
|
if (!tab) continue;
|
|
58
58
|
|
|
59
59
|
const { left: tabLeft, right: tabRight } = tab.getBoundingClientRect();
|
|
60
|
-
const visible = tabLeft
|
|
60
|
+
const visible = tabLeft >= wrapperLeft && tabRight <= wrapperRight;
|
|
61
61
|
|
|
62
62
|
if (!visible) {
|
|
63
63
|
hidden.push(renderableFiles[i]);
|
|
@@ -49,7 +49,8 @@ export function CodeStep({
|
|
|
49
49
|
// If the step is active during first render, scroll to it
|
|
50
50
|
// This is to ensure that the step is visible when the page is loaded
|
|
51
51
|
if (isActive) {
|
|
52
|
-
|
|
52
|
+
// Ensure scrollMarginTop calculated before step being scrolled.
|
|
53
|
+
setTimeout(handleActivateStep, 5);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
// Ignore dependency array because we only need to run this once
|
|
@@ -97,6 +98,7 @@ export function CodeStep({
|
|
|
97
98
|
onClick={handleActivateStep}
|
|
98
99
|
onFocus={handleActivateStep}
|
|
99
100
|
tabIndex={0}
|
|
101
|
+
className="code-step-wrapper"
|
|
100
102
|
>
|
|
101
103
|
<StepContent isActive={isActive}>
|
|
102
104
|
{heading ? <StepHeading>{heading}</StepHeading> : null}
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
CodeFilters,
|
|
14
14
|
GetFilterState,
|
|
15
15
|
} from '@redocly/theme/markdoc/components/CodeWalkthrough/CodeFilters';
|
|
16
|
-
import { StepWrapper } from '@redocly/theme/markdoc/components/CodeWalkthrough/CodeStep';
|
|
17
16
|
|
|
18
17
|
export type CodeWalkthroughProps = PropsWithChildren<CodeWalkthroughAttr>;
|
|
19
18
|
|
|
@@ -92,7 +91,7 @@ const ContentWrapper = styled.div`
|
|
|
92
91
|
min-height: 0;
|
|
93
92
|
max-width: var(--md-content-max-width);
|
|
94
93
|
|
|
95
|
-
& > *:not(
|
|
94
|
+
& > *:not(.code-step-wrapper) {
|
|
96
95
|
padding-left: var(--spacing-xl);
|
|
97
96
|
}
|
|
98
97
|
overflow-y: scroll;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type { ApiFunctionsRequest as Request } from '@redocly/config';
|
|
2
|
-
export type { ApiFunctionsResponse as Response } from '@redocly/config';
|
|
3
|
-
export type { ApiFunctionsContext as Context } from '@redocly/config';
|
|
4
|
-
export type { PropsContext } from '@redocly/config';
|
|
5
|
-
export type { PageStaticData as PropsData } from '@redocly/config';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type { ApiFunctionsRequest as Request } from '@redocly/config';
|
|
2
|
-
export type { ApiFunctionsResponse as Response } from '@redocly/config';
|
|
3
|
-
export type { ApiFunctionsContext as Context } from '@redocly/config';
|
|
4
|
-
export type { PropsContext } from '@redocly/config';
|
|
5
|
-
export type { PageStaticData as PropsData } from '@redocly/config';
|