react-native-radar 3.15.0 → 3.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +10 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/io/radar/react/RNRadarModule.java +20 -8
  4. package/app.plugin.js +1 -0
  5. package/dist/{src/ui → ui}/autocomplete.d.ts +2 -1
  6. package/dist/{src/ui → ui}/autocomplete.js +1 -1
  7. package/dist/{src/ui → ui}/map.d.ts +2 -1
  8. package/ios/Cartfile.resolved +1 -1
  9. package/ios/RNRadar.m +13 -5
  10. package/package.json +18 -11
  11. package/plugin/build/index.d.ts +3 -0
  12. package/plugin/build/index.js +6 -0
  13. package/plugin/build/types.d.ts +11 -0
  14. package/plugin/build/types.js +2 -0
  15. package/plugin/build/withRadar.d.ts +4 -0
  16. package/plugin/build/withRadar.js +26 -0
  17. package/plugin/build/withRadarAndroid.d.ts +3 -0
  18. package/plugin/build/withRadarAndroid.js +110 -0
  19. package/plugin/build/withRadarIOS.d.ts +3 -0
  20. package/plugin/build/withRadarIOS.js +75 -0
  21. package/react-native-radar.podspec +1 -1
  22. package/dist/package.json +0 -84
  23. package/src/@types/RadarNativeInterface.ts +0 -106
  24. package/src/@types/types.ts +0 -784
  25. package/src/helpers.js +0 -15
  26. package/src/index.native.ts +0 -298
  27. package/src/index.ts +0 -22
  28. package/src/index.web.js +0 -410
  29. package/src/ui/autocomplete.jsx +0 -323
  30. package/src/ui/back.png +0 -0
  31. package/src/ui/close.png +0 -0
  32. package/src/ui/images.js +0 -5
  33. package/src/ui/map-logo.png +0 -0
  34. package/src/ui/map.jsx +0 -122
  35. package/src/ui/marker.png +0 -0
  36. package/src/ui/radar-logo.png +0 -0
  37. package/src/ui/search.png +0 -0
  38. package/src/ui/styles.js +0 -125
  39. /package/dist/{src/@types → @types}/RadarNativeInterface.d.ts +0 -0
  40. /package/dist/{src/@types → @types}/RadarNativeInterface.js +0 -0
  41. /package/dist/{src/@types → @types}/types.d.ts +0 -0
  42. /package/dist/{src/@types → @types}/types.js +0 -0
  43. /package/dist/{src/helpers.d.ts → helpers.d.ts} +0 -0
  44. /package/dist/{src/helpers.js → helpers.js} +0 -0
  45. /package/dist/{src/index.d.ts → index.d.ts} +0 -0
  46. /package/dist/{src/index.js → index.js} +0 -0
  47. /package/dist/{src/index.native.d.ts → index.native.d.ts} +0 -0
  48. /package/dist/{src/index.native.js → index.native.js} +0 -0
  49. /package/dist/{src/index.web.d.ts → index.web.d.ts} +0 -0
  50. /package/dist/{src/index.web.js → index.web.js} +0 -0
  51. /package/dist/{src/ui → ui}/back.png +0 -0
  52. /package/dist/{src/ui → ui}/close.png +0 -0
  53. /package/dist/{src/ui → ui}/images.d.ts +0 -0
  54. /package/dist/{src/ui → ui}/images.js +0 -0
  55. /package/dist/{src/ui → ui}/map-logo.png +0 -0
  56. /package/dist/{src/ui → ui}/map.js +0 -0
  57. /package/dist/{src/ui → ui}/marker.png +0 -0
  58. /package/dist/{src/ui → ui}/radar-logo.png +0 -0
  59. /package/dist/{src/ui → ui}/search.png +0 -0
  60. /package/dist/{src/ui → ui}/styles.d.ts +0 -0
  61. /package/dist/{src/ui → ui}/styles.js +0 -0
