@react-native-ohos/react-native-keyboard-controller 1.17.0-beta.2 → 1.17.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 (408) hide show
  1. package/LICENSE +21 -21
  2. package/README.OpenSource +11 -11
  3. package/README.md +686 -19
  4. package/harmony/keyboard_controller/BuildProfile.ets +16 -16
  5. package/harmony/keyboard_controller/Index.ets +29 -28
  6. package/harmony/keyboard_controller/build-profile.json5 +31 -31
  7. package/harmony/keyboard_controller/hvigorfile.ts +6 -6
  8. package/harmony/keyboard_controller/obfuscation-rules.txt +17 -17
  9. package/harmony/keyboard_controller/oh-package-lock.json5 +28 -18
  10. package/harmony/keyboard_controller/oh-package.json5 +10 -10
  11. package/harmony/keyboard_controller/src/main/cpp/CMakeLists.txt +7 -7
  12. package/harmony/keyboard_controller/src/main/cpp/ClippingScrollViewComponentDescriptor.h +86 -0
  13. package/harmony/keyboard_controller/src/main/cpp/ClippingScrollViewComponentInstance.cpp +104 -0
  14. package/harmony/keyboard_controller/src/main/cpp/ClippingScrollViewComponentInstance.h +64 -0
  15. package/harmony/keyboard_controller/src/main/cpp/ClippingScrollViewJSIBinder.h +60 -0
  16. package/harmony/keyboard_controller/src/main/cpp/EventEmitters.cpp +119 -96
  17. package/harmony/keyboard_controller/src/main/cpp/EventEmitters.h +111 -111
  18. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentDescriptor.h +94 -94
  19. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.cpp +840 -288
  20. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.h +169 -103
  21. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewJSIBinder.h +65 -65
  22. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentDescriptor.h +79 -79
  23. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.cpp +108 -108
  24. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.h +83 -83
  25. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaJSIBinder.h +60 -60
  26. package/harmony/keyboard_controller/src/main/cpp/KeyboardToolbarGroupViewComponentDescriptor.h +46 -0
  27. package/harmony/keyboard_controller/src/main/cpp/KeyboardToolbarGroupViewComponentInstance.cpp +37 -0
  28. package/harmony/keyboard_controller/src/main/cpp/KeyboardToolbarGroupViewComponentInstance.h +32 -0
  29. package/harmony/keyboard_controller/src/main/cpp/KeyboardToolbarGroupViewJSIBinder.h +23 -0
  30. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.cpp +103 -46
  31. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.h +48 -48
  32. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardControllerPackage.h +20 -0
  33. package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.cpp +45 -45
  34. package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.h +49 -49
  35. package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.cpp +207 -186
  36. package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.h +131 -112
  37. package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.cpp +77 -64
  38. package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.h +85 -77
  39. package/harmony/keyboard_controller/src/main/ets/Logger.ts +66 -66
  40. package/harmony/keyboard_controller/src/main/ets/{RNKeyboardControllerPackage.ts → RNKeyboardControllerPackage.ets} +70 -66
  41. package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerTurboModule.ts +465 -273
  42. package/harmony/keyboard_controller/src/main/ets/RNStatusBarManagerCompatTurboModule.ts +128 -119
  43. package/harmony/keyboard_controller/src/main/ets/Type.ts +63 -62
  44. package/harmony/keyboard_controller/src/main/module.json5 +11 -11
  45. package/harmony/keyboard_controller/src/main/resources/base/element/string.json +8 -8
  46. package/harmony/keyboard_controller/src/main/resources/en_US/element/string.json +8 -8
  47. package/harmony/keyboard_controller/src/main/resources/zh_CN/element/string.json +8 -8
  48. package/harmony/keyboard_controller/{ts.ts → ts.ets} +29 -29
  49. package/harmony/keyboard_controller.har +0 -0
  50. package/lib/commonjs/animated.js +22 -11
  51. package/lib/commonjs/animated.js.map +1 -1
  52. package/lib/commonjs/architecture.js +8 -0
  53. package/lib/commonjs/architecture.js.map +1 -0
  54. package/lib/commonjs/bindings.js +40 -5
  55. package/lib/commonjs/bindings.js.map +1 -1
  56. package/lib/commonjs/bindings.native.js +28 -5
  57. package/lib/commonjs/bindings.native.js.map +1 -1
  58. package/lib/commonjs/compat.js +50 -0
  59. package/lib/commonjs/compat.js.map +1 -0
  60. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js +21 -15
  61. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js.map +1 -1
  62. package/lib/commonjs/components/KeyboardAvoidingView/index.js +39 -14
  63. package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
  64. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +94 -57
  65. package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
  66. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +5 -5
  67. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
  68. package/lib/commonjs/components/KeyboardAwareScrollView/utils.js.map +1 -1
  69. package/lib/commonjs/components/KeyboardChatScrollView/hooks.js +13 -0
  70. package/lib/commonjs/components/KeyboardChatScrollView/hooks.js.map +1 -0
  71. package/lib/commonjs/components/KeyboardChatScrollView/index.js +122 -0
  72. package/lib/commonjs/components/KeyboardChatScrollView/index.js.map +1 -0
  73. package/lib/commonjs/components/KeyboardChatScrollView/types.js +6 -0
  74. package/lib/commonjs/components/KeyboardChatScrollView/types.js.map +1 -0
  75. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/helpers.js +221 -0
  76. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/helpers.js.map +1 -0
  77. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js +149 -0
  78. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js.map +1 -0
  79. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.js +240 -0
  80. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.js.map +1 -0
  81. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/types.js +6 -0
  82. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/types.js.map +1 -0
  83. package/lib/commonjs/components/KeyboardChatScrollView/useEndVisible.js +40 -0
  84. package/lib/commonjs/components/KeyboardChatScrollView/useEndVisible.js.map +1 -0
  85. package/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js +92 -0
  86. package/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js.map +1 -0
  87. package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -1
  88. package/lib/commonjs/components/KeyboardToolbar/Arrow.js +2 -3
  89. package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -1
  90. package/lib/commonjs/components/KeyboardToolbar/Button.js +2 -3
  91. package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -1
  92. package/lib/commonjs/components/KeyboardToolbar/colors.js.map +1 -1
  93. package/lib/commonjs/components/KeyboardToolbar/colors.native.js.map +1 -1
  94. package/lib/commonjs/components/KeyboardToolbar/compound/components/Background.js +13 -0
  95. package/lib/commonjs/components/KeyboardToolbar/compound/components/Background.js.map +1 -0
  96. package/lib/commonjs/components/KeyboardToolbar/compound/components/Content.js +25 -0
  97. package/lib/commonjs/components/KeyboardToolbar/compound/components/Content.js.map +1 -0
  98. package/lib/commonjs/components/KeyboardToolbar/compound/components/Done.js +58 -0
  99. package/lib/commonjs/components/KeyboardToolbar/compound/components/Done.js.map +1 -0
  100. package/lib/commonjs/components/KeyboardToolbar/compound/components/Next.js +49 -0
  101. package/lib/commonjs/components/KeyboardToolbar/compound/components/Next.js.map +1 -0
  102. package/lib/commonjs/components/KeyboardToolbar/compound/components/Prev.js +49 -0
  103. package/lib/commonjs/components/KeyboardToolbar/compound/components/Prev.js.map +1 -0
  104. package/lib/commonjs/components/KeyboardToolbar/compound/components/index.js +42 -0
  105. package/lib/commonjs/components/KeyboardToolbar/compound/components/index.js.map +1 -0
  106. package/lib/commonjs/components/KeyboardToolbar/compound/components/types.js +6 -0
  107. package/lib/commonjs/components/KeyboardToolbar/compound/components/types.js.map +1 -0
  108. package/lib/commonjs/components/KeyboardToolbar/compound/context.js +17 -0
  109. package/lib/commonjs/components/KeyboardToolbar/compound/context.js.map +1 -0
  110. package/lib/commonjs/components/KeyboardToolbar/constants.js +17 -0
  111. package/lib/commonjs/components/KeyboardToolbar/constants.js.map +1 -0
  112. package/lib/commonjs/components/KeyboardToolbar/index.js +98 -87
  113. package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
  114. package/lib/commonjs/components/KeyboardToolbar/types.js.map +1 -1
  115. package/lib/commonjs/components/ScrollViewWithBottomPadding/index.js +120 -0
  116. package/lib/commonjs/components/ScrollViewWithBottomPadding/index.js.map +1 -0
  117. package/lib/commonjs/components/ScrollViewWithBottomPadding/styles.js +15 -0
  118. package/lib/commonjs/components/ScrollViewWithBottomPadding/styles.js.map +1 -0
  119. package/lib/commonjs/components/hooks/useColorScheme.js.map +1 -1
  120. package/lib/commonjs/components/hooks/useCombinedRef.js +24 -0
  121. package/lib/commonjs/components/hooks/useCombinedRef.js.map +1 -0
  122. package/lib/commonjs/components/hooks/useScrollState.js +62 -0
  123. package/lib/commonjs/components/hooks/useScrollState.js.map +1 -0
  124. package/lib/commonjs/components/index.js +7 -0
  125. package/lib/commonjs/components/index.js.map +1 -1
  126. package/lib/commonjs/constants.js +3 -1
  127. package/lib/commonjs/constants.js.map +1 -1
  128. package/lib/commonjs/context.js +1 -0
  129. package/lib/commonjs/context.js.map +1 -1
  130. package/lib/commonjs/hooks/index.js +14 -1
  131. package/lib/commonjs/hooks/index.js.map +1 -1
  132. package/lib/commonjs/hooks/useKeyboardState/index.js +39 -0
  133. package/lib/commonjs/hooks/useKeyboardState/index.js.map +1 -0
  134. package/lib/commonjs/hooks/useWindowDimensions/index.android.js.map +1 -1
  135. package/lib/commonjs/hooks/useWindowDimensions/index.js.map +1 -1
  136. package/lib/commonjs/index.js +27 -1
  137. package/lib/commonjs/index.js.map +1 -1
  138. package/lib/commonjs/internal.js +54 -18
  139. package/lib/commonjs/internal.js.map +1 -1
  140. package/lib/commonjs/module.js +21 -12
  141. package/lib/commonjs/module.js.map +1 -1
  142. package/lib/commonjs/reanimated.js.map +1 -1
  143. package/lib/commonjs/reanimated.native.js.map +1 -1
  144. package/lib/commonjs/specs/ClippingScrollViewDecoratorViewNativeComponent.js +12 -0
  145. package/lib/commonjs/specs/ClippingScrollViewDecoratorViewNativeComponent.js.map +1 -0
  146. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js +8 -2
  147. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  148. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js +2 -1
  149. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  150. package/lib/commonjs/specs/KeyboardToolbarGroupViewNativeComponent.js +12 -0
  151. package/lib/commonjs/specs/KeyboardToolbarGroupViewNativeComponent.js.map +1 -0
  152. package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
  153. package/lib/commonjs/specs/NativeStatusBarManagerCompat.js.map +1 -1
  154. package/lib/commonjs/specs/OverKeyboardViewNativeComponent.js.map +1 -1
  155. package/lib/commonjs/types.js.map +1 -1
  156. package/lib/commonjs/utils/findNodeHandle/index.js +9 -0
  157. package/lib/commonjs/utils/findNodeHandle/index.js.map +1 -0
  158. package/lib/commonjs/utils/findNodeHandle/index.native.js +13 -0
  159. package/lib/commonjs/utils/findNodeHandle/index.native.js.map +1 -0
  160. package/lib/commonjs/utils.js.map +1 -1
  161. package/lib/commonjs/views/KeyboardExtender/index.js +30 -0
  162. package/lib/commonjs/views/KeyboardExtender/index.js.map +1 -0
  163. package/lib/commonjs/views/OverKeyboardView/index.js.map +1 -1
  164. package/lib/commonjs/views/index.js +7 -0
  165. package/lib/commonjs/views/index.js.map +1 -1
  166. package/lib/module/animated.js +24 -13
  167. package/lib/module/animated.js.map +1 -1
  168. package/lib/module/architecture.js +2 -0
  169. package/lib/module/architecture.js.map +1 -0
  170. package/lib/module/bindings.js +39 -5
  171. package/lib/module/bindings.js.map +1 -1
  172. package/lib/module/bindings.native.js +27 -5
  173. package/lib/module/bindings.native.js.map +1 -1
  174. package/lib/module/compat.js +43 -0
  175. package/lib/module/compat.js.map +1 -0
  176. package/lib/module/components/KeyboardAvoidingView/hooks.js +22 -16
  177. package/lib/module/components/KeyboardAvoidingView/hooks.js.map +1 -1
  178. package/lib/module/components/KeyboardAvoidingView/index.js +38 -14
  179. package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
  180. package/lib/module/components/KeyboardAwareScrollView/index.js +97 -60
  181. package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
  182. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +5 -5
  183. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
  184. package/lib/module/components/KeyboardAwareScrollView/utils.js.map +1 -1
  185. package/lib/module/components/KeyboardChatScrollView/hooks.js +2 -0
  186. package/lib/module/components/KeyboardChatScrollView/hooks.js.map +1 -0
  187. package/lib/module/components/KeyboardChatScrollView/index.js +115 -0
  188. package/lib/module/components/KeyboardChatScrollView/index.js.map +1 -0
  189. package/lib/module/components/KeyboardChatScrollView/types.js +2 -0
  190. package/lib/module/components/KeyboardChatScrollView/types.js.map +1 -0
  191. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/helpers.js +207 -0
  192. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/helpers.js.map +1 -0
  193. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js +143 -0
  194. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js.map +1 -0
  195. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.js +234 -0
  196. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.js.map +1 -0
  197. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/types.js +2 -0
  198. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/types.js.map +1 -0
  199. package/lib/module/components/KeyboardChatScrollView/useEndVisible.js +33 -0
  200. package/lib/module/components/KeyboardChatScrollView/useEndVisible.js.map +1 -0
  201. package/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js +87 -0
  202. package/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js.map +1 -0
  203. package/lib/module/components/KeyboardStickyView/index.js.map +1 -1
  204. package/lib/module/components/KeyboardToolbar/Arrow.js +2 -2
  205. package/lib/module/components/KeyboardToolbar/Arrow.js.map +1 -1
  206. package/lib/module/components/KeyboardToolbar/Button.js +2 -2
  207. package/lib/module/components/KeyboardToolbar/Button.js.map +1 -1
  208. package/lib/module/components/KeyboardToolbar/colors.js.map +1 -1
  209. package/lib/module/components/KeyboardToolbar/colors.native.js.map +1 -1
  210. package/lib/module/components/KeyboardToolbar/compound/components/Background.js +6 -0
  211. package/lib/module/components/KeyboardToolbar/compound/components/Background.js.map +1 -0
  212. package/lib/module/components/KeyboardToolbar/compound/components/Content.js +18 -0
  213. package/lib/module/components/KeyboardToolbar/compound/components/Content.js.map +1 -0
  214. package/lib/module/components/KeyboardToolbar/compound/components/Done.js +50 -0
  215. package/lib/module/components/KeyboardToolbar/compound/components/Done.js.map +1 -0
  216. package/lib/module/components/KeyboardToolbar/compound/components/Next.js +41 -0
  217. package/lib/module/components/KeyboardToolbar/compound/components/Next.js.map +1 -0
  218. package/lib/module/components/KeyboardToolbar/compound/components/Prev.js +41 -0
  219. package/lib/module/components/KeyboardToolbar/compound/components/Prev.js.map +1 -0
  220. package/lib/module/components/KeyboardToolbar/compound/components/index.js +6 -0
  221. package/lib/module/components/KeyboardToolbar/compound/components/index.js.map +1 -0
  222. package/lib/module/components/KeyboardToolbar/compound/components/types.js +2 -0
  223. package/lib/module/components/KeyboardToolbar/compound/components/types.js.map +1 -0
  224. package/lib/module/components/KeyboardToolbar/compound/context.js +10 -0
  225. package/lib/module/components/KeyboardToolbar/compound/context.js.map +1 -0
  226. package/lib/module/components/KeyboardToolbar/constants.js +11 -0
  227. package/lib/module/components/KeyboardToolbar/constants.js.map +1 -0
  228. package/lib/module/components/KeyboardToolbar/index.js +98 -88
  229. package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
  230. package/lib/module/components/KeyboardToolbar/types.js.map +1 -1
  231. package/lib/module/components/ScrollViewWithBottomPadding/index.js +112 -0
  232. package/lib/module/components/ScrollViewWithBottomPadding/index.js.map +1 -0
  233. package/lib/module/components/ScrollViewWithBottomPadding/styles.js +9 -0
  234. package/lib/module/components/ScrollViewWithBottomPadding/styles.js.map +1 -0
  235. package/lib/module/components/hooks/useColorScheme.js.map +1 -1
  236. package/lib/module/components/hooks/useCombinedRef.js +18 -0
  237. package/lib/module/components/hooks/useCombinedRef.js.map +1 -0
  238. package/lib/module/components/hooks/useScrollState.js +56 -0
  239. package/lib/module/components/hooks/useScrollState.js.map +1 -0
  240. package/lib/module/components/index.js +1 -0
  241. package/lib/module/components/index.js.map +1 -1
  242. package/lib/module/constants.js +3 -0
  243. package/lib/module/constants.js.map +1 -1
  244. package/lib/module/context.js +1 -0
  245. package/lib/module/context.js.map +1 -1
  246. package/lib/module/hooks/index.js +3 -1
  247. package/lib/module/hooks/index.js.map +1 -1
  248. package/lib/module/hooks/useKeyboardState/index.js +33 -0
  249. package/lib/module/hooks/useKeyboardState/index.js.map +1 -0
  250. package/lib/module/hooks/useWindowDimensions/index.android.js.map +1 -1
  251. package/lib/module/hooks/useWindowDimensions/index.js.map +1 -1
  252. package/lib/module/index.js +3 -2
  253. package/lib/module/index.js.map +1 -1
  254. package/lib/module/internal.js +53 -18
  255. package/lib/module/internal.js.map +1 -1
  256. package/lib/module/module.js +21 -12
  257. package/lib/module/module.js.map +1 -1
  258. package/lib/module/reanimated.js.map +1 -1
  259. package/lib/module/reanimated.native.js.map +1 -1
  260. package/lib/module/specs/ClippingScrollViewDecoratorViewNativeComponent.js +6 -0
  261. package/lib/module/specs/ClippingScrollViewDecoratorViewNativeComponent.js.map +1 -0
  262. package/lib/module/specs/KeyboardControllerViewNativeComponent.js +7 -1
  263. package/lib/module/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  264. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js +2 -1
  265. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  266. package/lib/module/specs/KeyboardToolbarGroupViewNativeComponent.js +5 -0
  267. package/lib/module/specs/KeyboardToolbarGroupViewNativeComponent.js.map +1 -0
  268. package/lib/module/specs/NativeKeyboardController.js.map +1 -1
  269. package/lib/module/specs/NativeStatusBarManagerCompat.js.map +1 -1
  270. package/lib/module/specs/OverKeyboardViewNativeComponent.js.map +1 -1
  271. package/lib/module/types.js.map +1 -1
  272. package/lib/module/utils/findNodeHandle/index.js +2 -0
  273. package/lib/module/utils/findNodeHandle/index.js.map +1 -0
  274. package/lib/module/utils/findNodeHandle/index.native.js +3 -0
  275. package/lib/module/utils/findNodeHandle/index.native.js.map +1 -0
  276. package/lib/module/utils.js.map +1 -1
  277. package/lib/module/views/KeyboardExtender/index.js +23 -0
  278. package/lib/module/views/KeyboardExtender/index.js.map +1 -0
  279. package/lib/module/views/OverKeyboardView/index.js.map +1 -1
  280. package/lib/module/views/index.js +1 -0
  281. package/lib/module/views/index.js.map +1 -1
  282. package/lib/typescript/animated.d.ts +2 -38
  283. package/lib/typescript/architecture.d.ts +1 -0
  284. package/lib/typescript/bindings.d.ts +15 -1
  285. package/lib/typescript/bindings.native.d.ts +10 -1
  286. package/lib/typescript/compat.d.ts +12 -0
  287. package/lib/typescript/components/KeyboardAvoidingView/index.d.ts +5 -0
  288. package/lib/typescript/components/KeyboardAwareScrollView/index.d.ts +4 -1
  289. package/lib/typescript/components/KeyboardChatScrollView/hooks.d.ts +2 -0
  290. package/lib/typescript/components/KeyboardChatScrollView/index.d.ts +17 -0
  291. package/lib/typescript/components/KeyboardChatScrollView/types.d.ts +113 -0
  292. package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/helpers.d.ts +132 -0
  293. package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/index.d.ts +18 -0
  294. package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/index.ios.d.ts +21 -0
  295. package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/types.d.ts +37 -0
  296. package/lib/typescript/components/KeyboardChatScrollView/useEndVisible.d.ts +17 -0
  297. package/lib/typescript/components/KeyboardChatScrollView/useExtraContentPadding/index.d.ts +45 -0
  298. package/lib/typescript/components/KeyboardToolbar/Button.d.ts +2 -2
  299. package/lib/typescript/components/KeyboardToolbar/compound/components/Background.d.ts +6 -0
  300. package/lib/typescript/components/KeyboardToolbar/compound/components/Content.d.ts +7 -0
  301. package/lib/typescript/components/KeyboardToolbar/compound/components/Done.d.ts +7 -0
  302. package/lib/typescript/components/KeyboardToolbar/compound/components/Next.d.ts +4 -0
  303. package/lib/typescript/components/KeyboardToolbar/compound/components/Prev.d.ts +4 -0
  304. package/lib/typescript/components/KeyboardToolbar/compound/components/index.d.ts +5 -0
  305. package/lib/typescript/components/KeyboardToolbar/compound/components/types.d.ts +14 -0
  306. package/lib/typescript/components/KeyboardToolbar/compound/context.d.ts +9 -0
  307. package/lib/typescript/components/KeyboardToolbar/constants.d.ts +10 -0
  308. package/lib/typescript/components/KeyboardToolbar/index.d.ts +12 -45
  309. package/lib/typescript/components/KeyboardToolbar/types.d.ts +24 -1
  310. package/lib/typescript/components/ScrollViewWithBottomPadding/index.d.ts +30 -0
  311. package/lib/typescript/components/ScrollViewWithBottomPadding/styles.d.ts +7 -0
  312. package/lib/typescript/components/hooks/useCombinedRef.d.ts +3 -0
  313. package/lib/typescript/components/hooks/useScrollState.d.ts +17 -0
  314. package/lib/typescript/components/index.d.ts +3 -0
  315. package/lib/typescript/constants.d.ts +1 -0
  316. package/lib/typescript/context.d.ts +1 -0
  317. package/lib/typescript/hooks/index.d.ts +2 -0
  318. package/lib/typescript/hooks/useKeyboardState/index.d.ts +4 -0
  319. package/lib/typescript/index.d.ts +4 -3
  320. package/lib/typescript/internal.d.ts +4 -0
  321. package/lib/typescript/specs/ClippingScrollViewDecoratorViewNativeComponent.d.ts +10 -0
  322. package/lib/typescript/specs/KeyboardControllerViewNativeComponent.d.ts +4 -0
  323. package/lib/typescript/specs/KeyboardToolbarGroupViewNativeComponent.d.ts +6 -0
  324. package/lib/typescript/specs/NativeKeyboardController.d.ts +6 -2
  325. package/lib/typescript/types.d.ts +81 -5
  326. package/lib/typescript/utils/findNodeHandle/index.d.ts +4 -0
  327. package/lib/typescript/utils/findNodeHandle/index.native.d.ts +2 -0
  328. package/lib/typescript/views/KeyboardExtender/index.d.ts +5 -0
  329. package/lib/typescript/views/index.d.ts +1 -0
  330. package/package.json +183 -174
  331. package/src/animated.tsx +248 -255
  332. package/src/architecture.ts +1 -0
  333. package/src/bindings.native.ts +97 -62
  334. package/src/bindings.ts +81 -42
  335. package/src/compat.ts +44 -0
  336. package/src/components/KeyboardAvoidingView/hooks.ts +130 -123
  337. package/src/components/KeyboardAvoidingView/index.tsx +232 -188
  338. package/src/components/KeyboardAwareScrollView/index.tsx +452 -389
  339. package/src/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +133 -133
  340. package/src/components/KeyboardAwareScrollView/utils.ts +41 -41
  341. package/src/components/KeyboardChatScrollView/hooks.ts +2 -0
  342. package/src/components/KeyboardChatScrollView/index.tsx +164 -0
  343. package/src/components/KeyboardChatScrollView/types.ts +117 -0
  344. package/src/components/KeyboardChatScrollView/useChatKeyboard/helpers.ts +268 -0
  345. package/src/components/KeyboardChatScrollView/useChatKeyboard/index.ios.ts +260 -0
  346. package/src/components/KeyboardChatScrollView/useChatKeyboard/index.ts +374 -0
  347. package/src/components/KeyboardChatScrollView/useChatKeyboard/types.ts +39 -0
  348. package/src/components/KeyboardChatScrollView/useEndVisible.ts +66 -0
  349. package/src/components/KeyboardChatScrollView/useExtraContentPadding/index.ts +149 -0
  350. package/src/components/KeyboardStickyView/index.tsx +66 -66
  351. package/src/components/KeyboardToolbar/Arrow.tsx +80 -80
  352. package/src/components/KeyboardToolbar/Button.tsx +98 -98
  353. package/src/components/KeyboardToolbar/colors.native.ts +37 -37
  354. package/src/components/KeyboardToolbar/colors.ts +16 -16
  355. package/src/components/KeyboardToolbar/compound/components/Background.tsx +9 -0
  356. package/src/components/KeyboardToolbar/compound/components/Content.tsx +25 -0
  357. package/src/components/KeyboardToolbar/compound/components/Done.tsx +57 -0
  358. package/src/components/KeyboardToolbar/compound/components/Next.tsx +49 -0
  359. package/src/components/KeyboardToolbar/compound/components/Prev.tsx +49 -0
  360. package/src/components/KeyboardToolbar/compound/components/index.ts +5 -0
  361. package/src/components/KeyboardToolbar/compound/components/types.ts +15 -0
  362. package/src/components/KeyboardToolbar/compound/context.ts +25 -0
  363. package/src/components/KeyboardToolbar/constants.ts +14 -0
  364. package/src/components/KeyboardToolbar/index.tsx +220 -223
  365. package/src/components/KeyboardToolbar/types.ts +72 -40
  366. package/src/components/ScrollViewWithBottomPadding/index.tsx +216 -0
  367. package/src/components/ScrollViewWithBottomPadding/styles.ts +10 -0
  368. package/src/components/hooks/useColorScheme.ts +6 -6
  369. package/src/components/hooks/useCombinedRef.ts +22 -0
  370. package/src/components/hooks/useScrollState.ts +81 -0
  371. package/src/components/index.ts +14 -11
  372. package/src/constants.ts +23 -19
  373. package/src/context.ts +70 -68
  374. package/src/hooks/index.ts +91 -90
  375. package/src/hooks/useKeyboardState/index.ts +52 -0
  376. package/src/hooks/useWindowDimensions/index.android.ts +38 -38
  377. package/src/hooks/useWindowDimensions/index.ts +1 -1
  378. package/src/index.ts +27 -23
  379. package/src/internal.ts +146 -84
  380. package/src/module.ts +64 -52
  381. package/src/reanimated.native.ts +132 -132
  382. package/src/reanimated.ts +29 -29
  383. package/src/specs/ClippingScrollViewDecoratorViewNativeComponent.ts +19 -0
  384. package/src/specs/KeyboardControllerViewNativeComponent.ts +82 -71
  385. package/src/specs/KeyboardGestureAreaNativeComponent.ts +21 -20
  386. package/src/specs/KeyboardToolbarGroupViewNativeComponent.ts +10 -0
  387. package/src/specs/NativeKeyboardController.ts +23 -19
  388. package/src/specs/NativeStatusBarManagerCompat.ts +14 -14
  389. package/src/specs/OverKeyboardViewNativeComponent.ts +12 -12
  390. package/src/types.ts +330 -243
  391. package/src/utils/findNodeHandle/index.native.ts +3 -0
  392. package/src/utils/findNodeHandle/index.ts +6 -0
  393. package/src/utils.ts +1 -1
  394. package/src/views/KeyboardExtender/index.tsx +30 -0
  395. package/src/views/OverKeyboardView/index.tsx +43 -43
  396. package/src/views/index.ts +2 -1
  397. package/lib/commonjs/monkey-patch.android.js +0 -57
  398. package/lib/commonjs/monkey-patch.android.js.map +0 -1
  399. package/lib/commonjs/monkey-patch.js +0 -11
  400. package/lib/commonjs/monkey-patch.js.map +0 -1
  401. package/lib/module/monkey-patch.android.js +0 -47
  402. package/lib/module/monkey-patch.android.js.map +0 -1
  403. package/lib/module/monkey-patch.js +0 -5
  404. package/lib/module/monkey-patch.js.map +0 -1
  405. package/lib/typescript/monkey-patch.android.d.ts +0 -2
  406. package/lib/typescript/monkey-patch.d.ts +0 -2
  407. package/src/monkey-patch.android.ts +0 -44
  408. package/src/monkey-patch.ts +0 -4
