@redneckz/wildless-cms-uni-blocks 0.6.41 → 0.6.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/migration-scripts/0.6.34.js +2 -0
- package/bin/migration-scripts/0.6.43.js +29 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +213 -101
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/bundle/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/bundle/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/bundle/components/ProductTile/renderBenefit.d.ts +4 -0
- package/bundle/components/ProductTile/renderImage.d.ts +3 -0
- package/bundle/content-page-repository/transformImg.d.ts +1 -1
- package/bundle/hooks/useCachedAsyncData.d.ts +2 -0
- package/bundle/hooks/useLocation.d.ts +6 -0
- package/bundle/hooks/useRegions.d.ts +6 -0
- package/bundle/services/sitemap/SitemapProps.d.ts +8 -0
- package/bundle/ui-kit/Location/Location.d.ts +19 -0
- package/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
- package/bundle/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/bundle/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/bundle/utils/groupBy.d.ts +1 -0
- package/dist/components/Blocks.js +4 -2
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/dist/components/Header/Header.js +2 -2
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/HeaderBurger.js +4 -3
- package/dist/components/Header/HeaderBurger.js.map +1 -1
- package/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/dist/components/Header/HeaderSecondaryMenu.js +13 -4
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/ProductTile/ProductTile.js +9 -22
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/dist/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/dist/components/ProductTile/renderAdditionalDescription.js +18 -0
- package/dist/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/dist/components/ProductTile/renderBenefit.d.ts +4 -0
- package/dist/components/ProductTile/renderBenefit.js +32 -0
- package/dist/components/ProductTile/renderBenefit.js.map +1 -0
- package/dist/components/ProductTile/renderImage.d.ts +3 -0
- package/dist/components/ProductTile/renderImage.js +12 -0
- package/dist/components/ProductTile/renderImage.js.map +1 -0
- package/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/dist/components/TextBlock/TextBlock.js +13 -28
- package/dist/components/TextBlock/TextBlock.js.map +1 -1
- package/dist/content-page-repository/transformImg.d.ts +1 -1
- package/dist/content-page-repository/transformImg.js +4 -10
- package/dist/content-page-repository/transformImg.js.map +1 -1
- package/dist/content-page-repository/transformMarkdown.js +3 -3
- package/dist/content-page-repository/transformMarkdown.js.map +1 -1
- package/dist/hooks/useCachedAsyncData.d.ts +2 -0
- package/dist/hooks/useCachedAsyncData.js +25 -0
- package/dist/hooks/useCachedAsyncData.js.map +1 -0
- package/dist/hooks/useLocation.d.ts +6 -0
- package/dist/hooks/useLocation.js +26 -0
- package/dist/hooks/useLocation.js.map +1 -0
- package/dist/hooks/useRegions.d.ts +6 -0
- package/dist/hooks/useRegions.js +11 -0
- package/dist/hooks/useRegions.js.map +1 -0
- package/dist/services/sitemap/SitemapProps.d.ts +8 -0
- package/dist/ui-kit/Location/Location.d.ts +19 -0
- package/dist/ui-kit/Location/Location.js +44 -0
- package/dist/ui-kit/Location/Location.js.map +1 -0
- package/dist/ui-kit/Location/SearchBar.d.ts +6 -0
- package/dist/ui-kit/Location/SearchBar.js +9 -0
- package/dist/ui-kit/Location/SearchBar.js.map +1 -0
- package/dist/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/dist/ui-kit/MarkdownText/MarkdownText.js +9 -0
- package/dist/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/dist/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/dist/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/dist/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/dist/ui-kit/Text/Text.js +1 -5
- package/dist/ui-kit/Text/Text.js.map +1 -1
- package/dist/utils/groupBy.d.ts +1 -0
- package/dist/utils/groupBy.js +13 -0
- package/dist/utils/groupBy.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +4 -2
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.d.ts +9 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/lib/components/Header/Header.js +2 -2
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/HeaderBurger.js +4 -3
- package/lib/components/Header/HeaderBurger.js.map +1 -1
- package/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/lib/components/Header/HeaderSecondaryMenu.js +13 -4
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/ProductTile/ProductTile.js +10 -23
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/lib/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/lib/components/ProductTile/renderAdditionalDescription.js +15 -0
- package/lib/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/lib/components/ProductTile/renderBenefit.d.ts +4 -0
- package/lib/components/ProductTile/renderBenefit.js +29 -0
- package/lib/components/ProductTile/renderBenefit.js.map +1 -0
- package/lib/components/ProductTile/renderImage.d.ts +3 -0
- package/lib/components/ProductTile/renderImage.js +9 -0
- package/lib/components/ProductTile/renderImage.js.map +1 -0
- package/lib/components/Recommendation/Recommendation.fixture.d.ts +1 -1
- package/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/lib/components/TextBlock/TextBlock.js +13 -28
- package/lib/components/TextBlock/TextBlock.js.map +1 -1
- package/lib/content-page-repository/transformImg.d.ts +1 -1
- package/lib/content-page-repository/transformImg.js +4 -10
- package/lib/content-page-repository/transformImg.js.map +1 -1
- package/lib/content-page-repository/transformMarkdown.js +3 -3
- package/lib/content-page-repository/transformMarkdown.js.map +1 -1
- package/lib/hooks/useCachedAsyncData.d.ts +2 -0
- package/lib/hooks/useCachedAsyncData.js +22 -0
- package/lib/hooks/useCachedAsyncData.js.map +1 -0
- package/lib/hooks/useLocation.d.ts +6 -0
- package/lib/hooks/useLocation.js +23 -0
- package/lib/hooks/useLocation.js.map +1 -0
- package/lib/hooks/useRegions.d.ts +6 -0
- package/lib/hooks/useRegions.js +8 -0
- package/lib/hooks/useRegions.js.map +1 -0
- package/lib/services/sitemap/SitemapProps.d.ts +8 -0
- package/lib/ui-kit/Location/Location.d.ts +19 -0
- package/lib/ui-kit/Location/Location.fixture.d.ts +6 -0
- package/lib/ui-kit/Location/Location.js +42 -0
- package/lib/ui-kit/Location/Location.js.map +1 -0
- package/lib/ui-kit/Location/SearchBar.d.ts +6 -0
- package/lib/ui-kit/Location/SearchBar.js +7 -0
- package/lib/ui-kit/Location/SearchBar.js.map +1 -0
- package/lib/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/lib/ui-kit/MarkdownText/MarkdownText.js +7 -0
- package/lib/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/lib/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/lib/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/lib/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/lib/ui-kit/Text/Text.js +1 -5
- package/lib/ui-kit/Text/Text.js.map +1 -1
- package/lib/utils/groupBy.d.ts +1 -0
- package/lib/utils/groupBy.js +10 -0
- package/lib/utils/groupBy.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +49 -25
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/mobile/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/bundle/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/mobile/bundle/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/mobile/bundle/components/ProductTile/renderBenefit.d.ts +4 -0
- package/mobile/bundle/components/ProductTile/renderImage.d.ts +3 -0
- package/mobile/bundle/content-page-repository/transformImg.d.ts +1 -1
- package/mobile/bundle/hooks/useCachedAsyncData.d.ts +2 -0
- package/mobile/bundle/hooks/useLocation.d.ts +6 -0
- package/mobile/bundle/hooks/useRegions.d.ts +6 -0
- package/mobile/bundle/services/sitemap/SitemapProps.d.ts +8 -0
- package/mobile/bundle/ui-kit/Location/Location.d.ts +19 -0
- package/mobile/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
- package/mobile/bundle/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/mobile/bundle/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/mobile/bundle/utils/groupBy.d.ts +1 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/mobile/dist/components/Header/HeaderBurger.js +4 -3
- package/mobile/dist/components/Header/HeaderBurger.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js +13 -4
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTile.js +9 -22
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/mobile/dist/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/mobile/dist/components/ProductTile/renderAdditionalDescription.js +18 -0
- package/mobile/dist/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/mobile/dist/components/ProductTile/renderBenefit.d.ts +4 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js +32 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -0
- package/mobile/dist/components/ProductTile/renderImage.d.ts +3 -0
- package/mobile/dist/components/ProductTile/renderImage.js +12 -0
- package/mobile/dist/components/ProductTile/renderImage.js.map +1 -0
- package/mobile/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/dist/content-page-repository/transformImg.d.ts +1 -1
- package/mobile/dist/content-page-repository/transformImg.js +4 -10
- package/mobile/dist/content-page-repository/transformImg.js.map +1 -1
- package/mobile/dist/content-page-repository/transformMarkdown.js +3 -3
- package/mobile/dist/content-page-repository/transformMarkdown.js.map +1 -1
- package/mobile/dist/hooks/useCachedAsyncData.d.ts +2 -0
- package/mobile/dist/hooks/useCachedAsyncData.js +25 -0
- package/mobile/dist/hooks/useCachedAsyncData.js.map +1 -0
- package/mobile/dist/hooks/useLocation.d.ts +6 -0
- package/mobile/dist/hooks/useLocation.js +26 -0
- package/mobile/dist/hooks/useLocation.js.map +1 -0
- package/mobile/dist/hooks/useRegions.d.ts +6 -0
- package/mobile/dist/hooks/useRegions.js +11 -0
- package/mobile/dist/hooks/useRegions.js.map +1 -0
- package/mobile/dist/services/sitemap/SitemapProps.d.ts +8 -0
- package/mobile/dist/ui-kit/Location/Location.d.ts +19 -0
- package/mobile/dist/ui-kit/Location/Location.js +44 -0
- package/mobile/dist/ui-kit/Location/Location.js.map +1 -0
- package/mobile/dist/ui-kit/Location/SearchBar.d.ts +6 -0
- package/mobile/dist/ui-kit/Location/SearchBar.js +9 -0
- package/mobile/dist/ui-kit/Location/SearchBar.js.map +1 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownText.js +9 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/dist/ui-kit/Text/Text.js +1 -5
- package/mobile/dist/ui-kit/Text/Text.js.map +1 -1
- package/mobile/dist/utils/groupBy.d.ts +1 -0
- package/mobile/dist/utils/groupBy.js +13 -0
- package/mobile/dist/utils/groupBy.js.map +1 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/mobile/lib/components/Header/HeaderBurger.js +4 -3
- package/mobile/lib/components/Header/HeaderBurger.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js +13 -4
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTile.js +10 -23
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/mobile/lib/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/mobile/lib/components/ProductTile/renderAdditionalDescription.js +15 -0
- package/mobile/lib/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/mobile/lib/components/ProductTile/renderBenefit.d.ts +4 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js +29 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -0
- package/mobile/lib/components/ProductTile/renderImage.d.ts +3 -0
- package/mobile/lib/components/ProductTile/renderImage.js +9 -0
- package/mobile/lib/components/ProductTile/renderImage.js.map +1 -0
- package/mobile/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/lib/content-page-repository/transformImg.d.ts +1 -1
- package/mobile/lib/content-page-repository/transformImg.js +4 -10
- package/mobile/lib/content-page-repository/transformImg.js.map +1 -1
- package/mobile/lib/content-page-repository/transformMarkdown.js +3 -3
- package/mobile/lib/content-page-repository/transformMarkdown.js.map +1 -1
- package/mobile/lib/hooks/useCachedAsyncData.d.ts +2 -0
- package/mobile/lib/hooks/useCachedAsyncData.js +22 -0
- package/mobile/lib/hooks/useCachedAsyncData.js.map +1 -0
- package/mobile/lib/hooks/useLocation.d.ts +6 -0
- package/mobile/lib/hooks/useLocation.js +23 -0
- package/mobile/lib/hooks/useLocation.js.map +1 -0
- package/mobile/lib/hooks/useRegions.d.ts +6 -0
- package/mobile/lib/hooks/useRegions.js +8 -0
- package/mobile/lib/hooks/useRegions.js.map +1 -0
- package/mobile/lib/services/sitemap/SitemapProps.d.ts +8 -0
- package/mobile/lib/ui-kit/Location/Location.d.ts +19 -0
- package/mobile/lib/ui-kit/Location/Location.js +42 -0
- package/mobile/lib/ui-kit/Location/Location.js.map +1 -0
- package/mobile/lib/ui-kit/Location/SearchBar.d.ts +6 -0
- package/mobile/lib/ui-kit/Location/SearchBar.js +7 -0
- package/mobile/lib/ui-kit/Location/SearchBar.js.map +1 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownText.js +7 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/lib/ui-kit/Text/Text.js +1 -5
- package/mobile/lib/ui-kit/Text/Text.js.map +1 -1
- package/mobile/lib/utils/groupBy.d.ts +1 -0
- package/mobile/lib/utils/groupBy.js +10 -0
- package/mobile/lib/utils/groupBy.js.map +1 -0
- package/mobile/src/common.css +50 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
- package/mobile/src/components/Header/HeaderBurger.tsx +5 -7
- package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
- package/mobile/src/components/MiniGallery/MiniGallery.ui.json +1 -1
- package/mobile/src/components/ProductTile/ProductTile.example.json +3 -0
- package/mobile/src/components/ProductTile/ProductTile.tsx +13 -44
- package/mobile/src/components/ProductTile/ProductTile.ui.json +14 -1
- package/mobile/src/components/ProductTile/ProductTileContent.ts +26 -2
- package/mobile/src/components/ProductTile/renderAdditionalDescription.tsx +30 -0
- package/mobile/src/components/ProductTile/renderBenefit.tsx +39 -0
- package/mobile/src/components/ProductTile/renderImage.tsx +15 -0
- package/mobile/src/components/Recommendation/Recommendation.example.json +6 -5
- package/mobile/src/components/Recommendation/Recommendation.ui.json +8 -0
- package/mobile/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/mobile/src/content-page-repository/transformImg.ts +6 -14
- package/mobile/src/content-page-repository/transformMarkdown.ts +3 -3
- package/mobile/src/hooks/useCachedAsyncData.ts +37 -0
- package/mobile/src/hooks/useLocation.ts +48 -0
- package/mobile/src/hooks/useRegions.ts +16 -0
- package/mobile/src/services/sitemap/SitemapProps.ts +9 -0
- package/mobile/src/ui-kit/Location/Location.tsx +168 -0
- package/mobile/src/ui-kit/Location/SearchBar.tsx +30 -0
- package/mobile/src/ui-kit/MarkdownText/MarkdownText.tsx +8 -0
- package/mobile/src/ui-kit/MarkdownText/MarkdownTextProps.ts +6 -0
- package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
- package/mobile/src/ui-kit/Text/Text.tsx +5 -7
- package/mobile/src/utils/groupBy.ts +10 -0
- package/package.json +2 -2
- package/src/common.css +50 -0
- package/src/components/Blocks.ts +4 -2
- package/src/components/Carousel/Carousel.fixture.tsx +22 -4
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +47 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
- package/src/components/Header/Header.tsx +6 -4
- package/src/components/Header/HeaderBurger.tsx +5 -7
- package/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
- package/src/components/MiniGallery/MiniGallery.ui.json +1 -1
- package/src/components/ProductTile/ProductTile.example.json +3 -0
- package/src/components/ProductTile/ProductTile.fixture.tsx +11 -4
- package/src/components/ProductTile/ProductTile.tsx +13 -44
- package/src/components/ProductTile/ProductTile.ui.json +14 -1
- package/src/components/ProductTile/ProductTileContent.ts +26 -2
- package/src/components/ProductTile/renderAdditionalDescription.tsx +30 -0
- package/src/components/ProductTile/renderBenefit.tsx +39 -0
- package/src/components/ProductTile/renderImage.tsx +15 -0
- package/src/components/Recommendation/Recommendation.example.json +6 -5
- package/src/components/Recommendation/Recommendation.fixture.tsx +11 -10
- package/src/components/Recommendation/Recommendation.ui.json +8 -0
- package/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/src/components/TextBlock/TextBlock.tsx +49 -41
- package/src/content-page-repository/transformImg.ts +6 -14
- package/src/content-page-repository/transformMarkdown.ts +3 -3
- package/src/hooks/useCachedAsyncData.ts +37 -0
- package/src/hooks/useLocation.ts +48 -0
- package/src/hooks/useRegions.ts +16 -0
- package/src/services/sitemap/SitemapProps.ts +9 -0
- package/src/ui-kit/Location/Location.fixture.tsx +81 -0
- package/src/ui-kit/Location/Location.tsx +168 -0
- package/src/ui-kit/Location/SearchBar.tsx +30 -0
- package/src/ui-kit/MarkdownText/MarkdownText.tsx +8 -0
- package/src/ui-kit/MarkdownText/MarkdownTextProps.ts +6 -0
- package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
- package/src/ui-kit/Text/Text.tsx +5 -7
- package/src/utils/groupBy.ts +10 -0
- package/bundle/hooks/useGeolocation.d.ts +0 -1
- package/dist/hooks/useGeolocation.d.ts +0 -1
- package/dist/hooks/useGeolocation.js +0 -21
- package/dist/hooks/useGeolocation.js.map +0 -1
- package/lib/hooks/useGeolocation.d.ts +0 -1
- package/lib/hooks/useGeolocation.js +0 -18
- package/lib/hooks/useGeolocation.js.map +0 -1
- package/mobile/bundle/hooks/useGeolocation.d.ts +0 -1
- package/mobile/dist/hooks/useGeolocation.d.ts +0 -1
- package/mobile/dist/hooks/useGeolocation.js +0 -21
- package/mobile/dist/hooks/useGeolocation.js.map +0 -1
- package/mobile/lib/hooks/useGeolocation.d.ts +0 -1
- package/mobile/lib/hooks/useGeolocation.js +0 -18
- package/mobile/lib/hooks/useGeolocation.js.map +0 -1
- package/mobile/src/hooks/useGeolocation.ts +0 -22
- package/src/hooks/useGeolocation.ts +0 -22
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { BaseTile } from '../BaseTile/BaseTile';
|
|
2
|
+
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
3
|
+
import { BorderVersionStyleMap } from '../../model/BorderVersion';
|
|
4
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
7
|
+
import { List } from '../../ui-kit/List/List';
|
|
8
|
+
import { renderButton } from '../../ui-kit/Button/ButtonSection';
|
|
9
|
+
import { SocialMedia } from '../Footer/SocialMedia';
|
|
10
|
+
import { VersionStyleMap } from '../../model/BlockVersion';
|
|
11
|
+
import type { CarouselRecommendationCardContent } from './CarouselRecommendationCardContent';
|
|
12
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
13
|
+
|
|
14
|
+
export interface RecommendationCardProps extends CarouselRecommendationCardContent, UniBlockProps {}
|
|
15
|
+
|
|
16
|
+
export const CarouselRecommendationCard = JSX<RecommendationCardProps>(
|
|
17
|
+
({
|
|
18
|
+
button,
|
|
19
|
+
className = '',
|
|
20
|
+
description,
|
|
21
|
+
image,
|
|
22
|
+
items = [],
|
|
23
|
+
socialMedia = [],
|
|
24
|
+
title,
|
|
25
|
+
version = 'primary',
|
|
26
|
+
...rest
|
|
27
|
+
}) => {
|
|
28
|
+
const tileTitle = title ? (
|
|
29
|
+
<Heading headingType="h5" as="h3" className="mb-3.5 z-10" title={title} />
|
|
30
|
+
) : null;
|
|
31
|
+
const tileImage = image?.src ? (
|
|
32
|
+
<Img className="absolute bottom-0 right-0 m-0" image={image} />
|
|
33
|
+
) : null;
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<BlockWrapper
|
|
37
|
+
className={`relative text-left border border-solid box-border p-7 min-w-[524px]
|
|
38
|
+
${BorderVersionStyleMap[version]}
|
|
39
|
+
${VersionStyleMap[version]}
|
|
40
|
+
${className}`}
|
|
41
|
+
{...rest}
|
|
42
|
+
>
|
|
43
|
+
<BaseTile className="flex justify-between" title={tileTitle} image={tileImage}>
|
|
44
|
+
<div className="h-full flex flex-col justify-between">
|
|
45
|
+
{description ? <span className="mb-2">{description}</span> : null}
|
|
46
|
+
{items.length ? (
|
|
47
|
+
<List
|
|
48
|
+
className="text-xl-light flex flex-col flex-1 gap-2 max-w-[236px]"
|
|
49
|
+
items={items}
|
|
50
|
+
version={version}
|
|
51
|
+
/>
|
|
52
|
+
) : null}
|
|
53
|
+
{socialMedia.length ? (
|
|
54
|
+
<SocialMedia className="pt-10 pb-0" media={socialMedia} version={version} />
|
|
55
|
+
) : null}
|
|
56
|
+
{button?.text ? <div className="pt-2 mt-16">{renderButton({ button })}</div> : null}
|
|
57
|
+
</div>
|
|
58
|
+
</BaseTile>
|
|
59
|
+
</BlockWrapper>
|
|
60
|
+
);
|
|
61
|
+
},
|
|
62
|
+
);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
3
|
+
import type { LinkCommonProps } from '../../model/LinkProps';
|
|
4
|
+
import type { Picture } from '../../model/Picture';
|
|
5
|
+
import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
|
|
6
|
+
import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @title Карточка рекомендаций
|
|
10
|
+
*/
|
|
11
|
+
export interface CarouselRecommendationCardContent extends HeadlineCommonProps, ListContent {
|
|
12
|
+
/**
|
|
13
|
+
* @title Соц сети
|
|
14
|
+
* @minItems 3
|
|
15
|
+
* @default [
|
|
16
|
+
* { "href": "https://t.me" },
|
|
17
|
+
* { "href": "https://vk.com" },
|
|
18
|
+
* { "href": "https://ok.ru" },
|
|
19
|
+
* ]
|
|
20
|
+
*/
|
|
21
|
+
socialMedia?: LinkCommonProps[];
|
|
22
|
+
/**
|
|
23
|
+
* @default {
|
|
24
|
+
* "format": "webp",
|
|
25
|
+
* "size": {
|
|
26
|
+
* "width": 290
|
|
27
|
+
* },
|
|
28
|
+
* "sources": [{
|
|
29
|
+
* "media": 1279,
|
|
30
|
+
* "width": 174,
|
|
31
|
+
* "format": "webp",
|
|
32
|
+
* "alignment": "southeast"
|
|
33
|
+
* }]
|
|
34
|
+
* }
|
|
35
|
+
*/
|
|
36
|
+
image?: Picture;
|
|
37
|
+
/**
|
|
38
|
+
* @default {
|
|
39
|
+
* "text": "",
|
|
40
|
+
* "version": "secondary"
|
|
41
|
+
* }
|
|
42
|
+
*/
|
|
43
|
+
button?: ButtonProps;
|
|
44
|
+
version?: BlockVersion;
|
|
45
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useLocation } from '../../hooks/useLocation';
|
|
3
3
|
import type { VNode } from '../../model/VNode';
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
5
5
|
import { SearchBar } from '../../ui-kit/SearchBar/SearchBar';
|
|
6
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
6
7
|
import type { DispositionItem } from './HeaderContent';
|
|
7
8
|
|
|
8
9
|
export interface HeaderBurgerProps {
|
|
@@ -14,7 +15,7 @@ export interface HeaderBurgerProps {
|
|
|
14
15
|
|
|
15
16
|
export const HeaderBurger = JSX<HeaderBurgerProps>(
|
|
16
17
|
({ burgerSubMenu, onClick, defaultLocation = '', children }) => {
|
|
17
|
-
const [
|
|
18
|
+
const [location] = useLocation(defaultLocation);
|
|
18
19
|
|
|
19
20
|
return (
|
|
20
21
|
<div className="absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20">
|
|
@@ -24,10 +25,7 @@ export const HeaderBurger = JSX<HeaderBurgerProps>(
|
|
|
24
25
|
>
|
|
25
26
|
<Img image="CloseIcon" width="24" height="24" asSVG />
|
|
26
27
|
</button>
|
|
27
|
-
<button
|
|
28
|
-
onClick={getCity}
|
|
29
|
-
className="flex items-center text-s text-secondary-text p-0 mb-4 bg-transparent cursor-pointer"
|
|
30
|
-
>
|
|
28
|
+
<button className="flex items-center text-s p-0 mb-4 bg-transparent cursor-pointer">
|
|
31
29
|
<Img
|
|
32
30
|
image="GeolocationIcon"
|
|
33
31
|
width="20"
|
|
@@ -35,7 +33,7 @@ export const HeaderBurger = JSX<HeaderBurgerProps>(
|
|
|
35
33
|
className="text-primary-main box-border mr-2"
|
|
36
34
|
asSVG
|
|
37
35
|
/>
|
|
38
|
-
{
|
|
36
|
+
<Text color="text-secondary-text">{location.name}</Text>
|
|
39
37
|
</button>
|
|
40
38
|
{children}
|
|
41
39
|
<div className="mb-7">{burgerSubMenu?.map(renderBurgerSubMenuItem)}</div>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { useLocation } from '../../hooks/useLocation';
|
|
3
4
|
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
4
5
|
import type { IconVersion } from '../../model/IconVersion';
|
|
6
|
+
import type { ForeignOffice } from '../../services/sitemap/SitemapProps';
|
|
5
7
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
|
+
import { Location } from '../../ui-kit/Location/Location';
|
|
6
9
|
import { TopItem } from '../../ui-kit/TopItem/TopItem';
|
|
7
10
|
import { HeaderSecondaryMenuButton } from './HeaderSecondaryMenuButton';
|
|
8
11
|
|
|
@@ -10,6 +13,7 @@ interface HeaderSecondaryMenuContent {
|
|
|
10
13
|
defaultLocation?: string;
|
|
11
14
|
officesLink?: string;
|
|
12
15
|
bgColor?: BgColorVersion;
|
|
16
|
+
foreignOffices?: ForeignOffice[];
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
export interface HeaderSecondaryMenuProps extends HeaderSecondaryMenuContent {
|
|
@@ -30,8 +34,23 @@ const LINKS_ICON_VERSION_MAP: Record<BgColorVersion, IconVersion> = {
|
|
|
30
34
|
};
|
|
31
35
|
|
|
32
36
|
export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
33
|
-
({
|
|
34
|
-
|
|
37
|
+
({
|
|
38
|
+
className,
|
|
39
|
+
officesLink,
|
|
40
|
+
defaultLocation = 'Москва',
|
|
41
|
+
foreignOffices,
|
|
42
|
+
bgColor = 'bg-white',
|
|
43
|
+
}) => {
|
|
44
|
+
const [isShowLocationModal, setShowLocationModal] = useState<boolean>(false);
|
|
45
|
+
|
|
46
|
+
const [location, onChangeLocation] = useLocation(defaultLocation);
|
|
47
|
+
|
|
48
|
+
const showLocationModal = () => {
|
|
49
|
+
setShowLocationModal(true);
|
|
50
|
+
};
|
|
51
|
+
const hideLocationModal = () => {
|
|
52
|
+
setShowLocationModal(false);
|
|
53
|
+
};
|
|
35
54
|
|
|
36
55
|
return (
|
|
37
56
|
<div className={`flex items-center ${className || ''}`}>
|
|
@@ -39,9 +58,9 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
39
58
|
className="mr-5"
|
|
40
59
|
flat={true}
|
|
41
60
|
href="#"
|
|
42
|
-
text={
|
|
61
|
+
text={location.name}
|
|
43
62
|
ariaLabel="Местоположение"
|
|
44
|
-
onClick={
|
|
63
|
+
onClick={showLocationModal}
|
|
45
64
|
bgColor={bgColor}
|
|
46
65
|
/>
|
|
47
66
|
{officesLink ? (
|
|
@@ -76,6 +95,14 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
76
95
|
asSVG
|
|
77
96
|
/>
|
|
78
97
|
</HeaderSecondaryMenuButton>
|
|
98
|
+
{isShowLocationModal ? (
|
|
99
|
+
<Location
|
|
100
|
+
currentLocation={location}
|
|
101
|
+
foreignOffices={foreignOffices}
|
|
102
|
+
onChangeLocation={onChangeLocation}
|
|
103
|
+
close={hideLocationModal}
|
|
104
|
+
/>
|
|
105
|
+
) : null}
|
|
79
106
|
</div>
|
|
80
107
|
);
|
|
81
108
|
},
|
|
@@ -12,14 +12,17 @@
|
|
|
12
12
|
"version": "primary",
|
|
13
13
|
"benefits": [
|
|
14
14
|
{
|
|
15
|
+
"type": "default",
|
|
15
16
|
"label": "Преимущество 1",
|
|
16
17
|
"description": "Описание"
|
|
17
18
|
},
|
|
18
19
|
{
|
|
20
|
+
"type": "default",
|
|
19
21
|
"label": "Преимущество 2",
|
|
20
22
|
"description": "Описание"
|
|
21
23
|
},
|
|
22
24
|
{
|
|
25
|
+
"type": "default",
|
|
23
26
|
"label": "Преимущество 3",
|
|
24
27
|
"description": "Описание"
|
|
25
28
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
-
import {
|
|
3
|
+
import { VersionStyleMap } from '../../model/BlockVersion';
|
|
4
4
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
5
5
|
import type { Picture } from '../../model/Picture';
|
|
6
6
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
7
7
|
import { ButtonSection } from '../../ui-kit/Button/ButtonSection';
|
|
8
|
-
import { Img } from '../../ui-kit/Img/Img';
|
|
9
8
|
import { getTileRightPadding } from '../BaseTile/getTileRightPadding';
|
|
10
9
|
import { Headline } from '../Headline/Headline';
|
|
11
|
-
import type {
|
|
10
|
+
import type { Benefit, ProductTileContent } from './ProductTileContent';
|
|
11
|
+
import { renderAdditionalDescription } from './renderAdditionalDescription';
|
|
12
|
+
import { renderBenefit } from './renderBenefit';
|
|
13
|
+
import { renderImage } from './renderImage';
|
|
12
14
|
|
|
13
15
|
export interface ProductTileProps extends ProductTileContent, UniBlockProps {}
|
|
14
16
|
|
|
@@ -43,7 +45,7 @@ export const ProductTile = JSX<ProductTileProps>(
|
|
|
43
45
|
{...rest}
|
|
44
46
|
/>
|
|
45
47
|
{renderBenefits(benefits, version, image)}
|
|
46
|
-
{
|
|
48
|
+
{renderAdditionalDescription(additionalDescription, image)}
|
|
47
49
|
{buttons?.length ? (
|
|
48
50
|
<ButtonSection buttons={buttons} className="mt-5 gap-4 z-10 text-l" />
|
|
49
51
|
) : null}
|
|
@@ -53,53 +55,20 @@ export const ProductTile = JSX<ProductTileProps>(
|
|
|
53
55
|
),
|
|
54
56
|
);
|
|
55
57
|
|
|
56
|
-
function renderBenefits(benefits:
|
|
58
|
+
function renderBenefits(benefits: Benefit[], version: BlockVersion, image?: Picture) {
|
|
59
|
+
if (!benefits.length) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
57
63
|
// picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
|
|
58
|
-
const
|
|
64
|
+
const benefitsWidth = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
59
65
|
|
|
60
66
|
return (
|
|
61
67
|
<div
|
|
62
68
|
className={`z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline
|
|
63
|
-
${
|
|
69
|
+
${benefitsWidth}`}
|
|
64
70
|
>
|
|
65
71
|
{benefits.length ? benefits.map(renderBenefit(version)) : null}
|
|
66
72
|
</div>
|
|
67
73
|
);
|
|
68
74
|
}
|
|
69
|
-
|
|
70
|
-
const renderBenefit =
|
|
71
|
-
(version: BlockVersion = 'primary') =>
|
|
72
|
-
(benefit: TextBenefit, i: number) => {
|
|
73
|
-
const { label = '', description = '' } = benefit;
|
|
74
|
-
|
|
75
|
-
return [
|
|
76
|
-
<div key={`label-${i}`} className="text-h6">
|
|
77
|
-
{label}
|
|
78
|
-
</div>,
|
|
79
|
-
<div key={`desc-${i}`} className={`text-m-light ${VersionAdditionalStyleMap[version]}`}>
|
|
80
|
-
{description}
|
|
81
|
-
</div>,
|
|
82
|
-
];
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
function renderAdditionalDescription(additionalDescription: string, image?: Picture) {
|
|
86
|
-
// picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
|
|
87
|
-
const DESCRIPTION_WIDTH = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<div className={`text-m-light mt-2.5 z-10 ${DESCRIPTION_WIDTH}`}>{additionalDescription}</div>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function renderImage(image?: Picture, isImageOnRightSide?: boolean) {
|
|
95
|
-
if (!image?.src) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<Img
|
|
101
|
-
className={`absolute ${isImageOnRightSide ? 'right-0' : 'left-0'} bottom-0`}
|
|
102
|
-
image={image}
|
|
103
|
-
/>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
@@ -2,8 +2,32 @@ import type { BlockVersion } from '../../model/BlockVersion';
|
|
|
2
2
|
import type { DescriptionProps, HeadlineProps, LabelProps } from '../../model/HeadlineType';
|
|
3
3
|
import type { Picture } from '../../model/Picture';
|
|
4
4
|
import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
|
|
5
|
+
import type { MarkdownTextProps } from '../../ui-kit/MarkdownText/MarkdownTextProps';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @title Стандартный
|
|
9
|
+
*/
|
|
10
|
+
type TextBenefit = DescriptionProps &
|
|
11
|
+
LabelProps & {
|
|
12
|
+
/** @default default */
|
|
13
|
+
type: 'default';
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @title Форматированный текст
|
|
18
|
+
*/
|
|
19
|
+
type MarkdownTextContent = MarkdownTextProps & {
|
|
20
|
+
/** @default md */
|
|
21
|
+
type: 'md';
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @title Преимущество
|
|
26
|
+
* @default{
|
|
27
|
+
* "type": "default"
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
export type Benefit = TextBenefit | MarkdownTextContent;
|
|
7
31
|
|
|
8
32
|
/**
|
|
9
33
|
* @title Продуктовая плитка
|
|
@@ -30,7 +54,7 @@ export type ProductTileContent = HeadlineProps &
|
|
|
30
54
|
* @title Преимущества
|
|
31
55
|
* @maxItems 7
|
|
32
56
|
*/
|
|
33
|
-
benefits?:
|
|
57
|
+
benefits?: Benefit[];
|
|
34
58
|
/** @title Дополнительное описание */
|
|
35
59
|
additionalDescription?: string;
|
|
36
60
|
/** @title Картинка справа/текст слева */
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { Picture } from '../../model/Picture';
|
|
3
|
+
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
4
|
+
import type { TextColor } from '../../ui-kit/Text/TextProps';
|
|
5
|
+
|
|
6
|
+
const DESCRIPTION_STYLE_MAP: Record<BlockVersion, TextColor> = {
|
|
7
|
+
primary: 'text-secondary-text',
|
|
8
|
+
secondary: 'text-white',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function renderAdditionalDescription(
|
|
12
|
+
additionalDescription?: string,
|
|
13
|
+
image?: Picture,
|
|
14
|
+
version: BlockVersion = 'primary',
|
|
15
|
+
) {
|
|
16
|
+
if (!additionalDescription) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
|
|
21
|
+
const descriptionWidth = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div className={`mt-2.5 z-10 ${descriptionWidth}`}>
|
|
25
|
+
<Paragraph size="text-m" font="font-light" color={DESCRIPTION_STYLE_MAP[version]}>
|
|
26
|
+
{additionalDescription}
|
|
27
|
+
</Paragraph>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import { MarkdownText } from '../../ui-kit/MarkdownText/MarkdownText';
|
|
3
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
4
|
+
import type { TextColor } from '../../ui-kit/Text/TextProps';
|
|
5
|
+
import { assertUnreachable } from '../../utils/assertUnreachable';
|
|
6
|
+
import type { Benefit } from './ProductTileContent';
|
|
7
|
+
|
|
8
|
+
const LABEL_STYLE_MAP: Record<BlockVersion, TextColor> = {
|
|
9
|
+
primary: 'text-secondary-text',
|
|
10
|
+
secondary: 'text-white',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const renderBenefit =
|
|
14
|
+
(version: BlockVersion = 'primary') =>
|
|
15
|
+
// Linter doesn't understand that switch processes all cases
|
|
16
|
+
// eslint-disable-next-line consistent-return
|
|
17
|
+
(benefit: Benefit, i: number) => {
|
|
18
|
+
const { type } = benefit;
|
|
19
|
+
|
|
20
|
+
if (!(type === 'default' || type === 'md')) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
switch (type) {
|
|
25
|
+
case 'default':
|
|
26
|
+
return [
|
|
27
|
+
<Text key={`label-${i}`} size="text-h6">
|
|
28
|
+
{benefit.label}
|
|
29
|
+
</Text>,
|
|
30
|
+
<Text key={`desc-${i}`} size="text-m-light" color={LABEL_STYLE_MAP[version]}>
|
|
31
|
+
{benefit.description}
|
|
32
|
+
</Text>,
|
|
33
|
+
];
|
|
34
|
+
case 'md':
|
|
35
|
+
return <MarkdownText md={benefit.md} />;
|
|
36
|
+
default:
|
|
37
|
+
assertUnreachable(benefit);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Picture } from '../../model/Picture';
|
|
2
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
3
|
+
|
|
4
|
+
export function renderImage(image?: Picture, isImageOnRightSide?: boolean) {
|
|
5
|
+
if (!image?.src) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<Img
|
|
11
|
+
className={`absolute ${isImageOnRightSide ? 'right-0' : 'left-0'} bottom-0`}
|
|
12
|
+
image={image}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -28,11 +28,12 @@
|
|
|
28
28
|
},
|
|
29
29
|
"title": "Заголовок 2",
|
|
30
30
|
"description": "Описание 2",
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
"button": {
|
|
32
|
+
"href": "",
|
|
33
|
+
"text": "Подробнее",
|
|
34
|
+
"target": "_self",
|
|
35
|
+
"version": "primary"
|
|
36
|
+
}
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
"image": {
|
|
@@ -41,7 +41,7 @@ export const RecommendationCard = JSX<RecommendationCardProps>(
|
|
|
41
41
|
<SocialMedia className="pt-10 pb-0" media={socialMedia} version={version} />
|
|
42
42
|
) : null}
|
|
43
43
|
{button?.text ? (
|
|
44
|
-
<div className="pt-2">{renderButton({ button, buttonClassName: 'mt-16' })}</div>
|
|
44
|
+
<div className="pt-2">{renderButton({ button, buttonClassName: 'mt-16 px-5' })}</div>
|
|
45
45
|
) : null}
|
|
46
46
|
</div>
|
|
47
47
|
</BaseTile>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import util from 'util';
|
|
4
|
-
import sharp from 'sharp';
|
|
5
3
|
import type { ResizeOptions, Sharp } from 'sharp';
|
|
4
|
+
import sharp from 'sharp';
|
|
5
|
+
import util from 'util';
|
|
6
6
|
import type { ImageSize } from '../model/ImageSize';
|
|
7
|
-
import type { TransformationOptions } from './TransformationOptions';
|
|
8
7
|
import type { ImgAlignment, ImgSource, Picture } from '../model/Picture';
|
|
9
|
-
import { transformSrc } from './transformSrc';
|
|
10
8
|
import { isPictureSizeEmpty } from '../utils/isPictureSizeEmpty';
|
|
9
|
+
import type { TransformationOptions } from './TransformationOptions';
|
|
10
|
+
import { transformSrc } from './transformSrc';
|
|
11
11
|
|
|
12
12
|
const mkdir = util.promisify(fs.mkdir);
|
|
13
13
|
|
|
@@ -126,20 +126,12 @@ function getCompositionResizeSize(
|
|
|
126
126
|
const { width, height } = size;
|
|
127
127
|
const { width: containerWidth, height: containerHeight } = containerSize;
|
|
128
128
|
|
|
129
|
-
let widthRatio = 0;
|
|
130
|
-
let heightRatio = 0;
|
|
131
|
-
|
|
132
129
|
if (!(width || height)) {
|
|
133
130
|
return undefined;
|
|
134
131
|
}
|
|
135
132
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (height) {
|
|
141
|
-
heightRatio = containerHeight / height;
|
|
142
|
-
}
|
|
133
|
+
const widthRatio = width ? containerWidth / width : 0;
|
|
134
|
+
const heightRatio = height ? containerHeight / height : 0;
|
|
143
135
|
|
|
144
136
|
return widthRatio > heightRatio
|
|
145
137
|
? { width: Math.min(Number(width), containerWidth) }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { unified } from 'unified';
|
|
2
|
-
import remarkParse from 'remark-parse';
|
|
3
1
|
import remarkHtml from 'remark-html';
|
|
2
|
+
import remarkParse from 'remark-parse';
|
|
3
|
+
import { unified } from 'unified';
|
|
4
4
|
|
|
5
5
|
export async function transformMarkdown(markdown: string | null | undefined): Promise<string> {
|
|
6
6
|
if (!markdown) {
|
|
@@ -9,5 +9,5 @@ export async function transformMarkdown(markdown: string | null | undefined): Pr
|
|
|
9
9
|
|
|
10
10
|
const result = await unified().use(remarkParse).use(remarkHtml).process(markdown);
|
|
11
11
|
|
|
12
|
-
return result.toString('utf-8');
|
|
12
|
+
return result.toString('utf-8').replaceAll(/<h(\d)>([^<]*)<\/h\d>/g, '<p class="h$1">$2</p>');
|
|
13
13
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import type { AsyncDataResponse, Fetcher } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
3
|
+
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
4
|
+
|
|
5
|
+
const STORAGE_DEFAULT_TTL = 86400000; // 24 * 60 * 60 * 1000
|
|
6
|
+
|
|
7
|
+
export function useCachedAsyncData<Data = any>(
|
|
8
|
+
key: string,
|
|
9
|
+
fetcher: Fetcher<Data, string>,
|
|
10
|
+
storage: any = globalThis?.localStorage,
|
|
11
|
+
): AsyncDataResponse<Data> {
|
|
12
|
+
const cachedFetcher: typeof fetcher = useCallback(
|
|
13
|
+
async (...args) => {
|
|
14
|
+
const storageKey = `async:${key}`;
|
|
15
|
+
const storageData: string = storage.getItem(storageKey);
|
|
16
|
+
|
|
17
|
+
const cachedData = getParsedData(storageData);
|
|
18
|
+
if (cachedData) {
|
|
19
|
+
return cachedData;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const data = await fetcher(...args);
|
|
23
|
+
storage.setItem(storageKey, JSON.stringify({ data, timestamp: Date.now() }));
|
|
24
|
+
|
|
25
|
+
return data;
|
|
26
|
+
},
|
|
27
|
+
[key, fetcher],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
return useAsyncData(key, cachedFetcher);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getParsedData(storageData: string) {
|
|
34
|
+
const { data = null, timestamp = null } = storageData ? JSON.parse(storageData) : {};
|
|
35
|
+
|
|
36
|
+
return data && Date.now() - timestamp < STORAGE_DEFAULT_TTL ? data : undefined;
|
|
37
|
+
}
|