@gravity-ui/blog-constructor 5.9.0 → 5.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/build/cjs/blocks/Feed/Feed.js +2 -2
  2. package/build/cjs/blocks/Meta/Meta.js +4 -3
  3. package/build/cjs/blocks/Suggest/Suggest.js +1 -1
  4. package/build/cjs/components/FeedHeader/components/Controls/Controls.js +3 -3
  5. package/build/cjs/components/Paginator/Paginator.js +4 -4
  6. package/build/cjs/components/PostInfo/PostInfo.js +5 -3
  7. package/build/cjs/components/PostInfo/components/Date.d.ts +3 -3
  8. package/build/cjs/components/PostInfo/components/Date.js +2 -2
  9. package/build/cjs/components/PostInfo/components/ReadingTime.d.ts +3 -2
  10. package/build/cjs/components/PostInfo/components/ReadingTime.js +1 -1
  11. package/build/cjs/components/PostInfo/components/Save.js +3 -3
  12. package/build/cjs/components/PostInfo/components/Sharing.js +2 -2
  13. package/build/cjs/contexts/PostPageContext.d.ts +6 -5
  14. package/build/cjs/counters/metrika.d.ts +56 -60
  15. package/build/cjs/counters/metrika.js +4 -0
  16. package/build/cjs/models/blocks.d.ts +1 -1
  17. package/build/cjs/utils/common.d.ts +2 -0
  18. package/build/esm/blocks/Feed/Feed.js +1 -1
  19. package/build/esm/blocks/Meta/Meta.js +5 -4
  20. package/build/esm/blocks/Suggest/Suggest.js +1 -1
  21. package/build/esm/components/FeedHeader/components/Controls/Controls.js +1 -1
  22. package/build/esm/components/Paginator/Paginator.js +1 -1
  23. package/build/esm/components/PostInfo/PostInfo.js +5 -3
  24. package/build/esm/components/PostInfo/components/Date.d.ts +3 -3
  25. package/build/esm/components/PostInfo/components/Date.js +2 -2
  26. package/build/esm/components/PostInfo/components/ReadingTime.d.ts +3 -2
  27. package/build/esm/components/PostInfo/components/ReadingTime.js +1 -1
  28. package/build/esm/components/PostInfo/components/Save.js +2 -2
  29. package/build/esm/components/PostInfo/components/Sharing.js +1 -1
  30. package/build/esm/contexts/PostPageContext.d.ts +6 -5
  31. package/build/esm/counters/metrika.d.ts +56 -60
  32. package/build/esm/counters/metrika.js +4 -0
  33. package/build/esm/models/blocks.d.ts +1 -1
  34. package/build/esm/utils/common.d.ts +2 -0
  35. package/package.json +3 -14
  36. package/server/models/blocks.d.ts +1 -1
@@ -17,7 +17,7 @@ const RouterContext_1 = require("../../contexts/RouterContext");
17
17
  /**
18
18
  * @deprecated Metrika will be deleted after launch of analyticsEvents
19
19
  */
20
- const metrika_js_1 = tslib_1.__importDefault(require("../../counters/metrika.js"));
20
+ const metrika_1 = tslib_1.__importDefault(require("../../counters/metrika"));
21
21
  const utils_1 = require("../../counters/utils");
22
22
  const common_1 = require("../../models/common");
23
23
  const common_2 = require("../../utils/common");
@@ -108,7 +108,7 @@ const Feed = ({ image }) => {
108
108
  /**
109
109
  * @deprecated Metrika will be deleted after launch of analyticsEvents
110
110
  */
111
- metrika_js_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, constants_1.BlogMetrikaGoalIds.showMore);
111
+ metrika_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, constants_1.BlogMetrikaGoalIds.showMore);
112
112
  handleAnalytics();
113
113
  const nextPage = currentPage + 1;
114
114
  try {
@@ -27,21 +27,22 @@ const breadcrumbsGoals = [
27
27
  },
28
28
  ];
29
29
  const Meta = (props) => {
30
- const { paddingTop = 'l', paddingBottom = 'l', theme = 'light' } = props;
30
+ const { paddingTop = 'l', paddingBottom = 'l', theme = 'light', qa } = props;
31
31
  const { post } = (0, react_1.useContext)(PostPageContext_1.PostPageContext);
32
32
  const { locale } = (0, react_1.useContext)(LocaleContext_1.LocaleContext);
33
+ const qaAttributes = (0, common_1.getQaAttributes)(qa, 'post-info');
33
34
  const { title, id, date, readingTime, tags } = post;
34
35
  const breadcrumbs = (0, common_1.getBreadcrumbs)({ tags, pathPrefix: (locale === null || locale === void 0 ? void 0 : locale.pathPrefix) || '' });
35
36
  breadcrumbs.metrikaGoals = breadcrumbsGoals;
36
37
  return (react_1.default.createElement(Wrapper_1.Wrapper, { paddings: {
37
38
  [paddings_1.PaddingsDirections.top]: paddingTop,
38
39
  [paddings_1.PaddingsDirections.bottom]: paddingBottom,
39
- }, qa: "blog-meta-content" },
40
+ }, qa: qaAttributes.wrapper },
40
41
  breadcrumbs && (react_1.default.createElement(page_constructor_1.HeaderBreadcrumbs, { items: breadcrumbs.items, className: b('breadcrumbs'), theme: theme, metrikaGoals: breadcrumbs.metrikaGoals })),
41
42
  title && (react_1.default.createElement(page_constructor_1.YFMWrapper, { content: title, modifiers: {
42
43
  blogBreadcrumbs: true,
43
44
  resetPaddings: true,
44
45
  } })),
45
- post && (react_1.default.createElement(PostInfo_1.PostInfo, { postId: id, date: date, readingTime: readingTime, metrikaGoals: metrikaGoals, qa: "blog-meta-block" }))));
46
+ post && (react_1.default.createElement(PostInfo_1.PostInfo, { postId: id, date: date, readingTime: readingTime, metrikaGoals: metrikaGoals, qa: qaAttributes.postInfo }))));
46
47
  };
47
48
  exports.Meta = Meta;
@@ -37,6 +37,6 @@ const Suggest = ({ paddingTop = 'l', paddingBottom = 'l' }) => {
37
37
  [paddings_1.PaddingsDirections.top]: paddingTop,
38
38
  [paddings_1.PaddingsDirections.bottom]: paddingBottom,
39
39
  } },
