@react-native-ohos/react-native-keyboard-controller 1.16.8 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.OpenSource +2 -2
- package/README.md +105 -29
- package/harmony/keyboard_controller/BuildProfile.ets +1 -1
- package/harmony/keyboard_controller/Index.ets +1 -0
- package/harmony/keyboard_controller/oh-package-lock.json5 +7 -7
- package/harmony/keyboard_controller/oh-package.json5 +1 -1
- package/harmony/keyboard_controller/src/main/cpp/ClippingScrollViewComponentDescriptor.h +86 -0
- package/harmony/keyboard_controller/src/main/cpp/ClippingScrollViewComponentInstance.cpp +104 -0
- package/harmony/keyboard_controller/src/main/cpp/ClippingScrollViewComponentInstance.h +64 -0
- package/harmony/keyboard_controller/src/main/cpp/ClippingScrollViewJSIBinder.h +60 -0
- package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.cpp +8 -1
- package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.cpp +2 -2
- package/harmony/keyboard_controller/src/main/cpp/KeyboardToolbarGroupViewComponentDescriptor.h +46 -0
- package/harmony/keyboard_controller/src/main/cpp/KeyboardToolbarGroupViewComponentInstance.cpp +37 -0
- package/harmony/keyboard_controller/src/main/cpp/KeyboardToolbarGroupViewComponentInstance.h +32 -0
- package/harmony/keyboard_controller/src/main/cpp/KeyboardToolbarGroupViewJSIBinder.h +23 -0
- package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.cpp +58 -1
- package/harmony/keyboard_controller/src/main/cpp/RNKeyboardControllerPackage.h +20 -0
- package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.cpp +65 -44
- package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.h +22 -3
- package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.cpp +17 -4
- package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.h +9 -1
- package/harmony/keyboard_controller/src/main/ets/{RNKeyboardControllerPackage.ts → RNKeyboardControllerPackage.ets} +9 -5
- package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerTurboModule.ts +29 -5
- package/harmony/keyboard_controller/src/main/ets/Type.ts +2 -1
- package/harmony/keyboard_controller.har +0 -0
- package/lib/commonjs/animated.js +20 -9
- package/lib/commonjs/animated.js.map +1 -1
- package/lib/commonjs/architecture.js +8 -0
- package/lib/commonjs/architecture.js.map +1 -0
- package/lib/commonjs/bindings.js +37 -2
- package/lib/commonjs/bindings.js.map +1 -1
- package/lib/commonjs/bindings.native.js +25 -2
- package/lib/commonjs/bindings.native.js.map +1 -1
- package/lib/commonjs/compat.js +50 -0
- package/lib/commonjs/compat.js.map +1 -0
- package/lib/commonjs/components/KeyboardAvoidingView/hooks.js +21 -15
- package/lib/commonjs/components/KeyboardAvoidingView/hooks.js.map +1 -1
- package/lib/commonjs/components/KeyboardAvoidingView/index.js +36 -11
- package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js +51 -16
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +2 -2
- package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
- package/lib/commonjs/components/KeyboardChatScrollView/hooks.js +13 -0
- package/lib/commonjs/components/KeyboardChatScrollView/hooks.js.map +1 -0
- package/lib/commonjs/components/KeyboardChatScrollView/index.js +122 -0
- package/lib/commonjs/components/KeyboardChatScrollView/index.js.map +1 -0
- package/lib/commonjs/components/KeyboardChatScrollView/types.js +6 -0
- package/lib/commonjs/components/KeyboardChatScrollView/types.js.map +1 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/helpers.js +221 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/helpers.js.map +1 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js +149 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js.map +1 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.js +240 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.js.map +1 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/types.js +6 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/types.js.map +1 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useEndVisible.js +40 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useEndVisible.js.map +1 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js +92 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js.map +1 -0
- package/lib/commonjs/components/KeyboardToolbar/Arrow.js +2 -3
- package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/Button.js +2 -3
- package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/compound/components/Background.js +13 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/components/Background.js.map +1 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/components/Content.js +25 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/components/Content.js.map +1 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/components/Done.js +58 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/components/Done.js.map +1 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/components/Next.js +49 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/components/Next.js.map +1 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/components/Prev.js +49 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/components/Prev.js.map +1 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/components/index.js +42 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/components/index.js.map +1 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/components/types.js +6 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/components/types.js.map +1 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/context.js +17 -0
- package/lib/commonjs/components/KeyboardToolbar/compound/context.js.map +1 -0
- package/lib/commonjs/components/KeyboardToolbar/constants.js +17 -0
- package/lib/commonjs/components/KeyboardToolbar/constants.js.map +1 -0
- package/lib/commonjs/components/KeyboardToolbar/index.js +95 -84
- package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/types.js.map +1 -1
- package/lib/commonjs/components/ScrollViewWithBottomPadding/index.js +120 -0
- package/lib/commonjs/components/ScrollViewWithBottomPadding/index.js.map +1 -0
- package/lib/commonjs/components/ScrollViewWithBottomPadding/styles.js +15 -0
- package/lib/commonjs/components/ScrollViewWithBottomPadding/styles.js.map +1 -0
- package/lib/commonjs/components/hooks/useColorScheme.js +1 -1
- package/lib/commonjs/components/hooks/useColorScheme.js.map +1 -1
- package/lib/commonjs/components/hooks/useCombinedRef.js +24 -0
- package/lib/commonjs/components/hooks/useCombinedRef.js.map +1 -0
- package/lib/commonjs/components/hooks/useScrollState.js +62 -0
- package/lib/commonjs/components/hooks/useScrollState.js.map +1 -0
- package/lib/commonjs/components/index.js +7 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/constants.js +3 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/context.js +1 -0
- package/lib/commonjs/context.js.map +1 -1
- package/lib/commonjs/hooks/index.js +14 -1
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useKeyboardState/index.js +39 -0
- package/lib/commonjs/hooks/useKeyboardState/index.js.map +1 -0
- package/lib/commonjs/index.js +27 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal.js +36 -0
- package/lib/commonjs/internal.js.map +1 -1
- package/lib/commonjs/module.js +21 -12
- package/lib/commonjs/module.js.map +1 -1
- package/lib/commonjs/specs/ClippingScrollViewDecoratorViewNativeComponent.js +12 -0
- package/lib/commonjs/specs/ClippingScrollViewDecoratorViewNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js +8 -2
- package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js +2 -1
- package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/KeyboardToolbarGroupViewNativeComponent.js +12 -0
- package/lib/commonjs/specs/KeyboardToolbarGroupViewNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/findNodeHandle/index.js +9 -0
- package/lib/commonjs/utils/findNodeHandle/index.js.map +1 -0
- package/lib/commonjs/utils/findNodeHandle/index.native.js +13 -0
- package/lib/commonjs/utils/findNodeHandle/index.native.js.map +1 -0
- package/lib/commonjs/views/KeyboardExtender/index.js +30 -0
- package/lib/commonjs/views/KeyboardExtender/index.js.map +1 -0
- package/lib/commonjs/views/index.js +7 -0
- package/lib/commonjs/views/index.js.map +1 -1
- package/lib/module/animated.js +22 -11
- package/lib/module/animated.js.map +1 -1
- package/lib/module/architecture.js +2 -0
- package/lib/module/architecture.js.map +1 -0
- package/lib/module/bindings.js +36 -2
- package/lib/module/bindings.js.map +1 -1
- package/lib/module/bindings.native.js +24 -2
- package/lib/module/bindings.native.js.map +1 -1
- package/lib/module/compat.js +43 -0
- package/lib/module/compat.js.map +1 -0
- package/lib/module/components/KeyboardAvoidingView/hooks.js +22 -16
- package/lib/module/components/KeyboardAvoidingView/hooks.js.map +1 -1
- package/lib/module/components/KeyboardAvoidingView/index.js +35 -11
- package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/index.js +54 -19
- package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +2 -2
- package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
- package/lib/module/components/KeyboardChatScrollView/hooks.js +2 -0
- package/lib/module/components/KeyboardChatScrollView/hooks.js.map +1 -0
- package/lib/module/components/KeyboardChatScrollView/index.js +115 -0
- package/lib/module/components/KeyboardChatScrollView/index.js.map +1 -0
- package/lib/module/components/KeyboardChatScrollView/types.js +2 -0
- package/lib/module/components/KeyboardChatScrollView/types.js.map +1 -0
- package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/helpers.js +207 -0
- package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/helpers.js.map +1 -0
- package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js +143 -0
- package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js.map +1 -0
- package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.js +234 -0
- package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.js.map +1 -0
- package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/types.js +2 -0
- package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/types.js.map +1 -0
- package/lib/module/components/KeyboardChatScrollView/useEndVisible.js +33 -0
- package/lib/module/components/KeyboardChatScrollView/useEndVisible.js.map +1 -0
- package/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js +87 -0
- package/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js.map +1 -0
- package/lib/module/components/KeyboardToolbar/Arrow.js +2 -2
- package/lib/module/components/KeyboardToolbar/Arrow.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/Button.js +2 -2
- package/lib/module/components/KeyboardToolbar/Button.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/compound/components/Background.js +6 -0
- package/lib/module/components/KeyboardToolbar/compound/components/Background.js.map +1 -0
- package/lib/module/components/KeyboardToolbar/compound/components/Content.js +18 -0
- package/lib/module/components/KeyboardToolbar/compound/components/Content.js.map +1 -0
- package/lib/module/components/KeyboardToolbar/compound/components/Done.js +50 -0
- package/lib/module/components/KeyboardToolbar/compound/components/Done.js.map +1 -0
- package/lib/module/components/KeyboardToolbar/compound/components/Next.js +41 -0
- package/lib/module/components/KeyboardToolbar/compound/components/Next.js.map +1 -0
- package/lib/module/components/KeyboardToolbar/compound/components/Prev.js +41 -0
- package/lib/module/components/KeyboardToolbar/compound/components/Prev.js.map +1 -0
- package/lib/module/components/KeyboardToolbar/compound/components/index.js +6 -0
- package/lib/module/components/KeyboardToolbar/compound/components/index.js.map +1 -0
- package/lib/module/components/KeyboardToolbar/compound/components/types.js +2 -0
- package/lib/module/components/KeyboardToolbar/compound/components/types.js.map +1 -0
- package/lib/module/components/KeyboardToolbar/compound/context.js +10 -0
- package/lib/module/components/KeyboardToolbar/compound/context.js.map +1 -0
- package/lib/module/components/KeyboardToolbar/constants.js +11 -0
- package/lib/module/components/KeyboardToolbar/constants.js.map +1 -0
- package/lib/module/components/KeyboardToolbar/index.js +95 -85
- package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/types.js.map +1 -1
- package/lib/module/components/ScrollViewWithBottomPadding/index.js +112 -0
- package/lib/module/components/ScrollViewWithBottomPadding/index.js.map +1 -0
- package/lib/module/components/ScrollViewWithBottomPadding/styles.js +9 -0
- package/lib/module/components/ScrollViewWithBottomPadding/styles.js.map +1 -0
- package/lib/module/components/hooks/useColorScheme.js +1 -1
- package/lib/module/components/hooks/useColorScheme.js.map +1 -1
- package/lib/module/components/hooks/useCombinedRef.js +18 -0
- package/lib/module/components/hooks/useCombinedRef.js.map +1 -0
- package/lib/module/components/hooks/useScrollState.js +56 -0
- package/lib/module/components/hooks/useScrollState.js.map +1 -0
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/constants.js +3 -0
- package/lib/module/constants.js.map +1 -1
- package/lib/module/context.js +1 -0
- package/lib/module/context.js.map +1 -1
- package/lib/module/hooks/index.js +3 -1
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useKeyboardState/index.js +33 -0
- package/lib/module/hooks/useKeyboardState/index.js.map +1 -0
- package/lib/module/index.js +3 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal.js +35 -0
- package/lib/module/internal.js.map +1 -1
- package/lib/module/module.js +21 -12
- package/lib/module/module.js.map +1 -1
- package/lib/module/specs/ClippingScrollViewDecoratorViewNativeComponent.js +6 -0
- package/lib/module/specs/ClippingScrollViewDecoratorViewNativeComponent.js.map +1 -0
- package/lib/module/specs/KeyboardControllerViewNativeComponent.js +7 -1
- package/lib/module/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
- package/lib/module/specs/KeyboardGestureAreaNativeComponent.js +2 -1
- package/lib/module/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
- package/lib/module/specs/KeyboardToolbarGroupViewNativeComponent.js +5 -0
- package/lib/module/specs/KeyboardToolbarGroupViewNativeComponent.js.map +1 -0
- package/lib/module/specs/NativeKeyboardController.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/findNodeHandle/index.js +2 -0
- package/lib/module/utils/findNodeHandle/index.js.map +1 -0
- package/lib/module/utils/findNodeHandle/index.native.js +3 -0
- package/lib/module/utils/findNodeHandle/index.native.js.map +1 -0
- package/lib/module/views/KeyboardExtender/index.js +23 -0
- package/lib/module/views/KeyboardExtender/index.js.map +1 -0
- package/lib/module/views/index.js +1 -0
- package/lib/module/views/index.js.map +1 -1
- package/lib/typescript/animated.d.ts +2 -38
- package/lib/typescript/architecture.d.ts +1 -0
- package/lib/typescript/bindings.d.ts +15 -1
- package/lib/typescript/bindings.native.d.ts +10 -1
- package/lib/typescript/compat.d.ts +12 -0
- package/lib/typescript/components/KeyboardAvoidingView/index.d.ts +5 -0
- package/lib/typescript/components/KeyboardAwareScrollView/index.d.ts +4 -1
- package/lib/typescript/components/KeyboardChatScrollView/hooks.d.ts +2 -0
- package/lib/typescript/components/KeyboardChatScrollView/index.d.ts +17 -0
- package/lib/typescript/components/KeyboardChatScrollView/types.d.ts +113 -0
- package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/helpers.d.ts +132 -0
- package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/index.d.ts +18 -0
- package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/index.ios.d.ts +21 -0
- package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/types.d.ts +37 -0
- package/lib/typescript/components/KeyboardChatScrollView/useEndVisible.d.ts +17 -0
- package/lib/typescript/components/KeyboardChatScrollView/useExtraContentPadding/index.d.ts +45 -0
- package/lib/typescript/components/KeyboardToolbar/Button.d.ts +2 -2
- package/lib/typescript/components/KeyboardToolbar/compound/components/Background.d.ts +6 -0
- package/lib/typescript/components/KeyboardToolbar/compound/components/Content.d.ts +7 -0
- package/lib/typescript/components/KeyboardToolbar/compound/components/Done.d.ts +7 -0
- package/lib/typescript/components/KeyboardToolbar/compound/components/Next.d.ts +4 -0
- package/lib/typescript/components/KeyboardToolbar/compound/components/Prev.d.ts +4 -0
- package/lib/typescript/components/KeyboardToolbar/compound/components/index.d.ts +5 -0
- package/lib/typescript/components/KeyboardToolbar/compound/components/types.d.ts +14 -0
- package/lib/typescript/components/KeyboardToolbar/compound/context.d.ts +9 -0
- package/lib/typescript/components/KeyboardToolbar/constants.d.ts +10 -0
- package/lib/typescript/components/KeyboardToolbar/index.d.ts +12 -45
- package/lib/typescript/components/KeyboardToolbar/types.d.ts +24 -1
- package/lib/typescript/components/ScrollViewWithBottomPadding/index.d.ts +30 -0
- package/lib/typescript/components/ScrollViewWithBottomPadding/styles.d.ts +7 -0
- package/lib/typescript/components/hooks/useCombinedRef.d.ts +3 -0
- package/lib/typescript/components/hooks/useScrollState.d.ts +17 -0
- package/lib/typescript/components/index.d.ts +3 -0
- package/lib/typescript/constants.d.ts +1 -0
- package/lib/typescript/context.d.ts +1 -0
- package/lib/typescript/hooks/index.d.ts +2 -0
- package/lib/typescript/hooks/useKeyboardState/index.d.ts +4 -0
- package/lib/typescript/index.d.ts +4 -3
- package/lib/typescript/internal.d.ts +4 -0
- package/lib/typescript/specs/ClippingScrollViewDecoratorViewNativeComponent.d.ts +10 -0
- package/lib/typescript/specs/KeyboardControllerViewNativeComponent.d.ts +4 -0
- package/lib/typescript/specs/KeyboardToolbarGroupViewNativeComponent.d.ts +6 -0
- package/lib/typescript/specs/NativeKeyboardController.d.ts +6 -2
- package/lib/typescript/types.d.ts +80 -5
- package/lib/typescript/utils/findNodeHandle/index.d.ts +4 -0
- package/lib/typescript/utils/findNodeHandle/index.native.d.ts +2 -0
- package/lib/typescript/views/KeyboardExtender/index.d.ts +5 -0
- package/lib/typescript/views/index.d.ts +1 -0
- package/package.json +15 -9
- package/src/animated.tsx +41 -48
- package/src/architecture.ts +1 -0
- package/src/bindings.native.ts +37 -2
- package/src/bindings.ts +40 -1
- package/src/compat.ts +44 -0
- package/src/components/KeyboardAvoidingView/hooks.ts +24 -17
- package/src/components/KeyboardAvoidingView/index.tsx +62 -18
- package/src/components/KeyboardAwareScrollView/index.tsx +75 -20
- package/src/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +2 -2
- package/src/components/KeyboardChatScrollView/hooks.ts +2 -0
- package/src/components/KeyboardChatScrollView/index.tsx +164 -0
- package/src/components/KeyboardChatScrollView/types.ts +117 -0
- package/src/components/KeyboardChatScrollView/useChatKeyboard/helpers.ts +268 -0
- package/src/components/KeyboardChatScrollView/useChatKeyboard/index.ios.ts +260 -0
- package/src/components/KeyboardChatScrollView/useChatKeyboard/index.ts +374 -0
- package/src/components/KeyboardChatScrollView/useChatKeyboard/types.ts +39 -0
- package/src/components/KeyboardChatScrollView/useEndVisible.ts +66 -0
- package/src/components/KeyboardChatScrollView/useExtraContentPadding/index.ts +149 -0
- package/src/components/KeyboardToolbar/Arrow.tsx +2 -2
- package/src/components/KeyboardToolbar/Button.tsx +4 -4
- package/src/components/KeyboardToolbar/compound/components/Background.tsx +9 -0
- package/src/components/KeyboardToolbar/compound/components/Content.tsx +25 -0
- package/src/components/KeyboardToolbar/compound/components/Done.tsx +57 -0
- package/src/components/KeyboardToolbar/compound/components/Next.tsx +49 -0
- package/src/components/KeyboardToolbar/compound/components/Prev.tsx +49 -0
- package/src/components/KeyboardToolbar/compound/components/index.ts +5 -0
- package/src/components/KeyboardToolbar/compound/components/types.ts +15 -0
- package/src/components/KeyboardToolbar/compound/context.ts +25 -0
- package/src/components/KeyboardToolbar/constants.ts +14 -0
- package/src/components/KeyboardToolbar/index.tsx +143 -146
- package/src/components/KeyboardToolbar/types.ts +33 -1
- package/src/components/ScrollViewWithBottomPadding/index.tsx +216 -0
- package/src/components/ScrollViewWithBottomPadding/styles.ts +10 -0
- package/src/components/hooks/useColorScheme.ts +2 -1
- package/src/components/hooks/useCombinedRef.ts +22 -0
- package/src/components/hooks/useScrollState.ts +81 -0
- package/src/components/index.ts +3 -0
- package/src/constants.ts +4 -0
- package/src/context.ts +2 -0
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useKeyboardState/index.ts +52 -0
- package/src/index.ts +5 -1
- package/src/internal.ts +62 -0
- package/src/module.ts +21 -9
- package/src/specs/ClippingScrollViewDecoratorViewNativeComponent.ts +19 -0
- package/src/specs/KeyboardControllerViewNativeComponent.ts +14 -3
- package/src/specs/KeyboardGestureAreaNativeComponent.ts +1 -0
- package/src/specs/KeyboardToolbarGroupViewNativeComponent.ts +10 -0
- package/src/specs/NativeKeyboardController.ts +6 -2
- package/src/types.ts +91 -5
- package/src/utils/findNodeHandle/index.native.ts +3 -0
- package/src/utils/findNodeHandle/index.ts +6 -0
- package/src/views/KeyboardExtender/index.tsx +30 -0
- package/src/views/index.ts +1 -0
- package/lib/commonjs/monkey-patch.android.js +0 -57
- package/lib/commonjs/monkey-patch.android.js.map +0 -1
- package/lib/commonjs/monkey-patch.js +0 -11
- package/lib/commonjs/monkey-patch.js.map +0 -1
- package/lib/module/monkey-patch.android.js +0 -47
- package/lib/module/monkey-patch.android.js.map +0 -1
- package/lib/module/monkey-patch.js +0 -5
- package/lib/module/monkey-patch.js.map +0 -1
- package/lib/typescript/monkey-patch.android.d.ts +0 -2
- package/lib/typescript/monkey-patch.d.ts +0 -2
- package/src/monkey-patch.android.ts +0 -44
- package/src/monkey-patch.ts +0 -4
- /package/harmony/keyboard_controller/{ts.ts → ts.ets} +0 -0
|
@@ -25,20 +25,24 @@
|
|
|
25
25
|
* SOFTWARE.
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
-
import {
|
|
28
|
+
import { RNOHPackage } from '@rnoh/react-native-openharmony';
|
|
29
|
+
import { TurboModulesFactory } from '@rnoh/react-native-openharmony/ts';
|
|
29
30
|
import type { TurboModule, TurboModuleContext, } from '@rnoh/react-native-openharmony/ts';
|
|
30
31
|
import {RNKeyboardControllerTurboModule} from './RNKeyboardControllerTurboModule';
|
|
31
32
|
import {RNStatusBarManagerCompatTurboModule} from './RNStatusBarManagerCompatTurboModule';
|
|
32
33
|
|
|
33
34
|
class RNKeyboardControllerTurboModuleFactory extends TurboModulesFactory {
|
|
34
35
|
createTurboModule(name: string): TurboModule | null {
|
|
35
|
-
if (
|
|
36
|
+
if (name === 'KeyboardController') {
|
|
36
37
|
return new RNKeyboardControllerTurboModule(this.ctx);
|
|
37
38
|
}
|
|
39
|
+
if (name === 'StatusBarManagerCompat') {
|
|
40
|
+
return new RNStatusBarManagerCompatTurboModule(this.ctx);
|
|
41
|
+
}
|
|
38
42
|
return null;
|
|
39
43
|
}
|
|
40
44
|
hasTurboModule(name: string): boolean {
|
|
41
|
-
return name === 'KeyboardController';
|
|
45
|
+
return name === 'KeyboardController' || name === 'StatusBarManagerCompat';
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
}
|
|
@@ -54,12 +58,12 @@ class RNStatusBarManagerCompatTurboModuleFactory extends TurboModulesFactory {
|
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
60
|
|
|
57
|
-
export class RNKeyboardControllerPackage extends
|
|
61
|
+
export class RNKeyboardControllerPackage extends RNOHPackage {
|
|
58
62
|
createTurboModulesFactory(ctx: TurboModuleContext): TurboModulesFactory {
|
|
59
63
|
return new RNKeyboardControllerTurboModuleFactory(ctx);
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
|
-
export class RNStatusBarManagerCompatPackage extends
|
|
66
|
+
export class RNStatusBarManagerCompatPackage extends RNOHPackage {
|
|
63
67
|
createTurboModulesFactory(ctx: TurboModuleContext): TurboModulesFactory {
|
|
64
68
|
return new RNStatusBarManagerCompatTurboModuleFactory(ctx);
|
|
65
69
|
}
|
|
@@ -42,14 +42,20 @@ const NATIVE_KEYBOARD_WILL_EVENT_MIN_API = 20;
|
|
|
42
42
|
const LEGACY_KEYBOARD_ANIMATION_DURATION = 150;
|
|
43
43
|
const WINDOW_SESSION_MANAGER = 'SystemCapability.Window.SessionManager';
|
|
44
44
|
|
|
45
|
+
interface KeyboardControllerConstants {
|
|
46
|
+
keyboardBorderRadius: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
45
49
|
interface RNKeyboardControllerSpec {
|
|
46
|
-
getConstants():
|
|
50
|
+
getConstants(): KeyboardControllerConstants;
|
|
47
51
|
|
|
48
52
|
setInputMode(mode: number): void;
|
|
49
53
|
|
|
50
54
|
setDefaultMode(): void;
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
preload(): void;
|
|
57
|
+
|
|
58
|
+
dismiss(keepFocus: boolean, animated: boolean): void;
|
|
53
59
|
|
|
54
60
|
setFocusTo(direction: string): void;
|
|
55
61
|
|
|
@@ -135,6 +141,17 @@ export class RNKeyboardControllerTurboModule extends TurboModule implements RNKe
|
|
|
135
141
|
})
|
|
136
142
|
);
|
|
137
143
|
|
|
144
|
+
this.cleanUpCallbacks.push(
|
|
145
|
+
this.ctx.rnInstance.cppEventEmitter.subscribe("layoutDidSynchronize", () => {
|
|
146
|
+
if (this.listenerCount > 0) {
|
|
147
|
+
this.ctx.rnInstance.emitDeviceEvent(
|
|
148
|
+
KeyboardControllerEventName.LAYOUT_DID_SYNCHRONIZE,
|
|
149
|
+
{},
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
);
|
|
154
|
+
|
|
138
155
|
this.cleanUpCallbacks.push(
|
|
139
156
|
this.ctx.rnInstance.cppEventEmitter.subscribe(
|
|
140
157
|
'focusedInputChanged',
|
|
@@ -146,7 +163,9 @@ export class RNKeyboardControllerTurboModule extends TurboModule implements RNKe
|
|
|
146
163
|
);
|
|
147
164
|
}
|
|
148
165
|
|
|
149
|
-
|
|
166
|
+
getConstants(): KeyboardControllerConstants {
|
|
167
|
+
return { keyboardBorderRadius: 0 };
|
|
168
|
+
}
|
|
150
169
|
|
|
151
170
|
// set mode
|
|
152
171
|
setInputMode(mode: number): void {
|
|
@@ -157,10 +176,14 @@ export class RNKeyboardControllerTurboModule extends TurboModule implements RNKe
|
|
|
157
176
|
Logger.info('harmonyOS not support setDefaultMode')
|
|
158
177
|
}
|
|
159
178
|
|
|
179
|
+
preload(): void {
|
|
180
|
+
// Harmony IME runs outside the app process, so there is no iOS-equivalent UI to preload.
|
|
181
|
+
}
|
|
182
|
+
|
|
160
183
|
/**
|
|
161
184
|
* @description 键盘隐藏
|
|
162
185
|
* */
|
|
163
|
-
dismiss(keepFocus: boolean): void {
|
|
186
|
+
dismiss(keepFocus: boolean, animated: boolean): void {
|
|
164
187
|
let inputMethodController = inputMethod.getController();
|
|
165
188
|
inputMethodController.stopInputSession()
|
|
166
189
|
|
|
@@ -203,7 +226,8 @@ export class RNKeyboardControllerTurboModule extends TurboModule implements RNKe
|
|
|
203
226
|
KeyboardControllerEventName.KEYBOARD_DID_SHOW,
|
|
204
227
|
KeyboardControllerEventName.KEYBOARD_WILL_HIDE,
|
|
205
228
|
KeyboardControllerEventName.KEYBOARD_DID_HIDE,
|
|
206
|
-
KeyboardControllerEventName.FOCUS_DID_SET
|
|
229
|
+
KeyboardControllerEventName.FOCUS_DID_SET,
|
|
230
|
+
KeyboardControllerEventName.LAYOUT_DID_SYNCHRONIZE
|
|
207
231
|
];
|
|
208
232
|
}
|
|
209
233
|
|
|
@@ -30,7 +30,8 @@ export enum KeyboardControllerEventName {
|
|
|
30
30
|
KEYBOARD_DID_SHOW="KeyboardController::keyboardDidShow",
|
|
31
31
|
KEYBOARD_WILL_HIDE="KeyboardController::keyboardWillHide",
|
|
32
32
|
KEYBOARD_DID_HIDE="KeyboardController::keyboardDidHide",
|
|
33
|
-
FOCUS_DID_SET="KeyboardController::focusDidSet"
|
|
33
|
+
FOCUS_DID_SET="KeyboardController::focusDidSet",
|
|
34
|
+
LAYOUT_DID_SYNCHRONIZE="KeyboardController::layoutDidSynchronize"
|
|
34
35
|
}
|
|
35
36
|
export type KeyboardChangeResult = {
|
|
36
37
|
code:number;
|
|
Binary file
|
package/lib/commonjs/animated.js
CHANGED
|
@@ -10,7 +10,7 @@ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reani
|
|
|
10
10
|
var _bindings = require("./bindings");
|
|
11
11
|
var _context = require("./context");
|
|
12
12
|
var _internal = require("./internal");
|
|
13
|
-
var
|
|
13
|
+
var _module = require("./module");
|
|
14
14
|
var _reanimated = require("./reanimated");
|
|
15
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
16
|
const KeyboardControllerViewAnimated = _reactNativeReanimated.default.createAnimatedComponent(_reactNative.Animated.createAnimatedComponent(_bindings.KeyboardControllerView));
|
|
@@ -23,6 +23,7 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
23
23
|
position: "absolute"
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
+
|
|
26
27
|
// capture `Platform.OS` in separate variable to avoid deep workletization of entire RN package
|
|
27
28
|
// see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/393 and https://github.com/kirillzyusko/react-native-keyboard-controller/issues/294 for more details
|
|
28
29
|
const OS = _reactNative.Platform.OS;
|
|
@@ -31,8 +32,10 @@ const KeyboardProvider = ({
|
|
|
31
32
|
statusBarTranslucent,
|
|
32
33
|
navigationBarTranslucent,
|
|
33
34
|
preserveEdgeToEdge,
|
|
34
|
-
enabled: initiallyEnabled = true
|
|
35
|
+
enabled: initiallyEnabled = true,
|
|
36
|
+
preload = true
|
|
35
37
|
}) => {
|
|
38
|
+
const viewRef = (0, _react.useRef)(null);
|
|
36
39
|
// state
|
|
37
40
|
const [enabled, setEnabled] = (0, _react.useState)(initiallyEnabled);
|
|
38
41
|
// animated values
|
|
@@ -44,6 +47,15 @@ const KeyboardProvider = ({
|
|
|
44
47
|
const layout = (0, _reactNativeReanimated.useSharedValue)(null);
|
|
45
48
|
const [setKeyboardHandlers, broadcastKeyboardEvents] = (0, _internal.useSharedHandlers)();
|
|
46
49
|
const [setInputHandlers, broadcastInputEvents] = (0, _internal.useSharedHandlers)();
|
|
50
|
+
const update = (0, _react.useCallback)(async () => {
|
|
51
|
+
_bindings.KeyboardControllerViewCommands.synchronizeFocusedInputLayout(viewRef.current);
|
|
52
|
+
await new Promise(resolve => {
|
|
53
|
+
const subscription = _bindings.FocusedInputEvents.addListener("layoutDidSynchronize", () => {
|
|
54
|
+
subscription.remove();
|
|
55
|
+
resolve(null);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}, []);
|
|
47
59
|
// memo
|
|
48
60
|
const context = (0, _react.useMemo)(() => ({
|
|
49
61
|
enabled,
|
|
@@ -56,10 +68,11 @@ const KeyboardProvider = ({
|
|
|
56
68
|
height: heightSV
|
|
57
69
|
},
|
|
58
70
|
layout,
|
|
71
|
+
update,
|
|
59
72
|
setKeyboardHandlers,
|
|
60
73
|
setInputHandlers,
|
|
61
74
|
setEnabled
|
|
62
|
-
}), [enabled]);
|
|
75
|
+
}), [enabled, update]);
|
|
63
76
|
const style = (0, _react.useMemo)(() => [styles.hidden, {
|
|
64
77
|
transform: [{
|
|
65
78
|
translateX: height
|
|
@@ -136,17 +149,15 @@ const KeyboardProvider = ({
|
|
|
136
149
|
broadcastInputEvents("onSelectionChange", e);
|
|
137
150
|
}
|
|
138
151
|
}, []);
|
|
139
|
-
// effects
|
|
140
152
|
(0, _react.useEffect)(() => {
|
|
141
|
-
if (
|
|
142
|
-
|
|
143
|
-
} else {
|
|
144
|
-
(0, _monkeyPatch.revertMonkeyPatch)();
|
|
153
|
+
if (preload) {
|
|
154
|
+
_module.KeyboardController.preload();
|
|
145
155
|
}
|
|
146
|
-
}, [
|
|
156
|
+
}, [preload]);
|
|
147
157
|
return /*#__PURE__*/_react.default.createElement(_context.KeyboardContext.Provider, {
|
|
148
158
|
value: context
|
|
149
159
|
}, /*#__PURE__*/_react.default.createElement(KeyboardControllerViewAnimated, {
|
|
160
|
+
ref: viewRef,
|
|
150
161
|
enabled: enabled,
|
|
151
162
|
onKeyboardMoveReanimated: keyboardHandler,
|
|
152
163
|
onKeyboardMoveStart: OS === "ios" ? onKeyboardMove : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_bindings","_context","_internal","_monkeyPatch","_reanimated","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","KeyboardControllerViewAnimated","Reanimated","createAnimatedComponent","Animated","KeyboardControllerView","styles","StyleSheet","create","container","flex","hidden","display","position","OS","Platform","KeyboardProvider","children","statusBarTranslucent","navigationBarTranslucent","preserveEdgeToEdge","enabled","initiallyEnabled","setEnabled","useState","progress","useAnimatedValue","height","progressSV","useSharedValue","heightSV","layout","setKeyboardHandlers","broadcastKeyboardEvents","useSharedHandlers","setInputHandlers","broadcastInputEvents","context","useMemo","animated","multiply","reanimated","style","transform","translateX","translateY","onKeyboardMove","event","nativeEvent","useNativeDriver","updateSharedValues","platforms","includes","value","keyboardHandler","useAnimatedKeyboardHandler","onKeyboardMoveStart","onKeyboardMoveEnd","onKeyboardMoveInteractive","inputLayoutHandler","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged","target","inputTextHandler","useFocusedInputTextHandler","onFocusedInputTextChanged","inputSelectionHandler","useFocusedInputSelectionHandler","onFocusedInputSelectionChanged","useEffect","applyMonkeyPatch","revertMonkeyPatch","createElement","KeyboardContext","Provider","onKeyboardMoveReanimated","undefined","onFocusedInputLayoutChangedReanimated","onFocusedInputTextChangedReanimated","onFocusedInputSelectionChangedReanimated","View","exports"],"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 useFocusedInputSelectionHandler,\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 property indicating whether to keep edge-to-edge mode always enabled (even when you disable the module).\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/592\n * @platform android\n */\n preserveEdgeToEdge?: 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\n// capture `Platform.OS` in separate variable to avoid deep workletization of entire RN package\n// see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/393 and https://github.com/kirillzyusko/react-native-keyboard-controller/issues/294 for more details\nconst OS = Platform.OS;\n\nexport const KeyboardProvider = ({\n children,\n statusBarTranslucent,\n navigationBarTranslucent,\n preserveEdgeToEdge,\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:Platform.OS as string=='harmony'?false:true },\n ),\n [],\n );\n // handlers\n const updateSharedValues = (event: NativeEvent, platforms: string[]) => {\n \"worklet\";\n\n if (platforms.includes(OS)) {\n // eslint-disable-next-line react-compiler/react-compiler\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\", \"harmony\"]);\n },\n onKeyboardMoveEnd: (event: NativeEvent) => {\n \"worklet\";\n broadcastKeyboardEvents(\"onEnd\", event);\n updateSharedValues(event, [\"android\", \"harmony\"]);\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 const inputSelectionHandler = useFocusedInputSelectionHandler(\n {\n onFocusedInputSelectionChanged: (e) => {\n \"worklet\";\n broadcastInputEvents(\"onSelectionChange\", 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={OS === \"ios\" ? onKeyboardMove : undefined}\n onKeyboardMove={OS === \"android\" ? onKeyboardMove : undefined}\n onKeyboardMoveInteractive={onKeyboardMove}\n onKeyboardMoveEnd={ OS as string === \"harmony\"?onKeyboardMove:undefined}\n onFocusedInputLayoutChangedReanimated={inputLayoutHandler}\n onFocusedInputTextChangedReanimated={inputTextHandler}\n onFocusedInputSelectionChangedReanimated={inputSelectionHandler}\n navigationBarTranslucent={navigationBarTranslucent}\n statusBarTranslucent={statusBarTranslucent}\n preserveEdgeToEdge={preserveEdgeToEdge}\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,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GA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AAQ;IAACrB,KAAK,EAAEhB;EAAQ,gBACvCjE,MAAA,CAAAoB,OAAA,CAAAgF,aAAA,CAACvE,8BAA8B;IAC7BoB,OAAO,EAAEA,OAAQ;IACjBsD,wBAAwB,EAAErB,eAAgB;IAC1CE,mBAAmB,EAAE1C,EAAE,KAAK,KAAK,GAAGgC,cAAc,GAAG8B,SAAU;IAC/D9B,cAAc,EAAEhC,EAAE,KAAK,SAAS,GAAGgC,cAAc,GAAG8B,SAAU;IAC9DlB,yBAAyB,EAAEZ,cAAe;IAC1CW,iBAAiB,EAAG3C,EAAE,KAAe,SAAS,GAACgC,cAAc,GAAC8B,SAAU;IACxEC,qCAAqC,EAAElB,kBAAmB;IAC1DmB,mCAAmC,EAAEf,gBAAiB;IACtDgB,wCAAwC,EAAEb,qBAAsB;IAChE/C,wBAAwB,EAAEA,wBAAyB;IACnDD,oBAAoB,EAAEA,oBAAqB;IAC3CE,kBAAkB,EAAEA,kBAAmB;IACvCsB,KAAK,EAAEpC,MAAM,CAACG;EAAU,GAEvBQ,QAC6B,CAAC,eACjC7C,MAAA,CAAAoB,OAAA,CAAAgF,aAAA,CAACjG,YAAA,CAAA6B,QAAQ,CAAC4E,IAAI;IACZ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACAtC,KAAK,EAAEA;EAAM,CACd,CACuB,CAAC;AAE/B,CAAC;AAACuC,OAAA,CAAAjE,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_bindings","_context","_internal","_module","_reanimated","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","KeyboardControllerViewAnimated","Reanimated","createAnimatedComponent","Animated","KeyboardControllerView","styles","StyleSheet","create","container","flex","hidden","display","position","OS","Platform","KeyboardProvider","children","statusBarTranslucent","navigationBarTranslucent","preserveEdgeToEdge","enabled","initiallyEnabled","preload","viewRef","useRef","setEnabled","useState","progress","useAnimatedValue","height","progressSV","useSharedValue","heightSV","layout","setKeyboardHandlers","broadcastKeyboardEvents","useSharedHandlers","setInputHandlers","broadcastInputEvents","update","useCallback","KeyboardControllerViewCommands","synchronizeFocusedInputLayout","current","Promise","resolve","subscription","FocusedInputEvents","addListener","remove","context","useMemo","animated","multiply","reanimated","style","transform","translateX","translateY","onKeyboardMove","event","nativeEvent","useNativeDriver","updateSharedValues","platforms","includes","value","keyboardHandler","useAnimatedKeyboardHandler","onKeyboardMoveStart","onKeyboardMoveEnd","onKeyboardMoveInteractive","inputLayoutHandler","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged","target","inputTextHandler","useFocusedInputTextHandler","onFocusedInputTextChanged","inputSelectionHandler","useFocusedInputSelectionHandler","onFocusedInputSelectionChanged","useEffect","KeyboardController","createElement","KeyboardContext","Provider","ref","onKeyboardMoveReanimated","undefined","onFocusedInputLayoutChangedReanimated","onFocusedInputTextChangedReanimated","onFocusedInputSelectionChangedReanimated","View","exports"],"sources":["animated.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { Animated, Platform, StyleSheet } from \"react-native\";\nimport Reanimated, { useSharedValue } from \"react-native-reanimated\";\n\nimport {\n FocusedInputEvents,\n KeyboardControllerView,\n KeyboardControllerViewCommands,\n} from \"./bindings\";\nimport { KeyboardContext } from \"./context\";\nimport { useAnimatedValue, useSharedHandlers } from \"./internal\";\nimport { KeyboardController } from \"./module\";\nimport {\n useAnimatedKeyboardHandler,\n useFocusedInputLayoutHandler,\n useFocusedInputSelectionHandler,\n useFocusedInputTextHandler,\n} from \"./reanimated\";\n\nimport type { KeyboardAnimationContext } from \"./context\";\nimport type {\n FocusedInputHandler,\n FocusedInputLayoutChangedEvent,\n KeyboardControllerProps,\n KeyboardHandler,\n KeyboardProviderProps,\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) as React.ComponentType<\n KeyboardControllerProps &\n React.RefAttributes<React.Component<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\n// capture `Platform.OS` in separate variable to avoid deep workletization of entire RN package\n// see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/393 and https://github.com/kirillzyusko/react-native-keyboard-controller/issues/294 for more details\nconst OS = Platform.OS;\n\nexport const KeyboardProvider = ({\n children,\n statusBarTranslucent,\n navigationBarTranslucent,\n preserveEdgeToEdge,\n enabled: initiallyEnabled = true,\n preload = true,\n}: KeyboardProviderProps) => {\n const viewRef = useRef<React.Component<KeyboardControllerProps>>(null);\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 const update = useCallback(async () => {\n KeyboardControllerViewCommands.synchronizeFocusedInputLayout(\n viewRef.current,\n );\n\n await new Promise((resolve) => {\n const subscription = FocusedInputEvents.addListener(\n \"layoutDidSynchronize\",\n () => {\n subscription.remove();\n resolve(null);\n },\n );\n });\n }, []);\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 update,\n setKeyboardHandlers,\n setInputHandlers,\n setEnabled,\n }),\n [enabled, update],\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:Platform.OS as string=='harmony'?false:true },\n ),\n [],\n );\n // handlers\n const updateSharedValues = (event: NativeEvent, platforms: string[]) => {\n \"worklet\";\n\n if (platforms.includes(OS)) {\n // eslint-disable-next-line react-compiler/react-compiler\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\", \"harmony\"]);\n },\n onKeyboardMoveEnd: (event: NativeEvent) => {\n \"worklet\";\n broadcastKeyboardEvents(\"onEnd\", event);\n updateSharedValues(event, [\"android\", \"harmony\"]);\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 const inputSelectionHandler = useFocusedInputSelectionHandler(\n {\n onFocusedInputSelectionChanged: (e) => {\n \"worklet\";\n broadcastInputEvents(\"onSelectionChange\", e);\n },\n },\n [],\n );\n useEffect(() => {\n if (preload) {\n KeyboardController.preload();\n }\n }, [preload]);\n\n return (\n <KeyboardContext.Provider value={context}>\n <KeyboardControllerViewAnimated\n ref={viewRef}\n enabled={enabled}\n onKeyboardMoveReanimated={keyboardHandler}\n onKeyboardMoveStart={OS === \"ios\" ? onKeyboardMove : undefined}\n onKeyboardMove={OS === \"android\" ? onKeyboardMove : undefined}\n onKeyboardMoveInteractive={onKeyboardMove}\n onKeyboardMoveEnd={ OS as string === \"harmony\"?onKeyboardMove:undefined}\n onFocusedInputLayoutChangedReanimated={inputLayoutHandler}\n onFocusedInputTextChangedReanimated={inputTextHandler}\n onFocusedInputSelectionChangedReanimated={inputSelectionHandler}\n navigationBarTranslucent={navigationBarTranslucent}\n statusBarTranslucent={statusBarTranslucent}\n preserveEdgeToEdge={preserveEdgeToEdge}\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,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAKsB,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAA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MACX6D,0BAAkB,CAAC7D,OAAO,CAAC,CAAC;IAC9B;EACF,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAEb,oBACEnD,MAAA,CAAAoB,OAAA,CAAA6F,aAAA,CAAC3G,QAAA,CAAA4G,eAAe,CAACC,QAAQ;IAACpB,KAAK,EAAEhB;EAAQ,gBACvC/E,MAAA,CAAAoB,OAAA,CAAA6F,aAAA,CAACpF,8BAA8B;IAC7BuF,GAAG,EAAEhE,OAAQ;IACbH,OAAO,EAAEA,OAAQ;IACjBoE,wBAAwB,EAAErB,eAAgB;IAC1CE,mBAAmB,EAAExD,EAAE,KAAK,KAAK,GAAG8C,cAAc,GAAG8B,SAAU;IAC/D9B,cAAc,EAAE9C,EAAE,KAAK,SAAS,GAAG8C,cAAc,GAAG8B,SAAU;IAC9DlB,yBAAyB,EAAEZ,cAAe;IAC1CW,iBAAiB,EAAGzD,EAAE,KAAe,SAAS,GAAC8C,cAAc,GAAC8B,SAAU;IACxEC,qCAAqC,EAAElB,kBAAmB;IAC1DmB,mCAAmC,EAAEf,gBAAiB;IACtDgB,wCAAwC,EAAEb,qBAAsB;IAChE7D,wBAAwB,EAAEA,wBAAyB;IACnDD,oBAAoB,EAAEA,oBAAqB;IAC3CE,kBAAkB,EAAEA,kBAAmB;IACvCoC,KAAK,EAAElD,MAAM,CAACG;EAAU,GAEvBQ,QAC6B,CAAC,eACjC7C,MAAA,CAAAoB,OAAA,CAAA6F,aAAA,CAAC9G,YAAA,CAAA6B,QAAQ,CAAC0F,IAAI;IACZ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACAtC,KAAK,EAAEA;EAAM,CACd,CACuB,CAAC;AAE/B,CAAC;AAACuC,OAAA,CAAA/E,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["IS_FABRIC","exports","global"],"sources":["architecture.ts"],"sourcesContent":["export const IS_FABRIC = \"nativeFabricUIManager\" in global;\n"],"mappings":";;;;;;AAAO,MAAMA,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,uBAAuB,IAAIE,MAAM","ignoreList":[]}
|
package/lib/commonjs/bindings.js
CHANGED
|
@@ -3,16 +3,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.WindowDimensionsEvents = exports.RCTOverKeyboardView = exports.KeyboardGestureArea = exports.KeyboardEvents = exports.KeyboardControllerView = exports.KeyboardControllerNative = exports.FocusedInputEvents = void 0;
|
|
6
|
+
exports.WindowDimensionsEvents = exports.RCTOverKeyboardView = exports.RCTKeyboardToolbarGroupView = exports.RCTKeyboardExtender = exports.KeyboardGestureArea = exports.KeyboardEvents = exports.KeyboardControllerViewCommands = exports.KeyboardControllerView = exports.KeyboardControllerNative = exports.KeyboardBackgroundView = exports.FocusedInputEvents = exports.ClippingScrollView = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
8
|
var _reactNative = require("react-native");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
10
|
const NOOP = () => {};
|
|
9
11
|
const KeyboardControllerNative = exports.KeyboardControllerNative = {
|
|
10
12
|
setDefaultMode: NOOP,
|
|
11
13
|
setInputMode: NOOP,
|
|
14
|
+
preload: NOOP,
|
|
12
15
|
dismiss: NOOP,
|
|
13
16
|
setFocusTo: NOOP,
|
|
17
|
+
viewPositionInWindow: () => Promise.resolve({
|
|
18
|
+
x: 0,
|
|
19
|
+
y: 0,
|
|
20
|
+
width: 0,
|
|
21
|
+
height: 0
|
|
22
|
+
}),
|
|
14
23
|
addListener: NOOP,
|
|
15
|
-
removeListeners: NOOP
|
|
24
|
+
removeListeners: NOOP,
|
|
25
|
+
getConstants: () => ({
|
|
26
|
+
keyboardBorderRadius: 0
|
|
27
|
+
})
|
|
16
28
|
};
|
|
17
29
|
const KeyboardEvents = exports.KeyboardEvents = {
|
|
18
30
|
addListener: () => ({
|
|
@@ -34,6 +46,29 @@ const WindowDimensionsEvents = exports.WindowDimensionsEvents = {
|
|
|
34
46
|
})
|
|
35
47
|
};
|
|
36
48
|
const KeyboardControllerView = exports.KeyboardControllerView = _reactNative.View;
|
|
49
|
+
const KeyboardControllerViewCommands = exports.KeyboardControllerViewCommands = {
|
|
50
|
+
synchronizeFocusedInputLayout: _ref => {}
|
|
51
|
+
};
|
|
37
52
|
const KeyboardGestureArea = exports.KeyboardGestureArea = _reactNative.View;
|
|
38
53
|
const RCTOverKeyboardView = exports.RCTOverKeyboardView = _reactNative.View;
|
|
54
|
+
const ClippingScrollView = exports.ClippingScrollView = _reactNative.View;
|
|
55
|
+
const KeyboardBackgroundView = exports.KeyboardBackgroundView = /*#__PURE__*/_react.default.forwardRef(({
|
|
56
|
+
style,
|
|
57
|
+
...props
|
|
58
|
+
}, ref) => {
|
|
59
|
+
const colorScheme = (0, _reactNative.useColorScheme)();
|
|
60
|
+
const backgroundColor = colorScheme === "dark" ? "#2c2c2e" : "#eceff3";
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
62
|
+
ref,
|
|
63
|
+
style: [{
|
|
64
|
+
backgroundColor
|
|
65
|
+
}, style],
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
const RCTKeyboardExtender = exports.RCTKeyboardExtender = _reactNative.View;
|
|
70
|
+
/**
|
|
71
|
+
* A View that defines a group of `TextInput`s for toolbar navigation.
|
|
72
|
+
*/
|
|
73
|
+
const RCTKeyboardToolbarGroupView = exports.RCTKeyboardToolbarGroupView = _reactNative.View;
|
|
39
74
|
//# sourceMappingURL=bindings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","e","__esModule","default","NOOP","KeyboardControllerNative","exports","setDefaultMode","setInputMode","preload","dismiss","setFocusTo","viewPositionInWindow","Promise","resolve","x","y","width","height","addListener","removeListeners","getConstants","keyboardBorderRadius","KeyboardEvents","remove","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","View","KeyboardControllerViewCommands","synchronizeFocusedInputLayout","_ref","KeyboardGestureArea","RCTOverKeyboardView","ClippingScrollView","KeyboardBackgroundView","React","forwardRef","style","props","ref","colorScheme","useColorScheme","backgroundColor","createElement","RCTKeyboardExtender","RCTKeyboardToolbarGroupView"],"sources":["bindings.ts"],"sourcesContent":["import React from \"react\";\nimport { useColorScheme, View } from \"react-native\";\n\nimport type {\n ClippingScrollViewProps,\n FocusedInputEventsModule,\n KeyboardBackgroundViewProps,\n KeyboardControllerNativeModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardExtenderProps,\n KeyboardGestureAreaProps,\n KeyboardToolbarGroupViewProps,\n OverKeyboardViewProps,\n WindowDimensionsEventsModule,\n} from \"./types\";\nimport type { EmitterSubscription } from \"react-native\";\nimport type { View as RNView } from \"react-native\";\n\nconst NOOP = () => {};\n\nexport const KeyboardControllerNative: KeyboardControllerNativeModule = {\n setDefaultMode: NOOP,\n setInputMode: NOOP,\n preload: NOOP,\n dismiss: NOOP,\n setFocusTo: NOOP,\n viewPositionInWindow: () =>\n Promise.resolve({ x: 0, y: 0, width: 0, height: 0 }),\n addListener: NOOP,\n removeListeners: NOOP,\n getConstants: () => ({\n keyboardBorderRadius: 0,\n }),\n};\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\n/**\n * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.\n * Use it with cautious.\n */\nexport const FocusedInputEvents: FocusedInputEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\nexport const WindowDimensionsEvents: WindowDimensionsEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\nexport const KeyboardControllerView =\n View as unknown as React.FC<KeyboardControllerProps>;\nexport const KeyboardControllerViewCommands = {\n synchronizeFocusedInputLayout: (\n _ref: React.Component<KeyboardControllerProps> | null,\n ) => {},\n};\nexport const KeyboardGestureArea =\n View as unknown as React.FC<KeyboardGestureAreaProps>;\nexport const RCTOverKeyboardView =\n View as unknown as React.FC<OverKeyboardViewProps>;\nexport const ClippingScrollView =\n View as unknown as React.FC<ClippingScrollViewProps>;\nexport const KeyboardBackgroundView = React.forwardRef<\n RNView,\n KeyboardBackgroundViewProps\n>(({ style, ...props }, ref) => {\n const colorScheme = useColorScheme();\n const backgroundColor = colorScheme === \"dark\" ? \"#2c2c2e\" : \"#eceff3\";\n\n return React.createElement(View, {\n ref,\n style: [{ backgroundColor }, style],\n ...props,\n });\n});\nexport const RCTKeyboardExtender =\n View as unknown as React.FC<KeyboardExtenderProps>;\n/**\n * A View that defines a group of `TextInput`s for toolbar navigation.\n */\nexport const RCTKeyboardToolbarGroupView =\n View as unknown as React.FC<KeyboardToolbarGroupViewProps>;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAoD,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAkBpD,MAAMG,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAEd,MAAMC,wBAAwD,GAAAC,OAAA,CAAAD,wBAAA,GAAG;EACtEE,cAAc,EAAEH,IAAI;EACpBI,YAAY,EAAEJ,IAAI;EAClBK,OAAO,EAAEL,IAAI;EACbM,OAAO,EAAEN,IAAI;EACbO,UAAU,EAAEP,IAAI;EAChBQ,oBAAoB,EAAEA,CAAA,KACpBC,OAAO,CAACC,OAAO,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEC,KAAK,EAAE,CAAC;IAAEC,MAAM,EAAE;EAAE,CAAC,CAAC;EACtDC,WAAW,EAAEf,IA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AChB,iBAAI,EAAE;IAC/BY,GAAG;IACHF,KAAK,EAAE,CAAC;MAAEK;IAAgB,CAAC,EAAEL,KAAK,CAAC;IACnC,GAAGC;EACL,CAAC,CAAC;AACJ,CAAC,CAAC;AACK,MAAMM,mBAAmB,GAAAvC,OAAA,CAAAuC,mBAAA,GAC9BjB,iBAAkD;AACpD;AACA;AACA;AACO,MAAMkB,2BAA2B,GAAAxC,OAAA,CAAAwC,2BAAA,GACtClB,iBAA0D","ignoreList":[]}
|
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.WindowDimensionsEvents = exports.RCTOverKeyboardView = exports.KeyboardGestureArea = exports.KeyboardEvents = exports.KeyboardControllerView = exports.KeyboardControllerNative = exports.FocusedInputEvents = void 0;
|
|
6
|
+
exports.WindowDimensionsEvents = exports.RCTOverKeyboardView = exports.RCTKeyboardToolbarGroupView = exports.RCTKeyboardExtender = exports.KeyboardGestureArea = exports.KeyboardEvents = exports.KeyboardControllerViewCommands = exports.KeyboardControllerView = exports.KeyboardControllerNative = exports.KeyboardBackgroundView = exports.FocusedInputEvents = exports.ClippingScrollView = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
8
|
var _reactNative = require("react-native");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
10
|
const LINKING_ERROR = `The package 'react-native-keyboard-controller' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
9
11
|
ios: "- You have run 'pod install'\n",
|
|
10
12
|
default: ""
|
|
11
13
|
}) + "- You rebuilt the app after installing the package\n" + "- You are not using Expo Go\n";
|
|
14
|
+
const KeyboardControllerViewNativeComponentModule = require("./specs/KeyboardControllerViewNativeComponent");
|
|
12
15
|
const RCTKeyboardController = require("./specs/NativeKeyboardController").default;
|
|
13
16
|
const KeyboardControllerNative = exports.KeyboardControllerNative = RCTKeyboardController ? RCTKeyboardController : new Proxy({}, {
|
|
14
17
|
get() {
|
|
@@ -31,9 +34,29 @@ const FocusedInputEvents = exports.FocusedInputEvents = {
|
|
|
31
34
|
const WindowDimensionsEvents = exports.WindowDimensionsEvents = {
|
|
32
35
|
addListener: (name, cb) => eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb)
|
|
33
36
|
};
|
|
34
|
-
const KeyboardControllerView = exports.KeyboardControllerView =
|
|
37
|
+
const KeyboardControllerView = exports.KeyboardControllerView = KeyboardControllerViewNativeComponentModule.default;
|
|
38
|
+
const KeyboardControllerViewCommands = exports.KeyboardControllerViewCommands = KeyboardControllerViewNativeComponentModule.Commands;
|
|
35
39
|
const KeyboardGestureArea = exports.KeyboardGestureArea = _reactNative.Platform.OS === "android" && _reactNative.Platform.Version >= 30 || _reactNative.Platform.OS === "ios" ? require("./specs/KeyboardGestureAreaNativeComponent").default : ({
|
|
36
40
|
children
|
|
37
41
|
}) => children;
|
|
38
42
|
const RCTOverKeyboardView = exports.RCTOverKeyboardView = require("./specs/OverKeyboardViewNativeComponent").default;
|
|
43
|
+
const ClippingScrollView = exports.ClippingScrollView = _reactNative.Platform.OS === "android" || _reactNative.Platform.OS === "harmony" ? require("./specs/ClippingScrollViewDecoratorViewNativeComponent").default : ({
|
|
44
|
+
children
|
|
45
|
+
}) => children;
|
|
46
|
+
const KeyboardBackgroundView = exports.KeyboardBackgroundView = /*#__PURE__*/_react.default.forwardRef(({
|
|
47
|
+
style,
|
|
48
|
+
...props
|
|
49
|
+
}, ref) => {
|
|
50
|
+
const colorScheme = (0, _reactNative.useColorScheme)();
|
|
51
|
+
const backgroundColor = colorScheme === "dark" ? "#2c2c2e" : "#eceff3";
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
53
|
+
ref,
|
|
54
|
+
style: [{
|
|
55
|
+
backgroundColor
|
|
56
|
+
}, style],
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
const RCTKeyboardExtender = exports.RCTKeyboardExtender = _reactNative.View;
|
|
61
|
+
const RCTKeyboardToolbarGroupView = exports.RCTKeyboardToolbarGroupView = require("./specs/KeyboardToolbarGroupViewNativeComponent").default;
|
|
39
62
|
//# sourceMappingURL=bindings.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","e","__esModule","default","LINKING_ERROR","Platform","select","ios","KeyboardControllerViewNativeComponentModule","RCTKeyboardController","KeyboardControllerNative","exports","Proxy","get","Error","KEYBOARD_CONTROLLER_NAMESPACE","eventEmitter","NativeEventEmitter","KeyboardEvents","addListener","name","cb","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","KeyboardControllerViewCommands","Commands","KeyboardGestureArea","OS","Version","children","RCTOverKeyboardView","ClippingScrollView","KeyboardBackgroundView","React","forwardRef","style","props","ref","colorScheme","useColorScheme","backgroundColor","createElement","View","RCTKeyboardExtender","RCTKeyboardToolbarGroupView"],"sources":["bindings.native.ts"],"sourcesContent":["import React from \"react\";\nimport {\n NativeEventEmitter,\n Platform,\n useColorScheme,\n View,\n} from \"react-native\";\n\nimport type {\n ClippingScrollViewProps,\n FocusedInputEventsModule,\n KeyboardBackgroundViewProps,\n KeyboardControllerNativeModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardExtenderProps,\n KeyboardGestureAreaProps,\n KeyboardToolbarGroupViewProps,\n OverKeyboardViewProps,\n WindowDimensionsEventsModule,\n} from \"./types\";\nimport type { View as RNView } from \"react-native\";\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 KeyboardControllerViewNativeComponentModule = require(\"./specs/KeyboardControllerViewNativeComponent\");\nconst RCTKeyboardController =\n require(\"./specs/NativeKeyboardController\").default;\n\nexport const KeyboardControllerNative = (\n RCTKeyboardController\n ? RCTKeyboardController\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n },\n )\n) as KeyboardControllerNativeModule;\n\nconst KEYBOARD_CONTROLLER_NAMESPACE = \"KeyboardController::\";\nconst eventEmitter = new NativeEventEmitter(KeyboardControllerNative);\n\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: (name, cb) =>\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\n};\n\n/**\n * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.\n * Use it with cautious.\n */\nexport const FocusedInputEvents: FocusedInputEventsModule = {\n addListener: (name, cb) =>\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\n};\nexport const WindowDimensionsEvents: WindowDimensionsEventsModule = {\n addListener: (name, cb) =>\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\n};\nexport const KeyboardControllerView: React.FC<KeyboardControllerProps> =\n KeyboardControllerViewNativeComponentModule.default;\nexport const KeyboardControllerViewCommands =\n KeyboardControllerViewNativeComponentModule.Commands;\nexport const KeyboardGestureArea: React.FC<KeyboardGestureAreaProps> =\n (Platform.OS === \"android\" && Platform.Version >= 30) || Platform.OS === \"ios\"\n ? require(\"./specs/KeyboardGestureAreaNativeComponent\").default\n : ({ children }: KeyboardGestureAreaProps) => children;\nexport const RCTOverKeyboardView: React.FC<OverKeyboardViewProps> =\n require(\"./specs/OverKeyboardViewNativeComponent\").default;\nexport const ClippingScrollView: React.FC<ClippingScrollViewProps> =\n Platform.OS === \"android\" || (Platform.OS as string) === \"harmony\"\n ? require(\"./specs/ClippingScrollViewDecoratorViewNativeComponent\").default\n : ({ children }: ClippingScrollViewProps) => children;\nexport const KeyboardBackgroundView = React.forwardRef<\n RNView,\n KeyboardBackgroundViewProps\n>(({ style, ...props }, ref) => {\n const colorScheme = useColorScheme();\n const backgroundColor = colorScheme === \"dark\" ? \"#2c2c2e\" : \"#eceff3\";\n\n return React.createElement(View, {\n ref,\n style: [{ backgroundColor }, style],\n ...props,\n });\n});\nexport const RCTKeyboardExtender =\n View as unknown as React.FC<KeyboardExtenderProps>;\nexport const RCTKeyboardToolbarGroupView: React.FC<KeyboardToolbarGroupViewProps> =\n require(\"./specs/KeyboardToolbarGroupViewNativeComponent\").default;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAKsB,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAiBtB,MAAMG,aAAa,GACjB,2FAA2F,GAC3FC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEJ,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMK,2CAA2C,GAAGT,OAAO,CAAC,+CAA+C,CAAC;AAC5G,MAAMU,qBAAqB,GACzBV,OAAO,CAAC,kCAAkC,CAAC,CAACI,OAAO;AAE9C,MAAMO,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,GACnCD,qBAAqB,GACjBA,qBAAqB,GACrB,IAAIG,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACV,aAAa,CAAC;EAChC;AACF,CACF,CAC6B;AAEnC,MAAMW,6BAA6B,GAAG,sBAAsB;AAC5D,MAAMC,YAAY,GAAG,IAAIC,+BAAkB,CAACP,wBAAwB,CAAC;AAE9D,MAAMQ,cAAoC,GAAAP,OAAA,CAAAO,cAAA,GAAG;EAClDC,WAAW,EAAEA,CAACC,IAAI,EAAEC,EAAE,KACpBL,YAAY,CAACG,WAA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AtB,OAAA,CAAAsB,sBAAA,gBAAGC,cAAK,CAACC,UAAU,CAGpD,CAAC;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EAC9B,MAAMC,WAAW,GAAG,IAAAC,2BAAc,EAAC,CAAC;EACpC,MAAMC,eAAe,GAAGF,WAAW,KAAK,MAAM,GAAG,SAAS,GAAG,SAAS;EAEtE,oBAAOL,cAAK,CAACQ,aAAa,CAACC,iBAAI,EAAE;IAC/BL,GAAG;IACHF,KAAK,EAAE,CAAC;MAAEK;IAAgB,CAAC,EAAEL,KAAK,CAAC;IACnC,GAAGC;EACL,CAAC,CAAC;AACJ,CAAC,CAAC;AACK,MAAMO,mBAAmB,GAAAjC,OAAA,CAAAiC,mBAAA,GAC9BD,iBAAkD;AAC7C,MAAME,2BAAoE,GAAAlC,OAAA,CAAAkC,2BAAA,GAC/E9C,OAAO,CAAC,iDAAiD,CAAC,CAACI,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useAnimatedKeyboard = exports.KeyboardState = void 0;
|
|
7
|
+
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
|
+
var _hooks = require("./hooks");
|
|
9
|
+
const KeyboardState = exports.KeyboardState = {
|
|
10
|
+
UNKNOWN: 0,
|
|
11
|
+
OPENING: 1,
|
|
12
|
+
OPEN: 2,
|
|
13
|
+
CLOSING: 3,
|
|
14
|
+
CLOSED: 4
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** Compatibility layer for migrating from Reanimated's useAnimatedKeyboard. */
|
|
18
|
+
const useAnimatedKeyboard = () => {
|
|
19
|
+
const height = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
20
|
+
const state = (0, _reactNativeReanimated.useSharedValue)(KeyboardState.UNKNOWN);
|
|
21
|
+
(0, _hooks.useKeyboardHandler)({
|
|
22
|
+
onStart: event => {
|
|
23
|
+
"worklet";
|
|
24
|
+
|
|
25
|
+
state.value = event.height > 0 ? KeyboardState.OPENING : KeyboardState.CLOSING;
|
|
26
|
+
},
|
|
27
|
+
onMove: event => {
|
|
28
|
+
"worklet";
|
|
29
|
+
|
|
30
|
+
height.value = event.height;
|
|
31
|
+
},
|
|
32
|
+
onInteractive: event => {
|
|
33
|
+
"worklet";
|
|
34
|
+
|
|
35
|
+
height.value = event.height;
|
|
36
|
+
},
|
|
37
|
+
onEnd: event => {
|
|
38
|
+
"worklet";
|
|
39
|
+
|
|
40
|
+
state.value = event.height > 0 ? KeyboardState.OPEN : KeyboardState.CLOSED;
|
|
41
|
+
height.value = event.height;
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
44
|
+
return {
|
|
45
|
+
height,
|
|
46
|
+
state
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
exports.useAnimatedKeyboard = useAnimatedKeyboard;
|
|
50
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","require","_hooks","KeyboardState","exports","UNKNOWN","OPENING","OPEN","CLOSING","CLOSED","useAnimatedKeyboard","height","useSharedValue","state","useKeyboardHandler","onStart","event","value","onMove","onInteractive","onEnd"],"sources":["compat.ts"],"sourcesContent":["import { useSharedValue } from \"react-native-reanimated\";\n\nimport { useKeyboardHandler } from \"./hooks\";\n\nexport const KeyboardState = {\n UNKNOWN: 0,\n OPENING: 1,\n OPEN: 2,\n CLOSING: 3,\n CLOSED: 4,\n};\n\n/** Compatibility layer for migrating from Reanimated's useAnimatedKeyboard. */\nexport const useAnimatedKeyboard = () => {\n const height = useSharedValue(0);\n const state = useSharedValue(KeyboardState.UNKNOWN);\n\n useKeyboardHandler(\n {\n onStart: (event) => {\n \"worklet\";\n state.value =\n event.height > 0 ? KeyboardState.OPENING : KeyboardState.CLOSING;\n },\n onMove: (event) => {\n \"worklet\";\n height.value = event.height;\n },\n onInteractive: (event) => {\n \"worklet\";\n height.value = event.height;\n },\n onEnd: (event) => {\n \"worklet\";\n state.value =\n event.height > 0 ? KeyboardState.OPEN : KeyboardState.CLOSED;\n height.value = event.height;\n },\n },\n [],\n );\n\n return { height, state };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEO,MAAME,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC3BE,OAAO,EAAE,CAAC;EACVC,OAAO,EAAE,CAAC;EACVC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,CAAC;EACVC,MAAM,EAAE;AACV,CAAC;;AAED;AACO,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAMC,MAAM,GAAG,IAAAC,qCAAc,EAAC,CAAC,CAAC;EAChC,MAAMC,KAAK,GAAG,IAAAD,qCAAc,EAACT,aAAa,CAACE,OAAO,CAAC;EAEnD,IAAAS,yBAAkB,EAChB;IACEC,OAAO,EAAGC,KAAK,IAAK;MAClB,SAAS;;MACTH,KAAK,CAACI,KAAK,GACTD,KAAK,CAACL,MAAM,GAAG,CAAC,GAAGR,aAAa,CAACG,OAAO,GAAGH,aAAa,CAACK,OAAO;IACpE,CAAC;IACDU,MAAM,EAAGF,KAAK,IAAK;MACjB,SAAS;;MACTL,MAAM,CAACM,KAAK,GAAGD,KAAK,CAACL,MAAM;IAC7B,CAAC;IACDQ,aAAa,EAAGH,KAAK,IAAK;MACxB,SAAS;;MACTL,MAAM,CAACM,KAAK,GAAGD,KAAK,CAACL,MAAM;IAC7B,CAAC;IACDS,KAAK,EAAGJ,KAAK,IAAK;MAChB,SAAS;;MACTH,KAAK,CAACI,KAAK,GACTD,KAAK,CAACL,MAAM,GAAG,CAAC,GAAGR,aAAa,CAACI,IAAI,GAAGJ,aAAa,CAACM,MAAM;MAC9DE,MAAM,CAACM,KAAK,GAAGD,KAAK,CAACL,MAAM;IAC7B;EACF,CAAC,EACD,EACF,CAAC;EAED,OAAO;IAAEA,MAAM;IAAEE;EAAM,CAAC;AAC1B,CAAC;AAACT,OAAA,CAAAM,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -14,19 +14,25 @@ const useKeyboardAnimation = () => {
|
|
|
14
14
|
const {
|
|
15
15
|
reanimated
|
|
16
16
|
} = (0, _context.useKeyboardContext)();
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
const heightWhenOpened = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
18
|
+
const height = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
19
|
+
const progress = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
20
|
+
const isClosed = (0, _reactNativeReanimated.useSharedValue)(true);
|
|
21
|
+
(0, _react.useLayoutEffect)(() => {
|
|
22
|
+
const initialHeight = -reanimated.height.value;
|
|
23
|
+
const initialProgress = reanimated.progress.value;
|
|
24
|
+
|
|
25
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
26
|
+
heightWhenOpened.value = initialHeight;
|
|
27
|
+
height.value = initialHeight;
|
|
28
|
+
progress.value = initialProgress;
|
|
29
|
+
isClosed.value = initialProgress === 0;
|
|
30
|
+
}, []);
|
|
24
31
|
(0, _hooks.useKeyboardHandler)({
|
|
25
32
|
onStart: e => {
|
|
26
33
|
"worklet";
|
|
27
34
|
|
|
28
35
|
if (e.height > 0) {
|
|
29
|
-
// eslint-disable-next-line react-compiler/react-compiler
|
|
30
36
|
isClosed.value = false;
|
|
31
37
|
heightWhenOpened.value = e.height;
|
|
32
38
|
}
|
|
@@ -78,17 +84,17 @@ const useTranslateAnimation = () => {
|
|
|
78
84
|
const {
|
|
79
85
|
reanimated
|
|
80
86
|
} = (0, _context.useKeyboardContext)();
|
|
81
|
-
|
|
82
|
-
// calculate it only once on mount, to avoid `SharedValue` reads during a render
|
|
83
|
-
const [initialProgress] = (0, _react.useState)(() => reanimated.progress.value);
|
|
84
|
-
const padding = (0, _reactNativeReanimated.useSharedValue)(initialProgress);
|
|
87
|
+
const padding = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
85
88
|
const translate = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
89
|
+
(0, _react.useLayoutEffect)(() => {
|
|
90
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
91
|
+
padding.value = reanimated.progress.value;
|
|
92
|
+
}, []);
|
|
86
93
|
(0, _hooks.useKeyboardHandler)({
|
|
87
94
|
onStart: e => {
|
|
88
95
|
"worklet";
|
|
89
96
|
|
|
90
97
|
if (e.height === 0) {
|
|
91
|
-
// eslint-disable-next-line react-compiler/react-compiler
|
|
92
98
|
padding.value = 0;
|
|
93
99
|
}
|
|
94
100
|
if (OS === "ios") {
|
|
@@ -98,7 +104,7 @@ const useTranslateAnimation = () => {
|
|
|
98
104
|
onMove: e => {
|
|
99
105
|
"worklet";
|
|
100
106
|
|
|
101
|
-
if (OS
|
|
107
|
+
if (OS !== "ios") {
|
|
102
108
|
translate.value = e.progress;
|
|
103
109
|
}
|
|
104
110
|
},
|
|
@@ -112,7 +118,7 @@ const useTranslateAnimation = () => {
|
|
|
112
118
|
"worklet";
|
|
113
119
|
|
|
114
120
|
padding.value = e.progress;
|
|
115
|
-
if (OS
|
|
121
|
+
if (OS !== "ios") {
|
|
116
122
|
translate.value = e.progress;
|
|
117
123
|
}
|
|
118
124
|
}
|