@redneckz/wildless-cms-uni-blocks 0.9.7 → 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.
- package/bin/migration-scripts/0.9.8.js +29 -0
- package/bin/migration-scripts/0.9.9.js +110 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +15 -38
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -0
- package/bundle/components/StepsBlock/StepsBlockContent.d.ts +10 -1
- package/dist/components/Blocks.js +0 -2
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCard.js +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +2 -2
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +4 -6
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -0
- package/dist/components/StepsBlock/StepsBlock.js +5 -3
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +10 -1
- package/dist/components/StepsBlock/StepsBlockStyleMaps.js +2 -2
- package/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/dist/ui-kit/LinkWrapper/LinkWrapper.js +2 -1
- package/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +0 -2
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
- package/lib/components/CarouselProductCard/CarouselProductCard.js +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +2 -2
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.d.ts +2 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +4 -6
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -0
- package/lib/components/StepsBlock/StepsBlock.js +5 -3
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +10 -1
- package/lib/components/StepsBlock/StepsBlockStyleMaps.js +2 -2
- package/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/lib/ui-kit/LinkWrapper/LinkWrapper.js +2 -1
- package/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +3 -3
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -0
- package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +10 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +2 -2
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +4 -6
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -0
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +10 -1
- package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js +2 -2
- package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.js +2 -1
- package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +2 -2
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +4 -6
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -0
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +10 -1
- package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js +2 -2
- package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.js +2 -1
- package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -1
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.tsx +1 -1
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +3 -3
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +19 -30
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -0
- package/mobile/src/components/StepsBlock/StepsBlock.example.json +7 -5
- package/mobile/src/components/StepsBlock/StepsBlock.ui.json +10 -0
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +10 -2
- package/mobile/src/components/StepsBlock/StepsBlockStyleMaps.ts +3 -2
- package/mobile/src/ui-kit/LinkWrapper/LinkWrapper.tsx +2 -1
- package/mobile/src/ui-kit/SwipeListControl/SwipeListItem.tsx +1 -1
- package/package.json +1 -1
- package/src/components/Blocks.ts +0 -2
- package/src/components/Carousel/Carousel.fixture.tsx +25 -2
- package/src/components/CarouselProductCard/CarouselProductCard.tsx +1 -1
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.fixture.tsx +2 -2
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +3 -3
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +28 -1
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +19 -30
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -0
- package/src/components/StepsBlock/StepsBlock.example.json +7 -5
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +14 -8
- package/src/components/StepsBlock/StepsBlock.tsx +13 -4
- package/src/components/StepsBlock/StepsBlock.ui.json +10 -0
- package/src/components/StepsBlock/StepsBlockContent.ts +10 -2
- package/src/components/StepsBlock/StepsBlockStyleMaps.ts +3 -2
- package/src/ui-kit/LinkWrapper/LinkWrapper.tsx +2 -1
- package/src/ui-kit/SwipeListControl/SwipeListItem.tsx +1 -1
- package/bundle/components/Recommendation/Recommendation.d.ts +0 -5
- package/bundle/components/Recommendation/RecommendationCard.d.ts +0 -5
- package/bundle/components/Recommendation/RecommendationContent.d.ts +0 -24
- package/dist/components/Recommendation/Recommendation.d.ts +0 -5
- package/dist/components/Recommendation/Recommendation.js +0 -26
- package/dist/components/Recommendation/Recommendation.js.map +0 -1
- package/dist/components/Recommendation/RecommendationCard.d.ts +0 -5
- package/dist/components/Recommendation/RecommendationCard.js +0 -17
- package/dist/components/Recommendation/RecommendationCard.js.map +0 -1
- package/dist/components/Recommendation/RecommendationContent.d.ts +0 -24
- package/dist/components/Recommendation/RecommendationContent.js +0 -2
- package/dist/components/Recommendation/RecommendationContent.js.map +0 -1
- package/lib/components/Recommendation/Recommendation.d.ts +0 -5
- package/lib/components/Recommendation/Recommendation.fixture.d.ts +0 -15
- package/lib/components/Recommendation/Recommendation.js +0 -24
- package/lib/components/Recommendation/Recommendation.js.map +0 -1
- package/lib/components/Recommendation/RecommendationCard.d.ts +0 -5
- package/lib/components/Recommendation/RecommendationCard.js +0 -15
- package/lib/components/Recommendation/RecommendationCard.js.map +0 -1
- package/lib/components/Recommendation/RecommendationContent.d.ts +0 -24
- package/lib/components/Recommendation/RecommendationContent.js +0 -2
- package/lib/components/Recommendation/RecommendationContent.js.map +0 -1
- package/mobile/bundle/components/Recommendation/Recommendation.d.ts +0 -5
- package/mobile/bundle/components/Recommendation/RecommendationCard.d.ts +0 -5
- package/mobile/bundle/components/Recommendation/RecommendationContent.d.ts +0 -24
- package/mobile/dist/components/Recommendation/Recommendation.d.ts +0 -5
- package/mobile/dist/components/Recommendation/Recommendation.js +0 -26
- package/mobile/dist/components/Recommendation/Recommendation.js.map +0 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.d.ts +0 -5
- package/mobile/dist/components/Recommendation/RecommendationCard.js +0 -17
- package/mobile/dist/components/Recommendation/RecommendationCard.js.map +0 -1
- package/mobile/dist/components/Recommendation/RecommendationContent.d.ts +0 -24
- package/mobile/dist/components/Recommendation/RecommendationContent.js +0 -2
- package/mobile/dist/components/Recommendation/RecommendationContent.js.map +0 -1
- package/mobile/lib/components/Recommendation/Recommendation.d.ts +0 -5
- package/mobile/lib/components/Recommendation/Recommendation.js +0 -24
- package/mobile/lib/components/Recommendation/Recommendation.js.map +0 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.d.ts +0 -5
- package/mobile/lib/components/Recommendation/RecommendationCard.js +0 -15
- package/mobile/lib/components/Recommendation/RecommendationCard.js.map +0 -1
- package/mobile/lib/components/Recommendation/RecommendationContent.d.ts +0 -24
- package/mobile/lib/components/Recommendation/RecommendationContent.js +0 -2
- package/mobile/lib/components/Recommendation/RecommendationContent.js.map +0 -1
- package/mobile/src/components/Catalog/Catalog.ui.json +0 -1
- package/mobile/src/components/Recommendation/Recommendation.example.json +0 -61
- package/mobile/src/components/Recommendation/Recommendation.tsx +0 -66
- package/mobile/src/components/Recommendation/Recommendation.ui.json +0 -19
- package/mobile/src/components/Recommendation/RecommendationCard.tsx +0 -49
- package/mobile/src/components/Recommendation/RecommendationContent.ts +0 -27
- package/src/components/Catalog/Catalog.ui.json +0 -1
- package/src/components/Recommendation/Recommendation.example.json +0 -61
- package/src/components/Recommendation/Recommendation.fixture.tsx +0 -176
- package/src/components/Recommendation/Recommendation.tsx +0 -66
- package/src/components/Recommendation/Recommendation.ui.json +0 -19
- package/src/components/Recommendation/RecommendationCard.tsx +0 -49
- 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
|
+
});
|