@redneckz/wildless-cms-uni-blocks 0.14.225 → 0.14.227

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 (62) hide show
  1. package/bundle/bundle.umd.js +13 -9
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/Carousel/Carousel.d.ts +1 -0
  4. package/bundle/components/CarouselLinks/maxLinksCount.d.ts +1 -1
  5. package/dist/components/Carousel/Carousel.d.ts +1 -0
  6. package/dist/components/Carousel/Carousel.js +2 -2
  7. package/dist/components/Carousel/Carousel.js.map +1 -1
  8. package/dist/components/CarouselLinks/CarouselLinks.js +7 -4
  9. package/dist/components/CarouselLinks/CarouselLinks.js.map +1 -1
  10. package/dist/components/CarouselLinks/maxLinksCount.d.ts +1 -1
  11. package/dist/components/CarouselLinks/maxLinksCount.js +1 -1
  12. package/dist/components/CarouselLinks/maxLinksCount.js.map +1 -1
  13. package/dist/components/OfficesAtmsMap/useAtms.js +1 -1
  14. package/dist/components/OfficesAtmsMap/useAtms.js.map +1 -1
  15. package/dist/components/OfficesAtmsMap/useOffices.js +1 -1
  16. package/dist/components/OfficesAtmsMap/useOffices.js.map +1 -1
  17. package/lib/common.css +1 -1
  18. package/lib/components/Carousel/Carousel.d.ts +1 -0
  19. package/lib/components/Carousel/Carousel.js +2 -2
  20. package/lib/components/Carousel/Carousel.js.map +1 -1
  21. package/lib/components/CarouselLinks/CarouselLinks.js +7 -4
  22. package/lib/components/CarouselLinks/CarouselLinks.js.map +1 -1
  23. package/lib/components/CarouselLinks/maxLinksCount.d.ts +1 -1
  24. package/lib/components/CarouselLinks/maxLinksCount.js +1 -1
  25. package/lib/components/CarouselLinks/maxLinksCount.js.map +1 -1
  26. package/lib/components/OfficesAtmsMap/useAtms.js +1 -1
  27. package/lib/components/OfficesAtmsMap/useAtms.js.map +1 -1
  28. package/lib/components/OfficesAtmsMap/useOffices.js +1 -1
  29. package/lib/components/OfficesAtmsMap/useOffices.js.map +1 -1
  30. package/mobile/bundle/bundle.umd.js +13 -9
  31. package/mobile/bundle/bundle.umd.min.js +1 -1
  32. package/mobile/bundle/components/Carousel/Carousel.d.ts +1 -0
  33. package/mobile/dist/components/Carousel/Carousel.d.ts +1 -0
  34. package/mobile/dist/components/Carousel/Carousel.js +2 -2
  35. package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
  36. package/mobile/dist/components/CarouselLinks/CarouselLinks.js +7 -4
  37. package/mobile/dist/components/CarouselLinks/CarouselLinks.js.map +1 -1
  38. package/mobile/dist/components/OfficesAtmsMap/useAtms.js +1 -1
  39. package/mobile/dist/components/OfficesAtmsMap/useAtms.js.map +1 -1
  40. package/mobile/dist/components/OfficesAtmsMap/useOffices.js +1 -1
  41. package/mobile/dist/components/OfficesAtmsMap/useOffices.js.map +1 -1
  42. package/mobile/lib/common.css +1 -1
  43. package/mobile/lib/components/Carousel/Carousel.d.ts +1 -0
  44. package/mobile/lib/components/Carousel/Carousel.js +2 -2
  45. package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
  46. package/mobile/lib/components/CarouselLinks/CarouselLinks.js +7 -4
  47. package/mobile/lib/components/CarouselLinks/CarouselLinks.js.map +1 -1
  48. package/mobile/lib/components/OfficesAtmsMap/useAtms.js +1 -1
  49. package/mobile/lib/components/OfficesAtmsMap/useAtms.js.map +1 -1
  50. package/mobile/lib/components/OfficesAtmsMap/useOffices.js +1 -1
  51. package/mobile/lib/components/OfficesAtmsMap/useOffices.js.map +1 -1
  52. package/mobile/src/components/Carousel/Carousel.tsx +7 -1
  53. package/mobile/src/components/CarouselLinks/CarouselLinks.tsx +12 -9
  54. package/mobile/src/components/OfficesAtmsMap/useAtms.ts +1 -1
  55. package/mobile/src/components/OfficesAtmsMap/useOffices.ts +1 -1
  56. package/package.json +1 -1
  57. package/src/components/Carousel/Carousel.tsx +7 -1
  58. package/src/components/CarouselLinks/CarouselLinks.fixture.tsx +4 -2
  59. package/src/components/CarouselLinks/CarouselLinks.tsx +12 -9
  60. package/src/components/CarouselLinks/maxLinksCount.ts +1 -1
  61. package/src/components/OfficesAtmsMap/useAtms.ts +1 -1
  62. package/src/components/OfficesAtmsMap/useOffices.ts +1 -1
