@mappedin/react-native-sdk 6.0.0-alpha.8 → 6.0.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.
- package/LICENSE.txt +104 -0
- package/README.md +162 -164
- package/lib/components/label.d.ts +45 -0
- package/lib/components/label.d.ts.map +1 -0
- package/lib/components/marker.d.ts +54 -0
- package/lib/components/marker.d.ts.map +1 -0
- package/lib/components/model.d.ts +45 -0
- package/lib/components/model.d.ts.map +1 -0
- package/lib/components/path.d.ts +42 -0
- package/lib/components/path.d.ts.map +1 -0
- package/lib/components/shape.d.ts +54 -0
- package/lib/components/shape.d.ts.map +1 -0
- package/lib/controls/event-control.d.ts +89 -0
- package/lib/controls/event-control.d.ts.map +1 -0
- package/lib/controls/map-view-control.d.ts +360 -0
- package/lib/controls/map-view-control.d.ts.map +1 -0
- package/lib/errors.d.ts +4 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/hooks/use-bridge.d.ts +81 -0
- package/lib/hooks/use-bridge.d.ts.map +1 -0
- package/lib/hooks/use-map-view-event.d.ts +27 -0
- package/lib/hooks/use-map-view-event.d.ts.map +1 -0
- package/lib/hooks/use-map.d.ts +58 -0
- package/lib/hooks/use-map.d.ts.map +1 -0
- package/lib/index.d.ts +21 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +61507 -0
- package/lib/index.js.map +7 -0
- package/lib/map-view.d.ts +51 -0
- package/lib/map-view.d.ts.map +1 -0
- package/lib/types.d.ts +3 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/utils.d.ts +28 -0
- package/lib/utils.d.ts.map +1 -0
- package/package.json +52 -29
- package/dist/commonjs/index.js +0 -3628
- package/dist/esm/index.js +0 -3628
- package/dist/index.d.ts +0 -6863
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { TStateChangedInternalPayload, TShow3DMapOptions, TGetMapDataOptions } from '@mappedin/mappedin-js';
|
|
4
|
+
import type { Mappedin } from './types';
|
|
5
|
+
export interface MapViewProps {
|
|
6
|
+
/**
|
|
7
|
+
* Optional style overrides
|
|
8
|
+
*/
|
|
9
|
+
style?: any;
|
|
10
|
+
/**
|
|
11
|
+
* Options for the 3D map from mappedin-js
|
|
12
|
+
*/
|
|
13
|
+
options?: TShow3DMapOptions;
|
|
14
|
+
/**
|
|
15
|
+
* Options for getting map data from mappedin-js, or a pre-loaded MapData instance
|
|
16
|
+
*/
|
|
17
|
+
mapData?: TGetMapDataOptions | Mappedin.MapData;
|
|
18
|
+
/**
|
|
19
|
+
* Child components that will have access to mapData and mapView through useMap hook
|
|
20
|
+
*/
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Fallback component to show while map is loading or on error
|
|
24
|
+
*/
|
|
25
|
+
fallback?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Called when the map is ready
|
|
28
|
+
*/
|
|
29
|
+
onMapReady?: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* Called when there is an error loading the map
|
|
32
|
+
*/
|
|
33
|
+
onError?: (error: Error) => void;
|
|
34
|
+
/**
|
|
35
|
+
* initial state to sync on start
|
|
36
|
+
* @remarks
|
|
37
|
+
* This is useful for testing.
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
__startInitialState?: TStateChangedInternalPayload;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* MapView - A React Native component for displaying Mappedin maps
|
|
45
|
+
*
|
|
46
|
+
* This component wraps a WebView and provides MappedinContext to child components.
|
|
47
|
+
* Children are only rendered when both mapData and mapView are ready.
|
|
48
|
+
*/
|
|
49
|
+
export declare const MapView: React.FC<MapViewProps>;
|
|
50
|
+
export default MapView;
|
|
51
|
+
//# sourceMappingURL=map-view.d.ts.map
|
|
@@ -0,0 +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;AACvC,OAAO,KAAyC,MAAM,OAAO,CAAC;AAI9D,OAAO,KAAK,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIjH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAWxC,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,kBAAkB,GAAG,QAAQ,CAAC,OAAO,CAAC;IAChD;;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,CAqX1C,CAAC;AA+BF,eAAe,OAAO,CAAC"}
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,QAAQ,EAAE,CAAC"}
|
package/lib/utils.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { WebViewMessageEvent } from 'react-native-webview';
|
|
2
|
+
import { E_SDK_LOG_LEVEL } from '../../packages/common/Mappedin.Logger';
|
|
3
|
+
import type { TShow3DMapOptions } from '@mappedin/mappedin-js';
|
|
4
|
+
export declare const Logger: {
|
|
5
|
+
logState: E_SDK_LOG_LEVEL;
|
|
6
|
+
log(...args: any[]): void;
|
|
7
|
+
warn(...args: any[]): void;
|
|
8
|
+
error(...args: any[]): void;
|
|
9
|
+
assert(...args: any[]): void;
|
|
10
|
+
time(label: string): void;
|
|
11
|
+
timeEnd(label: string): void;
|
|
12
|
+
setLevel(level: E_SDK_LOG_LEVEL): void;
|
|
13
|
+
};
|
|
14
|
+
export declare function setLoggerLevel(level: 'log' | 'warn' | 'error' | 'silent'): void;
|
|
15
|
+
/**
|
|
16
|
+
* Process TShow3DMapOptions to provide default values for watermark settings.
|
|
17
|
+
* Specifically defaults watermark.iconOnly to true if not specified.
|
|
18
|
+
*
|
|
19
|
+
* @param options - The original TShow3DMapOptions or undefined
|
|
20
|
+
* @returns Processed options with watermark.iconOnly defaulting to true
|
|
21
|
+
*/
|
|
22
|
+
export declare function processShow3DMapOptions(options?: TShow3DMapOptions): TShow3DMapOptions;
|
|
23
|
+
/**
|
|
24
|
+
* Type guard to determine if an event is a MessageEvent (used in iframe/web contexts)
|
|
25
|
+
* Uses property-based detection instead of instanceof for better cross-platform reliability
|
|
26
|
+
*/
|
|
27
|
+
export declare function isMessageEvent(event: MessageEvent | WebViewMessageEvent): event is MessageEvent;
|
|
28
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAgB,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,eAAO,MAAM,MAAM;;;;;;;;;CAA0C,CAAC;AAC9D,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,QAexE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,iBAAiB,CAqBtF;AACD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,mBAAmB,GAAG,KAAK,IAAI,YAAY,CAG/F"}
|
package/package.json
CHANGED
|
@@ -1,39 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mappedin/react-native-sdk",
|
|
3
|
-
"version": "6.0.0-
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
3
|
+
"version": "6.0.0-beta.0",
|
|
4
|
+
"homepage": "https://developer.mappedin.com/",
|
|
5
|
+
"private": false,
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"module": "lib/index.js",
|
|
8
|
+
"types": "lib/index.d.ts",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"files": [
|
|
11
|
+
"lib",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE.txt",
|
|
14
|
+
"THIRD_PARTY_LICENSES.txt"
|
|
15
|
+
],
|
|
16
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
8
17
|
"repository": {
|
|
9
18
|
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/MappedIn/
|
|
11
|
-
},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"@types/react": "*",
|
|
14
|
-
"@types/react-native": "*",
|
|
15
|
-
"react": "*",
|
|
16
|
-
"react-native": "*",
|
|
17
|
-
"typescript": "4.4.2"
|
|
19
|
+
"url": "git+https://github.com/MappedIn/sdk.git"
|
|
18
20
|
},
|
|
19
21
|
"peerDependencies": {
|
|
20
|
-
"react": "
|
|
21
|
-
"react-native": "
|
|
22
|
+
"react": ">=16.8.0",
|
|
23
|
+
"react-native": ">=0.60.0",
|
|
24
|
+
"react-native-webview": ">=11.0.0",
|
|
25
|
+
"@mappedin/mappedin-js": "^6.0.1-beta.42"
|
|
22
26
|
},
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@babel/preset-flow": "^7.27.1",
|
|
29
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
30
|
+
"@react-native/babel-preset": "^0.79.3",
|
|
31
|
+
"@testing-library/react-native": "^13.2.0",
|
|
32
|
+
"@types/react": "~19.0.10",
|
|
33
|
+
"babel-jest": "30.0.0-beta.3",
|
|
34
|
+
"jest": "^29.7.0",
|
|
35
|
+
"jest-environment-node": "^29.7.0",
|
|
36
|
+
"react": "19.0.0",
|
|
37
|
+
"react-native": "0.79.2",
|
|
38
|
+
"react-test-renderer": "19.0.0",
|
|
39
|
+
"typescript": "~5.8.3",
|
|
40
|
+
"@mappedin/mappedin-js": "6.0.0-rc.0",
|
|
41
|
+
"@mappedin/webview-bridge": "6.0.1-beta.51"
|
|
42
|
+
},
|
|
43
|
+
"volta": {
|
|
44
|
+
"extends": "../../package.json"
|
|
34
45
|
},
|
|
35
46
|
"dependencies": {
|
|
36
|
-
"react-native-webview": "
|
|
47
|
+
"react-native-webview": "13.13.5"
|
|
37
48
|
},
|
|
38
|
-
"
|
|
39
|
-
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "node scripts/build.mjs",
|
|
51
|
+
"build:prod": "NODE_ENV=production pnpm build",
|
|
52
|
+
"types": "tsc --emitDeclarationOnly --declaration --declarationMap",
|
|
53
|
+
"start": "pnpm -w start:rn",
|
|
54
|
+
"docs": "typedoc",
|
|
55
|
+
"docs:serve": "npx serve ./docs",
|
|
56
|
+
"test": "jest",
|
|
57
|
+
"clean": "rm -rf lib/**",
|
|
58
|
+
"vs": "node scripts/version.mjs",
|
|
59
|
+
"publish:internal": "pnpm vs publish-internal",
|
|
60
|
+
"publish:npm": "pnpm vs mark-public && pnpm publish --tag alpha --registry=\"https://registry.npmjs.org/\" --no-git-checks"
|
|
61
|
+
}
|
|
62
|
+
}
|