react-native-keyboard-controller 1.19.6 → 1.20.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/.settings/org.eclipse.buildship.core.prefs +2 -0
- package/ios/KeyboardController.xcodeproj/xcuserdata/kirylziusko.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/ios/Tests/Tests.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Tests/Tests.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/Tests/Tests.xcodeproj/project.xcworkspace/xcuserdata/kirylziusko.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Tests/Tests.xcodeproj/xcuserdata/kirylziusko.xcuserdatad/xcschemes/xcschememanagement.plist +32 -0
- package/lib/commonjs/animated.js +2 -3
- package/lib/commonjs/animated.js.map +1 -1
- package/lib/commonjs/context.js.map +1 -1
- package/lib/commonjs/hooks/index.js +41 -2
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/internal.js +16 -16
- package/lib/commonjs/internal.js.map +1 -1
- package/lib/module/animated.js +2 -3
- package/lib/module/animated.js.map +1 -1
- package/lib/module/context.js.map +1 -1
- package/lib/module/hooks/index.js +41 -2
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/internal.js +16 -16
- package/lib/module/internal.js.map +1 -1
- package/lib/typescript/context.d.ts +4 -4
- package/lib/typescript/hooks/index.d.ts +3 -4
- package/lib/typescript/internal.d.ts +2 -3
- package/package.json +1 -1
- package/src/animated.tsx +2 -11
- package/src/context.ts +11 -8
- package/src/hooks/index.ts +64 -10
- package/src/internal.ts +33 -30
- package/lib/commonjs/event-handler.d.js +0 -6
- package/lib/commonjs/event-handler.d.js.map +0 -1
- package/lib/commonjs/event-handler.js +0 -19
- package/lib/commonjs/event-handler.js.map +0 -1
- package/lib/commonjs/event-handler.web.js +0 -10
- package/lib/commonjs/event-handler.web.js.map +0 -1
- package/lib/commonjs/event-mappings.js +0 -9
- package/lib/commonjs/event-mappings.js.map +0 -1
- package/lib/module/event-handler.d.js +0 -2
- package/lib/module/event-handler.d.js.map +0 -1
- package/lib/module/event-handler.js +0 -14
- package/lib/module/event-handler.js.map +0 -1
- package/lib/module/event-handler.web.js +0 -5
- package/lib/module/event-handler.web.js.map +0 -1
- package/lib/module/event-mappings.js +0 -3
- package/lib/module/event-mappings.js.map +0 -1
- package/lib/typescript/event-mappings.d.ts +0 -2
- package/src/event-handler.d.ts +0 -8
- package/src/event-handler.js +0 -15
- package/src/event-handler.web.js +0 -5
- package/src/event-mappings.ts +0 -14
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useEffect, useLayoutEffect } from "react";
|
|
2
|
+
import { useEvent, useHandler } from "react-native-reanimated";
|
|
2
3
|
import { AndroidSoftInputModes } from "../constants";
|
|
3
4
|
import { useKeyboardContext } from "../context";
|
|
4
5
|
import { KeyboardController } from "../module";
|
|
@@ -96,8 +97,31 @@ export const useReanimatedKeyboardAnimation = () => {
|
|
|
96
97
|
*/
|
|
97
98
|
export function useGenericKeyboardHandler(handler, deps) {
|
|
98
99
|
const context = useKeyboardContext();
|
|
100
|
+
const {
|
|
101
|
+
doDependenciesDiffer
|
|
102
|
+
} = useHandler(handler, deps);
|
|
103
|
+
const eventHandler = useEvent(event => {
|
|
104
|
+
"worklet";
|
|
105
|
+
|
|
106
|
+
if (event.eventName.endsWith("onKeyboardMoveStart")) {
|
|
107
|
+
var _handler$onStart;
|
|
108
|
+
(_handler$onStart = handler.onStart) === null || _handler$onStart === void 0 || _handler$onStart.call(handler, event);
|
|
109
|
+
}
|
|
110
|
+
if (event.eventName.endsWith("onKeyboardMove")) {
|
|
111
|
+
var _handler$onMove;
|
|
112
|
+
(_handler$onMove = handler.onMove) === null || _handler$onMove === void 0 || _handler$onMove.call(handler, event);
|
|
113
|
+
}
|
|
114
|
+
if (event.eventName.endsWith("onKeyboardMoveEnd")) {
|
|
115
|
+
var _handler$onEnd;
|
|
116
|
+
(_handler$onEnd = handler.onEnd) === null || _handler$onEnd === void 0 || _handler$onEnd.call(handler, event);
|
|
117
|
+
}
|
|
118
|
+
if (event.eventName.endsWith("onKeyboardMoveInteractive")) {
|
|
119
|
+
var _handler$onInteractiv;
|
|
120
|
+
(_handler$onInteractiv = handler.onInteractive) === null || _handler$onInteractiv === void 0 || _handler$onInteractiv.call(handler, event);
|
|
121
|
+
}
|
|
122
|
+
}, ["onKeyboardMoveStart", "onKeyboardMove", "onKeyboardMoveEnd", "onKeyboardMoveInteractive"], doDependenciesDiffer);
|
|
99
123
|
useLayoutEffect(() => {
|
|
100
|
-
const cleanup = context.setKeyboardHandlers(
|
|
124
|
+
const cleanup = context.setKeyboardHandlers(eventHandler);
|
|
101
125
|
return () => cleanup();
|
|
102
126
|
}, deps);
|
|
103
127
|
}
|
|
@@ -208,8 +232,23 @@ export function useReanimatedFocusedInput() {
|
|
|
208
232
|
*/
|
|
209
233
|
export function useFocusedInputHandler(handler, deps) {
|
|
210
234
|
const context = useKeyboardContext();
|
|
235
|
+
const {
|
|
236
|
+
doDependenciesDiffer
|
|
237
|
+
} = useHandler(handler, deps);
|
|
238
|
+
const eventHandler = useEvent(event => {
|
|
239
|
+
"worklet";
|
|
240
|
+
|
|
241
|
+
if (event.eventName.endsWith("onFocusedInputTextChanged")) {
|
|
242
|
+
var _handler$onChangeText;
|
|
243
|
+
(_handler$onChangeText = handler.onChangeText) === null || _handler$onChangeText === void 0 || _handler$onChangeText.call(handler, event);
|
|
244
|
+
}
|
|
245
|
+
if (event.eventName.endsWith("onFocusedInputSelectionChanged")) {
|
|
246
|
+
var _handler$onSelectionC;
|
|
247
|
+
(_handler$onSelectionC = handler.onSelectionChange) === null || _handler$onSelectionC === void 0 || _handler$onSelectionC.call(handler, event);
|
|
248
|
+
}
|
|
249
|
+
}, ["onFocusedInputTextChanged", "onFocusedInputSelectionChanged"], doDependenciesDiffer);
|
|
211
250
|
useLayoutEffect(() => {
|
|
212
|
-
const cleanup = context.setInputHandlers(
|
|
251
|
+
const cleanup = context.setInputHandlers(eventHandler);
|
|
213
252
|
return () => cleanup();
|
|
214
253
|
}, deps);
|
|
215
254
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useLayoutEffect","AndroidSoftInputModes","useKeyboardContext","KeyboardController","useResizeMode","setInputMode","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode","useKeyboardAnimation","context","animated","useReanimatedKeyboardAnimation","reanimated","useGenericKeyboardHandler","handler","deps","cleanup","setKeyboardHandlers","useKeyboardHandler","useKeyboardController","setEnabled","enabled","useReanimatedFocusedInput","input","layout","useFocusedInputHandler","setInputHandlers"],"sources":["index.ts"],"sourcesContent":["import { useEffect, useLayoutEffect } from \"react\";\n\nimport { AndroidSoftInputModes } from \"../constants\";\nimport { useKeyboardContext } from \"../context\";\nimport { KeyboardController } from \"../module\";\n\nimport type { AnimatedContext, ReanimatedContext } from \"../context\";\nimport type { FocusedInputHandler, KeyboardHandler } from \"../types\";\nimport type { DependencyList } from \"react\";\n\n/**\n * Hook that sets the Android soft input mode to adjust resize on mount and\n * restores default mode on unmount. This ensures the keyboard behavior is consistent\n * on all Android versions.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setinputmode-|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * useResizeMode();\n * return <View />;\n * }\n * ```\n */\nexport const useResizeMode = () => {\n useEffect(() => {\n KeyboardController.setInputMode(\n AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,\n );\n\n return () => KeyboardController.setDefaultMode();\n }, []);\n};\n\n/**\n * Hook that provides animated (`height`/`progress`) values for tracking keyboard movement.\n * Automatically sets the resize mode for Android.\n *\n * @returns Object {@link AnimatedContext|containing} animated values for keyboard movement.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/hooks/keyboard/use-keyboard-animation|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * const { height, progress } = useKeyboardAnimation();\n * return <Animated.View style={{ transform: [{ translateY: height }] }} />;\n * }\n * ```\n */\nexport const useKeyboardAnimation = (): AnimatedContext => {\n useResizeMode();\n const context = useKeyboardContext();\n\n return context.animated;\n};\n\n/**\n * Hook that provides reanimated (`height`/`progress`) values for tracking keyboard movement.\n * Automatically sets the resize mode for Android.\n *\n * @returns Object {@link ReanimatedContext|containing} reanimated values for keyboard movement.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/hooks/keyboard/use-reanimated-keyboard-animation|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * const { height, progress } = useReanimatedKeyboardAnimation();\n * return <Reanimated.View style={{ transform: [{ translateY: height }] }} />;\n * }\n * ```\n */\nexport const useReanimatedKeyboardAnimation = (): ReanimatedContext => {\n useResizeMode();\n const context = useKeyboardContext();\n\n return context.reanimated;\n};\n\n/**\n * An alternative to {@link useKeyboardHandler} that doesn't set resize mode on mount. If your\n * app already uses `adjustResize`, then you can use this hook instead of `useKeyboardHandler`.\n *\n * @param handler - Object containing keyboard event handlers.\n * @param [deps] - Dependencies array for the effect.\n * @example\n * ```tsx\n * function MyComponent() {\n * const height = useSharedValue(0);\n * const progress = useSharedValue(0);\n *\n * useGenericKeyboardHandler({\n * onMove: (e) => {\n * \"worklet\";\n *\n * height.value = e.height;\n * progress.value = e.progress;\n * },\n * onEnd: (e) => {\n * \"worklet\";\n *\n * height.value = e.height;\n * progress.value = e.progress;\n * },\n * }, []);\n *\n * return <Reanimated.View style={{ height: height }] }} />;\n * }\n * ```\n */\nexport function useGenericKeyboardHandler(\n handler: KeyboardHandler,\n deps?: DependencyList,\n) {\n const context = useKeyboardContext();\n\n useLayoutEffect(() => {\n const cleanup = context.setKeyboardHandlers(handler);\n\n return () => cleanup();\n }, deps);\n}\n\n/**\n * Hook that gives an access to each aspect of keyboard movement with workletized `onStart`/`onMove`/`onInteractive`/`onEnd` handlers.\n *\n * @param handler - Object containing keyboard event handlers.\n * @param [deps] - Dependencies array for the effect.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/hooks/keyboard/use-keyboard-handler|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * const height = useSharedValue(0);\n * const progress = useSharedValue(0);\n *\n * useKeyboardHandler({\n * onMove: (e) => {\n * \"worklet\";\n *\n * height.value = e.height;\n * progress.value = e.progress;\n * },\n * onEnd: (e) => {\n * \"worklet\";\n *\n * height.value = e.height;\n * progress.value = e.progress;\n * },\n * }, []);\n *\n * return <Reanimated.View style={{ height: height }] }} />;\n * }\n * ```\n */\nexport function useKeyboardHandler(\n handler: KeyboardHandler,\n deps?: DependencyList,\n) {\n useResizeMode();\n useGenericKeyboardHandler(handler, deps);\n}\n\n/**\n * Hook for controlling keyboard controller module.\n * Allows to disable/enable it and check the actual state (whether it's enabled or not).\n * When disabled it fallbacks to default android keyboard handling and stops tracking all\n * the events that are exposed from this library.\n *\n * @property {Function} setEnabled - Function to enable/disable keyboard handling.\n * @property {boolean} enabled - Current enabled state.\n * @returns Object containing keyboard control functions and state.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/hooks/module/use-keyboard-controller|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * const { setEnabled, enabled } = useKeyboardController();\n * return (\n * <Button\n * title={enabled ? 'Disable' : 'Enable'}\n * onPress={() => setEnabled(!enabled)}\n * />\n * );\n * }\n * ```\n */\nexport function useKeyboardController() {\n const context = useKeyboardContext();\n\n return { setEnabled: context.setEnabled, enabled: context.enabled };\n}\n\n/**\n * Hook that provides access to the layout of the currently focused input.\n *\n * @returns Object containing reanimated values for focused input.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/hooks/input/use-reanimated-focused-input|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * const { input } = useReanimatedFocusedInput();\n * return <Reanimated.View style={{ height: input.value?.layout.height }} />;\n * }\n * ```\n */\nexport function useReanimatedFocusedInput() {\n const context = useKeyboardContext();\n\n return { input: context.layout };\n}\n\n/**\n * Hook for handling focused input events, such as changes of selection, text etc.\n *\n * @param handler - Object containing focused input event handlers.\n * @param [deps] - Dependencies array for the effect.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/hooks/input/use-focused-input-handler|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * useFocusedInputHandler({\n * onChangeText: (e) => console.log('Text changed:', e.text),\n * onSelectionChange: (e) => console.log('Selection changed:', e.selection)\n * });\n * return <View />;\n * }\n * ```\n */\nexport function useFocusedInputHandler(\n handler: FocusedInputHandler,\n deps?: DependencyList,\n) {\n const context = useKeyboardContext();\n\n useLayoutEffect(() => {\n const cleanup = context.setInputHandlers(handler);\n\n return () => cleanup();\n }, deps);\n}\n\nexport * from \"./useWindowDimensions\";\nexport * from \"./useKeyboardState\";\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,eAAe,QAAQ,OAAO;AAElD,SAASC,qBAAqB,QAAQ,cAAc;AACpD,SAASC,kBAAkB,QAAQ,YAAY;AAC/C,SAASC,kBAAkB,QAAQ,WAAW;AAM9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjCL,SAAS,CAAC,MAAM;IACdI,kBAAkB,CAACE,YAAY,CAC7BJ,qBAAqB,CAACK,wBACxB,CAAC;IAED,OAAO,MAAMH,kBAAkB,CAACI,cAAc,CAAC,CAAC;EAClD,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAAuB;EACzDJ,aAAa,CAAC,CAAC;EACf,MAAMK,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpC,OAAOO,OAAO,CAACC,QAAQ;AACzB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,8BAA8B,GAAGA,CAAA,KAAyB;EACrEP,aAAa,CAAC,CAAC;EACf,MAAMK,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpC,OAAOO,OAAO,CAACG,UAAU;AAC3B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CACvCC,OAAwB,EACxBC,IAAqB,EACrB;EACA,MAAMN,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpCF,eAAe,CAAC,MAAM;IACpB,MAAMgB,OAAO,GAAGP,OAAO,CAACQ,mBAAmB,CAACH,OAAO,CAAC;IAEpD,OAAO,MAAME,OAAO,CAAC,CAAC;EACxB,CAAC,EAAED,IAAI,CAAC;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,kBAAkBA,CAChCJ,OAAwB,EACxBC,IAAqB,EACrB;EACAX,aAAa,CAAC,CAAC;EACfS,yBAAyB,CAACC,OAAO,EAAEC,IAAI,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,qBAAqBA,CAAA,EAAG;EACtC,MAAMV,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpC,OAAO;IAAEkB,UAAU,EAAEX,OAAO,CAACW,UAAU;IAAEC,OAAO,EAAEZ,OAAO,CAACY;EAAQ,CAAC;AACrE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CAAA,EAAG;EAC1C,MAAMb,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpC,OAAO;IAAEqB,KAAK,EAAEd,OAAO,CAACe;EAAO,CAAC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CACpCX,OAA4B,EAC5BC,IAAqB,EACrB;EACA,MAAMN,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpCF,eAAe,CAAC,MAAM;IACpB,MAAMgB,OAAO,GAAGP,OAAO,CAACiB,gBAAgB,CAACZ,OAAO,CAAC;IAEjD,OAAO,MAAME,OAAO,CAAC,CAAC;EACxB,CAAC,EAAED,IAAI,CAAC;AACV;AAEA,cAAc,uBAAuB;AACrC,cAAc,oBAAoB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useEffect","useLayoutEffect","useEvent","useHandler","AndroidSoftInputModes","useKeyboardContext","KeyboardController","useResizeMode","setInputMode","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode","useKeyboardAnimation","context","animated","useReanimatedKeyboardAnimation","reanimated","useGenericKeyboardHandler","handler","deps","doDependenciesDiffer","eventHandler","event","eventName","endsWith","_handler$onStart","onStart","call","_handler$onMove","onMove","_handler$onEnd","onEnd","_handler$onInteractiv","onInteractive","cleanup","setKeyboardHandlers","useKeyboardHandler","useKeyboardController","setEnabled","enabled","useReanimatedFocusedInput","input","layout","useFocusedInputHandler","_handler$onChangeText","onChangeText","_handler$onSelectionC","onSelectionChange","setInputHandlers"],"sources":["index.ts"],"sourcesContent":["import { useEffect, useLayoutEffect } from \"react\";\nimport { useEvent, useHandler } from \"react-native-reanimated\";\n\nimport { AndroidSoftInputModes } from \"../constants\";\nimport { useKeyboardContext } from \"../context\";\nimport { KeyboardController } from \"../module\";\n\nimport type { AnimatedContext, ReanimatedContext } from \"../context\";\nimport type {\n FocusedInputHandler,\n FocusedInputSelectionChangedEvent,\n FocusedInputTextChangedEvent,\n KeyboardHandler,\n NativeEvent,\n} from \"../types\";\n\n/**\n * Hook that sets the Android soft input mode to adjust resize on mount and\n * restores default mode on unmount. This ensures the keyboard behavior is consistent\n * on all Android versions.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setinputmode-|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * useResizeMode();\n * return <View />;\n * }\n * ```\n */\nexport const useResizeMode = () => {\n useEffect(() => {\n KeyboardController.setInputMode(\n AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,\n );\n\n return () => KeyboardController.setDefaultMode();\n }, []);\n};\n\n/**\n * Hook that provides animated (`height`/`progress`) values for tracking keyboard movement.\n * Automatically sets the resize mode for Android.\n *\n * @returns Object {@link AnimatedContext|containing} animated values for keyboard movement.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/hooks/keyboard/use-keyboard-animation|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * const { height, progress } = useKeyboardAnimation();\n * return <Animated.View style={{ transform: [{ translateY: height }] }} />;\n * }\n * ```\n */\nexport const useKeyboardAnimation = (): AnimatedContext => {\n useResizeMode();\n const context = useKeyboardContext();\n\n return context.animated;\n};\n\n/**\n * Hook that provides reanimated (`height`/`progress`) values for tracking keyboard movement.\n * Automatically sets the resize mode for Android.\n *\n * @returns Object {@link ReanimatedContext|containing} reanimated values for keyboard movement.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/hooks/keyboard/use-reanimated-keyboard-animation|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * const { height, progress } = useReanimatedKeyboardAnimation();\n * return <Reanimated.View style={{ transform: [{ translateY: height }] }} />;\n * }\n * ```\n */\nexport const useReanimatedKeyboardAnimation = (): ReanimatedContext => {\n useResizeMode();\n const context = useKeyboardContext();\n\n return context.reanimated;\n};\n\n/**\n * An alternative to {@link useKeyboardHandler} that doesn't set resize mode on mount. If your\n * app already uses `adjustResize`, then you can use this hook instead of `useKeyboardHandler`.\n *\n * @param handler - Object containing keyboard event handlers.\n * @param [deps] - Dependencies array for the effect.\n * @example\n * ```tsx\n * function MyComponent() {\n * const height = useSharedValue(0);\n * const progress = useSharedValue(0);\n *\n * useGenericKeyboardHandler({\n * onMove: (e) => {\n * \"worklet\";\n *\n * height.value = e.height;\n * progress.value = e.progress;\n * },\n * onEnd: (e) => {\n * \"worklet\";\n *\n * height.value = e.height;\n * progress.value = e.progress;\n * },\n * }, []);\n *\n * return <Reanimated.View style={{ height: height }] }} />;\n * }\n * ```\n */\nexport function useGenericKeyboardHandler(\n handler: KeyboardHandler,\n deps?: unknown[],\n) {\n const context = useKeyboardContext();\n\n const { doDependenciesDiffer } = useHandler(handler, deps);\n\n const eventHandler = useEvent<NativeEvent>(\n (event) => {\n \"worklet\";\n\n if (event.eventName.endsWith(\"onKeyboardMoveStart\")) {\n handler.onStart?.(event);\n }\n\n if (event.eventName.endsWith(\"onKeyboardMove\")) {\n handler.onMove?.(event);\n }\n\n if (event.eventName.endsWith(\"onKeyboardMoveEnd\")) {\n handler.onEnd?.(event);\n }\n\n if (event.eventName.endsWith(\"onKeyboardMoveInteractive\")) {\n handler.onInteractive?.(event);\n }\n },\n [\n \"onKeyboardMoveStart\",\n \"onKeyboardMove\",\n \"onKeyboardMoveEnd\",\n \"onKeyboardMoveInteractive\",\n ],\n doDependenciesDiffer,\n );\n\n useLayoutEffect(() => {\n const cleanup = context.setKeyboardHandlers(eventHandler);\n\n return () => cleanup();\n }, deps);\n}\n\n/**\n * Hook that gives an access to each aspect of keyboard movement with workletized `onStart`/`onMove`/`onInteractive`/`onEnd` handlers.\n *\n * @param handler - Object containing keyboard event handlers.\n * @param [deps] - Dependencies array for the effect.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/hooks/keyboard/use-keyboard-handler|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * const height = useSharedValue(0);\n * const progress = useSharedValue(0);\n *\n * useKeyboardHandler({\n * onMove: (e) => {\n * \"worklet\";\n *\n * height.value = e.height;\n * progress.value = e.progress;\n * },\n * onEnd: (e) => {\n * \"worklet\";\n *\n * height.value = e.height;\n * progress.value = e.progress;\n * },\n * }, []);\n *\n * return <Reanimated.View style={{ height: height }] }} />;\n * }\n * ```\n */\nexport function useKeyboardHandler(handler: KeyboardHandler, deps?: unknown[]) {\n useResizeMode();\n useGenericKeyboardHandler(handler, deps);\n}\n\n/**\n * Hook for controlling keyboard controller module.\n * Allows to disable/enable it and check the actual state (whether it's enabled or not).\n * When disabled it fallbacks to default android keyboard handling and stops tracking all\n * the events that are exposed from this library.\n *\n * @property {Function} setEnabled - Function to enable/disable keyboard handling.\n * @property {boolean} enabled - Current enabled state.\n * @returns Object containing keyboard control functions and state.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/hooks/module/use-keyboard-controller|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * const { setEnabled, enabled } = useKeyboardController();\n * return (\n * <Button\n * title={enabled ? 'Disable' : 'Enable'}\n * onPress={() => setEnabled(!enabled)}\n * />\n * );\n * }\n * ```\n */\nexport function useKeyboardController() {\n const context = useKeyboardContext();\n\n return { setEnabled: context.setEnabled, enabled: context.enabled };\n}\n\n/**\n * Hook that provides access to the layout of the currently focused input.\n *\n * @returns Object containing reanimated values for focused input.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/hooks/input/use-reanimated-focused-input|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * const { input } = useReanimatedFocusedInput();\n * return <Reanimated.View style={{ height: input.value?.layout.height }} />;\n * }\n * ```\n */\nexport function useReanimatedFocusedInput() {\n const context = useKeyboardContext();\n\n return { input: context.layout };\n}\n\n/**\n * Hook for handling focused input events, such as changes of selection, text etc.\n *\n * @param handler - Object containing focused input event handlers.\n * @param [deps] - Dependencies array for the effect.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/hooks/input/use-focused-input-handler|Documentation} page for more details.\n * @example\n * ```tsx\n * function MyComponent() {\n * useFocusedInputHandler({\n * onChangeText: (e) => console.log('Text changed:', e.text),\n * onSelectionChange: (e) => console.log('Selection changed:', e.selection)\n * });\n * return <View />;\n * }\n * ```\n */\nexport function useFocusedInputHandler(\n handler: FocusedInputHandler,\n deps?: unknown[],\n) {\n const context = useKeyboardContext();\n\n const { doDependenciesDiffer } = useHandler<never, never>(handler, deps);\n\n const eventHandler = useEvent<\n FocusedInputSelectionChangedEvent | FocusedInputTextChangedEvent\n >(\n (event) => {\n \"worklet\";\n\n if (event.eventName.endsWith(\"onFocusedInputTextChanged\")) {\n handler.onChangeText?.(event as FocusedInputTextChangedEvent);\n }\n\n if (event.eventName.endsWith(\"onFocusedInputSelectionChanged\")) {\n handler.onSelectionChange?.(event as FocusedInputSelectionChangedEvent);\n }\n },\n [\"onFocusedInputTextChanged\", \"onFocusedInputSelectionChanged\"],\n doDependenciesDiffer,\n );\n\n useLayoutEffect(() => {\n const cleanup = context.setInputHandlers(eventHandler);\n\n return () => cleanup();\n }, deps);\n}\n\nexport * from \"./useWindowDimensions\";\nexport * from \"./useKeyboardState\";\n"],"mappings":"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","ignoreList":[]}
|
package/lib/module/internal.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { useRef } from "react";
|
|
2
2
|
import { Animated } from "react-native";
|
|
3
|
-
import { registerEventHandler, unregisterEventHandler } from "./event-handler";
|
|
4
3
|
import { findNodeHandle } from "./utils/findNodeHandle";
|
|
5
4
|
/**
|
|
6
5
|
* An internal hook that helps to register workletized event handlers.
|
|
7
6
|
*
|
|
8
|
-
* @param map - Map of event handlers and their names.
|
|
9
7
|
* @param viewTagRef - Ref to the view that produces events.
|
|
10
8
|
* @returns A function that registers supplied event handlers.
|
|
11
9
|
* @example
|
|
@@ -16,26 +14,21 @@ import { findNodeHandle } from "./utils/findNodeHandle";
|
|
|
16
14
|
* );
|
|
17
15
|
* ```
|
|
18
16
|
*/
|
|
19
|
-
export function useEventHandlerRegistration(
|
|
17
|
+
export function useEventHandlerRegistration(viewTagRef) {
|
|
20
18
|
const onRegisterHandler = handler => {
|
|
21
|
-
const
|
|
19
|
+
const currentHandler = handler;
|
|
22
20
|
const attachWorkletHandlers = () => {
|
|
23
21
|
const viewTag = findNodeHandle(viewTagRef.current);
|
|
24
22
|
if (__DEV__ && !viewTag) {
|
|
25
23
|
console.warn("Can not attach worklet handlers for `react-native-keyboard-controller` because view tag can not be resolved. Be sure that `KeyboardProvider` is fully mounted before registering handlers. If you think it is a bug in library, please open an issue.");
|
|
26
24
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"worklet";
|
|
33
|
-
|
|
34
|
-
functionToCall === null || functionToCall === void 0 || functionToCall(event);
|
|
35
|
-
}, eventName, viewTag);
|
|
25
|
+
if (viewTag) {
|
|
26
|
+
if ("workletEventHandler" in currentHandler) {
|
|
27
|
+
currentHandler.workletEventHandler.registerForEvents(viewTag);
|
|
28
|
+
} else {
|
|
29
|
+
currentHandler.registerForEvents(viewTag);
|
|
36
30
|
}
|
|
37
|
-
|
|
38
|
-
}));
|
|
31
|
+
}
|
|
39
32
|
};
|
|
40
33
|
if (viewTagRef.current) {
|
|
41
34
|
attachWorkletHandlers();
|
|
@@ -44,7 +37,14 @@ export function useEventHandlerRegistration(map, viewTagRef) {
|
|
|
44
37
|
queueMicrotask(attachWorkletHandlers);
|
|
45
38
|
}
|
|
46
39
|
return () => {
|
|
47
|
-
|
|
40
|
+
const viewTag = findNodeHandle(viewTagRef.current);
|
|
41
|
+
if (viewTag) {
|
|
42
|
+
if ("workletEventHandler" in currentHandler) {
|
|
43
|
+
currentHandler.workletEventHandler.unregisterFromEvents(viewTag);
|
|
44
|
+
} else {
|
|
45
|
+
currentHandler.unregisterFromEvents(viewTag);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
return onRegisterHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRef","Animated","
|
|
1
|
+
{"version":3,"names":["useRef","Animated","findNodeHandle","useEventHandlerRegistration","viewTagRef","onRegisterHandler","handler","currentHandler","attachWorkletHandlers","viewTag","current","__DEV__","console","warn","workletEventHandler","registerForEvents","queueMicrotask","unregisterFromEvents","useAnimatedValue","initialValue","config","ref","Value"],"sources":["internal.ts"],"sourcesContent":["import { useRef } from \"react\";\nimport { Animated } from \"react-native\";\n\nimport { findNodeHandle } from \"./utils/findNodeHandle\";\n\nimport type { EventHandlerProcessed } from \"react-native-reanimated\";\n\ntype ComponentOrHandle = Parameters<typeof findNodeHandle>[0];\n\ntype WorkletHandler = {\n registerForEvents: (viewTag: number) => void;\n unregisterFromEvents: (viewTag: number) => void;\n};\n\ntype WorkletHandlerOrWorkletHandlerObject =\n | WorkletHandler\n | {\n workletEventHandler: WorkletHandler;\n };\n\n/**\n * An internal hook that helps to register workletized event handlers.\n *\n * @param viewTagRef - Ref to the view that produces events.\n * @returns A function that registers supplied event handlers.\n * @example\n * ```ts\n * const setKeyboardHandlers = useEventHandlerRegistration<KeyboardHandler>(\n * keyboardEventsMap,\n * viewTagRef,\n * );\n * ```\n */\nexport function useEventHandlerRegistration(\n viewTagRef: React.MutableRefObject<ComponentOrHandle>,\n) {\n const onRegisterHandler = (handler: EventHandlerProcessed<never, never>) => {\n const currentHandler =\n handler as unknown as WorkletHandlerOrWorkletHandlerObject;\n const attachWorkletHandlers = () => {\n const viewTag = findNodeHandle(viewTagRef.current);\n\n if (__DEV__ && !viewTag) {\n console.warn(\n \"Can not attach worklet handlers for `react-native-keyboard-controller` because view tag can not be resolved. Be sure that `KeyboardProvider` is fully mounted before registering handlers. If you think it is a bug in library, please open an issue.\",\n );\n }\n\n if (viewTag) {\n if (\"workletEventHandler\" in currentHandler) {\n currentHandler.workletEventHandler.registerForEvents(viewTag);\n } else {\n currentHandler.registerForEvents(viewTag);\n }\n }\n };\n\n if (viewTagRef.current) {\n attachWorkletHandlers();\n } else {\n // view may not be mounted yet - defer registration until call-stack becomes empty\n queueMicrotask(attachWorkletHandlers);\n }\n\n return () => {\n const viewTag = findNodeHandle(viewTagRef.current);\n\n if (viewTag) {\n if (\"workletEventHandler\" in currentHandler) {\n currentHandler.workletEventHandler.unregisterFromEvents(viewTag);\n } else {\n currentHandler.unregisterFromEvents(viewTag);\n }\n }\n };\n };\n\n return onRegisterHandler;\n}\n\n/**\n * TS variant of `useAnimatedValue` hook which is added in RN 0.71\n * A better alternative of storing animated values in refs, since\n * it doesn't recreate a new `Animated.Value` object on every re-render\n * and therefore consumes less memory. We can not use a variant from\n * RN, since this library supports earlier versions of RN.\n *\n * @param initialValue - Initial value of the animated value (numeric).\n * @param config - Additional {@link Animated.AnimatedConfig|configuration} for the animated value.\n * @returns Properly memoized {@link Animated.Value|Animated} value.\n * @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937\n * @example\n * ```ts\n * const progress = useAnimatedValue(0);\n * ```\n */\nexport function useAnimatedValue(\n initialValue: number,\n config?: Animated.AnimatedConfig,\n): Animated.Value {\n const ref = useRef<Animated.Value | null>(null);\n\n if (ref.current === null) {\n ref.current = new Animated.Value(initialValue, config);\n }\n\n return ref.current;\n}\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,OAAO;AAC9B,SAASC,QAAQ,QAAQ,cAAc;AAEvC,SAASC,cAAc,QAAQ,wBAAwB;AAiBvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,2BAA2BA,CACzCC,UAAqD,EACrD;EACA,MAAMC,iBAAiB,GAAIC,OAA4C,IAAK;IAC1E,MAAMC,cAAc,GAClBD,OAA0D;IAC5D,MAAME,qBAAqB,GAAGA,CAAA,KAAM;MAClC,MAAMC,OAAO,GAAGP,cAAc,CAACE,UAAU,CAACM,OAAO,CAAC;MAElD,IAAIC,OAAO,IAAI,CAACF,OAAO,EAAE;QACvBG,OAAO,CAACC,IAAI,CACV,uPACF,CAAC;MACH;MAEA,IAAIJ,OAAO,EAAE;QACX,IAAI,qBAAqB,IAAIF,cAAc,EAAE;UAC3CA,cAAc,CAACO,mBAAmB,CAACC,iBAAiB,CAACN,OAAO,CAAC;QAC/D,CAAC,MAAM;UACLF,cAAc,CAACQ,iBAAiB,CAACN,OAAO,CAAC;QAC3C;MACF;IACF,CAAC;IAED,IAAIL,UAAU,CAACM,OAAO,EAAE;MACtBF,qBAAqB,CAAC,CAAC;IACzB,CAAC,MAAM;MACL;MACAQ,cAAc,CAACR,qBAAqB,CAAC;IACvC;IAEA,OAAO,MAAM;MACX,MAAMC,OAAO,GAAGP,cAAc,CAACE,UAAU,CAACM,OAAO,CAAC;MAElD,IAAID,OAAO,EAAE;QACX,IAAI,qBAAqB,IAAIF,cAAc,EAAE;UAC3CA,cAAc,CAACO,mBAAmB,CAACG,oBAAoB,CAACR,OAAO,CAAC;QAClE,CAAC,MAAM;UACLF,cAAc,CAACU,oBAAoB,CAACR,OAAO,CAAC;QAC9C;MACF;IACF,CAAC;EACH,CAAC;EAED,OAAOJ,iBAAiB;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASa,gBAAgBA,CAC9BC,YAAoB,EACpBC,MAAgC,EAChB;EAChB,MAAMC,GAAG,GAAGrB,MAAM,CAAwB,IAAI,CAAC;EAE/C,IAAIqB,GAAG,CAACX,OAAO,KAAK,IAAI,EAAE;IACxBW,GAAG,CAACX,OAAO,GAAG,IAAIT,QAAQ,CAACqB,KAAK,CAACH,YAAY,EAAEC,MAAM,CAAC;EACxD;EAEA,OAAOC,GAAG,CAACX,OAAO;AACpB","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Animated } from "react-native";
|
|
2
|
-
import type {
|
|
2
|
+
import type { FocusedInputLayoutChangedEvent } from "./types";
|
|
3
3
|
import type React from "react";
|
|
4
|
-
import type { SharedValue } from "react-native-reanimated";
|
|
4
|
+
import type { EventHandlerProcessed, SharedValue } from "react-native-reanimated";
|
|
5
5
|
export type AnimatedContext = {
|
|
6
6
|
/**
|
|
7
7
|
* A value between `0` and `1` indicating keyboard position, where `0` means keyboard is closed and `1` means keyboard is fully visible.
|
|
@@ -30,9 +30,9 @@ export type KeyboardAnimationContext = {
|
|
|
30
30
|
/** Layout of the focused `TextInput` represented as `SharedValue`. */
|
|
31
31
|
layout: SharedValue<FocusedInputLayoutChangedEvent | null>;
|
|
32
32
|
/** Method for setting workletized keyboard handlers. */
|
|
33
|
-
setKeyboardHandlers: (handlers:
|
|
33
|
+
setKeyboardHandlers: (handlers: EventHandlerProcessed<never, never>) => () => void;
|
|
34
34
|
/** Method for setting workletized handlers for tracking focused input events. */
|
|
35
|
-
setInputHandlers: (handlers:
|
|
35
|
+
setInputHandlers: (handlers: EventHandlerProcessed<never, never>) => () => void;
|
|
36
36
|
/** Method to enable/disable KeyboardController library. */
|
|
37
37
|
setEnabled: React.Dispatch<React.SetStateAction<boolean>>;
|
|
38
38
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AnimatedContext, ReanimatedContext } from "../context";
|
|
2
2
|
import type { FocusedInputHandler, KeyboardHandler } from "../types";
|
|
3
|
-
import type { DependencyList } from "react";
|
|
4
3
|
/**
|
|
5
4
|
* Hook that sets the Android soft input mode to adjust resize on mount and
|
|
6
5
|
* restores default mode on unmount. This ensures the keyboard behavior is consistent
|
|
@@ -77,7 +76,7 @@ export declare const useReanimatedKeyboardAnimation: () => ReanimatedContext;
|
|
|
77
76
|
* }
|
|
78
77
|
* ```
|
|
79
78
|
*/
|
|
80
|
-
export declare function useGenericKeyboardHandler(handler: KeyboardHandler, deps?:
|
|
79
|
+
export declare function useGenericKeyboardHandler(handler: KeyboardHandler, deps?: unknown[]): void;
|
|
81
80
|
/**
|
|
82
81
|
* Hook that gives an access to each aspect of keyboard movement with workletized `onStart`/`onMove`/`onInteractive`/`onEnd` handlers.
|
|
83
82
|
*
|
|
@@ -109,7 +108,7 @@ export declare function useGenericKeyboardHandler(handler: KeyboardHandler, deps
|
|
|
109
108
|
* }
|
|
110
109
|
* ```
|
|
111
110
|
*/
|
|
112
|
-
export declare function useKeyboardHandler(handler: KeyboardHandler, deps?:
|
|
111
|
+
export declare function useKeyboardHandler(handler: KeyboardHandler, deps?: unknown[]): void;
|
|
113
112
|
/**
|
|
114
113
|
* Hook for controlling keyboard controller module.
|
|
115
114
|
* Allows to disable/enable it and check the actual state (whether it's enabled or not).
|
|
@@ -170,6 +169,6 @@ export declare function useReanimatedFocusedInput(): {
|
|
|
170
169
|
* }
|
|
171
170
|
* ```
|
|
172
171
|
*/
|
|
173
|
-
export declare function useFocusedInputHandler(handler: FocusedInputHandler, deps?:
|
|
172
|
+
export declare function useFocusedInputHandler(handler: FocusedInputHandler, deps?: unknown[]): void;
|
|
174
173
|
export * from "./useWindowDimensions";
|
|
175
174
|
export * from "./useKeyboardState";
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Animated } from "react-native";
|
|
2
2
|
import { findNodeHandle } from "./utils/findNodeHandle";
|
|
3
|
-
type
|
|
3
|
+
import type { EventHandlerProcessed } from "react-native-reanimated";
|
|
4
4
|
type ComponentOrHandle = Parameters<typeof findNodeHandle>[0];
|
|
5
5
|
/**
|
|
6
6
|
* An internal hook that helps to register workletized event handlers.
|
|
7
7
|
*
|
|
8
|
-
* @param map - Map of event handlers and their names.
|
|
9
8
|
* @param viewTagRef - Ref to the view that produces events.
|
|
10
9
|
* @returns A function that registers supplied event handlers.
|
|
11
10
|
* @example
|
|
@@ -16,7 +15,7 @@ type ComponentOrHandle = Parameters<typeof findNodeHandle>[0];
|
|
|
16
15
|
* );
|
|
17
16
|
* ```
|
|
18
17
|
*/
|
|
19
|
-
export declare function useEventHandlerRegistration
|
|
18
|
+
export declare function useEventHandlerRegistration(viewTagRef: React.MutableRefObject<ComponentOrHandle>): (handler: EventHandlerProcessed<never, never>) => () => void;
|
|
20
19
|
/**
|
|
21
20
|
* TS variant of `useAnimatedValue` hook which is added in RN 0.71
|
|
22
21
|
* A better alternative of storing animated values in refs, since
|
package/package.json
CHANGED
package/src/animated.tsx
CHANGED
|
@@ -9,7 +9,6 @@ import Reanimated, { useSharedValue } from "react-native-reanimated";
|
|
|
9
9
|
|
|
10
10
|
import { KeyboardControllerView } from "./bindings";
|
|
11
11
|
import { KeyboardContext } from "./context";
|
|
12
|
-
import { focusedInputEventsMap, keyboardEventsMap } from "./event-mappings";
|
|
13
12
|
import { useAnimatedValue, useEventHandlerRegistration } from "./internal";
|
|
14
13
|
import { KeyboardController } from "./module";
|
|
15
14
|
import {
|
|
@@ -19,10 +18,8 @@ import {
|
|
|
19
18
|
|
|
20
19
|
import type { KeyboardAnimationContext } from "./context";
|
|
21
20
|
import type {
|
|
22
|
-
FocusedInputHandler,
|
|
23
21
|
FocusedInputLayoutChangedEvent,
|
|
24
22
|
KeyboardControllerProps,
|
|
25
|
-
KeyboardHandler,
|
|
26
23
|
NativeEvent,
|
|
27
24
|
} from "./types";
|
|
28
25
|
import type { ViewStyle } from "react-native";
|
|
@@ -130,14 +127,8 @@ export const KeyboardProvider = (props: KeyboardProviderProps) => {
|
|
|
130
127
|
const progressSV = useSharedValue(0);
|
|
131
128
|
const heightSV = useSharedValue(0);
|
|
132
129
|
const layout = useSharedValue<FocusedInputLayoutChangedEvent | null>(null);
|
|
133
|
-
const setKeyboardHandlers = useEventHandlerRegistration
|
|
134
|
-
|
|
135
|
-
viewTagRef,
|
|
136
|
-
);
|
|
137
|
-
const setInputHandlers = useEventHandlerRegistration<FocusedInputHandler>(
|
|
138
|
-
focusedInputEventsMap,
|
|
139
|
-
viewTagRef,
|
|
140
|
-
);
|
|
130
|
+
const setKeyboardHandlers = useEventHandlerRegistration(viewTagRef);
|
|
131
|
+
const setInputHandlers = useEventHandlerRegistration(viewTagRef);
|
|
141
132
|
// memo
|
|
142
133
|
const context = useMemo<KeyboardAnimationContext>(
|
|
143
134
|
() => ({
|
package/src/context.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { createContext, useContext } from "react";
|
|
2
2
|
import { Animated } from "react-native";
|
|
3
3
|
|
|
4
|
-
import type {
|
|
5
|
-
FocusedInputHandler,
|
|
6
|
-
FocusedInputLayoutChangedEvent,
|
|
7
|
-
KeyboardHandler,
|
|
8
|
-
} from "./types";
|
|
4
|
+
import type { FocusedInputLayoutChangedEvent } from "./types";
|
|
9
5
|
import type React from "react";
|
|
10
|
-
import type {
|
|
6
|
+
import type {
|
|
7
|
+
EventHandlerProcessed,
|
|
8
|
+
SharedValue,
|
|
9
|
+
} from "react-native-reanimated";
|
|
11
10
|
|
|
12
11
|
export type AnimatedContext = {
|
|
13
12
|
/**
|
|
@@ -37,9 +36,13 @@ export type KeyboardAnimationContext = {
|
|
|
37
36
|
/** Layout of the focused `TextInput` represented as `SharedValue`. */
|
|
38
37
|
layout: SharedValue<FocusedInputLayoutChangedEvent | null>;
|
|
39
38
|
/** Method for setting workletized keyboard handlers. */
|
|
40
|
-
setKeyboardHandlers: (
|
|
39
|
+
setKeyboardHandlers: (
|
|
40
|
+
handlers: EventHandlerProcessed<never, never>,
|
|
41
|
+
) => () => void;
|
|
41
42
|
/** Method for setting workletized handlers for tracking focused input events. */
|
|
42
|
-
setInputHandlers: (
|
|
43
|
+
setInputHandlers: (
|
|
44
|
+
handlers: EventHandlerProcessed<never, never>,
|
|
45
|
+
) => () => void;
|
|
43
46
|
/** Method to enable/disable KeyboardController library. */
|
|
44
47
|
setEnabled: React.Dispatch<React.SetStateAction<boolean>>;
|
|
45
48
|
};
|
package/src/hooks/index.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { useEffect, useLayoutEffect } from "react";
|
|
2
|
+
import { useEvent, useHandler } from "react-native-reanimated";
|
|
2
3
|
|
|
3
4
|
import { AndroidSoftInputModes } from "../constants";
|
|
4
5
|
import { useKeyboardContext } from "../context";
|
|
5
6
|
import { KeyboardController } from "../module";
|
|
6
7
|
|
|
7
8
|
import type { AnimatedContext, ReanimatedContext } from "../context";
|
|
8
|
-
import type {
|
|
9
|
-
|
|
9
|
+
import type {
|
|
10
|
+
FocusedInputHandler,
|
|
11
|
+
FocusedInputSelectionChangedEvent,
|
|
12
|
+
FocusedInputTextChangedEvent,
|
|
13
|
+
KeyboardHandler,
|
|
14
|
+
NativeEvent,
|
|
15
|
+
} from "../types";
|
|
10
16
|
|
|
11
17
|
/**
|
|
12
18
|
* Hook that sets the Android soft input mode to adjust resize on mount and
|
|
@@ -107,12 +113,43 @@ export const useReanimatedKeyboardAnimation = (): ReanimatedContext => {
|
|
|
107
113
|
*/
|
|
108
114
|
export function useGenericKeyboardHandler(
|
|
109
115
|
handler: KeyboardHandler,
|
|
110
|
-
deps?:
|
|
116
|
+
deps?: unknown[],
|
|
111
117
|
) {
|
|
112
118
|
const context = useKeyboardContext();
|
|
113
119
|
|
|
120
|
+
const { doDependenciesDiffer } = useHandler(handler, deps);
|
|
121
|
+
|
|
122
|
+
const eventHandler = useEvent<NativeEvent>(
|
|
123
|
+
(event) => {
|
|
124
|
+
"worklet";
|
|
125
|
+
|
|
126
|
+
if (event.eventName.endsWith("onKeyboardMoveStart")) {
|
|
127
|
+
handler.onStart?.(event);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (event.eventName.endsWith("onKeyboardMove")) {
|
|
131
|
+
handler.onMove?.(event);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (event.eventName.endsWith("onKeyboardMoveEnd")) {
|
|
135
|
+
handler.onEnd?.(event);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (event.eventName.endsWith("onKeyboardMoveInteractive")) {
|
|
139
|
+
handler.onInteractive?.(event);
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
[
|
|
143
|
+
"onKeyboardMoveStart",
|
|
144
|
+
"onKeyboardMove",
|
|
145
|
+
"onKeyboardMoveEnd",
|
|
146
|
+
"onKeyboardMoveInteractive",
|
|
147
|
+
],
|
|
148
|
+
doDependenciesDiffer,
|
|
149
|
+
);
|
|
150
|
+
|
|
114
151
|
useLayoutEffect(() => {
|
|
115
|
-
const cleanup = context.setKeyboardHandlers(
|
|
152
|
+
const cleanup = context.setKeyboardHandlers(eventHandler);
|
|
116
153
|
|
|
117
154
|
return () => cleanup();
|
|
118
155
|
}, deps);
|
|
@@ -149,10 +186,7 @@ export function useGenericKeyboardHandler(
|
|
|
149
186
|
* }
|
|
150
187
|
* ```
|
|
151
188
|
*/
|
|
152
|
-
export function useKeyboardHandler(
|
|
153
|
-
handler: KeyboardHandler,
|
|
154
|
-
deps?: DependencyList,
|
|
155
|
-
) {
|
|
189
|
+
export function useKeyboardHandler(handler: KeyboardHandler, deps?: unknown[]) {
|
|
156
190
|
useResizeMode();
|
|
157
191
|
useGenericKeyboardHandler(handler, deps);
|
|
158
192
|
}
|
|
@@ -224,12 +258,32 @@ export function useReanimatedFocusedInput() {
|
|
|
224
258
|
*/
|
|
225
259
|
export function useFocusedInputHandler(
|
|
226
260
|
handler: FocusedInputHandler,
|
|
227
|
-
deps?:
|
|
261
|
+
deps?: unknown[],
|
|
228
262
|
) {
|
|
229
263
|
const context = useKeyboardContext();
|
|
230
264
|
|
|
265
|
+
const { doDependenciesDiffer } = useHandler<never, never>(handler, deps);
|
|
266
|
+
|
|
267
|
+
const eventHandler = useEvent<
|
|
268
|
+
FocusedInputSelectionChangedEvent | FocusedInputTextChangedEvent
|
|
269
|
+
>(
|
|
270
|
+
(event) => {
|
|
271
|
+
"worklet";
|
|
272
|
+
|
|
273
|
+
if (event.eventName.endsWith("onFocusedInputTextChanged")) {
|
|
274
|
+
handler.onChangeText?.(event as FocusedInputTextChangedEvent);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (event.eventName.endsWith("onFocusedInputSelectionChanged")) {
|
|
278
|
+
handler.onSelectionChange?.(event as FocusedInputSelectionChangedEvent);
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
["onFocusedInputTextChanged", "onFocusedInputSelectionChanged"],
|
|
282
|
+
doDependenciesDiffer,
|
|
283
|
+
);
|
|
284
|
+
|
|
231
285
|
useLayoutEffect(() => {
|
|
232
|
-
const cleanup = context.setInputHandlers(
|
|
286
|
+
const cleanup = context.setInputHandlers(eventHandler);
|
|
233
287
|
|
|
234
288
|
return () => cleanup();
|
|
235
289
|
}, deps);
|
package/src/internal.ts
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import { useRef } from "react";
|
|
2
2
|
import { Animated } from "react-native";
|
|
3
3
|
|
|
4
|
-
import { registerEventHandler, unregisterEventHandler } from "./event-handler";
|
|
5
4
|
import { findNodeHandle } from "./utils/findNodeHandle";
|
|
6
5
|
|
|
7
|
-
type
|
|
6
|
+
import type { EventHandlerProcessed } from "react-native-reanimated";
|
|
7
|
+
|
|
8
8
|
type ComponentOrHandle = Parameters<typeof findNodeHandle>[0];
|
|
9
9
|
|
|
10
|
+
type WorkletHandler = {
|
|
11
|
+
registerForEvents: (viewTag: number) => void;
|
|
12
|
+
unregisterFromEvents: (viewTag: number) => void;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type WorkletHandlerOrWorkletHandlerObject =
|
|
16
|
+
| WorkletHandler
|
|
17
|
+
| {
|
|
18
|
+
workletEventHandler: WorkletHandler;
|
|
19
|
+
};
|
|
20
|
+
|
|
10
21
|
/**
|
|
11
22
|
* An internal hook that helps to register workletized event handlers.
|
|
12
23
|
*
|
|
13
|
-
* @param map - Map of event handlers and their names.
|
|
14
24
|
* @param viewTagRef - Ref to the view that produces events.
|
|
15
25
|
* @returns A function that registers supplied event handlers.
|
|
16
26
|
* @example
|
|
@@ -21,14 +31,12 @@ type ComponentOrHandle = Parameters<typeof findNodeHandle>[0];
|
|
|
21
31
|
* );
|
|
22
32
|
* ```
|
|
23
33
|
*/
|
|
24
|
-
export function useEventHandlerRegistration
|
|
25
|
-
H extends Partial<Record<string, EventHandler>>,
|
|
26
|
-
>(
|
|
27
|
-
map: Map<keyof H, string>,
|
|
34
|
+
export function useEventHandlerRegistration(
|
|
28
35
|
viewTagRef: React.MutableRefObject<ComponentOrHandle>,
|
|
29
36
|
) {
|
|
30
|
-
const onRegisterHandler = (handler:
|
|
31
|
-
const
|
|
37
|
+
const onRegisterHandler = (handler: EventHandlerProcessed<never, never>) => {
|
|
38
|
+
const currentHandler =
|
|
39
|
+
handler as unknown as WorkletHandlerOrWorkletHandlerObject;
|
|
32
40
|
const attachWorkletHandlers = () => {
|
|
33
41
|
const viewTag = findNodeHandle(viewTagRef.current);
|
|
34
42
|
|
|
@@ -38,26 +46,13 @@ export function useEventHandlerRegistration<
|
|
|
38
46
|
);
|
|
39
47
|
}
|
|
40
48
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
(event: Parameters<NonNullable<H[keyof H]>>[0]) => {
|
|
49
|
-
"worklet";
|
|
50
|
-
|
|
51
|
-
functionToCall?.(event);
|
|
52
|
-
},
|
|
53
|
-
eventName,
|
|
54
|
-
viewTag,
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return null;
|
|
59
|
-
}),
|
|
60
|
-
);
|
|
49
|
+
if (viewTag) {
|
|
50
|
+
if ("workletEventHandler" in currentHandler) {
|
|
51
|
+
currentHandler.workletEventHandler.registerForEvents(viewTag);
|
|
52
|
+
} else {
|
|
53
|
+
currentHandler.registerForEvents(viewTag);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
61
56
|
};
|
|
62
57
|
|
|
63
58
|
if (viewTagRef.current) {
|
|
@@ -68,7 +63,15 @@ export function useEventHandlerRegistration<
|
|
|
68
63
|
}
|
|
69
64
|
|
|
70
65
|
return () => {
|
|
71
|
-
|
|
66
|
+
const viewTag = findNodeHandle(viewTagRef.current);
|
|
67
|
+
|
|
68
|
+
if (viewTag) {
|
|
69
|
+
if ("workletEventHandler" in currentHandler) {
|
|
70
|
+
currentHandler.workletEventHandler.unregisterFromEvents(viewTag);
|
|
71
|
+
} else {
|
|
72
|
+
currentHandler.unregisterFromEvents(viewTag);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
72
75
|
};
|
|
73
76
|
};
|
|
74
77
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["event-handler.d.ts"],"sourcesContent":["declare function registerEventHandler(\n handler: (event: never) => void,\n eventName: string,\n viewTag: number,\n): number;\ndeclare function unregisterEventHandler(id: number): void;\n\nexport { registerEventHandler, unregisterEventHandler };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.unregisterEventHandler = exports.registerEventHandler = void 0;
|
|
7
|
-
let REACore = null;
|
|
8
|
-
try {
|
|
9
|
-
REACore = require("react-native-reanimated/src/core");
|
|
10
|
-
} catch (e1) {
|
|
11
|
-
try {
|
|
12
|
-
REACore = require("react-native-reanimated/src/reanimated2/core");
|
|
13
|
-
} catch (e2) {
|
|
14
|
-
console.warn("Failed to load REACore from both paths");
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const registerEventHandler = exports.registerEventHandler = REACore.registerEventHandler;
|
|
18
|
-
const unregisterEventHandler = exports.unregisterEventHandler = REACore.unregisterEventHandler;
|
|
19
|
-
//# sourceMappingURL=event-handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["REACore","require","e1","e2","console","warn","registerEventHandler","exports","unregisterEventHandler"],"sources":["event-handler.js"],"sourcesContent":["let REACore = null;\n\ntry {\n REACore = require(\"react-native-reanimated/src/core\");\n} catch (e1) {\n try {\n REACore = require(\"react-native-reanimated/src/reanimated2/core\");\n } catch (e2) {\n console.warn(\"Failed to load REACore from both paths\");\n }\n}\nconst registerEventHandler = REACore.registerEventHandler;\nconst unregisterEventHandler = REACore.unregisterEventHandler;\n\nexport { registerEventHandler, unregisterEventHandler };\n"],"mappings":";;;;;;AAAA,IAAIA,OAAO,GAAG,IAAI;AAElB,IAAI;EACFA,OAAO,GAAGC,OAAO,CAAC,kCAAkC,CAAC;AACvD,CAAC,CAAC,OAAOC,EAAE,EAAE;EACX,IAAI;IACFF,OAAO,GAAGC,OAAO,CAAC,8CAA8C,CAAC;EACnE,CAAC,CAAC,OAAOE,EAAE,EAAE;IACXC,OAAO,CAACC,IAAI,CAAC,wCAAwC,CAAC;EACxD;AACF;AACA,MAAMC,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAGN,OAAO,CAACM,oBAAoB;AACzD,MAAME,sBAAsB,GAAAD,OAAA,CAAAC,sBAAA,GAAGR,OAAO,CAACQ,sBAAsB","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.unregisterEventHandler = exports.registerEventHandler = void 0;
|
|
7
|
-
const NOOP = () => {};
|
|
8
|
-
const registerEventHandler = exports.registerEventHandler = NOOP;
|
|
9
|
-
const unregisterEventHandler = exports.unregisterEventHandler = NOOP;
|
|
10
|
-
//# sourceMappingURL=event-handler.web.js.map
|