@gravity-ui/blog-constructor 4.0.0-alpha.1 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/build/cjs/blocks/Feed/Feed.js +47 -37
  3. package/build/cjs/blocks/Feed/reducer.d.ts +0 -5
  4. package/build/cjs/blocks/Feed/reducer.js +1 -4
  5. package/build/cjs/blocks/Header/schema.d.ts +81 -0
  6. package/build/cjs/blocks/Media/schema.d.ts +81 -0
  7. package/build/cjs/blocks/YFM/YFM.js +1 -1
  8. package/build/cjs/components/FeedHeader/FeedHeader.js +2 -2
  9. package/build/cjs/components/FeedHeader/components/Controls/Controls.d.ts +2 -3
  10. package/build/cjs/components/FeedHeader/components/Controls/Controls.js +24 -16
  11. package/build/cjs/components/Paginator/Paginator.d.ts +1 -1
  12. package/build/cjs/components/Paginator/Paginator.js +2 -2
  13. package/build/cjs/components/Paginator/types.d.ts +0 -1
  14. package/build/cjs/components/PostInfo/components/Save.js +6 -1
  15. package/build/cjs/components/Posts/Posts.css +25 -0
  16. package/build/cjs/components/Posts/Posts.d.ts +0 -1
  17. package/build/cjs/components/Posts/Posts.js +5 -4
  18. package/build/cjs/components/Prompt/Prompt.css +61 -0
  19. package/build/cjs/components/Prompt/Prompt.d.ts +17 -0
  20. package/build/cjs/components/Prompt/Prompt.js +41 -0
  21. package/build/cjs/components/PromptSignIn/PromptSignIn.d.ts +10 -0
  22. package/build/cjs/components/PromptSignIn/PromptSignIn.js +35 -0
  23. package/build/cjs/components/PromptSignIn/hooks/usePromptSignInProps.d.ts +6 -0
  24. package/build/cjs/components/PromptSignIn/hooks/usePromptSignInProps.js +16 -0
  25. package/build/cjs/components/Search/Search.js +1 -1
  26. package/build/cjs/containers/BlogPage/BlogPage.d.ts +4 -1
  27. package/build/cjs/containers/BlogPage/BlogPage.js +56 -18
  28. package/build/cjs/contexts/LikesContext.d.ts +2 -0
  29. package/build/cjs/hooks/useOpenCloseTimer.d.ts +9 -0
  30. package/build/cjs/hooks/useOpenCloseTimer.js +30 -0
  31. package/build/cjs/i18n/index.d.ts +3 -1
  32. package/build/cjs/i18n/index.js +6 -0
  33. package/build/cjs/models/common.d.ts +5 -1
  34. package/build/cjs/schema/index.d.ts +162 -0
  35. package/build/cjs/utils/common.js +1 -1
  36. package/build/esm/blocks/Feed/Feed.js +47 -37
  37. package/build/esm/blocks/Feed/reducer.d.ts +0 -5
  38. package/build/esm/blocks/Feed/reducer.js +1 -4
  39. package/build/esm/blocks/Header/schema.d.ts +81 -0
  40. package/build/esm/blocks/Media/schema.d.ts +81 -0
  41. package/build/esm/blocks/YFM/YFM.js +1 -1
  42. package/build/esm/components/FeedHeader/FeedHeader.js +2 -2
  43. package/build/esm/components/FeedHeader/components/Controls/Controls.d.ts +2 -3
  44. package/build/esm/components/FeedHeader/components/Controls/Controls.js +25 -17
  45. package/build/esm/components/Paginator/Paginator.d.ts +1 -1
  46. package/build/esm/components/Paginator/Paginator.js +2 -2
  47. package/build/esm/components/Paginator/types.d.ts +0 -1
  48. package/build/esm/components/PostInfo/components/Save.js +6 -1
  49. package/build/esm/components/Posts/Posts.css +25 -0
  50. package/build/esm/components/Posts/Posts.d.ts +0 -1
  51. package/build/esm/components/Posts/Posts.js +5 -4
  52. package/build/esm/components/Prompt/Prompt.css +61 -0
  53. package/build/esm/components/Prompt/Prompt.d.ts +18 -0
  54. package/build/esm/components/Prompt/Prompt.js +35 -0
  55. package/build/esm/components/PromptSignIn/PromptSignIn.d.ts +10 -0
  56. package/build/esm/components/PromptSignIn/PromptSignIn.js +28 -0
  57. package/build/esm/components/PromptSignIn/hooks/usePromptSignInProps.d.ts +6 -0
  58. package/build/esm/components/PromptSignIn/hooks/usePromptSignInProps.js +12 -0
  59. package/build/esm/components/Search/Search.js +1 -1
  60. package/build/esm/containers/BlogPage/BlogPage.d.ts +4 -1
  61. package/build/esm/containers/BlogPage/BlogPage.js +33 -18
  62. package/build/esm/contexts/LikesContext.d.ts +2 -0
  63. package/build/esm/hooks/useOpenCloseTimer.d.ts +9 -0
  64. package/build/esm/hooks/useOpenCloseTimer.js +26 -0
  65. package/build/esm/i18n/index.d.ts +3 -1
  66. package/build/esm/i18n/index.js +6 -0
  67. package/build/esm/models/common.d.ts +5 -1
  68. package/build/esm/schema/index.d.ts +162 -0
  69. package/build/esm/utils/common.js +1 -1
  70. package/package.json +3 -6
  71. package/server/data/sanitizeMeta.d.ts +2 -0
  72. package/server/data/sanitizeMeta.js +2 -0
  73. package/server/data/transformPageContent.js +1 -1
  74. package/server/models/common.d.ts +5 -1
  75. package/build/cjs/blocks/YFM/__tests__/YFM.test.d.ts +0 -1
  76. package/build/cjs/blocks/YFM/__tests__/YFM.test.js +0 -16
  77. package/build/esm/blocks/YFM/__tests__/YFM.test.d.ts +0 -1
  78. package/build/esm/blocks/YFM/__tests__/YFM.test.js +0 -11
