@rnmapbox/maps 10.1.13 → 10.1.15

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.
@@ -90,6 +90,7 @@ class RNMBXModule(private val mReactContext: ReactApplicationContext) : ReactCon
90
90
  cameraModes["Flight"] = CameraMode.FLIGHT
91
91
  cameraModes["Ease"] = CameraMode.EASE
92
92
  cameraModes["Linear"] = CameraMode.LINEAR
93
+ cameraModes["Move"] = CameraMode.MOVE
93
94
  cameraModes["None"] = CameraMode.NONE
94
95
 
95
96
  // offline region download states
@@ -14,6 +14,8 @@ data class ViewTagWaiter<V>(
14
14
  val reject: Promise?
15
15
  )
16
16
 
17
+ const val LOG_TAG = "ViewTagResolver"
18
+
17
19
  // see https://github.com/rnmapbox/maps/pull/3074
18
20
  open class ViewTagResolver(val context: ReactApplicationContext) {
19
21
  private val createdViews: HashSet<Int> = hashSetOf<Int>()
@@ -55,8 +57,14 @@ open class ViewTagResolver(val context: ReactApplicationContext) {
55
57
  fun <V>withViewResolved(viewTag: Int, reject: Promise? = null, fn: (V) -> Unit) {
56
58
  context.runOnUiQueueThread() {
57
59
  try {
58
- val view = manager.resolveView(viewTag) as V
59
- fn(view)
60
+ val resolvedView: View? = manager.resolveView(viewTag)
61
+ val view = resolvedView as? V
62
+ if (view != null) {
63
+ fn(view)
64
+ } else {
65
+ Logger.e(LOG_TAG, "view: $resolvedView found with tag: $viewTag but it's either null or not the correct type")
66
+ reject?.reject(Throwable("view: $resolvedView found with tag: $viewTag but it's either null or not the correct type"))
67
+ }
60
68
  } catch (err: IllegalViewOperationException) {
61
69
  if (!createdViews.contains(viewTag)) {
62
70
  viewWaiters.getOrPut(viewTag) { mutableListOf<ViewTagWaiter<View>>() }.add(ViewTagWaiter<View>({ view -> fn(view as V) }, reject))
@@ -37,5 +37,5 @@ public abstract class NativeRNMBXCameraModuleSpec extends ReactContextBaseJavaMo
37
37
 
38
38
  @ReactMethod
39
39
  @DoNotStrip
40
- public abstract void updateCameraStop(@Nullable Double viewRef, ReadableMap stops, Promise promise);
40
+ public abstract void updateCameraStop(@Nullable Double viewRef, ReadableMap stop, Promise promise);
41
41
  }
@@ -20,7 +20,7 @@ type Stop = {
20
20
  type NativeAnimationMode = 'flight' | 'ease' | 'linear' | 'none' | 'move';
21
21
  type ObjectOr<T> = Object;
22
22
  export interface Spec extends TurboModule {
23
- updateCameraStop(viewRef: ViewRef, stops: ObjectOr<Stop>): Promise<void>;
23
+ updateCameraStop(viewRef: ViewRef, stop: ObjectOr<Stop>): Promise<void>;
24
24
  }
25
25
  declare const _default: Spec;
26
26
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeRNMBXCameraModule.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeRNMBXCameraModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAGlE,KAAK,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;AAE5B,UAAU,gBAAgB;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC5B;AAED,KAAK,IAAI,GACL;IACE,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B,GACD,gBAAgB,CAAC;AAErB,KAAK,mBAAmB,GAAG,QAAQ,GAAG,MAAM,GAAG,Q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,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzE;;AAED,wBAA2E"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rnmapbox/maps",
3
3
  "description": "A Mapbox react native module for creating custom maps",
4
- "version": "10.1.13",
4
+ "version": "10.1.15",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
package/setup-jest.js CHANGED
@@ -2,8 +2,6 @@
2
2
  delete global.MessageChannel;
3
3
  import { NativeModules } from 'react-native';
4
4
 
5
- jest.useFakeTimers('legacy');
6
-
7
5
  function keyMirror(keys) {
8
6
  const obj = {};
9
7
  keys.forEach((key) => (obj[key] = key));
@@ -30,7 +30,7 @@ type NativeAnimationMode = 'flight' | 'ease' | 'linear' | 'none' | 'move';
30
30
  type ObjectOr<T> = Object;
31
31
 
32
32
  export interface Spec extends TurboModule {
33
- updateCameraStop(viewRef: ViewRef, stops: ObjectOr<Stop>): Promise<void>;
33
+ updateCameraStop(viewRef: ViewRef, stop: ObjectOr<Stop>): Promise<void>;
34
34
  }
35
35
 
36
36
  export default TurboModuleRegistry.getEnforcing<Spec>('RNMBXCameraModule');