@rnmapbox/maps 10.1.0-beta.14 → 10.1.0-beta.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.
Files changed (293) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/java/com/rnmapbox/rnmbx/RNMBXPackage.kt +22 -3
  3. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXCalloutManager.kt +33 -0
  4. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXMarkerViewManager.kt +24 -10
  5. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationManager.kt +70 -0
  6. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationModule.kt +33 -0
  7. package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImageManager.kt +11 -21
  8. package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImageModule.kt +33 -0
  9. package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt +9 -8
  10. package/android/src/main/java/com/rnmapbox/rnmbx/components/location/RNMBXNativeUserLocationManager.kt +11 -4
  11. package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt +140 -63
  12. package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapViewManager.kt +71 -55
  13. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/atmosphere/RNMBXAtmosphereManager.kt +0 -5
  14. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/light/RNMBXLightManager.kt +27 -0
  15. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXImageSourceManager.kt +16 -8
  16. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterDemSourceManager.kt +15 -1
  17. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterSourceManager.kt +11 -3
  18. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSource.kt +0 -2
  19. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceManager.kt +32 -31
  20. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXSource.kt +1 -1
  21. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXTileSourceManager.kt +17 -17
  22. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXVectorSourceManager.kt +13 -32
  23. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/terrain/RNMBXTerrainManager.kt +8 -11
  24. package/android/src/main/java/com/rnmapbox/rnmbx/utils/PropertyChanges.kt +68 -0
  25. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXCalloutManagerDelegate.java +25 -0
  26. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXCalloutManagerInterface.java +16 -0
  27. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImageManagerDelegate.java +47 -0
  28. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImageManagerInterface.java +22 -0
  29. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImagesManagerDelegate.java +38 -0
  30. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImagesManagerInterface.java +19 -0
  31. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXLightManagerDelegate.java +32 -0
  32. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXLightManagerInterface.java +17 -0
  33. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerDelegate.java +3 -0
  34. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerInterface.java +1 -0
  35. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMarkerViewManagerDelegate.java +41 -0
  36. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMarkerViewManagerInterface.java +20 -0
  37. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXNativeUserLocationManagerDelegate.java +35 -0
  38. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXNativeUserLocationManagerInterface.java +18 -0
  39. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXPointAnnotationManagerDelegate.java +41 -0
  40. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXPointAnnotationManagerInterface.java +20 -0
  41. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXShapeSourceManagerDelegate.java +0 -6
  42. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXShapeSourceManagerInterface.java +0 -2
  43. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXTerrainManagerDelegate.java +35 -0
  44. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXTerrainManagerInterface.java +18 -0
  45. package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXImageModuleSpec.java +40 -0
  46. package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXPointAnnotationModuleSpec.java +40 -0
  47. package/ios/RNMBX/RNMBXAtmosphereComponentView.mm +2 -0
  48. package/ios/RNMBX/RNMBXCallout.swift +1 -1
  49. package/ios/RNMBX/RNMBXCalloutComponentView.h +15 -0
  50. package/ios/RNMBX/RNMBXCalloutComponentView.mm +57 -0
  51. package/ios/RNMBX/{RNMBXCalloutManager.m → RNMBXCalloutViewManager.m} +1 -1
  52. package/ios/RNMBX/{RNMBXCalloutManager.swift → RNMBXCalloutViewManager.swift} +2 -2
  53. package/ios/RNMBX/RNMBXFabricHelpers.h +1 -8
  54. package/ios/RNMBX/RNMBXImage.swift +30 -22
  55. package/ios/RNMBX/RNMBXImageComponentView.h +15 -0
  56. package/ios/RNMBX/RNMBXImageComponentView.mm +100 -0
  57. package/ios/RNMBX/RNMBXImageManager.swift +0 -1
  58. package/ios/RNMBX/RNMBXImageModule.h +17 -0
  59. package/ios/RNMBX/RNMBXImageModule.mm +67 -0
  60. package/ios/RNMBX/RNMBXImages.swift +10 -10
  61. package/ios/RNMBX/RNMBXImagesComponentView.h +15 -0
  62. package/ios/RNMBX/RNMBXImagesComponentView.mm +91 -0
  63. package/ios/RNMBX/{RNMBXImagesManager.m → RNMBXImagesViewManager.m} +1 -2
  64. package/ios/RNMBX/{RNMBXImagesManager.swift → RNMBXImagesViewManager.swift} +2 -2
  65. package/ios/RNMBX/RNMBXLight.swift +7 -7
  66. package/ios/RNMBX/RNMBXLightComponentView.h +15 -0
  67. package/ios/RNMBX/RNMBXLightComponentView.mm +68 -0
  68. package/ios/RNMBX/{RNMBXLightManager.m → RNMBXLightViewManager.m} +1 -1
  69. package/ios/RNMBX/{RNMBXLightManager.swift → RNMBXLightViewManager.swift} +2 -2
  70. package/ios/RNMBX/RNMBXMapViewComponentView.mm +0 -1
  71. package/ios/RNMBX/RNMBXMarkerView.swift +23 -16
  72. package/ios/RNMBX/RNMBXMarkerViewComponentView.h +15 -0
  73. package/ios/RNMBX/RNMBXMarkerViewComponentView.mm +130 -0
  74. package/ios/RNMBX/RNMBXNativeUserLocation.swift +3 -3
  75. package/ios/RNMBX/RNMBXNativeUserLocationComponentView.h +15 -0
  76. package/ios/RNMBX/RNMBXNativeUserLocationComponentView.mm +72 -0
  77. package/ios/RNMBX/{RNMBXNativeUserLocationManager.m → RNMBXNativeUserLocationViewManager.m} +1 -1
  78. package/ios/RNMBX/{RNMBXNativeUserLocationManager.swift → RNMBXNativeUserLocationViewManager.swift} +2 -2
  79. package/ios/RNMBX/RNMBXPointAnnotation.swift +41 -30
  80. package/ios/RNMBX/RNMBXPointAnnotationComponentView.h +15 -0
  81. package/ios/RNMBX/RNMBXPointAnnotationComponentView.mm +147 -0
  82. package/ios/RNMBX/RNMBXPointAnnotationModule.h +17 -0
  83. package/ios/RNMBX/RNMBXPointAnnotationModule.mm +66 -0
  84. package/ios/RNMBX/{RNMBXPointAnnotationManager.m → RNMBXPointAnnotationViewManager.m} +1 -6
  85. package/ios/RNMBX/RNMBXPointAnnotationViewManager.swift +14 -0
  86. package/ios/RNMBX/RNMBXRasterDemSourceComponentView.h +1 -3
  87. package/ios/RNMBX/RNMBXRasterDemSourceComponentView.mm +0 -2
  88. package/ios/RNMBX/RNMBXRasterSourceComponentView.h +1 -3
  89. package/ios/RNMBX/RNMBXRasterSourceComponentView.mm +0 -2
  90. package/ios/RNMBX/RNMBXShapeSourceComponentView.h +1 -3
  91. package/ios/RNMBX/RNMBXShapeSourceComponentView.mm +4 -6
  92. package/ios/RNMBX/RNMBXShapeSourceModule.mm +1 -9
  93. package/ios/RNMBX/RNMBXSingletonLayer.swift +1 -1
  94. package/ios/RNMBX/RNMBXTerrain.swift +2 -2
  95. package/ios/RNMBX/RNMBXTerrainComponentView.h +15 -0
  96. package/ios/RNMBX/RNMBXTerrainComponentView.mm +78 -0
  97. package/ios/RNMBX/{RNMBXTerrainManager.m → RNMBXTerrainViewManager.m} +1 -1
  98. package/ios/RNMBX/{RNMBXTerrainManager.swift → RNMBXTerrainViewManager.swift} +2 -2
  99. package/ios/RNMBX/RNMBXVectorSourceComponentView.h +1 -3
  100. package/ios/RNMBX/RNMBXVectorSourceComponentView.mm +0 -2
  101. package/ios/RNMBX/rnmapbox_maps-Swift.pre.h +0 -2
  102. package/lib/commonjs/components/Callout.js +3 -4
  103. package/lib/commonjs/components/Callout.js.map +1 -1
  104. package/lib/commonjs/components/Image.js +20 -4
  105. package/lib/commonjs/components/Image.js.map +1 -1
  106. package/lib/commonjs/components/Images.js +6 -3
  107. package/lib/commonjs/components/Images.js.map +1 -1
  108. package/lib/commonjs/components/Light.js +5 -5
  109. package/lib/commonjs/components/Light.js.map +1 -1
  110. package/lib/commonjs/components/MapView.js +12 -49
  111. package/lib/commonjs/components/MapView.js.map +1 -1
  112. package/lib/commonjs/components/MarkerView.js +2 -1
  113. package/lib/commonjs/components/MarkerView.js.map +1 -1
  114. package/lib/commonjs/components/NativeBridgeComponent.js +6 -43
  115. package/lib/commonjs/components/NativeBridgeComponent.js.map +1 -1
  116. package/lib/commonjs/components/NativeUserLocation.js +3 -4
  117. package/lib/commonjs/components/NativeUserLocation.js.map +1 -1
  118. package/lib/commonjs/components/PointAnnotation.js +29 -14
  119. package/lib/commonjs/components/PointAnnotation.js.map +1 -1
  120. package/lib/commonjs/components/ShapeSource.js +7 -18
  121. package/lib/commonjs/components/ShapeSource.js.map +1 -1
  122. package/lib/commonjs/components/Terrain.js +4 -5
  123. package/lib/commonjs/components/Terrain.js.map +1 -1
  124. package/lib/commonjs/components/VectorSource.js +2 -11
  125. package/lib/commonjs/components/VectorSource.js.map +1 -1
  126. package/lib/commonjs/specs/NativeRNMBXImageModule.js +10 -0
  127. package/lib/commonjs/specs/NativeRNMBXImageModule.js.map +1 -0
  128. package/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js +10 -0
  129. package/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js.map +1 -0
  130. package/lib/commonjs/specs/RNMBXCalloutNativeComponent.js +11 -0
  131. package/lib/commonjs/specs/RNMBXCalloutNativeComponent.js.map +1 -0
  132. package/lib/commonjs/specs/{RNMBXAndroidTextureMapViewNativeComponent.js → RNMBXImageNativeComponent.js} +2 -4
  133. package/lib/commonjs/specs/RNMBXImageNativeComponent.js.map +1 -0
  134. package/lib/commonjs/specs/RNMBXImagesNativeComponent.js +10 -0
  135. package/lib/commonjs/specs/RNMBXImagesNativeComponent.js.map +1 -0
  136. package/lib/commonjs/specs/RNMBXLightNativeComponent.js +10 -0
  137. package/lib/commonjs/specs/RNMBXLightNativeComponent.js.map +1 -0
  138. package/lib/commonjs/specs/RNMBXMapViewNativeComponent.js +1 -1
  139. package/lib/commonjs/specs/RNMBXMapViewNativeComponent.js.map +1 -1
  140. package/lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js +10 -0
  141. package/lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js.map +1 -0
  142. package/lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js +10 -0
  143. package/lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js.map +1 -0
  144. package/lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js +10 -0
  145. package/lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js.map +1 -0
  146. package/lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js.map +1 -1
  147. package/lib/commonjs/specs/RNMBXTerrainNativeComponent.js +10 -0
  148. package/lib/commonjs/specs/RNMBXTerrainNativeComponent.js.map +1 -0
  149. package/lib/commonjs/utils/index.js +6 -30
  150. package/lib/commonjs/utils/index.js.map +1 -1
  151. package/lib/module/components/Callout.js +3 -4
  152. package/lib/module/components/Callout.js.map +1 -1
  153. package/lib/module/components/Image.js +19 -4
  154. package/lib/module/components/Image.js.map +1 -1
  155. package/lib/module/components/Images.js +7 -4
  156. package/lib/module/components/Images.js.map +1 -1
  157. package/lib/module/components/Light.js +4 -4
  158. package/lib/module/components/Light.js.map +1 -1
  159. package/lib/module/components/MapView.js +12 -49
  160. package/lib/module/components/MapView.js.map +1 -1
  161. package/lib/module/components/MarkerView.js +3 -2
  162. package/lib/module/components/MarkerView.js.map +1 -1
  163. package/lib/module/components/NativeBridgeComponent.js +7 -44
  164. package/lib/module/components/NativeBridgeComponent.js.map +1 -1
  165. package/lib/module/components/NativeUserLocation.js +2 -4
  166. package/lib/module/components/NativeUserLocation.js.map +1 -1
  167. package/lib/module/components/PointAnnotation.js +30 -15
  168. package/lib/module/components/PointAnnotation.js.map +1 -1
  169. package/lib/module/components/ShapeSource.js +7 -18
  170. package/lib/module/components/ShapeSource.js.map +1 -1
  171. package/lib/module/components/Terrain.js +2 -4
  172. package/lib/module/components/Terrain.js.map +1 -1
  173. package/lib/module/components/VectorSource.js +2 -11
  174. package/lib/module/components/VectorSource.js.map +1 -1
  175. package/lib/module/specs/NativeRNMBXImageModule.js +5 -0
  176. package/lib/module/specs/NativeRNMBXImageModule.js.map +1 -0
  177. package/lib/module/specs/NativeRNMBXPointAnnotationModule.js +5 -0
  178. package/lib/module/specs/NativeRNMBXPointAnnotationModule.js.map +1 -0
  179. package/lib/module/specs/RNMBXCalloutNativeComponent.js +6 -0
  180. package/lib/module/specs/RNMBXCalloutNativeComponent.js.map +1 -0
  181. package/lib/module/specs/RNMBXImageNativeComponent.js +3 -0
  182. package/lib/module/specs/RNMBXImageNativeComponent.js.map +1 -0
  183. package/lib/module/specs/RNMBXImagesNativeComponent.js +3 -0
  184. package/lib/module/specs/RNMBXImagesNativeComponent.js.map +1 -0
  185. package/lib/module/specs/RNMBXLightNativeComponent.js +3 -0
  186. package/lib/module/specs/RNMBXLightNativeComponent.js.map +1 -0
  187. package/lib/module/specs/RNMBXMapViewNativeComponent.js +2 -0
  188. package/lib/module/specs/RNMBXMapViewNativeComponent.js.map +1 -1
  189. package/lib/module/specs/RNMBXMarkerViewNativeComponent.js +3 -0
  190. package/lib/module/specs/RNMBXMarkerViewNativeComponent.js.map +1 -0
  191. package/lib/module/specs/RNMBXNativeUserLocationNativeComponent.js +3 -0
  192. package/lib/module/specs/RNMBXNativeUserLocationNativeComponent.js.map +1 -0
  193. package/lib/module/specs/RNMBXPointAnnotationNativeComponent.js +3 -0
  194. package/lib/module/specs/RNMBXPointAnnotationNativeComponent.js.map +1 -0
  195. package/lib/module/specs/RNMBXShapeSourceNativeComponent.js.map +1 -1
  196. package/lib/module/specs/RNMBXTerrainNativeComponent.js +3 -0
  197. package/lib/module/specs/RNMBXTerrainNativeComponent.js.map +1 -0
  198. package/lib/module/utils/index.js +6 -29
  199. package/lib/module/utils/index.js.map +1 -1
  200. package/lib/typescript/src/components/Callout.d.ts +0 -1
  201. package/lib/typescript/src/components/Callout.d.ts.map +1 -1
  202. package/lib/typescript/src/components/Image.d.ts +0 -1
  203. package/lib/typescript/src/components/Image.d.ts.map +1 -1
  204. package/lib/typescript/src/components/Images.d.ts +0 -1
  205. package/lib/typescript/src/components/Images.d.ts.map +1 -1
  206. package/lib/typescript/src/components/Light.d.ts +0 -1
  207. package/lib/typescript/src/components/Light.d.ts.map +1 -1
  208. package/lib/typescript/src/components/MapView.d.ts +21 -28
  209. package/lib/typescript/src/components/MapView.d.ts.map +1 -1
  210. package/lib/typescript/src/components/MarkerView.d.ts.map +1 -1
  211. package/lib/typescript/src/components/NativeBridgeComponent.d.ts +5 -9
  212. package/lib/typescript/src/components/NativeBridgeComponent.d.ts.map +1 -1
  213. package/lib/typescript/src/components/NativeUserLocation.d.ts.map +1 -1
  214. package/lib/typescript/src/components/PointAnnotation.d.ts +5 -11
  215. package/lib/typescript/src/components/PointAnnotation.d.ts.map +1 -1
  216. package/lib/typescript/src/components/ShapeSource.d.ts +40 -2
  217. package/lib/typescript/src/components/ShapeSource.d.ts.map +1 -1
  218. package/lib/typescript/src/components/Terrain.d.ts +0 -1
  219. package/lib/typescript/src/components/Terrain.d.ts.map +1 -1
  220. package/lib/typescript/src/components/VectorSource.d.ts +1 -2
  221. package/lib/typescript/src/components/VectorSource.d.ts.map +1 -1
  222. package/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts +9 -0
  223. package/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts.map +1 -0
  224. package/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts +9 -0
  225. package/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts.map +1 -0
  226. package/lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts +6 -0
  227. package/lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts.map +1 -0
  228. package/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts +14 -0
  229. package/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts.map +1 -0
  230. package/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts +18 -0
  231. package/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts.map +1 -0
  232. package/lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts +8 -0
  233. package/lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts.map +1 -0
  234. package/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts +52 -3
  235. package/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts.map +1 -1
  236. package/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts +16 -0
  237. package/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts.map +1 -0
  238. package/lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts +9 -0
  239. package/lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts.map +1 -0
  240. package/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts +37 -0
  241. package/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts.map +1 -0
  242. package/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts +0 -2
  243. package/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts.map +1 -1
  244. package/lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts +9 -0
  245. package/lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts.map +1 -0
  246. package/lib/typescript/src/specs/codegenUtils.d.ts +0 -4
  247. package/lib/typescript/src/specs/codegenUtils.d.ts.map +1 -1
  248. package/lib/typescript/src/utils/index.d.ts +2 -3
  249. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  250. package/package.json +1 -1
  251. package/setup-jest.js +8 -0
  252. package/src/components/Callout.tsx +4 -11
  253. package/src/components/Image.tsx +17 -13
  254. package/src/components/Images.tsx +9 -19
  255. package/src/components/Light.tsx +4 -12
  256. package/src/components/MapView.tsx +36 -74
  257. package/src/components/MarkerView.tsx +3 -15
  258. package/src/components/NativeBridgeComponent.tsx +9 -57
  259. package/src/components/NativeUserLocation.tsx +2 -8
  260. package/src/components/PointAnnotation.tsx +32 -24
  261. package/src/components/ShapeSource.tsx +21 -44
  262. package/src/components/Terrain.tsx +3 -11
  263. package/src/components/VectorSource.tsx +2 -19
  264. package/src/specs/NativeRNMBXImageModule.ts +10 -0
  265. package/src/specs/NativeRNMBXPointAnnotationModule.ts +12 -0
  266. package/src/specs/RNMBXCalloutNativeComponent.ts +9 -0
  267. package/src/specs/RNMBXImageNativeComponent.ts +18 -0
  268. package/src/specs/RNMBXImagesNativeComponent.ts +18 -0
  269. package/src/specs/RNMBXLightNativeComponent.ts +12 -0
  270. package/src/specs/RNMBXMapViewNativeComponent.ts +69 -5
  271. package/src/specs/RNMBXMarkerViewNativeComponent.ts +21 -0
  272. package/src/specs/RNMBXNativeUserLocationNativeComponent.ts +13 -0
  273. package/src/specs/RNMBXPointAnnotationNativeComponent.ts +40 -0
  274. package/src/specs/RNMBXShapeSourceNativeComponent.ts +0 -2
  275. package/src/specs/RNMBXTerrainNativeComponent.ts +13 -0
  276. package/src/specs/codegenUtils.ts +0 -5
  277. package/src/utils/index.ts +6 -43
  278. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXCalloutManager.java +0 -18
  279. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationManager.java +0 -84
  280. package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXAndroidTextureMapViewManager.kt +0 -39
  281. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/light/RNMBXLightManager.java +0 -25
  282. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXAndroidTextureMapViewManagerDelegate.java +0 -95
  283. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXAndroidTextureMapViewManagerInterface.java +0 -38
  284. package/ios/RNMBX/RNMBXCircleLayerManager.m +0 -12
  285. package/ios/RNMBX/RNMBXCircleLayerManager.swift +0 -13
  286. package/ios/RNMBX/RNMBXMapFeatureView.h +0 -7
  287. package/ios/RNMBX/RNMBXPointAnnotationManager.swift +0 -34
  288. package/lib/commonjs/specs/RNMBXAndroidTextureMapViewNativeComponent.js.map +0 -1
  289. package/lib/module/specs/RNMBXAndroidTextureMapViewNativeComponent.js +0 -5
  290. package/lib/module/specs/RNMBXAndroidTextureMapViewNativeComponent.js.map +0 -1
  291. package/lib/typescript/src/specs/RNMBXAndroidTextureMapViewNativeComponent.d.ts +0 -46
  292. package/lib/typescript/src/specs/RNMBXAndroidTextureMapViewNativeComponent.d.ts.map +0 -1
  293. package/src/specs/RNMBXAndroidTextureMapViewNativeComponent.ts +0 -59
