@gravity-ui/blog-constructor 2.1.2-alpha.2 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/build/cjs/blocks/Author/Author.js +3 -3
  3. package/build/cjs/blocks/Banner/Banner.js +4 -4
  4. package/build/cjs/blocks/CTA/CTA.js +3 -3
  5. package/build/cjs/blocks/ColoredText/ColoredText.js +1 -1
  6. package/build/cjs/blocks/Feed/Feed.js +17 -20
  7. package/build/cjs/blocks/Feed/reducer.d.ts +1 -1
  8. package/build/cjs/blocks/Header/Header.js +3 -4
  9. package/build/cjs/blocks/Meta/Meta.js +5 -6
  10. package/build/cjs/blocks/Suggest/Suggest.js +4 -5
  11. package/build/cjs/blocks/YFM/YFM.js +1 -1
  12. package/build/cjs/components/FeedHeader/FeedHeader.d.ts +1 -1
  13. package/build/cjs/components/FeedHeader/FeedHeader.js +1 -1
  14. package/build/cjs/components/FeedHeader/components/Controls/Controls.d.ts +1 -1
  15. package/build/cjs/components/FeedHeader/components/Controls/Controls.js +5 -8
  16. package/build/cjs/components/FeedHeader/components/Controls/customRenders.d.ts +1 -1
  17. package/build/cjs/components/FeedHeader/components/Controls/customRenders.js +1 -1
  18. package/build/cjs/components/Paginator/Paginator.js +3 -7
  19. package/build/cjs/components/Paginator/components/NavigationButton.js +1 -1
  20. package/build/cjs/components/Paginator/components/PaginatorItem.js +1 -1
  21. package/build/cjs/components/PostCard/PostCard.d.ts +0 -1
  22. package/build/cjs/components/PostCard/PostCard.js +1 -1
  23. package/build/cjs/components/PostInfo/PostInfo.d.ts +0 -1
  24. package/build/cjs/components/PostInfo/PostInfo.js +2 -2
  25. package/build/cjs/components/PostInfo/SuggestPostInfo.js +1 -1
  26. package/build/cjs/components/PostInfo/components/Date.js +1 -1
  27. package/build/cjs/components/PostInfo/components/Save.d.ts +0 -1
  28. package/build/cjs/components/PostInfo/components/Save.js +1 -2
  29. package/build/cjs/components/PostInfo/components/Sharing.d.ts +0 -1
  30. package/build/cjs/components/PostInfo/components/Sharing.js +1 -2
  31. package/build/cjs/components/Posts/Posts.js +1 -1
  32. package/build/cjs/components/PostsEmpty/PostsEmpty.js +1 -1
  33. package/build/cjs/components/Search/Search.js +2 -2
  34. package/build/cjs/components/Wrapper/Wrapper.js +1 -1
  35. package/build/cjs/constructor/BlogConstructorProvider.d.ts +1 -1
  36. package/build/cjs/constructor/BlogConstructorProvider.js +3 -3
  37. package/build/cjs/constructor/blocksMap.js +8 -8
  38. package/build/cjs/containers/BlogPage/BlogPage.d.ts +2 -2
  39. package/build/cjs/containers/BlogPage/BlogPage.js +2 -2
  40. package/build/cjs/containers/BlogPostPage/BlogPostPage.css +1 -1
  41. package/build/cjs/containers/BlogPostPage/BlogPostPage.d.ts +2 -2
  42. package/build/cjs/containers/BlogPostPage/BlogPostPage.js +2 -2
  43. package/build/cjs/contexts/FeedContext.d.ts +1 -1
  44. package/build/cjs/contexts/theme/ThemeProvider.js +1 -1
  45. package/build/cjs/counters/metrika.d.ts +0 -1
  46. package/build/cjs/counters/metrika.js +0 -1
  47. package/build/cjs/models/blocks.d.ts +1 -1
  48. package/build/cjs/models/common.d.ts +2 -1
  49. package/build/cjs/utils/common.d.ts +1 -1
  50. package/build/cjs/utils/common.js +1 -1
  51. package/build/esm/blocks/Author/Author.js +5 -5
  52. package/build/esm/blocks/Banner/Banner.js +4 -4
  53. package/build/esm/blocks/CTA/CTA.js +3 -3
  54. package/build/esm/blocks/ColoredText/ColoredText.js +1 -1
  55. package/build/esm/blocks/Feed/Feed.js +9 -12
  56. package/build/esm/blocks/Feed/reducer.d.ts +1 -1
  57. package/build/esm/blocks/Header/Header.js +3 -4
  58. package/build/esm/blocks/Meta/Meta.js +5 -6
  59. package/build/esm/blocks/Suggest/Suggest.js +4 -5
  60. package/build/esm/blocks/YFM/YFM.js +1 -1
  61. package/build/esm/components/FeedHeader/FeedHeader.d.ts +1 -1
  62. package/build/esm/components/FeedHeader/FeedHeader.js +2 -2
  63. package/build/esm/components/FeedHeader/components/Controls/Controls.d.ts +1 -1
  64. package/build/esm/components/FeedHeader/components/Controls/Controls.js +7 -10
  65. package/build/esm/components/FeedHeader/components/Controls/customRenders.d.ts +1 -1
  66. package/build/esm/components/FeedHeader/components/Controls/customRenders.js +2 -2
  67. package/build/esm/components/Paginator/Paginator.js +4 -8
  68. package/build/esm/components/Paginator/components/NavigationButton.js +2 -2
  69. package/build/esm/components/Paginator/components/PaginatorItem.js +1 -1
  70. package/build/esm/components/PostCard/PostCard.d.ts +0 -1
  71. package/build/esm/components/PostCard/PostCard.js +3 -3
  72. package/build/esm/components/PostInfo/PostInfo.d.ts +0 -1
  73. package/build/esm/components/PostInfo/PostInfo.js +2 -2
  74. package/build/esm/components/PostInfo/SuggestPostInfo.js +1 -1
  75. package/build/esm/components/PostInfo/components/Date.js +1 -1
  76. package/build/esm/components/PostInfo/components/ReadingTime.js +1 -1
  77. package/build/esm/components/PostInfo/components/Save.d.ts +0 -1
  78. package/build/esm/components/PostInfo/components/Save.js +1 -2
  79. package/build/esm/components/PostInfo/components/Sharing.d.ts +0 -1
  80. package/build/esm/components/PostInfo/components/Sharing.js +1 -2
  81. package/build/esm/components/Posts/Posts.js +2 -2
  82. package/build/esm/components/PostsEmpty/PostsEmpty.js +1 -1
  83. package/build/esm/components/PostsError/PostsError.js +1 -1
  84. package/build/esm/components/Search/Search.js +3 -3
  85. package/build/esm/components/Wrapper/Wrapper.js +1 -1
  86. package/build/esm/constructor/BlogConstructorProvider.d.ts +1 -1
  87. package/build/esm/constructor/BlogConstructorProvider.js +3 -3
  88. package/build/esm/constructor/blocksMap.js +8 -8
  89. package/build/esm/containers/BlogPage/BlogPage.d.ts +2 -2
  90. package/build/esm/containers/BlogPage/BlogPage.js +2 -2
  91. package/build/esm/containers/BlogPostPage/BlogPostPage.css +1 -1
  92. package/build/esm/containers/BlogPostPage/BlogPostPage.d.ts +2 -2
  93. package/build/esm/containers/BlogPostPage/BlogPostPage.js +2 -2
  94. package/build/esm/contexts/FeedContext.d.ts +1 -1
  95. package/build/esm/contexts/theme/ThemeProvider.js +1 -1
  96. package/build/esm/counters/metrika.d.ts +0 -1
  97. package/build/esm/counters/metrika.js +0 -1
  98. package/build/esm/hooks/useLikes.js +1 -1
  99. package/build/esm/models/blocks.d.ts +1 -1
  100. package/build/esm/models/common.d.ts +2 -1
  101. package/build/esm/utils/common.d.ts +1 -1
  102. package/build/esm/utils/common.js +3 -3
  103. package/package.json +4 -6
  104. package/server/data/contentFilter.js +1 -0
  105. package/server/data/createReadableContent.js +1 -1
  106. package/server/data/transformPost.d.ts +1 -1
  107. package/server/models/blocks.d.ts +1 -1
  108. package/server/models/common.d.ts +2 -1
  109. package/styles/yfm.css +1 -1
  110. package/styles/yfm.scss +1 -1
