@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.
- package/CHANGELOG.md +26 -0
- package/build/cjs/blocks/Author/Author.js +3 -3
- package/build/cjs/blocks/Banner/Banner.js +4 -4
- package/build/cjs/blocks/CTA/CTA.js +3 -3
- package/build/cjs/blocks/ColoredText/ColoredText.js +1 -1
- package/build/cjs/blocks/Feed/Feed.js +17 -20
- package/build/cjs/blocks/Feed/reducer.d.ts +1 -1
- package/build/cjs/blocks/Header/Header.js +3 -4
- package/build/cjs/blocks/Meta/Meta.js +5 -6
- package/build/cjs/blocks/Suggest/Suggest.js +4 -5
- package/build/cjs/blocks/YFM/YFM.js +1 -1
- package/build/cjs/components/FeedHeader/FeedHeader.d.ts +1 -1
- package/build/cjs/components/FeedHeader/FeedHeader.js +1 -1
- package/build/cjs/components/FeedHeader/components/Controls/Controls.d.ts +1 -1
- package/build/cjs/components/FeedHeader/components/Controls/Controls.js +5 -8
- package/build/cjs/components/FeedHeader/components/Controls/customRenders.d.ts +1 -1
- package/build/cjs/components/FeedHeader/components/Controls/customRenders.js +1 -1
- package/build/cjs/components/Paginator/Paginator.js +3 -7
- package/build/cjs/components/Paginator/components/NavigationButton.js +1 -1
- package/build/cjs/components/Paginator/components/PaginatorItem.js +1 -1
- package/build/cjs/components/PostCard/PostCard.d.ts +0 -1
- package/build/cjs/components/PostCard/PostCard.js +1 -1
- package/build/cjs/components/PostInfo/PostInfo.d.ts +0 -1
- package/build/cjs/components/PostInfo/PostInfo.js +2 -2
- package/build/cjs/components/PostInfo/SuggestPostInfo.js +1 -1
- package/build/cjs/components/PostInfo/components/Date.js +1 -1
- package/build/cjs/components/PostInfo/components/Save.d.ts +0 -1
- package/build/cjs/components/PostInfo/components/Save.js +1 -2
- package/build/cjs/components/PostInfo/components/Sharing.d.ts +0 -1
- package/build/cjs/components/PostInfo/components/Sharing.js +1 -2
- package/build/cjs/components/Posts/Posts.js +1 -1
- package/build/cjs/components/PostsEmpty/PostsEmpty.js +1 -1
- package/build/cjs/components/Search/Search.js +2 -2
- package/build/cjs/components/Wrapper/Wrapper.js +1 -1
- package/build/cjs/constructor/BlogConstructorProvider.d.ts +1 -1
- package/build/cjs/constructor/BlogConstructorProvider.js +3 -3
- package/build/cjs/constructor/blocksMap.js +8 -8
- package/build/cjs/containers/BlogPage/BlogPage.d.ts +2 -2
- package/build/cjs/containers/BlogPage/BlogPage.js +2 -2
- package/build/cjs/containers/BlogPostPage/BlogPostPage.css +1 -1
- package/build/cjs/containers/BlogPostPage/BlogPostPage.d.ts +2 -2
- package/build/cjs/containers/BlogPostPage/BlogPostPage.js +2 -2
- package/build/cjs/contexts/FeedContext.d.ts +1 -1
- package/build/cjs/contexts/theme/ThemeProvider.js +1 -1
- package/build/cjs/counters/metrika.d.ts +0 -1
- package/build/cjs/counters/metrika.js +0 -1
- package/build/cjs/models/blocks.d.ts +1 -1
- package/build/cjs/models/common.d.ts +2 -1
- package/build/cjs/utils/common.d.ts +1 -1
- package/build/cjs/utils/common.js +1 -1
- package/build/esm/blocks/Author/Author.js +5 -5
- package/build/esm/blocks/Banner/Banner.js +4 -4
- package/build/esm/blocks/CTA/CTA.js +3 -3
- package/build/esm/blocks/ColoredText/ColoredText.js +1 -1
- package/build/esm/blocks/Feed/Feed.js +9 -12
- package/build/esm/blocks/Feed/reducer.d.ts +1 -1
- package/build/esm/blocks/Header/Header.js +3 -4
- package/build/esm/blocks/Meta/Meta.js +5 -6
- package/build/esm/blocks/Suggest/Suggest.js +4 -5
- package/build/esm/blocks/YFM/YFM.js +1 -1
- package/build/esm/components/FeedHeader/FeedHeader.d.ts +1 -1
- package/build/esm/components/FeedHeader/FeedHeader.js +2 -2
- package/build/esm/components/FeedHeader/components/Controls/Controls.d.ts +1 -1
- package/build/esm/components/FeedHeader/components/Controls/Controls.js +7 -10
- package/build/esm/components/FeedHeader/components/Controls/customRenders.d.ts +1 -1
- package/build/esm/components/FeedHeader/components/Controls/customRenders.js +2 -2
- package/build/esm/components/Paginator/Paginator.js +4 -8
- package/build/esm/components/Paginator/components/NavigationButton.js +2 -2
- package/build/esm/components/Paginator/components/PaginatorItem.js +1 -1
- package/build/esm/components/PostCard/PostCard.d.ts +0 -1
- package/build/esm/components/PostCard/PostCard.js +3 -3
- package/build/esm/components/PostInfo/PostInfo.d.ts +0 -1
- package/build/esm/components/PostInfo/PostInfo.js +2 -2
- package/build/esm/components/PostInfo/SuggestPostInfo.js +1 -1
- package/build/esm/components/PostInfo/components/Date.js +1 -1
- package/build/esm/components/PostInfo/components/ReadingTime.js +1 -1
- package/build/esm/components/PostInfo/components/Save.d.ts +0 -1
- package/build/esm/components/PostInfo/components/Save.js +1 -2
- package/build/esm/components/PostInfo/components/Sharing.d.ts +0 -1
- package/build/esm/components/PostInfo/components/Sharing.js +1 -2
- package/build/esm/components/Posts/Posts.js +2 -2
- package/build/esm/components/PostsEmpty/PostsEmpty.js +1 -1
- package/build/esm/components/PostsError/PostsError.js +1 -1
- package/build/esm/components/Search/Search.js +3 -3
- package/build/esm/components/Wrapper/Wrapper.js +1 -1
- package/build/esm/constructor/BlogConstructorProvider.d.ts +1 -1
- package/build/esm/constructor/BlogConstructorProvider.js +3 -3
- package/build/esm/constructor/blocksMap.js +8 -8
- package/build/esm/containers/BlogPage/BlogPage.d.ts +2 -2
- package/build/esm/containers/BlogPage/BlogPage.js +2 -2
- package/build/esm/containers/BlogPostPage/BlogPostPage.css +1 -1
- package/build/esm/containers/BlogPostPage/BlogPostPage.d.ts +2 -2
- package/build/esm/containers/BlogPostPage/BlogPostPage.js +2 -2
- package/build/esm/contexts/FeedContext.d.ts +1 -1
- package/build/esm/contexts/theme/ThemeProvider.js +1 -1
- package/build/esm/counters/metrika.d.ts +0 -1
- package/build/esm/counters/metrika.js +0 -1
- package/build/esm/hooks/useLikes.js +1 -1
- package/build/esm/models/blocks.d.ts +1 -1
- package/build/esm/models/common.d.ts +2 -1
- package/build/esm/utils/common.d.ts +1 -1
- package/build/esm/utils/common.js +3 -3
- package/package.json +4 -6
- package/server/data/contentFilter.js +1 -0
- package/server/data/createReadableContent.js +1 -1
- package/server/data/transformPost.d.ts +1 -1
- package/server/models/blocks.d.ts +1 -1
- package/server/models/common.d.ts +2 -1
- package/styles/yfm.css +1 -1
- package/styles/yfm.scss +1 -1
@@ -1,8 +1,8 @@
|
|
1
|
-
import React, {
|
2
|
-
import { CardBase,
|
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, }) => {
|
@@ -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 {
|
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 {
|
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';
|
@@ -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';
|
@@ -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 {
|
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,12 +1,12 @@
|
|
1
|
-
import 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 {
|
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 {
|
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 {
|
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 {
|
2
|
-
import {
|
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: {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
2
|
+
import { NavigationData, PageConstructorProviderProps, PageContent } from '@gravity-ui/page-constructor';
|
3
3
|
import { ShareOptions } from '@gravity-ui/uikit';
|
4
|
-
import { PostData, ToggleLikeCallbackType
|
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,
|
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,4 +1,4 @@
|
|
1
|
-
import {
|
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 {
|
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 {
|
13
|
+
import { debounce, memoize } from 'lodash';
|
14
14
|
import { isNewMetrikaFormat, } from '@gravity-ui/page-constructor';
|
15
|
-
import {
|
16
|
-
import {
|
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.
|
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": "^
|
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.
|
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,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