@redneckz/wildless-cms-uni-blocks 0.8.2 → 0.8.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.
Files changed (255) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +106 -29
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/Carousel/CarouselContent.d.ts +6 -1
  5. package/bundle/components/Carousel/CarouselScrollButtons.d.ts +13 -0
  6. package/bundle/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
  7. package/bundle/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
  8. package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
  9. package/bundle/components/Footer/MediaButton.d.ts +2 -2
  10. package/bundle/components/Footer/SocialMedia.d.ts +2 -2
  11. package/bundle/hooks/useLink.d.ts +1 -1
  12. package/bundle/services/sitemap/isHrefActive.d.ts +2 -1
  13. package/bundle/services/sitemap/isTopItemActive.d.ts +2 -3
  14. package/dist/components/Blocks.js +2 -0
  15. package/dist/components/Blocks.js.map +1 -1
  16. package/dist/components/Carousel/Carousel.js +27 -6
  17. package/dist/components/Carousel/Carousel.js.map +1 -1
  18. package/dist/components/Carousel/CarouselContent.d.ts +6 -1
  19. package/dist/components/Carousel/CarouselScrollButtons.d.ts +13 -0
  20. package/dist/components/Carousel/CarouselScrollButtons.js +35 -0
  21. package/dist/components/Carousel/CarouselScrollButtons.js.map +1 -0
  22. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
  23. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +46 -0
  24. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -0
  25. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
  26. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js +2 -0
  27. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js.map +1 -0
  28. package/dist/components/CarouselCard/CarouselCard.js +1 -1
  29. package/dist/components/CarouselCard/CarouselCard.js.map +1 -1
  30. package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
  31. package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
  32. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  33. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  34. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
  35. package/dist/components/Footer/MediaButton.d.ts +2 -2
  36. package/dist/components/Footer/SocialMedia.d.ts +2 -2
  37. package/dist/components/Footer/SocialMedia.js +2 -1
  38. package/dist/components/Footer/SocialMedia.js.map +1 -1
  39. package/dist/hooks/useLink.d.ts +1 -1
  40. package/dist/hooks/useLink.js +2 -2
  41. package/dist/hooks/useLink.js.map +1 -1
  42. package/dist/services/sitemap/findActiveSubItem.js +2 -2
  43. package/dist/services/sitemap/findActiveSubItem.js.map +1 -1
  44. package/dist/services/sitemap/isHrefActive.d.ts +2 -1
  45. package/dist/services/sitemap/isHrefActive.js +1 -2
  46. package/dist/services/sitemap/isHrefActive.js.map +1 -1
  47. package/dist/services/sitemap/isTopItemActive.d.ts +2 -3
  48. package/dist/services/sitemap/isTopItemActive.js +1 -2
  49. package/dist/services/sitemap/isTopItemActive.js.map +1 -1
  50. package/dist/ui-kit/TopItem/TopItem.js +1 -1
  51. package/dist/ui-kit/TopItem/TopItem.js.map +1 -1
  52. package/dist/utils/url.js +1 -7
  53. package/dist/utils/url.js.map +1 -1
  54. package/lib/common.css +1 -1
  55. package/lib/components/Blocks.js +2 -0
  56. package/lib/components/Blocks.js.map +1 -1
  57. package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
  58. package/lib/components/Carousel/Carousel.js +28 -7
  59. package/lib/components/Carousel/Carousel.js.map +1 -1
  60. package/lib/components/Carousel/CarouselContent.d.ts +6 -1
  61. package/lib/components/Carousel/CarouselScrollButtons.d.ts +13 -0
  62. package/lib/components/Carousel/CarouselScrollButtons.js +33 -0
  63. package/lib/components/Carousel/CarouselScrollButtons.js.map +1 -0
  64. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
  65. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.d.ts +15 -0
  66. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +44 -0
  67. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -0
  68. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
  69. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js +2 -0
  70. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js.map +1 -0
  71. package/lib/components/CarouselCard/CarouselCard.js +1 -1
  72. package/lib/components/CarouselCard/CarouselCard.js.map +1 -1
  73. package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
  74. package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
  75. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  76. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  77. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
  78. package/lib/components/Footer/MediaButton.d.ts +2 -2
  79. package/lib/components/Footer/SocialMedia.d.ts +2 -2
  80. package/lib/components/Footer/SocialMedia.js +2 -1
  81. package/lib/components/Footer/SocialMedia.js.map +1 -1
  82. package/lib/hooks/useLink.d.ts +1 -1
  83. package/lib/hooks/useLink.js +2 -2
  84. package/lib/hooks/useLink.js.map +1 -1
  85. package/lib/services/sitemap/findActiveSubItem.js +2 -2
  86. package/lib/services/sitemap/findActiveSubItem.js.map +1 -1
  87. package/lib/services/sitemap/isHrefActive.d.ts +2 -1
  88. package/lib/services/sitemap/isHrefActive.js +2 -3
  89. package/lib/services/sitemap/isHrefActive.js.map +1 -1
  90. package/lib/services/sitemap/isTopItemActive.d.ts +2 -3
  91. package/lib/services/sitemap/isTopItemActive.js +1 -2
  92. package/lib/services/sitemap/isTopItemActive.js.map +1 -1
  93. package/lib/ui-kit/TopItem/TopItem.js +1 -1
  94. package/lib/ui-kit/TopItem/TopItem.js.map +1 -1
  95. package/lib/utils/url.js +1 -7
  96. package/lib/utils/url.js.map +1 -1
  97. package/mobile/bundle/bundle.umd.js +8 -19
  98. package/mobile/bundle/bundle.umd.min.js +1 -1
  99. package/mobile/bundle/components/Carousel/CarouselContent.d.ts +6 -1
  100. package/mobile/bundle/components/Carousel/CarouselScrollButtons.d.ts +13 -0
  101. package/mobile/bundle/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
  102. package/mobile/bundle/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
  103. package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
  104. package/mobile/bundle/components/Footer/MediaButton.d.ts +2 -2
  105. package/mobile/bundle/hooks/useLink.d.ts +1 -1
  106. package/mobile/bundle/services/sitemap/isHrefActive.d.ts +2 -1
  107. package/mobile/bundle/services/sitemap/isTopItemActive.d.ts +2 -3
  108. package/mobile/dist/components/Carousel/Carousel.js +27 -6
  109. package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
  110. package/mobile/dist/components/Carousel/CarouselContent.d.ts +6 -1
  111. package/mobile/dist/components/Carousel/CarouselScrollButtons.d.ts +13 -0
  112. package/mobile/dist/components/Carousel/CarouselScrollButtons.js +35 -0
  113. package/mobile/dist/components/Carousel/CarouselScrollButtons.js.map +1 -0
  114. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
  115. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +46 -0
  116. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -0
  117. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
  118. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js +2 -0
  119. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js.map +1 -0
  120. package/mobile/dist/components/CarouselCard/CarouselCard.js +1 -1
  121. package/mobile/dist/components/CarouselCard/CarouselCard.js.map +1 -1
  122. package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
  123. package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
  124. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  125. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  126. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
  127. package/mobile/dist/components/Footer/MediaButton.d.ts +2 -2
  128. package/mobile/dist/hooks/useLink.d.ts +1 -1
  129. package/mobile/dist/hooks/useLink.js +2 -2
  130. package/mobile/dist/hooks/useLink.js.map +1 -1
  131. package/mobile/dist/services/sitemap/findActiveSubItem.js +2 -2
  132. package/mobile/dist/services/sitemap/findActiveSubItem.js.map +1 -1
  133. package/mobile/dist/services/sitemap/isHrefActive.d.ts +2 -1
  134. package/mobile/dist/services/sitemap/isHrefActive.js +1 -2
  135. package/mobile/dist/services/sitemap/isHrefActive.js.map +1 -1
  136. package/mobile/dist/services/sitemap/isTopItemActive.d.ts +2 -3
  137. package/mobile/dist/services/sitemap/isTopItemActive.js +1 -2
  138. package/mobile/dist/services/sitemap/isTopItemActive.js.map +1 -1
  139. package/mobile/dist/ui-kit/TopItem/TopItem.js +1 -1
  140. package/mobile/dist/ui-kit/TopItem/TopItem.js.map +1 -1
  141. package/mobile/dist/utils/url.js +1 -7
  142. package/mobile/dist/utils/url.js.map +1 -1
  143. package/mobile/lib/components/Carousel/Carousel.js +28 -7
  144. package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
  145. package/mobile/lib/components/Carousel/CarouselContent.d.ts +6 -1
  146. package/mobile/lib/components/Carousel/CarouselScrollButtons.d.ts +13 -0
  147. package/mobile/lib/components/Carousel/CarouselScrollButtons.js +33 -0
  148. package/mobile/lib/components/Carousel/CarouselScrollButtons.js.map +1 -0
  149. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
  150. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +44 -0
  151. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -0
  152. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
  153. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js +2 -0
  154. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js.map +1 -0
  155. package/mobile/lib/components/CarouselCard/CarouselCard.js +1 -1
  156. package/mobile/lib/components/CarouselCard/CarouselCard.js.map +1 -1
  157. package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
  158. package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
  159. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  160. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  161. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
  162. package/mobile/lib/components/Footer/MediaButton.d.ts +2 -2
  163. package/mobile/lib/hooks/useLink.d.ts +1 -1
  164. package/mobile/lib/hooks/useLink.js +2 -2
  165. package/mobile/lib/hooks/useLink.js.map +1 -1
  166. package/mobile/lib/services/sitemap/findActiveSubItem.js +2 -2
  167. package/mobile/lib/services/sitemap/findActiveSubItem.js.map +1 -1
  168. package/mobile/lib/services/sitemap/isHrefActive.d.ts +2 -1
  169. package/mobile/lib/services/sitemap/isHrefActive.js +2 -3
  170. package/mobile/lib/services/sitemap/isHrefActive.js.map +1 -1
  171. package/mobile/lib/services/sitemap/isTopItemActive.d.ts +2 -3
  172. package/mobile/lib/services/sitemap/isTopItemActive.js +1 -2
  173. package/mobile/lib/services/sitemap/isTopItemActive.js.map +1 -1
  174. package/mobile/lib/ui-kit/TopItem/TopItem.js +1 -1
  175. package/mobile/lib/ui-kit/TopItem/TopItem.js.map +1 -1
  176. package/mobile/lib/utils/url.js +1 -7
  177. package/mobile/lib/utils/url.js.map +1 -1
  178. package/mobile/src/common.css +17 -0
  179. package/mobile/src/components/Carousel/Carousel.tsx +43 -32
  180. package/mobile/src/components/Carousel/CarouselContent.ts +6 -1
  181. package/mobile/src/components/Carousel/CarouselScrollButtons.tsx +81 -0
  182. package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.example.json +4 -0
  183. package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.tsx +85 -0
  184. package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.ui.json +1 -0
  185. package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.ts +9 -0
  186. package/mobile/src/components/CarouselCard/CarouselCard.tsx +2 -2
  187. package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +1 -1
  188. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +1 -1
  189. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +10 -9
  190. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +0 -1
  191. package/mobile/src/components/Footer/MediaButton.tsx +2 -2
  192. package/mobile/src/hooks/useLink.ts +4 -4
  193. package/mobile/src/services/sitemap/findActiveSubItem.ts +2 -2
  194. package/mobile/src/services/sitemap/isHrefActive.ts +6 -6
  195. package/mobile/src/services/sitemap/isTopItemActive.ts +3 -3
  196. package/mobile/src/ui-kit/TopItem/TopItem.tsx +1 -1
  197. package/mobile/src/utils/url.ts +1 -9
  198. package/package.json +3 -3
  199. package/src/common.css +17 -0
  200. package/src/components/Blocks.ts +2 -0
  201. package/src/components/Carousel/Carousel.fixture.tsx +20 -0
  202. package/src/components/Carousel/Carousel.tsx +43 -32
  203. package/src/components/Carousel/CarouselContent.ts +6 -1
  204. package/src/components/Carousel/CarouselScrollButtons.tsx +81 -0
  205. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.example.json +4 -0
  206. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.tsx +19 -0
  207. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.tsx +85 -0
  208. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.ui.json +1 -0
  209. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.ts +9 -0
  210. package/src/components/CarouselCard/CarouselCard.tsx +2 -2
  211. package/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +1 -1
  212. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +1 -1
  213. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +10 -9
  214. package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +0 -1
  215. package/src/components/Footer/MediaButton.tsx +2 -2
  216. package/src/components/Footer/SocialMedia.tsx +6 -3
  217. package/src/hooks/useLink.ts +4 -4
  218. package/src/services/sitemap/findActiveSubItem.ts +2 -2
  219. package/src/services/sitemap/isHrefActive.ts +6 -6
  220. package/src/services/sitemap/isTopItemActive.ts +3 -3
  221. package/src/ui-kit/TopItem/TopItem.tsx +1 -1
  222. package/src/utils/url.ts +1 -9
  223. package/tailwind.config.cjs +2 -0
  224. package/bundle/services/sitemap/isSubItemActive.d.ts +0 -4
  225. package/bundle/utils/adjustHref.d.ts +0 -1
  226. package/dist/services/sitemap/isSubItemActive.d.ts +0 -4
  227. package/dist/services/sitemap/isSubItemActive.js +0 -6
  228. package/dist/services/sitemap/isSubItemActive.js.map +0 -1
  229. package/dist/utils/adjustHref.d.ts +0 -1
  230. package/dist/utils/adjustHref.js +0 -9
  231. package/dist/utils/adjustHref.js.map +0 -1
  232. package/lib/services/sitemap/isSubItemActive.d.ts +0 -4
  233. package/lib/services/sitemap/isSubItemActive.js +0 -3
  234. package/lib/services/sitemap/isSubItemActive.js.map +0 -1
  235. package/lib/utils/adjustHref.d.ts +0 -1
  236. package/lib/utils/adjustHref.js +0 -6
  237. package/lib/utils/adjustHref.js.map +0 -1
  238. package/mobile/bundle/services/sitemap/isSubItemActive.d.ts +0 -4
  239. package/mobile/bundle/utils/adjustHref.d.ts +0 -1
  240. package/mobile/dist/services/sitemap/isSubItemActive.d.ts +0 -4
  241. package/mobile/dist/services/sitemap/isSubItemActive.js +0 -6
  242. package/mobile/dist/services/sitemap/isSubItemActive.js.map +0 -1
  243. package/mobile/dist/utils/adjustHref.d.ts +0 -1
  244. package/mobile/dist/utils/adjustHref.js +0 -9
  245. package/mobile/dist/utils/adjustHref.js.map +0 -1
  246. package/mobile/lib/services/sitemap/isSubItemActive.d.ts +0 -4
  247. package/mobile/lib/services/sitemap/isSubItemActive.js +0 -3
  248. package/mobile/lib/services/sitemap/isSubItemActive.js.map +0 -1
  249. package/mobile/lib/utils/adjustHref.d.ts +0 -1
  250. package/mobile/lib/utils/adjustHref.js +0 -6
  251. package/mobile/lib/utils/adjustHref.js.map +0 -1
  252. package/mobile/src/services/sitemap/isSubItemActive.ts +0 -7
  253. package/mobile/src/utils/adjustHref.ts +0 -7
  254. package/src/services/sitemap/isSubItemActive.ts +0 -7
  255. package/src/utils/adjustHref.ts +0 -7
