@redneckz/wildless-cms-uni-blocks 0.14.547 → 0.14.548

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.
@@ -649,12 +649,6 @@
649
649
  const imageAlwaysOnRightContainerStyle = (isImage) => style(isImage ? 'row-span-2' : '@xl:row-span-2');
650
650
  const renderUnitContainer = (childrenBlocks) => childrenBlocks?.length ? (jsx("div", { className: "flex items-start justify-end", children: childrenBlocks })) : null;
651
651
 
652
- const sum = (list = []) => list.reduce((a, b) => a + b, 0);
653
-
654
- const avg = (items = []) => (items?.length ? sum(items) / items.length : 0);
655
-
656
- const deviation = (items) => items?.length ? Math.sqrt(Math.abs(avg(items.map((_) => _ ** 2)) - avg(items) ** 2)) : 0;
657
-
658
652
  const renderBenefitIcon = (icon, benefitsVersion = 'normal') => icon?.icon || icon?.src ? (jsx("div", { className: style('sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon', benefitsVersion === 'normal'
659
653
  ? 'bg-secondary-light text-primary-main'
660
654
  : 'bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black'), children: jsx(Img, { className: "w-6 h-6", image: { ...icon, iconVersion: icon.iconVersion || benefitsVersion } }) })) : null;
@@ -686,12 +680,7 @@
686
680
 
687
681
  const BenefitItem = JSX(({ className, benefitsVersion, ..._ }) => (jsxs("div", { className: style('flex gap-m min-w-56 items-center', className), role: "listitem", children: ['icon' in _ ? renderBenefitIcon(_.icon, benefitsVersion) : null, jsx("div", { children: renderBenefitText(_) })] })));
688
682
 
689
- const MAX_BENEFITS_LEN_DEVIATION = 16;
690
- const benefitLength = (_) => Math.max(_?.label?.length || 0, _?.description?.length || 0, _?.__html?.length || 0);
691
- const isDistortedBenefits = (benefits) => deviation(benefits.map(benefitLength)) > MAX_BENEFITS_LEN_DEVIATION;
692
- const hasIcon = (_) => _ && 'icon' in _ && _.icon && (_.icon.icon || _.icon.src);
693
- const isTextualBenefits = (benefits) => !benefits.some(hasIcon);
694
- const DefaultBenefitsList = JSX(({ className, benefitsVersion = 'normal', benefits }) => benefits?.length ? (jsx("div", { className: style('flex gap-x-m gap-y-s', isDistortedBenefits(benefits) || isTextualBenefits(benefits) ? 'flex-col' : 'flex-wrap', className), role: "list", children: benefits.map((_, i) => (jsx(BenefitItem, { benefitsVersion: benefitsVersion, ..._ }, String(i)))) })) : null);
683
+ const DefaultBenefitsList = JSX(({ className, benefitsVersion = 'normal', benefits }) => benefits?.length ? (jsx("div", { className: style('flex gap-x-m gap-y-s flex-col', className), role: "list", children: benefits.map((_, i) => (jsx(BenefitItem, { benefitsVersion: benefitsVersion, ..._ }, String(i)))) })) : null);
695
684
 
696
685
  const TabularBenefitsList = JSX(({ className, benefits }) => benefits?.length ? (jsx("div", { className: style('grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs', className), role: "list", children: benefits.flatMap(renderBenefitText) })) : null);
697
686
 
@@ -4226,6 +4215,8 @@
4226
4215
  return acc;
4227
4216
  };
4228
4217
 
4218
+ const sum = (list = []) => list.reduce((a, b) => a + b, 0);
4219
+
4229
4220
  const MIN_TERM_LEN = 3;
4230
4221
  const tokenize = (text) => text
4231
4222
  .toLowerCase()
@@ -6509,7 +6500,7 @@
6509
6500
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6510
6501
  });
6511
6502
 
6512
- const packageVersion = "0.14.546";
6503
+ const packageVersion = "0.14.547";
6513
6504
 
6514
6505
  exports.Blocks = Blocks;
6515
6506
  exports.ContentPage = ContentPage;