@@ -9,7 +9,6 @@ type PostCardProps = {
9
9
  size?: 's' | 'm';
10
10
  /**
11
11
  * @deprecated Metrika will be deleted after launch of analyticsEvents
12
- * https://st.yandex-team.ru/PAGECTR-7
13
12
  */
14
13
  metrikaGoals?: MetrikaGoal;
15
14
  };
@@ -1,8 +1,8 @@
1
- import React, { useMemo, useContext } from 'react';
2
- import { CardBase, YFMWrapper, HTML } from '@gravity-ui/page-constructor';
1
+ import React, { useContext, useMemo } from 'react';
2
+ import { CardBase, HTML, YFMWrapper } from '@gravity-ui/page-constructor';
3
3
  import { LikesContext } from '../../contexts/LikesContext';
4
- import { SuggestPostInfo } from '../PostInfo/SuggestPostInfo';
5
4
  import { block } from '../../utils/cn';
5
+ import { SuggestPostInfo } from '../PostInfo/SuggestPostInfo';
6
6
  import './PostCard.css';
7
7
  const b = block('post-card');
8
8
  export const PostCard = ({ post, metrikaGoals, fullWidth = false, size = 's', showTag = false, }) => {
@@ -12,7 +12,6 @@ type PostInfoProps = {
12
12
  theme?: 'light' | 'dark';
13
13
  /**
14
14
  * @deprecated Metrika will be deleted after launch of analyticsEvents
15
- * https://st.yandex-team.ru/PAGECTR-7
16
15
  */
17
16
  metrikaGoals?: BlogMetrikaGoals;
18
17
  dataQa?: string;
@@ -1,10 +1,10 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { PostPageContext } from '../../contexts/PostPageContext';
3
+ import { block } from '../../utils/cn';
3
4
  import { Date } from './components/Date';
4
5
  import { ReadingTime } from './components/ReadingTime';
5
- import { Sharing } from './components/Sharing';
6
6
  import { Save } from './components/Save';
7
- import { block } from '../../utils/cn';
7
+ import { Sharing } from './components/Sharing';
8
8
  import './PostInfo.css';
9
9
  const b = block('post-info');
10
10
  /**
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { useLikes } from '../../hooks/useLikes';
3
+ import { block } from '../../utils/cn';
3
4
  import { Date } from './components/Date';
4
5
  import { ReadingTime } from './components/ReadingTime';
5
6
  import { Save } from './components/Save';
6
- import { block } from '../../utils/cn';
7
7
  import './PostInfo.css';
8
8
  const b = block('post-info');
9
9
  /**
@@ -1,7 +1,7 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { LocaleContext } from '../../../contexts/LocaleContext';
3
- import { format } from '../../../utils/date';
4
3
  import { block } from '../../../utils/cn';
4
+ import { format } from '../../../utils/date';
5
5
  import '../PostInfo.css';
6
6
  const b = block('post-info');
7
7
  export const Date = ({ date, size = 's' }) => {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Icon } from '@gravity-ui/uikit';
3
- import { i18, Keyset } from '../../../i18n';
3
+ import { Keyset, i18 } from '../../../i18n';
4
4
  import { Time } from '../../../icons/Time';
5
5
  import { block } from '../../../utils/cn';
6
6
  import '../PostInfo.css';
@@ -8,7 +8,6 @@ type SaveProps = {
8
8
  theme?: 'light' | 'dark';
9
9
  /**
10
10
  * @deprecated Metrika will be deleted after launch of analyticsEvents
11
- * https://st.yandex-team.ru/PAGECTR-7
12
11
  */
13
12
  metrikaGoal?: string;
14
13
  dataQa?: string;
@@ -1,10 +1,9 @@
1
+ import React, { useContext } from 'react';
1
2
  import { useAnalytics } from '@gravity-ui/page-constructor';
2
3
  import { Icon } from '@gravity-ui/uikit';
3
- import React, { useContext } from 'react';
4
4
  import { UserContext } from '../../../contexts/UserContext';
5
5
  import metrika from '../../../counters/metrika.js';
6
6
  import { MetrikaCounter } from '../../../counters/utils';
7
- // @ts-ignore
8
7
  import { Save as SaveIcon } from '../../../icons/Save';
9
8
  import { SaveFilled } from '../../../icons/SaveFilled';
10
9
  import { DefaultEventNames } from '../../../models/common';
@@ -4,7 +4,6 @@ type SharingProps = {
4
4
  theme?: 'light' | 'dark';
5
5
  /**
6
6
  * @deprecated Metrika will be deleted after launch of analyticsEvents
7
- * https://st.yandex-team.ru/PAGECTR-7
8
7
  */
9
8
  metrikaGoal?: string;
10
9
  };
@@ -1,6 +1,6 @@
1
+ import React, { useCallback, useContext } from 'react';
1
2
  import { useAnalytics } from '@gravity-ui/page-constructor';
2
3
  import { SharePopover } from '@gravity-ui/uikit';
3
- import React, { useCallback, useContext } from 'react';
4
4
  import { MobileContext } from '../../../contexts/MobileContext';
5
5
  import { PostPageContext } from '../../../contexts/PostPageContext';
6
6
  import { RouterContext } from '../../../contexts/RouterContext';
@@ -11,7 +11,6 @@ import { ShareArrowUp } from '../../../icons/ShareArrowUp';
11
11
  import { DefaultEventNames } from '../../../models/common';
12
12
  import { block } from '../../../utils/cn';
13
13
  import { getAbsolutePath } from '../../../utils/common';
14
- // @ts-ignore
15
14
  import '../PostInfo.css';
16
15
  const b = block('post-info');
17
16
  export const Sharing = ({ theme, metrikaGoal }) => {
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { CardLayoutBlock } from '@gravity-ui/page-constructor';
3
3
  import { Button } from '@gravity-ui/uikit';
4
- import { i18, Keyset } from '../../i18n';
4
+ import { Keyset, i18 } from '../../i18n';
5
+ import { block } from '../../utils/cn';
5
6
  import { Paginator } from '../Paginator/Paginator';
6
7
  import { PostCard } from '../PostCard/PostCard';
7
8
  import { PostsEmpty } from '../PostsEmpty/PostsEmpty';
8
- import { block } from '../../utils/cn';
9
9
  import './Posts.css';
10
10
  const b = block('posts');
11
11
  export const Posts = ({ containerId, pinnedPostOnPage, currentPage, postsOnPage, isShowMoreVisible, errorShowMore, postCountOnPage, perPageInQuery, isFetching, isShowMoreFetching, handleShowMore, handlePageChange, pageCountForShowSupportButtons, }) => (React.createElement("div", { className: b() },
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
+ import { Keyset, i18 } from '../../i18n';
2
3
  import { block } from '../../utils/cn';
3
4
  import './PostsEmpty.css';
4
- import { i18, Keyset } from '../../i18n';
5
5
  const b = block('posts-empty');
6
6
  export const PostsEmpty = () => (React.createElement("div", { className: b('container') },
7
7
  React.createElement("div", { className: b('title') }, i18(Keyset.TitleEmptyContainer)),
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Button } from '@gravity-ui/uikit';
3
- import { i18, Keyset } from '../../i18n';
3
+ import { Keyset, i18 } from '../../i18n';
4
4
  import { block } from '../../utils/cn';
5
5
  import './PostError.css';
6
6
  const b = block('posts-error');
@@ -1,12 +1,12 @@
1
- import React, { useRef, useEffect, useState } from 'react';
1
+ import React, { useEffect, useRef, useState } from 'react';
2
2
  import { debounce as lodashDebounce } from 'lodash';
3
3
  import { TextInput } from '@gravity-ui/uikit';
4
- import { ButtonWithIcon } from '../ButtonWithIcon/ButtonWithIcon';
5
4
  import { useIsIPhone } from '../../hooks/useIsIPhone';
5
+ import { Keyset, i18 } from '../../i18n';
6
6
  import { Close } from '../../icons/Close';
7
7
  import { SearchIcon } from '../../icons/SearchIcon';
8
- import { i18, Keyset } from '../../i18n';
9
8
  import { block } from '../../utils/cn';
9
+ import { ButtonWithIcon } from '../ButtonWithIcon/ButtonWithIcon';
10
10
  import './Search.css';
11
11
  const b = block('search');
12
12
  const SEARCH_ICON_SIZE = 16;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { block } from '../../utils/cn';
3
2
  import { DEFAULT_PADDINGS } from '../../constants';
3
+ import { block } from '../../utils/cn';
4
4
  import './Wrapper.css';
5
5
  const b = block('wrapper');
6
6
  export const Wrapper = ({ children, paddings = DEFAULT_PADDINGS, className, dataQa, }) => (React.createElement("section", { className: b({
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { AnalyticsContextProps } from '@gravity-ui/page-constructor';
3
+ import { DeviceContextProps } from '../contexts/DeviceContext';
3
4
  import { RouterContextProps } from '../contexts/RouterContext';
4
5
  import { UserContextProps } from '../contexts/UserContext';
5
- import { DeviceContextProps } from '../contexts/DeviceContext';
6
6
  import { ThemeValueType } from '../contexts/theme/ThemeValueContext';
7
7
  import { Locale } from '../models/locale';
8
8
  export interface BlogConstructorProviderProps {
@@ -1,12 +1,12 @@
1
1
  import React, { Fragment } from 'react';
2
2
  import { AnalyticsContext } from '@gravity-ui/page-constructor';
3
- import { MobileContext } from '../contexts/MobileContext';
3
+ import { DEFAULT_THEME } from '../constants';
4
+ import { DeviceContext } from '../contexts/DeviceContext';
4
5
  import { LocaleContext } from '../contexts/LocaleContext';
6
+ import { MobileContext } from '../contexts/MobileContext';
5
7
  import { RouterContext } from '../contexts/RouterContext';
6
8
  import { UserContext } from '../contexts/UserContext';
7
- import { DeviceContext } from '../contexts/DeviceContext';
8
9
  import { ThemeValueContext } from '../contexts/theme/ThemeValueContext';
9
- import { DEFAULT_THEME } from '../constants';
10
10
  export const BlogConstructorProvider = ({ isMobile, locale = {}, router = {}, theme = DEFAULT_THEME, user = {}, device = {}, analytics = {}, children, }) => {
11
11
  const context = [
12
12
  React.createElement(ThemeValueContext.Provider, { value: { themeValue: theme }, key: "theme-context" }),
@@ -1,15 +1,15 @@
1
- import { BlockType } from '../models/common';
1
+ import { Author } from '../blocks/Author/Author';
2
+ import { Banner } from '../blocks/Banner/Banner';
3
+ import { CTA } from '../blocks/CTA/CTA';
4
+ import { ColoredText } from '../blocks/ColoredText/ColoredText';
5
+ import { Feed } from '../blocks/Feed/Feed';
2
6
  import { Header } from '../blocks/Header/Header';
3
- import { YFM } from '../blocks/YFM/YFM';
4
7
  import { Layout } from '../blocks/Layout/Layout';
5
8
  import { Media } from '../blocks/Media/Media';
6
- import { CTA } from '../blocks/CTA/CTA';
7
- import { ColoredText } from '../blocks/ColoredText/ColoredText';
8
- import { Author } from '../blocks/Author/Author';
9
- import { Suggest } from '../blocks/Suggest/Suggest';
10
- import { Banner } from '../blocks/Banner/Banner';
11
9
  import { Meta } from '../blocks/Meta/Meta';
12
- import { Feed } from '../blocks/Feed/Feed';
10
+ import { Suggest } from '../blocks/Suggest/Suggest';
11
+ import { YFM } from '../blocks/YFM/YFM';
12
+ import { BlockType } from '../models/common';
13
13
  const blocks = {
14
14
  [BlockType.YFM]: YFM,
15
15
  [BlockType.Layout]: Layout,
@@ -1,5 +1,5 @@
1
- import { PageContent, PageConstructorProviderProps, NavigationData } from '@gravity-ui/page-constructor';
2
- import { Tag, PostsProps, ToggleLikeCallbackType, MetaProps, GetPostsType, SetQueryType, Service } from '../../models/common';
1
+ import { NavigationData, PageConstructorProviderProps, PageContent } from '@gravity-ui/page-constructor';
2
+ import { GetPostsType, MetaProps, PostsProps, Service, SetQueryType, Tag, ToggleLikeCallbackType } from '../../models/common';
3
3
  import './BlogPage.css';
4
4
  export type BlogPageProps = {
5
5
  content: PageContent;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { PageConstructor, PageConstructorProvider, } from '@gravity-ui/page-constructor';
3
- import { FeedContext } from '../../contexts/FeedContext';
4
- import { LikesContext } from '../../contexts/LikesContext';
5
3
  import { MetaWrapper } from '../../components/MetaWrapper/MetaWrapper';
6
4
  import componentMap from '../../constructor/blocksMap';
5
+ import { FeedContext } from '../../contexts/FeedContext';
6
+ import { LikesContext } from '../../contexts/LikesContext';
7
7
  import './BlogPage.css';
8
8
  export const BlogPage = ({ content, posts, tags, services, getPosts, metaData, toggleLike, navigation, settings, pageCountForShowSupportButtons, }) => (React.createElement("main", null,
9
9
  React.createElement(LikesContext.Provider, { value: {
@@ -56,7 +56,7 @@ unpredictable css rules order in build */
56
56
  .yfm_blog h5,
57
57
  .yfm_blog h6 {
58
58
  margin-bottom: 16px;
59
- margin-top: 48px;
59
+ margin-top: 32px;
60
60
  padding-top: 0;
61
61
  font-weight: var(--yc-text-header-font-weight);
62
62
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { PageContent, PageConstructorProviderProps, NavigationData } from '@gravity-ui/page-constructor';
2
+ import { NavigationData, PageConstructorProviderProps, PageContent } from '@gravity-ui/page-constructor';
3
3
  import { ShareOptions } from '@gravity-ui/uikit';
4
- import { PostData, ToggleLikeCallbackType, MetaProps } from '../../models/common';
4
+ import { MetaProps, PostData, ToggleLikeCallbackType } from '../../models/common';
5
5
  import './BlogPostPage.css';
6
6
  export interface BlogPostPageProps {
7
7
  suggestedPosts: PostData[];
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import { PageConstructor, PageConstructorProvider, } from '@gravity-ui/page-constructor';
3
+ import { MetaWrapper } from '../../components/MetaWrapper/MetaWrapper';
3
4
  import componentMap from '../../constructor/blocksMap';
4
- import { PostPageContext } from '../../contexts/PostPageContext';
5
5
  import { LikesContext } from '../../contexts/LikesContext';
6
+ import { PostPageContext } from '../../contexts/PostPageContext';
6
7
  import { useLikes } from '../../hooks/useLikes';
7
- import { MetaWrapper } from '../../components/MetaWrapper/MetaWrapper';
8
8
  import './BlogPostPage.css';
9
9
  export const BlogPostPage = ({ metaData, suggestedPosts, likes, content, post, settings, navigation, shareOptions, }) => {
10
10
  const { hasUserLike, likesCount, handleLike } = useLikes({
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { PostData, Tag, SetQueryType, GetPostsType, Service } from '../models/common';
2
+ import { GetPostsType, PostData, Service, SetQueryType, Tag } from '../models/common';
3
3
  export interface FeedContextProps {
4
4
  posts?: PostData[];
5
5
  pinnedPost?: PostData;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
+ import { DEFAULT_THEME } from '../../constants';
2
3
  import { ThemeContext } from './ThemeContext';
3
4
  import { ThemeValueContext } from './ThemeValueContext';
4
- import { DEFAULT_THEME } from '../../constants';
5
5
  export class ThemeProvider extends React.Component {
6
6
  constructor() {
7
7
  super(...arguments);
@@ -23,7 +23,6 @@ declare function reachGoal(counterName: any, ...args: any[]): void;
23
23
  declare function reachGoals(goals: any, counterName?: string): void;
24
24
  /**
25
25
  * @deprecated Metrika will be deleted after launch of analyticsEvents
26
- * https://st.yandex-team.ru/PAGECTR-7
27
26
  */
28
27
  declare const Goal: {
29
28
  SUPPORT_OPEN_FORM: string;
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * @deprecated Metrika will be deleted after launch of analyticsEvents
3
- * https://st.yandex-team.ru/PAGECTR-7
4
3
  */
5
4
  const Goal = {
6
5
  SUPPORT_OPEN_FORM: 'SUPPORTOPENFORM',
@@ -1,4 +1,4 @@
1
- import { useState, useCallback, useEffect } from 'react';
1
+ import { useCallback, useEffect, useState } from 'react';
2
2
  export const useLikes = ({ hasLike, count, toggleLikeCallback, postId }) => {
3
3
  const [hasUserLike, setHasUserLike] = useState(hasLike !== null && hasLike !== void 0 ? hasLike : false);
4
4
  const [likesCount, setLikesCount] = useState(count !== null && count !== void 0 ? count : 0);
@@ -1,7 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ContentBlockProps, HeaderBlockProps, MediaProps as PCMediaProps, TextTheme } from '@gravity-ui/page-constructor';
3
+ import { BlockType, ClassNameProps, PostData } from './common';
3
4
  import { PaddingsYFMProps } from './paddings';
4
- import { ClassNameProps, PostData, BlockType } from './common';
5
5
  export type AuthorProps = ClassNameProps & {
6
6
  authorId: number;
7
7
  image: string;
@@ -1,5 +1,5 @@
1
- import { IDevice, IBrowser } from 'ua-parser-js';
2
1
  import { ReactNode } from 'react';
2
+ import { IBrowser, IDevice } from 'ua-parser-js';
3
3
  import { HeaderBlockProps as PageConstructorHeaderBlockProps } from '@gravity-ui/page-constructor';
4
4
  import { Locale } from '../models/locale';
5
5
  export declare enum Theme {
@@ -18,6 +18,7 @@ export type Author = {
18
18
  secondName: string | null;
19
19
  description: string | null;
20
20
  fullDescription: string | null;
21
+ shortDescription: string | null;
21
22
  } & {
22
23
  [x: string]: string | null;
23
24
  };
@@ -1,7 +1,7 @@
1
1
  /// <reference types="lodash" />
2
2
  import { ContentBlockProps, HeaderBreadCrumbsProps, MetrikaGoal, NewMetrikaGoal } from '@gravity-ui/page-constructor';
3
3
  import { RouterContextProps } from '../contexts/RouterContext';
4
- import { Tag, GetPostsRequest, Query } from '../models/common';
4
+ import { GetPostsRequest, Query, Tag } from '../models/common';
5
5
  export interface QueryParam {
6
6
  name: string;
7
7
  value?: string | number | null;
@@ -10,10 +10,10 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { format, parse } from 'url';
13
- import { memoize, debounce } from 'lodash';
13
+ import { debounce, memoize } from 'lodash';
14
14
  import { isNewMetrikaFormat, } from '@gravity-ui/page-constructor';
15
- import { i18, Keyset } from '../i18n';
16
- import { CONTENT_DEFAULT_COL_SIZES, CONTENT_DEFAULT_SIZE, CONTENT_DEFAULT_THEME, DEFAULT_ROWS_PER_PAGE, DEFAULT_PAGE, } from '../blocks/constants';
15
+ import { CONTENT_DEFAULT_COL_SIZES, CONTENT_DEFAULT_SIZE, CONTENT_DEFAULT_THEME, DEFAULT_PAGE, DEFAULT_ROWS_PER_PAGE, } from '../blocks/constants';
16
+ import { Keyset, i18 } from '../i18n';
17
17
  export function getAbsolutePath(router, url) {
18
18
  if (!router || !router.pathname) {
19
19
  return url !== null && url !== void 0 ? url : '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/blog-constructor",
3
- "version": "2.1.2-alpha.2",
3
+ "version": "2.3.0",
4
4
  "description": "Gravity UI Blog Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -72,7 +72,7 @@
72
72
  "@babel/core": "^7.15.8",
73
73
  "@commitlint/config-conventional": "^17.4.3",
74
74
  "@doc-tools/transform": "^2.9.0",
75
- "@gravity-ui/eslint-config": "^1.0.2",
75
+ "@gravity-ui/eslint-config": "^2.0.0",
76
76
  "@gravity-ui/page-constructor": "^2.6.0",
77
77
  "@gravity-ui/prettier-config": "^1.0.1",
78
78
  "@gravity-ui/stylelint-config": "^1.0.0",
@@ -96,8 +96,9 @@
96
96
  "@types/react-transition-group": "^4.4.4",
97
97
  "@types/sanitize-html": "^2.6.0",
98
98
  "@types/ua-parser-js": "^0.7.36",
99
- "eslint": "^8.0.0",
99
+ "eslint": "^8.34.0",
100
100
  "eslint-plugin-local": "./eslint-plugin-local",
101
+ "eslint-plugin-no-not-accumulator-reassign": "^0.1.0",
101
102
  "eslint-plugin-testing-library": "^5.9.1",
102
103
  "gulp": "^4.0.2",
103
104
  "gulp-dart-sass": "^1.0.2",
@@ -140,8 +141,5 @@
140
141
  "*.{json,yaml,yml,md}": [
141
142
  "prettier --write"
142
143
  ]
143
- },
144
- "publishConfig": {
145
- "tag": "alpha"
146
144
  }
147
145
  }
@@ -21,6 +21,7 @@ const filterItems = ({ items, itemsKey, options }) => {
21
21
  const whenResult = when === true ||
22
22
  when === undefined ||
23
23
  (typeof when === 'string' && (0, evaluation_1.default)(when, options));
24
+ // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
24
25
  delete item.when;
25
26
  if (whenResult) {
26
27
  const property = item[itemsKey];
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createReadableContent = void 0;
4
- const config_1 = require("./config");
5
4
  const common_1 = require("../models/common");
5
+ const config_1 = require("./config");
6
6
  /**
7
7
  * Function for create readable content
8
8
  *
@@ -1,5 +1,5 @@
1
- import { Lang } from '../models/locale';
2
1
  import { PostData } from '../models/common';
2
+ import { Lang } from '../models/locale';
3
3
  /**
4
4
  * Func for transform post data
5
5
  *
@@ -1,7 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ContentBlockProps, HeaderBlockProps, MediaProps as PCMediaProps, TextTheme } from '@gravity-ui/page-constructor';
3
+ import { BlockType, ClassNameProps, PostData } from './common';
3
4
  import { PaddingsYFMProps } from './paddings';
4
- import { ClassNameProps, PostData, BlockType } from './common';
5
5
  export type AuthorProps = ClassNameProps & {
6
6
  authorId: number;
7
7
  image: string;
@@ -1,5 +1,5 @@
1
- import { IDevice, IBrowser } from 'ua-parser-js';
2
1
  import { ReactNode } from 'react';
2
+ import { IBrowser, IDevice } from 'ua-parser-js';
3
3
  import { HeaderBlockProps as PageConstructorHeaderBlockProps } from '@gravity-ui/page-constructor';
4
4
  import { Locale } from '../models/locale';
5
5
  export declare enum Theme {
@@ -18,6 +18,7 @@ export type Author = {
18
18
  secondName: string | null;
19
19
  description: string | null;
20
20
  fullDescription: string | null;
21
+ shortDescription: string | null;
21
22
  } & {
22
23
  [x: string]: string | null;
23
24
  };
package/styles/yfm.css CHANGED
@@ -32,7 +32,7 @@ unpredictable css rules order in build */
32
32
  .yfm_blog h5,
33
33
  .yfm_blog h6 {
34
34
  margin-bottom: 16px;
35
- margin-top: 48px;
35
+ margin-top: 32px;
36
36
  padding-top: 0;
37
37
  font-weight: var(--yc-text-header-font-weight);
38
38
  }
package/styles/yfm.scss CHANGED
@@ -33,7 +33,7 @@
33
33
  h5,
34
34
  h6 {
35
35
  margin-bottom: $indentXS;
36
- margin-top: $indentL;
36
+ margin-top: $indentM;
37
37
  padding-top: 0;
38
38
  font-weight: var(--yc-text-header-font-weight);
39
39
  }