@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
@@ -10,7 +10,7 @@ import metrika from '../../../../counters/metrika.js';
|
|
10
10
|
import { MetrikaCounter } from '../../../../counters/utils';
|
11
11
|
import { Keyset, i18 } from '../../../../i18n';
|
12
12
|
import { Save } from '../../../../icons/Save';
|
13
|
-
import { DefaultEventNames
|
13
|
+
import { DefaultEventNames } from '../../../../models/common';
|
14
14
|
import { block } from '../../../../utils/cn';
|
15
15
|
import { Search } from '../../../Search/Search';
|
16
16
|
import { renderFilter, renderOption, renderSwitcher } from './customRenders';
|
@@ -19,7 +19,7 @@ const b = block('feed-controls');
|
|
19
19
|
const ICON_SIZE = 16;
|
20
20
|
const DEFAULT_PAGE = 1;
|
21
21
|
const VIRTUALIZATION_THRESHOLD = 1000;
|
22
|
-
export const Controls = ({
|
22
|
+
export const Controls = ({ handleLoadData, tags = [], services = [], queryParams, }) => {
|
23
23
|
const { hasLikes } = useContext(LikesContext);
|
24
24
|
const handleAnalyticsTag = useAnalytics(DefaultEventNames.Tag);
|
25
25
|
const handleAnalyticsService = useAnalytics(DefaultEventNames.Service);
|
@@ -28,21 +28,25 @@ export const Controls = ({ setIsFetching, tags = [], services = [], handleChange
|
|
28
28
|
const [savedOnly, setSavedOnly] = useState(savedOnlyInitial === 'true');
|
29
29
|
const [search, setSearch] = useState(searchInitial);
|
30
30
|
const handleSavedOnly = () => {
|
31
|
-
handleChangeQuery({
|
32
|
-
savedOnly: savedOnly ? '' : 'true',
|
33
|
-
search: '',
|
34
|
-
tags: '',
|
35
|
-
page: DEFAULT_PAGE,
|
36
|
-
services: '',
|
37
|
-
});
|
38
31
|
handleAnalyticsSaveOnly();
|
39
32
|
setSavedOnly(!savedOnly);
|
40
|
-
|
33
|
+
handleLoadData({
|
34
|
+
page: DEFAULT_PAGE,
|
35
|
+
query: {
|
36
|
+
savedOnly: savedOnly ? '' : 'true',
|
37
|
+
search: '',
|
38
|
+
tags: '',
|
39
|
+
page: DEFAULT_PAGE,
|
40
|
+
services: '',
|
41
|
+
},
|
42
|
+
});
|
41
43
|
};
|
42
44
|
const handleSearch = (searchValue) => {
|
43
|
-
handleChangeQuery({ search: searchValue, page: DEFAULT_PAGE });
|
44
45
|
setSearch(searchValue);
|
45
|
-
|
46
|
+
handleLoadData({
|
47
|
+
page: DEFAULT_PAGE,
|
48
|
+
query: { search: searchValue, page: DEFAULT_PAGE },
|
49
|
+
});
|
46
50
|
};
|
47
51
|
const handleTagSelect = (selectedTags) => {
|
48
52
|
/**
|
@@ -55,11 +59,13 @@ export const Controls = ({ setIsFetching, tags = [], services = [], handleChange
|
|
55
59
|
theme: selectedTags[0],
|
56
60
|
});
|
57
61
|
const isEmptyTag = selectedTags.some((tag) => tag === 'empty');
|
58
|
-
|
59
|
-
tags: isEmptyTag ? '' : selectedTags[0],
|
62
|
+
handleLoadData({
|
60
63
|
page: DEFAULT_PAGE,
|
64
|
+
query: {
|
65
|
+
tags: isEmptyTag ? '' : selectedTags[0],
|
66
|
+
page: DEFAULT_PAGE,
|
67
|
+
},
|
61
68
|
});
|
62
|
-
setIsFetching(true);
|
63
69
|
};
|
64
70
|
const handleServicesSelect = (selectedServices) => {
|
65
71
|
const forMetrikaServices = services.filter((service) => {
|
@@ -76,8 +82,10 @@ export const Controls = ({ setIsFetching, tags = [], services = [], handleChange
|
|
76
82
|
service: metrikaAsString,
|
77
83
|
});
|
78
84
|
const servicesAsString = selectedServices.join(',');
|
79
|
-
|
80
|
-
|
85
|
+
handleLoadData({
|
86
|
+
page: DEFAULT_PAGE,
|
87
|
+
query: { services: servicesAsString, page: DEFAULT_PAGE },
|
88
|
+
});
|
81
89
|
};
|
82
90
|
const tagsItems = useMemo(() => [{ value: 'empty', content: i18(Keyset.AllTags) }, ...tags], [tags]);
|
83
91
|
const servicesItems = useMemo(() => (servicesInitial ? [...servicesInitial.split(',')] : []), [servicesInitial]);
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { PaginatorProps } from './types';
|
2
2
|
import './Paginator.css';
|
3
|
-
export declare const Paginator: ({ itemsPerPage, totalItems, maxPages, page, className,
|
3
|
+
export declare const Paginator: ({ itemsPerPage, totalItems, maxPages, page, className, onPageChange, pageCountForShowSupportButtons, }: PaginatorProps) => JSX.Element | null;
|
@@ -26,7 +26,7 @@ import { getPageConfigs, getPagesCount } from './utils';
|
|
26
26
|
import './Paginator.css';
|
27
27
|
const b = block('paginator');
|
28
28
|
const DEFAULT_PAGE_COUNT_FOR_SHOW_SUPPORT_BUTTONS = 6;
|
29
|
-
export const Paginator = ({ itemsPerPage, totalItems, maxPages, page, className,
|
29
|
+
export const Paginator = ({ itemsPerPage, totalItems, maxPages, page, className, onPageChange, pageCountForShowSupportButtons = DEFAULT_PAGE_COUNT_FOR_SHOW_SUPPORT_BUTTONS, }) => {
|
30
30
|
const [pagesCount, setPagesCount] = useState(getPagesCount({ itemsPerPage, totalItems, maxPages }));
|
31
31
|
useEffect(() => {
|
32
32
|
const count = getPagesCount({ itemsPerPage, totalItems, maxPages });
|
@@ -95,7 +95,7 @@ export const Paginator = ({ itemsPerPage, totalItems, maxPages, page, className,
|
|
95
95
|
}
|
96
96
|
const renderPaginatorItem = (item) => {
|
97
97
|
const { key } = item, rest = __rest(item, ["key"]);
|
98
|
-
return React.createElement(PaginatorItem, Object.assign({ key: `page_${key}` }, rest
|
98
|
+
return React.createElement(PaginatorItem, Object.assign({ key: `page_${key}` }, rest));
|
99
99
|
};
|
100
100
|
return (React.createElement("div", { className: b('pagination') },
|
101
101
|
page > 1 && (React.createElement("div", { className: b('pagination-block') },
|
@@ -1,9 +1,15 @@
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
2
2
|
unpredictable css rules order in build */
|
3
|
+
.bc-posts {
|
4
|
+
position: relative;
|
5
|
+
}
|
3
6
|
.bc-posts__cards-container, .bc-posts__pinned-container {
|
4
7
|
padding-top: 24px;
|
5
8
|
scroll-margin: 48px;
|
6
9
|
}
|
10
|
+
.bc-posts__cards-container_isLoading {
|
11
|
+
opacity: 0.7;
|
12
|
+
}
|
7
13
|
.bc-posts__pagination {
|
8
14
|
display: flex;
|
9
15
|
flex-direction: column;
|
@@ -25,4 +31,23 @@ unpredictable css rules order in build */
|
|
25
31
|
}
|
26
32
|
.bc-posts__paginator {
|
27
33
|
padding-top: 12px;
|
34
|
+
}
|
35
|
+
.bc-posts__loaderContainer {
|
36
|
+
z-index: 6;
|
37
|
+
position: absolute;
|
38
|
+
top: 0;
|
39
|
+
left: 0;
|
40
|
+
width: 70%;
|
41
|
+
height: 100%;
|
42
|
+
background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
|
43
|
+
animation: shimmer 2s infinite linear;
|
44
|
+
}
|
45
|
+
|
46
|
+
@keyframes shimmer {
|
47
|
+
from {
|
48
|
+
transform: translateX(-200%);
|
49
|
+
}
|
50
|
+
to {
|
51
|
+
transform: translateX(300%);
|
52
|
+
}
|
28
53
|
}
|
@@ -9,7 +9,6 @@ type PostCardProps = {
|
|
9
9
|
postCountOnPage: number;
|
10
10
|
perPageInQuery: number;
|
11
11
|
isFetching: boolean;
|
12
|
-
isShowMoreFetching: boolean;
|
13
12
|
handleShowMore: (value?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => Promise<void> | void;
|
14
13
|
handlePageChange: (value: number) => Promise<void> | void;
|
15
14
|
postsOnPage?: PostData[];
|
@@ -8,8 +8,9 @@ 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,
|
12
|
-
React.createElement("div", {
|
11
|
+
export const Posts = ({ containerId, pinnedPostOnPage, currentPage, postsOnPage, isShowMoreVisible, errorShowMore, postCountOnPage, perPageInQuery, isFetching, handleShowMore, handlePageChange, pageCountForShowSupportButtons, }) => (React.createElement("div", { className: b() },
|
12
|
+
isFetching && React.createElement("div", { className: b('loaderContainer') }),
|
13
|
+
React.createElement("div", { id: containerId, className: b('cards-container', { isLoading: isFetching }) },
|
13
14
|
pinnedPostOnPage && currentPage === 1 && (React.createElement("div", { className: b('pinned-container') },
|
14
15
|
React.createElement(PostCard, { post: pinnedPostOnPage, size: "m", fullWidth: true, showTag: true }))),
|
15
16
|
(postsOnPage === null || postsOnPage === void 0 ? void 0 : postsOnPage.length) ? (React.createElement(CardLayoutBlock, { title: '', colSizes: {
|
@@ -18,9 +19,9 @@ export const Posts = ({ containerId, pinnedPostOnPage, currentPage, postsOnPage,
|
|
18
19
|
md: 6,
|
19
20
|
} }, postsOnPage === null || postsOnPage === void 0 ? void 0 : postsOnPage.map((post) => (React.createElement(PostCard, { key: post.id, post: post, showTag: true }))))) : (React.createElement(PostsEmpty, null))),
|
20
21
|
React.createElement("div", { className: b('pagination') },
|
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
|
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))),
|
22
23
|
errorShowMore && (React.createElement("div", { className: b('error-show-more') },
|
23
24
|
React.createElement("div", null, i18(Keyset.ErrorTitle)),
|
24
25
|
React.createElement("div", null, i18(Keyset.PostLoadError)))),
|
25
26
|
Boolean(currentPage && postCountOnPage) && (React.createElement("div", { className: b('paginator') },
|
26
|
-
React.createElement(Paginator, { onPageChange: handlePageChange, page: currentPage, totalItems: postCountOnPage, itemsPerPage: perPageInQuery,
|
27
|
+
React.createElement(Paginator, { onPageChange: handlePageChange, page: currentPage, totalItems: postCountOnPage, itemsPerPage: perPageInQuery, maxPages: Infinity, pageCountForShowSupportButtons: pageCountForShowSupportButtons }))))));
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
2
|
-
import { debounce as lodashDebounce } from 'lodash';
|
3
2
|
import { TextInput } from '@gravity-ui/uikit';
|
3
|
+
import { debounce as lodashDebounce } from 'lodash';
|
4
4
|
import { useIsIPhone } from '../../hooks/useIsIPhone';
|
5
5
|
import { Keyset, i18 } from '../../i18n';
|
6
6
|
import { Close } from '../../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[];
|
@@ -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 { debounce, memoize } from 'lodash';
|
14
13
|
import { isNewMetrikaFormat, } from '@gravity-ui/page-constructor';
|
14
|
+
import { debounce, memoize } from 'lodash';
|
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": "4.0.0
|
3
|
+
"version": "4.0.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": "^3.
|
76
|
+
"@gravity-ui/page-constructor": "^3.1.1",
|
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,8 +141,5 @@
|
|
141
141
|
"*.{json,yaml,yml,md}": [
|
142
142
|
"prettier --write"
|
143
143
|
]
|
144
|
-
},
|
145
|
-
"publishConfig": {
|
146
|
-
"tag": "alpha"
|
147
144
|
}
|
148
145
|
}
|
@@ -4,6 +4,8 @@ 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
|
7
9
|
*/
|
8
10
|
const sanitizeMeta = (metaData) => {
|
9
11
|
const { title, description, date, image, canonicalUrl, organization } = metaData;
|
@@ -4,8 +4,8 @@ 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 js_yaml_1 = __importDefault(require("js-yaml"));
|
8
7
|
const server_1 = require("@gravity-ui/page-constructor/server");
|
8
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
9
9
|
const config_1 = require("./config");
|
10
10
|
const contentFilter_1 = require("./contentFilter");
|
11
11
|
const transformer = ({ blocks, lang, typographyConfig }) => (0, server_1.contentTransformer)({
|
@@ -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
|
+
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,16 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const react_1 = __importDefault(require("react"));
|
7
|
-
const react_2 = require("@testing-library/react");
|
8
|
-
const YFM_1 = require("../YFM");
|
9
|
-
const text = 'YFM block';
|
10
|
-
describe('YFM', () => {
|
11
|
-
test('Has id', async () => {
|
12
|
-
(0, react_2.render)(react_1.default.createElement(YFM_1.YFM, { text: text }));
|
13
|
-
const yfm = react_2.screen.getByText(text);
|
14
|
-
expect(yfm).toHaveClass('yfm');
|
15
|
-
});
|
16
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { render, screen } from '@testing-library/react';
|
3
|
-
import { YFM } from '../YFM';
|
4
|
-
const text = 'YFM block';
|
5
|
-
describe('YFM', () => {
|
6
|
-
test('Has id', async () => {
|
7
|
-
render(React.createElement(YFM, { text: text }));
|
8
|
-
const yfm = screen.getByText(text);
|
9
|
-
expect(yfm).toHaveClass('yfm');
|
10
|
-
});
|
11
|
-
});
|