@react-native-ohos/react-native-keyboard-controller 1.16.8 → 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 (352) hide show
  1. package/README.OpenSource +2 -2
  2. package/README.md +105 -29
  3. package/harmony/keyboard_controller/BuildProfile.ets +1 -1
  4. package/harmony/keyboard_controller/Index.ets +1 -0
  5. package/harmony/keyboard_controller/oh-package-lock.json5 +7 -7
  6. package/harmony/keyboard_controller/oh-package.json5 +1 -1
  7. package/harmony/keyboard_controller/src/main/cpp/ClippingScrollViewComponentDescriptor.h +86 -0
  8. package/harmony/keyboard_controller/src/main/cpp/ClippingScrollViewComponentInstance.cpp +104 -0
  9. package/harmony/keyboard_controller/src/main/cpp/ClippingScrollViewComponentInstance.h +64 -0
  10. package/harmony/keyboard_controller/src/main/cpp/ClippingScrollViewJSIBinder.h +60 -0
  11. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.cpp +8 -1
  12. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.cpp +2 -2
  13. package/harmony/keyboard_controller/src/main/cpp/KeyboardToolbarGroupViewComponentDescriptor.h +46 -0
  14. package/harmony/keyboard_controller/src/main/cpp/KeyboardToolbarGroupViewComponentInstance.cpp +37 -0
  15. package/harmony/keyboard_controller/src/main/cpp/KeyboardToolbarGroupViewComponentInstance.h +32 -0
  16. package/harmony/keyboard_controller/src/main/cpp/KeyboardToolbarGroupViewJSIBinder.h +23 -0
  17. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.cpp +58 -1
  18. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardControllerPackage.h +20 -0
  19. package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.cpp +65 -44
  20. package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.h +22 -3
  21. package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.cpp +17 -4
  22. package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.h +9 -1
  23. package/harmony/keyboard_controller/src/main/ets/{RNKeyboardControllerPackage.ts → RNKeyboardControllerPackage.ets} +9 -5
  24. package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerTurboModule.ts +29 -5
  25. package/harmony/keyboard_controller/src/main/ets/Type.ts +2 -1
  26. package/harmony/keyboard_controller.har +0 -0
  27. package/lib/commonjs/animated.js +20 -9
  28. package/lib/commonjs/animated.js.map +1 -1
  29. package/lib/commonjs/architecture.js +8 -0
  30. package/lib/commonjs/architecture.js.map +1 -0
  31. package/lib/commonjs/bindings.js +37 -2
  32. package/lib/commonjs/bindings.js.map +1 -1
  33. package/lib/commonjs/bindings.native.js +25 -2
  34. package/lib/commonjs/bindings.native.js.map +1 -1
  35. package/lib/commonjs/compat.js +50 -0
  36. package/lib/commonjs/compat.js.map +1 -0
  37. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js +21 -15
  38. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js.map +1 -1
  39. package/lib/commonjs/components/KeyboardAvoidingView/index.js +36 -11
  40. package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
  41. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +51 -16
  42. package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
  43. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +2 -2
  44. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
  45. package/lib/commonjs/components/KeyboardChatScrollView/hooks.js +13 -0
  46. package/lib/commonjs/components/KeyboardChatScrollView/hooks.js.map +1 -0
  47. package/lib/commonjs/components/KeyboardChatScrollView/index.js +122 -0
  48. package/lib/commonjs/components/KeyboardChatScrollView/index.js.map +1 -0
  49. package/lib/commonjs/components/KeyboardChatScrollView/types.js +6 -0
  50. package/lib/commonjs/components/KeyboardChatScrollView/types.js.map +1 -0
  51. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/helpers.js +221 -0
  52. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/helpers.js.map +1 -0
  53. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js +149 -0
  54. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js.map +1 -0
  55. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.js +240 -0
  56. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.js.map +1 -0
  57. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/types.js +6 -0
  58. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/types.js.map +1 -0
  59. package/lib/commonjs/components/KeyboardChatScrollView/useEndVisible.js +40 -0
  60. package/lib/commonjs/components/KeyboardChatScrollView/useEndVisible.js.map +1 -0
  61. package/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js +92 -0
  62. package/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js.map +1 -0
  63. package/lib/commonjs/components/KeyboardToolbar/Arrow.js +2 -3
  64. package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -1
  65. package/lib/commonjs/components/KeyboardToolbar/Button.js +2 -3
  66. package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -1
  67. package/lib/commonjs/components/KeyboardToolbar/compound/components/Background.js +13 -0
  68. package/lib/commonjs/components/KeyboardToolbar/compound/components/Background.js.map +1 -0
  69. package/lib/commonjs/components/KeyboardToolbar/compound/components/Content.js +25 -0
  70. package/lib/commonjs/components/KeyboardToolbar/compound/components/Content.js.map +1 -0
  71. package/lib/commonjs/components/KeyboardToolbar/compound/components/Done.js +58 -0
  72. package/lib/commonjs/components/KeyboardToolbar/compound/components/Done.js.map +1 -0
  73. package/lib/commonjs/components/KeyboardToolbar/compound/components/Next.js +49 -0
  74. package/lib/commonjs/components/KeyboardToolbar/compound/components/Next.js.map +1 -0
  75. package/lib/commonjs/components/KeyboardToolbar/compound/components/Prev.js +49 -0
  76. package/lib/commonjs/components/KeyboardToolbar/compound/components/Prev.js.map +1 -0
  77. package/lib/commonjs/components/KeyboardToolbar/compound/components/index.js +42 -0
  78. package/lib/commonjs/components/KeyboardToolbar/compound/components/index.js.map +1 -0
  79. package/lib/commonjs/components/KeyboardToolbar/compound/components/types.js +6 -0
  80. package/lib/commonjs/components/KeyboardToolbar/compound/components/types.js.map +1 -0
  81. package/lib/commonjs/components/KeyboardToolbar/compound/context.js +17 -0
  82. package/lib/commonjs/components/KeyboardToolbar/compound/context.js.map +1 -0
  83. package/lib/commonjs/components/KeyboardToolbar/constants.js +17 -0
  84. package/lib/commonjs/components/KeyboardToolbar/constants.js.map +1 -0
  85. package/lib/commonjs/components/KeyboardToolbar/index.js +95 -84
  86. package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
  87. package/lib/commonjs/components/KeyboardToolbar/types.js.map +1 -1
  88. package/lib/commonjs/components/ScrollViewWithBottomPadding/index.js +120 -0
  89. package/lib/commonjs/components/ScrollViewWithBottomPadding/index.js.map +1 -0
  90. package/lib/commonjs/components/ScrollViewWithBottomPadding/styles.js +15 -0
  91. package/lib/commonjs/components/ScrollViewWithBottomPadding/styles.js.map +1 -0
  92. package/lib/commonjs/components/hooks/useColorScheme.js +1 -1
  93. package/lib/commonjs/components/hooks/useColorScheme.js.map +1 -1
  94. package/lib/commonjs/components/hooks/useCombinedRef.js +24 -0
  95. package/lib/commonjs/components/hooks/useCombinedRef.js.map +1 -0
  96. package/lib/commonjs/components/hooks/useScrollState.js +62 -0
  97. package/lib/commonjs/components/hooks/useScrollState.js.map +1 -0
  98. package/lib/commonjs/components/index.js +7 -0
  99. package/lib/commonjs/components/index.js.map +1 -1
  100. package/lib/commonjs/constants.js +3 -1
  101. package/lib/commonjs/constants.js.map +1 -1
  102. package/lib/commonjs/context.js +1 -0
  103. package/lib/commonjs/context.js.map +1 -1
  104. package/lib/commonjs/hooks/index.js +14 -1
  105. package/lib/commonjs/hooks/index.js.map +1 -1
  106. package/lib/commonjs/hooks/useKeyboardState/index.js +39 -0
  107. package/lib/commonjs/hooks/useKeyboardState/index.js.map +1 -0
  108. package/lib/commonjs/index.js +27 -1
  109. package/lib/commonjs/index.js.map +1 -1
  110. package/lib/commonjs/internal.js +36 -0
  111. package/lib/commonjs/internal.js.map +1 -1
  112. package/lib/commonjs/module.js +21 -12
  113. package/lib/commonjs/module.js.map +1 -1
  114. package/lib/commonjs/specs/ClippingScrollViewDecoratorViewNativeComponent.js +12 -0
  115. package/lib/commonjs/specs/ClippingScrollViewDecoratorViewNativeComponent.js.map +1 -0
  116. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js +8 -2
  117. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  118. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js +2 -1
  119. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  120. package/lib/commonjs/specs/KeyboardToolbarGroupViewNativeComponent.js +12 -0
  121. package/lib/commonjs/specs/KeyboardToolbarGroupViewNativeComponent.js.map +1 -0
  122. package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
  123. package/lib/commonjs/types.js.map +1 -1
  124. package/lib/commonjs/utils/findNodeHandle/index.js +9 -0
  125. package/lib/commonjs/utils/findNodeHandle/index.js.map +1 -0
  126. package/lib/commonjs/utils/findNodeHandle/index.native.js +13 -0
  127. package/lib/commonjs/utils/findNodeHandle/index.native.js.map +1 -0
  128. package/lib/commonjs/views/KeyboardExtender/index.js +30 -0
  129. package/lib/commonjs/views/KeyboardExtender/index.js.map +1 -0
  130. package/lib/commonjs/views/index.js +7 -0
  131. package/lib/commonjs/views/index.js.map +1 -1
  132. package/lib/module/animated.js +22 -11
  133. package/lib/module/animated.js.map +1 -1
  134. package/lib/module/architecture.js +2 -0
  135. package/lib/module/architecture.js.map +1 -0
  136. package/lib/module/bindings.js +36 -2
  137. package/lib/module/bindings.js.map +1 -1
  138. package/lib/module/bindings.native.js +24 -2
  139. package/lib/module/bindings.native.js.map +1 -1
  140. package/lib/module/compat.js +43 -0
  141. package/lib/module/compat.js.map +1 -0
  142. package/lib/module/components/KeyboardAvoidingView/hooks.js +22 -16
  143. package/lib/module/components/KeyboardAvoidingView/hooks.js.map +1 -1
  144. package/lib/module/components/KeyboardAvoidingView/index.js +35 -11
  145. package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
  146. package/lib/module/components/KeyboardAwareScrollView/index.js +54 -19
  147. package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
  148. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +2 -2
  149. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
  150. package/lib/module/components/KeyboardChatScrollView/hooks.js +2 -0
  151. package/lib/module/components/KeyboardChatScrollView/hooks.js.map +1 -0
  152. package/lib/module/components/KeyboardChatScrollView/index.js +115 -0
  153. package/lib/module/components/KeyboardChatScrollView/index.js.map +1 -0
  154. package/lib/module/components/KeyboardChatScrollView/types.js +2 -0
  155. package/lib/module/components/KeyboardChatScrollView/types.js.map +1 -0
  156. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/helpers.js +207 -0
  157. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/helpers.js.map +1 -0
  158. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js +143 -0
  159. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js.map +1 -0
  160. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.js +234 -0
  161. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.js.map +1 -0
  162. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/types.js +2 -0
  163. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/types.js.map +1 -0
  164. package/lib/module/components/KeyboardChatScrollView/useEndVisible.js +33 -0
  165. package/lib/module/components/KeyboardChatScrollView/useEndVisible.js.map +1 -0
  166. package/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js +87 -0
  167. package/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js.map +1 -0
  168. package/lib/module/components/KeyboardToolbar/Arrow.js +2 -2
  169. package/lib/module/components/KeyboardToolbar/Arrow.js.map +1 -1
  170. package/lib/module/components/KeyboardToolbar/Button.js +2 -2
  171. package/lib/module/components/KeyboardToolbar/Button.js.map +1 -1
  172. package/lib/module/components/KeyboardToolbar/compound/components/Background.js +6 -0
  173. package/lib/module/components/KeyboardToolbar/compound/components/Background.js.map +1 -0
  174. package/lib/module/components/KeyboardToolbar/compound/components/Content.js +18 -0
  175. package/lib/module/components/KeyboardToolbar/compound/components/Content.js.map +1 -0
  176. package/lib/module/components/KeyboardToolbar/compound/components/Done.js +50 -0
  177. package/lib/module/components/KeyboardToolbar/compound/components/Done.js.map +1 -0
  178. package/lib/module/components/KeyboardToolbar/compound/components/Next.js +41 -0
  179. package/lib/module/components/KeyboardToolbar/compound/components/Next.js.map +1 -0
  180. package/lib/module/components/KeyboardToolbar/compound/components/Prev.js +41 -0
  181. package/lib/module/components/KeyboardToolbar/compound/components/Prev.js.map +1 -0
  182. package/lib/module/components/KeyboardToolbar/compound/components/index.js +6 -0
  183. package/lib/module/components/KeyboardToolbar/compound/components/index.js.map +1 -0
  184. package/lib/module/components/KeyboardToolbar/compound/components/types.js +2 -0
  185. package/lib/module/components/KeyboardToolbar/compound/components/types.js.map +1 -0
  186. package/lib/module/components/KeyboardToolbar/compound/context.js +10 -0
  187. package/lib/module/components/KeyboardToolbar/compound/context.js.map +1 -0
  188. package/lib/module/components/KeyboardToolbar/constants.js +11 -0
  189. package/lib/module/components/KeyboardToolbar/constants.js.map +1 -0
  190. package/lib/module/components/KeyboardToolbar/index.js +95 -85
  191. package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
  192. package/lib/module/components/KeyboardToolbar/types.js.map +1 -1
  193. package/lib/module/components/ScrollViewWithBottomPadding/index.js +112 -0
  194. package/lib/module/components/ScrollViewWithBottomPadding/index.js.map +1 -0
  195. package/lib/module/components/ScrollViewWithBottomPadding/styles.js +9 -0
  196. package/lib/module/components/ScrollViewWithBottomPadding/styles.js.map +1 -0
  197. package/lib/module/components/hooks/useColorScheme.js +1 -1
  198. package/lib/module/components/hooks/useColorScheme.js.map +1 -1
  199. package/lib/module/components/hooks/useCombinedRef.js +18 -0
  200. package/lib/module/components/hooks/useCombinedRef.js.map +1 -0
  201. package/lib/module/components/hooks/useScrollState.js +56 -0
  202. package/lib/module/components/hooks/useScrollState.js.map +1 -0
  203. package/lib/module/components/index.js +1 -0
  204. package/lib/module/components/index.js.map +1 -1
  205. package/lib/module/constants.js +3 -0
  206. package/lib/module/constants.js.map +1 -1
  207. package/lib/module/context.js +1 -0
  208. package/lib/module/context.js.map +1 -1
  209. package/lib/module/hooks/index.js +3 -1
  210. package/lib/module/hooks/index.js.map +1 -1
  211. package/lib/module/hooks/useKeyboardState/index.js +33 -0
  212. package/lib/module/hooks/useKeyboardState/index.js.map +1 -0
  213. package/lib/module/index.js +3 -2
  214. package/lib/module/index.js.map +1 -1
  215. package/lib/module/internal.js +35 -0
  216. package/lib/module/internal.js.map +1 -1
  217. package/lib/module/module.js +21 -12
  218. package/lib/module/module.js.map +1 -1
  219. package/lib/module/specs/ClippingScrollViewDecoratorViewNativeComponent.js +6 -0
  220. package/lib/module/specs/ClippingScrollViewDecoratorViewNativeComponent.js.map +1 -0
  221. package/lib/module/specs/KeyboardControllerViewNativeComponent.js +7 -1
  222. package/lib/module/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  223. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js +2 -1
  224. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  225. package/lib/module/specs/KeyboardToolbarGroupViewNativeComponent.js +5 -0
  226. package/lib/module/specs/KeyboardToolbarGroupViewNativeComponent.js.map +1 -0
  227. package/lib/module/specs/NativeKeyboardController.js.map +1 -1
  228. package/lib/module/types.js.map +1 -1
  229. package/lib/module/utils/findNodeHandle/index.js +2 -0
  230. package/lib/module/utils/findNodeHandle/index.js.map +1 -0
  231. package/lib/module/utils/findNodeHandle/index.native.js +3 -0
  232. package/lib/module/utils/findNodeHandle/index.native.js.map +1 -0
  233. package/lib/module/views/KeyboardExtender/index.js +23 -0
  234. package/lib/module/views/KeyboardExtender/index.js.map +1 -0
  235. package/lib/module/views/index.js +1 -0
  236. package/lib/module/views/index.js.map +1 -1
  237. package/lib/typescript/animated.d.ts +2 -38
  238. package/lib/typescript/architecture.d.ts +1 -0
  239. package/lib/typescript/bindings.d.ts +15 -1
  240. package/lib/typescript/bindings.native.d.ts +10 -1
  241. package/lib/typescript/compat.d.ts +12 -0
  242. package/lib/typescript/components/KeyboardAvoidingView/index.d.ts +5 -0
  243. package/lib/typescript/components/KeyboardAwareScrollView/index.d.ts +4 -1
  244. package/lib/typescript/components/KeyboardChatScrollView/hooks.d.ts +2 -0
  245. package/lib/typescript/components/KeyboardChatScrollView/index.d.ts +17 -0
  246. package/lib/typescript/components/KeyboardChatScrollView/types.d.ts +113 -0
  247. package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/helpers.d.ts +132 -0
  248. package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/index.d.ts +18 -0
  249. package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/index.ios.d.ts +21 -0
  250. package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/types.d.ts +37 -0
  251. package/lib/typescript/components/KeyboardChatScrollView/useEndVisible.d.ts +17 -0
  252. package/lib/typescript/components/KeyboardChatScrollView/useExtraContentPadding/index.d.ts +45 -0
  253. package/lib/typescript/components/KeyboardToolbar/Button.d.ts +2 -2
  254. package/lib/typescript/components/KeyboardToolbar/compound/components/Background.d.ts +6 -0
  255. package/lib/typescript/components/KeyboardToolbar/compound/components/Content.d.ts +7 -0
  256. package/lib/typescript/components/KeyboardToolbar/compound/components/Done.d.ts +7 -0
  257. package/lib/typescript/components/KeyboardToolbar/compound/components/Next.d.ts +4 -0
  258. package/lib/typescript/components/KeyboardToolbar/compound/components/Prev.d.ts +4 -0
  259. package/lib/typescript/components/KeyboardToolbar/compound/components/index.d.ts +5 -0
  260. package/lib/typescript/components/KeyboardToolbar/compound/components/types.d.ts +14 -0
  261. package/lib/typescript/components/KeyboardToolbar/compound/context.d.ts +9 -0
  262. package/lib/typescript/components/KeyboardToolbar/constants.d.ts +10 -0
  263. package/lib/typescript/components/KeyboardToolbar/index.d.ts +12 -45
  264. package/lib/typescript/components/KeyboardToolbar/types.d.ts +24 -1
  265. package/lib/typescript/components/ScrollViewWithBottomPadding/index.d.ts +30 -0
  266. package/lib/typescript/components/ScrollViewWithBottomPadding/styles.d.ts +7 -0
  267. package/lib/typescript/components/hooks/useCombinedRef.d.ts +3 -0
  268. package/lib/typescript/components/hooks/useScrollState.d.ts +17 -0
  269. package/lib/typescript/components/index.d.ts +3 -0
  270. package/lib/typescript/constants.d.ts +1 -0
  271. package/lib/typescript/context.d.ts +1 -0
  272. package/lib/typescript/hooks/index.d.ts +2 -0
  273. package/lib/typescript/hooks/useKeyboardState/index.d.ts +4 -0
  274. package/lib/typescript/index.d.ts +4 -3
  275. package/lib/typescript/internal.d.ts +4 -0
  276. package/lib/typescript/specs/ClippingScrollViewDecoratorViewNativeComponent.d.ts +10 -0
  277. package/lib/typescript/specs/KeyboardControllerViewNativeComponent.d.ts +4 -0
  278. package/lib/typescript/specs/KeyboardToolbarGroupViewNativeComponent.d.ts +6 -0
  279. package/lib/typescript/specs/NativeKeyboardController.d.ts +6 -2
  280. package/lib/typescript/types.d.ts +80 -5
  281. package/lib/typescript/utils/findNodeHandle/index.d.ts +4 -0
  282. package/lib/typescript/utils/findNodeHandle/index.native.d.ts +2 -0
  283. package/lib/typescript/views/KeyboardExtender/index.d.ts +5 -0
  284. package/lib/typescript/views/index.d.ts +1 -0
  285. package/package.json +15 -9
  286. package/src/animated.tsx +41 -48
  287. package/src/architecture.ts +1 -0
  288. package/src/bindings.native.ts +37 -2
  289. package/src/bindings.ts +40 -1
  290. package/src/compat.ts +44 -0
  291. package/src/components/KeyboardAvoidingView/hooks.ts +24 -17
  292. package/src/components/KeyboardAvoidingView/index.tsx +62 -18
  293. package/src/components/KeyboardAwareScrollView/index.tsx +75 -20
  294. package/src/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +2 -2
  295. package/src/components/KeyboardChatScrollView/hooks.ts +2 -0
  296. package/src/components/KeyboardChatScrollView/index.tsx +164 -0
  297. package/src/components/KeyboardChatScrollView/types.ts +117 -0
  298. package/src/components/KeyboardChatScrollView/useChatKeyboard/helpers.ts +268 -0
  299. package/src/components/KeyboardChatScrollView/useChatKeyboard/index.ios.ts +260 -0
  300. package/src/components/KeyboardChatScrollView/useChatKeyboard/index.ts +374 -0
  301. package/src/components/KeyboardChatScrollView/useChatKeyboard/types.ts +39 -0
  302. package/src/components/KeyboardChatScrollView/useEndVisible.ts +66 -0
  303. package/src/components/KeyboardChatScrollView/useExtraContentPadding/index.ts +149 -0
  304. package/src/components/KeyboardToolbar/Arrow.tsx +2 -2
  305. package/src/components/KeyboardToolbar/Button.tsx +4 -4
  306. package/src/components/KeyboardToolbar/compound/components/Background.tsx +9 -0
  307. package/src/components/KeyboardToolbar/compound/components/Content.tsx +25 -0
  308. package/src/components/KeyboardToolbar/compound/components/Done.tsx +57 -0
  309. package/src/components/KeyboardToolbar/compound/components/Next.tsx +49 -0
  310. package/src/components/KeyboardToolbar/compound/components/Prev.tsx +49 -0
  311. package/src/components/KeyboardToolbar/compound/components/index.ts +5 -0
  312. package/src/components/KeyboardToolbar/compound/components/types.ts +15 -0
  313. package/src/components/KeyboardToolbar/compound/context.ts +25 -0
  314. package/src/components/KeyboardToolbar/constants.ts +14 -0
  315. package/src/components/KeyboardToolbar/index.tsx +143 -146
  316. package/src/components/KeyboardToolbar/types.ts +33 -1
  317. package/src/components/ScrollViewWithBottomPadding/index.tsx +216 -0
  318. package/src/components/ScrollViewWithBottomPadding/styles.ts +10 -0
  319. package/src/components/hooks/useColorScheme.ts +2 -1
  320. package/src/components/hooks/useCombinedRef.ts +22 -0
  321. package/src/components/hooks/useScrollState.ts +81 -0
  322. package/src/components/index.ts +3 -0
  323. package/src/constants.ts +4 -0
  324. package/src/context.ts +2 -0
  325. package/src/hooks/index.ts +2 -1
  326. package/src/hooks/useKeyboardState/index.ts +52 -0
  327. package/src/index.ts +5 -1
  328. package/src/internal.ts +62 -0
  329. package/src/module.ts +21 -9
  330. package/src/specs/ClippingScrollViewDecoratorViewNativeComponent.ts +19 -0
  331. package/src/specs/KeyboardControllerViewNativeComponent.ts +14 -3
  332. package/src/specs/KeyboardGestureAreaNativeComponent.ts +1 -0
  333. package/src/specs/KeyboardToolbarGroupViewNativeComponent.ts +10 -0
  334. package/src/specs/NativeKeyboardController.ts +6 -2
  335. package/src/types.ts +91 -5
  336. package/src/utils/findNodeHandle/index.native.ts +3 -0
  337. package/src/utils/findNodeHandle/index.ts +6 -0
  338. package/src/views/KeyboardExtender/index.tsx +30 -0
  339. package/src/views/index.ts +1 -0
  340. package/lib/commonjs/monkey-patch.android.js +0 -57
  341. package/lib/commonjs/monkey-patch.android.js.map +0 -1
  342. package/lib/commonjs/monkey-patch.js +0 -11
  343. package/lib/commonjs/monkey-patch.js.map +0 -1
  344. package/lib/module/monkey-patch.android.js +0 -47
  345. package/lib/module/monkey-patch.android.js.map +0 -1
  346. package/lib/module/monkey-patch.js +0 -5
  347. package/lib/module/monkey-patch.js.map +0 -1
  348. package/lib/typescript/monkey-patch.android.d.ts +0 -2
  349. package/lib/typescript/monkey-patch.d.ts +0 -2
  350. package/src/monkey-patch.android.ts +0 -44
  351. package/src/monkey-patch.ts +0 -4
  352. /package/harmony/keyboard_controller/{ts.ts → ts.ets} +0 -0
