@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,130 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { MapViewProps } from "./types";
|
|
3
|
-
declare const MapView: React.FC<MapViewProps>;
|
|
4
|
-
export default MapView;
|
|
5
|
-
export declare const SEED_DATA: {
|
|
6
|
-
name: string;
|
|
7
|
-
tag: string;
|
|
8
|
-
description: string;
|
|
9
|
-
category: string;
|
|
10
|
-
layout: {};
|
|
11
|
-
props: {
|
|
12
|
-
apiKey: any;
|
|
13
|
-
provider: any;
|
|
14
|
-
latitudeDelta: {
|
|
15
|
-
label: string;
|
|
16
|
-
description: string;
|
|
17
|
-
formType: string;
|
|
18
|
-
propType: string;
|
|
19
|
-
group: string;
|
|
20
|
-
defaultValue: null;
|
|
21
|
-
editable: boolean;
|
|
22
|
-
required: boolean;
|
|
23
|
-
step: number;
|
|
24
|
-
};
|
|
25
|
-
longitudeDelta: {
|
|
26
|
-
label: string;
|
|
27
|
-
description: string;
|
|
28
|
-
formType: string;
|
|
29
|
-
propType: string;
|
|
30
|
-
group: string;
|
|
31
|
-
defaultValue: null;
|
|
32
|
-
editable: boolean;
|
|
33
|
-
required: boolean;
|
|
34
|
-
step: number;
|
|
35
|
-
};
|
|
36
|
-
latitude: {
|
|
37
|
-
label: string;
|
|
38
|
-
description: string;
|
|
39
|
-
formType: string;
|
|
40
|
-
propType: string;
|
|
41
|
-
group: string;
|
|
42
|
-
defaultValue: null;
|
|
43
|
-
editable: boolean;
|
|
44
|
-
required: boolean;
|
|
45
|
-
step: number;
|
|
46
|
-
};
|
|
47
|
-
longitude: {
|
|
48
|
-
label: string;
|
|
49
|
-
description: string;
|
|
50
|
-
formType: string;
|
|
51
|
-
propType: string;
|
|
52
|
-
group: string;
|
|
53
|
-
defaultValue: null;
|
|
54
|
-
editable: boolean;
|
|
55
|
-
required: boolean;
|
|
56
|
-
step: number;
|
|
57
|
-
};
|
|
58
|
-
mapType: any;
|
|
59
|
-
zoomEnabled: {
|
|
60
|
-
label: string;
|
|
61
|
-
description: string;
|
|
62
|
-
formType: string;
|
|
63
|
-
propType: string;
|
|
64
|
-
defaultValue: boolean;
|
|
65
|
-
editable: boolean;
|
|
66
|
-
required: boolean;
|
|
67
|
-
group: string;
|
|
68
|
-
};
|
|
69
|
-
showsCompass: {
|
|
70
|
-
label: string;
|
|
71
|
-
description: string;
|
|
72
|
-
formType: string;
|
|
73
|
-
propType: string;
|
|
74
|
-
defaultValue: boolean;
|
|
75
|
-
editable: boolean;
|
|
76
|
-
required: boolean;
|
|
77
|
-
group: string;
|
|
78
|
-
};
|
|
79
|
-
rotateEnabled: {
|
|
80
|
-
label: string;
|
|
81
|
-
description: string;
|
|
82
|
-
formType: string;
|
|
83
|
-
propType: string;
|
|
84
|
-
defaultValue: boolean;
|
|
85
|
-
editable: boolean;
|
|
86
|
-
required: boolean;
|
|
87
|
-
group: string;
|
|
88
|
-
};
|
|
89
|
-
scrollEnabled: {
|
|
90
|
-
label: string;
|
|
91
|
-
description: string;
|
|
92
|
-
formType: string;
|
|
93
|
-
propType: string;
|
|
94
|
-
defaultValue: boolean;
|
|
95
|
-
editable: boolean;
|
|
96
|
-
required: boolean;
|
|
97
|
-
group: string;
|
|
98
|
-
};
|
|
99
|
-
loadingEnabled: {
|
|
100
|
-
label: string;
|
|
101
|
-
description: string;
|
|
102
|
-
formType: string;
|
|
103
|
-
propType: string;
|
|
104
|
-
defaultValue: boolean;
|
|
105
|
-
editable: boolean;
|
|
106
|
-
required: boolean;
|
|
107
|
-
group: string;
|
|
108
|
-
};
|
|
109
|
-
loadingIndicatorColor: {
|
|
110
|
-
group: string;
|
|
111
|
-
label: string;
|
|
112
|
-
description: string;
|
|
113
|
-
editable: boolean;
|
|
114
|
-
required: boolean;
|
|
115
|
-
defaultValue: null;
|
|
116
|
-
formType: string;
|
|
117
|
-
propType: string;
|
|
118
|
-
};
|
|
119
|
-
loadingBackgroundColor: {
|
|
120
|
-
group: string;
|
|
121
|
-
label: string;
|
|
122
|
-
description: string;
|
|
123
|
-
editable: boolean;
|
|
124
|
-
required: boolean;
|
|
125
|
-
defaultValue: null;
|
|
126
|
-
formType: string;
|
|
127
|
-
propType: string;
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
2
|
-
import { MapTypes } from "react-native-maps";
|
|
3
|
-
export interface MapMarkerProps {
|
|
4
|
-
latitude: number;
|
|
5
|
-
longitude: number;
|
|
6
|
-
title?: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
pinColor?: string;
|
|
9
|
-
flat?: boolean;
|
|
10
|
-
style?: StyleProp<ViewStyle>;
|
|
11
|
-
}
|
|
12
|
-
export interface MapViewProps {
|
|
13
|
-
apiKey: string;
|
|
14
|
-
provider?: "google" | null;
|
|
15
|
-
latitudeDelta?: number;
|
|
16
|
-
longitudeDelta?: number;
|
|
17
|
-
latitude?: number;
|
|
18
|
-
longitude?: number;
|
|
19
|
-
mapType?: MapTypes;
|
|
20
|
-
zoomEnabled?: boolean;
|
|
21
|
-
showsCompass?: boolean;
|
|
22
|
-
rotateEnabled?: boolean;
|
|
23
|
-
scrollEnabled?: boolean;
|
|
24
|
-
loadingEnabled?: boolean;
|
|
25
|
-
loadingBackgroundColor?: string;
|
|
26
|
-
loadingIndicatorColor?: string;
|
|
27
|
-
style?: StyleProp<ViewStyle>;
|
|
28
|
-
}
|
|
29
|
-
export interface CalloutProps {
|
|
30
|
-
title?: string;
|
|
31
|
-
description?: string;
|
|
32
|
-
anchor: any;
|
|
33
|
-
onPress?: (event: any) => void;
|
|
34
|
-
showTooltip?: boolean;
|
|
35
|
-
}
|
|
@@ -1,22 +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
|
-
const MapCallout = ({ onPress, showTooltip, children, }) => (React.createElement(Callout, { tooltip: !showTooltip, onPress: onPress }, children));
|
|
5
|
-
export default MapCallout;
|
|
6
|
-
export const SEED_DATA = {
|
|
7
|
-
name: "Callout",
|
|
8
|
-
tag: "MapCallout",
|
|
9
|
-
description: "An info window to display on top of a marker when it is clicked",
|
|
10
|
-
category: COMPONENT_TYPES.container,
|
|
11
|
-
layout: {},
|
|
12
|
-
props: {
|
|
13
|
-
onPress: createActionProp({
|
|
14
|
-
description: "Action to execute when the callout is pressed",
|
|
15
|
-
}),
|
|
16
|
-
showTooltip: createBoolProp({
|
|
17
|
-
label: "Show Tooltip",
|
|
18
|
-
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',
|
|
19
|
-
defaultValue: false,
|
|
20
|
-
}),
|
|
21
|
-
},
|
|
22
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Callout } from "react-native-maps";
|
|
3
|
-
import { CalloutProps } from "./types";
|
|
4
|
-
import {
|
|
5
|
-
COMPONENT_TYPES,
|
|
6
|
-
createActionProp,
|
|
7
|
-
createBoolProp,
|
|
8
|
-
} from "@draftbit/types";
|
|
9
|
-
|
|
10
|
-
const MapCallout: React.FC<CalloutProps> = ({
|
|
11
|
-
onPress,
|
|
12
|
-
showTooltip,
|
|
13
|
-
children,
|
|
14
|
-
}) => (
|
|
15
|
-
<Callout tooltip={!showTooltip} onPress={onPress}>
|
|
16
|
-
{children}
|
|
17
|
-
</Callout>
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
export default MapCallout;
|
|
21
|
-
|
|
22
|
-
export const SEED_DATA = {
|
|
23
|
-
name: "Callout",
|
|
24
|
-
tag: "MapCallout",
|
|
25
|
-
description:
|
|
26
|
-
"An info window to display on top of a marker when it is clicked",
|
|
27
|
-
category: COMPONENT_TYPES.container,
|
|
28
|
-
layout: {},
|
|
29
|
-
props: {
|
|
30
|
-
onPress: createActionProp({
|
|
31
|
-
description: "Action to execute when the callout is pressed",
|
|
32
|
-
}),
|
|
33
|
-
showTooltip: createBoolProp({
|
|
34
|
-
label: "Show Tooltip",
|
|
35
|
-
description:
|
|
36
|
-
'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',
|
|
37
|
-
defaultValue: false,
|
|
38
|
-
}),
|
|
39
|
-
},
|
|
40
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { TouchableOpacity } from "react-native";
|
|
3
|
-
import { InfoWindow } from "@react-google-maps/api";
|
|
4
|
-
import { markerContext } from "./MapMarker.web";
|
|
5
|
-
const MapCallout = ({ anchor, onPress = () => { }, children, }) => {
|
|
6
|
-
const { toggleCallout, position, calloutOpened } = React.useContext(markerContext);
|
|
7
|
-
const handleClose = () => toggleCallout(false);
|
|
8
|
-
return calloutOpened ? (React.createElement(TouchableOpacity, { onPress: onPress },
|
|
9
|
-
React.createElement(InfoWindow, { anchor: anchor, position: {
|
|
10
|
-
lat: position?.latitude || 0,
|
|
11
|
-
lng: position?.longitude || 0,
|
|
12
|
-
}, onCloseClick: handleClose }, children))) : null;
|
|
13
|
-
};
|
|
14
|
-
export default MapCallout;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { TouchableOpacity } from "react-native";
|
|
3
|
-
import { InfoWindow } from "@react-google-maps/api";
|
|
4
|
-
import { markerContext } from "./MapMarker.web";
|
|
5
|
-
import { CalloutProps } from "./types";
|
|
6
|
-
|
|
7
|
-
const MapCallout: React.FC<CalloutProps> = ({
|
|
8
|
-
anchor,
|
|
9
|
-
onPress = () => {},
|
|
10
|
-
children,
|
|
11
|
-
}) => {
|
|
12
|
-
const { toggleCallout, position, calloutOpened } =
|
|
13
|
-
React.useContext(markerContext);
|
|
14
|
-
const handleClose = () => toggleCallout(false);
|
|
15
|
-
return calloutOpened ? (
|
|
16
|
-
<TouchableOpacity onPress={onPress}>
|
|
17
|
-
<InfoWindow
|
|
18
|
-
anchor={anchor}
|
|
19
|
-
position={{
|
|
20
|
-
lat: position?.latitude || 0,
|
|
21
|
-
lng: position?.longitude || 0,
|
|
22
|
-
}}
|
|
23
|
-
onCloseClick={handleClose}
|
|
24
|
-
>
|
|
25
|
-
{children}
|
|
26
|
-
</InfoWindow>
|
|
27
|
-
</TouchableOpacity>
|
|
28
|
-
) : null;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default MapCallout;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Marker } from "react-native-maps";
|
|
3
|
-
import { COMPONENT_TYPES, createBoolProp, createColorProp, createNumberProp, createTextProp, } from "@draftbit/types";
|
|
4
|
-
const MapMarker = ({ latitude, longitude, title, description, pinColor, flat, style, children, }) => (React.createElement(Marker, { coordinate: {
|
|
5
|
-
latitude,
|
|
6
|
-
longitude,
|
|
7
|
-
}, title: title, description: description, flat: flat, pinColor: pinColor, style: style }, children));
|
|
8
|
-
export default MapMarker;
|
|
9
|
-
export const SEED_DATA = {
|
|
10
|
-
name: "Map Marker",
|
|
11
|
-
tag: "MapMarker",
|
|
12
|
-
description: "A marker to show inside map view",
|
|
13
|
-
category: COMPONENT_TYPES.button,
|
|
14
|
-
layout: {},
|
|
15
|
-
props: {
|
|
16
|
-
latitude: createNumberProp({
|
|
17
|
-
label: "Latitude",
|
|
18
|
-
description: "The longitude in which the marker is located",
|
|
19
|
-
required: true,
|
|
20
|
-
precision: 0.000001,
|
|
21
|
-
min: -90,
|
|
22
|
-
max: 90,
|
|
23
|
-
}),
|
|
24
|
-
longitude: createNumberProp({
|
|
25
|
-
label: "Latitude",
|
|
26
|
-
description: "The latitude in which the marker is located",
|
|
27
|
-
required: true,
|
|
28
|
-
precision: 0.000001,
|
|
29
|
-
min: -180,
|
|
30
|
-
max: 180,
|
|
31
|
-
}),
|
|
32
|
-
title: createTextProp({
|
|
33
|
-
label: "Title",
|
|
34
|
-
description: "Title to show along with the marker",
|
|
35
|
-
defaultValue: null,
|
|
36
|
-
}),
|
|
37
|
-
description: createTextProp({
|
|
38
|
-
label: "Description",
|
|
39
|
-
description: "Optional description for the marker",
|
|
40
|
-
defaultValue: null,
|
|
41
|
-
}),
|
|
42
|
-
flat: createBoolProp({
|
|
43
|
-
label: "Flat",
|
|
44
|
-
description: "Sets whether this marker should be flat against the map (if true) or a billboard facing the camera (if false)",
|
|
45
|
-
defaultValue: false,
|
|
46
|
-
}),
|
|
47
|
-
pinColor: createColorProp({
|
|
48
|
-
label: "Pin Color",
|
|
49
|
-
description: "Sets the color of the marker",
|
|
50
|
-
}),
|
|
51
|
-
},
|
|
52
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Marker } from "react-native-maps";
|
|
3
|
-
import { MapMarkerProps } from "./types";
|
|
4
|
-
import {
|
|
5
|
-
COMPONENT_TYPES,
|
|
6
|
-
createBoolProp,
|
|
7
|
-
createColorProp,
|
|
8
|
-
createNumberProp,
|
|
9
|
-
createTextProp,
|
|
10
|
-
} from "@draftbit/types";
|
|
11
|
-
|
|
12
|
-
const MapMarker: React.FC<MapMarkerProps> = ({
|
|
13
|
-
latitude,
|
|
14
|
-
longitude,
|
|
15
|
-
title,
|
|
16
|
-
description,
|
|
17
|
-
pinColor,
|
|
18
|
-
flat,
|
|
19
|
-
style,
|
|
20
|
-
children,
|
|
21
|
-
}) => (
|
|
22
|
-
<Marker
|
|
23
|
-
coordinate={{
|
|
24
|
-
latitude,
|
|
25
|
-
longitude,
|
|
26
|
-
}}
|
|
27
|
-
title={title}
|
|
28
|
-
description={description}
|
|
29
|
-
flat={flat}
|
|
30
|
-
pinColor={pinColor}
|
|
31
|
-
style={style}
|
|
32
|
-
>
|
|
33
|
-
{children}
|
|
34
|
-
</Marker>
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
export default MapMarker;
|
|
38
|
-
|
|
39
|
-
export const SEED_DATA = {
|
|
40
|
-
name: "Map Marker",
|
|
41
|
-
tag: "MapMarker",
|
|
42
|
-
description: "A marker to show inside map view",
|
|
43
|
-
category: COMPONENT_TYPES.button,
|
|
44
|
-
layout: {},
|
|
45
|
-
props: {
|
|
46
|
-
latitude: createNumberProp({
|
|
47
|
-
label: "Latitude",
|
|
48
|
-
description: "The longitude in which the marker is located",
|
|
49
|
-
required: true,
|
|
50
|
-
precision: 0.000001,
|
|
51
|
-
min: -90,
|
|
52
|
-
max: 90,
|
|
53
|
-
}),
|
|
54
|
-
longitude: createNumberProp({
|
|
55
|
-
label: "Latitude",
|
|
56
|
-
description: "The latitude in which the marker is located",
|
|
57
|
-
required: true,
|
|
58
|
-
precision: 0.000001,
|
|
59
|
-
min: -180,
|
|
60
|
-
max: 180,
|
|
61
|
-
}),
|
|
62
|
-
title: createTextProp({
|
|
63
|
-
label: "Title",
|
|
64
|
-
description: "Title to show along with the marker",
|
|
65
|
-
defaultValue: null,
|
|
66
|
-
}),
|
|
67
|
-
description: createTextProp({
|
|
68
|
-
label: "Description",
|
|
69
|
-
description: "Optional description for the marker",
|
|
70
|
-
defaultValue: null,
|
|
71
|
-
}),
|
|
72
|
-
flat: createBoolProp({
|
|
73
|
-
label: "Flat",
|
|
74
|
-
description:
|
|
75
|
-
"Sets whether this marker should be flat against the map (if true) or a billboard facing the camera (if false)",
|
|
76
|
-
defaultValue: false,
|
|
77
|
-
}),
|
|
78
|
-
pinColor: createColorProp({
|
|
79
|
-
label: "Pin Color",
|
|
80
|
-
description: "Sets the color of the marker",
|
|
81
|
-
}),
|
|
82
|
-
},
|
|
83
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { View, Text, StyleSheet } from "react-native";
|
|
3
|
-
import { Marker as WebMarker } from "@react-google-maps/api";
|
|
4
|
-
import MapCallout from "./MapCallout.web";
|
|
5
|
-
export const markerContext = React.createContext({
|
|
6
|
-
pinColor: "#E74C3C",
|
|
7
|
-
calloutOpened: false,
|
|
8
|
-
position: undefined,
|
|
9
|
-
toggleCallout: () => { },
|
|
10
|
-
});
|
|
11
|
-
const MapMarker = ({ pinColor, latitude, longitude, title, description, children, }) => {
|
|
12
|
-
const { Provider } = markerContext;
|
|
13
|
-
const [calloutOpened, toggleCallout] = React.useState(false);
|
|
14
|
-
const [marker, setMarker] = React.useState(null);
|
|
15
|
-
const handleMarkerClick = () => toggleCallout(true);
|
|
16
|
-
const handleOnLoad = (m) => setMarker(m);
|
|
17
|
-
let mappedChildren;
|
|
18
|
-
if (!children) {
|
|
19
|
-
if (title || description) {
|
|
20
|
-
mappedChildren = (React.createElement(MapCallout, { showTooltip: true, anchor: marker },
|
|
21
|
-
React.createElement(View, { style: style.tooltip },
|
|
22
|
-
title && React.createElement(Text, { style: style.title }, title),
|
|
23
|
-
description && (React.createElement(Text, { style: style.description }, description)))));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
mappedChildren = React.Children.map(children, (child, index) => {
|
|
28
|
-
return React.cloneElement(child, {
|
|
29
|
-
index,
|
|
30
|
-
anchor: marker,
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
return (React.createElement(Provider, { value: {
|
|
35
|
-
pinColor: pinColor,
|
|
36
|
-
calloutOpened,
|
|
37
|
-
toggleCallout: (value) => toggleCallout(value),
|
|
38
|
-
position: {
|
|
39
|
-
latitude,
|
|
40
|
-
longitude,
|
|
41
|
-
},
|
|
42
|
-
} },
|
|
43
|
-
React.createElement(WebMarker, { position: {
|
|
44
|
-
lat: latitude,
|
|
45
|
-
lng: longitude,
|
|
46
|
-
}, onClick: handleMarkerClick, onLoad: handleOnLoad, icon: {
|
|
47
|
-
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",
|
|
48
|
-
fillColor: pinColor,
|
|
49
|
-
fillOpacity: 1,
|
|
50
|
-
strokeWeight: 0,
|
|
51
|
-
rotation: 0,
|
|
52
|
-
scale: 2,
|
|
53
|
-
} }, mappedChildren)));
|
|
54
|
-
};
|
|
55
|
-
const style = StyleSheet.create({
|
|
56
|
-
tooltip: {
|
|
57
|
-
display: "flex",
|
|
58
|
-
flexDirection: "column",
|
|
59
|
-
},
|
|
60
|
-
title: {
|
|
61
|
-
fontWeight: "600",
|
|
62
|
-
textAlign: "center",
|
|
63
|
-
},
|
|
64
|
-
description: {
|
|
65
|
-
textAlign: "center",
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
export default MapMarker;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { View, Text, StyleSheet } from "react-native";
|
|
3
|
-
import { LatLng, MarkerProps } from "react-native-maps";
|
|
4
|
-
import { MapMarkerProps } from "./types";
|
|
5
|
-
import { Marker as WebMarker } from "@react-google-maps/api";
|
|
6
|
-
import MapCallout from "./MapCallout.web";
|
|
7
|
-
|
|
8
|
-
interface IMarkerContext {
|
|
9
|
-
pinColor?: string | undefined;
|
|
10
|
-
calloutOpened: boolean;
|
|
11
|
-
position: LatLng | undefined;
|
|
12
|
-
toggleCallout: (value: boolean) => void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const markerContext = React.createContext<IMarkerContext>({
|
|
16
|
-
pinColor: "#E74C3C",
|
|
17
|
-
calloutOpened: false,
|
|
18
|
-
position: undefined,
|
|
19
|
-
toggleCallout: () => {},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const MapMarker: React.FC<MapMarkerProps> = ({
|
|
23
|
-
pinColor,
|
|
24
|
-
latitude,
|
|
25
|
-
longitude,
|
|
26
|
-
title,
|
|
27
|
-
description,
|
|
28
|
-
children,
|
|
29
|
-
}) => {
|
|
30
|
-
const { Provider } = markerContext;
|
|
31
|
-
const [calloutOpened, toggleCallout] = React.useState(false);
|
|
32
|
-
const [marker, setMarker] = React.useState<MarkerProps | null>(null);
|
|
33
|
-
const handleMarkerClick = () => toggleCallout(true);
|
|
34
|
-
const handleOnLoad = (m: any) => setMarker(m);
|
|
35
|
-
let mappedChildren;
|
|
36
|
-
if (!children) {
|
|
37
|
-
if (title || description) {
|
|
38
|
-
mappedChildren = (
|
|
39
|
-
<MapCallout showTooltip anchor={marker}>
|
|
40
|
-
<View style={style.tooltip}>
|
|
41
|
-
{title && <Text style={style.title}>{title}</Text>}
|
|
42
|
-
{description && (
|
|
43
|
-
<Text style={style.description}>{description}</Text>
|
|
44
|
-
)}
|
|
45
|
-
</View>
|
|
46
|
-
</MapCallout>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
} else {
|
|
50
|
-
mappedChildren = React.Children.map(children, (child, index) => {
|
|
51
|
-
return React.cloneElement(child as React.ReactElement, {
|
|
52
|
-
index,
|
|
53
|
-
anchor: marker,
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return (
|
|
58
|
-
<Provider
|
|
59
|
-
value={{
|
|
60
|
-
pinColor: pinColor,
|
|
61
|
-
calloutOpened,
|
|
62
|
-
toggleCallout: (value) => toggleCallout(value),
|
|
63
|
-
position: {
|
|
64
|
-
latitude,
|
|
65
|
-
longitude,
|
|
66
|
-
},
|
|
67
|
-
}}
|
|
68
|
-
>
|
|
69
|
-
<WebMarker
|
|
70
|
-
position={{
|
|
71
|
-
lat: latitude,
|
|
72
|
-
lng: longitude,
|
|
73
|
-
}}
|
|
74
|
-
onClick={handleMarkerClick}
|
|
75
|
-
onLoad={handleOnLoad}
|
|
76
|
-
icon={{
|
|
77
|
-
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",
|
|
78
|
-
fillColor: pinColor,
|
|
79
|
-
fillOpacity: 1,
|
|
80
|
-
strokeWeight: 0,
|
|
81
|
-
rotation: 0,
|
|
82
|
-
scale: 2,
|
|
83
|
-
}}
|
|
84
|
-
>
|
|
85
|
-
{mappedChildren}
|
|
86
|
-
</WebMarker>
|
|
87
|
-
</Provider>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
const style = StyleSheet.create({
|
|
92
|
-
tooltip: {
|
|
93
|
-
display: "flex",
|
|
94
|
-
flexDirection: "column",
|
|
95
|
-
},
|
|
96
|
-
title: {
|
|
97
|
-
fontWeight: "600",
|
|
98
|
-
textAlign: "center",
|
|
99
|
-
},
|
|
100
|
-
description: {
|
|
101
|
-
textAlign: "center",
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
export default MapMarker;
|