@gravity-ui/page-constructor 4.31.1-alpha.0 → 4.33.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/Header/Header.js +6 -2
- package/build/cjs/blocks/Tabs/Tabs.js +8 -1
- package/build/cjs/blocks/index.d.ts +0 -1
- package/build/cjs/blocks/index.js +1 -3
- 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 +17 -2
- package/build/cjs/components/YandexForm/YandexForm.js +4 -6
- package/build/cjs/constructor-items.d.ts +0 -1
- package/build/cjs/constructor-items.js +0 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +6 -31
- package/build/cjs/models/constructor-items/blocks.js +1 -13
- package/build/cjs/models/constructor-items/common.d.ts +6 -19
- package/build/cjs/models/guards.d.ts +1 -3
- package/build/cjs/models/guards.js +1 -9
- package/build/cjs/models/navigation.d.ts +1 -0
- package/build/cjs/navigation/components/Logo/Logo.css +1 -0
- package/build/cjs/navigation/components/Logo/Logo.js +10 -5
- package/build/cjs/schema/constants.js +1 -2
- package/build/cjs/schema/validators/blocks.d.ts +0 -1
- package/build/cjs/schema/validators/blocks.js +0 -1
- 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/LayoutItem/utils.d.ts +1 -0
- package/build/cjs/sub-blocks/Quote/Quote.css +0 -2
- 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 +0 -1
- package/build/esm/blocks/index.js +0 -1
- 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 +17 -2
- package/build/esm/components/YandexForm/YandexForm.js +3 -5
- package/build/esm/constructor-items.d.ts +0 -1
- package/build/esm/constructor-items.js +1 -2
- package/build/esm/models/constructor-items/blocks.d.ts +6 -31
- package/build/esm/models/constructor-items/blocks.js +0 -12
- package/build/esm/models/constructor-items/common.d.ts +6 -19
- package/build/esm/models/guards.d.ts +1 -3
- package/build/esm/models/guards.js +1 -7
- package/build/esm/models/navigation.d.ts +1 -0
- package/build/esm/navigation/components/Logo/Logo.css +1 -0
- package/build/esm/navigation/components/Logo/Logo.js +11 -6
- package/build/esm/schema/constants.js +2 -3
- package/build/esm/schema/validators/blocks.d.ts +0 -1
- package/build/esm/schema/validators/blocks.js +0 -1
- 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/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 +6 -31
- package/server/models/constructor-items/blocks.js +1 -13
- package/server/models/constructor-items/common.d.ts +6 -19
- package/server/models/guards.d.ts +1 -3
- package/server/models/guards.js +1 -9
- package/server/models/navigation.d.ts +1 -0
- package/widget/index.js +1 -1
- package/build/cjs/blocks/Form/Form.css +0 -136
- package/build/cjs/blocks/Form/Form.d.ts +0 -4
- package/build/cjs/blocks/Form/Form.js +0 -61
- package/build/cjs/blocks/Form/HubspotInlineForm.d.ts +0 -7
- package/build/cjs/blocks/Form/HubspotInlineForm.js +0 -14
- package/build/cjs/blocks/Form/InnerForm/InnerForm.d.ts +0 -9
- package/build/cjs/blocks/Form/InnerForm/InnerForm.js +0 -28
- package/build/cjs/blocks/Form/schema.d.ts +0 -202
- package/build/cjs/blocks/Form/schema.js +0 -44
- package/build/cjs/components/YandexForm/schema.d.ts +0 -16
- package/build/cjs/components/YandexForm/schema.js +0 -13
- package/build/cjs/editor/data/templates/form-block.json +0 -20
- package/build/cjs/sub-blocks/HubspotForm/schema.d.ts +0 -22
- package/build/cjs/sub-blocks/HubspotForm/schema.js +0 -17
- package/build/esm/blocks/Form/Form.css +0 -136
- package/build/esm/blocks/Form/Form.d.ts +0 -5
- package/build/esm/blocks/Form/Form.js +0 -59
- package/build/esm/blocks/Form/HubspotInlineForm.d.ts +0 -7
- package/build/esm/blocks/Form/HubspotInlineForm.js +0 -12
- package/build/esm/blocks/Form/InnerForm/InnerForm.d.ts +0 -9
- package/build/esm/blocks/Form/InnerForm/InnerForm.js +0 -26
- package/build/esm/blocks/Form/schema.d.ts +0 -202
- package/build/esm/blocks/Form/schema.js +0 -40
- package/build/esm/components/YandexForm/schema.d.ts +0 -16
- package/build/esm/components/YandexForm/schema.js +0 -10
- package/build/esm/editor/data/templates/form-block.json +0 -20
- package/build/esm/sub-blocks/HubspotForm/schema.d.ts +0 -22
- package/build/esm/sub-blocks/HubspotForm/schema.js +0 -14
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.HeaderBlock = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
7
|
const components_1 = require("../../components");
|
|
7
8
|
const HeaderBreadcrumbs_1 = tslib_1.__importDefault(require("../../components/HeaderBreadcrumbs/HeaderBreadcrumbs"));
|
|
8
9
|
const utils_1 = require("../../components/Media/Image/utils");
|
|
@@ -35,6 +36,7 @@ const HeaderBlock = (props) => {
|
|
|
35
36
|
const imageThemed = image && (0, utils_2.getThemedValue)(image, theme);
|
|
36
37
|
const videoThemed = video && (0, utils_2.getThemedValue)(video, theme);
|
|
37
38
|
const fullWidth = (backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.fullWidth) || (backgroundThemed === null || backgroundThemed === void 0 ? void 0 : backgroundThemed.fullWidthMedia);
|
|
39
|
+
const titleId = (0, uikit_1.useUniqId)();
|
|
38
40
|
return (react_1.default.createElement("header", { className: b({
|
|
39
41
|
['has-media']: hasRightSideImage,
|
|
40
42
|
['full-width']: fullWidth,
|
|
@@ -57,7 +59,7 @@ const HeaderBlock = (props) => {
|
|
|
57
59
|
react_1.default.createElement(grid_1.Col, { sizes: titleSizes, className: b('content-inner') },
|
|
58
60
|
overtitle && (react_1.default.createElement("div", { className: b('overtitle') },
|
|
59
61
|
react_1.default.createElement(components_1.HTML, null, overtitle))),
|
|
60
|
-
react_1.default.createElement("h1", { className: b('title') },
|
|
62
|
+
react_1.default.createElement("h1", { className: b('title'), id: titleId },
|
|
61
63
|
status,
|
|
62
64
|
renderTitle ? renderTitle(title) : react_1.default.createElement(components_1.HTML, null, title)),
|
|
63
65
|
description && (react_1.default.createElement("div", { className: b('description') },
|
|
@@ -66,7 +68,9 @@ const HeaderBlock = (props) => {
|
|
|
66
68
|
constructorTheme: textTheme,
|
|
67
69
|
} }))),
|
|
68
70
|
buttons && (react_1.default.createElement("div", { className: b('buttons'), "data-qa": "header-buttons" }, buttons.map((button, index) => (react_1.default.createElement(components_1.RouterLink, { href: button.url, key: index },
|
|
69
|
-
react_1.default.createElement(components_1.Button, Object.assign({ key: index, className: b('button'), size: "xl"
|
|
71
|
+
react_1.default.createElement(components_1.Button, Object.assign({ key: index, className: b('button'), size: "xl", extraProps: {
|
|
72
|
+
'aria-describedby': titleId,
|
|
73
|
+
} }, button))))))),
|
|
70
74
|
children))),
|
|
71
75
|
hasRightSideImage && (react_1.default.createElement(components_1.Media, { className: b('media', { [curImageSize]: true }), videoClassName: b('video'), imageClassName: b('image'), video: videoThemed, image: imageThemed })))))));
|
|
72
76
|
};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TabsBlock = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
7
|
const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/AnimateBlock/AnimateBlock"));
|
|
7
8
|
const ButtonTabs_1 = tslib_1.__importDefault(require("../../components/ButtonTabs/ButtonTabs"));
|
|
8
9
|
const FullscreenImage_1 = tslib_1.__importDefault(require("../../components/FullscreenImage/FullscreenImage"));
|
|
@@ -26,10 +27,16 @@ const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered
|
|
|
26
27
|
const ref = (0, react_1.useRef)(null);
|
|
27
28
|
const mediaWidth = (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.offsetWidth;
|
|
28
29
|
const mediaHeight = mediaWidth && (0, VideoBlock_1.getHeight)(mediaWidth);
|
|
30
|
+
const captionId = (0, uikit_1.useUniqId)();
|
|
29
31
|
let imageProps;
|
|
30
32
|
if (activeTabData) {
|
|
31
33
|
const themedImage = (0, utils_2.getThemedValue)(activeTabData.image, theme);
|
|
32
34
|
imageProps = themedImage && (0, utils_1.getMediaImage)(themedImage);
|
|
35
|
+
if (activeTabData.caption && imageProps) {
|
|
36
|
+
Object.assign(imageProps, {
|
|
37
|
+
'aria-describedby': captionId,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
33
40
|
}
|
|
34
41
|
const showMedia = Boolean((activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) || imageProps);
|
|
35
42
|
const showText = Boolean(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.text);
|
|
@@ -48,7 +55,7 @@ const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered
|
|
|
48
55
|
react_1.default.createElement("div", { ref: ref }, (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (react_1.default.createElement(Media_1.default, Object.assign({}, (0, utils_2.getThemedValue)(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: mediaHeight })))),
|
|
49
56
|
imageProps && (react_1.default.createElement(react_1.Fragment, null,
|
|
50
57
|
react_1.default.createElement(FullscreenImage_1.default, Object.assign({}, imageProps, { imageClassName: b('image') })))),
|
|
51
|
-
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && react_1.default.createElement("p", { className: b('caption') }, activeTabData.caption)));
|
|
58
|
+
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && (react_1.default.createElement("p", { className: b('caption'), id: captionId }, activeTabData.caption))));
|
|
52
59
|
const onSelectTab = (id, e) => {
|
|
53
60
|
setActiveTab(id);
|
|
54
61
|
e.currentTarget.scrollIntoView({ inline: 'center', behavior: 'smooth', block: 'nearest' });
|
|
@@ -16,4 +16,3 @@ export { default as CardLayoutBlock } from './CardLayout/CardLayout';
|
|
|
16
16
|
export { default as ContentLayoutBlock } from './ContentLayout/ContentLayout';
|
|
17
17
|
export { default as ShareBlock } from './Share/Share';
|
|
18
18
|
export { default as FilterBlock } from './FilterBlock/FilterBlock';
|
|
19
|
-
export { default as FormBlock } from './Form/Form';
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.FilterBlock = exports.ShareBlock = exports.ContentLayoutBlock = exports.CardLayoutBlock = exports.HeaderSliderBlock = exports.IconsBlock = exports.HeaderBlock = exports.TabsBlock = exports.TableBlock = exports.QuestionsBlock = exports.PromoFeaturesBlock = exports.ExtendedFeaturesBlock = exports.SliderBlock = exports.MapBlock = exports.MediaBlock = exports.InfoBlock = exports.CompaniesBlock = exports.BannerBlock = void 0;
|
|
7
7
|
var Banner_1 = require("./Banner/Banner");
|
|
8
8
|
Object.defineProperty(exports, "BannerBlock", { enumerable: true, get: function () { return __importDefault(Banner_1).default; } });
|
|
9
9
|
var Companies_1 = require("./Companies/Companies");
|
|
@@ -40,5 +40,3 @@ var Share_1 = require("./Share/Share");
|
|
|
40
40
|
Object.defineProperty(exports, "ShareBlock", { enumerable: true, get: function () { return __importDefault(Share_1).default; } });
|
|
41
41
|
var FilterBlock_1 = require("./FilterBlock/FilterBlock");
|
|
42
42
|
Object.defineProperty(exports, "FilterBlock", { enumerable: true, get: function () { return __importDefault(FilterBlock_1).default; } });
|
|
43
|
-
var Form_1 = require("./Form/Form");
|
|
44
|
-
Object.defineProperty(exports, "FormBlock", { enumerable: true, get: function () { return __importDefault(Form_1).default; } });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { HTMLProps, ReactNode } from 'react';
|
|
2
2
|
import { ButtonSize } from '@gravity-ui/uikit';
|
|
3
3
|
import { Tabbable } from '../../models';
|
|
4
4
|
export type Theme = 'default' | 'special';
|
|
5
|
-
export interface BackLinkProps extends Tabbable {
|
|
5
|
+
export interface BackLinkProps<T = HTMLElement> extends Tabbable {
|
|
6
6
|
url: string;
|
|
7
7
|
title: ReactNode;
|
|
8
8
|
theme?: Theme;
|
|
@@ -10,5 +10,6 @@ export interface BackLinkProps extends Tabbable {
|
|
|
10
10
|
className?: string;
|
|
11
11
|
shouldHandleBackAction?: boolean;
|
|
12
12
|
onClick?: () => void;
|
|
13
|
+
extraProps?: HTMLProps<T>;
|
|
13
14
|
}
|
|
14
15
|
export default function BackLink(props: BackLinkProps): JSX.Element;
|
|
@@ -9,7 +9,7 @@ const icons_1 = require("../../icons");
|
|
|
9
9
|
const models_1 = require("../../models");
|
|
10
10
|
function BackLink(props) {
|
|
11
11
|
const { history } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
12
|
-
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick, tabIndex, } = props;
|
|
12
|
+
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick, tabIndex, extraProps, } = props;
|
|
13
13
|
const handleAnalytics = (0, hooks_1.useAnalytics)(models_1.DefaultEventNames.ShareButton, url);
|
|
14
14
|
const backActionHandler = (0, react_1.useCallback)(async () => {
|
|
15
15
|
handleAnalytics();
|
|
@@ -26,7 +26,7 @@ function BackLink(props) {
|
|
|
26
26
|
history.push({ pathname: url });
|
|
27
27
|
}
|
|
28
28
|
}, [handleAnalytics, history, onClick, url]);
|
|
29
|
-
return (react_1.default.createElement(uikit_1.Button, { className: className, view: theme === 'special' ? 'flat-contrast' : 'flat-secondary', size: size, href: shouldHandleBackAction ? undefined : url, onClick: shouldHandleBackAction ? backActionHandler : undefined, tabIndex: tabIndex },
|
|
29
|
+
return (react_1.default.createElement(uikit_1.Button, { className: className, view: theme === 'special' ? 'flat-contrast' : 'flat-secondary', size: size, href: shouldHandleBackAction ? undefined : url, onClick: shouldHandleBackAction ? backActionHandler : undefined, tabIndex: tabIndex, extraProps: extraProps },
|
|
30
30
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.ArrowSidebar, size: 24 }),
|
|
31
31
|
react_1.default.createElement("span", null, title)));
|
|
32
32
|
}
|
|
@@ -3,7 +3,6 @@ import { ButtonProps as ButtonParams, QAProps } from '../../models';
|
|
|
3
3
|
export interface ButtonProps extends Omit<ButtonParams, 'url'>, QAProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
url?: string;
|
|
6
|
-
urlTitle?: string;
|
|
7
6
|
onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
|
|
8
7
|
}
|
|
9
8
|
declare const Button: (props: ButtonProps) => JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MediaVideoProps } from '../../models';
|
|
3
|
+
type DefaultVideoRefType = HTMLVideoElement | undefined;
|
|
4
|
+
interface DefaultVideoProps {
|
|
5
|
+
video: MediaVideoProps;
|
|
6
|
+
qa?: string;
|
|
7
|
+
customBarControlsClassName?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const DefaultVideo: React.ForwardRefExoticComponent<DefaultVideoProps & React.RefAttributes<DefaultVideoRefType>>;
|
|
11
|
+
export {};
|
|
@@ -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,5 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PixelEvent } from '../../models';
|
|
2
|
+
import { AnalyticsEventsBase } from '../../models/common';
|
|
2
3
|
export declare const YANDEX_FORM_ORIGIN = "https://forms.yandex.ru";
|
|
3
|
-
export
|
|
4
|
+
export interface YandexFormProps extends AnalyticsEventsBase {
|
|
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
|
+
}
|
|
4
19
|
declare const YandexForm: (props: YandexFormProps) => JSX.Element;
|
|
5
20
|
export default YandexForm;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
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,15 +11,13 @@ 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';
|
|
15
14
|
const CONTAINER_ID = 'pc-yandex-form-container';
|
|
16
15
|
const b = (0, utils_1.block)('yandex-form');
|
|
17
16
|
const YandexForm = (props) => {
|
|
18
|
-
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = constants_1.HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin,
|
|
17
|
+
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = constants_1.HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, } = props;
|
|
19
18
|
const formContainerRef = (0, react_1.useRef)(null);
|
|
20
19
|
const iframeRef = (0, react_1.useRef)();
|
|
21
20
|
const yaFormOrigin = customFormOrigin || exports.YANDEX_FORM_ORIGIN;
|
|
22
|
-
const yaFormSection = customFormSection || exports.YANDEX_FORM_SECTION;
|
|
23
21
|
const handleMetrika = (0, useMetrika_1.useMetrika)();
|
|
24
22
|
const handleAnalytics = (0, hooks_1.useAnalytics)(common_1.DefaultEventNames.YandexFormSubmit);
|
|
25
23
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
@@ -41,7 +39,7 @@ const YandexForm = (props) => {
|
|
|
41
39
|
queryParams.set(param, params[param]);
|
|
42
40
|
});
|
|
43
41
|
}
|
|
44
|
-
const src = `${yaFormOrigin}/${
|
|
42
|
+
const src = `${yaFormOrigin}/surveys/${id}/?${queryParams}`;
|
|
45
43
|
if (iframeRef.current) {
|
|
46
44
|
iframeRef.current.src = src;
|
|
47
45
|
}
|
|
@@ -56,7 +54,7 @@ const YandexForm = (props) => {
|
|
|
56
54
|
iframeRef.current.width = '100%';
|
|
57
55
|
container.appendChild(iframeRef.current);
|
|
58
56
|
}
|
|
59
|
-
}, [locale.lang, theme, isMobile, yaFormOrigin,
|
|
57
|
+
}, [locale.lang, theme, isMobile, yaFormOrigin, id, containerId, params]);
|
|
60
58
|
const handleSubmit = (0, react_1.useCallback)(() => {
|
|
61
59
|
if (formContainerRef && formContainerRef.current) {
|
|
62
60
|
const { top } = formContainerRef.current.getBoundingClientRect();
|
|
@@ -17,7 +17,6 @@ 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>;
|
|
21
20
|
};
|
|
22
21
|
export declare const subBlockMap: {
|
|
23
22
|
divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
|
|
@@ -26,7 +26,6 @@ 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,
|
|
30
29
|
};
|
|
31
30
|
exports.subBlockMap = {
|
|
32
31
|
[models_1.SubBlockType.Divider]: sub_blocks_1.Divider,
|
|
@@ -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
|
|
7
|
-
import { BannerCardProps,
|
|
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';
|
|
8
8
|
export declare enum BlockType {
|
|
9
9
|
PromoFeaturesBlock = "promo-features-block",
|
|
10
10
|
ExtendedFeaturesBlock = "extended-features-block",
|
|
@@ -23,8 +23,7 @@ export declare enum BlockType {
|
|
|
23
23
|
ContentLayoutBlock = "content-layout-block",
|
|
24
24
|
ShareBlock = "share-block",
|
|
25
25
|
MapBlock = "map-block",
|
|
26
|
-
FilterBlock = "filter-block"
|
|
27
|
-
FormBlock = "form-block"
|
|
26
|
+
FilterBlock = "filter-block"
|
|
28
27
|
}
|
|
29
28
|
export declare const BlockTypes: BlockType[];
|
|
30
29
|
export declare const HeaderBlockTypes: BlockType[];
|
|
@@ -275,7 +274,9 @@ export interface ContentItemProps {
|
|
|
275
274
|
}
|
|
276
275
|
export interface ContentBlockProps {
|
|
277
276
|
title?: TitleItemBaseProps | string;
|
|
277
|
+
titleId?: string;
|
|
278
278
|
text?: string;
|
|
279
|
+
textId?: string;
|
|
279
280
|
additionalInfo?: string;
|
|
280
281
|
links?: LinkProps[];
|
|
281
282
|
buttons?: ButtonProps[];
|
|
@@ -296,29 +297,6 @@ export interface ShareBlockProps {
|
|
|
296
297
|
items: PCShareSocialNetwork[];
|
|
297
298
|
title?: string;
|
|
298
299
|
}
|
|
299
|
-
export declare enum FormBlockDataTypes {
|
|
300
|
-
YANDEX = "yandex",
|
|
301
|
-
HUBSPOT_INLINE = "hubspot-inline"
|
|
302
|
-
}
|
|
303
|
-
export declare enum FormBlockDirection {
|
|
304
|
-
FormContent = "form-content",
|
|
305
|
-
ContentForm = "content-form",
|
|
306
|
-
Center = "center"
|
|
307
|
-
}
|
|
308
|
-
export interface FormBlockYandexData {
|
|
309
|
-
yandex: YandexFormProps;
|
|
310
|
-
}
|
|
311
|
-
export interface FormBlockHubspotData {
|
|
312
|
-
hubspot: HubspotFormProps;
|
|
313
|
-
}
|
|
314
|
-
export type FormBlockData = FormBlockYandexData | FormBlockHubspotData;
|
|
315
|
-
export interface FormBlockProps {
|
|
316
|
-
formData: FormBlockData;
|
|
317
|
-
title?: string;
|
|
318
|
-
textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;
|
|
319
|
-
direction?: FormBlockDirection;
|
|
320
|
-
background?: BackgroundImageProps;
|
|
321
|
-
}
|
|
322
300
|
export type HeaderBlockModel = {
|
|
323
301
|
type: BlockType.HeaderBlock;
|
|
324
302
|
} & HeaderBlockProps;
|
|
@@ -373,9 +351,6 @@ export type ContentLayoutBlockModel = {
|
|
|
373
351
|
export type ShareBLockModel = {
|
|
374
352
|
type: BlockType.ShareBlock;
|
|
375
353
|
} & ShareBlockProps;
|
|
376
|
-
|
|
377
|
-
type: BlockType.FormBlock;
|
|
378
|
-
} & FormBlockProps;
|
|
379
|
-
type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel | FormBlockModel;
|
|
354
|
+
type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
|
|
380
355
|
export type Block = BlockModels & BlockBaseProps;
|
|
381
356
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
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,7 +21,6 @@ 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";
|
|
25
24
|
})(BlockType = exports.BlockType || (exports.BlockType = {}));
|
|
26
25
|
exports.BlockTypes = Object.values(BlockType);
|
|
27
26
|
exports.HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];
|
|
@@ -45,14 +44,3 @@ var PCShareSocialNetwork;
|
|
|
45
44
|
PCShareSocialNetwork["Facebook"] = "facebook";
|
|
46
45
|
PCShareSocialNetwork["LinkedIn"] = "linkedin";
|
|
47
46
|
})(PCShareSocialNetwork = exports.PCShareSocialNetwork || (exports.PCShareSocialNetwork = {}));
|
|
48
|
-
var FormBlockDataTypes;
|
|
49
|
-
(function (FormBlockDataTypes) {
|
|
50
|
-
FormBlockDataTypes["YANDEX"] = "yandex";
|
|
51
|
-
FormBlockDataTypes["HUBSPOT_INLINE"] = "hubspot-inline";
|
|
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 = {}));
|