@redneckz/wildless-cms-uni-blocks 0.14.131 → 0.14.133
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +27 -11
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/UnitBlock/UnitBlock.d.ts +6 -0
- package/bundle/components/UnitBlock/UnitBlockContent.d.ts +6 -0
- package/bundle/components/VerticalLayout/VerticalLayoutContent.d.ts +2 -1
- package/bundle/ui-kit/BlockWrapper.d.ts +1 -0
- package/bundle/ui-kit/Unit/Unit.d.ts +2 -0
- package/bundle/ui-kit/Unit/UnitProps.d.ts +5 -0
- package/bundle/utils/adjustSrc.d.ts +2 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Blocks.mobile.js +2 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/UnitBlock/UnitBlock.d.ts +6 -0
- package/dist/components/UnitBlock/UnitBlock.js +11 -0
- package/dist/components/UnitBlock/UnitBlock.js.map +1 -0
- package/dist/components/UnitBlock/UnitBlockContent.d.ts +6 -0
- package/dist/components/UnitBlock/UnitBlockContent.js +2 -0
- package/dist/components/UnitBlock/UnitBlockContent.js.map +1 -0
- package/dist/components/VerticalLayout/VerticalLayout.js +14 -7
- package/dist/components/VerticalLayout/VerticalLayout.js.map +1 -1
- package/dist/components/VerticalLayout/VerticalLayoutContent.d.ts +2 -1
- package/dist/ui-kit/BlockWrapper.d.ts +1 -0
- package/dist/ui-kit/BlockWrapper.js +2 -2
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/dist/ui-kit/Img/ImgAsPicture.js +3 -5
- package/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/dist/ui-kit/Unit/Unit.d.ts +2 -0
- package/dist/ui-kit/Unit/Unit.js +9 -0
- package/dist/ui-kit/Unit/Unit.js.map +1 -0
- package/dist/ui-kit/Unit/UnitProps.d.ts +5 -0
- package/dist/ui-kit/Unit/UnitProps.js +2 -0
- package/dist/ui-kit/Unit/UnitProps.js.map +1 -0
- package/dist/utils/adjustSrc.d.ts +2 -0
- package/dist/utils/adjustSrc.js +7 -0
- package/dist/utils/adjustSrc.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Blocks.mobile.js +2 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/UnitBlock/UnitBlock.d.ts +6 -0
- package/lib/components/UnitBlock/UnitBlock.fixture.d.ts +7 -0
- package/lib/components/UnitBlock/UnitBlock.fixture.mobile.d.ts +7 -0
- package/lib/components/UnitBlock/UnitBlock.js +9 -0
- package/lib/components/UnitBlock/UnitBlock.js.map +1 -0
- package/lib/components/UnitBlock/UnitBlockContent.d.ts +6 -0
- package/lib/components/UnitBlock/UnitBlockContent.js +2 -0
- package/lib/components/UnitBlock/UnitBlockContent.js.map +1 -0
- package/lib/components/VerticalLayout/VerticalLayout.fixture.d.ts +1 -0
- package/lib/components/VerticalLayout/VerticalLayout.js +14 -7
- package/lib/components/VerticalLayout/VerticalLayout.js.map +1 -1
- package/lib/components/VerticalLayout/VerticalLayoutContent.d.ts +2 -1
- package/lib/ui-kit/BlockWrapper.d.ts +1 -0
- package/lib/ui-kit/BlockWrapper.js +2 -2
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/ui-kit/Img/ImgAsPicture.js +1 -3
- package/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/lib/ui-kit/Unit/Unit.d.ts +2 -0
- package/lib/ui-kit/Unit/Unit.js +7 -0
- package/lib/ui-kit/Unit/Unit.js.map +1 -0
- package/lib/ui-kit/Unit/UnitProps.d.ts +5 -0
- package/lib/ui-kit/Unit/UnitProps.js +2 -0
- package/lib/ui-kit/Unit/UnitProps.js.map +1 -0
- package/lib/utils/adjustSrc.d.ts +2 -0
- package/lib/utils/adjustSrc.js +4 -0
- package/lib/utils/adjustSrc.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +27 -11
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/UnitBlock/UnitBlock.d.ts +6 -0
- package/mobile/bundle/components/UnitBlock/UnitBlockContent.d.ts +6 -0
- package/mobile/bundle/components/VerticalLayout/VerticalLayoutContent.d.ts +2 -1
- package/mobile/bundle/ui-kit/BlockWrapper.d.ts +1 -0
- package/mobile/bundle/ui-kit/Unit/Unit.d.ts +2 -0
- package/mobile/bundle/ui-kit/Unit/UnitProps.d.ts +5 -0
- package/mobile/bundle/utils/adjustSrc.d.ts +2 -0
- package/mobile/dist/components/Blocks.js +2 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/UnitBlock/UnitBlock.d.ts +6 -0
- package/mobile/dist/components/UnitBlock/UnitBlock.js +11 -0
- package/mobile/dist/components/UnitBlock/UnitBlock.js.map +1 -0
- package/mobile/dist/components/UnitBlock/UnitBlockContent.d.ts +6 -0
- package/mobile/dist/components/UnitBlock/UnitBlockContent.js +2 -0
- package/mobile/dist/components/UnitBlock/UnitBlockContent.js.map +1 -0
- package/mobile/dist/components/VerticalLayout/VerticalLayout.js +14 -7
- package/mobile/dist/components/VerticalLayout/VerticalLayout.js.map +1 -1
- package/mobile/dist/components/VerticalLayout/VerticalLayoutContent.d.ts +2 -1
- package/mobile/dist/ui-kit/BlockWrapper.d.ts +1 -0
- package/mobile/dist/ui-kit/BlockWrapper.js +2 -2
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/dist/ui-kit/Img/ImgAsPicture.js +3 -5
- package/mobile/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/mobile/dist/ui-kit/Unit/Unit.d.ts +2 -0
- package/mobile/dist/ui-kit/Unit/Unit.js +9 -0
- package/mobile/dist/ui-kit/Unit/Unit.js.map +1 -0
- package/mobile/dist/ui-kit/Unit/UnitProps.d.ts +5 -0
- package/mobile/dist/ui-kit/Unit/UnitProps.js +2 -0
- package/mobile/dist/ui-kit/Unit/UnitProps.js.map +1 -0
- package/mobile/dist/utils/adjustSrc.d.ts +2 -0
- package/mobile/dist/utils/adjustSrc.js +7 -0
- package/mobile/dist/utils/adjustSrc.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Blocks.js +2 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/UnitBlock/UnitBlock.d.ts +6 -0
- package/mobile/lib/components/UnitBlock/UnitBlock.js +9 -0
- package/mobile/lib/components/UnitBlock/UnitBlock.js.map +1 -0
- package/mobile/lib/components/UnitBlock/UnitBlockContent.d.ts +6 -0
- package/mobile/lib/components/UnitBlock/UnitBlockContent.js +2 -0
- package/mobile/lib/components/UnitBlock/UnitBlockContent.js.map +1 -0
- package/mobile/lib/components/VerticalLayout/VerticalLayout.js +14 -7
- package/mobile/lib/components/VerticalLayout/VerticalLayout.js.map +1 -1
- package/mobile/lib/components/VerticalLayout/VerticalLayoutContent.d.ts +2 -1
- package/mobile/lib/ui-kit/BlockWrapper.d.ts +1 -0
- package/mobile/lib/ui-kit/BlockWrapper.js +2 -2
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/ui-kit/Img/ImgAsPicture.js +1 -3
- package/mobile/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/mobile/lib/ui-kit/Unit/Unit.d.ts +2 -0
- package/mobile/lib/ui-kit/Unit/Unit.js +7 -0
- package/mobile/lib/ui-kit/Unit/Unit.js.map +1 -0
- package/mobile/lib/ui-kit/Unit/UnitProps.d.ts +5 -0
- package/mobile/lib/ui-kit/Unit/UnitProps.js +2 -0
- package/mobile/lib/ui-kit/Unit/UnitProps.js.map +1 -0
- package/mobile/lib/utils/adjustSrc.d.ts +2 -0
- package/mobile/lib/utils/adjustSrc.js +4 -0
- package/mobile/lib/utils/adjustSrc.js.map +1 -0
- package/mobile/src/common.css +1 -1
- package/mobile/src/components/Blocks.ts +2 -0
- package/mobile/src/components/UnitBlock/UnitBlock.example.json +1 -0
- package/mobile/src/components/UnitBlock/UnitBlock.tsx +17 -0
- package/mobile/src/components/UnitBlock/UnitBlock.ui.json +1 -0
- package/mobile/src/components/UnitBlock/UnitBlockContent.ts +7 -0
- package/mobile/src/components/VerticalLayout/VerticalLayout.tsx +32 -17
- package/mobile/src/components/VerticalLayout/VerticalLayoutContent.ts +2 -1
- package/mobile/src/ui-kit/BlockWrapper.tsx +3 -0
- package/mobile/src/ui-kit/Img/ImgAsPicture.tsx +2 -6
- package/mobile/src/ui-kit/Unit/Unit.tsx +26 -0
- package/mobile/src/ui-kit/Unit/UnitProps.ts +5 -0
- package/mobile/src/utils/adjustSrc.ts +6 -0
- package/package.json +1 -1
- package/src/common.css +1 -1
- package/src/components/Blocks.mobile.ts +2 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/UnitBlock/UnitBlock.example.json +1 -0
- package/src/components/UnitBlock/UnitBlock.fixture.mobile.tsx +27 -0
- package/src/components/UnitBlock/UnitBlock.fixture.tsx +27 -0
- package/src/components/UnitBlock/UnitBlock.tsx +17 -0
- package/src/components/UnitBlock/UnitBlock.ui.json +1 -0
- package/src/components/UnitBlock/UnitBlockContent.ts +7 -0
- package/src/components/VerticalLayout/VerticalLayout.fixture.tsx +65 -0
- package/src/components/VerticalLayout/VerticalLayout.tsx +32 -17
- package/src/components/VerticalLayout/VerticalLayoutContent.ts +2 -1
- package/src/cosmos.decorator.tsx +4 -1
- package/src/ui-kit/BlockWrapper.tsx +3 -0
- package/src/ui-kit/Img/ImgAsPicture.tsx +2 -6
- package/src/ui-kit/Unit/Unit.tsx +26 -0
- package/src/ui-kit/Unit/UnitProps.ts +5 -0
- package/src/utils/adjustSrc.ts +6 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
transparent: 'bg-transparent text-primary-text',
|
|
291
291
|
'': '',
|
|
292
292
|
};
|
|
293
|
-
const BlockWrapper = JSX(({ className, version = 'primary', isTheme = true, defaultPadding = 'p-xl', padding, block, tag = 'section', role, children, }) => {
|
|
293
|
+
const BlockWrapper = JSX(({ className, version = 'primary', isTheme = true, defaultPadding = 'p-xl', padding, block, tag = 'section', role, children, style: inlineStyles, }) => {
|
|
294
294
|
const Tag = tag;
|
|
295
295
|
const [isHidden, setHidden] = useState(false);
|
|
296
296
|
useEffect(() => defaultEventBus.subscribe('tab', (event) => {
|
|
@@ -299,7 +299,7 @@
|
|
|
299
299
|
}
|
|
300
300
|
}), [block]);
|
|
301
301
|
const isGroup = version && isTheme;
|
|
302
|
-
return (jsx(Tag, { className: style('@container font-sans', isGroup ? 'group' : '', blockStyles[version], isHidden ? 'hidden' : '', padding || defaultPadding, className), ...(isGroup ? { 'data-ver': version } : {}), ...(block?.anchor ? { id: block.anchor } : {}), role: role, children: children }));
|
|
302
|
+
return (jsx(Tag, { className: style('@container font-sans', isGroup ? 'group' : '', blockStyles[version], isHidden ? 'hidden' : '', padding || defaultPadding, className), ...(isGroup ? { 'data-ver': version } : {}), ...(block?.anchor ? { id: block.anchor } : {}), role: role, style: inlineStyles, children: children }));
|
|
303
303
|
});
|
|
304
304
|
|
|
305
305
|
const headingTag = (tag) => tag;
|
|
@@ -449,6 +449,8 @@
|
|
|
449
449
|
const getSvgSize = (width) => (width ? '' : 'w-full h-full');
|
|
450
450
|
const Background = JSX(({ className, children }) => className ? jsx("div", { className: className, children: children }) : children);
|
|
451
451
|
|
|
452
|
+
const adjustSrc = (router, pathPrefix) => (src) => src && !isURL(src) ? adjustHref(router)(joinPath(pathPrefix, src)) : src;
|
|
453
|
+
|
|
452
454
|
const sourcesComparator = (a, b) => a?.media && b?.media ? a.media - b.media : 0;
|
|
453
455
|
const ImgAsPicture = JSX(({ className = '', image, imageClassName = '', pathPrefix }) => {
|
|
454
456
|
const router = useRouter();
|
|
@@ -465,7 +467,6 @@
|
|
|
465
467
|
width: image?.size?.width ? `${image.size?.width}px` : '100%',
|
|
466
468
|
height: image?.size?.height ? `${image.size?.height}px` : 'auto',
|
|
467
469
|
}, width: image?.size?.width, height: image?.size?.height }));
|
|
468
|
-
const adjustSrc = (router, pathPrefix) => (src) => src && !isURL(src) ? adjustHref(router)(joinPath(pathPrefix, src)) : src;
|
|
469
470
|
const formatToMimeType = (format) => format ? `image/${String(format)}` : undefined;
|
|
470
471
|
|
|
471
472
|
const Img = JSX(({ className = '', image, imageClassName = '', pathPrefix, ...iconProps }) => {
|
|
@@ -5620,13 +5621,27 @@
|
|
|
5620
5621
|
const renderIcon = () => (jsx("div", { className: `rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main`, children: "i" }));
|
|
5621
5622
|
const renderDescription = (description) => (jsx(Paragraph, { size: "text-s", font: "font-light", color: "text-secondary-text group-data-secondary:text-white", children: description }));
|
|
5622
5623
|
|
|
5623
|
-
const
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
}) }))
|
|
5624
|
+
const Unit = JSX(({ prefix, unit, suffix }) => (jsxs("div", { className: "w-full pt-default flex items-end", children: [prefix ? (jsx("div", { className: "gradient-color-text", children: jsx(Text, { size: "text-h2", children: prefix }) })) : null, unit ? (
|
|
5625
|
+
// -mb-n добавлен для выравнивания unit относительно prefix и suffix, тк шрифт font-mohave неправильно высчитывает line-height
|
|
5626
|
+
jsx("div", { className: "-mb-6 @xl:-mb-4", children: jsx("span", { className: "font-mohave text-title-large sm:text-title-extra gradient-color-text", children: unit }) })) : null, suffix ? (jsx("div", { className: "gradient-color-text", children: jsx(Text, { size: "text-h2", children: suffix }) })) : null] })));
|
|
5627
|
+
|
|
5628
|
+
const UnitBlock = JSX((props) => {
|
|
5629
|
+
const { prefix, unit, suffix, ...rest } = props;
|
|
5630
|
+
return (jsx(BlockWrapper, { defaultPadding: "p-0", ...rest, children: jsx(Unit, { prefix: prefix, unit: unit, suffix: suffix }) }));
|
|
5631
|
+
});
|
|
5632
|
+
|
|
5633
|
+
const VerticalLayout = JSX(({ className = '', padding = 'p-0', gap = '', isInnerPadding = true, version = 'transparent', isTheme = false, isCardBorder = false, image, ...rest }) => {
|
|
5634
|
+
const router = useRouter();
|
|
5635
|
+
return (jsx(BlockWrapper, { className: style('relative flex flex-col', gapStyles[gap], image?.src ? 'bg-right-bottom bg-no-repeat' : '', className), ...(image?.src
|
|
5636
|
+
? { style: { backgroundImage: `url(${adjustSrc(router)(image?.src)})` } }
|
|
5637
|
+
: {}), padding: padding, version: version, isTheme: isTheme, ...rest, children: renderChildren({
|
|
5638
|
+
...rest,
|
|
5639
|
+
extraProps: {
|
|
5640
|
+
className: style('w-full', getBorderStyle(isCardBorder)),
|
|
5641
|
+
padding: isInnerPadding ? '' : 'p-0',
|
|
5642
|
+
},
|
|
5643
|
+
}) }));
|
|
5644
|
+
});
|
|
5630
5645
|
VerticalLayout.childrenTypes = [];
|
|
5631
5646
|
|
|
5632
5647
|
const getColSpan = (className) => {
|
|
@@ -5680,6 +5695,7 @@
|
|
|
5680
5695
|
Placeholder,
|
|
5681
5696
|
ProductBlock,
|
|
5682
5697
|
ProductGallery,
|
|
5698
|
+
UnitBlock,
|
|
5683
5699
|
RepresentativeOfficeInfo,
|
|
5684
5700
|
RichTextBlock,
|
|
5685
5701
|
RollupItem,
|
|
@@ -5871,7 +5887,7 @@
|
|
|
5871
5887
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-3xl sticky bottom-0 pointer-events-auto" }) }));
|
|
5872
5888
|
}
|
|
5873
5889
|
|
|
5874
|
-
const packageVersion = "0.14.
|
|
5890
|
+
const packageVersion = "0.14.132";
|
|
5875
5891
|
|
|
5876
5892
|
exports.Blocks = Blocks;
|
|
5877
5893
|
exports.ContentPage = ContentPage;
|