@sentecacommerce-theme/lib 0.12.103 → 0.13.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.
- package/dist/cjs/analytics/Pixel/mainScript.js +1 -2
- package/dist/cjs/api/getSDKConfig.js +2 -4
- package/dist/cjs/api/myCartApi/index.js +2 -8
- package/dist/cjs/basket/api/mutations/index.js +0 -14
- package/dist/cjs/basket/hooks/index.js +0 -12
- package/dist/cjs/config/SentecaProvider.js +1 -3
- package/dist/cjs/hooks/useAggregateResult/index.js +1 -5
- package/dist/cjs/hooks/useAvailability/index.js +1 -1
- package/dist/cjs/hooks/useClearAllFilters/index.js +0 -2
- package/dist/cjs/hooks/useProduct/index.js +26 -36
- package/dist/cjs/hooks/wishlist-hooks/useWishlistItem/index.js +15 -39
- package/dist/cjs/listing/api/queries/useListingQuery.js +1 -1
- package/dist/cjs/listing/hooks/useListingFilters.js +1 -7
- package/dist/cjs/listing/hooks/useListingMeta.js +40 -49
- package/dist/cjs/listing/hooks/useSlideFilter.js +4 -27
- package/dist/cjs/listing/ssr/prefetchCategories.js +6 -5
- package/dist/cjs/listing/ssr/prefetchPredicate.js +4 -4
- package/dist/cjs/navigation/components/SearchBox/Components/EmptyBox/index.js +7 -7
- package/dist/cjs/navigation/components/SearchBox/index.js +4 -4
- package/dist/cjs/seo/components/TranslationsMeta/index.js +14 -43
- package/dist/cjs/seo/components/index.js +0 -12
- package/dist/cjs/seo/hooks/useSeoTranslations.js +14 -55
- package/dist/cjs/ui/components/GridStyles.js +2 -2
- package/dist/cjs/ui/components/RangeSliderInput.js +1 -14
- package/dist/cjs/user/api/queries/useGetMyLoyaltyCardQuery.js +3 -49
- package/dist/cjs/utils/getSelectedFilters.js +1 -3
- package/dist/cjs/utils/index.js +0 -12
- package/dist/cjs/utils/isTouchDevice.js +1 -2
- package/dist/esm/analytics/Pixel/mainScript.js +1 -2
- package/dist/esm/api/getSDKConfig.js +3 -5
- package/dist/esm/api/myCartApi/index.js +2 -8
- package/dist/esm/basket/api/mutations/index.js +0 -1
- package/dist/esm/basket/hooks/index.js +0 -1
- package/dist/esm/config/SentecaProvider.js +1 -3
- package/dist/esm/hooks/useAggregateResult/index.js +1 -5
- package/dist/esm/hooks/useAvailability/index.js +1 -1
- package/dist/esm/hooks/useClearAllFilters/index.js +0 -2
- package/dist/esm/hooks/useProduct/index.js +18 -28
- package/dist/esm/hooks/wishlist-hooks/useWishlistItem/index.js +13 -21
- package/dist/esm/listing/api/queries/useListingQuery.js +1 -1
- package/dist/esm/listing/hooks/useListingFilters.js +1 -7
- package/dist/esm/listing/hooks/useListingMeta.js +40 -49
- package/dist/esm/listing/hooks/useSlideFilter.js +4 -27
- package/dist/esm/listing/ssr/prefetchCategories.js +7 -6
- package/dist/esm/listing/ssr/prefetchPredicate.js +4 -4
- package/dist/esm/navigation/components/SearchBox/Components/EmptyBox/index.js +7 -7
- package/dist/esm/navigation/components/SearchBox/index.js +4 -4
- package/dist/esm/seo/components/TranslationsMeta/index.js +14 -43
- package/dist/esm/seo/components/index.js +0 -1
- package/dist/esm/seo/hooks/useSeoTranslations.js +14 -55
- package/dist/esm/ui/components/GridStyles.js +2 -2
- package/dist/esm/ui/components/RangeSliderInput.js +1 -14
- package/dist/esm/user/api/queries/useGetMyLoyaltyCardQuery.js +3 -44
- package/dist/esm/utils/getSelectedFilters.js +1 -3
- package/dist/esm/utils/index.js +0 -1
- package/dist/esm/utils/isTouchDevice.js +1 -2
- package/dist/types/basket/api/mutations/index.d.ts +0 -1
- package/dist/types/basket/hooks/index.d.ts +0 -1
- package/dist/types/hooks/basket-hooks/useBasketLineItem/index.d.ts +2 -1
- package/dist/types/hooks/useProduct/index.d.ts +1 -2
- package/dist/types/listing/hooks/useSlideFilter.d.ts +0 -4
- package/dist/types/listing/types.d.ts +0 -10
- package/dist/types/navigation/components/SearchBox/Components/EmptyBox/index.d.ts +4 -5
- package/dist/types/navigation/components/SearchBox/index.d.ts +6 -7
- package/dist/types/seo/components/index.d.ts +0 -1
- package/dist/types/seo/hooks/useSeoTranslations.d.ts +3 -5
- package/dist/types/ui/components/GridStyles.d.ts +1 -2
- package/dist/types/ui/components/RangeSliderInput.d.ts +1 -2
- package/dist/types/utils/index.d.ts +0 -1
- package/package.json +4 -4
- package/dist/cjs/basket/api/mutations/useChangeGiftVariant.js +0 -116
- package/dist/cjs/basket/hooks/useChangeGiftVariant.js +0 -16
- package/dist/cjs/utils/getLocaleFromPath.js +0 -13
- package/dist/esm/basket/api/mutations/useChangeGiftVariant.js +0 -106
- package/dist/esm/basket/hooks/useChangeGiftVariant.js +0 -3
- package/dist/esm/utils/getLocaleFromPath.js +0 -8
- package/dist/types/basket/api/mutations/useChangeGiftVariant.d.ts +0 -2
- package/dist/types/basket/hooks/useChangeGiftVariant.d.ts +0 -2
- package/dist/types/seo/components/TranslationsMeta/index.d.ts +0 -1
- package/dist/types/utils/getLocaleFromPath.d.ts +0 -1
@@ -1,116 +0,0 @@
|
|
1
|
-
Object.defineProperty(exports, "__esModule", {
|
2
|
-
value: true
|
3
|
-
});
|
4
|
-
exports.useChangeGiftVariantMutation = void 0;
|
5
|
-
var _regeneratorRuntime = _interopRequireDefault(require("regenerator-runtime"));
|
6
|
-
var _react = _interopRequireDefault(require("react"));
|
7
|
-
var _reactQuery = require("react-query");
|
8
|
-
var _sdk = require("@sentecacommerce/sdk");
|
9
|
-
var _index = require("../../index");
|
10
|
-
function _arrayLikeToArray(arr, len) {
|
11
|
-
if (len == null || len > arr.length) len = arr.length;
|
12
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
13
|
-
return arr2;
|
14
|
-
}
|
15
|
-
function _arrayWithHoles(arr) {
|
16
|
-
if (Array.isArray(arr)) return arr;
|
17
|
-
}
|
18
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
19
|
-
try {
|
20
|
-
var info = gen[key](arg);
|
21
|
-
var value = info.value;
|
22
|
-
} catch (error) {
|
23
|
-
reject(error);
|
24
|
-
return;
|
25
|
-
}
|
26
|
-
if (info.done) {
|
27
|
-
resolve(value);
|
28
|
-
} else {
|
29
|
-
Promise.resolve(value).then(_next, _throw);
|
30
|
-
}
|
31
|
-
}
|
32
|
-
function _asyncToGenerator(fn) {
|
33
|
-
return function() {
|
34
|
-
var self = this, args = arguments;
|
35
|
-
return new Promise(function(resolve, reject) {
|
36
|
-
var gen = fn.apply(self, args);
|
37
|
-
function _next(value) {
|
38
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
39
|
-
}
|
40
|
-
function _throw(err) {
|
41
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
42
|
-
}
|
43
|
-
_next(undefined);
|
44
|
-
});
|
45
|
-
};
|
46
|
-
}
|
47
|
-
function _interopRequireDefault(obj) {
|
48
|
-
return obj && obj.__esModule ? obj : {
|
49
|
-
default: obj
|
50
|
-
};
|
51
|
-
}
|
52
|
-
function _iterableToArrayLimit(arr, i) {
|
53
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
54
|
-
if (_i == null) return;
|
55
|
-
var _arr = [];
|
56
|
-
var _n = true;
|
57
|
-
var _d = false;
|
58
|
-
var _s, _e;
|
59
|
-
try {
|
60
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
61
|
-
_arr.push(_s.value);
|
62
|
-
if (i && _arr.length === i) break;
|
63
|
-
}
|
64
|
-
} catch (err) {
|
65
|
-
_d = true;
|
66
|
-
_e = err;
|
67
|
-
} finally{
|
68
|
-
try {
|
69
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
70
|
-
} finally{
|
71
|
-
if (_d) throw _e;
|
72
|
-
}
|
73
|
-
}
|
74
|
-
return _arr;
|
75
|
-
}
|
76
|
-
function _nonIterableRest() {
|
77
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
78
|
-
}
|
79
|
-
function _slicedToArray(arr, i) {
|
80
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
81
|
-
}
|
82
|
-
function _unsupportedIterableToArray(o, minLen) {
|
83
|
-
if (!o) return;
|
84
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
85
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
86
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
87
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
88
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
89
|
-
}
|
90
|
-
var useChangeGiftVariantMutation = function() {
|
91
|
-
var ref = _slicedToArray((0, _index).useReplaceBasket(), 1), replaceBasket = ref[0];
|
92
|
-
return (0, _reactQuery).useMutation(function() {
|
93
|
-
var _ref = _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee(props) {
|
94
|
-
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
95
|
-
while(1)switch(_ctx.prev = _ctx.next){
|
96
|
-
case 0:
|
97
|
-
_ctx.next = 2;
|
98
|
-
return (0, _sdk).MyCartChangeSelectableGiftLineItemVariant(props);
|
99
|
-
case 2:
|
100
|
-
return _ctx.abrupt("return", _ctx.sent);
|
101
|
-
case 3:
|
102
|
-
case "end":
|
103
|
-
return _ctx.stop();
|
104
|
-
}
|
105
|
-
}, _callee);
|
106
|
-
}));
|
107
|
-
return function(props) {
|
108
|
-
return _ref.apply(this, arguments);
|
109
|
-
};
|
110
|
-
}(), {
|
111
|
-
onSuccess: function(data) {
|
112
|
-
return replaceBasket(data);
|
113
|
-
}
|
114
|
-
});
|
115
|
-
};
|
116
|
-
exports.useChangeGiftVariantMutation = useChangeGiftVariantMutation;
|
@@ -1,16 +0,0 @@
|
|
1
|
-
Object.defineProperty(exports, "__esModule", {
|
2
|
-
value: true
|
3
|
-
});
|
4
|
-
Object.defineProperty(exports, "useChangeGiftVariant", {
|
5
|
-
enumerable: true,
|
6
|
-
get: function() {
|
7
|
-
return _mutations.useChangeGiftVariantMutation;
|
8
|
-
}
|
9
|
-
});
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
11
|
-
var _mutations = require("../api/mutations");
|
12
|
-
function _interopRequireDefault(obj) {
|
13
|
-
return obj && obj.__esModule ? obj : {
|
14
|
-
default: obj
|
15
|
-
};
|
16
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
Object.defineProperty(exports, "__esModule", {
|
2
|
-
value: true
|
3
|
-
});
|
4
|
-
exports.getLocaleFromPath = void 0;
|
5
|
-
var _canUseDom = require("./canUseDom");
|
6
|
-
var getLocaleFromPath = function() {
|
7
|
-
if (!(0, _canUseDom).canUseDOM()) return '';
|
8
|
-
var locale = window.location.pathname.split('/')[1] || '';
|
9
|
-
// the allowed standards: bg bg-BG, en en-US/en-UK
|
10
|
-
if (locale.length !== 2 && locale.length !== 5) return '';
|
11
|
-
return locale;
|
12
|
-
};
|
13
|
-
exports.getLocaleFromPath = getLocaleFromPath;
|
@@ -1,106 +0,0 @@
|
|
1
|
-
import regeneratorRuntime from "regenerator-runtime";
|
2
|
-
import React from 'react';
|
3
|
-
import { useMutation } from 'react-query';
|
4
|
-
import { MyCartChangeSelectableGiftLineItemVariant } from '@sentecacommerce/sdk';
|
5
|
-
import { useReplaceBasket } from '../../index';
|
6
|
-
function _arrayLikeToArray(arr, len) {
|
7
|
-
if (len == null || len > arr.length) len = arr.length;
|
8
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
9
|
-
return arr2;
|
10
|
-
}
|
11
|
-
function _arrayWithHoles(arr) {
|
12
|
-
if (Array.isArray(arr)) return arr;
|
13
|
-
}
|
14
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
15
|
-
try {
|
16
|
-
var info = gen[key](arg);
|
17
|
-
var value = info.value;
|
18
|
-
} catch (error) {
|
19
|
-
reject(error);
|
20
|
-
return;
|
21
|
-
}
|
22
|
-
if (info.done) {
|
23
|
-
resolve(value);
|
24
|
-
} else {
|
25
|
-
Promise.resolve(value).then(_next, _throw);
|
26
|
-
}
|
27
|
-
}
|
28
|
-
function _asyncToGenerator(fn) {
|
29
|
-
return function() {
|
30
|
-
var self = this, args = arguments;
|
31
|
-
return new Promise(function(resolve, reject) {
|
32
|
-
var gen = fn.apply(self, args);
|
33
|
-
function _next(value) {
|
34
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
35
|
-
}
|
36
|
-
function _throw(err) {
|
37
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
38
|
-
}
|
39
|
-
_next(undefined);
|
40
|
-
});
|
41
|
-
};
|
42
|
-
}
|
43
|
-
function _iterableToArrayLimit(arr, i) {
|
44
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
45
|
-
if (_i == null) return;
|
46
|
-
var _arr = [];
|
47
|
-
var _n = true;
|
48
|
-
var _d = false;
|
49
|
-
var _s, _e;
|
50
|
-
try {
|
51
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
52
|
-
_arr.push(_s.value);
|
53
|
-
if (i && _arr.length === i) break;
|
54
|
-
}
|
55
|
-
} catch (err) {
|
56
|
-
_d = true;
|
57
|
-
_e = err;
|
58
|
-
} finally{
|
59
|
-
try {
|
60
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
61
|
-
} finally{
|
62
|
-
if (_d) throw _e;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
return _arr;
|
66
|
-
}
|
67
|
-
function _nonIterableRest() {
|
68
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
69
|
-
}
|
70
|
-
function _slicedToArray(arr, i) {
|
71
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
72
|
-
}
|
73
|
-
function _unsupportedIterableToArray(o, minLen) {
|
74
|
-
if (!o) return;
|
75
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
76
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
77
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
78
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
79
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
80
|
-
}
|
81
|
-
export var useChangeGiftVariantMutation = function() {
|
82
|
-
var ref = _slicedToArray(useReplaceBasket(), 1), replaceBasket = ref[0];
|
83
|
-
return useMutation(function() {
|
84
|
-
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(props) {
|
85
|
-
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
86
|
-
while(1)switch(_ctx.prev = _ctx.next){
|
87
|
-
case 0:
|
88
|
-
_ctx.next = 2;
|
89
|
-
return MyCartChangeSelectableGiftLineItemVariant(props);
|
90
|
-
case 2:
|
91
|
-
return _ctx.abrupt("return", _ctx.sent);
|
92
|
-
case 3:
|
93
|
-
case "end":
|
94
|
-
return _ctx.stop();
|
95
|
-
}
|
96
|
-
}, _callee);
|
97
|
-
}));
|
98
|
-
return function(props) {
|
99
|
-
return _ref.apply(this, arguments);
|
100
|
-
};
|
101
|
-
}(), {
|
102
|
-
onSuccess: function(data) {
|
103
|
-
return replaceBasket(data);
|
104
|
-
}
|
105
|
-
});
|
106
|
-
};
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { canUseDOM } from './canUseDom';
|
2
|
-
export var getLocaleFromPath = function() {
|
3
|
-
if (!canUseDOM()) return '';
|
4
|
-
var locale = window.location.pathname.split('/')[1] || '';
|
5
|
-
// the allowed standards: bg bg-BG, en en-US/en-UK
|
6
|
-
if (locale.length !== 2 && locale.length !== 5) return '';
|
7
|
-
return locale;
|
8
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const TranslationsMeta: () => JSX.Element | null;
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const getLocaleFromPath: () => string;
|