@rnmapbox/maps 10.1.0-beta.14 → 10.1.0-beta.18

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 (310) hide show
  1. package/android/build.gradle +2 -1
  2. package/android/src/main/AndroidManifest.xml +1 -1
  3. package/android/src/main/java/com/rnmapbox/rnmbx/RNMBXPackage.kt +25 -6
  4. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXCalloutManager.kt +33 -0
  5. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXMarkerViewManager.kt +24 -10
  6. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotation.kt +5 -0
  7. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationManager.kt +83 -0
  8. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationModule.kt +33 -0
  9. package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImage.kt +5 -0
  10. package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImageManager.kt +25 -22
  11. package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImageModule.kt +33 -0
  12. package/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt +9 -8
  13. package/android/src/main/java/com/rnmapbox/rnmbx/components/location/RNMBXNativeUserLocationManager.kt +11 -4
  14. package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt +140 -63
  15. package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapViewManager.kt +71 -55
  16. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/atmosphere/RNMBXAtmosphereManager.kt +0 -5
  17. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/light/RNMBXLightManager.kt +27 -0
  18. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXImageSourceManager.kt +16 -8
  19. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterDemSourceManager.kt +15 -1
  20. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXRasterSourceManager.kt +11 -3
  21. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSource.kt +5 -2
  22. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceManager.kt +45 -32
  23. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXSource.kt +1 -1
  24. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXTileSourceManager.kt +17 -17
  25. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXVectorSourceManager.kt +13 -32
  26. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/terrain/RNMBXTerrainManager.kt +8 -11
  27. package/android/src/main/java/com/rnmapbox/rnmbx/utils/PropertyChanges.kt +68 -0
  28. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXCalloutManagerDelegate.java +25 -0
  29. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXCalloutManagerInterface.java +16 -0
  30. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImageManagerDelegate.java +47 -0
  31. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImageManagerInterface.java +22 -0
  32. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImagesManagerDelegate.java +38 -0
  33. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXImagesManagerInterface.java +19 -0
  34. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXLightManagerDelegate.java +32 -0
  35. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXLightManagerInterface.java +17 -0
  36. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerDelegate.java +3 -0
  37. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerInterface.java +1 -0
  38. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMarkerViewManagerDelegate.java +41 -0
  39. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMarkerViewManagerInterface.java +20 -0
  40. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXNativeUserLocationManagerDelegate.java +35 -0
  41. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXNativeUserLocationManagerInterface.java +18 -0
  42. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXPointAnnotationManagerDelegate.java +41 -0
  43. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXPointAnnotationManagerInterface.java +20 -0
  44. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXShapeSourceManagerDelegate.java +0 -6
  45. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXShapeSourceManagerInterface.java +0 -2
  46. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXTerrainManagerDelegate.java +35 -0
  47. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXTerrainManagerInterface.java +18 -0
  48. package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXImageModuleSpec.java +40 -0
  49. package/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXPointAnnotationModuleSpec.java +40 -0
  50. package/ios/RNMBX/RNMBXAtmosphereComponentView.mm +3 -1
  51. package/ios/RNMBX/RNMBXBackgroundLayerComponentView.mm +1 -1
  52. package/ios/RNMBX/RNMBXCallout.swift +1 -1
  53. package/ios/RNMBX/RNMBXCalloutComponentView.h +15 -0
  54. package/ios/RNMBX/RNMBXCalloutComponentView.mm +57 -0
  55. package/ios/RNMBX/{RNMBXCalloutManager.m → RNMBXCalloutViewManager.m} +1 -1
  56. package/ios/RNMBX/{RNMBXCalloutManager.swift → RNMBXCalloutViewManager.swift} +2 -2
  57. package/ios/RNMBX/RNMBXCamera.swift +4 -4
  58. package/ios/RNMBX/RNMBXCameraComponentView.mm +1 -1
  59. package/ios/RNMBX/RNMBXCircleLayerComponentView.mm +1 -1
  60. package/ios/RNMBX/RNMBXFabricHelpers.h +1 -8
  61. package/ios/RNMBX/RNMBXFillExtrusionLayerComponentView.mm +1 -1
  62. package/ios/RNMBX/RNMBXFillLayerComponentView.mm +1 -1
  63. package/ios/RNMBX/RNMBXHeatmapLayerComponentView.mm +1 -1
  64. package/ios/RNMBX/RNMBXImage.swift +30 -22
  65. package/ios/RNMBX/RNMBXImageComponentView.h +15 -0
  66. package/ios/RNMBX/RNMBXImageComponentView.mm +100 -0
  67. package/ios/RNMBX/RNMBXImageManager.swift +0 -1
  68. package/ios/RNMBX/RNMBXImageModule.h +17 -0
  69. package/ios/RNMBX/RNMBXImageModule.mm +67 -0
  70. package/ios/RNMBX/RNMBXImageSourceComponentView.mm +1 -1
  71. package/ios/RNMBX/RNMBXImages.swift +9 -9
  72. package/ios/RNMBX/RNMBXImagesComponentView.h +15 -0
  73. package/ios/RNMBX/RNMBXImagesComponentView.mm +91 -0
  74. package/ios/RNMBX/{RNMBXImagesManager.m → RNMBXImagesViewManager.m} +1 -2
  75. package/ios/RNMBX/{RNMBXImagesManager.swift → RNMBXImagesViewManager.swift} +2 -2
  76. package/ios/RNMBX/RNMBXLight.swift +7 -7
  77. package/ios/RNMBX/RNMBXLightComponentView.h +15 -0
  78. package/ios/RNMBX/RNMBXLightComponentView.mm +68 -0
  79. package/ios/RNMBX/{RNMBXLightManager.m → RNMBXLightViewManager.m} +1 -1
  80. package/ios/RNMBX/{RNMBXLightManager.swift → RNMBXLightViewManager.swift} +2 -2
  81. package/ios/RNMBX/RNMBXLineLayerComponentView.mm +1 -1
  82. package/ios/RNMBX/RNMBXMapView.swift +326 -136
  83. package/ios/RNMBX/RNMBXMapViewComponentView.mm +1 -2
  84. package/ios/RNMBX/RNMBXMarkerView.swift +24 -17
  85. package/ios/RNMBX/RNMBXMarkerViewComponentView.h +15 -0
  86. package/ios/RNMBX/RNMBXMarkerViewComponentView.mm +130 -0
  87. package/ios/RNMBX/RNMBXNativeUserLocation.swift +12 -10
  88. package/ios/RNMBX/RNMBXNativeUserLocationComponentView.h +15 -0
  89. package/ios/RNMBX/RNMBXNativeUserLocationComponentView.mm +72 -0
  90. package/ios/RNMBX/{RNMBXNativeUserLocationManager.m → RNMBXNativeUserLocationViewManager.m} +1 -1
  91. package/ios/RNMBX/{RNMBXNativeUserLocationManager.swift → RNMBXNativeUserLocationViewManager.swift} +2 -2
  92. package/ios/RNMBX/RNMBXPointAnnotation.swift +41 -30
  93. package/ios/RNMBX/RNMBXPointAnnotationComponentView.h +15 -0
  94. package/ios/RNMBX/RNMBXPointAnnotationComponentView.mm +147 -0
  95. package/ios/RNMBX/RNMBXPointAnnotationModule.h +17 -0
  96. package/ios/RNMBX/RNMBXPointAnnotationModule.mm +66 -0
  97. package/ios/RNMBX/{RNMBXPointAnnotationManager.m → RNMBXPointAnnotationViewManager.m} +1 -6
  98. package/ios/RNMBX/RNMBXPointAnnotationViewManager.swift +14 -0
  99. package/ios/RNMBX/RNMBXRasterDemSourceComponentView.h +1 -3
  100. package/ios/RNMBX/RNMBXRasterDemSourceComponentView.mm +1 -3
  101. package/ios/RNMBX/RNMBXRasterLayerComponentView.mm +1 -1
  102. package/ios/RNMBX/RNMBXRasterSourceComponentView.h +1 -3
  103. package/ios/RNMBX/RNMBXRasterSourceComponentView.mm +1 -3
  104. package/ios/RNMBX/RNMBXShapeSourceComponentView.h +1 -3
  105. package/ios/RNMBX/RNMBXShapeSourceComponentView.mm +5 -7
  106. package/ios/RNMBX/RNMBXShapeSourceModule.mm +1 -9
  107. package/ios/RNMBX/RNMBXSingletonLayer.swift +1 -1
  108. package/ios/RNMBX/RNMBXSkyLayerComponentView.mm +1 -1
  109. package/ios/RNMBX/RNMBXSymbolLayerComponentView.mm +1 -1
  110. package/ios/RNMBX/RNMBXTerrain.swift +2 -2
  111. package/ios/RNMBX/RNMBXTerrainComponentView.h +15 -0
  112. package/ios/RNMBX/RNMBXTerrainComponentView.mm +78 -0
  113. package/ios/RNMBX/{RNMBXTerrainManager.m → RNMBXTerrainViewManager.m} +1 -1
  114. package/ios/RNMBX/{RNMBXTerrainManager.swift → RNMBXTerrainViewManager.swift} +2 -2
  115. package/ios/RNMBX/RNMBXVectorSourceComponentView.h +1 -3
  116. package/ios/RNMBX/RNMBXVectorSourceComponentView.mm +1 -3
  117. package/ios/RNMBX/Uitls/PropertyChanges.swift +58 -0
  118. package/ios/RNMBX/rnmapbox_maps-Swift.pre.h +0 -2
  119. package/lib/commonjs/components/Callout.js +3 -4
  120. package/lib/commonjs/components/Callout.js.map +1 -1
  121. package/lib/commonjs/components/Image.js +20 -4
  122. package/lib/commonjs/components/Image.js.map +1 -1
  123. package/lib/commonjs/components/Images.js +6 -3
  124. package/lib/commonjs/components/Images.js.map +1 -1
  125. package/lib/commonjs/components/Light.js +5 -5
  126. package/lib/commonjs/components/Light.js.map +1 -1
  127. package/lib/commonjs/components/MapView.js +12 -49
  128. package/lib/commonjs/components/MapView.js.map +1 -1
  129. package/lib/commonjs/components/MarkerView.js +2 -1
  130. package/lib/commonjs/components/MarkerView.js.map +1 -1
  131. package/lib/commonjs/components/NativeBridgeComponent.js +6 -43
  132. package/lib/commonjs/components/NativeBridgeComponent.js.map +1 -1
  133. package/lib/commonjs/components/NativeUserLocation.js +3 -4
  134. package/lib/commonjs/components/NativeUserLocation.js.map +1 -1
  135. package/lib/commonjs/components/PointAnnotation.js +29 -14
  136. package/lib/commonjs/components/PointAnnotation.js.map +1 -1
  137. package/lib/commonjs/components/ShapeSource.js +7 -18
  138. package/lib/commonjs/components/ShapeSource.js.map +1 -1
  139. package/lib/commonjs/components/Terrain.js +4 -5
  140. package/lib/commonjs/components/Terrain.js.map +1 -1
  141. package/lib/commonjs/components/VectorSource.js +2 -11
  142. package/lib/commonjs/components/VectorSource.js.map +1 -1
  143. package/lib/commonjs/specs/NativeRNMBXImageModule.js +10 -0
  144. package/lib/commonjs/specs/NativeRNMBXImageModule.js.map +1 -0
  145. package/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js +10 -0
  146. package/lib/commonjs/specs/NativeRNMBXPointAnnotationModule.js.map +1 -0
  147. package/lib/commonjs/specs/RNMBXCalloutNativeComponent.js +11 -0
  148. package/lib/commonjs/specs/RNMBXCalloutNativeComponent.js.map +1 -0
  149. package/lib/commonjs/specs/{RNMBXAndroidTextureMapViewNativeComponent.js → RNMBXImageNativeComponent.js} +2 -4
  150. package/lib/commonjs/specs/RNMBXImageNativeComponent.js.map +1 -0
  151. package/lib/commonjs/specs/RNMBXImagesNativeComponent.js +10 -0
  152. package/lib/commonjs/specs/RNMBXImagesNativeComponent.js.map +1 -0
  153. package/lib/commonjs/specs/RNMBXLightNativeComponent.js +10 -0
  154. package/lib/commonjs/specs/RNMBXLightNativeComponent.js.map +1 -0
  155. package/lib/commonjs/specs/RNMBXMapViewNativeComponent.js +1 -1
  156. package/lib/commonjs/specs/RNMBXMapViewNativeComponent.js.map +1 -1
  157. package/lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js +10 -0
  158. package/lib/commonjs/specs/RNMBXMarkerViewNativeComponent.js.map +1 -0
  159. package/lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js +10 -0
  160. package/lib/commonjs/specs/RNMBXNativeUserLocationNativeComponent.js.map +1 -0
  161. package/lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js +10 -0
  162. package/lib/commonjs/specs/RNMBXPointAnnotationNativeComponent.js.map +1 -0
  163. package/lib/commonjs/specs/RNMBXShapeSourceNativeComponent.js.map +1 -1
  164. package/lib/commonjs/specs/RNMBXTerrainNativeComponent.js +10 -0
  165. package/lib/commonjs/specs/RNMBXTerrainNativeComponent.js.map +1 -0
  166. package/lib/commonjs/utils/index.js +6 -30
  167. package/lib/commonjs/utils/index.js.map +1 -1
  168. package/lib/module/components/Callout.js +3 -4
  169. package/lib/module/components/Callout.js.map +1 -1
  170. package/lib/module/components/Image.js +19 -4
  171. package/lib/module/components/Image.js.map +1 -1
  172. package/lib/module/components/Images.js +7 -4
  173. package/lib/module/components/Images.js.map +1 -1
  174. package/lib/module/components/Light.js +4 -4
  175. package/lib/module/components/Light.js.map +1 -1
  176. package/lib/module/components/MapView.js +12 -49
  177. package/lib/module/components/MapView.js.map +1 -1
  178. package/lib/module/components/MarkerView.js +3 -2
  179. package/lib/module/components/MarkerView.js.map +1 -1
  180. package/lib/module/components/NativeBridgeComponent.js +7 -44
  181. package/lib/module/components/NativeBridgeComponent.js.map +1 -1
  182. package/lib/module/components/NativeUserLocation.js +2 -4
  183. package/lib/module/components/NativeUserLocation.js.map +1 -1
  184. package/lib/module/components/PointAnnotation.js +30 -15
  185. package/lib/module/components/PointAnnotation.js.map +1 -1
  186. package/lib/module/components/ShapeSource.js +7 -18
  187. package/lib/module/components/ShapeSource.js.map +1 -1
  188. package/lib/module/components/Terrain.js +2 -4
  189. package/lib/module/components/Terrain.js.map +1 -1
  190. package/lib/module/components/VectorSource.js +2 -11
  191. package/lib/module/components/VectorSource.js.map +1 -1
  192. package/lib/module/specs/NativeRNMBXImageModule.js +5 -0
  193. package/lib/module/specs/NativeRNMBXImageModule.js.map +1 -0
  194. package/lib/module/specs/NativeRNMBXPointAnnotationModule.js +5 -0
  195. package/lib/module/specs/NativeRNMBXPointAnnotationModule.js.map +1 -0
  196. package/lib/module/specs/RNMBXCalloutNativeComponent.js +6 -0
  197. package/lib/module/specs/RNMBXCalloutNativeComponent.js.map +1 -0
  198. package/lib/module/specs/RNMBXImageNativeComponent.js +3 -0
  199. package/lib/module/specs/RNMBXImageNativeComponent.js.map +1 -0
  200. package/lib/module/specs/RNMBXImagesNativeComponent.js +3 -0
  201. package/lib/module/specs/RNMBXImagesNativeComponent.js.map +1 -0
  202. package/lib/module/specs/RNMBXLightNativeComponent.js +3 -0
  203. package/lib/module/specs/RNMBXLightNativeComponent.js.map +1 -0
  204. package/lib/module/specs/RNMBXMapViewNativeComponent.js +2 -0
  205. package/lib/module/specs/RNMBXMapViewNativeComponent.js.map +1 -1
  206. package/lib/module/specs/RNMBXMarkerViewNativeComponent.js +3 -0
  207. package/lib/module/specs/RNMBXMarkerViewNativeComponent.js.map +1 -0
  208. package/lib/module/specs/RNMBXNativeUserLocationNativeComponent.js +3 -0
  209. package/lib/module/specs/RNMBXNativeUserLocationNativeComponent.js.map +1 -0
  210. package/lib/module/specs/RNMBXPointAnnotationNativeComponent.js +3 -0
  211. package/lib/module/specs/RNMBXPointAnnotationNativeComponent.js.map +1 -0
  212. package/lib/module/specs/RNMBXShapeSourceNativeComponent.js.map +1 -1
  213. package/lib/module/specs/RNMBXTerrainNativeComponent.js +3 -0
  214. package/lib/module/specs/RNMBXTerrainNativeComponent.js.map +1 -0
  215. package/lib/module/utils/index.js +6 -29
  216. package/lib/module/utils/index.js.map +1 -1
  217. package/lib/typescript/src/components/Callout.d.ts +0 -1
  218. package/lib/typescript/src/components/Callout.d.ts.map +1 -1
  219. package/lib/typescript/src/components/Image.d.ts +0 -1
  220. package/lib/typescript/src/components/Image.d.ts.map +1 -1
  221. package/lib/typescript/src/components/Images.d.ts +0 -1
  222. package/lib/typescript/src/components/Images.d.ts.map +1 -1
  223. package/lib/typescript/src/components/Light.d.ts +0 -1
  224. package/lib/typescript/src/components/Light.d.ts.map +1 -1
  225. package/lib/typescript/src/components/MapView.d.ts +21 -28
  226. package/lib/typescript/src/components/MapView.d.ts.map +1 -1
  227. package/lib/typescript/src/components/MarkerView.d.ts.map +1 -1
  228. package/lib/typescript/src/components/NativeBridgeComponent.d.ts +5 -9
  229. package/lib/typescript/src/components/NativeBridgeComponent.d.ts.map +1 -1
  230. package/lib/typescript/src/components/NativeUserLocation.d.ts.map +1 -1
  231. package/lib/typescript/src/components/PointAnnotation.d.ts +5 -11
  232. package/lib/typescript/src/components/PointAnnotation.d.ts.map +1 -1
  233. package/lib/typescript/src/components/ShapeSource.d.ts +40 -2
  234. package/lib/typescript/src/components/ShapeSource.d.ts.map +1 -1
  235. package/lib/typescript/src/components/Terrain.d.ts +0 -1
  236. package/lib/typescript/src/components/Terrain.d.ts.map +1 -1
  237. package/lib/typescript/src/components/VectorSource.d.ts +1 -2
  238. package/lib/typescript/src/components/VectorSource.d.ts.map +1 -1
  239. package/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts +9 -0
  240. package/lib/typescript/src/specs/NativeRNMBXImageModule.d.ts.map +1 -0
  241. package/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts +9 -0
  242. package/lib/typescript/src/specs/NativeRNMBXPointAnnotationModule.d.ts.map +1 -0
  243. package/lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts +6 -0
  244. package/lib/typescript/src/specs/RNMBXCalloutNativeComponent.d.ts.map +1 -0
  245. package/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts +14 -0
  246. package/lib/typescript/src/specs/RNMBXImageNativeComponent.d.ts.map +1 -0
  247. package/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts +18 -0
  248. package/lib/typescript/src/specs/RNMBXImagesNativeComponent.d.ts.map +1 -0
  249. package/lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts +8 -0
  250. package/lib/typescript/src/specs/RNMBXLightNativeComponent.d.ts.map +1 -0
  251. package/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts +52 -3
  252. package/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts.map +1 -1
  253. package/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts +16 -0
  254. package/lib/typescript/src/specs/RNMBXMarkerViewNativeComponent.d.ts.map +1 -0
  255. package/lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts +9 -0
  256. package/lib/typescript/src/specs/RNMBXNativeUserLocationNativeComponent.d.ts.map +1 -0
  257. package/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts +37 -0
  258. package/lib/typescript/src/specs/RNMBXPointAnnotationNativeComponent.d.ts.map +1 -0
  259. package/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts +0 -2
  260. package/lib/typescript/src/specs/RNMBXShapeSourceNativeComponent.d.ts.map +1 -1
  261. package/lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts +9 -0
  262. package/lib/typescript/src/specs/RNMBXTerrainNativeComponent.d.ts.map +1 -0
  263. package/lib/typescript/src/specs/codegenUtils.d.ts +0 -4
  264. package/lib/typescript/src/specs/codegenUtils.d.ts.map +1 -1
  265. package/lib/typescript/src/utils/index.d.ts +2 -3
  266. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  267. package/package.json +2 -1
  268. package/setup-jest.js +8 -0
  269. package/src/components/Callout.tsx +4 -11
  270. package/src/components/Image.tsx +17 -13
  271. package/src/components/Images.tsx +9 -19
  272. package/src/components/Light.tsx +4 -12
  273. package/src/components/MapView.tsx +36 -74
  274. package/src/components/MarkerView.tsx +3 -15
  275. package/src/components/NativeBridgeComponent.tsx +9 -57
  276. package/src/components/NativeUserLocation.tsx +2 -8
  277. package/src/components/PointAnnotation.tsx +32 -24
  278. package/src/components/ShapeSource.tsx +21 -44
  279. package/src/components/Terrain.tsx +3 -11
  280. package/src/components/VectorSource.tsx +2 -19
  281. package/src/specs/NativeRNMBXImageModule.ts +10 -0
  282. package/src/specs/NativeRNMBXPointAnnotationModule.ts +12 -0
  283. package/src/specs/RNMBXCalloutNativeComponent.ts +9 -0
  284. package/src/specs/RNMBXImageNativeComponent.ts +18 -0
  285. package/src/specs/RNMBXImagesNativeComponent.ts +18 -0
  286. package/src/specs/RNMBXLightNativeComponent.ts +12 -0
  287. package/src/specs/RNMBXMapViewNativeComponent.ts +69 -5
  288. package/src/specs/RNMBXMarkerViewNativeComponent.ts +21 -0
  289. package/src/specs/RNMBXNativeUserLocationNativeComponent.ts +13 -0
  290. package/src/specs/RNMBXPointAnnotationNativeComponent.ts +40 -0
  291. package/src/specs/RNMBXShapeSourceNativeComponent.ts +0 -2
  292. package/src/specs/RNMBXTerrainNativeComponent.ts +13 -0
  293. package/src/specs/codegenUtils.ts +0 -5
  294. package/src/utils/index.ts +6 -43
  295. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXCalloutManager.java +0 -18
  296. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationManager.java +0 -84
  297. package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXAndroidTextureMapViewManager.kt +0 -39
  298. package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/light/RNMBXLightManager.java +0 -25
  299. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXAndroidTextureMapViewManagerDelegate.java +0 -95
  300. package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXAndroidTextureMapViewManagerInterface.java +0 -38
  301. package/ios/RNMBX/RNMBXCircleLayerManager.m +0 -12
  302. package/ios/RNMBX/RNMBXCircleLayerManager.swift +0 -13
  303. package/ios/RNMBX/RNMBXMapFeatureView.h +0 -7
  304. package/ios/RNMBX/RNMBXPointAnnotationManager.swift +0 -34
  305. package/lib/commonjs/specs/RNMBXAndroidTextureMapViewNativeComponent.js.map +0 -1
  306. package/lib/module/specs/RNMBXAndroidTextureMapViewNativeComponent.js +0 -5
  307. package/lib/module/specs/RNMBXAndroidTextureMapViewNativeComponent.js.map +0 -1
  308. package/lib/typescript/src/specs/RNMBXAndroidTextureMapViewNativeComponent.d.ts +0 -46
  309. package/lib/typescript/src/specs/RNMBXAndroidTextureMapViewNativeComponent.d.ts.map +0 -1
  310. package/src/specs/RNMBXAndroidTextureMapViewNativeComponent.ts +0 -59