@@ -0,0 +1,61 @@
1
+ .bc-prompt__content {
2
+ box-shadow: 0px 4px 24px var(--pc-color-sfx-shadow), 0px 2px 8px var(--pc-color-sfx-shadow);
3
+ }
4
+
5
+ /* use this for style redefinitions to awoid problems with
6
+ unpredictable css rules order in build */
7
+ @keyframes bc-prompt_open {
8
+ 0% {
9
+ opacity: 0;
10
+ transform: translateY(100%);
11
+ }
12
+ 100% {
13
+ opacity: 1;
14
+ transform: translateY(0%);
15
+ }
16
+ }
17
+ @keyframes bc-prompt_close {
18
+ 0% {
19
+ opacity: 1;
20
+ transform: translateY(0%);
21
+ }
22
+ 100% {
23
+ opacity: 0;
24
+ transform: translateY(100%);
25
+ }
26
+ }
27
+ .bc-prompt {
28
+ display: flex;
29
+ width: 100%;
30
+ justify-content: center;
31
+ overflow: hidden;
32
+ position: fixed;
33
+ bottom: 0;
34
+ }
35
+ .bc-prompt:not(.bc-prompt_mounted) {
36
+ display: none;
37
+ }
38
+ .bc-prompt__content {
39
+ display: flex;
40
+ flex-flow: row wrap;
41
+ gap: 16px;
42
+ align-items: center;
43
+ margin: 24px;
44
+ padding: 16px 20px;
45
+ border-radius: calc(var(--pc-border-radius) / 2);
46
+ background-color: var(--yc-color-base-float);
47
+ font-size: var(--yc-text-body-2-font-size);
48
+ }
49
+ .bc-prompt_close {
50
+ pointer-events: none;
51
+ }
52
+ .bc-prompt_open > .bc-prompt__content {
53
+ opacity: 0;
54
+ transform: translateY(100%);
55
+ animation: bc-prompt_open 600ms forwards;
56
+ }
57
+ .bc-prompt_close > .bc-prompt__content {
58
+ opacity: 1;
59
+ transform: translateY(0%);
60
+ animation: bc-prompt_close 600ms forwards;
61
+ }
@@ -0,0 +1,18 @@
1
+ import { ButtonProps } from '@gravity-ui/uikit';
2
+ import './Prompt.css';
3
+ export interface PromptProps {
4
+ text: string;
5
+ actions: ButtonProps[];
6
+ openTimestamp?: number;
7
+ openDuration?: number;
8
+ className?: string;
9
+ theme?: 'grey' | 'beige' | 'white';
10
+ }
11
+ /**
12
+ * Popup that appears with text message and button(s) for given `actions`.
13
+ * Features:
14
+ * - Automatically disappears after `openDuration` in milliseconds
15
+ * - `openTimestamp` (`Date.now()`) resets the visible duration
16
+ * @returns {JSX|null}
17
+ */
18
+ export declare const Prompt: ({ text, actions, className, openTimestamp, openDuration, theme, }: PromptProps) => JSX.Element;
@@ -0,0 +1,35 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ import { Button } from '@gravity-ui/uikit';
14
+ import { useOpenCloseTimer } from '../../hooks/useOpenCloseTimer';
15
+ import { block } from '../../utils/cn';
16
+ import './Prompt.css';
17
+ const b = block('prompt');
18
+ /**
19
+ * Popup that appears with text message and button(s) for given `actions`.
20
+ * Features:
21
+ * - Automatically disappears after `openDuration` in milliseconds
22
+ * - `openTimestamp` (`Date.now()`) resets the visible duration
23
+ * @returns {JSX|null}
24
+ */
25
+ export const Prompt = ({ text, actions, className, openTimestamp = 0, openDuration, theme, }) => {
26
+ const { open } = useOpenCloseTimer(openTimestamp, openDuration);
27
+ const mounted = openTimestamp > 0;
28
+ return (React.createElement("div", { className: b({ theme, open, close: !open, mounted }, className) },
29
+ React.createElement("div", { className: b('content') },
30
+ React.createElement("span", { className: b('text') }, text),
31
+ React.createElement("div", { className: b('actions') }, actions.map((_a, i) => {
32
+ var { view = 'action', className: btnClass } = _a, btnProps = __rest(_a, ["view", "className"]);
33
+ return (React.createElement(Button, Object.assign({ key: i, className: b('action', btnClass), view: view }, btnProps)));
34
+ })))));
35
+ };
@@ -0,0 +1,10 @@
1
+ import React, { SyntheticEvent } from 'react';
2
+ import { PromptProps } from '../Prompt/Prompt';
3
+ export interface PromptSignInProps extends Partial<PromptProps> {
4
+ onClickSignIn?: React.EventHandler<SyntheticEvent>;
5
+ }
6
+ /**
7
+ * Authentication Popup that appears when user action requires login
8
+ * @returns {JSX|null}
9
+ */
10
+ export declare const PromptSignIn: ({ text, onClickSignIn, actions, ...props }: PromptSignInProps) => JSX.Element;
@@ -0,0 +1,28 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ import { Keyset, i18 } from '../../i18n';
14
+ import { Prompt } from '../Prompt/Prompt';
15
+ /**
16
+ * Authentication Popup that appears when user action requires login
17
+ * @returns {JSX|null}
18
+ */
19
+ export const PromptSignIn = (_a) => {
20
+ var { text = i18(Keyset.PromptSignInOnLike), onClickSignIn = () => alert(i18(Keyset.SignIn)), actions = [
21
+ {
22
+ children: i18(Keyset.SignIn),
23
+ onClick: onClickSignIn,
24
+ size: 'l',
25
+ },
26
+ ] } = _a, props = __rest(_a, ["text", "onClickSignIn", "actions"]);
27
+ return React.createElement(Prompt, Object.assign({}, { text, actions }, props));
28
+ };
@@ -0,0 +1,6 @@
1
+ import React, { SyntheticEvent } from 'react';
2
+ export declare function usePromptSignInProps(onClickSignIn?: React.EventHandler<SyntheticEvent>): {
3
+ onClickSignIn: ((event: React.SyntheticEvent<Element, Event>) => void) | undefined;
4
+ openTimestamp: number;
5
+ requireSignIn: (() => void) | undefined;
6
+ };
@@ -0,0 +1,12 @@
1
+ import { useMemo, useState } from 'react';
2
+ export function usePromptSignInProps(onClickSignIn) {
3
+ const [openTimestamp, setTime] = useState(0);
4
+ const requireSignIn = useMemo(() => {
5
+ return onClickSignIn
6
+ ? () => {
7
+ setTime(Date.now());
8
+ }
9
+ : undefined;
10
+ }, [onClickSignIn, setTime]);
11
+ return { onClickSignIn, openTimestamp, requireSignIn };
12
+ }
@@ -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,3 +1,4 @@
1
+ import React, { SyntheticEvent } from 'react';
1
2
  import { NavigationData, PageConstructorProviderProps, PageContent } from '@gravity-ui/page-constructor';
