@situm/react-native 3.15.0-beta.3 → 3.15.0-beta.4

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 (65) hide show
  1. package/lib/commonjs/index.js.map +0 -1
  2. package/lib/commonjs/sdk/index.js.map +1 -1
  3. package/lib/commonjs/sdk/internaDelegatedState.js.map +0 -1
  4. package/lib/commonjs/sdk/nativeInterface.js.map +0 -1
  5. package/lib/commonjs/sdk/types/index.js.map +0 -1
  6. package/lib/commonjs/sdk/utils.js.map +0 -1
  7. package/lib/commonjs/utils/logError.js.map +0 -1
  8. package/lib/commonjs/wayfinding/types/index.js.map +0 -1
  9. package/lib/commonjs/wayfinding/utils/mapper.js.map +0 -1
  10. package/lib/module/index.js.map +0 -1
  11. package/lib/module/sdk/index.js.map +1 -1
  12. package/lib/module/sdk/internaDelegatedState.js.map +0 -1
  13. package/lib/module/sdk/nativeInterface.js.map +0 -1
  14. package/lib/module/sdk/types/index.js.map +0 -1
  15. package/lib/module/sdk/utils.js.map +0 -1
  16. package/lib/module/utils/logError.js.map +0 -1
  17. package/lib/module/wayfinding/types/index.js.map +0 -1
  18. package/lib/module/wayfinding/utils/index.js.map +0 -1
  19. package/lib/typescript/sdk/index.d.ts +5 -2
  20. package/lib/typescript/sdk/index.d.ts.map +1 -1
  21. package/package.json +3 -3
  22. package/src/sdk/index.ts +4 -14
  23. package/lib/commonjs/index.js +0 -73
  24. package/lib/commonjs/sdk/index.js +0 -931
  25. package/lib/commonjs/sdk/internaDelegatedState.js +0 -48
  26. package/lib/commonjs/sdk/nativeInterface.js +0 -20
  27. package/lib/commonjs/sdk/types/constants.js +0 -73
  28. package/lib/commonjs/sdk/types/index.js +0 -414
  29. package/lib/commonjs/sdk/utils.js +0 -156
  30. package/lib/commonjs/utils/index.js +0 -17
  31. package/lib/commonjs/utils/logError.js +0 -21
  32. package/lib/commonjs/wayfinding/components/MapView.js +0 -389
  33. package/lib/commonjs/wayfinding/components/MapView.js.map +0 -1
  34. package/lib/commonjs/wayfinding/hooks/index.js +0 -233
  35. package/lib/commonjs/wayfinding/hooks/index.js.map +0 -1
  36. package/lib/commonjs/wayfinding/index.js +0 -57
  37. package/lib/commonjs/wayfinding/store/index.js +0 -247
  38. package/lib/commonjs/wayfinding/store/index.js.map +0 -1
  39. package/lib/commonjs/wayfinding/store/utils.js +0 -49
  40. package/lib/commonjs/wayfinding/types/constants.js +0 -13
  41. package/lib/commonjs/wayfinding/types/index.js +0 -6
  42. package/lib/commonjs/wayfinding/utils/index.js +0 -12
  43. package/lib/commonjs/wayfinding/utils/mapper.js +0 -204
  44. package/lib/module/index.js +0 -14
  45. package/lib/module/sdk/index.js +0 -904
  46. package/lib/module/sdk/internaDelegatedState.js +0 -43
  47. package/lib/module/sdk/nativeInterface.js +0 -20
  48. package/lib/module/sdk/types/constants.js +0 -70
  49. package/lib/module/sdk/types/index.js +0 -445
  50. package/lib/module/sdk/utils.js +0 -146
  51. package/lib/module/utils/index.js +0 -4
  52. package/lib/module/utils/logError.js +0 -17
  53. package/lib/module/wayfinding/components/MapView.js +0 -381
  54. package/lib/module/wayfinding/components/MapView.js.map +0 -1
  55. package/lib/module/wayfinding/hooks/index.js +0 -226
  56. package/lib/module/wayfinding/hooks/index.js.map +0 -1
  57. package/lib/module/wayfinding/index.js +0 -15
  58. package/lib/module/wayfinding/store/index.js +0 -213
  59. package/lib/module/wayfinding/store/index.js.map +0 -1
  60. package/lib/module/wayfinding/store/utils.js +0 -40
  61. package/lib/module/wayfinding/types/constants.js +0 -9
  62. package/lib/module/wayfinding/types/index.js +0 -4
  63. package/lib/module/wayfinding/utils/index.js +0 -7
  64. package/lib/module/wayfinding/utils/mapper.js +0 -195
  65. package/lib/module/wayfinding/utils/mapper.js.map +0 -1
