@sentecacommerce-theme/lib 0.13.10 → 0.13.13
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/Pixel/hooks/usePixelFinishOrder.js +6 -7
- package/dist/cjs/analytics/Pixel/hooks/usePixelViewBasket.js +2 -5
- package/dist/cjs/analytics/Pixel/hooks/usePixelViewCategory.js +2 -5
- package/dist/cjs/analytics/Pixel/usePixel.js +1 -5
- package/dist/cjs/analytics/Pixel/utils.js +1 -1
- package/dist/cjs/hooks/useProduct/index.js +8 -3
- package/dist/cjs/seo/components/ProductSEO/index.js +17 -1
- package/dist/cjs/seo/utils/handleRobots.js +6 -5
- package/dist/esm/analytics/Pixel/hooks/usePixelFinishOrder.js +6 -7
- package/dist/esm/analytics/Pixel/hooks/usePixelViewBasket.js +2 -5
- package/dist/esm/analytics/Pixel/hooks/usePixelViewCategory.js +2 -5
- package/dist/esm/analytics/Pixel/usePixel.js +1 -5
- package/dist/esm/analytics/Pixel/utils.js +1 -1
- package/dist/esm/hooks/useProduct/index.js +8 -3
- package/dist/esm/seo/components/ProductSEO/index.js +8 -2
- package/dist/esm/seo/utils/handleRobots.js +6 -5
- package/dist/types/analytics/Pixel/types.d.ts +2 -1
- package/dist/types/seo/components/ProductSEO/index.d.ts +0 -11
- package/package.json +4 -4
@@ -3,20 +3,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
});
|
4
4
|
exports.usePixelFinishOrder = void 0;
|
5
5
|
var _utils = require("../utils");
|
6
|
-
var
|
7
|
-
"@swc/helpers - typeof";
|
8
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
9
|
-
};
|
6
|
+
var _index = require("../../../index");
|
10
7
|
var usePixelFinishOrder = function() {
|
11
8
|
var sendFinishOrderEvent = function(order) {
|
9
|
+
var ref, ref1;
|
12
10
|
var payload = {
|
13
11
|
orderId: order.orderRefNumber,
|
14
|
-
productsData: (0, _utils).mapProducts(order.lineItems)
|
12
|
+
productsData: (0, _utils).mapProducts(order.lineItems),
|
13
|
+
orderPrice: (Number((ref = order.grandTotalPrice) === null || ref === void 0 ? void 0 : ref.centAmount) / Math.pow(10, Number((ref1 = order.grandTotalPrice) === null || ref1 === void 0 ? void 0 : ref1.fractionDigits))).toFixed(2)
|
15
14
|
};
|
16
|
-
if ((
|
15
|
+
if ((0, _index).canUseDOM()) {
|
17
16
|
var pixel = window.pixel;
|
18
17
|
if (payload) {
|
19
|
-
pixel === null || pixel === void 0 ? void 0 : pixel.finishOrder(payload);
|
18
|
+
pixel === null || pixel === void 0 ? void 0 : pixel.finishOrder(payload.orderId, payload.productsData, payload.orderPrice);
|
20
19
|
}
|
21
20
|
}
|
22
21
|
};
|
@@ -3,14 +3,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
});
|
4
4
|
exports.usePixelViewBasket = void 0;
|
5
5
|
var _utils = require("../utils");
|
6
|
-
var
|
7
|
-
"@swc/helpers - typeof";
|
8
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
9
|
-
};
|
6
|
+
var _index = require("../../../index");
|
10
7
|
var usePixelViewBasket = function() {
|
11
8
|
var sendViewBasketEvent = function(data) {
|
12
9
|
var payload = (0, _utils).mapProducts(data);
|
13
|
-
if ((
|
10
|
+
if ((0, _index).canUseDOM()) {
|
14
11
|
var pixel = window.pixel;
|
15
12
|
if (payload) {
|
16
13
|
pixel === null || pixel === void 0 ? void 0 : pixel.viewBasket(payload);
|
@@ -2,10 +2,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
2
2
|
value: true
|
3
3
|
});
|
4
4
|
exports.usePixelViewCategory = void 0;
|
5
|
-
var
|
6
|
-
"@swc/helpers - typeof";
|
7
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
8
|
-
};
|
5
|
+
var _index = require("../../../index");
|
9
6
|
var usePixelViewCategory = function() {
|
10
7
|
var sendViewCategoryEvent = function(breadcrumbData) {
|
11
8
|
var breadcrumbString = breadcrumbData.reduce(function(res, curr, index) {
|
@@ -15,7 +12,7 @@ var usePixelViewCategory = function() {
|
|
15
12
|
}
|
16
13
|
return res;
|
17
14
|
}, '');
|
18
|
-
if ((
|
15
|
+
if ((0, _index).canUseDOM()) {
|
19
16
|
var pixel = window.pixel;
|
20
17
|
if (breadcrumbString) {
|
21
18
|
pixel === null || pixel === void 0 ? void 0 : pixel.viewCategory(breadcrumbString);
|
@@ -12,12 +12,8 @@ function _interopRequireDefault(obj) {
|
|
12
12
|
default: obj
|
13
13
|
};
|
14
14
|
}
|
15
|
-
var _typeof = function(obj) {
|
16
|
-
"@swc/helpers - typeof";
|
17
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
18
|
-
};
|
19
15
|
var pixelChangeRoute = function() {
|
20
|
-
if ((
|
16
|
+
if ((0, _utils1).canUseDOM()) {
|
21
17
|
var pixel = window.pixel;
|
22
18
|
var title = window.document.title;
|
23
19
|
if (!title || title === 'за') {
|
@@ -6,7 +6,7 @@ var mapProducts = function(data) {
|
|
6
6
|
var mapped = data === null || data === void 0 ? void 0 : data.reduce(function(res, cur) {
|
7
7
|
var ref, ref1;
|
8
8
|
res.push({
|
9
|
-
|
9
|
+
sku: cur.variant.sku,
|
10
10
|
price: (Number((ref = cur.totalPrice) === null || ref === void 0 ? void 0 : ref.centAmount) / Math.pow(10, Number((ref1 = cur.totalPrice) === null || ref1 === void 0 ? void 0 : ref1.fractionDigits))).toFixed(2),
|
11
11
|
quantity: cur.quantity + ''
|
12
12
|
});
|
@@ -65,12 +65,15 @@ function ProductProvider(param) {
|
|
65
65
|
product === null || product === void 0 ? void 0 : product.name,
|
66
66
|
product === null || product === void 0 ? void 0 : product.slug,
|
67
67
|
product === null || product === void 0 ? void 0 : product.assets,
|
68
|
-
selectedVariant,
|
68
|
+
selectedVariant,
|
69
|
+
product === null || product === void 0 ? void 0 : product.categories,
|
70
|
+
includeBrandInName,
|
71
|
+
product === null || product === void 0 ? void 0 : product.reviewRatingStatistics,
|
69
72
|
]);
|
70
73
|
var seoData = _react.default.useMemo(function() {
|
71
74
|
var ref, ref39, ref40;
|
72
75
|
var title = (0, _).getTranslatableField(selectedVariant === null || selectedVariant === void 0 ? void 0 : selectedVariant.metaTitle) || (0, _).getTranslatableField(product === null || product === void 0 ? void 0 : product.metaTitle);
|
73
|
-
var brandName = product === null || product === void 0 ? void 0 : (ref = product.brands) === null || ref === void 0 ? void 0 : (ref39 = ref[0]) === null || ref39 === void 0 ? void 0 : (ref40 = ref39.resource) === null || ref40 === void 0 ? void 0 : ref40.name;
|
76
|
+
var brandName = (0, _).getTranslatableField(product === null || product === void 0 ? void 0 : (ref = product.brands) === null || ref === void 0 ? void 0 : (ref39 = ref[0]) === null || ref39 === void 0 ? void 0 : (ref40 = ref39.resource) === null || ref40 === void 0 ? void 0 : ref40.name);
|
74
77
|
var seoObj = {
|
75
78
|
title: includeBrandInName && brandName ? "".concat(brandName, " ").concat(title) : title,
|
76
79
|
description: (0, _).getTranslatableField(selectedVariant === null || selectedVariant === void 0 ? void 0 : selectedVariant.metaDescription) || (0, _).getTranslatableField(product === null || product === void 0 ? void 0 : product.metaDescription),
|
@@ -81,7 +84,9 @@ function ProductProvider(param) {
|
|
81
84
|
product === null || product === void 0 ? void 0 : product.metaDescription,
|
82
85
|
product === null || product === void 0 ? void 0 : product.metaKeywords,
|
83
86
|
product === null || product === void 0 ? void 0 : product.metaTitle,
|
84
|
-
selectedVariant,
|
87
|
+
selectedVariant,
|
88
|
+
product === null || product === void 0 ? void 0 : product.brands,
|
89
|
+
includeBrandInName,
|
85
90
|
]);
|
86
91
|
var collapsedImages = (0, _utils).createCollapseKeyImagesMap(product);
|
87
92
|
var state = {
|
@@ -16,12 +16,28 @@ function _interopRequireDefault(obj) {
|
|
16
16
|
default: obj
|
17
17
|
};
|
18
18
|
}
|
19
|
+
/**
|
20
|
+
* Template Options:
|
21
|
+
* :title: -> is going to be replace with the title
|
22
|
+
* :name: -> is going to be replace with the name
|
23
|
+
* :description: -> is going to be replace with the description
|
24
|
+
* :category: -> is going to be replace with the category
|
25
|
+
* :price: -> is going to be replace with the price
|
26
|
+
* :quantity: -> is going to be replace with the quantity
|
27
|
+
* :brand: -> is going to be replace with the brand
|
28
|
+
*
|
29
|
+
*/ var truncateToCharLength = function(text, maxLenChars) {
|
30
|
+
var separator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ' ';
|
31
|
+
var cut = text.indexOf(separator, maxLenChars);
|
32
|
+
if (cut === -1) return text;
|
33
|
+
return text.substring(0, cut);
|
34
|
+
};
|
19
35
|
function ProductSEO() {
|
20
36
|
var ref16 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _favorTitleTemplateOverMeta = ref16.favorTitleTemplateOverMeta, favorTitleTemplateOverMeta = _favorTitleTemplateOverMeta === void 0 ? false : _favorTitleTemplateOverMeta, _favorDescriptionTemplateOverMeta = ref16.favorDescriptionTemplateOverMeta, favorDescriptionTemplateOverMeta = _favorDescriptionTemplateOverMeta === void 0 ? false : _favorDescriptionTemplateOverMeta, _titleTemplate = ref16.titleTemplate, titleTemplate = _titleTemplate === void 0 ? ':title:' : _titleTemplate, _descriptionTemplate = ref16.descriptionTemplate, descriptionTemplate = _descriptionTemplate === void 0 ? ':description:' : _descriptionTemplate;
|
21
37
|
var ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, ref10, ref11, ref12, ref13, ref14;
|
22
38
|
var ref15 = (0, _useProduct).useProductState(), selectedVariant = ref15.selectedVariant, metaData = ref15.metaData, seoData = ref15.seoData;
|
23
39
|
var domain = (0, _useConfig).useConfigState().domain;
|
24
|
-
var description = (0, _utils).escape(seoData.description || metaData.shortDescription || metaData.description || '');
|
40
|
+
var description = (0, _utils).escape(seoData.description || metaData.shortDescription || truncateToCharLength(metaData === null || metaData === void 0 ? void 0 : metaData.description, 200) || '');
|
25
41
|
var title = seoData.title || metaData.name || '';
|
26
42
|
var price = (0, _usePrice).usePrice({
|
27
43
|
price: selectedVariant === null || selectedVariant === void 0 ? void 0 : (ref1 = selectedVariant.offer) === null || ref1 === void 0 ? void 0 : ref1.originalPrice
|
@@ -42,7 +42,7 @@ function handleRobots(res, domain) {
|
|
42
42
|
}
|
43
43
|
function _handleRobots() {
|
44
44
|
_handleRobots = _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee(res, domain) {
|
45
|
-
var disallowed, txt, _args = arguments;
|
45
|
+
var disallowed, siteMapUrl, txt, _args = arguments;
|
46
46
|
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
47
47
|
while(1)switch(_ctx.prev = _ctx.next){
|
48
48
|
case 0:
|
@@ -53,18 +53,19 @@ function _handleRobots() {
|
|
53
53
|
'/profile',
|
54
54
|
'/favorites'
|
55
55
|
];
|
56
|
+
siteMapUrl = "https://".concat(domain, "sitemap.xml");
|
56
57
|
if (!(process.env.NO_INDEX === 'true')) {
|
57
|
-
_ctx.next =
|
58
|
+
_ctx.next = 5;
|
58
59
|
break;
|
59
60
|
}
|
60
61
|
res.status(200).send('User-agent: *\nDisallow: /');
|
61
62
|
return _ctx.abrupt("return");
|
62
|
-
case
|
63
|
+
case 5:
|
63
64
|
txt = disallowed.reduce(function(value, str) {
|
64
65
|
return value + "Disallow: ".concat(str, "\n");
|
65
|
-
}, "Sitemap: ".concat(
|
66
|
+
}, "Sitemap: ".concat(siteMapUrl, "\nUser-agent: *\n"));
|
66
67
|
res.status(200).send(txt);
|
67
|
-
case
|
68
|
+
case 7:
|
68
69
|
case "end":
|
69
70
|
return _ctx.stop();
|
70
71
|
}
|
@@ -1,18 +1,17 @@
|
|
1
1
|
import { mapProducts } from '../utils';
|
2
|
-
|
3
|
-
"@swc/helpers - typeof";
|
4
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
5
|
-
};
|
2
|
+
import { canUseDOM } from '../../../index';
|
6
3
|
export var usePixelFinishOrder = function() {
|
7
4
|
var sendFinishOrderEvent = function(order) {
|
5
|
+
var ref, ref1;
|
8
6
|
var payload = {
|
9
7
|
orderId: order.orderRefNumber,
|
10
|
-
productsData: mapProducts(order.lineItems)
|
8
|
+
productsData: mapProducts(order.lineItems),
|
9
|
+
orderPrice: (Number((ref = order.grandTotalPrice) === null || ref === void 0 ? void 0 : ref.centAmount) / Math.pow(10, Number((ref1 = order.grandTotalPrice) === null || ref1 === void 0 ? void 0 : ref1.fractionDigits))).toFixed(2)
|
11
10
|
};
|
12
|
-
if ((
|
11
|
+
if (canUseDOM()) {
|
13
12
|
var pixel = window.pixel;
|
14
13
|
if (payload) {
|
15
|
-
pixel === null || pixel === void 0 ? void 0 : pixel.finishOrder(payload);
|
14
|
+
pixel === null || pixel === void 0 ? void 0 : pixel.finishOrder(payload.orderId, payload.productsData, payload.orderPrice);
|
16
15
|
}
|
17
16
|
}
|
18
17
|
};
|
@@ -1,12 +1,9 @@
|
|
1
1
|
import { mapProducts } from '../utils';
|
2
|
-
|
3
|
-
"@swc/helpers - typeof";
|
4
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
5
|
-
};
|
2
|
+
import { canUseDOM } from '../../../index';
|
6
3
|
export var usePixelViewBasket = function() {
|
7
4
|
var sendViewBasketEvent = function(data) {
|
8
5
|
var payload = mapProducts(data);
|
9
|
-
if ((
|
6
|
+
if (canUseDOM()) {
|
10
7
|
var pixel = window.pixel;
|
11
8
|
if (payload) {
|
12
9
|
pixel === null || pixel === void 0 ? void 0 : pixel.viewBasket(payload);
|
@@ -1,7 +1,4 @@
|
|
1
|
-
|
2
|
-
"@swc/helpers - typeof";
|
3
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
4
|
-
};
|
1
|
+
import { canUseDOM } from '../../../index';
|
5
2
|
export var usePixelViewCategory = function() {
|
6
3
|
var sendViewCategoryEvent = function(breadcrumbData) {
|
7
4
|
var breadcrumbString = breadcrumbData.reduce(function(res, curr, index) {
|
@@ -11,7 +8,7 @@ export var usePixelViewCategory = function() {
|
|
11
8
|
}
|
12
9
|
return res;
|
13
10
|
}, '');
|
14
|
-
if ((
|
11
|
+
if (canUseDOM()) {
|
15
12
|
var pixel = window.pixel;
|
16
13
|
if (breadcrumbString) {
|
17
14
|
pixel === null || pixel === void 0 ? void 0 : pixel.viewCategory(breadcrumbString);
|
@@ -3,12 +3,8 @@ import Router from 'next/router';
|
|
3
3
|
import { useConfigState } from '../../index';
|
4
4
|
import { getBasketId } from '../Releva/utils';
|
5
5
|
import { canUseDOM } from '../../utils';
|
6
|
-
var _typeof = function(obj) {
|
7
|
-
"@swc/helpers - typeof";
|
8
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
9
|
-
};
|
10
6
|
export var pixelChangeRoute = function() {
|
11
|
-
if ((
|
7
|
+
if (canUseDOM()) {
|
12
8
|
var pixel = window.pixel;
|
13
9
|
var title = window.document.title;
|
14
10
|
if (!title || title === 'за') {
|
@@ -2,7 +2,7 @@ export var mapProducts = function(data) {
|
|
2
2
|
var mapped = data === null || data === void 0 ? void 0 : data.reduce(function(res, cur) {
|
3
3
|
var ref, ref1;
|
4
4
|
res.push({
|
5
|
-
|
5
|
+
sku: cur.variant.sku,
|
6
6
|
price: (Number((ref = cur.totalPrice) === null || ref === void 0 ? void 0 : ref.centAmount) / Math.pow(10, Number((ref1 = cur.totalPrice) === null || ref1 === void 0 ? void 0 : ref1.fractionDigits))).toFixed(2),
|
7
7
|
quantity: cur.quantity + ''
|
8
8
|
});
|
@@ -53,12 +53,15 @@ export function ProductProvider(param) {
|
|
53
53
|
product === null || product === void 0 ? void 0 : product.name,
|
54
54
|
product === null || product === void 0 ? void 0 : product.slug,
|
55
55
|
product === null || product === void 0 ? void 0 : product.assets,
|
56
|
-
selectedVariant,
|
56
|
+
selectedVariant,
|
57
|
+
product === null || product === void 0 ? void 0 : product.categories,
|
58
|
+
includeBrandInName,
|
59
|
+
product === null || product === void 0 ? void 0 : product.reviewRatingStatistics,
|
57
60
|
]);
|
58
61
|
var seoData = React.useMemo(function() {
|
59
62
|
var ref, ref39, ref40;
|
60
63
|
var title = getTranslatableField(selectedVariant === null || selectedVariant === void 0 ? void 0 : selectedVariant.metaTitle) || getTranslatableField(product === null || product === void 0 ? void 0 : product.metaTitle);
|
61
|
-
var brandName = product === null || product === void 0 ? void 0 : (ref = product.brands) === null || ref === void 0 ? void 0 : (ref39 = ref[0]) === null || ref39 === void 0 ? void 0 : (ref40 = ref39.resource) === null || ref40 === void 0 ? void 0 : ref40.name;
|
64
|
+
var brandName = getTranslatableField(product === null || product === void 0 ? void 0 : (ref = product.brands) === null || ref === void 0 ? void 0 : (ref39 = ref[0]) === null || ref39 === void 0 ? void 0 : (ref40 = ref39.resource) === null || ref40 === void 0 ? void 0 : ref40.name);
|
62
65
|
var seoObj = {
|
63
66
|
title: includeBrandInName && brandName ? "".concat(brandName, " ").concat(title) : title,
|
64
67
|
description: getTranslatableField(selectedVariant === null || selectedVariant === void 0 ? void 0 : selectedVariant.metaDescription) || getTranslatableField(product === null || product === void 0 ? void 0 : product.metaDescription),
|
@@ -69,7 +72,9 @@ export function ProductProvider(param) {
|
|
69
72
|
product === null || product === void 0 ? void 0 : product.metaDescription,
|
70
73
|
product === null || product === void 0 ? void 0 : product.metaKeywords,
|
71
74
|
product === null || product === void 0 ? void 0 : product.metaTitle,
|
72
|
-
selectedVariant,
|
75
|
+
selectedVariant,
|
76
|
+
product === null || product === void 0 ? void 0 : product.brands,
|
77
|
+
includeBrandInName,
|
73
78
|
]);
|
74
79
|
var collapsedImages = createCollapseKeyImagesMap(product);
|
75
80
|
var state = {
|
@@ -16,12 +16,18 @@ import { useConfigState } from '../../../hooks/useConfig';
|
|
16
16
|
* :quantity: -> is going to be replace with the quantity
|
17
17
|
* :brand: -> is going to be replace with the brand
|
18
18
|
*
|
19
|
-
*/
|
19
|
+
*/ var truncateToCharLength = function(text, maxLenChars) {
|
20
|
+
var separator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ' ';
|
21
|
+
var cut = text.indexOf(separator, maxLenChars);
|
22
|
+
if (cut === -1) return text;
|
23
|
+
return text.substring(0, cut);
|
24
|
+
};
|
25
|
+
export function ProductSEO() {
|
20
26
|
var ref16 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _favorTitleTemplateOverMeta = ref16.favorTitleTemplateOverMeta, favorTitleTemplateOverMeta = _favorTitleTemplateOverMeta === void 0 ? false : _favorTitleTemplateOverMeta, _favorDescriptionTemplateOverMeta = ref16.favorDescriptionTemplateOverMeta, favorDescriptionTemplateOverMeta = _favorDescriptionTemplateOverMeta === void 0 ? false : _favorDescriptionTemplateOverMeta, _titleTemplate = ref16.titleTemplate, titleTemplate = _titleTemplate === void 0 ? ':title:' : _titleTemplate, _descriptionTemplate = ref16.descriptionTemplate, descriptionTemplate = _descriptionTemplate === void 0 ? ':description:' : _descriptionTemplate;
|
21
27
|
var ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, ref10, ref11, ref12, ref13, ref14;
|
22
28
|
var ref15 = useProductState(), selectedVariant = ref15.selectedVariant, metaData = ref15.metaData, seoData = ref15.seoData;
|
23
29
|
var domain = useConfigState().domain;
|
24
|
-
var description = escape(seoData.description || metaData.shortDescription || metaData.description || '');
|
30
|
+
var description = escape(seoData.description || metaData.shortDescription || truncateToCharLength(metaData === null || metaData === void 0 ? void 0 : metaData.description, 200) || '');
|
25
31
|
var title = seoData.title || metaData.name || '';
|
26
32
|
var price = usePrice({
|
27
33
|
price: selectedVariant === null || selectedVariant === void 0 ? void 0 : (ref1 = selectedVariant.offer) === null || ref1 === void 0 ? void 0 : ref1.originalPrice
|
@@ -33,7 +33,7 @@ export function handleRobots(res, domain) {
|
|
33
33
|
}
|
34
34
|
function _handleRobots() {
|
35
35
|
_handleRobots = _asyncToGenerator(regeneratorRuntime.mark(function _callee(res, domain) {
|
36
|
-
var disallowed, txt, _args = arguments;
|
36
|
+
var disallowed, siteMapUrl, txt, _args = arguments;
|
37
37
|
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
38
38
|
while(1)switch(_ctx.prev = _ctx.next){
|
39
39
|
case 0:
|
@@ -44,18 +44,19 @@ function _handleRobots() {
|
|
44
44
|
'/profile',
|
45
45
|
'/favorites'
|
46
46
|
];
|
47
|
+
siteMapUrl = "https://".concat(domain, "sitemap.xml");
|
47
48
|
if (!(process.env.NO_INDEX === 'true')) {
|
48
|
-
_ctx.next =
|
49
|
+
_ctx.next = 5;
|
49
50
|
break;
|
50
51
|
}
|
51
52
|
res.status(200).send('User-agent: *\nDisallow: /');
|
52
53
|
return _ctx.abrupt("return");
|
53
|
-
case
|
54
|
+
case 5:
|
54
55
|
txt = disallowed.reduce(function(value, str) {
|
55
56
|
return value + "Disallow: ".concat(str, "\n");
|
56
|
-
}, "Sitemap: ".concat(
|
57
|
+
}, "Sitemap: ".concat(siteMapUrl, "\nUser-agent: *\n"));
|
57
58
|
res.status(200).send(txt);
|
58
|
-
case
|
59
|
+
case 7:
|
59
60
|
case "end":
|
60
61
|
return _ctx.stop();
|
61
62
|
}
|
@@ -8,11 +8,12 @@ export interface ProductsImpressionType {
|
|
8
8
|
products?: ProductType[] | SearchResultDTO[];
|
9
9
|
}
|
10
10
|
export interface Products {
|
11
|
-
|
11
|
+
sku: string;
|
12
12
|
price: string;
|
13
13
|
quantity: string;
|
14
14
|
}
|
15
15
|
export interface OrderType {
|
16
16
|
orderId: string;
|
17
17
|
productsData: Products[];
|
18
|
+
orderPrice: string;
|
18
19
|
}
|
@@ -1,14 +1,3 @@
|
|
1
|
-
/**
|
2
|
-
* Template Options:
|
3
|
-
* :title: -> is going to be replace with the title
|
4
|
-
* :name: -> is going to be replace with the name
|
5
|
-
* :description: -> is going to be replace with the description
|
6
|
-
* :category: -> is going to be replace with the category
|
7
|
-
* :price: -> is going to be replace with the price
|
8
|
-
* :quantity: -> is going to be replace with the quantity
|
9
|
-
* :brand: -> is going to be replace with the brand
|
10
|
-
*
|
11
|
-
*/
|
12
1
|
export declare function ProductSEO({ favorTitleTemplateOverMeta, favorDescriptionTemplateOverMeta, titleTemplate, descriptionTemplate, }?: {
|
13
2
|
favorTitleTemplateOverMeta?: boolean;
|
14
3
|
favorDescriptionTemplateOverMeta?: boolean;
|
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.13",
|
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": "daf24e6985c099ac54aaf26c4999a776127c9ad7",
|
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.13",
|
40
|
+
"@sentecacommerce-theme/cms": "^0.13.13",
|
41
41
|
"@sentecacommerce/sdk": "2.0.175",
|
42
42
|
"body-scroll-lock": "^3.1.5",
|
43
43
|
"copy-to-clipboard": "^3.3.1",
|