@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 @@
|
|
|
1
|
+
export declare const groupBy: <K, V>(list: V[], keyGetter: (input: V) => K) => Map<K, V[]>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CarouselRecommendationCardContent } from './CarouselRecommendationCardContent';
|
|
2
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
3
|
+
export interface RecommendationCardProps extends CarouselRecommendationCardContent, UniBlockProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const CarouselRecommendationCard: import("@redneckz/uni-jsx").UNIComponent<RecommendationCardProps, any, any>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.CarouselRecommendationCard = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const BaseTile_1 = require("../BaseTile/BaseTile");
|
|
5
|
+
const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
6
|
+
const BorderVersion_1 = require("../../model/BorderVersion");
|
|
7
|
+
const Heading_1 = require("../../ui-kit/Heading/Heading");
|
|
8
|
+
const Img_1 = require("../../ui-kit/Img/Img");
|
|
9
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
10
|
+
const List_1 = require("../../ui-kit/List/List");
|
|
11
|
+
const ButtonSection_1 = require("../../ui-kit/Button/ButtonSection");
|
|
12
|
+
const SocialMedia_1 = require("../Footer/SocialMedia");
|
|
13
|
+
const BlockVersion_1 = require("../../model/BlockVersion");
|
|
14
|
+
exports.CarouselRecommendationCard = (0, uni_jsx_1.JSX)(({ button, className = '', description, image, items = [], socialMedia = [], title, version = 'primary', ...rest }) => {
|
|
15
|
+
const tileTitle = title ? ((0, jsx_runtime_1.jsx)(Heading_1.Heading, { headingType: "h5", as: "h3", className: "mb-3.5 z-10", title: title })) : null;
|
|
16
|
+
const tileImage = image?.src ? ((0, jsx_runtime_1.jsx)(Img_1.Img, { className: "absolute bottom-0 right-0 m-0", image: image })) : null;
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: `relative text-left border border-solid box-border p-7 min-w-[524px]
|
|
18
|
+
${BorderVersion_1.BorderVersionStyleMap[version]}
|
|
19
|
+
${BlockVersion_1.VersionStyleMap[version]}
|
|
20
|
+
${className}`, ...rest, children: (0, jsx_runtime_1.jsx)(BaseTile_1.BaseTile, { className: "flex justify-between", title: tileTitle, image: tileImage, children: (0, jsx_runtime_1.jsxs)("div", { className: "h-full flex flex-col justify-between", children: [description ? (0, jsx_runtime_1.jsx)("span", { className: "mb-2", children: description }) : null, items.length ? ((0, jsx_runtime_1.jsx)(List_1.List, { className: "text-xl-light flex flex-col flex-1 gap-2 max-w-[236px]", items: items, version: version })) : null, socialMedia.length ? ((0, jsx_runtime_1.jsx)(SocialMedia_1.SocialMedia, { className: "pt-10 pb-0", media: socialMedia, version: version })) : null, button?.text ? (0, jsx_runtime_1.jsx)("div", { className: "pt-2 mt-16", children: (0, ButtonSection_1.renderButton)({ button }) }) : null] }) }) }));
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=CarouselRecommendationCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarouselRecommendationCard.js","sourceRoot":"","sources":["../../../src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx"],"names":[],"mappings":";;;AAAA,mDAAgD;AAChD,4DAAyD;AACzD,6DAAkE;AAClE,0DAAuD;AACvD,8CAA2C;AAC3C,+CAAwC;AACxC,iDAA8C;AAC9C,qEAAiE;AACjE,uDAAoD;AACpD,2DAA2D;AAM9C,QAAA,0BAA0B,GAAG,IAAA,aAAG,EAC3C,CAAC,EACC,MAAM,EACN,SAAS,GAAG,EAAE,EACd,WAAW,EACX,KAAK,EACL,KAAK,GAAG,EAAE,EACV,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,OAAO,GAAG,SAAS,EACnB,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CACxB,uBAAC,iBAAO,IAAC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ouselRecommendationCard/CarouselRecommendationCardContent.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
* @title Карточка рекомендаций
|
|
9
|
+
*/
|
|
10
|
+
export interface CarouselRecommendationCardContent extends HeadlineCommonProps, ListContent {
|
|
11
|
+
/**
|
|
12
|
+
* @title Соц сети
|
|
13
|
+
* @minItems 3
|
|
14
|
+
* @default [
|
|
15
|
+
* { "href": "https://t.me" },
|
|
16
|
+
* { "href": "https://vk.com" },
|
|
17
|
+
* { "href": "https://ok.ru" },
|
|
18
|
+
* ]
|
|
19
|
+
*/
|
|
20
|
+
socialMedia?: LinkCommonProps[];
|
|
21
|
+
/**
|
|
22
|
+
* @default {
|
|
23
|
+
* "format": "webp",
|
|
24
|
+
* "size": {
|
|
25
|
+
* "width": 290
|
|
26
|
+
* },
|
|
27
|
+
* "sources": [{
|
|
28
|
+
* "media": 1279,
|
|
29
|
+
* "width": 174,
|
|
30
|
+
* "format": "webp",
|
|
31
|
+
* "alignment": "southeast"
|
|
32
|
+
* }]
|
|
33
|
+
* }
|
|
34
|
+
*/
|
|
35
|
+
image?: Picture;
|
|
36
|
+
/**
|
|
37
|
+
* @default {
|
|
38
|
+
* "text": "",
|
|
39
|
+
* "version": "secondary"
|
|
40
|
+
* }
|
|
41
|
+
*/
|
|
42
|
+
button?: ButtonProps;
|
|
43
|
+
version?: BlockVersion;
|
|
44
|
+
}
|
package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarouselRecommendationCardContent.js","sourceRoot":"","sources":["../../../src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts"],"names":[],"mappings":""}
|
|
@@ -2,12 +2,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.HeaderBurger = void 0;
|
|
3
3
|
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
-
const
|
|
5
|
+
const useLocation_1 = require("../../hooks/useLocation");
|
|
6
6
|
const Img_1 = require("../../ui-kit/Img/Img");
|
|
7
7
|
const SearchBar_1 = require("../../ui-kit/SearchBar/SearchBar");
|
|
8
|
+
const Text_1 = require("../../ui-kit/Text/Text");
|
|
8
9
|
exports.HeaderBurger = (0, uni_jsx_1.JSX)(({ burgerSubMenu, onClick, defaultLocation = '', children }) => {
|
|
9
|
-
const [
|
|
10
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20", children: [(0, jsx_runtime_1.jsx)("button", { className: "absolute top-4 right-4 border-none bg-transparent cursor-pointer", onClick: onClick, children: (0, jsx_runtime_1.jsx)(Img_1.Img, { image: "CloseIcon", width: "24", height: "24", asSVG: true }) }), (0, jsx_runtime_1.jsxs)("button", {
|
|
10
|
+
const [location] = (0, useLocation_1.useLocation)(defaultLocation);
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20", children: [(0, jsx_runtime_1.jsx)("button", { className: "absolute top-4 right-4 border-none bg-transparent cursor-pointer", onClick: onClick, children: (0, jsx_runtime_1.jsx)(Img_1.Img, { image: "CloseIcon", width: "24", height: "24", asSVG: true }) }), (0, jsx_runtime_1.jsxs)("button", { className: "flex items-center text-s p-0 mb-4 bg-transparent cursor-pointer", children: [(0, jsx_runtime_1.jsx)(Img_1.Img, { image: "GeolocationIcon", width: "20", height: "20", className: "text-primary-main box-border mr-2", asSVG: true }), (0, jsx_runtime_1.jsx)(Text_1.Text, { color: "text-secondary-text", children: location.name })] }), children, (0, jsx_runtime_1.jsx)("div", { className: "mb-7", children: burgerSubMenu?.map(renderBurgerSubMenuItem) }), (0, jsx_runtime_1.jsx)(SearchBar_1.SearchBar, { className: "grow" })] }));
|
|
11
12
|
});
|
|
12
13
|
const renderBurgerSubMenuItem = (menu, i) => {
|
|
13
14
|
const { icon, href, text } = menu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderBurger.js","sourceRoot":"","sources":["../../../src/components/Header/HeaderBurger.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC
|
|
1
|
+
{"version":3,"file":"HeaderBurger.js","sourceRoot":"","sources":["../../../src/components/Header/HeaderBurger.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,yDAAsD;AAEtD,8CAA2C;AAC3C,gEAA6D;AAC7D,iDAA8C;AAUjC,QAAA,YAAY,GAAG,IAAA,aAAG,EAC7B,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,GAAG,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7D,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAA,yBAAW,EAAC,eAAe,CAAC,CAAC;IAEhD,OAAO,CACL,iCAAK,SAAS,EAAC,kEAAkE,aAC/E,mCACE,SAAS,EAAC,kEAAkE,EAC5E,OAAO,EAAE,OAAO,YAEhB,uBAAC,SAAG,IAAC,KAAK,EAAC,WAAW,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,KAAK,SAAG,GAC/C,EACT,oCAAQ,SAAS,EAAC,iEAAiE,aACjF,uBAAC,SAAG,IACF,KAAK,EAAC,iBAAiB,EACvB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,SAAS,EAAC,mCAAmC,EAC7C,KAAK,SACL,EACF,uBAAC,WAAI,IAAC,KAAK,EAAC,qBAAqB,YAAE,QAAQ,CAAC,IAAI,GAAQ,IACjD,EACR,QAAQ,EACT,gCAAK,SAAS,EAAC,MAAM,YAAE,aAAa,EAAE,GAAG,CAAC,uBAAuB,CAAC,GAAO,EACzE,uBAAC,qBAAS,IAAC,SAAS,EAAC,MAAM,GAAG,IAC1B,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAAC,IAAqB,EAAE,CAAS,EAAE,EAAE;IACnE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAElC,OAAO,CACL,+BAA8B,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,0CAA0C,aAC3F,IAAI,CAAC,CAAC,CAAC,CACN,uBAAC,SAAG,IAAC,SAAS,EAAC,wBAAwB,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,KAAK,SAAG,CACrF,CAAC,CAAC,CAAC,IAAI,EACR,iCAAM,SAAS,EAAC,oBAAoB,YAAE,IAAI,GAAQ,KAJ5C,iBAAiB,CAAC,EAAE,CAKxB,CACL,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
2
|
+
import type { ForeignOffice } from '../../services/sitemap/SitemapProps';
|
|
2
3
|
interface HeaderSecondaryMenuContent {
|
|
3
4
|
defaultLocation?: string;
|
|
4
5
|
officesLink?: string;
|
|
5
6
|
bgColor?: BgColorVersion;
|
|
7
|
+
foreignOffices?: ForeignOffice[];
|
|
6
8
|
}
|
|
7
9
|
export interface HeaderSecondaryMenuProps extends HeaderSecondaryMenuContent {
|
|
8
10
|
className?: string;
|
|
@@ -2,8 +2,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.HeaderSecondaryMenu = void 0;
|
|
3
3
|
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
-
const
|
|
5
|
+
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
6
|
+
const useLocation_1 = require("../../hooks/useLocation");
|
|
6
7
|
const Img_1 = require("../../ui-kit/Img/Img");
|
|
8
|
+
const Location_1 = require("../../ui-kit/Location/Location");
|
|
7
9
|
const TopItem_1 = require("../../ui-kit/TopItem/TopItem");
|
|
8
10
|
const HeaderSecondaryMenuButton_1 = require("./HeaderSecondaryMenuButton");
|
|
9
11
|
const COLORS_MAP = {
|
|
@@ -18,8 +20,15 @@ const LINKS_ICON_VERSION_MAP = {
|
|
|
18
20
|
'bg-white': 'black',
|
|
19
21
|
transparent: 'white',
|
|
20
22
|
};
|
|
21
|
-
exports.HeaderSecondaryMenu = (0, uni_jsx_1.JSX)(({ className, officesLink, defaultLocation = 'Москва', bgColor = 'bg-white' }) => {
|
|
22
|
-
const [
|
|
23
|
-
|
|
23
|
+
exports.HeaderSecondaryMenu = (0, uni_jsx_1.JSX)(({ className, officesLink, defaultLocation = 'Москва', foreignOffices, bgColor = 'bg-white', }) => {
|
|
24
|
+
const [isShowLocationModal, setShowLocationModal] = (0, hooks_1.useState)(false);
|
|
25
|
+
const [location, onChangeLocation] = (0, useLocation_1.useLocation)(defaultLocation);
|
|
26
|
+
const showLocationModal = () => {
|
|
27
|
+
setShowLocationModal(true);
|
|
28
|
+
};
|
|
29
|
+
const hideLocationModal = () => {
|
|
30
|
+
setShowLocationModal(false);
|
|
31
|
+
};
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `flex items-center ${className || ''}`, children: [(0, jsx_runtime_1.jsx)(TopItem_1.TopItem, { className: "mr-5", flat: true, href: "#", text: location.name, ariaLabel: "\u041C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435", onClick: showLocationModal, bgColor: bgColor }), officesLink ? ((0, jsx_runtime_1.jsx)(TopItem_1.TopItem, { className: "mr-7", flat: true, href: officesLink, 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", bgColor: bgColor })) : null, (0, jsx_runtime_1.jsx)(HeaderSecondaryMenuButton_1.HeaderSecondaryMenuButton, { className: `mr-5 group ${COLORS_MAP[bgColor]}`, ariaLabel: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u0430\u0439\u0442\u0443", children: (0, jsx_runtime_1.jsx)(Img_1.Img, { image: { icon: 'LoupeIcon', iconVersion: LINKS_ICON_VERSION_MAP[bgColor] }, className: "h-full pointer-events-none", imageClassName: "group-hover:text-primary-hover group-hover:invert-0 pointer-events-none", asSVG: true }) }), (0, jsx_runtime_1.jsx)(HeaderSecondaryMenuButton_1.HeaderSecondaryMenuButton, { className: `${LINKS_COLORS_MAP[bgColor]} group min-w-8 min-h-8`, ariaLabel: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0441\u0441\u044B\u043B\u043A\u0438", children: (0, jsx_runtime_1.jsx)(Img_1.Img, { image: { icon: 'GridIcon', iconVersion: LINKS_ICON_VERSION_MAP[bgColor] }, className: "h-full bg-main-divider/20 rounded-full pointer-events-none", imageClassName: "group-hover:text-primary-hover group-hover:invert-0", asSVG: true }) }), isShowLocationModal ? ((0, jsx_runtime_1.jsx)(Location_1.Location, { currentLocation: location, foreignOffices: foreignOffices, onChangeLocation: onChangeLocation, close: hideLocationModal })) : null] }));
|
|
24
33
|
});
|
|
25
34
|
//# sourceMappingURL=HeaderSecondaryMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderSecondaryMenu.js","sourceRoot":"","sources":["../../../src/components/Header/HeaderSecondaryMenu.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC
|
|
1
|
+
{"version":3,"file":"HeaderSecondaryMenu.js","sourceRoot":"","sources":["../../../src/components/Header/HeaderSecondaryMenu.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAuD;AACvD,yDAAsD;AAItD,8CAA2C;AAC3C,6DAA0D;AAC1D,0DAAuD;AACvD,2EAAwE;AAaxE,MAAM,UAAU,GAAmC;IACjD,UAAU,EAAE,2CAA2C;IACvD,WAAW,EAAE,YAAY;CAC1B,CAAC;AACF,MAAM,gBAAgB,GAAmC;IACvD,UAAU,EAAE,iDAAiD;IAC7D,WAAW,EAAE,YAAY;CAC1B,CAAC;AACF,MAAM,sBAAsB,GAAwC;IAClE,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,OAAO;CACrB,CAAC;AAEW,QAAA,mBAAmB,GAAG,IAAA,aAAG,EACpC,CAAC,EACC,SAAS,EACT,WAAW,EACX,eAAe,GAAG,QAAQ,EAC1B,cAAc,EACd,OAAO,GAAG,UAAU,GACrB,EAAE,EAAE;IACH,MAAM,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAE7E,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC,GAAG,IAAA,yBAAW,EAAC,eAAe,CAAC,CAAC;IAElE,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC7B,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC;IACF,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC7B,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC,CAAC;IAEF,OAAO,CACL,iCAAK,SAAS,EAAE,qBAAqB,SAAS,IAAI,EAAE,EAAE,aACp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CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -5,33 +5,20 @@ const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
|
5
5
|
const BlockVersion_1 = require("../../model/BlockVersion");
|
|
6
6
|
const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
7
7
|
const ButtonSection_1 = require("../../ui-kit/Button/ButtonSection");
|
|
8
|
-
const Img_1 = require("../../ui-kit/Img/Img");
|
|
9
8
|
const getTileRightPadding_1 = require("../BaseTile/getTileRightPadding");
|
|
10
9
|
const Headline_1 = require("../Headline/Headline");
|
|
10
|
+
const renderAdditionalDescription_1 = require("./renderAdditionalDescription");
|
|
11
|
+
const renderBenefit_1 = require("./renderBenefit");
|
|
12
|
+
const renderImage_1 = require("./renderImage");
|
|
11
13
|
exports.ProductTile = (0, uni_jsx_1.JSX)(({ className = '', title, headlineVersion = 'S', description, additionalDescription, benefits = [], buttons, image, isImageOnRightSide = true, version = 'primary', ...rest }) => ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: `overflow-hidden font-sans p-9 box-border relative min-h-[364px]
|
|
12
|
-
${BlockVersion_1.VersionStyleMap[version]} ${(0, getTileRightPadding_1.getTileRightPadding)(className)} ${className}`, ...rest, children: [(0, jsx_runtime_1.jsxs)("div", { className: `flex flex-col ${isImageOnRightSide ? '' : 'items-end'}`, children: [(0, jsx_runtime_1.jsx)(Headline_1.Headline, { className: `!p-0 !bg-transparent z-10 ${title || description ? 'mb-3.5' : ''}`, as: "h2", title: title, description: description, headlineVersion: headlineVersion, bgColorHeadline: version, align: "left", ...rest }), renderBenefits(benefits, version, image),
|
|
14
|
+
${BlockVersion_1.VersionStyleMap[version]} ${(0, getTileRightPadding_1.getTileRightPadding)(className)} ${className}`, ...rest, children: [(0, jsx_runtime_1.jsxs)("div", { className: `flex flex-col ${isImageOnRightSide ? '' : 'items-end'}`, children: [(0, jsx_runtime_1.jsx)(Headline_1.Headline, { className: `!p-0 !bg-transparent z-10 ${title || description ? 'mb-3.5' : ''}`, as: "h2", title: title, description: description, headlineVersion: headlineVersion, bgColorHeadline: version, align: "left", ...rest }), renderBenefits(benefits, version, image), (0, renderAdditionalDescription_1.renderAdditionalDescription)(additionalDescription, image), buttons?.length ? ((0, jsx_runtime_1.jsx)(ButtonSection_1.ButtonSection, { buttons: buttons, className: "mt-5 gap-4 z-10 text-l" })) : null] }), (0, renderImage_1.renderImage)(image, isImageOnRightSide)] })));
|
|
13
15
|
function renderBenefits(benefits, version, image) {
|
|
14
|
-
|
|
15
|
-
const BENEFITS_WIDTH = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: `z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline
|
|
17
|
-
${BENEFITS_WIDTH}`, children: benefits.length ? benefits.map(renderBenefit(version)) : null }));
|
|
18
|
-
}
|
|
19
|
-
const renderBenefit = (version = 'primary') => (benefit, i) => {
|
|
20
|
-
const { label = '', description = '' } = benefit;
|
|
21
|
-
return [
|
|
22
|
-
(0, jsx_runtime_1.jsx)("div", { className: "text-h6", children: label }, `label-${i}`),
|
|
23
|
-
(0, jsx_runtime_1.jsx)("div", { className: `text-m-light ${BlockVersion_1.VersionAdditionalStyleMap[version]}`, children: description }, `desc-${i}`),
|
|
24
|
-
];
|
|
25
|
-
};
|
|
26
|
-
function renderAdditionalDescription(additionalDescription, image) {
|
|
27
|
-
// picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
|
|
28
|
-
const DESCRIPTION_WIDTH = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: `text-m-light mt-2.5 z-10 ${DESCRIPTION_WIDTH}`, children: additionalDescription }));
|
|
30
|
-
}
|
|
31
|
-
function renderImage(image, isImageOnRightSide) {
|
|
32
|
-
if (!image?.src) {
|
|
16
|
+
if (!benefits.length) {
|
|
33
17
|
return null;
|
|
34
18
|
}
|
|
35
|
-
|
|
19
|
+
// picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
|
|
20
|
+
const benefitsWidth = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `z-10 grid grid-cols-[max-content_1fr] auto-rows-auto gap-x-6 gap-y-2.5 items-baseline
|
|
22
|
+
${benefitsWidth}`, children: benefits.length ? benefits.map((0, renderBenefit_1.renderBenefit)(version)) : null }));
|
|
36
23
|
}
|
|
37
24
|
//# sourceMappingURL=ProductTile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductTile.js","sourceRoot":"","sources":["../../../src/components/ProductTile/ProductTile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"ProductTile.js","sourceRoot":"","sources":["../../../src/components/ProductTile/ProductTile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,2DAA2D;AAG3D,4DAAyD;AACzD,qEAAkE;AAClE,yEAAsE;AACtE,mDAAgD;AAEhD,+EAA4E;AAC5E,mDAAgD;AAChD,+CAA4C;AAI/B,QAAA,WAAW,GAAG,IAAA,aAAG,EAC5B,CAAC,EACC,SAAS,GAAG,EAAE,EACd,KAAK,EACL,eAAe,GAAG,GAAG,EACrB,WAAW,EACX,qBAAqB,EACrB,QAAQ,GAAG,EAAE,EACb,OAAO,EACP,KAAK,EACL,kBAAkB,GAAG,IAAI,EACzB,OAAO,GAAG,SAAS,EACnB,GAAG,IAAI,EACR,EAAE,EAAE,CAAC,CACJ,wBAAC,2BAAY,IACX,SAAS,EAAE;YACL,8BAAe,CAAC,OAAO,CAAC,IAAI,IAAA,yCAAmB,EAAC,SAAS,CAAC,IAAI,SAAS,EAAE,KAC3E,IAAI,aAER,iCAAK,SAAS,EAAE,iBAAiB,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,aACtE,uBAAC,mBAAQ,IACP,SAAS,EAAE,6BAA6B,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,EAC9E,EAAE,EAAC,IAAI,EACP,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,OAAO,EACxB,KAAK,EAAC,MAAM,KACR,IAAI,GACR,EACD,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,EACxC,IAAA,yDAA2B,EAAC,qBAAqB,EAAE,KAAK,CAAC,EACzD,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CACjB,uBAAC,6BAAa,IAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAC,wBAAwB,GAAG,CACvE,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,IAAA,yBAAW,EAAC,KAAK,EAAE,kBAAkB,CAAC,IAC1B,CAChB,CACF,CAAC;AAEF,SAAS,cAAc,CAAC,QAAmB,EAAE,OAAqB,EAAE,KAAe;IACjF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;QACpB,OAAO,IAAI,CAAC;KACb;IAED,wGAAwG;IACxG,MAAM,aAAa,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,MAAM,CAAC;IAEvE,OAAO,CACL,gCACE,SAAS,EAAE;UACP,aAAa,EAAE,YAElB,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAA,6BAAa,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAC1D,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -2,7 +2,28 @@ 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
|
-
|
|
5
|
+
import type { MarkdownTextProps } from '../../ui-kit/MarkdownText/MarkdownTextProps';
|
|
6
|
+
/**
|
|
7
|
+
* @title Стандартный
|
|
8
|
+
*/
|
|
9
|
+
declare type TextBenefit = DescriptionProps & LabelProps & {
|
|
10
|
+
/** @default default */
|
|
11
|
+
type: 'default';
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* @title Форматированный текст
|
|
15
|
+
*/
|
|
16
|
+
declare type MarkdownTextContent = MarkdownTextProps & {
|
|
17
|
+
/** @default md */
|
|
18
|
+
type: 'md';
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* @title Преимущество
|
|
22
|
+
* @default{
|
|
23
|
+
* "type": "default"
|
|
24
|
+
* }
|
|
25
|
+
*/
|
|
26
|
+
export declare type Benefit = TextBenefit | MarkdownTextContent;
|
|
6
27
|
/**
|
|
7
28
|
* @title Продуктовая плитка
|
|
8
29
|
*/
|
|
@@ -27,9 +48,10 @@ export declare type ProductTileContent = HeadlineProps & ButtonContent & {
|
|
|
27
48
|
* @title Преимущества
|
|
28
49
|
* @maxItems 7
|
|
29
50
|
*/
|
|
30
|
-
benefits?:
|
|
51
|
+
benefits?: Benefit[];
|
|
31
52
|
/** @title Дополнительное описание */
|
|
32
53
|
additionalDescription?: string;
|
|
33
54
|
/** @title Картинка справа/текст слева */
|
|
34
55
|
isImageOnRightSide?: boolean;
|
|
35
56
|
};
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
+
import type { Picture } from '../../model/Picture';
|
|
4
|
+
export declare function renderAdditionalDescription(additionalDescription?: string, image?: Picture, version?: BlockVersion): JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.renderAdditionalDescription = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const Paragraph_1 = require("../../ui-kit/Paragraph/Paragraph");
|
|
5
|
+
const DESCRIPTION_STYLE_MAP = {
|
|
6
|
+
primary: 'text-secondary-text',
|
|
7
|
+
secondary: 'text-white',
|
|
8
|
+
};
|
|
9
|
+
function renderAdditionalDescription(additionalDescription, image, version = 'primary') {
|
|
10
|
+
if (!additionalDescription) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
// picture width = 242px. Text can overlay picture 20px deep. Outer paddings_x = 36px. 242-36-20 = 186px
|
|
14
|
+
const descriptionWidth = image?.src ? 'max-w-[calc(100%-186px)]' : '100%';
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `mt-2.5 z-10 ${descriptionWidth}`, children: (0, jsx_runtime_1.jsx)(Paragraph_1.Paragraph, { size: "text-m", font: "font-light", color: DESCRIPTION_STYLE_MAP[version], children: additionalDescription }) }));
|
|
16
|
+
}
|
|
17
|
+
exports.renderAdditionalDescription = renderAdditionalDescription;
|
|
18
|
+
//# sourceMappingURL=renderAdditionalDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderAdditionalDescription.js","sourceRoot":"","sources":["../../../src/components/ProductTile/renderAdditionalDescription.tsx"],"names":[],"mappings":";;;AAEA,gEAA6D;AAG7D,MAAM,qBAAqB,GAAoC;IAC7D,OAAO,EAAE,qBAAqB;IAC9B,SAAS,EAAE,YAAY;CACxB,CAAC;AAEF,SAAgB,2BAA2B,CACzC,qBAA8B,EAC9B,KAAe,EACf,UAAwB,SAAS;IAEjC,IAAI,CAAC,qBAAqB,EAAE;QAC1B,OAAO,IAAI,CAAC;KACb;IAED,wGAAwG;IACxG,MAAM,gBAAgB,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,MAAM,CAAC;IAE1E,OAAO,CACL,gCAAK,SAAS,EAAE,eAAe,gBAAgB,EAAE,YAC/C,uBAAC,qBAAS,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,YAAY,EAAC,KAAK,EAAE,qBAAqB,CAAC,OAAO,CAAC,YAC7E,qBAAqB,GACZ,GACR,CACP,CAAC;AACJ,CAAC;AAnBD,kEAmBC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
+
import type { Benefit } from './ProductTileContent';
|
|
4
|
+
export declare const renderBenefit: (version?: BlockVersion) => (benefit: Benefit, i: number) => JSX.Element | JSX.Element[] | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.renderBenefit = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const MarkdownText_1 = require("../../ui-kit/MarkdownText/MarkdownText");
|
|
5
|
+
const Text_1 = require("../../ui-kit/Text/Text");
|
|
6
|
+
const assertUnreachable_1 = require("../../utils/assertUnreachable");
|
|
7
|
+
const LABEL_STYLE_MAP = {
|
|
8
|
+
primary: 'text-secondary-text',
|
|
9
|
+
secondary: 'text-white',
|
|
10
|
+
};
|
|
11
|
+
const renderBenefit = (version = 'primary') =>
|
|
12
|
+
// Linter doesn't understand that switch processes all cases
|
|
13
|
+
// eslint-disable-next-line consistent-return
|
|
14
|
+
(benefit, i) => {
|
|
15
|
+
const { type } = benefit;
|
|
16
|
+
if (!(type === 'default' || type === 'md')) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
switch (type) {
|
|
20
|
+
case 'default':
|
|
21
|
+
return [
|
|
22
|
+
(0, jsx_runtime_1.jsx)(Text_1.Text, { size: "text-h6", children: benefit.label }, `label-${i}`),
|
|
23
|
+
(0, jsx_runtime_1.jsx)(Text_1.Text, { size: "text-m-light", color: LABEL_STYLE_MAP[version], children: benefit.description }, `desc-${i}`),
|
|
24
|
+
];
|
|
25
|
+
case 'md':
|
|
26
|
+
return (0, jsx_runtime_1.jsx)(MarkdownText_1.MarkdownText, { md: benefit.md });
|
|
27
|
+
default:
|
|
28
|
+
(0, assertUnreachable_1.assertUnreachable)(benefit);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.renderBenefit = renderBenefit;
|
|
32
|
+
//# sourceMappingURL=renderBenefit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderBenefit.js","sourceRoot":"","sources":["../../../src/components/ProductTile/renderBenefit.tsx"],"names":[],"mappings":";;;AACA,yEAAsE;AACtE,iDAA8C;AAE9C,qEAAkE;AAGlE,MAAM,eAAe,GAAoC;IACvD,OAAO,EAAE,qBAAqB;IAC9B,SAAS,EAAE,YAAY;CACxB,CAAC;AAEK,MAAM,aAAa,GACxB,CAAC,UAAwB,SAAS,EAAE,EAAE;AACtC,4DAA4D;AAC5D,6CAA6C;AAC7C,CAAC,OAAgB,EAAE,CAAS,EAAE,EAAE;IAC9B,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,CAAC,EAAE;QAC1C,OAAO,IAAI,CAAC;KACb;IAED,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO;gBACL,uBAAC,WAAI,IAAoB,IAAI,EAAC,SAAS,YACpC,OAAO,CAAC,KAAK,IADL,SAAS,CAAC,EAAE,CAEhB;gBACP,uBAAC,WAAI,IAAmB,IAAI,EAAC,cAAc,EAAC,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,YACxE,OAAO,CAAC,WAAW,IADX,QAAQ,CAAC,EAAE,CAEf;aACR,CAAC;QACJ,KAAK,IAAI;YACP,OAAO,uBAAC,2BAAY,IAAC,EAAE,EAAE,OAAO,CAAC,EAAE,GAAI,CAAC;QAC1C;YACE,IAAA,qCAAiB,EAAC,OAAO,CAAC,CAAC;KAC9B;AACH,CAAC,CAAC;AA1BS,QAAA,aAAa,iBA0BtB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.renderImage = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const Img_1 = require("../../ui-kit/Img/Img");
|
|
5
|
+
function renderImage(image, isImageOnRightSide) {
|
|
6
|
+
if (!image?.src) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(Img_1.Img, { className: `absolute ${isImageOnRightSide ? 'right-0' : 'left-0'} bottom-0`, image: image }));
|
|
10
|
+
}
|
|
11
|
+
exports.renderImage = renderImage;
|
|
12
|
+
//# sourceMappingURL=renderImage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderImage.js","sourceRoot":"","sources":["../../../src/components/ProductTile/renderImage.tsx"],"names":[],"mappings":";;;AACA,8CAA2C;AAE3C,SAAgB,WAAW,CAAC,KAAe,EAAE,kBAA4B;IACvE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE;QACf,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,uBAAC,SAAG,IACF,SAAS,EAAE,YAAY,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,WAAW,EAC3E,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;AACJ,CAAC;AAXD,kCAWC"}
|
|
@@ -11,6 +11,6 @@ const SocialMedia_1 = require("../Footer/SocialMedia");
|
|
|
11
11
|
exports.RecommendationCard = (0, uni_jsx_1.JSX)(({ className = '', title, description, items, image, version, socialMedia, button }) => {
|
|
12
12
|
const tileTitle = title ? ((0, jsx_runtime_1.jsx)(Heading_1.Heading, { headingType: "h5", as: "h3", className: "mb-3.5 z-10", title: title })) : null;
|
|
13
13
|
const tileImage = image?.src ? ((0, jsx_runtime_1.jsx)(Img_1.Img, { className: "absolute bottom-0 right-0 m-0", image: image })) : null;
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)("section", { className: `relative overflow-hidden text-left border border-solid box-border p-7 min-w-[524px] min-h-[218px] ${className}`, role: "listitem", children: (0, jsx_runtime_1.jsx)(BaseTile_1.BaseTile, { className: "flex justify-between", title: tileTitle, image: tileImage, children: (0, jsx_runtime_1.jsxs)("div", { className: "h-full flex flex-col justify-between", children: [description ? (0, jsx_runtime_1.jsx)("span", { className: "mb-2", children: description }) : null, items?.length ? ((0, jsx_runtime_1.jsx)(List_1.List, { className: "text-xl-light flex flex-col flex-1 gap-2 max-w-[236px]", items: items, version: version })) : null, socialMedia ? ((0, jsx_runtime_1.jsx)(SocialMedia_1.SocialMedia, { className: "pt-10 pb-0", media: socialMedia, version: version })) : null, button?.text ? ((0, jsx_runtime_1.jsx)("div", { className: "pt-2", children: (0, ButtonSection_1.renderButton)({ button, buttonClassName: 'mt-16' }) })) : null] }) }) }));
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)("section", { className: `relative overflow-hidden text-left border border-solid box-border p-7 min-w-[524px] min-h-[218px] ${className}`, role: "listitem", children: (0, jsx_runtime_1.jsx)(BaseTile_1.BaseTile, { className: "flex justify-between", title: tileTitle, image: tileImage, children: (0, jsx_runtime_1.jsxs)("div", { className: "h-full flex flex-col justify-between", children: [description ? (0, jsx_runtime_1.jsx)("span", { className: "mb-2", children: description }) : null, items?.length ? ((0, jsx_runtime_1.jsx)(List_1.List, { className: "text-xl-light flex flex-col flex-1 gap-2 max-w-[236px]", items: items, version: version })) : null, socialMedia ? ((0, jsx_runtime_1.jsx)(SocialMedia_1.SocialMedia, { className: "pt-10 pb-0", media: socialMedia, version: version })) : null, button?.text ? ((0, jsx_runtime_1.jsx)("div", { className: "pt-2", children: (0, ButtonSection_1.renderButton)({ button, buttonClassName: 'mt-16 px-5' }) })) : null] }) }) }));
|
|
15
15
|
});
|
|
16
16
|
//# sourceMappingURL=RecommendationCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecommendationCard.js","sourceRoot":"","sources":["../../../src/components/Recommendation/RecommendationCard.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,qEAAiE;AACjE,0DAAuD;AACvD,8CAA2C;AAC3C,iDAA8C;AAC9C,mDAAgD;AAChD,uDAAoD;AAQvC,QAAA,kBAAkB,GAAG,IAAA,aAAG,EACnC,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE;IACrF,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CACxB,uBAAC,iBAAO,IAAC,WAAW,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,SAAS,EAAC,aAAa,EAAC,KAAK,EAAE,KAAK,GAAI,CAC3E,CAAC,CAAC,CAAC,IAAI,CAAC;IACT,MAAM,SAAS,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAC7B,uBAAC,SAAG,IAAC,SAAS,EAAC,+BAA+B,EAAC,KAAK,EAAE,KAAK,GAAI,CAChE,CAAC,CAAC,CAAC,IAAI,CAAC;IAET,OAAO,CACL,oCACE,SAAS,EAAE,qGAAqG,SAAS,EAAE,EAC3H,IAAI,EAAC,UAAU,YAEf,uBAAC,mBAAQ,IAAC,SAAS,EAAC,sBAAsB,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,YAC3E,iCAAK,SAAS,EAAC,sCAAsC,aAClD,WAAW,CAAC,CAAC,CAAC,iCAAM,SAAS,EAAC,MAAM,YAAE,WAAW,GAAQ,CAAC,CAAC,CAAC,IAAI,EAChE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CACf,uBAAC,WAAI,IACH,SAAS,EAAC,wDAAwD,EAClE,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,GAChB,CACH,CAAC,CAAC,CAAC,IAAI,EACP,WAAW,CAAC,CAAC,CAAC,CACb,uBAAC,yBAAW,IAAC,SAAS,EAAC,YAAY,EAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,GAAI,CAC7E,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CACd,gCAAK,SAAS,EAAC,MAAM,YAAE,IAAA,4BAAY,EAAC,EAAE,MAAM,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"RecommendationCard.js","sourceRoot":"","sources":["../../../src/components/Recommendation/RecommendationCard.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,qEAAiE;AACjE,0DAAuD;AACvD,8CAA2C;AAC3C,iDAA8C;AAC9C,mDAAgD;AAChD,uDAAoD;AAQvC,QAAA,kBAAkB,GAAG,IAAA,aAAG,EACnC,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE;IACrF,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CACxB,uBAAC,iBAAO,IAAC,WAAW,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,SAAS,EAAC,aAAa,EAAC,KAAK,EAAE,KAAK,GAAI,CAC3E,CAAC,CAAC,CAAC,IAAI,CAAC;IACT,MAAM,SAAS,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAC7B,uBAAC,SAAG,IAAC,SAAS,EAAC,+BAA+B,EAAC,KAAK,EAAE,KAAK,GAAI,CAChE,CAAC,CAAC,CAAC,IAAI,CAAC;IAET,OAAO,CACL,oCACE,SAAS,EAAE,qGAAqG,SAAS,EAAE,EAC3H,IAAI,EAAC,UAAU,YAEf,uBAAC,mBAAQ,IAAC,SAAS,EAAC,sBAAsB,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,YAC3E,iCAAK,SAAS,EAAC,sCAAsC,aAClD,WAAW,CAAC,CAAC,CAAC,iCAAM,SAAS,EAAC,MAAM,YAAE,WAAW,GAAQ,CAAC,CAAC,CAAC,IAAI,EAChE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CACf,uBAAC,WAAI,IACH,SAAS,EAAC,wDAAwD,EAClE,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,GAChB,CACH,CAAC,CAAC,CAAC,IAAI,EACP,WAAW,CAAC,CAAC,CAAC,CACb,uBAAC,yBAAW,IAAC,SAAS,EAAC,YAAY,EAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,GAAI,CAC7E,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CACd,gCAAK,SAAS,EAAC,MAAM,YAAE,IAAA,4BAAY,EAAC,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC,GAAO,CACtF,CAAC,CAAC,CAAC,IAAI,IACJ,GACG,GACH,CACX,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ImageSize } from '../model/ImageSize';
|
|
2
|
-
import type { TransformationOptions } from './TransformationOptions';
|
|
3
2
|
import type { ImgSource } from '../model/Picture';
|
|
3
|
+
import type { TransformationOptions } from './TransformationOptions';
|
|
4
4
|
declare type TransformImgParams = {
|
|
5
5
|
pagePath: string;
|
|
6
6
|
src: string;
|
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.transformImg = void 0;
|
|
6
6
|
const fs_1 = __importDefault(require("fs"));
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const util_1 = __importDefault(require("util"));
|
|
9
8
|
const sharp_1 = __importDefault(require("sharp"));
|
|
10
|
-
const
|
|
9
|
+
const util_1 = __importDefault(require("util"));
|
|
11
10
|
const isPictureSizeEmpty_1 = require("../utils/isPictureSizeEmpty");
|
|
11
|
+
const transformSrc_1 = require("./transformSrc");
|
|
12
12
|
const mkdir = util_1.default.promisify(fs_1.default.mkdir);
|
|
13
13
|
async function transformImg({ pagePath, src, containerSize, transformationOptions, }) {
|
|
14
14
|
if (!src) {
|
|
@@ -73,17 +73,11 @@ function getPictureSize(size, containerSize) {
|
|
|
73
73
|
function getCompositionResizeSize(containerSize, size = {}) {
|
|
74
74
|
const { width, height } = size;
|
|
75
75
|
const { width: containerWidth, height: containerHeight } = containerSize;
|
|
76
|
-
let widthRatio = 0;
|
|
77
|
-
let heightRatio = 0;
|
|
78
76
|
if (!(width || height)) {
|
|
79
77
|
return undefined;
|
|
80
78
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
if (height) {
|
|
85
|
-
heightRatio = containerHeight / height;
|
|
86
|
-
}
|
|
79
|
+
const widthRatio = width ? containerWidth / width : 0;
|
|
80
|
+
const heightRatio = height ? containerHeight / height : 0;
|
|
87
81
|
return widthRatio > heightRatio
|
|
88
82
|
? { width: Math.min(Number(width), containerWidth) }
|
|
89
83
|
: { height: Math.min(Number(height), containerHeight) };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformImg.js","sourceRoot":"","sources":["../../src/content-page-repository/transformImg.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;
|
|
1
|
+
{"version":3,"file":"transformImg.js","sourceRoot":"","sources":["../../src/content-page-repository/transformImg.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAExB,kDAA0B;AAC1B,gDAAwB;AAGxB,oEAAiE;AAEjE,iDAA8C;AAE9C,MAAM,KAAK,GAAG,cA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CAAC,EAAE,eAAe,CAAC,EAAE,CAAC;AAC5D,CAAC;AAED,SAAS,YAAY,CAAC,IAAqB;IACzC;;;OAGG;IACH,OAAO;QACL,GAAG,EAAE,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,eAAK,CAAC,GAAG,CAAC,OAAO;KACtE,CAAC;AACJ,CAAC"}
|
|
@@ -3,15 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
};
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.transformMarkdown = void 0;
|
|
6
|
-
const unified_1 = require("unified");
|
|
7
|
-
const remark_parse_1 = __importDefault(require("remark-parse"));
|
|
8
6
|
const remark_html_1 = __importDefault(require("remark-html"));
|
|
7
|
+
const remark_parse_1 = __importDefault(require("remark-parse"));
|
|
8
|
+
const unified_1 = require("unified");
|
|
9
9
|
async function transformMarkdown(markdown) {
|
|
10
10
|
if (!markdown) {
|
|
11
11
|
return '';
|
|
12
12
|
}
|
|
13
13
|
const result = await (0, unified_1.unified)().use(remark_parse_1.default).use(remark_html_1.default).process(markdown);
|
|
14
|
-
return result.toString('utf-8');
|
|
14
|
+
return result.toString('utf-8').replaceAll(/<h(\d)>([^<]*)<\/h\d>/g, '<p class="h$1">$2</p>');
|
|
15
15
|
}
|
|
16
16
|
exports.transformMarkdown = transformMarkdown;
|
|
17
17
|
//# sourceMappingURL=transformMarkdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformMarkdown.js","sourceRoot":"","sources":["../../src/content-page-repository/transformMarkdown.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"transformMarkdown.js","sourceRoot":"","sources":["../../src/content-page-repository/transformMarkdown.ts"],"names":[],"mappings":";;;;;AAAA,8DAAqC;AACrC,gEAAuC;AACvC,qCAAkC;AAE3B,KAAK,UAAU,iBAAiB,CAAC,QAAmC;IACzE,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,EAAE,CAAC;KACX;IAED,MAAM,MAAM,GAAG,MAAM,IAAA,iBAAO,GAAE,CAAC,GAAG,CAAC,sBAAW,CAAC,CAAC,GAAG,CAAC,qBAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAElF,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,wBAAwB,EAAE,uBAAuB,CAAC,CAAC;AAChG,CAAC;AARD,8CAQC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.useCachedAsyncData = void 0;
|
|
3
|
+
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
4
|
+
const useAsyncData_1 = require("@redneckz/uni-jsx/lib/hooks/useAsyncData");
|
|
5
|
+
const STORAGE_DEFAULT_TTL = 86400000; // 24 * 60 * 60 * 1000
|
|
6
|
+
function useCachedAsyncData(key, fetcher, storage = globalThis?.localStorage) {
|
|
7
|
+
const cachedFetcher = (0, hooks_1.useCallback)(async (...args) => {
|
|
8
|
+
const storageKey = `async:${key}`;
|
|
9
|
+
const storageData = storage.getItem(storageKey);
|
|
10
|
+
const cachedData = getParsedData(storageData);
|
|
11
|
+
if (cachedData) {
|
|
12
|
+
return cachedData;
|
|
13
|
+
}
|
|
14
|
+
const data = await fetcher(...args);
|
|
15
|
+
storage.setItem(storageKey, JSON.stringify({ data, timestamp: Date.now() }));
|
|
16
|
+
return data;
|
|
17
|
+
}, [key, fetcher]);
|
|
18
|
+
return (0, useAsyncData_1.useAsyncData)(key, cachedFetcher);
|
|
19
|
+
}
|
|
20
|
+
exports.useCachedAsyncData = useCachedAsyncData;
|
|
21
|
+
function getParsedData(storageData) {
|
|
22
|
+
const { data = null, timestamp = null } = storageData ? JSON.parse(storageData) : {};
|
|
23
|
+
return data && Date.now() - timestamp < STORAGE_DEFAULT_TTL ? data : undefined;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=useCachedAsyncData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCachedAsyncData.js","sourceRoot":"","sources":["../../src/hooks/useCachedAsyncData.ts"],"names":[],"mappings":";;AAAA,uDAA0D;AAE1D,2EAAwE;AAExE,MAAM,mBAAmB,GAAG,QAAQ,CAAC,CAAC,sBAAsB;AAE5D,SAAgB,kBAAkB,CAChC,GAAW,EACX,OAA8B,EAC9B,UAAe,UAAU,EAAE,YAAY;IAEvC,MAAM,aAAa,GAAmB,IAAA,mBAAW,EAC/C,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE;QAChB,MAAM,UAAU,GAAG,SAAS,GAAG,EAAE,CAAC;QAClC,MAAM,WAAW,GAAW,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAExD,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;QAC9C,IAAI,UAAU,EAAE;YACd,OAAO,UAAU,CAAC;SACnB;QAED,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;QACpC,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;QAE7E,OAAO,IAAI,CAAC;IACd,CAAC,EACD,CAAC,GAAG,EAAE,OAAO,CAAC,CACf,CAAC;IAEF,OAAO,IAAA,2BAAY,EAAC,GAAG,EAAE,aAAa,CAAC,CAAC;AAC1C,CAAC;AAxBD,gDAwBC;AAED,SAAS,aAAa,CAAC,WAAmB;IACxC,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,GAAG,IAAI,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAErF,OAAO,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,GAAG,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.useLocation = void 0;
|
|
3
|
+
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
4
|
+
const fetchJSON_1 = require("../utils/fetchJSON");
|
|
5
|
+
const useCachedAsyncData_1 = require("./useCachedAsyncData");
|
|
6
|
+
const REGION_URL = '/api/v1/region';
|
|
7
|
+
const localStorageLocation = globalThis?.localStorage.getItem('location');
|
|
8
|
+
const currentLocation = localStorageLocation
|
|
9
|
+
? JSON.parse(localStorageLocation)
|
|
10
|
+
: null;
|
|
11
|
+
function useLocation(defaultLocation) {
|
|
12
|
+
const [location, setLocation] = (0, hooks_1.useState)(currentLocation?.region ?? { name: defaultLocation });
|
|
13
|
+
const { data } = (0, useCachedAsyncData_1.useCachedAsyncData)(REGION_URL, fetchJSON_1.fetchJSONUnsafe);
|
|
14
|
+
(0, hooks_1.useEffect)(() => {
|
|
15
|
+
setLocation(currentLocation?.region && currentLocation?.manual
|
|
16
|
+
? currentLocation.region
|
|
17
|
+
: data || { name: defaultLocation });
|
|
18
|
+
}, [data]);
|
|
19
|
+
const onChangeLocation = (0, hooks_1.useCallback)((region) => {
|
|
20
|
+
globalThis?.localStorage.setItem('location', JSON.stringify({ manual: true, region }));
|
|
21
|
+
setLocation(region);
|
|
22
|
+
}, [setLocation]);
|
|
23
|
+
return [location, onChangeLocation];
|
|
24
|
+
}
|
|
25
|
+
exports.useLocation = useLocation;
|
|
26
|
+
//# sourceMappingURL=useLocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLocation.js","sourceRoot":"","sources":["../../src/hooks/useLocation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