@situm/react-native 3.0.8 → 3.1.0-beta.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 (77) hide show
  1. package/android/src/main/java/com/situm/plugin/PluginHelper.java +3 -2
  2. package/android/src/main/java/com/situm/plugin/SitumMapper.java +38 -59
  3. package/android/src/main/java/com/situm/plugin/SitumPlugin.java +1 -0
  4. package/android/src/main/java/com/situm/plugin/SitumPluginImpl.java +1 -1
  5. package/ios/SitumPlugin.m +8 -2
  6. package/lib/commonjs/sdk/index.js +509 -251
  7. package/lib/commonjs/sdk/index.js.map +1 -1
  8. package/lib/commonjs/sdk/nativeInterface.js.map +1 -1
  9. package/lib/commonjs/sdk/types/constants.js +31 -4
  10. package/lib/commonjs/sdk/types/constants.js.map +1 -1
  11. package/lib/commonjs/sdk/utils.js +103 -0
  12. package/lib/commonjs/sdk/utils.js.map +1 -0
  13. package/lib/commonjs/utils/requestPermission.js +9 -16
  14. package/lib/commonjs/utils/requestPermission.js.map +1 -1
  15. package/lib/commonjs/wayfinding/components/MapView.js +78 -134
  16. package/lib/commonjs/wayfinding/components/MapView.js.map +1 -1
  17. package/lib/commonjs/wayfinding/hooks/index.js +118 -278
  18. package/lib/commonjs/wayfinding/hooks/index.js.map +1 -1
  19. package/lib/commonjs/wayfinding/store/index.js +17 -6
  20. package/lib/commonjs/wayfinding/store/index.js.map +1 -1
  21. package/lib/commonjs/wayfinding/types/index.js +1 -3
  22. package/lib/commonjs/wayfinding/types/index.js.map +1 -1
  23. package/lib/commonjs/wayfinding/utils/mapper.js +128 -71
  24. package/lib/commonjs/wayfinding/utils/mapper.js.map +1 -1
  25. package/lib/module/sdk/index.js +509 -249
  26. package/lib/module/sdk/index.js.map +1 -1
  27. package/lib/module/sdk/nativeInterface.js.map +1 -1
  28. package/lib/module/sdk/types/constants.js +27 -3
  29. package/lib/module/sdk/types/constants.js.map +1 -1
  30. package/lib/module/sdk/utils.js +94 -0
  31. package/lib/module/sdk/utils.js.map +1 -0
  32. package/lib/module/utils/requestPermission.js +9 -16
  33. package/lib/module/utils/requestPermission.js.map +1 -1
  34. package/lib/module/wayfinding/components/MapView.js +77 -133
  35. package/lib/module/wayfinding/components/MapView.js.map +1 -1
  36. package/lib/module/wayfinding/hooks/index.js +119 -278
  37. package/lib/module/wayfinding/hooks/index.js.map +1 -1
  38. package/lib/module/wayfinding/store/index.js +15 -6
  39. package/lib/module/wayfinding/store/index.js.map +1 -1
  40. package/lib/module/wayfinding/types/index.js +1 -1
  41. package/lib/module/wayfinding/types/index.js.map +1 -1
  42. package/lib/module/wayfinding/utils/mapper.js +123 -72
  43. package/lib/module/wayfinding/utils/mapper.js.map +1 -1
  44. package/lib/typescript/src/sdk/index.d.ts +183 -145
  45. package/lib/typescript/src/sdk/index.d.ts.map +1 -1
  46. package/lib/typescript/src/sdk/nativeInterface.d.ts +59 -0
  47. package/lib/typescript/src/sdk/nativeInterface.d.ts.map +1 -1
  48. package/lib/typescript/src/sdk/types/constants.d.ts +24 -3
  49. package/lib/typescript/src/sdk/types/constants.d.ts.map +1 -1
  50. package/lib/typescript/src/sdk/types/index.d.ts +91 -146
  51. package/lib/typescript/src/sdk/types/index.d.ts.map +1 -1
  52. package/lib/typescript/src/sdk/utils.d.ts +53 -0
  53. package/lib/typescript/src/sdk/utils.d.ts.map +1 -0
  54. package/lib/typescript/src/utils/requestPermission.d.ts +1 -1
  55. package/lib/typescript/src/utils/requestPermission.d.ts.map +1 -1
  56. package/lib/typescript/src/wayfinding/components/MapView.d.ts +16 -28
  57. package/lib/typescript/src/wayfinding/components/MapView.d.ts.map +1 -1
  58. package/lib/typescript/src/wayfinding/hooks/index.d.ts +3 -34
  59. package/lib/typescript/src/wayfinding/hooks/index.d.ts.map +1 -1
  60. package/lib/typescript/src/wayfinding/store/index.d.ts +8 -6
  61. package/lib/typescript/src/wayfinding/store/index.d.ts.map +1 -1
  62. package/lib/typescript/src/wayfinding/types/index.d.ts +36 -17
  63. package/lib/typescript/src/wayfinding/types/index.d.ts.map +1 -1
  64. package/lib/typescript/src/wayfinding/utils/mapper.d.ts +16 -11
  65. package/lib/typescript/src/wayfinding/utils/mapper.d.ts.map +1 -1
  66. package/package.json +2 -2
  67. package/src/sdk/index.ts +467 -476
  68. package/src/sdk/nativeInterface.ts +149 -1
  69. package/src/sdk/types/constants.ts +27 -3
  70. package/src/sdk/types/index.ts +98 -158
  71. package/src/sdk/utils.ts +129 -0
  72. package/src/utils/requestPermission.ts +18 -23
  73. package/src/wayfinding/components/MapView.tsx +145 -215
  74. package/src/wayfinding/hooks/index.ts +155 -385
  75. package/src/wayfinding/store/index.tsx +19 -9
  76. package/src/wayfinding/types/index.ts +49 -15
  77. package/src/wayfinding/utils/mapper.ts +145 -104
