@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.
- package/bundle/bundle.umd.js +21 -11
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
- package/dist/components/GalleryLayout/GalleryLayout.js +18 -8
- package/dist/components/GalleryLayout/GalleryLayout.js.map +1 -1
- package/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
- package/lib/common.css +1 -1
- package/lib/components/GalleryLayout/GalleryLayout.js +18 -8
- package/lib/components/GalleryLayout/GalleryLayout.js.map +1 -1
- package/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
- package/mobile/bundle/bundle.umd.js +21 -11
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
- package/mobile/dist/components/GalleryLayout/GalleryLayout.js +18 -8
- package/mobile/dist/components/GalleryLayout/GalleryLayout.js.map +1 -1
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/GalleryLayout/GalleryLayout.js +18 -8
- package/mobile/lib/components/GalleryLayout/GalleryLayout.js.map +1 -1
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
- package/mobile/src/components/GalleryLayout/GalleryLayout.tsx +20 -9
- package/mobile/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -1
- package/mobile/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +2 -0
- package/package.json +1 -1
- package/src/components/GalleryLayout/GalleryLayout.fixture.tsx +4 -15
- package/src/components/GalleryLayout/GalleryLayout.tsx +20 -9
- package/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -1
- 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
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
136
|
-
|
|
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}
|