@@ -2978,7 +2978,7 @@
2978
2978
 
2979
2979
  const VISIBLE_ITEM_COUNT = 1;
2980
2980
 
2981
- const Carousel = UniBlock(({ className, itemCount, visibleItemCount = VISIBLE_ITEM_COUNT, noCardBorder, isAlignCenter, arrowsPadded = true, isGap = true, cardSize = 'normal', ...rest }) => {
2981
+ const Carousel = UniBlock(({ className, itemCount, visibleItemCount = VISIBLE_ITEM_COUNT, noCardBorder, isAlignCenter, arrowsPadded = true, isGap = true, isEmbedded = false, cardSize = 'normal', ...rest }) => {
2982
2982
  const { blocks: childBlocks = [] } = rest.block || {};
2983
2983
  const count = itemCount || childBlocks?.length;
2984
2984
  const [activeIndex, { inc: increaseActiveIndex, dec: decreaseActiveIndex }] = useCarouselControls({
@@ -2989,7 +2989,7 @@
2989
2989
  const [dotsActiveIndex] = scroll.visibleIndicesRange;
2990
2990
  // TODO Remove
2991
2991
  const isBankHistoryCarousel = childBlocks && childBlocks[0]?.type === 'CarouselBankHistoryCard';
2992
- return (jsxs(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: [jsxs("div", { className: style(isAlignCenter ? 'flex justify-center' : '', 'relative max-w-full'), children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: isGap ? ITEMS_GAP : undefined, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderCarouselCards({ noCardBorder, activeIndex, cardSize, ...rest }) }), jsx(CarouselScrollButtons, { scroll: scroll, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count })] }), jsx(SwipeListControlDots, { className: "@5xl:hidden", containerRef: containerRef, activeIndex: dotsActiveIndex, dotCount: count, listType: "horizontal-list" })] }));
2992
+ return (jsxs(BlockWrapper, { className: style(isEmbedded ? '@container-normal' : '', className), defaultPadding: "p-6xl", ...rest, children: [jsxs("div", { className: style(isAlignCenter ? 'flex justify-center' : '', 'relative max-w-full'), children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: isGap ? ITEMS_GAP : undefined, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderCarouselCards({ noCardBorder, activeIndex, cardSize, ...rest }) }), jsx(CarouselScrollButtons, { scroll: scroll, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count })] }), jsx(SwipeListControlDots, { className: "@5xl:hidden", containerRef: containerRef, activeIndex: dotsActiveIndex, dotCount: count, listType: "horizontal-list" })] }));
2993
2993
  }, {
2994
2994
  childrenTypes: [
2995
2995
  'CarouselCard',
@@ -3044,12 +3044,16 @@
3044
3044
  return text ? (jsx("div", { className: style('flex relative group/link pl-s pb-s sm:pr-2xs min-w-64 sm:min-w-72', className), children: jsxs("div", { className: "relative min-h-16 w-full pb-lg sm:pb-0", children: [jsxs("a", { className: style(LINK_CLASS_NAME, 'flex rounded-md lg:rounded-none w-full w-full p-lg whitespace-nowrap z-10'), role: "link", href: href, target: target, onClick: onClick, children: [jsxs("div", { className: "flex items-center space-x-lg", children: [icon ? (jsx(Img, { imageClassName: "text-green-dark", image: icon, width: IconSize, height: IconSize })) : null, jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text })] }), jsx(Img, { className: "group-hover/link:brightness-100 sm:ml-2xs", image: { icon: 'ArrowRightIcon', iconVersion: IconVersion }, imageClassName: "group-hover/link:text-primary-main", width: IconSize, height: IconSize })] }), jsx("div", { className: style(LINK_BORDER_CLASS_NAME, '-bottom-1 -left-1') }), jsx("div", { className: style(LINK_BORDER_CLASS_NAME, '-bottom-2 -left-2') })] }) })) : null;
