@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.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +106 -29
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Carousel/CarouselContent.d.ts +6 -1
- package/bundle/components/Carousel/CarouselScrollButtons.d.ts +13 -0
- package/bundle/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
- package/bundle/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
- package/bundle/components/Footer/MediaButton.d.ts +2 -2
- package/bundle/components/Footer/SocialMedia.d.ts +2 -2
- package/bundle/hooks/useLink.d.ts +1 -1
- package/bundle/services/sitemap/isHrefActive.d.ts +2 -1
- package/bundle/services/sitemap/isTopItemActive.d.ts +2 -3
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Carousel/Carousel.js +27 -6
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel/CarouselContent.d.ts +6 -1
- package/dist/components/Carousel/CarouselScrollButtons.d.ts +13 -0
- package/dist/components/Carousel/CarouselScrollButtons.js +35 -0
- package/dist/components/Carousel/CarouselScrollButtons.js.map +1 -0
- package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
- package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +46 -0
- package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -0
- package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
- package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js +2 -0
- package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js.map +1 -0
- package/dist/components/CarouselCard/CarouselCard.js +1 -1
- package/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
- package/dist/components/Footer/MediaButton.d.ts +2 -2
- package/dist/components/Footer/SocialMedia.d.ts +2 -2
- package/dist/components/Footer/SocialMedia.js +2 -1
- package/dist/components/Footer/SocialMedia.js.map +1 -1
- package/dist/hooks/useLink.d.ts +1 -1
- package/dist/hooks/useLink.js +2 -2
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/services/sitemap/findActiveSubItem.js +2 -2
- package/dist/services/sitemap/findActiveSubItem.js.map +1 -1
- package/dist/services/sitemap/isHrefActive.d.ts +2 -1
- package/dist/services/sitemap/isHrefActive.js +1 -2
- package/dist/services/sitemap/isHrefActive.js.map +1 -1
- package/dist/services/sitemap/isTopItemActive.d.ts +2 -3
- package/dist/services/sitemap/isTopItemActive.js +1 -2
- package/dist/services/sitemap/isTopItemActive.js.map +1 -1
- package/dist/ui-kit/TopItem/TopItem.js +1 -1
- package/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/dist/utils/url.js +1 -7
- package/dist/utils/url.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
- package/lib/components/Carousel/Carousel.js +28 -7
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/CarouselContent.d.ts +6 -1
- package/lib/components/Carousel/CarouselScrollButtons.d.ts +13 -0
- package/lib/components/Carousel/CarouselScrollButtons.js +33 -0
- package/lib/components/Carousel/CarouselScrollButtons.js.map +1 -0
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.d.ts +15 -0
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +44 -0
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -0
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js +2 -0
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js.map +1 -0
- package/lib/components/CarouselCard/CarouselCard.js +1 -1
- package/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
- package/lib/components/Footer/MediaButton.d.ts +2 -2
- package/lib/components/Footer/SocialMedia.d.ts +2 -2
- package/lib/components/Footer/SocialMedia.js +2 -1
- package/lib/components/Footer/SocialMedia.js.map +1 -1
- package/lib/hooks/useLink.d.ts +1 -1
- package/lib/hooks/useLink.js +2 -2
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/services/sitemap/findActiveSubItem.js +2 -2
- package/lib/services/sitemap/findActiveSubItem.js.map +1 -1
- package/lib/services/sitemap/isHrefActive.d.ts +2 -1
- package/lib/services/sitemap/isHrefActive.js +2 -3
- package/lib/services/sitemap/isHrefActive.js.map +1 -1
- package/lib/services/sitemap/isTopItemActive.d.ts +2 -3
- package/lib/services/sitemap/isTopItemActive.js +1 -2
- package/lib/services/sitemap/isTopItemActive.js.map +1 -1
- package/lib/ui-kit/TopItem/TopItem.js +1 -1
- package/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/lib/utils/url.js +1 -7
- package/lib/utils/url.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +8 -19
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Carousel/CarouselContent.d.ts +6 -1
- package/mobile/bundle/components/Carousel/CarouselScrollButtons.d.ts +13 -0
- package/mobile/bundle/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
- package/mobile/bundle/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
- package/mobile/bundle/components/Footer/MediaButton.d.ts +2 -2
- package/mobile/bundle/hooks/useLink.d.ts +1 -1
- package/mobile/bundle/services/sitemap/isHrefActive.d.ts +2 -1
- package/mobile/bundle/services/sitemap/isTopItemActive.d.ts +2 -3
- package/mobile/dist/components/Carousel/Carousel.js +27 -6
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/Carousel/CarouselContent.d.ts +6 -1
- package/mobile/dist/components/Carousel/CarouselScrollButtons.d.ts +13 -0
- package/mobile/dist/components/Carousel/CarouselScrollButtons.js +35 -0
- package/mobile/dist/components/Carousel/CarouselScrollButtons.js.map +1 -0
- package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
- package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +46 -0
- package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -0
- package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
- package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js +2 -0
- package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js.map +1 -0
- package/mobile/dist/components/CarouselCard/CarouselCard.js +1 -1
- package/mobile/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
- package/mobile/dist/components/Footer/MediaButton.d.ts +2 -2
- package/mobile/dist/hooks/useLink.d.ts +1 -1
- package/mobile/dist/hooks/useLink.js +2 -2
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/services/sitemap/findActiveSubItem.js +2 -2
- package/mobile/dist/services/sitemap/findActiveSubItem.js.map +1 -1
- package/mobile/dist/services/sitemap/isHrefActive.d.ts +2 -1
- package/mobile/dist/services/sitemap/isHrefActive.js +1 -2
- package/mobile/dist/services/sitemap/isHrefActive.js.map +1 -1
- package/mobile/dist/services/sitemap/isTopItemActive.d.ts +2 -3
- package/mobile/dist/services/sitemap/isTopItemActive.js +1 -2
- package/mobile/dist/services/sitemap/isTopItemActive.js.map +1 -1
- package/mobile/dist/ui-kit/TopItem/TopItem.js +1 -1
- package/mobile/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/dist/utils/url.js +1 -7
- package/mobile/dist/utils/url.js.map +1 -1
- package/mobile/lib/components/Carousel/Carousel.js +28 -7
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/Carousel/CarouselContent.d.ts +6 -1
- package/mobile/lib/components/Carousel/CarouselScrollButtons.d.ts +13 -0
- package/mobile/lib/components/Carousel/CarouselScrollButtons.js +33 -0
- package/mobile/lib/components/Carousel/CarouselScrollButtons.js.map +1 -0
- package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
- package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +44 -0
- package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -0
- package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
- package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js +2 -0
- package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js.map +1 -0
- package/mobile/lib/components/CarouselCard/CarouselCard.js +1 -1
- package/mobile/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
- package/mobile/lib/components/Footer/MediaButton.d.ts +2 -2
- package/mobile/lib/hooks/useLink.d.ts +1 -1
- package/mobile/lib/hooks/useLink.js +2 -2
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/services/sitemap/findActiveSubItem.js +2 -2
- package/mobile/lib/services/sitemap/findActiveSubItem.js.map +1 -1
- package/mobile/lib/services/sitemap/isHrefActive.d.ts +2 -1
- package/mobile/lib/services/sitemap/isHrefActive.js +2 -3
- package/mobile/lib/services/sitemap/isHrefActive.js.map +1 -1
- package/mobile/lib/services/sitemap/isTopItemActive.d.ts +2 -3
- package/mobile/lib/services/sitemap/isTopItemActive.js +1 -2
- package/mobile/lib/services/sitemap/isTopItemActive.js.map +1 -1
- package/mobile/lib/ui-kit/TopItem/TopItem.js +1 -1
- package/mobile/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/lib/utils/url.js +1 -7
- package/mobile/lib/utils/url.js.map +1 -1
- package/mobile/src/common.css +17 -0
- package/mobile/src/components/Carousel/Carousel.tsx +43 -32
- package/mobile/src/components/Carousel/CarouselContent.ts +6 -1
- package/mobile/src/components/Carousel/CarouselScrollButtons.tsx +81 -0
- package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.example.json +4 -0
- package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.tsx +85 -0
- package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.ui.json +1 -0
- package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.ts +9 -0
- package/mobile/src/components/CarouselCard/CarouselCard.tsx +2 -2
- package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +1 -1
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +1 -1
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +10 -9
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +0 -1
- package/mobile/src/components/Footer/MediaButton.tsx +2 -2
- package/mobile/src/hooks/useLink.ts +4 -4
- package/mobile/src/services/sitemap/findActiveSubItem.ts +2 -2
- package/mobile/src/services/sitemap/isHrefActive.ts +6 -6
- package/mobile/src/services/sitemap/isTopItemActive.ts +3 -3
- package/mobile/src/ui-kit/TopItem/TopItem.tsx +1 -1
- package/mobile/src/utils/url.ts +1 -9
- package/package.json +3 -3
- package/src/common.css +17 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/Carousel/Carousel.fixture.tsx +20 -0
- package/src/components/Carousel/Carousel.tsx +43 -32
- package/src/components/Carousel/CarouselContent.ts +6 -1
- package/src/components/Carousel/CarouselScrollButtons.tsx +81 -0
- package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.example.json +4 -0
- package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.tsx +19 -0
- package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.tsx +85 -0
- package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.ui.json +1 -0
- package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.ts +9 -0
- package/src/components/CarouselCard/CarouselCard.tsx +2 -2
- package/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +1 -1
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +1 -1
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +10 -9
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +0 -1
- package/src/components/Footer/MediaButton.tsx +2 -2
- package/src/components/Footer/SocialMedia.tsx +6 -3
- package/src/hooks/useLink.ts +4 -4
- package/src/services/sitemap/findActiveSubItem.ts +2 -2
- package/src/services/sitemap/isHrefActive.ts +6 -6
- package/src/services/sitemap/isTopItemActive.ts +3 -3
- package/src/ui-kit/TopItem/TopItem.tsx +1 -1
- package/src/utils/url.ts +1 -9
- package/tailwind.config.cjs +2 -0
- package/bundle/services/sitemap/isSubItemActive.d.ts +0 -4
- package/bundle/utils/adjustHref.d.ts +0 -1
- package/dist/services/sitemap/isSubItemActive.d.ts +0 -4
- package/dist/services/sitemap/isSubItemActive.js +0 -6
- package/dist/services/sitemap/isSubItemActive.js.map +0 -1
- package/dist/utils/adjustHref.d.ts +0 -1
- package/dist/utils/adjustHref.js +0 -9
- package/dist/utils/adjustHref.js.map +0 -1
- package/lib/services/sitemap/isSubItemActive.d.ts +0 -4
- package/lib/services/sitemap/isSubItemActive.js +0 -3
- package/lib/services/sitemap/isSubItemActive.js.map +0 -1
- package/lib/utils/adjustHref.d.ts +0 -1
- package/lib/utils/adjustHref.js +0 -6
- package/lib/utils/adjustHref.js.map +0 -1
- package/mobile/bundle/services/sitemap/isSubItemActive.d.ts +0 -4
- package/mobile/bundle/utils/adjustHref.d.ts +0 -1
- package/mobile/dist/services/sitemap/isSubItemActive.d.ts +0 -4
- package/mobile/dist/services/sitemap/isSubItemActive.js +0 -6
- package/mobile/dist/services/sitemap/isSubItemActive.js.map +0 -1
- package/mobile/dist/utils/adjustHref.d.ts +0 -1
- package/mobile/dist/utils/adjustHref.js +0 -9
- package/mobile/dist/utils/adjustHref.js.map +0 -1
- package/mobile/lib/services/sitemap/isSubItemActive.d.ts +0 -4
- package/mobile/lib/services/sitemap/isSubItemActive.js +0 -3
- package/mobile/lib/services/sitemap/isSubItemActive.js.map +0 -1
- package/mobile/lib/utils/adjustHref.d.ts +0 -1
- package/mobile/lib/utils/adjustHref.js +0 -6
- package/mobile/lib/utils/adjustHref.js.map +0 -1
- package/mobile/src/services/sitemap/isSubItemActive.ts +0 -7
- package/mobile/src/utils/adjustHref.ts +0 -7
- package/src/services/sitemap/isSubItemActive.ts +0 -7
- package/src/utils/adjustHref.ts +0 -7
package/bundle/bundle.umd.js
CHANGED
|
@@ -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 &&
|
|
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
|
|
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
|
|
1916
|
-
|
|
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
|
-
|
|
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
|
|
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(
|
|
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
|
|
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
|
|
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(
|
|
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.
|
|
4561
|
+
const packageVersion = "0.8.3";
|
|
4485
4562
|
|
|
4486
4563
|
exports.Blocks = Blocks;
|
|
4487
4564
|
exports.ContentPage = ContentPage;
|