@redneckz/wildless-cms-uni-blocks 0.8.12 → 0.8.14
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 +11 -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 +6 -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 +6 -10
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +7 -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 +6 -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 +6 -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 +12 -13
- package/package.json +1 -1
- package/src/components/Tabs/Tabs.tsx +5 -23
- package/src/ui-kit/BlockWrapper.tsx +12 -13
package/bundle/bundle.umd.js
CHANGED
|
@@ -365,18 +365,14 @@
|
|
|
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
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}
|
|
375
|
-
else {
|
|
376
|
-
setVisible(true);
|
|
377
|
-
}
|
|
370
|
+
setHidden(Boolean(event.type === 'group' &&
|
|
371
|
+
event.label &&
|
|
372
|
+
block?.labels?.length &&
|
|
373
|
+
!block.labels.includes(event.label)));
|
|
378
374
|
}), [block]);
|
|
379
|
-
return
|
|
375
|
+
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
376
|
});
|
|
381
377
|
|
|
382
378
|
const styles$4 = {
|
|
@@ -4108,16 +4104,11 @@
|
|
|
4108
4104
|
const Tabs = JSX((props) => {
|
|
4109
4105
|
const { className = '', tabs, showCounter, isSticky, tabsMode, ...rest } = props;
|
|
4110
4106
|
const [currentTab, setCurrentTab] = useState(tabs ? tabs[0] : undefined);
|
|
4111
|
-
useEffect(() =>
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
setCurrentTab(tab);
|
|
4107
|
+
useEffect(() => {
|
|
4108
|
+
if (currentTab?.type === 'group') {
|
|
4109
|
+
defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref });
|
|
4115
4110
|
}
|
|
4116
|
-
|
|
4117
|
-
}), [tabs]);
|
|
4118
|
-
useEffect(() => currentTab?.type === 'group'
|
|
4119
|
-
? defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref })
|
|
4120
|
-
: undefined, [currentTab]);
|
|
4111
|
+
}, [currentTab]);
|
|
4121
4112
|
const handleClick = useCallback((selectedTab) => {
|
|
4122
4113
|
if (selectedTab?.type === 'group') {
|
|
4123
4114
|
defaultEventBus.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
|
|
@@ -4131,7 +4122,6 @@
|
|
|
4131
4122
|
...rest,
|
|
4132
4123
|
}))) }));
|
|
4133
4124
|
});
|
|
4134
|
-
const checkTab = (event) => (_) => _.type === 'link' && _.href === `#${event.label}`;
|
|
4135
4125
|
|
|
4136
4126
|
const DIVIDER_CLASSES = 'border-main-divider border border-t-0 border-x-0';
|
|
4137
4127
|
const FIRST_CELL_CLASSES = 'w-[354px] flex-shrink-0';
|
|
@@ -4541,7 +4531,7 @@
|
|
|
4541
4531
|
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
4532
|
}
|
|
4543
4533
|
|
|
4544
|
-
const packageVersion = "0.8.
|
|
4534
|
+
const packageVersion = "0.8.14";
|
|
4545
4535
|
|
|
4546
4536
|
exports.Blocks = Blocks;
|
|
4547
4537
|
exports.ContentPage = ContentPage;
|