package/src/ui/close.png DELETED
Binary file
package/src/ui/images.js DELETED
@@ -1,5 +0,0 @@
1
- export const BACK_ICON = require('./back.png');
2
- export const SEARCH_ICON = require('./search.png');
3
- export const RADAR_LOGO = require('./radar-logo.png');
4
- export const MARKER_ICON = require('./marker.png');
5
- export const CLOSE_ICON = require('./close.png');
Binary file
package/src/ui/map.jsx DELETED
@@ -1,122 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { View, Image } from 'react-native';
3
- import Radar from '../index.native';
4
- import { getHost, getPublishableKey } from '../helpers';
5
- import styles from './styles';
6
-
7
- let MapLibreGL;
8
- try {
9
- MapLibreGL = require('@maplibre/maplibre-react-native');
10
- } catch (e) {
11
- MapLibreGL = null;
12
- }
13
-
14
- const DEFAULT_STYLE = 'radar-default-v1';
15
-
16
- const createStyleURL = async (style = DEFAULT_STYLE) => {
17
- const host = await getHost();
18
- const publishableKey = await getPublishableKey();
19
- return `${host}/maps/styles/${style}?publishableKey=${publishableKey}`;
20
- };
21
-
22
- const RadarMap = ({ mapOptions, children }) => {
23
- const [styleURL, setStyleURL] = useState(null);
24
- const [userLocation, setUserLocation] = useState(null);
25
-
26
- useEffect(() => {
27
- createStyleURL(mapOptions?.mapStyle || DEFAULT_STYLE).then((result) => {
28
- setStyleURL(result);
29
- });
30
- }, [mapOptions]);
31
-
32
- useEffect(() => {
33
- Radar.getLocation().then((result) => {
34
- if (result?.location?.latitude && result?.location?.longitude) {
35
- setUserLocation({
36
- latitude: result.location.latitude,
37
- longitude: result.location.longitude,
38
- });
39
- }
40
- }).catch((err) => {
41
- // eslint-disable-next-line no-console
42
- console.warn(`Radar SDK: Failed to get location: ${err}`);
43
- });
44
- }, [mapOptions]);
45
-
46
- if (!styleURL) {
47
- return null;
48
- }
49
-
50
- if (!MapLibreGL) {
51
- return null;
52
- }
53
-
54
- const geoJSONUserLocation = {
55
- type: 'FeatureCollection',
56
- features: userLocation?.longitude !== undefined ? [
57
- {
58
- type: 'Feature',
59
- geometry: {
60
- type: 'Point',
61
- coordinates: [userLocation.longitude, userLocation.latitude],
62
- },
63
- },
64
- ] : [],
65
- };
66
-
67
- const userLocationMapIndicator = (
68
- <MapLibreGL.ShapeSource
69
- id="user-location"
70
- shape={geoJSONUserLocation}
71
- >
72
- <MapLibreGL.CircleLayer
73
- id="user-location-inner"
74
- style={{
75
- circleRadius: 15,
76
- circleColor: '#000257',
77
- circleOpacity: 0.2,
78
- circlePitchAlignment: 'map',
79
- }}
80
- />
81
- <MapLibreGL.CircleLayer
82
- id="user-location-middle"
83
- style={{
84
- circleRadius: 9,
85
- circleColor: '#fff',
86
- circlePitchAlignment: 'map',
87
- }}
88
- />
89
- <MapLibreGL.CircleLayer
90
- id="user-location-outer"
91
- style={{
92
- circleRadius: 6,
93
- circleColor: '#000257',
94
- circlePitchAlignment: 'map',
95
- }}
96
- />
97
- </MapLibreGL.ShapeSource>
98
- );
99
-
100
- return (
101
- <View style={styles.mapContainer}>
102
- <MapLibreGL.MapView
103
- style={styles.map}
104
- pitchEnabled={false}
105
- compassEnabled={false}
106
- logoEnabled={false}
107
- attributionEnabled
108
- onRegionDidChange={mapOptions?.onRegionDidChange ? mapOptions.onRegionDidChange : null}
109
- styleURL={styleURL}
110
- >
111
- {userLocationMapIndicator}
112
- {children}
113
- </MapLibreGL.MapView>
114
- <Image
115
- source={require('./map-logo.png')}
116
- style={styles.mapLogo}
117
- />
118
- </View>
119
- );
120
- };
121
-
122
- export default RadarMap;
package/src/ui/marker.png DELETED
Binary file
Binary file
package/src/ui/search.png DELETED
Binary file
package/src/ui/styles.js DELETED
@@ -1,125 +0,0 @@
1
- import { StyleSheet } from 'react-native';
2
-
3
- const styles = StyleSheet.create({
4
- container: {
5
- width: '100%',
6
- height: '100%',
7
- alignItems: 'center',
8
- paddingTop: 8,
9
- },
10
- inputContainer: {
11
- flexDirection: 'row',
12
- alignItems: 'center',
13
- marginHorizontal: 16,
14
- backgroundColor: 'white',
15
- borderRadius: 5,
16
- borderColor: '#DBE5EB',
17
- borderWidth: 1,
18
- width: '95%', // only difference between this and the modalInputContainer
19
- },
20
- modalInputContainer: {
21
- flexDirection: 'row',
22
- alignItems: 'center',
23
- marginHorizontal: 16,
24
- backgroundColor: 'white',
25
- borderRadius: 5,
26
- borderColor: '#DBE5EB',
27
- borderWidth: 1,
28
- },
29
- inputIcon: {
30
- marginLeft: 10,
31
- height: 18,
32
- width: 18,
33
- backgroundColor: 'white',
34
- },
35
- closeIcon: {
36
- marginRight: 10,
37
- height: 18,
38
- width: 18,
39
- backgroundColor: 'white',
40
- },
41
- input: {
42
- flex: 1,
43
- backgroundColor: 'white',
44
- height: 40,
45
- fontSize: 14,
46
- paddingHorizontal: 8,
47
- borderRadius: 5,
48
- },
49
- resultListWrapper: {
50
- width: '100%',
51
- marginBottom: 30,
52
- backgroundColor: 'white',
53
- borderRadius: 5,
54
- paddingVertical: 8,
55
- },
56
- resultList: {
57
- width: '100%',
58
- },
59
- resultItem: {
60
- paddingRight: 16,
61
- paddingVertical: 8,
62
- paddingHorizontal: 16,
63
- fontSize: 12,
64
- backgroundColor: 'white',
65
- },
66
- addressContainer: {
67
- flexDirection: 'row',
68
- alignItems: 'center',
69
- },
70
- pinIconContainer: {
71
- width: 28,
72
- marginRight: 8,
73
- },
74
- pinIcon: {
75
- height: 26,
76
- width: 26,
77
- },
78
- addressTextContainer: {
79
- flex: 1,
80
- },
81
- addressText: {
82
- fontSize: 14,
83
- lineHeight: 24,
84
- color: '#000',
85
- fontWeight: '600',
86
- },
87
- addressSubtext: {
88
- fontSize: 14,
89
- color: '#5A6872',
90
- },
91
- footerContainer: {
92
- flexDirection: 'row',
93
- alignItems: 'center',
94
- paddingVertical: 10,
95
- marginRight: 16,
96
- alignSelf: 'flex-end',
97
- },
98
- footerText: {
99
- marginTop: 2,
100
- marginRight: 4,
101
- fontSize: 10,
102
- color: '#5A6872',
103
- },
104
- logo: {
105
- width: 50,
106
- height: 15,
107
- resizeMode: 'contain',
108
- },
109
- mapContainer: {
110
- flex: 1,
111
- },
112
- map: {
113
- flex: 1,
114
- },
115
- mapLogo: {
116
- position: 'absolute',
117
- bottom: -10,
118
- left: 5,
119
- width: 50,
120
- height: 50,
121
- resizeMode: 'contain',
122
- },
123
- });
124
-
125
- export default styles;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes