@leonsilicon/react-native-wishlist 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/LICENSE +20 -0
  2. package/MGWishList.podspec +40 -0
  3. package/README.md +281 -0
  4. package/android/CMakeLists.txt +86 -0
  5. package/android/build.gradle +72 -0
  6. package/android/gradle.properties +5 -0
  7. package/android/spotless.gradle +24 -0
  8. package/android/src/main/AndroidManifest.xml +4 -0
  9. package/android/src/main/java/com/wishlist/ContentContainer.kt +22 -0
  10. package/android/src/main/java/com/wishlist/Orchestrator.kt +38 -0
  11. package/android/src/main/java/com/wishlist/TemplateContainer.kt +30 -0
  12. package/android/src/main/java/com/wishlist/TemplateContainerViewManager.kt +65 -0
  13. package/android/src/main/java/com/wishlist/TemplateInterceptor.kt +29 -0
  14. package/android/src/main/java/com/wishlist/TemplateInterceptorViewManager.kt +23 -0
  15. package/android/src/main/java/com/wishlist/UIScheduler.kt +15 -0
  16. package/android/src/main/java/com/wishlist/Wishlist.kt +135 -0
  17. package/android/src/main/java/com/wishlist/WishlistManagerModule.kt +51 -0
  18. package/android/src/main/java/com/wishlist/WishlistPackage.kt +47 -0
  19. package/android/src/main/java/com/wishlist/WishlistSoLoader.kt +17 -0
  20. package/android/src/main/java/com/wishlist/WishlistViewManager.kt +69 -0
  21. package/android/src/main/jni/ErrorHandlerAndroid.cpp +16 -0
  22. package/android/src/main/jni/ErrorHandlerAndroid.h +13 -0
  23. package/android/src/main/jni/JNIStateRegistry.cpp +22 -0
  24. package/android/src/main/jni/JNIStateRegistry.h +23 -0
  25. package/android/src/main/jni/OnLoad.cpp +12 -0
  26. package/android/src/main/jni/Orchestrator.cpp +167 -0
  27. package/android/src/main/jni/Orchestrator.hpp +78 -0
  28. package/android/src/main/jni/UISchedulerAndroid.cpp +20 -0
  29. package/android/src/main/jni/UISchedulerAndroid.h +18 -0
  30. package/android/src/main/jni/WishlistManagerModule.cpp +91 -0
  31. package/android/src/main/jni/WishlistManagerModule.hpp +43 -0
  32. package/android/src/main/jni/wishlist.h +19 -0
  33. package/cpp/ContentContainer/MGContentContainerComponentDescriptor.h +40 -0
  34. package/cpp/ContentContainer/MGContentContainerShadowNode.cpp +21 -0
  35. package/cpp/ContentContainer/MGContentContainerShadowNode.h +30 -0
  36. package/cpp/ContentContainer/MGContentContainerState.cpp +31 -0
  37. package/cpp/ContentContainer/MGContentContainerState.h +39 -0
  38. package/cpp/DataBinding/MGBindingProvider.hpp +21 -0
  39. package/cpp/DataBinding/MGDataBinding.hpp +23 -0
  40. package/cpp/DataBinding/MGDataBindingImpl.cpp +112 -0
  41. package/cpp/DataBinding/MGDataBindingImpl.hpp +35 -0
  42. package/cpp/DependencyInjection/MGDI.hpp +33 -0
  43. package/cpp/DependencyInjection/MGDIImpl.cpp +65 -0
  44. package/cpp/DependencyInjection/MGDIImpl.hpp +45 -0
  45. package/cpp/DependencyInjection/MGUIManagerHolder.cpp +21 -0
  46. package/cpp/DependencyInjection/MGUIManagerHolder.h +24 -0
  47. package/cpp/ItemProvider/ComponentsPool.cpp +91 -0
  48. package/cpp/ItemProvider/ComponentsPool.h +49 -0
  49. package/cpp/ItemProvider/ItemProvider.cpp +60 -0
  50. package/cpp/ItemProvider/ItemProvider.h +67 -0
  51. package/cpp/ItemProvider/ShadowNodeBinding.cpp +356 -0
  52. package/cpp/ItemProvider/ShadowNodeBinding.h +59 -0
  53. package/cpp/ItemProvider/ShadowNodeCopyMachine.cpp +95 -0
  54. package/cpp/ItemProvider/ShadowNodeCopyMachine.h +25 -0
  55. package/cpp/MGErrorHandler.h +12 -0
  56. package/cpp/MGViewportCarer/MGVSyncRequester.hpp +18 -0
  57. package/cpp/MGViewportCarer/MGViewportCarer.hpp +42 -0
  58. package/cpp/MGViewportCarer/MGViewportCarerImpl.cpp +453 -0
  59. package/cpp/MGViewportCarer/MGViewportCarerImpl.h +80 -0
  60. package/cpp/MGViewportCarer/MGViewportCarerListener.hpp +27 -0
  61. package/cpp/TemplateContainer/MGTemplateContainerComponentDescriptor.h +15 -0
  62. package/cpp/TemplateContainer/MGTemplateContainerShadowNode.cpp +43 -0
  63. package/cpp/TemplateContainer/MGTemplateContainerShadowNode.h +42 -0
  64. package/cpp/TemplateContainer/MGTemplateContainerState.cpp +37 -0
  65. package/cpp/TemplateContainer/MGTemplateContainerState.h +39 -0
  66. package/cpp/UIScheduler/MGUIScheduler.cpp +8 -0
  67. package/cpp/UIScheduler/MGUIScheduler.hpp +18 -0
  68. package/cpp/Wishlist/MGWishlistComponentDescriptor.h +14 -0
  69. package/cpp/Wishlist/MGWishlistShadowNode.cpp +49 -0
  70. package/cpp/Wishlist/MGWishlistShadowNode.h +37 -0
  71. package/cpp/Wishlist/MGWishlistState.cpp +57 -0
  72. package/cpp/Wishlist/MGWishlistState.h +42 -0
  73. package/cpp/WishlistDefine.h +3 -0
  74. package/cpp/WishlistJsRuntime.cpp +139 -0
  75. package/cpp/WishlistJsRuntime.h +59 -0
  76. package/ios/MGContentContainerComponent.h +9 -0
  77. package/ios/MGContentContainerComponent.mm +34 -0
  78. package/ios/MGErrorHandlerIOS.h +13 -0
  79. package/ios/MGErrorHandlerIOS.mm +12 -0
  80. package/ios/MGObjCJSIUtils.h +63 -0
  81. package/ios/MGTemplateContainerComponent.h +12 -0
  82. package/ios/MGTemplateContainerComponent.mm +105 -0
  83. package/ios/MGTemplateInterceptorComponent.h +9 -0
  84. package/ios/MGTemplateInterceptorComponent.mm +72 -0
  85. package/ios/MGWishListComponent.h +17 -0
  86. package/ios/MGWishListComponent.mm +187 -0
  87. package/ios/MGWishlistManager.h +21 -0
  88. package/ios/MGWishlistManager.mm +319 -0
  89. package/ios/MGWishlistQueue.h +11 -0
  90. package/ios/MGWishlistQueue.m +34 -0
  91. package/ios/Orchestrator/MGOrchestrator.h +35 -0
  92. package/ios/Orchestrator/MGOrchestrator.mm +139 -0
  93. package/ios/Orchestrator/MGOrchestratorCppAdapter.cpp +25 -0
  94. package/ios/Orchestrator/MGOrchestratorCppAdapter.hpp +32 -0
  95. package/ios/UIScheduleriOS/MGUIScheduleriOS.hpp +19 -0
  96. package/ios/UIScheduleriOS/MGUIScheduleriOS.mm +21 -0
  97. package/lib/commonjs/Colors.js +399 -0
  98. package/lib/commonjs/Colors.js.map +1 -0
  99. package/lib/commonjs/ComponentPool.js +28 -0
  100. package/lib/commonjs/ComponentPool.js.map +1 -0
  101. package/lib/commonjs/Components/ForEach.js +21 -0
  102. package/lib/commonjs/Components/ForEach.js.map +1 -0
  103. package/lib/commonjs/Components/ForEachBase.js +19 -0
  104. package/lib/commonjs/Components/ForEachBase.js.map +1 -0
  105. package/lib/commonjs/Components/IF.js +34 -0
  106. package/lib/commonjs/Components/IF.js.map +1 -0
  107. package/lib/commonjs/Components/Pressable.js +73 -0
  108. package/lib/commonjs/Components/Pressable.js.map +1 -0
  109. package/lib/commonjs/Components/Switch.js +52 -0
  110. package/lib/commonjs/Components/Switch.js.map +1 -0
  111. package/lib/commonjs/Components/WishlistImage.js +29 -0
  112. package/lib/commonjs/Components/WishlistImage.js.map +1 -0
  113. package/lib/commonjs/Components/WishlistText.js +24 -0
  114. package/lib/commonjs/Components/WishlistText.js.map +1 -0
  115. package/lib/commonjs/Components/WishlistView.js +10 -0
  116. package/lib/commonjs/Components/WishlistView.js.map +1 -0
  117. package/lib/commonjs/EventHandler.js +72 -0
  118. package/lib/commonjs/EventHandler.js.map +1 -0
  119. package/lib/commonjs/InflatorRepository.js +155 -0
  120. package/lib/commonjs/InflatorRepository.js.map +1 -0
  121. package/lib/commonjs/OrchestratorBinding.js +12 -0
  122. package/lib/commonjs/OrchestratorBinding.js.map +1 -0
  123. package/lib/commonjs/Specs/NativeContentContainer.js +12 -0
  124. package/lib/commonjs/Specs/NativeContentContainer.js.map +1 -0
  125. package/lib/commonjs/Specs/NativeTemplateContainer.js +12 -0
  126. package/lib/commonjs/Specs/NativeTemplateContainer.js.map +1 -0
  127. package/lib/commonjs/Specs/NativeTemplateInterceptor.js +10 -0
  128. package/lib/commonjs/Specs/NativeTemplateInterceptor.js.map +1 -0
  129. package/lib/commonjs/Specs/NativeWishlist.js +16 -0
  130. package/lib/commonjs/Specs/NativeWishlist.js.map +1 -0
  131. package/lib/commonjs/Specs/NativeWishlistManager.js +9 -0
  132. package/lib/commonjs/Specs/NativeWishlistManager.js.map +1 -0
  133. package/lib/commonjs/TemplateContext.js +17 -0
  134. package/lib/commonjs/TemplateContext.js.map +1 -0
  135. package/lib/commonjs/TemplateItem.js +2 -0
  136. package/lib/commonjs/TemplateItem.js.map +1 -0
  137. package/lib/commonjs/TemplateValue.js +68 -0
  138. package/lib/commonjs/TemplateValue.js.map +1 -0
  139. package/lib/commonjs/Utils.js +20 -0
  140. package/lib/commonjs/Utils.js.map +1 -0
  141. package/lib/commonjs/Wishlist.js +290 -0
  142. package/lib/commonjs/Wishlist.js.map +1 -0
  143. package/lib/commonjs/WishlistContext.js +17 -0
  144. package/lib/commonjs/WishlistContext.js.map +1 -0
  145. package/lib/commonjs/WishlistData.js +149 -0
  146. package/lib/commonjs/WishlistData.js.map +1 -0
  147. package/lib/commonjs/WishlistDataCopy.js +115 -0
  148. package/lib/commonjs/WishlistDataCopy.js.map +1 -0
  149. package/lib/commonjs/WishlistJsRuntime.android.js +22 -0
  150. package/lib/commonjs/WishlistJsRuntime.android.js.map +1 -0
  151. package/lib/commonjs/WishlistJsRuntime.js +42 -0
  152. package/lib/commonjs/WishlistJsRuntime.js.map +1 -0
  153. package/lib/commonjs/createTemplateComponent.js +196 -0
  154. package/lib/commonjs/createTemplateComponent.js.map +1 -0
  155. package/lib/commonjs/global.d.js +2 -0
  156. package/lib/commonjs/global.d.js.map +1 -0
  157. package/lib/commonjs/index.js +83 -0
  158. package/lib/commonjs/index.js.map +1 -0
  159. package/lib/commonjs/package.json +1 -0
  160. package/lib/commonjs/renderTemplate.js +14 -0
  161. package/lib/commonjs/renderTemplate.js.map +1 -0
  162. package/lib/module/Colors.js +395 -0
  163. package/lib/module/Colors.js.map +1 -0
  164. package/lib/module/ComponentPool.js +24 -0
  165. package/lib/module/ComponentPool.js.map +1 -0
  166. package/lib/module/Components/ForEach.js +17 -0
  167. package/lib/module/Components/ForEach.js.map +1 -0
  168. package/lib/module/Components/ForEachBase.js +14 -0
  169. package/lib/module/Components/ForEachBase.js.map +1 -0
  170. package/lib/module/Components/IF.js +29 -0
  171. package/lib/module/Components/IF.js.map +1 -0
  172. package/lib/module/Components/Pressable.js +68 -0
  173. package/lib/module/Components/Pressable.js.map +1 -0
  174. package/lib/module/Components/Switch.js +45 -0
  175. package/lib/module/Components/Switch.js.map +1 -0
  176. package/lib/module/Components/WishlistImage.js +25 -0
  177. package/lib/module/Components/WishlistImage.js.map +1 -0
  178. package/lib/module/Components/WishlistText.js +20 -0
  179. package/lib/module/Components/WishlistText.js.map +1 -0
  180. package/lib/module/Components/WishlistView.js +6 -0
  181. package/lib/module/Components/WishlistView.js.map +1 -0
  182. package/lib/module/EventHandler.js +66 -0
  183. package/lib/module/EventHandler.js.map +1 -0
  184. package/lib/module/InflatorRepository.js +149 -0
  185. package/lib/module/InflatorRepository.js.map +1 -0
  186. package/lib/module/OrchestratorBinding.js +8 -0
  187. package/lib/module/OrchestratorBinding.js.map +1 -0
  188. package/lib/module/Specs/NativeContentContainer.js +7 -0
  189. package/lib/module/Specs/NativeContentContainer.js.map +1 -0
  190. package/lib/module/Specs/NativeTemplateContainer.js +7 -0
  191. package/lib/module/Specs/NativeTemplateContainer.js.map +1 -0
  192. package/lib/module/Specs/NativeTemplateInterceptor.js +5 -0
  193. package/lib/module/Specs/NativeTemplateInterceptor.js.map +1 -0
  194. package/lib/module/Specs/NativeWishlist.js +11 -0
  195. package/lib/module/Specs/NativeWishlist.js.map +1 -0
  196. package/lib/module/Specs/NativeWishlistManager.js +5 -0
  197. package/lib/module/Specs/NativeWishlistManager.js.map +1 -0
  198. package/lib/module/TemplateContext.js +12 -0
  199. package/lib/module/TemplateContext.js.map +1 -0
  200. package/lib/module/TemplateItem.js +2 -0
  201. package/lib/module/TemplateItem.js.map +1 -0
  202. package/lib/module/TemplateValue.js +63 -0
  203. package/lib/module/TemplateValue.js.map +1 -0
  204. package/lib/module/Utils.js +15 -0
  205. package/lib/module/Utils.js.map +1 -0
  206. package/lib/module/Wishlist.js +284 -0
  207. package/lib/module/Wishlist.js.map +1 -0
  208. package/lib/module/WishlistContext.js +12 -0
  209. package/lib/module/WishlistContext.js.map +1 -0
  210. package/lib/module/WishlistData.js +144 -0
  211. package/lib/module/WishlistData.js.map +1 -0
  212. package/lib/module/WishlistDataCopy.js +111 -0
  213. package/lib/module/WishlistDataCopy.js.map +1 -0
  214. package/lib/module/WishlistJsRuntime.android.js +16 -0
  215. package/lib/module/WishlistJsRuntime.android.js.map +1 -0
  216. package/lib/module/WishlistJsRuntime.js +35 -0
  217. package/lib/module/WishlistJsRuntime.js.map +1 -0
  218. package/lib/module/createTemplateComponent.js +191 -0
  219. package/lib/module/createTemplateComponent.js.map +1 -0
  220. package/lib/module/global.d.js +2 -0
  221. package/lib/module/global.d.js.map +1 -0
  222. package/lib/module/index.js +14 -0
  223. package/lib/module/index.js.map +1 -0
  224. package/lib/module/renderTemplate.js +10 -0
  225. package/lib/module/renderTemplate.js.map +1 -0
  226. package/lib/typescript/Colors.d.ts +7 -0
  227. package/lib/typescript/Colors.d.ts.map +1 -0
  228. package/lib/typescript/ComponentPool.d.ts +10 -0
  229. package/lib/typescript/ComponentPool.d.ts.map +1 -0
  230. package/lib/typescript/Components/ForEach.d.ts +2 -0
  231. package/lib/typescript/Components/ForEach.d.ts.map +1 -0
  232. package/lib/typescript/Components/ForEachBase.d.ts +3 -0
  233. package/lib/typescript/Components/ForEachBase.d.ts.map +1 -0
  234. package/lib/typescript/Components/IF.d.ts +3 -0
  235. package/lib/typescript/Components/IF.d.ts.map +1 -0
  236. package/lib/typescript/Components/Pressable.d.ts +15 -0
  237. package/lib/typescript/Components/Pressable.d.ts.map +1 -0
  238. package/lib/typescript/Components/Switch.d.ts +17 -0
  239. package/lib/typescript/Components/Switch.d.ts.map +1 -0
  240. package/lib/typescript/Components/WishlistImage.d.ts +3 -0
  241. package/lib/typescript/Components/WishlistImage.d.ts.map +1 -0
  242. package/lib/typescript/Components/WishlistText.d.ts +3 -0
  243. package/lib/typescript/Components/WishlistText.d.ts.map +1 -0
  244. package/lib/typescript/Components/WishlistView.d.ts +3 -0
  245. package/lib/typescript/Components/WishlistView.d.ts.map +1 -0
  246. package/lib/typescript/EventHandler.d.ts +9 -0
  247. package/lib/typescript/EventHandler.d.ts.map +1 -0
  248. package/lib/typescript/InflatorRepository.d.ts +28 -0
  249. package/lib/typescript/InflatorRepository.d.ts.map +1 -0
  250. package/lib/typescript/OrchestratorBinding.d.ts +13 -0
  251. package/lib/typescript/OrchestratorBinding.d.ts.map +1 -0
  252. package/lib/typescript/Specs/NativeContentContainer.d.ts +6 -0
  253. package/lib/typescript/Specs/NativeContentContainer.d.ts.map +1 -0
  254. package/lib/typescript/Specs/NativeTemplateContainer.d.ts +9 -0
  255. package/lib/typescript/Specs/NativeTemplateContainer.d.ts.map +1 -0
  256. package/lib/typescript/Specs/NativeTemplateInterceptor.d.ts +6 -0
  257. package/lib/typescript/Specs/NativeTemplateInterceptor.d.ts.map +1 -0
  258. package/lib/typescript/Specs/NativeWishlist.d.ts +22 -0
  259. package/lib/typescript/Specs/NativeWishlist.d.ts.map +1 -0
  260. package/lib/typescript/Specs/NativeWishlistManager.d.ts +7 -0
  261. package/lib/typescript/Specs/NativeWishlistManager.d.ts.map +1 -0
  262. package/lib/typescript/TemplateContext.d.ts +9 -0
  263. package/lib/typescript/TemplateContext.d.ts.map +1 -0
  264. package/lib/typescript/TemplateItem.d.ts +13 -0
  265. package/lib/typescript/TemplateItem.d.ts.map +1 -0
  266. package/lib/typescript/TemplateValue.d.ts +16 -0
  267. package/lib/typescript/TemplateValue.d.ts.map +1 -0
  268. package/lib/typescript/Utils.d.ts +3 -0
  269. package/lib/typescript/Utils.d.ts.map +1 -0
  270. package/lib/typescript/Wishlist.d.ts +59 -0
  271. package/lib/typescript/Wishlist.d.ts.map +1 -0
  272. package/lib/typescript/WishlistContext.d.ts +11 -0
  273. package/lib/typescript/WishlistContext.d.ts.map +1 -0
  274. package/lib/typescript/WishlistData.d.ts +20 -0
  275. package/lib/typescript/WishlistData.d.ts.map +1 -0
  276. package/lib/typescript/WishlistDataCopy.d.ts +25 -0
  277. package/lib/typescript/WishlistDataCopy.d.ts.map +1 -0
  278. package/lib/typescript/WishlistJsRuntime.android.d.ts +4 -0
  279. package/lib/typescript/WishlistJsRuntime.android.d.ts.map +1 -0
  280. package/lib/typescript/WishlistJsRuntime.d.ts +6 -0
  281. package/lib/typescript/WishlistJsRuntime.d.ts.map +1 -0
  282. package/lib/typescript/createTemplateComponent.d.ts +35 -0
  283. package/lib/typescript/createTemplateComponent.d.ts.map +1 -0
  284. package/lib/typescript/index.d.ts +8 -0
  285. package/lib/typescript/index.d.ts.map +1 -0
  286. package/lib/typescript/renderTemplate.d.ts +3 -0
  287. package/lib/typescript/renderTemplate.d.ts.map +1 -0
  288. package/package.json +195 -0
  289. package/src/Colors.ts +474 -0
  290. package/src/ComponentPool.ts +33 -0
  291. package/src/Components/ForEach.tsx +22 -0
  292. package/src/Components/ForEachBase.tsx +8 -0
  293. package/src/Components/IF.tsx +20 -0
  294. package/src/Components/Pressable.tsx +111 -0
  295. package/src/Components/Switch.tsx +49 -0
  296. package/src/Components/WishlistImage.tsx +25 -0
  297. package/src/Components/WishlistText.tsx +14 -0
  298. package/src/Components/WishlistView.tsx +4 -0
  299. package/src/EventHandler.ts +78 -0
  300. package/src/InflatorRepository.ts +231 -0
  301. package/src/OrchestratorBinding.ts +15 -0
  302. package/src/Specs/NativeContentContainer.ts +9 -0
  303. package/src/Specs/NativeTemplateContainer.ts +13 -0
  304. package/src/Specs/NativeTemplateInterceptor.ts +8 -0
  305. package/src/Specs/NativeWishlist.ts +42 -0
  306. package/src/Specs/NativeWishlistManager.ts +7 -0
  307. package/src/TemplateContext.tsx +14 -0
  308. package/src/TemplateItem.ts +15 -0
  309. package/src/TemplateValue.tsx +101 -0
  310. package/src/Utils.ts +15 -0
  311. package/src/Wishlist.tsx +417 -0
  312. package/src/WishlistContext.tsx +15 -0
  313. package/src/WishlistData.ts +179 -0
  314. package/src/WishlistDataCopy.ts +138 -0
  315. package/src/WishlistJsRuntime.android.ts +20 -0
  316. package/src/WishlistJsRuntime.ts +59 -0
  317. package/src/createTemplateComponent.tsx +263 -0
  318. package/src/global.d.ts +1 -0
  319. package/src/index.ts +17 -0
  320. package/src/renderTemplate.ts +22 -0
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Margelo GmbH
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
@@ -0,0 +1,40 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ # This package only supports the New Architecture.
6
+ # As of React Native 0.82+, the New Architecture is the default. We only fail
7
+ # if it was explicitly disabled.
8
+ if ENV["RCT_NEW_ARCH_ENABLED"] == "0"
9
+ raise "@leonsilicon/react-native-wishlist requires the New Architecture. " \
10
+ "Please remove RCT_NEW_ARCH_ENABLED=0 before running `pod install`."
11
+ end
12
+
13
+ Pod::Spec.new do |s|
14
+ s.name = "MGWishList"
15
+ s.version = package["version"]
16
+ s.summary = package["description"]
17
+ s.description = <<-DESC
18
+ The fastest List component for React Native.
19
+ DESC
20
+ s.homepage = "https://github.com/margelo/react-native-wishlist"
21
+ s.license = "MIT"
22
+ # s.license = { :type => "MIT", :file => "FILE_LICENSE" }
23
+ s.author = { "author" => "author@domain.cn" }
24
+ s.platforms = { :ios => min_ios_version_supported }
25
+ s.source = { :git => "https://github.com/margelo/react-native-wishlist.git", :tag => "#{s.version}" }
26
+
27
+ s.source_files = [
28
+ "ios/**/*.{mm,h,m,cpp,hpp}",
29
+ "cpp/**/*.{cpp,h,m,mm,hpp}",
30
+ ]
31
+
32
+ s.pod_target_xcconfig = {
33
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
34
+ "GCC_PREPROCESSOR_DEFINITIONS" => "$(inherited) RCT_NEW_ARCH_ENABLED=1",
35
+ }
36
+
37
+ install_modules_dependencies(s)
38
+ s.dependency 'react-native-worklets-core'
39
+ end
40
+
package/README.md ADDED
@@ -0,0 +1,281 @@
1
+ # @leonsilicon/react-native-wishlist
2
+
3
+ The fastest List component for React Native.
4
+
5
+
6
+ ```jsx
7
+ function ChatRoom({ room }) {
8
+ return (
9
+ <Wishlist.Component data={room.messages}>
10
+ <Wishlist.Template type="text-message">
11
+ <TextMessageCell />
12
+ </Wishlist.Template>
13
+ <Wishlist.Template type="image-message">
14
+ <ImageMessageCell />
15
+ </Wishlist.Template>
16
+ </Wishlist.Component>
17
+ )
18
+ }
19
+ ```
20
+
21
+ ## State of WishList
22
+
23
+ WishList is an archived, read-only repository, and should probably not be used in production. It's a good proof of concept, and a pretty impressive experiment. See [this Notion document](https://margelo.notion.site/WishList-Summit-b20c24d1f0da4889a0513dfa929be5ed?pvs=74) for more details.
24
+
25
+ ## Installation
26
+
27
+ ```sh
28
+ vp add @leonsilicon/react-native-wishlist
29
+ cd ios && pod install
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ # Documentation
35
+
36
+ WishList uses a **template-based** approach, which is fundamentally different than FlatList's approach.
37
+
38
+ In a chat app, you might want to have three templates:
39
+
40
+ * A chat message containing text
41
+ * A chat message containing an image
42
+ * A system message (e.g. "You have been removed from this group")
43
+
44
+ Each template is rendered once, and while the user scrolls in the list, the template cells are re-used ("_recycled_") by just moving them around and updating their content.
45
+
46
+ A chat cell has static properties and template values:
47
+
48
+ * Static property: The chat room name, the user name
49
+ * Template value: The chat message itself, the sender
50
+
51
+ ## The data
52
+
53
+ In a List, you usually want to render an array of data. Per each item in the array, you want to render one cell in the list.
54
+
55
+ Data for WishList has to have the following structure:
56
+
57
+ ```ts
58
+ type Item = {
59
+ type: string
60
+ key: string
61
+ }
62
+ ```
63
+
64
+ Where `type` is the predefined template you want to render, and `key` is a unique key to identify a cell.
65
+
66
+ For the chat app, this might look like this:
67
+
68
+ ```ts
69
+ type TextChatMessage = {
70
+ type: 'text-message'
71
+ key: string
72
+ sender: User
73
+ text: string
74
+ }
75
+ type ImageChatMessage = {
76
+ type: 'image-message'
77
+ key: string
78
+ sender: User
79
+ imageUrl: string
80
+ }
81
+ type SystemChatMessage = {
82
+ type: 'system-message'
83
+ key: string
84
+ text: string
85
+ }
86
+
87
+ type ChatMessage =
88
+ | TextChatMessage
89
+ | ImageChatMessage
90
+ | SystemChatMessage
91
+ type Data = ChatMessage[]
92
+ ```
93
+
94
+ WishList provides a `useData` hook to imperatively update the data synchronously, which is usefuly for loading data as you scroll.
95
+
96
+ ## The List
97
+
98
+ The list component itself is the parent of all content cells, and can be styled and configured to match your needs.
99
+
100
+ ```jsx
101
+ function ChatRoom({ room }) {
102
+ return (
103
+ <Wishlist.Component
104
+ style={styles.list}
105
+ initialIndex={room.messages.length - 1} // aka inverted
106
+ initialData={room.messages}
107
+ ref={ref}>
108
+ <Wishlist.Template type="text-message">
109
+ <TextMessageCell roomName={room.name} />
110
+ </Wishlist.Template>
111
+ <Wishlist.Template type="image-message">
112
+ <ImageMessageCell roomName={room.name} />
113
+ </Wishlist.Template>
114
+ <Wishlist.Template type="system-message">
115
+ <SystemMessageCell roomName={room.name} />
116
+ </Wishlist.Template>
117
+ </Wishlist.Component>
118
+ )
119
+ }
120
+ ```
121
+
122
+ ## The Cells
123
+
124
+ Because WishList uses cell recycling, a cell is only _rendered_ once. WishList then uses that render result of a cell (the **template**) to move it around and update the content of the template as the user scrolls.
125
+
126
+ This means, that the React component's render function (e.g. `<TextMessageCell>`) is only called once to build the template, and the content itself is then updated through a custom update pipeline.
127
+
128
+ The custom update pipeline is ran fully on the UI Thread using Worklets.
129
+
130
+ For example, in **FlatList** you would have the following cell:
131
+
132
+ ```jsx
133
+ function TextMessageCell(message: TextChatMessage) {
134
+ return (
135
+ <View style={styles.cell}>
136
+ <Text style={styles.username}>
137
+ {message.sender.username}
138
+ </Text>
139
+ </View>
140
+ )
141
+ }
142
+ ```
143
+
144
+ Where `message` is a template-value, and the Text's content (`message.sender.username`) is a derived template-value.
145
+
146
+ In FlatList, the cell's render function gets called every time, whereas in WishList it only gets called once for the template.
147
+
148
+ To build the same cell in WishList, you would write the following:
149
+
150
+ ```jsx
151
+ function TextMessageCell() {
152
+ const username = useTemplateValue<TextChatMessage>(message => message.sender.username)
153
+
154
+ return (
155
+ <View style={styles.cell}>
156
+ <WishList.Text style={styles.username}>
157
+ {username}
158
+ </WishList.Text>
159
+ </View>
160
+ )
161
+ }
162
+ ```
163
+
164
+ In this case, `username` is a Proxy that holds the JSI HostObject, which is synchronized across threads.
165
+
166
+ We need to use `<WishList.Text>` instead of `<Text>` so that the update pipeline is able to imperatively update it's content on the UI Thread.
167
+
168
+ ### Components
169
+
170
+ For template-values, you need to use components that are able to update content directly;
171
+
172
+ * `<WishList.View>` instead of `<View>`
173
+ * `<WishList.Text>` instead of `<Text>`
174
+ * `<WishList.Image>` instead of `<Image>`
175
+ * `<WishList.Pressable>` instead of `<Pressable>`
176
+
177
+ ### Conditionals
178
+
179
+ Since the React component is only rendered once, conditionals in the render tree won't work.
180
+
181
+ In **FlatList**, you might have an inline conditional:
182
+
183
+ ```jsx
184
+ function TextMessageCell(message) {
185
+ return (
186
+ <View style={styles.cell}>
187
+ {message.isSender && (<DeleteButton />)}
188
+
189
+ ...
190
+ </View>
191
+ )
192
+ }
193
+ ```
194
+
195
+ Wheras in **WishList** you'd have to use a template-value so it can update on the UI Thread without having to do a re-render:
196
+
197
+ ```jsx
198
+ function TextMessageCell() {
199
+ const isSender = useTemplateValue<TextChatMessage>(message => message.isSender)
200
+
201
+ return (
202
+ <View style={styles.cell}>
203
+ <WishList.If value={isSender}>
204
+ <DeleteButton />
205
+ </WishList.If>
206
+
207
+ ...
208
+ </View>
209
+ )
210
+ }
211
+ ```
212
+
213
+ WishList also provides `<WishList.Switch>` and `<WishList.Case>` for inline switch/cases.
214
+
215
+ ### Loops
216
+
217
+ As with conditionals, this also goes for loops - instead of a `{data.map((d) => ...)}`, you'd use `<WishList.ForEach>`.
218
+
219
+ ### Callbacks
220
+
221
+ Since we are running on the UI Thread, we need to hop Threads for callbacks.
222
+
223
+ In **FlatList**, an `onPress` callback might look like this:
224
+
225
+ ```jsx
226
+ function ChatRoom() {
227
+ const onChatPressed = useCallback((item: ChatItem) => {
228
+ console.log(`Pressed message #${item.key}!`)
229
+ }, [])
230
+
231
+ const onChatPressedCallback = createRunInJsFn(onChatPressed)
232
+
233
+ return (
234
+ <FlatList renderItem={renderItem} {...listProps} />
235
+ )
236
+ }
237
+
238
+ function ChatCell({ onChatPressed }) {
239
+ return (
240
+ <Pressable onPress={onChatPressed}>
241
+ ...
242
+ </Pressable>
243
+ )
244
+ }
245
+ ```
246
+
247
+ For **WishList**, the above code can be roughly translated to this:
248
+
249
+ ```jsx
250
+ function ChatRoom() {
251
+ const onChatPressed = useCallback((item: ChatItem) => {
252
+ console.log(`Pressed message #${item.key}!`)
253
+ }, [])
254
+
255
+ const onChatPressedCallback = createRunInJsFn(onChatPressed)
256
+
257
+ return (
258
+ <WishList.Component {...listProps}>
259
+ <WishList.Template type="text-message">
260
+ <ChatCell onChatPressed={onChatPressedCallback} />
261
+ </WishList.Template>
262
+ </WishList.Component>
263
+ )
264
+ }
265
+
266
+ function ChatCell({ onChatPressed }: ChatCellProps) {
267
+ return (
268
+ <WishList.Pressable onPress={onChatPressed}>
269
+ ...
270
+ </WishList.Pressable>
271
+ )
272
+ }
273
+ ```
274
+
275
+ ## Contributing
276
+
277
+ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
278
+
279
+ ## License
280
+
281
+ MIT
@@ -0,0 +1,86 @@
1
+ project(Wishlist)
2
+ cmake_minimum_required(VERSION 3.13)
3
+
4
+ set(CMAKE_VERBOSE_MAKEFILE ON)
5
+ set(CMAKE_CXX_STANDARD 20)
6
+
7
+ add_compile_options(
8
+ -Wall
9
+ -std=c++20
10
+ -Wno-deprecated-declarations
11
+ -Wno-deprecated-this-capture
12
+ -Wno-unused-parameter
13
+ -Wno-unused-variable
14
+ -Wno-unused-private-field
15
+ -Wno-unused-function
16
+ -Wno-unused-lambda-capture
17
+ -Wno-unused-but-set-variable
18
+ )
19
+
20
+ if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
21
+ string(APPEND CMAKE_CXX_FLAGS " -DDEBUG")
22
+ endif()
23
+
24
+ set(PACKAGE_NAME "react_codegen_wishlist")
25
+ set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
26
+ set(COMMON_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../cpp")
27
+ set(LIB_ANDROID_GENERATED_JNI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build/generated/source/codegen/jni)
28
+
29
+ file(GLOB_RECURSE SOURCES_COMMON CONFIGURE_DEPENDS "${COMMON_SRC_DIR}/**.cpp")
30
+ file(GLOB_RECURSE SOURCES_ANDROID CONFIGURE_DEPENDS "${SRC_DIR}/main/jni/**.cpp")
31
+ file(GLOB_RECURSE SOURCES_CODEGEN CONFIGURE_DEPENDS "${LIB_ANDROID_GENERATED_JNI_DIR}/**.cpp")
32
+
33
+ # Consume shared libraries and headers from prefabs
34
+ find_package(fbjni REQUIRED CONFIG)
35
+ find_package(ReactAndroid REQUIRED CONFIG)
36
+ find_package(react-native-worklets REQUIRED CONFIG)
37
+
38
+ add_library(
39
+ ${PACKAGE_NAME}
40
+ SHARED
41
+ ${SOURCES_COMMON}
42
+ ${SOURCES_ANDROID}
43
+ ${SOURCES_CODEGEN}
44
+ )
45
+
46
+ target_compile_definitions(
47
+ ${PACKAGE_NAME}
48
+ PRIVATE
49
+ RN_SERIALIZABLE_STATE
50
+ )
51
+
52
+ # includes
53
+ target_include_directories(
54
+ ${PACKAGE_NAME}
55
+ PUBLIC
56
+ "${SRC_DIR}/main/jni"
57
+ "${COMMON_SRC_DIR}/ContentContainer"
58
+ "${COMMON_SRC_DIR}/DataBinding"
59
+ "${COMMON_SRC_DIR}/DependencyInjection"
60
+ "${COMMON_SRC_DIR}/ItemProvider"
61
+ "${COMMON_SRC_DIR}/MGViewportCarer"
62
+ "${COMMON_SRC_DIR}/ReanimatedRuntime"
63
+ "${COMMON_SRC_DIR}/TemplateContainer"
64
+ "${COMMON_SRC_DIR}/UIScheduler"
65
+ "${COMMON_SRC_DIR}/Wishlist"
66
+ "${COMMON_SRC_DIR}"
67
+ "${LIB_ANDROID_GENERATED_JNI_DIR}"
68
+ "${REACT_ANDROID_DIR}/src/main/jni/react/turbomodule"
69
+ )
70
+
71
+ # build shared lib
72
+ set_target_properties(${PACKAGE_NAME} PROPERTIES LINKER_LANGUAGE CXX)
73
+
74
+ target_link_libraries(
75
+ ${PACKAGE_NAME}
76
+ log
77
+ android
78
+ )
79
+
80
+ target_link_libraries(
81
+ ${PACKAGE_NAME}
82
+ fbjni::fbjni
83
+ react-native-worklets::worklets
84
+ ReactAndroid::reactnative
85
+ ReactAndroid::jsi
86
+ )
@@ -0,0 +1,72 @@
1
+ buildscript {
2
+ def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["Wishlist_kotlinVersion"]
3
+
4
+ repositories {
5
+ mavenCentral()
6
+ google()
7
+ }
8
+
9
+ dependencies {
10
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
11
+ classpath("com.android.tools.build:gradle:8.7.2")
12
+ }
13
+ }
14
+
15
+ if (project == rootProject) {
16
+ return
17
+ }
18
+
19
+ def getExtOrDefault(name) {
20
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Wishlist_" + name]
21
+ }
22
+
23
+ def getExtOrIntegerDefault(name) {
24
+ return getExtOrDefault(name).toInteger()
25
+ }
26
+
27
+ apply plugin: "com.android.library"
28
+ apply plugin: "kotlin-android"
29
+ apply plugin: "com.facebook.react"
30
+
31
+ // This package only supports the New Architecture.
32
+ // As of React Native 0.82+, the New Architecture is the default. We only fail
33
+ // if it was explicitly disabled.
34
+ if (project.hasProperty("newArchEnabled") && project.newArchEnabled == "false") {
35
+ throw new GradleException(
36
+ "@leonsilicon/react-native-wishlist requires the New Architecture. " +
37
+ "Remove newArchEnabled=false from your android/gradle.properties."
38
+ )
39
+ }
40
+
41
+ android {
42
+ namespace "com.wishlist"
43
+ compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
44
+ ndkVersion getExtOrDefault("ndkVersion")
45
+
46
+ defaultConfig {
47
+ minSdkVersion getExtOrIntegerDefault("minSdkVersion")
48
+ targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
49
+ }
50
+
51
+ compileOptions {
52
+ sourceCompatibility JavaVersion.VERSION_17
53
+ targetCompatibility JavaVersion.VERSION_17
54
+ }
55
+
56
+ kotlinOptions {
57
+ jvmTarget = "17"
58
+ }
59
+
60
+ buildFeatures {
61
+ prefab true
62
+ }
63
+ }
64
+
65
+ def kotlin_version = getExtOrDefault("kotlinVersion")
66
+
67
+
68
+ dependencies {
69
+ implementation "com.facebook.react:react-android"
70
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
71
+ implementation project(":react-native-worklets")
72
+ }
@@ -0,0 +1,5 @@
1
+ Wishlist_kotlinVersion=2.1.20
2
+ Wishlist_minSdkVersion=24
3
+ Wishlist_targetSdkVersion=36
4
+ Wishlist_compileSdkVersion=36
5
+ Wishlist_ndkVersion=27.1.12297006
@@ -0,0 +1,24 @@
1
+ apply plugin: 'com.diffplug.spotless'
2
+
3
+ allprojects {
4
+ repositories {
5
+ google()
6
+ mavenCentral()
7
+ }
8
+ }
9
+
10
+ spotless {
11
+ java {
12
+ target 'src/**/*.java'
13
+ googleJavaFormat()
14
+ }
15
+ kotlin {
16
+ target 'src/**/*.kt'
17
+ ktfmt()
18
+ }
19
+ groovyGradle {
20
+ target '*.gradle'
21
+ greclipse()
22
+ indentWithSpaces(4)
23
+ }
24
+ }
@@ -0,0 +1,4 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.wishlist">
3
+
4
+ </manifest>
@@ -0,0 +1,22 @@
1
+ package com.wishlist
2
+
3
+ import com.facebook.react.module.annotations.ReactModule
4
+ import com.facebook.react.uimanager.ThemedReactContext
5
+ import com.facebook.react.uimanager.ViewGroupManager
6
+ import com.facebook.react.viewmanagers.MGContentContainerManagerDelegate
7
+ import com.facebook.react.viewmanagers.MGContentContainerManagerInterface
8
+ import com.facebook.react.views.view.ReactViewGroup
9
+
10
+ @ReactModule(name = ContentContainerViewManager.REACT_CLASS)
11
+ class ContentContainerViewManager :
12
+ ViewGroupManager<ReactViewGroup>(), MGContentContainerManagerInterface<ReactViewGroup> {
13
+ companion object {
14
+ const val REACT_CLASS = "MGContentContainer"
15
+ }
16
+
17
+ override fun getName() = REACT_CLASS
18
+
19
+ override fun createViewInstance(reactContext: ThemedReactContext) = ReactViewGroup(reactContext)
20
+
21
+ override fun getDelegate() = MGContentContainerManagerDelegate(this)
22
+ }
@@ -0,0 +1,38 @@
1
+ package com.wishlist
2
+
3
+ import com.facebook.jni.HybridData
4
+ import com.facebook.proguard.annotations.DoNotStrip
5
+ import com.facebook.react.uimanager.PixelUtil
6
+
7
+ class Orchestrator(private val mWishlist: Wishlist, wishlistId: String, viewportCarerRef: Int) {
8
+ companion object {
9
+ init {
10
+ WishlistSoLoader.staticInit()
11
+ }
12
+ }
13
+
14
+ @field:DoNotStrip private val mHybridData = initHybrid(wishlistId, viewportCarerRef)
15
+
16
+ private external fun initHybrid(wishlistId: String, viewportCarerRef: Int): HybridData
17
+
18
+ external fun renderAsync(
19
+ width: Float,
20
+ height: Float,
21
+ initialContentSize: Float,
22
+ originItem: Int,
23
+ templatesRef: Int,
24
+ names: List<String>,
25
+ inflatorId: String
26
+ )
27
+
28
+ external fun didScrollAsync(width: Float, height: Float, contentOffset: Float, inflatorId: String)
29
+
30
+ external fun scrollToItem(index: Int)
31
+
32
+ external fun didUpdateContentOffset()
33
+
34
+ @DoNotStrip
35
+ private fun scrollToOffset(offset: Float, animated: Boolean) {
36
+ mWishlist.reactSmoothScrollTo(0, PixelUtil.toPixelFromDIP(offset).toInt())
37
+ }
38
+ }
@@ -0,0 +1,30 @@
1
+ package com.wishlist
2
+
3
+ import android.content.Context
4
+ import com.facebook.react.uimanager.StateWrapper
5
+ import com.facebook.react.views.view.ReactViewGroup
6
+
7
+ private const val TEMPLATES_KEY = 1
8
+
9
+ class TemplateContainer(reactContext: Context) : ReactViewGroup(reactContext) {
10
+ var inflatorId: String? = null
11
+ var wishlistId: String? = null
12
+ var names: List<String>? = null
13
+ var stateWrapper: StateWrapper? = null
14
+ var wishlist: Wishlist? = null
15
+ set(value) {
16
+ field = value
17
+ updateWishlist()
18
+ }
19
+
20
+ fun updateWishlist() {
21
+ wishlist?.let {
22
+ it.wishlistId = wishlistId
23
+ it.inflatorId = inflatorId
24
+ val templatesRef = stateWrapper?.stateDataMapBuffer?.getInt(TEMPLATES_KEY)
25
+ if (templatesRef != null) {
26
+ it.setTemplates(templatesRef, names ?: listOf())
27
+ }
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,65 @@
1
+ package com.wishlist
2
+
3
+ import com.facebook.react.module.annotations.ReactModule
4
+ import com.facebook.react.uimanager.ReactStylesDiffMap
5
+ import com.facebook.react.uimanager.StateWrapper
6
+ import com.facebook.react.uimanager.ThemedReactContext
7
+ import com.facebook.react.uimanager.ViewGroupManager
8
+ import com.facebook.react.uimanager.annotations.ReactProp
9
+ import com.facebook.react.viewmanagers.MGTemplateContainerManagerDelegate
10
+ import com.facebook.react.viewmanagers.MGTemplateContainerManagerInterface
11
+ import org.json.JSONArray
12
+
13
+ @ReactModule(name = TemplateContainerViewManager.REACT_CLASS)
14
+ class TemplateContainerViewManager :
15
+ ViewGroupManager<TemplateContainer>(), MGTemplateContainerManagerInterface<TemplateContainer> {
16
+ companion object {
17
+ const val REACT_CLASS = "MGTemplateContainer"
18
+ }
19
+
20
+ override fun getName() = REACT_CLASS
21
+
22
+ override fun createViewInstance(reactContext: ThemedReactContext) =
23
+ TemplateContainer(reactContext)
24
+
25
+ override fun getDelegate() = MGTemplateContainerManagerDelegate(this)
26
+
27
+ override fun updateState(
28
+ view: TemplateContainer,
29
+ props: ReactStylesDiffMap?,
30
+ stateWrapper: StateWrapper?
31
+ ): Any? {
32
+ view.stateWrapper = stateWrapper
33
+ view.updateWishlist()
34
+ return null
35
+ }
36
+
37
+ override fun onAfterUpdateTransaction(view: TemplateContainer) {
38
+ super.onAfterUpdateTransaction(view)
39
+ view.updateWishlist()
40
+ }
41
+
42
+ @ReactProp(name = "inflatorId")
43
+ override fun setInflatorId(view: TemplateContainer, value: String?) {
44
+ view.inflatorId = value
45
+ }
46
+
47
+ @ReactProp(name = "wishlistId")
48
+ override fun setWishlistId(view: TemplateContainer, value: String?) {
49
+ view.wishlistId = value
50
+ }
51
+
52
+ @ReactProp(name = "names")
53
+ override fun setNames(view: TemplateContainer, value: String?) {
54
+ if (value != null) {
55
+ val namesJson = JSONArray(value)
56
+ val names = ArrayList<String>(namesJson.length())
57
+ for (i in 0 until namesJson.length()) {
58
+ names.add(namesJson.getString(i))
59
+ }
60
+ view.names = names
61
+ } else {
62
+ view.names = null
63
+ }
64
+ }
65
+ }