@redneckz/wildless-cms-uni-blocks 0.14.973 → 0.14.974
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/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +25 -11
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/GalleryLayout/utils.d.ts +2 -2
- package/bundle/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/bundle/model/HeadlineType.d.ts +14 -1
- package/dist/components/GalleryLayout/utils.d.ts +2 -2
- package/dist/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/dist/components/ProductBlock/ProductBlock.js +16 -1
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/dist/model/HeadlineType.d.ts +14 -1
- package/lib/components/GalleryLayout/utils.d.ts +2 -2
- package/lib/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +1 -0
- package/lib/components/ProductBlock/ProductBlock.js +16 -1
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/lib/model/HeadlineType.d.ts +14 -1
- package/mobile/bundle/bundle.umd.js +25 -11
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/GalleryLayout/utils.d.ts +2 -2
- package/mobile/bundle/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/bundle/model/HeadlineType.d.ts +14 -1
- package/mobile/dist/components/GalleryLayout/utils.d.ts +2 -2
- package/mobile/dist/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/mobile/dist/components/ProductBlock/ProductBlock.js +16 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/dist/model/HeadlineType.d.ts +14 -1
- package/mobile/lib/components/GalleryLayout/utils.d.ts +2 -2
- package/mobile/lib/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/mobile/lib/components/ProductBlock/ProductBlock.js +16 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/lib/model/HeadlineType.d.ts +14 -1
- package/mobile/src/components/ProductBlock/ProductBlock.tsx +57 -14
- package/mobile/src/components/ProductBlock/ProductBlockContent.ts +6 -2
- package/mobile/src/model/HeadlineType.ts +20 -1
- package/package.json +1 -1
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +22 -0
- package/src/components/ProductBlock/ProductBlock.tsx +57 -14
- package/src/components/ProductBlock/ProductBlockContent.ts +6 -2
- package/src/icons/IconName.ts +4 -4
- package/src/model/HeadlineType.ts +20 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -977,7 +977,30 @@
|
|
|
977
977
|
return OutputComponent;
|
|
978
978
|
}
|
|
979
979
|
|
|
980
|
-
const
|
|
980
|
+
const QUERY_STORAGE_KEY = 'rshb-query-params';
|
|
981
|
+
function saveSessionQuery() {
|
|
982
|
+
const result = globalThis.location?.search || globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY) || '';
|
|
983
|
+
if (result) {
|
|
984
|
+
globalThis.sessionStorage?.setItem(QUERY_STORAGE_KEY, result);
|
|
985
|
+
}
|
|
986
|
+
return result;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
const ProductBlock = UniBlock(({ className, padding, defaultPadding, dynamicUtmDescription, dynamicDescriptionSource, description, ...rest }) => {
|
|
990
|
+
const formatDescription = getFormatDescription(dynamicUtmDescription, dynamicDescriptionSource?.list, description);
|
|
991
|
+
return (jsx(BlockWrapper, { className: style('overflow-hidden flex flex-col gap-3xl box-border', className), padding: "p-0", ...rest, children: jsx(BaseProductTile, { defaultPadding: defaultPadding || 'p-6xl', padding: padding, description: formatDescription, className: "grow h-full", ...rest }) }));
|
|
992
|
+
});
|
|
993
|
+
const getFormatDescription = (dynamicUtmDescription = {}, valuesList = [], description = '') => {
|
|
994
|
+
const { utm, value } = dynamicUtmDescription;
|
|
995
|
+
const sessionQuery = saveSessionQuery();
|
|
996
|
+
const utmValue = getUtmValue(utm ?? 'utm_source', sessionQuery);
|
|
997
|
+
const dynamicValue = valuesList.find((item) => item?.id === utmValue)?.value;
|
|
998
|
+
return dynamicValue ? description.replace(String(value), dynamicValue) : description;
|
|
999
|
+
};
|
|
1000
|
+
const getUtmValue = (utm, queryString) => {
|
|
1001
|
+
const params = new URLSearchParams(queryString);
|
|
1002
|
+
return params.get(utm);
|
|
1003
|
+
};
|
|
981
1004
|
|
|
982
1005
|
const AdTile = JSX((props) => {
|
|
983
1006
|
const { items } = (props.options?.page?.adSourceBook ?? {});
|
|
@@ -1005,15 +1028,6 @@
|
|
|
1005
1028
|
locationNavigator._impl = impl;
|
|
1006
1029
|
};
|
|
1007
1030
|
|
|
1008
|
-
const QUERY_STORAGE_KEY = 'rshb-query-params';
|
|
1009
|
-
function saveSessionQuery() {
|
|
1010
|
-
const result = globalThis.location?.search || globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY) || '';
|
|
1011
|
-
if (result) {
|
|
1012
|
-
globalThis.sessionStorage?.setItem(QUERY_STORAGE_KEY, result);
|
|
1013
|
-
}
|
|
1014
|
-
return result;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
1031
|
const adjustSessionQuery = (href) => {
|
|
1018
1032
|
const sessionQuery = saveSessionQuery();
|
|
1019
1033
|
if (!isURL(href) || !sessionQuery) {
|
|
@@ -13173,7 +13187,7 @@
|
|
|
13173
13187
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
13174
13188
|
});
|
|
13175
13189
|
|
|
13176
|
-
const packageVersion = "0.14.
|
|
13190
|
+
const packageVersion = "0.14.973";
|
|
13177
13191
|
|
|
13178
13192
|
exports.Blocks = Blocks;
|
|
13179
13193
|
exports.ContentPage = ContentPage;
|