@@ -0,0 +1,100 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+
3
+ #import "RNMBXImageComponentView.h"
4
+ #import "RNMBXFabricHelpers.h"
5
+
6
+ #import <React/RCTConversions.h>
7
+ #import <React/RCTFabricComponentsPlugins.h>
8
+
9
+ #import <react/renderer/components/rnmapbox_maps_specs/ComponentDescriptors.h>
10
+ #import <react/renderer/components/rnmapbox_maps_specs/EventEmitters.h>
11
+ #import <react/renderer/components/rnmapbox_maps_specs/Props.h>
12
+ #import <react/renderer/components/rnmapbox_maps_specs/RCTComponentViewHelpers.h>
13
+
14
+ using namespace facebook::react;
15
+
16
+ @interface RNMBXImageComponentView () <RCTRNMBXImageViewProtocol>
17
+ @end
18
+
19
+ @implementation RNMBXImageComponentView {
20
+ RNMBXImage *_view;
21
+ }
22
+
23
+
24
+ - (instancetype)initWithFrame:(CGRect)frame
25
+ {
26
+ if (self = [super initWithFrame:frame]) {
27
+ static const auto defaultProps = std::make_shared<const RNMBXImageProps>();
28
+ _props = defaultProps;
29
+ [self prepareView];
30
+ }
31
+
32
+ return self;
33
+ }
34
+
35
+ - (void)prepareView
36
+ {
37
+ _view = [[RNMBXImage alloc] init];
38
+ self.contentView = _view;
39
+ }
40
+
41
+ - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
42
+ {
43
+ if ([childComponentView isKindOfClass:[RCTViewComponentView class]] && ((RCTViewComponentView *)childComponentView).contentView != nil) {
44
+ [_view insertReactSubviewInternal:((RCTViewComponentView *)childComponentView).contentView at:index];
45
+ } else {
46
+ [_view insertReactSubviewInternal:childComponentView at:index];
47
+ }
48
+ }
49
+
50
+ - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
51
+ {
52
+ if ([childComponentView isKindOfClass:[RCTViewComponentView class]] && ((RCTViewComponentView *)childComponentView).contentView != nil) {
53
+ [_view removeReactSubviewInternal:((RCTViewComponentView *)childComponentView).contentView];
54
+ } else {
55
+ [_view removeReactSubviewInternal:childComponentView];
56
+ }
57
+ }
58
+
59
+ #pragma mark - RCTComponentViewProtocol
60
+
61
+ + (ComponentDescriptorProvider)componentDescriptorProvider
62
+ {
63
+ return concreteComponentDescriptorProvider<RNMBXImageComponentDescriptor>();
64
+ }
65
+
66
+ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
67
+ {
68
+ const auto &newProps = *std::static_pointer_cast<const RNMBXImageProps>(props);
69
+ id stretchX = RNMBXConvertFollyDynamicToId(newProps.stretchX);
70
+ if (stretchX != nil) {
71
+ _view.stretchX = stretchX;
72
+ }
73
+ id stretchY = RNMBXConvertFollyDynamicToId(newProps.stretchY);
74
+ if (stretchY != nil) {
75
+ _view.stretchY = stretchY;
76
+ }
77
+ id content = RNMBXConvertFollyDynamicToId(newProps.content);
78
+ if (content != nil) {
79
+ _view.content = content;
80
+ }
81
+ id sdf = RNMBXConvertFollyDynamicToId(newProps.sdf);
82
+ if (sdf != nil) {
83
+ _view.sdf = sdf;
84
+ }
85
+ id name = RNMBXConvertFollyDynamicToId(newProps.name);
86
+ if (name != nil) {
87
+ _view.name = name;
88
+ }
89
+
90
+ [super updateProps:props oldProps:oldProps];
91
+ }
92
+
93
+ @end
94
+
95
+ Class<RCTComponentViewProtocol> RNMBXImageCls(void)
96
+ {
97
+ return RNMBXImageComponentView.class;
98
+ }
99
+
100
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -8,7 +8,6 @@ class RNMBXImageManager : RCTViewManager {
8
8
 
9
9
  override func view() -> UIView! {
10
10
  let layer = RNMBXImage()
11
- layer.bridge = self.bridge
12
11
  return layer
13
12
  }
14
13
  }
@@ -0,0 +1,17 @@
1
+ #import <Foundation/Foundation.h>
2
+ #import <UIKit/UIKit.h>
3
+
4
+ #ifdef RCT_NEW_ARCH_ENABLED
5
+ #import "rnmapbox_maps_specs.h"
6
+ #else
7
+ #import <React/RCTBridge.h>
8
+ #endif
9
+
10
+ @interface RNMBXImageModule : NSObject
11
+ #ifdef RCT_NEW_ARCH_ENABLED
12
+ <NativeRNMBXImageModuleSpec>
13
+ #else
14
+ <RCTBridgeModule>
15
+ #endif
16
+
17
+ @end
@@ -0,0 +1,67 @@
1
+ #import <React/RCTBridge.h>
2
+ #import <React/RCTUIManager.h>
3
+ #import <React/RCTUIManagerUtils.h>
4
+
5
+ #import "RNMBXImageModule.h"
6
+ #ifdef RCT_NEW_ARCH_ENABLED
7
+ #import "RNMBXImageComponentView.h"
8
+ #endif // RCT_NEW_ARCH_ENABLED
9
+
10
+ #import "rnmapbox_maps-Swift.pre.h"
11
+
12
+ @implementation RNMBXImageModule
13
+
14
+ RCT_EXPORT_MODULE();
15
+
16
+ #ifdef RCT_NEW_ARCH_ENABLED
17
+ @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED;
18
+ #endif // RCT_NEW_ARCH_ENABLED
19
+ @synthesize bridge = _bridge;
20
+
21
+ - (dispatch_queue_t)methodQueue
22
+ {
23
+ // It seems that due to how UIBlocks work with uiManager, we need to call the methods there
24
+ // for the blocks to be dispatched before the batch is completed
25
+ return RCTGetUIManagerQueue();
26
+ }
27
+
28
+ - (void)withImage:(NSNumber*)viewRef block:(void (^)(RNMBXImage *))block reject:(RCTPromiseRejectBlock)reject methodName:(NSString *)methodName
29
+ {
30
+ #ifdef RCT_NEW_ARCH_ENABLED
31
+ [self.viewRegistry_DEPRECATED addUIBlock:^(RCTViewRegistry *viewRegistry) {
32
+ RNMBXImageComponentView *componentView = [self.viewRegistry_DEPRECATED viewForReactTag:viewRef];
33
+ RNMBXImage *view = componentView.contentView;
34
+
35
+ #else
36
+ [self.bridge.uiManager
37
+ addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
38
+ RNMBXImage *view = [uiManager viewForReactTag:viewRef];
39
+ #endif // RCT_NEW_ARCH_ENABLED
40
+ if (view != nil) {
41
+ block(view);
42
+ } else {
43
+ reject(methodName, [NSString stringWithFormat:@"Unknown reactTag: %@", viewRef], nil);
44
+ }
45
+ }];
46
+ }
47
+
48
+
49
+ RCT_EXPORT_METHOD(refresh:(NSNumber*)viewRef resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
50
+ {
51
+ [self withImage:viewRef block:^(RNMBXImage *view) {
52
+ // TODO: implement refresh on iOS
53
+ // [view refresh];
54
+ } reject:reject methodName:@"refresh"];
55
+ }
56
+
57
+
58
+ // Thanks to this guard, we won't compile this code when we build for the old architecture.
59
+ #ifdef RCT_NEW_ARCH_ENABLED
60
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
61
+ (const facebook::react::ObjCTurboModule::InitParams &)params
62
+ {
63
+ return std::make_shared<facebook::react::NativeRNMBXImageModuleSpecJSI>(params);
64
+ }
65
+ #endif // RCT_NEW_ARCH_ENABLED
66
+
67
+ @end
@@ -16,17 +16,17 @@ func hasImage(style: Style, name: String) -> Bool {
16
16
  typealias StyleImageMissingPayload = StyleImageMissing
17
17
  #endif
18
18
 
19
- class RNMBXImages : UIView, RNMBXMapComponent {
19
+ open class RNMBXImages : UIView, RNMBXMapComponent {
20
20
 
21
- weak var bridge : RCTBridge! = nil
21
+ @objc public weak var bridge : RCTBridge! = nil
22
22
 
23
23
  weak var style: Style? = nil
24
24
 
25
25
  @objc
26
- var onImageMissing: RCTBubblingEventBlock? = nil
26
+ public var onImageMissing: RCTBubblingEventBlock? = nil
27
27
 
28
28
  @objc
29
- var images : [String:Any] = [:] {
29
+ public var images : [String:Any] = [:] {
30
30
  didSet {
31
31
  updateImages(images: images, oldImages: oldValue)
32
32
  }
@@ -37,7 +37,7 @@ class RNMBXImages : UIView, RNMBXMapComponent {
37
37
  var imageViews: [RNMBXImage] = []
38
38
 
39
39
  @objc
40
- var nativeImages: [Any] = [] {
40
+ public var nativeImages: [Any] = [] {
41
41
  didSet {
42
42
  nativeImageInfos = nativeImages.compactMap { decodeImage($0) }
43
43
  }
@@ -116,9 +116,9 @@ class RNMBXImages : UIView, RNMBXMapComponent {
116
116
  if !sameImage(oldValue: oldImages[name], newValue: images[name]) {
117
117
  missingImages[name] = images[name]
118
118
  } else {
119
- if !hasImage(style: style, name: name) {
119
+ if hasImage(style: style, name: name) {
120
120
  logged("RNMBXImages.addImagePlaceholder") {
121
- try? style.addImage(placeholderImage, id: name, stretchX: [], stretchY: [])
121
+ try style.addImage(placeholderImage, id: name, stretchX: [], stretchY: [])
122
122
  missingImages[name] = images[name]
123
123
  }
124
124
  }
@@ -137,7 +137,7 @@ class RNMBXImages : UIView, RNMBXMapComponent {
137
137
  }
138
138
  }
139
139
 
140
- public func addMissingImageToStyle(style: Style, imageName: String) -> Bool {
140
+ internal func addMissingImageToStyle(style: Style, imageName: String) -> Bool {
141
141
  if let nativeImage = nativeImageInfos.first(where: { $0.name == imageName }) {
142
142
  addNativeImages(style: style, nativeImages: [nativeImage])
143
143
  return true
@@ -150,7 +150,7 @@ class RNMBXImages : UIView, RNMBXMapComponent {
150
150
  return false
151
151
  }
152
152
 
153
- public func sendImageMissingEvent(imageName: String, payload: StyleImageMissingPayload) {
153
+ internal func sendImageMissingEvent(imageName: String, payload: StyleImageMissingPayload) {
154
154
  let payload = ["imageKey":imageName]
155
155
  let event = RNMBXEvent(type: .imageMissing, payload: payload)
156
156
  if let onImageMissing = onImageMissing {
@@ -243,7 +243,7 @@ class RNMBXImages : UIView, RNMBXMapComponent {
243
243
  func addNativeImages(style: Style, nativeImages: [NativeImageInfo]) {
244
244
  for imageInfo in nativeImages {
245
245
  let imageName = imageInfo.name
246
- if !hasImage(style: style, name: imageInfo.name) {
246
+ if hasImage(style: style, name:imageName) {
247
247
  if let image = UIImage(named: imageName) {
248
248
  logged("RNMBXImage.addNativeImage: \(imageName)") {
249
249
  try style.addImage(image, id: imageName, sdf: imageInfo.sdf,
@@ -0,0 +1,15 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+
3
+ #import <UIKit/UIKit.h>
4
+
5
+ #import <React/RCTUIManager.h>
6
+ #import <React/RCTViewComponentView.h>
7
+
8
+ NS_ASSUME_NONNULL_BEGIN
9
+
10
+ @interface RNMBXImagesComponentView : RCTViewComponentView
11
+ @end
12
+
13
+ NS_ASSUME_NONNULL_END
14
+
15
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -0,0 +1,91 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+
3
+ #import "RNMBXImagesComponentView.h"
4
+ #import "RNMBXFabricHelpers.h"
5
+
6
+ #import <React/RCTBridge+Private.h>
7
+ #import <React/RCTConversions.h>
8
+ #import <React/RCTFabricComponentsPlugins.h>
9
+
10
+ #import <react/renderer/components/rnmapbox_maps_specs/ComponentDescriptors.h>
11
+ #import <react/renderer/components/rnmapbox_maps_specs/EventEmitters.h>
12
+ #import <react/renderer/components/rnmapbox_maps_specs/Props.h>
13
+ #import <react/renderer/components/rnmapbox_maps_specs/RCTComponentViewHelpers.h>
14
+
15
+ using namespace facebook::react;
16
+
17
+ @interface RNMBXImagesComponentView () <RCTRNMBXImagesViewProtocol>
18
+ @end
19
+
20
+ @implementation RNMBXImagesComponentView {
21
+ RNMBXImages *_view;
22
+ }
23
+
24
+ - (instancetype)initWithFrame:(CGRect)frame
25
+ {
26
+ if (self = [super initWithFrame:frame]) {
27
+ static const auto defaultProps = std::make_shared<const RNMBXImagesProps>();
28
+ _props = defaultProps;
29
+ [self prepareView];
30
+ }
31
+
32
+ return self;
33
+ }
34
+
35
+ - (void)prepareView
36
+ {
37
+ _view = [[RNMBXImages alloc] init];
38
+ _view.bridge = [RCTBridge currentBridge];
39
+
40
+ // capture weak self reference to prevent retain cycle
41
+ __weak __typeof__(self) weakSelf = self;
42
+
43
+ [_view setOnImageMissing:^(NSDictionary* event) {
44
+ __typeof__(self) strongSelf = weakSelf;
45
+
46
+ if (strongSelf != nullptr && strongSelf->_eventEmitter != nullptr) {
47
+ std::string type = [event valueForKey:@"type"] == nil ? "" : std::string([[event valueForKey:@"type"] UTF8String]);
48
+ std::string imageKey = (![[event valueForKey:@"payload"] isKindOfClass:[NSDictionary class]] || ![[[event valueForKey:@"payload"] valueForKey:@"imageKey"] isKindOfClass:[NSString class]]) ? "" : std::string([((NSDictionary *)event[@"payload"])[@"imageKey"] UTF8String]);
49
+ facebook::react::RNMBXImagesEventEmitter::OnImageMissingPayload payload = {.imageKey = imageKey};
50
+ std::dynamic_pointer_cast<const facebook::react::RNMBXImagesEventEmitter>(strongSelf->_eventEmitter)->onImageMissing({type, payload});
51
+ }
52
+ }];
53
+ self.contentView = _view;
54
+ }
55
+
56
+ - (void)prepareForRecycle
57
+ {
58
+ [super prepareForRecycle];
59
+ [self prepareView];
60
+ }
61
+
62
+ #pragma mark - RCTComponentViewProtocol
63
+
64
+ + (ComponentDescriptorProvider)componentDescriptorProvider
65
+ {
66
+ return concreteComponentDescriptorProvider<RNMBXImagesComponentDescriptor>();
67
+ }
68
+
69
+ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
70
+ {
71
+ const auto &newProps = *std::static_pointer_cast<const RNMBXImagesProps>(props);
72
+ id images = RNMBXConvertFollyDynamicToId(newProps.images);
73
+ if (images != nil) {
74
+ _view.images = images;
75
+ }
76
+ id nativeImages = RNMBXConvertFollyDynamicToId(newProps.nativeImages);
77
+ if (nativeImages != nil) {
78
+ _view.nativeImages = nativeImages;
79
+ }
80
+
81
+ [super updateProps:props oldProps:oldProps];
82
+ }
83
+
84
+ @end
85
+
86
+ Class<RCTComponentViewProtocol> RNMBXImagesCls(void)
87
+ {
88
+ return RNMBXImagesComponentView.class;
89
+ }
90
+
91
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -1,9 +1,8 @@
1
1
  #import <React/RCTBridgeModule.h>
2
2
  #import <React/RCTViewManager.h>
3
3
 
4
- @interface RCT_EXTERN_MODULE(RNMBXImagesManager, RCTViewManager)
4
+ @interface RCT_EXTERN_REMAP_MODULE(RNMBXImages, RNMBXImagesViewManager, RCTViewManager)
5
5
 
6
- RCT_EXPORT_VIEW_PROPERTY(id, NSString)
7
6
  RCT_EXPORT_VIEW_PROPERTY(images, NSDictionary)
8
7
  RCT_EXPORT_VIEW_PROPERTY(nativeImages, NSArray)
9
8
  RCT_REMAP_VIEW_PROPERTY(onImageMissing, onImageMissing, RCTBubblingEventBlock)
@@ -1,6 +1,6 @@
1
1
 
2
- @objc(RNMBXImagesManager)
3
- class RNMBXImagesManager : RCTViewManager {
2
+ @objc(RNMBXImagesViewManager)
3
+ class RNMBXImagesViewManager : RCTViewManager {
4
4
  @objc
5
5
  override static func requiresMainQueueSetup() -> Bool {
6
6
  return true
@@ -1,15 +1,15 @@
1
- @_spi(Experimental) import MapboxMaps
1
+ import MapboxMaps
2
2
 
3
3
  #if RNMBX_11
4
4
  typealias Light = FlatLight
5
5
  #endif
6
6
 
7
7
  @objc(RNMBXLight)
8
- class RNMBXLight: UIView, RNMBXMapComponent {
9
- weak var bridge : RCTBridge! = nil
8
+ public class RNMBXLight: UIView, RNMBXMapComponent {
9
+ @objc public weak var bridge : RCTBridge! = nil
10
10
  weak var map: MapboxMap! = nil
11
11
  var oldReactStyle: [String:Any]?
12
- @objc var reactStyle : [String:Any]! = nil {
12
+ @objc public var reactStyle : [String:Any]! = nil {
13
13
  willSet {
14
14
  oldReactStyle = reactStyle
15
15
  }
@@ -21,13 +21,13 @@ class RNMBXLight: UIView, RNMBXMapComponent {
21
21
  }
22
22
 
23
23
  func apply(light: Light) {
24
+ let lightData = try! JSONEncoder().encode(light)
25
+ let lightDictionary = try! JSONSerialization.jsonObject(with: lightData)
24
26
  logged("RNMBXLight.apply") {
25
27
  #if RNMBX_11
26
28
  try self.map.setLights(light)
27
29
  #else
28
- let lightData = try JSONEncoder().encode(light)
29
- let lightDictionary = try JSONSerialization.jsonObject(with: lightData)
30
- try self.map.style.setLight(properties: lightDictionary as! [String:Any])
30
+ try! self.map.style.setLight(properties: lightDictionary as! [String:Any])
31
31
  #endif
32
32
  }
33
33
  }
@@ -0,0 +1,15 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+
3
+ #import <UIKit/UIKit.h>
4
+
5
+ #import <React/RCTUIManager.h>
6
+ #import <React/RCTViewComponentView.h>
7
+
8
+ NS_ASSUME_NONNULL_BEGIN
9
+
10
+ @interface RNMBXLightComponentView : RCTViewComponentView
11
+ @end
12
+
13
+ NS_ASSUME_NONNULL_END
14
+
15
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -0,0 +1,68 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+
3
+ #import "RNMBXLightComponentView.h"
4
+ #import "RNMBXFabricHelpers.h"
5
+
6
+ #import <React/RCTBridge+Private.h>
7
+ #import <React/RCTConversions.h>
8
+ #import <React/RCTFabricComponentsPlugins.h>
9
+
10
+ #import <react/renderer/components/rnmapbox_maps_specs/ComponentDescriptors.h>
11
+ #import <react/renderer/components/rnmapbox_maps_specs/EventEmitters.h>
12
+ #import <react/renderer/components/rnmapbox_maps_specs/Props.h>
13
+ #import <react/renderer/components/rnmapbox_maps_specs/RCTComponentViewHelpers.h>
14
+
15
+ using namespace facebook::react;
16
+
17
+ @interface RNMBXLightComponentView () <RCTRNMBXLightViewProtocol>
18
+ @end
19
+
20
+ @implementation RNMBXLightComponentView {
21
+ RNMBXLight *_view;
22
+ }
23
+
24
+ - (instancetype)initWithFrame:(CGRect)frame
25
+ {
26
+ if (self = [super initWithFrame:frame]) {
27
+ static const auto defaultProps = std::make_shared<const RNMBXLightProps>();
28
+ _props = defaultProps;
29
+ [self prepareView];
30
+ }
31
+
32
+ return self;
33
+ }
34
+
35
+ - (void)prepareView
36
+ {
37
+ _view = [[RNMBXLight alloc] init];
38
+ _view.bridge = [RCTBridge currentBridge];
39
+ self.contentView = _view;
40
+ }
41
+
42
+ #pragma mark - RCTComponentViewProtocol
43
+
44
+ + (ComponentDescriptorProvider)componentDescriptorProvider
45
+ {
46
+ return concreteComponentDescriptorProvider<RNMBXLightComponentDescriptor>();
47
+ }
48
+
49
+
50
+ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
51
+ {
52
+ const auto &newProps = *std::static_pointer_cast<const RNMBXLightProps>(props);
53
+ id reactStyle = RNMBXConvertFollyDynamicToId(newProps.reactStyle);
54
+ if (reactStyle != nil) {
55
+ _view.reactStyle = reactStyle;
56
+ }
57
+
58
+ [super updateProps:props oldProps:oldProps];
59
+ }
60
+
61
+ @end
62
+
63
+ Class<RCTComponentViewProtocol> RNMBXLightCls(void)
64
+ {
65
+ return RNMBXLightComponentView.class;
66
+ }
67
+
68
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -1,7 +1,7 @@
1
1
  #import <React/RCTBridgeModule.h>
2
2
  #import <React/RCTViewManager.h>
3
3
 
4
- @interface RCT_EXTERN_MODULE(RNMBXLightManager, RCTViewManager)
4
+ @interface RCT_EXTERN_REMAP_MODULE(RNMBXLight, RNMBXLightViewManager, RCTViewManager)
5
5
 
6
6
  // light props
7
7
  RCT_EXPORT_VIEW_PROPERTY(reactStyle, NSDictionary);
@@ -1,5 +1,5 @@
1
- @objc(RNMBXLightManager)
2
- class RNMBXLightManager: RCTViewManager {
1
+ @objc(RNMBXLightViewManager)
2
+ class RNMBXLightViewManager: RCTViewManager {
3
3
  @objc
4
4
  override static func requiresMainQueueSetup() -> Bool {
5
5
  return true
@@ -92,7 +92,6 @@ using namespace facebook::react;
92
92
  std::dynamic_pointer_cast<const facebook::react::RNMBXMapViewEventEmitter>(strongSelf->_eventEmitter)->onMapChange({type, json});
93
93
  }
94
94
  }];
95
-
96
95
  self.contentView = _view;
97
96
  }
98
97
 
@@ -31,7 +31,8 @@ class RNMBXMarkerViewParentViewAnnotation : UIView {
31
31
  }
32
32
  }
33
33
 
34
- class RNMBXMarkerView: UIView, RNMBXMapComponent {
34
+ @objc(RNMBXMarkerView)
35
+ public class RNMBXMarkerView: UIView, RNMBXMapComponent {
35
36
  // MARK: - Instance variables
36
37
 
37
38
  static let key = "RNMBXMarkerView"
@@ -42,25 +43,25 @@ class RNMBXMarkerView: UIView, RNMBXMapComponent {
42
43
 
43
44
  var didAddToMap = false
44
45
 
45
- @objc var coordinate: String? {
46
+ @objc public var coordinate: String? {
46
47
  didSet {
47
48
  update()
48
49
  }
49
50
  }
50
51
 
51
- @objc var anchor: [String: NSNumber]? {
52
+ @objc public var anchor: [String: NSNumber]? {
52
53
  didSet {
53
54
  update()
54
55
  }
55
56
  }
56
57
 
57
- @objc var allowOverlap: Bool = false {
58
+ @objc public var allowOverlap: Bool = false {
58
59
  didSet {
59
60
  update()
60
61
  }
61
62
  }
62
63
 
63
- @objc var isSelected: Bool = false {
64
+ @objc public var isSelected: Bool = false {
64
65
  didSet {
65
66
  update()
66
67
  }
@@ -115,7 +116,7 @@ class RNMBXMarkerView: UIView, RNMBXMapComponent {
115
116
 
116
117
  // MARK: - React methods
117
118
 
118
- override var isHidden: Bool {
119
+ public override var isHidden: Bool {
119
120
  get {
120
121
  return super.isHidden
121
122
  }
@@ -124,7 +125,7 @@ class RNMBXMarkerView: UIView, RNMBXMapComponent {
124
125
  }
125
126
  }
126
127
 
127
- override func reactSetFrame(_ frame: CGRect) {
128
+ public override func reactSetFrame(_ frame: CGRect) {
128
129
  let prev = self.frame
129
130
  var next = frame
130
131
 
@@ -140,18 +141,24 @@ class RNMBXMarkerView: UIView, RNMBXMapComponent {
140
141
 
141
142
  super.reactSetFrame(next)
142
143
  if frameDidChange {
143
- annotationView.updateSize(next.size, oldOffset:calcOffset(size: prev.size), newOffset: calcOffset(size: next.size))
144
+ updateAnnotationViewSize(next, prev)
144
145
  }
145
146
  addOrUpdate()
146
147
  }
147
-
148
- override func insertReactSubview(_ subview: UIView, at atIndex: Int) {
149
- super.insertReactSubview(subview, at: atIndex)
148
+
149
+ public override func insertReactSubview(_ subview: UIView, at atIndex: Int) {
150
+ super.insertReactSubview(subview, at: atIndex)
151
+ }
152
+
153
+ public override func removeReactSubview(_ subview: UIView) {
154
+ super.removeReactSubview(subview)
155
+ }
156
+
157
+ @objc public func updateAnnotationViewSize(_ next: CGRect, _ prev: CGRect) {
158
+ annotationView.updateSize(next.size, oldOffset:calcOffset(size: prev.size), newOffset: calcOffset(size: next.size))
150
159
  }
151
160
 
152
- override func removeReactSubview(_ subview: UIView) {
153
- super.removeReactSubview(subview)
154
- }
161
+
155
162
 
156
163
  func waitForStyleLoad() -> Bool {
157
164
  true
@@ -159,7 +166,7 @@ class RNMBXMarkerView: UIView, RNMBXMapComponent {
159
166
 
160
167
  // MARK: - Create, update, and remove methods
161
168
 
162
- private func addOrUpdate() {
169
+ @objc public func addOrUpdate() {
163
170
  if didAddToMap {
164
171
  update()
165
172
  } else {
@@ -253,7 +260,7 @@ class RNMBXMarkerView: UIView, RNMBXMapComponent {
253
260
  return result
254
261
  }
255
262
 
256
- @objc override func didMoveToSuperview() {
263
+ @objc public override func didMoveToSuperview() {
257
264
  // React tends to add back us to our original superview,
258
265
  // https://github.com/facebook/react-native/blob/11ece22fc6955d169def9ef9f2809c24bc457ba8/React/Views/UIView%2BReact.m#L172-L177
259
266
  // fix that if we see that
@@ -0,0 +1,15 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+
3
+ #import <UIKit/UIKit.h>
4
+
5
+ #import <React/RCTUIManager.h>
6
+ #import <React/RCTViewComponentView.h>
7
+
8
+ NS_ASSUME_NONNULL_BEGIN
9
+
10
+ @interface RNMBXMarkerViewComponentView : RCTViewComponentView
11
+ @end
12
+
13
+ NS_ASSUME_NONNULL_END
14
+
15
+ #endif // RCT_NEW_ARCH_ENABLED