40
- react_1.default.createElement(page_constructor_1.SliderBlock, { slidesToShow: { xl: 3, lg: 2, sm: 1 }, title: { text: (0, i18n_1.i18)(i18n_1.Keyset.TitleSuggest) } }, suggestedPosts.map((post) => (react_1.default.createElement(PostCard_1.PostCard, { key: post.id, metrikaGoals: metrikaGoals, post: post }))))));
40
+ react_1.default.createElement(page_constructor_1.SliderBlock, { slidesToShow: { xl: 3, lg: 2, sm: 1 }, title: { text: (0, i18n_1.i18)(i18n_1.Keyset.TitleSuggest) }, lazyLoad: false }, suggestedPosts.map((post) => (react_1.default.createElement(PostCard_1.PostCard, { key: post.id, metrikaGoals: metrikaGoals, post: post }))))));
41
41
  };
42
42
  exports.Suggest = Suggest;
@@ -10,7 +10,7 @@ const uikit_1 = require("@gravity-ui/uikit");
10
10
  */
11
11
  const constants_1 = require("../../../../constants");
12
12
  const LikesContext_1 = require("../../../../contexts/LikesContext");
13
- const metrika_js_1 = tslib_1.__importDefault(require("../../../../counters/metrika.js"));
13
+ const metrika_1 = tslib_1.__importDefault(require("../../../../counters/metrika"));
14
14
  const utils_1 = require("../../../../counters/utils");
15
15
  const i18n_1 = require("../../../../i18n");
16
16
  const Save_1 = require("../../../../icons/Save");
@@ -55,7 +55,7 @@ const Controls = ({ handleLoadData, tags = [], services = [], queryParams, }) =>
55
55
  /**
56
56
  * @deprecated Metrika will be deleted after launch of analyticsEvents
57
57
  */
58
- metrika_js_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, constants_1.BlogMetrikaGoalIds.tag, {
58
+ metrika_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, constants_1.BlogMetrikaGoalIds.tag, {
59
59
  theme: selectedTags[0],
60
60
  });
61
61
  handleAnalyticsTag(null, {
@@ -78,7 +78,7 @@ const Controls = ({ handleLoadData, tags = [], services = [], queryParams, }) =>
78
78
  /**
79
79
  * @deprecated Metrika will be deleted after launch of analyticsEvents
80
80
  */
81
- metrika_js_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, constants_1.BlogMetrikaGoalIds.service, {
81
+ metrika_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, constants_1.BlogMetrikaGoalIds.service, {
82
82
  service: metrikaAsString,
83
83
  });
84
84
  handleAnalyticsService(null, {
@@ -8,7 +8,7 @@ const constants_1 = require("../../constants");
8
8
  /**
9
9
  * @deprecated Metrika will be deleted after launch of analyticsEvents
10
10
  */
11
- const metrika_js_1 = tslib_1.__importDefault(require("../../counters/metrika.js"));
11
+ const metrika_1 = tslib_1.__importDefault(require("../../counters/metrika"));
12
12
  const utils_1 = require("../../counters/utils");
13
13
  const common_1 = require("../../models/common");
14
14
  const cn_1 = require("../../utils/cn");
@@ -38,7 +38,7 @@ const Paginator = ({ itemsPerPage, totalItems, maxPages, page, className, onPage
38
38
  /**
39
39
  * @deprecated Metrika will be deleted after launch of analyticsEvents
40
40
  */
41
- metrika_js_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, constants_1.BlogMetrikaGoalIds.home);
41
+ metrika_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, constants_1.BlogMetrikaGoalIds.home);
42
42
  handleAnalyticsHome();
43
43
  newPage = 1;
44
44
  }
@@ -47,7 +47,7 @@ const Paginator = ({ itemsPerPage, totalItems, maxPages, page, className, onPage
47
47
  * @deprecated Metrika will be deleted after launch of analyticsEvents
48
48
  */
49
49
  handleAnalyticsNext();
50
- metrika_js_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, constants_1.BlogMetrikaGoalIds.next);
50
+ metrika_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, constants_1.BlogMetrikaGoalIds.next);
51
51
  newPage = page + 1;
52
52
  }
53
53
  if (newPage !== page) {
@@ -59,7 +59,7 @@ const Paginator = ({ itemsPerPage, totalItems, maxPages, page, className, onPage
59
59
  /**
60
60
  * @deprecated Metrika will be deleted after launch of analyticsEvents
61
61
  */
62
- metrika_js_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, constants_1.BlogMetrikaGoalIds.page, { page: index });
62
+ metrika_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, constants_1.BlogMetrikaGoalIds.page, { page: index });
63
63
  handleAnalyticsPage(null, { page: String(index) });
64
64
  handlePageChange(index);
65
65
  }
@@ -9,6 +9,7 @@ const Date_1 = require("./components/Date");
9
9
  const ReadingTime_1 = require("./components/ReadingTime");
10
10
  const Save_1 = require("./components/Save");
11
11
  const Sharing_1 = require("./components/Sharing");
12
+ const common_1 = require("../../utils/common");
12
13
  const b = (0, cn_1.block)('post-info');
13
14
  /**
14
15
  * Blog post info panel component
@@ -24,10 +25,11 @@ const b = (0, cn_1.block)('post-info');
24
25
  */
25
26
  const PostInfo = ({ date, readingTime, postId, theme = 'light', metrikaGoals, qa, }) => {
26
27
  const { likes } = (0, react_1.useContext)(PostPageContext_1.PostPageContext);
28
+ const qaAttributes = (0, common_1.getQaAttributes)(qa, 'date', 'reading-time', 'save');
27
29
  return (react_1.default.createElement("div", { className: b('container', { theme }) },
28
- date && react_1.default.createElement(Date_1.Date, { date: date }),
29
- readingTime && react_1.default.createElement(ReadingTime_1.ReadingTime, { readingTime: readingTime }),
30
+ date && react_1.default.createElement(Date_1.Date, { date: date, qa: qaAttributes.date }),
31
+ readingTime && react_1.default.createElement(ReadingTime_1.ReadingTime, { readingTime: readingTime, qa: qaAttributes.readingTime }),
30
32
  react_1.default.createElement(Sharing_1.Sharing, { metrikaGoal: metrikaGoals === null || metrikaGoals === void 0 ? void 0 : metrikaGoals.sharing, theme: theme }),
31
- likes && (react_1.default.createElement(Save_1.Save, { postId: postId, title: likes.likesCount, hasUserLike: likes.hasUserLike, handleUserLike: likes.handleUserLike, metrikaGoal: metrikaGoals === null || metrikaGoals === void 0 ? void 0 : metrikaGoals.save, theme: theme, qa: qa }))));
33
+ likes && (react_1.default.createElement(Save_1.Save, { postId: postId, title: likes.likesCount, hasUserLike: likes.hasUserLike, handleUserLike: likes.handleUserLike, metrikaGoal: metrikaGoals === null || metrikaGoals === void 0 ? void 0 : metrikaGoals.save, theme: theme, qa: qaAttributes.save }))));
32
34
  };