@@ -581,7 +581,7 @@
581
581
  const simpleKey = args[0];
582
582
  const fallbackData = fallback && typeof simpleKey === 'string' && fallback[simpleKey];
583
583
  return {
584
- data: !data && !error && fallbackData ? fallbackData : data,
584
+ data: !data && fallbackData ? fallbackData : data,
585
585
  error,
586
586
  mutate: () => Promise.resolve(undefined),
587
587
  isValidating: false
@@ -656,12 +656,7 @@
656
656
  }
657
657
 
658
658
  const isURL = (href) => Boolean(href?.includes('//'));
659
- const isLocalURL = (href, target) => Boolean(href &&
660
- !isURL(href) &&
661
- (projectSettings.BASE_PATH
662
- ? href.startsWith(projectSettings.BASE_PATH)
663
- : !href.startsWith('/')) &&
664
- (!target || target === '_self'));
659
+ const isLocalURL = (href, target) => Boolean(href && !isURL(href) && (!target || target === '_self'));
665
660
  const isHash = (href) => Boolean(href?.startsWith('#'));
666
661
  const withoutQuery = (href) => (href || '').replace(/\/?\?.*/, '');
667
662
  const getOrigin = (href) => (isURL(href) ? new URL(href).origin : undefined);
@@ -706,11 +701,11 @@
706
701
  useRouter._impl = impl;
