@faststore/core 2.1.0 → 2.1.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.
Files changed (149) hide show
  1. package/.turbo/turbo-build.log +9 -3
  2. package/.turbo/turbo-lint.log +2 -0
  3. package/package.json +8 -8
  4. package/.next/BUILD_ID +0 -1
  5. package/.next/build-manifest.json +0 -123
  6. package/.next/cache/.tsbuildinfo +0 -1
  7. package/.next/cache/eslint/.cache_abdhua +0 -1
  8. package/.next/cache/next-server.js.nft.json +0 -1
  9. package/.next/cache/webpack/client-production/0.pack +0 -0
  10. package/.next/cache/webpack/client-production/index.pack +0 -0
  11. package/.next/cache/webpack/server-production/0.pack +0 -0
  12. package/.next/cache/webpack/server-production/index.pack +0 -0
  13. package/.next/export-marker.json +0 -1
  14. package/.next/images-manifest.json +0 -1
  15. package/.next/next-server.js.nft.json +0 -1
  16. package/.next/package.json +0 -1
  17. package/.next/prerender-manifest.json +0 -1
  18. package/.next/react-loadable-manifest.json +0 -44
  19. package/.next/required-server-files.json +0 -1
  20. package/.next/routes-manifest.json +0 -1
  21. package/.next/server/chunks/123.js +0 -58
  22. package/.next/server/chunks/143.js +0 -106
  23. package/.next/server/chunks/183.js +0 -90
  24. package/.next/server/chunks/205.js +0 -722
  25. package/.next/server/chunks/247.js +0 -61
  26. package/.next/server/chunks/253.js +0 -535
  27. package/.next/server/chunks/280.js +0 -324
  28. package/.next/server/chunks/287.js +0 -58
  29. package/.next/server/chunks/289.js +0 -229
  30. package/.next/server/chunks/312.js +0 -697
  31. package/.next/server/chunks/350.js +0 -143
  32. package/.next/server/chunks/368.js +0 -253
  33. package/.next/server/chunks/378.js +0 -326
  34. package/.next/server/chunks/487.js +0 -9142
  35. package/.next/server/chunks/502.js +0 -626
  36. package/.next/server/chunks/513.js +0 -257
  37. package/.next/server/chunks/576.js +0 -90
  38. package/.next/server/chunks/597.js +0 -211
  39. package/.next/server/chunks/650.js +0 -9142
  40. package/.next/server/chunks/676.js +0 -32
  41. package/.next/server/chunks/701.js +0 -87
  42. package/.next/server/chunks/74.js +0 -3898
  43. package/.next/server/chunks/825.js +0 -4039
  44. package/.next/server/chunks/854.js +0 -72
  45. package/.next/server/chunks/859.js +0 -959
  46. package/.next/server/chunks/886.js +0 -120
  47. package/.next/server/chunks/907.js +0 -1803
  48. package/.next/server/chunks/98.js +0 -124
  49. package/.next/server/chunks/font-manifest.json +0 -1
  50. package/.next/server/font-manifest.json +0 -1
  51. package/.next/server/middleware-build-manifest.js +0 -1
  52. package/.next/server/middleware-manifest.json +0 -6
  53. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  54. package/.next/server/pages/404.js +0 -393
  55. package/.next/server/pages/404.js.nft.json +0 -1
  56. package/.next/server/pages/500.js +0 -395
  57. package/.next/server/pages/500.js.nft.json +0 -1
  58. package/.next/server/pages/[...slug].js +0 -786
  59. package/.next/server/pages/[...slug].js.nft.json +0 -1
  60. package/.next/server/pages/[slug]/p.js +0 -2325
  61. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  62. package/.next/server/pages/_app.js +0 -281
  63. package/.next/server/pages/_app.js.nft.json +0 -1
  64. package/.next/server/pages/_document.js +0 -340
  65. package/.next/server/pages/_document.js.nft.json +0 -1
  66. package/.next/server/pages/_error.js +0 -164
  67. package/.next/server/pages/_error.js.nft.json +0 -1
  68. package/.next/server/pages/account.js +0 -370
  69. package/.next/server/pages/account.js.nft.json +0 -1
  70. package/.next/server/pages/api/graphql.js +0 -365
  71. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  72. package/.next/server/pages/api/preview.js +0 -119
  73. package/.next/server/pages/api/preview.js.nft.json +0 -1
  74. package/.next/server/pages/checkout.js +0 -370
  75. package/.next/server/pages/checkout.js.nft.json +0 -1
  76. package/.next/server/pages/en-US/404.html +0 -81
  77. package/.next/server/pages/en-US/404.json +0 -1
  78. package/.next/server/pages/en-US/500.html +0 -81
  79. package/.next/server/pages/en-US/500.json +0 -1
  80. package/.next/server/pages/en-US/account.html +0 -81
  81. package/.next/server/pages/en-US/account.json +0 -1
  82. package/.next/server/pages/en-US/checkout.html +0 -81
  83. package/.next/server/pages/en-US/checkout.json +0 -1
  84. package/.next/server/pages/en-US/login.html +0 -81
  85. package/.next/server/pages/en-US/login.json +0 -1
  86. package/.next/server/pages/en-US/s.html +0 -81
  87. package/.next/server/pages/en-US/s.json +0 -1
  88. package/.next/server/pages/en-US.html +0 -81
  89. package/.next/server/pages/en-US.json +0 -1
  90. package/.next/server/pages/index.js +0 -1026
  91. package/.next/server/pages/index.js.nft.json +0 -1
  92. package/.next/server/pages/login.js +0 -375
  93. package/.next/server/pages/login.js.nft.json +0 -1
  94. package/.next/server/pages/s.js +0 -473
  95. package/.next/server/pages/s.js.nft.json +0 -1
  96. package/.next/server/pages-manifest.json +0 -16
  97. package/.next/server/webpack-api-runtime.js +0 -229
  98. package/.next/server/webpack-runtime.js +0 -229
  99. package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
  100. package/.next/static/chunks/21-5b0c50a44b0ed6ce.js +0 -1
  101. package/.next/static/chunks/234-7d72b0ee52936c13.js +0 -1
  102. package/.next/static/chunks/460-08f41a79ff49f7be.js +0 -1
  103. package/.next/static/chunks/495.0ecd099878b2a36d.js +0 -1
  104. package/.next/static/chunks/502.ec90d1859d393d34.js +0 -1
  105. package/.next/static/chunks/597.f8d0595b113c70af.js +0 -1
  106. package/.next/static/chunks/64.ebbe1d2b40f980c7.js +0 -1
  107. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  108. package/.next/static/chunks/682-dc059ce3e47eb9e1.js +0 -1
  109. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  110. package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
  111. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  112. package/.next/static/chunks/main-fd466221927468fd.js +0 -1
  113. package/.next/static/chunks/pages/404-e7a1846b72ad3430.js +0 -1
  114. package/.next/static/chunks/pages/500-0f4d738fa1caac78.js +0 -1
  115. package/.next/static/chunks/pages/[...slug]-119a323292c7e3af.js +0 -1
  116. package/.next/static/chunks/pages/[slug]/p-3c424924080d88cb.js +0 -1
  117. package/.next/static/chunks/pages/_app-79d333aa6001a806.js +0 -1
  118. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  119. package/.next/static/chunks/pages/account-bbe1795b8566f75a.js +0 -1
  120. package/.next/static/chunks/pages/checkout-4321004c6cdaf5c7.js +0 -1
  121. package/.next/static/chunks/pages/index-949a5393471484d5.js +0 -1
  122. package/.next/static/chunks/pages/login-b09e2dd0941c8882.js +0 -1
  123. package/.next/static/chunks/pages/s-e603b0c6e5eef0a7.js +0 -1
  124. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  125. package/.next/static/chunks/webpack-9ba6546d294eb768.js +0 -1
  126. package/.next/static/css/104f0f3ce3be32c6.css +0 -1
  127. package/.next/static/css/23a9d5dfc051ec6e.css +0 -1
  128. package/.next/static/css/287f5ba239375052.css +0 -1
  129. package/.next/static/css/2e00f7ba49c754b3.css +0 -1
  130. package/.next/static/css/6e41f1b6078c14c1.css +0 -1
  131. package/.next/static/css/7d822a137c54a781.css +0 -1
  132. package/.next/static/css/8988ac07eb0af0ca.css +0 -1
  133. package/.next/static/css/c7fc1f563fa33060.css +0 -1
  134. package/.next/static/css/d4a0d9df8c6df555.css +0 -1
  135. package/.next/static/css/e02cdad8fc000339.css +0 -1
  136. package/.next/static/eLm2Cd_zypP0KQaj5UlQ2/_buildManifest.js +0 -1
  137. package/.next/static/eLm2Cd_zypP0KQaj5UlQ2/_ssgManifest.js +0 -1
  138. package/.next/trace +0 -72
  139. package/public/~partytown/debug/partytown-atomics.js +0 -556
  140. package/public/~partytown/debug/partytown-media.js +0 -374
  141. package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
  142. package/public/~partytown/debug/partytown-sw.js +0 -59
  143. package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
  144. package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
  145. package/public/~partytown/debug/partytown.js +0 -72
  146. package/public/~partytown/partytown-atomics.js +0 -2
  147. package/public/~partytown/partytown-media.js +0 -2
  148. package/public/~partytown/partytown-sw.js +0 -2
  149. package/public/~partytown/partytown.js +0 -2
