@gravity-ui/blog-constructor 4.0.0-alpha.0 → 4.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/CHANGELOG.md +32 -0
- package/build/cjs/blocks/Feed/Feed.js +47 -37
- package/build/cjs/blocks/Feed/reducer.d.ts +0 -5
- package/build/cjs/blocks/Feed/reducer.js +1 -4
- package/build/cjs/blocks/Header/schema.d.ts +81 -0
- package/build/cjs/blocks/Media/schema.d.ts +81 -0
- package/build/cjs/blocks/YFM/YFM.js +1 -1
- package/build/cjs/components/FeedHeader/FeedHeader.js +2 -2
- package/build/cjs/components/FeedHeader/components/Controls/Controls.d.ts +2 -3
- package/build/cjs/components/FeedHeader/components/Controls/Controls.js +24 -16
- 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 +0 -1
- package/build/cjs/components/Posts/Posts.css +25 -0
- package/build/cjs/components/Posts/Posts.d.ts +0 -1
- package/build/cjs/components/Posts/Posts.js +5 -4
- package/build/cjs/components/Search/Search.js +1 -1
- package/build/cjs/models/common.d.ts +5 -1
- package/build/cjs/schema/index.d.ts +162 -0
- package/build/cjs/utils/common.js +1 -1
- package/build/esm/blocks/Feed/Feed.js +47 -37
- package/build/esm/blocks/Feed/reducer.d.ts +0 -5
- package/build/esm/blocks/Feed/reducer.js +1 -4
- package/build/esm/blocks/Header/schema.d.ts +81 -0
- package/build/esm/blocks/Media/schema.d.ts +81 -0
- package/build/esm/blocks/YFM/YFM.js +1 -1
- package/build/esm/components/FeedHeader/FeedHeader.js +2 -2
- package/build/esm/components/FeedHeader/components/Controls/Controls.d.ts +2 -3
- package/build/esm/components/FeedHeader/components/Controls/Controls.js +25 -17
- 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 +0 -1
- package/build/esm/components/Posts/Posts.css +25 -0
- package/build/esm/components/Posts/Posts.d.ts +0 -1
- package/build/esm/components/Posts/Posts.js +5 -4
- package/build/esm/components/Search/Search.js +1 -1
- package/build/esm/models/common.d.ts +5 -1
- package/build/esm/schema/index.d.ts +162 -0
- package/build/esm/utils/common.js +1 -1
- package/package.json +2 -5
- package/server/data/sanitizeMeta.d.ts +2 -0
- package/server/data/sanitizeMeta.js +2 -0
- package/server/data/transformPageContent.js +1 -1
- package/server/models/common.d.ts +5 -1
- package/build/cjs/blocks/YFM/__tests__/YFM.test.d.ts +0 -1
- package/build/cjs/blocks/YFM/__tests__/YFM.test.js +0 -16
- package/build/esm/blocks/YFM/__tests__/YFM.test.d.ts +0 -1
- package/build/esm/blocks/YFM/__tests__/YFM.test.js +0 -11
@@ -25,8 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
26
|
exports.Search = void 0;
|
27
27
|
const react_1 = __importStar(require("react"));
|
28
|
-
const lodash_1 = require("lodash");
|
29
28
|
const uikit_1 = require("@gravity-ui/uikit");
|
29
|
+
const lodash_1 = require("lodash");
|
30
30
|
const useIsIPhone_1 = require("../../hooks/useIsIPhone");
|
31
31
|
const i18n_1 = require("../../i18n");
|
32
32
|
const Close_1 = require("../../icons/Close");
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
-
import { IBrowser, IDevice } from 'ua-parser-js';
|
3
2
|
import { HeaderBlockProps as PageConstructorHeaderBlockProps } from '@gravity-ui/page-constructor';
|
3
|
+
import { IBrowser, IDevice } from 'ua-parser-js';
|
4
4
|
import { Locale } from '../models/locale';
|
5
5
|
export declare enum Theme {
|
6
6
|
Light = "light",
|
@@ -161,3 +161,7 @@ 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
|
+
};
|
@@ -295,6 +295,87 @@ export declare const schemasForCustom: {
|
|
295
295
|
type: string;
|
296
296
|
})[];
|
297
297
|
};
|
298
|
+
fullscreen: {
|
299
|
+
type: string;
|
300
|
+
};
|
301
|
+
analyticsEvents: {
|
302
|
+
anyOf: ({
|
303
|
+
type: string;
|
304
|
+
additionalProperties: {
|
305
|
+
type: string;
|
306
|
+
};
|
307
|
+
required: string[];
|
308
|
+
properties: {
|
309
|
+
name: {
|
310
|
+
type: string;
|
311
|
+
};
|
312
|
+
type: {
|
313
|
+
type: string;
|
314
|
+
};
|
315
|
+
counters: {
|
316
|
+
type: string;
|
317
|
+
additionalProperties: boolean;
|
318
|
+
required: never[];
|
319
|
+
properties: {
|
320
|
+
include: {
|
321
|
+
type: string;
|
322
|
+
items: {
|
323
|
+
type: string;
|
324
|
+
};
|
325
|
+
};
|
326
|
+
exclude: {
|
327
|
+
type: string;
|
328
|
+
items: {
|
329
|
+
type: string;
|
330
|
+
};
|
331
|
+
};
|
332
|
+
};
|
333
|
+
};
|
334
|
+
context: {
|
335
|
+
type: string;
|
336
|
+
};
|
337
|
+
};
|
338
|
+
} | {
|
339
|
+
type: string;
|
340
|
+
items: {
|
341
|
+
type: string;
|
342
|
+
additionalProperties: {
|
343
|
+
type: string;
|
344
|
+
};
|
345
|
+
required: string[];
|
346
|
+
properties: {
|
347
|
+
name: {
|
348
|
+
type: string;
|
349
|
+
};
|
350
|
+
type: {
|
351
|
+
type: string;
|
352
|
+
};
|
353
|
+
counters: {
|
354
|
+
type: string;
|
355
|
+
additionalProperties: boolean;
|
356
|
+
required: never[];
|
357
|
+
properties: {
|
358
|
+
include: {
|
359
|
+
type: string;
|
360
|
+
items: {
|
361
|
+
type: string;
|
362
|
+
};
|
363
|
+
};
|
364
|
+
exclude: {
|
365
|
+
type: string;
|
366
|
+
items: {
|
367
|
+
type: string;
|
368
|
+
};
|
369
|
+
};
|
370
|
+
};
|
371
|
+
};
|
372
|
+
context: {
|
373
|
+
type: string;
|
374
|
+
};
|
375
|
+
};
|
376
|
+
};
|
377
|
+
})[];
|
378
|
+
};
|
298
379
|
};
|
299
380
|
} | {
|
300
381
|
type: string;
|
@@ -1088,6 +1169,87 @@ export declare const schemasForCustom: {
|
|
1088
1169
|
type: string;
|
1089
1170
|
})[];
|
1090
1171
|
};
|
1172
|
+
fullscreen: {
|
1173
|
+
type: string;
|
1174
|
+
};
|
1175
|
+
analyticsEvents: {
|
1176
|
+
anyOf: ({
|
1177
|
+
type: string;
|
1178
|
+
additionalProperties: {
|
1179
|
+
type: string;
|
1180
|
+
};
|
1181
|
+
required: string[];
|
1182
|
+
properties: {
|
1183
|
+
name: {
|
1184
|
+
type: string;
|
1185
|
+
};
|
1186
|
+
type: {
|
1187
|
+
type: string;
|
1188
|
+
};
|
1189
|
+
counters: {
|
1190
|
+
type: string;
|
1191
|
+
additionalProperties: boolean;
|
1192
|
+
required: never[];
|
1193
|
+
properties: {
|
1194
|
+
include: {
|
1195
|
+
type: string;
|
1196
|
+
items: {
|
1197
|
+
type: string;
|
1198
|
+
};
|
1199
|
+
};
|
1200
|
+
exclude: {
|
1201
|
+
type: string;
|
1202
|
+
items: {
|
1203
|
+
type: string;
|
1204
|
+
};
|
1205
|
+
};
|
1206
|
+
};
|
1207
|
+
};
|
1208
|
+
context: {
|
1209
|
+
type: string;
|
1210
|
+
};
|
1211
|
+
};
|
1212
|
+
} | {
|
1213
|
+
type: string;
|
1214
|
+
items: {
|
1215
|
+
type: string;
|
1216
|
+
additionalProperties: {
|
1217
|
+
type: string;
|
1218
|
+
};
|
1219
|
+
required: string[];
|
1220
|
+
properties: {
|
1221
|
+
name: {
|
1222
|
+
type: string;
|
1223
|
+
};
|
1224
|
+
type: {
|
1225
|
+
type: string;
|
1226
|
+
};
|
1227
|
+
counters: {
|
1228
|
+
type: string;
|
1229
|
+
additionalProperties: boolean;
|
1230
|
+
required: never[];
|
1231
|
+
properties: {
|
1232
|
+
include: {
|
1233
|
+
type: string;
|
1234
|
+
items: {
|
1235
|
+
type: string;
|
1236
|
+
};
|
1237
|
+
};
|
1238
|
+
exclude: {
|
1239
|
+
type: string;
|
1240
|
+
items: {
|
1241
|
+
type: string;
|
1242
|
+
};
|
1243
|
+
};
|
1244
|
+
};
|
1245
|
+
};
|
1246
|
+
context: {
|
1247
|
+
type: string;
|
1248
|
+
};
|
1249
|
+
};
|
1250
|
+
};
|
1251
|
+
})[];
|
1252
|
+
};
|
1091
1253
|
paddingTop: {
|
1092
1254
|
type: string;
|
1093
1255
|
enum: string[];
|
@@ -13,8 +13,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
14
14
|
exports.scrollOnPageChange = exports.getFeedQueryParams = exports.getBlogElementMetrika = exports.isMetrikaExist = exports.getBreadcrumbs = exports.getBlogPath = exports.updateContentSizes = exports.getTagFilterUrl = exports.postLikeStatus = exports.getTags = exports.scrollToHash = exports.getPageSearchParams = exports.getAbsolutePath = void 0;
|
15
15
|
const url_1 = require("url");
|
16
|
-
const lodash_1 = require("lodash");
|
17
16
|
const page_constructor_1 = require("@gravity-ui/page-constructor");
|
17
|
+
const lodash_1 = require("lodash");
|
18
18
|
const constants_1 = require("../blocks/constants");
|
19
19
|
const i18n_1 = require("../i18n");
|
20
20
|
function getAbsolutePath(router, url) {
|
@@ -27,11 +27,10 @@ export const Feed = ({ image }) => {
|
|
27
27
|
const { posts, totalCount, tags, services, pinnedPost, getPosts, pageCountForShowSupportButtons, } = useContext(FeedContext);
|
28
28
|
const router = useContext(RouterContext);
|
29
29
|
const handleAnalytics = useAnalytics(DefaultEventNames.ShowMore);
|
30
|
-
const [{ errorLoad, errorShowMore, isFetching,
|
30
|
+
const [{ errorLoad, errorShowMore, isFetching, isShowMoreVisible, lastLoadedCount, postCountOnPage, postsOnPage, pinnedPostOnPage, currentPage, queryParams, }, dispatch,] = useReducer(reducer, {
|
31
31
|
errorLoad: false,
|
32
32
|
errorShowMore: false,
|
33
33
|
isFetching: false,
|
34
|
-
isShowMoreFetching: false,
|
35
34
|
isShowMoreVisible: true,
|
36
35
|
lastLoadedCount: (posts === null || posts === void 0 ? void 0 : posts.length) || 0,
|
37
36
|
postCountOnPage: totalCount || 0,
|
@@ -46,36 +45,36 @@ export const Feed = ({ image }) => {
|
|
46
45
|
const pageChange = (value) => {
|
47
46
|
dispatch({ type: ActionTypes.PageChange, payload: value });
|
48
47
|
};
|
49
|
-
const
|
50
|
-
dispatch({ type: ActionTypes.
|
51
|
-
const hasFirstPageQuery = Object.keys(value).some((queryKey) => queryKey === PAGE_QUERY && value[queryKey] === FIRST_PAGE);
|
52
|
-
if (hasFirstPageQuery) {
|
53
|
-
// eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
|
54
|
-
value[PAGE_QUERY] = null;
|
55
|
-
}
|
56
|
-
router.updateQueryCallback(value);
|
48
|
+
const setIsFetching = (value) => {
|
49
|
+
dispatch({ type: ActionTypes.SetIsFetching, payload: value });
|
57
50
|
};
|
58
|
-
const
|
59
|
-
|
60
|
-
handleChangeQueryParams({ page: value });
|
51
|
+
const setErrorLoad = (value) => {
|
52
|
+
dispatch({ type: ActionTypes.SetErrorLoad, payload: value });
|
61
53
|
};
|
62
|
-
const
|
63
|
-
|
64
|
-
|
65
|
-
|
54
|
+
const handleChangeQueryParams = useCallback((value) => {
|
55
|
+
dispatch({ type: ActionTypes.QueryParamsChange, payload: value });
|
56
|
+
const hasFirstPageQuery = Object.keys(value).some((queryKey) => queryKey === PAGE_QUERY && value[queryKey] === FIRST_PAGE);
|
57
|
+
const result = hasFirstPageQuery
|
58
|
+
? Object.assign(Object.assign({}, value), { [PAGE_QUERY]: null }) : Object.assign({}, value);
|
59
|
+
router.updateQueryCallback(result);
|
60
|
+
}, [router]);
|
61
|
+
const fetchData = useCallback(async ({ page, query }) => {
|
62
|
+
if (query && getPosts) {
|
63
|
+
const queryParamsForRequest = getFeedQueryParams(Object.assign(Object.assign({}, queryParams), query), page);
|
64
|
+
const data = await getPosts(queryParamsForRequest);
|
66
65
|
return data;
|
67
66
|
}
|
68
67
|
else {
|
69
68
|
throw new Error('cant get request');
|
70
69
|
}
|
71
70
|
}, [getPosts, queryParams]);
|
72
|
-
const
|
73
|
-
|
74
|
-
|
75
|
-
const fetchAndReplaceData = useCallback(async (pageNumber) => {
|
71
|
+
const handleLoad = useCallback(async ({ page, query }) => {
|
72
|
+
const pageNumber = Number(page || queryParams.page || DEFAULT_PAGE);
|
73
|
+
handleChangeQueryParams(query);
|
76
74
|
try {
|
77
|
-
|
78
|
-
|
75
|
+
setErrorLoad(false);
|
76
|
+
setIsFetching(true);
|
77
|
+
const fetchedData = await fetchData({ page: pageNumber, query });
|
79
78
|
if (fetchedData) {
|
80
79
|
dispatch({
|
81
80
|
type: ActionTypes.SetPosts,
|
@@ -89,22 +88,35 @@ export const Feed = ({ image }) => {
|
|
89
88
|
}
|
90
89
|
}
|
91
90
|
catch (err) {
|
92
|
-
|
91
|
+
setErrorLoad(true);
|
93
92
|
}
|
94
93
|
scrollOnPageChange(CONTAINER_ID);
|
95
94
|
setIsFetching(false);
|
96
|
-
}, [fetchData]);
|
95
|
+
}, [fetchData, handleChangeQueryParams, queryParams]);
|
96
|
+
const handlePageChange = async (value) => {
|
97
|
+
pageChange(value);
|
98
|
+
handleLoad({
|
99
|
+
page: value,
|
100
|
+
query: Object.assign(Object.assign({}, queryParams), { page: value }),
|
101
|
+
});
|
102
|
+
};
|
97
103
|
const handleShowMore = async () => {
|
98
|
-
dispatch({ type: ActionTypes.SetIsShowMoreFetching, payload: true });
|
99
104
|
/**
|
100
105
|
* @deprecated Metrika will be deleted after launch of analyticsEvents
|
101
106
|
*/
|
102
107
|
metrika.reachGoal(MetrikaCounter.CrossSite, BlogMetrikaGoalIds.showMore);
|
103
108
|
handleAnalytics();
|
109
|
+
const nextPage = currentPage + 1;
|
104
110
|
try {
|
105
|
-
|
111
|
+
setIsFetching(true);
|
112
|
+
const fetchedData = await fetchData({
|
113
|
+
page: nextPage,
|
114
|
+
query: {
|
115
|
+
page: nextPage,
|
116
|
+
},
|
117
|
+
});
|
106
118
|
handleChangeQueryParams({
|
107
|
-
page:
|
119
|
+
page: nextPage,
|
108
120
|
});
|
109
121
|
if (fetchedData) {
|
110
122
|
dispatch({
|
@@ -112,7 +124,7 @@ export const Feed = ({ image }) => {
|
|
112
124
|
payload: {
|
113
125
|
posts: (postsOnPage !== null && postsOnPage !== void 0 ? postsOnPage : []).concat(fetchedData.posts),
|
114
126
|
count: fetchedData.count,
|
115
|
-
currentPage:
|
127
|
+
currentPage: nextPage,
|
116
128
|
lastLoadedCount: fetchedData.posts.length,
|
117
129
|
},
|
118
130
|
});
|
@@ -121,13 +133,11 @@ export const Feed = ({ image }) => {
|
|
121
133
|
catch (err) {
|
122
134
|
dispatch({ type: ActionTypes.SetErrorShowMore, payload: true });
|
123
135
|
}
|
124
|
-
|
136
|
+
setIsFetching(false);
|
125
137
|
};
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
}
|
130
|
-
}, [fetchAndReplaceData, isFetching, queryParams.page]);
|
138
|
+
const handleOnErrorReload = useCallback(() => {
|
139
|
+
handleLoad({ page: currentPage, query: queryParams });
|
140
|
+
}, [currentPage, handleLoad, queryParams]);
|
131
141
|
useEffect(() => {
|
132
142
|
const loadedPostsCount = currentPage * perPageInQuery;
|
133
143
|
dispatch({
|
@@ -145,10 +155,10 @@ export const Feed = ({ image }) => {
|
|
145
155
|
icon: tag.icon && React.createElement(Icon, { data: tag.icon }),
|
146
156
|
})), [tags]);
|
147
157
|
return (React.createElement("div", null,
|
148
|
-
React.createElement(FeedHeader, { verticalOffset: "s", tags: tagItems, services: serviceItems,
|
158
|
+
React.createElement(FeedHeader, { verticalOffset: "s", tags: tagItems, services: serviceItems, handleLoadData: handleLoad, queryParams: queryParams, background: {
|
149
159
|
fullWidth: true,
|
150
160
|
url: image,
|
151
161
|
disableCompress: true,
|
152
162
|
} }),
|
153
|
-
errorLoad ? (React.createElement(PostsError, { onButtonClick:
|
163
|
+
errorLoad ? (React.createElement(PostsError, { onButtonClick: handleOnErrorReload })) : (React.createElement(Posts, { containerId: CONTAINER_ID, currentPage: currentPage, isShowMoreVisible: isShowMoreVisible, errorShowMore: errorShowMore, postCountOnPage: postCountOnPage, perPageInQuery: perPageInQuery, handleShowMore: handleShowMore, handlePageChange: handlePageChange, postsOnPage: postsOnPage, pinnedPostOnPage: pinnedPostOnPage, isFetching: isFetching, pageCountForShowSupportButtons: pageCountForShowSupportButtons }))));
|
154
164
|
};
|
@@ -6,7 +6,6 @@ export declare enum ActionTypes {
|
|
6
6
|
SetPosts = "setPosts",
|
7
7
|
SetShowMore = "setShowMore",
|
8
8
|
SetIsFetching = "setIsFetching",
|
9
|
-
SetIsShowMoreFetching = "setIsShowMoreFetching",
|
10
9
|
PageChange = "pageChange",
|
11
10
|
QueryParamsChange = "queryParamsChange"
|
12
11
|
}
|
@@ -15,7 +14,6 @@ export type State = {
|
|
15
14
|
errorLoad: boolean;
|
16
15
|
errorShowMore: boolean;
|
17
16
|
isFetching: boolean;
|
18
|
-
isShowMoreFetching: boolean;
|
19
17
|
isShowMoreVisible: boolean;
|
20
18
|
lastLoadedCount: number;
|
21
19
|
pinnedPostOnPage?: PostData;
|
@@ -29,9 +27,6 @@ type Action = {
|
|
29
27
|
} | {
|
30
28
|
type: ActionTypes.SetIsFetching;
|
31
29
|
payload: boolean;
|
32
|
-
} | {
|
33
|
-
type: ActionTypes.SetIsShowMoreFetching;
|
34
|
-
payload: boolean;
|
35
30
|
} | {
|
36
31
|
type: ActionTypes.SetPosts;
|
37
32
|
payload: {
|
@@ -6,7 +6,6 @@ export var ActionTypes;
|
|
6
6
|
ActionTypes["SetPosts"] = "setPosts";
|
7
7
|
ActionTypes["SetShowMore"] = "setShowMore";
|
8
8
|
ActionTypes["SetIsFetching"] = "setIsFetching";
|
9
|
-
ActionTypes["SetIsShowMoreFetching"] = "setIsShowMoreFetching";
|
10
9
|
ActionTypes["PageChange"] = "pageChange";
|
11
10
|
ActionTypes["QueryParamsChange"] = "queryParamsChange";
|
12
11
|
})(ActionTypes || (ActionTypes = {}));
|
@@ -17,11 +16,9 @@ export const reducer = (state, { type, payload }) => {
|
|
17
16
|
case ActionTypes.SetPosts:
|
18
17
|
return Object.assign(Object.assign({}, state), { lastLoadedCount: payload.count, postCountOnPage: payload.count, pinnedPostOnPage: payload.pinnedPost, postsOnPage: payload.posts, currentPage: payload.page });
|
19
18
|
case ActionTypes.SetShowMore:
|
20
|
-
return Object.assign(Object.assign({}, state), { lastLoadedCount: payload.lastLoadedCount, postCountOnPage: payload.count, currentPage: payload.currentPage, postsOnPage: payload.posts, errorShowMore: false
|
19
|
+
return Object.assign(Object.assign({}, state), { lastLoadedCount: payload.lastLoadedCount, postCountOnPage: payload.count, currentPage: payload.currentPage, postsOnPage: payload.posts, errorShowMore: false });
|
21
20
|
case ActionTypes.SetIsFetching:
|
22
21
|
return Object.assign(Object.assign({}, state), { isFetching: payload });
|
23
|
-
case ActionTypes.SetIsShowMoreFetching:
|
24
|
-
return Object.assign(Object.assign({}, state), { isShowMoreFetching: payload });
|
25
22
|
case ActionTypes.PageChange:
|
26
23
|
return Object.assign(Object.assign({}, state), { currentPage: payload, isFetching: true });
|
27
24
|
case ActionTypes.SetErrorLoad:
|
@@ -287,6 +287,87 @@ export declare const Header: {
|
|
287
287
|
type: string;
|
288
288
|
})[];
|
289
289
|
};
|
290
|
+
fullscreen: {
|
291
|
+
type: string;
|
292
|
+
};
|
293
|
+
analyticsEvents: {
|
294
|
+
anyOf: ({
|
295
|
+
type: string;
|
296
|
+
additionalProperties: {
|
297
|
+
type: string;
|
298
|
+
};
|
299
|
+
required: string[];
|
300
|
+
properties: {
|
301
|
+
name: {
|
302
|
+
type: string;
|
303
|
+
};
|
304
|
+
type: {
|
305
|
+
type: string;
|
306
|
+
};
|
307
|
+
counters: {
|
308
|
+
type: string;
|
309
|
+
additionalProperties: boolean;
|
310
|
+
required: never[];
|
311
|
+
properties: {
|
312
|
+
include: {
|
313
|
+
type: string;
|
314
|
+
items: {
|
315
|
+
type: string;
|
316
|
+
};
|
317
|
+
};
|
318
|
+
exclude: {
|
319
|
+
type: string;
|
320
|
+
items: {
|
321
|
+
type: string;
|
322
|
+
};
|
323
|
+
};
|
324
|
+
};
|
325
|
+
};
|
326
|
+
context: {
|
327
|
+
type: string;
|
328
|
+
};
|
329
|
+
};
|
330
|
+
} | {
|
331
|
+
type: string;
|
332
|
+
items: {
|
333
|
+
type: string;
|
334
|
+
additionalProperties: {
|
335
|
+
type: string;
|
336
|
+
};
|
337
|
+
required: string[];
|
338
|
+
properties: {
|
339
|
+
name: {
|
340
|
+
type: string;
|
341
|
+
};
|
342
|
+
type: {
|
343
|
+
type: string;
|
344
|
+
};
|
345
|
+
counters: {
|
346
|
+
type: string;
|
347
|
+
additionalProperties: boolean;
|
348
|
+
required: never[];
|
349
|
+
properties: {
|
350
|
+
include: {
|
351
|
+
type: string;
|
352
|
+
items: {
|
353
|
+
type: string;
|
354
|
+
};
|
355
|
+
};
|
356
|
+
exclude: {
|
357
|
+
type: string;
|
358
|
+
items: {
|
359
|
+
type: string;
|
360
|
+
};
|
361
|
+
};
|
362
|
+
};
|
363
|
+
};
|
364
|
+
context: {
|
365
|
+
type: string;
|
366
|
+
};
|
367
|
+
};
|
368
|
+
};
|
369
|
+
})[];
|
370
|
+
};
|
290
371
|
};
|
291
372
|
} | {
|
292
373
|
type: string;
|
@@ -135,6 +135,87 @@ export declare const Media: {
|
|
135
135
|
type: string;
|
136
136
|
})[];
|
137
137
|
};
|
138
|
+
fullscreen: {
|
139
|
+
type: string;
|
140
|
+
};
|
141
|
+
analyticsEvents: {
|
142
|
+
anyOf: ({
|
143
|
+
type: string;
|
144
|
+
additionalProperties: {
|
145
|
+
type: string;
|
146
|
+
};
|
147
|
+
required: string[];
|
148
|
+
properties: {
|
149
|
+
name: {
|
150
|
+
type: string;
|
151
|
+
};
|
152
|
+
type: {
|
153
|
+
type: string;
|
154
|
+
};
|
155
|
+
counters: {
|
156
|
+
type: string;
|
157
|
+
additionalProperties: boolean;
|
158
|
+
required: never[];
|
159
|
+
properties: {
|
160
|
+
include: {
|
161
|
+
type: string;
|
162
|
+
items: {
|
163
|
+
type: string;
|
164
|
+
};
|
165
|
+
};
|
166
|
+
exclude: {
|
167
|
+
type: string;
|
168
|
+
items: {
|
169
|
+
type: string;
|
170
|
+
};
|
171
|
+
};
|
172
|
+
};
|
173
|
+
};
|
174
|
+
context: {
|
175
|
+
type: string;
|
176
|
+
};
|
177
|
+
};
|
178
|
+
} | {
|
179
|
+
type: string;
|
180
|
+
items: {
|
181
|
+
type: string;
|
182
|
+
additionalProperties: {
|
183
|
+
type: string;
|
184
|
+
};
|
185
|
+
required: string[];
|
186
|
+
properties: {
|
187
|
+
name: {
|
188
|
+
type: string;
|
189
|
+
};
|
190
|
+
type: {
|
191
|
+
type: string;
|
192
|
+
};
|
193
|
+
counters: {
|
194
|
+
type: string;
|
195
|
+
additionalProperties: boolean;
|
196
|
+
required: never[];
|
197
|
+
properties: {
|
198
|
+
include: {
|
199
|
+
type: string;
|
200
|
+
items: {
|
201
|
+
type: string;
|
202
|
+
};
|
203
|
+
};
|
204
|
+
exclude: {
|
205
|
+
type: string;
|
206
|
+
items: {
|
207
|
+
type: string;
|
208
|
+
};
|
209
|
+
};
|
210
|
+
};
|
211
|
+
};
|
212
|
+
context: {
|
213
|
+
type: string;
|
214
|
+
};
|
215
|
+
};
|
216
|
+
};
|
217
|
+
})[];
|
218
|
+
};
|
138
219
|
paddingTop: {
|
139
220
|
type: string;
|
140
221
|
enum: string[];
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import block from 'bem-cn-lite';
|
3
2
|
import { YFMWrapper } from '@gravity-ui/page-constructor';
|
3
|
+
import block from 'bem-cn-lite';
|
4
4
|
import { Wrapper } from '../../components/Wrapper/Wrapper';
|
5
5
|
import { PaddingsDirections } from '../../models/paddings';
|
6
6
|
const b = block('yfm');
|
@@ -4,7 +4,7 @@ import { block } from '../../utils/cn';
|
|
4
4
|
import { Controls } from './components/Controls/Controls';
|
5
5
|
import './FeedHeader.css';
|
6
6
|
const b = block('feed-header');
|
7
|
-
export const FeedHeader = ({ tags, services,
|
7
|
+
export const FeedHeader = ({ tags, services, handleLoadData, offset = 'default', background, theme = 'default', verticalOffset = 'l', className, queryParams, }) => {
|
8
8
|
const backgroundThemed = background && getThemedValue(background, theme);
|
9
9
|
return (React.createElement("header", { className: b('header', { ['has-background']: Boolean(background) }, className) },
|
10
10
|
(backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.color) ? (React.createElement(FullWidthBackground, { style: { backgroundColor: backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.color }, theme: "rounded" })) : null,
|
@@ -14,5 +14,5 @@ export const FeedHeader = ({ tags, services, setIsFetching, offset = 'default',
|
|
14
14
|
? ''
|
15
15
|
: backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.color,
|
16
16
|
}, disableCompress: backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.disableCompress })) : null,
|
17
|
-
React.createElement(Controls, { tags: tags, services: services,
|
17
|
+
React.createElement(Controls, { tags: tags, services: services, handleLoadData: handleLoadData, queryParams: queryParams }))));
|
18
18
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { ReactNode } from 'react';
|
2
|
-
import {
|
2
|
+
import { FetchArgs, Query, SetQueryType } from '../../../../models/common';
|
3
3
|
import './Controls.css';
|
4
4
|
export type SelectItem = {
|
5
5
|
content: string;
|
@@ -7,10 +7,9 @@ export type SelectItem = {
|
|
7
7
|
icon?: ReactNode;
|
8
8
|
};
|
9
9
|
export type ControlsProps = {
|
10
|
-
|
10
|
+
handleLoadData: (props: FetchArgs) => void;
|
11
11
|
tags?: SelectItem[];
|
12
12
|
services?: SelectItem[];
|
13
|
-
handleChangeQuery: HandleChangeQueryParams;
|
14
13
|
queryParams: Query;
|
15
14
|
setQuery?: SetQueryType;
|
16
15
|
};
|