@faststore/core 2.2.0-alpha.1 → 2.2.0-alpha.12
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +74 -75
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- package/.next/cache/next-server.js.nft.json +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +11 -8
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/{647.js → 117.js} +32 -35
- package/.next/server/chunks/183.js +1 -0
- package/.next/server/chunks/289.js +25 -27
- package/.next/server/chunks/312.js +53 -72
- package/.next/server/chunks/350.js +8 -8
- package/.next/server/chunks/{483.js → 37.js} +121 -162
- package/.next/server/chunks/386.js +200 -0
- package/.next/server/chunks/{753.js → 387.js} +8 -12
- package/.next/server/chunks/574.js +42 -23
- package/.next/server/chunks/576.js +1 -0
- package/.next/server/chunks/{530.js → 585.js} +65 -51
- package/.next/server/chunks/{186.js → 692.js} +6 -8
- package/.next/server/chunks/{112.js → 732.js} +282 -457
- package/.next/server/chunks/74.js +247 -345
- package/.next/server/chunks/825.js +38 -3
- package/.next/server/chunks/{71.js → 897.js} +174 -181
- package/.next/server/chunks/98.js +42 -23
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.js +13 -13
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.js +14 -14
- package/.next/server/pages/500.js.nft.json +1 -1
- package/.next/server/pages/[...slug].js +141 -184
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +242 -219
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js +3 -4
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js +17 -33
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/account.js +12 -12
- package/.next/server/pages/account.js.nft.json +1 -1
- package/.next/server/pages/api/graphql.js +15 -8
- package/.next/server/pages/api/graphql.js.nft.json +1 -1
- package/.next/server/pages/api/preview.js +2 -20
- package/.next/server/pages/checkout.js +12 -12
- package/.next/server/pages/checkout.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +2 -2
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/account.html +2 -2
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US.html +11 -2
- package/.next/server/pages/index.js +41 -48
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/login.js +15 -15
- package/.next/server/pages/login.js.nft.json +1 -1
- package/.next/server/pages/s.js +52 -52
- package/.next/server/pages/s.js.nft.json +1 -1
- package/.next/server/pages-manifest.json +2 -2
- package/.next/static/6R1hrzilfMwT81RW6cNqt/_buildManifest.js +1 -0
- package/.next/static/chunks/251.ffc4f3998ecb915a.js +1 -0
- package/.next/static/chunks/383-6217b37bd38ffd07.js +1 -0
- package/.next/static/chunks/386.d01e0db26c523f0f.js +1 -0
- package/.next/static/chunks/{574.d13dd0afe15cd635.js → 574.70612be06fd1365f.js} +1 -1
- package/.next/static/chunks/585.3350efefe61c9461.js +1 -0
- package/.next/static/chunks/635-666ee2cad2925bb7.js +1 -0
- package/.next/static/chunks/721-f1665b3f1d98b7a9.js +1 -0
- package/.next/static/chunks/722-d0cc87aacd616b5d.js +1 -0
- package/.next/static/chunks/783-ded9d8cda0d5c8d9.js +1 -0
- package/.next/static/chunks/{709.daf1eddebf1e7952.js → 800.851af48fe2ab4a4c.js} +1 -1
- package/.next/static/chunks/98.40c7e17d9de4eb8f.js +1 -0
- package/.next/static/chunks/988.afda042dd9ba11d1.js +1 -0
- package/.next/static/chunks/main-e4e873ee741162eb.js +1 -0
- package/.next/static/chunks/pages/{404-af78f7cd1d3c1f60.js → 404-6c674028b2f80cbb.js} +1 -1
- package/.next/static/chunks/pages/{500-f6346ca5f9dc4fef.js → 500-ff55de77265a7e43.js} +1 -1
- package/.next/static/chunks/pages/[...slug]-7f8dc13cc9542463.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-2fb3fd9027f2923b.js +1 -0
- package/.next/static/chunks/pages/{_app-6d0e6ab9a4dd8106.js → _app-7db7de3d205714be.js} +1 -1
- package/.next/static/chunks/pages/{account-05bd79fb78365e88.js → account-b06035cba2c99604.js} +1 -1
- package/.next/static/chunks/pages/{checkout-c973786e68f25a39.js → checkout-f0c3e8d691cb8a54.js} +1 -1
- package/.next/static/chunks/pages/index-a141c747fcc197a1.js +1 -0
- package/.next/static/chunks/pages/{login-8deb9243376b6aa1.js → login-4e0e6cab7a07f1f3.js} +1 -1
- package/.next/static/chunks/pages/s-823f8e1cabbf63b3.js +1 -0
- package/.next/static/chunks/webpack-f3d0973d5a781e73.js +1 -0
- package/.next/static/css/6a7fdc5a21fbead5.css +1 -0
- package/.next/static/css/723835bce380750d.css +1 -0
- package/.next/static/css/8f93a4630936c20b.css +1 -0
- package/.next/static/css/9f79fa103f49bca1.css +1 -0
- package/.next/static/css/fd27ecc37832aa54.css +1 -0
- package/.next/trace +77 -80
- package/.turbo/turbo-build.log +24 -21
- package/.turbo/turbo-lint.log +3 -0
- package/.turbo/turbo-test.log +10 -10
- package/@generated/graphql/index.ts +38 -14
- package/@generated/graphql/persisted.json +6 -6
- package/README.md +3 -3
- package/cms/faststore/sections.json +24 -0
- package/cypress/global.js +8 -0
- package/cypress/integration/a11y.test.js +7 -24
- package/cypress/integration/analytics.test.js +78 -87
- package/cypress/integration/cart.test.js +4 -4
- package/cypress/integration/plp.test.js +6 -6
- package/cypress/integration/search.test.js +1 -1
- package/cypress/integration/seo.test.js +14 -14
- package/cypress.config.ts +19 -0
- package/faststore.config.js +1 -0
- package/index.ts +4 -0
- package/next.config.js +4 -0
- package/package.json +22 -18
- package/src/components/cart/CartSidebar/CartSidebar.tsx +41 -27
- package/src/components/product/NotAvailableButton/NotAvailableButton.tsx +13 -0
- package/src/components/product/NotAvailableButton/index.ts +1 -0
- package/src/components/product/ProductGrid/ProductGrid.tsx +2 -2
- package/src/components/search/Filter/Filter.tsx +1 -1
- package/src/components/search/Filter/FilterDesktop.tsx +1 -1
- package/src/components/search/Filter/FilterSlider.tsx +1 -1
- package/src/components/search/SearchInput/SearchInput.tsx +12 -1
- package/src/components/search/SearchTop/SearchTop.tsx +7 -1
- package/src/components/sections/CrossSellingShelf/CrossSellingShelf.tsx +0 -1
- package/src/components/sections/Newsletter/Overrides.tsx +4 -0
- package/src/components/sections/ProductDetails/Overrides.tsx +8 -4
- package/src/components/sections/ProductDetails/ProductDetails.tsx +26 -15
- package/src/components/sections/ProductTiles/ProductTiles.tsx +3 -2
- package/src/components/ui/ImageGallery/ImageGallery.tsx +13 -6
- package/src/components/ui/Newsletter/Newsletter.tsx +6 -44
- package/src/components/ui/Newsletter/NewsletterAddendum.tsx +86 -0
- package/src/components/ui/ProductDescription/ProductDescription.tsx +6 -1
- package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +97 -58
- package/src/components/ui/ProductGallery/ProductGallery.tsx +2 -2
- package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +12 -34
- package/src/customizations/fragments/{ClientProducts.ts → ClientManyProducts.ts} +1 -1
- package/src/customizations/fragments/ClientSearchSuggestions.ts +13 -0
- package/src/customizations/fragments/ClientShippingSimulation.ts +11 -0
- package/src/customizations/fragments/ClientTopSearchSuggestions.ts +13 -0
- package/src/customizations/fragments/{ServerProductPage.ts → ServerProduct.ts} +1 -1
- package/src/experimental/index.ts +36 -0
- package/src/pages/[...slug].tsx +5 -2
- package/src/pages/[slug]/p.tsx +7 -7
- package/src/sdk/analytics/index.tsx +1 -1
- package/src/sdk/analytics/platform/vtex/search.ts +53 -21
- package/src/sdk/analytics/types.ts +14 -0
- package/src/sdk/overrides/PageProvider.tsx +9 -5
- package/src/sdk/product/useLocalizedVariables.ts +2 -2
- package/src/sdk/product/usePageProductsQuery.ts +8 -8
- package/src/sdk/product/useProductGalleryQuery.ts +32 -3
- package/src/sdk/product/useProductsPrefetch.ts +4 -4
- package/src/sdk/product/useProductsQuery.ts +7 -7
- package/src/sdk/search/useSuggestions.ts +48 -16
- package/src/sdk/search/useTopSearch.ts +7 -12
- package/src/sdk/shipping/index.ts +6 -4
- package/src/{components/ui/ShippingSimulation → sdk/shipping}/useShippingSimulation.ts +33 -56
- package/src/server/generator/schema.ts +2 -1
- package/src/typings/overrides.ts +8 -2
- package/tsconfig.json +2 -1
- package/.next/static/chunks/148.3bb7e05cc5d1c1c4.js +0 -1
- package/.next/static/chunks/238-86838f629f3d0aa4.js +0 -1
- package/.next/static/chunks/243-ef9e49ef3df579c0.js +0 -1
- package/.next/static/chunks/530.848b014622932b93.js +0 -1
- package/.next/static/chunks/548-ab84e9e8b49413ab.js +0 -1
- package/.next/static/chunks/738-67a288ca3569cdbb.js +0 -1
- package/.next/static/chunks/932-33f45603c7d12a4b.js +0 -1
- package/.next/static/chunks/98.1632997dfd4d3a52.js +0 -1
- package/.next/static/chunks/988.d10040040cdfebbb.js +0 -1
- package/.next/static/chunks/main-fd466221927468fd.js +0 -1
- package/.next/static/chunks/pages/[...slug]-362204c7e0b533cf.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-885042c4b2b4f8ed.js +0 -1
- package/.next/static/chunks/pages/index-79b05b0071c02fff.js +0 -1
- package/.next/static/chunks/pages/s-e1bb00f8de6a386e.js +0 -1
- package/.next/static/chunks/webpack-88d120cefa1c4c09.js +0 -1
- package/.next/static/css/20e4a3a45cdd65f4.css +0 -1
- package/.next/static/css/4b7138899cd07c63.css +0 -1
- package/.next/static/css/e3b039e8f5daf95f.css +0 -1
- package/.next/static/css/f0e2d1b8832e935d.css +0 -1
- package/.next/static/wPqgZ8bYrPY473PZzuIX_/_buildManifest.js +0 -1
- package/cypress.json +0 -9
- package/generate.sh +0 -71
- /package/.next/static/{wPqgZ8bYrPY473PZzuIX_ → 6R1hrzilfMwT81RW6cNqt}/_ssgManifest.js +0 -0
- /package/src/{components/ui/ProductGallery → sdk/search}/useDelayedFacets.ts +0 -0
- /package/src/{components/ui/ProductGallery → sdk/search}/useDelayedPagination.ts +0 -0
- /package/src/{components/search/Filter → sdk/search}/useFilter.ts +0 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
exports.id =
|
|
2
|
-
exports.ids = [
|
|
1
|
+
exports.id = 387;
|
|
2
|
+
exports.ids = [387];
|
|
3
3
|
exports.modules = {
|
|
4
4
|
|
|
5
|
-
/***/
|
|
5
|
+
/***/ 387:
|
|
6
6
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
7
7
|
|
|
8
8
|
"use strict";
|
|
9
9
|
|
|
10
10
|
// EXPORTS
|
|
11
11
|
__webpack_require__.d(__webpack_exports__, {
|
|
12
|
-
"Z": () => (/*
|
|
12
|
+
"Z": () => (/* binding */ sections_Breadcrumb_Breadcrumb)
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
// EXTERNAL MODULE: external "react"
|
|
16
16
|
var external_react_ = __webpack_require__(6689);
|
|
17
17
|
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
18
|
-
// EXTERNAL MODULE: ./src/components/ui/Link/
|
|
19
|
-
var Link = __webpack_require__(
|
|
18
|
+
// EXTERNAL MODULE: ./src/components/ui/Link/Link.tsx
|
|
19
|
+
var Link = __webpack_require__(7058);
|
|
20
20
|
// EXTERNAL MODULE: ../components/dist/esm/atoms/Icon/Icon.js
|
|
21
21
|
var Icon = __webpack_require__(2614);
|
|
22
22
|
// EXTERNAL MODULE: ../components/dist/esm/atoms/Link/Link.js
|
|
@@ -437,10 +437,8 @@ const Breadcrumb_Breadcrumb_Breadcrumb = _ref => {
|
|
|
437
437
|
};
|
|
438
438
|
|
|
439
439
|
/* harmony default export */ const ui_Breadcrumb_Breadcrumb = (/*#__PURE__*/(0,external_react_.memo)(Breadcrumb_Breadcrumb_Breadcrumb));
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
// EXTERNAL MODULE: ./src/components/sections/Section/index.ts
|
|
443
|
-
var Section = __webpack_require__(7067);
|
|
440
|
+
// EXTERNAL MODULE: ./src/components/sections/Section/Section.tsx
|
|
441
|
+
var Section = __webpack_require__(3271);
|
|
444
442
|
// EXTERNAL MODULE: ./src/components/sections/Breadcrumb/section.module.scss
|
|
445
443
|
var section_module = __webpack_require__(5000);
|
|
446
444
|
var section_module_default = /*#__PURE__*/__webpack_require__.n(section_module);
|
|
@@ -479,8 +477,6 @@ function BreadcrumbSection(_ref) {
|
|
|
479
477
|
}
|
|
480
478
|
|
|
481
479
|
/* harmony default export */ const sections_Breadcrumb_Breadcrumb = (/*#__PURE__*/(0,external_react_.memo)(BreadcrumbSection));
|
|
482
|
-
;// CONCATENATED MODULE: ./src/components/sections/Breadcrumb/index.ts
|
|
483
|
-
|
|
484
480
|
|
|
485
481
|
/***/ }),
|
|
486
482
|
|
|
@@ -87,29 +87,48 @@ const sendEvent = options => fetch(`https://sp.vtex.com/event-api/v1/${(faststor
|
|
|
87
87
|
const isFullTextSearch = url => typeof url.searchParams.get('q') === 'string' && /^\/s(\/)?$/g.test(url.pathname);
|
|
88
88
|
|
|
89
89
|
const handleEvent = event => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
90
|
+
switch (event.name) {
|
|
91
|
+
case 'search_select_item':
|
|
92
|
+
{
|
|
93
|
+
const url = new URL(event.params.url);
|
|
94
|
+
|
|
95
|
+
if (!isFullTextSearch(url)) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
for (const item of event.params.items ?? []) {
|
|
100
|
+
const productId = item.item_id ?? item.item_variant;
|
|
101
|
+
const position = item.index;
|
|
102
|
+
|
|
103
|
+
if (productId && position) {
|
|
104
|
+
sendEvent({
|
|
105
|
+
type: 'search.click',
|
|
106
|
+
productId,
|
|
107
|
+
position,
|
|
108
|
+
url: url.href,
|
|
109
|
+
text: url.searchParams.get('q') ?? '<empty>'
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
case 'intelligent_search_query':
|
|
118
|
+
{
|
|
119
|
+
sendEvent({
|
|
120
|
+
type: 'search.query',
|
|
121
|
+
url: event.params.url,
|
|
122
|
+
text: event.params.term,
|
|
123
|
+
misspelled: event.params.isTermMisspelled,
|
|
124
|
+
match: event.params.totalCount,
|
|
125
|
+
operator: event.params.logicalOperator,
|
|
126
|
+
locale: event.params.locale
|
|
127
|
+
});
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
default:
|
|
113
132
|
}
|
|
114
133
|
};
|
|
115
134
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
exports.id =
|
|
2
|
-
exports.ids = [
|
|
1
|
+
exports.id = 585;
|
|
2
|
+
exports.ids = [585];
|
|
3
3
|
exports.modules = {
|
|
4
4
|
|
|
5
5
|
/***/ 6133:
|
|
@@ -24,7 +24,7 @@ function EmptyState({ testId = 'fs-empty-state', title, titleIcon, variant = 'de
|
|
|
24
24
|
|
|
25
25
|
/***/ }),
|
|
26
26
|
|
|
27
|
-
/***/
|
|
27
|
+
/***/ 6585:
|
|
28
28
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
29
29
|
|
|
30
30
|
"use strict";
|
|
@@ -94,7 +94,7 @@ var Button = __webpack_require__(3339);
|
|
|
94
94
|
// EXTERNAL MODULE: ../components/dist/esm/atoms/Icon/Icon.js
|
|
95
95
|
var Icon = __webpack_require__(2614);
|
|
96
96
|
// EXTERNAL MODULE: ./src/sdk/cart/index.ts + 1 modules
|
|
97
|
-
var
|
|
97
|
+
var cart = __webpack_require__(6073);
|
|
98
98
|
// EXTERNAL MODULE: ./faststore.config.js
|
|
99
99
|
var faststore_config = __webpack_require__(7183);
|
|
100
100
|
var faststore_config_default = /*#__PURE__*/__webpack_require__.n(faststore_config);
|
|
@@ -105,7 +105,7 @@ const useCheckoutButton = () => {
|
|
|
105
105
|
const {
|
|
106
106
|
isValidating,
|
|
107
107
|
id
|
|
108
|
-
} = (0,
|
|
108
|
+
} = (0,cart/* useCart */.jD)();
|
|
109
109
|
|
|
110
110
|
const onClick = e => {
|
|
111
111
|
e.preventDefault();
|
|
@@ -156,8 +156,8 @@ const GiftContent = (0,external_react_.forwardRef)(function GiftContent({ price,
|
|
|
156
156
|
});
|
|
157
157
|
/* harmony default export */ const Gift_GiftContent = (GiftContent);
|
|
158
158
|
//# sourceMappingURL=GiftContent.js.map
|
|
159
|
-
// EXTERNAL MODULE: ./src/components/ui/Image/
|
|
160
|
-
var Image = __webpack_require__(
|
|
159
|
+
// EXTERNAL MODULE: ./src/components/ui/Image/Image.tsx + 1 modules
|
|
160
|
+
var Image = __webpack_require__(5731);
|
|
161
161
|
// EXTERNAL MODULE: ./src/sdk/product/useFormattedPrice.ts
|
|
162
162
|
var useFormattedPrice = __webpack_require__(5346);
|
|
163
163
|
// EXTERNAL MODULE: external "react/jsx-runtime"
|
|
@@ -195,7 +195,7 @@ function Gift_Gift_Gift(_ref) {
|
|
|
195
195
|
})
|
|
196
196
|
}, otherProps), {}, {
|
|
197
197
|
children: [/*#__PURE__*/jsx_runtime_.jsx(Gift_GiftImage, {
|
|
198
|
-
children: /*#__PURE__*/jsx_runtime_.jsx(Image/*
|
|
198
|
+
children: /*#__PURE__*/jsx_runtime_.jsx(Image/* default */.Z, {
|
|
199
199
|
src: item.itemOffered.image[0].url,
|
|
200
200
|
alt: item.itemOffered.image[0].alternateName,
|
|
201
201
|
width: 89,
|
|
@@ -213,8 +213,6 @@ function Gift_Gift_Gift(_ref) {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
/* harmony default export */ const ui_Gift_Gift = (Gift_Gift_Gift);
|
|
216
|
-
;// CONCATENATED MODULE: ./src/components/ui/Gift/index.ts
|
|
217
|
-
|
|
218
216
|
// EXTERNAL MODULE: ../components/dist/esm/molecules/IconButton/IconButton.js
|
|
219
217
|
var IconButton = __webpack_require__(7041);
|
|
220
218
|
// EXTERNAL MODULE: ../components/dist/esm/molecules/QuantitySelector/QuantitySelector.js
|
|
@@ -292,7 +290,7 @@ const useRemoveButton = item => {
|
|
|
292
290
|
}]
|
|
293
291
|
}
|
|
294
292
|
});
|
|
295
|
-
|
|
293
|
+
cart/* cartStore.removeItem */.i8.removeItem(item.id);
|
|
296
294
|
}, [code, item]);
|
|
297
295
|
return {
|
|
298
296
|
onClick,
|
|
@@ -356,7 +354,7 @@ function CartItem_CartItem_CartItem({
|
|
|
356
354
|
} = useCartItemEvent();
|
|
357
355
|
const onQuantityChange = (0,external_react_.useCallback)(quantity => {
|
|
358
356
|
sendCartItemEvent(item, quantity);
|
|
359
|
-
|
|
357
|
+
cart/* cartStore.updateItemQuantity */.i8.updateItemQuantity(item.id, quantity);
|
|
360
358
|
}, [item, sendCartItemEvent]);
|
|
361
359
|
const skuActiveVariants = item.itemOffered.isVariantOf.skuVariants.activeVariations;
|
|
362
360
|
const activeVariations = Object.keys(skuActiveVariants).map(key => ({
|
|
@@ -375,7 +373,7 @@ function CartItem_CartItem_CartItem({
|
|
|
375
373
|
"data-sku": item.itemOffered.sku,
|
|
376
374
|
"data-seller": item.seller.identifier,
|
|
377
375
|
children: [/*#__PURE__*/jsx_runtime_.jsx(CartItem_CartItemImage, {
|
|
378
|
-
children: /*#__PURE__*/jsx_runtime_.jsx(Image/*
|
|
376
|
+
children: /*#__PURE__*/jsx_runtime_.jsx(Image/* default */.Z, {
|
|
379
377
|
src: item.itemOffered.image[0].url,
|
|
380
378
|
alt: item.itemOffered.image[0].alternateName,
|
|
381
379
|
width: 56,
|
|
@@ -389,8 +387,6 @@ function CartItem_CartItem_CartItem({
|
|
|
389
387
|
}
|
|
390
388
|
|
|
391
389
|
/* harmony default export */ const cart_CartItem_CartItem = (CartItem_CartItem_CartItem);
|
|
392
|
-
;// CONCATENATED MODULE: ./src/components/cart/CartItem/index.ts
|
|
393
|
-
|
|
394
390
|
// EXTERNAL MODULE: ../components/dist/esm/organisms/EmptyState/EmptyState.js
|
|
395
391
|
var EmptyState = __webpack_require__(6133);
|
|
396
392
|
;// CONCATENATED MODULE: ./src/components/cart/EmptyCart/EmptyCart.tsx
|
|
@@ -417,8 +413,6 @@ function EmptyCart({
|
|
|
417
413
|
}
|
|
418
414
|
|
|
419
415
|
/* harmony default export */ const EmptyCart_EmptyCart = (EmptyCart);
|
|
420
|
-
;// CONCATENATED MODULE: ./src/components/cart/EmptyCart/index.ts
|
|
421
|
-
|
|
422
416
|
;// CONCATENATED MODULE: ../components/dist/esm/molecules/OrderSummary/OrderSummary.js
|
|
423
417
|
|
|
424
418
|
|
|
@@ -462,8 +456,6 @@ function OrderSummary_OrderSummary_OrderSummary({
|
|
|
462
456
|
}
|
|
463
457
|
|
|
464
458
|
/* harmony default export */ const cart_OrderSummary_OrderSummary = (OrderSummary_OrderSummary_OrderSummary);
|
|
465
|
-
;// CONCATENATED MODULE: ./src/components/cart/OrderSummary/index.ts
|
|
466
|
-
|
|
467
459
|
// EXTERNAL MODULE: ./src/components/cart/CartSidebar/section.module.scss
|
|
468
460
|
var section_module = __webpack_require__(212);
|
|
469
461
|
var section_module_default = /*#__PURE__*/__webpack_require__.n(section_module);
|
|
@@ -490,6 +482,43 @@ function CartSidebar_defineProperty(obj, key, value) { if (key in obj) { Object.
|
|
|
490
482
|
|
|
491
483
|
|
|
492
484
|
|
|
485
|
+
function useViewCartEvent() {
|
|
486
|
+
const {
|
|
487
|
+
currency: {
|
|
488
|
+
code
|
|
489
|
+
}
|
|
490
|
+
} = (0,session/* useSession */.kP)();
|
|
491
|
+
const {
|
|
492
|
+
items,
|
|
493
|
+
gifts,
|
|
494
|
+
total
|
|
495
|
+
} = (0,cart/* useCart */.jD)();
|
|
496
|
+
const sendViewCartEvent = (0,external_react_.useCallback)(() => {
|
|
497
|
+
return (0,sendAnalyticsEvent/* sendAnalyticsEvent */._)({
|
|
498
|
+
name: 'view_cart',
|
|
499
|
+
params: {
|
|
500
|
+
currency: code,
|
|
501
|
+
value: total,
|
|
502
|
+
items: items.concat(gifts).map(item => ({
|
|
503
|
+
item_id: item.itemOffered.isVariantOf.productGroupID,
|
|
504
|
+
item_name: item.itemOffered.isVariantOf.name,
|
|
505
|
+
item_brand: item.itemOffered.brand.name,
|
|
506
|
+
item_variant: item.itemOffered.sku,
|
|
507
|
+
quantity: item.quantity,
|
|
508
|
+
price: item.price,
|
|
509
|
+
discount: item.listPrice - item.price,
|
|
510
|
+
currency: code,
|
|
511
|
+
item_variant_name: item.itemOffered.name,
|
|
512
|
+
product_reference_id: item.itemOffered.gtin
|
|
513
|
+
}))
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
}, [code, gifts, items, total]);
|
|
517
|
+
return (0,external_react_.useMemo)(() => ({
|
|
518
|
+
sendViewCartEvent
|
|
519
|
+
}), [sendViewCartEvent]);
|
|
520
|
+
}
|
|
521
|
+
|
|
493
522
|
function CartSidebar_CartSidebar_CartSidebar({
|
|
494
523
|
title,
|
|
495
524
|
alert: {
|
|
@@ -508,11 +537,15 @@ function CartSidebar_CartSidebar_CartSidebar({
|
|
|
508
537
|
}
|
|
509
538
|
}
|
|
510
539
|
}) {
|
|
511
|
-
const {
|
|
512
|
-
currency
|
|
513
|
-
} = (0,session/* useSession */.kP)();
|
|
514
540
|
const btnProps = useCheckoutButton();
|
|
515
|
-
const
|
|
541
|
+
const {
|
|
542
|
+
items,
|
|
543
|
+
gifts,
|
|
544
|
+
totalItems,
|
|
545
|
+
isValidating,
|
|
546
|
+
subTotal,
|
|
547
|
+
total
|
|
548
|
+
} = (0,cart/* useCart */.jD)();
|
|
516
549
|
const {
|
|
517
550
|
cart: displayCart,
|
|
518
551
|
closeCart
|
|
@@ -521,35 +554,16 @@ function CartSidebar_CartSidebar_CartSidebar({
|
|
|
521
554
|
fadeOut
|
|
522
555
|
} = (0,useFadeEffect/* useFadeEffect */.b)();
|
|
523
556
|
const {
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
isValidating,
|
|
528
|
-
subTotal,
|
|
529
|
-
total
|
|
530
|
-
} = cart;
|
|
531
|
-
const isEmpty = items.length === 0;
|
|
557
|
+
sendViewCartEvent
|
|
558
|
+
} = useViewCartEvent();
|
|
559
|
+
const isEmpty = (0,external_react_.useMemo)(() => items.length === 0, [items]);
|
|
532
560
|
(0,external_react_.useEffect)(() => {
|
|
533
|
-
(
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
item_id: item.itemOffered.isVariantOf.productGroupID,
|
|
540
|
-
item_name: item.itemOffered.isVariantOf.name,
|
|
541
|
-
item_brand: item.itemOffered.brand.name,
|
|
542
|
-
item_variant: item.itemOffered.sku,
|
|
543
|
-
quantity: item.quantity,
|
|
544
|
-
price: item.price,
|
|
545
|
-
discount: item.listPrice - item.price,
|
|
546
|
-
currency: currency.code,
|
|
547
|
-
item_variant_name: item.itemOffered.name,
|
|
548
|
-
product_reference_id: item.itemOffered.gtin
|
|
549
|
-
}))
|
|
550
|
-
}
|
|
551
|
-
}); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
552
|
-
}, []);
|
|
561
|
+
if (!displayCart) {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
sendViewCartEvent();
|
|
566
|
+
}, [displayCart, sendViewCartEvent]);
|
|
553
567
|
return /*#__PURE__*/jsx_runtime_.jsx(jsx_runtime_.Fragment, {
|
|
554
568
|
children: displayCart && /*#__PURE__*/jsx_runtime_.jsx(external_react_.Suspense, {
|
|
555
569
|
fallback: null,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
exports.id =
|
|
2
|
-
exports.ids = [
|
|
1
|
+
exports.id = 692;
|
|
2
|
+
exports.ids = [692];
|
|
3
3
|
exports.modules = {
|
|
4
4
|
|
|
5
5
|
/***/ 6133:
|
|
@@ -24,18 +24,18 @@ function EmptyState({ testId = 'fs-empty-state', title, titleIcon, variant = 'de
|
|
|
24
24
|
|
|
25
25
|
/***/ }),
|
|
26
26
|
|
|
27
|
-
/***/
|
|
27
|
+
/***/ 7692:
|
|
28
28
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
29
29
|
|
|
30
30
|
"use strict";
|
|
31
31
|
|
|
32
32
|
// EXPORTS
|
|
33
33
|
__webpack_require__.d(__webpack_exports__, {
|
|
34
|
-
"Z": () => (/*
|
|
34
|
+
"Z": () => (/* binding */ sections_EmptyState_EmptyState)
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
// EXTERNAL MODULE: ./src/components/sections/Section/
|
|
38
|
-
var Section = __webpack_require__(
|
|
37
|
+
// EXTERNAL MODULE: ./src/components/sections/Section/Section.tsx
|
|
38
|
+
var Section = __webpack_require__(3271);
|
|
39
39
|
// EXTERNAL MODULE: ./src/components/sections/EmptyState/section.module.scss
|
|
40
40
|
var section_module = __webpack_require__(6791);
|
|
41
41
|
var section_module_default = /*#__PURE__*/__webpack_require__.n(section_module);
|
|
@@ -92,8 +92,6 @@ function EmptyState_EmptyState({
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
/* harmony default export */ const sections_EmptyState_EmptyState = (EmptyState_EmptyState);
|
|
95
|
-
;// CONCATENATED MODULE: ./src/components/sections/EmptyState/index.ts
|
|
96
|
-
|
|
97
95
|
|
|
98
96
|
/***/ }),
|
|
99
97
|
|