@redneckz/wildless-cms-uni-blocks 0.8.0 → 0.8.2
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/bundle.umd.js +21 -23
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/hooks/useLink.js +8 -13
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +7 -5
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/lib/components/Tabs/Tabs.js +1 -1
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/hooks/useLink.js +8 -13
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +7 -5
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +20 -22
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/Tabs/Tabs.js +1 -1
- package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
- package/mobile/dist/hooks/useLink.js +8 -13
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +7 -5
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/lib/components/Tabs/Tabs.js +1 -1
- package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/hooks/useLink.js +8 -13
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +7 -5
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/src/components/Tabs/Tabs.tsx +2 -2
- package/mobile/src/hooks/useLink.ts +8 -14
- package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +9 -6
- package/package.json +1 -1
- package/src/components/Tabs/Tabs.tsx +2 -2
- package/src/hooks/useLink.ts +8 -14
- package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +9 -6
package/bundle/bundle.umd.js
CHANGED
|
@@ -679,10 +679,6 @@
|
|
|
679
679
|
getHash: getHash
|
|
680
680
|
});
|
|
681
681
|
|
|
682
|
-
const adjustHref = (href) => href && projectSettings.BASE_PATH && !(isURL(href) || href.startsWith('/'))
|
|
683
|
-
? `${projectSettings.BASE_PATH}${href}`
|
|
684
|
-
: href;
|
|
685
|
-
|
|
686
682
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
687
683
|
const handlerDecorator = (handler, targetContent) => {
|
|
688
684
|
return handlerDecorator._impl(handler, targetContent);
|
|
@@ -727,18 +723,14 @@
|
|
|
727
723
|
router.push(href);
|
|
728
724
|
}
|
|
729
725
|
};
|
|
730
|
-
return (props) => {
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
handleLocalURL(href, props.target)(ev);
|
|
739
|
-
}, props),
|
|
740
|
-
};
|
|
741
|
-
};
|
|
726
|
+
return (props) => ({
|
|
727
|
+
...props,
|
|
728
|
+
'aria-label': props.text,
|
|
729
|
+
onClick: handlerDecorator((ev) => {
|
|
730
|
+
props.onClick && props.onClick(ev);
|
|
731
|
+
handleLocalURL(props.href, props.target)(ev);
|
|
732
|
+
}, props),
|
|
733
|
+
});
|
|
742
734
|
}
|
|
743
735
|
|
|
744
736
|
const buttonStyleMap = {
|
|
@@ -1811,6 +1803,7 @@
|
|
|
1811
1803
|
});
|
|
1812
1804
|
|
|
1813
1805
|
const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
|
|
1806
|
+
const DEFAULT_HEIGHT = '866px';
|
|
1814
1807
|
const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
|
|
1815
1808
|
const observerOptions = {
|
|
1816
1809
|
sensitivity: 1,
|
|
@@ -1829,10 +1822,14 @@
|
|
|
1829
1822
|
const isHorizontalList = listType === 'horizontal-list';
|
|
1830
1823
|
const containerStyle = {
|
|
1831
1824
|
...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
|
|
1832
|
-
...(isVerticalList ?
|
|
1825
|
+
...(isVerticalList ? { height: DEFAULT_HEIGHT } : {}),
|
|
1833
1826
|
gap: `${gap}px`,
|
|
1834
1827
|
};
|
|
1835
|
-
|
|
1828
|
+
const itemContainerStyle = {
|
|
1829
|
+
...(isHorizontalList ? getContainerOffset(padding / 4) : {}),
|
|
1830
|
+
maxHeight: DEFAULT_HEIGHT,
|
|
1831
|
+
};
|
|
1832
|
+
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) }));
|
|
1836
1833
|
});
|
|
1837
1834
|
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
1838
1835
|
const getContainerOffset = (padding, additionalPadding = 0) => ({
|
|
@@ -1845,9 +1842,6 @@
|
|
|
1845
1842
|
.map((_, i) => [_, i])
|
|
1846
1843
|
.filter(([_]) => _ && _.intersectionRatio >= 0.9)
|
|
1847
1844
|
.map(([, i]) => i);
|
|
1848
|
-
const getContainerHeight = (ref) => ({
|
|
1849
|
-
height: ref?.current?.firstElementChild?.clientHeight || 0,
|
|
1850
|
-
});
|
|
1851
1845
|
|
|
1852
1846
|
const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
|
|
1853
1847
|
|
|
@@ -2564,6 +2558,10 @@
|
|
|
2564
2558
|
const renderMonthNames = (item, colSize) => item.month?.map((_, i) => (jsx("div", { style: { flexBasis: `${colSize}%` }, children: _.text }, `monthName-${i}`)));
|
|
2565
2559
|
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);
|
|
2566
2560
|
|
|
2561
|
+
const adjustHref = (href) => href && projectSettings.BASE_PATH && !(isURL(href) || href.startsWith('/'))
|
|
2562
|
+
? `${projectSettings.BASE_PATH}${href}`
|
|
2563
|
+
: href;
|
|
2564
|
+
|
|
2567
2565
|
const isHrefActive = (href, router) => withoutQuery(isURL(href) ? router.href : getPathname(router.href)).startsWith(withoutQuery(adjustHref(href)));
|
|
2568
2566
|
|
|
2569
2567
|
const isSubItemActive = (router) => (subItem) => isHrefActive(subItem.href, router);
|
|
@@ -4057,7 +4055,7 @@
|
|
|
4057
4055
|
return [];
|
|
4058
4056
|
}), [tabs]);
|
|
4059
4057
|
useEffect(() => currentTab?.type === 'group'
|
|
4060
|
-
? EventBus.inst.subject('tab', { label: currentTab.ref })
|
|
4058
|
+
? EventBus.inst.subject('tab', { type: currentTab.type, label: currentTab.ref })
|
|
4061
4059
|
: undefined, [currentTab]);
|
|
4062
4060
|
const handleClick = useCallback((selectedTab) => {
|
|
4063
4061
|
if (selectedTab?.type === 'group') {
|
|
@@ -4483,7 +4481,7 @@
|
|
|
4483
4481
|
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" }) }));
|
|
4484
4482
|
}
|
|
4485
4483
|
|
|
4486
|
-
const packageVersion = "0.8.
|
|
4484
|
+
const packageVersion = "0.8.2";
|
|
4487
4485
|
|
|
4488
4486
|
exports.Blocks = Blocks;
|
|
4489
4487
|
exports.ContentPage = ContentPage;
|