@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
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { KeyboardLiftBehavior } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Map the current keyboard height to an effective height that accounts for a
|
|
4
|
+
* fixed offset (e.g. Bottom safe-area or tab-bar height)..
|
|
5
|
+
*
|
|
6
|
+
* @param height - Current keyboard height.
|
|
7
|
+
* @param targetKeyboardHeight - Full target keyboard height (captured on keyboard open).
|
|
8
|
+
* @param offset - Fixed distance between the scroll-view bottom and the screen bottom.
|
|
9
|
+
* @returns Effective height after subtracting the offset proportionally.
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* getEffectiveHeight(300, 300, 50); // 250
|
|
13
|
+
* getEffectiveHeight(150, 300, 50); // 125
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const getEffectiveHeight: (height: number, targetKeyboardHeight: number, offset: number) => number;
|
|
17
|
+
/**
|
|
18
|
+
* Check whether the scroll view is at the end of its content.
|
|
19
|
+
*
|
|
20
|
+
* For non-inverted lists the "end" is the bottom of the content.
|
|
21
|
+
* For inverted lists the "end" is the top (scroll offset near 0),
|
|
22
|
+
* because that is where the latest messages are displayed.
|
|
23
|
+
*
|
|
24
|
+
* @param scrollOffset - Current vertical scroll offset.
|
|
25
|
+
* @param layoutHeight - Visible height of the scroll view.
|
|
26
|
+
* @param contentHeight - Total height of the scrollable content.
|
|
27
|
+
* @param inverted - Whether the list is inverted.
|
|
28
|
+
* @returns `true` if the scroll position is within the threshold of the content end.
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const atEnd = isScrollAtEnd(100, 800, 920); // true (100 + 800 >= 920 - 20)
|
|
32
|
+
* const atEndInverted = isScrollAtEnd(5, 800, 2000, true); // true (5 <= 20)
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare const isScrollAtEnd: (scrollOffset: number, layoutHeight: number, contentHeight: number, inverted?: boolean) => boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Decide whether content should be shifted based on the keyboard lift behavior.
|
|
38
|
+
*
|
|
39
|
+
* @param behavior - The configured keyboard lift behavior.
|
|
40
|
+
* @param isAtEnd - Whether the scroll view is currently at the end.
|
|
41
|
+
* @returns `true` if content should be shifted.
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* shouldShiftContent("always", false); // true
|
|
45
|
+
* shouldShiftContent("whenAtEnd", false); // false
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare const shouldShiftContent: (behavior: KeyboardLiftBehavior, isAtEnd: boolean) => boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Compute the fraction of minimum padding space currently visible in the viewport (0–1).
|
|
51
|
+
*
|
|
52
|
+
* The minimum padding space lives in the scroll view's contentInset, NOT in the
|
|
53
|
+
* content itself. So `contentHeight` (from onContentSizeChange / scroll
|
|
54
|
+
* events) does **not** include it. The visible portion is how far the
|
|
55
|
+
* viewport extends past the content boundary into the inset area.
|
|
56
|
+
*
|
|
57
|
+
* For non-inverted lists the padding is in contentInset.bottom.
|
|
58
|
+
* For inverted lists the padding is in contentInset.top (negative scroll).
|
|
59
|
+
*
|
|
60
|
+
* @param scrollOffset - Current vertical scroll offset.
|
|
61
|
+
* @param layoutHeight - Visible height of the scroll view.
|
|
62
|
+
* @param contentHeight - Height of the scroll content (excludes insets).
|
|
63
|
+
* @param blankSpace - Size of the minimum padding inset area.
|
|
64
|
+
* @param inverted - Whether the list is inverted.
|
|
65
|
+
* @returns A value between 0 (padding fully off-screen) and 1 (padding fully visible).
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* // Non-inverted: contentHeight=1500, layout=800, blankSpace=300
|
|
69
|
+
* getVisibleMinimumPaddingFraction(1500, 800, 1500, 300, false); // 1 (at end, viewport past content)
|
|
70
|
+
* getVisibleMinimumPaddingFraction(850, 800, 1500, 300, false); // 0.5 (half padding visible)
|
|
71
|
+
* getVisibleMinimumPaddingFraction(700, 800, 1500, 300, false); // 0 (padding off-screen)
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare const getVisibleMinimumPaddingFraction: (scrollOffset: number, layoutHeight: number, contentHeight: number, blankSpace: number, inverted: boolean) => number;
|
|
75
|
+
/**
|
|
76
|
+
* Compute how much of the minimum content padding absorbs the keyboard + extraContentPadding.
|
|
77
|
+
*
|
|
78
|
+
* @param blankSpace - Minimum inset floor.
|
|
79
|
+
* @param extraContentPadding - Extra content padding from external elements.
|
|
80
|
+
* @returns The portion of blankSpace that absorbs keyboard displacement.
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* getMinimumPaddingAbsorbed(500, 20); // 480
|
|
84
|
+
* getMinimumPaddingAbsorbed(0, 20); // 0
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare const getMinimumPaddingAbsorbed: (blankSpace: number, extraContentPadding: number) => number;
|
|
88
|
+
/**
|
|
89
|
+
* Compute the effective scroll displacement after minimum padding absorption.
|
|
90
|
+
*
|
|
91
|
+
* @param rawEffective - Raw effective keyboard height.
|
|
92
|
+
* @param minimumPaddingAbsorbed - Amount absorbed by minimum content padding.
|
|
93
|
+
* @returns The scroll displacement after subtracting the absorbed portion.
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts
|
|
96
|
+
* getScrollEffective(300, 200); // 100
|
|
97
|
+
* getScrollEffective(300, 400); // 0
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare const getScrollEffective: (rawEffective: number, minimumPaddingAbsorbed: number) => number;
|
|
101
|
+
/**
|
|
102
|
+
* Compute the clamped scroll target for non-inverted lists.
|
|
103
|
+
*
|
|
104
|
+
* @param offsetBeforeScroll - Scroll position before keyboard appeared.
|
|
105
|
+
* @param keyboardHeight - Current keyboard height (used for scroll displacement).
|
|
106
|
+
* @param contentHeight - Total height of the scrollable content.
|
|
107
|
+
* @param layoutHeight - Visible height of the scroll view.
|
|
108
|
+
* @param totalPaddingForMaxScroll - Total padding to use for maxScroll calculation. When provided, used instead of keyboardHeight for the scrollable range. Defaults to keyboardHeight.
|
|
109
|
+
* @returns Clamped scroll target between 0 and maxScroll.
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* clampedScrollTarget(100, 300, 1000, 800); // 400
|
|
113
|
+
* clampedScrollTarget(100, 100, 1000, 800, 500); // 200, maxScroll uses 500
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
export declare const clampedScrollTarget: (offsetBeforeScroll: number, keyboardHeight: number, contentHeight: number, layoutHeight: number, totalPaddingForMaxScroll?: number) => number;
|
|
117
|
+
/**
|
|
118
|
+
* Compute contentOffset.y for iOS lists.
|
|
119
|
+
*
|
|
120
|
+
* @param relativeScroll - Scroll position relative to current inset.
|
|
121
|
+
* @param keyboardHeight - Target keyboard height (used for scroll displacement).
|
|
122
|
+
* @param contentHeight - Total height of the scrollable content.
|
|
123
|
+
* @param layoutHeight - Visible height of the scroll view.
|
|
124
|
+
* @param inverted - Whether the list is inverted.
|
|
125
|
+
* @param totalPaddingForMaxScroll - Total padding to use for maxScroll calculation. When provided, used instead of keyboardHeight for the scrollable range. Defaults to keyboardHeight.
|
|
126
|
+
* @returns The absolute contentOffset.y to set.
|
|
127
|
+
* @example
|
|
128
|
+
* ```ts
|
|
129
|
+
* computeIOSContentOffset(100, 300, 1000, 800, false); // 400
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
export declare const computeIOSContentOffset: (relativeScroll: number, keyboardHeight: number, contentHeight: number, layoutHeight: number, inverted: boolean, totalPaddingForMaxScroll?: number) => number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UseChatKeyboardOptions, UseChatKeyboardReturn } from "./types";
|
|
2
|
+
import type { AnimatedRef } from "react-native-reanimated";
|
|
3
|
+
import type Reanimated from "react-native-reanimated";
|
|
4
|
+
/**
|
|
5
|
+
* Hook that manages keyboard-driven scrolling for chat-style scroll views.
|
|
6
|
+
* Calculates padding (extra scrollable space) and content shift values,
|
|
7
|
+
* using per-frame scrollTo updates (Android and other platforms).
|
|
8
|
+
*
|
|
9
|
+
* @param scrollViewRef - Animated ref to the scroll view.
|
|
10
|
+
* @param options - Configuration for inverted and keyboardLiftBehavior.
|
|
11
|
+
* @returns Shared values for padding and contentOffsetY (always `undefined`).
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const { padding } = useChatKeyboard(ref, { inverted: false, keyboardLiftBehavior: "always" });
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
declare function useChatKeyboard(scrollViewRef: AnimatedRef<Reanimated.ScrollView>, options: UseChatKeyboardOptions): UseChatKeyboardReturn;
|
|
18
|
+
export { useChatKeyboard };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { UseChatKeyboardOptions, UseChatKeyboardReturn } from "./types";
|
|
2
|
+
import type { AnimatedRef } from "react-native-reanimated";
|
|
3
|
+
import type Reanimated from "react-native-reanimated";
|
|
4
|
+
/**
|
|
5
|
+
* Hook that manages keyboard-driven scrolling for chat-style scroll views.
|
|
6
|
+
* Calculates padding (extra scrollable space) and content shift values,
|
|
7
|
+
* using iOS-specific strategy (contentOffset set once in onStart).
|
|
8
|
+
*
|
|
9
|
+
* @param scrollViewRef - Animated ref to the scroll view.
|
|
10
|
+
* @param options - Configuration for inverted and keyboardLiftBehavior.
|
|
11
|
+
* @returns Shared values for padding and contentOffsetY.
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const { padding, contentOffsetY } = useChatKeyboard(ref, {
|
|
15
|
+
* inverted: false,
|
|
16
|
+
* keyboardLiftBehavior: "always",
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare function useChatKeyboard(scrollViewRef: AnimatedRef<Reanimated.ScrollView>, options: UseChatKeyboardOptions): UseChatKeyboardReturn;
|
|
21
|
+
export { useChatKeyboard };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { LayoutChangeEvent } from "react-native";
|
|
2
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
3
|
+
type KeyboardLiftBehavior = "always" | "whenAtEnd" | "persistent" | "never";
|
|
4
|
+
type UseChatKeyboardOptions = {
|
|
5
|
+
inverted: boolean;
|
|
6
|
+
keyboardLiftBehavior: KeyboardLiftBehavior;
|
|
7
|
+
freeze: SharedValue<boolean>;
|
|
8
|
+
offset: number;
|
|
9
|
+
blankSpace: SharedValue<number>;
|
|
10
|
+
/** Extra content padding shared value — needed on iOS to correctly clamp contentOffset. */
|
|
11
|
+
extraContentPadding: SharedValue<number>;
|
|
12
|
+
};
|
|
13
|
+
type UseChatKeyboardReturn = {
|
|
14
|
+
/** Extra scrollable space (= keyboard height). Used as contentInset on iOS, contentInsetBottom/contentInsetTop on Android. */
|
|
15
|
+
padding: SharedValue<number>;
|
|
16
|
+
/** Raw keyboard height updated every frame in onMove. Used to force Reanimated commits on Fabric. */
|
|
17
|
+
currentHeight: SharedValue<number>;
|
|
18
|
+
/** Absolute Y content offset for iOS (set once in onStart). `undefined` on Android. */
|
|
19
|
+
contentOffsetY: SharedValue<number> | undefined;
|
|
20
|
+
/** Current vertical scroll offset. */
|
|
21
|
+
scroll: SharedValue<number>;
|
|
22
|
+
/** Visible viewport dimensions. */
|
|
23
|
+
layout: SharedValue<{
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
}>;
|
|
27
|
+
/** Total content dimensions. */
|
|
28
|
+
size: SharedValue<{
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
}>;
|
|
32
|
+
/** Callback to attach to ScrollView's onLayout prop to capture initial viewport dimensions. */
|
|
33
|
+
onLayout: (e: LayoutChangeEvent) => void;
|
|
34
|
+
/** Callback to attach to ScrollView's onContentSizeChange prop to capture initial content dimensions. */
|
|
35
|
+
onContentSizeChange: (w: number, h: number) => void;
|
|
36
|
+
};
|
|
37
|
+
export type { KeyboardLiftBehavior, UseChatKeyboardOptions, UseChatKeyboardReturn, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
2
|
+
type EndVisibleCallback = (visible: boolean) => void;
|
|
3
|
+
type Options = {
|
|
4
|
+
scroll: SharedValue<number>;
|
|
5
|
+
layout: SharedValue<{
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}>;
|
|
9
|
+
size: SharedValue<{
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}>;
|
|
13
|
+
inverted: boolean;
|
|
14
|
+
onEndVisible?: EndVisibleCallback;
|
|
15
|
+
};
|
|
16
|
+
export declare const useEndVisible: ({ scroll, layout, size, inverted, onEndVisible, }: Options) => void;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { KeyboardLiftBehavior } from "../useChatKeyboard/types";
|
|
2
|
+
import type { AnimatedRef, SharedValue } from "react-native-reanimated";
|
|
3
|
+
import type Reanimated from "react-native-reanimated";
|
|
4
|
+
type UseExtraContentPaddingOptions = {
|
|
5
|
+
scrollViewRef: AnimatedRef<Reanimated.ScrollView>;
|
|
6
|
+
extraContentPadding: SharedValue<number>;
|
|
7
|
+
/** Keyboard-only padding from useChatKeyboard — used to compute total padding for clamping. */
|
|
8
|
+
keyboardPadding: SharedValue<number>;
|
|
9
|
+
/** Minimum inset floor — used to absorb keyboard and extraContentPadding changes. */
|
|
10
|
+
blankSpace: SharedValue<number>;
|
|
11
|
+
/** Current vertical scroll offset. */
|
|
12
|
+
scroll: SharedValue<number>;
|
|
13
|
+
/** Visible viewport dimensions. */
|
|
14
|
+
layout: SharedValue<{
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
}>;
|
|
18
|
+
/** Total content dimensions. */
|
|
19
|
+
size: SharedValue<{
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
}>;
|
|
23
|
+
/** IOS only — when provided, sets contentOffset atomically with contentInset. */
|
|
24
|
+
contentOffsetY?: SharedValue<number>;
|
|
25
|
+
inverted: boolean;
|
|
26
|
+
keyboardLiftBehavior: KeyboardLiftBehavior;
|
|
27
|
+
freeze: SharedValue<boolean>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Hook that reacts to `extraContentPadding` changes and conditionally
|
|
31
|
+
* adjusts the scroll position using `scrollTo` on both iOS and Android.
|
|
32
|
+
*
|
|
33
|
+
* Padding extension (scrollable range) is handled externally via a
|
|
34
|
+
* `useDerivedValue` that sums keyboard padding + extra content padding.
|
|
35
|
+
* This hook only handles the scroll correction.
|
|
36
|
+
*
|
|
37
|
+
* @param options - Configuration and shared values.
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* useExtraContentPadding({ scrollViewRef, extraContentPadding, ... });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
declare function useExtraContentPadding(options: UseExtraContentPaddingOptions): void;
|
|
44
|
+
export { useExtraContentPadding };
|
|
45
|
+
export type { UseExtraContentPaddingOptions };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { KeyboardToolbarTheme } from "./types";
|
|
3
3
|
import type { PropsWithChildren } from "react";
|
|
4
|
-
import type { ViewStyle } from "react-native";
|
|
4
|
+
import type { GestureResponderEvent, ViewStyle } from "react-native";
|
|
5
5
|
type ButtonProps = {
|
|
6
6
|
disabled?: boolean;
|
|
7
|
-
onPress: () => void;
|
|
7
|
+
onPress: (event: GestureResponderEvent) => void;
|
|
8
8
|
accessibilityLabel: string;
|
|
9
9
|
accessibilityHint: string;
|
|
10
10
|
testID: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type Arrow from "../../Arrow";
|
|
2
|
+
import type Button from "../../Button";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import type { GestureResponderEvent, ViewStyle } from "react-native";
|
|
5
|
+
export type ButtonSubProps = {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
testID?: string;
|
|
10
|
+
rippleRadius?: number;
|
|
11
|
+
style?: ViewStyle;
|
|
12
|
+
button?: typeof Button;
|
|
13
|
+
icon?: typeof Arrow;
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { KeyboardToolbarTheme } from "../types";
|
|
2
|
+
type ToolbarContextType = {
|
|
3
|
+
theme: KeyboardToolbarTheme;
|
|
4
|
+
isPrevDisabled: boolean;
|
|
5
|
+
isNextDisabled: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const ToolbarContext: import("react").Context<ToolbarContextType | undefined>;
|
|
8
|
+
export declare const useToolbarContext: () => ToolbarContextType;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HEX } from "./types";
|
|
2
|
+
export declare const TEST_ID_KEYBOARD_TOOLBAR = "keyboard.toolbar";
|
|
3
|
+
export declare const TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = "keyboard.toolbar.previous";
|
|
4
|
+
export declare const TEST_ID_KEYBOARD_TOOLBAR_NEXT = "keyboard.toolbar.next";
|
|
5
|
+
export declare const TEST_ID_KEYBOARD_TOOLBAR_CONTENT = "keyboard.toolbar.content";
|
|
6
|
+
export declare const TEST_ID_KEYBOARD_TOOLBAR_DONE = "keyboard.toolbar.done";
|
|
7
|
+
export declare const KEYBOARD_TOOLBAR_HEIGHT = 42;
|
|
8
|
+
export declare const DEFAULT_OPACITY: HEX;
|
|
9
|
+
export declare const KEYBOARD_HAS_ROUNDED_CORNERS: boolean;
|
|
10
|
+
export declare const OPENED_OFFSET: number;
|
|
@@ -1,52 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import Button from "./Button";
|
|
2
|
+
import { RCTKeyboardToolbarGroupView } from "../../bindings";
|
|
4
3
|
import { colors } from "./colors";
|
|
5
|
-
import
|
|
6
|
-
import type {
|
|
7
|
-
import type { ReactNode } from "react";
|
|
8
|
-
import type { ViewProps } from "react-native";
|
|
9
|
-
export type KeyboardToolbarProps = Omit<ViewProps, "style" | "testID" | "children"> & {
|
|
10
|
-
/** An element that is shown in the middle of the toolbar. */
|
|
11
|
-
content?: JSX.Element | null;
|
|
12
|
-
/** A set of dark/light colors consumed by toolbar component. */
|
|
13
|
-
theme?: KeyboardToolbarTheme;
|
|
14
|
-
/** Custom text for done button. */
|
|
15
|
-
doneText?: ReactNode;
|
|
16
|
-
/** Custom touchable component for toolbar (used for prev/next/done buttons). */
|
|
17
|
-
button?: typeof Button;
|
|
18
|
-
/** Custom icon component used to display next/prev buttons. */
|
|
19
|
-
icon?: typeof Arrow;
|
|
20
|
-
/**
|
|
21
|
-
* Whether to show next and previous buttons. Can be useful to set it to `false` if you have only one input
|
|
22
|
-
* and want to show only `Done` button. Default to `true`.
|
|
23
|
-
*/
|
|
24
|
-
showArrows?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* A callback that is called when the user presses the next button along with the default action.
|
|
27
|
-
*/
|
|
28
|
-
onNextCallback?: () => void;
|
|
29
|
-
/**
|
|
30
|
-
* A callback that is called when the user presses the previous button along with the default action.
|
|
31
|
-
*/
|
|
32
|
-
onPrevCallback?: () => void;
|
|
33
|
-
/**
|
|
34
|
-
* A callback that is called when the user presses the done button along with the default action.
|
|
35
|
-
*/
|
|
36
|
-
onDoneCallback?: () => void;
|
|
37
|
-
/**
|
|
38
|
-
* A component that applies blur effect to the toolbar.
|
|
39
|
-
*/
|
|
40
|
-
blur?: JSX.Element | null;
|
|
41
|
-
/**
|
|
42
|
-
* A value for container opacity in hexadecimal format (e.g. `ff`). Default value is `ff`.
|
|
43
|
-
*/
|
|
44
|
-
opacity?: HEX;
|
|
45
|
-
} & Pick<KeyboardStickyViewProps, "offset" | "enabled">;
|
|
4
|
+
import { Background, Content, Done, Next, Prev } from "./compound/components";
|
|
5
|
+
import type { KeyboardToolbarProps } from "./types";
|
|
46
6
|
/**
|
|
47
7
|
* `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and
|
|
48
8
|
* `Done` buttons.
|
|
49
9
|
*/
|
|
50
|
-
declare const KeyboardToolbar: React.FC<KeyboardToolbarProps
|
|
51
|
-
|
|
10
|
+
declare const KeyboardToolbar: React.FC<KeyboardToolbarProps> & {
|
|
11
|
+
Background: typeof Background;
|
|
12
|
+
Content: typeof Content;
|
|
13
|
+
Prev: typeof Prev;
|
|
14
|
+
Next: typeof Next;
|
|
15
|
+
Done: typeof Done;
|
|
16
|
+
Group: typeof RCTKeyboardToolbarGroupView;
|
|
17
|
+
};
|
|
18
|
+
export { colors as DefaultKeyboardToolbarTheme, KeyboardToolbarProps };
|
|
52
19
|
export default KeyboardToolbar;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type Arrow from "./Arrow";
|
|
2
|
+
import type Button from "./Button";
|
|
3
|
+
import type { KeyboardStickyViewProps } from "../KeyboardStickyView";
|
|
4
|
+
import type { ReactNode } from "react";
|
|
5
|
+
import type { ColorValue, GestureResponderEvent, ViewProps } from "react-native";
|
|
2
6
|
type Theme = {
|
|
3
7
|
/** Color for arrow when it's enabled */
|
|
4
8
|
primary: ColorValue;
|
|
@@ -15,4 +19,23 @@ export type KeyboardToolbarTheme = {
|
|
|
15
19
|
};
|
|
16
20
|
type HexSymbol = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "A" | "B" | "C" | "D" | "E" | "F" | "a" | "b" | "c" | "d" | "e" | "f";
|
|
17
21
|
export type HEX = `${HexSymbol}${HexSymbol}`;
|
|
22
|
+
type SafeAreaInsets = {
|
|
23
|
+
left: number;
|
|
24
|
+
right: number;
|
|
25
|
+
};
|
|
26
|
+
export type KeyboardToolbarProps = Omit<ViewProps, "style" | "testID" | "children"> & {
|
|
27
|
+
content?: React.JSX.Element | null;
|
|
28
|
+
theme?: KeyboardToolbarTheme;
|
|
29
|
+
doneText?: ReactNode;
|
|
30
|
+
button?: typeof Button;
|
|
31
|
+
icon?: typeof Arrow;
|
|
32
|
+
showArrows?: boolean;
|
|
33
|
+
onNextCallback?: (event: GestureResponderEvent) => void;
|
|
34
|
+
onPrevCallback?: (event: GestureResponderEvent) => void;
|
|
35
|
+
onDoneCallback?: (event: GestureResponderEvent) => void;
|
|
36
|
+
blur?: React.JSX.Element | null;
|
|
37
|
+
opacity?: HEX;
|
|
38
|
+
insets?: SafeAreaInsets;
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
} & Pick<KeyboardStickyViewProps, "offset" | "enabled">;
|
|
18
41
|
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Reanimated from "react-native-reanimated";
|
|
3
|
+
import type { ScrollViewProps } from "react-native";
|
|
4
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
5
|
+
type AnimatedScrollViewProps = React.ComponentProps<typeof Reanimated.ScrollView>;
|
|
6
|
+
export type AnimatedScrollViewComponent = React.ForwardRefExoticComponent<AnimatedScrollViewProps & React.RefAttributes<Reanimated.ScrollView>>;
|
|
7
|
+
export type ScrollViewContentInsets = {
|
|
8
|
+
top: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
left: number;
|
|
11
|
+
right: number;
|
|
12
|
+
};
|
|
13
|
+
declare const ScrollViewWithBottomPadding: React.ForwardRefExoticComponent<{
|
|
14
|
+
ScrollViewComponent: AnimatedScrollViewComponent;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
inverted?: boolean;
|
|
17
|
+
bottomPadding: SharedValue<number>;
|
|
18
|
+
/** Padding for scroll indicator insets (excludes blankSpace). Falls back to bottomPadding when not provided. */
|
|
19
|
+
scrollIndicatorPadding?: SharedValue<number>;
|
|
20
|
+
/** Absolute Y content offset (iOS only, for KeyboardChatScrollView). */
|
|
21
|
+
contentOffsetY?: SharedValue<number>;
|
|
22
|
+
applyWorkaroundForContentInsetHitTestBug?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Fires whenever the effective content inset changes (combines the static `contentInset`
|
|
25
|
+
* prop with the dynamic keyboard-driven padding). Useful on Android where the synthetic
|
|
26
|
+
* inset is not reflected in `onScroll` events.
|
|
27
|
+
*/
|
|
28
|
+
onContentInsetChange?: (insets: ScrollViewContentInsets) => void;
|
|
29
|
+
} & ScrollViewProps & React.RefAttributes<Reanimated.ScrollView>>;
|
|
30
|
+
export default ScrollViewWithBottomPadding;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LayoutChangeEvent } from "react-native";
|
|
2
|
+
import type { AnimatedRef } from "react-native-reanimated";
|
|
3
|
+
import type Reanimated from "react-native-reanimated";
|
|
4
|
+
declare const useScrollState: (ref: AnimatedRef<Reanimated.ScrollView>) => {
|
|
5
|
+
offset: import("react-native-reanimated").SharedValue<number>;
|
|
6
|
+
layout: import("react-native-reanimated").SharedValue<{
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}>;
|
|
10
|
+
size: import("react-native-reanimated").SharedValue<{
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}>;
|
|
14
|
+
onLayout: (e: LayoutChangeEvent) => void;
|
|
15
|
+
onContentSizeChange: (w: number, h: number) => void;
|
|
16
|
+
};
|
|
17
|
+
export default useScrollState;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export { default as KeyboardAvoidingView } from "./KeyboardAvoidingView";
|
|
2
2
|
export { default as KeyboardStickyView } from "./KeyboardStickyView";
|
|
3
3
|
export { default as KeyboardAwareScrollView } from "./KeyboardAwareScrollView";
|
|
4
|
+
export { default as KeyboardChatScrollView } from "./KeyboardChatScrollView";
|
|
4
5
|
export { default as KeyboardToolbar, DefaultKeyboardToolbarTheme, } from "./KeyboardToolbar";
|
|
5
6
|
export type { KeyboardAvoidingViewProps } from "./KeyboardAvoidingView";
|
|
6
7
|
export type { KeyboardStickyViewProps } from "./KeyboardStickyView";
|
|
7
8
|
export type { KeyboardAwareScrollViewProps } from "./KeyboardAwareScrollView";
|
|
9
|
+
export type { KeyboardAwareScrollViewRef } from "./KeyboardAwareScrollView";
|
|
10
|
+
export type { KeyboardChatScrollViewProps } from "./KeyboardChatScrollView/types";
|
|
8
11
|
export type { KeyboardToolbarProps } from "./KeyboardToolbar";
|
|
@@ -15,6 +15,7 @@ export type KeyboardAnimationContext = {
|
|
|
15
15
|
animated: AnimatedContext;
|
|
16
16
|
reanimated: ReanimatedContext;
|
|
17
17
|
layout: SharedValue<FocusedInputLayoutChangedEvent | null>;
|
|
18
|
+
update: () => Promise<void>;
|
|
18
19
|
setKeyboardHandlers: (handlers: KeyboardHandlers) => void;
|
|
19
20
|
setInputHandlers: (handlers: FocusedInputHandlers) => void;
|
|
20
21
|
setEnabled: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -12,6 +12,8 @@ export declare function useKeyboardController(): {
|
|
|
12
12
|
};
|
|
13
13
|
export declare function useReanimatedFocusedInput(): {
|
|
14
14
|
input: import("react-native-reanimated").SharedValue<import("../types").FocusedInputLayoutChangedEvent | null>;
|
|
15
|
+
update: () => Promise<void>;
|
|
15
16
|
};
|
|
16
17
|
export declare function useFocusedInputHandler(handler?: FocusedInputHandler, deps?: DependencyList): void;
|
|
17
18
|
export * from "./useWindowDimensions";
|
|
19
|
+
export * from "./useKeyboardState";
|
|
@@ -5,6 +5,7 @@ export * from "./hooks";
|
|
|
5
5
|
export * from "./constants";
|
|
6
6
|
export * from "./module";
|
|
7
7
|
export * from "./types";
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export {
|
|
8
|
+
export * from "./compat";
|
|
9
|
+
export { KeyboardChatScrollView, KeyboardAvoidingView, KeyboardStickyView, KeyboardAwareScrollView, KeyboardToolbar, DefaultKeyboardToolbarTheme, } from "./components";
|
|
10
|
+
export type { KeyboardChatScrollViewProps, KeyboardAvoidingViewProps, KeyboardStickyViewProps, KeyboardAwareScrollViewProps, KeyboardAwareScrollViewRef, KeyboardToolbarProps, } from "./components";
|
|
11
|
+
export { OverKeyboardView, KeyboardExtender } from "./views";
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Animated } from "react-native";
|
|
2
|
+
import { findNodeHandle } from "./utils/findNodeHandle";
|
|
3
|
+
import type { EventHandlerProcessed } from "react-native-reanimated";
|
|
2
4
|
import type { Handlers } from "./types";
|
|
5
|
+
type ComponentOrHandle = Parameters<typeof findNodeHandle>[0];
|
|
6
|
+
export declare function useEventHandlerRegistration(viewTagRef: React.MutableRefObject<ComponentOrHandle>): (handler: EventHandlerProcessed<never, never>) => () => void;
|
|
3
7
|
type UntypedHandler = Record<string, (event: never) => void>;
|
|
4
8
|
type SharedHandlersReturnType<T extends UntypedHandler> = [
|
|
5
9
|
(handler: Handlers<T>) => void,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HostComponent } from "react-native";
|
|
2
|
+
import type { ViewProps } from "react-native";
|
|
3
|
+
import type { Double } from "react-native/Libraries/Types/CodegenTypes";
|
|
4
|
+
export interface NativeProps extends ViewProps {
|
|
5
|
+
contentInsetBottom: Double;
|
|
6
|
+
contentInsetTop: Double;
|
|
7
|
+
applyWorkaroundForContentInsetHitTestBug?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: HostComponent<NativeProps>;
|
|
10
|
+
export default _default;
|
|
@@ -50,5 +50,9 @@ export interface NativeProps extends ViewProps {
|
|
|
50
50
|
onFocusedInputTextChanged?: DirectEventHandler<FocusedInputTextChangedEvent>;
|
|
51
51
|
onFocusedInputSelectionChanged?: DirectEventHandler<FocusedInputSelectionChangedEvent>;
|
|
52
52
|
}
|
|
53
|
+
interface NativeCommands {
|
|
54
|
+
synchronizeFocusedInputLayout: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
55
|
+
}
|
|
56
|
+
export declare const Commands: NativeCommands;
|
|
53
57
|
declare const _default: HostComponent<NativeProps>;
|
|
54
58
|
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HostComponent } from "react-native";
|
|
2
|
+
import type { ViewProps } from "react-native/Libraries/Components/View/ViewPropTypes";
|
|
3
|
+
export interface NativeProps extends ViewProps {
|
|
4
|
+
}
|
|
5
|
+
declare const _default: HostComponent<NativeProps>;
|
|
6
|
+
export default _default;
|