diff --git a/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/NativeMapViewModule.kt b/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/NativeMapViewModule.kt index 9f412f555..5ff073e3f 100644 --- a/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/NativeMapViewModule.kt +++ b/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/NativeMapViewModule.kt @@ -3,6 +3,7 @@ package com.rnmapbox.rnmbx.components.mapview import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.ReadableArray +import com.facebook.react.bridge.ReadableMap import com.facebook.react.bridge.WritableMap import com.facebook.react.bridge.WritableNativeMap import com.rnmapbox.rnmbx.NativeMapViewModuleSpec @@ -12,6 +13,7 @@ import com.rnmapbox.rnmbx.utils.ViewRefTag import com.rnmapbox.rnmbx.utils.ViewTagResolver import com.rnmapbox.rnmbx.utils.extensions.toCoordinate import com.rnmapbox.rnmbx.utils.extensions.toScreenCoordinate +import com.rnmapbox.rnmbx.utils.extensions.toValueHashMap class NativeMapViewModule(context: ReactApplicationContext, val viewTagResolver: ViewTagResolver) : NativeMapViewModuleSpec(context) { private fun withMapViewOnUIThread( @@ -158,6 +160,44 @@ class NativeMapViewModule(context: ReactApplicationContext, val viewTagResolver: } } + override fun setFeatureState( + viewRef: ViewRefTag?, + featureId: String, + state: ReadableMap, + sourceId: String, + sourceLayerId: String?, + promise: Promise + ) { + withMapViewOnUIThread(viewRef, promise) { + it.setFeatureState(featureId, state.toValueHashMap(), sourceId, sourceLayerId, createCommandResponse(promise)) + } + } + + override fun getFeatureState( + viewRef: ViewRefTag?, + featureId: String, + sourceId: String, + sourceLayerId: String?, + promise: Promise + ) { + withMapViewOnUIThread(viewRef, promise) { + it.getFeatureState(featureId, sourceId, sourceLayerId, createCommandResponse(promise)) + } + } + + override fun removeFeatureState( + viewRef: ViewRefTag?, + featureId: String, + stateKey: String?, + sourceId: String, + sourceLayerId: String?, + promise: Promise + ) { + withMapViewOnUIThread(viewRef, promise) { + it.removeFeatureState(featureId, stateKey, sourceId, sourceLayerId, createCommandResponse(promise)) + } + } + override fun querySourceFeatures( viewRef: ViewRefTag?, sourceId: String, diff --git a/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt b/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt index 688f3a637..465507f91 100644 --- a/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt +++ b/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt @@ -34,12 +34,14 @@ import com.mapbox.maps.extension.style.layers.properties.generated.ProjectionNam import com.mapbox.maps.extension.style.layers.properties.generated.Visibility import com.mapbox.maps.extension.style.projection.generated.Projection import com.mapbox.maps.extension.style.projection.generated.setProjection +import com.mapbox.maps.logE import com.mapbox.maps.plugin.attribution.attribution import com.mapbox.maps.plugin.compass.compass import com.mapbox.maps.plugin.delegates.listeners.* import com.mapbox.maps.plugin.gestures.* import com.mapbox.maps.plugin.logo.logo import com.mapbox.maps.plugin.scalebar.scalebar +import com.mapbox.maps.toCameraOptions import com.mapbox.maps.viewannotation.ViewAnnotationManager import com.rnmapbox.rnmbx.R import com.rnmapbox.rnmbx.components.AbstractMapFeature @@ -47,7 +49,9 @@ import com.rnmapbox.rnmbx.components.RemovalReason import com.rnmapbox.rnmbx.components.annotation.RNMBXMarkerView import com.rnmapbox.rnmbx.components.annotation.RNMBXMarkerViewManager import com.rnmapbox.rnmbx.components.annotation.RNMBXPointAnnotation +import com.rnmapbox.rnmbx.components.annotation.RNMBXPointAnnotationCoordinator import com.rnmapbox.rnmbx.components.camera.RNMBXCamera +import com.rnmapbox.rnmbx.components.images.ImageManager import com.rnmapbox.rnmbx.components.images.RNMBXImages import com.rnmapbox.rnmbx.components.location.LocationComponentManager import com.rnmapbox.rnmbx.components.location.RNMBXNativeUserLocation @@ -64,17 +68,11 @@ import com.rnmapbox.rnmbx.events.MapClickEvent import com.rnmapbox.rnmbx.events.constants.EventTypes import com.rnmapbox.rnmbx.utils.* import com.rnmapbox.rnmbx.utils.extensions.toReadableArray -import java.util.* - -import com.rnmapbox.rnmbx.components.annotation.RNMBXPointAnnotationCoordinator -import com.rnmapbox.rnmbx.components.images.ImageManager - import com.rnmapbox.rnmbx.v11compat.event.* -import com.rnmapbox.rnmbx.v11compat.feature.* -import com.rnmapbox.rnmbx.v11compat.mapboxmap.* import com.rnmapbox.rnmbx.v11compat.ornamentsettings.* -import org.json.JSONException -import org.json.JSONObject +import java.util.* +import org.json.* + fun MutableList.removeIf21(predicate: (T) -> Boolean): Boolean { var removed = false @@ -1097,6 +1095,50 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie } } + fun setFeatureState( + featureId: String, + state: HashMap, + sourceId: String, + sourceLayerId: String?, + response: CommandResponse + ) { + mapView.getMapboxMap().setFeatureState(sourceId, sourceLayerId, featureId, Value.valueOf(state)) + response.success { } + } + + fun getFeatureState( + featureId: String, + sourceId: String, + sourceLayerId: String?, + response: CommandResponse + ) { + mapView.getMapboxMap().getFeatureState(sourceId, sourceLayerId, featureId) { expected -> + if (expected.isValue) { + response.success { + val state = expected.value!!.contents + if (state is Map<*,*>) { + it.putMap("featureState", writableMapOf(*state.map { it.key to it.value}.toTypedArray())) + } else { + it.putMap("featureState", Arguments.createMap()) + } + } + } else { + response.error(expected.error!!.toString()) + } + } + } + + fun removeFeatureState( + featureId: String, + stateKey: String?, + sourceId: String, + sourceLayerId: String?, + response: CommandResponse + ) { + mapView.getMapboxMap().removeFeatureState(sourceId, sourceLayerId, featureId, stateKey) + response.success { } + } + fun match(layer: Layer, sourceId:String, sourceLayerId: String?) : Boolean { fun match(actSourceId: String, actSourceLayerId: String?) : Boolean { return (actSourceId == sourceId && ((sourceLayerId == null) || (sourceLayerId == actSourceLayerId))) diff --git a/android/src/main/java/com/rnmapbox/rnmbx/utils/writeableMapArrayOf.kt b/android/src/main/java/com/rnmapbox/rnmbx/utils/writeableMapArrayOf.kt index e469abb3b..1b2a77b3a 100644 --- a/android/src/main/java/com/rnmapbox/rnmbx/utils/writeableMapArrayOf.kt +++ b/android/src/main/java/com/rnmapbox/rnmbx/utils/writeableMapArrayOf.kt @@ -3,10 +3,12 @@ package com.rnmapbox.rnmbx.utils import com.facebook.react.bridge.Arguments import com.facebook.react.bridge.WritableArray import com.facebook.react.bridge.WritableMap +import com.mapbox.bindgen.Value -fun writableMapOf(vararg values: Pair): WritableMap { +fun writableMapOf(vararg values: Pair<*, *>): WritableMap { val map = Arguments.createMap() for ((key, value) in values) { + if (key !is String) continue; when (value) { null -> map.putNull(key) is Boolean -> map.putBoolean(key, value) @@ -14,8 +16,23 @@ fun writableMapOf(vararg values: Pair): WritableMap { is Int -> map.putInt(key, value) is Long -> map.putInt(key, value.toInt()) is String -> map.putString(key, value) + is Map<*,*> -> map.putMap(key, writableMapOf(*value.map { it.key to it.value }.toTypedArray())) + is Array<*> -> map.putArray(key, writableArrayOf(*value.map{it as Any}.toTypedArray())) is WritableMap -> map.putMap(key, value) is WritableArray -> map.putArray(key, value) + is Value -> { + val contents = value.contents + when (contents) { + null -> map.putNull(key) + is Boolean -> map.putBoolean(key, contents) + is Double -> map.putDouble(key, contents) + is Int -> map.putInt(key, contents) + is Long -> map.putInt(key, contents.toInt()) + is String -> map.putString(key, contents) + is WritableMap -> map.putMap(key, contents) + is WritableArray -> map.putArray(key, contents) + } + } else -> throw IllegalArgumentException("Unsupported value type ${value::class.java.name} for key [$key]") } } @@ -32,8 +49,25 @@ fun writableArrayOf(vararg values: Any): WritableArray { is Int -> array.pushInt(value) is Long -> array.pushInt(value.toInt()) is String -> array.pushString(value) + is Map<*,*> -> array.pushMap(writableMapOf(*value.map { it.key to it.value }.toTypedArray())) + is Array<*> -> array.pushArray(writableArrayOf(*value.map{ it as Any }.toTypedArray())) is WritableMap -> array.pushMap(value) is WritableArray -> array.pushArray(value) + is Value -> { + val contents = value.contents + when (contents) { + null -> array.pushNull() + is Boolean -> array.pushBoolean(contents) + is Double -> array.pushDouble(contents) + is Int -> array.pushInt(contents) + is Long -> array.pushInt(contents.toInt()) + is String -> array.pushString(contents) + is Map<*,*> -> array.pushMap(writableMapOf(*contents.map { it.key to it.value }.toTypedArray())) + is Array<*> -> array.pushArray(writableArrayOf(*contents.map{it as Any}.toTypedArray())) + is WritableMap -> array.pushMap(contents) + is WritableArray -> array.pushArray(contents) + } + } else -> throw IllegalArgumentException("Unsupported value type ${value::class.java.name}") } } diff --git a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeMapViewModuleSpec.java b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeMapViewModuleSpec.java index 5014f4c73..c20e7e65f 100644 --- a/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeMapViewModuleSpec.java +++ b/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeMapViewModuleSpec.java @@ -19,6 +19,7 @@ import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReactModuleWithSpec; import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.bridge.ReadableMap; import com.facebook.react.turbomodule.core.interfaces.TurboModule; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -83,6 +84,18 @@ public NativeMapViewModuleSpec(ReactApplicationContext reactContext) { @DoNotStrip public abstract void clearData(@Nullable Double viewRef, Promise promise); + @ReactMethod + @DoNotStrip + public abstract void setFeatureState(@Nullable Double viewRef, String featureId, ReadableMap state, String sourceId, @Nullable String sourceLayerId, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void getFeatureState(@Nullable Double viewRef, String featureId, String sourceId, @Nullable String sourceLayerId, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void removeFeatureState(@Nullable Double viewRef, String featureId, @Nullable String stateKey, String sourceId, @Nullable String sourceLayerId, Promise promise); + @ReactMethod @DoNotStrip public abstract void querySourceFeatures(@Nullable Double viewRef, String sourceId, ReadableArray withFilter, ReadableArray withSourceLayerIDs, Promise promise); diff --git a/docs/MapView.md b/docs/MapView.md index 8f252f119..c86862b75 100644 --- a/docs/MapView.md +++ b/docs/MapView.md @@ -712,7 +712,9 @@ Queries the currently loaded data for elevation at a geographical location.
| `coordinate` | `Position` | `Yes` | the coordinates to query elevation at | -[Query Terrain Elevation](../examples/V10/QueryTerrainElevation)### setSourceVisibility(visible, sourceId[, sourceLayerId]) +[Query Terrain Elevation](../examples/V10/QueryTerrainElevation) + +### setSourceVisibility(visible, sourceId[, sourceLayerId]) Sets the visibility of all the layers referencing the specified `sourceLayerId` and/or `sourceId` @@ -721,7 +723,7 @@ Sets the visibility of all the layers referencing the specified `sourceLayerId` | ---- | :--: | :------: | :----------: | | `visible` | `boolean` | `Yes` | Visibility of the layers | | `sourceId` | `string` | `Yes` | Identifier of the target source (e.g. 'composite') | -| `sourceLayerId` | `String` | `No` | Identifier of the target source-layer (e.g. 'building') | +| `sourceLayerId` | `string` | `No` | Identifier of the target source-layer (e.g. 'building') | @@ -729,5 +731,58 @@ Sets the visibility of all the layers referencing the specified `sourceLayerId` await this._map.setSourceVisibility(false, 'composite', 'building') ``` +### setFeatureState(featureId, state, sourceId [, sourceLayerId]) + +Updates the state map of a feature within a style source. + +Updates entries in the state map of a given feature within a style source. + +Only entries listed in the `state` will be updated. + +An entry in the feature state map that is not listed in `state` will retain its previous value. + +#### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `featureId` | `string` | `Yes` | Identifier of the feature whose state should be updated | +| `state` | `object` | `Yes` | Map of entries to update with their respective new values. | +| `sourceId` | `string` | `Yes` | Style source identifier | +| `sourceLayerId` | `string` | `No` | Style source layer identifier (for multi-layer sources such as vector sources). | + +```javascript +await this._map.setFeatureState('my-feature-id', { 'my-feature-state-key': 'my-feature-state-value' }, 'my-source-id', 'my-source-layer-id') +``` + + +### getFeatureState(featureId, sourceId [, sourceLayerId]) + +Returns the state map of a feature within a style source. + +#### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `featureId` | `string` | `Yes` | Identifier of the feature whose state should be updated. | +| `sourceId` | `string` | `Yes` | Style source identifier. | +| `sourceLayerId` | `string` | `No` | Style source layer identifier (for multi-layer sources such as vector sources). | + +```javascript +await this._map.getFeatureState('my-feature-id', 'my-source-id', 'my-source-layer-id') +``` + +### removeFeatureState(featureId, stateKey, sourceId [, sourceLayerId]) +Removes entries from a feature state object. +Removes a specified property or all properties from a feature's state object depending on the value of `stateKey`. + +#### arguments +| Name | Type | Required | Description | +| ---- | :--: | :------: | :----------: | +| `featureId` | `string` | `Yes` | Identifier of the feature whose state should be removed. | +| `stateKey` | `string` or `null` | `Yes` | The name of the property to remove. If `null`, all feature’s state object properties are removed. | +| `sourceId` | `string` | `Yes` | Style source identifier. | +| `sourceLayerId` | `string` | `No` | Style source layer identifier (for multi-layer sources such as vector sources). | + +```javascript +await this._map.removeFeatureState('my-feature-id', 'my-feature-state-key', 'my-source-id', 'my-source-layer-id') +``` diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 4cc32ba93..47f32536e 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,21 +1,21 @@ PODS: - boost (1.84.0) - DoubleConversion (1.1.6) - - FBLazyVector (0.76.0-rc.6) + - FBLazyVector (0.76.0) - fmt (9.1.0) - glog (0.3.5) - - hermes-engine (0.76.0-rc.6): - - hermes-engine/Pre-built (= 0.76.0-rc.6) - - hermes-engine/Pre-built (0.76.0-rc.6) - - MapboxCommon (23.10.1) - - MapboxCoreMaps (10.18.0): - - MapboxCommon (~> 23.10) - - MapboxMaps (10.18.2): - - MapboxCommon (= 23.10.1) - - MapboxCoreMaps (= 10.18.0) - - MapboxMobileEvents (= 1.0.10) + - hermes-engine (0.76.0): + - hermes-engine/Pre-built (= 0.76.0) + - hermes-engine/Pre-built (0.76.0) + - MapboxCommon (23.11.2) + - MapboxCoreMaps (10.19.2): + - MapboxCommon (~> 23.11) + - MapboxMaps (10.19.1): + - MapboxCommon (= 23.11.2) + - MapboxCoreMaps (= 10.19.2) + - MapboxMobileEvents (= 2.0.0) - Turf (= 2.8.0) - - MapboxMobileEvents (1.0.10) + - MapboxMobileEvents (2.0.0) - RCT-Folly (2024.01.01.00): - boost - DoubleConversion @@ -32,32 +32,32 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - RCTDeprecation (0.76.0-rc.6) - - RCTRequired (0.76.0-rc.6) - - RCTTypeSafety (0.76.0-rc.6): - - FBLazyVector (= 0.76.0-rc.6) - - RCTRequired (= 0.76.0-rc.6) - - React-Core (= 0.76.0-rc.6) - - React (0.76.0-rc.6): - - React-Core (= 0.76.0-rc.6) - - React-Core/DevSupport (= 0.76.0-rc.6) - - React-Core/RCTWebSocket (= 0.76.0-rc.6) - - React-RCTActionSheet (= 0.76.0-rc.6) - - React-RCTAnimation (= 0.76.0-rc.6) - - React-RCTBlob (= 0.76.0-rc.6) - - React-RCTImage (= 0.76.0-rc.6) - - React-RCTLinking (= 0.76.0-rc.6) - - React-RCTNetwork (= 0.76.0-rc.6) - - React-RCTSettings (= 0.76.0-rc.6) - - React-RCTText (= 0.76.0-rc.6) - - React-RCTVibration (= 0.76.0-rc.6) - - React-callinvoker (0.76.0-rc.6) - - React-Core (0.76.0-rc.6): + - RCTDeprecation (0.76.0) + - RCTRequired (0.76.0) + - RCTTypeSafety (0.76.0): + - FBLazyVector (= 0.76.0) + - RCTRequired (= 0.76.0) + - React-Core (= 0.76.0) + - React (0.76.0): + - React-Core (= 0.76.0) + - React-Core/DevSupport (= 0.76.0) + - React-Core/RCTWebSocket (= 0.76.0) + - React-RCTActionSheet (= 0.76.0) + - React-RCTAnimation (= 0.76.0) + - React-RCTBlob (= 0.76.0) + - React-RCTImage (= 0.76.0) + - React-RCTLinking (= 0.76.0) + - React-RCTNetwork (= 0.76.0) + - React-RCTSettings (= 0.76.0) + - React-RCTText (= 0.76.0) + - React-RCTVibration (= 0.76.0) + - React-callinvoker (0.76.0) + - React-Core (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - RCTDeprecation - - React-Core/Default (= 0.76.0-rc.6) + - React-Core/Default (= 0.76.0) - React-cxxreact - React-featureflags - React-hermes @@ -69,7 +69,7 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-Core/CoreModulesHeaders (0.76.0-rc.6): + - React-Core/CoreModulesHeaders (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -86,7 +86,7 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-Core/Default (0.76.0-rc.6): + - React-Core/Default (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -102,13 +102,13 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-Core/DevSupport (0.76.0-rc.6): + - React-Core/DevSupport (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - RCTDeprecation - - React-Core/Default (= 0.76.0-rc.6) - - React-Core/RCTWebSocket (= 0.76.0-rc.6) + - React-Core/Default (= 0.76.0) + - React-Core/RCTWebSocket (= 0.76.0) - React-cxxreact - React-featureflags - React-hermes @@ -120,7 +120,7 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-Core/RCTActionSheetHeaders (0.76.0-rc.6): + - React-Core/RCTActionSheetHeaders (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -137,7 +137,7 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-Core/RCTAnimationHeaders (0.76.0-rc.6): + - React-Core/RCTAnimationHeaders (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -154,7 +154,7 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-Core/RCTBlobHeaders (0.76.0-rc.6): + - React-Core/RCTBlobHeaders (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -171,7 +171,7 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-Core/RCTImageHeaders (0.76.0-rc.6): + - React-Core/RCTImageHeaders (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -188,7 +188,7 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-Core/RCTLinkingHeaders (0.76.0-rc.6): + - React-Core/RCTLinkingHeaders (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -205,7 +205,7 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-Core/RCTNetworkHeaders (0.76.0-rc.6): + - React-Core/RCTNetworkHeaders (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -222,7 +222,7 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-Core/RCTSettingsHeaders (0.76.0-rc.6): + - React-Core/RCTSettingsHeaders (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -239,7 +239,7 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-Core/RCTTextHeaders (0.76.0-rc.6): + - React-Core/RCTTextHeaders (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -256,7 +256,7 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-Core/RCTVibrationHeaders (0.76.0-rc.6): + - React-Core/RCTVibrationHeaders (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -273,12 +273,12 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-Core/RCTWebSocket (0.76.0-rc.6): + - React-Core/RCTWebSocket (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - RCTDeprecation - - React-Core/Default (= 0.76.0-rc.6) + - React-Core/Default (= 0.76.0) - React-cxxreact - React-featureflags - React-hermes @@ -290,37 +290,37 @@ PODS: - React-utils - SocketRocket (= 0.7.1) - Yoga - - React-CoreModules (0.76.0-rc.6): + - React-CoreModules (0.76.0): - DoubleConversion - fmt (= 9.1.0) - RCT-Folly (= 2024.01.01.00) - - RCTTypeSafety (= 0.76.0-rc.6) - - React-Core/CoreModulesHeaders (= 0.76.0-rc.6) - - React-jsi (= 0.76.0-rc.6) + - RCTTypeSafety (= 0.76.0) + - React-Core/CoreModulesHeaders (= 0.76.0) + - React-jsi (= 0.76.0) - React-jsinspector - React-NativeModulesApple - React-RCTBlob - - React-RCTImage (= 0.76.0-rc.6) + - React-RCTImage (= 0.76.0) - ReactCodegen - ReactCommon - SocketRocket (= 0.7.1) - - React-cxxreact (0.76.0-rc.6): + - React-cxxreact (0.76.0): - boost - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-callinvoker (= 0.76.0-rc.6) - - React-debug (= 0.76.0-rc.6) - - React-jsi (= 0.76.0-rc.6) + - React-callinvoker (= 0.76.0) + - React-debug (= 0.76.0) + - React-jsi (= 0.76.0) - React-jsinspector - - React-logger (= 0.76.0-rc.6) - - React-perflogger (= 0.76.0-rc.6) - - React-runtimeexecutor (= 0.76.0-rc.6) - - React-timing (= 0.76.0-rc.6) - - React-debug (0.76.0-rc.6) - - React-defaultsnativemodule (0.76.0-rc.6): + - React-logger (= 0.76.0) + - React-perflogger (= 0.76.0) + - React-runtimeexecutor (= 0.76.0) + - React-timing (= 0.76.0) + - React-debug (0.76.0) + - React-defaultsnativemodule (0.76.0): - DoubleConversion - glog - hermes-engine @@ -345,7 +345,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - React-domnativemodule (0.76.0-rc.6): + - React-domnativemodule (0.76.0): - DoubleConversion - glog - hermes-engine @@ -367,7 +367,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - React-Fabric (0.76.0-rc.6): + - React-Fabric (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -378,21 +378,21 @@ PODS: - React-Core - React-cxxreact - React-debug - - React-Fabric/animations (= 0.76.0-rc.6) - - React-Fabric/attributedstring (= 0.76.0-rc.6) - - React-Fabric/componentregistry (= 0.76.0-rc.6) - - React-Fabric/componentregistrynative (= 0.76.0-rc.6) - - React-Fabric/components (= 0.76.0-rc.6) - - React-Fabric/core (= 0.76.0-rc.6) - - React-Fabric/dom (= 0.76.0-rc.6) - - React-Fabric/imagemanager (= 0.76.0-rc.6) - - React-Fabric/leakchecker (= 0.76.0-rc.6) - - React-Fabric/mounting (= 0.76.0-rc.6) - - React-Fabric/observers (= 0.76.0-rc.6) - - React-Fabric/scheduler (= 0.76.0-rc.6) - - React-Fabric/telemetry (= 0.76.0-rc.6) - - React-Fabric/templateprocessor (= 0.76.0-rc.6) - - React-Fabric/uimanager (= 0.76.0-rc.6) + - React-Fabric/animations (= 0.76.0) + - React-Fabric/attributedstring (= 0.76.0) + - React-Fabric/componentregistry (= 0.76.0) + - React-Fabric/componentregistrynative (= 0.76.0) + - React-Fabric/components (= 0.76.0) + - React-Fabric/core (= 0.76.0) + - React-Fabric/dom (= 0.76.0) + - React-Fabric/imagemanager (= 0.76.0) + - React-Fabric/leakchecker (= 0.76.0) + - React-Fabric/mounting (= 0.76.0) + - React-Fabric/observers (= 0.76.0) + - React-Fabric/scheduler (= 0.76.0) + - React-Fabric/telemetry (= 0.76.0) + - React-Fabric/templateprocessor (= 0.76.0) + - React-Fabric/uimanager (= 0.76.0) - React-featureflags - React-graphics - React-jsi @@ -402,7 +402,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/animations (0.76.0-rc.6): + - React-Fabric/animations (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -422,7 +422,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/attributedstring (0.76.0-rc.6): + - React-Fabric/attributedstring (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -442,7 +442,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/componentregistry (0.76.0-rc.6): + - React-Fabric/componentregistry (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -462,7 +462,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/componentregistrynative (0.76.0-rc.6): + - React-Fabric/componentregistrynative (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -482,7 +482,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components (0.76.0-rc.6): + - React-Fabric/components (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -493,9 +493,9 @@ PODS: - React-Core - React-cxxreact - React-debug - - React-Fabric/components/legacyviewmanagerinterop (= 0.76.0-rc.6) - - React-Fabric/components/root (= 0.76.0-rc.6) - - React-Fabric/components/view (= 0.76.0-rc.6) + - React-Fabric/components/legacyviewmanagerinterop (= 0.76.0) + - React-Fabric/components/root (= 0.76.0) + - React-Fabric/components/view (= 0.76.0) - React-featureflags - React-graphics - React-jsi @@ -505,7 +505,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/legacyviewmanagerinterop (0.76.0-rc.6): + - React-Fabric/components/legacyviewmanagerinterop (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -525,7 +525,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/root (0.76.0-rc.6): + - React-Fabric/components/root (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -545,7 +545,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/view (0.76.0-rc.6): + - React-Fabric/components/view (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -566,7 +566,7 @@ PODS: - React-utils - ReactCommon/turbomodule/core - Yoga - - React-Fabric/core (0.76.0-rc.6): + - React-Fabric/core (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -586,7 +586,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/dom (0.76.0-rc.6): + - React-Fabric/dom (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -606,7 +606,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/imagemanager (0.76.0-rc.6): + - React-Fabric/imagemanager (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -626,7 +626,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/leakchecker (0.76.0-rc.6): + - React-Fabric/leakchecker (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -646,7 +646,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/mounting (0.76.0-rc.6): + - React-Fabric/mounting (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -666,7 +666,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/observers (0.76.0-rc.6): + - React-Fabric/observers (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -677,7 +677,7 @@ PODS: - React-Core - React-cxxreact - React-debug - - React-Fabric/observers/events (= 0.76.0-rc.6) + - React-Fabric/observers/events (= 0.76.0) - React-featureflags - React-graphics - React-jsi @@ -687,7 +687,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/observers/events (0.76.0-rc.6): + - React-Fabric/observers/events (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -707,7 +707,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/scheduler (0.76.0-rc.6): + - React-Fabric/scheduler (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -729,7 +729,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/telemetry (0.76.0-rc.6): + - React-Fabric/telemetry (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -749,7 +749,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/templateprocessor (0.76.0-rc.6): + - React-Fabric/templateprocessor (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -769,7 +769,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/uimanager (0.76.0-rc.6): + - React-Fabric/uimanager (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -780,7 +780,7 @@ PODS: - React-Core - React-cxxreact - React-debug - - React-Fabric/uimanager/consistency (= 0.76.0-rc.6) + - React-Fabric/uimanager/consistency (= 0.76.0) - React-featureflags - React-graphics - React-jsi @@ -791,7 +791,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/uimanager/consistency (0.76.0-rc.6): + - React-Fabric/uimanager/consistency (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -812,7 +812,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-FabricComponents (0.76.0-rc.6): + - React-FabricComponents (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -824,8 +824,8 @@ PODS: - React-cxxreact - React-debug - React-Fabric - - React-FabricComponents/components (= 0.76.0-rc.6) - - React-FabricComponents/textlayoutmanager (= 0.76.0-rc.6) + - React-FabricComponents/components (= 0.76.0) + - React-FabricComponents/textlayoutmanager (= 0.76.0) - React-featureflags - React-graphics - React-jsi @@ -837,7 +837,7 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/core - Yoga - - React-FabricComponents/components (0.76.0-rc.6): + - React-FabricComponents/components (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -849,15 +849,15 @@ PODS: - React-cxxreact - React-debug - React-Fabric - - React-FabricComponents/components/inputaccessory (= 0.76.0-rc.6) - - React-FabricComponents/components/iostextinput (= 0.76.0-rc.6) - - React-FabricComponents/components/modal (= 0.76.0-rc.6) - - React-FabricComponents/components/rncore (= 0.76.0-rc.6) - - React-FabricComponents/components/safeareaview (= 0.76.0-rc.6) - - React-FabricComponents/components/scrollview (= 0.76.0-rc.6) - - React-FabricComponents/components/text (= 0.76.0-rc.6) - - React-FabricComponents/components/textinput (= 0.76.0-rc.6) - - React-FabricComponents/components/unimplementedview (= 0.76.0-rc.6) + - React-FabricComponents/components/inputaccessory (= 0.76.0) + - React-FabricComponents/components/iostextinput (= 0.76.0) + - React-FabricComponents/components/modal (= 0.76.0) + - React-FabricComponents/components/rncore (= 0.76.0) + - React-FabricComponents/components/safeareaview (= 0.76.0) + - React-FabricComponents/components/scrollview (= 0.76.0) + - React-FabricComponents/components/text (= 0.76.0) + - React-FabricComponents/components/textinput (= 0.76.0) + - React-FabricComponents/components/unimplementedview (= 0.76.0) - React-featureflags - React-graphics - React-jsi @@ -869,7 +869,7 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/core - Yoga - - React-FabricComponents/components/inputaccessory (0.76.0-rc.6): + - React-FabricComponents/components/inputaccessory (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -892,7 +892,7 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/core - Yoga - - React-FabricComponents/components/iostextinput (0.76.0-rc.6): + - React-FabricComponents/components/iostextinput (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -915,7 +915,7 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/core - Yoga - - React-FabricComponents/components/modal (0.76.0-rc.6): + - React-FabricComponents/components/modal (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -938,7 +938,7 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/core - Yoga - - React-FabricComponents/components/rncore (0.76.0-rc.6): + - React-FabricComponents/components/rncore (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -961,7 +961,7 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/core - Yoga - - React-FabricComponents/components/safeareaview (0.76.0-rc.6): + - React-FabricComponents/components/safeareaview (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -984,7 +984,7 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/core - Yoga - - React-FabricComponents/components/scrollview (0.76.0-rc.6): + - React-FabricComponents/components/scrollview (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -1007,7 +1007,7 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/core - Yoga - - React-FabricComponents/components/text (0.76.0-rc.6): + - React-FabricComponents/components/text (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -1030,7 +1030,7 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/core - Yoga - - React-FabricComponents/components/textinput (0.76.0-rc.6): + - React-FabricComponents/components/textinput (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -1053,7 +1053,7 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/core - Yoga - - React-FabricComponents/components/unimplementedview (0.76.0-rc.6): + - React-FabricComponents/components/unimplementedview (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -1076,7 +1076,7 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/core - Yoga - - React-FabricComponents/textlayoutmanager (0.76.0-rc.6): + - React-FabricComponents/textlayoutmanager (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -1099,26 +1099,26 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/core - Yoga - - React-FabricImage (0.76.0-rc.6): + - React-FabricImage (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly/Fabric (= 2024.01.01.00) - - RCTRequired (= 0.76.0-rc.6) - - RCTTypeSafety (= 0.76.0-rc.6) + - RCTRequired (= 0.76.0) + - RCTTypeSafety (= 0.76.0) - React-Fabric - React-graphics - React-ImageManager - React-jsi - - React-jsiexecutor (= 0.76.0-rc.6) + - React-jsiexecutor (= 0.76.0) - React-logger - React-rendererdebug - React-utils - ReactCommon - Yoga - - React-featureflags (0.76.0-rc.6) - - React-featureflagsnativemodule (0.76.0-rc.6): + - React-featureflags (0.76.0) + - React-featureflagsnativemodule (0.76.0): - DoubleConversion - glog - hermes-engine @@ -1139,7 +1139,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - React-graphics (0.76.0-rc.6): + - React-graphics (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog @@ -1147,19 +1147,19 @@ PODS: - React-jsi - React-jsiexecutor - React-utils - - React-hermes (0.76.0-rc.6): + - React-hermes (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-cxxreact (= 0.76.0-rc.6) + - React-cxxreact (= 0.76.0) - React-jsi - - React-jsiexecutor (= 0.76.0-rc.6) + - React-jsiexecutor (= 0.76.0) - React-jsinspector - - React-perflogger (= 0.76.0-rc.6) + - React-perflogger (= 0.76.0) - React-runtimeexecutor - - React-idlecallbacksnativemodule (0.76.0-rc.6): + - React-idlecallbacksnativemodule (0.76.0): - DoubleConversion - glog - hermes-engine @@ -1181,7 +1181,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - React-ImageManager (0.76.0-rc.6): + - React-ImageManager (0.76.0): - glog - RCT-Folly/Fabric - React-Core/Default @@ -1190,47 +1190,47 @@ PODS: - React-graphics - React-rendererdebug - React-utils - - React-jserrorhandler (0.76.0-rc.6): + - React-jserrorhandler (0.76.0): - glog - hermes-engine - RCT-Folly/Fabric (= 2024.01.01.00) - React-cxxreact - React-debug - React-jsi - - React-jsi (0.76.0-rc.6): + - React-jsi (0.76.0): - boost - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-jsiexecutor (0.76.0-rc.6): + - React-jsiexecutor (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-cxxreact (= 0.76.0-rc.6) - - React-jsi (= 0.76.0-rc.6) + - React-cxxreact (= 0.76.0) + - React-jsi (= 0.76.0) - React-jsinspector - - React-perflogger (= 0.76.0-rc.6) - - React-jsinspector (0.76.0-rc.6): + - React-perflogger (= 0.76.0) + - React-jsinspector (0.76.0): - DoubleConversion - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - React-featureflags - React-jsi - - React-perflogger (= 0.76.0-rc.6) - - React-runtimeexecutor (= 0.76.0-rc.6) - - React-jsitracing (0.76.0-rc.6): + - React-perflogger (= 0.76.0) + - React-runtimeexecutor (= 0.76.0) + - React-jsitracing (0.76.0): - React-jsi - - React-logger (0.76.0-rc.6): + - React-logger (0.76.0): - glog - - React-Mapbuffer (0.76.0-rc.6): + - React-Mapbuffer (0.76.0): - glog - React-debug - - React-microtasksnativemodule (0.76.0-rc.6): + - React-microtasksnativemodule (0.76.0): - DoubleConversion - glog - hermes-engine @@ -1251,7 +1251,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - react-native-safe-area-context (4.11.1): + - react-native-safe-area-context (4.12.0): - DoubleConversion - glog - hermes-engine @@ -1264,8 +1264,8 @@ PODS: - React-featureflags - React-graphics - React-ImageManager - - react-native-safe-area-context/common (= 4.11.1) - - react-native-safe-area-context/fabric (= 4.11.1) + - react-native-safe-area-context/common (= 4.12.0) + - react-native-safe-area-context/fabric (= 4.12.0) - React-NativeModulesApple - React-RCTFabric - React-rendererdebug @@ -1274,7 +1274,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - react-native-safe-area-context/common (4.11.1): + - react-native-safe-area-context/common (4.12.0): - DoubleConversion - glog - hermes-engine @@ -1295,7 +1295,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - react-native-safe-area-context/fabric (4.11.1): + - react-native-safe-area-context/fabric (4.12.0): - DoubleConversion - glog - hermes-engine @@ -1317,8 +1317,8 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - React-nativeconfig (0.76.0-rc.6) - - React-NativeModulesApple (0.76.0-rc.6): + - React-nativeconfig (0.76.0) + - React-NativeModulesApple (0.76.0): - glog - hermes-engine - React-callinvoker @@ -1329,16 +1329,16 @@ PODS: - React-runtimeexecutor - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - React-perflogger (0.76.0-rc.6): + - React-perflogger (0.76.0): - DoubleConversion - RCT-Folly (= 2024.01.01.00) - - React-performancetimeline (0.76.0-rc.6): + - React-performancetimeline (0.76.0): - RCT-Folly (= 2024.01.01.00) - React-cxxreact - React-timing - - React-RCTActionSheet (0.76.0-rc.6): - - React-Core/RCTActionSheetHeaders (= 0.76.0-rc.6) - - React-RCTAnimation (0.76.0-rc.6): + - React-RCTActionSheet (0.76.0): + - React-Core/RCTActionSheetHeaders (= 0.76.0) + - React-RCTAnimation (0.76.0): - RCT-Folly (= 2024.01.01.00) - RCTTypeSafety - React-Core/RCTAnimationHeaders @@ -1346,7 +1346,7 @@ PODS: - React-NativeModulesApple - ReactCodegen - ReactCommon - - React-RCTAppDelegate (0.76.0-rc.6): + - React-RCTAppDelegate (0.76.0): - RCT-Folly (= 2024.01.01.00) - RCTRequired - RCTTypeSafety @@ -1371,7 +1371,7 @@ PODS: - React-utils - ReactCodegen - ReactCommon - - React-RCTBlob (0.76.0-rc.6): + - React-RCTBlob (0.76.0): - DoubleConversion - fmt (= 9.1.0) - hermes-engine @@ -1384,7 +1384,7 @@ PODS: - React-RCTNetwork - ReactCodegen - ReactCommon - - React-RCTFabric (0.76.0-rc.6): + - React-RCTFabric (0.76.0): - glog - hermes-engine - RCT-Folly/Fabric (= 2024.01.01.00) @@ -1407,7 +1407,7 @@ PODS: - React-runtimescheduler - React-utils - Yoga - - React-RCTImage (0.76.0-rc.6): + - React-RCTImage (0.76.0): - RCT-Folly (= 2024.01.01.00) - RCTTypeSafety - React-Core/RCTImageHeaders @@ -1416,14 +1416,14 @@ PODS: - React-RCTNetwork - ReactCodegen - ReactCommon - - React-RCTLinking (0.76.0-rc.6): - - React-Core/RCTLinkingHeaders (= 0.76.0-rc.6) - - React-jsi (= 0.76.0-rc.6) + - React-RCTLinking (0.76.0): + - React-Core/RCTLinkingHeaders (= 0.76.0) + - React-jsi (= 0.76.0) - React-NativeModulesApple - ReactCodegen - ReactCommon - - ReactCommon/turbomodule/core (= 0.76.0-rc.6) - - React-RCTNetwork (0.76.0-rc.6): + - ReactCommon/turbomodule/core (= 0.76.0) + - React-RCTNetwork (0.76.0): - RCT-Folly (= 2024.01.01.00) - RCTTypeSafety - React-Core/RCTNetworkHeaders @@ -1431,7 +1431,7 @@ PODS: - React-NativeModulesApple - ReactCodegen - ReactCommon - - React-RCTSettings (0.76.0-rc.6): + - React-RCTSettings (0.76.0): - RCT-Folly (= 2024.01.01.00) - RCTTypeSafety - React-Core/RCTSettingsHeaders @@ -1439,24 +1439,24 @@ PODS: - React-NativeModulesApple - ReactCodegen - ReactCommon - - React-RCTText (0.76.0-rc.6): - - React-Core/RCTTextHeaders (= 0.76.0-rc.6) + - React-RCTText (0.76.0): + - React-Core/RCTTextHeaders (= 0.76.0) - Yoga - - React-RCTVibration (0.76.0-rc.6): + - React-RCTVibration (0.76.0): - RCT-Folly (= 2024.01.01.00) - React-Core/RCTVibrationHeaders - React-jsi - React-NativeModulesApple - ReactCodegen - ReactCommon - - React-rendererconsistency (0.76.0-rc.6) - - React-rendererdebug (0.76.0-rc.6): + - React-rendererconsistency (0.76.0) + - React-rendererdebug (0.76.0): - DoubleConversion - fmt (= 9.1.0) - RCT-Folly (= 2024.01.01.00) - React-debug - - React-rncore (0.76.0-rc.6) - - React-RuntimeApple (0.76.0-rc.6): + - React-rncore (0.76.0) + - React-RuntimeApple (0.76.0): - hermes-engine - RCT-Folly/Fabric (= 2024.01.01.00) - React-callinvoker @@ -1475,7 +1475,7 @@ PODS: - React-RuntimeHermes - React-runtimescheduler - React-utils - - React-RuntimeCore (0.76.0-rc.6): + - React-RuntimeCore (0.76.0): - glog - hermes-engine - RCT-Folly/Fabric (= 2024.01.01.00) @@ -1489,9 +1489,9 @@ PODS: - React-runtimeexecutor - React-runtimescheduler - React-utils - - React-runtimeexecutor (0.76.0-rc.6): - - React-jsi (= 0.76.0-rc.6) - - React-RuntimeHermes (0.76.0-rc.6): + - React-runtimeexecutor (0.76.0): + - React-jsi (= 0.76.0) + - React-RuntimeHermes (0.76.0): - hermes-engine - RCT-Folly/Fabric (= 2024.01.01.00) - React-featureflags @@ -1502,7 +1502,7 @@ PODS: - React-nativeconfig - React-RuntimeCore - React-utils - - React-runtimescheduler (0.76.0-rc.6): + - React-runtimescheduler (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -1517,14 +1517,14 @@ PODS: - React-runtimeexecutor - React-timing - React-utils - - React-timing (0.76.0-rc.6) - - React-utils (0.76.0-rc.6): + - React-timing (0.76.0) + - React-utils (0.76.0): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - React-debug - - React-jsi (= 0.76.0-rc.6) - - ReactCodegen (0.76.0-rc.6): + - React-jsi (= 0.76.0) + - ReactCodegen (0.76.0): - DoubleConversion - glog - hermes-engine @@ -1544,47 +1544,47 @@ PODS: - React-utils - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - ReactCommon (0.76.0-rc.6): - - ReactCommon/turbomodule (= 0.76.0-rc.6) - - ReactCommon/turbomodule (0.76.0-rc.6): + - ReactCommon (0.76.0): + - ReactCommon/turbomodule (= 0.76.0) + - ReactCommon/turbomodule (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-callinvoker (= 0.76.0-rc.6) - - React-cxxreact (= 0.76.0-rc.6) - - React-jsi (= 0.76.0-rc.6) - - React-logger (= 0.76.0-rc.6) - - React-perflogger (= 0.76.0-rc.6) - - ReactCommon/turbomodule/bridging (= 0.76.0-rc.6) - - ReactCommon/turbomodule/core (= 0.76.0-rc.6) - - ReactCommon/turbomodule/bridging (0.76.0-rc.6): + - React-callinvoker (= 0.76.0) + - React-cxxreact (= 0.76.0) + - React-jsi (= 0.76.0) + - React-logger (= 0.76.0) + - React-perflogger (= 0.76.0) + - ReactCommon/turbomodule/bridging (= 0.76.0) + - ReactCommon/turbomodule/core (= 0.76.0) + - ReactCommon/turbomodule/bridging (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-callinvoker (= 0.76.0-rc.6) - - React-cxxreact (= 0.76.0-rc.6) - - React-jsi (= 0.76.0-rc.6) - - React-logger (= 0.76.0-rc.6) - - React-perflogger (= 0.76.0-rc.6) - - ReactCommon/turbomodule/core (0.76.0-rc.6): + - React-callinvoker (= 0.76.0) + - React-cxxreact (= 0.76.0) + - React-jsi (= 0.76.0) + - React-logger (= 0.76.0) + - React-perflogger (= 0.76.0) + - ReactCommon/turbomodule/core (0.76.0): - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-callinvoker (= 0.76.0-rc.6) - - React-cxxreact (= 0.76.0-rc.6) - - React-debug (= 0.76.0-rc.6) - - React-featureflags (= 0.76.0-rc.6) - - React-jsi (= 0.76.0-rc.6) - - React-logger (= 0.76.0-rc.6) - - React-perflogger (= 0.76.0-rc.6) - - React-utils (= 0.76.0-rc.6) - - RNCAsyncStorage (1.23.1): + - React-callinvoker (= 0.76.0) + - React-cxxreact (= 0.76.0) + - React-debug (= 0.76.0) + - React-featureflags (= 0.76.0) + - React-jsi (= 0.76.0) + - React-logger (= 0.76.0) + - React-perflogger (= 0.76.0) + - React-utils (= 0.76.0) + - RNCAsyncStorage (1.24.0): - DoubleConversion - glog - hermes-engine @@ -1605,16 +1605,16 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - rnmapbox-maps (10.1.32-rc.0): - - MapboxMaps (~> 10.18.2) + - rnmapbox-maps (10.1.33): + - MapboxMaps (~> 10.19.0) - React - React-Core - - rnmapbox-maps/DynamicLibrary (= 10.1.32-rc.0) + - rnmapbox-maps/DynamicLibrary (= 10.1.33) - Turf - - rnmapbox-maps/DynamicLibrary (10.1.32-rc.0): + - rnmapbox-maps/DynamicLibrary (10.1.33): - DoubleConversion - hermes-engine - - MapboxMaps (~> 10.18.2) + - MapboxMaps (~> 10.19.0) - RCT-Folly - RCTRequired - RCTTypeSafety @@ -1630,7 +1630,7 @@ PODS: - ReactCommon/turbomodule/core - Turf - Yoga - - RNScreens (3.34.0): + - RNScreens (3.35.0): - DoubleConversion - glog - hermes-engine @@ -1651,9 +1651,9 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNScreens/common (= 3.34.0) + - RNScreens/common (= 3.35.0) - Yoga - - RNScreens/common (3.34.0): + - RNScreens/common (3.35.0): - DoubleConversion - glog - hermes-engine @@ -1902,81 +1902,81 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - boost: 4cb898d0bf20404aab1850c656dcea009429d6c1 - DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 - FBLazyVector: 319d66555ce769137a84559a19fb8197733a68e1 - fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 - glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f - hermes-engine: 8d54e8b503c75afaf8f4cf61a22e2fe8e1badcde - MapboxCommon: 0ff437e44988da6856e280d00ffb266564ed0487 - MapboxCoreMaps: f1bd9405f5b9d3e343f2fe4138775299699a22fb - MapboxMaps: e76b14f52c54c40b76ddecd04f40448e6f35a864 - MapboxMobileEvents: de50b3a4de180dd129c326e09cd12c8adaaa46d6 - RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47 - RCTDeprecation: 41b81ffee0755cd07c0ccc9132bda4d15548f54c - RCTRequired: 67416fa5a975096df7226fed460bc468226440a9 - RCTTypeSafety: b5997285e05d3e2960fd1b5704cca2066db42300 - React: 2bbc56a13da3eb90a3417be54d7882d653a5ce3d - React-callinvoker: 6cbc2bb752c2ca492ea4d36c5b05436c60bfaa92 - React-Core: 39d2057537745f93b1c2cc4ad6c210e0d269bb02 - React-CoreModules: eb7ab7dbd2ae00d6a19f60ec7780f81c266ebd78 - React-cxxreact: f911fc86b34a7c7a166a8f582aaf38f350b787d2 - React-debug: 612aa1f74bd6ef1ec2d34ea427d2316428757fb7 - React-defaultsnativemodule: 8d4f282d45c9e5c8b6dfb21d3818ecb4d438929e - React-domnativemodule: 3065cd6597dc08daae2bce52531e2c9f37bbc8c7 - React-Fabric: b365a71c07e9b2902299b68419b28e8c4277a557 - React-FabricComponents: d680578e824bbdef418cae70697786bb12b248de - React-FabricImage: f223fd3a32642cc157d6013a97695a69b4d416b1 - React-featureflags: 0fa2e6491b2ed1753b495229b292670a37aeb8f5 - React-featureflagsnativemodule: f9bc68341172a699c213aa689635901c3c4b0c4d - React-graphics: b17369a2aeb3949957b59ce0f4b2118a0bde86b4 - React-hermes: 1beb90db74f2a3c06277ba3dee4a9cbdc1d38b57 - React-idlecallbacksnativemodule: 3884619506b02e5cc71a7f23e46dad679e441eb6 - React-ImageManager: 286882bd4fe41bee58da68403024efefb54e7601 - React-jserrorhandler: e95815657ee08ea88ab4890309ffb2bfc2cb5f54 - React-jsi: 33cd45a947ce461e228179a7b1f175742d528fff - React-jsiexecutor: 55a0a1c8ba0025648131519c6aa8fe8e58415b4d - React-jsinspector: 1fa973c8bfcc1747cdf880e4470047e37667b1df - React-jsitracing: 1c49248a400cc501b692517bebbd6cde2e3d236f - React-logger: a6d7479d445d6b557ab73729dc71db14d35b0f93 - React-Mapbuffer: 30cda50703756c688d4cd016ee84b54b80f6435e - React-microtasksnativemodule: 8fc3fb2e65975db9f323a4d84a44d313b57c4f33 - react-native-safe-area-context: 2279fe040bc93af8624f7d034806180fdbe5fa02 - React-nativeconfig: 6bf19f5279402e095a35ac880144c14aa9b63df4 - React-NativeModulesApple: 1636a3fcfc14025481c5933f4582a512f65cb152 - React-perflogger: c6e000a569b3a45d5de65b0bf81e35d91f3fe5a8 - React-performancetimeline: 4e2fed8ce8f5b1b303b4e6ebf5a5f85494fd0a85 - React-RCTActionSheet: 0169a12a5f5085d31d93294c0302aff66e9f9cee - React-RCTAnimation: a2039d635e1519bd736b983cce266e9081b073ee - React-RCTAppDelegate: 2087344d4417abee751eb7f65b6ef572119f0b05 - React-RCTBlob: 22dbeb1e49faf83bda307060162de6c22becbe47 - React-RCTFabric: 1c66506f73632c5d38b400e669ca94706c19c8b0 - React-RCTImage: dbdc3981f8b0fc6e0f358cb9a4db8bf42c0fea7d - React-RCTLinking: 5705a5ae9ea58b803a4b6bfbb1b0f6baf377bb76 - React-RCTNetwork: a6e333a48abdbe892fc2961c6cf32472969acb01 - React-RCTSettings: d8a94fb83b800d8c272503b8312ebac019b40d08 - React-RCTText: dd601ba38405f56c6bbb936815fbf8f1dabc33c7 - React-RCTVibration: 249ce3aa017d9093228372b193fa55741cc73fe7 - React-rendererconsistency: 660af52b5b8b2599f0dfde7f8212fb8bf684d968 - React-rendererdebug: 782760e7f56bc6d78c7917b8000442c79bb0ab15 - React-rncore: 855146e1e0b9bdeeddf6f6f1aca5c68d306b5e44 - React-RuntimeApple: fc2293ed693e2f8ba738a34aac98dafbfe873ffe - React-RuntimeCore: 17d33d54ef200d41829a9d0aa95ad454583faf60 - React-runtimeexecutor: 6ed13de8c9a67c6001ba82ca108055d8acfc2f8b - React-RuntimeHermes: d9db4a678c02b3ac5f3901a528d37446083de0d8 - React-runtimescheduler: 88658434e250d004d77f3b8f94078cf5836ff9b5 - React-timing: 9e213f60979bd63e39cc81f07a02a39b1ba694d5 - React-utils: 7b5f884193005345985dad15b84f324d6bc7731d - ReactCodegen: f4ec52507766ae9229e6daff936ef4819cd38d64 - ReactCommon: 964a21f03865d9b98dcc64df7b172be083e108c9 - RNCAsyncStorage: a927b768986f83467b635cf6d7559e6edb46db7a - rnmapbox-maps: c095d7509bf9a09d1bfb132422f6edbd133eeaf1 - RNScreens: de6e57426ba0e6cbc3fb5b4f496e7f08cb2773c2 + boost: 1dca942403ed9342f98334bf4c3621f011aa7946 + DoubleConversion: f16ae600a246532c4020132d54af21d0ddb2a385 + FBLazyVector: aa59bef5c46e93168bffcf3dc37ee1e176de799a + fmt: 10c6e61f4be25dc963c36bd73fc7b1705fe975be + glog: 08b301085f15bcbb6ff8632a8ebaf239aae04e6a + hermes-engine: 9de51d2f67336348a6cd5b686330e436d1dbd522 + MapboxCommon: 873b75dd0e8c5d7029e0c849437eba365f4887e5 + MapboxCoreMaps: 35685edba03e44468aed57c3dfd7f8795edafda8 + MapboxMaps: 05822ab0ee74f7d626e6471572439afe35c1c116 + MapboxMobileEvents: d044b9edbe0ec7df60f6c2c9634fe9a7f449266b + RCT-Folly: bf5c0376ffe4dd2cf438dcf86db385df9fdce648 + RCTDeprecation: 4c2c4a088b6f0ccfcbd53c9d5614b0238ad57909 + RCTRequired: 2d8a683a7848bc0baf5883f0792c1ac43f6267b5 + RCTTypeSafety: 23df4344c69c602e1c5a8053a93c633af1bee825 + React: cf99f97aa57ce39ab4d3d4f396e01a3f30f3c8ad + React-callinvoker: bec5283f86b784de5a1ba807e31cb4f177765507 + React-Core: 3b131c387be8d45565fc32c6c08df7a450d8d5a8 + React-CoreModules: ac0a55891bcb72a9f8c6631128e7cbbf9ce06b65 + React-cxxreact: fec14d0078f627985b2cce98f90458e969a848ae + React-debug: c185808d0674717d0d408d7ce45a7343f0072199 + React-defaultsnativemodule: 5dc781a1e3274cbb6d6d3e91f5bf9914a258115d + React-domnativemodule: f81f69be048840a0efcf0add685ad0cf5583fb5f + React-Fabric: 8de8a37b62f81d264302462cf33c69b97faf9979 + React-FabricComponents: 777f5e4fdc39355fa0275412a3b8f2430a7bef1d + React-FabricImage: 9202f25c36040de738cd486ea6b8480f2d62b05f + React-featureflags: 51f1373ac42cefac4936c62be46dbe2a1f9f1f7d + React-featureflagsnativemodule: 59083d49f82a50aecba32e1cddb791ca362df198 + React-graphics: 4508c3473dd97c76d627938bfa0c304abc37e3b0 + React-hermes: 9d2b208eb88bfd4eb156064a831bec2f01e8165d + React-idlecallbacksnativemodule: fc31bde9dc276e78d4289b4fd209b5fbe762600b + React-ImageManager: f046a503ff853fc5aec31db274c03cea239e5de4 + React-jserrorhandler: a03ee04881559e8a0cdcd0cb7dbbc4d1c78edc9d + React-jsi: b7efc160dd211f6a3999cdc4a2c9fc2bbcda05db + React-jsiexecutor: 4ec7211a13582bd954c79590996260afffb64b30 + React-jsinspector: d913f0d6c32cca8f090cc0c1dfc3c95ec65970b8 + React-jsitracing: 043658000ac681e8aa5f3ee61690e0686da01bfe + React-logger: d1a89c7d9b3c847eb63eb85724c54b06cae2c939 + React-Mapbuffer: b0b4ace5b62b269f3838df26ba2d8b4f39f90783 + React-microtasksnativemodule: 0b7db04c18f6bb01ef5b1f9007c3229abecc35dd + react-native-safe-area-context: 458f6b948437afcb59198016b26bbd02ff9c3b47 + React-nativeconfig: 72c10ff34863148ef90df9c9c8eacba99d2faaaa + React-NativeModulesApple: 5ec49182fa000b2215ee1bed03e2867f8323ccf5 + React-perflogger: 073c7a8a436b3fe724f1df34e9d1f3db1d25fe74 + React-performancetimeline: 52f8e3b73b98dad5d5ba360035ad0be294087bd8 + React-RCTActionSheet: 96cf4d93fccb7a96ba1867e173c586e7ad9cd5cc + React-RCTAnimation: bcd2356245abffd232ea8d4d5b64ae0bf93c7ef0 + React-RCTAppDelegate: 20242d0ddf9348f8de10e5750d8c0844e222b0e3 + React-RCTBlob: 7fadfb83ce2bb5580b73368384fe242aaa6ddbc6 + React-RCTFabric: 504fe0307b1e72d093aa84e1c5ccb26d1bca66e3 + React-RCTImage: fdf95e50ad94842fd9c508ed36d9bfd6e1ffa8ef + React-RCTLinking: 76a398421d9a26422e5733439e2a9d13f19e5a99 + React-RCTNetwork: 2bf6ca74a1a14648f6985cfbfc4f8813fa66e6a4 + React-RCTSettings: 3cd121542bb87d318df5102bffdfd85899896187 + React-RCTText: 78b41d87d44c07ac8b2c47172da28a85446d254b + React-RCTVibration: 245a4a1b33f1c2c9622d4480cf5bb4362096214d + React-rendererconsistency: db2497919f3ab2543e3af19fbcef384ddfeb97ad + React-rendererdebug: ae62b22e402083d1a23539b90873f0513eaa1fec + React-rncore: 5c0cefbd816edc0438f9f0782c3fd4a4b4ef5770 + React-RuntimeApple: 82c8072c3b35aead653f9abe66397f678a92764f + React-RuntimeCore: 286b297ab0c5905c9fa83afe1a2df5bfe5edb5a7 + React-runtimeexecutor: 79e15d2c4b261925ea52261f69cac6318db5ab91 + React-RuntimeHermes: 0d4d9a9dae3be2de2df8ec9da2390b3c7097e115 + React-runtimescheduler: b11553b58430aa51b1558ffa93073257dadb00ef + React-timing: 8458b1f6741bfa16c78aa0a39fde969c6b843e23 + React-utils: d9624101245ebaab39c9f1bd786132da0b4f27ff + ReactCodegen: dbfef1fef26f42c900bb1884fa149d49d501d64d + ReactCommon: 429ca28cd813c31359c73ffac6dc24f93347d522 + RNCAsyncStorage: 3ad840f7b17b45ca7ebbbb0e80948564a9513315 + rnmapbox-maps: d184c8d3213acf4c97ec71fbbb6f9d4954552d80 + RNScreens: e389d6a6a66a4f0d3662924ecae803073ccce8ec RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8 SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Turf: aa2ede4298009639d10db36aba1a7ebaad072a5e - Yoga: dcf6b28b5105d538537e656bf4e239f4d87fc546 + Yoga: 1d66db49f38fd9e576a1d7c3b081e46ab4c28b9e -PODFILE CHECKSUM: 64ef587163c106f31b1afaaefdc1bac985b496e0 +PODFILE CHECKSUM: 85b355571773a06d25503efcc9017e8b6129f70e -COCOAPODS: 1.14.2 +COCOAPODS: 1.16.2 diff --git a/example/src/examples/V10/FeatureState.tsx b/example/src/examples/V10/FeatureState.tsx new file mode 100644 index 000000000..9a02da24c --- /dev/null +++ b/example/src/examples/V10/FeatureState.tsx @@ -0,0 +1,147 @@ +import React, { ComponentProps, useCallback, useRef } from 'react'; +import { Camera, FillLayer, MapView, ShapeSource } from '@rnmapbox/maps'; + +import { ExampleWithMetadata } from '../common/ExampleMetadata'; + +type CustomProperties = { + normalColor: string; + selectedColor: string; +}; + +const SOURCE: GeoJSON.FeatureCollection = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + id: 1, + properties: { normalColor: '#0000cc', selectedColor: '#ff0000' }, + geometry: { + type: 'Polygon', + coordinates: [ + [ + [-107.8857421875, 45.197522303056815], + [-106.5234375, 36.58024660149866], + [-120.498046875, 36.10237644873645], + [-120.05859375, 44.918139299585135], + [-107.8857421875, 45.197522303056815], + ], + ], + }, + }, + { + type: 'Feature', + id: 2, + properties: { normalColor: '#00cc00', selectedColor: '#ff00ff' }, + geometry: { + type: 'Polygon', + coordinates: [ + [ + [-90.59326171875, 45.25942203635168], + [-87.1875, 40.46366632458768], + [-87.1875, 37.07271048132945], + [-102.81005859375, 36.89719446989035], + [-101.77734375, 44.8714427501659], + [-90.59326171875, 45.25942203635168], + ], + ], + }, + }, + ], +}; + +const SHAPES_SOURCE_ID = 'shapes'; +const SELECTED_KEY = 'selected'; + +const styles = { + map: { + flex: 1, + }, + shapesFill: { + fillColor: [ + 'case', + ['to-boolean', ['feature-state', SELECTED_KEY]], + ['get', 'selectedColor'], + ['get', 'normalColor'], + ], + }, +} as const; + +type ShapeSourceProps = ComponentProps; + +const FeatureState = () => { + const mapRef = useRef(null); + + const toggleSelected = useCallback(async (featureId: string) => { + const { current: map } = mapRef; + if (!map) return; + + console.log(`Toggling selected state for ID '${featureId}'`); + + try { + const currentState = await map.getFeatureState( + featureId, + SHAPES_SOURCE_ID, + ); + + console.log(`Current state: ${JSON.stringify(currentState)}`); + + if ('selected' in currentState) { + await map.removeFeatureState(featureId, SELECTED_KEY, SHAPES_SOURCE_ID); + } else { + await map.setFeatureState( + featureId, + { + [SELECTED_KEY]: true, + }, + SHAPES_SOURCE_ID, + ); + } + } catch (err) { + console.error( + `Failed to toggle feature state for ID '${featureId}': ${ + (err as Error).message + }`, + ); + } + }, []); + + const handlePressShapes: NonNullable = + useCallback( + (e) => { + const [feature] = e.features; + if (!feature || feature.id === undefined) return; + toggleSelected(feature.id.toString()); + }, + [toggleSelected], + ); + + return ( + + + + + + + ); +}; + +export default FeatureState; + +const metadata: ExampleWithMetadata['metadata'] = { + title: 'Feature State', + tags: [ + 'MapView', + 'MapView#setFeatureState', + 'MapView#getFeatureState', + 'MapView#removeFeatureState', + ], + docs: ` +Demonstrates modifying the feature state. +`, +}; + +FeatureState.metadata = metadata; diff --git a/example/src/examples/V10/index.js b/example/src/examples/V10/index.js index 8d3c14b66..65af9f91b 100644 --- a/example/src/examples/V10/index.js +++ b/example/src/examples/V10/index.js @@ -5,6 +5,7 @@ export { default as Markers } from './Markers'; export { default as QueryTerrainElevation } from './QueryTerrainElevation'; export { default as TerrainSkyAtmosphere } from './TerrainSkyAtmosphere'; export { default as SimpleModelLayer } from './SimpleModelLayer'; +export { default as FeatureState } from './FeatureState'; export const metadata = { title: 'V10', diff --git a/ios/RNMBX/RNMBXMapViewManager.swift b/ios/RNMBX/RNMBXMapViewManager.swift index 4306b9057..fd18a7e6e 100644 --- a/ios/RNMBX/RNMBXMapViewManager.swift +++ b/ios/RNMBX/RNMBXMapViewManager.swift @@ -118,6 +118,67 @@ extension RNMBXMapViewManager { } } + + @objc public static func setFeatureState( + _ view: RNMBXMapView, + featureId: String, + state: [String : Any], + sourceId: String, + sourceLayerId: String?, + resolver: @escaping RCTPromiseResolveBlock, + rejecter: @escaping RCTPromiseRejectBlock) { + view.withMapboxMap { map in + map.setFeatureState( + sourceId: sourceId, + sourceLayerId: sourceLayerId, + featureId: featureId, + state: state + ) + resolver(nil) + } + } + + @objc public static func getFeatureState( + _ view: RNMBXMapView, + featureId: String, + sourceId: String, + sourceLayerId: String?, + resolver: @escaping RCTPromiseResolveBlock, + rejecter: @escaping RCTPromiseRejectBlock) { + view.withMapboxMap { map in + map.getFeatureState( + sourceId: sourceId, + sourceLayerId: sourceLayerId, + featureId: featureId + ) { result in + switch (result) { + case .success(let featureState): + resolver(["featureState": featureState]) + case .failure(let error): + rejecter("getFeatureState", "failed to get feature state", error) + } + } + } + } + + @objc public static func removeFeatureState( + _ view: RNMBXMapView, + featureId: String, + stateKey: String?, + sourceId: String, + sourceLayerId: String?, + resolver: @escaping RCTPromiseResolveBlock, + rejecter: @escaping RCTPromiseRejectBlock) { + view.withMapboxMap { map in + map.removeFeatureState( + sourceId: sourceId, + sourceLayerId: sourceLayerId, + featureId: featureId, + stateKey: stateKey + ) + resolver(nil) + } + } } // MARK: - queryRenderedFeatures diff --git a/ios/RNMBX/RNMBXMapViewModule.mm b/ios/RNMBX/RNMBXMapViewModule.mm index ec622d223..5519c635f 100644 --- a/ios/RNMBX/RNMBXMapViewModule.mm +++ b/ios/RNMBX/RNMBXMapViewModule.mm @@ -133,6 +133,24 @@ - (void)withMapView:(nonnull NSNumber*)viewRef block:(void (^)(RNMBXMapView *))b } reject:reject methodName:@"setSourceVisibility"]; } +RCT_EXPORT_METHOD(setFeatureState:(nonnull NSNumber*)viewRef featureId:(nonnull NSString *)featureId state:(nonnull NSDictionary *)state sourceId:(NSString *)sourceId sourceLayerId:(NSString *)sourceLayerId resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) { + [self withMapView:viewRef block:^(RNMBXMapView *view) { + [RNMBXMapViewManager setFeatureState:view featureId:featureId state:state sourceId:sourceId sourceLayerId:sourceLayerId resolver:resolve rejecter:reject]; + } reject:reject methodName:@"setFeatureState"]; +} + +RCT_EXPORT_METHOD(getFeatureState:(nonnull NSNumber*)viewRef featureId:(nonnull NSString *)featureId sourceId:(nonnull NSString *)sourceId sourceLayerId:(NSString *)sourceLayerId resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) { + [self withMapView:viewRef block:^(RNMBXMapView *view) { + [RNMBXMapViewManager getFeatureState:view featureId:featureId sourceId:sourceId sourceLayerId:sourceLayerId resolver:resolve rejecter:reject]; + } reject:reject methodName:@"getFeatureState"]; +} + +RCT_EXPORT_METHOD(removeFeatureState:(nonnull NSNumber*)viewRef featureId:(nonnull NSString *)featureId stateKey:(NSString*)stateKey sourceId:(NSString *)sourceId sourceLayerId:(NSString *)sourceLayerId resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) { + [self withMapView:viewRef block:^(RNMBXMapView *view) { + [RNMBXMapViewManager removeFeatureState:view featureId:featureId stateKey:stateKey sourceId:sourceId sourceLayerId:sourceLayerId resolver:resolve rejecter:reject]; + } reject:reject methodName:@"removeFeatureState"]; +} + RCT_EXPORT_METHOD(querySourceFeatures:(nonnull NSNumber*)viewRef sourceId:(NSString*)sourceId withFilter:(NSArray*)withFilter withSourceLayerIDs:(NSArray*)withSourceLayerIDs resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) { [self withMapView:viewRef block:^(RNMBXMapView *view) { [RNMBXMapViewManager querySourceFeatures:view withSourceId:sourceId withFilter:withFilter withSourceLayerIds:withSourceLayerIDs resolver:resolve rejecter:reject]; diff --git a/src/components/MapView.tsx b/src/components/MapView.tsx index 13042336f..9e8994e2e 100644 --- a/src/components/MapView.tsx +++ b/src/components/MapView.tsx @@ -922,6 +922,96 @@ class MapView extends NativeBridgeComponent( ]); } + /** + * Updates the state map of a feature within a style source. + * + * Updates entries in the state map of a given feature within a style source. + * Only entries listed in the `state` will be updated. + * An entry in the feature state map that is not listed in `state` will retain its previous value. + * + * @param {string} featureId Identifier of the feature whose state should be updated. + * @param {[k: string]: NativeArg} state Map of entries to update with their respective new values. + * @param {string} sourceId Style source identifier. + * @param {string | null} sourceLayerId Style source layer identifier (for multi-layer sources such as vector sources). + */ + async setFeatureState( + featureId: string, + state: { [k: string]: NativeArg }, + sourceId: string, + sourceLayerId: string | null = null, + ): Promise { + if (!RNMBXModule.MapboxV10) { + console.warn( + 'RNMapbox: setFeatureState is only implemented in v10 implementation or later', + ); + return; + } + + await this._runNative('setFeatureState', [ + featureId, + state, + sourceId, + sourceLayerId, + ]); + } + + /** + * Returns the state map of a feature within a style source. + * + * @param {string} featureId Identifier of the feature whose state should be queried. + * @param {string} sourceId Style source identifier. + * @param {string | null} sourceLayerId Style source layer identifier (for multi-layer sources such as vector sources). + */ + async getFeatureState( + featureId: string, + sourceId: string, + sourceLayerId: string | null = null, + ): Promise>> { + if (!RNMBXModule.MapboxV10) { + console.warn( + 'RNMapbox: setFeatureState is only implemented in v10 implementation or later', + ); + return {}; + } + + const res = await this._runNative<{ + featureState: Readonly>; + }>('getFeatureState', [featureId, sourceId, sourceLayerId]); + return res.featureState; + } + + /** + * Removes entries from a feature state object. + * + * Removes a specified property or all properties from a feature’s state object, + * depending on the value of `stateKey`. + * + * @param {string} featureId Identifier of the feature whose state should be removed. + * @param {string | null} stateKey The name of the property to remove. If `null`, all feature’s state object properties are removed. + * @param {string} sourceId Style source identifier. + * @param {string | null} sourceLayerId Style source layer identifier (for multi-layer sources such as vector sources). + */ + async removeFeatureState( + featureId: string, + stateKey: string | null, + sourceId: string, + sourceLayerId: string | null = null, + ): Promise { + if (!RNMBXModule.MapboxV10) { + console.warn( + 'RNMapbox: removeFeatureState is only implemented in v10 implementation or later', + ); + return; + } + + await this._runNative('removeFeatureState', [ + featureId, + stateKey, + sourceId, + sourceLayerId, + ]); + } + _decodePayload(payload: T | string): T { if (typeof payload === 'string') { return JSON.parse(payload);