@redneckz/wildless-cms-uni-blocks 0.2.85 → 0.2.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/blocks.schema.json +1 -945
- package/bundle/bundle.umd.js +194 -195
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Accordion/Accordion.js +1 -1
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Accordion/AccordionContent.d.ts +29 -10
- package/dist/components/Accordion/AccordionItem.d.ts +2 -2
- package/dist/components/Accordion/AccordionItem.js +5 -6
- package/dist/components/Accordion/AccordionItem.js.map +1 -1
- package/dist/components/BaseTile/BaseTile.d.ts +2 -2
- package/dist/components/BaseTile/BaseTile.js +1 -1
- package/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/dist/components/BaseTile/BaseTileProps.d.ts +31 -0
- package/dist/{model/SitemapContent.js → components/BaseTile/BaseTileProps.js} +1 -1
- package/dist/components/BaseTile/BaseTileProps.js.map +1 -0
- package/dist/components/BenefitsBlock/BenefitsBlock.d.ts +1 -1
- package/dist/components/BenefitsBlock/BenefitsBlock.js +2 -1
- package/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/dist/components/BenefitsBlock/BenefitsBlockContent.d.ts +14 -1
- package/dist/components/BlockContent.d.ts +4 -1
- package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +45 -2
- package/dist/components/ComparisonTable/HeaderCell.d.ts +2 -2
- package/dist/components/ContentPage/ContentPage.d.ts +3 -2
- package/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/dist/components/CreditCalculator/CreditCalculatorContent.d.ts +4 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTile.d.ts +1 -1
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +4 -0
- package/dist/components/Footer/Contacts.js +2 -2
- package/dist/components/Footer/Contacts.js.map +1 -1
- package/dist/components/Footer/FooterContent.d.ts +35 -9
- package/dist/components/Footer/FooterLink.d.ts +2 -2
- package/dist/components/Footer/HorizontalNavigation.js.map +1 -1
- package/dist/components/Footer/Sitemap.d.ts +1 -1
- package/dist/components/Footer/Sitemap.js +1 -1
- package/dist/components/Footer/Sitemap.js.map +1 -1
- package/dist/components/Footer/SocialMedia.d.ts +2 -2
- package/dist/components/Footer/TextInformation.js.map +1 -1
- package/dist/components/Gallery/GalleryContent.d.ts +13 -0
- package/dist/components/Header/HeaderContent.d.ts +10 -2
- package/dist/components/Header/isSubItemActive.d.ts +2 -2
- package/dist/components/Header/isSubItemActive.js.map +1 -1
- package/dist/components/Header/isTopItemActive.d.ts +2 -2
- package/dist/components/Header/isTopItemActive.js.map +1 -1
- package/dist/components/MiniGallery/MiniGallery.d.ts +3 -3
- package/dist/components/MiniGallery/MiniGalleryContent.d.ts +6 -0
- package/dist/components/MiniGallery/MiniGalleryContent.js +2 -0
- package/dist/components/MiniGallery/MiniGalleryContent.js.map +1 -0
- package/dist/components/MobileAppTile/MobileAppTileContent.d.ts +11 -2
- package/dist/components/Placeholder/PlaceholderContent.d.ts +3 -0
- package/dist/components/ProductBlock/ProductBlock.mobile.d.ts +2 -2
- package/dist/components/ProductBlock/ProductBlock.mobile.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +10 -5
- package/dist/components/ProductBlock/ProductBlockInner.d.ts +2 -2
- package/dist/components/ProductBlock/ProductBlockInner.js +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/dist/components/ProductGallery/ProductGallery.d.ts +1 -1
- package/dist/components/ProductGallery/ProductGallery.js.map +1 -1
- package/dist/components/ProductGallery/ProductGalleryContent.d.ts +17 -2
- package/dist/components/ProductTile/ProductTileContent.d.ts +6 -2
- package/dist/components/PromoTile/PromoTileContent.d.ts +6 -2
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +13 -0
- package/dist/components/TextBlock/TextBlockContent.d.ts +13 -0
- package/dist/components/Tile/TileContent.d.ts +5 -2
- package/dist/hooks/useLink.d.ts +3 -3
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.js +10 -10
- 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 +4 -0
- package/dist/model/ButtonVersion.d.ts +4 -0
- package/dist/model/LinkProps.d.ts +21 -0
- package/dist/model/{LinkContent.js → LinkProps.js} +1 -1
- package/dist/model/LinkProps.js.map +1 -0
- package/dist/model/Picture.d.ts +11 -0
- package/dist/model/SitemapProps.d.ts +13 -0
- package/dist/{components/BaseTile/BaseTileContent.js → model/SitemapProps.js} +1 -1
- package/dist/model/SitemapProps.js.map +1 -0
- package/dist/types.d.ts +2 -2
- package/dist/ui-kit/Breadcrumb.d.ts +2 -2
- package/dist/ui-kit/Button/Button.d.ts +6 -3
- package/dist/ui-kit/Button/Button.js.map +1 -1
- package/dist/ui-kit/Button/ButtonProps.d.ts +15 -12
- package/dist/ui-kit/Icon/IconProps.d.ts +49 -18
- package/dist/ui-kit/Icon/IconProps.js +21 -18
- package/dist/ui-kit/Icon/IconProps.js.map +1 -1
- package/dist/ui-kit/TopItem/TopItem.d.ts +2 -2
- package/lib/common.css +1 -1
- package/lib/components/Accordion/Accordion.js +1 -1
- package/lib/components/Accordion/Accordion.js.map +1 -1
- package/lib/components/Accordion/AccordionContent.d.ts +29 -10
- package/lib/components/Accordion/AccordionItem.d.ts +2 -2
- package/lib/components/Accordion/AccordionItem.js +5 -6
- package/lib/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/components/BaseTile/BaseTile.d.ts +2 -2
- package/lib/components/BaseTile/BaseTile.js +1 -1
- package/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/lib/components/BaseTile/BaseTileProps.d.ts +31 -0
- package/lib/components/BaseTile/BaseTileProps.js +2 -0
- package/lib/components/BaseTile/BaseTileProps.js.map +1 -0
- package/lib/components/BenefitsBlock/BenefitsBlock.d.ts +1 -1
- package/lib/components/BenefitsBlock/BenefitsBlock.js +2 -1
- package/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/lib/components/BenefitsBlock/BenefitsBlockContent.d.ts +14 -1
- package/lib/components/BlockContent.d.ts +4 -1
- package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +45 -2
- package/lib/components/ComparisonTable/HeaderCell.d.ts +2 -2
- package/lib/components/ContentPage/ContentPage.d.ts +3 -2
- package/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/lib/components/CreditCalculator/CreditCalculatorContent.d.ts +4 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTile.d.ts +1 -1
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +4 -0
- package/lib/components/Footer/Contacts.js +2 -2
- package/lib/components/Footer/Contacts.js.map +1 -1
- package/lib/components/Footer/FooterContent.d.ts +35 -9
- package/lib/components/Footer/FooterLink.d.ts +2 -2
- package/lib/components/Footer/HorizontalNavigation.js.map +1 -1
- package/lib/components/Footer/Sitemap.d.ts +1 -1
- package/lib/components/Footer/Sitemap.js +1 -1
- package/lib/components/Footer/Sitemap.js.map +1 -1
- package/lib/components/Footer/SocialMedia.d.ts +2 -2
- package/lib/components/Footer/TextInformation.js.map +1 -1
- package/lib/components/Gallery/GalleryContent.d.ts +13 -0
- package/lib/components/Header/HeaderContent.d.ts +10 -2
- package/lib/components/Header/isSubItemActive.d.ts +2 -2
- package/lib/components/Header/isSubItemActive.js.map +1 -1
- package/lib/components/Header/isTopItemActive.d.ts +2 -2
- package/lib/components/Header/isTopItemActive.js.map +1 -1
- package/lib/components/MiniGallery/MiniGallery.d.ts +3 -3
- package/lib/components/MiniGallery/MiniGalleryContent.d.ts +6 -0
- package/lib/components/MiniGallery/MiniGalleryContent.js +2 -0
- package/lib/components/MiniGallery/MiniGalleryContent.js.map +1 -0
- package/lib/components/MobileAppTile/MobileAppTileContent.d.ts +11 -2
- package/lib/components/Placeholder/PlaceholderContent.d.ts +3 -0
- package/lib/components/ProductBlock/ProductBlock.mobile.d.ts +2 -2
- package/lib/components/ProductBlock/ProductBlock.mobile.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +10 -5
- package/lib/components/ProductBlock/ProductBlockInner.d.ts +2 -2
- package/lib/components/ProductBlock/ProductBlockInner.js +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/lib/components/ProductGallery/ProductGallery.d.ts +1 -1
- package/lib/components/ProductGallery/ProductGallery.js.map +1 -1
- package/lib/components/ProductGallery/ProductGalleryContent.d.ts +17 -2
- package/lib/components/ProductTile/ProductTileContent.d.ts +6 -2
- package/lib/components/PromoTile/PromoTileContent.d.ts +6 -2
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +13 -0
- package/lib/components/TextBlock/TextBlockContent.d.ts +13 -0
- package/lib/components/Tile/TileContent.d.ts +5 -2
- package/lib/hooks/useLink.d.ts +3 -3
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/index.d.ts +12 -12
- package/lib/index.js +5 -5
- 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 +4 -0
- package/lib/model/ButtonVersion.d.ts +4 -0
- package/lib/model/LinkProps.d.ts +21 -0
- package/lib/model/LinkProps.js +2 -0
- package/lib/model/LinkProps.js.map +1 -0
- package/lib/model/Picture.d.ts +11 -0
- package/lib/model/SitemapProps.d.ts +13 -0
- package/lib/model/SitemapProps.js +2 -0
- package/lib/model/SitemapProps.js.map +1 -0
- package/lib/types.d.ts +2 -2
- package/lib/ui-kit/Breadcrumb.d.ts +2 -2
- package/lib/ui-kit/Button/Button.d.ts +6 -3
- package/lib/ui-kit/Button/Button.js.map +1 -1
- package/lib/ui-kit/Button/ButtonProps.d.ts +15 -12
- package/lib/ui-kit/Icon/IconProps.d.ts +49 -18
- package/lib/ui-kit/Icon/IconProps.js +21 -18
- package/lib/ui-kit/Icon/IconProps.js.map +1 -1
- package/lib/ui-kit/TopItem/TopItem.d.ts +2 -2
- package/package.json +2 -22
- package/src/components/Accordion/Accordion.example.json +74 -0
- package/src/components/Accordion/Accordion.fixture.tsx +1 -16
- package/src/components/Accordion/Accordion.tsx +1 -1
- package/src/components/Accordion/AccordionContent.ts +31 -11
- package/src/components/Accordion/AccordionItem.tsx +10 -10
- package/src/components/BaseTile/BaseTile.tsx +4 -5
- package/src/components/BaseTile/BaseTileProps.ts +33 -0
- package/src/components/BenefitsBlock/BenefitsBlock.example.json +13 -0
- package/src/components/BenefitsBlock/BenefitsBlock.tsx +3 -2
- package/src/components/BenefitsBlock/BenefitsBlockContent.ts +14 -1
- package/src/components/BlockContent.ts +4 -1
- package/src/components/ComparisonTable/ComparisonTable.example.json +84 -0
- package/src/components/ComparisonTable/ComparisonTableContent.ts +46 -3
- package/src/components/ComparisonTable/HeaderCell.tsx +2 -2
- package/src/components/ContentPage/ContentPage.tsx +7 -5
- package/src/components/CreditCalculator/CreditCalculatorContent.ts +4 -0
- package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +2 -2
- package/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +4 -0
- package/src/components/Footer/Contacts.tsx +2 -2
- package/src/components/Footer/FooterContent.ts +36 -9
- package/src/components/Footer/FooterLink.ts +2 -2
- package/src/components/Footer/HorizontalNavigation.tsx +2 -2
- package/src/components/Footer/Sitemap.tsx +5 -5
- package/src/components/Footer/SocialMedia.tsx +2 -2
- package/src/components/Footer/TextInformation.tsx +2 -2
- package/src/components/Gallery/Gallery.example.json +71 -0
- package/src/components/Gallery/GalleryContent.ts +13 -0
- package/src/components/Header/HeaderContent.ts +10 -2
- package/src/components/Header/isSubItemActive.ts +3 -3
- package/src/components/Header/isTopItemActive.ts +3 -3
- package/src/components/MiniGallery/MiniGallery.example.json +61 -0
- package/src/components/MiniGallery/MiniGallery.tsx +3 -3
- package/src/components/MiniGallery/MiniGalleryContent.ts +6 -0
- package/src/components/MobileAppTile/MobileAppTile.example.json +20 -0
- package/src/components/MobileAppTile/MobileAppTileContent.ts +11 -2
- package/src/components/Placeholder/PlaceholderContent.ts +3 -0
- package/src/components/ProductBlock/ProductBlock.example.json +17 -0
- package/src/components/ProductBlock/ProductBlock.mobile.tsx +3 -3
- package/src/components/ProductBlock/ProductBlockContent.ts +10 -5
- package/src/components/ProductBlock/ProductBlockInner.tsx +4 -4
- package/src/components/ProductGallery/ProductGallery.example.json +21 -0
- package/src/components/ProductGallery/ProductGallery.tsx +3 -3
- package/src/components/ProductGallery/ProductGalleryContent.ts +17 -2
- package/src/components/ProductTile/ProductTile.example.json +30 -0
- package/src/components/ProductTile/ProductTileContent.ts +6 -2
- package/src/components/PromoTile/PromoTile.example.json +13 -0
- package/src/components/PromoTile/PromoTileContent.ts +6 -2
- package/src/components/StepsBlock/StepsBlock.example.json +17 -0
- package/src/components/StepsBlock/StepsBlockContent.ts +13 -0
- package/src/components/TextBlock/TextBlock.example.json +6 -0
- package/src/components/TextBlock/TextBlockContent.ts +14 -0
- package/src/components/Tile/Tile.example.json +18 -0
- package/src/components/Tile/TileContent.ts +5 -2
- package/src/hooks/useLink.ts +2 -2
- package/src/index.ts +14 -21
- package/src/mergeTopItems.ts +5 -5
- package/src/model/BlockVersion.ts +4 -0
- package/src/model/ButtonVersion.ts +4 -0
- package/src/model/LinkProps.ts +22 -0
- package/src/model/Picture.ts +11 -0
- package/src/model/SitemapProps.ts +15 -0
- package/src/types.ts +2 -2
- package/src/ui-kit/Breadcrumb.tsx +2 -2
- package/src/ui-kit/Button/Button.tsx +7 -3
- package/src/ui-kit/Button/ButtonProps.ts +16 -13
- package/src/ui-kit/Icon/IconProps.ts +35 -4
- package/src/ui-kit/TopItem/TopItem.tsx +2 -2
- package/dist/components/BaseTile/BaseTileContent.d.ts +0 -13
- package/dist/components/BaseTile/BaseTileContent.js.map +0 -1
- package/dist/model/LinkContent.d.ts +0 -5
- package/dist/model/LinkContent.js.map +0 -1
- package/dist/model/SitemapContent.d.ts +0 -7
- package/dist/model/SitemapContent.js.map +0 -1
- package/lib/components/BaseTile/BaseTileContent.d.ts +0 -13
- package/lib/components/BaseTile/BaseTileContent.js +0 -2
- package/lib/components/BaseTile/BaseTileContent.js.map +0 -1
- package/lib/model/LinkContent.d.ts +0 -5
- package/lib/model/LinkContent.js +0 -2
- package/lib/model/LinkContent.js.map +0 -1
- package/lib/model/SitemapContent.d.ts +0 -7
- package/lib/model/SitemapContent.js +0 -2
- package/lib/model/SitemapContent.js.map +0 -1
- package/src/components/BaseTile/BaseTileContent.ts +0 -14
- package/src/model/LinkContent.ts +0 -5
- package/src/model/SitemapContent.ts +0 -9
package/bundle/bundle.umd.js
CHANGED
|
@@ -38,36 +38,36 @@
|
|
|
38
38
|
return Component._tmpl;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
get CDN() {
|
|
68
|
-
return this._.CDN;
|
|
41
|
+
const getGeolocation = async () => new Promise((resolve) => navigator.geolocation.getCurrentPosition(({ coords }) => resolve(coords)));
|
|
42
|
+
|
|
43
|
+
function DaDataAPI(baseURL = '') {
|
|
44
|
+
async function getFetcherAddress() {
|
|
45
|
+
if (!('geolocation' in navigator)) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
const coords = await getGeolocation();
|
|
50
|
+
const response = await fetch(`${baseURL}/geolocate`, {
|
|
51
|
+
method: 'POST',
|
|
52
|
+
mode: 'cors',
|
|
53
|
+
body: JSON.stringify({
|
|
54
|
+
lat: coords.latitude,
|
|
55
|
+
lon: coords.longitude,
|
|
56
|
+
count: 1,
|
|
57
|
+
}),
|
|
58
|
+
});
|
|
59
|
+
const data = (await response.json());
|
|
60
|
+
return data?.suggestions?.[0]?.data?.city;
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
console.error(e);
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
69
66
|
}
|
|
70
|
-
|
|
67
|
+
return {
|
|
68
|
+
getFetcherAddress,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
71
|
|
|
72
72
|
const AUTH_PREFIX = 'guest';
|
|
73
73
|
const STORAGE_KEY = 'likesToken';
|
|
@@ -185,93 +185,36 @@
|
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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',
|
|
188
|
+
const projectSettings = new (class {
|
|
189
|
+
_ = {
|
|
190
|
+
PROD_BRANCH: 'master',
|
|
191
|
+
FORCED_DRAFT_FLOW: false,
|
|
233
192
|
};
|
|
234
|
-
|
|
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 listStyleMap = {
|
|
243
|
-
primary: 'bg-primary-main',
|
|
244
|
-
secondary: 'bg-white',
|
|
245
|
-
};
|
|
246
|
-
const textStyleMap = {
|
|
247
|
-
primary: 'text-primary-text',
|
|
248
|
-
secondary: 'text-white',
|
|
249
|
-
};
|
|
250
|
-
const BlockItem = JSX(({ className, text, children, version = 'primary' }) => {
|
|
251
|
-
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 })] }));
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
const buttonStyleMap = {
|
|
255
|
-
primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
|
|
256
|
-
secondary: 'text-primary-main bg-secondary-light hover:bg-secondary-hover active:bg-secondary-active',
|
|
257
|
-
};
|
|
258
|
-
const buttonDisabledStyleMap = {
|
|
259
|
-
primary: 'bg-secondary-dark text-secondary-text',
|
|
260
|
-
secondary: 'bg-secondary-light text-secondary-text',
|
|
261
|
-
};
|
|
262
|
-
const styleButton = 'inline-block text-center font-sans select-none';
|
|
263
|
-
const Button = JSX(({ className, text, aboveText, appendLeft, href, target, onClick, children, disabled, rounded, version = 'none', ariaLabel, ...rest }) => {
|
|
264
|
-
const buttonInner = children ?? (jsx(ButtonInner, { text: text, aboveText: aboveText, appendLeft: appendLeft, rounded: rounded }));
|
|
265
|
-
if (disabled) {
|
|
266
|
-
return (jsx("div", { role: "button", "aria-disabled": "true", "aria-label": ariaLabel, tabIndex: "-1", className: `${styleButton} ${buttonDisabledStyleMap[version] || ''} ${rounded ? 'rounded-full' : 'rounded-md'} ${className || ''}`, children: buttonInner }));
|
|
193
|
+
setup(_) {
|
|
194
|
+
this._ = _;
|
|
267
195
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
196
|
+
get TEST_BRANCH() {
|
|
197
|
+
return this._.TEST_BRANCH;
|
|
198
|
+
}
|
|
199
|
+
get RC_BRANCH() {
|
|
200
|
+
return this._.RC_BRANCH;
|
|
201
|
+
}
|
|
202
|
+
get PROD_BRANCH() {
|
|
203
|
+
return this._.PROD_BRANCH;
|
|
204
|
+
}
|
|
205
|
+
get FORCED_DRAFT_FLOW() {
|
|
206
|
+
return this._.FORCED_DRAFT_FLOW;
|
|
207
|
+
}
|
|
208
|
+
get ENABLE_ASSIST() {
|
|
209
|
+
return this._.ENABLE_ASSIST;
|
|
210
|
+
}
|
|
211
|
+
get SITEMAP() {
|
|
212
|
+
return this._.SITEMAP;
|
|
213
|
+
}
|
|
214
|
+
get CDN() {
|
|
215
|
+
return this._.CDN;
|
|
216
|
+
}
|
|
217
|
+
})();
|
|
275
218
|
|
|
276
219
|
const Icon = JSX(({ className, name, alt = `Icon ${name}`, title = alt, asSVG, ...imgProps }) => {
|
|
277
220
|
const href = `${projectSettings.CDN || ''}icons/${name}.svg`;
|
|
@@ -281,13 +224,6 @@
|
|
|
281
224
|
return (jsx("img", { className: className, src: href, alt: alt, title: title, ...imgProps, "aria-hidden": "true" }));
|
|
282
225
|
});
|
|
283
226
|
|
|
284
|
-
const Img = JSX(({ className, image }) => (jsxs("picture", { className: `${className || ''}`, children: [image.sources?.length
|
|
285
|
-
? image.sources.map(({ src, format }, index) => (jsx("source", { srcSet: src, type: formatToMimeType(format) }, `${index}_${src}`)))
|
|
286
|
-
: null, jsx("img", { src: image.src, alt: image.alt || image.title, title: image.title, ...image?.size })] })));
|
|
287
|
-
function formatToMimeType(format) {
|
|
288
|
-
return format ? `image/${String(format)}` : undefined;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
227
|
var SizeTableClass;
|
|
292
228
|
(function (SizeTableClass) {
|
|
293
229
|
SizeTableClass["XL"] = "text-title-lg";
|
|
@@ -302,6 +238,13 @@
|
|
|
302
238
|
});
|
|
303
239
|
const getClasses = (...classes) => classes.filter(Boolean).join(' ');
|
|
304
240
|
|
|
241
|
+
const BenefitsBlock = JSX(({ className, title, benefits }) => {
|
|
242
|
+
return (jsxs("section", { className: `font-sans text-primary-text bg-white p-12 pb-2 flex flex-col items-center ${className || ''}`, children: [title ? jsx(Title, { className: "font-medium m-0 max-w-[47rem] text-center", children: title }) : null, benefits?.length ? (jsx("div", { className: "grid grid-cols-2 gap-5 mt-9", children: benefits.map(renderStep) })) : null] }));
|
|
243
|
+
});
|
|
244
|
+
const renderStep = (benefit, i) => {
|
|
245
|
+
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)));
|
|
246
|
+
};
|
|
247
|
+
|
|
305
248
|
const MOBILE_URL_PATH = '/mobile';
|
|
306
249
|
const isURL = (href) => href?.includes('//');
|
|
307
250
|
const isHrefActive = (href, router, cmp = (href, baseHref) => href === baseHref) => {
|
|
@@ -365,6 +308,47 @@
|
|
|
365
308
|
};
|
|
366
309
|
}
|
|
367
310
|
|
|
311
|
+
const listStyleMap = {
|
|
312
|
+
primary: 'bg-primary-main',
|
|
313
|
+
secondary: 'bg-white',
|
|
314
|
+
};
|
|
315
|
+
const textStyleMap = {
|
|
316
|
+
primary: 'text-primary-text',
|
|
317
|
+
secondary: 'text-white',
|
|
318
|
+
};
|
|
319
|
+
const BlockItem = JSX(({ className, text, children, version = 'primary' }) => {
|
|
320
|
+
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 })] }));
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
const buttonStyleMap = {
|
|
324
|
+
primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
|
|
325
|
+
secondary: 'text-primary-main bg-secondary-light hover:bg-secondary-hover active:bg-secondary-active',
|
|
326
|
+
};
|
|
327
|
+
const buttonDisabledStyleMap = {
|
|
328
|
+
primary: 'bg-secondary-dark text-secondary-text',
|
|
329
|
+
secondary: 'bg-secondary-light text-secondary-text',
|
|
330
|
+
};
|
|
331
|
+
const styleButton = 'inline-block text-center font-sans select-none';
|
|
332
|
+
const Button = JSX(({ className, text, aboveText, appendLeft, href, target, onClick, children, disabled, rounded, version = 'none', ariaLabel, ...rest }) => {
|
|
333
|
+
const buttonInner = children ?? (jsx(ButtonInner, { text: text, aboveText: aboveText, appendLeft: appendLeft, rounded: rounded }));
|
|
334
|
+
if (disabled) {
|
|
335
|
+
return (jsx("div", { role: "button", "aria-disabled": "true", "aria-label": ariaLabel, tabIndex: "-1", className: `${styleButton} ${buttonDisabledStyleMap[version] || ''} ${rounded ? 'rounded-full' : 'rounded-md'} ${className || ''}`, children: buttonInner }));
|
|
336
|
+
}
|
|
337
|
+
return (jsx("a", { className: `${styleButton} cursor-pointer no-underline ${buttonStyleMap[version] || ''} ${rounded ? 'rounded-full' : 'rounded-md'} ${className || ''}`, href: href, target: target, onClick: onClick, "aria-label": ariaLabel, role: !href ? 'button' : 'link', ...rest, children: buttonInner }));
|
|
338
|
+
});
|
|
339
|
+
const ButtonInner = JSX(({ text, aboveText, appendLeft, rounded }) => {
|
|
340
|
+
const withoutText = !text && !aboveText && Boolean(appendLeft);
|
|
341
|
+
const buttonInnerClasses = `flex items-center justify-center ${withoutText ? 'h-12 w-12 min-h-12 min-w-12' : `px-8 gap-2 ${aboveText ? 'py-2' : 'py-[13px]'}`} ${rounded ? 'rounded-full' : ''}`;
|
|
342
|
+
return (jsxs("div", { className: buttonInnerClasses, children: [appendLeft ? appendLeft : null, !withoutText ? (jsxs("div", { children: [jsx("div", { className: "text-xxs text-left", children: aboveText }), jsx("div", { className: "text-sm font-medium text-left", children: text })] })) : null] }));
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
const Img = JSX(({ className, image }) => (jsxs("picture", { className: `${className || ''}`, children: [image.sources?.length
|
|
346
|
+
? image.sources.map(({ src, format }, index) => (jsx("source", { srcSet: src, type: formatToMimeType(format) }, `${index}_${src}`)))
|
|
347
|
+
: null, jsx("img", { src: image.src, alt: image.alt || image.title, title: image.title, ...image?.size })] })));
|
|
348
|
+
function formatToMimeType(format) {
|
|
349
|
+
return format ? `image/${String(format)}` : undefined;
|
|
350
|
+
}
|
|
351
|
+
|
|
368
352
|
const getColSpan = (className) => {
|
|
369
353
|
const colSpanPrefix = 'col-span-';
|
|
370
354
|
const colSpanStr = className.split(/\s+/).find((_) => _.startsWith(colSpanPrefix));
|
|
@@ -421,66 +405,6 @@
|
|
|
421
405
|
}
|
|
422
406
|
}
|
|
423
407
|
|
|
424
|
-
const GOLDEN_RATIO = 1.618;
|
|
425
|
-
const Placeholder = JSX(({ className, context, title }) => {
|
|
426
|
-
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() }) }));
|
|
427
|
-
});
|
|
428
|
-
const renderShimmer = (size = 3) => goldenSequence(100, size)
|
|
429
|
-
.map((_) => Math.floor(_))
|
|
430
|
-
.map(renderShimmerItem);
|
|
431
|
-
const renderShimmerItem = (width = 100, index) => (jsx("div", { style: { width: `${width}%` }, className: "h-4 mt-2 bg-secondary-light" }, String(index)));
|
|
432
|
-
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
433
|
-
|
|
434
|
-
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
435
|
-
const ContentPage = JSX(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
|
|
436
|
-
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 }) }))] }));
|
|
437
|
-
function renderBlock(block, i) {
|
|
438
|
-
const { type } = block;
|
|
439
|
-
if (!(type in blocksRegistry)) {
|
|
440
|
-
console.warn(`No block with "${type}" is registered`);
|
|
441
|
-
}
|
|
442
|
-
const BlockComponent = blocksRegistry[type] || Placeholder;
|
|
443
|
-
return blockDecorator({
|
|
444
|
-
blockClassName: style2className(block.style),
|
|
445
|
-
block,
|
|
446
|
-
render: (props) => {
|
|
447
|
-
const { version, content, blocks } = props.block;
|
|
448
|
-
return (jsx(BlockComponent, { className: props.blockClassName, version: version, context: context, ...content, children: blocks?.length ? blocks.map(renderBlock) : null }, `${type}-${i}`));
|
|
449
|
-
},
|
|
450
|
-
}, `block-${i}`);
|
|
451
|
-
}
|
|
452
|
-
});
|
|
453
|
-
function style2className(style) {
|
|
454
|
-
return style ? style.join(' ') : '';
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
function toMobilePage(contentPage) {
|
|
458
|
-
const blocks = contentPage.blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
|
|
459
|
-
return {
|
|
460
|
-
...contentPage,
|
|
461
|
-
blocks,
|
|
462
|
-
};
|
|
463
|
-
}
|
|
464
|
-
function toMobileBlock(block) {
|
|
465
|
-
const { mobile } = block;
|
|
466
|
-
if (mobile) {
|
|
467
|
-
return {
|
|
468
|
-
...block,
|
|
469
|
-
style: mobile.style?.length ? mobile.style : block.style,
|
|
470
|
-
};
|
|
471
|
-
}
|
|
472
|
-
else {
|
|
473
|
-
return block;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
const BenefitsBlock = JSX(({ className, title, benefits }) => {
|
|
478
|
-
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] }));
|
|
479
|
-
});
|
|
480
|
-
const renderStep = (benefit, i) => {
|
|
481
|
-
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)));
|
|
482
|
-
};
|
|
483
|
-
|
|
484
408
|
const CBR_EXCHANGE_RATE_URL = 'https://www.cbr-xml-daily.ru/daily_json.js';
|
|
485
409
|
const CURRENCY_CODES = ['USD', 'EUR'];
|
|
486
410
|
const CURRENCY_ICONS_MAP = {
|
|
@@ -546,7 +470,7 @@
|
|
|
546
470
|
const { type, text, description } = item;
|
|
547
471
|
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)));
|
|
548
472
|
};
|
|
549
|
-
const renderText = (type, text) => {
|
|
473
|
+
const renderText = (type, text = '') => {
|
|
550
474
|
switch (type) {
|
|
551
475
|
case 'tel':
|
|
552
476
|
return (jsx("a", { className: "font-sans font-medium text-xl text-primary-text no-underline", href: `tel:${formatTel(text)}`, children: text }));
|
|
@@ -565,13 +489,6 @@
|
|
|
565
489
|
});
|
|
566
490
|
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}` })));
|
|
567
491
|
|
|
568
|
-
const cmp = (a) => (b) => a?.href === b?.href;
|
|
569
|
-
const substitute = (items, substitution) => (items || []).map((_) => substitution?.find(cmp(_)) || _);
|
|
570
|
-
const subtract = (minuend, subtrahend) => (minuend || []).filter((_) => !subtrahend?.find(cmp(_)));
|
|
571
|
-
function mergeTopItems(left, right) {
|
|
572
|
-
return substitute(left, right).concat(subtract(right, left));
|
|
573
|
-
}
|
|
574
|
-
|
|
575
492
|
function useSitemap(useAsyncData) {
|
|
576
493
|
const { data } = useAsyncData(sitemapURL(), fetchSitemap);
|
|
577
494
|
return data || {};
|
|
@@ -584,6 +501,13 @@
|
|
|
584
501
|
return `/wcms-resources/${projectSettings.SITEMAP || 'sitemap'}.json`;
|
|
585
502
|
}
|
|
586
503
|
|
|
504
|
+
const cmp = (a) => (b) => a?.href === b?.href;
|
|
505
|
+
const substitute = (items, substitution) => (items || []).map((_) => substitution?.find(cmp(_)) || _);
|
|
506
|
+
const subtract = (minuend, subtrahend) => (minuend || []).filter((_) => !subtrahend?.find(cmp(_)));
|
|
507
|
+
function mergeTopItems(left, right) {
|
|
508
|
+
return substitute(left, right).concat(subtract(right, left));
|
|
509
|
+
}
|
|
510
|
+
|
|
587
511
|
const Sitemap = JSX(({ className, items, context }) => {
|
|
588
512
|
const sitemap = useSitemap(context.useAsyncData);
|
|
589
513
|
const mergedItems = mergeTopItems(sitemap.topItems, items);
|
|
@@ -737,6 +661,16 @@
|
|
|
737
661
|
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" })] }) }));
|
|
738
662
|
});
|
|
739
663
|
|
|
664
|
+
const GOLDEN_RATIO = 1.618;
|
|
665
|
+
const Placeholder = JSX(({ className, context, title }) => {
|
|
666
|
+
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() }) }));
|
|
667
|
+
});
|
|
668
|
+
const renderShimmer = (size = 3) => goldenSequence(100, size)
|
|
669
|
+
.map((_) => Math.floor(_))
|
|
670
|
+
.map(renderShimmerItem);
|
|
671
|
+
const renderShimmerItem = (width = 100, index) => (jsx("div", { style: { width: `${width}%` }, className: "h-4 mt-2 bg-secondary-light" }, String(index)));
|
|
672
|
+
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
673
|
+
|
|
740
674
|
const ProductBlockInner = JSX(({ className, context, title, titleSize, description, benefits, buttons, image, items }) => {
|
|
741
675
|
return (jsxs("div", { className: `flex grow justify-between items-stretch ${className || ''}`, children: [jsxs("div", { className: 'flex flex-col', children: [title && (
|
|
742
676
|
/* TODO Why <Title> is duplicated here? */
|
|
@@ -919,15 +853,14 @@
|
|
|
919
853
|
: `${contentBlock.scrollHeight}px`;
|
|
920
854
|
};
|
|
921
855
|
return (jsxs("li", { className: "border-0 border-b border-solid border-main-divider last:border-b-0", children: [jsxs("button", { className: `border-none bg-transparent px-0 py-5 flex justify-between text-left w-full font-sans text-primary-text
|
|
922
|
-
${hasContent ? 'group cursor-pointer' : ''}`, onClick: handleToggle, children: [jsx("span", { className: `m-0 text-xl pr-2.5 font-medium ${hasContent ? 'group-hover:text-primary-main' : ''}`, children: label }), hasContent ? jsx(Icon, { name: icon, width: "24", height: "24" }) : null] }), hasContent ? (jsx("div", { className: `${isActive ? 'pb-5' : ''} text-sm transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0 `, children: blocks?.length ? blocks.map(
|
|
856
|
+
${hasContent ? 'group cursor-pointer' : ''}`, onClick: handleToggle, children: [jsx("span", { className: `m-0 text-xl pr-2.5 font-medium ${hasContent ? 'group-hover:text-primary-main' : ''}`, children: label }), hasContent ? jsx(Icon, { name: icon, width: "24", height: "24" }) : null] }), hasContent ? (jsx("div", { className: `${isActive ? 'pb-5' : ''} text-sm transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0 `, children: blocks?.length ? blocks.map((block, i) => renderBlock(block, i, context)) : null })) : null] }));
|
|
923
857
|
});
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
if (block.type && block.data && !AccordionBlocks.hasOwnProperty(block.type)) {
|
|
858
|
+
const renderBlock = (block, i, context) => {
|
|
859
|
+
if (!block.type || !block.data || !AccordionBlocks.hasOwnProperty(block.type)) {
|
|
927
860
|
return null;
|
|
928
861
|
}
|
|
929
|
-
const AccordionBlock =
|
|
930
|
-
return (jsx("div", { className: "mb-5 last:mb-0", children: jsx(AccordionBlock, { ...block.data }) }, `
|
|
862
|
+
const AccordionBlock = AccordionBlocks[block.type];
|
|
863
|
+
return (jsx("div", { className: "mb-5 last:mb-0", children: jsx(AccordionBlock, { context: context, ...block.data }) }, `block_${i}`));
|
|
931
864
|
};
|
|
932
865
|
const getContentBlock = (e) => e.target.tagName === 'BUTTON' ? e.target.nextSibling : e.target.parentNode.nextSibling;
|
|
933
866
|
|
|
@@ -1098,6 +1031,72 @@
|
|
|
1098
1031
|
CreditCalculator,
|
|
1099
1032
|
};
|
|
1100
1033
|
|
|
1034
|
+
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() })));
|
|
1035
|
+
const renderLikeIcon = () => {
|
|
1036
|
+
const params = {
|
|
1037
|
+
stroke: '#292D32',
|
|
1038
|
+
strokeLinecap: 'round',
|
|
1039
|
+
strokeLinejoin: 'round',
|
|
1040
|
+
strokeWidth: '1.5',
|
|
1041
|
+
};
|
|
1042
|
+
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" })] }));
|
|
1043
|
+
};
|
|
1044
|
+
|
|
1045
|
+
const LikeControl = JSX(({ className, context }) => {
|
|
1046
|
+
const likeService = context.useLikeService();
|
|
1047
|
+
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 })] }));
|
|
1048
|
+
});
|
|
1049
|
+
|
|
1050
|
+
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
1051
|
+
const ContentPage = JSX(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
|
|
1052
|
+
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 }) }))] }));
|
|
1053
|
+
function renderBlock(block, i) {
|
|
1054
|
+
const { type } = block;
|
|
1055
|
+
if (!(type in blocksRegistry)) {
|
|
1056
|
+
console.warn(`No block with "${type}" is registered`);
|
|
1057
|
+
}
|
|
1058
|
+
const BlockComponent = blocksRegistry[type] || Placeholder;
|
|
1059
|
+
return blockDecorator({
|
|
1060
|
+
blockClassName: style2className(block.style),
|
|
1061
|
+
block,
|
|
1062
|
+
render: (props) => {
|
|
1063
|
+
const { version, content, blocks } = props.block;
|
|
1064
|
+
return (jsx(BlockComponent, { className: props.blockClassName, version: version, context: context, ...content, children: blocks?.length ? blocks.map(renderBlock) : null }, `${type}-${i}`));
|
|
1065
|
+
},
|
|
1066
|
+
}, `block-${i}`);
|
|
1067
|
+
}
|
|
1068
|
+
});
|
|
1069
|
+
function style2className(style) {
|
|
1070
|
+
return style ? style.join(' ') : '';
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
const ContentPageHead = JSX(({ HeadComponent, data, children }) => {
|
|
1074
|
+
const { title, description, keywords, robots, og } = data;
|
|
1075
|
+
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
|
|
1076
|
+
? Object.entries(og).map(([key, value]) => (jsx("meta", { name: `og:${key}`, content: value }, key)))
|
|
1077
|
+
: null, children] }));
|
|
1078
|
+
});
|
|
1079
|
+
|
|
1080
|
+
function toMobilePage(contentPage) {
|
|
1081
|
+
const blocks = contentPage.blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
|
|
1082
|
+
return {
|
|
1083
|
+
...contentPage,
|
|
1084
|
+
blocks,
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
function toMobileBlock(block) {
|
|
1088
|
+
const { mobile } = block;
|
|
1089
|
+
if (mobile) {
|
|
1090
|
+
return {
|
|
1091
|
+
...block,
|
|
1092
|
+
style: mobile.style?.length ? mobile.style : block.style,
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
else {
|
|
1096
|
+
return block;
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1101
1100
|
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 }) })));
|
|
1102
1101
|
|
|
1103
1102
|
const Gallery = JSX(({ title, description, cards = [], className }) => {
|