707
702
  };
708
703
 
709
- function useLink() {
704
+ function useLink(isRemote) {
710
705
  const router = useRouter();
711
706
  const blockRouter = useBlockRouter();
712
707
  const handleLocalURL = (href, target) => (ev) => {
713
- if (!isLocalURL(href, target)) {
708
+ if (isRemote || !isLocalURL(href, target)) {
714
709
  // Proceed with native handle
715
710
  return;
716
711
  }
@@ -1910,20 +1905,54 @@
1910
1905
  ];
1911
1906
  };
1912
1907
 
1913
- const ITEMS_GAP = 4;
1908
+ const scrollButtonStyle$1 = 'absolute top-[calc(50%-24px)] z-50';
1914
1909
  const blurBaseStyle = 'absolute top-0 bottom-0 z-50 w-[84px] pointer-events-none';
1915
- const scrollButtonStyle$1 = 'absolute top-[calc(50%-12px)] z-50';
1916
- const Carousel = JSX(({ className = '', itemCount, visibleItemCount, isBlur = true, isCyclic = false, isPadding = true, ...rest }) => {
1910
+ const CarouselScrollButtons = JSX(({ scroll, arrowsPadded, isBlur, onScrollLeft, onScrollRight, hasEdgeBlocks, activeIndex, itemCount, }) => {
1911
+ const { canScrollLeft, canScrollRight, scrollLeft, scrollRight } = scroll;
1912
+ const canMoveLeft = hasEdgeBlocks ? activeIndex > 0 : canScrollLeft;
1913
+ const canMoveRight = hasEdgeBlocks ? activeIndex < itemCount - 1 : canScrollRight;
1914
+ const handleScrollLeft = useCallback(() => {
1915
+ if (!hasEdgeBlocks) {
1916
+ scrollLeft();
1917
+ }
1918
+ else {
1919
+ canScrollLeft && activeIndex !== itemCount - 1 && scrollLeft();
1920
+ onScrollLeft();
1921
+ }
1922
+ }, [scrollLeft, onScrollLeft, hasEdgeBlocks, canScrollLeft, activeIndex, itemCount]);
1923
+ const handleScrollRight = useCallback(() => {
1924
+ if (!hasEdgeBlocks) {
1925
+ scrollRight();
1926
+ }
1927
+ else {
1928
+ canScrollRight && activeIndex !== 0 && scrollRight();
1929
+ onScrollRight();
1930
+ }
1931
+ }, [scrollRight, onScrollRight, hasEdgeBlocks, canScrollLeft, activeIndex, itemCount]);
1932
+ return (jsxs("div", { children: [renderBlur(isBlur, scroll), canMoveLeft ? (jsx(ScrollLeftButton, { className: style(scrollButtonStyle$1, arrowsPadded ? 'left-8' : 'left-0'), onClick: handleScrollLeft })) : null, canMoveRight ? (jsx(ScrollRightButton, { className: style(scrollButtonStyle$1, arrowsPadded ? 'right-8' : 'right-0'), onClick: handleScrollRight })) : null] }));
1933
+ });
1934
+ const renderBlur = (isBlur, scroll) => (scroll.canScrollLeft || scroll.canScrollRight) && isBlur ? (jsxs("div", { children: [jsx("div", { className: style(blurBaseStyle, 'left-0 bg-opacity-from-white') }), jsx("div", { className: style(blurBaseStyle, 'right-0 bg-opacity-to-white') })] })) : null;
1935
+
1936
+ const ITEMS_GAP = 4;
1937
+ const Carousel = JSX(({ className = '', itemCount, visibleItemCount, isBlur = true, isCyclic = false, arrowsPadded = true, isPadding = true, ...rest }) => {
1917
1938
  const { blocks: childBlocks } = rest.block || {};
1918
1939
  const count = itemCount || childBlocks?.length || 0;
1940
+ const [activeIndex, setActiveIndex] = useState(Math.floor((visibleItemCount || 0) / 2));
1941
+ const increaseActiveIndex = useCallback(() => setActiveIndex((_) => _ + 1), []);
1942
+ const decreaseActiveIndex = useCallback(() => setActiveIndex((_) => _ - 1), []);
1919
1943
  const [containerRef, scroll] = useSwipeListScroll({
1920
1944
  itemCount: count,
1921
1945
  isCyclic,
1922
1946
  });
1923
- return (jsx(BlockWrapper, { className: style(getPaddingStyle(isPadding), className), ...rest, children: jsxs("div", { className: "relative max-w-full", children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderChildren(rest) }), (scroll.canScrollLeft || scroll.canScrollRight) && isBlur ? (jsxs("div", { children: [jsx("div", { className: `${blurBaseStyle} left-0 bg-opacity-from-white` }), jsx("div", { className: `${blurBaseStyle} right-0 bg-opacity-to-white` })] })) : null, renderScrollButtons(scroll)] }) }));
1947
+ const isBankHistoryCarousel = childBlocks && childBlocks[0].type === 'CarouselBankHistoryCard';
1948
+ return (jsx(BlockWrapper, { className: style(getPaddingStyle(isPadding), className), ...rest, children: jsxs("div", { className: "relative max-w-full", children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderChildren({
1949
+ ...rest,
1950
+ block: { ...rest.block, blocks: buildBlocks(childBlocks, activeIndex) },
1951
+ }) }), jsx(CarouselScrollButtons, { scroll: scroll, isBlur: isBlur, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count })] }) }));
1924
1952
  });