33
35
  exports.PostInfo = PostInfo;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { PostCardSize } from '../../../models/common';
3
- type DateProps = {
2
+ import { PostCardSize, QAProps } from '../../../models/common';
3
+ type DateProps = QAProps & {
4
4
  date: string | number;
5
5
  size?: PostCardSize;
6
6
  id?: string;
7
7
  };
8
- export declare const Date: ({ date, size, id }: DateProps) => React.JSX.Element;
8
+ export declare const Date: ({ date, size, id, qa }: DateProps) => React.JSX.Element;
9
9
  export {};
@@ -8,8 +8,8 @@ const common_1 = require("../../../models/common");
8
8
  const cn_1 = require("../../../utils/cn");
9
9
  const date_1 = require("../../../utils/date");
10
10
  const b = (0, cn_1.block)('post-info');
11
- const Date = ({ date, size = common_1.PostCardSize.SMALL, id }) => {
11
+ const Date = ({ date, size = common_1.PostCardSize.SMALL, id, qa }) => {
12
12
  const { locale } = (0, react_1.useContext)(LocaleContext_1.LocaleContext);
13
- return (react_1.default.createElement("div", { className: b('item', { size }), id: id }, (0, date_1.format)(date, 'longDate', locale === null || locale === void 0 ? void 0 : locale.code)));
13
+ return (react_1.default.createElement("div", { className: b('item', { size }), id: id, "data-qa": qa }, (0, date_1.format)(date, 'longDate', locale === null || locale === void 0 ? void 0 : locale.code)));
14
14
  };
15
15
  exports.Date = Date;
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
- type ReadingTimeProps = {
2
+ import { QAProps } from '../../../models/common';
3
+ type ReadingTimeProps = QAProps & {
3
4
  readingTime: number;
4
5
  size?: 's' | 'm';
5
6
  id?: string;
6
7
  };
7
- export declare const ReadingTime: ({ readingTime, size, id }: ReadingTimeProps) => React.JSX.Element;
8
+ export declare const ReadingTime: ({ readingTime, size, id, qa }: ReadingTimeProps) => React.JSX.Element;
8
9
  export {};
@@ -9,7 +9,7 @@ const Time_1 = require("../../../icons/Time");
9
9
  const cn_1 = require("../../../utils/cn");
10
10
  const b = (0, cn_1.block)('post-info');
11
11
  const ICON_SIZE = 16;
12
- const ReadingTime = ({ readingTime, size = 's', id }) => (react_1.default.createElement("div", { className: b('item', { size }), id: id },
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
15
  (0, i18n_1.i18)(i18n_1.Keyset.ContextReadingTime, { count: readingTime })));
@@ -6,7 +6,7 @@ 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_js_1 = tslib_1.__importDefault(require("../../../counters/metrika.js"));
9
+ const metrika_1 = tslib_1.__importDefault(require("../../../counters/metrika"));
10
10
  const utils_1 = require("../../../counters/utils");
11
11
  const Save_1 = require("../../../icons/Save");
12
12
  const SaveFilled_1 = require("../../../icons/SaveFilled");
@@ -46,9 +46,9 @@ const Save = ({ title, postId, hasUserLike, handleUserLike, metrikaGoal, size, t
46
46
  }
47
47
  (0, common_2.postLikeStatus)(postId, Boolean(hasUserLike));
48
48
  handleUserLike();
49
- metrika_js_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, metrikaGoal);
49
+ metrika_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, metrikaGoal);
50
50
  handleAnalytics();
51
- }, "data-qa": `${qa ? qa + '-' : ''}save` },
51
+ }, "data-qa": qa },
52
52
  react_1.default.createElement("div", { className: b('content', { cursor: isLikeable, theme }) },
53
53
  react_1.default.createElement("span", { className: b('icon') },
54
54
  react_1.default.createElement(uikit_1.Icon, { data: hasUserLike ? SaveFilled_1.SaveFilled : Save_1.Save, size: ICON_SIZE, className: b({ filled: Boolean(hasUserLike) }) })),
@@ -8,7 +8,7 @@ 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_js_1 = tslib_1.__importDefault(require("../../../counters/metrika.js"));
11
+ const metrika_1 = tslib_1.__importDefault(require("../../../counters/metrika"));
12
12
  const utils_1 = require("../../../counters/utils");
13
13
  const i18n_1 = require("../../../i18n");
14
14
  const ShareArrowUp_1 = require("../../../icons/ShareArrowUp");
@@ -22,7 +22,7 @@ const Sharing = ({ theme, metrikaGoal }) => {
22
22
  const { shareOptions } = (0, react_1.useContext)(PostPageContext_1.PostPageContext);
23
23
  const handleAnalyticsGlobal = (0, page_constructor_1.useAnalytics)(common_1.DefaultEventNames.ShareButton);
24
24
  const handleMetrika = (0, react_1.useCallback)(() => {
25
- metrika_js_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, metrikaGoal);
25
+ metrika_1.default.reachGoal(utils_1.MetrikaCounter.CrossSite, metrikaGoal);
26
26
  }, [metrikaGoal]);
27
27
  const handleAnalytics = (0, react_1.useCallback)(() => {
28
28
  handleAnalyticsGlobal();
@@ -1,14 +1,15 @@
1
1
  import React from 'react';
2
2
  import { ShareOptions } from '@gravity-ui/components';
3
3
  import { PostData } from '../models/common';
4
+ export type LikesRoutineType = {
5
+ handleUserLike: () => void;
6
+ hasUserLike: boolean;
7
+ likesCount: number;
8
+ };
4
9
  export interface PostPageContextProps {
5
10
  post: PostData;
6
11
  suggestedPosts: PostData[];
7
- likes?: {
8
- handleUserLike: () => void;
9
- hasUserLike: boolean;
10
- likesCount: number;
11
- };
12
+ likes?: LikesRoutineType;
12
13
  shareOptions?: ShareOptions[];
13
14
  }
14
15
  export declare const PostPageContext: React.Context<PostPageContextProps>;
@@ -1,62 +1,58 @@
1
- export function initCounters(configs: any): void;
2
- declare namespace _default {
3
- export { hit };
4
- export { params };
5
- export { reachGoal };
6
- export { reachGoals };
7
- export { Goal };
8
- export { getServicePrefix };
9
- export { getMarketPlacePrefix };
10
- export { goalGoToConsole };
11
- export { goalGoToForm };
12
- export { goalGoToDocs };
13
- export { goalFormSubmit };
14
- export { goalEventFormSubmit };
15
- export { goalEventVideoAction };
16
- export { goalCaseFormSubmit };
17
- export { goalSwitchLang };
18
- }
19
- export default _default;
1
+ export declare function initCounters(configs: Record<string, string>[]): void;
20
2
  declare function hit(...args: any[]): void;
21
- declare function params(...args: any[]): void;
22
- declare function reachGoal(counterName: any, ...args: any[]): void;
23
- declare function reachGoals(goals: any, counterName?: string): void;
24
- /**
25
- * @deprecated Metrika will be deleted after launch of analyticsEvents
26
- */
27
- declare const Goal: {
28
- SUPPORT_OPEN_FORM: string;
29
- SUPPORT_STEP_1_SUBMIT: string;
30
- SUPPORT_STEP_2_SUBMIT: string;
31
- SUPPORT_STEP_3_SUBMIT: string;
32
- SUPPORT_THANKYOU_SUBMIT: string;
33
- MP_OPEN_FORM: string;
34
- EDIT_ON_GITHUB: string;
35
- MAIN_GO_TO_VAR: string;
36
- MAIN_GO_TO_ISV: string;
37
- MAIN_ALL_PARTNERS: string;
38
- FIND_GO_TO_VAR: string;
39
- ISV_GO_TO_MP: string;
40
- FOOTER_SUBSCRIBE: string;
41
- FOOTER_MNG_SUBSCRIPTIONS: string;
42
- MOBILE_STORE_IOS: string;
43
- MOBILE_STORE_ANDROID: string;
44
- REGION_POPUP_SHOW: string;
45
- REGION_POPUP_YES: string;
46
- REGION_POPUP_NO: string;
47
- REGION_POPUP_CLOSE: string;
48
- SCALE_REGISTRATION: string;
49
- DLGOTOPRODUCT_MPSITE: string;
50
- MPK8S_CLCK: string;
51
- 'SITE_CALCULATOR_SHARE-RESULT_CLICK': string;
3
+ declare function params(...args: Record<string, any>[]): void;
4
+ declare function reachGoal(counterName: string, ...args: any[]): void;
5
+ declare function reachGoals(goals: string | object, counterName?: string): void;
6
+ declare function getServicePrefix(id: string): "CMPT" | "IAM" | "VPC" | "STRG" | "SK" | "CH" | "MONGO" | "POSTGR" | "MR" | "MMSQL" | "MK" | "TRSL" | "INSTGR" | "LB" | "MQ" | "DL" | "MNTRG" | "DP" | "KMS" | "YDB" | "INTRCNCT" | undefined;
7
+ declare function getMarketPlacePrefix(id: string): string;
8
+ declare function goalGoToConsole(prefix: string): string;
9
+ declare function goalGoToForm(prefix: string): string;
10
+ declare function goalGoToDocs(prefix: string): string;
11
+ declare function goalFormSubmit(prefix: string): string;
12
+ declare function goalEventFormSubmit(id: string): string;
13
+ declare function goalEventVideoAction(id: string, action: string): string;
14
+ declare function goalCaseFormSubmit(id: string): string;
15
+ declare function goalSwitchLang(place: string): string;
16
+ declare const _default: {
17
+ hit: typeof hit;
18
+ params: typeof params;
19
+ reachGoal: typeof reachGoal;
20
+ reachGoals: typeof reachGoals;
21
+ Goal: {
22
+ SUPPORT_OPEN_FORM: string;
23
+ SUPPORT_STEP_1_SUBMIT: string;
24
+ SUPPORT_STEP_2_SUBMIT: string;
25
+ SUPPORT_STEP_3_SUBMIT: string;
26
+ SUPPORT_THANKYOU_SUBMIT: string;
27
+ MP_OPEN_FORM: string;
28
+ EDIT_ON_GITHUB: string;
29
+ MAIN_GO_TO_VAR: string;
30
+ MAIN_GO_TO_ISV: string;
31
+ MAIN_ALL_PARTNERS: string;
32
+ FIND_GO_TO_VAR: string;
33
+ ISV_GO_TO_MP: string;
34
+ FOOTER_SUBSCRIBE: string;
35
+ FOOTER_MNG_SUBSCRIPTIONS: string;
36
+ MOBILE_STORE_IOS: string;
37
+ MOBILE_STORE_ANDROID: string;
38
+ REGION_POPUP_SHOW: string;
39
+ REGION_POPUP_YES: string;
40
+ REGION_POPUP_NO: string;
41
+ REGION_POPUP_CLOSE: string;
42
+ SCALE_REGISTRATION: string;
43
+ DLGOTOPRODUCT_MPSITE: string;
44
+ MPK8S_CLCK: string;
45
+ 'SITE_CALCULATOR_SHARE-RESULT_CLICK': string;
46
+ };
47
+ getServicePrefix: typeof getServicePrefix;
48
+ getMarketPlacePrefix: typeof getMarketPlacePrefix;
49
+ goalGoToConsole: typeof goalGoToConsole;
50
+ goalGoToForm: typeof goalGoToForm;
51
+ goalGoToDocs: typeof goalGoToDocs;
52
+ goalFormSubmit: typeof goalFormSubmit;
53
+ goalEventFormSubmit: typeof goalEventFormSubmit;
54
+ goalEventVideoAction: typeof goalEventVideoAction;
55
+ goalCaseFormSubmit: typeof goalCaseFormSubmit;
56
+ goalSwitchLang: typeof goalSwitchLang;
52
57
  };
53
- declare function getServicePrefix(id: any): "CMPT" | "IAM" | "VPC" | "STRG" | "SK" | "CH" | "MONGO" | "POSTGR" | "MR" | "MMSQL" | "MK" | "TRSL" | "INSTGR" | "LB" | "MQ" | "DL" | "MNTRG" | "DP" | "KMS" | "YDB" | "INTRCNCT" | undefined;
54
- declare function getMarketPlacePrefix(id: any): string;
55
- declare function goalGoToConsole(prefix: any): any;
56
- declare function goalGoToForm(prefix: any): any;
57
- declare function goalGoToDocs(prefix: any): any;
58
- declare function goalFormSubmit(prefix: any): any;
59
- declare function goalEventFormSubmit(id: any): string;
60
- declare function goalEventVideoAction(id: any, action: any): string;
61
- declare function goalCaseFormSubmit(id: any): string;
62
- declare function goalSwitchLang(place: any): string;
58
+ export default _default;
@@ -34,6 +34,7 @@ const HIT_COUNTERS = ['main', 'cross-site', 'scale'];
34
34
  const counterIds = {};
35
35
  function getCounter(name) {
36
36
  const counterId = counterIds[name];
37
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
38
  return window['yaCounter' + counterId];
38
39
  }
39
40
  function initCounters(configs) {
@@ -42,6 +43,7 @@ function initCounters(configs) {
42
43
  });
43
44
  }
44
45
  exports.initCounters = initCounters;
46
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
47
  function hit(...args) {
46
48
  HIT_COUNTERS.forEach((counterName) => {
47
49
  const counter = getCounter(counterName);
@@ -51,6 +53,7 @@ function hit(...args) {
51
53
  counter.hit(...args);
52
54
  });
53
55
  }
56
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
57
  function params(...args) {
55
58
  const counter = getCounter('main');
56
59
  if (!counter) {
@@ -58,6 +61,7 @@ function params(...args) {
58
61
  }
59
62
  counter.params(...args);
60
63
  }
64
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
61
65
  function reachGoal(counterName, ...args) {
62
66
  const counter = getCounter(counterName);
63
67
  if (!counter) {
@@ -30,7 +30,7 @@ export type LayoutProps = {
30
30
  export type MediaProps = ClassNameProps & PaddingsYFMProps & Partial<Pick<PCMediaProps, 'youtube' | 'previewImg' | 'image' | 'video' | 'dataLens'>> & {
31
31
  text?: string;
32
32
  };
33
- export type MetaProps = {
33
+ export type MetaProps = QAProps & {
34
34
  locale: string;
35
35
  theme?: TextTheme;
36
36
  } & PaddingsYFMProps;
@@ -24,7 +24,9 @@ export declare const updateContentSizes: ({ size, colSizes, theme, ...contentDat
24
24
  } | Partial<Record<import("@gravity-ui/page-constructor").GridColumnSize, number>>;
25
25
  theme: import("@gravity-ui/page-constructor").ContentTheme;
26
26
  title?: string | import("@gravity-ui/page-constructor").TitleItemBaseProps | undefined;
27
+ titleId?: string | undefined;
27
28
  text?: string | undefined;
29
+ textId?: string | undefined;
28
30
  additionalInfo?: string | undefined;
29
31
  links?: import("@gravity-ui/page-constructor").LinkProps[] | undefined;
30
32
  buttons?: import("@gravity-ui/page-constructor").ButtonProps[] | undefined;
@@ -13,7 +13,7 @@ import { RouterContext } from '../../contexts/RouterContext';
13
13
  /**
14
14
  * @deprecated Metrika will be deleted after launch of analyticsEvents
15
15
  */
16
- import metrika from '../../counters/metrika.js';
16
+ import metrika from '../../counters/metrika';
17
17
  import { MetrikaCounter } from '../../counters/utils';
18
18
  import { DefaultEventNames } from '../../models/common';
19
19
  import { getFeedQueryParams, scrollOnPageChange } from '../../utils/common';
@@ -7,7 +7,7 @@ import { LocaleContext } from '../../contexts/LocaleContext';
7
7
  import { PostPageContext } from '../../contexts/PostPageContext';
8
8
  import { PaddingsDirections } from '../../models/paddings';
9
9
  import { block } from '../../utils/cn';
10
- import { getBreadcrumbs } from '../../utils/common';
10
+ import { getBreadcrumbs, getQaAttributes } from '../../utils/common';
11
11
  import './Meta.css';
12
12
  const b = block('meta');
13
13
  /**
@@ -24,20 +24,21 @@ const breadcrumbsGoals = [
24
24
  },
25
25
  ];
26
26
  export const Meta = (props) => {
27
- const { paddingTop = 'l', paddingBottom = 'l', theme = 'light' } = props;
27
+ const { paddingTop = 'l', paddingBottom = 'l', theme = 'light', qa } = props;
28
28
  const { post } = useContext(PostPageContext);
29
29
  const { locale } = useContext(LocaleContext);
30
+ const qaAttributes = getQaAttributes(qa, 'post-info');
30
31
  const { title, id, date, readingTime, tags } = post;
31
32
  const breadcrumbs = getBreadcrumbs({ tags, pathPrefix: (locale === null || locale === void 0 ? void 0 : locale.pathPrefix) || '' });
32
33
  breadcrumbs.metrikaGoals = breadcrumbsGoals;
33
34
  return (React.createElement(Wrapper, { paddings: {
34
35
  [PaddingsDirections.top]: paddingTop,
35
36
  [PaddingsDirections.bottom]: paddingBottom,
36
- }, qa: "blog-meta-content" },
37
+ }, qa: qaAttributes.wrapper },
37
38
  breadcrumbs && (React.createElement(HeaderBreadcrumbs, { items: breadcrumbs.items, className: b('breadcrumbs'), theme: theme, metrikaGoals: breadcrumbs.metrikaGoals })),
38
39
  title && (React.createElement(YFMWrapper, { content: title, modifiers: {
39
40
  blogBreadcrumbs: true,
40
41
  resetPaddings: true,
41
42
  } })),
42
- post && (React.createElement(PostInfo, { postId: id, date: date, readingTime: readingTime, metrikaGoals: metrikaGoals, qa: "blog-meta-block" }))));
43
+ post && (React.createElement(PostInfo, { postId: id, date: date, readingTime: readingTime, metrikaGoals: metrikaGoals, qa: qaAttributes.postInfo }))));
43
44
  };
@@ -33,5 +33,5 @@ export const Suggest = ({ paddingTop = 'l', paddingBottom = 'l' }) => {
33
33
  [PaddingsDirections.top]: paddingTop,
34
34
  [PaddingsDirections.bottom]: paddingBottom,
35
35
  } },
36
- React.createElement(SliderBlock, { slidesToShow: { xl: 3, lg: 2, sm: 1 }, title: { text: i18(Keyset.TitleSuggest) } }, suggestedPosts.map((post) => (React.createElement(PostCard, { key: post.id, metrikaGoals: metrikaGoals, post: post }))))));
36
+ React.createElement(SliderBlock, { slidesToShow: { xl: 3, lg: 2, sm: 1 }, title: { text: i18(Keyset.TitleSuggest) }, lazyLoad: false }, suggestedPosts.map((post) => (React.createElement(PostCard, { key: post.id, metrikaGoals: metrikaGoals, post: post }))))));
37
37
  };
@@ -6,7 +6,7 @@ import { Button, Icon, Select } from '@gravity-ui/uikit';
6
6
  */
7
7
  import { BlogMetrikaGoalIds } from '../../../../constants';
8
8
  import { LikesContext } from '../../../../contexts/LikesContext';
9
- import metrika from '../../../../counters/metrika.js';
9
+ import metrika from '../../../../counters/metrika';
10
10
  import { MetrikaCounter } from '../../../../counters/utils';
11
11
  import { Keyset, i18 } from '../../../../i18n';
12
12
  import { Save } from '../../../../icons/Save';
@@ -5,7 +5,7 @@ import { BlogMetrikaGoalIds } from '../../constants';
5
5
  /**
6
6
  * @deprecated Metrika will be deleted after launch of analyticsEvents
7
7
  */
8
- import metrika from '../../counters/metrika.js';
8
+ import metrika from '../../counters/metrika';
9
9
  import { MetrikaCounter } from '../../counters/utils';
10
10
  import { DefaultEventNames } from '../../models/common';
11
11
  import { block } from '../../utils/cn';
@@ -5,6 +5,7 @@ import { Date } from './components/Date';
5
5
  import { ReadingTime } from './components/ReadingTime';
6
6
  import { Save } from './components/Save';
7
7
  import { Sharing } from './components/Sharing';
8
+ import { getQaAttributes } from '../../utils/common';
8
9
  import './PostInfo.css';
9
10
  const b = block('post-info');
10
11
  /**
@@ -21,9 +22,10 @@ const b = block('post-info');
21
22
  */
22
23
  export const PostInfo = ({ date, readingTime, postId, theme = 'light', metrikaGoals, qa, }) => {
23
24
  const { likes } = useContext(PostPageContext);
25
+ const qaAttributes = getQaAttributes(qa, 'date', 'reading-time', 'save');
24
26
  return (React.createElement("div", { className: b('container', { theme }) },
25
- date && React.createElement(Date, { date: date }),
26
- readingTime && React.createElement(ReadingTime, { readingTime: readingTime }),
27
+ date && React.createElement(Date, { date: date, qa: qaAttributes.date }),
28
+ readingTime && React.createElement(ReadingTime, { readingTime: readingTime, qa: qaAttributes.readingTime }),
27
29
  React.createElement(Sharing, { metrikaGoal: metrikaGoals === null || metrikaGoals === void 0 ? void 0 : metrikaGoals.sharing, theme: theme }),
28
- likes && (React.createElement(Save, { postId: postId, title: likes.likesCount, hasUserLike: likes.hasUserLike, handleUserLike: likes.handleUserLike, metrikaGoal: metrikaGoals === null || metrikaGoals === void 0 ? void 0 : metrikaGoals.save, theme: theme, qa: qa }))));
30
+ likes && (React.createElement(Save, { postId: postId, title: likes.likesCount, hasUserLike: likes.hasUserLike, handleUserLike: likes.handleUserLike, metrikaGoal: metrikaGoals === null || metrikaGoals === void 0 ? void 0 : metrikaGoals.save, theme: theme, qa: qaAttributes.save }))));
29
31
  };
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- import { PostCardSize } from '../../../models/common';
2
+ import { PostCardSize, QAProps } from '../../../models/common';
3
3
  import '../PostInfo.css';
4
- type DateProps = {
4
+ type DateProps = QAProps & {
5
5
  date: string | number;
6
6
  size?: PostCardSize;
7
7
  id?: string;
8
8
  };
9
- export declare const Date: ({ date, size, id }: DateProps) => React.JSX.Element;
9
+ export declare const Date: ({ date, size, id, qa }: DateProps) => React.JSX.Element;
10
10
  export {};
@@ -5,7 +5,7 @@ import { block } from '../../../utils/cn';
5
5
  import { format } from '../../../utils/date';
6
6
  import '../PostInfo.css';
7
7
  const b = block('post-info');
8
- export const Date = ({ date, size = PostCardSize.SMALL, id }) => {
8
+ export const Date = ({ date, size = PostCardSize.SMALL, id, qa }) => {
9
9
  const { locale } = useContext(LocaleContext);
10
- return (React.createElement("div", { className: b('item', { size }), id: id }, format(date, 'longDate', locale === null || locale === void 0 ? void 0 : locale.code)));
10
+ return (React.createElement("div", { className: b('item', { size }), id: id, "data-qa": qa }, format(date, 'longDate', locale === null || locale === void 0 ? void 0 : locale.code)));
11
11
  };
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
+ import { QAProps } from '../../../models/common';
2
3
  import '../PostInfo.css';
3
- type ReadingTimeProps = {
4
+ type ReadingTimeProps = QAProps & {
4
5
  readingTime: number;
5
6
  size?: 's' | 'm';
6
7
  id?: string;
7
8
  };
8
- export declare const ReadingTime: ({ readingTime, size, id }: ReadingTimeProps) => React.JSX.Element;
9
+ export declare const ReadingTime: ({ readingTime, size, id, qa }: ReadingTimeProps) => React.JSX.Element;
9
10
  export {};
@@ -6,7 +6,7 @@ import { block } from '../../../utils/cn';
6
6
  import '../PostInfo.css';
7
7
  const b = block('post-info');
8
8
  const ICON_SIZE = 16;
9
- export const ReadingTime = ({ readingTime, size = 's', id }) => (React.createElement("div", { className: b('item', { size }), id: id },
9
+ export const ReadingTime = ({ readingTime, size = 's', id, qa }) => (React.createElement("div", { className: b('item', { size }), id: id, "data-qa": qa },
10
10
  React.createElement("span", { className: b('icon') },
11
11
  React.createElement(Icon, { data: Time, size: ICON_SIZE, className: b('icon-color') })),
12
12
  i18(Keyset.ContextReadingTime, { count: readingTime })));
@@ -2,7 +2,7 @@ import React, { useContext } from 'react';
2
2
  import { useAnalytics } from '@gravity-ui/page-constructor';
3
3
  import { Icon } from '@gravity-ui/uikit';
4
4
  import { LikesContext } from '../../../contexts/LikesContext';
5
- import metrika from '../../../counters/metrika.js';
5
+ import metrika from '../../../counters/metrika';
6
6
  import { MetrikaCounter } from '../../../counters/utils';
7
7
  import { Save as SaveIcon } from '../../../icons/Save';
8
8
  import { SaveFilled } from '../../../icons/SaveFilled';
@@ -45,7 +45,7 @@ export const Save = ({ title, postId, hasUserLike, handleUserLike, metrikaGoal,
45
45
  handleUserLike();
46
46
  metrika.reachGoal(MetrikaCounter.CrossSite, metrikaGoal);
47
47
  handleAnalytics();
48
- }, "data-qa": `${qa ? qa + '-' : ''}save` },
48
+ }, "data-qa": qa },
49
49
  React.createElement("div", { className: b('content', { cursor: isLikeable, theme }) },
50
50
  React.createElement("span", { className: b('icon') },
51
51
  React.createElement(Icon, { data: hasUserLike ? SaveFilled : SaveIcon, size: ICON_SIZE, className: b({ filled: Boolean(hasUserLike) }) })),
@@ -4,7 +4,7 @@ import { useAnalytics } from '@gravity-ui/page-constructor';
4
4
  import { MobileContext } from '../../../contexts/MobileContext';
5
5
  import { PostPageContext } from '../../../contexts/PostPageContext';
6
6
  import { RouterContext } from '../../../contexts/RouterContext';
7
- import metrika from '../../../counters/metrika.js';
7
+ import metrika from '../../../counters/metrika';
8
8
  import { MetrikaCounter } from '../../../counters/utils';
9
9
  import { Keyset, i18 } from '../../../i18n';
10
10
  import { ShareArrowUp } from '../../../icons/ShareArrowUp';
@@ -1,14 +1,15 @@
1
1
  import React from 'react';
2
2
  import { ShareOptions } from '@gravity-ui/components';
3
3
  import { PostData } from '../models/common';
4
+ export type LikesRoutineType = {
5
+ handleUserLike: () => void;
6
+ hasUserLike: boolean;
7
+ likesCount: number;
8
+ };
4
9
  export interface PostPageContextProps {
5
10
  post: PostData;
6
11
  suggestedPosts: PostData[];
7
- likes?: {
8
- handleUserLike: () => void;
9
- hasUserLike: boolean;
10
- likesCount: number;
11
- };
12
+ likes?: LikesRoutineType;
12
13
  shareOptions?: ShareOptions[];
13
14
  }
14
15
  export declare const PostPageContext: React.Context<PostPageContextProps>;
@@ -1,62 +1,58 @@
1
- export function initCounters(configs: any): void;
2
- declare namespace _default {
3
- export { hit };
4
- export { params };
5
- export { reachGoal };
6
- export { reachGoals };
7
- export { Goal };
8
- export { getServicePrefix };
9
- export { getMarketPlacePrefix };
10
- export { goalGoToConsole };
11
- export { goalGoToForm };
12
- export { goalGoToDocs };
13
- export { goalFormSubmit };
14
- export { goalEventFormSubmit };
15
- export { goalEventVideoAction };
16
- export { goalCaseFormSubmit };
17
- export { goalSwitchLang };
18
- }
19
- export default _default;
1
+ export declare function initCounters(configs: Record<string, string>[]): void;
20
2
  declare function hit(...args: any[]): void;
21
- declare function params(...args: any[]): void;
22
- declare function reachGoal(counterName: any, ...args: any[]): void;
23
- declare function reachGoals(goals: any, counterName?: string): void;
24
- /**
25
- * @deprecated Metrika will be deleted after launch of analyticsEvents
26
- */
27
- declare const Goal: {
28
- SUPPORT_OPEN_FORM: string;
29
- SUPPORT_STEP_1_SUBMIT: string;
30
- SUPPORT_STEP_2_SUBMIT: string;
31
- SUPPORT_STEP_3_SUBMIT: string;
32
- SUPPORT_THANKYOU_SUBMIT: string;
33
- MP_OPEN_FORM: string;
34
- EDIT_ON_GITHUB: string;
35
- MAIN_GO_TO_VAR: string;
36
- MAIN_GO_TO_ISV: string;
37
- MAIN_ALL_PARTNERS: string;
38
- FIND_GO_TO_VAR: string;
39
- ISV_GO_TO_MP: string;
40
- FOOTER_SUBSCRIBE: string;
41
- FOOTER_MNG_SUBSCRIPTIONS: string;
42
- MOBILE_STORE_IOS: string;
43
- MOBILE_STORE_ANDROID: string;
44
- REGION_POPUP_SHOW: string;
45
- REGION_POPUP_YES: string;
46
- REGION_POPUP_NO: string;
47
- REGION_POPUP_CLOSE: string;
48
- SCALE_REGISTRATION: string;
49
- DLGOTOPRODUCT_MPSITE: string;
50
- MPK8S_CLCK: string;
51
- 'SITE_CALCULATOR_SHARE-RESULT_CLICK': string;
3
+ declare function params(...args: Record<string, any>[]): void;
4
+ declare function reachGoal(counterName: string, ...args: any[]): void;
5
+ declare function reachGoals(goals: string | object, counterName?: string): void;
6
+ declare function getServicePrefix(id: string): "CMPT" | "IAM" | "VPC" | "STRG" | "SK" | "CH" | "MONGO" | "POSTGR" | "MR" | "MMSQL" | "MK" | "TRSL" | "INSTGR" | "LB" | "MQ" | "DL" | "MNTRG" | "DP" | "KMS" | "YDB" | "INTRCNCT" | undefined;
7
+ declare function getMarketPlacePrefix(id: string): string;
8
+ declare function goalGoToConsole(prefix: string): string;
9
+ declare function goalGoToForm(prefix: string): string;
10
+ declare function goalGoToDocs(prefix: string): string;
11
+ declare function goalFormSubmit(prefix: string): string;
12
+ declare function goalEventFormSubmit(id: string): string;
13
+ declare function goalEventVideoAction(id: string, action: string): string;
14
+ declare function goalCaseFormSubmit(id: string): string;
15
+ declare function goalSwitchLang(place: string): string;
16
+ declare const _default: {
17
+ hit: typeof hit;
18
+ params: typeof params;
19
+ reachGoal: typeof reachGoal;
20
+ reachGoals: typeof reachGoals;
21
+ Goal: {
22
+ SUPPORT_OPEN_FORM: string;
23
+ SUPPORT_STEP_1_SUBMIT: string;
24
+ SUPPORT_STEP_2_SUBMIT: string;
25
+ SUPPORT_STEP_3_SUBMIT: string;
26
+ SUPPORT_THANKYOU_SUBMIT: string;
27
+ MP_OPEN_FORM: string;
28
+ EDIT_ON_GITHUB: string;
29
+ MAIN_GO_TO_VAR: string;
30
+ MAIN_GO_TO_ISV: string;
31
+ MAIN_ALL_PARTNERS: string;
32
+ FIND_GO_TO_VAR: string;
33
+ ISV_GO_TO_MP: string;
34
+ FOOTER_SUBSCRIBE: string;
35
+ FOOTER_MNG_SUBSCRIPTIONS: string;
36
+ MOBILE_STORE_IOS: string;
37
+ MOBILE_STORE_ANDROID: string;
38
+ REGION_POPUP_SHOW: string;
39
+ REGION_POPUP_YES: string;
40
+ REGION_POPUP_NO: string;
41
+ REGION_POPUP_CLOSE: string;
42
+ SCALE_REGISTRATION: string;
43
+ DLGOTOPRODUCT_MPSITE: string;
44
+ MPK8S_CLCK: string;
45
+ 'SITE_CALCULATOR_SHARE-RESULT_CLICK': string;
46
+ };
47
+ getServicePrefix: typeof getServicePrefix;
48
+ getMarketPlacePrefix: typeof getMarketPlacePrefix;
49
+ goalGoToConsole: typeof goalGoToConsole;
50
+ goalGoToForm: typeof goalGoToForm;
51
+ goalGoToDocs: typeof goalGoToDocs;
52
+ goalFormSubmit: typeof goalFormSubmit;
53
+ goalEventFormSubmit: typeof goalEventFormSubmit;
54
+ goalEventVideoAction: typeof goalEventVideoAction;
55
+ goalCaseFormSubmit: typeof goalCaseFormSubmit;
56
+ goalSwitchLang: typeof goalSwitchLang;
52
57
  };
53
- declare function getServicePrefix(id: any): "CMPT" | "IAM" | "VPC" | "STRG" | "SK" | "CH" | "MONGO" | "POSTGR" | "MR" | "MMSQL" | "MK" | "TRSL" | "INSTGR" | "LB" | "MQ" | "DL" | "MNTRG" | "DP" | "KMS" | "YDB" | "INTRCNCT" | undefined;
54
- declare function getMarketPlacePrefix(id: any): string;
55
- declare function goalGoToConsole(prefix: any): any;
56
- declare function goalGoToForm(prefix: any): any;
57
- declare function goalGoToDocs(prefix: any): any;
58
- declare function goalFormSubmit(prefix: any): any;
59
- declare function goalEventFormSubmit(id: any): string;
60
- declare function goalEventVideoAction(id: any, action: any): string;
61
- declare function goalCaseFormSubmit(id: any): string;
62
- declare function goalSwitchLang(place: any): string;
58
+ export default _default;
@@ -31,6 +31,7 @@ const HIT_COUNTERS = ['main', 'cross-site', 'scale'];
31
31
  const counterIds = {};
32
32
  function getCounter(name) {
33
33
  const counterId = counterIds[name];
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
35
  return window['yaCounter' + counterId];
35
36
  }
36
37
  export function initCounters(configs) {
@@ -38,6 +39,7 @@ export function initCounters(configs) {
38
39
  counterIds[config.name] = config.id;
39
40
  });
40
41
  }
42
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
43
  function hit(...args) {
42
44
  HIT_COUNTERS.forEach((counterName) => {
43
45
  const counter = getCounter(counterName);
@@ -47,6 +49,7 @@ function hit(...args) {
47
49
  counter.hit(...args);
48
50
  });
49
51
  }
52
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
53
  function params(...args) {
51
54
  const counter = getCounter('main');
52
55
  if (!counter) {
@@ -54,6 +57,7 @@ function params(...args) {
54
57
  }
55
58
  counter.params(...args);
56
59
  }
60
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
61
  function reachGoal(counterName, ...args) {
58
62
  const counter = getCounter(counterName);
59
63
  if (!counter) {
@@ -30,7 +30,7 @@ export type LayoutProps = {
30
30
  export type MediaProps = ClassNameProps & PaddingsYFMProps & Partial<Pick<PCMediaProps, 'youtube' | 'previewImg' | 'image' | 'video' | 'dataLens'>> & {
31
31
  text?: string;
32
32
  };
33
- export type MetaProps = {
33
+ export type MetaProps = QAProps & {
34
34
  locale: string;
35
35
  theme?: TextTheme;
36
36
  } & PaddingsYFMProps;
@@ -24,7 +24,9 @@ export declare const updateContentSizes: ({ size, colSizes, theme, ...contentDat
24
24
  } | Partial<Record<import("@gravity-ui/page-constructor").GridColumnSize, number>>;
25
25
  theme: import("@gravity-ui/page-constructor").ContentTheme;
26
26
  title?: string | import("@gravity-ui/page-constructor").TitleItemBaseProps | undefined;
27
+ titleId?: string | undefined;
27
28
  text?: string | undefined;
29
+ textId?: string | undefined;
28
30
  additionalInfo?: string | undefined;
29
31
  links?: import("@gravity-ui/page-constructor").LinkProps[] | undefined;
30
32
  buttons?: import("@gravity-ui/page-constructor").ButtonProps[] | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/blog-constructor",
3
- "version": "5.9.0",
3
+ "version": "5.11.0",
4
4
  "description": "Gravity UI Blog Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -64,16 +64,8 @@
64
64
  "@gravity-ui/i18n": "^1.1.0",
65
65
  "lodash": "^4.17.21",
66
66
  "react-helmet": "^6.1.0",
67
- "react-player": "^2.9.0",
68
- "react-slick": "^0.29.0",
69
- "react-transition-group": "^4.4.2",
70
- "react-waypoint": "^10.1.0",
71
- "sanitize-html": "^2.6.1",
72
- "snakecase-keys": "^5.1.0",
73
- "typograf": "^6.14.0",
74
67
  "ua-parser-js": "^0.7.28",
75
68
  "url": "^0.11.0",
76
- "url-join": "^5.0.0",
77
69
  "utility-types": "^3.10.0"
78
70
  },
79
71
  "peerDependencies": {
@@ -89,11 +81,11 @@
89
81
  "@commitlint/config-conventional": "^17.4.3",
90
82
  "@doc-tools/transform": "^3.11.0",
91
83
  "@gravity-ui/eslint-config": "^3.1.1",
92
- "@gravity-ui/page-constructor": "^4.31.1",
84
+ "@gravity-ui/page-constructor": "^4.37.2",
93
85
  "@gravity-ui/prettier-config": "^1.1.0",
94
86
  "@gravity-ui/stylelint-config": "^4.0.1",
95
87
  "@gravity-ui/tsconfig": "^1.0.0",
96
- "@gravity-ui/uikit": "^5.18.1",
88
+ "@gravity-ui/uikit": "^5.20.0",
97
89
  "@jest/environment": "^29.7.0",
98
90
  "@storybook/addon-essentials": "^7.0.27",
99
91
  "@storybook/cli": "^7.0.27",
@@ -109,9 +101,6 @@
109
101
  "@types/lodash": "^4.14.176",
110
102
  "@types/react": "^18.0.26",
111
103
  "@types/react-helmet": "^6.1.5",
112
- "@types/react-slick": "^0.23.7",
113
- "@types/react-transition-group": "^4.4.4",
114
- "@types/sanitize-html": "^2.6.0",
115
104
  "@types/ua-parser-js": "^0.7.36",
116
105
  "eslint": "^8.34.0",
117
106
  "eslint-plugin-no-not-accumulator-reassign": "^0.1.0",
@@ -30,7 +30,7 @@ export type LayoutProps = {
30
30
  export type MediaProps = ClassNameProps & PaddingsYFMProps & Partial<Pick<PCMediaProps, 'youtube' | 'previewImg' | 'image' | 'video' | 'dataLens'>> & {
31
31
  text?: string;
32
32
  };
33
- export type MetaProps = {
33
+ export type MetaProps = QAProps & {
34
34
  locale: string;
35
35
  theme?: TextTheme;
36
36
  } & PaddingsYFMProps;