react-native-maplibre-gl-js 1.3.1 → 1.4.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/module/index.js +10 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/react-native/components/{MapProvider → core/MapProvider}/MapProvider.hooks.js +23 -6
- package/lib/module/react-native/components/core/MapProvider/MapProvider.hooks.js.map +1 -0
- package/lib/module/react-native/components/{MapProvider → core/MapProvider}/MapProvider.js +3 -3
- package/lib/module/react-native/components/core/MapProvider/MapProvider.js.map +1 -0
- package/lib/module/react-native/components/{MapProvider → core/MapProvider}/MapProvider.test.unit.js +28 -3
- package/lib/module/react-native/components/core/MapProvider/MapProvider.test.unit.js.map +1 -0
- package/lib/module/react-native/components/core/MapProvider/MapProvider.types.js.map +1 -0
- package/lib/module/react-native/components/core/MapProvider/MapProvider.utils.js.map +1 -0
- package/lib/module/react-native/components/map-sources/GeoJSONSource/GeoJSONSource.js +16 -0
- package/lib/module/react-native/components/map-sources/GeoJSONSource/GeoJSONSource.js.map +1 -0
- package/lib/module/react-native/components/map-sources/GeoJSONSource/GeoJSONSource.types.js +4 -0
- package/lib/module/react-native/components/map-sources/GeoJSONSource/GeoJSONSource.types.js.map +1 -0
- package/lib/module/react-native/components/{Map → web-objects/Map}/Map.js +2 -1
- package/lib/module/react-native/components/web-objects/Map/Map.js.map +1 -0
- package/lib/module/react-native/components/web-objects/Map/Map.test.unit.js.map +1 -0
- package/lib/module/react-native/components/web-objects/Map/Map.types.js.map +1 -0
- package/lib/module/react-native/components/{Marker → web-objects/Marker}/Marker.js +1 -1
- package/lib/module/react-native/components/web-objects/Marker/Marker.js.map +1 -0
- package/lib/module/react-native/components/web-objects/Marker/Marker.test.unit.js.map +1 -0
- package/lib/module/react-native/components/web-objects/Marker/Marker.types.js.map +1 -0
- package/lib/module/react-native/components/{Popup → web-objects/Popup}/Popup.js +1 -1
- package/lib/module/react-native/components/web-objects/Popup/Popup.js.map +1 -0
- package/lib/module/react-native/components/web-objects/Popup/Popup.test.unit.js.map +1 -0
- package/lib/module/react-native/components/web-objects/Popup/Popup.types.js.map +1 -0
- package/lib/module/react-native/components-factories/map-sources/createMapSourceAsComponent.js +13 -0
- package/lib/module/react-native/components-factories/map-sources/createMapSourceAsComponent.js.map +1 -0
- package/lib/module/react-native/components-factories/map-sources/createMapSourceAsComponent.types.js +4 -0
- package/lib/module/react-native/components-factories/map-sources/createMapSourceAsComponent.types.js.map +1 -0
- package/lib/module/react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountCallbacks.js +69 -0
- package/lib/module/react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountCallbacks.js.map +1 -0
- package/lib/module/react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountWithProps.js +48 -0
- package/lib/module/react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountWithProps.js.map +1 -0
- package/lib/module/react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountWithProps.mock.js +5 -0
- package/lib/module/react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountWithProps.mock.js.map +1 -0
- package/lib/module/react-native/components-factories/web-objects/createWebObjectAsComponent.js.map +1 -0
- package/lib/module/react-native/{components-factory → components-factories/web-objects}/createWebObjectAsComponent.test.integration.js +2 -2
- package/lib/module/react-native/components-factories/web-objects/createWebObjectAsComponent.test.integration.js.map +1 -0
- package/lib/module/react-native/components-factories/web-objects/createWebObjectAsComponent.test.unit.js.map +1 -0
- package/lib/module/react-native/components-factories/web-objects/createWebObjectAsComponent.types.js.map +1 -0
- package/lib/module/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMethodsProxy.js +1 -1
- package/lib/module/react-native/components-factories/web-objects/hooks/useWebObjectMethodsProxy.js.map +1 -0
- package/lib/module/react-native/components-factories/web-objects/hooks/useWebObjectMethodsProxy.mock.js.map +1 -0
- package/lib/module/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMountUnmountCallbacks.js +3 -3
- package/lib/module/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountCallbacks.js.map +1 -0
- package/lib/module/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountCallbacks.mock.js.map +1 -0
- package/lib/module/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountCallbacks.test.unit.js +202 -0
- package/lib/module/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountCallbacks.test.unit.js.map +1 -0
- package/lib/module/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountCallbacks.types.js.map +1 -0
- package/lib/module/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMountUnmountWithProps.js +3 -3
- package/lib/module/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountWithProps.js.map +1 -0
- package/lib/module/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountWithProps.mock.js.map +1 -0
- package/lib/module/react-native/hooks/atoms/useMapAtoms.js +45 -2
- package/lib/module/react-native/hooks/atoms/useMapAtoms.js.map +1 -1
- package/lib/module/react-native/hooks/atoms/useMapAtoms.mock.js +12 -0
- package/lib/module/react-native/hooks/atoms/useMapAtoms.mock.js.map +1 -1
- package/lib/module/react-native/hooks/atoms/useMapAtoms.test.unit.js +184 -0
- package/lib/module/react-native/hooks/atoms/useMapAtoms.test.unit.js.map +1 -0
- package/lib/module/web/bridge/ReactNativeBridge.js +12 -7
- package/lib/module/web/bridge/ReactNativeBridge.js.map +1 -1
- package/lib/module/web/controllers/CoreController.js +61 -0
- package/lib/module/web/controllers/CoreController.js.map +1 -0
- package/lib/module/web/controllers/MapSourcesController.js +113 -0
- package/lib/module/web/controllers/MapSourcesController.js.map +1 -0
- package/lib/module/web/{maplibre-gl-js/MapController.js → controllers/WebObjectsController.js} +42 -72
- package/lib/module/web/controllers/WebObjectsController.js.map +1 -0
- package/lib/module/web/generated/index.js +3 -4
- package/lib/module/web/generated/index.js.map +1 -1
- package/lib/module/web/generated/webview_static_html.js +237 -82
- package/lib/module/web/generated/webview_static_html.js.map +1 -1
- package/lib/typescript/src/communication/messages.types.d.ts +23 -23
- 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 +10 -8
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/react-native/components/{MapProvider → core/MapProvider}/MapProvider.d.ts +1 -1
- package/lib/typescript/src/react-native/components/core/MapProvider/MapProvider.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/core/MapProvider/MapProvider.hooks.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/core/MapProvider/MapProvider.test.unit.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/{MapProvider → core/MapProvider}/MapProvider.types.d.ts +1 -1
- package/lib/typescript/src/react-native/components/core/MapProvider/MapProvider.types.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/core/MapProvider/MapProvider.utils.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/map-sources/GeoJSONSource/GeoJSONSource.d.ts +13 -0
- package/lib/typescript/src/react-native/components/map-sources/GeoJSONSource/GeoJSONSource.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/map-sources/GeoJSONSource/GeoJSONSource.types.d.ts +8 -0
- package/lib/typescript/src/react-native/components/map-sources/GeoJSONSource/GeoJSONSource.types.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/{Map → web-objects/Map}/Map.d.ts +1 -1
- package/lib/typescript/src/react-native/components/web-objects/Map/Map.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/web-objects/Map/Map.test.unit.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/{Map → web-objects/Map}/Map.types.d.ts +1 -1
- package/lib/typescript/src/react-native/components/web-objects/Map/Map.types.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/{Marker → web-objects/Marker}/Marker.d.ts +1 -1
- package/lib/typescript/src/react-native/components/web-objects/Marker/Marker.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/web-objects/Marker/Marker.test.unit.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/{Marker → web-objects/Marker}/Marker.types.d.ts +2 -2
- package/lib/typescript/src/react-native/components/web-objects/Marker/Marker.types.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/{Popup → web-objects/Popup}/Popup.d.ts +1 -1
- package/lib/typescript/src/react-native/components/web-objects/Popup/Popup.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/web-objects/Popup/Popup.test.unit.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components/{Popup → web-objects/Popup}/Popup.types.d.ts +1 -1
- package/lib/typescript/src/react-native/components/web-objects/Popup/Popup.types.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components-factories/map-sources/createMapSourceAsComponent.d.ts +4 -0
- package/lib/typescript/src/react-native/components-factories/map-sources/createMapSourceAsComponent.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components-factories/map-sources/createMapSourceAsComponent.types.d.ts +88 -0
- package/lib/typescript/src/react-native/components-factories/map-sources/createMapSourceAsComponent.types.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountCallbacks.d.ts +14 -0
- package/lib/typescript/src/react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountCallbacks.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountWithProps.d.ts +10 -0
- package/lib/typescript/src/react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountWithProps.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountWithProps.mock.d.ts +3 -0
- package/lib/typescript/src/react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountWithProps.mock.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components-factories/web-objects/createWebObjectAsComponent.d.ts +4 -0
- package/lib/typescript/src/react-native/components-factories/web-objects/createWebObjectAsComponent.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components-factories/web-objects/createWebObjectAsComponent.test.integration.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components-factories/web-objects/createWebObjectAsComponent.test.unit.d.ts.map +1 -0
- package/lib/typescript/src/react-native/{components-factory → components-factories/web-objects}/createWebObjectAsComponent.types.d.ts +29 -3
- package/lib/typescript/src/react-native/components-factories/web-objects/createWebObjectAsComponent.types.d.ts.map +1 -0
- package/lib/typescript/src/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMethodsProxy.d.ts +2 -2
- package/lib/typescript/src/react-native/components-factories/web-objects/hooks/useWebObjectMethodsProxy.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components-factories/web-objects/hooks/useWebObjectMethodsProxy.mock.d.ts.map +1 -0
- package/lib/typescript/src/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMountUnmountCallbacks.d.ts +1 -2
- package/lib/typescript/src/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountCallbacks.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountCallbacks.mock.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountCallbacks.test.unit.d.ts +2 -0
- package/lib/typescript/src/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountCallbacks.test.unit.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountCallbacks.types.d.ts.map +1 -0
- package/lib/typescript/src/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMountUnmountWithProps.d.ts +2 -3
- package/lib/typescript/src/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountWithProps.d.ts.map +1 -0
- package/lib/typescript/src/react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountWithProps.mock.d.ts.map +1 -0
- package/lib/typescript/src/react-native/hooks/atoms/useMapAtoms.d.ts +31 -4
- package/lib/typescript/src/react-native/hooks/atoms/useMapAtoms.d.ts.map +1 -1
- package/lib/typescript/src/react-native/hooks/atoms/useMapAtoms.mock.d.ts +12 -0
- package/lib/typescript/src/react-native/hooks/atoms/useMapAtoms.mock.d.ts.map +1 -1
- package/lib/typescript/src/react-native/hooks/atoms/useMapAtoms.test.unit.d.ts +2 -0
- package/lib/typescript/src/react-native/hooks/atoms/useMapAtoms.test.unit.d.ts.map +1 -0
- package/lib/typescript/src/typedoc.d.ts +4 -4
- package/lib/typescript/src/typedoc.d.ts.map +1 -1
- package/lib/typescript/src/web/bridge/ReactNativeBridge.d.ts +7 -3
- package/lib/typescript/src/web/bridge/ReactNativeBridge.d.ts.map +1 -1
- package/lib/typescript/src/web/controllers/CoreController.d.ts +13 -0
- package/lib/typescript/src/web/controllers/CoreController.d.ts.map +1 -0
- package/lib/typescript/src/web/controllers/MapSourcesController.d.ts +14 -0
- package/lib/typescript/src/web/controllers/MapSourcesController.d.ts.map +1 -0
- package/lib/typescript/src/web/controllers/WebObjectsController.d.ts +18 -0
- package/lib/typescript/src/web/controllers/WebObjectsController.d.ts.map +1 -0
- package/lib/typescript/src/web/generated/webview_static_html.d.ts +1 -1
- package/lib/typescript/src/web/generated/webview_static_html.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/module/react-native/components/Map/Map.js.map +0 -1
- package/lib/module/react-native/components/Map/Map.test.unit.js.map +0 -1
- package/lib/module/react-native/components/Map/Map.types.js.map +0 -1
- package/lib/module/react-native/components/MapProvider/MapProvider.hooks.js.map +0 -1
- package/lib/module/react-native/components/MapProvider/MapProvider.js.map +0 -1
- package/lib/module/react-native/components/MapProvider/MapProvider.test.unit.js.map +0 -1
- package/lib/module/react-native/components/MapProvider/MapProvider.types.js.map +0 -1
- package/lib/module/react-native/components/MapProvider/MapProvider.utils.js.map +0 -1
- package/lib/module/react-native/components/Marker/Marker.js.map +0 -1
- package/lib/module/react-native/components/Marker/Marker.test.unit.js.map +0 -1
- package/lib/module/react-native/components/Marker/Marker.types.js.map +0 -1
- package/lib/module/react-native/components/Popup/Popup.js.map +0 -1
- package/lib/module/react-native/components/Popup/Popup.test.unit.js.map +0 -1
- package/lib/module/react-native/components/Popup/Popup.types.js.map +0 -1
- package/lib/module/react-native/components-factory/createWebObjectAsComponent.js.map +0 -1
- package/lib/module/react-native/components-factory/createWebObjectAsComponent.test.integration.js.map +0 -1
- package/lib/module/react-native/components-factory/createWebObjectAsComponent.test.unit.js.map +0 -1
- package/lib/module/react-native/components-factory/createWebObjectAsComponent.types.js.map +0 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMethodsProxy.js.map +0 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMethodsProxy.mock.js.map +0 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMountUnmountCallbacks.js.map +0 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMountUnmountCallbacks.mock.js.map +0 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMountUnmountCallbacks.types.js.map +0 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMountUnmountWithProps.js.map +0 -1
- package/lib/module/react-native/components-factory/hooks/useWebObjectMountUnmountWithProps.mock.js.map +0 -1
- package/lib/module/web/maplibre-gl-js/MapController.js.map +0 -1
- package/lib/typescript/src/react-native/components/Map/Map.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components/Map/Map.test.unit.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components/Map/Map.types.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components/MapProvider/MapProvider.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components/MapProvider/MapProvider.hooks.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components/MapProvider/MapProvider.test.unit.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components/MapProvider/MapProvider.types.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components/MapProvider/MapProvider.utils.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components/Marker/Marker.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components/Marker/Marker.test.unit.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components/Marker/Marker.types.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components/Popup/Popup.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components/Popup/Popup.test.unit.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components/Popup/Popup.types.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components-factory/createWebObjectAsComponent.d.ts +0 -5
- package/lib/typescript/src/react-native/components-factory/createWebObjectAsComponent.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components-factory/createWebObjectAsComponent.test.integration.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components-factory/createWebObjectAsComponent.test.unit.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components-factory/createWebObjectAsComponent.types.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMethodsProxy.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMethodsProxy.mock.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMountUnmountCallbacks.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMountUnmountCallbacks.mock.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMountUnmountCallbacks.types.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMountUnmountWithProps.d.ts.map +0 -1
- package/lib/typescript/src/react-native/components-factory/hooks/useWebObjectMountUnmountWithProps.mock.d.ts.map +0 -1
- package/lib/typescript/src/web/maplibre-gl-js/MapController.d.ts +0 -15
- package/lib/typescript/src/web/maplibre-gl-js/MapController.d.ts.map +0 -1
- /package/lib/module/react-native/components/{MapProvider → core/MapProvider}/MapProvider.types.js +0 -0
- /package/lib/module/react-native/components/{MapProvider → core/MapProvider}/MapProvider.utils.js +0 -0
- /package/lib/module/react-native/components/{Map → web-objects/Map}/Map.test.unit.js +0 -0
- /package/lib/module/react-native/components/{Map → web-objects/Map}/Map.types.js +0 -0
- /package/lib/module/react-native/components/{Marker → web-objects/Marker}/Marker.test.unit.js +0 -0
- /package/lib/module/react-native/components/{Marker → web-objects/Marker}/Marker.types.js +0 -0
- /package/lib/module/react-native/components/{Popup → web-objects/Popup}/Popup.test.unit.js +0 -0
- /package/lib/module/react-native/components/{Popup → web-objects/Popup}/Popup.types.js +0 -0
- /package/lib/module/react-native/{components-factory → components-factories/web-objects}/createWebObjectAsComponent.js +0 -0
- /package/lib/module/react-native/{components-factory → components-factories/web-objects}/createWebObjectAsComponent.test.unit.js +0 -0
- /package/lib/module/react-native/{components-factory → components-factories/web-objects}/createWebObjectAsComponent.types.js +0 -0
- /package/lib/module/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMethodsProxy.mock.js +0 -0
- /package/lib/module/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMountUnmountCallbacks.mock.js +0 -0
- /package/lib/module/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMountUnmountCallbacks.types.js +0 -0
- /package/lib/module/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMountUnmountWithProps.mock.js +0 -0
- /package/lib/typescript/src/react-native/components/{MapProvider → core/MapProvider}/MapProvider.hooks.d.ts +0 -0
- /package/lib/typescript/src/react-native/components/{MapProvider → core/MapProvider}/MapProvider.test.unit.d.ts +0 -0
- /package/lib/typescript/src/react-native/components/{MapProvider → core/MapProvider}/MapProvider.utils.d.ts +0 -0
- /package/lib/typescript/src/react-native/components/{Map → web-objects/Map}/Map.test.unit.d.ts +0 -0
- /package/lib/typescript/src/react-native/components/{Marker → web-objects/Marker}/Marker.test.unit.d.ts +0 -0
- /package/lib/typescript/src/react-native/components/{Popup → web-objects/Popup}/Popup.test.unit.d.ts +0 -0
- /package/lib/typescript/src/react-native/{components-factory → components-factories/web-objects}/createWebObjectAsComponent.test.integration.d.ts +0 -0
- /package/lib/typescript/src/react-native/{components-factory → components-factories/web-objects}/createWebObjectAsComponent.test.unit.d.ts +0 -0
- /package/lib/typescript/src/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMethodsProxy.mock.d.ts +0 -0
- /package/lib/typescript/src/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMountUnmountCallbacks.mock.d.ts +0 -0
- /package/lib/typescript/src/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMountUnmountCallbacks.types.d.ts +0 -0
- /package/lib/typescript/src/react-native/{components-factory → components-factories/web-objects}/hooks/useWebObjectMountUnmountWithProps.mock.d.ts +0 -0
package/lib/module/index.js
CHANGED
|
@@ -7,11 +7,15 @@
|
|
|
7
7
|
* @sortStrategy sort-order
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
// @group Types
|
|
10
|
+
// @group Types (web objects)
|
|
11
11
|
|
|
12
|
-
// @group
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export { default as
|
|
16
|
-
export { default as
|
|
12
|
+
// @group Types (map sources)
|
|
13
|
+
|
|
14
|
+
// @group Components (web objects)
|
|
15
|
+
export { default as MapProvider } from "./react-native/components/core/MapProvider/MapProvider.js";
|
|
16
|
+
export { default as Map } from "./react-native/components/web-objects/Map/Map.js";
|
|
17
|
+
export { default as Marker } from "./react-native/components/web-objects/Marker/Marker.js";
|
|
18
|
+
export { default as Popup } from "./react-native/components/web-objects/Popup/Popup.js";
|
|
19
|
+
// @group Components (map sources)
|
|
20
|
+
export { default as GeoJSONSource } from "./react-native/components/map-sources/GeoJSONSource/GeoJSONSource.js";
|
|
17
21
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","MapProvider","Map","Marker","Popup"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;;
|
|
1
|
+
{"version":3,"names":["default","MapProvider","Map","Marker","Popup","GeoJSONSource"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAcA;;AAGA;AACA,SAASA,OAAO,IAAIC,WAAW,QAAQ,2DAAwD;AAC/F,SAASD,OAAO,IAAIE,GAAG,QAAQ,kDAA+C;AAC9E,SAASF,OAAO,IAAIG,MAAM,QAAQ,wDAAqD;AACvF,SAASH,OAAO,IAAII,KAAK,QAAQ,sDAAmD;AACpF;AACA,SAASJ,OAAO,IAAIK,aAAa,QAAQ,sEAAmE","ignoreList":[]}
|
package/lib/module/react-native/components/{MapProvider → core/MapProvider}/MapProvider.hooks.js
RENAMED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { StyleSheet } from 'react-native';
|
|
4
4
|
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
5
|
-
import RNLogger from "
|
|
6
|
-
import { isWebObjectListenerOnHTMLElement, isWebObjectListenerOnMapLayer, isWebObjectListenerOnObject, isWebObjectListenerOnRN } from "
|
|
7
|
-
import useMapAtoms from "
|
|
5
|
+
import RNLogger from "../../../logger/rn-logger.js";
|
|
6
|
+
import { isWebObjectListenerOnHTMLElement, isWebObjectListenerOnMapLayer, isWebObjectListenerOnObject, isWebObjectListenerOnRN } from "../../../../communication/messages.utils.js";
|
|
7
|
+
import useMapAtoms from "../../../hooks/atoms/useMapAtoms.js";
|
|
8
8
|
import { buildCssInjectionScript, normalizeCss } from "./MapProvider.utils.js";
|
|
9
9
|
export const useStyles = () => {
|
|
10
10
|
return useMemo(() => StyleSheet.create({
|
|
@@ -48,6 +48,7 @@ export const useWebMessageHandler = () => {
|
|
|
48
48
|
const {
|
|
49
49
|
setIsWebWorldReady,
|
|
50
50
|
getWebObjectListeners,
|
|
51
|
+
getMapSourceListeners,
|
|
51
52
|
resolveWebObjectPendingMethodResponse
|
|
52
53
|
} = useMapAtoms();
|
|
53
54
|
const createWebViewMessageHandler = useCallback(handlers => {
|
|
@@ -81,9 +82,9 @@ export const useWebMessageHandler = () => {
|
|
|
81
82
|
},
|
|
82
83
|
webObjectListenerEvent: ({
|
|
83
84
|
payload: {
|
|
85
|
+
objectId,
|
|
84
86
|
eventName,
|
|
85
|
-
event
|
|
86
|
-
objectId
|
|
87
|
+
event
|
|
87
88
|
}
|
|
88
89
|
}) => {
|
|
89
90
|
// Retrieve the corresponding object listener.
|
|
@@ -118,9 +119,25 @@ export const useWebMessageHandler = () => {
|
|
|
118
119
|
requestId,
|
|
119
120
|
result
|
|
120
121
|
});
|
|
122
|
+
},
|
|
123
|
+
mapSourceListenerEvent: ({
|
|
124
|
+
payload: {
|
|
125
|
+
sourceId,
|
|
126
|
+
layerId,
|
|
127
|
+
eventName,
|
|
128
|
+
event
|
|
129
|
+
}
|
|
130
|
+
}) => {
|
|
131
|
+
// Retrieve the corresponding object listener.
|
|
132
|
+
const listener = getMapSourceListeners({
|
|
133
|
+
sourceId,
|
|
134
|
+
layerId
|
|
135
|
+
})?.[eventName];
|
|
136
|
+
// Then, call it.
|
|
137
|
+
listener?.(event);
|
|
121
138
|
}
|
|
122
139
|
});
|
|
123
|
-
}, [createWebViewMessageHandler, setIsWebWorldReady, getWebObjectListeners, resolveWebObjectPendingMethodResponse]);
|
|
140
|
+
}, [createWebViewMessageHandler, setIsWebWorldReady, getWebObjectListeners, getMapSourceListeners, resolveWebObjectPendingMethodResponse]);
|
|
124
141
|
return {
|
|
125
142
|
handler
|
|
126
143
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","useCallback","useEffect","useMemo","useRef","RNLogger","isWebObjectListenerOnHTMLElement","isWebObjectListenerOnMapLayer","isWebObjectListenerOnObject","isWebObjectListenerOnRN","useMapAtoms","buildCssInjectionScript","normalizeCss","useStyles","create","container","width","height","overflow","webView","flex","backgroundColor","useFlushMessagesOnMapMounted","isMapMountMessageReady","flushMessages","useWebMessageHandler","setIsWebWorldReady","getWebObjectListeners","getMapSourceListeners","resolveWebObjectPendingMethodResponse","createWebViewMessageHandler","handlers","handleMessage","event","debug","name","nativeEvent","data","message","JSON","parse","handler","type","error","console","payload","args","level","slice","ready","webObjectListenerEvent","objectId","eventName","listener","rnListener","objectListener","layerListener","elementListener","webObjectMethodResponse","requestId","result","mapSourceListenerEvent","sourceId","layerId","useCssInjectionScript","injectedCss","cssInjectionScript","normalizedCss","undefined","useInjectJavaScriptIfInjectedCssChanged","lastInjectedScriptRef","isWebWorldReady","current","injectJavaScript"],"sourceRoot":"../../../../../../src","sources":["react-native/components/core/MapProvider/MapProvider.hooks.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAG/D,OAAOC,QAAQ,MAAM,8BAA2B;AAEhD,SACEC,gCAAgC,EAChCC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,uBAAuB,QAClB,6CAA0C;AACjD,OAAOC,WAAW,MAAM,qCAAkC;AAO1D,SAASC,uBAAuB,EAAEC,YAAY,QAAQ,wBAAqB;AAE3E,OAAO,MAAMC,SAAS,GAAGA,CAAA,KAAM;EAC7B,OAAOV,OAAO,CACZ,MACEH,UAAU,CAACc,MAAM,CAAC;IAChBC,SAAS,EAAE;MAAEC,KAAK,EAAE,MAAM;MAAEC,MAAM,EAAE,MAAM;MAAEC,QAAQ,EAAE;IAAS,CAAC;IAChEC,OAAO,EAAE;MAAEC,IAAI,EAAE,CAAC;MAAEC,eAAe,EAAE;IAAc;EACrD,CAAC,CAAC,EACJ,EACF,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GAAGA,CAAA,KAAM;EAChD;EACA;EACA,MAAM;IAAEC,sBAAsB;IAAEC;EAAc,CAAC,GAAGd,WAAW,CAAC,CAAC;EAE/DR,SAAS,CAAC,MAAM;IACd,IAAIqB,sBAAsB,EAAE;MAC1BC,aAAa,CAAC,CA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CACtC,CAAC;EAEF,OAAO;IAAEY;EAAQ,CAAC;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMuB,qBAAqB,GAAIC,WAA+B,IAAK;EACxE,MAAMC,kBAAkB,GAAG/D,OAAO,CAAC,MAAM;IACvC,MAAMgE,aAAa,GAAGvD,YAAY,CAACqD,WAAW,CAAC;IAC/C,OAAOE,aAAa,GAAGxD,uBAAuB,CAACwD,aAAa,CAAC,GAAGC,SAAS;EAC3E,CAAC,EAAE,CAACH,WAAW,CAAC,CAAC;EACjB,OAAO;IAAEC;EAAmB,CAAC;AAC/B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,uCAAuC,GAClDH,kBAA2B,IACxB;EACH;EACA,MAAMI,qBAAqB,GAAGlE,MAAM,CAAgB,IAAI,CAAC;EACzD;EACA;EACA,MAAM;IAAEe,OAAO;IAAEoD;EAAgB,CAAC,GAAG7D,WAAW,CAAC,CAAC;EAElDR,SAAS,CAAC,MAAM;IACd,IACE,CAACgE,kBAAkB,IACnB,CAACK,eAAe,IAChB,CAACpD,OAAO,IACRmD,qBAAqB,CAACE,OAAO,KAAKN,kBAAkB,EACpD;MACA;IACF;IACA/C,OAAO,EAAEsD,gBAAgB,CAACP,kBAAkB,CAAC;IAC7CI,qBAAqB,CAACE,OAAO,GAAGN,kBAAkB;EACpD,CAAC,EAAE,CAACA,kBAAkB,EAAEK,eAAe,EAAEpD,OAAO,CAAC,CAAC;AACpD,CAAC","ignoreList":[]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
import { WebView } from 'react-native-webview';
|
|
5
|
-
import { WEBVIEW_STATIC_HTML } from "
|
|
6
|
-
import useMapAtoms from "
|
|
5
|
+
import { WEBVIEW_STATIC_HTML } from "../../../../web/generated/webview_static_html.js";
|
|
6
|
+
import useMapAtoms from "../../../hooks/atoms/useMapAtoms.js";
|
|
7
7
|
import { useFlushMessagesOnMapMounted, useCssInjectionScript, useInjectJavaScriptIfInjectedCssChanged, useStyles, useWebMessageHandler } from "./MapProvider.hooks.js";
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
9
|
/**
|
|
@@ -11,7 +11,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
* Every child must be a direct component.
|
|
12
12
|
* This is the bridge to the web world / the `MapLibre GL JS` library.
|
|
13
13
|
* @param props -
|
|
14
|
-
* @group Components
|
|
14
|
+
* @group Components (core)
|
|
15
15
|
* @example
|
|
16
16
|
* ```tsx
|
|
17
17
|
* <MapProvider>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","WebView","WEBVIEW_STATIC_HTML","useMapAtoms","useFlushMessagesOnMapMounted","useCssInjectionScript","useInjectJavaScriptIfInjectedCssChanged","useStyles","useWebMessageHandler","jsx","_jsx","jsxs","_jsxs","MapProvider","style","webViewStyle","children","injectedCss","setWebView","styles","handler","cssInjectionScript","container","testID","ref","webView","scrollEnabled","javaScriptEnabled","domStorageEnabled","onMessage","source","html","injectedJavaScriptBeforeContentLoaded"],"sourceRoot":"../../../../../../src","sources":["react-native/components/core/MapProvider/MapProvider.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,mBAAmB,QAAQ,kDAA+C;AACnF,OAAOC,WAAW,MAAM,qCAAkC;AAC1D,SACEC,4BAA4B,EAC5BC,qBAAqB,EACrBC,uCAAuC,EACvCC,SAAS,EACTC,oBAAoB,QACf,wBAAqB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAGA,CAAC;EACnBC,KAAK;EACLC,YAAY;EACZC,QAAQ;EACRC;AACgB,CAAC,KAAK;EACtB;EACA;EACA,MAAM;IAAEC;EAAW,CAAC,GAAGf,WAAW,CAAC,CAAC;EACpC;EACA,MAAMgB,MAAM,GAAGZ,SAAS,CAAC,CAAC;EAC1B;EACAH,4BAA4B,CAAC,CAAC;EAC9B,MAAM;IAAEgB;EAAQ,CAAC,GAAGZ,oBAAoB,CAAC,CAAC;EAC1C,MAAM;IAAEa;EAAmB,CAAC,GAAGhB,qBAAqB,CAACY,WAAW,CAAC;EACjEX,uCAAuC,CAACe,kBAAkB,CAAC;EAE3D,oBACET,KAAA,CAACZ,IAAI;IAACc,KAAK,EAAE,CAACK,MAAM,CAACG,SAAS,EAAER,KAAK,CAAE;IAAAE,QAAA,gBACrCN,IAAA,CAACT,OAAO;MACNsB,MAAM,EAAE,sBAAuB;MAC/BC,GAAG,EAAEN,UAAW;MAChBJ,KAAK,EAAE,CAACK,MAAM,CAACM,OAAO,EAAEV,YAAY,CAAE;MACtCW,aAAa,EAAE,KAAM;MACrBC,iBAAiB,EAAE,IAAK;MACxBC,iBAAiB,EAAE,IAAK;MACxBC,SAAS,EAAET,OAAQ;MACnBU,MAAM,EAAE;QAAEC,IAAI,EAAE7B;MAAoB,CAAE;MACtC8B,qCAAqC,EAAEX;IAAmB,CAC3D,CAAC,EACDL,QAAQ;EAAA,CACL,CAAC;AAEX,CAAC;AAED,eAAeH,WAAW","ignoreList":[]}
|
package/lib/module/react-native/components/{MapProvider → core/MapProvider}/MapProvider.test.unit.js
RENAMED
|
@@ -4,8 +4,8 @@ import { View, Text } from 'react-native';
|
|
|
4
4
|
import { render, renderHook, screen } from '@testing-library/react-native';
|
|
5
5
|
import MapProvider from "./MapProvider.js";
|
|
6
6
|
import { useWebMessageHandler } from "./MapProvider.hooks.js";
|
|
7
|
-
import RNLogger from "
|
|
8
|
-
import { getWebObjectListenersMock, resolveWebObjectPendingMethodResponseMock, setIsWebWorldReadyMock } from "
|
|
7
|
+
import RNLogger from "../../../logger/rn-logger.js";
|
|
8
|
+
import { getMapSourceListenersMock, getWebObjectListenersMock, resolveWebObjectPendingMethodResponseMock, setIsWebWorldReadyMock } from "../../../hooks/atoms/useMapAtoms.mock.js";
|
|
9
9
|
import { jest } from '@jest/globals';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
const createEvent = data => ({
|
|
@@ -13,7 +13,7 @@ const createEvent = data => ({
|
|
|
13
13
|
data: typeof data === 'string' ? data : JSON.stringify(data)
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
jest.mock('
|
|
16
|
+
jest.mock('./../../../hooks/atoms/useMapAtoms', () => require('./../../../hooks/atoms/useMapAtoms.mock'));
|
|
17
17
|
describe('MapProvider', () => {
|
|
18
18
|
beforeEach(() => {
|
|
19
19
|
jest.clearAllMocks();
|
|
@@ -120,6 +120,31 @@ describe('useWebMessageHandler', () => {
|
|
|
120
120
|
expect(rnListener).toHaveBeenCalledWith(eventPayload);
|
|
121
121
|
});
|
|
122
122
|
});
|
|
123
|
+
describe('When handling a message of type "mapSourceListenerEvent"', () => {
|
|
124
|
+
let listener;
|
|
125
|
+
let eventPayload;
|
|
126
|
+
beforeEach(() => {
|
|
127
|
+
listener = jest.fn();
|
|
128
|
+
eventPayload = {
|
|
129
|
+
x: Math.random()
|
|
130
|
+
};
|
|
131
|
+
getMapSourceListenersMock.mockReturnValue({
|
|
132
|
+
click: listener
|
|
133
|
+
});
|
|
134
|
+
handler(createEvent({
|
|
135
|
+
type: 'mapSourceListenerEvent',
|
|
136
|
+
payload: {
|
|
137
|
+
sourceId: 'src-1',
|
|
138
|
+
layerId: 'layer-1',
|
|
139
|
+
eventName: 'click',
|
|
140
|
+
event: eventPayload
|
|
141
|
+
}
|
|
142
|
+
}));
|
|
143
|
+
});
|
|
144
|
+
test('Then dispatches the event to the corresponding listener', () => {
|
|
145
|
+
expect(listener).toHaveBeenCalledWith(eventPayload);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
123
148
|
describe('When handling a message of type "webObjectMethodResponse"', () => {
|
|
124
149
|
beforeEach(() => {
|
|
125
150
|
handler(createEvent({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Text","render","renderHook","screen","MapProvider","useWebMessageHandler","RNLogger","getMapSourceListenersMock","getWebObjectListenersMock","resolveWebObjectPendingMethodResponseMock","setIsWebWorldReadyMock","jest","jsx","_jsx","createEvent","data","nativeEvent","JSON","stringify","mock","require","describe","beforeEach","clearAllMocks","children","testID","test","child","getByTestId","expect","toBeTruthy","webView","handler","result","current","toBe","type","not","toThrow","payload","level","args","info","toHaveBeenCalledWith","rnListener","eventPayload","fn","x","Math","random","mockReturnValue","click","objectId","eventName","event","listener","sourceId","layerId","requestId","ok"],"sourceRoot":"../../../../../../src","sources":["react-native/components/core/MapProvider/MapProvider.test.unit.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,MAAM,EAAEC,UAAU,EAAEC,MAAM,QAAQ,+BAA+B;AAC1E,OAAOC,WAAW,MAAM,kBAAe;AACvC,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,OAAOC,QAAQ,MAAM,8BAA2B;AAChD,SACEC,yBAAyB,EACzBC,yBAAyB,EACzBC,yCAAyC,EACzCC,sBAAsB,QACjB,0CAAuC;AAC9C,SAASC,IAAI,QAAQ,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGpC,MAAMC,WAAW,GACfC,IAAqE,KAEpE;EACCC,WAAW,EAAE;IACXD,IAAI,EAAE,OAAOA,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAGE,IAAI,CAACC,SAAS,CAACH,IAAI;EAC7D;AACF,CAAC,CAAQ;AAEXJ,IAAI,CAACQ,IAAI,CAAC,oCAAoC,EAAE,MAC9CC,OAAO,CAAC,yCAAyC,CACnD,CAAC;AAEDC,QAAQ,CAAC,aAAa,EAAE,MAAM;EAC5BC,UAAU,CAAC,MAAM;IACfX,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O;YAClBC,KAAK,EAAET;UACT;QACF,CAAC,CACH,CAAC;MACH,CAAC,CAAC;MAEFnB,IAAI,CAAC,yDAAyD,EAAE,MAAM;QACpEG,MAAM,CAAC0B,QAAQ,CAAC,CAACZ,oBAAoB,CAACE,YAAY,CAAC;MACrD,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFxB,QAAQ,CAAC,2DAA2D,EAAE,MAAM;MAC1EC,UAAU,CAAC,MAAM;QACfU,OAAO,CACLlB,WAAW,CAAC;UACVsB,IAAI,EAAE,yBAAyB;UAC/BG,OAAO,EAAE;YACPmB,SAAS,EAAE,SAAS;YACpBzB,MAAM,EAAE;cAAE0B,EAAE,EAAE;YAAK;UACrB;QACF,CAAC,CACH,CAAC;MACH,CAAC,CAAC;MAEFjC,IAAI,CAAC,8CAA8C,EAAE,MAAM;QACzDG,MAAM,CAACpB,yCAAyC,CAAC,CAACkC,oBAAoB,CAAC;UACrEe,SAAS,EAAE,SAAS;UACpBzB,MAAM,EAAE;YAAE0B,EAAE,EAAE;UAAK;QACrB,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../../src","sources":["react-native/components/core/MapProvider/MapProvider.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["normalizeCss","css","normalizedCss","Array","isArray","map","s","trim","filter","Boolean","length","undefined","buildCssInjectionScript","INJECTED_STYLE_ID","join","cssJSON","JSON","stringify","idJSON"],"sourceRoot":"../../../../../../src","sources":["react-native/components/core/MapProvider/MapProvider.utils.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,YAAY,GAAIC,GAAuB,IAA2B;EAC7E,MAAMC,aAAa,GAAG,CAACC,KAAK,CAACC,OAAO,CAACH,GAAG,CAAC,GAAGA,GAAG,GAAGA,GAAG,GAAG,CAACA,GAAG,CAAC,GAAG,EAAE,EAC/DI,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACC,IAAI,CAAC,CAAC,CAAC,CACpBC,MAAM,CAACC,OAAO,CAAC;EAElB,OAAOP,aAAa,CAACQ,MAAM,GAAGR,aAAa,GAAGS,SAAS;AACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAIV,aAAuB,IAAa;EAC1E,MAAMW,iBAAiB,GAAG,+BAA+B;EAEzD,MAAMZ,GAAG,GAAGC,aAAa,CAACY,IAAI,CAAC,IAAI,CAAC;EACpC,MAAMC,OAAO,GAAGC,IAAI,CAACC,SAAS,CAAChB,GAAG,CAAC;EACnC,MAAMiB,MAAM,GAAGF,IAAI,CAACC,SAAS,CAACJ,iBAAiB,CAAC;EAEhD,OAAO;AACT;AACA;AACA;AACA,mBAAmBK,MAAM;AACzB,oBAAoBH,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import createMapSourceAsComponent from "../../../components-factories/map-sources/createMapSourceAsComponent.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* MapLibre GeoJSONSource view.
|
|
7
|
+
* @props {@link GeoJSONSourceProps}
|
|
8
|
+
* @see {@link https://maplibre.org/maplibre-gl-js/docs/API/classes/GeoJSONSource/ `MapLibre GL JS` docs}
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* ```
|
|
12
|
+
* @group Components
|
|
13
|
+
*/
|
|
14
|
+
const GeoJSONSource = createMapSourceAsComponent();
|
|
15
|
+
export default GeoJSONSource;
|
|
16
|
+
//# sourceMappingURL=GeoJSONSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createMapSourceAsComponent","GeoJSONSource"],"sourceRoot":"../../../../../../src","sources":["react-native/components/map-sources/GeoJSONSource/GeoJSONSource.tsx"],"mappings":";;AACA,OAAOA,0BAA0B,MAAM,yEAAsE;;AAE7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAGD,0BAA0B,CAAqB,CAAC;AAEtE,eAAeC,aAAa","ignoreList":[]}
|
package/lib/module/react-native/components/map-sources/GeoJSONSource/GeoJSONSource.types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../../src","sources":["react-native/components/map-sources/GeoJSONSource/GeoJSONSource.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import createWebObjectAsComponent from "
|
|
3
|
+
import createWebObjectAsComponent from "../../../components-factories/web-objects/createWebObjectAsComponent.js";
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* MapLibre Map view.
|
|
6
7
|
* @props {@link MapProps}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createWebObjectAsComponent","Map"],"sourceRoot":"../../../../../../src","sources":["react-native/components/web-objects/Map/Map.tsx"],"mappings":";;AACA,OAAOA,0BAA0B,MAAM,yEAAsE;;AAE7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,GAAG,GAAGD,0BAA0B,CAAmB,KAAK,CAAC;AAE/D,eAAeC,GAAG","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["render","Map","jsx","_jsx","describe","beforeEach","jest","clearAllMocks","test"],"sourceRoot":"../../../../../../src","sources":["react-native/components/web-objects/Map/Map.test.unit.tsx"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,+BAA+B;AACtD,OAAOC,GAAG,MAAM,UAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEvBC,QAAQ,CAAC,KAAK,EAAE,MAAM;EACpBC,UAAU,CAAC,MAAM;IACfC,IAAI,CAACC,aAAa,CAAC,CAAC;EACtB,CAAC,CAAC;EAEFH,QAAQ,CAAC,iCAAiC,EAAE,MAAM;IAChDC,UAAU,CAAC,MAAM;MACfL,MAAM,cAACG,IAAA,CAACF,GAAG,IAAE,CAAC,CAAC;IACjB,CAAC,CAAC;IAEFG,QAAQ,CAAC,cAAc,EAAE,MAAM;MAC7BI,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../../src","sources":["react-native/components/web-objects/Map/Map.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import createWebObjectAsComponent from "
|
|
3
|
+
import createWebObjectAsComponent from "../../../components-factories/web-objects/createWebObjectAsComponent.js";
|
|
4
4
|
/**
|
|
5
5
|
* MapLibre Marker view.
|
|
6
6
|
* @props {@link MarkerProps}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createWebObjectAsComponent","Marker"],"sourceRoot":"../../../../../../src","sources":["react-native/components/web-objects/Marker/Marker.tsx"],"mappings":";;AAAA,OAAOA,0BAA0B,MAAM,yEAAsE;AAG7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,MAAM,GAAGD,0BAA0B,CAAyB,QAAQ,CAAC;AAE3E,eAAeC,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["render","Marker","jest","jsx","_jsx","describe","beforeEach","clearAllMocks","test"],"sourceRoot":"../../../../../../src","sources":["react-native/components/web-objects/Marker/Marker.test.unit.tsx"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,+BAA+B;AACtD,OAAOC,MAAM,MAAM,aAAU;AAC7B,SAASC,IAAI,QAAQ,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEpCC,QAAQ,CAAC,QAAQ,EAAE,MAAM;EACvBC,UAAU,CAAC,MAAM;IACfJ,IAAI,CAACK,aAAa,CAAC,CAAC;EACtB,CAAC,CAAC;EAEFF,QAAQ,CAAC,iCAAiC,EAAE,MAAM;IAChDC,UAAU,CAAC,MAAM;MACfN,MAAM,cAACI,IAAA,CAACH,MAAM,IAAE,CAAC,CAAC;IACpB,CAAC,CAAC;IAEFI,QAAQ,CAAC,cAAc,EAAE,MAAM;MAC7BG,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../../src","sources":["react-native/components/web-objects/Marker/Marker.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import createWebObjectAsComponent from "
|
|
3
|
+
import createWebObjectAsComponent from "../../../components-factories/web-objects/createWebObjectAsComponent.js";
|
|
4
4
|
/**
|
|
5
5
|
* MapLibre Popup view.
|
|
6
6
|
* @props {@link PopupProps}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createWebObjectAsComponent","Popup"],"sourceRoot":"../../../../../../src","sources":["react-native/components/web-objects/Popup/Popup.tsx"],"mappings":";;AAAA,OAAOA,0BAA0B,MAAM,yEAAsE;AAG7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,KAAK,GAAGD,0BAA0B,CAAuB,OAAO,CAAC;AAEvE,eAAeC,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["render","Popup","jsx","_jsx","describe","beforeEach","jest","clearAllMocks","test"],"sourceRoot":"../../../../../../src","sources":["react-native/components/web-objects/Popup/Popup.test.unit.tsx"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,+BAA+B;AACtD,OAAOC,KAAK,MAAM,YAAS;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAE3BC,QAAQ,CAAC,OAAO,EAAE,MAAM;EACtBC,UAAU,CAAC,MAAM;IACfC,IAAI,CAACC,aAAa,CAAC,CAAC;EACtB,CAAC,CAAC;EAEFH,QAAQ,CAAC,iCAAiC,EAAE,MAAM;IAChDC,UAAU,CAAC,MAAM;MACfL,MAAM,cAACG,IAAA,CAACF,KAAK,IAAE,CAAC,CAAC;IACnB,CAAC,CAAC;IAEFG,QAAQ,CAAC,cAAc,EAAE,MAAM;MAC7BI,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../../src","sources":["react-native/components/web-objects/Popup/Popup.types.ts"],"mappings":"","ignoreList":[]}
|
package/lib/module/react-native/components-factories/map-sources/createMapSourceAsComponent.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import useMapSourceMountUnmountWithProps from "./hooks/useMapSourceMountUnmountWithProps.js";
|
|
4
|
+
const createMapSourceAsComponent = () => {
|
|
5
|
+
return props => {
|
|
6
|
+
// Mount the map source on launch and update the map source properties when
|
|
7
|
+
// they changed in the component body.
|
|
8
|
+
useMapSourceMountUnmountWithProps(props);
|
|
9
|
+
return null;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default createMapSourceAsComponent;
|
|
13
|
+
//# sourceMappingURL=createMapSourceAsComponent.js.map
|
package/lib/module/react-native/components-factories/map-sources/createMapSourceAsComponent.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMapSourceMountUnmountWithProps","createMapSourceAsComponent","props"],"sourceRoot":"../../../../../src","sources":["react-native/components-factories/map-sources/createMapSourceAsComponent.ts"],"mappings":";;AACA,OAAOA,iCAAiC,MAAM,8CAA2C;AAEzF,MAAMC,0BAA0B,GAAGA,CAAA,KAAyC;EAC1E,OAAQC,KAAY,IAAK;IACvB;IACA;IACAF,iCAAiC,CAAQE,KAAK,CAAC;IAE/C,OAAO,IAAI;EACb,CAAC;AACH,CAAC;AAED,eAAeD,0BAA0B","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["react-native/components-factories/map-sources/createMapSourceAsComponent.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useRef } from 'react';
|
|
4
|
+
import useMapAtoms from "../../../hooks/atoms/useMapAtoms.js";
|
|
5
|
+
/**
|
|
6
|
+
* @param props - The RN object props.
|
|
7
|
+
* @returns – The callbacks used to mount and unmount the map source. They
|
|
8
|
+
* internally handle edge cases where execution must be prevented, with no
|
|
9
|
+
* external management required. They allow (un)mounting the map sources with
|
|
10
|
+
* their options, but also their listeners.
|
|
11
|
+
*/
|
|
12
|
+
const useMapSourceMountUnmountCallbacks = props => {
|
|
13
|
+
// Refs.
|
|
14
|
+
const areOptionsMounted = useRef(false);
|
|
15
|
+
const areListenersMounted = useRef(false);
|
|
16
|
+
// States.
|
|
17
|
+
// - Global.
|
|
18
|
+
const {
|
|
19
|
+
dispatchMessage,
|
|
20
|
+
setMapSourceListeners,
|
|
21
|
+
deleteMapSourceListeners
|
|
22
|
+
} = useMapAtoms();
|
|
23
|
+
const mount = useCallback(() => {
|
|
24
|
+
// Mount the component as a map source within the web world.
|
|
25
|
+
if (!areOptionsMounted.current) {
|
|
26
|
+
dispatchMessage({
|
|
27
|
+
type: `mapSourceMount`,
|
|
28
|
+
payload: props
|
|
29
|
+
});
|
|
30
|
+
areOptionsMounted.current = true;
|
|
31
|
+
}
|
|
32
|
+
// Register listeners on event from the web world.
|
|
33
|
+
if (!areListenersMounted.current) {
|
|
34
|
+
setMapSourceListeners({
|
|
35
|
+
sourceId: props.id,
|
|
36
|
+
listeners: props.layers.map(item => item.listeners ? {
|
|
37
|
+
layerId: item.layer.id,
|
|
38
|
+
listeners: item.listeners
|
|
39
|
+
} : undefined).filter(item => item !== undefined) ?? []
|
|
40
|
+
});
|
|
41
|
+
areListenersMounted.current = true;
|
|
42
|
+
}
|
|
43
|
+
}, [props, dispatchMessage, setMapSourceListeners]);
|
|
44
|
+
const unmount = useCallback(() => {
|
|
45
|
+
// Unmount the component.
|
|
46
|
+
if (areOptionsMounted.current) {
|
|
47
|
+
dispatchMessage({
|
|
48
|
+
type: `mapSourceUnmount`,
|
|
49
|
+
payload: {
|
|
50
|
+
sourceId: props.id
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
areOptionsMounted.current = false;
|
|
54
|
+
}
|
|
55
|
+
// Unregister listeners on event from the web world.
|
|
56
|
+
if (areListenersMounted.current) {
|
|
57
|
+
deleteMapSourceListeners({
|
|
58
|
+
sourceId: props.id
|
|
59
|
+
});
|
|
60
|
+
areListenersMounted.current = false;
|
|
61
|
+
}
|
|
62
|
+
}, [deleteMapSourceListeners, dispatchMessage, props.id]);
|
|
63
|
+
return {
|
|
64
|
+
mount,
|
|
65
|
+
unmount
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export default useMapSourceMountUnmountCallbacks;
|
|
69
|
+
//# sourceMappingURL=useMapSourceMountUnmountCallbacks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useRef","useMapAtoms","useMapSourceMountUnmountCallbacks","props","areOptionsMounted","areListenersMounted","dispatchMessage","setMapSourceListeners","deleteMapSourceListeners","mount","current","type","payload","sourceId","id","listeners","layers","map","item","layerId","layer","undefined","filter","unmount"],"sourceRoot":"../../../../../../src","sources":["react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountCallbacks.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,MAAM,QAAQ,OAAO;AAC3C,OAAOC,WAAW,MAAM,qCAAkC;AAG1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iCAAiC,GACrCC,KAAY,IACT;EACH;EACA,MAAMC,iBAAiB,GAAGJ,MAAM,CAAU,KAAK,CAAC;EAChD,MAAMK,mBAAmB,GAAGL,MAAM,CAAU,KAAK,CAAC;EAClD;EACA;EACA,MAAM;IAAEM,eAAe;IAAEC,qBAAqB;IAAEC;EAAyB,CAAC,GACxEP,WAAW,CAAC,CAAC;EAEf,MAAMQ,KAAK,GAAGV,WAAW,CAAC,MAAM;IAC9B;IACA,IAAI,CAACK,iBAAiB,CAACM,OAAO,EAAE;MAC9BJ,eAAe,CAAC;QACdK,IAAI,EAAE,gBAAgB;QACtBC,OAAO,EAAET;MACX,CAAC,CAAC;MAC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useMemo, useRef } from 'react';
|
|
4
|
+
import { stableStringify } from "../../../hooks/atoms/useMapAtoms.utils.js";
|
|
5
|
+
import useMapAtoms from "../../../hooks/atoms/useMapAtoms.js";
|
|
6
|
+
import useMapSourceMountUnmountCallbacks from "./useMapSourceMountUnmountCallbacks.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Mount the component as a map source within the web world on component mount.
|
|
10
|
+
* Propagate any change in the component props to the web world by unmounting
|
|
11
|
+
* and mounting the map source with the new options.
|
|
12
|
+
* @param props - The RN object props.
|
|
13
|
+
*/
|
|
14
|
+
export const useMapSourceMountUnmountWithProps = props => {
|
|
15
|
+
// Refs.
|
|
16
|
+
const propsAsStringPrevious = useRef(undefined);
|
|
17
|
+
// States.
|
|
18
|
+
// - Local.
|
|
19
|
+
const hasBeenMountedAtLeastOnce = useRef(false);
|
|
20
|
+
// - Global.
|
|
21
|
+
const {
|
|
22
|
+
isWebWorldReady
|
|
23
|
+
} = useMapAtoms();
|
|
24
|
+
// Behaviors.
|
|
25
|
+
const {
|
|
26
|
+
mount,
|
|
27
|
+
unmount
|
|
28
|
+
} = useMapSourceMountUnmountCallbacks(props);
|
|
29
|
+
const propsAsString = useMemo(() => stableStringify(props), [props]);
|
|
30
|
+
|
|
31
|
+
// Mount the source only when props have changed (mounted in the web world),
|
|
32
|
+
// or that the map source has never been mounted.
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (!isWebWorldReady) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const arePropsEqual = propsAsStringPrevious.current === propsAsString;
|
|
38
|
+
const shouldMount = !arePropsEqual || !hasBeenMountedAtLeastOnce.current;
|
|
39
|
+
hasBeenMountedAtLeastOnce.current = true;
|
|
40
|
+
propsAsStringPrevious.current = propsAsString;
|
|
41
|
+
if (shouldMount) {
|
|
42
|
+
unmount();
|
|
43
|
+
mount();
|
|
44
|
+
}
|
|
45
|
+
}, [mount, unmount, hasBeenMountedAtLeastOnce, isWebWorldReady, propsAsString]);
|
|
46
|
+
};
|
|
47
|
+
export default useMapSourceMountUnmountWithProps;
|
|
48
|
+
//# sourceMappingURL=useMapSourceMountUnmountWithProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useMemo","useRef","stableStringify","useMapAtoms","useMapSourceMountUnmountCallbacks","useMapSourceMountUnmountWithProps","props","propsAsStringPrevious","undefined","hasBeenMountedAtLeastOnce","isWebWorldReady","mount","unmount","propsAsString","arePropsEqual","current","shouldMount"],"sourceRoot":"../../../../../../src","sources":["react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountWithProps.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAClD,SAASC,eAAe,QAAQ,2CAAwC;AACxE,OAAOC,WAAW,MAAM,qCAAkC;AAE1D,OAAOC,iCAAiC,MAAM,wCAAqC;;AAEnF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iCAAiC,GAG5CC,KAAY,IACT;EACH;EACA,MAAMC,qBAAqB,GAAGN,MAAM,CAAqBO,SAAS,CAAC;EACnE;EACA;EACA,MAAMC,yBAAyB,GAAGR,MAAM,CAAU,KAAK,CAAC;EACxD;EACA,MAAM;IAAES;EAAgB,CAAC,GAAGP,WAAW,CAAC,CAAC;EACzC;EACA,MAAM;IAAEQ,KAAK;IAAEC;EAAQ,CAAC,GAAGR,iCAAiC,CAACE,KAAK,CAAC;EACnE,MAAMO,aAAa,GAAGb,OAAO,CAAC,MAAME,eAAe,CAACI,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;;EAEpE;EACA;EACAP,SAAS,CAAC,MAAM;IACd,IAAI,CAACW,eAAe,EAAE;MACpB;IACF;IACA,MAAMI,aAAa,GAAGP,qBAAqB,CAACQ,OAAO,KAAKF,aAAa;IACrE,MAAMG,WAAW,GAAG,CAACF,aAAa,IAAI,CAACL,yBAAyB,CAACM,OAAO;IAExEN,yBAAyB,CAACM,OAAO,GAAG,IAAI;IACxCR,qBAAqB,CAACQ,OAAO,GAAGF,aAAa;IAE7C,IAAIG,WAAW,EAAE;MACfJ,OAAO,CAAC,CAAC;MACTD,KAAK,CAAC,CAAC;IACT;EACF,CAAC,EAAE,CACDA,KAAK,EACLC,OAAO,EACPH,yBAAyB,EACzBC,eAAe,EACfG,aAAa,CACd,CAAC;AACJ,CAAC;AAED,eAAeR,iCAAiC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMapSourceMountUnmountWithPropsMock","jest","fn"],"sourceRoot":"../../../../../../src","sources":["react-native/components-factories/map-sources/hooks/useMapSourceMountUnmountWithProps.mock.ts"],"mappings":";;AAAA,MAAMA,qCAAqC,GAAGC,IAAI,CAACC,EAAE,CAAC,CAAC;AAEvD,eAAeF,qCAAqC","ignoreList":[]}
|
package/lib/module/react-native/components-factories/web-objects/createWebObjectAsComponent.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","useId","useWebObjectMethodsProxy","useWebObjectMountUnmountWithProps","createWebObjectAsComponent","objectType","props","ref","id"],"sourceRoot":"../../../../../src","sources":["react-native/components-factories/web-objects/createWebObjectAsComponent.ts"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,KAAK,QAAQ,OAAO;AAQzC,OAAOC,wBAAwB,MAAM,qCAAkC;AACvE,OAAOC,iCAAiC,MAAM,8CAA2C;AAEzF,MAAMC,0BAA0B,GAI9BC,UAAyB,IACU;EACnC,oBAAOL,UAAU,CAAa,CAACM,KAAK,EAAEC,GAAG,KAAK;IAC5C;IACA,MAAMC,EAAe,GAAGP,KAAK,CAAC,CAAC;IAC/B;IACAC,wBAAwB,CAAMK,GAAG,EAAEC,EAAE,CAAC;IACtC;IACA;IACAL,iCAAiC,CAAQG,KAAK,EAAEE,EAAE,EAAEH,UAAU,CAAC;IAE/D,OAAO,IAAI;EACb,CAAC,CAAC;AACJ,CAAC;AAED,eAAeD,0BAA0B","ignoreList":[]}
|
|
@@ -4,9 +4,9 @@ import { render, screen } from '@testing-library/react-native';
|
|
|
4
4
|
import createWebObjectAsComponent from "./createWebObjectAsComponent.js";
|
|
5
5
|
import { jest } from '@jest/globals';
|
|
6
6
|
import { mount, unmount } from "./hooks/useWebObjectMountUnmountCallbacks.mock.js";
|
|
7
|
-
import { setIsWebWorldReady } from "
|
|
7
|
+
import { setIsWebWorldReady } from "../../hooks/atoms/useMapAtoms.mock.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
jest.mock('
|
|
9
|
+
jest.mock('./../../hooks/atoms/useMapAtoms', () => require('./../../hooks/atoms/useMapAtoms.mock'));
|
|
10
10
|
jest.mock('./hooks/useWebObjectMountUnmountCallbacks', () => require('./hooks/useWebObjectMountUnmountCallbacks.mock'));
|
|
11
11
|
describe('createWebObjectAsComponent', () => {
|
|
12
12
|
beforeEach(() => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["render","screen","createWebObjectAsComponent","jest","mount","unmount","setIsWebWorldReady","jsx","_jsx","mock","require","describe","beforeEach","clearAllMocks","Component","test","expect","toHaveBeenCalledTimes","toHaveBeenCalledWith","options","listeners","rerender","new","toHaveBeenNthCalledWith"],"sourceRoot":"../../../../../src","sources":["react-native/components-factories/web-objects/createWebObjectAsComponent.test.integration.tsx"],"mappings":";;AAAA,SAASA,MAAM,EAAEC,MAAM,QAAQ,+BAA+B;AAC9D,OAAOC,0BAA0B,MAAM,iCAA8B;AACrE,SAASC,IAAI,QAAQ,eAAe;AAMpC,SAASC,KAAK,EAAEC,OAAO,QAAQ,mDAAgD;AAC/E,SAASC,kBAAkB,QAAQ,uCAAoC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEvEL,IAAI,CAACM,IAAI,CAAC,iCAAiC,EAAE,MAC3CC,OAAO,CAAC,sCAAsC,CAChD,CAAC;AAEDP,IAAI,CAACM,IAAI,CAAC,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J,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["render","createWebObjectAsComponent","useWebObjectMethodsProxy","useWebObjectMountUnmountWithProps","jest","jsx","_jsx","mock","require","describe","beforeEach","clearAllMocks","Component","test","expect","toHaveBeenCalledTimes"],"sourceRoot":"../../../../../src","sources":["react-native/components-factories/web-objects/createWebObjectAsComponent.test.unit.tsx"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,+BAA+B;AACtD,OAAOC,0BAA0B,MAAM,iCAA8B;AACrE,OAAOC,wBAAwB,MAAM,qCAAkC;AACvE,OAAOC,iCAAiC,MAAM,8CAA2C;AACzF,SAASC,IAAI,QAAQ,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEpCF,IAAI,CAACG,IAAI,CAAC,kCAAkC,EAAE,MAC5CC,OAAO,CAAC,uCAAuC,CACjD,CAAC;AAEDJ,IAAI,CAACG,IAAI,CAAC,2CAA2C,EAAE,MACrDC,OAAO,CAAC,gDAAgD,CAC1D,CAAC;AAEDC,QAAQ,CAAC,4BAA4B,EAAE,MAAM;EAC3CC,UAAU,CAAC,MAAM;IACfN,IAAI,CAACO,aAAa,CAAC,CAAC;EACtB,CAAC,CAAC;EAEFF,QAAQ,CAAC,kCAAkC,EAAE,MAAM;IACjDC,UAAU,CAAC,MAAM;MACf,MAAME,SAAS,GAAGX,0BAA0B,CAAC,KAAK,CAAC;MACnDD,MAAM,cAACM,IAAA,CAACM,SAAS,IAAE,CAAC,CAAC;IACvB,CAAC,CAAC;IAEFH,QAAQ,CAAC,cAAc,EAAE,MAAM;MAC7BI,IAAI,CAAC,mCAAmC,EAAE,MAAM;QAC9CC,MAAM,CAACZ,wBAAwB,CAAC,CAACa,qBAAqB,CAAC,CAAC,CAAC;MAC3D,CAAC,CAAC;MAEFF,IAAI,CAAC,kCAAkC,EAAE,MAAM;QAC7CC,MAAM,CAACX,iCAAiC,CAAC,CAACY,qBAAqB,CAAC,CAAC,CAAC;MACpE,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["react-native/components-factories/web-objects/createWebObjectAsComponent.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useCallback, useImperativeHandle, useMemo } from 'react';
|
|
4
|
-
import useMapAtoms from "
|
|
4
|
+
import useMapAtoms from "../../../hooks/atoms/useMapAtoms.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Create a proxy to call the methods of the corresponding web world object,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useImperativeHandle","useMemo","useMapAtoms","useWebObjectMethodsProxy","ref","objectId","dispatchMessage","setWebObjectPendingMethodResponse","createProxy","Proxy","get","_","propKey","args","Promise","resolve","requestId","Math","random","toString","slice","type","payload","method","methodsProxy"],"sourceRoot":"../../../../../../src","sources":["react-native/components-factories/web-objects/hooks/useWebObjectMethodsProxy.ts"],"mappings":";;AAAA,SAEEA,WAAW,EACXC,mBAAmB,EACnBC,OAAO,QACF,OAAO;AAMd,OAAOC,WAAW,MAAM,qCAAkC;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAGA,CACtCC,GAAsB,EACtBC,QAAqB,KAClB;EACH;EACA;EACA,MAAM;IAAEC,eAAe;IAAEC;EAAkC,CAAC,GAAGL,WAAW,CAAC,CAAC;EAE5E,MAAMM,WAAW,GAAGT,WAAW,CAAC,MAAW;IACzC,OAAO,IAAIU,KAAK,CACd,CAAC,CAAC,EACF;MACEC,GAAGA,CAACC,CAAC,EAAEC,OAAO,EAAE;QACd,IAAIA,OAAO,KAAK,OAAO,EAAE;UACvB,OAAO,MAAMP,QAAQ;QACvB;QACA,OAAO,CAAC,GAAGQ,IAAW,KAAK;UACzB,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;YAC9B;YACA,MAAMC,SAAuC,GAAGC,IAAI,CAACC,MAAM,CAAC,CAAC,CAC1DC,QAAQ,CAAC,EAAE,CAAC,CACZC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;YACf;YACAb,iCAAiC,CAAC;cAAES,SAAS;cAAED;YAAQ,CAAC,CAAC;YACzD;YACAT,eAAe,CAAC;cACde,IAAI,EAAE,qBAAqB;cAC3BC,OAAO,EAAE;gBACPN,SAAS;gBACTX,QAAQ;gBACRkB,MAAM,EAAEX,OAAiB;gBACzBC;cACF;YACF,CAAC,CAAC;UACJ,CAAC,CAAC;QACJ,CAAC;MACH;IACF,CACF,CAAC;EACH,CAAC,EAAE,CAACR,QAAQ,EAAEC,eAAe,EAAEC,iCAAiC,CAAC,CAAC;EAElE,MAAMiB,YAAY,GAAGvB,OAAO,CAAC,MAAMO,WAAW,CAAC,CAAC,EAAE,CAACA,WAAW,CAAC,CAAC;EAChE;EACAR,mBAAmB,CAACI,GAAG,EAAE,MAAMoB,YAAY,CAAC;AAC9C,CAAC;AAED,eAAerB,wBAAwB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useWebObjectMethodsProxyMock","jest","fn"],"sourceRoot":"../../../../../../src","sources":["react-native/components-factories/web-objects/hooks/useWebObjectMethodsProxy.mock.ts"],"mappings":";;AAAA,MAAMA,4BAA4B,GAAGC,IAAI,CAACC,EAAE,CAAC,CAAC;AAE9C,eAAeF,4BAA4B","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useCallback, useRef } from 'react';
|
|
4
|
-
import useMapAtoms from "
|
|
4
|
+
import useMapAtoms from "../../../hooks/atoms/useMapAtoms.js";
|
|
5
5
|
/**
|
|
6
6
|
* @param props - The RN object props.
|
|
7
7
|
* @param objectId - The ID of the web object that owns the method.
|
|
@@ -52,7 +52,7 @@ const useWebObjectMountUnmountCallbacks = (props, objectId, objectType) => {
|
|
|
52
52
|
options = true,
|
|
53
53
|
listeners = true
|
|
54
54
|
} = {}) => {
|
|
55
|
-
//
|
|
55
|
+
// Unmount the component.
|
|
56
56
|
if (options && areOptionsMounted.current) {
|
|
57
57
|
dispatchMessage({
|
|
58
58
|
type: `webObjectUnmount`,
|
|
@@ -62,7 +62,7 @@ const useWebObjectMountUnmountCallbacks = (props, objectId, objectType) => {
|
|
|
62
62
|
});
|
|
63
63
|
areOptionsMounted.current = false;
|
|
64
64
|
}
|
|
65
|
-
//
|
|
65
|
+
// Unregister listeners on event from the web world.
|
|
66
66
|
if (listeners && areListenersMounted.current) {
|
|
67
67
|
deleteWebObjectListeners({
|
|
68
68
|
objectId
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useRef","useMapAtoms","useWebObjectMountUnmountCallbacks","props","objectId","objectType","areOptionsMounted","areListenersMounted","dispatchMessage","setWebObjectListeners","deleteWebObjectListeners","mount","options","listeners","current","type","payload","unmount"],"sourceRoot":"../../../../../../src","sources":["react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountCallbacks.ts"],"mappings":";;AAIA,SAA+BA,WAAW,EAAEC,MAAM,QAAQ,OAAO;AACjE,OAAOC,WAAW,MAAM,qCAAkC;AAG1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iCAAiC,GAAGA,CAGxCC,KAA6B,EAC7BC,QAAgB,EAChBC,UAAyB,KACtB;EACH;EACA,MAAMC,iBAAiB,GAAGN,MAAM,CAAU,KAAK,CAAC;EAChD,MAAMO,mBAAmB,GAAGP,MAAM,CAAU,KAAK,CAAC;EAClD;EACA;EACA,MAAM;IAAEQ,eAAe;IAAEC,qBAAqB;IAAEC;EAAyB,CAAC,GACxET,WAAW,CAAC,CAAC;EAEf,MAAMU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,CAAC;MACtCG,mBAAmB,CAACO,OAAO,GAAG,KAAK;IACrC;EACF,CAAC,EACD,CAACV,QAAQ,EAAEI,eAAe,EAAEE,wBAAwB,CACtD,CAAC;EAED,OAAO;IAAEC,KAAK;IAAEM;EAAQ,CAAC;AAC3B,CAAC;AAED,eAAef,iCAAiC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["mount","jest","fn","unmount","useWebObjectMountUnmountCallbacksMock"],"sourceRoot":"../../../../../../src","sources":["react-native/components-factories/web-objects/hooks/useWebObjectMountUnmountCallbacks.mock.ts"],"mappings":";;AAEA,OAAO,MAAMA,KAAK,GAAGC,IAAI,CAACC,EAAE,CAAC,CAAC;AAC9B,OAAO,MAAMC,OAAO,GAAGF,IAAI,CAACC,EAAE,CAAC,CAAC;AAEhC,MAAME,qCAAqC,GAAGA,CAAA,MAGxC;EACJJ,KAAK;EACLG;AACF,CAAC,CAAC;AAEF,eAAeC,qCAAqC","ignoreList":[]}
|