@redneckz/wildless-cms-uni-blocks 0.14.462 → 0.14.463

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 (27) hide show
  1. package/bin/migration-scripts/0.14.455.js +22 -0
  2. package/bundle/bundle.umd.js +4 -5
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/StepsBlock/renderStep.d.ts +0 -1
  5. package/dist/components/StepsBlock/StepsBlock.js +1 -2
  6. package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  7. package/dist/components/StepsBlock/renderStep.d.ts +0 -1
  8. package/dist/components/StepsBlock/renderStep.js +2 -2
  9. package/dist/components/StepsBlock/renderStep.js.map +1 -1
  10. package/lib/components/StepsBlock/StepsBlock.js +1 -2
  11. package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  12. package/lib/components/StepsBlock/renderStep.d.ts +0 -1
  13. package/lib/components/StepsBlock/renderStep.js +2 -2
  14. package/lib/components/StepsBlock/renderStep.js.map +1 -1
  15. package/mobile/bundle/bundle.umd.js +1 -1
  16. package/mobile/bundle/bundle.umd.min.js +1 -1
  17. package/mobile/bundle/components/StepsBlock/renderStep.d.ts +0 -1
  18. package/mobile/dist/components/StepsBlock/renderStep.d.ts +0 -1
  19. package/mobile/dist/components/StepsBlock/renderStep.js +2 -2
  20. package/mobile/dist/components/StepsBlock/renderStep.js.map +1 -1
  21. package/mobile/lib/components/StepsBlock/renderStep.d.ts +0 -1
  22. package/mobile/lib/components/StepsBlock/renderStep.js +2 -2
  23. package/mobile/lib/components/StepsBlock/renderStep.js.map +1 -1
  24. package/mobile/src/components/StepsBlock/renderStep.tsx +2 -3
  25. package/package.json +1 -1
  26. package/src/components/StepsBlock/StepsBlock.tsx +1 -3
  27. package/src/components/StepsBlock/renderStep.tsx +2 -3
@@ -0,0 +1,22 @@
1
+ import { traversePageBlocks } from '../utils.js';
2
+
3
+ export const description = 'v0.14.455';
4
+ export default traversePageBlocks(removeButtonByKey);
5
+
6
+ function removeButtonByKey(block) {
7
+ if (block.type !== 'StepsBlock') {
8
+ return block;
9
+ }
10
+
11
+ if (block.content.buttons && block.content.buttons.some((button) => button.text === 'Кнопка')) {
12
+ delete block.content.buttons;
13
+ }
14
+
15
+ block.content.steps?.forEach((step) => {
16
+ if (step?.button?.text === 'Кнопка') {
17
+ delete step.button;
18
+ }
19
+ });
20
+
21
+ return block;
22
+ }
@@ -5907,9 +5907,9 @@
5907
5907
  const STEP_BREAKPOINT = 4;
5908
5908
  // TODO: Create universal function for this case
5909
5909
  const renderStep = (props) => (step, i, arr) => {
5910
- const { styleMap, isMainButton, version } = props;
5910
+ const { styleMap, version } = props;
5911
5911
  const { label, description, button, isDotted } = step;
5912
- return (jsxs("div", { className: style('relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl', getContainerWidth(arr.length)), children: [jsxs("div", { className: "space-y-xs", children: [label ? (jsx(Text, { size: "text-h6", align: "text-center", children: label })) : null, jsxs("div", { className: "flex flex-col items-center gap-3xs", children: [description ? jsx("div", { className: styleMap.description, children: description }) : null, jsx(RichText, { __html: step.__html, itemSize: "list-s", isDotted: isDotted })] })] }), button?.text && !isMainButton ? (jsx(LinkButton, { className: "box-border py-s w-full max-w-60 mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
5912
+ return (jsxs("div", { className: style('relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl', getContainerWidth(arr.length)), children: [jsxs("div", { className: "space-y-xs", children: [label ? (jsx(Text, { size: "text-h6", align: "text-center", children: label })) : null, jsxs("div", { className: "flex flex-col items-center gap-3xs", children: [description ? jsx("div", { className: styleMap.description, children: description }) : null, jsx(RichText, { __html: step.__html, itemSize: "list-s", isDotted: isDotted })] })] }), button?.text ? (jsx(LinkButton, { className: "box-border py-s w-full max-w-60 mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
5913
5913
  };
5914
5914
  const getContainerWidth = (length) => (length < STEP_BREAKPOINT ? 'w-72' : 'w-52');
5915
5915
 
@@ -5929,8 +5929,7 @@
5929
5929
  const lineOpacity = getLineOpacity(showLines);
5930
5930
  const paddingXNormal = stepsLength < STEP_BREAKPOINT ? 'px-24' : 'px-16';
5931
5931
  const paddingXSmall = stepsLength < STEP_BREAKPOINT ? 'px-28' : 'px-20';
5932
- const isMainButton = Boolean(buttons?.every((b) => b?.text));
5933
- return (jsxs(BlockWrapper, { className: style('box-border flex flex-col items-center overflow-hidden gap-y-3xl', className), defaultPadding: "p-6xl", version: version, ...rest, children: [jsx(Headline, { headlineVersion: "S", title: title, description: description, isEmbedded: true, className: "w-full", align: AlignStyles }), steps?.length ? (jsxs("div", { className: "box-border space-y-lg flex flex-col justify-center", children: [jsx("div", { className: style('flex items-center', size === 'normal' ? paddingXNormal : paddingXSmall), children: joinList(jsx("div", { className: style('h-0.5 w-full bg-secondary-light flex-1', lineOpacity) }))(steps.map(renderStepIcon(styleMap, size, stepVersion))) }), jsx("div", { className: style('flex justify-between', shortGaps ? 'gap-x-s' : 'gap-x-20'), children: steps.map(renderStep({ styleMap, isMainButton, version })) })] })) : null, renderButtonsSection(buttons)] }));
5932
+ return (jsxs(BlockWrapper, { className: style('box-border flex flex-col items-center overflow-hidden gap-y-3xl', className), defaultPadding: "p-6xl", version: version, ...rest, children: [jsx(Headline, { headlineVersion: "S", title: title, description: description, isEmbedded: true, className: "w-full", align: AlignStyles }), steps?.length ? (jsxs("div", { className: "box-border space-y-lg flex flex-col justify-center", children: [jsx("div", { className: style('flex items-center', size === 'normal' ? paddingXNormal : paddingXSmall), children: joinList(jsx("div", { className: style('h-0.5 w-full bg-secondary-light flex-1', lineOpacity) }))(steps.map(renderStepIcon(styleMap, size, stepVersion))) }), jsx("div", { className: style('flex justify-between', shortGaps ? 'gap-x-s' : 'gap-x-20'), children: steps.map(renderStep({ styleMap, version })) })] })) : null, renderButtonsSection(buttons)] }));
5934
5933
  });
5935
5934
  const renderStepIcon = (styleMap, size, stepVersion) => ({ icon }, i) => {
5936
5935
  const iconVersion = stepVersion === 'secondary' ? 'white' : 'color';
@@ -6559,7 +6558,7 @@
6559
6558
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6560
6559
  });
6561
6560
 
6562
- const packageVersion = "0.14.461";
6561
+ const packageVersion = "0.14.462";
6563
6562
 
6564
6563
  exports.Blocks = Blocks;
6565
6564
  exports.ContentPage = ContentPage;