@@ -1,108 +1,108 @@
1
- /*
2
- * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3
- */
4
- /**
5
- * MIT License
6
- *
7
- * Copyright (C) 2024 Huawei Device Co., Ltd.
8
- *
9
- * Permission is hereby granted, free of charge, to any person obtaining a copy
10
- * of this software and associated documentation files (the "Software"), to deal
11
- * in the Software without restriction, including without limitation the rights
12
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- * copies of the Software, and to permit persons to whom the Software is
14
- * furnished to do so, subject to the following conditions:
15
- *
16
- * The above copyright notice and this permission notice shall be included in all
17
- * copies or substantial portions of the Software.
18
- *
19
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
- * SOFTWARE.
26
- */
27
-
28
- #include "KeyboardGestureAreaComponentInstance.h"
29
- #include <folly/dynamic.h>
30
-
31
-
32
- namespace rnoh {
33
- KeyboardGestureAreaComponentInstance::KeyboardGestureAreaComponentInstance(Context context)
34
- : CppComponentInstance(std::move(context)) {
35
- DLOG(INFO) << "KeyboardGestureAreaComponentInstance";
36
- ArkUINodeRegistry::getInstance().registerTouchHandler(&m_stackNode, this);
37
- }
38
- void KeyboardGestureAreaComponentInstance::onTouchEvent(ArkUI_UIInputEvent *e) {
39
- auto action = OH_ArkUI_UIInputEvent_GetAction(e);
40
- DLOG(INFO) << "KeyboardGestureAreaComponentInstance onTouchEvent" << action;
41
- if (action == UI_TOUCH_EVENT_ACTION_DOWN) {
42
- this->swipeToDismiss();
43
- }
44
- if (action == UI_TOUCH_EVENT_ACTION_UP) {
45
- this->swipeToUp();
46
- }
47
- }
48
- void KeyboardGestureAreaComponentInstance::onChildInserted(ComponentInstance::Shared const &childComponentInstance,
49
- std::size_t index) {
50
- CppComponentInstance::onChildInserted(childComponentInstance, index);
51
- m_stackNode.insertChild(childComponentInstance->getLocalRootArkUINode(), index + 1);
52
- }
53
-
54
- void KeyboardGestureAreaComponentInstance::onChildRemoved(ComponentInstance::Shared const &childComponentInstance) {
55
- CppComponentInstance::onChildRemoved(childComponentInstance);
56
- m_stackNode.removeChild(childComponentInstance->getLocalRootArkUINode());
57
- }
58
- ArkUINode &KeyboardGestureAreaComponentInstance::getLocalRootArkUINode() { return m_stackNode; }
59
- void KeyboardGestureAreaComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
60
- DLOG(INFO) << "###onPropsChanged";
61
- CppComponentInstance::onPropsChanged(props);
62
- this->showOnSwipeUp = props->showOnSwipeUp;
63
- this->enableSwipeToDismiss = props->enableSwipeToDismiss;
64
- this->interpolator = props->interpolator;
65
- }
66
-
67
- void KeyboardGestureAreaComponentInstance::onCommandReceived(std::string const &commandName,
68
- folly::dynamic const &args) {
69
- CppComponentInstance::onCommandReceived(commandName, args);
70
- }
71
-
72
- void KeyboardGestureAreaComponentInstance::handleTouchEvent(ArkUI_UIInputEvent *e) {
73
- auto action = OH_ArkUI_UIInputEvent_GetAction(e);
74
- if (action == UI_TOUCH_EVENT_ACTION_DOWN) {
75
- this->swipeToDismiss();
76
- }
77
- if (action == UI_TOUCH_EVENT_ACTION_UP) {
78
- this->swipeToUp();
79
- }
80
- }
81
- void KeyboardGestureAreaComponentInstance::swipeToDismiss() {
82
- if (!this->enableSwipeToDismiss) {
83
- return;
84
- }
85
- auto rnInstancePtr = this->m_deps->rnInstance.lock();
86
- if (rnInstancePtr != nullptr) {
87
- auto turboModule = rnInstancePtr->getTurboModule("KeyboardController");
88
- auto arkTsTurboModule = std::dynamic_pointer_cast<rnoh::ArkTSTurboModule>(turboModule);
89
- arkTsTurboModule->callSync("dismiss", {false});
90
- }
91
- }
92
- void KeyboardGestureAreaComponentInstance::swipeToUp() {
93
- if (!this->showOnSwipeUp) {
94
- return;
95
- }
96
- auto rnInstancePtr = this->m_deps->rnInstance.lock();
97
- if (rnInstancePtr != nullptr) {
98
- auto turboModule = rnInstancePtr->getTurboModule("KeyboardController");
99
- auto arkTsTurboModule = std::dynamic_pointer_cast<rnoh::ArkTSTurboModule>(turboModule);
100
- arkTsTurboModule->callSync("show", {});
101
- }
102
- }
103
- void KeyboardGestureAreaComponentInstance::executeInterpolator() {
104
- // to do
105
- }
106
-
107
- } // namespace rnoh
108
- // namespace rnoh
1
+ /*
2
+ * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3
+ */
4
+ /**
5
+ * MIT License
6
+ *
7
+ * Copyright (C) 2024 Huawei Device Co., Ltd.
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in all
17
+ * copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ */
27
+
28
+ #include "KeyboardGestureAreaComponentInstance.h"
29
+ #include <folly/dynamic.h>
30
+
31
+
32
+ namespace rnoh {
33
+ KeyboardGestureAreaComponentInstance::KeyboardGestureAreaComponentInstance(Context context)
34
+ : CppComponentInstance(std::move(context)) {
35
+ DLOG(INFO) << "KeyboardGestureAreaComponentInstance";
36
+ ArkUINodeRegistry::getInstance().registerTouchHandler(&m_stackNode, this);
37
+ }
38
+ void KeyboardGestureAreaComponentInstance::onTouchEvent(ArkUI_UIInputEvent *e) {
39
+ auto action = OH_ArkUI_UIInputEvent_GetAction(e);
40
+ DLOG(INFO) << "KeyboardGestureAreaComponentInstance onTouchEvent" << action;
41
+ if (action == UI_TOUCH_EVENT_ACTION_DOWN) {
42
+ this->swipeToDismiss();
43
+ }
44
+ if (action == UI_TOUCH_EVENT_ACTION_UP) {
45
+ this->swipeToUp();
46
+ }
47
+ }
48
+ void KeyboardGestureAreaComponentInstance::onChildInserted(ComponentInstance::Shared const &childComponentInstance,
49
+ std::size_t index) {
50
+ CppComponentInstance::onChildInserted(childComponentInstance, index);
51
+ m_stackNode.insertChild(childComponentInstance->getLocalRootArkUINode(), index + 1);
52
+ }
53
+
54
+ void KeyboardGestureAreaComponentInstance::onChildRemoved(ComponentInstance::Shared const &childComponentInstance) {
55
+ CppComponentInstance::onChildRemoved(childComponentInstance);
56
+ m_stackNode.removeChild(childComponentInstance->getLocalRootArkUINode());
57
+ }
58
+ ArkUINode &KeyboardGestureAreaComponentInstance::getLocalRootArkUINode() { return m_stackNode; }
59
+ void KeyboardGestureAreaComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
60
+ DLOG(INFO) << "###onPropsChanged";
61
+ CppComponentInstance::onPropsChanged(props);
62
+ this->showOnSwipeUp = props->showOnSwipeUp;
63
+ this->enableSwipeToDismiss = props->enableSwipeToDismiss;
64
+ this->interpolator = props->interpolator;
65
+ }
66
+
67
+ void KeyboardGestureAreaComponentInstance::onCommandReceived(std::string const &commandName,
68
+ folly::dynamic const &args) {
69
+ CppComponentInstance::onCommandReceived(commandName, args);
70
+ }
71
+
72
+ void KeyboardGestureAreaComponentInstance::handleTouchEvent(ArkUI_UIInputEvent *e) {
73
+ auto action = OH_ArkUI_UIInputEvent_GetAction(e);
74
+ if (action == UI_TOUCH_EVENT_ACTION_DOWN) {
75
+ this->swipeToDismiss();
76
+ }
77
+ if (action == UI_TOUCH_EVENT_ACTION_UP) {
78
+ this->swipeToUp();
79
+ }
80
+ }
81
+ void KeyboardGestureAreaComponentInstance::swipeToDismiss() {
82
+ if (!this->enableSwipeToDismiss) {
83
+ return;
84
+ }
85
+ auto rnInstancePtr = this->m_deps->rnInstance.lock();
86
+ if (rnInstancePtr != nullptr) {
87
+ auto turboModule = rnInstancePtr->getTurboModule("KeyboardController");
88
+ auto arkTsTurboModule = std::dynamic_pointer_cast<rnoh::ArkTSTurboModule>(turboModule);
89
+ arkTsTurboModule->callSync("dismiss", {false, true});
90
+ }
91
+ }
92
+ void KeyboardGestureAreaComponentInstance::swipeToUp() {
93
+ if (!this->showOnSwipeUp) {
94
+ return;
95
+ }
96
+ auto rnInstancePtr = this->m_deps->rnInstance.lock();
97
+ if (rnInstancePtr != nullptr) {
98
+ auto turboModule = rnInstancePtr->getTurboModule("KeyboardController");
99
+ auto arkTsTurboModule = std::dynamic_pointer_cast<rnoh::ArkTSTurboModule>(turboModule);
100
+ arkTsTurboModule->callSync("show", {});
101
+ }
102
+ }
103
+ void KeyboardGestureAreaComponentInstance::executeInterpolator() {
104
+ // to do
105
+ }
106
+
107
+ } // namespace rnoh
108
+ // namespace rnoh
@@ -1,83 +1,83 @@
1
- /*
2
- * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3
- */
4
- /**
5
- * MIT License
6
- *
7
- * Copyright (C) 2024 Huawei Device Co., Ltd.
8
- *
9
- * Permission is hereby granted, free of charge, to any person obtaining a copy
10
- * of this software and associated documentation files (the "Software"), to deal
11
- * in the Software without restriction, including without limitation the rights
12
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- * copies of the Software, and to permit persons to whom the Software is
14
- * furnished to do so, subject to the following conditions:
15
- *
16
- * The above copyright notice and this permission notice shall be included in all
17
- * copies or substantial portions of the Software.
18
- *
19
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
- * SOFTWARE.
26
- */
27
-
28
- #ifndef KEYBOARDGESTUREAREACOMPONENTINSTANCE_H
29
- #define KEYBOARDGESTUREAREACOMPONENTINSTANCE_H
30
-
31
- #ifndef TESTER_HARMONY_KEYBOARD_CONTROLLER_SRC_MAIN_CPP_KEYBOARDGESTUREAREACOMPONENTINSTANCE_H
32
- #define TESTER_HARMONY_KEYBOARD_CONTROLLER_SRC_MAIN_CPP_KEYBOARDGESTUREAREACOMPONENTINSTANCE_H
33
-
34
- #include <iostream>
35
- #include <deque>
36
- #include "RNOH/CppComponentInstance.h"
37
- #include "KeyboardGestureAreaComponentDescriptor.h"
38
- #include "RNOH/arkui/StackNode.h"
39
- #include "RNOH/arkui/ArkUINodeRegistry.h"
40
- namespace rnoh {
41
-
42
- class KeyboardGestureAreaComponentInstance
43
- : public CppComponentInstance<facebook::react::KeyboardGestureAreaShadowNode>,
44
- public TouchEventHandler {
45
- public:
46
- KeyboardGestureAreaComponentInstance(Context context);
47
- ~KeyboardGestureAreaComponentInstance()
48
- {
49
- // Clean-up code here
50
- std::cout << "KeyboardGestureAreaComponentInstance destroyed." << std::endl;
51
- ArkUINodeRegistry::getInstance().unregisterTouchHandler(&m_stackNode);
52
- }
53
- void onTouchEvent(ArkUI_UIInputEvent *e) override;
54
- void onChildInserted(ComponentInstance::Shared const &childComponentInstance, std::size_t index) override;
55
- void onChildRemoved(ComponentInstance::Shared const &childComponentInstance) override;
56
- void onPropsChanged(SharedConcreteProps const &props) override;
57
- void onCommandReceived(std::string const &commandName, folly::dynamic const &args) override;
58
- ArkUINode &getLocalRootArkUINode() override;
59
- protected:
60
- private:
61
- bool showOnSwipeUp;
62
- bool enableSwipeToDismiss;
63
- std::string interpolator;
64
- double keyboardHeight;
65
- size_t maxSize;
66
- std::deque<folly::dynamic> buffer;
67
- StackNode m_stackNode;
68
- struct TouchPoint {
69
- facebook::react::Float pointerId;
70
- facebook::react::Float windowX;
71
- facebook::react::Float windowY;
72
- };
73
- folly::dynamic convertNodeTouchPointToDynamic(ArkUI_UIInputEvent *e, int32_t index);
74
- void swipeToUp();
75
- void swipeToDismiss();
76
- void executeInterpolator();
77
- void handleTouchEvent(ArkUI_UIInputEvent *e);
78
- };
79
- } // namespace rnoh
80
-
81
- #endif
82
-
83
- #endif
1
+ /*
2
+ * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3
+ */
4
+ /**
5
+ * MIT License
6
+ *
7
+ * Copyright (C) 2024 Huawei Device Co., Ltd.
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in all
17
+ * copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ */
27
+
28
+ #ifndef KEYBOARDGESTUREAREACOMPONENTINSTANCE_H
29
+ #define KEYBOARDGESTUREAREACOMPONENTINSTANCE_H
30
+
31
+ #ifndef TESTER_HARMONY_KEYBOARD_CONTROLLER_SRC_MAIN_CPP_KEYBOARDGESTUREAREACOMPONENTINSTANCE_H
32
+ #define TESTER_HARMONY_KEYBOARD_CONTROLLER_SRC_MAIN_CPP_KEYBOARDGESTUREAREACOMPONENTINSTANCE_H
33
+
34
+ #include <iostream>
35
+ #include <deque>
36
+ #include "RNOH/CppComponentInstance.h"
37
+ #include "KeyboardGestureAreaComponentDescriptor.h"
38
+ #include "RNOH/arkui/StackNode.h"
39
+ #include "RNOH/arkui/ArkUINodeRegistry.h"
40
+ namespace rnoh {
41
+
42
+ class KeyboardGestureAreaComponentInstance
43
+ : public CppComponentInstance<facebook::react::KeyboardGestureAreaShadowNode>,
44
+ public TouchEventHandler {
45
+ public:
46
+ KeyboardGestureAreaComponentInstance(Context context);
47
+ ~KeyboardGestureAreaComponentInstance()
48
+ {
49
+ // Clean-up code here
50
+ std::cout << "KeyboardGestureAreaComponentInstance destroyed." << std::endl;
51
+ ArkUINodeRegistry::getInstance().unregisterTouchHandler(&m_stackNode);
52
+ }
53
+ void onTouchEvent(ArkUI_UIInputEvent *e) override;
54
+ void onChildInserted(ComponentInstance::Shared const &childComponentInstance, std::size_t index) override;
55
+ void onChildRemoved(ComponentInstance::Shared const &childComponentInstance) override;
56
+ void onPropsChanged(SharedConcreteProps const &props) override;
57
+ void onCommandReceived(std::string const &commandName, folly::dynamic const &args) override;
58
+ ArkUINode &getLocalRootArkUINode() override;
59
+ protected:
60
+ private:
61
+ bool showOnSwipeUp;
62
+ bool enableSwipeToDismiss;
63
+ std::string interpolator;
64
+ double keyboardHeight;
65
+ size_t maxSize;
66
+ std::deque<folly::dynamic> buffer;
67
+ StackNode m_stackNode;
68
+ struct TouchPoint {
69
+ facebook::react::Float pointerId;
70
+ facebook::react::Float windowX;
71
+ facebook::react::Float windowY;
72
+ };
73
+ folly::dynamic convertNodeTouchPointToDynamic(ArkUI_UIInputEvent *e, int32_t index);
74
+ void swipeToUp();
75
+ void swipeToDismiss();
76
+ void executeInterpolator();
77
+ void handleTouchEvent(ArkUI_UIInputEvent *e);
78
+ };
79
+ } // namespace rnoh
80
+
81
+ #endif
82
+
83
+ #endif
@@ -1,60 +1,60 @@
1
- /*
2
- * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3
- */
4
- /**
5
- * MIT License
6
- *
7
- * Copyright (C) 2024 Huawei Device Co., Ltd.
8
- *
9
- * Permission is hereby granted, free of charge, to any person obtaining a copy
10
- * of this software and associated documentation files (the "Software"), to deal
11
- * in the Software without restriction, including without limitation the rights
12
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- * copies of the Software, and to permit persons to whom the Software is
14
- * furnished to do so, subject to the following conditions:
15
- *
16
- * The above copyright notice and this permission notice shall be included in all
17
- * copies or substantial portions of the Software.
18
- *
19
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
- * SOFTWARE.
26
- */
27
-
28
- #ifndef TESTER_HARMONY_KEYBOARD_CONTROLLER_SRC_MAIN_CPP_KEYBOARDGESTUREAREAJSIBINDER_H
29
- #define TESTER_HARMONY_KEYBOARD_CONTROLLER_SRC_MAIN_CPP_KEYBOARDGESTUREAREAJSIBINDER_H
30
-
31
- #pragma once
32
- #include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h"
33
-
34
- namespace rnoh {
35
- class KeyboardGestureAreaJSIBinder : public ViewComponentJSIBinder {
36
- protected:
37
- facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override
38
- {
39
- auto object = ViewComponentJSIBinder::createNativeProps(rt);
40
- object.setProperty(rt, "interpolator", "String");
41
- object.setProperty(rt, "showOnSwipeUp", "bool");
42
- object.setProperty(rt, "enableSwipeToDismiss", "bool");
43
- return object;
44
- }
45
-
46
- facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override
47
- {
48
- facebook::jsi::Object events(rt);
49
- return events;
50
- }
51
-
52
- facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override
53
- {
54
- facebook::jsi::Object events(rt);
55
- return events;
56
- }
57
- };
58
- } // namespace rnoh
59
-
60
- #endif
1
+ /*
2
+ * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3
+ */
4
+ /**
5
+ * MIT License
6
+ *
7
+ * Copyright (C) 2024 Huawei Device Co., Ltd.
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in all
17
+ * copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ */
27
+
28
+ #ifndef TESTER_HARMONY_KEYBOARD_CONTROLLER_SRC_MAIN_CPP_KEYBOARDGESTUREAREAJSIBINDER_H
29
+ #define TESTER_HARMONY_KEYBOARD_CONTROLLER_SRC_MAIN_CPP_KEYBOARDGESTUREAREAJSIBINDER_H
30
+
31
+ #pragma once
32
+ #include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h"
33
+
34
+ namespace rnoh {
35
+ class KeyboardGestureAreaJSIBinder : public ViewComponentJSIBinder {
36
+ protected:
37
+ facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override
38
+ {
39
+ auto object = ViewComponentJSIBinder::createNativeProps(rt);
40
+ object.setProperty(rt, "interpolator", "String");
41
+ object.setProperty(rt, "showOnSwipeUp", "bool");
42
+ object.setProperty(rt, "enableSwipeToDismiss", "bool");
43
+ return object;
44
+ }
45
+
46
+ facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override
47
+ {
48
+ facebook::jsi::Object events(rt);
49
+ return events;
50
+ }
51
+
52
+ facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override
53
+ {
54
+ facebook::jsi::Object events(rt);
55
+ return events;
56
+ }
57
+ };
58
+ } // namespace rnoh
59
+
60
+ #endif
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3
+ */
4
+
5
+ #ifndef KEYBOARDTOOLBARGROUPVIEWCOMPONENTDESCRIPTOR_H
6
+ #define KEYBOARDTOOLBARGROUPVIEWCOMPONENTDESCRIPTOR_H
7
+
8
+ #pragma once
9
+
10
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
11
+ #include <react/renderer/components/view/ViewProps.h>
12
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
13
+
14
+ namespace facebook {
15
+ namespace react {
16
+
17
+ inline const char KeyboardToolbarGroupViewComponentName[] =
18
+ "KeyboardToolbarGroupView";
19
+
20
+ class KeyboardToolbarGroupViewProps : public ViewProps {
21
+ public:
22
+ KeyboardToolbarGroupViewProps() = default;
23
+ KeyboardToolbarGroupViewProps(
24
+ const PropsParserContext &context,
25
+ const KeyboardToolbarGroupViewProps &sourceProps,
26
+ const RawProps &rawProps)
27
+ : ViewProps(context, sourceProps, rawProps) {}
28
+ };
29
+
30
+ using KeyboardToolbarGroupViewShadowNode = ConcreteViewShadowNode<
31
+ KeyboardToolbarGroupViewComponentName,
32
+ KeyboardToolbarGroupViewProps,
33
+ ViewEventEmitter>;
34
+
35
+ class KeyboardToolbarGroupViewComponentDescriptor final
36
+ : public ConcreteComponentDescriptor<KeyboardToolbarGroupViewShadowNode> {
37
+ public:
38
+ KeyboardToolbarGroupViewComponentDescriptor(
39
+ ComponentDescriptorParameters const &parameters)
40
+ : ConcreteComponentDescriptor(parameters) {}
41
+ };
42
+
43
+ } // namespace react
44
+ } // namespace facebook
45
+
46
+ #endif
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3
+ */
4
+
5
+ #include "KeyboardToolbarGroupViewComponentInstance.h"
6
+
7
+ namespace rnoh {
8
+
9
+ KeyboardToolbarGroupViewComponentInstance::KeyboardToolbarGroupViewComponentInstance(
10
+ Context context)
11
+ : CppComponentInstance(std::move(context)) {
12
+ m_stackNode.setHitTestMode(ARKUI_HIT_TEST_MODE_DEFAULT);
13
+ }
14
+
15
+ void KeyboardToolbarGroupViewComponentInstance::onChildInserted(
16
+ ComponentInstance::Shared const &childComponentInstance,
17
+ std::size_t index) {
18
+ CppComponentInstance::onChildInserted(childComponentInstance, index);
19
+ m_stackNode.insertChild(childComponentInstance->getLocalRootArkUINode(), index);
20
+ }
21
+
22
+ void KeyboardToolbarGroupViewComponentInstance::onChildRemoved(
23
+ ComponentInstance::Shared const &childComponentInstance) {
24
+ CppComponentInstance::onChildRemoved(childComponentInstance);
25
+ m_stackNode.removeChild(childComponentInstance->getLocalRootArkUINode());
26
+ }
27
+
28
+ void KeyboardToolbarGroupViewComponentInstance::onPropsChanged(
29
+ SharedConcreteProps const &props) {
30
+ CppComponentInstance::onPropsChanged(props);
31
+ }
32
+
33
+ ArkUINode &KeyboardToolbarGroupViewComponentInstance::getLocalRootArkUINode() {
34
+ return m_stackNode;
35
+ }
36
+
37
+ } // namespace rnoh
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3
+ */
4
+
5
+ #ifndef KEYBOARDTOOLBARGROUPVIEWCOMPONENTINSTANCE_H
6
+ #define KEYBOARDTOOLBARGROUPVIEWCOMPONENTINSTANCE_H
7
+
8
+ #pragma once
9
+
10
+ #include "KeyboardToolbarGroupViewComponentDescriptor.h"
11
+ #include "RNOH/CppComponentInstance.h"
12
+ #include "RNOH/arkui/StackNode.h"
13
+
14
+ namespace rnoh {
15
+
16
+ class KeyboardToolbarGroupViewComponentInstance
17
+ : public CppComponentInstance<facebook::react::KeyboardToolbarGroupViewShadowNode> {
18
+ public:
19
+ explicit KeyboardToolbarGroupViewComponentInstance(Context context);
20
+
21
+ void onChildInserted(ComponentInstance::Shared const &childComponentInstance, std::size_t index) override;
22
+ void onChildRemoved(ComponentInstance::Shared const &childComponentInstance) override;
23
+ void onPropsChanged(SharedConcreteProps const &props) override;
24
+ ArkUINode &getLocalRootArkUINode() override;
25
+
26
+ private:
27
+ StackNode m_stackNode;
28
+ };
29
+
30
+ } // namespace rnoh
31
+
32
+ #endif
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3
+ */
4
+
5
+ #ifndef KEYBOARDTOOLBARGROUPVIEWJSIBINDER_H
6
+ #define KEYBOARDTOOLBARGROUPVIEWJSIBINDER_H
7
+
8
+ #pragma once
9
+
10
+ #include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h"
11
+
12
+ namespace rnoh {
13
+
14
+ class KeyboardToolbarGroupViewJSIBinder : public ViewComponentJSIBinder {
15
+ protected:
16
+ facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override {
17
+ return ViewComponentJSIBinder::createNativeProps(rt);
18
+ }
19
+ };
20
+
21
+ } // namespace rnoh
22
+
23
+ #endif