one 2.19.0 → 2.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/One.podspec +2 -2
- package/android/build.gradle +2 -0
- package/android/portal/CMakeLists.txt +4 -1
- package/android/portal/react/renderer/components/OneNativeSpec/ComponentDescriptors.h +1 -0
- package/android/src/main/java/com/margelo/nitro/one/HybridOneKeyboard.kt +110 -0
- package/android/src/main/java/dev/onejs/keyboard/ClippingScrollViewDecoratorViewManager.kt +44 -0
- package/android/src/main/java/dev/onejs/keyboard/KeyboardBackgroundViewManager.kt +19 -0
- package/android/src/main/java/dev/onejs/keyboard/KeyboardControllerViewManager.kt +85 -0
- package/android/src/main/java/dev/onejs/keyboard/KeyboardGestureAreaViewManager.kt +65 -0
- package/android/src/main/java/dev/onejs/keyboard/KeyboardToolbarGroupViewManager.kt +19 -0
- package/android/src/main/java/dev/onejs/keyboard/LICENSE +21 -0
- package/android/src/main/java/dev/onejs/keyboard/OneKeyboardBridge.kt +9 -0
- package/android/src/main/java/dev/onejs/keyboard/OverKeyboardViewManager.kt +49 -0
- package/android/src/main/java/dev/onejs/keyboard/constants/Keyboard.kt +7 -0
- package/android/src/main/java/dev/onejs/keyboard/constants/UIThread.kt +9 -0
- package/android/src/main/java/dev/onejs/keyboard/events/FocusedInputLayoutChangedEvent.kt +52 -0
- package/android/src/main/java/dev/onejs/keyboard/events/FocusedInputSelectionChangedEvent.kt +56 -0
- package/android/src/main/java/dev/onejs/keyboard/events/FocusedInputTextChangedEvent.kt +25 -0
- package/android/src/main/java/dev/onejs/keyboard/events/KeyboardTransitionEvent.kt +44 -0
- package/android/src/main/java/dev/onejs/keyboard/extensions/Context.kt +58 -0
- package/android/src/main/java/dev/onejs/keyboard/extensions/EditText.kt +262 -0
- package/android/src/main/java/dev/onejs/keyboard/extensions/Float.kt +8 -0
- package/android/src/main/java/dev/onejs/keyboard/extensions/ReactContext.kt +37 -0
- package/android/src/main/java/dev/onejs/keyboard/extensions/ScrollView.kt +65 -0
- package/android/src/main/java/dev/onejs/keyboard/extensions/SoftInputMode.kt +13 -0
- package/android/src/main/java/dev/onejs/keyboard/extensions/ThemedReactContext.kt +56 -0
- package/android/src/main/java/dev/onejs/keyboard/extensions/View.kt +91 -0
- package/android/src/main/java/dev/onejs/keyboard/extensions/ViewGroup.kt +10 -0
- package/android/src/main/java/dev/onejs/keyboard/extensions/WindowInsetsAnimationCompat.kt +7 -0
- package/android/src/main/java/dev/onejs/keyboard/interactive/InteractiveKeyboardProvider.kt +5 -0
- package/android/src/main/java/dev/onejs/keyboard/interactive/KeyboardAnimationController.kt +407 -0
- package/android/src/main/java/dev/onejs/keyboard/interactive/interpolators/Interpolator.kt +20 -0
- package/android/src/main/java/dev/onejs/keyboard/interactive/interpolators/IosInterpolator.kt +21 -0
- package/android/src/main/java/dev/onejs/keyboard/interactive/interpolators/LinearInterpolator.kt +10 -0
- package/android/src/main/java/dev/onejs/keyboard/listeners/FocusedInputObserver.kt +200 -0
- package/android/src/main/java/dev/onejs/keyboard/listeners/KeyboardAnimationCallback.kt +505 -0
- package/android/src/main/java/dev/onejs/keyboard/listeners/WindowDimensionListener.kt +76 -0
- package/android/src/main/java/dev/onejs/keyboard/log/Logger.kt +28 -0
- package/android/src/main/java/dev/onejs/keyboard/managers/ClippingScrollViewDecoratorViewManagerImpl.kt +13 -0
- package/android/src/main/java/dev/onejs/keyboard/managers/KeyboardBackgroundViewManagerImpl.kt +13 -0
- package/android/src/main/java/dev/onejs/keyboard/managers/KeyboardControllerViewManagerImpl.kt +96 -0
- package/android/src/main/java/dev/onejs/keyboard/managers/KeyboardGestureAreaViewManagerImpl.kt +41 -0
- package/android/src/main/java/dev/onejs/keyboard/managers/KeyboardToolbarGroupViewManagerImpl.kt +13 -0
- package/android/src/main/java/dev/onejs/keyboard/managers/OverKeyboardViewManagerImpl.kt +23 -0
- package/android/src/main/java/dev/onejs/keyboard/modal/ModalAttachedWatcher.kt +116 -0
- package/android/src/main/java/dev/onejs/keyboard/modules/KeyboardControllerModuleImpl.kt +139 -0
- package/android/src/main/java/dev/onejs/keyboard/traversal/FocusedInputHolder.kt +19 -0
- package/android/src/main/java/dev/onejs/keyboard/traversal/ViewHierarchyNavigator.kt +130 -0
- package/android/src/main/java/dev/onejs/keyboard/views/ClippingScrollViewDecoratorView.kt +241 -0
- package/android/src/main/java/dev/onejs/keyboard/views/EdgeToEdgeReactViewGroup.kt +225 -0
- package/android/src/main/java/dev/onejs/keyboard/views/KeyboardGestureAreaReactViewGroup.kt +247 -0
- package/android/src/main/java/dev/onejs/keyboard/views/KeyboardToolbarGroupReactViewGroup.kt +13 -0
- package/android/src/main/java/dev/onejs/keyboard/views/background/KeyboardBackgroundViewGroup.kt +34 -0
- package/android/src/main/java/dev/onejs/keyboard/views/background/Skins.kt +91 -0
- package/android/src/main/java/dev/onejs/keyboard/views/overlay/JSPointerDispatcherCompat.kt +74 -0
- package/android/src/main/java/dev/onejs/keyboard/views/overlay/OverKeyboardHostShadowNode.kt +33 -0
- package/android/src/main/java/dev/onejs/keyboard/views/overlay/OverKeyboardViewGroup.kt +249 -0
- package/android/src/main/java/dev/onejs/keyboard/views/overlay/RootViewCompat.kt +18 -0
- package/android/src/main/java/dev/onejs/one/OnePackage.kt +12 -0
- package/android/src/main/res/values/one_keyboard_attrs.xml +7 -0
- package/android/src/main/res/values/one_keyboard_skins.xml +35 -0
- package/android/src/main/res/values-v29/one_keyboard_skins.xml +5 -0
- package/android/src/main/res/values-v30/one_keyboard_skins.xml +17 -0
- package/android/src/main/res/values-v33/one_keyboard_skins.xml +14 -0
- package/android/src/main/res/values-v34/one_keyboard_skins.xml +18 -0
- package/android/src/main/res/values-v35/one_keyboard_skins.xml +10 -0
- package/cpp/OneOverKeyboardViewComponentDescriptor.h +31 -0
- package/cpp/OneOverKeyboardViewShadowNode.cpp +7 -0
- package/cpp/OneOverKeyboardViewShadowNode.h +23 -0
- package/cpp/OneOverKeyboardViewState.cpp +12 -0
- package/cpp/OneOverKeyboardViewState.h +43 -0
- package/dist/cjs/keyboard/animated.cjs +154 -0
- package/dist/cjs/keyboard/animated.native.cjs +168 -0
- package/dist/cjs/keyboard/animated.native.js +170 -0
- package/dist/cjs/keyboard/animated.native.js.map +1 -0
- package/dist/cjs/keyboard/architecture.cjs +25 -0
- package/dist/cjs/keyboard/architecture.native.cjs +27 -0
- package/dist/cjs/keyboard/architecture.native.js +29 -0
- package/dist/cjs/keyboard/architecture.native.js.map +1 -0
- package/dist/cjs/keyboard/bindings.cjs +65 -0
- package/dist/cjs/keyboard/bindings.native.cjs +147 -0
- package/dist/cjs/keyboard/bindings.native.js +149 -0
- package/dist/cjs/keyboard/bindings.native.js.map +1 -0
- package/dist/cjs/keyboard/compat.cjs +63 -0
- package/dist/cjs/keyboard/compat.native.cjs +65 -0
- package/dist/cjs/keyboard/compat.native.js +67 -0
- package/dist/cjs/keyboard/compat.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardAvoidingView/hooks.cjs +144 -0
- package/dist/cjs/keyboard/components/KeyboardAvoidingView/hooks.native.cjs +146 -0
- package/dist/cjs/keyboard/components/KeyboardAvoidingView/hooks.native.js +148 -0
- package/dist/cjs/keyboard/components/KeyboardAvoidingView/hooks.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardAvoidingView/index.cjs +156 -0
- package/dist/cjs/keyboard/components/KeyboardAvoidingView/index.native.cjs +173 -0
- package/dist/cjs/keyboard/components/KeyboardAvoidingView/index.native.js +175 -0
- package/dist/cjs/keyboard/components/KeyboardAvoidingView/index.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/index.cjs +326 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/index.native.cjs +344 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/index.native.js +346 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/index.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/types.cjs +17 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/types.native.cjs +19 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/types.native.js +21 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/types.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.cjs +100 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.native.cjs +110 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.native.js +112 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/utils.cjs +50 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/utils.native.cjs +58 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/utils.native.js +60 -0
- package/dist/cjs/keyboard/components/KeyboardAwareScrollView/utils.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/hooks.cjs +25 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/hooks.native.cjs +27 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/hooks.native.js +29 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/hooks.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/index.cjs +118 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/index.native.cjs +133 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/index.native.js +135 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/index.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/types.cjs +17 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/types.native.cjs +19 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/types.native.js +21 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/types.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/helpers.cjs +93 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/helpers.native.cjs +97 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/helpers.native.js +99 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/helpers.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.cjs +210 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.ios.cjs +145 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js +147 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.native.cjs +212 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.native.js +214 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/types.cjs +17 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/types.native.cjs +19 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/types.native.js +21 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useChatKeyboard/types.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useEndVisible.cjs +52 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useEndVisible.native.cjs +61 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useEndVisible.native.js +63 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useEndVisible.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useExtraContentPadding/index.cjs +92 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useExtraContentPadding/index.native.cjs +96 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useExtraContentPadding/index.native.js +98 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useExtraContentPadding/index.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useFrozenPadding/index.cjs +53 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useFrozenPadding/index.native.cjs +58 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useFrozenPadding/index.native.js +60 -0
- package/dist/cjs/keyboard/components/KeyboardChatScrollView/useFrozenPadding/index.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardEffects/index.cjs +94 -0
- package/dist/cjs/keyboard/components/KeyboardEffects/index.native.cjs +99 -0
- package/dist/cjs/keyboard/components/KeyboardEffects/index.native.js +101 -0
- package/dist/cjs/keyboard/components/KeyboardEffects/index.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardStickyView/index.cjs +54 -0
- package/dist/cjs/keyboard/components/KeyboardStickyView/index.native.cjs +59 -0
- package/dist/cjs/keyboard/components/KeyboardStickyView/index.native.js +61 -0
- package/dist/cjs/keyboard/components/KeyboardStickyView/index.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/Arrow.cjs +82 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/Arrow.native.cjs +99 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/Arrow.native.js +101 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/Arrow.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/Button.cjs +71 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/Button.native.cjs +89 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/Button.native.js +91 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/Button.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/colors.cjs +38 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/colors.native.cjs +59 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/colors.native.js +61 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/colors.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Background.cjs +27 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Background.native.cjs +39 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Background.native.js +41 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Background.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Content.cjs +36 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Content.native.cjs +46 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Content.native.js +48 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Content.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Done.cjs +75 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Done.native.cjs +84 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Done.native.js +86 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Done.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Next.cjs +64 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Next.native.cjs +67 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Next.native.js +69 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Next.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Prev.cjs +64 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Prev.native.cjs +68 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Prev.native.js +70 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/Prev.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/index.cjs +41 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/index.native.cjs +43 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/index.native.js +45 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/index.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/types.cjs +17 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/types.native.cjs +19 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/types.native.js +21 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/components/types.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/context.cjs +36 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/context.native.cjs +38 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/context.native.js +40 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/compound/context.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/constants.cjs +42 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/constants.native.cjs +44 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/constants.native.js +46 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/constants.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/index.cjs +202 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/index.native.cjs +215 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/index.native.js +217 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/index.native.js.map +1 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/types.cjs +17 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/types.native.cjs +19 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/types.native.js +21 -0
- package/dist/cjs/keyboard/components/KeyboardToolbar/types.native.js.map +1 -0
- package/dist/cjs/keyboard/components/ScrollViewWithBottomPadding/index.cjs +127 -0
- package/dist/cjs/keyboard/components/ScrollViewWithBottomPadding/index.native.cjs +134 -0
- package/dist/cjs/keyboard/components/ScrollViewWithBottomPadding/index.native.js +136 -0
- package/dist/cjs/keyboard/components/ScrollViewWithBottomPadding/index.native.js.map +1 -0
- package/dist/cjs/keyboard/components/ScrollViewWithBottomPadding/styles.cjs +30 -0
- package/dist/cjs/keyboard/components/ScrollViewWithBottomPadding/styles.native.cjs +32 -0
- package/dist/cjs/keyboard/components/ScrollViewWithBottomPadding/styles.native.js +34 -0
- package/dist/cjs/keyboard/components/ScrollViewWithBottomPadding/styles.native.js.map +1 -0
- package/dist/cjs/keyboard/components/hooks/useCombinedRef.cjs +40 -0
- package/dist/cjs/keyboard/components/hooks/useCombinedRef.native.cjs +62 -0
- package/dist/cjs/keyboard/components/hooks/useCombinedRef.native.js +64 -0
- package/dist/cjs/keyboard/components/hooks/useCombinedRef.native.js.map +1 -0
- package/dist/cjs/keyboard/components/hooks/useScrollState.cjs +78 -0
- package/dist/cjs/keyboard/components/hooks/useScrollState.native.cjs +81 -0
- package/dist/cjs/keyboard/components/hooks/useScrollState.native.js +83 -0
- package/dist/cjs/keyboard/components/hooks/useScrollState.native.js.map +1 -0
- package/dist/cjs/keyboard/components/index.cjs +44 -0
- package/dist/cjs/keyboard/components/index.native.cjs +46 -0
- package/dist/cjs/keyboard/components/index.native.js +48 -0
- package/dist/cjs/keyboard/components/index.native.js.map +1 -0
- package/dist/cjs/keyboard/components/utils/safeScrollTo.cjs +33 -0
- package/dist/cjs/keyboard/components/utils/safeScrollTo.native.cjs +35 -0
- package/dist/cjs/keyboard/components/utils/safeScrollTo.native.js +37 -0
- package/dist/cjs/keyboard/components/utils/safeScrollTo.native.js.map +1 -0
- package/dist/cjs/keyboard/constants.cjs +48 -0
- package/dist/cjs/keyboard/constants.native.cjs +50 -0
- package/dist/cjs/keyboard/constants.native.js +52 -0
- package/dist/cjs/keyboard/constants.native.js.map +1 -0
- package/dist/cjs/keyboard/context.cjs +65 -0
- package/dist/cjs/keyboard/context.native.cjs +73 -0
- package/dist/cjs/keyboard/context.native.js +75 -0
- package/dist/cjs/keyboard/context.native.js.map +1 -0
- package/dist/cjs/keyboard/hooks/index.cjs +121 -0
- package/dist/cjs/keyboard/hooks/index.native.cjs +135 -0
- package/dist/cjs/keyboard/hooks/index.native.js +137 -0
- package/dist/cjs/keyboard/hooks/index.native.js.map +1 -0
- package/dist/cjs/keyboard/hooks/useKeyboardState/index.cjs +44 -0
- package/dist/cjs/keyboard/hooks/useKeyboardState/index.native.cjs +59 -0
- package/dist/cjs/keyboard/hooks/useKeyboardState/index.native.js +61 -0
- package/dist/cjs/keyboard/hooks/useKeyboardState/index.native.js.map +1 -0
- package/dist/cjs/keyboard/hooks/useWindowDimensions/index.cjs +48 -0
- package/dist/cjs/keyboard/hooks/useWindowDimensions/index.native.cjs +50 -0
- package/dist/cjs/keyboard/hooks/useWindowDimensions/index.native.js +52 -0
- package/dist/cjs/keyboard/hooks/useWindowDimensions/index.native.js.map +1 -0
- package/dist/cjs/keyboard/index.cjs +45 -0
- package/dist/cjs/keyboard/index.native.cjs +47 -0
- package/dist/cjs/keyboard/index.native.js +49 -0
- package/dist/cjs/keyboard/index.native.js.map +1 -0
- package/dist/cjs/keyboard/internal.cjs +77 -0
- package/dist/cjs/keyboard/internal.native.cjs +79 -0
- package/dist/cjs/keyboard/internal.native.js +81 -0
- package/dist/cjs/keyboard/internal.native.js.map +1 -0
- package/dist/cjs/keyboard/module.cjs +72 -0
- package/dist/cjs/keyboard/module.native.cjs +79 -0
- package/dist/cjs/keyboard/module.native.js +81 -0
- package/dist/cjs/keyboard/module.native.js.map +1 -0
- package/dist/cjs/keyboard/reanimated.cjs +36 -0
- package/dist/cjs/keyboard/reanimated.native.cjs +84 -0
- package/dist/cjs/keyboard/reanimated.native.js +86 -0
- package/dist/cjs/keyboard/reanimated.native.js.map +1 -0
- package/dist/cjs/keyboard/typings/hooks.cjs +17 -0
- package/dist/cjs/keyboard/typings/hooks.native.cjs +19 -0
- package/dist/cjs/keyboard/typings/hooks.native.js +21 -0
- package/dist/cjs/keyboard/typings/hooks.native.js.map +1 -0
- package/dist/cjs/keyboard/typings/index.cjs +23 -0
- package/dist/cjs/keyboard/typings/index.native.cjs +25 -0
- package/dist/cjs/keyboard/typings/index.native.js +27 -0
- package/dist/cjs/keyboard/typings/index.native.js.map +1 -0
- package/dist/cjs/keyboard/typings/internal.cjs +17 -0
- package/dist/cjs/keyboard/typings/internal.native.cjs +19 -0
- package/dist/cjs/keyboard/typings/internal.native.js +21 -0
- package/dist/cjs/keyboard/typings/internal.native.js.map +1 -0
- package/dist/cjs/keyboard/typings/module.cjs +17 -0
- package/dist/cjs/keyboard/typings/module.native.cjs +19 -0
- package/dist/cjs/keyboard/typings/module.native.js +21 -0
- package/dist/cjs/keyboard/typings/module.native.js.map +1 -0
- package/dist/cjs/keyboard/typings/provider.cjs +17 -0
- package/dist/cjs/keyboard/typings/provider.native.cjs +19 -0
- package/dist/cjs/keyboard/typings/provider.native.js +21 -0
- package/dist/cjs/keyboard/typings/provider.native.js.map +1 -0
- package/dist/cjs/keyboard/typings/views.cjs +17 -0
- package/dist/cjs/keyboard/typings/views.native.cjs +19 -0
- package/dist/cjs/keyboard/typings/views.native.js +21 -0
- package/dist/cjs/keyboard/typings/views.native.js.map +1 -0
- package/dist/cjs/keyboard/utils/findNodeHandle/index.cjs +25 -0
- package/dist/cjs/keyboard/utils/findNodeHandle/index.native.cjs +27 -0
- package/dist/cjs/keyboard/utils/findNodeHandle/index.native.js +29 -0
- package/dist/cjs/keyboard/utils/findNodeHandle/index.native.js.map +1 -0
- package/dist/cjs/keyboard/views/KeyboardExtender/index.cjs +48 -0
- package/dist/cjs/keyboard/views/KeyboardExtender/index.ios.cjs +50 -0
- package/dist/cjs/keyboard/views/KeyboardExtender/index.ios.js +52 -0
- package/dist/cjs/keyboard/views/KeyboardExtender/index.ios.js.map +1 -0
- package/dist/cjs/keyboard/views/KeyboardExtender/index.native.cjs +57 -0
- package/dist/cjs/keyboard/views/KeyboardExtender/index.native.js +59 -0
- package/dist/cjs/keyboard/views/KeyboardExtender/index.native.js.map +1 -0
- package/dist/cjs/keyboard/views/OverKeyboardView/index.cjs +60 -0
- package/dist/cjs/keyboard/views/OverKeyboardView/index.native.cjs +72 -0
- package/dist/cjs/keyboard/views/OverKeyboardView/index.native.js +74 -0
- package/dist/cjs/keyboard/views/OverKeyboardView/index.native.js.map +1 -0
- package/dist/cjs/keyboard/views/index.cjs +35 -0
- package/dist/cjs/keyboard/views/index.native.cjs +37 -0
- package/dist/cjs/keyboard/views/index.native.js +39 -0
- package/dist/cjs/keyboard/views/index.native.js.map +1 -0
- package/dist/cjs/keyboard.cjs +19 -0
- package/dist/cjs/keyboard.native.cjs +21 -0
- package/dist/cjs/keyboard.native.js +23 -0
- package/dist/cjs/keyboard.native.js.map +1 -0
- package/dist/cjs/platform/specs/OneClippingScrollViewDecoratorViewNativeComponent.cjs +34 -0
- package/dist/cjs/platform/specs/OneClippingScrollViewDecoratorViewNativeComponent.native.cjs +34 -0
- package/dist/cjs/platform/specs/OneClippingScrollViewDecoratorViewNativeComponent.native.js +35 -0
- package/dist/cjs/platform/specs/OneClippingScrollViewDecoratorViewNativeComponent.native.js.map +7 -0
- package/dist/cjs/platform/specs/OneKeyboard.nitro.cjs +17 -0
- package/dist/cjs/platform/specs/OneKeyboard.nitro.native.cjs +19 -0
- package/dist/cjs/platform/specs/OneKeyboard.nitro.native.js +21 -0
- package/dist/cjs/platform/specs/OneKeyboard.nitro.native.js.map +1 -0
- package/dist/cjs/platform/specs/OneKeyboardBackgroundViewNativeComponent.cjs +30 -0
- package/dist/cjs/platform/specs/OneKeyboardBackgroundViewNativeComponent.native.cjs +30 -0
- package/dist/cjs/platform/specs/OneKeyboardBackgroundViewNativeComponent.native.js +31 -0
- package/dist/cjs/platform/specs/OneKeyboardBackgroundViewNativeComponent.native.js.map +7 -0
- package/dist/cjs/platform/specs/OneKeyboardControllerViewNativeComponent.cjs +79 -0
- package/dist/cjs/platform/specs/OneKeyboardControllerViewNativeComponent.native.cjs +79 -0
- package/dist/cjs/platform/specs/OneKeyboardControllerViewNativeComponent.native.js +80 -0
- package/dist/cjs/platform/specs/OneKeyboardControllerViewNativeComponent.native.js.map +7 -0
- package/dist/cjs/platform/specs/OneKeyboardExtenderNativeComponent.cjs +33 -0
- package/dist/cjs/platform/specs/OneKeyboardExtenderNativeComponent.native.cjs +33 -0
- package/dist/cjs/platform/specs/OneKeyboardExtenderNativeComponent.native.js +34 -0
- package/dist/cjs/platform/specs/OneKeyboardExtenderNativeComponent.native.js.map +7 -0
- package/dist/cjs/platform/specs/OneKeyboardGestureAreaNativeComponent.cjs +36 -0
- package/dist/cjs/platform/specs/OneKeyboardGestureAreaNativeComponent.native.cjs +36 -0
- package/dist/cjs/platform/specs/OneKeyboardGestureAreaNativeComponent.native.js +37 -0
- package/dist/cjs/platform/specs/OneKeyboardGestureAreaNativeComponent.native.js.map +7 -0
- package/dist/cjs/platform/specs/OneKeyboardToolbarGroupViewNativeComponent.cjs +30 -0
- package/dist/cjs/platform/specs/OneKeyboardToolbarGroupViewNativeComponent.native.cjs +30 -0
- package/dist/cjs/platform/specs/OneKeyboardToolbarGroupViewNativeComponent.native.js +31 -0
- package/dist/cjs/platform/specs/OneKeyboardToolbarGroupViewNativeComponent.native.js.map +7 -0
- package/dist/cjs/platform/specs/OneOverKeyboardViewNativeComponent.cjs +32 -0
- package/dist/cjs/platform/specs/OneOverKeyboardViewNativeComponent.native.cjs +32 -0
- package/dist/cjs/platform/specs/OneOverKeyboardViewNativeComponent.native.js +33 -0
- package/dist/cjs/platform/specs/OneOverKeyboardViewNativeComponent.native.js.map +7 -0
- package/dist/esm/keyboard/animated.mjs +135 -0
- package/dist/esm/keyboard/animated.mjs.map +1 -0
- package/dist/esm/keyboard/animated.native.js +141 -0
- package/dist/esm/keyboard/animated.native.js.map +1 -0
- package/dist/esm/keyboard/architecture.mjs +5 -0
- package/dist/esm/keyboard/architecture.mjs.map +1 -0
- package/dist/esm/keyboard/architecture.native.js +5 -0
- package/dist/esm/keyboard/architecture.native.js.map +1 -0
- package/dist/esm/keyboard/bindings.mjs +33 -0
- package/dist/esm/keyboard/bindings.mjs.map +1 -0
- package/dist/esm/keyboard/bindings.native.js +107 -0
- package/dist/esm/keyboard/bindings.native.js.map +1 -0
- package/dist/esm/keyboard/compat.mjs +41 -0
- package/dist/esm/keyboard/compat.mjs.map +1 -0
- package/dist/esm/keyboard/compat.native.js +41 -0
- package/dist/esm/keyboard/compat.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardAvoidingView/hooks.mjs +122 -0
- package/dist/esm/keyboard/components/KeyboardAvoidingView/hooks.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardAvoidingView/hooks.native.js +122 -0
- package/dist/esm/keyboard/components/KeyboardAvoidingView/hooks.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardAvoidingView/index.mjs +131 -0
- package/dist/esm/keyboard/components/KeyboardAvoidingView/index.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardAvoidingView/index.native.js +146 -0
- package/dist/esm/keyboard/components/KeyboardAvoidingView/index.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/index.mjs +301 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/index.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/index.native.js +317 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/index.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/types.mjs +0 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/types.native.js +0 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.mjs +81 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.native.js +89 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/utils.mjs +27 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/utils.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/utils.native.js +33 -0
- package/dist/esm/keyboard/components/KeyboardAwareScrollView/utils.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/hooks.mjs +3 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/hooks.native.js +3 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/index.mjs +92 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/index.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/index.native.js +105 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/index.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/types.mjs +0 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/types.native.js +0 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useChatKeyboard/helpers.mjs +65 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useChatKeyboard/helpers.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useChatKeyboard/helpers.native.js +67 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useChatKeyboard/helpers.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js +118 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.mjs +185 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.native.js +185 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useChatKeyboard/types.mjs +0 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useChatKeyboard/types.native.js +0 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useEndVisible.mjs +33 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useEndVisible.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useEndVisible.native.js +40 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useEndVisible.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useExtraContentPadding/index.mjs +73 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useExtraContentPadding/index.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useExtraContentPadding/index.native.js +75 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useExtraContentPadding/index.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useFrozenPadding/index.mjs +34 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useFrozenPadding/index.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useFrozenPadding/index.native.js +37 -0
- package/dist/esm/keyboard/components/KeyboardChatScrollView/useFrozenPadding/index.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardEffects/index.mjs +69 -0
- package/dist/esm/keyboard/components/KeyboardEffects/index.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardEffects/index.native.js +72 -0
- package/dist/esm/keyboard/components/KeyboardEffects/index.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardStickyView/index.mjs +29 -0
- package/dist/esm/keyboard/components/KeyboardStickyView/index.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardStickyView/index.native.js +32 -0
- package/dist/esm/keyboard/components/KeyboardStickyView/index.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/Arrow.mjs +63 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/Arrow.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/Arrow.native.js +72 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/Arrow.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/Button.mjs +52 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/Button.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/Button.native.js +62 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/Button.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/colors.mjs +18 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/colors.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/colors.native.js +38 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/colors.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Background.mjs +8 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Background.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Background.native.js +12 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Background.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Content.mjs +17 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Content.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Content.native.js +19 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Content.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Done.mjs +50 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Done.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Done.native.js +56 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Done.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Next.mjs +39 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Next.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Next.native.js +40 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Next.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Prev.mjs +39 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Prev.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Prev.native.js +40 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/Prev.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/index.mjs +7 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/index.native.js +7 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/types.mjs +0 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/components/types.native.js +0 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/context.mjs +14 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/context.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/context.native.js +14 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/compound/context.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/constants.mjs +14 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/constants.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/constants.native.js +14 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/constants.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/index.mjs +174 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/index.mjs.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/index.native.js +185 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/index.native.js.map +1 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/types.mjs +0 -0
- package/dist/esm/keyboard/components/KeyboardToolbar/types.native.js +0 -0
- package/dist/esm/keyboard/components/ScrollViewWithBottomPadding/index.mjs +102 -0
- package/dist/esm/keyboard/components/ScrollViewWithBottomPadding/index.mjs.map +1 -0
- package/dist/esm/keyboard/components/ScrollViewWithBottomPadding/index.native.js +107 -0
- package/dist/esm/keyboard/components/ScrollViewWithBottomPadding/index.native.js.map +1 -0
- package/dist/esm/keyboard/components/ScrollViewWithBottomPadding/styles.mjs +11 -0
- package/dist/esm/keyboard/components/ScrollViewWithBottomPadding/styles.mjs.map +1 -0
- package/dist/esm/keyboard/components/ScrollViewWithBottomPadding/styles.native.js +11 -0
- package/dist/esm/keyboard/components/ScrollViewWithBottomPadding/styles.native.js.map +1 -0
- package/dist/esm/keyboard/components/hooks/useCombinedRef.mjs +21 -0
- package/dist/esm/keyboard/components/hooks/useCombinedRef.mjs.map +1 -0
- package/dist/esm/keyboard/components/hooks/useCombinedRef.native.js +41 -0
- package/dist/esm/keyboard/components/hooks/useCombinedRef.native.js.map +1 -0
- package/dist/esm/keyboard/components/hooks/useScrollState.mjs +59 -0
- package/dist/esm/keyboard/components/hooks/useScrollState.mjs.map +1 -0
- package/dist/esm/keyboard/components/hooks/useScrollState.native.js +60 -0
- package/dist/esm/keyboard/components/hooks/useScrollState.native.js.map +1 -0
- package/dist/esm/keyboard/components/index.mjs +8 -0
- package/dist/esm/keyboard/components/index.native.js +8 -0
- package/dist/esm/keyboard/components/utils/safeScrollTo.mjs +14 -0
- package/dist/esm/keyboard/components/utils/safeScrollTo.mjs.map +1 -0
- package/dist/esm/keyboard/components/utils/safeScrollTo.native.js +14 -0
- package/dist/esm/keyboard/components/utils/safeScrollTo.native.js.map +1 -0
- package/dist/esm/keyboard/constants.mjs +25 -0
- package/dist/esm/keyboard/constants.mjs.map +1 -0
- package/dist/esm/keyboard/constants.native.js +25 -0
- package/dist/esm/keyboard/constants.native.js.map +1 -0
- package/dist/esm/keyboard/context.mjs +43 -0
- package/dist/esm/keyboard/context.mjs.map +1 -0
- package/dist/esm/keyboard/context.native.js +49 -0
- package/dist/esm/keyboard/context.native.js.map +1 -0
- package/dist/esm/keyboard/hooks/index.mjs +94 -0
- package/dist/esm/keyboard/hooks/index.mjs.map +1 -0
- package/dist/esm/keyboard/hooks/index.native.js +106 -0
- package/dist/esm/keyboard/hooks/index.native.js.map +1 -0
- package/dist/esm/keyboard/hooks/useKeyboardState/index.mjs +25 -0
- package/dist/esm/keyboard/hooks/useKeyboardState/index.mjs.map +1 -0
- package/dist/esm/keyboard/hooks/useKeyboardState/index.native.js +38 -0
- package/dist/esm/keyboard/hooks/useKeyboardState/index.native.js.map +1 -0
- package/dist/esm/keyboard/hooks/useWindowDimensions/index.mjs +29 -0
- package/dist/esm/keyboard/hooks/useWindowDimensions/index.mjs.map +1 -0
- package/dist/esm/keyboard/hooks/useWindowDimensions/index.native.js +29 -0
- package/dist/esm/keyboard/hooks/useWindowDimensions/index.native.js.map +1 -0
- package/dist/esm/keyboard/index.mjs +20 -0
- package/dist/esm/keyboard/index.native.js +20 -0
- package/dist/esm/keyboard/internal.mjs +55 -0
- package/dist/esm/keyboard/internal.mjs.map +1 -0
- package/dist/esm/keyboard/internal.native.js +55 -0
- package/dist/esm/keyboard/internal.native.js.map +1 -0
- package/dist/esm/keyboard/module.mjs +53 -0
- package/dist/esm/keyboard/module.mjs.map +1 -0
- package/dist/esm/keyboard/module.native.js +58 -0
- package/dist/esm/keyboard/module.native.js.map +1 -0
- package/dist/esm/keyboard/reanimated.mjs +9 -0
- package/dist/esm/keyboard/reanimated.mjs.map +1 -0
- package/dist/esm/keyboard/reanimated.native.js +55 -0
- package/dist/esm/keyboard/reanimated.native.js.map +1 -0
- package/dist/esm/keyboard/typings/hooks.mjs +0 -0
- package/dist/esm/keyboard/typings/hooks.native.js +0 -0
- package/dist/esm/keyboard/typings/index.mjs +9 -0
- package/dist/esm/keyboard/typings/index.native.js +9 -0
- package/dist/esm/keyboard/typings/internal.mjs +0 -0
- package/dist/esm/keyboard/typings/internal.native.js +0 -0
- package/dist/esm/keyboard/typings/module.mjs +0 -0
- package/dist/esm/keyboard/typings/module.native.js +0 -0
- package/dist/esm/keyboard/typings/provider.mjs +0 -0
- package/dist/esm/keyboard/typings/provider.native.js +0 -0
- package/dist/esm/keyboard/typings/views.mjs +0 -0
- package/dist/esm/keyboard/typings/views.native.js +0 -0
- package/dist/esm/keyboard/utils/findNodeHandle/index.mjs +5 -0
- package/dist/esm/keyboard/utils/findNodeHandle/index.mjs.map +1 -0
- package/dist/esm/keyboard/utils/findNodeHandle/index.native.js +3 -0
- package/dist/esm/keyboard/views/KeyboardExtender/index.ios.js +23 -0
- package/dist/esm/keyboard/views/KeyboardExtender/index.ios.js.map +1 -0
- package/dist/esm/keyboard/views/KeyboardExtender/index.mjs +29 -0
- package/dist/esm/keyboard/views/KeyboardExtender/index.mjs.map +1 -0
- package/dist/esm/keyboard/views/KeyboardExtender/index.native.js +30 -0
- package/dist/esm/keyboard/views/KeyboardExtender/index.native.js.map +1 -0
- package/dist/esm/keyboard/views/OverKeyboardView/index.mjs +41 -0
- package/dist/esm/keyboard/views/OverKeyboardView/index.mjs.map +1 -0
- package/dist/esm/keyboard/views/OverKeyboardView/index.native.js +45 -0
- package/dist/esm/keyboard/views/OverKeyboardView/index.native.js.map +1 -0
- package/dist/esm/keyboard/views/index.mjs +4 -0
- package/dist/esm/keyboard/views/index.native.js +4 -0
- package/dist/esm/keyboard.mjs +1 -0
- package/dist/esm/keyboard.native.js +1 -0
- package/dist/esm/platform/specs/OneClippingScrollViewDecoratorViewNativeComponent.mjs +16 -0
- package/dist/esm/platform/specs/OneClippingScrollViewDecoratorViewNativeComponent.mjs.map +7 -0
- package/dist/esm/platform/specs/OneClippingScrollViewDecoratorViewNativeComponent.native.js +16 -0
- package/dist/esm/platform/specs/OneClippingScrollViewDecoratorViewNativeComponent.native.js.map +7 -0
- package/dist/esm/platform/specs/OneKeyboard.nitro.mjs +0 -0
- package/dist/esm/platform/specs/OneKeyboard.nitro.native.js +0 -0
- package/dist/esm/platform/specs/OneKeyboardBackgroundViewNativeComponent.mjs +12 -0
- package/dist/esm/platform/specs/OneKeyboardBackgroundViewNativeComponent.mjs.map +7 -0
- package/dist/esm/platform/specs/OneKeyboardBackgroundViewNativeComponent.native.js +12 -0
- package/dist/esm/platform/specs/OneKeyboardBackgroundViewNativeComponent.native.js.map +7 -0
- package/dist/esm/platform/specs/OneKeyboardControllerViewNativeComponent.mjs +61 -0
- package/dist/esm/platform/specs/OneKeyboardControllerViewNativeComponent.mjs.map +7 -0
- package/dist/esm/platform/specs/OneKeyboardControllerViewNativeComponent.native.js +61 -0
- package/dist/esm/platform/specs/OneKeyboardControllerViewNativeComponent.native.js.map +7 -0
- package/dist/esm/platform/specs/OneKeyboardExtenderNativeComponent.mjs +15 -0
- package/dist/esm/platform/specs/OneKeyboardExtenderNativeComponent.mjs.map +7 -0
- package/dist/esm/platform/specs/OneKeyboardExtenderNativeComponent.native.js +15 -0
- package/dist/esm/platform/specs/OneKeyboardExtenderNativeComponent.native.js.map +7 -0
- package/dist/esm/platform/specs/OneKeyboardGestureAreaNativeComponent.mjs +18 -0
- package/dist/esm/platform/specs/OneKeyboardGestureAreaNativeComponent.mjs.map +7 -0
- package/dist/esm/platform/specs/OneKeyboardGestureAreaNativeComponent.native.js +18 -0
- package/dist/esm/platform/specs/OneKeyboardGestureAreaNativeComponent.native.js.map +7 -0
- package/dist/esm/platform/specs/OneKeyboardToolbarGroupViewNativeComponent.mjs +12 -0
- package/dist/esm/platform/specs/OneKeyboardToolbarGroupViewNativeComponent.mjs.map +7 -0
- package/dist/esm/platform/specs/OneKeyboardToolbarGroupViewNativeComponent.native.js +12 -0
- package/dist/esm/platform/specs/OneKeyboardToolbarGroupViewNativeComponent.native.js.map +7 -0
- package/dist/esm/platform/specs/OneOverKeyboardViewNativeComponent.mjs +14 -0
- package/dist/esm/platform/specs/OneOverKeyboardViewNativeComponent.mjs.map +7 -0
- package/dist/esm/platform/specs/OneOverKeyboardViewNativeComponent.native.js +14 -0
- package/dist/esm/platform/specs/OneOverKeyboardViewNativeComponent.native.js.map +7 -0
- package/ios/Keyboard/KeyboardBackdropController.swift +57 -0
- package/ios/Keyboard/KeyboardControllerModuleImpl.swift +75 -0
- package/ios/Keyboard/LICENSE +21 -0
- package/ios/Keyboard/OneKeyboardBridge.swift +51 -0
- package/ios/Keyboard/animations/KeyboardAnimation.swift +80 -0
- package/ios/Keyboard/animations/SpringAnimation.swift +75 -0
- package/ios/Keyboard/animations/TimingAnimation.swift +145 -0
- package/ios/Keyboard/core/KeyboardControllerConfiguration.swift +9 -0
- package/ios/Keyboard/core/UIUtils.swift +6 -0
- package/ios/Keyboard/delegates/KCTextInputCompositeDelegate.swift +263 -0
- package/ios/Keyboard/events/KeyboardEventEmitterPayload.swift +16 -0
- package/ios/Keyboard/events/OneKCFocusedInputLayoutChangedEvent.h +8 -0
- package/ios/Keyboard/events/OneKCFocusedInputLayoutChangedEvent.m +70 -0
- package/ios/Keyboard/events/OneKCFocusedInputSelectionChangedEvent.h +8 -0
- package/ios/Keyboard/events/OneKCFocusedInputSelectionChangedEvent.m +69 -0
- package/ios/Keyboard/events/OneKCFocusedInputTextChangedEvent.h +8 -0
- package/ios/Keyboard/events/OneKCFocusedInputTextChangedEvent.m +64 -0
- package/ios/Keyboard/events/OneKCKeyboardMoveEvent.h +13 -0
- package/ios/Keyboard/events/OneKCKeyboardMoveEvent.m +75 -0
- package/ios/Keyboard/extensions/CGFloat.swift +13 -0
- package/ios/Keyboard/extensions/Date.swift +7 -0
- package/ios/Keyboard/extensions/NSObject.swift +5 -0
- package/ios/Keyboard/extensions/Notification.swift +15 -0
- package/ios/Keyboard/extensions/String.swift +5 -0
- package/ios/Keyboard/extensions/UIApplication.swift +38 -0
- package/ios/Keyboard/extensions/UIKeyboardType.swift +23 -0
- package/ios/Keyboard/extensions/UIResponder.swift +94 -0
- package/ios/Keyboard/extensions/UIScrollView.swift +8 -0
- package/ios/Keyboard/extensions/UIView.swift +83 -0
- package/ios/Keyboard/extensions/UIWindow.swift +56 -0
- package/ios/Keyboard/interactive/InvisibleInputAccessoryView.swift +52 -0
- package/ios/Keyboard/interactive/KeyboardAreaExtender.swift +68 -0
- package/ios/Keyboard/interactive/KeyboardOffsetProvider.swift +32 -0
- package/ios/Keyboard/objc/NSObject+SafeKVC.h +5 -0
- package/ios/Keyboard/objc/NSObject+SafeKVC.m +12 -0
- package/ios/Keyboard/objc/TextInput+DelegateManager.h +13 -0
- package/ios/Keyboard/objc/TextInput+DelegateManager.m +48 -0
- package/ios/Keyboard/observers/FocusedInputObserver.swift +334 -0
- package/ios/Keyboard/observers/movement/KeyboardEventsIgnorer.swift +32 -0
- package/ios/Keyboard/observers/movement/KeyboardTrackingView.swift +163 -0
- package/ios/Keyboard/observers/movement/KeyboardViewLocator.swift +16 -0
- package/ios/Keyboard/observers/movement/observer/KeyboardMovementObserver+Animation.swift +14 -0
- package/ios/Keyboard/observers/movement/observer/KeyboardMovementObserver+Interactive.swift +55 -0
- package/ios/Keyboard/observers/movement/observer/KeyboardMovementObserver+Lifecycle.swift +28 -0
- package/ios/Keyboard/observers/movement/observer/KeyboardMovementObserver+Listeners.swift +116 -0
- package/ios/Keyboard/observers/movement/observer/KeyboardMovementObserver+Watcher.swift +69 -0
- package/ios/Keyboard/observers/movement/observer/KeyboardMovementObserver.swift +57 -0
- package/ios/Keyboard/protocols/TextInput.swift +50 -0
- package/ios/Keyboard/swizzling/UIResponderSwizzle.swift +144 -0
- package/ios/Keyboard/traversal/FocusedInputHolder.swift +24 -0
- package/ios/Keyboard/traversal/KeyboardView.swift +28 -0
- package/ios/Keyboard/traversal/ViewHierarchyNavigator.swift +157 -0
- package/ios/Keyboard/views/KeyboardExtenderContainerView.swift +207 -0
- package/ios/Keyboard/views/OneClippingScrollViewDecoratorViewComponentView.h +8 -0
- package/ios/Keyboard/views/OneClippingScrollViewDecoratorViewComponentView.mm +230 -0
- package/ios/Keyboard/views/OneKeyboardBackgroundViewComponentView.h +8 -0
- package/ios/Keyboard/views/OneKeyboardBackgroundViewComponentView.mm +123 -0
- package/ios/Keyboard/views/OneKeyboardControllerViewComponentView.h +13 -0
- package/ios/Keyboard/views/OneKeyboardControllerViewComponentView.mm +299 -0
- package/ios/Keyboard/views/OneKeyboardExtenderComponentView.h +16 -0
- package/ios/Keyboard/views/OneKeyboardExtenderComponentView.mm +275 -0
- package/ios/Keyboard/views/OneKeyboardGestureAreaComponentView.h +10 -0
- package/ios/Keyboard/views/OneKeyboardGestureAreaComponentView.mm +111 -0
- package/ios/Keyboard/views/OneKeyboardToolbarGroupViewComponentView.h +7 -0
- package/ios/Keyboard/views/OneKeyboardToolbarGroupViewComponentView.mm +47 -0
- package/ios/Keyboard/views/OneOverKeyboardViewComponentView.h +15 -0
- package/ios/Keyboard/views/OneOverKeyboardViewComponentView.mm +155 -0
- package/ios/Nitro/HybridOneKeyboard.swift +140 -0
- package/ios/Nitro/OneLaunchScreen.h +2 -0
- package/ios/Nitro/OneLaunchScreen.m +16 -0
- package/nitrogen/generated/android/One+autolinking.cmake +2 -0
- package/nitrogen/generated/android/OneOnLoad.cpp +24 -2
- package/nitrogen/generated/android/c++/JFunc_void_OneKeyboardEventName_OneKeyboardEvent.hpp +80 -0
- package/nitrogen/generated/android/c++/JFunc_void_OneKeyboardFocus.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_double_double.hpp +75 -0
- package/nitrogen/generated/android/c++/JHybridOneKeyboardSpec.cpp +181 -0
- package/nitrogen/generated/android/c++/JHybridOneKeyboardSpec.hpp +74 -0
- package/nitrogen/generated/android/c++/JOneKeyboardEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JOneKeyboardEventName.hpp +64 -0
- package/nitrogen/generated/android/c++/JOneKeyboardFocus.hpp +61 -0
- package/nitrogen/generated/android/c++/JOneKeyboardFrame.hpp +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/Func_void_OneKeyboardEventName_OneKeyboardEvent.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/Func_void_OneKeyboardFocus.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/Func_void_double_double.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HybridOneKeyboardSpec.kt +128 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/OneKeyboardEvent.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/OneKeyboardEventName.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/OneKeyboardFocus.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/OneKeyboardFrame.kt +66 -0
- package/nitrogen/generated/ios/One-Swift-Cxx-Bridge.cpp +197 -148
- package/nitrogen/generated/ios/One-Swift-Cxx-Bridge.hpp +590 -452
- package/nitrogen/generated/ios/One-Swift-Cxx-Umbrella.hpp +17 -0
- package/nitrogen/generated/ios/OneAutolinking.mm +8 -0
- package/nitrogen/generated/ios/OneAutolinking.swift +12 -0
- package/nitrogen/generated/ios/c++/HybridOneKeyboardSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridOneKeyboardSpecSwift.hpp +173 -0
- package/nitrogen/generated/ios/swift/Func_void_OneKeyboardEventName_OneKeyboardEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_OneKeyboardFocus.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_OneKeyboardFrame.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_double_double.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridOneKeyboardSpec.swift +66 -0
- package/nitrogen/generated/ios/swift/HybridOneKeyboardSpec_cxx.swift +316 -0
- package/nitrogen/generated/ios/swift/OneKeyboardEvent.swift +54 -0
- package/nitrogen/generated/ios/swift/OneKeyboardEventName.swift +48 -0
- package/nitrogen/generated/ios/swift/OneKeyboardFocus.swift +34 -0
- package/nitrogen/generated/ios/swift/OneKeyboardFrame.swift +44 -0
- package/nitrogen/generated/shared/c++/HybridOneKeyboardSpec.cpp +33 -0
- package/nitrogen/generated/shared/c++/HybridOneKeyboardSpec.hpp +86 -0
- package/nitrogen/generated/shared/c++/OneKeyboardEvent.hpp +103 -0
- package/nitrogen/generated/shared/c++/OneKeyboardEventName.hpp +84 -0
- package/nitrogen/generated/shared/c++/OneKeyboardFocus.hpp +87 -0
- package/nitrogen/generated/shared/c++/OneKeyboardFrame.hpp +95 -0
- package/package.json +27 -13
- package/react-native.config.cjs +6 -0
- package/src/keyboard/LICENSE +21 -0
- package/src/keyboard/animated.tsx +235 -0
- package/src/keyboard/architecture.ts +1 -0
- package/src/keyboard/bindings.native.ts +113 -0
- package/src/keyboard/bindings.ts +100 -0
- package/src/keyboard/compat.ts +61 -0
- package/src/keyboard/components/KeyboardAvoidingView/hooks.ts +152 -0
- package/src/keyboard/components/KeyboardAvoidingView/index.tsx +260 -0
- package/src/keyboard/components/KeyboardAwareScrollView/index.tsx +607 -0
- package/src/keyboard/components/KeyboardAwareScrollView/types.ts +30 -0
- package/src/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +151 -0
- package/src/keyboard/components/KeyboardAwareScrollView/utils.ts +42 -0
- package/src/keyboard/components/KeyboardChatScrollView/hooks.ts +2 -0
- package/src/keyboard/components/KeyboardChatScrollView/index.tsx +182 -0
- package/src/keyboard/components/KeyboardChatScrollView/types.ts +120 -0
- package/src/keyboard/components/KeyboardChatScrollView/useChatKeyboard/helpers.ts +263 -0
- package/src/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.ios.ts +255 -0
- package/src/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.ts +356 -0
- package/src/keyboard/components/KeyboardChatScrollView/useChatKeyboard/types.ts +39 -0
- package/src/keyboard/components/KeyboardChatScrollView/useEndVisible.ts +59 -0
- package/src/keyboard/components/KeyboardChatScrollView/useExtraContentPadding/index.ts +188 -0
- package/src/keyboard/components/KeyboardChatScrollView/useFrozenPadding/index.ts +80 -0
- package/src/keyboard/components/KeyboardEffects/index.tsx +122 -0
- package/src/keyboard/components/KeyboardStickyView/index.tsx +75 -0
- package/src/keyboard/components/KeyboardToolbar/Arrow.tsx +76 -0
- package/src/keyboard/components/KeyboardToolbar/Button.tsx +89 -0
- package/src/keyboard/components/KeyboardToolbar/colors.native.ts +37 -0
- package/src/keyboard/components/KeyboardToolbar/colors.ts +16 -0
- package/src/keyboard/components/KeyboardToolbar/compound/components/Background.tsx +7 -0
- package/src/keyboard/components/KeyboardToolbar/compound/components/Content.tsx +23 -0
- package/src/keyboard/components/KeyboardToolbar/compound/components/Done.tsx +70 -0
- package/src/keyboard/components/KeyboardToolbar/compound/components/Next.tsx +53 -0
- package/src/keyboard/components/KeyboardToolbar/compound/components/Prev.tsx +54 -0
- package/src/keyboard/components/KeyboardToolbar/compound/components/index.ts +5 -0
- package/src/keyboard/components/KeyboardToolbar/compound/components/types.ts +15 -0
- package/src/keyboard/components/KeyboardToolbar/compound/context.ts +21 -0
- package/src/keyboard/components/KeyboardToolbar/constants.ts +13 -0
- package/src/keyboard/components/KeyboardToolbar/index.tsx +231 -0
- package/src/keyboard/components/KeyboardToolbar/types.ts +129 -0
- package/src/keyboard/components/ScrollViewWithBottomPadding/index.tsx +185 -0
- package/src/keyboard/components/ScrollViewWithBottomPadding/styles.ts +10 -0
- package/src/keyboard/components/hooks/useCombinedRef.ts +22 -0
- package/src/keyboard/components/hooks/useScrollState.ts +81 -0
- package/src/keyboard/components/index.ts +22 -0
- package/src/keyboard/components/utils/safeScrollTo.ts +26 -0
- package/src/keyboard/constants.ts +23 -0
- package/src/keyboard/context.ts +100 -0
- package/src/keyboard/hooks/index.ts +289 -0
- package/src/keyboard/hooks/useKeyboardState/index.ts +70 -0
- package/src/keyboard/hooks/useWindowDimensions/index.ts +38 -0
- package/src/keyboard/index.ts +31 -0
- package/src/keyboard/internal.ts +117 -0
- package/src/keyboard/module.ts +62 -0
- package/src/keyboard/reanimated.native.ts +104 -0
- package/src/keyboard/reanimated.ts +26 -0
- package/src/keyboard/typings/hooks.ts +214 -0
- package/src/keyboard/typings/index.ts +5 -0
- package/src/keyboard/typings/internal.ts +24 -0
- package/src/keyboard/typings/module.ts +136 -0
- package/src/keyboard/typings/provider.ts +43 -0
- package/src/keyboard/typings/views.ts +63 -0
- package/src/keyboard/utils/findNodeHandle/index.native.ts +3 -0
- package/src/keyboard/utils/findNodeHandle/index.ts +6 -0
- package/src/keyboard/views/KeyboardExtender/index.ios.tsx +35 -0
- package/src/keyboard/views/KeyboardExtender/index.tsx +47 -0
- package/src/keyboard/views/OverKeyboardView/index.tsx +61 -0
- package/src/keyboard/views/index.ts +2 -0
- package/src/keyboard.ts +1 -0
- package/src/platform/specs/OneClippingScrollViewDecoratorViewNativeComponent.ts +15 -0
- package/src/platform/specs/OneKeyboard.nitro.ts +49 -0
- package/src/platform/specs/OneKeyboardBackgroundViewNativeComponent.ts +10 -0
- package/src/platform/specs/OneKeyboardControllerViewNativeComponent.ts +84 -0
- package/src/platform/specs/OneKeyboardExtenderNativeComponent.ts +13 -0
- package/src/platform/specs/OneKeyboardGestureAreaNativeComponent.ts +17 -0
- package/src/platform/specs/OneKeyboardToolbarGroupViewNativeComponent.ts +10 -0
- package/src/platform/specs/OneOverKeyboardViewNativeComponent.ts +12 -0
- package/types/keyboard/animated.d.ts +18 -0
- package/types/keyboard/animated.d.ts.map +1 -0
- package/types/keyboard/architecture.d.ts +2 -0
- package/types/keyboard/architecture.d.ts.map +1 -0
- package/types/keyboard/bindings.d.ts +64 -0
- package/types/keyboard/bindings.d.ts.map +1 -0
- package/types/keyboard/bindings.native.d.ts +19 -0
- package/types/keyboard/bindings.native.d.ts.map +1 -0
- package/types/keyboard/compat.d.ts +28 -0
- package/types/keyboard/compat.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardAvoidingView/hooks.d.ts +11 -0
- package/types/keyboard/components/KeyboardAvoidingView/hooks.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardAvoidingView/index.d.ts +81 -0
- package/types/keyboard/components/KeyboardAvoidingView/index.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardAwareScrollView/index.d.ts +31 -0
- package/types/keyboard/components/KeyboardAwareScrollView/index.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardAwareScrollView/types.d.ts +29 -0
- package/types/keyboard/components/KeyboardAwareScrollView/types.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.d.ts +23 -0
- package/types/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardAwareScrollView/utils.d.ts +3 -0
- package/types/keyboard/components/KeyboardAwareScrollView/utils.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardChatScrollView/hooks.d.ts +3 -0
- package/types/keyboard/components/KeyboardChatScrollView/hooks.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardChatScrollView/index.d.ts +5 -0
- package/types/keyboard/components/KeyboardChatScrollView/index.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardChatScrollView/types.d.ts +116 -0
- package/types/keyboard/components/KeyboardChatScrollView/types.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardChatScrollView/useChatKeyboard/helpers.d.ts +134 -0
- package/types/keyboard/components/KeyboardChatScrollView/useChatKeyboard/helpers.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.d.ts +19 -0
- package/types/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.ios.d.ts +22 -0
- package/types/keyboard/components/KeyboardChatScrollView/useChatKeyboard/index.ios.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardChatScrollView/useChatKeyboard/types.d.ts +42 -0
- package/types/keyboard/components/KeyboardChatScrollView/useChatKeyboard/types.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardChatScrollView/useEndVisible.d.ts +18 -0
- package/types/keyboard/components/KeyboardChatScrollView/useEndVisible.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardChatScrollView/useExtraContentPadding/index.d.ts +48 -0
- package/types/keyboard/components/KeyboardChatScrollView/useExtraContentPadding/index.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardChatScrollView/useFrozenPadding/index.d.ts +31 -0
- package/types/keyboard/components/KeyboardChatScrollView/useFrozenPadding/index.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardEffects/index.d.ts +61 -0
- package/types/keyboard/components/KeyboardEffects/index.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardStickyView/index.d.ts +53 -0
- package/types/keyboard/components/KeyboardStickyView/index.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/Arrow.d.ts +10 -0
- package/types/keyboard/components/KeyboardToolbar/Arrow.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/Button.d.ts +18 -0
- package/types/keyboard/components/KeyboardToolbar/Button.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/colors.d.ts +3 -0
- package/types/keyboard/components/KeyboardToolbar/colors.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/colors.native.d.ts +3 -0
- package/types/keyboard/components/KeyboardToolbar/colors.native.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/Background.d.ts +7 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/Background.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/Content.d.ts +8 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/Content.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/Done.d.ts +8 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/Done.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/Next.d.ts +5 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/Next.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/Prev.d.ts +5 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/Prev.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/index.d.ts +6 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/index.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/types.d.ts +15 -0
- package/types/keyboard/components/KeyboardToolbar/compound/components/types.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/compound/context.d.ts +10 -0
- package/types/keyboard/components/KeyboardToolbar/compound/context.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/constants.d.ts +10 -0
- package/types/keyboard/components/KeyboardToolbar/constants.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/index.d.ts +30 -0
- package/types/keyboard/components/KeyboardToolbar/index.d.ts.map +1 -0
- package/types/keyboard/components/KeyboardToolbar/types.d.ts +106 -0
- package/types/keyboard/components/KeyboardToolbar/types.d.ts.map +1 -0
- package/types/keyboard/components/ScrollViewWithBottomPadding/index.d.ts +31 -0
- package/types/keyboard/components/ScrollViewWithBottomPadding/index.d.ts.map +1 -0
- package/types/keyboard/components/ScrollViewWithBottomPadding/styles.d.ts +8 -0
- package/types/keyboard/components/ScrollViewWithBottomPadding/styles.d.ts.map +1 -0
- package/types/keyboard/components/hooks/useCombinedRef.d.ts +4 -0
- package/types/keyboard/components/hooks/useCombinedRef.d.ts.map +1 -0
- package/types/keyboard/components/hooks/useScrollState.d.ts +18 -0
- package/types/keyboard/components/hooks/useScrollState.d.ts.map +1 -0
- package/types/keyboard/components/index.d.ts +13 -0
- package/types/keyboard/components/index.d.ts.map +1 -0
- package/types/keyboard/components/utils/safeScrollTo.d.ts +13 -0
- package/types/keyboard/components/utils/safeScrollTo.d.ts.map +1 -0
- package/types/keyboard/constants.d.ts +19 -0
- package/types/keyboard/constants.d.ts.map +1 -0
- package/types/keyboard/context.d.ts +58 -0
- package/types/keyboard/context.d.ts.map +1 -0
- package/types/keyboard/hooks/index.d.ts +176 -0
- package/types/keyboard/hooks/index.d.ts.map +1 -0
- package/types/keyboard/hooks/useKeyboardState/index.d.ts +29 -0
- package/types/keyboard/hooks/useKeyboardState/index.d.ts.map +1 -0
- package/types/keyboard/hooks/useWindowDimensions/index.d.ts +3 -0
- package/types/keyboard/hooks/useWindowDimensions/index.d.ts.map +1 -0
- package/types/keyboard/index.d.ts +12 -0
- package/types/keyboard/index.d.ts.map +1 -0
- package/types/keyboard/internal.d.ts +37 -0
- package/types/keyboard/internal.d.ts.map +1 -0
- package/types/keyboard/module.d.ts +6 -0
- package/types/keyboard/module.d.ts.map +1 -0
- package/types/keyboard/reanimated.d.ts +5 -0
- package/types/keyboard/reanimated.d.ts.map +1 -0
- package/types/keyboard/reanimated.native.d.ts +12 -0
- package/types/keyboard/reanimated.native.d.ts.map +1 -0
- package/types/keyboard/typings/hooks.d.ts +168 -0
- package/types/keyboard/typings/hooks.d.ts.map +1 -0
- package/types/keyboard/typings/index.d.ts +6 -0
- package/types/keyboard/typings/index.d.ts.map +1 -0
- package/types/keyboard/typings/internal.d.ts +18 -0
- package/types/keyboard/typings/internal.d.ts.map +1 -0
- package/types/keyboard/typings/module.d.ts +122 -0
- package/types/keyboard/typings/module.d.ts.map +1 -0
- package/types/keyboard/typings/provider.d.ts +44 -0
- package/types/keyboard/typings/provider.d.ts.map +1 -0
- package/types/keyboard/typings/views.d.ts +61 -0
- package/types/keyboard/typings/views.d.ts.map +1 -0
- package/types/keyboard/utils/findNodeHandle/index.d.ts +5 -0
- package/types/keyboard/utils/findNodeHandle/index.d.ts.map +1 -0
- package/types/keyboard/utils/findNodeHandle/index.native.d.ts +3 -0
- package/types/keyboard/utils/findNodeHandle/index.native.d.ts.map +1 -0
- package/types/keyboard/views/KeyboardExtender/index.d.ts +20 -0
- package/types/keyboard/views/KeyboardExtender/index.d.ts.map +1 -0
- package/types/keyboard/views/KeyboardExtender/index.ios.d.ts +20 -0
- package/types/keyboard/views/KeyboardExtender/index.ios.d.ts.map +1 -0
- package/types/keyboard/views/OverKeyboardView/index.d.ts +19 -0
- package/types/keyboard/views/OverKeyboardView/index.d.ts.map +1 -0
- package/types/keyboard/views/index.d.ts +3 -0
- package/types/keyboard/views/index.d.ts.map +1 -0
- package/types/keyboard.d.ts +2 -0
- package/types/keyboard.d.ts.map +1 -0
- package/types/platform/specs/OneClippingScrollViewDecoratorViewNativeComponent.d.ts +11 -0
- package/types/platform/specs/OneClippingScrollViewDecoratorViewNativeComponent.d.ts.map +1 -0
- package/types/platform/specs/OneKeyboard.nitro.d.ts +39 -0
- package/types/platform/specs/OneKeyboard.nitro.d.ts.map +1 -0
- package/types/platform/specs/OneKeyboardBackgroundViewNativeComponent.d.ts +7 -0
- package/types/platform/specs/OneKeyboardBackgroundViewNativeComponent.d.ts.map +1 -0
- package/types/platform/specs/OneKeyboardControllerViewNativeComponent.d.ts +61 -0
- package/types/platform/specs/OneKeyboardControllerViewNativeComponent.d.ts.map +1 -0
- package/types/platform/specs/OneKeyboardExtenderNativeComponent.d.ts +9 -0
- package/types/platform/specs/OneKeyboardExtenderNativeComponent.d.ts.map +1 -0
- package/types/platform/specs/OneKeyboardGestureAreaNativeComponent.d.ts +13 -0
- package/types/platform/specs/OneKeyboardGestureAreaNativeComponent.d.ts.map +1 -0
- package/types/platform/specs/OneKeyboardToolbarGroupViewNativeComponent.d.ts +7 -0
- package/types/platform/specs/OneKeyboardToolbarGroupViewNativeComponent.d.ts.map +1 -0
- package/types/platform/specs/OneOverKeyboardViewNativeComponent.d.ts +8 -0
- package/types/platform/specs/OneOverKeyboardViewNativeComponent.d.ts.map +1 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo } from "react";
|
|
2
|
+
import Reanimated, { clamp, interpolate, runOnUI, scrollTo, useAnimatedRef, useSharedValue } from "react-native-reanimated";
|
|
3
|
+
import { useFocusedInputHandler, useReanimatedFocusedInput, useWindowDimensions } from "../../hooks/index.mjs";
|
|
4
|
+
import { useAnimatedReaction, useAnimatedStyle, useDerivedValue } from "../../reanimated.mjs";
|
|
5
|
+
import { findNodeHandle } from "../../utils/findNodeHandle/index.mjs";
|
|
6
|
+
import useCombinedRef from "../hooks/useCombinedRef.mjs";
|
|
7
|
+
import useScrollState from "../hooks/useScrollState.mjs";
|
|
8
|
+
import ScrollViewWithBottomPadding from "../ScrollViewWithBottomPadding/index.mjs";
|
|
9
|
+
import { useSmoothKeyboardHandler } from "./useSmoothKeyboardHandler.mjs";
|
|
10
|
+
import { debounce, scrollDistanceWithRespectToSnapPoints } from "./utils.mjs";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
|
|
13
|
+
// dist/esm/keyboard/components/KeyboardAwareScrollView/index.js
|
|
14
|
+
const KeyboardAwareScrollView = forwardRef(({ children, onLayout, bottomOffset = 0, disableScrollOnKeyboardHide = false, enabled = true, extraKeyboardSpace = 0, mode = "insets", ScrollViewComponent = Reanimated.ScrollView, snapToOffsets, ...rest }, ref) => {
|
|
15
|
+
const scrollViewAnimatedRef = useAnimatedRef();
|
|
16
|
+
const scrollViewRef = React.useRef(null);
|
|
17
|
+
const onRef = useCombinedRef(scrollViewAnimatedRef, scrollViewRef);
|
|
18
|
+
const scrollViewTarget = useSharedValue(null);
|
|
19
|
+
const scrollPosition = useSharedValue(0);
|
|
20
|
+
const { offset: position, layout: scrollViewLayout, size: scrollViewContentSize } = useScrollState(scrollViewAnimatedRef);
|
|
21
|
+
const currentKeyboardFrameHeight = useSharedValue(0);
|
|
22
|
+
const keyboardHeight = useSharedValue(0);
|
|
23
|
+
const keyboardWillAppear = useSharedValue(false);
|
|
24
|
+
const keyboardWillHide = useSharedValue(false);
|
|
25
|
+
const tag = useSharedValue(-1);
|
|
26
|
+
const initialKeyboardSize = useSharedValue(0);
|
|
27
|
+
const scrollBeforeKeyboardMovement = useSharedValue(0);
|
|
28
|
+
const { input, update } = useReanimatedFocusedInput();
|
|
29
|
+
const layout = useSharedValue(null);
|
|
30
|
+
const lastSelection = useSharedValue(null);
|
|
31
|
+
const ghostViewSpace = useSharedValue(-1);
|
|
32
|
+
const pendingSelectionForFocus = useSharedValue(false);
|
|
33
|
+
const selectionUpdatedSinceHide = useSharedValue(false);
|
|
34
|
+
const { height } = useWindowDimensions();
|
|
35
|
+
const syncScrollViewTarget = useCallback(() => {
|
|
36
|
+
scrollViewTarget.value = findNodeHandle(scrollViewAnimatedRef.current);
|
|
37
|
+
}, []);
|
|
38
|
+
const onScrollViewLayout = useCallback((e) => {
|
|
39
|
+
syncScrollViewTarget();
|
|
40
|
+
onLayout?.(e);
|
|
41
|
+
}, [onLayout, syncScrollViewTarget]);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
syncScrollViewTarget();
|
|
44
|
+
}, [syncScrollViewTarget]);
|
|
45
|
+
const maybeScroll = useCallback((e, animated = false) => {
|
|
46
|
+
"worklet";
|
|
47
|
+
if (!enabled) {
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
if (layout.value?.parentScrollViewTarget !== scrollViewTarget.value) {
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
const visibleRect = height - keyboardHeight.value;
|
|
54
|
+
const absoluteY = layout.value?.layout.absoluteY || 0;
|
|
55
|
+
const inputHeight = layout.value?.layout.height || 0;
|
|
56
|
+
const point = absoluteY + inputHeight;
|
|
57
|
+
if (visibleRect - point <= bottomOffset) {
|
|
58
|
+
const relativeScrollTo = keyboardHeight.value - (height - point) + bottomOffset;
|
|
59
|
+
const interpolatedScrollTo = interpolate(e, [initialKeyboardSize.value, keyboardHeight.value], [0, scrollDistanceWithRespectToSnapPoints(relativeScrollTo + scrollPosition.value, snapToOffsets) - scrollPosition.value]);
|
|
60
|
+
const targetScrollY = Math.max(interpolatedScrollTo, 0) + scrollPosition.value;
|
|
61
|
+
scrollTo(scrollViewAnimatedRef, 0, targetScrollY, animated);
|
|
62
|
+
return interpolatedScrollTo;
|
|
63
|
+
}
|
|
64
|
+
const contentY = layout.value?.layout.contentY || 0;
|
|
65
|
+
if (contentY + inputHeight < scrollPosition.value) {
|
|
66
|
+
const positionOnScreen = visibleRect - bottomOffset;
|
|
67
|
+
const topOfScreen = scrollPosition.value + point;
|
|
68
|
+
scrollTo(scrollViewAnimatedRef, 0, topOfScreen - positionOnScreen, animated);
|
|
69
|
+
}
|
|
70
|
+
return 0;
|
|
71
|
+
}, [
|
|
72
|
+
bottomOffset,
|
|
73
|
+
enabled,
|
|
74
|
+
height,
|
|
75
|
+
snapToOffsets
|
|
76
|
+
]);
|
|
77
|
+
const removeGhostPadding = useCallback((e) => {
|
|
78
|
+
"worklet";
|
|
79
|
+
if (mode === "layout") {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
if (enabled && keyboardWillHide.value && keyboardHeight.value > 0 && ghostViewSpace.value > 0) {
|
|
83
|
+
scrollTo(scrollViewAnimatedRef, 0, scrollPosition.value - interpolate(e, [initialKeyboardSize.value, keyboardHeight.value], [ghostViewSpace.value, 0]), false);
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
}, [enabled, mode]);
|
|
88
|
+
const performScrollWithPositionRestoration = useCallback((newPosition) => {
|
|
89
|
+
"worklet";
|
|
90
|
+
const prevScroll = scrollPosition.value;
|
|
91
|
+
scrollPosition.value = newPosition;
|
|
92
|
+
maybeScroll(keyboardHeight.value, true);
|
|
93
|
+
scrollPosition.value = prevScroll;
|
|
94
|
+
}, [
|
|
95
|
+
scrollPosition,
|
|
96
|
+
keyboardHeight,
|
|
97
|
+
maybeScroll
|
|
98
|
+
]);
|
|
99
|
+
const syncKeyboardFrame = useCallback((e) => {
|
|
100
|
+
"worklet";
|
|
101
|
+
const keyboardFrame = interpolate(e.height, [0, keyboardHeight.value], [0, keyboardHeight.value + extraKeyboardSpace]);
|
|
102
|
+
currentKeyboardFrameHeight.value = keyboardFrame;
|
|
103
|
+
}, [extraKeyboardSpace]);
|
|
104
|
+
const updateLayoutFromSelection = useCallback(() => {
|
|
105
|
+
"worklet";
|
|
106
|
+
const customHeight = lastSelection.value?.selection.end.y;
|
|
107
|
+
if (!input.value?.layout || customHeight === void 0) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
layout.value = {
|
|
111
|
+
...input.value,
|
|
112
|
+
layout: {
|
|
113
|
+
...input.value.layout,
|
|
114
|
+
height: clamp(customHeight, 0, input.value.layout.height)
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
return true;
|
|
118
|
+
}, [
|
|
119
|
+
input,
|
|
120
|
+
lastSelection,
|
|
121
|
+
layout
|
|
122
|
+
]);
|
|
123
|
+
const scrollFromCurrentPosition = useCallback(() => {
|
|
124
|
+
"worklet";
|
|
125
|
+
const prevLayout = layout.value;
|
|
126
|
+
if (!updateLayoutFromSelection()) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
performScrollWithPositionRestoration(position.value);
|
|
130
|
+
layout.value = prevLayout;
|
|
131
|
+
}, [performScrollWithPositionRestoration]);
|
|
132
|
+
const onChangeText = useCallback(() => {
|
|
133
|
+
"worklet";
|
|
134
|
+
scrollFromCurrentPosition();
|
|
135
|
+
}, [scrollFromCurrentPosition]);
|
|
136
|
+
const onChangeTextHandler = useMemo(() => debounce(onChangeText, 200), [onChangeText]);
|
|
137
|
+
const onSelectionChange = useCallback((e) => {
|
|
138
|
+
"worklet";
|
|
139
|
+
const lastTarget = lastSelection.value?.target;
|
|
140
|
+
const latestSelection = lastSelection.value?.selection;
|
|
141
|
+
lastSelection.value = e;
|
|
142
|
+
selectionUpdatedSinceHide.value = true;
|
|
143
|
+
if (e.target !== lastTarget || pendingSelectionForFocus.value) {
|
|
144
|
+
if (pendingSelectionForFocus.value) {
|
|
145
|
+
pendingSelectionForFocus.value = false;
|
|
146
|
+
updateLayoutFromSelection();
|
|
147
|
+
if (!keyboardWillAppear.value && keyboardHeight.value > 0) {
|
|
148
|
+
position.value += maybeScroll(keyboardHeight.value, true);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (e.selection.end.position === e.selection.start.position && latestSelection?.end.y !== e.selection.end.y) {
|
|
154
|
+
return scrollFromCurrentPosition();
|
|
155
|
+
}
|
|
156
|
+
if (e.selection.start.position !== e.selection.end.position) {
|
|
157
|
+
return scrollFromCurrentPosition();
|
|
158
|
+
}
|
|
159
|
+
onChangeTextHandler();
|
|
160
|
+
}, [
|
|
161
|
+
scrollFromCurrentPosition,
|
|
162
|
+
onChangeTextHandler,
|
|
163
|
+
updateLayoutFromSelection,
|
|
164
|
+
maybeScroll
|
|
165
|
+
]);
|
|
166
|
+
useFocusedInputHandler({ onSelectionChange }, [onSelectionChange]);
|
|
167
|
+
useSmoothKeyboardHandler({
|
|
168
|
+
onStart: (e) => {
|
|
169
|
+
"worklet";
|
|
170
|
+
const keyboardWillChangeSize = keyboardHeight.value !== e.height && e.height > 0;
|
|
171
|
+
const hideWasInterrupted = keyboardWillHide.value && e.height > 0;
|
|
172
|
+
keyboardWillAppear.value = e.height > 0 && keyboardHeight.value === 0;
|
|
173
|
+
keyboardWillHide.value = e.height === 0;
|
|
174
|
+
const focusWasChanged = tag.value !== e.target && e.target !== -1 || keyboardWillChangeSize;
|
|
175
|
+
if (keyboardWillChangeSize) {
|
|
176
|
+
initialKeyboardSize.value = keyboardHeight.value;
|
|
177
|
+
}
|
|
178
|
+
if (keyboardWillHide.value) {
|
|
179
|
+
initialKeyboardSize.value = 0;
|
|
180
|
+
scrollPosition.value = scrollBeforeKeyboardMovement.value;
|
|
181
|
+
pendingSelectionForFocus.value = false;
|
|
182
|
+
}
|
|
183
|
+
if (keyboardWillAppear.value || keyboardWillChangeSize || focusWasChanged) {
|
|
184
|
+
scrollPosition.value = position.value;
|
|
185
|
+
keyboardHeight.value = e.height;
|
|
186
|
+
if (mode === "insets") {
|
|
187
|
+
syncKeyboardFrame(e);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (focusWasChanged) {
|
|
191
|
+
tag.value = e.target;
|
|
192
|
+
if (lastSelection.value?.target === e.target && selectionUpdatedSinceHide.value) {
|
|
193
|
+
updateLayoutFromSelection();
|
|
194
|
+
pendingSelectionForFocus.value = false;
|
|
195
|
+
} else {
|
|
196
|
+
if (lastSelection.value?.target === e.target) {
|
|
197
|
+
updateLayoutFromSelection();
|
|
198
|
+
} else if (input.value) {
|
|
199
|
+
layout.value = input.value;
|
|
200
|
+
}
|
|
201
|
+
pendingSelectionForFocus.value = true;
|
|
202
|
+
}
|
|
203
|
+
scrollBeforeKeyboardMovement.value = position.value;
|
|
204
|
+
}
|
|
205
|
+
if (focusWasChanged && !keyboardWillAppear.value) {
|
|
206
|
+
if (!pendingSelectionForFocus.value) {
|
|
207
|
+
position.value += maybeScroll(e.height, true);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (mode === "insets") {
|
|
211
|
+
ghostViewSpace.value = position.value - Math.max(scrollViewContentSize.value.height - scrollViewLayout.value.height, 0);
|
|
212
|
+
if (ghostViewSpace.value > 0) {
|
|
213
|
+
scrollPosition.value = position.value;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (hideWasInterrupted && !focusWasChanged) {
|
|
217
|
+
scrollPosition.value = scrollBeforeKeyboardMovement.value;
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
onMove: (e) => {
|
|
221
|
+
"worklet";
|
|
222
|
+
if (pendingSelectionForFocus.value && lastSelection.value?.target !== tag.value) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (removeGhostPadding(e.height)) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (mode === "layout") {
|
|
229
|
+
syncKeyboardFrame(e);
|
|
230
|
+
}
|
|
231
|
+
if (!disableScrollOnKeyboardHide || keyboardWillAppear.value) {
|
|
232
|
+
maybeScroll(e.height);
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
onEnd: (e) => {
|
|
236
|
+
"worklet";
|
|
237
|
+
if (e.height === 0) {
|
|
238
|
+
removeGhostPadding(e.height);
|
|
239
|
+
}
|
|
240
|
+
keyboardHeight.value = e.height;
|
|
241
|
+
scrollPosition.value = position.value;
|
|
242
|
+
if (e.height === 0) {
|
|
243
|
+
selectionUpdatedSinceHide.value = false;
|
|
244
|
+
} else if (keyboardWillAppear.value) {
|
|
245
|
+
pendingSelectionForFocus.value = false;
|
|
246
|
+
}
|
|
247
|
+
syncKeyboardFrame(e);
|
|
248
|
+
}
|
|
249
|
+
}, [
|
|
250
|
+
mode,
|
|
251
|
+
maybeScroll,
|
|
252
|
+
removeGhostPadding,
|
|
253
|
+
disableScrollOnKeyboardHide,
|
|
254
|
+
syncKeyboardFrame
|
|
255
|
+
]);
|
|
256
|
+
const synchronize = useCallback(async () => {
|
|
257
|
+
await update();
|
|
258
|
+
requestAnimationFrame(() => {
|
|
259
|
+
runOnUI(() => {
|
|
260
|
+
"worklet";
|
|
261
|
+
scrollFromCurrentPosition();
|
|
262
|
+
})();
|
|
263
|
+
});
|
|
264
|
+
}, [update, scrollFromCurrentPosition]);
|
|
265
|
+
useImperativeHandle(ref, () => {
|
|
266
|
+
const scrollView = scrollViewRef.current;
|
|
267
|
+
if (scrollView) {
|
|
268
|
+
const scrollViewWithMethods = scrollView;
|
|
269
|
+
scrollViewWithMethods.assureFocusedInputVisible = () => {
|
|
270
|
+
synchronize();
|
|
271
|
+
};
|
|
272
|
+
return scrollViewWithMethods;
|
|
273
|
+
}
|
|
274
|
+
return { assureFocusedInputVisible: () => {
|
|
275
|
+
synchronize();
|
|
276
|
+
} };
|
|
277
|
+
}, [synchronize]);
|
|
278
|
+
useEffect(() => {
|
|
279
|
+
synchronize();
|
|
280
|
+
}, [bottomOffset]);
|
|
281
|
+
useAnimatedReaction(() => input.value, (current, previous) => {
|
|
282
|
+
if (current?.target === previous?.target && current?.layout.height !== previous?.layout.height) {
|
|
283
|
+
scrollFromCurrentPosition();
|
|
284
|
+
}
|
|
285
|
+
}, []);
|
|
286
|
+
const padding = useDerivedValue(() => enabled && mode === "insets" ? currentKeyboardFrameHeight.value : 0, [enabled, mode]);
|
|
287
|
+
const layoutSpacerStyle = useAnimatedStyle(() => enabled && mode === "layout" ? { paddingBottom: currentKeyboardFrameHeight.value + 1 } : {}, [enabled, mode]);
|
|
288
|
+
return /* @__PURE__ */ jsxs(ScrollViewWithBottomPadding, {
|
|
289
|
+
ref: onRef,
|
|
290
|
+
...rest,
|
|
291
|
+
bottomPadding: padding,
|
|
292
|
+
scrollEventThrottle: 16,
|
|
293
|
+
ScrollViewComponent,
|
|
294
|
+
onLayout: onScrollViewLayout,
|
|
295
|
+
children: [children, enabled && mode === "layout" && /* @__PURE__ */ jsx(Reanimated.View, { style: layoutSpacerStyle })]
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
var KeyboardAwareScrollView_default = KeyboardAwareScrollView;
|
|
299
|
+
|
|
300
|
+
export { KeyboardAwareScrollView_default as default };
|
|
301
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/keyboard/components/KeyboardAwareScrollView/index.js"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo\n} from \"react\";\nimport Reanimated, {\n clamp,\n interpolate,\n runOnUI,\n scrollTo,\n useAnimatedRef,\n useSharedValue\n} from \"react-native-reanimated\";\nimport {\n useFocusedInputHandler,\n useReanimatedFocusedInput,\n useWindowDimensions\n} from \"../../hooks\";\nimport { useAnimatedReaction, useAnimatedStyle, useDerivedValue } from \"../../reanimated\";\nimport { findNodeHandle } from \"../../utils/findNodeHandle\";\nimport useCombinedRef from \"../hooks/useCombinedRef\";\nimport useScrollState from \"../hooks/useScrollState\";\nimport ScrollViewWithBottomPadding from \"../ScrollViewWithBottomPadding\";\nimport { useSmoothKeyboardHandler } from \"./useSmoothKeyboardHandler\";\nimport { debounce, scrollDistanceWithRespectToSnapPoints } from \"./utils\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst KeyboardAwareScrollView = forwardRef(\n ({\n children,\n onLayout,\n bottomOffset = 0,\n disableScrollOnKeyboardHide = false,\n enabled = true,\n extraKeyboardSpace = 0,\n mode = \"insets\",\n ScrollViewComponent = Reanimated.ScrollView,\n snapToOffsets,\n ...rest\n }, ref) => {\n const scrollViewAnimatedRef = useAnimatedRef();\n const scrollViewRef = React.useRef(null);\n const onRef = useCombinedRef(scrollViewAnimatedRef, scrollViewRef);\n const scrollViewTarget = useSharedValue(null);\n const scrollPosition = useSharedValue(0);\n const {\n offset: position,\n layout: scrollViewLayout,\n size: scrollViewContentSize\n } = useScrollState(scrollViewAnimatedRef);\n const currentKeyboardFrameHeight = useSharedValue(0);\n const keyboardHeight = useSharedValue(0);\n const keyboardWillAppear = useSharedValue(false);\n const keyboardWillHide = useSharedValue(false);\n const tag = useSharedValue(-1);\n const initialKeyboardSize = useSharedValue(0);\n const scrollBeforeKeyboardMovement = useSharedValue(0);\n const { input, update } = useReanimatedFocusedInput();\n const layout = useSharedValue(null);\n const lastSelection = useSharedValue(null);\n const ghostViewSpace = useSharedValue(-1);\n const pendingSelectionForFocus = useSharedValue(false);\n const selectionUpdatedSinceHide = useSharedValue(false);\n const { height } = useWindowDimensions();\n const syncScrollViewTarget = useCallback(() => {\n scrollViewTarget.value = findNodeHandle(scrollViewAnimatedRef.current);\n }, []);\n const onScrollViewLayout = useCallback(\n (e) => {\n syncScrollViewTarget();\n onLayout?.(e);\n },\n [onLayout, syncScrollViewTarget]\n );\n useEffect(() => {\n syncScrollViewTarget();\n }, [syncScrollViewTarget]);\n const maybeScroll = useCallback(\n (e, animated = false) => {\n \"worklet\";\n if (!enabled) {\n return 0;\n }\n if (layout.value?.parentScrollViewTarget !== scrollViewTarget.value) {\n return 0;\n }\n const visibleRect = height - keyboardHeight.value;\n const absoluteY = layout.value?.layout.absoluteY || 0;\n const inputHeight = layout.value?.layout.height || 0;\n const point = absoluteY + inputHeight;\n if (visibleRect - point <= bottomOffset) {\n const relativeScrollTo = keyboardHeight.value - (height - point) + bottomOffset;\n const interpolatedScrollTo = interpolate(\n e,\n [initialKeyboardSize.value, keyboardHeight.value],\n [\n 0,\n scrollDistanceWithRespectToSnapPoints(\n relativeScrollTo + scrollPosition.value,\n snapToOffsets\n ) - scrollPosition.value\n ]\n );\n const targetScrollY = Math.max(interpolatedScrollTo, 0) + scrollPosition.value;\n scrollTo(scrollViewAnimatedRef, 0, targetScrollY, animated);\n return interpolatedScrollTo;\n }\n const contentY = layout.value?.layout.contentY || 0;\n if (contentY + inputHeight < scrollPosition.value) {\n const positionOnScreen = visibleRect - bottomOffset;\n const topOfScreen = scrollPosition.value + point;\n scrollTo(scrollViewAnimatedRef, 0, topOfScreen - positionOnScreen, animated);\n }\n return 0;\n },\n [bottomOffset, enabled, height, snapToOffsets]\n );\n const removeGhostPadding = useCallback(\n (e) => {\n \"worklet\";\n if (mode === \"layout\") {\n return false;\n }\n if (enabled && keyboardWillHide.value && keyboardHeight.value > 0 && ghostViewSpace.value > 0) {\n scrollTo(\n scrollViewAnimatedRef,\n 0,\n scrollPosition.value - interpolate(\n e,\n [initialKeyboardSize.value, keyboardHeight.value],\n [ghostViewSpace.value, 0]\n ),\n false\n );\n return true;\n }\n return false;\n },\n [enabled, mode]\n );\n const performScrollWithPositionRestoration = useCallback(\n (newPosition) => {\n \"worklet\";\n const prevScroll = scrollPosition.value;\n scrollPosition.value = newPosition;\n maybeScroll(keyboardHeight.value, true);\n scrollPosition.value = prevScroll;\n },\n [scrollPosition, keyboardHeight, maybeScroll]\n );\n const syncKeyboardFrame = useCallback(\n (e) => {\n \"worklet\";\n const keyboardFrame = interpolate(\n e.height,\n [0, keyboardHeight.value],\n [0, keyboardHeight.value + extraKeyboardSpace]\n );\n currentKeyboardFrameHeight.value = keyboardFrame;\n },\n [extraKeyboardSpace]\n );\n const updateLayoutFromSelection = useCallback(() => {\n \"worklet\";\n const customHeight = lastSelection.value?.selection.end.y;\n if (!input.value?.layout || customHeight === void 0) {\n return false;\n }\n layout.value = {\n ...input.value,\n layout: {\n ...input.value.layout,\n // when we have multiline input with limited amount of lines, then custom height can be very big\n // so we clamp it to max input height\n height: clamp(customHeight, 0, input.value.layout.height)\n }\n };\n return true;\n }, [input, lastSelection, layout]);\n const scrollFromCurrentPosition = useCallback(() => {\n \"worklet\";\n const prevLayout = layout.value;\n if (!updateLayoutFromSelection()) {\n return;\n }\n performScrollWithPositionRestoration(position.value);\n layout.value = prevLayout;\n }, [performScrollWithPositionRestoration]);\n const onChangeText = useCallback(() => {\n \"worklet\";\n scrollFromCurrentPosition();\n }, [scrollFromCurrentPosition]);\n const onChangeTextHandler = useMemo(() => debounce(onChangeText, 200), [onChangeText]);\n const onSelectionChange = useCallback(\n (e) => {\n \"worklet\";\n const lastTarget = lastSelection.value?.target;\n const latestSelection = lastSelection.value?.selection;\n lastSelection.value = e;\n selectionUpdatedSinceHide.value = true;\n if (e.target !== lastTarget || pendingSelectionForFocus.value) {\n if (pendingSelectionForFocus.value) {\n pendingSelectionForFocus.value = false;\n updateLayoutFromSelection();\n if (!keyboardWillAppear.value && keyboardHeight.value > 0) {\n position.value += maybeScroll(keyboardHeight.value, true);\n }\n }\n return;\n }\n if (e.selection.end.position === e.selection.start.position && latestSelection?.end.y !== e.selection.end.y) {\n return scrollFromCurrentPosition();\n }\n if (e.selection.start.position !== e.selection.end.position) {\n return scrollFromCurrentPosition();\n }\n onChangeTextHandler();\n },\n [\n scrollFromCurrentPosition,\n onChangeTextHandler,\n updateLayoutFromSelection,\n maybeScroll\n ]\n );\n useFocusedInputHandler(\n {\n onSelectionChange\n },\n [onSelectionChange]\n );\n useSmoothKeyboardHandler(\n {\n onStart: (e) => {\n \"worklet\";\n const keyboardWillChangeSize = keyboardHeight.value !== e.height && e.height > 0;\n const hideWasInterrupted = keyboardWillHide.value && e.height > 0;\n keyboardWillAppear.value = e.height > 0 && keyboardHeight.value === 0;\n keyboardWillHide.value = e.height === 0;\n const focusWasChanged = tag.value !== e.target && e.target !== -1 || keyboardWillChangeSize;\n if (keyboardWillChangeSize) {\n initialKeyboardSize.value = keyboardHeight.value;\n }\n if (keyboardWillHide.value) {\n initialKeyboardSize.value = 0;\n scrollPosition.value = scrollBeforeKeyboardMovement.value;\n pendingSelectionForFocus.value = false;\n }\n if (keyboardWillAppear.value || keyboardWillChangeSize || focusWasChanged) {\n scrollPosition.value = position.value;\n keyboardHeight.value = e.height;\n if (mode === \"insets\") {\n syncKeyboardFrame(e);\n }\n }\n if (focusWasChanged) {\n tag.value = e.target;\n if (lastSelection.value?.target === e.target && selectionUpdatedSinceHide.value) {\n updateLayoutFromSelection();\n pendingSelectionForFocus.value = false;\n } else {\n if (lastSelection.value?.target === e.target) {\n updateLayoutFromSelection();\n } else if (input.value) {\n layout.value = input.value;\n }\n pendingSelectionForFocus.value = true;\n }\n scrollBeforeKeyboardMovement.value = position.value;\n }\n if (focusWasChanged && !keyboardWillAppear.value) {\n if (!pendingSelectionForFocus.value) {\n position.value += maybeScroll(e.height, true);\n }\n }\n if (mode === \"insets\") {\n ghostViewSpace.value = position.value - Math.max(\n scrollViewContentSize.value.height - scrollViewLayout.value.height,\n 0\n );\n if (ghostViewSpace.value > 0) {\n scrollPosition.value = position.value;\n }\n }\n if (hideWasInterrupted && !focusWasChanged) {\n scrollPosition.value = scrollBeforeKeyboardMovement.value;\n }\n },\n onMove: (e) => {\n \"worklet\";\n if (pendingSelectionForFocus.value && lastSelection.value?.target !== tag.value) {\n return;\n }\n if (removeGhostPadding(e.height)) {\n return;\n }\n if (mode === \"layout\") {\n syncKeyboardFrame(e);\n }\n if (!disableScrollOnKeyboardHide || keyboardWillAppear.value) {\n maybeScroll(e.height);\n }\n },\n onEnd: (e) => {\n \"worklet\";\n if (e.height === 0) {\n removeGhostPadding(e.height);\n }\n keyboardHeight.value = e.height;\n scrollPosition.value = position.value;\n if (e.height === 0) {\n selectionUpdatedSinceHide.value = false;\n } else if (keyboardWillAppear.value) {\n pendingSelectionForFocus.value = false;\n }\n syncKeyboardFrame(e);\n }\n },\n [\n mode,\n maybeScroll,\n removeGhostPadding,\n disableScrollOnKeyboardHide,\n syncKeyboardFrame\n ]\n );\n const synchronize = useCallback(async () => {\n await update();\n requestAnimationFrame(() => {\n runOnUI(() => {\n \"worklet\";\n scrollFromCurrentPosition();\n })();\n });\n }, [update, scrollFromCurrentPosition]);\n useImperativeHandle(ref, () => {\n const scrollView = scrollViewRef.current;\n if (scrollView) {\n const scrollViewWithMethods = scrollView;\n scrollViewWithMethods.assureFocusedInputVisible = () => {\n synchronize();\n };\n return scrollViewWithMethods;\n }\n return {\n assureFocusedInputVisible: () => {\n synchronize();\n }\n };\n }, [synchronize]);\n useEffect(() => {\n synchronize();\n }, [bottomOffset]);\n useAnimatedReaction(\n () => input.value,\n (current, previous) => {\n if (current?.target === previous?.target && current?.layout.height !== previous?.layout.height) {\n scrollFromCurrentPosition();\n }\n },\n []\n );\n const padding = useDerivedValue(\n () => enabled && mode === \"insets\" ? currentKeyboardFrameHeight.value : 0,\n [enabled, mode]\n );\n const layoutSpacerStyle = useAnimatedStyle(\n () => enabled && mode === \"layout\" ? { paddingBottom: currentKeyboardFrameHeight.value + 1 } : {},\n [enabled, mode]\n );\n return /* @__PURE__ */ jsxs(\n ScrollViewWithBottomPadding,\n {\n ref: onRef,\n ...rest,\n bottomPadding: padding,\n scrollEventThrottle: 16,\n ScrollViewComponent,\n onLayout: onScrollViewLayout,\n children: [\n children,\n enabled && mode === \"layout\" && /* @__PURE__ */ jsx(Reanimated.View, { style: layoutSpacerStyle })\n ]\n }\n );\n }\n);\nvar KeyboardAwareScrollView_default = KeyboardAwareScrollView;\nexport {\n KeyboardAwareScrollView_default as default\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":"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"}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo } from "react";
|
|
3
|
+
import Reanimated, { clamp, interpolate, runOnUI, scrollTo, useAnimatedRef, useSharedValue } from "react-native-reanimated";
|
|
4
|
+
import { useFocusedInputHandler, useReanimatedFocusedInput, useWindowDimensions } from "../../hooks/index.native.js";
|
|
5
|
+
import { useAnimatedReaction, useAnimatedStyle, useDerivedValue } from "../../reanimated.native.js";
|
|
6
|
+
import { findNodeHandle } from "../../utils/findNodeHandle/index.native.js";
|
|
7
|
+
import useCombinedRef from "../hooks/useCombinedRef.native.js";
|
|
8
|
+
import useScrollState from "../hooks/useScrollState.native.js";
|
|
9
|
+
import ScrollViewWithBottomPadding from "../ScrollViewWithBottomPadding/index.native.js";
|
|
10
|
+
import { useSmoothKeyboardHandler } from "./useSmoothKeyboardHandler.native.js";
|
|
11
|
+
import { debounce, scrollDistanceWithRespectToSnapPoints } from "./utils.native.js";
|
|
12
|
+
|
|
13
|
+
// dist/esm/keyboard/components/KeyboardAwareScrollView/index.native.js
|
|
14
|
+
var KeyboardAwareScrollView = /* @__PURE__ */ forwardRef(function(param, ref) {
|
|
15
|
+
var { children, onLayout, bottomOffset = 0, disableScrollOnKeyboardHide = false, enabled = true, extraKeyboardSpace = 0, mode = "insets", ScrollViewComponent = Reanimated.ScrollView, snapToOffsets, ...rest } = param;
|
|
16
|
+
var scrollViewAnimatedRef = useAnimatedRef();
|
|
17
|
+
var scrollViewRef = React.useRef(null);
|
|
18
|
+
var onRef = useCombinedRef(scrollViewAnimatedRef, scrollViewRef);
|
|
19
|
+
var scrollViewTarget = useSharedValue(null);
|
|
20
|
+
var scrollPosition = useSharedValue(0);
|
|
21
|
+
var { offset: position, layout: scrollViewLayout, size: scrollViewContentSize } = useScrollState(scrollViewAnimatedRef);
|
|
22
|
+
var currentKeyboardFrameHeight = useSharedValue(0);
|
|
23
|
+
var keyboardHeight = useSharedValue(0);
|
|
24
|
+
var keyboardWillAppear = useSharedValue(false);
|
|
25
|
+
var keyboardWillHide = useSharedValue(false);
|
|
26
|
+
var tag = useSharedValue(-1);
|
|
27
|
+
var initialKeyboardSize = useSharedValue(0);
|
|
28
|
+
var scrollBeforeKeyboardMovement = useSharedValue(0);
|
|
29
|
+
var { input, update } = useReanimatedFocusedInput();
|
|
30
|
+
var layout = useSharedValue(null);
|
|
31
|
+
var lastSelection = useSharedValue(null);
|
|
32
|
+
var ghostViewSpace = useSharedValue(-1);
|
|
33
|
+
var pendingSelectionForFocus = useSharedValue(false);
|
|
34
|
+
var selectionUpdatedSinceHide = useSharedValue(false);
|
|
35
|
+
var { height } = useWindowDimensions();
|
|
36
|
+
var syncScrollViewTarget = useCallback(function() {
|
|
37
|
+
scrollViewTarget.value = findNodeHandle(scrollViewAnimatedRef.current);
|
|
38
|
+
}, []);
|
|
39
|
+
var onScrollViewLayout = useCallback(function(e) {
|
|
40
|
+
syncScrollViewTarget();
|
|
41
|
+
onLayout === null || onLayout === void 0 ? void 0 : onLayout(e);
|
|
42
|
+
}, [onLayout, syncScrollViewTarget]);
|
|
43
|
+
useEffect(function() {
|
|
44
|
+
syncScrollViewTarget();
|
|
45
|
+
}, [syncScrollViewTarget]);
|
|
46
|
+
var maybeScroll = useCallback(function(e) {
|
|
47
|
+
"worklet";
|
|
48
|
+
var animated = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
49
|
+
var _layout_value, _layout_value1, _layout_value2, _layout_value3;
|
|
50
|
+
if (!enabled) {
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
if (((_layout_value = layout.value) === null || _layout_value === void 0 ? void 0 : _layout_value.parentScrollViewTarget) !== scrollViewTarget.value) {
|
|
54
|
+
return 0;
|
|
55
|
+
}
|
|
56
|
+
var visibleRect = height - keyboardHeight.value;
|
|
57
|
+
var absoluteY = ((_layout_value1 = layout.value) === null || _layout_value1 === void 0 ? void 0 : _layout_value1.layout.absoluteY) || 0;
|
|
58
|
+
var inputHeight = ((_layout_value2 = layout.value) === null || _layout_value2 === void 0 ? void 0 : _layout_value2.layout.height) || 0;
|
|
59
|
+
var point = absoluteY + inputHeight;
|
|
60
|
+
if (visibleRect - point <= bottomOffset) {
|
|
61
|
+
var relativeScrollTo = keyboardHeight.value - (height - point) + bottomOffset;
|
|
62
|
+
var interpolatedScrollTo = interpolate(e, [initialKeyboardSize.value, keyboardHeight.value], [0, scrollDistanceWithRespectToSnapPoints(relativeScrollTo + scrollPosition.value, snapToOffsets) - scrollPosition.value]);
|
|
63
|
+
var targetScrollY = Math.max(interpolatedScrollTo, 0) + scrollPosition.value;
|
|
64
|
+
scrollTo(scrollViewAnimatedRef, 0, targetScrollY, animated);
|
|
65
|
+
return interpolatedScrollTo;
|
|
66
|
+
}
|
|
67
|
+
var contentY = ((_layout_value3 = layout.value) === null || _layout_value3 === void 0 ? void 0 : _layout_value3.layout.contentY) || 0;
|
|
68
|
+
if (contentY + inputHeight < scrollPosition.value) {
|
|
69
|
+
var positionOnScreen = visibleRect - bottomOffset;
|
|
70
|
+
var topOfScreen = scrollPosition.value + point;
|
|
71
|
+
scrollTo(scrollViewAnimatedRef, 0, topOfScreen - positionOnScreen, animated);
|
|
72
|
+
}
|
|
73
|
+
return 0;
|
|
74
|
+
}, [
|
|
75
|
+
bottomOffset,
|
|
76
|
+
enabled,
|
|
77
|
+
height,
|
|
78
|
+
snapToOffsets
|
|
79
|
+
]);
|
|
80
|
+
var removeGhostPadding = useCallback(function(e) {
|
|
81
|
+
"worklet";
|
|
82
|
+
if (mode === "layout") {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
if (enabled && keyboardWillHide.value && keyboardHeight.value > 0 && ghostViewSpace.value > 0) {
|
|
86
|
+
scrollTo(scrollViewAnimatedRef, 0, scrollPosition.value - interpolate(e, [initialKeyboardSize.value, keyboardHeight.value], [ghostViewSpace.value, 0]), false);
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
}, [enabled, mode]);
|
|
91
|
+
var performScrollWithPositionRestoration = useCallback(function(newPosition) {
|
|
92
|
+
"worklet";
|
|
93
|
+
var prevScroll = scrollPosition.value;
|
|
94
|
+
scrollPosition.value = newPosition;
|
|
95
|
+
maybeScroll(keyboardHeight.value, true);
|
|
96
|
+
scrollPosition.value = prevScroll;
|
|
97
|
+
}, [
|
|
98
|
+
scrollPosition,
|
|
99
|
+
keyboardHeight,
|
|
100
|
+
maybeScroll
|
|
101
|
+
]);
|
|
102
|
+
var syncKeyboardFrame = useCallback(function(e) {
|
|
103
|
+
"worklet";
|
|
104
|
+
var keyboardFrame = interpolate(e.height, [0, keyboardHeight.value], [0, keyboardHeight.value + extraKeyboardSpace]);
|
|
105
|
+
currentKeyboardFrameHeight.value = keyboardFrame;
|
|
106
|
+
}, [extraKeyboardSpace]);
|
|
107
|
+
var updateLayoutFromSelection = useCallback(function() {
|
|
108
|
+
"worklet";
|
|
109
|
+
var _lastSelection_value, _input_value;
|
|
110
|
+
var customHeight = (_lastSelection_value = lastSelection.value) === null || _lastSelection_value === void 0 ? void 0 : _lastSelection_value.selection.end.y;
|
|
111
|
+
if (!((_input_value = input.value) === null || _input_value === void 0 ? void 0 : _input_value.layout) || customHeight === void 0) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
layout.value = {
|
|
115
|
+
...input.value,
|
|
116
|
+
layout: {
|
|
117
|
+
...input.value.layout,
|
|
118
|
+
height: clamp(customHeight, 0, input.value.layout.height)
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
return true;
|
|
122
|
+
}, [
|
|
123
|
+
input,
|
|
124
|
+
lastSelection,
|
|
125
|
+
layout
|
|
126
|
+
]);
|
|
127
|
+
var scrollFromCurrentPosition = useCallback(function() {
|
|
128
|
+
"worklet";
|
|
129
|
+
var prevLayout = layout.value;
|
|
130
|
+
if (!updateLayoutFromSelection()) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
performScrollWithPositionRestoration(position.value);
|
|
134
|
+
layout.value = prevLayout;
|
|
135
|
+
}, [performScrollWithPositionRestoration]);
|
|
136
|
+
var onChangeText = useCallback(function() {
|
|
137
|
+
"worklet";
|
|
138
|
+
scrollFromCurrentPosition();
|
|
139
|
+
}, [scrollFromCurrentPosition]);
|
|
140
|
+
var onChangeTextHandler = useMemo(function() {
|
|
141
|
+
return debounce(onChangeText, 200);
|
|
142
|
+
}, [onChangeText]);
|
|
143
|
+
var onSelectionChange = useCallback(function(e) {
|
|
144
|
+
"worklet";
|
|
145
|
+
var _lastSelection_value, _lastSelection_value1;
|
|
146
|
+
var lastTarget = (_lastSelection_value = lastSelection.value) === null || _lastSelection_value === void 0 ? void 0 : _lastSelection_value.target;
|
|
147
|
+
var latestSelection = (_lastSelection_value1 = lastSelection.value) === null || _lastSelection_value1 === void 0 ? void 0 : _lastSelection_value1.selection;
|
|
148
|
+
lastSelection.value = e;
|
|
149
|
+
selectionUpdatedSinceHide.value = true;
|
|
150
|
+
if (e.target !== lastTarget || pendingSelectionForFocus.value) {
|
|
151
|
+
if (pendingSelectionForFocus.value) {
|
|
152
|
+
pendingSelectionForFocus.value = false;
|
|
153
|
+
updateLayoutFromSelection();
|
|
154
|
+
if (!keyboardWillAppear.value && keyboardHeight.value > 0) {
|
|
155
|
+
position.value += maybeScroll(keyboardHeight.value, true);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (e.selection.end.position === e.selection.start.position && (latestSelection === null || latestSelection === void 0 ? void 0 : latestSelection.end.y) !== e.selection.end.y) {
|
|
161
|
+
return scrollFromCurrentPosition();
|
|
162
|
+
}
|
|
163
|
+
if (e.selection.start.position !== e.selection.end.position) {
|
|
164
|
+
return scrollFromCurrentPosition();
|
|
165
|
+
}
|
|
166
|
+
onChangeTextHandler();
|
|
167
|
+
}, [
|
|
168
|
+
scrollFromCurrentPosition,
|
|
169
|
+
onChangeTextHandler,
|
|
170
|
+
updateLayoutFromSelection,
|
|
171
|
+
maybeScroll
|
|
172
|
+
]);
|
|
173
|
+
useFocusedInputHandler({ onSelectionChange }, [onSelectionChange]);
|
|
174
|
+
useSmoothKeyboardHandler({
|
|
175
|
+
onStart: function onStart(e) {
|
|
176
|
+
"worklet";
|
|
177
|
+
var keyboardWillChangeSize = keyboardHeight.value !== e.height && e.height > 0;
|
|
178
|
+
var hideWasInterrupted = keyboardWillHide.value && e.height > 0;
|
|
179
|
+
keyboardWillAppear.value = e.height > 0 && keyboardHeight.value === 0;
|
|
180
|
+
keyboardWillHide.value = e.height === 0;
|
|
181
|
+
var focusWasChanged = tag.value !== e.target && e.target !== -1 || keyboardWillChangeSize;
|
|
182
|
+
if (keyboardWillChangeSize) {
|
|
183
|
+
initialKeyboardSize.value = keyboardHeight.value;
|
|
184
|
+
}
|
|
185
|
+
if (keyboardWillHide.value) {
|
|
186
|
+
initialKeyboardSize.value = 0;
|
|
187
|
+
scrollPosition.value = scrollBeforeKeyboardMovement.value;
|
|
188
|
+
pendingSelectionForFocus.value = false;
|
|
189
|
+
}
|
|
190
|
+
if (keyboardWillAppear.value || keyboardWillChangeSize || focusWasChanged) {
|
|
191
|
+
scrollPosition.value = position.value;
|
|
192
|
+
keyboardHeight.value = e.height;
|
|
193
|
+
if (mode === "insets") {
|
|
194
|
+
syncKeyboardFrame(e);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (focusWasChanged) {
|
|
198
|
+
var _lastSelection_value;
|
|
199
|
+
tag.value = e.target;
|
|
200
|
+
if (((_lastSelection_value = lastSelection.value) === null || _lastSelection_value === void 0 ? void 0 : _lastSelection_value.target) === e.target && selectionUpdatedSinceHide.value) {
|
|
201
|
+
updateLayoutFromSelection();
|
|
202
|
+
pendingSelectionForFocus.value = false;
|
|
203
|
+
} else {
|
|
204
|
+
var _lastSelection_value1;
|
|
205
|
+
if (((_lastSelection_value1 = lastSelection.value) === null || _lastSelection_value1 === void 0 ? void 0 : _lastSelection_value1.target) === e.target) {
|
|
206
|
+
updateLayoutFromSelection();
|
|
207
|
+
} else if (input.value) {
|
|
208
|
+
layout.value = input.value;
|
|
209
|
+
}
|
|
210
|
+
pendingSelectionForFocus.value = true;
|
|
211
|
+
}
|
|
212
|
+
scrollBeforeKeyboardMovement.value = position.value;
|
|
213
|
+
}
|
|
214
|
+
if (focusWasChanged && !keyboardWillAppear.value) {
|
|
215
|
+
if (!pendingSelectionForFocus.value) {
|
|
216
|
+
position.value += maybeScroll(e.height, true);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (mode === "insets") {
|
|
220
|
+
ghostViewSpace.value = position.value - Math.max(scrollViewContentSize.value.height - scrollViewLayout.value.height, 0);
|
|
221
|
+
if (ghostViewSpace.value > 0) {
|
|
222
|
+
scrollPosition.value = position.value;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (hideWasInterrupted && !focusWasChanged) {
|
|
226
|
+
scrollPosition.value = scrollBeforeKeyboardMovement.value;
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
onMove: function onMove(e) {
|
|
230
|
+
"worklet";
|
|
231
|
+
var _lastSelection_value;
|
|
232
|
+
if (pendingSelectionForFocus.value && ((_lastSelection_value = lastSelection.value) === null || _lastSelection_value === void 0 ? void 0 : _lastSelection_value.target) !== tag.value) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
if (removeGhostPadding(e.height)) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (mode === "layout") {
|
|
239
|
+
syncKeyboardFrame(e);
|
|
240
|
+
}
|
|
241
|
+
if (!disableScrollOnKeyboardHide || keyboardWillAppear.value) {
|
|
242
|
+
maybeScroll(e.height);
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
onEnd: function onEnd(e) {
|
|
246
|
+
"worklet";
|
|
247
|
+
if (e.height === 0) {
|
|
248
|
+
removeGhostPadding(e.height);
|
|
249
|
+
}
|
|
250
|
+
keyboardHeight.value = e.height;
|
|
251
|
+
scrollPosition.value = position.value;
|
|
252
|
+
if (e.height === 0) {
|
|
253
|
+
selectionUpdatedSinceHide.value = false;
|
|
254
|
+
} else if (keyboardWillAppear.value) {
|
|
255
|
+
pendingSelectionForFocus.value = false;
|
|
256
|
+
}
|
|
257
|
+
syncKeyboardFrame(e);
|
|
258
|
+
}
|
|
259
|
+
}, [
|
|
260
|
+
mode,
|
|
261
|
+
maybeScroll,
|
|
262
|
+
removeGhostPadding,
|
|
263
|
+
disableScrollOnKeyboardHide,
|
|
264
|
+
syncKeyboardFrame
|
|
265
|
+
]);
|
|
266
|
+
var synchronize = useCallback(async function() {
|
|
267
|
+
await update();
|
|
268
|
+
requestAnimationFrame(function() {
|
|
269
|
+
runOnUI(function() {
|
|
270
|
+
"worklet";
|
|
271
|
+
scrollFromCurrentPosition();
|
|
272
|
+
})();
|
|
273
|
+
});
|
|
274
|
+
}, [update, scrollFromCurrentPosition]);
|
|
275
|
+
useImperativeHandle(ref, function() {
|
|
276
|
+
var scrollView = scrollViewRef.current;
|
|
277
|
+
if (scrollView) {
|
|
278
|
+
var scrollViewWithMethods = scrollView;
|
|
279
|
+
scrollViewWithMethods.assureFocusedInputVisible = function() {
|
|
280
|
+
synchronize();
|
|
281
|
+
};
|
|
282
|
+
return scrollViewWithMethods;
|
|
283
|
+
}
|
|
284
|
+
return { assureFocusedInputVisible: function assureFocusedInputVisible() {
|
|
285
|
+
synchronize();
|
|
286
|
+
} };
|
|
287
|
+
}, [synchronize]);
|
|
288
|
+
useEffect(function() {
|
|
289
|
+
synchronize();
|
|
290
|
+
}, [bottomOffset]);
|
|
291
|
+
useAnimatedReaction(function() {
|
|
292
|
+
return input.value;
|
|
293
|
+
}, function(current, previous) {
|
|
294
|
+
if ((current === null || current === void 0 ? void 0 : current.target) === (previous === null || previous === void 0 ? void 0 : previous.target) && (current === null || current === void 0 ? void 0 : current.layout.height) !== (previous === null || previous === void 0 ? void 0 : previous.layout.height)) {
|
|
295
|
+
scrollFromCurrentPosition();
|
|
296
|
+
}
|
|
297
|
+
}, []);
|
|
298
|
+
var padding = useDerivedValue(function() {
|
|
299
|
+
return enabled && mode === "insets" ? currentKeyboardFrameHeight.value : 0;
|
|
300
|
+
}, [enabled, mode]);
|
|
301
|
+
var layoutSpacerStyle = useAnimatedStyle(function() {
|
|
302
|
+
return enabled && mode === "layout" ? { paddingBottom: currentKeyboardFrameHeight.value + 1 } : {};
|
|
303
|
+
}, [enabled, mode]);
|
|
304
|
+
return /* @__PURE__ */ jsxs(ScrollViewWithBottomPadding, {
|
|
305
|
+
ref: onRef,
|
|
306
|
+
...rest,
|
|
307
|
+
bottomPadding: padding,
|
|
308
|
+
scrollEventThrottle: 16,
|
|
309
|
+
ScrollViewComponent,
|
|
310
|
+
onLayout: onScrollViewLayout,
|
|
311
|
+
children: [children, enabled && mode === "layout" && /* @__PURE__ */ jsx(Reanimated.View, { style: layoutSpacerStyle })]
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
var KeyboardAwareScrollView_default = KeyboardAwareScrollView;
|
|
315
|
+
|
|
316
|
+
export { KeyboardAwareScrollView_default as default };
|
|
317
|
+
//# sourceMappingURL=index.native.js.map
|