@gravity-ui/blog-constructor 5.0.2 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/blocks/Author/Author.d.ts +1 -1
- package/build/cjs/blocks/Author/Author.js +2 -2
- package/build/cjs/blocks/Banner/Banner.d.ts +1 -1
- package/build/cjs/blocks/Banner/Banner.js +7 -5
- package/build/cjs/blocks/CTA/CTA.d.ts +1 -1
- package/build/cjs/blocks/ColoredText/ColoredText.d.ts +1 -1
- package/build/cjs/blocks/ColoredText/ColoredText.js +5 -4
- package/build/cjs/blocks/Feed/Feed.d.ts +1 -1
- package/build/cjs/blocks/Header/Header.d.ts +1 -1
- package/build/cjs/blocks/Layout/Layout.d.ts +2 -2
- package/build/cjs/blocks/Media/Media.d.ts +1 -1
- package/build/cjs/blocks/Meta/Meta.d.ts +1 -1
- package/build/cjs/blocks/Suggest/Suggest.d.ts +1 -1
- package/build/cjs/blocks/YFM/YFM.d.ts +1 -1
- package/build/cjs/blocks/YFM/YFM.js +6 -4
- package/build/cjs/components/FeedHeader/FeedHeader.d.ts +1 -1
- package/build/cjs/components/FeedHeader/components/Controls/Controls.css +5 -23
- package/build/cjs/components/FeedHeader/components/Controls/Controls.d.ts +1 -1
- package/build/cjs/components/FeedHeader/components/Controls/Controls.js +1 -1
- package/build/cjs/components/FeedHeader/components/Controls/customRenders.js +1 -2
- package/build/cjs/components/Paginator/types.d.ts +4 -4
- package/build/cjs/components/PostCard/PostCard.d.ts +4 -3
- package/build/cjs/components/PostCard/PostCard.js +5 -4
- package/build/cjs/components/PostInfo/PostInfo.d.ts +1 -1
- package/build/cjs/components/PostInfo/SuggestPostInfo.d.ts +3 -3
- package/build/cjs/components/PostInfo/SuggestPostInfo.js +2 -1
- package/build/cjs/components/PostInfo/components/Date.d.ts +3 -2
- package/build/cjs/components/PostInfo/components/Date.js +2 -1
- package/build/cjs/components/PostInfo/components/ReadingTime.d.ts +1 -1
- package/build/cjs/components/PostInfo/components/Save.d.ts +1 -1
- package/build/cjs/components/PostInfo/components/Sharing.d.ts +1 -1
- package/build/cjs/components/Posts/Posts.d.ts +1 -1
- package/build/cjs/components/Posts/Posts.js +5 -2
- package/build/cjs/components/PostsEmpty/PostsEmpty.d.ts +1 -1
- package/build/cjs/components/PostsError/PostsError.d.ts +1 -1
- package/build/cjs/components/Search/Search.css +13 -15
- package/build/cjs/components/Search/Search.d.ts +7 -1
- package/build/cjs/components/Search/Search.js +26 -14
- package/build/cjs/constructor/BlogConstructorProvider.d.ts +2 -2
- package/build/cjs/constructor/blocksMap.d.ts +11 -11
- package/build/cjs/containers/BlogPostPage/BlogPostPage.d.ts +1 -1
- package/build/cjs/icons/Close.d.ts +1 -1
- package/build/cjs/icons/DropdownArrow.d.ts +1 -1
- package/build/cjs/icons/Save.d.ts +1 -1
- package/build/cjs/icons/SaveFilled.d.ts +1 -1
- package/build/cjs/icons/SearchIcon.d.ts +1 -1
- package/build/cjs/icons/ShareArrowUp.d.ts +1 -1
- package/build/cjs/icons/Time.d.ts +1 -1
- package/build/cjs/models/blocks.d.ts +5 -5
- package/build/cjs/models/common.d.ts +8 -0
- package/build/cjs/models/common.js +12 -2
- package/build/cjs/utils/cn.d.ts +2 -3
- package/build/cjs/utils/cn.js +4 -7
- package/build/cjs/utils/common.d.ts +1 -0
- package/build/cjs/utils/common.js +15 -2
- package/build/esm/blocks/Author/Author.d.ts +1 -1
- package/build/esm/blocks/Author/Author.js +2 -2
- package/build/esm/blocks/Banner/Banner.d.ts +1 -1
- package/build/esm/blocks/Banner/Banner.js +8 -6
- package/build/esm/blocks/CTA/CTA.d.ts +1 -1
- package/build/esm/blocks/ColoredText/ColoredText.d.ts +1 -1
- package/build/esm/blocks/ColoredText/ColoredText.js +6 -5
- package/build/esm/blocks/Feed/Feed.d.ts +1 -1
- package/build/esm/blocks/Header/Header.d.ts +1 -1
- package/build/esm/blocks/Layout/Layout.d.ts +2 -2
- package/build/esm/blocks/Media/Media.d.ts +1 -1
- package/build/esm/blocks/Meta/Meta.d.ts +1 -1
- package/build/esm/blocks/Suggest/Suggest.d.ts +1 -1
- package/build/esm/blocks/YFM/YFM.d.ts +1 -1
- package/build/esm/blocks/YFM/YFM.js +6 -4
- package/build/esm/components/FeedHeader/FeedHeader.d.ts +1 -1
- package/build/esm/components/FeedHeader/components/Controls/Controls.css +5 -23
- package/build/esm/components/FeedHeader/components/Controls/Controls.d.ts +1 -1
- package/build/esm/components/FeedHeader/components/Controls/Controls.js +1 -1
- package/build/esm/components/FeedHeader/components/Controls/customRenders.js +1 -2
- package/build/esm/components/Paginator/types.d.ts +4 -4
- package/build/esm/components/PostCard/PostCard.d.ts +4 -3
- package/build/esm/components/PostCard/PostCard.js +5 -4
- package/build/esm/components/PostInfo/PostInfo.d.ts +1 -1
- package/build/esm/components/PostInfo/SuggestPostInfo.d.ts +3 -3
- package/build/esm/components/PostInfo/SuggestPostInfo.js +2 -1
- package/build/esm/components/PostInfo/components/Date.d.ts +3 -2
- package/build/esm/components/PostInfo/components/Date.js +2 -1
- package/build/esm/components/PostInfo/components/ReadingTime.d.ts +1 -1
- package/build/esm/components/PostInfo/components/Save.d.ts +1 -1
- package/build/esm/components/PostInfo/components/Sharing.d.ts +1 -1
- package/build/esm/components/Posts/Posts.d.ts +1 -1
- package/build/esm/components/Posts/Posts.js +5 -2
- package/build/esm/components/PostsEmpty/PostsEmpty.d.ts +1 -1
- package/build/esm/components/PostsError/PostsError.d.ts +1 -1
- package/build/esm/components/Search/Search.css +13 -15
- package/build/esm/components/Search/Search.d.ts +7 -1
- package/build/esm/components/Search/Search.js +28 -16
- package/build/esm/constructor/BlogConstructorProvider.d.ts +2 -2
- package/build/esm/constructor/blocksMap.d.ts +11 -11
- package/build/esm/containers/BlogPostPage/BlogPostPage.d.ts +1 -1
- package/build/esm/icons/Close.d.ts +1 -1
- package/build/esm/icons/DropdownArrow.d.ts +1 -1
- package/build/esm/icons/Save.d.ts +1 -1
- package/build/esm/icons/SaveFilled.d.ts +1 -1
- package/build/esm/icons/SearchIcon.d.ts +1 -1
- package/build/esm/icons/ShareArrowUp.d.ts +1 -1
- package/build/esm/icons/Time.d.ts +1 -1
- package/build/esm/models/blocks.d.ts +5 -5
- package/build/esm/models/common.d.ts +8 -0
- package/build/esm/models/common.js +11 -1
- package/build/esm/utils/cn.d.ts +2 -3
- package/build/esm/utils/cn.js +3 -4
- package/build/esm/utils/common.d.ts +1 -0
- package/build/esm/utils/common.js +13 -1
- package/package.json +18 -6
- package/server/models/blocks.d.ts +5 -5
- package/server/models/common.d.ts +8 -0
- package/server/models/common.js +12 -2
- package/build/cjs/components/ButtonWithIcon/ButtonWithIcon.css +0 -76
- package/build/cjs/components/ButtonWithIcon/ButtonWithIcon.d.ts +0 -12
- package/build/cjs/components/ButtonWithIcon/ButtonWithIcon.js +0 -11
- package/build/cjs/demo/DocsDecorator/DocsDecorator.css +0 -14
- package/build/cjs/internal-typings/bem-cn-lite.d.ts +0 -17
- package/build/esm/components/ButtonWithIcon/ButtonWithIcon.css +0 -76
- package/build/esm/components/ButtonWithIcon/ButtonWithIcon.d.ts +0 -13
- package/build/esm/components/ButtonWithIcon/ButtonWithIcon.js +0 -7
- package/build/esm/demo/DocsDecorator/DocsDecorator.css +0 -14
- package/build/esm/internal-typings/bem-cn-lite.d.ts +0 -17
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
blocks: {
|
|
3
|
-
"blog-yfm-block": import("
|
|
4
|
-
"blog-layout-block": import("react").
|
|
5
|
-
"blog-media-block": import("
|
|
6
|
-
"blog-banner-block": import("
|
|
7
|
-
"blog-cta-block": import("
|
|
8
|
-
"blog-colored-text-block": import("
|
|
9
|
-
"blog-author-block": import("
|
|
10
|
-
"blog-suggest-block": import("
|
|
11
|
-
"blog-meta-block": import("
|
|
12
|
-
"blog-feed-block": import("
|
|
3
|
+
"blog-yfm-block": (props: import("../models/blocks").YFMProps) => import("react").JSX.Element;
|
|
4
|
+
"blog-layout-block": ({ fullWidth, mobileOrder, children, paddingTop, paddingBottom, }: import("react").PropsWithChildren<import("../models/blocks").LayoutProps>) => import("react").JSX.Element;
|
|
5
|
+
"blog-media-block": ({ text, paddingTop, paddingBottom, ...mediaProps }: import("../models/blocks").MediaProps) => import("react").JSX.Element;
|
|
6
|
+
"blog-banner-block": ({ color, imageSize, image, paddingTop, paddingBottom, qa, ...content }: import("../models/blocks").BannerProps) => import("react").JSX.Element;
|
|
7
|
+
"blog-cta-block": ({ items, paddingTop, paddingBottom }: import("../models/blocks").CTAProps) => import("react").JSX.Element;
|
|
8
|
+
"blog-colored-text-block": ({ background, paddingTop, paddingBottom, qa, ...content }: import("../models/blocks").ColoredTextProps) => import("react").JSX.Element;
|
|
9
|
+
"blog-author-block": (props: import("../models/blocks").AuthorProps) => import("react").JSX.Element | null;
|
|
10
|
+
"blog-suggest-block": ({ paddingTop, paddingBottom }: import("../models/blocks").SuggestProps) => import("react").JSX.Element | null;
|
|
11
|
+
"blog-meta-block": (props: import("../models/blocks").MetaProps) => import("react").JSX.Element;
|
|
12
|
+
"blog-feed-block": ({ image }: import("../models/blocks").FeedProps) => import("react").JSX.Element;
|
|
13
13
|
};
|
|
14
14
|
headers: {
|
|
15
|
-
"blog-header-block": import("
|
|
15
|
+
"blog-header-block": (props: import("../models/blocks").HeaderProps) => import("react").JSX.Element;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
export default _default;
|
|
@@ -18,4 +18,4 @@ export interface BlogPostPageProps {
|
|
|
18
18
|
isSignedInUser?: boolean;
|
|
19
19
|
onClickSignIn?: React.EventHandler<SyntheticEvent>;
|
|
20
20
|
}
|
|
21
|
-
export declare const BlogPostPage: React.
|
|
21
|
+
export declare const BlogPostPage: ({ metaData, suggestedPosts, likes, content, post, settings, navigation, shareOptions, isSignedInUser, onClickSignIn, }: BlogPostPageProps) => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const Close: React.
|
|
2
|
+
export declare const Close: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const DropdownArrow: React.
|
|
2
|
+
export declare const DropdownArrow: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const Save: React.
|
|
2
|
+
export declare const Save: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const SaveFilled: React.
|
|
2
|
+
export declare const SaveFilled: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const SearchIcon: React.
|
|
2
|
+
export declare const SearchIcon: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const ShareArrowUp: React.
|
|
2
|
+
export declare const ShareArrowUp: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const Time: React.
|
|
2
|
+
export declare const Time: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
@@ -1,17 +1,17 @@
|
|
|
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
|
+
import { BlockType, ClassNameProps, PostData, QAProps } from './common';
|
|
4
4
|
import { PaddingsYFMProps } from './paddings';
|
|
5
5
|
export type AuthorProps = ClassNameProps & {
|
|
6
6
|
authorId: number;
|
|
7
7
|
image: string;
|
|
8
|
-
} & PaddingsYFMProps;
|
|
9
|
-
export type BannerProps = ContentBlockProps & {
|
|
8
|
+
} & PaddingsYFMProps & QAProps;
|
|
9
|
+
export type BannerProps = ContentBlockProps & QAProps & {
|
|
10
10
|
color?: string;
|
|
11
11
|
image?: string;
|
|
12
12
|
imageSize?: 's' | 'm';
|
|
13
13
|
} & PaddingsYFMProps;
|
|
14
|
-
export type ColoredTextProps = ContentBlockProps & {
|
|
14
|
+
export type ColoredTextProps = ContentBlockProps & QAProps & {
|
|
15
15
|
background?: {
|
|
16
16
|
color?: string;
|
|
17
17
|
image?: string;
|
|
@@ -40,7 +40,7 @@ export type SuggestProps = ClassNameProps & {
|
|
|
40
40
|
} & PaddingsYFMProps;
|
|
41
41
|
export type YFMProps = {
|
|
42
42
|
text: string;
|
|
43
|
-
} & PaddingsYFMProps;
|
|
43
|
+
} & PaddingsYFMProps & QAProps;
|
|
44
44
|
export type FeedProps = {
|
|
45
45
|
image: string;
|
|
46
46
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultEventNames = exports.BlockType = exports.Theme = void 0;
|
|
3
|
+
exports.PostCardTitleHeadingLevel = exports.PostCardSize = exports.DefaultEventNames = exports.BlockType = exports.Theme = void 0;
|
|
4
4
|
var Theme;
|
|
5
5
|
(function (Theme) {
|
|
6
6
|
Theme["Light"] = "light";
|
|
@@ -31,4 +31,14 @@ var DefaultEventNames;
|
|
|
31
31
|
DefaultEventNames["Tag"] = "selector-tag-click";
|
|
32
32
|
DefaultEventNames["Service"] = "selector-service-click";
|
|
33
33
|
DefaultEventNames["SaveOnly"] = "save-only-button-click";
|
|
34
|
-
})(DefaultEventNames = exports.DefaultEventNames || (exports.DefaultEventNames = {}));
|
|
34
|
+
})(DefaultEventNames = exports.DefaultEventNames || (exports.DefaultEventNames = {}));
|
|
35
|
+
var PostCardSize;
|
|
36
|
+
(function (PostCardSize) {
|
|
37
|
+
PostCardSize["SMALL"] = "s";
|
|
38
|
+
PostCardSize["MEDIUM"] = "m";
|
|
39
|
+
})(PostCardSize = exports.PostCardSize || (exports.PostCardSize = {}));
|
|
40
|
+
var PostCardTitleHeadingLevel;
|
|
41
|
+
(function (PostCardTitleHeadingLevel) {
|
|
42
|
+
PostCardTitleHeadingLevel["H2"] = "h2";
|
|
43
|
+
PostCardTitleHeadingLevel["H3"] = "h3";
|
|
44
|
+
})(PostCardTitleHeadingLevel = exports.PostCardTitleHeadingLevel || (exports.PostCardTitleHeadingLevel = {}));
|
package/build/cjs/utils/cn.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import blockOrigin from 'bem-cn-lite';
|
|
2
1
|
export declare const NAMESPACE = "bc-";
|
|
3
|
-
export
|
|
4
|
-
export declare
|
|
2
|
+
export declare const cn: import("@bem-react/classname").ClassNameInitilizer;
|
|
3
|
+
export declare const block: import("@bem-react/classname").ClassNameInitilizer;
|
package/build/cjs/utils/cn.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.block = exports.NAMESPACE = void 0;
|
|
4
|
-
const
|
|
5
|
-
const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
|
|
3
|
+
exports.block = exports.cn = exports.NAMESPACE = void 0;
|
|
4
|
+
const classname_1 = require("@bem-react/classname");
|
|
6
5
|
exports.NAMESPACE = 'bc-';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
exports.block = block;
|
|
6
|
+
exports.cn = (0, classname_1.withNaming)({ e: '__', m: '_' });
|
|
7
|
+
exports.block = (0, classname_1.withNaming)({ n: exports.NAMESPACE, e: '__', m: '_' });
|
|
@@ -41,4 +41,5 @@ export declare const isMetrikaExist: (goal: NewMetrikaGoal, existGoals: NewMetri
|
|
|
41
41
|
export declare const getBlogElementMetrika: (blogCustomGoal: NewMetrikaGoal, existingGoals?: MetrikaGoal) => string | string[] | NewMetrikaGoal[];
|
|
42
42
|
export declare const getFeedQueryParams: (queryString: Query, pageNumber?: number) => GetPostsRequest;
|
|
43
43
|
export declare const scrollOnPageChange: (containerId: string) => void;
|
|
44
|
+
export declare const getQaAttributes: (qa?: string, ...customKeys: (string | Array<string>)[]) => Record<string, string>;
|
|
44
45
|
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.scrollOnPageChange = exports.getFeedQueryParams = exports.getBlogElementMetrika = exports.isMetrikaExist = exports.getBreadcrumbs = exports.getBlogPath = exports.updateContentSizes = exports.getTagFilterUrl = exports.postLikeStatus = exports.getTags = exports.scrollToHash = exports.getPageSearchParams = exports.getAbsolutePath = void 0;
|
|
3
|
+
exports.getQaAttributes = exports.scrollOnPageChange = exports.getFeedQueryParams = exports.getBlogElementMetrika = exports.isMetrikaExist = exports.getBreadcrumbs = exports.getBlogPath = exports.updateContentSizes = exports.getTagFilterUrl = exports.postLikeStatus = exports.getTags = exports.scrollToHash = exports.getPageSearchParams = exports.getAbsolutePath = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const url_1 = require("url");
|
|
6
6
|
const page_constructor_1 = require("@gravity-ui/page-constructor");
|
|
7
7
|
const lodash_1 = require("lodash");
|
|
8
8
|
const constants_1 = require("../blocks/constants");
|
|
9
9
|
const i18n_1 = require("../i18n");
|
|
10
|
+
const QA_ATTRIBUTES_KEYS = ['container', 'content', 'wrapper', 'image', 'button'];
|
|
10
11
|
function getAbsolutePath(router, url) {
|
|
11
12
|
if (!router || !router.pathname) {
|
|
12
13
|
return url !== null && url !== void 0 ? url : '';
|
|
@@ -112,4 +113,16 @@ const scrollOnPageChange = (containerId) => {
|
|
|
112
113
|
(0, exports.scrollToHash)(containerId);
|
|
113
114
|
}
|
|
114
115
|
};
|
|
115
|
-
exports.scrollOnPageChange = scrollOnPageChange;
|
|
116
|
+
exports.scrollOnPageChange = scrollOnPageChange;
|
|
117
|
+
const getQaAttributes = (qa, ...customKeys) => {
|
|
118
|
+
const attributes = {};
|
|
119
|
+
if (qa) {
|
|
120
|
+
const keys = QA_ATTRIBUTES_KEYS.concat((0, lodash_1.flatten)(customKeys));
|
|
121
|
+
keys.forEach((key) => {
|
|
122
|
+
attributes[(0, lodash_1.camelCase)(key)] = `${qa}-${key}`;
|
|
123
|
+
});
|
|
124
|
+
attributes.default = qa;
|
|
125
|
+
}
|
|
126
|
+
return attributes;
|
|
127
|
+
};
|
|
128
|
+
exports.getQaAttributes = getQaAttributes;
|
|
@@ -8,7 +8,7 @@ import './Author.css';
|
|
|
8
8
|
const b = block('author');
|
|
9
9
|
export const Author = (props) => {
|
|
10
10
|
var _a;
|
|
11
|
-
const { image, paddingTop, paddingBottom, authorId } = props;
|
|
11
|
+
const { image, paddingTop, paddingBottom, authorId, qa } = props;
|
|
12
12
|
const { post } = useContext(PostPageContext);
|
|
13
13
|
const author = (_a = post === null || post === void 0 ? void 0 : post.authors) === null || _a === void 0 ? void 0 : _a.find(({ id }) => id === authorId);
|
|
14
14
|
const authorItem = useMemo(() => {
|
|
@@ -28,7 +28,7 @@ export const Author = (props) => {
|
|
|
28
28
|
return (React.createElement(Wrapper, { paddings: {
|
|
29
29
|
[PaddingsDirections.top]: paddingTop,
|
|
30
30
|
[PaddingsDirections.bottom]: paddingBottom,
|
|
31
|
-
}, className: b('content') },
|
|
31
|
+
}, className: b('content'), qa: qa },
|
|
32
32
|
React.createElement("div", { className: b('layout'), "data-qa": "blog-author-layout" },
|
|
33
33
|
React.createElement(PCAuthor, { type: AuthorType.Column, author: authorItem, authorContainerClassName: b('container') }))));
|
|
34
34
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BannerProps } from '../../models/blocks';
|
|
3
3
|
import './Banner.css';
|
|
4
|
-
export declare const Banner: React.
|
|
4
|
+
export declare const Banner: ({ color, imageSize, image, paddingTop, paddingBottom, qa, ...content }: BannerProps) => React.JSX.Element;
|
|
@@ -5,13 +5,15 @@ import { Wrapper } from '../../components/Wrapper/Wrapper';
|
|
|
5
5
|
import { BlogMetrikaGoalIds } from '../../constants';
|
|
6
6
|
import { PaddingsDirections } from '../../models/paddings';
|
|
7
7
|
import { block } from '../../utils/cn';
|
|
8
|
-
import { getBlogElementMetrika, updateContentSizes } from '../../utils/common';
|
|
8
|
+
import { getBlogElementMetrika, getQaAttributes, updateContentSizes } from '../../utils/common';
|
|
9
9
|
import './Banner.css';
|
|
10
10
|
const b = block('banner');
|
|
11
|
+
const BANNER_CUSTOM_QA_ATTRIBUTES = ['image-container'];
|
|
11
12
|
export const Banner = (_a) => {
|
|
12
13
|
var _b;
|
|
13
|
-
var { color, imageSize = 's', image, paddingTop, paddingBottom } = _a, content = __rest(_a, ["color", "imageSize", "image", "paddingTop", "paddingBottom"]);
|
|
14
|
+
var { color, imageSize = 's', image, paddingTop, paddingBottom, qa } = _a, content = __rest(_a, ["color", "imageSize", "image", "paddingTop", "paddingBottom", "qa"]);
|
|
14
15
|
const contentStyle = {};
|
|
16
|
+
const qaAttributes = getQaAttributes(qa, BANNER_CUSTOM_QA_ATTRIBUTES);
|
|
15
17
|
if (color) {
|
|
16
18
|
contentStyle.backgroundColor = color;
|
|
17
19
|
}
|
|
@@ -30,10 +32,10 @@ export const Banner = (_a) => {
|
|
|
30
32
|
return (React.createElement(Wrapper, { paddings: {
|
|
31
33
|
[PaddingsDirections.top]: paddingTop,
|
|
32
34
|
[PaddingsDirections.bottom]: paddingBottom,
|
|
33
|
-
}, className: b('container') },
|
|
34
|
-
React.createElement("div", { className: b('content'), style: contentStyle, "data-qa":
|
|
35
|
+
}, qa: qaAttributes.wrapper, className: b('container') },
|
|
36
|
+
React.createElement("div", { className: b('content'), style: contentStyle, "data-qa": qaAttributes.content },
|
|
35
37
|
React.createElement("div", { className: b('info') },
|
|
36
|
-
React.createElement(Content, Object.assign({}, contentData))),
|
|
37
|
-
image && (React.createElement("div", { className: b('image-container', { ['image-size']: imageSize }) },
|
|
38
|
+
React.createElement(Content, Object.assign({}, contentData, { qa: qaAttributes.content }))),
|
|
39
|
+
image && (React.createElement("div", { className: b('image-container', { ['image-size']: imageSize }), "data-qa": qaAttributes.imageContainer },
|
|
38
40
|
React.createElement(Image, { className: b('image'), src: image }))))));
|
|
39
41
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ColoredTextProps } from '../../models/blocks';
|
|
3
3
|
import './ColoredText.css';
|
|
4
|
-
export declare const ColoredText: React.
|
|
4
|
+
export declare const ColoredText: ({ background, paddingTop, paddingBottom, qa, ...content }: ColoredTextProps) => React.JSX.Element;
|
|
@@ -4,18 +4,19 @@ import { BackgroundImage, Content } from '@gravity-ui/page-constructor';
|
|
|
4
4
|
import { Wrapper } from '../../components/Wrapper/Wrapper';
|
|
5
5
|
import { PaddingsDirections } from '../../models/paddings';
|
|
6
6
|
import { block } from '../../utils/cn';
|
|
7
|
-
import { updateContentSizes } from '../../utils/common';
|
|
7
|
+
import { getQaAttributes, updateContentSizes } from '../../utils/common';
|
|
8
8
|
import './ColoredText.css';
|
|
9
9
|
const b = block('colored-text');
|
|
10
10
|
export const ColoredText = (_a) => {
|
|
11
|
-
var { background, paddingTop, paddingBottom } = _a, content = __rest(_a, ["background", "paddingTop", "paddingBottom"]);
|
|
11
|
+
var { background, paddingTop, paddingBottom, qa } = _a, content = __rest(_a, ["background", "paddingTop", "paddingBottom", "qa"]);
|
|
12
12
|
const contentData = updateContentSizes(content);
|
|
13
|
+
const qaAttributes = getQaAttributes(qa);
|
|
13
14
|
return (React.createElement(Wrapper, { paddings: {
|
|
14
15
|
[PaddingsDirections.top]: paddingTop,
|
|
15
16
|
[PaddingsDirections.bottom]: paddingBottom,
|
|
16
|
-
} },
|
|
17
|
-
React.createElement("div", { className: b('container'), style: { backgroundColor: (background === null || background === void 0 ? void 0 : background.color) || 'none' }, "data-qa":
|
|
17
|
+
}, qa: qaAttributes.wrapper },
|
|
18
|
+
React.createElement("div", { className: b('container'), style: { backgroundColor: (background === null || background === void 0 ? void 0 : background.color) || 'none' }, "data-qa": qaAttributes.container },
|
|
18
19
|
React.createElement("div", { className: b('picture-container') }, (background === null || background === void 0 ? void 0 : background.image) && (React.createElement(BackgroundImage, { className: b('picture'), alt: background === null || background === void 0 ? void 0 : background.altText, src: background === null || background === void 0 ? void 0 : background.image }))),
|
|
19
20
|
React.createElement("div", { className: b('text-content') },
|
|
20
|
-
React.createElement(Content, Object.assign({}, contentData))))));
|
|
21
|
+
React.createElement(Content, Object.assign({}, contentData, { qa: qaAttributes.content }))))));
|
|
21
22
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { LayoutProps } from '../../models/blocks';
|
|
3
3
|
import './Layout.css';
|
|
4
|
-
export declare const Layout: React.
|
|
4
|
+
export declare const Layout: ({ fullWidth, mobileOrder, children, paddingTop, paddingBottom, }: PropsWithChildren<LayoutProps>) => React.JSX.Element;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { YFMWrapper } from '@gravity-ui/page-constructor';
|
|
3
|
-
import block from 'bem-cn-lite';
|
|
4
3
|
import { Wrapper } from '../../components/Wrapper/Wrapper';
|
|
5
4
|
import { PaddingsDirections } from '../../models/paddings';
|
|
6
|
-
|
|
5
|
+
import { cn } from '../../utils/cn';
|
|
6
|
+
import { getQaAttributes } from '../../utils/common';
|
|
7
|
+
const b = cn('yfm');
|
|
7
8
|
export const YFM = (props) => {
|
|
8
|
-
const { text, paddingTop, paddingBottom } = props;
|
|
9
|
+
const { text, paddingTop, paddingBottom, qa } = props;
|
|
10
|
+
const qaAttributes = getQaAttributes(qa);
|
|
9
11
|
return (React.createElement(Wrapper, { paddings: {
|
|
10
12
|
[PaddingsDirections.top]: paddingTop,
|
|
11
13
|
[PaddingsDirections.bottom]: paddingBottom,
|
|
12
|
-
} },
|
|
14
|
+
}, qa: qaAttributes.wrapper },
|
|
13
15
|
React.createElement(YFMWrapper, { content: text, modifiers: {
|
|
14
16
|
blog: true,
|
|
15
17
|
resetPaddings: true,
|
|
@@ -5,5 +5,5 @@ import './FeedHeader.css';
|
|
|
5
5
|
type HeaderProps = Pick<HeaderBlockProps, 'background' | 'offset' | 'theme' | 'verticalOffset'>;
|
|
6
6
|
type FeedHeaderProps = HeaderProps & ControlsProps;
|
|
7
7
|
type FeedHeaderContainerProps = FeedHeaderProps & ClassNameProps;
|
|
8
|
-
export declare const FeedHeader: React.
|
|
8
|
+
export declare const FeedHeader: ({ tags, services, handleLoadData, offset, background, theme, verticalOffset, className, queryParams, }: FeedHeaderContainerProps) => React.JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -23,9 +23,6 @@ unpredictable css rules order in build */
|
|
|
23
23
|
width: 100%;
|
|
24
24
|
max-width: 100%;
|
|
25
25
|
}
|
|
26
|
-
.bc-feed-controls__search .yc-text-input_view_normal .yc-text-input__control {
|
|
27
|
-
border-color: var(--g-color-base-background);
|
|
28
|
-
}
|
|
29
26
|
.bc-feed-controls__select {
|
|
30
27
|
width: 100%;
|
|
31
28
|
}
|
|
@@ -33,9 +30,6 @@ unpredictable css rules order in build */
|
|
|
33
30
|
max-height: 500px;
|
|
34
31
|
border-radius: 12px;
|
|
35
32
|
}
|
|
36
|
-
.bc-feed-controls__popup.bc-feed-controls__popup .g-select-filter + .g-select-list {
|
|
37
|
-
margin-top: 0;
|
|
38
|
-
}
|
|
39
33
|
.bc-feed-controls__popup.bc-feed-controls__popup .g-select-list {
|
|
40
34
|
overflow: scroll;
|
|
41
35
|
}
|
|
@@ -49,27 +43,15 @@ unpredictable css rules order in build */
|
|
|
49
43
|
margin: 4px;
|
|
50
44
|
border-radius: 8px;
|
|
51
45
|
}
|
|
52
|
-
.bc-feed-controls__popup.bc-feed-controls__popup .yc-text-input__content {
|
|
53
|
-
padding: 4px;
|
|
54
|
-
border: none;
|
|
55
|
-
border-bottom: 1px solid var(--yc-color-line-generic);
|
|
56
|
-
border-bottom-right-radius: 0;
|
|
57
|
-
border-bottom-left-radius: 0;
|
|
58
|
-
}
|
|
59
|
-
.bc-feed-controls__popup.bc-feed-controls__popup .yc-text-input__content .yc-text-input__control.yc-text-input__control_type_input {
|
|
60
|
-
border: none;
|
|
61
|
-
}
|
|
62
|
-
.bc-feed-controls__popup.bc-feed-controls__popup .g-select-list_size_xl .g-select-list__option {
|
|
63
|
-
padding: 0 16px;
|
|
64
|
-
}
|
|
65
46
|
|
|
66
|
-
.bc-feed-controls__popup-filter
|
|
47
|
+
.bc-feed-controls__popup-filter {
|
|
67
48
|
font-size: var(--g-text-body-2-font-size);
|
|
68
49
|
line-height: var(--g-text-body-2-line-height);
|
|
50
|
+
padding: 4px 12px;
|
|
69
51
|
border: none;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
border:
|
|
52
|
+
border-bottom: 1px solid var(--yc-color-line-generic);
|
|
53
|
+
border-bottom-right-radius: 0;
|
|
54
|
+
border-bottom-left-radius: 0;
|
|
73
55
|
}
|
|
74
56
|
.bc-feed-controls__select:hover {
|
|
75
57
|
width: 100%;
|
|
@@ -101,7 +101,7 @@ export const Controls = ({ handleLoadData, tags = [], services = [], queryParams
|
|
|
101
101
|
defaultLabel: i18(Keyset.AllTags),
|
|
102
102
|
}), disablePortal: true, virtualizationThreshold: VIRTUALIZATION_THRESHOLD, renderOption: renderOption })),
|
|
103
103
|
services.length > 0 ? (React.createElement("div", { className: b('filter-item') },
|
|
104
|
-
React.createElement(Select, { className: b('select'), size: "xl", multiple: true, filterable: true, disablePortal: true, options: services, defaultValue: servicesItems, popupClassName: b('popup'), onUpdate: handleServicesSelect, placeholder: i18(Keyset.AllServices), renderControl: renderSwitcher({
|
|
104
|
+
React.createElement(Select, { className: b('select'), size: "xl", multiple: true, filterable: true, hasClear: true, disablePortal: true, options: services, defaultValue: servicesItems, popupClassName: b('popup'), onUpdate: handleServicesSelect, placeholder: i18(Keyset.AllServices), renderControl: renderSwitcher({
|
|
105
105
|
initial: servicesItems,
|
|
106
106
|
list: services,
|
|
107
107
|
defaultLabel: i18(Keyset.AllServices),
|
|
@@ -9,6 +9,5 @@ const b = block('feed-controls');
|
|
|
9
9
|
export const renderSwitcher = ({ initial, list, defaultLabel }) =>
|
|
10
10
|
// eslint-disable-next-line react/display-name
|
|
11
11
|
({ onClick, ref }) => (React.createElement(CustomSwitcher, { initial: initial, defaultLabel: defaultLabel, list: list, controlRef: ref, onClick: onClick }));
|
|
12
|
-
export const renderFilter = ({ value, ref, onChange, onKeyDown }) => (React.createElement("
|
|
13
|
-
React.createElement(TextInput, { controlRef: ref, controlProps: { size: 1 }, value: value, placeholder: i18(Keyset.Search), onUpdate: onChange, onKeyDown: onKeyDown })));
|
|
12
|
+
export const renderFilter = ({ value, ref, onChange, onKeyDown }) => (React.createElement(TextInput, { controlRef: ref, controlProps: { size: 1 }, value: value, view: "clear", placeholder: i18(Keyset.Search), onUpdate: onChange, onKeyDown: onKeyDown, className: b('popup-filter') }));
|
|
14
13
|
export const renderOption = (option) => (React.createElement(CustomSelectOption, { data: option }));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { ClassNameProps } from '../../models/common';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { NoStrictEntityMods } from '@bem-react/classname';
|
|
3
|
+
import type { ClassNameProps } from '../../models/common';
|
|
4
4
|
export interface PaginatorItemProps {
|
|
5
5
|
key: string | ArrowType;
|
|
6
6
|
dataKey: string | ArrowType;
|
|
7
|
-
mods:
|
|
7
|
+
mods: NoStrictEntityMods;
|
|
8
8
|
content: ReactNode;
|
|
9
9
|
onClick?: (key: number | ArrowType) => void;
|
|
10
10
|
loading?: boolean;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MetrikaGoal } from '@gravity-ui/page-constructor';
|
|
3
|
-
import { PostData } from '../../models/common';
|
|
3
|
+
import { PostCardSize, PostCardTitleHeadingLevel, PostData } from '../../models/common';
|
|
4
4
|
import './PostCard.css';
|
|
5
5
|
type PostCardProps = {
|
|
6
6
|
post: PostData;
|
|
7
7
|
fullWidth?: boolean;
|
|
8
8
|
showTag?: boolean;
|
|
9
|
-
size?:
|
|
9
|
+
size?: PostCardSize;
|
|
10
|
+
titleHeadingLevel?: PostCardTitleHeadingLevel;
|
|
10
11
|
/**
|
|
11
12
|
* @deprecated Metrika will be deleted after launch of analyticsEvents
|
|
12
13
|
*/
|
|
13
14
|
metrikaGoals?: MetrikaGoal;
|
|
14
15
|
};
|
|
15
|
-
export declare const PostCard: React.
|
|
16
|
+
export declare const PostCard: ({ post, metrikaGoals, fullWidth, size, showTag, titleHeadingLevel, }: PostCardProps) => React.JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useContext, useMemo } from 'react';
|
|
2
2
|
import { CardBase, HTML, YFMWrapper } from '@gravity-ui/page-constructor';
|
|
3
3
|
import { LikesContext } from '../../contexts/LikesContext';
|
|
4
|
+
import { PostCardSize, PostCardTitleHeadingLevel } from '../../models/common';
|
|
4
5
|
import { block } from '../../utils/cn';
|
|
5
6
|
import { SuggestPostInfo } from '../PostInfo/SuggestPostInfo';
|
|
6
7
|
import './PostCard.css';
|
|
7
8
|
const b = block('post-card');
|
|
8
|
-
export const PostCard = ({ post, metrikaGoals, fullWidth = false, size =
|
|
9
|
+
export const PostCard = ({ post, metrikaGoals, fullWidth = false, size = PostCardSize.SMALL, showTag = false, titleHeadingLevel = PostCardTitleHeadingLevel.H3, }) => {
|
|
9
10
|
var _a;
|
|
10
11
|
const { title: postTitle, htmlTitle, textTitle, blogPostId, id, date, readingTime, hasUserLike, likes, image, description, tags, url, } = post;
|
|
11
12
|
const title = postTitle || textTitle || htmlTitle;
|
|
@@ -22,9 +23,9 @@ export const PostCard = ({ post, metrikaGoals, fullWidth = false, size = 's', sh
|
|
|
22
23
|
React.createElement("div", { className: b('image-container'), "data-qa": "blog-suggest-header" })),
|
|
23
24
|
React.createElement(CardBase.Content, null,
|
|
24
25
|
showTag && ((_a = tags === null || tags === void 0 ? void 0 : tags[0]) === null || _a === void 0 ? void 0 : _a.name) && (React.createElement("div", { className: b('tag', { size }) }, tags[0].name)),
|
|
25
|
-
title &&
|
|
26
|
-
React.createElement("span", null,
|
|
27
|
-
React.createElement(HTML, null, title)))
|
|
26
|
+
title &&
|
|
27
|
+
React.createElement(titleHeadingLevel, { className: b('title', { size }) }, React.createElement("span", null,
|
|
28
|
+
React.createElement(HTML, null, title))),
|
|
28
29
|
description && (React.createElement(YFMWrapper, { className: b('description'), content: description, modifiers: {
|
|
29
30
|
blog: size === 'm',
|
|
30
31
|
blogCard: true,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PostData, QAProps, ToggleLikeCallbackType } from '../../models/common';
|
|
2
|
+
import { PostCardSize, PostData, QAProps, ToggleLikeCallbackType } from '../../models/common';
|
|
3
3
|
import './PostInfo.css';
|
|
4
4
|
export interface SuggestPostInfoProps extends Pick<PostData, 'date' | 'readingTime' | 'hasUserLike'>, QAProps {
|
|
5
5
|
postId: PostData['blogPostId'];
|
|
6
|
-
size?:
|
|
6
|
+
size?: PostCardSize;
|
|
7
7
|
likes?: {
|
|
8
8
|
likesCount?: number;
|
|
9
9
|
hasUserLike?: boolean;
|
|
@@ -24,4 +24,4 @@ export interface SuggestPostInfoProps extends Pick<PostData, 'date' | 'readingTi
|
|
|
24
24
|
*
|
|
25
25
|
* @returns jsx
|
|
26
26
|
*/
|
|
27
|
-
export declare const SuggestPostInfo: React.
|
|
27
|
+
export declare const SuggestPostInfo: ({ postId, date, readingTime, likes, size, qa, }: SuggestPostInfoProps) => React.JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useLikes } from '../../hooks/useLikes';
|
|
3
|
+
import { PostCardSize } from '../../models/common';
|
|
3
4
|
import { block } from '../../utils/cn';
|
|
4
5
|
import { Date } from './components/Date';
|
|
5
6
|
import { ReadingTime } from './components/ReadingTime';
|
|
@@ -20,7 +21,7 @@ const b = block('post-info');
|
|
|
20
21
|
*
|
|
21
22
|
* @returns jsx
|
|
22
23
|
*/
|
|
23
|
-
export const SuggestPostInfo = ({ postId, date, readingTime, likes, size =
|
|
24
|
+
export const SuggestPostInfo = ({ postId, date, readingTime, likes, size = PostCardSize.SMALL, qa, }) => {
|
|
24
25
|
const { hasUserLike, likesCount, handleLike } = useLikes({
|
|
25
26
|
hasLike: likes === null || likes === void 0 ? void 0 : likes.hasUserLike,
|
|
26
27
|
count: likes === null || likes === void 0 ? void 0 : likes.likesCount,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PostCardSize } from '../../../models/common';
|
|
2
3
|
import '../PostInfo.css';
|
|
3
4
|
type DateProps = {
|
|
4
5
|
date: string | number;
|
|
5
|
-
size?:
|
|
6
|
+
size?: PostCardSize;
|
|
6
7
|
};
|
|
7
|
-
export declare const Date: React.
|
|
8
|
+
export declare const Date: ({ date, size }: DateProps) => React.JSX.Element;
|
|
8
9
|
export {};
|