@mappedin/react-native-sdk 6.0.0-alpha.9 → 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.
@@ -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,3 @@
1
+ import type * as Mappedin from '@mappedin/mappedin-js';
2
+ export type { Mappedin };
3
+ //# sourceMappingURL=types.d.ts.map
@@ -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-alpha.9",
4
- "main": "dist/commonjs/index.js",
5
- "module": "dist/module/index.js",
6
- "types": "dist/index.d.ts",
7
- "license": "UNLICENSED",
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/mappedin-core-sdk.git"
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
- "files": [
24
- "dist",
25
- "README.md"
26
- ],
27
- "scripts": {
28
- "clean": "rm -rf dist",
29
- "build": "rm -rf dist/ && yarn types && node scripts/build.mjs",
30
- "types": "tsc -b .",
31
- "lint": "eslint .",
32
- "test": "echo \"No tests yet\"",
33
- "docs": "yarn build && typedoc --categorizeByGroup --disableSources --includeVersion --hideGenerator --excludePrivate --tsconfig tsconfig.json --out docs src/index.ts"
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": "^11.13.0"
47
+ "react-native-webview": "13.13.5"
37
48
  },
38
- "gitHead": "f9a3e6062edda24eb6224a4de00cc1acbce2304f"
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
+ }