instantsearch.js 4.82.0 → 4.83.0
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/cjs/connectors/chat/connectChat.js +11 -1
- package/cjs/lib/version.js +1 -1
- package/cjs/widgets/autocomplete/autocomplete.js +100 -32
- package/cjs/widgets/chat/chat.js +57 -6
- package/cjs/widgets/index/index.js +0 -6
- package/dist/instantsearch.development.d.ts +21 -3
- package/dist/instantsearch.development.js +477 -159
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +21 -3
- package/dist/instantsearch.production.min.d.ts +21 -3
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/connectors/chat/connectChat.d.ts +4 -4
- package/es/connectors/chat/connectChat.js +11 -1
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/widgets/autocomplete/autocomplete.d.ts +18 -0
- package/es/widgets/autocomplete/autocomplete.js +101 -33
- package/es/widgets/chat/chat.d.ts +41 -2
- package/es/widgets/chat/chat.js +57 -6
- package/es/widgets/index/index.js +0 -6
- package/package.json +7 -7
|
@@ -5,6 +5,7 @@ import type { AutocompleteIndexClassNames } from 'instantsearch-ui-components';
|
|
|
5
5
|
import type { AutocompleteIndexConfig } from 'instantsearch-ui-components';
|
|
6
6
|
import { Banner } from 'algoliasearch-helper';
|
|
7
7
|
import type { CarouselProps } from 'instantsearch-ui-components';
|
|
8
|
+
import type { ClientSideTools } from 'instantsearch-ui-components';
|
|
8
9
|
import { CompositionClient } from 'algoliasearch-helper/types/algoliasearch.js';
|
|
9
10
|
import EventEmitter from '@algolia/events';
|
|
10
11
|
import { FindAnswersOptions } from 'algoliasearch-helper/types/algoliasearch.js';
|
|
@@ -33,7 +34,6 @@ import { SearchParameters } from 'algoliasearch-helper';
|
|
|
33
34
|
import { SearchResults } from 'algoliasearch-helper';
|
|
34
35
|
import type { TrendingItemsProps } from 'instantsearch-ui-components';
|
|
35
36
|
import type { UIMessage } from 'ai';
|
|
36
|
-
import type { UserClientSideTool } from 'instantsearch-ui-components';
|
|
37
37
|
import { VNode } from 'preact';
|
|
38
38
|
import type { VNode as VNode_2 } from 'instantsearch-ui-components';
|
|
39
39
|
|
|
@@ -337,6 +337,24 @@ declare type AutocompleteWidgetParams<TItem extends BaseHit> = {
|
|
|
337
337
|
showSuggestions?: Partial<Pick<IndexConfig<{
|
|
338
338
|
query: string;
|
|
339
339
|
}>, 'indexName' | 'getURL' | 'templates' | 'cssClasses'>>;
|
|
340
|
+
showRecent?: boolean | {
|
|
341
|
+
/**
|
|
342
|
+
* Storage key to use in the local storage.
|
|
343
|
+
*/
|
|
344
|
+
storageKey?: string;
|
|
345
|
+
templates?: Partial<{
|
|
346
|
+
/**
|
|
347
|
+
* Template to use for each result. This template will receive an object containing a single record.
|
|
348
|
+
*/
|
|
349
|
+
item: Template<{
|
|
350
|
+
item: {
|
|
351
|
+
query: string;
|
|
352
|
+
};
|
|
353
|
+
onSelect: () => void;
|
|
354
|
+
onRemoveRecentSearch: () => void;
|
|
355
|
+
}>;
|
|
356
|
+
}>;
|
|
357
|
+
};
|
|
340
358
|
getSearchPageURL?: (nextUiState: IndexUiState) => string;
|
|
341
359
|
onSelect?: AutocompleteIndexConfig<TItem>['onSelect'];
|
|
342
360
|
/**
|
|
@@ -643,9 +661,9 @@ declare type ChatRenderState<TUiMessage extends UIMessage = UIMessage> = {
|
|
|
643
661
|
*/
|
|
644
662
|
onClearTransitionEnd: () => void;
|
|
645
663
|
/**
|
|
646
|
-
* Tools configuration
|
|
664
|
+
* Tools configuration with addToolResult bound, ready to be used by the UI.
|
|
647
665
|
*/
|
|
648
|
-
tools:
|
|
666
|
+
tools: ClientSideTools;
|
|
649
667
|
} & Pick<AbstractChat<TUiMessage>, 'addToolResult' | 'clearError' | 'error' | 'id' | 'messages' | 'regenerate' | 'resumeStream' | 'sendMessage' | 'status' | 'stop'>;
|
|
650
668
|
|
|
651
669
|
declare type ChatWidgetDescription<TUiMessage extends UIMessage = UIMessage> = {
|
|
@@ -5,6 +5,7 @@ import type { AutocompleteIndexClassNames } from 'instantsearch-ui-components';
|
|
|
5
5
|
import type { AutocompleteIndexConfig } from 'instantsearch-ui-components';
|
|
6
6
|
import { Banner } from 'algoliasearch-helper';
|
|
7
7
|
import type { CarouselProps } from 'instantsearch-ui-components';
|
|
8
|
+
import type { ClientSideTools } from 'instantsearch-ui-components';
|
|
8
9
|
import { CompositionClient } from 'algoliasearch-helper/types/algoliasearch.js';
|
|
9
10
|
import EventEmitter from '@algolia/events';
|
|
10
11
|
import { FindAnswersOptions } from 'algoliasearch-helper/types/algoliasearch.js';
|
|
@@ -33,7 +34,6 @@ import { SearchParameters } from 'algoliasearch-helper';
|
|
|
33
34
|
import { SearchResults } from 'algoliasearch-helper';
|
|
34
35
|
import type { TrendingItemsProps } from 'instantsearch-ui-components';
|
|
35
36
|
import type { UIMessage } from 'ai';
|
|
36
|
-
import type { UserClientSideTool } from 'instantsearch-ui-components';
|
|
37
37
|
import { VNode } from 'preact';
|
|
38
38
|
import type { VNode as VNode_2 } from 'instantsearch-ui-components';
|
|
39
39
|
|
|
@@ -337,6 +337,24 @@ declare type AutocompleteWidgetParams<TItem extends BaseHit> = {
|
|
|
337
337
|
showSuggestions?: Partial<Pick<IndexConfig<{
|
|
338
338
|
query: string;
|
|
339
339
|
}>, 'indexName' | 'getURL' | 'templates' | 'cssClasses'>>;
|
|
340
|
+
showRecent?: boolean | {
|
|
341
|
+
/**
|
|
342
|
+
* Storage key to use in the local storage.
|
|
343
|
+
*/
|
|
344
|
+
storageKey?: string;
|
|
345
|
+
templates?: Partial<{
|
|
346
|
+
/**
|
|
347
|
+
* Template to use for each result. This template will receive an object containing a single record.
|
|
348
|
+
*/
|
|
349
|
+
item: Template<{
|
|
350
|
+
item: {
|
|
351
|
+
query: string;
|
|
352
|
+
};
|
|
353
|
+
onSelect: () => void;
|
|
354
|
+
onRemoveRecentSearch: () => void;
|
|
355
|
+
}>;
|
|
356
|
+
}>;
|
|
357
|
+
};
|
|
340
358
|
getSearchPageURL?: (nextUiState: IndexUiState) => string;
|
|
341
359
|
onSelect?: AutocompleteIndexConfig<TItem>['onSelect'];
|
|
342
360
|
/**
|
|
@@ -643,9 +661,9 @@ declare type ChatRenderState<TUiMessage extends UIMessage = UIMessage> = {
|
|
|
643
661
|
*/
|
|
644
662
|
onClearTransitionEnd: () => void;
|
|
645
663
|
/**
|
|
646
|
-
* Tools configuration
|
|
664
|
+
* Tools configuration with addToolResult bound, ready to be used by the UI.
|
|
647
665
|
*/
|
|
648
|
-
tools:
|
|
666
|
+
tools: ClientSideTools;
|
|
649
667
|
} & Pick<AbstractChat<TUiMessage>, 'addToolResult' | 'clearError' | 'error' | 'id' | 'messages' | 'regenerate' | 'resumeStream' | 'sendMessage' | 'status' | 'stop'>;
|
|
650
668
|
|
|
651
669
|
declare type ChatWidgetDescription<TUiMessage extends UIMessage = UIMessage> = {
|