@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.19.0](https://github.com/gravity-ui/page-constructor/compare/v1.18.1...v1.19.0) (2023-02-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * add Map-block ([13874f7](https://github.com/gravity-ui/page-constructor/commit/13874f70edddc297c711a6e4eae7753ae04fd746))
9
+
10
+ ## [1.18.1](https://github.com/gravity-ui/page-constructor/compare/v1.18.0...v1.18.1) (2023-02-28)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * add mixin for navigation item and refactor ([#179](https://github.com/gravity-ui/page-constructor/issues/179)) ([3709fcd](https://github.com/gravity-ui/page-constructor/commit/3709fcdcaa2149ed287fb9ef0250dfca1181c842))
16
+
3
17
  ## [1.18.0](https://github.com/gravity-ui/page-constructor/compare/v1.17.0...v1.18.0) (2023-02-28)
4
18
 
5
19
 
package/README.md CHANGED
@@ -46,6 +46,7 @@ interface PageConstructorProviderProps {
46
46
  metrika?: Metrika; //Functions for sending analytics
47
47
  ssrConfig?: SSR; //A flag indicating that the code is run on the server size.
48
48
  theme?: 'light' | 'dark'; //Theme to render the page with.
49
+ mapsContext?: MapsContextType; //Params for map: apikey, type, scriptSrc, nonce
49
50
  }
50
51
 
51
52
  export interface PageContent extends Animatable {
@@ -211,6 +212,13 @@ import {configure, Lang} from '@gravity-ui/page-constructor';
211
212
  configure({lang: Lang.En});
212
213
  ```
213
214
 
215
+ ### Maps
216
+
217
+ To use maps, put the map type, scriptSrc and apiKey in field `mapContext` in `PageConstructorProvider`.
218
+
219
+ You can define environment variables for dev-mode in .env.development file within project root.
220
+ `STORYBOOK_GMAP_API_KEY` - apiKey for google maps
221
+
214
222
  ## Development
215
223
 
216
224
  ```bash
@@ -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,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MapBlock = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = tslib_1.__importDefault(require("react"));
6
+ const Map_1 = tslib_1.__importDefault(require("../../components/Map/Map"));
7
+ const MediaBase_1 = tslib_1.__importDefault(require("../../components/MediaBase/MediaBase"));
8
+ const MapBlock = (_a) => {
9
+ var { map } = _a, props = tslib_1.__rest(_a, ["map"]);
10
+ return (react_1.default.createElement(MediaBase_1.default, Object.assign({}, props),
11
+ react_1.default.createElement(MediaBase_1.default.Card, null,
12
+ react_1.default.createElement(Map_1.default, Object.assign({}, map)))));
13
+ };
14
+ exports.MapBlock = MapBlock;
15
+ exports.default = exports.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,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MapBlock = exports.Map = void 0;
4
+ const common_1 = require("../../schema/validators/common");
5
+ const schema_1 = require("../Media/schema");
6
+ exports.Map = {
7
+ type: 'object',
8
+ additionalProperties: false,
9
+ required: [],
10
+ properties: common_1.MapProps,
11
+ };
12
+ exports.MapBlock = {
13
+ 'map-block': {
14
+ additionalProperties: false,
15
+ required: ['title', 'map'],
16
+ properties: Object.assign(Object.assign({}, schema_1.MediaBlockBaseProps), { map: exports.Map }),
17
+ },
18
+ };
@@ -4,39 +4,17 @@ exports.MediaBlock = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
6
  const utils_1 = require("../../utils");
7
- const grid_1 = require("../../grid");
8
7
  const Media_1 = tslib_1.__importDefault(require("../../components/Media/Media"));
9
- const AnimateBlock_1 = tslib_1.__importDefault(require("../../components/AnimateBlock/AnimateBlock"));
10
- const BlockHeader_1 = tslib_1.__importDefault(require("../../components/BlockHeader/BlockHeader"));
11
- const MediaContent_1 = tslib_1.__importDefault(require("./MediaContent"));
8
+ const MediaBase_1 = tslib_1.__importDefault(require("../../components/MediaBase/MediaBase"));
12
9
  const ThemeValueContext_1 = require("../../context/theme/ThemeValueContext");
13
- const b = (0, utils_1.block)('media-block');
14
10
  const MediaBlock = (props) => {
15
- const { media, largeMedia, direction = 'content-media', mobileDirection = 'content-media', animated, mediaOnly, disableShadow = false } = props, mediaContentProps = tslib_1.__rest(props, ["media", "largeMedia", "direction", "mobileDirection", "animated", "mediaOnly", "disableShadow"]);
16
- const { title, description } = mediaContentProps;
11
+ const { media } = props;
17
12
  const [play, setPlay] = (0, react_1.useState)(false);
18
13
  const { themeValue: theme } = (0, react_1.useContext)(ThemeValueContext_1.ThemeValueContext);
19
14
  const mediaThemed = (0, utils_1.getThemedValue)(media, theme);
20
- const mediaSizes = (0, react_1.useMemo)(() => {
21
- return mediaOnly
22
- ? { [grid_1.GridColumnSize.All]: 12 }
23
- : { [grid_1.GridColumnSize.Md]: largeMedia ? 8 : 6, [grid_1.GridColumnSize.All]: 12 };
24
- }, [mediaOnly, largeMedia]);
25
- const contentSizes = (0, react_1.useMemo)(() => {
26
- return { [grid_1.GridColumnSize.Md]: largeMedia ? 4 : 6, [grid_1.GridColumnSize.All]: 12 };
27
- }, [largeMedia]);
28
- const mediaContent = !mediaOnly && react_1.default.createElement(MediaContent_1.default, Object.assign({}, mediaContentProps));
29
- return (react_1.default.createElement(AnimateBlock_1.default, { className: b(), onScroll: () => setPlay(true), animate: animated },
30
- mediaOnly && (react_1.default.createElement(BlockHeader_1.default, { className: b('header'), title: title, description: description })),
31
- react_1.default.createElement(grid_1.Grid, null,
32
- react_1.default.createElement(grid_1.Row, { className: b('row', {
33
- reverse: direction === 'media-content',
34
- 'mobile-reverse': mobileDirection === 'media-content',
35
- }) },
36
- react_1.default.createElement(grid_1.Col, { className: b('content'), sizes: contentSizes }, mediaContent),
37
- react_1.default.createElement(grid_1.Col, { sizes: mediaSizes },
38
- react_1.default.createElement("div", { className: b('card', { shadow: !disableShadow }) },
39
- react_1.default.createElement(Media_1.default, Object.assign({}, mediaThemed, { playVideo: play }))))))));
15
+ return (react_1.default.createElement(MediaBase_1.default, Object.assign({}, props, { onScroll: () => setPlay(true) }),
16
+ react_1.default.createElement(MediaBase_1.default.Card, null,
17
+ react_1.default.createElement(Media_1.default, Object.assign({}, mediaThemed, { playVideo: play })))));
40
18
  };
41
19
  exports.MediaBlock = MediaBlock;
42
20
  exports.default = exports.MediaBlock;