@redneckz/wildless-cms-uni-blocks 0.14.982 → 0.14.984
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 +21 -18
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/RichTextBlock/RichTextBlock.d.ts +5 -1
- package/bundle/components/RichTextBlock/RichTextBlockContent.d.ts +2 -1
- package/bundle/utils/getFormatDynamicText.d.ts +2 -0
- package/bundle/utils/getQueryParamValue.d.ts +1 -0
- package/dist/components/ProductBlock/ProductBlock.js +2 -13
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/RichTextBlock/RichTextBlock.d.ts +5 -1
- package/dist/components/RichTextBlock/RichTextBlock.js +6 -4
- package/dist/components/RichTextBlock/RichTextBlock.js.map +1 -1
- package/dist/components/RichTextBlock/RichTextBlockContent.d.ts +2 -1
- package/dist/retail/components/Fields/RegionRetailField.js +2 -2
- package/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/dist/utils/getFormatDynamicText.d.ts +2 -0
- package/dist/utils/getFormatDynamicText.js +13 -0
- package/dist/utils/getFormatDynamicText.js.map +1 -0
- package/dist/utils/getQueryParamValue.d.ts +1 -0
- package/dist/utils/getQueryParamValue.js +8 -0
- package/dist/utils/getQueryParamValue.js.map +1 -0
- package/lib/components/ProductBlock/ProductBlock.js +2 -13
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/RichTextBlock/RichTextBlock.d.ts +5 -1
- package/lib/components/RichTextBlock/RichTextBlock.fixture.d.ts +1 -0
- package/lib/components/RichTextBlock/RichTextBlock.js +6 -4
- package/lib/components/RichTextBlock/RichTextBlock.js.map +1 -1
- package/lib/components/RichTextBlock/RichTextBlockContent.d.ts +2 -1
- package/lib/retail/components/Fields/RegionRetailField.js +2 -2
- package/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/lib/utils/getFormatDynamicText.d.ts +2 -0
- package/lib/utils/getFormatDynamicText.js +10 -0
- package/lib/utils/getFormatDynamicText.js.map +1 -0
- package/lib/utils/getQueryParamValue.d.ts +1 -0
- package/lib/utils/getQueryParamValue.js +5 -0
- package/lib/utils/getQueryParamValue.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +21 -18
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/RichTextBlock/RichTextBlock.d.ts +5 -1
- package/mobile/bundle/components/RichTextBlock/RichTextBlockContent.d.ts +2 -1
- package/mobile/bundle/utils/getFormatDynamicText.d.ts +2 -0
- package/mobile/bundle/utils/getQueryParamValue.d.ts +1 -0
- package/mobile/dist/components/ProductBlock/ProductBlock.js +2 -13
- package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/dist/components/RichTextBlock/RichTextBlock.d.ts +5 -1
- package/mobile/dist/components/RichTextBlock/RichTextBlock.js +6 -4
- package/mobile/dist/components/RichTextBlock/RichTextBlock.js.map +1 -1
- package/mobile/dist/components/RichTextBlock/RichTextBlockContent.d.ts +2 -1
- package/mobile/dist/retail/components/Fields/RegionRetailField.js +2 -2
- package/mobile/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/dist/utils/getFormatDynamicText.d.ts +2 -0
- package/mobile/dist/utils/getFormatDynamicText.js +13 -0
- package/mobile/dist/utils/getFormatDynamicText.js.map +1 -0
- package/mobile/dist/utils/getQueryParamValue.d.ts +1 -0
- package/mobile/dist/utils/getQueryParamValue.js +8 -0
- package/mobile/dist/utils/getQueryParamValue.js.map +1 -0
- package/mobile/lib/components/ProductBlock/ProductBlock.js +2 -13
- package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/lib/components/RichTextBlock/RichTextBlock.d.ts +5 -1
- package/mobile/lib/components/RichTextBlock/RichTextBlock.js +6 -4
- package/mobile/lib/components/RichTextBlock/RichTextBlock.js.map +1 -1
- package/mobile/lib/components/RichTextBlock/RichTextBlockContent.d.ts +2 -1
- package/mobile/lib/retail/components/Fields/RegionRetailField.js +2 -2
- package/mobile/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/lib/utils/getFormatDynamicText.d.ts +2 -0
- package/mobile/lib/utils/getFormatDynamicText.js +10 -0
- package/mobile/lib/utils/getFormatDynamicText.js.map +1 -0
- package/mobile/lib/utils/getQueryParamValue.d.ts +1 -0
- package/mobile/lib/utils/getQueryParamValue.js +5 -0
- package/mobile/lib/utils/getQueryParamValue.js.map +1 -0
- package/mobile/src/components/ProductBlock/ProductBlock.tsx +2 -24
- package/mobile/src/components/RichTextBlock/RichTextBlock.tsx +19 -5
- package/mobile/src/components/RichTextBlock/RichTextBlockContent.ts +2 -1
- package/mobile/src/retail/components/Fields/RegionRetailField.tsx +2 -4
- package/mobile/src/utils/getFormatDynamicText.ts +18 -0
- package/mobile/src/utils/getQueryParamValue.ts +5 -0
- package/package.json +1 -1
- package/src/components/ProductBlock/ProductBlock.tsx +2 -24
- package/src/components/RichTextBlock/RichTextBlock.fixture.tsx +18 -1
- package/src/components/RichTextBlock/RichTextBlock.tsx +19 -5
- package/src/components/RichTextBlock/RichTextBlockContent.ts +2 -1
- package/src/retail/components/Fields/RegionRetailField.tsx +2 -4
- package/src/utils/getFormatDynamicText.ts +18 -0
- package/src/utils/getQueryParamValue.ts +5 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -977,6 +977,11 @@
|
|
|
977
977
|
return OutputComponent;
|
|
978
978
|
}
|
|
979
979
|
|
|
980
|
+
const getQueryParamValue = (queryParam, queryString) => {
|
|
981
|
+
const params = new URLSearchParams(queryString);
|
|
982
|
+
return params.get(queryParam);
|
|
983
|
+
};
|
|
984
|
+
|
|
980
985
|
const QUERY_STORAGE_KEY = 'rshb-query-params';
|
|
981
986
|
function saveSessionQuery() {
|
|
982
987
|
const result = globalThis.location?.search || globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY) || '';
|
|
@@ -986,26 +991,23 @@
|
|
|
986
991
|
return result;
|
|
987
992
|
}
|
|
988
993
|
|
|
994
|
+
const getFormatDynamicText = (dynamicQueryParamText = {}, valuesList = [], text = '') => {
|
|
995
|
+
const { queryParam, value } = dynamicQueryParamText;
|
|
996
|
+
const sessionQuery = saveSessionQuery();
|
|
997
|
+
const utmValue = getQueryParamValue(queryParam ?? 'utm_source', sessionQuery);
|
|
998
|
+
const dynamicValue = valuesList.find((item) => item?.id?.toLowerCase() === utmValue?.toLowerCase())?.value;
|
|
999
|
+
return dynamicValue ? text?.replace(String(value), dynamicValue) : text;
|
|
1000
|
+
};
|
|
1001
|
+
|
|
989
1002
|
const ProductBlock = UniBlock(({ className, padding, defaultPadding, dynamicQueryParamText = {}, dynamicTextSource, description, title, ...rest }) => {
|
|
990
1003
|
const { textType } = dynamicQueryParamText;
|
|
991
|
-
const formatText =
|
|
1004
|
+
const formatText = getFormatDynamicText(dynamicQueryParamText, dynamicTextSource?.list, textType === 'title' ? title : description);
|
|
992
1005
|
const textProps = {
|
|
993
1006
|
title: textType === 'title' ? formatText : title,
|
|
994
1007
|
description: textType === 'description' ? formatText : description,
|
|
995
1008
|
};
|
|
996
1009
|
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, className: "grow h-full", ...textProps, ...rest }) }));
|
|
997
1010
|
});
|
|
998
|
-
const getFormatDescription = (dynamicQueryParamText = {}, valuesList = [], text = '') => {
|
|
999
|
-
const { queryParam, value } = dynamicQueryParamText;
|
|
1000
|
-
const sessionQuery = saveSessionQuery();
|
|
1001
|
-
const utmValue = getQueryParamValue(queryParam ?? 'utm_source', sessionQuery);
|
|
1002
|
-
const dynamicValue = valuesList.find((item) => item?.id?.toLowerCase() === utmValue?.toLowerCase())?.value;
|
|
1003
|
-
return dynamicValue ? text?.replace(String(value), dynamicValue) : text;
|
|
1004
|
-
};
|
|
1005
|
-
const getQueryParamValue = (queryParam, queryString) => {
|
|
1006
|
-
const params = new URLSearchParams(queryString);
|
|
1007
|
-
return params.get(queryParam);
|
|
1008
|
-
};
|
|
1009
1011
|
|
|
1010
1012
|
const AdTile = JSX((props) => {
|
|
1011
1013
|
const { items } = (props.options?.page?.adSourceBook ?? {});
|
|
@@ -5792,12 +5794,12 @@
|
|
|
5792
5794
|
handleChangeRegionHasDelivery?.(checkRegionDeliveryStatus(DEFAULT_BIBLIOLOBUS_VALUES.region));
|
|
5793
5795
|
handleChangeMethodObtain?.('office');
|
|
5794
5796
|
}
|
|
5795
|
-
if (isSalaryCard) {
|
|
5797
|
+
else if (isSalaryCard) {
|
|
5796
5798
|
handleChangeRegion?.(DEFAULT_SALARY_CARD_VALUES.region);
|
|
5797
5799
|
handleChangeOffice?.(DEFAULT_SALARY_CARD_VALUES.office);
|
|
5798
5800
|
handleChangeMethodObtain?.('office');
|
|
5799
5801
|
}
|
|
5800
|
-
if (regionRetail) {
|
|
5802
|
+
else if (regionRetail) {
|
|
5801
5803
|
const regionHasDelivery = checkRegionDeliveryStatus(regionRetail);
|
|
5802
5804
|
handleChangeRegionHasDelivery?.(regionHasDelivery);
|
|
5803
5805
|
handleChangeMethodObtain?.(regionHasDelivery ? 'courier' : 'office');
|
|
@@ -12524,9 +12526,10 @@
|
|
|
12524
12526
|
return (jsx(BlockWrapper, { version: "transparent", className: style(className), defaultPadding: "p-0", ...rest, children: dataType === 'offices' ? jsx(OfficesMap, {}) : jsx(AtmsMap, { descriptionData: data }) }));
|
|
12525
12527
|
});
|
|
12526
12528
|
|
|
12527
|
-
const RichTextBlock =
|
|
12528
|
-
const { __html, richVersion = '', ...rest } = props;
|
|
12529
|
-
|
|
12529
|
+
const RichTextBlock = UniBlock((props) => {
|
|
12530
|
+
const { __html, dynamicQueryParamText = {}, dynamicTextSource, richVersion = '', ...rest } = props;
|
|
12531
|
+
const formatText = getFormatDynamicText(dynamicQueryParamText, dynamicTextSource?.list, __html);
|
|
12532
|
+
return (jsx(BlockWrapper, { defaultPadding: "p-0", ...rest, children: jsx(RichText, { __html: formatText, richVersion: richVersion }) }));
|
|
12530
12533
|
});
|
|
12531
12534
|
|
|
12532
12535
|
const getFoldableStyles = (isMobile = false) => isMobile ? 'flex flex-wrap group-last:last:pb-0' : 'grid grid-cols-12 [&>*]:pb-m';
|
|
@@ -13137,7 +13140,7 @@
|
|
|
13137
13140
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
13138
13141
|
});
|
|
13139
13142
|
|
|
13140
|
-
const packageVersion = "0.14.
|
|
13143
|
+
const packageVersion = "0.14.983";
|
|
13141
13144
|
|
|
13142
13145
|
exports.Blocks = Blocks;
|
|
13143
13146
|
exports.ContentPage = ContentPage;
|