@gravity-ui/page-constructor 4.31.1 → 4.34.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/Form/Form.css +136 -0
- package/build/cjs/blocks/Form/Form.d.ts +4 -0
- package/build/cjs/blocks/Form/Form.js +59 -0
- package/build/cjs/blocks/Form/InnerForm/InnerForm.d.ts +9 -0
- package/build/cjs/blocks/Form/InnerForm/InnerForm.js +28 -0
- package/build/cjs/blocks/Form/schema.d.ts +202 -0
- package/build/cjs/blocks/Form/schema.js +44 -0
- package/build/cjs/blocks/Header/Header.js +6 -2
- package/build/cjs/blocks/Tabs/Tabs.js +8 -1
- package/build/cjs/blocks/index.d.ts +1 -0
- package/build/cjs/blocks/index.js +3 -1
- package/build/cjs/components/BackLink/BackLink.d.ts +3 -2
- package/build/cjs/components/BackLink/BackLink.js +2 -2
- package/build/cjs/components/Button/Button.d.ts +0 -1
- package/build/cjs/components/DefaultVideo/DefaultVideo.css +5 -0
- package/build/cjs/components/DefaultVideo/DefaultVideo.d.ts +11 -0
- package/build/cjs/components/DefaultVideo/DefaultVideo.js +60 -0
- package/build/cjs/components/FileLink/FileLink.js +2 -2
- package/build/cjs/components/FullscreenImage/FullscreenImage.d.ts +2 -1
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +2 -2
- package/build/cjs/components/Image/Image.js +2 -2
- package/build/cjs/components/Link/Link.js +4 -4
- package/build/cjs/components/Media/Video/Video.css +0 -5
- package/build/cjs/components/Media/Video/Video.js +3 -7
- package/build/cjs/components/Title/Title.d.ts +2 -1
- package/build/cjs/components/Title/Title.js +2 -2
- package/build/cjs/components/Title/TitleItem.css +3 -3
- package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -17
- package/build/cjs/components/YandexForm/YandexForm.js +6 -4
- package/build/cjs/components/YandexForm/schema.d.ts +16 -0
- package/build/cjs/components/YandexForm/schema.js +13 -0
- package/build/cjs/constructor-items.d.ts +1 -0
- package/build/cjs/constructor-items.js +1 -0
- package/build/cjs/editor/data/templates/form-block.json +20 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +33 -4
- package/build/cjs/models/constructor-items/blocks.js +13 -1
- package/build/cjs/models/constructor-items/common.d.ts +22 -3
- package/build/cjs/models/guards.d.ts +3 -1
- package/build/cjs/models/guards.js +9 -1
- package/build/cjs/schema/constants.js +2 -1
- package/build/cjs/schema/validators/blocks.d.ts +1 -0
- package/build/cjs/schema/validators/blocks.js +1 -0
- package/build/cjs/sub-blocks/BasicCard/BasicCard.js +5 -2
- package/build/cjs/sub-blocks/Content/Content.js +12 -5
- package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +10 -10
- package/build/cjs/sub-blocks/HubspotForm/schema.d.ts +22 -0
- package/build/cjs/sub-blocks/HubspotForm/schema.js +17 -0
- package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +1 -0
- package/build/cjs/sub-blocks/Quote/Quote.css +0 -2
- package/build/esm/blocks/Form/Form.css +136 -0
- package/build/esm/blocks/Form/Form.d.ts +5 -0
- package/build/esm/blocks/Form/Form.js +57 -0
- package/build/esm/blocks/Form/InnerForm/InnerForm.d.ts +9 -0
- package/build/esm/blocks/Form/InnerForm/InnerForm.js +26 -0
- package/build/esm/blocks/Form/schema.d.ts +202 -0
- package/build/esm/blocks/Form/schema.js +40 -0
- package/build/esm/blocks/Header/Header.js +6 -2
- package/build/esm/blocks/Tabs/Tabs.js +8 -1
- package/build/esm/blocks/index.d.ts +1 -0
- package/build/esm/blocks/index.js +1 -0
- package/build/esm/components/BackLink/BackLink.d.ts +3 -2
- package/build/esm/components/BackLink/BackLink.js +2 -2
- package/build/esm/components/Button/Button.d.ts +0 -1
- package/build/esm/components/DefaultVideo/DefaultVideo.css +5 -0
- package/build/esm/components/DefaultVideo/DefaultVideo.d.ts +12 -0
- package/build/esm/components/DefaultVideo/DefaultVideo.js +57 -0
- package/build/esm/components/FileLink/FileLink.js +2 -2
- package/build/esm/components/FullscreenImage/FullscreenImage.d.ts +2 -1
- package/build/esm/components/FullscreenImage/FullscreenImage.js +2 -2
- package/build/esm/components/Image/Image.js +3 -2
- package/build/esm/components/Link/Link.js +4 -4
- package/build/esm/components/Media/Video/Video.css +0 -5
- package/build/esm/components/Media/Video/Video.js +3 -7
- package/build/esm/components/Title/Title.d.ts +2 -1
- package/build/esm/components/Title/Title.js +2 -2
- package/build/esm/components/Title/TitleItem.css +3 -3
- package/build/esm/components/YandexForm/YandexForm.d.ts +2 -17
- package/build/esm/components/YandexForm/YandexForm.js +5 -3
- package/build/esm/components/YandexForm/schema.d.ts +16 -0
- package/build/esm/components/YandexForm/schema.js +10 -0
- package/build/esm/constructor-items.d.ts +1 -0
- package/build/esm/constructor-items.js +2 -1
- package/build/esm/editor/data/templates/form-block.json +20 -0
- package/build/esm/models/constructor-items/blocks.d.ts +33 -4
- package/build/esm/models/constructor-items/blocks.js +12 -0
- package/build/esm/models/constructor-items/common.d.ts +22 -3
- package/build/esm/models/guards.d.ts +3 -1
- package/build/esm/models/guards.js +7 -1
- package/build/esm/schema/constants.js +3 -2
- package/build/esm/schema/validators/blocks.d.ts +1 -0
- package/build/esm/schema/validators/blocks.js +1 -0
- package/build/esm/sub-blocks/BasicCard/BasicCard.js +5 -2
- package/build/esm/sub-blocks/Content/Content.js +12 -5
- package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +10 -10
- package/build/esm/sub-blocks/HubspotForm/schema.d.ts +22 -0
- package/build/esm/sub-blocks/HubspotForm/schema.js +14 -0
- package/build/esm/sub-blocks/LayoutItem/utils.d.ts +1 -0
- package/build/esm/sub-blocks/Quote/Quote.css +0 -2
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +33 -4
- package/server/models/constructor-items/blocks.js +13 -1
- package/server/models/constructor-items/common.d.ts +22 -3
- package/server/models/guards.d.ts +3 -1
- package/server/models/guards.js +9 -1
- package/widget/index.js +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultVideo = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const models_1 = require("../../models");
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
8
|
+
const utils_2 = require("../Media/Video/utils");
|
|
9
|
+
const CustomBarControls_1 = tslib_1.__importDefault(require("../ReactPlayer/CustomBarControls"));
|
|
10
|
+
const b = (0, utils_1.block)('default-video');
|
|
11
|
+
exports.DefaultVideo = react_1.default.forwardRef((props, ref) => {
|
|
12
|
+
const { video, qa, customBarControlsClassName } = props;
|
|
13
|
+
const { controls, customControlsOptions, muted: initiallyMuted } = video;
|
|
14
|
+
const { muteButtonShown, positioning, type: customControlsType, } = customControlsOptions || {};
|
|
15
|
+
const [isPaused, setIsPaused] = (0, react_1.useState)(false);
|
|
16
|
+
const [isMuted, setIsMuted] = (0, react_1.useState)(initiallyMuted);
|
|
17
|
+
const videoRef = (0, react_1.useRef)(null);
|
|
18
|
+
// one may not use this hook and work with `ref` variable only, but
|
|
19
|
+
// in this case one should support both function type and object type,
|
|
20
|
+
// according to ForwardedRef type.
|
|
21
|
+
// Currently used way with extra ref and useImperativeHandle is more
|
|
22
|
+
// convenient and allows us to work with object typed ref only,
|
|
23
|
+
// avoiding typeof ref === 'function' statements
|
|
24
|
+
(0, react_1.useImperativeHandle)(ref, () => {
|
|
25
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current)) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
return videoRef.current;
|
|
29
|
+
}, [videoRef]);
|
|
30
|
+
const onPlayToggle = (0, react_1.useCallback)(() => {
|
|
31
|
+
setIsPaused((value) => {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
if (value) {
|
|
34
|
+
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
(_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.pause();
|
|
38
|
+
}
|
|
39
|
+
return !value;
|
|
40
|
+
});
|
|
41
|
+
}, [videoRef]);
|
|
42
|
+
const onMuteToggle = (0, react_1.useCallback)(() => {
|
|
43
|
+
setIsMuted((value) => !value);
|
|
44
|
+
}, []);
|
|
45
|
+
const onClick = (0, react_1.useCallback)(() => {
|
|
46
|
+
if (customControlsType === models_1.CustomControlsType.WithPlayPauseButton) {
|
|
47
|
+
onPlayToggle();
|
|
48
|
+
}
|
|
49
|
+
}, [onPlayToggle, customControlsType]);
|
|
50
|
+
return (react_1.default.createElement(react_1.Fragment, null,
|
|
51
|
+
react_1.default.createElement("video", { disablePictureInPicture: true, playsInline: true,
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
54
|
+
pip: "false", className: b(), ref: videoRef, preload: "metadata", muted: isMuted, "aria-label": video.ariaLabel, onClick: onClick }, (0, utils_2.getVideoTypesWithPriority)(video.src).map(({ src, type }, index) => (react_1.default.createElement("source", { key: index, src: src, type: type, "data-qa": qa })))),
|
|
55
|
+
controls === models_1.MediaVideoControlsType.Custom && (react_1.default.createElement(CustomBarControls_1.default, { className: customBarControlsClassName, type: customControlsType, isPaused: isPaused, onPlayClick: onPlayToggle, muteButtonShown: muteButtonShown, shown: true, positioning: positioning, mute: {
|
|
56
|
+
isMuted: Boolean(isMuted),
|
|
57
|
+
changeMute: onMuteToggle,
|
|
58
|
+
} }))));
|
|
59
|
+
});
|
|
60
|
+
exports.DefaultVideo.displayName = 'DefaultVideo';
|
|
@@ -41,13 +41,13 @@ const LabelSizeMap = {
|
|
|
41
41
|
};
|
|
42
42
|
const FileLink = (props) => {
|
|
43
43
|
const { hostname } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
44
|
-
const { href, text, type = 'vertical', textSize = 'm', className, theme = 'default', onClick, tabIndex, urlTitle, } = props;
|
|
44
|
+
const { href, text, type = 'vertical', textSize = 'm', className, theme = 'default', onClick, tabIndex, urlTitle, extraProps, } = props;
|
|
45
45
|
const fileExt = getFileExt(href);
|
|
46
46
|
const labelTheme = (FileExtensionThemes[fileExt] || 'unknown');
|
|
47
47
|
const labelSize = LabelSizeMap[textSize];
|
|
48
48
|
return (react_1.default.createElement("div", { className: b({ ext: fileExt, type, size: textSize, theme }, className) },
|
|
49
49
|
react_1.default.createElement(uikit_1.Label, { className: b('file-label'), size: labelSize, theme: labelTheme }, fileExt),
|
|
50
50
|
react_1.default.createElement("div", { className: b('link') },
|
|
51
|
-
react_1.default.createElement("a", Object.assign({ href: href, onClick: onClick, tabIndex: tabIndex, title: urlTitle }, (0, utils_1.getLinkProps)(href, hostname)), text))));
|
|
51
|
+
react_1.default.createElement("a", Object.assign({ href: href, onClick: onClick, tabIndex: tabIndex, title: urlTitle }, (0, utils_1.getLinkProps)(href, hostname), extraProps), text))));
|
|
52
52
|
};
|
|
53
53
|
exports.default = FileLink;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
1
|
+
import { CSSProperties, HTMLProps } from 'react';
|
|
2
2
|
import { ImageProps } from '../Image/Image';
|
|
3
3
|
export interface FullscreenImageProps extends ImageProps {
|
|
4
4
|
imageClassName?: string;
|
|
5
5
|
modalImageClass?: string;
|
|
6
6
|
imageStyle?: CSSProperties;
|
|
7
|
+
extraProps?: HTMLProps<HTMLDivElement>;
|
|
7
8
|
}
|
|
8
9
|
declare const FullscreenImage: (props: FullscreenImageProps) => JSX.Element;
|
|
9
10
|
export default FullscreenImage;
|
|
@@ -11,11 +11,11 @@ const b = (0, utils_1.block)('fullscreen-image');
|
|
|
11
11
|
const FULL_SCREEN_ICON_SIZE = 18;
|
|
12
12
|
const CLOSE_ICON_SIZE = 30;
|
|
13
13
|
const FullscreenImage = (props) => {
|
|
14
|
-
const { imageClassName, modalImageClass, imageStyle, alt = (0, i18n_1.default)('img-alt') } = props;
|
|
14
|
+
const { imageClassName, modalImageClass, imageStyle, alt = (0, i18n_1.default)('img-alt'), extraProps } = props;
|
|
15
15
|
const [isOpened, setIsOpened] = (0, react_1.useState)(false);
|
|
16
16
|
const openModal = () => setIsOpened(true);
|
|
17
17
|
const closeModal = () => setIsOpened(false);
|
|
18
|
-
return (react_1.default.createElement("div", { className: b() },
|
|
18
|
+
return (react_1.default.createElement("div", Object.assign({ className: b() }, extraProps),
|
|
19
19
|
react_1.default.createElement("div", { className: b('image-wrapper') },
|
|
20
20
|
react_1.default.createElement(Image_1.default, Object.assign({}, props, { alt: alt, className: b('image', imageClassName), onClick: openModal, style: imageStyle })),
|
|
21
21
|
react_1.default.createElement("button", { className: b('icon-wrapper'), onClick: openModal },
|
|
@@ -15,7 +15,7 @@ const DeviceSpecificFragment = ({ disableWebp, src, breakpoint, qa, }) => (react
|
|
|
15
15
|
react_1.default.createElement("source", { srcSet: src, media: `(max-width: ${breakpoint}px)`, "data-qa": qa })));
|
|
16
16
|
const Image = (props) => {
|
|
17
17
|
const projectSettings = (0, react_1.useContext)(projectSettingsContext_1.ProjectSettingsContext);
|
|
18
|
-
const { src: imageSrc, alt, disableCompress, tablet, desktop, mobile, style, className, onClick, containerClassName, qa
|
|
18
|
+
const { src: imageSrc, alt, disableCompress, tablet, desktop, mobile, style, className, onClick, containerClassName, qa } = props, rest = tslib_1.__rest(props, ["src", "alt", "disableCompress", "tablet", "desktop", "mobile", "style", "className", "onClick", "containerClassName", "qa"]);
|
|
19
19
|
const [imgLoadingError, setImgLoadingError] = (0, react_1.useState)(false);
|
|
20
20
|
const src = imageSrc || desktop;
|
|
21
21
|
if (!src) {
|
|
@@ -30,6 +30,6 @@ const Image = (props) => {
|
|
|
30
30
|
mobile && (react_1.default.createElement(DeviceSpecificFragment, { src: mobile, disableWebp: disableWebp, breakpoint: constants_1.BREAKPOINTS.sm, qa: qaAttributes.mobileSource })),
|
|
31
31
|
tablet && (react_1.default.createElement(DeviceSpecificFragment, { src: tablet, disableWebp: disableWebp, breakpoint: constants_1.BREAKPOINTS.md, qa: qaAttributes.tabletSource })),
|
|
32
32
|
src && !disableWebp && (react_1.default.createElement("source", { srcSet: checkWebP(src), type: "image/webp", "data-qa": qaAttributes.desktopSourceCompressed })),
|
|
33
|
-
react_1.default.createElement(ImageBase_1.default, { className: className, alt: alt, src: src, style: style, onClick: onClick, onError: () => setImgLoadingError(true) })));
|
|
33
|
+
react_1.default.createElement(ImageBase_1.default, Object.assign({ className: className, alt: alt, src: src, style: style, onClick: onClick, onError: () => setImgLoadingError(true) }, rest))));
|
|
34
34
|
};
|
|
35
35
|
exports.default = Image;
|
|
@@ -28,7 +28,7 @@ function getArrowSize(size) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
const LinkBlock = (props) => {
|
|
31
|
-
const { text, url, arrow, metrikaGoals, pixelEvents, analyticsEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, tabIndex, qa, urlTitle, } = props;
|
|
31
|
+
const { text, url, arrow, metrikaGoals, pixelEvents, analyticsEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, tabIndex, qa, urlTitle, extraProps, } = props;
|
|
32
32
|
const qaAttributes = (0, index_1.getQaAttrubutes)(qa, ['normal']);
|
|
33
33
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
34
34
|
const handleAnalytics = (0, hooks_1.useAnalytics)(models_1.DefaultEventNames.Link, url);
|
|
@@ -43,14 +43,14 @@ const LinkBlock = (props) => {
|
|
|
43
43
|
const getLinkByType = () => {
|
|
44
44
|
switch (theme) {
|
|
45
45
|
case 'back':
|
|
46
|
-
return (react_1.default.createElement(BackLink_1.default, { title: children || text, url: href, onClick: onClick, tabIndex: tabIndex }));
|
|
46
|
+
return (react_1.default.createElement(BackLink_1.default, { title: children || text, url: href, onClick: onClick, tabIndex: tabIndex, extraProps: extraProps }));
|
|
47
47
|
case 'file-link':
|
|
48
48
|
case 'underline':
|
|
49
|
-
return (react_1.default.createElement(FileLink_1.default, { text: children || text, href: href, type: "horizontal", textSize: textSize, onClick: onClick, tabIndex: tabIndex }));
|
|
49
|
+
return (react_1.default.createElement(FileLink_1.default, { text: children || text, href: href, type: "horizontal", textSize: textSize, onClick: onClick, tabIndex: tabIndex, extraProps: extraProps }));
|
|
50
50
|
case 'normal': {
|
|
51
51
|
const linkProps = (0, utils_1.getLinkProps)(url, hostname, target);
|
|
52
52
|
const content = children || text;
|
|
53
|
-
return (react_1.default.createElement("a", Object.assign({ className: b('link', { theme: colorTheme, 'has-arrow': arrow }), href: href, onClick: onClick, tabIndex: tabIndex, title: urlTitle }, linkProps, { "data-qa": qaAttributes.normal }), arrow ? (react_1.default.createElement(react_1.Fragment, null,
|
|
53
|
+
return (react_1.default.createElement("a", Object.assign({ className: b('link', { theme: colorTheme, 'has-arrow': arrow }), href: href, onClick: onClick, tabIndex: tabIndex, title: urlTitle }, linkProps, { "data-qa": qaAttributes.normal }, extraProps), arrow ? (react_1.default.createElement(react_1.Fragment, null,
|
|
54
54
|
react_1.default.createElement("span", { className: b('content') }, content),
|
|
55
55
|
WORD_JOINER_SYM,
|
|
56
56
|
react_1.default.createElement(uikit_1.Icon, { className: b('arrow'), data: icons_1.Chevron, size: getArrowSize(textSize) }))) : (content)));
|
|
@@ -4,11 +4,6 @@ unpredictable css rules order in build */
|
|
|
4
4
|
position: relative;
|
|
5
5
|
overflow: hidden;
|
|
6
6
|
}
|
|
7
|
-
.pc-media-component-video__item {
|
|
8
|
-
width: 100%;
|
|
9
|
-
display: flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
}
|
|
12
7
|
.pc-media-component-video__react-player {
|
|
13
8
|
display: flex;
|
|
14
9
|
position: relative;
|
|
@@ -4,8 +4,8 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const models_1 = require("../../../models");
|
|
6
6
|
const utils_1 = require("../../../utils");
|
|
7
|
+
const DefaultVideo_1 = require("../../DefaultVideo/DefaultVideo");
|
|
7
8
|
const ReactPlayer_1 = tslib_1.__importDefault(require("../../ReactPlayer/ReactPlayer"));
|
|
8
|
-
const utils_2 = require("./utils");
|
|
9
9
|
const b = (0, utils_1.block)('media-component-video');
|
|
10
10
|
const Video = (props) => {
|
|
11
11
|
const { video, height, metrika, analyticsEvents, previewImg, playButton: commonPlayButton, customBarControlsClassName, videoClassName, playVideo, setHasVideoFallback, hasVideoFallback, qa, ratio, } = props;
|
|
@@ -47,13 +47,9 @@ const Video = (props) => {
|
|
|
47
47
|
]);
|
|
48
48
|
const defaultVideoBlock = (0, react_1.useMemo)(() => {
|
|
49
49
|
return video.src.length && !hasVideoFallback ? (react_1.default.createElement("div", { className: b('wrap', videoClassName), style: { height }, "data-qa": qaAttributes.default },
|
|
50
|
-
react_1.default.createElement(
|
|
51
|
-
// @ts-ignore
|
|
52
|
-
// eslint-disable-next-line react/no-unknown-property
|
|
53
|
-
pip: "false", className: b('item'), ref: ref, preload: "metadata", muted: true, "aria-label": video.ariaLabel }, (0, utils_2.getVideoTypesWithPriority)(video.src).map(({ src, type }, index) => (react_1.default.createElement("source", { key: index, src: src, type: type, "data-qa": qaAttributes.source })))))) : null;
|
|
50
|
+
react_1.default.createElement(DefaultVideo_1.DefaultVideo, { ref: ref, video: video, qa: qaAttributes.source }))) : null;
|
|
54
51
|
}, [
|
|
55
|
-
video
|
|
56
|
-
video.ariaLabel,
|
|
52
|
+
video,
|
|
57
53
|
hasVideoFallback,
|
|
58
54
|
videoClassName,
|
|
59
55
|
height,
|
|
@@ -2,6 +2,7 @@ import { GridColumnSizesType } from '../../grid';
|
|
|
2
2
|
import { ClassNameProps, TitleProps as TitleParams } from '../../models';
|
|
3
3
|
export interface TitleProps extends TitleParams {
|
|
4
4
|
colSizes?: GridColumnSizesType;
|
|
5
|
+
id?: string;
|
|
5
6
|
}
|
|
6
|
-
declare const Title: ({ title, subtitle, className, colSizes, }: TitleProps & ClassNameProps) => JSX.Element | null;
|
|
7
|
+
declare const Title: ({ title, subtitle, className, colSizes, id, }: TitleProps & ClassNameProps) => JSX.Element | null;
|
|
7
8
|
export default Title;
|
|
@@ -7,12 +7,12 @@ const utils_1 = require("../../utils");
|
|
|
7
7
|
const YFMWrapper_1 = tslib_1.__importDefault(require("../YFMWrapper/YFMWrapper"));
|
|
8
8
|
const TitleItem_1 = tslib_1.__importDefault(require("./TitleItem"));
|
|
9
9
|
const b = (0, utils_1.block)('title');
|
|
10
|
-
const Title = ({ title, subtitle, className, colSizes = { all: 12, sm: 8 }, }) => {
|
|
10
|
+
const Title = ({ title, subtitle, className, colSizes = { all: 12, sm: 8 }, id, }) => {
|
|
11
11
|
if (!title && !subtitle) {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
14
|
const _a = !title || typeof title === 'string' ? { text: title } : title, { text } = _a, titleProps = tslib_1.__rest(_a, ["text"]);
|
|
15
|
-
return (react_1.default.createElement("div", { className: b(null, className) },
|
|
15
|
+
return (react_1.default.createElement("div", { className: b(null, className), id: id },
|
|
16
16
|
text && (react_1.default.createElement(grid_1.Col, { reset: true, sizes: colSizes },
|
|
17
17
|
react_1.default.createElement(TitleItem_1.default, Object.assign({ text: text }, titleProps)))),
|
|
18
18
|
subtitle && (react_1.default.createElement(grid_1.Col, { reset: true, sizes: colSizes },
|
|
@@ -50,13 +50,13 @@ unpredictable css rules order in build */
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
.pc-title-item__arrow {
|
|
53
|
-
margin-top:
|
|
53
|
+
margin-top: 9px;
|
|
54
54
|
}
|
|
55
55
|
.pc-title-item__arrow_size_xs {
|
|
56
|
-
margin-top:
|
|
56
|
+
margin-top: 6px;
|
|
57
57
|
}
|
|
58
58
|
.pc-title-item__arrow_size_s {
|
|
59
|
-
margin-top:
|
|
59
|
+
margin-top: 4px;
|
|
60
60
|
}
|
|
61
61
|
.pc-title-item__link {
|
|
62
62
|
color: inherit;
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AnalyticsEventsBase } from '../../models/common';
|
|
1
|
+
import { YandexFormProps } from '../../models';
|
|
3
2
|
export declare const YANDEX_FORM_ORIGIN = "https://forms.yandex.ru";
|
|
4
|
-
export
|
|
5
|
-
id: number | string;
|
|
6
|
-
containerId?: string;
|
|
7
|
-
theme?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
headerHeight?: number;
|
|
10
|
-
customFormOrigin?: string;
|
|
11
|
-
params?: {
|
|
12
|
-
[key: string]: string;
|
|
13
|
-
};
|
|
14
|
-
onSubmit?: () => void;
|
|
15
|
-
onLoad?: () => void;
|
|
16
|
-
metrikaGoals?: string | string[];
|
|
17
|
-
pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
|
|
18
|
-
}
|
|
3
|
+
export declare const YANDEX_FORM_SECTION = "surveys";
|
|
19
4
|
declare const YandexForm: (props: YandexFormProps) => JSX.Element;
|
|
20
5
|
export default YandexForm;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.YANDEX_FORM_ORIGIN = void 0;
|
|
3
|
+
exports.YANDEX_FORM_SECTION = exports.YANDEX_FORM_ORIGIN = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const localeContext_1 = require("../../context/localeContext");
|
|
@@ -11,13 +11,15 @@ const common_1 = require("../../models/common");
|
|
|
11
11
|
const utils_1 = require("../../utils");
|
|
12
12
|
const constants_1 = require("../constants");
|
|
13
13
|
exports.YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';
|
|
14
|
+
exports.YANDEX_FORM_SECTION = 'surveys';
|
|
14
15
|
const CONTAINER_ID = 'pc-yandex-form-container';
|
|
15
16
|
const b = (0, utils_1.block)('yandex-form');
|
|
16
17
|
const YandexForm = (props) => {
|
|
17
|
-
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = constants_1.HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, } = props;
|
|
18
|
+
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = constants_1.HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, customFormSection, } = props;
|
|
18
19
|
const formContainerRef = (0, react_1.useRef)(null);
|
|
19
20
|
const iframeRef = (0, react_1.useRef)();
|
|
20
21
|
const yaFormOrigin = customFormOrigin || exports.YANDEX_FORM_ORIGIN;
|
|
22
|
+
const yaFormSection = customFormSection || exports.YANDEX_FORM_SECTION;
|
|
21
23
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
22
24
|
const handleAnalytics = (0, hooks_1.useAnalytics)(common_1.DefaultEventNames.YandexFormSubmit);
|
|
23
25
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
@@ -39,7 +41,7 @@ const YandexForm = (props) => {
|
|
|
39
41
|
queryParams.set(param, params[param]);
|
|
40
42
|
});
|
|
41
43
|
}
|
|
42
|
-
const src = `${yaFormOrigin}
|
|
44
|
+
const src = `${yaFormOrigin}/${yaFormSection}/${id}/?${queryParams}`;
|
|
43
45
|
if (iframeRef.current) {
|
|
44
46
|
iframeRef.current.src = src;
|
|
45
47
|
}
|
|
@@ -54,7 +56,7 @@ const YandexForm = (props) => {
|
|
|
54
56
|
iframeRef.current.width = '100%';
|
|
55
57
|
container.appendChild(iframeRef.current);
|
|
56
58
|
}
|
|
57
|
-
}, [locale.lang, theme, isMobile, yaFormOrigin, id, containerId, params]);
|
|
59
|
+
}, [locale.lang, theme, isMobile, yaFormOrigin, yaFormSection, id, containerId, params]);
|
|
58
60
|
const handleSubmit = (0, react_1.useCallback)(() => {
|
|
59
61
|
if (formContainerRef && formContainerRef.current) {
|
|
60
62
|
const { top } = formContainerRef.current.getBoundingClientRect();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.YandexFormProps = void 0;
|
|
4
|
+
const common_1 = require("../../schema/validators/common");
|
|
5
|
+
exports.YandexFormProps = {
|
|
6
|
+
type: 'object',
|
|
7
|
+
required: ['id'],
|
|
8
|
+
properties: Object.assign(Object.assign({}, common_1.BaseProps), { id: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
}, containerId: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
} }),
|
|
13
|
+
};
|
|
@@ -17,6 +17,7 @@ export declare const blockMap: {
|
|
|
17
17
|
"share-block": ({ items, title }: import("./models").ShareBlockProps) => JSX.Element;
|
|
18
18
|
"map-block": ({ map, ...props }: import("./models").MapBlockProps) => JSX.Element;
|
|
19
19
|
"filter-block": import("react").FC<import("./models").FilterBlockProps>;
|
|
20
|
+
"form-block": import("react").FC<import("./models").FormBlockProps>;
|
|
20
21
|
};
|
|
21
22
|
export declare const subBlockMap: {
|
|
22
23
|
divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
|
|
@@ -26,6 +26,7 @@ exports.blockMap = {
|
|
|
26
26
|
[models_1.BlockType.ShareBlock]: blocks_1.ShareBlock,
|
|
27
27
|
[models_1.BlockType.MapBlock]: blocks_1.MapBlock,
|
|
28
28
|
[models_1.BlockType.FilterBlock]: blocks_1.FilterBlock,
|
|
29
|
+
[models_1.BlockType.FormBlock]: blocks_1.FormBlock,
|
|
29
30
|
};
|
|
30
31
|
exports.subBlockMap = {
|
|
31
32
|
[models_1.SubBlockType.Divider]: sub_blocks_1.Divider,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"template": {
|
|
3
|
+
"type": "form-block",
|
|
4
|
+
"formData": {
|
|
5
|
+
"yandex": {
|
|
6
|
+
"hash": "hashString",
|
|
7
|
+
"title": ""
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"direction": "center",
|
|
11
|
+
"textContent": {
|
|
12
|
+
"title": "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
|
|
13
|
+
"text": "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
|
|
14
|
+
},
|
|
15
|
+
"image": {
|
|
16
|
+
"src": "https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img-mini_4-12_light.png"
|
|
17
|
+
},
|
|
18
|
+
"backgroundColor": "#262626"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -3,8 +3,8 @@ import { ButtonSize } from '@gravity-ui/uikit';
|
|
|
3
3
|
import { GridColumnSize, GridColumnSizesType } from '../../grid/types';
|
|
4
4
|
import { ThemeSupporting } from '../../utils';
|
|
5
5
|
import { AnalyticsEventsBase } from '../common';
|
|
6
|
-
import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps } from './common';
|
|
7
|
-
import { BannerCardProps, SubBlock, SubBlockModels } from './sub-blocks';
|
|
6
|
+
import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps, YandexFormProps } from './common';
|
|
7
|
+
import { BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels } from './sub-blocks';
|
|
8
8
|
export declare enum BlockType {
|
|
9
9
|
PromoFeaturesBlock = "promo-features-block",
|
|
10
10
|
ExtendedFeaturesBlock = "extended-features-block",
|
|
@@ -23,7 +23,8 @@ export declare enum BlockType {
|
|
|
23
23
|
ContentLayoutBlock = "content-layout-block",
|
|
24
24
|
ShareBlock = "share-block",
|
|
25
25
|
MapBlock = "map-block",
|
|
26
|
-
FilterBlock = "filter-block"
|
|
26
|
+
FilterBlock = "filter-block",
|
|
27
|
+
FormBlock = "form-block"
|
|
27
28
|
}
|
|
28
29
|
export declare const BlockTypes: BlockType[];
|
|
29
30
|
export declare const HeaderBlockTypes: BlockType[];
|
|
@@ -274,7 +275,9 @@ export interface ContentItemProps {
|
|
|
274
275
|
}
|
|
275
276
|
export interface ContentBlockProps {
|
|
276
277
|
title?: TitleItemBaseProps | string;
|
|
278
|
+
titleId?: string;
|
|
277
279
|
text?: string;
|
|
280
|
+
textId?: string;
|
|
278
281
|
additionalInfo?: string;
|
|
279
282
|
links?: LinkProps[];
|
|
280
283
|
buttons?: ButtonProps[];
|
|
@@ -295,6 +298,29 @@ export interface ShareBlockProps {
|
|
|
295
298
|
items: PCShareSocialNetwork[];
|
|
296
299
|
title?: string;
|
|
297
300
|
}
|
|
301
|
+
export declare enum FormBlockDataTypes {
|
|
302
|
+
YANDEX = "yandex",
|
|
303
|
+
HUBSPOT = "hubspot"
|
|
304
|
+
}
|
|
305
|
+
export declare enum FormBlockDirection {
|
|
306
|
+
FormContent = "form-content",
|
|
307
|
+
ContentForm = "content-form",
|
|
308
|
+
Center = "center"
|
|
309
|
+
}
|
|
310
|
+
export interface FormBlockYandexData {
|
|
311
|
+
yandex: YandexFormProps;
|
|
312
|
+
}
|
|
313
|
+
export interface FormBlockHubspotData {
|
|
314
|
+
hubspot: HubspotFormProps;
|
|
315
|
+
}
|
|
316
|
+
export type FormBlockData = FormBlockYandexData | FormBlockHubspotData;
|
|
317
|
+
export interface FormBlockProps {
|
|
318
|
+
formData: FormBlockData;
|
|
319
|
+
title?: string;
|
|
320
|
+
textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;
|
|
321
|
+
direction?: FormBlockDirection;
|
|
322
|
+
background?: BackgroundImageProps;
|
|
323
|
+
}
|
|
298
324
|
export type HeaderBlockModel = {
|
|
299
325
|
type: BlockType.HeaderBlock;
|
|
300
326
|
} & HeaderBlockProps;
|
|
@@ -349,6 +375,9 @@ export type ContentLayoutBlockModel = {
|
|
|
349
375
|
export type ShareBLockModel = {
|
|
350
376
|
type: BlockType.ShareBlock;
|
|
351
377
|
} & ShareBlockProps;
|
|
352
|
-
type
|
|
378
|
+
export type FormBlockModel = {
|
|
379
|
+
type: BlockType.FormBlock;
|
|
380
|
+
} & FormBlockProps;
|
|
381
|
+
type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel | FormBlockModel;
|
|
353
382
|
export type Block = BlockModels & BlockBaseProps;
|
|
354
383
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PCShareSocialNetwork = exports.SliderType = exports.SliderBreakpointNames = exports.HeaderBlockTypes = exports.BlockTypes = exports.BlockType = void 0;
|
|
3
|
+
exports.FormBlockDirection = exports.FormBlockDataTypes = exports.PCShareSocialNetwork = exports.SliderType = exports.SliderBreakpointNames = exports.HeaderBlockTypes = exports.BlockTypes = exports.BlockType = void 0;
|
|
4
4
|
var BlockType;
|
|
5
5
|
(function (BlockType) {
|
|
6
6
|
BlockType["PromoFeaturesBlock"] = "promo-features-block";
|
|
@@ -21,6 +21,7 @@ var BlockType;
|
|
|
21
21
|
BlockType["ShareBlock"] = "share-block";
|
|
22
22
|
BlockType["MapBlock"] = "map-block";
|
|
23
23
|
BlockType["FilterBlock"] = "filter-block";
|
|
24
|
+
BlockType["FormBlock"] = "form-block";
|
|
24
25
|
})(BlockType = exports.BlockType || (exports.BlockType = {}));
|
|
25
26
|
exports.BlockTypes = Object.values(BlockType);
|
|
26
27
|
exports.HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];
|
|
@@ -44,3 +45,14 @@ var PCShareSocialNetwork;
|
|
|
44
45
|
PCShareSocialNetwork["Facebook"] = "facebook";
|
|
45
46
|
PCShareSocialNetwork["LinkedIn"] = "linkedin";
|
|
46
47
|
})(PCShareSocialNetwork = exports.PCShareSocialNetwork || (exports.PCShareSocialNetwork = {}));
|
|
48
|
+
var FormBlockDataTypes;
|
|
49
|
+
(function (FormBlockDataTypes) {
|
|
50
|
+
FormBlockDataTypes["YANDEX"] = "yandex";
|
|
51
|
+
FormBlockDataTypes["HUBSPOT"] = "hubspot";
|
|
52
|
+
})(FormBlockDataTypes = exports.FormBlockDataTypes || (exports.FormBlockDataTypes = {}));
|
|
53
|
+
var FormBlockDirection;
|
|
54
|
+
(function (FormBlockDirection) {
|
|
55
|
+
FormBlockDirection["FormContent"] = "form-content";
|
|
56
|
+
FormBlockDirection["ContentForm"] = "content-form";
|
|
57
|
+
FormBlockDirection["Center"] = "center";
|
|
58
|
+
})(FormBlockDirection = exports.FormBlockDirection || (exports.FormBlockDirection = {}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { CSSProperties, ReactNode } from 'react';
|
|
1
|
+
import React, { CSSProperties, HTMLProps, ReactNode } from 'react';
|
|
2
2
|
import { ButtonView, ButtonProps as UikitButtonProps } from '@gravity-ui/uikit';
|
|
3
3
|
import { ThemeSupporting } from '../../utils';
|
|
4
|
-
import { AnalyticsEventsBase, ClassNameProps, PixelEventType, QAProps } from '../common';
|
|
4
|
+
import { AnalyticsEventsBase, ClassNameProps, PixelEvent, PixelEventType, QAProps } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
7
7
|
Line = "line"
|
|
@@ -95,7 +95,7 @@ interface LoopProps {
|
|
|
95
95
|
start: number;
|
|
96
96
|
end?: number;
|
|
97
97
|
}
|
|
98
|
-
export interface ImageInfoProps {
|
|
98
|
+
export interface ImageInfoProps extends Pick<HTMLProps<HTMLImageElement>, 'aria-describedby'> {
|
|
99
99
|
alt?: string;
|
|
100
100
|
disableCompress?: boolean;
|
|
101
101
|
}
|
|
@@ -138,6 +138,7 @@ export interface LinkProps extends AnalyticsEventsBase, Stylable, Tabbable {
|
|
|
138
138
|
target?: string;
|
|
139
139
|
metrikaGoals?: MetrikaGoal;
|
|
140
140
|
pixelEvents?: ButtonPixel;
|
|
141
|
+
extraProps?: HTMLProps<HTMLAnchorElement>;
|
|
141
142
|
}
|
|
142
143
|
export interface FileLinkProps extends ClassNameProps, Tabbable {
|
|
143
144
|
href: string;
|
|
@@ -147,11 +148,13 @@ export interface FileLinkProps extends ClassNameProps, Tabbable {
|
|
|
147
148
|
theme?: ContentTheme;
|
|
148
149
|
urlTitle?: string;
|
|
149
150
|
onClick?: () => void;
|
|
151
|
+
extraProps?: HTMLProps<HTMLAnchorElement>;
|
|
150
152
|
}
|
|
151
153
|
export type ButtonTheme = ButtonView | 'github' | 'app-store' | 'google-play' | 'scale' | 'monochrome';
|
|
152
154
|
export interface ButtonProps extends AnalyticsEventsBase, Pick<UikitButtonProps, 'size' | 'width' | 'extraProps'> {
|
|
153
155
|
text: string;
|
|
154
156
|
url: string;
|
|
157
|
+
urlTitle?: string;
|
|
155
158
|
primary?: boolean;
|
|
156
159
|
theme?: ButtonTheme;
|
|
157
160
|
img?: ButtonImageProps | string;
|
|
@@ -337,4 +340,20 @@ export interface TitleProps {
|
|
|
337
340
|
title?: TitleItemProps | string;
|
|
338
341
|
subtitle?: string;
|
|
339
342
|
}
|
|
343
|
+
export interface YandexFormProps extends AnalyticsEventsBase {
|
|
344
|
+
id: number | string;
|
|
345
|
+
containerId?: string;
|
|
346
|
+
theme?: string;
|
|
347
|
+
className?: string;
|
|
348
|
+
headerHeight?: number;
|
|
349
|
+
customFormOrigin?: string;
|
|
350
|
+
customFormSection?: string;
|
|
351
|
+
params?: {
|
|
352
|
+
[key: string]: string;
|
|
353
|
+
};
|
|
354
|
+
onSubmit?: () => void;
|
|
355
|
+
onLoad?: () => void;
|
|
356
|
+
metrikaGoals?: string | string[];
|
|
357
|
+
pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
|
|
358
|
+
}
|
|
340
359
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { Block, ConstructorItem } from './';
|
|
1
|
+
import { Block, ConstructorItem, FormBlockData, FormBlockHubspotData, FormBlockYandexData } from './';
|
|
2
2
|
import { MetrikaGoal, NewMetrikaGoal } from './index';
|
|
3
3
|
export declare function isBlock(block: ConstructorItem): block is Block;
|
|
4
4
|
export declare function isNewMetrikaFormat(metrika: MetrikaGoal): metrika is NewMetrikaGoal[];
|
|
5
|
+
export declare function isYandexDataForm(data: FormBlockData): data is FormBlockYandexData;
|
|
6
|
+
export declare function isHubspotDataForm(data: FormBlockData): data is FormBlockHubspotData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNewMetrikaFormat = exports.isBlock = void 0;
|
|
3
|
+
exports.isHubspotDataForm = exports.isYandexDataForm = exports.isNewMetrikaFormat = exports.isBlock = void 0;
|
|
4
4
|
const _1 = require("./");
|
|
5
5
|
function isBlock(block) {
|
|
6
6
|
return block.type in _1.BlockTypes;
|
|
@@ -10,3 +10,11 @@ function isNewMetrikaFormat(metrika) {
|
|
|
10
10
|
return Boolean(Array.isArray(metrika) && metrika.length && typeof metrika[0] === 'object');
|
|
11
11
|
}
|
|
12
12
|
exports.isNewMetrikaFormat = isNewMetrikaFormat;
|
|
13
|
+
function isYandexDataForm(data) {
|
|
14
|
+
return Boolean(data.yandex);
|
|
15
|
+
}
|
|
16
|
+
exports.isYandexDataForm = isYandexDataForm;
|
|
17
|
+
function isHubspotDataForm(data) {
|
|
18
|
+
return Boolean(data.hubspot);
|
|
19
|
+
}
|
|
20
|
+
exports.isHubspotDataForm = isHubspotDataForm;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.constructorCardSchemaNames = exports.constructorBlockSchemaNames = exports.cardSchemas = exports.blockSchemas = void 0;
|
|
4
4
|
const blocks_1 = require("./validators/blocks");
|
|
5
5
|
const sub_blocks_1 = require("./validators/sub-blocks");
|
|
6
|
-
exports.blockSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.Divider), blocks_1.ExtendedFeaturesBlock), blocks_1.PromoFeaturesBlock), blocks_1.SliderBlock), blocks_1.QuestionsBlock), blocks_1.HeaderBlock), blocks_1.BannerBlock), blocks_1.CompaniesBlock), blocks_1.MediaBlock), blocks_1.MapBlock), blocks_1.InfoBlock), blocks_1.TableBlock), blocks_1.TabsBlock), blocks_1.HeaderSliderBlock), blocks_1.IconsBlock), blocks_1.CardLayoutBlock), blocks_1.ContentLayoutBlock), blocks_1.ShareBlock), blocks_1.FilterBlock);
|
|
6
|
+
exports.blockSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.Divider), blocks_1.ExtendedFeaturesBlock), blocks_1.PromoFeaturesBlock), blocks_1.SliderBlock), blocks_1.QuestionsBlock), blocks_1.HeaderBlock), blocks_1.BannerBlock), blocks_1.CompaniesBlock), blocks_1.MediaBlock), blocks_1.MapBlock), blocks_1.InfoBlock), blocks_1.TableBlock), blocks_1.TabsBlock), blocks_1.HeaderSliderBlock), blocks_1.IconsBlock), blocks_1.CardLayoutBlock), blocks_1.ContentLayoutBlock), blocks_1.ShareBlock), blocks_1.FilterBlock), blocks_1.FormBlock);
|
|
7
7
|
exports.cardSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.MediaCardBlock), blocks_1.BannerCard), sub_blocks_1.PriceDetailedBlock), sub_blocks_1.BackgroundCard), sub_blocks_1.Quote), sub_blocks_1.BasicCard);
|
|
8
8
|
exports.constructorBlockSchemaNames = [
|
|
9
9
|
'divider',
|
|
@@ -30,6 +30,7 @@ exports.constructorBlockSchemaNames = [
|
|
|
30
30
|
'content-layout-block',
|
|
31
31
|
'share-block',
|
|
32
32
|
'filter-block',
|
|
33
|
+
'form-block',
|
|
33
34
|
];
|
|
34
35
|
exports.constructorCardSchemaNames = [
|
|
35
36
|
'media-card',
|
|
@@ -19,3 +19,4 @@ tslib_1.__exportStar(require("../../blocks/CardLayout/schema"), exports);
|
|
|
19
19
|
tslib_1.__exportStar(require("../../blocks/ContentLayout/schema"), exports);
|
|
20
20
|
tslib_1.__exportStar(require("../../blocks/Share/schema"), exports);
|
|
21
21
|
tslib_1.__exportStar(require("../../blocks/FilterBlock/schema"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("../../blocks/Form/schema"), exports);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
5
6
|
const __1 = require("../");
|
|
6
7
|
const CardBase_1 = tslib_1.__importDefault(require("../../components/CardBase/CardBase"));
|
|
7
8
|
const Image_1 = tslib_1.__importDefault(require("../../components/Image/Image"));
|
|
@@ -12,10 +13,12 @@ const b = (0, utils_2.block)('basic-card');
|
|
|
12
13
|
const BasicCard = (props) => {
|
|
13
14
|
const { title, text, icon, additionalInfo, links, buttons, iconPosition = sub_blocks_1.IconPosition.Top } = props, cardParams = tslib_1.__rest(props, ["title", "text", "icon", "additionalInfo", "links", "buttons", "iconPosition"]);
|
|
14
15
|
const iconProps = icon && (0, utils_1.getMediaImage)(icon);
|
|
15
|
-
|
|
16
|
+
const titleId = (0, uikit_1.useUniqId)();
|
|
17
|
+
const descriptionId = (0, uikit_1.useUniqId)();
|
|
18
|
+
return (react_1.default.createElement(CardBase_1.default, Object.assign({ className: b() }, cardParams, { extraProps: { 'aria-describedby': descriptionId, 'aria-labelledby': titleId } }),
|
|
16
19
|
react_1.default.createElement(CardBase_1.default.Content, null,
|
|
17
20
|
react_1.default.createElement("div", { className: b('content', { ['icon-position']: iconPosition }) },
|
|
18
21
|
iconProps && (react_1.default.createElement(Image_1.default, Object.assign({}, iconProps, { className: b('icon', { ['icon-position']: iconPosition }) }))),
|
|
19
|
-
react_1.default.createElement(__1.Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 }, size: "s", className: b({ ['content-layout']: iconPosition }) })))));
|
|
22
|
+
react_1.default.createElement(__1.Content, { title: title, titleId: titleId, text: text, textId: descriptionId, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 }, size: "s", className: b({ ['content-layout']: iconPosition }) })))));
|
|
20
23
|
};
|
|
21
24
|
exports.default = BasicCard;
|