1925
1953
  Carousel.childrenTypes = [
1926
1954
  'CarouselCard',
1955
+ 'CarouselBankHistoryCard',
1927
1956
  'CarouselCatalogCard',
1928
1957
  'CarouselInvestmentCard',
1929
1958
  'CarouselProductCard',
@@ -1932,21 +1961,74 @@
1932
1961
  'CarouselTariffsCard',
1933
1962
  'CarouselInvestmentCard',
1934
1963
  ];
1935
- const renderScrollButtons = ({ scrollLeft, scrollRight, canScrollLeft, canScrollRight, }) => (jsxs("div", { children: [canScrollLeft ? (jsx(ScrollLeftButton, { className: `${scrollButtonStyle$1} left-8`, onClick: scrollLeft })) : null, canScrollRight ? (jsx(ScrollRightButton, { className: `${scrollButtonStyle$1} right-8`, onClick: scrollRight })) : null] }));
1964
+ const buildBlocks = (blocks, activeIndex) => {
1965
+ return blocks && blocks[0].type === 'CarouselBankHistoryCard'
1966
+ ? blocks.map((_, i) => {
1967
+ return {
1968
+ ..._,
1969
+ content: {
1970
+ ..._.content,
1971
+ orderNumber: i,
1972
+ isActive: activeIndex === i,
1973
+ blocksLength: blocks.length,
1974
+ },
1975
+ };
1976
+ })
1977
+ : blocks;
1978
+ };
1936
1979
  const getPaddingStyle = (isPadding) => (isPadding ? 'p-12' : '');