@@ -1,19 +1,25 @@
1
1
  import { KeyboardControllerNative, KeyboardEvents } from "./bindings";
2
- let isClosed = false;
3
- let lastEvent = null;
2
+ let isClosed = true;
3
+ let lastState = {
4
+ height: 0,
5
+ tag: -1,
6
+ duration: 0,
7
+ timestamp: new Date().getTime(),
8
+ target: -1,
9
+ type: "default",
10
+ appearance: "light"
11
+ };
4
12
  KeyboardEvents.addListener("keyboardDidHide", e => {
5
13
  isClosed = true;
6
- lastEvent = e;
14
+ lastState = e;
7
15
  });
8
16
  KeyboardEvents.addListener("keyboardDidShow", e => {
9
17
  isClosed = false;
10
- lastEvent = e;
18
+ lastState = e;
11
19
  });
12
- const dismiss = async ({
13
- keepFocus
14
- } = {
15
- keepFocus: false
16
- }) => {
20
+ const dismiss = async options => {
21
+ const keepFocus = (options === null || options === void 0 ? void 0 : options.keepFocus) ?? false;
22
+ const animated = (options === null || options === void 0 ? void 0 : options.animated) ?? true;
17
23
  return new Promise(resolve => {
18
24
  if (isClosed) {
19
25
  resolve();
@@ -23,19 +29,22 @@ const dismiss = async ({
23
29
  resolve(undefined);
24
30
  subscription.remove();
25
31
  });
26
- KeyboardControllerNative.dismiss(keepFocus);
32
+ KeyboardControllerNative.dismiss(keepFocus, animated);
27
33
  });
28
34
  };
29
35
  const isVisible = () => !isClosed;
30
- const state = () => lastEvent;
36
+ const state = () => lastState;
37
+ const preload = KeyboardControllerNative.preload ?? (() => {});
31
38
  export const KeyboardController = {
32
39
  setDefaultMode: KeyboardControllerNative.setDefaultMode,
33
40
  setInputMode: KeyboardControllerNative.setInputMode,
34
41
  setFocusTo: KeyboardControllerNative.setFocusTo,
42
+ preload,
35
43
  dismiss,
36
44
  isVisible,
37
45
  state,
38
46
  addListener: KeyboardControllerNative.addListener,
39
- removeListeners: KeyboardControllerNative.removeListeners
47
+ removeListeners: KeyboardControllerNative.removeListeners,
48
+ getConstants: KeyboardControllerNative.getConstants
40
49
  };
41
50
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["KeyboardControllerNative","KeyboardEvents","isClosed","lastEvent","addListener","e","dismiss","keepFocus","Promise","resolve","subscription","undefined","remove","isVisible","state","KeyboardController","setDefaultMode","setInputMode","setFocusTo","removeListeners"],"sources":["module.ts"],"sourcesContent":["import { KeyboardControllerNative, KeyboardEvents } from \"./bindings\";\n\nimport type {\n DismissOptions,\n KeyboardControllerModule,\n KeyboardEventData,\n} from \"./types\";\n\nlet isClosed = false;\nlet lastEvent: KeyboardEventData | null = null;\n\nKeyboardEvents.addListener(\"keyboardDidHide\", (e) => {\n isClosed = true;\n lastEvent = e;\n});\n\nKeyboardEvents.addListener(\"keyboardDidShow\", (e) => {\n isClosed = false;\n lastEvent = e;\n});\n\nconst dismiss = async (\n { keepFocus }: DismissOptions = { keepFocus: false },\n): Promise<void> => {\n return new Promise((resolve) => {\n if (isClosed) {\n resolve();\n\n return;\n }\n\n const subscription = KeyboardEvents.addListener(\"keyboardDidHide\", () => {\n resolve(undefined);\n subscription.remove();\n });\n\n KeyboardControllerNative.dismiss(keepFocus);\n });\n};\nconst isVisible = () => !isClosed;\nconst state = () => lastEvent;\n\nexport const KeyboardController: KeyboardControllerModule = {\n setDefaultMode: KeyboardControllerNative.setDefaultMode,\n setInputMode: KeyboardControllerNative.setInputMode,\n setFocusTo: KeyboardControllerNative.setFocusTo,\n dismiss,\n isVisible,\n state,\n addListener: KeyboardControllerNative.addListener,\n removeListeners: KeyboardControllerNative.removeListeners,\n};\n"],"mappings":"AAAA,SAASA,wBAAwB,EAAEC,cAAc,QAAQ,YAAY;AAQrE,IAAIC,QAAQ,GAAG,KAAK;AACpB,IAAIC,SAAmC,GAAG,IAAI;AAE9CF,cAAc,CAACG,WAAW,CAAC,iBAAiB,EAAGC,CAAC,IAAK;EACnDH,QAAQ,GAAG,IAAI;EACfC,SAAS,GAAGE,CAAC;AACf,CAAC,CAAC;AAEFJ,cAAc,CAACG,WAAW,CAAC,iBAAiB,EAAGC,CAAC,IAAK;EACnDH,QAAQ,GAAG,KAAK;EAChBC,SAAS,GAAGE,CAAC;AACf,CAAC,CAAC;AAEF,MAAMC,OAAO,GAAG,MAAAA,CACd;EAAEC;AAA0B,CAAC,GAAG;EAAEA,SAAS,EAAE;AAAM,CAAC,KAClC;EAClB,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;IAC9B,IAAIP,QAAQ,EAAE;MACZO,OAAO,CAAC,CAAC;MAET;IACF;IAEA,MAAMC,YAAY,GAAGT,cAAc,CAACG,WAAW,CAAC,iBAAiB,EAAE,MAAM;MACvEK,OAAO,CAACE,SAAS,CAAC;MAClBD,YAAY,CAACE,MAAM,CAAC,CAAC;IACvB,CAAC,CAAC;IAEFZ,wBAAwB,CAACM,OAAO,CAACC,SAAS,CAAC;EAC7C,CAAC,CAAC;AACJ,CAAC;AACD,MAAMM,SAAS,GAAGA,CAAA,KAAM,CAACX,QAAQ;AACjC,MAAMY,KAAK,GAAGA,CAAA,KAAMX,SAAS;AAE7B,OAAO,MAAMY,kBAA4C,GAAG;EAC1DC,cAAc,EAAEhB,wBAAwB,CAACgB,cAAc;EACvDC,YAAY,EAAEjB,wBAAwB,CAACiB,YAAY;EACnDC,UAAU,EAAElB,wBAAwB,CAACkB,UAAU;EAC/CZ,OAAO;EACPO,SAAS;EACTC,KAAK;EACLV,WAAW,EAAEJ,wBAAwB,CAACI,WAAW;EACjDe,eAAe,EAAEnB,wBAAwB,CAACmB;AAC5C,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["KeyboardControllerNative","KeyboardEvents","isClosed","lastState","height","tag","duration","timestamp","Date","getTime","target","type","appearance","addListener","e","dismiss","options","keepFocus","animated","Promise","resolve","subscription","undefined","remove","isVisible","state","preload","KeyboardController","setDefaultMode","setInputMode","setFocusTo","removeListeners","getConstants"],"sources":["module.ts"],"sourcesContent":["import { KeyboardControllerNative, KeyboardEvents } from \"./bindings\";\n\nimport type {\n DismissOptions,\n KeyboardControllerModule,\n KeyboardEventData,\n} from \"./types\";\n\nlet isClosed = true;\nlet lastState: KeyboardEventData = {\n height: 0,\n tag: -1,\n duration: 0,\n timestamp: new Date().getTime(),\n target: -1,\n type: \"default\",\n appearance: \"light\",\n};\n\nKeyboardEvents.addListener(\"keyboardDidHide\", (e) => {\n isClosed = true;\n lastState = e;\n});\n\nKeyboardEvents.addListener(\"keyboardDidShow\", (e) => {\n isClosed = false;\n lastState = e;\n});\n\nconst dismiss = async (options?: Partial<DismissOptions>): Promise<void> => {\n const keepFocus = options?.keepFocus ?? false;\n const animated = options?.animated ?? true;\n\n return new Promise((resolve) => {\n if (isClosed) {\n resolve();\n\n return;\n }\n\n const subscription = KeyboardEvents.addListener(\"keyboardDidHide\", () => {\n resolve(undefined);\n subscription.remove();\n });\n\n KeyboardControllerNative.dismiss(keepFocus, animated);\n });\n};\nconst isVisible = () => !isClosed;\nconst state = () => lastState;\nconst preload = KeyboardControllerNative.preload ?? (() => {});\n\nexport const KeyboardController: KeyboardControllerModule = {\n setDefaultMode: KeyboardControllerNative.setDefaultMode,\n setInputMode: KeyboardControllerNative.setInputMode,\n setFocusTo: KeyboardControllerNative.setFocusTo,\n preload,\n dismiss,\n isVisible,\n state,\n addListener: KeyboardControllerNative.addListener,\n removeListeners: KeyboardControllerNative.removeListeners,\n getConstants: KeyboardControllerNative.getConstants,\n};\n"],"mappings":"AAAA,SAASA,wBAAwB,EAAEC,cAAc,QAAQ,YAAY;AAQrE,IAAIC,QAAQ,GAAG,IAAI;AACnB,IAAIC,SAA4B,GAAG;EACjCC,MAAM,EAAE,CAAC;EACTC,GAAG,EAAE,CAAC,CAAC;EACPC,QAAQ,EAAE,CAAC;EACXC,SAAS,EAAE,IAAIC,IAAI,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC;EAC/BC,MAAM,EAAE,CAAC,CAAC;EACVC,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE;AACd,CAAC;AAEDX,cAAc,CAACY,WAAW,CAAC,iBAAiB,EAAGC,CAAC,IAAK;EACnDZ,QAAQ,GAAG,IAAI;EACfC,SAAS,GAAGW,CAAC;AACf,CAAC,CAAC;AAEFb,cAAc,CAACY,WAAW,CAAC,iBAAiB,EAAGC,CAAC,IAAK;EACnDZ,QAAQ,GAAG,KAAK;EAChBC,SAAS,GAAGW,CAAC;AACf,CAAC,CAAC;AAEF,MAAMC,OAAO,GAAG,MAAOC,OAAiC,IAAoB;EAC1E,MAAMC,SAAS,GAAG,CAAAD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,SAAS,KAAI,KAAK;EAC7C,MAAMC,QAAQ,GAAG,CAAAF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,QAAQ,KAAI,IAAI;EAE1C,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;IAC9B,IAAIlB,QAAQ,EAAE;MACZkB,OAAO,CAAC,CAAC;MAET;IACF;IAEA,MAAMC,YAAY,GAAGpB,cAAc,CAACY,WAAW,CAAC,iBAAiB,EAAE,MAAM;MACvEO,OAAO,CAACE,SAAS,CAAC;MAClBD,YAAY,CAACE,MAAM,CAAC,CAAC;IACvB,CAAC,CAAC;IAEFvB,wBAAwB,CAACe,OAAO,CAACE,SAAS,EAAEC,QAAQ,CAAC;EACvD,CAAC,CAAC;AACJ,CAAC;AACD,MAAMM,SAAS,GAAGA,CAAA,KAAM,CAACtB,QAAQ;AACjC,MAAMuB,KAAK,GAAGA,CAAA,KAAMtB,SAAS;AAC7B,MAAMuB,OAAO,GAAG1B,wBAAwB,CAAC0B,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC;AAE9D,OAAO,MAAMC,kBAA4C,GAAG;EAC1DC,cAAc,EAAE5B,wBAAwB,CAAC4B,cAAc;EACvDC,YAAY,EAAE7B,wBAAwB,CAAC6B,YAAY;EACnDC,UAAU,EAAE9B,wBAAwB,CAAC8B,UAAU;EAC/CJ,OAAO;EACPX,OAAO;EACPS,SAAS;EACTC,KAAK;EACLZ,WAAW,EAAEb,wBAAwB,CAACa,WAAW;EACjDkB,eAAe,EAAE/B,wBAAwB,CAAC+B,eAAe;EACzDC,YAAY,EAAEhC,wBAAwB,CAACgC;AACzC,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ import { codegenNativeComponent } from "react-native";
2
+ export default codegenNativeComponent("ClippingScrollViewDecoratorView", {
3
+ interfaceOnly: true,
4
+ excludedPlatforms: ["iOS"]
5
+ });
6
+ //# sourceMappingURL=ClippingScrollViewDecoratorViewNativeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["codegenNativeComponent","interfaceOnly","excludedPlatforms"],"sources":["ClippingScrollViewDecoratorViewNativeComponent.ts"],"sourcesContent":["import { codegenNativeComponent } from \"react-native\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native\";\nimport type { Double } from \"react-native/Libraries/Types/CodegenTypes\";\n\nexport interface NativeProps extends ViewProps {\n contentInsetBottom: Double;\n contentInsetTop: Double;\n applyWorkaroundForContentInsetHitTestBug?: boolean;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n \"ClippingScrollViewDecoratorView\",\n {\n interfaceOnly: true,\n excludedPlatforms: [\"iOS\"],\n },\n) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,SAASA,sBAAsB,QAAQ,cAAc;AAYrD,eAAeA,sBAAsB,CACnC,iCAAiC,EACjC;EACEC,aAAa,EAAE,IAAI;EACnBC,iBAAiB,EAAE,CAAC,KAAK;AAC3B,CACF,CAAC","ignoreList":[]}
@@ -1,3 +1,9 @@
1
+ import codegenNativeCommands from "react-native/Libraries/Utilities/codegenNativeCommands";
1
2
  import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
2
- export default codegenNativeComponent("RNKeyboardControllerView");
3
+ export const Commands = codegenNativeCommands({
4
+ supportedCommands: ["synchronizeFocusedInputLayout"]
5
+ });
6
+ export default codegenNativeComponent("RNKeyboardControllerView", {
7
+ interfaceOnly: true
8
+ });
3
9
  //# sourceMappingURL=KeyboardControllerViewNativeComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["codegenNativeComponent"],"sources":["KeyboardControllerViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\nimport type {\n DirectEventHandler,\n Double,\n Int32,\n} from \"react-native/Libraries/Types/CodegenTypes\";\n\ntype KeyboardMoveEvent = Readonly<{\n height: Double;\n progress: Double;\n duration: Int32;\n target: Int32;\n}>;\n\ntype FocusedInputLayoutChangedEvent = Readonly<{\n target: Int32;\n parentScrollViewTarget: Int32;\n layout: {\n x: Double;\n y: Double;\n width: Double;\n height: Double;\n absoluteX: Double;\n absoluteY: Double;\n };\n}>;\n\ntype FocusedInputTextChangedEvent = Readonly<{\n text: string;\n}>;\n\ntype FocusedInputSelectionChangedEvent = Readonly<{\n target: Int32;\n selection: {\n start: {\n x: Double;\n y: Double;\n position: Int32;\n };\n end: {\n x: Double;\n y: Double;\n position: Int32;\n };\n };\n}>;\n\nexport interface NativeProps extends ViewProps {\n // props\n enabled?: boolean;\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n preserveEdgeToEdge?: boolean;\n // callbacks\n /// keyboard\n onKeyboardMoveStart?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveEnd?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveInteractive?: DirectEventHandler<KeyboardMoveEvent>;\n /// focused input\n onFocusedInputLayoutChanged?: DirectEventHandler<FocusedInputLayoutChangedEvent>;\n onFocusedInputTextChanged?: DirectEventHandler<FocusedInputTextChangedEvent>;\n onFocusedInputSelectionChanged?: DirectEventHandler<FocusedInputSelectionChangedEvent>;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n \"RNKeyboardControllerView\",\n) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAoE5F,eAAeA,sBAAsB,CACnC,0BACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["codegenNativeCommands","codegenNativeComponent","Commands","supportedCommands","interfaceOnly"],"sources":["KeyboardControllerViewNativeComponent.ts"],"sourcesContent":["import codegenNativeCommands from \"react-native/Libraries/Utilities/codegenNativeCommands\";\nimport codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\nimport type {\n DirectEventHandler,\n Double,\n Int32,\n} from \"react-native/Libraries/Types/CodegenTypes\";\n\ntype KeyboardMoveEvent = Readonly<{\n height: Double;\n progress: Double;\n duration: Int32;\n target: Int32;\n}>;\n\ntype FocusedInputLayoutChangedEvent = Readonly<{\n target: Int32;\n parentScrollViewTarget: Int32;\n layout: {\n x: Double;\n y: Double;\n width: Double;\n height: Double;\n absoluteX: Double;\n absoluteY: Double;\n };\n}>;\n\ntype FocusedInputTextChangedEvent = Readonly<{\n text: string;\n}>;\n\ntype FocusedInputSelectionChangedEvent = Readonly<{\n target: Int32;\n selection: {\n start: {\n x: Double;\n y: Double;\n position: Int32;\n };\n end: {\n x: Double;\n y: Double;\n position: Int32;\n };\n };\n}>;\n\nexport interface NativeProps extends ViewProps {\n // props\n enabled?: boolean;\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n preserveEdgeToEdge?: boolean;\n // callbacks\n /// keyboard\n onKeyboardMoveStart?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveEnd?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveInteractive?: DirectEventHandler<KeyboardMoveEvent>;\n /// focused input\n onFocusedInputLayoutChanged?: DirectEventHandler<FocusedInputLayoutChangedEvent>;\n onFocusedInputTextChanged?: DirectEventHandler<FocusedInputTextChangedEvent>;\n onFocusedInputSelectionChanged?: DirectEventHandler<FocusedInputSelectionChangedEvent>;\n}\n\ninterface NativeCommands {\n synchronizeFocusedInputLayout: (\n viewRef: React.ElementRef<HostComponent<NativeProps>>,\n ) => void;\n}\n\nexport const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({\n supportedCommands: [\"synchronizeFocusedInputLayout\"],\n});\n\nexport default codegenNativeComponent<NativeProps>(\"RNKeyboardControllerView\", {\n interfaceOnly: true,\n}) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,qBAAqB,MAAM,wDAAwD;AAC1F,OAAOC,sBAAsB,MAAM,yDAAyD;AA0E5F,OAAO,MAAMC,QAAwB,GAAGF,qBAAqB,CAAiB;EAC5EG,iBAAiB,EAAE,CAAC,+BAA+B;AACrD,CAAC,CAAC;AAEF,eAAeF,sBAAsB,CAAc,0BAA0B,EAAE;EAC7EG,aAAa,EAAE;AACjB,CAAC,CAAC","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
2
2
  export default codegenNativeComponent("RNKeyboardGestureArea", {
3
- excludedPlatforms: ["iOS"]
3
+ excludedPlatforms: ["iOS"],
4
+ interfaceOnly: true
4
5
  });
5
6
  //# sourceMappingURL=KeyboardGestureAreaNativeComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["codegenNativeComponent","excludedPlatforms"],"sources":["KeyboardGestureAreaNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\nimport type {\n Double,\n WithDefault,\n} from \"react-native/Libraries/Types/CodegenTypes\";\n\nexport interface NativeProps extends ViewProps {\n interpolator?: WithDefault<\"linear\" | \"ios\", \"linear\">;\n showOnSwipeUp?: boolean;\n enableSwipeToDismiss?: boolean;\n offset?: Double;\n textInputNativeID?: string;\n}\n\nexport default codegenNativeComponent<NativeProps>(\"RNKeyboardGestureArea\", {\n excludedPlatforms: [\"iOS\"],\n}) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAiB5F,eAAeA,sBAAsB,CAAc,uBAAuB,EAAE;EAC1EC,iBAAiB,EAAE,CAAC,KAAK;AAC3B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["codegenNativeComponent","excludedPlatforms","interfaceOnly"],"sources":["KeyboardGestureAreaNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\nimport type {\n Double,\n WithDefault,\n} from \"react-native/Libraries/Types/CodegenTypes\";\n\nexport interface NativeProps extends ViewProps {\n interpolator?: WithDefault<\"linear\" | \"ios\", \"linear\">;\n showOnSwipeUp?: boolean;\n enableSwipeToDismiss?: boolean;\n offset?: Double;\n textInputNativeID?: string;\n}\n\nexport default codegenNativeComponent<NativeProps>(\"RNKeyboardGestureArea\", {\n excludedPlatforms: [\"iOS\"],\n interfaceOnly: true,\n}) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAiB5F,eAAeA,sBAAsB,CAAc,uBAAuB,EAAE;EAC1EC,iBAAiB,EAAE,CAAC,KAAK,CAAC;EAC1BC,aAAa,EAAE;AACjB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
2
+ export default codegenNativeComponent("KeyboardToolbarGroupView", {
3
+ interfaceOnly: true
4
+ });
5
+ //# sourceMappingURL=KeyboardToolbarGroupViewNativeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["codegenNativeComponent","interfaceOnly"],"sources":["KeyboardToolbarGroupViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\n\nexport interface NativeProps extends ViewProps {}\n\nexport default codegenNativeComponent<NativeProps>(\"KeyboardToolbarGroupView\", {\n interfaceOnly: true,\n}) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAO5F,eAAeA,sBAAsB,CAAc,0BAA0B,EAAE;EAC7EC,aAAa,EAAE;AACjB,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeKeyboardController.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\n\nimport type { TurboModule } from \"react-native\";\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n // methods\n setInputMode(mode: number): void;\n setDefaultMode(): void;\n dismiss(keepFocus: boolean): void;\n setFocusTo(direction: string): void;\n\n // event emitter\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n}\n\nexport default TurboModuleRegistry.get<Spec>(\"KeyboardController\");\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAkBlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeKeyboardController.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\n\nimport type { TurboModule } from \"react-native\";\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {\n keyboardBorderRadius: number;\n };\n\n // methods\n setInputMode(mode: number): void;\n setDefaultMode(): void;\n preload(): void;\n dismiss(keepFocus: boolean, animated: boolean): void;\n setFocusTo(direction: string): void;\n viewPositionInWindow(viewTag: number): Promise<object>;\n\n // event emitter\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n}\n\nexport default TurboModuleRegistry.get<Spec>(\"KeyboardController\");\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAsBlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport type {\n EmitterSubscription,\n NativeSyntheticEvent,\n TextInputProps,\n ViewProps,\n} from \"react-native\";\n\n// DirectEventHandler events declaration\nexport type NativeEvent = {\n progress: number;\n height: number;\n duration: number;\n target: number;\n};\nexport type FocusedInputLayoutChangedEvent = {\n target: number;\n parentScrollViewTarget: number;\n layout: {\n x: number;\n y: number;\n width: number;\n height: number;\n absoluteX: number;\n absoluteY: number;\n };\n};\nexport type FocusedInputTextChangedEvent = {\n text: string;\n};\nexport type FocusedInputSelectionChangedEvent = {\n target: number;\n selection: {\n start: {\n x: number;\n y: number;\n position: number;\n };\n end: {\n x: number;\n y: number;\n position: number;\n };\n };\n};\nexport type EventWithName<T> = {\n eventName: string;\n} & T;\n\n// native View/Module declarations\nexport type KeyboardControllerProps = {\n // callback props\n onKeyboardMoveStart?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMove?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveEnd?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveInteractive?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n onFocusedInputSelectionChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\n ) => void;\n // fake props used to activate reanimated bindings\n onKeyboardMoveReanimated?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n onFocusedInputSelectionChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\n ) => void;\n // props\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n preserveEdgeToEdge?: boolean;\n enabled?: boolean;\n} & ViewProps;\n\nexport type KeyboardGestureAreaProps = {\n interpolator?: \"ios\" | \"linear\";\n /**\n * Whether to allow to show a keyboard from dismissed state by swipe up.\n * Default to `false`.\n */\n showOnSwipeUp?: boolean;\n /**\n * Whether to allow to control a keyboard by gestures. The strategy how\n * it should be controlled is determined by `interpolator` property.\n * Defaults to `true`.\n */\n enableSwipeToDismiss?: boolean;\n /**\n * Extra distance to the keyboard.\n */\n offset?: number;\n /**\n * A corresponding `nativeID` value from the corresponding `TextInput`.\n */\n textInputNativeID?: string;\n} & ViewProps;\n\nexport type OverKeyboardViewProps = PropsWithChildren<{\n visible: boolean;\n}>;\n\nexport type Direction = \"next\" | \"prev\" | \"current\";\nexport type DismissOptions = {\n keepFocus: boolean;\n};\nexport type KeyboardControllerModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // all platforms\n dismiss: (options?: DismissOptions) => Promise<void>;\n setFocusTo: (direction: Direction) => void;\n isVisible: () => boolean;\n state: () => KeyboardEventData | null;\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n};\nexport type KeyboardControllerNativeModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // all platforms\n dismiss: (keepFocus: boolean) => void;\n setFocusTo: (direction: Direction) => void;\n // native event module stuff\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n};\n\n// Event module declarations\nexport type KeyboardControllerEvents =\n | \"keyboardWillShow\"\n | \"keyboardDidShow\"\n | \"keyboardWillHide\"\n | \"keyboardDidHide\";\nexport type KeyboardEventData = {\n height: number;\n tag: number;\n duration: number;\n timestamp: number;\n target: number;\n type: NonNullable<TextInputProps[\"keyboardType\"]>;\n appearance: NonNullable<TextInputProps[\"keyboardAppearance\"]>;\n};\nexport type KeyboardEventsModule = {\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEventData) => void,\n ) => EmitterSubscription;\n};\nexport type FocusedInputAvailableEvents = \"focusDidSet\";\nexport type FocusedInputEventData = {\n current: number;\n count: number;\n};\nexport type FocusedInputEventsModule = {\n addListener: (\n name: FocusedInputAvailableEvents,\n cb: (e: FocusedInputEventData) => void,\n ) => EmitterSubscription;\n};\nexport type WindowDimensionsAvailableEvents = \"windowDidResize\";\nexport type WindowDimensionsEventData = {\n width: number;\n height: number;\n};\nexport type WindowDimensionsEventsModule = {\n addListener: (\n name: WindowDimensionsAvailableEvents,\n cb: (e: WindowDimensionsEventData) => void,\n ) => EmitterSubscription;\n};\n\n// reanimated hook declaration\nexport type KeyboardHandlerHook<TContext, Event> = (\n handlers: {\n onKeyboardMoveStart?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMove?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveEnd?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveInteractive?: (e: NativeEvent, context: TContext) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputLayoutHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputLayoutChanged?: (\n e: FocusedInputLayoutChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputTextHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputTextChanged?: (\n e: FocusedInputTextChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputSelectionHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputSelectionChanged?: (\n e: FocusedInputSelectionChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\n\n// package types\nexport type Handlers<T> = Record<string, T | undefined>;\nexport type KeyboardHandler = Partial<{\n onStart: (e: NativeEvent) => void;\n onMove: (e: NativeEvent) => void;\n onEnd: (e: NativeEvent) => void;\n onInteractive: (e: NativeEvent) => void;\n}>;\nexport type KeyboardHandlers = Handlers<KeyboardHandler>;\nexport type FocusedInputHandler = Partial<{\n onChangeText: (e: FocusedInputTextChangedEvent) => void;\n onSelectionChange: (e: FocusedInputSelectionChangedEvent) => void;\n}>;\nexport type FocusedInputHandlers = Handlers<FocusedInputHandler>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport type {\n EmitterSubscription,\n NativeSyntheticEvent,\n TextInputProps,\n ViewProps,\n} from \"react-native\";\n\nexport type KeyboardProviderProps = {\n children: React.ReactNode;\n /**\n * Set the value to `true`, if you use translucent status bar on Android.\n * If you already control status bar translucency via `react-native-screens`\n * or `StatusBar` component from `react-native`, you can ignore it.\n * Defaults to `false`.\n *\n * @platform android\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/14\n */\n statusBarTranslucent?: boolean;\n /**\n * Set the value to `true`, if you use translucent navigation bar on Android.\n * Defaults to `false`.\n *\n * @platform android\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/119\n */\n navigationBarTranslucent?: boolean;\n /**\n * A boolean property indicating whether to keep edge-to-edge mode always enabled (even when you disable the module).\n * Defaults to `false`.\n *\n * @platform android\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/592\n */\n preserveEdgeToEdge?: boolean;\n /**\n * A boolean prop indicating whether the module is enabled. It indicate only initial state\n * (if you try to change this prop after component mount it will not have any effect).\n * To change the property in runtime use `useKeyboardController` hook and `setEnabled` method.\n * Defaults to `true`.\n */\n enabled?: boolean;\n /**\n * A boolean prop indicating whether to preload the keyboard to reduce time-to-interaction (TTI) on first input focus.\n * Defaults to `true`.\n *\n * @platform ios\n */\n preload?: boolean;\n};\n\n// DirectEventHandler events declaration\nexport type NativeEvent = {\n progress: number;\n height: number;\n duration: number;\n target: number;\n};\nexport type FocusedInputLayoutChangedEvent = {\n target: number;\n parentScrollViewTarget: number;\n layout: {\n x: number;\n y: number;\n width: number;\n height: number;\n absoluteX: number;\n absoluteY: number;\n };\n};\nexport type FocusedInputTextChangedEvent = {\n text: string;\n};\nexport type FocusedInputSelectionChangedEvent = {\n target: number;\n selection: {\n start: {\n x: number;\n y: number;\n position: number;\n };\n end: {\n x: number;\n y: number;\n position: number;\n };\n };\n};\nexport type EventWithName<T> = {\n eventName: string;\n} & T;\n\n// native View/Module declarations\nexport type KeyboardControllerProps = {\n // callback props\n onKeyboardMoveStart?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMove?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveEnd?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveInteractive?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n onFocusedInputSelectionChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\n ) => void;\n // fake props used to activate reanimated bindings\n onKeyboardMoveReanimated?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n onFocusedInputSelectionChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\n ) => void;\n // props\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n preserveEdgeToEdge?: boolean;\n enabled?: boolean;\n} & ViewProps;\n\nexport type KeyboardGestureAreaProps = {\n interpolator?: \"ios\" | \"linear\";\n /**\n * Whether to allow to show a keyboard from dismissed state by swipe up.\n * Default to `false`.\n */\n showOnSwipeUp?: boolean;\n /**\n * Whether to allow to control a keyboard by gestures. The strategy how\n * it should be controlled is determined by `interpolator` property.\n * Defaults to `true`.\n */\n enableSwipeToDismiss?: boolean;\n /**\n * Extra distance to the keyboard.\n */\n offset?: number;\n /**\n * A corresponding `nativeID` value from the corresponding `TextInput`.\n */\n textInputNativeID?: string;\n} & ViewProps;\n\nexport type OverKeyboardViewProps = PropsWithChildren<{\n visible: boolean;\n}>;\nexport type ClippingScrollViewProps = PropsWithChildren<\n ViewProps & {\n /** An additional space that gets applied to the bottom of the ScrollView content. Default is 0. */\n contentInsetBottom?: number;\n /** An additional space that gets applied to the top of the ScrollView content. Default is 0. */\n contentInsetTop?: number;\n applyWorkaroundForContentInsetHitTestBug?: boolean;\n }\n>;\nexport type KeyboardBackgroundViewProps = PropsWithChildren<ViewProps>;\nexport type KeyboardToolbarGroupViewProps = PropsWithChildren<ViewProps>;\nexport type KeyboardExtenderProps = PropsWithChildren<{\n /** Controls whether this `KeyboardExtender` instance should take effect. Default is `true`. */\n enabled?: boolean;\n}>;\n\nexport type Direction = \"next\" | \"prev\" | \"current\";\nexport type DismissOptions = {\n keepFocus: boolean;\n animated: boolean;\n};\nexport type KeyboardControllerModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // ios only\n preload: () => void;\n // all platforms\n dismiss: (options?: Partial<DismissOptions>) => Promise<void>;\n setFocusTo: (direction: Direction) => void;\n isVisible: () => boolean;\n state: () => KeyboardEventData;\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n // constants\n getConstants: () => {\n keyboardBorderRadius: number;\n };\n};\nexport type ViewPositionInWindowResult = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\nexport type KeyboardControllerNativeModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // ios only\n preload: () => void;\n // all platforms\n dismiss: (keepFocus: boolean, animated: boolean) => void;\n setFocusTo: (direction: Direction) => void;\n viewPositionInWindow: (\n viewTag: number,\n ) => Promise<ViewPositionInWindowResult>;\n // constants\n getConstants: () => {\n keyboardBorderRadius: number;\n };\n // native event module stuff\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n};\n\n// Event module declarations\nexport type KeyboardControllerEvents =\n | \"keyboardWillShow\"\n | \"keyboardDidShow\"\n | \"keyboardWillHide\"\n | \"keyboardDidHide\";\nexport type KeyboardEventData = {\n height: number;\n tag: number;\n duration: number;\n timestamp: number;\n target: number;\n type: NonNullable<TextInputProps[\"keyboardType\"]>;\n appearance: \"dark\" | \"light\";\n};\nexport type IKeyboardState = {\n isVisible: boolean;\n} & KeyboardEventData;\nexport type KeyboardEventsModule = {\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEventData) => void,\n ) => EmitterSubscription;\n};\nexport type FocusedInputAvailableEvents =\n | \"focusDidSet\"\n | \"layoutDidSynchronize\";\nexport type FocusedInputEventData = {\n current: number;\n count: number;\n};\nexport type FocusedInputEventsModule = {\n addListener: (\n name: FocusedInputAvailableEvents,\n cb: (e: FocusedInputEventData) => void,\n ) => EmitterSubscription;\n};\nexport type WindowDimensionsAvailableEvents = \"windowDidResize\";\nexport type WindowDimensionsEventData = {\n width: number;\n height: number;\n};\nexport type WindowDimensionsEventsModule = {\n addListener: (\n name: WindowDimensionsAvailableEvents,\n cb: (e: WindowDimensionsEventData) => void,\n ) => EmitterSubscription;\n};\n\n// reanimated hook declaration\nexport type KeyboardHandlerHook<TContext, Event> = (\n handlers: {\n onKeyboardMoveStart?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMove?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveEnd?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveInteractive?: (e: NativeEvent, context: TContext) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputLayoutHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputLayoutChanged?: (\n e: FocusedInputLayoutChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputTextHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputTextChanged?: (\n e: FocusedInputTextChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputSelectionHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputSelectionChanged?: (\n e: FocusedInputSelectionChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\n\n// package types\nexport type Handlers<T> = Record<string, T | undefined>;\nexport type KeyboardHandler = Partial<{\n onStart: (e: NativeEvent) => void;\n onMove: (e: NativeEvent) => void;\n onEnd: (e: NativeEvent) => void;\n onInteractive: (e: NativeEvent) => void;\n}>;\nexport type KeyboardHandlers = Handlers<KeyboardHandler>;\nexport type FocusedInputHandler = Partial<{\n onChangeText: (e: FocusedInputTextChangedEvent) => void;\n onSelectionChange: (e: FocusedInputSelectionChangedEvent) => void;\n}>;\nexport type FocusedInputHandlers = Handlers<FocusedInputHandler>;\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export const findNodeHandle = componentOrHandle => componentOrHandle;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["findNodeHandle","componentOrHandle"],"sources":["index.ts"],"sourcesContent":["import type { findNodeHandle as findNodeHandleRN } from \"react-native\";\n\ntype FindNodeHandleRN = typeof findNodeHandleRN;\n\nexport const findNodeHandle: FindNodeHandleRN = (componentOrHandle) =>\n componentOrHandle as number | null;\n"],"mappings":"AAIA,OAAO,MAAMA,cAAgC,GAAIC,iBAAiB,IAChEA,iBAAkC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import { findNodeHandle } from "react-native";
2
+ export { findNodeHandle };
3
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["findNodeHandle"],"sources":["index.native.ts"],"sourcesContent":["import { findNodeHandle } from \"react-native\";\n\nexport { findNodeHandle };\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,cAAc;AAE7C,SAASA,cAAc","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { Animated } from "react-native";
3
+ import { KeyboardBackgroundView } from "../../bindings";
4
+ import { KeyboardStickyView } from "../../components";
5
+ import { useKeyboardAnimation } from "../../hooks";
6
+ const AnimatedKeyboardBackgroundView = Animated.createAnimatedComponent(KeyboardBackgroundView);
7
+ const KeyboardExtender = ({
8
+ children,
9
+ enabled = true
10
+ }) => {
11
+ const {
12
+ progress
13
+ } = useKeyboardAnimation();
14
+ return /*#__PURE__*/React.createElement(KeyboardStickyView, {
15
+ enabled: enabled
16
+ }, /*#__PURE__*/React.createElement(AnimatedKeyboardBackgroundView, {
17
+ style: {
18
+ opacity: progress
19
+ }
20
+ }, children));
21
+ };
22
+ export default KeyboardExtender;
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Animated","KeyboardBackgroundView","KeyboardStickyView","useKeyboardAnimation","AnimatedKeyboardBackgroundView","createAnimatedComponent","KeyboardExtender","children","enabled","progress","createElement","style","opacity"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport { Animated } from \"react-native\";\n\nimport { KeyboardBackgroundView } from \"../../bindings\";\nimport { KeyboardStickyView } from \"../../components\";\nimport { useKeyboardAnimation } from \"../../hooks\";\n\nimport type { KeyboardExtenderProps } from \"../../types\";\nimport type { PropsWithChildren } from \"react\";\n\nconst AnimatedKeyboardBackgroundView = Animated.createAnimatedComponent(\n KeyboardBackgroundView,\n);\n\nconst KeyboardExtender = ({\n children,\n enabled = true,\n}: PropsWithChildren<KeyboardExtenderProps>) => {\n const { progress } = useKeyboardAnimation();\n\n return (\n <KeyboardStickyView enabled={enabled}>\n <AnimatedKeyboardBackgroundView style={{ opacity: progress }}>\n {children}\n </AnimatedKeyboardBackgroundView>\n </KeyboardStickyView>\n );\n};\n\nexport default KeyboardExtender;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,cAAc;AAEvC,SAASC,sBAAsB,QAAQ,gBAAgB;AACvD,SAASC,kBAAkB,QAAQ,kBAAkB;AACrD,SAASC,oBAAoB,QAAQ,aAAa;AAKlD,MAAMC,8BAA8B,GAAGJ,QAAQ,CAACK,uBAAuB,CACrEJ,sBACF,CAAC;AAED,MAAMK,gBAAgB,GAAGA,CAAC;EACxBC,QAAQ;EACRC,OAAO,GAAG;AAC8B,CAAC,KAAK;EAC9C,MAAM;IAAEC;EAAS,CAAC,GAAGN,oBAAoB,CAAC,CAAC;EAE3C,oBACEJ,KAAA,CAAAW,aAAA,CAACR,kBAAkB;IAACM,OAAO,EAAEA;EAAQ,gBACnCT,KAAA,CAAAW,aAAA,CAACN,8BAA8B;IAACO,KAAK,EAAE;MAAEC,OAAO,EAAEH;IAAS;EAAE,GAC1DF,QAC6B,CACd,CAAC;AAEzB,CAAC;AAED,eAAeD,gBAAgB","ignoreList":[]}
@@ -1,2 +1,3 @@
1
1
  export { default as OverKeyboardView } from "./OverKeyboardView";
2
+ export { default as KeyboardExtender } from "./KeyboardExtender";
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default","OverKeyboardView"],"sources":["index.ts"],"sourcesContent":["export { default as OverKeyboardView } from \"./OverKeyboardView\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,gBAAgB,QAAQ,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["default","OverKeyboardView","KeyboardExtender"],"sources":["index.ts"],"sourcesContent":["export { default as OverKeyboardView } from \"./OverKeyboardView\";\nexport { default as KeyboardExtender } from \"./KeyboardExtender\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,gBAAgB,QAAQ,oBAAoB;AAChE,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,oBAAoB","ignoreList":[]}
@@ -1,39 +1,3 @@
1
1
  import React from "react";
