@gravity-ui/page-constructor 5.26.0 → 5.27.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/build/cjs/blocks/Banner/Banner.js +2 -2
- package/build/cjs/containers/PageConstructor/PageConstructor.js +3 -1
- package/build/cjs/context/projectSettingsContext/ProjectSettingsContext.d.ts +1 -0
- package/build/cjs/editor/components/AddBlock/AddBlock.js +23 -6
- package/build/cjs/editor/data/index.d.ts +3 -2
- package/build/cjs/editor/data/index.js +19 -12
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -1
- package/build/cjs/sub-blocks/BannerCard/BannerCard.js +3 -3
- package/build/esm/blocks/Banner/Banner.js +2 -2
- package/build/esm/containers/PageConstructor/PageConstructor.js +4 -2
- package/build/esm/context/projectSettingsContext/ProjectSettingsContext.d.ts +1 -0
- package/build/esm/editor/components/AddBlock/AddBlock.js +24 -7
- package/build/esm/editor/data/index.d.ts +3 -2
- package/build/esm/editor/data/index.js +18 -12
- package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -1
- package/build/esm/sub-blocks/BannerCard/BannerCard.js +3 -3
- package/package.json +3 -1
- package/server/models/constructor-items/sub-blocks.d.ts +2 -1
- package/widget/index.js +1 -1
|
@@ -8,8 +8,8 @@ const sub_blocks_1 = require("../../sub-blocks");
|
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
9
|
const b = (0, utils_1.block)('banner-block');
|
|
10
10
|
const BannerBlock = (props) => {
|
|
11
|
-
const { animated } = props, bannerProps = tslib_1.__rest(props, ["animated"]);
|
|
12
|
-
return (react_1.default.createElement(AnimateBlock_1.default, { className: b(), animate: animated },
|
|
11
|
+
const { animated, className } = props, bannerProps = tslib_1.__rest(props, ["animated", "className"]);
|
|
12
|
+
return (react_1.default.createElement(AnimateBlock_1.default, { className: b(null, className), animate: animated },
|
|
13
13
|
react_1.default.createElement(sub_blocks_1.BannerCard, Object.assign({}, bannerProps))));
|
|
14
14
|
};
|
|
15
15
|
exports.BannerBlock = BannerBlock;
|
|
@@ -9,6 +9,7 @@ const RootCn_1 = tslib_1.__importDefault(require("../../components/RootCn"));
|
|
|
9
9
|
const constructor_items_1 = require("../../constructor-items");
|
|
10
10
|
const animateContext_1 = require("../../context/animateContext");
|
|
11
11
|
const innerContext_1 = require("../../context/innerContext");
|
|
12
|
+
const projectSettingsContext_1 = require("../../context/projectSettingsContext");
|
|
12
13
|
const theme_1 = require("../../context/theme");
|
|
13
14
|
const grid_1 = require("../../grid");
|
|
14
15
|
const models_1 = require("../../models");
|
|
@@ -54,7 +55,8 @@ const Constructor = (props) => {
|
|
|
54
55
|
};
|
|
55
56
|
exports.Constructor = Constructor;
|
|
56
57
|
const PageConstructor = (props) => {
|
|
57
|
-
const {
|
|
58
|
+
const { isAnimationEnabled = true } = (0, react_1.useContext)(projectSettingsContext_1.ProjectSettingsContext);
|
|
59
|
+
const { content: { animated = isAnimationEnabled } = {} } = props, rest = tslib_1.__rest(props, ["content"]);
|
|
58
60
|
return (react_1.default.createElement(animateContext_1.AnimateContext.Provider, { value: { animated } },
|
|
59
61
|
react_1.default.createElement(exports.Constructor, Object.assign({ content: props.content }, rest))));
|
|
60
62
|
};
|
|
@@ -9,16 +9,30 @@ const icons_1 = require("@gravity-ui/icons");
|
|
|
9
9
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
10
10
|
const constructor_items_1 = require("../../../constructor-items");
|
|
11
11
|
const utils_1 = require("../../../utils");
|
|
12
|
-
const data_1 =
|
|
12
|
+
const data_1 = require("../../data");
|
|
13
13
|
const b = (0, utils_1.block)('add-block');
|
|
14
14
|
const sortedBlockNames = Object.keys(constructor_items_1.blockMap).sort();
|
|
15
15
|
const AddBlock = ({ onAdd, className }) => {
|
|
16
16
|
const [isOpened, setIsOpened] = (0, react_1.useState)(false);
|
|
17
17
|
const [search, setSearch] = (0, react_1.useState)('');
|
|
18
|
+
const [editorBlocksData, setEditorBlocksData] = (0, react_1.useState)(null);
|
|
18
19
|
const ref = (0, react_1.useRef)(null);
|
|
19
|
-
const blocks = (0, react_1.useMemo)(() =>
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const blocks = (0, react_1.useMemo)(() => {
|
|
21
|
+
if (!editorBlocksData) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
return sortedBlockNames.filter((blockName) => {
|
|
25
|
+
var _a;
|
|
26
|
+
return (_a = editorBlocksData[blockName]) === null || _a === void 0 ? void 0 : _a.meta.title.toLocaleLowerCase().startsWith(search.toLocaleLowerCase());
|
|
27
|
+
});
|
|
28
|
+
}, [editorBlocksData, search]);
|
|
29
|
+
(0, react_1.useEffect)(() => {
|
|
30
|
+
const loadEditorBlocksData = async () => {
|
|
31
|
+
const data = await (0, data_1.getEditorBlocksData)();
|
|
32
|
+
setEditorBlocksData(data);
|
|
33
|
+
};
|
|
34
|
+
loadEditorBlocksData();
|
|
35
|
+
}, []);
|
|
22
36
|
return (react_1.default.createElement("div", { className: b(null, className), ref: ref },
|
|
23
37
|
react_1.default.createElement("button", { className: b('button'), type: "button", onClick: () => {
|
|
24
38
|
setIsOpened(!isOpened);
|
|
@@ -30,8 +44,11 @@ const AddBlock = ({ onAdd, className }) => {
|
|
|
30
44
|
react_1.default.createElement(uikit_1.TextInput, { placeholder: "search", type: "text", value: search, size: "l", onUpdate: (value) => setSearch(value) })),
|
|
31
45
|
react_1.default.createElement("div", { className: b('blocks') }, blocks.map((blockName) => {
|
|
32
46
|
var _a;
|
|
33
|
-
const blockData =
|
|
34
|
-
|
|
47
|
+
const blockData = editorBlocksData === null || editorBlocksData === void 0 ? void 0 : editorBlocksData[blockName];
|
|
48
|
+
if (!blockData) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const Preview = blockData.preview;
|
|
35
52
|
return (react_1.default.createElement("div", { key: blockName, className: b('block'), onClick: () => {
|
|
36
53
|
onAdd(blockData === null || blockData === void 0 ? void 0 : blockData.template);
|
|
37
54
|
setIsOpened(false);
|
|
@@ -9,5 +9,6 @@ export interface EdiorBlockData {
|
|
|
9
9
|
description?: string;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
type EditorBlocksData = Partial<Record<BlockType, EdiorBlockData>>;
|
|
13
|
+
declare function getEditorBlocksData(): Promise<EditorBlocksData>;
|
|
14
|
+
export { EditorBlocksData, getEditorBlocksData };
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEditorBlocksData = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const models_1 = require("../../models");
|
|
5
6
|
const utils_1 = require("../utils");
|
|
6
7
|
const default_preview_1 = tslib_1.__importDefault(require("./previews/default-preview"));
|
|
7
|
-
const
|
|
8
|
+
const header_block_1 = tslib_1.__importDefault(require("./previews/header-block"));
|
|
9
|
+
const getBlockTemplate = (blockType) => { var _a; return (_a = `./templates/${blockType}.json`, Promise.resolve().then(() => tslib_1.__importStar(require(_a)))).then((data) => data.default); };
|
|
8
10
|
const getBlockPreview = (blockType) => {
|
|
9
11
|
try {
|
|
10
|
-
|
|
12
|
+
if (blockType === models_1.BlockType.HeaderBlock) {
|
|
13
|
+
return header_block_1.default;
|
|
14
|
+
}
|
|
15
|
+
return default_preview_1.default;
|
|
11
16
|
}
|
|
12
17
|
catch (err) {
|
|
13
18
|
/*eslint-disable no-console */
|
|
@@ -15,13 +20,15 @@ const getBlockPreview = (blockType) => {
|
|
|
15
20
|
return default_preview_1.default;
|
|
16
21
|
}
|
|
17
22
|
};
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
23
|
+
async function getEditorBlocksData() {
|
|
24
|
+
const EdiorBlockData = {};
|
|
25
|
+
for (const blockType of Object.values(models_1.BlockType)) {
|
|
26
|
+
const template = await getBlockTemplate(blockType);
|
|
27
|
+
const preview = getBlockPreview(blockType);
|
|
28
|
+
template.meta = template.meta || {};
|
|
29
|
+
template.meta.title = template.meta.title || (0, utils_1.formatBlockName)(blockType);
|
|
30
|
+
EdiorBlockData[blockType] = Object.assign(Object.assign({}, template), { preview });
|
|
31
|
+
}
|
|
32
|
+
return EdiorBlockData;
|
|
33
|
+
}
|
|
34
|
+
exports.getEditorBlocksData = getEditorBlocksData;
|
|
@@ -113,11 +113,12 @@ export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, Card
|
|
|
113
113
|
export interface BannerCardProps {
|
|
114
114
|
title: string;
|
|
115
115
|
subtitle?: string;
|
|
116
|
+
className?: string;
|
|
116
117
|
image?: ThemeSupporting<string>;
|
|
117
118
|
disableCompress?: boolean;
|
|
118
119
|
color?: ThemeSupporting<string>;
|
|
119
120
|
theme?: TextTheme;
|
|
120
|
-
button
|
|
121
|
+
button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;
|
|
121
122
|
mediaView?: MediaView;
|
|
122
123
|
}
|
|
123
124
|
export interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {
|
|
@@ -8,7 +8,7 @@ const theme_1 = require("../../context/theme");
|
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
9
|
const b = (0, utils_1.block)('banner-card');
|
|
10
10
|
const BannerCard = (props) => {
|
|
11
|
-
const { title, subtitle, button: { url, text, target, theme: buttonTheme = 'raised' }, color, theme: textTheme = 'light', image, disableCompress, mediaView = 'full', } = props;
|
|
11
|
+
const { title, subtitle, button: { url, text, target, theme: buttonTheme = 'raised' } = {}, color, theme: textTheme = 'light', image, disableCompress, mediaView = 'full', } = props;
|
|
12
12
|
const theme = (0, theme_1.useTheme)();
|
|
13
13
|
const contentStyle = {};
|
|
14
14
|
if (color) {
|
|
@@ -21,8 +21,8 @@ const BannerCard = (props) => {
|
|
|
21
21
|
react_1.default.createElement("h2", { className: b('title') },
|
|
22
22
|
react_1.default.createElement(components_1.HTML, null, title)),
|
|
23
23
|
subtitle && (react_1.default.createElement(components_1.YFMWrapper, { className: b('subtitle'), content: subtitle, modifiers: { constructor: true } }))),
|
|
24
|
-
react_1.default.createElement(components_1.RouterLink, { href: url },
|
|
25
|
-
react_1.default.createElement(components_1.Button, { className: b('button'), theme: buttonTheme, size: "xl", text: text, url: url, target: target }))),
|
|
24
|
+
url && (react_1.default.createElement(components_1.RouterLink, { href: url },
|
|
25
|
+
react_1.default.createElement(components_1.Button, { className: b('button'), theme: buttonTheme, size: "xl", text: text !== null && text !== void 0 ? text : '', url: url, target: target })))),
|
|
26
26
|
react_1.default.createElement(components_1.BackgroundImage, { className: b('image'), src: (0, utils_1.getThemedValue)(image, theme), disableCompress: disableCompress }))));
|
|
27
27
|
};
|
|
28
28
|
exports.BannerCard = BannerCard;
|
|
@@ -6,8 +6,8 @@ import { block } from '../../utils';
|
|
|
6
6
|
import './Banner.css';
|
|
7
7
|
const b = block('banner-block');
|
|
8
8
|
export const BannerBlock = (props) => {
|
|
9
|
-
const { animated } = props, bannerProps = __rest(props, ["animated"]);
|
|
10
|
-
return (React.createElement(AnimateBlock, { className: b(), animate: animated },
|
|
9
|
+
const { animated, className } = props, bannerProps = __rest(props, ["animated", "className"]);
|
|
10
|
+
return (React.createElement(AnimateBlock, { className: b(null, className), animate: animated },
|
|
11
11
|
React.createElement(BannerCard, Object.assign({}, bannerProps))));
|
|
12
12
|
};
|
|
13
13
|
export default BannerBlock;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
|
-
import React, { useMemo } from 'react';
|
|
2
|
+
import React, { useContext, useMemo } from 'react';
|
|
3
3
|
import '@diplodoc/transform/dist/js/yfm';
|
|
4
4
|
import BackgroundMedia from '../../components/BackgroundMedia/BackgroundMedia';
|
|
5
5
|
import RootCn from '../../components/RootCn';
|
|
6
6
|
import { blockMap, navItemMap, subBlockMap } from '../../constructor-items';
|
|
7
7
|
import { AnimateContext } from '../../context/animateContext';
|
|
8
8
|
import { InnerContext } from '../../context/innerContext';
|
|
9
|
+
import { ProjectSettingsContext } from '../../context/projectSettingsContext';
|
|
9
10
|
import { useTheme } from '../../context/theme';
|
|
10
11
|
import { Grid } from '../../grid';
|
|
11
12
|
import { BlockType, BlockTypes, HeaderBlockTypes, NavigationItemTypes, SubBlockTypes, } from '../../models';
|
|
@@ -51,7 +52,8 @@ export const Constructor = (props) => {
|
|
|
51
52
|
React.createElement(ConstructorBlocks, { items: restBlocks })))))))));
|
|
52
53
|
};
|
|
53
54
|
export const PageConstructor = (props) => {
|
|
54
|
-
const {
|
|
55
|
+
const { isAnimationEnabled = true } = useContext(ProjectSettingsContext);
|
|
56
|
+
const { content: { animated = isAnimationEnabled } = {} } = props, rest = __rest(props, ["content"]);
|
|
55
57
|
return (React.createElement(AnimateContext.Provider, { value: { animated } },
|
|
56
58
|
React.createElement(Constructor, Object.assign({ content: props.content }, rest))));
|
|
57
59
|
};
|
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
2
2
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
3
3
|
// TODO fix in https://github.com/gravity-ui/page-constructor/issues/965
|
|
4
|
-
import React, { useMemo, useRef, useState } from 'react';
|
|
4
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { Plus } from '@gravity-ui/icons';
|
|
6
6
|
import { Popup, TextInput } from '@gravity-ui/uikit';
|
|
7
7
|
import { blockMap } from '../../../constructor-items';
|
|
8
8
|
import { block } from '../../../utils';
|
|
9
|
-
import
|
|
9
|
+
import { getEditorBlocksData } from '../../data';
|
|
10
10
|
import './AddBlock.css';
|
|
11
11
|
const b = block('add-block');
|
|
12
12
|
const sortedBlockNames = Object.keys(blockMap).sort();
|
|
13
13
|
const AddBlock = ({ onAdd, className }) => {
|
|
14
14
|
const [isOpened, setIsOpened] = useState(false);
|
|
15
15
|
const [search, setSearch] = useState('');
|
|
16
|
+
const [editorBlocksData, setEditorBlocksData] = useState(null);
|
|
16
17
|
const ref = useRef(null);
|
|
17
|
-
const blocks = useMemo(() =>
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const blocks = useMemo(() => {
|
|
19
|
+
if (!editorBlocksData) {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
return sortedBlockNames.filter((blockName) => {
|
|
23
|
+
var _a;
|
|
24
|
+
return (_a = editorBlocksData[blockName]) === null || _a === void 0 ? void 0 : _a.meta.title.toLocaleLowerCase().startsWith(search.toLocaleLowerCase());
|
|
25
|
+
});
|
|
26
|
+
}, [editorBlocksData, search]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const loadEditorBlocksData = async () => {
|
|
29
|
+
const data = await getEditorBlocksData();
|
|
30
|
+
setEditorBlocksData(data);
|
|
31
|
+
};
|
|
32
|
+
loadEditorBlocksData();
|
|
33
|
+
}, []);
|
|
20
34
|
return (React.createElement("div", { className: b(null, className), ref: ref },
|
|
21
35
|
React.createElement("button", { className: b('button'), type: "button", onClick: () => {
|
|
22
36
|
setIsOpened(!isOpened);
|
|
@@ -28,8 +42,11 @@ const AddBlock = ({ onAdd, className }) => {
|
|
|
28
42
|
React.createElement(TextInput, { placeholder: "search", type: "text", value: search, size: "l", onUpdate: (value) => setSearch(value) })),
|
|
29
43
|
React.createElement("div", { className: b('blocks') }, blocks.map((blockName) => {
|
|
30
44
|
var _a;
|
|
31
|
-
const blockData =
|
|
32
|
-
|
|
45
|
+
const blockData = editorBlocksData === null || editorBlocksData === void 0 ? void 0 : editorBlocksData[blockName];
|
|
46
|
+
if (!blockData) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const Preview = blockData.preview;
|
|
33
50
|
return (React.createElement("div", { key: blockName, className: b('block'), onClick: () => {
|
|
34
51
|
onAdd(blockData === null || blockData === void 0 ? void 0 : blockData.template);
|
|
35
52
|
setIsOpened(false);
|
|
@@ -9,5 +9,6 @@ export interface EdiorBlockData {
|
|
|
9
9
|
description?: string;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
type EditorBlocksData = Partial<Record<BlockType, EdiorBlockData>>;
|
|
13
|
+
declare function getEditorBlocksData(): Promise<EditorBlocksData>;
|
|
14
|
+
export { EditorBlocksData, getEditorBlocksData };
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { BlockType } from '../../models';
|
|
2
2
|
import { formatBlockName } from '../utils';
|
|
3
3
|
import DefaultPreview from './previews/default-preview';
|
|
4
|
-
|
|
4
|
+
import HeaderBlock from './previews/header-block';
|
|
5
|
+
const getBlockTemplate = (blockType) => import(`./templates/${blockType}.json`).then((data) => data.default);
|
|
5
6
|
const getBlockPreview = (blockType) => {
|
|
6
7
|
try {
|
|
7
|
-
|
|
8
|
+
if (blockType === BlockType.HeaderBlock) {
|
|
9
|
+
return HeaderBlock;
|
|
10
|
+
}
|
|
11
|
+
return DefaultPreview;
|
|
8
12
|
}
|
|
9
13
|
catch (err) {
|
|
10
14
|
/*eslint-disable no-console */
|
|
@@ -12,13 +16,15 @@ const getBlockPreview = (blockType) => {
|
|
|
12
16
|
return DefaultPreview;
|
|
13
17
|
}
|
|
14
18
|
};
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
19
|
+
async function getEditorBlocksData() {
|
|
20
|
+
const EdiorBlockData = {};
|
|
21
|
+
for (const blockType of Object.values(BlockType)) {
|
|
22
|
+
const template = await getBlockTemplate(blockType);
|
|
23
|
+
const preview = getBlockPreview(blockType);
|
|
24
|
+
template.meta = template.meta || {};
|
|
25
|
+
template.meta.title = template.meta.title || formatBlockName(blockType);
|
|
26
|
+
EdiorBlockData[blockType] = Object.assign(Object.assign({}, template), { preview });
|
|
27
|
+
}
|
|
28
|
+
return EdiorBlockData;
|
|
29
|
+
}
|
|
30
|
+
export { getEditorBlocksData };
|
|
@@ -113,11 +113,12 @@ export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, Card
|
|
|
113
113
|
export interface BannerCardProps {
|
|
114
114
|
title: string;
|
|
115
115
|
subtitle?: string;
|
|
116
|
+
className?: string;
|
|
116
117
|
image?: ThemeSupporting<string>;
|
|
117
118
|
disableCompress?: boolean;
|
|
118
119
|
color?: ThemeSupporting<string>;
|
|
119
120
|
theme?: TextTheme;
|
|
120
|
-
button
|
|
121
|
+
button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;
|
|
121
122
|
mediaView?: MediaView;
|
|
122
123
|
}
|
|
123
124
|
export interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {
|
|
@@ -5,7 +5,7 @@ import { block, getThemedValue } from '../../utils';
|
|
|
5
5
|
import './BannerCard.css';
|
|
6
6
|
const b = block('banner-card');
|
|
7
7
|
export const BannerCard = (props) => {
|
|
8
|
-
const { title, subtitle, button: { url, text, target, theme: buttonTheme = 'raised' }, color, theme: textTheme = 'light', image, disableCompress, mediaView = 'full', } = props;
|
|
8
|
+
const { title, subtitle, button: { url, text, target, theme: buttonTheme = 'raised' } = {}, color, theme: textTheme = 'light', image, disableCompress, mediaView = 'full', } = props;
|
|
9
9
|
const theme = useTheme();
|
|
10
10
|
const contentStyle = {};
|
|
11
11
|
if (color) {
|
|
@@ -18,8 +18,8 @@ export const BannerCard = (props) => {
|
|
|
18
18
|
React.createElement("h2", { className: b('title') },
|
|
19
19
|
React.createElement(HTML, null, title)),
|
|
20
20
|
subtitle && (React.createElement(YFMWrapper, { className: b('subtitle'), content: subtitle, modifiers: { constructor: true } }))),
|
|
21
|
-
React.createElement(RouterLink, { href: url },
|
|
22
|
-
React.createElement(Button, { className: b('button'), theme: buttonTheme, size: "xl", text: text, url: url, target: target }))),
|
|
21
|
+
url && (React.createElement(RouterLink, { href: url },
|
|
22
|
+
React.createElement(Button, { className: b('button'), theme: buttonTheme, size: "xl", text: text !== null && text !== void 0 ? text : '', url: url, target: target })))),
|
|
23
23
|
React.createElement(BackgroundImage, { className: b('image'), src: getThemedValue(image, theme), disableCompress: disableCompress }))));
|
|
24
24
|
};
|
|
25
25
|
export default BannerCard;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.27.0",
|
|
4
4
|
"description": "Gravity UI Page Constructor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -202,6 +202,8 @@
|
|
|
202
202
|
"ts-jest": "^29.0.3",
|
|
203
203
|
"tslib": "^2.4.0",
|
|
204
204
|
"typescript": "^4.9.4",
|
|
205
|
+
"vite-plugin-commonjs": "^0.10.1",
|
|
206
|
+
"vite-plugin-svgr": "^4.2.0",
|
|
205
207
|
"webpack": "^5.88.2",
|
|
206
208
|
"webpack-cli": "^5.1.4",
|
|
207
209
|
"webpack-shell-plugin-next": "^2.3.1"
|
|
@@ -113,11 +113,12 @@ export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, Card
|
|
|
113
113
|
export interface BannerCardProps {
|
|
114
114
|
title: string;
|
|
115
115
|
subtitle?: string;
|
|
116
|
+
className?: string;
|
|
116
117
|
image?: ThemeSupporting<string>;
|
|
117
118
|
disableCompress?: boolean;
|
|
118
119
|
color?: ThemeSupporting<string>;
|
|
119
120
|
theme?: TextTheme;
|
|
120
|
-
button
|
|
121
|
+
button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;
|
|
121
122
|
mediaView?: MediaView;
|
|
122
123
|
}
|
|
123
124
|
export interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {
|