@redneckz/wildless-cms-uni-blocks 0.2.69 → 0.2.72
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 +933 -0
- package/bundle/bundle.umd.js +878 -0
- package/bundle/bundle.umd.min.js +1 -0
- package/dist/BaseTile.d.ts +2 -12
- package/dist/BaseTile.js.map +1 -1
- package/dist/BaseTileContent.d.ts +13 -0
- package/dist/BaseTileContent.js +2 -0
- package/dist/BaseTileContent.js.map +1 -0
- package/dist/BenefitsBlock.d.ts +1 -10
- package/dist/BenefitsBlock.js.map +1 -1
- package/dist/BenefitsBlockContent.d.ts +10 -0
- package/dist/BenefitsBlockContent.js +2 -0
- package/dist/BenefitsBlockContent.js.map +1 -0
- package/dist/BlockContent.d.ts +15 -0
- package/dist/BlockContent.js +2 -0
- package/dist/BlockContent.js.map +1 -0
- package/dist/Blocks.d.ts +0 -15
- package/dist/Blocks.js +7 -7
- package/dist/Blocks.js.map +1 -1
- package/dist/ContentPage.d.ts +1 -1
- package/dist/ExchangeRateTile.d.ts +1 -3
- package/dist/ExchangeRateTile.js.map +1 -1
- package/dist/ExchangeRateTileContent.d.ts +3 -0
- package/dist/ExchangeRateTileContent.js +2 -0
- package/dist/ExchangeRateTileContent.js.map +1 -0
- package/dist/Footer/Contacts.d.ts +2 -1
- package/dist/Footer/Contacts.js.map +1 -1
- package/dist/Footer/Footer.d.ts +2 -8
- package/dist/Footer/Footer.js +1 -1
- package/dist/Footer/Footer.js.map +1 -1
- package/dist/Footer/Footer.mobile.d.ts +1 -1
- package/dist/Footer/FooterContent.d.ts +13 -0
- package/dist/Footer/FooterContent.js +2 -0
- package/dist/Footer/FooterContent.js.map +1 -0
- package/dist/Footer/FooterLink.d.ts +1 -1
- package/dist/Footer/Sitemap.d.ts +2 -1
- package/dist/Footer/Sitemap.js.map +1 -1
- package/dist/Footer/SocialMedia.d.ts +2 -1
- package/dist/Footer/SocialMedia.js.map +1 -1
- package/dist/Gallery.d.ts +2 -13
- package/dist/Gallery.js.map +1 -1
- package/dist/Gallery.mobile.d.ts +1 -1
- package/dist/Gallery.mobile.js.map +1 -1
- package/dist/GalleryContent.d.ts +13 -0
- package/dist/GalleryContent.js +2 -0
- package/dist/GalleryContent.js.map +1 -0
- package/dist/Header/HeaderContent.d.ts +2 -3
- package/dist/Header/isSubItemActive.d.ts +1 -1
- package/dist/Header/isTopItemActive.d.ts +1 -1
- package/dist/Img.d.ts +1 -1
- package/dist/MobileAppTile.d.ts +1 -9
- package/dist/MobileAppTile.js.map +1 -1
- package/dist/MobileAppTileContent.d.ts +9 -0
- package/dist/MobileAppTileContent.js +2 -0
- package/dist/MobileAppTileContent.js.map +1 -0
- package/dist/MobileBlocks.js +2 -2
- package/dist/MobileBlocks.js.map +1 -1
- package/dist/Placeholder.d.ts +1 -3
- package/dist/Placeholder.js.map +1 -1
- package/dist/PlaceholderContent.d.ts +3 -0
- package/dist/PlaceholderContent.js +2 -0
- package/dist/PlaceholderContent.js.map +1 -0
- package/dist/ProductBlock.d.ts +2 -4
- package/dist/ProductBlock.js.map +1 -1
- package/dist/ProductBlock.mobile.d.ts +1 -1
- package/dist/ProductBlock.mobile.js.map +1 -1
- package/dist/ProductBlockContent.d.ts +5 -0
- package/dist/ProductBlockContent.js +2 -0
- package/dist/ProductBlockContent.js.map +1 -0
- package/dist/ProductBlockInner.d.ts +1 -5
- package/dist/ProductBlockInner.js.map +1 -1
- package/dist/ProductBlockInnerContent.d.ts +5 -0
- package/dist/ProductBlockInnerContent.js +2 -0
- package/dist/ProductBlockInnerContent.js.map +1 -0
- package/dist/ProductGallery.d.ts +1 -14
- package/dist/ProductGallery.js.map +1 -1
- package/dist/ProductGalleryContent.d.ts +14 -0
- package/dist/ProductGalleryContent.js +2 -0
- package/dist/ProductGalleryContent.js.map +1 -0
- package/dist/ProductTile.d.ts +1 -5
- package/dist/ProductTile.js.map +1 -1
- package/dist/ProductTileContent.d.ts +5 -0
- package/dist/ProductTileContent.js +2 -0
- package/dist/ProductTileContent.js.map +1 -0
- package/dist/PromoTile.d.ts +1 -4
- package/dist/PromoTile.js.map +1 -1
- package/dist/PromoTileContent.d.ts +4 -0
- package/dist/PromoTileContent.js +2 -0
- package/dist/PromoTileContent.js.map +1 -0
- package/dist/StepsBlock.d.ts +1 -10
- package/dist/StepsBlock.js.map +1 -1
- package/dist/StepsBlockContent.d.ts +10 -0
- package/dist/StepsBlockContent.js +2 -0
- package/dist/StepsBlockContent.js.map +1 -0
- package/dist/TextBlock.d.ts +2 -11
- package/dist/TextBlock.js.map +1 -1
- package/dist/TextBlockContent.d.ts +10 -0
- package/dist/TextBlockContent.js +2 -0
- package/dist/TextBlockContent.js.map +1 -0
- package/dist/Tile.d.ts +2 -2
- package/dist/Tile.js.map +1 -1
- package/dist/TileContent.d.ts +2 -0
- package/dist/TileContent.js +2 -0
- package/dist/TileContent.js.map +1 -0
- package/dist/content-page-repository/transformContentPage.js.map +1 -1
- package/dist/content-page-repository/transformPicture.d.ts +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/mergeTopItems.d.ts +2 -2
- package/dist/mergeTopItems.js.map +1 -1
- package/dist/model/BlockVersion.d.ts +1 -0
- package/dist/model/BlockVersion.js +2 -0
- package/dist/model/BlockVersion.js.map +1 -0
- package/dist/model/ButtonVersion.d.ts +1 -0
- package/dist/model/ButtonVersion.js +2 -0
- package/dist/model/ButtonVersion.js.map +1 -0
- package/dist/model/LinkContent.d.ts +5 -0
- package/dist/model/LinkContent.js +2 -0
- package/dist/model/LinkContent.js.map +1 -0
- package/dist/model/Picture.d.ts +17 -0
- package/dist/model/Picture.js +2 -0
- package/dist/model/Picture.js.map +1 -0
- package/dist/model/SitemapContent.d.ts +7 -0
- package/dist/model/SitemapContent.js +2 -0
- package/dist/model/SitemapContent.js.map +1 -0
- package/dist/types.d.ts +2 -32
- package/dist/ui-kit/Breadcrumb.d.ts +1 -1
- package/dist/ui-kit/Button.d.ts +1 -8
- package/dist/ui-kit/Button.js.map +1 -1
- package/dist/ui-kit/ButtonProps.d.ts +9 -0
- package/dist/ui-kit/ButtonProps.js +2 -0
- package/dist/ui-kit/ButtonProps.js.map +1 -0
- package/dist/ui-kit/Icon.d.ts +1 -10
- package/dist/ui-kit/Icon.js.map +1 -1
- package/dist/ui-kit/IconButton.d.ts +1 -6
- package/dist/ui-kit/IconButton.js.map +1 -1
- package/dist/ui-kit/IconButtonProps.d.ts +6 -0
- package/dist/ui-kit/IconButtonProps.js +2 -0
- package/dist/ui-kit/IconButtonProps.js.map +1 -0
- package/dist/ui-kit/IconProps.d.ts +10 -0
- package/dist/ui-kit/IconProps.js +2 -0
- package/dist/ui-kit/IconProps.js.map +1 -0
- package/dist/ui-kit/Title.d.ts +1 -10
- package/dist/ui-kit/Title.js +3 -9
- package/dist/ui-kit/Title.js.map +1 -1
- package/dist/ui-kit/TitleProps.d.ts +10 -0
- package/dist/ui-kit/TitleProps.js +10 -0
- package/dist/ui-kit/TitleProps.js.map +1 -0
- package/dist/ui-kit/TopItem.d.ts +1 -1
- package/dist/useLink.d.ts +5 -2
- package/dist/useLink.js.map +1 -1
- package/dist/useSitemap.d.ts +1 -1
- package/lib/BaseTile.d.ts +2 -12
- package/lib/BaseTile.js.map +1 -1
- package/lib/BaseTileContent.d.ts +13 -0
- package/lib/BaseTileContent.js +2 -0
- package/lib/BaseTileContent.js.map +1 -0
- package/lib/BenefitsBlock.d.ts +1 -10
- package/lib/BenefitsBlock.js.map +1 -1
- package/lib/BenefitsBlockContent.d.ts +10 -0
- package/lib/BenefitsBlockContent.js +2 -0
- package/lib/BenefitsBlockContent.js.map +1 -0
- package/lib/BlockContent.d.ts +15 -0
- package/lib/BlockContent.js +2 -0
- package/lib/BlockContent.js.map +1 -0
- package/lib/Blocks.d.ts +0 -15
- package/lib/Blocks.js +5 -5
- package/lib/Blocks.js.map +1 -1
- package/lib/ContentPage.d.ts +1 -1
- package/lib/ExchangeRateTile.d.ts +1 -3
- package/lib/ExchangeRateTile.js.map +1 -1
- package/lib/ExchangeRateTileContent.d.ts +3 -0
- package/lib/ExchangeRateTileContent.js +2 -0
- package/lib/ExchangeRateTileContent.js.map +1 -0
- package/lib/Footer/Contacts.d.ts +2 -1
- package/lib/Footer/Contacts.js.map +1 -1
- package/lib/Footer/Footer.d.ts +2 -8
- package/lib/Footer/Footer.js +1 -1
- package/lib/Footer/Footer.js.map +1 -1
- package/lib/Footer/Footer.mobile.d.ts +1 -1
- package/lib/Footer/FooterContent.d.ts +13 -0
- package/lib/Footer/FooterContent.js +2 -0
- package/lib/Footer/FooterContent.js.map +1 -0
- package/lib/Footer/FooterLink.d.ts +1 -1
- package/lib/Footer/Sitemap.d.ts +2 -1
- package/lib/Footer/Sitemap.js.map +1 -1
- package/lib/Footer/SocialMedia.d.ts +2 -1
- package/lib/Footer/SocialMedia.js.map +1 -1
- package/lib/Gallery.d.ts +2 -13
- package/lib/Gallery.js.map +1 -1
- package/lib/Gallery.mobile.d.ts +1 -1
- package/lib/Gallery.mobile.js.map +1 -1
- package/lib/GalleryContent.d.ts +13 -0
- package/lib/GalleryContent.js +2 -0
- package/lib/GalleryContent.js.map +1 -0
- package/lib/Header/HeaderContent.d.ts +2 -3
- package/lib/Header/isSubItemActive.d.ts +1 -1
- package/lib/Header/isTopItemActive.d.ts +1 -1
- package/lib/Img.d.ts +1 -1
- package/lib/MobileAppTile.d.ts +1 -9
- package/lib/MobileAppTile.js.map +1 -1
- package/lib/MobileAppTileContent.d.ts +9 -0
- package/lib/MobileAppTileContent.js +2 -0
- package/lib/MobileAppTileContent.js.map +1 -0
- package/lib/MobileBlocks.js +1 -1
- package/lib/MobileBlocks.js.map +1 -1
- package/lib/Placeholder.d.ts +1 -3
- package/lib/Placeholder.js.map +1 -1
- package/lib/PlaceholderContent.d.ts +3 -0
- package/lib/PlaceholderContent.js +2 -0
- package/lib/PlaceholderContent.js.map +1 -0
- package/lib/ProductBlock.d.ts +2 -4
- package/lib/ProductBlock.js.map +1 -1
- package/lib/ProductBlock.mobile.d.ts +1 -1
- package/lib/ProductBlock.mobile.js.map +1 -1
- package/lib/ProductBlockContent.d.ts +5 -0
- package/lib/ProductBlockContent.js +2 -0
- package/lib/ProductBlockContent.js.map +1 -0
- package/lib/ProductBlockInner.d.ts +1 -5
- package/lib/ProductBlockInner.js.map +1 -1
- package/lib/ProductBlockInnerContent.d.ts +5 -0
- package/lib/ProductBlockInnerContent.js +2 -0
- package/lib/ProductBlockInnerContent.js.map +1 -0
- package/lib/ProductGallery.d.ts +1 -14
- package/lib/ProductGallery.js.map +1 -1
- package/lib/ProductGalleryContent.d.ts +14 -0
- package/lib/ProductGalleryContent.js +2 -0
- package/lib/ProductGalleryContent.js.map +1 -0
- package/lib/ProductTile.d.ts +1 -5
- package/lib/ProductTile.js.map +1 -1
- package/lib/ProductTileContent.d.ts +5 -0
- package/lib/ProductTileContent.js +2 -0
- package/lib/ProductTileContent.js.map +1 -0
- package/lib/PromoTile.d.ts +1 -4
- package/lib/PromoTile.js.map +1 -1
- package/lib/PromoTileContent.d.ts +4 -0
- package/lib/PromoTileContent.js +2 -0
- package/lib/PromoTileContent.js.map +1 -0
- package/lib/StepsBlock.d.ts +1 -10
- package/lib/StepsBlock.js.map +1 -1
- package/lib/StepsBlockContent.d.ts +10 -0
- package/lib/StepsBlockContent.js +2 -0
- package/lib/StepsBlockContent.js.map +1 -0
- package/lib/TextBlock.d.ts +2 -11
- package/lib/TextBlock.js.map +1 -1
- package/lib/TextBlockContent.d.ts +10 -0
- package/lib/TextBlockContent.js +2 -0
- package/lib/TextBlockContent.js.map +1 -0
- package/lib/Tile.d.ts +2 -2
- package/lib/Tile.js.map +1 -1
- package/lib/TileContent.d.ts +2 -0
- package/lib/TileContent.js +2 -0
- package/lib/TileContent.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/content-page-repository/transformContentPage.js.map +1 -1
- package/lib/content-page-repository/transformPicture.d.ts +1 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/mergeTopItems.d.ts +2 -2
- package/lib/mergeTopItems.js.map +1 -1
- package/lib/model/BlockVersion.d.ts +1 -0
- package/lib/model/BlockVersion.js +2 -0
- package/lib/model/BlockVersion.js.map +1 -0
- package/lib/model/ButtonVersion.d.ts +1 -0
- package/lib/model/ButtonVersion.js +2 -0
- package/lib/model/ButtonVersion.js.map +1 -0
- package/lib/model/LinkContent.d.ts +5 -0
- package/lib/model/LinkContent.js +2 -0
- package/lib/model/LinkContent.js.map +1 -0
- package/lib/model/Picture.d.ts +17 -0
- package/lib/model/Picture.js +2 -0
- package/lib/model/Picture.js.map +1 -0
- package/lib/model/SitemapContent.d.ts +7 -0
- package/lib/model/SitemapContent.js +2 -0
- package/lib/model/SitemapContent.js.map +1 -0
- package/lib/types.d.ts +2 -32
- package/lib/ui-kit/Breadcrumb.d.ts +1 -1
- package/lib/ui-kit/Button.d.ts +1 -8
- package/lib/ui-kit/Button.js.map +1 -1
- package/lib/ui-kit/ButtonProps.d.ts +9 -0
- package/lib/ui-kit/ButtonProps.js +2 -0
- package/lib/ui-kit/ButtonProps.js.map +1 -0
- package/lib/ui-kit/Icon.d.ts +1 -10
- package/lib/ui-kit/Icon.js.map +1 -1
- package/lib/ui-kit/IconButton.d.ts +1 -6
- package/lib/ui-kit/IconButton.js.map +1 -1
- package/lib/ui-kit/IconButtonProps.d.ts +6 -0
- package/lib/ui-kit/IconButtonProps.js +2 -0
- package/lib/ui-kit/IconButtonProps.js.map +1 -0
- package/lib/ui-kit/IconProps.d.ts +10 -0
- package/lib/ui-kit/IconProps.js +2 -0
- package/lib/ui-kit/IconProps.js.map +1 -0
- package/lib/ui-kit/Title.d.ts +1 -10
- package/lib/ui-kit/Title.js +1 -7
- package/lib/ui-kit/Title.js.map +1 -1
- package/lib/ui-kit/TitleProps.d.ts +10 -0
- package/lib/ui-kit/TitleProps.js +8 -0
- package/lib/ui-kit/TitleProps.js.map +1 -0
- package/lib/ui-kit/TopItem.d.ts +1 -1
- package/lib/useLink.d.ts +5 -2
- package/lib/useLink.js.map +1 -1
- package/lib/useSitemap.d.ts +1 -1
- package/package.json +6 -2
- package/src/BaseTile.tsx +5 -13
- package/src/BaseTileContent.ts +14 -0
- package/src/BenefitsBlock.tsx +2 -12
- package/src/BenefitsBlockContent.ts +12 -0
- package/src/BlockContent.ts +30 -0
- package/src/Blocks.ts +12 -30
- package/src/ContentPage.tsx +1 -1
- package/src/ExchangeRateTile.tsx +2 -5
- package/src/ExchangeRateTileContent.ts +3 -0
- package/src/Footer/Contacts.tsx +2 -1
- package/src/Footer/Footer.mobile.tsx +1 -1
- package/src/Footer/Footer.tsx +3 -10
- package/src/Footer/FooterContent.ts +15 -0
- package/src/Footer/FooterLink.ts +1 -1
- package/src/Footer/HorizontalNavigation.tsx +2 -2
- package/src/Footer/Sitemap.tsx +3 -2
- package/src/Footer/SocialMedia.tsx +4 -2
- package/src/Footer/TextInformation.tsx +1 -1
- package/src/Gallery.fixture.tsx +1 -1
- package/src/Gallery.mobile.tsx +2 -1
- package/src/Gallery.tsx +2 -15
- package/src/GalleryContent.ts +15 -0
- package/src/Header/HeaderContent.ts +2 -3
- package/src/Header/isSubItemActive.ts +1 -1
- package/src/Header/isTopItemActive.ts +1 -1
- package/src/Img.tsx +1 -1
- package/src/MobileAppTile.tsx +1 -11
- package/src/MobileAppTileContent.ts +11 -0
- package/src/MobileBlocks.ts +1 -1
- package/src/Placeholder.tsx +1 -4
- package/src/PlaceholderContent.ts +3 -0
- package/src/ProductBlock.fixture.tsx +1 -1
- package/src/ProductBlock.mobile.tsx +1 -1
- package/src/ProductBlock.tsx +3 -5
- package/src/ProductBlockContent.ts +6 -0
- package/src/ProductBlockInner.tsx +2 -6
- package/src/ProductBlockInnerContent.ts +6 -0
- package/src/ProductGallery.fixture.tsx +1 -1
- package/src/ProductGallery.tsx +2 -16
- package/src/ProductGalleryContent.ts +16 -0
- package/src/ProductTile.fixture.tsx +1 -1
- package/src/ProductTile.tsx +3 -7
- package/src/ProductTileContent.ts +6 -0
- package/src/PromoTile.tsx +1 -5
- package/src/PromoTileContent.ts +5 -0
- package/src/StepsBlock.tsx +2 -12
- package/src/StepsBlockContent.ts +12 -0
- package/src/TextBlock.fixture.tsx +1 -1
- package/src/TextBlock.tsx +3 -12
- package/src/TextBlockContent.ts +12 -0
- package/src/Tile.fixture.tsx +1 -1
- package/src/Tile.tsx +4 -3
- package/src/TileContent.ts +3 -0
- package/src/content-page-repository/transformContentPage.ts +2 -1
- package/src/content-page-repository/transformPicture.ts +1 -1
- package/src/index.ts +6 -11
- package/src/mergeTopItems.ts +5 -5
- package/src/model/BlockVersion.ts +1 -0
- package/src/model/ButtonVersion.ts +1 -0
- package/src/model/LinkContent.ts +5 -0
- package/src/model/Picture.ts +19 -0
- package/src/model/SitemapContent.ts +9 -0
- package/src/types.ts +2 -56
- package/src/ui-kit/Breadcrumb.tsx +1 -1
- package/src/ui-kit/Button.tsx +2 -9
- package/src/ui-kit/ButtonProps.ts +10 -0
- package/src/ui-kit/Icon.tsx +1 -32
- package/src/ui-kit/IconButton.tsx +2 -7
- package/src/ui-kit/IconButtonProps.ts +7 -0
- package/src/ui-kit/IconProps.ts +31 -0
- package/src/ui-kit/Title.tsx +1 -13
- package/src/ui-kit/TitleProps.ts +12 -0
- package/src/ui-kit/TopItem.tsx +1 -1
- package/src/useLink.ts +2 -2
- package/src/useSitemap.ts +1 -1
- package/dist/Footer/index.d.ts +0 -2
- package/dist/Footer/index.js +0 -5
- package/dist/Footer/index.js.map +0 -1
- package/dist/Header/index.d.ts +0 -3
- package/dist/Header/index.js +0 -5
- package/dist/Header/index.js.map +0 -1
- package/lib/Footer/index.d.ts +0 -2
- package/lib/Footer/index.js +0 -2
- package/lib/Footer/index.js.map +0 -1
- package/lib/Header/index.d.ts +0 -3
- package/lib/Header/index.js +0 -2
- package/lib/Header/index.js.map +0 -1
- package/src/Footer/index.ts +0 -2
- package/src/Header/index.ts +0 -3
|
@@ -0,0 +1,878 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.UniBlocks = {}));
|
|
5
|
+
})(this, (function (exports) { 'use strict';
|
|
6
|
+
|
|
7
|
+
const setup = (_jsx, _jsxs) => {
|
|
8
|
+
setup._jsx = _jsx;
|
|
9
|
+
setup._jsxs = _jsxs || _jsx;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
setup.vue = _ => {
|
|
13
|
+
const adapter = (type, { children, dangerouslySetInnerHTML, ...rest } = {}) => {
|
|
14
|
+
const props = Object.assign({}, rest, dangerouslySetInnerHTML ? { innerHTML: dangerouslySetInnerHTML.__html } : {});
|
|
15
|
+
const isComponent = typeof type !== 'string';
|
|
16
|
+
const lazyChildren = isComponent ? () => children : children; // Vue optimization
|
|
17
|
+
return _(type, props, lazyChildren);
|
|
18
|
+
};
|
|
19
|
+
setup(adapter);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const jsx = (...args) => setup._jsx(...args);
|
|
23
|
+
const jsxs = (...args) => setup._jsxs(...args);
|
|
24
|
+
|
|
25
|
+
const JSX = Component => {
|
|
26
|
+
if (Component._tmpl) return Component._tmpl;
|
|
27
|
+
|
|
28
|
+
Component._tmpl = function JSXTmpl(rawProps, context) {
|
|
29
|
+
const { children: rawChildren, ...props } = rawProps || {};
|
|
30
|
+
|
|
31
|
+
const defaultSlot = context?.slots?.default; // Vue
|
|
32
|
+
const children = rawChildren || (defaultSlot && defaultSlot());
|
|
33
|
+
return Component(Object.assign(props, children && { children }), context);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
Component._tmpl.inheritAttrs = false; // Vue
|
|
37
|
+
|
|
38
|
+
return Component._tmpl;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const projectSettings = new (class {
|
|
42
|
+
_ = {
|
|
43
|
+
PROD_BRANCH: 'master',
|
|
44
|
+
FORCED_DRAFT_FLOW: false,
|
|
45
|
+
};
|
|
46
|
+
setup(_) {
|
|
47
|
+
this._ = _;
|
|
48
|
+
}
|
|
49
|
+
get TEST_BRANCH() {
|
|
50
|
+
return this._.TEST_BRANCH;
|
|
51
|
+
}
|
|
52
|
+
get RC_BRANCH() {
|
|
53
|
+
return this._.RC_BRANCH;
|
|
54
|
+
}
|
|
55
|
+
get PROD_BRANCH() {
|
|
56
|
+
return this._.PROD_BRANCH;
|
|
57
|
+
}
|
|
58
|
+
get FORCED_DRAFT_FLOW() {
|
|
59
|
+
return this._.FORCED_DRAFT_FLOW;
|
|
60
|
+
}
|
|
61
|
+
get ENABLE_ASSIST() {
|
|
62
|
+
return this._.ENABLE_ASSIST;
|
|
63
|
+
}
|
|
64
|
+
get SITEMAP() {
|
|
65
|
+
return this._.SITEMAP;
|
|
66
|
+
}
|
|
67
|
+
get CDN() {
|
|
68
|
+
return this._.CDN;
|
|
69
|
+
}
|
|
70
|
+
})();
|
|
71
|
+
|
|
72
|
+
const AUTH_PREFIX = 'guest';
|
|
73
|
+
const STORAGE_KEY = 'likesToken';
|
|
74
|
+
function LikeAPI(projectId, baseURL = '') {
|
|
75
|
+
async function getLikeCount(...nodeIds) {
|
|
76
|
+
if (!nodeIds.length) {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
const { token: Authorization } = await auth();
|
|
80
|
+
try {
|
|
81
|
+
const response = await fetch(`${baseURL}/assist/v1/public/projects/${projectId}/nodes/likes`, {
|
|
82
|
+
method: 'POST',
|
|
83
|
+
mode: 'cors',
|
|
84
|
+
headers: { 'Content-Type': 'application/json', Authorization },
|
|
85
|
+
body: JSON.stringify({
|
|
86
|
+
node_ids: nodeIds,
|
|
87
|
+
}),
|
|
88
|
+
});
|
|
89
|
+
const { likes } = await response.json();
|
|
90
|
+
return likes || [];
|
|
91
|
+
}
|
|
92
|
+
catch (e) {
|
|
93
|
+
console.error(e);
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async function like(nodeId) {
|
|
98
|
+
if (!nodeId) {
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
const { token: Authorization, name } = await auth();
|
|
102
|
+
try {
|
|
103
|
+
const response = await fetch(`${baseURL}/assist/v1/public/projects/${projectId}/nodes/like`, {
|
|
104
|
+
method: 'POST',
|
|
105
|
+
mode: 'cors',
|
|
106
|
+
headers: {
|
|
107
|
+
'Content-Type': 'application/json',
|
|
108
|
+
Authorization,
|
|
109
|
+
UserID: name,
|
|
110
|
+
},
|
|
111
|
+
body: JSON.stringify({
|
|
112
|
+
node_id: nodeId,
|
|
113
|
+
user_name: name,
|
|
114
|
+
}),
|
|
115
|
+
});
|
|
116
|
+
const { likes } = await response.json();
|
|
117
|
+
return likes || 0;
|
|
118
|
+
}
|
|
119
|
+
catch (e) {
|
|
120
|
+
console.error(e);
|
|
121
|
+
return 0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
async function dislike(nodeId) {
|
|
125
|
+
if (!nodeId) {
|
|
126
|
+
return 0;
|
|
127
|
+
}
|
|
128
|
+
const { token: Authorization, name } = await auth();
|
|
129
|
+
try {
|
|
130
|
+
const response = await fetch(`${baseURL}/assist/v1/public/projects/${projectId}/nodes/unlike`, {
|
|
131
|
+
method: 'POST',
|
|
132
|
+
mode: 'cors',
|
|
133
|
+
headers: {
|
|
134
|
+
'Content-Type': 'application/json',
|
|
135
|
+
Authorization,
|
|
136
|
+
UserID: name,
|
|
137
|
+
},
|
|
138
|
+
body: JSON.stringify({
|
|
139
|
+
node_id: nodeId,
|
|
140
|
+
user_name: name,
|
|
141
|
+
}),
|
|
142
|
+
});
|
|
143
|
+
const { likes } = await response.json();
|
|
144
|
+
return likes || 0;
|
|
145
|
+
}
|
|
146
|
+
catch (e) {
|
|
147
|
+
console.error(e);
|
|
148
|
+
return 0;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
async function auth() {
|
|
152
|
+
try {
|
|
153
|
+
const userData = JSON.parse(globalThis.localStorage.getItem(STORAGE_KEY) || '');
|
|
154
|
+
if (userData?.token) {
|
|
155
|
+
return userData;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
catch (e) {
|
|
159
|
+
// do nothing
|
|
160
|
+
}
|
|
161
|
+
try {
|
|
162
|
+
const response = await fetch(`${baseURL}/assist/v1/public/auth`, {
|
|
163
|
+
method: 'POST',
|
|
164
|
+
mode: 'cors',
|
|
165
|
+
headers: {
|
|
166
|
+
'Content-Type': 'application/json',
|
|
167
|
+
},
|
|
168
|
+
body: JSON.stringify({
|
|
169
|
+
prefix: AUTH_PREFIX,
|
|
170
|
+
}),
|
|
171
|
+
});
|
|
172
|
+
const { token, name } = await response.json();
|
|
173
|
+
globalThis.localStorage.setItem(STORAGE_KEY, JSON.stringify({ token, name }));
|
|
174
|
+
return { token, name };
|
|
175
|
+
}
|
|
176
|
+
catch (e) {
|
|
177
|
+
console.error(e);
|
|
178
|
+
return {};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return {
|
|
182
|
+
getLikeCount,
|
|
183
|
+
like,
|
|
184
|
+
dislike,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const getGeolocation = async () => new Promise((resolve) => navigator.geolocation.getCurrentPosition(({ coords }) => resolve(coords)));
|
|
189
|
+
|
|
190
|
+
function DaDataAPI(baseURL = '') {
|
|
191
|
+
async function getFetcherAddress() {
|
|
192
|
+
if (!('geolocation' in navigator)) {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
try {
|
|
196
|
+
const coords = await getGeolocation();
|
|
197
|
+
const response = await fetch(`${baseURL}/geolocate`, {
|
|
198
|
+
method: 'POST',
|
|
199
|
+
mode: 'cors',
|
|
200
|
+
body: JSON.stringify({
|
|
201
|
+
lat: coords.latitude,
|
|
202
|
+
lon: coords.longitude,
|
|
203
|
+
count: 1,
|
|
204
|
+
}),
|
|
205
|
+
});
|
|
206
|
+
const data = (await response.json());
|
|
207
|
+
return data?.suggestions?.[0]?.data?.city;
|
|
208
|
+
}
|
|
209
|
+
catch (e) {
|
|
210
|
+
console.error(e);
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return {
|
|
215
|
+
getFetcherAddress,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const ContentPageHead = JSX(({ HeadComponent, data, children }) => {
|
|
220
|
+
const { title, description, keywords, robots, og } = data;
|
|
221
|
+
return (jsxs(HeadComponent, { children: [jsx("title", { children: title }), jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), description && jsx("meta", { name: "description", content: description }), keywords && jsx("meta", { name: "keywords", content: keywords.join(',') }), robots && jsx("meta", { name: "robots", content: robots.join(',') }), og
|
|
222
|
+
? Object.entries(og).map(([key, value]) => (jsx("meta", { name: `og:${key}`, content: value }, key)))
|
|
223
|
+
: null, children] }));
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
const LikeButton = JSX(({ className, onClick, ariaLabel }) => (jsx("button", { type: "button", className: `border-0 w-[36px] bg-inherit cursor-pointer ${className || ''}`, onClick: onClick, "aria-label": ariaLabel, children: renderLikeIcon() })));
|
|
227
|
+
const renderLikeIcon = () => {
|
|
228
|
+
const params = {
|
|
229
|
+
stroke: '#292D32',
|
|
230
|
+
strokeLinecap: 'round',
|
|
231
|
+
strokeLinejoin: 'round',
|
|
232
|
+
strokeWidth: '1.5',
|
|
233
|
+
};
|
|
234
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [jsx("path", { ...params, strokeMiterlimit: "10", d: "M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77" }), jsx("path", { ...params, d: "M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z" })] }));
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
const LikeControl = JSX(({ className, context }) => {
|
|
238
|
+
const likeService = context.useLikeService();
|
|
239
|
+
return (jsxs("div", { className: `border-main border-2 border-solid bg-white flex w-[125px] items-center justify-center gap-3 p-2 font-sans ${className || ''}`, children: [jsx(LikeButton, { onClick: likeService.like, ariaLabel: "\u041F\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043E\u0442\u043C\u0435\u0442\u043A\u0443 \u00AB\u043B\u0430\u0439\u043A\u00BB" }), jsx(LikeButton, { onClick: likeService.dislike, className: "rotate-180", ariaLabel: "\u041F\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043E\u0442\u043C\u0435\u0442\u043A\u0443 \u00AB\u0434\u0438\u0437\u043B\u0430\u0439\u043A\u00BB" }), jsx("span", { className: "select-none", children: likeService.likeCount })] }));
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
const Img = JSX(({ className, image }) => (jsxs("picture", { className: `${className || ''}`, children: [image.sources?.length
|
|
243
|
+
? image.sources.map(({ src, format }, index) => (jsx("source", { srcSet: src, type: formatToMimeType(format) }, `${index}_${src}`)))
|
|
244
|
+
: null, jsx("img", { src: image.src, alt: image.alt || image.title, title: image.title, ...image?.size })] })));
|
|
245
|
+
function formatToMimeType(format) {
|
|
246
|
+
return format ? `image/${String(format)}` : undefined;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const listStyleMap = {
|
|
250
|
+
primary: 'bg-primary-main',
|
|
251
|
+
secondary: 'bg-white',
|
|
252
|
+
};
|
|
253
|
+
const textStyleMap = {
|
|
254
|
+
primary: 'text-primary-text',
|
|
255
|
+
secondary: 'text-white',
|
|
256
|
+
};
|
|
257
|
+
const BlockItem = JSX(({ className, text, children, version = 'primary' }) => {
|
|
258
|
+
return (jsxs("div", { className: `inline-block flex ${className || ''}`, role: "listitem", children: [jsx("div", { className: `inline-block w-[8px] h-[8px] min-w-[8px] min-h-[8px] rounded-full mt-2 ${listStyleMap[version]}` }), jsx("span", { className: `text-base font-normal font-sans mx-3 ${textStyleMap[version]}`, children: text || children })] }));
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
const buttonStyleMap = {
|
|
262
|
+
primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
|
|
263
|
+
secondary: 'text-primary-main bg-secondary-light hover:bg-secondary-hover active:bg-secondary-active',
|
|
264
|
+
};
|
|
265
|
+
const buttonDisabledStyleMap = {
|
|
266
|
+
primary: 'bg-secondary-dark text-secondary-text',
|
|
267
|
+
secondary: 'bg-secondary-light text-secondary-text',
|
|
268
|
+
};
|
|
269
|
+
const styleButton = 'inline-block rounded-md px-8 py-2 text-center font-sans';
|
|
270
|
+
const Button = JSX(({ className, text, href, target, onClick, children, disabled, version = 'primary', ariaLabel, }) => {
|
|
271
|
+
if (disabled) {
|
|
272
|
+
return (jsx("div", { role: "button", "aria-disabled": "true", "aria-label": ariaLabel, tabIndex: "-1", className: `${styleButton} select-none ${buttonDisabledStyleMap[version]} ${className || ''}`, children: children ? (jsx("div", { children: children })) : (jsx("div", { className: "text-sm font-medium py-1.5", children: text })) }));
|
|
273
|
+
}
|
|
274
|
+
return (jsx("a", { className: `${styleButton} no-underline ${buttonStyleMap[version]} ${className || ''}`, href: href, target: target, onClick: onClick, "aria-label": ariaLabel, children: children ? (jsx("div", { children: children })) : (jsx("div", { className: "text-sm font-medium py-1.5", children: text })) }));
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
const Icon = JSX(({ className, name, alt = `Icon ${name}`, title = alt, ...imgProps }) => (jsx("img", { className: className, src: `${projectSettings.CDN || ''}icons/${name}.svg`, alt: alt, title: title, ...imgProps })));
|
|
278
|
+
|
|
279
|
+
const IconButton = JSX((props) => {
|
|
280
|
+
return (jsx(Button, { ...props, children: props.icon ? (jsxs("div", { className: "flex items-center", children: [jsx("div", { className: "mr-2", children: jsx(Icon, { name: props.icon, width: "24", height: "24" }) }), jsxs("div", { children: [jsx("div", { className: "text-xxs text-left", children: props.aboveText }), jsx("div", { className: "text-sm font-medium text-left", children: props.text })] })] })) : null }));
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
var SizeTableClass;
|
|
284
|
+
(function (SizeTableClass) {
|
|
285
|
+
SizeTableClass["XL"] = "text-title-lg";
|
|
286
|
+
SizeTableClass["L"] = "text-title";
|
|
287
|
+
SizeTableClass["M"] = "text-title-sm";
|
|
288
|
+
SizeTableClass["S"] = "text-title-xs";
|
|
289
|
+
})(SizeTableClass || (SizeTableClass = {}));
|
|
290
|
+
|
|
291
|
+
const Title = JSX(({ size = 'L', className, children, ...rest }) => {
|
|
292
|
+
const Tag = size === 'XL' ? 'h1' : 'h2';
|
|
293
|
+
return (jsx(Tag, { className: getClasses(SizeTableClass[size], className), ...rest, children: children }));
|
|
294
|
+
});
|
|
295
|
+
const getClasses = (...classes) => classes.filter(Boolean).join(' ');
|
|
296
|
+
|
|
297
|
+
const MOBILE_URL_PATH = '/mobile';
|
|
298
|
+
const isURL = (href) => href?.includes('//');
|
|
299
|
+
const isHrefActive = (href, router, cmp = (href, baseHref) => href === baseHref) => {
|
|
300
|
+
return cmp(withoutQuery(href), withoutMobilePath(withoutQuery(isURL(href) ? router.href : router.pathname)));
|
|
301
|
+
};
|
|
302
|
+
const withoutQuery = (href) => (href || '').replace(/\/?\?.*/, '');
|
|
303
|
+
const withoutMobilePath = (href) => (href || '').replace(MOBILE_URL_PATH, '');
|
|
304
|
+
const getOrigin = (href) => {
|
|
305
|
+
if (!isURL(href)) {
|
|
306
|
+
return undefined;
|
|
307
|
+
}
|
|
308
|
+
const url = href;
|
|
309
|
+
const protoSeparator = '//';
|
|
310
|
+
const endOfProto = url.indexOf(protoSeparator);
|
|
311
|
+
const endOfOrigin = url.indexOf('/', endOfProto + protoSeparator.length);
|
|
312
|
+
return endOfOrigin !== -1 ? url.substring(0, endOfOrigin) : url;
|
|
313
|
+
};
|
|
314
|
+
const adjustHref = (href, router) => {
|
|
315
|
+
if (!href) {
|
|
316
|
+
return href;
|
|
317
|
+
}
|
|
318
|
+
const relativeHref = toRelativeHref(href, router);
|
|
319
|
+
const isMobilePage = router?.pathname.startsWith(MOBILE_URL_PATH);
|
|
320
|
+
return isMobilePage && !isURL(relativeHref) ? `${MOBILE_URL_PATH}${relativeHref}` : relativeHref;
|
|
321
|
+
};
|
|
322
|
+
const toRelativeHref = (href, router) => {
|
|
323
|
+
if (!href) {
|
|
324
|
+
return href;
|
|
325
|
+
}
|
|
326
|
+
const origin = getOrigin(router?.href);
|
|
327
|
+
return origin ? href.replace(origin, '') || '/' : href;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
var url = /*#__PURE__*/Object.freeze({
|
|
331
|
+
__proto__: null,
|
|
332
|
+
MOBILE_URL_PATH: MOBILE_URL_PATH,
|
|
333
|
+
isURL: isURL,
|
|
334
|
+
isHrefActive: isHrefActive,
|
|
335
|
+
withoutQuery: withoutQuery,
|
|
336
|
+
withoutMobilePath: withoutMobilePath,
|
|
337
|
+
getOrigin: getOrigin,
|
|
338
|
+
adjustHref: adjustHref,
|
|
339
|
+
toRelativeHref: toRelativeHref
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
const defaultHandlerDecorator = (handler, targetContent) => handler;
|
|
343
|
+
function useLink({ router, handlerDecorator = defaultHandlerDecorator, }, link) {
|
|
344
|
+
const href = adjustHref(link.href, router);
|
|
345
|
+
return {
|
|
346
|
+
...link,
|
|
347
|
+
href,
|
|
348
|
+
ariaLabel: link.text,
|
|
349
|
+
onClick: handlerDecorator((ev) => {
|
|
350
|
+
const isLocalHref = href && !isURL(href);
|
|
351
|
+
const isLocalTarget = !link.target || link.target === '_self';
|
|
352
|
+
if (isLocalHref && isLocalTarget) {
|
|
353
|
+
ev.preventDefault();
|
|
354
|
+
router.push(href);
|
|
355
|
+
}
|
|
356
|
+
}, link),
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const getColSpan = (className) => {
|
|
361
|
+
const colSpanPrefix = 'col-span-';
|
|
362
|
+
const colSpanStr = className.split(/\s+/).find((_) => _.startsWith(colSpanPrefix));
|
|
363
|
+
return colSpanStr ? parseInt(colSpanStr.substring(colSpanPrefix.length), 10) : 12;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
const TITLE_CLASSES = 'font-medium m-0 mb-4 whitespace-pre-wrap max-w-[600px]';
|
|
367
|
+
const BaseTile = JSX(({ className, context, title, titleSize, description, children, buttons, image, items, version = 'primary', }) => {
|
|
368
|
+
const router = context.useRouter();
|
|
369
|
+
const { handlerDecorator } = context;
|
|
370
|
+
return (jsxs("div", { className: `font-sans flex flex-col grow h-full`, children: [title && (jsx(Title, { size: titleSize || getTitleSizeByClassName(className), className: TITLE_CLASSES, children: title })), jsxs("div", { className: "flex grow justify-between", children: [jsxs("div", { className: "flex flex-col justify-between items-start", children: [jsxs("div", { children: [description ? (jsx("div", { className: "font-normal text-base max-w-[600px] mb-5", children: description })) : null, children, items?.length ? renderItems$2(items, version) : null] }), buttons?.length ? (jsx("div", { className: "flex mt-9 gap-3", children: buttons.map((button, index) => renderButton(useLink({ router, handlerDecorator }, button), index)) })) : null] }), image?.src && jsx(Img, { className: "mt-auto ml-7", image: image })] })] }));
|
|
371
|
+
});
|
|
372
|
+
function getTitleSizeByClassName(className = '') {
|
|
373
|
+
const colSpan = getColSpan(className);
|
|
374
|
+
if (colSpan <= 4) {
|
|
375
|
+
return 'S';
|
|
376
|
+
}
|
|
377
|
+
else if (colSpan <= 8) {
|
|
378
|
+
return 'M';
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
return 'L';
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
function renderItems$2(items = [], version) {
|
|
385
|
+
return (jsx("section", { className: "max-w-[600px]", role: "list", children: items.map((_, i) => (jsx(BlockItem, { className: i ? 'mt-2.5' : '', text: _, version: version }, String(i)))) }));
|
|
386
|
+
}
|
|
387
|
+
function renderButton(button, i) {
|
|
388
|
+
return button?.text ? jsx(IconButton, { ...button }, String(i)) : null;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const tileStyleMap = {
|
|
392
|
+
primary: 'bg-white text-primary-text',
|
|
393
|
+
secondary: 'bg-primary-main text-white',
|
|
394
|
+
};
|
|
395
|
+
const Tile = JSX((props) => {
|
|
396
|
+
const { children, className, version = 'primary' } = props;
|
|
397
|
+
return (jsx("section", { className: `font-sans p-9 min-h-[320px] box-border ${className || ''} ${tileStyleMap[version]} ${getContainerPaddingRight(className)} `, children: jsx(BaseTile, { ...props, children: children }) }));
|
|
398
|
+
});
|
|
399
|
+
function getContainerPaddingRight(className = '') {
|
|
400
|
+
const colSpan = getColSpan(className);
|
|
401
|
+
if (colSpan <= 6) {
|
|
402
|
+
return 'pr-9';
|
|
403
|
+
}
|
|
404
|
+
else if (colSpan <= 8) {
|
|
405
|
+
return 'pr-[4.75rem]';
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
return 'pr-[9.4rem]';
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
const GOLDEN_RATIO = 1.618;
|
|
413
|
+
const Placeholder = JSX(({ className, context, title }) => {
|
|
414
|
+
return (jsx(Tile, { className: className, context: context, title: title, description: "\u0411\u043B\u043E\u043A \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043E\u0442\u043A\u0435...", children: jsx("figure", { className: "m-0 min-w-[600px]", children: renderShimmer() }) }));
|
|
415
|
+
});
|
|
416
|
+
const renderShimmer = (size = 3) => goldenSequence(100, size)
|
|
417
|
+
.map((_) => Math.floor(_))
|
|
418
|
+
.map(renderShimmerItem);
|
|
419
|
+
const renderShimmerItem = (width = 100, index) => (jsx("div", { style: { width: `${width}%` }, className: "h-4 mt-2 bg-secondary-light" }, String(index)));
|
|
420
|
+
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
421
|
+
|
|
422
|
+
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
423
|
+
const ContentPage = JSX(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
|
|
424
|
+
return (jsxs("section", { className: "relative", "data-theme": colorPalette, children: [jsx("div", { className: `grid grid-cols-12 gap-1 ${style2className(pageStyle)} ${className || ''}`, children: blocks?.length ? blocks.map(renderBlock) : null }), likeControl && (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", context: context }) }))] }));
|
|
425
|
+
function renderBlock(block, i) {
|
|
426
|
+
const { type } = block;
|
|
427
|
+
if (!(type in blocksRegistry)) {
|
|
428
|
+
console.warn(`No block with "${type}" is registered`);
|
|
429
|
+
}
|
|
430
|
+
const BlockComponent = blocksRegistry[type] || Placeholder;
|
|
431
|
+
return blockDecorator({
|
|
432
|
+
blockClassName: style2className(block.style),
|
|
433
|
+
block,
|
|
434
|
+
render: (props) => {
|
|
435
|
+
const { version, content, blocks } = props.block;
|
|
436
|
+
return (jsx(BlockComponent, { className: props.blockClassName, version: version, context: context, ...content, children: blocks?.length ? blocks.map(renderBlock) : null }, `${type}-${i}`));
|
|
437
|
+
},
|
|
438
|
+
}, `block-${i}`);
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
function style2className(style) {
|
|
442
|
+
return style ? style.join(' ') : '';
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function toMobilePage(contentPage) {
|
|
446
|
+
const blocks = contentPage.blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
|
|
447
|
+
return {
|
|
448
|
+
...contentPage,
|
|
449
|
+
blocks,
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
function toMobileBlock(block) {
|
|
453
|
+
const { mobile } = block;
|
|
454
|
+
if (mobile) {
|
|
455
|
+
return {
|
|
456
|
+
...block,
|
|
457
|
+
style: mobile.style?.length ? mobile.style : block.style,
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
return block;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
const BenefitsBlock = JSX(({ className, title, benefits }) => {
|
|
466
|
+
return (jsxs("section", { className: `font-sans text-primary-text bg-white p-12 pb-2 flex flex-col items-center ${className || ''}`, children: [jsx("h2", { className: "font-medium text-title m-0 max-w-[47rem] text-center", children: title }), benefits?.length ? (jsx("div", { className: "grid grid-cols-2 gap-5 mt-9", children: benefits.map(renderStep) })) : null] }));
|
|
467
|
+
});
|
|
468
|
+
const renderStep = (benefit, i) => {
|
|
469
|
+
return (jsxs("div", { className: "flex items-center p-10 gap-5 max-w-[580px]", children: [benefit.icon && (jsx(Icon, { className: "h-[70px] w-[70px] min-w-[70px] min-h-[70px]", name: benefit.icon, width: "70", height: "70" })), jsxs("div", { children: [jsx("h3", { className: "font-medium text-xl m-0", children: benefit.label }), benefit.description && (jsx("div", { className: "font-normal text-sm mt-2", children: benefit.description }))] })] }, String(i)));
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
const CBR_EXCHANGE_RATE_URL = 'https://www.cbr-xml-daily.ru/daily_json.js';
|
|
473
|
+
const CURRENCY_CODES = ['USD', 'EUR'];
|
|
474
|
+
const CURRENCY_ICONS_MAP = {
|
|
475
|
+
USD: 'DollarIcon',
|
|
476
|
+
EUR: 'EuroIcon',
|
|
477
|
+
};
|
|
478
|
+
const buttons = [
|
|
479
|
+
{
|
|
480
|
+
text: 'Все показатели',
|
|
481
|
+
href: 'https://cbr.ru/currency_base/daily/',
|
|
482
|
+
},
|
|
483
|
+
];
|
|
484
|
+
const ExchangeRateTile = JSX(({ className, context, title }) => {
|
|
485
|
+
const { data } = context.useAsyncData(CBR_EXCHANGE_RATE_URL, fetchExchangeRate);
|
|
486
|
+
return (jsx(Tile, { className: className, context: context, title: title || 'Курсы обмена валют', buttons: buttons, children: jsxs("table", { children: [jsx("thead", { children: jsxs("tr", { children: [jsx(CurrencyTH, { children: "\u0412\u0430\u043B\u044E\u0442\u0430" }), jsx(CurrencyTH, { className: "pl-11", children: "\u041A\u0443\u0440\u0441" })] }) }), jsx("tbody", { children: CURRENCY_CODES.map((code) => {
|
|
487
|
+
const value = (data?.Valute || {})[code]?.Value;
|
|
488
|
+
return (jsxs("tr", { children: [jsx(CurrencyTD, { className: "pt-4", children: jsxs("div", { className: "flex items-center", children: [jsx(Icon, { name: CURRENCY_ICONS_MAP[code], width: "24", height: "24" }), jsx("span", { className: "ml-2", children: code })] }) }), jsx(CurrencyTD, { className: "pt-4 pl-11", children: formatCurrency(value) })] }, code));
|
|
489
|
+
}) })] }) }));
|
|
490
|
+
});
|
|
491
|
+
const CurrencyTH = JSX(({ className = '', children }) => (jsx("th", { className: `text-left font-normal text-sm text-secondary-text ${className}`, children: children })));
|
|
492
|
+
const CurrencyTD = JSX(({ className = '', children }) => (jsx("td", { className: `text-left font-normal text-base text-primary-text ${className}`, children: children })));
|
|
493
|
+
async function fetchExchangeRate() {
|
|
494
|
+
const response = await fetch(CBR_EXCHANGE_RATE_URL);
|
|
495
|
+
return await response.json();
|
|
496
|
+
}
|
|
497
|
+
const currencyNumberFormat = new Intl.NumberFormat('ru', { style: 'currency', currency: 'RUB' });
|
|
498
|
+
const formatCurrency = (value) => (value ? currencyNumberFormat.format(value) : '');
|
|
499
|
+
|
|
500
|
+
const SVG = JSX(({ className, viewBox, fill = 'none', paths, ...commonOptions }) => {
|
|
501
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, children: paths.map(({ d, fill, ...options }, i) => (jsx("path", { d: d, fill: fill || 'currentColor', ...commonOptions, ...options }, i))) }));
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
const LOGO_PATHS = [
|
|
505
|
+
'm13.72 25.51 4.42-4.33v-2.95l-4.42 4.32v2.96Zm0-10.98 4.42-4.35V7.41l-4.42 4.31v2.8Zm0 3.63 4.42-4.33v-2.78l-4.42 4.32v2.8ZM12.46 7.44l-.6-.56V0h-.66v6.22l-.58-.57V0h-.67v5l-.59-.58V0H8.7v6.56l4.44 4.33V0h-.67v7.44Zm1.26 14.35 4.42-4.33v-2.78L13.72 19v2.8Zm-5.03-.61 4.44 4.33v-2.96l-4.44-4.32v2.95Zm8.79-16.76-.59.58V0h-.66v5.66l-.6.56V0h-.66v6.87l-.58.57V0h-.67v10.9l4.42-4.34V0h-.66v4.42Zm-8.79 5.76 4.44 4.35v-2.8L8.69 7.4v2.77Zm0 3.65 4.44 4.33v-2.8l-4.44-4.3v2.77Zm0 3.63 4.44 4.33V19l-4.44-4.31v2.78Zm26.37 2.29H24.3a2.25 2.25 0 0 0 .36-1.22 2.32 2.32 0 0 0-2.33-2.31 2.32 2.32 0 0 0-2.31 2.31c0 .5.16.96.43 1.34a.74.74 0 0 0-.33.61c0 .26.14.49.33.62a2.32 2.32 0 0 0-.43 1.34 2.31 2.31 0 0 0 2.31 2.31 2.32 2.32 0 0 0 2.33-2.31c0-.45-.13-.87-.36-1.22h8.01v.49h-.8v.68h.8v.7h-.8v1.3h.8v-.58h1.17v.58h.79v-1.3h-.79v-.7h.79v-.68h-.79v-.5h1.58a.56.56 0 0 0 .56-.56v-.34a.57.57 0 0 0-.56-.56Zm-11.53 2.7a1.2 1.2 0 0 1-2.4 0c0-.24.08-.47.2-.66l.34-.56a.97.97 0 0 1-.34-.75c0-.3.13-.56.33-.74l-.32-.56a1.13 1.13 0 0 1-.2-.66 1.2 1.2 0 0 1 2.4 0c0 .49-.56 1.65-.56 1.65v.62c-.01.01.55 1.17.55 1.66ZM4.67 18.34v2.89c0 2.75 1.2 4.53 1.9 5.21l4.58 4.5c1.28 1.25 1.5 1.66 1.79 2.37v-3.2c0-2.84-1.44-3.94-2.19-4.67-1.73-1.68-2.89-2.8-3.82-3.73a8.98 8.98 0 0 1-2.26-3.37Zm6.08 14.24c-1.73-1.7-2.89-2.8-3.82-3.73a10 10 0 0 1-2.25-2.98v2.49a7.87 7.87 0 0 0 1.89 5.24l4.58 4.47c1.28 1.25 1.5 1.85 1.79 2.55v-3.37c0-2.85-1.45-3.95-2.19-4.67Z',
|
|
506
|
+
'M19.88 5.34c-.32 0-.64 0-.96.02V6.7a18.5 18.5 0 1 1 .95 36.94A18.5 18.5 0 0 1 1.35 25.17c0-5.67 2.55-10.73 6.58-14.13V9.32A19.78 19.78 0 0 0 0 25.17C0 36.12 8.9 45 19.88 45a19.85 19.85 0 0 0 19.86-19.83c0-10.95-8.9-19.83-19.87-19.83Z',
|
|
507
|
+
'M33.93 35.53c.3-.41.6-.85.87-1.3v-2.66h-.87v3.96Zm2.54-4.92c.12-.4.24-.78.34-1.16h-2.88v.7h.43c.77-.02 1.63-.03 2.11.46Zm-19.19-1.27h-.78v7.91h.78v-7.9Z',
|
|
508
|
+
'M14.7 27.83h2.58c.67 0 1.14.14 1.4.4.27.25.4.72.4 1.38v7.4c0 .66-.12 1.12-.4 1.38-.4.41-1.16.41-1.78.41l-.4-.01v3.5l.78.14v-2.88c1.2 0 1.97-.4 2.34-1.22v4.29h.26l.5-.01V29.74c0-.68.13-1.16.4-1.43.25-.27.72-.4 1.37-.4.67 0 1.65-.1 2.16.4.26.27.38.76.38 1.43v3.8h-1.77v-4.06h-.77v12.99c.26-.03.5-.07.77-.12V34.3h1.77v7.64c.36-.1.72-.21 1.08-.34v-7c0-.8.19-1.4 1-1.67l-.9-4.87h1.8l.3 5.31h.22l.3-5.31h1.88l-1.01 4.87c.84.3 1.01.81 1.01 1.66v4.53a16.63 16.63 0 0 0 1.5-1.27v-9.83h5.25l.1-.72H24.93l.17.89c-.38-.72-1.12-1.08-2.2-1.08h-.77c-1.3 0-2.1.52-2.4 1.55-.27-1.08-1.1-1.62-2.46-1.62h-3.36v14.52c.26.09.52.18.78.25V27.84Zm16.29 5.58-.85-.8.85-4.37v5.17Z',
|
|
509
|
+
'M27.66 40.79c.27-.14.55-.28.8-.43v-5.98h-.8v6.4Z',
|
|
510
|
+
];
|
|
511
|
+
const Logo = JSX(({ className, href, children, targetBlank }) => {
|
|
512
|
+
return (jsxs("a", { className: `inline-flex items-center font-sans no-underline ${className || ''}`, href: href || 'https://rshb.ru/', target: targetBlank ? '_blank' : '_self', children: [jsx(SVG, { className: "text-primary-main w-10", viewBox: "0 0 40 45", paths: LOGO_PATHS.map((d) => ({ d })) }), jsx("span", { className: "text-black text-base font-medium ml-2.5", children: children || 'Россельхозбанк' })] }));
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
const SearchBar = JSX(({ className, context }) => {
|
|
516
|
+
const { term, setTerm } = context.useSearch();
|
|
517
|
+
return (jsxs("form", { className: `relative ${className || ''}`, children: [jsxs("div", { className: "absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none", children: [jsx("div", { className: "w-[24px] h-[24px]", children: jsx(Icon, { name: "LoupeIcon", width: "24", height: "24" }) }), !term && (jsx("span", { className: "font-sans font-normal text-base text-secondary-text", children: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u0430\u0439\u0442\u0443" }))] }), jsx("input", { className: "pl-12 w-full font-sans font-normal text-base text-black border border-solid border-main-divider rounded h-full box-border outline-none pr-[6%]", value: term, onChange: (e) => setTerm(e.target.value), type: "text", name: "s" }), term && (jsx("button", { type: "submit", className: "absolute font-sans font-normal text-sm cursor-pointer bg-transparent hover:bg-primary-hover active:bg-primary-active text-primary-main hover:text-white border-none px-5 py-2 rounded top-1 right-1 outline-none", onClick: (e) => {
|
|
518
|
+
e.preventDefault();
|
|
519
|
+
console.log('click');
|
|
520
|
+
}, children: "\u041D\u0430\u0439\u0442\u0438" }))] }));
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
const Contacts = JSX(({ className, items, hasButton, context }) => {
|
|
524
|
+
const router = context.useRouter();
|
|
525
|
+
const { handlerDecorator } = context;
|
|
526
|
+
return (jsxs("div", { className: `flex flex-col ${className || ''}`, children: [items?.length ? items.map(renderContact) : null, hasButton ? (jsx(Button, { className: "my-4", ...useLink({ router, handlerDecorator }, {
|
|
527
|
+
text: 'Обратная связь',
|
|
528
|
+
href: '/',
|
|
529
|
+
target: '_blank',
|
|
530
|
+
}) })) : null] }));
|
|
531
|
+
});
|
|
532
|
+
const renderContact = (item, index) => {
|
|
533
|
+
const { type, text, description } = item;
|
|
534
|
+
return (jsxs("div", { className: "mb-4", children: [jsx("div", { children: renderText(type, text) }), jsx("div", { className: "font-sans text-sm text-secondary-text", children: description })] }, String(index)));
|
|
535
|
+
};
|
|
536
|
+
const renderText = (type, text) => {
|
|
537
|
+
switch (type) {
|
|
538
|
+
case 'tel':
|
|
539
|
+
return (jsx("a", { className: "font-sans font-medium text-xl text-primary-text no-underline", href: `tel:${formatTel(text)}`, children: text }));
|
|
540
|
+
case 'email':
|
|
541
|
+
return (jsx("a", { className: "font-sans font-medium text-xl text-primary-text no-underline", href: `mailto:${text}`, children: text }));
|
|
542
|
+
default:
|
|
543
|
+
return jsx("span", { children: text });
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
const formatTel = (s) => s.replaceAll(/(\-|\s|\(|\)|\D+)/g, '');
|
|
547
|
+
|
|
548
|
+
const HorizontalNavigation = JSX(({ className, links, context }) => {
|
|
549
|
+
const router = context.useRouter();
|
|
550
|
+
const { handlerDecorator } = context;
|
|
551
|
+
return (jsx("div", { className: `${className || ''}`, children: links?.length ? (jsx("div", { className: "flex justify-between items-center gap-5 py-5 border-solid border-x-0 border-y border-y-main-divider", children: links.map((_, i) => (jsx(HorizontalNavigationLink, { index: i, ...useLink({ router, handlerDecorator }, _) }, String(i)))) })) : null }));
|
|
552
|
+
});
|
|
553
|
+
const HorizontalNavigationLink = JSX(({ className, index, text, href, target, onClick }) => (jsx("a", { className: `font-sans font-normal text-sm text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${className || ''}`, href: href, target: target, onClick: onClick, children: text || `Документ ${index}` })));
|
|
554
|
+
|
|
555
|
+
const cmp = (a) => (b) => a?.href === b?.href;
|
|
556
|
+
const substitute = (items, substitution) => (items || []).map((_) => substitution?.find(cmp(_)) || _);
|
|
557
|
+
const subtract = (minuend, subtrahend) => (minuend || []).filter((_) => !subtrahend?.find(cmp(_)));
|
|
558
|
+
function mergeTopItems(left, right) {
|
|
559
|
+
return substitute(left, right).concat(subtract(right, left));
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
function useSitemap(useAsyncData) {
|
|
563
|
+
const { data } = useAsyncData(sitemapURL(), fetchSitemap);
|
|
564
|
+
return data || {};
|
|
565
|
+
}
|
|
566
|
+
async function fetchSitemap() {
|
|
567
|
+
const response = await fetch(sitemapURL());
|
|
568
|
+
return await response.json();
|
|
569
|
+
}
|
|
570
|
+
function sitemapURL() {
|
|
571
|
+
return `/wcms-resources/${projectSettings.SITEMAP || 'sitemap'}.json`;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
const Sitemap = JSX(({ className, items, context }) => {
|
|
575
|
+
const sitemap = useSitemap(context.useAsyncData);
|
|
576
|
+
const mergedItems = mergeTopItems(sitemap.topItems, items);
|
|
577
|
+
const linkParams = {
|
|
578
|
+
router: context.useRouter(),
|
|
579
|
+
handlerDecorator: context.handlerDecorator,
|
|
580
|
+
};
|
|
581
|
+
return (jsx("div", { className: `flex items-start justify-start gap-11 xl:gap-5 ${className || ''}`, children: mergedItems?.map((_, i) => renderColumn(_, i, linkParams)) }));
|
|
582
|
+
});
|
|
583
|
+
const renderColumn = (c, index, { router, handlerDecorator }) => {
|
|
584
|
+
const { text, href, items, target } = c;
|
|
585
|
+
return (jsxs("div", { className: "flex flex-col w-[235px] gap-[14px]", children: [jsx("a", { className: "block font-sans font-medium text-base text-primary-text no-underline", href: href, target: target || '_self', children: text || `Раздел ${index}` }), items?.map((_, i) => (jsx(ColumnItem, { ...useLink({ router, handlerDecorator }, _) }, String(i))))] }, String(index)));
|
|
586
|
+
};
|
|
587
|
+
const ColumnItem = JSX(({ text, href, target, index }) => (jsx("a", { className: "block font-sans font-normal text-base text-secondary-text hover:text-primary-main no-underline", href: href, target: target || '_self', children: text || `Раздел ${index}` })));
|
|
588
|
+
|
|
589
|
+
const ICONS_MAP = [
|
|
590
|
+
{ origins: ['t.me', 'telegram.org'], icon: 'TelegramIcon', label: 'Телеграм' },
|
|
591
|
+
{ origins: ['vk.com'], icon: 'VKIcon', label: 'ВКонтакте' },
|
|
592
|
+
{ origins: ['ok.ru'], icon: 'OkIcon', label: 'Одноклассники' },
|
|
593
|
+
];
|
|
594
|
+
const SocialMedia = JSX(({ className, media, context }) => {
|
|
595
|
+
const router = context.useRouter();
|
|
596
|
+
const { handlerDecorator } = context;
|
|
597
|
+
return (jsx("div", { className: `flex items-end justify-end gap-2 pt-[30px] pb-7 ${className || ''}`, children: media?.map((_, index) => (jsx(MediaButton, { ...useLink({ router, handlerDecorator }, _) }, String(index)))) }));
|
|
598
|
+
});
|
|
599
|
+
const MediaButton = JSX(({ href }) => {
|
|
600
|
+
const { icon, label } = ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
|
|
601
|
+
return (jsx("a", { className: "flex items-center justify-center border-solid border border-main-divider rounded-full no-underline outline-none w-9 h-9", href: href, target: "_blank", rel: "noopener noreferrer", "aria-label": label, children: icon && jsx(Icon, { className: "block", name: icon }) /* TODO width & height */ }));
|
|
602
|
+
});
|
|
603
|
+
|
|
604
|
+
const TextInformation = JSX(({ className, links, context }) => {
|
|
605
|
+
const router = context.useRouter();
|
|
606
|
+
const { handlerDecorator } = context;
|
|
607
|
+
return (jsxs("div", { className: `${className || ''}`, children: [jsx("div", { className: "pt-5 pb-[5px]", children: jsx("span", { className: "font-sans font-normal text-xs text-secondary-text", children: `\u00a9\u00A02000-${new Date().getFullYear()}\u00A0АО \u00ABРоссельхозбанк\u00BB Генеральная лицензия Банка России \u2116\u00A03349 от\u00A012.08.2015\u00A0г.` }) }), links?.length ? (jsx("div", { className: "flex justify-start items-start gap-5 pt-[5px]", children: links.map((_, i) => (jsx(TextInformationLink, { index: i, ...useLink({ router, handlerDecorator }, _) }, String(i)))) })) : null] }));
|
|
608
|
+
});
|
|
609
|
+
const TextInformationLink = JSX(({ className, index, text, href, target, onClick }) => (jsx("a", { className: `font-sans font-normal text-xs text-secondary-text visited:text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${className || ''}`, href: href, target: target, onClick: onClick, children: text || `Документ ${index}` })));
|
|
610
|
+
|
|
611
|
+
const LEFT_COL_WIDTH_FULL_HD = 'w-[280px]';
|
|
612
|
+
const LEFT_COL_WIDTH_SMALL_DESKTOP = 'xl:w-[220px]';
|
|
613
|
+
const Footer$1 = JSX(({ className, documents, relatedEnterprises, contacts, socialMedia, topItems, context }) => {
|
|
614
|
+
return (jsxs("footer", { className: `${className} px-9 py-10 bg-white`, children: [jsxs("div", { className: "flex items-stretch gap-32 pb-8 xl:gap-8", children: [jsx(Logo, { className: `${LEFT_COL_WIDTH_FULL_HD} ${LEFT_COL_WIDTH_SMALL_DESKTOP}` }), jsx(SearchBar, { context: context, className: "grow" })] }), jsxs("div", { className: "flex items-stretch gap-32 xl:gap-8", children: [jsx(Contacts, { className: `${LEFT_COL_WIDTH_FULL_HD} shrink-0 overflow-hidden ${LEFT_COL_WIDTH_SMALL_DESKTOP}`, items: contacts, context: context, hasButton: true }), jsx(Sitemap, { className: "pt-[3px]", context: context, items: topItems })] }), jsx(SocialMedia, { media: socialMedia, context: context }), jsx(HorizontalNavigation, { links: relatedEnterprises, context: context }), jsx(TextInformation, { links: documents, context: context })] }));
|
|
615
|
+
});
|
|
616
|
+
|
|
617
|
+
const ArrowButton = JSX(({ className, onClick, ariaLabel }) => {
|
|
618
|
+
return (jsx("button", { className: `${className} border-none no-underline w-12 h-12 rounded-3xl bg-white flex text-black hover:text-primary-main`, style: { boxShadow: '0px 4px 25px rgba(0, 0, 0, 0.07)' }, onClick: onClick, "aria-label": ariaLabel, children: jsxs("svg", { className: "m-auto", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M7 12L3 8L7 4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }), jsx("path", { d: "M14 9C14.5523 9 15 8.55228 15 8C15 7.44772 14.5523 7 14 7L14 9ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55229 7.44772 9 8 9L8 7ZM14 7L8 7L8 9L14 9L14 7Z", fill: "currentColor" })] }) }));
|
|
619
|
+
});
|
|
620
|
+
|
|
621
|
+
const CARD_WIDTH = 384;
|
|
622
|
+
const GALLERY_LENGTH_FOR_SCROLL = 3;
|
|
623
|
+
const Gallery$1 = JSX(({ title, description, context, cards = [], className }) => {
|
|
624
|
+
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
625
|
+
function handleNextClick() {
|
|
626
|
+
setActiveCardIndex(activeCardIndex + 1);
|
|
627
|
+
}
|
|
628
|
+
function handlePrevClick() {
|
|
629
|
+
setActiveCardIndex(activeCardIndex - 1);
|
|
630
|
+
}
|
|
631
|
+
const isGalleryScrollAvailable = cards?.length > GALLERY_LENGTH_FOR_SCROLL;
|
|
632
|
+
const showNextButton = isGalleryScrollAvailable && cards?.length - activeCardIndex > GALLERY_LENGTH_FOR_SCROLL;
|
|
633
|
+
const showPrevButton = isGalleryScrollAvailable && activeCardIndex > 0;
|
|
634
|
+
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white p-12 overflow-hidden ${className}`, children: [jsxs("div", { className: "flex flex-col items-center mb-8", children: [jsx(Title, { className: "font-medium m-0 text-centers", children: title }), description ? (jsx("div", { className: "font-normal text-base max-w-[600px] mt-3", children: description })) : null] }), jsx("div", {
|
|
635
|
+
// Need to place all cards at the center if count of cards less than 4
|
|
636
|
+
className: `flex ${cards?.length <= GALLERY_LENGTH_FOR_SCROLL ? 'justify-center' : ''} duration-1000`,
|
|
637
|
+
// All cards has same width
|
|
638
|
+
style: { transform: `translateX(-${activeCardIndex * CARD_WIDTH}px)` }, role: "list", children: cards?.map(renderCard$1) }), showPrevButton && (jsx(ArrowButton, { className: "absolute top-1/2 left-8", onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E" })), showNextButton && (jsx(ArrowButton, { className: "absolute top-1/2 right-1 z-20 rotate-180", onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E" })), jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[84px]", style: {
|
|
639
|
+
background: 'linear-gradient(270deg, #FFFFFF 34.89%, rgba(255, 255, 255, 0) 92.52%)',
|
|
640
|
+
} })] }));
|
|
641
|
+
});
|
|
642
|
+
function renderCard$1(card, key) {
|
|
643
|
+
return (jsxs("div", { className: "box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between items-stretch min-w-[364px] w-[364px] w-full", role: "listitem", children: [jsxs("div", { children: [card.image?.src ? (jsx("div", { className: "flex justify-center", children: jsx(Img, { className: "mb-6", image: card.image }) })) : null, card.title ? (jsx("h4", { className: `font-medium text-xl m-0 ${!card.description && !card.items?.length ? 'text-center' : ''}`, children: card.title })) : null, card.description ? (jsx("div", { className: "font-normal text-sm text-secondary-text mt-2", children: card.description })) : null, card.items?.length ? renderItems$1(card.items) : null] }), card.href ? (jsx(Button, { className: "mt-6", text: "\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435", version: "secondary", href: card.href })) : null] }, key));
|
|
644
|
+
}
|
|
645
|
+
function renderItems$1(items = []) {
|
|
646
|
+
return (jsx("section", { className: "max-w-[308px] mt-2", role: "list", children: items.map((item, i) => (jsx(BlockItem, { children: jsx("span", { className: "text-sm text-secondary-text", children: item }) }, String(i)))) }));
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
const HeaderItem = JSX(({ className, text, href, target, active, onClick, children }) => {
|
|
650
|
+
const textStyle = active ? 'text-primary-main' : 'text-primary-text hover:text-primary-main';
|
|
651
|
+
return (jsxs("a", { className: `relative inline-block bg-transparent text-center no-underline ${className || ''}`, href: href, target: target, onClick: onClick, children: [jsx("span", { className: `font-sans font-normal text-base ${textStyle}`, children: text || children }), active ? (jsx("div", { className: "absolute left-0 -bottom-2 w-full h-[2px] bg-primary-main" })) : null] }));
|
|
652
|
+
});
|
|
653
|
+
|
|
654
|
+
const TopItem = JSX(({ className, text, href, target, active, flat, onClick, children, ariaLabel }) => {
|
|
655
|
+
const linkStyle = active ? 'border-primary-main rounded-md' : 'border-transparent';
|
|
656
|
+
const textStyle = active
|
|
657
|
+
? 'text-primary-main'
|
|
658
|
+
: `${flat ? 'text-primary-text' : 'text-secondary-text'} hover:text-primary-main`;
|
|
659
|
+
return (jsx("a", { className: `inline-block border border-solid bg-transparent text-center no-underline ${flat ? '' : 'px-4 py-2'} ${linkStyle} ${className || ''}`, href: href, target: target, onClick: onClick, rel: "noopener noreferrer", "aria-label": ariaLabel, children: jsx("span", { className: `font-sans font-normal text-sm ${textStyle}`, children: text || children }) }));
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
const HeaderSecondaryMenuButton = JSX(({ className, children, ariaLabel }) => (jsx("button", { type: "button", className: `border-0 p-0 w-[24px] flex items-center bg-inherit cursor-pointer ${className || ''}`, disabled: true, "aria-label": ariaLabel, children: children })));
|
|
663
|
+
|
|
664
|
+
const HeaderSecondaryMenu = JSX(({ context, className, defaultLocation = '' }) => {
|
|
665
|
+
const [city, getCity] = context.useGeolocation(defaultLocation);
|
|
666
|
+
return (jsxs("div", { className: `flex items-center ${className || ''}`, children: [jsx(TopItem, { className: "mr-5", flat: true, href: "#", text: city, ariaLabel: "\u041C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435", onClick: getCity }), jsx(TopItem, { className: "mr-7", flat: true, href: "#", text: "\u041E\u0444\u0438\u0441\u044B \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B", ariaLabel: "\u0421\u043F\u0438\u0441\u043E\u043A \u0432\u0441\u0435\u0445 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043E\u0444\u0438\u0441\u043E\u0432 \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u043E\u0432" }), jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u0430\u0439\u0442\u0443", children: jsx(Icon, { name: "LoupeIcon", "aria-hidden": "true" }) }), jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u0440\u043E\u0444\u0438\u043B\u044C", children: jsx(Icon, { name: "ProfileIcon", "aria-hidden": "true" }) }), jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-secondary-light hover:text-secondary-active min-w-[32px] min-h-[32px]", ariaLabel: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0441\u0441\u044B\u043B\u043A\u0438", children: jsx(Icon, { name: "GridIcon", "aria-hidden": "true" }) })] }));
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
function isSubItemActive(router) {
|
|
670
|
+
return (subItem) => isHrefActive(subItem.href, router);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
function isTopItemActive(router) {
|
|
674
|
+
return (topItem) => isHrefActive(topItem.href, router, (topItemHref, baseHref) => baseHref.startsWith(topItemHref));
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
const Header = JSX(({ className, defaultLocation, context, topItems }) => {
|
|
678
|
+
const router = context.useRouter();
|
|
679
|
+
const sitemap = useSitemap(context.useAsyncData);
|
|
680
|
+
const { handlerDecorator } = context;
|
|
681
|
+
const mergedItems = mergeTopItems(sitemap.topItems, topItems);
|
|
682
|
+
const activeTopItem = mergedItems.find(isTopItemActive(router));
|
|
683
|
+
const subItems = activeTopItem?.items;
|
|
684
|
+
const activeSubItem = subItems?.find(isSubItemActive(router));
|
|
685
|
+
const topMenu = mergedItems.map((_, i) => (jsx(TopItem, { active: _ === activeTopItem, ...useLink({ router, handlerDecorator }, _), ariaLabel: _.text }, String(i))));
|
|
686
|
+
const subMenu = subItems?.map((_) => (jsx(HeaderItem, { className: "mr-8", active: _ === activeSubItem, ...useLink({ router, handlerDecorator }, _) }, _.href)));
|
|
687
|
+
return (jsxs("header", { className: `pt-5 pb-8 px-20 bg-white ${className || ''}`, children: [jsxs("div", { className: "flex items-center", children: [jsx(Logo, { className: "mr-8" }), topMenu, jsx(HeaderSecondaryMenu, { context: context, className: "ml-auto", defaultLocation: defaultLocation })] }), jsx("div", { className: "mt-5 h-[1px] bg-main-divider" }), jsx("nav", { className: "mt-5", children: subMenu })] }));
|
|
688
|
+
});
|
|
689
|
+
|
|
690
|
+
const MobileAppTile = JSX(({ className, context, title = 'Мобильное приложение', qr, buttons = [] }) => {
|
|
691
|
+
return (jsx(Tile, { className: className, context: context, title: title, buttons: buttons, children: jsxs("div", { className: "flex items-center", children: [qr?.src && qr?.href && (jsx("a", { href: qr.href, target: "_blank", children: jsx("img", { src: qr.src, alt: title, title: title, width: "164", height: "164", className: "w-[90px] h-[90px] min-w-[90px] min-h-[90px] bg-secondary-light" }) })), jsx("span", { className: "font-normal text-sm text-secondary-text ml-4", children: "\u041D\u0430\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u0430\u043C\u0435\u0440\u0443 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 \u043D\u0430 QR-\u043A\u043E\u0434 \u0438 \u0441\u043A\u0430\u0447\u0430\u0439\u0442\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435" })] }) }));
|
|
692
|
+
});
|
|
693
|
+
|
|
694
|
+
const ProductBlockInner = JSX(({ className, context, title, titleSize, description, benefits, buttons, image, items }) => {
|
|
695
|
+
return (jsxs("div", { className: `flex grow justify-between items-stretch ${className || ''}`, children: [jsxs("div", { className: 'flex flex-col', children: [title && (
|
|
696
|
+
/* TODO Why <Title> is duplicated here? */
|
|
697
|
+
jsx(Title, { size: titleSize || 'XL', className: "font-medium m-0 mb-4 whitespace-pre-wrap max-w-[600px]", children: title })), jsx(BaseTile, { context: context, description: description, items: items, buttons: buttons, children: benefits?.length ? (jsx("div", { className: "flex gap-6 mt-6 mb-3.5", children: benefits.map(renderBenefit) })) : null })] }), image?.src && jsx(Img, { className: "mt-auto", image: image })] }));
|
|
698
|
+
});
|
|
699
|
+
function renderBenefit(benefit, i) {
|
|
700
|
+
return (jsxs("div", { className: "flex gap-4 items-center", children: [benefit.icon && (jsx(Icon, { className: "w-[50px] h-[50px] min-w-[50px] min-h-[50px] bg-main rounded-full p-[10px] box-border", name: benefit.icon, width: "24", height: "24" })), jsxs("div", { className: "flex gap-1 flex-col h-full", children: [jsx("h4", { className: "font-medium text-xl m-0", children: benefit.label }), benefit.description && (jsx("div", { className: "font-normal text-sm text-secondary-text", children: benefit.description }))] })] }, String(i)));
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
const Breadcrumb = JSX(({ text, href, target, onClick, className, children }) => {
|
|
704
|
+
if (href) {
|
|
705
|
+
return (jsx("a", { className: `no-underline ${className || ''}`, href: href, target: target, onClick: onClick, children: jsx("span", { className: `${className || ''}`, children: text || children }) }));
|
|
706
|
+
}
|
|
707
|
+
else {
|
|
708
|
+
return jsx("span", { className: `${className || ''}`, children: text || children });
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
|
|
712
|
+
function joinList(sep) {
|
|
713
|
+
return (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: i }, el) : [el]), []);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
const ProductBlock$1 = JSX((props) => {
|
|
717
|
+
const { context, className, breadcrumbs } = props;
|
|
718
|
+
const router = context.useRouter();
|
|
719
|
+
const { handlerDecorator } = context;
|
|
720
|
+
return (jsxs("section", { className: `font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${className || ''}`, children: [breadcrumbs?.length ? (jsx("div", { className: "text-xs mb-6", children: joinList(jsx("span", { className: "text-secondary-text mx-2", children: "/" }))(breadcrumbs.map((breadcrumb, i) => (jsx(Breadcrumb, { ...useLink({ router, handlerDecorator }, { className: 'text-secondary-text', ...breadcrumb }) }, String(i))))) })) : null, jsx(ProductBlockInner, { ...props })] }));
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
const ProductGallery = JSX(({ className, context, duration = 0, slides = [] }) => {
|
|
724
|
+
const galleryNav = slides.map((s) => s.nav);
|
|
725
|
+
const galleryBlocks = slides.map((s) => s.productBlock);
|
|
726
|
+
const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
|
|
727
|
+
return (jsxs("section", { className: `font-sans bg-white overflow-hidden w-100 ${className || ''}`, children: [jsx("div", { className: `flex duration-1000`, style: { transform: `translateX(-${activeSlideIndex}00%)` }, role: "list", children: galleryBlocks.map((_, i) => renderProductBlock(_, i, context)) }), jsx("div", { className: `border-t border-solid border-main-divider flex`, children: galleryNav.map((slide, i) => renderNavButton({
|
|
728
|
+
slide,
|
|
729
|
+
i,
|
|
730
|
+
activeSlideIndex,
|
|
731
|
+
onClick: () => setActiveSlideIndex(i),
|
|
732
|
+
duration,
|
|
733
|
+
})) })] }));
|
|
734
|
+
});
|
|
735
|
+
function renderProductBlock(block, i, context) {
|
|
736
|
+
return (jsx("section", { className: "flex grow-0 shrink-0 basis-full", role: "listitem", children: jsx("div", { className: "p-10 flex grow", children: jsx(ProductBlockInner, { className: "pl-2.5 pt-2.5 pb-1.5 pr-[6.25rem]", context: context, ...block }) }) }, String(i)));
|
|
737
|
+
}
|
|
738
|
+
function renderNavButton({ slide, i, activeSlideIndex, onClick, duration }) {
|
|
739
|
+
const isActiveBtn = i === activeSlideIndex;
|
|
740
|
+
const progressBarClassName = isActiveBtn ? 'animate-slide' : '';
|
|
741
|
+
const btnTitleClassName = isActiveBtn ? 'text-primary-text' : 'text-secondary-text';
|
|
742
|
+
return (jsxs("button", { type: "button", onClick: onClick, className: `group relative overflow-hidden border-0 bg-inherit cursor-pointer text-left px-0 py-4 grow basis-0`, children: [jsxs("div", { className: "border-0 border-r border-solid border-main-divider px-6", children: [jsx("div", { className: `text-sm font-medium group-hover:text-primary-text ${btnTitleClassName}`, children: slide?.title }), jsx("div", { className: "text-xs text-secondary-text", children: slide.desc })] }), jsx("div", { className: `absolute bottom-0 left-0 w-full h-[3px] bg-primary-main -translate-x-full ${progressBarClassName}`, style: { animationDuration: `${duration}s` } })] }, String(i)));
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
const ProductTile = JSX((props) => {
|
|
746
|
+
const { benefits, version } = props;
|
|
747
|
+
return (jsx(Tile, { ...props, children: jsxs("div", { className: "flex mt-5 mb-1", children: [benefits?.length ? (jsx("div", { className: "mr-8", children: benefits.map(renderBenefitDescription) })) : null, benefits?.length ? (jsx("div", { className: "pt-1", children: benefits.map((_, i) => renderBenefitLabel(_, i, version)) })) : null] }) }));
|
|
748
|
+
});
|
|
749
|
+
function renderBenefitLabel(benefit, i, version = 'primary') {
|
|
750
|
+
const labelStyleMap = {
|
|
751
|
+
primary: 'text-secondary-text',
|
|
752
|
+
secondary: 'text-white',
|
|
753
|
+
};
|
|
754
|
+
return (jsx("div", { className: `text-sm ${i ? 'mt-4' : ''} ${labelStyleMap[version]}`, children: benefit.label }, String(i)));
|
|
755
|
+
}
|
|
756
|
+
function renderBenefitDescription(benefit, i) {
|
|
757
|
+
return (jsx("div", { className: `text-xl font-medium ${i ? 'mt-2.5' : ''}`, children: benefit.description }, String(i)));
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
const PromoTile = JSX(({ className, context, title = 'Акции и спецпредложения', date, description, buttons = [], version, }) => {
|
|
761
|
+
return (jsx(Tile, { className: className, context: context, title: title, buttons: buttons, version: version, children: jsxs("div", { children: [date && jsx("div", { className: "text-sm mb-2", children: formatDate(date) }), jsx("div", { className: "text-base", children: description })] }) }));
|
|
762
|
+
});
|
|
763
|
+
function formatDate(date) {
|
|
764
|
+
const dateObj = new Date(date);
|
|
765
|
+
const dateFormat = {
|
|
766
|
+
day: 'numeric',
|
|
767
|
+
month: 'long',
|
|
768
|
+
year: 'numeric',
|
|
769
|
+
};
|
|
770
|
+
return dateObj.toLocaleString('ru-RU', dateFormat).replace('г.', '');
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
const StepsBlock = JSX(({ className, title, steps }) => {
|
|
774
|
+
return (jsxs("section", { className: `font-sans text-primary-text bg-white px-12 py-12 flex flex-col items-center ${className || ''}`, children: [jsx(Title, { className: "font-medium m-0 max-w-[47rem] text-center", children: title }), steps?.length ? (jsxs("div", { children: [jsx("div", { className: "flex mt-9 items-center px-[88px]", children: joinList(jsx("div", { className: "h-0.5 w-full bg-secondary-light" }))(steps.map((step, i) => renderStepIcon(step, i))) }), jsx("div", { className: "flex mt-9 justify-between gap-x-24", children: steps.map(renderStepTitle) })] })) : null] }));
|
|
775
|
+
});
|
|
776
|
+
const renderStepIcon = (step, i) => {
|
|
777
|
+
return (jsx("div", { className: "flex flex-col items-center text-center relative", children: jsx("div", { className: "h-[100px] w-[100px] min-w-[100px] min-h-[100px] bg-secondary-light rounded-full p-[26px] box-border z-10", children: (step.icon && jsx(Icon, { name: step.icon, width: "48", height: "48" })) || (jsx("span", { className: "font-medium text-title-sm text-secondary-text", children: i + 1 })) }) }, String(i)));
|
|
778
|
+
};
|
|
779
|
+
const renderStepTitle = (step, i) => {
|
|
780
|
+
return (jsx("div", { className: "flex flex-col items-center text-center relative w-[276px]", children: jsxs("div", { className: "max-w-min", children: [jsx("h5", { className: "font-medium text-xl m-0 mt-4 whitespace-nowrap px-3", children: step.label }), step.description && (jsx("div", { className: "font-normal text-sm text-secondary-text mt-2", children: step.description }))] }) }, String(i)));
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
const textBlockStyleMaps = {
|
|
784
|
+
primary: {
|
|
785
|
+
background: 'bg-white',
|
|
786
|
+
icon: 'bg-primary-main text-white',
|
|
787
|
+
title: 'text-base',
|
|
788
|
+
description: 'text-secondary-text',
|
|
789
|
+
},
|
|
790
|
+
secondary: {
|
|
791
|
+
background: 'bg-primary-main',
|
|
792
|
+
icon: 'bg-white text-primary-main',
|
|
793
|
+
title: 'text-white',
|
|
794
|
+
description: 'text-white',
|
|
795
|
+
},
|
|
796
|
+
'secondary-light': {
|
|
797
|
+
background: 'bg-primary-main/10',
|
|
798
|
+
icon: 'bg-primary-main text-white',
|
|
799
|
+
title: 'text-base',
|
|
800
|
+
description: 'text-secondary-text',
|
|
801
|
+
},
|
|
802
|
+
};
|
|
803
|
+
const TextBlock = JSX(({ title, description, blockVersion = 'primary', iconVersion, image, className }) => {
|
|
804
|
+
const textBlockStyleMap = textBlockStyleMaps[blockVersion];
|
|
805
|
+
return (jsxs("section", { className: `font-sans px-9 py-4 flex ${textBlockStyleMap.background} ${className || ''}`, children: [iconVersion && iconVersion === 'small' ? renderIcon(textBlockStyleMap.icon) : null, iconVersion && iconVersion === 'big' ? renderImage(image) : null, jsxs("div", { className: "py-0.5", children: [title && jsx("div", { className: `font-medium mb-1 ${textBlockStyleMap.title}`, children: title }), description && (jsx("div", { className: `text-sm ${textBlockStyleMap.description}`, children: description }))] })] }));
|
|
806
|
+
});
|
|
807
|
+
function renderIcon(className) {
|
|
808
|
+
return (jsx("div", { className: `pt-1.5 pr-4`, children: jsx("div", { className: `rounded-full h-4 w-4 text-center text-xs ${className}`, children: "i" }) }));
|
|
809
|
+
}
|
|
810
|
+
function renderImage(image) {
|
|
811
|
+
return image?.src ? jsx(Img, { className: "pt-0.5 pr-3", image: image }) : null;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
const Blocks = {
|
|
815
|
+
Header,
|
|
816
|
+
Footer: Footer$1,
|
|
817
|
+
Placeholder,
|
|
818
|
+
Tile,
|
|
819
|
+
PromoTile,
|
|
820
|
+
TextBlock,
|
|
821
|
+
ProductTile,
|
|
822
|
+
ProductBlock: ProductBlock$1,
|
|
823
|
+
StepsBlock,
|
|
824
|
+
BenefitsBlock,
|
|
825
|
+
ProductGallery,
|
|
826
|
+
ExchangeRateTile,
|
|
827
|
+
MobileAppTile,
|
|
828
|
+
Gallery: Gallery$1,
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
const Footer = JSX(({ className, context }) => (jsx("footer", { className: `${className} px-9 py-2 bg-white rounded-bl-3xl rounded-br-3xl`, children: jsx(TextInformation, { context: context }) })));
|
|
832
|
+
|
|
833
|
+
const Gallery = JSX(({ title, description, cards = [], className }) => {
|
|
834
|
+
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white p-4 overflow-hidden ${className}`, children: [jsxs("div", { className: "flex flex-col items-center mb-8", children: [jsx(Title, { className: "font-medium m-0 text-centers", children: title }), description ? (jsx("div", { className: "font-normal text-base max-w-[600px] mt-3", children: description })) : null] }), jsx("div", { className: "horizontal-list no-scrollbar", role: "list", children: cards?.map(renderCard) })] }));
|
|
835
|
+
});
|
|
836
|
+
function renderCard(card, key) {
|
|
837
|
+
return (jsxs("div", { className: "box-border horizontal-list-item border-solid border rounded-md border-main-divider p-4 mx-1 flex flex-col justify-between items-stretch", role: "listitem", children: [jsxs("div", { children: [card.image?.src ? (jsx("div", { className: "flex justify-center", children: jsx(Img, { className: "mb-6", image: card.image }) })) : null, card.title ? (jsx("h4", { className: `font-medium text-xl m-0 ${!card.description && !card.items?.length ? 'text-center' : ''}`, children: card.title })) : null, card.description ? (jsx("div", { className: "font-normal text-sm text-secondary-text mt-2", children: card.description })) : null, card.items?.length ? renderItems(card.items) : null] }), card.href ? (jsx(Button, { className: "mt-6", text: "\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435", version: "secondary", href: card.href })) : null] }, key));
|
|
838
|
+
}
|
|
839
|
+
function renderItems(items = []) {
|
|
840
|
+
return (jsx("section", { className: "max-w-[308px] mt-2", role: "list", children: items.map((item, i) => (jsx(BlockItem, { children: jsx("span", { className: "text-sm text-secondary-text", children: item }) }, String(i)))) }));
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
const ProductBlock = JSX(({ titleSize, image, benefits, ...props } /* Get rid of image and benefits */) => {
|
|
844
|
+
const { className } = props;
|
|
845
|
+
return (jsx("section", { className: `font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${className || ''}`, children: jsx(ProductBlockInner, { ...props, titleSize: "L" }) }));
|
|
846
|
+
});
|
|
847
|
+
|
|
848
|
+
const MobileBlocks = {
|
|
849
|
+
Header,
|
|
850
|
+
Footer,
|
|
851
|
+
Placeholder,
|
|
852
|
+
Tile,
|
|
853
|
+
ProductTile,
|
|
854
|
+
ProductBlock,
|
|
855
|
+
TextBlock,
|
|
856
|
+
ExchangeRateTile,
|
|
857
|
+
MobileAppTile,
|
|
858
|
+
Gallery,
|
|
859
|
+
// TODO StepsBlock,
|
|
860
|
+
// TODO BenefitsBlock,
|
|
861
|
+
// TODO ProductGallery
|
|
862
|
+
};
|
|
863
|
+
|
|
864
|
+
exports.Blocks = Blocks;
|
|
865
|
+
exports.ContentPage = ContentPage;
|
|
866
|
+
exports.ContentPageHead = ContentPageHead;
|
|
867
|
+
exports.DaDataAPI = DaDataAPI;
|
|
868
|
+
exports.LikeAPI = LikeAPI;
|
|
869
|
+
exports.MobileBlocks = MobileBlocks;
|
|
870
|
+
exports.joinList = joinList;
|
|
871
|
+
exports.projectSettings = projectSettings;
|
|
872
|
+
exports.setup = setup;
|
|
873
|
+
exports.toMobilePage = toMobilePage;
|
|
874
|
+
exports.url = url;
|
|
875
|
+
|
|
876
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
877
|
+
|
|
878
|
+
}));
|