@@ -1,4 +1,5 @@
1
- import type { DirectionPoint, Poi } from "../../sdk/types";
1
+ import { AccessibilityMode } from "src/sdk";
2
+ import type { Point } from "../../sdk/types";
2
3
  import { ErrorName } from "./constants";
3
4
  export interface MapViewError {
4
5
  name: ErrorName;
@@ -6,9 +7,16 @@ export interface MapViewError {
6
7
  }
7
8
  export interface MapViewRef {
8
9
  selectPoi: (poiId: number) => void;
9
- navigateToPoi: ({ poi, poiId }: {
10
- poi?: Poi;
11
- poiId?: number;
10
+ navigateToPoi: ({ identifier, accessibilityMode, }: {
11
+ identifier: number;
12
+ accessibilityMode?: AccessibilityMode;
13
+ }) => void;
14
+ navigateToPoint: ({ lat, lng, floorIdentifier, navigationName, accessibilityMode, }: {
15
+ lat: number;
16
+ lng: number;
17
+ floorIdentifier: string;
18
+ navigationName?: string;
19
+ accessibilityMode?: AccessibilityMode;
12
20
  }) => void;
13
21
  cancelNavigation: () => void;
14
22
  }
@@ -17,16 +25,12 @@ export interface WayfindingResult {
17
25
  message: string;
18
26
  }
19
27
  export interface OnPoiSelectedResult {
20
- buildingId: string;
21
- buildingName: string;
22
- floorId: string;
23
- floorName: string;
24
- poiId: string;
25
- poiName: string;
28
+ identifier: string;
29
+ buildingIdentifier: string;
26
30
  }
27
31
  export interface OnPoiDeselectedResult {
28
- buildingId: string;
29
- buildingName: string;
32
+ identifier: string;
33
+ buildingIdentifier: string;
30
34
  }
31
35
  export interface OnFloorChangedResult {
32
36
  buildingId: string;
@@ -40,18 +44,33 @@ export interface Destination {
40
44
  category: string;
41
45
  identifier?: string;
42
46
  name?: string;
43
- point: DirectionPoint;
47
+ point: Point;
44
48
  }
45
49
  export interface Navigation {
46
50
  status: string;
47
51
  destination?: Destination;
48
52
  }
49
53
  export interface OnNavigationResult {
50
- navigation: Navigation;
54
+ navigation?: Navigation;
51
55
  error?: Error;
52
56
  }
53
- export type NavigateToPoiType = {
54
- navigationTo: number;
55
- type?: string;
57
+ export type NavigateToPoiPayload = {
58
+ identifier: number;
59
+ accessibilityMode?: AccessibilityMode;
60
+ };
61
+ export type NavigateToPointPayload = {
62
+ lat: number;
63
+ lng: number;
64
+ floorIdentifier: string;
65
+ navigationName?: string;
66
+ accessibilityMode?: AccessibilityMode;
67
+ };
68
+ export type DirectionsMessage = {
69
+ buildingIdentifier: string;
70
+ originIdentifier: string;
71
+ originCategory: string;
72
+ destinationIdentifier: string;
73
+ destinationCategory: string;
74
+ identifier: string;
56
75
  };
57
76
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/wayfinding/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,aAAa,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,E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,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
@@ -1,18 +1,23 @@
1
- import type { Directions, Location, SDKNavigation } from "../../sdk/types";
2
- import type { NavigateToPoiType, Navigation } from "../types";
3
- declare const Mapper: {
1
+ import type { Directions, DirectionsRequest, Location, NavigationProgress, NavigationRequest, Point } from "../../sdk/types";
2
+ import type { DirectionsMessage, NavigateToPointPayload, NavigateToPoiPayload, Navigation, OnNavigationResult } from "../types";
3
+ export declare const createPoint: (payload: any) => Point;
4
+ export declare const createDirectionsMessage: (payload: any) => DirectionsMessage;
5
+ export declare const createDirectionsRequest: (payload: any) => DirectionsRequest;
6
+ export declare const createNavigationRequest: (payload: any) => NavigationRequest;
7
+ declare const ViewerMapper: {
8
+ followUser: (follow: boolean) => string;
9
+ setLanguage: (lang: string) => string;
10
+ initialConfiguration: (style: any) => string;
11
+ selectPoi: (poiId: number | null) => string;
4
12
  location: (location: Location) => string;
5
13
  locationStatus: (locationStatus: Location["status"]) => string;
6
14
  route: (directions: Directions) => string;
15
+ routeToResult: (route: any) => OnNavigationResult;
7
16
  navigation: (navigation: Navigation) => string;
8
- navigateToPoi: (navigate: NavigateToPoiType) => string;
17
+ navigateToPoi: (navigate: NavigateToPoiPayload) => string;
18
+ navigateToPoint: ({ lat, lng, floorIdentifier, navigationName, accessibilityMode, }: NavigateToPointPayload) => string;
9
19
  cancelNavigation: () => string;
10
- selectPoi: (poiId: number | null) => string;
11
- followUser: (follow: boolean) => string;
12
- setLanguage: (lang: string) => string;
13
- initialConfiguration: (style: any, enablePoiClustering: any, showPoiNames: any, minZoom: any, maxZoom: any, initialZoom: any, useDashboardTheme: any) => string;
14
- routeToResult: (navigation: any) => Navigation;
15
- navigationToResult: (navigation: SDKNavigation) => Navigation;
20
+ navigationToResult: (navigation: NavigationProgress) => OnNavigationResult;
16
21
  };
17
- export default Mapper;
22
+ export default ViewerMapper;
18
23
  //# sourceMappingURL=mapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../../../src/wayfinding/utils/mapper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,UAAU,EACV,QAAQ,EACR,aAAa,EACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAe,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,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1
  {
2
2
  "name": "@situm/react-native",
3
- "version": "3.0.8",
3
+ "version": "3.1.0-beta.0",
4
4
  "description": "Set of utilities that allow any developer to build React Native location based apps using Situm's indoor positioning system.",
5
5
  "private": false,
6
6
  "repository": "https://github.com/situmtech/react-native",
@@ -74,7 +74,7 @@
74
74
  "@commitlint/config-conventional": "^17.6.7",
75
75
  "@evilmartians/lefthook": "^1.2.20.7.7",
76
76
  "@react-native-community/eslint-config": "^3.2.0",
77
- "@types/jest": "^29.5.2",
77
+ "@types/jest": "^29.5.3",
78
78
  "@types/react": "^18.2.7",
79
79
  "@types/react-native": "0.72.2",
80
80
  "@types/react-test-renderer": "^18.0.0",