@redneckz/wildless-cms-uni-blocks 0.9.8 → 0.9.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 (122) hide show
  1. package/bin/migration-scripts/0.9.8.js +29 -0
  2. package/bin/migration-scripts/0.9.9.js +110 -0
  3. package/bundle/blocks.schema.json +1 -1
  4. package/bundle/bundle.umd.js +11 -34
  5. package/bundle/bundle.umd.min.js +1 -1
  6. package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -0
  7. package/bundle/components/StepsBlock/StepsBlockContent.d.ts +10 -1
  8. package/dist/components/Blocks.js +0 -2
  9. package/dist/components/Blocks.js.map +1 -1
  10. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +4 -6
  11. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  12. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -0
  13. package/dist/components/StepsBlock/StepsBlock.js +5 -3
  14. package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  15. package/dist/components/StepsBlock/StepsBlockContent.d.ts +10 -1
  16. package/dist/components/StepsBlock/StepsBlockStyleMaps.js +2 -2
  17. package/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
  18. package/lib/common.css +1 -1
  19. package/lib/components/Blocks.js +0 -2
  20. package/lib/components/Blocks.js.map +1 -1
  21. package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
  22. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.d.ts +2 -0
  23. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +4 -6
  24. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  25. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -0
  26. package/lib/components/StepsBlock/StepsBlock.js +5 -3
  27. package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  28. package/lib/components/StepsBlock/StepsBlockContent.d.ts +10 -1
  29. package/lib/components/StepsBlock/StepsBlockStyleMaps.js +2 -2
  30. package/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
  31. package/mobile/bundle/bundle.umd.js +3 -3
  32. package/mobile/bundle/bundle.umd.min.js +1 -1
  33. package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -0
  34. package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +10 -1
  35. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +4 -6
  36. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  37. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -0
  38. package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +10 -1
  39. package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js +2 -2
  40. package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
  41. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +4 -6
  42. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  43. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -0
  44. package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +10 -1
  45. package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js +2 -2
  46. package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
  47. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -0
  48. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +18 -34
  49. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -0
  50. package/mobile/src/components/StepsBlock/StepsBlock.example.json +7 -5
  51. package/mobile/src/components/StepsBlock/StepsBlock.ui.json +10 -0
  52. package/mobile/src/components/StepsBlock/StepsBlockContent.ts +10 -2
  53. package/mobile/src/components/StepsBlock/StepsBlockStyleMaps.ts +3 -2
  54. package/package.json +1 -1
  55. package/src/components/Blocks.ts +0 -2
  56. package/src/components/Carousel/Carousel.fixture.tsx +25 -2
  57. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -0
  58. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +28 -1
  59. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +18 -34
  60. package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -0
  61. package/src/components/StepsBlock/StepsBlock.example.json +7 -5
  62. package/src/components/StepsBlock/StepsBlock.fixture.tsx +14 -8
  63. package/src/components/StepsBlock/StepsBlock.tsx +13 -4
  64. package/src/components/StepsBlock/StepsBlock.ui.json +10 -0
  65. package/src/components/StepsBlock/StepsBlockContent.ts +10 -2
  66. package/src/components/StepsBlock/StepsBlockStyleMaps.ts +3 -2
  67. package/bundle/components/Recommendation/Recommendation.d.ts +0 -5
  68. package/bundle/components/Recommendation/RecommendationCard.d.ts +0 -5
  69. package/bundle/components/Recommendation/RecommendationContent.d.ts +0 -24
  70. package/dist/components/Recommendation/Recommendation.d.ts +0 -5
  71. package/dist/components/Recommendation/Recommendation.js +0 -26
  72. package/dist/components/Recommendation/Recommendation.js.map +0 -1
  73. package/dist/components/Recommendation/RecommendationCard.d.ts +0 -5
  74. package/dist/components/Recommendation/RecommendationCard.js +0 -17
  75. package/dist/components/Recommendation/RecommendationCard.js.map +0 -1
  76. package/dist/components/Recommendation/RecommendationContent.d.ts +0 -24
  77. package/dist/components/Recommendation/RecommendationContent.js +0 -2
  78. package/dist/components/Recommendation/RecommendationContent.js.map +0 -1
  79. package/lib/components/Recommendation/Recommendation.d.ts +0 -5
  80. package/lib/components/Recommendation/Recommendation.fixture.d.ts +0 -15
  81. package/lib/components/Recommendation/Recommendation.js +0 -24
  82. package/lib/components/Recommendation/Recommendation.js.map +0 -1
  83. package/lib/components/Recommendation/RecommendationCard.d.ts +0 -5
  84. package/lib/components/Recommendation/RecommendationCard.js +0 -15
  85. package/lib/components/Recommendation/RecommendationCard.js.map +0 -1
  86. package/lib/components/Recommendation/RecommendationContent.d.ts +0 -24
  87. package/lib/components/Recommendation/RecommendationContent.js +0 -2
  88. package/lib/components/Recommendation/RecommendationContent.js.map +0 -1
  89. package/mobile/bundle/components/Recommendation/Recommendation.d.ts +0 -5
  90. package/mobile/bundle/components/Recommendation/RecommendationCard.d.ts +0 -5
  91. package/mobile/bundle/components/Recommendation/RecommendationContent.d.ts +0 -24
  92. package/mobile/dist/components/Recommendation/Recommendation.d.ts +0 -5
  93. package/mobile/dist/components/Recommendation/Recommendation.js +0 -26
  94. package/mobile/dist/components/Recommendation/Recommendation.js.map +0 -1
  95. package/mobile/dist/components/Recommendation/RecommendationCard.d.ts +0 -5
  96. package/mobile/dist/components/Recommendation/RecommendationCard.js +0 -17
  97. package/mobile/dist/components/Recommendation/RecommendationCard.js.map +0 -1
  98. package/mobile/dist/components/Recommendation/RecommendationContent.d.ts +0 -24
  99. package/mobile/dist/components/Recommendation/RecommendationContent.js +0 -2
  100. package/mobile/dist/components/Recommendation/RecommendationContent.js.map +0 -1
  101. package/mobile/lib/components/Recommendation/Recommendation.d.ts +0 -5
  102. package/mobile/lib/components/Recommendation/Recommendation.js +0 -24
  103. package/mobile/lib/components/Recommendation/Recommendation.js.map +0 -1
  104. package/mobile/lib/components/Recommendation/RecommendationCard.d.ts +0 -5
  105. package/mobile/lib/components/Recommendation/RecommendationCard.js +0 -15
  106. package/mobile/lib/components/Recommendation/RecommendationCard.js.map +0 -1
  107. package/mobile/lib/components/Recommendation/RecommendationContent.d.ts +0 -24
  108. package/mobile/lib/components/Recommendation/RecommendationContent.js +0 -2
  109. package/mobile/lib/components/Recommendation/RecommendationContent.js.map +0 -1
  110. package/mobile/src/components/Catalog/Catalog.ui.json +0 -1
  111. package/mobile/src/components/Recommendation/Recommendation.example.json +0 -61
  112. package/mobile/src/components/Recommendation/Recommendation.tsx +0 -66
  113. package/mobile/src/components/Recommendation/Recommendation.ui.json +0 -19
  114. package/mobile/src/components/Recommendation/RecommendationCard.tsx +0 -49
  115. package/mobile/src/components/Recommendation/RecommendationContent.ts +0 -27
  116. package/src/components/Catalog/Catalog.ui.json +0 -1
  117. package/src/components/Recommendation/Recommendation.example.json +0 -61
  118. package/src/components/Recommendation/Recommendation.fixture.tsx +0 -176
  119. package/src/components/Recommendation/Recommendation.tsx +0 -66
  120. package/src/components/Recommendation/Recommendation.ui.json +0 -19
  121. package/src/components/Recommendation/RecommendationCard.tsx +0 -49
  122. package/src/components/Recommendation/RecommendationContent.ts +0 -27
