@redneckz/wildless-cms-uni-blocks 0.7.2 → 0.7.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.
@@ -1400,15 +1400,17 @@
1400
1400
  onVisibleIndicesChange && onVisibleIndicesChange(getVisibleIndices(itemsVisibilityList));
1401
1401
  }, [onVisibleItemsChange, onVisibleIndicesChange]);
1402
1402
  const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
1403
+ const isVerticalList = listType === 'vertical-list';
1403
1404
  const isHorizontalList = listType === 'horizontal-list';
1404
1405
  const containerStyle = {
1405
- ...(isHorizontalList ? getContainerStyle(padding, additionPadding) : {}),
1406
+ ...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
1407
+ ...(isVerticalList ? getContainerHeight(containerRef) : {}),
1406
1408
  gap: `${gap}px`,
1407
1409
  };
1408
- 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] : '', listType === 'vertical-list' ? 'h-full' : ''), style: isHorizontalList ? getContainerStyle(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
1410
+ 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] : ''), style: isHorizontalList ? getContainerOffset(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
1409
1411
  });
1410
1412
  // Styles used to compensate outer container padding to get rid of clipping effect
1411
- const getContainerStyle = (padding, additionalPadding = 0) => ({
1413
+ const getContainerOffset = (padding, additionalPadding = 0) => ({
1412
1414
  marginLeft: `${-padding}px`,
1413
1415
  marginRight: `${-padding}px`,
1414
1416
  paddingLeft: `${padding}px`,
@@ -1418,6 +1420,9 @@
1418
1420
  .map((_, i) => [_, i])
1419
1421
  .filter(([_]) => _ && _.intersectionRatio >= 0.9)
1420
1422
  .map(([, i]) => i);
1423
+ const getContainerHeight = (ref) => ({
1424
+ height: ref?.current?.firstElementChild?.clientHeight || 0,
1425
+ });
1421
1426
 
1422
1427
  const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
1423
1428
 
@@ -3996,7 +4001,7 @@
3996
4001
  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" }) }));
3997
4002
  }
3998
4003
 
3999
- const packageVersion = "0.7.2";
4004
+ const packageVersion = "0.7.3";
4000
4005
 
4001
4006
  exports.Blocks = Blocks;
4002
4007
  exports.ContentPage = ContentPage;