@redocly/theme 0.60.0-next.2 → 0.60.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/Buttons/variables.js +1 -1
- package/lib/components/Menu/MenuItem.js +5 -1
- package/lib/components/Search/FilterFields/SearchFilterFieldTags.js +7 -1
- package/lib/components/Search/SearchItem.js +5 -1
- package/lib/components/Tag/Tag.d.ts +1 -1
- package/lib/components/Tag/variables.dark.js +6 -0
- package/lib/components/Tag/variables.js +6 -0
- package/lib/core/constants/index.d.ts +1 -0
- package/lib/core/constants/index.js +1 -0
- package/lib/core/constants/request-methods.d.ts +1 -0
- package/lib/core/constants/request-methods.js +14 -0
- package/lib/core/openapi/index.d.ts +1 -0
- package/lib/core/openapi/index.js +3 -1
- package/lib/core/types/catalog.d.ts +5 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/search.d.ts +1 -0
- package/lib/core/types/sidebar.d.ts +1 -0
- package/lib/core/utils/get-operation-color.d.ts +7 -0
- package/lib/core/utils/get-operation-color.js +13 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/markdoc/components/Tabs/Tabs.d.ts +2 -1
- package/lib/markdoc/components/Tabs/Tabs.js +8 -3
- package/package.json +4 -4
- package/src/components/Buttons/variables.ts +1 -1
- package/src/components/Menu/MenuItem.tsx +6 -2
- package/src/components/Search/FilterFields/SearchFilterFieldTags.tsx +7 -1
- package/src/components/Search/SearchItem.tsx +7 -2
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/Tag/variables.dark.ts +6 -0
- package/src/components/Tag/variables.ts +6 -0
- package/src/core/constants/index.ts +1 -0
- package/src/core/constants/request-methods.ts +10 -0
- package/src/core/hooks/__mocks__/use-controlled-state.ts +5 -2
- package/src/core/hooks/__mocks__/use-input-key-commands.ts +10 -2
- package/src/core/hooks/__mocks__/use-mobile-menu.ts +10 -2
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +4 -2
- package/src/core/hooks/menu/__mocks__/use-mobile-menu-items.ts +13 -2
- package/src/core/openapi/index.ts +1 -0
- package/src/core/types/catalog.ts +5 -0
- package/src/core/types/l10n.ts +10 -0
- package/src/core/types/search.ts +1 -0
- package/src/core/types/sidebar.ts +1 -0
- package/src/core/utils/get-operation-color.ts +18 -0
- package/src/core/utils/index.ts +1 -0
- package/src/markdoc/components/Tabs/Tabs.tsx +11 -0
|
@@ -24,7 +24,7 @@ exports.aiAssistantButton = (0, styled_components_1.css) `
|
|
|
24
24
|
/* Positioning */
|
|
25
25
|
--ai-assistant-button-bottom: var(--spacing-xl);
|
|
26
26
|
--ai-assistant-button-right: var(--spacing-xl);
|
|
27
|
-
--ai-assistant-button-z-index:
|
|
27
|
+
--ai-assistant-button-z-index: calc(var(--z-index-overlay) - 1);
|
|
28
28
|
|
|
29
29
|
/* Typography */
|
|
30
30
|
--ai-assistant-button-font-size: var(--font-size-base);
|
|
@@ -80,7 +80,11 @@ function MenuItem(props) {
|
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
const chevron = hasChevron ? (isExpanded ? (react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, { size: "var(--menu-item-label-chevron-size)", color: "--tree-content-color-default" })) : (react_1.default.createElement(ChevronRightIcon_1.ChevronRightIcon, { size: "var(--menu-item-label-chevron-size)", color: "--tree-content-color-default" }))) : null;
|
|
83
|
-
const httpColor =
|
|
83
|
+
const httpColor = (0, utils_1.getOperationColor)({
|
|
84
|
+
isAdditionalOperation: item.isAdditionalOperation,
|
|
85
|
+
deprecated: item.deprecated,
|
|
86
|
+
httpVerb: item.httpVerb || '',
|
|
87
|
+
});
|
|
84
88
|
const label = item.label && (react_1.default.createElement(MenuItemLabelWrapper, { active: item.active, deprecated: item.deprecated, depth: depth, withChevron: hasChevron, isSeparator: isSeparator, onClick: handleOnClick, onKeyDown: handleExpandOnEnter, ref: labelRef, role: item.link ? 'none' : 'link', tabIndex: !item.link ? 0 : undefined, "data-testid": "menu-item-label", "data-active": item.active },
|
|
85
89
|
hasChevron ? react_1.default.createElement(ChevronWrapper, null, chevron) : null,
|
|
86
90
|
react_1.default.createElement(MenuItemIcon, { icon: item.icon, srcSet: item.srcSet }),
|
|
@@ -7,6 +7,8 @@ exports.SearchFilterFieldTags = SearchFilterFieldTags;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const Tag_1 = require("../../../components/Tag/Tag");
|
|
10
|
+
const utils_1 = require("../../../core/utils");
|
|
11
|
+
const constants_1 = require("../../../core/constants");
|
|
10
12
|
function SearchFilterFieldTags({ className, facet, selectedValues, onChange, }) {
|
|
11
13
|
return (react_1.default.createElement(FilterTagsWrapper, { "data-component-name": "Search/FilterFields/SearchFilterFieldTags", className: className }, facet.values.map((facetCount, index) => {
|
|
12
14
|
const { value, count, isCounterVisible } = facetCount;
|
|
@@ -17,7 +19,11 @@ function SearchFilterFieldTags({ className, facet, selectedValues, onChange, })
|
|
|
17
19
|
: [...selectedValues, value];
|
|
18
20
|
onChange(values);
|
|
19
21
|
};
|
|
20
|
-
|
|
22
|
+
const color = (0, utils_1.getOperationColor)({
|
|
23
|
+
httpVerb: value,
|
|
24
|
+
isAdditionalOperation: !constants_1.REQUEST_METHODS.includes(value.toUpperCase()),
|
|
25
|
+
});
|
|
26
|
+
return (react_1.default.createElement(FilterTagWrapper, { key: `${count}-${index}`, tabIndex: 0, color: color, onClick: () => {
|
|
21
27
|
updateSelectedValues();
|
|
22
28
|
}, onKeyDown: (e) => {
|
|
23
29
|
if (e.key === 'Enter') {
|
|
@@ -61,6 +61,10 @@ function SearchItem({ onClick, item, className, product, innerRef, }) {
|
|
|
61
61
|
const { document, highlight } = item;
|
|
62
62
|
const parameter = highlight.parameters && highlight.parameters.length ? highlight.parameters[0] : null;
|
|
63
63
|
const shouldShowPath = document.path && ((_a = document.path) === null || _a === void 0 ? void 0 : _a.length) > 1;
|
|
64
|
+
const httpColor = (0, utils_1.getOperationColor)({
|
|
65
|
+
isAdditionalOperation: document.isAdditionalOperation,
|
|
66
|
+
httpVerb: document.httpMethod || '',
|
|
67
|
+
});
|
|
64
68
|
return (react_1.default.createElement(SearchItemWrapper, { className: className, to: document.url, onClick: onClick, tabIndex: 0, innerRef: (el) => {
|
|
65
69
|
ref.current = el;
|
|
66
70
|
if (!innerRef)
|
|
@@ -78,7 +82,7 @@ function SearchItem({ onClick, item, className, product, innerRef, }) {
|
|
|
78
82
|
react_1.default.createElement(Image_1.Image, { src: product.icon }),
|
|
79
83
|
product.name)),
|
|
80
84
|
document.httpMethod ? (react_1.default.createElement(SearchItemOperation, null,
|
|
81
|
-
react_1.default.createElement(SearchItemOperationTag, { color:
|
|
85
|
+
react_1.default.createElement(SearchItemOperationTag, { color: httpColor }, document.httpMethod.toUpperCase()),
|
|
82
86
|
highlight.httpPath ? (0, SearchHighlight_1.searchHighlight)(highlight.httpPath) : document.httpPath)) : null,
|
|
83
87
|
react_1.default.createElement(SearchItemTitleWrapper, null,
|
|
84
88
|
react_1.default.createElement(SearchItemTitle, null, highlight.title ? (0, SearchHighlight_1.searchHighlight)(highlight.title) : document.title),
|
|
@@ -6,7 +6,7 @@ type SubjectStatusColor = 'active' | 'draft' | 'deprecated' | 'product';
|
|
|
6
6
|
type HttpColor = 'get' | 'post' | 'put' | 'delete' | 'option' | 'patch' | 'head' | 'hook' | 'link';
|
|
7
7
|
type ActionColor = 'receive' | 'send';
|
|
8
8
|
type ChannelColor = 'channel';
|
|
9
|
-
type HttpStatusColor = 'http-deprecated';
|
|
9
|
+
type HttpStatusColor = 'http-deprecated' | 'http-additional-operation';
|
|
10
10
|
type StatusColor = DefaultStatusColor | ActionStatusColor | SubjectStatusColor | HttpColor | ActionColor | ChannelColor | HttpStatusColor;
|
|
11
11
|
type Color = 'red' | 'green' | 'blue' | 'grey' | 'turquoise' | 'magenta' | 'purple' | 'carrot' | 'raspberry' | 'orange' | 'grass' | 'persian-green' | 'sky' | 'blueberry';
|
|
12
12
|
export type TagProps = {
|
|
@@ -232,6 +232,12 @@ exports.tagDarkMode = (0, styled_components_1.css) `
|
|
|
232
232
|
--tag-bg-color-hover: #373776; // @presenter Color
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
.tag-http-additional-operation {
|
|
236
|
+
--tag-color: #FCAB69; // @presenter Color
|
|
237
|
+
--tag-bg-color: #523926; // @presenter Color
|
|
238
|
+
--tag-bg-color-hover: #694830; // @presenter Color
|
|
239
|
+
}
|
|
240
|
+
|
|
235
241
|
.tag-receive {
|
|
236
242
|
--tag-color: #88CF82; // @presenter Color
|
|
237
243
|
--tag-bg-color: #23421F; // @presenter Color
|
|
@@ -313,6 +313,12 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
313
313
|
--tag-color: var(--text-color-disabled); // @presenter Color
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
+
.tag-http-additional-operation {
|
|
317
|
+
--tag-color: #F97316; // @presenter Color
|
|
318
|
+
--tag-bg-color: #faede3; // @presenter Color
|
|
319
|
+
--tag-bg-color-hover: #fae2cf; // @presenter Color
|
|
320
|
+
}
|
|
321
|
+
|
|
316
322
|
.tag-send {
|
|
317
323
|
--tag-color: #4144F6; // @presenter Color
|
|
318
324
|
--tag-bg-color: #ECECFE; // @presenter Color
|
|
@@ -20,5 +20,6 @@ __exportStar(require("./code-walkthrough"), exports);
|
|
|
20
20
|
__exportStar(require("./search"), exports);
|
|
21
21
|
__exportStar(require("./catalog"), exports);
|
|
22
22
|
__exportStar(require("./breadcrumb"), exports);
|
|
23
|
+
__exportStar(require("./request-methods"), exports);
|
|
23
24
|
__exportStar(require("./mcp"), exports);
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const REQUEST_METHODS: string[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REQUEST_METHODS = void 0;
|
|
4
|
+
exports.REQUEST_METHODS = [
|
|
5
|
+
'GET',
|
|
6
|
+
'POST',
|
|
7
|
+
'PUT',
|
|
8
|
+
'DELETE',
|
|
9
|
+
'PATCH',
|
|
10
|
+
'OPTIONS',
|
|
11
|
+
'HEAD',
|
|
12
|
+
'TRACE',
|
|
13
|
+
];
|
|
14
|
+
//# sourceMappingURL=request-methods.js.map
|
|
@@ -11,6 +11,7 @@ export { useMount } from '../hooks/use-mount';
|
|
|
11
11
|
export { GlobalStyle } from '../styles/global';
|
|
12
12
|
export { breakpoints } from '../utils/media-css';
|
|
13
13
|
export { isPrimitive } from '../utils/args-typecheck';
|
|
14
|
+
export { getOperationColor } from '../utils/get-operation-color';
|
|
14
15
|
export { ClipboardService } from '../utils/clipboard-service';
|
|
15
16
|
export { getUserAgent } from '../utils/get-user-agent';
|
|
16
17
|
export { useFocusTrap } from '../hooks/use-focus-trap';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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.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.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;
|
|
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");
|
|
@@ -22,6 +22,8 @@ var media_css_1 = require("../utils/media-css");
|
|
|
22
22
|
Object.defineProperty(exports, "breakpoints", { enumerable: true, get: function () { return media_css_1.breakpoints; } });
|
|
23
23
|
var args_typecheck_1 = require("../utils/args-typecheck");
|
|
24
24
|
Object.defineProperty(exports, "isPrimitive", { enumerable: true, get: function () { return args_typecheck_1.isPrimitive; } });
|
|
25
|
+
var get_operation_color_1 = require("../utils/get-operation-color");
|
|
26
|
+
Object.defineProperty(exports, "getOperationColor", { enumerable: true, get: function () { return get_operation_color_1.getOperationColor; } });
|
|
25
27
|
var clipboard_service_1 = require("../utils/clipboard-service");
|
|
26
28
|
Object.defineProperty(exports, "ClipboardService", { enumerable: true, get: function () { return clipboard_service_1.ClipboardService; } });
|
|
27
29
|
var get_user_agent_1 = require("../utils/get-user-agent");
|
|
@@ -119,6 +119,7 @@ export type BffCatalogRelatedEntity = {
|
|
|
119
119
|
relationType: EntityRelationType;
|
|
120
120
|
sourceFile?: string | null;
|
|
121
121
|
metadata?: Record<string, any>;
|
|
122
|
+
version?: string | null;
|
|
122
123
|
readonly createdAt: string | null;
|
|
123
124
|
readonly updatedAt: string | null;
|
|
124
125
|
};
|
|
@@ -150,6 +151,10 @@ export type BffCatalogEntity = {
|
|
|
150
151
|
}>;
|
|
151
152
|
sourceFile?: string;
|
|
152
153
|
readonly object: 'catalogEntityView';
|
|
154
|
+
readonly version?: string | null;
|
|
155
|
+
readonly revision: string;
|
|
156
|
+
readonly isCurrent?: boolean | null;
|
|
157
|
+
readonly isDefaultVersion?: boolean | null;
|
|
153
158
|
readonly createdAt: string;
|
|
154
159
|
readonly updatedAt: string;
|
|
155
160
|
};
|
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.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.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.back' | '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.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.notFound.title' | 'page.notFound.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.tags.more' | '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' | '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.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.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.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.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | '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';
|
|
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.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.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.back' | '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.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.notFound.title' | 'page.notFound.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.tags.more' | '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' | '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.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.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.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | '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';
|
|
3
3
|
export type Locale = {
|
|
4
4
|
code: string;
|
|
5
5
|
name: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOperationColor = getOperationColor;
|
|
4
|
+
function getOperationColor({ deprecated, isAdditionalOperation, httpVerb, }) {
|
|
5
|
+
if (deprecated) {
|
|
6
|
+
return 'http-deprecated';
|
|
7
|
+
}
|
|
8
|
+
else if (isAdditionalOperation) {
|
|
9
|
+
return 'http-additional-operation';
|
|
10
|
+
}
|
|
11
|
+
return httpVerb;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=get-operation-color.js.map
|
package/lib/core/utils/index.js
CHANGED
|
@@ -55,5 +55,6 @@ __exportStar(require("./enhanced-smoothstep"), exports);
|
|
|
55
55
|
__exportStar(require("./icon-resolver"), exports);
|
|
56
56
|
__exportStar(require("./Dynamic"), exports);
|
|
57
57
|
__exportStar(require("./tabs"), exports);
|
|
58
|
+
__exportStar(require("./get-operation-color"), exports);
|
|
58
59
|
__exportStar(require("./frontmatter-translate"), exports);
|
|
59
60
|
//# sourceMappingURL=index.js.map
|
|
@@ -18,7 +18,8 @@ type TabsProps = {
|
|
|
18
18
|
size: TabsSize;
|
|
19
19
|
initialTab?: string;
|
|
20
20
|
forceReady?: boolean;
|
|
21
|
+
activeTab?: string;
|
|
21
22
|
};
|
|
22
|
-
export declare function Tabs({ id, children, className, size, initialTab: propInitialTab, forceReady, }: TabsProps): JSX.Element;
|
|
23
|
+
export declare function Tabs({ id, children, className, size, initialTab: propInitialTab, forceReady, activeTab: controlledActiveTab, }: TabsProps): JSX.Element;
|
|
23
24
|
export declare const TabContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
24
25
|
export {};
|
|
@@ -46,7 +46,7 @@ var TabsSize;
|
|
|
46
46
|
TabsSize["SMALL"] = "small";
|
|
47
47
|
TabsSize["MEDIUM"] = "medium";
|
|
48
48
|
})(TabsSize || (exports.TabsSize = TabsSize = {}));
|
|
49
|
-
function Tabs({ id, children, className, size, initialTab: propInitialTab, forceReady = false, }) {
|
|
49
|
+
function Tabs({ id, children, className, size, initialTab: propInitialTab, forceReady = false, activeTab: controlledActiveTab, }) {
|
|
50
50
|
var _a, _b;
|
|
51
51
|
const childrenArray = react_1.default.Children.toArray(children);
|
|
52
52
|
const [isReady, setIsReady] = (0, react_1.useState)(false);
|
|
@@ -62,10 +62,15 @@ function Tabs({ id, children, className, size, initialTab: propInitialTab, force
|
|
|
62
62
|
setIsReady(false);
|
|
63
63
|
}, [labelsHash]);
|
|
64
64
|
const inRouter = (0, react_router_dom_1.useInRouterContext)();
|
|
65
|
-
return (react_1.default.createElement(TabsView, { id: id, className: className, size: size, childrenArray: childrenArray, initialTab: initialTab, useActiveTab: inRouter ? useActiveTabWithRouter : useActiveTabWithoutRouter, isReady: isReady || forceReady, labelsHash: labelsHash, containerRef: containerRef, onReadyChange: handleReadyChange }));
|
|
65
|
+
return (react_1.default.createElement(TabsView, { id: id, className: className, size: size, childrenArray: childrenArray, initialTab: initialTab, useActiveTab: inRouter ? useActiveTabWithRouter : useActiveTabWithoutRouter, isReady: isReady || forceReady, labelsHash: labelsHash, containerRef: containerRef, onReadyChange: handleReadyChange, externalActiveTab: controlledActiveTab }));
|
|
66
66
|
}
|
|
67
|
-
function TabsView({ id, className, size, childrenArray, useActiveTab, initialTab, isReady, labelsHash, containerRef, onReadyChange, }) {
|
|
67
|
+
function TabsView({ id, className, size, childrenArray, useActiveTab, initialTab, isReady, labelsHash, containerRef, onReadyChange, externalActiveTab, }) {
|
|
68
68
|
const { activeTab, setActiveTab } = useActiveTab(initialTab, id, childrenArray);
|
|
69
|
+
(0, react_1.useEffect)(() => {
|
|
70
|
+
if (externalActiveTab && externalActiveTab !== activeTab) {
|
|
71
|
+
setActiveTab(externalActiveTab);
|
|
72
|
+
}
|
|
73
|
+
}, [externalActiveTab, activeTab, setActiveTab]);
|
|
69
74
|
return (react_1.default.createElement(TabsContainer, { "data-component-name": "Markdoc/Tabs/Tabs", className: className, key: id, "$isReady": isReady },
|
|
70
75
|
react_1.default.createElement(TabList_1.TabList, { key: labelsHash, size: size, childrenArray: childrenArray, activeTab: activeTab, onTabChange: setActiveTab, containerRef: containerRef, onReadyChange: onReadyChange }),
|
|
71
76
|
childrenArray.map((child, index) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.60.0-next.
|
|
3
|
+
"version": "0.60.0-next.4",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@types/react-dom": "^19.1.4",
|
|
51
51
|
"@types/styled-components": "5.1.34",
|
|
52
52
|
"@types/styled-system": "5.1.22",
|
|
53
|
-
"@vitest/coverage-v8": "^
|
|
53
|
+
"@vitest/coverage-v8": "^4.0.9",
|
|
54
54
|
"@vitest/ui": "3.2.4",
|
|
55
55
|
"concurrently": "7.6.0",
|
|
56
56
|
"json-schema-to-ts": "2.7.2",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"tsconfig-paths": "4.2.0",
|
|
68
68
|
"tsconfig-paths-webpack-plugin": "3.5.2",
|
|
69
69
|
"typescript": "5.9.3",
|
|
70
|
-
"vitest": "
|
|
70
|
+
"vitest": "4.0.9",
|
|
71
71
|
"vitest-when": "0.6.2",
|
|
72
72
|
"webpack": "5.94.0"
|
|
73
73
|
},
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"openapi-sampler": "1.6.2",
|
|
88
88
|
"react-calendar": "5.1.0",
|
|
89
89
|
"react-date-picker": "11.0.0",
|
|
90
|
-
"@redocly/config": "0.
|
|
90
|
+
"@redocly/config": "0.40.0",
|
|
91
91
|
"@redocly/realm-asyncapi-sdk": "0.6.0-next.0"
|
|
92
92
|
},
|
|
93
93
|
"scripts": {
|
|
@@ -22,7 +22,7 @@ export const aiAssistantButton = css`
|
|
|
22
22
|
/* Positioning */
|
|
23
23
|
--ai-assistant-button-bottom: var(--spacing-xl);
|
|
24
24
|
--ai-assistant-button-right: var(--spacing-xl);
|
|
25
|
-
--ai-assistant-button-z-index:
|
|
25
|
+
--ai-assistant-button-z-index: calc(var(--z-index-overlay) - 1);
|
|
26
26
|
|
|
27
27
|
/* Typography */
|
|
28
28
|
--ai-assistant-button-font-size: var(--font-size-base);
|
|
@@ -11,7 +11,7 @@ import { ChevronDownIcon } from '@redocly/theme/icons/ChevronDownIcon/ChevronDow
|
|
|
11
11
|
import { ChevronRightIcon } from '@redocly/theme/icons/ChevronRightIcon/ChevronRightIcon';
|
|
12
12
|
import { HttpTag } from '@redocly/theme/components/Tags/HttpTag';
|
|
13
13
|
import { MenuItemType } from '@redocly/theme/core/constants';
|
|
14
|
-
import { getMenuItemType } from '@redocly/theme/core/utils';
|
|
14
|
+
import { getMenuItemType, getOperationColor } from '@redocly/theme/core/utils';
|
|
15
15
|
import { ArrowRightIcon } from '@redocly/theme/icons/ArrowRightIcon/ArrowRightIcon';
|
|
16
16
|
import { Badge } from '@redocly/theme/components/Badge/Badge';
|
|
17
17
|
import { GenericIcon } from '@redocly/theme/icons/GenericIcon/GenericIcon';
|
|
@@ -67,7 +67,11 @@ export function MenuItem(props: React.PropsWithChildren<MenuItemProps>): JSX.Ele
|
|
|
67
67
|
)
|
|
68
68
|
) : null;
|
|
69
69
|
|
|
70
|
-
const httpColor =
|
|
70
|
+
const httpColor = getOperationColor({
|
|
71
|
+
isAdditionalOperation: item.isAdditionalOperation,
|
|
72
|
+
deprecated: item.deprecated,
|
|
73
|
+
httpVerb: item.httpVerb || '',
|
|
74
|
+
});
|
|
71
75
|
|
|
72
76
|
const label = item.label && (
|
|
73
77
|
<MenuItemLabelWrapper
|
|
@@ -4,6 +4,8 @@ import styled from 'styled-components';
|
|
|
4
4
|
import type { SearchFacet, SearchFacetCount } from '@redocly/theme/core/types';
|
|
5
5
|
|
|
6
6
|
import { Tag } from '@redocly/theme/components/Tag/Tag';
|
|
7
|
+
import { getOperationColor } from '@redocly/theme/core/utils';
|
|
8
|
+
import { REQUEST_METHODS } from '@redocly/theme/core/constants';
|
|
7
9
|
|
|
8
10
|
type SearchFilterFieldTagsProps = {
|
|
9
11
|
className?: string;
|
|
@@ -32,11 +34,15 @@ export function SearchFilterFieldTags({
|
|
|
32
34
|
: [...selectedValues, value];
|
|
33
35
|
onChange(values);
|
|
34
36
|
};
|
|
37
|
+
const color = getOperationColor({
|
|
38
|
+
httpVerb: value,
|
|
39
|
+
isAdditionalOperation: !REQUEST_METHODS.includes(value.toUpperCase()),
|
|
40
|
+
});
|
|
35
41
|
return (
|
|
36
42
|
<FilterTagWrapper
|
|
37
43
|
key={`${count}-${index}`}
|
|
38
44
|
tabIndex={0}
|
|
39
|
-
color={
|
|
45
|
+
color={color}
|
|
40
46
|
onClick={() => {
|
|
41
47
|
updateSelectedValues();
|
|
42
48
|
}}
|
|
@@ -9,7 +9,7 @@ import { Link } from '@redocly/theme/components/Link/Link';
|
|
|
9
9
|
import { Image } from '@redocly/theme/components/Image/Image';
|
|
10
10
|
import { searchHighlight } from '@redocly/theme/components/Search/SearchHighlight';
|
|
11
11
|
import { Badge } from '@redocly/theme/components/Badge/Badge';
|
|
12
|
-
import { trimText } from '@redocly/theme/core/utils';
|
|
12
|
+
import { trimText, getOperationColor } from '@redocly/theme/core/utils';
|
|
13
13
|
import { ReturnKeyIcon } from '@redocly/theme/icons/ReturnKeyIcon/ReturnKeyIcon';
|
|
14
14
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
15
15
|
|
|
@@ -48,6 +48,11 @@ export function SearchItem({
|
|
|
48
48
|
highlight.parameters && highlight.parameters.length ? highlight.parameters[0] : null;
|
|
49
49
|
const shouldShowPath = document.path && document.path?.length > 1;
|
|
50
50
|
|
|
51
|
+
const httpColor = getOperationColor({
|
|
52
|
+
isAdditionalOperation: document.isAdditionalOperation,
|
|
53
|
+
httpVerb: document.httpMethod || '',
|
|
54
|
+
});
|
|
55
|
+
|
|
51
56
|
return (
|
|
52
57
|
<SearchItemWrapper
|
|
53
58
|
className={className}
|
|
@@ -77,7 +82,7 @@ export function SearchItem({
|
|
|
77
82
|
)}
|
|
78
83
|
{document.httpMethod ? (
|
|
79
84
|
<SearchItemOperation>
|
|
80
|
-
<SearchItemOperationTag color={
|
|
85
|
+
<SearchItemOperationTag color={httpColor}>
|
|
81
86
|
{document.httpMethod.toUpperCase()}
|
|
82
87
|
</SearchItemOperationTag>
|
|
83
88
|
{highlight.httpPath ? searchHighlight(highlight.httpPath) : document.httpPath}
|
|
@@ -12,7 +12,7 @@ type SubjectStatusColor = 'active' | 'draft' | 'deprecated' | 'product';
|
|
|
12
12
|
type HttpColor = 'get' | 'post' | 'put' | 'delete' | 'option' | 'patch' | 'head' | 'hook' | 'link';
|
|
13
13
|
type ActionColor = 'receive' | 'send';
|
|
14
14
|
type ChannelColor = 'channel';
|
|
15
|
-
type HttpStatusColor = 'http-deprecated';
|
|
15
|
+
type HttpStatusColor = 'http-deprecated' | 'http-additional-operation';
|
|
16
16
|
type StatusColor =
|
|
17
17
|
| DefaultStatusColor
|
|
18
18
|
| ActionStatusColor
|
|
@@ -230,6 +230,12 @@ export const tagDarkMode = css`
|
|
|
230
230
|
--tag-bg-color-hover: #373776; // @presenter Color
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
+
.tag-http-additional-operation {
|
|
234
|
+
--tag-color: #FCAB69; // @presenter Color
|
|
235
|
+
--tag-bg-color: #523926; // @presenter Color
|
|
236
|
+
--tag-bg-color-hover: #694830; // @presenter Color
|
|
237
|
+
}
|
|
238
|
+
|
|
233
239
|
.tag-receive {
|
|
234
240
|
--tag-color: #88CF82; // @presenter Color
|
|
235
241
|
--tag-bg-color: #23421F; // @presenter Color
|
|
@@ -311,6 +311,12 @@ export const tag = css`
|
|
|
311
311
|
--tag-color: var(--text-color-disabled); // @presenter Color
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
+
.tag-http-additional-operation {
|
|
315
|
+
--tag-color: #F97316; // @presenter Color
|
|
316
|
+
--tag-bg-color: #faede3; // @presenter Color
|
|
317
|
+
--tag-bg-color-hover: #fae2cf; // @presenter Color
|
|
318
|
+
}
|
|
319
|
+
|
|
314
320
|
.tag-send {
|
|
315
321
|
--tag-color: #4144F6; // @presenter Color
|
|
316
322
|
--tag-bg-color: #ECECFE; // @presenter Color
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import { vi } from 'vitest';
|
|
1
|
+
import { vi, type MockedFunction } from 'vitest';
|
|
2
2
|
|
|
3
|
-
export const useInputKeyCommands
|
|
3
|
+
export const useInputKeyCommands: MockedFunction<
|
|
4
|
+
(actionHandlers?: {
|
|
5
|
+
onSelectAll?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
6
|
+
onEscape?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
7
|
+
onClear?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
8
|
+
onEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
9
|
+
onPaste?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
10
|
+
}) => { onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void }
|
|
11
|
+
> = vi.fn(() => ({
|
|
4
12
|
onKeyDown: vi.fn(),
|
|
5
13
|
}));
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import { vi } from 'vitest';
|
|
1
|
+
import { vi, type MockedFunction } from 'vitest';
|
|
2
2
|
|
|
3
|
-
export const useMobileMenu = ()
|
|
3
|
+
export const useMobileMenu = (): {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
openMobileMenu: MockedFunction<() => void>;
|
|
6
|
+
closeMobileMenu: MockedFunction<() => void>;
|
|
7
|
+
} => ({
|
|
8
|
+
isOpen: false,
|
|
9
|
+
openMobileMenu: vi.fn(),
|
|
10
|
+
closeMobileMenu: vi.fn(),
|
|
11
|
+
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { vi } from 'vitest';
|
|
1
|
+
import { vi, type MockedFunction } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import type { ThemeHooks } from '../../types/hooks';
|
|
2
4
|
|
|
3
5
|
export const useThemeHooks = vi.fn(() => ({
|
|
4
6
|
useTranslate: vi.fn(() => ({
|
|
@@ -90,4 +92,4 @@ export const useThemeHooks = vi.fn(() => ({
|
|
|
90
92
|
useLoadAndNavigate: vi.fn(),
|
|
91
93
|
usePageProps: vi.fn().mockReturnValue({}),
|
|
92
94
|
usePageData: vi.fn().mockReturnValue(null),
|
|
93
|
-
}))
|
|
95
|
+
})) as unknown as MockedFunction<() => ThemeHooks>;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import { vi } from 'vitest';
|
|
1
|
+
import { vi, type MockedFunction } from 'vitest';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import type { ResolvedNavItem } from '@redocly/config';
|
|
4
|
+
|
|
5
|
+
import { MobileMenuType } from '../../../constants/common';
|
|
6
|
+
|
|
7
|
+
export const useMobileMenuItems: MockedFunction<
|
|
8
|
+
(menuType: MobileMenuType) => {
|
|
9
|
+
items: ResolvedNavItem[];
|
|
10
|
+
popDrilldownState: () => void;
|
|
11
|
+
pushDrilldownState: (drilldownDetails: unknown) => void;
|
|
12
|
+
backLink?: { slug?: string; label?: string };
|
|
13
|
+
}
|
|
14
|
+
> = vi.fn().mockReturnValue({
|
|
4
15
|
items: [
|
|
5
16
|
{
|
|
6
17
|
type: 'group',
|
|
@@ -24,6 +24,7 @@ export { useMount } from '../hooks/use-mount';
|
|
|
24
24
|
export { GlobalStyle } from '../styles/global';
|
|
25
25
|
export { breakpoints } from '../utils/media-css';
|
|
26
26
|
export { isPrimitive } from '../utils/args-typecheck';
|
|
27
|
+
export { getOperationColor } from '../utils/get-operation-color';
|
|
27
28
|
export { ClipboardService } from '../utils/clipboard-service';
|
|
28
29
|
export { getUserAgent } from '../utils/get-user-agent';
|
|
29
30
|
export { useFocusTrap } from '../hooks/use-focus-trap';
|
|
@@ -144,6 +144,7 @@ export type BffCatalogRelatedEntity = {
|
|
|
144
144
|
sourceFile?: string | null;
|
|
145
145
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
146
146
|
metadata?: Record<string, any>;
|
|
147
|
+
version?: string | null;
|
|
147
148
|
readonly createdAt: string | null;
|
|
148
149
|
readonly updatedAt: string | null;
|
|
149
150
|
};
|
|
@@ -177,6 +178,10 @@ export type BffCatalogEntity = {
|
|
|
177
178
|
}>;
|
|
178
179
|
sourceFile?: string;
|
|
179
180
|
readonly object: 'catalogEntityView';
|
|
181
|
+
readonly version?: string | null;
|
|
182
|
+
readonly revision: string;
|
|
183
|
+
readonly isCurrent?: boolean | null;
|
|
184
|
+
readonly isDefaultVersion?: boolean | null;
|
|
180
185
|
readonly createdAt: string;
|
|
181
186
|
readonly updatedAt: string;
|
|
182
187
|
};
|
package/src/core/types/l10n.ts
CHANGED
|
@@ -332,6 +332,16 @@ export type TranslationKey =
|
|
|
332
332
|
| 'openapi.mcp.outputExample'
|
|
333
333
|
| 'asyncapi.download.description.title'
|
|
334
334
|
| 'asyncapi.info.title'
|
|
335
|
+
| 'graphql.download.description.title'
|
|
336
|
+
| 'graphql.info.title'
|
|
337
|
+
| 'graphql.info.contact.url'
|
|
338
|
+
| 'graphql.info.contact.name'
|
|
339
|
+
| 'graphql.info.license'
|
|
340
|
+
| 'graphql.info.termsOfService'
|
|
341
|
+
| 'graphql.overview'
|
|
342
|
+
| 'graphql.metadata'
|
|
343
|
+
| 'graphql.key'
|
|
344
|
+
| 'graphql.value'
|
|
335
345
|
| 'graphql.queries'
|
|
336
346
|
| 'graphql.mutations'
|
|
337
347
|
| 'graphql.subscriptions'
|
package/src/core/types/search.ts
CHANGED
|
@@ -51,6 +51,7 @@ export type ItemState = Omit<SidebarNavItem, 'items'> & {
|
|
|
51
51
|
languageInsensitive?: boolean;
|
|
52
52
|
modified?: boolean; //item from openapi-docs sidebar
|
|
53
53
|
deprecated?: boolean; //item from openapi-docs sidebar
|
|
54
|
+
isAdditionalOperation?: boolean; //item from openapi-docs sidebar
|
|
54
55
|
};
|
|
55
56
|
|
|
56
57
|
export type DrilldownMenuItemDetails = {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type OperationColorProps = {
|
|
2
|
+
deprecated?: boolean;
|
|
3
|
+
isAdditionalOperation?: boolean;
|
|
4
|
+
httpVerb: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export function getOperationColor({
|
|
8
|
+
deprecated,
|
|
9
|
+
isAdditionalOperation,
|
|
10
|
+
httpVerb,
|
|
11
|
+
}: OperationColorProps): string {
|
|
12
|
+
if (deprecated) {
|
|
13
|
+
return 'http-deprecated';
|
|
14
|
+
} else if (isAdditionalOperation) {
|
|
15
|
+
return 'http-additional-operation';
|
|
16
|
+
}
|
|
17
|
+
return httpVerb;
|
|
18
|
+
}
|
package/src/core/utils/index.ts
CHANGED
|
@@ -28,6 +28,7 @@ type TabsProps = {
|
|
|
28
28
|
size: TabsSize;
|
|
29
29
|
initialTab?: string;
|
|
30
30
|
forceReady?: boolean;
|
|
31
|
+
activeTab?: string;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
type UseActiveTabFn = (
|
|
@@ -47,6 +48,7 @@ type TabsViewProps = Omit<TabsProps, 'children'> & {
|
|
|
47
48
|
useActiveTab: UseActiveTabFn;
|
|
48
49
|
containerRef: React.RefObject<HTMLUListElement | null>;
|
|
49
50
|
onReadyChange: (ready: boolean) => void;
|
|
51
|
+
externalActiveTab?: string;
|
|
50
52
|
};
|
|
51
53
|
|
|
52
54
|
export function Tabs({
|
|
@@ -56,6 +58,7 @@ export function Tabs({
|
|
|
56
58
|
size,
|
|
57
59
|
initialTab: propInitialTab,
|
|
58
60
|
forceReady = false,
|
|
61
|
+
activeTab: controlledActiveTab,
|
|
59
62
|
}: TabsProps): JSX.Element {
|
|
60
63
|
const childrenArray = React.Children.toArray(children) as React.ReactElement<TabItemProps>[];
|
|
61
64
|
const [isReady, setIsReady] = useState(false);
|
|
@@ -88,6 +91,7 @@ export function Tabs({
|
|
|
88
91
|
labelsHash={labelsHash}
|
|
89
92
|
containerRef={containerRef}
|
|
90
93
|
onReadyChange={handleReadyChange}
|
|
94
|
+
externalActiveTab={controlledActiveTab}
|
|
91
95
|
/>
|
|
92
96
|
);
|
|
93
97
|
}
|
|
@@ -103,9 +107,16 @@ function TabsView({
|
|
|
103
107
|
labelsHash,
|
|
104
108
|
containerRef,
|
|
105
109
|
onReadyChange,
|
|
110
|
+
externalActiveTab,
|
|
106
111
|
}: TabsViewProps): JSX.Element {
|
|
107
112
|
const { activeTab, setActiveTab } = useActiveTab(initialTab, id, childrenArray);
|
|
108
113
|
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (externalActiveTab && externalActiveTab !== activeTab) {
|
|
116
|
+
setActiveTab(externalActiveTab);
|
|
117
|
+
}
|
|
118
|
+
}, [externalActiveTab, activeTab, setActiveTab]);
|
|
119
|
+
|
|
109
120
|
return (
|
|
110
121
|
<TabsContainer
|
|
111
122
|
data-component-name="Markdoc/Tabs/Tabs"
|