@micromag/screen-map 0.2.408 → 0.3.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.
- package/assets/css/styles.css +1 -1
- package/es/index.js +382 -269
- package/lib/index.js +386 -273
- package/package.json +13 -13
package/es/index.js
CHANGED
|
@@ -2,22 +2,22 @@ import { useIntl, FormattedMessage, defineMessage } from 'react-intl';
|
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
|
-
import React, { useState, useRef, useCallback, useMemo, useEffect } from 'react';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
5
|
import classNames from 'classnames';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import React, { useState, useRef, useCallback, useMemo, useEffect } from 'react';
|
|
8
8
|
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { PlaceholderMap, Transitions, Button, ScreenElement } from '@micromag/core/components';
|
|
10
|
+
import { useGoogleKeys, useScreenSize, useScreenRenderContext, useScreenState } from '@micromag/core/contexts';
|
|
11
11
|
import { useTrackScreenEvent, useResizeObserver } from '@micromag/core/hooks';
|
|
12
12
|
import { getStyleFromColor, isTextFilled } from '@micromag/core/utils';
|
|
13
13
|
import { Background } from '@micromag/element-background';
|
|
14
|
+
import ButtonElement from '@micromag/element-button';
|
|
14
15
|
import Container from '@micromag/element-container';
|
|
15
|
-
import Map from '@micromag/element-map';
|
|
16
16
|
import Heading from '@micromag/element-heading';
|
|
17
|
+
import ImageElement from '@micromag/element-image';
|
|
18
|
+
import Map from '@micromag/element-map';
|
|
17
19
|
import Scroll from '@micromag/element-scroll';
|
|
18
20
|
import Text from '@micromag/element-text';
|
|
19
|
-
import ImageElement from '@micromag/element-image';
|
|
20
|
-
import ButtonElement from '@micromag/element-button';
|
|
21
21
|
import _extends from '@babel/runtime/helpers/extends';
|
|
22
22
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
23
23
|
import { Map as Map$1, Container as Container$1 } from '@micromag/transforms/apple-news';
|
|
@@ -38,6 +38,9 @@ var propTypes = {
|
|
|
38
38
|
button: PropTypes$1.textElement,
|
|
39
39
|
openedMarkerSpacerHeight: PropTypes.number,
|
|
40
40
|
withMarkerImages: PropTypes.bool,
|
|
41
|
+
center: PropTypes$1.geoPosition,
|
|
42
|
+
zoom: PropTypes.number,
|
|
43
|
+
fitBounds: PropTypes.bool,
|
|
41
44
|
background: PropTypes$1.backgroundElement,
|
|
42
45
|
current: PropTypes.bool,
|
|
43
46
|
active: PropTypes.bool,
|
|
@@ -51,6 +54,9 @@ var defaultProps = {
|
|
|
51
54
|
layout: 'normal',
|
|
52
55
|
draggable: true,
|
|
53
56
|
markers: [],
|
|
57
|
+
center: defaultCenter,
|
|
58
|
+
zoom: defaultZoom,
|
|
59
|
+
fitBounds: true,
|
|
54
60
|
title: null,
|
|
55
61
|
description: null,
|
|
56
62
|
button: null,
|
|
@@ -66,8 +72,8 @@ var defaultProps = {
|
|
|
66
72
|
className: null
|
|
67
73
|
};
|
|
68
74
|
|
|
69
|
-
|
|
70
|
-
var
|
|
75
|
+
function MapScreen(_ref) {
|
|
76
|
+
var _ref16;
|
|
71
77
|
|
|
72
78
|
var layout = _ref.layout,
|
|
73
79
|
draggable = _ref.draggable,
|
|
@@ -77,6 +83,9 @@ var MapScreen = function MapScreen(_ref) {
|
|
|
77
83
|
button = _ref.button,
|
|
78
84
|
openedMarkerSpacerHeight = _ref.openedMarkerSpacerHeight,
|
|
79
85
|
withMarkerImages = _ref.withMarkerImages,
|
|
86
|
+
zoom = _ref.zoom,
|
|
87
|
+
center = _ref.center,
|
|
88
|
+
fitBounds = _ref.fitBounds,
|
|
80
89
|
background = _ref.background,
|
|
81
90
|
current = _ref.current,
|
|
82
91
|
active = _ref.active,
|
|
@@ -120,6 +129,8 @@ var MapScreen = function MapScreen(_ref) {
|
|
|
120
129
|
isStatic = _useScreenRenderConte.isStatic,
|
|
121
130
|
isCapture = _useScreenRenderConte.isCapture;
|
|
122
131
|
|
|
132
|
+
var screenState = useScreenState();
|
|
133
|
+
|
|
123
134
|
var _useState3 = useState(false),
|
|
124
135
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
125
136
|
ready = _useState4[0],
|
|
@@ -186,8 +197,8 @@ var MapScreen = function MapScreen(_ref) {
|
|
|
186
197
|
trackScreenEvent('click_close', 'Close icon');
|
|
187
198
|
closeMarker();
|
|
188
199
|
}, [setOpened, onEnableInteraction, trackScreenEvent]);
|
|
189
|
-
var onMapDragEnd = useCallback(function (
|
|
190
|
-
var coords =
|
|
200
|
+
var onMapDragEnd = useCallback(function (newCenter) {
|
|
201
|
+
var coords = newCenter.toJSON();
|
|
191
202
|
trackScreenEvent('drag_map', "Latitude: ".concat(coords.lat.toFixed(4), ", Longitude: ").concat(coords.lng.toFixed(4)), {
|
|
192
203
|
coords: coords
|
|
193
204
|
});
|
|
@@ -261,211 +272,111 @@ var MapScreen = function MapScreen(_ref) {
|
|
|
261
272
|
}
|
|
262
273
|
|
|
263
274
|
return function () {};
|
|
264
|
-
}, [withMarkerImages, markers]);
|
|
265
|
-
var element = null;
|
|
275
|
+
}, [withMarkerImages, markers]); // Switch state
|
|
266
276
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
});
|
|
272
|
-
} else if (isPreview) {
|
|
273
|
-
if (width > 0 && height > 0 && apiKey !== null) {
|
|
274
|
-
var staticUrl = "https://maps.googleapis.com/maps/api/staticmap?size=".concat(Math.round(width), "x").concat(Math.round(height));
|
|
275
|
-
|
|
276
|
-
if (defaultCenter !== null && (markers === null || markers.length === 0)) {
|
|
277
|
-
var _ref7 = defaultCenter || {},
|
|
278
|
-
_ref7$lat = _ref7.lat,
|
|
279
|
-
lat = _ref7$lat === void 0 ? null : _ref7$lat,
|
|
280
|
-
_ref7$lng = _ref7.lng,
|
|
281
|
-
lng = _ref7$lng === void 0 ? null : _ref7$lng;
|
|
282
|
-
|
|
283
|
-
staticUrl += "¢er=".concat(lat, ",").concat(lng);
|
|
284
|
-
}
|
|
277
|
+
useEffect(function () {
|
|
278
|
+
if (!isEdit && !isPreview) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
285
281
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
282
|
+
var _ref7 = screenState !== null ? screenState.split('.') : [],
|
|
283
|
+
_ref8 = _slicedToArray(_ref7, 2),
|
|
284
|
+
_ref8$ = _ref8[0],
|
|
285
|
+
stateId = _ref8$ === void 0 ? null : _ref8$,
|
|
286
|
+
_ref8$2 = _ref8[1],
|
|
287
|
+
markerIndex = _ref8$2 === void 0 ? null : _ref8$2;
|
|
288
|
+
|
|
289
|
+
if (stateId === 'intro') {
|
|
290
|
+
setOpened(false);
|
|
291
|
+
setSelectedMarkerIndex(null);
|
|
292
|
+
} else if (stateId === 'map') {
|
|
293
|
+
setOpened(true);
|
|
294
|
+
setSelectedMarkerIndex(null);
|
|
295
|
+
} else if (stateId === 'markers') {
|
|
296
|
+
setOpened(true);
|
|
297
|
+
setSelectedMarkerIndex(parseInt(markerIndex, 10));
|
|
298
|
+
}
|
|
299
|
+
}, [screenState, isEdit, setOpened]);
|
|
300
|
+
var staticUrl;
|
|
301
|
+
|
|
302
|
+
if (width > 0 && height > 0 && apiKey !== null) {
|
|
303
|
+
var correctMarkers = markers !== null ? markers.filter(function (it) {
|
|
304
|
+
return it !== null;
|
|
305
|
+
}).filter(function (_ref9) {
|
|
306
|
+
var _ref9$geoPosition = _ref9.geoPosition,
|
|
307
|
+
geoPosition = _ref9$geoPosition === void 0 ? null : _ref9$geoPosition;
|
|
308
|
+
return geoPosition !== null;
|
|
309
|
+
}) : null;
|
|
310
|
+
staticUrl = "https://maps.googleapis.com/maps/api/staticmap?size=".concat(Math.round(width), "x").concat(Math.round(height));
|
|
311
|
+
|
|
312
|
+
if (center !== null && (correctMarkers === null || correctMarkers.length === 0)) {
|
|
313
|
+
var _ref10 = center || {},
|
|
314
|
+
_ref10$lat = _ref10.lat,
|
|
315
|
+
lat = _ref10$lat === void 0 ? null : _ref10$lat,
|
|
316
|
+
_ref10$lng = _ref10.lng,
|
|
317
|
+
lng = _ref10$lng === void 0 ? null : _ref10$lng;
|
|
318
|
+
|
|
319
|
+
staticUrl += "¢er=".concat(lat, ",").concat(lng);
|
|
320
|
+
}
|
|
289
321
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
322
|
+
if (zoom !== null) {
|
|
323
|
+
staticUrl += "&zoom=".concat(zoom);
|
|
324
|
+
}
|
|
293
325
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
326
|
+
if (apiKey !== null) {
|
|
327
|
+
staticUrl += "&key=".concat(apiKey);
|
|
328
|
+
}
|
|
297
329
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
_ref8$geoPosition = _ref8.geoPosition,
|
|
302
|
-
geoPosition = _ref8$geoPosition === void 0 ? null : _ref8$geoPosition;
|
|
330
|
+
if (locale !== null) {
|
|
331
|
+
staticUrl += "&language=".concat(locale);
|
|
332
|
+
}
|
|
303
333
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
334
|
+
if (correctMarkers !== null) {
|
|
335
|
+
staticUrl += correctMarkers.map(function (marker) {
|
|
336
|
+
var _ref11 = marker || {},
|
|
337
|
+
_ref11$geoPosition = _ref11.geoPosition,
|
|
338
|
+
geoPosition = _ref11$geoPosition === void 0 ? null : _ref11$geoPosition;
|
|
309
339
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
340
|
+
var _ref12 = geoPosition || {},
|
|
341
|
+
_ref12$lat = _ref12.lat,
|
|
342
|
+
lat = _ref12$lat === void 0 ? null : _ref12$lat,
|
|
343
|
+
_ref12$lng = _ref12.lng,
|
|
344
|
+
lng = _ref12$lng === void 0 ? null : _ref12$lng;
|
|
313
345
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
346
|
+
var _ref13 = marker || {},
|
|
347
|
+
_ref13$image = _ref13.image,
|
|
348
|
+
image = _ref13$image === void 0 ? null : _ref13$image;
|
|
317
349
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
350
|
+
var _ref14 = image || {},
|
|
351
|
+
_ref14$url = _ref14.url,
|
|
352
|
+
url = _ref14$url === void 0 ? null : _ref14$url;
|
|
321
353
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
url: staticUrl,
|
|
325
|
-
metadata: {
|
|
326
|
-
width: Math.min(640, width),
|
|
327
|
-
height: Math.min(640, height)
|
|
328
|
-
}
|
|
329
|
-
},
|
|
330
|
-
width: width,
|
|
331
|
-
height: height,
|
|
332
|
-
objectFit: {
|
|
333
|
-
fit: 'cover'
|
|
334
|
-
}
|
|
335
|
-
});
|
|
354
|
+
return lat !== null && lng !== null ? "&markers=".concat(url !== null ? "icon:".concat(url) : '', "%7C").concat(lat, ",").concat(lng) : '';
|
|
355
|
+
}).join('');
|
|
336
356
|
}
|
|
337
|
-
} else {
|
|
338
|
-
var renderedMarker = hasSelectedMarker ? finalMarkers[selectedMarkerIndex] : lastRenderedMarker.current;
|
|
339
|
-
|
|
340
|
-
var _ref12 = renderedMarker || {},
|
|
341
|
-
_ref12$title = _ref12.title,
|
|
342
|
-
markerTitle = _ref12$title === void 0 ? null : _ref12$title,
|
|
343
|
-
_ref12$subtitle = _ref12.subtitle,
|
|
344
|
-
markerSubtitle = _ref12$subtitle === void 0 ? null : _ref12$subtitle,
|
|
345
|
-
_ref12$description = _ref12.description,
|
|
346
|
-
markerDescription = _ref12$description === void 0 ? null : _ref12$description,
|
|
347
|
-
_ref12$image = _ref12.image,
|
|
348
|
-
markerImage = _ref12$image === void 0 ? null : _ref12$image;
|
|
349
|
-
|
|
350
|
-
var hasMarkerTitle = markerTitle !== null;
|
|
351
|
-
var hasMarkerSubtitle = markerSubtitle !== null;
|
|
352
|
-
var hasMarkerDescription = markerDescription !== null;
|
|
353
|
-
var hasMarkerImage = markerImage !== null;
|
|
354
|
-
var hasTitle = isTextFilled(title);
|
|
355
|
-
var hasDescription = isTextFilled(description);
|
|
356
|
-
var hasButton = isTextFilled(button);
|
|
357
|
-
element = /*#__PURE__*/React.createElement(Transitions, {
|
|
358
|
-
transitions: transitions,
|
|
359
|
-
playing: transitionPlaying,
|
|
360
|
-
fullscreen: true,
|
|
361
|
-
disabled: transitionDisabled
|
|
362
|
-
}, /*#__PURE__*/React.createElement(Map, {
|
|
363
|
-
key: "map",
|
|
364
|
-
center: defaultCenter,
|
|
365
|
-
zoom: defaultZoom,
|
|
366
|
-
draggable: draggable,
|
|
367
|
-
markers: finalMarkers,
|
|
368
|
-
fitBounds: true,
|
|
369
|
-
onClickMarker: onClickMarker,
|
|
370
|
-
onReady: onMapReady,
|
|
371
|
-
onDragEnd: onMapDragEnd
|
|
372
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
373
|
-
key: "marker-overlay",
|
|
374
|
-
className: styles.markerOverlayContainer
|
|
375
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
376
|
-
className: styles.markerOverlayScrollable
|
|
377
|
-
}, /*#__PURE__*/React.createElement(Scroll, {
|
|
378
|
-
fullscreen: true,
|
|
379
|
-
disabled: scrollingDisabled,
|
|
380
|
-
onScrolledBottom: onScrolledBottom
|
|
381
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
382
|
-
className: styles.markerOverlaySafe,
|
|
383
|
-
onClick: onClickMap,
|
|
384
|
-
withoutStyle: true,
|
|
385
|
-
style: {
|
|
386
|
-
height: height * openedMarkerSpacerHeight
|
|
387
|
-
},
|
|
388
|
-
disabled: isPreview,
|
|
389
|
-
focusable: current && isView
|
|
390
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
391
|
-
className: styles.markerOverlay,
|
|
392
|
-
style: {
|
|
393
|
-
minHeight: height * (1 - openedMarkerSpacerHeight)
|
|
394
|
-
}
|
|
395
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
396
|
-
className: styles.markerOverlayContent,
|
|
397
|
-
style: markerOverlayContentStyle
|
|
398
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
399
|
-
className: styles.swipeIndicator
|
|
400
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
401
|
-
className: styles.markerOverlayContentInner,
|
|
402
|
-
key: "markerContent-".concat(selectedMarkerIndex),
|
|
403
|
-
ref: markerOverContentInnerRef
|
|
404
|
-
}, hasMarkerImage ? /*#__PURE__*/React.createElement(ImageElement, {
|
|
405
|
-
className: styles.markerImage,
|
|
406
|
-
media: markerImage,
|
|
407
|
-
width: markerOverContentInnerWidth
|
|
408
|
-
}) : null, hasMarkerTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({
|
|
409
|
-
className: styles.markerTitle
|
|
410
|
-
}, markerTitle)) : null, hasMarkerSubtitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({
|
|
411
|
-
size: 3,
|
|
412
|
-
className: styles.markerSubtitle
|
|
413
|
-
}, markerSubtitle)) : null, hasMarkerDescription ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
414
|
-
className: styles.markerDescription
|
|
415
|
-
}, markerDescription)) : null)))))), /*#__PURE__*/React.createElement("div", {
|
|
416
|
-
key: "splash",
|
|
417
|
-
className: classNames([styles.splash])
|
|
418
|
-
}, /*#__PURE__*/React.createElement(ScreenElement, {
|
|
419
|
-
emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
420
|
-
id: "2ZOPe+",
|
|
421
|
-
defaultMessage: [{
|
|
422
|
-
"type": 0,
|
|
423
|
-
"value": "Title"
|
|
424
|
-
}]
|
|
425
|
-
}),
|
|
426
|
-
emptyClassName: styles.emptyTitle,
|
|
427
|
-
isEmpty: !hasTitle
|
|
428
|
-
}, /*#__PURE__*/React.createElement(Heading, Object.assign({
|
|
429
|
-
className: styles.title
|
|
430
|
-
}, title))), /*#__PURE__*/React.createElement(ScreenElement, {
|
|
431
|
-
emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
432
|
-
id: "507VAi",
|
|
433
|
-
defaultMessage: [{
|
|
434
|
-
"type": 0,
|
|
435
|
-
"value": "Description"
|
|
436
|
-
}]
|
|
437
|
-
}),
|
|
438
|
-
emptyClassName: styles.emptyDescription,
|
|
439
|
-
isEmpty: !hasDescription
|
|
440
|
-
}, /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
441
|
-
className: styles.description
|
|
442
|
-
}, description))), /*#__PURE__*/React.createElement(ScreenElement, {
|
|
443
|
-
emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
444
|
-
id: "bv3rRe",
|
|
445
|
-
defaultMessage: [{
|
|
446
|
-
"type": 0,
|
|
447
|
-
"value": "Button"
|
|
448
|
-
}]
|
|
449
|
-
}),
|
|
450
|
-
emptyClassName: styles.emptyButton,
|
|
451
|
-
isEmpty: !hasButton
|
|
452
|
-
}, /*#__PURE__*/React.createElement(ButtonElement, {
|
|
453
|
-
className: styles.splashButton,
|
|
454
|
-
onClick: onButtonClick,
|
|
455
|
-
buttonStyle: button !== null ? button.buttonStyle : null,
|
|
456
|
-
focusable: current && isView
|
|
457
|
-
}, /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
458
|
-
className: styles.button
|
|
459
|
-
}, button))))), !isStatic && !isCapture ? /*#__PURE__*/React.createElement(Button, {
|
|
460
|
-
key: "close-button",
|
|
461
|
-
className: styles.closeButton,
|
|
462
|
-
onClick: onCloseClick,
|
|
463
|
-
focusable: current && isView
|
|
464
|
-
}, "\xD7") : null);
|
|
465
357
|
}
|
|
466
358
|
|
|
359
|
+
var renderedMarker = hasSelectedMarker ? finalMarkers[selectedMarkerIndex] : lastRenderedMarker.current;
|
|
360
|
+
|
|
361
|
+
var _ref15 = renderedMarker || {},
|
|
362
|
+
_ref15$title = _ref15.title,
|
|
363
|
+
markerTitle = _ref15$title === void 0 ? null : _ref15$title,
|
|
364
|
+
_ref15$subtitle = _ref15.subtitle,
|
|
365
|
+
markerSubtitle = _ref15$subtitle === void 0 ? null : _ref15$subtitle,
|
|
366
|
+
_ref15$description = _ref15.description,
|
|
367
|
+
markerDescription = _ref15$description === void 0 ? null : _ref15$description,
|
|
368
|
+
_ref15$image = _ref15.image,
|
|
369
|
+
markerImage = _ref15$image === void 0 ? null : _ref15$image;
|
|
370
|
+
|
|
371
|
+
var hasMarkerTitle = markerTitle !== null;
|
|
372
|
+
var hasMarkerSubtitle = markerSubtitle !== null;
|
|
373
|
+
var hasMarkerDescription = markerDescription !== null;
|
|
374
|
+
var hasMarkerImage = markerImage !== null;
|
|
375
|
+
var hasTitle = isTextFilled(title);
|
|
376
|
+
var hasDescription = isTextFilled(description);
|
|
377
|
+
var hasButton = isTextFilled(button);
|
|
467
378
|
return /*#__PURE__*/React.createElement("div", {
|
|
468
|
-
className: classNames([styles.container, (
|
|
379
|
+
className: classNames([styles.container, (_ref16 = {}, _defineProperty(_ref16, className, className !== null), _defineProperty(_ref16, styles["".concat(layout, "Layout")], layout !== null), _defineProperty(_ref16, styles.opened, opened || isPreview && screenState !== 'intro'), _defineProperty(_ref16, styles.hasSelectedMarker, hasSelectedMarker), _ref16)]),
|
|
469
380
|
"data-screen-ready": finalReady
|
|
470
381
|
}, !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
|
|
471
382
|
color: {
|
|
@@ -479,8 +390,131 @@ var MapScreen = function MapScreen(_ref) {
|
|
|
479
390
|
}) : null, /*#__PURE__*/React.createElement(Container, {
|
|
480
391
|
width: width,
|
|
481
392
|
height: height
|
|
482
|
-
},
|
|
483
|
-
|
|
393
|
+
}, isPlaceholder ? /*#__PURE__*/React.createElement(PlaceholderMap, {
|
|
394
|
+
className: styles.placeholder,
|
|
395
|
+
withImages: withMarkerImages
|
|
396
|
+
}) : /*#__PURE__*/React.createElement(Transitions, {
|
|
397
|
+
transitions: transitions,
|
|
398
|
+
playing: transitionPlaying,
|
|
399
|
+
fullscreen: true,
|
|
400
|
+
disabled: transitionDisabled
|
|
401
|
+
}, isPreview ? /*#__PURE__*/React.createElement(ImageElement, {
|
|
402
|
+
media: staticUrl !== null ? {
|
|
403
|
+
url: staticUrl,
|
|
404
|
+
metadata: {
|
|
405
|
+
width: Math.min(640, width),
|
|
406
|
+
height: Math.min(640, height)
|
|
407
|
+
}
|
|
408
|
+
} : null,
|
|
409
|
+
width: width,
|
|
410
|
+
height: height,
|
|
411
|
+
objectFit: {
|
|
412
|
+
fit: 'cover'
|
|
413
|
+
}
|
|
414
|
+
}) : /*#__PURE__*/React.createElement(Map, {
|
|
415
|
+
key: "map",
|
|
416
|
+
center: center,
|
|
417
|
+
zoom: zoom,
|
|
418
|
+
draggable: draggable,
|
|
419
|
+
markers: finalMarkers,
|
|
420
|
+
fitBounds: fitBounds,
|
|
421
|
+
onClickMarker: onClickMarker,
|
|
422
|
+
onReady: onMapReady,
|
|
423
|
+
onDragEnd: onMapDragEnd
|
|
424
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
425
|
+
key: "marker-overlay",
|
|
426
|
+
className: styles.markerOverlayContainer
|
|
427
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
428
|
+
className: styles.markerOverlayScrollable
|
|
429
|
+
}, /*#__PURE__*/React.createElement(Scroll, {
|
|
430
|
+
fullscreen: true,
|
|
431
|
+
disabled: scrollingDisabled,
|
|
432
|
+
onScrolledBottom: onScrolledBottom
|
|
433
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
434
|
+
className: styles.markerOverlaySafe,
|
|
435
|
+
onClick: onClickMap,
|
|
436
|
+
withoutStyle: true,
|
|
437
|
+
style: {
|
|
438
|
+
height: height * openedMarkerSpacerHeight
|
|
439
|
+
},
|
|
440
|
+
disabled: isPreview,
|
|
441
|
+
focusable: current && isView
|
|
442
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
443
|
+
className: styles.markerOverlay,
|
|
444
|
+
style: {
|
|
445
|
+
minHeight: height * (1 - openedMarkerSpacerHeight)
|
|
446
|
+
}
|
|
447
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
448
|
+
className: styles.markerOverlayContent,
|
|
449
|
+
style: markerOverlayContentStyle
|
|
450
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
451
|
+
className: styles.swipeIndicator
|
|
452
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
453
|
+
className: styles.markerOverlayContentInner,
|
|
454
|
+
key: "markerContent-".concat(selectedMarkerIndex),
|
|
455
|
+
ref: markerOverContentInnerRef
|
|
456
|
+
}, hasMarkerImage ? /*#__PURE__*/React.createElement(ImageElement, {
|
|
457
|
+
className: styles.markerImage,
|
|
458
|
+
media: markerImage,
|
|
459
|
+
width: markerOverContentInnerWidth
|
|
460
|
+
}) : null, hasMarkerTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({
|
|
461
|
+
className: styles.markerTitle
|
|
462
|
+
}, markerTitle)) : null, hasMarkerSubtitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({
|
|
463
|
+
size: 3,
|
|
464
|
+
className: styles.markerSubtitle
|
|
465
|
+
}, markerSubtitle)) : null, hasMarkerDescription ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
466
|
+
className: styles.markerDescription
|
|
467
|
+
}, markerDescription)) : null)))))), /*#__PURE__*/React.createElement("div", {
|
|
468
|
+
key: "splash",
|
|
469
|
+
className: classNames([styles.splash])
|
|
470
|
+
}, /*#__PURE__*/React.createElement(ScreenElement, {
|
|
471
|
+
emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
472
|
+
id: "2ZOPe+",
|
|
473
|
+
defaultMessage: [{
|
|
474
|
+
"type": 0,
|
|
475
|
+
"value": "Title"
|
|
476
|
+
}]
|
|
477
|
+
}),
|
|
478
|
+
emptyClassName: styles.emptyTitle,
|
|
479
|
+
isEmpty: !hasTitle
|
|
480
|
+
}, /*#__PURE__*/React.createElement(Heading, Object.assign({
|
|
481
|
+
className: styles.title
|
|
482
|
+
}, title))), /*#__PURE__*/React.createElement(ScreenElement, {
|
|
483
|
+
emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
484
|
+
id: "507VAi",
|
|
485
|
+
defaultMessage: [{
|
|
486
|
+
"type": 0,
|
|
487
|
+
"value": "Description"
|
|
488
|
+
}]
|
|
489
|
+
}),
|
|
490
|
+
emptyClassName: styles.emptyDescription,
|
|
491
|
+
isEmpty: !hasDescription
|
|
492
|
+
}, /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
493
|
+
className: styles.description
|
|
494
|
+
}, description))), /*#__PURE__*/React.createElement(ScreenElement, {
|
|
495
|
+
emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
496
|
+
id: "bv3rRe",
|
|
497
|
+
defaultMessage: [{
|
|
498
|
+
"type": 0,
|
|
499
|
+
"value": "Button"
|
|
500
|
+
}]
|
|
501
|
+
}),
|
|
502
|
+
emptyClassName: styles.emptyButton,
|
|
503
|
+
isEmpty: !hasButton
|
|
504
|
+
}, /*#__PURE__*/React.createElement(ButtonElement, {
|
|
505
|
+
className: styles.splashButton,
|
|
506
|
+
onClick: onButtonClick,
|
|
507
|
+
buttonStyle: button !== null ? button.buttonStyle : null,
|
|
508
|
+
focusable: current && isView
|
|
509
|
+
}, /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
510
|
+
className: styles.button
|
|
511
|
+
}, button))))), !isStatic && !isCapture && !isPreview && !isEdit ? /*#__PURE__*/React.createElement(Button, {
|
|
512
|
+
key: "close-button",
|
|
513
|
+
className: styles.closeButton,
|
|
514
|
+
onClick: onCloseClick,
|
|
515
|
+
focusable: current && isView
|
|
516
|
+
}, "\xD7") : null)));
|
|
517
|
+
}
|
|
484
518
|
|
|
485
519
|
MapScreen.propTypes = propTypes;
|
|
486
520
|
MapScreen.defaultProps = defaultProps;
|
|
@@ -539,7 +573,7 @@ var definition = [{
|
|
|
539
573
|
type: 'screen',
|
|
540
574
|
group: {
|
|
541
575
|
label: defineMessage({
|
|
542
|
-
id: "
|
|
576
|
+
id: "Z27IP6",
|
|
543
577
|
defaultMessage: [{
|
|
544
578
|
"type": 0,
|
|
545
579
|
"value": "Map"
|
|
@@ -548,7 +582,7 @@ var definition = [{
|
|
|
548
582
|
order: 6
|
|
549
583
|
},
|
|
550
584
|
title: defineMessage({
|
|
551
|
-
id: "
|
|
585
|
+
id: "dPYwJG",
|
|
552
586
|
defaultMessage: [{
|
|
553
587
|
"type": 0,
|
|
554
588
|
"value": "Map"
|
|
@@ -557,79 +591,158 @@ var definition = [{
|
|
|
557
591
|
component: MapScreen,
|
|
558
592
|
layouts: ['normal'],
|
|
559
593
|
transforms: transforms,
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
type: 'heading-element',
|
|
563
|
-
theme: {
|
|
564
|
-
textStyle: 'heading1'
|
|
565
|
-
},
|
|
594
|
+
states: [{
|
|
595
|
+
id: 'intro',
|
|
566
596
|
label: defineMessage({
|
|
567
|
-
id: "
|
|
597
|
+
id: "BgrRxZ",
|
|
568
598
|
defaultMessage: [{
|
|
569
599
|
"type": 0,
|
|
570
|
-
"value": "
|
|
600
|
+
"value": "Intro"
|
|
571
601
|
}]
|
|
572
|
-
})
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
602
|
+
}),
|
|
603
|
+
fields: [{
|
|
604
|
+
name: 'title',
|
|
605
|
+
type: 'heading-element',
|
|
606
|
+
theme: {
|
|
607
|
+
textStyle: 'heading1'
|
|
608
|
+
},
|
|
609
|
+
label: defineMessage({
|
|
610
|
+
id: "+AEVbJ",
|
|
611
|
+
defaultMessage: [{
|
|
612
|
+
"type": 0,
|
|
613
|
+
"value": "Title"
|
|
614
|
+
}]
|
|
615
|
+
})
|
|
616
|
+
}, {
|
|
617
|
+
name: 'description',
|
|
618
|
+
type: 'text-element',
|
|
619
|
+
theme: {
|
|
620
|
+
textStyle: 'text'
|
|
621
|
+
},
|
|
622
|
+
label: defineMessage({
|
|
623
|
+
id: "ZCe0r4",
|
|
624
|
+
defaultMessage: [{
|
|
625
|
+
"type": 0,
|
|
626
|
+
"value": "Description"
|
|
627
|
+
}]
|
|
628
|
+
})
|
|
629
|
+
}, {
|
|
630
|
+
name: 'button',
|
|
631
|
+
type: 'button-element',
|
|
632
|
+
theme: {
|
|
633
|
+
textStyle: 'button'
|
|
634
|
+
},
|
|
635
|
+
label: defineMessage({
|
|
636
|
+
id: "i6bmbD",
|
|
637
|
+
defaultMessage: [{
|
|
638
|
+
"type": 0,
|
|
639
|
+
"value": "Button"
|
|
640
|
+
}]
|
|
641
|
+
})
|
|
642
|
+
}]
|
|
599
643
|
}, {
|
|
600
|
-
|
|
601
|
-
type: 'toggle',
|
|
602
|
-
defaultValue: true,
|
|
644
|
+
id: 'map',
|
|
603
645
|
label: defineMessage({
|
|
604
|
-
id: "
|
|
646
|
+
id: "eYHEYe",
|
|
605
647
|
defaultMessage: [{
|
|
606
648
|
"type": 0,
|
|
607
|
-
"value": "
|
|
649
|
+
"value": "Map"
|
|
608
650
|
}]
|
|
609
|
-
})
|
|
651
|
+
}),
|
|
652
|
+
fields: [{
|
|
653
|
+
name: 'draggable',
|
|
654
|
+
type: 'toggle',
|
|
655
|
+
defaultValue: true,
|
|
656
|
+
label: defineMessage({
|
|
657
|
+
id: "A7ncT3",
|
|
658
|
+
defaultMessage: [{
|
|
659
|
+
"type": 0,
|
|
660
|
+
"value": "Draggable"
|
|
661
|
+
}]
|
|
662
|
+
})
|
|
663
|
+
}, {
|
|
664
|
+
name: 'fitBounds',
|
|
665
|
+
type: 'toggle',
|
|
666
|
+
defaultValue: true,
|
|
667
|
+
label: defineMessage({
|
|
668
|
+
id: "NVUpOG",
|
|
669
|
+
defaultMessage: [{
|
|
670
|
+
"type": 0,
|
|
671
|
+
"value": "Map fit markers"
|
|
672
|
+
}]
|
|
673
|
+
})
|
|
674
|
+
}, {
|
|
675
|
+
name: 'zoom',
|
|
676
|
+
type: 'slider',
|
|
677
|
+
defaultValue: 9,
|
|
678
|
+
min: 0,
|
|
679
|
+
max: 16,
|
|
680
|
+
label: defineMessage({
|
|
681
|
+
id: "vRzzo6",
|
|
682
|
+
defaultMessage: [{
|
|
683
|
+
"type": 0,
|
|
684
|
+
"value": "Zoom"
|
|
685
|
+
}]
|
|
686
|
+
})
|
|
687
|
+
}, {
|
|
688
|
+
name: 'center',
|
|
689
|
+
type: 'geo-position',
|
|
690
|
+
label: defineMessage({
|
|
691
|
+
id: "W5qWPj",
|
|
692
|
+
defaultMessage: [{
|
|
693
|
+
"type": 0,
|
|
694
|
+
"value": "Center"
|
|
695
|
+
}]
|
|
696
|
+
})
|
|
697
|
+
}]
|
|
610
698
|
}, {
|
|
611
|
-
|
|
612
|
-
type: 'markers',
|
|
613
|
-
theme: {
|
|
614
|
-
title: {
|
|
615
|
-
textStyle: 'heading3'
|
|
616
|
-
},
|
|
617
|
-
description: {
|
|
618
|
-
textStyle: 'text'
|
|
619
|
-
}
|
|
620
|
-
},
|
|
699
|
+
id: 'markers',
|
|
621
700
|
label: defineMessage({
|
|
622
|
-
id: "
|
|
701
|
+
id: "+LvOvJ",
|
|
623
702
|
defaultMessage: [{
|
|
624
703
|
"type": 0,
|
|
625
704
|
"value": "Markers"
|
|
626
705
|
}]
|
|
627
|
-
})
|
|
628
|
-
|
|
706
|
+
}),
|
|
707
|
+
repeatable: true,
|
|
708
|
+
fieldName: 'markers',
|
|
709
|
+
fields: [{
|
|
710
|
+
name: 'title',
|
|
711
|
+
type: 'heading-element',
|
|
712
|
+
label: defineMessage({
|
|
713
|
+
id: "+AEVbJ",
|
|
714
|
+
defaultMessage: [{
|
|
715
|
+
"type": 0,
|
|
716
|
+
"value": "Title"
|
|
717
|
+
}]
|
|
718
|
+
})
|
|
719
|
+
}, {
|
|
720
|
+
name: 'description',
|
|
721
|
+
type: 'text-element',
|
|
722
|
+
label: defineMessage({
|
|
723
|
+
id: "ZCe0r4",
|
|
724
|
+
defaultMessage: [{
|
|
725
|
+
"type": 0,
|
|
726
|
+
"value": "Description"
|
|
727
|
+
}]
|
|
728
|
+
})
|
|
729
|
+
}, {
|
|
730
|
+
name: 'geoPosition',
|
|
731
|
+
type: 'geo-position',
|
|
732
|
+
label: defineMessage({
|
|
733
|
+
id: "u3ok54",
|
|
734
|
+
defaultMessage: [{
|
|
735
|
+
"type": 0,
|
|
736
|
+
"value": "Position"
|
|
737
|
+
}]
|
|
738
|
+
})
|
|
739
|
+
}]
|
|
740
|
+
}],
|
|
741
|
+
fields: [{
|
|
629
742
|
name: 'background',
|
|
630
743
|
type: 'background',
|
|
631
744
|
label: defineMessage({
|
|
632
|
-
id: "
|
|
745
|
+
id: "cDj1mZ",
|
|
633
746
|
defaultMessage: [{
|
|
634
747
|
"type": 0,
|
|
635
748
|
"value": "Background"
|
|
@@ -641,7 +754,7 @@ var definition = [{
|
|
|
641
754
|
type: 'screen',
|
|
642
755
|
group: {
|
|
643
756
|
label: defineMessage({
|
|
644
|
-
id: "
|
|
757
|
+
id: "Z27IP6",
|
|
645
758
|
defaultMessage: [{
|
|
646
759
|
"type": 0,
|
|
647
760
|
"value": "Map"
|
|
@@ -650,7 +763,7 @@ var definition = [{
|
|
|
650
763
|
order: 6
|
|
651
764
|
},
|
|
652
765
|
title: defineMessage({
|
|
653
|
-
id: "
|
|
766
|
+
id: "ro6yHS",
|
|
654
767
|
defaultMessage: [{
|
|
655
768
|
"type": 0,
|
|
656
769
|
"value": "Map with image markers"
|
|
@@ -666,7 +779,7 @@ var definition = [{
|
|
|
666
779
|
textStyle: 'heading1'
|
|
667
780
|
},
|
|
668
781
|
label: defineMessage({
|
|
669
|
-
id: "
|
|
782
|
+
id: "+AEVbJ",
|
|
670
783
|
defaultMessage: [{
|
|
671
784
|
"type": 0,
|
|
672
785
|
"value": "Title"
|
|
@@ -679,7 +792,7 @@ var definition = [{
|
|
|
679
792
|
textStyle: 'text'
|
|
680
793
|
},
|
|
681
794
|
label: defineMessage({
|
|
682
|
-
id: "
|
|
795
|
+
id: "ZCe0r4",
|
|
683
796
|
defaultMessage: [{
|
|
684
797
|
"type": 0,
|
|
685
798
|
"value": "Description"
|
|
@@ -692,7 +805,7 @@ var definition = [{
|
|
|
692
805
|
textStyle: 'button'
|
|
693
806
|
},
|
|
694
807
|
label: defineMessage({
|
|
695
|
-
id: "
|
|
808
|
+
id: "i6bmbD",
|
|
696
809
|
defaultMessage: [{
|
|
697
810
|
"type": 0,
|
|
698
811
|
"value": "Button"
|
|
@@ -703,7 +816,7 @@ var definition = [{
|
|
|
703
816
|
type: 'toggle',
|
|
704
817
|
defaultValue: true,
|
|
705
818
|
label: defineMessage({
|
|
706
|
-
id: "
|
|
819
|
+
id: "A7ncT3",
|
|
707
820
|
defaultMessage: [{
|
|
708
821
|
"type": 0,
|
|
709
822
|
"value": "Draggable"
|
|
@@ -721,7 +834,7 @@ var definition = [{
|
|
|
721
834
|
}
|
|
722
835
|
},
|
|
723
836
|
label: defineMessage({
|
|
724
|
-
id: "
|
|
837
|
+
id: "CW3KAC",
|
|
725
838
|
defaultMessage: [{
|
|
726
839
|
"type": 0,
|
|
727
840
|
"value": "Markers with image"
|
|
@@ -731,7 +844,7 @@ var definition = [{
|
|
|
731
844
|
name: 'background',
|
|
732
845
|
type: 'background',
|
|
733
846
|
label: defineMessage({
|
|
734
|
-
id: "
|
|
847
|
+
id: "cDj1mZ",
|
|
735
848
|
defaultMessage: [{
|
|
736
849
|
"type": 0,
|
|
737
850
|
"value": "Background"
|