2
3
  import { GetPostsType, MetaProps, PostsProps, Service, SetQueryType, Tag, ToggleLikeCallbackType } from '../../models/common';
3
4
  import './BlogPage.css';
@@ -14,5 +15,7 @@ export type BlogPageProps = {
14
15
  setQuery?: SetQueryType;
15
16
  settings?: PageConstructorProviderProps;
16
17
  pageCountForShowSupportButtons?: number;
18
+ isSignedInUser?: boolean;
19
+ onClickSignIn?: React.EventHandler<SyntheticEvent>;
17
20
  };
18
- export declare const BlogPage: ({ content, posts, tags, services, getPosts, metaData, hasLikes, toggleLike, navigation, settings, pageCountForShowSupportButtons, }: BlogPageProps) => JSX.Element;
21
+ export declare const BlogPage: ({ content, posts, tags, services, getPosts, metaData, hasLikes, toggleLike, navigation, settings, pageCountForShowSupportButtons, isSignedInUser, onClickSignIn, }: BlogPageProps) => JSX.Element;
@@ -1,24 +1,39 @@
1
- import React from 'react';
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React, { useMemo } from 'react';
2
13
  import { PageConstructor, PageConstructorProvider, } from '@gravity-ui/page-constructor';
3
14
  import { MetaWrapper } from '../../components/MetaWrapper/MetaWrapper';
