@redneckz/wildless-cms-uni-blocks 0.2.83 → 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 +203 -198
- 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/SocialMedia.js +2 -2
- package/dist/components/Footer/SocialMedia.js.map +1 -1
- 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/HeaderSecondaryMenu.js +1 -1
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/Header/HeaderSecondaryMenuButton.js +1 -1
- package/dist/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- 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/Icon.js +7 -1
- package/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/dist/ui-kit/Icon/IconProps.d.ts +50 -19
- 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/SocialMedia.js +2 -2
- package/lib/components/Footer/SocialMedia.js.map +1 -1
- 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/HeaderSecondaryMenu.js +1 -1
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/Header/HeaderSecondaryMenuButton.js +1 -1
- package/lib/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- 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/Icon.js +7 -1
- package/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/lib/ui-kit/Icon/IconProps.d.ts +50 -19
- 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 +17 -36
- 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 +5 -12
- 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/HeaderSecondaryMenu.tsx +4 -8
- package/src/components/Header/HeaderSecondaryMenuButton.tsx +1 -1
- 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/icons/GridIcon.svg +4 -7
- 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/Icon.tsx +23 -9
- package/src/ui-kit/Icon/IconProps.ts +36 -5
- 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,103 +185,45 @@
|
|
|
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
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
193
|
+
setup(_) {
|
|
194
|
+
this._ = _;
|
|
195
|
+
}
|
|
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
|
+
})();
|
|
253
218
|
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
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 }));
|
|
219
|
+
const Icon = JSX(({ className, name, alt = `Icon ${name}`, title = alt, asSVG, ...imgProps }) => {
|
|
220
|
+
const href = `${projectSettings.CDN || ''}icons/${name}.svg`;
|
|
221
|
+
if (asSVG) {
|
|
222
|
+
return (jsxs("svg", { className: className, ...imgProps, "aria-hidden": "true", children: [title ? jsx("title", { children: title }) : null, alt ? jsx("desc", { children: alt }) : null, jsx("use", { href: `${href}#icon`, xlinkHref: `${href}#icon` })] }));
|
|
267
223
|
}
|
|
268
|
-
return (jsx("
|
|
269
|
-
});
|
|
270
|
-
const ButtonInner = JSX(({ text, aboveText, appendLeft, rounded }) => {
|
|
271
|
-
const withoutText = !text && !aboveText && Boolean(appendLeft);
|
|
272
|
-
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' : ''}`;
|
|
273
|
-
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] }));
|
|
224
|
+
return (jsx("img", { className: className, src: href, alt: alt, title: title, ...imgProps, "aria-hidden": "true" }));
|
|
274
225
|
});
|
|
275
226
|
|
|
276
|
-
const Icon = JSX(({ className, name, alt = `Icon ${name}`, title = alt, ...imgProps }) => (jsxs("svg", { className: className, ...imgProps, "aria-hidden": "true", children: [title ? jsx("title", { children: title }) : null, alt ? jsx("desc", { children: alt }) : null, jsx("use", { href: `${projectSettings.CDN || ''}icons/${name}.svg#icon`, xlinkHref: `${projectSettings.CDN || ''}icons/${name}.svg#icon` })] })));
|
|
277
|
-
|
|
278
|
-
const Img = JSX(({ className, image }) => (jsxs("picture", { className: `${className || ''}`, children: [image.sources?.length
|
|
279
|
-
? image.sources.map(({ src, format }, index) => (jsx("source", { srcSet: src, type: formatToMimeType(format) }, `${index}_${src}`)))
|
|
280
|
-
: null, jsx("img", { src: image.src, alt: image.alt || image.title, title: image.title, ...image?.size })] })));
|
|
281
|
-
function formatToMimeType(format) {
|
|
282
|
-
return format ? `image/${String(format)}` : undefined;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
227
|
var SizeTableClass;
|
|
286
228
|
(function (SizeTableClass) {
|
|
287
229
|
SizeTableClass["XL"] = "text-title-lg";
|
|
@@ -296,6 +238,13 @@
|
|
|
296
238
|
});
|
|
297
239
|
const getClasses = (...classes) => classes.filter(Boolean).join(' ');
|
|
298
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
|
+
|
|
299
248
|
const MOBILE_URL_PATH = '/mobile';
|
|
300
249
|
const isURL = (href) => href?.includes('//');
|
|
301
250
|
const isHrefActive = (href, router, cmp = (href, baseHref) => href === baseHref) => {
|
|
@@ -359,6 +308,47 @@
|
|
|
359
308
|
};
|
|
360
309
|
}
|
|
361
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
|
+
|
|
362
352
|
const getColSpan = (className) => {
|
|
363
353
|
const colSpanPrefix = 'col-span-';
|
|
364
354
|
const colSpanStr = className.split(/\s+/).find((_) => _.startsWith(colSpanPrefix));
|
|
@@ -415,66 +405,6 @@
|
|
|
415
405
|
}
|
|
416
406
|
}
|
|
417
407
|
|
|
418
|
-
const GOLDEN_RATIO = 1.618;
|
|
419
|
-
const Placeholder = JSX(({ className, context, title }) => {
|
|
420
|
-
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() }) }));
|
|
421
|
-
});
|
|
422
|
-
const renderShimmer = (size = 3) => goldenSequence(100, size)
|
|
423
|
-
.map((_) => Math.floor(_))
|
|
424
|
-
.map(renderShimmerItem);
|
|
425
|
-
const renderShimmerItem = (width = 100, index) => (jsx("div", { style: { width: `${width}%` }, className: "h-4 mt-2 bg-secondary-light" }, String(index)));
|
|
426
|
-
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
427
|
-
|
|
428
|
-
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
429
|
-
const ContentPage = JSX(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
|
|
430
|
-
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 }) }))] }));
|
|
431
|
-
function renderBlock(block, i) {
|
|
432
|
-
const { type } = block;
|
|
433
|
-
if (!(type in blocksRegistry)) {
|
|
434
|
-
console.warn(`No block with "${type}" is registered`);
|
|
435
|
-
}
|
|
436
|
-
const BlockComponent = blocksRegistry[type] || Placeholder;
|
|
437
|
-
return blockDecorator({
|
|
438
|
-
blockClassName: style2className(block.style),
|
|
439
|
-
block,
|
|
440
|
-
render: (props) => {
|
|
441
|
-
const { version, content, blocks } = props.block;
|
|
442
|
-
return (jsx(BlockComponent, { className: props.blockClassName, version: version, context: context, ...content, children: blocks?.length ? blocks.map(renderBlock) : null }, `${type}-${i}`));
|
|
443
|
-
},
|
|
444
|
-
}, `block-${i}`);
|
|
445
|
-
}
|
|
446
|
-
});
|
|
447
|
-
function style2className(style) {
|
|
448
|
-
return style ? style.join(' ') : '';
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
function toMobilePage(contentPage) {
|
|
452
|
-
const blocks = contentPage.blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
|
|
453
|
-
return {
|
|
454
|
-
...contentPage,
|
|
455
|
-
blocks,
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
function toMobileBlock(block) {
|
|
459
|
-
const { mobile } = block;
|
|
460
|
-
if (mobile) {
|
|
461
|
-
return {
|
|
462
|
-
...block,
|
|
463
|
-
style: mobile.style?.length ? mobile.style : block.style,
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
else {
|
|
467
|
-
return block;
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
const BenefitsBlock = JSX(({ className, title, benefits }) => {
|
|
472
|
-
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] }));
|
|
473
|
-
});
|
|
474
|
-
const renderStep = (benefit, i) => {
|
|
475
|
-
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)));
|
|
476
|
-
};
|
|
477
|
-
|
|
478
408
|
const CBR_EXCHANGE_RATE_URL = 'https://www.cbr-xml-daily.ru/daily_json.js';
|
|
479
409
|
const CURRENCY_CODES = ['USD', 'EUR'];
|
|
480
410
|
const CURRENCY_ICONS_MAP = {
|
|
@@ -540,7 +470,7 @@
|
|
|
540
470
|
const { type, text, description } = item;
|
|
541
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)));
|
|
542
472
|
};
|
|
543
|
-
const renderText = (type, text) => {
|
|
473
|
+
const renderText = (type, text = '') => {
|
|
544
474
|
switch (type) {
|
|
545
475
|
case 'tel':
|
|
546
476
|
return (jsx("a", { className: "font-sans font-medium text-xl text-primary-text no-underline", href: `tel:${formatTel(text)}`, children: text }));
|
|
@@ -559,13 +489,6 @@
|
|
|
559
489
|
});
|
|
560
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}` })));
|
|
561
491
|
|
|
562
|
-
const cmp = (a) => (b) => a?.href === b?.href;
|
|
563
|
-
const substitute = (items, substitution) => (items || []).map((_) => substitution?.find(cmp(_)) || _);
|
|
564
|
-
const subtract = (minuend, subtrahend) => (minuend || []).filter((_) => !subtrahend?.find(cmp(_)));
|
|
565
|
-
function mergeTopItems(left, right) {
|
|
566
|
-
return substitute(left, right).concat(subtract(right, left));
|
|
567
|
-
}
|
|
568
|
-
|
|
569
492
|
function useSitemap(useAsyncData) {
|
|
570
493
|
const { data } = useAsyncData(sitemapURL(), fetchSitemap);
|
|
571
494
|
return data || {};
|
|
@@ -578,6 +501,13 @@
|
|
|
578
501
|
return `/wcms-resources/${projectSettings.SITEMAP || 'sitemap'}.json`;
|
|
579
502
|
}
|
|
580
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
|
+
|
|
581
511
|
const Sitemap = JSX(({ className, items, context }) => {
|
|
582
512
|
const sitemap = useSitemap(context.useAsyncData);
|
|
583
513
|
const mergedItems = mergeTopItems(sitemap.topItems, items);
|
|
@@ -613,7 +543,7 @@
|
|
|
613
543
|
const { icon, label, width, height } = ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
|
|
614
544
|
if (!icon)
|
|
615
545
|
return null;
|
|
616
|
-
return (jsx(Button, { rounded: true, href: href, target: "_blank", rel: "noopener noreferrer", "aria-label": label, className: "border-solid border border-main-divider w-9 h-9 flex items-center justify-center hover:fill-primary-main", appendLeft: jsx(Icon, { name: icon, width: width, height: height,
|
|
546
|
+
return (jsx(Button, { rounded: true, href: href, target: "_blank", rel: "noopener noreferrer", "aria-label": label, className: "border-solid border border-main-divider w-9 h-9 flex items-center justify-center hover:fill-primary-main", appendLeft: jsx(Icon, { name: icon, width: width, height: height, asSVG: true }) }));
|
|
617
547
|
});
|
|
618
548
|
|
|
619
549
|
const TextInformation = JSX(({ className, links, context }) => {
|
|
@@ -697,11 +627,11 @@
|
|
|
697
627
|
return (jsx("a", { className: `inline-block border border-solid bg-transparent text-center no-underline ${flat ? '' : 'px-4 py-2'} ${linkStyle} ${className || ''}`, href: href, target: target, onClick: onClick, rel: "noopener noreferrer", "aria-label": ariaLabel, children: jsx("span", { className: `font-sans font-normal text-sm ${textStyle}`, children: text || children }) }));
|
|
698
628
|
});
|
|
699
629
|
|
|
700
|
-
const HeaderSecondaryMenuButton = JSX(({ className, children, ariaLabel }) => (jsx("button", { type: "button", className: `border-0 p-0 w-[24px] flex items-center bg-inherit cursor-pointer ${className || ''}`, disabled: true, "aria-label": ariaLabel, children: children })));
|
|
630
|
+
const HeaderSecondaryMenuButton = JSX(({ className, children, ariaLabel }) => (jsx("button", { type: "button", className: `border-0 p-0 w-[24px] h-[24px] flex items-center bg-inherit cursor-pointer ${className || ''}`, disabled: true, "aria-label": ariaLabel, children: children })));
|
|
701
631
|
|
|
702
632
|
const HeaderSecondaryMenu = JSX(({ context, className, defaultLocation = '' }) => {
|
|
703
633
|
const [city, getCity] = context.useGeolocation(defaultLocation);
|
|
704
|
-
return (jsxs("div", { className: `flex items-center ${className || ''}`, children: [jsx(TopItem, { className: "mr-5", flat: true, href: "#", text: city, ariaLabel: "\u041C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435", onClick: getCity }), jsx(TopItem, { className: "mr-7", flat: true, href: "#", text: "\u041E\u0444\u0438\u0441\u044B \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B", ariaLabel: "\u0421\u043F\u0438\u0441\u043E\u043A \u0432\u0441\u0435\u0445 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043E\u0444\u0438\u0441\u043E\u0432 \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u043E\u0432" }), jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u0430\u0439\u0442\u0443", children: jsx(Icon, { name: "LoupeIcon", "aria-hidden": "true" }) }), jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u0440\u043E\u0444\u0438\u043B\u044C", children: jsx(Icon, { name: "ProfileIcon", "aria-hidden": "true" }) }), jsx(HeaderSecondaryMenuButton, { className: "
|
|
634
|
+
return (jsxs("div", { className: `flex items-center ${className || ''}`, children: [jsx(TopItem, { className: "mr-5", flat: true, href: "#", text: city, ariaLabel: "\u041C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435", onClick: getCity }), jsx(TopItem, { className: "mr-7", flat: true, href: "#", text: "\u041E\u0444\u0438\u0441\u044B \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B", ariaLabel: "\u0421\u043F\u0438\u0441\u043E\u043A \u0432\u0441\u0435\u0445 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043E\u0444\u0438\u0441\u043E\u0432 \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u043E\u0432" }), jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u0430\u0439\u0442\u0443", children: jsx(Icon, { name: "LoupeIcon", "aria-hidden": "true", className: "h-full", asSVG: true }) }), jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u0440\u043E\u0444\u0438\u043B\u044C", children: jsx(Icon, { name: "ProfileIcon", "aria-hidden": "true", className: "h-full", asSVG: true }) }), jsx(HeaderSecondaryMenuButton, { className: "min-w-[32px] min-h-[32px] fill-secondary-light hover:fill-secondary-hover", ariaLabel: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0441\u0441\u044B\u043B\u043A\u0438", children: jsx(Icon, { name: "GridIcon", "aria-hidden": "true", className: "h-full", asSVG: true }) })] }));
|
|
705
635
|
});
|
|
706
636
|
|
|
707
637
|
function isSubItemActive(router) {
|
|
@@ -731,6 +661,16 @@
|
|
|
731
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" })] }) }));
|
|
732
662
|
});
|
|
733
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
|
+
|
|
734
674
|
const ProductBlockInner = JSX(({ className, context, title, titleSize, description, benefits, buttons, image, items }) => {
|
|
735
675
|
return (jsxs("div", { className: `flex grow justify-between items-stretch ${className || ''}`, children: [jsxs("div", { className: 'flex flex-col', children: [title && (
|
|
736
676
|
/* TODO Why <Title> is duplicated here? */
|
|
@@ -913,15 +853,14 @@
|
|
|
913
853
|
: `${contentBlock.scrollHeight}px`;
|
|
914
854
|
};
|
|
915
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
|
|
916
|
-
${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] }));
|
|
917
857
|
});
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
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)) {
|
|
921
860
|
return null;
|
|
922
861
|
}
|
|
923
|
-
const AccordionBlock =
|
|
924
|
-
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}`));
|
|
925
864
|
};
|
|
926
865
|
const getContentBlock = (e) => e.target.tagName === 'BUTTON' ? e.target.nextSibling : e.target.parentNode.nextSibling;
|
|
927
866
|
|
|
@@ -1092,6 +1031,72 @@
|
|
|
1092
1031
|
CreditCalculator,
|
|
1093
1032
|
};
|
|
1094
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
|
+
|
|
1095
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 }) })));
|
|
1096
1101
|
|
|
1097
1102
|
const Gallery = JSX(({ title, description, cards = [], className }) => {
|