@redocly/theme 0.68.0-next.4 → 0.68.0-next.5
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/Button/ShowMoreToggleButton.d.ts +11 -0
- package/lib/components/Button/ShowMoreToggleButton.js +21 -0
- package/lib/components/CodeBlock/CodeBlock.d.ts +7 -1
- package/lib/components/CodeBlock/CodeBlock.js +30 -7
- package/lib/components/Dropdown/Dropdown.d.ts +2 -0
- package/lib/components/Dropdown/Dropdown.js +59 -14
- package/lib/components/Dropdown/variables.js +3 -1
- package/lib/components/Feedback/Feedback.js +1 -3
- package/lib/components/Feedback/Stars.js +1 -1
- package/lib/components/Footer/FooterItem.js +1 -1
- package/lib/components/JsonViewer/Helpers.d.ts +1 -0
- package/lib/components/JsonViewer/Helpers.js +20 -7
- package/lib/components/JsonViewer/JsonViewer.d.ts +2 -0
- package/lib/components/JsonViewer/JsonViewer.js +2 -2
- package/lib/components/LanguagePicker/LanguagePicker.js +3 -2
- package/lib/components/Markdown/Markdown.js +13 -6
- package/lib/components/Menu/MenuItem.d.ts +7 -1
- package/lib/components/Menu/MenuItem.js +43 -2
- package/lib/components/Navbar/NavbarItem.js +8 -3
- package/lib/components/PageActions/PageActions.js +1 -4
- package/lib/components/Panel/variables.js +1 -0
- package/lib/components/ReplayGate/ReplayGate.d.ts +12 -0
- package/lib/components/ReplayGate/ReplayGate.js +11 -0
- package/lib/components/ReplayTopBarActions/ReplayTopBarActions.d.ts +13 -0
- package/lib/components/ReplayTopBarActions/ReplayTopBarActions.js +7 -0
- package/lib/components/Search/SearchDialog.js +4 -4
- package/lib/core/hooks/use-active-section-id.d.ts +2 -0
- package/lib/core/hooks/use-active-section-id.js +11 -1
- package/lib/core/hooks/use-page-actions.js +10 -9
- package/lib/core/hooks/use-theme-hooks.js +1 -0
- package/lib/core/openapi/index.d.ts +1 -1
- package/lib/core/openapi/index.js +2 -1
- package/lib/core/styles/global.js +8 -0
- package/lib/core/types/hooks.d.ts +1 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/layouts/ThreePanelLayout.d.ts +5 -2
- package/package.json +2 -2
- package/src/components/Button/ShowMoreToggleButton.tsx +33 -0
- package/src/components/CodeBlock/CodeBlock.tsx +56 -12
- package/src/components/Dropdown/Dropdown.tsx +93 -21
- package/src/components/Dropdown/variables.ts +3 -1
- package/src/components/Feedback/Feedback.tsx +1 -3
- package/src/components/Feedback/Stars.tsx +1 -0
- package/src/components/Footer/FooterItem.tsx +3 -0
- package/src/components/JsonViewer/Helpers.tsx +41 -3
- package/src/components/JsonViewer/JsonViewer.tsx +4 -0
- package/src/components/LanguagePicker/LanguagePicker.tsx +3 -1
- package/src/components/Markdown/Markdown.tsx +13 -6
- package/src/components/Menu/MenuItem.tsx +47 -2
- package/src/components/Navbar/NavbarItem.tsx +10 -4
- package/src/components/PageActions/PageActions.tsx +3 -6
- package/src/components/Panel/variables.ts +1 -0
- package/src/components/ReplayGate/ReplayGate.tsx +18 -0
- package/src/components/ReplayTopBarActions/ReplayTopBarActions.tsx +14 -0
- package/src/components/Search/SearchDialog.tsx +4 -4
- package/src/core/hooks/use-active-section-id.ts +13 -1
- package/src/core/hooks/use-page-actions.ts +13 -11
- package/src/core/hooks/use-theme-hooks.ts +1 -0
- package/src/core/openapi/index.ts +1 -1
- package/src/core/styles/global.ts +8 -0
- package/src/core/types/hooks.ts +1 -0
- package/src/core/types/l10n.ts +39 -1
- package/src/layouts/ThreePanelLayout.tsx +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ReplayGateProps = {
|
|
3
|
+
setEnvironmentValues: (envName: string, values: Record<string, string | {
|
|
4
|
+
value: string;
|
|
5
|
+
isSecret?: boolean;
|
|
6
|
+
}>) => void;
|
|
7
|
+
setSelectedEnvironment: (envName: string) => void;
|
|
8
|
+
selectedEnvironment?: string;
|
|
9
|
+
apiId?: string;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export declare function ReplayGate({ children }: ReplayGateProps): React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ReplayGate = ReplayGate;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
function ReplayGate({ children }) {
|
|
9
|
+
return react_1.default.createElement(react_1.default.Fragment, null, children);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=ReplayGate.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ReplayTopBarActionsProps = {
|
|
2
|
+
environments: ReadonlyArray<{
|
|
3
|
+
name: string;
|
|
4
|
+
}>;
|
|
5
|
+
activeEnvironment: string;
|
|
6
|
+
setEnvironmentValues: (envName: string, values: Record<string, string | {
|
|
7
|
+
value: string;
|
|
8
|
+
isSecret?: boolean;
|
|
9
|
+
}>) => void;
|
|
10
|
+
setSelectedEnvironment: (envName: string) => void;
|
|
11
|
+
apiId?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function ReplayTopBarActions(_props: ReplayTopBarActionsProps): null;
|
|
@@ -324,12 +324,12 @@ const SearchDialogWrapper = styled_components_1.default.div `
|
|
|
324
324
|
|
|
325
325
|
@media screen and (min-width: ${utils_1.breakpoints.small}) {
|
|
326
326
|
border-radius: var(--search-modal-border-radius);
|
|
327
|
-
width: var(--search-modal-width);
|
|
328
|
-
min-height: var(--search-modal-min-height);
|
|
329
|
-
min-width: var(--search-modal-min-width);
|
|
327
|
+
width: min(var(--search-modal-width), 95vw);
|
|
328
|
+
min-height: min(var(--search-modal-min-height), 95vh);
|
|
329
|
+
min-width: min(var(--search-modal-min-width), 95vw);
|
|
330
330
|
max-width: 95vw;
|
|
331
331
|
max-height: 95vh;
|
|
332
|
-
height: var(--search-modal-min-height);
|
|
332
|
+
height: min(var(--search-modal-min-height), 95vh);
|
|
333
333
|
resize: both;
|
|
334
334
|
}
|
|
335
335
|
`;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { Location } from 'react-router-dom';
|
|
2
2
|
export type UseActiveSectionIdReturnType = string;
|
|
3
|
+
/** Px below the top where the active section is read (accounts for next-section visibility). */
|
|
4
|
+
export declare const SECTION_READING_LINE_OFFSET = 150;
|
|
3
5
|
export declare function useActiveSectionId(location: Location, hasOverviewPage?: boolean, withNavbar?: boolean, sectionOffset?: number): UseActiveSectionIdReturnType;
|
|
@@ -3,15 +3,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SECTION_READING_LINE_OFFSET = void 0;
|
|
6
7
|
exports.useActiveSectionId = useActiveSectionId;
|
|
7
8
|
const react_1 = require("react");
|
|
8
9
|
const lodash_throttle_1 = __importDefault(require("lodash.throttle"));
|
|
9
10
|
const use_navbar_height_1 = require("./use-navbar-height");
|
|
10
|
-
|
|
11
|
+
const dom_1 = require("../utils/dom");
|
|
12
|
+
/** Px below the top where the active section is read (accounts for next-section visibility). */
|
|
13
|
+
exports.SECTION_READING_LINE_OFFSET = 150;
|
|
14
|
+
function useActiveSectionId(location, hasOverviewPage = false, withNavbar = true, sectionOffset = exports.SECTION_READING_LINE_OFFSET) {
|
|
11
15
|
const [itemId, setItemId] = (0, react_1.useState)('');
|
|
12
16
|
const navbarHeight = (0, use_navbar_height_1.useNavbarHeight)(location);
|
|
13
17
|
const heightOffset = (withNavbar ? navbarHeight : 0) + sectionOffset;
|
|
14
18
|
const scrollListener = (0, react_1.useMemo)(() => (0, lodash_throttle_1.default)(() => {
|
|
19
|
+
if (!dom_1.IS_BROWSER) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
15
22
|
const sections = document.querySelectorAll('[data-section-id]');
|
|
16
23
|
if (sections.length < 2) {
|
|
17
24
|
setItemId('');
|
|
@@ -34,6 +41,9 @@ function useActiveSectionId(location, hasOverviewPage = false, withNavbar = true
|
|
|
34
41
|
}
|
|
35
42
|
}, 150), [heightOffset, hasOverviewPage]);
|
|
36
43
|
(0, react_1.useEffect)(() => {
|
|
44
|
+
if (!dom_1.IS_BROWSER) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
37
47
|
window.addEventListener('scroll', scrollListener, { capture: false });
|
|
38
48
|
setTimeout(() => {
|
|
39
49
|
scrollListener();
|
|
@@ -40,8 +40,9 @@ function usePageActions(pageSlug, mcpUrl, actions) {
|
|
|
40
40
|
const themeConfig = (0, use_theme_config_1.useThemeConfig)();
|
|
41
41
|
const pageProps = usePageProps();
|
|
42
42
|
const telemetry = useTelemetry();
|
|
43
|
-
const
|
|
44
|
-
const
|
|
43
|
+
const apiDocsSharedData = usePageSharedData('apiDocsStore');
|
|
44
|
+
const apiDocsExcludeFromSearch = (_a = apiDocsSharedData === null || apiDocsSharedData === void 0 ? void 0 : apiDocsSharedData.options) === null || _a === void 0 ? void 0 : _a.excludeFromSearch;
|
|
45
|
+
const isApiDocsPage = Boolean(apiDocsSharedData);
|
|
45
46
|
const mcpConfig = (0, use_mcp_config_1.useMCPConfig)();
|
|
46
47
|
const { isPublic } = usePageData() || {};
|
|
47
48
|
const createMCPHandler = (0, react_1.useCallback)((clientType, requiresMcpUrl = false) => () => {
|
|
@@ -66,7 +67,8 @@ function usePageActions(pageSlug, mcpUrl, actions) {
|
|
|
66
67
|
const hideActionContext = {
|
|
67
68
|
pageProps,
|
|
68
69
|
themeConfig,
|
|
69
|
-
|
|
70
|
+
apiDocsExcludeFromSearch,
|
|
71
|
+
isApiDocsPage,
|
|
70
72
|
isPublic,
|
|
71
73
|
mcpUrl,
|
|
72
74
|
isMcpDisabled: mcpConfig.isMcpDisabled,
|
|
@@ -157,7 +159,8 @@ function usePageActions(pageSlug, mcpUrl, actions) {
|
|
|
157
159
|
}, [
|
|
158
160
|
pageProps,
|
|
159
161
|
themeConfig,
|
|
160
|
-
|
|
162
|
+
apiDocsExcludeFromSearch,
|
|
163
|
+
isApiDocsPage,
|
|
161
164
|
isPublic,
|
|
162
165
|
mcpUrl,
|
|
163
166
|
mcpConfig.isMcpDisabled,
|
|
@@ -188,8 +191,8 @@ function createMCPAction({ clientType, mcpConfig, translate, onClickCallback, })
|
|
|
188
191
|
}
|
|
189
192
|
return Object.assign(Object.assign({}, sharedProps), { buttonText: translate('page.actions.connectMcp.vscode', 'Connect to VS Code'), title: translate('page.actions.connectMcp.vscode', 'Connect to VS Code'), description: translate('page.actions.connectMcp.vscodeDescription', 'Install MCP server on VS Code'), iconComponent: VSCodeIcon_1.VSCodeIcon });
|
|
190
193
|
}
|
|
191
|
-
function shouldHideAction(action, { pageProps, themeConfig,
|
|
192
|
-
var _a, _b, _c, _d, _e, _f
|
|
194
|
+
function shouldHideAction(action, { pageProps, themeConfig, apiDocsExcludeFromSearch, isApiDocsPage, isPublic, mcpUrl, isMcpDisabled, }) {
|
|
195
|
+
var _a, _b, _c, _d, _e, _f;
|
|
193
196
|
// Page actions are explicitly disabled in config
|
|
194
197
|
if ((_b = (_a = themeConfig.navigation) === null || _a === void 0 ? void 0 : _a.actions) === null || _b === void 0 ? void 0 : _b.hide) {
|
|
195
198
|
return true;
|
|
@@ -204,9 +207,7 @@ function shouldHideAction(action, { pageProps, themeConfig, openapiExcludeFromSe
|
|
|
204
207
|
if ((_e = (_d = pageProps === null || pageProps === void 0 ? void 0 : pageProps.seo) === null || _d === void 0 ? void 0 : _d.llmstxt) === null || _e === void 0 ? void 0 : _e.hide) {
|
|
205
208
|
return true;
|
|
206
209
|
}
|
|
207
|
-
const
|
|
208
|
-
((_g = pageProps === null || pageProps === void 0 ? void 0 : pageProps.metadata) === null || _g === void 0 ? void 0 : _g.subType) === 'openapi-operation';
|
|
209
|
-
const isPageExcludedFromSearch = ((_h = pageProps === null || pageProps === void 0 ? void 0 : pageProps.frontmatter) === null || _h === void 0 ? void 0 : _h.excludeFromSearch) || (isOpenApiPage && openapiExcludeFromSearch);
|
|
210
|
+
const isPageExcludedFromSearch = ((_f = pageProps === null || pageProps === void 0 ? void 0 : pageProps.frontmatter) === null || _f === void 0 ? void 0 : _f.excludeFromSearch) || (isApiDocsPage && apiDocsExcludeFromSearch);
|
|
210
211
|
if (isPageExcludedFromSearch) {
|
|
211
212
|
return true;
|
|
212
213
|
}
|
|
@@ -9,6 +9,7 @@ const fallbacks = {
|
|
|
9
9
|
useTranslate: () => ({
|
|
10
10
|
translate: (value, options) => (typeof options === 'string' ? options : options === null || options === void 0 ? void 0 : options.defaultValue) || value || '',
|
|
11
11
|
}),
|
|
12
|
+
useTranslationKeys: () => [],
|
|
12
13
|
useSubmitFeedback: () => ({ submitFeedback: () => { } }),
|
|
13
14
|
useTelemetry: use_telemetry_fallback_1.useTelemetryFallback,
|
|
14
15
|
/**
|
|
@@ -17,7 +17,7 @@ export { getUserAgent } from '../utils/get-user-agent';
|
|
|
17
17
|
export { useFocusTrap } from '../hooks/use-focus-trap';
|
|
18
18
|
export { useThemeHooks } from '../hooks/use-theme-hooks';
|
|
19
19
|
export { useOutsideClick } from '../hooks/use-outside-click';
|
|
20
|
-
export { useActiveSectionId } from '../hooks/use-active-section-id';
|
|
20
|
+
export { useActiveSectionId, SECTION_READING_LINE_OFFSET } from '../hooks/use-active-section-id';
|
|
21
21
|
export { useModalScrollLock } from '../hooks/use-modal-scroll-lock';
|
|
22
22
|
export { useSearchDialog } from '../hooks/search/use-search-dialog';
|
|
23
23
|
export { useDialogHotKeys } from '../hooks/use-dialog-hotkeys';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.trimText = exports.useUniqueSvgIds = exports.SearchSessionContext = exports.SearchSessionProvider = exports.ThemeDataContext = exports.isObject = exports.isNotNull = exports.isString = exports.isUndefined = exports.SecurityVariablesEnvSuffix = exports.useDialogHotKeys = exports.useSearchDialog = exports.useModalScrollLock = exports.useActiveSectionId = exports.useOutsideClick = exports.useThemeHooks = exports.useFocusTrap = exports.getUserAgent = exports.ClipboardService = exports.getOperationColor = exports.isPrimitive = exports.breakpoints = exports.GlobalStyle = exports.useMount = exports.typedMemo = exports.capitalize = exports.withPathPrefix = exports.addTrailingSlash = exports.combineUrls = exports.getPathPrefix = exports.removeLeadingSlash = exports.addLeadingSlash = exports.IS_BROWSER = void 0;
|
|
3
|
+
exports.trimText = exports.useUniqueSvgIds = exports.SearchSessionContext = exports.SearchSessionProvider = exports.ThemeDataContext = exports.isObject = exports.isNotNull = exports.isString = exports.isUndefined = exports.SecurityVariablesEnvSuffix = exports.useDialogHotKeys = exports.useSearchDialog = exports.useModalScrollLock = exports.SECTION_READING_LINE_OFFSET = exports.useActiveSectionId = exports.useOutsideClick = exports.useThemeHooks = exports.useFocusTrap = exports.getUserAgent = exports.ClipboardService = exports.getOperationColor = exports.isPrimitive = exports.breakpoints = exports.GlobalStyle = exports.useMount = exports.typedMemo = exports.capitalize = exports.withPathPrefix = exports.addTrailingSlash = exports.combineUrls = exports.getPathPrefix = exports.removeLeadingSlash = exports.addLeadingSlash = exports.IS_BROWSER = void 0;
|
|
4
4
|
var dom_1 = require("../utils/dom");
|
|
5
5
|
Object.defineProperty(exports, "IS_BROWSER", { enumerable: true, get: function () { return dom_1.IS_BROWSER; } });
|
|
6
6
|
var urls_1 = require("../utils/urls");
|
|
@@ -36,6 +36,7 @@ var use_outside_click_1 = require("../hooks/use-outside-click");
|
|
|
36
36
|
Object.defineProperty(exports, "useOutsideClick", { enumerable: true, get: function () { return use_outside_click_1.useOutsideClick; } });
|
|
37
37
|
var use_active_section_id_1 = require("../hooks/use-active-section-id");
|
|
38
38
|
Object.defineProperty(exports, "useActiveSectionId", { enumerable: true, get: function () { return use_active_section_id_1.useActiveSectionId; } });
|
|
39
|
+
Object.defineProperty(exports, "SECTION_READING_LINE_OFFSET", { enumerable: true, get: function () { return use_active_section_id_1.SECTION_READING_LINE_OFFSET; } });
|
|
39
40
|
var use_modal_scroll_lock_1 = require("../hooks/use-modal-scroll-lock");
|
|
40
41
|
Object.defineProperty(exports, "useModalScrollLock", { enumerable: true, get: function () { return use_modal_scroll_lock_1.useModalScrollLock; } });
|
|
41
42
|
var use_search_dialog_1 = require("../hooks/search/use-search-dialog");
|
|
@@ -825,6 +825,14 @@ const badges = (0, styled_components_1.css) `
|
|
|
825
825
|
--badge-deprecated-bg-color: var(--color-warning-base); // @presenter Color
|
|
826
826
|
--badge-deprecated-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
827
827
|
|
|
828
|
+
/**
|
|
829
|
+
* @tokens Webhook Badge
|
|
830
|
+
*/
|
|
831
|
+
|
|
832
|
+
--badge-webhook-text-color: var(--color-warm-grey-1); // @presenter Color
|
|
833
|
+
--badge-webhook-bg-color: var(--color-purple-7); // @presenter Color
|
|
834
|
+
--badge-webhook-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
835
|
+
|
|
828
836
|
/**
|
|
829
837
|
* @tokens Audience Badge
|
|
830
838
|
*/
|
package/lib/core/types/l10n.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TOptions } from 'i18next';
|
|
2
|
-
export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.create.app.dialog.callbackUrls' | 'dev.create.app.dialog.callbackUrls.placeholder' | 'dev.create.app.dialog.callbackUrls.hint' | 'dev.app.callbackUrls.title' | 'dev.edit.callbackUrls.dialog.title' | 'dev.edit.callbackUrls.dialog.placeholder' | 'dev.edit.callbackUrls.dialog.hint' | 'dev.edit.callbackUrls.dialog.save' | 'dev.edit.callbackUrls.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.error.title' | 'search.error.button' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.back' | 'search.ai.assistant' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.feedback.title' | 'search.ai.feedback.detailsPlaceholder' | 'search.ai.feedback.thanks' | 'search.ai.toolCall.executed' | 'search.ai.toolCall.executing' | 'search.ai.toolCall.withArgs' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'search.ai.feedback.more' | 'search.searchItem.deprecated' | 'search.groups.all' | 'search.filter.field.footer' | 'aiAssistant.trigger' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.forbidden.description' | 'page.notFound.title' | 'page.notFound.description' | 'page.mcpNotAllowed.title' | 'page.mcpNotAllowed.description' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.catalogs.dataSchema.title' | 'catalog.catalogs.dataSchema.description' | 'catalog.catalogs.dataSchema.switcherLabel' | 'catalog.catalogs.apiOperation.title' | 'catalog.catalogs.apiOperation.description' | 'catalog.catalogs.apiOperation.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.schema.title' | 'catalog.entity.properties.apiDescription.title' | 'catalog.backToAllLabel' | 'catalog.notConnected' | 'catalog.tags.label' | 'catalog.sort' | 'catalog.catalogs.label' | 'catalog.owners.label' | 'catalog.repositories.label' | 'catalog.email.label' | 'catalog.format.label' | 'catalog.entityType.label' | 'catalog.domains.label' | 'catalog.contact.label' | 'catalog.methodAndPath.label' | 'catalog.links.label' | 'catalog.metadata.domains' | 'catalog.metadata.owners' | 'catalog.history.button.label' | 'catalog.history.sidebar.title' | 'catalog.history.sidebar.close' | 'catalog.history.version.label' | 'catalog.filters.close' | 'catalog.history.version.notSpecified' | 'catalog.history.version.default' | 'catalog.history.revisions.limitMessage' | 'catalog.history.revision.current' | 'catalog.history.revisions.showLess' | 'catalog.history.revisions.showMore' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeToSingleColumn' | 'sidebar.actions.changeToTwoColumns' | 'sidebar.actions.singleColumn' | 'sidebar.actions.twoColumns' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.maxLength' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'codeSnippet.expand.tooltipText' | 'codeSnippet.collapse.tooltipText' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'page.actions.copyButtonText' | 'page.actions.copyTitle' | 'page.actions.copyDescription' | 'page.actions.viewAsMdTitle' | 'page.actions.viewAsMdButtonText' | 'page.actions.viewAsMdDescription' | 'page.actions.chatGptTitle' | 'page.actions.chatGptButtonText' | 'page.actions.chatGptDescription' | 'page.actions.claudeTitle' | 'page.actions.claudeButtonText' | 'page.actions.claudeDescription' | 'page.actions.cursorMcpButtonText' | 'page.actions.cursorMcpTitle' | 'page.actions.cursorMcpDescription' | 'page.actions.connectMcp' | 'page.actions.connectMcp.cursor' | 'page.actions.connectMcp.cursorDescription' | 'page.actions.connectMcp.vscode' | 'page.actions.connectMcp.vscodeDescription' | 'page.actions.connectMcp.copyConfig' | 'page.actions.connectMcp.copyConfigDescription' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.languages.moreButton.tooltipText' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.discriminator.searchPlaceholder' | 'openapi.discriminator.searchNoResults' | 'openapi.discriminator.defaultMapping' | 'openapi.discriminator.defaultMappingTooltip' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'openapi.schemaCatalogLink.title' | 'openapi.schemaCatalogLink.copyButtonTooltip' | 'openapi.schemaCatalogLink.copiedTooltip' | 'openapi.mcp.title' | 'openapi.mcp.endpoint' | 'openapi.mcp.tools' | 'openapi.mcp.protocolVersion' | 'openapi.mcp.capabilities' | 'openapi.mcp.experimentalCapabilities' | 'openapi.mcp.inputSchema' | 'openapi.mcp.inputExample' | 'openapi.mcp.outputSchema' | 'openapi.mcp.outputExample' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'graphql.download.description.title' | 'graphql.info.title' | 'graphql.info.contact.url' | 'graphql.info.contact.name' | 'graphql.info.license' | 'graphql.info.termsOfService' | 'graphql.overview' | 'graphql.metadata' | 'graphql.key' | 'graphql.value' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.requiredScopes' | 'graphql.viewSecurityDetails' | 'graphql.objectScopes' | 'graphql.fieldScopes' | 'graphql.implementedInterfaces' | 'graphql.implementedBy' | 'graphql.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'button.copy.tooltipText' | 'button.download.tooltipText' | 'button.externalLink.tooltipText' | 'button.email.tooltipText' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description' | 'page.skipToContent.label' | 'select.noResults' | 'loaders.loading' | 'filter.dateRange.from' | 'filter.dateRange.to' | 'diagram.openFullscreen' | 'diagram.zoomIn' | 'diagram.zoomOut' | 'diagram.reset' | 'diagram.close' | 'diagram.viewer';
|
|
2
|
+
export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.create.app.dialog.callbackUrls' | 'dev.create.app.dialog.callbackUrls.placeholder' | 'dev.create.app.dialog.callbackUrls.hint' | 'dev.app.callbackUrls.title' | 'dev.edit.callbackUrls.dialog.title' | 'dev.edit.callbackUrls.dialog.placeholder' | 'dev.edit.callbackUrls.dialog.hint' | 'dev.edit.callbackUrls.dialog.save' | 'dev.edit.callbackUrls.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.error.title' | 'search.error.button' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.back' | 'search.ai.assistant' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.feedback.title' | 'search.ai.feedback.detailsPlaceholder' | 'search.ai.feedback.thanks' | 'search.ai.toolCall.executed' | 'search.ai.toolCall.executing' | 'search.ai.toolCall.withArgs' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'search.ai.feedback.more' | 'search.searchItem.deprecated' | 'search.groups.all' | 'search.filter.field.footer' | 'aiAssistant.trigger' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.forbidden.description' | 'page.notFound.title' | 'page.notFound.description' | 'page.mcpNotAllowed.title' | 'page.mcpNotAllowed.description' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.catalogs.dataSchema.title' | 'catalog.catalogs.dataSchema.description' | 'catalog.catalogs.dataSchema.switcherLabel' | 'catalog.catalogs.apiOperation.title' | 'catalog.catalogs.apiOperation.description' | 'catalog.catalogs.apiOperation.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.schema.title' | 'catalog.entity.properties.apiDescription.title' | 'catalog.backToAllLabel' | 'catalog.notConnected' | 'catalog.tags.label' | 'catalog.sort' | 'catalog.catalogs.label' | 'catalog.owners.label' | 'catalog.repositories.label' | 'catalog.email.label' | 'catalog.format.label' | 'catalog.entityType.label' | 'catalog.domains.label' | 'catalog.contact.label' | 'catalog.methodAndPath.label' | 'catalog.links.label' | 'catalog.metadata.domains' | 'catalog.metadata.owners' | 'catalog.history.button.label' | 'catalog.history.sidebar.title' | 'catalog.history.sidebar.close' | 'catalog.history.version.label' | 'catalog.filters.close' | 'catalog.history.version.notSpecified' | 'catalog.history.version.default' | 'catalog.history.revisions.limitMessage' | 'catalog.history.revision.current' | 'catalog.history.revisions.showLess' | 'catalog.history.revisions.showMore' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeToSingleColumn' | 'sidebar.actions.changeToTwoColumns' | 'sidebar.actions.singleColumn' | 'sidebar.actions.twoColumns' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.maxLength' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'codeSnippet.expand.tooltipText' | 'codeSnippet.collapse.tooltipText' | 'jsonViewer.showMore' | 'jsonViewer.showLess' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'page.actions.copyButtonText' | 'page.actions.copyTitle' | 'page.actions.copyDescription' | 'page.actions.viewAsMdTitle' | 'page.actions.viewAsMdButtonText' | 'page.actions.viewAsMdDescription' | 'page.actions.chatGptTitle' | 'page.actions.chatGptButtonText' | 'page.actions.chatGptDescription' | 'page.actions.claudeTitle' | 'page.actions.claudeButtonText' | 'page.actions.claudeDescription' | 'page.actions.cursorMcpButtonText' | 'page.actions.cursorMcpTitle' | 'page.actions.cursorMcpDescription' | 'page.actions.connectMcp' | 'page.actions.connectMcp.cursor' | 'page.actions.connectMcp.cursorDescription' | 'page.actions.connectMcp.vscode' | 'page.actions.connectMcp.vscodeDescription' | 'page.actions.connectMcp.copyConfig' | 'page.actions.connectMcp.copyConfigDescription' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.languages.moreButton.tooltipText' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.schemas' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.querystring' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.property' | 'openapi.properties' | 'openapi.details' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.discriminator.searchPlaceholder' | 'openapi.discriminator.searchNoResults' | 'openapi.discriminator.defaultMapping' | 'openapi.discriminator.defaultMappingTooltip' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.noRequestData' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'openapi.schemaCatalogLink.title' | 'openapi.schemaCatalogLink.copyButtonTooltip' | 'openapi.schemaCatalogLink.copiedTooltip' | 'openapi.mcp.title' | 'openapi.mcp.endpoint' | 'openapi.mcp.tools' | 'openapi.mcp.protocolVersion' | 'openapi.mcp.capabilities' | 'openapi.mcp.experimentalCapabilities' | 'openapi.mcp.inputSchema' | 'openapi.mcp.inputExample' | 'openapi.mcp.outputSchema' | 'openapi.mcp.outputExample' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'asyncapi.info.contact.url' | 'asyncapi.info.contact.name' | 'asyncapi.info.license' | 'asyncapi.info.termsOfService' | 'asyncapi.key' | 'asyncapi.value' | 'asyncapi.variables' | 'asyncapi.required' | 'asyncapi.requiredScopes' | 'asyncapi.viewSecurityDetails' | 'graphql.download.description.title' | 'graphql.info.title' | 'graphql.info.contact.url' | 'graphql.info.contact.name' | 'graphql.info.license' | 'graphql.info.termsOfService' | 'graphql.overview' | 'graphql.metadata' | 'graphql.key' | 'graphql.value' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.actions.show' | 'graphql.actions.hide' | 'graphql.actions.more' | 'graphql.fields' | 'graphql.inputFields' | 'graphql.values' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.requiredScopes' | 'graphql.viewSecurityDetails' | 'graphql.objectScopes' | 'graphql.fieldScopes' | 'graphql.implementedInterfaces' | 'graphql.implementedBy' | 'graphql.nonNull' | 'graphql.required' | 'asyncapi.badges.deprecated' | 'graphql.badges.deprecated' | 'asyncapi.actions.show' | 'asyncapi.actions.hide' | 'asyncapi.actions.more' | 'asyncapi.payload' | 'asyncapi.parameters' | 'asyncapi.messages' | 'asyncapi.contentType' | 'asyncapi.moreDetails' | 'asyncapi.property' | 'asyncapi.properties' | 'asyncapi.details' | 'asyncapi.reply' | 'asyncapi.servers.title' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'button.copy.tooltipText' | 'button.download.tooltipText' | 'button.externalLink.tooltipText' | 'button.email.tooltipText' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description' | 'page.skipToContent.label' | 'select.noResults' | 'loaders.loading' | 'filter.dateRange.from' | 'filter.dateRange.to' | 'diagram.openFullscreen' | 'diagram.zoomIn' | 'diagram.zoomOut' | 'diagram.reset' | 'diagram.close' | 'diagram.viewer';
|
|
3
3
|
export type Locale = {
|
|
4
4
|
code: string;
|
|
5
5
|
name: string;
|
|
@@ -5,28 +5,31 @@ export type ThreePanelLayoutProps = PropsWithChildren<{
|
|
|
5
5
|
collapsedSidebar?: boolean;
|
|
6
6
|
id?: string;
|
|
7
7
|
className?: string;
|
|
8
|
+
onClickCapture?: React.MouseEventHandler<HTMLDivElement>;
|
|
8
9
|
}>;
|
|
9
10
|
export declare function ThreePanelLayout({ layout, collapsedSidebar, children, ...props }: ThreePanelLayoutProps): JSX.Element;
|
|
10
11
|
export declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>> & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>, "$collapsedSidebar" | "$layout" | "data-component-name"> & {
|
|
11
12
|
'data-component-name': string;
|
|
12
13
|
$layout: LayoutVariant;
|
|
13
14
|
$collapsedSidebar: boolean;
|
|
14
|
-
}, "children" | "className" | "collapsedSidebar" | "id" | "layout"> & {
|
|
15
|
+
}, "children" | "className" | "collapsedSidebar" | "id" | "layout" | "onClickCapture"> & {
|
|
15
16
|
layout?: LayoutVariant;
|
|
16
17
|
collapsedSidebar?: boolean;
|
|
17
18
|
id?: string;
|
|
18
19
|
className?: string;
|
|
20
|
+
onClickCapture?: React.MouseEventHandler<HTMLDivElement>;
|
|
19
21
|
} & {
|
|
20
22
|
children?: React.ReactNode | undefined;
|
|
21
23
|
}, "$collapsedSidebar" | "$layout" | "about" | "accessKey" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "autoCapitalize" | "autoCorrect" | "autoFocus" | "autoSave" | "children" | "className" | "color" | "content" | "contentEditable" | "contextMenu" | "dangerouslySetInnerHTML" | "data-component-name" | "datatype" | "defaultChecked" | "defaultValue" | "dir" | "draggable" | "enterKeyHint" | "exportparts" | "hidden" | "id" | "inert" | "inlist" | "inputMode" | "is" | "itemID" | "itemProp" | "itemRef" | "itemScope" | "itemType" | "key" | "lang" | "nonce" | "onAbort" | "onAbortCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAuxClick" | "onAuxClickCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onBeforeToggle" | "onBlur" | "onBlurCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onChange" | "onChangeCapture" | "onClick" | "onClickCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onContextMenu" | "onContextMenuCapture" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onError" | "onErrorCapture" | "onFocus" | "onFocusCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onInput" | "onInputCapture" | "onInvalid" | "onInvalidCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onLoad" | "onLoadCapture" | "onLoadStart" | "onLoadStartCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onPaste" | "onPasteCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerMove" | "onPointerMoveCapture" | "onPointerOut" | "onPointerOutCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerUp" | "onPointerUpCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onReset" | "onResetCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onSelect" | "onSelectCapture" | "onStalled" | "onStalledCapture" | "onSubmit" | "onSubmitCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onToggle" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onWheel" | "onWheelCapture" | "part" | "popover" | "popoverTarget" | "popoverTargetAction" | "prefix" | "property" | "radioGroup" | "ref" | "rel" | "resource" | "results" | "rev" | "role" | "security" | "slot" | "spellCheck" | "style" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "tabIndex" | "title" | "translate" | "typeof" | "unselectable" | "vocab"> & Partial<Pick<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>> & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>, "$collapsedSidebar" | "$layout" | "data-component-name"> & {
|
|
22
24
|
'data-component-name': string;
|
|
23
25
|
$layout: LayoutVariant;
|
|
24
26
|
$collapsedSidebar: boolean;
|
|
25
|
-
}, "children" | "className" | "collapsedSidebar" | "id" | "layout"> & {
|
|
27
|
+
}, "children" | "className" | "collapsedSidebar" | "id" | "layout" | "onClickCapture"> & {
|
|
26
28
|
layout?: LayoutVariant;
|
|
27
29
|
collapsedSidebar?: boolean;
|
|
28
30
|
id?: string;
|
|
29
31
|
className?: string;
|
|
32
|
+
onClickCapture?: React.MouseEventHandler<HTMLDivElement>;
|
|
30
33
|
} & {
|
|
31
34
|
children?: React.ReactNode | undefined;
|
|
32
35
|
}, "$collapsedSidebar" | "$layout" | "about" | "accessKey" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "autoCapitalize" | "autoCorrect" | "autoFocus" | "autoSave" | "children" | "className" | "color" | "content" | "contentEditable" | "contextMenu" | "dangerouslySetInnerHTML" | "data-component-name" | "datatype" | "defaultChecked" | "defaultValue" | "dir" | "draggable" | "enterKeyHint" | "exportparts" | "hidden" | "id" | "inert" | "inlist" | "inputMode" | "is" | "itemID" | "itemProp" | "itemRef" | "itemScope" | "itemType" | "key" | "lang" | "nonce" | "onAbort" | "onAbortCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAuxClick" | "onAuxClickCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onBeforeToggle" | "onBlur" | "onBlurCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onChange" | "onChangeCapture" | "onClick" | "onClickCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onContextMenu" | "onContextMenuCapture" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onError" | "onErrorCapture" | "onFocus" | "onFocusCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onInput" | "onInputCapture" | "onInvalid" | "onInvalidCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onLoad" | "onLoadCapture" | "onLoadStart" | "onLoadStartCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onPaste" | "onPasteCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerMove" | "onPointerMoveCapture" | "onPointerOut" | "onPointerOutCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerUp" | "onPointerUpCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onReset" | "onResetCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onSelect" | "onSelectCapture" | "onStalled" | "onStalledCapture" | "onSubmit" | "onSubmitCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onToggle" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onWheel" | "onWheelCapture" | "part" | "popover" | "popoverTarget" | "popoverTargetAction" | "prefix" | "property" | "radioGroup" | "ref" | "rel" | "resource" | "results" | "rev" | "role" | "security" | "slot" | "spellCheck" | "style" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "tabIndex" | "title" | "translate" | "typeof" | "unselectable" | "vocab">>> & string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.68.0-next.
|
|
3
|
+
"version": "0.68.0-next.5",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"openapi-sampler": "^1.7.2",
|
|
82
82
|
"react-calendar": "5.1.0",
|
|
83
83
|
"react-date-picker": "11.0.0",
|
|
84
|
-
"@redocly/config": "0.53.
|
|
84
|
+
"@redocly/config": "0.53.1"
|
|
85
85
|
},
|
|
86
86
|
"scripts": {
|
|
87
87
|
"watch": "tsgo -p tsconfig.build.json && (concurrently \"tsgo -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { JSX } from 'react';
|
|
4
|
+
|
|
5
|
+
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
6
|
+
import { Button } from '@redocly/theme/components/Button/Button';
|
|
7
|
+
|
|
8
|
+
export type ShowMoreToggleButtonProps = {
|
|
9
|
+
isExpanded: boolean;
|
|
10
|
+
onToggle: () => void;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* "Show more" / "Show less" toggle used by truncated-value renderers
|
|
16
|
+
* (JsonViewer oversized strings, CodeBlock `maxDisplayLength`).
|
|
17
|
+
*/
|
|
18
|
+
export function ShowMoreToggleButton({
|
|
19
|
+
isExpanded,
|
|
20
|
+
onToggle,
|
|
21
|
+
className,
|
|
22
|
+
}: ShowMoreToggleButtonProps): JSX.Element {
|
|
23
|
+
const { useTranslate } = useThemeHooks();
|
|
24
|
+
const { translate } = useTranslate();
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Button className={className} size="small" variant="link" onClick={onToggle}>
|
|
28
|
+
{isExpanded
|
|
29
|
+
? translate('jsonViewer.showLess', 'Show less')
|
|
30
|
+
: translate('jsonViewer.showMore', 'Show more')}
|
|
31
|
+
</Button>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import type { JSX } from 'react';
|
|
@@ -10,6 +10,7 @@ import { useModalScrollLock, useReportDialog, useThemeHooks } from '@redocly/the
|
|
|
10
10
|
import { ReportDialog } from '@redocly/theme/components/Feedback/ReportDialog';
|
|
11
11
|
import { CodeBlockContainer } from '@redocly/theme/components/CodeBlock/CodeBlockContainer';
|
|
12
12
|
import { CodeBlockControls } from '@redocly/theme/components/CodeBlock/CodeBlockControls';
|
|
13
|
+
import { ShowMoreToggleButton } from '@redocly/theme/components/Button/ShowMoreToggleButton';
|
|
13
14
|
|
|
14
15
|
export type CodeBlockProps = {
|
|
15
16
|
lang?: string;
|
|
@@ -23,6 +24,12 @@ export type CodeBlockProps = {
|
|
|
23
24
|
withLineNumbers?: boolean;
|
|
24
25
|
startLineNumber?: number;
|
|
25
26
|
highlightedHtml?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Display at most this many characters of `source`, with a "Show more" toggle for the rest.
|
|
29
|
+
* Copy and report controls always receive the full source. Ignored when `highlightedHtml`
|
|
30
|
+
* or `children` are provided.
|
|
31
|
+
*/
|
|
32
|
+
maxDisplayLength?: number;
|
|
26
33
|
skipHighlight?: boolean;
|
|
27
34
|
codeBlockRef?: (instance: HTMLPreElement | null) => void;
|
|
28
35
|
codeBlockMaxHeight?: string;
|
|
@@ -62,6 +69,7 @@ export function CodeBlock({
|
|
|
62
69
|
dataTestId = 'source-code',
|
|
63
70
|
codeBlockRef,
|
|
64
71
|
highlightedHtml,
|
|
72
|
+
maxDisplayLength,
|
|
65
73
|
withLineNumbers,
|
|
66
74
|
startLineNumber,
|
|
67
75
|
className,
|
|
@@ -79,17 +87,42 @@ export function CodeBlock({
|
|
|
79
87
|
const { useCodeHighlight } = useThemeHooks();
|
|
80
88
|
const { highlight } = useCodeHighlight() || {};
|
|
81
89
|
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
const dataHighlight = rest['data-highlight'] as string | undefined;
|
|
91
|
+
const hasChildren = Boolean(children);
|
|
92
|
+
|
|
93
|
+
const [isSourceExpanded, setIsSourceExpanded] = useState(false);
|
|
94
|
+
const isTruncatable =
|
|
95
|
+
maxDisplayLength !== undefined &&
|
|
96
|
+
sourceCode.length > maxDisplayLength &&
|
|
97
|
+
!highlightedHtml &&
|
|
98
|
+
!hasChildren;
|
|
99
|
+
const displayedSource =
|
|
100
|
+
isTruncatable && !isSourceExpanded ? `${sourceCode.slice(0, maxDisplayLength)}…` : sourceCode;
|
|
101
|
+
|
|
102
|
+
const highlightedCode = useMemo(
|
|
103
|
+
() =>
|
|
104
|
+
highlightedHtml
|
|
105
|
+
? withLineNumbers
|
|
106
|
+
? addLineNumbers(highlightedHtml, startLineNumber)
|
|
107
|
+
: highlightedHtml
|
|
108
|
+
: hasChildren
|
|
109
|
+
? null
|
|
110
|
+
: highlight?.(displayedSource, lang, {
|
|
111
|
+
withLineNumbers,
|
|
112
|
+
startLineNumber,
|
|
113
|
+
highlight: dataHighlight,
|
|
114
|
+
}),
|
|
115
|
+
[
|
|
116
|
+
highlightedHtml,
|
|
117
|
+
withLineNumbers,
|
|
118
|
+
startLineNumber,
|
|
119
|
+
hasChildren,
|
|
120
|
+
highlight,
|
|
121
|
+
displayedSource,
|
|
122
|
+
lang,
|
|
123
|
+
dataHighlight,
|
|
124
|
+
],
|
|
125
|
+
);
|
|
93
126
|
|
|
94
127
|
// The same initial value should be returned for ssr and frontend to avoid issues
|
|
95
128
|
// Because we don't have session storage in ssr and can't get the security details there
|
|
@@ -149,10 +182,21 @@ export function CodeBlock({
|
|
|
149
182
|
/>
|
|
150
183
|
)}
|
|
151
184
|
</ContainerWrapper>
|
|
185
|
+
{isTruncatable ? (
|
|
186
|
+
<TruncationToggleButton
|
|
187
|
+
isExpanded={isSourceExpanded}
|
|
188
|
+
onToggle={() => setIsSourceExpanded((expanded) => !expanded)}
|
|
189
|
+
/>
|
|
190
|
+
) : null}
|
|
152
191
|
</CodeBlockWrapper>
|
|
153
192
|
);
|
|
154
193
|
}
|
|
155
194
|
|
|
195
|
+
const TruncationToggleButton = styled(ShowMoreToggleButton)`
|
|
196
|
+
margin: 0 var(--spacing-sm) var(--spacing-xs);
|
|
197
|
+
user-select: none;
|
|
198
|
+
`;
|
|
199
|
+
|
|
156
200
|
const ContainerWrapper = styled.div`
|
|
157
201
|
display: grid; // prevents content to overstretch
|
|
158
202
|
position: relative;
|