@tapcart/mobile-components 0.14.0 → 0.14.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/dist/components/hooks/use-infinite-scroll.d.ts.map +1 -1
- package/dist/components/hooks/use-infinite-scroll.js +41 -20
- package/dist/components/hooks/use-infinite-scroll.test.d.ts +2 -0
- package/dist/components/hooks/use-infinite-scroll.test.d.ts.map +1 -0
- package/dist/components/hooks/use-infinite-scroll.test.js +212 -0
- package/dist/components/ui/animate-container.d.ts.map +1 -1
- package/dist/components/ui/chip.d.ts.map +1 -1
- package/dist/components/ui/quantity-picker.d.ts.map +1 -1
- package/dist/components/ui/quantity-picker.js +1 -1
- package/dist/components/ui/quantity-pickerNEW.d.ts +0 -1
- package/dist/components/ui/quantity-pickerNEW.d.ts.map +1 -1
- package/dist/components/ui/quantity-pickerNEW.js +1 -1
- package/dist/components/ui/use-toast.d.ts.map +1 -1
- package/dist/components/ui/wishlist-select.d.ts.map +1 -1
- package/dist/lib/cart.util.d.ts.map +1 -1
- package/dist/lib/variablesCart.util.d.ts.map +1 -1
- package/dist/styles.css +3 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-infinite-scroll.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-infinite-scroll.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAmB,MAAM,iBAAiB,CAAA;AAE1E,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAG5D,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,GAAG,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAA;CACxC;AAED,UAAU,sBAAsB;IAE9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IAC/B,IAAI,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAA;IAC5B,KAAK,EAAE,GAAG,CAAA;IACV,oBAAoB,EAAE,OAAO,CAAA;IAC7B,aAAa,EAAE,OAAO,GAAG,SAAS,CAAA;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,OAAO,CAAA;IACtB,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;IAChD,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,oBAAoB,EAAE,GAAG,EAAE,CAAA;IAC3B,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,EAAE,OAAO,CAAA;CACtB;AAED,eAAO,MAAM,sCAAsC,iBACnC,uBAAuB,OAsBtC,CAAA;AAWD,eAAO,MAAM,wBAAwB,UAAa,CAAA;AAIlD,eAAO,MAAM,qBAAqB,WACxB,OAAO,MAAM,EAAE,OAAO,CAAC,KAC9B,OAAO,MAAM,EAAE,OAAO,CAMxB,CAAA;AAED,QAAA,MAAM,YAAY,WAAY,MAAM,WAGnC,CAAA;AAED,QAAA,MAAM,iBAAiB,wLAgBpB,sBAAsB,KAAG,uBA8V3B,CAAA;AAED,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -71,7 +71,6 @@ direction = "vertical", productLimit = Infinity, threshold = 0.01, interval = 33
|
|
|
71
71
|
customFetcher, customGetKey, shouldSkipFetch: shouldSkipFetchProp, }) => {
|
|
72
72
|
var _a, _b, _c, _d, _e, _f;
|
|
73
73
|
const searchParams = useSearchParams();
|
|
74
|
-
const productCount = useRef(0);
|
|
75
74
|
const isFirstRender = useRef(true);
|
|
76
75
|
const prevParamsRef = useRef({
|
|
77
76
|
collectionId: null,
|
|
@@ -122,7 +121,6 @@ customFetcher, customGetKey, shouldSkipFetch: shouldSkipFetchProp, }) => {
|
|
|
122
121
|
return Object.assign(Object.assign({}, queryVariables), { cursorBlob: previousPageData.pageData.cursorBlob });
|
|
123
122
|
};
|
|
124
123
|
const apiFetcher = (body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
125
|
-
var _g, _h;
|
|
126
124
|
if (!(initialData === null || initialData === void 0 ? void 0 : initialData.apiURL)) {
|
|
127
125
|
throw new Error("initialData.apiURL is required for API mode");
|
|
128
126
|
}
|
|
@@ -131,7 +129,6 @@ customFetcher, customGetKey, shouldSkipFetch: shouldSkipFetchProp, }) => {
|
|
|
131
129
|
body: JSON.stringify(body),
|
|
132
130
|
});
|
|
133
131
|
const data = yield res.json();
|
|
134
|
-
productCount.current += (_h = (_g = data === null || data === void 0 ? void 0 : data.products) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0;
|
|
135
132
|
return data;
|
|
136
133
|
});
|
|
137
134
|
// Return null from getKey to conditionally skip fetching
|
|
@@ -154,18 +151,14 @@ customFetcher, customGetKey, shouldSkipFetch: shouldSkipFetchProp, }) => {
|
|
|
154
151
|
};
|
|
155
152
|
const fetcher = usingSearchClient
|
|
156
153
|
? (...args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
157
|
-
var _j, _k;
|
|
158
154
|
if (!searchClientFetcher)
|
|
159
155
|
return null;
|
|
160
156
|
const result = yield searchClientFetcher(...args);
|
|
161
|
-
productCount.current += (_k = (_j = result === null || result === void 0 ? void 0 : result.products) === null || _j === void 0 ? void 0 : _j.length) !== null && _k !== void 0 ? _k : 0;
|
|
162
157
|
return result;
|
|
163
158
|
})
|
|
164
159
|
: (...args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
165
|
-
var _l, _m;
|
|
166
160
|
if (customFetcher) {
|
|
167
161
|
const result = yield customFetcher(...args);
|
|
168
|
-
productCount.current += (_m = (_l = result === null || result === void 0 ? void 0 : result.products) === null || _l === void 0 ? void 0 : _l.length) !== null && _m !== void 0 ? _m : 0;
|
|
169
162
|
return result;
|
|
170
163
|
}
|
|
171
164
|
return apiFetcher(args[0]);
|
|
@@ -203,7 +196,6 @@ customFetcher, customGetKey, shouldSkipFetch: shouldSkipFetchProp, }) => {
|
|
|
203
196
|
};
|
|
204
197
|
// Skip reset on first render, but force it for any subsequent transitions to valid params
|
|
205
198
|
if (!isFirstRender.current && hasValidCurrentParams) {
|
|
206
|
-
productCount.current = 0;
|
|
207
199
|
mutate();
|
|
208
200
|
}
|
|
209
201
|
}
|
|
@@ -241,10 +233,49 @@ customFetcher, customGetKey, shouldSkipFetch: shouldSkipFetchProp, }) => {
|
|
|
241
233
|
}
|
|
242
234
|
const isReachingEnd = isEmpty || isEndPointer;
|
|
243
235
|
const isRefreshing = isValidating && data && data.length === size;
|
|
236
|
+
// Flatten the SWR Infinite pages into the rendered list, deduped by product id
|
|
237
|
+
// (handle fallback). Cursor/page pagination over a volatile, mutable-sort
|
|
238
|
+
// result set — Shopify relevance/best-selling search, reorderable collections —
|
|
239
|
+
// re-serves boundary products on the following page, so consecutive pages
|
|
240
|
+
// overlap; without this dedupe the same product renders twice (seen on Edikted
|
|
241
|
+
// search). Keep the FIRST occurrence so the original ranked position wins, and
|
|
242
|
+
// dedupe BEFORE the productLimit slice so a finite limit (carousels) yields N
|
|
243
|
+
// UNIQUE products. Two rows sharing a product id always resolve to the same
|
|
244
|
+
// product-level card (the search-client pipeline resolves every row via
|
|
245
|
+
// getProduct(id|handle) and discards per-hit variant context), so this can
|
|
246
|
+
// never collapse a legitimately-distinct variant card.
|
|
247
|
+
const products = useMemo(() => {
|
|
248
|
+
var _a;
|
|
249
|
+
const flat = data
|
|
250
|
+
? data.flatMap((page) => { var _a; return (_a = page === null || page === void 0 ? void 0 : page.products) !== null && _a !== void 0 ? _a : []; })
|
|
251
|
+
: hasInitialProducts
|
|
252
|
+
? initialData.products
|
|
253
|
+
: [];
|
|
254
|
+
const seen = new Set();
|
|
255
|
+
const deduped = [];
|
|
256
|
+
for (const product of flat) {
|
|
257
|
+
if (!product)
|
|
258
|
+
continue;
|
|
259
|
+
const key = (_a = product.id) !== null && _a !== void 0 ? _a : product.handle;
|
|
260
|
+
if (key == null) {
|
|
261
|
+
deduped.push(product);
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
if (seen.has(key))
|
|
265
|
+
continue;
|
|
266
|
+
seen.add(key);
|
|
267
|
+
deduped.push(product);
|
|
268
|
+
}
|
|
269
|
+
return deduped.slice(0, productLimit);
|
|
270
|
+
}, [data, productLimit, hasInitialProducts, initialData === null || initialData === void 0 ? void 0 : initialData.products]);
|
|
244
271
|
const loadMore = useCallback(() => {
|
|
245
272
|
if (isLoading || isLoadingMore || isReachingEnd || isRefreshing)
|
|
246
273
|
return;
|
|
247
|
-
|
|
274
|
+
// Gate on the deduped, limit-sliced `products` count. Counting raw fetched
|
|
275
|
+
// products would include the page-seam duplicates the memo above removes, so
|
|
276
|
+
// a finite productLimit could look "reached" while fewer than productLimit
|
|
277
|
+
// unique products have actually loaded — under-filling the carousel.
|
|
278
|
+
if (products.length >= productLimit)
|
|
248
279
|
return;
|
|
249
280
|
setSize(size + 1);
|
|
250
281
|
}, [
|
|
@@ -252,6 +283,7 @@ customFetcher, customGetKey, shouldSkipFetch: shouldSkipFetchProp, }) => {
|
|
|
252
283
|
isLoadingMore,
|
|
253
284
|
isReachingEnd,
|
|
254
285
|
isRefreshing,
|
|
286
|
+
products.length,
|
|
255
287
|
productLimit,
|
|
256
288
|
setSize,
|
|
257
289
|
size,
|
|
@@ -267,21 +299,10 @@ customFetcher, customGetKey, shouldSkipFetch: shouldSkipFetchProp, }) => {
|
|
|
267
299
|
if (!usingSearchClient || !searchClient)
|
|
268
300
|
return;
|
|
269
301
|
const unsubscribeAllChanges = searchClient.onSearchStateChange(() => {
|
|
270
|
-
productCount.current = 0;
|
|
271
302
|
mutate();
|
|
272
303
|
});
|
|
273
304
|
return unsubscribeAllChanges;
|
|
274
305
|
}, [searchClient, mutate, usingSearchClient]);
|
|
275
|
-
const products = useMemo(() => {
|
|
276
|
-
if (data) {
|
|
277
|
-
return data.flatMap((page) => page === null || page === void 0 ? void 0 : page.products).slice(0, productLimit);
|
|
278
|
-
}
|
|
279
|
-
// Use pre-fetched products while SWR fetches the real paginated data
|
|
280
|
-
if (hasInitialProducts) {
|
|
281
|
-
return initialData.products;
|
|
282
|
-
}
|
|
283
|
-
return [];
|
|
284
|
-
}, [data, productLimit, hasInitialProducts, initialData === null || initialData === void 0 ? void 0 : initialData.products]);
|
|
285
306
|
// Collect all integration responses per page when using search client
|
|
286
307
|
const integrationResponses = useMemo(() => {
|
|
287
308
|
if (!usingSearchClient)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-infinite-scroll.test.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-infinite-scroll.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { renderHook } from "@testing-library/react";
|
|
2
|
+
// ─── Module mocks ────────────────────────────────────────────────────────────
|
|
3
|
+
// useSWRInfinite is the source of `data` (the array of fetched pages). We mock
|
|
4
|
+
// it so each test can hand the hook an exact set of (possibly overlapping)
|
|
5
|
+
// pages and assert how they are flattened/deduped into `products`.
|
|
6
|
+
jest.mock("swr/infinite", () => ({
|
|
7
|
+
__esModule: true,
|
|
8
|
+
default: jest.fn(),
|
|
9
|
+
}));
|
|
10
|
+
jest.mock("react-intersection-observer", () => ({
|
|
11
|
+
useInView: jest.fn(() => ({ ref: jest.fn(), inView: false })),
|
|
12
|
+
}));
|
|
13
|
+
jest.mock("next/navigation", () => ({
|
|
14
|
+
useSearchParams: () => new URLSearchParams(),
|
|
15
|
+
}));
|
|
16
|
+
jest.mock("./swr-retry", () => ({
|
|
17
|
+
useSwrRetryConfig: () => ({
|
|
18
|
+
errorRetryCount: 0,
|
|
19
|
+
shouldRetryOnError: false,
|
|
20
|
+
onErrorRetry: jest.fn(),
|
|
21
|
+
onSuccess: jest.fn(),
|
|
22
|
+
isRetrying: false,
|
|
23
|
+
}),
|
|
24
|
+
}));
|
|
25
|
+
// ─── Imports after mocks ─────────────────────────────────────────────────────
|
|
26
|
+
import useSWRInfinite from "swr/infinite";
|
|
27
|
+
import { useInView } from "react-intersection-observer";
|
|
28
|
+
import { useInfiniteScroll } from "./use-infinite-scroll";
|
|
29
|
+
const mockUseSWRInfinite = useSWRInfinite;
|
|
30
|
+
const mockUseInView = useInView;
|
|
31
|
+
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
32
|
+
const setPages = (pages) => {
|
|
33
|
+
var _a;
|
|
34
|
+
mockUseSWRInfinite.mockReturnValue({
|
|
35
|
+
data: pages,
|
|
36
|
+
error: undefined,
|
|
37
|
+
size: (_a = pages === null || pages === void 0 ? void 0 : pages.length) !== null && _a !== void 0 ? _a : 0,
|
|
38
|
+
setSize: jest.fn(),
|
|
39
|
+
isLoading: false,
|
|
40
|
+
isValidating: false,
|
|
41
|
+
mutate: jest.fn(),
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const page = (products, hasMore = true) => ({
|
|
45
|
+
products,
|
|
46
|
+
hasMore,
|
|
47
|
+
filtersData: null,
|
|
48
|
+
apiURL: "https://example.com/api",
|
|
49
|
+
});
|
|
50
|
+
const renderProducts = (props = {}) => renderHook(() => useInfiniteScroll(Object.assign({
|
|
51
|
+
// Force fetching on so `products` is returned (not the skip-override).
|
|
52
|
+
shouldSkipFetch: false, initialData: {
|
|
53
|
+
apiURL: "https://example.com/api",
|
|
54
|
+
products: [],
|
|
55
|
+
filtersData: null,
|
|
56
|
+
}, queryVariables: { collectionId: "c1" } }, props))).result.current.products;
|
|
57
|
+
// ─── Tests ───────────────────────────────────────────────────────────────────
|
|
58
|
+
describe("useInfiniteScroll – page flatten & dedupe", () => {
|
|
59
|
+
beforeEach(() => {
|
|
60
|
+
mockUseSWRInfinite.mockReset();
|
|
61
|
+
});
|
|
62
|
+
it("removes products re-served at page seams, keeping first occurrence", () => {
|
|
63
|
+
// page 1 ends with id 3; page 2 re-serves 3 at its head (the cursor race);
|
|
64
|
+
// page 3 re-serves 5. Expected: 1..6 once each, in first-seen order.
|
|
65
|
+
setPages([
|
|
66
|
+
page([{ id: "1" }, { id: "2" }, { id: "3" }]),
|
|
67
|
+
page([{ id: "3" }, { id: "4" }, { id: "5" }]),
|
|
68
|
+
page([{ id: "5" }, { id: "6" }], false),
|
|
69
|
+
]);
|
|
70
|
+
expect(renderProducts().map((p) => p.id)).toEqual([
|
|
71
|
+
"1",
|
|
72
|
+
"2",
|
|
73
|
+
"3",
|
|
74
|
+
"4",
|
|
75
|
+
"5",
|
|
76
|
+
"6",
|
|
77
|
+
]);
|
|
78
|
+
});
|
|
79
|
+
it("dedupes BEFORE applying productLimit (limit counts unique products)", () => {
|
|
80
|
+
setPages([
|
|
81
|
+
page([{ id: "1" }, { id: "2" }, { id: "3" }]),
|
|
82
|
+
page([{ id: "3" }, { id: "4" }, { id: "5" }]),
|
|
83
|
+
]);
|
|
84
|
+
// If the slice ran before dedupe we'd get ["1","2","3","3"]; dedupe-first
|
|
85
|
+
// yields four UNIQUE products.
|
|
86
|
+
expect(renderProducts({ productLimit: 4 }).map((p) => p.id)).toEqual([
|
|
87
|
+
"1",
|
|
88
|
+
"2",
|
|
89
|
+
"3",
|
|
90
|
+
"4",
|
|
91
|
+
]);
|
|
92
|
+
});
|
|
93
|
+
it("dedupes and slices the initialData fallback before SWR data resolves", () => {
|
|
94
|
+
// Before the first fetch resolves, `data` is undefined and `products` falls
|
|
95
|
+
// back to `initialData.products` (the warm-IDB seed from
|
|
96
|
+
// useInfiniteScrollCached, which is NOT pre-bounded to productLimit). That
|
|
97
|
+
// fallback now runs through the same dedupe + productLimit slice as fetched
|
|
98
|
+
// pages, so a seed with duplicates and more entries than the limit is capped
|
|
99
|
+
// to N unique products on first paint instead of rendering the raw seed.
|
|
100
|
+
setPages(undefined);
|
|
101
|
+
const products = renderProducts({
|
|
102
|
+
initialData: {
|
|
103
|
+
apiURL: "https://example.com/api",
|
|
104
|
+
products: [{ id: "1" }, { id: "1" }, { id: "2" }, { id: "3" }],
|
|
105
|
+
filtersData: null,
|
|
106
|
+
},
|
|
107
|
+
productLimit: 2,
|
|
108
|
+
});
|
|
109
|
+
expect(products.map((p) => p.id)).toEqual(["1", "2"]);
|
|
110
|
+
});
|
|
111
|
+
it("falls back to handle when id is absent", () => {
|
|
112
|
+
setPages([
|
|
113
|
+
page([{ handle: "a" }, { handle: "b" }]),
|
|
114
|
+
page([{ handle: "b" }, { handle: "c" }], false),
|
|
115
|
+
]);
|
|
116
|
+
expect(renderProducts().map((p) => p.handle)).toEqual(["a", "b", "c"]);
|
|
117
|
+
});
|
|
118
|
+
it("does not collapse same-name colorways that are distinct product ids", () => {
|
|
119
|
+
// The Edikted "Holly Glitter" case: same title, different ids → all kept.
|
|
120
|
+
setPages([
|
|
121
|
+
page([
|
|
122
|
+
{ id: "gid://shopify/Product/1", handle: "holly_silver" },
|
|
123
|
+
{ id: "gid://shopify/Product/2", handle: "holly_gold" },
|
|
124
|
+
]),
|
|
125
|
+
page([
|
|
126
|
+
{ id: "gid://shopify/Product/2", handle: "holly_gold" },
|
|
127
|
+
{ id: "gid://shopify/Product/3", handle: "holly_black" },
|
|
128
|
+
], false),
|
|
129
|
+
]);
|
|
130
|
+
expect(renderProducts().map((p) => p.handle)).toEqual([
|
|
131
|
+
"holly_silver",
|
|
132
|
+
"holly_gold",
|
|
133
|
+
"holly_black",
|
|
134
|
+
]);
|
|
135
|
+
});
|
|
136
|
+
it("keeps unkeyable items (no id and no handle) rather than dropping them", () => {
|
|
137
|
+
setPages([page([{ title: "x" }, { title: "y" }], false)]);
|
|
138
|
+
expect(renderProducts()).toHaveLength(2);
|
|
139
|
+
});
|
|
140
|
+
it("skips nullish page payloads while still in flight", () => {
|
|
141
|
+
setPages([page([{ id: "1" }, { id: "2" }]), undefined]);
|
|
142
|
+
expect(renderProducts().map((p) => p.id)).toEqual(["1", "2"]);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
// ─── loadMore gate: deduped count, not raw fetch count ──────────────────────
|
|
146
|
+
//
|
|
147
|
+
// `loadMore` must gate on the deduped, limit-sliced `products` count, not the
|
|
148
|
+
// raw `productCount` ref (which counts every fetched product including
|
|
149
|
+
// page-seam duplicates the `products` memo removes). These tests drive the
|
|
150
|
+
// `inView` intersection-observer effect (the real trigger path for `loadMore`)
|
|
151
|
+
// against pages whose provider size is smaller than `productLimit`, with
|
|
152
|
+
// boundary duplicates between pages. `pageData.cursorBlob` is set on every
|
|
153
|
+
// page (non-search-client / API mode) so `isReachingEnd` stays false and only
|
|
154
|
+
// the productLimit gate can be responsible for stopping pagination.
|
|
155
|
+
describe("useInfiniteScroll – loadMore gate uses deduped count, not raw fetch count", () => {
|
|
156
|
+
const apiPage = (products, cursorBlob = "cursor") => ({
|
|
157
|
+
products,
|
|
158
|
+
pageData: { cursorBlob },
|
|
159
|
+
filtersData: null,
|
|
160
|
+
apiURL: "https://example.com/api",
|
|
161
|
+
});
|
|
162
|
+
const renderWithPages = (pages, setSizeSpy, productLimit) => {
|
|
163
|
+
mockUseSWRInfinite.mockReturnValue({
|
|
164
|
+
data: pages,
|
|
165
|
+
error: undefined,
|
|
166
|
+
size: pages.length,
|
|
167
|
+
setSize: setSizeSpy,
|
|
168
|
+
isLoading: false,
|
|
169
|
+
isValidating: false,
|
|
170
|
+
mutate: jest.fn(),
|
|
171
|
+
});
|
|
172
|
+
return renderHook(() => useInfiniteScroll({
|
|
173
|
+
shouldSkipFetch: false,
|
|
174
|
+
initialData: {
|
|
175
|
+
apiURL: "https://example.com/api",
|
|
176
|
+
products: [],
|
|
177
|
+
filtersData: null,
|
|
178
|
+
},
|
|
179
|
+
queryVariables: { collectionId: "c1" },
|
|
180
|
+
// interval: 0 makes the lodash throttle wrapping loadMore invoke
|
|
181
|
+
// synchronously on the leading edge, so the inView effect's call is
|
|
182
|
+
// observable immediately after render.
|
|
183
|
+
interval: 0,
|
|
184
|
+
productLimit,
|
|
185
|
+
}));
|
|
186
|
+
};
|
|
187
|
+
beforeEach(() => {
|
|
188
|
+
mockUseSWRInfinite.mockReset();
|
|
189
|
+
mockUseInView.mockReturnValue({ ref: jest.fn(), inView: true });
|
|
190
|
+
});
|
|
191
|
+
it("keeps paginating while deduped products are still below a finite limit", () => {
|
|
192
|
+
const setSizeSpy = jest.fn();
|
|
193
|
+
// Provider page size (2) is well below productLimit (6); only 2 unique
|
|
194
|
+
// products so far — loadMore must advance setSize rather than gate off.
|
|
195
|
+
renderWithPages([apiPage([{ id: "1" }, { id: "2" }])], setSizeSpy, 6);
|
|
196
|
+
expect(setSizeSpy).toHaveBeenCalled();
|
|
197
|
+
});
|
|
198
|
+
it("stops paginating once deduped products reach the limit, even though raw fetched count differs due to seam duplicates", () => {
|
|
199
|
+
const setSizeSpy = jest.fn();
|
|
200
|
+
// 3 pages x 2 raw products = 6 raw fetched entries, but seam duplicates
|
|
201
|
+
// ("2" and "3") collapse them to 4 UNIQUE products — exactly productLimit.
|
|
202
|
+
// The last page still has a cursorBlob (more pages are technically
|
|
203
|
+
// available), so only the deduped-count gate — not isReachingEnd — can be
|
|
204
|
+
// responsible for stopping pagination here.
|
|
205
|
+
renderWithPages([
|
|
206
|
+
apiPage([{ id: "1" }, { id: "2" }]),
|
|
207
|
+
apiPage([{ id: "2" }, { id: "3" }]),
|
|
208
|
+
apiPage([{ id: "3" }, { id: "4" }]),
|
|
209
|
+
], setSizeSpy, 4);
|
|
210
|
+
expect(setSizeSpy).not.toHaveBeenCalled();
|
|
211
|
+
});
|
|
212
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animate-container.d.ts","sourceRoot":"","sources":["../../../components/ui/animate-container.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"animate-container.d.ts","sourceRoot":"","sources":["../../../components/ui/animate-container.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAGhD,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,CAAA;AAErC,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,aAAa,EAAE,eAAe,CAW7D,CAAA;AAED,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,UAAU,EAAE,eAAe,EAAE,CAAA;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,UAAU,EACV,QAAc,EACd,SAAS,EACT,SAAS,EACT,OAAO,GACR,EAAE,qBAAqB,2CAmCvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../components/ui/chip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,
|
|
1
|
+
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../components/ui/chip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAA8B,MAAM,OAAO,CAAA;AAIlD,QAAA,MAAM,YAAY;;;;mFAwBjB,CAAA;AAED,KAAK,SAAS,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GACpD,YAAY,CAAC,OAAO,YAAY,CAAC,GAAG;IAClC,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAEH,QAAA,MAAM,IAAI;;;;;;;;;;yBALc,IAAI;yBACJ,IAAI;;wCAgF3B,CAAA;AAGD,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAA;IACzC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;CAC9C,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqD/C,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quantity-picker.d.ts","sourceRoot":"","sources":["../../../components/ui/quantity-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"quantity-picker.d.ts","sourceRoot":"","sources":["../../../components/ui/quantity-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,MAAM,WAAW,mBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACxC,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACxC,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAChC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAmCD,QAAA,MAAM,cAAc,4FA2GnB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import * as React from "react";
|
|
15
|
-
import { cn
|
|
15
|
+
import { cn } from "../../lib/utils";
|
|
16
16
|
import { Icon } from "./icon";
|
|
17
17
|
const IconButton = ({ iconUrl, iconColor, handler, className, style, disabled }) => {
|
|
18
18
|
const visualButtonStyle = Object.assign({}, style);
|
|
@@ -17,7 +17,6 @@ export interface QuantityPickerNEWProps extends React.HTMLAttributes<HTMLDivElem
|
|
|
17
17
|
inputStyle?: React.CSSProperties;
|
|
18
18
|
buttonStyle?: React.CSSProperties;
|
|
19
19
|
buttonCornerRadius?: number;
|
|
20
|
-
debounceTime?: number;
|
|
21
20
|
max?: number;
|
|
22
21
|
parentRef?: React.RefObject<HTMLDivElement>;
|
|
23
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quantity-pickerNEW.d.ts","sourceRoot":"","sources":["../../../components/ui/quantity-pickerNEW.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"quantity-pickerNEW.d.ts","sourceRoot":"","sources":["../../../components/ui/quantity-pickerNEW.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,WAAW,sBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACxC,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACxC,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,gBAAgB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAChC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;CAC5C;AAgED,QAAA,MAAM,iBAAiB,+FA2KtB,CAAA;AAID,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -37,7 +37,7 @@ const IconButton = ({ iconUrl, iconColor, handler, className, style, disabled })
|
|
|
37
37
|
}, disabled: disabled, "aria-label": "Quantity button" })] })));
|
|
38
38
|
};
|
|
39
39
|
const QuantityPickerNEW = React.forwardRef((_a, ref) => {
|
|
40
|
-
var { className, decreaseIconUrl, increaseIconUrl, deleteIconUrl, isDeleteOnly = false, iconColor, onDecreaseClick, onIncreaseClick, isDecreaseDisabled, isIncreaseDisabled, value, onValueSet, onAdjustQuantity, inputStyle, buttonStyle, buttonCornerRadius = 4, max = 99, loading = false,
|
|
40
|
+
var { className, decreaseIconUrl, increaseIconUrl, deleteIconUrl, isDeleteOnly = false, iconColor, onDecreaseClick, onIncreaseClick, isDecreaseDisabled, isIncreaseDisabled, value, onValueSet, onAdjustQuantity, inputStyle, buttonStyle, buttonCornerRadius = 4, max = 99, loading = false, parentRef } = _a, props = __rest(_a, ["className", "decreaseIconUrl", "increaseIconUrl", "deleteIconUrl", "isDeleteOnly", "iconColor", "onDecreaseClick", "onIncreaseClick", "isDecreaseDisabled", "isIncreaseDisabled", "value", "onValueSet", "onAdjustQuantity", "inputStyle", "buttonStyle", "buttonCornerRadius", "max", "loading", "parentRef"]);
|
|
41
41
|
const safeValue = typeof value === "number" && Number.isFinite(value) ? value : 1;
|
|
42
42
|
const inputRef = React.useRef(null);
|
|
43
43
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-toast.d.ts","sourceRoot":"","sources":["../../../components/ui/use-toast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"use-toast.d.ts","sourceRoot":"","sources":["../../../components/ui/use-toast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAKzC,KAAK,YAAY,GAAG,UAAU,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,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;CACjE;AAED,QAAA,MAAM,kBAAkB,wFA8CvB,CAAA;AAGD,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,GACnB,CAAA;AAED,YAAY,EAAE,yBAAyB,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart.util.d.ts","sourceRoot":"","sources":["../../lib/cart.util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,6BAA6B,
|
|
1
|
+
{"version":3,"file":"cart.util.d.ts","sourceRoot":"","sources":["../../lib/cart.util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,6BAA6B,EAC7B,cAAc,EACf,MAAM,kBAAkB,CAAA;AAGzB,eAAO,MAAM,eAAe;cAKhB,MAAM;aACP,cAAc;;0BAEH;YAChB,gBAAgB,CAAC,EAAE;gBACjB,MAAM,EAAE,MAAM,CAAA;gBACd,YAAY,EAAE,MAAM,CAAA;aACrB,CAAA;YACD,KAAK,EAAE;gBACL,MAAM,EAAE,MAAM,CAAA;gBACd,YAAY,EAAE,MAAM,CAAA;aACrB,CAAA;YACD,cAAc,CAAC,EAAE;gBACf,MAAM,EAAE,MAAM,CAAA;gBACd,YAAY,EAAE,MAAM,CAAA;aACrB,CAAA;SACF,EAAE;;;;;;;CAgCN,CAAA;AAuCD,eAAO,MAAM,oBAAoB,SAAU,MAAM,QAAQ,YAAY,YAMpE,CAAA;AAED,eAAO,MAAM,kBAAkB,SAAU,MAAM,QAAQ,YAAY,YAMlE,CAAA;AAoHD,MAAM,MAAM,cAAc,GAAG;IAC3B,yBAAyB,EAAE,sBAAsB,EAAE,CAAA;IACnD,gBAAgB,EAAE,6BAA6B,EAAE,CAAA;IACjD,cAAc,EAAE,OAAO,CAAA;IACvB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,cAUrC,CAAA;AAED,eAAO,MAAM,qBAAqB,SAAU,YAAY,KAAG,cA8B1D,CAAA;AAGD,eAAO,MAAM,mBAAmB;eACnB,MAAM;;;;;aAEG,MAAM;eAAS,MAAM;;;;oBAIN,MAAM;0BAAgB,MAAM;;;eAElD,MAAM;;;;;gBAML,MAAM;cACR,MAAM;;cAEN,MAAM;;;0BAIM;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,YAAY,EAAE,MAAM,CAAA;SAAE;oBAC9C,MAAM;;;;YAsCzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variablesCart.util.d.ts","sourceRoot":"","sources":["../../lib/variablesCart.util.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,6BAA6B,
|
|
1
|
+
{"version":3,"file":"variablesCart.util.d.ts","sourceRoot":"","sources":["../../lib/variablesCart.util.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,6BAA6B,EAG9B,MAAM,kBAAkB,CAAA;AAEzB,eAAO,MAAM,2BAA2B;;cAM5B,MAAM;;0BAEI;YAChB,gBAAgB,CAAC,EAAE,MAAM,CAAA;YACzB,KAAK,EAAE,MAAM,CAAA;YACb,cAAc,CAAC,EAAE,MAAM,CAAA;SACxB,EAAE;;;;;;CAyBN,CAAA;AA8FD,eAAO,MAAM,6BAA6B,SAClC,MAAM,QACN,SAAS,GAAG,IAAI,YAUvB,CAAA;AAED,eAAO,MAAM,2BAA2B,SAChC,MAAM,QACN,SAAS,GAAG,IAAI,YAUvB,CAAA;AAoMD,MAAM,MAAM,uBAAuB,GAAG;IACpC,yBAAyB,EAAE,sBAAsB,EAAE,CAAA;IACnD,gBAAgB,EAAE,6BAA6B,EAAE,CAAA;IACjD,cAAc,EAAE,OAAO,CAAA;IACvB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,iCAAiC,EAAE,uBAU/C,CAAA;AAED,eAAO,MAAM,8BAA8B,SACnC,SAAS,GAAG,IAAI,KACrB,uBAmCF,CAAA"}
|
package/dist/styles.css
CHANGED