@gravity-ui/page-constructor 1.15.0-alpha.19 → 1.15.0-alpha.20
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/README.md +4 -4
- package/build/cjs/blocks/Banner/Banner.js +3 -8
- package/build/cjs/blocks/Banner/schema.d.ts +9 -9
- package/build/cjs/blocks/Banner/schema.js +1 -1
- package/build/cjs/blocks/CardLayout/schema.d.ts +2 -2
- package/build/cjs/blocks/ContentLayout/ContentLayout.js +2 -3
- package/build/cjs/blocks/ContentLayout/schema.d.ts +1 -1
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.d.ts +1 -1
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -3
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +1 -1
- package/build/cjs/blocks/Header/Header.js +5 -6
- package/build/cjs/blocks/Header/schema.d.ts +5 -5
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -3
- package/build/cjs/blocks/Icons/schema.d.ts +2 -2
- package/build/cjs/blocks/Info/Info.js +3 -4
- package/build/cjs/blocks/Info/schema.d.ts +1 -1
- package/build/cjs/blocks/Info/schema.js +1 -1
- package/build/cjs/blocks/LinkTable/schema.d.ts +1 -1
- package/build/cjs/blocks/Media/Media.js +2 -3
- package/build/cjs/blocks/Media/MediaContent.js +2 -3
- package/build/cjs/blocks/Media/schema.d.ts +3 -3
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +2 -2
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.js +2 -3
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.d.ts +0 -1
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.js +2 -3
- package/build/cjs/blocks/Preview/Preview.js +2 -3
- package/build/cjs/blocks/Preview/schema.d.ts +1 -1
- package/build/cjs/blocks/Preview/schema.js +1 -1
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +2 -3
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +1 -1
- package/build/cjs/blocks/Questions/Questions.js +2 -3
- package/build/cjs/blocks/Questions/schema.d.ts +1 -1
- package/build/cjs/blocks/Security/Security.js +2 -3
- package/build/cjs/blocks/Security/schema.d.ts +1 -1
- package/build/cjs/blocks/Security/schema.js +1 -1
- package/build/cjs/blocks/Share/Share.d.ts +1 -1
- package/build/cjs/blocks/Share/Share.js +5 -3
- package/build/cjs/blocks/Simple/schema.d.ts +1 -1
- package/build/cjs/blocks/Slider/schema.d.ts +1 -1
- package/build/cjs/blocks/Table/schema.d.ts +1 -1
- package/build/cjs/blocks/Tabs/Tabs.d.ts +1 -1
- package/build/cjs/blocks/Tabs/Tabs.js +4 -5
- package/build/cjs/blocks/Tabs/schema.d.ts +1 -1
- package/build/cjs/components/BackLink/BackLink.d.ts +1 -1
- package/build/cjs/components/BackLink/BackLink.js +2 -2
- package/build/cjs/components/BackgroundMedia/BackgroundMedia.js +1 -2
- package/build/cjs/components/Button/Button.d.ts +1 -1
- package/build/cjs/components/Button/Button.js +4 -3
- package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +1 -1
- package/build/cjs/components/ButtonTabs/ButtonTabs.js +2 -3
- package/build/cjs/components/CardBase/CardBase.d.ts +1 -1
- package/build/cjs/components/CardBase/CardBase.js +5 -4
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +2 -3
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.d.ts +2 -2
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.js +5 -4
- package/build/cjs/components/Link/Link.js +6 -5
- package/build/cjs/components/Media/Media.js +2 -4
- package/build/cjs/components/Media/Video/Video.js +2 -4
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +5 -4
- package/build/cjs/components/YandexForm/YandexForm.d.ts +1 -1
- package/build/cjs/components/YandexForm/YandexForm.js +5 -4
- package/build/cjs/constructor-items.d.ts +5 -5
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +1 -1
- package/build/cjs/models/common.d.ts +1 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +10 -11
- package/build/cjs/models/constructor-items/common.d.ts +5 -5
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +4 -4
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +2 -2
- package/build/cjs/schema/validators/common.d.ts +5 -5
- package/build/cjs/schema/validators/common.js +1 -1
- package/build/cjs/schema/validators/event.d.ts +1 -1
- package/build/cjs/schema/validators/event.js +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +2 -3
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +1 -1
- package/build/cjs/sub-blocks/BannerCard/BannerCard.js +2 -3
- package/build/cjs/sub-blocks/BasicCard/BasicCard.js +2 -3
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.d.ts +1 -1
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.js +2 -3
- package/build/cjs/sub-blocks/Content/Content.js +3 -4
- package/build/cjs/sub-blocks/HubspotForm/index.js +5 -3
- package/build/cjs/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
- package/build/cjs/sub-blocks/MediaCard/MediaCard.js +2 -3
- package/build/cjs/sub-blocks/Quote/Quote.js +5 -3
- package/build/cjs/sub-blocks/Quote/schema.d.ts +1 -1
- package/build/cjs/sub-blocks/Quote/schema.js +1 -1
- package/build/esm/blocks/Banner/Banner.js +3 -8
- package/build/esm/blocks/Banner/schema.d.ts +9 -9
- package/build/esm/blocks/Banner/schema.js +1 -1
- package/build/esm/blocks/CardLayout/schema.d.ts +2 -2
- package/build/esm/blocks/ContentLayout/ContentLayout.js +2 -3
- package/build/esm/blocks/ContentLayout/schema.d.ts +1 -1
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.d.ts +1 -1
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -3
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +1 -1
- package/build/esm/blocks/Header/Header.js +5 -6
- package/build/esm/blocks/Header/schema.d.ts +5 -5
- package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -3
- package/build/esm/blocks/Icons/schema.d.ts +2 -2
- package/build/esm/blocks/Info/Info.js +3 -4
- package/build/esm/blocks/Info/schema.d.ts +1 -1
- package/build/esm/blocks/Info/schema.js +1 -1
- package/build/esm/blocks/LinkTable/schema.d.ts +1 -1
- package/build/esm/blocks/Media/Media.js +2 -3
- package/build/esm/blocks/Media/MediaContent.js +2 -3
- package/build/esm/blocks/Media/schema.d.ts +3 -3
- package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +2 -2
- package/build/esm/blocks/Preview/MediaContent/MediaContent.js +2 -3
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.d.ts +0 -1
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.js +2 -3
- package/build/esm/blocks/Preview/Preview.js +2 -3
- package/build/esm/blocks/Preview/schema.d.ts +1 -1
- package/build/esm/blocks/Preview/schema.js +1 -1
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +2 -3
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +1 -1
- package/build/esm/blocks/Questions/Questions.js +2 -3
- package/build/esm/blocks/Questions/schema.d.ts +1 -1
- package/build/esm/blocks/Security/Security.js +2 -3
- package/build/esm/blocks/Security/schema.d.ts +1 -1
- package/build/esm/blocks/Security/schema.js +1 -1
- package/build/esm/blocks/Share/Share.d.ts +1 -1
- package/build/esm/blocks/Share/Share.js +6 -4
- package/build/esm/blocks/Simple/schema.d.ts +1 -1
- package/build/esm/blocks/Slider/schema.d.ts +1 -1
- package/build/esm/blocks/Table/schema.d.ts +1 -1
- package/build/esm/blocks/Tabs/Tabs.d.ts +1 -1
- package/build/esm/blocks/Tabs/Tabs.js +4 -5
- package/build/esm/blocks/Tabs/schema.d.ts +1 -1
- package/build/esm/components/BackLink/BackLink.d.ts +1 -1
- package/build/esm/components/BackLink/BackLink.js +2 -2
- package/build/esm/components/BackgroundMedia/BackgroundMedia.js +1 -2
- package/build/esm/components/Button/Button.d.ts +1 -1
- package/build/esm/components/Button/Button.js +4 -3
- package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +1 -1
- package/build/esm/components/ButtonTabs/ButtonTabs.js +2 -3
- package/build/esm/components/CardBase/CardBase.d.ts +1 -1
- package/build/esm/components/CardBase/CardBase.js +6 -5
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +2 -3
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.d.ts +2 -2
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.js +6 -5
- package/build/esm/components/Link/Link.js +6 -5
- package/build/esm/components/Media/Media.js +2 -4
- package/build/esm/components/Media/Video/Video.js +2 -4
- package/build/esm/components/ReactPlayer/ReactPlayer.js +5 -4
- package/build/esm/components/YandexForm/YandexForm.d.ts +1 -1
- package/build/esm/components/YandexForm/YandexForm.js +5 -4
- package/build/esm/constructor-items.d.ts +5 -5
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +1 -1
- package/build/esm/models/common.d.ts +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +10 -11
- package/build/esm/models/constructor-items/common.d.ts +5 -5
- package/build/esm/models/constructor-items/sub-blocks.d.ts +4 -4
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +2 -2
- package/build/esm/schema/validators/common.d.ts +5 -5
- package/build/esm/schema/validators/common.js +1 -1
- package/build/esm/schema/validators/event.d.ts +1 -1
- package/build/esm/schema/validators/event.js +1 -1
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +2 -3
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +1 -1
- package/build/esm/sub-blocks/BackgroundCard/schema.js +1 -1
- package/build/esm/sub-blocks/BannerCard/BannerCard.js +2 -3
- package/build/esm/sub-blocks/BasicCard/BasicCard.js +2 -3
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.d.ts +1 -1
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.js +2 -3
- package/build/esm/sub-blocks/Content/Content.js +3 -4
- package/build/esm/sub-blocks/HubspotForm/index.js +6 -4
- package/build/esm/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
- package/build/esm/sub-blocks/MediaCard/MediaCard.js +2 -3
- package/build/esm/sub-blocks/Quote/Quote.js +6 -4
- package/build/esm/sub-blocks/Quote/schema.d.ts +1 -1
- package/build/esm/sub-blocks/Quote/schema.js +1 -1
- package/package.json +1 -1
- package/server/models/common.d.ts +1 -1
- package/server/models/constructor-items/blocks.d.ts +10 -11
- package/server/models/constructor-items/common.d.ts +5 -5
- package/server/models/constructor-items/sub-blocks.d.ts +4 -4
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { block } from '../../utils';
|
|
3
|
-
import { BlockType } from '../../models';
|
|
4
3
|
import { FullWidthBackground, HTML, Media, Link, AnimateBlock } from '../../components';
|
|
5
4
|
import { Grid, Row, Col } from '../../grid';
|
|
6
5
|
import './Security.css';
|
|
7
6
|
const b = block('SecurityBlock');
|
|
8
7
|
export const SecurityBlock = (props) => {
|
|
9
|
-
const { backgroundColor, theme = 'dark', title, points, media, animated
|
|
8
|
+
const { backgroundColor, theme = 'dark', title, points, media, animated } = props;
|
|
10
9
|
return (React.createElement(AnimateBlock, { className: b({ theme }), offset: 200, animate: animated },
|
|
11
10
|
React.createElement("div", { className: b('content') },
|
|
12
11
|
React.createElement(FullWidthBackground, { className: b('background'), style: { backgroundColor } }),
|
|
@@ -20,6 +19,6 @@ export const SecurityBlock = (props) => {
|
|
|
20
19
|
link && (React.createElement(Link, { className: b('point-link'), text: link.text, url: link.url, theme: 'normal', arrow: true }))))))),
|
|
21
20
|
media && (React.createElement(Row, { className: b('media') },
|
|
22
21
|
React.createElement(Col, null,
|
|
23
|
-
React.createElement(Media, Object.assign({ className: b('media') }, media
|
|
22
|
+
React.createElement(Media, Object.assign({ className: b('media') }, media)))))))));
|
|
24
23
|
};
|
|
25
24
|
export default SecurityBlock;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { useContext, useCallback, useMemo } from 'react';
|
|
2
2
|
import { Icon, Button } from '@gravity-ui/uikit';
|
|
3
3
|
import { block, getAbsolutePath, getShareLink } from '../../utils';
|
|
4
|
-
import {
|
|
4
|
+
import { PredefinedEventTypes } from '../../models';
|
|
5
5
|
import { LocationContext } from '../../context/locationContext';
|
|
6
|
+
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
6
7
|
import i18n from './i18n';
|
|
7
8
|
import { useAnalytics } from '../../hooks';
|
|
8
9
|
import { Facebook } from '../../icons/Facebook';
|
|
@@ -19,13 +20,14 @@ const icons = {
|
|
|
19
20
|
telegram: Telegram,
|
|
20
21
|
};
|
|
21
22
|
const b = block('share-block');
|
|
22
|
-
const Share = ({ items, title
|
|
23
|
+
const Share = ({ items, title }) => {
|
|
23
24
|
const { pathname, hostname } = useContext(LocationContext);
|
|
25
|
+
const context = useContext(BlockPositionContext);
|
|
24
26
|
const defaultEvent = useMemo(() => ({
|
|
25
27
|
name: 'share-button-click',
|
|
26
28
|
type: PredefinedEventTypes.Default,
|
|
27
|
-
|
|
28
|
-
}), [
|
|
29
|
+
context,
|
|
30
|
+
}), [context]);
|
|
29
31
|
const handleAnalytics = useAnalytics(defaultEvent);
|
|
30
32
|
const handleButtonClick = useCallback(() => handleAnalytics(), [handleAnalytics]);
|
|
31
33
|
return (React.createElement("div", { className: b() },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TabsBlockProps } from '../../models';
|
|
2
2
|
import './Tabs.css';
|
|
3
|
-
export declare const TabsBlock: ({ items, title, description, animated, tabsColSizes, centered, direction,
|
|
3
|
+
export declare const TabsBlock: ({ items, title, description, animated, tabsColSizes, centered, direction, }: TabsBlockProps) => JSX.Element;
|
|
4
4
|
export default TabsBlock;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { Fragment, useContext, useRef, useState } from 'react';
|
|
2
2
|
import { block, getThemedValue } from '../../utils';
|
|
3
3
|
import { Row, Col, GridColumnOrderClasses } from '../../grid';
|
|
4
|
-
import { BlockType } from '../../models';
|
|
5
4
|
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
6
5
|
import BlockHeader from '../../components/BlockHeader/BlockHeader';
|
|
7
6
|
import FullScreenImage from '../../components/FullscreenImage/FullscreenImage';
|
|
@@ -13,7 +12,7 @@ import { Content } from '../../sub-blocks';
|
|
|
13
12
|
import { getHeight } from '../../components/VideoBlock/VideoBlock';
|
|
14
13
|
import './Tabs.css';
|
|
15
14
|
const b = block('tabs-block');
|
|
16
|
-
export const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content',
|
|
15
|
+
export const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', }) => {
|
|
17
16
|
var _a;
|
|
18
17
|
const [activeTab, setActiveTab] = useState(items[0].tabName);
|
|
19
18
|
const [play, setPlay] = useState(false);
|
|
@@ -38,12 +37,12 @@ export const TabsBlock = ({ items, title, description, animated, tabsColSizes, c
|
|
|
38
37
|
React.createElement(Content, { title: activeTabData.title, text: activeTabData.text, additionalInfo: activeTabData.additionalInfo, size: "s", links: [
|
|
39
38
|
...(activeTabData.link ? [activeTabData.link] : []),
|
|
40
39
|
...(activeTabData.links || []),
|
|
41
|
-
], buttons: activeTabData.buttons, colSizes: { all: 12 }
|
|
40
|
+
], buttons: activeTabData.buttons, colSizes: { all: 12 } }))));
|
|
42
41
|
const mediaContent = showMedia && (React.createElement(Col, { sizes: { all: 12, md: 8 }, orders: {
|
|
43
42
|
all: GridColumnOrderClasses.Last,
|
|
44
43
|
md: GridColumnOrderClasses.First,
|
|
45
44
|
}, className: b('col', { centered: centered }) },
|
|
46
|
-
React.createElement("div", { ref: ref }, (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (React.createElement(Media, Object.assign({}, getThemedValue(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: mediaHeight
|
|
45
|
+
React.createElement("div", { ref: ref }, (activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.media) && (React.createElement(Media, Object.assign({}, getThemedValue(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: mediaHeight })))),
|
|
47
46
|
imageProps && (React.createElement(Fragment, null,
|
|
48
47
|
React.createElement(FullScreenImage, Object.assign({}, imageProps, { imageClassName: b('image') })))),
|
|
49
48
|
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && React.createElement("p", { className: b('caption') }, activeTabData.caption)));
|
|
@@ -51,7 +50,7 @@ export const TabsBlock = ({ items, title, description, animated, tabsColSizes, c
|
|
|
51
50
|
React.createElement(BlockHeader, { title: title, description: description, className: b('block-title', { centered: centered }) }),
|
|
52
51
|
React.createElement(Row, null,
|
|
53
52
|
React.createElement(Col, { sizes: tabsColSizes },
|
|
54
|
-
React.createElement(ButtonTabs, { items: tabs, onSelectTab: setActiveTab, activeTab: activeTab, className: b('tabs', { centered: centered })
|
|
53
|
+
React.createElement(ButtonTabs, { items: tabs, onSelectTab: setActiveTab, activeTab: activeTab, className: b('tabs', { centered: centered }) }))),
|
|
55
54
|
activeTabData && (React.createElement(Row, { className: b('row', { reverse: isReverse }) },
|
|
56
55
|
mediaContent,
|
|
57
56
|
textContent))));
|
|
@@ -7,11 +7,11 @@ import { PredefinedEventTypes } from '../../models';
|
|
|
7
7
|
const COMPONENT_NAME = 'backlink';
|
|
8
8
|
export default function BackLink(props) {
|
|
9
9
|
const { history } = useContext(LocationContext);
|
|
10
|
-
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick,
|
|
10
|
+
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick, context = COMPONENT_NAME, } = props;
|
|
11
11
|
const handleAnalytics = useAnalytics({
|
|
12
12
|
name: 'back-link-click',
|
|
13
13
|
type: PredefinedEventTypes.Default,
|
|
14
|
-
|
|
14
|
+
context: context,
|
|
15
15
|
target: url,
|
|
16
16
|
});
|
|
17
17
|
const backActionHandler = useCallback(async () => {
|
|
@@ -6,12 +6,11 @@ import AnimateBlock from '../AnimateBlock/AnimateBlock';
|
|
|
6
6
|
import { MobileContext } from '../../context/mobileContext';
|
|
7
7
|
import './BackgroundMedia.css';
|
|
8
8
|
const b = block('BackgroundMedia');
|
|
9
|
-
const COMPONENT_NAME = 'backgound-media-component';
|
|
10
9
|
const BackgroundMedia = (_a) => {
|
|
11
10
|
var { className, color, animated, parallax = true, video, mediaClassName } = _a, props = __rest(_a, ["className", "color", "animated", "parallax", "video", "mediaClassName"]);
|
|
12
11
|
const isMobile = useContext(MobileContext);
|
|
13
12
|
return (React.createElement(AnimateBlock, { className: b(null, className), style: { backgroundColor: color }, animate: animated },
|
|
14
13
|
React.createElement(Media, Object.assign({ className: b('media', mediaClassName), imageClassName: b('image'), videoClassName: b('video'), isBackground: true }, Object.assign({ height: 720, color,
|
|
15
|
-
parallax, video: isMobile ? undefined : video }, props)
|
|
14
|
+
parallax, video: isMobile ? undefined : video }, props)))));
|
|
16
15
|
};
|
|
17
16
|
export default BackgroundMedia;
|
|
@@ -15,14 +15,15 @@ const b = block('button-block');
|
|
|
15
15
|
const Button = (props) => {
|
|
16
16
|
const handleMetrika = useMetrika();
|
|
17
17
|
const { lang, tld } = useContext(LocaleContext);
|
|
18
|
-
const { className, metrikaGoals, pixelEvents, analyticsEvents, size = 'l', theme = 'normal', url, img, onClick: onClickOrigin, text
|
|
18
|
+
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"]);
|
|
19
|
+
const context = useContext(BlockPositionContext);
|
|
19
20
|
const defaultImgPosition = 'left';
|
|
20
21
|
const defaultEvent = useMemo(() => ({
|
|
21
22
|
name: 'button-click',
|
|
22
23
|
type: PredefinedEventTypes.Default,
|
|
23
|
-
|
|
24
|
+
context: context || COMPONENT_NAME,
|
|
24
25
|
target: url,
|
|
25
|
-
}), [
|
|
26
|
+
}), [context, url]);
|
|
26
27
|
const handleAnalytics = useAnalytics(defaultEvent);
|
|
27
28
|
const blockPosition = useContext(BlockPositionContext);
|
|
28
29
|
// eslint-disable-next-line no-console
|
|
@@ -9,7 +9,7 @@ export interface ButtonTabsProps {
|
|
|
9
9
|
items: ButtonTabsItemProps[];
|
|
10
10
|
activeTab?: string;
|
|
11
11
|
onSelectTab?: (tabId: string) => void;
|
|
12
|
-
|
|
12
|
+
context?: string;
|
|
13
13
|
}
|
|
14
14
|
declare const ButtonTabs: (props: ButtonTabsProps) => JSX.Element;
|
|
15
15
|
export default ButtonTabs;
|
|
@@ -3,9 +3,8 @@ import { block } from '../../utils';
|
|
|
3
3
|
import { Button } from '../index';
|
|
4
4
|
import './ButtonTabs.css';
|
|
5
5
|
const b = block('button-tabs');
|
|
6
|
-
const COMPONENT_NAME = 'button-tabs';
|
|
7
6
|
const ButtonTabs = (props) => {
|
|
8
|
-
const { className, items, activeTab, onSelectTab
|
|
7
|
+
const { className, items, activeTab, onSelectTab } = props;
|
|
9
8
|
const activeTabId = useMemo(() => {
|
|
10
9
|
if (activeTab) {
|
|
11
10
|
return activeTab;
|
|
@@ -19,7 +18,7 @@ const ButtonTabs = (props) => {
|
|
|
19
18
|
}, [onSelectTab]);
|
|
20
19
|
return (React.createElement("div", { className: b(null, className) }, items.map((item) => {
|
|
21
20
|
const isActive = item.id === activeTabId;
|
|
22
|
-
return (React.createElement(Button, { text: item.title, className: b('item', { active: isActive }), key: item.title, size: 'l', onClick: () => handleClick(item.id), theme: isActive ? 'monochrome' : 'normal'
|
|
21
|
+
return (React.createElement(Button, { text: item.title, className: b('item', { active: isActive }), key: item.title, size: 'l', onClick: () => handleClick(item.id), theme: isActive ? 'monochrome' : 'normal' }));
|
|
23
22
|
})));
|
|
24
23
|
};
|
|
25
24
|
export default ButtonTabs;
|
|
@@ -12,7 +12,7 @@ export interface CardBaseProps extends CardBaseParams {
|
|
|
12
12
|
metrikaGoals?: MetrikaGoal;
|
|
13
13
|
pixelEvents?: ButtonPixel;
|
|
14
14
|
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
15
|
-
|
|
15
|
+
context?: string;
|
|
16
16
|
}
|
|
17
17
|
export interface CardHeaderBaseProps {
|
|
18
18
|
className?: string;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import React, { Children, Fragment, useMemo } from 'react';
|
|
1
|
+
import React, { Children, Fragment, useMemo, useContext, } from 'react';
|
|
2
2
|
import { block } from '../../utils';
|
|
3
|
+
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
3
4
|
import BackgroundImage from '../BackgroundImage/BackgroundImage';
|
|
4
5
|
import RouterLink from '../RouterLink/RouterLink';
|
|
5
6
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
6
7
|
import { PredefinedEventTypes } from '../../models/common';
|
|
7
8
|
import { useAnalytics } from '../../hooks';
|
|
8
9
|
import './CardBase.css';
|
|
9
|
-
const COMPONENT_NAME = 'card-base';
|
|
10
10
|
const b = block('card-base-block');
|
|
11
11
|
const Header = () => null;
|
|
12
12
|
const Content = () => null;
|
|
13
13
|
const Footer = () => null;
|
|
14
14
|
export const Layout = (props) => {
|
|
15
|
-
const { className, bodyClassName, metrikaGoals, pixelEvents, analyticsEvents, contentClassName, children, url, target, border = 'shadow',
|
|
15
|
+
const { className, bodyClassName, metrikaGoals, pixelEvents, analyticsEvents, contentClassName, children, url, target, border = 'shadow', } = props;
|
|
16
16
|
const handleMetrika = useMetrika();
|
|
17
|
+
const context = useContext(BlockPositionContext);
|
|
17
18
|
const defaultEvent = useMemo(() => ({
|
|
18
19
|
name: 'card-base-click',
|
|
19
20
|
type: PredefinedEventTypes.Default,
|
|
20
|
-
|
|
21
|
+
context,
|
|
21
22
|
target: url,
|
|
22
|
-
}), [
|
|
23
|
+
}), [context, url]);
|
|
23
24
|
const handleAnalytics = useAnalytics(defaultEvent);
|
|
24
25
|
let header, content, footer, image, headerClass, footerClass;
|
|
25
26
|
function handleChild(child) {
|
|
@@ -3,8 +3,7 @@ import { block } from '../../utils';
|
|
|
3
3
|
import HeaderBreadcrumbsItem from './HeaderBreadcrumbsItem';
|
|
4
4
|
import './HeaderBreadcrumbs.css';
|
|
5
5
|
const b = block('header-breadcrumbs');
|
|
6
|
-
const COMPONENT_NAME = 'header-breadcrumbs';
|
|
7
6
|
export default function HeaderBreadcrumbs(props) {
|
|
8
|
-
const { items, metrikaGoals, pixelEvents, theme = 'light',
|
|
9
|
-
return (React.createElement("div", { className: b({ theme }, className) }, items.map((item) => (React.createElement(HeaderBreadcrumbsItem, { key: item.url, url: item.url, text: item.text, metrikaGoals: metrikaGoals, pixelEvents: pixelEvents, analyticsEvents: item.analyticsEvents
|
|
7
|
+
const { items, metrikaGoals, pixelEvents, theme = 'light', className } = props;
|
|
8
|
+
return (React.createElement("div", { className: b({ theme }, className) }, items.map((item) => (React.createElement(HeaderBreadcrumbsItem, { key: item.url, url: item.url, text: item.text, metrikaGoals: metrikaGoals, pixelEvents: pixelEvents, analyticsEvents: item.analyticsEvents })))));
|
|
10
9
|
}
|
|
@@ -7,7 +7,7 @@ type HeaderBreadcrumbsItemProps = {
|
|
|
7
7
|
metrikaGoals?: MetrikaGoal;
|
|
8
8
|
pixelEvents?: ButtonPixel;
|
|
9
9
|
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
10
|
-
|
|
10
|
+
context?: string;
|
|
11
11
|
};
|
|
12
|
-
export default function HeaderBreadcrumbsItem({ url, text, metrikaGoals, pixelEvents, analyticsEvents,
|
|
12
|
+
export default function HeaderBreadcrumbsItem({ url, text, metrikaGoals, pixelEvents, analyticsEvents, }: HeaderBreadcrumbsItemProps): JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { useContext, useMemo } from 'react';
|
|
2
2
|
import { block } from '../../utils';
|
|
3
3
|
import { PredefinedEventTypes } from '../../models';
|
|
4
4
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
5
5
|
import { useAnalytics } from '../../hooks';
|
|
6
|
+
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
6
7
|
import './HeaderBreadcrumbsItem.css';
|
|
7
8
|
const b = block('header-breadcrumbs-item');
|
|
8
|
-
|
|
9
|
-
export default function HeaderBreadcrumbsItem({ url, text, metrikaGoals, pixelEvents, analyticsEvents, blockName = COMPONENT_NAME, }) {
|
|
9
|
+
export default function HeaderBreadcrumbsItem({ url, text, metrikaGoals, pixelEvents, analyticsEvents, }) {
|
|
10
10
|
const handleMetrika = useMetrika();
|
|
11
|
+
const context = useContext(BlockPositionContext);
|
|
11
12
|
const defaultEvent = useMemo(() => ({
|
|
12
13
|
name: 'header-breadcrumbs-click',
|
|
13
14
|
type: PredefinedEventTypes.Default,
|
|
14
|
-
|
|
15
|
+
context: context,
|
|
15
16
|
target: url,
|
|
16
|
-
}), [
|
|
17
|
+
}), [context, url]);
|
|
17
18
|
const handleAnalytics = useAnalytics(defaultEvent);
|
|
18
19
|
const onClick = () => {
|
|
19
20
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
@@ -9,10 +9,10 @@ import { LocaleContext } from '../../context/localeContext/localeContext';
|
|
|
9
9
|
import { LocationContext } from '../../context/locationContext/locationContext';
|
|
10
10
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
11
11
|
import { useAnalytics } from '../../hooks';
|
|
12
|
+
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
12
13
|
import './Link.css';
|
|
13
14
|
const b = block('link-block');
|
|
14
15
|
const WORD_JOINER_SYM = '\u200b';
|
|
15
|
-
const COMPONENT_NAME = 'link';
|
|
16
16
|
function getArrowSize(size) {
|
|
17
17
|
switch (size) {
|
|
18
18
|
case 'l':
|
|
@@ -26,14 +26,15 @@ function getArrowSize(size) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
const LinkBlock = (props) => {
|
|
29
|
-
const { text, url, arrow, metrikaGoals, pixelEvents, analyticsEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children,
|
|
29
|
+
const { text, url, arrow, metrikaGoals, pixelEvents, analyticsEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, } = props;
|
|
30
30
|
const handleMetrika = useMetrika();
|
|
31
|
+
const context = useContext(BlockPositionContext);
|
|
31
32
|
const defaultEvent = useMemo(() => ({
|
|
32
33
|
name: 'link-click',
|
|
33
34
|
type: PredefinedEventTypes.Default,
|
|
34
|
-
|
|
35
|
+
context,
|
|
35
36
|
target: url,
|
|
36
|
-
}), [
|
|
37
|
+
}), [context, url]);
|
|
37
38
|
const handleAnalytics = useAnalytics(defaultEvent);
|
|
38
39
|
const { hostname } = useContext(LocationContext);
|
|
39
40
|
const { tld } = useContext(LocaleContext);
|
|
@@ -46,7 +47,7 @@ const LinkBlock = (props) => {
|
|
|
46
47
|
const getLinkByType = () => {
|
|
47
48
|
switch (theme) {
|
|
48
49
|
case 'back':
|
|
49
|
-
return
|
|
50
|
+
return React.createElement(BackLink, { title: children || text, url: href, onClick: onClick });
|
|
50
51
|
case 'file-link':
|
|
51
52
|
case 'underline':
|
|
52
53
|
return (React.createElement(FileLink, { text: children || text, href: href, type: "horizontal", textSize: textSize, onClick: onClick }));
|
|
@@ -6,10 +6,9 @@ import Video from './Video/Video';
|
|
|
6
6
|
import YoutubeBlock from '../VideoBlock/VideoBlock';
|
|
7
7
|
import './Media.css';
|
|
8
8
|
const b = block('Media');
|
|
9
|
-
const COMPONENT_NAME = 'media-component';
|
|
10
9
|
export const Media = (props) => {
|
|
11
10
|
const { image, video, youtube, dataLens, color, height, previewImg, parallax = false, metrika, analyticsEvents, } = props;
|
|
12
|
-
const { className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName,
|
|
11
|
+
const { className, imageClassName, videoClassName, youtubeClassName, playVideo = true, isBackground, playButton, customBarControlsClassName, } = props;
|
|
13
12
|
const [hasVideoFallback, setHasVideoFallback] = useState(false);
|
|
14
13
|
const content = useMemo(() => {
|
|
15
14
|
let result = [];
|
|
@@ -17,7 +16,7 @@ export const Media = (props) => {
|
|
|
17
16
|
result.push(React.createElement(Image, { key: "image", parallax: parallax, image: image, height: height, imageClassName: imageClassName, isBackground: isBackground, video: video, hasVideoFallback: hasVideoFallback }));
|
|
18
17
|
}
|
|
19
18
|
if (video) {
|
|
20
|
-
result.push(React.createElement(Video, { key: "video", video: video, videoClassName: videoClassName, height: height, metrika: metrika, analyticsEvents: analyticsEvents, playVideo: playVideo, previewImg: previewImg, playButton: playButton, customBarControlsClassName: customBarControlsClassName, hasVideoFallback: hasVideoFallback, setHasVideoFallback: setHasVideoFallback
|
|
19
|
+
result.push(React.createElement(Video, { key: "video", video: video, videoClassName: videoClassName, height: height, metrika: metrika, analyticsEvents: analyticsEvents, playVideo: playVideo, previewImg: previewImg, playButton: playButton, customBarControlsClassName: customBarControlsClassName, hasVideoFallback: hasVideoFallback, setHasVideoFallback: setHasVideoFallback }));
|
|
21
20
|
}
|
|
22
21
|
if (youtube) {
|
|
23
22
|
result = (React.createElement(YoutubeBlock, { className: b('youtube', youtubeClassName), record: youtube, attributes: { color: 'white', rel: '0' }, previewImg: previewImg, height: height }));
|
|
@@ -43,7 +42,6 @@ export const Media = (props) => {
|
|
|
43
42
|
previewImg,
|
|
44
43
|
playButton,
|
|
45
44
|
customBarControlsClassName,
|
|
46
|
-
blockName,
|
|
47
45
|
youtubeClassName,
|
|
48
46
|
]);
|
|
49
47
|
return (React.createElement("div", { className: b(null, className), style: { backgroundColor: color } }, content));
|
|
@@ -5,9 +5,8 @@ import { getVideoTypesWithPriority } from './utils';
|
|
|
5
5
|
import { block } from '../../../utils';
|
|
6
6
|
import './Video.css';
|
|
7
7
|
const b = block('media-component-video');
|
|
8
|
-
const COMPONENT_NAME = 'media-video';
|
|
9
8
|
const Video = (props) => {
|
|
10
|
-
const { video, height, metrika, analyticsEvents, previewImg, playButton: commonPlayButton, customBarControlsClassName, videoClassName, playVideo, setHasVideoFallback, hasVideoFallback,
|
|
9
|
+
const { video, height, metrika, analyticsEvents, previewImg, playButton: commonPlayButton, customBarControlsClassName, videoClassName, playVideo, setHasVideoFallback, hasVideoFallback, } = props;
|
|
11
10
|
const ref = useRef(null);
|
|
12
11
|
useEffect(() => {
|
|
13
12
|
if (ref && ref.current) {
|
|
@@ -30,7 +29,7 @@ const Video = (props) => {
|
|
|
30
29
|
}, [playVideo, video, setHasVideoFallback]);
|
|
31
30
|
const reactPlayerBlock = useMemo(() => {
|
|
32
31
|
const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton } = video;
|
|
33
|
-
return (React.createElement(ReactPlayerBlock, { className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, metrika: metrika, analyticsEvents: analyticsEvents, height: height
|
|
32
|
+
return (React.createElement(ReactPlayerBlock, { className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, metrika: metrika, analyticsEvents: analyticsEvents, height: height }));
|
|
34
33
|
}, [
|
|
35
34
|
video,
|
|
36
35
|
height,
|
|
@@ -41,7 +40,6 @@ const Video = (props) => {
|
|
|
41
40
|
customBarControlsClassName,
|
|
42
41
|
metrika,
|
|
43
42
|
analyticsEvents,
|
|
44
|
-
blockName,
|
|
45
43
|
]);
|
|
46
44
|
const defaultVideoBlock = useMemo(() => {
|
|
47
45
|
return video.src.length && !hasVideoFallback ? (React.createElement("div", { className: b('wrap', videoClassName), style: { height } },
|
|
@@ -8,17 +8,17 @@ import CustomBarControls from './CustomBarControls';
|
|
|
8
8
|
import { VideoContext } from '../../context/videoContext';
|
|
9
9
|
import { MetrikaContext } from '../../context/metrikaContext';
|
|
10
10
|
import { MobileContext } from '../../context/mobileContext';
|
|
11
|
+
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
11
12
|
import { PlayVideo } from '../../icons';
|
|
12
13
|
import { useAnalytics } from '../../hooks';
|
|
13
14
|
import './ReactPlayer.css';
|
|
14
15
|
const b = block('ReactPlayer');
|
|
15
16
|
const FPS = 60;
|
|
16
|
-
const COMPONENT_NAME = 'react-player';
|
|
17
17
|
// eslint-disable-next-line react/display-name
|
|
18
18
|
export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
19
19
|
const isMobile = useContext(MobileContext);
|
|
20
20
|
const { metrika } = useContext(MetrikaContext);
|
|
21
|
-
const { src, previewImgUrl, loop = false, controls = MediaVideoControlsType.Default, muted: initiallyMuted = false, elapsedTime, playButton, className, customBarControlsClassName, showPreview, onClickPreview, metrika: videoMetrika, analyticsEvents, height,
|
|
21
|
+
const { src, previewImgUrl, loop = false, controls = MediaVideoControlsType.Default, muted: initiallyMuted = false, elapsedTime, playButton, className, customBarControlsClassName, showPreview, onClickPreview, metrika: videoMetrika, analyticsEvents, height, } = props;
|
|
22
22
|
const { type = PlayButtonType.Default, theme = PlayButtonThemes.Blue, text, className: buttonClassName, } = playButton || {};
|
|
23
23
|
const autoPlay = Boolean(!isMobile && !previewImgUrl && props.autoplay);
|
|
24
24
|
const mute = initiallyMuted || autoPlay;
|
|
@@ -39,11 +39,12 @@ export const ReactPlayerBlock = React.forwardRef((props, originRef) => {
|
|
|
39
39
|
}
|
|
40
40
|
return [];
|
|
41
41
|
}, [analyticsEvents]);
|
|
42
|
+
const context = useContext(BlockPositionContext);
|
|
42
43
|
const defaultEvent = useMemo(() => ({
|
|
43
44
|
name: 'react-player-controls-click',
|
|
44
45
|
type: PredefinedEventTypes.Default,
|
|
45
|
-
|
|
46
|
-
}), [
|
|
46
|
+
context: context,
|
|
47
|
+
}), [context]);
|
|
47
48
|
const handleAnalytics = useAnalytics(defaultEvent);
|
|
48
49
|
useImperativeHandle(originRef, () => ({
|
|
49
50
|
pause: () => setIsPlaying(false),
|
|
@@ -16,7 +16,7 @@ export interface YandexFormProps {
|
|
|
16
16
|
metrikaGoals?: string | string[];
|
|
17
17
|
pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
|
|
18
18
|
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
19
|
-
|
|
19
|
+
context?: string;
|
|
20
20
|
}
|
|
21
21
|
declare const YandexForm: (props: YandexFormProps) => JSX.Element;
|
|
22
22
|
export default YandexForm;
|
|
@@ -6,21 +6,22 @@ import { block } from '../../utils';
|
|
|
6
6
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
7
7
|
import { PredefinedEventTypes } from '../../models/common';
|
|
8
8
|
import { useAnalytics } from '../../hooks';
|
|
9
|
+
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
9
10
|
export const YANDEX_FORM_ORIGIN = 'https://forms.yandex.ru';
|
|
10
11
|
const CONTAINER_ID = 'pc-yandex-form-container';
|
|
11
|
-
const COMPONENT_NAME = 'yandex-form';
|
|
12
12
|
const b = block('yandex-form');
|
|
13
13
|
const YandexForm = (props) => {
|
|
14
|
-
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin,
|
|
14
|
+
const { onLoad, id, params, className, theme, containerId = CONTAINER_ID, headerHeight = HEADER_HEIGHT, onSubmit, metrikaGoals, pixelEvents, analyticsEvents, customFormOrigin, } = props;
|
|
15
15
|
const formContainerRef = useRef(null);
|
|
16
16
|
const iframeRef = useRef();
|
|
17
17
|
const yaFormOrigin = customFormOrigin || YANDEX_FORM_ORIGIN;
|
|
18
18
|
const handleMetrika = useMetrika();
|
|
19
|
+
const context = useContext(BlockPositionContext);
|
|
19
20
|
const defaultEvent = useMemo(() => ({
|
|
20
21
|
name: 'yndex-form-submit',
|
|
21
22
|
type: PredefinedEventTypes.Default,
|
|
22
|
-
|
|
23
|
-
}), [
|
|
23
|
+
context: context,
|
|
24
|
+
}), [context]);
|
|
24
25
|
const handleAnalytics = useAnalytics(defaultEvent);
|
|
25
26
|
const isMobile = useContext(MobileContext);
|
|
26
27
|
const locale = useContext(LocaleContext);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const blockMap: {
|
|
2
2
|
"slider-block": (props: import("./models").WithChildren<import("./blocks/Slider/Slider").SliderProps>) => JSX.Element;
|
|
3
3
|
"simple-block": (props: import("./models").WithChildren<import("./models").SimpleBlockProps>) => JSX.Element;
|
|
4
|
-
"extended-features-block": ({ title, description, items, colSizes, animated,
|
|
4
|
+
"extended-features-block": ({ title, description, items, colSizes, animated, }: import("./models").ExtendedFeaturesProps) => JSX.Element;
|
|
5
5
|
"promo-features-block": (props: import("./models").PromoFeaturesProps) => JSX.Element;
|
|
6
6
|
"questions-block": (props: import("./models").QuestionsProps) => JSX.Element;
|
|
7
7
|
"banner-block": (props: import("./models").BannerBlockProps) => JSX.Element;
|
|
@@ -11,14 +11,14 @@ export declare const blockMap: {
|
|
|
11
11
|
"info-block": (props: import("./models").InfoBlockProps) => JSX.Element;
|
|
12
12
|
"security-block": (props: import("./models").SecurityBlockProps) => JSX.Element;
|
|
13
13
|
"table-block": (props: import("./models").TableBlockProps) => JSX.Element;
|
|
14
|
-
"tabs-block": ({ items, title, description, animated, tabsColSizes, centered, direction,
|
|
14
|
+
"tabs-block": ({ items, title, description, animated, tabsColSizes, centered, direction, }: import("./models").TabsBlockProps) => JSX.Element;
|
|
15
15
|
"link-table-block": ({ items, title, description, linkTheme }: import("./models").LinkTableBlockProps) => JSX.Element;
|
|
16
16
|
"header-block": (props: import("./models").WithChildren<import("./models").HeaderBlockProps & import("./models").ClassNameProps>) => JSX.Element;
|
|
17
17
|
"icons-block": ({ title, size, items }: import("./models").IconsBlockProps) => JSX.Element;
|
|
18
18
|
"header-slider-block": ({ items, arrows, ...props }: import("./models").HeaderSliderBlockProps) => JSX.Element;
|
|
19
19
|
"card-layout-block": ({ title, description, animated, colSizes, children, }: import("./blocks/CardLayout/CardLayout").CardLayoutBlockProps) => JSX.Element;
|
|
20
20
|
"content-layout-block": (props: import("./models").ContentLayoutBlockProps) => JSX.Element;
|
|
21
|
-
"share-block": ({ items, title
|
|
21
|
+
"share-block": ({ items, title }: import("./models").ShareBlockProps) => JSX.Element;
|
|
22
22
|
};
|
|
23
23
|
export declare const subBlockMap: {
|
|
24
24
|
divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
|
|
@@ -31,10 +31,10 @@ export declare const subBlockMap: {
|
|
|
31
31
|
*/
|
|
32
32
|
partner: ({ text, logo, url, border }: import("./models").PartnerProps) => JSX.Element;
|
|
33
33
|
"price-detailed": (props: import("./models").PriceDetailedProps) => JSX.Element;
|
|
34
|
-
"media-card": ({ border,
|
|
34
|
+
"media-card": ({ border, ...mediaProps }: import("./models").MediaCardProps) => JSX.Element;
|
|
35
35
|
"banner-card": (props: import("./models").BannerCardProps) => JSX.Element;
|
|
36
36
|
"news-card": (props: import("./models").NewsCardProps) => JSX.Element;
|
|
37
|
-
"card-with-image": ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons,
|
|
37
|
+
"card-with-image": ({ title, description, image, disableCompress, links, border, fullScreen, className, additionalInfo, buttons, }: import("./models").CardWithImageProps) => JSX.Element;
|
|
38
38
|
"background-card": (props: import("./models").BackgroundCardProps) => JSX.Element;
|
|
39
39
|
"basic-card": (props: import("./models").BasicCardProps) => JSX.Element;
|
|
40
40
|
content: (props: import("./models").ContentBlockProps & import("./models").ClassNameProps) => JSX.Element;
|
package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export interface ConstructorItemProps {
|
|
|
3
3
|
data: ConstructorItemType;
|
|
4
4
|
context?: string;
|
|
5
5
|
}
|
|
6
|
-
export declare const ConstructorItem: ({ data, children, context
|
|
6
|
+
export declare const ConstructorItem: ({ data, children, context }: WithChildren<ConstructorItemProps>) => JSX.Element;
|
|
7
7
|
export declare const ConstructorHeader: ({ data }: Pick<ConstructorItemProps, 'data'>) => JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
3
|
import { InnerContext } from '../../../../context/innerContext';
|
|
4
4
|
import { BlockPositionContext } from '../../../../context/blockPositionContext';
|
|
5
|
-
export const ConstructorItem = ({ data, children, context
|
|
5
|
+
export const ConstructorItem = ({ data, children, context }) => {
|
|
6
6
|
const { itemMap } = useContext(InnerContext);
|
|
7
7
|
const { type } = data, rest = __rest(data, ["type"]);
|
|
8
8
|
const Component = itemMap[type];
|