react-native-keyboard-controller 1.9.5 → 1.10.1

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 (169) hide show
  1. package/README.md +1 -1
  2. package/android/src/fabric/java/com/reactnativekeyboardcontroller/KeyboardControllerModule.kt +4 -0
  3. package/android/src/main/java/com/reactnativekeyboardcontroller/events/FocusedInputTextChangedEvent.kt +20 -0
  4. package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/EditText.kt +36 -0
  5. package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/WindowInsetsAnimationCompat.kt +7 -0
  6. package/android/src/main/java/com/reactnativekeyboardcontroller/listeners/FocusedInputObserver.kt +17 -0
  7. package/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt +12 -0
  8. package/android/src/main/java/com/reactnativekeyboardcontroller/managers/KeyboardControllerViewManagerImpl.kt +2 -0
  9. package/android/src/main/java/com/reactnativekeyboardcontroller/modules/KeyboardControllerModuleImpl.kt +13 -0
  10. package/android/src/paper/java/com/reactnativekeyboardcontroller/KeyboardControllerModule.kt +5 -0
  11. package/ios/.clang-format +30 -30
  12. package/ios/.swiftlint.yml +1 -1
  13. package/ios/KeyboardController.xcodeproj/project.pbxproj +10 -0
  14. package/ios/KeyboardControllerModule.mm +14 -0
  15. package/ios/events/FocusedInputTextChangedEvent.h +16 -0
  16. package/ios/events/FocusedInputTextChangedEvent.m +72 -0
  17. package/ios/observers/FocusedInputObserver.swift +29 -14
  18. package/ios/observers/TextChangeObserver.swift +41 -0
  19. package/ios/views/KeyboardControllerView.mm +53 -31
  20. package/ios/views/KeyboardControllerViewManager.mm +1 -0
  21. package/ios/views/KeyboardControllerViewManager.swift +21 -10
  22. package/jest/index.js +6 -4
  23. package/lib/commonjs/animated.js +33 -27
  24. package/lib/commonjs/animated.js.map +1 -1
  25. package/lib/commonjs/bindings.js +1 -0
  26. package/lib/commonjs/bindings.js.map +1 -1
  27. package/lib/commonjs/bindings.native.js +6 -6
  28. package/lib/commonjs/bindings.native.js.map +1 -1
  29. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js +5 -3
  30. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js.map +1 -1
  31. package/lib/commonjs/components/KeyboardAvoidingView/index.js +17 -9
  32. package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
  33. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +199 -0
  34. package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -0
  35. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +100 -0
  36. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -0
  37. package/lib/commonjs/components/KeyboardAwareScrollView/utils.js +28 -0
  38. package/lib/commonjs/components/KeyboardAwareScrollView/utils.js.map +1 -0
  39. package/lib/commonjs/components/KeyboardStickyView/index.js +7 -4
  40. package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -1
  41. package/lib/commonjs/components/hooks/useKeyboardInterpolation.js +81 -0
  42. package/lib/commonjs/components/hooks/useKeyboardInterpolation.js.map +1 -0
  43. package/lib/commonjs/components/index.js +7 -0
  44. package/lib/commonjs/components/index.js.map +1 -1
  45. package/lib/commonjs/constants.js.map +1 -1
  46. package/lib/commonjs/context.js +2 -1
  47. package/lib/commonjs/context.js.map +1 -1
  48. package/lib/commonjs/hooks.js +17 -2
  49. package/lib/commonjs/hooks.js.map +1 -1
  50. package/lib/commonjs/index.js +8 -1
  51. package/lib/commonjs/index.js.map +1 -1
  52. package/lib/commonjs/internal.js +3 -6
  53. package/lib/commonjs/internal.js.map +1 -1
  54. package/lib/commonjs/monkey-patch.android.js +1 -1
  55. package/lib/commonjs/monkey-patch.android.js.map +1 -1
  56. package/lib/commonjs/monkey-patch.js.map +1 -1
  57. package/lib/commonjs/reanimated.js +5 -3
  58. package/lib/commonjs/reanimated.js.map +1 -1
  59. package/lib/commonjs/reanimated.native.js +29 -12
  60. package/lib/commonjs/reanimated.native.js.map +1 -1
  61. package/lib/commonjs/replicas.js +7 -5
  62. package/lib/commonjs/replicas.js.map +1 -1
  63. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js +1 -1
  64. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  65. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js +2 -2
  66. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  67. package/lib/commonjs/specs/NativeKeyboardController.js +1 -1
  68. package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
  69. package/lib/commonjs/specs/NativeStatusBarManagerCompat.js +1 -1
  70. package/lib/commonjs/specs/NativeStatusBarManagerCompat.js.map +1 -1
  71. package/lib/commonjs/types.js.map +1 -1
  72. package/lib/commonjs/utils.js.map +1 -1
  73. package/lib/module/animated.js +41 -35
  74. package/lib/module/animated.js.map +1 -1
  75. package/lib/module/bindings.js +2 -1
  76. package/lib/module/bindings.js.map +1 -1
  77. package/lib/module/bindings.native.js +7 -7
  78. package/lib/module/bindings.native.js.map +1 -1
  79. package/lib/module/components/KeyboardAvoidingView/hooks.js +7 -5
  80. package/lib/module/components/KeyboardAvoidingView/hooks.js.map +1 -1
  81. package/lib/module/components/KeyboardAvoidingView/index.js +20 -13
  82. package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
  83. package/lib/module/components/KeyboardAwareScrollView/index.js +190 -0
  84. package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -0
  85. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +93 -0
  86. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -0
  87. package/lib/module/components/KeyboardAwareScrollView/utils.js +21 -0
  88. package/lib/module/components/KeyboardAwareScrollView/utils.js.map +1 -0
  89. package/lib/module/components/KeyboardStickyView/index.js +9 -7
  90. package/lib/module/components/KeyboardStickyView/index.js.map +1 -1
  91. package/lib/module/components/hooks/useKeyboardInterpolation.js +74 -0
  92. package/lib/module/components/hooks/useKeyboardInterpolation.js.map +1 -0
  93. package/lib/module/components/index.js +3 -2
  94. package/lib/module/components/index.js.map +1 -1
  95. package/lib/module/context.js +4 -3
  96. package/lib/module/context.js.map +1 -1
  97. package/lib/module/hooks.js +21 -7
  98. package/lib/module/hooks.js.map +1 -1
  99. package/lib/module/index.js +8 -8
  100. package/lib/module/index.js.map +1 -1
  101. package/lib/module/internal.js +6 -9
  102. package/lib/module/internal.js.map +1 -1
  103. package/lib/module/monkey-patch.android.js +2 -2
  104. package/lib/module/monkey-patch.android.js.map +1 -1
  105. package/lib/module/monkey-patch.js.map +1 -1
  106. package/lib/module/reanimated.js +2 -1
  107. package/lib/module/reanimated.js.map +1 -1
  108. package/lib/module/reanimated.native.js +27 -11
  109. package/lib/module/reanimated.native.js.map +1 -1
  110. package/lib/module/replicas.js +13 -11
  111. package/lib/module/replicas.js.map +1 -1
  112. package/lib/module/specs/KeyboardControllerViewNativeComponent.js +2 -2
  113. package/lib/module/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  114. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js +3 -3
  115. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  116. package/lib/module/specs/NativeKeyboardController.js +2 -2
  117. package/lib/module/specs/NativeKeyboardController.js.map +1 -1
  118. package/lib/module/specs/NativeStatusBarManagerCompat.js +2 -2
  119. package/lib/module/specs/NativeStatusBarManagerCompat.js.map +1 -1
  120. package/lib/module/types.js.map +1 -1
  121. package/lib/module/utils.js.map +1 -1
  122. package/lib/typescript/animated.d.ts +1 -1
  123. package/lib/typescript/bindings.d.ts +1 -1
  124. package/lib/typescript/bindings.native.d.ts +1 -1
  125. package/lib/typescript/components/KeyboardAvoidingView/index.d.ts +4 -4
  126. package/lib/typescript/components/KeyboardAwareScrollView/index.d.ts +45 -0
  127. package/lib/typescript/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.d.ts +6 -0
  128. package/lib/typescript/components/KeyboardAwareScrollView/utils.d.ts +1 -0
  129. package/lib/typescript/components/KeyboardStickyView/index.d.ts +2 -2
  130. package/lib/typescript/components/hooks/useKeyboardInterpolation.d.ts +20 -0
  131. package/lib/typescript/components/index.d.ts +3 -2
  132. package/lib/typescript/context.d.ts +6 -5
  133. package/lib/typescript/hooks.d.ts +4 -3
  134. package/lib/typescript/index.d.ts +8 -8
  135. package/lib/typescript/internal.d.ts +9 -6
  136. package/lib/typescript/reanimated.d.ts +3 -2
  137. package/lib/typescript/reanimated.native.d.ts +3 -2
  138. package/lib/typescript/replicas.d.ts +1 -1
  139. package/lib/typescript/specs/KeyboardControllerViewNativeComponent.d.ts +7 -3
  140. package/lib/typescript/specs/KeyboardGestureAreaNativeComponent.d.ts +4 -4
  141. package/lib/typescript/specs/NativeKeyboardController.d.ts +2 -1
  142. package/lib/typescript/specs/NativeStatusBarManagerCompat.d.ts +1 -1
  143. package/lib/typescript/types.d.ts +18 -5
  144. package/package.json +12 -11
  145. package/react-native-keyboard-controller.podspec +1 -1
  146. package/src/animated.tsx +59 -42
  147. package/src/bindings.native.ts +11 -11
  148. package/src/bindings.ts +4 -3
  149. package/src/components/KeyboardAvoidingView/hooks.ts +9 -6
  150. package/src/components/KeyboardAvoidingView/index.tsx +30 -27
  151. package/src/components/KeyboardAwareScrollView/index.tsx +262 -0
  152. package/src/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +123 -0
  153. package/src/components/KeyboardAwareScrollView/utils.ts +26 -0
  154. package/src/components/KeyboardStickyView/index.tsx +12 -18
  155. package/src/components/hooks/useKeyboardInterpolation.ts +96 -0
  156. package/src/components/index.ts +3 -2
  157. package/src/context.ts +15 -9
  158. package/src/hooks.ts +30 -13
  159. package/src/index.ts +12 -8
  160. package/src/internal.ts +22 -13
  161. package/src/monkey-patch.android.ts +2 -2
  162. package/src/reanimated.native.ts +43 -18
  163. package/src/reanimated.ts +9 -3
  164. package/src/replicas.ts +18 -17
  165. package/src/specs/KeyboardControllerViewNativeComponent.ts +12 -5
  166. package/src/specs/KeyboardGestureAreaNativeComponent.ts +7 -7
  167. package/src/specs/NativeKeyboardController.ts +4 -3
  168. package/src/specs/NativeStatusBarManagerCompat.ts +3 -3
  169. package/src/types.ts +45 -19
