@gravity-ui/page-constructor 1.18.0 → 1.19.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.
Files changed (139) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +8 -0
  3. package/build/cjs/blocks/Map/Map.d.ts +3 -0
  4. package/build/cjs/blocks/Map/Map.js +15 -0
  5. package/build/cjs/blocks/Map/schema.d.ts +370 -0
  6. package/build/cjs/blocks/Map/schema.js +18 -0
  7. package/build/cjs/blocks/Media/Media.js +5 -27
  8. package/build/cjs/blocks/Media/schema.d.ts +265 -9
  9. package/build/cjs/blocks/Media/schema.js +18 -17
  10. package/build/cjs/blocks/index.d.ts +1 -0
  11. package/build/cjs/blocks/index.js +3 -1
  12. package/build/cjs/components/Map/GoogleMap.d.ts +4 -0
  13. package/build/cjs/components/Map/GoogleMap.js +42 -0
  14. package/build/cjs/components/Map/Map.css +20 -0
  15. package/build/cjs/components/Map/Map.d.ts +3 -0
  16. package/build/cjs/components/Map/Map.js +21 -0
  17. package/build/cjs/components/Map/YMap/YMap.d.ts +13 -0
  18. package/build/cjs/components/Map/YMap/YMap.js +97 -0
  19. package/build/cjs/components/Map/YMap/YandexMap.d.ts +4 -0
  20. package/build/cjs/components/Map/YMap/YandexMap.js +72 -0
  21. package/build/cjs/components/Map/YMap/YandexMapApiLoader.d.ts +11 -0
  22. package/build/cjs/components/Map/YMap/YandexMapApiLoader.js +37 -0
  23. package/build/cjs/components/Map/YMap/i18n/en.json +4 -0
  24. package/build/cjs/components/Map/YMap/i18n/index.d.ts +2 -0
  25. package/build/cjs/components/Map/YMap/i18n/index.js +8 -0
  26. package/build/cjs/components/Map/YMap/i18n/ru.json +4 -0
  27. package/build/cjs/components/Map/helpers.d.ts +1 -0
  28. package/build/cjs/components/Map/helpers.js +7 -0
  29. package/build/cjs/{blocks/Media/Media.css → components/MediaBase/MediaBase.css} +15 -14
  30. package/build/cjs/components/MediaBase/MediaBase.d.ts +13 -0
  31. package/build/cjs/components/MediaBase/MediaBase.js +39 -0
  32. package/build/cjs/{blocks/Media/MediaContent.css → components/MediaBase/MediaBaseContent.css} +2 -2
  33. package/build/cjs/{blocks/Media/MediaContent.js → components/MediaBase/MediaBaseContent.js} +1 -1
  34. package/build/cjs/constructor-items.d.ts +1 -0
  35. package/build/cjs/constructor-items.js +1 -0
  36. package/build/cjs/containers/PageConstructor/Provider.d.ts +2 -0
  37. package/build/cjs/containers/PageConstructor/Provider.js +3 -1
  38. package/build/cjs/context/mapsContext/mapsContext.d.ts +22 -0
  39. package/build/cjs/context/mapsContext/mapsContext.js +20 -0
  40. package/build/cjs/context/mapsContext/mapsProvider.d.ts +10 -0
  41. package/build/cjs/context/mapsContext/mapsProvider.js +15 -0
  42. package/build/cjs/context/mapsContext/useMap.d.ts +2 -0
  43. package/build/cjs/context/mapsContext/useMap.js +11 -0
  44. package/build/cjs/internal-typings/global.d.ts +36 -0
  45. package/build/cjs/models/constructor-items/blocks.d.ts +18 -9
  46. package/build/cjs/models/constructor-items/blocks.js +1 -0
  47. package/build/cjs/models/constructor-items/common.d.ts +25 -0
  48. package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +1 -3
  49. package/build/cjs/navigation/components/NavigationItem/components/GithubStars/GithubStars.css +4 -0
  50. package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.css +6 -0
  51. package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js +3 -3
  52. package/build/cjs/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.css +4 -0
  53. package/build/cjs/navigation/components/NavigationItem/mixins.css +0 -0
  54. package/build/cjs/schema/index.js +1 -1
  55. package/build/cjs/schema/validators/blocks.d.ts +1 -0
  56. package/build/cjs/schema/validators/blocks.js +1 -0
  57. package/build/cjs/schema/validators/common.d.ts +91 -0
  58. package/build/cjs/schema/validators/common.js +46 -1
  59. package/build/cjs/utils/blocks.d.ts +1 -1
  60. package/build/cjs/utils/common.d.ts +6 -0
  61. package/build/cjs/utils/common.js +24 -0
  62. package/build/cjs/utils/index.d.ts +1 -0
  63. package/build/cjs/utils/index.js +1 -0
  64. package/build/esm/blocks/Map/Map.d.ts +3 -0
  65. package/build/esm/blocks/Map/Map.js +11 -0
  66. package/build/esm/blocks/Map/schema.d.ts +370 -0
  67. package/build/esm/blocks/Map/schema.js +15 -0
  68. package/build/esm/blocks/Media/Media.d.ts +0 -1
  69. package/build/esm/blocks/Media/Media.js +7 -31
  70. package/build/esm/blocks/Media/schema.d.ts +265 -9
  71. package/build/esm/blocks/Media/schema.js +17 -16
  72. package/build/esm/blocks/index.d.ts +1 -0
  73. package/build/esm/blocks/index.js +1 -0
  74. package/build/esm/components/Map/GoogleMap.d.ts +4 -0
  75. package/build/esm/components/Map/GoogleMap.js +39 -0
  76. package/build/esm/components/Map/Map.css +20 -0
  77. package/build/esm/components/Map/Map.d.ts +4 -0
  78. package/build/esm/components/Map/Map.js +17 -0
  79. package/build/esm/components/Map/YMap/YMap.d.ts +13 -0
  80. package/build/esm/components/Map/YMap/YMap.js +93 -0
  81. package/build/esm/components/Map/YMap/YandexMap.d.ts +4 -0
  82. package/build/esm/components/Map/YMap/YandexMap.js +69 -0
  83. package/build/esm/components/Map/YMap/YandexMapApiLoader.d.ts +11 -0
  84. package/build/esm/components/Map/YMap/YandexMapApiLoader.js +33 -0
  85. package/build/esm/components/Map/YMap/i18n/en.json +4 -0
  86. package/build/esm/components/Map/YMap/i18n/index.d.ts +2 -0
  87. package/build/esm/components/Map/YMap/i18n/index.js +5 -0
  88. package/build/esm/components/Map/YMap/i18n/ru.json +4 -0
  89. package/build/esm/components/Map/helpers.d.ts +1 -0
  90. package/build/esm/components/Map/helpers.js +3 -0
  91. package/build/esm/{blocks/Media/Media.css → components/MediaBase/MediaBase.css} +15 -14
  92. package/build/esm/components/MediaBase/MediaBase.d.ts +14 -0
  93. package/build/esm/components/MediaBase/MediaBase.js +36 -0
  94. package/build/esm/{blocks/Media/MediaContent.css → components/MediaBase/MediaBaseContent.css} +2 -2
  95. package/build/esm/{blocks/Media/MediaContent.d.ts → components/MediaBase/MediaBaseContent.d.ts} +1 -1
  96. package/build/esm/{blocks/Media/MediaContent.js → components/MediaBase/MediaBaseContent.js} +2 -2
  97. package/build/esm/constructor-items.d.ts +1 -0
  98. package/build/esm/constructor-items.js +2 -1
  99. package/build/esm/containers/PageConstructor/Provider.d.ts +2 -0
  100. package/build/esm/containers/PageConstructor/Provider.js +3 -1
  101. package/build/esm/context/mapsContext/mapsContext.d.ts +22 -0
  102. package/build/esm/context/mapsContext/mapsContext.js +16 -0
  103. package/build/esm/context/mapsContext/mapsProvider.d.ts +10 -0
  104. package/build/esm/context/mapsContext/mapsProvider.js +10 -0
  105. package/build/esm/context/mapsContext/useMap.d.ts +2 -0
  106. package/build/esm/context/mapsContext/useMap.js +6 -0
  107. package/build/esm/internal-typings/global.d.ts +36 -0
  108. package/build/esm/models/constructor-items/blocks.d.ts +18 -9
  109. package/build/esm/models/constructor-items/blocks.js +1 -0
  110. package/build/esm/models/constructor-items/common.d.ts +25 -0
  111. package/build/esm/navigation/components/NavigationItem/NavigationItem.d.ts +0 -1
  112. package/build/esm/navigation/components/NavigationItem/NavigationItem.js +1 -4
  113. package/build/esm/navigation/components/NavigationItem/components/GithubStars/GithubStars.css +4 -0
  114. package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.css +6 -0
  115. package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js +3 -3
  116. package/build/esm/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.css +4 -0
  117. package/build/esm/navigation/components/NavigationItem/mixins.css +0 -0
  118. package/build/esm/schema/index.js +2 -2
  119. package/build/esm/schema/validators/blocks.d.ts +1 -0
  120. package/build/esm/schema/validators/blocks.js +1 -0
  121. package/build/esm/schema/validators/common.d.ts +91 -0
  122. package/build/esm/schema/validators/common.js +45 -0
  123. package/build/esm/utils/blocks.d.ts +1 -1
  124. package/build/esm/utils/common.d.ts +6 -0
  125. package/build/esm/utils/common.js +20 -0
  126. package/build/esm/utils/index.d.ts +1 -0
  127. package/build/esm/utils/index.js +1 -0
  128. package/package.json +1 -1
  129. package/server/models/constructor-items/blocks.d.ts +18 -9
  130. package/server/models/constructor-items/blocks.js +1 -0
  131. package/server/models/constructor-items/common.d.ts +25 -0
  132. package/server/utils/blocks.d.ts +1 -1
  133. package/server/utils/common.d.ts +6 -0
  134. package/server/utils/common.js +24 -0
  135. package/server/utils/index.d.ts +1 -0
  136. package/server/utils/index.js +1 -0
  137. package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +0 -6
  138. package/build/esm/navigation/components/NavigationItem/NavigationItem.css +0 -6
  139. /package/build/cjs/{blocks/Media/MediaContent.d.ts → components/MediaBase/MediaBaseContent.d.ts} +0 -0