15
+ import { PromptSignIn } from '../../components/PromptSignIn/PromptSignIn';
16
+ import { usePromptSignInProps } from '../../components/PromptSignIn/hooks/usePromptSignInProps';
4
17
  import componentMap from '../../constructor/blocksMap';
5
18
  import { FeedContext } from '../../contexts/FeedContext';
6
19
  import { LikesContext } from '../../contexts/LikesContext';
7
20
  import './BlogPage.css';
8
- export const BlogPage = ({ content, posts, tags, services, getPosts, metaData, hasLikes = false, toggleLike, navigation, settings, pageCountForShowSupportButtons, }) => (React.createElement("main", null,
9
- React.createElement(LikesContext.Provider, { value: {
10
- toggleLike: toggleLike,
11
- hasLikes,
12
- } },
13
- React.createElement(FeedContext.Provider, { value: {
14
- posts: posts.posts,
15
- pinnedPost: posts.pinnedPost,
16
- totalCount: posts.count,
17
- tags,
18
- services: services !== null && services !== void 0 ? services : [],
19
- getPosts,
20
- pageCountForShowSupportButtons,
21
- } },
22
- React.createElement(PageConstructorProvider, Object.assign({}, settings),
23
- metaData ? React.createElement(MetaWrapper, Object.assign({}, metaData)) : null,
24
- React.createElement(PageConstructor, { content: content, custom: componentMap, navigation: navigation }))))));
21
+ export const BlogPage = ({ content, posts, tags, services, getPosts, metaData, hasLikes = false, toggleLike, navigation, settings, pageCountForShowSupportButtons, isSignedInUser = false, onClickSignIn, }) => {
22
+ const _a = usePromptSignInProps(onClickSignIn), { requireSignIn } = _a, promptSignInProps = __rest(_a, ["requireSignIn"]);
23
+ const likes = useMemo(() => ({ toggleLike, hasLikes, isSignedInUser, requireSignIn }), [toggleLike, hasLikes, isSignedInUser, requireSignIn]);
24
+ return (React.createElement("main", null,
25
+ React.createElement(LikesContext.Provider, { value: likes },
26
+ React.createElement(FeedContext.Provider, { value: {
27
+ posts: posts.posts,
28
+ pinnedPost: posts.pinnedPost,
29
+ totalCount: posts.count,
30
+ tags,
31
+ services: services !== null && services !== void 0 ? services : [],
32
+ getPosts,
33
+ pageCountForShowSupportButtons,
34
+ } },
35
+ React.createElement(PageConstructorProvider, Object.assign({}, settings),
36
+ metaData ? React.createElement(MetaWrapper, Object.assign({}, metaData)) : null,
37
+ React.createElement(PageConstructor, { content: content, custom: componentMap, navigation: navigation })))),
38
+ React.createElement(PromptSignIn, Object.assign({}, promptSignInProps))));
39
+ };
@@ -3,5 +3,7 @@ import { ToggleLikeCallbackType } from '../models/common';
3
3
  export interface LikesContextProps {
4
4
  toggleLike?: ToggleLikeCallbackType;
5
5
  hasLikes?: boolean;
6
+ isSignedInUser?: boolean;
7
+ requireSignIn?: React.MouseEventHandler;
6
8
  }
7
9
  export declare const LikesContext: React.Context<LikesContextProps>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Timer to automatically update `open` state after a given duration
