@sentecacommerce-theme/lib 0.14.13 → 0.14.16
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/config/SentecaProvider.js +4 -4
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/listing/components/BasicListingSEO.js +1 -0
- package/dist/cjs/seo/components/BasicSEO/index.js +3 -0
- package/dist/cjs/seo/components/GlobalSEO/index.js +1 -0
- package/dist/cjs/seo/components/OpenGraph/index.js +4 -0
- package/dist/esm/config/SentecaProvider.js +4 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/listing/components/BasicListingSEO.js +1 -0
- package/dist/esm/seo/components/BasicSEO/index.js +3 -0
- package/dist/esm/seo/components/GlobalSEO/index.js +1 -0
- package/dist/esm/seo/components/OpenGraph/index.js +4 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +4 -4
|
@@ -47,6 +47,7 @@ var ConfigStateContext = /*#__PURE__*/ _react.default.createContext(undefined);
|
|
|
47
47
|
function SentecaProvider(param) {
|
|
48
48
|
var defaultConfig = param.defaultConfig, transientConfig = param.transientConfig, localeData = param.localeData, children = param.children, disableStaged = param.disableStaged;
|
|
49
49
|
var queryCache = (0, _reactQuery).useQueryCache();
|
|
50
|
+
var router = (0, _router).useRouter();
|
|
50
51
|
var options = (0, _getSDKConfig).getOptions(defaultConfig);
|
|
51
52
|
// add interfaceKey and storeKey in the headers
|
|
52
53
|
if (localeData) {
|
|
@@ -62,12 +63,11 @@ function SentecaProvider(param) {
|
|
|
62
63
|
headers: _objectSpread({}, options.headers || {}, transientConfig.headers || {})
|
|
63
64
|
}));
|
|
64
65
|
}
|
|
65
|
-
var router = (0, _router).useRouter();
|
|
66
66
|
_react.default.useEffect(function() {
|
|
67
67
|
if (disableStaged || router.query.staged !== 'true') return;
|
|
68
|
-
var pageName = router.pathname;
|
|
68
|
+
var pageName = router === null || router === void 0 ? void 0 : router.pathname;
|
|
69
69
|
if (pageName === '/[[...path]]') {
|
|
70
|
-
pageName = router.asPath.split('?')[0];
|
|
70
|
+
pageName = router === null || router === void 0 ? void 0 : router.asPath.split('?')[0];
|
|
71
71
|
}
|
|
72
72
|
router.replace({
|
|
73
73
|
pathname: '/preview',
|
|
@@ -81,7 +81,7 @@ function SentecaProvider(param) {
|
|
|
81
81
|
router,
|
|
82
82
|
disableStaged
|
|
83
83
|
]);
|
|
84
|
-
if (!disableStaged && router.asPath.includes('staged=true')) return null;
|
|
84
|
+
if (!disableStaged && (router === null || router === void 0 ? void 0 : router.asPath.includes('staged=true'))) return null;
|
|
85
85
|
if (!defaultConfig) {
|
|
86
86
|
throw new Error('SentecaProvider requires a valid config object');
|
|
87
87
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1046,15 +1046,15 @@ Object.keys(_useLocalRating).forEach(function(key) {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
});
|
|
1048
1048
|
});
|
|
1049
|
-
var
|
|
1050
|
-
Object.keys(
|
|
1049
|
+
var _useProductVariants = _interopRequireWildcard(require("./hooks/useProductVariants"));
|
|
1050
|
+
Object.keys(_useProductVariants).forEach(function(key) {
|
|
1051
1051
|
if (key === "default" || key === "__esModule") return;
|
|
1052
1052
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
1053
|
-
if (key in exports && exports[key] ===
|
|
1053
|
+
if (key in exports && exports[key] === _useProductVariants[key]) return;
|
|
1054
1054
|
Object.defineProperty(exports, key, {
|
|
1055
1055
|
enumerable: true,
|
|
1056
1056
|
get: function() {
|
|
1057
|
-
return
|
|
1057
|
+
return _useProductVariants[key];
|
|
1058
1058
|
}
|
|
1059
1059
|
});
|
|
1060
1060
|
});
|
|
@@ -1082,15 +1082,15 @@ Object.keys(_utils1).forEach(function(key) {
|
|
|
1082
1082
|
}
|
|
1083
1083
|
});
|
|
1084
1084
|
});
|
|
1085
|
-
var
|
|
1086
|
-
Object.keys(
|
|
1085
|
+
var _types = _interopRequireWildcard(require("./types"));
|
|
1086
|
+
Object.keys(_types).forEach(function(key) {
|
|
1087
1087
|
if (key === "default" || key === "__esModule") return;
|
|
1088
1088
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
1089
|
-
if (key in exports && exports[key] ===
|
|
1089
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
1090
1090
|
Object.defineProperty(exports, key, {
|
|
1091
1091
|
enumerable: true,
|
|
1092
1092
|
get: function() {
|
|
1093
|
-
return
|
|
1093
|
+
return _types[key];
|
|
1094
1094
|
}
|
|
1095
1095
|
});
|
|
1096
1096
|
});
|
|
@@ -33,6 +33,7 @@ var BasicListingSEO = function(param) {
|
|
|
33
33
|
var formattedDescription = favorDescriptionTemplateOverMeta ? createTemplate(descriptionTemplate) : metaDescription || createTemplate(descriptionTemplate);
|
|
34
34
|
return(/*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_head.default, null, isSearchPage && /*#__PURE__*/ _react.default.createElement("meta", {
|
|
35
35
|
name: "robots",
|
|
36
|
+
key: "robots",
|
|
36
37
|
content: "noindex"
|
|
37
38
|
}), (pagination === null || pagination === void 0 ? void 0 : pagination.hasPrevious) && /*#__PURE__*/ _react.default.createElement("link", {
|
|
38
39
|
rel: "prev",
|
|
@@ -13,12 +13,15 @@ function BasicSEO(props) {
|
|
|
13
13
|
var title = props.title, description = props.description, keywords = props.keywords, noIndex = props.noIndex;
|
|
14
14
|
return(/*#__PURE__*/ _react.default.createElement(_head.default, null, Boolean(noIndex) && /*#__PURE__*/ _react.default.createElement("meta", {
|
|
15
15
|
name: "robots",
|
|
16
|
+
key: "robots",
|
|
16
17
|
content: "noindex"
|
|
17
18
|
}), Boolean(title) && /*#__PURE__*/ _react.default.createElement("title", null, title), Boolean(description) && /*#__PURE__*/ _react.default.createElement("meta", {
|
|
18
19
|
name: "description",
|
|
20
|
+
key: "description",
|
|
19
21
|
content: description
|
|
20
22
|
}), Boolean(keywords) && /*#__PURE__*/ _react.default.createElement("meta", {
|
|
21
23
|
name: "keywords",
|
|
24
|
+
key: "keywords",
|
|
22
25
|
content: keywords
|
|
23
26
|
})));
|
|
24
27
|
}
|
|
@@ -21,6 +21,7 @@ function GlobalSEO() {
|
|
|
21
21
|
var organizationJSONLd = "{\n \"@context\": \"https://schema.org\",\n \"@type\": \"Organization\",\n \"url\": \"".concat(domain, "\",\n \"contactPoint\": [\n {\n \"@type\": \"ContactPoint\",\n \"telephone\": \"").concat(organizationPhone, "\",\n \"contactType\": \"customer service\"\n }\n ]\n }");
|
|
22
22
|
var defaultIcon = (favicon === null || favicon === void 0 ? void 0 : favicon.default) || (favicon === null || favicon === void 0 ? void 0 : favicon.medium) || (favicon === null || favicon === void 0 ? void 0 : favicon.svg);
|
|
23
23
|
return(/*#__PURE__*/ _react.default.createElement(_head.default, null, /*#__PURE__*/ _react.default.createElement("link", {
|
|
24
|
+
key: "canonical",
|
|
24
25
|
rel: "canonical",
|
|
25
26
|
href: "https://".concat(domain).concat(router === null || router === void 0 ? void 0 : (ref = router.asPath) === null || ref === void 0 ? void 0 : ref.split('?')[0])
|
|
26
27
|
}), /*#__PURE__*/ _react.default.createElement("script", {
|
|
@@ -17,9 +17,11 @@ var OpenGraph = function(props) {
|
|
|
17
17
|
var domain = (0, _useConfig).useConfigState().domain;
|
|
18
18
|
return(/*#__PURE__*/ _react.default.createElement(_head.default, null, /*#__PURE__*/ _react.default.createElement("meta", {
|
|
19
19
|
property: "og:title",
|
|
20
|
+
key: "og:title",
|
|
20
21
|
content: title
|
|
21
22
|
}), /*#__PURE__*/ _react.default.createElement("meta", {
|
|
22
23
|
property: "og:type",
|
|
24
|
+
key: "og:type",
|
|
23
25
|
content: type
|
|
24
26
|
}), Array.isArray(image) ? image.map(function(img) {
|
|
25
27
|
/*#__PURE__*/ return _react.default.createElement("meta", {
|
|
@@ -29,9 +31,11 @@ var OpenGraph = function(props) {
|
|
|
29
31
|
});
|
|
30
32
|
}) : /*#__PURE__*/ _react.default.createElement("meta", {
|
|
31
33
|
property: "og:image",
|
|
34
|
+
key: "og:image",
|
|
32
35
|
content: image
|
|
33
36
|
}), /*#__PURE__*/ _react.default.createElement("meta", {
|
|
34
37
|
property: "og:url",
|
|
38
|
+
key: "og:url",
|
|
35
39
|
content: url || "https://".concat(domain).concat(router === null || router === void 0 ? void 0 : router.asPath)
|
|
36
40
|
}), Array.isArray(additionalProps) ? additionalProps.map(function(prop) {
|
|
37
41
|
/*#__PURE__*/ return _react.default.createElement("meta", {
|
|
@@ -38,6 +38,7 @@ var ConfigStateContext = /*#__PURE__*/ React.createContext(undefined);
|
|
|
38
38
|
export function SentecaProvider(param) {
|
|
39
39
|
var defaultConfig = param.defaultConfig, transientConfig = param.transientConfig, localeData = param.localeData, children = param.children, disableStaged = param.disableStaged;
|
|
40
40
|
var queryCache = useQueryCache();
|
|
41
|
+
var router = useRouter();
|
|
41
42
|
var options = getOptions(defaultConfig);
|
|
42
43
|
// add interfaceKey and storeKey in the headers
|
|
43
44
|
if (localeData) {
|
|
@@ -53,12 +54,11 @@ export function SentecaProvider(param) {
|
|
|
53
54
|
headers: _objectSpread({}, options.headers || {}, transientConfig.headers || {})
|
|
54
55
|
}));
|
|
55
56
|
}
|
|
56
|
-
var router = useRouter();
|
|
57
57
|
React.useEffect(function() {
|
|
58
58
|
if (disableStaged || router.query.staged !== 'true') return;
|
|
59
|
-
var pageName = router.pathname;
|
|
59
|
+
var pageName = router === null || router === void 0 ? void 0 : router.pathname;
|
|
60
60
|
if (pageName === '/[[...path]]') {
|
|
61
|
-
pageName = router.asPath.split('?')[0];
|
|
61
|
+
pageName = router === null || router === void 0 ? void 0 : router.asPath.split('?')[0];
|
|
62
62
|
}
|
|
63
63
|
router.replace({
|
|
64
64
|
pathname: '/preview',
|
|
@@ -72,7 +72,7 @@ export function SentecaProvider(param) {
|
|
|
72
72
|
router,
|
|
73
73
|
disableStaged
|
|
74
74
|
]);
|
|
75
|
-
if (!disableStaged && router.asPath.includes('staged=true')) return null;
|
|
75
|
+
if (!disableStaged && (router === null || router === void 0 ? void 0 : router.asPath.includes('staged=true'))) return null;
|
|
76
76
|
if (!defaultConfig) {
|
|
77
77
|
throw new Error('SentecaProvider requires a valid config object');
|
|
78
78
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -92,7 +92,7 @@ export * from './hooks/useRouterRedirect';
|
|
|
92
92
|
export * from './hooks/useProgressBar';
|
|
93
93
|
export * from './hooks/useCatalogDiscounts';
|
|
94
94
|
export * from './hooks/useLocalRating';
|
|
95
|
-
export * from './hooks/useProductVariants
|
|
95
|
+
export * from './hooks/useProductVariants';
|
|
96
96
|
export * from './hooks/CompareContext/';
|
|
97
97
|
// Utils
|
|
98
98
|
export * from './utils';
|
|
@@ -29,6 +29,7 @@ import { useListingMeta, useListingPagination } from '../hooks';
|
|
|
29
29
|
var formattedDescription = favorDescriptionTemplateOverMeta ? createTemplate(descriptionTemplate) : metaDescription || createTemplate(descriptionTemplate);
|
|
30
30
|
return(/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Head, null, isSearchPage && /*#__PURE__*/ React.createElement("meta", {
|
|
31
31
|
name: "robots",
|
|
32
|
+
key: "robots",
|
|
32
33
|
content: "noindex"
|
|
33
34
|
}), (pagination === null || pagination === void 0 ? void 0 : pagination.hasPrevious) && /*#__PURE__*/ React.createElement("link", {
|
|
34
35
|
rel: "prev",
|
|
@@ -4,12 +4,15 @@ export function BasicSEO(props) {
|
|
|
4
4
|
var title = props.title, description = props.description, keywords = props.keywords, noIndex = props.noIndex;
|
|
5
5
|
return(/*#__PURE__*/ React.createElement(Head, null, Boolean(noIndex) && /*#__PURE__*/ React.createElement("meta", {
|
|
6
6
|
name: "robots",
|
|
7
|
+
key: "robots",
|
|
7
8
|
content: "noindex"
|
|
8
9
|
}), Boolean(title) && /*#__PURE__*/ React.createElement("title", null, title), Boolean(description) && /*#__PURE__*/ React.createElement("meta", {
|
|
9
10
|
name: "description",
|
|
11
|
+
key: "description",
|
|
10
12
|
content: description
|
|
11
13
|
}), Boolean(keywords) && /*#__PURE__*/ React.createElement("meta", {
|
|
12
14
|
name: "keywords",
|
|
15
|
+
key: "keywords",
|
|
13
16
|
content: keywords
|
|
14
17
|
})));
|
|
15
18
|
}
|
|
@@ -11,6 +11,7 @@ export function GlobalSEO() {
|
|
|
11
11
|
var organizationJSONLd = "{\n \"@context\": \"https://schema.org\",\n \"@type\": \"Organization\",\n \"url\": \"".concat(domain, "\",\n \"contactPoint\": [\n {\n \"@type\": \"ContactPoint\",\n \"telephone\": \"").concat(organizationPhone, "\",\n \"contactType\": \"customer service\"\n }\n ]\n }");
|
|
12
12
|
var defaultIcon = (favicon === null || favicon === void 0 ? void 0 : favicon.default) || (favicon === null || favicon === void 0 ? void 0 : favicon.medium) || (favicon === null || favicon === void 0 ? void 0 : favicon.svg);
|
|
13
13
|
return(/*#__PURE__*/ React.createElement(Head, null, /*#__PURE__*/ React.createElement("link", {
|
|
14
|
+
key: "canonical",
|
|
14
15
|
rel: "canonical",
|
|
15
16
|
href: "https://".concat(domain).concat(router === null || router === void 0 ? void 0 : (ref = router.asPath) === null || ref === void 0 ? void 0 : ref.split('?')[0])
|
|
16
17
|
}), /*#__PURE__*/ React.createElement("script", {
|
|
@@ -8,9 +8,11 @@ export var OpenGraph = function(props) {
|
|
|
8
8
|
var domain = useConfigState().domain;
|
|
9
9
|
return(/*#__PURE__*/ React.createElement(Head, null, /*#__PURE__*/ React.createElement("meta", {
|
|
10
10
|
property: "og:title",
|
|
11
|
+
key: "og:title",
|
|
11
12
|
content: title
|
|
12
13
|
}), /*#__PURE__*/ React.createElement("meta", {
|
|
13
14
|
property: "og:type",
|
|
15
|
+
key: "og:type",
|
|
14
16
|
content: type
|
|
15
17
|
}), Array.isArray(image) ? image.map(function(img) {
|
|
16
18
|
/*#__PURE__*/ return React.createElement("meta", {
|
|
@@ -20,9 +22,11 @@ export var OpenGraph = function(props) {
|
|
|
20
22
|
});
|
|
21
23
|
}) : /*#__PURE__*/ React.createElement("meta", {
|
|
22
24
|
property: "og:image",
|
|
25
|
+
key: "og:image",
|
|
23
26
|
content: image
|
|
24
27
|
}), /*#__PURE__*/ React.createElement("meta", {
|
|
25
28
|
property: "og:url",
|
|
29
|
+
key: "og:url",
|
|
26
30
|
content: url || "https://".concat(domain).concat(router === null || router === void 0 ? void 0 : router.asPath)
|
|
27
31
|
}), Array.isArray(additionalProps) ? additionalProps.map(function(prop) {
|
|
28
32
|
/*#__PURE__*/ return React.createElement("meta", {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -85,7 +85,7 @@ export * from './hooks/useRouterRedirect';
|
|
|
85
85
|
export * from './hooks/useProgressBar';
|
|
86
86
|
export * from './hooks/useCatalogDiscounts';
|
|
87
87
|
export * from './hooks/useLocalRating';
|
|
88
|
-
export * from './hooks/useProductVariants
|
|
88
|
+
export * from './hooks/useProductVariants';
|
|
89
89
|
export * from './hooks/CompareContext/';
|
|
90
90
|
export * from './utils';
|
|
91
91
|
export * from './types';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentecacommerce-theme/lib",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.16",
|
|
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": "d6cdf200ac4174fa2f33aa2120ff0169df884f0a",
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react-query": "^2.26.2"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@sentecacommerce-theme/base": "^0.14.
|
|
40
|
-
"@sentecacommerce-theme/cms": "^0.14.
|
|
39
|
+
"@sentecacommerce-theme/base": "^0.14.16",
|
|
40
|
+
"@sentecacommerce-theme/cms": "^0.14.16",
|
|
41
41
|
"@sentecacommerce/sdk": "2.0.175",
|
|
42
42
|
"body-scroll-lock": "^3.1.5",
|
|
43
43
|
"copy-to-clipboard": "^3.3.1",
|