@redneckz/wildless-cms-uni-blocks 0.14.815 → 0.14.817

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 (50) hide show
  1. package/bundle/bundle.umd.js +21 -11
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/model/FormTypeFieldDef.d.ts +1 -1
  4. package/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  5. package/dist/components/GalleryLayout/GalleryLayout.js +18 -8
  6. package/dist/components/GalleryLayout/GalleryLayout.js.map +1 -1
  7. package/dist/model/FormTypeFieldDef.d.ts +1 -1
  8. package/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  9. package/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  10. package/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  11. package/lib/common.css +1 -1
  12. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
  13. package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +1 -0
  14. package/lib/components/GalleryLayout/GalleryLayout.js +18 -8
  15. package/lib/components/GalleryLayout/GalleryLayout.js.map +1 -1
  16. package/lib/model/FormTypeFieldDef.d.ts +1 -1
  17. package/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  18. package/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  19. package/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  20. package/mobile/bundle/bundle.umd.js +21 -11
  21. package/mobile/bundle/bundle.umd.min.js +1 -1
  22. package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
  23. package/mobile/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  24. package/mobile/dist/components/GalleryLayout/GalleryLayout.js +18 -8
  25. package/mobile/dist/components/GalleryLayout/GalleryLayout.js.map +1 -1
  26. package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
  27. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  28. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  29. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  30. package/mobile/lib/common.css +1 -1
  31. package/mobile/lib/components/GalleryLayout/GalleryLayout.js +18 -8
  32. package/mobile/lib/components/GalleryLayout/GalleryLayout.js.map +1 -1
  33. package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
  34. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  35. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  36. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  37. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +87 -0
  38. package/mobile/src/components/GalleryLayout/GalleryLayout.tsx +20 -9
  39. package/mobile/src/model/FormTypeFieldDef.ts +2 -1
  40. package/mobile/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -1
  41. package/mobile/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +2 -0
  42. package/package.json +1 -1
  43. package/src/components/ApplicationForm/ApplicationForm.example.json +87 -0
  44. package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +60 -0
  45. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +60 -0
  46. package/src/components/GalleryLayout/GalleryLayout.fixture.tsx +4 -15
  47. package/src/components/GalleryLayout/GalleryLayout.tsx +20 -9
  48. package/src/model/FormTypeFieldDef.ts +2 -1
  49. package/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -1
  50. package/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +2 -0
@@ -712,8 +712,8 @@
712
712
  };
713
713
  const BaseProductTile = JSX(
714
714
  // eslint-disable-next-line max-lines-per-function
715
- ({ className, padding, defaultPadding, title, description, headlineVersion = 'L', align = 'text-left', benefitsVersion, isTabularBenefits, isDotted = true, benefits, __html, richVersion, isFullWidthTitle, priceList = [], tags = [], buttons, image, imageOptions: { imageAlign = 'center', directionRight = true, isImageAlwaysOnRight, isImageSecondary = false, } = {}, backwardButton, children, ...rest }) => {
716
- const img = image?.src ? jsx(Img, { image: image }) : null;
715
+ ({ className, padding, defaultPadding, title, description, headlineVersion = 'L', align = 'text-left', benefitsVersion, isTabularBenefits, isDotted = true, benefits, __html, richVersion, isFullWidthTitle, priceList = [], tags = [], buttons, image, imageOptions: { imageAlign = 'center', directionRight = true, isImageAlwaysOnRight, isImageSecondary = false, className: imageClassName, } = {}, backwardButton, children, ...rest }) => {
716
+ const img = image?.src ? jsx(Img, { image: image, imageClassName: imageClassName }) : null;
717
717
  const headline = (jsx(Headline, { title: title, description: description, headlineVersion: headlineVersion, align: align, isEmbedded: true }));
718
718
  const filteredBenefits = benefits?.filter((_) => '__html' in _ || 'label' in _ || 'description' in _);
719
719
  return (jsx(BaseTile, { className: className, padding: padding, defaultPadding: defaultPadding, ...(isFullWidthTitle ? { title: headline } : { insetTitle: headline }), ...leftOrRightImage(img, directionRight), isImageSecondary: isImageSecondary, imageAlign: imageAlign, isImageAlwaysOnRight: isImageAlwaysOnRight, buttons: renderButtonsSection(buttons), backwardButton: backwardButton, ...rest, children: renderChildList(renderBenefits(filteredBenefits, { benefitsVersion, isTabularBenefits }), renderRichText(__html, { richVersion, isDotted, headlineVersion }), children, renderPriceList(priceList), renderTags(tags)) }));
@@ -9925,7 +9925,7 @@
9925
9925
  },
9926
9926
  },
9927
9927
  ],
9928
- title: 'Ссылка',
9928
+ title: 'Ссылка (если заполнено, то кнопка скрывается)',
9929
9929
  required: ['href'],
9930
9930
  },
9931
9931
  };
@@ -9948,21 +9948,31 @@
9948
9948
  ...props,
9949
9949
  render: (renderProps) => productBlockDecorator(idx)({ ...props, ...renderProps }, i),
9950
9950
  }, `wrap_${i}`) ?? productBlockDecorator(idx)(props, i);
9951
- const productBlockDecorator = (idx) => ({ blockClassName, block, render }, i) => (jsx(LinkWrapper, { ...block.content?.link, className: getChildStyle(idx), children: render({
9952
- blockClassName: style(blockClassName, 'h-full'),
9953
- block: modifyBlock(block, idx),
9954
- }) }, i));
9951
+ const productBlockDecorator = (idx) => ({ blockClassName, block, render }, i) => {
9952
+ const modifiedBlock = modifyBlock(block, idx);
9953
+ return (jsx(LinkWrapper, { ...modifiedBlock.content?.link, className: getChildStyle(idx), children: render({
9954
+ blockClassName: style(blockClassName, 'h-full'),
9955
+ block: modifiedBlock,
9956
+ }) }, String(i)));
9957
+ };
9955
9958
  const getChildStyle = (index) => SHORT_TILE_INDEXES.includes(index)
9956
9959
  ? 'lg:col-span-1 lg:row-span-1'
9957
9960
  : 'lg:col-span-2 lg:row-span-2';
9958
9961
  const modifyBlock = (block, i) => {
9959
9962
  const content = { ...block.content };
9960
- if (SHORT_TILE_INDEXES.includes(i)) {
9963
+ const isSmallTile = SHORT_TILE_INDEXES.includes(i);
9964
+ if (isSmallTile) {
9961
9965
  delete content.description;
9962
9966
  delete content.benefits;
9967
+ if (content.link?.href) {
9968
+ delete content.buttons;
9969
+ }
9970
+ content.imageOptions = { ...content.imageOptions, className: 'max-w-max !h-auto' };
9963
9971
  }
9964
- if (content.link?.href) {
9965
- delete content.buttons;
9972
+ else {
9973
+ if ((content.buttons ?? []).length) {
9974
+ delete content.link;
9975
+ }
9966
9976
  }
9967
9977
  return { ...block, content };
9968
9978
  };
@@ -11581,7 +11591,7 @@
11581
11591
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
11582
11592
  });
11583
11593
 
11584
- const packageVersion = "0.14.814";
11594
+ const packageVersion = "0.14.816";
11585
11595
 
11586
11596
  exports.Blocks = Blocks;
11587
11597
  exports.ContentPage = ContentPage;