2
- type KeyboardProviderProps = {
3
- children: React.ReactNode;
4
- /**
5
- * Set the value to `true`, if you use translucent status bar on Android.
6
- * If you already control status bar translucency via `react-native-screens`
7
- * or `StatusBar` component from `react-native`, you can ignore it.
8
- * Defaults to `false`.
9
- *
10
- * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/14
11
- * @platform android
12
- */
13
- statusBarTranslucent?: boolean;
14
- /**
15
- * Set the value to `true`, if you use translucent navigation bar on Android.
16
- * Defaults to `false`.
17
- *
18
- * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/119
19
- * @platform android
20
- */
21
- navigationBarTranslucent?: boolean;
22
- /**
23
- * A boolean property indicating whether to keep edge-to-edge mode always enabled (even when you disable the module).
24
- * Defaults to `false`.
25
- *
26
- * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/592
27
- * @platform android
28
- */
29
- preserveEdgeToEdge?: boolean;
30
- /**
31
- * A boolean prop indicating whether the module is enabled. It indicate only initial state,
32
- * i. e. if you try to change this prop after component mount it will not have any effect.
33
- * To change the property in runtime use `useKeyboardController` hook and `setEnabled` method.
34
- * Defaults to `true`.
35
- */
36
- enabled?: boolean;
37
- };
38
- export declare const KeyboardProvider: ({ children, statusBarTranslucent, navigationBarTranslucent, preserveEdgeToEdge, enabled: initiallyEnabled, }: KeyboardProviderProps) => React.JSX.Element;
39
- export {};
2
+ import type { KeyboardProviderProps } from "./types";
3
+ export declare const KeyboardProvider: ({ children, statusBarTranslucent, navigationBarTranslucent, preserveEdgeToEdge, enabled: initiallyEnabled, preload, }: KeyboardProviderProps) => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const IS_FABRIC: boolean;
@@ -1,4 +1,6 @@
1
- import type { FocusedInputEventsModule, KeyboardControllerNativeModule, KeyboardControllerProps, KeyboardEventsModule, KeyboardGestureAreaProps, OverKeyboardViewProps, WindowDimensionsEventsModule } from "./types";
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import type { ClippingScrollViewProps, FocusedInputEventsModule, KeyboardControllerNativeModule, KeyboardControllerProps, KeyboardEventsModule, KeyboardExtenderProps, KeyboardGestureAreaProps, KeyboardToolbarGroupViewProps, OverKeyboardViewProps, WindowDimensionsEventsModule } from "./types";
2
4
  export declare const KeyboardControllerNative: KeyboardControllerNativeModule;