@@ -0,0 +1,29 @@
1
+ export const description = 'v0.9.8';
2
+
3
+ export default (unitPath, content) => {
4
+ if (!content?.blocks) {
5
+ return content;
6
+ }
7
+
8
+ for (const block of content.blocks) {
9
+ adjustStepsBlock(block);
10
+ }
11
+
12
+ return { ...content };
13
+ };
14
+
15
+ const adjustStepsBlock = (block) => {
16
+ if (block.blocks) {
17
+ for (const childBlock of block.blocks) {
18
+ adjustStepsBlock(childBlock);
19
+ }
20
+ }
21
+
22
+ if (block.type !== 'StepsBlock') {
23
+ return;
24
+ }
25
+ if (block?.content?.button) {
26
+ block.content.buttons = [block?.content?.button];
27
+ Reflect.deleteProperty(block.content, 'button');
28
+ }
29
+ };
@@ -0,0 +1,110 @@
1
+ import { deleteEmptyProps, renameProp } from '../utils.js';
2
+
3
+ export const description = 'v0.9.9';
4
+
5
+ export default (unitPath, content) => {
6
+ if (!content?.blocks) {
7
+ return content;
8
+ }
9
+
10
+ for (const block of content.blocks) {
11
+ adjustCarouselBlock(block);
12
+ }
13
+
14
+ return { ...content };
15
+ };
16
+
17
+ const adjustCarouselBlock = (block) => {
18
+ if (block.blocks) {
19
+ for (const childBlock of block.blocks) {
20
+ adjustCarouselBlock(childBlock);
21
+ }
22
+ }
23
+
24
+ if (block.type === 'Recommendation') {
25
+ adjustCarousel(block, 'CarouselRecommendationCard');
26
+ }
27
+ };
28
+
29
+ const adjustCarousel = (block, type, cardCount) => {
30
+ if (block.blocks) {
31
+ for (const childBlock of block.blocks) {
32
+ adjustCarousel(childBlock);
33
+ }
34
+ }
35
+
36
+ const recommendations = block?.content?.recommendations;
37
+ const headlineTitle = block?.content?.title;
38
+ const anchor = block?.anchor;
39
+ block.blocks = [];
40
+ if (headlineTitle) {
41
+ block.blocks.push(getHeadlineBlock(headlineTitle));
42
+ }
43
+ if (recommendations && recommendations?.length > 0) {
44
+ block.blocks.push(getCarousel(recommendations, type, cardCount));
45
+ }
46
+ if (anchor) {
47
+ block.anchor = anchor;
48
+ }
49
+
50
+ getVerticalLayout(block);
51
+ };
52
+
53
+ const getVerticalLayout = (block) => {
54
+ block.content = {
55
+ isTheme: false,
56
+ version: 'secondary',
57
+ isPadding: true,
58
+ isInnerPadding: true,
59
+ align: 'stretch',
60
+ gap: 'L',
61
+ };
62
+ block.style = ['col-span-12'];
63
+ block.type = 'VerticalLayout';
64
+ };
65
+
66
+ const getCarousel = (recommendation, cardType) => {
67
+ return {
68
+ content: {
69
+ isTheme: true,
70
+ visibleItemCount: 0,
71
+ isBlur: false,
72
+ arrowsPadded: true,
73
+ isCycle: false,
74
+ isPadding: false,
75
+ version: '',
76
+ },
77
+ style: ['col-span-12'],
78
+ type: 'Carousel',
79
+ blocks: recommendation.map((_) => {
80
+ renameProp(_, 'image', 'icon');
81
+ if (!_.button?.text) {
82
+ Reflect.deleteProperty(_, 'button');
83
+ }
84
+ if (_?.recommendations) {
85
+ Reflect.deleteProperty(_, 'recommendations');
86
+ }
87
+ _.version = 'secondary';
88
+ deleteEmptyProps(_);
89
+
90
+ return {
91
+ content: _,
92
+ style: ['col-span-12'],
93
+ type: cardType,
94
+ };
95
+ }),
96
+ };
97
+ };
98
+
99
+ const getHeadlineBlock = (title) => ({
100
+ content: {
101
+ isTheme: true,
102
+ title: title,
103
+ align: 'text-center',
104
+ bgColorHeadline: 'transparent',
105
+ headlineVersion: 'M',
106
+ isPadding: false,
107
+ },
108
+ style: ['col-span-12'],
109
+ type: 'Headline',
110
+ });