@gravity-ui/blog-constructor 5.16.1 → 6.0.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/README.md +5 -5
- package/build/cjs/blocks/Banner/Banner.js +7 -9
- package/build/cjs/blocks/CTA/CTA.js +7 -9
- package/build/cjs/blocks/Feed/Feed.js +5 -12
- package/build/cjs/blocks/Header/Header.js +10 -14
- package/build/cjs/blocks/Media/Media.js +1 -0
- package/build/cjs/blocks/Meta/Meta.js +11 -15
- package/build/cjs/blocks/Suggest/Suggest.js +8 -11
- package/build/cjs/components/FeedHeader/components/Controls/Controls.css +19 -5
- package/build/cjs/components/FeedHeader/components/Controls/Controls.js +22 -27
- package/build/cjs/components/FeedHeader/components/Controls/customRenders.js +1 -1
- package/build/cjs/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.css +1 -1
- package/build/cjs/components/Paginator/Paginator.js +16 -19
- package/build/cjs/components/Paginator/components/NavigationButton.js +1 -1
- package/build/cjs/components/PostCard/PostCard.d.ts +3 -6
- package/build/cjs/components/PostCard/PostCard.js +2 -2
- package/build/cjs/components/PostInfo/PostInfo.d.ts +4 -10
- package/build/cjs/components/PostInfo/PostInfo.js +4 -4
- package/build/cjs/components/PostInfo/SuggestPostInfo.js +4 -1
- package/build/cjs/components/PostInfo/components/ReadingTime.js +1 -1
- package/build/cjs/components/PostInfo/components/Save.d.ts +4 -6
- package/build/cjs/components/PostInfo/components/Save.js +3 -6
- package/build/cjs/components/PostInfo/components/Sharing.d.ts +3 -5
- package/build/cjs/components/PostInfo/components/Sharing.js +4 -10
- package/build/cjs/components/Posts/Posts.js +3 -3
- package/build/cjs/components/PostsEmpty/PostsEmpty.js +2 -2
- package/build/cjs/components/PostsError/PostsError.js +3 -3
- package/build/cjs/components/PromptSignIn/PromptSignIn.js +2 -2
- package/build/cjs/components/Search/Search.js +1 -1
- package/build/cjs/constants.d.ts +2 -1
- package/build/cjs/constants.js +20 -19
- package/build/cjs/constructor/BlogConstructorProvider.js +1 -0
- package/build/cjs/containers/BlogPostPage/BlogPostPage.css +1 -1
- package/build/cjs/contexts/LocaleContext.js +2 -2
- package/build/cjs/counters/metrika.js +0 -3
- package/build/cjs/counters/utils.d.ts +1 -1
- package/build/cjs/counters/utils.js +7 -7
- package/build/cjs/i18n/index.d.ts +1 -3
- package/build/cjs/i18n/index.js +8 -10
- package/build/cjs/index.d.ts +0 -1
- package/build/cjs/index.js +1 -3
- package/build/cjs/models/common.d.ts +1 -1
- package/build/cjs/models/locale.d.ts +1 -4
- package/build/cjs/models/locale.js +1 -6
- package/build/cjs/utils/common.d.ts +15 -3
- package/build/cjs/utils/common.js +20 -19
- package/build/esm/blocks/Banner/Banner.js +8 -10
- package/build/esm/blocks/CTA/CTA.js +8 -10
- package/build/esm/blocks/Feed/Feed.js +8 -15
- package/build/esm/blocks/Header/Header.js +12 -16
- package/build/esm/blocks/Media/Media.js +1 -0
- package/build/esm/blocks/Meta/Meta.js +13 -17
- package/build/esm/blocks/Suggest/Suggest.js +9 -12
- package/build/esm/components/FeedHeader/components/Controls/Controls.css +19 -5
- package/build/esm/components/FeedHeader/components/Controls/Controls.js +25 -30
- package/build/esm/components/FeedHeader/components/Controls/customRenders.js +2 -2
- package/build/esm/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.css +1 -1
- package/build/esm/components/Paginator/Paginator.js +18 -21
- package/build/esm/components/Paginator/components/NavigationButton.js +2 -2
- package/build/esm/components/PostCard/PostCard.d.ts +3 -6
- package/build/esm/components/PostCard/PostCard.js +2 -2
- package/build/esm/components/PostInfo/PostInfo.d.ts +4 -10
- package/build/esm/components/PostInfo/PostInfo.js +4 -4
- package/build/esm/components/PostInfo/SuggestPostInfo.js +4 -1
- package/build/esm/components/PostInfo/components/ReadingTime.js +2 -2
- package/build/esm/components/PostInfo/components/Save.d.ts +4 -6
- package/build/esm/components/PostInfo/components/Save.js +3 -6
- package/build/esm/components/PostInfo/components/Sharing.d.ts +3 -5
- package/build/esm/components/PostInfo/components/Sharing.js +5 -11
- package/build/esm/components/Posts/Posts.js +4 -4
- package/build/esm/components/PostsEmpty/PostsEmpty.js +3 -3
- package/build/esm/components/PostsError/PostsError.js +4 -4
- package/build/esm/components/PromptSignIn/PromptSignIn.js +3 -3
- package/build/esm/components/Search/Search.js +2 -2
- package/build/esm/constants.d.ts +2 -1
- package/build/esm/constants.js +19 -18
- package/build/esm/constructor/BlogConstructorProvider.js +2 -1
- package/build/esm/containers/BlogPostPage/BlogPostPage.css +1 -1
- package/build/esm/contexts/LocaleContext.js +1 -1
- package/build/esm/counters/metrika.js +0 -3
- package/build/esm/counters/utils.d.ts +1 -1
- package/build/esm/counters/utils.js +6 -6
- package/build/esm/i18n/index.d.ts +1 -3
- package/build/esm/i18n/index.js +7 -9
- package/build/esm/index.d.ts +0 -1
- package/build/esm/index.js +0 -1
- package/build/esm/models/common.d.ts +1 -1
- package/build/esm/models/locale.d.ts +1 -4
- package/build/esm/models/locale.js +0 -5
- package/build/esm/utils/common.d.ts +15 -3
- package/build/esm/utils/common.js +18 -17
- package/package.json +15 -14
- package/server/data/contentFilter.d.ts +1 -1
- package/server/data/contentFilter.js +2 -1
- package/server/data/transformPageContent.d.ts +2 -2
- package/server/data/transformPost.d.ts +7 -2
- package/server/data/transformPost.js +1 -1
- package/server/index.d.ts +1 -1
- package/server/models/common.d.ts +1 -1
- package/server/models/locale.d.ts +1 -4
- package/server/models/locale.js +1 -6
- package/styles/storybook/common.scss +8 -0
- package/styles/storybook/index.scss +1 -1
- package/styles/styles.css +115 -0
- package/styles/styles.scss +1 -0
- package/build/cjs/configure.d.ts +0 -5
- package/build/cjs/configure.js +0 -8
- package/build/esm/configure.d.ts +0 -5
- package/build/esm/configure.js +0 -4
|
@@ -9,7 +9,10 @@ const cn_1 = require("../../utils/cn");
|
|
|
9
9
|
const Date_1 = require("./components/Date");
|
|
10
10
|
const ReadingTime_1 = require("./components/ReadingTime");
|
|
11
11
|
const Save_1 = require("./components/Save");
|
|
12
|
+
const common_2 = require("../../utils/common");
|
|
13
|
+
const constants_1 = require("../../constants");
|
|
12
14
|
const b = (0, cn_1.block)('post-info');
|
|
15
|
+
const saveEvents = (0, common_2.prepareAnalyticsEvent)({ name: constants_1.DefaultGoalIds.saveSuggest });
|
|
13
16
|
/**
|
|
14
17
|
* Suggest blog card info component
|
|
15
18
|
*
|
|
@@ -37,6 +40,6 @@ const SuggestPostInfo = ({ postId, date, readingTime, likes, size = common_1.Pos
|
|
|
37
40
|
react_1.default.createElement("div", { className: b('suggest-container') },
|
|
38
41
|
date && react_1.default.createElement(Date_1.Date, { date: date, size: size, id: dateId }),
|
|
39
42
|
readingTime && (react_1.default.createElement(ReadingTime_1.ReadingTime, { readingTime: readingTime, size: size, id: readingTimeId }))),
|
|
40
|
-
likes && postId && (react_1.default.createElement(Save_1.Save, { postId: postId, title: likesCount, hasUserLike: hasUserLike, handleUserLike: handleLike, size: size, qa: qa }))));
|
|
43
|
+
likes && postId && (react_1.default.createElement(Save_1.Save, { postId: postId, title: likesCount, analyticsEvents: saveEvents, hasUserLike: hasUserLike, handleUserLike: handleLike, size: size, qa: qa }))));
|
|
41
44
|
};
|
|
42
45
|
exports.SuggestPostInfo = SuggestPostInfo;
|
|
@@ -12,5 +12,5 @@ const ICON_SIZE = 16;
|
|
|
12
12
|
const ReadingTime = ({ readingTime, size = 's', id, qa }) => (react_1.default.createElement("div", { className: b('item', { size }), id: id, "data-qa": qa },
|
|
13
13
|
react_1.default.createElement("span", { className: b('icon') },
|
|
14
14
|
react_1.default.createElement(uikit_1.Icon, { data: Time_1.Time, size: ICON_SIZE, className: b('icon-color') })),
|
|
15
|
-
(0, i18n_1.
|
|
15
|
+
(0, i18n_1.i18n)(i18n_1.Keyset.ContextReadingTime, { count: readingTime })));
|
|
16
16
|
exports.ReadingTime = ReadingTime;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { AnalyticsEventsProp } from '@gravity-ui/page-constructor';
|
|
2
3
|
import { QAProps } from '../../../models/common';
|
|
3
4
|
type SaveProps = QAProps & {
|
|
4
5
|
title: string | number;
|
|
@@ -6,11 +7,8 @@ type SaveProps = QAProps & {
|
|
|
6
7
|
hasUserLike: boolean;
|
|
7
8
|
handleUserLike: () => void;
|
|
8
9
|
theme?: 'light' | 'dark';
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Metrika will be deleted after launch of analyticsEvents
|
|
11
|
-
*/
|
|
12
|
-
metrikaGoal?: string;
|
|
13
10
|
size?: 's' | 'm';
|
|
11
|
+
analyticsEvents?: AnalyticsEventsProp;
|
|
14
12
|
};
|
|
15
13
|
/**
|
|
16
14
|
* Components for 'save' blog UI-component
|
|
@@ -18,11 +16,11 @@ type SaveProps = QAProps & {
|
|
|
18
16
|
* @param title - post title
|
|
19
17
|
* @param postId - post id
|
|
20
18
|
* @param hasUserLike - flag what blog has like from current user
|
|
21
|
-
* @param metrikaGoal - metrika goal name
|
|
22
19
|
* @param qa - test-attr
|
|
23
20
|
* @param size - text size
|
|
21
|
+
* @param analyticsEvents - a single or collection of objects detailing analytics events
|
|
24
22
|
*
|
|
25
23
|
* @returns jsx
|
|
26
24
|
*/
|
|
27
|
-
export declare const Save: ({ title, postId, hasUserLike, handleUserLike,
|
|
25
|
+
export declare const Save: ({ title, postId, hasUserLike, handleUserLike, size, theme, qa, analyticsEvents, }: SaveProps) => React.JSX.Element;
|
|
28
26
|
export {};
|
|
@@ -6,8 +6,6 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const page_constructor_1 = require("@gravity-ui/page-constructor");
|
|
7
7
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
8
8
|
const LikesContext_1 = require("../../../contexts/LikesContext");
|
|
9
|
-
const metrika_1 = tslib_1.__importDefault(require("../../../counters/metrika"));
|
|
10
|
-
const utils_1 = require("../../../counters/utils");
|
|
11
9
|
const Save_1 = require("../../../icons/Save");
|
|
12
10
|
const SaveFilled_1 = require("../../../icons/SaveFilled");
|
|
13
11
|
const common_1 = require("../../../models/common");
|
|
@@ -21,13 +19,13 @@ const b = (0, cn_1.block)('post-info');
|
|
|
21
19
|
* @param title - post title
|
|
22
20
|
* @param postId - post id
|
|
23
21
|
* @param hasUserLike - flag what blog has like from current user
|
|
24
|
-
* @param metrikaGoal - metrika goal name
|
|
25
22
|
* @param qa - test-attr
|
|
26
23
|
* @param size - text size
|
|
24
|
+
* @param analyticsEvents - a single or collection of objects detailing analytics events
|
|
27
25
|
*
|
|
28
26
|
* @returns jsx
|
|
29
27
|
*/
|
|
30
|
-
const Save = ({ title, postId, hasUserLike, handleUserLike,
|
|
28
|
+
const Save = ({ title, postId, hasUserLike, handleUserLike, size, theme, qa, analyticsEvents, }) => {
|
|
31
29
|
const { toggleLike, isSignedInUser, requireSignIn } = (0, react_1.useContext)(LikesContext_1.LikesContext);
|
|
32
30
|
const handleAnalytics = (0, page_constructor_1.useAnalytics)(common_1.DefaultEventNames.SaveButton);
|
|
33
31
|
const isLikeable = Boolean(toggleLike);
|
|
@@ -46,8 +44,7 @@ const Save = ({ title, postId, hasUserLike, handleUserLike, metrikaGoal, size, t
|
|
|
46
44
|
}
|
|
47
45
|
(0, common_2.postLikeStatus)(postId, Boolean(hasUserLike));
|
|
48
46
|
handleUserLike();
|
|
49
|
-
|
|
50
|
-
handleAnalytics();
|
|
47
|
+
handleAnalytics(analyticsEvents);
|
|
51
48
|
}, "data-qa": qa },
|
|
52
49
|
react_1.default.createElement("div", { className: b('content', { cursor: isLikeable, theme }) },
|
|
53
50
|
react_1.default.createElement("span", { className: b('icon') },
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { AnalyticsEventsProp } from '@gravity-ui/page-constructor';
|
|
2
3
|
type SharingProps = {
|
|
3
4
|
theme?: 'light' | 'dark';
|
|
4
|
-
|
|
5
|
-
* @deprecated Metrika will be deleted after launch of analyticsEvents
|
|
6
|
-
*/
|
|
7
|
-
metrikaGoal?: string;
|
|
5
|
+
analyticsEvents?: AnalyticsEventsProp;
|
|
8
6
|
};
|
|
9
|
-
export declare const Sharing: ({ theme,
|
|
7
|
+
export declare const Sharing: ({ theme, analyticsEvents }: SharingProps) => React.JSX.Element;
|
|
10
8
|
export {};
|
|
@@ -8,28 +8,22 @@ const page_constructor_1 = require("@gravity-ui/page-constructor");
|
|
|
8
8
|
const MobileContext_1 = require("../../../contexts/MobileContext");
|
|
9
9
|
const PostPageContext_1 = require("../../../contexts/PostPageContext");
|
|
10
10
|
const RouterContext_1 = require("../../../contexts/RouterContext");
|
|
11
|
-
const metrika_1 = tslib_1.__importDefault(require("../../../counters/metrika"));
|
|
12
|
-
const utils_1 = require("../../../counters/utils");
|
|
13
11
|
const i18n_1 = require("../../../i18n");
|
|
14
12
|
const ShareArrowUp_1 = require("../../../icons/ShareArrowUp");
|
|
15
13
|
const common_1 = require("../../../models/common");
|
|
16
14
|
const cn_1 = require("../../../utils/cn");
|
|
17
15
|
const common_2 = require("../../../utils/common");
|
|
18
16
|
const b = (0, cn_1.block)('post-info');
|
|
19
|
-
const Sharing = ({ theme,
|
|
17
|
+
const Sharing = ({ theme, analyticsEvents }) => {
|
|
20
18
|
const router = (0, react_1.useContext)(RouterContext_1.RouterContext);
|
|
21
19
|
const isMobile = (0, react_1.useContext)(MobileContext_1.MobileContext);
|
|
22
20
|
const { shareOptions } = (0, react_1.useContext)(PostPageContext_1.PostPageContext);
|
|
23
21
|
const handleAnalyticsGlobal = (0, page_constructor_1.useAnalytics)(common_1.DefaultEventNames.ShareButton);
|
|
24
|
-
const handleMetrika = (0, react_1.useCallback)(() => {
|
|
25
|
-
metrika_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, metrikaGoal);
|
|
26
|
-
}, [metrikaGoal]);
|
|
27
22
|
const handleAnalytics = (0, react_1.useCallback)(() => {
|
|
28
|
-
handleAnalyticsGlobal();
|
|
29
|
-
|
|
30
|
-
}, [handleAnalyticsGlobal, handleMetrika]);
|
|
23
|
+
handleAnalyticsGlobal(analyticsEvents);
|
|
24
|
+
}, [analyticsEvents, handleAnalyticsGlobal]);
|
|
31
25
|
return (react_1.default.createElement("div", { className: b('item') },
|
|
32
26
|
react_1.default.createElement("div", { className: b('icon') },
|
|
33
|
-
react_1.default.createElement(components_1.SharePopover, { url: (0, common_2.getAbsolutePath)(router), className: b('share'), iconClass: b('share-icon'), switcherClassName: b('switcher', { theme }), tooltipClassName: b('popup'), useWebShareApi: isMobile, direction: components_1.ShareLayoutDirection.Column, buttonTitle: (0, i18n_1.
|
|
27
|
+
react_1.default.createElement(components_1.SharePopover, { url: (0, common_2.getAbsolutePath)(router), className: b('share'), iconClass: b('share-icon'), switcherClassName: b('switcher', { theme }), tooltipClassName: b('popup'), useWebShareApi: isMobile, direction: components_1.ShareLayoutDirection.Column, buttonTitle: (0, i18n_1.i18n)(i18n_1.Keyset.ActionShare), customIcon: ShareArrowUp_1.ShareArrowUp, placement: "bottom", openByHover: false, shareOptions: shareOptions, onClick: handleAnalytics }))));
|
|
34
28
|
};
|
|
35
29
|
exports.Sharing = Sharing;
|
|
@@ -25,10 +25,10 @@ const Posts = ({ containerId, pinnedPostOnPage, currentPage, postsOnPage, isShow
|
|
|
25
25
|
? common_1.PostCardTitleHeadingLevel.H3
|
|
26
26
|
: common_1.PostCardTitleHeadingLevel.H2 }))))) : (react_1.default.createElement(PostsEmpty_1.PostsEmpty, null))),
|
|
27
27
|
react_1.default.createElement("div", { className: b('pagination') },
|
|
28
|
-
Boolean(isShowMoreVisible && (postsOnPage === null || postsOnPage === void 0 ? void 0 : postsOnPage.length)) && (react_1.default.createElement(uikit_1.Button, { view: "outlined", size: "xl", className: b('more-button'), onClick: handleShowMore }, (0, i18n_1.
|
|
28
|
+
Boolean(isShowMoreVisible && (postsOnPage === null || postsOnPage === void 0 ? void 0 : postsOnPage.length)) && (react_1.default.createElement(uikit_1.Button, { view: "outlined", size: "xl", className: b('more-button'), onClick: handleShowMore }, (0, i18n_1.i18n)(i18n_1.Keyset.ActionLoadMore))),
|
|
29
29
|
errorShowMore && (react_1.default.createElement("div", { className: b('error-show-more') },
|
|
30
|
-
react_1.default.createElement("div", null, (0, i18n_1.
|
|
31
|
-
react_1.default.createElement("div", null, (0, i18n_1.
|
|
30
|
+
react_1.default.createElement("div", null, (0, i18n_1.i18n)(i18n_1.Keyset.ErrorTitle)),
|
|
31
|
+
react_1.default.createElement("div", null, (0, i18n_1.i18n)(i18n_1.Keyset.PostLoadError)))),
|
|
32
32
|
Boolean(currentPage && postCountOnPage) && (react_1.default.createElement("div", { className: b('paginator') },
|
|
33
33
|
react_1.default.createElement(Paginator_1.Paginator, { onPageChange: handlePageChange, page: currentPage, totalItems: postCountOnPage, itemsPerPage: perPageInQuery, maxPages: Infinity, pageCountForShowSupportButtons: pageCountForShowSupportButtons, queryParams: queryParams }))))));
|
|
34
34
|
exports.Posts = Posts;
|
|
@@ -7,6 +7,6 @@ const i18n_1 = require("../../i18n");
|
|
|
7
7
|
const cn_1 = require("../../utils/cn");
|
|
8
8
|
const b = (0, cn_1.block)('posts-empty');
|
|
9
9
|
const PostsEmpty = () => (react_1.default.createElement("div", { className: b('container') },
|
|
10
|
-
react_1.default.createElement("div", { className: b('title') }, (0, i18n_1.
|
|
11
|
-
react_1.default.createElement("div", { className: b('subtitle') }, (0, i18n_1.
|
|
10
|
+
react_1.default.createElement("div", { className: b('title') }, (0, i18n_1.i18n)(i18n_1.Keyset.TitleEmptyContainer)),
|
|
11
|
+
react_1.default.createElement("div", { className: b('subtitle') }, (0, i18n_1.i18n)(i18n_1.Keyset.ContextEmptyContainer))));
|
|
12
12
|
exports.PostsEmpty = PostsEmpty;
|
|
@@ -10,9 +10,9 @@ const b = (0, cn_1.block)('posts-error');
|
|
|
10
10
|
const PostsError = ({ onButtonClick }) => {
|
|
11
11
|
const handleClick = () => (onButtonClick ? onButtonClick() : window.location.reload());
|
|
12
12
|
return (react_1.default.createElement("div", { className: b('container') },
|
|
13
|
-
react_1.default.createElement("div", { className: b('title') }, (0, i18n_1.
|
|
14
|
-
react_1.default.createElement("div", { className: b('subtitle') }, (0, i18n_1.
|
|
13
|
+
react_1.default.createElement("div", { className: b('title') }, (0, i18n_1.i18n)(i18n_1.Keyset.ErrorTitle)),
|
|
14
|
+
react_1.default.createElement("div", { className: b('subtitle') }, (0, i18n_1.i18n)(i18n_1.Keyset.PostLoadError)),
|
|
15
15
|
react_1.default.createElement("div", { className: b('button') },
|
|
16
|
-
react_1.default.createElement(uikit_1.Button, { size: "xl", view: "outlined", onClick: handleClick }, (0, i18n_1.
|
|
16
|
+
react_1.default.createElement(uikit_1.Button, { size: "xl", view: "outlined", onClick: handleClick }, (0, i18n_1.i18n)(i18n_1.Keyset.ActionTryAgain)))));
|
|
17
17
|
};
|
|
18
18
|
exports.PostsError = PostsError;
|
|
@@ -10,9 +10,9 @@ const Prompt_1 = require("../Prompt/Prompt");
|
|
|
10
10
|
* @returns {JSX|null}
|
|
11
11
|
*/
|
|
12
12
|
const PromptSignIn = (_a) => {
|
|
13
|
-
var { text = (0, i18n_1.
|
|
13
|
+
var { text = (0, i18n_1.i18n)(i18n_1.Keyset.PromptSignInOnLike), onClickSignIn = () => alert((0, i18n_1.i18n)(i18n_1.Keyset.SignIn)), actions = [
|
|
14
14
|
{
|
|
15
|
-
children: (0, i18n_1.
|
|
15
|
+
children: (0, i18n_1.i18n)(i18n_1.Keyset.SignIn),
|
|
16
16
|
onClick: onClickSignIn,
|
|
17
17
|
size: 'l',
|
|
18
18
|
},
|
|
@@ -20,7 +20,7 @@ const AUTOFOCUS_TIMEOUT = 0;
|
|
|
20
20
|
*
|
|
21
21
|
* @returns {JSX|null}
|
|
22
22
|
*/
|
|
23
|
-
const Search = ({ className, initialValue, onSubmit, debounce = 300, placeholder = (0, i18n_1.
|
|
23
|
+
const Search = ({ className, initialValue, onSubmit, debounce = 300, placeholder = (0, i18n_1.i18n)(i18n_1.Keyset.Search), size = 'm', autoFocus = false, value: externalValue, }) => {
|
|
24
24
|
const handleChange = (0, debounce_1.default)(onSubmit, debounce);
|
|
25
25
|
const [value, setValue] = (0, react_1.useState)(initialValue);
|
|
26
26
|
const inputRef = (0, react_1.useRef)(null);
|
package/build/cjs/constants.d.ts
CHANGED
|
@@ -9,13 +9,14 @@ export declare const BREAKPOINTS: {
|
|
|
9
9
|
export declare const DEFAULT_THEME = "light";
|
|
10
10
|
export declare const UIKIT_ROOT_CLASS = "g-root";
|
|
11
11
|
export declare const UIKIT_THEME_LIGHT_CLASS: string;
|
|
12
|
-
export declare enum
|
|
12
|
+
export declare enum DefaultGoalIds {
|
|
13
13
|
shareTop = "SITE_BLOG_SHARE-TOP_CLICK",
|
|
14
14
|
shareBottom = "SITE_BLOG_SHARE-BOTTOM_CLICK",
|
|
15
15
|
breadcrumbsTop = "SITE_BLOG_BREADCRUMBS-TOP_CLICK",
|
|
16
16
|
breadcrumbsBottom = "SITE_BLOG_BREADCRUMBS-BOTTOM_CLICK",
|
|
17
17
|
saveTop = "SITE_BLOG_SAVE-TOP_CLICK",
|
|
18
18
|
saveBottom = "SITE_BLOG_SAVE-BOTTOM_CLICK",
|
|
19
|
+
saveSuggest = "SITE_BLOG_SAVE-SUGGEST_CLICK",
|
|
19
20
|
suggest = "SITE_BLOG_INTERESTING-CARD_CLICK",
|
|
20
21
|
bannerCommon = "SITE_BLOG_TEXT-BANNER_CLICK",
|
|
21
22
|
cta = "SITE_BLOG_CTA_CLICK",
|
package/build/cjs/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_PADDINGS = exports.
|
|
3
|
+
exports.DEFAULT_PADDINGS = exports.DefaultGoalIds = exports.UIKIT_THEME_LIGHT_CLASS = exports.UIKIT_ROOT_CLASS = exports.DEFAULT_THEME = exports.BREAKPOINTS = void 0;
|
|
4
4
|
const paddings_1 = require("./models/paddings");
|
|
5
5
|
exports.BREAKPOINTS = {
|
|
6
6
|
xs: 0,
|
|
@@ -12,24 +12,25 @@ exports.BREAKPOINTS = {
|
|
|
12
12
|
exports.DEFAULT_THEME = 'light';
|
|
13
13
|
exports.UIKIT_ROOT_CLASS = 'g-root';
|
|
14
14
|
exports.UIKIT_THEME_LIGHT_CLASS = `${exports.UIKIT_ROOT_CLASS}_theme_${exports.DEFAULT_THEME}`;
|
|
15
|
-
var
|
|
16
|
-
(function (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
var DefaultGoalIds;
|
|
16
|
+
(function (DefaultGoalIds) {
|
|
17
|
+
DefaultGoalIds["shareTop"] = "SITE_BLOG_SHARE-TOP_CLICK";
|
|
18
|
+
DefaultGoalIds["shareBottom"] = "SITE_BLOG_SHARE-BOTTOM_CLICK";
|
|
19
|
+
DefaultGoalIds["breadcrumbsTop"] = "SITE_BLOG_BREADCRUMBS-TOP_CLICK";
|
|
20
|
+
DefaultGoalIds["breadcrumbsBottom"] = "SITE_BLOG_BREADCRUMBS-BOTTOM_CLICK";
|
|
21
|
+
DefaultGoalIds["saveTop"] = "SITE_BLOG_SAVE-TOP_CLICK";
|
|
22
|
+
DefaultGoalIds["saveBottom"] = "SITE_BLOG_SAVE-BOTTOM_CLICK";
|
|
23
|
+
DefaultGoalIds["saveSuggest"] = "SITE_BLOG_SAVE-SUGGEST_CLICK";
|
|
24
|
+
DefaultGoalIds["suggest"] = "SITE_BLOG_INTERESTING-CARD_CLICK";
|
|
25
|
+
DefaultGoalIds["bannerCommon"] = "SITE_BLOG_TEXT-BANNER_CLICK";
|
|
26
|
+
DefaultGoalIds["cta"] = "SITE_BLOG_CTA_CLICK";
|
|
27
|
+
DefaultGoalIds["tag"] = "SITE_BLOG_THEME-SELECTOR_CLCK";
|
|
28
|
+
DefaultGoalIds["service"] = "SITE_BLOG_SERVICE-SELECTOR_CLCK";
|
|
29
|
+
DefaultGoalIds["showMore"] = "SITE_BLOG-PAGINATION_SHOW-MORE_CLCK";
|
|
30
|
+
DefaultGoalIds["next"] = "SITE_BLOG-PAGINATION_NEXT_CLCK";
|
|
31
|
+
DefaultGoalIds["home"] = "SITE_BLOG-PAGINATION_HOME_CLCK";
|
|
32
|
+
DefaultGoalIds["page"] = "SITE_BLOG-PAGINATION_PAGE-NMBR_CLCK";
|
|
33
|
+
})(DefaultGoalIds = exports.DefaultGoalIds || (exports.DefaultGoalIds = {}));
|
|
33
34
|
exports.DEFAULT_PADDINGS = {
|
|
34
35
|
[paddings_1.PaddingsDirections.bottom]: 'l',
|
|
35
36
|
[paddings_1.PaddingsDirections.top]: 'xs',
|
|
@@ -14,6 +14,7 @@ const ThemeValueContext_1 = require("../contexts/theme/ThemeValueContext");
|
|
|
14
14
|
const BlogConstructorProvider = ({ isMobile, locale = {}, router = {}, theme = constants_1.DEFAULT_THEME, device = {}, analytics = {}, settings = {}, children, }) => {
|
|
15
15
|
const context = [
|
|
16
16
|
react_1.default.createElement(ThemeValueContext_1.ThemeValueContext.Provider, { value: { themeValue: theme }, key: "theme-context" }),
|
|
17
|
+
react_1.default.createElement(page_constructor_1.ThemeContext.Provider, { value: { theme: theme }, key: "pc-theme" }),
|
|
17
18
|
react_1.default.createElement(LocaleContext_1.LocaleContext.Provider, { value: { locale }, key: "locale-context" }),
|
|
18
19
|
react_1.default.createElement(RouterContext_1.RouterContext.Provider, { value: router, key: "router-context" }),
|
|
19
20
|
react_1.default.createElement(MobileContext_1.MobileContext.Provider, { value: Boolean(isMobile), key: "is-mobile-context" }),
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LocaleContext = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const
|
|
6
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
7
|
exports.LocaleContext = react_1.default.createContext({
|
|
8
8
|
locale: {
|
|
9
9
|
code: 'en-En',
|
|
10
|
-
lang:
|
|
10
|
+
lang: uikit_1.Lang.En,
|
|
11
11
|
langName: 'English',
|
|
12
12
|
pathPrefix: 'en',
|
|
13
13
|
},
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initCounters = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated Metrika will be deleted after launch of analyticsEvents
|
|
6
|
-
*/
|
|
7
4
|
const Goal = {
|
|
8
5
|
SUPPORT_OPEN_FORM: 'SUPPORTOPENFORM',
|
|
9
6
|
SUPPORT_STEP_1_SUBMIT: 'SUPPORTSTEP1SUBMIT',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
(function (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(
|
|
3
|
+
exports.AnalyticsCounter = void 0;
|
|
4
|
+
var AnalyticsCounter;
|
|
5
|
+
(function (AnalyticsCounter) {
|
|
6
|
+
AnalyticsCounter["Main"] = "main";
|
|
7
|
+
AnalyticsCounter["CrossSite"] = "cross-site";
|
|
8
|
+
AnalyticsCounter["Scale"] = "scale";
|
|
9
|
+
})(AnalyticsCounter = exports.AnalyticsCounter || (exports.AnalyticsCounter = {}));
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { I18N } from '@gravity-ui/i18n';
|
|
2
|
-
export declare const i18n: I18N;
|
|
3
1
|
export declare enum Keyset {
|
|
4
2
|
Title = "title",
|
|
5
3
|
TitleBreadcrumbs = "title_breadcrumbs",
|
|
@@ -21,4 +19,4 @@ export declare enum Keyset {
|
|
|
21
19
|
PromptSignInOnLike = "prompt_sign_in_on_like",
|
|
22
20
|
SignIn = "Sign In"
|
|
23
21
|
}
|
|
24
|
-
export declare const
|
|
22
|
+
export declare const i18n: (key: Keyset, params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
package/build/cjs/i18n/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const i18n_1 = require("@gravity-ui/i18n");
|
|
5
|
-
const
|
|
6
|
-
const KEYSET_NAME = 'blog';
|
|
7
|
-
exports.i18n = new i18n_1.I18N();
|
|
3
|
+
exports.i18n = exports.Keyset = void 0;
|
|
4
|
+
const i18n_1 = require("@gravity-ui/uikit/i18n");
|
|
5
|
+
const NAMESPACE = 'blog';
|
|
8
6
|
var Keyset;
|
|
9
7
|
(function (Keyset) {
|
|
10
8
|
Keyset["Title"] = "title";
|
|
@@ -27,7 +25,7 @@ var Keyset;
|
|
|
27
25
|
Keyset["PromptSignInOnLike"] = "prompt_sign_in_on_like";
|
|
28
26
|
Keyset["SignIn"] = "Sign In";
|
|
29
27
|
})(Keyset = exports.Keyset || (exports.Keyset = {}));
|
|
30
|
-
|
|
28
|
+
const en = {
|
|
31
29
|
[Keyset.Title]: 'Blog',
|
|
32
30
|
[Keyset.TitleBreadcrumbs]: 'Blog',
|
|
33
31
|
[Keyset.TitleSuggest]: 'See also',
|
|
@@ -51,8 +49,8 @@ exports.i18n.registerKeyset(locale_1.Lang.En, KEYSET_NAME, {
|
|
|
51
49
|
'{{count}} mins to read',
|
|
52
50
|
],
|
|
53
51
|
[Keyset.SignIn]: 'Sign In',
|
|
54
|
-
}
|
|
55
|
-
|
|
52
|
+
};
|
|
53
|
+
const ru = {
|
|
56
54
|
[Keyset.Title]: 'Блог',
|
|
57
55
|
[Keyset.TitleBreadcrumbs]: 'Блог',
|
|
58
56
|
[Keyset.TitleSuggest]: 'Читать также',
|
|
@@ -76,5 +74,5 @@ exports.i18n.registerKeyset(locale_1.Lang.Ru, KEYSET_NAME, {
|
|
|
76
74
|
'{{count}} минут чтения',
|
|
77
75
|
],
|
|
78
76
|
[Keyset.SignIn]: 'Войти',
|
|
79
|
-
}
|
|
80
|
-
exports.
|
|
77
|
+
};
|
|
78
|
+
exports.i18n = (0, i18n_1.addComponentKeysets)({ en, ru }, NAMESPACE);
|
package/build/cjs/index.d.ts
CHANGED
package/build/cjs/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BREAKPOINTS = exports.BlogPage = exports.BlogPostPage = exports.BlogConstructorProvider =
|
|
3
|
+
exports.BREAKPOINTS = exports.BlogPage = exports.BlogPostPage = exports.BlogConstructorProvider = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
var configure_1 = require("./configure");
|
|
6
|
-
Object.defineProperty(exports, "configure", { enumerable: true, get: function () { return configure_1.configure; } });
|
|
7
5
|
var BlogConstructorProvider_1 = require("./constructor/BlogConstructorProvider");
|
|
8
6
|
Object.defineProperty(exports, "BlogConstructorProvider", { enumerable: true, get: function () { return BlogConstructorProvider_1.BlogConstructorProvider; } });
|
|
9
7
|
var BlogPostPage_1 = require("./containers/BlogPostPage/BlogPostPage");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { MarkdownItPluginCb } from '@
|
|
2
|
+
import { MarkdownItPluginCb } from '@diplodoc/transform/lib/plugins/typings';
|
|
3
3
|
import { HeaderBlockProps as PageConstructorHeaderBlockProps } from '@gravity-ui/page-constructor';
|
|
4
4
|
import { IBrowser, IDevice } from 'ua-parser-js';
|
|
5
5
|
import { Locale } from '../models/locale';
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Currency =
|
|
4
|
-
var Lang;
|
|
5
|
-
(function (Lang) {
|
|
6
|
-
Lang["Ru"] = "ru";
|
|
7
|
-
Lang["En"] = "en";
|
|
8
|
-
})(Lang = exports.Lang || (exports.Lang = {}));
|
|
3
|
+
exports.Currency = void 0;
|
|
9
4
|
var Currency;
|
|
10
5
|
(function (Currency) {
|
|
11
6
|
Currency["RUB"] = "RUB";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
|
-
import {
|
|
2
|
+
import { AnalyticsEvent, AnalyticsEventsProp, ContentBlockProps, HeaderBreadCrumbsProps } from '@gravity-ui/page-constructor';
|
|
3
3
|
import { RouterContextProps } from '../contexts/RouterContext';
|
|
4
4
|
import { GetPostsRequest, Query, Tag } from '../models/common';
|
|
5
|
+
import { AnalyticsCounter } from '../counters/utils';
|
|
5
6
|
export interface QueryParam {
|
|
6
7
|
name: string;
|
|
7
8
|
value?: string | number | null;
|
|
@@ -38,9 +39,20 @@ type GetBreadcrumbsProps = {
|
|
|
38
39
|
};
|
|
39
40
|
export declare const getBlogPath: (pathPrefix: string) => string;
|
|
40
41
|
export declare const getBreadcrumbs: ({ tags, blogPath }: GetBreadcrumbsProps) => HeaderBreadCrumbsProps;
|
|
41
|
-
export declare const
|
|
42
|
-
|
|
42
|
+
export declare const getMergedAnalyticsEvents: (analyticEvents: AnalyticsEventsProp, existringEvents?: AnalyticsEventsProp) => {
|
|
43
|
+
name: string;
|
|
44
|
+
type?: string | undefined;
|
|
45
|
+
counters?: import("@gravity-ui/page-constructor").AnalyticsCounters | undefined;
|
|
46
|
+
context?: string | undefined;
|
|
47
|
+
target?: string | undefined;
|
|
48
|
+
}[];
|
|
43
49
|
export declare const getFeedQueryParams: (queryString: Query, pageNumber?: number) => GetPostsRequest;
|
|
44
50
|
export declare const scrollOnPageChange: (containerId: string) => void;
|
|
45
51
|
export declare const getQaAttributes: (qa?: string, ...customKeys: (string | Array<string>)[]) => Record<string, string>;
|
|
52
|
+
type PrepareAnalyticsEventArgs = {
|
|
53
|
+
name: string;
|
|
54
|
+
counter?: AnalyticsCounter;
|
|
55
|
+
options?: Record<string, string | number>;
|
|
56
|
+
};
|
|
57
|
+
export declare const prepareAnalyticsEvent: ({ name, counter, options, }: PrepareAnalyticsEventArgs) => AnalyticsEvent;
|
|
46
58
|
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.prepareAnalyticsEvent = exports.getQaAttributes = exports.scrollOnPageChange = exports.getFeedQueryParams = exports.getMergedAnalyticsEvents = exports.getBreadcrumbs = exports.getBlogPath = exports.updateContentSizes = 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
|
-
const page_constructor_1 = require("@gravity-ui/page-constructor");
|
|
7
6
|
const camelCase_1 = tslib_1.__importDefault(require("lodash/camelCase"));
|
|
8
7
|
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
|
|
9
8
|
const flatten_1 = tslib_1.__importDefault(require("lodash/flatten"));
|
|
10
9
|
const memoize_1 = tslib_1.__importDefault(require("lodash/memoize"));
|
|
11
10
|
const constants_1 = require("../blocks/constants");
|
|
12
11
|
const i18n_1 = require("../i18n");
|
|
12
|
+
const utils_1 = require("../counters/utils");
|
|
13
13
|
const QA_ATTRIBUTES_KEYS = ['container', 'content', 'wrapper', 'image', 'button'];
|
|
14
14
|
function getAbsolutePath(router, url) {
|
|
15
15
|
if (!router || !router.pathname) {
|
|
@@ -62,7 +62,7 @@ const getBlogPath = (pathPrefix) => {
|
|
|
62
62
|
exports.getBlogPath = getBlogPath;
|
|
63
63
|
const getBreadcrumbs = ({ tags, blogPath }) => {
|
|
64
64
|
const breadcrumbs = {
|
|
65
|
-
items: [{ text: (0, i18n_1.
|
|
65
|
+
items: [{ text: (0, i18n_1.i18n)(i18n_1.Keyset.TitleBreadcrumbs), url: blogPath }],
|
|
66
66
|
theme: 'light',
|
|
67
67
|
};
|
|
68
68
|
if (tags === null || tags === void 0 ? void 0 : tags.length) {
|
|
@@ -74,24 +74,21 @@ const getBreadcrumbs = ({ tags, blogPath }) => {
|
|
|
74
74
|
return breadcrumbs;
|
|
75
75
|
};
|
|
76
76
|
exports.getBreadcrumbs = getBreadcrumbs;
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
exports.isMetrikaExist = isMetrikaExist;
|
|
81
|
-
const getBlogElementMetrika = (blogCustomGoal, existingGoals) => {
|
|
82
|
-
if (existingGoals) {
|
|
83
|
-
if ((0, page_constructor_1.isNewMetrikaFormat)(existingGoals) && !(0, exports.isMetrikaExist)(blogCustomGoal, existingGoals)) {
|
|
84
|
-
const goals = [...existingGoals];
|
|
85
|
-
goals.push(blogCustomGoal);
|
|
86
|
-
return goals;
|
|
87
|
-
}
|
|
88
|
-
return existingGoals;
|
|
77
|
+
const getArrayOfEvents = (events) => {
|
|
78
|
+
if (!events) {
|
|
79
|
+
return [];
|
|
89
80
|
}
|
|
90
|
-
|
|
91
|
-
return
|
|
81
|
+
if (Array.isArray(events)) {
|
|
82
|
+
return events;
|
|
92
83
|
}
|
|
84
|
+
return [events];
|
|
85
|
+
};
|
|
86
|
+
const getMergedAnalyticsEvents = (analyticEvents, existringEvents) => {
|
|
87
|
+
const eventsAsArray = getArrayOfEvents(analyticEvents);
|
|
88
|
+
const existingAsArray = getArrayOfEvents(existringEvents);
|
|
89
|
+
return eventsAsArray.concat(existingAsArray);
|
|
93
90
|
};
|
|
94
|
-
exports.
|
|
91
|
+
exports.getMergedAnalyticsEvents = getMergedAnalyticsEvents;
|
|
95
92
|
const getFeedQueryParams = (queryString, pageNumber) => {
|
|
96
93
|
const queryParams = (0, exports.getPageSearchParams)(queryString);
|
|
97
94
|
const tags = queryParams.get('tags') || undefined;
|
|
@@ -123,4 +120,8 @@ const getQaAttributes = (qa, ...customKeys) => {
|
|
|
123
120
|
}
|
|
124
121
|
return attributes;
|
|
125
122
|
};
|
|
126
|
-
exports.getQaAttributes = getQaAttributes;
|
|
123
|
+
exports.getQaAttributes = getQaAttributes;
|
|
124
|
+
const prepareAnalyticsEvent = ({ name, counter = utils_1.AnalyticsCounter.Main, options = {}, }) => (Object.assign(Object.assign({}, options), { name, counters: {
|
|
125
|
+
include: [counter],
|
|
126
|
+
} }));
|
|
127
|
+
exports.prepareAnalyticsEvent = prepareAnalyticsEvent;
|
|
@@ -2,13 +2,18 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Content, Image } from '@gravity-ui/page-constructor';
|
|
4
4
|
import { Wrapper } from '../../components/Wrapper/Wrapper';
|
|
5
|
-
import { BlogMetrikaGoalIds } from '../../constants';
|
|
6
5
|
import { PaddingsDirections } from '../../models/paddings';
|
|
7
6
|
import { block } from '../../utils/cn';
|
|
8
|
-
import {
|
|
7
|
+
import { getMergedAnalyticsEvents, getQaAttributes, prepareAnalyticsEvent, updateContentSizes, } from '../../utils/common';
|
|
8
|
+
import { DefaultGoalIds } from '../../constants';
|
|
9
|
+
import { AnalyticsCounter } from '../../counters/utils';
|
|
9
10
|
import './Banner.css';
|
|
10
11
|
const b = block('banner');
|
|
11
12
|
const BANNER_CUSTOM_QA_ATTRIBUTES = ['image-container'];
|
|
13
|
+
const buttonGoals = prepareAnalyticsEvent({
|
|
14
|
+
name: DefaultGoalIds.bannerCommon,
|
|
15
|
+
counter: AnalyticsCounter.CrossSite,
|
|
16
|
+
});
|
|
12
17
|
export const Banner = (_a) => {
|
|
13
18
|
var _b;
|
|
14
19
|
var { color, imageSize = 's', image, paddingTop, paddingBottom, qa } = _a, content = __rest(_a, ["color", "imageSize", "image", "paddingTop", "paddingBottom", "qa"]);
|
|
@@ -18,16 +23,9 @@ export const Banner = (_a) => {
|
|
|
18
23
|
contentStyle.backgroundColor = color;
|
|
19
24
|
}
|
|
20
25
|
const contentData = updateContentSizes(content);
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Metrika will be deleted after launch of analyticsEvents
|
|
23
|
-
*/
|
|
24
|
-
const metrikaGoal = {
|
|
25
|
-
name: BlogMetrikaGoalIds.bannerCommon,
|
|
26
|
-
isCrossSite: true,
|
|
27
|
-
};
|
|
28
26
|
(_b = contentData.buttons) === null || _b === void 0 ? void 0 : _b.forEach((button) => {
|
|
29
27
|
// eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
|
|
30
|
-
button.
|
|
28
|
+
button.analyticsEvents = getMergedAnalyticsEvents(buttonGoals, button.analyticsEvents);
|
|
31
29
|
});
|
|
32
30
|
return (React.createElement(Wrapper, { paddings: {
|
|
33
31
|
[PaddingsDirections.top]: paddingTop,
|