@sentecacommerce-theme/lib 0.13.15 → 0.13.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/analytics/Releva/types.js +19 -20
- package/dist/cjs/analytics/pageView.js +4 -4
- package/dist/cjs/analytics/purchase.js +2 -2
- package/dist/cjs/components/AnalyticsScripts/index.js +3 -3
- package/dist/cjs/components/GoogleOneTap/index.js +3 -3
- package/dist/cjs/contexts/CheckoutForm/utils/validateBillingAddress.js +3 -8
- package/dist/cjs/listing/hooks/useListingBreadcrumbs.js +3 -3
- package/dist/esm/analytics/Releva/types.js +19 -20
- package/dist/esm/analytics/pageView.js +4 -4
- package/dist/esm/analytics/purchase.js +2 -2
- package/dist/esm/components/AnalyticsScripts/index.js +3 -3
- package/dist/esm/components/GoogleOneTap/index.js +3 -3
- package/dist/esm/contexts/CheckoutForm/utils/validateBillingAddress.js +3 -8
- package/dist/esm/listing/hooks/useListingBreadcrumbs.js +3 -3
- package/dist/types/analytics/Releva/types.d.ts +19 -19
- package/dist/types/types/index.d.ts +2 -2
- package/package.json +4 -4
@@ -2,27 +2,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
2
2
|
value: true
|
3
3
|
});
|
4
4
|
exports.relevaCookie = exports.GenericActionTypesEnum = exports.PageTypeMap = void 0;
|
5
|
-
var PageTypeMap
|
5
|
+
var PageTypeMap = {
|
6
|
+
'/': 'Home page',
|
7
|
+
'/[slug]/p': 'Product page',
|
8
|
+
'/[slug]/c': 'Category page',
|
9
|
+
'/[slug]/[cat]/c': 'Category page',
|
10
|
+
'/[slug]/b': 'Brand page',
|
11
|
+
'/[slug]/[cat]/b': 'Brand page',
|
12
|
+
'/[slug]/v': 'View page',
|
13
|
+
'/[slug]/ct': 'Collection page',
|
14
|
+
'/search': 'Search page',
|
15
|
+
'/profile/[[...tab]]': 'Profile page',
|
16
|
+
'/favorites': 'Wishlist page',
|
17
|
+
'/basket': 'Cart page',
|
18
|
+
'/checkout': 'Checkout page',
|
19
|
+
'/order/[orderId]': 'Order Complete page',
|
20
|
+
'/stores': 'Stores page',
|
21
|
+
'/vouchers': 'Vouchers page',
|
22
|
+
'/login': 'Login/Register page'
|
23
|
+
};
|
6
24
|
exports.PageTypeMap = PageTypeMap;
|
7
|
-
(function(PageTypeMap) {
|
8
|
-
PageTypeMap['/'] = '/';
|
9
|
-
PageTypeMap['/[slug]/p'] = '/[slug]/p';
|
10
|
-
PageTypeMap['/[slug]/c'] = '/[slug]/c';
|
11
|
-
PageTypeMap['/[slug]/[cat]/c'] = '/[slug]/[cat]/c';
|
12
|
-
PageTypeMap['/[slug]/b'] = '/[slug]/b';
|
13
|
-
PageTypeMap['/[slug]/[cat]/b'] = '/[slug]/[cat]/b';
|
14
|
-
PageTypeMap['/[slug]/v'] = '/[slug]/v';
|
15
|
-
PageTypeMap['/[slug]/ct'] = '/[slug]/ct';
|
16
|
-
PageTypeMap['/search'] = '/search';
|
17
|
-
PageTypeMap['/profile/[[...tab]]'] = '/profile/[[...tab]]';
|
18
|
-
PageTypeMap['/favorites'] = '/favorites';
|
19
|
-
PageTypeMap['/basket'] = '/basket';
|
20
|
-
PageTypeMap['/checkout'] = '/checkout';
|
21
|
-
PageTypeMap['/order/[orderId]'] = '/order/[orderId]';
|
22
|
-
PageTypeMap['/stores'] = '/stores';
|
23
|
-
PageTypeMap['/vouchers'] = '/vouchers';
|
24
|
-
PageTypeMap['/login'] = '/login';
|
25
|
-
})(PageTypeMap || (exports.PageTypeMap = PageTypeMap = {}));
|
26
25
|
var GenericActionTypesEnum;
|
27
26
|
exports.GenericActionTypesEnum = GenericActionTypesEnum;
|
28
27
|
(function(GenericActionTypesEnum) {
|
@@ -7,8 +7,8 @@ var usePageView = function() {
|
|
7
7
|
var config = (0, _useConfig).useConfigState();
|
8
8
|
return function(url, title) {
|
9
9
|
var ref, ref1;
|
10
|
-
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
11
|
-
(ref1 = window.gtag) === null || ref1 === void 0 ? void 0 : ref1.call(window, 'config', config.google.
|
10
|
+
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.analytics)) return;
|
11
|
+
(ref1 = window.gtag) === null || ref1 === void 0 ? void 0 : ref1.call(window, 'config', config.google.analytics, {
|
12
12
|
page_path: url,
|
13
13
|
page_title: title
|
14
14
|
});
|
@@ -18,8 +18,8 @@ exports.usePageView = usePageView;
|
|
18
18
|
var getPageView = function(config) {
|
19
19
|
return function(url, title) {
|
20
20
|
var ref, ref2, ref3;
|
21
|
-
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
22
|
-
(ref3 = window.gtag) === null || ref3 === void 0 ? void 0 : ref3.call(window, 'config', (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.
|
21
|
+
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.analytics)) return;
|
22
|
+
(ref3 = window.gtag) === null || ref3 === void 0 ? void 0 : ref3.call(window, 'config', (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.analytics, {
|
23
23
|
page_path: url,
|
24
24
|
page_title: title
|
25
25
|
});
|
@@ -13,7 +13,7 @@ var purchase = function(order, config) {
|
|
13
13
|
var hasGoogleReMarketing = Boolean(((ref4 = config.google) === null || ref4 === void 0 ? void 0 : (ref5 = ref4.reMarketing) === null || ref5 === void 0 ? void 0 : ref5.id) && ((ref6 = config.google) === null || ref6 === void 0 ? void 0 : (ref7 = ref6.reMarketing) === null || ref7 === void 0 ? void 0 : ref7.label));
|
14
14
|
var facebookPixelLoaded = Boolean(window.fbq);
|
15
15
|
var isGtagLoaded = Boolean(window.gtag);
|
16
|
-
var hasGoogleId = Boolean((ref8 = config.google) === null || ref8 === void 0 ? void 0 : ref8.
|
16
|
+
var hasGoogleId = Boolean((ref8 = config.google) === null || ref8 === void 0 ? void 0 : ref8.analytics);
|
17
17
|
if (isGtagLoaded && hasGoogleId) {
|
18
18
|
var ref9, ref10, ref11;
|
19
19
|
var items = ((ref9 = order.lineItems) === null || ref9 === void 0 ? void 0 : ref9.map(function(item, i) {
|
@@ -28,7 +28,7 @@ var purchase = function(order, config) {
|
|
28
28
|
})) || [];
|
29
29
|
(ref11 = window.gtag) === null || ref11 === void 0 ? void 0 : ref11.call(window, 'event', 'purchase', {
|
30
30
|
transaction_id: order._id,
|
31
|
-
send_to: (ref10 = config.google) === null || ref10 === void 0 ? void 0 : ref10.
|
31
|
+
send_to: (ref10 = config.google) === null || ref10 === void 0 ? void 0 : ref10.analytics,
|
32
32
|
affiliation: config.defaultMerchant,
|
33
33
|
value: (0, _decodePrice).decodePrice(order.grandTotalPrice),
|
34
34
|
currency: order.currencyCode,
|
@@ -87,18 +87,18 @@ function AnalyticsScripts() {
|
|
87
87
|
var router = (0, _router).useRouter();
|
88
88
|
var config = (0, _useConfig).useConfigState();
|
89
89
|
var ref5 = _slicedToArray((0, _react).useState(null), 2), scripts = ref5[0], setScripts = ref5[1];
|
90
|
-
var hasGoogleId = Boolean((ref11 = config.google) === null || ref11 === void 0 ? void 0 : ref11.
|
90
|
+
var hasGoogleId = Boolean((ref11 = config.google) === null || ref11 === void 0 ? void 0 : ref11.analytics);
|
91
91
|
var hasGoogleReMarketing = Boolean(((ref1 = config.google) === null || ref1 === void 0 ? void 0 : (ref2 = ref1.reMarketing) === null || ref2 === void 0 ? void 0 : ref2.id) && ((ref3 = config.google) === null || ref3 === void 0 ? void 0 : (ref4 = ref3.reMarketing) === null || ref4 === void 0 ? void 0 : ref4.label));
|
92
92
|
var initAnalytics = function() {
|
93
93
|
var ref, ref6, ref7, ref8, ref9, ref10;
|
94
94
|
return setScripts({
|
95
95
|
gtag: hasGoogleId ? /*#__PURE__*/ _react.default.createElement("script", {
|
96
96
|
async: true,
|
97
|
-
src: "https://www.googletagmanager.com/gtag/js?id=".concat((ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
97
|
+
src: "https://www.googletagmanager.com/gtag/js?id=".concat((ref = config.google) === null || ref === void 0 ? void 0 : ref.analytics)
|
98
98
|
}) : null,
|
99
99
|
gtm: hasGoogleId ? /*#__PURE__*/ _react.default.createElement("script", {
|
100
100
|
dangerouslySetInnerHTML: {
|
101
|
-
__html: "\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat((ref6 = config.google) === null || ref6 === void 0 ? void 0 : ref6.
|
101
|
+
__html: "\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat((ref6 = config.google) === null || ref6 === void 0 ? void 0 : ref6.analytics, "', {\n page_path: window.location.pathname,\n });\n ").concat(hasGoogleReMarketing ? "gtag('config', '".concat((ref7 = config.google) === null || ref7 === void 0 ? void 0 : (ref8 = ref7.reMarketing) === null || ref8 === void 0 ? void 0 : ref8.id, "')") : '', "\n ")
|
102
102
|
}
|
103
103
|
}) : null,
|
104
104
|
pixel: ((ref9 = config.facebook) === null || ref9 === void 0 ? void 0 : ref9.pixelId) ? /*#__PURE__*/ _react.default.createElement("script", {
|
@@ -119,11 +119,11 @@ var GoogleOneTap = function(param) {
|
|
119
119
|
var ref;
|
120
120
|
var token = _jsCookie.default.get(_tokens.AUTH_TOKEN_KEY);
|
121
121
|
// Google one tap
|
122
|
-
if (typeof google === 'undefined' || !(config === null || config === void 0 ? void 0 : (ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
122
|
+
if (typeof google === 'undefined' || !(config === null || config === void 0 ? void 0 : (ref = config.google) === null || ref === void 0 ? void 0 : ref.oneTapId)) return;
|
123
123
|
if (!token) {
|
124
124
|
var ref2;
|
125
125
|
google.accounts.id.initialize({
|
126
|
-
client_id: config === null || config === void 0 ? void 0 : (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.
|
126
|
+
client_id: config === null || config === void 0 ? void 0 : (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.oneTapId,
|
127
127
|
callback: function() {
|
128
128
|
var _ref = _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee(response) {
|
129
129
|
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
@@ -157,7 +157,7 @@ var GoogleOneTap = function(param) {
|
|
157
157
|
google.accounts.id.cancel();
|
158
158
|
}
|
159
159
|
}, [
|
160
|
-
config === null || config === void 0 ? void 0 : (ref3 = config.google) === null || ref3 === void 0 ? void 0 : ref3.
|
160
|
+
config === null || config === void 0 ? void 0 : (ref3 = config.google) === null || ref3 === void 0 ? void 0 : ref3.oneTapId,
|
161
161
|
login,
|
162
162
|
autoSignIn
|
163
163
|
]);
|
@@ -30,11 +30,6 @@ function _objectSpread(target) {
|
|
30
30
|
}
|
31
31
|
return target;
|
32
32
|
}
|
33
|
-
var requiredFields = [
|
34
|
-
'city',
|
35
|
-
'postalCode',
|
36
|
-
'streetName'
|
37
|
-
];
|
38
33
|
function genericBillingAddressValidation(data, errorLabels, requiredCompanyFields) {
|
39
34
|
var isWithInvoice = Boolean(data.company);
|
40
35
|
if (!isWithInvoice) return null;
|
@@ -45,9 +40,9 @@ function genericBillingAddressValidation(data, errorLabels, requiredCompanyField
|
|
45
40
|
}
|
46
41
|
return errors;
|
47
42
|
}, {});
|
48
|
-
var fieldErrors =
|
49
|
-
var ref;
|
50
|
-
if (!((ref = data[field]) === null ||
|
43
|
+
var fieldErrors = requiredCompanyFields.reduce(function(errors, field) {
|
44
|
+
var ref, ref2;
|
45
|
+
if (!(data === null || data === void 0 ? void 0 : (ref = data.company) === null || ref === void 0 ? void 0 : (ref2 = ref[field]) === null || ref2 === void 0 ? void 0 : ref2.trim())) {
|
51
46
|
return _objectSpread({}, errors, _defineProperty({}, field, errorLabels.fieldIsRequired));
|
52
47
|
}
|
53
48
|
return errors;
|
@@ -70,12 +70,12 @@ var useListingBreadcrumbs = function() {
|
|
70
70
|
];
|
71
71
|
}
|
72
72
|
var breadcrumbData = createCatalogBreadcrumb(data, config.type, router);
|
73
|
-
if (config.type === _.ListingTypesEnum.View || config.type === _.ListingTypesEnum.Brand) {
|
73
|
+
if ((config.type === _.ListingTypesEnum.View || config.type === _.ListingTypesEnum.Brand) && categoryName) {
|
74
74
|
var ref2;
|
75
75
|
breadcrumbData.push({
|
76
|
-
name: categoryName
|
76
|
+
name: categoryName,
|
77
77
|
id: categoryId,
|
78
|
-
link: processLink((ref2 = data) === null || ref2 === void 0 ? void 0 : ref2.slug, config.type,
|
78
|
+
link: processLink((ref2 = data) === null || ref2 === void 0 ? void 0 : ref2.slug, config.type, '') + applyFilters(router)
|
79
79
|
});
|
80
80
|
}
|
81
81
|
return breadcrumbData;
|
@@ -1,23 +1,22 @@
|
|
1
|
-
export var PageTypeMap
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
})(PageTypeMap || (PageTypeMap = {}));
|
1
|
+
export var PageTypeMap = {
|
2
|
+
'/': 'Home page',
|
3
|
+
'/[slug]/p': 'Product page',
|
4
|
+
'/[slug]/c': 'Category page',
|
5
|
+
'/[slug]/[cat]/c': 'Category page',
|
6
|
+
'/[slug]/b': 'Brand page',
|
7
|
+
'/[slug]/[cat]/b': 'Brand page',
|
8
|
+
'/[slug]/v': 'View page',
|
9
|
+
'/[slug]/ct': 'Collection page',
|
10
|
+
'/search': 'Search page',
|
11
|
+
'/profile/[[...tab]]': 'Profile page',
|
12
|
+
'/favorites': 'Wishlist page',
|
13
|
+
'/basket': 'Cart page',
|
14
|
+
'/checkout': 'Checkout page',
|
15
|
+
'/order/[orderId]': 'Order Complete page',
|
16
|
+
'/stores': 'Stores page',
|
17
|
+
'/vouchers': 'Vouchers page',
|
18
|
+
'/login': 'Login/Register page'
|
19
|
+
};
|
21
20
|
export var GenericActionTypesEnum;
|
22
21
|
(function(GenericActionTypesEnum) {
|
23
22
|
GenericActionTypesEnum["changeBasket"] = "changeBasket";
|
@@ -3,8 +3,8 @@ export var usePageView = function() {
|
|
3
3
|
var config = useConfigState();
|
4
4
|
return function(url, title) {
|
5
5
|
var ref, ref1;
|
6
|
-
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
7
|
-
(ref1 = window.gtag) === null || ref1 === void 0 ? void 0 : ref1.call(window, 'config', config.google.
|
6
|
+
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.analytics)) return;
|
7
|
+
(ref1 = window.gtag) === null || ref1 === void 0 ? void 0 : ref1.call(window, 'config', config.google.analytics, {
|
8
8
|
page_path: url,
|
9
9
|
page_title: title
|
10
10
|
});
|
@@ -13,8 +13,8 @@ export var usePageView = function() {
|
|
13
13
|
export var getPageView = function(config) {
|
14
14
|
return function(url, title) {
|
15
15
|
var ref, ref2, ref3;
|
16
|
-
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
17
|
-
(ref3 = window.gtag) === null || ref3 === void 0 ? void 0 : ref3.call(window, 'config', (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.
|
16
|
+
if (!((ref = config.google) === null || ref === void 0 ? void 0 : ref.analytics)) return;
|
17
|
+
(ref3 = window.gtag) === null || ref3 === void 0 ? void 0 : ref3.call(window, 'config', (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.analytics, {
|
18
18
|
page_path: url,
|
19
19
|
page_title: title
|
20
20
|
});
|
@@ -9,7 +9,7 @@ export var purchase = function(order, config) {
|
|
9
9
|
var hasGoogleReMarketing = Boolean(((ref4 = config.google) === null || ref4 === void 0 ? void 0 : (ref5 = ref4.reMarketing) === null || ref5 === void 0 ? void 0 : ref5.id) && ((ref6 = config.google) === null || ref6 === void 0 ? void 0 : (ref7 = ref6.reMarketing) === null || ref7 === void 0 ? void 0 : ref7.label));
|
10
10
|
var facebookPixelLoaded = Boolean(window.fbq);
|
11
11
|
var isGtagLoaded = Boolean(window.gtag);
|
12
|
-
var hasGoogleId = Boolean((ref8 = config.google) === null || ref8 === void 0 ? void 0 : ref8.
|
12
|
+
var hasGoogleId = Boolean((ref8 = config.google) === null || ref8 === void 0 ? void 0 : ref8.analytics);
|
13
13
|
if (isGtagLoaded && hasGoogleId) {
|
14
14
|
var ref9, ref10, ref11;
|
15
15
|
var items = ((ref9 = order.lineItems) === null || ref9 === void 0 ? void 0 : ref9.map(function(item, i) {
|
@@ -24,7 +24,7 @@ export var purchase = function(order, config) {
|
|
24
24
|
})) || [];
|
25
25
|
(ref11 = window.gtag) === null || ref11 === void 0 ? void 0 : ref11.call(window, 'event', 'purchase', {
|
26
26
|
transaction_id: order._id,
|
27
|
-
send_to: (ref10 = config.google) === null || ref10 === void 0 ? void 0 : ref10.
|
27
|
+
send_to: (ref10 = config.google) === null || ref10 === void 0 ? void 0 : ref10.analytics,
|
28
28
|
affiliation: config.defaultMerchant,
|
29
29
|
value: decodePrice(order.grandTotalPrice),
|
30
30
|
currency: order.currencyCode,
|
@@ -57,18 +57,18 @@ export function AnalyticsScripts() {
|
|
57
57
|
var router = useRouter();
|
58
58
|
var config = useConfigState();
|
59
59
|
var ref5 = _slicedToArray(useState(null), 2), scripts = ref5[0], setScripts = ref5[1];
|
60
|
-
var hasGoogleId = Boolean((ref11 = config.google) === null || ref11 === void 0 ? void 0 : ref11.
|
60
|
+
var hasGoogleId = Boolean((ref11 = config.google) === null || ref11 === void 0 ? void 0 : ref11.analytics);
|
61
61
|
var hasGoogleReMarketing = Boolean(((ref1 = config.google) === null || ref1 === void 0 ? void 0 : (ref2 = ref1.reMarketing) === null || ref2 === void 0 ? void 0 : ref2.id) && ((ref3 = config.google) === null || ref3 === void 0 ? void 0 : (ref4 = ref3.reMarketing) === null || ref4 === void 0 ? void 0 : ref4.label));
|
62
62
|
var initAnalytics = function() {
|
63
63
|
var ref, ref6, ref7, ref8, ref9, ref10;
|
64
64
|
return setScripts({
|
65
65
|
gtag: hasGoogleId ? /*#__PURE__*/ React.createElement("script", {
|
66
66
|
async: true,
|
67
|
-
src: "https://www.googletagmanager.com/gtag/js?id=".concat((ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
67
|
+
src: "https://www.googletagmanager.com/gtag/js?id=".concat((ref = config.google) === null || ref === void 0 ? void 0 : ref.analytics)
|
68
68
|
}) : null,
|
69
69
|
gtm: hasGoogleId ? /*#__PURE__*/ React.createElement("script", {
|
70
70
|
dangerouslySetInnerHTML: {
|
71
|
-
__html: "\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat((ref6 = config.google) === null || ref6 === void 0 ? void 0 : ref6.
|
71
|
+
__html: "\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat((ref6 = config.google) === null || ref6 === void 0 ? void 0 : ref6.analytics, "', {\n page_path: window.location.pathname,\n });\n ").concat(hasGoogleReMarketing ? "gtag('config', '".concat((ref7 = config.google) === null || ref7 === void 0 ? void 0 : (ref8 = ref7.reMarketing) === null || ref8 === void 0 ? void 0 : ref8.id, "')") : '', "\n ")
|
72
72
|
}
|
73
73
|
}) : null,
|
74
74
|
pixel: ((ref9 = config.facebook) === null || ref9 === void 0 ? void 0 : ref9.pixelId) ? /*#__PURE__*/ React.createElement("script", {
|
@@ -89,11 +89,11 @@ export var GoogleOneTap = function(param) {
|
|
89
89
|
var ref;
|
90
90
|
var token = Cookies.get(AUTH_TOKEN_KEY);
|
91
91
|
// Google one tap
|
92
|
-
if (typeof google === 'undefined' || !(config === null || config === void 0 ? void 0 : (ref = config.google) === null || ref === void 0 ? void 0 : ref.
|
92
|
+
if (typeof google === 'undefined' || !(config === null || config === void 0 ? void 0 : (ref = config.google) === null || ref === void 0 ? void 0 : ref.oneTapId)) return;
|
93
93
|
if (!token) {
|
94
94
|
var ref2;
|
95
95
|
google.accounts.id.initialize({
|
96
|
-
client_id: config === null || config === void 0 ? void 0 : (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.
|
96
|
+
client_id: config === null || config === void 0 ? void 0 : (ref2 = config.google) === null || ref2 === void 0 ? void 0 : ref2.oneTapId,
|
97
97
|
callback: function() {
|
98
98
|
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(response) {
|
99
99
|
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
@@ -127,7 +127,7 @@ export var GoogleOneTap = function(param) {
|
|
127
127
|
google.accounts.id.cancel();
|
128
128
|
}
|
129
129
|
}, [
|
130
|
-
config === null || config === void 0 ? void 0 : (ref3 = config.google) === null || ref3 === void 0 ? void 0 : ref3.
|
130
|
+
config === null || config === void 0 ? void 0 : (ref3 = config.google) === null || ref3 === void 0 ? void 0 : ref3.oneTapId,
|
131
131
|
login,
|
132
132
|
autoSignIn
|
133
133
|
]);
|
@@ -26,11 +26,6 @@ function _objectSpread(target) {
|
|
26
26
|
}
|
27
27
|
return target;
|
28
28
|
}
|
29
|
-
var requiredFields = [
|
30
|
-
'city',
|
31
|
-
'postalCode',
|
32
|
-
'streetName'
|
33
|
-
];
|
34
29
|
export function genericBillingAddressValidation(data, errorLabels, requiredCompanyFields) {
|
35
30
|
var isWithInvoice = Boolean(data.company);
|
36
31
|
if (!isWithInvoice) return null;
|
@@ -41,9 +36,9 @@ export function genericBillingAddressValidation(data, errorLabels, requiredCompa
|
|
41
36
|
}
|
42
37
|
return errors;
|
43
38
|
}, {});
|
44
|
-
var fieldErrors =
|
45
|
-
var ref;
|
46
|
-
if (!((ref = data[field]) === null ||
|
39
|
+
var fieldErrors = requiredCompanyFields.reduce(function(errors, field) {
|
40
|
+
var ref, ref2;
|
41
|
+
if (!(data === null || data === void 0 ? void 0 : (ref = data.company) === null || ref === void 0 ? void 0 : (ref2 = ref[field]) === null || ref2 === void 0 ? void 0 : ref2.trim())) {
|
47
42
|
return _objectSpread({}, errors, _defineProperty({}, field, errorLabels.fieldIsRequired));
|
48
43
|
}
|
49
44
|
return errors;
|
@@ -61,12 +61,12 @@ export var useListingBreadcrumbs = function() {
|
|
61
61
|
];
|
62
62
|
}
|
63
63
|
var breadcrumbData = createCatalogBreadcrumb(data, config.type, router);
|
64
|
-
if (config.type === ListingTypesEnum.View || config.type === ListingTypesEnum.Brand) {
|
64
|
+
if ((config.type === ListingTypesEnum.View || config.type === ListingTypesEnum.Brand) && categoryName) {
|
65
65
|
var ref2;
|
66
66
|
breadcrumbData.push({
|
67
|
-
name: categoryName
|
67
|
+
name: categoryName,
|
68
68
|
id: categoryId,
|
69
|
-
link: processLink((ref2 = data) === null || ref2 === void 0 ? void 0 : ref2.slug, config.type,
|
69
|
+
link: processLink((ref2 = data) === null || ref2 === void 0 ? void 0 : ref2.slug, config.type, '') + applyFilters(router)
|
70
70
|
});
|
71
71
|
}
|
72
72
|
return breadcrumbData;
|
@@ -58,25 +58,25 @@ export declare type ListingDataType = {
|
|
58
58
|
items?: SearchResultDTO[];
|
59
59
|
activeFilters: FormattedAggregationResultType[];
|
60
60
|
};
|
61
|
-
export declare
|
62
|
-
'/'
|
63
|
-
'/[slug]/p'
|
64
|
-
'/[slug]/c'
|
65
|
-
'/[slug]/[cat]/c'
|
66
|
-
'/[slug]/b'
|
67
|
-
'/[slug]/[cat]/b'
|
68
|
-
'/[slug]/v'
|
69
|
-
'/[slug]/ct'
|
70
|
-
'/search'
|
71
|
-
'/profile/[[...tab]]'
|
72
|
-
'/favorites'
|
73
|
-
'/basket'
|
74
|
-
'/checkout'
|
75
|
-
'/order/[orderId]'
|
76
|
-
'/stores'
|
77
|
-
'/vouchers'
|
78
|
-
'/login'
|
79
|
-
}
|
61
|
+
export declare const PageTypeMap: {
|
62
|
+
'/': string;
|
63
|
+
'/[slug]/p': string;
|
64
|
+
'/[slug]/c': string;
|
65
|
+
'/[slug]/[cat]/c': string;
|
66
|
+
'/[slug]/b': string;
|
67
|
+
'/[slug]/[cat]/b': string;
|
68
|
+
'/[slug]/v': string;
|
69
|
+
'/[slug]/ct': string;
|
70
|
+
'/search': string;
|
71
|
+
'/profile/[[...tab]]': string;
|
72
|
+
'/favorites': string;
|
73
|
+
'/basket': string;
|
74
|
+
'/checkout': string;
|
75
|
+
'/order/[orderId]': string;
|
76
|
+
'/stores': string;
|
77
|
+
'/vouchers': string;
|
78
|
+
'/login': string;
|
79
|
+
};
|
80
80
|
export declare enum GenericActionTypesEnum {
|
81
81
|
changeBasket = "changeBasket",
|
82
82
|
changeProfileData = "changeProfileData",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { GroupField, NumberField, StringField } from
|
1
|
+
import { GroupField, NumberField, StringField } from '@sentecacommerce-theme/cms';
|
2
2
|
export interface DefaultConfig {
|
3
3
|
organizationPhone: StringField;
|
4
4
|
domain: StringField;
|
@@ -25,7 +25,7 @@ export interface DefaultConfig {
|
|
25
25
|
redirectURI: StringField;
|
26
26
|
}>;
|
27
27
|
google: GroupField<{
|
28
|
-
|
28
|
+
oneTapId: StringField;
|
29
29
|
analytics: StringField;
|
30
30
|
reMarketing: GroupField<{
|
31
31
|
id: StringField;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sentecacommerce-theme/lib",
|
3
3
|
"sideEffects": false,
|
4
|
-
"version": "0.13.
|
4
|
+
"version": "0.13.18",
|
5
5
|
"main": "dist/cjs/index.js",
|
6
6
|
"module": "dist/esm/index.js",
|
7
7
|
"types": "dist/types/index.d.ts",
|
@@ -31,13 +31,13 @@
|
|
31
31
|
"watch:cjs": "swc src --out-dir dist/cjs -w",
|
32
32
|
"watch:esm": "swc src --out-dir dist/esm --no-swcrc -w"
|
33
33
|
},
|
34
|
-
"gitHead": "
|
34
|
+
"gitHead": "d03d8560515b6806d5fa33ff85088cfd4012801a",
|
35
35
|
"peerDependencies": {
|
36
36
|
"react-query": "^2.26.2"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@sentecacommerce-theme/base": "^0.13.
|
40
|
-
"@sentecacommerce-theme/cms": "^0.13.
|
39
|
+
"@sentecacommerce-theme/base": "^0.13.18",
|
40
|
+
"@sentecacommerce-theme/cms": "^0.13.18",
|
41
41
|
"@sentecacommerce/sdk": "2.0.175",
|
42
42
|
"body-scroll-lock": "^3.1.5",
|
43
43
|
"copy-to-clipboard": "^3.3.1",
|