3
5
  export declare const KeyboardEvents: KeyboardEventsModule;
4
6
  /**
@@ -8,5 +10,17 @@ export declare const KeyboardEvents: KeyboardEventsModule;
8
10
  export declare const FocusedInputEvents: FocusedInputEventsModule;
9
11
  export declare const WindowDimensionsEvents: WindowDimensionsEventsModule;
10
12
  export declare const KeyboardControllerView: React.FC<KeyboardControllerProps>;
13
+ export declare const KeyboardControllerViewCommands: {
14
+ synchronizeFocusedInputLayout: (_ref: React.Component<KeyboardControllerProps> | null) => void;
15
+ };
11
16
  export declare const KeyboardGestureArea: React.FC<KeyboardGestureAreaProps>;
12
17
  export declare const RCTOverKeyboardView: React.FC<OverKeyboardViewProps>;
18
+ export declare const ClippingScrollView: React.FC<ClippingScrollViewProps>;
19
+ export declare const KeyboardBackgroundView: React.ForwardRefExoticComponent<import("react-native").ViewProps & {
20
+ children?: React.ReactNode | undefined;
21
+ } & React.RefAttributes<View>>;
22
+ export declare const RCTKeyboardExtender: React.FC<KeyboardExtenderProps>;
23
+ /**
24
+ * A View that defines a group of `TextInput`s for toolbar navigation.
25
+ */
26
+ export declare const RCTKeyboardToolbarGroupView: React.FC<KeyboardToolbarGroupViewProps>;
@@ -1,4 +1,6 @@
1
- import type { FocusedInputEventsModule, KeyboardControllerNativeModule, KeyboardControllerProps, KeyboardEventsModule, KeyboardGestureAreaProps, OverKeyboardViewProps, WindowDimensionsEventsModule } from "./types";
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import type { ClippingScrollViewProps, FocusedInputEventsModule, KeyboardControllerNativeModule, KeyboardControllerProps, KeyboardEventsModule, KeyboardExtenderProps, KeyboardGestureAreaProps, KeyboardToolbarGroupViewProps, OverKeyboardViewProps, WindowDimensionsEventsModule } from "./types";
2
4
  export declare const KeyboardControllerNative: KeyboardControllerNativeModule;
