@gravity-ui/page-constructor 1.14.0-alpha.4 → 1.14.0-alpha.6
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 +0 -7
- package/build/cjs/blocks/Banner/schema.d.ts +312 -0
- package/build/cjs/blocks/Media/schema.d.ts +104 -0
- package/build/cjs/components/Button/Button.js +5 -2
- package/build/cjs/components/CardBase/CardBase.d.ts +2 -0
- package/build/cjs/components/CardBase/CardBase.js +4 -1
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +4 -1
- package/build/cjs/components/Link/Link.js +4 -1
- package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -0
- package/build/cjs/components/YandexForm/YandexForm.js +13 -2
- package/build/cjs/containers/PageConstructor/Provider.d.ts +2 -0
- package/build/cjs/containers/PageConstructor/Provider.js +3 -1
- package/build/cjs/context/analyticsContext/analyticsContext.d.ts +6 -0
- package/build/cjs/context/analyticsContext/analyticsContext.js +6 -0
- package/build/cjs/context/analyticsContext/index.d.ts +1 -0
- package/build/cjs/{schema/validators/navigation.js → context/analyticsContext/index.js} +1 -1
- package/build/cjs/context/metrikaContext/metrikaContext.d.ts +6 -0
- package/build/cjs/hooks/useAnalytics.d.ts +2 -0
- package/build/cjs/hooks/useAnalytics.js +15 -0
- package/build/cjs/hooks/useMetrika.d.ts +6 -0
- package/build/cjs/hooks/useMetrika.js +8 -0
- package/build/cjs/models/common.d.ts +30 -0
- package/build/cjs/models/common.js +3 -0
- package/build/cjs/models/constructor-items/common.d.ts +4 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -1
- package/build/cjs/models/navigation.d.ts +3 -1
- package/build/cjs/navigation/components/Header/Header.css +3 -5
- package/build/cjs/navigation/components/Logo/Logo.css +6 -5
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +0 -1
- package/build/cjs/schema/index.d.ts +0 -111
- package/build/cjs/schema/index.js +1 -2
- package/build/cjs/schema/validators/common.d.ts +220 -0
- package/build/cjs/schema/validators/common.js +10 -0
- package/build/cjs/schema/validators/event.d.ts +50 -0
- package/build/cjs/schema/validators/event.js +53 -0
- package/build/cjs/schema/validators/index.d.ts +0 -2
- package/build/cjs/schema/validators/index.js +0 -2
- package/build/cjs/sub-blocks/HubspotForm/index.js +14 -2
- package/build/esm/blocks/Banner/schema.d.ts +312 -0
- package/build/esm/blocks/Media/schema.d.ts +104 -0
- package/build/esm/components/Button/Button.js +5 -2
- package/build/esm/components/CardBase/CardBase.d.ts +2 -0
- package/build/esm/components/CardBase/CardBase.js +4 -1
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +4 -1
- package/build/esm/components/Link/Link.js +4 -1
- package/build/esm/components/YandexForm/YandexForm.d.ts +2 -0
- package/build/esm/components/YandexForm/YandexForm.js +13 -2
- package/build/esm/containers/PageConstructor/Provider.d.ts +2 -0
- package/build/esm/containers/PageConstructor/Provider.js +3 -1
- package/build/esm/context/analyticsContext/analyticsContext.d.ts +6 -0
- package/build/esm/context/analyticsContext/analyticsContext.js +2 -0
- package/build/esm/context/analyticsContext/index.d.ts +1 -0
- package/build/esm/context/analyticsContext/index.js +1 -0
- package/build/esm/context/metrikaContext/metrikaContext.d.ts +6 -0
- package/build/esm/hooks/useAnalytics.d.ts +2 -0
- package/build/esm/hooks/useAnalytics.js +11 -0
- package/build/esm/hooks/useMetrika.d.ts +6 -0
- package/build/esm/hooks/useMetrika.js +8 -0
- package/build/esm/models/common.d.ts +30 -0
- package/build/esm/models/common.js +3 -0
- package/build/esm/models/constructor-items/common.d.ts +4 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -1
- package/build/esm/models/navigation.d.ts +3 -1
- package/build/esm/navigation/components/Header/Header.css +3 -5
- package/build/esm/navigation/components/Logo/Logo.css +6 -5
- package/build/esm/navigation/components/NavigationItem/NavigationItem.css +0 -1
- package/build/esm/schema/index.d.ts +0 -111
- package/build/esm/schema/index.js +1 -2
- package/build/esm/schema/validators/common.d.ts +220 -0
- package/build/esm/schema/validators/common.js +10 -0
- package/build/esm/schema/validators/event.d.ts +50 -0
- package/build/esm/schema/validators/event.js +50 -0
- package/build/esm/schema/validators/index.d.ts +0 -2
- package/build/esm/schema/validators/index.js +0 -2
- package/build/esm/sub-blocks/HubspotForm/index.js +14 -2
- package/package.json +1 -1
- package/server/models/common.d.ts +30 -0
- package/server/models/common.js +3 -0
- package/server/models/constructor-items/common.d.ts +4 -1
- package/server/models/constructor-items/sub-blocks.d.ts +2 -1
- package/server/models/navigation.d.ts +3 -1
- package/build/cjs/navigation/schema.d.ts +0 -104
- package/build/cjs/navigation/schema.js +0 -78
- package/build/cjs/schema/validators/navigation.d.ts +0 -1
- package/build/esm/navigation/schema.d.ts +0 -104
- package/build/esm/navigation/schema.js +0 -75
- package/build/esm/schema/validators/navigation.d.ts +0 -1
- package/build/esm/schema/validators/navigation.js +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { pixelEvents } from './pixel';
|
|
2
2
|
import { Theme } from '../../models';
|
|
3
3
|
import { ImageProps, urlPattern } from '../../components/Image/schema';
|
|
4
|
+
import { AnalyticsEventSchema } from './event';
|
|
4
5
|
export const mediaDirection = ['media-content', 'content-media'];
|
|
5
6
|
export const textSize = ['s', 'm', 'l'];
|
|
6
7
|
export const containerSizesArray = ['sm', 'md', 'lg', 'xl', 'all'];
|
|
@@ -306,6 +307,9 @@ export const ButtonProps = {
|
|
|
306
307
|
},
|
|
307
308
|
],
|
|
308
309
|
},
|
|
310
|
+
/**
|
|
311
|
+
* @deprecated Metrika will be deleted
|
|
312
|
+
*/
|
|
309
313
|
metrikaGoals: {
|
|
310
314
|
anyOf: [
|
|
311
315
|
{ type: 'string' },
|
|
@@ -328,7 +332,13 @@ export const ButtonProps = {
|
|
|
328
332
|
},
|
|
329
333
|
],
|
|
330
334
|
},
|
|
335
|
+
/**
|
|
336
|
+
* @deprecated Pixel will be deleted
|
|
337
|
+
*/
|
|
331
338
|
pixelEvents,
|
|
339
|
+
events: {
|
|
340
|
+
anyOf: [AnalyticsEventSchema, { type: 'array', items: AnalyticsEventSchema }],
|
|
341
|
+
},
|
|
332
342
|
target: {
|
|
333
343
|
type: 'string',
|
|
334
344
|
enum: ['_self', '_blank', '_parent', '_top'],
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const AnalyticsEventSchema: {
|
|
2
|
+
type: string;
|
|
3
|
+
additionalProperties: boolean;
|
|
4
|
+
required: string[];
|
|
5
|
+
properties: {
|
|
6
|
+
name: {
|
|
7
|
+
type: string;
|
|
8
|
+
};
|
|
9
|
+
type: {
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
12
|
+
counters: {
|
|
13
|
+
type: string;
|
|
14
|
+
additionalProperties: boolean;
|
|
15
|
+
required: never[];
|
|
16
|
+
properties: {
|
|
17
|
+
include: {
|
|
18
|
+
type: string;
|
|
19
|
+
items: string;
|
|
20
|
+
};
|
|
21
|
+
exclude: {
|
|
22
|
+
type: string;
|
|
23
|
+
items: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
category: {
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
label: {
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
params: {
|
|
34
|
+
type: string;
|
|
35
|
+
items: {
|
|
36
|
+
type: string;
|
|
37
|
+
additionalProperties: boolean;
|
|
38
|
+
required: string[];
|
|
39
|
+
properties: {
|
|
40
|
+
key: {
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
value: {
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export const AnalyticsEventSchema = {
|
|
2
|
+
type: 'object',
|
|
3
|
+
additionalProperties: false,
|
|
4
|
+
required: ['name'],
|
|
5
|
+
properties: {
|
|
6
|
+
name: {
|
|
7
|
+
type: 'string',
|
|
8
|
+
},
|
|
9
|
+
type: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
},
|
|
12
|
+
counters: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
additionalProperties: false,
|
|
15
|
+
required: [],
|
|
16
|
+
properties: {
|
|
17
|
+
include: {
|
|
18
|
+
type: 'array',
|
|
19
|
+
items: 'string',
|
|
20
|
+
},
|
|
21
|
+
exclude: {
|
|
22
|
+
type: 'array',
|
|
23
|
+
items: 'string',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
category: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
},
|
|
33
|
+
params: {
|
|
34
|
+
type: 'array',
|
|
35
|
+
items: {
|
|
36
|
+
type: 'object',
|
|
37
|
+
additionalProperties: false,
|
|
38
|
+
required: ['key', 'value'],
|
|
39
|
+
properties: {
|
|
40
|
+
key: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
},
|
|
43
|
+
value: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -3,12 +3,10 @@ import * as common from './common';
|
|
|
3
3
|
import * as subBlocks from './sub-blocks';
|
|
4
4
|
import * as pixel from './pixel';
|
|
5
5
|
import * as utils from './utils';
|
|
6
|
-
import * as navigation from './navigation';
|
|
7
6
|
export declare const validators: {
|
|
8
7
|
blocks: typeof blocks;
|
|
9
8
|
common: typeof common;
|
|
10
9
|
subBlocks: typeof subBlocks;
|
|
11
10
|
pixel: typeof pixel;
|
|
12
11
|
utils: typeof utils;
|
|
13
|
-
navigation: typeof navigation;
|
|
14
12
|
};
|
|
@@ -3,12 +3,10 @@ import * as common from './common';
|
|
|
3
3
|
import * as subBlocks from './sub-blocks';
|
|
4
4
|
import * as pixel from './pixel';
|
|
5
5
|
import * as utils from './utils';
|
|
6
|
-
import * as navigation from './navigation';
|
|
7
6
|
export const validators = {
|
|
8
7
|
blocks,
|
|
9
8
|
common,
|
|
10
9
|
subBlocks,
|
|
11
10
|
pixel,
|
|
12
11
|
utils,
|
|
13
|
-
navigation,
|
|
14
12
|
};
|
|
@@ -5,13 +5,15 @@ import { MobileContext } from '../../context/mobileContext';
|
|
|
5
5
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
6
6
|
import { useHandleHubspotEvents } from '../../hooks';
|
|
7
7
|
import HubspotFormContainer from './HubspotFormContainer';
|
|
8
|
+
import { useAnalytics } from '../../hooks/useAnalytics';
|
|
8
9
|
import './HubspotForm.css';
|
|
9
10
|
const b = block('hubspot-form');
|
|
10
11
|
const HubspotForm = (props) => {
|
|
11
12
|
const { className, theme: themeProp, isMobile: isMobileProp, formId, formInstanceId, portalId, region, formClassName, pixelEvents,
|
|
12
13
|
// hubspotEvents, // TODO: decide how to handle them
|
|
13
|
-
onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, } = props;
|
|
14
|
+
analyticsEvents, onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, } = props;
|
|
14
15
|
const handleMetrika = useMetrika();
|
|
16
|
+
const handleAnalytics = useAnalytics();
|
|
15
17
|
const { themeValue } = useContext(ThemeValueContext);
|
|
16
18
|
const isMobileValue = useContext(MobileContext);
|
|
17
19
|
const theme = themeProp !== null && themeProp !== void 0 ? themeProp : themeValue;
|
|
@@ -22,9 +24,19 @@ const HubspotForm = (props) => {
|
|
|
22
24
|
onLoad,
|
|
23
25
|
onSubmit: (e) => {
|
|
24
26
|
handleMetrika === null || handleMetrika === void 0 ? void 0 : handleMetrika({ pixelEvents });
|
|
27
|
+
handleAnalytics(analyticsEvents);
|
|
25
28
|
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(e);
|
|
26
29
|
},
|
|
27
|
-
}), [
|
|
30
|
+
}), [
|
|
31
|
+
onBeforeLoad,
|
|
32
|
+
onBeforeSubmit,
|
|
33
|
+
onLoad,
|
|
34
|
+
handleMetrika,
|
|
35
|
+
pixelEvents,
|
|
36
|
+
handleAnalytics,
|
|
37
|
+
analyticsEvents,
|
|
38
|
+
onSubmit,
|
|
39
|
+
]);
|
|
28
40
|
useHandleHubspotEvents(handlers, formId);
|
|
29
41
|
return (React.createElement(HubspotFormContainer, { key: [formClassName, formId, formInstanceId, portalId, region].join(), className: b({ theme, mobile }, className), formClassName: formClassName, formId: formId, portalId: portalId, formInstanceId: formInstanceId, region: region }));
|
|
30
42
|
};
|
package/package.json
CHANGED
|
@@ -7,12 +7,21 @@ export declare enum Theme {
|
|
|
7
7
|
Light = "light",
|
|
8
8
|
Dark = "dark"
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Pixel will be deleted
|
|
12
|
+
*/
|
|
10
13
|
type PixelCommand = 'track' | 'trackCustom';
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Pixel will be deleted
|
|
16
|
+
*/
|
|
11
17
|
export interface PixelEvent {
|
|
12
18
|
command: PixelCommand;
|
|
13
19
|
event: PixelEventType | string;
|
|
14
20
|
data?: Object;
|
|
15
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Pixel will be deleted from package
|
|
24
|
+
*/
|
|
16
25
|
export declare enum PixelEventType {
|
|
17
26
|
AddPaymentInfo = "AddPaymentInfo",
|
|
18
27
|
AddToCart = "AddToCart",
|
|
@@ -36,11 +45,17 @@ export declare enum PixelEventType {
|
|
|
36
45
|
export type Modifiers = {
|
|
37
46
|
[name: string]: string | boolean | undefined;
|
|
38
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated Pixel will be deleted
|
|
50
|
+
*/
|
|
39
51
|
export interface Pixel<TEvent = string> {
|
|
40
52
|
trackStandard: (event: TEvent, data?: Object) => void;
|
|
41
53
|
trackCustom: (event: string, data?: Object) => void;
|
|
42
54
|
track: (trackEvents: string | string[] | PixelEvent[] | PixelEvent) => void;
|
|
43
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated Metrika will be deleted
|
|
58
|
+
*/
|
|
44
59
|
export interface Metrika {
|
|
45
60
|
reachGoal: (counterName: string, ...args: any) => void;
|
|
46
61
|
reachGoals: (goals: MetrikaGoal, counterName?: string) => void;
|
|
@@ -49,4 +64,19 @@ export interface ClassNameProps {
|
|
|
49
64
|
className?: string;
|
|
50
65
|
}
|
|
51
66
|
export type Timeout = ReturnType<typeof setTimeout> | undefined;
|
|
67
|
+
export type AnalyticsParameter = {
|
|
68
|
+
key: string;
|
|
69
|
+
value: string;
|
|
70
|
+
};
|
|
71
|
+
export type AnalyticsEvent = {
|
|
72
|
+
name: string;
|
|
73
|
+
type?: string;
|
|
74
|
+
counters?: {
|
|
75
|
+
include?: string[];
|
|
76
|
+
exclude?: string[];
|
|
77
|
+
};
|
|
78
|
+
category?: string;
|
|
79
|
+
label?: string;
|
|
80
|
+
params?: AnalyticsParameter[];
|
|
81
|
+
};
|
|
52
82
|
export {};
|
package/server/models/common.js
CHANGED
|
@@ -6,6 +6,9 @@ var Theme;
|
|
|
6
6
|
Theme["Light"] = "light";
|
|
7
7
|
Theme["Dark"] = "dark";
|
|
8
8
|
})(Theme = exports.Theme || (exports.Theme = {}));
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Pixel will be deleted from package
|
|
11
|
+
*/
|
|
9
12
|
var PixelEventType;
|
|
10
13
|
(function (PixelEventType) {
|
|
11
14
|
PixelEventType["AddPaymentInfo"] = "AddPaymentInfo";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ButtonSize, ButtonView } from '@gravity-ui/uikit';
|
|
3
3
|
import { ThemeSupporting } from '../../utils/theme';
|
|
4
|
-
import { ClassNameProps, PixelEventType } from '../common';
|
|
4
|
+
import { AnalyticsEvent, ClassNameProps, PixelEventType } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
7
7
|
Line = "line"
|
|
@@ -121,6 +121,7 @@ export interface LinkProps extends Stylable {
|
|
|
121
121
|
target?: string;
|
|
122
122
|
metrikaGoals?: MetrikaGoal;
|
|
123
123
|
pixelEvents?: ButtonPixel;
|
|
124
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
124
125
|
}
|
|
125
126
|
export interface FileLinkProps extends ClassNameProps {
|
|
126
127
|
href: string;
|
|
@@ -139,6 +140,7 @@ export interface ButtonProps {
|
|
|
139
140
|
img?: ButtonImageProps | string;
|
|
140
141
|
metrikaGoals?: MetrikaGoal;
|
|
141
142
|
pixelEvents?: ButtonPixel;
|
|
143
|
+
analyticsEvents?: AnalyticsEvent[];
|
|
142
144
|
target?: string;
|
|
143
145
|
}
|
|
144
146
|
export interface ButtonImageProps {
|
|
@@ -222,6 +224,7 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
|
|
|
222
224
|
theme?: TextTheme;
|
|
223
225
|
metrikaGoals?: MetrikaGoal;
|
|
224
226
|
pixelEvents?: ButtonPixel;
|
|
227
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
225
228
|
}
|
|
226
229
|
export interface PreviewContentItemProps {
|
|
227
230
|
title: string;
|
|
@@ -3,7 +3,7 @@ import { ThemeSupporting } from '../../utils';
|
|
|
3
3
|
import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
|
|
4
4
|
import { AuthorItem, ButtonPixel, ButtonProps, CardBaseProps, ContentTheme, DividerSize, ImageObjectProps, ImageProps, LinkProps, MediaProps, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
|
|
5
5
|
import { ContentBlockProps } from './blocks';
|
|
6
|
-
import { PixelEvent } from '../common';
|
|
6
|
+
import { AnalyticsEvent, PixelEvent } from '../common';
|
|
7
7
|
export declare enum SubBlockType {
|
|
8
8
|
Divider = "divider",
|
|
9
9
|
Quote = "quote",
|
|
@@ -61,6 +61,7 @@ export interface HubspotFormProps extends HubspotEventHandlers {
|
|
|
61
61
|
onLoad?: (arg: HubspotEventData) => void;
|
|
62
62
|
pixelEvents?: string | string[] | PixelEvent | PixelEvent[] | ButtonPixel;
|
|
63
63
|
hubspotEvents?: string[];
|
|
64
|
+
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
64
65
|
}
|
|
65
66
|
export interface PartnerProps extends CardBaseProps {
|
|
66
67
|
text: string;
|
|
@@ -11,7 +11,7 @@ export interface NavigationItemBase {
|
|
|
11
11
|
icon?: ImageProps;
|
|
12
12
|
url?: string;
|
|
13
13
|
}
|
|
14
|
-
export interface NavigationLinkItem extends
|
|
14
|
+
export interface NavigationLinkItem extends NavigationItemBase {
|
|
15
15
|
type: NavigationItemType.Link;
|
|
16
16
|
url: string;
|
|
17
17
|
arrow?: boolean;
|
|
@@ -19,6 +19,8 @@ export interface NavigationLinkItem extends Omit<NavigationItemBase, 'url'> {
|
|
|
19
19
|
}
|
|
20
20
|
export interface NavigationButtonItem extends ButtonProps {
|
|
21
21
|
type: NavigationItemType.Button;
|
|
22
|
+
url: string;
|
|
23
|
+
target?: string;
|
|
22
24
|
}
|
|
23
25
|
export interface NavigationDropdownItem extends NavigationItemBase {
|
|
24
26
|
type: NavigationItemType.Dropdown;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
export declare const LogoProps: {
|
|
2
|
-
type: string;
|
|
3
|
-
additionalProperties: boolean;
|
|
4
|
-
required: string[];
|
|
5
|
-
properties: {
|
|
6
|
-
icon: {
|
|
7
|
-
oneOf: ({
|
|
8
|
-
type: string;
|
|
9
|
-
properties: {
|
|
10
|
-
when: {
|
|
11
|
-
type: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
} | {
|
|
15
|
-
type: string;
|
|
16
|
-
pattern: string;
|
|
17
|
-
})[];
|
|
18
|
-
};
|
|
19
|
-
text: {
|
|
20
|
-
type: string;
|
|
21
|
-
contentType: string;
|
|
22
|
-
};
|
|
23
|
-
url: {
|
|
24
|
-
type: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export declare const NavigationHeaderProps: {
|
|
29
|
-
type: string;
|
|
30
|
-
additionalProperties: boolean;
|
|
31
|
-
required: string[];
|
|
32
|
-
properties: {
|
|
33
|
-
leftItems: {
|
|
34
|
-
oneOf: {
|
|
35
|
-
type: string;
|
|
36
|
-
additionalProperties: boolean;
|
|
37
|
-
required: string[];
|
|
38
|
-
properties: {
|
|
39
|
-
type: {
|
|
40
|
-
type: string;
|
|
41
|
-
enum: string[];
|
|
42
|
-
};
|
|
43
|
-
items: {
|
|
44
|
-
type: string;
|
|
45
|
-
items: {
|
|
46
|
-
type: string;
|
|
47
|
-
properties: {
|
|
48
|
-
when: {
|
|
49
|
-
type: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
text: {
|
|
55
|
-
type: string;
|
|
56
|
-
contentType: string;
|
|
57
|
-
};
|
|
58
|
-
url: {
|
|
59
|
-
type: string;
|
|
60
|
-
};
|
|
61
|
-
icon: {
|
|
62
|
-
type: string;
|
|
63
|
-
pattern: string;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
}[];
|
|
67
|
-
};
|
|
68
|
-
rightItems: {
|
|
69
|
-
oneOf: {
|
|
70
|
-
type: string;
|
|
71
|
-
additionalProperties: boolean;
|
|
72
|
-
required: string[];
|
|
73
|
-
properties: {
|
|
74
|
-
type: {
|
|
75
|
-
type: string;
|
|
76
|
-
enum: string[];
|
|
77
|
-
};
|
|
78
|
-
items: {
|
|
79
|
-
type: string;
|
|
80
|
-
items: {
|
|
81
|
-
type: string;
|
|
82
|
-
properties: {
|
|
83
|
-
when: {
|
|
84
|
-
type: string;
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
text: {
|
|
90
|
-
type: string;
|
|
91
|
-
contentType: string;
|
|
92
|
-
};
|
|
93
|
-
url: {
|
|
94
|
-
type: string;
|
|
95
|
-
};
|
|
96
|
-
icon: {
|
|
97
|
-
type: string;
|
|
98
|
-
pattern: string;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
}[];
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NavigationHeaderProps = exports.LogoProps = void 0;
|
|
4
|
-
const common_1 = require("../schema/validators/common");
|
|
5
|
-
const schema_1 = require("../components/Image/schema");
|
|
6
|
-
const lodash_1 = require("lodash");
|
|
7
|
-
const utils_1 = require("../schema/validators/utils");
|
|
8
|
-
const NavigationItemType = {
|
|
9
|
-
type: 'string',
|
|
10
|
-
enum: ['link', 'button', 'dropdown'],
|
|
11
|
-
};
|
|
12
|
-
exports.LogoProps = {
|
|
13
|
-
type: 'object',
|
|
14
|
-
additionalProperties: false,
|
|
15
|
-
required: ['icon'],
|
|
16
|
-
properties: {
|
|
17
|
-
icon: schema_1.ImageProps,
|
|
18
|
-
text: {
|
|
19
|
-
type: 'string',
|
|
20
|
-
contentType: 'text',
|
|
21
|
-
},
|
|
22
|
-
url: {
|
|
23
|
-
type: 'string',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
const NavigationItemBaseProps = {
|
|
28
|
-
text: {
|
|
29
|
-
type: 'string',
|
|
30
|
-
contentType: 'text',
|
|
31
|
-
},
|
|
32
|
-
url: {
|
|
33
|
-
type: 'string',
|
|
34
|
-
},
|
|
35
|
-
icon: {
|
|
36
|
-
type: 'string',
|
|
37
|
-
pattern: schema_1.urlPattern,
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
const NavigationItemBaseLinkProps = (0, lodash_1.omit)(NavigationItemBaseProps, ['url']);
|
|
41
|
-
const NavigationLinkItemProps = {
|
|
42
|
-
type: 'object',
|
|
43
|
-
additionalProperties: false,
|
|
44
|
-
required: ['type', 'text'],
|
|
45
|
-
properties: Object.assign(Object.assign({}, NavigationItemBaseLinkProps), { type: Object.assign({}, NavigationItemType), url: {
|
|
46
|
-
type: 'string',
|
|
47
|
-
}, target: {
|
|
48
|
-
type: 'string',
|
|
49
|
-
}, arrow: {
|
|
50
|
-
type: 'boolean',
|
|
51
|
-
} }),
|
|
52
|
-
};
|
|
53
|
-
const NavigationButtonItemProps = {
|
|
54
|
-
type: 'object',
|
|
55
|
-
additionalProperties: false,
|
|
56
|
-
required: ['type', 'text', 'url'],
|
|
57
|
-
properties: Object.assign(Object.assign({}, common_1.ButtonProps), { type: Object.assign({}, NavigationItemType) }),
|
|
58
|
-
};
|
|
59
|
-
const NavigationDropdownItemProps = {
|
|
60
|
-
type: 'object',
|
|
61
|
-
additionalProperties: false,
|
|
62
|
-
required: ['type', 'items'],
|
|
63
|
-
properties: Object.assign(Object.assign({}, NavigationItemBaseProps), { type: Object.assign({}, NavigationItemType), items: (0, utils_1.filteredArray)(NavigationLinkItemProps) }),
|
|
64
|
-
};
|
|
65
|
-
const NavigationItemProps = {
|
|
66
|
-
oneOf: [
|
|
67
|
-
Object.assign(Object.assign(Object.assign({}, NavigationLinkItemProps), NavigationButtonItemProps), NavigationDropdownItemProps),
|
|
68
|
-
],
|
|
69
|
-
};
|
|
70
|
-
exports.NavigationHeaderProps = {
|
|
71
|
-
type: 'object',
|
|
72
|
-
additionalProperties: false,
|
|
73
|
-
required: ['leftItems'],
|
|
74
|
-
properties: {
|
|
75
|
-
leftItems: NavigationItemProps,
|
|
76
|
-
rightItems: NavigationItemProps,
|
|
77
|
-
},
|
|
78
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../navigation/schema';
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
export declare const LogoProps: {
|
|
2
|
-
type: string;
|
|
3
|
-
additionalProperties: boolean;
|
|
4
|
-
required: string[];
|
|
5
|
-
properties: {
|
|
6
|
-
icon: {
|
|
7
|
-
oneOf: ({
|
|
8
|
-
type: string;
|
|
9
|
-
properties: {
|
|
10
|
-
when: {
|
|
11
|
-
type: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
} | {
|
|
15
|
-
type: string;
|
|
16
|
-
pattern: string;
|
|
17
|
-
})[];
|
|
18
|
-
};
|
|
19
|
-
text: {
|
|
20
|
-
type: string;
|
|
21
|
-
contentType: string;
|
|
22
|
-
};
|
|
23
|
-
url: {
|
|
24
|
-
type: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export declare const NavigationHeaderProps: {
|
|
29
|
-
type: string;
|
|
30
|
-
additionalProperties: boolean;
|
|
31
|
-
required: string[];
|
|
32
|
-
properties: {
|
|
33
|
-
leftItems: {
|
|
34
|
-
oneOf: {
|
|
35
|
-
type: string;
|
|
36
|
-
additionalProperties: boolean;
|
|
37
|
-
required: string[];
|
|
38
|
-
properties: {
|
|
39
|
-
type: {
|
|
40
|
-
type: string;
|
|
41
|
-
enum: string[];
|
|
42
|
-
};
|
|
43
|
-
items: {
|
|
44
|
-
type: string;
|
|
45
|
-
items: {
|
|
46
|
-
type: string;
|
|
47
|
-
properties: {
|
|
48
|
-
when: {
|
|
49
|
-
type: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
text: {
|
|
55
|
-
type: string;
|
|
56
|
-
contentType: string;
|
|
57
|
-
};
|
|
58
|
-
url: {
|
|
59
|
-
type: string;
|
|
60
|
-
};
|
|
61
|
-
icon: {
|
|
62
|
-
type: string;
|
|
63
|
-
pattern: string;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
}[];
|
|
67
|
-
};
|
|
68
|
-
rightItems: {
|
|
69
|
-
oneOf: {
|
|
70
|
-
type: string;
|
|
71
|
-
additionalProperties: boolean;
|
|
72
|
-
required: string[];
|
|
73
|
-
properties: {
|
|
74
|
-
type: {
|
|
75
|
-
type: string;
|
|
76
|
-
enum: string[];
|
|
77
|
-
};
|
|
78
|
-
items: {
|
|
79
|
-
type: string;
|
|
80
|
-
items: {
|
|
81
|
-
type: string;
|
|
82
|
-
properties: {
|
|
83
|
-
when: {
|
|
84
|
-
type: string;
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
text: {
|
|
90
|
-
type: string;
|
|
91
|
-
contentType: string;
|
|
92
|
-
};
|
|
93
|
-
url: {
|
|
94
|
-
type: string;
|
|
95
|
-
};
|
|
96
|
-
icon: {
|
|
97
|
-
type: string;
|
|
98
|
-
pattern: string;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
}[];
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
};
|