@gravity-ui/page-constructor 1.15.0-alpha.8 → 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 -11
- 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 -16
- 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/constants.d.ts +0 -1
- package/build/cjs/constants.js +1 -2
- 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 -29
- package/build/cjs/models/common.js +0 -3
- 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 -19
- 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 -10
- 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 -12
- 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 +3 -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/constants.d.ts +0 -1
- package/build/esm/constants.js +0 -1
- 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 -29
- package/build/esm/models/common.js +0 -3
- 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 -20
- 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 -12
- 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 -29
- package/server/models/common.js +0 -3
- 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
|
@@ -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
|
};
|
|
@@ -9,7 +9,6 @@ interface MediaContentProps extends Refable<HTMLDivElement> {
|
|
|
9
9
|
switching: boolean;
|
|
10
10
|
isActiveBlock: (id: number, isMediaBlock?: boolean) => boolean;
|
|
11
11
|
showMediaContent: (id: number) => void;
|
|
12
|
-
blockName?: string;
|
|
13
12
|
}
|
|
14
|
-
declare const MediaContent: React.ForwardRefExoticComponent<Pick<MediaContentProps, "title" | "
|
|
13
|
+
declare const MediaContent: React.ForwardRefExoticComponent<Pick<MediaContentProps, "title" | "items" | "description" | "ratioMediaContent" | "switching" | "isActiveBlock" | "showMediaContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
14
|
export default MediaContent;
|
|
@@ -7,9 +7,8 @@ import PreviewMedia from './PreviewMedia';
|
|
|
7
7
|
import { ThemeValueContext } from '../../../context/theme/ThemeValueContext';
|
|
8
8
|
import './MediaContent.css';
|
|
9
9
|
const b = block('preview-media-content-block');
|
|
10
|
-
const COMPONENT_NAME = 'preview-media-content';
|
|
11
10
|
const MediaContent = forwardRef((props, ref) => {
|
|
12
|
-
const { items, title, description = '', switching, ratioMediaContent = '1-1', isActiveBlock, showMediaContent,
|
|
11
|
+
const { items, title, description = '', switching, ratioMediaContent = '1-1', isActiveBlock, showMediaContent, } = props;
|
|
13
12
|
const { themeValue: theme } = useContext(ThemeValueContext);
|
|
14
13
|
const [mediaSizes, setMediaSizes] = useState({ [GridColumnSize.All]: 12 });
|
|
15
14
|
const [contentSizes, setContentSizes] = useState({ [GridColumnSize.All]: 12 });
|
|
@@ -31,7 +30,7 @@ const MediaContent = forwardRef((props, ref) => {
|
|
|
31
30
|
const mediaMods = { active: isActiveBlock(id, true) };
|
|
32
31
|
const onClick = () => showMediaContent(id);
|
|
33
32
|
contentComponents.push(React.createElement(PreviewContent, Object.assign({ key: id, id: id }, content, { switching: switching, onClick: onClick, mods: contentMods })));
|
|
34
|
-
mediaComponents.push(React.createElement(PreviewMedia, { key: id, id: id, media: media && getThemedValue(media, theme), play: isActive, mods: mediaMods
|
|
33
|
+
mediaComponents.push(React.createElement(PreviewMedia, { key: id, id: id, media: media && getThemedValue(media, theme), play: isActive, mods: mediaMods }));
|
|
35
34
|
});
|
|
36
35
|
return (React.createElement(Fragment, null,
|
|
37
36
|
React.createElement(Col, { sizes: contentSizes, className: b('content') },
|
|
@@ -3,10 +3,9 @@ import { block } from '../../../utils';
|
|
|
3
3
|
import Media from '../../../components/Media/Media';
|
|
4
4
|
import './PreviewMedia.css';
|
|
5
5
|
const b = block('preview-media-block');
|
|
6
|
-
const COMPONENT_NAME = 'preview-media';
|
|
7
6
|
const PreviewMedia = (props) => {
|
|
8
|
-
const { id, media, play, mods
|
|
7
|
+
const { id, media, play, mods } = props;
|
|
9
8
|
return (React.createElement("div", { key: id, className: b('media', mods) },
|
|
10
|
-
React.createElement(Media, Object.assign({}, media, { playVideo: play
|
|
9
|
+
React.createElement(Media, Object.assign({}, media, { playVideo: play }))));
|
|
11
10
|
};
|
|
12
11
|
export default PreviewMedia;
|
|
@@ -4,7 +4,6 @@ import { BreakpointContext } from '../../context/breakpointContext';
|
|
|
4
4
|
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
5
5
|
import MediaContent from './MediaContent/MediaContent';
|
|
6
6
|
import { Row } from '../../grid';
|
|
7
|
-
import { BlockType } from '../../models';
|
|
8
7
|
import { BREAKPOINTS } from '../../constants';
|
|
9
8
|
import { useIntersection } from '../../hooks/useIntersection';
|
|
10
9
|
import './Preview.css';
|
|
@@ -20,7 +19,7 @@ const INDENT_BETWEEN_TITLE_DESCRIPTION = 16;
|
|
|
20
19
|
export const PreviewBlock = (props) => {
|
|
21
20
|
const { direction = 'content-media', animated, items, title, description, ratioMediaContent = '1-1', stopVideo = false,
|
|
22
21
|
// TODO YDB-server doesn't see previewRef.current and doesn't update the component CLOUDFRONT-9395
|
|
23
|
-
showImmediately = false,
|
|
22
|
+
showImmediately = false, } = props;
|
|
24
23
|
const breakpoint = useContext(BreakpointContext);
|
|
25
24
|
const isDesktop = breakpoint >= BREAKPOINTS.md;
|
|
26
25
|
const menuRef = React.useRef(null);
|
|
@@ -83,7 +82,7 @@ export const PreviewBlock = (props) => {
|
|
|
83
82
|
}, [changeActiveSlide, activeSlide, autoSwitchTimerId]);
|
|
84
83
|
return (React.createElement(AnimateBlock, { className: b(), animate: animated },
|
|
85
84
|
React.createElement(Row, { ref: previewRef, className: b('row', { reverse: direction === 'media-content' }) },
|
|
86
|
-
React.createElement(MediaContent, { ref: menuRef, items: items, title: title, description: description, ratioMediaContent: ratioMediaContent, switching: !stopSwitching, isActiveBlock: isActiveBlock, showMediaContent: showMediaContent
|
|
85
|
+
React.createElement(MediaContent, { ref: menuRef, items: items, title: title, description: description, ratioMediaContent: ratioMediaContent, switching: !stopSwitching, isActiveBlock: isActiveBlock, showMediaContent: showMediaContent }))));
|
|
87
86
|
};
|
|
88
87
|
function changeMenuScroll(element, nextSlide, activeSlide) {
|
|
89
88
|
if (!element) {
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { block } from '../../utils';
|
|
3
3
|
import { BREAKPOINTS } from '../../constants';
|
|
4
4
|
import YFMWrapper from '../../components/YFMWrapper/YFMWrapper';
|
|
5
|
-
import { BlockType } from '../../models';
|
|
6
5
|
import Media from '../../components/Media/Media';
|
|
7
6
|
import BlockHeader from '../../components/BlockHeader/BlockHeader';
|
|
8
7
|
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
|
|
@@ -16,7 +15,7 @@ const breakpointColumns = {
|
|
|
16
15
|
[BREAKPOINTS.sm]: 1,
|
|
17
16
|
};
|
|
18
17
|
const PromoFeaturesBlock = (props) => {
|
|
19
|
-
const { items, title, description, theme, animated = true
|
|
18
|
+
const { items, title, description, theme, animated = true } = props;
|
|
20
19
|
const backgroundTheme = theme || 'default';
|
|
21
20
|
return (React.createElement(AnimateBlock, { className: b({ [backgroundTheme]: true }), animate: animated },
|
|
22
21
|
React.createElement(FullWidthBackground, { className: b('background', { [backgroundTheme]: true }) }),
|
|
@@ -32,7 +31,7 @@ const PromoFeaturesBlock = (props) => {
|
|
|
32
31
|
React.createElement("h4", { className: b('card-title') }, cardTitle),
|
|
33
32
|
React.createElement("div", { className: b('card-text') },
|
|
34
33
|
React.createElement(YFMWrapper, { content: text, modifiers: { constructor: true } }))),
|
|
35
|
-
media &&
|
|
34
|
+
media && React.createElement(Media, Object.assign({ className: b('card-media') }, media))));
|
|
36
35
|
}))));
|
|
37
36
|
};
|
|
38
37
|
export default PromoFeaturesBlock;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { block } from '../../utils';
|
|
3
|
-
import { BlockType } from '../../models';
|
|
4
3
|
import Link from '../../components/Link/Link';
|
|
5
4
|
import { YFMWrapper, ToggleArrow, Foldable, HTML } from '../../components';
|
|
6
5
|
import { Row, Col } from '../../grid';
|
|
@@ -8,7 +7,7 @@ import { Content } from '../../sub-blocks';
|
|
|
8
7
|
import './Questions.css';
|
|
9
8
|
const b = block('QuestionsBlock');
|
|
10
9
|
const QuestionsBlock = (props) => {
|
|
11
|
-
const { title, text, additionalInfo, links, buttons, items
|
|
10
|
+
const { title, text, additionalInfo, links, buttons, items } = props;
|
|
12
11
|
const [opened, setOpened] = useState([0]);
|
|
13
12
|
const toggleItem = (index) => {
|
|
14
13
|
let newState;
|
|
@@ -24,7 +23,7 @@ const QuestionsBlock = (props) => {
|
|
|
24
23
|
React.createElement(Row, null,
|
|
25
24
|
React.createElement(Col, { sizes: { all: 12, md: 4 } },
|
|
26
25
|
React.createElement("div", { className: b('title') },
|
|
27
|
-
React.createElement(Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 }
|
|
26
|
+
React.createElement(Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 } }))),
|
|
28
27
|
React.createElement(Col, { sizes: { all: 12, md: 8 } }, items.map(({ title: itemTitle, text: itemText, link, listStyle = 'dash' }, index) => {
|
|
29
28
|
const isOpened = opened.includes(index);
|
|
30
29
|
return (React.createElement("div", { key: itemTitle, className: b('item') },
|
|
@@ -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,16 +1,13 @@
|
|
|
1
|
-
import React, { useContext
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
2
|
import { Icon, Button } from '@gravity-ui/uikit';
|
|
3
3
|
import { block, getAbsolutePath, getShareLink } from '../../utils';
|
|
4
|
-
import { BlockType } from '../../models';
|
|
5
4
|
import { LocationContext } from '../../context/locationContext';
|
|
6
5
|
import i18n from './i18n';
|
|
7
|
-
import { useAnalytics } from '../../hooks';
|
|
8
6
|
import { Facebook } from '../../icons/Facebook';
|
|
9
7
|
import { Twitter } from '../../icons/Twitter';
|
|
10
8
|
import { Linkedin } from '../../icons/Linkedin';
|
|
11
9
|
import { Vk } from '../../icons/Vk';
|
|
12
10
|
import { Telegram } from '../../icons/Telegram';
|
|
13
|
-
import { DEFAULT_EVENT_TYPE } from '../../constants';
|
|
14
11
|
import './Share.css';
|
|
15
12
|
const icons = {
|
|
16
13
|
facebook: Facebook,
|
|
@@ -20,21 +17,15 @@ const icons = {
|
|
|
20
17
|
telegram: Telegram,
|
|
21
18
|
};
|
|
22
19
|
const b = block('share-block');
|
|
23
|
-
const Share = ({ items, title
|
|
20
|
+
const Share = ({ items, title }) => {
|
|
24
21
|
const { pathname, hostname } = useContext(LocationContext);
|
|
25
|
-
const handleAnalytics = useAnalytics({
|
|
26
|
-
name: 'share-button-click',
|
|
27
|
-
type: DEFAULT_EVENT_TYPE,
|
|
28
|
-
blockName: blockName,
|
|
29
|
-
});
|
|
30
|
-
const handleButtonClick = useCallback(() => handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(), [handleAnalytics]);
|
|
31
22
|
return (React.createElement("div", { className: b() },
|
|
32
23
|
React.createElement("h5", { className: b('title') }, title || i18n('constructor-share')),
|
|
33
24
|
React.createElement("div", { className: b('items') }, items.map((type) => {
|
|
34
25
|
const url = getAbsolutePath(hostname, pathname);
|
|
35
26
|
const socialUrl = getShareLink(url, type);
|
|
36
27
|
const icon = icons[type];
|
|
37
|
-
return (React.createElement(Button, { key: type, view: "flat", size: "l", target: "_blank", href: socialUrl, className: b('item', { type: type.toLowerCase() })
|
|
28
|
+
return (React.createElement(Button, { key: type, view: "flat", size: "l", target: "_blank", href: socialUrl, className: b('item', { type: type.toLowerCase() }) }, icon && React.createElement(Icon, { data: icon, size: 24, className: b('icon', { type }) })));
|
|
38
29
|
}))));
|
|
39
30
|
};
|
|
40
31
|
export default Share;
|
|
@@ -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))));
|
|
@@ -2,19 +2,10 @@ import React, { useCallback, useContext } from 'react';
|
|
|
2
2
|
import { Button, Icon } from '@gravity-ui/uikit';
|
|
3
3
|
import { ArrowSidebar } from '../../icons';
|
|
4
4
|
import { LocationContext } from '../../context/locationContext';
|
|
5
|
-
import { useAnalytics } from '../../hooks';
|
|
6
|
-
import { DEFAULT_EVENT_TYPE } from '../../constants';
|
|
7
|
-
const COMPONENT_NAME = 'backlink';
|
|
8
5
|
export default function BackLink(props) {
|
|
9
6
|
const { history } = useContext(LocationContext);
|
|
10
|
-
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick,
|
|
11
|
-
const handleAnalytics = useAnalytics({
|
|
12
|
-
name: 'back-link-click',
|
|
13
|
-
type: DEFAULT_EVENT_TYPE,
|
|
14
|
-
blockName: blockName,
|
|
15
|
-
});
|
|
7
|
+
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick, } = props;
|
|
16
8
|
const backActionHandler = useCallback(async () => {
|
|
17
|
-
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics();
|
|
18
9
|
if (!history) {
|
|
19
10
|
return;
|
|
20
11
|
}
|
|
@@ -27,7 +18,7 @@ export default function BackLink(props) {
|
|
|
27
18
|
else {
|
|
28
19
|
history.push({ pathname: url });
|
|
29
20
|
}
|
|
30
|
-
}, [
|
|
21
|
+
}, [history, onClick, url]);
|
|
31
22
|
return (React.createElement(Button, { className: className, view: theme === 'special' ? 'flat-contrast' : 'flat-secondary', size: size, href: shouldHandleBackAction ? undefined : url, onClick: shouldHandleBackAction ? backActionHandler : undefined },
|
|
32
23
|
React.createElement(Icon, { data: ArrowSidebar, size: 24 }),
|
|
33
24
|
React.createElement("span", null, title)));
|
|
@@ -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;
|
|
@@ -5,29 +5,20 @@ import { block, setUrlTld } from '../../utils';
|
|
|
5
5
|
import { toCommonSize, toCommonView } from './utils';
|
|
6
6
|
import { LocaleContext } from '../../context/localeContext/localeContext';
|
|
7
7
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
8
|
-
import { useAnalytics } from '../../hooks';
|
|
9
8
|
import { Github } from '../../icons';
|
|
10
|
-
import { DEFAULT_EVENT_TYPE } from '../../constants';
|
|
11
9
|
import './Button.css';
|
|
12
|
-
const COMPONENT_NAME = 'button';
|
|
13
10
|
const b = block('button-block');
|
|
14
11
|
const Button = (props) => {
|
|
15
12
|
const handleMetrika = useMetrika();
|
|
16
13
|
const { lang, tld } = useContext(LocaleContext);
|
|
17
|
-
const { className, metrikaGoals, pixelEvents,
|
|
14
|
+
const { className, metrikaGoals, pixelEvents, size = 'l', theme = 'normal', url, img, onClick: onClickOrigin, text } = props, rest = __rest(props, ["className", "metrikaGoals", "pixelEvents", "size", "theme", "url", "img", "onClick", "text"]);
|
|
18
15
|
const defaultImgPosition = 'left';
|
|
19
|
-
const handleAnalytics = useAnalytics({
|
|
20
|
-
name: 'button-click',
|
|
21
|
-
type: DEFAULT_EVENT_TYPE,
|
|
22
|
-
blockName: blockName,
|
|
23
|
-
});
|
|
24
16
|
const onClick = useCallback(() => {
|
|
25
17
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
26
|
-
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
|
|
27
18
|
if (onClickOrigin) {
|
|
28
19
|
onClickOrigin();
|
|
29
20
|
}
|
|
30
|
-
}, [handleMetrika, metrikaGoals, pixelEvents,
|
|
21
|
+
}, [handleMetrika, metrikaGoals, pixelEvents, onClickOrigin]);
|
|
31
22
|
const buttonImg = img instanceof Object
|
|
32
23
|
? { url: img.url, position: img.position || defaultImgPosition, alt: img.alt }
|
|
33
24
|
: { url: img, position: defaultImgPosition };
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { block } from '../../utils';
|
|
3
3
|
import { Button } from '../index';
|
|
4
|
-
import { useAnalytics } from '../../hooks';
|
|
5
|
-
import { DEFAULT_EVENT_TYPE } from '../../constants';
|
|
6
4
|
import './ButtonTabs.css';
|
|
7
5
|
const b = block('button-tabs');
|
|
8
|
-
const COMPONENT_NAME = 'button-tabs';
|
|
9
6
|
const ButtonTabs = (props) => {
|
|
10
|
-
const { className, items, activeTab, onSelectTab
|
|
11
|
-
const handleAnalytics = useAnalytics({
|
|
12
|
-
name: 'button-tabs-click',
|
|
13
|
-
type: DEFAULT_EVENT_TYPE,
|
|
14
|
-
blockName: blockName,
|
|
15
|
-
});
|
|
7
|
+
const { className, items, activeTab, onSelectTab } = props;
|
|
16
8
|
const activeTabId = useMemo(() => {
|
|
17
9
|
if (activeTab) {
|
|
18
10
|
return activeTab;
|
|
@@ -20,11 +12,10 @@ const ButtonTabs = (props) => {
|
|
|
20
12
|
return items[0].id;
|
|
21
13
|
}, [activeTab, items]);
|
|
22
14
|
const handleClick = useCallback((tabId) => {
|
|
23
|
-
handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics();
|
|
24
15
|
if (onSelectTab) {
|
|
25
16
|
onSelectTab(tabId);
|
|
26
17
|
}
|
|
27
|
-
}, [
|
|
18
|
+
}, [onSelectTab]);
|
|
28
19
|
return (React.createElement("div", { className: b(null, className) }, items.map((item) => {
|
|
29
20
|
const isActive = item.id === activeTabId;
|
|
30
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' }));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { ReactElement, HTMLAttributeAnchorTarget } from 'react';
|
|
2
2
|
import { ButtonPixel, CardBaseProps as CardBaseParams, ImageProps, MetrikaGoal, WithChildren } from '../../models';
|
|
3
|
-
import { AnalyticsEvent } from '../../models/common';
|
|
4
3
|
import './CardBase.css';
|
|
5
4
|
export interface CardBaseProps extends CardBaseParams {
|
|
6
5
|
className?: string;
|
|
@@ -11,8 +10,6 @@ export interface CardBaseProps extends CardBaseParams {
|
|
|
11
10
|
target?: HTMLAttributeAnchorTarget;
|
|
12
11
|
metrikaGoals?: MetrikaGoal;
|
|
13
12
|
pixelEvents?: ButtonPixel;
|
|
14
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
15
|
-
blockName?: string;
|
|
16
13
|
}
|
|
17
14
|
export interface CardHeaderBaseProps {
|
|
18
15
|
className?: string;
|