@@ -1,19 +1,19 @@
1
- import React, { useEffect, useMemo, useState } from 'react';
2
- import { Animated, Platform, StyleSheet } from 'react-native';
3
- import Reanimated, { useSharedValue } from 'react-native-reanimated';
4
- import { KeyboardControllerView } from './bindings';
5
- import { KeyboardContext } from './context';
6
- import { useAnimatedValue, useSharedHandlers } from './internal';
7
- import { applyMonkeyPatch, revertMonkeyPatch } from './monkey-patch';
8
- import { useAnimatedKeyboardHandler, useFocusedInputHandler } from './reanimated';
1
+ import React, { useEffect, useMemo, useState } from "react";
2
+ import { Animated, Platform, StyleSheet } from "react-native";
3
+ import Reanimated, { useSharedValue } from "react-native-reanimated";
4
+ import { KeyboardControllerView } from "./bindings";
5
+ import { KeyboardContext } from "./context";
6
+ import { useAnimatedValue, useSharedHandlers } from "./internal";
7
+ import { applyMonkeyPatch, revertMonkeyPatch } from "./monkey-patch";
8
+ import { useAnimatedKeyboardHandler, useFocusedInputLayoutHandler, useFocusedInputTextHandler } from "./reanimated";
9
9
  const KeyboardControllerViewAnimated = Reanimated.createAnimatedComponent(Animated.createAnimatedComponent(KeyboardControllerView));
10
10
  const styles = StyleSheet.create({
11
11
  container: {
12
12
  flex: 1
13
13
  },
14
14
  hidden: {
15
- display: 'none',
16
- position: 'absolute'
15
+ display: "none",
16
+ position: "absolute"
17
17
  }
18
18
  });