@@ -2,14 +2,7 @@
2
2
  #import <folly/dynamic.h>
3
3
  #import <react/renderer/components/rnmapbox_maps_specs/Props.h>
4
4
 
5
- // needed for compilation for some reason
6
- #import <CoreFoundation/CoreFoundation.h>
7
- #import <CoreLocation/CoreLocation.h>
8
-
9
- @interface MapView : UIView
10
- @end
11
-
12
- #import <rnmapbox_maps-Swift.h>
5
+ #import "rnmapbox_maps-Swift.pre.h"
13
6
 
14
7
  // copied from RCTFollyConvert
15
8
  static id RNMBXConvertFollyDynamicToId(const folly::dynamic &dyn)
@@ -48,7 +48,7 @@ using namespace facebook::react;
48
48
 
49
49
  - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
50
50
  {
51
- const auto &newProps = *std::static_pointer_cast<const RNMBXFillExtrusionLayerProps>(props);
51
+ const auto &newProps = static_cast<const RNMBXFillExtrusionLayerProps &>(*props);
52
52
  RNMBXSetCommonLayerProps(newProps, _view);
53
53
 
54
54
 
@@ -48,7 +48,7 @@ using namespace facebook::react;
48
48
 
49
49
  - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
50
50
  {
51
- const auto &newProps = *std::static_pointer_cast<const RNMBXFillLayerProps>(props);
51
+ const auto &newProps = static_cast<const RNMBXFillLayerProps &>(*props);
52
52
  RNMBXSetCommonLayerProps(newProps, _view);
53
53
 
54
54
  [super updateProps:props oldProps:oldProps];
@@ -47,7 +47,7 @@ using namespace facebook::react;
47
47
 
48
48
  - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
49
49
  {
50
- const auto &newProps = *std::static_pointer_cast<const RNMBXHeatmapLayerProps>(props);
50
+ const auto &newProps = static_cast<const RNMBXHeatmapLayerProps &>(*props);
51
51
  RNMBXSetCommonLayerProps(newProps, _view);
52
52
 
53
53
 
@@ -1,38 +1,38 @@
1
1
  import MapboxMaps
2
2
 
3
- class RNMBXImage : UIView {
3
+ public class RNMBXImage : UIView {
4
4
  @objc
5
- var name: String = "" {
5
+ public var name: String = "" {
6
6
  didSet {
7
7
  _addImageToStyle()
8
8
  }
9
9
  }
10
10
 
11
- var image: UIImage? = nil
11
+ @objc public var image: UIImage? = nil
12
12
 
13
13
  @objc
14
- var sdf: Bool = false {
14
+ public var sdf: Bool = false {
15
15
  didSet {
16
16
  _addImageToStyle()
17
17
  }
18
18
  }
19
19
 
20
20
  @objc
21
- var stretchX: [[NSNumber]] = [] {
21
+ public var stretchX: [[NSNumber]] = [] {
22
22
  didSet {
23
23
  _addImageToStyle()
24
24
  }
25
25
  }
26
26
 
27
27
  @objc
28
- var stretchY: [[NSNumber]] = [] {
28
+ public var stretchY: [[NSNumber]] = [] {
29
29
  didSet {
30
30
  _addImageToStyle()
31
31
  }
32
32
  }
33
33
 
34
34
  @objc
35
- var content: [NSNumber]? = nil {
35
+ public var content: [NSNumber]? = nil {
36
36
  didSet {
37
37
  _addImageToStyle()
38
38
  }
@@ -43,28 +43,36 @@ class RNMBXImage : UIView {
43
43
  DispatchQueue.main.async { self.setImage() }
44
44
  }
45
45
  }
46
- weak var bridge : RCTBridge! = nil
47
46
 
48
- var reactSubviews : [UIView] = []
47
+ var reactSubviews : [UIView] = []
49
48
 
50
49
  // MARK: - subview management
51
50
 
52
- @objc open override func insertReactSubview(_ subview: UIView!, at atIndex: Int) {
53
- reactSubviews.insert(subview, at: atIndex)
54
- if reactSubviews.count > 1 {
55
- Logger.log(level: .error, message: "Image supports max 1 subview")
56
- }
57
- if image == nil {
58
- DispatchQueue.main.asyncAfter(deadline: .now() + .microseconds(10)) {
59
- self.setImage()
51
+ public override func insertReactSubview(_ subview: UIView!, at atIndex: Int) {
52
+ insertReactSubviewInternal(subview, at: atIndex)
53
+ }
54
+
55
+ @objc public func insertReactSubviewInternal(_ subview: UIView!, at atIndex: Int) {
56
+ reactSubviews.insert(subview, at: atIndex)
57
+ if reactSubviews.count > 1 {
58
+ Logger.log(level: .error, message: "Image supports max 1 subview")
59
+ }
60
+ if image == nil {
61
+ DispatchQueue.main.asyncAfter(deadline: .now() + .microseconds(10)) {
62
+ self.setImage()
63
+ }
60
64
  }
61
65
  }
62
- }
63
66
 
64
- @objc
65
- open override func removeReactSubview(_ subview: UIView!) {
66
- reactSubviews.removeAll(where: { $0 == subview })
67
+
68
+ public override func removeReactSubview(_ subview: UIView!) {
69
+ removeReactSubviewInternal(subview)
67
70
  }
71
+
72
+ @objc
73
+ open func removeReactSubviewInternal(_ subview: UIView!) {
74
+ reactSubviews.removeAll(where: { $0 == subview })
75
+ }
68
76
 
69
77
  // MARK: - view shnapshot
70
78
 
@@ -79,7 +87,7 @@ class RNMBXImage : UIView {
79
87
  _addImageToStyle()
80
88
  }
81
89
 
82
- func setImage() {
90
+ @objc public func setImage() {
83
91
  if let image = _createViewSnapshot() {
84
92
  changeImage(image, name: name)
85
93
  }
@@ -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 RNMBXImageComponentView : RCTViewComponentView
11
+ @end
12
+
13
+ NS_ASSUME_NONNULL_END
14
+
15
+ #endif // RCT_NEW_ARCH_ENABLED
@@ -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 = static_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
@@ -70,7 +70,7 @@ using namespace facebook::react;
70
70
 
71
71
  - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
72
72
  {
73
- const auto &newProps = *std::static_pointer_cast<const RNMBXImageSourceProps>(props);
73
+ const auto &newProps = static_cast<const RNMBXImageSourceProps &>(*props);
74
74
  id idx = RNMBXConvertFollyDynamicToId(newProps.id);
75
75
  if (idx != nil) {
76
76
  _view.id = idx;
@@ -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
  }
@@ -118,7 +118,7 @@ class RNMBXImages : UIView, RNMBXMapComponent {
118
118
  } else {
119
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 = static_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