@redneckz/wildless-cms-uni-blocks 0.8.18 → 0.8.19

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 (90) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +20 -16
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +0 -2
  5. package/bundle/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +2 -7
  6. package/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  7. package/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +12 -3
  8. package/bundle/ui-kit/SwipeListControl/getContainerHeight.d.ts +4 -0
  9. package/dist/components/CarouselLinks/CarouselLinks.js +1 -1
  10. package/dist/ui-kit/LinkButton/LinkButton.js +4 -4
  11. package/dist/ui-kit/LinkButton/LinkButton.js.map +1 -1
  12. package/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +0 -2
  13. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +4 -8
  14. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  15. package/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
  16. package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  17. package/dist/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +2 -7
  18. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  19. package/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +12 -3
  20. package/dist/ui-kit/SwipeListControl/getContainerHeight.d.ts +4 -0
  21. package/dist/ui-kit/SwipeListControl/getContainerHeight.js +13 -0
  22. package/dist/ui-kit/SwipeListControl/getContainerHeight.js.map +1 -0
  23. package/lib/components/CarouselLinks/CarouselLinks.js +1 -1
  24. package/lib/ui-kit/LinkButton/LinkButton.js +4 -4
  25. package/lib/ui-kit/LinkButton/LinkButton.js.map +1 -1
  26. package/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +0 -2
  27. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +4 -8
  28. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  29. package/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
  30. package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  31. package/lib/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +2 -7
  32. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  33. package/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +12 -3
  34. package/lib/ui-kit/SwipeListControl/getContainerHeight.d.ts +4 -0
  35. package/lib/ui-kit/SwipeListControl/getContainerHeight.js +10 -0
  36. package/lib/ui-kit/SwipeListControl/getContainerHeight.js.map +1 -0
  37. package/mobile/bundle/bundle.umd.js +16 -11
  38. package/mobile/bundle/bundle.umd.min.js +1 -1
  39. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +0 -2
  40. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +2 -7
  41. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  42. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +12 -3
  43. package/mobile/bundle/ui-kit/SwipeListControl/getContainerHeight.d.ts +4 -0
  44. package/mobile/dist/components/CarouselLinks/CarouselLinks.js +1 -1
  45. package/mobile/dist/ui-kit/LinkButton/LinkButton.js +4 -4
  46. package/mobile/dist/ui-kit/LinkButton/LinkButton.js.map +1 -1
  47. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +0 -2
  48. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +4 -8
  49. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  50. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
  51. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  52. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +2 -7
  53. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  54. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +12 -3
  55. package/mobile/dist/ui-kit/SwipeListControl/getContainerHeight.d.ts +4 -0
  56. package/mobile/dist/ui-kit/SwipeListControl/getContainerHeight.js +13 -0
  57. package/mobile/dist/ui-kit/SwipeListControl/getContainerHeight.js.map +1 -0
  58. package/mobile/lib/components/CarouselLinks/CarouselLinks.js +1 -1
  59. package/mobile/lib/ui-kit/LinkButton/LinkButton.js +4 -4
  60. package/mobile/lib/ui-kit/LinkButton/LinkButton.js.map +1 -1
  61. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +0 -2
  62. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +4 -8
  63. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  64. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
  65. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  66. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +2 -7
  67. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  68. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +12 -3
  69. package/mobile/lib/ui-kit/SwipeListControl/getContainerHeight.d.ts +4 -0
  70. package/mobile/lib/ui-kit/SwipeListControl/getContainerHeight.js +10 -0
  71. package/mobile/lib/ui-kit/SwipeListControl/getContainerHeight.js.map +1 -0
  72. package/mobile/src/components/CarouselLinks/CarouselLinks.tsx +1 -1
  73. package/mobile/src/components/CarouselLinks/CarouselLinks.ui.json +8 -0
  74. package/mobile/src/ui-kit/LinkButton/LinkButton.tsx +7 -7
  75. package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +4 -10
  76. package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +2 -0
  77. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlContent.ts +2 -8
  78. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
  79. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +14 -3
  80. package/mobile/src/ui-kit/SwipeListControl/getContainerHeight.ts +10 -0
  81. package/package.json +1 -1
  82. package/src/components/CarouselLinks/CarouselLinks.tsx +1 -1
  83. package/src/components/CarouselLinks/CarouselLinks.ui.json +8 -0
  84. package/src/ui-kit/LinkButton/LinkButton.tsx +7 -7
  85. package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +4 -10
  86. package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +2 -0
  87. package/src/ui-kit/SwipeListControl/SwipeListControlContent.ts +2 -8
  88. package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
  89. package/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +14 -3
  90. package/src/ui-kit/SwipeListControl/getContainerHeight.ts +10 -0