1937
1980
 
1981
+ const CarouselBankHistoryCard = JSX(({ title, description, isActive, orderNumber = 0, blocksLength = 0 }) => {
1982
+ return (jsx(BlockWrapper, { className: "flex h-[485px]", children: isActive ? (jsx("div", { className: "relative flex items-center w-full", children: jsx(Headline, { headlineVersion: "S", title: title, description: description, align: "text-left", className: style('absolute z-10 h-[385px] w-[440px] text-white shadow-dark-blue', getActiveBlockPosition(orderNumber, blocksLength), getBackgroundColor(orderNumber)) }) })) : (jsx("div", { className: "flex w-full items-center justify-center", children: jsx("div", { className: style('flex justify-center items-center h-[300px] w-[340px] font-mohave text-title-large tracking-[-0.03em]', getBackgroundColor(orderNumber)), children: jsx("span", { className: getTextColor(orderNumber), children: title }) }) })) }));
1983
+ });
1984
+ const getBackgroundColor = (orderNumber) => {
1985
+ const division = orderNumber % 3;
1986
+ switch (division) {
1987
+ case 0:
1988
+ return 'bg-primary-main';
1989
+ case 1:
1990
+ return 'bg-green-light';
1991
+ case 2:
1992
+ return 'bg-yellow-light';
1993
+ default:
1994
+ return 'bg-primary-main';
1995
+ }
1996
+ };
1997
+ const getTextColor = (orderNumber) => {
1998
+ const division = orderNumber % 3;
1999
+ switch (division) {
2000
+ case 1:
2001
+ return 'gradient-color-text-on-yellow';
2002
+ case 2:
2003
+ return 'gradient-color-text-on-yellow';
2004
+ default:
2005
+ return 'gradient-color-text-on-green';
2006
+ }
2007
+ };
2008
+ const getActiveBlockPosition = (orderNumber, blocksLength) => {
2009
+ if (orderNumber === 0) {
2010
+ return 'left-9';
2011
+ }
2012
+ else if (orderNumber === blocksLength - 1) {
2013
+ return 'right-9';
2014
+ }
2015
+ else {
2016
+ return '-left-[25px]';
2017
+ }
2018
+ };
2019
+
1938
2020
  const BLOCK_CLASSES = 'absolute border border-solid border-gray w-full h-full';
