@mappedin/react-native-sdk 6.10.0 → 6.11.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/index.js +676 -567
- package/lib/map-view.d.ts.map +1 -1
- package/lib/utils/event-hydration.d.ts +39 -0
- package/lib/utils/event-hydration.d.ts.map +1 -0
- package/package.json +2 -2
package/lib/map-view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-view.d.ts","sourceRoot":"","sources":["../src/map-view.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAkD,MAAM,OAAO,CAAC;AAIvE,OAAO,KAAK,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIjH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"map-view.d.ts","sourceRoot":"","sources":["../src/map-view.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAkD,MAAM,OAAO,CAAC;AAIvE,OAAO,KAAK,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIjH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAcxC,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;OAEG;IACH,OAAO,EAAE,kBAAkB,GAAG,QAAQ,CAAC,OAAO,CAAC;IAC/C;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,4BAA4B,CAAC;CACnD;AAED;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA6b1C,CAAC;AA+BF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { MapData } from '@mappedin/mappedin-js';
|
|
2
|
+
/**
|
|
3
|
+
* Events that contain map data objects that can be hydrated.
|
|
4
|
+
* Currently supports click and hover events which contain spaces, objects, etc.
|
|
5
|
+
*/
|
|
6
|
+
export declare const HYDRATABLE_EVENTS: Set<"click" | "hover">;
|
|
7
|
+
/** Serialized map data object with optional id */
|
|
8
|
+
type SerializedItem = {
|
|
9
|
+
id?: string;
|
|
10
|
+
} & Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* Hydrates an array of serialized map data objects to full instances.
|
|
13
|
+
* Uses mapData.getById to retrieve the full object with all properties.
|
|
14
|
+
*
|
|
15
|
+
* @param mapData - The MapData instance to hydrate from
|
|
16
|
+
* @param type - The type of object to hydrate ('space', 'object', etc.)
|
|
17
|
+
* @param items - Array of serialized objects with at least an 'id' property
|
|
18
|
+
* @returns Array of hydrated objects, falls back to original if not found
|
|
19
|
+
*/
|
|
20
|
+
export declare function hydrateMapDataArray<T>(mapData: MapData, type: 'space' | 'object' | 'area' | 'floor' | 'facade', items: SerializedItem[] | undefined): T[];
|
|
21
|
+
/**
|
|
22
|
+
* Hydrates an event payload by replacing serialized map data objects with
|
|
23
|
+
* full instances from mapData. This restores properties like externalId,
|
|
24
|
+
* enterpriseLocations, doors, etc. that are not included in toJSON().
|
|
25
|
+
*
|
|
26
|
+
* @param mapData - The MapData instance to hydrate from
|
|
27
|
+
* @param eventName - The name of the event
|
|
28
|
+
* @param payload - The serialized event payload from WebView
|
|
29
|
+
* @returns Hydrated payload with full map data object instances
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const hydratedPayload = hydrateEventPayload(mapData, 'click', serializedPayload);
|
|
34
|
+
* // Now hydratedPayload.spaces[0].externalId is available
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function hydrateEventPayload<T>(mapData: MapData | null, eventName: string, payload: T): T;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=event-hydration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-hydration.d.ts","sourceRoot":"","sources":["../../src/utils/event-hydration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAyC,MAAM,uBAAuB,CAAC;AAE5F;;;GAGG;AACH,eAAO,MAAM,iBAAiB,wBAAuC,CAAC;AActE,kDAAkD;AAClD,KAAK,cAAc,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEhE;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACpC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,EACtD,KAAK,EAAE,cAAc,EAAE,GAAG,SAAS,GACjC,CAAC,EAAE,CAeL;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CA0BhG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mappedin/react-native-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.11.0",
|
|
4
4
|
"homepage": "https://developer.mappedin.com/",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"react": ">=16.8.0",
|
|
19
19
|
"react-native": ">=0.60.0",
|
|
20
20
|
"react-native-webview": ">=11.0.0",
|
|
21
|
-
"@mappedin/mappedin-js": "^6.
|
|
21
|
+
"@mappedin/mappedin-js": "^6.11.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {},
|
|
24
24
|
"volta": {
|