@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.
Files changed (37) hide show
  1. package/bundle/bundle.umd.js +4 -4
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/dist/components/GracePeriod/GracePeriod.js +2 -2
  4. package/dist/components/GracePeriod/GracePeriod.js.map +1 -1
  5. package/dist/components/NavigatorTabs/NavigatorTabs.js +1 -1
  6. package/dist/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
  7. package/dist/utils/changeHashOnScroll.js +1 -1
  8. package/dist/utils/changeHashOnScroll.js.map +1 -1
  9. package/lib/components/GracePeriod/GracePeriod.js +2 -2
  10. package/lib/components/GracePeriod/GracePeriod.js.map +1 -1
  11. package/lib/components/NavigatorTabs/NavigatorTabs.js +1 -1
  12. package/lib/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
  13. package/lib/utils/changeHashOnScroll.js +1 -1
  14. package/lib/utils/changeHashOnScroll.js.map +1 -1
  15. package/mobile/bundle/bundle.umd.js +1 -1
  16. package/mobile/bundle/bundle.umd.min.js +1 -1
  17. package/mobile/dist/components/GracePeriod/GracePeriod.js +2 -2
  18. package/mobile/dist/components/GracePeriod/GracePeriod.js.map +1 -1
  19. package/mobile/dist/components/NavigatorTabs/NavigatorTabs.js +1 -1
  20. package/mobile/dist/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
  21. package/mobile/dist/utils/changeHashOnScroll.js +1 -1
  22. package/mobile/dist/utils/changeHashOnScroll.js.map +1 -1
  23. package/mobile/lib/components/GracePeriod/GracePeriod.js +2 -2
  24. package/mobile/lib/components/GracePeriod/GracePeriod.js.map +1 -1
  25. package/mobile/lib/components/NavigatorTabs/NavigatorTabs.js +1 -1
  26. package/mobile/lib/components/NavigatorTabs/NavigatorTabs.js.map +1 -1
  27. package/mobile/lib/utils/changeHashOnScroll.js +1 -1
  28. package/mobile/lib/utils/changeHashOnScroll.js.map +1 -1
  29. package/mobile/src/components/GracePeriod/GracePeriod.example.json +6 -11
  30. package/mobile/src/components/GracePeriod/GracePeriod.tsx +11 -9
  31. package/mobile/src/components/NavigatorTabs/NavigatorTabs.tsx +1 -1
  32. package/mobile/src/utils/changeHashOnScroll.ts +1 -1
  33. package/package.json +1 -1
  34. package/src/components/GracePeriod/GracePeriod.example.json +6 -11
  35. package/src/components/GracePeriod/GracePeriod.tsx +11 -9
  36. package/src/components/NavigatorTabs/NavigatorTabs.tsx +1 -1
  37. 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
- <div
65
- key={`monthImage-${_.image.src}`}
66
- 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"
67
- >
68
- <Img image={_.image} className="flex" />
69
- </div>
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.href;
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.hash;
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
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.3.38",
3
+ "version": "0.3.41",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -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
- <div
65
- key={`monthImage-${_.image.src}`}
66
- 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"
67
- >
68
- <Img image={_.image} className="flex" />
69
- </div>
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.href;
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.hash;
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;