@gravity-ui/page-constructor 1.15.0-alpha.9 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +5 -75
- package/build/cjs/blocks/Banner/Banner.js +2 -3
- package/build/cjs/blocks/Banner/schema.d.ts +0 -243
- package/build/cjs/blocks/Banner/schema.js +1 -3
- package/build/cjs/blocks/CardLayout/schema.d.ts +0 -6
- package/build/cjs/blocks/ContentLayout/ContentLayout.js +2 -3
- package/build/cjs/blocks/ContentLayout/schema.d.ts +0 -3
- 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 +0 -3
- package/build/cjs/blocks/Header/Header.js +5 -6
- package/build/cjs/blocks/Header/schema.d.ts +0 -3
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +0 -3
- package/build/cjs/blocks/Icons/schema.d.ts +0 -6
- package/build/cjs/blocks/Info/Info.js +3 -4
- package/build/cjs/blocks/Info/schema.d.ts +0 -3
- package/build/cjs/blocks/Info/schema.js +0 -2
- package/build/cjs/blocks/LinkTable/schema.d.ts +0 -3
- 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 +0 -81
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +1 -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 +0 -3
- package/build/cjs/blocks/Preview/schema.js +1 -3
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +2 -3
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +0 -3
- package/build/cjs/blocks/Questions/Questions.js +2 -3
- package/build/cjs/blocks/Questions/schema.d.ts +0 -3
- package/build/cjs/blocks/Security/Security.js +2 -3
- package/build/cjs/blocks/Security/schema.d.ts +0 -3
- package/build/cjs/blocks/Security/schema.js +1 -3
- package/build/cjs/blocks/Share/Share.d.ts +1 -1
- package/build/cjs/blocks/Share/Share.js +2 -10
- package/build/cjs/blocks/Simple/schema.d.ts +0 -3
- package/build/cjs/blocks/Slider/schema.d.ts +0 -3
- package/build/cjs/blocks/Table/schema.d.ts +0 -3
- 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 +0 -3
- package/build/cjs/components/BackLink/BackLink.d.ts +0 -1
- package/build/cjs/components/BackLink/BackLink.js +2 -11
- package/build/cjs/components/BackgroundMedia/BackgroundMedia.js +1 -2
- package/build/cjs/components/Button/Button.d.ts +0 -1
- package/build/cjs/components/Button/Button.js +2 -11
- package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +0 -1
- package/build/cjs/components/ButtonTabs/ButtonTabs.js +2 -11
- package/build/cjs/components/CardBase/CardBase.d.ts +0 -3
- package/build/cjs/components/CardBase/CardBase.js +1 -10
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +8 -6
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.css +70 -0
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.d.ts +9 -0
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.js +40 -0
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -10
- package/build/cjs/components/Link/Link.js +2 -11
- package/build/cjs/components/Media/Media.js +5 -7
- package/build/cjs/components/Media/Video/Video.js +3 -6
- package/build/cjs/components/MetaInfo/MetaInfo.css +13 -0
- package/build/cjs/components/MetaInfo/MetaInfo.d.ts +6 -0
- package/build/cjs/components/MetaInfo/MetaInfo.js +8 -0
- package/build/cjs/components/MetaInfo/schema.d.ts +8 -0
- package/build/cjs/components/MetaInfo/schema.js +10 -0
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +3 -15
- package/build/cjs/components/VideoBlock/VideoBlock.d.ts +1 -0
- package/build/cjs/components/VideoBlock/VideoBlock.js +6 -10
- package/build/cjs/components/YandexForm/YandexForm.d.ts +0 -3
- package/build/cjs/components/YandexForm/YandexForm.js +2 -19
- package/build/cjs/components/index.d.ts +2 -0
- package/build/cjs/components/index.js +5 -1
- package/build/cjs/constructor-items.d.ts +9 -5
- package/build/cjs/constructor-items.js +4 -0
- package/build/cjs/containers/PageConstructor/PageConstructor.css +1 -0
- package/build/cjs/containers/PageConstructor/Provider.d.ts +0 -2
- package/build/cjs/containers/PageConstructor/Provider.js +1 -3
- package/build/cjs/context/metrikaContext/metrikaContext.d.ts +0 -6
- package/build/cjs/hooks/index.d.ts +0 -1
- package/build/cjs/hooks/index.js +0 -1
- package/build/cjs/hooks/useMetrika.d.ts +0 -6
- package/build/cjs/hooks/useMetrika.js +0 -8
- package/build/cjs/models/common.d.ts +0 -34
- package/build/cjs/models/common.js +1 -10
- package/build/cjs/models/constructor-items/blocks.d.ts +0 -11
- package/build/cjs/models/constructor-items/common.d.ts +2 -27
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +16 -6
- package/build/cjs/models/constructor-items/sub-blocks.js +4 -0
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +2 -3
- package/build/cjs/schema/index.js +1 -0
- package/build/cjs/schema/validators/common.d.ts +0 -171
- package/build/cjs/schema/validators/common.js +0 -12
- package/build/cjs/schema/validators/sub-blocks.d.ts +1 -0
- package/build/cjs/schema/validators/sub-blocks.js +1 -0
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +2 -3
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +0 -3
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +0 -2
- 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/HubspotForm.css +2 -2
- package/build/cjs/sub-blocks/HubspotForm/index.js +3 -18
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +16 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +3 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +21 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +218 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.js +18 -0
- package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +15 -0
- package/build/cjs/sub-blocks/LayoutItem/utils.js +12 -0
- 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 +2 -9
- package/build/cjs/sub-blocks/Quote/schema.d.ts +0 -3
- package/build/cjs/sub-blocks/Quote/schema.js +1 -3
- package/build/cjs/sub-blocks/index.d.ts +1 -0
- package/build/cjs/sub-blocks/index.js +3 -1
- package/build/cjs/text-transform/blocks.js +17 -0
- package/build/cjs/utils/hubspot.d.ts +2 -1
- package/build/cjs/utils/hubspot.js +5 -1
- package/build/esm/blocks/Banner/Banner.js +2 -3
- package/build/esm/blocks/Banner/schema.d.ts +0 -243
- package/build/esm/blocks/Banner/schema.js +1 -3
- package/build/esm/blocks/CardLayout/schema.d.ts +0 -6
- package/build/esm/blocks/ContentLayout/ContentLayout.js +2 -3
- package/build/esm/blocks/ContentLayout/schema.d.ts +0 -3
- 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 +0 -3
- package/build/esm/blocks/Header/Header.js +5 -6
- package/build/esm/blocks/Header/schema.d.ts +0 -3
- package/build/esm/blocks/HeaderSlider/schema.d.ts +0 -3
- package/build/esm/blocks/Icons/schema.d.ts +0 -6
- package/build/esm/blocks/Info/Info.js +3 -4
- package/build/esm/blocks/Info/schema.d.ts +0 -3
- package/build/esm/blocks/Info/schema.js +0 -2
- package/build/esm/blocks/LinkTable/schema.d.ts +0 -3
- 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 +0 -81
- package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +1 -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 +0 -3
- package/build/esm/blocks/Preview/schema.js +1 -3
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +2 -3
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +0 -3
- package/build/esm/blocks/Questions/Questions.js +2 -3
- package/build/esm/blocks/Questions/schema.d.ts +0 -3
- package/build/esm/blocks/Security/Security.js +2 -3
- package/build/esm/blocks/Security/schema.d.ts +0 -3
- package/build/esm/blocks/Security/schema.js +1 -3
- package/build/esm/blocks/Share/Share.d.ts +1 -1
- package/build/esm/blocks/Share/Share.js +3 -11
- package/build/esm/blocks/Simple/schema.d.ts +0 -3
- package/build/esm/blocks/Slider/schema.d.ts +0 -3
- package/build/esm/blocks/Table/schema.d.ts +0 -3
- 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 +0 -3
- package/build/esm/components/BackLink/BackLink.d.ts +0 -1
- package/build/esm/components/BackLink/BackLink.js +2 -11
- package/build/esm/components/BackgroundMedia/BackgroundMedia.js +1 -2
- package/build/esm/components/Button/Button.d.ts +0 -1
- package/build/esm/components/Button/Button.js +2 -11
- package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +0 -1
- package/build/esm/components/ButtonTabs/ButtonTabs.js +2 -11
- package/build/esm/components/CardBase/CardBase.d.ts +0 -3
- package/build/esm/components/CardBase/CardBase.js +1 -10
- package/build/esm/components/FullscreenImage/FullscreenImage.js +9 -7
- package/build/esm/components/FullscreenMedia/FullScreenMedia.css +70 -0
- package/build/esm/components/FullscreenMedia/FullScreenMedia.d.ts +10 -0
- package/build/esm/components/FullscreenMedia/FullScreenMedia.js +38 -0
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -10
- package/build/esm/components/Link/Link.js +2 -11
- package/build/esm/components/Media/Media.js +5 -7
- package/build/esm/components/Media/Video/Video.js +3 -6
- package/build/esm/components/MetaInfo/MetaInfo.css +13 -0
- package/build/esm/components/MetaInfo/MetaInfo.d.ts +7 -0
- package/build/esm/components/MetaInfo/MetaInfo.js +6 -0
- package/build/esm/components/MetaInfo/schema.d.ts +8 -0
- package/build/esm/components/MetaInfo/schema.js +8 -0
- package/build/esm/components/ReactPlayer/ReactPlayer.js +4 -16
- package/build/esm/components/VideoBlock/VideoBlock.d.ts +1 -0
- package/build/esm/components/VideoBlock/VideoBlock.js +6 -10
- package/build/esm/components/YandexForm/YandexForm.d.ts +0 -3
- package/build/esm/components/YandexForm/YandexForm.js +2 -19
- package/build/esm/components/index.d.ts +2 -0
- package/build/esm/components/index.js +2 -0
- package/build/esm/constructor-items.d.ts +9 -5
- package/build/esm/constructor-items.js +5 -1
- package/build/esm/containers/PageConstructor/PageConstructor.css +1 -0
- package/build/esm/containers/PageConstructor/Provider.d.ts +0 -2
- package/build/esm/containers/PageConstructor/Provider.js +1 -3
- package/build/esm/context/metrikaContext/metrikaContext.d.ts +0 -6
- package/build/esm/hooks/index.d.ts +0 -1
- package/build/esm/hooks/index.js +0 -1
- package/build/esm/hooks/useMetrika.d.ts +0 -6
- package/build/esm/hooks/useMetrika.js +0 -8
- package/build/esm/models/common.d.ts +0 -34
- package/build/esm/models/common.js +0 -9
- package/build/esm/models/constructor-items/blocks.d.ts +0 -11
- package/build/esm/models/constructor-items/common.d.ts +2 -27
- package/build/esm/models/constructor-items/sub-blocks.d.ts +16 -6
- package/build/esm/models/constructor-items/sub-blocks.js +4 -0
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +2 -3
- package/build/esm/schema/index.js +1 -0
- package/build/esm/schema/validators/common.d.ts +0 -171
- package/build/esm/schema/validators/common.js +0 -12
- package/build/esm/schema/validators/sub-blocks.d.ts +1 -0
- package/build/esm/schema/validators/sub-blocks.js +1 -0
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +2 -3
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +0 -3
- package/build/esm/sub-blocks/BackgroundCard/schema.js +0 -2
- 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/HubspotForm.css +2 -2
- package/build/esm/sub-blocks/HubspotForm/index.js +4 -19
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +16 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +4 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +20 -0
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +218 -0
- package/build/esm/sub-blocks/LayoutItem/schema.js +14 -0
- package/build/esm/sub-blocks/LayoutItem/utils.d.ts +15 -0
- package/build/esm/sub-blocks/LayoutItem/utils.js +6 -0
- 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 +4 -11
- package/build/esm/sub-blocks/Quote/schema.d.ts +0 -3
- package/build/esm/sub-blocks/Quote/schema.js +1 -3
- package/build/esm/sub-blocks/index.d.ts +1 -0
- package/build/esm/sub-blocks/index.js +1 -0
- package/build/esm/text-transform/blocks.js +17 -0
- package/build/esm/utils/hubspot.d.ts +2 -1
- package/build/esm/utils/hubspot.js +5 -1
- package/package.json +4 -5
- package/server/models/common.d.ts +0 -34
- package/server/models/common.js +1 -10
- package/server/models/constructor-items/blocks.d.ts +0 -11
- package/server/models/constructor-items/common.d.ts +2 -27
- package/server/models/constructor-items/sub-blocks.d.ts +16 -6
- package/server/models/constructor-items/sub-blocks.js +4 -0
- package/server/text-transform/blocks.js +17 -0
- package/server/utils/hubspot.d.ts +2 -1
- package/server/utils/hubspot.js +5 -1
- package/styles/root.scss +1 -0
- package/build/cjs/context/analyticsContext/analyticsContext.d.ts +0 -6
- package/build/cjs/context/analyticsContext/analyticsContext.js +0 -6
- package/build/cjs/context/analyticsContext/index.d.ts +0 -1
- package/build/cjs/context/analyticsContext/index.js +0 -4
- package/build/cjs/hooks/useAnalytics.d.ts +0 -2
- package/build/cjs/hooks/useAnalytics.js +0 -23
- package/build/cjs/schema/validators/event.d.ts +0 -37
- package/build/cjs/schema/validators/event.js +0 -38
- package/build/esm/context/analyticsContext/analyticsContext.d.ts +0 -6
- package/build/esm/context/analyticsContext/analyticsContext.js +0 -2
- package/build/esm/context/analyticsContext/index.d.ts +0 -1
- package/build/esm/context/analyticsContext/index.js +0 -1
- package/build/esm/hooks/useAnalytics.d.ts +0 -2
- package/build/esm/hooks/useAnalytics.js +0 -19
- package/build/esm/schema/validators/event.d.ts +0 -37
- package/build/esm/schema/validators/event.js +0 -35
|
@@ -4,14 +4,13 @@ exports.InfoBlock = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
|
-
const models_1 = require("../../models");
|
|
8
7
|
const grid_1 = require("../../grid");
|
|
9
8
|
const ThemeValueContext_1 = require("../../context/theme/ThemeValueContext");
|
|
10
9
|
const Content_1 = tslib_1.__importDefault(require("../../sub-blocks/Content/Content"));
|
|
11
10
|
const b = (0, utils_1.block)('info-block');
|
|
12
11
|
const sizes = { md: 6, all: 12 };
|
|
13
12
|
const InfoBlock = (props) => {
|
|
14
|
-
const { backgroundColor, theme: blockTheme = 'dark', buttons = [], title, sectionsTitle, links = [], rightContent = {}, leftContent = {},
|
|
13
|
+
const { backgroundColor, theme: blockTheme = 'dark', buttons = [], title, sectionsTitle, links = [], rightContent = {}, leftContent = {}, } = props;
|
|
15
14
|
const { themeValue: theme } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
|
|
16
15
|
const contentTheme = blockTheme === 'dark' ? 'dark' : 'default';
|
|
17
16
|
const rightLinks = [
|
|
@@ -29,9 +28,9 @@ const InfoBlock = (props) => {
|
|
|
29
28
|
react_1.default.createElement(grid_1.Grid, null,
|
|
30
29
|
react_1.default.createElement(grid_1.Row, null,
|
|
31
30
|
react_1.default.createElement(grid_1.Col, { sizes: sizes, className: b('left') },
|
|
32
|
-
react_1.default.createElement(Content_1.default, Object.assign({ title: title || (leftContent === null || leftContent === void 0 ? void 0 : leftContent.title), text: leftContent === null || leftContent === void 0 ? void 0 : leftContent.text, links: leftContent === null || leftContent === void 0 ? void 0 : leftContent.links, buttons: leftButtons, additionalInfo: leftContent === null || leftContent === void 0 ? void 0 : leftContent.additionalInfo }, commonProps
|
|
31
|
+
react_1.default.createElement(Content_1.default, Object.assign({ title: title || (leftContent === null || leftContent === void 0 ? void 0 : leftContent.title), text: leftContent === null || leftContent === void 0 ? void 0 : leftContent.text, links: leftContent === null || leftContent === void 0 ? void 0 : leftContent.links, buttons: leftButtons, additionalInfo: leftContent === null || leftContent === void 0 ? void 0 : leftContent.additionalInfo }, commonProps))),
|
|
33
32
|
react_1.default.createElement(grid_1.Col, { sizes: sizes, className: b('right') },
|
|
34
|
-
react_1.default.createElement(Content_1.default, Object.assign({ title: sectionsTitle || (rightContent === null || rightContent === void 0 ? void 0 : rightContent.title), text: rightContent === null || rightContent === void 0 ? void 0 : rightContent.text, links: rightLinks, buttons: rightContent === null || rightContent === void 0 ? void 0 : rightContent.buttons, additionalInfo: rightContent === null || rightContent === void 0 ? void 0 : rightContent.additionalInfo }, commonProps
|
|
33
|
+
react_1.default.createElement(Content_1.default, Object.assign({ title: sectionsTitle || (rightContent === null || rightContent === void 0 ? void 0 : rightContent.title), text: rightContent === null || rightContent === void 0 ? void 0 : rightContent.text, links: rightLinks, buttons: rightContent === null || rightContent === void 0 ? void 0 : rightContent.buttons, additionalInfo: rightContent === null || rightContent === void 0 ? void 0 : rightContent.additionalInfo }, commonProps))))))));
|
|
35
34
|
};
|
|
36
35
|
exports.InfoBlock = InfoBlock;
|
|
37
36
|
exports.default = exports.InfoBlock;
|
|
@@ -22,8 +22,6 @@ exports.InfoBlock = {
|
|
|
22
22
|
}), sectionsTitle: {
|
|
23
23
|
type: 'string',
|
|
24
24
|
contentType: 'text',
|
|
25
|
-
}, blockName: {
|
|
26
|
-
type: 'string',
|
|
27
25
|
}, buttons: (0, utils_1.filteredArray)(common_1.ButtonBlock), theme: common_1.ThemeProps, links: (0, utils_1.filteredArray)(common_1.LinkProps), leftContent: ContentProps, rightContent: ContentProps }),
|
|
28
26
|
},
|
|
29
27
|
};
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const grid_1 = require("../../grid");
|
|
8
|
-
const models_1 = require("../../models");
|
|
9
8
|
const Media_1 = tslib_1.__importDefault(require("../../components/Media/Media"));
|
|
10
9
|
const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/AnimateBlock/AnimateBlock"));
|
|
11
10
|
const BlockHeader_1 = tslib_1.__importDefault(require("../../components/BlockHeader/BlockHeader"));
|
|
@@ -13,7 +12,7 @@ const MediaContent_1 = tslib_1.__importDefault(require("./MediaContent"));
|
|
|
13
12
|
const ThemeValueContext_1 = require("../../context/theme/ThemeValueContext");
|
|
14
13
|
const b = (0, utils_1.block)('media-block');
|
|
15
14
|
const MediaBlock = (props) => {
|
|
16
|
-
const { media, largeMedia, direction = 'content-media', mobileDirection = 'content-media', animated, mediaOnly, disableShadow = false
|
|
15
|
+
const { media, largeMedia, direction = 'content-media', mobileDirection = 'content-media', animated, mediaOnly, disableShadow = false } = props, mediaContentProps = tslib_1.__rest(props, ["media", "largeMedia", "direction", "mobileDirection", "animated", "mediaOnly", "disableShadow"]);
|
|
17
16
|
const { title, description } = mediaContentProps;
|
|
18
17
|
const [play, setPlay] = (0, react_1.useState)(false);
|
|
19
18
|
const { themeValue: theme } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
|
|
@@ -37,7 +36,7 @@ const MediaBlock = (props) => {
|
|
|
37
36
|
react_1.default.createElement(grid_1.Col, { className: b('content'), sizes: contentSizes }, mediaContent),
|
|
38
37
|
react_1.default.createElement(grid_1.Col, { sizes: mediaSizes },
|
|
39
38
|
react_1.default.createElement("div", { className: b('card', { shadow: !disableShadow }) },
|
|
40
|
-
react_1.default.createElement(Media_1.default, Object.assign({}, mediaThemed, { playVideo: play
|
|
39
|
+
react_1.default.createElement(Media_1.default, Object.assign({}, mediaThemed, { playVideo: play }))))))));
|
|
41
40
|
};
|
|
42
41
|
exports.MediaBlock = MediaBlock;
|
|
43
42
|
exports.default = exports.MediaBlock;
|
|
@@ -3,13 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
|
-
const models_1 = require("../../models");
|
|
7
6
|
const sub_blocks_1 = require("../../sub-blocks");
|
|
8
7
|
const b = (0, utils_1.block)('media-content');
|
|
9
8
|
const MediaContent = (props) => {
|
|
10
|
-
const { title, description, button, links, buttons = [], additionalInfo, size = 'l'
|
|
9
|
+
const { title, description, button, links, buttons = [], additionalInfo, size = 'l' } = props;
|
|
11
10
|
const allButtons = button ? [Object.assign(Object.assign({}, button), { size: 'xl' }), ...buttons] : buttons;
|
|
12
11
|
return (react_1.default.createElement("div", { className: b() },
|
|
13
|
-
react_1.default.createElement(sub_blocks_1.Content, { title: title, text: description, links: links, theme: "default", buttons: allButtons, additionalInfo: additionalInfo, size: size, colSizes: { all: 12, md: 12 }
|
|
12
|
+
react_1.default.createElement(sub_blocks_1.Content, { title: title, text: description, links: links, theme: "default", buttons: allButtons, additionalInfo: additionalInfo, size: size, colSizes: { all: 12, md: 12 } })));
|
|
14
13
|
};
|
|
15
14
|
exports.default = MediaContent;
|
|
@@ -426,84 +426,6 @@ export declare const MediaBlock: {
|
|
|
426
426
|
};
|
|
427
427
|
};
|
|
428
428
|
};
|
|
429
|
-
analyticsEvents: {
|
|
430
|
-
anyOf: ({
|
|
431
|
-
type: string;
|
|
432
|
-
additionalProperties: {
|
|
433
|
-
type: string;
|
|
434
|
-
};
|
|
435
|
-
required: string[];
|
|
436
|
-
properties: {
|
|
437
|
-
name: {
|
|
438
|
-
type: string;
|
|
439
|
-
};
|
|
440
|
-
type: {
|
|
441
|
-
type: string;
|
|
442
|
-
};
|
|
443
|
-
counters: {
|
|
444
|
-
type: string;
|
|
445
|
-
additionalProperties: boolean;
|
|
446
|
-
required: never[];
|
|
447
|
-
properties: {
|
|
448
|
-
include: {
|
|
449
|
-
type: string;
|
|
450
|
-
items: {
|
|
451
|
-
type: string;
|
|
452
|
-
};
|
|
453
|
-
};
|
|
454
|
-
exclude: {
|
|
455
|
-
type: string;
|
|
456
|
-
items: {
|
|
457
|
-
type: string;
|
|
458
|
-
};
|
|
459
|
-
};
|
|
460
|
-
};
|
|
461
|
-
};
|
|
462
|
-
blockName: {
|
|
463
|
-
type: string;
|
|
464
|
-
};
|
|
465
|
-
};
|
|
466
|
-
} | {
|
|
467
|
-
type: string;
|
|
468
|
-
items: {
|
|
469
|
-
type: string;
|
|
470
|
-
additionalProperties: {
|
|
471
|
-
type: string;
|
|
472
|
-
};
|
|
473
|
-
required: string[];
|
|
474
|
-
properties: {
|
|
475
|
-
name: {
|
|
476
|
-
type: string;
|
|
477
|
-
};
|
|
478
|
-
type: {
|
|
479
|
-
type: string;
|
|
480
|
-
};
|
|
481
|
-
counters: {
|
|
482
|
-
type: string;
|
|
483
|
-
additionalProperties: boolean;
|
|
484
|
-
required: never[];
|
|
485
|
-
properties: {
|
|
486
|
-
include: {
|
|
487
|
-
type: string;
|
|
488
|
-
items: {
|
|
489
|
-
type: string;
|
|
490
|
-
};
|
|
491
|
-
};
|
|
492
|
-
exclude: {
|
|
493
|
-
type: string;
|
|
494
|
-
items: {
|
|
495
|
-
type: string;
|
|
496
|
-
};
|
|
497
|
-
};
|
|
498
|
-
};
|
|
499
|
-
};
|
|
500
|
-
blockName: {
|
|
501
|
-
type: string;
|
|
502
|
-
};
|
|
503
|
-
};
|
|
504
|
-
};
|
|
505
|
-
})[];
|
|
506
|
-
};
|
|
507
429
|
target: {
|
|
508
430
|
type: string;
|
|
509
431
|
enum: string[];
|
|
@@ -603,9 +525,6 @@ export declare const MediaBlock: {
|
|
|
603
525
|
resetPaddings: {
|
|
604
526
|
type: string;
|
|
605
527
|
};
|
|
606
|
-
blockName: {
|
|
607
|
-
type: string;
|
|
608
|
-
};
|
|
609
528
|
type: {};
|
|
610
529
|
when: {};
|
|
611
530
|
};
|
|
@@ -8,7 +8,6 @@ interface MediaContentProps extends Refable<HTMLDivElement> {
|
|
|
8
8
|
switching: boolean;
|
|
9
9
|
isActiveBlock: (id: number, isMediaBlock?: boolean) => boolean;
|
|
10
10
|
showMediaContent: (id: number) => void;
|
|
11
|
-
blockName?: string;
|
|
12
11
|
}
|
|
13
|
-
declare const MediaContent: React.ForwardRefExoticComponent<Pick<MediaContentProps, "title" | "
|
|
12
|
+
declare const MediaContent: React.ForwardRefExoticComponent<Pick<MediaContentProps, "title" | "items" | "description" | "ratioMediaContent" | "switching" | "isActiveBlock" | "showMediaContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
13
|
export default MediaContent;
|
|
@@ -9,9 +9,8 @@ const PreviewContent_1 = tslib_1.__importDefault(require("./PreviewContent"));
|
|
|
9
9
|
const PreviewMedia_1 = tslib_1.__importDefault(require("./PreviewMedia"));
|
|
10
10
|
const ThemeValueContext_1 = require("../../../context/theme/ThemeValueContext");
|
|
11
11
|
const b = (0, utils_1.block)('preview-media-content-block');
|
|
12
|
-
const COMPONENT_NAME = 'preview-media-content';
|
|
13
12
|
const MediaContent = (0, react_1.forwardRef)((props, ref) => {
|
|
14
|
-
const { items, title, description = '', switching, ratioMediaContent = '1-1', isActiveBlock, showMediaContent,
|
|
13
|
+
const { items, title, description = '', switching, ratioMediaContent = '1-1', isActiveBlock, showMediaContent, } = props;
|
|
15
14
|
const { themeValue: theme } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
|
|
16
15
|
const [mediaSizes, setMediaSizes] = (0, react_1.useState)({ [grid_1.GridColumnSize.All]: 12 });
|
|
17
16
|
const [contentSizes, setContentSizes] = (0, react_1.useState)({ [grid_1.GridColumnSize.All]: 12 });
|
|
@@ -33,7 +32,7 @@ const MediaContent = (0, react_1.forwardRef)((props, ref) => {
|
|
|
33
32
|
const mediaMods = { active: isActiveBlock(id, true) };
|
|
34
33
|
const onClick = () => showMediaContent(id);
|
|
35
34
|
contentComponents.push(react_1.default.createElement(PreviewContent_1.default, Object.assign({ key: id, id: id }, content, { switching: switching, onClick: onClick, mods: contentMods })));
|
|
36
|
-
mediaComponents.push(react_1.default.createElement(PreviewMedia_1.default, { key: id, id: id, media: media && (0, utils_1.getThemedValue)(media, theme), play: isActive, mods: mediaMods
|
|
35
|
+
mediaComponents.push(react_1.default.createElement(PreviewMedia_1.default, { key: id, id: id, media: media && (0, utils_1.getThemedValue)(media, theme), play: isActive, mods: mediaMods }));
|
|
37
36
|
});
|
|
38
37
|
return (react_1.default.createElement(react_1.Fragment, null,
|
|
39
38
|
react_1.default.createElement(grid_1.Col, { sizes: contentSizes, className: b('content') },
|
|
@@ -5,10 +5,9 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
5
5
|
const utils_1 = require("../../../utils");
|
|
6
6
|
const Media_1 = tslib_1.__importDefault(require("../../../components/Media/Media"));
|
|
7
7
|
const b = (0, utils_1.block)('preview-media-block');
|
|
8
|
-
const COMPONENT_NAME = 'preview-media';
|
|
9
8
|
const PreviewMedia = (props) => {
|
|
10
|
-
const { id, media, play, mods
|
|
9
|
+
const { id, media, play, mods } = props;
|
|
11
10
|
return (react_1.default.createElement("div", { key: id, className: b('media', mods) },
|
|
12
|
-
react_1.default.createElement(Media_1.default, Object.assign({}, media, { playVideo: play
|
|
11
|
+
react_1.default.createElement(Media_1.default, Object.assign({}, media, { playVideo: play }))));
|
|
13
12
|
};
|
|
14
13
|
exports.default = PreviewMedia;
|
|
@@ -8,7 +8,6 @@ const breakpointContext_1 = require("../../context/breakpointContext");
|
|
|
8
8
|
const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/AnimateBlock/AnimateBlock"));
|
|
9
9
|
const MediaContent_1 = tslib_1.__importDefault(require("./MediaContent/MediaContent"));
|
|
10
10
|
const grid_1 = require("../../grid");
|
|
11
|
-
const models_1 = require("../../models");
|
|
12
11
|
const constants_1 = require("../../constants");
|
|
13
12
|
const useIntersection_1 = require("../../hooks/useIntersection");
|
|
14
13
|
const b = (0, utils_1.block)('preview-block');
|
|
@@ -23,7 +22,7 @@ const INDENT_BETWEEN_TITLE_DESCRIPTION = 16;
|
|
|
23
22
|
const PreviewBlock = (props) => {
|
|
24
23
|
const { direction = 'content-media', animated, items, title, description, ratioMediaContent = '1-1', stopVideo = false,
|
|
25
24
|
// TODO YDB-server doesn't see previewRef.current and doesn't update the component CLOUDFRONT-9395
|
|
26
|
-
showImmediately = false,
|
|
25
|
+
showImmediately = false, } = props;
|
|
27
26
|
const breakpoint = (0, react_1.useContext)(breakpointContext_1.BreakpointContext);
|
|
28
27
|
const isDesktop = breakpoint >= constants_1.BREAKPOINTS.md;
|
|
29
28
|
const menuRef = react_1.default.useRef(null);
|
|
@@ -86,7 +85,7 @@ const PreviewBlock = (props) => {
|
|
|
86
85
|
}, [changeActiveSlide, activeSlide, autoSwitchTimerId]);
|
|
87
86
|
return (react_1.default.createElement(AnimateBlock_1.default, { className: b(), animate: animated },
|
|
88
87
|
react_1.default.createElement(grid_1.Row, { ref: previewRef, className: b('row', { reverse: direction === 'media-content' }) },
|
|
89
|
-
react_1.default.createElement(MediaContent_1.default, { ref: menuRef, items: items, title: title, description: description, ratioMediaContent: ratioMediaContent, switching: !stopSwitching, isActiveBlock: isActiveBlock, showMediaContent: showMediaContent
|
|
88
|
+
react_1.default.createElement(MediaContent_1.default, { ref: menuRef, items: items, title: title, description: description, ratioMediaContent: ratioMediaContent, switching: !stopSwitching, isActiveBlock: isActiveBlock, showMediaContent: showMediaContent }))));
|
|
90
89
|
};
|
|
91
90
|
exports.PreviewBlock = PreviewBlock;
|
|
92
91
|
function changeMenuScroll(element, nextSlide, activeSlide) {
|
|
@@ -48,8 +48,6 @@ exports.PreviewBlock = {
|
|
|
48
48
|
}, ratioMediaContent: {
|
|
49
49
|
type: 'string',
|
|
50
50
|
enum: previewRatioMediaContent,
|
|
51
|
-
}, items: (0, utils_1.filteredArray)(PreviewItem),
|
|
52
|
-
type: 'string',
|
|
53
|
-
} }),
|
|
51
|
+
}, items: (0, utils_1.filteredArray)(PreviewItem) }),
|
|
54
52
|
},
|
|
55
53
|
};
|
|
@@ -5,7 +5,6 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
const constants_1 = require("../../constants");
|
|
7
7
|
const YFMWrapper_1 = tslib_1.__importDefault(require("../../components/YFMWrapper/YFMWrapper"));
|
|
8
|
-
const models_1 = require("../../models");
|
|
9
8
|
const Media_1 = tslib_1.__importDefault(require("../../components/Media/Media"));
|
|
10
9
|
const BlockHeader_1 = tslib_1.__importDefault(require("../../components/BlockHeader/BlockHeader"));
|
|
11
10
|
const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/AnimateBlock/AnimateBlock"));
|
|
@@ -18,7 +17,7 @@ const breakpointColumns = {
|
|
|
18
17
|
[constants_1.BREAKPOINTS.sm]: 1,
|
|
19
18
|
};
|
|
20
19
|
const PromoFeaturesBlock = (props) => {
|
|
21
|
-
const { items, title, description, theme, animated = true
|
|
20
|
+
const { items, title, description, theme, animated = true } = props;
|
|
22
21
|
const backgroundTheme = theme || 'default';
|
|
23
22
|
return (react_1.default.createElement(AnimateBlock_1.default, { className: b({ [backgroundTheme]: true }), animate: animated },
|
|
24
23
|
react_1.default.createElement(FullWidthBackground_1.default, { className: b('background', { [backgroundTheme]: true }) }),
|
|
@@ -34,7 +33,7 @@ const PromoFeaturesBlock = (props) => {
|
|
|
34
33
|
react_1.default.createElement("h4", { className: b('card-title') }, cardTitle),
|
|
35
34
|
react_1.default.createElement("div", { className: b('card-text') },
|
|
36
35
|
react_1.default.createElement(YFMWrapper_1.default, { content: text, modifiers: { constructor: true } }))),
|
|
37
|
-
media &&
|
|
36
|
+
media && react_1.default.createElement(Media_1.default, Object.assign({ className: b('card-media') }, media))));
|
|
38
37
|
}))));
|
|
39
38
|
};
|
|
40
39
|
exports.default = PromoFeaturesBlock;
|
|
@@ -3,14 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
|
-
const models_1 = require("../../models");
|
|
7
6
|
const Link_1 = tslib_1.__importDefault(require("../../components/Link/Link"));
|
|
8
7
|
const components_1 = require("../../components");
|
|
9
8
|
const grid_1 = require("../../grid");
|
|
10
9
|
const sub_blocks_1 = require("../../sub-blocks");
|
|
11
10
|
const b = (0, utils_1.block)('QuestionsBlock');
|
|
12
11
|
const QuestionsBlock = (props) => {
|
|
13
|
-
const { title, text, additionalInfo, links, buttons, items
|
|
12
|
+
const { title, text, additionalInfo, links, buttons, items } = props;
|
|
14
13
|
const [opened, setOpened] = (0, react_1.useState)([0]);
|
|
15
14
|
const toggleItem = (index) => {
|
|
16
15
|
let newState;
|
|
@@ -26,7 +25,7 @@ const QuestionsBlock = (props) => {
|
|
|
26
25
|
react_1.default.createElement(grid_1.Row, null,
|
|
27
26
|
react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: 4 } },
|
|
28
27
|
react_1.default.createElement("div", { className: b('title') },
|
|
29
|
-
react_1.default.createElement(sub_blocks_1.Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 }
|
|
28
|
+
react_1.default.createElement(sub_blocks_1.Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 } }))),
|
|
30
29
|
react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: 8 } }, items.map(({ title: itemTitle, text: itemText, link, listStyle = 'dash' }, index) => {
|
|
31
30
|
const isOpened = opened.includes(index);
|
|
32
31
|
return (react_1.default.createElement("div", { key: itemTitle, className: b('item') },
|
|
@@ -4,12 +4,11 @@ exports.SecurityBlock = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
|
-
const models_1 = require("../../models");
|
|
8
7
|
const components_1 = require("../../components");
|
|
9
8
|
const grid_1 = require("../../grid");
|
|
10
9
|
const b = (0, utils_1.block)('SecurityBlock');
|
|
11
10
|
const SecurityBlock = (props) => {
|
|
12
|
-
const { backgroundColor, theme = 'dark', title, points, media, animated
|
|
11
|
+
const { backgroundColor, theme = 'dark', title, points, media, animated } = props;
|
|
13
12
|
return (react_1.default.createElement(components_1.AnimateBlock, { className: b({ theme }), offset: 200, animate: animated },
|
|
14
13
|
react_1.default.createElement("div", { className: b('content') },
|
|
15
14
|
react_1.default.createElement(components_1.FullWidthBackground, { className: b('background'), style: { backgroundColor } }),
|
|
@@ -23,7 +22,7 @@ const SecurityBlock = (props) => {
|
|
|
23
22
|
link && (react_1.default.createElement(components_1.Link, { className: b('point-link'), text: link.text, url: link.url, theme: 'normal', arrow: true }))))))),
|
|
24
23
|
media && (react_1.default.createElement(grid_1.Row, { className: b('media') },
|
|
25
24
|
react_1.default.createElement(grid_1.Col, null,
|
|
26
|
-
react_1.default.createElement(components_1.Media, Object.assign({ className: b('media') }, media
|
|
25
|
+
react_1.default.createElement(components_1.Media, Object.assign({ className: b('media') }, media)))))))));
|
|
27
26
|
};
|
|
28
27
|
exports.SecurityBlock = SecurityBlock;
|
|
29
28
|
exports.default = exports.SecurityBlock;
|
|
@@ -4,10 +4,8 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
|
-
const models_1 = require("../../models");
|
|
8
7
|
const locationContext_1 = require("../../context/locationContext");
|
|
9
8
|
const i18n_1 = tslib_1.__importDefault(require("./i18n"));
|
|
10
|
-
const hooks_1 = require("../../hooks");
|
|
11
9
|
const Facebook_1 = require("../../icons/Facebook");
|
|
12
10
|
const Twitter_1 = require("../../icons/Twitter");
|
|
13
11
|
const Linkedin_1 = require("../../icons/Linkedin");
|
|
@@ -21,21 +19,15 @@ const icons = {
|
|
|
21
19
|
telegram: Telegram_1.Telegram,
|
|
22
20
|
};
|
|
23
21
|
const b = (0, utils_1.block)('share-block');
|
|
24
|
-
const Share = ({ items, title
|
|
22
|
+
const Share = ({ items, title }) => {
|
|
25
23
|
const { pathname, hostname } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
26
|
-
const handleAnalytics = (0, hooks_1.useAnalytics)({
|
|
27
|
-
name: 'share-button-click',
|
|
28
|
-
type: models_1.PredefinedEventTypes.Default,
|
|
29
|
-
blockName: blockName,
|
|
30
|
-
});
|
|
31
|
-
const handleButtonClick = (0, react_1.useCallback)(() => handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(), [handleAnalytics]);
|
|
32
24
|
return (react_1.default.createElement("div", { className: b() },
|
|
33
25
|
react_1.default.createElement("h5", { className: b('title') }, title || (0, i18n_1.default)('constructor-share')),
|
|
34
26
|
react_1.default.createElement("div", { className: b('items') }, items.map((type) => {
|
|
35
27
|
const url = (0, utils_1.getAbsolutePath)(hostname, pathname);
|
|
36
28
|
const socialUrl = (0, utils_1.getShareLink)(url, type);
|
|
37
29
|
const icon = icons[type];
|
|
38
|
-
return (react_1.default.createElement(uikit_1.Button, { key: type, view: "flat", size: "l", target: "_blank", href: socialUrl, className: b('item', { type: type.toLowerCase() })
|
|
30
|
+
return (react_1.default.createElement(uikit_1.Button, { key: type, view: "flat", size: "l", target: "_blank", href: socialUrl, className: b('item', { type: type.toLowerCase() }) }, icon && react_1.default.createElement(uikit_1.Icon, { data: icon, size: 24, className: b('icon', { type }) })));
|
|
39
31
|
}))));
|
|
40
32
|
};
|
|
41
33
|
exports.default = Share;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TabsBlockProps } from '../../models';
|
|
2
|
-
export declare const TabsBlock: ({ items, title, description, animated, tabsColSizes, centered, direction,
|
|
2
|
+
export declare const TabsBlock: ({ items, title, description, animated, tabsColSizes, centered, direction, }: TabsBlockProps) => JSX.Element;
|
|
3
3
|
export default TabsBlock;
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const grid_1 = require("../../grid");
|
|
8
|
-
const models_1 = require("../../models");
|
|
9
8
|
const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/AnimateBlock/AnimateBlock"));
|
|
10
9
|
const BlockHeader_1 = tslib_1.__importDefault(require("../../components/BlockHeader/BlockHeader"));
|
|
11
10
|
const FullscreenImage_1 = tslib_1.__importDefault(require("../../components/FullscreenImage/FullscreenImage"));
|
|
@@ -16,7 +15,7 @@ const ButtonTabs_1 = tslib_1.__importDefault(require("../../components/ButtonTab
|
|
|
16
15
|
const sub_blocks_1 = require("../../sub-blocks");
|
|
17
16
|
const VideoBlock_1 = require("../../components/VideoBlock/VideoBlock");
|
|
18
17
|
const b = (0, utils_1.block)('tabs-block');
|
|
19
|
-
const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content',
|
|
18
|
+
const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered, direction = 'media-content', }) => {
|
|
20
19
|
var _a;
|
|
21
20
|
const [activeTab, setActiveTab] = (0, react_1.useState)(items[0].tabName);
|
|
22
21
|
const [play, setPlay] = (0, react_1.useState)(false);
|
|
@@ -41,12 +40,12 @@ const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered
|
|
|
41
40
|
react_1.default.createElement(sub_blocks_1.Content, { title: activeTabData.title, text: activeTabData.text, additionalInfo: activeTabData.additionalInfo, size: "s", links: [
|
|
42
41
|
...(activeTabData.link ? [activeTabData.link] : []),
|
|
43
42
|
...(activeTabData.links || []),
|
|
44
|
-
], buttons: activeTabData.buttons, colSizes: { all: 12 }
|
|
43
|
+
], buttons: activeTabData.buttons, colSizes: { all: 12 } }))));
|
|
45
44
|
const mediaContent = showMedia && (react_1.default.createElement(grid_1.Col, { sizes: { all: 12, md: 8 }, orders: {
|
|
46
45
|
all: grid_1.GridColumnOrderClasses.Last,
|
|
47
46
|
md: grid_1.GridColumnOrderClasses.First,
|
|
48
47
|
}, className: b('col', { centered: centered }) },
|
|
49
|
-
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_1.getThemedValue)(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: mediaHeight
|
|
48
|
+
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_1.getThemedValue)(activeTabData.media, theme), { key: activeTab, className: b('media'), playVideo: play, height: mediaHeight })))),
|
|
50
49
|
imageProps && (react_1.default.createElement(react_1.Fragment, null,
|
|
51
50
|
react_1.default.createElement(FullscreenImage_1.default, Object.assign({}, imageProps, { imageClassName: b('image') })))),
|
|
52
51
|
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && react_1.default.createElement("p", { className: b('caption') }, activeTabData.caption)));
|
|
@@ -54,7 +53,7 @@ const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered
|
|
|
54
53
|
react_1.default.createElement(BlockHeader_1.default, { title: title, description: description, className: b('block-title', { centered: centered }) }),
|
|
55
54
|
react_1.default.createElement(grid_1.Row, null,
|
|
56
55
|
react_1.default.createElement(grid_1.Col, { sizes: tabsColSizes },
|
|
57
|
-
react_1.default.createElement(ButtonTabs_1.default, { items: tabs, onSelectTab: setActiveTab, activeTab: activeTab, className: b('tabs', { centered: centered })
|
|
56
|
+
react_1.default.createElement(ButtonTabs_1.default, { items: tabs, onSelectTab: setActiveTab, activeTab: activeTab, className: b('tabs', { centered: centered }) }))),
|
|
58
57
|
activeTabData && (react_1.default.createElement(grid_1.Row, { className: b('row', { reverse: isReverse }) },
|
|
59
58
|
mediaContent,
|
|
60
59
|
textContent))));
|
|
@@ -5,19 +5,10 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
6
|
const icons_1 = require("../../icons");
|
|
7
7
|
const locationContext_1 = require("../../context/locationContext");
|
|
8
|
-
const hooks_1 = require("../../hooks");
|
|
9
|
-
const models_1 = require("../../models");
|
|
10
|
-
const COMPONENT_NAME = 'backlink';
|
|
11
8
|
function BackLink(props) {
|
|
12
9
|
const { history } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
13
|
-
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick,
|
|
14
|
-
const handleAnalytics = (0, hooks_1.useAnalytics)({
|
|
15
|
-
name: 'back-link-click',
|
|
16
|
-
type: models_1.PredefinedEventTypes.Default,
|
|
17
|
-
blockName: blockName,
|
|
18
|
-
});
|
|
10
|
+
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick, } = props;
|
|
19
11
|
const backActionHandler = (0, react_1.useCallback)(async () => {
|
|
20
|
-
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics();
|
|
21
12
|
if (!history) {
|
|
22
13
|
return;
|
|
23
14
|
}
|
|
@@ -30,7 +21,7 @@ function BackLink(props) {
|
|
|
30
21
|
else {
|
|
31
22
|
history.push({ pathname: url });
|
|
32
23
|
}
|
|
33
|
-
}, [
|
|
24
|
+
}, [history, onClick, url]);
|
|
34
25
|
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 },
|
|
35
26
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.ArrowSidebar, size: 24 }),
|
|
36
27
|
react_1.default.createElement("span", null, title)));
|
|
@@ -7,12 +7,11 @@ const Media_1 = tslib_1.__importDefault(require("../Media/Media"));
|
|
|
7
7
|
const AnimateBlock_1 = tslib_1.__importDefault(require("../AnimateBlock/AnimateBlock"));
|
|
8
8
|
const mobileContext_1 = require("../../context/mobileContext");
|
|
9
9
|
const b = (0, utils_1.block)('BackgroundMedia');
|
|
10
|
-
const COMPONENT_NAME = 'backgound-media-component';
|
|
11
10
|
const BackgroundMedia = (_a) => {
|
|
12
11
|
var { className, color, animated, parallax = true, video, mediaClassName } = _a, props = tslib_1.__rest(_a, ["className", "color", "animated", "parallax", "video", "mediaClassName"]);
|
|
13
12
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
14
13
|
return (react_1.default.createElement(AnimateBlock_1.default, { className: b(null, className), style: { backgroundColor: color }, animate: animated },
|
|
15
14
|
react_1.default.createElement(Media_1.default, Object.assign({ className: b('media', mediaClassName), imageClassName: b('image'), videoClassName: b('video'), isBackground: true }, Object.assign({ height: 720, color,
|
|
16
|
-
parallax, video: isMobile ? undefined : video }, props)
|
|
15
|
+
parallax, video: isMobile ? undefined : video }, props)))));
|
|
17
16
|
};
|
|
18
17
|
exports.default = BackgroundMedia;
|