@situm/react-native 3.15.0-beta.4 → 3.15.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/lib/commonjs/index.js +72 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/sdk/index.js +930 -0
- package/lib/commonjs/sdk/index.js.map +1 -1
- package/lib/commonjs/sdk/internaDelegatedState.js +48 -0
- package/lib/commonjs/sdk/internaDelegatedState.js.map +1 -0
- package/lib/commonjs/sdk/nativeInterface.js +20 -0
- package/lib/commonjs/sdk/nativeInterface.js.map +1 -0
- package/lib/commonjs/sdk/types/constants.js +73 -0
- package/lib/commonjs/sdk/types/index.js +414 -0
- package/lib/commonjs/sdk/types/index.js.map +1 -0
- package/lib/commonjs/sdk/utils.js +156 -0
- package/lib/commonjs/sdk/utils.js.map +1 -0
- package/lib/commonjs/utils/index.js +17 -0
- package/lib/commonjs/utils/logError.js +21 -0
- package/lib/commonjs/utils/logError.js.map +1 -0
- package/lib/commonjs/wayfinding/components/MapView.js +388 -0
- package/lib/commonjs/wayfinding/components/MapView.js.map +1 -0
- package/lib/commonjs/wayfinding/hooks/index.js +233 -0
- package/lib/commonjs/wayfinding/hooks/index.js.map +1 -0
- package/lib/commonjs/wayfinding/index.js +57 -0
- package/lib/commonjs/wayfinding/store/index.js +246 -0
- package/lib/commonjs/wayfinding/store/index.js.map +1 -0
- package/lib/commonjs/wayfinding/store/utils.js +49 -0
- package/lib/commonjs/wayfinding/types/constants.js +13 -0
- package/lib/commonjs/wayfinding/types/index.js +6 -0
- package/lib/commonjs/wayfinding/types/index.js.map +1 -0
- package/lib/commonjs/wayfinding/utils/index.js +12 -0
- package/lib/commonjs/wayfinding/utils/mapper.js +204 -0
- package/lib/commonjs/wayfinding/utils/mapper.js.map +1 -0
- package/lib/module/index.js +14 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/sdk/index.js +904 -0
- package/lib/module/sdk/index.js.map +1 -1
- package/lib/module/sdk/internaDelegatedState.js +43 -0
- package/lib/module/sdk/internaDelegatedState.js.map +1 -0
- package/lib/module/sdk/nativeInterface.js +20 -0
- package/lib/module/sdk/nativeInterface.js.map +1 -0
- package/lib/module/sdk/types/constants.js +70 -0
- package/lib/module/sdk/types/index.js +445 -0
- package/lib/module/sdk/types/index.js.map +1 -0
- package/lib/module/sdk/utils.js +146 -0
- package/lib/module/sdk/utils.js.map +1 -0
- package/lib/module/utils/index.js +4 -0
- package/lib/module/utils/logError.js +17 -0
- package/lib/module/utils/logError.js.map +1 -0
- package/lib/module/wayfinding/components/MapView.js +381 -0
- package/lib/module/wayfinding/components/MapView.js.map +1 -0
- package/lib/module/wayfinding/hooks/index.js +226 -0
- package/lib/module/wayfinding/hooks/index.js.map +1 -0
- package/lib/module/wayfinding/index.js +15 -0
- package/lib/module/wayfinding/store/index.js +213 -0
- package/lib/module/wayfinding/store/index.js.map +1 -0
- package/lib/module/wayfinding/store/utils.js +40 -0
- package/lib/module/wayfinding/types/constants.js +9 -0
- package/lib/module/wayfinding/types/index.js +4 -0
- package/lib/module/wayfinding/types/index.js.map +1 -0
- package/lib/module/wayfinding/utils/index.js +7 -0
- package/lib/module/wayfinding/utils/index.js.map +1 -0
- package/lib/module/wayfinding/utils/mapper.js +195 -0
- package/lib/module/wayfinding/utils/mapper.js.map +1 -0
- package/lib/typescript/sdk/index.d.ts +2 -2
- package/lib/typescript/sdk/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/sdk/index.ts +12 -3
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
import React, { createContext, useReducer } from "react";
|
|
5
|
+
import { useSitumInternal } from "../hooks";
|
|
6
|
+
import { createStore } from "./utils";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export const initialState = {
|
|
9
|
+
webViewRef: undefined,
|
|
10
|
+
sdkInitialized: false,
|
|
11
|
+
user: undefined,
|
|
12
|
+
location: undefined,
|
|
13
|
+
locationStatus: undefined,
|
|
14
|
+
buildings: null,
|
|
15
|
+
currentBuilding: undefined,
|
|
16
|
+
pois: [],
|
|
17
|
+
directions: undefined,
|
|
18
|
+
navigation: undefined,
|
|
19
|
+
destinationPoiID: undefined,
|
|
20
|
+
error: undefined,
|
|
21
|
+
buildingIdentifier: "-1"
|
|
22
|
+
};
|
|
23
|
+
export const SitumContext = /*#__PURE__*/createContext(undefined);
|
|
24
|
+
const store = createStore({
|
|
25
|
+
initialState,
|
|
26
|
+
reducers: {
|
|
27
|
+
setWebViewRef: (state, payload) => {
|
|
28
|
+
return {
|
|
29
|
+
...state,
|
|
30
|
+
webViewRef: payload
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
setSdkInitialized: (state, payload) => {
|
|
34
|
+
return {
|
|
35
|
+
...state,
|
|
36
|
+
sdkInitialized: payload
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
setAuth: (state, payload) => {
|
|
40
|
+
return {
|
|
41
|
+
...state,
|
|
42
|
+
user: payload
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
setLocation: (state, payload) => {
|
|
46
|
+
return {
|
|
47
|
+
...state,
|
|
48
|
+
location: payload
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
setLocationStatus: (state, payload) => {
|
|
52
|
+
return {
|
|
53
|
+
...state,
|
|
54
|
+
locationStatus: payload
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
resetLocation: state => {
|
|
58
|
+
return {
|
|
59
|
+
...state,
|
|
60
|
+
location: initialState.location
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
setBuildings: (state, payload) => {
|
|
64
|
+
return {
|
|
65
|
+
...state,
|
|
66
|
+
buildings: payload
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
setCurrentBuilding: (state, payload) => {
|
|
70
|
+
return {
|
|
71
|
+
...state,
|
|
72
|
+
currentBuilding: payload
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
setPois: (state, payload) => {
|
|
76
|
+
return {
|
|
77
|
+
...state,
|
|
78
|
+
pois: payload
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
setDirections: (state, payload) => {
|
|
82
|
+
return {
|
|
83
|
+
...state,
|
|
84
|
+
directions: payload
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
setNavigation: (state, payload) => {
|
|
88
|
+
return {
|
|
89
|
+
...state,
|
|
90
|
+
navigation: payload
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
setDestinationPoiID: (state, payload) => {
|
|
94
|
+
return {
|
|
95
|
+
...state,
|
|
96
|
+
destinationPoiID: payload
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
setError: (state, payload) => {
|
|
100
|
+
return {
|
|
101
|
+
...state,
|
|
102
|
+
error: payload
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
setBuildingIdentifier: (state, payload) => {
|
|
106
|
+
return {
|
|
107
|
+
...state,
|
|
108
|
+
buildingIdentifier: payload
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
export const selectWebViewRef = state => {
|
|
114
|
+
return state.webViewRef;
|
|
115
|
+
};
|
|
116
|
+
export const selectIsSDKInitialized = state => {
|
|
117
|
+
return state.sdkInitialized;
|
|
118
|
+
};
|
|
119
|
+
export const selectUser = state => {
|
|
120
|
+
return state.user;
|
|
121
|
+
};
|
|
122
|
+
export const selectLocation = state => {
|
|
123
|
+
return state.location;
|
|
124
|
+
};
|
|
125
|
+
export const selectLocationStatus = state => {
|
|
126
|
+
return state.locationStatus;
|
|
127
|
+
};
|
|
128
|
+
export const selectBuildings = state => {
|
|
129
|
+
return state.buildings;
|
|
130
|
+
};
|
|
131
|
+
export const selectCurrentBuilding = state => {
|
|
132
|
+
return state.currentBuilding;
|
|
133
|
+
};
|
|
134
|
+
export const selectPois = state => {
|
|
135
|
+
return state.pois;
|
|
136
|
+
};
|
|
137
|
+
export const selectDirections = state => {
|
|
138
|
+
return state.directions;
|
|
139
|
+
};
|
|
140
|
+
export const selectNavigation = state => {
|
|
141
|
+
return state.navigation;
|
|
142
|
+
};
|
|
143
|
+
export const selectDestinationPoiID = state => {
|
|
144
|
+
return state.destinationPoiID;
|
|
145
|
+
};
|
|
146
|
+
export const selectError = state => {
|
|
147
|
+
return state.error;
|
|
148
|
+
};
|
|
149
|
+
export const selectBuildingIdentifier = state => {
|
|
150
|
+
return state.buildingIdentifier;
|
|
151
|
+
};
|
|
152
|
+
export const {
|
|
153
|
+
setWebViewRef,
|
|
154
|
+
setSdkInitialized,
|
|
155
|
+
setAuth,
|
|
156
|
+
setLocation,
|
|
157
|
+
setLocationStatus,
|
|
158
|
+
resetLocation,
|
|
159
|
+
setBuildings,
|
|
160
|
+
setCurrentBuilding,
|
|
161
|
+
setPois,
|
|
162
|
+
setDirections,
|
|
163
|
+
setNavigation,
|
|
164
|
+
setDestinationPoiID,
|
|
165
|
+
setError,
|
|
166
|
+
setBuildingIdentifier
|
|
167
|
+
} = store.actions;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Context specifically to store the only instance of our hook.
|
|
171
|
+
*/
|
|
172
|
+
export const UseSitumContext = /*#__PURE__*/createContext(undefined);
|
|
173
|
+
const UseSitumProvider = ({
|
|
174
|
+
children
|
|
175
|
+
}) => {
|
|
176
|
+
// TODO: if we have this, there is no need to have a context for the rest of the state
|
|
177
|
+
// as there is only one instance of the hook
|
|
178
|
+
const useSitum = useSitumInternal();
|
|
179
|
+
return /*#__PURE__*/_jsx(UseSitumContext.Provider, {
|
|
180
|
+
value: {
|
|
181
|
+
useSitum
|
|
182
|
+
},
|
|
183
|
+
children: children
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Main context of the application, stores the plugins' state.
|
|
189
|
+
*/
|
|
190
|
+
const SitumProvider = ({
|
|
191
|
+
email,
|
|
192
|
+
apiKey,
|
|
193
|
+
children
|
|
194
|
+
}) => {
|
|
195
|
+
const [state, dispatch] = useReducer(store.reducer, {
|
|
196
|
+
...store.initialState,
|
|
197
|
+
user: {
|
|
198
|
+
email,
|
|
199
|
+
apiKey
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
return /*#__PURE__*/_jsx(SitumContext.Provider, {
|
|
203
|
+
value: {
|
|
204
|
+
state,
|
|
205
|
+
dispatch
|
|
206
|
+
},
|
|
207
|
+
children: /*#__PURE__*/_jsx(UseSitumProvider, {
|
|
208
|
+
children: children
|
|
209
|
+
})
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
export default SitumProvider;
|
|
213
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","createContext","useReducer","useSitumInternal","createStore","jsx","_jsx","initialState","webViewRef","undefined","sdkInitialized","user","location","locationStatus","buildings","currentBuilding","pois","directions","navigation","destinationPoiID","error","buildingIdentifier","SitumContext","store","reducers","setWebViewRef","state","payload","setSdkInitialized","setAuth","setLocation","setLocationStatus","resetLocation","setBuildings","setCurrentBuilding","setPois","setDirections","setNavigation","setDestinationPoiID","setError","setBuildingIdentifier","selectWebViewRef","selectIsSDKInitialized","selectUser","selectLocation","selectLocationStatus","selectBuildings","selectCurrentBuilding","selectPois","selectDirections","selectNavigation","selectDestinationPoiID","selectError","selectBuildingIdentifier","actions","UseSitumContext","UseSitumProvider","children","useSitum","Provider","value","SitumProvider","email","apiKey","dispatch","reducer"],"sourceRoot":"../../../../src","sources":["wayfinding/store/index.tsx"],"mappings":";;AAAA;AACA,OAAOA,KAAK,IAAIC,aAAa,EAAyBC,UAAU,QAAQ,OAAO;AAW/E,SAASC,gBAAgB,QAAQ,UAAU;AAC3C,SAASC,WAAW,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAuBt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,aAAa;EACbC,aAAa;EACbC,mBAAmB;EACnBC,QAAQ;EACRC;AACF,CAAC,GAAGjB,KAAK,CAAC+B,OAAO;;AAEjB;AACA;AACA;AACA,OAAO,MAAMC,eAAe,gBAAGtD,aAAa,CAC1CQ,SACF,CAAC;AAED,MAAM+C,gBAAyD,GAAGA,CAAC;EACjEC;AACF,CAAC,KAAK;EACJ;EACA;EACA,MAAMC,QAAQ,GAAGvD,gBAAgB,CAAC,CAAC;EAEnC,oBACEG,IAAA,CAACiD,eAAe,CAACI,QAAQ;IAACC,KAAK,EAAE;MAAEF;IAAS,CAAE;IAAAD,QAAA,EAC3CA;EAAQ,CACe,CAAC;AAE/B,CAAC;;AAED;AACA;AACA;AACA,MAAMI,aAKL,GAAGA,CAAC;EAAEC,KAAK;EAAEC,MAAM;EAAEN;AAAS,CAAC,KAAK;EACnC,MAAM,CAAC/B,KAAK,EAAEsC,QAAQ,CAAC,GAAG9D,UAAU,CAACqB,KAAK,CAAC0C,OAAO,EAAE;IAClD,GAAG1C,KAAK,CAAChB,YAAY;IACrBI,IAAI,EAAE;MAAEmD,KAAK;MAAEC;IAAO;EACxB,CAAC,CAAC;EAEF,oBACEzD,IAAA,CAACgB,YAAY,CAACqC,QAAQ;IACpBC,KAAK,EAAE;MACLlC,KAAK;MACLsC;IACF,CAAE;IAAAP,QAAA,eAEFnD,IAAA,CAACkD,gBAAgB;MAAAC,QAAA,EAAEA;IAAQ,CAAmB;EAAC,CAC1B,CAAC;AAE5B,CAAC;AAED,eAAeI,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
import { useContext } from "react";
|
|
5
|
+
import { SitumContext } from "./index";
|
|
6
|
+
export const createReducer = () => {
|
|
7
|
+
const reducer = (state, action) => {
|
|
8
|
+
return action(state);
|
|
9
|
+
};
|
|
10
|
+
return reducer;
|
|
11
|
+
};
|
|
12
|
+
export const createStore = ({
|
|
13
|
+
initialState,
|
|
14
|
+
reducers
|
|
15
|
+
}) => {
|
|
16
|
+
const actions = Object.keys(reducers).reduce((acc, r) => {
|
|
17
|
+
acc[r] = payload => state => reducers[r](state, payload);
|
|
18
|
+
return acc;
|
|
19
|
+
}, {});
|
|
20
|
+
return {
|
|
21
|
+
initialState,
|
|
22
|
+
actions,
|
|
23
|
+
reducer: createReducer()
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export const useSelector = selector => {
|
|
27
|
+
const context = useContext(SitumContext);
|
|
28
|
+
if (!context) {
|
|
29
|
+
throw new Error("No SitumProvider found.");
|
|
30
|
+
}
|
|
31
|
+
return selector(context.state);
|
|
32
|
+
};
|
|
33
|
+
export const useDispatch = () => {
|
|
34
|
+
const context = useContext(SitumContext);
|
|
35
|
+
if (!context) {
|
|
36
|
+
throw new Error("No SitumProvider found.");
|
|
37
|
+
}
|
|
38
|
+
return context.dispatch;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Define class that handles errors
|
|
4
|
+
export let ErrorName = /*#__PURE__*/function (ErrorName) {
|
|
5
|
+
ErrorName["ERR_INTERNET_DISCONNECTED"] = "ERR_INTERNET_DISCONNECTED";
|
|
6
|
+
ErrorName["ERR_INTERNAL_SERVER_ERROR"] = "ERR_INTERNAL_SERVER_ERROR";
|
|
7
|
+
return ErrorName;
|
|
8
|
+
}({});
|
|
9
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["wayfinding/types/index.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["sendMessageToViewer","viewer","message","injectJavaScript"],"sourceRoot":"../../../../src","sources":["wayfinding/utils/index.ts"],"mappings":";;AAEA,OAAO,MAAMA,mBAAmB,GAAGA,CAACC,MAAsB,EAAEC,OAAe,KAAK;EAC9E,IAAI,CAACD,MAAM,EAAE;EACbA,MAAM,CAACE,gBAAgB,CAAC,sBAAsBD,OAAO,GAAG,CAAC;AAC3D,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
import { AccessibilityMode } from "../../sdk";
|
|
5
|
+
export const createPoint = payload => {
|
|
6
|
+
return {
|
|
7
|
+
buildingIdentifier: payload.buildingIdentifier,
|
|
8
|
+
floorIdentifier: payload.floorIdentifier,
|
|
9
|
+
cartesianCoordinate: payload.cartesianCoordinate,
|
|
10
|
+
coordinate: payload.coordinate
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export const createDirectionsMessage = payload => {
|
|
14
|
+
return {
|
|
15
|
+
buildingIdentifier: payload.buildingIdentifier,
|
|
16
|
+
originIdentifier: (payload.originIdentifier || -1).toString(),
|
|
17
|
+
originCategory: payload.originCategory,
|
|
18
|
+
destinationIdentifier: (payload.destinationIdentifier || -1).toString(),
|
|
19
|
+
destinationCategory: payload.destinationCategory,
|
|
20
|
+
identifier: (payload.identifier || "").toString()
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export const createDirectionsRequest = payload => {
|
|
24
|
+
return {
|
|
25
|
+
buildingIdentifier: payload.from.buildingIdentifier,
|
|
26
|
+
to: createPoint(payload.to),
|
|
27
|
+
from: createPoint(payload.from),
|
|
28
|
+
bearingFrom: payload.bearingFrom?.radians || 0,
|
|
29
|
+
accessibilityMode: payload.accessibilityMode || AccessibilityMode.CHOOSE_SHORTEST,
|
|
30
|
+
minimizeFloorChanges: payload.minimizeFloorChanges || false,
|
|
31
|
+
includedTags: payload.includedTags || [],
|
|
32
|
+
excludedTags: payload.excludedTags || []
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export const createNavigationRequest = payload => {
|
|
36
|
+
const navigationRequest = {
|
|
37
|
+
distanceToGoalThreshold: payload.distanceToGoalThreshold,
|
|
38
|
+
outsideRouteThreshold: payload.outsideRouteThreshold,
|
|
39
|
+
distanceToIgnoreFirstIndication: payload.distanceToIgnoreFirstIndication,
|
|
40
|
+
distanceToFloorChangeThreshold: payload.distanceToFloorChangeThreshold,
|
|
41
|
+
distanceToChangeIndicationThreshold: payload.distanceToChangeIndicationThreshold,
|
|
42
|
+
indicationsInterval: payload.indicationsInterval,
|
|
43
|
+
timeToFirstIndication: payload.timeToFirstIndication,
|
|
44
|
+
roundIndicationsStep: payload.roundIndicationsStep,
|
|
45
|
+
timeToIgnoreUnexpectedFloorChanges: payload.timeToIgnoreUnexpectedFloorChanges,
|
|
46
|
+
ignoreLowQualityLocations: payload.ignoreLowQualityLocations
|
|
47
|
+
};
|
|
48
|
+
return Object.fromEntries(Object.entries(navigationRequest || {}).filter(([_, value]) => value !== undefined));
|
|
49
|
+
};
|
|
50
|
+
const mapperWrapper = (type, payload) => {
|
|
51
|
+
return JSON.stringify({
|
|
52
|
+
type,
|
|
53
|
+
payload: payload ?? {}
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
const ViewerMapper = {
|
|
57
|
+
// Configuration
|
|
58
|
+
followUser: follow => {
|
|
59
|
+
return mapperWrapper("camera.follow_user", {
|
|
60
|
+
value: follow
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
setLanguage: lang => {
|
|
64
|
+
return mapperWrapper("ui.set_language", lang);
|
|
65
|
+
},
|
|
66
|
+
setFavoritePois: poiIds => {
|
|
67
|
+
return mapperWrapper("ui.set_favorite_pois", poiIds);
|
|
68
|
+
},
|
|
69
|
+
initialConfiguration: style => {
|
|
70
|
+
return mapperWrapper("ui.initial_configuration", {
|
|
71
|
+
...(style && {
|
|
72
|
+
style: style
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
// Cartography
|
|
77
|
+
selectPoi: poiId => {
|
|
78
|
+
return mapperWrapper(`cartography.select_poi`, {
|
|
79
|
+
identifier: poiId
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
selectCar: () => {
|
|
83
|
+
return mapperWrapper(`cartography.select_car`);
|
|
84
|
+
},
|
|
85
|
+
selectPoiCategory: categoryId => {
|
|
86
|
+
return mapperWrapper(`cartography.select_poi_category`, {
|
|
87
|
+
identifier: categoryId
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
selectFloor: (floorIdentifier, options) => {
|
|
91
|
+
return mapperWrapper(`cartography.select_floor`, {
|
|
92
|
+
identifier: floorIdentifier,
|
|
93
|
+
options
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
setDirectionsOptions: directionsOptions => {
|
|
97
|
+
return mapperWrapper(`directions.set_options`, {
|
|
98
|
+
includedTags: directionsOptions.includedTags,
|
|
99
|
+
excludedTags: directionsOptions.excludedTags
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
// Location
|
|
103
|
+
location: location => {
|
|
104
|
+
return mapperWrapper("location.update", {
|
|
105
|
+
...(location.position && {
|
|
106
|
+
latitude: location.position.coordinate.latitude,
|
|
107
|
+
longitude: location.position.coordinate.longitude,
|
|
108
|
+
x: location.position.cartesianCoordinate.x,
|
|
109
|
+
y: location.position.cartesianCoordinate.y,
|
|
110
|
+
buildingId: location.position.buildingIdentifier,
|
|
111
|
+
floorId: location.position.floorIdentifier,
|
|
112
|
+
bearing: location.bearing?.degreesClockwise,
|
|
113
|
+
isIndoor: location.position.isIndoor,
|
|
114
|
+
isOutdoor: location.position.isOutdoor,
|
|
115
|
+
accuracy: location.accuracy,
|
|
116
|
+
hasBearing: location.hasBearing
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
},
|
|
120
|
+
locationStatus: locationStatus => {
|
|
121
|
+
return mapperWrapper("location.update_status", {
|
|
122
|
+
status: locationStatus
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
locationError: errorCode => {
|
|
126
|
+
return mapperWrapper("location.update_status", {
|
|
127
|
+
status: errorCode
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
// Directions
|
|
131
|
+
route: directions => {
|
|
132
|
+
return mapperWrapper("directions.update", directions);
|
|
133
|
+
},
|
|
134
|
+
routeToResult: route => {
|
|
135
|
+
return {
|
|
136
|
+
navigation: {
|
|
137
|
+
status: route.status,
|
|
138
|
+
destination: {
|
|
139
|
+
category: route?.destinationId ? "POI" : "COORDINATE",
|
|
140
|
+
identifier: route?.destinationId,
|
|
141
|
+
//name:, //TODO
|
|
142
|
+
point: route.to ? createPoint(route.to) : createPoint(route.TO)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
},
|
|
147
|
+
// Navigation
|
|
148
|
+
navigation: navigation => {
|
|
149
|
+
return mapperWrapper(`navigation.${navigation.status}`, navigation);
|
|
150
|
+
},
|
|
151
|
+
navigateToPoi: navigate => {
|
|
152
|
+
return mapperWrapper(`navigation.start`, {
|
|
153
|
+
navigationTo: navigate?.identifier,
|
|
154
|
+
type: navigate.accessibilityMode
|
|
155
|
+
});
|
|
156
|
+
},
|
|
157
|
+
navigateToCar: params => {
|
|
158
|
+
return mapperWrapper(`navigation.start.to_car`, {
|
|
159
|
+
type: params?.accessibilityMode
|
|
160
|
+
});
|
|
161
|
+
},
|
|
162
|
+
navigateToPoint: ({
|
|
163
|
+
lat,
|
|
164
|
+
lng,
|
|
165
|
+
floorIdentifier,
|
|
166
|
+
navigationName,
|
|
167
|
+
accessibilityMode
|
|
168
|
+
}) => {
|
|
169
|
+
return mapperWrapper(`navigation.start`, {
|
|
170
|
+
lat,
|
|
171
|
+
lng,
|
|
172
|
+
floorIdentifier,
|
|
173
|
+
navigationName,
|
|
174
|
+
type: accessibilityMode
|
|
175
|
+
});
|
|
176
|
+
},
|
|
177
|
+
cancelNavigation: () => {
|
|
178
|
+
return mapperWrapper(`navigation.cancel`, {});
|
|
179
|
+
},
|
|
180
|
+
navigationToResult: navigation => {
|
|
181
|
+
return {
|
|
182
|
+
navigation: {
|
|
183
|
+
status: navigation?.type
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
search: searchFilter => {
|
|
188
|
+
return mapperWrapper(`ui.set_search_filter`, {
|
|
189
|
+
text: searchFilter.text,
|
|
190
|
+
poiCategoryIdentifier: searchFilter.poiCategoryIdentifier
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
export default ViewerMapper;
|
|
195
|
+
//# sourceMappingURL=mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AccessibilityMode","createPoint","payload","buildingIdentifier","floorIdentifier","cartesianCoordinate","coordinate","createDirectionsMessage","originIdentifier","toString","originCategory","destinationIdentifier","destinationCategory","identifier","createDirectionsRequest","from","to","bearingFrom","radians","accessibilityMode","CHOOSE_SHORTEST","minimizeFloorChanges","includedTags","excludedTags","createNavigationRequest","navigationRequest","distanceToGoalThreshold","outsideRouteThreshold","distanceToIgnoreFirstIndication","distanceToFloorChangeThreshold","distanceToChangeIndicationThreshold","indicationsInterval","timeToFirstIndication","roundIndicationsStep","timeToIgnoreUnexpectedFloorChanges","ignoreLowQualityLocations","Object","fromEntries","entries","filter","_","value","undefined","mapperWrapper","type","JSON","stringify","ViewerMapper","followUser","follow","setLanguage","lang","setFavoritePois","poiIds","initialConfiguration","style","selectPoi","poiId","selectCar","selectPoiCategory","categoryId","selectFloor","options","setDirectionsOptions","directionsOptions","location","position","latitude","longitude","x","y","buildingId","floorId","bearing","degreesClockwise","isIndoor","isOutdoor","accuracy","hasBearing","locationStatus","status","locationError","errorCode","route","directions","routeToResult","navigation","destination","category","destinationId","point","TO","navigateToPoi","navigate","navigationTo","navigateToCar","params","navigateToPoint","lat","lng","navigationName","cancelNavigation","navigationToResult","search","searchFilter","text","poiCategoryIdentifier"],"sourceRoot":"../../../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AAY","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Building, type BuildingInfo, type ConfigurationOptions, type DirectionsOptions, type Error, type Floor, type Geofence, InternalCall, type Location, type LocationRequest, type LocationStatus, type NavigationProgress, type NavigationRequest, type Poi, type PoiCategory, type PoiIcon, type Point, type Route, type UserHelperOptions } from "./types";
|
|
1
|
+
import { type Building, type BuildingInfo, type ConfigurationOptions, type DirectionsOptions, type Error, type Floor, type Geofence, InternalCall, type Location, type LocationRequest, type LocationStatus, type NavigationProgress, type NavigationRequest, type Poi, type PoiCategory, type PoiIcon, type Point, type Route, type SdkVersion, type UserHelperOptions } from "./types";
|
|
2
2
|
export * from "./types";
|
|
3
3
|
export * from "./types/constants";
|
|
4
4
|
export default class SitumPlugin {
|
|
@@ -100,7 +100,7 @@ export default class SitumPlugin {
|
|
|
100
100
|
* @returns void
|
|
101
101
|
* @throw Exception
|
|
102
102
|
*/
|
|
103
|
-
static sdkVersion: () =>
|
|
103
|
+
static sdkVersion: () => SdkVersion | undefined;
|
|
104
104
|
/**
|
|
105
105
|
* Returns the device identifier that has generated the location
|
|
106
106
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAEzB,KAAK,iBAAiB,EACtB,KAAK,KAAK,EAGV,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,YAAY,EACZ,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,KAAK,E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I,UAGhD;IAEF;;;;OAIG;IACH,MAAM,CAAC,8BAA8B,GACnC,UAAU,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,UAGhC;IAEF;;;;OAIG;IACH,MAAM,CAAC,sBAAsB,GAAI,UAAU,MAAM,IAAI,UAEnD;IAEF;;;;;;;;OAQG;IACH,MAAM,CAAC,oBAAoB,GAAI,UAAU,MAAM,IAAI,UAEjD;IAEF;;;;OAIG;IACH,MAAM,CAAC,wBAAwB,GAAI,UAAU,MAAM,IAAI,UAErD;IAEF;;;;OAIG;IACH,MAAM,CAAC,iBAAiB,GAAI,UAAU,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,UAExD;CACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@situm/react-native",
|
|
3
|
-
"version": "3.15.0
|
|
3
|
+
"version": "3.15.0",
|
|
4
4
|
"description": "Situm Wayfinding for React Native. Integrate plug&play navigation experience with indoor maps, routes and turn-by-turn directions in no time. With the power of Situm.",
|
|
5
5
|
"repository": "https://github.com/situmtech/react-native",
|
|
6
6
|
"author": "Situm Technologies <mobile@situm.com>",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
},
|
|
15
15
|
"main": "lib/commonjs/index",
|
|
16
16
|
"module": "lib/module/index",
|
|
17
|
-
"types": "lib/typescript/
|
|
17
|
+
"types": "lib/typescript/index.d.ts",
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
-
"types": "./lib/typescript/
|
|
20
|
+
"types": "./lib/typescript/index.d.ts",
|
|
21
21
|
"default": "./lib/module/index.js"
|
|
22
22
|
},
|
|
23
23
|
"./package.json": "./package.json"
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"lib/"
|
|
157
157
|
],
|
|
158
158
|
"sdkVersions": {
|
|
159
|
-
"android": "3.
|
|
160
|
-
"ios": "3.
|
|
159
|
+
"android": "3.30.0@aar",
|
|
160
|
+
"ios": "3.32.1"
|
|
161
161
|
}
|
|
162
162
|
}
|
package/src/sdk/index.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { NativeEventEmitter, NativeModules, Platform } from "react-native";
|
|
5
5
|
|
|
6
6
|
import { logError } from "../utils/logError";
|
|
7
|
+
import { DelegatedStateManager } from "./internaDelegatedState";
|
|
7
8
|
import type { SitumPluginInterface } from "./nativeInterface";
|
|
8
9
|
import {
|
|
9
10
|
type Building,
|
|
@@ -37,7 +38,6 @@ import {
|
|
|
37
38
|
locationStatusAdapter,
|
|
38
39
|
promiseWrapper,
|
|
39
40
|
} from "./utils";
|
|
40
|
-
import { DelegatedStateManager } from "./internaDelegatedState";
|
|
41
41
|
|
|
42
42
|
export * from "./types";
|
|
43
43
|
export * from "./types/constants";
|
|
@@ -399,7 +399,15 @@ export default class SitumPlugin {
|
|
|
399
399
|
* @throw Exception
|
|
400
400
|
*/
|
|
401
401
|
static sdkVersion = () => {
|
|
402
|
-
return
|
|
402
|
+
return exceptionWrapper<SdkVersion>(({ onSuccess }) => {
|
|
403
|
+
const versions: { react_native: string; ios?: string; android?: string } =
|
|
404
|
+
{
|
|
405
|
+
react_native: "",
|
|
406
|
+
ios: "",
|
|
407
|
+
android: "",
|
|
408
|
+
};
|
|
409
|
+
onSuccess(versions);
|
|
410
|
+
});
|
|
403
411
|
};
|
|
404
412
|
|
|
405
413
|
/**
|
|
@@ -693,7 +701,8 @@ export default class SitumPlugin {
|
|
|
693
701
|
request: any,
|
|
694
702
|
callback?: (response: { isInsideGeofence: boolean; geofence: any }) => void,
|
|
695
703
|
) => {
|
|
696
|
-
|
|
704
|
+
const noop = () => {}; // eslint-disable-line @typescript-eslint/no-empty-function
|
|
705
|
+
RNCSitumPlugin.checkIfPointInsideGeofence(request, callback || noop);
|
|
697
706
|
};
|
|
698
707
|
|
|
699
708
|
/**
|