@redneckz/wildless-cms-uni-blocks 0.14.45 → 0.14.46

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 (70) hide show
  1. package/bin/migration-scripts/0.14.44.js +103 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +1 -13
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/dist/components/Blocks.js +0 -2
  6. package/dist/components/Blocks.js.map +1 -1
  7. package/lib/common.css +1 -1
  8. package/lib/components/Blocks.js +0 -2
  9. package/lib/components/Blocks.js.map +1 -1
  10. package/lib/components/VerticalLayout/VerticalLayout.fixture.d.ts +1 -0
  11. package/mobile/bundle/bundle.umd.js +1 -1
  12. package/mobile/bundle/bundle.umd.min.js +1 -1
  13. package/mobile/lib/common.css +1 -1
  14. package/package.json +1 -1
  15. package/src/components/Blocks.ts +0 -2
  16. package/src/components/VerticalLayout/VerticalLayout.fixture.tsx +62 -0
  17. package/bundle/components/BusinessBlock/BusinessBlock.d.ts +0 -5
  18. package/bundle/components/BusinessBlock/BusinessBlockContent.d.ts +0 -25
  19. package/bundle/components/BusinessBlock/BusinessCard.d.ts +0 -2
  20. package/dist/components/BusinessBlock/BusinessBlock.d.ts +0 -5
  21. package/dist/components/BusinessBlock/BusinessBlock.js +0 -9
  22. package/dist/components/BusinessBlock/BusinessBlock.js.map +0 -1
  23. package/dist/components/BusinessBlock/BusinessBlockContent.d.ts +0 -25
  24. package/dist/components/BusinessBlock/BusinessBlockContent.js +0 -2
  25. package/dist/components/BusinessBlock/BusinessBlockContent.js.map +0 -1
  26. package/dist/components/BusinessBlock/BusinessCard.d.ts +0 -2
  27. package/dist/components/BusinessBlock/BusinessCard.js +0 -17
  28. package/dist/components/BusinessBlock/BusinessCard.js.map +0 -1
  29. package/lib/components/BusinessBlock/BusinessBlock.d.ts +0 -5
  30. package/lib/components/BusinessBlock/BusinessBlock.fixture.d.ts +0 -6
  31. package/lib/components/BusinessBlock/BusinessBlock.js +0 -7
  32. package/lib/components/BusinessBlock/BusinessBlock.js.map +0 -1
  33. package/lib/components/BusinessBlock/BusinessBlockContent.d.ts +0 -25
  34. package/lib/components/BusinessBlock/BusinessBlockContent.js +0 -2
  35. package/lib/components/BusinessBlock/BusinessBlockContent.js.map +0 -1
  36. package/lib/components/BusinessBlock/BusinessCard.d.ts +0 -2
  37. package/lib/components/BusinessBlock/BusinessCard.js +0 -15
  38. package/lib/components/BusinessBlock/BusinessCard.js.map +0 -1
  39. package/mobile/bundle/components/BusinessBlock/BusinessBlock.d.ts +0 -5
  40. package/mobile/bundle/components/BusinessBlock/BusinessBlockContent.d.ts +0 -25
  41. package/mobile/bundle/components/BusinessBlock/BusinessCard.d.ts +0 -2
  42. package/mobile/dist/components/BusinessBlock/BusinessBlock.d.ts +0 -5
  43. package/mobile/dist/components/BusinessBlock/BusinessBlock.js +0 -9
  44. package/mobile/dist/components/BusinessBlock/BusinessBlock.js.map +0 -1
  45. package/mobile/dist/components/BusinessBlock/BusinessBlockContent.d.ts +0 -25
  46. package/mobile/dist/components/BusinessBlock/BusinessBlockContent.js +0 -2
  47. package/mobile/dist/components/BusinessBlock/BusinessBlockContent.js.map +0 -1
  48. package/mobile/dist/components/BusinessBlock/BusinessCard.d.ts +0 -2
  49. package/mobile/dist/components/BusinessBlock/BusinessCard.js +0 -17
  50. package/mobile/dist/components/BusinessBlock/BusinessCard.js.map +0 -1
  51. package/mobile/lib/components/BusinessBlock/BusinessBlock.d.ts +0 -5
  52. package/mobile/lib/components/BusinessBlock/BusinessBlock.js +0 -7
  53. package/mobile/lib/components/BusinessBlock/BusinessBlock.js.map +0 -1
  54. package/mobile/lib/components/BusinessBlock/BusinessBlockContent.d.ts +0 -25
  55. package/mobile/lib/components/BusinessBlock/BusinessBlockContent.js +0 -2
  56. package/mobile/lib/components/BusinessBlock/BusinessBlockContent.js.map +0 -1
  57. package/mobile/lib/components/BusinessBlock/BusinessCard.d.ts +0 -2
  58. package/mobile/lib/components/BusinessBlock/BusinessCard.js +0 -15
  59. package/mobile/lib/components/BusinessBlock/BusinessCard.js.map +0 -1
  60. package/mobile/src/components/BusinessBlock/BusinessBlock.example.json +0 -97
  61. package/mobile/src/components/BusinessBlock/BusinessBlock.tsx +0 -17
  62. package/mobile/src/components/BusinessBlock/BusinessBlock.ui.json +0 -29
  63. package/mobile/src/components/BusinessBlock/BusinessBlockContent.ts +0 -30
  64. package/mobile/src/components/BusinessBlock/BusinessCard.tsx +0 -42
  65. package/src/components/BusinessBlock/BusinessBlock.example.json +0 -97
  66. package/src/components/BusinessBlock/BusinessBlock.fixture.tsx +0 -75
  67. package/src/components/BusinessBlock/BusinessBlock.tsx +0 -17
  68. package/src/components/BusinessBlock/BusinessBlock.ui.json +0 -29
  69. package/src/components/BusinessBlock/BusinessBlockContent.ts +0 -30
  70. package/src/components/BusinessBlock/BusinessCard.tsx +0 -42
