@gravity-ui/blog-constructor 2.1.2-alpha.2 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -0
- package/build/cjs/blocks/Author/Author.js +3 -3
- package/build/cjs/blocks/Banner/Banner.js +4 -7
- package/build/cjs/blocks/CTA/CTA.js +3 -6
- package/build/cjs/blocks/ColoredText/ColoredText.js +1 -1
- package/build/cjs/blocks/Feed/Feed.js +12 -28
- package/build/cjs/blocks/Feed/reducer.d.ts +1 -1
- package/build/cjs/blocks/Header/Header.js +3 -7
- package/build/cjs/blocks/Meta/Meta.js +5 -9
- package/build/cjs/blocks/Suggest/Suggest.js +4 -8
- package/build/cjs/blocks/YFM/YFM.js +1 -1
- package/build/cjs/components/FeedHeader/FeedHeader.d.ts +1 -1
- package/build/cjs/components/FeedHeader/FeedHeader.js +1 -1
- package/build/cjs/components/FeedHeader/components/Controls/Controls.d.ts +1 -1
- package/build/cjs/components/FeedHeader/components/Controls/Controls.js +4 -28
- package/build/cjs/components/FeedHeader/components/Controls/customRenders.d.ts +1 -1
- package/build/cjs/components/FeedHeader/components/Controls/customRenders.js +1 -1
- package/build/cjs/components/Paginator/Paginator.js +2 -26
- package/build/cjs/components/Paginator/components/NavigationButton.js +1 -1
- package/build/cjs/components/Paginator/components/PaginatorItem.js +1 -1
- package/build/cjs/components/PostCard/PostCard.d.ts +0 -4
- package/build/cjs/components/PostCard/PostCard.js +1 -1
- package/build/cjs/components/PostInfo/PostInfo.d.ts +0 -4
- package/build/cjs/components/PostInfo/PostInfo.js +2 -2
- package/build/cjs/components/PostInfo/SuggestPostInfo.js +1 -1
- package/build/cjs/components/PostInfo/components/Date.js +1 -1
- package/build/cjs/components/PostInfo/components/Save.d.ts +0 -4
- package/build/cjs/components/PostInfo/components/Save.js +4 -8
- package/build/cjs/components/PostInfo/components/Sharing.d.ts +0 -4
- package/build/cjs/components/PostInfo/components/Sharing.js +5 -12
- package/build/cjs/components/Posts/Posts.js +1 -1
- package/build/cjs/components/PostsEmpty/PostsEmpty.js +1 -1
- package/build/cjs/components/Search/Search.js +2 -2
- package/build/cjs/components/Wrapper/Wrapper.js +1 -1
- package/build/cjs/constructor/BlogConstructorProvider.d.ts +1 -3
- package/build/cjs/constructor/BlogConstructorProvider.js +4 -6
- package/build/cjs/constructor/blocksMap.js +8 -8
- package/build/cjs/containers/BlogPage/BlogPage.d.ts +2 -2
- package/build/cjs/containers/BlogPage/BlogPage.js +2 -2
- package/build/cjs/containers/BlogPostPage/BlogPostPage.d.ts +2 -2
- package/build/cjs/containers/BlogPostPage/BlogPostPage.js +2 -2
- package/build/cjs/contexts/FeedContext.d.ts +1 -1
- package/build/cjs/contexts/theme/ThemeProvider.js +1 -1
- package/build/cjs/counters/metrika.d.ts +0 -4
- package/build/cjs/counters/metrika.js +0 -4
- package/build/cjs/models/blocks.d.ts +1 -1
- package/build/cjs/models/common.d.ts +2 -12
- package/build/cjs/models/common.js +2 -14
- package/build/cjs/utils/common.d.ts +1 -1
- package/build/cjs/utils/common.js +1 -1
- package/build/esm/blocks/Author/Author.js +5 -5
- package/build/esm/blocks/Banner/Banner.js +4 -7
- package/build/esm/blocks/CTA/CTA.js +3 -6
- package/build/esm/blocks/ColoredText/ColoredText.js +1 -1
- package/build/esm/blocks/Feed/Feed.js +8 -24
- package/build/esm/blocks/Feed/reducer.d.ts +1 -1
- package/build/esm/blocks/Header/Header.js +3 -7
- package/build/esm/blocks/Meta/Meta.js +5 -9
- package/build/esm/blocks/Suggest/Suggest.js +4 -8
- package/build/esm/blocks/YFM/YFM.js +1 -1
- package/build/esm/components/FeedHeader/FeedHeader.d.ts +1 -1
- package/build/esm/components/FeedHeader/FeedHeader.js +2 -2
- package/build/esm/components/FeedHeader/components/Controls/Controls.d.ts +1 -1
- package/build/esm/components/FeedHeader/components/Controls/Controls.js +6 -30
- package/build/esm/components/FeedHeader/components/Controls/customRenders.d.ts +1 -1
- package/build/esm/components/FeedHeader/components/Controls/customRenders.js +2 -2
- package/build/esm/components/Paginator/Paginator.js +3 -27
- package/build/esm/components/Paginator/components/NavigationButton.js +2 -2
- package/build/esm/components/Paginator/components/PaginatorItem.js +1 -1
- package/build/esm/components/PostCard/PostCard.d.ts +0 -4
- package/build/esm/components/PostCard/PostCard.js +3 -3
- package/build/esm/components/PostInfo/PostInfo.d.ts +0 -4
- package/build/esm/components/PostInfo/PostInfo.js +2 -2
- package/build/esm/components/PostInfo/SuggestPostInfo.js +1 -1
- package/build/esm/components/PostInfo/components/Date.js +1 -1
- package/build/esm/components/PostInfo/components/ReadingTime.js +1 -1
- package/build/esm/components/PostInfo/components/Save.d.ts +0 -4
- package/build/esm/components/PostInfo/components/Save.js +2 -6
- package/build/esm/components/PostInfo/components/Sharing.d.ts +0 -4
- package/build/esm/components/PostInfo/components/Sharing.js +4 -11
- package/build/esm/components/Posts/Posts.js +2 -2
- package/build/esm/components/PostsEmpty/PostsEmpty.js +1 -1
- package/build/esm/components/PostsError/PostsError.js +1 -1
- package/build/esm/components/Search/Search.js +3 -3
- package/build/esm/components/Wrapper/Wrapper.js +1 -1
- package/build/esm/constructor/BlogConstructorProvider.d.ts +1 -3
- package/build/esm/constructor/BlogConstructorProvider.js +4 -6
- package/build/esm/constructor/blocksMap.js +8 -8
- package/build/esm/containers/BlogPage/BlogPage.d.ts +2 -2
- package/build/esm/containers/BlogPage/BlogPage.js +2 -2
- package/build/esm/containers/BlogPostPage/BlogPostPage.d.ts +2 -2
- package/build/esm/containers/BlogPostPage/BlogPostPage.js +2 -2
- package/build/esm/contexts/FeedContext.d.ts +1 -1
- package/build/esm/contexts/theme/ThemeProvider.js +1 -1
- package/build/esm/counters/metrika.d.ts +0 -4
- package/build/esm/counters/metrika.js +0 -4
- package/build/esm/hooks/useLikes.js +1 -1
- package/build/esm/models/blocks.d.ts +1 -1
- package/build/esm/models/common.d.ts +2 -12
- package/build/esm/models/common.js +1 -13
- package/build/esm/utils/common.d.ts +1 -1
- package/build/esm/utils/common.js +3 -3
- package/package.json +5 -7
- package/server/data/contentFilter.js +1 -0
- package/server/data/createReadableContent.js +1 -1
- package/server/data/transformPost.d.ts +1 -1
- package/server/models/blocks.d.ts +1 -1
- package/server/models/common.d.ts +2 -12
- package/server/models/common.js +2 -14
@@ -21,10 +21,6 @@ declare function hit(...args: any[]): void;
|
|
21
21
|
declare function params(...args: any[]): void;
|
22
22
|
declare function reachGoal(counterName: any, ...args: any[]): void;
|
23
23
|
declare function reachGoals(goals: any, counterName?: string): void;
|
24
|
-
/**
|
25
|
-
* @deprecated Metrika will be deleted after launch of analyticsEvents
|
26
|
-
* https://st.yandex-team.ru/PAGECTR-7
|
27
|
-
*/
|
28
24
|
declare const Goal: {
|
29
25
|
SUPPORT_OPEN_FORM: string;
|
30
26
|
SUPPORT_STEP_1_SUBMIT: string;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
2
2
|
export const useLikes = ({ hasLike, count, toggleLikeCallback, postId }) => {
|
3
3
|
const [hasUserLike, setHasUserLike] = useState(hasLike !== null && hasLike !== void 0 ? hasLike : false);
|
4
4
|
const [likesCount, setLikesCount] = useState(count !== null && count !== void 0 ? count : 0);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ReactElement } from 'react';
|
2
2
|
import { ContentBlockProps, HeaderBlockProps, MediaProps as PCMediaProps, TextTheme } from '@gravity-ui/page-constructor';
|
3
|
+
import { BlockType, ClassNameProps, PostData } from './common';
|
3
4
|
import { PaddingsYFMProps } from './paddings';
|
4
|
-
import { ClassNameProps, PostData, BlockType } from './common';
|
5
5
|
export type AuthorProps = ClassNameProps & {
|
6
6
|
authorId: number;
|
7
7
|
image: string;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { IDevice, IBrowser } from 'ua-parser-js';
|
2
1
|
import { ReactNode } from 'react';
|
2
|
+
import { IBrowser, IDevice } from 'ua-parser-js';
|
3
3
|
import { HeaderBlockProps as PageConstructorHeaderBlockProps } from '@gravity-ui/page-constructor';
|
4
4
|
import { Locale } from '../models/locale';
|
5
5
|
export declare enum Theme {
|
@@ -18,6 +18,7 @@ export type Author = {
|
|
18
18
|
secondName: string | null;
|
19
19
|
description: string | null;
|
20
20
|
fullDescription: string | null;
|
21
|
+
shortDescription: string | null;
|
21
22
|
} & {
|
22
23
|
[x: string]: string | null;
|
23
24
|
};
|
@@ -149,14 +150,3 @@ export type HandleChangeQueryParams = (params: Query) => void;
|
|
149
150
|
export type SetQueryType = (params: Query, options?: {
|
150
151
|
[y: string]: boolean;
|
151
152
|
}) => Promise<void> | void;
|
152
|
-
export declare enum DefaultEventNames {
|
153
|
-
ShareButton = "share-button-click",
|
154
|
-
SaveButton = "save-button-click",
|
155
|
-
ShowMore = "show-more-button-click",
|
156
|
-
PaginatorHome = "paginator-home-button-click",
|
157
|
-
PaginatorNext = "paginator-next-button-click",
|
158
|
-
PaginatorPage = "paginator-page-button-click",
|
159
|
-
Tag = "selector-tag-click",
|
160
|
-
Service = "selector-service-click",
|
161
|
-
SaveOnly = "save-only-button-click"
|
162
|
-
}
|
@@ -16,16 +16,4 @@ export var BlockType;
|
|
16
16
|
BlockType["Suggest"] = "blog-suggest-block";
|
17
17
|
BlockType["Meta"] = "blog-meta-block";
|
18
18
|
BlockType["Feed"] = "blog-feed-block";
|
19
|
-
})(BlockType || (BlockType = {}));
|
20
|
-
export var DefaultEventNames;
|
21
|
-
(function (DefaultEventNames) {
|
22
|
-
DefaultEventNames["ShareButton"] = "share-button-click";
|
23
|
-
DefaultEventNames["SaveButton"] = "save-button-click";
|
24
|
-
DefaultEventNames["ShowMore"] = "show-more-button-click";
|
25
|
-
DefaultEventNames["PaginatorHome"] = "paginator-home-button-click";
|
26
|
-
DefaultEventNames["PaginatorNext"] = "paginator-next-button-click";
|
27
|
-
DefaultEventNames["PaginatorPage"] = "paginator-page-button-click";
|
28
|
-
DefaultEventNames["Tag"] = "selector-tag-click";
|
29
|
-
DefaultEventNames["Service"] = "selector-service-click";
|
30
|
-
DefaultEventNames["SaveOnly"] = "save-only-button-click";
|
31
|
-
})(DefaultEventNames || (DefaultEventNames = {}));
|
19
|
+
})(BlockType || (BlockType = {}));
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="lodash" />
|
2
2
|
import { ContentBlockProps, HeaderBreadCrumbsProps, MetrikaGoal, NewMetrikaGoal } from '@gravity-ui/page-constructor';
|
3
3
|
import { RouterContextProps } from '../contexts/RouterContext';
|
4
|
-
import {
|
4
|
+
import { GetPostsRequest, Query, Tag } from '../models/common';
|
5
5
|
export interface QueryParam {
|
6
6
|
name: string;
|
7
7
|
value?: string | number | null;
|
@@ -10,10 +10,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
10
10
|
return t;
|
11
11
|
};
|
12
12
|
import { format, parse } from 'url';
|
13
|
-
import {
|
13
|
+
import { debounce, memoize } from 'lodash';
|
14
14
|
import { isNewMetrikaFormat, } from '@gravity-ui/page-constructor';
|
15
|
-
import {
|
16
|
-
import {
|
15
|
+
import { CONTENT_DEFAULT_COL_SIZES, CONTENT_DEFAULT_SIZE, CONTENT_DEFAULT_THEME, DEFAULT_PAGE, DEFAULT_ROWS_PER_PAGE, } from '../blocks/constants';
|
16
|
+
import { Keyset, i18 } from '../i18n';
|
17
17
|
export function getAbsolutePath(router, url) {
|
18
18
|
if (!router || !router.pathname) {
|
19
19
|
return url !== null && url !== void 0 ? url : '';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@gravity-ui/blog-constructor",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.2.0",
|
4
4
|
"description": "Gravity UI Blog Constructor",
|
5
5
|
"license": "MIT",
|
6
6
|
"repository": {
|
@@ -72,8 +72,8 @@
|
|
72
72
|
"@babel/core": "^7.15.8",
|
73
73
|
"@commitlint/config-conventional": "^17.4.3",
|
74
74
|
"@doc-tools/transform": "^2.9.0",
|
75
|
-
"@gravity-ui/eslint-config": "^
|
76
|
-
"@gravity-ui/page-constructor": "^2.
|
75
|
+
"@gravity-ui/eslint-config": "^2.0.0",
|
76
|
+
"@gravity-ui/page-constructor": "^2.2.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",
|
@@ -96,8 +96,9 @@
|
|
96
96
|
"@types/react-transition-group": "^4.4.4",
|
97
97
|
"@types/sanitize-html": "^2.6.0",
|
98
98
|
"@types/ua-parser-js": "^0.7.36",
|
99
|
-
"eslint": "^8.
|
99
|
+
"eslint": "^8.34.0",
|
100
100
|
"eslint-plugin-local": "./eslint-plugin-local",
|
101
|
+
"eslint-plugin-no-not-accumulator-reassign": "^0.1.0",
|
101
102
|
"eslint-plugin-testing-library": "^5.9.1",
|
102
103
|
"gulp": "^4.0.2",
|
103
104
|
"gulp-dart-sass": "^1.0.2",
|
@@ -140,8 +141,5 @@
|
|
140
141
|
"*.{json,yaml,yml,md}": [
|
141
142
|
"prettier --write"
|
142
143
|
]
|
143
|
-
},
|
144
|
-
"publishConfig": {
|
145
|
-
"tag": "alpha"
|
146
144
|
}
|
147
145
|
}
|
@@ -21,6 +21,7 @@ const filterItems = ({ items, itemsKey, options }) => {
|
|
21
21
|
const whenResult = when === true ||
|
22
22
|
when === undefined ||
|
23
23
|
(typeof when === 'string' && (0, evaluation_1.default)(when, options));
|
24
|
+
// eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
|
24
25
|
delete item.when;
|
25
26
|
if (whenResult) {
|
26
27
|
const property = item[itemsKey];
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.createReadableContent = void 0;
|
4
|
-
const config_1 = require("./config");
|
5
4
|
const common_1 = require("../models/common");
|
5
|
+
const config_1 = require("./config");
|
6
6
|
/**
|
7
7
|
* Function for create readable content
|
8
8
|
*
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ReactElement } from 'react';
|
2
2
|
import { ContentBlockProps, HeaderBlockProps, MediaProps as PCMediaProps, TextTheme } from '@gravity-ui/page-constructor';
|
3
|
+
import { BlockType, ClassNameProps, PostData } from './common';
|
3
4
|
import { PaddingsYFMProps } from './paddings';
|
4
|
-
import { ClassNameProps, PostData, BlockType } from './common';
|
5
5
|
export type AuthorProps = ClassNameProps & {
|
6
6
|
authorId: number;
|
7
7
|
image: string;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { IDevice, IBrowser } from 'ua-parser-js';
|
2
1
|
import { ReactNode } from 'react';
|
2
|
+
import { IBrowser, IDevice } from 'ua-parser-js';
|
3
3
|
import { HeaderBlockProps as PageConstructorHeaderBlockProps } from '@gravity-ui/page-constructor';
|
4
4
|
import { Locale } from '../models/locale';
|
5
5
|
export declare enum Theme {
|
@@ -18,6 +18,7 @@ export type Author = {
|
|
18
18
|
secondName: string | null;
|
19
19
|
description: string | null;
|
20
20
|
fullDescription: string | null;
|
21
|
+
shortDescription: string | null;
|
21
22
|
} & {
|
22
23
|
[x: string]: string | null;
|
23
24
|
};
|
@@ -149,14 +150,3 @@ export type HandleChangeQueryParams = (params: Query) => void;
|
|
149
150
|
export type SetQueryType = (params: Query, options?: {
|
150
151
|
[y: string]: boolean;
|
151
152
|
}) => Promise<void> | void;
|
152
|
-
export declare enum DefaultEventNames {
|
153
|
-
ShareButton = "share-button-click",
|
154
|
-
SaveButton = "save-button-click",
|
155
|
-
ShowMore = "show-more-button-click",
|
156
|
-
PaginatorHome = "paginator-home-button-click",
|
157
|
-
PaginatorNext = "paginator-next-button-click",
|
158
|
-
PaginatorPage = "paginator-page-button-click",
|
159
|
-
Tag = "selector-tag-click",
|
160
|
-
Service = "selector-service-click",
|
161
|
-
SaveOnly = "save-only-button-click"
|
162
|
-
}
|
package/server/models/common.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.BlockType = exports.Theme = void 0;
|
4
4
|
var Theme;
|
5
5
|
(function (Theme) {
|
6
6
|
Theme["Light"] = "light";
|
@@ -19,16 +19,4 @@ var BlockType;
|
|
19
19
|
BlockType["Suggest"] = "blog-suggest-block";
|
20
20
|
BlockType["Meta"] = "blog-meta-block";
|
21
21
|
BlockType["Feed"] = "blog-feed-block";
|
22
|
-
})(BlockType = exports.BlockType || (exports.BlockType = {}));
|
23
|
-
var DefaultEventNames;
|
24
|
-
(function (DefaultEventNames) {
|
25
|
-
DefaultEventNames["ShareButton"] = "share-button-click";
|
26
|
-
DefaultEventNames["SaveButton"] = "save-button-click";
|
27
|
-
DefaultEventNames["ShowMore"] = "show-more-button-click";
|
28
|
-
DefaultEventNames["PaginatorHome"] = "paginator-home-button-click";
|
29
|
-
DefaultEventNames["PaginatorNext"] = "paginator-next-button-click";
|
30
|
-
DefaultEventNames["PaginatorPage"] = "paginator-page-button-click";
|
31
|
-
DefaultEventNames["Tag"] = "selector-tag-click";
|
32
|
-
DefaultEventNames["Service"] = "selector-service-click";
|
33
|
-
DefaultEventNames["SaveOnly"] = "save-only-button-click";
|
34
|
-
})(DefaultEventNames = exports.DefaultEventNames || (exports.DefaultEventNames = {}));
|
22
|
+
})(BlockType = exports.BlockType || (exports.BlockType = {}));
|