@findlane/browser 0.22.0 → 0.24.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 +24 -2
- package/dist/index.js +82 -9
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/search-provider.d.ts +5 -2
- package/dist/react/search-provider.js +12 -1
- package/dist/react/state.d.ts +3 -0
- package/dist/react/state.js +2 -0
- package/dist/react/store.d.ts +1 -1
- package/dist/react/store.js +5 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -298,14 +298,31 @@ export type EventItem = {
|
|
|
298
298
|
quantity?: number;
|
|
299
299
|
price?: number;
|
|
300
300
|
};
|
|
301
|
-
/** Where a clicked product was: its place in the results (from 1), and the search's query or the
|
|
302
|
-
* recommendation list (and the product whose list it was).
|
|
301
|
+
/** Where a clicked product was: its place in the results (from 1), and the search's query and filters, or the
|
|
302
|
+
* recommendation list (and the product whose list it was). A click on a search the page noted with `landed` is
|
|
303
|
+
* marked with how the page was opened from outside the site; `landing` and `network` say so yourself. */
|
|
303
304
|
export type ClickDetails = {
|
|
304
305
|
position?: number;
|
|
305
306
|
query?: string;
|
|
306
307
|
list?: "goesWith" | "similar" | "together" | "related";
|
|
307
308
|
from?: string;
|
|
309
|
+
/** The search's filters, as it took them: sales by filter value count them. */
|
|
310
|
+
filters?: Record<string, unknown>;
|
|
311
|
+
landing?: Landing["kind"];
|
|
312
|
+
network?: string;
|
|
313
|
+
};
|
|
314
|
+
/** How a page was opened from outside the site: an ad (with its network, when its click ID or tags name one), an
|
|
315
|
+
* email, or another site's link. Revenue from search leaves such searches' clicks out. */
|
|
316
|
+
export type Landing = {
|
|
317
|
+
kind: "ad" | "email" | "link";
|
|
318
|
+
network?: string;
|
|
308
319
|
};
|
|
320
|
+
/** How a page with this address (`search`) and referrer was opened from outside the site on `host`: an ad click
|
|
321
|
+
* ID, or `utm_medium` saying paid, is an ad; `utm_medium` email or newsletter an email; other `utm_*` tags,
|
|
322
|
+
* `fbclid` alone (Facebook and Instagram add it to every link out) or another site's referrer, a link. Null
|
|
323
|
+
* otherwise, an empty referrer without tags too: some sites send none from their own pages. The search box
|
|
324
|
+
* widget decides the same way. */
|
|
325
|
+
export declare function landingOf(search: string, referrer: string, host: string): Landing | null;
|
|
309
326
|
/** Events from the page, sent in the background: a batch a second, and what's left when the page is
|
|
310
327
|
* hidden or closed. They carry no cookie, and no ID unless `visitorIds` is on. */
|
|
311
328
|
export type BrowserEvents = {
|
|
@@ -313,6 +330,11 @@ export type BrowserEvents = {
|
|
|
313
330
|
* (React's double mount in development, a re-render), so it isn't sent. */
|
|
314
331
|
view(objectID: string): void;
|
|
315
332
|
click(objectID: string, details?: ClickDetails): void;
|
|
333
|
+
/** The page shows search `q` from its address, such as a results page a link opened. When the page was opened
|
|
334
|
+
* from outside the site (an ad, an email, another site: `landingOf`), clicks on that search are marked so, and
|
|
335
|
+
* with `visitorIds` for the rest of the visit, so revenue from search leaves them out. `SearchProvider` with
|
|
336
|
+
* `routing` calls it. */
|
|
337
|
+
landed(q: string): void;
|
|
316
338
|
/** A query suggestion was picked: the search, its place in its list (from 1), and whether it was
|
|
317
339
|
* suggested for what was typed, or was a popular or recent search in an empty box. */
|
|
318
340
|
suggestion(query: string, details?: {
|
package/dist/index.js
CHANGED
|
@@ -52,12 +52,52 @@ export class FindlaneError extends Error {
|
|
|
52
52
|
this.name = "FindlaneError";
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
// Ad click IDs and their networks. The ID itself is never kept.
|
|
56
|
+
const clickIds = { gclid: "google", gbraid: "google", wbraid: "google", dclid: "google", msclkid: "microsoft",
|
|
57
|
+
ttclid: "tiktok", twclid: "x", li_fat_id: "linkedin", epik: "pinterest", sccid: "snapchat" };
|
|
58
|
+
const paidMedium = /^(cpc|ppc|cpm|cpv|paid|paid[-_ ]?(search|social|media)|display|banner|retargeting|remarketing|ads?)$/;
|
|
59
|
+
const sourceNetworks = [[/google|youtube/, "google"], [/bing|microsoft/, "microsoft"],
|
|
60
|
+
[/facebook|instagram|^fb$|^ig$|meta/, "meta"], [/tiktok/, "tiktok"], [/twitter|^x$/, "x"], [/linkedin/, "linkedin"],
|
|
61
|
+
[/pinterest/, "pinterest"], [/snapchat/, "snapchat"]];
|
|
62
|
+
/** How a page with this address (`search`) and referrer was opened from outside the site on `host`: an ad click
|
|
63
|
+
* ID, or `utm_medium` saying paid, is an ad; `utm_medium` email or newsletter an email; other `utm_*` tags,
|
|
64
|
+
* `fbclid` alone (Facebook and Instagram add it to every link out) or another site's referrer, a link. Null
|
|
65
|
+
* otherwise, an empty referrer without tags too: some sites send none from their own pages. The search box
|
|
66
|
+
* widget decides the same way. */
|
|
67
|
+
export function landingOf(search, referrer, host) {
|
|
68
|
+
const params = new URLSearchParams(search);
|
|
69
|
+
const named = new Map([...params.keys()].map((key) => [key.toLowerCase(), params.get(key)?.trim() ?? ""]));
|
|
70
|
+
for (const [id, network] of Object.entries(clickIds))
|
|
71
|
+
if (named.get(id))
|
|
72
|
+
return { kind: "ad", network };
|
|
73
|
+
const medium = (named.get("utm_medium") ?? "").toLowerCase();
|
|
74
|
+
if (paidMedium.test(medium)) {
|
|
75
|
+
const source = (named.get("utm_source") ?? "").toLowerCase();
|
|
76
|
+
const network = sourceNetworks.find(([pattern]) => pattern.test(source))?.[1];
|
|
77
|
+
return network ? { kind: "ad", network } : { kind: "ad" };
|
|
78
|
+
}
|
|
79
|
+
if (/^(e-?mail|newsletter)$/.test(medium))
|
|
80
|
+
return { kind: "email" };
|
|
81
|
+
if (named.get("fbclid") || [...named].some(([key, value]) => key.startsWith("utm_") && value))
|
|
82
|
+
return { kind: "link" };
|
|
83
|
+
const bare = (name) => name.toLowerCase().replace(/^www\./, "");
|
|
84
|
+
try {
|
|
85
|
+
if (referrer && bare(new URL(referrer).hostname) !== bare(host))
|
|
86
|
+
return { kind: "link" };
|
|
87
|
+
}
|
|
88
|
+
catch { }
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
const sameQuery = (a, b) => a.trim().toLowerCase().replace(/\s+/g, " ") === b.trim().toLowerCase().replace(/\s+/g, " ");
|
|
92
|
+
const landed = (value) => !!value && typeof value == "object" && typeof value.q == "string" &&
|
|
93
|
+
["ad", "email", "link"].includes(value.kind) && ["string", "undefined"].includes(typeof value.network);
|
|
55
94
|
/** The hosted Findlane API, used unless `baseUrl` says otherwise. */
|
|
56
95
|
export const defaultBaseUrl = "https://api.findlane.dev";
|
|
57
96
|
const day = 86_400_000;
|
|
58
97
|
/** The visitor and visit IDs of a public ID, kept on the device: the visitor's in localStorage, made
|
|
59
98
|
* anew 13 months after it was made (use doesn't extend it); the visit's in sessionStorage, made anew
|
|
60
|
-
* after 30 minutes without events
|
|
99
|
+
* after 30 minutes without events, with how the visit's search was opened from outside the site, if it was.
|
|
100
|
+
* Storage that can't be used (a sandboxed frame's) means no IDs. */
|
|
61
101
|
function deviceIds(publicId) {
|
|
62
102
|
const keys = { visitor: `findlane:visitor:${publicId}`, visit: `findlane:visit:${publicId}` };
|
|
63
103
|
// 16 random bytes in base64url: letters, digits, - and _, as the API takes IDs.
|
|
@@ -65,24 +105,39 @@ function deviceIds(publicId) {
|
|
|
65
105
|
.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
66
106
|
const read = (storage, key) => {
|
|
67
107
|
const value = JSON.parse(storage.getItem(key) ?? "null");
|
|
68
|
-
return typeof value?.id == "string" && typeof value.at == "number"
|
|
108
|
+
return typeof value?.id == "string" && typeof value.at == "number"
|
|
109
|
+
? { id: value.id, at: value.at, ...(landed(value.landing) ? { landing: value.landing } : {}) } : null;
|
|
110
|
+
};
|
|
111
|
+
const live = (now) => {
|
|
112
|
+
const visit = read(sessionStorage, keys.visit);
|
|
113
|
+
return visit && now - visit.at <= 30 * 60_000 ? visit : null;
|
|
69
114
|
};
|
|
70
115
|
return {
|
|
71
|
-
/** The IDs for a request now, made when there are none or they're old. */
|
|
72
|
-
use(now = Date.now()) {
|
|
116
|
+
/** The IDs for a request now, made when there are none or they're old; the visit keeps `landing`, or its own. */
|
|
117
|
+
use(now = Date.now(), landing) {
|
|
73
118
|
try {
|
|
74
119
|
let visitor = read(localStorage, keys.visitor);
|
|
75
120
|
if (!visitor || now - visitor.at > 395 * day)
|
|
76
121
|
localStorage.setItem(keys.visitor, JSON.stringify(visitor = { id: random(), at: now }));
|
|
77
|
-
const visit =
|
|
78
|
-
const visitId = visit
|
|
79
|
-
|
|
122
|
+
const visit = live(now);
|
|
123
|
+
const visitId = visit?.id ?? random();
|
|
124
|
+
const kept = landing ?? visit?.landing;
|
|
125
|
+
sessionStorage.setItem(keys.visit, JSON.stringify({ id: visitId, at: now, ...(kept ? { landing: kept } : {}) }));
|
|
80
126
|
return { visitorId: visitor.id, visitId };
|
|
81
127
|
}
|
|
82
128
|
catch {
|
|
83
129
|
return null;
|
|
84
130
|
}
|
|
85
131
|
},
|
|
132
|
+
/** How the live visit's search was opened from outside the site, if it was. */
|
|
133
|
+
landing(now = Date.now()) {
|
|
134
|
+
try {
|
|
135
|
+
return live(now)?.landing ?? null;
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
},
|
|
86
141
|
/** Deletes them from the device, and returns those there were. */
|
|
87
142
|
clear() {
|
|
88
143
|
try {
|
|
@@ -103,6 +158,16 @@ function eventSender(url, fetcher, mode, ids) {
|
|
|
103
158
|
let timer;
|
|
104
159
|
let listening = false;
|
|
105
160
|
let lastView = { objectID: "", at: 0 };
|
|
161
|
+
// The page's search when the page was opened from outside the site (landed).
|
|
162
|
+
let page = null;
|
|
163
|
+
const landingFor = (query) => {
|
|
164
|
+
if (!query)
|
|
165
|
+
return null;
|
|
166
|
+
if (page && sameQuery(page.q, query))
|
|
167
|
+
return page;
|
|
168
|
+
const visit = ids?.landing();
|
|
169
|
+
return visit && sameQuery(visit.q, query) ? visit : null;
|
|
170
|
+
};
|
|
106
171
|
const send = (body) => {
|
|
107
172
|
// A beacon outlives the page; text/plain needs no CORS preflight.
|
|
108
173
|
if (fetcher || !(typeof navigator == "object" && navigator.sendBeacon?.(url, new Blob([body], { type: "text/plain" }))))
|
|
@@ -113,7 +178,7 @@ function eventSender(url, fetcher, mode, ids) {
|
|
|
113
178
|
clearTimeout(timer);
|
|
114
179
|
timer = undefined;
|
|
115
180
|
while (allowed && queue.length)
|
|
116
|
-
send(JSON.stringify({ ...ids?.use(), events: queue.splice(0, 100) }));
|
|
181
|
+
send(JSON.stringify({ ...ids?.use(Date.now(), page), events: queue.splice(0, 100) }));
|
|
117
182
|
};
|
|
118
183
|
const add = (event) => {
|
|
119
184
|
if (allowed === false)
|
|
@@ -135,7 +200,15 @@ function eventSender(url, fetcher, mode, ids) {
|
|
|
135
200
|
lastView = { objectID, at: now };
|
|
136
201
|
add({ type: "view", objectID });
|
|
137
202
|
},
|
|
138
|
-
click
|
|
203
|
+
click(objectID, details) {
|
|
204
|
+
const landing = details?.list || details?.landing ? null : landingFor(details?.query);
|
|
205
|
+
add({ type: "click", objectID, ...details, ...(landing ? { landing: landing.kind, ...(landing.network ? { network: landing.network } : {}) } : {}) });
|
|
206
|
+
},
|
|
207
|
+
landed(q) {
|
|
208
|
+
const landing = q.trim() && typeof location == "object" && typeof document == "object"
|
|
209
|
+
? landingOf(location.search, document.referrer, location.hostname) : null;
|
|
210
|
+
page = landing ? { ...landing, q: q.trim() } : null;
|
|
211
|
+
},
|
|
139
212
|
suggestion: (query, details) => add({ type: "suggestion", query, ...details }),
|
|
140
213
|
bannerClick: (rule, details) => add({ type: "bannerClick", rule, ...details }),
|
|
141
214
|
addToCart: (items, options) => add({ type: "addToCart", items, ...options }),
|
package/dist/react/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { useAutocomplete, type AutocompleteItem, type AutocompleteOptions, type
|
|
|
4
4
|
export { useRecommendations, type UseRecommendationsOptions, type UseRecommendationsResult } from "./use-recommendations.js";
|
|
5
5
|
export { Recommendations, type RecommendationsProps } from "./recommendations.js";
|
|
6
6
|
export { ProductView, useProductView } from "./product-view.js";
|
|
7
|
-
export { SearchProvider, useCurrentRefinements, useDidYouMean, useGeoSearch, useHits, useLoadMore, usePagination, useRange, useRefinementList, useSearchBox, useSearchState, useSortBy, useToggle, type Range, type Refinement, type SearchProviderProps, } from "./search-provider.js";
|
|
7
|
+
export { SearchProvider, useCurrentRefinements, useDidYouMean, useGeoSearch, useHits, useLoadMore, usePagination, useRange, useRefinementList, useSearchBox, useSearchState, useSortBy, useSubindex, useToggle, type Range, type Refinement, type SearchProviderProps, } from "./search-provider.js";
|
|
8
8
|
export { CurrentRefinements, DefaultBanner, DefaultHit, DidYouMean, Hits, LoadMore, RefinementList, SearchBox, SearchInput, SortSelect, Stats, type HitsProps, type RefinementListProps, type SearchBoxProps, type SuggestionLabels, } from "./components.js";
|
|
9
9
|
export { SearchDialog, type SearchDialogProps } from "./dialog.js";
|
|
10
10
|
export { Highlight, Snippet, excerpt, highlightParts, type HighlightProps } from "./highlight.js";
|
package/dist/react/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export { useAutocomplete } from "./use-autocomplete.js";
|
|
|
6
6
|
export { useRecommendations } from "./use-recommendations.js";
|
|
7
7
|
export { Recommendations } from "./recommendations.js";
|
|
8
8
|
export { ProductView, useProductView } from "./product-view.js";
|
|
9
|
-
export { SearchProvider, useCurrentRefinements, useDidYouMean, useGeoSearch, useHits, useLoadMore, usePagination, useRange, useRefinementList, useSearchBox, useSearchState, useSortBy, useToggle, } from "./search-provider.js";
|
|
9
|
+
export { SearchProvider, useCurrentRefinements, useDidYouMean, useGeoSearch, useHits, useLoadMore, usePagination, useRange, useRefinementList, useSearchBox, useSearchState, useSortBy, useSubindex, useToggle, } from "./search-provider.js";
|
|
10
10
|
export { CurrentRefinements, DefaultBanner, DefaultHit, DidYouMean, Hits, LoadMore, RefinementList, SearchBox, SearchInput, SortSelect, Stats, } from "./components.js";
|
|
11
11
|
export { SearchDialog } from "./dialog.js";
|
|
12
12
|
export { Highlight, Snippet, excerpt, highlightParts } from "./highlight.js";
|
|
@@ -2,7 +2,7 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
import type { DidYouMean, GeoBox } from "../index.js";
|
|
3
3
|
import { type ClientOptions } from "./client.js";
|
|
4
4
|
import { type ServerResults, type StateChange } from "./store.js";
|
|
5
|
-
import { type Near, type SearchConfig, type SearchState } from "./state.js";
|
|
5
|
+
import { type Hit, type Near, type SearchConfig, type SearchState } from "./state.js";
|
|
6
6
|
export type SearchProviderProps<T> = SearchConfig & ClientOptions & {
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
/** Keeps the state in the page's URL (`?q=shoe&brand=Acme`), so results can be shared and Back
|
|
@@ -32,8 +32,11 @@ export declare function useSearchBox(): {
|
|
|
32
32
|
/** Opens the connection to the API ahead of the first search: call it when the box gets focus. */
|
|
33
33
|
warm: () => void;
|
|
34
34
|
};
|
|
35
|
+
/** A subindex's results for the current query (SearchProvider's `subindexes`), such as categories to suggest
|
|
36
|
+
* above the results; none without a query, or when its search failed (0.23.0). */
|
|
37
|
+
export declare function useSubindex<T = Record<string, unknown>>(name: string): Hit<T>[];
|
|
35
38
|
export declare function useHits<T = Record<string, unknown>>(): {
|
|
36
|
-
hits:
|
|
39
|
+
hits: Hit<T>[];
|
|
37
40
|
total: number;
|
|
38
41
|
/** With the index's related results on, when nothing matched: the products closest in meaning. */
|
|
39
42
|
related: import("../index.js").SearchHit<T>[];
|
|
@@ -27,7 +27,11 @@ export function SearchProvider(props) {
|
|
|
27
27
|
};
|
|
28
28
|
});
|
|
29
29
|
useClientLayoutEffect(() => {
|
|
30
|
-
|
|
30
|
+
const fromUrl = routing && !state ? stateFromUrl(window.location.search, config) : undefined;
|
|
31
|
+
// A search the address opened, perhaps from an ad, an email or another site, whose clicks are marked so.
|
|
32
|
+
if (fromUrl?.q)
|
|
33
|
+
client.events.landed(fromUrl.q);
|
|
34
|
+
store.start(fromUrl);
|
|
31
35
|
return () => store.stop();
|
|
32
36
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33
37
|
}, [store]);
|
|
@@ -77,6 +81,13 @@ export function useSearchBox() {
|
|
|
77
81
|
/** Opens the connection to the API ahead of the first search: call it when the box gets focus. */
|
|
78
82
|
warm: () => store.warm() };
|
|
79
83
|
}
|
|
84
|
+
/** A subindex's results for the current query (SearchProvider's `subindexes`), such as categories to suggest
|
|
85
|
+
* above the results; none without a query, or when its search failed (0.23.0). */
|
|
86
|
+
export function useSubindex(name) {
|
|
87
|
+
const [{ results }] = useSnapshot();
|
|
88
|
+
const answer = results?.response.subindexes?.[name];
|
|
89
|
+
return answer && "hits" in answer ? answer.hits : [];
|
|
90
|
+
}
|
|
80
91
|
export function useHits() {
|
|
81
92
|
const [{ results, pending, error }, store] = useSnapshot();
|
|
82
93
|
return {
|
package/dist/react/state.d.ts
CHANGED
|
@@ -41,6 +41,9 @@ export type SearchConfig = {
|
|
|
41
41
|
facetMode?: "page" | "exact";
|
|
42
42
|
/** Contexts the page sends, which the index's rules may fire on, such as "category-page" (0.19.0). */
|
|
43
43
|
context?: string | string[];
|
|
44
|
+
/** The index's subindexes to search with each query, such as categories to suggest above the results, by
|
|
45
|
+
* name (0.23.0): in the same request, counted as one search. Read them with useSubindex. */
|
|
46
|
+
subindexes?: SearchRequest["subindexes"];
|
|
44
47
|
};
|
|
45
48
|
export declare const emptyState: SearchState;
|
|
46
49
|
/** The API's largest offset. */
|
package/dist/react/state.js
CHANGED
|
@@ -28,6 +28,8 @@ export function planSearch(config, state) {
|
|
|
28
28
|
countMode: config.countMode ?? "exact",
|
|
29
29
|
...(facets.length ? { facetMode: config.facetMode ?? "exact" } : {}),
|
|
30
30
|
...(config.context?.length ? { context: config.context } : {}),
|
|
31
|
+
// Subindexes only for a query: a page without words has nothing to suggest.
|
|
32
|
+
...(config.subindexes && state.q.trim() ? { subindexes: config.subindexes } : {}),
|
|
31
33
|
highlight: true,
|
|
32
34
|
};
|
|
33
35
|
}
|
package/dist/react/store.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export declare class SearchStore<T = unknown> {
|
|
|
62
62
|
get settings(): SearchConfig;
|
|
63
63
|
/** Opens the connection to the API before the first search needs it (the client's warm). */
|
|
64
64
|
warm(): void;
|
|
65
|
-
/** Sends a click on a result: its place in the results, from 1, and the query they're for. A related
|
|
65
|
+
/** Sends a click on a result: its place in the results, from 1, and the query and filters they're for. A related
|
|
66
66
|
* result's click says so (list "related"), with its place among them. */
|
|
67
67
|
click(objectID: string): void;
|
|
68
68
|
/** Sends a click on a rule's banner, with the query it showed for. */
|
package/dist/react/store.js
CHANGED
|
@@ -67,15 +67,17 @@ export class SearchStore {
|
|
|
67
67
|
get settings() { return this.config; }
|
|
68
68
|
/** Opens the connection to the API before the first search needs it (the client's warm). */
|
|
69
69
|
warm() { this.client.warm(); }
|
|
70
|
-
/** Sends a click on a result: its place in the results, from 1, and the query they're for. A related
|
|
70
|
+
/** Sends a click on a result: its place in the results, from 1, and the query and filters they're for. A related
|
|
71
71
|
* result's click says so (list "related"), with its place among them. */
|
|
72
72
|
click(objectID) {
|
|
73
73
|
const results = this.snapshot.results;
|
|
74
74
|
const index = results ? results.hits.findIndex((hit) => hit.id === objectID) : -1;
|
|
75
75
|
const related = index < 0 && results ? (results.response.related?.hits ?? []).findIndex((hit) => hit.id === objectID) : -1;
|
|
76
|
+
const filters = related < 0 ? results?.request.filters : undefined;
|
|
76
77
|
this.client.events.click(objectID, { query: results?.request.q ?? "",
|
|
77
78
|
...(index >= 0 ? { position: (results.request.offset ?? 0) + index + 1 } : {}),
|
|
78
|
-
...(related >= 0 ? { position: related + 1, list: "related" } : {})
|
|
79
|
+
...(related >= 0 ? { position: related + 1, list: "related" } : {}),
|
|
80
|
+
...(filters && Object.keys(filters).length ? { filters } : {}) });
|
|
79
81
|
}
|
|
80
82
|
/** Sends a click on a rule's banner, with the query it showed for. */
|
|
81
83
|
bannerClick(banner) {
|
|
@@ -164,7 +166,7 @@ export class SearchStore {
|
|
|
164
166
|
const { results, loadingMore, pending } = this.snapshot;
|
|
165
167
|
if (!results?.hasMore || loadingMore || pending)
|
|
166
168
|
return;
|
|
167
|
-
const { facets: _, disjunctiveFacets: __, facetMode: ___, facetStats: ____, ...request } = results.request;
|
|
169
|
+
const { facets: _, disjunctiveFacets: __, facetMode: ___, facetStats: ____, subindexes: _____, ...request } = results.request;
|
|
168
170
|
const offset = (request.offset ?? 0) + results.hits.length;
|
|
169
171
|
const run = this.run;
|
|
170
172
|
this.set({ loadingMore: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@findlane/browser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.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",
|