@redneckz/wildless-cms-uni-blocks 0.7.7 → 0.7.9
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/bin/migration-scripts/0.7.8.js +29 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +40 -17
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/PictureText/renderBenefit.d.ts +4 -0
- package/bundle/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/bundle/ui-kit/SlideCheckbox/SlideCheckbox.d.ts +7 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/dist/components/ErrorBlock/ErrorBlock.js +3 -1
- package/dist/components/ErrorBlock/ErrorBlock.js.map +1 -1
- package/dist/components/Header/DropdownMenu.js +4 -1
- package/dist/components/Header/DropdownMenu.js.map +1 -1
- package/dist/components/OtherProductsItem/OtherProductsItem.js +3 -1
- package/dist/components/OtherProductsItem/OtherProductsItem.js.map +1 -1
- package/dist/components/PictureText/PictureText.js +2 -3
- package/dist/components/PictureText/PictureText.js.map +1 -1
- package/dist/components/PictureText/renderBenefit.d.ts +4 -0
- package/dist/components/PictureText/renderBenefit.js +25 -0
- package/dist/components/PictureText/renderBenefit.js.map +1 -0
- package/dist/components/ProductTile/renderBenefit.js +1 -1
- package/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/dist/ui-kit/SlideCheckbox/SlideCheckbox.d.ts +7 -0
- package/dist/ui-kit/SlideCheckbox/SlideCheckbox.js +7 -0
- package/dist/ui-kit/SlideCheckbox/SlideCheckbox.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/lib/components/ErrorBlock/ErrorBlock.js +3 -1
- package/lib/components/ErrorBlock/ErrorBlock.js.map +1 -1
- package/lib/components/Header/DropdownMenu.js +4 -1
- package/lib/components/Header/DropdownMenu.js.map +1 -1
- package/lib/components/OtherProductsItem/OtherProductsItem.js +3 -1
- package/lib/components/OtherProductsItem/OtherProductsItem.js.map +1 -1
- package/lib/components/PictureText/PictureText.fixture.d.ts +2 -0
- package/lib/components/PictureText/PictureText.js +1 -2
- package/lib/components/PictureText/PictureText.js.map +1 -1
- package/lib/components/PictureText/renderBenefit.d.ts +4 -0
- package/lib/components/PictureText/renderBenefit.js +22 -0
- package/lib/components/PictureText/renderBenefit.js.map +1 -0
- package/lib/components/ProductTile/renderBenefit.js +1 -1
- package/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.fixture.d.ts +1 -0
- package/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/lib/ui-kit/SlideCheckbox/SlideCheckbox.d.ts +7 -0
- package/lib/ui-kit/SlideCheckbox/SlideCheckbox.fixture.d.ts +5 -0
- package/lib/ui-kit/SlideCheckbox/SlideCheckbox.js +5 -0
- package/lib/ui-kit/SlideCheckbox/SlideCheckbox.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +2 -2
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/PictureText/renderBenefit.d.ts +4 -0
- package/mobile/bundle/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/mobile/bundle/ui-kit/SlideCheckbox/SlideCheckbox.d.ts +7 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/dist/components/ErrorBlock/ErrorBlock.js +3 -1
- package/mobile/dist/components/ErrorBlock/ErrorBlock.js.map +1 -1
- package/mobile/dist/components/Header/DropdownMenu.js +4 -1
- package/mobile/dist/components/Header/DropdownMenu.js.map +1 -1
- package/mobile/dist/components/OtherProductsItem/OtherProductsItem.js +3 -1
- package/mobile/dist/components/OtherProductsItem/OtherProductsItem.js.map +1 -1
- package/mobile/dist/components/PictureText/PictureText.js +2 -3
- package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
- package/mobile/dist/components/PictureText/renderBenefit.d.ts +4 -0
- package/mobile/dist/components/PictureText/renderBenefit.js +25 -0
- package/mobile/dist/components/PictureText/renderBenefit.js.map +1 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js +1 -1
- package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/mobile/dist/ui-kit/SlideCheckbox/SlideCheckbox.d.ts +7 -0
- package/mobile/dist/ui-kit/SlideCheckbox/SlideCheckbox.js +7 -0
- package/mobile/dist/ui-kit/SlideCheckbox/SlideCheckbox.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/lib/components/ErrorBlock/ErrorBlock.js +3 -1
- package/mobile/lib/components/ErrorBlock/ErrorBlock.js.map +1 -1
- package/mobile/lib/components/Header/DropdownMenu.js +4 -1
- package/mobile/lib/components/Header/DropdownMenu.js.map +1 -1
- package/mobile/lib/components/OtherProductsItem/OtherProductsItem.js +3 -1
- package/mobile/lib/components/OtherProductsItem/OtherProductsItem.js.map +1 -1
- package/mobile/lib/components/PictureText/PictureText.js +1 -2
- package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
- package/mobile/lib/components/PictureText/renderBenefit.d.ts +4 -0
- package/mobile/lib/components/PictureText/renderBenefit.js +22 -0
- package/mobile/lib/components/PictureText/renderBenefit.js.map +1 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js +1 -1
- package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/mobile/lib/ui-kit/SlideCheckbox/SlideCheckbox.d.ts +7 -0
- package/mobile/lib/ui-kit/SlideCheckbox/SlideCheckbox.js +5 -0
- package/mobile/lib/ui-kit/SlideCheckbox/SlideCheckbox.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +5 -1
- package/mobile/src/components/ErrorBlock/ErrorBlock.tsx +10 -1
- package/mobile/src/components/Header/DropdownMenu.tsx +16 -12
- package/mobile/src/components/OtherProductsItem/OtherProductsItem.tsx +3 -1
- package/mobile/src/components/PictureText/PictureText.tsx +1 -14
- package/mobile/src/components/PictureText/PictureText.ui.json +10 -0
- package/mobile/src/components/PictureText/renderBenefit.tsx +33 -0
- package/mobile/src/components/ProductTile/renderBenefit.tsx +5 -1
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +1 -1
- package/mobile/src/ui-kit/BenefitItem/BenefitItemProps.ts +28 -3
- package/mobile/src/ui-kit/SlideCheckbox/SlideCheckbox.tsx +33 -0
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
- package/package.json +1 -1
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +1 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +5 -1
- package/src/components/ErrorBlock/ErrorBlock.tsx +10 -1
- package/src/components/Header/DropdownMenu.tsx +16 -12
- package/src/components/OtherProductsItem/OtherProductsItem.tsx +3 -1
- package/src/components/PictureText/PictureText.fixture.tsx +37 -0
- package/src/components/PictureText/PictureText.tsx +1 -14
- package/src/components/PictureText/PictureText.ui.json +10 -0
- package/src/components/PictureText/renderBenefit.tsx +33 -0
- package/src/components/ProductTile/renderBenefit.tsx +5 -1
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +1 -1
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.fixture.tsx +17 -0
- package/src/ui-kit/BenefitItem/BenefitItemProps.ts +28 -3
- package/src/ui-kit/SlideCheckbox/SlideCheckbox.fixture.tsx +9 -0
- package/src/ui-kit/SlideCheckbox/SlideCheckbox.tsx +33 -0
- package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -1775,7 +1775,7 @@
|
|
|
1775
1775
|
const tileTitle = title ? (jsx(Heading, { headingType: "h5", as: "h3", className: "mb-3.5 z-10", title: title })) : null;
|
|
1776
1776
|
const tileImage = image?.src ? (jsx(ImgInner, { className: "absolute bottom-0 right-0 m-0", image: image })) : null;
|
|
1777
1777
|
const BORDER_STYLE = 'border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider';
|
|
1778
|
-
return (jsx(BlockWrapper, { className: style('relative p-7 min-w-[524px] text-left box-border group-data-gray:bg-main-divider/50', BORDER_STYLE, className), version: version, ...rest, children: jsx(BaseTile, { className: "flex justify-between", title: tileTitle, image: tileImage, children: jsxs("div", { className: "h-full flex flex-col justify-between", children: [description ? jsx("span", { className: "mb-2", children: description }) : null, items.length ? (jsx(List, { className: "text-xl-light flex flex-col flex-1 gap-2 max-w-[236px]", items: items })) : null, socialMedia.length ? jsx(SocialMedia, { className: "pt-10 pb-0", media: socialMedia }) : null, renderButtonsSection([button], { className: 'pt-2 mt-16' })] }) }) }));
|
|
1778
|
+
return (jsx(BlockWrapper, { className: style('relative p-7 min-w-[524px] text-left box-border group-data-gray:bg-main-divider/50', BORDER_STYLE, className), version: version, ...rest, children: jsx(BaseTile, { className: "flex justify-between", title: tileTitle, image: tileImage, children: jsxs("div", { className: "h-full flex flex-col justify-between", children: [description ? (jsx("span", { className: "mb-2 group-data-gray:text-secondary-text group-data-gray:max-w-[265px]", children: description })) : null, items.length ? (jsx(List, { className: "text-xl-light flex flex-col flex-1 gap-2 max-w-[236px]", items: items })) : null, socialMedia.length ? jsx(SocialMedia, { className: "pt-10 pb-0", media: socialMedia }) : null, renderButtonsSection([button], { className: 'pt-2 mt-16' })] }) }) }));
|
|
1779
1779
|
});
|
|
1780
1780
|
|
|
1781
1781
|
const VISIBLE_CELLS_COUNT = 1;
|
|
@@ -1895,7 +1895,8 @@
|
|
|
1895
1895
|
}
|
|
1896
1896
|
return null;
|
|
1897
1897
|
};
|
|
1898
|
-
const
|
|
1898
|
+
const getErrorBlockStyle = (text) => (text ? 'py-20 pt-3 pb-1' : 'mb-16 pb-2 mt-24 pt-3');
|
|
1899
|
+
const ErrorBlock = JSX(({ className = '', title, subtitle, error, button }) => (jsxs("section", { className: style('flex flex-col justify-center items-center', getErrorBlockStyle(button?.text), className), children: [jsx("div", { className: "flex justify-center py-20", children: renderErrorContent(error) }), title ? jsx(Heading, { headingType: "h1", className: "text-left mb-4", title: title }) : null, subtitle ? (jsx("div", { className: "font-sans text-xl-light mb-7 max-w-[613px] text-center", children: subtitle })) : null, button?.text ? (jsx(Button, { className: "py-4 px-9", version: button?.version, ...button, children: button.text })) : null] })));
|
|
1899
1900
|
|
|
1900
1901
|
var Currency;
|
|
1901
1902
|
(function (Currency) {
|
|
@@ -2516,7 +2517,10 @@
|
|
|
2516
2517
|
const ref = useOutsideClick(handleClickOutside);
|
|
2517
2518
|
return (jsxs("div", { className: style(visible ? 'bg-white rounded-md shadow-blue-gray' : '', className), ref: ref, children: [jsx("button", { className: "group/btn flex justify-between items-center h-6 ml-6", "aria-label": `${visible ? 'Скрыть другие разделы' : 'Показать другие разделы'}`, onClick: handleToggle, children: Array(3)
|
|
2518
2519
|
.fill(null)
|
|
2519
|
-
.map((_, i) => (jsx("div", { className: "w-[3px] h-[3px] rounded mr-1 bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white" }, String(i)))) }), jsx("div", { className: style('flex flex-col rounded-md bg-white p-6 pb-2', visible ? '' : 'hidden'), "aria-hidden": !visible, children: items?.map((item, i) =>
|
|
2520
|
+
.map((_, i) => (jsx("div", { className: "w-[3px] h-[3px] rounded mr-1 bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white" }, String(i)))) }), jsx("div", { className: style('flex flex-col rounded-md bg-white p-6 pb-2', visible ? '' : 'hidden'), "aria-hidden": !visible, children: items?.map((item, i) => {
|
|
2521
|
+
const { text, ...linkProps } = item;
|
|
2522
|
+
return (jsx("a", { className: style('text-l-light pb-4 hover:text-primary-main', item === activeItem ? 'text-primary-main' : ''), ...link(linkProps), children: text }, item.href || String(i)));
|
|
2523
|
+
}) })] }));
|
|
2520
2524
|
});
|
|
2521
2525
|
|
|
2522
2526
|
const HeaderItem = JSX(({ className = '', active, dataItemName, children, ...rest }) => {
|
|
@@ -3176,7 +3180,9 @@
|
|
|
3176
3180
|
const { colorPalette } = getParentBlockContent(rest.options, {});
|
|
3177
3181
|
return (jsx("div", { className: `border-0 border-b border-solid border-main-divider ${className}`, children: jsx(Foldable, { unfoldedByDefault: unfoldedByDefault, renderFoldableSection: ({ isUnfolded }) => (jsx("div", { className: "box-border", children: jsx(FoldableSection, { className: "grid grid-cols-12 gap-1 border-box", isUnfolded: isUnfolded, children: renderChildren(rest) }) })), renderFoldButton: ({ isUnfolded, onToggle }) => (jsx(DefaultFoldButton, { label: label, icon: icons[Number(isUnfolded)], dataTheme: colorPalette || rest.options?.page?.colorPalette, onClick: onToggle })) }) }));
|
|
3178
3182
|
});
|
|
3179
|
-
OtherProductsItem.childrenTypes =
|
|
3183
|
+
OtherProductsItem.childrenTypes = {
|
|
3184
|
+
exclude: ['OtherProductsItem'],
|
|
3185
|
+
};
|
|
3180
3186
|
|
|
3181
3187
|
const ParagraphBlock = JSX(({ text, size, align, font, children, ...rest }) => (jsx(BlockWrapper, { ...rest, children: jsx(Paragraph, { size: size, align: align, font: font, children: text || children }) })));
|
|
3182
3188
|
|
|
@@ -3197,8 +3203,34 @@
|
|
|
3197
3203
|
return `w-12 h-12 min-w-12 rounded-full p-2.5 box-border flex items-center justify-center ${bgColorStyle}`;
|
|
3198
3204
|
}
|
|
3199
3205
|
|
|
3206
|
+
const RichText = JSX((props) => {
|
|
3207
|
+
const { __html = '' } = props;
|
|
3208
|
+
return jsx("div", { className: "md-container", dangerouslySetInnerHTML: { __html } });
|
|
3209
|
+
});
|
|
3210
|
+
|
|
3211
|
+
function assertUnreachable(x) {
|
|
3212
|
+
throw new Error(x);
|
|
3213
|
+
}
|
|
3214
|
+
|
|
3215
|
+
const renderBenefit$2 =
|
|
3216
|
+
// Linter doesn't understand that switch processes all cases
|
|
3217
|
+
// eslint-disable-next-line consistent-return
|
|
3218
|
+
(version) => (benefit, i) => {
|
|
3219
|
+
const { type } = benefit;
|
|
3220
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
3221
|
+
return null;
|
|
3222
|
+
}
|
|
3223
|
+
switch (type) {
|
|
3224
|
+
case 'default':
|
|
3225
|
+
return (jsx(BenefitItem, { icon: benefit.icon, label: benefit.label, description: benefit.description, version: version }, String(i)));
|
|
3226
|
+
case 'rte':
|
|
3227
|
+
return jsx(RichText, { __html: benefit.__html });
|
|
3228
|
+
default:
|
|
3229
|
+
assertUnreachable(benefit);
|
|
3230
|
+
}
|
|
3231
|
+
};
|
|
3232
|
+
|
|
3200
3233
|
const PictureText = JSX(({ className = '', title, description, image, benefits, sum, monthLimit, directionRight = false, version = 'primary', ...rest }) => (jsxs(BlockWrapper, { className: `relative py-12 px-24 ${className}`, version: version, ...rest, children: [jsx(Headline, { className: "!p-0", title: title, description: description, headlineVersion: "M" }), jsxs("div", { className: 'flex justify-center gap-[122px] mt-[30px]', children: [image?.src ? jsx(ImgInner, { className: directionRight ? 'order-2' : '', image: image }) : null, jsxs("div", { className: "w-[558px] m-auto", children: [benefits?.length ? (jsx("div", { className: "flex flex-col gap-4", children: benefits.map(renderBenefit$2(version)) })) : null, renderInsuranceSumMonth(Number(sum), Number(monthLimit))] })] })] })));
|
|
3201
|
-
const renderBenefit$2 = (version) => (benefit, i) => (jsx(BenefitItem, { icon: benefit.icon, label: benefit.label, description: benefit.description, version: version }, String(i)));
|
|
3202
3234
|
function renderInsuranceSumMonth(sum, monthLimit) {
|
|
3203
3235
|
return sum || monthLimit ? (jsxs("div", { className: "bg-main-divider rounded-md flex mt-7 gap-6 px-5 py-4", children: [Number(sum) > 0 ? renderValueBlock('Страховая сумма:', sum, Boolean(monthLimit)) : null, Number(monthLimit) > 0
|
|
3204
3236
|
? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(sum))
|
|
@@ -3316,15 +3348,6 @@
|
|
|
3316
3348
|
return (jsx("div", { className: `mt-2.5 z-10 ${descriptionWidth}`, children: jsx(Paragraph, { size: "text-m", font: "font-light", color: "group-data-primary:text-secondary-text", children: additionalDescription }) }));
|
|
3317
3349
|
}
|
|
3318
3350
|
|
|
3319
|
-
const RichText = JSX((props) => {
|
|
3320
|
-
const { __html = '' } = props;
|
|
3321
|
-
return jsx("div", { className: "md-container", dangerouslySetInnerHTML: { __html } });
|
|
3322
|
-
});
|
|
3323
|
-
|
|
3324
|
-
function assertUnreachable(x) {
|
|
3325
|
-
throw new Error(x);
|
|
3326
|
-
}
|
|
3327
|
-
|
|
3328
3351
|
const renderBenefit =
|
|
3329
3352
|
// Linter doesn't understand that switch processes all cases
|
|
3330
3353
|
// eslint-disable-next-line consistent-return
|
|
@@ -3340,7 +3363,7 @@
|
|
|
3340
3363
|
jsx(Text, { size: "text-m", font: "font-light", color: "group-data-primary:text-secondary-text", children: benefit.description }, `desc-${i}`),
|
|
3341
3364
|
];
|
|
3342
3365
|
case 'rte':
|
|
3343
|
-
return jsx(RichText, { __html: benefit.__html });
|
|
3366
|
+
return (jsx("div", { className: "col-span-2", children: jsx(RichText, { __html: benefit.__html }) }));
|
|
3344
3367
|
default:
|
|
3345
3368
|
assertUnreachable(benefit);
|
|
3346
3369
|
}
|
|
@@ -3626,7 +3649,7 @@
|
|
|
3626
3649
|
'horizontal-list': 'w-6',
|
|
3627
3650
|
'vertical-list': 'h-6',
|
|
3628
3651
|
};
|
|
3629
|
-
const dotStyle = 'cursor-pointer bg-primary-main rounded-full transition-width duration-300 group-data-secondary:bg-white';
|
|
3652
|
+
const dotStyle = 'cursor-pointer bg-primary-main rounded-full transition-width duration-300 group-data-secondary:bg-white group-data-transparent:bg-white';
|
|
3630
3653
|
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
3631
3654
|
const SwipeListControlDots = JSX(({ containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list' }) => {
|
|
3632
3655
|
const handleClick = (idx) => {
|
|
@@ -4225,7 +4248,7 @@
|
|
|
4225
4248
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
|
|
4226
4249
|
}
|
|
4227
4250
|
|
|
4228
|
-
const packageVersion = "0.7.
|
|
4251
|
+
const packageVersion = "0.7.9";
|
|
4229
4252
|
|
|
4230
4253
|
exports.Blocks = Blocks;
|
|
4231
4254
|
exports.ContentPage = ContentPage;
|