@redneckz/wildless-cms-uni-blocks 0.14.816 → 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 (36) hide show
  1. package/bundle/bundle.umd.js +21 -11
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  4. package/dist/components/GalleryLayout/GalleryLayout.js +18 -8
  5. package/dist/components/GalleryLayout/GalleryLayout.js.map +1 -1
  6. package/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  7. package/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  8. package/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  9. package/lib/common.css +1 -1
  10. package/lib/components/GalleryLayout/GalleryLayout.js +18 -8
  11. package/lib/components/GalleryLayout/GalleryLayout.js.map +1 -1
  12. package/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  13. package/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  14. package/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  15. package/mobile/bundle/bundle.umd.js +21 -11
  16. package/mobile/bundle/bundle.umd.min.js +1 -1
  17. package/mobile/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  18. package/mobile/dist/components/GalleryLayout/GalleryLayout.js +18 -8
  19. package/mobile/dist/components/GalleryLayout/GalleryLayout.js.map +1 -1
  20. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  21. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  22. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  23. package/mobile/lib/common.css +1 -1
  24. package/mobile/lib/components/GalleryLayout/GalleryLayout.js +18 -8
  25. package/mobile/lib/components/GalleryLayout/GalleryLayout.js.map +1 -1
  26. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  27. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  28. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  29. package/mobile/src/components/GalleryLayout/GalleryLayout.tsx +20 -9
  30. package/mobile/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -1
  31. package/mobile/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +2 -0
  32. package/package.json +1 -1
  33. package/src/components/GalleryLayout/GalleryLayout.fixture.tsx +4 -15
  34. package/src/components/GalleryLayout/GalleryLayout.tsx +20 -9
  35. package/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -1
  36. package/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +2 -0
@@ -33,7 +33,7 @@ const LINK_SCHEMA: Record<string, JSONSchema7Definition> = {
33
33
  },
34
34
  },
35
35
  ],
36
- title: 'Ссылка',
36
+ title: 'Ссылка (если заполнено, то кнопка скрывается)',
37
37
  required: ['href'],
38
38
  },
39
39
  };
@@ -109,15 +109,18 @@ const blockDecoratorWrapper =
109
109
 
110
110
  const productBlockDecorator =
111
111
  (idx: number): BlockDecorator =>
112
- ({ blockClassName, block, render }, i) =>
113
- (
114
- <LinkWrapper key={i} {...block.content?.link} className={getChildStyle(idx)}>
112
+ ({ blockClassName, block, render }, i) => {
113
+ const modifiedBlock = modifyBlock(block, idx);
114
+
115
+ return (
116
+ <LinkWrapper key={String(i)} {...modifiedBlock.content?.link} className={getChildStyle(idx)}>
115
117
  {render({
116
118
  blockClassName: style(blockClassName, 'h-full'),
117
- block: modifyBlock(block, idx),
119
+ block: modifiedBlock,
118
120
  })}
119
121
  </LinkWrapper>
120
122
  );
123
+ };
121
124
 
122
125
  const getChildStyle = (index: number) =>
123
126
  SHORT_TILE_INDEXES.includes(index)
@@ -127,13 +130,21 @@ const getChildStyle = (index: number) =>
127
130
  const modifyBlock = (block: BlockDef, i: number) => {
128
131
  const content: ProductBlockContent & { link?: LinkProps } = { ...block.content };
129
132
 
130
- if (SHORT_TILE_INDEXES.includes(i)) {
133
+ const isSmallTile = SHORT_TILE_INDEXES.includes(i);
134
+
135
+ if (isSmallTile) {
131
136
  delete content.description;
132
137
  delete content.benefits;
133
- }
134
138
 
135
- if (content.link?.href) {
136
- delete content.buttons;
139
+ if (content.link?.href) {
140
+ delete content.buttons;
141
+ }
142
+
143
+ content.imageOptions = { ...content.imageOptions, className: 'max-w-max !h-auto' };
144
+ } else {
145
+ if ((content.buttons ?? []).length) {
146
+ delete content.link;
147
+ }
137
148
  }
138
149
 
139
150
  return { ...block, content };
@@ -54,12 +54,13 @@ export const BaseProductTile = JSX<BaseProductTileProps>(
54
54
  directionRight = true,
55
55
  isImageAlwaysOnRight,
56
56
  isImageSecondary = false,
57
+ className: imageClassName,
57
58
  } = {},
58
59
  backwardButton,
59
60
  children,
60
61
  ...rest
61
62
  }) => {
62
- const img = image?.src ? <Img image={image} /> : null;
63
+ const img = image?.src ? <Img image={image} imageClassName={imageClassName} /> : null;
63
64
  const headline = (
64
65
  <Headline
65
66
  title={title}
@@ -19,6 +19,8 @@ export interface TileImageOptions {
19
19
  isImageSecondary?: boolean;
20
20
  /** @title Изображение всегда справа */
21
21
  isImageAlwaysOnRight?: boolean;
22
+ /** @hidden */
23
+ className?: string;
22
24
  }
23
25
 
24
26
  /** @title Цены */