@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.
Files changed (129) hide show
  1. package/bin/migration-scripts/0.7.8.js +29 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +40 -17
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/PictureText/renderBenefit.d.ts +4 -0
  6. package/bundle/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
  7. package/bundle/ui-kit/SlideCheckbox/SlideCheckbox.d.ts +7 -0
  8. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  9. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  10. package/dist/components/ErrorBlock/ErrorBlock.js +3 -1
  11. package/dist/components/ErrorBlock/ErrorBlock.js.map +1 -1
  12. package/dist/components/Header/DropdownMenu.js +4 -1
  13. package/dist/components/Header/DropdownMenu.js.map +1 -1
  14. package/dist/components/OtherProductsItem/OtherProductsItem.js +3 -1
  15. package/dist/components/OtherProductsItem/OtherProductsItem.js.map +1 -1
  16. package/dist/components/PictureText/PictureText.js +2 -3
  17. package/dist/components/PictureText/PictureText.js.map +1 -1
  18. package/dist/components/PictureText/renderBenefit.d.ts +4 -0
  19. package/dist/components/PictureText/renderBenefit.js +25 -0
  20. package/dist/components/PictureText/renderBenefit.js.map +1 -0
  21. package/dist/components/ProductTile/renderBenefit.js +1 -1
  22. package/dist/components/ProductTile/renderBenefit.js.map +1 -1
  23. package/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
  24. package/dist/ui-kit/SlideCheckbox/SlideCheckbox.d.ts +7 -0
  25. package/dist/ui-kit/SlideCheckbox/SlideCheckbox.js +7 -0
  26. package/dist/ui-kit/SlideCheckbox/SlideCheckbox.js.map +1 -0
  27. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  28. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  29. package/lib/common.css +1 -1
  30. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  31. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  32. package/lib/components/ErrorBlock/ErrorBlock.js +3 -1
  33. package/lib/components/ErrorBlock/ErrorBlock.js.map +1 -1
  34. package/lib/components/Header/DropdownMenu.js +4 -1
  35. package/lib/components/Header/DropdownMenu.js.map +1 -1
  36. package/lib/components/OtherProductsItem/OtherProductsItem.js +3 -1
  37. package/lib/components/OtherProductsItem/OtherProductsItem.js.map +1 -1
  38. package/lib/components/PictureText/PictureText.fixture.d.ts +2 -0
  39. package/lib/components/PictureText/PictureText.js +1 -2
  40. package/lib/components/PictureText/PictureText.js.map +1 -1
  41. package/lib/components/PictureText/renderBenefit.d.ts +4 -0
  42. package/lib/components/PictureText/renderBenefit.js +22 -0
  43. package/lib/components/PictureText/renderBenefit.js.map +1 -0
  44. package/lib/components/ProductTile/renderBenefit.js +1 -1
  45. package/lib/components/ProductTile/renderBenefit.js.map +1 -1
  46. package/lib/components/SwipeListControlBlock/SwipeListControlBlock.fixture.d.ts +1 -0
  47. package/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
  48. package/lib/ui-kit/SlideCheckbox/SlideCheckbox.d.ts +7 -0
  49. package/lib/ui-kit/SlideCheckbox/SlideCheckbox.fixture.d.ts +5 -0
  50. package/lib/ui-kit/SlideCheckbox/SlideCheckbox.js +5 -0
  51. package/lib/ui-kit/SlideCheckbox/SlideCheckbox.js.map +1 -0
  52. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  53. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  54. package/mobile/bundle/bundle.umd.js +2 -2
  55. package/mobile/bundle/bundle.umd.min.js +1 -1
  56. package/mobile/bundle/components/PictureText/renderBenefit.d.ts +4 -0
  57. package/mobile/bundle/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
  58. package/mobile/bundle/ui-kit/SlideCheckbox/SlideCheckbox.d.ts +7 -0
  59. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  60. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  61. package/mobile/dist/components/ErrorBlock/ErrorBlock.js +3 -1
  62. package/mobile/dist/components/ErrorBlock/ErrorBlock.js.map +1 -1
  63. package/mobile/dist/components/Header/DropdownMenu.js +4 -1
  64. package/mobile/dist/components/Header/DropdownMenu.js.map +1 -1
  65. package/mobile/dist/components/OtherProductsItem/OtherProductsItem.js +3 -1
  66. package/mobile/dist/components/OtherProductsItem/OtherProductsItem.js.map +1 -1
  67. package/mobile/dist/components/PictureText/PictureText.js +2 -3
  68. package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
  69. package/mobile/dist/components/PictureText/renderBenefit.d.ts +4 -0
  70. package/mobile/dist/components/PictureText/renderBenefit.js +25 -0
  71. package/mobile/dist/components/PictureText/renderBenefit.js.map +1 -0
  72. package/mobile/dist/components/ProductTile/renderBenefit.js +1 -1
  73. package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -1
  74. package/mobile/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
  75. package/mobile/dist/ui-kit/SlideCheckbox/SlideCheckbox.d.ts +7 -0
  76. package/mobile/dist/ui-kit/SlideCheckbox/SlideCheckbox.js +7 -0
  77. package/mobile/dist/ui-kit/SlideCheckbox/SlideCheckbox.js.map +1 -0
  78. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  79. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  80. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  81. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  82. package/mobile/lib/components/ErrorBlock/ErrorBlock.js +3 -1
  83. package/mobile/lib/components/ErrorBlock/ErrorBlock.js.map +1 -1
  84. package/mobile/lib/components/Header/DropdownMenu.js +4 -1
  85. package/mobile/lib/components/Header/DropdownMenu.js.map +1 -1
  86. package/mobile/lib/components/OtherProductsItem/OtherProductsItem.js +3 -1
  87. package/mobile/lib/components/OtherProductsItem/OtherProductsItem.js.map +1 -1
  88. package/mobile/lib/components/PictureText/PictureText.js +1 -2
  89. package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
  90. package/mobile/lib/components/PictureText/renderBenefit.d.ts +4 -0
  91. package/mobile/lib/components/PictureText/renderBenefit.js +22 -0
  92. package/mobile/lib/components/PictureText/renderBenefit.js.map +1 -0
  93. package/mobile/lib/components/ProductTile/renderBenefit.js +1 -1
  94. package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -1
  95. package/mobile/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
  96. package/mobile/lib/ui-kit/SlideCheckbox/SlideCheckbox.d.ts +7 -0
  97. package/mobile/lib/ui-kit/SlideCheckbox/SlideCheckbox.js +5 -0
  98. package/mobile/lib/ui-kit/SlideCheckbox/SlideCheckbox.js.map +1 -0
  99. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  100. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  101. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +5 -1
  102. package/mobile/src/components/ErrorBlock/ErrorBlock.tsx +10 -1
  103. package/mobile/src/components/Header/DropdownMenu.tsx +16 -12
  104. package/mobile/src/components/OtherProductsItem/OtherProductsItem.tsx +3 -1
  105. package/mobile/src/components/PictureText/PictureText.tsx +1 -14
  106. package/mobile/src/components/PictureText/PictureText.ui.json +10 -0
  107. package/mobile/src/components/PictureText/renderBenefit.tsx +33 -0
  108. package/mobile/src/components/ProductTile/renderBenefit.tsx +5 -1
  109. package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +1 -1
  110. package/mobile/src/ui-kit/BenefitItem/BenefitItemProps.ts +28 -3
  111. package/mobile/src/ui-kit/SlideCheckbox/SlideCheckbox.tsx +33 -0
  112. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
  113. package/package.json +1 -1
  114. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +1 -0
  115. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +5 -1
  116. package/src/components/ErrorBlock/ErrorBlock.tsx +10 -1
  117. package/src/components/Header/DropdownMenu.tsx +16 -12
  118. package/src/components/OtherProductsItem/OtherProductsItem.tsx +3 -1
  119. package/src/components/PictureText/PictureText.fixture.tsx +37 -0
  120. package/src/components/PictureText/PictureText.tsx +1 -14
  121. package/src/components/PictureText/PictureText.ui.json +10 -0
  122. package/src/components/PictureText/renderBenefit.tsx +33 -0
  123. package/src/components/ProductTile/renderBenefit.tsx +5 -1
  124. package/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +1 -1
  125. package/src/components/SwipeListControlBlock/SwipeListControlBlock.fixture.tsx +17 -0
  126. package/src/ui-kit/BenefitItem/BenefitItemProps.ts +28 -3
  127. package/src/ui-kit/SlideCheckbox/SlideCheckbox.fixture.tsx +9 -0
  128. package/src/ui-kit/SlideCheckbox/SlideCheckbox.tsx +33 -0
  129. package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
@@ -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 ErrorBlock = JSX(({ className = '', title, subtitle, error, button }) => (jsxs("section", { className: `flex flex-col justify-center items-center mt-12 ${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] })));
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) => (jsx("a", { className: style('text-l-light pb-4 hover:text-primary-main', item === activeItem ? 'text-primary-main' : ''), ...link(item), children: item.text }, item.href || String(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 = []; // All types of blocks are suitable
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.7";
4251
+ const packageVersion = "0.7.9";
4229
4252
 
4230
4253
  exports.Blocks = Blocks;
4231
4254
  exports.ContentPage = ContentPage;