react-native-pointr 9.6.0 → 9.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API_REFERENCE.md +1035 -557
- package/CHANGELOG.md +6 -0
- package/README.md +75 -216
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/pointr/PTRMapWidgetManager.kt +156 -0
- package/ios/PTRMapWidgetContainerView.swift +179 -1
- package/ios/PTRMapWidgetManager-Bridging.m +6 -0
- package/ios/PTRNativeLibrary.swift +14 -0
- package/package.json +16 -5
- package/react-native-pointr.podspec +1 -1
- package/src/PTRMapWidgetUtils.ts +2 -8
- package/src/api/MapWidgetApi.ts +45 -0
- package/src/api/PointrSdk.ts +241 -0
- package/src/api/index.ts +9 -0
- package/src/commands/index.ts +275 -0
- package/src/components/index.tsx +130 -0
- package/src/constants/index.ts +104 -0
- package/src/hooks/index.ts +8 -0
- package/src/hooks/usePointrEvents.ts +40 -0
- package/src/hooks/usePointrPois.ts +41 -0
- package/src/hooks/usePointrPosition.ts +31 -0
- package/src/hooks/usePointrSdk.ts +41 -0
- package/src/index.tsx +87 -7
- package/src/{PTRPoiManager.ts → managers/PTRPoiManager.ts} +1 -1
- package/src/types/config.ts +57 -0
- package/src/types/events.ts +106 -0
- package/src/types/index.ts +35 -0
package/src/index.tsx
CHANGED
|
@@ -17,18 +17,45 @@ const PTRNativePointrLibrary = NativeModules.PTRNativePointrLibrary
|
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
|
|
20
|
-
// Export the native library as default
|
|
20
|
+
// Export the native library as default (backwards compatibility)
|
|
21
21
|
export default PTRNativePointrLibrary;
|
|
22
22
|
|
|
23
|
-
//
|
|
24
|
-
|
|
23
|
+
// ============================================================================
|
|
24
|
+
// NEW API - Recommended for new projects
|
|
25
|
+
// ============================================================================
|
|
25
26
|
|
|
26
|
-
//
|
|
27
|
-
export {
|
|
27
|
+
// Core API
|
|
28
|
+
export { PointrSdk, pointrSdk } from './api/PointrSdk';
|
|
29
|
+
export {
|
|
30
|
+
executeMapCommand,
|
|
31
|
+
} from './api/MapWidgetApi';
|
|
28
32
|
|
|
29
|
-
//
|
|
33
|
+
// Constants and Enums
|
|
30
34
|
export {
|
|
35
|
+
PTRLogLevel,
|
|
36
|
+
PTRState,
|
|
37
|
+
PTRAnimationType,
|
|
31
38
|
PTRCommandType,
|
|
39
|
+
PTREvents,
|
|
40
|
+
PTRErrorMessages,
|
|
41
|
+
} from './constants';
|
|
42
|
+
|
|
43
|
+
// React Hooks
|
|
44
|
+
export {
|
|
45
|
+
usePointrSdk,
|
|
46
|
+
usePointrPosition,
|
|
47
|
+
usePointrPois,
|
|
48
|
+
usePointrGeofence,
|
|
49
|
+
usePointrBuildingClick,
|
|
50
|
+
usePointrSiteClick,
|
|
51
|
+
} from './hooks';
|
|
52
|
+
|
|
53
|
+
// Components
|
|
54
|
+
export { PTRMapWidget } from './components';
|
|
55
|
+
export type { PTRMapWidgetProps } from './components';
|
|
56
|
+
|
|
57
|
+
// Commands (new refactored version)
|
|
58
|
+
export {
|
|
32
59
|
PTRCommand,
|
|
33
60
|
PTRSiteCommand,
|
|
34
61
|
PTRBuildingCommand,
|
|
@@ -41,9 +68,58 @@ export {
|
|
|
41
68
|
PTRMarkMyCarSiteCommand,
|
|
42
69
|
PTRShowMyCarSiteCommand,
|
|
43
70
|
PTRStartAndFocusCommand,
|
|
71
|
+
isPTRSiteCommand,
|
|
72
|
+
isPTRBuildingCommand,
|
|
73
|
+
isPTRLevelCommand,
|
|
74
|
+
isPTRPoiCommand,
|
|
75
|
+
isPTRPathCommand,
|
|
76
|
+
isPTRStaticPathCommand,
|
|
77
|
+
} from './commands';
|
|
78
|
+
|
|
79
|
+
// Types
|
|
80
|
+
export type {
|
|
81
|
+
PTRConfiguration,
|
|
82
|
+
PTRMapWidgetConfiguration,
|
|
83
|
+
PTRStateCallback,
|
|
84
|
+
PTRPositionEvent,
|
|
85
|
+
PTRBuildingClickEvent,
|
|
86
|
+
PTRSiteClickEvent,
|
|
87
|
+
PTRGeofenceEvent,
|
|
88
|
+
PTRGeofence,
|
|
89
|
+
PTRGeofenceNotification,
|
|
90
|
+
PTRMapCommandResponse,
|
|
91
|
+
} from './types';
|
|
92
|
+
|
|
93
|
+
export { PTRGeofenceEventType } from './types';
|
|
94
|
+
|
|
95
|
+
// ============================================================================
|
|
96
|
+
// LEGACY API - Maintained for backwards compatibility
|
|
97
|
+
// ============================================================================
|
|
98
|
+
|
|
99
|
+
// Export POI Manager functions (legacy)
|
|
100
|
+
export { getPois } from './managers/PTRPoiManager';
|
|
101
|
+
|
|
102
|
+
// Export Map Widget utilities (legacy)
|
|
103
|
+
export { showMapWidget } from './PTRMapWidgetUtils';
|
|
104
|
+
|
|
105
|
+
// Legacy command exports (still works but new code should use ./commands)
|
|
106
|
+
export {
|
|
107
|
+
PTRCommandType as LegacyPTRCommandType,
|
|
108
|
+
PTRCommand as LegacyPTRCommand,
|
|
109
|
+
PTRSiteCommand as LegacyPTRSiteCommand,
|
|
110
|
+
PTRBuildingCommand as LegacyPTRBuildingCommand,
|
|
111
|
+
PTRLevelCommand as LegacyPTRLevelCommand,
|
|
112
|
+
PTRPoiCommand as LegacyPTRPoiCommand,
|
|
113
|
+
PTRPathCommand as LegacyPTRPathCommand,
|
|
114
|
+
PTRStaticPathCommand as LegacyPTRStaticPathCommand,
|
|
115
|
+
PTRStaticWayfindingCommand as LegacyPTRStaticWayfindingCommand,
|
|
116
|
+
PTRMarkMyCarLevelCommand as LegacyPTRMarkMyCarLevelCommand,
|
|
117
|
+
PTRMarkMyCarSiteCommand as LegacyPTRMarkMyCarSiteCommand,
|
|
118
|
+
PTRShowMyCarSiteCommand as LegacyPTRShowMyCarSiteCommand,
|
|
119
|
+
PTRStartAndFocusCommand as LegacyPTRStartAndFocusCommand,
|
|
44
120
|
} from './PTRCommand';
|
|
45
121
|
|
|
46
|
-
// Export types
|
|
122
|
+
// Export all existing types (maintained for backwards compatibility)
|
|
47
123
|
export type { PTRPoi, PTRPoiAttributes } from './types/PTRPoi';
|
|
48
124
|
export type { PTRPosition } from './types/PTRPosition';
|
|
49
125
|
export type { PTRWayfindingEvent } from './types/PTRWayfindingEvent';
|
|
@@ -57,3 +133,7 @@ export type {
|
|
|
57
133
|
PTRGeoMultiPolygon,
|
|
58
134
|
PTRGeoCircle,
|
|
59
135
|
} from './types/PTRGeometry';
|
|
136
|
+
|
|
137
|
+
// Re-export native module reference
|
|
138
|
+
export { PTRNativePointrLibrary };
|
|
139
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration types for the Pointr SDK
|
|
3
|
+
* @module types/config
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { PTRLogLevel } from '../constants';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Configuration options for initializing the Pointr SDK
|
|
10
|
+
*/
|
|
11
|
+
export interface PTRConfiguration {
|
|
12
|
+
/** Client ID provided by Pointr */
|
|
13
|
+
readonly clientId: string;
|
|
14
|
+
/** License key provided by Pointr */
|
|
15
|
+
readonly licenseKey: string;
|
|
16
|
+
/** Base URL for the Pointr service */
|
|
17
|
+
readonly baseUrl: string;
|
|
18
|
+
/** Log level for SDK output (default: ERROR) */
|
|
19
|
+
readonly logLevel?: PTRLogLevel;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Map widget configuration options
|
|
24
|
+
*/
|
|
25
|
+
export interface PTRMapWidgetConfiguration {
|
|
26
|
+
/** Show/hide the level selector UI */
|
|
27
|
+
readonly isLevelSelectorEnabled?: boolean;
|
|
28
|
+
/** Show/hide the loading view */
|
|
29
|
+
readonly isLoadingViewEnabled?: boolean;
|
|
30
|
+
/** Show/hide the map tracking mode button */
|
|
31
|
+
readonly isMapTrackingModeButtonEnabled?: boolean;
|
|
32
|
+
/** Show/hide the exit button */
|
|
33
|
+
readonly isExitButtonEnabled?: boolean;
|
|
34
|
+
/** Show/hide the splash screen */
|
|
35
|
+
readonly isSplashScreenEnabled?: boolean;
|
|
36
|
+
/** Enable/disable the onboarding flow */
|
|
37
|
+
readonly isOnboardingEnabled?: boolean;
|
|
38
|
+
/** Show/hide the joystick control */
|
|
39
|
+
readonly isJoystickEnabled?: boolean;
|
|
40
|
+
/** Show/hide toast messages */
|
|
41
|
+
readonly isToastMessagesEnabled?: boolean;
|
|
42
|
+
/** Show/hide the info button */
|
|
43
|
+
readonly isInfoButtonEnabled?: boolean;
|
|
44
|
+
/** Show/hide the location indicator */
|
|
45
|
+
readonly isLocationIndicatorEnabled?: boolean;
|
|
46
|
+
/** Automatically pan map to first calculated user position */
|
|
47
|
+
readonly shouldFocusOnFirstUserPosition?: boolean;
|
|
48
|
+
/** Enable/disable quick access panel */
|
|
49
|
+
readonly isQuickAccessEnabled?: boolean;
|
|
50
|
+
/** Show/hide the app banner */
|
|
51
|
+
readonly isAppBannerEnabled?: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Callback function for SDK state changes
|
|
56
|
+
*/
|
|
57
|
+
export type PTRStateCallback = (state: string) => void;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event types for the Pointr SDK
|
|
3
|
+
* @module types/events
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { PTRPosition } from './PTRPosition';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Position event payload
|
|
10
|
+
*/
|
|
11
|
+
export interface PTRPositionEvent {
|
|
12
|
+
/** Geographic position */
|
|
13
|
+
readonly position: PTRPosition;
|
|
14
|
+
/** Timestamp of the position calculation */
|
|
15
|
+
readonly timestamp?: number;
|
|
16
|
+
/** Accuracy of the position in meters */
|
|
17
|
+
readonly accuracy?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Building click event payload
|
|
22
|
+
*/
|
|
23
|
+
export interface PTRBuildingClickEvent {
|
|
24
|
+
/** Site identifier */
|
|
25
|
+
readonly siteId: string;
|
|
26
|
+
/** Building identifier */
|
|
27
|
+
readonly buildingId: string;
|
|
28
|
+
/** Building name */
|
|
29
|
+
readonly buildingName?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Site click event payload
|
|
34
|
+
*/
|
|
35
|
+
export interface PTRSiteClickEvent {
|
|
36
|
+
/** Site identifier */
|
|
37
|
+
readonly siteId: string;
|
|
38
|
+
/** Site name */
|
|
39
|
+
readonly siteName?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Geofence event types
|
|
44
|
+
*/
|
|
45
|
+
export enum PTRGeofenceEventType {
|
|
46
|
+
/** User entered a geofence */
|
|
47
|
+
ENTER = 'enter',
|
|
48
|
+
/** User exited a geofence */
|
|
49
|
+
EXIT = 'exit',
|
|
50
|
+
/** User is dwelling in a geofence */
|
|
51
|
+
DWELL = 'dwell',
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Geofence data
|
|
56
|
+
*/
|
|
57
|
+
export interface PTRGeofence {
|
|
58
|
+
/** Geofence identifier */
|
|
59
|
+
readonly id: string;
|
|
60
|
+
/** External identifier */
|
|
61
|
+
readonly externalId?: string;
|
|
62
|
+
/** Geofence name */
|
|
63
|
+
readonly name: string;
|
|
64
|
+
/** Geofence type */
|
|
65
|
+
readonly geofenceType: string;
|
|
66
|
+
/** Position of the geofence */
|
|
67
|
+
readonly position: PTRPosition;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Geofence notification
|
|
72
|
+
*/
|
|
73
|
+
export interface PTRGeofenceNotification {
|
|
74
|
+
/** Notification identifier */
|
|
75
|
+
readonly id: string;
|
|
76
|
+
/** Notification message */
|
|
77
|
+
readonly message: string;
|
|
78
|
+
/** Notification timestamp */
|
|
79
|
+
readonly timestamp: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Geofence event payload
|
|
84
|
+
*/
|
|
85
|
+
export interface PTRGeofenceEvent {
|
|
86
|
+
/** Event type (enter/exit/dwell) */
|
|
87
|
+
readonly eventType: PTRGeofenceEventType | string;
|
|
88
|
+
/** Geofence data */
|
|
89
|
+
readonly geofence?: PTRGeofence;
|
|
90
|
+
/** Optional notification */
|
|
91
|
+
readonly geofenceNotification?: PTRGeofenceNotification;
|
|
92
|
+
/** Event timestamp (iOS only) */
|
|
93
|
+
readonly timestamp?: number;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Map command response payload
|
|
98
|
+
*/
|
|
99
|
+
export interface PTRMapCommandResponse {
|
|
100
|
+
/** Command type that was executed */
|
|
101
|
+
readonly command: string;
|
|
102
|
+
/** Site external identifier (for site commands) */
|
|
103
|
+
readonly siteExternalIdentifier?: string;
|
|
104
|
+
/** Error message if command failed */
|
|
105
|
+
readonly error?: string;
|
|
106
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the Pointr SDK
|
|
3
|
+
* @module types
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Export configuration types
|
|
7
|
+
export type { PTRConfiguration, PTRMapWidgetConfiguration, PTRStateCallback } from './config';
|
|
8
|
+
|
|
9
|
+
// Export event types
|
|
10
|
+
export type {
|
|
11
|
+
PTRPositionEvent,
|
|
12
|
+
PTRBuildingClickEvent,
|
|
13
|
+
PTRSiteClickEvent,
|
|
14
|
+
PTRGeofenceEvent,
|
|
15
|
+
PTRGeofence,
|
|
16
|
+
PTRGeofenceNotification,
|
|
17
|
+
PTRMapCommandResponse,
|
|
18
|
+
} from './events';
|
|
19
|
+
|
|
20
|
+
export { PTRGeofenceEventType } from './events';
|
|
21
|
+
|
|
22
|
+
// Export existing types
|
|
23
|
+
export type { PTRPoi, PTRPoiAttributes } from './PTRPoi';
|
|
24
|
+
export type { PTRPosition } from './PTRPosition';
|
|
25
|
+
export type { PTRWayfindingEvent } from './PTRWayfindingEvent';
|
|
26
|
+
export type {
|
|
27
|
+
PTRGeometry,
|
|
28
|
+
PTRGeoPoint,
|
|
29
|
+
PTRGeoLineString,
|
|
30
|
+
PTRGeoPolygon,
|
|
31
|
+
PTRGeoMultiPoint,
|
|
32
|
+
PTRGeoMultiLineString,
|
|
33
|
+
PTRGeoMultiPolygon,
|
|
34
|
+
PTRGeoCircle,
|
|
35
|
+
} from './PTRGeometry';
|