@redneckz/wildless-cms-uni-blocks 0.9.1 → 0.9.3
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.5.14.js +6 -0
- package/bin/migration-scripts/0.8.17.js +6 -0
- package/bin/migration-scripts/0.8.24.js +8 -2
- package/bin/migration-scripts/0.8.8.js +6 -0
- package/bin/migration-scripts/{0.8.31.js → 0.9.3.js} +14 -12
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +12 -4
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/bundle/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/bundle/components/Footer/FooterContent.d.ts +2 -2
- package/dist/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/dist/components/CarouselEventCard/CarouselEventCard.js +9 -3
- package/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCard.js +9 -5
- package/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/dist/components/Footer/FooterContent.d.ts +2 -2
- package/lib/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/lib/components/CarouselEventCard/CarouselEventCard.js +9 -3
- package/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCard.js +9 -5
- package/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/lib/components/Footer/FooterContent.d.ts +2 -2
- package/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/mobile/bundle/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/mobile/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/mobile/bundle/components/Footer/FooterContent.d.ts +2 -2
- package/mobile/dist/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js +9 -3
- package/mobile/dist/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js +9 -5
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/mobile/dist/components/Footer/FooterContent.d.ts +2 -2
- package/mobile/lib/components/CarouselEventCard/CarouselEventCard.d.ts +1 -1
- package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js +9 -3
- package/mobile/lib/components/CarouselEventCard/CarouselEventCard.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.d.ts +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js +9 -5
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -1
- package/mobile/lib/components/Footer/FooterContent.d.ts +2 -2
- package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.example.json +0 -1
- package/mobile/src/components/CarouselEventCard/CarouselEventCard.example.json +1 -3
- package/mobile/src/components/CarouselEventCard/CarouselEventCard.tsx +19 -9
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.example.json +0 -1
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.tsx +21 -12
- package/mobile/src/components/CarouselProductCard/CarouselProductCardContent.ts +3 -1
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +0 -2
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +0 -1
- package/mobile/src/components/Footer/Footer.ui.json +1 -11
- package/mobile/src/components/Footer/FooterContent.ts +2 -3
- package/package.json +1 -1
- package/src/components/CarouselCatalogCard/CarouselCatalogCard.example.json +0 -1
- package/src/components/CarouselEventCard/CarouselEventCard.example.json +1 -3
- package/src/components/CarouselEventCard/CarouselEventCard.tsx +19 -9
- package/src/components/CarouselProductCard/CarouselProductCard.example.json +0 -1
- package/src/components/CarouselProductCard/CarouselProductCard.tsx +21 -12
- package/src/components/CarouselProductCard/CarouselProductCardContent.ts +3 -1
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +0 -2
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +0 -1
- package/src/components/Footer/Footer.ui.json +1 -11
- package/src/components/Footer/FooterContent.ts +2 -3
- package/bin/migration-scripts/0.4.5.js +0 -109
- package/bin/migration-scripts/0.5.10.js +0 -36
- package/bin/migration-scripts/0.6.16.js +0 -90
- package/bin/migration-scripts/0.6.34.js +0 -53
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { jsonCopy } from '../utils.js';
|
|
2
|
-
|
|
3
|
-
export const description = 'v0.6.16';
|
|
4
|
-
|
|
5
|
-
const replaceToContent = (obj, prop) => {
|
|
6
|
-
if (!obj.hasOwnProperty('content')) {
|
|
7
|
-
Object.assign(obj, { content: {} });
|
|
8
|
-
}
|
|
9
|
-
if (obj.hasOwnProperty(prop) && prop) {
|
|
10
|
-
Object.assign(obj.content, { [prop]: obj[prop] });
|
|
11
|
-
Reflect.deleteProperty(obj, prop);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default (unitPath, content) => {
|
|
16
|
-
if (!content?.blocks) {
|
|
17
|
-
return content;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
for (const block of content.blocks) {
|
|
21
|
-
adjustOtherProducts(block);
|
|
22
|
-
adjustAccordion(block);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return { ...content };
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const adjustAccordionItems = (accordionItems) =>
|
|
29
|
-
accordionItems.map((item) => {
|
|
30
|
-
item.type = 'AccordionItem';
|
|
31
|
-
item.content = {};
|
|
32
|
-
replaceToContent(item, 'label');
|
|
33
|
-
replaceToContent(item, 'labelIcon');
|
|
34
|
-
replaceToContent(item, 'bordered');
|
|
35
|
-
|
|
36
|
-
if (!item?.blocks) {
|
|
37
|
-
return item;
|
|
38
|
-
}
|
|
39
|
-
item.blocks = item.blocks.map((_) => {
|
|
40
|
-
if (_?.blockListType) {
|
|
41
|
-
const { blockListType = '', style, ...rest } = _;
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
content: { ...rest },
|
|
45
|
-
type: blockListType,
|
|
46
|
-
style,
|
|
47
|
-
};
|
|
48
|
-
} else {
|
|
49
|
-
return _;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
return item;
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
function adjustAccordion(block) {
|
|
56
|
-
if (block.type !== 'Accordion' || !block.content || !block.content?.accordionItems) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const content = block.content;
|
|
60
|
-
block.blocks = adjustAccordionItems(content.accordionItems);
|
|
61
|
-
Reflect.deleteProperty(content, 'accordionItems');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const adjustOtherProductsItems = (blockItems) => {
|
|
65
|
-
return blockItems.map((item) => {
|
|
66
|
-
item.type = 'OtherProductsItem';
|
|
67
|
-
replaceToContent(item, 'label');
|
|
68
|
-
if (!item?.blocks) {
|
|
69
|
-
return item;
|
|
70
|
-
}
|
|
71
|
-
item.blocks = item.blocks.map((_) => {
|
|
72
|
-
const { blockListType, style, ...rest } = _;
|
|
73
|
-
|
|
74
|
-
return {
|
|
75
|
-
content: { ...rest },
|
|
76
|
-
type: blockListType,
|
|
77
|
-
style,
|
|
78
|
-
};
|
|
79
|
-
});
|
|
80
|
-
return item;
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
function adjustOtherProducts(block) {
|
|
84
|
-
if (block.type !== 'OtherProducts' || !block.content || !block.content.blockItems) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const content = block.content;
|
|
88
|
-
block.blocks = adjustOtherProductsItems(content.blockItems);
|
|
89
|
-
Reflect.deleteProperty(content, 'blockItems');
|
|
90
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export const description = 'v0.6.34';
|
|
2
|
-
|
|
3
|
-
export default (unitPath, content) => {
|
|
4
|
-
if (!content?.blocks) {
|
|
5
|
-
return content;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
for (const block of content.blocks) {
|
|
9
|
-
adjustAccordion(block);
|
|
10
|
-
adjustOtherProducts(block);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return { ...content };
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
function adjustAccordion(block) {
|
|
17
|
-
if (block.type !== 'Accordion' || !block.blocks || block.blocks.length === 0) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
for (const accordionItemsBlock of block.blocks) {
|
|
21
|
-
if (accordionItemsBlock.type === 'AccordionItem') {
|
|
22
|
-
adjustAccordionItem(accordionItemsBlock);
|
|
23
|
-
}
|
|
24
|
-
if (accordionItemsBlock.type === 'Accordion') {
|
|
25
|
-
adjustAccordion(accordionItemsBlock);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function adjustAccordionItem(block) {
|
|
31
|
-
block.content.isFoldButtonOnTop = true;
|
|
32
|
-
block.content.version = 'primary';
|
|
33
|
-
block.type = 'RollupItem';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function adjustOtherProducts(block) {
|
|
37
|
-
if (block.type !== 'OtherProducts' || !block.blocks || block.blocks.length === 0) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
for (const otherProductsBlock of block.blocks) {
|
|
41
|
-
if (otherProductsBlock.type === 'OtherProductsItem') {
|
|
42
|
-
adjustOtherProductsItem(otherProductsBlock);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function adjustOtherProductsItem(block) {
|
|
48
|
-
block.content.isFoldButtonOnTop = false;
|
|
49
|
-
block.content.version = 'secondary';
|
|
50
|
-
block.content.isExpanded = block.isUnfolded;
|
|
51
|
-
Reflect.deleteProperty(block, 'isUnfolded');
|
|
52
|
-
block.type = 'RollupItem';
|
|
53
|
-
}
|