@gravity-ui/page-constructor 1.15.0-alpha.2 → 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 +110 -5
- package/build/cjs/blocks/Banner/schema.d.ts +27 -0
- package/build/cjs/blocks/Banner/schema.js +3 -1
- package/build/cjs/blocks/CardLayout/schema.d.ts +6 -0
- package/build/cjs/blocks/ContentLayout/schema.d.ts +3 -0
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +3 -0
- package/build/cjs/blocks/Header/schema.d.ts +159 -0
- package/build/cjs/blocks/Header/schema.js +4 -0
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +81 -0
- package/build/cjs/blocks/Icons/schema.d.ts +6 -0
- package/build/cjs/blocks/Info/schema.d.ts +3 -0
- package/build/cjs/blocks/Info/schema.js +2 -0
- package/build/cjs/blocks/LinkTable/schema.d.ts +3 -0
- package/build/cjs/blocks/Media/schema.d.ts +9 -0
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +2 -1
- package/build/cjs/blocks/Preview/schema.d.ts +3 -0
- package/build/cjs/blocks/Preview/schema.js +3 -1
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
- package/build/cjs/blocks/Questions/schema.d.ts +3 -0
- package/build/cjs/blocks/Security/schema.d.ts +3 -0
- package/build/cjs/blocks/Security/schema.js +3 -1
- package/build/cjs/blocks/Share/Share.js +12 -1
- package/build/cjs/blocks/Simple/schema.d.ts +3 -0
- package/build/cjs/blocks/Slider/schema.d.ts +3 -0
- package/build/cjs/blocks/Table/schema.d.ts +3 -0
- package/build/cjs/blocks/Tabs/schema.d.ts +3 -0
- package/build/cjs/components/BackLink/BackLink.d.ts +1 -0
- package/build/cjs/components/BackLink/BackLink.js +12 -2
- package/build/cjs/components/Button/Button.d.ts +1 -0
- package/build/cjs/components/Button/Button.js +15 -2
- package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +1 -0
- package/build/cjs/components/CardBase/CardBase.d.ts +1 -0
- package/build/cjs/components/CardBase/CardBase.js +11 -2
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +0 -30
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +3 -11
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.css +30 -0
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.d.ts +12 -0
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.js +28 -0
- package/build/cjs/components/Link/Link.js +11 -2
- package/build/cjs/components/Media/Video/Video.js +1 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +21 -25
- package/build/cjs/components/YandexForm/YandexForm.d.ts +1 -0
- package/build/cjs/components/YandexForm/YandexForm.js +11 -3
- package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +5 -4
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +2 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +4 -2
- package/build/cjs/context/analyticsContext/analyticsContext.d.ts +2 -1
- package/build/cjs/context/blockPositionContext/blockPositionContext.d.ts +3 -0
- package/build/cjs/context/blockPositionContext/blockPositionContext.js +6 -0
- package/build/cjs/context/blockPositionContext/index.d.ts +1 -0
- package/build/cjs/context/blockPositionContext/index.js +4 -0
- package/build/cjs/hooks/useAnalytics.d.ts +1 -1
- package/build/cjs/hooks/useAnalytics.js +13 -7
- package/build/cjs/models/common.d.ts +7 -4
- package/build/cjs/models/common.js +7 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +10 -0
- package/build/cjs/models/constructor-items/common.d.ts +9 -4
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +4 -1
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +3 -2
- package/build/cjs/schema/validators/common.d.ts +15 -0
- package/build/cjs/schema/validators/common.js +2 -0
- package/build/cjs/schema/validators/event.d.ts +3 -0
- package/build/cjs/schema/validators/event.js +3 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +3 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +2 -0
- package/build/cjs/sub-blocks/HubspotForm/index.js +10 -2
- package/build/cjs/sub-blocks/Quote/Quote.js +12 -1
- package/build/cjs/sub-blocks/Quote/schema.d.ts +3 -0
- package/build/cjs/sub-blocks/Quote/schema.js +3 -1
- package/build/cjs/utils/blocks.d.ts +7 -0
- package/build/cjs/utils/blocks.js +5 -1
- package/build/esm/blocks/Banner/schema.d.ts +27 -0
- package/build/esm/blocks/Banner/schema.js +3 -1
- package/build/esm/blocks/CardLayout/schema.d.ts +6 -0
- package/build/esm/blocks/ContentLayout/schema.d.ts +3 -0
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +3 -0
- package/build/esm/blocks/Header/schema.d.ts +159 -0
- package/build/esm/blocks/Header/schema.js +4 -0
- package/build/esm/blocks/HeaderSlider/schema.d.ts +81 -0
- package/build/esm/blocks/Icons/schema.d.ts +6 -0
- package/build/esm/blocks/Info/schema.d.ts +3 -0
- package/build/esm/blocks/Info/schema.js +2 -0
- package/build/esm/blocks/LinkTable/schema.d.ts +3 -0
- package/build/esm/blocks/Media/schema.d.ts +9 -0
- package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +2 -1
- package/build/esm/blocks/Preview/schema.d.ts +3 -0
- package/build/esm/blocks/Preview/schema.js +3 -1
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +3 -0
- package/build/esm/blocks/Questions/schema.d.ts +3 -0
- package/build/esm/blocks/Security/schema.d.ts +3 -0
- package/build/esm/blocks/Security/schema.js +3 -1
- package/build/esm/blocks/Share/Share.js +13 -2
- package/build/esm/blocks/Simple/schema.d.ts +3 -0
- package/build/esm/blocks/Slider/schema.d.ts +3 -0
- package/build/esm/blocks/Table/schema.d.ts +3 -0
- package/build/esm/blocks/Tabs/schema.d.ts +3 -0
- package/build/esm/components/BackLink/BackLink.d.ts +1 -0
- package/build/esm/components/BackLink/BackLink.js +12 -2
- package/build/esm/components/Button/Button.d.ts +1 -0
- package/build/esm/components/Button/Button.js +16 -3
- package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +1 -0
- package/build/esm/components/CardBase/CardBase.d.ts +1 -0
- package/build/esm/components/CardBase/CardBase.js +12 -3
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +0 -30
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +3 -11
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.css +30 -0
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.d.ts +13 -0
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.js +25 -0
- package/build/esm/components/Link/Link.js +12 -3
- package/build/esm/components/Media/Video/Video.js +1 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.js +22 -26
- package/build/esm/components/YandexForm/YandexForm.d.ts +1 -0
- package/build/esm/components/YandexForm/YandexForm.js +12 -4
- package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +6 -5
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +2 -1
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +4 -2
- package/build/esm/context/analyticsContext/analyticsContext.d.ts +2 -1
- package/build/esm/context/blockPositionContext/blockPositionContext.d.ts +3 -0
- package/build/esm/context/blockPositionContext/blockPositionContext.js +2 -0
- package/build/esm/context/blockPositionContext/index.d.ts +1 -0
- package/build/esm/context/blockPositionContext/index.js +1 -0
- package/build/esm/hooks/useAnalytics.d.ts +1 -1
- package/build/esm/hooks/useAnalytics.js +13 -7
- package/build/esm/models/common.d.ts +7 -4
- package/build/esm/models/common.js +6 -0
- package/build/esm/models/constructor-items/blocks.d.ts +10 -0
- package/build/esm/models/constructor-items/common.d.ts +9 -4
- package/build/esm/models/constructor-items/sub-blocks.d.ts +4 -1
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +3 -2
- package/build/esm/schema/validators/common.d.ts +15 -0
- package/build/esm/schema/validators/common.js +2 -0
- package/build/esm/schema/validators/event.d.ts +3 -0
- package/build/esm/schema/validators/event.js +3 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +3 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.js +2 -0
- package/build/esm/sub-blocks/HubspotForm/index.js +10 -2
- package/build/esm/sub-blocks/Quote/Quote.js +14 -3
- package/build/esm/sub-blocks/Quote/schema.d.ts +3 -0
- package/build/esm/sub-blocks/Quote/schema.js +3 -1
- package/build/esm/utils/blocks.d.ts +7 -0
- package/build/esm/utils/blocks.js +3 -0
- package/package.json +1 -1
- package/server/models/common.d.ts +7 -4
- package/server/models/common.js +7 -1
- package/server/models/constructor-items/blocks.d.ts +10 -0
- package/server/models/constructor-items/common.d.ts +9 -4
- package/server/models/constructor-items/sub-blocks.d.ts +4 -1
- package/server/utils/blocks.d.ts +7 -0
- package/server/utils/blocks.js +5 -1
package/README.md
CHANGED
|
@@ -43,7 +43,8 @@ interface PageConstructorProviderProps {
|
|
|
43
43
|
isMobile?: boolean; //A flag indicating that the code is executed in mobile mode.
|
|
44
44
|
locale?: LocaleContextProps; //Info about the language and domain (used when generating and formatting links).
|
|
45
45
|
location?: Location; //API of the browser or router history, the page URL.
|
|
46
|
-
|
|
46
|
+
analytics?: AnalyticsContextProps; // function to handle analytics event
|
|
47
|
+
|
|
47
48
|
ssrConfig?: SSR; //A flag indicating that the code is run on the server size.
|
|
48
49
|
theme?: 'light' | 'dark'; //Theme to render the page with.
|
|
49
50
|
}
|
|
@@ -81,10 +82,17 @@ interface SSR {
|
|
|
81
82
|
isServer?: boolean;
|
|
82
83
|
}
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
85
|
+
type AnalyticsCounters = {
|
|
86
|
+
include?: string[];
|
|
87
|
+
exclude?: string[];
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
type AnalyticsEvent<T = {}> = T & {
|
|
91
|
+
name: string;
|
|
92
|
+
type?: string;
|
|
93
|
+
counters?: AnalyticsCounters;
|
|
94
|
+
context?: string;
|
|
95
|
+
};
|
|
88
96
|
|
|
89
97
|
interface NavigationData {
|
|
90
98
|
logo: NavigationLogo;
|
|
@@ -211,6 +219,103 @@ import {configure, Lang} from '@gravity-ui/page-constructor';
|
|
|
211
219
|
configure({lang: Lang.En});
|
|
212
220
|
```
|
|
213
221
|
|
|
222
|
+
### Analytics
|
|
223
|
+
|
|
224
|
+
#### Init
|
|
225
|
+
|
|
226
|
+
To start using any analytics, pass a handler to the constructor. The handler must be created on a project side. The handler will receive the `default` and `custom` event objects. The passed handler will be fired on a button, link, navigation, and control clicks. As one handler is used for all events treatment, pay attention to how to treat different events while creating the handler. There are predefined fields that serve to help you to build complex logic.
|
|
227
|
+
|
|
228
|
+
Pass `autoEvents: true` to constructor to fire automatically configured events.
|
|
229
|
+
|
|
230
|
+
```ts
|
|
231
|
+
function sendEvents(events: MyEventType []) {
|
|
232
|
+
...
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
<PageConstructorProvider
|
|
236
|
+
...
|
|
237
|
+
|
|
238
|
+
analytics={{sendEvents, autoEvents: true}}
|
|
239
|
+
|
|
240
|
+
...
|
|
241
|
+
/>
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
An event object has only one required field - `name`. It also has predefined fields, which serve to help manage complex logic. For example, `counter.include` can help to send event in a particular counter if several analytics systems are used in a project.
|
|
245
|
+
|
|
246
|
+
```ts
|
|
247
|
+
type AnalyticsCounters = {
|
|
248
|
+
include?: string[];
|
|
249
|
+
exclude?: string[];
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
type AnalyticsEvent<T = {}> = T & {
|
|
253
|
+
name: string;
|
|
254
|
+
type?: string;
|
|
255
|
+
counters?: AnalyticsCounters;
|
|
256
|
+
context?: string;
|
|
257
|
+
};
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
It is possible to configure an event type needed for a project.
|
|
261
|
+
|
|
262
|
+
```ts
|
|
263
|
+
type MyEventType = AnalyticsEvent<{
|
|
264
|
+
anyParameterName?: string; // only a 'string' type is supported
|
|
265
|
+
}>;
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
#### Counter selector
|
|
269
|
+
|
|
270
|
+
It is possible to configure an event to which an analytics system to sent.
|
|
271
|
+
|
|
272
|
+
```ts
|
|
273
|
+
type AnalyticsCounters = {
|
|
274
|
+
include?: string[];
|
|
275
|
+
exclude?: string[];
|
|
276
|
+
};
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
#### context parameter
|
|
280
|
+
|
|
281
|
+
Pass `context` value to define place in a project where an event is fired.
|
|
282
|
+
|
|
283
|
+
Use selector below or create logic that serves project needs.
|
|
284
|
+
|
|
285
|
+
```ts
|
|
286
|
+
// utils.ts
|
|
287
|
+
const isCounterAllowed = (counter: Counter, counters?: AnalyticsCounters) => {
|
|
288
|
+
if (!counters) {
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (counters.exclude?.includes(counter)) {
|
|
293
|
+
return false;
|
|
294
|
+
} else if (counters.include?.includes(counter)) {
|
|
295
|
+
return true;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return false;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
// analyticsHandler.ts
|
|
302
|
+
if (isCounterAllowed(counterName, counters)) {
|
|
303
|
+
analyticsCounter.reachGoal(counterName, name, parameters);
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
#### Reserved event types
|
|
308
|
+
|
|
309
|
+
Several predefined event types are used to mark automatically configured events. Use the types to filter default events, for example.
|
|
310
|
+
|
|
311
|
+
```ts
|
|
312
|
+
enum PredefinedEventTypes {
|
|
313
|
+
Default = 'default-event', // default events which fire on every button click
|
|
314
|
+
Play = 'play', // React player event
|
|
315
|
+
Stop = 'stop', // React player event
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
214
319
|
## Development
|
|
215
320
|
|
|
216
321
|
```bash
|
|
@@ -206,6 +206,9 @@ export declare const BannerCardProps: {
|
|
|
206
206
|
};
|
|
207
207
|
};
|
|
208
208
|
};
|
|
209
|
+
context: {
|
|
210
|
+
type: string;
|
|
211
|
+
};
|
|
209
212
|
};
|
|
210
213
|
} | {
|
|
211
214
|
type: string;
|
|
@@ -241,6 +244,9 @@ export declare const BannerCardProps: {
|
|
|
241
244
|
};
|
|
242
245
|
};
|
|
243
246
|
};
|
|
247
|
+
context: {
|
|
248
|
+
type: string;
|
|
249
|
+
};
|
|
244
250
|
};
|
|
245
251
|
};
|
|
246
252
|
})[];
|
|
@@ -264,6 +270,9 @@ export declare const BannerCardProps: {
|
|
|
264
270
|
required: string[];
|
|
265
271
|
};
|
|
266
272
|
};
|
|
273
|
+
context: {
|
|
274
|
+
type: string;
|
|
275
|
+
};
|
|
267
276
|
animated: {
|
|
268
277
|
type: string;
|
|
269
278
|
};
|
|
@@ -480,6 +489,9 @@ export declare const BannerBlock: {
|
|
|
480
489
|
};
|
|
481
490
|
};
|
|
482
491
|
};
|
|
492
|
+
context: {
|
|
493
|
+
type: string;
|
|
494
|
+
};
|
|
483
495
|
};
|
|
484
496
|
} | {
|
|
485
497
|
type: string;
|
|
@@ -515,6 +527,9 @@ export declare const BannerBlock: {
|
|
|
515
527
|
};
|
|
516
528
|
};
|
|
517
529
|
};
|
|
530
|
+
context: {
|
|
531
|
+
type: string;
|
|
532
|
+
};
|
|
518
533
|
};
|
|
519
534
|
};
|
|
520
535
|
})[];
|
|
@@ -538,6 +553,9 @@ export declare const BannerBlock: {
|
|
|
538
553
|
required: string[];
|
|
539
554
|
};
|
|
540
555
|
};
|
|
556
|
+
context: {
|
|
557
|
+
type: string;
|
|
558
|
+
};
|
|
541
559
|
animated: {
|
|
542
560
|
type: string;
|
|
543
561
|
};
|
|
@@ -755,6 +773,9 @@ export declare const BannerCard: {
|
|
|
755
773
|
};
|
|
756
774
|
};
|
|
757
775
|
};
|
|
776
|
+
context: {
|
|
777
|
+
type: string;
|
|
778
|
+
};
|
|
758
779
|
};
|
|
759
780
|
} | {
|
|
760
781
|
type: string;
|
|
@@ -790,6 +811,9 @@ export declare const BannerCard: {
|
|
|
790
811
|
};
|
|
791
812
|
};
|
|
792
813
|
};
|
|
814
|
+
context: {
|
|
815
|
+
type: string;
|
|
816
|
+
};
|
|
793
817
|
};
|
|
794
818
|
};
|
|
795
819
|
})[];
|
|
@@ -813,6 +837,9 @@ export declare const BannerCard: {
|
|
|
813
837
|
required: string[];
|
|
814
838
|
};
|
|
815
839
|
};
|
|
840
|
+
context: {
|
|
841
|
+
type: string;
|
|
842
|
+
};
|
|
816
843
|
animated: {
|
|
817
844
|
type: string;
|
|
818
845
|
};
|
|
@@ -20,7 +20,9 @@ exports.BannerCardProps = {
|
|
|
20
20
|
}), theme: common_1.ThemeProps, width: {
|
|
21
21
|
type: 'string',
|
|
22
22
|
enum: ['s', 'm', 'l'],
|
|
23
|
-
}, button: common_1.ButtonBlock
|
|
23
|
+
}, button: common_1.ButtonBlock, context: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
} }),
|
|
24
26
|
};
|
|
25
27
|
exports.BannerBlock = {
|
|
26
28
|
'banner-block': exports.BannerCardProps,
|
|
@@ -66,6 +66,9 @@ export declare const CardLayoutProps: {
|
|
|
66
66
|
resetPaddings: {
|
|
67
67
|
type: string;
|
|
68
68
|
};
|
|
69
|
+
context: {
|
|
70
|
+
type: string;
|
|
71
|
+
};
|
|
69
72
|
type: {};
|
|
70
73
|
when: {};
|
|
71
74
|
};
|
|
@@ -139,6 +142,9 @@ export declare const CardLayoutBlock: {
|
|
|
139
142
|
resetPaddings: {
|
|
140
143
|
type: string;
|
|
141
144
|
};
|
|
145
|
+
context: {
|
|
146
|
+
type: string;
|
|
147
|
+
};
|
|
142
148
|
type: {};
|
|
143
149
|
when: {};
|
|
144
150
|
};
|
|
@@ -274,6 +274,84 @@ export declare const HeaderProperties: {
|
|
|
274
274
|
type: string;
|
|
275
275
|
contentType: string;
|
|
276
276
|
};
|
|
277
|
+
analyticsEvents: {
|
|
278
|
+
anyOf: ({
|
|
279
|
+
type: string;
|
|
280
|
+
additionalProperties: {
|
|
281
|
+
type: string;
|
|
282
|
+
};
|
|
283
|
+
required: string[];
|
|
284
|
+
properties: {
|
|
285
|
+
name: {
|
|
286
|
+
type: string;
|
|
287
|
+
};
|
|
288
|
+
type: {
|
|
289
|
+
type: string;
|
|
290
|
+
};
|
|
291
|
+
counters: {
|
|
292
|
+
type: string;
|
|
293
|
+
additionalProperties: boolean;
|
|
294
|
+
required: never[];
|
|
295
|
+
properties: {
|
|
296
|
+
include: {
|
|
297
|
+
type: string;
|
|
298
|
+
items: {
|
|
299
|
+
type: string;
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
exclude: {
|
|
303
|
+
type: string;
|
|
304
|
+
items: {
|
|
305
|
+
type: string;
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
context: {
|
|
311
|
+
type: string;
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
} | {
|
|
315
|
+
type: string;
|
|
316
|
+
items: {
|
|
317
|
+
type: string;
|
|
318
|
+
additionalProperties: {
|
|
319
|
+
type: string;
|
|
320
|
+
};
|
|
321
|
+
required: string[];
|
|
322
|
+
properties: {
|
|
323
|
+
name: {
|
|
324
|
+
type: string;
|
|
325
|
+
};
|
|
326
|
+
type: {
|
|
327
|
+
type: string;
|
|
328
|
+
};
|
|
329
|
+
counters: {
|
|
330
|
+
type: string;
|
|
331
|
+
additionalProperties: boolean;
|
|
332
|
+
required: never[];
|
|
333
|
+
properties: {
|
|
334
|
+
include: {
|
|
335
|
+
type: string;
|
|
336
|
+
items: {
|
|
337
|
+
type: string;
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
exclude: {
|
|
341
|
+
type: string;
|
|
342
|
+
items: {
|
|
343
|
+
type: string;
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
context: {
|
|
349
|
+
type: string;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
})[];
|
|
354
|
+
};
|
|
277
355
|
};
|
|
278
356
|
};
|
|
279
357
|
imageSize: {
|
|
@@ -607,6 +685,84 @@ export declare const HeaderBlock: {
|
|
|
607
685
|
type: string;
|
|
608
686
|
contentType: string;
|
|
609
687
|
};
|
|
688
|
+
analyticsEvents: {
|
|
689
|
+
anyOf: ({
|
|
690
|
+
type: string;
|
|
691
|
+
additionalProperties: {
|
|
692
|
+
type: string;
|
|
693
|
+
};
|
|
694
|
+
required: string[];
|
|
695
|
+
properties: {
|
|
696
|
+
name: {
|
|
697
|
+
type: string;
|
|
698
|
+
};
|
|
699
|
+
type: {
|
|
700
|
+
type: string;
|
|
701
|
+
};
|
|
702
|
+
counters: {
|
|
703
|
+
type: string;
|
|
704
|
+
additionalProperties: boolean;
|
|
705
|
+
required: never[];
|
|
706
|
+
properties: {
|
|
707
|
+
include: {
|
|
708
|
+
type: string;
|
|
709
|
+
items: {
|
|
710
|
+
type: string;
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
exclude: {
|
|
714
|
+
type: string;
|
|
715
|
+
items: {
|
|
716
|
+
type: string;
|
|
717
|
+
};
|
|
718
|
+
};
|
|
719
|
+
};
|
|
720
|
+
};
|
|
721
|
+
context: {
|
|
722
|
+
type: string;
|
|
723
|
+
};
|
|
724
|
+
};
|
|
725
|
+
} | {
|
|
726
|
+
type: string;
|
|
727
|
+
items: {
|
|
728
|
+
type: string;
|
|
729
|
+
additionalProperties: {
|
|
730
|
+
type: string;
|
|
731
|
+
};
|
|
732
|
+
required: string[];
|
|
733
|
+
properties: {
|
|
734
|
+
name: {
|
|
735
|
+
type: string;
|
|
736
|
+
};
|
|
737
|
+
type: {
|
|
738
|
+
type: string;
|
|
739
|
+
};
|
|
740
|
+
counters: {
|
|
741
|
+
type: string;
|
|
742
|
+
additionalProperties: boolean;
|
|
743
|
+
required: never[];
|
|
744
|
+
properties: {
|
|
745
|
+
include: {
|
|
746
|
+
type: string;
|
|
747
|
+
items: {
|
|
748
|
+
type: string;
|
|
749
|
+
};
|
|
750
|
+
};
|
|
751
|
+
exclude: {
|
|
752
|
+
type: string;
|
|
753
|
+
items: {
|
|
754
|
+
type: string;
|
|
755
|
+
};
|
|
756
|
+
};
|
|
757
|
+
};
|
|
758
|
+
};
|
|
759
|
+
context: {
|
|
760
|
+
type: string;
|
|
761
|
+
};
|
|
762
|
+
};
|
|
763
|
+
};
|
|
764
|
+
})[];
|
|
765
|
+
};
|
|
610
766
|
};
|
|
611
767
|
};
|
|
612
768
|
imageSize: {
|
|
@@ -821,6 +977,9 @@ export declare const HeaderBlock: {
|
|
|
821
977
|
resetPaddings: {
|
|
822
978
|
type: string;
|
|
823
979
|
};
|
|
980
|
+
context: {
|
|
981
|
+
type: string;
|
|
982
|
+
};
|
|
824
983
|
type: {};
|
|
825
984
|
when: {};
|
|
826
985
|
};
|
|
@@ -4,6 +4,7 @@ exports.HeaderBlock = exports.HeaderProperties = exports.HeaderBackgroundProps =
|
|
|
4
4
|
const common_1 = require("../../schema/validators/common");
|
|
5
5
|
const utils_1 = require("../../schema/validators/utils");
|
|
6
6
|
const schema_1 = require("../../components/Image/schema");
|
|
7
|
+
const event_1 = require("../../schema/validators/event");
|
|
7
8
|
exports.HeaderBackgroundProps = {
|
|
8
9
|
type: 'object',
|
|
9
10
|
additionalProperties: false,
|
|
@@ -45,6 +46,9 @@ exports.HeaderProperties = {
|
|
|
45
46
|
type: 'string',
|
|
46
47
|
contentType: 'text',
|
|
47
48
|
},
|
|
49
|
+
analyticsEvents: {
|
|
50
|
+
anyOf: [event_1.AnalyticsEventSchema, { type: 'array', items: event_1.AnalyticsEventSchema }],
|
|
51
|
+
},
|
|
48
52
|
},
|
|
49
53
|
},
|
|
50
54
|
imageSize: {
|
|
@@ -144,6 +144,84 @@ export declare const HeaderSliderBlock: {
|
|
|
144
144
|
type: string;
|
|
145
145
|
contentType: string;
|
|
146
146
|
};
|
|
147
|
+
analyticsEvents: {
|
|
148
|
+
anyOf: ({
|
|
149
|
+
type: string;
|
|
150
|
+
additionalProperties: {
|
|
151
|
+
type: string;
|
|
152
|
+
};
|
|
153
|
+
required: string[];
|
|
154
|
+
properties: {
|
|
155
|
+
name: {
|
|
156
|
+
type: string;
|
|
157
|
+
};
|
|
158
|
+
type: {
|
|
159
|
+
type: string;
|
|
160
|
+
};
|
|
161
|
+
counters: {
|
|
162
|
+
type: string;
|
|
163
|
+
additionalProperties: boolean;
|
|
164
|
+
required: never[];
|
|
165
|
+
properties: {
|
|
166
|
+
include: {
|
|
167
|
+
type: string;
|
|
168
|
+
items: {
|
|
169
|
+
type: string;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
exclude: {
|
|
173
|
+
type: string;
|
|
174
|
+
items: {
|
|
175
|
+
type: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
context: {
|
|
181
|
+
type: string;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
} | {
|
|
185
|
+
type: string;
|
|
186
|
+
items: {
|
|
187
|
+
type: string;
|
|
188
|
+
additionalProperties: {
|
|
189
|
+
type: string;
|
|
190
|
+
};
|
|
191
|
+
required: string[];
|
|
192
|
+
properties: {
|
|
193
|
+
name: {
|
|
194
|
+
type: string;
|
|
195
|
+
};
|
|
196
|
+
type: {
|
|
197
|
+
type: string;
|
|
198
|
+
};
|
|
199
|
+
counters: {
|
|
200
|
+
type: string;
|
|
201
|
+
additionalProperties: boolean;
|
|
202
|
+
required: never[];
|
|
203
|
+
properties: {
|
|
204
|
+
include: {
|
|
205
|
+
type: string;
|
|
206
|
+
items: {
|
|
207
|
+
type: string;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
exclude: {
|
|
211
|
+
type: string;
|
|
212
|
+
items: {
|
|
213
|
+
type: string;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
context: {
|
|
219
|
+
type: string;
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
})[];
|
|
224
|
+
};
|
|
147
225
|
};
|
|
148
226
|
};
|
|
149
227
|
imageSize: {
|
|
@@ -433,6 +511,9 @@ export declare const HeaderSliderBlock: {
|
|
|
433
511
|
resetPaddings: {
|
|
434
512
|
type: string;
|
|
435
513
|
};
|
|
514
|
+
context: {
|
|
515
|
+
type: string;
|
|
516
|
+
};
|
|
436
517
|
type: {};
|
|
437
518
|
when: {};
|
|
438
519
|
};
|
|
@@ -54,6 +54,9 @@ export declare const IconsProps: {
|
|
|
54
54
|
resetPaddings: {
|
|
55
55
|
type: string;
|
|
56
56
|
};
|
|
57
|
+
context: {
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
57
60
|
type: {};
|
|
58
61
|
when: {};
|
|
59
62
|
};
|
|
@@ -115,6 +118,9 @@ export declare const IconsBlock: {
|
|
|
115
118
|
resetPaddings: {
|
|
116
119
|
type: string;
|
|
117
120
|
};
|
|
121
|
+
context: {
|
|
122
|
+
type: string;
|
|
123
|
+
};
|
|
118
124
|
type: {};
|
|
119
125
|
when: {};
|
|
120
126
|
};
|
|
@@ -22,6 +22,8 @@ exports.InfoBlock = {
|
|
|
22
22
|
}), sectionsTitle: {
|
|
23
23
|
type: 'string',
|
|
24
24
|
contentType: 'text',
|
|
25
|
+
}, context: {
|
|
26
|
+
type: 'string',
|
|
25
27
|
}, buttons: (0, utils_1.filteredArray)(common_1.ButtonBlock), theme: common_1.ThemeProps, links: (0, utils_1.filteredArray)(common_1.LinkProps), leftContent: ContentProps, rightContent: ContentProps }),
|
|
26
28
|
},
|
|
27
29
|
};
|
|
@@ -459,6 +459,9 @@ export declare const MediaBlock: {
|
|
|
459
459
|
};
|
|
460
460
|
};
|
|
461
461
|
};
|
|
462
|
+
context: {
|
|
463
|
+
type: string;
|
|
464
|
+
};
|
|
462
465
|
};
|
|
463
466
|
} | {
|
|
464
467
|
type: string;
|
|
@@ -494,6 +497,9 @@ export declare const MediaBlock: {
|
|
|
494
497
|
};
|
|
495
498
|
};
|
|
496
499
|
};
|
|
500
|
+
context: {
|
|
501
|
+
type: string;
|
|
502
|
+
};
|
|
497
503
|
};
|
|
498
504
|
};
|
|
499
505
|
})[];
|
|
@@ -597,6 +603,9 @@ export declare const MediaBlock: {
|
|
|
597
603
|
resetPaddings: {
|
|
598
604
|
type: string;
|
|
599
605
|
};
|
|
606
|
+
context: {
|
|
607
|
+
type: string;
|
|
608
|
+
};
|
|
600
609
|
type: {};
|
|
601
610
|
when: {};
|
|
602
611
|
};
|
|
@@ -8,6 +8,7 @@ interface MediaContentProps extends Refable<HTMLDivElement> {
|
|
|
8
8
|
switching: boolean;
|
|
9
9
|
isActiveBlock: (id: number, isMediaBlock?: boolean) => boolean;
|
|
10
10
|
showMediaContent: (id: number) => void;
|
|
11
|
+
context?: string;
|
|
11
12
|
}
|
|
12
|
-
declare const MediaContent: React.ForwardRefExoticComponent<Pick<MediaContentProps, "title" | "items" | "description" | "ratioMediaContent" | "switching" | "isActiveBlock" | "showMediaContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const MediaContent: React.ForwardRefExoticComponent<Pick<MediaContentProps, "title" | "context" | "items" | "description" | "ratioMediaContent" | "switching" | "isActiveBlock" | "showMediaContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
14
|
export default MediaContent;
|
|
@@ -48,6 +48,8 @@ exports.PreviewBlock = {
|
|
|
48
48
|
}, ratioMediaContent: {
|
|
49
49
|
type: 'string',
|
|
50
50
|
enum: previewRatioMediaContent,
|
|
51
|
-
}, items: (0, utils_1.filteredArray)(PreviewItem)
|
|
51
|
+
}, items: (0, utils_1.filteredArray)(PreviewItem), context: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
} }),
|
|
52
54
|
},
|
|
53
55
|
};
|