@redocly/theme 0.45.9 → 0.45.10
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/Markdown/Markdown.js +4 -0
- package/lib/components/Search/SearchDialog.js +1 -1
- package/lib/core/types/hooks.d.ts +3 -1
- package/package.json +1 -1
- package/src/components/Markdown/Markdown.tsx +4 -0
- package/src/components/Search/SearchDialog.tsx +1 -1
- package/src/core/types/hooks.ts +1 -1
|
@@ -54,7 +54,7 @@ function SearchDialog({ onClose, className }) {
|
|
|
54
54
|
const autoSearchDisabled = mode !== 'search';
|
|
55
55
|
const { query, setQuery, filter, setFilter, items, isSearchLoading, facets, setLoadMore, advancedSearch, askAi, } = useSearch(product === null || product === void 0 ? void 0 : product.name, autoSearchDisabled);
|
|
56
56
|
const { isFilterOpen, onFilterToggle, onFilterChange, onFilterReset, onFacetReset, onTopFacetsReset, } = (0, hooks_1.useSearchFilter)(filter, setFilter);
|
|
57
|
-
const aiSearch = useAiSearch();
|
|
57
|
+
const aiSearch = useAiSearch({ filter });
|
|
58
58
|
const modalRef = (0, react_1.useRef)(null);
|
|
59
59
|
const { translate } = useTranslate();
|
|
60
60
|
(0, hooks_1.useDialogHotKeys)(modalRef, onClose);
|
|
@@ -60,7 +60,9 @@ export type ThemeHooks = {
|
|
|
60
60
|
advancedSearch?: boolean;
|
|
61
61
|
askAi?: boolean;
|
|
62
62
|
};
|
|
63
|
-
useAiSearch: (
|
|
63
|
+
useAiSearch: (options?: {
|
|
64
|
+
filter?: SearchFilterItem[];
|
|
65
|
+
}) => {
|
|
64
66
|
askQuestion: (question: string) => void;
|
|
65
67
|
isGeneratingResponse: boolean;
|
|
66
68
|
question: string;
|
package/package.json
CHANGED
|
@@ -53,7 +53,7 @@ export function SearchDialog({ onClose, className }: SearchDialogProps): JSX.Ele
|
|
|
53
53
|
onFacetReset,
|
|
54
54
|
onTopFacetsReset,
|
|
55
55
|
} = useSearchFilter(filter, setFilter);
|
|
56
|
-
const aiSearch = useAiSearch();
|
|
56
|
+
const aiSearch = useAiSearch({ filter });
|
|
57
57
|
|
|
58
58
|
const modalRef = useRef<HTMLDivElement>(null);
|
|
59
59
|
const { translate } = useTranslate();
|
package/src/core/types/hooks.ts
CHANGED
|
@@ -77,7 +77,7 @@ export type ThemeHooks = {
|
|
|
77
77
|
advancedSearch?: boolean;
|
|
78
78
|
askAi?: boolean;
|
|
79
79
|
};
|
|
80
|
-
useAiSearch: () => {
|
|
80
|
+
useAiSearch: (options?: { filter?: SearchFilterItem[] }) => {
|
|
81
81
|
askQuestion: (question: string) => void;
|
|
82
82
|
isGeneratingResponse: boolean;
|
|
83
83
|
question: string;
|