@redneckz/wildless-cms-uni-blocks 0.14.814 → 0.14.816
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/UniBlock/UniBlock.d.ts +3 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +86 -19
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/GalleryLayout/GalleryLayout.d.ts +5 -0
- package/bundle/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
- package/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/dist/BlockRenderer/renderBlock.js +1 -1
- package/dist/BlockRenderer/renderBlock.js.map +1 -1
- package/dist/UniBlock/UniBlock.d.ts +3 -1
- package/dist/UniBlock/UniBlock.js.map +1 -1
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Blocks.mobile.js +2 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/dist/components/GalleryLayout/GalleryLayout.d.ts +5 -0
- package/dist/components/GalleryLayout/GalleryLayout.js +71 -0
- package/dist/components/GalleryLayout/GalleryLayout.js.map +1 -0
- package/dist/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
- package/dist/components/GalleryLayout/GalleryLayoutContent.js +2 -0
- package/dist/components/GalleryLayout/GalleryLayoutContent.js.map +1 -0
- package/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/dist/ui-kit/BaseProductTile/BaseProductTile.js +8 -1
- package/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/dist/ui-kit/BaseTile/BaseTile.js +3 -3
- package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/lib/BlockRenderer/renderBlock.js +1 -1
- package/lib/BlockRenderer/renderBlock.js.map +1 -1
- package/lib/UniBlock/UniBlock.d.ts +3 -1
- package/lib/UniBlock/UniBlock.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
- package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Blocks.mobile.js +2 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/lib/components/GalleryLayout/GalleryLayout.d.ts +5 -0
- package/lib/components/GalleryLayout/GalleryLayout.fixture.d.ts +5 -0
- package/lib/components/GalleryLayout/GalleryLayout.js +69 -0
- package/lib/components/GalleryLayout/GalleryLayout.js.map +1 -0
- package/lib/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
- package/lib/components/GalleryLayout/GalleryLayoutContent.js +2 -0
- package/lib/components/GalleryLayout/GalleryLayoutContent.js.map +1 -0
- package/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/lib/ui-kit/BaseProductTile/BaseProductTile.js +9 -2
- package/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/lib/ui-kit/BaseTile/BaseTile.js +3 -3
- package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/bundle/UniBlock/UniBlock.d.ts +3 -1
- package/mobile/bundle/bundle.umd.js +86 -19
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/GalleryLayout/GalleryLayout.d.ts +5 -0
- package/mobile/bundle/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
- package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/dist/BlockRenderer/renderBlock.js +1 -1
- package/mobile/dist/BlockRenderer/renderBlock.js.map +1 -1
- package/mobile/dist/UniBlock/UniBlock.d.ts +3 -1
- package/mobile/dist/UniBlock/UniBlock.js.map +1 -1
- package/mobile/dist/components/Blocks.js +2 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/dist/components/GalleryLayout/GalleryLayout.d.ts +5 -0
- package/mobile/dist/components/GalleryLayout/GalleryLayout.js +71 -0
- package/mobile/dist/components/GalleryLayout/GalleryLayout.js.map +1 -0
- package/mobile/dist/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
- package/mobile/dist/components/GalleryLayout/GalleryLayoutContent.js +2 -0
- package/mobile/dist/components/GalleryLayout/GalleryLayoutContent.js.map +1 -0
- package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js +8 -1
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js +3 -3
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/lib/BlockRenderer/renderBlock.js +1 -1
- package/mobile/lib/BlockRenderer/renderBlock.js.map +1 -1
- package/mobile/lib/UniBlock/UniBlock.d.ts +3 -1
- package/mobile/lib/UniBlock/UniBlock.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Blocks.js +2 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/lib/components/GalleryLayout/GalleryLayout.d.ts +5 -0
- package/mobile/lib/components/GalleryLayout/GalleryLayout.js +69 -0
- package/mobile/lib/components/GalleryLayout/GalleryLayout.js.map +1 -0
- package/mobile/lib/components/GalleryLayout/GalleryLayoutContent.d.ts +14 -0
- package/mobile/lib/components/GalleryLayout/GalleryLayoutContent.js +2 -0
- package/mobile/lib/components/GalleryLayout/GalleryLayoutContent.js.map +1 -0
- package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js +9 -2
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js +3 -3
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/src/BlockRenderer/renderBlock.tsx +3 -3
- package/mobile/src/UniBlock/UniBlock.tsx +3 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +87 -0
- package/mobile/src/components/Blocks.ts +2 -0
- package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +1 -0
- package/mobile/src/components/GalleryLayout/GalleryLayout.example.json +102 -0
- package/mobile/src/components/GalleryLayout/GalleryLayout.tsx +140 -0
- package/mobile/src/components/GalleryLayout/GalleryLayout.ui.json +1 -0
- package/mobile/src/components/GalleryLayout/GalleryLayoutContent.ts +16 -0
- package/mobile/src/model/FormTypeFieldDef.ts +2 -1
- package/mobile/src/ui-kit/BaseProductTile/BaseProductTile.tsx +60 -23
- package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +11 -7
- package/package.json +2 -2
- package/src/BlockRenderer/renderBlock.tsx +3 -3
- package/src/UniBlock/UniBlock.tsx +3 -1
- package/src/components/ApplicationForm/ApplicationForm.example.json +87 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +60 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +60 -0
- package/src/components/Blocks.mobile.ts +2 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +1 -0
- package/src/components/GalleryLayout/GalleryLayout.example.json +102 -0
- package/src/components/GalleryLayout/GalleryLayout.fixture.tsx +61 -0
- package/src/components/GalleryLayout/GalleryLayout.tsx +140 -0
- package/src/components/GalleryLayout/GalleryLayout.ui.json +1 -0
- package/src/components/GalleryLayout/GalleryLayoutContent.ts +16 -0
- package/src/model/FormTypeFieldDef.ts +2 -1
- package/src/ui-kit/BaseProductTile/BaseProductTile.tsx +60 -23
- package/src/ui-kit/BaseTile/BaseTile.tsx +11 -7
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { Headline } from '../../components/Headline/Headline';
|
|
3
|
+
import { type Align } from '../../model/Align';
|
|
3
4
|
import { type HeadlineVersion } from '../../model/HeadlineType';
|
|
5
|
+
import { type IconVersion } from '../../model/IconVersion';
|
|
4
6
|
import { type VNode } from '../../model/VNode';
|
|
5
7
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
6
8
|
import { BaseTile } from '../BaseTile/BaseTile';
|
|
9
|
+
import { type BenefitItemContent } from '../BenefitItem/BenefitItemContent';
|
|
7
10
|
import { BenefitsList } from '../BenefitsList/BenefitsList';
|
|
8
11
|
import { Img } from '../Img/Img';
|
|
9
12
|
import { renderButtonsSection } from '../LinkButton/renderButtonsSection';
|
|
10
13
|
import { PriceList } from '../PriceList/PriceList';
|
|
11
14
|
import { RichText } from '../RichText/RichText';
|
|
12
|
-
import { type RichTextItemSize } from '../RichText/RichTextProps';
|
|
15
|
+
import { type RichTextItemSize, type RichVersion } from '../RichText/RichTextProps';
|
|
13
16
|
import { Tags } from '../Tags/Tags';
|
|
14
|
-
import { type BaseProductTileContent } from './BaseProductTileContent';
|
|
17
|
+
import { type BaseProductTileContent, type PriceItem } from './BaseProductTileContent';
|
|
15
18
|
|
|
16
19
|
const RICHTEXT_SIZE: Record<HeadlineVersion, RichTextItemSize> = {
|
|
17
20
|
XXL: 'list-l',
|
|
@@ -47,7 +50,7 @@ export const BaseProductTile = JSX<BaseProductTileProps>(
|
|
|
47
50
|
buttons,
|
|
48
51
|
image,
|
|
49
52
|
imageOptions: {
|
|
50
|
-
imageAlign = 'center',
|
|
53
|
+
imageAlign = 'center' as Align,
|
|
51
54
|
directionRight = true,
|
|
52
55
|
isImageAlwaysOnRight,
|
|
53
56
|
isImageSecondary = false,
|
|
@@ -84,31 +87,65 @@ export const BaseProductTile = JSX<BaseProductTileProps>(
|
|
|
84
87
|
backwardButton={backwardButton}
|
|
85
88
|
{...rest}
|
|
86
89
|
>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
) : null}
|
|
95
|
-
{__html ? (
|
|
96
|
-
<RichText
|
|
97
|
-
richVersion={richVersion}
|
|
98
|
-
__html={__html}
|
|
99
|
-
isDotted={isDotted}
|
|
100
|
-
itemSize={RICHTEXT_SIZE[headlineVersion]}
|
|
101
|
-
/>
|
|
102
|
-
) : null}
|
|
103
|
-
{children}
|
|
104
|
-
{priceList?.length ? <PriceList priceList={priceList} /> : null}
|
|
105
|
-
{renderTags(tags)}
|
|
106
|
-
</div>
|
|
90
|
+
{renderChildList(
|
|
91
|
+
renderBenefits(filteredBenefits, { benefitsVersion, isTabularBenefits }),
|
|
92
|
+
renderRichText(__html, { richVersion, isDotted, headlineVersion }),
|
|
93
|
+
children,
|
|
94
|
+
renderPriceList(priceList),
|
|
95
|
+
renderTags(tags),
|
|
96
|
+
)}
|
|
107
97
|
</BaseTile>
|
|
108
98
|
);
|
|
109
99
|
},
|
|
110
100
|
);
|
|
111
101
|
|
|
102
|
+
const renderBenefits = (
|
|
103
|
+
benefits?: BenefitItemContent[],
|
|
104
|
+
{
|
|
105
|
+
benefitsVersion,
|
|
106
|
+
isTabularBenefits,
|
|
107
|
+
}: { benefitsVersion?: IconVersion; isTabularBenefits?: boolean } = {},
|
|
108
|
+
) =>
|
|
109
|
+
benefits?.length ? (
|
|
110
|
+
<BenefitsList
|
|
111
|
+
benefitsVersion={benefitsVersion}
|
|
112
|
+
isTabularBenefits={isTabularBenefits}
|
|
113
|
+
benefits={benefits}
|
|
114
|
+
/>
|
|
115
|
+
) : null;
|
|
116
|
+
|
|
117
|
+
const renderRichText = (
|
|
118
|
+
__html?: string,
|
|
119
|
+
{
|
|
120
|
+
richVersion,
|
|
121
|
+
isDotted,
|
|
122
|
+
headlineVersion,
|
|
123
|
+
}: { richVersion?: RichVersion; isDotted?: boolean; headlineVersion?: HeadlineVersion } = {},
|
|
124
|
+
) =>
|
|
125
|
+
__html ? (
|
|
126
|
+
<RichText
|
|
127
|
+
__html={__html}
|
|
128
|
+
richVersion={richVersion}
|
|
129
|
+
isDotted={isDotted}
|
|
130
|
+
itemSize={RICHTEXT_SIZE[headlineVersion ?? 'L']}
|
|
131
|
+
/>
|
|
132
|
+
) : null;
|
|
133
|
+
|
|
134
|
+
const renderPriceList = (priceList?: PriceItem[]) =>
|
|
135
|
+
priceList?.length ? <PriceList priceList={priceList} /> : null;
|
|
136
|
+
|
|
137
|
+
const renderChildList = (...elements: VNode[]) => {
|
|
138
|
+
const cleanElements = elements.filter(Boolean);
|
|
139
|
+
|
|
140
|
+
return cleanElements.length ? (
|
|
141
|
+
<div className="flex flex-col sm:gap-xl gap-4xl">
|
|
142
|
+
{cleanElements.map((_, i) => (
|
|
143
|
+
<div key={String(i)}>{_}</div>
|
|
144
|
+
))}
|
|
145
|
+
</div>
|
|
146
|
+
) : null;
|
|
147
|
+
};
|
|
148
|
+
|
|
112
149
|
export const leftOrRightImage = (img: VNode, directionRight: boolean) =>
|
|
113
150
|
directionRight ? { rightImage: img } : { leftImage: img };
|
|
114
151
|
|
|
@@ -55,7 +55,7 @@ export const BaseTile = JSX<BaseTileProps>(
|
|
|
55
55
|
)}
|
|
56
56
|
>
|
|
57
57
|
{isBackBtn && renderBackwardButton({ version, handleClick, text: backwardButtonText })}
|
|
58
|
-
{title ? <div className="relative
|
|
58
|
+
{title ? <div className="relative">{title}</div> : null}
|
|
59
59
|
<div
|
|
60
60
|
className={style('grow relative flex flex-col @xl:flex-row gap-3xl w-full', {
|
|
61
61
|
'self-start @xl:w-auto': leftImage,
|
|
@@ -69,14 +69,10 @@ export const BaseTile = JSX<BaseTileProps>(
|
|
|
69
69
|
'@xl:grid-cols-2 auto-cols-fr': rightImage,
|
|
70
70
|
grow: !leftImage,
|
|
71
71
|
},
|
|
72
|
-
'h-
|
|
73
|
-
'auto-rows-[max-content_1fr]', //? fix issue https://github.com/redneckz/temp_wcms/issues/1324
|
|
72
|
+
'h-auto',
|
|
74
73
|
)}
|
|
75
74
|
>
|
|
76
|
-
|
|
77
|
-
{insetTitle}
|
|
78
|
-
{children}
|
|
79
|
-
</div>
|
|
75
|
+
{renderMiddleContent(insetTitle, children)}
|
|
80
76
|
{renderUnitContainer(
|
|
81
77
|
renderChildren({ ...rest, extraProps: { className: '@container-normal' } }),
|
|
82
78
|
)}
|
|
@@ -96,6 +92,14 @@ export const BaseTile = JSX<BaseTileProps>(
|
|
|
96
92
|
},
|
|
97
93
|
);
|
|
98
94
|
|
|
95
|
+
const renderMiddleContent = (insetTitle: VNode, children: VNode) =>
|
|
96
|
+
insetTitle || children ? (
|
|
97
|
+
<div className="grow space-y-lg min-w-fit">
|
|
98
|
+
{insetTitle}
|
|
99
|
+
{children}
|
|
100
|
+
</div>
|
|
101
|
+
) : null;
|
|
102
|
+
|
|
99
103
|
const imageAlwaysOnRightContainerStyle = (isImage: boolean) =>
|
|
100
104
|
style(isImage ? 'row-span-2' : '@xl:row-span-2');
|
|
101
105
|
|