@draftbit/core 42.4.2-50ce38.2 → 42.4.2-717ab1.2
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/lib/commonjs/components/Accordion/AccordionItem.js +16 -5
- package/lib/commonjs/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/Accordion/index.js.map +1 -1
- package/lib/commonjs/components/ActionSheet/ActionSheetCancel.js.map +1 -1
- package/lib/commonjs/components/ActionSheet/ActionSheetItem.js.map +1 -1
- package/lib/commonjs/components/ActionSheet/index.js.map +1 -1
- package/lib/commonjs/components/AnimatedCircularProgress.js +11 -3
- package/lib/commonjs/components/AnimatedCircularProgress.js.map +1 -1
- package/lib/commonjs/components/AspectRatio.js +15 -2
- package/lib/commonjs/components/AspectRatio.js.map +1 -1
- package/lib/commonjs/components/AvatarEdit.js +16 -5
- package/lib/commonjs/components/AvatarEdit.js.map +1 -1
- package/lib/commonjs/components/Button.js +25 -11
- package/lib/commonjs/components/Button.js.map +1 -1
- package/lib/commonjs/components/CardBlock.js +17 -5
- package/lib/commonjs/components/CardBlock.js.map +1 -1
- package/lib/commonjs/components/CardContainer.js +14 -5
- package/lib/commonjs/components/CardContainer.js.map +1 -1
- package/lib/commonjs/components/CardContainerRating.js +16 -5
- package/lib/commonjs/components/CardContainerRating.js.map +1 -1
- package/lib/commonjs/components/CardInline.js.map +1 -1
- package/lib/commonjs/components/Carousel.js +15 -5
- package/lib/commonjs/components/Carousel.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +14 -6
- package/lib/commonjs/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/Checkbox/context.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/CircleImage.js +18 -5
- package/lib/commonjs/components/CircleImage.js.map +1 -1
- package/lib/commonjs/components/Config.js.map +1 -1
- package/lib/commonjs/components/Container.js +14 -5
- package/lib/commonjs/components/Container.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/commonjs/components/DeprecatedButton.js +15 -4
- package/lib/commonjs/components/DeprecatedButton.js.map +1 -1
- package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -14
- package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/commonjs/components/Elevation.js +14 -3
- package/lib/commonjs/components/Elevation.js.map +1 -1
- package/lib/commonjs/components/FAB.js +16 -5
- package/lib/commonjs/components/FAB.js.map +1 -1
- package/lib/commonjs/components/FieldSearchBarFull.js +1 -1
- package/lib/commonjs/components/FieldSearchBarFull.js.map +1 -1
- package/lib/commonjs/components/FormRow.js +18 -5
- package/lib/commonjs/components/FormRow.js.map +1 -1
- package/lib/commonjs/components/Header.js.map +1 -1
- package/lib/commonjs/components/HeaderLarge.js.map +1 -1
- package/lib/commonjs/components/HeaderMedium.js.map +1 -1
- package/lib/commonjs/components/HeaderOverline.js.map +1 -1
- package/lib/commonjs/components/IconButton.js +18 -5
- package/lib/commonjs/components/IconButton.js.map +1 -1
- package/lib/commonjs/components/Image.js +16 -6
- package/lib/commonjs/components/Image.js.map +1 -1
- package/lib/commonjs/components/Justification.js +2 -1
- package/lib/commonjs/components/Layout.js +41 -22
- package/lib/commonjs/components/Layout.js.map +1 -1
- package/lib/commonjs/components/{MapView/MapCallout.native.js → Markdown.js} +21 -23
- package/lib/commonjs/components/Markdown.js.map +1 -0
- package/lib/commonjs/components/NumberInput.js +15 -3
- package/lib/commonjs/components/NumberInput.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerTypes.js +2 -1
- package/lib/commonjs/components/Portal/PortalManager.js.map +1 -1
- package/lib/commonjs/components/ProgressBar.js +19 -6
- package/lib/commonjs/components/ProgressBar.js.map +1 -1
- package/lib/commonjs/components/ProgressCircle.js.map +1 -1
- package/lib/commonjs/components/ProgressIndicator.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js +14 -5
- package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +11 -2
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +15 -5
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/components/ResizeMode.js +2 -1
- package/lib/commonjs/components/Row.js.map +1 -1
- package/lib/commonjs/components/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/components/RowHeadlineImageCaption.js.map +1 -1
- package/lib/commonjs/components/RowHeadlineImageIcon.js.map +1 -1
- package/lib/commonjs/components/ScreenContainer.js +18 -5
- package/lib/commonjs/components/ScreenContainer.js.map +1 -1
- package/lib/commonjs/components/Slider.js +17 -5
- package/lib/commonjs/components/Slider.js.map +1 -1
- package/lib/commonjs/components/StepIndicator.js.map +1 -1
- package/lib/commonjs/components/Stepper.js.map +1 -1
- package/lib/commonjs/components/Surface.js +11 -4
- package/lib/commonjs/components/Surface.js.map +1 -1
- package/lib/commonjs/components/Swiper/Swiper.js.map +1 -1
- package/lib/commonjs/components/TextField.js +18 -7
- package/lib/commonjs/components/TextField.js.map +1 -1
- package/lib/commonjs/components/TextInput.js +12 -2
- package/lib/commonjs/components/TextInput.js.map +1 -1
- package/lib/commonjs/components/ToggleButton.js +17 -5
- package/lib/commonjs/components/ToggleButton.js.map +1 -1
- package/lib/commonjs/components/Touchable.js +16 -5
- package/lib/commonjs/components/Touchable.js.map +1 -1
- package/lib/commonjs/components/Touchable.web.js.map +1 -1
- package/lib/commonjs/components/Typography.js.map +1 -1
- package/lib/commonjs/index.js +8 -20
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/Markdown.js +26 -0
- package/lib/module/components/Markdown.js.map +1 -0
- package/lib/module/components/Surface.js +2 -4
- package/lib/module/components/Surface.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/components/Markdown.d.ts +21 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/package.json +3 -4
- package/src/components/Markdown.js +21 -0
- package/src/components/Markdown.tsx +30 -0
- package/src/index.js +1 -1
- package/src/index.tsx +1 -1
- package/lib/commonjs/components/MapView/MapCallout.native.js.map +0 -1
- package/lib/commonjs/components/MapView/MapCallout.web.js +0 -47
- package/lib/commonjs/components/MapView/MapCallout.web.js.map +0 -1
- package/lib/commonjs/components/MapView/MapMarker.native.js +0 -86
- package/lib/commonjs/components/MapView/MapMarker.native.js.map +0 -1
- package/lib/commonjs/components/MapView/MapMarker.web.js +0 -116
- package/lib/commonjs/components/MapView/MapMarker.web.js.map +0 -1
- package/lib/commonjs/components/MapView/MapView.native.js +0 -162
- package/lib/commonjs/components/MapView/MapView.native.js.map +0 -1
- package/lib/commonjs/components/MapView/MapView.web.js +0 -55
- package/lib/commonjs/components/MapView/MapView.web.js.map +0 -1
- package/lib/commonjs/components/MapView/NoApiKey.js +0 -20
- package/lib/commonjs/components/MapView/NoApiKey.js.map +0 -1
- package/lib/commonjs/components/MapView/index.js +0 -32
- package/lib/commonjs/components/MapView/index.js.map +0 -1
- package/lib/commonjs/components/MapView/types.js +0 -5
- package/lib/commonjs/components/MapView/types.js.map +0 -1
- package/lib/module/components/MapView/MapCallout.native.js +0 -32
- package/lib/module/components/MapView/MapCallout.native.js.map +0 -1
- package/lib/module/components/MapView/MapCallout.web.js +0 -32
- package/lib/module/components/MapView/MapCallout.web.js.map +0 -1
- package/lib/module/components/MapView/MapMarker.native.js +0 -71
- package/lib/module/components/MapView/MapMarker.native.js.map +0 -1
- package/lib/module/components/MapView/MapMarker.web.js +0 -96
- package/lib/module/components/MapView/MapMarker.web.js.map +0 -1
- package/lib/module/components/MapView/MapView.native.js +0 -144
- package/lib/module/components/MapView/MapView.native.js.map +0 -1
- package/lib/module/components/MapView/MapView.web.js +0 -38
- package/lib/module/components/MapView/MapView.web.js.map +0 -1
- package/lib/module/components/MapView/NoApiKey.js +0 -7
- package/lib/module/components/MapView/NoApiKey.js.map +0 -1
- package/lib/module/components/MapView/index.js +0 -7
- package/lib/module/components/MapView/index.js.map +0 -1
- package/lib/module/components/MapView/types.js +0 -2
- package/lib/module/components/MapView/types.js.map +0 -1
- package/lib/typescript/src/components/MapView/MapCallout.native.d.ts +0 -33
- package/lib/typescript/src/components/MapView/MapCallout.web.d.ts +0 -4
- package/lib/typescript/src/components/MapView/MapMarker.native.d.ts +0 -57
- package/lib/typescript/src/components/MapView/MapMarker.web.d.ts +0 -12
- package/lib/typescript/src/components/MapView/MapView.native.d.ts +0 -130
- package/lib/typescript/src/components/MapView/MapView.web.d.ts +0 -4
- package/lib/typescript/src/components/MapView/NoApiKey.d.ts +0 -2
- package/lib/typescript/src/components/MapView/index.d.ts +0 -3
- package/lib/typescript/src/components/MapView/types.d.ts +0 -35
- package/src/components/MapView/MapCallout.native.js +0 -22
- package/src/components/MapView/MapCallout.native.tsx +0 -40
- package/src/components/MapView/MapCallout.web.js +0 -14
- package/src/components/MapView/MapCallout.web.tsx +0 -31
- package/src/components/MapView/MapMarker.native.js +0 -52
- package/src/components/MapView/MapMarker.native.tsx +0 -83
- package/src/components/MapView/MapMarker.web.js +0 -68
- package/src/components/MapView/MapMarker.web.tsx +0 -105
- package/src/components/MapView/MapView.native.js +0 -118
- package/src/components/MapView/MapView.native.tsx +0 -163
- package/src/components/MapView/MapView.web.js +0 -18
- package/src/components/MapView/MapView.web.tsx +0 -42
- package/src/components/MapView/NoApiKey.js +0 -5
- package/src/components/MapView/NoApiKey.tsx +0 -10
- package/src/components/MapView/index.js +0 -6
- package/src/components/MapView/index.tsx +0 -6
- package/src/components/MapView/types.js +0 -1
- package/src/components/MapView/types.tsx +0 -38
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
var _api = require("@react-google-maps/api");
|
|
13
|
-
|
|
14
|
-
var _MapMarker = require("./MapMarker.web");
|
|
15
|
-
|
|
16
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
|
|
20
|
-
const MapCallout = ({
|
|
21
|
-
anchor,
|
|
22
|
-
onPress = () => {},
|
|
23
|
-
children
|
|
24
|
-
}) => {
|
|
25
|
-
const {
|
|
26
|
-
toggleCallout,
|
|
27
|
-
position,
|
|
28
|
-
calloutOpened
|
|
29
|
-
} = React.useContext(_MapMarker.markerContext);
|
|
30
|
-
|
|
31
|
-
const handleClose = () => toggleCallout(false);
|
|
32
|
-
|
|
33
|
-
return calloutOpened ? /*#__PURE__*/React.createElement(_reactNative.TouchableOpacity, {
|
|
34
|
-
onPress: onPress
|
|
35
|
-
}, /*#__PURE__*/React.createElement(_api.InfoWindow, {
|
|
36
|
-
anchor: anchor,
|
|
37
|
-
position: {
|
|
38
|
-
lat: (position === null || position === void 0 ? void 0 : position.latitude) || 0,
|
|
39
|
-
lng: (position === null || position === void 0 ? void 0 : position.longitude) || 0
|
|
40
|
-
},
|
|
41
|
-
onCloseClick: handleClose
|
|
42
|
-
}, children)) : null;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var _default = MapCallout;
|
|
46
|
-
exports.default = _default;
|
|
47
|
-
//# sourceMappingURL=MapCallout.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["MapCallout.web.tsx"],"names":["MapCallout","anchor","onPress","children","toggleCallout","position","calloutOpened","React","useContext","markerContext","handleClose","lat","latitude","lng","longitude"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAGA,MAAMA,UAAkC,GAAG,CAAC;AAC1CC,EAAAA,MAD0C;AAE1CC,EAAAA,OAAO,GAAG,MAAM,CAAE,CAFwB;AAG1CC,EAAAA;AAH0C,CAAD,KAIrC;AACJ,QAAM;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA,QAAjB;AAA2BC,IAAAA;AAA3B,MACJC,KAAK,CAACC,UAAN,CAAiBC,wBAAjB,CADF;;AAEA,QAAMC,WAAW,GAAG,MAAMN,aAAa,CAAC,KAAD,CAAvC;;AACA,SAAOE,aAAa,gBAClB,oBAAC,6BAAD;AAAkB,IAAA,OAAO,EAAEJ;AAA3B,kBACE,oBAAC,eAAD;AACE,IAAA,MAAM,EAAED,MADV;AAEE,IAAA,QAAQ,EAAE;AACRU,MAAAA,GAAG,EAAE,CAAAN,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAEO,QAAV,KAAsB,CADnB;AAERC,MAAAA,GAAG,EAAE,CAAAR,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAES,SAAV,KAAuB;AAFpB,KAFZ;AAME,IAAA,YAAY,EAAEJ;AANhB,KAQGP,QARH,CADF,CADkB,GAahB,IAbJ;AAcD,CAtBD;;eAwBeH,U","sourcesContent":["import * as React from \"react\";\nimport { TouchableOpacity } from \"react-native\";\nimport { InfoWindow } from \"@react-google-maps/api\";\nimport { markerContext } from \"./MapMarker.web\";\nimport { CalloutProps } from \"./types\";\n\nconst MapCallout: React.FC<CalloutProps> = ({\n anchor,\n onPress = () => {},\n children,\n}) => {\n const { toggleCallout, position, calloutOpened } =\n React.useContext(markerContext);\n const handleClose = () => toggleCallout(false);\n return calloutOpened ? (\n <TouchableOpacity onPress={onPress}>\n <InfoWindow\n anchor={anchor}\n position={{\n lat: position?.latitude || 0,\n lng: position?.longitude || 0,\n }}\n onCloseClick={handleClose}\n >\n {children}\n </InfoWindow>\n </TouchableOpacity>\n ) : null;\n};\n\nexport default MapCallout;\n"]}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SEED_DATA = exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNativeMaps = require("react-native-maps");
|
|
11
|
-
|
|
12
|
-
var _types = require("@draftbit/types");
|
|
13
|
-
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
|
|
16
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
18
|
-
const MapMarker = ({
|
|
19
|
-
latitude,
|
|
20
|
-
longitude,
|
|
21
|
-
title,
|
|
22
|
-
description,
|
|
23
|
-
pinColor,
|
|
24
|
-
flat,
|
|
25
|
-
style,
|
|
26
|
-
children
|
|
27
|
-
}) => /*#__PURE__*/React.createElement(_reactNativeMaps.Marker, {
|
|
28
|
-
coordinate: {
|
|
29
|
-
latitude,
|
|
30
|
-
longitude
|
|
31
|
-
},
|
|
32
|
-
title: title,
|
|
33
|
-
description: description,
|
|
34
|
-
flat: flat,
|
|
35
|
-
pinColor: pinColor,
|
|
36
|
-
style: style
|
|
37
|
-
}, children);
|
|
38
|
-
|
|
39
|
-
var _default = MapMarker;
|
|
40
|
-
exports.default = _default;
|
|
41
|
-
const SEED_DATA = {
|
|
42
|
-
name: "Map Marker",
|
|
43
|
-
tag: "MapMarker",
|
|
44
|
-
description: "A marker to show inside map view",
|
|
45
|
-
category: _types.COMPONENT_TYPES.button,
|
|
46
|
-
layout: {},
|
|
47
|
-
props: {
|
|
48
|
-
latitude: (0, _types.createNumberProp)({
|
|
49
|
-
label: "Latitude",
|
|
50
|
-
description: "The longitude in which the marker is located",
|
|
51
|
-
required: true,
|
|
52
|
-
precision: 0.000001,
|
|
53
|
-
min: -90,
|
|
54
|
-
max: 90
|
|
55
|
-
}),
|
|
56
|
-
longitude: (0, _types.createNumberProp)({
|
|
57
|
-
label: "Latitude",
|
|
58
|
-
description: "The latitude in which the marker is located",
|
|
59
|
-
required: true,
|
|
60
|
-
precision: 0.000001,
|
|
61
|
-
min: -180,
|
|
62
|
-
max: 180
|
|
63
|
-
}),
|
|
64
|
-
title: (0, _types.createTextProp)({
|
|
65
|
-
label: "Title",
|
|
66
|
-
description: "Title to show along with the marker",
|
|
67
|
-
defaultValue: null
|
|
68
|
-
}),
|
|
69
|
-
description: (0, _types.createTextProp)({
|
|
70
|
-
label: "Description",
|
|
71
|
-
description: "Optional description for the marker",
|
|
72
|
-
defaultValue: null
|
|
73
|
-
}),
|
|
74
|
-
flat: (0, _types.createBoolProp)({
|
|
75
|
-
label: "Flat",
|
|
76
|
-
description: "Sets whether this marker should be flat against the map (if true) or a billboard facing the camera (if false)",
|
|
77
|
-
defaultValue: false
|
|
78
|
-
}),
|
|
79
|
-
pinColor: (0, _types.createColorProp)({
|
|
80
|
-
label: "Pin Color",
|
|
81
|
-
description: "Sets the color of the marker"
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
exports.SEED_DATA = SEED_DATA;
|
|
86
|
-
//# sourceMappingURL=MapMarker.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["MapMarker.native.tsx"],"names":["MapMarker","latitude","longitude","title","description","pinColor","flat","style","children","SEED_DATA","name","tag","category","COMPONENT_TYPES","button","layout","props","label","required","precision","min","max","defaultValue"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;AAQA,MAAMA,SAAmC,GAAG,CAAC;AAC3CC,EAAAA,QAD2C;AAE3CC,EAAAA,SAF2C;AAG3CC,EAAAA,KAH2C;AAI3CC,EAAAA,WAJ2C;AAK3CC,EAAAA,QAL2C;AAM3CC,EAAAA,IAN2C;AAO3CC,EAAAA,KAP2C;AAQ3CC,EAAAA;AAR2C,CAAD,kBAU1C,oBAAC,uBAAD;AACE,EAAA,UAAU,EAAE;AACVP,IAAAA,QADU;AAEVC,IAAAA;AAFU,GADd;AAKE,EAAA,KAAK,EAAEC,KALT;AAME,EAAA,WAAW,EAAEC,WANf;AAOE,EAA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E,MADY;AAEnBb,MAAAA,WAAW,EACT,+GAHiB;AAInBkB,MAAAA,YAAY,EAAE;AAJK,KAAf,CA3BD;AAiCLjB,IAAAA,QAAQ,EAAE,4BAAgB;AACxBY,MAAAA,KAAK,EAAE,WADiB;AAExBb,MAAAA,WAAW,EAAE;AAFW,KAAhB;AAjCL;AANgB,CAAlB","sourcesContent":["import * as React from \"react\";\nimport { Marker } from \"react-native-maps\";\nimport { MapMarkerProps } from \"./types\";\nimport {\n COMPONENT_TYPES,\n createBoolProp,\n createColorProp,\n createNumberProp,\n createTextProp,\n} from \"@draftbit/types\";\n\nconst MapMarker: React.FC<MapMarkerProps> = ({\n latitude,\n longitude,\n title,\n description,\n pinColor,\n flat,\n style,\n children,\n}) => (\n <Marker\n coordinate={{\n latitude,\n longitude,\n }}\n title={title}\n description={description}\n flat={flat}\n pinColor={pinColor}\n style={style}\n >\n {children}\n </Marker>\n);\n\nexport default MapMarker;\n\nexport const SEED_DATA = {\n name: \"Map Marker\",\n tag: \"MapMarker\",\n description: \"A marker to show inside map view\",\n category: COMPONENT_TYPES.button,\n layout: {},\n props: {\n latitude: createNumberProp({\n label: \"Latitude\",\n description: \"The longitude in which the marker is located\",\n required: true,\n precision: 0.000001,\n min: -90,\n max: 90,\n }),\n longitude: createNumberProp({\n label: \"Latitude\",\n description: \"The latitude in which the marker is located\",\n required: true,\n precision: 0.000001,\n min: -180,\n max: 180,\n }),\n title: createTextProp({\n label: \"Title\",\n description: \"Title to show along with the marker\",\n defaultValue: null,\n }),\n description: createTextProp({\n label: \"Description\",\n description: \"Optional description for the marker\",\n defaultValue: null,\n }),\n flat: createBoolProp({\n label: \"Flat\",\n description:\n \"Sets whether this marker should be flat against the map (if true) or a billboard facing the camera (if false)\",\n defaultValue: false,\n }),\n pinColor: createColorProp({\n label: \"Pin Color\",\n description: \"Sets the color of the marker\",\n }),\n },\n};\n"]}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.markerContext = void 0;
|
|
7
|
-
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
var _api = require("@react-google-maps/api");
|
|
13
|
-
|
|
14
|
-
var _MapCallout = _interopRequireDefault(require("./MapCallout.web"));
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
|
-
const markerContext = /*#__PURE__*/React.createContext({
|
|
23
|
-
pinColor: "#E74C3C",
|
|
24
|
-
calloutOpened: false,
|
|
25
|
-
position: undefined,
|
|
26
|
-
toggleCallout: () => {}
|
|
27
|
-
});
|
|
28
|
-
exports.markerContext = markerContext;
|
|
29
|
-
|
|
30
|
-
const MapMarker = ({
|
|
31
|
-
pinColor,
|
|
32
|
-
latitude,
|
|
33
|
-
longitude,
|
|
34
|
-
title,
|
|
35
|
-
description,
|
|
36
|
-
children
|
|
37
|
-
}) => {
|
|
38
|
-
const {
|
|
39
|
-
Provider
|
|
40
|
-
} = markerContext;
|
|
41
|
-
const [calloutOpened, toggleCallout] = React.useState(false);
|
|
42
|
-
const [marker, setMarker] = React.useState(null);
|
|
43
|
-
|
|
44
|
-
const handleMarkerClick = () => toggleCallout(true);
|
|
45
|
-
|
|
46
|
-
const handleOnLoad = m => setMarker(m);
|
|
47
|
-
|
|
48
|
-
let mappedChildren;
|
|
49
|
-
|
|
50
|
-
if (!children) {
|
|
51
|
-
if (title || description) {
|
|
52
|
-
mappedChildren = /*#__PURE__*/React.createElement(_MapCallout.default, {
|
|
53
|
-
showTooltip: true,
|
|
54
|
-
anchor: marker
|
|
55
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
56
|
-
style: style.tooltip
|
|
57
|
-
}, title && /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
58
|
-
style: style.title
|
|
59
|
-
}, title), description && /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
60
|
-
style: style.description
|
|
61
|
-
}, description)));
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
mappedChildren = React.Children.map(children, (child, index) => {
|
|
65
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
66
|
-
index,
|
|
67
|
-
anchor: marker
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return /*#__PURE__*/React.createElement(Provider, {
|
|
73
|
-
value: {
|
|
74
|
-
pinColor: pinColor,
|
|
75
|
-
calloutOpened,
|
|
76
|
-
toggleCallout: value => toggleCallout(value),
|
|
77
|
-
position: {
|
|
78
|
-
latitude,
|
|
79
|
-
longitude
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}, /*#__PURE__*/React.createElement(_api.Marker, {
|
|
83
|
-
position: {
|
|
84
|
-
lat: latitude,
|
|
85
|
-
lng: longitude
|
|
86
|
-
},
|
|
87
|
-
onClick: handleMarkerClick,
|
|
88
|
-
onLoad: handleOnLoad,
|
|
89
|
-
icon: {
|
|
90
|
-
path: "m12 0c-4.4183 2.3685e-15 -8 3.5817-8 8 0 1.421 0.3816 2.75 1.0312 3.906 0.1079 0.192 0.221 0.381 0.3438 0.563l6.625 11.531 6.625-11.531c0.102-0.151 0.19-0.311 0.281-0.469l0.063-0.094c0.649-1.156 1.031-2.485 1.031-3.906 0-4.4183-3.582-8-8-8zm0 4c2.209 0 4 1.7909 4 4 0 2.209-1.791 4-4 4-2.2091 0-4-1.791-4-4 0-2.2091 1.7909-4 4-4z",
|
|
91
|
-
fillColor: pinColor,
|
|
92
|
-
fillOpacity: 1,
|
|
93
|
-
strokeWeight: 0,
|
|
94
|
-
rotation: 0,
|
|
95
|
-
scale: 2
|
|
96
|
-
}
|
|
97
|
-
}, mappedChildren));
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const style = _reactNative.StyleSheet.create({
|
|
101
|
-
tooltip: {
|
|
102
|
-
display: "flex",
|
|
103
|
-
flexDirection: "column"
|
|
104
|
-
},
|
|
105
|
-
title: {
|
|
106
|
-
fontWeight: "600",
|
|
107
|
-
textAlign: "center"
|
|
108
|
-
},
|
|
109
|
-
description: {
|
|
110
|
-
textAlign: "center"
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
var _default = MapMarker;
|
|
115
|
-
exports.default = _default;
|
|
116
|
-
//# sourceMappingURL=MapMarker.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["MapMarker.web.tsx"],"names":["markerContext","React","createContext","pinColor","calloutOpened","position","undefined","toggleCallout","MapMarker","latitude","longitude","title","description","children","Provider","useState","marker","setMarker","handleMarkerClick","handleOnLoad","m","mappedChildren","style","tooltip","Children","map","child","index","cloneElement","anchor","value","lat","lng","path","fillColor","fillOpacity","strokeWeight","rotation","scale","StyleSheet","create","display","flexDirection","fontWeight","textAlign"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;AACA;;;;;;;;AASO,MAAMA,aAAa,gBAAGC,KAAK,CAACC,aAAN,CAAoC;AAC/DC,EAAAA,QAAQ,EAAE,SADqD;AAE/DC,EAAAA,aAAa,EAAE,KAFgD;AAG/DC,EAAAA,QAAQ,EAAEC,SAHqD;AAI/DC,EAAAA,aAAa,EAAE,MAAM,CAAE;AAJwC,CAApC,CAAtB;;;AAOP,MAAMC,SAAmC,GAAG,CAAC;AAC3CL,EAAAA,QAD2C;AAE3CM,EAAAA,QAF2C;AAG3CC,EAAAA,SAH2C;AAI3CC,EAAAA,KAJ2C;AAK3CC,EAAAA,WAL2C;AAM3CC,EAAAA;AAN2C,CAAD,KAOtC;AACJ,QAAM;AAAEC,IAAAA;AAAF,MAAed,aAArB;AACA,QAAM,CAACI,aAAD,EAAgBG,aAAhB,IAAiCN,KAAK,CAACc,QAAN,CAAe,KAAf,CAAvC;AACA,QAAM,CAACC,MAAD,EAASC,SAAT,IAAsBhB,KAAK,CAACc,QAAN,CAAmC,IAAnC,CAA5B;;AACA,QAAMG,iBAAiB,GAAG,MAAMX,aAAa,CAAC,IAAD,CAA7C;;AACA,QAAMY,YAAY,GAAIC,CAAD,IAAYH,SAAS,CAACG,CAAD,CAA1C;;AACA,MAAIC,cAAJ;;AACA,MAAI,CAACR,QAAL,EAAe;AACb,QAAIF,KAAK,IAAIC,WAAb,EAA0B;AACxBS,MAAAA,cAAc,gBACZ,oBAAC,mBAAD;AAAY,QAAA,WAAW,MAAvB;AAAwB,QAAA,MAAM,EAAEL;AAAhC,sBACE,oBAAC,iBAAD;AAAM,QAAA,KAAK,EAAEM,KAAK,CAACC;AAAnB,SACGZ,KAAK,iBAAI,oBAAC,iBAAD;AAAM,QAAA,KAAK,EAAEW,KAAK,CAACX;AAAnB,SAA2BA,KAA3B,CADZ,EAEGC,WAAW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ADqB;AAK9B/B,EAAAA,KAAK,EAAE;AACLgC,IAAAA,UAAU,EAAE,KADP;AAELC,IAAAA,SAAS,EAAE;AAFN,GALuB;AAS9BhC,EAAAA,WAAW,EAAE;AACXgC,IAAAA,SAAS,EAAE;AADA;AATiB,CAAlB,CAAd;;eAcepC,S","sourcesContent":["import * as React from \"react\";\nimport { View, Text, StyleSheet } from \"react-native\";\nimport { LatLng, MarkerProps } from \"react-native-maps\";\nimport { MapMarkerProps } from \"./types\";\nimport { Marker as WebMarker } from \"@react-google-maps/api\";\nimport MapCallout from \"./MapCallout.web\";\n\ninterface IMarkerContext {\n pinColor?: string | undefined;\n calloutOpened: boolean;\n position: LatLng | undefined;\n toggleCallout: (value: boolean) => void;\n}\n\nexport const markerContext = React.createContext<IMarkerContext>({\n pinColor: \"#E74C3C\",\n calloutOpened: false,\n position: undefined,\n toggleCallout: () => {},\n});\n\nconst MapMarker: React.FC<MapMarkerProps> = ({\n pinColor,\n latitude,\n longitude,\n title,\n description,\n children,\n}) => {\n const { Provider } = markerContext;\n const [calloutOpened, toggleCallout] = React.useState(false);\n const [marker, setMarker] = React.useState<MarkerProps | null>(null);\n const handleMarkerClick = () => toggleCallout(true);\n const handleOnLoad = (m: any) => setMarker(m);\n let mappedChildren;\n if (!children) {\n if (title || description) {\n mappedChildren = (\n <MapCallout showTooltip anchor={marker}>\n <View style={style.tooltip}>\n {title && <Text style={style.title}>{title}</Text>}\n {description && (\n <Text style={style.description}>{description}</Text>\n )}\n </View>\n </MapCallout>\n );\n }\n } else {\n mappedChildren = React.Children.map(children, (child, index) => {\n return React.cloneElement(child as React.ReactElement, {\n index,\n anchor: marker,\n });\n });\n }\n return (\n <Provider\n value={{\n pinColor: pinColor,\n calloutOpened,\n toggleCallout: (value) => toggleCallout(value),\n position: {\n latitude,\n longitude,\n },\n }}\n >\n <WebMarker\n position={{\n lat: latitude,\n lng: longitude,\n }}\n onClick={handleMarkerClick}\n onLoad={handleOnLoad}\n icon={{\n path: \"m12 0c-4.4183 2.3685e-15 -8 3.5817-8 8 0 1.421 0.3816 2.75 1.0312 3.906 0.1079 0.192 0.221 0.381 0.3438 0.563l6.625 11.531 6.625-11.531c0.102-0.151 0.19-0.311 0.281-0.469l0.063-0.094c0.649-1.156 1.031-2.485 1.031-3.906 0-4.4183-3.582-8-8-8zm0 4c2.209 0 4 1.7909 4 4 0 2.209-1.791 4-4 4-2.2091 0-4-1.791-4-4 0-2.2091 1.7909-4 4-4z\",\n fillColor: pinColor,\n fillOpacity: 1,\n strokeWeight: 0,\n rotation: 0,\n scale: 2,\n }}\n >\n {mappedChildren}\n </WebMarker>\n </Provider>\n );\n};\n\nconst style = StyleSheet.create({\n tooltip: {\n display: \"flex\",\n flexDirection: \"column\",\n },\n title: {\n fontWeight: \"600\",\n textAlign: \"center\",\n },\n description: {\n textAlign: \"center\",\n },\n});\n\nexport default MapMarker;\n"]}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SEED_DATA = exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNativeMaps = _interopRequireWildcard(require("react-native-maps"));
|
|
11
|
-
|
|
12
|
-
var _NoApiKey = _interopRequireDefault(require("./NoApiKey"));
|
|
13
|
-
|
|
14
|
-
var _types = require("@draftbit/types");
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
|
-
const MapView = ({
|
|
23
|
-
provider = _reactNativeMaps.PROVIDER_GOOGLE,
|
|
24
|
-
apiKey,
|
|
25
|
-
latitude,
|
|
26
|
-
latitudeDelta,
|
|
27
|
-
longitude,
|
|
28
|
-
longitudeDelta,
|
|
29
|
-
showsCompass = false,
|
|
30
|
-
rotateEnabled = true,
|
|
31
|
-
zoomEnabled = true,
|
|
32
|
-
loadingEnabled = true,
|
|
33
|
-
scrollEnabled = true,
|
|
34
|
-
loadingBackgroundColor,
|
|
35
|
-
loadingIndicatorColor,
|
|
36
|
-
mapType = "standard",
|
|
37
|
-
style,
|
|
38
|
-
children
|
|
39
|
-
}) => {
|
|
40
|
-
if (!apiKey) {
|
|
41
|
-
return /*#__PURE__*/React.createElement(_NoApiKey.default, null);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return /*#__PURE__*/React.createElement(_reactNativeMaps.default, {
|
|
45
|
-
provider: provider,
|
|
46
|
-
mapType: mapType,
|
|
47
|
-
showsCompass: showsCompass,
|
|
48
|
-
rotateEnabled: rotateEnabled,
|
|
49
|
-
zoomEnabled: zoomEnabled,
|
|
50
|
-
initialRegion: {
|
|
51
|
-
latitude: latitude,
|
|
52
|
-
longitude: longitude,
|
|
53
|
-
latitudeDelta: latitudeDelta,
|
|
54
|
-
longitudeDelta: longitudeDelta
|
|
55
|
-
},
|
|
56
|
-
loadingEnabled: loadingEnabled,
|
|
57
|
-
scrollEnabled: scrollEnabled,
|
|
58
|
-
loadingBackgroundColor: loadingBackgroundColor,
|
|
59
|
-
loadingIndicatorColor: loadingIndicatorColor,
|
|
60
|
-
style: style
|
|
61
|
-
}, children);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var _default = MapView;
|
|
65
|
-
exports.default = _default;
|
|
66
|
-
const SEED_DATA = {
|
|
67
|
-
name: "Map View",
|
|
68
|
-
tag: "MapView",
|
|
69
|
-
description: "A map view",
|
|
70
|
-
category: _types.COMPONENT_TYPES.media,
|
|
71
|
-
layout: {},
|
|
72
|
-
props: {
|
|
73
|
-
apiKey: (0, _types.createTextProp)({
|
|
74
|
-
label: "API Key",
|
|
75
|
-
description: "Your API Key",
|
|
76
|
-
required: true,
|
|
77
|
-
defaultValue: null
|
|
78
|
-
}),
|
|
79
|
-
provider: (0, _types.createTextProp)({
|
|
80
|
-
label: "Provider",
|
|
81
|
-
description: "The maps provider",
|
|
82
|
-
required: false,
|
|
83
|
-
defaultValue: "google",
|
|
84
|
-
options: ["google"]
|
|
85
|
-
}),
|
|
86
|
-
latitudeDelta: (0, _types.createNumberProp)({
|
|
87
|
-
label: "Latitude Delta",
|
|
88
|
-
description: "The latitude delta for the map's initial region",
|
|
89
|
-
required: false,
|
|
90
|
-
precision: 0.0001
|
|
91
|
-
}),
|
|
92
|
-
longitudeDelta: (0, _types.createNumberProp)({
|
|
93
|
-
label: "Longitude Delta",
|
|
94
|
-
description: "The longitude delta for the map's initial region",
|
|
95
|
-
required: false,
|
|
96
|
-
precision: 0.0001
|
|
97
|
-
}),
|
|
98
|
-
latitude: (0, _types.createNumberProp)({
|
|
99
|
-
label: "Latitude",
|
|
100
|
-
description: "The longitude for the map's initial region",
|
|
101
|
-
required: false,
|
|
102
|
-
precision: 0.000001,
|
|
103
|
-
min: -90,
|
|
104
|
-
max: 90
|
|
105
|
-
}),
|
|
106
|
-
longitude: (0, _types.createNumberProp)({
|
|
107
|
-
label: "Latitude",
|
|
108
|
-
description: "The latitude for the map's initial region",
|
|
109
|
-
required: false,
|
|
110
|
-
precision: 0.000001,
|
|
111
|
-
min: -180,
|
|
112
|
-
max: 180
|
|
113
|
-
}),
|
|
114
|
-
mapType: (0, _types.createTextProp)({
|
|
115
|
-
label: "Map Type",
|
|
116
|
-
description: "The type of map to show",
|
|
117
|
-
required: false,
|
|
118
|
-
defaultValue: "standard",
|
|
119
|
-
options: ["standard", "satellite", "hybrid", "terrain", "none", "mutedStandard"]
|
|
120
|
-
}),
|
|
121
|
-
zoomEnabled: (0, _types.createBoolProp)({
|
|
122
|
-
label: "Zoom Enabled",
|
|
123
|
-
description: "Whether zooming is enabled",
|
|
124
|
-
required: false,
|
|
125
|
-
defaultValue: true
|
|
126
|
-
}),
|
|
127
|
-
showsCompass: (0, _types.createBoolProp)({
|
|
128
|
-
label: "Shows Compass",
|
|
129
|
-
description: "Whether compass is shown",
|
|
130
|
-
required: false,
|
|
131
|
-
defaultValue: false
|
|
132
|
-
}),
|
|
133
|
-
rotateEnabled: (0, _types.createBoolProp)({
|
|
134
|
-
label: "Rotate Enabled",
|
|
135
|
-
description: "Whether rotating the map is enabled",
|
|
136
|
-
required: false,
|
|
137
|
-
defaultValue: true
|
|
138
|
-
}),
|
|
139
|
-
scrollEnabled: (0, _types.createBoolProp)({
|
|
140
|
-
label: "Scroll Enabled",
|
|
141
|
-
description: "Whether scrolling the map view is enabled",
|
|
142
|
-
required: false,
|
|
143
|
-
defaultValue: true
|
|
144
|
-
}),
|
|
145
|
-
loadingEnabled: (0, _types.createBoolProp)({
|
|
146
|
-
label: "Loading Enabled",
|
|
147
|
-
description: "If true a loading indicator will show while the map is loading",
|
|
148
|
-
required: false,
|
|
149
|
-
defaultValue: true
|
|
150
|
-
}),
|
|
151
|
-
loadingIndicatorColor: (0, _types.createColorProp)({
|
|
152
|
-
label: "Loading Indicator Color",
|
|
153
|
-
description: "Color of the loading indicator"
|
|
154
|
-
}),
|
|
155
|
-
loadingBackgroundColor: (0, _types.createColorProp)({
|
|
156
|
-
label: "Loading Background Color",
|
|
157
|
-
description: "Color of the background to show while the map is loading"
|
|
158
|
-
})
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
exports.SEED_DATA = SEED_DATA;
|
|
162
|
-
//# sourceMappingURL=MapView.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["MapView.native.tsx"],"names":["MapView","provider","PROVIDER_GOOGLE","apiKey","latitude","latitudeDelta","longitude","longitudeDelta","showsCompass","rotateEnabled","zoomEnabled","loadingEnabled","scrollEnabled","loadingBackgroundColor","loadingIndicatorColor","mapType","style","children","SEED_DATA","name","tag","description","category","COMPONENT_TYPES","media","layout","props","label","required","defaultValue","options","precision","min","max"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;AAQA,MAAMA,OAA+B,GAAG,CAAC;AACvCC,EAAAA,QAAQ,GAAGC,gCAD4B;AAEvCC,EAAAA,MAFuC;AAGvCC,EAAAA,QAHuC;AAIvCC,EAAAA,aAJuC;AAKvCC,EAAAA,SALuC;AAMvCC,EAAAA,cANuC;AAOvCC,EAAAA,YAAY,GAAG,KAPwB;AAQvCC,EAAAA,aAAa,GAAG,IARuB;AASvCC,EAAAA,WAAW,GAAG,IATyB;AAUvCC,EAAAA,cAAc,GAAG,IAVsB;AAWvCC,EAAAA,aAAa,GAAG,IAXuB;AAYvCC,EAAAA,sBAZuC;AAavCC,EAAAA,qBAbuC;AAcvCC,EAAAA,OAAO,GAAG,UAd6B;AAevCC,EAAAA,KAfuC;AAgBvCC,EAAAA;AAhBuC,CAAD,KAiBlC;AACJ,MAAI,CAACd,MAAL,EAAa;AACX,wBAAO,oBAAC,iBAAD,OAAP;AACD;;AAED,sBACE,oBAAC,wBAAD;AACE,IAAA,QAAQ,EAAEF,QADZ;AAEE,IAAA,O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EAAE,KAHgB;AAI1BC,MAAAA,YAAY,EAAE;AAJY,KAAf,CAxDR;AA8DLrB,IAAAA,YAAY,EAAE,2BAAe;AAC3BmB,MAAAA,KAAK,EAAE,eADoB;AAE3BN,MAAAA,WAAW,EAAE,0BAFc;AAG3BO,MAAAA,QAAQ,EAAE,KAHiB;AAI3BC,MAAAA,YAAY,EAAE;AAJa,KAAf,CA9DT;AAoELpB,IAAAA,aAAa,EAAE,2BAAe;AAC5BkB,MAAAA,KAAK,EAAE,gBADqB;AAE5BN,MAAAA,WAAW,EAAE,qCAFe;AAG5BO,MAAAA,QAAQ,EAAE,KAHkB;AAI5BC,MAAAA,YAAY,EAAE;AAJc,KAAf,CApEV;AA0ELjB,IAAAA,aAAa,EAAE,2BAAe;AAC5Be,MAAAA,KAAK,EAAE,gBADqB;AAE5BN,MAAAA,WAAW,EAAE,2CAFe;AAG5BO,MAAAA,QAAQ,EAAE,KAHkB;AAI5BC,MAAAA,YAAY,EAAE;AAJc,KAAf,CA1EV;AAgFLlB,IAAAA,cAAc,EAAE,2BAAe;AAC7BgB,MAAAA,KAAK,EAAE,iBADsB;AAE7BN,MAAAA,WAAW,EACT,gEAH2B;AAI7BO,MAAAA,QAAQ,EAAE,KAJmB;AAK7BC,MAAAA,YAAY,EAAE;AALe,KAAf,CAhFX;AAuFLf,IAAAA,qBAAqB,EAAE,4BAAgB;AACrCa,MAAAA,KAAK,EAAE,yBAD8B;AAErCN,MAAAA,WAAW,EAAE;AAFwB,KAAhB,CAvFlB;AA2FLR,IAAAA,sBAAsB,EAAE,4BAAgB;AACtCc,MAAAA,KAAK,EAAE,0BAD+B;AAEtCN,MAAAA,WAAW,EAAE;AAFyB,KAAhB;AA3FnB;AANgB,CAAlB","sourcesContent":["import * as React from \"react\";\nimport NativeMapView, { PROVIDER_GOOGLE } from \"react-native-maps\";\nimport { MapViewProps } from \"./types\";\nimport NoApiKey from \"./NoApiKey\";\nimport {\n COMPONENT_TYPES,\n createBoolProp,\n createColorProp,\n createNumberProp,\n createTextProp,\n} from \"@draftbit/types\";\n\nconst MapView: React.FC<MapViewProps> = ({\n provider = PROVIDER_GOOGLE,\n apiKey,\n latitude,\n latitudeDelta,\n longitude,\n longitudeDelta,\n showsCompass = false,\n rotateEnabled = true,\n zoomEnabled = true,\n loadingEnabled = true,\n scrollEnabled = true,\n loadingBackgroundColor,\n loadingIndicatorColor,\n mapType = \"standard\",\n style,\n children,\n}) => {\n if (!apiKey) {\n return <NoApiKey />;\n }\n\n return (\n <NativeMapView\n provider={provider}\n mapType={mapType}\n showsCompass={showsCompass}\n rotateEnabled={rotateEnabled}\n zoomEnabled={zoomEnabled}\n initialRegion={{\n latitude: latitude as number,\n longitude: longitude as number,\n latitudeDelta: latitudeDelta as number,\n longitudeDelta: longitudeDelta as number,\n }}\n loadingEnabled={loadingEnabled}\n scrollEnabled={scrollEnabled}\n loadingBackgroundColor={loadingBackgroundColor}\n loadingIndicatorColor={loadingIndicatorColor}\n style={style}\n >\n {children}\n </NativeMapView>\n );\n};\n\nexport default MapView;\n\nexport const SEED_DATA = {\n name: \"Map View\",\n tag: \"MapView\",\n description: \"A map view\",\n category: COMPONENT_TYPES.media,\n layout: {},\n props: {\n apiKey: createTextProp({\n label: \"API Key\",\n description: \"Your API Key\",\n required: true,\n defaultValue: null,\n }),\n provider: createTextProp({\n label: \"Provider\",\n description: \"The maps provider\",\n required: false,\n defaultValue: \"google\",\n options: [\"google\"],\n }),\n latitudeDelta: createNumberProp({\n label: \"Latitude Delta\",\n description: \"The latitude delta for the map's initial region\",\n required: false,\n precision: 0.0001,\n }),\n longitudeDelta: createNumberProp({\n label: \"Longitude Delta\",\n description: \"The longitude delta for the map's initial region\",\n required: false,\n precision: 0.0001,\n }),\n latitude: createNumberProp({\n label: \"Latitude\",\n description: \"The longitude for the map's initial region\",\n required: false,\n precision: 0.000001,\n min: -90,\n max: 90,\n }),\n longitude: createNumberProp({\n label: \"Latitude\",\n description: \"The latitude for the map's initial region\",\n required: false,\n precision: 0.000001,\n min: -180,\n max: 180,\n }),\n mapType: createTextProp({\n label: \"Map Type\",\n description: \"The type of map to show\",\n required: false,\n defaultValue: \"standard\",\n options: [\n \"standard\",\n \"satellite\",\n \"hybrid\",\n \"terrain\",\n \"none\",\n \"mutedStandard\",\n ],\n }),\n zoomEnabled: createBoolProp({\n label: \"Zoom Enabled\",\n description: \"Whether zooming is enabled\",\n required: false,\n defaultValue: true,\n }),\n showsCompass: createBoolProp({\n label: \"Shows Compass\",\n description: \"Whether compass is shown\",\n required: false,\n defaultValue: false,\n }),\n rotateEnabled: createBoolProp({\n label: \"Rotate Enabled\",\n description: \"Whether rotating the map is enabled\",\n required: false,\n defaultValue: true,\n }),\n scrollEnabled: createBoolProp({\n label: \"Scroll Enabled\",\n description: \"Whether scrolling the map view is enabled\",\n required: false,\n defaultValue: true,\n }),\n loadingEnabled: createBoolProp({\n label: \"Loading Enabled\",\n description:\n \"If true a loading indicator will show while the map is loading\",\n required: false,\n defaultValue: true,\n }),\n loadingIndicatorColor: createColorProp({\n label: \"Loading Indicator Color\",\n description: \"Color of the loading indicator\",\n }),\n loadingBackgroundColor: createColorProp({\n label: \"Loading Background Color\",\n description: \"Color of the background to show while the map is loading\",\n }),\n },\n};\n"]}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _api = require("@react-google-maps/api");
|
|
11
|
-
|
|
12
|
-
var _NoApiKey = _interopRequireDefault(require("./NoApiKey"));
|
|
13
|
-
|
|
14
|
-
var _reactNative = require("react-native");
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
|
-
const MapView = ({
|
|
23
|
-
apiKey,
|
|
24
|
-
latitude,
|
|
25
|
-
longitude,
|
|
26
|
-
rotateEnabled = true,
|
|
27
|
-
scrollEnabled = true,
|
|
28
|
-
mapType = "standard",
|
|
29
|
-
style,
|
|
30
|
-
children
|
|
31
|
-
}) => {
|
|
32
|
-
if (!apiKey) {
|
|
33
|
-
return /*#__PURE__*/React.createElement(_NoApiKey.default, null);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return /*#__PURE__*/React.createElement(_api.LoadScript, {
|
|
37
|
-
googleMapsApiKey: apiKey
|
|
38
|
-
}, /*#__PURE__*/React.createElement(_api.GoogleMap, {
|
|
39
|
-
mapContainerStyle: _reactNative.StyleSheet.flatten(style),
|
|
40
|
-
center: {
|
|
41
|
-
lat: latitude || 0,
|
|
42
|
-
lng: longitude || 0
|
|
43
|
-
},
|
|
44
|
-
mapTypeId: mapType,
|
|
45
|
-
zoom: 14,
|
|
46
|
-
options: {
|
|
47
|
-
scrollwheel: scrollEnabled,
|
|
48
|
-
rotateControl: rotateEnabled
|
|
49
|
-
}
|
|
50
|
-
}, children));
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
var _default = MapView;
|
|
54
|
-
exports.default = _default;
|
|
55
|
-
//# sourceMappingURL=MapView.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["MapView.web.tsx"],"names":["MapView","apiKey","latitude","longitude","rotateEnabled","scrollEnabled","mapType","style","children","StyleSheet","flatten","lat","lng","scrollwheel","rotateControl"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;;;;;AAEA,MAAMA,OAA+B,GAAG,CAAC;AACvCC,EAAAA,MADuC;AAEvCC,EAAAA,QAFuC;AAGvCC,EAAAA,SAHuC;AAIvCC,EAAAA,aAAa,GAAG,IAJuB;AAKvCC,EAAAA,aAAa,GAAG,IALuB;AAMvCC,EAAAA,OAAO,GAAG,UAN6B;AAOvCC,EAAAA,KAPuC;AAQvCC,EAAAA;AARuC,CAAD,KASlC;AACJ,MAAI,CAACP,MAAL,EAAa;AACX,wBAAO,oBAAC,iBAAD,OAAP;AACD;;AAED,sBACE,oBAAC,eAAD;AAAY,IAAA,gBAAgB,EAAEA;AAA9B,kBACE,oBAAC,cAAD;AACE,IAAA,iBAAiB,EAAEQ,wBAAWC,OAAX,CAAmBH,KAAnB,CADrB;AAEE,IAAA,MAAM,EAAE;AACNI,MAAAA,GAAG,EAAET,QAAQ,IAAI,CADX;AAENU,MAAAA,GAAG,EAAET,SAAS,IAAI;AAFZ,KAFV;AAME,IAAA,SAAS,EAAEG,OANb;AAOE,IAAA,IAAI,EAAE,EAPR;AAQE,IAAA,OAAO,EAAE;AACPO,MAAAA,WAAW,EAAER,aADN;AAEPS,MAAAA,aAAa,EAAEV;AAFR;AARX,KAaGI,QAbH,CADF,CADF;AAmBD,CAjCD;;eAmCeR,O","sourcesContent":["import * as React from \"react\";\nimport { GoogleMap, LoadScript } from \"@react-google-maps/api\";\nimport NoApiKey from \"./NoApiKey\";\nimport { MapViewProps } from \"./types\";\nimport { StyleSheet } from \"react-native\";\n\nconst MapView: React.FC<MapViewProps> = ({\n apiKey,\n latitude,\n longitude,\n rotateEnabled = true,\n scrollEnabled = true,\n mapType = \"standard\",\n style,\n children,\n}) => {\n if (!apiKey) {\n return <NoApiKey />;\n }\n\n return (\n <LoadScript googleMapsApiKey={apiKey}>\n <GoogleMap\n mapContainerStyle={StyleSheet.flatten(style) as React.CSSProperties}\n center={{\n lat: latitude || 0,\n lng: longitude || 0,\n }}\n mapTypeId={mapType}\n zoom={14}\n options={{\n scrollwheel: scrollEnabled,\n rotateControl: rotateEnabled,\n }}\n >\n {children}\n </GoogleMap>\n </LoadScript>\n );\n};\n\nexport default MapView;\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
-
|
|
14
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
|
|
16
|
-
const NoApiKey = () => /*#__PURE__*/React.createElement(_reactNative.View, null, /*#__PURE__*/React.createElement(_reactNative.Text, null, "You need to pass an API key in order for MapView to work."));
|
|
17
|
-
|
|
18
|
-
var _default = NoApiKey;
|
|
19
|
-
exports.default = _default;
|
|
20
|
-
//# sourceMappingURL=NoApiKey.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["NoApiKey.tsx"],"names":["NoApiKey"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAEA,MAAMA,QAAQ,GAAG,mBACf,oBAAC,iBAAD,qBACE,oBAAC,iBAAD,oEADF,CADF;;eAMeA,Q","sourcesContent":["import * as React from \"react\";\nimport { Text, View } from \"react-native\";\n\nconst NoApiKey = () => (\n <View>\n <Text>You need to pass an API key in order for MapView to work.</Text>\n </View>\n);\n\nexport default NoApiKey;\n"]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "MapView", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _MapView.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "MapMarker", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _MapMarker.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "MapCallout", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _MapCallout.default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
var _MapView = _interopRequireDefault(require("./MapView"));
|
|
26
|
-
|
|
27
|
-
var _MapMarker = _interopRequireDefault(require("./MapMarker"));
|
|
28
|
-
|
|
29
|
-
var _MapCallout = _interopRequireDefault(require("./MapCallout"));
|
|
30
|
-
|
|
31
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;AAEA","sourcesContent":["//@ts-ignore\nexport { default as MapView } from \"./MapView\";\n//@ts-ignore\nexport { default as MapMarker } from \"./MapMarker\";\n//@ts-ignore\nexport { default as MapCallout } from \"./MapCallout\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Callout } from "react-native-maps";
|
|
3
|
-
import { COMPONENT_TYPES, createActionProp, createBoolProp } from "@draftbit/types";
|
|
4
|
-
|
|
5
|
-
const MapCallout = ({
|
|
6
|
-
onPress,
|
|
7
|
-
showTooltip,
|
|
8
|
-
children
|
|
9
|
-
}) => /*#__PURE__*/React.createElement(Callout, {
|
|
10
|
-
tooltip: !showTooltip,
|
|
11
|
-
onPress: onPress
|
|
12
|
-
}, children);
|
|
13
|
-
|
|
14
|
-
export default MapCallout;
|
|
15
|
-
export const SEED_DATA = {
|
|
16
|
-
name: "Callout",
|
|
17
|
-
tag: "MapCallout",
|
|
18
|
-
description: "An info window to display on top of a marker when it is clicked",
|
|
19
|
-
category: COMPONENT_TYPES.container,
|
|
20
|
-
layout: {},
|
|
21
|
-
props: {
|
|
22
|
-
onPress: createActionProp({
|
|
23
|
-
description: "Action to execute when the callout is pressed"
|
|
24
|
-
}),
|
|
25
|
-
showTooltip: createBoolProp({
|
|
26
|
-
label: "Show Tooltip",
|
|
27
|
-
description: 'If false, a default "tooltip" bubble window will be drawn around this callout\'s children. If true, the child views can fully customize their appearance, including any "bubble"-like styles',
|
|
28
|
-
defaultValue: false
|
|
29
|
-
})
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=MapCallout.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["MapCallout.native.tsx"],"names":["React","Callout","COMPONENT_TYPES","createActionProp","createBoolProp","MapCallout","onPress","showTooltip","children","SEED_DATA","name","tag","description","category","container","layout","props","label","defaultValue"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,OAAT,QAAwB,mBAAxB;AAEA,SACEC,eADF,EAEEC,gBAFF,EAGEC,cAHF,QAIO,iBAJP;;AAMA,MAAMC,UAAkC,GAAG,CAAC;AAC1CC,EAAAA,OAD0C;AAE1CC,EAAAA,WAF0C;AAG1CC,EAAAA;AAH0C,CAAD,kBAKzC,oBAAC,OAAD;AAAS,EAAA,OAAO,EAAE,CAACD,WAAnB;AAAgC,EAAA,OAAO,EAAED;AAAzC,GACGE,QADH,CALF;;AAUA,eAAeH,UAAf;AAEA,OAAO,MAAMI,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,SADiB;AAEvBC,EAAAA,GAAG,EAAE,YAFkB;AAGvBC,EAAAA,WAAW,EACT,iEAJqB;AAKvBC,EAAAA,QAAQ,EAAEX,eAAe,CAACY,SALH;AAMvBC,EAAAA,MAAM,EAAE,EANe;AAOvBC,EAAAA,KAAK,EAAE;AACLV,IAAAA,OAAO,EAAEH,gBAAgB,CAAC;AACxBS,MAAAA,WAAW,EAAE;AADW,KAAD,CADpB;AAILL,IAAAA,WAAW,EAAEH,cAAc,CAAC;AAC1Ba,MAAAA,KAAK,EAAE,cADmB;AAE1BL,MAAAA,WAAW,EACT,8LAHwB;AAI1BM,MAAAA,YAAY,EAAE;AAJY,KAAD;AAJtB;AAPgB,CAAlB","sourcesContent":["import * as React from \"react\";\nimport { Callout } from \"react-native-maps\";\nimport { CalloutProps } from \"./types\";\nimport {\n COMPONENT_TYPES,\n createActionProp,\n createBoolProp,\n} from \"@draftbit/types\";\n\nconst MapCallout: React.FC<CalloutProps> = ({\n onPress,\n showTooltip,\n children,\n}) => (\n <Callout tooltip={!showTooltip} onPress={onPress}>\n {children}\n </Callout>\n);\n\nexport default MapCallout;\n\nexport const SEED_DATA = {\n name: \"Callout\",\n tag: \"MapCallout\",\n description:\n \"An info window to display on top of a marker when it is clicked\",\n category: COMPONENT_TYPES.container,\n layout: {},\n props: {\n onPress: createActionProp({\n description: \"Action to execute when the callout is pressed\",\n }),\n showTooltip: createBoolProp({\n label: \"Show Tooltip\",\n description:\n 'If false, a default \"tooltip\" bubble window will be drawn around this callout\\'s children. If true, the child views can fully customize their appearance, including any \"bubble\"-like styles',\n defaultValue: false,\n }),\n },\n};\n"]}
|