@react-native-ohos/react-native-keyboard-controller 1.17.0-beta.2 → 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/LICENSE +21 -21
- package/README.OpenSource +11 -11
- package/README.md +686 -19
- package/harmony/keyboard_controller/BuildProfile.ets +16 -16
- package/harmony/keyboard_controller/Index.ets +29 -28
- package/harmony/keyboard_controller/build-profile.json5 +31 -31
- package/harmony/keyboard_controller/hvigorfile.ts +6 -6
- package/harmony/keyboard_controller/obfuscation-rules.txt +17 -17
- package/harmony/keyboard_controller/oh-package-lock.json5 +28 -18
- package/harmony/keyboard_controller/oh-package.json5 +10 -10
- package/harmony/keyboard_controller/src/main/cpp/CMakeLists.txt +7 -7
- 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/EventEmitters.cpp +119 -96
- package/harmony/keyboard_controller/src/main/cpp/EventEmitters.h +111 -111
- package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentDescriptor.h +94 -94
- package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.cpp +840 -288
- package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.h +169 -103
- package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewJSIBinder.h +65 -65
- package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentDescriptor.h +79 -79
- package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.cpp +108 -108
- package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.h +83 -83
- package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaJSIBinder.h +60 -60
- 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 +103 -46
- package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.h +48 -48
- package/harmony/keyboard_controller/src/main/cpp/RNKeyboardControllerPackage.h +20 -0
- package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.cpp +45 -45
- package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.h +49 -49
- package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.cpp +207 -186
- package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.h +131 -112
- package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.cpp +77 -64
- package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.h +85 -77
- package/harmony/keyboard_controller/src/main/ets/Logger.ts +66 -66
- package/harmony/keyboard_controller/src/main/ets/{RNKeyboardControllerPackage.ts → RNKeyboardControllerPackage.ets} +70 -66
- package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerTurboModule.ts +465 -273
- package/harmony/keyboard_controller/src/main/ets/RNStatusBarManagerCompatTurboModule.ts +128 -119
- package/harmony/keyboard_controller/src/main/ets/Type.ts +63 -62
- package/harmony/keyboard_controller/src/main/module.json5 +11 -11
- package/harmony/keyboard_controller/src/main/resources/base/element/string.json +8 -8
- package/harmony/keyboard_controller/src/main/resources/en_US/element/string.json +8 -8
- package/harmony/keyboard_controller/src/main/resources/zh_CN/element/string.json +8 -8
- package/harmony/keyboard_controller/{ts.ts → ts.ets} +29 -29
- package/harmony/keyboard_controller.har +0 -0
- package/lib/commonjs/animated.js +22 -11
- 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 +40 -5
- package/lib/commonjs/bindings.js.map +1 -1
- package/lib/commonjs/bindings.native.js +28 -5
- 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 +39 -14
- package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js +94 -57
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +5 -5
- package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/utils.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/KeyboardStickyView/index.js.map +1 -1
- 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/colors.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/colors.native.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 +98 -87
- 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.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/hooks/useWindowDimensions/index.android.js.map +1 -1
- package/lib/commonjs/hooks/useWindowDimensions/index.js.map +1 -1
- package/lib/commonjs/index.js +27 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal.js +54 -18
- 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/reanimated.js.map +1 -1
- package/lib/commonjs/reanimated.native.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/specs/NativeStatusBarManagerCompat.js.map +1 -1
- package/lib/commonjs/specs/OverKeyboardViewNativeComponent.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/utils.js.map +1 -1
- package/lib/commonjs/views/KeyboardExtender/index.js +30 -0
- package/lib/commonjs/views/KeyboardExtender/index.js.map +1 -0
- package/lib/commonjs/views/OverKeyboardView/index.js.map +1 -1
- package/lib/commonjs/views/index.js +7 -0
- package/lib/commonjs/views/index.js.map +1 -1
- package/lib/module/animated.js +24 -13
- 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 +39 -5
- package/lib/module/bindings.js.map +1 -1
- package/lib/module/bindings.native.js +27 -5
- 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 +38 -14
- package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/index.js +97 -60
- package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +5 -5
- package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/utils.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/KeyboardStickyView/index.js.map +1 -1
- 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/colors.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/colors.native.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 +98 -88
- 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.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/hooks/useWindowDimensions/index.android.js.map +1 -1
- package/lib/module/hooks/useWindowDimensions/index.js.map +1 -1
- package/lib/module/index.js +3 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal.js +53 -18
- 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/reanimated.js.map +1 -1
- package/lib/module/reanimated.native.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/specs/NativeStatusBarManagerCompat.js.map +1 -1
- package/lib/module/specs/OverKeyboardViewNativeComponent.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/utils.js.map +1 -1
- package/lib/module/views/KeyboardExtender/index.js +23 -0
- package/lib/module/views/KeyboardExtender/index.js.map +1 -0
- package/lib/module/views/OverKeyboardView/index.js.map +1 -1
- 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 +81 -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 +183 -174
- package/src/animated.tsx +248 -255
- package/src/architecture.ts +1 -0
- package/src/bindings.native.ts +97 -62
- package/src/bindings.ts +81 -42
- package/src/compat.ts +44 -0
- package/src/components/KeyboardAvoidingView/hooks.ts +130 -123
- package/src/components/KeyboardAvoidingView/index.tsx +232 -188
- package/src/components/KeyboardAwareScrollView/index.tsx +452 -389
- package/src/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +133 -133
- package/src/components/KeyboardAwareScrollView/utils.ts +41 -41
- 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/KeyboardStickyView/index.tsx +66 -66
- package/src/components/KeyboardToolbar/Arrow.tsx +80 -80
- package/src/components/KeyboardToolbar/Button.tsx +98 -98
- package/src/components/KeyboardToolbar/colors.native.ts +37 -37
- package/src/components/KeyboardToolbar/colors.ts +16 -16
- 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 +220 -223
- package/src/components/KeyboardToolbar/types.ts +72 -40
- package/src/components/ScrollViewWithBottomPadding/index.tsx +216 -0
- package/src/components/ScrollViewWithBottomPadding/styles.ts +10 -0
- package/src/components/hooks/useColorScheme.ts +6 -6
- package/src/components/hooks/useCombinedRef.ts +22 -0
- package/src/components/hooks/useScrollState.ts +81 -0
- package/src/components/index.ts +14 -11
- package/src/constants.ts +23 -19
- package/src/context.ts +70 -68
- package/src/hooks/index.ts +91 -90
- package/src/hooks/useKeyboardState/index.ts +52 -0
- package/src/hooks/useWindowDimensions/index.android.ts +38 -38
- package/src/hooks/useWindowDimensions/index.ts +1 -1
- package/src/index.ts +27 -23
- package/src/internal.ts +146 -84
- package/src/module.ts +64 -52
- package/src/reanimated.native.ts +132 -132
- package/src/reanimated.ts +29 -29
- package/src/specs/ClippingScrollViewDecoratorViewNativeComponent.ts +19 -0
- package/src/specs/KeyboardControllerViewNativeComponent.ts +82 -71
- package/src/specs/KeyboardGestureAreaNativeComponent.ts +21 -20
- package/src/specs/KeyboardToolbarGroupViewNativeComponent.ts +10 -0
- package/src/specs/NativeKeyboardController.ts +23 -19
- package/src/specs/NativeStatusBarManagerCompat.ts +14 -14
- package/src/specs/OverKeyboardViewNativeComponent.ts +12 -12
- package/src/types.ts +330 -243
- package/src/utils/findNodeHandle/index.native.ts +3 -0
- package/src/utils/findNodeHandle/index.ts +6 -0
- package/src/utils.ts +1 -1
- package/src/views/KeyboardExtender/index.tsx +30 -0
- package/src/views/OverKeyboardView/index.tsx +43 -43
- package/src/views/index.ts +2 -1
- 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
|
@@ -1,119 +1,128 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* MIT License
|
|
6
|
-
*
|
|
7
|
-
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
8
|
-
*
|
|
9
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
11
|
-
* in the Software without restriction, including without limitation the rights
|
|
12
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
-
* furnished to do so, subject to the following conditions:
|
|
15
|
-
*
|
|
16
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
17
|
-
* copies or substantial portions of the Software.
|
|
18
|
-
*
|
|
19
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
-
* SOFTWARE.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
import { TurboModule } from "@rnoh/react-native-openharmony/ts";
|
|
29
|
-
import window from '@ohos.window';
|
|
30
|
-
import common from '@ohos.app.ability.common';
|
|
31
|
-
import { BusinessError } from '@kit.BasicServicesKit';
|
|
32
|
-
import Logger from './Logger';
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
interface StatusBarManagerCompatSpec {
|
|
36
|
-
getConstants(): {};
|
|
37
|
-
setHidden(hidden: boolean): void;
|
|
38
|
-
setColor(color: number, animated: boolean): void;
|
|
39
|
-
setTranslucent(translucent: boolean): void;
|
|
40
|
-
setStyle(style: string): void;
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
export class RNStatusBarManagerCompatTurboModule extends TurboModule implements StatusBarManagerCompatSpec{
|
|
44
|
-
private context: common.UIAbilityContext;
|
|
45
|
-
constructor(ctx) {
|
|
46
|
-
super(ctx);
|
|
47
|
-
this.context = this.ctx.uiAbilityContext;
|
|
48
|
-
}
|
|
49
|
-
private async setWindowSystemBarProperties(properties:window.SystemBarProperties){
|
|
50
|
-
let windowInstance: window.Window | undefined = undefined;
|
|
51
|
-
windowInstance = await window.getLastWindow(this.context);
|
|
52
|
-
let systemBarProperty = windowInstance.getWindowSystemBarProperties();
|
|
53
|
-
let newSystemBarProperty: window.SystemBarProperties = {
|
|
54
|
-
...systemBarProperty,
|
|
55
|
-
...properties
|
|
56
|
-
};
|
|
57
|
-
try {
|
|
58
|
-
let promise = windowInstance.setWindowSystemBarProperties(newSystemBarProperty);
|
|
59
|
-
promise.then(() => {
|
|
60
|
-
Logger.info('Succeeded in setting the system bar properties.');
|
|
61
|
-
}).catch((err: BusinessError) => {
|
|
62
|
-
Logger.error(`Failed to set the system bar properties. Cause code: ${err.code}, message: ${err.message}`);
|
|
63
|
-
});
|
|
64
|
-
} catch (exception) {
|
|
65
|
-
Logger.error(`Failed to set the system bar properties. Cause code: ${exception.code}, message: ${exception.message}`);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
readonly getConstants:()=>{};
|
|
69
|
-
// set mode
|
|
70
|
-
async setHidden(hidden: boolean): Promise<void> {
|
|
71
|
-
Logger.info("###turboModule setHidden");
|
|
72
|
-
let windowInstance: window.Window | undefined = undefined;
|
|
73
|
-
windowInstance = await window.getLastWindow(this.context);
|
|
74
|
-
let names: Array<'status' | 'navigation'> = ['navigation'];
|
|
75
|
-
hidden && names.push('status');
|
|
76
|
-
try {
|
|
77
|
-
let promise = windowInstance.setWindowSystemBarEnable(names);
|
|
78
|
-
promise.then(() => {
|
|
79
|
-
Logger.info('Succeeded in setting the system bar to be invisible.');
|
|
80
|
-
}).catch((err: BusinessError) => {
|
|
81
|
-
Logger.error(`Failed to set the system bar to be invisible. Cause code: ${err.code}, message: ${err.message}`);
|
|
82
|
-
});
|
|
83
|
-
} catch (exception) {
|
|
84
|
-
Logger.error(`Failed to set the system bar to be invisible. Cause code: ${exception.code}, message: ${exception.message}`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
async setColor(color: number, animated: boolean): Promise<void> {
|
|
89
|
-
Logger.info("###turboModule setColor");
|
|
90
|
-
let newSystemBarProperty: window.SystemBarProperties = {
|
|
91
|
-
statusBarColor:
|
|
92
|
-
enableStatusBarAnimation:animated
|
|
93
|
-
};
|
|
94
|
-
this.setWindowSystemBarProperties(newSystemBarProperty)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
async setTranslucent(translucent: boolean): Promise<void> {
|
|
98
|
-
Logger.info("###turboModule setTranslucent");
|
|
99
|
-
let windowInstance: window.Window | undefined = undefined;
|
|
100
|
-
windowInstance = await window.getLastWindow(this.context);
|
|
101
|
-
let systemBarProperty = windowInstance.getWindowSystemBarProperties();
|
|
102
|
-
let newSystemBarProperty: window.SystemBarProperties = {
|
|
103
|
-
statusBarColor:translucent?'#00000000':systemBarProperty.statusBarColor,
|
|
104
|
-
};
|
|
105
|
-
this.setWindowSystemBarProperties(newSystemBarProperty)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
setStyle(style: 'dark-content'|'light-content'): void {
|
|
109
|
-
Logger.info("###turboModule setStyle");
|
|
110
|
-
let themeFlag= style == "dark-content"
|
|
111
|
-
let newSystemBarProperty: window.SystemBarProperties = {
|
|
112
|
-
statusBarContentColor:themeFlag?"#000000":"#ffffff",
|
|
113
|
-
};
|
|
114
|
-
this.setWindowSystemBarProperties(newSystemBarProperty)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* MIT License
|
|
6
|
+
*
|
|
7
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
* in the Software without restriction, including without limitation the rights
|
|
12
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
* furnished to do so, subject to the following conditions:
|
|
15
|
+
*
|
|
16
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
* copies or substantial portions of the Software.
|
|
18
|
+
*
|
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
* SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import { TurboModule } from "@rnoh/react-native-openharmony/ts";
|
|
29
|
+
import window from '@ohos.window';
|
|
30
|
+
import common from '@ohos.app.ability.common';
|
|
31
|
+
import { BusinessError } from '@kit.BasicServicesKit';
|
|
32
|
+
import Logger from './Logger';
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
interface StatusBarManagerCompatSpec {
|
|
36
|
+
getConstants(): {};
|
|
37
|
+
setHidden(hidden: boolean): void;
|
|
38
|
+
setColor(color: number, animated: boolean): void;
|
|
39
|
+
setTranslucent(translucent: boolean): void;
|
|
40
|
+
setStyle(style: string): void;
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
export class RNStatusBarManagerCompatTurboModule extends TurboModule implements StatusBarManagerCompatSpec{
|
|
44
|
+
private context: common.UIAbilityContext;
|
|
45
|
+
constructor(ctx) {
|
|
46
|
+
super(ctx);
|
|
47
|
+
this.context = this.ctx.uiAbilityContext;
|
|
48
|
+
}
|
|
49
|
+
private async setWindowSystemBarProperties(properties:window.SystemBarProperties){
|
|
50
|
+
let windowInstance: window.Window | undefined = undefined;
|
|
51
|
+
windowInstance = await window.getLastWindow(this.context);
|
|
52
|
+
let systemBarProperty = windowInstance.getWindowSystemBarProperties();
|
|
53
|
+
let newSystemBarProperty: window.SystemBarProperties = {
|
|
54
|
+
...systemBarProperty,
|
|
55
|
+
...properties
|
|
56
|
+
};
|
|
57
|
+
try {
|
|
58
|
+
let promise = windowInstance.setWindowSystemBarProperties(newSystemBarProperty);
|
|
59
|
+
promise.then(() => {
|
|
60
|
+
Logger.info('Succeeded in setting the system bar properties.');
|
|
61
|
+
}).catch((err: BusinessError) => {
|
|
62
|
+
Logger.error(`Failed to set the system bar properties. Cause code: ${err.code}, message: ${err.message}`);
|
|
63
|
+
});
|
|
64
|
+
} catch (exception) {
|
|
65
|
+
Logger.error(`Failed to set the system bar properties. Cause code: ${exception.code}, message: ${exception.message}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
readonly getConstants:()=>{};
|
|
69
|
+
// set mode
|
|
70
|
+
async setHidden(hidden: boolean): Promise<void> {
|
|
71
|
+
Logger.info("###turboModule setHidden");
|
|
72
|
+
let windowInstance: window.Window | undefined = undefined;
|
|
73
|
+
windowInstance = await window.getLastWindow(this.context);
|
|
74
|
+
let names: Array<'status' | 'navigation'> = ['navigation'];
|
|
75
|
+
hidden && names.push('status');
|
|
76
|
+
try {
|
|
77
|
+
let promise = windowInstance.setWindowSystemBarEnable(names);
|
|
78
|
+
promise.then(() => {
|
|
79
|
+
Logger.info('Succeeded in setting the system bar to be invisible.');
|
|
80
|
+
}).catch((err: BusinessError) => {
|
|
81
|
+
Logger.error(`Failed to set the system bar to be invisible. Cause code: ${err.code}, message: ${err.message}`);
|
|
82
|
+
});
|
|
83
|
+
} catch (exception) {
|
|
84
|
+
Logger.error(`Failed to set the system bar to be invisible. Cause code: ${exception.code}, message: ${exception.message}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async setColor(color: number, animated: boolean): Promise<void> {
|
|
89
|
+
Logger.info("###turboModule setColor");
|
|
90
|
+
let newSystemBarProperty: window.SystemBarProperties = {
|
|
91
|
+
statusBarColor: this.toHarmonyColor(color),
|
|
92
|
+
enableStatusBarAnimation:animated
|
|
93
|
+
};
|
|
94
|
+
this.setWindowSystemBarProperties(newSystemBarProperty)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async setTranslucent(translucent: boolean): Promise<void> {
|
|
98
|
+
Logger.info("###turboModule setTranslucent");
|
|
99
|
+
let windowInstance: window.Window | undefined = undefined;
|
|
100
|
+
windowInstance = await window.getLastWindow(this.context);
|
|
101
|
+
let systemBarProperty = windowInstance.getWindowSystemBarProperties();
|
|
102
|
+
let newSystemBarProperty: window.SystemBarProperties = {
|
|
103
|
+
statusBarColor:translucent?'#00000000':systemBarProperty.statusBarColor,
|
|
104
|
+
};
|
|
105
|
+
this.setWindowSystemBarProperties(newSystemBarProperty)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
setStyle(style: 'dark-content'|'light-content'): void {
|
|
109
|
+
Logger.info("###turboModule setStyle");
|
|
110
|
+
let themeFlag= style == "dark-content"
|
|
111
|
+
let newSystemBarProperty: window.SystemBarProperties = {
|
|
112
|
+
statusBarContentColor:themeFlag?"#000000":"#ffffff",
|
|
113
|
+
};
|
|
114
|
+
this.setWindowSystemBarProperties(newSystemBarProperty)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
private toHarmonyColor(color: number): string {
|
|
118
|
+
const unsignedColor = color >>> 0;
|
|
119
|
+
const hex = unsignedColor > 0xffffff
|
|
120
|
+
? unsignedColor.toString(16).padStart(8, '0')
|
|
121
|
+
: unsignedColor.toString(16).padStart(6, '0');
|
|
122
|
+
|
|
123
|
+
return `#${hex}`;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* MIT License
|
|
6
|
-
*
|
|
7
|
-
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
8
|
-
*
|
|
9
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
11
|
-
* in the Software without restriction, including without limitation the rights
|
|
12
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
-
* furnished to do so, subject to the following conditions:
|
|
15
|
-
*
|
|
16
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
17
|
-
* copies or substantial portions of the Software.
|
|
18
|
-
*
|
|
19
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
-
* SOFTWARE.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
export enum KeyboardControllerEventName {
|
|
29
|
-
KEYBOARD_WILL_SHOW="KeyboardController::keyboardWillShow",
|
|
30
|
-
KEYBOARD_DID_SHOW="KeyboardController::keyboardDidShow",
|
|
31
|
-
KEYBOARD_WILL_HIDE="KeyboardController::keyboardWillHide",
|
|
32
|
-
KEYBOARD_DID_HIDE="KeyboardController::keyboardDidHide",
|
|
33
|
-
FOCUS_DID_SET="KeyboardController::focusDidSet"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* MIT License
|
|
6
|
+
*
|
|
7
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
* in the Software without restriction, including without limitation the rights
|
|
12
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
* furnished to do so, subject to the following conditions:
|
|
15
|
+
*
|
|
16
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
* copies or substantial portions of the Software.
|
|
18
|
+
*
|
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
* SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
export enum KeyboardControllerEventName {
|
|
29
|
+
KEYBOARD_WILL_SHOW="KeyboardController::keyboardWillShow",
|
|
30
|
+
KEYBOARD_DID_SHOW="KeyboardController::keyboardDidShow",
|
|
31
|
+
KEYBOARD_WILL_HIDE="KeyboardController::keyboardWillHide",
|
|
32
|
+
KEYBOARD_DID_HIDE="KeyboardController::keyboardDidHide",
|
|
33
|
+
FOCUS_DID_SET="KeyboardController::focusDidSet",
|
|
34
|
+
LAYOUT_DID_SYNCHRONIZE="KeyboardController::layoutDidSynchronize"
|
|
35
|
+
}
|
|
36
|
+
export type KeyboardChangeResult = {
|
|
37
|
+
code:number;
|
|
38
|
+
message:string;
|
|
39
|
+
data:number | undefined
|
|
40
|
+
}
|
|
41
|
+
export type KeyboardEvent ={
|
|
42
|
+
height:number;
|
|
43
|
+
duration:number;
|
|
44
|
+
timestamp:number;
|
|
45
|
+
target:number;
|
|
46
|
+
}
|
|
47
|
+
export enum KeyboardStatusType {
|
|
48
|
+
HIDE = 0,
|
|
49
|
+
SHOW = 1
|
|
50
|
+
};
|
|
51
|
+
export type RawTouchPoint={
|
|
52
|
+
pointerId: number;
|
|
53
|
+
windowX: number;
|
|
54
|
+
windowY: number;
|
|
55
|
+
}
|
|
56
|
+
export type RawTouchEvent = {
|
|
57
|
+
action: number;
|
|
58
|
+
actionTouch: RawTouchPoint;
|
|
59
|
+
touchPoints: RawTouchPoint[];
|
|
60
|
+
sourceType: number;
|
|
61
|
+
timestamp: number;
|
|
62
|
+
rootTag:number;
|
|
63
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
{
|
|
2
|
-
"module": {
|
|
3
|
-
"name": "keyboard_controller",
|
|
4
|
-
"type": "har",
|
|
5
|
-
"deviceTypes": [
|
|
6
|
-
"default",
|
|
7
|
-
"tablet",
|
|
8
|
-
"2in1"
|
|
9
|
-
]
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"module": {
|
|
3
|
+
"name": "keyboard_controller",
|
|
4
|
+
"type": "har",
|
|
5
|
+
"deviceTypes": [
|
|
6
|
+
"default",
|
|
7
|
+
"tablet",
|
|
8
|
+
"2in1"
|
|
9
|
+
]
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"string": [
|
|
3
|
-
{
|
|
4
|
-
"name": "page_show",
|
|
5
|
-
"value": "page from package"
|
|
6
|
-
}
|
|
7
|
-
]
|
|
8
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"string": [
|
|
3
|
+
{
|
|
4
|
+
"name": "page_show",
|
|
5
|
+
"value": "page from package"
|
|
6
|
+
}
|
|
7
|
+
]
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"string": [
|
|
3
|
-
{
|
|
4
|
-
"name": "page_show",
|
|
5
|
-
"value": "page from package"
|
|
6
|
-
}
|
|
7
|
-
]
|
|
8
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"string": [
|
|
3
|
+
{
|
|
4
|
+
"name": "page_show",
|
|
5
|
+
"value": "page from package"
|
|
6
|
+
}
|
|
7
|
+
]
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"string": [
|
|
3
|
-
{
|
|
4
|
-
"name": "page_show",
|
|
5
|
-
"value": "page from package"
|
|
6
|
-
}
|
|
7
|
-
]
|
|
8
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"string": [
|
|
3
|
+
{
|
|
4
|
+
"name": "page_show",
|
|
5
|
+
"value": "page from package"
|
|
6
|
+
}
|
|
7
|
+
]
|
|
8
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* MIT License
|
|
6
|
-
*
|
|
7
|
-
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
8
|
-
*
|
|
9
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
11
|
-
* in the Software without restriction, including without limitation the rights
|
|
12
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
-
* furnished to do so, subject to the following conditions:
|
|
15
|
-
*
|
|
16
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
17
|
-
* copies or substantial portions of the Software.
|
|
18
|
-
*
|
|
19
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
-
* SOFTWARE.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
export * from './src/main/ets/RNKeyboardControllerPackage';
|
|
29
|
-
export * from './src/main/ets/RNKeyboardControllerTurboModule';
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* MIT License
|
|
6
|
+
*
|
|
7
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
* in the Software without restriction, including without limitation the rights
|
|
12
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
* furnished to do so, subject to the following conditions:
|
|
15
|
+
*
|
|
16
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
* copies or substantial portions of the Software.
|
|
18
|
+
*
|
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
* SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
export * from './src/main/ets/RNKeyboardControllerPackage';
|
|
29
|
+
export * from './src/main/ets/RNKeyboardControllerTurboModule';
|
|
30
30
|
export * from './src/main/ets/RNStatusBarManagerCompatTurboModule';
|
|
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
|
|
@@ -96,13 +109,13 @@ const KeyboardProvider = ({
|
|
|
96
109
|
"worklet";
|
|
97
110
|
|
|
98
111
|
broadcastKeyboardEvents("onMove", event);
|
|
99
|
-
updateSharedValues(event, ["android"]);
|
|
112
|
+
updateSharedValues(event, ["android", "harmony"]);
|
|
100
113
|
},
|
|
101
114
|
onKeyboardMoveEnd: event => {
|
|
102
115
|
"worklet";
|
|
103
116
|
|
|
104
117
|
broadcastKeyboardEvents("onEnd", event);
|
|
105
|
-
updateSharedValues(event, [
|
|
118
|
+
updateSharedValues(event, ["android", "harmony"]);
|
|
106
119
|
},
|
|
107
120
|
onKeyboardMoveInteractive: event => {
|
|
108
121
|
"worklet";
|
|
@@ -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,
|