@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 +1 @@
1
- {"version":3,"names":["React","useMemo","Animated","StyleSheet","View","useColorScheme","ArrowComponent","type","disabled","theme","colorScheme","color","backgroundColor","primary","left","styles","arrowLeftLine","right","arrowRightLine","createElement","style","arrowDownContainer","arrowUpContainer","arrow","arrowLine","width","height","borderRadius","marginHorizontal","justifyContent","alignItems","create","transform","rotate","flexDirection"],"sources":["Arrow.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Animated, StyleSheet, View } from \"react-native\";\n\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { ViewStyle } from \"react-native\";\n\ntype ArrowProps = {\n type: \"prev\" | \"next\";\n disabled?: boolean;\n theme: KeyboardToolbarTheme;\n};\n\nconst ArrowComponent: React.FC<ArrowProps> = ({ type, disabled, theme }) => {\n const colorScheme = useColorScheme();\n\n const color = useMemo(\n () => ({\n backgroundColor: disabled\n ? theme[colorScheme].disabled\n : theme[colorScheme].primary,\n }),\n [disabled, theme, colorScheme],\n );\n const left = useMemo(() => [styles.arrowLeftLine, color], [color]);\n const right = useMemo(() => [styles.arrowRightLine, color], [color]);\n\n return (\n <View\n style={\n type === \"next\" ? styles.arrowDownContainer : styles.arrowUpContainer\n }\n >\n <View style={styles.arrow}>\n <Animated.View style={left} />\n <Animated.View style={right} />\n </View>\n </View>\n );\n};\n\nconst arrowLine: ViewStyle = {\n width: 13,\n height: 2,\n borderRadius: 1,\n};\nconst arrowUpContainer: ViewStyle = {\n marginHorizontal: 5,\n width: 30,\n height: 30,\n justifyContent: \"center\",\n alignItems: \"center\",\n};\nconst styles = StyleSheet.create({\n arrowUpContainer: arrowUpContainer,\n arrowDownContainer: {\n ...arrowUpContainer,\n transform: [{ rotate: \"180deg\" }],\n },\n arrow: {\n width: 20,\n height: 20,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n },\n arrowLeftLine: {\n ...arrowLine,\n transform: [{ rotate: \"-45deg\" }],\n left: -0.5,\n },\n arrowRightLine: {\n ...arrowLine,\n transform: [{ rotate: \"45deg\" }],\n left: -5.5,\n },\n});\n\nexport default ArrowComponent;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEzD,OAAOC,cAAc,MAAM,yBAAyB;AAWpD,MAAMC,cAAoC,GAAGA,CAAC;EAAEC,IAAI;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EAC1E,MAAMC,WAAW,GAAGL,cAAc,CAAC,CAAC;EAEpC,MAAMM,KAAK,GAAGV,OAAO,CACnB,OAAO;IACLW,eAAe,EAAEJ,QAAQ,GACrBC,KAAK,CAACC,WAAW,CAAC,CAACF,QAAQ,GAC3BC,KAAK,CAACC,WAAW,CAAC,CAACG;EACzB,CAAC,CAAC,EACF,CAACL,QAAQ,EAAEC,KAAK,EAAEC,WAAW,CAC/B,CAAC;EACD,MAAMI,IAAI,GAAGb,OAAO,CAAC,MAAM,CAACc,MAAM,CAACC,aAAa,EAAEL,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAClE,MAAMM,KAAK,GAAGhB,OAAO,CAAC,MAAM,CAACc,MAAM,CAACG,cAAc,EAAEP,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAEpE,oBACEX,KAAA,CAAAmB,aAAA,CAACf,IAAI;IACHgB,KAAK,EACHb,IAAI,KAAK,MAAM,GAAGQ,MAAM,CAACM,kBAAkB,GAAGN,MAAM,CAACO;EACtD,gBAEDtB,KAAA,CAAAmB,aAAA,CAACf,IAAI;IAACgB,KAAK,EAAEL,MAAM,CAACQ;EAAM,gBACxBvB,KAAA,CAAAmB,aAAA,CAACjB,QAAQ,CAACE,IAAI;IAACgB,KAAK,EAAEN;EAAK,CAAE,CAAC,eAC9Bd,KAAA,CAAAmB,aAAA,CAACjB,QAAQ,CAACE,IAAI;IAACgB,KAAK,EAAEH;EAAM,CAAE,CAC1B,CACF,CAAC;AAEX,CAAC;AAED,MAAMO,SAAoB,GAAG;EAC3BC,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,CAAC;EACTC,YAAY,EAAE;AAChB,CAAC;AACD,MAAML,gBAA2B,GAAG;EAClCM,gBAAgB,EAAE,CAAC;EACnBH,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,EAAE;EACVG,cAAc,EAAE,QAAQ;EACxBC,UAAU,EAAE;AACd,CAAC;AACD,MAAMf,MAAM,GAAGZ,UAAU,CAAC4B,MAAM,CAAC;EAC/BT,gBAAgB,EAAEA,gBAAgB;EAClCD,kBAAkB,EAAE;IAClB,GAAGC,gBAAgB;IACnBU,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC;EAClC,CAAC;EACDV,KAAK,EAAE;IACLE,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVQ,aAAa,EAAE,KAAK;IACpBJ,UAAU,EAAE,QAAQ;IACpBD,cAAc,EAAE;EAClB,CAAC;EACDb,aAAa,EAAE;IACb,GAAGQ,SAAS;IACZQ,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC,CAAC;IACjCnB,IAAI,EAAE,CAAC;EACT,CAAC;EACDI,cAAc,EAAE;IACd,GAAGM,SAAS;IACZQ,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAQ,CAAC,CAAC;IAChCnB,IAAI,EAAE,CAAC;EACT;AACF,CAAC,CAAC;AAEF,eAAeR,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","Animated","StyleSheet","View","useKeyboardState","ArrowComponent","type","disabled","theme","colorScheme","state","appearance","color","backgroundColor","primary","left","styles","arrowLeftLine","right","arrowRightLine","createElement","style","arrowDownContainer","arrowUpContainer","arrow","arrowLine","width","height","borderRadius","marginHorizontal","justifyContent","alignItems","create","transform","rotate","flexDirection"],"sources":["Arrow.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Animated, StyleSheet, View } from \"react-native\";\n\nimport { useKeyboardState } from \"../../hooks\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { ViewStyle } from \"react-native\";\n\ntype ArrowProps = {\n type: \"prev\" | \"next\";\n disabled?: boolean;\n theme: KeyboardToolbarTheme;\n};\n\nconst ArrowComponent: React.FC<ArrowProps> = ({ type, disabled, theme }) => {\n const colorScheme = useKeyboardState((state) => state.appearance);\n\n const color = useMemo(\n () => ({\n backgroundColor: disabled\n ? theme[colorScheme].disabled\n : theme[colorScheme].primary,\n }),\n [disabled, theme, colorScheme],\n );\n const left = useMemo(() => [styles.arrowLeftLine, color], [color]);\n const right = useMemo(() => [styles.arrowRightLine, color], [color]);\n\n return (\n <View\n style={\n type === \"next\" ? styles.arrowDownContainer : styles.arrowUpContainer\n }\n >\n <View style={styles.arrow}>\n <Animated.View style={left} />\n <Animated.View style={right} />\n </View>\n </View>\n );\n};\n\nconst arrowLine: ViewStyle = {\n width: 13,\n height: 2,\n borderRadius: 1,\n};\nconst arrowUpContainer: ViewStyle = {\n marginHorizontal: 5,\n width: 30,\n height: 30,\n justifyContent: \"center\",\n alignItems: \"center\",\n};\nconst styles = StyleSheet.create({\n arrowUpContainer: arrowUpContainer,\n arrowDownContainer: {\n ...arrowUpContainer,\n transform: [{ rotate: \"180deg\" }],\n },\n arrow: {\n width: 20,\n height: 20,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n },\n arrowLeftLine: {\n ...arrowLine,\n transform: [{ rotate: \"-45deg\" }],\n left: -0.5,\n },\n arrowRightLine: {\n ...arrowLine,\n transform: [{ rotate: \"45deg\" }],\n left: -5.5,\n },\n});\n\nexport default ArrowComponent;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEzD,SAASC,gBAAgB,QAAQ,aAAa;AAW9C,MAAMC,cAAoC,GAAGA,CAAC;EAAEC,IAAI;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EAC1E,MAAMC,WAAW,GAAGL,gBAAgB,CAAEM,KAAK,IAAKA,KAAK,CAACC,UAAU,CAAC;EAEjE,MAAMC,KAAK,GAAGZ,OAAO,CACnB,OAAO;IACLa,eAAe,EAAEN,QAAQ,GACrBC,KAAK,CAACC,WAAW,CAAC,CAACF,QAAQ,GAC3BC,KAAK,CAACC,WAAW,CAAC,CAACK;EACzB,CAAC,CAAC,EACF,CAACP,QAAQ,EAAEC,KAAK,EAAEC,WAAW,CAC/B,CAAC;EACD,MAAMM,IAAI,GAAGf,OAAO,CAAC,MAAM,CAACgB,MAAM,CAACC,aAAa,EAAEL,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAClE,MAAMM,KAAK,GAAGlB,OAAO,CAAC,MAAM,CAACgB,MAAM,CAACG,cAAc,EAAEP,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAEpE,oBACEb,KAAA,CAAAqB,aAAA,CAACjB,IAAI;IACHkB,KAAK,EACHf,IAAI,KAAK,MAAM,GAAGU,MAAM,CAACM,kBAAkB,GAAGN,MAAM,CAACO;EACtD,gBAEDxB,KAAA,CAAAqB,aAAA,CAACjB,IAAI;IAACkB,KAAK,EAAEL,MAAM,CAACQ;EAAM,gBACxBzB,KAAA,CAAAqB,aAAA,CAACnB,QAAQ,CAACE,IAAI;IAACkB,KAAK,EAAEN;EAAK,CAAE,CAAC,eAC9BhB,KAAA,CAAAqB,aAAA,CAACnB,QAAQ,CAACE,IAAI;IAACkB,KAAK,EAAEH;EAAM,CAAE,CAC1B,CACF,CAAC;AAEX,CAAC;AAED,MAAMO,SAAoB,GAAG;EAC3BC,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,CAAC;EACTC,YAAY,EAAE;AAChB,CAAC;AACD,MAAML,gBAA2B,GAAG;EAClCM,gBAAgB,EAAE,CAAC;EACnBH,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,EAAE;EACVG,cAAc,EAAE,QAAQ;EACxBC,UAAU,EAAE;AACd,CAAC;AACD,MAAMf,MAAM,GAAGd,UAAU,CAAC8B,MAAM,CAAC;EAC/BT,gBAAgB,EAAEA,gBAAgB;EAClCD,kBAAkB,EAAE;IAClB,GAAGC,gBAAgB;IACnBU,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC;EAClC,CAAC;EACDV,KAAK,EAAE;IACLE,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVQ,aAAa,EAAE,KAAK;IACpBJ,UAAU,EAAE,QAAQ;IACpBD,cAAc,EAAE;EAClB,CAAC;EACDb,aAAa,EAAE;IACb,GAAGQ,SAAS;IACZQ,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC,CAAC;IACjCnB,IAAI,EAAE,CAAC;EACT,CAAC;EACDI,cAAc,EAAE;IACd,GAAGM,SAAS;IACZQ,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAQ,CAAC,CAAC;IAChCnB,IAAI,EAAE,CAAC;EACT;AACF,CAAC,CAAC;AAEF,eAAeV,cAAc","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import React, { useMemo } from "react";
2
2
  import { Platform, TouchableNativeFeedback, TouchableOpacity, View } from "react-native";
3
- import useColorScheme from "../hooks/useColorScheme";
3
+ import { useKeyboardState } from "../../hooks";
4
4
  const ButtonIOS = ({
5
5
  children,
6
6
  onPress,
@@ -37,7 +37,7 @@ const ButtonAndroid = ({
37
37
  style,
38
38
  theme
39
39
  }) => {
40
- const colorScheme = useColorScheme();
40
+ const colorScheme = useKeyboardState(state => state.appearance);
41
41
  const accessibilityState = useMemo(() => ({
42
42
  disabled
43
43
  }), [disabled]);
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","Platform","TouchableNativeFeedback","TouchableOpacity","View","useColorScheme","ButtonIOS","children","onPress","disabled","accessibilityLabel","accessibilityHint","testID","style","Container","accessibilityState","createElement","accessibilityRole","ButtonAndroid","rippleRadius","theme","colorScheme","ripple","Ripple","background","select","android","default"],"sources":["Button.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport {\n Platform,\n TouchableNativeFeedback,\n TouchableOpacity,\n View,\n} from \"react-native\";\n\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { PropsWithChildren } from \"react\";\nimport type { ViewStyle } from \"react-native\";\n\ntype ButtonProps = {\n disabled?: boolean;\n onPress: () => void;\n accessibilityLabel: string;\n accessibilityHint: string;\n testID: string;\n rippleRadius?: number;\n style?: ViewStyle;\n theme: KeyboardToolbarTheme;\n};\n\nconst ButtonIOS = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n style,\n}: PropsWithChildren<ButtonProps>) => {\n // immediately switch to plain view to avoid animation flickering\n // when fade out animation happens and view becomes disabled\n const Container = disabled\n ? (View as unknown as typeof TouchableOpacity)\n : TouchableOpacity;\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n\n return (\n <Container\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n style={style}\n testID={testID}\n >\n {children}\n </Container>\n );\n};\nconst ButtonAndroid = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n rippleRadius = 18,\n style,\n theme,\n}: PropsWithChildren<ButtonProps>) => {\n const colorScheme = useColorScheme();\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n const ripple = useMemo(\n () =>\n TouchableNativeFeedback.Ripple(\n theme[colorScheme].ripple,\n true,\n rippleRadius,\n ),\n [colorScheme, rippleRadius, theme],\n );\n\n return (\n <TouchableNativeFeedback\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n background={ripple}\n testID={testID}\n style={style}\n >\n <View style={style}>{children}</View>\n </TouchableNativeFeedback>\n );\n};\n\nexport default Platform.select({\n android: ButtonAndroid,\n default: ButtonIOS,\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SACEC,QAAQ,EACRC,uBAAuB,EACvBC,gBAAgB,EAChBC,IAAI,QACC,cAAc;AAErB,OAAOC,cAAc,MAAM,yBAAyB;AAiBpD,MAAMC,SAAS,GAAGA,CAAC;EACjBC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,kBAAkB;EAClBC,iBAAiB;EACjBC,MAAM;EACNC;AAC8B,CAAC,KAAK;EACpC;EACA;EACA,MAAMC,SAAS,GAAGL,QAAQ,GACrBL,IAAI,GACLD,gBAAgB;EACpB,MAAMY,kBAAkB,GAAGf,OAAO,CAAC,OAAO;IAAES;EAAS,CAAC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EAEpE,oBACEV,KAAA,CAAAiB,aAAA,CAACF,SAAS;IACRC,kBAAkB,EAAEA,kBAAmB;IACvCE,iBAAiB,EAAC,QAAQ;IAC1BP,kBAAkB,EAAEA,kBAAmB;IACvCC,iBAAiB,EAAEA,iBAAkB;IACrCH,OAAO,EAAEA,OAAQ;IACjBK,KAAK,EAAEA,KAAM;IACbD,MAAM,EAAEA;EAAO,GAEdL,QACQ,CAAC;AAEhB,CAAC;AACD,MAAMW,aAAa,GAAGA,CAAC;EACrBX,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,kBAAkB;EAClBC,iBAAiB;EACjBC,MAAM;EACNO,YAAY,GAAG,EAAE;EACjBN,KAAK;EACLO;AAC8B,CAAC,KAAK;EACpC,MAAMC,WAAW,GAAGhB,cAAc,CAAC,CAAC;EACpC,MAAMU,kBAAkB,GAAGf,OAAO,CAAC,OAAO;IAAES;EAAS,CAAC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EACpE,MAAMa,MAAM,GAAGtB,OAAO,CACpB,MACEE,uBAAuB,CAACqB,MAAM,CAC5BH,KAAK,CAACC,WAAW,CAAC,CAACC,MAAM,EACzB,IAAI,EACJH,YACF,CAAC,EACH,CAACE,WAAW,EAAEF,YAAY,EAAEC,KAAK,CACnC,CAAC;EAED,oBACErB,KAAA,CAAAiB,aAAA,CAACd,uBAAuB;IACtBa,kBAAkB,EAAEA,kBAAmB;IACvCE,iBAAiB,EAAC,QAAQ;IAC1BP,kBAAkB,EAAEA,kBAAmB;IACvCC,iBAAiB,EAAEA,iBAAkB;IACrCH,OAAO,EAAEA,OAAQ;IACjBgB,UAAU,EAAEF,MAAO;IACnBV,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA;EAAM,gBAEbd,KAAA,CAAAiB,aAAA,CAACZ,IAAI;IAACS,KAAK,EAAEA;EAAM,GAAEN,QAAe,CACb,CAAC;AAE9B,CAAC;AAED,eAAeN,QAAQ,CAACwB,MAAM,CAAC;EAC7BC,OAAO,EAAER,aAAa;EACtBS,OAAO,EAAErB;AACX,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","Platform","TouchableNativeFeedback","TouchableOpacity","View","useKeyboardState","ButtonIOS","children","onPress","disabled","accessibilityLabel","accessibilityHint","testID","style","Container","accessibilityState","createElement","accessibilityRole","ButtonAndroid","rippleRadius","theme","colorScheme","state","appearance","ripple","Ripple","background","select","android","default"],"sources":["Button.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport {\n Platform,\n TouchableNativeFeedback,\n TouchableOpacity,\n View,\n} from \"react-native\";\n\nimport { useKeyboardState } from \"../../hooks\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { PropsWithChildren } from \"react\";\nimport type { GestureResponderEvent, ViewStyle } from \"react-native\";\n\ntype ButtonProps = {\n disabled?: boolean;\n onPress: (event: GestureResponderEvent) => void;\n accessibilityLabel: string;\n accessibilityHint: string;\n testID: string;\n rippleRadius?: number;\n style?: ViewStyle;\n theme: KeyboardToolbarTheme;\n};\n\nconst ButtonIOS = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n style,\n}: PropsWithChildren<ButtonProps>) => {\n // immediately switch to plain view to avoid animation flickering\n // when fade out animation happens and view becomes disabled\n const Container = disabled\n ? (View as unknown as typeof TouchableOpacity)\n : TouchableOpacity;\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n\n return (\n <Container\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n style={style}\n testID={testID}\n >\n {children}\n </Container>\n );\n};\nconst ButtonAndroid = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n rippleRadius = 18,\n style,\n theme,\n}: PropsWithChildren<ButtonProps>) => {\n const colorScheme = useKeyboardState((state) => state.appearance);\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n const ripple = useMemo(\n () =>\n TouchableNativeFeedback.Ripple(\n theme[colorScheme].ripple,\n true,\n rippleRadius,\n ),\n [colorScheme, rippleRadius, theme],\n );\n\n return (\n <TouchableNativeFeedback\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n background={ripple}\n testID={testID}\n style={style}\n >\n <View style={style}>{children}</View>\n </TouchableNativeFeedback>\n );\n};\n\nexport default Platform.select({\n android: ButtonAndroid,\n default: ButtonIOS,\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SACEC,QAAQ,EACRC,uBAAuB,EACvBC,gBAAgB,EAChBC,IAAI,QACC,cAAc;AAErB,SAASC,gBAAgB,QAAQ,aAAa;AAiB9C,MAAMC,SAAS,GAAGA,CAAC;EACjBC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,kBAAkB;EAClBC,iBAAiB;EACjBC,MAAM;EACNC;AAC8B,CAAC,KAAK;EACpC;EACA;EACA,MAAMC,SAAS,GAAGL,QAAQ,GACrBL,IAAI,GACLD,gBAAgB;EACpB,MAAMY,kBAAkB,GAAGf,OAAO,CAAC,OAAO;IAAES;EAAS,CAAC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EAEpE,oBACEV,KAAA,CAAAiB,aAAA,CAACF,SAAS;IACRC,kBAAkB,EAAEA,kBAAmB;IACvCE,iBAAiB,EAAC,QAAQ;IAC1BP,kBAAkB,EAAEA,kBAAmB;IACvCC,iBAAiB,EAAEA,iBAAkB;IACrCH,OAAO,EAAEA,OAAQ;IACjBK,KAAK,EAAEA,KAAM;IACbD,MAAM,EAAEA;EAAO,GAEdL,QACQ,CAAC;AAEhB,CAAC;AACD,MAAMW,aAAa,GAAGA,CAAC;EACrBX,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,kBAAkB;EAClBC,iBAAiB;EACjBC,MAAM;EACNO,YAAY,GAAG,EAAE;EACjBN,KAAK;EACLO;AAC8B,CAAC,KAAK;EACpC,MAAMC,WAAW,GAAGhB,gBAAgB,CAAEiB,KAAK,IAAKA,KAAK,CAACC,UAAU,CAAC;EACjE,MAAMR,kBAAkB,GAAGf,OAAO,CAAC,OAAO;IAAES;EAAS,CAAC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EACpE,MAAMe,MAAM,GAAGxB,OAAO,CACpB,MACEE,uBAAuB,CAACuB,MAAM,CAC5BL,KAAK,CAACC,WAAW,CAAC,CAACG,MAAM,EACzB,IAAI,EACJL,YACF,CAAC,EACH,CAACE,WAAW,EAAEF,YAAY,EAAEC,KAAK,CACnC,CAAC;EAED,oBACErB,KAAA,CAAAiB,aAAA,CAACd,uBAAuB;IACtBa,kBAAkB,EAAEA,kBAAmB;IACvCE,iBAAiB,EAAC,QAAQ;IAC1BP,kBAAkB,EAAEA,kBAAmB;IACvCC,iBAAiB,EAAEA,iBAAkB;IACrCH,OAAO,EAAEA,OAAQ;IACjBkB,UAAU,EAAEF,MAAO;IACnBZ,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA;EAAM,gBAEbd,KAAA,CAAAiB,aAAA,CAACZ,IAAI;IAACS,KAAK,EAAEA;EAAM,GAAEN,QAAe,CACb,CAAC;AAE9B,CAAC;AAED,eAAeN,QAAQ,CAAC0B,MAAM,CAAC;EAC7BC,OAAO,EAAEV,aAAa;EACtBW,OAAO,EAAEvB;AACX,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ const Background = ({
3
+ children
4
+ }) => /*#__PURE__*/React.createElement(React.Fragment, null, children);
5
+ export default Background;
6
+ //# sourceMappingURL=Background.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Background","children","createElement","Fragment"],"sources":["Background.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { ReactNode } from \"react\";\n\nconst Background: React.FC<{ children: ReactNode }> = ({ children }) => (\n <>{children}</>\n);\n\nexport default Background;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAIzB,MAAMC,UAA6C,GAAGA,CAAC;EAAEC;AAAS,CAAC,kBACjEF,KAAA,CAAAG,aAAA,CAAAH,KAAA,CAAAI,QAAA,QAAGF,QAAW,CACf;AAED,eAAeD,UAAU","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { StyleSheet, View } from "react-native";
3
+ import { TEST_ID_KEYBOARD_TOOLBAR_CONTENT } from "../../constants";
4
+ const Content = ({
5
+ children
6
+ }) => {
7
+ return /*#__PURE__*/React.createElement(View, {
8
+ style: styles.flex,
9
+ testID: TEST_ID_KEYBOARD_TOOLBAR_CONTENT
10
+ }, children);
11
+ };
12
+ const styles = StyleSheet.create({
13
+ flex: {
14
+ flex: 1
15
+ }
16
+ });
17
+ export default Content;
18
+ //# sourceMappingURL=Content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","TEST_ID_KEYBOARD_TOOLBAR_CONTENT","Content","children","createElement","style","styles","flex","testID","create"],"sources":["Content.tsx"],"sourcesContent":["import React from \"react\";\nimport { StyleSheet, View } from \"react-native\";\n\nimport { TEST_ID_KEYBOARD_TOOLBAR_CONTENT } from \"../../constants\";\n\nimport type { ReactNode } from \"react\";\nimport type { ViewProps } from \"react-native\";\n\nconst Content: React.FC<ViewProps & { children?: ReactNode }> = ({\n children,\n}) => {\n return (\n <View style={styles.flex} testID={TEST_ID_KEYBOARD_TOOLBAR_CONTENT}>\n {children}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n flex: {\n flex: 1,\n },\n});\n\nexport default Content;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,gCAAgC,QAAQ,iBAAiB;AAKlE,MAAMC,OAAuD,GAAGA,CAAC;EAC/DC;AACF,CAAC,KAAK;EACJ,oBACEL,KAAA,CAAAM,aAAA,CAACJ,IAAI;IAACK,KAAK,EAAEC,MAAM,CAACC,IAAK;IAACC,MAAM,EAAEP;EAAiC,GAChEE,QACG,CAAC;AAEX,CAAC;AAED,MAAMG,MAAM,GAAGP,UAAU,CAACU,MAAM,CAAC;EAC/BF,IAAI,EAAE;IACJA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,eAAeL,OAAO","ignoreList":[]}
@@ -0,0 +1,50 @@
1
+ import React, { useCallback, useMemo } from "react";
2
+ import { StyleSheet, Text } from "react-native";
3
+ import { useKeyboardState } from "../../../../hooks";
4
+ import { KeyboardController } from "../../../../module";
5
+ import Button from "../../Button";
6
+ import { TEST_ID_KEYBOARD_TOOLBAR_DONE } from "../../constants";
7
+ import { useToolbarContext } from "../context";
8
+ const Done = ({
9
+ children,
10
+ onPress,
11
+ rippleRadius = 28,
12
+ text,
13
+ button: ButtonContainer = Button
14
+ }) => {
15
+ const colorScheme = useKeyboardState(state => state.appearance);
16
+ const {
17
+ theme
18
+ } = useToolbarContext();
19
+ const doneStyle = useMemo(() => [styles.doneButton, {
20
+ color: theme[colorScheme].primary
21
+ }], [colorScheme, theme]);
22
+ const onPressDone = useCallback(event => {
23
+ onPress === null || onPress === void 0 || onPress(event);
24
+ if (!event.isDefaultPrevented()) KeyboardController.dismiss();
25
+ }, [onPress]);
26
+ return /*#__PURE__*/React.createElement(ButtonContainer, {
27
+ accessibilityHint: "Closes the keyboard",
28
+ accessibilityLabel: "Done",
29
+ rippleRadius: rippleRadius,
30
+ style: styles.doneButtonContainer,
31
+ testID: TEST_ID_KEYBOARD_TOOLBAR_DONE,
32
+ theme: theme,
33
+ onPress: onPressDone
34
+ }, /*#__PURE__*/React.createElement(Text, {
35
+ maxFontSizeMultiplier: 1.3,
36
+ style: doneStyle
37
+ }, children ?? text ?? "Done"));
38
+ };
39
+ const styles = StyleSheet.create({
40
+ doneButton: {
41
+ fontWeight: "600",
42
+ fontSize: 15
43
+ },
44
+ doneButtonContainer: {
45
+ marginRight: 16,
46
+ marginLeft: 8
47
+ }
48
+ });
49
+ export default Done;
50
+ //# sourceMappingURL=Done.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useCallback","useMemo","StyleSheet","Text","useKeyboardState","KeyboardController","Button","TEST_ID_KEYBOARD_TOOLBAR_DONE","useToolbarContext","Done","children","onPress","rippleRadius","text","button","ButtonContainer","colorScheme","state","appearance","theme","doneStyle","styles","doneButton","color","primary","onPressDone","event","isDefaultPrevented","dismiss","createElement","accessibilityHint","accessibilityLabel","style","doneButtonContainer","testID","maxFontSizeMultiplier","create","fontWeight","fontSize","marginRight","marginLeft"],"sources":["Done.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { StyleSheet, Text } from \"react-native\";\n\nimport { useKeyboardState } from \"../../../../hooks\";\nimport { KeyboardController } from \"../../../../module\";\nimport Button from \"../../Button\";\nimport { TEST_ID_KEYBOARD_TOOLBAR_DONE } from \"../../constants\";\nimport { useToolbarContext } from \"../context\";\n\nimport type { ButtonSubProps } from \"./types\";\nimport type { ReactNode } from \"react\";\nimport type { GestureResponderEvent } from \"react-native\";\n\nconst Done: React.FC<Omit<ButtonSubProps, \"icon\"> & { text?: ReactNode }> = ({\n children,\n onPress,\n rippleRadius = 28,\n text,\n button: ButtonContainer = Button,\n}) => {\n const colorScheme = useKeyboardState((state) => state.appearance);\n const { theme } = useToolbarContext();\n const doneStyle = useMemo(\n () => [styles.doneButton, { color: theme[colorScheme].primary }],\n [colorScheme, theme],\n );\n const onPressDone = useCallback(\n (event: GestureResponderEvent) => {\n onPress?.(event);\n if (!event.isDefaultPrevented()) KeyboardController.dismiss();\n },\n [onPress],\n );\n\n return (\n <ButtonContainer\n accessibilityHint=\"Closes the keyboard\"\n accessibilityLabel=\"Done\"\n rippleRadius={rippleRadius}\n style={styles.doneButtonContainer}\n testID={TEST_ID_KEYBOARD_TOOLBAR_DONE}\n theme={theme}\n onPress={onPressDone}\n >\n <Text maxFontSizeMultiplier={1.3} style={doneStyle}>\n {children ?? text ?? \"Done\"}\n </Text>\n </ButtonContainer>\n );\n};\n\nconst styles = StyleSheet.create({\n doneButton: { fontWeight: \"600\", fontSize: 15 },\n doneButtonContainer: { marginRight: 16, marginLeft: 8 },\n});\n\nexport default Done;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACnD,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,gBAAgB,QAAQ,mBAAmB;AACpD,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,OAAOC,MAAM,MAAM,cAAc;AACjC,SAASC,6BAA6B,QAAQ,iBAAiB;AAC/D,SAASC,iBAAiB,QAAQ,YAAY;AAM9C,MAAMC,IAAmE,GAAGA,CAAC;EAC3EC,QAAQ;EACRC,OAAO;EACPC,YAAY,GAAG,EAAE;EACjBC,IAAI;EACJC,MAAM,EAAEC,eAAe,GAAGT;AAC5B,CAAC,KAAK;EACJ,MAAMU,WAAW,GAAGZ,gBAAgB,CAAEa,KAAK,IAAKA,KAAK,CAACC,UAAU,CAAC;EACjE,MAAM;IAAEC;EAAM,CAAC,GAAGX,iBAAiB,CAAC,CAAC;EACrC,MAAMY,SAAS,GAAGnB,OAAO,CACvB,MAAM,CAACoB,MAAM,CAACC,UAAU,EAAE;IAAEC,KAAK,EAAEJ,KAAK,CAACH,WAAW,CAAC,CAACQ;EAAQ,CAAC,CAAC,EAChE,CAACR,WAAW,EAAEG,KAAK,CACrB,CAAC;EACD,MAAMM,WAAW,GAAGzB,WAAW,CAC5B0B,KAA4B,IAAK;IAChCf,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAGe,KAAK,CAAC;IAChB,IAAI,CAACA,KAAK,CAACC,kBAAkB,CAAC,CAAC,EAAEtB,kBAAkB,CAACuB,OAAO,CAAC,CAAC;EAC/D,CAAC,EACD,CAACjB,OAAO,CACV,CAAC;EAED,oBACEZ,KAAA,CAAA8B,aAAA,CAACd,eAAe;IACde,iBAAiB,EAAC,qBAAqB;IACvCC,kBAAkB,EAAC,MAAM;IACzBnB,YAAY,EAAEA,YAAa;IAC3BoB,KAAK,EAAEX,MAAM,CAACY,mBAAoB;IAClCC,MAAM,EAAE3B,6BAA8B;IACtCY,KAAK,EAAEA,KAAM;IACbR,OAAO,EAAEc;EAAY,gBAErB1B,KAAA,CAAA8B,aAAA,CAAC1B,IAAI;IAACgC,qBAAqB,EAAE,GAAI;IAACH,KAAK,EAAEZ;EAAU,GAChDV,QAAQ,IAAIG,IAAI,IAAI,MACjB,CACS,CAAC;AAEtB,CAAC;AAED,MAAMQ,MAAM,GAAGnB,UAAU,CAACkC,MAAM,CAAC;EAC/Bd,UAAU,EAAE;IAAEe,UAAU,EAAE,KAAK;IAAEC,QAAQ,EAAE;EAAG,CAAC;EAC/CL,mBAAmB,EAAE;IAAEM,WAAW,EAAE,EAAE;IAAEC,UAAU,EAAE;EAAE;AACxD,CAAC,CAAC;AAEF,eAAe/B,IAAI","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ import React, { useCallback } from "react";
2
+ import { KeyboardController } from "../../../../module";
3
+ import Arrow from "../../Arrow";
4
+ import Button from "../../Button";
5
+ import { TEST_ID_KEYBOARD_TOOLBAR_NEXT } from "../../constants";
6
+ import { useToolbarContext } from "../context";
7
+ const Next = ({
8
+ children,
9
+ onPress,
10
+ disabled,
11
+ rippleRadius,
12
+ style,
13
+ button: ButtonContainer = Button,
14
+ icon: IconContainer = Arrow
15
+ }) => {
16
+ const {
17
+ theme,
18
+ isNextDisabled
19
+ } = useToolbarContext();
20
+ const isDisabled = disabled ?? isNextDisabled;
21
+ const onPressNext = useCallback(event => {
22
+ onPress === null || onPress === void 0 || onPress(event);
23
+ if (!event.isDefaultPrevented()) KeyboardController.setFocusTo("next");
24
+ }, [onPress]);
25
+ return /*#__PURE__*/React.createElement(ButtonContainer, {
26
+ accessibilityHint: "Moves focus to the next field",
27
+ accessibilityLabel: "Next",
28
+ disabled: isDisabled,
29
+ rippleRadius: rippleRadius,
30
+ style: style,
31
+ testID: TEST_ID_KEYBOARD_TOOLBAR_NEXT,
32
+ theme: theme,
33
+ onPress: onPressNext
34
+ }, children ?? /*#__PURE__*/React.createElement(IconContainer, {
35
+ disabled: isDisabled,
36
+ theme: theme,
37
+ type: "next"
38
+ }));
39
+ };
40
+ export default Next;
41
+ //# sourceMappingURL=Next.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useCallback","KeyboardController","Arrow","Button","TEST_ID_KEYBOARD_TOOLBAR_NEXT","useToolbarContext","Next","children","onPress","disabled","rippleRadius","style","button","ButtonContainer","icon","IconContainer","theme","isNextDisabled","isDisabled","onPressNext","event","isDefaultPrevented","setFocusTo","createElement","accessibilityHint","accessibilityLabel","testID","type"],"sources":["Next.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\n\nimport { KeyboardController } from \"../../../../module\";\nimport Arrow from \"../../Arrow\";\nimport Button from \"../../Button\";\nimport { TEST_ID_KEYBOARD_TOOLBAR_NEXT } from \"../../constants\";\nimport { useToolbarContext } from \"../context\";\n\nimport type { ButtonSubProps } from \"./types\";\nimport type { GestureResponderEvent } from \"react-native\";\n\nconst Next: React.FC<ButtonSubProps> = ({\n children,\n onPress,\n disabled,\n rippleRadius,\n style,\n button: ButtonContainer = Button,\n icon: IconContainer = Arrow,\n}) => {\n const { theme, isNextDisabled } = useToolbarContext();\n const isDisabled = disabled ?? isNextDisabled;\n const onPressNext = useCallback(\n (event: GestureResponderEvent) => {\n onPress?.(event);\n if (!event.isDefaultPrevented()) KeyboardController.setFocusTo(\"next\");\n },\n [onPress],\n );\n\n return (\n <ButtonContainer\n accessibilityHint=\"Moves focus to the next field\"\n accessibilityLabel=\"Next\"\n disabled={isDisabled}\n rippleRadius={rippleRadius}\n style={style}\n testID={TEST_ID_KEYBOARD_TOOLBAR_NEXT}\n theme={theme}\n onPress={onPressNext}\n >\n {children ?? (\n <IconContainer disabled={isDisabled} theme={theme} type=\"next\" />\n )}\n </ButtonContainer>\n );\n};\n\nexport default Next;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAE1C,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,MAAM,MAAM,cAAc;AACjC,SAASC,6BAA6B,QAAQ,iBAAiB;AAC/D,SAASC,iBAAiB,QAAQ,YAAY;AAK9C,MAAMC,IAA8B,GAAGA,CAAC;EACtCC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,YAAY;EACZC,KAAK;EACLC,MAAM,EAAEC,eAAe,GAAGV,MAAM;EAChCW,IAAI,EAAEC,aAAa,GAAGb;AACxB,CAAC,KAAK;EACJ,MAAM;IAAEc,KAAK;IAAEC;EAAe,CAAC,GAAGZ,iBAAiB,CAAC,CAAC;EACrD,MAAMa,UAAU,GAAGT,QAAQ,IAAIQ,cAAc;EAC7C,MAAME,WAAW,GAAGnB,WAAW,CAC5BoB,KAA4B,IAAK;IAChCZ,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAGY,KAAK,CAAC;IAChB,IAAI,CAACA,KAAK,CAACC,kBAAkB,CAAC,CAAC,EAAEpB,kBAAkB,CAACqB,UAAU,CAAC,MAAM,CAAC;EACxE,CAAC,EACD,CAACd,OAAO,CACV,CAAC;EAED,oBACET,KAAA,CAAAwB,aAAA,CAACV,eAAe;IACdW,iBAAiB,EAAC,+BAA+B;IACjDC,kBAAkB,EAAC,MAAM;IACzBhB,QAAQ,EAAES,UAAW;IACrBR,YAAY,EAAEA,YAAa;IAC3BC,KAAK,EAAEA,KAAM;IACbe,MAAM,EAAEtB,6BAA8B;IACtCY,KAAK,EAAEA,KAAM;IACbR,OAAO,EAAEW;EAAY,GAEpBZ,QAAQ,iBACPR,KAAA,CAAAwB,aAAA,CAACR,aAAa;IAACN,QAAQ,EAAES,UAAW;IAACF,KAAK,EAAEA,KAAM;IAACW,IAAI,EAAC;EAAM,CAAE,CAEnD,CAAC;AAEtB,CAAC;AAED,eAAerB,IAAI","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ import React, { useCallback } from "react";
2
+ import { KeyboardController } from "../../../../module";
3
+ import Arrow from "../../Arrow";
4
+ import Button from "../../Button";
5
+ import { TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS } from "../../constants";
6
+ import { useToolbarContext } from "../context";
7
+ const Prev = ({
8
+ children,
9
+ onPress,
10
+ disabled,
11
+ rippleRadius,
12
+ style,
13
+ button: ButtonContainer = Button,
14
+ icon: IconContainer = Arrow
15
+ }) => {
16
+ const {
17
+ theme,
18
+ isPrevDisabled
19
+ } = useToolbarContext();
20
+ const isDisabled = disabled ?? isPrevDisabled;
21
+ const onPressPrev = useCallback(event => {
22
+ onPress === null || onPress === void 0 || onPress(event);
23
+ if (!event.isDefaultPrevented()) KeyboardController.setFocusTo("prev");
24
+ }, [onPress]);
25
+ return /*#__PURE__*/React.createElement(ButtonContainer, {
26
+ accessibilityHint: "Moves focus to the previous field",
27
+ accessibilityLabel: "Previous",
28
+ disabled: isDisabled,
29
+ rippleRadius: rippleRadius,
30
+ style: style,
31
+ testID: TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS,
32
+ theme: theme,
33
+ onPress: onPressPrev
34
+ }, children ?? /*#__PURE__*/React.createElement(IconContainer, {
35
+ disabled: isDisabled,
36
+ theme: theme,
37
+ type: "prev"
38
+ }));
39
+ };
40
+ export default Prev;
41
+ //# sourceMappingURL=Prev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useCallback","KeyboardController","Arrow","Button","TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS","useToolbarContext","Prev","children","onPress","disabled","rippleRadius","style","button","ButtonContainer","icon","IconContainer","theme","isPrevDisabled","isDisabled","onPressPrev","event","isDefaultPrevented","setFocusTo","createElement","accessibilityHint","accessibilityLabel","testID","type"],"sources":["Prev.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\n\nimport { KeyboardController } from \"../../../../module\";\nimport Arrow from \"../../Arrow\";\nimport Button from \"../../Button\";\nimport { TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS } from \"../../constants\";\nimport { useToolbarContext } from \"../context\";\n\nimport type { ButtonSubProps } from \"./types\";\nimport type { GestureResponderEvent } from \"react-native\";\n\nconst Prev: React.FC<ButtonSubProps> = ({\n children,\n onPress,\n disabled,\n rippleRadius,\n style,\n button: ButtonContainer = Button,\n icon: IconContainer = Arrow,\n}) => {\n const { theme, isPrevDisabled } = useToolbarContext();\n const isDisabled = disabled ?? isPrevDisabled;\n const onPressPrev = useCallback(\n (event: GestureResponderEvent) => {\n onPress?.(event);\n if (!event.isDefaultPrevented()) KeyboardController.setFocusTo(\"prev\");\n },\n [onPress],\n );\n\n return (\n <ButtonContainer\n accessibilityHint=\"Moves focus to the previous field\"\n accessibilityLabel=\"Previous\"\n disabled={isDisabled}\n rippleRadius={rippleRadius}\n style={style}\n testID={TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS}\n theme={theme}\n onPress={onPressPrev}\n >\n {children ?? (\n <IconContainer disabled={isDisabled} theme={theme} type=\"prev\" />\n )}\n </ButtonContainer>\n );\n};\n\nexport default Prev;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAE1C,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,MAAM,MAAM,cAAc;AACjC,SAASC,iCAAiC,QAAQ,iBAAiB;AACnE,SAASC,iBAAiB,QAAQ,YAAY;AAK9C,MAAMC,IAA8B,GAAGA,CAAC;EACtCC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,YAAY;EACZC,KAAK;EACLC,MAAM,EAAEC,eAAe,GAAGV,MAAM;EAChCW,IAAI,EAAEC,aAAa,GAAGb;AACxB,CAAC,KAAK;EACJ,MAAM;IAAEc,KAAK;IAAEC;EAAe,CAAC,GAAGZ,iBAAiB,CAAC,CAAC;EACrD,MAAMa,UAAU,GAAGT,QAAQ,IAAIQ,cAAc;EAC7C,MAAME,WAAW,GAAGnB,WAAW,CAC5BoB,KAA4B,IAAK;IAChCZ,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAGY,KAAK,CAAC;IAChB,IAAI,CAACA,KAAK,CAACC,kBAAkB,CAAC,CAAC,EAAEpB,kBAAkB,CAACqB,UAAU,CAAC,MAAM,CAAC;EACxE,CAAC,EACD,CAACd,OAAO,CACV,CAAC;EAED,oBACET,KAAA,CAAAwB,aAAA,CAACV,eAAe;IACdW,iBAAiB,EAAC,mCAAmC;IACrDC,kBAAkB,EAAC,UAAU;IAC7BhB,QAAQ,EAAES,UAAW;IACrBR,YAAY,EAAEA,YAAa;IAC3BC,KAAK,EAAEA,KAAM;IACbe,MAAM,EAAEtB,iCAAkC;IAC1CY,KAAK,EAAEA,KAAM;IACbR,OAAO,EAAEW;EAAY,GAEpBZ,QAAQ,iBACPR,KAAA,CAAAwB,aAAA,CAACR,aAAa;IAACN,QAAQ,EAAES,UAAW;IAACF,KAAK,EAAEA,KAAM;IAACW,IAAI,EAAC;EAAM,CAAE,CAEnD,CAAC;AAEtB,CAAC;AAED,eAAerB,IAAI","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ export { default as Background } from "./Background";
2
+ export { default as Content } from "./Content";
3
+ export { default as Done } from "./Done";
4
+ export { default as Next } from "./Next";
5
+ export { default as Prev } from "./Prev";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["default","Background","Content","Done","Next","Prev"],"sources":["index.ts"],"sourcesContent":["export { default as Background } from \"./Background\";\nexport { default as Content } from \"./Content\";\nexport { default as Done } from \"./Done\";\nexport { default as Next } from \"./Next\";\nexport { default as Prev } from \"./Prev\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,UAAU,QAAQ,cAAc;AACpD,SAASD,OAAO,IAAIE,OAAO,QAAQ,WAAW;AAC9C,SAASF,OAAO,IAAIG,IAAI,QAAQ,QAAQ;AACxC,SAASH,OAAO,IAAII,IAAI,QAAQ,QAAQ;AACxC,SAASJ,OAAO,IAAIK,IAAI,QAAQ,QAAQ","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type Arrow from \"../../Arrow\";\nimport type Button from \"../../Button\";\nimport type { ReactNode } from \"react\";\nimport type { GestureResponderEvent, ViewStyle } from \"react-native\";\n\nexport type ButtonSubProps = {\n children?: ReactNode;\n onPress?: (event: GestureResponderEvent) => void;\n disabled?: boolean;\n testID?: string;\n rippleRadius?: number;\n style?: ViewStyle;\n button?: typeof Button;\n icon?: typeof Arrow;\n};\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import { createContext, useContext } from "react";
2
+ export const ToolbarContext = /*#__PURE__*/createContext(undefined);
3
+ export const useToolbarContext = () => {
4
+ const context = useContext(ToolbarContext);
5
+ if (!context) {
6
+ throw new Error("KeyboardToolbar.* component must be used inside <KeyboardToolbar>");
7
+ }
8
+ return context;
9
+ };
10
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createContext","useContext","ToolbarContext","undefined","useToolbarContext","context","Error"],"sources":["context.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\nimport type { KeyboardToolbarTheme } from \"../types\";\n\ntype ToolbarContextType = {\n theme: KeyboardToolbarTheme;\n isPrevDisabled: boolean;\n isNextDisabled: boolean;\n};\n\nexport const ToolbarContext = createContext<ToolbarContextType | undefined>(\n undefined,\n);\n\nexport const useToolbarContext = () => {\n const context = useContext(ToolbarContext);\n\n if (!context) {\n throw new Error(\n \"KeyboardToolbar.* component must be used inside <KeyboardToolbar>\",\n );\n }\n\n return context;\n};\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,UAAU,QAAQ,OAAO;AAUjD,OAAO,MAAMC,cAAc,gBAAGF,aAAa,CACzCG,SACF,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACrC,MAAMC,OAAO,GAAGJ,UAAU,CAACC,cAAc,CAAC;EAE1C,IAAI,CAACG,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CACb,mEACF,CAAC;EACH;EAEA,OAAOD,OAAO;AAChB,CAAC","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ import { KEYBOARD_BORDER_RADIUS } from "../../constants";
2
+ export const TEST_ID_KEYBOARD_TOOLBAR = "keyboard.toolbar";
3
+ export const TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;
4
+ export const TEST_ID_KEYBOARD_TOOLBAR_NEXT = `${TEST_ID_KEYBOARD_TOOLBAR}.next`;
5
+ export const TEST_ID_KEYBOARD_TOOLBAR_CONTENT = `${TEST_ID_KEYBOARD_TOOLBAR}.content`;
6
+ export const TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;
7
+ export const KEYBOARD_TOOLBAR_HEIGHT = 42;
8
+ export const DEFAULT_OPACITY = "FF";
9
+ export const KEYBOARD_HAS_ROUNDED_CORNERS = KEYBOARD_BORDER_RADIUS > 0;
10
+ export const OPENED_OFFSET = KEYBOARD_HAS_ROUNDED_CORNERS ? -11 : 0;
11
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["KEYBOARD_BORDER_RADIUS","TEST_ID_KEYBOARD_TOOLBAR","TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS","TEST_ID_KEYBOARD_TOOLBAR_NEXT","TEST_ID_KEYBOARD_TOOLBAR_CONTENT","TEST_ID_KEYBOARD_TOOLBAR_DONE","KEYBOARD_TOOLBAR_HEIGHT","DEFAULT_OPACITY","KEYBOARD_HAS_ROUNDED_CORNERS","OPENED_OFFSET"],"sources":["constants.ts"],"sourcesContent":["import { KEYBOARD_BORDER_RADIUS } from \"../../constants\";\n\nimport type { HEX } from \"./types\";\n\nexport const TEST_ID_KEYBOARD_TOOLBAR = \"keyboard.toolbar\";\nexport const TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;\nexport const TEST_ID_KEYBOARD_TOOLBAR_NEXT = `${TEST_ID_KEYBOARD_TOOLBAR}.next`;\nexport const TEST_ID_KEYBOARD_TOOLBAR_CONTENT = `${TEST_ID_KEYBOARD_TOOLBAR}.content`;\nexport const TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;\n\nexport const KEYBOARD_TOOLBAR_HEIGHT = 42;\nexport const DEFAULT_OPACITY: HEX = \"FF\";\nexport const KEYBOARD_HAS_ROUNDED_CORNERS = KEYBOARD_BORDER_RADIUS > 0;\nexport const OPENED_OFFSET = KEYBOARD_HAS_ROUNDED_CORNERS ? -11 : 0;\n"],"mappings":"AAAA,SAASA,sBAAsB,QAAQ,iBAAiB;AAIxD,OAAO,MAAMC,wBAAwB,GAAG,kBAAkB;AAC1D,OAAO,MAAMC,iCAAiC,GAAG,GAAGD,wBAAwB,WAAW;AACvF,OAAO,MAAME,6BAA6B,GAAG,GAAGF,wBAAwB,OAAO;AAC/E,OAAO,MAAMG,gCAAgC,GAAG,GAAGH,wBAAwB,UAAU;AACrF,OAAO,MAAMI,6BAA6B,GAAG,GAAGJ,wBAAwB,OAAO;AAE/E,OAAO,MAAMK,uBAAuB,GAAG,EAAE;AACzC,OAAO,MAAMC,eAAoB,GAAG,IAAI;AACxC,OAAO,MAAMC,4BAA4B,GAAGR,sBAAsB,GAAG,CAAC;AACtE,OAAO,MAAMS,aAAa,GAAGD,4BAA4B,GAAG,CAAC,EAAE,GAAG,CAAC","ignoreList":[]}
@@ -1,32 +1,24 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React, { useCallback, useEffect, useMemo, useState } from "react";
3
- import { StyleSheet, Text, View } from "react-native";
4
- import { FocusedInputEvents } from "../../bindings";
2
+ import React, { useEffect, useMemo, useState } from "react";
3
+ import { StyleSheet, View } from "react-native";
4
+ import { FocusedInputEvents, RCTKeyboardToolbarGroupView } from "../../bindings";
5
+ import { useKeyboardState } from "../../hooks";
5
6
  import KeyboardStickyView from "../KeyboardStickyView";
6
- import { KeyboardControllerNative } from "../../bindings";
7
- import useColorScheme from "../hooks/useColorScheme";
8
7
  import Arrow from "./Arrow";
9
8
  import Button from "./Button";
10
9
  import { colors } from "./colors";
11
- const TEST_ID_KEYBOARD_TOOLBAR = "keyboard.toolbar";
12
- const TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;
13
- const TEST_ID_KEYBOARD_TOOLBAR_NEXT = `${TEST_ID_KEYBOARD_TOOLBAR}.next`;
14
- const TEST_ID_KEYBOARD_TOOLBAR_CONTENT = `${TEST_ID_KEYBOARD_TOOLBAR}.content`;
15
- const TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;
16
- const KEYBOARD_TOOLBAR_HEIGHT = 42;
17
- const DEFAULT_OPACITY = "FF";
18
- const dismissKeyboard = () => KeyboardControllerNative.dismiss(false);
19
- const goToNextField = () => KeyboardControllerNative.setFocusTo("next");
20
- const goToPrevField = () => KeyboardControllerNative.setFocusTo("prev");
21
-
10
+ import { Background, Content, Done, Next, Prev } from "./compound/components";
11
+ import { ToolbarContext } from "./compound/context";
12
+ import { DEFAULT_OPACITY, KEYBOARD_HAS_ROUNDED_CORNERS, KEYBOARD_TOOLBAR_HEIGHT, OPENED_OFFSET, TEST_ID_KEYBOARD_TOOLBAR } from "./constants";
22
13
  /**
23
14
  * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and
24
15
  * `Done` buttons.
25
16
  */
26
17
  const KeyboardToolbar = ({
18
+ children,
27
19
  content,
28
20
  theme = colors,
29
- doneText,
21
+ doneText = "Done",
30
22
  button,
31
23
  icon,
32
24
  showArrows = true,
@@ -40,92 +32,103 @@ const KeyboardToolbar = ({
40
32
  opened = 0
41
33
  } = {},
42
34
  enabled = true,
35
+ insets,
43
36
  ...rest
44
37
  }) => {
45
- const colorScheme = useColorScheme();
38
+ const colorScheme = useKeyboardState(state => state.appearance);
46
39
  const [inputs, setInputs] = useState({
47
40
  current: 0,
48
41
  count: 0
49
42
  });
50
43
  const isPrevDisabled = inputs.current === 0;
51
44
  const isNextDisabled = inputs.current === inputs.count - 1;
45
+ const buttonContainer = button ?? Button;
46
+ const iconContainer = icon ?? Arrow;
52
47
  useEffect(() => {
53
48
  const subscription = FocusedInputEvents.addListener("focusDidSet", e => {
54
49
  setInputs(e);
55
50
  });
56
51
  return subscription.remove;
57
52
  }, []);
58
- const doneStyle = useMemo(() => [styles.doneButton, {
59
- color: theme[colorScheme].primary
60
- }], [colorScheme, theme]);
61
53
  const toolbarStyle = useMemo(() => [styles.toolbar, {
62
54
  backgroundColor: `${theme[colorScheme].background}${opacity}`
63
- }], [colorScheme, opacity, theme]);
55
+ }, !KEYBOARD_HAS_ROUNDED_CORNERS ? {
56
+ paddingLeft: insets === null || insets === void 0 ? void 0 : insets.left,
57
+ paddingRight: insets === null || insets === void 0 ? void 0 : insets.right
58
+ } : null, KEYBOARD_HAS_ROUNDED_CORNERS ? styles.floating : null], [colorScheme, opacity, theme, insets]);
59
+ const containerStyle = useMemo(() => [
60
+ // CRUCIAL: gives the native view real bounds
61
+ styles.sticky, KEYBOARD_HAS_ROUNDED_CORNERS ? {
62
+ left: ((insets === null || insets === void 0 ? void 0 : insets.left) ?? 0) + 16,
63
+ right: ((insets === null || insets === void 0 ? void 0 : insets.right) ?? 0) + 16
64
+ } : null], [insets]);
64
65
  const offset = useMemo(() => ({
65
66
  closed: closed + KEYBOARD_TOOLBAR_HEIGHT,
66
- opened
67
+ opened: opened + OPENED_OFFSET
67
68
  }), [closed, opened]);
68
- const ButtonContainer = button || Button;
69
- const IconContainer = icon || Arrow;
70
- const onPressNext = useCallback(() => {
71
- goToNextField();
72
- onNextCallback === null || onNextCallback === void 0 || onNextCallback();
73
- }, [onNextCallback]);
74
- const onPressPrev = useCallback(() => {
75
- goToPrevField();
76
- onPrevCallback === null || onPrevCallback === void 0 || onPrevCallback();
77
- }, [onPrevCallback]);
78
- const onPressDone = useCallback(() => {
79
- dismissKeyboard();
80
- onDoneCallback === null || onDoneCallback === void 0 || onDoneCallback();
81
- }, [onDoneCallback]);
82
- return /*#__PURE__*/React.createElement(KeyboardStickyView, {
69
+ let backgroundElement = null;
70
+ let arrowsElement = null;
71
+ let contentContainer = null;
72
+ let doneElement = null;
73
+ if (children) {
74
+ let prevChild = null;
75
+ let nextChild = null;
76
+ let contentChild = null;
77
+ let doneChild = null;
78
+ let backgroundChild = null;
79
+ React.Children.forEach(children, child => {
80
+ if (! /*#__PURE__*/React.isValidElement(child)) return;
81
+ if (child.type === Background) backgroundChild = child;else if (child.type === Content) contentChild = child;else if (child.type === Prev) prevChild = child;else if (child.type === Next) nextChild = child;else if (child.type === Done) doneChild = child;
82
+ });
83
+ backgroundElement = backgroundChild;
84
+ doneElement = doneChild;
85
+ arrowsElement = prevChild || nextChild ? /*#__PURE__*/React.createElement(View, {
86
+ style: styles.arrows
87
+ }, prevChild, nextChild) : null;
88
+ contentContainer = contentChild ?? /*#__PURE__*/React.createElement(Content, null, contentChild);
89
+ } else {
90
+ backgroundElement = blur;
91
+ arrowsElement = showArrows ? /*#__PURE__*/React.createElement(View, {
92
+ style: styles.arrows
93
+ }, /*#__PURE__*/React.createElement(Prev, {
94
+ button: buttonContainer,
95
+ icon: iconContainer,
96
+ onPress: onPrevCallback
97
+ }), /*#__PURE__*/React.createElement(Next, {
98
+ button: buttonContainer,
99
+ icon: iconContainer,
100
+ onPress: onNextCallback
101
+ })) : null;
102
+ contentContainer = /*#__PURE__*/React.createElement(Content, null, content);
103
+ doneElement = doneText ? /*#__PURE__*/React.createElement(Done, {
104
+ button: buttonContainer,
105
+ text: doneText,
106
+ onPress: onDoneCallback
107
+ }) : null;
108
+ }
109
+ const contextValue = useMemo(() => ({
110
+ theme,
111
+ isPrevDisabled,
112
+ isNextDisabled
113
+ }), [theme, isPrevDisabled, isNextDisabled]);
114
+ return /*#__PURE__*/React.createElement(ToolbarContext.Provider, {
115
+ value: contextValue
116
+ }, /*#__PURE__*/React.createElement(KeyboardStickyView, {
83
117
  enabled: enabled,
84
- offset: offset
118
+ offset: offset,
119
+ style: containerStyle
85
120
  }, /*#__PURE__*/React.createElement(View, _extends({}, rest, {
86
121
  style: toolbarStyle,
87
122
  testID: TEST_ID_KEYBOARD_TOOLBAR
88
- }), blur, showArrows && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ButtonContainer, {
89
- accessibilityLabel: "Previous",
90
- accessibilityHint: "Will move focus to previous field",
91
- disabled: isPrevDisabled,
92
- onPress: onPressPrev,
93
- testID: TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS,
94
- theme: theme
95
- }, /*#__PURE__*/React.createElement(IconContainer, {
96
- disabled: isPrevDisabled,
97
- type: "prev",
98
- theme: theme
99
- })), /*#__PURE__*/React.createElement(ButtonContainer, {
100
- accessibilityLabel: "Next",
101
- accessibilityHint: "Will move focus to next field",
102
- disabled: isNextDisabled,
103
- onPress: onPressNext,
104
- testID: TEST_ID_KEYBOARD_TOOLBAR_NEXT,
105
- theme: theme
106
- }, /*#__PURE__*/React.createElement(IconContainer, {
107
- disabled: isNextDisabled,
108
- type: "next",
109
- theme: theme
110
- }))), /*#__PURE__*/React.createElement(View, {
111
- style: styles.flex,
112
- testID: TEST_ID_KEYBOARD_TOOLBAR_CONTENT
113
- }, content), /*#__PURE__*/React.createElement(ButtonContainer, {
114
- accessibilityLabel: "Done",
115
- accessibilityHint: "Will close the keyboard",
116
- onPress: onPressDone,
117
- testID: TEST_ID_KEYBOARD_TOOLBAR_DONE,
118
- rippleRadius: 28,
119
- style: styles.doneButtonContainer,
120
- theme: theme
121
- }, /*#__PURE__*/React.createElement(Text, {
122
- style: doneStyle,
123
- maxFontSizeMultiplier: 1.3
124
- }, doneText || "Done"))));
123
+ }), backgroundElement, arrowsElement, contentContainer, doneElement)));
125
124
  };
