diff --git a/src/models/constructor-items/sub-blocks.ts b/src/models/constructor-items/sub-blocks.ts index 101e48378..75ddfb11a 100644 --- a/src/models/constructor-items/sub-blocks.ts +++ b/src/models/constructor-items/sub-blocks.ts @@ -130,7 +130,7 @@ export interface BannerCardProps { export interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {} -export interface LayoutItemProps extends ClassNameProps { +export interface LayoutItemProps extends ClassNameProps, AnalyticsEventsBase { content: Omit; media: MediaProps; metaInfo?: string[]; diff --git a/src/sub-blocks/LayoutItem/LayoutItem.tsx b/src/sub-blocks/LayoutItem/LayoutItem.tsx index 24bf6a706..7fdfe3bc7 100644 --- a/src/sub-blocks/LayoutItem/LayoutItem.tsx +++ b/src/sub-blocks/LayoutItem/LayoutItem.tsx @@ -18,6 +18,7 @@ const LayoutItem = ({ border, fullscreen, className, + analyticsEvents, }: LayoutItemProps) => (
{fullscreen && hasFullscreen(media) ? ( @@ -31,11 +32,12 @@ const LayoutItem = ({ {...media} {...fullscreenMediaProps} className={b('media', {border}, mediaClassName)} + analyticsEvents={analyticsEvents} /> )} ) : ( - + )} {metaInfo && }
diff --git a/src/sub-blocks/LayoutItem/schema.ts b/src/sub-blocks/LayoutItem/schema.ts index 31ef2466f..7f254bbb4 100644 --- a/src/sub-blocks/LayoutItem/schema.ts +++ b/src/sub-blocks/LayoutItem/schema.ts @@ -2,6 +2,7 @@ import {omit} from 'lodash'; import metaInfo from '../../components/MetaInfo/schema'; import {BaseProps, MediaProps} from '../../schema/validators/common'; +import {AnalyticsEventSchema} from '../../schema/validators/event'; import {ContentBase} from '../../sub-blocks/Content/schema'; export const LayoutItem = { @@ -19,5 +20,18 @@ export const LayoutItem = { fullscreen: { type: 'boolean', }, + analyticsEvents: { + oneOf: [ + { + ...AnalyticsEventSchema, + optionName: 'single', + }, + { + type: 'array', + items: AnalyticsEventSchema, + optionName: 'list', + }, + ], + }, }, };