1939
2021
  const CARD_WIDTH_MAP = {
1940
2022
  normal: 'min-w-[970px]',
1941
2023
  mini: 'min-w-[355px]',
1942
2024
  };
1943
- const CarouselCard = JSX(({ className = '', button, description, title, carouselVersion = 'normal' }) => (jsx("section", { className: `flex pb-9 pl-12 border-box ${CARD_WIDTH_MAP[carouselVersion]} ${className}`, children: jsxs("div", { className: "relative w-full", children: [jsx("div", { className: `${BLOCK_CLASSES} z-10 top-9 right-12 bg-green-dark` }), jsx("div", { className: `${BLOCK_CLASSES} z-10 top-6 right-8 bg-green` }), jsx("div", { className: `${BLOCK_CLASSES} z-10 top-3 right-4 bg-green-light` }), jsxs("div", { className: "relative bg-white z-10 p-10 border border-solid border-green-light", children: [jsx(Headline, { className: "!p-0", title: title, description: description, headlineVersion: "L", align: "text-left" }), renderButtonsSection([button], { className: 'mt-14' })] })] }) })));
2025
+ const CarouselCard = JSX(({ className = '', button, description, title, carouselVersion = 'normal' }) => (jsx("section", { className: `flex pb-9 pl-12 border-box h-full ${CARD_WIDTH_MAP[carouselVersion]} ${className}`, children: jsxs("div", { className: "relative w-full", children: [jsx("div", { className: `${BLOCK_CLASSES} z-10 top-9 right-12 bg-green-dark` }), jsx("div", { className: `${BLOCK_CLASSES} z-10 top-6 right-8 bg-green` }), jsx("div", { className: `${BLOCK_CLASSES} z-10 top-3 right-4 bg-green-light` }), jsxs("div", { className: "relative h-full bg-white z-10 p-10 border border-solid border-green-light", children: [jsx(Headline, { className: "!p-0", title: title, description: description, headlineVersion: "L", align: "text-left" }), renderButtonsSection([button], { className: 'mt-14' })] })] }) })));
1944
2026
 
1945
2027
  const cardStyleMap$2 = {
1946
2028
  black: 'bg-black',
1947
2029
  white: 'bg-white',
1948
2030
  };
