@findlane/browser 0.18.0 → 0.19.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/dist/index.d.ts +5 -0
- package/dist/react/state.d.ts +2 -0
- package/dist/react/state.js +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,9 @@ export type SearchRequest = {
|
|
|
51
51
|
/** With the index's `distinct` setting, which shows each product once, such as one of its colours: false
|
|
52
52
|
* shows every record, a number 1 to 4 how many of each group's records. */
|
|
53
53
|
distinct?: boolean | number;
|
|
54
|
+
/** Contexts the page sends, which the index's rules may fire on, such as "category-page" or
|
|
55
|
+
* "black-friday": a name or up to 10, each 1 to 64 letters, digits, `_`, `:` or `-` (0.19.0). */
|
|
56
|
+
context?: string | string[];
|
|
54
57
|
};
|
|
55
58
|
/** A point in degrees: lat from -90 to 90, lng from -180 to 180. */
|
|
56
59
|
export type GeoPoint = {
|
|
@@ -85,6 +88,8 @@ export type SearchHit<T> = {
|
|
|
85
88
|
variant?: {
|
|
86
89
|
index: number;
|
|
87
90
|
};
|
|
91
|
+
/** A rule pinned it at its place (0.19.0). */
|
|
92
|
+
pinned?: true;
|
|
88
93
|
};
|
|
89
94
|
export type SearchResponse<T> = {
|
|
90
95
|
hits: SearchHit<T>[];
|
package/dist/react/state.d.ts
CHANGED
|
@@ -39,6 +39,8 @@ export type SearchConfig = {
|
|
|
39
39
|
/** "exact" (default) counts every match; "page" is faster on large indexes. */
|
|
40
40
|
countMode?: "page" | "exact";
|
|
41
41
|
facetMode?: "page" | "exact";
|
|
42
|
+
/** Contexts the page sends, which the index's rules may fire on, such as "category-page" (0.19.0). */
|
|
43
|
+
context?: string | string[];
|
|
42
44
|
};
|
|
43
45
|
export declare const emptyState: SearchState;
|
|
44
46
|
/** The API's largest offset. */
|
package/dist/react/state.js
CHANGED
|
@@ -27,6 +27,7 @@ export function planSearch(config, state) {
|
|
|
27
27
|
...(config.fields ? { attributesToRetrieve: config.fields } : {}),
|
|
28
28
|
countMode: config.countMode ?? "exact",
|
|
29
29
|
...(facets.length ? { facetMode: config.facetMode ?? "exact" } : {}),
|
|
30
|
+
...(config.context?.length ? { context: config.context } : {}),
|
|
30
31
|
highlight: true,
|
|
31
32
|
};
|
|
32
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@findlane/browser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Findlane browser SDK: fast, typo-tolerant public search from the browser with an index's public ID, plus React hooks and components.",
|
|
5
5
|
"keywords": ["findlane", "search", "full-text search", "typo tolerance", "instant search", "ecommerce search", "browser", "react", "autocomplete"],
|
|
6
6
|
"license": "MIT",
|