3
5
  export declare const KeyboardEvents: KeyboardEventsModule;
4
6
  /**
@@ -8,5 +10,12 @@ export declare const KeyboardEvents: KeyboardEventsModule;
8
10
  export declare const FocusedInputEvents: FocusedInputEventsModule;
9
11
  export declare const WindowDimensionsEvents: WindowDimensionsEventsModule;
10
12
  export declare const KeyboardControllerView: React.FC<KeyboardControllerProps>;
13
+ export declare const KeyboardControllerViewCommands: any;
11
14
  export declare const KeyboardGestureArea: React.FC<KeyboardGestureAreaProps>;
12
15
  export declare const RCTOverKeyboardView: React.FC<OverKeyboardViewProps>;
16
+ export declare const ClippingScrollView: React.FC<ClippingScrollViewProps>;
17
+ export declare const KeyboardBackgroundView: React.ForwardRefExoticComponent<import("react-native").ViewProps & {
18
+ children?: React.ReactNode | undefined;
19
+ } & React.RefAttributes<View>>;
20
+ export declare const RCTKeyboardExtender: React.FC<KeyboardExtenderProps>;
21
+ export declare const RCTKeyboardToolbarGroupView: React.FC<KeyboardToolbarGroupViewProps>;
@@ -0,0 +1,12 @@
1
+ export declare const KeyboardState: {
2
+ UNKNOWN: number;
3
+ OPENING: number;
4
+ OPEN: number;
5
+ CLOSING: number;
6
+ CLOSED: number;
7
+ };
8
+ /** Compatibility layer for migrating from Reanimated's useAnimatedKeyboard. */
9
+ export declare const useAnimatedKeyboard: () => {
10
+ height: import("react-native-reanimated").SharedValue<number>;
11
+ state: import("react-native-reanimated").SharedValue<number>;
12
+ };
@@ -12,6 +12,11 @@ export type KeyboardAvoidingViewBaseProps = {
12
12
  * may be non-zero in some cases. Defaults to 0.
13
13
  */
14
14
  keyboardVerticalOffset?: number;
15
+ /**
16
+ * When true, detect the view position in the window automatically.
17
+ * keyboardVerticalOffset remains an additive offset.
18
+ */
19
+ automaticOffset?: boolean;
15
20
  } & ViewProps;