@@ -0,0 +1,103 @@
1
+ import { deleteEmptyButton, deleteEmptyProps, deleteProp } from '../utils.js';
2
+
3
+ export const description = 'v0.14.44';
4
+
5
+ export default (uniPath, content) => {
6
+ if (!content?.blocks) {
7
+ return content;
8
+ }
9
+
10
+ for (const block of content.blocks) {
11
+ adjustCarouselBusinessBlock(block);
12
+ }
13
+
14
+ return { ...content };
15
+ };
16
+
17
+ function adjustCarouselBusinessBlock(block) {
18
+ if (block.blocks) {
19
+ for (const childBlock of block.blocks) {
20
+ adjustCarouselBusinessBlock(childBlock);
21
+ }
22
+ }
23
+ const content = block?.content;
24
+ if (block.type === 'BusinessBlock') {
25
+ block.content = deleteEmptyProps(content);
26
+ block.content = deleteEmptyButton(content);
27
+
28
+ block.type = 'VerticalLayout';
29
+ block.blocks = [
30
+ {
31
+ type: 'Headline',
32
+ content: {
33
+ title: content?.title,
34
+ align: 'text-center',
35
+ headlineVersion: 'M',
36
+ isEmbedded: true,
37
+ },
38
+ },
39
+ {
40
+ style: ['col-span-12'],
41
+ type: 'HorizontalLayout',
42
+ content: {
43
+ version: 'primary',
44
+ isTheme: false,
45
+ gap: 'M',
46
+ title: 'Горизонтальный компоновщик',
47
+ isCardBorder: true,
48
+ isPadding: false,
49
+ },
50
+ blocks: content.cards.map(cardToProductBlock),
51
+ },
52
+ ];
53
+ block.content = {
54
+ version: 'primary',
55
+ isPadding: true,
56
+ isInnerPadding: true,
57
+ gap: 'L',
58
+ defaultPadding: 'p-6xl',
59
+ };
60
+
61
+ deleteProp(content, 'cards');
62
+ block.content = deleteEmptyProps(block.content);
63
+ block.content = deleteEmptyButton(block.content);
64
+ }
65
+ }
66
+
67
+ const cardToProductBlock = (card) => ({
68
+ style: ['col-span-6'],
69
+ type: 'ProductBlock',
70
+ content: {
71
+ headlineVersion: 'S',
72
+ title: card?.title,
73
+ backwardButton: false,
74
+ image: card?.image,
75
+ isDotted: true,
76
+ buttons: [
77
+ {
78
+ ...deleteEmptyButton(card.button),
79
+ },
80
+ ],
81
+ version: 'primary',
82
+ benefitsVersion: 'normal',
83
+ benefits: card?.cardItems?.map(itemToBenefit),
84
+ imageOptions: {
85
+ directionRight: false,
86
+ imageAlign: 'end',
87
+ },
88
+ padding: 'p-3xl',
89
+ },
90
+ });
91
+
92
+ const itemToBenefit = (benefit) => {
93
+ const isIconName = benefit?.icon?.icon || benefit?.icon?.src;
94
+ if (!isIconName) {
95
+ deleteProp(benefit, 'icon');
96
+ }
97
+ benefit.type = 'default';
98
+ if (benefit?.text) {
99
+ benefit.description = benefit?.text;
100
+ }
101
+
102
+ return benefit;
103
+ };