@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.
Files changed (47) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +25 -11
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/GalleryLayout/utils.d.ts +2 -2
  5. package/bundle/components/ProductBlock/ProductBlock.d.ts +4 -0
  6. package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  7. package/bundle/model/HeadlineType.d.ts +14 -1
  8. package/dist/components/GalleryLayout/utils.d.ts +2 -2
  9. package/dist/components/ProductBlock/ProductBlock.d.ts +4 -0
  10. package/dist/components/ProductBlock/ProductBlock.js +16 -1
  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 +14 -1
  14. package/lib/components/GalleryLayout/utils.d.ts +2 -2
  15. package/lib/components/ProductBlock/ProductBlock.d.ts +4 -0
  16. package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +1 -0
  17. package/lib/components/ProductBlock/ProductBlock.js +16 -1
  18. package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  19. package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  20. package/lib/model/HeadlineType.d.ts +14 -1
  21. package/mobile/bundle/bundle.umd.js +25 -11
  22. package/mobile/bundle/bundle.umd.min.js +1 -1
  23. package/mobile/bundle/components/GalleryLayout/utils.d.ts +2 -2
  24. package/mobile/bundle/components/ProductBlock/ProductBlock.d.ts +4 -0
  25. package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  26. package/mobile/bundle/model/HeadlineType.d.ts +14 -1
  27. package/mobile/dist/components/GalleryLayout/utils.d.ts +2 -2
  28. package/mobile/dist/components/ProductBlock/ProductBlock.d.ts +4 -0
  29. package/mobile/dist/components/ProductBlock/ProductBlock.js +16 -1
  30. package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  31. package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  32. package/mobile/dist/model/HeadlineType.d.ts +14 -1
  33. package/mobile/lib/components/GalleryLayout/utils.d.ts +2 -2
  34. package/mobile/lib/components/ProductBlock/ProductBlock.d.ts +4 -0
  35. package/mobile/lib/components/ProductBlock/ProductBlock.js +16 -1
  36. package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  37. package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  38. package/mobile/lib/model/HeadlineType.d.ts +14 -1
  39. package/mobile/src/components/ProductBlock/ProductBlock.tsx +57 -14
  40. package/mobile/src/components/ProductBlock/ProductBlockContent.ts +6 -2
  41. package/mobile/src/model/HeadlineType.ts +20 -1
  42. package/package.json +1 -1
  43. package/src/components/ProductBlock/ProductBlock.fixture.tsx +22 -0
  44. package/src/components/ProductBlock/ProductBlock.tsx +57 -14
  45. package/src/components/ProductBlock/ProductBlockContent.ts +6 -2
  46. package/src/icons/IconName.ts +4 -4
  47. package/src/model/HeadlineType.ts +20 -1
@@ -977,7 +977,30 @@
977
977
  return OutputComponent;
978
978
  }
979
979
 
980
- const ProductBlock = UniBlock(({ className, padding, defaultPadding, ...rest }) => (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", ...rest }) })));
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.972";
13190
+ const packageVersion = "0.14.973";
13177
13191
 
13178
13192
  exports.Blocks = Blocks;
13179
13193
  exports.ContentPage = ContentPage;