@@ -1,324 +0,0 @@
1
- "use strict";
2
- exports.id = 280;
3
- exports.ids = [280];
4
- exports.modules = {
5
-
6
- /***/ 89875:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
-
10
- // EXPORTS
11
- __webpack_require__.d(__webpack_exports__, {
12
- "Z": () => (/* binding */ DiscountBadge_DiscountBadge)
13
- });
14
-
15
- // EXTERNAL MODULE: external "react"
16
- var external_react_ = __webpack_require__(16689);
17
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
18
- // EXTERNAL MODULE: ../components/dist/atoms/Badge/Badge.js
19
- var Badge = __webpack_require__(10044);
20
- ;// CONCATENATED MODULE: ../components/dist/molecules/DiscountBadge/useDiscountPercent.js
21
-
22
- const useDiscountPercent = (listPrice, spotPrice) => {
23
- return (0,external_react_.useMemo)(() => {
24
- const diff = listPrice - spotPrice;
25
- const discount = (diff * 100) / listPrice;
26
- return Math.round(discount);
27
- }, [spotPrice, listPrice]);
28
- };
29
- //# sourceMappingURL=useDiscountPercent.js.map
30
- ;// CONCATENATED MODULE: ../components/dist/molecules/DiscountBadge/DiscountBadge.js
31
-
32
-
33
-
34
- const DiscountBadge = ({ listPrice, spotPrice, thresholdLow = 15, thresholdHigh = 40, size, testId = 'fs-discount-badge', }) => {
35
- const discountPercent = useDiscountPercent(listPrice, spotPrice);
36
- if (discountPercent === 0) {
37
- return external_react_default().createElement((external_react_default()).Fragment, null);
38
- }
39
- const discountVariant = discountPercent <= thresholdLow
40
- ? 'low'
41
- : discountPercent <= thresholdHigh
42
- ? 'medium'
43
- : 'high';
44
- return (external_react_default().createElement(Badge/* default */.Z, { "data-fs-discount-badge": true, "data-fs-discount-badge-variant": discountVariant, size: size, "data-testid": testId },
45
- discountPercent,
46
- "% off"));
47
- };
48
- /* harmony default export */ const DiscountBadge_DiscountBadge = (DiscountBadge);
49
- //# sourceMappingURL=DiscountBadge.js.map
50
-
51
- /***/ }),
52
-
53
- /***/ 40783:
54
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
55
-
56
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
57
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
58
- /* harmony export */ });
59
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16689);
60
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
61
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25045);
62
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82765);
63
- /* harmony import */ var _atoms_List__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41329);
64
-
65
-
66
-
67
- const Rating = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function Rating({ children, testId = 'fs-rating', length = 5, value = 0, icon, onChange, ...otherProps }, ref) {
68
- const [hover, setHover] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
69
- const outlineProps = { 'data-fs-rating-icon-outline': true };
70
- const ratingIcon = react__WEBPACK_IMPORTED_MODULE_0___default().isValidElement(icon) ? icon : react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, { name: "Star" });
71
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_atoms_List__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, { ref: ref, "data-fs-rating": true, "data-fs-rating-actionable": typeof onChange === 'function', "data-testid": testId, ...otherProps }, Array.from({ length }).map((_, index) => {
72
- const tempIndex = index + 1;
73
- const fillCheck = () => {
74
- if (tempIndex <= (hover || value)) {
75
- return 'full';
76
- }
77
- if (tempIndex - value > 0 && tempIndex - value < 1) {
78
- return 'partial';
79
- }
80
- return 'empty';
81
- };
82
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", { key: `rating-${index}`, "data-fs-rating-item": fillCheck(), "data-testid": `${testId}-item` }, onChange ? (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, { "data-fs-rating-button": true, icon: ratingIcon, size: "small", "aria-label": "rate", onClick: () => {
83
- onChange(tempIndex);
84
- }, onMouseEnter: () => setHover(tempIndex), onMouseLeave: () => setHover(value) })) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null,
85
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { "data-fs-rating-icon-wrapper": true }, ratingIcon),
86
- react__WEBPACK_IMPORTED_MODULE_0___default().isValidElement(icon) ? (react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(icon, outlineProps)) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, { name: "Star", "data-fs-rating-icon-outline": true }))))));
87
- })));
88
- });
89
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rating);
90
- //# sourceMappingURL=Rating.js.map
91
-
92
- /***/ }),
93
-
94
- /***/ 56475:
95
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
96
-
97
-
98
- // EXPORTS
99
- __webpack_require__.d(__webpack_exports__, {
100
- "Z": () => (/* reexport */ product_ProductCard_ProductCard)
101
- });
102
-
103
- // EXTERNAL MODULE: external "react"
104
- var external_react_ = __webpack_require__(16689);
105
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
106
- ;// CONCATENATED MODULE: ../components/dist/molecules/ProductCard/ProductCard.js
107
-
108
- const ProductCard = (0,external_react_.forwardRef)(function ProductCard({ testId = 'fs-product-card', variant = 'default', bordered = false, outOfStock, children, ...otherProps }, ref) {
109
- return (external_react_default().createElement("article", { ref: ref, "data-fs-product-card": outOfStock ? 'out-of-stock' : '', "data-fs-product-card-variant": variant, "data-fs-product-card-bordered": bordered, "data-testid": testId, ...otherProps }, children));
110
- });
111
- /* harmony default export */ const ProductCard_ProductCard = (ProductCard);
112
- //# sourceMappingURL=ProductCard.js.map
113
- ;// CONCATENATED MODULE: ../components/dist/molecules/ProductCard/ProductCardImage.js
114
-
115
- const ProductCardImage = (0,external_react_.forwardRef)(function ProductCardImage({ testId = 'fs-product-card-image', aspectRatio = 1, children, ...otherProps }, ref) {
116
- return (external_react_default().createElement("div", { ref: ref, "data-fs-product-card-image": true, "data-testid": testId, style: {
117
- '--fs-product-card-image-aspect-ratio': aspectRatio
118
- }, ...otherProps }, children));
119
- });
120
- /* harmony default export */ const ProductCard_ProductCardImage = (ProductCardImage);
121
- //# sourceMappingURL=ProductCardImage.js.map
122
- // EXTERNAL MODULE: ../components/dist/atoms/Link/Link.js
123
- var Link = __webpack_require__(87865);
124
- // EXTERNAL MODULE: ../components/dist/atoms/Price/Price.js
125
- var Price = __webpack_require__(57549);
126
- // EXTERNAL MODULE: ../components/dist/molecules/Rating/Rating.js
127
- var Rating = __webpack_require__(40783);
128
- // EXTERNAL MODULE: ../components/dist/atoms/Icon/Icon.js
129
- var Icon = __webpack_require__(25045);
130
- // EXTERNAL MODULE: ../components/dist/molecules/DiscountBadge/DiscountBadge.js + 1 modules
131
- var DiscountBadge = __webpack_require__(89875);
132
- // EXTERNAL MODULE: ../components/dist/atoms/Badge/Badge.js
133
- var Badge = __webpack_require__(10044);
134
- // EXTERNAL MODULE: ../components/dist/atoms/Button/Button.js
135
- var Button = __webpack_require__(57578);
136
- ;// CONCATENATED MODULE: ../components/dist/molecules/ProductCard/ProductCardContent.js
137
-
138
-
139
- const ProductCardContent = (0,external_react_.forwardRef)(function CardContent({ testId = 'fs-product-card-content', title, linkProps, price, outOfStock, outOfStockLabel = 'Out of stock', ratingValue, showDiscountBadge, buttonLabel = 'Add', onButtonClick, children, ...otherProps }, ref) {
140
- return (external_react_default().createElement("section", { ref: ref, "data-fs-product-card-content": true, "data-fs-product-card-badge": showDiscountBadge, "data-testid": testId, ...otherProps },
141
- external_react_default().createElement("div", { "data-fs-product-card-heading": true },
142
- external_react_default().createElement("h3", { "data-fs-product-card-title": true },
143
- external_react_default().createElement(Link/* default */.Z, { ...linkProps, title: title }, title)),
144
- external_react_default().createElement("div", { "data-fs-product-card-prices": true },
145
- external_react_default().createElement(Price/* default */.Z, { value: price?.listPrice ? price.listPrice : 0, formatter: price?.formatter, testId: "list-price", "data-value": price?.listPrice, variant: "listing", SRText: "Original price:" }),
146
- external_react_default().createElement(Price/* default */.Z, { value: price?.value ? price.value : 0, formatter: price?.formatter, testId: "price", "data-value": price?.value, variant: "spot", SRText: "Sale Price:" })),
147
- ratingValue && external_react_default().createElement(Rating/* default */.Z, { value: ratingValue, icon: external_react_default().createElement(Icon/* default */.Z, { name: "Star" }) })),
148
- showDiscountBadge && !outOfStock && (external_react_default().createElement(DiscountBadge/* default */.Z, { listPrice: price?.listPrice ? price.listPrice : 0, spotPrice: price?.value ? price.value : 0 })),
149
- outOfStock && external_react_default().createElement(Badge/* default */.Z, null, outOfStockLabel),
150
- onButtonClick && !outOfStock && (external_react_default().createElement("div", { "data-fs-product-card-actions": true },
151
- external_react_default().createElement(Button/* default */.Z, { variant: "primary", icon: external_react_default().createElement(Icon/* default */.Z, { name: "ShoppingCart" }), iconPosition: "left", size: "small", onClick: onButtonClick }, buttonLabel)))));
152
- });
153
- /* harmony default export */ const ProductCard_ProductCardContent = (ProductCardContent);
154
- //# sourceMappingURL=ProductCardContent.js.map
155
- // EXTERNAL MODULE: ./node_modules/next/link.js
156
- var next_link = __webpack_require__(41664);
157
- var link_default = /*#__PURE__*/__webpack_require__.n(next_link);
158
- // EXTERNAL MODULE: ./src/components/ui/Image/index.ts + 2 modules
159
- var Image = __webpack_require__(79266);
160
- // EXTERNAL MODULE: ./src/sdk/product/useFormattedPrice.ts
161
- var useFormattedPrice = __webpack_require__(95346);
162
- // EXTERNAL MODULE: ./src/sdk/product/useProductLink.ts
163
- var useProductLink = __webpack_require__(49854);
164
- // EXTERNAL MODULE: external "react/jsx-runtime"
165
- var jsx_runtime_ = __webpack_require__(20997);
166
- ;// CONCATENATED MODULE: ./src/components/product/ProductCard/ProductCard.tsx
167
- const _excluded = ["product", "index", "bordered", "variant", "aspectRatio", "imgProps", "ratingValue", "buttonLabel", "onButtonClick", "showDiscountBadge"];
168
-
169
- 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; }
170
-
171
- 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; }
172
-
173
- 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; }
174
-
175
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
176
-
177
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
178
-
179
-
180
-
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
- function ProductCard_ProductCard_ProductCard(_ref) {
189
- let {
190
- product,
191
- index,
192
- bordered = false,
193
- variant = 'default',
194
- aspectRatio = 1,
195
- imgProps,
196
- ratingValue,
197
- buttonLabel = 'Add',
198
- onButtonClick,
199
- showDiscountBadge = true
200
- } = _ref,
201
- otherProps = _objectWithoutProperties(_ref, _excluded);
202
-
203
- const {
204
- sku,
205
- isVariantOf: {
206
- name
207
- },
208
- image: [img],
209
- offers: {
210
- lowPrice: spotPrice,
211
- offers: [{
212
- listPrice,
213
- availability
214
- }]
215
- }
216
- } = product;
217
-
218
- const linkProps = _objectSpread(_objectSpread({}, (0,useProductLink/* useProductLink */.w)({
219
- product,
220
- selectedOffer: 0,
221
- index
222
- })), {}, {
223
- as: (link_default()),
224
- passHref: true,
225
- legacyBehavior: false,
226
- prefetch: false
227
- });
228
-
229
- const outOfStock = availability !== 'https://schema.org/InStock';
230
- return /*#__PURE__*/(0,jsx_runtime_.jsxs)(ProductCard_ProductCard, _objectSpread(_objectSpread({
231
- outOfStock: outOfStock,
232
- bordered: bordered,
233
- variant: variant,
234
- "data-fs-product-card-sku": sku
235
- }, otherProps), {}, {
236
- children: [/*#__PURE__*/jsx_runtime_.jsx(ProductCard_ProductCardImage, {
237
- aspectRatio: aspectRatio,
238
- children: /*#__PURE__*/jsx_runtime_.jsx(Image/* Image */.E, {
239
- src: img.url,
240
- alt: img.alternateName,
241
- sizes: `${imgProps?.sizes ?? '(max-width: 768px) 40vw, 30vw'}`,
242
- width: imgProps?.width ?? 360,
243
- height: Math.round((Number(imgProps?.height) || 360) / aspectRatio),
244
- loading: imgProps?.loading
245
- })
246
- }), /*#__PURE__*/jsx_runtime_.jsx(ProductCard_ProductCardContent, {
247
- title: name,
248
- price: {
249
- value: spotPrice,
250
- listPrice: listPrice,
251
- formatter: useFormattedPrice/* useFormattedPrice */.P
252
- },
253
- ratingValue: ratingValue,
254
- outOfStock: outOfStock,
255
- onButtonClick: onButtonClick,
256
- linkProps: linkProps,
257
- showDiscountBadge: showDiscountBadge
258
- })]
259
- }));
260
- }
261
-
262
- const fragment = "unknown";
263
- /* harmony default export */ const product_ProductCard_ProductCard = (/*#__PURE__*/(0,external_react_.memo)(ProductCard_ProductCard_ProductCard));
264
- ;// CONCATENATED MODULE: ./src/components/product/ProductCard/index.ts
265
-
266
-
267
- /***/ }),
268
-
269
- /***/ 55184:
270
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
271
-
272
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
273
- /* harmony export */ "m": () => (/* binding */ useViewItemListEvent)
274
- /* harmony export */ });
275
- /* harmony import */ var _faststore_sdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71072);
276
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16689);
277
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
278
- /* harmony import */ var src_sdk_session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97295);
279
-
280
-
281
-
282
- const useViewItemListEvent = ({
283
- products,
284
- title,
285
- page,
286
- pageSize
287
- }) => {
288
- const {
289
- currency: {
290
- code
291
- }
292
- } = (0,src_sdk_session__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .kP)();
293
- const sendViewItemListEvent = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
294
- (0,_faststore_sdk__WEBPACK_IMPORTED_MODULE_2__/* .sendAnalyticsEvent */ ._)({
295
- name: 'view_item_list',
296
- params: {
297
- item_list_name: title,
298
- item_list_id: title,
299
- items: products.map(({
300
- node: product
301
- }, index) => ({
302
- item_id: product.isVariantOf.productGroupID,
303
- item_name: product.isVariantOf.name,
304
- item_brand: product.brand.name,
305
- item_variant: product.sku,
306
- price: product.offers.offers[0].price,
307
- index: page * pageSize + index + 1,
308
- discount: product.offers.offers[0].listPrice - product.offers.offers[0].price,
309
- currency: code,
310
- item_variant_name: product.name,
311
- product_reference_id: product.gtin
312
- }))
313
- }
314
- });
315
- }, [code, products, title, page, pageSize]);
316
- return {
317
- sendViewItemListEvent
318
- };
319
- };
320
-
321
- /***/ })
322
-
323
- };
324
- ;
@@ -1,58 +0,0 @@
1
- "use strict";
2
- exports.id = 287;
3
- exports.ids = [287];
4
- exports.modules = {
5
-
6
- /***/ 57216:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
11
- /* harmony export */ });
12
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16689);
13
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
14
-
15
- const Label = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function Label({ testId = 'fs-label', children, ...otherProps }, ref) {
16
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", { ref: ref, "data-fs-label": true, "data-testid": testId, ...otherProps }, children));
17
- });
18
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Label);
19
- //# sourceMappingURL=Label.js.map
20
-
21
- /***/ }),
22
-
23
- /***/ 28287:
24
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
25
-
26
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
27
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
28
- /* harmony export */ });
29
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16689);
30
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
31
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(875);
32
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57216);
33
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82765);
34
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25045);
35
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(57578);
36
-
37
-
38
- const InputField = ({ id, label, type = 'text', error, displayClearButton, actionable, buttonActionText = 'Apply', onSubmit, onClear, placeholder = ' ', // initializes with an empty space to style float label using `placeholder-shown`
39
- inputRef, disabled, value, testId = 'fs-input-field', ...otherProps }) => {
40
- const shouldDisplayError = !disabled && error && error !== '';
41
- const shouldDisplayButton = actionable && !disabled && value !== '';
42
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { "data-fs-input-field": true, "data-fs-input-field-actionable": actionable, "data-fs-input-field-error": error && error !== '', "data-testid": testId },
43
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, { id: id, type: type, value: value, ref: inputRef, disabled: disabled, placeholder: placeholder, ...otherProps }),
44
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, { htmlFor: id }, label),
45
- shouldDisplayButton &&
46
- (displayClearButton || error ? (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, { size: "small", "aria-label": "Clear Field", icon: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, { name: "XCircle" }), onClick: () => {
47
- onClear?.();
48
- inputRef?.current?.focus();
49
- } })) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, { variant: "tertiary", size: "small", onClick: onSubmit }, buttonActionText))),
50
- shouldDisplayError && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { "data-fs-input-field-error-message": true }, error))));
51
- };
52
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InputField);
53
- //# sourceMappingURL=InputField.js.map
54
-
55
- /***/ })
56
-
57
- };
58
- ;
@@ -1,229 +0,0 @@
1
- "use strict";
2
- exports.id = 289;
3
- exports.ids = [289];
4
- exports.modules = {
5
-
6
- /***/ 84436:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
-
10
- // EXPORTS
11
- __webpack_require__.d(__webpack_exports__, {
12
- "Z": () => (/* reexport */ product_ProductGrid_ProductGrid)
13
- });
14
-
15
- // EXTERNAL MODULE: external "react"
16
- var external_react_ = __webpack_require__(16689);
17
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
18
- ;// CONCATENATED MODULE: ../components/dist/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/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/index.ts + 1 modules
33
- var ProductGridSkeleton = __webpack_require__(89913);
34
- // EXTERNAL MODULE: ./src/components/product/ProductCard/index.ts + 4 modules
35
- var ProductCard = __webpack_require__(56475);
36
- // EXTERNAL MODULE: external "react/jsx-runtime"
37
- var jsx_runtime_ = __webpack_require__(20997);
38
- ;// CONCATENATED MODULE: ./src/components/product/ProductGrid/ProductGrid.tsx
39
-
40
-
41
-
42
-
43
-
44
- function ProductGrid_ProductGrid_ProductGrid({
45
- products,
46
- page,
47
- pageSize,
48
- productCard
49
- }) {
50
- const aspectRatio = 1;
51
- return /*#__PURE__*/jsx_runtime_.jsx(ProductGridSkeleton/* default */.Z, {
52
- aspectRatio: aspectRatio,
53
- loading: products.length === 0,
54
- children: /*#__PURE__*/jsx_runtime_.jsx(ProductGrid_ProductGrid, {
55
- children: products.map(({
56
- node: product
57
- }, idx) => /*#__PURE__*/jsx_runtime_.jsx(ProductGrid_ProductGridItem, {
58
- children: /*#__PURE__*/jsx_runtime_.jsx(ProductCard/* default */.Z, {
59
- product: product,
60
- index: pageSize * page + idx + 1,
61
- bordered: productCard?.bordered,
62
- showDiscountBadge: productCard?.showDiscountBadge,
63
- aspectRatio: aspectRatio,
64
- imgProps: {
65
- width: 150,
66
- height: 150,
67
- sizes: '30vw'
68
- }
69
- })
70
- }, `${product.id}`))
71
- })
72
- });
73
- }
74
-
75
- /* harmony default export */ const product_ProductGrid_ProductGrid = (ProductGrid_ProductGrid_ProductGrid);
76
- ;// CONCATENATED MODULE: ./src/components/product/ProductGrid/index.ts
77
-
78
-
79
- /***/ }),
80
-
81
- /***/ 75289:
82
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
83
-
84
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
85
- __webpack_require__.r(__webpack_exports__);
86
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
87
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
88
- /* harmony export */ });
89
- /* harmony import */ var _faststore_sdk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(73221);
90
- /* harmony import */ var src_components_product_ProductGrid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(84436);
91
- /* harmony import */ var src_sdk_search_Sentinel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1566);
92
- /* harmony import */ var _usePageProducts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(49521);
93
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20997);
94
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
95
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_usePageProducts__WEBPACK_IMPORTED_MODULE_2__]);
96
- _usePageProducts__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
- function GalleryPage({
106
- page,
107
- title,
108
- productCard
109
- }) {
110
- const products = (0,_usePageProducts__WEBPACK_IMPORTED_MODULE_2__/* .useProducts */ .r)(page) ?? [];
111
- const {
112
- itemsPerPage
113
- } = (0,_faststore_sdk__WEBPACK_IMPORTED_MODULE_4__/* .useSearch */ .R)();
114
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.Fragment, {
115
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(src_sdk_search_Sentinel__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
116
- products: products,
117
- page: page,
118
- pageSize: itemsPerPage,
119
- title: title
120
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(src_components_product_ProductGrid__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z, {
121
- products: products,
122
- page: page,
123
- pageSize: itemsPerPage,
124
- productCard: productCard
125
- })]
126
- });
127
- }
128
-
129
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GalleryPage);
130
- __webpack_async_result__();
131
- } catch(e) { __webpack_async_result__(e); } });
132
-
133
- /***/ }),
134
-
135
- /***/ 1566:
136
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
137
-
138
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
139
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
140
- /* harmony export */ });
141
- /* harmony import */ var _faststore_sdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(73221);
142
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16689);
143
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
144
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19785);
145
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__);
146
- /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71853);
147
- /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_router__WEBPACK_IMPORTED_MODULE_2__);
148
- /* harmony import */ var _analytics_hooks_useViewItemListEvent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(55184);
149
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20997);
150
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
- // Adds/Replaces ?page= to the querystring of the page
159
- const replacePagination = (page, router) => {
160
- const url = new URL(window.location.href); // In case the page argument already matches the target page
161
-
162
- if (url.searchParams.get('page') === page) {
163
- return;
164
- } // Set ?page= parameter and replace route
165
-
166
-
167
- url.searchParams.set('page', page);
168
- router.replace(url, undefined, {
169
- shallow: true,
170
- scroll: false
171
- });
172
- };
173
- /**
174
- * Use this component to add a boundary between pages so we can
175
- * change the current page being viewed on infinite pagination.
176
- *
177
- * For more info: https://developers.google.com/search/blog/2014/02/infinite-scroll-search-friendly
178
- *
179
- * Also, this component's name is kind of curious. Wikipedia calls is Page Break(https://en.wikipedia.org/wiki/Page_break)
180
- * however all codes I've seen online use Sentinel
181
- */
182
-
183
-
184
- function Sentinel({
185
- page,
186
- pageSize,
187
- products,
188
- title
189
- }) {
190
- const viewedRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
191
- const {
192
- ref,
193
- inView
194
- } = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__.useInView)();
195
- const {
196
- pages
197
- } = (0,_faststore_sdk__WEBPACK_IMPORTED_MODULE_5__/* .useSearch */ .R)();
198
- const router = (0,next_router__WEBPACK_IMPORTED_MODULE_2__.useRouter)();
199
- const {
200
- sendViewItemListEvent
201
- } = (0,_analytics_hooks_useViewItemListEvent__WEBPACK_IMPORTED_MODULE_3__/* .useViewItemListEvent */ .m)({
202
- products,
203
- title,
204
- page,
205
- pageSize
206
- });
207
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
208
- // Only replace pagination state when infinite scroll
209
- // state has more than one page being rendered to the screen
210
- if (inView && pages.length > 1) {
211
- replacePagination(page.toString(), router);
212
- }
213
-
214
- if (inView && !viewedRef.current && products.length) {
215
- sendViewItemListEvent();
216
- viewedRef.current = true;
217
- }
218
- }, [pages.length, inView, page, router, sendViewItemListEvent, products.length]);
219
- return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx("div", {
220
- ref: ref
221
- });
222
- }
223
-
224
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Sentinel);
225
-
226
- /***/ })
227
-
228
- };
229
- ;