@indxsearch/intrface 2.1.0 → 2.1.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/CHANGELOG.md +7 -0
- package/dist/components/ActiveFiltersPanel.d.ts +1 -0
- package/dist/components/RangeFilterPanel.d.ts +11 -0
- package/dist/components/ResultTitle.d.ts +0 -0
- package/dist/components/SearchErrorBoundary.d.ts +45 -0
- package/dist/components/SearchInput.d.ts +8 -0
- package/dist/components/SearchResults.d.ts +7 -0
- package/dist/components/SearchSettingsPanel.d.ts +1 -0
- package/dist/components/SortByPanel.d.ts +8 -0
- package/dist/components/ValueFilterPanel.d.ts +23 -0
- package/dist/context/SearchContext.d.ts +80 -0
- package/dist/context/useSearch.d.ts +1 -0
- package/dist/index.d.ts +11 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to @indxsearch/intrface will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.1.1] - 2026-01-21
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **CRITICAL**: Fixed missing TypeScript declaration files (.d.ts) in published package
|
|
12
|
+
- v2.1.0 was published without declaration files, causing TypeScript compilation errors
|
|
13
|
+
- All type definitions are now properly included in the npm package
|
|
14
|
+
|
|
8
15
|
## [2.1.0] - 2026-01-21
|
|
9
16
|
|
|
10
17
|
### Added
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ActiveFiltersPanel(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface RangeFilterPanelProps {
|
|
3
|
+
field: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
displayType?: 'slider' | 'input';
|
|
6
|
+
expectedMin?: number;
|
|
7
|
+
expectedMax?: number;
|
|
8
|
+
collapsible?: boolean;
|
|
9
|
+
startCollapsed?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const RangeFilterPanel: React.FC<RangeFilterPanelProps>;
|
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { default as React, Component, ErrorInfo, ReactNode } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
fallback?: (error: Error, reset: () => void) => ReactNode;
|
|
5
|
+
}
|
|
6
|
+
interface State {
|
|
7
|
+
hasError: boolean;
|
|
8
|
+
error: Error | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Error boundary component for graceful error handling in search components.
|
|
12
|
+
*
|
|
13
|
+
* Catches errors during initialization and search operations, displaying
|
|
14
|
+
* user-friendly error messages with suggestions for fixing common issues.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <SearchErrorBoundary>
|
|
18
|
+
* <SearchProvider {...props}>
|
|
19
|
+
* {children}
|
|
20
|
+
* </SearchProvider>
|
|
21
|
+
* </SearchErrorBoundary>
|
|
22
|
+
*
|
|
23
|
+
* @example Custom fallback
|
|
24
|
+
* <SearchErrorBoundary
|
|
25
|
+
* fallback={(error, reset) => (
|
|
26
|
+
* <div>
|
|
27
|
+
* <h2>Something went wrong</h2>
|
|
28
|
+
* <p>{error.message}</p>
|
|
29
|
+
* <button onClick={reset}>Try Again</button>
|
|
30
|
+
* </div>
|
|
31
|
+
* )}
|
|
32
|
+
* >
|
|
33
|
+
* <SearchProvider {...props}>
|
|
34
|
+
* {children}
|
|
35
|
+
* </SearchProvider>
|
|
36
|
+
* </SearchErrorBoundary>
|
|
37
|
+
*/
|
|
38
|
+
export declare class SearchErrorBoundary extends Component<Props, State> {
|
|
39
|
+
constructor(props: Props);
|
|
40
|
+
static getDerivedStateFromError(error: Error): State;
|
|
41
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
42
|
+
reset: () => void;
|
|
43
|
+
render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputSize } from '@indxsearch/systm';
|
|
3
|
+
export interface SearchInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
inputSize?: InputSize;
|
|
5
|
+
showClear?: boolean;
|
|
6
|
+
showFocus?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const SearchInput: React.FC<SearchInputProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SearchSettingsPanel(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ValueFilterPanelProps {
|
|
3
|
+
field: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
preserveBlankFacetState?: boolean;
|
|
6
|
+
preserveBlankFacetStateOrder?: boolean;
|
|
7
|
+
sortFacetsBy?: 'histogram' | 'alphabetical' | 'numeric';
|
|
8
|
+
limit?: number;
|
|
9
|
+
collapsible?: boolean;
|
|
10
|
+
startCollapsed?: boolean;
|
|
11
|
+
displayType?: 'checkbox' | 'button' | 'toggle';
|
|
12
|
+
layout?: 'list' | 'grid';
|
|
13
|
+
showActivePanel?: boolean;
|
|
14
|
+
showCount?: boolean;
|
|
15
|
+
showNull?: boolean;
|
|
16
|
+
displayIfEmptyQuery?: boolean;
|
|
17
|
+
displayCondition?: (context: {
|
|
18
|
+
query: string;
|
|
19
|
+
filters: Record<string, string[]>;
|
|
20
|
+
facets: any;
|
|
21
|
+
}) => boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const ValueFilterPanel: React.FC<ValueFilterPanelProps>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CoverageSetup } from '@indxsearch/indx-types';
|
|
3
|
+
export type RequiredCoverageSetup = Required<CoverageSetup>;
|
|
4
|
+
export interface SearchSettings {
|
|
5
|
+
maxNumberOfRecordsToReturn: number;
|
|
6
|
+
coverageDepth: number;
|
|
7
|
+
enableCoverage: boolean;
|
|
8
|
+
removeDuplicates: boolean;
|
|
9
|
+
coverageSetup: RequiredCoverageSetup;
|
|
10
|
+
minimumScore: number;
|
|
11
|
+
showScore: boolean;
|
|
12
|
+
placeholderText: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SearchResult {
|
|
15
|
+
document: any;
|
|
16
|
+
documentKey: number;
|
|
17
|
+
score: number;
|
|
18
|
+
}
|
|
19
|
+
export interface SearchState {
|
|
20
|
+
query: string;
|
|
21
|
+
results: SearchResult[] | null;
|
|
22
|
+
isLoading: boolean;
|
|
23
|
+
resultsSuppressed?: boolean;
|
|
24
|
+
facetDebounceDelayMillis?: number;
|
|
25
|
+
error?: string;
|
|
26
|
+
facets?: any | null;
|
|
27
|
+
filterableFields?: string[];
|
|
28
|
+
facetableFields?: string[];
|
|
29
|
+
sortableFields?: string[];
|
|
30
|
+
filters: Record<string, string[]>;
|
|
31
|
+
rangeFilters: Record<string, {
|
|
32
|
+
min: number;
|
|
33
|
+
max: number;
|
|
34
|
+
}>;
|
|
35
|
+
facetStats?: Record<string, {
|
|
36
|
+
min: number;
|
|
37
|
+
max: number;
|
|
38
|
+
}>;
|
|
39
|
+
rangeBounds?: Record<string, {
|
|
40
|
+
min: number;
|
|
41
|
+
max: number;
|
|
42
|
+
}>;
|
|
43
|
+
sortBy?: string;
|
|
44
|
+
sortAscending?: boolean;
|
|
45
|
+
searchSettings: SearchSettings;
|
|
46
|
+
truncationIndex?: number;
|
|
47
|
+
totalDocumentCount?: number;
|
|
48
|
+
}
|
|
49
|
+
export interface SearchContextType {
|
|
50
|
+
state: SearchState;
|
|
51
|
+
isFetchingInitial: boolean;
|
|
52
|
+
allowEmptySearch: boolean;
|
|
53
|
+
setQuery: (query: string) => void;
|
|
54
|
+
toggleFilter: (field: string, value: string) => void;
|
|
55
|
+
setRangeFilter: (field: string, min: number, max: number) => void;
|
|
56
|
+
resetFilters: () => void;
|
|
57
|
+
resetSingleFilter: (field: string, value?: string, isUserAction?: boolean) => void;
|
|
58
|
+
setSort: (field: string | null, ascending: boolean) => void;
|
|
59
|
+
setDebounceDelay?: (ms: number) => void;
|
|
60
|
+
setSearchSettings: (settings: Partial<SearchSettings>) => void;
|
|
61
|
+
fetchMoreResults: (newMax: number) => void;
|
|
62
|
+
}
|
|
63
|
+
export declare const SearchProvider: React.FC<{
|
|
64
|
+
children: React.ReactNode;
|
|
65
|
+
email?: string;
|
|
66
|
+
password?: string;
|
|
67
|
+
url: string;
|
|
68
|
+
dataset: string;
|
|
69
|
+
allowEmptySearch?: boolean;
|
|
70
|
+
maxResults?: number;
|
|
71
|
+
facetDebounceDelayMillis?: number;
|
|
72
|
+
enableFacets?: boolean;
|
|
73
|
+
coverageDepth?: number;
|
|
74
|
+
removeDuplicates?: boolean;
|
|
75
|
+
enableCoverage?: boolean;
|
|
76
|
+
initialCoverageSetup?: Partial<CoverageSetup>;
|
|
77
|
+
enableDebugLogs?: boolean;
|
|
78
|
+
preAuthenticatedToken?: string;
|
|
79
|
+
}>;
|
|
80
|
+
export declare const useSearchContext: () => SearchContextType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useSearchContext as useSearch } from './SearchContext';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { SearchProvider } from './context/SearchContext';
|
|
2
|
+
export { useSearchContext } from './context/SearchContext';
|
|
3
|
+
export { useSearch } from './context/useSearch';
|
|
4
|
+
export { SearchInput } from './components/SearchInput';
|
|
5
|
+
export { SearchResults } from './components/SearchResults';
|
|
6
|
+
export { ValueFilterPanel } from './components/ValueFilterPanel';
|
|
7
|
+
export { RangeFilterPanel } from './components/RangeFilterPanel';
|
|
8
|
+
export { ActiveFiltersPanel } from './components/ActiveFiltersPanel';
|
|
9
|
+
export { SortByPanel } from './components/SortByPanel';
|
|
10
|
+
export { SearchSettingsPanel } from './components/SearchSettingsPanel';
|
|
11
|
+
export { SearchErrorBoundary } from './components/SearchErrorBoundary';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indxsearch/intrface",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Indx Search interface components for React. Provides ready-to-use filter panels, search inputs, faceted navigation, and sorting components. Built on @indxsearch/systm.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"indx",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "https://github.com/indxSearch/indx-intrface.git",
|
|
24
|
+
"url": "git+https://github.com/indxSearch/indx-intrface.git",
|
|
25
25
|
"directory": "packages/indx-intrface"
|
|
26
26
|
},
|
|
27
27
|
"source": "./src/index.tsx",
|