16
21
  export type KeyboardAvoidingViewProps = KeyboardAvoidingViewBaseProps & ({
17
22
  /**
@@ -12,6 +12,9 @@ export type KeyboardAwareScrollViewProps = {
12
12
  /** Custom component for `ScrollView`. Default is `ScrollView` */
13
13
  ScrollViewComponent?: React.ComponentType<ScrollViewProps>;
14
14
  } & ScrollViewProps;
15
+ export type KeyboardAwareScrollViewRef = ScrollView & {
16
+ assureFocusedInputVisible: () => void;
17
+ };
15
18
  declare const KeyboardAwareScrollView: React.ForwardRefExoticComponent<{
16
19
  /** The distance between keyboard and focused `TextInput` when keyboard is shown. Default is `0`. */
17
20
  bottomOffset?: number;
@@ -25,5 +28,5 @@ declare const KeyboardAwareScrollView: React.ForwardRefExoticComponent<{
25
28
  ScrollViewComponent?: React.ComponentType<ScrollViewProps>;
26
29
  } & ScrollViewProps & {
27
30
  children?: React.ReactNode | undefined;
28
- } & React.RefAttributes<ScrollView>>;
31
+ } & React.RefAttributes<KeyboardAwareScrollViewRef>>;
29
32
  export default KeyboardAwareScrollView;
@@ -0,0 +1,2 @@
1
+ export { useChatKeyboard } from "./useChatKeyboard";
2
+ export type { KeyboardLiftBehavior } from "./useChatKeyboard/types";
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import Reanimated from "react-native-reanimated";
3
+ declare const KeyboardChatScrollView: React.ForwardRefExoticComponent<{
4
+ ScrollViewComponent?: import("../ScrollViewWithBottomPadding").AnimatedScrollViewComponent;
5
+ inverted?: boolean;
6
+ offset?: number;
7
+ keyboardLiftBehavior?: import("./hooks").KeyboardLiftBehavior;
8
+ freeze?: boolean | import("react-native-reanimated").SharedValue<boolean>;
9
+ extraContentPadding?: import("react-native-reanimated").SharedValue<number>;
10
+ applyWorkaroundForContentInsetHitTestBug?: boolean;
11
+ blankSpace?: import("react-native-reanimated").SharedValue<number>;
12
+ onContentInsetChange?: (insets: import("../ScrollViewWithBottomPadding").ScrollViewContentInsets) => void;
13
+ onEndVisible?: (visible: boolean) => void;
14
+ } & import("react-native").ScrollViewProps & {
15
+ children?: React.ReactNode | undefined;
16
+ } & React.RefAttributes<Reanimated.ScrollView>>;
17
+ export default KeyboardChatScrollView;
@@ -0,0 +1,113 @@
1
+ import type { AnimatedScrollViewComponent, ScrollViewContentInsets } from "../ScrollViewWithBottomPadding";
2
+ import type { KeyboardLiftBehavior } from "./useChatKeyboard/types";
3
+ import type { ScrollViewProps } from "react-native";
4
+ import type { SharedValue } from "react-native-reanimated";
5
+ export type KeyboardChatScrollViewProps = {
6
+ /** Custom component for `ScrollView`. Default is `ScrollView`. */
7
+ ScrollViewComponent?: AnimatedScrollViewComponent;
8
+ /** Whether list are using `inverted` prop. Default is `false`. */
9
+ inverted?: boolean;
10
+ /**
11
+ * The distance between the bottom of the screen and the `ScrollView`.
12
+ * When the keyboard appears, the `ScrollView` will only push content by the effective
13
+ * distance (`keyboardHeight - offset`) instead of the full keyboard height.
14
+ *
15
+ * Useful when the input is not at the very bottom of the screen (e.g., above safe area, above
16
+ * bottom tabs, etc. - in this case offset should be equal to the height of the elements between
17
+ * `ScrollView` and bottom of the screen).
18
+ *
19
+ * Default is `0`.
20
+ */
21
+ offset?: number;
22
+ /**
23
+ * Determines how the chat content should behave when the keyboard appears, specifically whether
24
+ * the scroll view should automatically lift its content to keep it visible above the keyboard.
25
+ *
26
+ * Possible values:
27
+ * - `'always'`: The content always lifts along with the keyboard, ensuring the messages from the bottom part of screen
28
+ * remain visible regardless of the current scroll position. This is the default behavior for most chat applications (used in Telegram).
29
+ * - `'whenAtEnd'`: The content lifts only if the scroll view is at the end (i.e., the last message
30
+ * is visible or near the bottom). This prevents unnecessary adjustments when the user is scrolling
31
+ * through older messages (ChatGPT mobile app behavior).
32
+ * - `'persistent'`: The content always lifts when the keyboard appears (similar to `'always'`), but
33
+ * does not reset (lower) when the keyboard hides. This mimics behaviors where the view remains adjusted
34
+ * after keyboard dismissal to maintain focus on the latest content without shifting back (Claude mobile app behavior).
35
+ * - `'never'`: The content does not lift at all when the keyboard appears. Use this for scenarios
36
+ * when you don't want to disturb user attention with animations (Perplexity mobile app behavior).
37
+ *
38
+ * Default is `'always'`.
39
+ */
40
+ keyboardLiftBehavior?: KeyboardLiftBehavior;
41
+ /**
42
+ * When `true`, freezes all keyboard-driven layout changes (padding, content offset, scroll position).
43
+ * Useful when dismissing the keyboard to open a bottom sheet — prevents visual disruption
44
+ * while the sheet is visible.
45
+ *
46
+ * Default is `false`.
47
+ */
48
+ freeze?: boolean | SharedValue<boolean>;
49
+ /**
50
+ * A shared value representing additional padding from external elements
51
+ * (e.g., a growing multiline `TextInput` in a `KeyboardStickyView`).
52
+ *
53
+ * When this value changes:
54
+ * - The scrollable range is always extended/contracted (via `contentInset`).
55
+ * - The scroll position is conditionally adjusted based on `keyboardLiftBehavior`.
56
+ *
57
+ * Default is `undefined` (no extra padding).
58
+ */
59
+ extraContentPadding?: SharedValue<number>;
60
+ /**
61
+ * When `true`, applies a runtime workaround for a React Native 0.81+ bug
62
+ * where the ScrollView's `contentInset` area does not respond to touch/scroll
63
+ * gestures (facebook/react-native#54123).
64
+ *
65
+ * This uses Objective-C runtime method swizzling on the ScrollView's container
66
+ * view, which is inherently fragile. Only enable if you are affected by the
67
+ * upstream bug and understand the risks.
68
+ *
69
+ * iOS only. Default is `false`.
70
+ */
71
+ applyWorkaroundForContentInsetHitTestBug?: boolean;
72
+ /**
73
+ * A shared value representing a minimum inset floor (in pixels).
74
+ *
75
+ * When set, the total bottom padding is computed as:
76
+ * `max(blankSpace, keyboardPadding + extraContentPadding)`
77
+ *
78
+ * This means the keyboard "absorbs" into the minimum padding rather than adding to it:
79
+ * - When `blankSpace >= keyboard + extraContentPadding`: content does NOT move on keyboard open/close.
80
+ * - When `blankSpace < keyboard + extraContentPadding`: content moves, but only by the excess amount.
81
+ *
82
+ * Useful in AI chat apps where a sent message needs space below it (to push it to the top
83
+ * of the viewport) while the AI response streams in, without that space causing extra movement
84
+ * when the keyboard opens.
85
+ *
86
+ * Default is `undefined` (equivalent to `0` — no minimum floor).
87
+ */
88
+ blankSpace?: SharedValue<number>;
89
+ /**
90
+ * Fires whenever the effective content inset changes — the static `contentInset`
91
+ * prop combined with the dynamic keyboard-driven padding.
92
+ *
93
+ * Useful on Android, where the synthetic content inset is not reflected in the native
94
+ * `onScroll` event payload. Consumers such as virtualized lists computing their own
95
+ * `scrollToEnd` target can use this to track the current inset alongside scroll offsets.
96
+ */
97
+ onContentInsetChange?: (insets: ScrollViewContentInsets) => void;
98
+ /**
99
+ * Fires whenever the visibility of the content "end" changes — both when the user
100
+ * arrives at the end and when they leave it. The boolean parameter reflects the new state.
101
+ *
102
+ * For non-inverted lists, the "end" is the bottom of the content. For inverted lists
103
+ * (`inverted={true}`), the "end" is the top of the scroll view, where the latest messages
104
+ * are rendered. The same internal detection drives `keyboardLiftBehavior="whenAtEnd"`.
105
+ *
106
+ * The callback can be either a plain JS function or a Reanimated worklet — the type is
107
+ * detected automatically. Worklets run on the UI thread; plain functions are dispatched
108
+ * via `runOnJS`.
109
+ *
110
+ * Fires once on mount with the initial state (after the scroll view has been measured).
111
+ */
112
+ onEndVisible?: (visible: boolean) => void;
113
+ } & ScrollViewProps;