@redneckz/wildless-cms-uni-blocks 0.8.12 → 0.8.13
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 +8 -21
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Tabs/Tabs.js +4 -10
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/ui-kit/BlockWrapper.js +3 -10
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/components/Tabs/Tabs.js +4 -10
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/ui-kit/BlockWrapper.js +3 -10
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +4 -11
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/Tabs/Tabs.js +4 -10
- package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
- package/mobile/dist/ui-kit/BlockWrapper.js +3 -10
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/components/Tabs/Tabs.js +4 -10
- package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/ui-kit/BlockWrapper.js +3 -10
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/src/components/Tabs/Tabs.tsx +5 -23
- package/mobile/src/ui-kit/BlockWrapper.tsx +7 -13
- package/package.json +1 -1
- package/src/components/Tabs/Tabs.tsx +5 -23
- package/src/ui-kit/BlockWrapper.tsx +7 -13
package/bundle/bundle.umd.js
CHANGED
|
@@ -365,18 +365,11 @@
|
|
|
365
365
|
const BlockWrapper = JSX(({ className = '', version = 'primary', block, tag = 'section', role, children }) => {
|
|
366
366
|
const Tag = tag;
|
|
367
367
|
const ref = useBlockIntersectionObserver(block);
|
|
368
|
-
const [
|
|
368
|
+
const [isHidden, setHidden] = useState(false);
|
|
369
369
|
useEffect(() => defaultEventBus.subscribe('tab', (event) => {
|
|
370
|
-
|
|
371
|
-
setVisible(!block?.labels?.length ||
|
|
372
|
-
!event.label ||
|
|
373
|
-
Boolean(block?.labels?.includes(event.label)));
|
|
374
|
-
}
|
|
375
|
-
else {
|
|
376
|
-
setVisible(true);
|
|
377
|
-
}
|
|
370
|
+
setHidden(Boolean(event.type === 'group' && event.label && block?.labels?.includes(event.label)));
|
|
378
371
|
}), [block]);
|
|
379
|
-
return
|
|
372
|
+
return (jsx(Tag, { className: style('group', blockStyles[version], isHidden ? 'hidden' : '', className), ...(version ? { 'data-ver': version } : {}), ...(block?.anchor ? { id: block.anchor, ref } : {}), role: role, children: children }));
|
|
380
373
|
});
|
|
381
374
|
|
|
382
375
|
const styles$4 = {
|
|
@@ -4108,16 +4101,11 @@
|
|
|
4108
4101
|
const Tabs = JSX((props) => {
|
|
4109
4102
|
const { className = '', tabs, showCounter, isSticky, tabsMode, ...rest } = props;
|
|
4110
4103
|
const [currentTab, setCurrentTab] = useState(tabs ? tabs[0] : undefined);
|
|
4111
|
-
useEffect(() =>
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
setCurrentTab(tab);
|
|
4104
|
+
useEffect(() => {
|
|
4105
|
+
if (currentTab?.type === 'group') {
|
|
4106
|
+
defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref });
|
|
4115
4107
|
}
|
|
4116
|
-
|
|
4117
|
-
}), [tabs]);
|
|
4118
|
-
useEffect(() => currentTab?.type === 'group'
|
|
4119
|
-
? defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref })
|
|
4120
|
-
: undefined, [currentTab]);
|
|
4108
|
+
}, [currentTab]);
|
|
4121
4109
|
const handleClick = useCallback((selectedTab) => {
|
|
4122
4110
|
if (selectedTab?.type === 'group') {
|
|
4123
4111
|
defaultEventBus.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
|
|
@@ -4131,7 +4119,6 @@
|
|
|
4131
4119
|
...rest,
|
|
4132
4120
|
}))) }));
|
|
4133
4121
|
});
|
|
4134
|
-
const checkTab = (event) => (_) => _.type === 'link' && _.href === `#${event.label}`;
|
|
4135
4122
|
|
|
4136
4123
|
const DIVIDER_CLASSES = 'border-main-divider border border-t-0 border-x-0';
|
|
4137
4124
|
const FIRST_CELL_CLASSES = 'w-[354px] flex-shrink-0';
|
|
@@ -4541,7 +4528,7 @@
|
|
|
4541
4528
|
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" }) }));
|
|
4542
4529
|
}
|
|
4543
4530
|
|
|
4544
|
-
const packageVersion = "0.8.
|
|
4531
|
+
const packageVersion = "0.8.13";
|
|
4545
4532
|
|
|
4546
4533
|
exports.Blocks = Blocks;
|
|
4547
4534
|
exports.ContentPage = ContentPage;
|