@docsearch/react
Advanced tools
+63
-4
@@ -143,11 +143,41 @@ import { BaseItem, AutocompleteState, AutocompleteContext, AutocompleteInsightsApi, AutocompleteOptions } from '@algolia/autocomplete-core'; | ||
| interface DocSearchProps { | ||
| /** | ||
| * Algolia application id used by the search client. | ||
| */ | ||
| appId: string; | ||
| /** | ||
| * Public api key with search permissions for the index. | ||
| */ | ||
| apiKey: string; | ||
| /** | ||
| * Name of the algolia index to query. | ||
| */ | ||
| indexName: string; | ||
| /** | ||
| * Configuration or assistant id to enable ask ai mode. Pass a string assistant id or a full config object. | ||
| */ | ||
| askAi?: DocSearchAskAi | string; | ||
| /** | ||
| * Theme overrides applied to the modal and related components. | ||
| */ | ||
| theme?: DocSearchTheme; | ||
| /** | ||
| * Placeholder text for the search input. | ||
| */ | ||
| placeholder?: string; | ||
| /** | ||
| * Additional algolia search parameters to merge into each query. | ||
| */ | ||
| searchParameters?: SearchParamsObject; | ||
| /** | ||
| * Maximum number of hits to display per source/group. | ||
| */ | ||
| maxResultsPerGroup?: number; | ||
| /** | ||
| * Hook to post-process hits before rendering. | ||
| */ | ||
| transformItems?: (items: DocSearchHit[]) => DocSearchHit[]; | ||
| /** | ||
| * Custom component to render an individual hit. | ||
| */ | ||
| hitComponent?: (props: { | ||
@@ -157,16 +187,44 @@ hit: InternalDocSearchHit | StoredDocSearchHit; | ||
| }) => JSX.Element; | ||
| /** | ||
| * Custom component rendered at the bottom of the results panel. | ||
| */ | ||
| resultsFooterComponent?: (props: { | ||
| state: AutocompleteState<InternalDocSearchHit>; | ||
| }) => JSX.Element | null; | ||
| /** | ||
| * Hook to wrap or modify the algolia search client. | ||
| */ | ||
| transformSearchClient?: (searchClient: DocSearchTransformClient) => DocSearchTransformClient; | ||
| /** | ||
| * Disable storage and usage of recent and favorite searches. | ||
| */ | ||
| disableUserPersonalization?: boolean; | ||
| /** | ||
| * Query string to prefill when opening the modal. | ||
| */ | ||
| initialQuery?: string; | ||
| /** | ||
| * Custom navigator for controlling link navigation. | ||
| */ | ||
| navigator?: AutocompleteOptions<InternalDocSearchHit>['navigator']; | ||
| /** | ||
| * Localized strings for the button and modal ui. | ||
| */ | ||
| translations?: DocSearchTranslations; | ||
| /** | ||
| * Builds a url to report missing results for a given query. | ||
| */ | ||
| getMissingResultsUrl?: ({ query }: { | ||
| query: string; | ||
| }) => string; | ||
| /** | ||
| * Insights client integration options to send analytics events. | ||
| */ | ||
| insights?: AutocompleteOptions<InternalDocSearchHit>['insights']; | ||
| /** | ||
| * Limit of how many recent searches that should be saved/displayed. | ||
| * The container element where the modal should be portaled to. Defaults to document.body. | ||
| */ | ||
| portalContainer?: DocumentFragment | Element; | ||
| /** | ||
| * Limit of how many recent searches should be saved/displayed.. | ||
| * | ||
@@ -177,3 +235,3 @@ * @default 7 | ||
| /** | ||
| * Limit of how many recent searches that should be saved/displayed when there are favorited searches. | ||
| * Limit of how many recent searches should be saved/displayed when there are favorited searches.. | ||
| * | ||
@@ -315,4 +373,5 @@ * @default 4 | ||
| declare const version = "4.0.0-beta.6"; | ||
| declare const version = "4.0.0-beta.7"; | ||
| export { type ButtonTranslations, DocSearch, type DocSearchAskAi, DocSearchButton, type DocSearchButtonProps, type DocSearchHit, DocSearchModal, type DocSearchModalProps, type DocSearchProps, type DocSearchState, type DocSearchTheme, type DocSearchTransformClient, type DocSearchTranslations, type InternalDocSearchHit, type ModalTranslations, type StoredAskAiMessage, type StoredAskAiState, type StoredDocSearchHit, type UseDocSearchKeyboardEventsProps, useDocSearchKeyboardEvents, version }; | ||
| export { DocSearch, DocSearchButton, DocSearchModal, useDocSearchKeyboardEvents, version }; | ||
| export type { ButtonTranslations, DocSearchAskAi, DocSearchButtonProps, DocSearchHit, DocSearchModalProps, DocSearchProps, DocSearchState, DocSearchTheme, DocSearchTransformClient, DocSearchTranslations, InternalDocSearchHit, ModalTranslations, StoredAskAiMessage, StoredAskAiState, StoredDocSearchHit, UseDocSearchKeyboardEventsProps }; |
+3
-2
| { | ||
| "name": "@docsearch/react", | ||
| "description": "React package for DocSearch, the best search experience for docs.", | ||
| "version": "4.0.0-beta.6", | ||
| "version": "4.0.0-beta.7", | ||
| "license": "MIT", | ||
@@ -41,3 +41,3 @@ "homepage": "https://docsearch.algolia.com", | ||
| "@algolia/autocomplete-core": "1.19.2", | ||
| "@docsearch/css": "4.0.0-beta.6", | ||
| "@docsearch/css": "4.0.0-beta.7", | ||
| "algoliasearch": "^5.28.0", | ||
@@ -51,2 +51,3 @@ "marked": "^15.0.12" | ||
| "nodemon": "^3.1.0", | ||
| "rollup-plugin-dts": "^6.2.1", | ||
| "vitest": "3.0.2", | ||
@@ -53,0 +54,0 @@ "zod": "^3.25.67" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1325560
0.87%2404
2.96%15
-21.05%7
16.67%+ Added
- Removed
Updated