@gravity-ui/page-constructor 1.18.1 → 1.19.1
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 +14 -0
- package/README.md +8 -0
- package/build/cjs/blocks/Map/Map.d.ts +3 -0
- package/build/cjs/blocks/Map/Map.js +15 -0
- package/build/cjs/blocks/Map/schema.d.ts +384 -0
- package/build/cjs/blocks/Map/schema.js +18 -0
- package/build/cjs/blocks/Media/Media.js +5 -27
- package/build/cjs/blocks/Media/schema.d.ts +265 -9
- package/build/cjs/blocks/Media/schema.js +18 -17
- package/build/cjs/blocks/index.d.ts +1 -0
- package/build/cjs/blocks/index.js +3 -1
- package/build/cjs/components/Map/GoogleMap.d.ts +4 -0
- package/build/cjs/components/Map/GoogleMap.js +42 -0
- package/build/cjs/components/Map/Map.css +20 -0
- package/build/cjs/components/Map/Map.d.ts +3 -0
- package/build/cjs/components/Map/Map.js +21 -0
- package/build/cjs/components/Map/YMap/YMap.d.ts +13 -0
- package/build/cjs/components/Map/YMap/YMap.js +97 -0
- package/build/cjs/components/Map/YMap/YandexMap.d.ts +4 -0
- package/build/cjs/components/Map/YMap/YandexMap.js +72 -0
- package/build/cjs/components/Map/YMap/YandexMapApiLoader.d.ts +11 -0
- package/build/cjs/components/Map/YMap/YandexMapApiLoader.js +37 -0
- package/build/cjs/components/Map/YMap/i18n/en.json +4 -0
- package/build/cjs/components/Map/YMap/i18n/index.d.ts +2 -0
- package/build/cjs/components/Map/YMap/i18n/index.js +8 -0
- package/build/cjs/components/Map/YMap/i18n/ru.json +4 -0
- package/build/cjs/components/Map/helpers.d.ts +1 -0
- package/build/cjs/components/Map/helpers.js +7 -0
- package/build/cjs/{blocks/Media/Media.css → components/MediaBase/MediaBase.css} +15 -14
- package/build/cjs/components/MediaBase/MediaBase.d.ts +13 -0
- package/build/cjs/components/MediaBase/MediaBase.js +39 -0
- package/build/{esm/blocks/Media/MediaContent.css → cjs/components/MediaBase/MediaBaseContent.css} +2 -2
- package/build/cjs/{blocks/Media/MediaContent.js → components/MediaBase/MediaBaseContent.js} +1 -1
- package/build/cjs/constructor-items.d.ts +1 -0
- package/build/cjs/constructor-items.js +1 -0
- package/build/cjs/containers/PageConstructor/Provider.d.ts +2 -0
- package/build/cjs/containers/PageConstructor/Provider.js +3 -1
- package/build/cjs/context/mapsContext/mapsContext.d.ts +22 -0
- package/build/cjs/context/mapsContext/mapsContext.js +20 -0
- package/build/cjs/context/mapsContext/mapsProvider.d.ts +10 -0
- package/build/cjs/context/mapsContext/mapsProvider.js +15 -0
- package/build/cjs/context/mapsContext/useMap.d.ts +2 -0
- package/build/cjs/context/mapsContext/useMap.js +11 -0
- package/build/cjs/internal-typings/global.d.ts +36 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +18 -9
- package/build/cjs/models/constructor-items/blocks.js +1 -0
- package/build/cjs/models/constructor-items/common.d.ts +25 -0
- package/build/cjs/schema/index.js +1 -1
- package/build/cjs/schema/validators/blocks.d.ts +1 -0
- package/build/cjs/schema/validators/blocks.js +1 -0
- package/build/cjs/schema/validators/common.d.ts +108 -0
- package/build/cjs/schema/validators/common.js +53 -1
- package/build/cjs/utils/blocks.d.ts +1 -1
- package/build/cjs/utils/common.d.ts +6 -0
- package/build/cjs/utils/common.js +24 -0
- package/build/cjs/utils/index.d.ts +1 -0
- package/build/cjs/utils/index.js +1 -0
- package/build/esm/blocks/Map/Map.d.ts +3 -0
- package/build/esm/blocks/Map/Map.js +11 -0
- package/build/esm/blocks/Map/schema.d.ts +384 -0
- package/build/esm/blocks/Map/schema.js +15 -0
- package/build/esm/blocks/Media/Media.d.ts +0 -1
- package/build/esm/blocks/Media/Media.js +7 -31
- package/build/esm/blocks/Media/schema.d.ts +265 -9
- package/build/esm/blocks/Media/schema.js +17 -16
- package/build/esm/blocks/index.d.ts +1 -0
- package/build/esm/blocks/index.js +1 -0
- package/build/esm/components/Map/GoogleMap.d.ts +4 -0
- package/build/esm/components/Map/GoogleMap.js +39 -0
- package/build/esm/components/Map/Map.css +20 -0
- package/build/esm/components/Map/Map.d.ts +4 -0
- package/build/esm/components/Map/Map.js +17 -0
- package/build/esm/components/Map/YMap/YMap.d.ts +13 -0
- package/build/esm/components/Map/YMap/YMap.js +93 -0
- package/build/esm/components/Map/YMap/YandexMap.d.ts +4 -0
- package/build/esm/components/Map/YMap/YandexMap.js +69 -0
- package/build/esm/components/Map/YMap/YandexMapApiLoader.d.ts +11 -0
- package/build/esm/components/Map/YMap/YandexMapApiLoader.js +33 -0
- package/build/esm/components/Map/YMap/i18n/en.json +4 -0
- package/build/esm/components/Map/YMap/i18n/index.d.ts +2 -0
- package/build/esm/components/Map/YMap/i18n/index.js +5 -0
- package/build/esm/components/Map/YMap/i18n/ru.json +4 -0
- package/build/esm/components/Map/helpers.d.ts +1 -0
- package/build/esm/components/Map/helpers.js +3 -0
- package/build/esm/{blocks/Media/Media.css → components/MediaBase/MediaBase.css} +15 -14
- package/build/esm/components/MediaBase/MediaBase.d.ts +14 -0
- package/build/esm/components/MediaBase/MediaBase.js +36 -0
- package/build/{cjs/blocks/Media/MediaContent.css → esm/components/MediaBase/MediaBaseContent.css} +2 -2
- package/build/esm/{blocks/Media/MediaContent.d.ts → components/MediaBase/MediaBaseContent.d.ts} +1 -1
- package/build/esm/{blocks/Media/MediaContent.js → components/MediaBase/MediaBaseContent.js} +2 -2
- package/build/esm/constructor-items.d.ts +1 -0
- package/build/esm/constructor-items.js +2 -1
- package/build/esm/containers/PageConstructor/Provider.d.ts +2 -0
- package/build/esm/containers/PageConstructor/Provider.js +3 -1
- package/build/esm/context/mapsContext/mapsContext.d.ts +22 -0
- package/build/esm/context/mapsContext/mapsContext.js +16 -0
- package/build/esm/context/mapsContext/mapsProvider.d.ts +10 -0
- package/build/esm/context/mapsContext/mapsProvider.js +10 -0
- package/build/esm/context/mapsContext/useMap.d.ts +2 -0
- package/build/esm/context/mapsContext/useMap.js +6 -0
- package/build/esm/internal-typings/global.d.ts +36 -0
- package/build/esm/models/constructor-items/blocks.d.ts +18 -9
- package/build/esm/models/constructor-items/blocks.js +1 -0
- package/build/esm/models/constructor-items/common.d.ts +25 -0
- package/build/esm/schema/index.js +2 -2
- package/build/esm/schema/validators/blocks.d.ts +1 -0
- package/build/esm/schema/validators/blocks.js +1 -0
- package/build/esm/schema/validators/common.d.ts +108 -0
- package/build/esm/schema/validators/common.js +52 -0
- package/build/esm/utils/blocks.d.ts +1 -1
- package/build/esm/utils/common.d.ts +6 -0
- package/build/esm/utils/common.js +20 -0
- package/build/esm/utils/index.d.ts +1 -0
- package/build/esm/utils/index.js +1 -0
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +18 -9
- package/server/models/constructor-items/blocks.js +1 -0
- package/server/models/constructor-items/common.d.ts +25 -0
- package/server/utils/blocks.d.ts +1 -1
- package/server/utils/common.d.ts +6 -0
- package/server/utils/common.js +24 -0
- package/server/utils/index.d.ts +1 -0
- package/server/utils/index.js +1 -0
- /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.1](https://github.com/gravity-ui/page-constructor/compare/v1.19.0...v1.19.1) (2023-03-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* fix map block scheme ([8db1923](https://github.com/gravity-ui/page-constructor/commit/8db1923b315c793d349da868f9299feb983408be))
|
|
9
|
+
|
|
10
|
+
## [1.19.0](https://github.com/gravity-ui/page-constructor/compare/v1.18.1...v1.19.0) (2023-02-28)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add Map-block ([13874f7](https://github.com/gravity-ui/page-constructor/commit/13874f70edddc297c711a6e4eae7753ae04fd746))
|
|
16
|
+
|
|
3
17
|
## [1.18.1](https://github.com/gravity-ui/page-constructor/compare/v1.18.0...v1.18.1) (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,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,384 @@
|
|
|
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
|
+
type: string;
|
|
26
|
+
additionalProperties: boolean;
|
|
27
|
+
required: never[];
|
|
28
|
+
properties: {
|
|
29
|
+
coordinate: {
|
|
30
|
+
type: string;
|
|
31
|
+
items: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
address: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
label: {
|
|
39
|
+
type: string;
|
|
40
|
+
required: never[];
|
|
41
|
+
properties: {
|
|
42
|
+
iconCaption: {
|
|
43
|
+
type: string;
|
|
44
|
+
};
|
|
45
|
+
iconContent: {
|
|
46
|
+
type: string;
|
|
47
|
+
};
|
|
48
|
+
iconColor: {
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
preset: {
|
|
52
|
+
type: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export declare const MapBlock: {
|
|
63
|
+
'map-block': {
|
|
64
|
+
additionalProperties: boolean;
|
|
65
|
+
required: string[];
|
|
66
|
+
properties: {
|
|
67
|
+
map: {
|
|
68
|
+
type: string;
|
|
69
|
+
additionalProperties: boolean;
|
|
70
|
+
required: never[];
|
|
71
|
+
properties: {
|
|
72
|
+
zoom: {
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
center: {
|
|
76
|
+
type: string;
|
|
77
|
+
items: {
|
|
78
|
+
type: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
address: {
|
|
82
|
+
type: string;
|
|
83
|
+
};
|
|
84
|
+
id: {
|
|
85
|
+
type: string;
|
|
86
|
+
};
|
|
87
|
+
markers: {
|
|
88
|
+
type: string;
|
|
89
|
+
items: {
|
|
90
|
+
type: {
|
|
91
|
+
type: string;
|
|
92
|
+
additionalProperties: boolean;
|
|
93
|
+
required: never[];
|
|
94
|
+
properties: {
|
|
95
|
+
coordinate: {
|
|
96
|
+
type: string;
|
|
97
|
+
items: {
|
|
98
|
+
type: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
address: {
|
|
102
|
+
type: string;
|
|
103
|
+
};
|
|
104
|
+
label: {
|
|
105
|
+
type: string;
|
|
106
|
+
required: never[];
|
|
107
|
+
properties: {
|
|
108
|
+
iconCaption: {
|
|
109
|
+
type: string;
|
|
110
|
+
};
|
|
111
|
+
iconContent: {
|
|
112
|
+
type: string;
|
|
113
|
+
};
|
|
114
|
+
iconColor: {
|
|
115
|
+
type: string;
|
|
116
|
+
};
|
|
117
|
+
preset: {
|
|
118
|
+
type: string;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
description: {
|
|
129
|
+
type: string;
|
|
130
|
+
contentType: string;
|
|
131
|
+
};
|
|
132
|
+
direction: {
|
|
133
|
+
type: string;
|
|
134
|
+
enum: string[];
|
|
135
|
+
};
|
|
136
|
+
mobileDirection: {
|
|
137
|
+
type: string;
|
|
138
|
+
enum: string[];
|
|
139
|
+
};
|
|
140
|
+
largeMedia: {
|
|
141
|
+
type: string;
|
|
142
|
+
};
|
|
143
|
+
mediaOnly: {
|
|
144
|
+
type: string;
|
|
145
|
+
};
|
|
146
|
+
disableShadow: {
|
|
147
|
+
type: string;
|
|
148
|
+
};
|
|
149
|
+
button: {
|
|
150
|
+
type: string;
|
|
151
|
+
additionalProperties: boolean;
|
|
152
|
+
properties: {
|
|
153
|
+
text: {
|
|
154
|
+
type: string;
|
|
155
|
+
contentType: string;
|
|
156
|
+
};
|
|
157
|
+
url: {
|
|
158
|
+
type: string;
|
|
159
|
+
};
|
|
160
|
+
primary: {
|
|
161
|
+
type: string;
|
|
162
|
+
};
|
|
163
|
+
size: {
|
|
164
|
+
type: string;
|
|
165
|
+
enum: string[];
|
|
166
|
+
};
|
|
167
|
+
theme: {
|
|
168
|
+
type: string;
|
|
169
|
+
enum: string[];
|
|
170
|
+
};
|
|
171
|
+
img: {
|
|
172
|
+
anyOf: ({
|
|
173
|
+
type: string;
|
|
174
|
+
additionalProperties?: undefined;
|
|
175
|
+
required?: undefined;
|
|
176
|
+
properties?: undefined;
|
|
177
|
+
} | {
|
|
178
|
+
type: string;
|
|
179
|
+
additionalProperties: boolean;
|
|
180
|
+
required: string[];
|
|
181
|
+
properties: {
|
|
182
|
+
data: {
|
|
183
|
+
type: string;
|
|
184
|
+
};
|
|
185
|
+
position: {
|
|
186
|
+
type: string;
|
|
187
|
+
enum: string[];
|
|
188
|
+
};
|
|
189
|
+
alt: {
|
|
190
|
+
type: string;
|
|
191
|
+
contentType: string;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
})[];
|
|
195
|
+
};
|
|
196
|
+
metrikaGoals: {
|
|
197
|
+
anyOf: ({
|
|
198
|
+
type: string;
|
|
199
|
+
items?: undefined;
|
|
200
|
+
} | {
|
|
201
|
+
type: string;
|
|
202
|
+
items: {
|
|
203
|
+
type: string;
|
|
204
|
+
additionalProperties?: undefined;
|
|
205
|
+
required?: undefined;
|
|
206
|
+
properties?: undefined;
|
|
207
|
+
};
|
|
208
|
+
} | {
|
|
209
|
+
type: string;
|
|
210
|
+
items: {
|
|
211
|
+
type: string;
|
|
212
|
+
additionalProperties: boolean;
|
|
213
|
+
required: string[];
|
|
214
|
+
properties: {
|
|
215
|
+
name: {
|
|
216
|
+
type: string;
|
|
217
|
+
};
|
|
218
|
+
isCrossSite: {
|
|
219
|
+
type: string;
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
})[];
|
|
224
|
+
};
|
|
225
|
+
pixelEvents: {
|
|
226
|
+
type: string;
|
|
227
|
+
items: {
|
|
228
|
+
type: string;
|
|
229
|
+
required: string[];
|
|
230
|
+
additionalProperties: boolean;
|
|
231
|
+
properties: {
|
|
232
|
+
name: {
|
|
233
|
+
type: string;
|
|
234
|
+
enum: import("../..").PixelEventType[];
|
|
235
|
+
};
|
|
236
|
+
data: {};
|
|
237
|
+
};
|
|
238
|
+
select: {
|
|
239
|
+
$data: string;
|
|
240
|
+
};
|
|
241
|
+
selectCases: {
|
|
242
|
+
SubmitApplication: {
|
|
243
|
+
additionalProperties: boolean;
|
|
244
|
+
properties: {
|
|
245
|
+
name: {};
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
Contact: {
|
|
249
|
+
additionalProperties: boolean;
|
|
250
|
+
properties: {
|
|
251
|
+
name: {};
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
Lead: {
|
|
255
|
+
additionalProperties: boolean;
|
|
256
|
+
properties: {
|
|
257
|
+
name: {};
|
|
258
|
+
data: {
|
|
259
|
+
type: string;
|
|
260
|
+
additionalProperties: boolean;
|
|
261
|
+
properties: {
|
|
262
|
+
content_category: {
|
|
263
|
+
type: string;
|
|
264
|
+
};
|
|
265
|
+
content_name: {
|
|
266
|
+
type: string;
|
|
267
|
+
};
|
|
268
|
+
currency: {
|
|
269
|
+
type: string;
|
|
270
|
+
};
|
|
271
|
+
value: {
|
|
272
|
+
type: string;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
target: {
|
|
282
|
+
type: string;
|
|
283
|
+
enum: string[];
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
if: {
|
|
287
|
+
properties: {
|
|
288
|
+
theme: {
|
|
289
|
+
enum: string[];
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
then: {
|
|
294
|
+
required: string[];
|
|
295
|
+
};
|
|
296
|
+
else: {
|
|
297
|
+
required: string[];
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
title: {
|
|
301
|
+
oneOf: ({
|
|
302
|
+
type: string;
|
|
303
|
+
additionalProperties: boolean;
|
|
304
|
+
required: string[];
|
|
305
|
+
properties: {
|
|
306
|
+
text: {
|
|
307
|
+
type: string;
|
|
308
|
+
contentType: string;
|
|
309
|
+
};
|
|
310
|
+
textSize: {
|
|
311
|
+
type: string;
|
|
312
|
+
enum: string[];
|
|
313
|
+
};
|
|
314
|
+
url: {
|
|
315
|
+
type: string;
|
|
316
|
+
};
|
|
317
|
+
resetMargin: {
|
|
318
|
+
type: string;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
} | {
|
|
322
|
+
type: string;
|
|
323
|
+
contentType: string;
|
|
324
|
+
})[];
|
|
325
|
+
};
|
|
326
|
+
size: {
|
|
327
|
+
type: string;
|
|
328
|
+
enum: string[];
|
|
329
|
+
};
|
|
330
|
+
additionalInfo: {
|
|
331
|
+
type: string;
|
|
332
|
+
contentType: string;
|
|
333
|
+
};
|
|
334
|
+
links: {
|
|
335
|
+
type: string;
|
|
336
|
+
items: {
|
|
337
|
+
type: string;
|
|
338
|
+
properties: {
|
|
339
|
+
when: {
|
|
340
|
+
type: string;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
buttons: {
|
|
346
|
+
type: string;
|
|
347
|
+
items: {
|
|
348
|
+
type: string;
|
|
349
|
+
properties: {
|
|
350
|
+
when: {
|
|
351
|
+
type: string;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
animated: {
|
|
357
|
+
type: string;
|
|
358
|
+
};
|
|
359
|
+
anchor: {
|
|
360
|
+
type: string;
|
|
361
|
+
additionalProperties: boolean;
|
|
362
|
+
required: string[];
|
|
363
|
+
properties: {
|
|
364
|
+
text: {
|
|
365
|
+
type: string;
|
|
366
|
+
contentType: string;
|
|
367
|
+
};
|
|
368
|
+
url: {
|
|
369
|
+
type: string;
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
visible: {
|
|
374
|
+
type: string;
|
|
375
|
+
enum: string[];
|
|
376
|
+
};
|
|
377
|
+
resetPaddings: {
|
|
378
|
+
type: string;
|
|
379
|
+
};
|
|
380
|
+
type: {};
|
|
381
|
+
when: {};
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
};
|
|
@@ -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
|
|
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
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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;
|