@redneckz/wildless-cms-uni-blocks 0.3.38 → 0.3.41
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/bundle/bundle.umd.js +4 -4
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/GracePeriod/GracePeriod.js +2 -2
- package/dist/components/GracePeriod/GracePeriod.js.map +1 -1
- package/dist/components/NavigatorTabs/NavigatorTabs.js +1 -1
- package/dist/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
- package/dist/utils/changeHashOnScroll.js +1 -1
- package/dist/utils/changeHashOnScroll.js.map +1 -1
- package/lib/components/GracePeriod/GracePeriod.js +2 -2
- package/lib/components/GracePeriod/GracePeriod.js.map +1 -1
- package/lib/components/NavigatorTabs/NavigatorTabs.js +1 -1
- package/lib/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
- package/lib/utils/changeHashOnScroll.js +1 -1
- package/lib/utils/changeHashOnScroll.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/GracePeriod/GracePeriod.js +2 -2
- package/mobile/dist/components/GracePeriod/GracePeriod.js.map +1 -1
- package/mobile/dist/components/NavigatorTabs/NavigatorTabs.js +1 -1
- package/mobile/dist/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
- package/mobile/dist/utils/changeHashOnScroll.js +1 -1
- package/mobile/dist/utils/changeHashOnScroll.js.map +1 -1
- package/mobile/lib/components/GracePeriod/GracePeriod.js +2 -2
- package/mobile/lib/components/GracePeriod/GracePeriod.js.map +1 -1
- package/mobile/lib/components/NavigatorTabs/NavigatorTabs.js +1 -1
- package/mobile/lib/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
- package/mobile/lib/utils/changeHashOnScroll.js +1 -1
- package/mobile/lib/utils/changeHashOnScroll.js.map +1 -1
- package/mobile/src/components/GracePeriod/GracePeriod.example.json +6 -11
- package/mobile/src/components/GracePeriod/GracePeriod.tsx +11 -9
- package/mobile/src/components/NavigatorTabs/NavigatorTabs.tsx +1 -1
- package/mobile/src/utils/changeHashOnScroll.ts +1 -1
- package/package.json +1 -1
- package/src/components/GracePeriod/GracePeriod.example.json +6 -11
- package/src/components/GracePeriod/GracePeriod.tsx +11 -9
- package/src/components/NavigatorTabs/NavigatorTabs.tsx +1 -1
- package/src/utils/changeHashOnScroll.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"title": "Пример использования «Карты для покупок в рассрочку»:",
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "Необязательное описание блока",
|
|
4
4
|
"calendar": [
|
|
5
5
|
{
|
|
6
6
|
"blackText": "1 декабря — беспроцентный период",
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
"src": "calendar/august.png",
|
|
13
13
|
"format": "webp",
|
|
14
14
|
"size": {
|
|
15
|
-
"width": 210
|
|
16
|
-
"height": "auto"
|
|
15
|
+
"width": 210
|
|
17
16
|
},
|
|
18
17
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
19
18
|
}
|
|
@@ -30,8 +29,7 @@
|
|
|
30
29
|
"src": "calendar/september.png",
|
|
31
30
|
"format": "webp",
|
|
32
31
|
"size": {
|
|
33
|
-
"width": 210
|
|
34
|
-
"height": "auto"
|
|
32
|
+
"width": 210
|
|
35
33
|
},
|
|
36
34
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
37
35
|
}
|
|
@@ -42,8 +40,7 @@
|
|
|
42
40
|
"src": "calendar/october.png",
|
|
43
41
|
"format": "webp",
|
|
44
42
|
"size": {
|
|
45
|
-
"width": 210
|
|
46
|
-
"height": "auto"
|
|
43
|
+
"width": 210
|
|
47
44
|
},
|
|
48
45
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
49
46
|
}
|
|
@@ -60,8 +57,7 @@
|
|
|
60
57
|
"src": "calendar/november.png",
|
|
61
58
|
"format": "webp",
|
|
62
59
|
"size": {
|
|
63
|
-
"width": 210
|
|
64
|
-
"height": "auto"
|
|
60
|
+
"width": 210
|
|
65
61
|
},
|
|
66
62
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
67
63
|
}
|
|
@@ -78,8 +74,7 @@
|
|
|
78
74
|
"src": "calendar/december.png",
|
|
79
75
|
"format": "webp",
|
|
80
76
|
"size": {
|
|
81
|
-
"width": 210
|
|
82
|
-
"height": "auto"
|
|
77
|
+
"width": 210
|
|
83
78
|
},
|
|
84
79
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
85
80
|
}
|
|
@@ -13,7 +13,7 @@ export const GracePeriod = JSX<GracePeriodProps>(
|
|
|
13
13
|
<section className={`bg-white p-16 pt-12 ${className}`} id={anchor}>
|
|
14
14
|
<Heading headingType="h2" className="text-center" title={title} />
|
|
15
15
|
<div className="font-light text-base-md text-center mt-3">{description}</div>
|
|
16
|
-
{renderCalendar(calendar)}
|
|
16
|
+
{calendar ? renderCalendar(calendar) : null}
|
|
17
17
|
</section>
|
|
18
18
|
);
|
|
19
19
|
},
|
|
@@ -60,11 +60,13 @@ const renderMonthNames = (item, colSize) =>
|
|
|
60
60
|
</div>
|
|
61
61
|
));
|
|
62
62
|
const renderMonthImages = (item) =>
|
|
63
|
-
item.month.map((_) =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
item.month.map((_) =>
|
|
64
|
+
_.image?.src ? (
|
|
65
|
+
<div
|
|
66
|
+
key={`monthImage-${_.image.src}`}
|
|
67
|
+
className="max-h-[207px] border-r-[1px] pr-3 mr-3 border-r-gray/100 last:border-r-0 last:pr-0 last:mr-0"
|
|
68
|
+
>
|
|
69
|
+
<Img image={_.image} className="flex" />
|
|
70
|
+
</div>
|
|
71
|
+
) : null,
|
|
72
|
+
);
|
|
@@ -10,7 +10,7 @@ export interface TabsBlockProps extends UniBlockProps, NavigatorTabsContent {}
|
|
|
10
10
|
export const NavigatorTabs = JSX<TabsBlockProps>(
|
|
11
11
|
({ className = '', navigatorTabs, context, anchor = null }) => {
|
|
12
12
|
const router = context.useRouter();
|
|
13
|
-
const href = globalThis.location
|
|
13
|
+
const href = globalThis.location?.href; // TODO: remove globalThis, use href from router
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
16
|
<section
|
|
@@ -2,7 +2,7 @@ import { Router } from '../components/ContentPage/ContentPageContext';
|
|
|
2
2
|
|
|
3
3
|
export const changeHashOnScroll = (router: Router, blocks: NodeListOf<Element> | null) => {
|
|
4
4
|
blocks?.forEach((block) => {
|
|
5
|
-
const currentHash = globalThis.location
|
|
5
|
+
const currentHash = globalThis.location?.hash; // TODO: remove globalThis, use href from router
|
|
6
6
|
const anchorHash = `#${block?.id}`;
|
|
7
7
|
|
|
8
8
|
if (currentHash === anchorHash) return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"title": "Пример использования «Карты для покупок в рассрочку»:",
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "Необязательное описание блока",
|
|
4
4
|
"calendar": [
|
|
5
5
|
{
|
|
6
6
|
"blackText": "1 декабря — беспроцентный период",
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
"src": "calendar/august.png",
|
|
13
13
|
"format": "webp",
|
|
14
14
|
"size": {
|
|
15
|
-
"width": 210
|
|
16
|
-
"height": "auto"
|
|
15
|
+
"width": 210
|
|
17
16
|
},
|
|
18
17
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
19
18
|
}
|
|
@@ -30,8 +29,7 @@
|
|
|
30
29
|
"src": "calendar/september.png",
|
|
31
30
|
"format": "webp",
|
|
32
31
|
"size": {
|
|
33
|
-
"width": 210
|
|
34
|
-
"height": "auto"
|
|
32
|
+
"width": 210
|
|
35
33
|
},
|
|
36
34
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
37
35
|
}
|
|
@@ -42,8 +40,7 @@
|
|
|
42
40
|
"src": "calendar/october.png",
|
|
43
41
|
"format": "webp",
|
|
44
42
|
"size": {
|
|
45
|
-
"width": 210
|
|
46
|
-
"height": "auto"
|
|
43
|
+
"width": 210
|
|
47
44
|
},
|
|
48
45
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
49
46
|
}
|
|
@@ -60,8 +57,7 @@
|
|
|
60
57
|
"src": "calendar/november.png",
|
|
61
58
|
"format": "webp",
|
|
62
59
|
"size": {
|
|
63
|
-
"width": 210
|
|
64
|
-
"height": "auto"
|
|
60
|
+
"width": 210
|
|
65
61
|
},
|
|
66
62
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
67
63
|
}
|
|
@@ -78,8 +74,7 @@
|
|
|
78
74
|
"src": "calendar/december.png",
|
|
79
75
|
"format": "webp",
|
|
80
76
|
"size": {
|
|
81
|
-
"width": 210
|
|
82
|
-
"height": "auto"
|
|
77
|
+
"width": 210
|
|
83
78
|
},
|
|
84
79
|
"alt": "Пример использования «Карты для покупок в рассрочку»"
|
|
85
80
|
}
|
|
@@ -13,7 +13,7 @@ export const GracePeriod = JSX<GracePeriodProps>(
|
|
|
13
13
|
<section className={`bg-white p-16 pt-12 ${className}`} id={anchor}>
|
|
14
14
|
<Heading headingType="h2" className="text-center" title={title} />
|
|
15
15
|
<div className="font-light text-base-md text-center mt-3">{description}</div>
|
|
16
|
-
{renderCalendar(calendar)}
|
|
16
|
+
{calendar ? renderCalendar(calendar) : null}
|
|
17
17
|
</section>
|
|
18
18
|
);
|
|
19
19
|
},
|
|
@@ -60,11 +60,13 @@ const renderMonthNames = (item, colSize) =>
|
|
|
60
60
|
</div>
|
|
61
61
|
));
|
|
62
62
|
const renderMonthImages = (item) =>
|
|
63
|
-
item.month.map((_) =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
item.month.map((_) =>
|
|
64
|
+
_.image?.src ? (
|
|
65
|
+
<div
|
|
66
|
+
key={`monthImage-${_.image.src}`}
|
|
67
|
+
className="max-h-[207px] border-r-[1px] pr-3 mr-3 border-r-gray/100 last:border-r-0 last:pr-0 last:mr-0"
|
|
68
|
+
>
|
|
69
|
+
<Img image={_.image} className="flex" />
|
|
70
|
+
</div>
|
|
71
|
+
) : null,
|
|
72
|
+
);
|
|
@@ -10,7 +10,7 @@ export interface TabsBlockProps extends UniBlockProps, NavigatorTabsContent {}
|
|
|
10
10
|
export const NavigatorTabs = JSX<TabsBlockProps>(
|
|
11
11
|
({ className = '', navigatorTabs, context, anchor = null }) => {
|
|
12
12
|
const router = context.useRouter();
|
|
13
|
-
const href = globalThis.location
|
|
13
|
+
const href = globalThis.location?.href; // TODO: remove globalThis, use href from router
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
16
|
<section
|
|
@@ -2,7 +2,7 @@ import { Router } from '../components/ContentPage/ContentPageContext';
|
|
|
2
2
|
|
|
3
3
|
export const changeHashOnScroll = (router: Router, blocks: NodeListOf<Element> | null) => {
|
|
4
4
|
blocks?.forEach((block) => {
|
|
5
|
-
const currentHash = globalThis.location
|
|
5
|
+
const currentHash = globalThis.location?.hash; // TODO: remove globalThis, use href from router
|
|
6
6
|
const anchorHash = `#${block?.id}`;
|
|
7
7
|
|
|
8
8
|
if (currentHash === anchorHash) return;
|