@redneckz/wildless-cms-uni-blocks 0.6.42 → 0.6.44
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/bin/migration-scripts/0.6.34.js +2 -0
- package/bin/migration-scripts/0.6.43.js +29 -0
- package/bundle/ProjectSettings.d.ts +2 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +122 -91
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/bundle/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/bundle/components/ProductTile/renderBenefit.d.ts +4 -0
- package/bundle/components/ProductTile/renderImage.d.ts +3 -0
- package/bundle/content-page-repository/transformImg.d.ts +1 -1
- package/bundle/services/BlockRouter/BlockRouter.d.ts +1 -1
- package/bundle/services/sitemap/checkIsHrefSameOrigin.d.ts +2 -4
- package/bundle/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/bundle/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/bundle/utils/normalizeURLPath.d.ts +1 -0
- package/bundle/utils/url.d.ts +1 -0
- package/dist/ProjectSettings.d.ts +2 -0
- package/dist/ProjectSettings.js +5 -0
- package/dist/ProjectSettings.js.map +1 -1
- package/dist/api/LikeAPI.js +2 -2
- package/dist/api/LikeAPI.js.map +1 -1
- package/dist/components/Header/Header.js +1 -6
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/ProductTile/ProductTile.js +9 -22
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/dist/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/dist/components/ProductTile/renderAdditionalDescription.js +18 -0
- package/dist/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/dist/components/ProductTile/renderBenefit.d.ts +4 -0
- package/dist/components/ProductTile/renderBenefit.js +32 -0
- package/dist/components/ProductTile/renderBenefit.js.map +1 -0
- package/dist/components/ProductTile/renderImage.d.ts +3 -0
- package/dist/components/ProductTile/renderImage.js +12 -0
- package/dist/components/ProductTile/renderImage.js.map +1 -0
- package/dist/components/TextBlock/TextBlock.js +13 -28
- package/dist/components/TextBlock/TextBlock.js.map +1 -1
- package/dist/content-page-repository/transformImg.d.ts +1 -1
- package/dist/content-page-repository/transformImg.js +4 -10
- package/dist/content-page-repository/transformImg.js.map +1 -1
- package/dist/content-page-repository/transformMarkdown.js +3 -3
- package/dist/content-page-repository/transformMarkdown.js.map +1 -1
- package/dist/hooks/useLink.js +3 -5
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/hooks/useLocation.js +11 -5
- package/dist/hooks/useLocation.js.map +1 -1
- package/dist/services/BlockRouter/BlockRouter.d.ts +1 -1
- package/dist/services/BlockRouter/BlockRouter.js.map +1 -1
- package/dist/services/sitemap/checkIsHrefSameOrigin.d.ts +2 -4
- package/dist/services/sitemap/checkIsHrefSameOrigin.js +1 -1
- package/dist/services/sitemap/checkIsHrefSameOrigin.js.map +1 -1
- package/dist/services/sitemap/isHrefActive.js +2 -3
- package/dist/services/sitemap/isHrefActive.js.map +1 -1
- package/dist/setup-fixture.js +3 -3
- package/dist/setup-fixture.js.map +1 -1
- package/dist/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/dist/ui-kit/MarkdownText/MarkdownText.js +9 -0
- package/dist/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/dist/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/dist/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/dist/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/dist/ui-kit/Text/Text.js +1 -5
- package/dist/ui-kit/Text/Text.js.map +1 -1
- package/dist/utils/normalizeURLPath.d.ts +1 -0
- package/dist/utils/normalizeURLPath.js +12 -0
- package/dist/utils/normalizeURLPath.js.map +1 -0
- package/dist/utils/url.d.ts +1 -0
- package/dist/utils/url.js +9 -1
- package/dist/utils/url.js.map +1 -1
- package/dist/wlc.json +3 -1
- package/lib/ProjectSettings.d.ts +2 -0
- package/lib/ProjectSettings.js +5 -0
- package/lib/ProjectSettings.js.map +1 -1
- package/lib/api/LikeAPI.js +2 -2
- package/lib/api/LikeAPI.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Header/Header.js +1 -6
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/ProductTile/ProductTile.js +10 -23
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/lib/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/lib/components/ProductTile/renderAdditionalDescription.js +15 -0
- package/lib/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/lib/components/ProductTile/renderBenefit.d.ts +4 -0
- package/lib/components/ProductTile/renderBenefit.js +29 -0
- package/lib/components/ProductTile/renderBenefit.js.map +1 -0
- package/lib/components/ProductTile/renderImage.d.ts +3 -0
- package/lib/components/ProductTile/renderImage.js +9 -0
- package/lib/components/ProductTile/renderImage.js.map +1 -0
- package/lib/components/TextBlock/TextBlock.js +13 -28
- package/lib/components/TextBlock/TextBlock.js.map +1 -1
- package/lib/content-page-repository/transformImg.d.ts +1 -1
- package/lib/content-page-repository/transformImg.js +4 -10
- package/lib/content-page-repository/transformImg.js.map +1 -1
- package/lib/content-page-repository/transformMarkdown.js +3 -3
- package/lib/content-page-repository/transformMarkdown.js.map +1 -1
- package/lib/hooks/useLink.js +3 -5
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/hooks/useLocation.js +11 -5
- package/lib/hooks/useLocation.js.map +1 -1
- package/lib/services/BlockRouter/BlockRouter.d.ts +1 -1
- package/lib/services/BlockRouter/BlockRouter.js.map +1 -1
- package/lib/services/sitemap/checkIsHrefSameOrigin.d.ts +2 -4
- package/lib/services/sitemap/checkIsHrefSameOrigin.js +1 -1
- package/lib/services/sitemap/checkIsHrefSameOrigin.js.map +1 -1
- package/lib/services/sitemap/isHrefActive.js +3 -4
- package/lib/services/sitemap/isHrefActive.js.map +1 -1
- package/lib/setup-fixture.js +3 -3
- package/lib/setup-fixture.js.map +1 -1
- package/lib/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/lib/ui-kit/MarkdownText/MarkdownText.js +7 -0
- package/lib/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/lib/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/lib/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/lib/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/lib/ui-kit/Text/Text.js +1 -5
- package/lib/ui-kit/Text/Text.js.map +1 -1
- package/lib/utils/normalizeURLPath.d.ts +1 -0
- package/lib/utils/normalizeURLPath.js +9 -0
- package/lib/utils/normalizeURLPath.js.map +1 -0
- package/lib/utils/url.d.ts +1 -0
- package/lib/utils/url.js +7 -0
- package/lib/utils/url.js.map +1 -1
- package/lib/wlc.json +3 -1
- package/mobile/bundle/ProjectSettings.d.ts +2 -0
- package/mobile/bundle/bundle.umd.js +39 -21
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/mobile/bundle/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/mobile/bundle/components/ProductTile/renderBenefit.d.ts +4 -0
- package/mobile/bundle/components/ProductTile/renderImage.d.ts +3 -0
- package/mobile/bundle/content-page-repository/transformImg.d.ts +1 -1
- package/mobile/bundle/services/BlockRouter/BlockRouter.d.ts +1 -1
- package/mobile/bundle/services/sitemap/checkIsHrefSameOrigin.d.ts +2 -4
- package/mobile/bundle/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/mobile/bundle/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/mobile/bundle/utils/normalizeURLPath.d.ts +1 -0
- package/mobile/bundle/utils/url.d.ts +1 -0
- package/mobile/dist/ProjectSettings.d.ts +2 -0
- package/mobile/dist/ProjectSettings.js +5 -0
- package/mobile/dist/ProjectSettings.js.map +1 -1
- package/mobile/dist/api/LikeAPI.js +2 -2
- package/mobile/dist/api/LikeAPI.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTile.js +9 -22
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/mobile/dist/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/mobile/dist/components/ProductTile/renderAdditionalDescription.js +18 -0
- package/mobile/dist/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/mobile/dist/components/ProductTile/renderBenefit.d.ts +4 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js +32 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -0
- package/mobile/dist/components/ProductTile/renderImage.d.ts +3 -0
- package/mobile/dist/components/ProductTile/renderImage.js +12 -0
- package/mobile/dist/components/ProductTile/renderImage.js.map +1 -0
- package/mobile/dist/content-page-repository/transformImg.d.ts +1 -1
- package/mobile/dist/content-page-repository/transformImg.js +4 -10
- package/mobile/dist/content-page-repository/transformImg.js.map +1 -1
- package/mobile/dist/content-page-repository/transformMarkdown.js +3 -3
- package/mobile/dist/content-page-repository/transformMarkdown.js.map +1 -1
- package/mobile/dist/hooks/useLink.js +3 -5
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/hooks/useLocation.js +11 -5
- package/mobile/dist/hooks/useLocation.js.map +1 -1
- package/mobile/dist/services/BlockRouter/BlockRouter.d.ts +1 -1
- package/mobile/dist/services/BlockRouter/BlockRouter.js.map +1 -1
- package/mobile/dist/services/sitemap/checkIsHrefSameOrigin.d.ts +2 -4
- package/mobile/dist/services/sitemap/checkIsHrefSameOrigin.js +1 -1
- package/mobile/dist/services/sitemap/checkIsHrefSameOrigin.js.map +1 -1
- package/mobile/dist/services/sitemap/isHrefActive.js +2 -3
- package/mobile/dist/services/sitemap/isHrefActive.js.map +1 -1
- package/mobile/dist/setup-fixture.js +3 -3
- package/mobile/dist/setup-fixture.js.map +1 -1
- package/mobile/dist/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownText.js +9 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/mobile/dist/ui-kit/Text/Text.js +1 -5
- package/mobile/dist/ui-kit/Text/Text.js.map +1 -1
- package/mobile/dist/utils/normalizeURLPath.d.ts +1 -0
- package/mobile/dist/utils/normalizeURLPath.js +12 -0
- package/mobile/dist/utils/normalizeURLPath.js.map +1 -0
- package/mobile/dist/utils/url.d.ts +1 -0
- package/mobile/dist/utils/url.js +9 -1
- package/mobile/dist/utils/url.js.map +1 -1
- package/mobile/dist/wlc.json +3 -1
- package/mobile/lib/ProjectSettings.d.ts +2 -0
- package/mobile/lib/ProjectSettings.js +5 -0
- package/mobile/lib/ProjectSettings.js.map +1 -1
- package/mobile/lib/api/LikeAPI.js +2 -2
- package/mobile/lib/api/LikeAPI.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTile.js +10 -23
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/mobile/lib/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/mobile/lib/components/ProductTile/renderAdditionalDescription.js +15 -0
- package/mobile/lib/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/mobile/lib/components/ProductTile/renderBenefit.d.ts +4 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js +29 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -0
- package/mobile/lib/components/ProductTile/renderImage.d.ts +3 -0
- package/mobile/lib/components/ProductTile/renderImage.js +9 -0
- package/mobile/lib/components/ProductTile/renderImage.js.map +1 -0
- package/mobile/lib/content-page-repository/transformImg.d.ts +1 -1
- package/mobile/lib/content-page-repository/transformImg.js +4 -10
- package/mobile/lib/content-page-repository/transformImg.js.map +1 -1
- package/mobile/lib/content-page-repository/transformMarkdown.js +3 -3
- package/mobile/lib/content-page-repository/transformMarkdown.js.map +1 -1
- package/mobile/lib/hooks/useLink.js +3 -5
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/hooks/useLocation.js +11 -5
- package/mobile/lib/hooks/useLocation.js.map +1 -1
- package/mobile/lib/services/BlockRouter/BlockRouter.d.ts +1 -1
- package/mobile/lib/services/BlockRouter/BlockRouter.js.map +1 -1
- package/mobile/lib/services/sitemap/checkIsHrefSameOrigin.d.ts +2 -4
- package/mobile/lib/services/sitemap/checkIsHrefSameOrigin.js +1 -1
- package/mobile/lib/services/sitemap/checkIsHrefSameOrigin.js.map +1 -1
- package/mobile/lib/services/sitemap/isHrefActive.js +3 -4
- package/mobile/lib/services/sitemap/isHrefActive.js.map +1 -1
- package/mobile/lib/setup-fixture.js +3 -3
- package/mobile/lib/setup-fixture.js.map +1 -1
- package/mobile/lib/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownText.js +7 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/mobile/lib/ui-kit/Text/Text.js +1 -5
- package/mobile/lib/ui-kit/Text/Text.js.map +1 -1
- package/mobile/lib/utils/normalizeURLPath.d.ts +1 -0
- package/mobile/lib/utils/normalizeURLPath.js +9 -0
- package/mobile/lib/utils/normalizeURLPath.js.map +1 -0
- package/mobile/lib/utils/url.d.ts +1 -0
- package/mobile/lib/utils/url.js +7 -0
- package/mobile/lib/utils/url.js.map +1 -1
- package/mobile/lib/wlc.json +3 -1
- package/mobile/src/ProjectSettings.ts +6 -0
- package/mobile/src/api/LikeAPI.ts +2 -2
- package/mobile/src/common.css +50 -0
- package/mobile/src/components/ProductTile/ProductTile.example.json +3 -0
- package/mobile/src/components/ProductTile/ProductTile.tsx +13 -44
- package/mobile/src/components/ProductTile/ProductTile.ui.json +14 -1
- package/mobile/src/components/ProductTile/ProductTileContent.ts +26 -2
- package/mobile/src/components/ProductTile/renderAdditionalDescription.tsx +30 -0
- package/mobile/src/components/ProductTile/renderBenefit.tsx +39 -0
- package/mobile/src/components/ProductTile/renderImage.tsx +15 -0
- package/mobile/src/content-page-repository/transformImg.ts +6 -14
- package/mobile/src/content-page-repository/transformMarkdown.ts +3 -3
- package/mobile/src/hooks/useLink.ts +6 -7
- package/mobile/src/hooks/useLocation.ts +12 -6
- package/mobile/src/services/BlockRouter/BlockRouter.ts +1 -1
- package/mobile/src/services/sitemap/checkIsHrefSameOrigin.ts +5 -4
- package/mobile/src/services/sitemap/isHrefActive.ts +7 -4
- package/mobile/src/setup-fixture.ts +3 -3
- package/mobile/src/ui-kit/MarkdownText/MarkdownText.tsx +8 -0
- package/mobile/src/ui-kit/MarkdownText/MarkdownTextProps.ts +6 -0
- package/mobile/src/ui-kit/Text/Text.tsx +5 -7
- package/mobile/src/utils/normalizeURLPath.ts +10 -0
- package/mobile/src/utils/url.ts +10 -0
- package/mobile/src/wlc.json +3 -1
- package/package.json +1 -1
- package/src/ProjectSettings.ts +6 -0
- package/src/api/LikeAPI.ts +2 -2
- package/src/common.css +50 -0
- package/src/components/Header/Header.tsx +2 -10
- package/src/components/ProductTile/ProductTile.example.json +3 -0
- package/src/components/ProductTile/ProductTile.fixture.tsx +11 -4
- package/src/components/ProductTile/ProductTile.tsx +13 -44
- package/src/components/ProductTile/ProductTile.ui.json +14 -1
- package/src/components/ProductTile/ProductTileContent.ts +26 -2
- package/src/components/ProductTile/renderAdditionalDescription.tsx +30 -0
- package/src/components/ProductTile/renderBenefit.tsx +39 -0
- package/src/components/ProductTile/renderImage.tsx +15 -0
- package/src/components/TextBlock/TextBlock.tsx +49 -41
- package/src/content-page-repository/transformImg.ts +6 -14
- package/src/content-page-repository/transformMarkdown.ts +3 -3
- package/src/hooks/useLink.ts +6 -7
- package/src/hooks/useLocation.ts +12 -6
- package/src/services/BlockRouter/BlockRouter.ts +1 -1
- package/src/services/sitemap/checkIsHrefSameOrigin.ts +5 -4
- package/src/services/sitemap/isHrefActive.ts +7 -4
- package/src/setup-fixture.ts +3 -3
- package/src/ui-kit/MarkdownText/MarkdownText.tsx +8 -0
- package/src/ui-kit/MarkdownText/MarkdownTextProps.ts +6 -0
- package/src/ui-kit/Text/Text.tsx +5 -7
- package/src/utils/normalizeURLPath.ts +10 -0
- package/src/utils/url.ts +10 -0
- package/src/wlc.json +3 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -85,6 +85,11 @@
|
|
|
85
85
|
get CDN() {
|
|
86
86
|
return this._.CDN;
|
|
87
87
|
}
|
|
88
|
+
get BASE_PATH() {
|
|
89
|
+
return this._.BASE_PATH && !this._.BASE_PATH.endsWith('/')
|
|
90
|
+
? `${this._.BASE_PATH}/`
|
|
91
|
+
: this._.BASE_PATH;
|
|
92
|
+
}
|
|
88
93
|
get YANDEX_MAP_API_KEY() {
|
|
89
94
|
return this._.YANDEX_MAP_API_KEY;
|
|
90
95
|
}
|
|
@@ -175,7 +180,7 @@
|
|
|
175
180
|
}
|
|
176
181
|
async function auth() {
|
|
177
182
|
try {
|
|
178
|
-
const userData = JSON.parse(globalThis.localStorage
|
|
183
|
+
const userData = JSON.parse(globalThis.localStorage?.getItem(STORAGE_KEY) || '');
|
|
179
184
|
if (userData?.token) {
|
|
180
185
|
return userData;
|
|
181
186
|
}
|
|
@@ -195,7 +200,7 @@
|
|
|
195
200
|
}),
|
|
196
201
|
});
|
|
197
202
|
const { token, name } = await response.json();
|
|
198
|
-
globalThis.localStorage
|
|
203
|
+
globalThis.localStorage?.setItem(STORAGE_KEY, JSON.stringify({ token, name }));
|
|
199
204
|
return { token, name };
|
|
200
205
|
}
|
|
201
206
|
catch (e) {
|
|
@@ -519,11 +524,7 @@
|
|
|
519
524
|
return (jsx(ImgAsPicture, { className: className, imageClassName: imageClassName, image: image, isMobile: isMobile }));
|
|
520
525
|
});
|
|
521
526
|
|
|
522
|
-
const Text = JSX((
|
|
523
|
-
const { size = '', color = '', align = '', font = '', children } = props;
|
|
524
|
-
const textClasses = `font-sans ${size} ${color} ${align} ${font}`;
|
|
525
|
-
return jsx("span", { className: textClasses, children: children });
|
|
526
|
-
});
|
|
527
|
+
const Text = JSX(({ size, color, align, font, children }) => (jsx("span", { className: ['font-sans', size, color, align, font].filter(Boolean).join(' '), children: children })));
|
|
527
528
|
|
|
528
529
|
const icons$1 = ['PlusIcon', 'MinusIcon'];
|
|
529
530
|
const AccordionItem = JSX(({ className = '', label = '', isExpanded, ...rest }) => (jsx("li", { className: `border-0 border-b border-solid border-main-divider last:border-b-0 ${className}`, children: jsx(Foldable, { isFoldButtonOnTop: true, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { className: "grid grid-cols-12 gap-5 [&>*]:p-0", isUnfolded: isUnfolded, children: renderChildren(rest) })), renderFoldButton: ({ isUnfolded, onToggle }) => (jsx(FoldButton$1, { label: label, icon: icons$1[Number(isUnfolded)], onClick: onToggle })) }) })));
|
|
@@ -559,9 +560,9 @@
|
|
|
559
560
|
const BenefitsBlock = JSX(({ className = '', title, benefitList, version = 'primary', ...rest }) => (jsxs(BlockWrapper, { className: `font-sans text-primary-text p-12 flex flex-col items-center ${className} ${VersionStyleMap[version]}`, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", as: "h2", className: `max-w-[47rem] text-center ${benefitsTextStyleMap[version]}`, title: title })) : null, benefitList?.length ? (jsx("div", { className: "flex flex-wrap w-full justify-center gap-x-20 mt-8", children: benefitList.map(renderStep(version)) })) : null] })));
|
|
560
561
|
const renderStep = (version) => (benefit, i) => {
|
|
561
562
|
const description = benefit.description;
|
|
562
|
-
return (jsxs("div", { className: "flex items-center basis-1/2 max-w-[500px] mb-14", children: [benefit?.icon?.icon ? (jsx(ImgInner, { className: `w-12 h-12 min-w-12 p-3 rounded-full ${benefitsIconStyleMap[version]}`, image: getIconWithVersion(benefit.icon, version), asSVG: true })) : null, benefit?.icon?.src ? jsx(ImgInner, { image: benefit.icon }) : null, jsxs("div", { className: "ml-5", children: [benefit?.label ? (jsx("h3", { className: `text-h6 m-0 ${benefitsTextStyleMap[version]}`, children: benefit.label })) : null, renderDescription$
|
|
563
|
+
return (jsxs("div", { className: "flex items-center basis-1/2 max-w-[500px] mb-14", children: [benefit?.icon?.icon ? (jsx(ImgInner, { className: `w-12 h-12 min-w-12 p-3 rounded-full ${benefitsIconStyleMap[version]}`, image: getIconWithVersion(benefit.icon, version), asSVG: true })) : null, benefit?.icon?.src ? jsx(ImgInner, { image: benefit.icon }) : null, jsxs("div", { className: "ml-5", children: [benefit?.label ? (jsx("h3", { className: `text-h6 m-0 ${benefitsTextStyleMap[version]}`, children: benefit.label })) : null, renderDescription$5(description, version)] })] }, String(i)));
|
|
563
564
|
};
|
|
564
|
-
const renderDescription$
|
|
565
|
+
const renderDescription$5 = (description, version) => {
|
|
565
566
|
const benefitType = description?.benefitType || null;
|
|
566
567
|
return description && benefitType ? (jsx("div", { className: `text-l-light mt-2 ${benefitsDescriptionStyleMap[version]}`, children: benefitType === 'list'
|
|
567
568
|
? renderListBenefit(description)
|
|
@@ -589,6 +590,13 @@
|
|
|
589
590
|
const endOfOrigin = url.indexOf('/', endOfProto + protoSeparator.length);
|
|
590
591
|
return endOfOrigin !== -1 ? url.substring(0, endOfOrigin) : url;
|
|
591
592
|
};
|
|
593
|
+
const getPathname = (href) => {
|
|
594
|
+
if (!href || !isURL(href)) {
|
|
595
|
+
return undefined;
|
|
596
|
+
}
|
|
597
|
+
const url = new URL(href);
|
|
598
|
+
return url.pathname;
|
|
599
|
+
};
|
|
592
600
|
const getHash = (href) => {
|
|
593
601
|
if (!href || !isURL(href)) {
|
|
594
602
|
return undefined;
|
|
@@ -603,6 +611,7 @@
|
|
|
603
611
|
isURL: isURL,
|
|
604
612
|
withoutQuery: withoutQuery,
|
|
605
613
|
getOrigin: getOrigin,
|
|
614
|
+
getPathname: getPathname,
|
|
606
615
|
getHash: getHash,
|
|
607
616
|
isHash: isHash
|
|
608
617
|
});
|
|
@@ -654,10 +663,7 @@
|
|
|
654
663
|
'aria-label': props.text,
|
|
655
664
|
onClick: handlerDecorator((ev) => {
|
|
656
665
|
props.onClick && props.onClick(ev);
|
|
657
|
-
|
|
658
|
-
const isLocalTarget = !props.target || props.target === '_self';
|
|
659
|
-
if (!isLocalHref || !isLocalTarget) {
|
|
660
|
-
// Default handle
|
|
666
|
+
if (isRemoteHref(href, props.target)) {
|
|
661
667
|
return;
|
|
662
668
|
}
|
|
663
669
|
ev?.preventDefault();
|
|
@@ -665,12 +671,13 @@
|
|
|
665
671
|
blockRouter.goto(href);
|
|
666
672
|
}
|
|
667
673
|
else {
|
|
668
|
-
router.push(href);
|
|
674
|
+
href && router.push(href);
|
|
669
675
|
}
|
|
670
676
|
}, props),
|
|
671
677
|
};
|
|
672
678
|
};
|
|
673
679
|
}
|
|
680
|
+
const isRemoteHref = (href, target) => isURL(href) || (target && target !== '_self') || href?.startsWith('/');
|
|
674
681
|
|
|
675
682
|
const buttonStyleMap = {
|
|
676
683
|
primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
|
|
@@ -1676,11 +1683,11 @@
|
|
|
1676
1683
|
BORDER_STYLE,
|
|
1677
1684
|
AlignText[align],
|
|
1678
1685
|
VersionStyleMap[version],
|
|
1679
|
-
].join(' '), role: "listitem", children: [jsxs("div", { className: "flex flex-col h-full", children: [renderImage$4(icon, version), renderCardTitle$1(headlineSmallVersion, title), renderDescription$
|
|
1686
|
+
].join(' '), role: "listitem", children: [jsxs("div", { className: "flex flex-col h-full", children: [renderImage$4(icon, version), renderCardTitle$1(headlineSmallVersion, title), renderDescription$4(description, title), renderItems$2(items, isDotted, version), renderAdditionalDescription$2(additionalDescription, version)] }), renderButton({ button, buttonClassName: 'mt-6' })] }));
|
|
1680
1687
|
});
|
|
1681
1688
|
const renderImage$4 = (image, version) => (jsxs("div", { className: "flex justify-center", children: [image?.src ? jsx(ImgInner, { className: "mb-5", image: image }) : null, image?.icon ? (jsx(ImgInner, { className: `w-[32px] h-[32px] min-w-[32px] mb-5 rounded-full`, image: getIconWithVersion(image, version), asSVG: true })) : null] }));
|
|
1682
1689
|
const renderCardTitle$1 = (headlineSmallVersion, title) => title ? jsx(Text, { size: HEADLINE_SMALL_VERSION[headlineSmallVersion], children: title }) : null;
|
|
1683
|
-
const renderDescription$
|
|
1690
|
+
const renderDescription$4 = (description, title) => description ? (jsx("div", { className: title ? 'mt-2' : '', children: jsx(Paragraph, { size: "text-l", children: description }) })) : null;
|
|
1684
1691
|
const renderAdditionalDescription$2 = (additionalDescription, version = 'primary') => additionalDescription ? (jsx("div", { className: "mt-auto", children: jsx(Text, { size: "text-m", font: "font-light", color: descriptionStyleMap[version], children: additionalDescription }) })) : null;
|
|
1685
1692
|
const renderItems$2 = (items, isDotted, version = 'primary') => items?.length ? (jsx(List, { className: `max-w-[308px] mt-2 text-s ${version === 'primary' ? '!text-secondary-text' : ''}`, itemClassName: "text-left", items: items.filter((item) => item?.text).map((item) => item.text), isDotted: isDotted, version: version })) : null;
|
|
1686
1693
|
|
|
@@ -2050,12 +2057,12 @@
|
|
|
2050
2057
|
'bg-white': 'text-primary-text',
|
|
2051
2058
|
transparent: 'text-white',
|
|
2052
2059
|
};
|
|
2053
|
-
const renderTitle$
|
|
2060
|
+
const renderTitle$3 = (title, bgColor, className) => {
|
|
2054
2061
|
return (jsx("span", { className: `${TEXT_COLOR[bgColor]} ml-2.5 font-medium ${className || ''}`, children: title || 'Россельхозбанк' }));
|
|
2055
2062
|
};
|
|
2056
2063
|
|
|
2057
2064
|
const Logo = JSX(({ className = '', href, logo, children = logo?.title, targetBlank, bgColor = 'bg-white', showTitle = true, }) => {
|
|
2058
|
-
return (jsxs("a", { className: `inline-flex items-center font-sans no-underline ${className}`, href: href || '/', target: targetBlank ? '_blank' : '_self', "aria-label": logo?.title || 'Россельхозбанк', children: [renderImage$3(bgColor, logo?.image, { width: '40', height: '45' }), showTitle ? renderTitle$
|
|
2065
|
+
return (jsxs("a", { className: `inline-flex items-center font-sans no-underline ${className}`, href: href || '/', target: targetBlank ? '_blank' : '_self', "aria-label": logo?.title || 'Россельхозбанк', children: [renderImage$3(bgColor, logo?.image, { width: '40', height: '45' }), showTitle ? renderTitle$3(children || logo?.title, bgColor) : null] }));
|
|
2059
2066
|
});
|
|
2060
2067
|
|
|
2061
2068
|
const useSearch = () => {
|
|
@@ -2203,7 +2210,7 @@
|
|
|
2203
2210
|
mini: 276,
|
|
2204
2211
|
};
|
|
2205
2212
|
|
|
2206
|
-
const GalleryCardInner = JSX(({ title, headlineSmallVersion = 'H6', description, additionalDescription, icon, items, button, version, isFullWidth = true, isDotted = true, align = 'center', }) => (jsxs("div", { className: `h-full flex flex-col justify-between ${AlignText[align]}`, children: [jsxs("div", { className: "flex flex-col h-full", children: [renderImage$2(icon, version), renderCardTitle(headlineSmallVersion, title), renderDescription$
|
|
2213
|
+
const GalleryCardInner = JSX(({ title, headlineSmallVersion = 'H6', description, additionalDescription, icon, items, button, version, isFullWidth = true, isDotted = true, align = 'center', }) => (jsxs("div", { className: `h-full flex flex-col justify-between ${AlignText[align]}`, children: [jsxs("div", { className: "flex flex-col h-full", children: [renderImage$2(icon, version), renderCardTitle(headlineSmallVersion, title), renderDescription$3(description, title), items?.length ? renderItems$1(items, isDotted, version) : null, renderAdditionalDescription$1(additionalDescription, version)] }), button?.text
|
|
2207
2214
|
? renderButton({
|
|
2208
2215
|
button,
|
|
2209
2216
|
buttonClassName: `mt-6 ${isFullWidth ? '' : 'self-center'}`,
|
|
@@ -2211,7 +2218,7 @@
|
|
|
2211
2218
|
: null] })));
|
|
2212
2219
|
const renderImage$2 = (image, version) => (jsxs("div", { className: "flex justify-center", children: [image?.src ? jsx(ImgInner, { className: "mb-5", image: image }) : null, image?.icon ? (jsx(ImgInner, { className: `w-8 h-8 min-w-8 mb-5 rounded-full`, image: getIconWithVersion(image, version), asSVG: true })) : null] }));
|
|
2213
2220
|
const renderCardTitle = (headlineSmallVersion, title) => title ? jsx("div", { className: HEADLINE_SMALL_VERSION[headlineSmallVersion], children: title }) : null;
|
|
2214
|
-
const renderDescription$
|
|
2221
|
+
const renderDescription$3 = (description, title) => description ? jsx("div", { className: `text-l ${title ? 'mt-2' : ''}`, children: description }) : null;
|
|
2215
2222
|
const renderAdditionalDescription$1 = (additionalDescription, version) => additionalDescription ? (jsx("div", { className: `text-m-light mt-auto ${VersionAdditionalStyleMap[version ?? 'primary']}`, children: additionalDescription })) : null;
|
|
2216
2223
|
const renderItems$1 = (items, isDotted, version = 'primary') => (jsx(List, { className: `max-w-[308px] mt-2 text-s ${version === 'primary' ? '!text-secondary-text' : ''}`, itemClassName: "text-left", items: items.filter((item) => item?.text).map((item) => item.text), isDotted: isDotted, version: version }));
|
|
2217
2224
|
|
|
@@ -2252,12 +2259,17 @@
|
|
|
2252
2259
|
const renderMonthNames = (item, colSize) => item.month?.map((_, i) => (jsx("div", { style: { flexBasis: `${colSize}%` }, children: _.text }, `monthName-${i}`)));
|
|
2253
2260
|
const renderMonthImages = (item) => item.month?.map((_) => _.image?.src ? (jsx("div", { className: "h-[207px] border-r pr-3 mr-3 border-main-divider last:border-r-0 last:pr-0 last:mr-0", children: jsx(ImgInner, { image: _.image, className: "flex" }) }, `monthImage-${_.image.src}`)) : null);
|
|
2254
2261
|
|
|
2255
|
-
const checkIsHrefSameOrigin = (href, router) => getOrigin(href)
|
|
2262
|
+
const checkIsHrefSameOrigin = (href, router) => [getOrigin(href), getOrigin(router.href)].every((link, _, arr) => Boolean(link) && link === arr[0]);
|
|
2256
2263
|
|
|
2257
|
-
const
|
|
2258
|
-
|
|
2264
|
+
const normalizeURLPath = (href) => {
|
|
2265
|
+
if (isURL(href) || href?.startsWith('/')) {
|
|
2266
|
+
return href;
|
|
2267
|
+
}
|
|
2268
|
+
return `${projectSettings.BASE_PATH || ''}${href}`;
|
|
2259
2269
|
};
|
|
2260
2270
|
|
|
2271
|
+
const isHrefActive = (href, router, cmp = (targetHref, baseHref) => baseHref.startsWith(targetHref)) => cmp(withoutQuery(normalizeURLPath(href)), withoutQuery(isURL(href) ? router.href : getPathname(router.href)));
|
|
2272
|
+
|
|
2261
2273
|
const isSubItemActive = (router) => (subItem) => isHrefActive(subItem.href, router);
|
|
2262
2274
|
|
|
2263
2275
|
const isTopItemActive = (router) => (topItem) => topItem.items?.some(isSubItemActive(router)) ||
|
|
@@ -2307,11 +2319,8 @@
|
|
|
2307
2319
|
}
|
|
2308
2320
|
|
|
2309
2321
|
const REGION_URL = '/api/v1/region';
|
|
2310
|
-
const localStorageLocation = globalThis?.localStorage.getItem('location');
|
|
2311
|
-
const currentLocation = localStorageLocation
|
|
2312
|
-
? JSON.parse(localStorageLocation)
|
|
2313
|
-
: null;
|
|
2314
2322
|
function useLocation(defaultLocation) {
|
|
2323
|
+
const currentLocation = getLocalStorageLocation();
|
|
2315
2324
|
const [location, setLocation] = useState(currentLocation?.region ?? { name: defaultLocation });
|
|
2316
2325
|
const { data } = useCachedAsyncData(REGION_URL, fetchJSONUnsafe);
|
|
2317
2326
|
useEffect(() => {
|
|
@@ -2320,11 +2329,20 @@
|
|
|
2320
2329
|
: data || { name: defaultLocation });
|
|
2321
2330
|
}, [data]);
|
|
2322
2331
|
const onChangeLocation = useCallback((region) => {
|
|
2323
|
-
globalThis?.
|
|
2332
|
+
globalThis.localStorage?.setItem('location', JSON.stringify({ manual: true, region }));
|
|
2324
2333
|
setLocation(region);
|
|
2325
2334
|
}, [setLocation]);
|
|
2326
2335
|
return [location, onChangeLocation];
|
|
2327
2336
|
}
|
|
2337
|
+
const getLocalStorageLocation = () => {
|
|
2338
|
+
const localStorageLocation = globalThis.localStorage?.getItem('location');
|
|
2339
|
+
try {
|
|
2340
|
+
return localStorageLocation ? JSON.parse(localStorageLocation) : null;
|
|
2341
|
+
}
|
|
2342
|
+
catch (_) {
|
|
2343
|
+
return null;
|
|
2344
|
+
}
|
|
2345
|
+
};
|
|
2328
2346
|
|
|
2329
2347
|
const REGIONS_URL$1 = '/api/v1/regions';
|
|
2330
2348
|
function useRegions() {
|
|
@@ -2484,15 +2502,10 @@
|
|
|
2484
2502
|
const Header = JSX(({ bgColor = 'bg-white', className = '', showSubMenu = true, ...rest }) => {
|
|
2485
2503
|
const router = useRouter();
|
|
2486
2504
|
const { topItems, logo, defaultLocation, foreignOffices, officesLink } = useSWRResource(projectSettings.SITEMAP || 'sitemap', rest.options?.page?.fallback);
|
|
2487
|
-
const activeTopItem =
|
|
2505
|
+
const activeTopItem = topItems?.find(isTopItemActive(router));
|
|
2488
2506
|
const topMenu = topItems?.map((_, i) => (jsx(TopItem, { active: _ === activeTopItem, "aria-label": _.text, bgColor: bgColor, ..._ }, String(i))));
|
|
2489
2507
|
return (jsx(BlockWrapper, { tag: "header", className: `pt-6 px-20 ${bgColor} ${className} ${showSubMenu && activeTopItem?.items?.length ? 'pb-4' : 'pb-5'}`, ...rest, children: jsxs("div", { className: "container", children: [jsxs("div", { className: "flex items-center", children: [jsx(Logo, { className: "mr-8", bgColor: bgColor, logo: logo }), topMenu, jsx(HeaderSecondaryMenu, { className: "ml-auto", foreignOffices: foreignOffices, defaultLocation: defaultLocation, officesLink: officesLink, bgColor: bgColor })] }), jsx("div", { className: `mt-6 h-px ${BORDER_COLORS[bgColor]}` }), showSubMenu && activeTopItem?.items?.length ? (jsx(HeaderSubMenu, { subItems: activeTopItem.items, bgColor: bgColor })) : null] }) }));
|
|
2490
2508
|
});
|
|
2491
|
-
const getActiveItem = (topItems, router) => {
|
|
2492
|
-
const [firstPortal] = topItems || [];
|
|
2493
|
-
// Если по слагу невозможно понять к какому подпорталу этот слаг относиться, то выбираем первый подпортал.
|
|
2494
|
-
return topItems?.find(isTopItemActive(router)) || firstPortal;
|
|
2495
|
-
};
|
|
2496
2509
|
|
|
2497
2510
|
const ImgBlock = JSX((props) => {
|
|
2498
2511
|
const { className, image, ...rest } = props;
|
|
@@ -2675,12 +2688,12 @@
|
|
|
2675
2688
|
${getTileMinHeight(className)}
|
|
2676
2689
|
${VersionStyleMap[version]}
|
|
2677
2690
|
${className}`, ...rest, children: [jsxs(BaseTile, { className: "z-10", title: title ? (jsx(Heading, { headingType: headingType, as: "h3", title: title, className: `whitespace-pre-wrap mb-7 w-full
|
|
2678
|
-
${textColorClass} ${AlignText[alignTitle]}` })) : null, buttons: buttons?.length ? (jsx(ButtonSection, { buttons: buttonsWithClass, className: "flex gap-4 mt-8", ...rest })) : null, children: [renderDescription$
|
|
2691
|
+
${textColorClass} ${AlignText[alignTitle]}` })) : null, buttons: buttons?.length ? (jsx(ButtonSection, { buttons: buttonsWithClass, className: "flex gap-4 mt-8", ...rest })) : null, children: [renderDescription$2(description), jsxs("div", { className: "flex flex-1 items-center mb-3", children: [qr?.src ? (jsx("div", { className: `flex justify-center mr-5 bg-white rounded-md ${containerStyle}`, children: jsx(ImgInner, { className: "w-fit", image: qr }) })) : null, renderList$1(version, items)] })] }), image?.src ? (jsx("div", { className: "absolute right-0 bottom-0", children: jsx(ImgInner, { image: image }) })) : null] }));
|
|
2679
2692
|
});
|
|
2680
2693
|
const renderList$1 = (version, items) => {
|
|
2681
2694
|
return items?.length ? (jsx(List, { items: items, itemClassName: "text-l-light mb-2 last:mb-0", version: version })) : (jsx("span", { className: "text-m-light text-secondary-text", 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" }));
|
|
2682
2695
|
};
|
|
2683
|
-
const renderDescription$
|
|
2696
|
+
const renderDescription$2 = (description) => description ? jsx("p", { className: "text-xl-light mb-5 pt-0.5", children: description }) : null;
|
|
2684
2697
|
|
|
2685
2698
|
function renderClusterer(yandexMaps, map, points) {
|
|
2686
2699
|
map.geoObjects.removeAll();
|
|
@@ -3279,26 +3292,53 @@
|
|
|
3279
3292
|
`, children: jsxs("div", { className: "border-0 px-6", children: [jsx("div", { className: `last:pb-0 ${btnTitleClassName}`, children: slide?.title }), jsx("div", { className: `text-secondary-text ${btnDescClassName}`, children: slide?.description })] }) }, String(i)));
|
|
3280
3293
|
}
|
|
3281
3294
|
|
|
3282
|
-
const
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
// picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
|
|
3286
|
-
const BENEFITS_WIDTH = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
3287
|
-
return (jsx("div", { className: `z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline
|
|
3288
|
-
${BENEFITS_WIDTH}`, children: benefits.length ? benefits.map(renderBenefit(version)) : null }));
|
|
3289
|
-
}
|
|
3290
|
-
const renderBenefit = (version = 'primary') => (benefit, i) => {
|
|
3291
|
-
const { label = '', description = '' } = benefit;
|
|
3292
|
-
return [
|
|
3293
|
-
jsx("div", { className: "text-h6", children: label }, `label-${i}`),
|
|
3294
|
-
jsx("div", { className: `text-m-light ${VersionAdditionalStyleMap[version]}`, children: description }, `desc-${i}`),
|
|
3295
|
-
];
|
|
3295
|
+
const DESCRIPTION_STYLE_MAP = {
|
|
3296
|
+
primary: 'text-secondary-text',
|
|
3297
|
+
secondary: 'text-white',
|
|
3296
3298
|
};
|
|
3297
|
-
function renderAdditionalDescription(additionalDescription, image) {
|
|
3299
|
+
function renderAdditionalDescription(additionalDescription, image, version = 'primary') {
|
|
3300
|
+
if (!additionalDescription) {
|
|
3301
|
+
return null;
|
|
3302
|
+
}
|
|
3298
3303
|
// picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
|
|
3299
|
-
const
|
|
3300
|
-
return (jsx("div", { className: `
|
|
3304
|
+
const descriptionWidth = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
3305
|
+
return (jsx("div", { className: `mt-2.5 z-10 ${descriptionWidth}`, children: jsx(Paragraph, { size: "text-m", font: "font-light", color: DESCRIPTION_STYLE_MAP[version], children: additionalDescription }) }));
|
|
3301
3306
|
}
|
|
3307
|
+
|
|
3308
|
+
const MarkdownText = JSX((props) => {
|
|
3309
|
+
const { md = '' } = props;
|
|
3310
|
+
return jsx("div", { className: "md-container", dangerouslySetInnerHTML: { __html: md } });
|
|
3311
|
+
});
|
|
3312
|
+
|
|
3313
|
+
function assertUnreachable(x) {
|
|
3314
|
+
throw new Error(x);
|
|
3315
|
+
}
|
|
3316
|
+
|
|
3317
|
+
const LABEL_STYLE_MAP = {
|
|
3318
|
+
primary: 'text-secondary-text',
|
|
3319
|
+
secondary: 'text-white',
|
|
3320
|
+
};
|
|
3321
|
+
const renderBenefit = (version = 'primary') =>
|
|
3322
|
+
// Linter doesn't understand that switch processes all cases
|
|
3323
|
+
// eslint-disable-next-line consistent-return
|
|
3324
|
+
(benefit, i) => {
|
|
3325
|
+
const { type } = benefit;
|
|
3326
|
+
if (!(type === 'default' || type === 'md')) {
|
|
3327
|
+
return null;
|
|
3328
|
+
}
|
|
3329
|
+
switch (type) {
|
|
3330
|
+
case 'default':
|
|
3331
|
+
return [
|
|
3332
|
+
jsx(Text, { size: "text-h6", children: benefit.label }, `label-${i}`),
|
|
3333
|
+
jsx(Text, { size: "text-m-light", color: LABEL_STYLE_MAP[version], children: benefit.description }, `desc-${i}`),
|
|
3334
|
+
];
|
|
3335
|
+
case 'md':
|
|
3336
|
+
return jsx(MarkdownText, { md: benefit.md });
|
|
3337
|
+
default:
|
|
3338
|
+
assertUnreachable(benefit);
|
|
3339
|
+
}
|
|
3340
|
+
};
|
|
3341
|
+
|
|
3302
3342
|
function renderImage$1(image, isImageOnRightSide) {
|
|
3303
3343
|
if (!image?.src) {
|
|
3304
3344
|
return null;
|
|
@@ -3306,6 +3346,18 @@
|
|
|
3306
3346
|
return (jsx(ImgInner, { className: `absolute ${isImageOnRightSide ? 'right-0' : 'left-0'} bottom-0`, image: image }));
|
|
3307
3347
|
}
|
|
3308
3348
|
|
|
3349
|
+
const ProductTile = JSX(({ className = '', title, headlineVersion = 'S', description, additionalDescription, benefits = [], buttons, image, isImageOnRightSide = true, version = 'primary', ...rest }) => (jsxs(BlockWrapper, { className: `overflow-hidden font-sans p-9 box-border relative min-h-[364px]
|
|
3350
|
+
${VersionStyleMap[version]} ${getTileRightPadding(className)} ${className}`, ...rest, children: [jsxs("div", { className: `flex flex-col ${isImageOnRightSide ? '' : 'items-end'}`, children: [jsx(Headline, { className: `!p-0 !bg-transparent z-10 ${title || description ? 'mb-3.5' : ''}`, as: "h2", title: title, description: description, headlineVersion: headlineVersion, bgColorHeadline: version, align: "left", ...rest }), renderBenefits(benefits, version, image), renderAdditionalDescription(additionalDescription, image), buttons?.length ? (jsx(ButtonSection, { buttons: buttons, className: "mt-5 gap-4 z-10 text-l" })) : null] }), renderImage$1(image, isImageOnRightSide)] })));
|
|
3351
|
+
function renderBenefits(benefits, version, image) {
|
|
3352
|
+
if (!benefits.length) {
|
|
3353
|
+
return null;
|
|
3354
|
+
}
|
|
3355
|
+
// picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
|
|
3356
|
+
const benefitsWidth = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
3357
|
+
return (jsx("div", { className: `z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline
|
|
3358
|
+
${benefitsWidth}`, children: benefits.length ? benefits.map(renderBenefit(version)) : null }));
|
|
3359
|
+
}
|
|
3360
|
+
|
|
3309
3361
|
const PromoTile = JSX(({ className = '', title = 'Акции и спецпредложения', date, description, buttons = [], version = 'primary', ...rest }) => (jsx(BlockWrapper, { className: `bg-white text-primary-text font-sans p-9 box-border ${className} ${VersionStyleMap[version]} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, ...rest, children: jsx(BaseTile, { title: title ? (jsx(Headline, { title: title, className: `!p-0 max-w-[600px]`, headlineVersion: getTileHeadingType(className), bgColorHeadline: version, align: "left", as: "h2", ...rest })) : null, buttons: buttons?.length ? jsx(ButtonSection, { buttons: buttons, className: "flex gap-3" }) : null, children: jsxs("div", { className: "mt-1.5", children: [date ? jsx("div", { className: "text-s mb-2", children: formatDate(date) }) : null, jsx("div", { className: "text-l", children: description })] }) }) })));
|
|
3310
3362
|
function formatDate(date) {
|
|
3311
3363
|
const dateObj = new Date(date);
|
|
@@ -3564,10 +3616,6 @@
|
|
|
3564
3616
|
const renderStepIcon = (styleMap, version) => ({ icon }, i) => (jsx("div", { className: "flex flex-col items-center text-center", children: jsx("div", { className: `h-[100px] w-[100px] min-w-[100px] min-h-[100px] rounded-full p-[26px] box-border z-10 flex justify-center items-center
|
|
3565
3617
|
${styleMap.iconBackground} ${styleMap.title}`, children: checkIsIconRenderable(icon) ? (jsx(ImgInner, { image: getIconWithVersion(icon || {}, version), width: "48", height: "48", asSVG: true })) : (jsx("span", { className: `text-h4 ${styleMap.iconText}`, children: i + 1 })) }) }, String(i)));
|
|
3566
3618
|
|
|
3567
|
-
function assertUnreachable(x) {
|
|
3568
|
-
throw new Error(x);
|
|
3569
|
-
}
|
|
3570
|
-
|
|
3571
3619
|
const LINK_CLASSES = 'h-12 flex-1 flex items-center justify-center cursor-pointer';
|
|
3572
3620
|
const ACTIVE_LINK_CLASSES = 'bg-primary-main';
|
|
3573
3621
|
const INACTIVE_LINK_CLASSES = 'group bg-white';
|
|
@@ -3591,9 +3639,9 @@
|
|
|
3591
3639
|
const count = tab.ref && page?.blocks
|
|
3592
3640
|
? page.blocks.filter((block) => block?.labels?.includes(tab.ref)).length
|
|
3593
3641
|
: 0;
|
|
3594
|
-
return (jsx("div", { className: `${LINK_CLASSES} ${active ? ACTIVE_LINK_CLASSES : INACTIVE_LINK_CLASSES}`, role: "tab", "aria-selected": active, onClick: () => onClick(tab), children: jsxs("div", { className: "flex flex-1 items-center justify-center", children: [tab?.title ? renderTitle$
|
|
3642
|
+
return (jsx("div", { className: `${LINK_CLASSES} ${active ? ACTIVE_LINK_CLASSES : INACTIVE_LINK_CLASSES}`, role: "tab", "aria-selected": active, onClick: () => onClick(tab), children: jsxs("div", { className: "flex flex-1 items-center justify-center", children: [tab?.title ? renderTitle$2(tab.title, active) : null, showCounter && count ? renderCount(count, active) : null] }) }, String(i)));
|
|
3595
3643
|
};
|
|
3596
|
-
const renderTitle$
|
|
3644
|
+
const renderTitle$2 = (title, active) => (jsx("h3", { className: `${TEXT_CLASSES} ${active ? ACTIVE_TEXT_CLASSES : INACTIVE_TEXT_CLASSES}`, children: title }));
|
|
3597
3645
|
const renderCount = (count, active) => (jsx("div", { className: `${BADGE_CLASSES} ${active ? ACTIVE_BADGE_CLASSES : INACTIVE_BADGE_CLASSES}`, children: count }));
|
|
3598
3646
|
|
|
3599
3647
|
const renderTab = ({ page, currentTab, showCounter, onClick }) =>
|
|
@@ -3802,12 +3850,12 @@
|
|
|
3802
3850
|
});
|
|
3803
3851
|
const rows = (rowData || []).map((row, i) => (jsx(TariffsTableRow, { row: row, activeIndex: activeIndex, rowIdx: i, ...rest }, String(i))));
|
|
3804
3852
|
const [visibleRows, hiddenRows] = hiddenRowsNum > 0 ? [rows.slice(0, -hiddenRowsNum), rows.slice(-hiddenRowsNum)] : [rows, []];
|
|
3805
|
-
return (jsxs(BlockWrapper, { className: `bg-white font-sans p-12 overflow-hidden text-primary-text relative ${itemCount > 1 ? 'pr-0' : ''} ${className}`, ...rest, children: [renderTitle({ title, description }), renderDescription(description), hiddenRowsNum > 0 ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs(Wrapper, { controls: controls, children: [visibleRows, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenRows })] })), renderFoldButton: renderDefaultFoldButton })) : (jsx(Wrapper, { controls: controls, children: rows }))] }));
|
|
3853
|
+
return (jsxs(BlockWrapper, { className: `bg-white font-sans p-12 overflow-hidden text-primary-text relative ${itemCount > 1 ? 'pr-0' : ''} ${className}`, ...rest, children: [renderTitle$1({ title, description }), renderDescription$1(description), hiddenRowsNum > 0 ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs(Wrapper, { controls: controls, children: [visibleRows, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenRows })] })), renderFoldButton: renderDefaultFoldButton })) : (jsx(Wrapper, { controls: controls, children: rows }))] }));
|
|
3806
3854
|
});
|
|
3807
|
-
function renderTitle({ title, description }) {
|
|
3855
|
+
function renderTitle$1({ title, description }) {
|
|
3808
3856
|
return title ? (jsx(Heading, { headingType: "h3", className: `text-center ${description ? 'mb-2.5' : 'mb-8'}`, title: title })) : null;
|
|
3809
3857
|
}
|
|
3810
|
-
function renderDescription(description) {
|
|
3858
|
+
function renderDescription$1(description) {
|
|
3811
3859
|
return description ? jsx("div", { className: "mb-9 text-center text-l", children: description }) : null;
|
|
3812
3860
|
}
|
|
3813
3861
|
const Wrapper = JSX(({ children, controls }) => {
|
|
@@ -3819,36 +3867,19 @@
|
|
|
3819
3867
|
})] }), isScrollAvailable ? (jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white" })) : null] }));
|
|
3820
3868
|
});
|
|
3821
3869
|
|
|
3822
|
-
const
|
|
3823
|
-
primary:
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
title: 'text-primary-text',
|
|
3827
|
-
description: 'text-secondary-text',
|
|
3828
|
-
},
|
|
3829
|
-
secondary: {
|
|
3830
|
-
background: 'bg-primary-main',
|
|
3831
|
-
icon: 'bg-white text-primary-main',
|
|
3832
|
-
title: 'text-white',
|
|
3833
|
-
description: 'text-white',
|
|
3834
|
-
},
|
|
3835
|
-
'secondary-light': {
|
|
3836
|
-
background: 'bg-primary-main/10',
|
|
3837
|
-
icon: 'bg-primary-main text-white',
|
|
3838
|
-
title: 'text-primary-text',
|
|
3839
|
-
description: 'text-secondary-text',
|
|
3840
|
-
},
|
|
3870
|
+
const textBlockBack = {
|
|
3871
|
+
primary: 'bg-white',
|
|
3872
|
+
secondary: 'bg-primary-main',
|
|
3873
|
+
'secondary-light': 'bg-primary-main/10',
|
|
3841
3874
|
};
|
|
3842
|
-
const TextBlock = JSX(({ title, description, blockVersion = 'primary', iconVersion, image,
|
|
3843
|
-
const
|
|
3844
|
-
return (jsxs(BlockWrapper, { className: `
|
|
3875
|
+
const TextBlock = JSX(({ className = '', title, description, blockVersion = 'primary', iconVersion, image, ...rest }) => {
|
|
3876
|
+
const isSecondaryBlock = blockVersion === 'secondary';
|
|
3877
|
+
return (jsxs(BlockWrapper, { className: `px-9 py-4 flex gap-3 ${textBlockBack[blockVersion]} ${className}`, ...rest, children: [iconVersion === 'small' ? (jsx("div", { className: "mt-1", children: renderIcon(isSecondaryBlock) })) : null, iconVersion === 'big' ? renderImage(image) : null, jsxs("div", { children: [title ? renderTitle(title, isSecondaryBlock) : null, description ? (jsx("div", { className: "mt-1", children: renderDescription(description, isSecondaryBlock) })) : null] })] }));
|
|
3845
3878
|
});
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
}
|
|
3849
|
-
|
|
3850
|
-
return image?.src ? jsx(ImgInner, { className: "pt-0.5 pr-3", image: image }) : null;
|
|
3851
|
-
}
|
|
3879
|
+
const renderIcon = (isSecondaryBlock) => (jsx("div", { className: `rounded-full h-4 w-4 text-center text-xs-light ${isSecondaryBlock ? 'bg-white text-primary-main' : 'bg-primary-main text-white'}`, children: "i" }));
|
|
3880
|
+
const renderImage = (image) => (image?.src ? jsx(ImgInner, { image: image }) : null);
|
|
3881
|
+
const renderTitle = (title, isSecondaryBlock) => (jsx(Text, { size: "text-l", font: "font-medium", color: isSecondaryBlock ? 'text-white' : 'text-primary-text', children: title }));
|
|
3882
|
+
const renderDescription = (description, isSecondaryBlock) => (jsx(Paragraph, { size: "text-s", color: isSecondaryBlock ? 'text-white' : 'text-secondary-text', children: description }));
|
|
3852
3883
|
|
|
3853
3884
|
const Tags = JSX((props) => {
|
|
3854
3885
|
const { tags, className = '' } = props;
|
|
@@ -4093,7 +4124,7 @@
|
|
|
4093
4124
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
|
|
4094
4125
|
}
|
|
4095
4126
|
|
|
4096
|
-
const packageVersion = "0.6.
|
|
4127
|
+
const packageVersion = "0.6.44";
|
|
4097
4128
|
|
|
4098
4129
|
exports.Blocks = Blocks;
|
|
4099
4130
|
exports.ContentPage = ContentPage;
|