3
+ * @param {number} openTimestamp - UNIX timestamp in milliseconds
4
+ * @param {number} openDuration - in milliseconds
5
+ * @returns {{open: boolean}} {open} - whether the state is open
6
+ */
7
+ export declare function useOpenCloseTimer(openTimestamp?: number, openDuration?: number): {
8
+ open: boolean;
9
+ };
@@ -0,0 +1,26 @@
1
+ import { useEffect, useState } from 'react';
2
+ /**
3
+ * Timer to automatically update `open` state after a given duration
4
+ * @param {number} openTimestamp - UNIX timestamp in milliseconds
5
+ * @param {number} openDuration - in milliseconds
6
+ * @returns {{open: boolean}} {open} - whether the state is open
7
+ */
8
+ export function useOpenCloseTimer(openTimestamp = Date.now(), openDuration = 4000) {
9
+ const open = Date.now() - openTimestamp < openDuration;
10
+ const [, reset] = useState(0); // time to reset `open` state
11
+ useEffect(() => {
12
+ const closeTime = openTimestamp + openDuration;
13
+ const delay = closeTime - Date.now();
14
+ if (delay <= 0) {
15
+ return;
16
+ }
17
+ const timer = setTimeout(() => {
18
+ reset(Date.now);
19
+ }, delay);
20
+ // eslint-disable-next-line consistent-return
21
+ return () => {
22
+ clearTimeout(timer);
23
+ };
24
+ }, [openTimestamp, openDuration]);
25
+ return { open };
26
+ }
@@ -17,6 +17,8 @@ export declare enum Keyset {
17
17
  Search = "search_placeholder",
18
18
  AllTags = "label_all_tags",
19
19
  ActionSavedOnly = "action_saved_only",
20
- AllServices = "label_all_services"
20
+ AllServices = "label_all_services",
21
+ PromptSignInOnLike = "prompt_sign_in_on_like",
22
+ SignIn = "Sign In"
21
23
  }
22
24
  export declare const i18: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
@@ -21,6 +21,8 @@ export var Keyset;
21
21
  Keyset["AllTags"] = "label_all_tags";
22
22
  Keyset["ActionSavedOnly"] = "action_saved_only";
23
23
  Keyset["AllServices"] = "label_all_services";
24
+ Keyset["PromptSignInOnLike"] = "prompt_sign_in_on_like";
25
+ Keyset["SignIn"] = "Sign In";
24
26
  })(Keyset || (Keyset = {}));
25
27
  i18n.registerKeyset(Lang.En, KEYSET_NAME, {
26
28
  [Keyset.Title]: 'Blog',
@@ -39,11 +41,13 @@ i18n.registerKeyset(Lang.En, KEYSET_NAME, {
39
41
  [Keyset.AllTags]: 'All topics',
40
42
  [Keyset.ActionSavedOnly]: 'Saved',
41
43
  [Keyset.AllServices]: 'All Services',
44
+ [Keyset.PromptSignInOnLike]: 'Please sign in to save your bookmarks',
42
45
  [Keyset.ContextReadingTime]: [
43
46
  '{{count}} min to read',
44
47
  '{{count}} mins to read',
45
48
  '{{count}} mins to read',
46
49
  ],
50
+ [Keyset.SignIn]: 'Sign In',
47
51
  });
48
52
  i18n.registerKeyset(Lang.Ru, KEYSET_NAME, {
49
53
  [Keyset.Title]: 'Блог',
@@ -62,10 +66,12 @@ i18n.registerKeyset(Lang.Ru, KEYSET_NAME, {
62
66
  [Keyset.AllTags]: 'Все темы',
63
67
  [Keyset.ActionSavedOnly]: 'Сохранённые',
64
68
  [Keyset.AllServices]: 'Все сервисы',
69
+ [Keyset.PromptSignInOnLike]: 'Войдите, чтобы добавить доклад в своё расписание',
65
70
  [Keyset.ContextReadingTime]: [
66
71
  '{{count}} минута чтения',
67
72
  '{{count}} минуты чтения',
68
73
  '{{count}} минут чтения',
69
74
  ],
75
+ [Keyset.SignIn]: 'Войти',
70
76
  });
71
77
  export const i18 = i18n.keyset(KEYSET_NAME);
@@ -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-alpha.1",
3
+ "version": "4.1.0",
4
4
  "description": "Gravity UI Blog Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -65,7 +65,7 @@
65
65
  "peerDependencies": {
66
66
  "@doc-tools/transform": "^2.9.0",
67
67
  "@gravity-ui/uikit": "^4.1.0",
68
- "@gravity-ui/page-constructor": "^2.2.1",
68
+ "@gravity-ui/page-constructor": "^3.1.1",
69
69
  "react": "^16.0.0 || ^17.0.0 | ^18.0.0"
70
70
  },
71
71
  "devDependencies": {
@@ -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.0.0-alpha.6",
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
  }
@@ -1,6 +1,8 @@
1
1
  import { PostMetaProps } from '../models/common';
2
2
  /**
3
3
  * Function for sanitized meta-data fields
4
+ * @param metaData PostMetaProps
5
+ * @returns metaData
4
6
  */
5
7
  export declare const sanitizeMeta: (metaData: PostMetaProps) => {
6
8
  title: string;
@@ -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 {};