@@ -1832,6 +1832,16 @@
1832
1832
  return Array.isArray(children) ? children.map(mapper) : mapper(children, 0);
1833
1833
  };
1834
1834
 
1835
+ const HEADER_HEIGHT = 170;
1836
+ const FOOTER_HEIGHT = 48;
1837
+ const BLOCKS_GAP = 4;
1838
+ const PAGE_PADDINGS_X = 20;
1839
+ const DEFAULT_HEIGHT = 866;
1840
+ const getContainerHeight = (minHeight) => ({
1841
+ height: `calc(100vh - ${HEADER_HEIGHT + FOOTER_HEIGHT + BLOCKS_GAP + PAGE_PADDINGS_X}px)`,
1842
+ minHeight: `${minHeight || DEFAULT_HEIGHT}px`,
1843
+ });
1844
+
1835
1845
  const SwipeListItem = JSX(({ className = '', style, idx, activeIndex, observerOptions, children, onIntersection }) => {
1836
1846
  const observerCallback = useCallback((entries) => {
1837
1847
  if (entries.length && onIntersection) {
@@ -1843,8 +1853,7 @@
1843
1853
  });
1844
1854
 
1845
1855
  const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
1846
- const DEFAULT_HEIGHT = '866px';
1847
- const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
1856
+ const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', minHeight, children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
1848
1857
  const observerOptions = {
1849
1858
  sensitivity: 1,
1850
1859
  rootRef: containerRef,
@@ -1862,14 +1871,10 @@
1862
1871
  const isHorizontalList = listType === 'horizontal-list';
1863
1872
  const containerStyle = {
1864
1873
  ...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
1865
- ...(isVerticalList ? { height: DEFAULT_HEIGHT } : {}),
1874
+ ...(isVerticalList ? getContainerHeight(minHeight) : {}),
1866
1875
  gap: `${gap}px`,
1867
1876
  };
1868
- const itemContainerStyle = {
1869
- ...(isHorizontalList ? getContainerOffset(padding / 4) : {}),
1870
- maxHeight: DEFAULT_HEIGHT,
1871
- };
1872
- return (jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, role: "list", ref: containerRef, children: mapChildren((child, idx) => (jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : '', isVerticalList ? 'h-full' : ''), style: itemContainerStyle, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
1877
+ return (jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, role: "list", ref: containerRef, children: mapChildren((child, idx) => (jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : '', isVerticalList ? 'h-full' : ''), style: isHorizontalList ? getContainerOffset(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
1873
1878
  });
1874
1879
  // Styles used to compensate outer container padding to get rid of clipping effect
1875
1880
  const getContainerOffset = (padding, additionalPadding = 0) => ({
@@ -2101,13 +2106,12 @@
2101
2106
  justify-between items-center group-hover/link:text-primary-main z-10`;
2102
2107
  const LINK_BORDER_CLASS_NAME = 'bg-transparent border-white border h-[70px] absolute w-[316px] top-0';
2103
2108
  const LinkButton = JSX(({ text, href = '', target = '', className = '' }) => {
2104
- if (!text) {
2105
- return null;
2106
- }
2107
- return (jsxs("div", { className: `relative group/link cursor-pointer w-[328px] h-[82px] ${className}`, children: [jsxs("a", { className: LINK_CLASS_NAME, role: "link", href: href, target: target, children: [jsx("div", { className: "p-0.5", children: text }), jsx("div", { className: "w-6 h-6", children: jsx(ImgInner, { className: "w-4 h-4 min-w-4 min-h-4 rounded-full box-border brightness-0 group-hover/link:brightness-100", image: { icon: 'ArrowRightIcon', iconVersion: 'black' }, imageClassName: "group-hover/link:text-primary-main", width: "24", height: "24", asSVG: true }) })] }), jsx("div", { className: `${LINK_BORDER_CLASS_NAME} mx-1.5 mt-1.5` }), jsx("div", { className: `${LINK_BORDER_CLASS_NAME} mt-3 mr-3` })] }));
2109
+ const link = useLink();
2110
+ const adjustedProps = link({ href, target });
2111
+ return text ? (jsxs("div", { className: `relative group/link cursor-pointer w-[328px] h-[82px] ${className}`, children: [jsxs("a", { className: LINK_CLASS_NAME, role: "link", ...adjustedProps, children: [jsx("div", { className: "p-0.5", children: text }), jsx("div", { className: "w-6 h-6", children: jsx(ImgInner, { className: "w-4 h-4 min-w-4 min-h-4 rounded-full box-border brightness-0 group-hover/link:brightness-100", image: { icon: 'ArrowRightIcon', iconVersion: 'black' }, imageClassName: "group-hover/link:text-primary-main", width: "24", height: "24", asSVG: true }) })] }), jsx("div", { className: `${LINK_BORDER_CLASS_NAME} mx-1.5 mt-1.5` }), jsx("div", { className: `${LINK_BORDER_CLASS_NAME} mt-3 mr-3` })] })) : null;
2108
2112
  });
2109
2113
 
2110
- const MAX_LINKS_COUNT = 12;
2114
+ const MAX_LINKS_COUNT = 10;
2111
2115
  const CarouselLinks = JSX(({ className = '', additionalDescription, description, links, title, version = 'secondary', ...rest }) => {
2112
2116
  return (jsxs(BlockWrapper, { className: `flex w-full p-10 overflow-hidden justify-between ${className}`, version: version, ...rest, children: [jsxs("div", { className: "flex flex-col max-w-96 pr-9 text-white text-xl-light", children: [jsx(Headline, { className: "p-0", title: title, description: description, as: "h1", align: "text-left" }), additionalDescription ? (jsx("div", { className: "pt-6", children: jsx(Paragraph, { children: additionalDescription }) })) : null] }), links?.length ? renderLinks(links) : null] }));
2113
2117
  });
@@ -3949,14 +3953,14 @@
3949
3953
  and get rid of a clipping effect caused by overflow: hidden.
3950
3954
  */
3951
3955
  const DEFAULT_PADDING = 16;
3952
- const SwipeListControl = JSX(({ className = '', gap = DEFAULT_GAP, padding = DEFAULT_PADDING, showDots = true, children, onVisibleIndicesChange, listType = 'horizontal-list', }) => {
3956
+ const SwipeListControl = JSX(({ className = '', gap = DEFAULT_GAP, padding = DEFAULT_PADDING, showDots = true, minHeight, children, onVisibleIndicesChange, listType = 'horizontal-list', }) => {
3953
3957
  const itemCount = Array.isArray(children) ? children.length : 0;
3954
3958
  const [containerRef, scroll] = useSwipeListScroll({
3955
3959
  itemCount,
3956
3960
  onVisibleIndicesChange,
3957
3961
  });
3958
3962
  const [activeIndex] = scroll.visibleIndicesRange;
3959
- return (jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, listType: listType, children: children }), showDots ? (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount, listType: listType })) : null] }));
3963
+ return (jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, listType: listType, minHeight: minHeight, children: children }), showDots ? (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount, listType: listType })) : null] }));
3960
3964
  });
3961
3965
 
3962
3966
  const SwipeListControlBlock = JSX(({ listType, showDots, options, ...rest }) => {
@@ -4523,7 +4527,7 @@
4523
4527
  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" }) }));
4524
4528
  }
4525
4529
 
4526
- const packageVersion = "0.8.18";
4530
+ const packageVersion = "0.8.19";
4527
4531
 
4528
4532
  exports.Blocks = Blocks;
4529
4533
  exports.ContentPage = ContentPage;