@@ -863,6 +863,97 @@ export declare const MediaProps: {
863
863
  })[];
864
864
  };
865
865
  };
866
+ export declare const YMapMarkerLabel: {
867
+ required: never[];
868
+ iconCaption: {
869
+ type: string;
870
+ };
871
+ iconContent: {
872
+ type: string;
873
+ };
874
+ iconColor: {
875
+ type: string;
876
+ };
877
+ preset: {
878
+ type: string;
879
+ };
880
+ };
881
+ export declare const YMapMarker: {
882
+ required: never[];
883
+ coordinate: {
884
+ type: string;
885
+ items: {
886
+ type: string;
887
+ };
888
+ };
889
+ address: {
890
+ type: string;
891
+ };
892
+ label: {
893
+ required: never[];
894
+ iconCaption: {
895
+ type: string;
896
+ };
897
+ iconContent: {
898
+ type: string;
899
+ };
900
+ iconColor: {
901
+ type: string;
902
+ };
903
+ preset: {
904
+ type: string;
905
+ };
906
+ };
907
+ };
908
+ export declare const MapProps: {
909
+ zoom: {
910
+ type: string;
911
+ };
912
+ center: {
913
+ type: string;
914
+ items: {
915
+ type: string;
916
+ };
917
+ };
918
+ address: {
919
+ type: string;
920
+ };
921
+ id: {
922
+ type: string;
923
+ };
924
+ markers: {
925
+ type: string;
926
+ items: {
927
+ type: {
928
+ required: never[];
929
+ coordinate: {
930
+ type: string;
931
+ items: {
932
+ type: string;
933
+ };
934
+ };
935
+ address: {
936
+ type: string;
937
+ };
938
+ label: {
939
+ required: never[];
940
+ iconCaption: {
941
+ type: string;
942
+ };
943
+ iconContent: {
944
+ type: string;
945
+ };
946
+ iconColor: {
947
+ type: string;
948
+ };
949
+ preset: {
950
+ type: string;
951
+ };
952
+ };
953
+ };
954
+ };
955
+ };
956
+ };
866
957
  export declare const CardBase: {
867
958
  border: {
868
959
  type: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BlockHeaderProps = exports.CardBase = exports.MediaProps = exports.ButtonBlock = exports.TitleProps = exports.BlockBaseProps = exports.AnchorProps = exports.withTheme = exports.MenuProps = exports.ButtonProps = exports.authorItem = exports.FileLinkProps = exports.LinkProps = exports.BackgroundProps = exports.DataLensProps = exports.DataLensObjectProps = exports.JustifyProps = exports.ThemeProps = exports.VideoProps = exports.PlayIconProps = exports.LoopProps = exports.ChildrenCardsProps = exports.ChildrenProps = exports.AnimatableProps = exports.sliderSizesObject = exports.containerSizesObject = exports.BaseProps = exports.contentThemes = exports.sizeNumber = exports.dividerEnum = exports.fileLinkTypes = exports.videoControlsTypes = exports.playIconThemes = exports.playIconTypes = exports.videoTypes = exports.contentTextWidth = exports.contentSizes = exports.sliderSizesArray = exports.containerSizesArray = exports.textSize = exports.mediaDirection = void 0;
3
+ exports.BlockHeaderProps = exports.CardBase = exports.MapProps = exports.YMapMarker = exports.YMapMarkerLabel = exports.MediaProps = exports.ButtonBlock = exports.TitleProps = exports.BlockBaseProps = exports.AnchorProps = exports.withTheme = exports.MenuProps = exports.ButtonProps = exports.authorItem = exports.FileLinkProps = exports.LinkProps = exports.BackgroundProps = exports.DataLensProps = exports.DataLensObjectProps = exports.JustifyProps = exports.ThemeProps = exports.VideoProps = exports.PlayIconProps = exports.LoopProps = exports.ChildrenCardsProps = exports.ChildrenProps = exports.AnimatableProps = exports.sliderSizesObject = exports.containerSizesObject = exports.BaseProps = exports.contentThemes = exports.sizeNumber = exports.dividerEnum = exports.fileLinkTypes = exports.videoControlsTypes = exports.playIconThemes = exports.playIconTypes = exports.videoTypes = exports.contentTextWidth = exports.contentSizes = exports.sliderSizesArray = exports.containerSizesArray = exports.textSize = exports.mediaDirection = void 0;
4
4
  const pixel_1 = require("./pixel");
5
5
  const models_1 = require("../../models");
6
6
  const schema_1 = require("../../components/Image/schema");
@@ -442,6 +442,51 @@ exports.MediaProps = {
442
442
  },
443
443
  dataLens: exports.DataLensProps,
444
444
  };
445
+ exports.YMapMarkerLabel = {
446
+ required: [],
447
+ iconCaption: {
448
+ type: 'string',
449
+ },
450
+ iconContent: {
451
+ type: 'string',
452
+ },
453
+ iconColor: {
454
+ type: 'string',
455
+ },
456
+ preset: {
457
+ type: 'string',
458
+ },
459
+ };
460
+ exports.YMapMarker = {
461
+ required: [],
462
+ coordinate: {
463
+ type: 'array',
464
+ items: { type: 'number' },
465
+ },
466
+ address: {
467
+ type: 'string',
468
+ },
469
+ label: exports.YMapMarkerLabel,
470
+ };
471
+ exports.MapProps = {
472
+ zoom: {
473
+ type: 'number',
474
+ },
475
+ center: {
476
+ type: 'array',
477
+ items: { type: 'number' },
478
+ },
479
+ address: {
480
+ type: 'string',
481
+ },
482
+ id: {
483
+ type: 'string',
484
+ },
485
+ markers: {
486
+ type: 'array',
487
+ items: { type: exports.YMapMarker },
488
+ },
489
+ };
445
490
  exports.CardBase = {
446
491
  border: {
447
492
  type: 'string',
@@ -1,6 +1,6 @@
1
1
  import { ConstructorBlock } from '../models/constructor';
2
2
  import { TextSize, CustomConfig, PCShareSocialNetwork } from '../models';
3
- export declare function getHeaderTag(size: TextSize): "h1" | "h4" | "h2";
3
+ export declare function getHeaderTag(size: TextSize): "h1" | "h2" | "h4";
4
4
  export declare function getBlockKey(block: ConstructorBlock, index: number): string;
5
5
  export declare const getCustomBlockTypes: ({ blocks, headers }?: CustomConfig) => string[];
6
6
  export declare const getCustomItems: ({ blocks, headers, subBlocks }?: CustomConfig) => {
@@ -0,0 +1,6 @@
1
+ export interface ScriptOptions {
2
+ id: string;
3
+ defer?: boolean;
4
+ async?: boolean;
5
+ }
6
+ export declare function loadScript(src: string, { id, defer, async }: ScriptOptions): Promise<unknown>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadScript = void 0;
4
+ async function loadScript(src, { id, defer = false, async = true }) {
5
+ // eslint-disable-next-line @typescript-eslint/no-shadow
6
+ return new Promise((resolve, reject) => {
7
+ const script = document.createElement('script');
8
+ script.src = src;
9
+ script.id = id;
10
+ script.defer = defer;
11
+ script.async = async;
12
+ script.onload = (event) => {
13
+ resolve(event);
14
+ };
15
+ script.onerror = (event) => {
16
+ var _a;
17
+ const element = document.getElementById(id);
18
+ (_a = element === null || element === void 0 ? void 0 : element.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(element);
19
+ reject(event);
20
+ };
21
+ document.head.appendChild(script);
22
+ });
23
+ }
24
+ exports.loadScript = loadScript;
@@ -1,3 +1,4 @@
1
+ export * from './common';
1
2
  export * from './blocks';
2
3
  export * from './scroll';
3
4
  export * from './url';
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isHubspotEventData = exports.configure = exports.Lang = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ tslib_1.__exportStar(require("./common"), exports);
5
6
  tslib_1.__exportStar(require("./blocks"), exports);
6
7
  tslib_1.__exportStar(require("./scroll"), exports);
7
8
  tslib_1.__exportStar(require("./url"), exports);
@@ -0,0 +1,3 @@
1
+ import { MapBlockProps } from '../../models';
2
+ export declare const MapBlock: ({ map, ...props }: MapBlockProps) => JSX.Element;
3
+ export default MapBlock;
@@ -0,0 +1,11 @@
1
+ import { __rest } from "tslib";
2
+ import React from 'react';
3
+ import Map from '../../components/Map/Map';
4
+ import MediaBase from '../../components/MediaBase/MediaBase';
5
+ export const MapBlock = (_a) => {
6
+ var { map } = _a, props = __rest(_a, ["map"]);
7
+ return (React.createElement(MediaBase, Object.assign({}, props),
8
+ React.createElement(MediaBase.Card, null,
9
+ React.createElement(Map, Object.assign({}, map)))));
10
+ };
11
+ export default MapBlock;
@@ -0,0 +1,370 @@
1
+ export declare const Map: {
2
+ type: string;
3
+ additionalProperties: boolean;
4
+ required: never[];
5
+ properties: {
6
+ zoom: {
7
+ type: string;
8
+ };
9
+ center: {
10
+ type: string;
11
+ items: {
12
+ type: string;
13
+ };
14
+ };
15
+ address: {
16
+ type: string;
17
+ };
18
+ id: {
19
+ type: string;
20
+ };
21
+ markers: {
22
+ type: string;
23
+ items: {
24
+ type: {
25
+ required: never[];
26
+ coordinate: {
27
+ type: string;
28
+ items: {
29
+ type: string;
30
+ };
31
+ };
32
+ address: {
33
+ type: string;
34
+ };
35
+ label: {
36
+ required: never[];
37
+ iconCaption: {
38
+ type: string;
39
+ };
40
+ iconContent: {
41
+ type: string;
42
+ };
43
+ iconColor: {
44
+ type: string;
45
+ };
46
+ preset: {
47
+ type: string;
48
+ };
49
+ };
50
+ };
51
+ };
52
+ };
53
+ };
54
+ };
55
+ export declare const MapBlock: {
56
+ 'map-block': {
57
+ additionalProperties: boolean;
58
+ required: string[];
59
+ properties: {
60
+ map: {
61
+ type: string;
62
+ additionalProperties: boolean;
63
+ required: never[];
64
+ properties: {
65
+ zoom: {
66
+ type: string;
67
+ };
68
+ center: {
69
+ type: string;
70
+ items: {
71
+ type: string;
72
+ };
73
+ };
74
+ address: {
75
+ type: string;
76
+ };
77
+ id: {
78
+ type: string;
79
+ };
80
+ markers: {
81
+ type: string;
82
+ items: {
83
+ type: {
84
+ required: never[];
85
+ coordinate: {
86
+ type: string;
87
+ items: {
88
+ type: string;
89
+ };
90
+ };
91
+ address: {
92
+ type: string;
93
+ };
94
+ label: {
95
+ required: never[];
96
+ iconCaption: {
97
+ type: string;
98
+ };
99
+ iconContent: {
100
+ type: string;
101
+ };
102
+ iconColor: {
103
+ type: string;
104
+ };
105
+ preset: {
106
+ type: string;
107
+ };
108
+ };
109
+ };
110
+ };
111
+ };
112
+ };
113
+ };
114
+ description: {
115
+ type: string;
116
+ contentType: string;
117
+ };
118
+ direction: {
119
+ type: string;
120
+ enum: string[];
121
+ };
122
+ mobileDirection: {
123
+ type: string;
124
+ enum: string[];
125
+ };
126
+ largeMedia: {
127
+ type: string;
128
+ };
129
+ mediaOnly: {
130
+ type: string;
131
+ };
132
+ disableShadow: {
133
+ type: string;
134
+ };
135
+ button: {
136
+ type: string;
137
+ additionalProperties: boolean;
138
+ properties: {
139
+ text: {
140
+ type: string;
141
+ contentType: string;
142
+ };
143
+ url: {
144
+ type: string;
145
+ };
146
+ primary: {
147
+ type: string;
148
+ };
149
+ size: {
150
+ type: string;
151
+ enum: string[];
152
+ };
153
+ theme: {
154
+ type: string;
155
+ enum: string[];
156
+ };
157
+ img: {
158
+ anyOf: ({
159
+ type: string;
160
+ additionalProperties?: undefined;
161
+ required?: undefined;
162
+ properties?: undefined;
163
+ } | {
164
+ type: string;
165
+ additionalProperties: boolean;
166
+ required: string[];
167
+ properties: {
168
+ data: {
169
+ type: string;
170
+ };
171
+ position: {
172
+ type: string;
173
+ enum: string[];
174
+ };
175
+ alt: {
176
+ type: string;
177
+ contentType: string;
178
+ };
179
+ };
180
+ })[];
181
+ };
182
+ metrikaGoals: {
183
+ anyOf: ({
184
+ type: string;
185
+ items?: undefined;
186
+ } | {
187
+ type: string;
188
+ items: {
189
+ type: string;
190
+ additionalProperties?: undefined;
191
+ required?: undefined;
192
+ properties?: undefined;
193
+ };
194
+ } | {
195
+ type: string;
196
+ items: {
197
+ type: string;
198
+ additionalProperties: boolean;
199
+ required: string[];
200
+ properties: {
201
+ name: {
202
+ type: string;
203
+ };
204
+ isCrossSite: {
205
+ type: string;
206
+ };
207
+ };
208
+ };
209
+ })[];
210
+ };
211
+ pixelEvents: {
212
+ type: string;
213
+ items: {
214
+ type: string;
215
+ required: string[];
216
+ additionalProperties: boolean;
217
+ properties: {
218
+ name: {
219
+ type: string;
220
+ enum: import("../..").PixelEventType[];
221
+ };
222
+ data: {};
223
+ };
224
+ select: {
225
+ $data: string;
226
+ };
227
+ selectCases: {
228
+ SubmitApplication: {
229
+ additionalProperties: boolean;
230
+ properties: {
231
+ name: {};
232
+ };
233
+ };
234
+ Contact: {
235
+ additionalProperties: boolean;
236
+ properties: {
237
+ name: {};
238
+ };
239
+ };
240
+ Lead: {
241
+ additionalProperties: boolean;
242
+ properties: {
243
+ name: {};
244
+ data: {
245
+ type: string;
246
+ additionalProperties: boolean;
247
+ properties: {
248
+ content_category: {
249
+ type: string;
250
+ };
251
+ content_name: {
252
+ type: string;
253
+ };
254
+ currency: {
255
+ type: string;
256
+ };
257
+ value: {
258
+ type: string;
259
+ };
260
+ };
261
+ };
262
+ };
263
+ };
264
+ };
265
+ };
266
+ };
267
+ target: {
268
+ type: string;
269
+ enum: string[];
270
+ };
271
+ };
272
+ if: {
273
+ properties: {
274
+ theme: {
275
+ enum: string[];
276
+ };
277
+ };
278
+ };
279
+ then: {
280
+ required: string[];
281
+ };
282
+ else: {
283
+ required: string[];
284
+ };
285
+ };
286
+ title: {
287
+ oneOf: ({
288
+ type: string;
289
+ additionalProperties: boolean;
290
+ required: string[];
291
+ properties: {
292
+ text: {
293
+ type: string;
294
+ contentType: string;
295
+ };
296
+ textSize: {
297
+ type: string;
298
+ enum: string[];
299
+ };
300
+ url: {
301
+ type: string;
302
+ };
303
+ resetMargin: {
304
+ type: string;
305
+ };
306
+ };
307
+ } | {
308
+ type: string;
309
+ contentType: string;
310
+ })[];
311
+ };
312
+ size: {
313
+ type: string;
314
+ enum: string[];
315
+ };
316
+ additionalInfo: {
317
+ type: string;
318
+ contentType: string;
319
+ };
320
+ links: {
321
+ type: string;
322
+ items: {
323
+ type: string;
324
+ properties: {
325
+ when: {
326
+ type: string;
327
+ };
328
+ };
329
+ };
330
+ };
331
+ buttons: {
332
+ type: string;
333
+ items: {
334
+ type: string;
335
+ properties: {
336
+ when: {
337
+ type: string;
338
+ };
339
+ };
340
+ };
341
+ };
342
+ animated: {
343
+ type: string;
344
+ };
345
+ anchor: {
346
+ type: string;
347
+ additionalProperties: boolean;
348
+ required: string[];
349
+ properties: {
350
+ text: {
351
+ type: string;
352
+ contentType: string;
353
+ };
354
+ url: {
355
+ type: string;
356
+ };
357
+ };
358
+ };
359
+ visible: {
360
+ type: string;
361
+ enum: string[];
362
+ };
363
+ resetPaddings: {
364
+ type: string;
365
+ };
366
+ type: {};
367
+ when: {};
368
+ };
369
+ };
370
+ };
@@ -0,0 +1,15 @@
1
+ import { MapProps } from '../../schema/validators/common';
2
+ import { MediaBlockBaseProps } from '../Media/schema';
3
+ export const Map = {
4
+ type: 'object',
5
+ additionalProperties: false,
6
+ required: [],
7
+ properties: MapProps,
8
+ };
9
+ export const MapBlock = {
10
+ 'map-block': {
11
+ additionalProperties: false,
12
+ required: ['title', 'map'],
13
+ properties: Object.assign(Object.assign({}, MediaBlockBaseProps), { map: Map }),
14
+ },
15
+ };
@@ -1,4 +1,3 @@
1
1
  import { MediaBlockProps } from '../../models';
2
- import './Media.css';
3
2
  export declare const MediaBlock: (props: MediaBlockProps) => JSX.Element;
4
3
  export default MediaBlock;
@@ -1,39 +1,15 @@
1
- import { __rest } from "tslib";
2
- import React, { useContext, useMemo, useState } from 'react';
3
- import { block, getThemedValue } from '../../utils';
4
- import { Grid, Row, Col, GridColumnSize } from '../../grid';
1
+ import React, { useContext, useState } from 'react';
2
+ import { getThemedValue } from '../../utils';
5
3
  import Media from '../../components/Media/Media';
6
- import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
7
- import BlockHeader from '../../components/BlockHeader/BlockHeader';
8
- import MediaContent from './MediaContent';
4
+ import MediaBase from '../../components/MediaBase/MediaBase';
9
5
  import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
10
- import './Media.css';
11
- const b = block('media-block');
12
6
  export const MediaBlock = (props) => {
13
- const { media, largeMedia, direction = 'content-media', mobileDirection = 'content-media', animated, mediaOnly, disableShadow = false } = props, mediaContentProps = __rest(props, ["media", "largeMedia", "direction", "mobileDirection", "animated", "mediaOnly", "disableShadow"]);
14
- const { title, description } = mediaContentProps;
7
+ const { media } = props;
15
8
  const [play, setPlay] = useState(false);
16
9
  const { themeValue: theme } = useContext(ThemeValueContext);
17
10
  const mediaThemed = getThemedValue(media, theme);
18
- const mediaSizes = useMemo(() => {
19
- return mediaOnly
20
- ? { [GridColumnSize.All]: 12 }
21
- : { [GridColumnSize.Md]: largeMedia ? 8 : 6, [GridColumnSize.All]: 12 };
22
- }, [mediaOnly, largeMedia]);
23
- const contentSizes = useMemo(() => {
24
- return { [GridColumnSize.Md]: largeMedia ? 4 : 6, [GridColumnSize.All]: 12 };
25
- }, [largeMedia]);
26
- const mediaContent = !mediaOnly && React.createElement(MediaContent, Object.assign({}, mediaContentProps));
27
- return (React.createElement(AnimateBlock, { className: b(), onScroll: () => setPlay(true), animate: animated },
28
- mediaOnly && (React.createElement(BlockHeader, { className: b('header'), title: title, description: description })),
29
- React.createElement(Grid, null,
30
- React.createElement(Row, { className: b('row', {
31
- reverse: direction === 'media-content',
32
- 'mobile-reverse': mobileDirection === 'media-content',
33
- }) },
34
- React.createElement(Col, { className: b('content'), sizes: contentSizes }, mediaContent),
35
- React.createElement(Col, { sizes: mediaSizes },
36
- React.createElement("div", { className: b('card', { shadow: !disableShadow }) },
37
- React.createElement(Media, Object.assign({}, mediaThemed, { playVideo: play }))))))));
11
+ return (React.createElement(MediaBase, Object.assign({}, props, { onScroll: () => setPlay(true) }),
12
+ React.createElement(MediaBase.Card, null,
13
+ React.createElement(Media, Object.assign({}, mediaThemed, { playVideo: play })))));
38
14
  };
39
15
  export default MediaBlock;