@react-native-ohos/react-native-keyboard-controller 1.12.8-beta.9

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 (251) hide show
  1. package/LICENSE +21 -0
  2. package/README.OpenSource +11 -0
  3. package/README.md +19 -0
  4. package/harmony/keyboard_controller/BuildProfile.ets +17 -0
  5. package/harmony/keyboard_controller/Index.ets +30 -0
  6. package/harmony/keyboard_controller/ResourceTable.txt +9 -0
  7. package/harmony/keyboard_controller/build-profile.json5 +31 -0
  8. package/harmony/keyboard_controller/consumer-rules.txt +0 -0
  9. package/harmony/keyboard_controller/hvigorfile.ts +6 -0
  10. package/harmony/keyboard_controller/obfuscation-rules.txt +18 -0
  11. package/harmony/keyboard_controller/oh-package-lock.json5 +19 -0
  12. package/harmony/keyboard_controller/oh-package.json5 +11 -0
  13. package/harmony/keyboard_controller/src/main/cpp/CMakeLists.txt +7 -0
  14. package/harmony/keyboard_controller/src/main/cpp/EventEmitters.cpp +96 -0
  15. package/harmony/keyboard_controller/src/main/cpp/EventEmitters.h +111 -0
  16. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentDescriptor.h +98 -0
  17. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.cpp +274 -0
  18. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.h +101 -0
  19. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewJSIBinder.h +64 -0
  20. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentDescriptor.h +85 -0
  21. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.cpp +110 -0
  22. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.h +84 -0
  23. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaJSIBinder.h +60 -0
  24. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.cpp +46 -0
  25. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.h +48 -0
  26. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardControllerPackage.cpp +64 -0
  27. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardControllerPackage.h +77 -0
  28. package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.cpp +45 -0
  29. package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.h +49 -0
  30. package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.cpp +186 -0
  31. package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.h +112 -0
  32. package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.cpp +64 -0
  33. package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.h +77 -0
  34. package/harmony/keyboard_controller/src/main/ets/Logger.ts +67 -0
  35. package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerPackage.ets +70 -0
  36. package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerTurboModule.ts +245 -0
  37. package/harmony/keyboard_controller/src/main/ets/RNStatusBarManagerCompatTurboModule.ts +119 -0
  38. package/harmony/keyboard_controller/src/main/ets/Type.ts +62 -0
  39. package/harmony/keyboard_controller/src/main/module.json +29 -0
  40. package/harmony/keyboard_controller/src/main/module.json5 +11 -0
  41. package/harmony/keyboard_controller/src/main/resources/base/element/string.json +8 -0
  42. package/harmony/keyboard_controller/src/main/resources/en_US/element/string.json +8 -0
  43. package/harmony/keyboard_controller/src/main/resources/zh_CN/element/string.json +8 -0
  44. package/harmony/keyboard_controller/ts.ets +30 -0
  45. package/harmony/keyboard_controller.har +0 -0
  46. package/lib/commonjs/animated.js +188 -0
  47. package/lib/commonjs/animated.js.map +1 -0
  48. package/lib/commonjs/bindings.js +38 -0
  49. package/lib/commonjs/bindings.js.map +1 -0
  50. package/lib/commonjs/bindings.native.js +37 -0
  51. package/lib/commonjs/bindings.native.js.map +1 -0
  52. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js +66 -0
  53. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js.map +1 -0
  54. package/lib/commonjs/components/KeyboardAvoidingView/index.js +102 -0
  55. package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -0
  56. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +255 -0
  57. package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -0
  58. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +110 -0
  59. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -0
  60. package/lib/commonjs/components/KeyboardAwareScrollView/utils.js +37 -0
  61. package/lib/commonjs/components/KeyboardAwareScrollView/utils.js.map +1 -0
  62. package/lib/commonjs/components/KeyboardStickyView/index.js +40 -0
  63. package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -0
  64. package/lib/commonjs/components/KeyboardToolbar/Arrow.js +76 -0
  65. package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -0
  66. package/lib/commonjs/components/KeyboardToolbar/Button.js +70 -0
  67. package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -0
  68. package/lib/commonjs/components/KeyboardToolbar/colors.js +21 -0
  69. package/lib/commonjs/components/KeyboardToolbar/colors.js.map +1 -0
  70. package/lib/commonjs/components/KeyboardToolbar/colors.native.js +40 -0
  71. package/lib/commonjs/components/KeyboardToolbar/colors.native.js.map +1 -0
  72. package/lib/commonjs/components/KeyboardToolbar/index.js +152 -0
  73. package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -0
  74. package/lib/commonjs/components/KeyboardToolbar/types.js +6 -0
  75. package/lib/commonjs/components/KeyboardToolbar/types.js.map +1 -0
  76. package/lib/commonjs/components/hooks/useColorScheme.js +10 -0
  77. package/lib/commonjs/components/hooks/useColorScheme.js.map +1 -0
  78. package/lib/commonjs/components/index.js +42 -0
  79. package/lib/commonjs/components/index.js.map +1 -0
  80. package/lib/commonjs/constants.js +27 -0
  81. package/lib/commonjs/constants.js.map +1 -0
  82. package/lib/commonjs/context.js +42 -0
  83. package/lib/commonjs/context.js.map +1 -0
  84. package/lib/commonjs/hooks/index.js +104 -0
  85. package/lib/commonjs/hooks/index.js.map +1 -0
  86. package/lib/commonjs/hooks/useWindowDimensions/index.android.js +29 -0
  87. package/lib/commonjs/hooks/useWindowDimensions/index.android.js.map +1 -0
  88. package/lib/commonjs/hooks/useWindowDimensions/index.js +13 -0
  89. package/lib/commonjs/hooks/useWindowDimensions/index.js.map +1 -0
  90. package/lib/commonjs/index.js +116 -0
  91. package/lib/commonjs/index.js.map +1 -0
  92. package/lib/commonjs/internal.js +73 -0
  93. package/lib/commonjs/internal.js.map +1 -0
  94. package/lib/commonjs/monkey-patch.android.js +57 -0
  95. package/lib/commonjs/monkey-patch.android.js.map +1 -0
  96. package/lib/commonjs/monkey-patch.js +11 -0
  97. package/lib/commonjs/monkey-patch.js.map +1 -0
  98. package/lib/commonjs/reanimated.js +12 -0
  99. package/lib/commonjs/reanimated.js.map +1 -0
  100. package/lib/commonjs/reanimated.native.js +88 -0
  101. package/lib/commonjs/reanimated.native.js.map +1 -0
  102. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js +10 -0
  103. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -0
  104. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js +12 -0
  105. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -0
  106. package/lib/commonjs/specs/NativeKeyboardController.js +9 -0
  107. package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -0
  108. package/lib/commonjs/specs/NativeStatusBarManagerCompat.js +9 -0
  109. package/lib/commonjs/specs/NativeStatusBarManagerCompat.js.map +1 -0
  110. package/lib/commonjs/types.js +6 -0
  111. package/lib/commonjs/types.js.map +1 -0
  112. package/lib/commonjs/utils.js +9 -0
  113. package/lib/commonjs/utils.js.map +1 -0
  114. package/lib/module/animated.js +180 -0
  115. package/lib/module/animated.js.map +1 -0
  116. package/lib/module/bindings.js +32 -0
  117. package/lib/module/bindings.js.map +1 -0
  118. package/lib/module/bindings.native.js +31 -0
  119. package/lib/module/bindings.native.js.map +1 -0
  120. package/lib/module/components/KeyboardAvoidingView/hooks.js +59 -0
  121. package/lib/module/components/KeyboardAvoidingView/hooks.js.map +1 -0
  122. package/lib/module/components/KeyboardAvoidingView/index.js +95 -0
  123. package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -0
  124. package/lib/module/components/KeyboardAwareScrollView/index.js +248 -0
  125. package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -0
  126. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +103 -0
  127. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -0
  128. package/lib/module/components/KeyboardAwareScrollView/utils.js +29 -0
  129. package/lib/module/components/KeyboardAwareScrollView/utils.js.map +1 -0
  130. package/lib/module/components/KeyboardStickyView/index.js +33 -0
  131. package/lib/module/components/KeyboardStickyView/index.js.map +1 -0
  132. package/lib/module/components/KeyboardToolbar/Arrow.js +68 -0
  133. package/lib/module/components/KeyboardToolbar/Arrow.js.map +1 -0
  134. package/lib/module/components/KeyboardToolbar/Button.js +62 -0
  135. package/lib/module/components/KeyboardToolbar/Button.js.map +1 -0
  136. package/lib/module/components/KeyboardToolbar/colors.js +15 -0
  137. package/lib/module/components/KeyboardToolbar/colors.js.map +1 -0
  138. package/lib/module/components/KeyboardToolbar/colors.native.js +34 -0
  139. package/lib/module/components/KeyboardToolbar/colors.native.js.map +1 -0
  140. package/lib/module/components/KeyboardToolbar/index.js +140 -0
  141. package/lib/module/components/KeyboardToolbar/index.js.map +1 -0
  142. package/lib/module/components/KeyboardToolbar/types.js +2 -0
  143. package/lib/module/components/KeyboardToolbar/types.js.map +1 -0
  144. package/lib/module/components/hooks/useColorScheme.js +4 -0
  145. package/lib/module/components/hooks/useColorScheme.js.map +1 -0
  146. package/lib/module/components/index.js +5 -0
  147. package/lib/module/components/index.js.map +1 -0
  148. package/lib/module/constants.js +21 -0
  149. package/lib/module/constants.js.map +1 -0
  150. package/lib/module/context.js +35 -0
  151. package/lib/module/context.js.map +1 -0
  152. package/lib/module/hooks/index.js +68 -0
  153. package/lib/module/hooks/index.js.map +1 -0
  154. package/lib/module/hooks/useWindowDimensions/index.android.js +22 -0
  155. package/lib/module/hooks/useWindowDimensions/index.android.js.map +1 -0
  156. package/lib/module/hooks/useWindowDimensions/index.js +2 -0
  157. package/lib/module/hooks/useWindowDimensions/index.js.map +1 -0
  158. package/lib/module/index.js +10 -0
  159. package/lib/module/index.js.map +1 -0
  160. package/lib/module/internal.js +66 -0
  161. package/lib/module/internal.js.map +1 -0
  162. package/lib/module/monkey-patch.android.js +47 -0
  163. package/lib/module/monkey-patch.android.js.map +1 -0
  164. package/lib/module/monkey-patch.js +5 -0
  165. package/lib/module/monkey-patch.js.map +1 -0
  166. package/lib/module/reanimated.js +6 -0
  167. package/lib/module/reanimated.js.map +1 -0
  168. package/lib/module/reanimated.native.js +78 -0
  169. package/lib/module/reanimated.native.js.map +1 -0
  170. package/lib/module/specs/KeyboardControllerViewNativeComponent.js +3 -0
  171. package/lib/module/specs/KeyboardControllerViewNativeComponent.js.map +1 -0
  172. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js +5 -0
  173. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js.map +1 -0
  174. package/lib/module/specs/NativeKeyboardController.js +3 -0
  175. package/lib/module/specs/NativeKeyboardController.js.map +1 -0
  176. package/lib/module/specs/NativeStatusBarManagerCompat.js +3 -0
  177. package/lib/module/specs/NativeStatusBarManagerCompat.js.map +1 -0
  178. package/lib/module/types.js +2 -0
  179. package/lib/module/types.js.map +1 -0
  180. package/lib/module/utils.js +2 -0
  181. package/lib/module/utils.js.map +1 -0
  182. package/lib/typescript/animated.d.ts +31 -0
  183. package/lib/typescript/bindings.d.ts +12 -0
  184. package/lib/typescript/bindings.native.d.ts +12 -0
  185. package/lib/typescript/components/KeyboardAvoidingView/hooks.d.ts +6 -0
  186. package/lib/typescript/components/KeyboardAvoidingView/index.d.ts +50 -0
  187. package/lib/typescript/components/KeyboardAwareScrollView/index.d.ts +25 -0
  188. package/lib/typescript/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.d.ts +6 -0
  189. package/lib/typescript/components/KeyboardAwareScrollView/utils.d.ts +2 -0
  190. package/lib/typescript/components/KeyboardStickyView/index.d.ts +35 -0
  191. package/lib/typescript/components/KeyboardToolbar/Arrow.d.ts +9 -0
  192. package/lib/typescript/components/KeyboardToolbar/Button.d.ts +15 -0
  193. package/lib/typescript/components/KeyboardToolbar/colors.d.ts +2 -0
  194. package/lib/typescript/components/KeyboardToolbar/colors.native.d.ts +2 -0
  195. package/lib/typescript/components/KeyboardToolbar/index.d.ts +50 -0
  196. package/lib/typescript/components/KeyboardToolbar/types.d.ts +18 -0
  197. package/lib/typescript/components/hooks/useColorScheme.d.ts +2 -0
  198. package/lib/typescript/components/index.d.ts +8 -0
  199. package/lib/typescript/constants.d.ts +16 -0
  200. package/lib/typescript/context.d.ts +23 -0
  201. package/lib/typescript/hooks/index.d.ts +17 -0
  202. package/lib/typescript/hooks/useWindowDimensions/index.android.d.ts +2 -0
  203. package/lib/typescript/hooks/useWindowDimensions/index.d.ts +1 -0
  204. package/lib/typescript/index.d.ts +8 -0
  205. package/lib/typescript/internal.d.ts +30 -0
  206. package/lib/typescript/monkey-patch.android.d.ts +2 -0
  207. package/lib/typescript/monkey-patch.d.ts +2 -0
  208. package/lib/typescript/reanimated.d.ts +5 -0
  209. package/lib/typescript/reanimated.native.d.ts +7 -0
  210. package/lib/typescript/specs/KeyboardControllerViewNativeComponent.d.ts +53 -0
  211. package/lib/typescript/specs/KeyboardGestureAreaNativeComponent.d.ts +10 -0
  212. package/lib/typescript/specs/NativeKeyboardController.d.ts +12 -0
  213. package/lib/typescript/specs/NativeStatusBarManagerCompat.d.ts +10 -0
  214. package/lib/typescript/types.d.ts +133 -0
  215. package/lib/typescript/utils.d.ts +1 -0
  216. package/package.json +178 -0
  217. package/react-native-keyboard-controller.podspec +61 -0
  218. package/src/animated.tsx +253 -0
  219. package/src/bindings.native.ts +57 -0
  220. package/src/bindings.ts +38 -0
  221. package/src/components/KeyboardAvoidingView/hooks.ts +58 -0
  222. package/src/components/KeyboardAvoidingView/index.tsx +156 -0
  223. package/src/components/KeyboardAwareScrollView/index.tsx +373 -0
  224. package/src/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +133 -0
  225. package/src/components/KeyboardAwareScrollView/utils.ts +41 -0
  226. package/src/components/KeyboardStickyView/index.tsx +57 -0
  227. package/src/components/KeyboardToolbar/Arrow.tsx +80 -0
  228. package/src/components/KeyboardToolbar/Button.tsx +98 -0
  229. package/src/components/KeyboardToolbar/colors.native.ts +37 -0
  230. package/src/components/KeyboardToolbar/colors.ts +16 -0
  231. package/src/components/KeyboardToolbar/index.tsx +211 -0
  232. package/src/components/KeyboardToolbar/types.ts +40 -0
  233. package/src/components/hooks/useColorScheme.ts +5 -0
  234. package/src/components/index.ts +11 -0
  235. package/src/constants.ts +19 -0
  236. package/src/context.ts +65 -0
  237. package/src/hooks/index.ts +90 -0
  238. package/src/hooks/useWindowDimensions/index.android.ts +33 -0
  239. package/src/hooks/useWindowDimensions/index.ts +1 -0
  240. package/src/index.ts +21 -0
  241. package/src/internal.ts +84 -0
  242. package/src/monkey-patch.android.ts +44 -0
  243. package/src/monkey-patch.ts +4 -0
  244. package/src/reanimated.native.ts +132 -0
  245. package/src/reanimated.ts +29 -0
  246. package/src/specs/KeyboardControllerViewNativeComponent.ts +70 -0
  247. package/src/specs/KeyboardGestureAreaNativeComponent.ts +15 -0
  248. package/src/specs/NativeKeyboardController.ts +19 -0
  249. package/src/specs/NativeStatusBarManagerCompat.ts +14 -0
  250. package/src/types.ts +211 -0
  251. package/src/utils.ts +1 -0
