@redneckz/wildless-cms-uni-blocks 0.14.975 → 0.14.976

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.
Files changed (45) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +16 -11
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/GalleryLayout/utils.d.ts +1 -1
  5. package/bundle/components/ProductBlock/ProductBlock.d.ts +1 -1
  6. package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  7. package/bundle/model/HeadlineType.d.ts +15 -8
  8. package/dist/components/GalleryLayout/utils.d.ts +1 -1
  9. package/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
  10. package/dist/components/ProductBlock/ProductBlock.js +15 -10
  11. package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  12. package/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  13. package/dist/model/HeadlineType.d.ts +15 -8
  14. package/lib/components/GalleryLayout/utils.d.ts +1 -1
  15. package/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
  16. package/lib/components/ProductBlock/ProductBlock.js +15 -10
  17. package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  18. package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  19. package/lib/model/HeadlineType.d.ts +15 -8
  20. package/mobile/bundle/bundle.umd.js +16 -11
  21. package/mobile/bundle/bundle.umd.min.js +1 -1
  22. package/mobile/bundle/components/GalleryLayout/utils.d.ts +1 -1
  23. package/mobile/bundle/components/ProductBlock/ProductBlock.d.ts +1 -1
  24. package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  25. package/mobile/bundle/model/HeadlineType.d.ts +15 -8
  26. package/mobile/dist/components/GalleryLayout/utils.d.ts +1 -1
  27. package/mobile/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
  28. package/mobile/dist/components/ProductBlock/ProductBlock.js +15 -10
  29. package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  30. package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  31. package/mobile/dist/model/HeadlineType.d.ts +15 -8
  32. package/mobile/lib/components/GalleryLayout/utils.d.ts +1 -1
  33. package/mobile/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
  34. package/mobile/lib/components/ProductBlock/ProductBlock.js +15 -10
  35. package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  36. package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  37. package/mobile/lib/model/HeadlineType.d.ts +15 -8
  38. package/mobile/src/components/ProductBlock/ProductBlock.tsx +26 -17
  39. package/mobile/src/components/ProductBlock/ProductBlockContent.ts +2 -5
  40. package/mobile/src/model/HeadlineType.ts +16 -8
  41. package/package.json +1 -1
  42. package/src/components/ProductBlock/ProductBlock.fixture.tsx +16 -7
  43. package/src/components/ProductBlock/ProductBlock.tsx +26 -17
  44. package/src/components/ProductBlock/ProductBlockContent.ts +2 -5
  45. package/src/model/HeadlineType.ts +16 -8
@@ -986,20 +986,25 @@
986
986
  return result;
987
987
  }
988
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 }) }));
989
+ const ProductBlock = UniBlock(({ className, padding, defaultPadding, dynamicQueryParamText = {}, dynamicTextSource, description, title, ...rest }) => {
990
+ const { textType } = dynamicQueryParamText;
991
+ const formatText = getFormatDescription(dynamicQueryParamText, dynamicTextSource?.list, textType === 'title' ? title : description);
992
+ const textProps = {
993
+ title: textType === 'title' ? formatText : title,
994
+ description: textType === 'description' ? formatText : description,
995
+ };
996
+ 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 }) }));
992
997
  });
993
- const getFormatDescription = (dynamicUtmDescription = {}, valuesList = [], description = '') => {
994
- const { utm, value } = dynamicUtmDescription;
998
+ const getFormatDescription = (dynamicQueryParamText = {}, valuesList = [], text = '') => {
999
+ const { queryParam, value } = dynamicQueryParamText;
995
1000
  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;
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;
999
1004
  };
1000
- const getUtmValue = (utm, queryString) => {
1005
+ const getQueryParamValue = (queryParam, queryString) => {
1001
1006
  const params = new URLSearchParams(queryString);
1002
- return params.get(utm);
1007
+ return params.get(queryParam);
1003
1008
  };
1004
1009
 
1005
1010
  const AdTile = JSX((props) => {
@@ -13069,7 +13074,7 @@
13069
13074
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
13070
13075
  });
13071
13076
 
13072
- const packageVersion = "0.14.974";
13077
+ const packageVersion = "0.14.975";
13073
13078
 
13074
13079
  exports.Blocks = Blocks;
13075
13080
  exports.ContentPage = ContentPage;