@redocly/theme 0.59.0-next.3 → 0.59.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/Buttons/AIAssistantButton.js +5 -1
- package/lib/components/Buttons/variables.js +1 -1
- package/lib/components/Search/SearchDialog.js +30 -2
- package/lib/core/hooks/use-telemetry-fallback.d.ts +9 -8
- package/lib/core/hooks/use-telemetry-fallback.js +9 -8
- package/lib/core/styles/dark.js +4 -0
- package/lib/core/styles/global.js +4 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/icons/HashtagIcon/HashtagIcon.d.ts +9 -0
- package/lib/icons/HashtagIcon/HashtagIcon.js +22 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/package.json +3 -3
- package/src/components/Buttons/AIAssistantButton.tsx +5 -1
- package/src/components/Buttons/variables.ts +1 -1
- package/src/components/Search/SearchDialog.tsx +43 -10
- package/src/core/hooks/use-telemetry-fallback.ts +9 -8
- package/src/core/styles/dark.ts +4 -0
- package/src/core/styles/global.ts +4 -0
- package/src/core/types/l10n.ts +1 -0
- package/src/icons/HashtagIcon/HashtagIcon.tsx +23 -0
- package/src/index.ts +1 -0
|
@@ -73,8 +73,9 @@ function AIAssistantButton() {
|
|
|
73
73
|
var _a, _b;
|
|
74
74
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
75
75
|
const themeConfig = (0, hooks_1.useThemeConfig)();
|
|
76
|
-
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
76
|
+
const { useTranslate, useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
77
77
|
const { translate } = useTranslate();
|
|
78
|
+
const telemetry = useTelemetry();
|
|
78
79
|
const buttonConfig = Object.assign(Object.assign({}, defaultConfig), ((_b = (_a = themeConfig.aiAssistant) === null || _a === void 0 ? void 0 : _a.trigger) !== null && _b !== void 0 ? _b : {}));
|
|
79
80
|
const { hide, inputIcon, inputType } = buttonConfig;
|
|
80
81
|
if (hide) {
|
|
@@ -84,6 +85,9 @@ function AIAssistantButton() {
|
|
|
84
85
|
const text = translate('aiAssistant.trigger', 'Ask AI');
|
|
85
86
|
const handleOpen = () => {
|
|
86
87
|
setIsOpen(true);
|
|
88
|
+
telemetry.sendSearchAiOpenedMessage({
|
|
89
|
+
method: 'ai_trigger_button',
|
|
90
|
+
});
|
|
87
91
|
};
|
|
88
92
|
const handleClose = () => {
|
|
89
93
|
setIsOpen(false);
|
|
@@ -23,7 +23,7 @@ exports.aiAssistantButton = (0, styled_components_1.css) `
|
|
|
23
23
|
/* Positioning */
|
|
24
24
|
--ai-assistant-button-bottom: var(--spacing-xl);
|
|
25
25
|
--ai-assistant-button-right: var(--spacing-xl);
|
|
26
|
-
--ai-assistant-button-z-index:
|
|
26
|
+
--ai-assistant-button-z-index: 50
|
|
27
27
|
|
|
28
28
|
/* Typography */
|
|
29
29
|
--ai-assistant-button-font-size: var(--font-size-base);
|
|
@@ -75,6 +75,16 @@ function SearchDialog({ onClose, className, initialMode = 'search', }) {
|
|
|
75
75
|
const aiSearch = useAiSearch({ filter }, searchSessionId);
|
|
76
76
|
const searchInputRef = (0, react_1.useRef)(null);
|
|
77
77
|
const modalRef = (0, react_1.useRef)(null);
|
|
78
|
+
const [isMobile, setIsMobile] = (0, react_1.useState)(false);
|
|
79
|
+
(0, react_1.useEffect)(() => {
|
|
80
|
+
const mediaQuery = window.matchMedia(`(max-width: ${utils_1.breakpoints.small})`);
|
|
81
|
+
setIsMobile(mediaQuery.matches);
|
|
82
|
+
const handleChange = (e) => {
|
|
83
|
+
setIsMobile(e.matches);
|
|
84
|
+
};
|
|
85
|
+
mediaQuery.addEventListener('change', handleChange);
|
|
86
|
+
return () => mediaQuery.removeEventListener('change', handleChange);
|
|
87
|
+
}, []);
|
|
78
88
|
const aiQueryRef = (0, react_1.useRef)(null);
|
|
79
89
|
const firstSearchResultRef = (0, react_1.useRef)(null);
|
|
80
90
|
const searchKeysWithResults = items ? Object.keys(items).filter((key) => { var _a; return (_a = items[key]) === null || _a === void 0 ? void 0 : _a.length; }) : [];
|
|
@@ -176,14 +186,21 @@ function SearchDialog({ onClose, className, initialMode = 'search', }) {
|
|
|
176
186
|
if (query.trim()) {
|
|
177
187
|
aiSearch.askQuestion(query);
|
|
178
188
|
}
|
|
189
|
+
telemetry.sendSearchAiOpenedMessage({
|
|
190
|
+
method: 'ai_search_button',
|
|
191
|
+
});
|
|
179
192
|
} }, translate('search.ai.button', 'Search with AI'))) : null,
|
|
180
193
|
showSearchFilterButton && (react_1.default.createElement(SearchFilterToggleButton, { icon: react_1.default.createElement(SettingsIcon_1.SettingsIcon, null), onClick: onFilterToggle })))))) : (react_1.default.createElement(AiDialogHeaderWrapper, null,
|
|
181
194
|
react_1.default.createElement(Button_1.Button, { variant: "secondary", onClick: () => {
|
|
182
195
|
setMode('search');
|
|
183
196
|
aiSearch.clearConversation();
|
|
184
197
|
focusSearchInput();
|
|
185
|
-
}, tabIndex: 0, icon: react_1.default.createElement(ChevronLeftIcon_1.ChevronLeftIcon, null) },
|
|
186
|
-
|
|
198
|
+
}, tabIndex: 0, icon: react_1.default.createElement(ChevronLeftIcon_1.ChevronLeftIcon, null) }, isMobile
|
|
199
|
+
? translate('search.ai.back', 'Back')
|
|
200
|
+
: translate('search.ai.backToSearch', 'Back to search')),
|
|
201
|
+
react_1.default.createElement(AiDialogHeaderActionsWrapper, null,
|
|
202
|
+
react_1.default.createElement(Button_1.Button, { variant: "secondary", disabled: !aiSearch.conversation.length, onClick: () => aiSearch.clearConversation(), tabIndex: 0, icon: react_1.default.createElement(EditIcon_1.EditIcon, null) }, translate('search.ai.newConversation', 'New conversation')),
|
|
203
|
+
isMobile && react_1.default.createElement(Button_1.Button, { variant: "text", icon: react_1.default.createElement(CloseIcon_1.CloseIcon, null), onClick: handleClose }))))),
|
|
187
204
|
react_1.default.createElement(SearchDialogBody, null, mode === 'search' ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
188
205
|
advancedSearch && isFilterOpen && (react_1.default.createElement(SearchDialogBodyFilterView, null,
|
|
189
206
|
react_1.default.createElement(SearchFilter_1.SearchFilter, { facets: facets, filter: filter, query: query, quickFilterFields: [groupField], onFilterChange: onFilterChange, onFilterReset: onFilterReset, onFacetReset: onFacetReset }))),
|
|
@@ -194,12 +211,18 @@ function SearchDialog({ onClose, className, initialMode = 'search', }) {
|
|
|
194
211
|
if (query.trim()) {
|
|
195
212
|
aiSearch.askQuestion(query);
|
|
196
213
|
}
|
|
214
|
+
telemetry.sendSearchAiOpenedMessage({
|
|
215
|
+
method: 'ai_search_input',
|
|
216
|
+
});
|
|
197
217
|
}, onKeyDown: (e) => {
|
|
198
218
|
if (e.key === 'Enter') {
|
|
199
219
|
setMode('ai-dialog');
|
|
200
220
|
if (query.trim()) {
|
|
201
221
|
aiSearch.askQuestion(query);
|
|
202
222
|
}
|
|
223
|
+
telemetry.sendSearchAiOpenedMessage({
|
|
224
|
+
method: 'ai_search_input',
|
|
225
|
+
});
|
|
203
226
|
}
|
|
204
227
|
}, ref: aiQueryRef, tabIndex: 0, role: "option", "aria-selected": "true" },
|
|
205
228
|
react_1.default.createElement(AiStarsIcon_1.AiStarsIcon, { style: { flexShrink: 0 }, color: "var(--search-ai-icon-color)", size: "36px", background: "var(--search-ai-icon-bg-color)", margin: "0 var(--spacing-md) 0 0", borderRadius: "var(--border-radius-lg)" }),
|
|
@@ -312,6 +335,10 @@ const AiDialogHeaderWrapper = styled_components_1.default.div `
|
|
|
312
335
|
align-items: center;
|
|
313
336
|
width: 100%;
|
|
314
337
|
`;
|
|
338
|
+
const AiDialogHeaderActionsWrapper = styled_components_1.default.div `
|
|
339
|
+
display: flex;
|
|
340
|
+
gap: var(--spacing-xxs);
|
|
341
|
+
`;
|
|
315
342
|
const SearchDialogBody = styled_components_1.default.div `
|
|
316
343
|
display: flex;
|
|
317
344
|
flex-direction: row-reverse;
|
|
@@ -413,6 +440,7 @@ const AiDisclaimer = styled_components_1.default.div `
|
|
|
413
440
|
line-height: var(--search-ai-disclaimer-line-height);
|
|
414
441
|
color: var(--search-ai-disclaimer-text-color);
|
|
415
442
|
margin: 0 auto;
|
|
443
|
+
text-align: center;
|
|
416
444
|
`;
|
|
417
445
|
const SearchWithAI = styled_components_1.default.div `
|
|
418
446
|
display: flex;
|
|
@@ -36,20 +36,21 @@ export declare const useTelemetryFallback: () => {
|
|
|
36
36
|
sendLanguagePickerLocaleChangedMessage: () => void;
|
|
37
37
|
sendSearchOpenedMessage: () => void;
|
|
38
38
|
sendSearchQueryMessage: () => void;
|
|
39
|
+
sendSearchAiOpenedMessage: () => void;
|
|
39
40
|
sendSearchAIQueryMessage: () => void;
|
|
40
41
|
sendFeedbackMessage: () => void;
|
|
41
42
|
sendSearchResultClickedMessage: () => void;
|
|
42
43
|
sendRedirectMessage: () => void;
|
|
43
44
|
sendOpenapiDocsMessage: () => void;
|
|
44
45
|
sendCopyCodeSnippetClickedMessage: () => void;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
sendViewedMessage: () => void;
|
|
47
|
+
sendPerformanceMetricsMessage: () => void;
|
|
48
|
+
sendDownloadDefinitionClickedMessage: () => void;
|
|
49
|
+
sendSelectLanguageClickedMessage: () => void;
|
|
50
|
+
sendExpandCollapseAllClickedMessage: () => void;
|
|
51
|
+
sendSwitchServersClickedMessage: () => void;
|
|
52
|
+
sendExamplesSwitcherClickedMessage: () => void;
|
|
53
|
+
sendTryItOpenedMessage: () => void;
|
|
53
54
|
sendAsyncapiDocsViewedMessage: () => void;
|
|
54
55
|
sendAsyncapiDocsPerformanceMetricsMessage: () => void;
|
|
55
56
|
sendAsyncapiDocsSwitchMessageClickedMessage: () => void;
|
|
@@ -40,20 +40,21 @@ const useTelemetryFallback = () => ({
|
|
|
40
40
|
sendLanguagePickerLocaleChangedMessage: () => { },
|
|
41
41
|
sendSearchOpenedMessage: () => { },
|
|
42
42
|
sendSearchQueryMessage: () => { },
|
|
43
|
+
sendSearchAiOpenedMessage: () => { },
|
|
43
44
|
sendSearchAIQueryMessage: () => { },
|
|
44
45
|
sendFeedbackMessage: () => { },
|
|
45
46
|
sendSearchResultClickedMessage: () => { },
|
|
46
47
|
sendRedirectMessage: () => { },
|
|
47
48
|
sendOpenapiDocsMessage: () => { },
|
|
48
49
|
sendCopyCodeSnippetClickedMessage: () => { },
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
sendViewedMessage: () => { },
|
|
51
|
+
sendPerformanceMetricsMessage: () => { },
|
|
52
|
+
sendDownloadDefinitionClickedMessage: () => { },
|
|
53
|
+
sendSelectLanguageClickedMessage: () => { },
|
|
54
|
+
sendExpandCollapseAllClickedMessage: () => { },
|
|
55
|
+
sendSwitchServersClickedMessage: () => { },
|
|
56
|
+
sendExamplesSwitcherClickedMessage: () => { },
|
|
57
|
+
sendTryItOpenedMessage: () => { },
|
|
57
58
|
sendAsyncapiDocsViewedMessage: () => { },
|
|
58
59
|
sendAsyncapiDocsPerformanceMetricsMessage: () => { },
|
|
59
60
|
sendAsyncapiDocsSwitchMessageClickedMessage: () => { },
|
package/lib/core/styles/dark.js
CHANGED
|
@@ -37,6 +37,10 @@ const replayDarkMode = (0, styled_components_1.css) `
|
|
|
37
37
|
--replay-server-variable-bg-color-hover: rgba(31, 10, 144, 0.4); // @presenter Color
|
|
38
38
|
--replay-path-parameter-bg-color-hover: rgba(5, 88, 99, 0.4); // @presenter Color
|
|
39
39
|
|
|
40
|
+
--replay-runtime-expression-color: rgba(147, 166, 249, 1); // @presenter Color
|
|
41
|
+
--replay-runtime-expression-bg-color: rgba(147, 166, 249, 0.16); // @presenter Color
|
|
42
|
+
--replay-operators-color: rgba(168, 143, 88, 1); // @presenter Color
|
|
43
|
+
|
|
40
44
|
// @tokens End
|
|
41
45
|
`;
|
|
42
46
|
exports.darkMode = (0, styled_components_1.css) `
|
|
@@ -1203,6 +1203,10 @@ const replay = (0, styled_components_1.css) `
|
|
|
1203
1203
|
--replay-server-variable-bg-color-hover: rgba(119, 45, 240, 0.16); // @presenter Color
|
|
1204
1204
|
--replay-path-parameter-bg-color-hover: rgba(4, 117, 161, 0.16); // @presenter Color
|
|
1205
1205
|
|
|
1206
|
+
--replay-runtime-expression-color: rgba(54, 90, 249, 1); // @presenter Color
|
|
1207
|
+
--replay-runtime-expression-bg-color: rgba(54, 90, 249, 0.08); // @presenter Color
|
|
1208
|
+
--replay-operators-color: rgba(193, 142, 31, 1); // @presenter Color
|
|
1209
|
+
|
|
1206
1210
|
// @tokens End
|
|
1207
1211
|
`;
|
|
1208
1212
|
exports.styles = (0, styled_components_1.css) `
|
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.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.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' | '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' | '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' | '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.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';
|
|
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.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' | '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' | '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' | '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.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';
|
|
3
3
|
export type Locale = {
|
|
4
4
|
code: string;
|
|
5
5
|
name: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const HashtagIcon: import("styled-components").StyledComponent<(props: IconProps) => React.JSX.Element, any, {
|
|
4
|
+
'data-component-name': string;
|
|
5
|
+
} & {
|
|
6
|
+
color?: string;
|
|
7
|
+
size?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
} & React.SVGProps<SVGSVGElement>, "data-component-name">;
|
|
@@ -0,0 +1,22 @@
|
|
|
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.HashtagIcon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const utils_1 = require("../../core/utils");
|
|
10
|
+
const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
11
|
+
react_1.default.createElement("path", { d: "M10.5 4.5V3.75H8.25V1.5H7.5V3.75H4.5V1.5H3.75V3.75H1.5V4.5H3.75V7.5H1.5V8.25H3.75V10.5H4.5V8.25H7.5V10.5H8.25V8.25H10.5V7.5H8.25V4.5H10.5ZM7.5 7.5H4.5V4.5H7.5V7.5Z" })));
|
|
12
|
+
exports.HashtagIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
13
|
+
'data-component-name': 'icons/HashtagIcon/HashtagIcon',
|
|
14
|
+
})) `
|
|
15
|
+
path {
|
|
16
|
+
fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
height: ${({ size }) => size || '16px'};
|
|
20
|
+
width: ${({ size }) => size || '16px'};
|
|
21
|
+
`;
|
|
22
|
+
//# sourceMappingURL=HashtagIcon.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -261,6 +261,7 @@ export * from './icons/RedoclyIcon/RedoclyIcon';
|
|
|
261
261
|
export * from './icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon';
|
|
262
262
|
export * from './icons/GenericIcon/GenericIcon';
|
|
263
263
|
export * from './icons/ShareIcon/ShareIcon';
|
|
264
|
+
export * from './icons/HashtagIcon/HashtagIcon';
|
|
264
265
|
export * from './layouts/RootLayout';
|
|
265
266
|
export * from './layouts/PageLayout';
|
|
266
267
|
export * from './layouts/NotFound';
|
package/lib/index.js
CHANGED
|
@@ -324,6 +324,7 @@ __exportStar(require("./icons/RedoclyIcon/RedoclyIcon"), exports);
|
|
|
324
324
|
__exportStar(require("./icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon"), exports);
|
|
325
325
|
__exportStar(require("./icons/GenericIcon/GenericIcon"), exports);
|
|
326
326
|
__exportStar(require("./icons/ShareIcon/ShareIcon"), exports);
|
|
327
|
+
__exportStar(require("./icons/HashtagIcon/HashtagIcon"), exports);
|
|
327
328
|
/* Layouts */
|
|
328
329
|
__exportStar(require("./layouts/RootLayout"), exports);
|
|
329
330
|
__exportStar(require("./layouts/PageLayout"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.59.0-next.
|
|
3
|
+
"version": "0.59.0-next.5",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -87,8 +87,8 @@
|
|
|
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.36.
|
|
91
|
-
"@redocly/realm-asyncapi-sdk": "0.5.0-next.
|
|
90
|
+
"@redocly/config": "0.36.1",
|
|
91
|
+
"@redocly/realm-asyncapi-sdk": "0.5.0-next.2"
|
|
92
92
|
},
|
|
93
93
|
"scripts": {
|
|
94
94
|
"watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
|
|
@@ -56,8 +56,9 @@ const getIcon = (
|
|
|
56
56
|
export function AIAssistantButton() {
|
|
57
57
|
const [isOpen, setIsOpen] = useState(false);
|
|
58
58
|
const themeConfig = useThemeConfig();
|
|
59
|
-
const { useTranslate } = useThemeHooks();
|
|
59
|
+
const { useTranslate, useTelemetry } = useThemeHooks();
|
|
60
60
|
const { translate } = useTranslate();
|
|
61
|
+
const telemetry = useTelemetry();
|
|
61
62
|
|
|
62
63
|
const buttonConfig = {
|
|
63
64
|
...defaultConfig,
|
|
@@ -75,6 +76,9 @@ export function AIAssistantButton() {
|
|
|
75
76
|
|
|
76
77
|
const handleOpen = () => {
|
|
77
78
|
setIsOpen(true);
|
|
79
|
+
telemetry.sendSearchAiOpenedMessage({
|
|
80
|
+
method: 'ai_trigger_button',
|
|
81
|
+
});
|
|
78
82
|
};
|
|
79
83
|
|
|
80
84
|
const handleClose = () => {
|
|
@@ -21,7 +21,7 @@ export const aiAssistantButton = css`
|
|
|
21
21
|
/* Positioning */
|
|
22
22
|
--ai-assistant-button-bottom: var(--spacing-xl);
|
|
23
23
|
--ai-assistant-button-right: var(--spacing-xl);
|
|
24
|
-
--ai-assistant-button-z-index:
|
|
24
|
+
--ai-assistant-button-z-index: 50
|
|
25
25
|
|
|
26
26
|
/* Typography */
|
|
27
27
|
--ai-assistant-button-font-size: var(--font-size-base);
|
|
@@ -77,6 +77,20 @@ export function SearchDialog({
|
|
|
77
77
|
|
|
78
78
|
const searchInputRef = useRef<HTMLInputElement>(null);
|
|
79
79
|
const modalRef = useRef<HTMLDivElement>(null);
|
|
80
|
+
|
|
81
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
82
|
+
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
const mediaQuery = window.matchMedia(`(max-width: ${breakpoints.small})`);
|
|
85
|
+
setIsMobile(mediaQuery.matches);
|
|
86
|
+
|
|
87
|
+
const handleChange = (e: MediaQueryListEvent) => {
|
|
88
|
+
setIsMobile(e.matches);
|
|
89
|
+
};
|
|
90
|
+
mediaQuery.addEventListener('change', handleChange);
|
|
91
|
+
return () => mediaQuery.removeEventListener('change', handleChange);
|
|
92
|
+
}, []);
|
|
93
|
+
|
|
80
94
|
const aiQueryRef = useRef<HTMLDivElement>(null);
|
|
81
95
|
const firstSearchResultRef = useRef<HTMLAnchorElement>(null);
|
|
82
96
|
const searchKeysWithResults = items ? Object.keys(items).filter((key) => items[key]?.length) : [];
|
|
@@ -228,6 +242,9 @@ export function SearchDialog({
|
|
|
228
242
|
if (query.trim()) {
|
|
229
243
|
aiSearch.askQuestion(query);
|
|
230
244
|
}
|
|
245
|
+
telemetry.sendSearchAiOpenedMessage({
|
|
246
|
+
method: 'ai_search_button',
|
|
247
|
+
});
|
|
231
248
|
}}
|
|
232
249
|
>
|
|
233
250
|
{translate('search.ai.button', 'Search with AI')}
|
|
@@ -251,17 +268,22 @@ export function SearchDialog({
|
|
|
251
268
|
tabIndex={0}
|
|
252
269
|
icon={<ChevronLeftIcon />}
|
|
253
270
|
>
|
|
254
|
-
{
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
variant="secondary"
|
|
258
|
-
disabled={!aiSearch.conversation.length}
|
|
259
|
-
onClick={() => aiSearch.clearConversation()}
|
|
260
|
-
tabIndex={0}
|
|
261
|
-
icon={<EditIcon />}
|
|
262
|
-
>
|
|
263
|
-
{translate('search.ai.newConversation', 'New conversation')}
|
|
271
|
+
{isMobile
|
|
272
|
+
? translate('search.ai.back', 'Back')
|
|
273
|
+
: translate('search.ai.backToSearch', 'Back to search')}
|
|
264
274
|
</Button>
|
|
275
|
+
<AiDialogHeaderActionsWrapper>
|
|
276
|
+
<Button
|
|
277
|
+
variant="secondary"
|
|
278
|
+
disabled={!aiSearch.conversation.length}
|
|
279
|
+
onClick={() => aiSearch.clearConversation()}
|
|
280
|
+
tabIndex={0}
|
|
281
|
+
icon={<EditIcon />}
|
|
282
|
+
>
|
|
283
|
+
{translate('search.ai.newConversation', 'New conversation')}
|
|
284
|
+
</Button>
|
|
285
|
+
{isMobile && <Button variant="text" icon={<CloseIcon />} onClick={handleClose} />}
|
|
286
|
+
</AiDialogHeaderActionsWrapper>
|
|
265
287
|
</AiDialogHeaderWrapper>
|
|
266
288
|
)}
|
|
267
289
|
</SearchDialogHeader>
|
|
@@ -298,6 +320,9 @@ export function SearchDialog({
|
|
|
298
320
|
if (query.trim()) {
|
|
299
321
|
aiSearch.askQuestion(query);
|
|
300
322
|
}
|
|
323
|
+
telemetry.sendSearchAiOpenedMessage({
|
|
324
|
+
method: 'ai_search_input',
|
|
325
|
+
});
|
|
301
326
|
}}
|
|
302
327
|
onKeyDown={(e) => {
|
|
303
328
|
if (e.key === 'Enter') {
|
|
@@ -305,6 +330,9 @@ export function SearchDialog({
|
|
|
305
330
|
if (query.trim()) {
|
|
306
331
|
aiSearch.askQuestion(query);
|
|
307
332
|
}
|
|
333
|
+
telemetry.sendSearchAiOpenedMessage({
|
|
334
|
+
method: 'ai_search_input',
|
|
335
|
+
});
|
|
308
336
|
}
|
|
309
337
|
}}
|
|
310
338
|
ref={aiQueryRef}
|
|
@@ -527,6 +555,10 @@ const AiDialogHeaderWrapper = styled.div`
|
|
|
527
555
|
align-items: center;
|
|
528
556
|
width: 100%;
|
|
529
557
|
`;
|
|
558
|
+
const AiDialogHeaderActionsWrapper = styled.div`
|
|
559
|
+
display: flex;
|
|
560
|
+
gap: var(--spacing-xxs);
|
|
561
|
+
`;
|
|
530
562
|
|
|
531
563
|
const SearchDialogBody = styled.div`
|
|
532
564
|
display: flex;
|
|
@@ -643,6 +675,7 @@ const AiDisclaimer = styled.div`
|
|
|
643
675
|
line-height: var(--search-ai-disclaimer-line-height);
|
|
644
676
|
color: var(--search-ai-disclaimer-text-color);
|
|
645
677
|
margin: 0 auto;
|
|
678
|
+
text-align: center;
|
|
646
679
|
`;
|
|
647
680
|
|
|
648
681
|
const SearchWithAI = styled.div`
|
|
@@ -37,20 +37,21 @@ export const useTelemetryFallback = () => ({
|
|
|
37
37
|
sendLanguagePickerLocaleChangedMessage: () => {},
|
|
38
38
|
sendSearchOpenedMessage: () => {},
|
|
39
39
|
sendSearchQueryMessage: () => {},
|
|
40
|
+
sendSearchAiOpenedMessage: () => {},
|
|
40
41
|
sendSearchAIQueryMessage: () => {},
|
|
41
42
|
sendFeedbackMessage: () => {},
|
|
42
43
|
sendSearchResultClickedMessage: () => {},
|
|
43
44
|
sendRedirectMessage: () => {},
|
|
44
45
|
sendOpenapiDocsMessage: () => {},
|
|
45
46
|
sendCopyCodeSnippetClickedMessage: () => {},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
sendViewedMessage: () => {},
|
|
48
|
+
sendPerformanceMetricsMessage: () => {},
|
|
49
|
+
sendDownloadDefinitionClickedMessage: () => {},
|
|
50
|
+
sendSelectLanguageClickedMessage: () => {},
|
|
51
|
+
sendExpandCollapseAllClickedMessage: () => {},
|
|
52
|
+
sendSwitchServersClickedMessage: () => {},
|
|
53
|
+
sendExamplesSwitcherClickedMessage: () => {},
|
|
54
|
+
sendTryItOpenedMessage: () => {},
|
|
54
55
|
sendAsyncapiDocsViewedMessage: () => {},
|
|
55
56
|
sendAsyncapiDocsPerformanceMetricsMessage: () => {},
|
|
56
57
|
sendAsyncapiDocsSwitchMessageClickedMessage: () => {},
|
package/src/core/styles/dark.ts
CHANGED
|
@@ -36,6 +36,10 @@ const replayDarkMode = css`
|
|
|
36
36
|
--replay-server-variable-bg-color-hover: rgba(31, 10, 144, 0.4); // @presenter Color
|
|
37
37
|
--replay-path-parameter-bg-color-hover: rgba(5, 88, 99, 0.4); // @presenter Color
|
|
38
38
|
|
|
39
|
+
--replay-runtime-expression-color: rgba(147, 166, 249, 1); // @presenter Color
|
|
40
|
+
--replay-runtime-expression-bg-color: rgba(147, 166, 249, 0.16); // @presenter Color
|
|
41
|
+
--replay-operators-color: rgba(168, 143, 88, 1); // @presenter Color
|
|
42
|
+
|
|
39
43
|
// @tokens End
|
|
40
44
|
`;
|
|
41
45
|
|
|
@@ -1224,6 +1224,10 @@ const replay = css`
|
|
|
1224
1224
|
--replay-server-variable-bg-color-hover: rgba(119, 45, 240, 0.16); // @presenter Color
|
|
1225
1225
|
--replay-path-parameter-bg-color-hover: rgba(4, 117, 161, 0.16); // @presenter Color
|
|
1226
1226
|
|
|
1227
|
+
--replay-runtime-expression-color: rgba(54, 90, 249, 1); // @presenter Color
|
|
1228
|
+
--replay-runtime-expression-bg-color: rgba(54, 90, 249, 0.08); // @presenter Color
|
|
1229
|
+
--replay-operators-color: rgba(193, 142, 31, 1); // @presenter Color
|
|
1230
|
+
|
|
1227
1231
|
// @tokens End
|
|
1228
1232
|
`;
|
|
1229
1233
|
|
package/src/core/types/l10n.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path d="M10.5 4.5V3.75H8.25V1.5H7.5V3.75H4.5V1.5H3.75V3.75H1.5V4.5H3.75V7.5H1.5V8.25H3.75V10.5H4.5V8.25H7.5V10.5H8.25V8.25H10.5V7.5H8.25V4.5H10.5ZM7.5 7.5H4.5V4.5H7.5V7.5Z" />
|
|
11
|
+
</svg>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const HashtagIcon = styled(Icon).attrs(() => ({
|
|
15
|
+
'data-component-name': 'icons/HashtagIcon/HashtagIcon',
|
|
16
|
+
}))<IconProps>`
|
|
17
|
+
path {
|
|
18
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
height: ${({ size }) => size || '16px'};
|
|
22
|
+
width: ${({ size }) => size || '16px'};
|
|
23
|
+
`;
|
package/src/index.ts
CHANGED
|
@@ -287,6 +287,7 @@ export * from '@redocly/theme/icons/RedoclyIcon/RedoclyIcon';
|
|
|
287
287
|
export * from '@redocly/theme/icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon';
|
|
288
288
|
export * from '@redocly/theme/icons/GenericIcon/GenericIcon';
|
|
289
289
|
export * from '@redocly/theme/icons/ShareIcon/ShareIcon';
|
|
290
|
+
export * from '@redocly/theme/icons/HashtagIcon/HashtagIcon';
|
|
290
291
|
/* Layouts */
|
|
291
292
|
export * from '@redocly/theme/layouts/RootLayout';
|
|
292
293
|
export * from '@redocly/theme/layouts/PageLayout';
|