@redneckz/wildless-cms-uni-blocks 0.3.75 → 0.3.77
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +19 -21
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Accordion/AccordionContent.d.ts +4 -1
- package/dist/components/Calculator/renderRate.js +1 -1
- package/dist/components/Calculator/renderRate.js.map +1 -1
- package/dist/components/Catalog/Catalog.js +2 -2
- package/dist/components/Catalog/Catalog.js.map +1 -1
- package/dist/components/Catalog/CatalogContent.d.ts +1 -0
- package/dist/components/GroupBlock/GroupBlockContent.d.ts +2 -2
- package/dist/components/LinkDocs/LinkDocsContent.d.ts +10 -1
- package/dist/components/PictureText/PictureTextContent.d.ts +1 -0
- package/dist/components/ProductTile/ProductTile.js +7 -8
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +3 -2
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +2 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -0
- package/dist/model/Picture.d.ts +6 -0
- package/dist/ui-kit/BlocksList/BlocksListProps.d.ts +10 -10
- package/dist/ui-kit/Button/ButtonInner.js +2 -2
- package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/dist/ui-kit/Foldable/Foldable.js +1 -1
- package/dist/ui-kit/Foldable/Foldable.js.map +1 -1
- package/dist/ui-kit/Img/Img.js +2 -6
- package/dist/ui-kit/Img/Img.js.map +1 -1
- package/dist/utils/checkIsIconRenderable.d.ts +2 -0
- package/dist/utils/checkIsIconRenderable.js +5 -0
- package/dist/utils/checkIsIconRenderable.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Accordion/AccordionContent.d.ts +4 -1
- package/lib/components/Calculator/renderRate.js +1 -1
- package/lib/components/Calculator/renderRate.js.map +1 -1
- package/lib/components/Catalog/Catalog.js +2 -2
- package/lib/components/Catalog/Catalog.js.map +1 -1
- package/lib/components/Catalog/CatalogContent.d.ts +1 -0
- package/lib/components/GroupBlock/GroupBlockContent.d.ts +2 -2
- package/lib/components/LinkDocs/LinkDocsContent.d.ts +10 -1
- package/lib/components/PictureText/PictureTextContent.d.ts +1 -0
- package/lib/components/ProductTile/ProductTile.js +7 -8
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.js +3 -2
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +2 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -0
- package/lib/model/Picture.d.ts +6 -0
- package/lib/ui-kit/BlocksList/BlocksListProps.d.ts +10 -10
- package/lib/ui-kit/Button/ButtonInner.js +2 -2
- package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/lib/ui-kit/Foldable/Foldable.js +1 -1
- package/lib/ui-kit/Foldable/Foldable.js.map +1 -1
- package/lib/ui-kit/Img/Img.js +2 -6
- package/lib/ui-kit/Img/Img.js.map +1 -1
- package/lib/utils/checkIsIconRenderable.d.ts +2 -0
- package/lib/utils/checkIsIconRenderable.js +2 -0
- package/lib/utils/checkIsIconRenderable.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +5 -3
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/Accordion/AccordionContent.d.ts +4 -1
- package/mobile/dist/components/Calculator/renderRate.js +1 -1
- package/mobile/dist/components/Calculator/renderRate.js.map +1 -1
- package/mobile/dist/components/Catalog/Catalog.js +2 -2
- package/mobile/dist/components/Catalog/Catalog.js.map +1 -1
- package/mobile/dist/components/Catalog/CatalogContent.d.ts +1 -0
- package/mobile/dist/components/GroupBlock/GroupBlockContent.d.ts +2 -2
- package/mobile/dist/components/LinkDocs/LinkDocsContent.d.ts +10 -1
- package/mobile/dist/components/PictureText/PictureTextContent.d.ts +1 -0
- package/mobile/dist/components/ProductTile/ProductTile.js +7 -8
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js +2 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -0
- package/mobile/dist/model/Picture.d.ts +6 -0
- package/mobile/dist/ui-kit/BlocksList/BlocksListProps.d.ts +10 -10
- package/mobile/dist/ui-kit/Button/ButtonInner.js +2 -2
- package/mobile/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/dist/ui-kit/Foldable/Foldable.js +1 -1
- package/mobile/dist/ui-kit/Foldable/Foldable.js.map +1 -1
- package/mobile/dist/utils/checkIsIconRenderable.d.ts +2 -0
- package/mobile/dist/utils/checkIsIconRenderable.js +5 -0
- package/mobile/dist/utils/checkIsIconRenderable.js.map +1 -0
- package/mobile/lib/components/Accordion/AccordionContent.d.ts +4 -1
- package/mobile/lib/components/Calculator/renderRate.js +1 -1
- package/mobile/lib/components/Calculator/renderRate.js.map +1 -1
- package/mobile/lib/components/Catalog/Catalog.js +2 -2
- package/mobile/lib/components/Catalog/Catalog.js.map +1 -1
- package/mobile/lib/components/Catalog/CatalogContent.d.ts +1 -0
- package/mobile/lib/components/GroupBlock/GroupBlockContent.d.ts +2 -2
- package/mobile/lib/components/LinkDocs/LinkDocsContent.d.ts +10 -1
- package/mobile/lib/components/PictureText/PictureTextContent.d.ts +1 -0
- package/mobile/lib/components/ProductTile/ProductTile.js +7 -8
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js +2 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -0
- package/mobile/lib/model/Picture.d.ts +6 -0
- package/mobile/lib/ui-kit/BlocksList/BlocksListProps.d.ts +10 -10
- package/mobile/lib/ui-kit/Button/ButtonInner.js +2 -2
- package/mobile/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/lib/ui-kit/Foldable/Foldable.js +1 -1
- package/mobile/lib/ui-kit/Foldable/Foldable.js.map +1 -1
- package/mobile/lib/utils/checkIsIconRenderable.d.ts +2 -0
- package/mobile/lib/utils/checkIsIconRenderable.js +2 -0
- package/mobile/lib/utils/checkIsIconRenderable.js.map +1 -0
- package/mobile/src/components/Accordion/Accordion.example.json +13 -6
- package/mobile/src/components/Accordion/AccordionContent.ts +4 -1
- package/mobile/src/components/Calculator/renderRate.tsx +1 -3
- package/mobile/src/components/Catalog/Catalog.tsx +2 -1
- package/mobile/src/components/Catalog/CatalogContent.ts +1 -0
- package/mobile/src/components/ContentPage/ContentPage.page.json +1 -1
- package/mobile/src/components/GroupBlock/GroupBlock.example.json +72 -3
- package/mobile/src/components/GroupBlock/GroupBlockContent.ts +2 -2
- package/mobile/src/components/LinkDocs/LinkDocsContent.ts +10 -1
- package/mobile/src/components/OtherProducts/OtherProducts.example.json +12 -6
- package/mobile/src/components/PictureText/PictureTextContent.ts +1 -0
- package/mobile/src/components/ProductBlock/ProductBlock.example.json +3 -10
- package/mobile/src/components/ProductTile/ProductTile.example.json +1 -2
- package/mobile/src/components/ProductTile/ProductTile.tsx +28 -30
- package/mobile/src/components/PromoTile/PromoTile.example.json +1 -2
- package/mobile/src/components/StepsBlock/StepsBlock.example.json +18 -3
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +6 -1
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +11 -0
- package/mobile/src/components/Tile/Tile.example.json +2 -9
- package/mobile/src/model/Picture.ts +7 -0
- package/mobile/src/ui-kit/BlocksList/BlocksListProps.ts +42 -20
- package/mobile/src/ui-kit/Button/ButtonInner.tsx +2 -2
- package/mobile/src/ui-kit/Foldable/Foldable.tsx +1 -1
- package/mobile/src/utils/checkIsIconRenderable.tsx +3 -0
- package/package.json +2 -2
- package/src/components/Accordion/Accordion.example.json +13 -6
- package/src/components/Accordion/AccordionContent.ts +4 -1
- package/src/components/Calculator/renderRate.tsx +1 -3
- package/src/components/Catalog/Catalog.tsx +2 -1
- package/src/components/Catalog/CatalogContent.ts +1 -0
- package/src/components/ContentPage/ContentPage.page.json +1 -1
- package/src/components/GroupBlock/GroupBlock.example.json +72 -3
- package/src/components/GroupBlock/GroupBlockContent.ts +2 -2
- package/src/components/LinkDocs/LinkDocsContent.ts +10 -1
- package/src/components/OtherProducts/OtherProducts.example.json +12 -6
- package/src/components/PictureText/PictureTextContent.ts +1 -0
- package/src/components/ProductBlock/ProductBlock.example.json +3 -10
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +2 -2
- package/src/components/ProductTile/ProductTile.example.json +1 -2
- package/src/components/ProductTile/ProductTile.tsx +28 -30
- package/src/components/PromoTile/PromoTile.example.json +1 -2
- package/src/components/StepsBlock/StepsBlock.example.json +18 -3
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +6 -1
- package/src/components/StepsBlock/StepsBlock.tsx +19 -13
- package/src/components/StepsBlock/StepsBlockContent.ts +11 -0
- package/src/components/Tile/Tile.example.json +2 -9
- package/src/model/Picture.ts +7 -0
- package/src/ui-kit/BlocksList/BlocksListProps.ts +42 -20
- package/src/ui-kit/Button/ButtonInner.tsx +2 -2
- package/src/ui-kit/Foldable/Foldable.tsx +1 -1
- package/src/ui-kit/Img/Img.tsx +9 -16
- package/src/utils/checkIsIconRenderable.tsx +3 -0
package/src/model/Picture.ts
CHANGED
|
@@ -10,6 +10,12 @@ export interface Img {
|
|
|
10
10
|
title?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* @title Брейкпоинт
|
|
15
|
+
* @enumNames ["1919px и меньше", "1439px и меньше", "1279px и меньше"]
|
|
16
|
+
*/
|
|
17
|
+
export type MediaQuery = '(max-width: 1919px)' | '(max-width: 1439px)' | '(max-width: 1279px)';
|
|
18
|
+
|
|
13
19
|
export interface ImgSource {
|
|
14
20
|
/** @title Иконка */
|
|
15
21
|
icon?: IconName;
|
|
@@ -20,6 +26,7 @@ export interface ImgSource {
|
|
|
20
26
|
format?: 'jpeg' | 'jpg' | 'png' | 'gif' | 'webp' | 'heif' | 'avif';
|
|
21
27
|
/** @hidden */
|
|
22
28
|
options?: Record<string, any>;
|
|
29
|
+
media?: MediaQuery;
|
|
23
30
|
/** @title Размер изображения */
|
|
24
31
|
size?: {
|
|
25
32
|
/** @title Ширина */
|
|
@@ -27,71 +27,93 @@ export interface BlocksCommonProps {
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* @title Заголовок
|
|
30
|
-
* @default {"blockListType": "Headline"}
|
|
31
30
|
*/
|
|
32
31
|
export type HeadlineBlockListDef = HeadlineContent &
|
|
33
|
-
BlocksCommonProps & {
|
|
32
|
+
BlocksCommonProps & {
|
|
33
|
+
/** @default Headline */
|
|
34
|
+
blockListType: 'Headline';
|
|
35
|
+
};
|
|
34
36
|
|
|
35
37
|
/**
|
|
36
38
|
* @title Список документов
|
|
37
|
-
* @default {"blockListType": "LinkDocs"}
|
|
38
39
|
*/
|
|
39
40
|
export type LinkDocsBlockListDef = LinkDocsContent &
|
|
40
|
-
BlocksCommonProps & {
|
|
41
|
+
BlocksCommonProps & {
|
|
42
|
+
/** @default LinkDocs */
|
|
43
|
+
blockListType: 'LinkDocs';
|
|
44
|
+
};
|
|
41
45
|
|
|
42
46
|
/**
|
|
43
47
|
* @title Текстовый блок
|
|
44
|
-
* @default {"blockListType": "TextBlock"}
|
|
45
48
|
*/
|
|
46
49
|
export type TextBlockBlockListDef = TextBlockContent &
|
|
47
|
-
BlocksCommonProps & {
|
|
50
|
+
BlocksCommonProps & {
|
|
51
|
+
/** @default TextBlock */
|
|
52
|
+
blockListType: 'TextBlock';
|
|
53
|
+
};
|
|
48
54
|
|
|
49
55
|
/**
|
|
50
56
|
* @title Картинка с текстом
|
|
51
|
-
* @default {"blockListType": "PictureText"}
|
|
52
57
|
*/
|
|
53
58
|
export type PictureTextBlockListDef = PictureTextContent &
|
|
54
|
-
BlocksCommonProps & {
|
|
59
|
+
BlocksCommonProps & {
|
|
60
|
+
/** @default PictureText */
|
|
61
|
+
blockListType: 'PictureText';
|
|
62
|
+
};
|
|
55
63
|
|
|
56
64
|
/**
|
|
57
65
|
* @title Продуктовый блок
|
|
58
|
-
* @default {"blockListType": "ProductBlock"}
|
|
59
66
|
*/
|
|
60
67
|
export type ProductBlockBlockListDef = ProductBlockContent &
|
|
61
|
-
BlocksCommonProps & {
|
|
68
|
+
BlocksCommonProps & {
|
|
69
|
+
/** @default ProductBlock */
|
|
70
|
+
blockListType: 'ProductBlock';
|
|
71
|
+
};
|
|
62
72
|
|
|
63
73
|
/**
|
|
64
74
|
* @title Плитка
|
|
65
|
-
* @default {"blockListType": "Tile"}
|
|
66
75
|
*/
|
|
67
|
-
export type TileBlockListDef = TileContent &
|
|
76
|
+
export type TileBlockListDef = TileContent &
|
|
77
|
+
BlocksCommonProps & {
|
|
78
|
+
/** @default Tile */
|
|
79
|
+
blockListType: 'Tile';
|
|
80
|
+
};
|
|
68
81
|
|
|
69
82
|
/**
|
|
70
83
|
* @title Продуктовая плитка
|
|
71
|
-
* @default {"blockListType": "ProductTile"}
|
|
72
84
|
*/
|
|
73
85
|
export type ProductTileBlockListDef = ProductTileContent &
|
|
74
|
-
BlocksCommonProps & {
|
|
86
|
+
BlocksCommonProps & {
|
|
87
|
+
/** @default ProductTile */
|
|
88
|
+
blockListType: 'ProductTile';
|
|
89
|
+
};
|
|
75
90
|
|
|
76
91
|
/**
|
|
77
92
|
* @title Галерея
|
|
78
|
-
* @default {"blockListType": "Gallery"}
|
|
79
93
|
*/
|
|
80
|
-
export type GalleryBlockListDef = GalleryContent &
|
|
94
|
+
export type GalleryBlockListDef = GalleryContent &
|
|
95
|
+
BlocksCommonProps & {
|
|
96
|
+
/** @default Gallery */
|
|
97
|
+
blockListType: 'Gallery';
|
|
98
|
+
};
|
|
81
99
|
|
|
82
100
|
/**
|
|
83
101
|
* @title Мини-галлерея
|
|
84
|
-
* @default {"blockListType": "MiniGallery"}
|
|
85
102
|
*/
|
|
86
103
|
export type MiniGalleryBlockListDef = MiniGalleryContent &
|
|
87
|
-
BlocksCommonProps & {
|
|
104
|
+
BlocksCommonProps & {
|
|
105
|
+
/** @default MiniGallery */
|
|
106
|
+
blockListType: 'MiniGallery';
|
|
107
|
+
};
|
|
88
108
|
|
|
89
109
|
/**
|
|
90
110
|
* @title Список ссылок
|
|
91
|
-
* @default {"blockListType": "LinkList"}
|
|
92
111
|
*/
|
|
93
112
|
export type LinkListBlockListDef = LinkListContent &
|
|
94
|
-
BlocksCommonProps & {
|
|
113
|
+
BlocksCommonProps & {
|
|
114
|
+
/** @default LinkList */
|
|
115
|
+
blockListType: 'LinkList';
|
|
116
|
+
};
|
|
95
117
|
|
|
96
118
|
/**
|
|
97
119
|
* @title Содержимое блока
|
|
@@ -15,7 +15,7 @@ export const ButtonInner = JSX<ButtonInnerProps>((props) => {
|
|
|
15
15
|
{isWithText(props) ? (
|
|
16
16
|
<div>
|
|
17
17
|
<div className="text-m-2xs font-light text-left">{aboveText}</div>
|
|
18
|
-
<div className="text-
|
|
18
|
+
<div className="text-base text-left">{text}</div>
|
|
19
19
|
</div>
|
|
20
20
|
) : null}
|
|
21
21
|
{appendRight ? appendRight : null}
|
|
@@ -30,7 +30,7 @@ const getButtonStyle = (props: ButtonInnerProps) => {
|
|
|
30
30
|
return '';
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
const withTextStyle = `px-
|
|
33
|
+
const withTextStyle = `px-9 gap-2 ${aboveText ? 'py-2' : 'py-4'}`;
|
|
34
34
|
|
|
35
35
|
return [
|
|
36
36
|
'flex items-center justify-center',
|
|
@@ -59,7 +59,7 @@ export const Foldable = JSX<FoldableProps>(
|
|
|
59
59
|
onClick={handleToggle}
|
|
60
60
|
>
|
|
61
61
|
<span className="pr-3">{isActive ? 'Скрыть' : foldButtonLabel}</span>
|
|
62
|
-
{icon
|
|
62
|
+
{icon ? <Icon name={icon} iconVersion="white" width="20" height="20" asSVG /> : null}
|
|
63
63
|
</button>
|
|
64
64
|
) : null}
|
|
65
65
|
</div>
|
package/src/ui-kit/Img/Img.tsx
CHANGED
|
@@ -43,8 +43,14 @@ export const ImgAsPicture = JSX<ImageProps<Picture>>(
|
|
|
43
43
|
return (
|
|
44
44
|
<picture className={`flex-none ${className}`}>
|
|
45
45
|
{image?.sources?.length
|
|
46
|
-
? image.sources.map(({ src, format }, index) => (
|
|
47
|
-
<source
|
|
46
|
+
? image.sources.map(({ src, format, media, size }, index) => (
|
|
47
|
+
<source
|
|
48
|
+
key={`${index}_${src}`}
|
|
49
|
+
srcSet={src}
|
|
50
|
+
type={formatToMimeType(format)}
|
|
51
|
+
media={media}
|
|
52
|
+
{...size}
|
|
53
|
+
/>
|
|
48
54
|
))
|
|
49
55
|
: null}
|
|
50
56
|
{renderImg(image, imageClassName)}
|
|
@@ -54,23 +60,10 @@ export const ImgAsPicture = JSX<ImageProps<Picture>>(
|
|
|
54
60
|
);
|
|
55
61
|
|
|
56
62
|
const renderImg = (image: Picture, imageClassName = '') => {
|
|
57
|
-
const style = {
|
|
58
|
-
width: image.size?.width ? `${image.size?.width}px` : '100%',
|
|
59
|
-
height: image.size?.height ? `${image.size?.height}px` : '100%',
|
|
60
|
-
};
|
|
61
63
|
const title = image.title || '';
|
|
62
64
|
const alt = image.alt || image.title;
|
|
63
65
|
|
|
64
|
-
return
|
|
65
|
-
<img
|
|
66
|
-
src={image.src}
|
|
67
|
-
className={imageClassName}
|
|
68
|
-
alt={alt}
|
|
69
|
-
title={title}
|
|
70
|
-
style={style}
|
|
71
|
-
{...image.size}
|
|
72
|
-
/>
|
|
73
|
-
);
|
|
66
|
+
return <img src={image.src} className={imageClassName} alt={alt} title={title} {...image.size} />;
|
|
74
67
|
};
|
|
75
68
|
|
|
76
69
|
export function formatToMimeType(format: ImgSource['format']): string | undefined {
|