1949
- const CarouselCatalogCard = JSX(({ className = '', title, description, image, price, button, colors, ...rest }) => (jsxs(BlockWrapper, { className: `border box-border border-gray p-7 min-w-[392px] flex flex-col justify-left ${className}`, ...rest, children: [image?.src ? jsx(ImgInner, { className: "mb-5 flex justify-center", image: image }) : null, title ? (jsx(Heading, { headingType: "h6", as: "h4", className: "text-left mb-1.5", title: title })) : null, description ? (jsx("div", { className: "mb-4", children: jsx(Paragraph, { size: "text-m", align: "text-left", font: "font-light", children: description }) })) : null, colors?.length ? (jsxs("div", { className: "flex mb-4 text-s-light text-secondary-text", children: [jsx("div", { className: "mr-1.5", children: jsx(Text, { children: "\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 \u0446\u0432\u0435\u0442\u0430: " }) }), colors.map(renderColorOption$1)] })) : null, price ? (jsxs(Text, { size: "text-h3", align: "text-left", children: [price, "\u00A0\u20BD"] })) : null, renderButtonsSection([button], { buttonClassName: 'mt-5 w-full' })] })));
2031
+ const CarouselCatalogCard = JSX(({ className = '', title, description, image, price, button, colors, ...rest }) => (jsxs(BlockWrapper, { className: `border box-border border-gray p-7 min-w-[392px] h-full flex flex-col justify-left ${className}`, ...rest, children: [image?.src ? jsx(ImgInner, { className: "mb-5 flex justify-center", image: image }) : null, title ? (jsx(Heading, { headingType: "h6", as: "h4", className: "text-left mb-1.5", title: title })) : null, description ? (jsx("div", { className: "mb-4", children: jsx(Paragraph, { size: "text-m", align: "text-left", font: "font-light", children: description }) })) : null, colors?.length ? (jsxs("div", { className: "flex mb-4 text-s-light text-secondary-text", children: [jsx("div", { className: "mr-1.5", children: jsx(Text, { children: "\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 \u0446\u0432\u0435\u0442\u0430: " }) }), colors.map(renderColorOption$1)] })) : null, price ? (jsxs(Text, { size: "text-h3", align: "text-left", children: [price, "\u00A0\u20BD"] })) : null, renderButtonsSection([button], { buttonClassName: 'mt-5 w-full' })] })));
1950
2032
  const renderColorOption$1 = (color, i) => (jsx("span", { className: `w-6 h-6 ml-3 border border-solid border-main-divider rounded-full ${cardStyleMap$2[color]}` }, String(i)));
1951
2033
 
1952
2034
  const BaseTile = JSX(({ className = '', title = '', buttons, image, children }) => (jsxs("div", { className: `font-sans flex flex-col grow h-full items-start ${className}`, children: [title, jsxs("div", { className: "flex grow w-full justify-between", children: [jsxs("div", { className: "flex flex-col justify-between w-full", children: [jsx("div", { className: "h-full", children: children }), buttons ? jsx("div", { className: "mt-auto pt-8", children: buttons }) : null] }), image] })] })));
@@ -2072,13 +2154,13 @@
2072
2154
  return (jsx(Button, { className: style('group/media flex items-center justify-center box-border', buttonSizeStyles[buttonSize], rounded ? 'rounded-full' : 'rounded-md', 'border border-solid hover:border-transparent', 'group-data-primary:border-main-divider', 'hover:bg-primary-main hover:text-black', 'group-data-secondary:bg-white border-main-divider group-data-secondary:hover:bg-secondary-hover', 'group-data-gray:border-green', buttonSizeStyles[buttonSize]), "aria-label": label, target: "_blank", rel: "noopener noreferrer", version: version, ...rest, children: iconWithVersion ? (jsx(ImgInner, { image: iconWithVersion, imageClassName: "group-hover/media:text-white", width: "24", height: "24", asSVG: true })) : null }));
2073
2155
  });
2074
2156
 
2075
- const SocialMedia = JSX(({ className = '', media, children, buttonSize }) => (jsxs("div", { className: "font-sans", children: [jsx("div", { className: `flex gap-2.5 ${className}`, children: media?.map((_, index) => (jsx(MediaButton, { buttonSize: buttonSize, version: _.version, ..._ }, String(index)))) }), jsx("span", { className: "text-s-light text-secondary-text", children: children })] })));
2157
+ const SocialMedia = JSX(({ className = '', media, children, buttonSize }) => (jsxs("div", { className: "font-sans", children: [jsx("div", { className: `flex gap-2.5 ${className}`, children: media?.map((_, index) => (jsx(MediaButton, { buttonSize: buttonSize, version: _.version, ..._ }, String(index)))) }), jsx(Text, { size: "text-s-light", color: "text-secondary-text", children: children })] })));
2076
2158
 
