react-native-maplibre-gl-js 1.0.0 → 1.0.2
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/README.md +7 -5
- package/lib/module/index.js +4 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/react-native/components/Map/Map.js +1 -1
- package/lib/module/react-native/components/Map/Map.js.map +1 -1
- package/lib/module/react-native/components/MapProvider/MapProvider.js +5 -5
- package/lib/module/react-native/components/MapProvider/MapProvider.js.map +1 -1
- package/lib/module/react-native/components/Marker/Marker.js +1 -1
- package/lib/module/react-native/components/Marker/Marker.js.map +1 -1
- package/lib/module/react-native/components/Popup/Popup.js +1 -1
- package/lib/module/react-native/components/Popup/Popup.js.map +1 -1
- package/lib/module/react-native/components-factory/createWebObjectAsComponent.js +2 -2
- package/lib/module/react-native/components-factory/createWebObjectAsComponent.js.map +1 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMethodsProxy.js +1 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMethodsProxy.js.map +1 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMountOnLaunch.js +1 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMountOnLaunch.js.map +1 -1
- package/lib/module/react-native/hooks/atoms/useMapAtoms.js +1 -1
- package/lib/module/react-native/hooks/atoms/useMapAtoms.js.map +1 -1
- package/lib/module/web/bridge/ReactNativeBridge.js +1 -1
- package/lib/module/web/bridge/ReactNativeBridge.js.map +1 -1
- package/lib/module/web/generated/index.js +2 -2
- package/lib/module/web/generated/index.js.map +1 -1
- package/lib/module/web/maplibre-gl-js/MapController.js +2 -2
- package/lib/module/web/maplibre-gl-js/MapController.js.map +1 -1
- package/lib/typescript/src/communication/messages.types.d.ts +1 -1
- package/lib/typescript/src/communication/messages.types.d.ts.map +1 -1
- package/lib/typescript/src/communication/messages.utils.d.ts +1 -1
- package/lib/typescript/src/communication/messages.utils.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +8 -8
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/Map/Map.d.ts +1 -1
- package/lib/typescript/src/react-native/components/Map/Map.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/Map/Map.types.d.ts +1 -1
- package/lib/typescript/src/react-native/components/Map/Map.types.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/MapProvider/MapProvider.d.ts +1 -1
- package/lib/typescript/src/react-native/components/MapProvider/MapProvider.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/Marker/Marker.d.ts +1 -1
- package/lib/typescript/src/react-native/components/Marker/Marker.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/Marker/Marker.types.d.ts +2 -2
- package/lib/typescript/src/react-native/components/Marker/Marker.types.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/Popup/Popup.d.ts +1 -1
- package/lib/typescript/src/react-native/components/Popup/Popup.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/Popup/Popup.types.d.ts +1 -1
- package/lib/typescript/src/react-native/components/Popup/Popup.types.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components-factory/createWebObjectAsComponent.d.ts +2 -2
- package/lib/typescript/src/react-native/components-factory/createWebObjectAsComponent.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMethodsProxy.d.ts +1 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMethodsProxy.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMountOnLaunch.d.ts +2 -2
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMountOnLaunch.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectOptionsUpdater.d.ts +2 -2
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectOptionsUpdater.d.ts.map +1 -1
- package/lib/typescript/src/react-native/hooks/atoms/useMapAtoms.d.ts +2 -2
- package/lib/typescript/src/react-native/hooks/atoms/useMapAtoms.d.ts.map +1 -1
- package/lib/typescript/src/typedoc.d.ts +1 -1
- package/lib/typescript/src/typedoc.d.ts.map +1 -1
- package/lib/typescript/src/web/bridge/ReactNativeBridge.d.ts +2 -2
- package/lib/typescript/src/web/bridge/ReactNativeBridge.d.ts.map +1 -1
- package/lib/typescript/src/web/maplibre-gl-js/MapController.d.ts +2 -2
- package/lib/typescript/src/web/maplibre-gl-js/MapController.d.ts.map +1 -1
- package/package.json +20 -14
- package/src/communication/messages.types.ts +0 -121
- package/src/communication/messages.utils.ts +0 -58
- package/src/index.ts +0 -31
- package/src/react-native/components/Map/Map.tsx +0 -14
- package/src/react-native/components/Map/Map.types.ts +0 -149
- package/src/react-native/components/MapProvider/MapProvider.hooks.ts +0 -13
- package/src/react-native/components/MapProvider/MapProvider.tsx +0 -139
- package/src/react-native/components/MapProvider/MapProvider.types.ts +0 -12
- package/src/react-native/components/Marker/Marker.tsx +0 -14
- package/src/react-native/components/Marker/Marker.types.ts +0 -56
- package/src/react-native/components/Popup/Popup.tsx +0 -14
- package/src/react-native/components/Popup/Popup.types.ts +0 -43
- package/src/react-native/components-factory/createWebObjectAsComponent.ts +0 -33
- package/src/react-native/components-factory/createWebObjectAsComponent.types.ts +0 -176
- package/src/react-native/components-factory/hooks/useWebObjectMethodsProxy.ts +0 -61
- package/src/react-native/components-factory/hooks/useWebObjectMountOnLaunch.ts +0 -79
- package/src/react-native/components-factory/hooks/useWebObjectOptionsUpdater.ts +0 -29
- package/src/react-native/hooks/atoms/useMapAtoms.ts +0 -261
- package/src/react-native/hooks/atoms/useMapAtoms.utils.ts +0 -15
- package/src/react-native/logger/rn-logger.ts +0 -51
- package/src/typedoc.ts +0 -35
- package/src/web/bridge/ReactNativeBridge.ts +0 -44
- package/src/web/generated/index.html +0 -18
- package/src/web/generated/index.ts +0 -17
- package/src/web/generated/webview_static_html.ts +0 -23528
- package/src/web/logger/web-logger.ts +0 -36
- package/src/web/maplibre-gl-js/MapController.ts +0 -322
package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMountOnLaunch.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PropsWithoutRef } from 'react';
|
|
2
|
-
import type { WebObjectType } from '
|
|
3
|
-
import type { WebObjectProps } from '
|
|
2
|
+
import type { WebObjectType } from '@ml/communication/messages.types';
|
|
3
|
+
import type { WebObjectProps } from '@ml/react-native/components-factory/createWebObjectAsComponent.types';
|
|
4
4
|
/**
|
|
5
5
|
* Mount the web object once the React Native one is mounted.
|
|
6
6
|
* @param props - The RN object props.
|
package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMountOnLaunch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWebObjectMountOnLaunch.d.ts","sourceRoot":"","sources":["../../../../../../src/react-native/components-factory/hooks/useWebObjectMountOnLaunch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAkC,MAAM,OAAO,CAAA;AAE5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useWebObjectMountOnLaunch.d.ts","sourceRoot":"","sources":["../../../../../../src/react-native/components-factory/hooks/useWebObjectMountOnLaunch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAkC,MAAM,OAAO,CAAA;AAE5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sEAAsE,CAAA;AAE1G;;;;;GAKG;AACH,QAAA,MAAM,yBAAyB,GAAI,KAAK,SAAS,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EACvE,OAAO,eAAe,CAAC,KAAK,CAAC,EAC7B,UAAU,MAAM,EAChB,YAAY,aAAa,SA8D1B,CAAA;AAED,eAAe,yBAAyB,CAAA"}
|
package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectOptionsUpdater.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { WebObjectType } from '
|
|
2
|
-
import type { WebObjectOptionsInferred, WebObjectProps, WebObjectListeners } from '
|
|
1
|
+
import type { WebObjectType } from '@ml/communication/messages.types';
|
|
2
|
+
import type { WebObjectOptionsInferred, WebObjectProps, WebObjectListeners } from '@ml/react-native/components-factory/createWebObjectAsComponent.types';
|
|
3
3
|
export declare const useWebObjectOptionsUpdater: <Options extends WebObjectOptionsInferred<WebObjectType>, Listeners extends WebObjectListeners>(props: WebObjectProps<Options, Listeners>, id: string, dispatchMessage: (msg: any) => void) => void;
|
|
4
4
|
export default useWebObjectOptionsUpdater;
|
|
5
5
|
//# sourceMappingURL=useWebObjectOptionsUpdater.d.ts.map
|
package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectOptionsUpdater.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWebObjectOptionsUpdater.d.ts","sourceRoot":"","sources":["../../../../../../src/react-native/components-factory/hooks/useWebObjectOptionsUpdater.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useWebObjectOptionsUpdater.d.ts","sourceRoot":"","sources":["../../../../../../src/react-native/components-factory/hooks/useWebObjectOptionsUpdater.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,KAAK,EACV,wBAAwB,EACxB,cAAc,EACd,kBAAkB,EACnB,MAAM,sEAAsE,CAAA;AAE7E,eAAO,MAAM,0BAA0B,GACrC,OAAO,SAAS,wBAAwB,CAAC,aAAa,CAAC,EACvD,SAAS,SAAS,kBAAkB,EAEpC,OAAO,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,EACzC,IAAI,MAAM,EACV,iBAAiB,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,SAYpC,CAAA;AAED,eAAe,0BAA0B,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WebView } from 'react-native-webview';
|
|
2
|
-
import type { MessageFromRNToWeb, WebObjectId } from '
|
|
3
|
-
import type { WebObjectListeners } from '
|
|
2
|
+
import type { MessageFromRNToWeb, WebObjectId } from '@ml/communication/messages.types';
|
|
3
|
+
import type { WebObjectListeners } from '@ml/react-native/components-factory/createWebObjectAsComponent.types';
|
|
4
4
|
/**
|
|
5
5
|
* The callbacks registered to react to web objects events.
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMapAtoms.d.ts","sourceRoot":"","sources":["../../../../../../src/react-native/hooks/atoms/useMapAtoms.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACZ,MAAM,
|
|
1
|
+
{"version":3,"file":"useMapAtoms.d.ts","sourceRoot":"","sources":["../../../../../../src/react-native/hooks/atoms/useMapAtoms.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACZ,MAAM,kCAAkC,CAAA;AAEzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sEAAsE,CAAA;AAqC9G;;GAEG;AACH,eAAO,MAAM,uBAAuB;;CAEnC,CAAA;AAiLD,QAAA,MAAM,WAAW;;;;;;;;;;mBAnFG,MAAM;iBAAW,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI;;;mBAaT,MAAM;gBAAU,GAAG;;;;kBAmCjD,WAAW;mBAAa,kBAAkB;;;kBAgB/B,WAAW;;;kBAYF,WAAW;;CAsCjD,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* @module Internal types
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
|
-
import type { WebObjectComponent, WebObjectRef, WebObjectProps, WebObjectListeners, WebObjectListenersDefault, WebObjectListenersWeb, WebObjectListenerOnRN, WebObjectListenerOnObject, WebObjectListenerOnMapLayer, WebObjectListenerOnHTMLElement, WebObjectOptionsInferred, WebObjectMethodsInferred } from '
|
|
6
|
+
import type { WebObjectComponent, WebObjectRef, WebObjectProps, WebObjectListeners, WebObjectListenersDefault, WebObjectListenersWeb, WebObjectListenerOnRN, WebObjectListenerOnObject, WebObjectListenerOnMapLayer, WebObjectListenerOnHTMLElement, WebObjectOptionsInferred, WebObjectMethodsInferred } from '@ml/react-native/components-factory/createWebObjectAsComponent.types';
|
|
7
7
|
export type { WebObjectComponent, WebObjectRef, WebObjectProps, WebObjectListeners, WebObjectListenersDefault, WebObjectListenersWeb, WebObjectListenerOnRN, WebObjectListenerOnObject, WebObjectListenerOnMapLayer, WebObjectListenerOnHTMLElement, WebObjectOptionsInferred, WebObjectMethodsInferred, };
|
|
8
8
|
//# sourceMappingURL=typedoc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedoc.d.ts","sourceRoot":"","sources":["../../../src/typedoc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,
|
|
1
|
+
{"version":3,"file":"typedoc.d.ts","sourceRoot":"","sources":["../../../src/typedoc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,sEAAsE,CAAA;AAE7E,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACxB,wBAAwB,GACzB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type MapController from '
|
|
2
|
-
import type { MessageFromWebToRN } from '
|
|
1
|
+
import type MapController from '@ml/web/maplibre-gl-js/MapController';
|
|
2
|
+
import type { MessageFromWebToRN } from '@ml/communication/messages.types';
|
|
3
3
|
/**
|
|
4
4
|
* From the web world, manage bidirectional communication with the React Native
|
|
5
5
|
* one by receiving and sending messages.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactNativeBridge.d.ts","sourceRoot":"","sources":["../../../../../src/web/bridge/ReactNativeBridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,
|
|
1
|
+
{"version":3,"file":"ReactNativeBridge.d.ts","sourceRoot":"","sources":["../../../../../src/web/bridge/ReactNativeBridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAEV,kBAAkB,EACnB,MAAM,kCAAkC,CAAA;AAGzC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;;;IAmBpC,IAAI,aAAa,CAAC,UAAU,EAAE,aAAa,EAE1C;IAED,IAAI,aAAa,IAAI,aAAa,GAAG,SAAS,CAE7C;IAED,WAAW,CAAC,OAAO,EAAE,kBAAkB;CAKxC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import maplibregl from 'maplibre-gl';
|
|
2
|
-
import type ReactNativeBridge from '
|
|
3
|
-
import { type MessageFromRNToWeb } from '
|
|
2
|
+
import type ReactNativeBridge from '@ml/web/bridge/ReactNativeBridge';
|
|
3
|
+
import { type MessageFromRNToWeb } from '@ml/communication/messages.types';
|
|
4
4
|
/**
|
|
5
5
|
* Manage the MapLibre GL JS map and its objects. Receive messages from the
|
|
6
6
|
* React Native world and act accordingly.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapController.d.ts","sourceRoot":"","sources":["../../../../../src/web/maplibre-gl-js/MapController.ts"],"names":[],"mappings":"AAAA,OAAO,UAAsC,MAAM,aAAa,CAAA;AAChE,OAAO,KAAK,iBAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"MapController.d.ts","sourceRoot":"","sources":["../../../../../src/web/maplibre-gl-js/MapController.ts"],"names":[],"mappings":"AAAA,OAAO,UAAsC,MAAM,aAAa,CAAA;AAChE,OAAO,KAAK,iBAAiB,MAAM,kCAAkC,CAAA;AACrE,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,kCAAkC,CAAA;AAYzC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,aAAa;;IAKhC,IAAI,iBAAiB,IAAI,iBAAiB,CAKzC;IAED,IAAI,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,EAE9C;IAED,IAAI,GAAG,IAAI,UAAU,CAAC,GAAG,CAMxB;IAED,aAAa,GAAI,SAAS,kBAAkB,UAiB3C;CAkQF"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-maplibre-gl-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "MapLibre GL JS for React Native",
|
|
5
|
+
"files": [
|
|
6
|
+
"lib",
|
|
7
|
+
"package.json",
|
|
8
|
+
"README.md",
|
|
9
|
+
"LICENSE"
|
|
10
|
+
],
|
|
5
11
|
"main": "./lib/module/index.js",
|
|
6
12
|
"types": "./lib/typescript/src/index.d.ts",
|
|
7
13
|
"exports": {
|
|
8
14
|
".": {
|
|
9
|
-
"source": "./src/index.ts",
|
|
10
15
|
"types": "./lib/typescript/src/index.d.ts",
|
|
11
16
|
"default": "./lib/module/index.js"
|
|
12
17
|
},
|
|
18
|
+
"./react-native/*": {
|
|
19
|
+
"types": "./lib/typescript/src/react-native/*",
|
|
20
|
+
"default": "./lib/module/react-native/*"
|
|
21
|
+
},
|
|
22
|
+
"./web/*": {
|
|
23
|
+
"types": "./lib/typescript/src/web/*",
|
|
24
|
+
"default": "./lib/module/web/*"
|
|
25
|
+
},
|
|
26
|
+
"./communication/*": {
|
|
27
|
+
"types": "./lib/typescript/src/communication/*",
|
|
28
|
+
"default": "./lib/module/communication/*"
|
|
29
|
+
},
|
|
13
30
|
"./package.json": "./package.json"
|
|
14
31
|
},
|
|
15
|
-
"files": [
|
|
16
|
-
"src",
|
|
17
|
-
"lib",
|
|
18
|
-
"!**/.*",
|
|
19
|
-
"!**/*tests*",
|
|
20
|
-
"!**/*fixtures*",
|
|
21
|
-
"!**/*mocks*"
|
|
22
|
-
],
|
|
23
32
|
"scripts": {
|
|
24
33
|
"build:webview": "node scripts/build.js",
|
|
25
34
|
"example": "yarn workspace react-native-maplibre-gl-js-example",
|
|
@@ -102,10 +111,6 @@
|
|
|
102
111
|
{
|
|
103
112
|
"path": "CHANGELOG.md",
|
|
104
113
|
"label": "Changelog"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"path": "*.tgz",
|
|
108
|
-
"label": "NPM package (.tgz)"
|
|
109
114
|
}
|
|
110
115
|
]
|
|
111
116
|
}
|
|
@@ -171,6 +176,7 @@
|
|
|
171
176
|
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
172
177
|
"@types/jest": "^29.5.14",
|
|
173
178
|
"@types/react": "^19.1.12",
|
|
179
|
+
"babel-plugin-module-resolver": "^5.0.2",
|
|
174
180
|
"commitlint": "^19.8.1",
|
|
175
181
|
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
176
182
|
"del-cli": "^6.0.0",
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Map as MapLibreMap,
|
|
3
|
-
Marker as MapLibreMarker,
|
|
4
|
-
Popup as MapLibrePopup,
|
|
5
|
-
} from 'maplibre-gl'
|
|
6
|
-
import type {
|
|
7
|
-
WebObjectOptionsInferred,
|
|
8
|
-
WebObjectListeners,
|
|
9
|
-
} from 'react-native-maplibre-gl-js/react-native/components-factory/createWebObjectAsComponent.types'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The web objects that are supported by this library.
|
|
13
|
-
* A string version to be used as an identifier on the RN side (cannot use
|
|
14
|
-
* MapLibre classes directly).
|
|
15
|
-
* Must correspond to `WebObjectClass`.
|
|
16
|
-
*/
|
|
17
|
-
export type WebObjectType = 'map' | 'marker' | 'popup'
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* The web objects that are supported by this library.
|
|
21
|
-
* A class version to be used on the web side.
|
|
22
|
-
* Must correspond to `WebObjectType`.
|
|
23
|
-
*/
|
|
24
|
-
export type WebObjectClass = MapLibreMap | MapLibreMarker | MapLibrePopup
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* UID of a web object in the web world.
|
|
28
|
-
*/
|
|
29
|
-
export type WebObjectId = string
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* UID of a request for a web object method to be executed.
|
|
33
|
-
*/
|
|
34
|
-
export type WebObjectMethodCallRequestId = string
|
|
35
|
-
|
|
36
|
-
export type MessageFromRNToWeb =
|
|
37
|
-
/**
|
|
38
|
-
* TODO Messages about a MapLibre object.
|
|
39
|
-
*/
|
|
40
|
-
| {
|
|
41
|
-
type: 'webObjectMount'
|
|
42
|
-
payload: {
|
|
43
|
-
objectId: WebObjectId
|
|
44
|
-
objectType: WebObjectType
|
|
45
|
-
options: WebObjectOptionsInferred<any>
|
|
46
|
-
listeners: WebObjectListeners
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
| {
|
|
50
|
-
type: 'webObjectUnmount'
|
|
51
|
-
payload: {
|
|
52
|
-
objectId: WebObjectId
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
| {
|
|
56
|
-
type: 'webObjectMethodCall'
|
|
57
|
-
payload: {
|
|
58
|
-
requestId: WebObjectMethodCallRequestId
|
|
59
|
-
objectId: WebObjectId
|
|
60
|
-
method: string
|
|
61
|
-
args: any[]
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
| {
|
|
65
|
-
type: 'webObjectOptionsUpdate'
|
|
66
|
-
payload: {
|
|
67
|
-
objectId: WebObjectId
|
|
68
|
-
options: WebObjectOptionsInferred<any>
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export type MessageFromWebToRN =
|
|
73
|
-
/**
|
|
74
|
-
* Anything that should be logged in the React Native world.
|
|
75
|
-
*/
|
|
76
|
-
| {
|
|
77
|
-
type: 'console'
|
|
78
|
-
payload: {
|
|
79
|
-
level: 'debug' | 'info' | 'error'
|
|
80
|
-
args: [string, ...any[]]
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Notify the React Native world that the web one is ready.
|
|
85
|
-
*/
|
|
86
|
-
| {
|
|
87
|
-
type: 'ready'
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Event issued by a web object, eligible to be listened to from the RN world.
|
|
91
|
-
*/
|
|
92
|
-
| {
|
|
93
|
-
type: 'webObjectListenerEvent'
|
|
94
|
-
payload: {
|
|
95
|
-
objectId: WebObjectId
|
|
96
|
-
eventName: keyof WebObjectListeners
|
|
97
|
-
event?: any
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Response to a call to a method of a web object.
|
|
102
|
-
*/
|
|
103
|
-
| {
|
|
104
|
-
type: 'webObjectMethodResponse'
|
|
105
|
-
payload: {
|
|
106
|
-
requestId: WebObjectMethodCallRequestId
|
|
107
|
-
result: any
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* To replace HTMLElement instances that cannot be created in React Native.
|
|
113
|
-
*/
|
|
114
|
-
export type HTMLElementDescriptor = {
|
|
115
|
-
tagName?: string
|
|
116
|
-
className?: string
|
|
117
|
-
attributes?: Record<string, string>
|
|
118
|
-
style?: Record<string, string>
|
|
119
|
-
dataset?: Record<string, string>
|
|
120
|
-
innerHTML?: string
|
|
121
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
WebObjectListenerOnHTMLElement,
|
|
3
|
-
WebObjectListenerOnMapLayer,
|
|
4
|
-
WebObjectListenerOnObject,
|
|
5
|
-
WebObjectListenerOnRN,
|
|
6
|
-
} from 'react-native-maplibre-gl-js/react-native/components-factory/createWebObjectAsComponent.types'
|
|
7
|
-
|
|
8
|
-
export const isWebObjectListenerOnRN = (
|
|
9
|
-
listener?:
|
|
10
|
-
| WebObjectListenerOnRN<any>
|
|
11
|
-
| WebObjectListenerOnObject<any>
|
|
12
|
-
| WebObjectListenerOnHTMLElement<any>
|
|
13
|
-
| WebObjectListenerOnMapLayer<any>,
|
|
14
|
-
): boolean => {
|
|
15
|
-
if (!listener) {
|
|
16
|
-
return false
|
|
17
|
-
}
|
|
18
|
-
return 'rnListener' in listener
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const isWebObjectListenerOnObject = (
|
|
22
|
-
listener?:
|
|
23
|
-
| WebObjectListenerOnRN<any>
|
|
24
|
-
| WebObjectListenerOnObject<any>
|
|
25
|
-
| WebObjectListenerOnHTMLElement<any>
|
|
26
|
-
| WebObjectListenerOnMapLayer<any>,
|
|
27
|
-
): boolean => {
|
|
28
|
-
if (!listener) {
|
|
29
|
-
return false
|
|
30
|
-
}
|
|
31
|
-
return 'objectListener' in listener
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const isWebObjectListenerOnMapLayer = (
|
|
35
|
-
listener?:
|
|
36
|
-
| WebObjectListenerOnRN<any>
|
|
37
|
-
| WebObjectListenerOnObject<any>
|
|
38
|
-
| WebObjectListenerOnHTMLElement<any>
|
|
39
|
-
| WebObjectListenerOnMapLayer<any>,
|
|
40
|
-
): boolean => {
|
|
41
|
-
if (!listener) {
|
|
42
|
-
return false
|
|
43
|
-
}
|
|
44
|
-
return 'layerListener' in listener
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export const isWebObjectListenerOnHTMLElement = (
|
|
48
|
-
listener?:
|
|
49
|
-
| WebObjectListenerOnRN<any>
|
|
50
|
-
| WebObjectListenerOnObject<any>
|
|
51
|
-
| WebObjectListenerOnHTMLElement<any>
|
|
52
|
-
| WebObjectListenerOnMapLayer<any>,
|
|
53
|
-
): boolean => {
|
|
54
|
-
if (!listener) {
|
|
55
|
-
return false
|
|
56
|
-
}
|
|
57
|
-
return 'elementListener' in listener
|
|
58
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public API of react-native-maplibre-gl-js.
|
|
3
|
-
* @module Public API
|
|
4
|
-
* @packageDocumentation
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { MapProviderProps } from 'react-native-maplibre-gl-js/react-native/components/MapProvider/MapProvider.types'
|
|
8
|
-
import type {
|
|
9
|
-
MapRef,
|
|
10
|
-
MapProps,
|
|
11
|
-
} from 'react-native-maplibre-gl-js/react-native/components/Map/Map.types'
|
|
12
|
-
import type {
|
|
13
|
-
MarkerRef,
|
|
14
|
-
MarkerProps,
|
|
15
|
-
} from 'react-native-maplibre-gl-js/react-native/components/Marker/Marker.types'
|
|
16
|
-
import type {
|
|
17
|
-
PopupRef,
|
|
18
|
-
PopupProps,
|
|
19
|
-
} from 'react-native-maplibre-gl-js/react-native/components/Popup/Popup.types'
|
|
20
|
-
|
|
21
|
-
export type { MapProviderProps }
|
|
22
|
-
export type { MapRef, MapProps }
|
|
23
|
-
export type { MarkerRef, MarkerProps }
|
|
24
|
-
export type { PopupRef, PopupProps }
|
|
25
|
-
|
|
26
|
-
import MapProvider from 'react-native-maplibre-gl-js/react-native/components/MapProvider/MapProvider'
|
|
27
|
-
import Map from 'react-native-maplibre-gl-js/react-native/components/Map/Map'
|
|
28
|
-
import Marker from 'react-native-maplibre-gl-js/react-native/components/Marker/Marker'
|
|
29
|
-
import Popup from 'react-native-maplibre-gl-js/react-native/components/Popup/Popup'
|
|
30
|
-
|
|
31
|
-
export { MapProvider, Map, Marker, Popup }
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import createWebObjectAsComponent from 'react-native-maplibre-gl-js/react-native/components-factory/createWebObjectAsComponent'
|
|
2
|
-
import type {
|
|
3
|
-
MapRef,
|
|
4
|
-
MapProps,
|
|
5
|
-
} from 'react-native-maplibre-gl-js/react-native/components/Map/Map.types'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* MapLibre Map view.
|
|
9
|
-
* @see {@link https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/ MapLibre GL JS docs}
|
|
10
|
-
* @group Components
|
|
11
|
-
*/
|
|
12
|
-
const Map = createWebObjectAsComponent<MapRef, MapProps>('map')
|
|
13
|
-
|
|
14
|
-
export default Map
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type Map as MapLibreMap,
|
|
3
|
-
type MapContextEvent,
|
|
4
|
-
type MapLayerMouseEvent,
|
|
5
|
-
type MapLayerTouchEvent,
|
|
6
|
-
type MapLibreEvent,
|
|
7
|
-
type MapLibreZoomEvent,
|
|
8
|
-
type MapOptions as MapLibreMapOptions,
|
|
9
|
-
MapTouchEvent,
|
|
10
|
-
MapWheelEvent,
|
|
11
|
-
ErrorEvent,
|
|
12
|
-
type MapDataEvent,
|
|
13
|
-
type MapStyleDataEvent,
|
|
14
|
-
type MapSourceDataEvent,
|
|
15
|
-
type MapStyleImageMissingEvent,
|
|
16
|
-
} from 'maplibre-gl'
|
|
17
|
-
import type {
|
|
18
|
-
WebObjectMethodsInferred,
|
|
19
|
-
WebObjectOptionsInferred,
|
|
20
|
-
WebObjectListenerOnMapLayer,
|
|
21
|
-
WebObjectListenerOnObject,
|
|
22
|
-
WebObjectListenerOnRN,
|
|
23
|
-
WebObjectProps,
|
|
24
|
-
WebObjectRef,
|
|
25
|
-
} from 'react-native-maplibre-gl-js/react-native/components-factory/createWebObjectAsComponent.types'
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* A Map component ref.
|
|
29
|
-
* @group Types
|
|
30
|
-
*/
|
|
31
|
-
export type MapRef = WebObjectRef<MapMethods>
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* A Map component props.
|
|
35
|
-
* @group Types
|
|
36
|
-
*/
|
|
37
|
-
export type MapProps = WebObjectProps<MapOptions, MapListeners>
|
|
38
|
-
|
|
39
|
-
type MapMethods = WebObjectMethodsInferred<MapLibreMap>
|
|
40
|
-
type MapOptions = WebObjectOptionsInferred<MapLibreMapOptions, {}, 'container'>
|
|
41
|
-
type MapListeners = {
|
|
42
|
-
// React native events.
|
|
43
|
-
mount: WebObjectListenerOnRN<void>
|
|
44
|
-
unmount: WebObjectListenerOnRN<void>
|
|
45
|
-
// MapLibre GL JS events.
|
|
46
|
-
// https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#on
|
|
47
|
-
mousedown:
|
|
48
|
-
| WebObjectListenerOnObject<MapLayerMouseEvent>
|
|
49
|
-
| WebObjectListenerOnMapLayer<MapLayerMouseEvent>
|
|
50
|
-
mouseup:
|
|
51
|
-
| WebObjectListenerOnObject<MapLayerMouseEvent>
|
|
52
|
-
| WebObjectListenerOnMapLayer<MapLayerMouseEvent>
|
|
53
|
-
mouseover:
|
|
54
|
-
| WebObjectListenerOnObject<MapLayerMouseEvent>
|
|
55
|
-
| WebObjectListenerOnMapLayer<MapLayerMouseEvent>
|
|
56
|
-
mouseout:
|
|
57
|
-
| WebObjectListenerOnObject<MapLayerMouseEvent>
|
|
58
|
-
| WebObjectListenerOnMapLayer<MapLayerMouseEvent>
|
|
59
|
-
mousemove:
|
|
60
|
-
| WebObjectListenerOnObject<MapLayerMouseEvent>
|
|
61
|
-
| WebObjectListenerOnMapLayer<MapLayerMouseEvent>
|
|
62
|
-
mouseenter: WebObjectListenerOnMapLayer<MapLayerMouseEvent>
|
|
63
|
-
mouseleave: WebObjectListenerOnMapLayer<MapLayerMouseEvent>
|
|
64
|
-
click:
|
|
65
|
-
| WebObjectListenerOnObject<MapLayerMouseEvent>
|
|
66
|
-
| WebObjectListenerOnMapLayer<MapLayerMouseEvent>
|
|
67
|
-
dblclick:
|
|
68
|
-
| WebObjectListenerOnObject<MapLayerMouseEvent>
|
|
69
|
-
| WebObjectListenerOnMapLayer<MapLayerMouseEvent>
|
|
70
|
-
contextmenu:
|
|
71
|
-
| WebObjectListenerOnObject<MapLayerMouseEvent>
|
|
72
|
-
| WebObjectListenerOnMapLayer<MapLayerMouseEvent>
|
|
73
|
-
touchstart:
|
|
74
|
-
| WebObjectListenerOnObject<MapLayerTouchEvent>
|
|
75
|
-
| WebObjectListenerOnMapLayer<MapLayerTouchEvent>
|
|
76
|
-
touchend:
|
|
77
|
-
| WebObjectListenerOnObject<MapLayerTouchEvent>
|
|
78
|
-
| WebObjectListenerOnMapLayer<MapLayerTouchEvent>
|
|
79
|
-
touchcancel:
|
|
80
|
-
| WebObjectListenerOnObject<MapLayerTouchEvent>
|
|
81
|
-
| WebObjectListenerOnMapLayer<MapLayerTouchEvent>
|
|
82
|
-
wheel: WebObjectListenerOnObject<MapWheelEvent>
|
|
83
|
-
resize: WebObjectListenerOnObject<MapLibreEvent>
|
|
84
|
-
remove: WebObjectListenerOnObject<MapLibreEvent>
|
|
85
|
-
touchmove: WebObjectListenerOnObject<MapTouchEvent>
|
|
86
|
-
movestart: WebObjectListenerOnObject<
|
|
87
|
-
MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>
|
|
88
|
-
>
|
|
89
|
-
move: WebObjectListenerOnObject<
|
|
90
|
-
MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>
|
|
91
|
-
>
|
|
92
|
-
moveend: WebObjectListenerOnObject<
|
|
93
|
-
MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>
|
|
94
|
-
>
|
|
95
|
-
dragstart: WebObjectListenerOnObject<
|
|
96
|
-
MapLibreEvent<MouseEvent | TouchEvent | undefined>
|
|
97
|
-
>
|
|
98
|
-
drag: WebObjectListenerOnObject<
|
|
99
|
-
MapLibreEvent<MouseEvent | TouchEvent | undefined>
|
|
100
|
-
>
|
|
101
|
-
dragend: WebObjectListenerOnObject<
|
|
102
|
-
MapLibreEvent<MouseEvent | TouchEvent | undefined>
|
|
103
|
-
>
|
|
104
|
-
zoomstart: WebObjectListenerOnObject<
|
|
105
|
-
MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>
|
|
106
|
-
>
|
|
107
|
-
zoom: WebObjectListenerOnObject<
|
|
108
|
-
MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>
|
|
109
|
-
>
|
|
110
|
-
zoomend: WebObjectListenerOnObject<
|
|
111
|
-
MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>
|
|
112
|
-
>
|
|
113
|
-
rotatestart: WebObjectListenerOnObject<
|
|
114
|
-
MapLibreEvent<MouseEvent | TouchEvent | undefined>
|
|
115
|
-
>
|
|
116
|
-
rotate: WebObjectListenerOnObject<
|
|
117
|
-
MapLibreEvent<MouseEvent | TouchEvent | undefined>
|
|
118
|
-
>
|
|
119
|
-
rotateend: WebObjectListenerOnObject<
|
|
120
|
-
MapLibreEvent<MouseEvent | TouchEvent | undefined>
|
|
121
|
-
>
|
|
122
|
-
pitchstart: WebObjectListenerOnObject<
|
|
123
|
-
MapLibreEvent<MouseEvent | TouchEvent | undefined>
|
|
124
|
-
>
|
|
125
|
-
pitch: WebObjectListenerOnObject<
|
|
126
|
-
MapLibreEvent<MouseEvent | TouchEvent | undefined>
|
|
127
|
-
>
|
|
128
|
-
pitchend: WebObjectListenerOnObject<
|
|
129
|
-
MapLibreEvent<MouseEvent | TouchEvent | undefined>
|
|
130
|
-
>
|
|
131
|
-
boxzoomstart: WebObjectListenerOnObject<MapLibreZoomEvent>
|
|
132
|
-
boxzoomend: WebObjectListenerOnObject<MapLibreZoomEvent>
|
|
133
|
-
boxzoomcancel: WebObjectListenerOnObject<MapLibreZoomEvent>
|
|
134
|
-
webglcontextlost: WebObjectListenerOnObject<MapContextEvent>
|
|
135
|
-
webglcontextrestored: WebObjectListenerOnObject<MapContextEvent>
|
|
136
|
-
load: WebObjectListenerOnObject<MapLibreEvent>
|
|
137
|
-
render: WebObjectListenerOnObject<MapLibreEvent>
|
|
138
|
-
idle: WebObjectListenerOnObject<MapLibreEvent>
|
|
139
|
-
error: WebObjectListenerOnObject<ErrorEvent>
|
|
140
|
-
data: WebObjectListenerOnObject<MapDataEvent>
|
|
141
|
-
styledata: WebObjectListenerOnObject<MapStyleDataEvent>
|
|
142
|
-
sourcedata: WebObjectListenerOnObject<MapSourceDataEvent>
|
|
143
|
-
dataloading: WebObjectListenerOnObject<MapDataEvent>
|
|
144
|
-
styledataloading: WebObjectListenerOnObject<MapStyleDataEvent>
|
|
145
|
-
sourcedataloading: WebObjectListenerOnObject<MapSourceDataEvent>
|
|
146
|
-
styleimagemissing: WebObjectListenerOnObject<MapStyleImageMissingEvent>
|
|
147
|
-
dataabort: WebObjectListenerOnObject<MapDataEvent>
|
|
148
|
-
sourcedataabort: WebObjectListenerOnObject<MapSourceDataEvent>
|
|
149
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from 'react-native'
|
|
2
|
-
import { useMemo } from 'react'
|
|
3
|
-
|
|
4
|
-
export const useStyles = () => {
|
|
5
|
-
return useMemo(
|
|
6
|
-
() =>
|
|
7
|
-
StyleSheet.create({
|
|
8
|
-
container: { width: '100%', height: '100%', overflow: 'hidden' },
|
|
9
|
-
webview: { flex: 1, backgroundColor: 'transparent' },
|
|
10
|
-
}),
|
|
11
|
-
[],
|
|
12
|
-
)
|
|
13
|
-
}
|