19
19
  export const KeyboardProvider = _ref => {
@@ -23,6 +23,7 @@ export const KeyboardProvider = _ref => {
23
23
  navigationBarTranslucent,
24
24
  enabled: initiallyEnabled = true
25
25
  } = _ref;
26
+ // state
26
27
  const [enabled, setEnabled] = useState(initiallyEnabled);
27
28
  // animated values
28
29
  const progress = useAnimatedValue(0);
@@ -31,10 +32,8 @@ export const KeyboardProvider = _ref => {
31
32
  const progressSV = useSharedValue(0);
32
33
  const heightSV = useSharedValue(0);
33
34
  const layout = useSharedValue(null);
34
- const {
35
- setHandlers,
36
- broadcast
37
- } = useSharedHandlers();
35
+ const [setKeyboardHandlers, broadcastKeyboardEvents] = useSharedHandlers();
36
+ const [setInputHandlers, broadcastInputEvents] = useSharedHandlers();
38
37
  // memo
39
38
  const context = useMemo(() => ({
40
39
  enabled,
@@ -47,7 +46,8 @@ export const KeyboardProvider = _ref => {
47
46
  height: heightSV
48
47
  },
49
48
  layout,
50
- setHandlers,
49
+ setKeyboardHandlers,
50
+ setInputHandlers,
51
51
  setEnabled
52
52
  }), [enabled]);
53
53
  const style = useMemo(() => [styles.hidden, {
@@ -67,7 +67,7 @@ export const KeyboardProvider = _ref => {
67
67
  }), []);
68
68
  // handlers
69
69
  const updateSharedValues = (event, platforms) => {
70
- 'worklet';
70
+ "worklet";
71
71
 
72
72
  if (platforms.includes(Platform.OS)) {
73
73
  progressSV.value = event.progress;
@@ -76,32 +76,32 @@ export const KeyboardProvider = _ref => {
76
76
  };
77
77
  const keyboardHandler = useAnimatedKeyboardHandler({
78
78
  onKeyboardMoveStart: event => {
79
- 'worklet';
79
+ "worklet";
80
80
 
81
- broadcast('onStart', event);
82
- updateSharedValues(event, ['ios']);
81
+ broadcastKeyboardEvents("onStart", event);
82
+ updateSharedValues(event, ["ios"]);
83
83
  },
84
84
  onKeyboardMove: event => {
85
- 'worklet';
85
+ "worklet";
86
86
 
87
- broadcast('onMove', event);
88
- updateSharedValues(event, ['android']);
87
+ broadcastKeyboardEvents("onMove", event);
88
+ updateSharedValues(event, ["android"]);
89
89
  },
90
90
  onKeyboardMoveEnd: event => {
91
- 'worklet';
91
+ "worklet";
92
92
 
93
- broadcast('onEnd', event);
93
+ broadcastKeyboardEvents("onEnd", event);
94
94
  },
95
95
  onKeyboardMoveInteractive: event => {
96
- 'worklet';
96
+ "worklet";
97
97
 
98
- updateSharedValues(event, ['android', 'ios']);
99
- broadcast('onInteractive', event);
98
+ updateSharedValues(event, ["android", "ios"]);
99
+ broadcastKeyboardEvents("onInteractive", event);
100
100
  }
101
101
  }, []);
102
- const inputHandler = useFocusedInputHandler({
102
+ const inputLayoutHandler = useFocusedInputLayoutHandler({
103
103
  onFocusedInputLayoutChanged: e => {
104
- 'worklet';
104
+ "worklet";
105
105
 
106
106
  if (e.target !== -1) {
107
107
  layout.value = e;
@@ -110,6 +110,13 @@ export const KeyboardProvider = _ref => {
110
110
  }
111
111
  }
112
112
  }, []);
113
+ const inputTextHandler = useFocusedInputTextHandler({
114
+ onFocusedInputTextChanged: e => {
115
+ "worklet";
116
+
117
+ broadcastInputEvents("onChangeText", e);
118
+ }
119
+ }, []);
113
120
  // effects
114
121
  useEffect(() => {
115
122
  if (enabled) {
@@ -123,14 +130,13 @@ export const KeyboardProvider = _ref => {
123
130
  }, /*#__PURE__*/React.createElement(KeyboardControllerViewAnimated, {
124
131
  enabled: enabled,
125
132
  onKeyboardMoveReanimated: keyboardHandler,
126
- onKeyboardMoveStart: Platform.OS === 'ios' ? onKeyboardMove : undefined,
127
- onKeyboardMove: Platform.OS === 'android' ? onKeyboardMove : undefined,
133
+ onKeyboardMoveStart: Platform.OS === "ios" ? onKeyboardMove : undefined,
134
+ onKeyboardMove: Platform.OS === "android" ? onKeyboardMove : undefined,
128
135
  onKeyboardMoveInteractive: onKeyboardMove,
129
- onFocusedInputLayoutChangedReanimated: inputHandler,
136
+ onFocusedInputLayoutChangedReanimated: inputLayoutHandler,
137
+ onFocusedInputTextChangedReanimated: inputTextHandler,
130
138
  navigationBarTranslucent: navigationBarTranslucent,
131
- statusBarTranslucent: statusBarTranslucent
132
- // @ts-expect-error https://github.com/software-mansion/react-native-reanimated/pull/4923
133
- ,
139
+ statusBarTranslucent: statusBarTranslucent,
134
140
  style: styles.container
135
141
  }, children), /*#__PURE__*/React.createElement(Animated.View, {
136
142
  // we are using this small hack, because if the component (where
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useMemo","useState","Animated","Platform","StyleSheet","Reanimated","useSharedValue","KeyboardControllerView","KeyboardContext","useAnimatedValue","useSharedHandlers","applyMonkeyPatch","revertMonkeyPatch","useAnimatedKeyboardHandler","useFocusedInputHandler","KeyboardControllerViewAnimated","createAnimatedComponent","styles","create","container","flex","hidden","display","position","KeyboardProvider","children","statusBarTranslucent","navigationBarTranslucent","enabled","initiallyEnabled","setEnabled","progress","height","progressSV","heightSV","layout","setHandlers","broadcast","context","animated","multiply","reanimated","style","transform","translateX","translateY","onKeyboardMove","event","nativeEvent","useNativeDriver","updateSharedValues","platforms","includes","OS","value","keyboardHandler","onKeyboardMoveStart","onKeyboardMoveEnd","onKeyboardMoveInteractive","inputHandler","onFocusedInputLayoutChanged","e","target","undefined"],"sources":["animated.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport { Animated, Platform, StyleSheet } from 'react-native';\nimport Reanimated, { useSharedValue } from 'react-native-reanimated';\n\nimport { KeyboardControllerView } from './bindings';\nimport { KeyboardContext } from './context';\nimport { useAnimatedValue, useSharedHandlers } from './internal';\nimport { applyMonkeyPatch, revertMonkeyPatch } from './monkey-patch';\nimport {\n useAnimatedKeyboardHandler,\n useFocusedInputHandler,\n} from './reanimated';\n\nimport type { KeyboardAnimationContext } from './context';\nimport type {\n FocusedInputLayoutChangedEvent,\n KeyboardControllerProps,\n KeyboardHandler,\n NativeEvent,\n} from './types';\nimport type { ViewStyle } from 'react-native';\n\nconst KeyboardControllerViewAnimated = Reanimated.createAnimatedComponent(\n Animated.createAnimatedComponent(\n KeyboardControllerView\n ) as React.FC<KeyboardControllerProps>\n);\n\ntype Styles = {\n container: ViewStyle;\n hidden: ViewStyle;\n};\n\nconst styles = StyleSheet.create<Styles>({\n container: {\n flex: 1,\n },\n hidden: {\n display: 'none',\n position: 'absolute',\n },\n});\n\ntype KeyboardProviderProps = {\n children: React.ReactNode;\n /**\n * Set the value to `true`, if you use translucent status bar on Android.\n * If you already control status bar translucency via `react-native-screens`\n * or `StatusBar` component from `react-native`, you can ignore it.\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/14\n * @platform android\n */\n statusBarTranslucent?: boolean;\n /**\n * Set the value to `true`, if you use translucent navigation bar on Android.\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/119\n * @platform android\n */\n navigationBarTranslucent?: boolean;\n /**\n * A boolean prop indicating whether the module is enabled. It indicate only initial state,\n * i. e. if you try to change this prop after component mount it will not have any effect.\n * To change the property in runtime use `useKeyboardController` hook and `setEnabled` method.\n * Defaults to `true`.\n */\n enabled?: boolean;\n};\n\nexport const KeyboardProvider = ({\n children,\n statusBarTranslucent,\n navigationBarTranslucent,\n enabled: initiallyEnabled = true,\n}: KeyboardProviderProps) => {\n const [enabled, setEnabled] = useState(initiallyEnabled);\n // animated values\n const progress = useAnimatedValue(0);\n const height = useAnimatedValue(0);\n // shared values\n const progressSV = useSharedValue(0);\n const heightSV = useSharedValue(0);\n const layout = useSharedValue<FocusedInputLayoutChangedEvent | null>(null);\n const { setHandlers, broadcast } = useSharedHandlers<KeyboardHandler>();\n // memo\n const context = useMemo<KeyboardAnimationContext>(\n () => ({\n enabled,\n animated: { progress: progress, height: Animated.multiply(height, -1) },\n reanimated: { progress: progressSV, height: heightSV },\n layout,\n setHandlers,\n setEnabled,\n }),\n [enabled]\n );\n const style = useMemo(\n () => [\n styles.hidden,\n { transform: [{ translateX: height }, { translateY: progress }] },\n ],\n []\n );\n const onKeyboardMove = useMemo(\n () =>\n Animated.event(\n [\n {\n nativeEvent: {\n progress,\n height,\n },\n },\n ],\n { useNativeDriver: true }\n ),\n []\n );\n // handlers\n const updateSharedValues = (event: NativeEvent, platforms: string[]) => {\n 'worklet';\n\n if (platforms.includes(Platform.OS)) {\n progressSV.value = event.progress;\n heightSV.value = -event.height;\n }\n };\n const keyboardHandler = useAnimatedKeyboardHandler(\n {\n onKeyboardMoveStart: (event: NativeEvent) => {\n 'worklet';\n\n broadcast('onStart', event);\n updateSharedValues(event, ['ios']);\n },\n onKeyboardMove: (event: NativeEvent) => {\n 'worklet';\n\n broadcast('onMove', event);\n updateSharedValues(event, ['android']);\n },\n onKeyboardMoveEnd: (event: NativeEvent) => {\n 'worklet';\n\n broadcast('onEnd', event);\n },\n onKeyboardMoveInteractive: (event: NativeEvent) => {\n 'worklet';\n\n updateSharedValues(event, ['android', 'ios']);\n broadcast('onInteractive', event);\n },\n },\n []\n );\n const inputHandler = useFocusedInputHandler(\n {\n onFocusedInputLayoutChanged: (e) => {\n 'worklet';\n\n if (e.target !== -1) {\n layout.value = e;\n } else {\n layout.value = null;\n }\n },\n },\n []\n );\n // effects\n useEffect(() => {\n if (enabled) {\n applyMonkeyPatch();\n } else {\n revertMonkeyPatch();\n }\n }, [enabled]);\n\n return (\n <KeyboardContext.Provider value={context}>\n <KeyboardControllerViewAnimated\n enabled={enabled}\n onKeyboardMoveReanimated={keyboardHandler}\n onKeyboardMoveStart={Platform.OS === 'ios' ? onKeyboardMove : undefined}\n onKeyboardMove={Platform.OS === 'android' ? onKeyboardMove : undefined}\n onKeyboardMoveInteractive={onKeyboardMove}\n onFocusedInputLayoutChangedReanimated={inputHandler}\n navigationBarTranslucent={navigationBarTranslucent}\n statusBarTranslucent={statusBarTranslucent}\n // @ts-expect-error https://github.com/software-mansion/react-native-reanimated/pull/4923\n style={styles.container}\n >\n {children}\n </KeyboardControllerViewAnimated>\n <Animated.View\n // we are using this small hack, because if the component (where\n // animated value has been used) is unmounted, then animation will\n // stop receiving events (seems like it's react-native optimization).\n // So we need to keep a reference to the animated value, to keep it's\n // always mounted (keep a reference to an animated value).\n //\n // To test why it's needed, try to open screen which consumes Animated.Value\n // then close it and open it again (for example 'Animated transition').\n style={style}\n />\n </KeyboardContext.Provider>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QA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CAAqC,EAAEa,YAAa;IACpD,wBAAwB,EAAEhC,wBAAyB;IACnD,oBAAoB,EAAED;IACtB;IAAA;IACA,KAAK,EAAET,MAAM,CAACE;EAAU,GAEvBM,QAAQ,CACsB,eACjC,oBAAC,QAAQ,CAAC,IAAI;IACZ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,KAAK,EAAEiB;EAAM,EACb,CACuB;AAE/B,CAAC"}
1
+ {"version":3,"names":["React","useEffect","useMemo","useState","Animated","Platform","StyleSheet","Reanimated","useSharedValue","KeyboardControllerView","KeyboardContext","useAnimatedValue","useSharedHandlers","applyMonkeyPatch","revertMonkeyPatch","useAnimatedKeyboardHandler","useFocusedInputLayoutHandler","useFocusedInputTextHandler","KeyboardControllerViewAnimated","createAnimatedComponent","styles","create","container","flex","hidden","display","position","KeyboardProvider","_ref","children","statusBarTranslucent","navigationBarTranslucent","enabled","initiallyEnabled","setEnabled","progress","height","progressSV","heightSV","layout","setKeyboardHandlers","broadcastKeyboardEvents","setInputHandlers","broadcastInputEvents","context","animated","multiply","reanimated","style","transform","translateX","translateY","onKeyboardMove","event","nativeEvent","useNativeDriver","updateSharedValues","platforms","includes","OS","value","keyboardHandler","onKeyboardMoveStart","onKeyboardMoveEnd","onKeyboardMoveInteractive","inputLayoutHandler","onFocusedInputLayoutChanged","e","target","inputTextHandler","onFocusedInputTextChanged","createElement","Provider","onKeyboardMoveReanimated","undefined","onFocusedInputLayoutChangedReanimated","onFocusedInputTextChangedReanimated","View"],"sources":["animated.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { Animated, Platform, StyleSheet } from \"react-native\";\nimport Reanimated, { useSharedValue } from \"react-native-reanimated\";\n\nimport { KeyboardControllerView } from \"./bindings\";\nimport { KeyboardContext } from \"./context\";\nimport { useAnimatedValue, useSharedHandlers } from \"./internal\";\nimport { applyMonkeyPatch, revertMonkeyPatch } from \"./monkey-patch\";\nimport {\n useAnimatedKeyboardHandler,\n useFocusedInputLayoutHandler,\n useFocusedInputTextHandler,\n} from \"./reanimated\";\n\nimport type { KeyboardAnimationContext } from \"./context\";\nimport type {\n FocusedInputHandler,\n FocusedInputLayoutChangedEvent,\n KeyboardControllerProps,\n KeyboardHandler,\n NativeEvent,\n} from \"./types\";\nimport type { ViewStyle } from \"react-native\";\n\nconst KeyboardControllerViewAnimated = Reanimated.createAnimatedComponent(\n Animated.createAnimatedComponent(\n KeyboardControllerView,\n ) as React.FC<KeyboardControllerProps>,\n);\n\ntype Styles = {\n container: ViewStyle;\n hidden: ViewStyle;\n};\n\nconst styles = StyleSheet.create<Styles>({\n container: {\n flex: 1,\n },\n hidden: {\n display: \"none\",\n position: \"absolute\",\n },\n});\n\ntype KeyboardProviderProps = {\n children: React.ReactNode;\n /**\n * Set the value to `true`, if you use translucent status bar on Android.\n * If you already control status bar translucency via `react-native-screens`\n * or `StatusBar` component from `react-native`, you can ignore it.\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/14\n * @platform android\n */\n statusBarTranslucent?: boolean;\n /**\n * Set the value to `true`, if you use translucent navigation bar on Android.\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/119\n * @platform android\n */\n navigationBarTranslucent?: boolean;\n /**\n * A boolean prop indicating whether the module is enabled. It indicate only initial state,\n * i. e. if you try to change this prop after component mount it will not have any effect.\n * To change the property in runtime use `useKeyboardController` hook and `setEnabled` method.\n * Defaults to `true`.\n */\n enabled?: boolean;\n};\n\nexport const KeyboardProvider = ({\n children,\n statusBarTranslucent,\n navigationBarTranslucent,\n enabled: initiallyEnabled = true,\n}: KeyboardProviderProps) => {\n // state\n const [enabled, setEnabled] = useState(initiallyEnabled);\n // animated values\n const progress = useAnimatedValue(0);\n const height = useAnimatedValue(0);\n // shared values\n const progressSV = useSharedValue(0);\n const heightSV = useSharedValue(0);\n const layout = useSharedValue<FocusedInputLayoutChangedEvent | null>(null);\n const [setKeyboardHandlers, broadcastKeyboardEvents] =\n useSharedHandlers<KeyboardHandler>();\n const [setInputHandlers, broadcastInputEvents] =\n useSharedHandlers<FocusedInputHandler>();\n // memo\n const context = useMemo<KeyboardAnimationContext>(\n () => ({\n enabled,\n animated: { progress: progress, height: Animated.multiply(height, -1) },\n reanimated: { progress: progressSV, height: heightSV },\n layout,\n setKeyboardHandlers,\n setInputHandlers,\n setEnabled,\n }),\n [enabled],\n );\n const style = useMemo(\n () => [\n styles.hidden,\n { transform: [{ translateX: height }, { translateY: progress }] },\n ],\n [],\n );\n const onKeyboardMove = useMemo(\n () =>\n Animated.event(\n [\n {\n nativeEvent: {\n progress,\n height,\n },\n },\n ],\n { useNativeDriver: true },\n ),\n [],\n );\n // handlers\n const updateSharedValues = (event: NativeEvent, platforms: string[]) => {\n \"worklet\";\n\n if (platforms.includes(Platform.OS)) {\n progressSV.value = event.progress;\n heightSV.value = -event.height;\n }\n };\n const keyboardHandler = useAnimatedKeyboardHandler(\n {\n onKeyboardMoveStart: (event: NativeEvent) => {\n \"worklet\";\n\n broadcastKeyboardEvents(\"onStart\", event);\n updateSharedValues(event, [\"ios\"]);\n },\n onKeyboardMove: (event: NativeEvent) => {\n \"worklet\";\n\n broadcastKeyboardEvents(\"onMove\", event);\n updateSharedValues(event, [\"android\"]);\n },\n onKeyboardMoveEnd: (event: NativeEvent) => {\n \"worklet\";\n\n broadcastKeyboardEvents(\"onEnd\", event);\n },\n onKeyboardMoveInteractive: (event: NativeEvent) => {\n \"worklet\";\n\n updateSharedValues(event, [\"android\", \"ios\"]);\n broadcastKeyboardEvents(\"onInteractive\", event);\n },\n },\n [],\n );\n const inputLayoutHandler = useFocusedInputLayoutHandler(\n {\n onFocusedInputLayoutChanged: (e) => {\n \"worklet\";\n\n if (e.target !== -1) {\n layout.value = e;\n } else {\n layout.value = null;\n }\n },\n },\n [],\n );\n const inputTextHandler = useFocusedInputTextHandler(\n {\n onFocusedInputTextChanged: (e) => {\n \"worklet\";\n\n broadcastInputEvents(\"onChangeText\", e);\n },\n },\n [],\n );\n // effects\n useEffect(() => {\n if (enabled) {\n applyMonkeyPatch();\n } else {\n revertMonkeyPatch();\n }\n }, [enabled]);\n\n return (\n <KeyboardContext.Provider value={context}>\n <KeyboardControllerViewAnimated\n enabled={enabled}\n onKeyboardMoveReanimated={keyboardHandler}\n onKeyboardMoveStart={Platform.OS === \"ios\" ? onKeyboardMove : undefined}\n onKeyboardMove={Platform.OS === \"android\" ? onKeyboardMove : undefined}\n onKeyboardMoveInteractive={onKeyboardMove}\n onFocusedInputLayoutChangedReanimated={inputLayoutHandler}\n onFocusedInputTextChangedReanimated={inputTextHandler}\n navigationBarTranslucent={navigationBarTranslucent}\n statusBarTranslucent={statusBarTranslucent}\n style={styles.container}\n >\n {children}\n </KeyboardControllerViewAnimated>\n <Animated.View\n // we are using this small hack, because if the component (where\n // animated value has been used) is unmounted, then animation will\n // stop receiving events (seems like it's react-native optimization).\n // So we need to keep a reference to the animated value, to keep it's\n // always mounted (keep a reference to an animated value).\n //\n // To test why it's needed, try to open screen which consumes Animated.Value\n // then close it and open it again (for example 'Animated transition').\n style={style}\n />\n </KeyboardContext.Provider>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC3D,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAC7D,OAAOC,UAAU,IAAIC,cAAc,QAAQ,yBAAyB;AAEpE,SAASC,sBAAsB,QAAQ,YAAY;AACnD,SAASC,eAAe,QAAQ,WAAW;AAC3C,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,YAAY;AAChE,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,gBAAgB;AACpE,SACEC,0BAA0B,EAC1BC,4BAA4B,EAC5BC,0BAA0B,QACrB,cAAc;AAYrB,MAAMC,8BAA8B,GAAGX,UAAU,CAACY,uBAAuB,CACvEf,QAAQ,CAACe,uBAAuB,CAC9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B;IAC1DW,mCAAmC,EAAEP,gBAAiB;IACtDtC,wBAAwB,EAAEA,wBAAyB;IACnDD,oBAAoB,EAAEA,oBAAqB;IAC3CkB,KAAK,EAAE5B,MAAM,CAACE;EAAU,GAEvBO,QAC6B,CAAC,eACjC7B,KAAA,CAAAuE,aAAA,CAACnE,QAAQ,CAACyE,IAAI;IACZ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA7B,KAAK,EAAEA;EAAM,CACd,CACuB,CAAC;AAE/B,CAAC"}
@@ -1,8 +1,9 @@
1
- import { View } from 'react-native';
1
+ import { View } from "react-native";
2
2
  const NOOP = () => {};
3
3
  export const KeyboardController = {
4
4
  setDefaultMode: NOOP,
5
5
  setInputMode: NOOP,
6
+ dismiss: NOOP,
6
7
  addListener: NOOP,
7
8
  removeListeners: NOOP
8
9
  };
@@ -1 +1 @@
1
- {"version":3,"names":["View","NOOP","KeyboardController","setDefaultMode","setInputMode","addListener","removeListeners","KeyboardEvents","remove","KeyboardControllerView","KeyboardGestureArea"],"sources":["bindings.ts"],"sourcesContent":["import { View } from 'react-native';\n\nimport type {\n KeyboardControllerModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardGestureAreaProps,\n} from './types';\nimport type { EmitterSubscription } from 'react-native';\n\nconst NOOP = () => {};\nexport const KeyboardController: KeyboardControllerModule = {\n setDefaultMode: NOOP,\n setInputMode: NOOP,\n addListener: NOOP,\n removeListeners: NOOP,\n};\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\nexport const KeyboardControllerView =\n View as unknown as React.FC<KeyboardControllerProps>;\nexport const KeyboardGestureArea =\n View as unknown as React.FC<KeyboardGestureAreaProps>;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,cAAc;AAUnC,MAAMC,IAAI,GAAG,MAAM,CAAC,CAAC;AACrB,OAAO,MAAMC,kBAA4C,GAAG;EAC1DC,cAAc,EAAEF,IAAI;EACpBG,YAAY,EAAEH,IAAI;EAClBI,WAAW,EAAEJ,IAAI;EACjBK,eAAe,EAAEL;AACnB,CAAC;AACD,OAAO,MAAMM,cAAoC,GAAG;EAClDF,WAAW,EAAE,OAAO;IAAEG,MAAM,EAAEP;EAAK,CAAC;AACtC,CAAC;AACD,OAAO,MAAMQ,sBAAsB,GACjCT,IAAoD;AACtD,OAAO,MAAMU,mBAAmB,GAC9BV,IAAqD"}
1
+ {"version":3,"names":["View","NOOP","KeyboardController","setDefaultMode","setInputMode","dismiss","addListener","removeListeners","KeyboardEvents","remove","KeyboardControllerView","KeyboardGestureArea"],"sources":["bindings.ts"],"sourcesContent":["import { View } from \"react-native\";\n\nimport type {\n KeyboardControllerModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardGestureAreaProps,\n} from \"./types\";\nimport type { EmitterSubscription } from \"react-native\";\n\nconst NOOP = () => {};\nexport const KeyboardController: KeyboardControllerModule = {\n setDefaultMode: NOOP,\n setInputMode: NOOP,\n dismiss: NOOP,\n addListener: NOOP,\n removeListeners: NOOP,\n};\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\nexport const KeyboardControllerView =\n View as unknown as React.FC<KeyboardControllerProps>;\nexport const KeyboardGestureArea =\n View as unknown as React.FC<KeyboardGestureAreaProps>;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,cAAc;AAUnC,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,OAAO,MAAMC,kBAA4C,GAAG;EAC1DC,cAAc,EAAEF,IAAI;EACpBG,YAAY,EAAEH,IAAI;EAClBI,OAAO,EAAEJ,IAAI;EACbK,WAAW,EAAEL,IAAI;EACjBM,eAAe,EAAEN;AACnB,CAAC;AACD,OAAO,MAAMO,cAAoC,GAAG;EAClDF,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAER;EAAK,CAAC;AACtC,CAAC;AACD,OAAO,MAAMS,sBAAsB,GACjCV,IAAoD;AACtD,OAAO,MAAMW,mBAAmB,GAC9BX,IAAqD"}
@@ -1,9 +1,9 @@
1
- import { NativeEventEmitter, Platform } from 'react-native';
1
+ import { NativeEventEmitter, Platform } from "react-native";
2
2
  const LINKING_ERROR = `The package 'react-native-keyboard-controller' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
3
3
  ios: "- You have run 'pod install'\n",
4
- default: ''
5
- }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
6
- const RCTKeyboardController = require('./specs/NativeKeyboardController').default;
4
+ default: ""
5
+ }) + "- You rebuilt the app after installing the package\n" + "- You are not using Expo Go\n";
6
+ const RCTKeyboardController = require("./specs/NativeKeyboardController").default;
7
7
  export const KeyboardController = RCTKeyboardController ? RCTKeyboardController : new Proxy({}, {
8
8
  get() {
9
9
  throw new Error(LINKING_ERROR);
@@ -11,10 +11,10 @@ export const KeyboardController = RCTKeyboardController ? RCTKeyboardController
11
11
  });
12
12
  const eventEmitter = new NativeEventEmitter(KeyboardController);
13
13
  export const KeyboardEvents = {
14
- addListener: (name, cb) => eventEmitter.addListener('KeyboardController::' + name, cb)
14
+ addListener: (name, cb) => eventEmitter.addListener("KeyboardController::" + name, cb)
15
15
  };
16
- export const KeyboardControllerView = require('./specs/KeyboardControllerViewNativeComponent').default;
17
- export const KeyboardGestureArea = Platform.OS === 'android' && Platform.Version >= 30 ? require('./specs/KeyboardGestureAreaNativeComponent').default : _ref => {
16
+ export const KeyboardControllerView = require("./specs/KeyboardControllerViewNativeComponent").default;
17
+ export const KeyboardGestureArea = Platform.OS === "android" && Platform.Version >= 30 ? require("./specs/KeyboardGestureAreaNativeComponent").default : _ref => {
18
18
  let {
19
19
  children
20
20
  } = _ref;
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","Platform","LINKING_ERROR","select","ios","default","RCTKeyboardController","require","KeyboardController","Proxy","get","Error","eventEmitter","KeyboardEvents","addListener","name","cb","KeyboardControllerView","KeyboardGestureArea","OS","Version","children"],"sources":["bindings.native.ts"],"sourcesContent":["import { NativeEventEmitter, Platform } from 'react-native';\n\nimport type {\n KeyboardControllerModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardGestureAreaProps,\n} from './types';\n\nconst LINKING_ERROR =\n `The package 'react-native-keyboard-controller' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo Go\\n';\n\nconst RCTKeyboardController =\n require('./specs/NativeKeyboardController').default;\nexport const KeyboardController = (\n RCTKeyboardController\n ? RCTKeyboardController\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n )\n) as KeyboardControllerModule;\n\nconst eventEmitter = new NativeEventEmitter(KeyboardController);\n\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: (name, cb) =>\n eventEmitter.addListener('KeyboardController::' + name, cb),\n};\nexport const KeyboardControllerView: React.FC<KeyboardControllerProps> =\n require('./specs/KeyboardControllerViewNativeComponent').default;\nexport const KeyboardGestureArea: React.FC<KeyboardGestureAreaProps> =\n Platform.OS === 'android' && Platform.Version >= 30\n ? require('./specs/KeyboardGestureAreaNativeComponent').default\n : ({ children }: KeyboardGestureAreaProps) => children;\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAS3D,MAAMC,aAAa,GAChB,2FAA0F,GAC3FD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,qBAAqB,GACzBC,OAAO,CAAC,kCAAkC,CAAC,CAACF,OAAO;AACrD,OAAO,MAAMG,kBAAkB,GAC7BF,qBAAqB,GACjBA,qBAAqB,GACrB,IAAIG,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CAAC,CAEoB;AAE7B,MAAMU,YAAY,GAAG,IAAIZ,kBAAkB,CAACQ,kBAAkB,CAAC;AAE/D,OAAO,MAAMK,cAAoC,GAAG;EAClDC,WAAW,EAAE,CAACC,IAAI,EAAEC,EAAE,KACpBJ,YAAY,CAACE,WAAW,CAAC,sBAAsB,GAAGC,IAAI,EAAEC,EAAE;AAC9D,CAAC;AACD,OAAO,MAAMC,sBAAyD,GACpEV,OAAO,CAAC,+CAA+C,CAAC,CAACF,OAAO;AAClE,OAAO,MAAMa,mBAAuD,GAClEjB,QAAQ,CAACkB,EAAE,KAAK,SAAS,IAAIlB,QAAQ,CAACmB,OAAO,IAAI,EAAE,GAC/Cb,OAAO,CAAC,4CAA4C,CAAC,CAACF,OAAO,GAC7D;EAAA,IAAC;IAAEgB;EAAmC,CAAC;EAAA,OAAKA,QAAQ;AAAA"}
1
+ {"version":3,"names":["NativeEventEmitter","Platform","LINKING_ERROR","select","ios","default","RCTKeyboardController","require","KeyboardController","Proxy","get","Error","eventEmitter","KeyboardEvents","addListener","name","cb","KeyboardControllerView","KeyboardGestureArea","OS","Version","_ref","children"],"sources":["bindings.native.ts"],"sourcesContent":["import { NativeEventEmitter, Platform } from \"react-native\";\n\nimport type {\n KeyboardControllerModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardGestureAreaProps,\n} from \"./types\";\n\nconst LINKING_ERROR =\n `The package 'react-native-keyboard-controller' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: \"\" }) +\n \"- You rebuilt the app after installing the package\\n\" +\n \"- You are not using Expo Go\\n\";\n\nconst RCTKeyboardController =\n require(\"./specs/NativeKeyboardController\").default;\nexport const KeyboardController = (\n RCTKeyboardController\n ? RCTKeyboardController\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n },\n )\n) as KeyboardControllerModule;\n\nconst eventEmitter = new NativeEventEmitter(KeyboardController);\n\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: (name, cb) =>\n eventEmitter.addListener(\"KeyboardController::\" + name, cb),\n};\nexport const KeyboardControllerView: React.FC<KeyboardControllerProps> =\n require(\"./specs/KeyboardControllerViewNativeComponent\").default;\nexport const KeyboardGestureArea: React.FC<KeyboardGestureAreaProps> =\n Platform.OS === \"android\" && Platform.Version >= 30\n ? require(\"./specs/KeyboardGestureAreaNativeComponent\").default\n : ({ children }: KeyboardGestureAreaProps) => children;\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAS3D,MAAMC,aAAa,GAChB,2FAA0F,GAC3FD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,qBAAqB,GACzBC,OAAO,CAAC,kCAAkC,CAAC,CAACF,OAAO;AACrD,OAAO,MAAMG,kBAAkB,GAC7BF,qBAAqB,GACjBA,qBAAqB,GACrB,IAAIG,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CACF,CACuB;AAE7B,MAAMU,YAAY,GAAG,IAAIZ,kBAAkB,CAACQ,kBAAkB,CAAC;AAE/D,OAAO,MAAMK,cAAoC,GAAG;EAClDC,WAAW,EAAEA,CAACC,IAAI,EAAEC,EAAE,KACpBJ,YAAY,CAACE,WAAW,CAAC,sBAAsB,GAAGC,IAAI,EAAEC,EAAE;AAC9D,CAAC;AACD,OAAO,MAAMC,sBAAyD,GACpEV,OAAO,CAAC,+CAA+C,CAAC,CAACF,OAAO;AAClE,OAAO,MAAMa,mBAAuD,GAClEjB,QAAQ,CAACkB,EAAE,KAAK,SAAS,IAAIlB,QAAQ,CAACmB,OAAO,IAAI,EAAE,GAC/Cb,OAAO,CAAC,4CAA4C,CAAC,CAACF,OAAO,GAC7DgB,IAAA;EAAA,IAAC;IAAEC;EAAmC,CAAC,GAAAD,IAAA;EAAA,OAAKC,QAAQ;AAAA"}
@@ -1,5 +1,5 @@
1
- import { useSharedValue } from 'react-native-reanimated';
2
- import { useKeyboardHandler } from '../../hooks';
1
+ import { useSharedValue } from "react-native-reanimated";
2
+ import { useKeyboardHandler } from "../../hooks";
3
3
  export const useKeyboardAnimation = () => {
4
4
  const heightWhenOpened = useSharedValue(0);
5
5
  const height = useSharedValue(0);
@@ -7,7 +7,7 @@ export const useKeyboardAnimation = () => {
7
7
  const isClosed = useSharedValue(true);
8
8
  useKeyboardHandler({
9
9
  onStart: e => {
10
- 'worklet';
10
+ "worklet";
11
11
 
12
12
  if (e.height > 0) {
13
13
  isClosed.value = false;
@@ -15,15 +15,17 @@ export const useKeyboardAnimation = () => {
15
15
  }
16
16
  },
17
17
  onMove: e => {
18
- 'worklet';
18
+ "worklet";
19
19
 
20
20
  progress.value = e.progress;
21
21
  height.value = e.height;
22
22
  },
23
23
  onEnd: e => {
24
- 'worklet';
24
+ "worklet";
25
25
 
26
26
  isClosed.value = e.height === 0;
27
+ progress.value = e.progress;
28
+ height.value = e.height;
27
29
  }
28
30
  }, []);
29
31
  return {
@@ -1 +1 @@
1
- {"version":3,"names":["useSharedValue","useKeyboardHandler","useKeyboardAnimation","heightWhenOpened","height","progress","isClosed","onStart","e","value","onMove","onEnd"],"sources":["hooks.ts"],"sourcesContent":["import { useSharedValue } from 'react-native-reanimated';\n\nimport { useKeyboardHandler } from '../../hooks';\n\nexport const useKeyboardAnimation = () => {\n const heightWhenOpened = useSharedValue(0);\n const height = useSharedValue(0);\n const progress = useSharedValue(0);\n const isClosed = useSharedValue(true);\n\n useKeyboardHandler(\n {\n onStart: (e) => {\n 'worklet';\n\n if (e.height > 0) {\n isClosed.value = false;\n heightWhenOpened.value = e.height;\n }\n },\n onMove: (e) => {\n 'worklet';\n\n progress.value = e.progress;\n height.value = e.height;\n },\n onEnd: (e) => {\n 'worklet';\n\n isClosed.value = e.height === 0;\n },\n },\n []\n );\n\n return { height, progress, heightWhenOpened, isClosed };\n};\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,yBAAyB;AAExD,SAASC,kBAAkB,QAAQ,aAAa;AAEhD,OAAO,MAAMC,oBAAoB,GAAG,MAAM;EACxC,MAAMC,gBAAgB,GAAGH,cAAc,CAAC,CAAC,CAAC;EAC1C,MAAMI,MAAM,GAAGJ,cAAc,CAAC,CAAC,CAAC;EAChC,MAAMK,QAAQ,GAAGL,cAAc,CAAC,CAAC,CAAC;EAClC,MAAMM,QAAQ,GAAGN,cAAc,CAAC,IAAI,CAAC;EAErCC,kBAAkB,CAChB;IACEM,OAAO,EAAGC,CAAC,IAAK;MACd,SAAS;;MAET,IAAIA,CAAC,CAACJ,MAAM,GAAG,CAAC,EAAE;QAChBE,QAAQ,CAACG,KAAK,GAAG,KAAK;QACtBN,gBAAgB,CAACM,KAAK,GAAGD,CAAC,CAACJ,MAAM;MACnC;IACF,CAAC;IACDM,MAAM,EAAGF,CAAC,IAAK;MACb,SAAS;;MAETH,QAAQ,CAACI,KAAK,GAAGD,CAAC,CAACH,QAAQ;MAC3BD,MAAM,CAACK,KAAK,GAAGD,CAAC,CAACJ,MAAM;IACzB,CAAC;IACDO,KAAK,EAAGH,CAAC,IAAK;MACZ,SAAS;;MAETF,QAAQ,CAACG,KAAK,GAAGD,CAAC,CAACJ,MAAM,KAAK,CAAC;IACjC;EACF,CAAC,EACD,EAAE,CACH;EAED,OAAO;IAAEA,MAAM;IAAEC,QAAQ;IAAEF,gBAAgB;IAAEG;EAAS,CAAC;AACzD,CAAC"}
1
+ {"version":3,"names":["useSharedValue","useKeyboardHandler","useKeyboardAnimation","heightWhenOpened","height","progress","isClosed","onStart","e","value","onMove","onEnd"],"sources":["hooks.ts"],"sourcesContent":["import { useSharedValue } from \"react-native-reanimated\";\n\nimport { useKeyboardHandler } from \"../../hooks\";\n\nexport const useKeyboardAnimation = () => {\n const heightWhenOpened = useSharedValue(0);\n const height = useSharedValue(0);\n const progress = useSharedValue(0);\n const isClosed = useSharedValue(true);\n\n useKeyboardHandler(\n {\n onStart: (e) => {\n \"worklet\";\n\n if (e.height > 0) {\n isClosed.value = false;\n heightWhenOpened.value = e.height;\n }\n },\n onMove: (e) => {\n \"worklet\";\n\n progress.value = e.progress;\n height.value = e.height;\n },\n onEnd: (e) => {\n \"worklet\";\n\n isClosed.value = e.height === 0;\n\n progress.value = e.progress;\n height.value = e.height;\n },\n },\n [],\n );\n\n return { height, progress, heightWhenOpened, isClosed };\n};\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,yBAAyB;AAExD,SAASC,kBAAkB,QAAQ,aAAa;AAEhD,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACxC,MAAMC,gBAAgB,GAAGH,cAAc,CAAC,CAAC,CAAC;EAC1C,MAAMI,MAAM,GAAGJ,cAAc,CAAC,CAAC,CAAC;EAChC,MAAMK,QAAQ,GAAGL,cAAc,CAAC,CAAC,CAAC;EAClC,MAAMM,QAAQ,GAAGN,cAAc,CAAC,IAAI,CAAC;EAErCC,kBAAkB,CAChB;IACEM,OAAO,EAAGC,CAAC,IAAK;MACd,SAAS;;MAET,IAAIA,CAAC,CAACJ,MAAM,GAAG,CAAC,EAAE;QAChBE,QAAQ,CAACG,KAAK,GAAG,KAAK;QACtBN,gBAAgB,CAACM,KAAK,GAAGD,CAAC,CAACJ,MAAM;MACnC;IACF,CAAC;IACDM,MAAM,EAAGF,CAAC,IAAK;MACb,SAAS;;MAETH,QAAQ,CAACI,KAAK,GAAGD,CAAC,CAACH,QAAQ;MAC3BD,MAAM,CAACK,KAAK,GAAGD,CAAC,CAACJ,MAAM;IACzB,CAAC;IACDO,KAAK,EAAGH,CAAC,IAAK;MACZ,SAAS;;MAETF,QAAQ,CAACG,KAAK,GAAGD,CAAC,CAACJ,MAAM,KAAK,CAAC;MAE/BC,QAAQ,CAACI,KAAK,GAAGD,CAAC,CAACH,QAAQ;MAC3BD,MAAM,CAACK,KAAK,GAAGD,CAAC,CAACJ,MAAM;IACzB;EACF,CAAC,EACD,EACF,CAAC;EAED,OAAO;IAAEA,MAAM;IAAEC,QAAQ;IAAEF,gBAAgB;IAAEG;EAAS,CAAC;AACzD,CAAC"}
@@ -1,8 +1,9 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React, { forwardRef, useCallback, useMemo } from 'react';
3
- import { View, useWindowDimensions } from 'react-native';
4
- import Reanimated, { interpolate, runOnUI, useAnimatedStyle, useDerivedValue, useSharedValue, useWorkletCallback } from 'react-native-reanimated';
5
- import { useKeyboardAnimation } from './hooks';
2
+ import React, { forwardRef, useCallback, useMemo } from "react";
3
+ import { View, useWindowDimensions } from "react-native";
4
+ import Reanimated, { runOnUI, useAnimatedStyle, useDerivedValue, useSharedValue } from "react-native-reanimated";
5
+ import useKeyboardInterpolation from "../hooks/useKeyboardInterpolation";
6
+ import { useKeyboardAnimation } from "./hooks";
6
7
  const defaultLayout = {
7
8
  x: 0,
8
9
  y: 0,
@@ -31,24 +32,31 @@ const KeyboardAvoidingView = /*#__PURE__*/forwardRef((_ref, ref) => {
31
32
  const {
32
33
  height: screenHeight
33
34
  } = useWindowDimensions();
34
- const relativeKeyboardHeight = useWorkletCallback(() => {
35
+ const relativeKeyboardHeight = useCallback(() => {
36
+ "worklet";
37
+
35
38
  const keyboardY = screenHeight - keyboard.heightWhenOpened.value - keyboardVerticalOffset;
36
39
  return Math.max(frame.value.y + frame.value.height - keyboardY, 0);
37
40
  }, [screenHeight, keyboardVerticalOffset]);
38
- const onLayoutWorklet = useWorkletCallback(layout => {
41
+ const {
42
+ interpolate
43
+ } = useKeyboardInterpolation();
44
+ const onLayoutWorklet = useCallback(layout => {
45
+ "worklet";
46
+
39
47
  if (keyboard.isClosed.value) {
40
48
  initialFrame.value = layout;
41
49
  }
42
- });
50
+ }, []);
43
51
  const onLayout = useCallback(e => {
44
52
  runOnUI(onLayoutWorklet)(e.nativeEvent.layout);
45
53
  onLayoutProps === null || onLayoutProps === void 0 ? void 0 : onLayoutProps(e);
46
54
  }, [onLayoutProps]);
47
55
  const animatedStyle = useAnimatedStyle(() => {
48
- const bottom = interpolate(keyboard.progress.value, [0, 1], [0, relativeKeyboardHeight()]);
56
+ const bottom = interpolate(keyboard.height.value, [0, relativeKeyboardHeight()]);
49
57
  const bottomHeight = enabled ? bottom : 0;
50
58
  switch (behavior) {
51
- case 'height':
59
+ case "height":
52
60
  if (!keyboard.isClosed.value) {
53
61
  return {
54
62
  height: frame.value.height - bottomHeight,
@@ -56,11 +64,11 @@ const KeyboardAvoidingView = /*#__PURE__*/forwardRef((_ref, ref) => {
56
64
  };
57
65
  }
58
66
  return {};
59
- case 'position':
67
+ case "position":
60
68
  return {
61
69
  bottom: bottomHeight
62
70
  };
63
- case 'padding':
71
+ case "padding":
64
72
  return {
65
73
  paddingBottom: bottomHeight
66
74
  };
@@ -68,7 +76,7 @@ const KeyboardAvoidingView = /*#__PURE__*/forwardRef((_ref, ref) => {
68
76
  return {};
69
77
  }
70
78
  }, [behavior, enabled, relativeKeyboardHeight]);
71
- const isPositionBehavior = behavior === 'position';
79
+ const isPositionBehavior = behavior === "position";
72
80
  const containerStyle = isPositionBehavior ? contentContainerStyle : style;
73
81
  const combinedStyles = useMemo(() => [containerStyle, animatedStyle], [containerStyle, animatedStyle]);
74
82
  if (isPositionBehavior) {
@@ -81,7 +89,6 @@ const KeyboardAvoidingView = /*#__PURE__*/forwardRef((_ref, ref) => {
81
89
  }, children));
82
90
  }
83
91
  return /*#__PURE__*/React.createElement(Reanimated.View, _extends({
84
- // @ts-expect-error because `ref` from reanimated is not compatible with react-native
85
92
  ref: ref,
86
93
  onLayout: onLayout,
87
94
  style: combinedStyles
@@ -1 +1 @@
1
- {"version":3,"names":["React","forwardRef","useCallback","useMemo","View","useWindowDimensions","Reanimated","interpolate","runOnUI","useAnimatedStyle","useDerivedValue","useSharedValue","useWorkletCallback","useKeyboardAnimation","defaultLayout","x","y","width","height","KeyboardAvoidingView","ref","behavior","children","contentContainerStyle","enabled","keyboardVerticalOffset","style","onLayout","onLayoutProps","props","initialFrame","frame","value","keyboard","screenHeight","relativeKeyboardHeight","keyboardY","heightWhenOpened","Math","max","onLayoutWorklet","layout","isClosed","e","nativeEvent","animatedStyle","bottom","progress","bottomHeight","flex","paddingBottom","isPositionBehavior","containerStyle","combinedStyles"],"sources":["index.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo } from 'react';\nimport { View, useWindowDimensions } from 'react-native';\nimport Reanimated, {\n interpolate,\n runOnUI,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n useWorkletCallback,\n} from 'react-native-reanimated';\n\nimport { useKeyboardAnimation } from './hooks';\n\nimport type { LayoutRectangle, ViewProps } from 'react-native';\n\ntype Props = {\n /**\n * Specify how to react to the presence of the keyboard.\n */\n behavior?: 'height' | 'position' | 'padding';\n\n /**\n * Style of the content container when `behavior` is 'position'.\n */\n contentContainerStyle?: ViewProps['style'];\n\n /**\n * Controls whether this `KeyboardAvoidingView` instance should take effect.\n * This is useful when more than one is on the screen. Defaults to true.\n */\n enabled?: boolean;\n\n /**\n * Distance between the top of the user screen and the React Native view. This\n * may be non-zero in some cases. Defaults to 0.\n */\n keyboardVerticalOffset?: number;\n} & ViewProps;\n\nconst defaultLayout: LayoutRectangle = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n\n/**\n * View that moves out of the way when the keyboard appears by automatically\n * adjusting its height, position, or bottom padding.\n */\nconst KeyboardAvoidingView = forwardRef<View, React.PropsWithChildren<Props>>(\n (\n {\n behavior,\n children,\n contentContainerStyle,\n enabled = true,\n keyboardVerticalOffset = 0,\n style,\n onLayout: onLayoutProps,\n ...props\n },\n ref\n ) => {\n const initialFrame = useSharedValue<LayoutRectangle | null>(null);\n const frame = useDerivedValue(() => initialFrame.value || defaultLayout);\n\n const keyboard = useKeyboardAnimation();\n const { height: screenHeight } = useWindowDimensions();\n\n const relativeKeyboardHeight = useWorkletCallback(() => {\n const keyboardY =\n screenHeight - keyboard.heightWhenOpened.value - keyboardVerticalOffset;\n\n return Math.max(frame.value.y + frame.value.height - keyboardY, 0);\n }, [screenHeight, keyboardVerticalOffset]);\n\n const onLayoutWorklet = useWorkletCallback((layout: LayoutRectangle) => {\n if (keyboard.isClosed.value) {\n initialFrame.value = layout;\n }\n });\n const onLayout = useCallback<NonNullable<ViewProps['onLayout']>>(\n (e) => {\n runOnUI(onLayoutWorklet)(e.nativeEvent.layout);\n onLayoutProps?.(e);\n },\n [onLayoutProps]\n );\n\n const animatedStyle = useAnimatedStyle(() => {\n const bottom = interpolate(\n keyboard.progress.value,\n [0, 1],\n [0, relativeKeyboardHeight()]\n );\n const bottomHeight = enabled ? bottom : 0;\n\n switch (behavior) {\n case 'height':\n if (!keyboard.isClosed.value) {\n return {\n height: frame.value.height - bottomHeight,\n flex: 0,\n };\n }\n\n return {};\n\n case 'position':\n return { bottom: bottomHeight };\n\n case 'padding':\n return { paddingBottom: bottomHeight };\n\n default:\n return {};\n }\n }, [behavior, enabled, relativeKeyboardHeight]);\n const isPositionBehavior = behavior === 'position';\n const containerStyle = isPositionBehavior ? contentContainerStyle : style;\n const combinedStyles = useMemo(\n () => [containerStyle, animatedStyle],\n [containerStyle, animatedStyle]\n );\n\n if (isPositionBehavior) {\n return (\n <View ref={ref} style={style} onLayout={onLayout} {...props}>\n <Reanimated.View style={combinedStyles}>{children}</Reanimated.View>\n </View>\n );\n }\n\n return (\n <Reanimated.View\n // @ts-expect-error because `ref` from reanimated is not compatible with react-native\n ref={ref}\n onLayout={onLayout}\n style={combinedStyles}\n {...props}\n >\n {children}\n </Reanimated.View>\n );\n }\n);\n\nexport default Keyboard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MAAM+B,cAAc,GAAGD,kBAAkB,GAAG5B,qBAAqB,GAAGG,KAAK;EACzE,MAAM2B,cAAc,GAAGlD,OAAO,CAC5B,MAAM,CAACiD,cAAc,EAAEP,aAAa,CAAC,EACrC,CAACO,cAAc,EAAEP,aAAa,CAAC,CAChC;EAED,IAAIM,kBAAkB,EAAE;IACtB,oBACE,oBAAC,IAAI;MAAC,GAAG,EAAE/B,GAAI;MAAC,KAAK,EAAEM,KAAM;MAAC,QAAQ,EAAEC;IAAS,GAAKE,KAAK,gBACzD,oBAAC,UAAU,CAAC,IAAI;MAAC,KAAK,EAAEwB;IAAe,GAAE/B,QAAQ,CAAmB,CAC/D;EAEX;EAEA,oBACE,oBAAC,UAAU,CAAC,IAAI;IACd;IACA,GAAG,EAAEF,GAAI;IACT,QAAQ,EAAEO,QAAS;IACnB,KAAK,EAAE0B;EAAe,GAClBxB,KAAK,GAERP,QAAQ,CACO;AAEtB,CAAC,CACF;AAED,eAAeH,oBAAoB"}
1
+ {"version":3,"names":["React","forwardRef","useCallback","useMemo","View","useWindowDimensions","Reanimated","runOnUI","useAnimatedStyle","useDerivedValue","useSharedValue","useKeyboardInterpolation","useKeyboardAnimation","defaultLayout","x","y","width","height","KeyboardAvoidingView","_ref","ref","behavior","children","contentContainerStyle","enabled","keyboardVerticalOffset","style","onLayout","onLayoutProps","props","initialFrame","frame","value","keyboard","screenHeight","relativeKeyboardHeight","keyboardY","heightWhenOpened","Math","max","interpolate","onLayoutWorklet","layout","isClosed","e","nativeEvent","animatedStyle","bottom","bottomHeight","flex","paddingBottom","isPositionBehavior","containerStyle","combinedStyles","createElement","_extends"],"sources":["index.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo } from \"react\";\nimport { View, useWindowDimensions } from \"react-native\";\nimport Reanimated, {\n runOnUI,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n} from \"react-native-reanimated\";\n\nimport useKeyboardInterpolation from \"../hooks/useKeyboardInterpolation\";\n\nimport { useKeyboardAnimation } from \"./hooks\";\n\nimport type { LayoutRectangle, ViewProps } from \"react-native\";\n\ntype Props = {\n /**\n * Specify how to react to the presence of the keyboard.\n */\n behavior?: \"height\" | \"position\" | \"padding\";\n\n /**\n * Style of the content container when `behavior` is 'position'.\n */\n contentContainerStyle?: ViewProps[\"style\"];\n\n /**\n * Controls whether this `KeyboardAvoidingView` instance should take effect.\n * This is useful when more than one is on the screen. Defaults to true.\n */\n enabled?: boolean;\n\n /**\n * Distance between the top of the user screen and the React Native view. This\n * may be non-zero in some cases. Defaults to 0.\n */\n keyboardVerticalOffset?: number;\n} & ViewProps;\n\nconst defaultLayout: LayoutRectangle = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n\n/**\n * View that moves out of the way when the keyboard appears by automatically\n * adjusting its height, position, or bottom padding.\n */\nconst KeyboardAvoidingView = forwardRef<View, React.PropsWithChildren<Props>>(\n (\n {\n behavior,\n children,\n contentContainerStyle,\n enabled = true,\n keyboardVerticalOffset = 0,\n style,\n onLayout: onLayoutProps,\n ...props\n },\n ref,\n ) => {\n const initialFrame = useSharedValue<LayoutRectangle | null>(null);\n const frame = useDerivedValue(() => initialFrame.value || defaultLayout);\n\n const keyboard = useKeyboardAnimation();\n const { height: screenHeight } = useWindowDimensions();\n\n const relativeKeyboardHeight = useCallback(() => {\n \"worklet\";\n\n const keyboardY =\n screenHeight - keyboard.heightWhenOpened.value - keyboardVerticalOffset;\n\n return Math.max(frame.value.y + frame.value.height - keyboardY, 0);\n }, [screenHeight, keyboardVerticalOffset]);\n const { interpolate } = useKeyboardInterpolation();\n\n const onLayoutWorklet = useCallback((layout: LayoutRectangle) => {\n \"worklet\";\n\n if (keyboard.isClosed.value) {\n initialFrame.value = layout;\n }\n }, []);\n const onLayout = useCallback<NonNullable<ViewProps[\"onLayout\"]>>(\n (e) => {\n runOnUI(onLayoutWorklet)(e.nativeEvent.layout);\n onLayoutProps?.(e);\n },\n [onLayoutProps],\n );\n\n const animatedStyle = useAnimatedStyle(() => {\n const bottom = interpolate(keyboard.height.value, [\n 0,\n relativeKeyboardHeight(),\n ]);\n const bottomHeight = enabled ? bottom : 0;\n\n switch (behavior) {\n case \"height\":\n if (!keyboard.isClosed.value) {\n return {\n height: frame.value.height - bottomHeight,\n flex: 0,\n };\n }\n\n return {};\n\n case \"position\":\n return { bottom: bottomHeight };\n\n case \"padding\":\n return { paddingBottom: bottomHeight };\n\n default:\n return {};\n }\n }, [behavior, enabled, relativeKeyboardHeight]);\n const isPositionBehavior = behavior === \"position\";\n const containerStyle = isPositionBehavior ? contentContainerStyle : style;\n const combinedStyles = useMemo(\n () => [containerStyle, animatedStyle],\n [containerStyle, animatedStyle],\n );\n\n if (isPositionBehavior) {\n return (\n <View ref={ref} style={style} onLayout={onLayout} {...props}>\n <Reanimated.View style={combinedStyles}>{children}</Reanimated.View>\n </View>\n );\n }\n\n return (\n <Reanimated.View\n ref={ref}\n onLayout={onLayout}\n style={combinedStyles}\n {...props}\n >\n {children}\n </Reanimated.View>\n );\n },\n);\n\nexport default KeyboardAvoidingView;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC/D,SAASC,IAAI,EAAEC,mBAAmB,QAAQ,cAAc;AACxD,OAAOC,UAAU,IACfC,OAAO,EACPC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,QACT,yBAAyB;AAEhC,OAAOC,wBAAwB,MAAM,mCAAmC;AAExE,SAASC,oBAAoB,QAAQ,SAAS;AA4B9C,MAAMC,aAA8B,GAAG;EACrCC,CAAC,EAAE,CAAC;EACJC,CAAC,EAAE,CAAC;EACJC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE;AACV,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,gBAAGjB,UAAU,CACrC,CAAAkB,IAAA,EAWEC,GAAG,KACA;EAAA,IAXH;IACEC,QAAQ;IACRC,QAAQ;IACRC,qBAAqB;IACrBC,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