@gravity-ui/blog-constructor 1.0.0-aplha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +231 -0
- package/LICENSE +21 -0
- package/README.md +14 -0
- package/build/cjs/blocks/Author/Author.css +31 -0
- package/build/cjs/blocks/Author/Author.d.ts +3 -0
- package/build/cjs/blocks/Author/Author.js +60 -0
- package/build/cjs/blocks/Banner/Banner.css +58 -0
- package/build/cjs/blocks/Banner/Banner.d.ts +3 -0
- package/build/cjs/blocks/Banner/Banner.js +51 -0
- package/build/cjs/blocks/CTA/CTA.css +56 -0
- package/build/cjs/blocks/CTA/CTA.d.ts +3 -0
- package/build/cjs/blocks/CTA/CTA.js +44 -0
- package/build/cjs/blocks/ColoredText/ColoredText.css +28 -0
- package/build/cjs/blocks/ColoredText/ColoredText.d.ts +3 -0
- package/build/cjs/blocks/ColoredText/ColoredText.js +37 -0
- package/build/cjs/blocks/Feed/Feed.d.ts +3 -0
- package/build/cjs/blocks/Feed/Feed.js +183 -0
- package/build/cjs/blocks/Feed/reducer.d.ts +65 -0
- package/build/cjs/blocks/Feed/reducer.js +40 -0
- package/build/cjs/blocks/Header/Header.d.ts +3 -0
- package/build/cjs/blocks/Header/Header.js +63 -0
- package/build/cjs/blocks/Layout/Layout.css +22 -0
- package/build/cjs/blocks/Layout/Layout.d.ts +3 -0
- package/build/cjs/blocks/Layout/Layout.js +78 -0
- package/build/cjs/blocks/Media/Media.css +41 -0
- package/build/cjs/blocks/Media/Media.d.ts +3 -0
- package/build/cjs/blocks/Media/Media.js +38 -0
- package/build/cjs/blocks/Meta/Meta.css +7 -0
- package/build/cjs/blocks/Meta/Meta.d.ts +3 -0
- package/build/cjs/blocks/Meta/Meta.js +66 -0
- package/build/cjs/blocks/Suggest/Suggest.d.ts +12 -0
- package/build/cjs/blocks/Suggest/Suggest.js +61 -0
- package/build/cjs/blocks/YFM/YFM.d.ts +3 -0
- package/build/cjs/blocks/YFM/YFM.js +24 -0
- package/build/cjs/blocks/constants.d.ts +8 -0
- package/build/cjs/blocks/constants.js +8 -0
- package/build/cjs/components/ButtonWithIcon/ButtonWithIcon.css +76 -0
- package/build/cjs/components/ButtonWithIcon/ButtonWithIcon.d.ts +12 -0
- package/build/cjs/components/ButtonWithIcon/ButtonWithIcon.js +13 -0
- package/build/cjs/components/FeedHeader/FeedHeader.css +54 -0
- package/build/cjs/components/FeedHeader/FeedHeader.d.ts +8 -0
- package/build/cjs/components/FeedHeader/FeedHeader.js +24 -0
- package/build/cjs/components/FeedHeader/components/Controls/Controls.css +107 -0
- package/build/cjs/components/FeedHeader/components/Controls/Controls.d.ts +16 -0
- package/build/cjs/components/FeedHeader/components/Controls/Controls.js +106 -0
- package/build/cjs/components/FeedHeader/components/Controls/customRenders.d.ts +11 -0
- package/build/cjs/components/FeedHeader/components/Controls/customRenders.js +22 -0
- package/build/cjs/components/FeedHeader/components/CustomSelectOption/CustomSelectOption.css +14 -0
- package/build/cjs/components/FeedHeader/components/CustomSelectOption/CustomSelectOption.d.ts +8 -0
- package/build/cjs/components/FeedHeader/components/CustomSelectOption/CustomSelectOption.js +13 -0
- package/build/cjs/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.css +53 -0
- package/build/cjs/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.d.ts +11 -0
- package/build/cjs/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.js +47 -0
- package/build/cjs/components/MetaWrapper/MetaWrapper.d.ts +10 -0
- package/build/cjs/components/MetaWrapper/MetaWrapper.js +18 -0
- package/build/cjs/components/Paginator/Paginator.css +54 -0
- package/build/cjs/components/Paginator/Paginator.d.ts +2 -0
- package/build/cjs/components/Paginator/Paginator.js +118 -0
- package/build/cjs/components/Paginator/components/NavigationButton.d.ts +6 -0
- package/build/cjs/components/Paginator/components/NavigationButton.js +13 -0
- package/build/cjs/components/Paginator/components/PaginatorItem.d.ts +2 -0
- package/build/cjs/components/Paginator/components/PaginatorItem.js +15 -0
- package/build/cjs/components/Paginator/types.d.ts +29 -0
- package/build/cjs/components/Paginator/types.js +8 -0
- package/build/cjs/components/Paginator/utils.d.ts +3 -0
- package/build/cjs/components/Paginator/utils.js +32 -0
- package/build/cjs/components/PostCard/PostCard.css +85 -0
- package/build/cjs/components/PostCard/PostCard.d.ts +12 -0
- package/build/cjs/components/PostCard/PostCard.js +60 -0
- package/build/cjs/components/PostInfo/PostInfo.css +88 -0
- package/build/cjs/components/PostInfo/PostInfo.d.ts +28 -0
- package/build/cjs/components/PostInfo/PostInfo.js +55 -0
- package/build/cjs/components/PostInfo/SuggestPostInfo.d.ts +27 -0
- package/build/cjs/components/PostInfo/SuggestPostInfo.js +41 -0
- package/build/cjs/components/PostInfo/components/Date.d.ts +7 -0
- package/build/cjs/components/PostInfo/components/Date.js +36 -0
- package/build/cjs/components/PostInfo/components/ReadingTime.d.ts +7 -0
- package/build/cjs/components/PostInfo/components/ReadingTime.js +18 -0
- package/build/cjs/components/PostInfo/components/Save.d.ts +25 -0
- package/build/cjs/components/PostInfo/components/Save.js +73 -0
- package/build/cjs/components/PostInfo/components/Sharing.d.ts +7 -0
- package/build/cjs/components/PostInfo/components/Sharing.js +54 -0
- package/build/cjs/components/Posts/Posts.css +28 -0
- package/build/cjs/components/Posts/Posts.d.ts +19 -0
- package/build/cjs/components/Posts/Posts.js +32 -0
- package/build/cjs/components/PostsEmpty/PostsEmpty.css +25 -0
- package/build/cjs/components/PostsEmpty/PostsEmpty.d.ts +2 -0
- package/build/cjs/components/PostsEmpty/PostsEmpty.js +14 -0
- package/build/cjs/components/PostsError/PostError.css +30 -0
- package/build/cjs/components/PostsError/PostsError.d.ts +6 -0
- package/build/cjs/components/PostsError/PostsError.js +20 -0
- package/build/cjs/components/Search/Search.css +33 -0
- package/build/cjs/components/Search/Search.d.ts +15 -0
- package/build/cjs/components/Search/Search.js +67 -0
- package/build/cjs/components/Wrapper/Wrapper.css +32 -0
- package/build/cjs/components/Wrapper/Wrapper.d.ts +10 -0
- package/build/cjs/components/Wrapper/Wrapper.js +17 -0
- package/build/cjs/configure.d.ts +5 -0
- package/build/cjs/configure.js +8 -0
- package/build/cjs/constants.d.ts +27 -0
- package/build/cjs/constants.js +34 -0
- package/build/cjs/constructor/BlogConstructorProvider.d.ts +16 -0
- package/build/cjs/constructor/BlogConstructorProvider.js +46 -0
- package/build/cjs/constructor/blocksMap.d.ts +18 -0
- package/build/cjs/constructor/blocksMap.js +30 -0
- package/build/cjs/containers/BlogPage/BlogPage.css +21 -0
- package/build/cjs/containers/BlogPage/BlogPage.d.ts +15 -0
- package/build/cjs/containers/BlogPage/BlogPage.js +30 -0
- package/build/cjs/containers/BlogPostPage/BlogPostPage.css +251 -0
- package/build/cjs/containers/BlogPostPage/BlogPostPage.d.ts +18 -0
- package/build/cjs/containers/BlogPostPage/BlogPostPage.js +42 -0
- package/build/cjs/contexts/DeviceContext.d.ts +4 -0
- package/build/cjs/contexts/DeviceContext.js +8 -0
- package/build/cjs/contexts/FeedContext.d.ts +13 -0
- package/build/cjs/contexts/FeedContext.js +8 -0
- package/build/cjs/contexts/LikesContext.d.ts +7 -0
- package/build/cjs/contexts/LikesContext.js +8 -0
- package/build/cjs/contexts/LocaleContext.d.ts +6 -0
- package/build/cjs/contexts/LocaleContext.js +16 -0
- package/build/cjs/contexts/MobileContext.d.ts +2 -0
- package/build/cjs/contexts/MobileContext.js +8 -0
- package/build/cjs/contexts/PostPageContext.d.ts +14 -0
- package/build/cjs/contexts/PostPageContext.js +8 -0
- package/build/cjs/contexts/RouterContext.d.ts +9 -0
- package/build/cjs/contexts/RouterContext.js +8 -0
- package/build/cjs/contexts/UserContext.d.ts +18 -0
- package/build/cjs/contexts/UserContext.js +8 -0
- package/build/cjs/contexts/theme/ThemeContext.d.ts +8 -0
- package/build/cjs/contexts/theme/ThemeContext.js +13 -0
- package/build/cjs/contexts/theme/ThemeProvider.d.ts +23 -0
- package/build/cjs/contexts/theme/ThemeProvider.js +51 -0
- package/build/cjs/contexts/theme/ThemeValueContext.d.ts +7 -0
- package/build/cjs/contexts/theme/ThemeValueContext.js +11 -0
- package/build/cjs/contexts/theme/index.d.ts +6 -0
- package/build/cjs/contexts/theme/index.js +22 -0
- package/build/cjs/contexts/theme/useTheme.d.ts +2 -0
- package/build/cjs/contexts/theme/useTheme.js +13 -0
- package/build/cjs/contexts/theme/useThemeValue.d.ts +2 -0
- package/build/cjs/contexts/theme/useThemeValue.js +13 -0
- package/build/cjs/contexts/theme/withTheme.d.ts +6 -0
- package/build/cjs/contexts/theme/withTheme.js +21 -0
- package/build/cjs/contexts/theme/withThemeValue.d.ts +6 -0
- package/build/cjs/contexts/theme/withThemeValue.js +21 -0
- package/build/cjs/counters/metrika.d.ts +59 -0
- package/build/cjs/counters/metrika.js +170 -0
- package/build/cjs/counters/utils.d.ts +5 -0
- package/build/cjs/counters/utils.js +9 -0
- package/build/cjs/hooks/useIsIPhone.d.ts +1 -0
- package/build/cjs/hooks/useIsIPhone.js +10 -0
- package/build/cjs/hooks/useLikes.d.ts +15 -0
- package/build/cjs/hooks/useLikes.js +35 -0
- package/build/cjs/i18n/index.d.ts +22 -0
- package/build/cjs/i18n/index.js +74 -0
- package/build/cjs/icons/Close.d.ts +2 -0
- package/build/cjs/icons/Close.js +11 -0
- package/build/cjs/icons/DropdownArrow.d.ts +2 -0
- package/build/cjs/icons/DropdownArrow.js +11 -0
- package/build/cjs/icons/Save.d.ts +2 -0
- package/build/cjs/icons/Save.js +11 -0
- package/build/cjs/icons/SaveFilled.d.ts +2 -0
- package/build/cjs/icons/SaveFilled.js +11 -0
- package/build/cjs/icons/SearchIcon.d.ts +2 -0
- package/build/cjs/icons/SearchIcon.js +11 -0
- package/build/cjs/icons/ShareArrowUp.d.ts +2 -0
- package/build/cjs/icons/ShareArrowUp.js +11 -0
- package/build/cjs/icons/Time.d.ts +2 -0
- package/build/cjs/icons/Time.js +11 -0
- package/build/cjs/index.d.ts +7 -0
- package/build/cjs/index.js +29 -0
- package/build/cjs/internal-typings/bem-cn-lite.d.ts +17 -0
- package/build/cjs/internal-typings/global.d.ts +5 -0
- package/build/cjs/models/blocks.d.ts +84 -0
- package/build/cjs/models/blocks.js +2 -0
- package/build/cjs/models/common.d.ts +151 -0
- package/build/cjs/models/common.js +22 -0
- package/build/cjs/models/locale.d.ts +29 -0
- package/build/cjs/models/locale.js +14 -0
- package/build/cjs/models/paddings.d.ts +16 -0
- package/build/cjs/models/paddings.js +10 -0
- package/build/cjs/utils/cn.d.ts +4 -0
- package/build/cjs/utils/cn.js +12 -0
- package/build/cjs/utils/common.d.ts +42 -0
- package/build/cjs/utils/common.js +120 -0
- package/build/cjs/utils/date.d.ts +13 -0
- package/build/cjs/utils/date.js +59 -0
- package/build/cjs/utils/svg.d.ts +3 -0
- package/build/cjs/utils/svg.js +7 -0
- package/build/esm/blocks/Author/Author.css +31 -0
- package/build/esm/blocks/Author/Author.d.ts +4 -0
- package/build/esm/blocks/Author/Author.js +34 -0
- package/build/esm/blocks/Banner/Banner.css +58 -0
- package/build/esm/blocks/Banner/Banner.d.ts +4 -0
- package/build/esm/blocks/Banner/Banner.js +45 -0
- package/build/esm/blocks/CTA/CTA.css +56 -0
- package/build/esm/blocks/CTA/CTA.d.ts +4 -0
- package/build/esm/blocks/CTA/CTA.js +38 -0
- package/build/esm/blocks/ColoredText/ColoredText.css +28 -0
- package/build/esm/blocks/ColoredText/ColoredText.d.ts +4 -0
- package/build/esm/blocks/ColoredText/ColoredText.js +31 -0
- package/build/esm/blocks/Feed/Feed.d.ts +3 -0
- package/build/esm/blocks/Feed/Feed.js +153 -0
- package/build/esm/blocks/Feed/reducer.d.ts +65 -0
- package/build/esm/blocks/Feed/reducer.js +36 -0
- package/build/esm/blocks/Header/Header.d.ts +3 -0
- package/build/esm/blocks/Header/Header.js +36 -0
- package/build/esm/blocks/Layout/Layout.css +22 -0
- package/build/esm/blocks/Layout/Layout.d.ts +4 -0
- package/build/esm/blocks/Layout/Layout.js +52 -0
- package/build/esm/blocks/Media/Media.css +41 -0
- package/build/esm/blocks/Media/Media.d.ts +4 -0
- package/build/esm/blocks/Media/Media.js +32 -0
- package/build/esm/blocks/Meta/Meta.css +7 -0
- package/build/esm/blocks/Meta/Meta.d.ts +4 -0
- package/build/esm/blocks/Meta/Meta.js +40 -0
- package/build/esm/blocks/Suggest/Suggest.d.ts +12 -0
- package/build/esm/blocks/Suggest/Suggest.js +34 -0
- package/build/esm/blocks/YFM/YFM.d.ts +3 -0
- package/build/esm/blocks/YFM/YFM.js +17 -0
- package/build/esm/blocks/constants.d.ts +8 -0
- package/build/esm/blocks/constants.js +5 -0
- package/build/esm/components/ButtonWithIcon/ButtonWithIcon.css +76 -0
- package/build/esm/components/ButtonWithIcon/ButtonWithIcon.d.ts +13 -0
- package/build/esm/components/ButtonWithIcon/ButtonWithIcon.js +7 -0
- package/build/esm/components/FeedHeader/FeedHeader.css +54 -0
- package/build/esm/components/FeedHeader/FeedHeader.d.ts +9 -0
- package/build/esm/components/FeedHeader/FeedHeader.js +18 -0
- package/build/esm/components/FeedHeader/components/Controls/Controls.css +107 -0
- package/build/esm/components/FeedHeader/components/Controls/Controls.d.ts +17 -0
- package/build/esm/components/FeedHeader/components/Controls/Controls.js +77 -0
- package/build/esm/components/FeedHeader/components/Controls/customRenders.d.ts +12 -0
- package/build/esm/components/FeedHeader/components/Controls/customRenders.js +14 -0
- package/build/esm/components/FeedHeader/components/CustomSelectOption/CustomSelectOption.css +14 -0
- package/build/esm/components/FeedHeader/components/CustomSelectOption/CustomSelectOption.d.ts +9 -0
- package/build/esm/components/FeedHeader/components/CustomSelectOption/CustomSelectOption.js +7 -0
- package/build/esm/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.css +53 -0
- package/build/esm/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.d.ts +12 -0
- package/build/esm/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.js +21 -0
- package/build/esm/components/MetaWrapper/MetaWrapper.d.ts +10 -0
- package/build/esm/components/MetaWrapper/MetaWrapper.js +11 -0
- package/build/esm/components/Paginator/Paginator.css +54 -0
- package/build/esm/components/Paginator/Paginator.d.ts +3 -0
- package/build/esm/components/Paginator/Paginator.js +89 -0
- package/build/esm/components/Paginator/components/NavigationButton.d.ts +7 -0
- package/build/esm/components/Paginator/components/NavigationButton.js +7 -0
- package/build/esm/components/Paginator/components/PaginatorItem.d.ts +3 -0
- package/build/esm/components/Paginator/components/PaginatorItem.js +9 -0
- package/build/esm/components/Paginator/types.d.ts +29 -0
- package/build/esm/components/Paginator/types.js +5 -0
- package/build/esm/components/Paginator/utils.d.ts +3 -0
- package/build/esm/components/Paginator/utils.js +27 -0
- package/build/esm/components/PostCard/PostCard.css +85 -0
- package/build/esm/components/PostCard/PostCard.d.ts +13 -0
- package/build/esm/components/PostCard/PostCard.js +34 -0
- package/build/esm/components/PostInfo/PostInfo.css +88 -0
- package/build/esm/components/PostInfo/PostInfo.d.ts +29 -0
- package/build/esm/components/PostInfo/PostInfo.js +29 -0
- package/build/esm/components/PostInfo/SuggestPostInfo.d.ts +28 -0
- package/build/esm/components/PostInfo/SuggestPostInfo.js +35 -0
- package/build/esm/components/PostInfo/components/Date.d.ts +8 -0
- package/build/esm/components/PostInfo/components/Date.js +10 -0
- package/build/esm/components/PostInfo/components/ReadingTime.d.ts +8 -0
- package/build/esm/components/PostInfo/components/ReadingTime.js +12 -0
- package/build/esm/components/PostInfo/components/Save.d.ts +26 -0
- package/build/esm/components/PostInfo/components/Save.js +44 -0
- package/build/esm/components/PostInfo/components/Sharing.d.ts +8 -0
- package/build/esm/components/PostInfo/components/Sharing.js +25 -0
- package/build/esm/components/Posts/Posts.css +28 -0
- package/build/esm/components/Posts/Posts.d.ts +20 -0
- package/build/esm/components/Posts/Posts.js +26 -0
- package/build/esm/components/PostsEmpty/PostsEmpty.css +25 -0
- package/build/esm/components/PostsEmpty/PostsEmpty.d.ts +3 -0
- package/build/esm/components/PostsEmpty/PostsEmpty.js +8 -0
- package/build/esm/components/PostsError/PostError.css +30 -0
- package/build/esm/components/PostsError/PostsError.d.ts +7 -0
- package/build/esm/components/PostsError/PostsError.js +14 -0
- package/build/esm/components/Search/Search.css +33 -0
- package/build/esm/components/Search/Search.d.ts +16 -0
- package/build/esm/components/Search/Search.js +41 -0
- package/build/esm/components/Wrapper/Wrapper.css +32 -0
- package/build/esm/components/Wrapper/Wrapper.d.ts +11 -0
- package/build/esm/components/Wrapper/Wrapper.js +11 -0
- package/build/esm/configure.d.ts +5 -0
- package/build/esm/configure.js +4 -0
- package/build/esm/constants.d.ts +27 -0
- package/build/esm/constants.js +31 -0
- package/build/esm/constructor/BlogConstructorProvider.d.ts +16 -0
- package/build/esm/constructor/BlogConstructorProvider.js +19 -0
- package/build/esm/constructor/blocksMap.d.ts +18 -0
- package/build/esm/constructor/blocksMap.js +28 -0
- package/build/esm/containers/BlogPage/BlogPage.css +21 -0
- package/build/esm/containers/BlogPage/BlogPage.d.ts +16 -0
- package/build/esm/containers/BlogPage/BlogPage.js +24 -0
- package/build/esm/containers/BlogPostPage/BlogPostPage.css +251 -0
- package/build/esm/containers/BlogPostPage/BlogPostPage.d.ts +19 -0
- package/build/esm/containers/BlogPostPage/BlogPostPage.js +36 -0
- package/build/esm/contexts/DeviceContext.d.ts +4 -0
- package/build/esm/contexts/DeviceContext.js +2 -0
- package/build/esm/contexts/FeedContext.d.ts +13 -0
- package/build/esm/contexts/FeedContext.js +2 -0
- package/build/esm/contexts/LikesContext.d.ts +7 -0
- package/build/esm/contexts/LikesContext.js +2 -0
- package/build/esm/contexts/LocaleContext.d.ts +6 -0
- package/build/esm/contexts/LocaleContext.js +10 -0
- package/build/esm/contexts/MobileContext.d.ts +2 -0
- package/build/esm/contexts/MobileContext.js +2 -0
- package/build/esm/contexts/PostPageContext.d.ts +14 -0
- package/build/esm/contexts/PostPageContext.js +2 -0
- package/build/esm/contexts/RouterContext.d.ts +9 -0
- package/build/esm/contexts/RouterContext.js +2 -0
- package/build/esm/contexts/UserContext.d.ts +18 -0
- package/build/esm/contexts/UserContext.js +2 -0
- package/build/esm/contexts/theme/ThemeContext.d.ts +8 -0
- package/build/esm/contexts/theme/ThemeContext.js +7 -0
- package/build/esm/contexts/theme/ThemeProvider.d.ts +23 -0
- package/build/esm/contexts/theme/ThemeProvider.js +44 -0
- package/build/esm/contexts/theme/ThemeValueContext.d.ts +7 -0
- package/build/esm/contexts/theme/ThemeValueContext.js +5 -0
- package/build/esm/contexts/theme/index.d.ts +6 -0
- package/build/esm/contexts/theme/index.js +6 -0
- package/build/esm/contexts/theme/useTheme.d.ts +2 -0
- package/build/esm/contexts/theme/useTheme.js +6 -0
- package/build/esm/contexts/theme/useThemeValue.d.ts +2 -0
- package/build/esm/contexts/theme/useThemeValue.js +6 -0
- package/build/esm/contexts/theme/withTheme.d.ts +6 -0
- package/build/esm/contexts/theme/withTheme.js +14 -0
- package/build/esm/contexts/theme/withThemeValue.d.ts +6 -0
- package/build/esm/contexts/theme/withThemeValue.js +14 -0
- package/build/esm/counters/metrika.d.ts +59 -0
- package/build/esm/counters/metrika.js +166 -0
- package/build/esm/counters/utils.d.ts +5 -0
- package/build/esm/counters/utils.js +6 -0
- package/build/esm/hooks/useIsIPhone.d.ts +1 -0
- package/build/esm/hooks/useIsIPhone.js +6 -0
- package/build/esm/hooks/useLikes.d.ts +15 -0
- package/build/esm/hooks/useLikes.js +31 -0
- package/build/esm/i18n/index.d.ts +22 -0
- package/build/esm/i18n/index.js +71 -0
- package/build/esm/icons/Close.d.ts +2 -0
- package/build/esm/icons/Close.js +4 -0
- package/build/esm/icons/DropdownArrow.d.ts +2 -0
- package/build/esm/icons/DropdownArrow.js +4 -0
- package/build/esm/icons/Save.d.ts +2 -0
- package/build/esm/icons/Save.js +4 -0
- package/build/esm/icons/SaveFilled.d.ts +2 -0
- package/build/esm/icons/SaveFilled.js +4 -0
- package/build/esm/icons/SearchIcon.d.ts +2 -0
- package/build/esm/icons/SearchIcon.js +4 -0
- package/build/esm/icons/ShareArrowUp.d.ts +2 -0
- package/build/esm/icons/ShareArrowUp.js +4 -0
- package/build/esm/icons/Time.d.ts +2 -0
- package/build/esm/icons/Time.js +4 -0
- package/build/esm/index.d.ts +7 -0
- package/build/esm/index.js +7 -0
- package/build/esm/internal-typings/bem-cn-lite.d.ts +17 -0
- package/build/esm/internal-typings/global.d.ts +5 -0
- package/build/esm/models/blocks.d.ts +84 -0
- package/build/esm/models/blocks.js +1 -0
- package/build/esm/models/common.d.ts +151 -0
- package/build/esm/models/common.js +19 -0
- package/build/esm/models/locale.d.ts +29 -0
- package/build/esm/models/locale.js +11 -0
- package/build/esm/models/paddings.d.ts +16 -0
- package/build/esm/models/paddings.js +7 -0
- package/build/esm/utils/cn.d.ts +4 -0
- package/build/esm/utils/cn.js +5 -0
- package/build/esm/utils/common.d.ts +42 -0
- package/build/esm/utils/common.js +107 -0
- package/build/esm/utils/date.d.ts +13 -0
- package/build/esm/utils/date.js +55 -0
- package/build/esm/utils/svg.d.ts +3 -0
- package/build/esm/utils/svg.js +4 -0
- package/package.json +140 -0
- package/server/data/config.d.ts +32 -0
- package/server/data/config.js +39 -0
- package/server/data/contentFilter.d.ts +27 -0
- package/server/data/contentFilter.js +61 -0
- package/server/data/createReadableContent.d.ts +17 -0
- package/server/data/createReadableContent.js +47 -0
- package/server/data/sanitizeMeta.d.ts +24 -0
- package/server/data/sanitizeMeta.js +18 -0
- package/server/data/transformPageContent.d.ts +21 -0
- package/server/data/transformPageContent.js +35 -0
- package/server/data/transformPost.d.ts +11 -0
- package/server/data/transformPost.js +34 -0
- package/server/index.d.ts +4 -0
- package/server/index.js +11 -0
- package/server/models/blocks.d.ts +84 -0
- package/server/models/blocks.js +2 -0
- package/server/models/common.d.ts +151 -0
- package/server/models/common.js +22 -0
- package/server/models/locale.d.ts +29 -0
- package/server/models/locale.js +14 -0
- package/server/models/paddings.d.ts +16 -0
- package/server/models/paddings.js +10 -0
- package/styles/fonts.css +195 -0
- package/styles/fonts.scss +223 -0
- package/styles/mixins.css +2 -0
- package/styles/mixins.scss +59 -0
- package/styles/root.css +21 -0
- package/styles/root.scss +25 -0
- package/styles/storybook/common.scss +29 -0
- package/styles/storybook/index.scss +21 -0
- package/styles/storybook/palette.scss +75 -0
- package/styles/storybook/typography.scss +139 -0
- package/styles/styles.css +196 -0
- package/styles/styles.scss +2 -0
- package/styles/variables.css +0 -0
- package/styles/variables.scss +7 -0
- package/styles/yfm.css +103 -0
- package/styles/yfm.scss +123 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { PostData } from '../../models/common';
|
3
|
+
import './PostInfo.css';
|
4
|
+
export type BlogMetrikaGoals = {
|
5
|
+
sharing?: string;
|
6
|
+
save?: string;
|
7
|
+
};
|
8
|
+
type PostInfoProps = {
|
9
|
+
postId: PostData['id'];
|
10
|
+
readingTime: PostData['readingTime'];
|
11
|
+
date: PostData['date'];
|
12
|
+
theme?: 'light' | 'dark';
|
13
|
+
metrikaGoals?: BlogMetrikaGoals;
|
14
|
+
dataQa?: string;
|
15
|
+
};
|
16
|
+
/**
|
17
|
+
* Blog post info panel component
|
18
|
+
*
|
19
|
+
* @param postId - post id
|
20
|
+
* @param readingTime - post reading time
|
21
|
+
* @param date - post create date
|
22
|
+
* @param theme - theme name
|
23
|
+
* @param metrikaGoals - metrika goals name
|
24
|
+
* @param dataQa - test-attr
|
25
|
+
*
|
26
|
+
* @returns jsx
|
27
|
+
*/
|
28
|
+
export declare const PostInfo: React.FC<PostInfoProps>;
|
29
|
+
export {};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { PostPageContext } from '../../contexts/PostPageContext';
|
3
|
+
import { Date } from './components/Date';
|
4
|
+
import { ReadingTime } from './components/ReadingTime';
|
5
|
+
import { Sharing } from './components/Sharing';
|
6
|
+
import { Save } from './components/Save';
|
7
|
+
import { block } from '../../utils/cn';
|
8
|
+
import './PostInfo.css';
|
9
|
+
const b = block('post-info');
|
10
|
+
/**
|
11
|
+
* Blog post info panel component
|
12
|
+
*
|
13
|
+
* @param postId - post id
|
14
|
+
* @param readingTime - post reading time
|
15
|
+
* @param date - post create date
|
16
|
+
* @param theme - theme name
|
17
|
+
* @param metrikaGoals - metrika goals name
|
18
|
+
* @param dataQa - test-attr
|
19
|
+
*
|
20
|
+
* @returns jsx
|
21
|
+
*/
|
22
|
+
export const PostInfo = ({ date, readingTime, postId, theme = 'light', metrikaGoals, dataQa, }) => {
|
23
|
+
const { likes } = useContext(PostPageContext);
|
24
|
+
return (React.createElement("div", { className: b('container', { theme }) },
|
25
|
+
date && React.createElement(Date, { date: date }),
|
26
|
+
readingTime && React.createElement(ReadingTime, { readingTime: readingTime }),
|
27
|
+
React.createElement(Sharing, { metrikaGoal: metrikaGoals === null || metrikaGoals === void 0 ? void 0 : metrikaGoals.sharing, theme: theme }),
|
28
|
+
likes && (React.createElement(Save, { postId: postId, title: likes.likesCount, hasUserLike: likes.hasUserLike, handleUserLike: likes.handleUserLike, metrikaGoal: metrikaGoals === null || metrikaGoals === void 0 ? void 0 : metrikaGoals.save, theme: theme, dataQa: dataQa }))));
|
29
|
+
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { PostData, ToggleLikeCallbackType } from '../../models/common';
|
3
|
+
import './PostInfo.css';
|
4
|
+
export interface SuggestPostInfoProps extends Pick<PostData, 'date' | 'readingTime' | 'hasUserLike'> {
|
5
|
+
postId: PostData['blogPostId'];
|
6
|
+
size?: 's' | 'm';
|
7
|
+
dataQa?: string;
|
8
|
+
likes?: {
|
9
|
+
likesCount?: number;
|
10
|
+
hasUserLike?: boolean;
|
11
|
+
toggleLike?: ToggleLikeCallbackType;
|
12
|
+
};
|
13
|
+
}
|
14
|
+
/**
|
15
|
+
* Suggest blog card info component
|
16
|
+
*
|
17
|
+
* @param postId - post id
|
18
|
+
* @param date - post create date
|
19
|
+
* @param readingTime - post reading time
|
20
|
+
* @param hasUserLike - flag that the user liked the post
|
21
|
+
* @param likes - likes count
|
22
|
+
* @param dataQa - test-attr
|
23
|
+
* @param size - text size
|
24
|
+
* @param isModernIcon - flag what we need render 'bookmark' icon
|
25
|
+
*
|
26
|
+
* @returns jsx
|
27
|
+
*/
|
28
|
+
export declare const SuggestPostInfo: React.FC<SuggestPostInfoProps>;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { useLikes } from '../../hooks/useLikes';
|
3
|
+
import { Date } from './components/Date';
|
4
|
+
import { ReadingTime } from './components/ReadingTime';
|
5
|
+
import { Save } from './components/Save';
|
6
|
+
import { block } from '../../utils/cn';
|
7
|
+
import './PostInfo.css';
|
8
|
+
const b = block('post-info');
|
9
|
+
/**
|
10
|
+
* Suggest blog card info component
|
11
|
+
*
|
12
|
+
* @param postId - post id
|
13
|
+
* @param date - post create date
|
14
|
+
* @param readingTime - post reading time
|
15
|
+
* @param hasUserLike - flag that the user liked the post
|
16
|
+
* @param likes - likes count
|
17
|
+
* @param dataQa - test-attr
|
18
|
+
* @param size - text size
|
19
|
+
* @param isModernIcon - flag what we need render 'bookmark' icon
|
20
|
+
*
|
21
|
+
* @returns jsx
|
22
|
+
*/
|
23
|
+
export const SuggestPostInfo = ({ postId, date, readingTime, likes, size = 's', dataQa, }) => {
|
24
|
+
const { hasUserLike, likesCount, handleLike } = useLikes({
|
25
|
+
hasLike: likes === null || likes === void 0 ? void 0 : likes.hasUserLike,
|
26
|
+
count: likes === null || likes === void 0 ? void 0 : likes.likesCount,
|
27
|
+
toggleLikeCallback: likes === null || likes === void 0 ? void 0 : likes.toggleLike,
|
28
|
+
postId: postId,
|
29
|
+
});
|
30
|
+
return (React.createElement("div", { className: b('container') },
|
31
|
+
React.createElement("div", { className: b('suggest-container') },
|
32
|
+
date && React.createElement(Date, { date: date, size: size }),
|
33
|
+
readingTime && React.createElement(ReadingTime, { readingTime: readingTime, size: size })),
|
34
|
+
likes && postId && (React.createElement(Save, { postId: postId, title: likesCount, hasUserLike: hasUserLike, handleUserLike: handleLike, size: size, dataQa: dataQa }))));
|
35
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { LocaleContext } from '../../../contexts/LocaleContext';
|
3
|
+
import { format } from '../../../utils/date';
|
4
|
+
import { block } from '../../../utils/cn';
|
5
|
+
import '../PostInfo.css';
|
6
|
+
const b = block('post-info');
|
7
|
+
export const Date = ({ date, size = 's' }) => {
|
8
|
+
const { locale } = useContext(LocaleContext);
|
9
|
+
return React.createElement("div", { className: b('item', { size }) }, format(date, 'longDate', locale === null || locale === void 0 ? void 0 : locale.code));
|
10
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Icon } from '@gravity-ui/uikit';
|
3
|
+
import { i18, Keyset } from '../../../i18n';
|
4
|
+
import { Time } from '../../../icons/Time';
|
5
|
+
import { block } from '../../../utils/cn';
|
6
|
+
import '../PostInfo.css';
|
7
|
+
const b = block('post-info');
|
8
|
+
const ICON_SIZE = 16;
|
9
|
+
export const ReadingTime = ({ readingTime, size = 's' }) => (React.createElement("div", { className: b('item', { size }) },
|
10
|
+
React.createElement("span", { className: b('icon') },
|
11
|
+
React.createElement(Icon, { data: Time, size: ICON_SIZE, className: b('icon-color') })),
|
12
|
+
i18(Keyset.ContextReadingTime, { count: readingTime })));
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import '../PostInfo.css';
|
3
|
+
type SaveProps = {
|
4
|
+
title: string | number;
|
5
|
+
postId: number;
|
6
|
+
hasUserLike: boolean;
|
7
|
+
handleUserLike: () => void;
|
8
|
+
theme?: 'light' | 'dark';
|
9
|
+
metrikaGoal?: string;
|
10
|
+
dataQa?: string;
|
11
|
+
size?: 's' | 'm';
|
12
|
+
};
|
13
|
+
/**
|
14
|
+
* Components for 'save' blog UI-component
|
15
|
+
*
|
16
|
+
* @param title - post title
|
17
|
+
* @param postId - post id
|
18
|
+
* @param hasUserLike - flag what blog has like from current user
|
19
|
+
* @param metrikaGoal - metrika goal name
|
20
|
+
* @param dataQa - test-attr
|
21
|
+
* @param size - text size
|
22
|
+
*
|
23
|
+
* @returns jsx
|
24
|
+
*/
|
25
|
+
export declare const Save: React.FC<SaveProps>;
|
26
|
+
export {};
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { Icon } from '@gravity-ui/uikit';
|
3
|
+
import { postLikeStatus } from '../../../utils/common';
|
4
|
+
import { block } from '../../../utils/cn';
|
5
|
+
import { MetrikaCounter } from '../../../counters/utils';
|
6
|
+
// @ts-ignore
|
7
|
+
import metrika from '../../../counters/metrika.js';
|
8
|
+
import { Save as SaveIcon } from '../../../icons/Save';
|
9
|
+
import { SaveFilled } from '../../../icons/SaveFilled';
|
10
|
+
import { UserContext } from '../../../contexts/UserContext';
|
11
|
+
import '../PostInfo.css';
|
12
|
+
const ICON_SIZE = 16;
|
13
|
+
const b = block('post-info');
|
14
|
+
/**
|
15
|
+
* Components for 'save' blog UI-component
|
16
|
+
*
|
17
|
+
* @param title - post title
|
18
|
+
* @param postId - post id
|
19
|
+
* @param hasUserLike - flag what blog has like from current user
|
20
|
+
* @param metrikaGoal - metrika goal name
|
21
|
+
* @param dataQa - test-attr
|
22
|
+
* @param size - text size
|
23
|
+
*
|
24
|
+
* @returns jsx
|
25
|
+
*/
|
26
|
+
export const Save = ({ title, postId, hasUserLike, handleUserLike, metrikaGoal, size, theme, dataQa, }) => {
|
27
|
+
const { uid } = useContext(UserContext);
|
28
|
+
return (React.createElement("div", { className: b('item', { size }), onClick: (event) => {
|
29
|
+
// both preventDefault and stopImmediatePropagation required to work properly
|
30
|
+
// https://stackoverflow.com/questions/24415631/reactjs-syntheticevent-stoppropagation-only-works-with-react-events
|
31
|
+
event.preventDefault();
|
32
|
+
event.nativeEvent.stopImmediatePropagation();
|
33
|
+
if (!uid) {
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
postLikeStatus(postId, Boolean(hasUserLike));
|
37
|
+
handleUserLike();
|
38
|
+
metrika.reachGoal(MetrikaCounter.CrossSite, metrikaGoal);
|
39
|
+
}, "data-qa": `${dataQa ? dataQa + '-' : ''}save` },
|
40
|
+
React.createElement("div", { className: b('content', { cursor: Boolean(uid), theme }) },
|
41
|
+
React.createElement("span", { className: b('icon') },
|
42
|
+
React.createElement(Icon, { data: hasUserLike ? SaveFilled : SaveIcon, size: ICON_SIZE, className: b({ filled: Boolean(hasUserLike) }) })),
|
43
|
+
React.createElement("span", { className: b('title', { cursor: Boolean(uid) }) }, title))));
|
44
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { SharePopover } from '@gravity-ui/uikit';
|
3
|
+
import { MobileContext } from '../../../contexts/MobileContext';
|
4
|
+
import { RouterContext } from '../../../contexts/RouterContext';
|
5
|
+
import { PostPageContext } from '../../../contexts/PostPageContext';
|
6
|
+
import { i18, Keyset } from '../../../i18n';
|
7
|
+
import { getAbsolutePath } from '../../../utils/common';
|
8
|
+
import { block } from '../../../utils/cn';
|
9
|
+
import { MetrikaCounter } from '../../../counters/utils';
|
10
|
+
// @ts-ignore
|
11
|
+
import metrika from '../../../counters/metrika.js';
|
12
|
+
import { ShareArrowUp } from '../../../icons/ShareArrowUp';
|
13
|
+
import '../PostInfo.css';
|
14
|
+
const b = block('post-info');
|
15
|
+
export const Sharing = ({ theme, metrikaGoal }) => {
|
16
|
+
const router = useContext(RouterContext);
|
17
|
+
const isMobile = useContext(MobileContext);
|
18
|
+
const { shareOptions } = useContext(PostPageContext);
|
19
|
+
const handleMetrika = () => {
|
20
|
+
metrika.reachGoal(MetrikaCounter.CrossSite, metrikaGoal);
|
21
|
+
};
|
22
|
+
return (React.createElement("div", { className: b('item') },
|
23
|
+
React.createElement("span", { className: b('icon') },
|
24
|
+
React.createElement(SharePopover, { url: getAbsolutePath(router), className: b('share'), iconClass: b('share-icon'), switcherClassName: b('switcher', { theme }), tooltipClassName: b('popup'), useWebShareApi: isMobile, direction: 'column', buttonTitle: i18(Keyset.ActionShare), customIcon: ShareArrowUp, placement: "bottom", openByHover: false, shareOptions: shareOptions, handleMetrika: handleMetrika }))));
|
25
|
+
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
2
|
+
unpredictable css rules order in build */
|
3
|
+
.bc-posts__cards-container, .bc-posts__pinned-container {
|
4
|
+
padding-top: 24px;
|
5
|
+
scroll-margin: 48px;
|
6
|
+
}
|
7
|
+
.bc-posts__pagination {
|
8
|
+
display: flex;
|
9
|
+
flex-direction: column;
|
10
|
+
align-items: center;
|
11
|
+
justify-content: center;
|
12
|
+
padding-top: 48px;
|
13
|
+
padding-bottom: 64px;
|
14
|
+
}
|
15
|
+
.bc-posts__more-button {
|
16
|
+
margin-bottom: 12px;
|
17
|
+
}
|
18
|
+
.bc-posts__error-show-more {
|
19
|
+
display: flex;
|
20
|
+
flex-direction: column;
|
21
|
+
align-items: center;
|
22
|
+
justify-content: center;
|
23
|
+
color: var(--yc-color-promo-base-tomato);
|
24
|
+
padding-bottom: 12px;
|
25
|
+
}
|
26
|
+
.bc-posts__paginator {
|
27
|
+
padding-top: 12px;
|
28
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React, { MouseEvent } from 'react';
|
2
|
+
import { PostData } from '../../models/common';
|
3
|
+
import './Posts.css';
|
4
|
+
type PostCardProps = {
|
5
|
+
containerId: string;
|
6
|
+
currentPage: number;
|
7
|
+
isShowMoreVisible: boolean;
|
8
|
+
errorShowMore: boolean;
|
9
|
+
postCountOnPage: number;
|
10
|
+
perPageInQuery: number;
|
11
|
+
isFetching: boolean;
|
12
|
+
isShowMoreFetching: boolean;
|
13
|
+
handleShowMore: (value?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => Promise<void> | void;
|
14
|
+
handlePageChange: (value: number) => Promise<void> | void;
|
15
|
+
postsOnPage?: PostData[];
|
16
|
+
pinnedPostOnPage?: PostData;
|
17
|
+
pageCountForShowSupportButtons?: number;
|
18
|
+
};
|
19
|
+
export declare const Posts: React.FC<PostCardProps>;
|
20
|
+
export {};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { CardLayoutBlock } from '@gravity-ui/page-constructor';
|
3
|
+
import { Button } from '@gravity-ui/uikit';
|
4
|
+
import { i18, Keyset } from '../../i18n';
|
5
|
+
import { Paginator } from '../Paginator/Paginator';
|
6
|
+
import { PostCard } from '../PostCard/PostCard';
|
7
|
+
import { PostsEmpty } from '../PostsEmpty/PostsEmpty';
|
8
|
+
import { block } from '../../utils/cn';
|
9
|
+
import './Posts.css';
|
10
|
+
const b = block('posts');
|
11
|
+
export const Posts = ({ containerId, pinnedPostOnPage, currentPage, postsOnPage, isShowMoreVisible, errorShowMore, postCountOnPage, perPageInQuery, isFetching, isShowMoreFetching, handleShowMore, handlePageChange, pageCountForShowSupportButtons, }) => (React.createElement("div", { className: b() },
|
12
|
+
React.createElement("div", { id: containerId, className: b('cards-container') },
|
13
|
+
pinnedPostOnPage && currentPage === 1 && (React.createElement("div", { className: b('pinned-container') },
|
14
|
+
React.createElement(PostCard, { post: pinnedPostOnPage, size: "m", fullWidth: true, showTag: true }))),
|
15
|
+
(postsOnPage === null || postsOnPage === void 0 ? void 0 : postsOnPage.length) ? (React.createElement(CardLayoutBlock, { title: '', colSizes: {
|
16
|
+
all: 12,
|
17
|
+
lg: 4,
|
18
|
+
md: 6,
|
19
|
+
} }, postsOnPage === null || postsOnPage === void 0 ? void 0 : postsOnPage.map((post) => (React.createElement(PostCard, { key: post.id, post: post, showTag: true }))))) : (React.createElement(PostsEmpty, null))),
|
20
|
+
React.createElement("div", { className: b('pagination') },
|
21
|
+
Boolean(isShowMoreVisible && (postsOnPage === null || postsOnPage === void 0 ? void 0 : postsOnPage.length)) && (React.createElement(Button, { view: "outlined", size: "xl", className: b('more-button'), onClick: handleShowMore, loading: isShowMoreFetching }, i18(Keyset.ActionLoadMore))),
|
22
|
+
errorShowMore && (React.createElement("div", { className: b('error-show-more') },
|
23
|
+
React.createElement("div", null, i18(Keyset.ErrorTitle)),
|
24
|
+
React.createElement("div", null, i18(Keyset.PostLoadError)))),
|
25
|
+
Boolean(currentPage && postCountOnPage) && (React.createElement("div", { className: b('paginator') },
|
26
|
+
React.createElement(Paginator, { onPageChange: handlePageChange, page: currentPage, totalItems: postCountOnPage, itemsPerPage: perPageInQuery, loading: isFetching, maxPages: Infinity, pageCountForShowSupportButtons: pageCountForShowSupportButtons }))))));
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
2
|
+
unpredictable css rules order in build */
|
3
|
+
.bc-posts-empty__container {
|
4
|
+
display: flex;
|
5
|
+
flex-direction: column;
|
6
|
+
justify-content: center;
|
7
|
+
align-items: center;
|
8
|
+
}
|
9
|
+
.bc-posts-empty__title, .bc-posts-empty__subtitle {
|
10
|
+
text-align: center;
|
11
|
+
word-wrap: break-word;
|
12
|
+
max-width: 400px;
|
13
|
+
width: 100%;
|
14
|
+
}
|
15
|
+
.bc-posts-empty__title {
|
16
|
+
margin-top: 24px;
|
17
|
+
font-size: var(--yc-text-display-2-font-size);
|
18
|
+
line-height: var(--yc-text-display-2-line-height);
|
19
|
+
font-weight: var(--yc-text-accent-font-weight);
|
20
|
+
}
|
21
|
+
.bc-posts-empty__subtitle {
|
22
|
+
margin-top: 16px;
|
23
|
+
font-size: var(--yc-text-body-3-font-size);
|
24
|
+
line-height: var(--yc-text-body-3-line-height);
|
25
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { block } from '../../utils/cn';
|
3
|
+
import './PostsEmpty.css';
|
4
|
+
import { i18, Keyset } from '../../i18n';
|
5
|
+
const b = block('posts-empty');
|
6
|
+
export const PostsEmpty = () => (React.createElement("div", { className: b('container') },
|
7
|
+
React.createElement("div", { className: b('title') }, i18(Keyset.TitleEmptyContainer)),
|
8
|
+
React.createElement("div", { className: b('subtitle') }, i18(Keyset.ContextEmptyContainer))));
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
2
|
+
unpredictable css rules order in build */
|
3
|
+
.bc-posts-error__container {
|
4
|
+
display: flex;
|
5
|
+
flex-direction: column;
|
6
|
+
justify-content: center;
|
7
|
+
align-items: center;
|
8
|
+
padding-top: 24px;
|
9
|
+
padding-bottom: 64px;
|
10
|
+
}
|
11
|
+
.bc-posts-error__title, .bc-posts-error__subtitle {
|
12
|
+
text-align: center;
|
13
|
+
word-wrap: break-word;
|
14
|
+
max-width: 400px;
|
15
|
+
width: 100%;
|
16
|
+
}
|
17
|
+
.bc-posts-error__title {
|
18
|
+
margin-top: 24px;
|
19
|
+
font-size: var(--yc-text-display-2-font-size);
|
20
|
+
line-height: var(--yc-text-display-2-line-height);
|
21
|
+
font-weight: var(--yc-text-accent-font-weight);
|
22
|
+
}
|
23
|
+
.bc-posts-error__subtitle {
|
24
|
+
margin-top: 16px;
|
25
|
+
font-size: var(--yc-text-body-3-font-size);
|
26
|
+
line-height: var(--yc-text-body-3-line-height);
|
27
|
+
}
|
28
|
+
.bc-posts-error__button {
|
29
|
+
padding: 24px 0 48px;
|
30
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Button } from '@gravity-ui/uikit';
|
3
|
+
import { i18, Keyset } from '../../i18n';
|
4
|
+
import { block } from '../../utils/cn';
|
5
|
+
import './PostError.css';
|
6
|
+
const b = block('posts-error');
|
7
|
+
export const PostsError = ({ onButtonClick }) => {
|
8
|
+
const handleClick = () => (onButtonClick ? onButtonClick() : window.location.reload());
|
9
|
+
return (React.createElement("div", { className: b('container') },
|
10
|
+
React.createElement("div", { className: b('title') }, i18(Keyset.ErrorTitle)),
|
11
|
+
React.createElement("div", { className: b('subtitle') }, i18(Keyset.PostLoadError)),
|
12
|
+
React.createElement("div", { className: b('button') },
|
13
|
+
React.createElement(Button, { size: "xl", view: "outlined", onClick: handleClick }, i18(Keyset.ActionTryAgain)))));
|
14
|
+
};
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
2
|
+
unpredictable css rules order in build */
|
3
|
+
.bc-search {
|
4
|
+
font-size: var(--yc-text-body-1-font-size);
|
5
|
+
line-height: var(--yc-text-body-1-line-height);
|
6
|
+
position: relative;
|
7
|
+
display: flex;
|
8
|
+
align-items: center;
|
9
|
+
justify-content: flex-end;
|
10
|
+
max-width: 376px;
|
11
|
+
height: 44px;
|
12
|
+
transition: width 0.3s;
|
13
|
+
}
|
14
|
+
.bc-search__close-button, .bc-search__search-button {
|
15
|
+
position: absolute;
|
16
|
+
z-index: 2;
|
17
|
+
right: 10px;
|
18
|
+
color: var(--yc-color-text-hint);
|
19
|
+
}
|
20
|
+
.bc-search__search-button:hover {
|
21
|
+
color: var(--yc-color-text-secondary);
|
22
|
+
}
|
23
|
+
.bc-search__search-suggest-container {
|
24
|
+
width: 100%;
|
25
|
+
}
|
26
|
+
.bc-search__search-suggest .yc-text-input__control {
|
27
|
+
padding-right: 32px;
|
28
|
+
}
|
29
|
+
.bc-search_size_s {
|
30
|
+
height: 36px;
|
31
|
+
width: 352px;
|
32
|
+
max-width: 100%;
|
33
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ClassNameProps } from '../../models/common';
|
3
|
+
import './Search.css';
|
4
|
+
export type SearchSize = 's' | 'm';
|
5
|
+
interface SearchProps extends ClassNameProps {
|
6
|
+
value?: string;
|
7
|
+
initialValue: string;
|
8
|
+
onSubmit: (value: string) => void;
|
9
|
+
debounce?: number;
|
10
|
+
placeholder?: string;
|
11
|
+
size?: SearchSize;
|
12
|
+
autoFocus?: boolean;
|
13
|
+
className?: string;
|
14
|
+
}
|
15
|
+
export declare const Search: React.FC<SearchProps>;
|
16
|
+
export {};
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import React, { useRef, useEffect, useState } from 'react';
|
2
|
+
import { debounce as lodashDebounce } from 'lodash';
|
3
|
+
import { TextInput } from '@gravity-ui/uikit';
|
4
|
+
import { ButtonWithIcon } from '../ButtonWithIcon/ButtonWithIcon';
|
5
|
+
import { useIsIPhone } from '../../hooks/useIsIPhone';
|
6
|
+
import { Close } from '../../icons/Close';
|
7
|
+
import { SearchIcon } from '../../icons/SearchIcon';
|
8
|
+
import { i18, Keyset } from '../../i18n';
|
9
|
+
import { block } from '../../utils/cn';
|
10
|
+
import './Search.css';
|
11
|
+
const b = block('search');
|
12
|
+
const SEARCH_ICON_SIZE = 16;
|
13
|
+
const CLOSE_ICON_SIZE = 12;
|
14
|
+
export const Search = (props) => {
|
15
|
+
const { className, initialValue, onSubmit, debounce = 300, placeholder = i18(Keyset.Search), size = 'm', autoFocus = false, value: externalValue, } = props;
|
16
|
+
const handleChange = lodashDebounce(onSubmit, debounce);
|
17
|
+
const [value, setValue] = useState(initialValue);
|
18
|
+
const inputRef = useRef(null);
|
19
|
+
const isIPhone = useIsIPhone();
|
20
|
+
useEffect(() => {
|
21
|
+
if (externalValue !== undefined) {
|
22
|
+
setValue(externalValue);
|
23
|
+
}
|
24
|
+
}, [externalValue]);
|
25
|
+
useEffect(() => {
|
26
|
+
if (autoFocus && !isIPhone) {
|
27
|
+
setTimeout(() => { var _a; return (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true }); }, 0);
|
28
|
+
}
|
29
|
+
}, [autoFocus, inputRef, isIPhone]);
|
30
|
+
return (React.createElement("div", { className: b({ size }, className) },
|
31
|
+
React.createElement("div", { className: b('search-suggest-container') },
|
32
|
+
React.createElement(TextInput, { value: value, onUpdate: (query) => {
|
33
|
+
setValue(query);
|
34
|
+
handleChange(query);
|
35
|
+
}, placeholder: placeholder, className: b('search-suggest'), size: size === 'm' ? 'xl' : 'l', controlRef: inputRef })),
|
36
|
+
value ? (React.createElement(ButtonWithIcon, { className: b('close-button'), icon: Close, iconSize: CLOSE_ICON_SIZE, size: "xs", onClick: () => {
|
37
|
+
handleChange.cancel();
|
38
|
+
setValue('');
|
39
|
+
onSubmit('');
|
40
|
+
} })) : (React.createElement(ButtonWithIcon, { className: b('search-button'), icon: SearchIcon, iconSize: SEARCH_ICON_SIZE, size: "xs", disabled: true }))));
|
41
|
+
};
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
2
|
+
unpredictable css rules order in build */
|
3
|
+
.bc-wrapper_padding-top_xs {
|
4
|
+
padding-top: 0px;
|
5
|
+
}
|
6
|
+
.bc-wrapper_padding-top_s {
|
7
|
+
padding-top: 16px;
|
8
|
+
}
|
9
|
+
.bc-wrapper_padding-top_m {
|
10
|
+
padding-top: 32px;
|
11
|
+
}
|
12
|
+
.bc-wrapper_padding-top_l {
|
13
|
+
padding-top: 48px;
|
14
|
+
}
|
15
|
+
.bc-wrapper_padding-top_xl {
|
16
|
+
padding-top: 64px;
|
17
|
+
}
|
18
|
+
.bc-wrapper_padding-bottom_xs {
|
19
|
+
padding-bottom: 0px;
|
20
|
+
}
|
21
|
+
.bc-wrapper_padding-bottom_s {
|
22
|
+
padding-bottom: 16px;
|
23
|
+
}
|
24
|
+
.bc-wrapper_padding-bottom_m {
|
25
|
+
padding-bottom: 32px;
|
26
|
+
}
|
27
|
+
.bc-wrapper_padding-bottom_l {
|
28
|
+
padding-bottom: 48px;
|
29
|
+
}
|
30
|
+
.bc-wrapper_padding-bottom_xl {
|
31
|
+
padding-bottom: 64px;
|
32
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ClassNameProps } from '../../models/common';
|
3
|
+
import { Paddings } from '../../models/paddings';
|
4
|
+
import './Wrapper.css';
|
5
|
+
type WrapperProps = ClassNameProps & {
|
6
|
+
paddings?: Paddings;
|
7
|
+
dataQa?: string;
|
8
|
+
children?: React.ReactNode;
|
9
|
+
};
|
10
|
+
export declare const Wrapper: React.FunctionComponent<WrapperProps>;
|
11
|
+
export {};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { block } from '../../utils/cn';
|
3
|
+
import { DEFAULT_PADDINGS } from '../../constants';
|
4
|
+
import './Wrapper.css';
|
5
|
+
const b = block('wrapper');
|
6
|
+
export const Wrapper = ({ children, paddings = DEFAULT_PADDINGS, className, dataQa, }) => (React.createElement("section", { className: b({
|
7
|
+
['padding-top']: (paddings === null || paddings === void 0 ? void 0 : paddings.top) || 'xs',
|
8
|
+
['padding-bottom']: (paddings === null || paddings === void 0 ? void 0 : paddings.bottom) || 'l',
|
9
|
+
['padding-left']: (paddings === null || paddings === void 0 ? void 0 : paddings.left) || '',
|
10
|
+
['padding-right']: (paddings === null || paddings === void 0 ? void 0 : paddings.right) || '',
|
11
|
+
}, className), "data-qa": dataQa }, children));
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { Paddings } from './models/paddings';
|
2
|
+
export declare const BREAKPOINTS: {
|
3
|
+
xs: number;
|
4
|
+
sm: number;
|
5
|
+
md: number;
|
6
|
+
lg: number;
|
7
|
+
xl: number;
|
8
|
+
};
|
9
|
+
export declare const DEFAULT_THEME = "light";
|
10
|
+
export declare enum BlogMetrikaGoalIds {
|
11
|
+
shareTop = "SITE_BLOG_SHARE-TOP_CLICK",
|
12
|
+
shareBottom = "SITE_BLOG_SHARE-BOTTOM_CLICK",
|
13
|
+
breadcrumbsTop = "SITE_BLOG_BREADCRUMBS-TOP_CLICK",
|
14
|
+
breadcrumbsBottom = "SITE_BLOG_BREADCRUMBS-BOTTOM_CLICK",
|
15
|
+
saveTop = "SITE_BLOG_SAVE-TOP_CLICK",
|
16
|
+
saveBottom = "SITE_BLOG_SAVE-BOTTOM_CLICK",
|
17
|
+
suggest = "SITE_BLOG_INTERESTING-CARD_CLICK",
|
18
|
+
bannerCommon = "SITE_BLOG_TEXT-BANNER_CLICK",
|
19
|
+
cta = "SITE_BLOG_CTA_CLICK",
|
20
|
+
tag = "SITE_BLOG_THEME-SELECTOR_CLCK",
|
21
|
+
service = "SITE_BLOG_SERVICE-SELECTOR_CLCK",
|
22
|
+
showMore = "SITE_BLOG-PAGINATION_SHOW-MORE_CLCK",
|
23
|
+
next = "SITE_BLOG-PAGINATION_NEXT_CLCK",
|
24
|
+
home = "SITE_BLOG-PAGINATION_HOME_CLCK",
|
25
|
+
page = "SITE_BLOG-PAGINATION_PAGE-NMBR_CLCK"
|
26
|
+
}
|
27
|
+
export declare const DEFAULT_PADDINGS: Paddings;
|