@redocly/theme 0.59.0-next.7 → 0.59.0-next.9
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 +1 -1
- package/lib/components/Catalog/CatalogFilter/CatalogFilter.js +4 -0
- package/lib/components/Search/SearchAiActionButtons.d.ts +10 -0
- package/lib/components/Search/SearchAiActionButtons.js +43 -0
- package/lib/components/Search/SearchAiDialog.d.ts +3 -6
- package/lib/components/Search/SearchAiDialog.js +20 -9
- package/lib/components/Search/SearchAiMessage.d.ts +9 -5
- package/lib/components/Search/SearchAiMessage.js +146 -22
- package/lib/components/Search/SearchAiNegativeFeedbackForm.d.ts +8 -0
- package/lib/components/Search/SearchAiNegativeFeedbackForm.js +169 -0
- package/lib/components/Search/variables.js +29 -66
- package/lib/core/hooks/index.d.ts +1 -0
- package/lib/core/hooks/index.js +1 -0
- package/lib/core/hooks/search/use-feedback-tooltip.d.ts +6 -0
- package/lib/core/hooks/search/use-feedback-tooltip.js +26 -0
- package/lib/core/hooks/use-telemetry-fallback.d.ts +1 -0
- package/lib/core/hooks/use-telemetry-fallback.js +1 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/search.d.ts +11 -4
- package/lib/core/types/search.js +6 -0
- package/lib/core/utils/frontmatter-translate.d.ts +6 -0
- package/lib/core/utils/frontmatter-translate.js +14 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/icons/ThumbDownFilledIcon/ThumbDownFilledIcon.d.ts +9 -0
- package/lib/icons/ThumbDownFilledIcon/ThumbDownFilledIcon.js +34 -0
- package/lib/icons/ThumbUpFilledIcon/ThumbUpFilledIcon.d.ts +9 -0
- package/lib/icons/ThumbUpFilledIcon/ThumbUpFilledIcon.js +34 -0
- package/package.json +3 -3
- package/src/components/Buttons/AIAssistantButton.tsx +1 -1
- package/src/components/Catalog/CatalogFilter/CatalogFilter.tsx +5 -0
- package/src/components/Search/SearchAiActionButtons.tsx +76 -0
- package/src/components/Search/SearchAiDialog.tsx +52 -23
- package/src/components/Search/SearchAiMessage.tsx +172 -43
- package/src/components/Search/SearchAiNegativeFeedbackForm.tsx +210 -0
- package/src/components/Search/variables.ts +29 -66
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/search/use-feedback-tooltip.ts +32 -0
- package/src/core/hooks/use-telemetry-fallback.ts +1 -0
- package/src/core/types/l10n.ts +3 -0
- package/src/core/types/search.ts +13 -4
- package/src/core/utils/frontmatter-translate.ts +9 -0
- package/src/core/utils/index.ts +1 -0
- package/src/icons/ThumbDownFilledIcon/ThumbDownFilledIcon.tsx +38 -0
- package/src/icons/ThumbUpFilledIcon/ThumbUpFilledIcon.tsx +35 -0
|
@@ -146,27 +146,24 @@ exports.search = (0, styled_components_1.css) `
|
|
|
146
146
|
/**
|
|
147
147
|
* @tokens AI Search
|
|
148
148
|
*/
|
|
149
|
-
|
|
149
|
+
|
|
150
150
|
--search-ai-gradient: linear-gradient(to right, #715efe, #ff5cdc);
|
|
151
151
|
|
|
152
|
-
--search-ai-spinner-icon-color: var(--icon-color-interactive);
|
|
153
|
-
--search-ai-checkmark-icon-color: var(--icon-color-interactive);
|
|
154
152
|
--search-ai-response-padding: var(--spacing-lg);
|
|
155
153
|
--search-ai-response-gap: var(--spacing-sm);
|
|
156
|
-
|
|
157
154
|
--search-ai-response-header-gap: var(--spacing-md);
|
|
155
|
+
--search-ai-response-body-gap: var(--spacing-xl);
|
|
156
|
+
--search-ai-response-body-padding: 0 40px;
|
|
158
157
|
|
|
159
158
|
--search-ai-question-font-size: var(--font-size-xl);
|
|
160
159
|
--search-ai-question-font-weight: var(--font-weight-semibold);
|
|
161
160
|
--search-ai-question-line-height: var(--line-height-xl);
|
|
162
161
|
--search-ai-question-text-color: var(--text-color-primary);
|
|
163
162
|
|
|
164
|
-
--search-ai-response-body-gap: var(--spacing-xl);
|
|
165
|
-
--search-ai-response-body-padding: 0 40px;
|
|
166
|
-
|
|
167
163
|
--search-ai-text-color: var(--text-color-secondary);
|
|
168
164
|
--search-ai-text-font-size: var(--font-size-lg);
|
|
169
165
|
--search-ai-text-line-height: var(--line-height-lg);
|
|
166
|
+
--search-ai-thinking-text-margin: var(--md-pre-margin) 0;
|
|
170
167
|
|
|
171
168
|
--search-ai-user-bg-color: var(--color-blue-6);
|
|
172
169
|
--search-ai-user-text-color: var(--color-static-white);
|
|
@@ -175,40 +172,50 @@ exports.search = (0, styled_components_1.css) `
|
|
|
175
172
|
--search-ai-assistant-border: 1px solid var(--border-color-primary);
|
|
176
173
|
--search-ai-assistant-message-max-width: 80%;
|
|
177
174
|
|
|
178
|
-
--search-ai-
|
|
175
|
+
--search-ai-icon-size: 32px;
|
|
176
|
+
--search-ai-icon-bg-color: var(--search-ai-gradient);
|
|
177
|
+
--search-ai-icon-color: var(--color-static-white);
|
|
178
|
+
--search-ai-icon-wrapper-padding: var(--spacing-xs);
|
|
179
|
+
|
|
180
|
+
--search-ai-resources-gap: var(--spacing-xxs);
|
|
179
181
|
--search-ai-resources-title-font-weight: var(--font-weight-medium);
|
|
180
182
|
--search-ai-resources-title-font-size: var(--font-size-lg);
|
|
181
183
|
--search-ai-resources-title-line-height: var(--line-height-lg);
|
|
182
184
|
|
|
183
|
-
--search-ai-resource-tags-gap: var(--spacing-
|
|
185
|
+
--search-ai-resource-tags-gap: var(--spacing-xxs);
|
|
184
186
|
--search-ai-resource-tag-text-color: var(--text-color-secondary);
|
|
185
187
|
--search-ai-resource-tag-icon-color: var(--text-color-secondary);
|
|
186
188
|
--search-ai-resource-tag-icon-size: 16px;
|
|
187
189
|
|
|
188
|
-
--search-ai-
|
|
189
|
-
--search-ai-
|
|
190
|
-
--search-ai-
|
|
191
|
-
|
|
192
|
-
--search-ai-
|
|
190
|
+
--search-ai-suggestions-gap: var(--spacing-sm);
|
|
191
|
+
--search-ai-suggestions-margin-left: var(--spacing-xs);
|
|
192
|
+
--search-ai-suggestion-item-gap: var(--spacing-xxs);
|
|
193
|
+
--search-ai-suggestions-title-text-color: var(--text-color-description);
|
|
194
|
+
--search-ai-suggestions-title-font-size: var(--font-size-base);
|
|
195
|
+
--search-ai-suggestions-title-line-height: var(--line-height-base);
|
|
196
|
+
--search-ai-suggestions-title-font-weight: var(--font-weight-light);
|
|
197
|
+
--search-ai-suggestions-text-color: var(--text-color-description);
|
|
193
198
|
|
|
194
199
|
--search-ai-thinking-dots-gap: 4px;
|
|
195
200
|
--search-ai-thinking-dots-padding: 4px 0;
|
|
196
201
|
--search-ai-thinking-dot-size: 6px;
|
|
197
202
|
--search-ai-thinking-dot-color: var(--search-ai-gradient);
|
|
198
203
|
|
|
204
|
+
--search-ai-spinner-icon-color: var(--icon-color-interactive);
|
|
205
|
+
--search-ai-checkmark-icon-color: var(--icon-color-interactive);
|
|
206
|
+
|
|
207
|
+
--search-ai-feedback-gap: var(--spacing-xxs);
|
|
208
|
+
|
|
209
|
+
--search-ai-feedback-form-bg-color: var(--background-color-secondary);
|
|
210
|
+
--search-ai-feedback-form-border-color: var(--border-color-primary);
|
|
211
|
+
|
|
199
212
|
--search-ai-disclaimer-font-size: var(--font-size-sm);
|
|
200
213
|
--search-ai-disclaimer-line-height: var(--line-height-sm);
|
|
201
214
|
--search-ai-disclaimer-text-color: var(--text-color-secondary);
|
|
202
215
|
|
|
203
|
-
|
|
204
216
|
--search-ai-welcome-margin: var(--spacing-md);
|
|
205
|
-
--search-ai-icon-wrapper-padding: var(--spacing-xs);
|
|
206
217
|
|
|
207
|
-
--search-ai-
|
|
208
|
-
--search-ai-suggestions-title-font-size: var(--font-size-base);
|
|
209
|
-
--search-ai-suggestions-title-line-height: var(--line-height-base);
|
|
210
|
-
--search-ai-suggestions-title-font-weight: var(--font-weight-light);
|
|
211
|
-
--search-ai-suggestions-text-color: var(--text-color-description);
|
|
218
|
+
--search-ai-button-icon-color: none;
|
|
212
219
|
|
|
213
220
|
--search-ai-conversation-input-send-button-bg-color: var(--button-bg-color-primary);
|
|
214
221
|
--search-ai-conversation-input-send-button-bg-color-hover: var(--button-bg-color-primary-hover);
|
|
@@ -246,52 +253,8 @@ exports.search = (0, styled_components_1.css) `
|
|
|
246
253
|
|
|
247
254
|
--search-ai-conversation-input-send-button-right: 12px;
|
|
248
255
|
--search-ai-conversation-input-send-button-padding: 5px;
|
|
249
|
-
--search-ai-conversation-input-send-button-bg-color: var(--button-bg-color-primary);
|
|
250
|
-
--search-ai-conversation-input-send-button-bg-color-hover: var(--button-bg-color-primary-hover);
|
|
251
|
-
--search-ai-conversation-input-send-button-bg-color-disabled: var(--button-bg-color-disabled);
|
|
252
|
-
--search-ai-conversation-input-send-button-border-disabled: 1px solid var(--button-border-color-disabled);
|
|
253
256
|
--search-ai-conversation-input-send-button-border-radius: var(--border-radius);
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* @tokens AI Search Response
|
|
257
|
-
*/
|
|
258
|
-
--search-ai-response-padding: var(--spacing-lg);
|
|
259
|
-
--search-ai-response-gap: var(--spacing-sm);
|
|
260
|
-
--search-ai-response-header-gap: var(--spacing-md);
|
|
261
|
-
--search-ai-response-body-gap: var(--spacing-xl);
|
|
262
|
-
--search-ai-response-body-padding: 0 40px;
|
|
263
|
-
|
|
264
|
-
--search-ai-text-color: var(--text-color-secondary);
|
|
265
|
-
--search-ai-text-font-size: var(--font-size-lg);
|
|
266
|
-
--search-ai-text-line-height: var(--line-height-lg);
|
|
267
|
-
|
|
268
|
-
--search-ai-thinking-text-margin: var(--md-pre-margin) 0;
|
|
269
|
-
|
|
270
|
-
--search-ai-question-font-size: var(--font-size-xl);
|
|
271
|
-
--search-ai-question-font-weight: var(--font-weight-semibold);
|
|
272
|
-
--search-ai-question-line-height: var(--line-height-xl);
|
|
273
|
-
--search-ai-question-text-color: var(--text-color-primary);
|
|
274
|
-
|
|
275
|
-
--search-ai-resources-gap: var(--spacing-base);
|
|
276
|
-
--search-ai-resources-title-font-weight: var(--font-weight-medium);
|
|
277
|
-
--search-ai-resources-title-font-size: var(--font-size-lg);
|
|
278
|
-
--search-ai-resources-title-line-height: var(--line-height-lg);
|
|
279
|
-
|
|
280
|
-
--search-ai-resource-tags-gap: var(--spacing-base);
|
|
281
|
-
--search-ai-resource-tag-text-color: var(--text-color-secondary);
|
|
282
|
-
--search-ai-resource-tag-icon-color: var(--text-color-secondary);
|
|
283
|
-
|
|
284
|
-
--search-ai-suggestions-gap: var(--spacing-sm);
|
|
285
|
-
--search-ai-suggestions-margin-left: var(--spacing-xs);
|
|
286
|
-
--search-ai-suggestion-item-gap: var(--spacing-xxs);
|
|
287
|
-
|
|
288
|
-
--search-ai-suggestions-title-text-color: var(--text-color-description);
|
|
289
|
-
--search-ai-suggestions-title-font-size: var(--font-size-base);
|
|
290
|
-
--search-ai-suggestions-title-line-height: var(--line-height-base);
|
|
291
|
-
--search-ai-suggestions-title-font-weight: var(--font-weight-light);
|
|
292
|
-
|
|
293
|
-
--search-ai-spinner-icon-color: var(--icon-color-interactive);
|
|
294
|
-
--search-ai-checkmark-icon-color: var(--icon-color-interactive);
|
|
257
|
+
--search-ai-conversation-input-send-button-border-disabled: 1px solid var(--button-border-color-disabled);
|
|
295
258
|
|
|
296
259
|
// @tokens End
|
|
297
260
|
`;
|
|
@@ -26,6 +26,7 @@ export * from './use-language-picker';
|
|
|
26
26
|
export * from './use-product-picker';
|
|
27
27
|
export * from './search/use-search-dialog';
|
|
28
28
|
export * from './search/use-search-filter';
|
|
29
|
+
export * from './search/use-feedback-tooltip';
|
|
29
30
|
export * from './use-controlled-state';
|
|
30
31
|
export * from './use-codeblock-tabs-controls';
|
|
31
32
|
export * from './code-walkthrough/use-code-walkthrough';
|
package/lib/core/hooks/index.js
CHANGED
|
@@ -42,6 +42,7 @@ __exportStar(require("./use-language-picker"), exports);
|
|
|
42
42
|
__exportStar(require("./use-product-picker"), exports);
|
|
43
43
|
__exportStar(require("./search/use-search-dialog"), exports);
|
|
44
44
|
__exportStar(require("./search/use-search-filter"), exports);
|
|
45
|
+
__exportStar(require("./search/use-feedback-tooltip"), exports);
|
|
45
46
|
__exportStar(require("./use-controlled-state"), exports);
|
|
46
47
|
__exportStar(require("./use-codeblock-tabs-controls"), exports);
|
|
47
48
|
__exportStar(require("./code-walkthrough/use-code-walkthrough"), exports);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFeedbackTooltip = useFeedbackTooltip;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const use_control_1 = require("../use-control");
|
|
6
|
+
const DEFAULT_TOOLTIP_DURATION = 1500;
|
|
7
|
+
function useFeedbackTooltip() {
|
|
8
|
+
const [closeTooltipTimeout, setCloseTooltipTimeout] = (0, react_1.useState)(null);
|
|
9
|
+
const tooltipControl = (0, use_control_1.useControl)();
|
|
10
|
+
const showTooltip = () => {
|
|
11
|
+
tooltipControl.handleOpen();
|
|
12
|
+
if (closeTooltipTimeout) {
|
|
13
|
+
clearTimeout(closeTooltipTimeout);
|
|
14
|
+
}
|
|
15
|
+
const newCloseTooltipTimeout = setTimeout(() => {
|
|
16
|
+
tooltipControl.handleClose();
|
|
17
|
+
setCloseTooltipTimeout(null);
|
|
18
|
+
}, DEFAULT_TOOLTIP_DURATION);
|
|
19
|
+
setCloseTooltipTimeout(newCloseTooltipTimeout);
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
isOpen: tooltipControl.isOpened,
|
|
23
|
+
showTooltip,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=use-feedback-tooltip.js.map
|
|
@@ -38,6 +38,7 @@ export declare const useTelemetryFallback: () => {
|
|
|
38
38
|
sendSearchQueryMessage: () => void;
|
|
39
39
|
sendSearchAiOpenedMessage: () => void;
|
|
40
40
|
sendSearchAIQueryMessage: () => void;
|
|
41
|
+
sendSearchAIFeedbackMessage: () => void;
|
|
41
42
|
sendFeedbackMessage: () => void;
|
|
42
43
|
sendSearchResultClickedMessage: () => void;
|
|
43
44
|
sendRedirectMessage: () => void;
|
|
@@ -42,6 +42,7 @@ const useTelemetryFallback = () => ({
|
|
|
42
42
|
sendSearchQueryMessage: () => { },
|
|
43
43
|
sendSearchAiOpenedMessage: () => { },
|
|
44
44
|
sendSearchAIQueryMessage: () => { },
|
|
45
|
+
sendSearchAIFeedbackMessage: () => { },
|
|
45
46
|
sendFeedbackMessage: () => { },
|
|
46
47
|
sendSearchResultClickedMessage: () => { },
|
|
47
48
|
sendRedirectMessage: () => { },
|
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.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.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' | '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;
|
|
@@ -82,11 +82,18 @@ export type AiSearchErrorConfig = {
|
|
|
82
82
|
messageKey: string;
|
|
83
83
|
messageDefault: string;
|
|
84
84
|
};
|
|
85
|
+
export declare enum FeedbackType {
|
|
86
|
+
Like = "like",
|
|
87
|
+
Dislike = "dislike"
|
|
88
|
+
}
|
|
89
|
+
export type SearchAiMessageResource = {
|
|
90
|
+
url: string;
|
|
91
|
+
title: string;
|
|
92
|
+
};
|
|
85
93
|
export type AiSearchConversationItem = {
|
|
86
94
|
role: AiSearchConversationRole;
|
|
87
95
|
content: string;
|
|
88
|
-
resources?:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}[];
|
|
96
|
+
resources?: SearchAiMessageResource[];
|
|
97
|
+
messageId?: string;
|
|
98
|
+
feedback?: FeedbackType;
|
|
92
99
|
};
|
package/lib/core/types/search.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FeedbackType = void 0;
|
|
4
|
+
var FeedbackType;
|
|
5
|
+
(function (FeedbackType) {
|
|
6
|
+
FeedbackType["Like"] = "like";
|
|
7
|
+
FeedbackType["Dislike"] = "dislike";
|
|
8
|
+
})(FeedbackType || (exports.FeedbackType = FeedbackType = {}));
|
|
3
9
|
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility function for use in React frontmatter
|
|
3
|
+
* This function creates a string that will be processed by the frontmatter loader
|
|
4
|
+
* to convert it into a translation key object
|
|
5
|
+
*/
|
|
6
|
+
export declare const frontmatterTranslate: (key: string, defaultValue: string) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.frontmatterTranslate = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Utility function for use in React frontmatter
|
|
6
|
+
* This function creates a string that will be processed by the frontmatter loader
|
|
7
|
+
* to convert it into a translation key object
|
|
8
|
+
*/
|
|
9
|
+
const frontmatterTranslate = (key, defaultValue) => {
|
|
10
|
+
const escapedDefaultValue = defaultValue.replace(/'/g, "\\'");
|
|
11
|
+
return `frontmatterTranslate('${key}', '${escapedDefaultValue}')`;
|
|
12
|
+
};
|
|
13
|
+
exports.frontmatterTranslate = frontmatterTranslate;
|
|
14
|
+
//# sourceMappingURL=frontmatter-translate.js.map
|
package/lib/core/utils/index.js
CHANGED
|
@@ -54,4 +54,5 @@ __exportStar(require("./enhanced-smoothstep"), exports);
|
|
|
54
54
|
__exportStar(require("./icon-resolver"), exports);
|
|
55
55
|
__exportStar(require("./dynamic"), exports);
|
|
56
56
|
__exportStar(require("./tabs"), exports);
|
|
57
|
+
__exportStar(require("./frontmatter-translate"), exports);
|
|
57
58
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const ThumbDownFilledIcon: 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,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ThumbDownFilledIcon = void 0;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
20
|
+
const utils_1 = require("../../core/utils");
|
|
21
|
+
const Icon = (props) => {
|
|
22
|
+
const { color } = props, restProps = __rest(props, ["color"]);
|
|
23
|
+
return (react_1.default.createElement("svg", Object.assign({ width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, restProps),
|
|
24
|
+
react_1.default.createElement("path", { d: "M3.0625 0.875H0.875V7H3.0625V0.875Z", fill: (0, utils_1.getCssColorVariable)(color) || '#DCDDE5' }),
|
|
25
|
+
react_1.default.createElement("path", { d: "M10.0625 0.875H3.9375V7.35118L5.26846 9.34771L5.63828 11.9362C5.66886 12.1443 5.77308 12.3346 5.932 12.4725C6.09092 12.6103 6.29402 12.6866 6.5044 12.6875H6.5625C6.91048 12.6871 7.2441 12.5487 7.49016 12.3027C7.73621 12.0566 7.87462 11.723 7.875 11.375V8.75H11.375C11.839 8.74948 12.2838 8.56494 12.6119 8.23686C12.9399 7.90879 13.1245 7.46397 13.125 7V3.9375C13.1241 3.12555 12.8012 2.34712 12.227 1.77298C11.6529 1.19885 10.8744 0.875903 10.0625 0.875Z", fill: (0, utils_1.getCssColorVariable)(color) || '#DCDDE5' })));
|
|
26
|
+
};
|
|
27
|
+
exports.ThumbDownFilledIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
28
|
+
'data-component-name': 'icons/ThumbDownFilledIcon/ThumbDownFilledIcon',
|
|
29
|
+
})) `
|
|
30
|
+
height: ${({ size }) => size || '14px'};
|
|
31
|
+
width: ${({ size }) => size || '14px'};
|
|
32
|
+
color: ${({ color }) => color && (0, utils_1.getCssColorVariable)(color)};
|
|
33
|
+
`;
|
|
34
|
+
//# sourceMappingURL=ThumbDownFilledIcon.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const ThumbUpFilledIcon: 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,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ThumbUpFilledIcon = void 0;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
20
|
+
const utils_1 = require("../../core/utils");
|
|
21
|
+
const Icon = (props) => {
|
|
22
|
+
const { color } = props, restProps = __rest(props, ["color"]);
|
|
23
|
+
return (react_1.default.createElement("svg", Object.assign({ width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, restProps),
|
|
24
|
+
react_1.default.createElement("path", { d: "M3.0625 7H0.875V13.125H3.0625V7Z", fill: (0, utils_1.getCssColorVariable)(color) || '#DCDDE5' }),
|
|
25
|
+
react_1.default.createElement("path", { d: "M10.0625 13.125H3.9375V6.64882L5.26846 4.65229L5.63828 2.06382C5.66886 1.85567 5.77308 1.66539 5.932 1.52753C6.09092 1.38967 6.29402 1.31338 6.5044 1.3125H6.5625C6.91048 1.31288 7.2441 1.45129 7.49016 1.69734C7.73621 1.9434 7.87462 2.27702 7.875 2.625V5.25H11.375C11.839 5.25052 12.2838 5.43506 12.6119 5.76314C12.9399 6.09121 13.1245 6.53603 13.125 7V10.0625C13.1241 10.8744 12.8012 11.6529 12.227 12.227C11.6529 12.8012 10.8744 13.1241 10.0625 13.125Z", fill: (0, utils_1.getCssColorVariable)(color) || '#DCDDE5' })));
|
|
26
|
+
};
|
|
27
|
+
exports.ThumbUpFilledIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
28
|
+
'data-component-name': 'icons/ThumbUpFilledIcon/ThumbUpFilledIcon',
|
|
29
|
+
})) `
|
|
30
|
+
height: ${({ size }) => size || '14px'};
|
|
31
|
+
width: ${({ size }) => size || '14px'};
|
|
32
|
+
color: ${({ color }) => color && (0, utils_1.getCssColorVariable)(color)};
|
|
33
|
+
`;
|
|
34
|
+
//# sourceMappingURL=ThumbUpFilledIcon.js.map
|
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.9",
|
|
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.2",
|
|
91
|
+
"@redocly/realm-asyncapi-sdk": "0.5.0-next.3"
|
|
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\")",
|
|
@@ -26,6 +26,11 @@ export function CatalogFilter({
|
|
|
26
26
|
}: CatalogFilterProps): JSX.Element | null {
|
|
27
27
|
if (!filter.parentUsed) return null;
|
|
28
28
|
|
|
29
|
+
const filteredOptions = filter.filteredOptions || filter.options;
|
|
30
|
+
if (!filteredOptions || filteredOptions.length === 0) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
29
34
|
const FilterComponent = filterComponents[(filter.type || 'checkboxes') as FilterTypes];
|
|
30
35
|
|
|
31
36
|
return (
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { JSX } from 'react';
|
|
5
|
+
|
|
6
|
+
import { FeedbackType } from '@redocly/theme/core/types';
|
|
7
|
+
import { Button } from '@redocly/theme/components/Button/Button';
|
|
8
|
+
import { ThumbUpIcon } from '@redocly/theme/icons/ThumbUpIcon/ThumbUpIcon';
|
|
9
|
+
import { ThumbUpFilledIcon } from '@redocly/theme/icons/ThumbUpFilledIcon/ThumbUpFilledIcon';
|
|
10
|
+
import { ThumbDownIcon } from '@redocly/theme/icons/ThumbDownIcon/ThumbDownIcon';
|
|
11
|
+
import { ThumbDownFilledIcon } from '@redocly/theme/icons/ThumbDownFilledIcon/ThumbDownFilledIcon';
|
|
12
|
+
import { CopyButton } from '@redocly/theme/components/Buttons/CopyButton';
|
|
13
|
+
|
|
14
|
+
export type SearchAiActionButtonsProps = {
|
|
15
|
+
content: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
feedback?: FeedbackType;
|
|
18
|
+
onFeedback: (feedback: FeedbackType) => void;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function SearchAiActionButtons({
|
|
23
|
+
content,
|
|
24
|
+
className,
|
|
25
|
+
feedback,
|
|
26
|
+
onFeedback,
|
|
27
|
+
disabled,
|
|
28
|
+
}: SearchAiActionButtonsProps): JSX.Element {
|
|
29
|
+
return (
|
|
30
|
+
<ActionButtonsWrapper className={className} data-component-name="Search/SearchAiActionButtons">
|
|
31
|
+
<CopyButton data={content} />
|
|
32
|
+
<FeedbackButton
|
|
33
|
+
variant="text"
|
|
34
|
+
size="small"
|
|
35
|
+
icon={feedback === FeedbackType.Like ? <ThumbUpFilledIcon /> : <ThumbUpIcon />}
|
|
36
|
+
onClick={() => !disabled && onFeedback(FeedbackType.Like)}
|
|
37
|
+
extraClass={feedback === FeedbackType.Like ? 'active' : ''}
|
|
38
|
+
aria-label="Like this response"
|
|
39
|
+
disabled={disabled}
|
|
40
|
+
/>
|
|
41
|
+
|
|
42
|
+
<FeedbackButton
|
|
43
|
+
variant="text"
|
|
44
|
+
size="small"
|
|
45
|
+
icon={feedback === FeedbackType.Dislike ? <ThumbDownFilledIcon /> : <ThumbDownIcon />}
|
|
46
|
+
onClick={() => !disabled && onFeedback(FeedbackType.Dislike)}
|
|
47
|
+
extraClass={feedback === FeedbackType.Dislike ? 'active' : ''}
|
|
48
|
+
aria-label="Dislike this response"
|
|
49
|
+
disabled={disabled}
|
|
50
|
+
/>
|
|
51
|
+
</ActionButtonsWrapper>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const ActionButtonsWrapper = styled.div`
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: var(--search-ai-feedback-gap);
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
const FeedbackButton = styled(Button)`
|
|
62
|
+
&:disabled {
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
cursor: default;
|
|
65
|
+
opacity: 1;
|
|
66
|
+
background-color: var(--button-bg-color);
|
|
67
|
+
color: var(--button-color);
|
|
68
|
+
border-color: var(--button-border-color);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:disabled.active {
|
|
72
|
+
background-color: var(--button-bg-color-active);
|
|
73
|
+
border-color: var(--button-border-color-active);
|
|
74
|
+
color: var(--button-color-active);
|
|
75
|
+
}
|
|
76
|
+
`;
|