@gravity-ui/page-constructor 2.22.0-alpha → 2.22.0-alpha.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 +53 -0
- package/build/cjs/components/Anchor/Anchor.d.ts +2 -2
- package/build/cjs/components/Anchor/Anchor.js +1 -1
- package/build/cjs/components/BackgroundImage/BackgroundImage.js +2 -2
- package/build/cjs/components/BlockBase/BlockBase.d.ts +3 -2
- package/build/cjs/components/BlockBase/BlockBase.js +4 -2
- package/build/cjs/components/Button/Button.css +3 -0
- package/build/cjs/components/Button/Button.js +5 -4
- package/build/cjs/components/Image/Image.d.ts +1 -0
- package/build/cjs/components/Image/Image.js +2 -2
- package/build/cjs/containers/Loadable/Loadable.d.ts +2 -2
- package/build/cjs/containers/PageConstructor/PageConstructor.js +5 -3
- package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +3 -2
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +5 -5
- package/build/cjs/context/innerContext/InnerContext.d.ts +2 -1
- package/build/cjs/customization/BlockDecoration.d.ts +3 -0
- package/build/cjs/customization/BlockDecoration.js +22 -0
- package/build/cjs/editor/Components/AddBlock/AddBlock.css +82 -0
- package/build/cjs/editor/Components/AddBlock/AddBlock.d.ts +7 -0
- package/build/cjs/editor/Components/AddBlock/AddBlock.js +43 -0
- package/build/cjs/editor/Components/EditBlock/EditBlock.css +47 -0
- package/build/cjs/editor/Components/EditBlock/EditBlock.d.ts +4 -0
- package/build/cjs/editor/Components/EditBlock/EditBlock.js +32 -0
- package/build/cjs/editor/Containers/Editor.d.ts +2 -0
- package/build/cjs/editor/Containers/Editor.js +24 -0
- package/build/cjs/editor/data/index.d.ts +13 -0
- package/build/cjs/editor/data/index.js +27 -0
- package/build/cjs/editor/data/previews/default-preview.d.ts +3 -0
- package/build/cjs/editor/data/previews/default-preview.js +18 -0
- package/build/cjs/editor/data/previews/header-block.d.ts +3 -0
- package/build/cjs/editor/data/previews/header-block.js +19 -0
- package/build/cjs/editor/index.d.ts +2 -0
- package/build/cjs/editor/index.js +7 -0
- package/build/cjs/editor/store/index.d.ts +15 -0
- package/build/cjs/editor/store/index.js +32 -0
- package/build/cjs/editor/store/reducer.d.ts +41 -0
- package/build/cjs/editor/store/reducer.js +59 -0
- package/build/cjs/editor/store/utils.d.ts +13 -0
- package/build/cjs/editor/store/utils.js +34 -0
- package/build/cjs/editor/styles/mixins.css +0 -0
- package/build/cjs/editor/styles/variables.css +0 -0
- package/build/cjs/editor/types/index.d.ts +17 -0
- package/build/cjs/editor/types/index.js +2 -0
- package/build/cjs/editor/utils/index.d.ts +11 -0
- package/build/cjs/editor/utils/index.js +12 -0
- package/build/cjs/grid/Col/Col.d.ts +1 -1
- package/build/cjs/hooks/useMetrika.js +0 -7
- package/build/cjs/internal-typings/global.d.ts +18 -16
- package/build/cjs/models/constructor-items/blocks.d.ts +1 -11
- package/build/cjs/models/constructor-items/blocks.js +0 -2
- package/build/cjs/models/constructor-items/common.d.ts +3 -3
- package/build/cjs/models/constructor.d.ts +4 -1
- package/build/cjs/models/customization.d.ts +9 -0
- package/build/cjs/models/customization.js +2 -0
- package/build/cjs/models/index.d.ts +1 -0
- package/build/cjs/models/index.js +1 -0
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +2 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.js +5 -2
- package/build/cjs/sub-blocks/HubspotForm/index.d.ts +1 -1
- package/build/cjs/sub-blocks/HubspotForm/index.js +6 -5
- package/build/cjs/utils/blocks.d.ts +4 -1
- package/build/cjs/utils/blocks.js +11 -1
- package/build/esm/components/Anchor/Anchor.d.ts +2 -2
- package/build/esm/components/Anchor/Anchor.js +1 -1
- package/build/esm/components/BackgroundImage/BackgroundImage.js +2 -2
- package/build/esm/components/BlockBase/BlockBase.d.ts +3 -2
- package/build/esm/components/BlockBase/BlockBase.js +4 -2
- package/build/esm/components/Button/Button.css +3 -0
- package/build/esm/components/Button/Button.js +5 -4
- package/build/esm/components/Image/Image.d.ts +1 -0
- package/build/esm/components/Image/Image.js +2 -2
- package/build/esm/containers/Loadable/Loadable.d.ts +2 -2
- package/build/esm/containers/PageConstructor/PageConstructor.js +6 -4
- package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +3 -2
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +5 -5
- package/build/esm/context/innerContext/InnerContext.d.ts +2 -1
- package/build/esm/customization/BlockDecoration.d.ts +3 -0
- package/build/esm/customization/BlockDecoration.js +17 -0
- package/build/esm/editor/Components/AddBlock/AddBlock.css +82 -0
- package/build/esm/editor/Components/AddBlock/AddBlock.d.ts +8 -0
- package/build/esm/editor/Components/AddBlock/AddBlock.js +41 -0
- package/build/esm/editor/Components/EditBlock/EditBlock.css +47 -0
- package/build/esm/editor/Components/EditBlock/EditBlock.d.ts +5 -0
- package/build/esm/editor/Components/EditBlock/EditBlock.js +30 -0
- package/build/esm/editor/Containers/Editor.d.ts +2 -0
- package/build/esm/editor/Containers/Editor.js +20 -0
- package/build/esm/editor/data/index.d.ts +13 -0
- package/build/esm/editor/data/index.js +24 -0
- package/build/esm/editor/data/previews/default-preview.d.ts +3 -0
- package/build/esm/editor/data/previews/default-preview.js +15 -0
- package/build/esm/editor/data/previews/header-block.d.ts +3 -0
- package/build/esm/editor/data/previews/header-block.js +16 -0
- package/build/esm/editor/index.d.ts +2 -0
- package/build/esm/editor/index.js +2 -0
- package/build/esm/editor/store/index.d.ts +15 -0
- package/build/esm/editor/store/index.js +28 -0
- package/build/esm/editor/store/reducer.d.ts +41 -0
- package/build/esm/editor/store/reducer.js +55 -0
- package/build/esm/editor/store/utils.d.ts +13 -0
- package/build/esm/editor/store/utils.js +26 -0
- package/build/esm/editor/styles/mixins.css +0 -0
- package/build/esm/editor/styles/variables.css +0 -0
- package/build/esm/editor/types/index.d.ts +17 -0
- package/build/esm/editor/utils/index.d.ts +11 -0
- package/build/esm/editor/utils/index.js +6 -0
- package/build/esm/grid/Col/Col.d.ts +1 -1
- package/build/esm/hooks/useMetrika.js +0 -7
- package/build/esm/internal-typings/global.d.ts +18 -16
- package/build/esm/models/constructor-items/blocks.d.ts +1 -11
- package/build/esm/models/constructor-items/blocks.js +0 -2
- package/build/esm/models/constructor-items/common.d.ts +3 -3
- package/build/esm/models/constructor.d.ts +4 -1
- package/build/esm/models/customization.d.ts +9 -0
- package/build/esm/models/index.d.ts +1 -0
- package/build/esm/models/index.js +1 -0
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +2 -1
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.js +6 -3
- package/build/esm/sub-blocks/HubspotForm/index.d.ts +1 -1
- package/build/esm/sub-blocks/HubspotForm/index.js +7 -6
- package/build/esm/utils/blocks.d.ts +4 -1
- package/build/esm/utils/blocks.js +7 -0
- package/package.json +4 -3
- package/server/models/constructor-items/blocks.d.ts +1 -11
- package/server/models/constructor-items/blocks.js +0 -2
- package/server/models/constructor-items/common.d.ts +3 -3
- package/server/models/constructor.d.ts +4 -1
- package/server/models/customization.d.ts +9 -0
- package/server/models/customization.js +2 -0
- package/server/models/index.d.ts +1 -0
- package/server/models/index.js +1 -0
- package/server/utils/blocks.d.ts +4 -1
- package/server/utils/blocks.js +11 -1
- package/build/cjs/components/Anchor/__tests__/Anchor.test.js +0 -21
- package/build/cjs/components/AnimateBlock/__tests__/AnimateBlock.test.js +0 -36
- package/build/cjs/components/Author/__tests__/Author.test.d.ts +0 -1
- package/build/cjs/components/Author/__tests__/Author.test.js +0 -49
- package/build/cjs/components/BackLink/__tests__/BackLink.test.d.ts +0 -1
- package/build/cjs/components/BackLink/__tests__/BackLink.test.js +0 -63
- package/build/cjs/components/BlockBase/__tests__/BlockBase.test.d.ts +0 -1
- package/build/cjs/components/BlockBase/__tests__/BlockBase.test.js +0 -44
- package/build/cjs/components/Button/__tests__/Button.test.d.ts +0 -1
- package/build/cjs/components/Button/__tests__/Button.test.js +0 -91
- package/build/cjs/components/ButtonTabs/__tests__/ButtonTabs.test.d.ts +0 -1
- package/build/cjs/components/ButtonTabs/__tests__/ButtonTabs.test.js +0 -58
- package/build/esm/components/Anchor/__tests__/Anchor.test.d.ts +0 -1
- package/build/esm/components/Anchor/__tests__/Anchor.test.js +0 -18
- package/build/esm/components/AnimateBlock/__tests__/AnimateBlock.test.d.ts +0 -1
- package/build/esm/components/AnimateBlock/__tests__/AnimateBlock.test.js +0 -33
- package/build/esm/components/Author/__tests__/Author.test.d.ts +0 -1
- package/build/esm/components/Author/__tests__/Author.test.js +0 -46
- package/build/esm/components/BackLink/__tests__/BackLink.test.d.ts +0 -1
- package/build/esm/components/BackLink/__tests__/BackLink.test.js +0 -60
- package/build/esm/components/BlockBase/__tests__/BlockBase.test.d.ts +0 -1
- package/build/esm/components/BlockBase/__tests__/BlockBase.test.js +0 -41
- package/build/esm/components/Button/__tests__/Button.test.d.ts +0 -1
- package/build/esm/components/Button/__tests__/Button.test.js +0 -88
- package/build/esm/components/ButtonTabs/__tests__/ButtonTabs.test.d.ts +0 -1
- package/build/esm/components/ButtonTabs/__tests__/ButtonTabs.test.js +0 -55
- /package/build/{cjs/components/Anchor/__tests__/Anchor.test.d.ts → esm/editor/types/index.js} +0 -0
- /package/build/{cjs/components/AnimateBlock/__tests__/AnimateBlock.test.d.ts → esm/models/customization.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getShareLink = exports.getCustomHeaderTypes = exports.getCustomSubBlockTypes = exports.getCustomItems = exports.getCustomBlockTypes = exports.getBlockKey = exports.getHeaderTag = void 0;
|
|
3
|
+
exports.getBlockIndexFromId = exports.getShareLink = exports.getHeaderBlock = exports.getOrderedBlocks = exports.getCustomHeaderTypes = exports.getCustomSubBlockTypes = exports.getCustomItems = exports.getCustomBlockTypes = exports.getBlockKey = exports.getHeaderTag = void 0;
|
|
4
4
|
const models_1 = require("../models");
|
|
5
5
|
function getHeaderTag(size) {
|
|
6
6
|
switch (size) {
|
|
@@ -46,6 +46,14 @@ const getShareUrlWithParams = (url, params = {}) => {
|
|
|
46
46
|
});
|
|
47
47
|
return result.toString();
|
|
48
48
|
};
|
|
49
|
+
const getOrderedBlocks = (blocks, headerBlockTypes = []) => {
|
|
50
|
+
return blocks.filter(({ type }) => !headerBlockTypes.includes(type));
|
|
51
|
+
};
|
|
52
|
+
exports.getOrderedBlocks = getOrderedBlocks;
|
|
53
|
+
const getHeaderBlock = (blocks, headerBlockTypes = []) => {
|
|
54
|
+
return blocks.find(({ type }) => headerBlockTypes.includes(type));
|
|
55
|
+
};
|
|
56
|
+
exports.getHeaderBlock = getHeaderBlock;
|
|
49
57
|
const getShareLink = (url, type, title, text) => {
|
|
50
58
|
// https://github.com/bradvin/social-share-urls
|
|
51
59
|
switch (type) {
|
|
@@ -75,3 +83,5 @@ const getShareLink = (url, type, title, text) => {
|
|
|
75
83
|
}
|
|
76
84
|
};
|
|
77
85
|
exports.getShareLink = getShareLink;
|
|
86
|
+
const getBlockIndexFromId = (blockId) => { var _a; return Number((_a = blockId === null || blockId === void 0 ? void 0 : blockId.split('-')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()); };
|
|
87
|
+
exports.getBlockIndexFromId = getBlockIndexFromId;
|
|
@@ -3,7 +3,7 @@ import './Anchor.css';
|
|
|
3
3
|
export declare const qaIdByDefault = "qa-anchor";
|
|
4
4
|
export interface AnchorProps extends ClassNameProps {
|
|
5
5
|
id: string;
|
|
6
|
-
|
|
6
|
+
qa?: string;
|
|
7
7
|
}
|
|
8
|
-
declare const Anchor: ({ id, className,
|
|
8
|
+
declare const Anchor: ({ id, className, qa }: AnchorProps) => JSX.Element;
|
|
9
9
|
export default Anchor;
|
|
@@ -4,5 +4,5 @@ import { block } from '../../utils';
|
|
|
4
4
|
import './Anchor.css';
|
|
5
5
|
const b = block('Anchor');
|
|
6
6
|
export const qaIdByDefault = 'qa-anchor';
|
|
7
|
-
const Anchor = ({ id, className,
|
|
7
|
+
const Anchor = ({ id, className, qa }) => (React.createElement("div", { id: id, className: b(null, className), "data-qa": qa || qaIdByDefault }));
|
|
8
8
|
export default Anchor;
|
|
@@ -4,8 +4,8 @@ import Image from '../Image/Image';
|
|
|
4
4
|
import './BackgroundImage.css';
|
|
5
5
|
const b = block('storage-background-image');
|
|
6
6
|
const BackgroundImage = (props) => {
|
|
7
|
-
const { children, src, desktop, className, imageClassName, style, hide } = props;
|
|
8
|
-
return (React.createElement("div", { className: b(null, className), style: style },
|
|
7
|
+
const { children, src, desktop, className, imageClassName, style, hide, qa } = props;
|
|
8
|
+
return (React.createElement("div", { className: b(null, className), style: style, "data-qa": qa },
|
|
9
9
|
(src || desktop) && !hide && React.createElement(Image, Object.assign({}, props, { className: b('img', imageClassName) })),
|
|
10
10
|
children && React.createElement("div", { className: b('container') }, children)));
|
|
11
11
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { BlockBaseProps, ClassNameProps } from '../../models';
|
|
2
3
|
import './BlockBase.css';
|
|
3
|
-
declare const BlockBase: (props:
|
|
4
|
+
declare const BlockBase: (props: PropsWithChildren<BlockBaseProps & ClassNameProps>) => JSX.Element;
|
|
4
5
|
export default BlockBase;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { BlockDecoration } from '../../customization/BlockDecoration';
|
|
2
3
|
import { Col } from '../../grid';
|
|
3
4
|
import { block } from '../../utils';
|
|
4
5
|
import Anchor from '../Anchor/Anchor';
|
|
@@ -7,7 +8,8 @@ const b = block('block-base');
|
|
|
7
8
|
const BlockBase = (props) => {
|
|
8
9
|
const { anchor, visible, children, className, resetPaddings, qa } = props;
|
|
9
10
|
return (React.createElement(Col, { className: b({ ['reset-paddings']: resetPaddings }, className), visible: visible, reset: true, dataQa: qa },
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
React.createElement(BlockDecoration, null,
|
|
12
|
+
anchor && React.createElement(Anchor, { id: anchor.url, className: b('anchor') }),
|
|
13
|
+
children)));
|
|
12
14
|
};
|
|
13
15
|
export default BlockBase;
|
|
@@ -14,7 +14,7 @@ const b = block('button-block');
|
|
|
14
14
|
const Button = (props) => {
|
|
15
15
|
const handleMetrika = useMetrika();
|
|
16
16
|
const { lang, tld } = useContext(LocaleContext);
|
|
17
|
-
const { className, metrikaGoals, pixelEvents, analyticsEvents, size = 'l', theme = 'normal', url, img, onClick: onClickOrigin, text } = props, rest = __rest(props, ["className", "metrikaGoals", "pixelEvents", "analyticsEvents", "size", "theme", "url", "img", "onClick", "text"]);
|
|
17
|
+
const { className, metrikaGoals, pixelEvents, analyticsEvents, size = 'l', theme = 'normal', url, img, onClick: onClickOrigin, text, width } = props, rest = __rest(props, ["className", "metrikaGoals", "pixelEvents", "analyticsEvents", "size", "theme", "url", "img", "onClick", "text", "width"]);
|
|
18
18
|
const defaultImgPosition = 'left';
|
|
19
19
|
const handleAnalytics = useAnalytics(DefaultEventNames.Button, url);
|
|
20
20
|
const onClick = useCallback((e) => {
|
|
@@ -24,12 +24,13 @@ const Button = (props) => {
|
|
|
24
24
|
onClickOrigin(e);
|
|
25
25
|
}
|
|
26
26
|
}, [handleMetrika, metrikaGoals, pixelEvents, handleAnalytics, analyticsEvents, onClickOrigin]);
|
|
27
|
+
const buttonModifiers = { size, theme, width };
|
|
27
28
|
const buttonImg = img instanceof Object
|
|
28
29
|
? { url: img.url, position: img.position || defaultImgPosition, alt: img.alt }
|
|
29
30
|
: { url: img, position: defaultImgPosition };
|
|
30
31
|
const buttonClass = img
|
|
31
|
-
? b({ position: buttonImg.position
|
|
32
|
-
: b({
|
|
32
|
+
? b(Object.assign({ position: buttonImg.position }, buttonModifiers), className)
|
|
33
|
+
: b(Object.assign({}, buttonModifiers), className);
|
|
33
34
|
const buttonProps = Object.assign(Object.assign({}, rest), { onClick });
|
|
34
35
|
if (theme === 'app-store' || theme === 'google-play') {
|
|
35
36
|
const platform = theme === 'app-store' ? Platform.IOS : Platform.ANDROID;
|
|
@@ -42,7 +43,7 @@ const Button = (props) => {
|
|
|
42
43
|
image = undefined;
|
|
43
44
|
}
|
|
44
45
|
const buttonTheme = theme === 'scale' ? 'accent' : theme;
|
|
45
|
-
return (React.createElement(CommonButton, Object.assign({ className: buttonClass, view: toCommonView(buttonTheme), size: toCommonSize(size), href: url ? setUrlTld(url, tld) : undefined }, buttonProps),
|
|
46
|
+
return (React.createElement(CommonButton, Object.assign({ className: buttonClass, view: toCommonView(buttonTheme), size: toCommonSize(size), href: url ? setUrlTld(url, tld) : undefined, width: width }, buttonProps),
|
|
46
47
|
icon && buttonImg.position === 'left' ? icon : null,
|
|
47
48
|
React.createElement("span", { className: b('content') },
|
|
48
49
|
image && buttonImg.position === 'left' ? image : null,
|
|
@@ -5,6 +5,7 @@ export interface ImageProps extends Partial<ImageObjectProps>, Partial<ImageDevi
|
|
|
5
5
|
className?: string;
|
|
6
6
|
onClick?: MouseEventHandler;
|
|
7
7
|
containerClassName?: string;
|
|
8
|
+
qa?: string;
|
|
8
9
|
}
|
|
9
10
|
declare const Image: (props: ImageProps) => JSX.Element | null;
|
|
10
11
|
export default Image;
|
|
@@ -9,7 +9,7 @@ const checkWebP = (src) => {
|
|
|
9
9
|
};
|
|
10
10
|
const Image = (props) => {
|
|
11
11
|
const projectSettings = useContext(ProjectSettingsContext);
|
|
12
|
-
const { src: imageSrc, alt = i18n('img-alt'), disableCompress, tablet, desktop, mobile, style, className, onClick, containerClassName, } = props;
|
|
12
|
+
const { src: imageSrc, alt = i18n('img-alt'), disableCompress, tablet, desktop, mobile, style, className, onClick, containerClassName, qa, } = props;
|
|
13
13
|
const [imgLoadingError, setImgLoadingError] = useState(false);
|
|
14
14
|
const src = imageSrc || desktop;
|
|
15
15
|
if (!src) {
|
|
@@ -19,7 +19,7 @@ const Image = (props) => {
|
|
|
19
19
|
disableCompress ||
|
|
20
20
|
!isCompressible(src) ||
|
|
21
21
|
imgLoadingError;
|
|
22
|
-
return (React.createElement("picture", { className: containerClassName },
|
|
22
|
+
return (React.createElement("picture", { className: containerClassName, "data-qa": qa },
|
|
23
23
|
mobile && (React.createElement(Fragment, null,
|
|
24
24
|
!disableWebp && (React.createElement("source", { srcSet: checkWebP(mobile), type: "image/webp", media: `(max-width: ${BREAKPOINTS.sm}px)` })),
|
|
25
25
|
React.createElement("source", { srcSet: mobile, media: `(max-width: ${BREAKPOINTS.sm}px)` }))),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ConstructorItem, CustomItem, FetchLoadableData, LoadableData, LoadableProps } from '../../models';
|
|
3
3
|
import './Loadable.css';
|
|
4
4
|
export interface LoadableState {
|
|
5
5
|
loading: boolean;
|
|
@@ -9,7 +9,7 @@ export interface LoadableState {
|
|
|
9
9
|
export interface LoadableComponentsProps extends Omit<PropsWithChildren<LoadableProps>, 'source'> {
|
|
10
10
|
Component: CustomItem;
|
|
11
11
|
ChildComponent: CustomItem;
|
|
12
|
-
block:
|
|
12
|
+
block: ConstructorItem;
|
|
13
13
|
blockKey: string;
|
|
14
14
|
fetch: FetchLoadableData;
|
|
15
15
|
}
|
|
@@ -9,7 +9,7 @@ import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
|
|
|
9
9
|
import { Grid } from '../../grid';
|
|
10
10
|
import { BlockType, BlockTypes, HeaderBlockTypes, SubBlockTypes, } from '../../models';
|
|
11
11
|
import Layout from '../../navigation/containers/Layout/Layout';
|
|
12
|
-
import { block as cnBlock, getCustomBlockTypes, getCustomHeaderTypes, getCustomItems, getCustomSubBlockTypes, getThemedValue, } from '../../utils';
|
|
12
|
+
import { block as cnBlock, getCustomBlockTypes, getCustomHeaderTypes, getCustomItems, getCustomSubBlockTypes, getHeaderBlock, getOrderedBlocks, getThemedValue, } from '../../utils';
|
|
13
13
|
import { ConstructorBlocks } from './components/ConstructorBlocks';
|
|
14
14
|
import { ConstructorFootnotes } from './components/ConstructorFootnotes';
|
|
15
15
|
import { ConstructorHeader } from './components/ConstructorItem';
|
|
@@ -26,13 +26,15 @@ export const Constructor = (props) => {
|
|
|
26
26
|
itemMap: Object.assign(Object.assign(Object.assign({}, blockMap), subBlockMap), getCustomItems(custom)),
|
|
27
27
|
loadables: custom === null || custom === void 0 ? void 0 : custom.loadable,
|
|
28
28
|
shouldRenderBlock,
|
|
29
|
+
customization: {
|
|
30
|
+
decorators: custom === null || custom === void 0 ? void 0 : custom.decorators,
|
|
31
|
+
},
|
|
29
32
|
},
|
|
30
33
|
}), [custom, shouldRenderBlock]);
|
|
31
34
|
const { themeValue: theme } = useContext(ThemeValueContext);
|
|
32
35
|
const hasFootnotes = footnotes.length > 0;
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const restBlocks = blocks === null || blocks === void 0 ? void 0 : blocks.filter((block) => !isHeaderBlock(block));
|
|
36
|
+
const header = getHeaderBlock(blocks, context.headerBlockTypes);
|
|
37
|
+
const restBlocks = getOrderedBlocks(blocks, context.headerBlockTypes);
|
|
36
38
|
const themedBackground = getThemedValue(background, theme);
|
|
37
39
|
return (React.createElement(InnerContext.Provider, { value: context },
|
|
38
40
|
React.createElement("div", { className: b() },
|
package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Fragment, useContext } from 'react';
|
|
2
2
|
import _ from 'lodash';
|
|
3
|
+
import { BlockIdContext } from '../../../../context/blockIdContext';
|
|
3
4
|
import { InnerContext } from '../../../../context/innerContext';
|
|
4
5
|
import { getBlockKey } from '../../../../utils';
|
|
5
6
|
import { ConstructorBlock } from '../ConstructorBlock/ConstructorBlock';
|
|
@@ -30,9 +31,9 @@ export const ConstructorBlocks = ({ items }) => {
|
|
|
30
31
|
if ('children' in item && item.children) {
|
|
31
32
|
children = item.children.map(renderer.bind(null, blockId));
|
|
32
33
|
}
|
|
33
|
-
itemElement = (React.createElement(ConstructorItem, { data: item,
|
|
34
|
+
itemElement = (React.createElement(ConstructorItem, { data: item, blockKey: blockId }, children));
|
|
34
35
|
}
|
|
35
|
-
return blockTypes.includes(item.type) ? (React.createElement(ConstructorBlock, { data: item
|
|
36
|
+
return (React.createElement(BlockIdContext.Provider, { value: blockId, key: blockId }, blockTypes.includes(item.type) ? (React.createElement(ConstructorBlock, { data: item }, itemElement)) : (itemElement)));
|
|
36
37
|
};
|
|
37
38
|
return React.createElement(Fragment, null, items.map(renderer.bind(null, '')));
|
|
38
39
|
};
|
package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export interface ConstructorItemProps {
|
|
|
3
3
|
data: ConstructorItemType;
|
|
4
4
|
blockKey: string;
|
|
5
5
|
}
|
|
6
|
-
export declare const ConstructorItem: ({ data,
|
|
6
|
+
export declare const ConstructorItem: ({ data, children }: WithChildren<ConstructorItemProps>) => JSX.Element;
|
|
7
7
|
export declare const ConstructorHeader: ({ data, blockKey, }: Pick<ConstructorItemProps, 'data' | 'blockKey'>) => JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
|
-
import { BlockIdContext } from '../../../../context/blockIdContext';
|
|
4
3
|
import { InnerContext } from '../../../../context/innerContext';
|
|
5
|
-
|
|
4
|
+
import { BlockDecoration } from '../../../../customization/BlockDecoration';
|
|
5
|
+
export const ConstructorItem = ({ data, children }) => {
|
|
6
6
|
const { itemMap } = useContext(InnerContext);
|
|
7
7
|
const { type } = data, rest = __rest(data, ["type"]);
|
|
8
8
|
const Component = itemMap[type];
|
|
9
|
-
return
|
|
10
|
-
React.createElement(Component, Object.assign({}, rest), children)));
|
|
9
|
+
return React.createElement(Component, Object.assign({}, rest), children);
|
|
11
10
|
};
|
|
12
|
-
export const ConstructorHeader = ({ data, blockKey, }) => (React.createElement(
|
|
11
|
+
export const ConstructorHeader = ({ data, blockKey, }) => (React.createElement(BlockDecoration, { id: data.type },
|
|
12
|
+
React.createElement(ConstructorItem, { data: data, key: data.type, blockKey: blockKey })));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ItemMap } from '../../containers/PageConstructor/PageConstructor';
|
|
3
|
-
import { LoadableConfig, ShouldRenderBlock } from '../../models';
|
|
3
|
+
import { CustomConfig, LoadableConfig, ShouldRenderBlock } from '../../models';
|
|
4
4
|
export interface InnerContextType {
|
|
5
5
|
blockTypes: string[];
|
|
6
6
|
subBlockTypes: string[];
|
|
@@ -8,5 +8,6 @@ export interface InnerContextType {
|
|
|
8
8
|
itemMap: ItemMap;
|
|
9
9
|
loadables?: LoadableConfig;
|
|
10
10
|
shouldRenderBlock?: ShouldRenderBlock;
|
|
11
|
+
customization?: Pick<CustomConfig, 'decorators'>;
|
|
11
12
|
}
|
|
12
13
|
export declare const InnerContext: React.Context<InnerContextType>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { Fragment, useContext } from 'react';
|
|
2
|
+
import { BlockIdContext } from '../context/blockIdContext';
|
|
3
|
+
import { InnerContext } from '../context/innerContext';
|
|
4
|
+
import { getBlockIndexFromId } from '../utils';
|
|
5
|
+
export const BlockDecoration = (props) => {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const blockContenxtId = getBlockIndexFromId(useContext(BlockIdContext));
|
|
8
|
+
const { headerBlockTypes } = useContext(InnerContext);
|
|
9
|
+
const blockId = props.id || blockContenxtId;
|
|
10
|
+
const isHeader = Boolean(props.id && headerBlockTypes.includes(props.id));
|
|
11
|
+
const block = React.createElement(Fragment, null, props.children);
|
|
12
|
+
const blockDecorators = (_b = (_a = useContext(InnerContext).customization) === null || _a === void 0 ? void 0 : _a.decorators) === null || _b === void 0 ? void 0 : _b.block;
|
|
13
|
+
if (!blockDecorators) {
|
|
14
|
+
return block;
|
|
15
|
+
}
|
|
16
|
+
return blockDecorators.reduce((children, decorator) => (React.createElement(Fragment, null, decorator({ children, id: blockId, isHeader }))), block);
|
|
17
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-add-block {
|
|
4
|
+
position: fixed;
|
|
5
|
+
bottom: 32px;
|
|
6
|
+
left: 50%;
|
|
7
|
+
transform: translateX(-50%);
|
|
8
|
+
z-index: 110;
|
|
9
|
+
}
|
|
10
|
+
.pc-add-block__button {
|
|
11
|
+
display: inline-block;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
font: inherit;
|
|
15
|
+
border: none;
|
|
16
|
+
outline: none;
|
|
17
|
+
color: inherit;
|
|
18
|
+
background: none;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
align-items: center;
|
|
23
|
+
transition: transform 0.2s;
|
|
24
|
+
width: 76px;
|
|
25
|
+
height: 40px;
|
|
26
|
+
color: var(--yc-color-text-inverted-primary);
|
|
27
|
+
background-color: var(--yc-color-promo-base-neon);
|
|
28
|
+
border-radius: 8px;
|
|
29
|
+
}
|
|
30
|
+
.pc-add-block__button:hover {
|
|
31
|
+
transform: scale(1.05);
|
|
32
|
+
}
|
|
33
|
+
.pc-add-block__icon {
|
|
34
|
+
width: 16px;
|
|
35
|
+
height: 16px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.pc-add-block__popup {
|
|
39
|
+
min-width: 420px;
|
|
40
|
+
border-radius: var(--pc-border-radius);
|
|
41
|
+
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.06), 0px 4px 24px rgba(0, 0, 0, 0.06);
|
|
42
|
+
}
|
|
43
|
+
.pc-add-block__popup .pc-add-block__search {
|
|
44
|
+
padding: 20px 20px 0;
|
|
45
|
+
}
|
|
46
|
+
.pc-add-block__popup .pc-add-block__blocks {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
padding: 20px;
|
|
50
|
+
height: 296px;
|
|
51
|
+
max-height: 296px;
|
|
52
|
+
overflow-y: auto;
|
|
53
|
+
}
|
|
54
|
+
.pc-add-block__popup .pc-add-block__block {
|
|
55
|
+
display: flex;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
align-items: center;
|
|
58
|
+
transition: transform 0.2s;
|
|
59
|
+
margin-top: 20px;
|
|
60
|
+
justify-content: flex-start;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
}
|
|
63
|
+
.pc-add-block__popup .pc-add-block__block:hover {
|
|
64
|
+
transform: scale(1.05);
|
|
65
|
+
}
|
|
66
|
+
.pc-add-block__popup .pc-add-block__block:first-child {
|
|
67
|
+
margin-top: 0;
|
|
68
|
+
}
|
|
69
|
+
.pc-add-block__popup .pc-add-block__preview {
|
|
70
|
+
width: 148px;
|
|
71
|
+
height: 74px;
|
|
72
|
+
border-radius: var(--pc-border-radius);
|
|
73
|
+
margin-right: 16px;
|
|
74
|
+
}
|
|
75
|
+
.pc-add-block__popup .pc-add-block__title {
|
|
76
|
+
font-size: var(--yc-text-body-2-font-size);
|
|
77
|
+
line-height: var(--yc-text-body-2-line-height);
|
|
78
|
+
}
|
|
79
|
+
.pc-add-block__popup .pc-add-block__title,
|
|
80
|
+
.pc-add-block__popup .pc-add-block__description {
|
|
81
|
+
margin: 0;
|
|
82
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { Block } from '../../../models';
|
|
3
|
+
import './AddBlock.css';
|
|
4
|
+
export interface AddBlockProps {
|
|
5
|
+
onAdd: (data: Block) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const AddBlock: ({ onAdd }: PropsWithChildren<AddBlockProps>) => JSX.Element;
|
|
8
|
+
export default AddBlock;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { Plus } from '@gravity-ui/icons';
|
|
3
|
+
import { Popup, TextInput } from '@gravity-ui/uikit';
|
|
4
|
+
import { blockMap } from '../../../constructor-items';
|
|
5
|
+
import { block } from '../../../utils';
|
|
6
|
+
import EditorBlocksData from '../../data';
|
|
7
|
+
import './AddBlock.css';
|
|
8
|
+
const b = block('add-block');
|
|
9
|
+
const sortedBlockNames = Object.keys(blockMap).sort();
|
|
10
|
+
const AddBlock = ({ onAdd }) => {
|
|
11
|
+
const [isOpened, setIsOpened] = useState(false);
|
|
12
|
+
const [search, setSearch] = useState('');
|
|
13
|
+
const ref = useRef(null);
|
|
14
|
+
const blocks = useMemo(() => sortedBlockNames.filter((blockName) => EditorBlocksData[blockName].meta.title
|
|
15
|
+
.toLocaleLowerCase()
|
|
16
|
+
.startsWith(search.toLocaleLowerCase())), [search]);
|
|
17
|
+
return (React.createElement("div", { className: b(), ref: ref },
|
|
18
|
+
React.createElement("button", { className: b('button'), onClick: () => {
|
|
19
|
+
setIsOpened(!isOpened);
|
|
20
|
+
setSearch('');
|
|
21
|
+
} },
|
|
22
|
+
React.createElement(Plus, { className: b('icon') })),
|
|
23
|
+
isOpened && (React.createElement(Popup, { anchorRef: ref, open: isOpened, className: b('popup'), placement: "top", offset: [0, 24], onOutsideClick: () => setIsOpened(false) },
|
|
24
|
+
React.createElement("div", { className: b('search') },
|
|
25
|
+
React.createElement(TextInput, { placeholder: "search", type: "text", value: search, size: "l", onUpdate: (value) => setSearch(value) })),
|
|
26
|
+
React.createElement("div", { className: b('blocks') }, blocks.map((blockName) => {
|
|
27
|
+
var _a;
|
|
28
|
+
const blockData = EditorBlocksData[blockName];
|
|
29
|
+
const Preview = blockData === null || blockData === void 0 ? void 0 : blockData.preview;
|
|
30
|
+
return (React.createElement("div", { key: blockName, className: b('block'), onClick: () => {
|
|
31
|
+
onAdd(blockData === null || blockData === void 0 ? void 0 : blockData.template);
|
|
32
|
+
setIsOpened(false);
|
|
33
|
+
} },
|
|
34
|
+
React.createElement("div", { className: b('preview') },
|
|
35
|
+
React.createElement(Preview, null)),
|
|
36
|
+
React.createElement("div", { className: b('info') },
|
|
37
|
+
React.createElement("h4", { className: b('title') }, blockData.meta.title),
|
|
38
|
+
((_a = blockData === null || blockData === void 0 ? void 0 : blockData.meta) === null || _a === void 0 ? void 0 : _a.description) && (React.createElement("p", { className: b('description') }, blockData.meta.description)))));
|
|
39
|
+
}))))));
|
|
40
|
+
};
|
|
41
|
+
export default AddBlock;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-edit-block {
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
.pc-edit-block__controls {
|
|
8
|
+
position: absolute;
|
|
9
|
+
width: calc(100% + 40px);
|
|
10
|
+
height: calc(100% + 40px);
|
|
11
|
+
top: -20px;
|
|
12
|
+
left: -20px;
|
|
13
|
+
border-radius: 8px;
|
|
14
|
+
z-index: 100;
|
|
15
|
+
}
|
|
16
|
+
.pc-edit-block__controls_isHeader {
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
top: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
}
|
|
22
|
+
.pc-edit-block__controls_active {
|
|
23
|
+
border: 4px solid var(--yc-color-promo-base-neon);
|
|
24
|
+
}
|
|
25
|
+
.pc-edit-block__controls-content {
|
|
26
|
+
display: flex;
|
|
27
|
+
position: absolute;
|
|
28
|
+
bottom: -44px;
|
|
29
|
+
left: 50%;
|
|
30
|
+
transform: translateX(-50%);
|
|
31
|
+
}
|
|
32
|
+
.pc-edit-block__control {
|
|
33
|
+
display: flex;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
align-items: center;
|
|
36
|
+
transition: transform 0.2s;
|
|
37
|
+
width: 24px;
|
|
38
|
+
height: 24px;
|
|
39
|
+
border-radius: calc(8px / 2);
|
|
40
|
+
background-color: var(--yc-color-promo-highlight-neon);
|
|
41
|
+
}
|
|
42
|
+
.pc-edit-block__control:hover {
|
|
43
|
+
transform: scale(1.1);
|
|
44
|
+
}
|
|
45
|
+
.pc-edit-block__control:not(:first-child) {
|
|
46
|
+
margin-left: 12px;
|
|
47
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditBlockProps } from '../../../editor/types';
|
|
3
|
+
import './EditBlock.css';
|
|
4
|
+
declare const _default: React.MemoExoticComponent<({ id, isHeader, activeBlockId, onDelete, onSelect, onCopy, onOrderChange, children, orderedBlocksCount, }: EditBlockProps) => JSX.Element>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { Fragment, useEffect, useRef } from 'react';
|
|
2
|
+
import { ChevronDown, ChevronUp, Copy, TrashBin } from '@gravity-ui/icons';
|
|
3
|
+
import { block } from '../../../utils';
|
|
4
|
+
import './EditBlock.css';
|
|
5
|
+
const b = block('edit-block');
|
|
6
|
+
const EditBlock = ({ id, isHeader, activeBlockId, onDelete, onSelect, onCopy, onOrderChange, children, orderedBlocksCount, }) => {
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
const controlsActive = activeBlockId === id;
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
var _a;
|
|
11
|
+
if (controlsActive && ref.current) {
|
|
12
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
13
|
+
}
|
|
14
|
+
}, [controlsActive]);
|
|
15
|
+
return (React.createElement("div", { className: b(), onClick: () => {
|
|
16
|
+
onSelect(id);
|
|
17
|
+
}, ref: ref },
|
|
18
|
+
React.createElement("div", { className: b('controls', { active: controlsActive, isHeader }) }, controlsActive && (React.createElement("div", { className: b('controls-content'), onClick: (e) => e.stopPropagation() },
|
|
19
|
+
typeof id === 'number' && (React.createElement(Fragment, null,
|
|
20
|
+
id > 0 && (React.createElement("div", { className: b('control'), onClick: () => onOrderChange(id, id - 1) },
|
|
21
|
+
React.createElement(ChevronUp, null))),
|
|
22
|
+
id < orderedBlocksCount - 1 && (React.createElement("div", { className: b('control'), onClick: () => onOrderChange(id, id + 1) },
|
|
23
|
+
React.createElement(ChevronDown, null))),
|
|
24
|
+
React.createElement("div", { className: b('control'), onClick: () => onCopy(id) },
|
|
25
|
+
React.createElement(Copy, null)))),
|
|
26
|
+
React.createElement("div", { className: b('control'), onClick: () => onDelete(id) },
|
|
27
|
+
React.createElement(TrashBin, null))))),
|
|
28
|
+
children));
|
|
29
|
+
};
|
|
30
|
+
export default React.memo(EditBlock);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import AddBlock from '../Components/AddBlock/AddBlock';
|
|
4
|
+
import EditBlock from '../Components/EditBlock/EditBlock';
|
|
5
|
+
import { useEditorState } from '../store';
|
|
6
|
+
import { addCustomDecorator } from '../utils';
|
|
7
|
+
export const Editor = (_a) => {
|
|
8
|
+
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
9
|
+
const { content, onAdd, editControlsProps } = useEditorState(rest);
|
|
10
|
+
const constructorProps = useMemo(() => {
|
|
11
|
+
const editControlsDecorator = (props) => (React.createElement(EditBlock, Object.assign({}, props, editControlsProps)));
|
|
12
|
+
return {
|
|
13
|
+
content,
|
|
14
|
+
custom: addCustomDecorator(editControlsDecorator, rest.custom),
|
|
15
|
+
};
|
|
16
|
+
}, [editControlsProps, content, rest.custom]);
|
|
17
|
+
return (React.createElement("div", null,
|
|
18
|
+
children(constructorProps),
|
|
19
|
+
React.createElement(AddBlock, { onAdd: onAdd })));
|
|
20
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Block, BlockType } from '../../models';
|
|
3
|
+
export type PreviewComponent = React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
4
|
+
export interface EdiorBlockData {
|
|
5
|
+
template: Block;
|
|
6
|
+
preview: PreviewComponent;
|
|
7
|
+
meta: {
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
declare const EditorBlocksData: Record<BlockType, EdiorBlockData>;
|
|
13
|
+
export default EditorBlocksData;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BlockType } from '../../models';
|
|
2
|
+
import { formatBlockName } from '../utils';
|
|
3
|
+
import DefaultPreview from './previews/default-preview';
|
|
4
|
+
const getBlockTemplate = (blockType) => require(`./templates/${blockType}.json`);
|
|
5
|
+
const getBlockPreview = (blockType) => {
|
|
6
|
+
try {
|
|
7
|
+
return require(`./previews/${blockType}.tsx`).default;
|
|
8
|
+
}
|
|
9
|
+
catch (err) {
|
|
10
|
+
/*eslint-disable no-console */
|
|
11
|
+
console.warn(`Preview image for ${blockType} not found`);
|
|
12
|
+
return DefaultPreview;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const EditorBlocksData = Object.values(BlockType).reduce((previewData, blockType) => {
|
|
16
|
+
const template = getBlockTemplate(blockType);
|
|
17
|
+
const preview = getBlockPreview(blockType);
|
|
18
|
+
template.meta = template.meta || {};
|
|
19
|
+
template.meta.title = template.meta.title || formatBlockName(blockType);
|
|
20
|
+
/* eslint-disable no-param-reassign */
|
|
21
|
+
previewData[blockType] = Object.assign(Object.assign({}, template), { preview });
|
|
22
|
+
return previewData;
|
|
23
|
+
}, {});
|
|
24
|
+
export default EditorBlocksData;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { a11yHiddenSvgProps } from '../../../utils/svg';
|
|
3
|
+
const DefaultPreview = (props) => (React.createElement("svg", Object.assign({ width: "150", height: "76", viewBox: "0 0 150 76", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a11yHiddenSvgProps, props),
|
|
4
|
+
React.createElement("rect", { x: "1", y: "1", width: "148", height: "74", rx: "8", fill: "white" }),
|
|
5
|
+
React.createElement("rect", { x: "14.7674", y: "21.6512", width: "28.3953", height: "6.88372", rx: "0.860465", fill: "#E7E7E7" }),
|
|
6
|
+
React.createElement("rect", { x: "43.1628", y: "21.6512", width: "28.3953", height: "6.88372", rx: "0.860465", fill: "white" }),
|
|
7
|
+
React.createElement("rect", { x: "14.7674", y: "31.9767", width: "56.7907", height: "3.44186", rx: "0.860465", fill: "#E7E7E7" }),
|
|
8
|
+
React.createElement("rect", { x: "14.7675", y: "37.1395", width: "56.7907", height: "3.44186", rx: "0.860465", fill: "#E7E7E7" }),
|
|
9
|
+
React.createElement("rect", { x: "14.7675", y: "42.3023", width: "56.7907", height: "3.44186", rx: "0.860465", fill: "#E7E7E7" }),
|
|
10
|
+
React.createElement("rect", { x: "14.7674", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "#E7E7E7" }),
|
|
11
|
+
React.createElement("rect", { x: "33.6977", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "white" }),
|
|
12
|
+
React.createElement("rect", { x: "52.6279", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "white" }),
|
|
13
|
+
React.createElement("rect", { x: "78.4418", y: "9.60464", width: "56.7907", height: "56.7907", rx: "5.16279", fill: "#A967FF" }),
|
|
14
|
+
React.createElement("rect", { x: "0.5", y: "0.5", width: "149", height: "75", rx: "8.5", stroke: "black", strokeOpacity: "0.1" })));
|
|
15
|
+
export default DefaultPreview;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { a11yHiddenSvgProps } from '../../../utils/svg';
|
|
3
|
+
const Header = (props) => (React.createElement("svg", Object.assign({ width: "150", height: "76", viewBox: "0 0 150 76", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a11yHiddenSvgProps, props),
|
|
4
|
+
React.createElement("rect", { x: "1", y: "1", width: "148", height: "74", rx: "8", fill: "white" }),
|
|
5
|
+
React.createElement("rect", { x: "4.44174", y: "9.60464", width: "141.116", height: "56.7907", rx: "5.16279", fill: "#A967FF" }),
|
|
6
|
+
React.createElement("rect", { x: "14.7674", y: "21.6512", width: "28.3953", height: "6.88372", rx: "0.860465", fill: "white" }),
|
|
7
|
+
React.createElement("rect", { x: "43.1628", y: "21.6512", width: "28.3953", height: "6.88372", rx: "0.860465", fill: "#A967FF" }),
|
|
8
|
+
React.createElement("rect", { x: "14.7674", y: "31.9767", width: "56.7907", height: "3.44186", rx: "0.860465", fill: "white" }),
|
|
9
|
+
React.createElement("rect", { x: "14.7674", y: "37.1395", width: "56.7907", height: "3.44186", rx: "0.860465", fill: "white" }),
|
|
10
|
+
React.createElement("rect", { x: "14.7674", y: "42.3023", width: "56.7907", height: "3.44186", rx: "0.860465", fill: "white" }),
|
|
11
|
+
React.createElement("rect", { x: "14.7674", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "white" }),
|
|
12
|
+
React.createElement("rect", { x: "33.6976", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "#A967FF" }),
|
|
13
|
+
React.createElement("rect", { x: "52.6279", y: "49.186", width: "18.9302", height: "5.16279", rx: "0.860465", fill: "#A967FF" }),
|
|
14
|
+
React.createElement("rect", { x: "78.4418", y: "9.60464", width: "56.7907", height: "56.7907", rx: "5.16279", fill: "#A967FF" }),
|
|
15
|
+
React.createElement("rect", { x: "0.5", y: "0.5", width: "149", height: "75", rx: "8.5", stroke: "black", strokeOpacity: "0.1" })));
|
|
16
|
+
export default Header;
|