@brainfish-ai/components 0.15.0 → 0.15.1
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/dist/esm/chunks/{ChatSearch.C9Kg6j_Y.js → ChatSearch.DsnO9IEM.js} +15 -3
- package/dist/esm/chunks/{ChatSearch.C9Kg6j_Y.js.map → ChatSearch.DsnO9IEM.js.map} +1 -1
- package/dist/esm/chunks/{FormattedMessage.aTY_CSO9.js → FormattedMessage.DdZqirSo.js} +5 -5
- package/dist/esm/chunks/{FormattedMessage.aTY_CSO9.js.map → FormattedMessage.DdZqirSo.js.map} +1 -1
- package/dist/esm/components/chat-search.js +1 -1
- package/dist/esm/components/markdown.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/stats.html +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { motion, AnimatePresence } from 'framer-motion';
|
|
|
3
3
|
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '../components/ui/tooltip.js';
|
|
4
4
|
import { Button } from '../components/ui/button.js';
|
|
5
5
|
import { XCircle, Check, Copy, CaretDown, ArrowSquareOut, CaretRight, ArrowsVertical, ArrowDown, Globe, LockSimple, MagnifyingGlass, X, Image, ArrowRight, ArrowLeft, ArrowsInSimple, ArrowsOutSimple } from '@phosphor-icons/react';
|
|
6
|
-
import { F as FormattedMessage, c as addPopupWidgetUtm } from './FormattedMessage.
|
|
6
|
+
import { F as FormattedMessage, c as addPopupWidgetUtm } from './FormattedMessage.DdZqirSo.js';
|
|
7
7
|
import { appendErrors, useForm, Controller } from 'react-hook-form';
|
|
8
8
|
import { validateFieldsNatively, toNestErrors } from '@hookform/resolvers';
|
|
9
9
|
import require$$0 from 'ajv';
|
|
@@ -5372,7 +5372,19 @@ function useAutocomplete({
|
|
|
5372
5372
|
conversationId,
|
|
5373
5373
|
allowedRegions
|
|
5374
5374
|
});
|
|
5375
|
-
|
|
5375
|
+
if (payload?.response?.results) {
|
|
5376
|
+
const lowerCaseQuery = debouncedQuery.toLowerCase();
|
|
5377
|
+
const sortedSuggestions = payload.response.results.sort((a, b) => {
|
|
5378
|
+
const aStartsWithQuery = a.question.toLowerCase().startsWith(lowerCaseQuery);
|
|
5379
|
+
const bStartsWithQuery = b.question.toLowerCase().startsWith(lowerCaseQuery);
|
|
5380
|
+
if (aStartsWithQuery && !bStartsWithQuery) return -1;
|
|
5381
|
+
if (!aStartsWithQuery && bStartsWithQuery) return 1;
|
|
5382
|
+
return 0;
|
|
5383
|
+
});
|
|
5384
|
+
setSuggestions(sortedSuggestions);
|
|
5385
|
+
} else {
|
|
5386
|
+
setSuggestions([]);
|
|
5387
|
+
}
|
|
5376
5388
|
} catch (err) {
|
|
5377
5389
|
console.error("Error fetching autocomplete suggestions:", err);
|
|
5378
5390
|
setError(err instanceof Error ? err.message : "Failed to fetch suggestions");
|
|
@@ -6132,4 +6144,4 @@ const ChatSearch = forwardRef(({ featureFlags, ...props }, ref) => /* @__PURE__
|
|
|
6132
6144
|
ChatSearch.displayName = "ChatSearch";
|
|
6133
6145
|
|
|
6134
6146
|
export { ChatSearch as C, ChatSearchProvider as a, useIsChatSearchDirty as b, useChatSearch as u };
|
|
6135
|
-
//# sourceMappingURL=ChatSearch.
|
|
6147
|
+
//# sourceMappingURL=ChatSearch.DsnO9IEM.js.map
|