@faststore/core 2.2.10 → 2.2.11

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.
Files changed (156) hide show
  1. package/.turbo/turbo-test.log +8 -8
  2. package/package.json +2 -2
  3. package/src/components/ui/ProductShelf/ProductShelf.tsx +5 -1
  4. package/.next/BUILD_ID +0 -1
  5. package/.next/build-manifest.json +0 -126
  6. package/.next/cache/.tsbuildinfo +0 -1
  7. package/.next/cache/config.json +0 -7
  8. package/.next/cache/eslint/.cache_1gneedd +0 -1
  9. package/.next/cache/next-server.js.nft.json +0 -1
  10. package/.next/cache/webpack/client-production/0.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack +0 -0
  12. package/.next/cache/webpack/server-production/0.pack +0 -0
  13. package/.next/cache/webpack/server-production/index.pack +0 -0
  14. package/.next/export-marker.json +0 -1
  15. package/.next/images-manifest.json +0 -1
  16. package/.next/next-server.js.nft.json +0 -1
  17. package/.next/package.json +0 -1
  18. package/.next/prerender-manifest.json +0 -1
  19. package/.next/react-loadable-manifest.json +0 -47
  20. package/.next/required-server-files.json +0 -1
  21. package/.next/routes-manifest.json +0 -1
  22. package/.next/server/chunks/117.js +0 -430
  23. package/.next/server/chunks/177.js +0 -120
  24. package/.next/server/chunks/183.js +0 -121
  25. package/.next/server/chunks/184.js +0 -61
  26. package/.next/server/chunks/289.js +0 -240
  27. package/.next/server/chunks/312.js +0 -678
  28. package/.next/server/chunks/350.js +0 -200
  29. package/.next/server/chunks/386.js +0 -200
  30. package/.next/server/chunks/390.js +0 -550
  31. package/.next/server/chunks/398.js +0 -610
  32. package/.next/server/chunks/52.js +0 -4007
  33. package/.next/server/chunks/53.js +0 -61
  34. package/.next/server/chunks/574.js +0 -145
  35. package/.next/server/chunks/576.js +0 -121
  36. package/.next/server/chunks/585.js +0 -640
  37. package/.next/server/chunks/676.js +0 -32
  38. package/.next/server/chunks/693.js +0 -58
  39. package/.next/server/chunks/732.js +0 -1880
  40. package/.next/server/chunks/74.js +0 -3964
  41. package/.next/server/chunks/779.js +0 -58
  42. package/.next/server/chunks/817.js +0 -4007
  43. package/.next/server/chunks/825.js +0 -4074
  44. package/.next/server/chunks/854.js +0 -72
  45. package/.next/server/chunks/859.js +0 -959
  46. package/.next/server/chunks/863.js +0 -111
  47. package/.next/server/chunks/979.js +0 -1302
  48. package/.next/server/chunks/98.js +0 -163
  49. package/.next/server/chunks/988.js +0 -211
  50. package/.next/server/chunks/font-manifest.json +0 -1
  51. package/.next/server/font-manifest.json +0 -1
  52. package/.next/server/middleware-build-manifest.js +0 -1
  53. package/.next/server/middleware-manifest.json +0 -6
  54. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  55. package/.next/server/pages/404.js +0 -391
  56. package/.next/server/pages/404.js.nft.json +0 -1
  57. package/.next/server/pages/500.js +0 -395
  58. package/.next/server/pages/500.js.nft.json +0 -1
  59. package/.next/server/pages/[...slug].js +0 -1084
  60. package/.next/server/pages/[...slug].js.nft.json +0 -1
  61. package/.next/server/pages/[slug]/p.js +0 -2274
  62. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  63. package/.next/server/pages/_app.js +0 -287
  64. package/.next/server/pages/_app.js.nft.json +0 -1
  65. package/.next/server/pages/_document.js +0 -365
  66. package/.next/server/pages/_document.js.nft.json +0 -1
  67. package/.next/server/pages/_error.js +0 -164
  68. package/.next/server/pages/_error.js.nft.json +0 -1
  69. package/.next/server/pages/account.js +0 -370
  70. package/.next/server/pages/account.js.nft.json +0 -1
  71. package/.next/server/pages/api/graphql.js +0 -464
  72. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  73. package/.next/server/pages/api/health/live.js +0 -31
  74. package/.next/server/pages/api/health/live.js.nft.json +0 -1
  75. package/.next/server/pages/api/health/ready.js +0 -31
  76. package/.next/server/pages/api/health/ready.js.nft.json +0 -1
  77. package/.next/server/pages/api/preview.js +0 -137
  78. package/.next/server/pages/api/preview.js.nft.json +0 -1
  79. package/.next/server/pages/checkout.js +0 -370
  80. package/.next/server/pages/checkout.js.nft.json +0 -1
  81. package/.next/server/pages/en-US/404.html +0 -81
  82. package/.next/server/pages/en-US/404.json +0 -1
  83. package/.next/server/pages/en-US/500.html +0 -81
  84. package/.next/server/pages/en-US/500.json +0 -1
  85. package/.next/server/pages/en-US/account.html +0 -81
  86. package/.next/server/pages/en-US/account.json +0 -1
  87. package/.next/server/pages/en-US/checkout.html +0 -81
  88. package/.next/server/pages/en-US/checkout.json +0 -1
  89. package/.next/server/pages/en-US/login.html +0 -81
  90. package/.next/server/pages/en-US/login.json +0 -1
  91. package/.next/server/pages/en-US/s.html +0 -81
  92. package/.next/server/pages/en-US/s.json +0 -1
  93. package/.next/server/pages/en-US.html +0 -90
  94. package/.next/server/pages/en-US.json +0 -1
  95. package/.next/server/pages/index.js +0 -439
  96. package/.next/server/pages/index.js.nft.json +0 -1
  97. package/.next/server/pages/login.js +0 -382
  98. package/.next/server/pages/login.js.nft.json +0 -1
  99. package/.next/server/pages/s.js +0 -555
  100. package/.next/server/pages/s.js.nft.json +0 -1
  101. package/.next/server/pages-manifest.json +0 -18
  102. package/.next/server/webpack-api-runtime.js +0 -229
  103. package/.next/server/webpack-runtime.js +0 -229
  104. package/.next/static/chunks/251.1c79f06f2a2814b1.js +0 -1
  105. package/.next/static/chunks/386.d01e0db26c523f0f.js +0 -1
  106. package/.next/static/chunks/400-7ce14b0f942135d1.js +0 -1
  107. package/.next/static/chunks/520-5a9ae7339f19a163.js +0 -1
  108. package/.next/static/chunks/574.70612be06fd1365f.js +0 -1
  109. package/.next/static/chunks/585.4c5d40fc6a72a611.js +0 -1
  110. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  111. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  112. package/.next/static/chunks/742-e32d18d91fe6f08b.js +0 -1
  113. package/.next/static/chunks/783-e26f8f831db78ded.js +0 -1
  114. package/.next/static/chunks/800.ee4f8b9622001e8c.js +0 -1
  115. package/.next/static/chunks/98.40c7e17d9de4eb8f.js +0 -1
  116. package/.next/static/chunks/988.afda042dd9ba11d1.js +0 -1
  117. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  118. package/.next/static/chunks/main-e4e873ee741162eb.js +0 -1
  119. package/.next/static/chunks/pages/404-d186c22d910fecbb.js +0 -1
  120. package/.next/static/chunks/pages/500-c6f28e1de16c5aab.js +0 -1
  121. package/.next/static/chunks/pages/[...slug]-c7c8e53be9021135.js +0 -1
  122. package/.next/static/chunks/pages/[slug]/p-4441e76801e44b50.js +0 -1
  123. package/.next/static/chunks/pages/_app-48d56037a2534a44.js +0 -1
  124. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  125. package/.next/static/chunks/pages/account-46edcd73944d7924.js +0 -1
  126. package/.next/static/chunks/pages/checkout-49faa1acf04be10c.js +0 -1
  127. package/.next/static/chunks/pages/index-5088cf4fabfe4812.js +0 -1
  128. package/.next/static/chunks/pages/login-e944d38d65d2eea5.js +0 -1
  129. package/.next/static/chunks/pages/s-b8b561b006b5056f.js +0 -1
  130. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  131. package/.next/static/chunks/webpack-6f8551ecbd88c3ec.js +0 -1
  132. package/.next/static/css/527e334fa69cf40a.css +0 -1
  133. package/.next/static/css/5d1f64b61ea581f4.css +0 -1
  134. package/.next/static/css/6a7fdc5a21fbead5.css +0 -1
  135. package/.next/static/css/6e1a7434f061d0ef.css +0 -1
  136. package/.next/static/css/723835bce380750d.css +0 -1
  137. package/.next/static/css/8f93a4630936c20b.css +0 -1
  138. package/.next/static/css/9f79fa103f49bca1.css +0 -1
  139. package/.next/static/css/a2eefb25a4608343.css +0 -1
  140. package/.next/static/css/cb7d1fcea42fab9c.css +0 -1
  141. package/.next/static/css/df588bb98c0b0ca6.css +0 -1
  142. package/.next/static/css/dfbdb0f27fd64782.css +0 -1
  143. package/.next/static/ztLSe4FT287QVm4KXs6gF/_buildManifest.js +0 -1
  144. package/.next/static/ztLSe4FT287QVm4KXs6gF/_ssgManifest.js +0 -1
  145. package/.next/trace +0 -77
  146. package/public/~partytown/debug/partytown-atomics.js +0 -556
  147. package/public/~partytown/debug/partytown-media.js +0 -374
  148. package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
  149. package/public/~partytown/debug/partytown-sw.js +0 -59
  150. package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
  151. package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
  152. package/public/~partytown/debug/partytown.js +0 -72
  153. package/public/~partytown/partytown-atomics.js +0 -2
  154. package/public/~partytown/partytown-media.js +0 -2
  155. package/public/~partytown/partytown-sw.js +0 -2
  156. package/public/~partytown/partytown.js +0 -2
