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

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 (71) hide show
  1. package/bin/migration-scripts/0.14.44.js +103 -0
  2. package/bin/migration-scripts/0.14.45.js +17 -0
  3. package/bundle/blocks.schema.json +1 -1
  4. package/bundle/bundle.umd.js +1 -13
  5. package/bundle/bundle.umd.min.js +1 -1
  6. package/dist/components/Blocks.js +0 -2
  7. package/dist/components/Blocks.js.map +1 -1
  8. package/lib/common.css +1 -1
  9. package/lib/components/Blocks.js +0 -2
  10. package/lib/components/Blocks.js.map +1 -1
  11. package/lib/components/VerticalLayout/VerticalLayout.fixture.d.ts +1 -0
  12. package/mobile/bundle/bundle.umd.js +1 -1
  13. package/mobile/bundle/bundle.umd.min.js +1 -1
  14. package/mobile/lib/common.css +1 -1
  15. package/package.json +1 -1
  16. package/src/components/Blocks.ts +0 -2
  17. package/src/components/VerticalLayout/VerticalLayout.fixture.tsx +62 -0
  18. package/bundle/components/BusinessBlock/BusinessBlock.d.ts +0 -5
  19. package/bundle/components/BusinessBlock/BusinessBlockContent.d.ts +0 -25
  20. package/bundle/components/BusinessBlock/BusinessCard.d.ts +0 -2
  21. package/dist/components/BusinessBlock/BusinessBlock.d.ts +0 -5
  22. package/dist/components/BusinessBlock/BusinessBlock.js +0 -9
  23. package/dist/components/BusinessBlock/BusinessBlock.js.map +0 -1
  24. package/dist/components/BusinessBlock/BusinessBlockContent.d.ts +0 -25
  25. package/dist/components/BusinessBlock/BusinessBlockContent.js +0 -2
  26. package/dist/components/BusinessBlock/BusinessBlockContent.js.map +0 -1
  27. package/dist/components/BusinessBlock/BusinessCard.d.ts +0 -2
  28. package/dist/components/BusinessBlock/BusinessCard.js +0 -17
  29. package/dist/components/BusinessBlock/BusinessCard.js.map +0 -1
  30. package/lib/components/BusinessBlock/BusinessBlock.d.ts +0 -5
  31. package/lib/components/BusinessBlock/BusinessBlock.fixture.d.ts +0 -6
  32. package/lib/components/BusinessBlock/BusinessBlock.js +0 -7
  33. package/lib/components/BusinessBlock/BusinessBlock.js.map +0 -1
  34. package/lib/components/BusinessBlock/BusinessBlockContent.d.ts +0 -25
  35. package/lib/components/BusinessBlock/BusinessBlockContent.js +0 -2
  36. package/lib/components/BusinessBlock/BusinessBlockContent.js.map +0 -1
  37. package/lib/components/BusinessBlock/BusinessCard.d.ts +0 -2
  38. package/lib/components/BusinessBlock/BusinessCard.js +0 -15
  39. package/lib/components/BusinessBlock/BusinessCard.js.map +0 -1
  40. package/mobile/bundle/components/BusinessBlock/BusinessBlock.d.ts +0 -5
  41. package/mobile/bundle/components/BusinessBlock/BusinessBlockContent.d.ts +0 -25
  42. package/mobile/bundle/components/BusinessBlock/BusinessCard.d.ts +0 -2
  43. package/mobile/dist/components/BusinessBlock/BusinessBlock.d.ts +0 -5
  44. package/mobile/dist/components/BusinessBlock/BusinessBlock.js +0 -9
  45. package/mobile/dist/components/BusinessBlock/BusinessBlock.js.map +0 -1
  46. package/mobile/dist/components/BusinessBlock/BusinessBlockContent.d.ts +0 -25
  47. package/mobile/dist/components/BusinessBlock/BusinessBlockContent.js +0 -2
  48. package/mobile/dist/components/BusinessBlock/BusinessBlockContent.js.map +0 -1
  49. package/mobile/dist/components/BusinessBlock/BusinessCard.d.ts +0 -2
  50. package/mobile/dist/components/BusinessBlock/BusinessCard.js +0 -17
  51. package/mobile/dist/components/BusinessBlock/BusinessCard.js.map +0 -1
  52. package/mobile/lib/components/BusinessBlock/BusinessBlock.d.ts +0 -5
  53. package/mobile/lib/components/BusinessBlock/BusinessBlock.js +0 -7
  54. package/mobile/lib/components/BusinessBlock/BusinessBlock.js.map +0 -1
  55. package/mobile/lib/components/BusinessBlock/BusinessBlockContent.d.ts +0 -25
  56. package/mobile/lib/components/BusinessBlock/BusinessBlockContent.js +0 -2
  57. package/mobile/lib/components/BusinessBlock/BusinessBlockContent.js.map +0 -1
  58. package/mobile/lib/components/BusinessBlock/BusinessCard.d.ts +0 -2
  59. package/mobile/lib/components/BusinessBlock/BusinessCard.js +0 -15
  60. package/mobile/lib/components/BusinessBlock/BusinessCard.js.map +0 -1
  61. package/mobile/src/components/BusinessBlock/BusinessBlock.example.json +0 -97
  62. package/mobile/src/components/BusinessBlock/BusinessBlock.tsx +0 -17
  63. package/mobile/src/components/BusinessBlock/BusinessBlock.ui.json +0 -29
  64. package/mobile/src/components/BusinessBlock/BusinessBlockContent.ts +0 -30
  65. package/mobile/src/components/BusinessBlock/BusinessCard.tsx +0 -42
  66. package/src/components/BusinessBlock/BusinessBlock.example.json +0 -97
  67. package/src/components/BusinessBlock/BusinessBlock.fixture.tsx +0 -75
  68. package/src/components/BusinessBlock/BusinessBlock.tsx +0 -17
  69. package/src/components/BusinessBlock/BusinessBlock.ui.json +0 -29
  70. package/src/components/BusinessBlock/BusinessBlockContent.ts +0 -30
  71. 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
+ };
@@ -0,0 +1,17 @@
1
+ export const description = 'v0.14.45';
2
+
3
+ const CALCULATOR_OLD_SCHEME_NAME = 'Калькулятора параметры.schema.json';
4
+ const CALCULATOR_NEW_SCHEME_NAME = 'Параметры калькулятора.schema.json';
5
+
6
+ export default (unitPath, content) => {
7
+ if (!content._schemaPath || !content._schemaPath.endsWith(CALCULATOR_OLD_SCHEME_NAME)) {
8
+ return content;
9
+ }
10
+
11
+ content._schemaPath = content._schemaPath.replace(
12
+ CALCULATOR_OLD_SCHEME_NAME,
13
+ CALCULATOR_NEW_SCHEME_NAME,
14
+ );
15
+
16
+ return { ...content };
17
+ };