@@ -1,233 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useSitumInternal = exports.default = void 0;
7
- var _react = require("react");
8
- var _sdk = _interopRequireDefault(require("../../sdk"));
9
- var _types = require("../../sdk/types");
10
- var _constants = require("../../sdk/types/constants");
11
- var _index = require("../store/index");
12
- var _utils = require("../store/utils");
13
- var _mapper = require("../utils/mapper");
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- /* eslint-disable @typescript-eslint/no-explicit-any */
16
-
17
- const defaultNavigationRequest = {
18
- distanceToGoalThreshold: 4,
19
- outsideRouteThreshold: 5
20
- };
21
- const useSitumInternal = () => {
22
- const dispatch = (0, _utils.useDispatch)();
23
- const location = (0, _utils.useSelector)(_index.selectLocation);
24
- const locationStatus = (0, _utils.useSelector)(_index.selectLocationStatus);
25
- const directions = (0, _utils.useSelector)(_index.selectDirections);
26
- const navigation = (0, _utils.useSelector)(_index.selectNavigation);
27
- const error = (0, _utils.useSelector)(_index.selectError);
28
- const [lockDirections, setLockDirections] = (0, _react.useState)(false);
29
- const init = () => {
30
- console.debug("Situm > hook > Initializing -> Registering callbacks");
31
- registerCallbacks();
32
- };
33
- function registerCallbacks() {
34
- _sdk.default.internalSetMethodCallMapDelegate(internalCall => {
35
- switch (internalCall.type) {
36
- case _constants.InternalCallType.LOCATION:
37
- let location = internalCall.get();
38
- dispatch((0, _index.setLocation)({
39
- ...location
40
- }));
41
- break;
42
- case _constants.InternalCallType.LOCATION_STATUS:
43
- let statusName = internalCall.get();
44
- if (statusName in _constants.LocationStatusName) {
45
- dispatch((0, _index.setLocationStatus)(statusName));
46
- }
47
- break;
48
- case _constants.InternalCallType.LOCATION_STOPPED:
49
- // TODO: LOCATION_STOPPED exists only in RN, delete!
50
- dispatch((0, _index.resetLocation)());
51
- break;
52
- case _constants.InternalCallType.LOCATION_ERROR:
53
- let error = internalCall.get();
54
- dispatch((0, _index.setError)(error));
55
- break;
56
- case _constants.InternalCallType.NAVIGATION_START:
57
- dispatch((0, _index.setNavigation)({
58
- type: _constants.NavigationUpdateType.PROGRESS,
59
- status: _constants.NavigationStatus.START
60
- }));
61
- break;
62
- case _constants.InternalCallType.NAVIGATION_DESTINATION_REACHED:
63
- dispatch((0, _index.setNavigation)({
64
- type: _constants.NavigationUpdateType.DESTINATION_REACHED,
65
- status: _constants.NavigationStatus.UPDATE
66
- }));
67
- break;
68
- case _constants.InternalCallType.NAVIGATION_PROGRESS:
69
- let progress = internalCall.get();
70
- dispatch((0, _index.setNavigation)({
71
- currentIndication: progress?.currentIndication,
72
- routeStep: progress?.routeStep,
73
- distanceToGoal: progress?.distanceToGoal,
74
- points: progress?.points,
75
- type: _constants.NavigationUpdateType.PROGRESS,
76
- segments: progress?.segments,
77
- status: _constants.NavigationStatus.UPDATE
78
- }));
79
- break;
80
- case _constants.InternalCallType.NAVIGATION_OUT_OF_ROUTE:
81
- dispatch((0, _index.setNavigation)({
82
- type: _constants.NavigationUpdateType.OUT_OF_ROUTE,
83
- status: _constants.NavigationStatus.UPDATE
84
- }));
85
- break;
86
- case _constants.InternalCallType.NAVIGATION_CANCELLATION:
87
- dispatch((0, _index.setNavigation)({
88
- type: _constants.NavigationUpdateType.CANCELLED,
89
- status: _constants.NavigationStatus.STOP
90
- }));
91
- break;
92
- case _constants.InternalCallType.NAVIGATION_ERROR:
93
- case _constants.InternalCallType.GEOFENCES_ENTER:
94
- case _constants.InternalCallType.GEOFENCES_EXIT:
95
- // Do nothing.
96
- break;
97
- }
98
- });
99
- }
100
- const calculateRoute = async (payload, interceptor, updateRoute = true) => {
101
- console.debug("Situm > hook > calculating route");
102
- const directionsRequest = (0, _mapper.createDirectionsRequest)(payload.directionsRequest);
103
- interceptor && interceptor(directionsRequest);
104
- const {
105
- to,
106
- from,
107
- minimizeFloorChanges,
108
- accessibilityMode,
109
- bearingFrom,
110
- includedTags,
111
- excludedTags
112
- } = directionsRequest;
113
- const {
114
- originIdentifier,
115
- destinationIdentifier,
116
- buildingIdentifier
117
- } = (0, _mapper.createDirectionsMessage)(payload);
118
- const _buildings = await _sdk.default.fetchBuildings();
119
- const _building = _buildings.find(b => b.buildingIdentifier === buildingIdentifier);
120
- if (!_building) {
121
- console.debug(`Situm > hook > Could not compute route: missing building`);
122
- return;
123
- }
124
- if (!to || !from || lockDirections) {
125
- console.debug(`Situm > hook > Could not compute route (to: ${to}, from: ${from}, lockDirections: ${lockDirections})`);
126
- return;
127
- }
128
-
129
- // iOS workaround -> does not allow for several direction petitions
130
- setLockDirections(true);
131
- return await _sdk.default.requestDirections(_building, from, to, {
132
- minimizeFloorChanges,
133
- accessibilityMode,
134
- bearingFrom,
135
- includedTags,
136
- excludedTags
137
- }).then(_directions => {
138
- const newRoute = {
139
- ..._directions,
140
- originIdentifier,
141
- destinationIdentifier,
142
- type: accessibilityMode
143
- };
144
- if (updateRoute) {
145
- dispatch((0, _index.setDirections)(newRoute));
146
- }
147
- return newRoute;
148
- }).catch(e => {
149
- console.error(`Situm > hook > Could not compute route: ${e}`);
150
- dispatch((0, _index.setDirections)({
151
- error: JSON.stringify(e)
152
- }));
153
- }).finally(() => {
154
- setLockDirections(false);
155
- });
156
- };
157
-
158
- // Navigation
159
- const startNavigation = (payload, interceptor) => {
160
- console.debug("Situm > hook > request to start navigation");
161
- // TODO: we should delegate this to the sdk plugin
162
- if (!navigation || navigation?.status !== _constants.NavigationStatus.STOP) {
163
- stopNavigation();
164
- }
165
- calculateRoute(payload, interceptor, false).then(r => {
166
- if (!r) {
167
- console.debug(`Situm > hook > No route was computed`);
168
- return;
169
- }
170
- dispatch((0, _index.setNavigation)({
171
- status: _constants.NavigationStatus.START,
172
- type: _constants.NavigationUpdateType.PROGRESS,
173
- ...r
174
- }));
175
- try {
176
- const navigationRequest = (0, _mapper.createNavigationRequest)(payload.navigationRequest);
177
- _sdk.default.requestNavigationUpdates({
178
- ...defaultNavigationRequest,
179
- ...navigationRequest
180
- });
181
- } catch (e) {
182
- console.error(`Situm > hook > Could not update navigation ${e}`);
183
- //TODO: Remove this and emit these errors in SitumPlugin.onNavigationError
184
- dispatch((0, _index.setError)({
185
- message: "Could not update navigation",
186
- code: _types.ErrorCode.UNKNOWN,
187
- type: _types.ErrorType.NON_CRITICAL
188
- }));
189
- stopNavigation();
190
- }
191
- }).catch(e => {
192
- console.error(`Situm > hook > Could not compute route for navigation ${JSON.stringify(e)}`);
193
- });
194
- };
195
- const stopNavigation = () => {
196
- // TODO: we should delegate this to the sdk plugin
197
- if (!navigation || navigation?.status === _constants.NavigationStatus.STOP) {
198
- return;
199
- }
200
- console.debug("Situm > hook > Stopping navigation");
201
- _sdk.default.removeNavigationUpdates().then(() => {
202
- console.debug("Situm > hook > Successfully removed navigation updates");
203
- dispatch((0, _index.setNavigation)({
204
- status: _constants.NavigationStatus.STOP
205
- }));
206
- }).catch(e => {
207
- console.warn(`Situm > hook > Could not remove navigation updates ${JSON.stringify(e)}`);
208
- });
209
- };
210
- return {
211
- // States
212
- location,
213
- locationStatus,
214
- directions,
215
- navigation,
216
- error,
217
- // Functions
218
- init,
219
- calculateRoute,
220
- startNavigation,
221
- stopNavigation
222
- };
223
- };
224
- exports.useSitumInternal = useSitumInternal;
225
- const useSitum = () => {
226
- const context = (0, _react.useContext)(_index.UseSitumContext);
227
- if (!context) {
228
- throw new Error("Situm > hook > No SitumProvider found.");
229
- }
230
- return context.useSitum;
231
- };
232
- var _default = exports.default = useSitum;
233
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_sdk","_interopRequireDefault","_types","_constants","_index","_utils","_mapper","e","__esModule","default","defaultNavigationRequest","distanceToGoalThreshold","outsideRouteThreshold","useSitumInternal","dispatch","useDispatch","location","useSelector","selectLocation","locationStatus","selectLocationStatus","directions","selectDirections","navigation","selectNavigation","error","selectError","lockDirections","setLockDirections","useState","init","console","debug","registerCallbacks","SitumPlugin","internalSetMethodCallMapDelegate","internalCall","type","InternalCallType","LOCATION","get","setLocation","LOCATION_STATUS","statusName","LocationStatusName","setLocationStatus","LOCATION_STOPPED","resetLocation","LOCATION_ERROR","setError","NAVIGATION_START","setNavigation","NavigationUpdateType","PROGRESS","status","NavigationStatus","START","NAVIGATION_DESTINATION_REACHED","DESTINATION_REACHED","UPDATE","NAVIGATION_PROGRESS","progress","currentIndication","routeStep","distanceToGoal","points","segments","NAVIGATION_OUT_OF_ROUTE","OUT_OF_ROUTE","NAVIGATION_CANCELLATION","CANCELLED","STOP","NAVIGATION_ERROR","GEOFENCES_ENTER","GEOFENCES_EXIT","calculateRoute","payload","interceptor","updateRoute","directionsRequest","createDirectionsRequest","to","from","minimizeFloorChanges","accessibilityMode","bearingFrom","includedTags","excludedTags","originIdentifier","destinationIdentifier","buildingIdentifier","createDirectionsMessage","_buildings","fetchBuildings","_building","find","b","requestDirections","then","_directions","newRoute","setDirections","catch","JSON","stringify","finally","startNavigation","stopNavigation","r","navigationRequest","createNavigationRequest","requestNavigationUpdates","message","code","ErrorCode","UNKNOWN","ErrorType","NON_CRITICAL","removeNavigationUpdates","warn","exports","useSitum","context","useContext","UseSitumContext","Error","_default"],"sourceRoot":"../../../../src","sources":["wayfinding/hooks/index.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AASA,IAAAI,UAAA,GAAAJ,OAAA;AAMA,IAAAK,MAAA,GAAAL,OAAA;AAcA,IAAAM,MAAA,GAAAN,OAAA;AAEA,IAAAO,OAAA,GAAAP,OAAA;AAIyB,SAAAE,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAvCzB;;AAyCA,MAAMG,wBAAwB,GAAG;EAC/BC,uBAAuB,EAAE,CAAC;EAC1BC,qBAAqB,EAAE;AACzB,CAAC;AAEM,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EACpC,MAAMC,QAAQ,GAAG,IAAAC,kBAAW,EAAC,CAAC;EAE9B,MAAMC,QAAQ,GAAG,IAAAC,kBAAW,EAACC,qBAAc,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IAEL;IACAK,IAAI;IACJ6C,cAAc;IACd+B,eAAe;IACfC;EACF,CAAC;AACH,CAAC;AAACa,OAAA,CAAA3G,gBAAA,GAAAA,gBAAA;AAEF,MAAM4G,QAAQ,GAAGA,CAAA,KAAM;EACrB,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACC,sBAAe,CAAC;EAE3C,IAAI,CAACF,OAAO,EAAE;IACZ,MAAM,IAAIG,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EAEA,OAAOH,OAAO,CAACD,QAAQ;AACzB,CAAC;AAAC,IAAAK,QAAA,GAAAN,OAAA,CAAA/G,OAAA,GAEagH,QAAQ","ignoreList":[]}
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {
7
- useSitum: true,
8
- SitumProvider: true,
9
- MapView: true
10
- };
11
- Object.defineProperty(exports, "MapView", {
12
- enumerable: true,
13
- get: function () {
14
- return _MapView.default;
15
- }
16
- });
17
- Object.defineProperty(exports, "SitumProvider", {
18
- enumerable: true,
19
- get: function () {
20
- return _store.default;
21
- }
22
- });
23
- Object.defineProperty(exports, "useSitum", {
24
- enumerable: true,
25
- get: function () {
26
- return _hooks.default;
27
- }
28
- });
29
- var _types = require("./types");
30
- Object.keys(_types).forEach(function (key) {
31
- if (key === "default" || key === "__esModule") return;
32
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
33
- if (key in exports && exports[key] === _types[key]) return;
34
- Object.defineProperty(exports, key, {
35
- enumerable: true,
36
- get: function () {
37
- return _types[key];
38
- }
39
- });
40
- });
41
- var _constants = require("./types/constants");
42
- Object.keys(_constants).forEach(function (key) {
43
- if (key === "default" || key === "__esModule") return;
44
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
45
- if (key in exports && exports[key] === _constants[key]) return;
46
- Object.defineProperty(exports, key, {
47
- enumerable: true,
48
- get: function () {
49
- return _constants[key];
50
- }
51
- });
52
- });
53
- var _hooks = _interopRequireDefault(require("./hooks"));
54
- var _store = _interopRequireDefault(require("./store"));
55
- var _MapView = _interopRequireDefault(require("./components/MapView"));
56
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
57
- //# sourceMappingURL=index.js.map
@@ -1,247 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.setWebViewRef = exports.setSdkInitialized = exports.setPois = exports.setNavigation = exports.setLocationStatus = exports.setLocation = exports.setError = exports.setDirections = exports.setDestinationPoiID = exports.setCurrentBuilding = exports.setBuildings = exports.setBuildingIdentifier = exports.setAuth = exports.selectWebViewRef = exports.selectUser = exports.selectPois = exports.selectNavigation = exports.selectLocationStatus = exports.selectLocation = exports.selectIsSDKInitialized = exports.selectError = exports.selectDirections = exports.selectDestinationPoiID = exports.selectCurrentBuilding = exports.selectBuildings = exports.selectBuildingIdentifier = exports.resetLocation = exports.initialState = exports.default = exports.UseSitumContext = exports.SitumContext = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _hooks = require("../hooks");
9
- var _utils = require("./utils");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
- /* eslint-disable @typescript-eslint/no-explicit-any */
14
-
15
- const initialState = exports.initialState = {
16
- webViewRef: undefined,
17
- sdkInitialized: false,
18
- user: undefined,
19
- location: undefined,
20
- locationStatus: undefined,
21
- buildings: null,
22
- currentBuilding: undefined,
23
- pois: [],
24
- directions: undefined,
25
- navigation: undefined,
26
- destinationPoiID: undefined,
27
- error: undefined,
28
- buildingIdentifier: "-1"
29
- };
30
- const SitumContext = exports.SitumContext = /*#__PURE__*/(0, _react.createContext)(undefined);
31
- const store = (0, _utils.createStore)({
32
- initialState,
33
- reducers: {
34
- setWebViewRef: (state, payload) => {
35
- return {
36
- ...state,
37
- webViewRef: payload
38
- };
39
- },
40
- setSdkInitialized: (state, payload) => {
41
- return {
42
- ...state,
43
- sdkInitialized: payload
44
- };
45
- },
46
- setAuth: (state, payload) => {
47
- return {
48
- ...state,
49
- user: payload
50
- };
51
- },
52
- setLocation: (state, payload) => {
53
- return {
54
- ...state,
55
- location: payload
56
- };
57
- },
58
- setLocationStatus: (state, payload) => {
59
- return {
60
- ...state,
61
- locationStatus: payload
62
- };
63
- },
64
- resetLocation: state => {
65
- return {
66
- ...state,
67
- location: initialState.location
68
- };
69
- },
70
- setBuildings: (state, payload) => {
71
- return {
72
- ...state,
73
- buildings: payload
74
- };
75
- },
76
- setCurrentBuilding: (state, payload) => {
77
- return {
78
- ...state,
79
- currentBuilding: payload
80
- };
81
- },
82
- setPois: (state, payload) => {
83
- return {
84
- ...state,
85
- pois: payload
86
- };
87
- },
88
- setDirections: (state, payload) => {
89
- return {
90
- ...state,
91
- directions: payload
92
- };
93
- },
94
- setNavigation: (state, payload) => {
95
- return {
96
- ...state,
97
- navigation: payload
98
- };
99
- },
100
- setDestinationPoiID: (state, payload) => {
101
- return {
102
- ...state,
103
- destinationPoiID: payload
104
- };
105
- },
106
- setError: (state, payload) => {
107
- return {
108
- ...state,
109
- error: payload
110
- };
111
- },
112
- setBuildingIdentifier: (state, payload) => {
113
- return {
114
- ...state,
115
- buildingIdentifier: payload
116
- };
117
- }
118
- }
119
- });
120
- const selectWebViewRef = state => {
121
- return state.webViewRef;
122
- };
123
- exports.selectWebViewRef = selectWebViewRef;
124
- const selectIsSDKInitialized = state => {
125
- return state.sdkInitialized;
126
- };
127
- exports.selectIsSDKInitialized = selectIsSDKInitialized;
128
- const selectUser = state => {
129
- return state.user;
130
- };
131
- exports.selectUser = selectUser;
132
- const selectLocation = state => {
133
- return state.location;
134
- };
135
- exports.selectLocation = selectLocation;
136
- const selectLocationStatus = state => {
137
- return state.locationStatus;
138
- };
139
- exports.selectLocationStatus = selectLocationStatus;
140
- const selectBuildings = state => {
141
- return state.buildings;
142
- };
143
- exports.selectBuildings = selectBuildings;
144
- const selectCurrentBuilding = state => {
145
- return state.currentBuilding;
146
- };
147
- exports.selectCurrentBuilding = selectCurrentBuilding;
148
- const selectPois = state => {
149
- return state.pois;
150
- };
151
- exports.selectPois = selectPois;
152
- const selectDirections = state => {
153
- return state.directions;
154
- };
155
- exports.selectDirections = selectDirections;
156
- const selectNavigation = state => {
157
- return state.navigation;
158
- };
159
- exports.selectNavigation = selectNavigation;
160
- const selectDestinationPoiID = state => {
161
- return state.destinationPoiID;
162
- };
163
- exports.selectDestinationPoiID = selectDestinationPoiID;
164
- const selectError = state => {
165
- return state.error;
166
- };
167
- exports.selectError = selectError;
168
- const selectBuildingIdentifier = state => {
169
- return state.buildingIdentifier;
170
- };
171
- exports.selectBuildingIdentifier = selectBuildingIdentifier;
172
- const {
173
- setWebViewRef,
174
- setSdkInitialized,
175
- setAuth,
176
- setLocation,
177
- setLocationStatus,
178
- resetLocation,
179
- setBuildings,
180
- setCurrentBuilding,
181
- setPois,
182
- setDirections,
183
- setNavigation,
184
- setDestinationPoiID,
185
- setError,
186
- setBuildingIdentifier
187
- } = store.actions;
188
-
189
- /**
190
- * Context specifically to store the only instance of our hook.
191
- */
192
- exports.setBuildingIdentifier = setBuildingIdentifier;
193
- exports.setError = setError;
194
- exports.setDestinationPoiID = setDestinationPoiID;
195
- exports.setNavigation = setNavigation;
196
- exports.setDirections = setDirections;
197
- exports.setPois = setPois;
198
- exports.setCurrentBuilding = setCurrentBuilding;
199
- exports.setBuildings = setBuildings;
200
- exports.resetLocation = resetLocation;
201
- exports.setLocationStatus = setLocationStatus;
202
- exports.setLocation = setLocation;
203
- exports.setAuth = setAuth;
204
- exports.setSdkInitialized = setSdkInitialized;
205
- exports.setWebViewRef = setWebViewRef;
206
- const UseSitumContext = exports.UseSitumContext = /*#__PURE__*/(0, _react.createContext)(undefined);
207
- const UseSitumProvider = ({
208
- children
209
- }) => {
210
- // TODO: if we have this, there is no need to have a context for the rest of the state
211
- // as there is only one instance of the hook
212
- const useSitum = (0, _hooks.useSitumInternal)();
213
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(UseSitumContext.Provider, {
214
- value: {
215
- useSitum
216
- },
217
- children: children
218
- });
219
- };
220
-
221
- /**
222
- * Main context of the application, stores the plugins' state.
223
- */
224
- const SitumProvider = ({
225
- email,
226
- apiKey,
227
- children
228
- }) => {
229
- const [state, dispatch] = (0, _react.useReducer)(store.reducer, {
230
- ...store.initialState,
231
- user: {
232
- email,
233
- apiKey
234
- }
235
- });
236
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(SitumContext.Provider, {
237
- value: {
238
- state,
239
- dispatch
240
- },
241
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(UseSitumProvider, {
242
- children: children
243
- })
244
- });
245
- };
246
- var _default = exports.default = SitumProvider;
247
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_hooks","_utils","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","initialState","exports","webViewRef","undefined","sdkInitialized","user","location","locationStatus","buildings","currentBuilding","pois","directions","navigation","destinationPoiID","error","buildingIdentifier","SitumContext","createContext","store","createStore","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","useSitumInternal","jsx","Provider","value","SitumProvider","email","apiKey","dispatch","useReducer","reducer","_default"],"sourceRoot":"../../../../src","sources":["wayfinding/store/index.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAWA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAsC,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAA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B,CAAC;AAE5B,CAAC;AAAC,IAAAY,QAAA,GAAAhE,OAAA,CAAAf,OAAA,GAEayE,aAAa","ignoreList":[]}
@@ -1,49 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useSelector = exports.useDispatch = exports.createStore = exports.createReducer = void 0;
7
- var _react = require("react");
8
- var _index = require("./index");
9
- /* eslint-disable @typescript-eslint/no-explicit-any */
10
-
11
- const createReducer = () => {
12
- const reducer = (state, action) => {
13
- return action(state);
14
- };
15
- return reducer;
16
- };
17
- exports.createReducer = createReducer;
18
- const createStore = ({
19
- initialState,
20
- reducers
21
- }) => {
22
- const actions = Object.keys(reducers).reduce((acc, r) => {
23
- acc[r] = payload => state => reducers[r](state, payload);
24
- return acc;
25
- }, {});
26
- return {
27
- initialState,
28
- actions,
29
- reducer: createReducer()
30
- };
31
- };
32
- exports.createStore = createStore;
33
- const useSelector = selector => {
34
- const context = (0, _react.useContext)(_index.SitumContext);
35
- if (!context) {
36
- throw new Error("No SitumProvider found.");
37
- }
38
- return selector(context.state);
39
- };
40
- exports.useSelector = useSelector;
41
- const useDispatch = () => {
42
- const context = (0, _react.useContext)(_index.SitumContext);
43
- if (!context) {
44
- throw new Error("No SitumProvider found.");
45
- }
46
- return context.dispatch;
47
- };
48
- exports.useDispatch = useDispatch;
49
- //# sourceMappingURL=utils.js.map
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ErrorName = void 0;
7
- // Define class that handles errors
8
- let ErrorName = exports.ErrorName = /*#__PURE__*/function (ErrorName) {
9
- ErrorName["ERR_INTERNET_DISCONNECTED"] = "ERR_INTERNET_DISCONNECTED";
10
- ErrorName["ERR_INTERNAL_SERVER_ERROR"] = "ERR_INTERNAL_SERVER_ERROR";
11
- return ErrorName;
12
- }({});
13
- //# sourceMappingURL=constants.js.map
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- //# sourceMappingURL=index.js.map
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.sendMessageToViewer = void 0;
7
- const sendMessageToViewer = (viewer, message) => {
8
- if (!viewer) return;
9
- viewer.injectJavaScript(`window.postMessage(${message})`);
10
- };
11
- exports.sendMessageToViewer = sendMessageToViewer;
12
- //# sourceMappingURL=index.js.map