2077
2159
  const CarouselRecommendationCard = JSX(({ button, className = '', description, image, items = [], socialMedia = [], title, version = 'primary', ...rest }) => {
2078
2160
  const tileTitle = title ? (jsx(Heading, { headingType: "h5", as: "h3", className: "mb-3.5 z-10", title: title })) : null;
2079
2161
  const tileImage = image?.src ? (jsx(ImgInner, { className: "absolute bottom-0 right-0 m-0", image: image })) : null;
2080
2162
  const BORDER_STYLE = 'border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider';
2081
- return (jsx(BlockWrapper, { className: style('relative p-7 min-w-[524px] text-left box-border group-data-gray:bg-main-divider/50', BORDER_STYLE, className), version: version, ...rest, children: jsx(BaseTile, { className: "flex justify-between", title: tileTitle, image: tileImage, children: jsxs("div", { className: "h-full flex flex-col justify-between", children: [description ? (jsx("span", { className: "mb-2 group-data-gray:text-secondary-text group-data-gray:max-w-[265px]", children: description })) : null, items.length ? (jsx(List, { className: "text-xl-light flex flex-col flex-1 gap-2 max-w-[236px]", items: items })) : null, socialMedia.length ? jsx(SocialMedia, { className: "pt-10 pb-0", media: socialMedia }) : null, renderButtonsSection([button], { className: 'pt-2 mt-16' })] }) }) }));
2163
+ return (jsx(BlockWrapper, { className: style('relative p-7 min-w-[524px] h-full text-left box-border group-data-gray:bg-main-divider/50', BORDER_STYLE, className), version: version, ...rest, children: jsx(BaseTile, { className: "flex justify-between", title: tileTitle, image: tileImage, children: jsxs("div", { className: "h-full flex flex-col justify-between", children: [description ? (jsx("span", { className: "mb-2 group-data-gray:text-secondary-text group-data-gray:max-w-[265px]", children: description })) : null, items.length ? (jsx(List, { className: "text-xl-light flex flex-col flex-1 gap-2 max-w-[236px]", items: items })) : null, socialMedia.length ? jsx(SocialMedia, { className: "pt-10 pb-0", media: socialMedia }) : null, renderButtonsSection([button], { className: 'pt-2 mt-16' })] }) }) }));
2082
2164
  });
2083
2165
 
2084
2166
  const VISIBLE_CELLS_COUNT = 1;
@@ -2558,18 +2640,12 @@
2558
2640
  const renderMonthNames = (item, colSize) => item.month?.map((_, i) => (jsx("div", { style: { flexBasis: `${colSize}%` }, children: _.text }, `monthName-${i}`)));
2559
2641
  const renderMonthImages = (item) => item.month?.map((_) => _.image?.src ? (jsx("div", { className: "h-[207px] border-r pr-3 mr-3 border-main-divider last:border-r-0 last:pr-0 last:mr-0", children: jsx(ImgInner, { image: _.image, className: "flex" }) }, `monthImage-${_.image.src}`)) : null);
2560
2642
 
2561
- const adjustHref = (href) => href && projectSettings.BASE_PATH && !(isURL(href) || href.startsWith('/'))
2562
- ? `${projectSettings.BASE_PATH}${href}`
2563
- : href;
2643
+ const isHrefActive = (router) => ({ href }) => withoutQuery(isURL(href) ? router.href : router.pathname).startsWith(withoutQuery(href));
2564
2644
 
2565
- const isHrefActive = (href, router) => withoutQuery(isURL(href) ? router.href : getPathname(router.href)).startsWith(withoutQuery(adjustHref(href)));
2566
-
2567
- const isSubItemActive = (router) => (subItem) => isHrefActive(subItem.href, router);
2568
-
2569
- const isTopItemActive = (router) => (topItem) => topItem.items?.some(isSubItemActive(router)) || isHrefActive(topItem.href, router);
2645
+ const isTopItemActive = (router) => (topItem) => topItem.items?.some(isHrefActive(router)) || isHrefActive(router)(topItem);
2570
2646
 
2571
2647
  const TopItem = JSX(({ className = '', active, flat, children, ...rest }) => {
2572
- const link = useLink();
2648
+ const link = useLink(true);
2573
2649
  const { href, target, text, onClick } = link(rest);
2574
2650
  return (jsx("a", { className: style(getLinkStyle(active, flat), className), href: href, target: target, onClick: onClick, rel: "noopener noreferrer", "aria-label": text, children: jsx("span", { className: getTextStyle$1(active, flat), children: text || children }) }));
2575
2651
  });
@@ -2754,7 +2830,7 @@
2754
2830
  });
2755
2831
 
2756
2832
  const findActiveSubItem = (router) => (items = []) => {
2757
- const possibleActiveSubItems = items?.filter(isSubItemActive(router));
2833
+ const possibleActiveSubItems = items?.filter(isHrefActive(router));
2758
2834
  return possibleActiveSubItems?.length
2759
2835
  ? maxBy((_) => _.href?.length || 0)(possibleActiveSubItems) // More specific item with max length
2760
2836
  : undefined;
@@ -4306,6 +4382,7 @@
4306
4382
  Calculator,
4307
4383
  CardTransfer,
4308
4384
  Carousel,
4385
+ CarouselBankHistoryCard,
4309
4386
  CarouselCard,
4310
4387
  CarouselCatalogCard,
4311
4388
  CarouselInvestmentCard,
@@ -4481,7 +4558,7 @@
4481
4558
  return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
4482
4559
  }
4483
4560
 
4484
- const packageVersion = "0.8.2";
4561
+ const packageVersion = "0.8.3";
4485
4562
 
4486
4563
  exports.Blocks = Blocks;
4487
4564
  exports.ContentPage = ContentPage;