@gravity-ui/blog-constructor 3.4.0 → 4.0.0-alpha.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/CHANGELOG.md +0 -7
- package/build/cjs/blocks/Feed/Feed.js +37 -47
- package/build/cjs/blocks/Feed/reducer.d.ts +5 -0
- package/build/cjs/blocks/Feed/reducer.js +4 -1
- package/build/cjs/blocks/YFM/YFM.js +1 -1
- package/build/cjs/blocks/YFM/__tests__/YFM.test.d.ts +1 -0
- package/build/cjs/blocks/YFM/__tests__/YFM.test.js +16 -0
- package/build/cjs/components/FeedHeader/FeedHeader.js +2 -2
- package/build/cjs/components/FeedHeader/components/Controls/Controls.d.ts +3 -2
- package/build/cjs/components/FeedHeader/components/Controls/Controls.js +16 -24
- package/build/cjs/components/Paginator/Paginator.d.ts +1 -1
- package/build/cjs/components/Paginator/Paginator.js +2 -2
- package/build/cjs/components/Paginator/types.d.ts +1 -0
- package/build/cjs/components/Posts/Posts.css +0 -25
- package/build/cjs/components/Posts/Posts.d.ts +1 -0
- package/build/cjs/components/Posts/Posts.js +4 -5
- package/build/cjs/components/Search/Search.js +1 -1
- package/build/cjs/containers/BlogPostPage/BlogPostPage.css +0 -12
- package/build/cjs/counters/metrika.d.ts +62 -0
- package/build/cjs/counters/metrika.js +173 -0
- package/build/cjs/models/common.d.ts +1 -5
- package/build/cjs/utils/common.d.ts +1 -1
- package/build/cjs/utils/common.js +1 -1
- package/build/esm/blocks/Feed/Feed.js +37 -47
- package/build/esm/blocks/Feed/reducer.d.ts +5 -0
- package/build/esm/blocks/Feed/reducer.js +4 -1
- package/build/esm/blocks/YFM/YFM.js +1 -1
- package/build/esm/blocks/YFM/__tests__/YFM.test.d.ts +1 -0
- package/build/esm/blocks/YFM/__tests__/YFM.test.js +11 -0
- package/build/esm/components/FeedHeader/FeedHeader.js +2 -2
- package/build/esm/components/FeedHeader/components/Controls/Controls.d.ts +3 -2
- package/build/esm/components/FeedHeader/components/Controls/Controls.js +17 -25
- package/build/esm/components/Paginator/Paginator.d.ts +1 -1
- package/build/esm/components/Paginator/Paginator.js +2 -2
- package/build/esm/components/Paginator/types.d.ts +1 -0
- package/build/esm/components/Posts/Posts.css +0 -25
- package/build/esm/components/Posts/Posts.d.ts +1 -0
- package/build/esm/components/Posts/Posts.js +4 -5
- package/build/esm/components/Search/Search.js +1 -1
- package/build/esm/containers/BlogPostPage/BlogPostPage.css +0 -12
- package/build/esm/counters/metrika.d.ts +62 -0
- package/build/esm/counters/metrika.js +169 -0
- package/build/esm/models/common.d.ts +1 -5
- package/build/esm/utils/common.d.ts +1 -1
- package/build/esm/utils/common.js +1 -1
- package/package.json +5 -2
- package/server/data/sanitizeMeta.d.ts +0 -2
- package/server/data/sanitizeMeta.js +0 -2
- package/server/data/transformPageContent.js +16 -3
- package/server/models/common.d.ts +1 -5
@@ -8,9 +8,8 @@ import { PostCard } from '../PostCard/PostCard';
|
|
8
8
|
import { PostsEmpty } from '../PostsEmpty/PostsEmpty';
|
9
9
|
import './Posts.css';
|
10
10
|
const b = block('posts');
|
11
|
-
export const Posts = ({ containerId, pinnedPostOnPage, currentPage, postsOnPage, isShowMoreVisible, errorShowMore, postCountOnPage, perPageInQuery, isFetching, handleShowMore, handlePageChange, pageCountForShowSupportButtons, }) => (React.createElement("div", { className: b() },
|
12
|
-
|
13
|
-
React.createElement("div", { id: containerId, className: b('cards-container', { isLoading: isFetching }) },
|
11
|
+
export const Posts = ({ containerId, pinnedPostOnPage, currentPage, postsOnPage, isShowMoreVisible, errorShowMore, postCountOnPage, perPageInQuery, isFetching, isShowMoreFetching, handleShowMore, handlePageChange, pageCountForShowSupportButtons, }) => (React.createElement("div", { className: b() },
|
12
|
+
React.createElement("div", { id: containerId, className: b('cards-container') },
|
14
13
|
pinnedPostOnPage && currentPage === 1 && (React.createElement("div", { className: b('pinned-container') },
|
15
14
|
React.createElement(PostCard, { post: pinnedPostOnPage, size: "m", fullWidth: true, showTag: true }))),
|
16
15
|
(postsOnPage === null || postsOnPage === void 0 ? void 0 : postsOnPage.length) ? (React.createElement(CardLayoutBlock, { title: '', colSizes: {
|
@@ -19,9 +18,9 @@ export const Posts = ({ containerId, pinnedPostOnPage, currentPage, postsOnPage,
|
|
19
18
|
md: 6,
|
20
19
|
} }, postsOnPage === null || postsOnPage === void 0 ? void 0 : postsOnPage.map((post) => (React.createElement(PostCard, { key: post.id, post: post, showTag: true }))))) : (React.createElement(PostsEmpty, null))),
|
21
20
|
React.createElement("div", { className: b('pagination') },
|
22
|
-
Boolean(isShowMoreVisible && (postsOnPage === null || postsOnPage === void 0 ? void 0 : postsOnPage.length)) && (React.createElement(Button, { view: "outlined", size: "xl", className: b('more-button'), onClick: handleShowMore }, i18(Keyset.ActionLoadMore))),
|
21
|
+
Boolean(isShowMoreVisible && (postsOnPage === null || postsOnPage === void 0 ? void 0 : postsOnPage.length)) && (React.createElement(Button, { view: "outlined", size: "xl", className: b('more-button'), onClick: handleShowMore, loading: isShowMoreFetching }, i18(Keyset.ActionLoadMore))),
|
23
22
|
errorShowMore && (React.createElement("div", { className: b('error-show-more') },
|
24
23
|
React.createElement("div", null, i18(Keyset.ErrorTitle)),
|
25
24
|
React.createElement("div", null, i18(Keyset.PostLoadError)))),
|
26
25
|
Boolean(currentPage && postCountOnPage) && (React.createElement("div", { className: b('paginator') },
|
27
|
-
React.createElement(Paginator, { onPageChange: handlePageChange, page: currentPage, totalItems: postCountOnPage, itemsPerPage: perPageInQuery, maxPages: Infinity, pageCountForShowSupportButtons: pageCountForShowSupportButtons }))))));
|
26
|
+
React.createElement(Paginator, { onPageChange: handlePageChange, page: currentPage, totalItems: postCountOnPage, itemsPerPage: perPageInQuery, loading: isFetching, maxPages: Infinity, pageCountForShowSupportButtons: pageCountForShowSupportButtons }))))));
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
2
|
-
import { TextInput } from '@gravity-ui/uikit';
|
3
2
|
import { debounce as lodashDebounce } from 'lodash';
|
3
|
+
import { TextInput } from '@gravity-ui/uikit';
|
4
4
|
import { useIsIPhone } from '../../hooks/useIsIPhone';
|
5
5
|
import { Keyset, i18 } from '../../i18n';
|
6
6
|
import { Close } from '../../icons/Close';
|
@@ -173,18 +173,6 @@ unpredictable css rules order in build */
|
|
173
173
|
.yfm_constructor_theme_dark p {
|
174
174
|
color: var(--yc-color-text-light-primary);
|
175
175
|
}
|
176
|
-
.yfm_constructor_footnote_text p, .yfm_constructor_footnote_page p {
|
177
|
-
opacity: 0.5;
|
178
|
-
}
|
179
|
-
.yfm_constructor_footnote_text p {
|
180
|
-
font-size: var(--yc-text-body-2-font-size);
|
181
|
-
line-height: var(--yc-text-body-2-line-height);
|
182
|
-
}
|
183
|
-
.yfm_constructor_footnote_page p {
|
184
|
-
font-size: var(--yc-text-body-1-font-size);
|
185
|
-
line-height: var(--yc-text-body-1-line-height);
|
186
|
-
display: inline;
|
187
|
-
}
|
188
176
|
.yfm_constructor_list_style ul {
|
189
177
|
padding-left: 20px;
|
190
178
|
}
|
@@ -0,0 +1,62 @@
|
|
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;
|
20
|
+
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;
|
52
|
+
};
|
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;
|
@@ -0,0 +1,169 @@
|
|
1
|
+
/**
|
2
|
+
* @deprecated Metrika will be deleted after launch of analyticsEvents
|
3
|
+
*/
|
4
|
+
const Goal = {
|
5
|
+
SUPPORT_OPEN_FORM: 'SUPPORTOPENFORM',
|
6
|
+
SUPPORT_STEP_1_SUBMIT: 'SUPPORTSTEP1SUBMIT',
|
7
|
+
SUPPORT_STEP_2_SUBMIT: 'SUPPORTSTEP2SUBMIT',
|
8
|
+
SUPPORT_STEP_3_SUBMIT: 'SUPPORTSTEP3SUBMIT',
|
9
|
+
SUPPORT_THANKYOU_SUBMIT: 'SUPPORTTHANKYOUSUBMIT',
|
10
|
+
MP_OPEN_FORM: 'MPOPENFORM',
|
11
|
+
EDIT_ON_GITHUB: 'EDITONGITHUB',
|
12
|
+
MAIN_GO_TO_VAR: 'MAINGOTOVAR',
|
13
|
+
MAIN_GO_TO_ISV: 'MAINGOTOISV',
|
14
|
+
MAIN_ALL_PARTNERS: 'MAINALLPARTNERS',
|
15
|
+
FIND_GO_TO_VAR: 'FINDGOTOVAR',
|
16
|
+
ISV_GO_TO_MP: 'ISVGOTOMP',
|
17
|
+
FOOTER_SUBSCRIBE: 'FOOTERSUBSCRIBE',
|
18
|
+
FOOTER_MNG_SUBSCRIPTIONS: 'FOOTERMNGSUBSCRIPTIONS',
|
19
|
+
MOBILE_STORE_IOS: '154_Mobile_App_Store_Badge',
|
20
|
+
MOBILE_STORE_ANDROID: '155_Mobile_Google_Play_Badge',
|
21
|
+
REGION_POPUP_SHOW: 'REGIONPOPUP',
|
22
|
+
REGION_POPUP_YES: 'REGIONPOPUPYES',
|
23
|
+
REGION_POPUP_NO: 'REGIONPOPUPNO',
|
24
|
+
REGION_POPUP_CLOSE: 'REGIONPOPUPCLOSE',
|
25
|
+
SCALE_REGISTRATION: 'Scale_registration',
|
26
|
+
DLGOTOPRODUCT_MPSITE: 'DLGOTOPRODUCT_MPSITE',
|
27
|
+
MPK8S_CLCK: 'MPK8S_CLCK',
|
28
|
+
'SITE_CALCULATOR_SHARE-RESULT_CLICK': 'SITE_CALCULATOR_SHARE-RESULT_CLICK',
|
29
|
+
};
|
30
|
+
const HIT_COUNTERS = ['main', 'cross-site', 'scale'];
|
31
|
+
const counterIds = {};
|
32
|
+
function getCounter(name) {
|
33
|
+
const counterId = counterIds[name];
|
34
|
+
return window['yaCounter' + counterId];
|
35
|
+
}
|
36
|
+
export function initCounters(configs) {
|
37
|
+
configs.forEach((config) => {
|
38
|
+
counterIds[config.name] = config.id;
|
39
|
+
});
|
40
|
+
}
|
41
|
+
function hit(...args) {
|
42
|
+
HIT_COUNTERS.forEach((counterName) => {
|
43
|
+
const counter = getCounter(counterName);
|
44
|
+
if (!counter) {
|
45
|
+
return;
|
46
|
+
}
|
47
|
+
counter.hit(...args);
|
48
|
+
});
|
49
|
+
}
|
50
|
+
function params(...args) {
|
51
|
+
const counter = getCounter('main');
|
52
|
+
if (!counter) {
|
53
|
+
return;
|
54
|
+
}
|
55
|
+
counter.params(...args);
|
56
|
+
}
|
57
|
+
function reachGoal(counterName, ...args) {
|
58
|
+
const counter = getCounter(counterName);
|
59
|
+
if (!counter) {
|
60
|
+
return;
|
61
|
+
}
|
62
|
+
counter.reachGoal(...args);
|
63
|
+
}
|
64
|
+
function reachGoals(goals, counterName = 'main') {
|
65
|
+
if (!goals) {
|
66
|
+
return;
|
67
|
+
}
|
68
|
+
const goalsArray = Array.isArray(goals) ? goals : [goals];
|
69
|
+
goalsArray.forEach((goal) => {
|
70
|
+
if (typeof goal === 'object') {
|
71
|
+
reachGoal(counterName, goal.name, goal.params);
|
72
|
+
}
|
73
|
+
else {
|
74
|
+
reachGoal(counterName, goal);
|
75
|
+
}
|
76
|
+
});
|
77
|
+
}
|
78
|
+
// eslint-disable-next-line complexity
|
79
|
+
function getServicePrefix(id) {
|
80
|
+
switch (id) {
|
81
|
+
case 'compute':
|
82
|
+
return 'CMPT';
|
83
|
+
case 'iam':
|
84
|
+
return 'IAM';
|
85
|
+
case 'vpc':
|
86
|
+
return 'VPC';
|
87
|
+
case 'storage':
|
88
|
+
return 'STRG';
|
89
|
+
case 'speechkit':
|
90
|
+
return 'SK';
|
91
|
+
case 'managed-clickhouse':
|
92
|
+
return 'CH';
|
93
|
+
case 'managed-mongodb':
|
94
|
+
return 'MONGO';
|
95
|
+
case 'managed-postgresql':
|
96
|
+
return 'POSTGR';
|
97
|
+
case 'managed-redis':
|
98
|
+
return 'MR';
|
99
|
+
case 'managed-mysql':
|
100
|
+
return 'MMSQL';
|
101
|
+
case 'managed-kubernetes':
|
102
|
+
return 'MK';
|
103
|
+
case 'translate':
|
104
|
+
return 'TRSL';
|
105
|
+
case 'instance-groups':
|
106
|
+
return 'INSTGR';
|
107
|
+
case 'load-balancer':
|
108
|
+
return 'LB';
|
109
|
+
case 'message-queue':
|
110
|
+
return 'MQ';
|
111
|
+
case 'datalens':
|
112
|
+
return 'DL';
|
113
|
+
case 'monitoring':
|
114
|
+
return 'MNTRG';
|
115
|
+
case 'data-proc':
|
116
|
+
return 'DP';
|
117
|
+
case 'kms':
|
118
|
+
return 'KMS';
|
119
|
+
case 'ydb':
|
120
|
+
return 'YDB';
|
121
|
+
case 'interconnect':
|
122
|
+
return 'INTRCNCT';
|
123
|
+
}
|
124
|
+
return undefined;
|
125
|
+
}
|
126
|
+
function getMarketPlacePrefix(id) {
|
127
|
+
return `product_${id}_`;
|
128
|
+
}
|
129
|
+
function goalGoToConsole(prefix) {
|
130
|
+
return prefix && `${prefix}GOTOCONSOLE`;
|
131
|
+
}
|
132
|
+
function goalGoToForm(prefix) {
|
133
|
+
return prefix && `${prefix}GOTOFORM`;
|
134
|
+
}
|
135
|
+
function goalGoToDocs(prefix) {
|
136
|
+
return prefix && `${prefix}GOTODOCS`;
|
137
|
+
}
|
138
|
+
function goalFormSubmit(prefix) {
|
139
|
+
return prefix && `${prefix}FORMSUBMIT`;
|
140
|
+
}
|
141
|
+
function goalEventFormSubmit(id) {
|
142
|
+
return `event${id || 's'}_form_submit`;
|
143
|
+
}
|
144
|
+
function goalEventVideoAction(id, action) {
|
145
|
+
return `event${id}_video_${action}`;
|
146
|
+
}
|
147
|
+
function goalCaseFormSubmit(id) {
|
148
|
+
return `case${id ? `_${id}` : 's'}_form_submit`;
|
149
|
+
}
|
150
|
+
function goalSwitchLang(place) {
|
151
|
+
return `SWITCH_LANG_${place}`;
|
152
|
+
}
|
153
|
+
export default {
|
154
|
+
hit,
|
155
|
+
params,
|
156
|
+
reachGoal,
|
157
|
+
reachGoals,
|
158
|
+
Goal,
|
159
|
+
getServicePrefix,
|
160
|
+
getMarketPlacePrefix,
|
161
|
+
goalGoToConsole,
|
162
|
+
goalGoToForm,
|
163
|
+
goalGoToDocs,
|
164
|
+
goalFormSubmit,
|
165
|
+
goalEventFormSubmit,
|
166
|
+
goalEventVideoAction,
|
167
|
+
goalCaseFormSubmit,
|
168
|
+
goalSwitchLang,
|
169
|
+
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
-
import { HeaderBlockProps as PageConstructorHeaderBlockProps } from '@gravity-ui/page-constructor';
|
3
2
|
import { IBrowser, IDevice } from 'ua-parser-js';
|
3
|
+
import { HeaderBlockProps as PageConstructorHeaderBlockProps } from '@gravity-ui/page-constructor';
|
4
4
|
import { Locale } from '../models/locale';
|
5
5
|
export declare enum Theme {
|
6
6
|
Light = "light",
|
@@ -161,7 +161,3 @@ export declare enum DefaultEventNames {
|
|
161
161
|
Service = "selector-service-click",
|
162
162
|
SaveOnly = "save-only-button-click"
|
163
163
|
}
|
164
|
-
export type FetchArgs = {
|
165
|
-
page?: number;
|
166
|
-
query: Query;
|
167
|
-
};
|
@@ -23,7 +23,7 @@ export declare const updateContentSizes: ({ size, colSizes, theme, ...contentDat
|
|
23
23
|
md: number;
|
24
24
|
} | Partial<Record<import("@gravity-ui/page-constructor").GridColumnSize, number>>;
|
25
25
|
theme: import("@gravity-ui/page-constructor").ContentTheme;
|
26
|
-
title?: string | import("@gravity-ui/page-constructor").
|
26
|
+
title?: string | import("@gravity-ui/page-constructor").TitleItemBaseProps | undefined;
|
27
27
|
text?: string | undefined;
|
28
28
|
additionalInfo?: string | undefined;
|
29
29
|
links?: import("@gravity-ui/page-constructor").LinkProps[] | undefined;
|
@@ -10,8 +10,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
10
10
|
return t;
|
11
11
|
};
|
12
12
|
import { format, parse } from 'url';
|
13
|
-
import { isNewMetrikaFormat, } from '@gravity-ui/page-constructor';
|
14
13
|
import { debounce, memoize } from 'lodash';
|
14
|
+
import { isNewMetrikaFormat, } from '@gravity-ui/page-constructor';
|
15
15
|
import { CONTENT_DEFAULT_COL_SIZES, CONTENT_DEFAULT_SIZE, CONTENT_DEFAULT_THEME, DEFAULT_PAGE, DEFAULT_ROWS_PER_PAGE, } from '../blocks/constants';
|
16
16
|
import { Keyset, i18 } from '../i18n';
|
17
17
|
export function getAbsolutePath(router, url) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@gravity-ui/blog-constructor",
|
3
|
-
"version": "
|
3
|
+
"version": "4.0.0-alpha.0",
|
4
4
|
"description": "Gravity UI Blog Constructor",
|
5
5
|
"license": "MIT",
|
6
6
|
"repository": {
|
@@ -73,7 +73,7 @@
|
|
73
73
|
"@commitlint/config-conventional": "^17.4.3",
|
74
74
|
"@doc-tools/transform": "^2.9.0",
|
75
75
|
"@gravity-ui/eslint-config": "^2.0.0",
|
76
|
-
"@gravity-ui/page-constructor": "^
|
76
|
+
"@gravity-ui/page-constructor": "^3.0.0-alpha.5",
|
77
77
|
"@gravity-ui/prettier-config": "^1.0.1",
|
78
78
|
"@gravity-ui/stylelint-config": "^1.0.0",
|
79
79
|
"@gravity-ui/tsconfig": "^1.0.0",
|
@@ -141,5 +141,8 @@
|
|
141
141
|
"*.{json,yaml,yml,md}": [
|
142
142
|
"prettier --write"
|
143
143
|
]
|
144
|
+
},
|
145
|
+
"publishConfig": {
|
146
|
+
"tag": "alpha"
|
144
147
|
}
|
145
148
|
}
|
@@ -4,8 +4,6 @@ exports.sanitizeMeta = void 0;
|
|
4
4
|
const server_1 = require("@gravity-ui/page-constructor/server");
|
5
5
|
/**
|
6
6
|
* Function for sanitized meta-data fields
|
7
|
-
* @param metaData PostMetaProps
|
8
|
-
* @returns metaData
|
9
7
|
*/
|
10
8
|
const sanitizeMeta = (metaData) => {
|
11
9
|
const { title, description, date, image, canonicalUrl, organization } = metaData;
|
@@ -4,11 +4,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.transformPageContent = void 0;
|
7
|
-
const server_1 = require("@gravity-ui/page-constructor/server");
|
8
7
|
const js_yaml_1 = __importDefault(require("js-yaml"));
|
8
|
+
const server_1 = require("@gravity-ui/page-constructor/server");
|
9
9
|
const config_1 = require("./config");
|
10
10
|
const contentFilter_1 = require("./contentFilter");
|
11
|
-
const
|
11
|
+
const transformer = ({ blocks, lang, typographyConfig }) => (0, server_1.contentTransformer)({
|
12
|
+
content: {
|
13
|
+
blocks: blocks || [],
|
14
|
+
},
|
15
|
+
options: {
|
16
|
+
lang,
|
17
|
+
customConfig: Object.assign(Object.assign({}, typographyConfig), (0, config_1.getExtendTypographyConfig)()),
|
18
|
+
},
|
19
|
+
});
|
12
20
|
/**
|
13
21
|
* Func for transform blog page content
|
14
22
|
*
|
@@ -22,7 +30,12 @@ const transformPageContent = ({ content, lang, region, typographyConfig = {}, })
|
|
22
30
|
try {
|
23
31
|
const transformedContent = (0, contentFilter_1.filterContent)(js_yaml_1.default.load(content), { lang, region });
|
24
32
|
if (transformedContent.blocks) {
|
25
|
-
|
33
|
+
const { blocks: transformedBlocks } = transformer({
|
34
|
+
blocks: transformedContent.blocks,
|
35
|
+
lang,
|
36
|
+
typographyConfig,
|
37
|
+
});
|
38
|
+
transformedContent.blocks = transformedBlocks;
|
26
39
|
}
|
27
40
|
return transformedContent;
|
28
41
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
-
import { HeaderBlockProps as PageConstructorHeaderBlockProps } from '@gravity-ui/page-constructor';
|
3
2
|
import { IBrowser, IDevice } from 'ua-parser-js';
|
3
|
+
import { HeaderBlockProps as PageConstructorHeaderBlockProps } from '@gravity-ui/page-constructor';
|
4
4
|
import { Locale } from '../models/locale';
|
5
5
|
export declare enum Theme {
|
6
6
|
Light = "light",
|
@@ -161,7 +161,3 @@ export declare enum DefaultEventNames {
|
|
161
161
|
Service = "selector-service-click",
|
162
162
|
SaveOnly = "save-only-button-click"
|
163
163
|
}
|
164
|
-
export type FetchArgs = {
|
165
|
-
page?: number;
|
166
|
-
query: Query;
|
167
|
-
};
|