@@ -0,0 +1,66 @@
1
+ import { useCallback, useRef } from "react";
2
+ import { Animated } from "react-native";
3
+ import { useSharedValue } from "react-native-reanimated";
4
+ /**
5
+ * Hook for storing worklet handlers (objects with keys, where values are worklets).
6
+ * Returns methods for setting handlers and broadcasting events in them.
7
+ *
8
+ * T is a generic that looks like:
9
+ * @example
10
+ * {
11
+ * onEvent: () => {},
12
+ * onEvent2: () => {},
13
+ * }
14
+ */
15
+ export function useSharedHandlers() {
16
+ const handlers = useSharedValue({});
17
+ const jsHandlers = useRef({});
18
+
19
+ // since js -> worklet -> js call is asynchronous, we can not write handlers
20
+ // straight into shared variable (using current shared value as a previous result),
21
+ // since there may be a race condition in a call, and closure may have out-of-dated
22
+ // values. As a result, some of handlers may be not written to "all handlers" object.
23
+ // Below we are writing all handlers to `ref` and afterwards synchronize them with
24
+ // shared value (since `refs` are not referring to actual value in worklets).
25
+ // This approach allow us to update synchronously handlers in js thread (and it assures,
26
+ // that it will have all of them) and then update them in worklet thread (calls are
27
+ // happening in FIFO order, so we will always have actual value).
28
+ const updateSharedHandlers = () => {
29
+ // eslint-disable-next-line react-compiler/react-compiler
30
+ handlers.value = jsHandlers.current;
31
+ };
32
+ const setHandlers = useCallback(handler => {
33
+ jsHandlers.current = {
34
+ ...jsHandlers.current,
35
+ ...handler
36
+ };
37
+ updateSharedHandlers();
38
+ }, []);
39
+ const broadcast = (type, event) => {
40
+ "worklet";
41
+
42
+ Object.keys(handlers.value).forEach(key => {
43
+ var _handlers$value$key, _handlers$value$key$t;
44
+ (_handlers$value$key = handlers.value[key]) === null || _handlers$value$key === void 0 || (_handlers$value$key$t = _handlers$value$key[type]) === null || _handlers$value$key$t === void 0 || _handlers$value$key$t.call(_handlers$value$key, event);
45
+ });
46
+ };
47
+ return [setHandlers, broadcast];
48
+ }
49
+
50
+ /**
51
+ * TS variant of `useAnimatedValue` hook which is added in RN 0.71
52
+ * A better alternative of storing animated values in refs, since
53
+ * it doesn't recreate a new `Animated.Value` object on every re-render
54
+ * and therefore consumes less memory. We can not use a variant from
55
+ * RN, since this library supports earlier versions of RN.
56
+ *
57
+ * @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937
58
+ */
59
+ export function useAnimatedValue(initialValue, config) {
60
+ const ref = useRef(null);
61
+ if (ref.current == null) {
62
+ ref.current = new Animated.Value(initialValue, config);
63
+ }
64
+ return ref.current;
65
+ }
66
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useRef","Animated","useSharedValue","useSharedHandlers","handlers","jsHandlers","updateSharedHandlers","value","current","setHandlers","handler","broadcast","type","event","Object","keys","forEach","key","_handlers$value$key","_handlers$value$key$t","call","useAnimatedValue","initialValue","config","ref","Value"],"sources":["internal.ts"],"sourcesContent":["import { useCallback, useRef } from \"react\";\r\nimport { Animated } from \"react-native\";\r\nimport { useSharedValue } from \"react-native-reanimated\";\r\n\r\nimport type { Handlers } from \"./types\";\r\n\r\ntype UntypedHandler = Record<string, (event: never) => void>;\r\ntype SharedHandlersReturnType<T extends UntypedHandler> = [\r\n (handler: Handlers<T>) => void,\r\n <K extends keyof T>(type: K, event: Parameters<T[K]>[0]) => void,\r\n];\r\n\r\n/**\r\n * Hook for storing worklet handlers (objects with keys, where values are worklets).\r\n * Returns methods for setting handlers and broadcasting events in them.\r\n *\r\n * T is a generic that looks like:\r\n * @example\r\n * {\r\n * onEvent: () => {},\r\n * onEvent2: () => {},\r\n * }\r\n */\r\nexport function useSharedHandlers<\r\n T extends UntypedHandler,\r\n>(): SharedHandlersReturnType<T> {\r\n const handlers = useSharedValue<Handlers<T>>({});\r\n const jsHandlers = useRef<Handlers<T>>({});\r\n\r\n // since js -> worklet -> js call is asynchronous, we can not write handlers\r\n // straight into shared variable (using current shared value as a previous result),\r\n // since there may be a race condition in a call, and closure may have out-of-dated\r\n // values. As a result, some of handlers may be not written to \"all handlers\" object.\r\n // Below we are writing all handlers to `ref` and afterwards synchronize them with\r\n // shared value (since `refs` are not referring to actual value in worklets).\r\n // This approach allow us to update synchronously handlers in js thread (and it assures,\r\n // that it will have all of them) and then update them in worklet thread (calls are\r\n // happening in FIFO order, so we will always have actual value).\r\n const updateSharedHandlers = () => {\r\n // eslint-disable-next-line react-compiler/react-compiler\r\n handlers.value = jsHandlers.current;\r\n };\r\n const setHandlers = useCallback((handler: Handlers<T>) => {\r\n jsHandlers.current = {\r\n ...jsHandlers.current,\r\n ...handler,\r\n };\r\n updateSharedHandlers();\r\n }, []);\r\n const broadcast = <K extends keyof T>(\r\n type: K,\r\n event: Parameters<T[K]>[0],\r\n ) => {\r\n \"worklet\";\r\n\r\n Object.keys(handlers.value).forEach((key) => {\r\n handlers.value[key]?.[type]?.(event);\r\n });\r\n };\r\n\r\n return [setHandlers, broadcast];\r\n}\r\n\r\n/**\r\n * TS variant of `useAnimatedValue` hook which is added in RN 0.71\r\n * A better alternative of storing animated values in refs, since\r\n * it doesn't recreate a new `Animated.Value` object on every re-render\r\n * and therefore consumes less memory. We can not use a variant from\r\n * RN, since this library supports earlier versions of RN.\r\n *\r\n * @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937\r\n */\r\nexport function useAnimatedValue(\r\n initialValue: number,\r\n config?: Animated.AnimatedConfig,\r\n): Animated.Value {\r\n const ref = useRef<Animated.Value | null>(null);\r\n\r\n if (ref.current == null) {\r\n ref.current = new Animated.Value(initialValue, config);\r\n }\r\n\r\n return ref.current;\r\n}\r\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,MAAM,QAAQ,OAAO;AAC3C,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,cAAc,QAAQ,yBAAyB;AAUxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAA,EAEA;EAC/B,MAAMC,QAAQ,GAAGF,cAAc,CAAc,CAAC,CAAC,CAAC;EAChD,MAAMG,UAAU,GAAGL,MAAM,CAAc,CAAC,CAAC,CAAC;;EAE1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMM,oBAAoB,GAAGA,CAAA,KAAM;IACjC;IACAF,QAAQ,CAACG,KAAK,GAAGF,UAAU,CAACG,OAAO;EACrC,CAAC;EACD,MAAMC,WAAW,GAAGV,WAAW,CAAEW,OAAoB,IAAK;IACxDL,UAAU,CAACG,OAAO,GAAG;MACnB,GAAGH,UAAU,CAACG,OAAO;MACrB,GAAGE;IACL,CAAC;IACDJ,oBAAoB,CAAC,CAAC;EACxB,CAAC,EAAE,EAAE,CAAC;EACN,MAAMK,SAAS,GAAGA,CAChBC,IAAO,EACPC,KAA0B,KACvB;IACH,SAAS;;IAETC,MAAM,CAACC,IAAI,CAACX,QAAQ,CAACG,KAAK,CAAC,CAACS,OAAO,CAAEC,GAAG,IAAK;MAAA,IAAAC,mBAAA,EAAAC,qBAAA;MAC3C,CAAAD,mBAAA,GAAAd,QAAQ,CAACG,KAAK,CAACU,GAAG,CAAC,cAAAC,mBAAA,gBAAAC,qBAAA,GAAnBD,mBAAA,CAAsBN,IAAI,CAAC,cAAAO,qBAAA,eAA3BA,qBAAA,CAAAC,IAAA,CAAAF,mBAAA,EAA8BL,KAAK,CAAC;IACtC,CAAC,CAAC;EACJ,CAAC;EAED,OAAO,CAACJ,WAAW,EAAEE,SAAS,CAAC;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,gBAAgBA,CAC9BC,YAAoB,EACpBC,MAAgC,EAChB;EAChB,MAAMC,GAAG,GAAGxB,MAAM,CAAwB,IAAI,CAAC;EAE/C,IAAIwB,GAAG,CAAChB,OAAO,IAAI,IAAI,EAAE;IACvBgB,GAAG,CAAChB,OAAO,GAAG,IAAIP,QAAQ,CAACwB,KAAK,CAACH,YAAY,EAAEC,MAAM,CAAC;EACxD;EAEA,OAAOC,GAAG,CAAChB,OAAO;AACpB","ignoreList":[]}
@@ -0,0 +1,47 @@
1
+ // @ts-expect-error because there is no corresponding type definition
2
+ import * as NativeAndroidManager from "react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid";
3
+ const RCTStatusBarManagerCompat =
4
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
5
+ require("./specs/NativeStatusBarManagerCompat").default;
6
+
7
+ // Copy original default manager to keep its original state and methods
8
+ const OriginalNativeAndroidManager = {
9
+ ...NativeAndroidManager.default
10
+ };
11
+
12
+ // Create a new object that modifies the necessary methods
13
+ // On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so
14
+ // in order to use library on all available platforms we have to monkey patch
15
+ // default RN implementation and use modern `WindowInsetsControllerCompat`.
16
+ const ModifiedNativeAndroidManager = {
17
+ ...NativeAndroidManager.default,
18
+ // Spread original properties to keep existing functionality
19
+ setColor: (color, animated) => {
20
+ RCTStatusBarManagerCompat.setColor(color, animated);
21
+ },
22
+ setTranslucent: translucent => {
23
+ RCTStatusBarManagerCompat.setTranslucent(translucent);
24
+ },
25
+ /**
26
+ * - statusBarStyles can be:
27
+ * - 'default'
28
+ * - 'dark-content'
29
+ */
30
+ setStyle: statusBarStyle => {
31
+ RCTStatusBarManagerCompat.setStyle(statusBarStyle);
32
+ },
33
+ setHidden: hidden => {
34
+ RCTStatusBarManagerCompat.setHidden(hidden);
35
+ }
36
+ };
37
+
38
+ // Define a function to apply the monkey patch
39
+ export const applyMonkeyPatch = () => {
40
+ Object.assign(NativeAndroidManager.default, ModifiedNativeAndroidManager);
41
+ };
42
+
43
+ // Define a function to revert changes back to the original state
44
+ export const revertMonkeyPatch = () => {
45
+ Object.assign(NativeAndroidManager.default, OriginalNativeAndroidManager);
46
+ };
47
+ //# sourceMappingURL=monkey-patch.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeAndroidManager","RCTStatusBarManagerCompat","require","default","OriginalNativeAndroidManager","ModifiedNativeAndroidManager","setColor","color","animated","setTranslucent","translucent","setStyle","statusBarStyle","setHidden","hidden","applyMonkeyPatch","Object","assign","revertMonkeyPatch"],"sources":["monkey-patch.android.ts"],"sourcesContent":["// @ts-expect-error because there is no corresponding type definition\r\nimport * as NativeAndroidManager from \"react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid\";\r\n\r\nconst RCTStatusBarManagerCompat =\r\n // eslint-disable-next-line @typescript-eslint/no-var-requires\r\n require(\"./specs/NativeStatusBarManagerCompat\").default;\r\n\r\n// Copy original default manager to keep its original state and methods\r\nconst OriginalNativeAndroidManager = { ...NativeAndroidManager.default };\r\n\r\n// Create a new object that modifies the necessary methods\r\n// On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so\r\n// in order to use library on all available platforms we have to monkey patch\r\n// default RN implementation and use modern `WindowInsetsControllerCompat`.\r\nconst ModifiedNativeAndroidManager = {\r\n ...NativeAndroidManager.default, // Spread original properties to keep existing functionality\r\n setColor: (color: number, animated: boolean): void => {\r\n RCTStatusBarManagerCompat.setColor(color, animated);\r\n },\r\n setTranslucent: (translucent: boolean): void => {\r\n RCTStatusBarManagerCompat.setTranslucent(translucent);\r\n },\r\n /**\r\n * - statusBarStyles can be:\r\n * - 'default'\r\n * - 'dark-content'\r\n */\r\n setStyle: (statusBarStyle?: string): void => {\r\n RCTStatusBarManagerCompat.setStyle(statusBarStyle);\r\n },\r\n setHidden: (hidden: boolean): void => {\r\n RCTStatusBarManagerCompat.setHidden(hidden);\r\n },\r\n};\r\n\r\n// Define a function to apply the monkey patch\r\nexport const applyMonkeyPatch = () => {\r\n Object.assign(NativeAndroidManager.default, ModifiedNativeAndroidManager);\r\n};\r\n\r\n// Define a function to revert changes back to the original state\r\nexport const revertMonkeyPatch = () => {\r\n Object.assign(NativeAndroidManager.default, OriginalNativeAndroidManager);\r\n};\r\n"],"mappings":"AAAA;AACA,OAAO,KAAKA,oBAAoB,MAAM,2EAA2E;AAEjH,MAAMC,yBAAyB;AAC7B;AACAC,OAAO,CAAC,sCAAsC,CAAC,CAACC,OAAO;;AAEzD;AACA,MAAMC,4BAA4B,GAAG;EAAE,GAAGJ,oBAAoB,CAACG;AAAQ,CAAC;;AAExE;AACA;AACA;AACA;AACA,MAAME,4BAA4B,GAAG;EACnC,GAAGL,oBAAoB,CAACG,OAAO;EAAE;EACjCG,QAAQ,EAAEA,CAACC,KAAa,EAAEC,QAAiB,KAAW;IACpDP,yBAAyB,CAACK,QAAQ,CAACC,KAAK,EAAEC,QAAQ,CAAC;EACrD,CAAC;EACDC,cAAc,EAAGC,WAAoB,IAAW;IAC9CT,yBAAyB,CAACQ,cAAc,CAACC,WAAW,CAAC;EACvD,CAAC;EACD;AACF;AACA;AACA;AACA;EACEC,QAAQ,EAAGC,cAAuB,IAAW;IAC3CX,yBAAyB,CAACU,QAAQ,CAACC,cAAc,CAAC;EACpD,CAAC;EACDC,SAAS,EAAGC,MAAe,IAAW;IACpCb,yBAAyB,CAACY,SAAS,CAACC,MAAM,CAAC;EAC7C;AACF,CAAC;;AAED;AACA,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EACpCC,MAAM,CAACC,MAAM,CAACjB,oBAAoB,CAACG,OAAO,EAAEE,4BAA4B,CAAC;AAC3E,CAAC;;AAED;AACA,OAAO,MAAMa,iBAAiB,GAAGA,CAAA,KAAM;EACrCF,MAAM,CAACC,MAAM,CAACjB,oBAAoB,CAACG,OAAO,EAAEC,4BAA4B,CAAC;AAC3E,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ // stub for all platforms
2
+ const NOOP = () => {};
3
+ export const applyMonkeyPatch = NOOP;
4
+ export const revertMonkeyPatch = NOOP;
5
+ //# sourceMappingURL=monkey-patch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NOOP","applyMonkeyPatch","revertMonkeyPatch"],"sources":["monkey-patch.ts"],"sourcesContent":["// stub for all platforms\r\nconst NOOP = () => {};\r\nexport const applyMonkeyPatch = NOOP;\r\nexport const revertMonkeyPatch = NOOP;\r\n"],"mappings":"AAAA;AACA,MAAMA,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,OAAO,MAAMC,gBAAgB,GAAGD,IAAI;AACpC,OAAO,MAAME,iBAAiB,GAAGF,IAAI","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ const NOOP = () => () => {};
2
+ export const useAnimatedKeyboardHandler = NOOP;
3
+ export const useFocusedInputLayoutHandler = NOOP;
4
+ export const useFocusedInputTextHandler = NOOP;
5
+ export const useFocusedInputSelectionHandler = NOOP;
6
+ //# sourceMappingURL=reanimated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NOOP","useAnimatedKeyboardHandler","useFocusedInputLayoutHandler","useFocusedInputTextHandler","useFocusedInputSelectionHandler"],"sources":["reanimated.ts"],"sourcesContent":["import type {\r\n EventWithName,\r\n FocusedInputLayoutChangedEvent,\r\n FocusedInputLayoutHandlerHook,\r\n FocusedInputSelectionChangedEvent,\r\n FocusedInputSelectionHandlerHook,\r\n FocusedInputTextChangedEvent,\r\n FocusedInputTextHandlerHook,\r\n KeyboardHandlerHook,\r\n NativeEvent,\r\n} from \"./types\";\r\n\r\nconst NOOP = () => () => {};\r\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\r\n Record<string, unknown>,\r\n EventWithName<NativeEvent>\r\n> = NOOP;\r\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\r\n Record<string, unknown>,\r\n EventWithName<FocusedInputLayoutChangedEvent>\r\n> = NOOP;\r\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\r\n Record<string, unknown>,\r\n EventWithName<FocusedInputTextChangedEvent>\r\n> = NOOP;\r\nexport const useFocusedInputSelectionHandler: FocusedInputSelectionHandlerHook<\r\n Record<string, unknown>,\r\n EventWithName<FocusedInputSelectionChangedEvent>\r\n> = NOOP;\r\n"],"mappings":"AAYA,MAAMA,IAAI,GAAGA,CAAA,KAAM,MAAM,CAAC,CAAC;AAC3B,OAAO,MAAMC,0BAGZ,GAAGD,IAAI;AACR,OAAO,MAAME,4BAGZ,GAAGF,IAAI;AACR,OAAO,MAAMG,0BAGZ,GAAGH,IAAI;AACR,OAAO,MAAMI,+BAGZ,GAAGJ,IAAI","ignoreList":[]}
@@ -0,0 +1,78 @@
1
+ import { useEvent, useHandler } from "react-native-reanimated";
2
+ export const useAnimatedKeyboardHandler = (handlers, dependencies) => {
3
+ const {
4
+ context,
5
+ doDependenciesDiffer
6
+ } = useHandler(handlers, dependencies);
7
+ return useEvent(event => {
8
+ "worklet";
9
+
10
+ const {
11
+ onKeyboardMoveStart,
12
+ onKeyboardMove,
13
+ onKeyboardMoveEnd,
14
+ onKeyboardMoveInteractive
15
+ } = handlers;
16
+ if (onKeyboardMoveStart && event.eventName.endsWith("onKeyboardMoveStart")) {
17
+ onKeyboardMoveStart(event, context);
18
+ }
19
+ if (onKeyboardMove && event.eventName.endsWith("onKeyboardMove")) {
20
+ onKeyboardMove(event, context);
21
+ }
22
+ if (onKeyboardMoveEnd && event.eventName.endsWith("onKeyboardMoveEnd")) {
23
+ onKeyboardMoveEnd(event, context);
24
+ }
25
+ if (onKeyboardMoveInteractive && event.eventName.endsWith("onKeyboardMoveInteractive")) {
26
+ onKeyboardMoveInteractive(event, context);
27
+ }
28
+ }, ["onKeyboardMoveStart", "onKeyboardMove", "onKeyboardMoveEnd", "onKeyboardMoveInteractive"], doDependenciesDiffer);
29
+ };
30
+ export const useFocusedInputLayoutHandler = (handlers, dependencies) => {
31
+ const {
32
+ context,
33
+ doDependenciesDiffer
34
+ } = useHandler(handlers, dependencies);
35
+ return useEvent(event => {
36
+ "worklet";
37
+
38
+ const {
39
+ onFocusedInputLayoutChanged
40
+ } = handlers;
41
+ if (onFocusedInputLayoutChanged && event.eventName.endsWith("onFocusedInputLayoutChanged")) {
42
+ onFocusedInputLayoutChanged(event, context);
43
+ }
44
+ }, ["onFocusedInputLayoutChanged"], doDependenciesDiffer);
45
+ };
46
+ export const useFocusedInputTextHandler = (handlers, dependencies) => {
47
+ const {
48
+ context,
49
+ doDependenciesDiffer
50
+ } = useHandler(handlers, dependencies);
51
+ return useEvent(event => {
52
+ "worklet";
53
+
54
+ const {
55
+ onFocusedInputTextChanged
56
+ } = handlers;
57
+ if (onFocusedInputTextChanged && event.eventName.endsWith("onFocusedInputTextChanged")) {
58
+ onFocusedInputTextChanged(event, context);
59
+ }
60
+ }, ["onFocusedInputTextChanged"], doDependenciesDiffer);
61
+ };
62
+ export const useFocusedInputSelectionHandler = (handlers, dependencies) => {
63
+ const {
64
+ context,
65
+ doDependenciesDiffer
66
+ } = useHandler(handlers, dependencies);
67
+ return useEvent(event => {
68
+ "worklet";
69
+
70
+ const {
71
+ onFocusedInputSelectionChanged
72
+ } = handlers;
73
+ if (onFocusedInputSelectionChanged && event.eventName.endsWith("onFocusedInputSelectionChanged")) {
74
+ onFocusedInputSelectionChanged(event, context);
75
+ }
76
+ }, ["onFocusedInputSelectionChanged"], doDependenciesDiffer);
77
+ };
78
+ //# sourceMappingURL=reanimated.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEvent","useHandler","useAnimatedKeyboardHandler","handlers","dependencies","context","doDependenciesDiffer","event","onKeyboardMoveStart","onKeyboardMove","onKeyboardMoveEnd","onKeyboardMoveInteractive","eventName","endsWith","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged","useFocusedInputTextHandler","onFocusedInputTextChanged","useFocusedInputSelectionHandler","onFocusedInputSelectionChanged"],"sources":["reanimated.native.ts"],"sourcesContent":["import { useEvent, useHandler } from \"react-native-reanimated\";\r\n\r\nimport type {\r\n EventWithName,\r\n FocusedInputLayoutChangedEvent,\r\n FocusedInputLayoutHandlerHook,\r\n FocusedInputSelectionChangedEvent,\r\n FocusedInputSelectionHandlerHook,\r\n FocusedInputTextChangedEvent,\r\n FocusedInputTextHandlerHook,\r\n KeyboardHandlerHook,\r\n NativeEvent,\r\n} from \"./types\";\r\n\r\ntype EventContext = Record<string, unknown>;\r\n\r\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\r\n EventContext,\r\n EventWithName<NativeEvent>\r\n> = (handlers, dependencies) => {\r\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\r\n\r\n return useEvent(\r\n (event) => {\r\n \"worklet\";\r\n const {\r\n onKeyboardMoveStart,\r\n onKeyboardMove,\r\n onKeyboardMoveEnd,\r\n onKeyboardMoveInteractive,\r\n } = handlers;\r\n\r\n if (\r\n onKeyboardMoveStart &&\r\n event.eventName.endsWith(\"onKeyboardMoveStart\")\r\n ) {\r\n onKeyboardMoveStart(event, context);\r\n }\r\n\r\n if (onKeyboardMove && event.eventName.endsWith(\"onKeyboardMove\")) {\r\n onKeyboardMove(event, context);\r\n }\r\n\r\n if (onKeyboardMoveEnd && event.eventName.endsWith(\"onKeyboardMoveEnd\")) {\r\n onKeyboardMoveEnd(event, context);\r\n }\r\n\r\n if (\r\n onKeyboardMoveInteractive &&\r\n event.eventName.endsWith(\"onKeyboardMoveInteractive\")\r\n ) {\r\n onKeyboardMoveInteractive(event, context);\r\n }\r\n },\r\n [\r\n \"onKeyboardMoveStart\",\r\n \"onKeyboardMove\",\r\n \"onKeyboardMoveEnd\",\r\n \"onKeyboardMoveInteractive\",\r\n ],\r\n doDependenciesDiffer,\r\n );\r\n};\r\n\r\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\r\n EventContext,\r\n EventWithName<FocusedInputLayoutChangedEvent>\r\n> = (handlers, dependencies) => {\r\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\r\n\r\n return useEvent(\r\n (event) => {\r\n \"worklet\";\r\n const { onFocusedInputLayoutChanged } = handlers;\r\n\r\n if (\r\n onFocusedInputLayoutChanged &&\r\n event.eventName.endsWith(\"onFocusedInputLayoutChanged\")\r\n ) {\r\n onFocusedInputLayoutChanged(event, context);\r\n }\r\n },\r\n [\"onFocusedInputLayoutChanged\"],\r\n doDependenciesDiffer,\r\n );\r\n};\r\n\r\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\r\n EventContext,\r\n EventWithName<FocusedInputTextChangedEvent>\r\n> = (handlers, dependencies) => {\r\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\r\n\r\n return useEvent(\r\n (event) => {\r\n \"worklet\";\r\n const { onFocusedInputTextChanged } = handlers;\r\n\r\n if (\r\n onFocusedInputTextChanged &&\r\n event.eventName.endsWith(\"onFocusedInputTextChanged\")\r\n ) {\r\n onFocusedInputTextChanged(event, context);\r\n }\r\n },\r\n [\"onFocusedInputTextChanged\"],\r\n doDependenciesDiffer,\r\n );\r\n};\r\n\r\nexport const useFocusedInputSelectionHandler: FocusedInputSelectionHandlerHook<\r\n EventContext,\r\n EventWithName<FocusedInputSelectionChangedEvent>\r\n> = (handlers, dependencies) => {\r\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\r\n\r\n return useEvent(\r\n (event) => {\r\n \"worklet\";\r\n const { onFocusedInputSelectionChanged } = handlers;\r\n\r\n if (\r\n onFocusedInputSelectionChanged &&\r\n event.eventName.endsWith(\"onFocusedInputSelectionChanged\")\r\n ) {\r\n onFocusedInputSelectionChanged(event, context);\r\n }\r\n },\r\n [\"onFocusedInputSelectionChanged\"],\r\n doDependenciesDiffer,\r\n );\r\n};\r\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,UAAU,QAAQ,yBAAyB;AAgB9D,OAAO,MAAMC,0BAGZ,GAAGA,CAACC,QAAQ,EAAEC,YAAY,KAAK;EAC9B,MAAM;IAAEC,OAAO;IAAEC;EAAqB,CAAC,GAAGL,UAAU,CAACE,QAAQ,EAAEC,YAAY,CAAC;EAE5E,OAAOJ,QAAQ,CACZO,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MACJC,mBAAmB;MACnBC,cAAc;MACdC,iBAAiB;MACjBC;IACF,CAAC,GAAGR,QAAQ;IAEZ,IACEK,mBAAmB,IACnBD,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,qBAAqB,CAAC,EAC/C;MACAL,mBAAmB,CAACD,KAAK,EAAEF,OAAO,CAAC;IACrC;IAEA,IAAII,cAAc,IAAIF,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;MAChEJ,cAAc,CAACF,KAAK,EAAEF,OAAO,CAAC;IAChC;IAEA,IAAIK,iBAAiB,IAAIH,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,mBAAmB,CAAC,EAAE;MACtEH,iBAAiB,CAACH,KAAK,EAAEF,OAAO,CAAC;IACnC;IAEA,IACEM,yBAAyB,IACzBJ,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,2BAA2B,CAAC,EACrD;MACAF,yBAAyB,CAACJ,KAAK,EAAEF,OAAO,CAAC;IAC3C;EACF,CAAC,EACD,CACE,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,2BAA2B,CAC5B,EACDC,oBACF,CAAC;AACH,CAAC;AAED,OAAO,MAAMQ,4BAGZ,GAAGA,CAACX,QAAQ,EAAEC,YAAY,KAAK;EAC9B,MAAM;IAAEC,OAAO;IAAEC;EAAqB,CAAC,GAAGL,UAAU,CAACE,QAAQ,EAAEC,YAAY,CAAC;EAE5E,OAAOJ,QAAQ,CACZO,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MAAEQ;IAA4B,CAAC,GAAGZ,QAAQ;IAEhD,IACEY,2BAA2B,IAC3BR,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,6BAA6B,CAAC,EACvD;MACAE,2BAA2B,CAACR,KAAK,EAAEF,OAAO,CAAC;IAC7C;EACF,CAAC,EACD,CAAC,6BAA6B,CAAC,EAC/BC,oBACF,CAAC;AACH,CAAC;AAED,OAAO,MAAMU,0BAGZ,GAAGA,CAACb,QAAQ,EAAEC,YAAY,KAAK;EAC9B,MAAM;IAAEC,OAAO;IAAEC;EAAqB,CAAC,GAAGL,UAAU,CAACE,QAAQ,EAAEC,YAAY,CAAC;EAE5E,OAAOJ,QAAQ,CACZO,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MAAEU;IAA0B,CAAC,GAAGd,QAAQ;IAE9C,IACEc,yBAAyB,IACzBV,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,2BAA2B,CAAC,EACrD;MACAI,yBAAyB,CAACV,KAAK,EAAEF,OAAO,CAAC;IAC3C;EACF,CAAC,EACD,CAAC,2BAA2B,CAAC,EAC7BC,oBACF,CAAC;AACH,CAAC;AAED,OAAO,MAAMY,+BAGZ,GAAGA,CAACf,QAAQ,EAAEC,YAAY,KAAK;EAC9B,MAAM;IAAEC,OAAO;IAAEC;EAAqB,CAAC,GAAGL,UAAU,CAACE,QAAQ,EAAEC,YAAY,CAAC;EAE5E,OAAOJ,QAAQ,CACZO,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MAAEY;IAA+B,CAAC,GAAGhB,QAAQ;IAEnD,IACEgB,8BAA8B,IAC9BZ,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,gCAAgC,CAAC,EAC1D;MACAM,8BAA8B,CAACZ,KAAK,EAAEF,OAAO,CAAC;IAChD;EACF,CAAC,EACD,CAAC,gCAAgC,CAAC,EAClCC,oBACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
2
+ export default codegenNativeComponent("RNKeyboardControllerView");
3
+ //# sourceMappingURL=KeyboardControllerViewNativeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["codegenNativeComponent"],"sources":["KeyboardControllerViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\r\n\r\nimport type { HostComponent } from \"react-native\";\r\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\r\nimport type {\r\n DirectEventHandler,\r\n Double,\r\n Int32,\r\n} from \"react-native/Libraries/Types/CodegenTypes\";\r\n\r\ntype KeyboardMoveEvent = Readonly<{\r\n height: Double;\r\n progress: Double;\r\n duration: Int32;\r\n target: Int32;\r\n}>;\r\n\r\ntype FocusedInputLayoutChangedEvent = Readonly<{\r\n target: Int32;\r\n parentScrollViewTarget: Int32;\r\n layout: {\r\n x: Double;\r\n y: Double;\r\n width: Double;\r\n height: Double;\r\n absoluteX: Double;\r\n absoluteY: Double;\r\n };\r\n}>;\r\n\r\ntype FocusedInputTextChangedEvent = Readonly<{\r\n text: string;\r\n}>;\r\n\r\ntype FocusedInputSelectionChangedEvent = Readonly<{\r\n target: Int32;\r\n selection: {\r\n start: {\r\n x: Double;\r\n y: Double;\r\n position: Int32;\r\n };\r\n end: {\r\n x: Double;\r\n y: Double;\r\n position: Int32;\r\n };\r\n };\r\n}>;\r\n\r\nexport interface NativeProps extends ViewProps {\r\n // props\r\n enabled?: boolean;\r\n statusBarTranslucent?: boolean;\r\n navigationBarTranslucent?: boolean;\r\n // callbacks\r\n /// keyboard\r\n onKeyboardMoveStart?: DirectEventHandler<KeyboardMoveEvent>;\r\n onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;\r\n onKeyboardMoveEnd?: DirectEventHandler<KeyboardMoveEvent>;\r\n onKeyboardMoveInteractive?: DirectEventHandler<KeyboardMoveEvent>;\r\n /// focused input\r\n onFocusedInputLayoutChanged?: DirectEventHandler<FocusedInputLayoutChangedEvent>;\r\n onFocusedInputTextChanged?: DirectEventHandler<FocusedInputTextChangedEvent>;\r\n onFocusedInputSelectionChanged?: DirectEventHandler<FocusedInputSelectionChangedEvent>;\r\n}\r\n\r\nexport default codegenNativeComponent<NativeProps>(\r\n \"RNKeyboardControllerView\",\r\n) as HostComponent<NativeProps>;\r\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAmE5F,eAAeA,sBAAsB,CACnC,0BACF,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
2
+ export default codegenNativeComponent("RNKeyboardGestureArea", {
3
+ excludedPlatforms: ["iOS"]
4
+ });
5
+ //# sourceMappingURL=KeyboardGestureAreaNativeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["codegenNativeComponent","excludedPlatforms"],"sources":["KeyboardGestureAreaNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\r\n\r\nimport type { HostComponent } from \"react-native\";\r\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\r\nimport type { WithDefault } from \"react-native/Libraries/Types/CodegenTypes\";\r\n\r\nexport interface NativeProps extends ViewProps {\r\n interpolator?: WithDefault<\"linear\" | \"ios\", \"linear\">;\r\n showOnSwipeUp?: boolean;\r\n enableSwipeToDismiss?: boolean;\r\n}\r\n\r\nexport default codegenNativeComponent<NativeProps>(\"RNKeyboardGestureArea\", {\r\n excludedPlatforms: [\"iOS\"],\r\n}) as HostComponent<NativeProps>;\r\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAY5F,eAAeA,sBAAsB,CAAc,uBAAuB,EAAE;EAC1EC,iBAAiB,EAAE,CAAC,KAAK;AAC3B,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import { TurboModuleRegistry } from "react-native";
2
+ export default TurboModuleRegistry.get("KeyboardController");
3
+ //# sourceMappingURL=NativeKeyboardController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeKeyboardController.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\r\n\r\nimport type { TurboModule } from \"react-native\";\r\n\r\nexport interface Spec extends TurboModule {\r\n readonly getConstants: () => {};\r\n\r\n // methods\r\n setInputMode(mode: number): void;\r\n setDefaultMode(): void;\r\n dismiss(): void;\r\n setFocusTo(direction: string): void;\r\n\r\n // event emitter\r\n addListener: (eventName: string) => void;\r\n removeListeners: (count: number) => void;\r\n}\r\n\r\nexport default TurboModuleRegistry.get<Spec>(\"KeyboardController\");\r\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAkBlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import { TurboModuleRegistry } from "react-native";
2
+ export default TurboModuleRegistry.get("StatusBarManagerCompat");
3
+ //# sourceMappingURL=NativeStatusBarManagerCompat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeStatusBarManagerCompat.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\r\n\r\nimport type { TurboModule } from \"react-native\";\r\n\r\nexport interface Spec extends TurboModule {\r\n readonly getConstants: () => {};\r\n\r\n setHidden(hidden: boolean): void;\r\n setColor(color: number, animated: boolean): void;\r\n setTranslucent(translucent: boolean): void;\r\n setStyle(style: string): void;\r\n}\r\n\r\nexport default TurboModuleRegistry.get<Spec>(\"StatusBarManagerCompat\");\r\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAalD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,wBAAwB,CAAC","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 {\r\n EmitterSubscription,\r\n NativeSyntheticEvent,\r\n ViewProps,\r\n} from \"react-native\";\r\n\r\n// DirectEventHandler events declaration\r\nexport type NativeEvent = {\r\n progress: number;\r\n height: number;\r\n duration: number;\r\n target: number;\r\n};\r\nexport type FocusedInputLayoutChangedEvent = {\r\n target: number;\r\n parentScrollViewTarget: number;\r\n layout: {\r\n x: number;\r\n y: number;\r\n width: number;\r\n height: number;\r\n absoluteX: number;\r\n absoluteY: number;\r\n };\r\n};\r\nexport type FocusedInputTextChangedEvent = {\r\n text: string;\r\n};\r\nexport type FocusedInputSelectionChangedEvent = {\r\n target: number;\r\n selection: {\r\n start: {\r\n x: number;\r\n y: number;\r\n position: number;\r\n };\r\n end: {\r\n x: number;\r\n y: number;\r\n position: number;\r\n };\r\n };\r\n};\r\nexport type EventWithName<T> = {\r\n eventName: string;\r\n} & T;\r\n\r\n// native View/Module declarations\r\nexport type KeyboardControllerProps = {\r\n // callback props\r\n onKeyboardMoveStart?: (\r\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\r\n ) => void;\r\n onKeyboardMove?: (\r\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\r\n ) => void;\r\n onKeyboardMoveEnd?: (\r\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\r\n ) => void;\r\n onKeyboardMoveInteractive?: (\r\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\r\n ) => void;\r\n onFocusedInputLayoutChanged?: (\r\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\r\n ) => void;\r\n onFocusedInputTextChanged?: (\r\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\r\n ) => void;\r\n onFocusedInputSelectionChanged?: (\r\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\r\n ) => void;\r\n // fake props used to activate reanimated bindings\r\n onKeyboardMoveReanimated?: (\r\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\r\n ) => void;\r\n onFocusedInputLayoutChangedReanimated?: (\r\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\r\n ) => void;\r\n onFocusedInputTextChangedReanimated?: (\r\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\r\n ) => void;\r\n onFocusedInputSelectionChangedReanimated?: (\r\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\r\n ) => void;\r\n // props\r\n statusBarTranslucent?: boolean;\r\n navigationBarTranslucent?: boolean;\r\n enabled?: boolean;\r\n} & ViewProps;\r\n\r\nexport type KeyboardGestureAreaProps = {\r\n interpolator: \"ios\" | \"linear\";\r\n /**\r\n * Whether to allow to show a keyboard from dismissed state by swipe up.\r\n * Default to `false`.\r\n */\r\n showOnSwipeUp?: boolean;\r\n /**\r\n * Whether to allow to control a keyboard by gestures. The strategy how\r\n * it should be controlled is determined by `interpolator` property.\r\n * Defaults to `true`.\r\n */\r\n enableSwipeToDismiss?: boolean;\r\n} & ViewProps;\r\n\r\nexport type Direction = \"next\" | \"prev\" | \"current\";\r\nexport type KeyboardControllerModule = {\r\n // android only\r\n setDefaultMode: () => void;\r\n setInputMode: (mode: number) => void;\r\n // all platforms\r\n dismiss: () => void;\r\n setFocusTo: (direction: Direction) => void;\r\n // native event module stuff\r\n addListener: (eventName: string) => void;\r\n removeListeners: (count: number) => void;\r\n};\r\n\r\n// Event module declarations\r\nexport type KeyboardControllerEvents =\r\n | \"keyboardWillShow\"\r\n | \"keyboardDidShow\"\r\n | \"keyboardWillHide\"\r\n | \"keyboardDidHide\";\r\nexport type KeyboardEventData = {\r\n height: number;\r\n duration: number;\r\n timestamp: number;\r\n target: number;\r\n};\r\nexport type KeyboardEventsModule = {\r\n addListener: (\r\n name: KeyboardControllerEvents,\r\n cb: (e: KeyboardEventData) => void,\r\n ) => EmitterSubscription;\r\n};\r\nexport type FocusedInputAvailableEvents = \"focusDidSet\";\r\nexport type FocusedInputEventData = {\r\n current: number;\r\n count: number;\r\n};\r\nexport type FocusedInputEventsModule = {\r\n addListener: (\r\n name: FocusedInputAvailableEvents,\r\n cb: (e: FocusedInputEventData) => void,\r\n ) => EmitterSubscription;\r\n};\r\nexport type WindowDimensionsAvailableEvents = \"windowDidResize\";\r\nexport type WindowDimensionsEventData = {\r\n width: number;\r\n height: number;\r\n};\r\nexport type WindowDimensionsEventsModule = {\r\n addListener: (\r\n name: WindowDimensionsAvailableEvents,\r\n cb: (e: WindowDimensionsEventData) => void,\r\n ) => EmitterSubscription;\r\n};\r\n\r\n// reanimated hook declaration\r\nexport type KeyboardHandlerHook<TContext, Event> = (\r\n handlers: {\r\n onKeyboardMoveStart?: (e: NativeEvent, context: TContext) => void;\r\n onKeyboardMove?: (e: NativeEvent, context: TContext) => void;\r\n onKeyboardMoveEnd?: (e: NativeEvent, context: TContext) => void;\r\n onKeyboardMoveInteractive?: (e: NativeEvent, context: TContext) => void;\r\n },\r\n dependencies?: unknown[],\r\n) => (e: NativeSyntheticEvent<Event>) => void;\r\nexport type FocusedInputLayoutHandlerHook<TContext, Event> = (\r\n handlers: {\r\n onFocusedInputLayoutChanged?: (\r\n e: FocusedInputLayoutChangedEvent,\r\n context: TContext,\r\n ) => void;\r\n },\r\n dependencies?: unknown[],\r\n) => (e: NativeSyntheticEvent<Event>) => void;\r\nexport type FocusedInputTextHandlerHook<TContext, Event> = (\r\n handlers: {\r\n onFocusedInputTextChanged?: (\r\n e: FocusedInputTextChangedEvent,\r\n context: TContext,\r\n ) => void;\r\n },\r\n dependencies?: unknown[],\r\n) => (e: NativeSyntheticEvent<Event>) => void;\r\nexport type FocusedInputSelectionHandlerHook<TContext, Event> = (\r\n handlers: {\r\n onFocusedInputSelectionChanged?: (\r\n e: FocusedInputSelectionChangedEvent,\r\n context: TContext,\r\n ) => void;\r\n },\r\n dependencies?: unknown[],\r\n) => (e: NativeSyntheticEvent<Event>) => void;\r\n\r\n// package types\r\nexport type Handlers<T> = Record<string, T | undefined>;\r\nexport type KeyboardHandler = Partial<{\r\n onStart: (e: NativeEvent) => void;\r\n onMove: (e: NativeEvent) => void;\r\n onEnd: (e: NativeEvent) => void;\r\n onInteractive: (e: NativeEvent) => void;\r\n}>;\r\nexport type KeyboardHandlers = Handlers<KeyboardHandler>;\r\nexport type FocusedInputHandler = Partial<{\r\n onChangeText: (e: FocusedInputTextChangedEvent) => void;\r\n onSelectionChange: (e: FocusedInputSelectionChangedEvent) => void;\r\n}>;\r\nexport type FocusedInputHandlers = Handlers<FocusedInputHandler>;\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export const uuid = () => Math.random().toString(36).slice(-6);
2
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["uuid","Math","random","toString","slice"],"sources":["utils.ts"],"sourcesContent":["export const uuid = () => Math.random().toString(36).slice(-6);\r\n"],"mappings":"AAAA,OAAO,MAAMA,IAAI,GAAGA,CAAA,KAAMC,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,31 @@
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 prop indicating whether the module is enabled. It indicate only initial state,
24
+ * i. e. if you try to change this prop after component mount it will not have any effect.
25
+ * To change the property in runtime use `useKeyboardController` hook and `setEnabled` method.
26
+ * Defaults to `true`.
27
+ */
28
+ enabled?: boolean;
29
+ };
30
+ export declare const KeyboardProvider: ({ children, statusBarTranslucent, navigationBarTranslucent, enabled: initiallyEnabled, }: KeyboardProviderProps) => React.JSX.Element;
31
+ export {};
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { FocusedInputEventsModule, KeyboardControllerModule, KeyboardControllerProps, KeyboardEventsModule, KeyboardGestureAreaProps, WindowDimensionsEventsModule } from "./types";
3
+ export declare const KeyboardController: KeyboardControllerModule;
4
+ export declare const KeyboardEvents: KeyboardEventsModule;
5
+ /**
6
+ * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.
7
+ * Use it with cautious.
8
+ */
9
+ export declare const FocusedInputEvents: FocusedInputEventsModule;
10
+ export declare const WindowDimensionsEvents: WindowDimensionsEventsModule;
11
+ export declare const KeyboardControllerView: import("react").FC<KeyboardControllerProps>;
12
+ export declare const KeyboardGestureArea: import("react").FC<KeyboardGestureAreaProps>;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { FocusedInputEventsModule, KeyboardControllerModule, KeyboardControllerProps, KeyboardEventsModule, KeyboardGestureAreaProps, WindowDimensionsEventsModule } from "./types";
3
+ export declare const KeyboardController: KeyboardControllerModule;
4
+ export declare const KeyboardEvents: KeyboardEventsModule;
5
+ /**
6
+ * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.
7
+ * Use it with cautious.
8
+ */
9
+ export declare const FocusedInputEvents: FocusedInputEventsModule;
10
+ export declare const WindowDimensionsEvents: WindowDimensionsEventsModule;
11
+ export declare const KeyboardControllerView: React.FC<KeyboardControllerProps>;
12
+ export declare const KeyboardGestureArea: React.FC<KeyboardGestureAreaProps>;
@@ -0,0 +1,6 @@
1
+ export declare const useKeyboardAnimation: () => {
2
+ height: import("react-native-reanimated").SharedValue<number>;
3
+ progress: import("react-native-reanimated").SharedValue<number>;
4
+ heightWhenOpened: import("react-native-reanimated").SharedValue<number>;
5
+ isClosed: import("react-native-reanimated").SharedValue<boolean>;
6
+ };
@@ -0,0 +1,50 @@
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import type { ViewProps } from "react-native";
4
+ export type KeyboardAvoidingViewProps = {
5
+ /**
6
+ * Specify how to react to the presence of the keyboard.
7
+ */
8
+ behavior?: "height" | "position" | "padding";
9
+ /**
10
+ * Style of the content container when `behavior` is 'position'.
11
+ */
12
+ contentContainerStyle?: ViewProps["style"];
13
+ /**
14
+ * Controls whether this `KeyboardAvoidingView` instance should take effect.
15
+ * This is useful when more than one is on the screen. Defaults to true.
16
+ */
17
+ enabled?: boolean;
18
+ /**
19
+ * Distance between the top of the user screen and the React Native view. This
20
+ * may be non-zero in some cases. Defaults to 0.
21
+ */
22
+ keyboardVerticalOffset?: number;
23
+ } & ViewProps;
24
+ /**
25
+ * View that moves out of the way when the keyboard appears by automatically
26
+ * adjusting its height, position, or bottom padding.
27
+ */
28
+ declare const KeyboardAvoidingView: React.ForwardRefExoticComponent<{
29
+ /**
30
+ * Specify how to react to the presence of the keyboard.
31
+ */
32
+ behavior?: "height" | "padding" | "position" | undefined;
33
+ /**
34
+ * Style of the content container when `behavior` is 'position'.
35
+ */
36
+ contentContainerStyle?: ViewProps["style"];
37
+ /**
38
+ * Controls whether this `KeyboardAvoidingView` instance should take effect.
39
+ * This is useful when more than one is on the screen. Defaults to true.
40
+ */
41
+ enabled?: boolean | undefined;
42
+ /**
43
+ * Distance between the top of the user screen and the React Native view. This
44
+ * may be non-zero in some cases. Defaults to 0.
45
+ */
46
+ keyboardVerticalOffset?: number | undefined;
47
+ } & ViewProps & {
48
+ children?: React.ReactNode;
49
+ } & React.RefAttributes<View>>;
50
+ export default KeyboardAvoidingView;
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import type { ScrollView, ScrollViewProps } from "react-native";
3
+ export type KeyboardAwareScrollViewProps = {
4
+ /** The distance between keyboard and focused `TextInput` when keyboard is shown. Default is `0`. */
5
+ bottomOffset?: number;
6
+ /** Prevents automatic scrolling of the `ScrollView` when the keyboard gets hidden, maintaining the current screen position. Default is `false`. */
7
+ disableScrollOnKeyboardHide?: boolean;
8
+ /** Controls whether this `KeyboardAwareScrollView` instance should take effect. Default is `true` */
9
+ enabled?: boolean;
10
+ /** Adjusting the bottom spacing of KeyboardAwareScrollView. Default is `0` */
11
+ extraKeyboardSpace?: number;
12
+ } & ScrollViewProps;
13
+ declare const KeyboardAwareScrollView: React.ForwardRefExoticComponent<{
14
+ /** The distance between keyboard and focused `TextInput` when keyboard is shown. Default is `0`. */
15
+ bottomOffset?: number | undefined;
16
+ /** Prevents automatic scrolling of the `ScrollView` when the keyboard gets hidden, maintaining the current screen position. Default is `false`. */
17
+ disableScrollOnKeyboardHide?: boolean | undefined;
18
+ /** Controls whether this `KeyboardAwareScrollView` instance should take effect. Default is `true` */
19
+ enabled?: boolean | undefined;
20
+ /** Adjusting the bottom spacing of KeyboardAwareScrollView. Default is `0` */
21
+ extraKeyboardSpace?: number | undefined;
22
+ } & ScrollViewProps & {
23
+ children?: React.ReactNode;
24
+ } & React.RefAttributes<ScrollView>>;
25
+ export default KeyboardAwareScrollView;
@@ -0,0 +1,6 @@
1
+ import { useKeyboardHandler } from "../../hooks";
2
+ /**
3
+ * Hook that uses default transitions for iOS and Android > 11, and uses
4
+ * custom interpolation on Android < 11 to achieve more smooth animation
5
+ */
6
+ export declare const useSmoothKeyboardHandler: typeof useKeyboardHandler;
@@ -0,0 +1,2 @@
1
+ export declare const debounce: <F extends (...args: Parameters<F>) => ReturnType<F>>(worklet: F, wait?: number) => (...args: Parameters<F>) => void | ReturnType<F>;
2
+ export declare const scrollDistanceWithRespectToSnapPoints: (defaultScrollValue: number, snapPoints?: number[]) => number;
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+ import type { View, ViewProps } from "react-native";
3
+ export type KeyboardStickyViewProps = {
4
+ /**
5
+ * Specify additional offset to the view for given keyboard state.
6
+ */
7
+ offset?: {
8
+ /**
9
+ * Adds additional `translateY` when keyboard is close. By default `0`.
10
+ */
11
+ closed?: number;
12
+ /**
13
+ * Adds additional `translateY` when keyboard is open. By default `0`.
14
+ */
15
+ opened?: number;
16
+ };
17
+ } & ViewProps;
18
+ declare const KeyboardStickyView: React.ForwardRefExoticComponent<{
19
+ /**
20
+ * Specify additional offset to the view for given keyboard state.
21
+ */
22
+ offset?: {
23
+ /**
24
+ * Adds additional `translateY` when keyboard is close. By default `0`.
25
+ */
26
+ closed?: number | undefined;
27
+ /**
28
+ * Adds additional `translateY` when keyboard is open. By default `0`.
29
+ */
30
+ opened?: number | undefined;
31
+ } | undefined;
32
+ } & ViewProps & {
33
+ children?: React.ReactNode;
34
+ } & React.RefAttributes<View>>;
35
+ export default KeyboardStickyView;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { KeyboardToolbarTheme } from "./types";
3
+ type ArrowProps = {
4
+ type: "prev" | "next";
5
+ disabled?: boolean;
6
+ theme: KeyboardToolbarTheme;
7
+ };
8
+ declare const ArrowComponent: React.FC<ArrowProps>;
9
+ export default ArrowComponent;
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import type { KeyboardToolbarTheme } from "./types";
3
+ import type { ViewStyle } from "react-native";
4
+ type ButtonProps = {
5
+ disabled?: boolean;
6
+ onPress: () => void;
7
+ accessibilityLabel: string;
8
+ accessibilityHint: string;
9
+ testID: string;
10
+ rippleRadius?: number;
11
+ style?: ViewStyle;
12
+ theme: KeyboardToolbarTheme;
13
+ };
14
+ declare const _default: ({ children, onPress, disabled, accessibilityLabel, accessibilityHint, testID, style, }: React.PropsWithChildren<ButtonProps>) => React.JSX.Element;
15
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import type { KeyboardToolbarTheme } from "./types";
2
+ export declare const colors: KeyboardToolbarTheme;
@@ -0,0 +1,2 @@
1
+ import type { KeyboardToolbarTheme } from "./types";
2
+ export declare const colors: KeyboardToolbarTheme;
@@ -0,0 +1,50 @@
1
+ import React from "react";
2
+ import Arrow from "./Arrow";
3
+ import Button from "./Button";
4
+ import { colors } from "./colors";
5
+ import type { HEX, KeyboardToolbarTheme } from "./types";
6
+ import type { ReactNode } from "react";
7
+ export type KeyboardToolbarProps = {
8
+ /** An element that is shown in the middle of the toolbar. */
9
+ content?: JSX.Element | null;
10
+ /** A set of dark/light colors consumed by toolbar component. */
11
+ theme?: KeyboardToolbarTheme;
12
+ /** Custom text for done button. */
13
+ doneText?: ReactNode;
14
+ /** Custom touchable component for toolbar (used for prev/next/done buttons). */
15
+ button?: typeof Button;
16
+ /** Custom icon component used to display next/prev buttons. */
17
+ icon?: typeof Arrow;
18
+ /**
19
+ * Whether to show next and previous buttons. Can be useful to set it to `false` if you have only one input
20
+ * and want to show only `Done` button. Default to `true`.
21
+ */
22
+ showArrows?: boolean;
23
+ /**
24
+ * A callback that is called when the user presses the next button along with the default action.
25
+ */
26
+ onNextCallback?: () => void;
27
+ /**
28
+ * A callback that is called when the user presses the previous button along with the default action.
29
+ */
30
+ onPrevCallback?: () => void;
31
+ /**
32
+ * A callback that is called when the user presses the done button along with the default action.
33
+ */
34
+ onDoneCallback?: () => void;
35
+ /**
36
+ * A component that applies blur effect to the toolbar.
37
+ */
38
+ blur?: JSX.Element | null;
39
+ /**
40
+ * A value for container opacity in hexadecimal format (e.g. `ff`). Default value is `ff`.
41
+ */
42
+ opacity?: HEX;
43
+ };
44
+ /**
45
+ * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and
46
+ * `Done` buttons.
47
+ */
48
+ declare const KeyboardToolbar: React.FC<KeyboardToolbarProps>;
49
+ export { colors as DefaultKeyboardToolbarTheme };
50
+ export default KeyboardToolbar;