@@ -1,121 +0,0 @@
1
- exports.id = 183;
2
- exports.ids = [183];
3
- exports.modules = {
4
-
5
- /***/ 572:
6
- /***/ ((module) => {
7
-
8
- module.exports = {
9
- seo: {
10
- title: 'FastStore Starter',
11
- description: 'Fast Demo Store',
12
- titleTemplate: '%s | FastStore',
13
- author: 'Store Framework'
14
- },
15
- // Theming
16
- theme: 'custom-theme',
17
- // Ecommerce Platform
18
- platform: 'vtex',
19
- // Platform specific configs for API
20
- api: {
21
- storeId: 'storeframework',
22
- workspace: 'master',
23
- environment: 'vtexcommercestable',
24
- hideUnavailableItems: false,
25
- incrementAddress: true
26
- },
27
- // Default session
28
- session: {
29
- currency: {
30
- code: 'USD',
31
- symbol: '$'
32
- },
33
- locale: 'en-US',
34
- channel: '{"salesChannel":"1","regionId":""}',
35
- country: 'USA',
36
- deliveryMode: null,
37
- addressType: null,
38
- postalCode: null,
39
- geoCoordinates: null,
40
- person: null
41
- },
42
- // Default cart
43
- cart: {
44
- id: '',
45
- items: [],
46
- messages: [],
47
- shouldSplitItem: true
48
- },
49
- // Production URLs
50
- storeUrl: 'https://vtexfaststore.com',
51
- secureSubdomain: 'https://secure.vtexfaststore.com',
52
- checkoutUrl: 'https://secure.vtexfaststore.com/checkout',
53
- loginUrl: 'https://secure.vtexfaststore.com/api/io/login',
54
- accountUrl: 'https://secure.vtexfaststore.com/api/io/account',
55
- // Preview redirects
56
- previewRedirects: {
57
- home: '/',
58
- plp: '/office',
59
- search: '/s?q=headphone',
60
- pdp: '/apple-magic-mouse/p'
61
- },
62
- // Lighthouse CI
63
- lighthouse: {
64
- server: process.env.BASE_SITE_URL || 'http://localhost:3000',
65
- pages: {
66
- home: '/',
67
- pdp: '/apple-magic-mouse/p',
68
- collection: '/office'
69
- }
70
- },
71
- // E2E CI
72
- cypress: {
73
- pages: {
74
- home: '/',
75
- pdp: '/apple-magic-mouse/p',
76
- collection: '/office',
77
- collection_2: '/technology',
78
- collection_filtered: '/office/?category-1=office&marca=acer&facets=category-1%2Cmarca',
79
- search: '/s?q=orange'
80
- }
81
- },
82
- analytics: {
83
- // https://developers.google.com/tag-platform/tag-manager/web#standard_web_page_installation,
84
- gtmContainerId: 'GTM-PGHZ95N'
85
- },
86
- experimental: {
87
- cypressVersion: 12,
88
- enableCypressExtension: false
89
- }
90
- };
91
-
92
- /***/ }),
93
-
94
- /***/ 7183:
95
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
96
-
97
- const defaultConfig = __webpack_require__(572);
98
-
99
- const starterConfig = __webpack_require__(4310);
100
-
101
- const deepmerge = __webpack_require__(6330);
102
- /**
103
- * @type {typeof defaultConfig & Record<string, any>}
104
- * */
105
-
106
-
107
- const finalConfig = deepmerge(defaultConfig, starterConfig);
108
- module.exports = finalConfig;
109
-
110
- /***/ }),
111
-
112
- /***/ 4310:
113
- /***/ ((module) => {
114
-
115
- // This is a placeholder file for when starter files are copied here
116
- module.exports = {};
117
-
118
- /***/ })
119
-
120
- };
121
- ;
@@ -1,61 +0,0 @@
1
- "use strict";
2
- exports.id = 184;
3
- exports.ids = [184];
4
- exports.modules = {
5
-
6
- /***/ 5184:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
- /* harmony export */ "m": () => (/* binding */ useViewItemListEvent)
11
- /* harmony export */ });
12
- /* harmony import */ var _faststore_sdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1072);
13
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
14
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
15
- /* harmony import */ var src_sdk_session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7295);
16
-
17
-
18
-
19
- const useViewItemListEvent = ({
20
- products,
21
- title,
22
- page,
23
- pageSize
24
- }) => {
25
- const {
26
- currency: {
27
- code
28
- }
29
- } = (0,src_sdk_session__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .kP)();
30
- const sendViewItemListEvent = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
31
- (0,_faststore_sdk__WEBPACK_IMPORTED_MODULE_2__/* .sendAnalyticsEvent */ ._)({
32
- name: 'view_item_list',
33
- params: {
34
- item_list_name: title,
35
- item_list_id: title,
36
- items: products.map(({
37
- node: product
38
- }, index) => ({
39
- item_id: product.isVariantOf.productGroupID,
40
- item_name: product.isVariantOf.name,
41
- item_brand: product.brand.name,
42
- item_variant: product.sku,
43
- price: product.offers.offers[0].price,
44
- index: page * pageSize + index + 1,
45
- discount: product.offers.offers[0].listPrice - product.offers.offers[0].price,
46
- currency: code,
47
- item_variant_name: product.name,
48
- product_reference_id: product.gtin
49
- }))
50
- }
51
- });
52
- }, [code, products, title, page, pageSize]);
53
- return {
54
- sendViewItemListEvent
55
- };
56
- };
57
-
58
- /***/ })
59
-
60
- };
61
- ;
@@ -1,240 +0,0 @@
1
- "use strict";
2
- exports.id = 289;
3
- exports.ids = [289];
4
- exports.modules = {
5
-
6
- /***/ 6387:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
-
10
- // EXPORTS
11
- __webpack_require__.d(__webpack_exports__, {
12
- "Z": () => (/* binding */ product_ProductGrid_ProductGrid)
13
- });
14
-
15
- // EXTERNAL MODULE: external "react"
16
- var external_react_ = __webpack_require__(6689);
17
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
18
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ProductGrid/ProductGrid.js
19
-
20
- const ProductGrid = (0,external_react_.forwardRef)(function ProductGridItem({ testId = 'fs-product-grid', children, ...otherProps }, ref) {
21
- return (external_react_default().createElement("ul", { ref: ref, "data-fs-product-grid": true, ...otherProps }, children));
22
- });
23
- /* harmony default export */ const ProductGrid_ProductGrid = (ProductGrid);
24
- //# sourceMappingURL=ProductGrid.js.map
25
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ProductGrid/ProductGridItem.js
26
-
27
- const ProductGridItem = (0,external_react_.forwardRef)(function ProductGridItem({ testId = 'fs-product-grid-item', children, ...otherProps }, ref) {
28
- return (external_react_default().createElement("li", { ref: ref, "data-fs-product-grid-item": true, ...otherProps }, children));
29
- });
30
- /* harmony default export */ const ProductGrid_ProductGridItem = (ProductGridItem);
31
- //# sourceMappingURL=ProductGridItem.js.map
32
- // EXTERNAL MODULE: ./src/components/skeletons/ProductGridSkeleton/ProductGridSkeleton.tsx
33
- var ProductGridSkeleton = __webpack_require__(1708);
34
- // EXTERNAL MODULE: ./src/components/sections/ProductGallery/Overrides.tsx + 2 modules
35
- var Overrides = __webpack_require__(6702);
36
- // EXTERNAL MODULE: external "react/jsx-runtime"
37
- var jsx_runtime_ = __webpack_require__(997);
38
- ;// CONCATENATED MODULE: ./src/components/product/ProductGrid/ProductGrid.tsx
39
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
40
-
41
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
42
-
43
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
- function ProductGrid_ProductGrid_ProductGrid({
52
- products,
53
- page,
54
- pageSize,
55
- productCard: {
56
- showDiscountBadge = Overrides/* __experimentalProductCard.props.showDiscountBadge */.zM.props.showDiscountBadge,
57
- bordered = Overrides/* __experimentalProductCard.props.bordered */.zM.props.bordered
58
- } = {}
59
- }) {
60
- const aspectRatio = 1;
61
- return /*#__PURE__*/jsx_runtime_.jsx(ProductGridSkeleton/* default */.Z, {
62
- aspectRatio: aspectRatio,
63
- loading: products.length === 0,
64
- children: /*#__PURE__*/jsx_runtime_.jsx(ProductGrid_ProductGrid, {
65
- children: products.map(({
66
- node: product
67
- }, idx) => /*#__PURE__*/jsx_runtime_.jsx(ProductGrid_ProductGridItem, {
68
- children: /*#__PURE__*/jsx_runtime_.jsx(Overrides/* __experimentalProductCard.Component */.zM.Component, _objectSpread(_objectSpread({
69
- aspectRatio: aspectRatio,
70
- imgProps: {
71
- width: 150,
72
- height: 150,
73
- sizes: '30vw'
74
- }
75
- }, Overrides/* __experimentalProductCard.props */.zM.props), {}, {
76
- bordered: bordered,
77
- showDiscountBadge: showDiscountBadge,
78
- product: product,
79
- index: pageSize * page + idx + 1
80
- }))
81
- }, `${product.id}`))
82
- })
83
- });
84
- }
85
-
86
- /* harmony default export */ const product_ProductGrid_ProductGrid = (/*#__PURE__*/(0,external_react_.memo)(ProductGrid_ProductGrid_ProductGrid));
87
-
88
- /***/ }),
89
-
90
- /***/ 5289:
91
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
92
-
93
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
94
- __webpack_require__.r(__webpack_exports__);
95
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
96
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
97
- /* harmony export */ });
98
- /* harmony import */ var src_components_product_ProductGrid__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6387);
99
- /* harmony import */ var src_sdk_search_Sentinel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1566);
100
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
101
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
102
- /* harmony import */ var src_sdk_product_usePageProductsQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8934);
103
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(997);
104
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
105
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_sdk_product_usePageProductsQuery__WEBPACK_IMPORTED_MODULE_2__]);
106
- src_sdk_product_usePageProductsQuery__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
- function ProductGalleryPage({
116
- page,
117
- title,
118
- productCard,
119
- itemsPerPage
120
- }) {
121
- const {
122
- data
123
- } = (0,src_sdk_product_usePageProductsQuery__WEBPACK_IMPORTED_MODULE_2__/* .useGalleryPage */ .__)(page);
124
- const products = data?.search?.products?.edges ?? [];
125
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
126
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx(src_sdk_search_Sentinel__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
127
- products: products,
128
- page: page,
129
- pageSize: itemsPerPage,
130
- title: title
131
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx(src_components_product_ProductGrid__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
132
- products: products,
133
- page: page,
134
- pageSize: itemsPerPage,
135
- productCard: productCard
136
- })]
137
- });
138
- }
139
-
140
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(ProductGalleryPage));
141
- __webpack_async_result__();
142
- } catch(e) { __webpack_async_result__(e); } });
143
-
144
- /***/ }),
145
-
146
- /***/ 1566:
147
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
148
-
149
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
150
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
151
- /* harmony export */ });
152
- /* harmony import */ var _faststore_sdk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3221);
153
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
154
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
155
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9785);
156
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__);
157
- /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1853);
158
- /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_router__WEBPACK_IMPORTED_MODULE_2__);
159
- /* harmony import */ var _analytics_hooks_useViewItemListEvent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5184);
160
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(997);
161
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
- // Adds/Replaces ?page= to the querystring of the page
170
- const replacePagination = (page, router) => {
171
- const url = new URL(window.location.href); // In case the page argument already matches the target page
172
-
173
- if (url.searchParams.get('page') === page) {
174
- return;
175
- } // Set ?page= parameter and replace route
176
-
177
-
178
- url.searchParams.set('page', page);
179
- router.replace(url, undefined, {
180
- shallow: true,
181
- scroll: false
182
- });
183
- };
184
- /**
185
- * Use this component to add a boundary between pages so we can
186
- * change the current page being viewed on infinite pagination.
187
- *
188
- * For more info: https://developers.google.com/search/blog/2014/02/infinite-scroll-search-friendly
189
- *
190
- * Also, this component's name is kind of curious. Wikipedia calls is Page Break(https://en.wikipedia.org/wiki/Page_break)
191
- * however all codes I've seen online use Sentinel
192
- */
193
-
194
-
195
- function Sentinel({
196
- page,
197
- pageSize,
198
- products,
199
- title
200
- }) {
201
- const viewedRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
202
- const {
203
- ref,
204
- inView
205
- } = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__.useInView)();
206
- const {
207
- pages
208
- } = (0,_faststore_sdk__WEBPACK_IMPORTED_MODULE_4__/* .useSearch */ .R)();
209
- const router = (0,next_router__WEBPACK_IMPORTED_MODULE_2__.useRouter)();
210
- const {
211
- sendViewItemListEvent
212
- } = (0,_analytics_hooks_useViewItemListEvent__WEBPACK_IMPORTED_MODULE_5__/* .useViewItemListEvent */ .m)({
213
- products,
214
- title,
215
- page,
216
- pageSize
217
- });
218
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
219
- // Only replace pagination state when infinite scroll
220
- // state has more than one page being rendered to the screen
221
- if (inView && pages.length > 1) {
222
- replacePagination(page.toString(), router);
223
- }
224
-
225
- if (inView && !viewedRef.current && products.length) {
226
- sendViewItemListEvent();
227
- viewedRef.current = true;
228
- }
229
- }, [pages.length, inView, page, router, sendViewItemListEvent, products.length]);
230
- return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx("div", {
231
- ref: ref
232
- });
233
- }
234
-
235
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Sentinel);
236
-
237
- /***/ })
238
-
239
- };
240
- ;