126
125
  const styles = StyleSheet.create({
127
- flex: {
128
- flex: 1
126
+ sticky: {
127
+ position: "absolute",
128
+ left: 0,
129
+ right: 0,
130
+ bottom: 0,
131
+ height: KEYBOARD_TOOLBAR_HEIGHT
129
132
  },
130
133
  toolbar: {
131
134
  position: "absolute",
@@ -133,17 +136,24 @@ const styles = StyleSheet.create({
133
136
  alignItems: "center",
134
137
  width: "100%",
135
138
  flexDirection: "row",
136
- height: KEYBOARD_TOOLBAR_HEIGHT,
137
- paddingHorizontal: 8
139
+ height: KEYBOARD_TOOLBAR_HEIGHT
138
140
  },
139
- doneButton: {
140
- fontWeight: "600",
141
- fontSize: 15
141
+ arrows: {
142
+ flexDirection: "row",
143
+ paddingLeft: 8
142
144
  },
143
- doneButtonContainer: {
144
- marginRight: 8
145
+ floating: {
146
+ alignSelf: "center",
147
+ borderRadius: 20,
148
+ overflow: "hidden"
145
149
  }
146
150
  });
151
+ KeyboardToolbar.Background = Background;
152
+ KeyboardToolbar.Content = Content;
153
+ KeyboardToolbar.Prev = Prev;
154
+ KeyboardToolbar.Next = Next;
155
+ KeyboardToolbar.Done = Done;
156
+ KeyboardToolbar.Group = RCTKeyboardToolbarGroupView;
147
157
  export { colors as DefaultKeyboardToolbarTheme };
148
158
  export default KeyboardToolbar;
149
159
  //# sourceMappingURL=index.js.map