@searchcraft/react-sdk 0.10.5 → 0.10.7
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/client/index.js +1382 -1289
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.d.ts +16 -7
- package/dist/server/index.js +1295 -1202
- package/dist/server/index.js.map +1 -1
- package/package.json +3 -3
package/dist/server/index.d.ts
CHANGED
|
@@ -542,6 +542,8 @@ declare class SearchClient {
|
|
|
542
542
|
private userId;
|
|
543
543
|
private parent;
|
|
544
544
|
private searchCompletedEventTimeout;
|
|
545
|
+
private abortController;
|
|
546
|
+
private supplementalAbortController;
|
|
545
547
|
constructor(parent: SearchcraftCore, config: SearchcraftConfig, userId: string);
|
|
546
548
|
/**
|
|
547
549
|
* Getter for the base url used by the /search endpoint.
|
|
@@ -550,10 +552,10 @@ declare class SearchClient {
|
|
|
550
552
|
/**
|
|
551
553
|
* Make the request to get the search results.
|
|
552
554
|
* @param {properties} properties - The properties for the search.
|
|
553
|
-
* @param
|
|
555
|
+
* @param isSupplemental - Whether or not this is a supplemental search request (for the purpose of getting top-level facet counts)
|
|
554
556
|
* @returns
|
|
555
557
|
*/
|
|
556
|
-
getSearchResponseItems: (properties: SearchClientRequestProperties | string,
|
|
558
|
+
getSearchResponseItems: (properties: SearchClientRequestProperties | string, isSupplemental?: boolean) => Promise<SearchcraftResponse>;
|
|
557
559
|
private handleGetSearchResponseItemsWithString;
|
|
558
560
|
private handleGetSearchResponseItemsWithObject;
|
|
559
561
|
/**
|
|
@@ -605,7 +607,7 @@ export declare class SearchcraftCore {
|
|
|
605
607
|
* Perform various actions when the input is cleared
|
|
606
608
|
*/
|
|
607
609
|
handleInputCleared(): void;
|
|
608
|
-
getResponseItems: (properties: SearchClientRequestProperties | string, searchCallback: (response: SearchcraftResponse, items: SearchClientResponseItem[], supplementalResponse: SearchcraftResponse | undefined) => void, adCallback: (items: AdClientResponseItem[]) => void) => void;
|
|
610
|
+
getResponseItems: (properties: SearchClientRequestProperties | string, searchCallback: (request: SearchClientRequestProperties | string, response: SearchcraftResponse, items: SearchClientResponseItem[], supplementalResponse: SearchcraftResponse | undefined) => void, adCallback: (items: AdClientResponseItem[]) => void) => void;
|
|
609
611
|
}
|
|
610
612
|
/**
|
|
611
613
|
* Callable functions made available by the SearchcraftStore.
|
|
@@ -621,8 +623,8 @@ export interface SearchcraftStateFunctions {
|
|
|
621
623
|
search: () => Promise<void>;
|
|
622
624
|
set: (state: Partial<SearchcraftState> | ((state: SearchcraftState) => Partial<SearchcraftState>)) => SearchcraftState;
|
|
623
625
|
setAdClientResponseItems: (items: AdClientResponseItem[]) => void;
|
|
624
|
-
setSearchClientResponseItemsFromResponse: (response: SearchcraftResponse, items: SearchClientResponseItem[], supplementalResponse: SearchcraftResponse | undefined) => void;
|
|
625
|
-
setInitialSearchClientResponseItemsFromResponse: (response: SearchcraftResponse, items: SearchClientResponseItem[]) => void;
|
|
626
|
+
setSearchClientResponseItemsFromResponse: (request: SearchClientRequestProperties | string, response: SearchcraftResponse, items: SearchClientResponseItem[], supplementalResponse: SearchcraftResponse | undefined) => void;
|
|
627
|
+
setInitialSearchClientResponseItemsFromResponse: (request: SearchClientRequestProperties | string, response: SearchcraftResponse, items: SearchClientResponseItem[]) => void;
|
|
626
628
|
setInitialQuery: (query: string) => void;
|
|
627
629
|
setPopoverVisibility: (isVisible: boolean) => void;
|
|
628
630
|
setSearchResultsCount: (count: number) => void;
|
|
@@ -653,6 +655,7 @@ export interface SearchcraftStateValues {
|
|
|
653
655
|
isSearchInProgress: boolean;
|
|
654
656
|
rangeValueForIndexFields: Record<string, RangeValueForIndexField>;
|
|
655
657
|
searchMode: "fuzzy" | "exact";
|
|
658
|
+
searchClientRequest: SearchClientRequestProperties | string | undefined | null;
|
|
656
659
|
searchClientResponseItems: SearchClientResponseItem[];
|
|
657
660
|
searchResponseTimeTaken: number | undefined;
|
|
658
661
|
searchResponseFacetPrime: FacetPrime | undefined | null;
|
|
@@ -679,8 +682,11 @@ export namespace Components {
|
|
|
679
682
|
*/
|
|
680
683
|
interface SearchcraftAd {
|
|
681
684
|
"adClientResponseItem"?: AdClientResponseItem;
|
|
682
|
-
"adContainerId": string;
|
|
683
685
|
"adSource": SearchcraftAdSource;
|
|
686
|
+
/**
|
|
687
|
+
* Where the ad is being rendered within the search results div. Lifecycle behavior differs for ads being rendered in different positions, so we need to be able to handle all of those cases.
|
|
688
|
+
*/
|
|
689
|
+
"renderPosition": "interstitial" | "top" | "bottom";
|
|
684
690
|
}
|
|
685
691
|
/**
|
|
686
692
|
* This web component represents a button.
|
|
@@ -1779,8 +1785,11 @@ declare namespace LocalJSX {
|
|
|
1779
1785
|
*/
|
|
1780
1786
|
interface SearchcraftAd {
|
|
1781
1787
|
"adClientResponseItem"?: AdClientResponseItem;
|
|
1782
|
-
"adContainerId"?: string;
|
|
1783
1788
|
"adSource"?: SearchcraftAdSource;
|
|
1789
|
+
/**
|
|
1790
|
+
* Where the ad is being rendered within the search results div. Lifecycle behavior differs for ads being rendered in different positions, so we need to be able to handle all of those cases.
|
|
1791
|
+
*/
|
|
1792
|
+
"renderPosition"?: "interstitial" | "top" | "bottom";
|
|
1784
1793
|
}
|
|
1785
1794
|
/**
|
|
1786
1795
|
* This web component represents a button.
|