3045
3045
  });
3046
3046
 
3047
- const CarouselLinks = JSX(({ className, additionalDescription, description, links, title, ...rest }) => (jsx(BlockWrapper, { defaultPadding: "p-5xl", className: style('overflow-hidden', className), ...rest, children: jsxs("div", { className: "flex flex-col m:flex-row gap-s justify-between", children: [jsxs("div", { className: "w-full m:w-1/3", children: [jsx(Headline, { isEmbedded: true, title: title, description: description, as: "h1", align: "text-left" }), jsx(Headline, { className: "pt-m", description: additionalDescription, align: "text-left", isEmbedded: true })] }), links?.length ? renderLinks(links, 'm:justify-self-end m:pt-s w-full m:w-2/3') : null] }) })));
3047
+ const MAX_LINKS_COUNT = 5;
3048
+
3049
+ const CarouselLinks = JSX(({ className, additionalDescription, description, links, title, ...rest }) => (jsx(BlockWrapper, { defaultPadding: "p-5xl", className: style('overflow-hidden', className), ...rest, children: jsxs("div", { className: "flex flex-col lg:flex-row sm:items-center gap-s justify-between", children: [jsxs("div", { children: [jsx(Headline, { isEmbedded: true, title: title, description: description, as: "h1", align: "text-left" }), jsx(Headline, { className: "pt-m", description: additionalDescription, align: "text-left", isEmbedded: true })] }), links?.length ? renderLinks(links, 'sm:self-end sm:pt-s') : null] }) })));
3048
3050
  const renderLinks = (links, className = '') => {
3049
- const itemCount = Math.ceil(links.length / 3);
3050
- return (jsx(Carousel, { className: className, version: "secondary", itemCount: itemCount, arrowsPadded: false, padding: "p-0", visibleItemCount: 0, children: Array.from({ length: itemCount })
3051
+ const itemCount = Math.ceil(links.length / MAX_LINKS_COUNT);
3052
+ return (jsx(Carousel, { className: className, version: "secondary", itemCount: itemCount, arrowsPadded: false, padding: "p-0", visibleItemCount: 0, isEmbedded: true, children: Array.from({ length: itemCount })
3051
3053
  .fill(null)
3052
- .map((_, groupIndex) => (jsx("div", { className: style('flex flex-wrap gap-2xs m:justify-center'), children: links.slice(groupIndex * 3, (groupIndex + 1) * 3).map((link, index) => (jsx(CarouselLinkButton, { ...link }, String(index)))) }, String(groupIndex)))) }));
3054
+ .map((_, groupIndex) => (jsx("div", { className: "flex flex-wrap gap-2xs sm:gap-0 sm:justify-center", children: links
3055
+ .slice(groupIndex * MAX_LINKS_COUNT, (groupIndex + 1) * MAX_LINKS_COUNT)
3056
+ .map((link, index) => (jsx(CarouselLinkButton, { ...link }, String(index)))) }, String(groupIndex)))) }));
3053
3057
  };
3054
3058
 
3055
3059
  const LinkWrapper = JSX(({ className = '', href, target, isRemote = false, children }) => {
@@ -4868,7 +4872,7 @@
4868
4872
  }
4869
4873
  const fetchMap$1 = async (url) => {
4870
4874
  const result = await fetchJSON(url, { method: 'GET' });
4871
- return result || EMPTY_VALUE$2;
4875
+ return Array.isArray(result) ? result : EMPTY_VALUE$2;
4872
4876
  };
4873
4877
 
4874
4878
  const INITIAL_FILTRATION_STATE$1 = {
@@ -5073,7 +5077,7 @@
5073
5077
  }
5074
5078
  const fetchMap = async (url) => {
5075
5079
  const result = await fetchJSON(url, { method: 'GET' });
5076
- return result || EMPTY_VALUE$1;
5080
+ return Array.isArray(result) ? result : EMPTY_VALUE$1;
5077
5081
  };
5078
5082
 
5079
5083
  const INITIAL_FILTRATION_STATE = {
@@ -5988,7 +5992,7 @@
5988
5992
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
5989
5993
  });
5990
5994
 
5991
- const packageVersion = "0.14.224";
5995
+ const packageVersion = "0.14.226";
5992
5996
 
5993
5997
  exports.Blocks = Blocks;
5994
5998
  exports.ContentPage = ContentPage;