one 2.19.0 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["esm/keyboard/components/KeyboardAwareScrollView/index.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo } from \"react\";\nimport Reanimated, { clamp, interpolate, runOnUI, scrollTo, useAnimatedRef, useSharedValue } from \"react-native-reanimated\";\nimport { useFocusedInputHandler, useReanimatedFocusedInput, useWindowDimensions } 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\";\nvar KeyboardAwareScrollView = /* @__PURE__ */ forwardRef(function(param, ref) {\n var { children, onLayout, bottomOffset = 0, disableScrollOnKeyboardHide = false, enabled = true, extraKeyboardSpace = 0, mode = \"insets\", ScrollViewComponent = Reanimated.ScrollView, snapToOffsets, ...rest } = param;\n var scrollViewAnimatedRef = useAnimatedRef();\n var scrollViewRef = React.useRef(null);\n var onRef = useCombinedRef(scrollViewAnimatedRef, scrollViewRef);\n var scrollViewTarget = useSharedValue(null);\n var scrollPosition = useSharedValue(0);\n var { offset: position, layout: scrollViewLayout, size: scrollViewContentSize } = useScrollState(scrollViewAnimatedRef);\n var currentKeyboardFrameHeight = useSharedValue(0);\n var keyboardHeight = useSharedValue(0);\n var keyboardWillAppear = useSharedValue(false);\n var keyboardWillHide = useSharedValue(false);\n var tag = useSharedValue(-1);\n var initialKeyboardSize = useSharedValue(0);\n var scrollBeforeKeyboardMovement = useSharedValue(0);\n var { input, update } = useReanimatedFocusedInput();\n var layout = useSharedValue(null);\n var lastSelection = useSharedValue(null);\n var ghostViewSpace = useSharedValue(-1);\n var pendingSelectionForFocus = useSharedValue(false);\n var selectionUpdatedSinceHide = useSharedValue(false);\n var { height } = useWindowDimensions();\n var syncScrollViewTarget = useCallback(function() {\n scrollViewTarget.value = findNodeHandle(scrollViewAnimatedRef.current);\n }, []);\n var onScrollViewLayout = useCallback(function(e) {\n syncScrollViewTarget();\n onLayout === null || onLayout === void 0 ? void 0 : onLayout(e);\n }, [\n onLayout,\n syncScrollViewTarget\n ]);\n useEffect(function() {\n syncScrollViewTarget();\n }, [\n syncScrollViewTarget\n ]);\n var maybeScroll = useCallback(function(e) {\n \"worklet\";\n var animated = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;\n var _layout_value, _layout_value1, _layout_value2, _layout_value3;\n if (!enabled) {\n return 0;\n }\n if (((_layout_value = layout.value) === null || _layout_value === void 0 ? void 0 : _layout_value.parentScrollViewTarget) !== scrollViewTarget.value) {\n return 0;\n }\n var visibleRect = height - keyboardHeight.value;\n var absoluteY = ((_layout_value1 = layout.value) === null || _layout_value1 === void 0 ? void 0 : _layout_value1.layout.absoluteY) || 0;\n var inputHeight = ((_layout_value2 = layout.value) === null || _layout_value2 === void 0 ? void 0 : _layout_value2.layout.height) || 0;\n var point = absoluteY + inputHeight;\n if (visibleRect - point <= bottomOffset) {\n var relativeScrollTo = keyboardHeight.value - (height - point) + bottomOffset;\n var interpolatedScrollTo = interpolate(e, [\n initialKeyboardSize.value,\n keyboardHeight.value\n ], [\n 0,\n scrollDistanceWithRespectToSnapPoints(relativeScrollTo + scrollPosition.value, snapToOffsets) - scrollPosition.value\n ]);\n var targetScrollY = Math.max(interpolatedScrollTo, 0) + scrollPosition.value;\n scrollTo(scrollViewAnimatedRef, 0, targetScrollY, animated);\n return interpolatedScrollTo;\n }\n var contentY = ((_layout_value3 = layout.value) === null || _layout_value3 === void 0 ? void 0 : _layout_value3.layout.contentY) || 0;\n if (contentY + inputHeight < scrollPosition.value) {\n var positionOnScreen = visibleRect - bottomOffset;\n var topOfScreen = scrollPosition.value + point;\n scrollTo(scrollViewAnimatedRef, 0, topOfScreen - positionOnScreen, animated);\n }\n return 0;\n }, [\n bottomOffset,\n enabled,\n height,\n snapToOffsets\n ]);\n var removeGhostPadding = useCallback(function(e) {\n \"worklet\";\n if (mode === \"layout\") {\n return false;\n }\n if (enabled && keyboardWillHide.value && keyboardHeight.value > 0 && ghostViewSpace.value > 0) {\n scrollTo(scrollViewAnimatedRef, 0, scrollPosition.value - interpolate(e, [\n initialKeyboardSize.value,\n keyboardHeight.value\n ], [\n ghostViewSpace.value,\n 0\n ]), false);\n return true;\n }\n return false;\n }, [\n enabled,\n mode\n ]);\n var performScrollWithPositionRestoration = useCallback(function(newPosition) {\n \"worklet\";\n var prevScroll = scrollPosition.value;\n scrollPosition.value = newPosition;\n maybeScroll(keyboardHeight.value, true);\n scrollPosition.value = prevScroll;\n }, [\n scrollPosition,\n keyboardHeight,\n maybeScroll\n ]);\n var syncKeyboardFrame = useCallback(function(e) {\n \"worklet\";\n var keyboardFrame = interpolate(e.height, [\n 0,\n keyboardHeight.value\n ], [\n 0,\n keyboardHeight.value + extraKeyboardSpace\n ]);\n currentKeyboardFrameHeight.value = keyboardFrame;\n }, [\n extraKeyboardSpace\n ]);\n var updateLayoutFromSelection = useCallback(function() {\n \"worklet\";\n var _lastSelection_value, _input_value;\n var customHeight = (_lastSelection_value = lastSelection.value) === null || _lastSelection_value === void 0 ? void 0 : _lastSelection_value.selection.end.y;\n if (!((_input_value = input.value) === null || _input_value === void 0 ? void 0 : _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 }, [\n input,\n lastSelection,\n layout\n ]);\n var scrollFromCurrentPosition = useCallback(function() {\n \"worklet\";\n var prevLayout = layout.value;\n if (!updateLayoutFromSelection()) {\n return;\n }\n performScrollWithPositionRestoration(position.value);\n layout.value = prevLayout;\n }, [\n performScrollWithPositionRestoration\n ]);\n var onChangeText = useCallback(function() {\n \"worklet\";\n scrollFromCurrentPosition();\n }, [\n scrollFromCurrentPosition\n ]);\n var onChangeTextHandler = useMemo(function() {\n return debounce(onChangeText, 200);\n }, [\n onChangeText\n ]);\n var onSelectionChange = useCallback(function(e) {\n \"worklet\";\n var _lastSelection_value, _lastSelection_value1;\n var lastTarget = (_lastSelection_value = lastSelection.value) === null || _lastSelection_value === void 0 ? void 0 : _lastSelection_value.target;\n var latestSelection = (_lastSelection_value1 = lastSelection.value) === null || _lastSelection_value1 === void 0 ? void 0 : _lastSelection_value1.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 === null || latestSelection === void 0 ? void 0 : 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 scrollFromCurrentPosition,\n onChangeTextHandler,\n updateLayoutFromSelection,\n maybeScroll\n ]);\n useFocusedInputHandler({\n onSelectionChange\n }, [\n onSelectionChange\n ]);\n useSmoothKeyboardHandler({\n onStart: function onStart(e) {\n \"worklet\";\n var keyboardWillChangeSize = keyboardHeight.value !== e.height && e.height > 0;\n var hideWasInterrupted = keyboardWillHide.value && e.height > 0;\n keyboardWillAppear.value = e.height > 0 && keyboardHeight.value === 0;\n keyboardWillHide.value = e.height === 0;\n var 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 var _lastSelection_value;\n tag.value = e.target;\n if (((_lastSelection_value = lastSelection.value) === null || _lastSelection_value === void 0 ? void 0 : _lastSelection_value.target) === e.target && selectionUpdatedSinceHide.value) {\n updateLayoutFromSelection();\n pendingSelectionForFocus.value = false;\n } else {\n var _lastSelection_value1;\n if (((_lastSelection_value1 = lastSelection.value) === null || _lastSelection_value1 === void 0 ? void 0 : _lastSelection_value1.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(scrollViewContentSize.value.height - scrollViewLayout.value.height, 0);\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: function onMove(e) {\n \"worklet\";\n var _lastSelection_value;\n if (pendingSelectionForFocus.value && ((_lastSelection_value = lastSelection.value) === null || _lastSelection_value === void 0 ? void 0 : _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: function 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 mode,\n maybeScroll,\n removeGhostPadding,\n disableScrollOnKeyboardHide,\n syncKeyboardFrame\n ]);\n var synchronize = useCallback(async function() {\n await update();\n requestAnimationFrame(function() {\n runOnUI(function() {\n \"worklet\";\n scrollFromCurrentPosition();\n })();\n });\n }, [\n update,\n scrollFromCurrentPosition\n ]);\n useImperativeHandle(ref, function() {\n var scrollView = scrollViewRef.current;\n if (scrollView) {\n var scrollViewWithMethods = scrollView;\n scrollViewWithMethods.assureFocusedInputVisible = function() {\n synchronize();\n };\n return scrollViewWithMethods;\n }\n return {\n assureFocusedInputVisible: function assureFocusedInputVisible() {\n synchronize();\n }\n };\n }, [\n synchronize\n ]);\n useEffect(function() {\n synchronize();\n }, [\n bottomOffset\n ]);\n useAnimatedReaction(function() {\n return input.value;\n }, function(current, previous) {\n 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)) {\n scrollFromCurrentPosition();\n }\n }, []);\n var padding = useDerivedValue(function() {\n return enabled && mode === \"insets\" ? currentKeyboardFrameHeight.value : 0;\n }, [\n enabled,\n mode\n ]);\n var layoutSpacerStyle = useAnimatedStyle(function() {\n return enabled && mode === \"layout\" ? {\n paddingBottom: currentKeyboardFrameHeight.value + 1\n } : {};\n }, [\n enabled,\n mode\n ]);\n return /* @__PURE__ */ _jsxs(ScrollViewWithBottomPadding, {\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, {\n style: layoutSpacerStyle\n })\n ]\n });\n});\nvar KeyboardAwareScrollView_default = KeyboardAwareScrollView;\nexport {\n KeyboardAwareScrollView_default as default\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAI,0BAA0C,2BAAW,SAAS,OAAO,KAAK;CAC5E,IAAI,EAAE,UAAU,UAAU,eAAe,GAAG,8BAA8B,OAAO,UAAU,MAAM,qB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AY,KAAK,IAAI,KAAK,IAAI,QAAQ,aAAa,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,YAAY,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,OAAO,aAAa,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,OAAO,SAAS;GAC9S,0BAA0B;EAC5B;CACF,GAAG,CAAC,CAAC;CACL,IAAI,UAAU,gBAAgB,WAAW;EACvC,OAAO,WAAW,SAAS,WAAW,2BAA2B,QAAQ;CAC3E,GAAG,CACD,SACA,IACF,CAAC;CACD,IAAI,oBAAoB,iBAAiB,WAAW;EAClD,OAAO,WAAW,SAAS,WAAW,EACpC,eAAe,2BAA2B,QAAQ,EACpD,IAAI,CAAC;CACP,GAAG,CACD,SACA,IACF,CAAC;CACD,OAAuB,qBAAM,6BAA6B;EACxD,KAAK;EACL,GAAG;EACH,eAAe;EACf,qBAAqB;EACrB;EACA,UAAU;EACV,UAAU,CACR,UACA,WAAW,SAAS,YAA4B,oBAAK,WAAW,MAAM,EACpE,OAAO,kBACT,CAAC,CACH;CACF,CAAC;AACH,CAAC;AACD,IAAI,kCAAkC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { Platform } from "react-native-web";
|
|
3
|
+
import { Easing, useSharedValue, withTiming } from "react-native-reanimated";
|
|
4
|
+
import { useKeyboardHandler } from "../../hooks/index.mjs";
|
|
5
|
+
import { useAnimatedReaction } from "../../reanimated.mjs";
|
|
6
|
+
|
|
7
|
+
// dist/esm/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js
|
|
8
|
+
const IS_ANDROID_ELEVEN_OR_HIGHER = Platform.OS === "android" && Platform.Version >= 30;
|
|
9
|
+
const IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS = IS_ANDROID_ELEVEN_OR_HIGHER || Platform.OS === "ios";
|
|
10
|
+
const TELEGRAM_ANDROID_TIMING_CONFIG = {
|
|
11
|
+
duration: 250,
|
|
12
|
+
easing: Easing.bezier(.19919472913616398, .010644531250000006, .27920937042459737, .91025390625)
|
|
13
|
+
};
|
|
14
|
+
const useSmoothKeyboardHandler = (unstableHandler, deps) => {
|
|
15
|
+
const handler = useMemo(() => unstableHandler, deps ?? []);
|
|
16
|
+
const target = useSharedValue(-1);
|
|
17
|
+
const height = useSharedValue(0);
|
|
18
|
+
const persistedHeight = useSharedValue(0);
|
|
19
|
+
const animatedKeyboardHeight = useSharedValue(0);
|
|
20
|
+
useAnimatedReaction(() => {
|
|
21
|
+
if (IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (persistedHeight.value === 0) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const event = {
|
|
28
|
+
duration: TELEGRAM_ANDROID_TIMING_CONFIG.duration,
|
|
29
|
+
target: target.value,
|
|
30
|
+
height: animatedKeyboardHeight.value,
|
|
31
|
+
progress: animatedKeyboardHeight.value / persistedHeight.value
|
|
32
|
+
};
|
|
33
|
+
return event;
|
|
34
|
+
}, (evt, previous) => {
|
|
35
|
+
if (!evt || evt.height === previous?.height && evt.target === previous?.target && evt.progress === previous?.progress) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
handler.onMove?.(evt);
|
|
39
|
+
if (evt.height === height.value) {
|
|
40
|
+
handler.onEnd?.(evt);
|
|
41
|
+
persistedHeight.value = height.value;
|
|
42
|
+
}
|
|
43
|
+
}, deps ? [...deps] : deps);
|
|
44
|
+
useKeyboardHandler({
|
|
45
|
+
onStart: (e) => {
|
|
46
|
+
"worklet";
|
|
47
|
+
if (!IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS && e.height === persistedHeight.value) {
|
|
48
|
+
handler.onStart?.(e);
|
|
49
|
+
handler.onEnd?.(e);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
target.value = e.target;
|
|
53
|
+
height.value = e.height;
|
|
54
|
+
if (e.height > 0) {
|
|
55
|
+
persistedHeight.value = e.height;
|
|
56
|
+
}
|
|
57
|
+
if (!IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {
|
|
58
|
+
animatedKeyboardHeight.value = withTiming(e.height, TELEGRAM_ANDROID_TIMING_CONFIG);
|
|
59
|
+
}
|
|
60
|
+
handler.onStart?.({
|
|
61
|
+
...e,
|
|
62
|
+
duration: IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS ? e.duration : TELEGRAM_ANDROID_TIMING_CONFIG.duration
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
onMove: (e) => {
|
|
66
|
+
"worklet";
|
|
67
|
+
if (IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {
|
|
68
|
+
handler.onMove?.(e);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
onEnd: (e) => {
|
|
72
|
+
"worklet";
|
|
73
|
+
if (IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {
|
|
74
|
+
handler.onEnd?.(e);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}, deps);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { useSmoothKeyboardHandler };
|
|
81
|
+
//# sourceMappingURL=useSmoothKeyboardHandler.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSmoothKeyboardHandler.js","names":[],"sources":["esm/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js"],"sourcesContent":["import { useMemo } from \"react\";\nimport { Platform } from \"react-native-web\";\nimport { Easing, useSharedValue, withTiming } from \"react-native-reanimated\";\nimport { useKeyboardHandler } from \"../../hooks\";\nimport { useAnimatedReaction } from \"../../reanimated\";\nconst IS_ANDROID_ELEVEN_OR_HIGHER = Platform.OS === \"android\" && Platform.Version >= 30;\nconst IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS = IS_ANDROID_ELEVEN_OR_HIGHER || Platform.OS === \"ios\";\nconst TELEGRAM_ANDROID_TIMING_CONFIG = {\n duration: 250,\n easing: Easing.bezier(\n 0.19919472913616398,\n 0.010644531250000006,\n 0.27920937042459737,\n 0.91025390625\n )\n};\nconst useSmoothKeyboardHandler = (unstableHandler, deps) => {\n const handler = useMemo(() => unstableHandler, deps ?? []);\n const target = useSharedValue(-1);\n const height = useSharedValue(0);\n const persistedHeight = useSharedValue(0);\n const animatedKeyboardHeight = useSharedValue(0);\n useAnimatedReaction(\n () => {\n if (IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {\n return;\n }\n if (persistedHeight.value === 0) {\n return;\n }\n const event = {\n // it'll be always `TELEGRAM_ANDROID_TIMING_CONFIG.duration`, since we're running animation via `withTiming`\n duration: TELEGRAM_ANDROID_TIMING_CONFIG.duration,\n target: target.value,\n height: animatedKeyboardHeight.value,\n progress: animatedKeyboardHeight.value / persistedHeight.value\n };\n return event;\n },\n (evt, previous) => {\n if (!evt || evt.height === previous?.height && evt.target === previous?.target && evt.progress === previous?.progress) {\n return;\n }\n handler.onMove?.(evt);\n if (evt.height === height.value) {\n handler.onEnd?.(evt);\n persistedHeight.value = height.value;\n }\n },\n // create shallow copy (if deps specified) since `useAnimatedReaction` modifies them\n deps ? [...deps] : deps\n );\n useKeyboardHandler(\n {\n onStart: (e) => {\n \"worklet\";\n if (!IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS && e.height === persistedHeight.value) {\n handler.onStart?.(e);\n handler.onEnd?.(e);\n return;\n }\n target.value = e.target;\n height.value = e.height;\n if (e.height > 0) {\n persistedHeight.value = e.height;\n }\n if (!IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {\n animatedKeyboardHeight.value = withTiming(\n e.height,\n TELEGRAM_ANDROID_TIMING_CONFIG\n );\n }\n handler.onStart?.({\n ...e,\n duration: IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS ? e.duration : TELEGRAM_ANDROID_TIMING_CONFIG.duration\n });\n },\n onMove: (e) => {\n \"worklet\";\n if (IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {\n handler.onMove?.(e);\n }\n },\n onEnd: (e) => {\n \"worklet\";\n if (IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {\n handler.onEnd?.(e);\n }\n }\n },\n deps\n );\n};\nexport {\n useSmoothKeyboardHandler\n};\n//# sourceMappingURL=useSmoothKeyboardHandler.js.map\n"],"mappings":";;;;;;;AAKA,MAAM,8BAA8B,SAAS,OAAO,aAAa,SAAS,WAAW;AACrF,MAAM,qCAAqC,+BAA+B,SAAS,OAAO;AAC1F,MAAM,iCAAiC;CACrC,UAAU;CACV,QAAQ,OAAO,OACb,oBACA,qBACA,oBACA,YACF;AACF;AACA,MAAM,4BAA4B,iBAAiB,SAAS;CAC1D,MAAM,UAAU,cAAc,iBAAiB,QAAQ,CAAC,CAAC;CACzD,MAAM,SAAS,eAAe,CAAC,CAAC;CAChC,MAAM,SAAS,eAAe,CAAC;CAC/B,MAAM,kBAAkB,eAAe,CAAC;CACxC,MAAM,yBAAyB,eAAe,CAAC;CAC/C,0BACQ;EACJ,IAAI,oCAAoC;GACtC;EACF;EACA,IAAI,gBAAgB,UAAU,GAAG;GAC/B;EACF;EACA,MAAM,QAAQ;GAEZ,UAAU,+BAA+B;GACzC,QAAQ,OAAO;GACf,QAAQ,uBAAuB;GAC/B,UAAU,uBAAuB,QAAQ,gBAAgB;EAC3D;EACA,OAAO;CACT,IACC,KAAK,aAAa;EACjB,IAAI,CAAC,OAAO,IAAI,WAAW,UAAU,UAAU,IAAI,WAAW,UAAU,UAAU,IAAI,aAAa,UAAU,UAAU;GACrH;EACF;EACA,QAAQ,SAAS,GAAG;EACpB,IAAI,IAAI,WAAW,OAAO,OAAO;GAC/B,QAAQ,QAAQ,GAAG;GACnB,gBAAgB,QAAQ,OAAO;EACjC;CACF,GAEA,OAAO,CAAC,GAAG,IAAI,IAAI,IACrB;CACA,mBACE;EACE,UAAU,MAAM;GACd;GACA,IAAI,CAAC,sCAAsC,EAAE,WAAW,gBAAgB,OAAO;IAC7E,QAAQ,UAAU,CAAC;IACnB,QAAQ,QAAQ,CAAC;IACjB;GACF;GACA,OAAO,QAAQ,EAAE;GACjB,OAAO,QAAQ,EAAE;GACjB,IAAI,EAAE,SAAS,GAAG;IAChB,gBAAgB,QAAQ,EAAE;GAC5B;GACA,IAAI,CAAC,oCAAoC;IACvC,uBAAuB,QAAQ,WAC7B,EAAE,QACF,8BACF;GACF;GACA,QAAQ,UAAU;IAChB,GAAG;IACH,UAAU,qCAAqC,EAAE,WAAW,+BAA+B;GAC7F,CAAC;EACH;EACA,SAAS,MAAM;GACb;GACA,IAAI,oCAAoC;IACtC,QAAQ,SAAS,CAAC;GACpB;EACF;EACA,QAAQ,MAAM;GACZ;GACA,IAAI,oCAAoC;IACtC,QAAQ,QAAQ,CAAC;GACnB;EACF;CACF,GACA,IACF;AACF"}
|
package/dist/esm/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.native.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { Platform } from "react-native";
|
|
3
|
+
import { Easing, useSharedValue, withTiming } from "react-native-reanimated";
|
|
4
|
+
import { useKeyboardHandler } from "../../hooks/index.native.js";
|
|
5
|
+
import { useAnimatedReaction } from "../../reanimated.native.js";
|
|
6
|
+
|
|
7
|
+
// dist/esm/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.native.js
|
|
8
|
+
var IS_ANDROID_ELEVEN_OR_HIGHER = Platform.OS === "android" && Platform.Version >= 30;
|
|
9
|
+
var IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS = IS_ANDROID_ELEVEN_OR_HIGHER || Platform.OS === "ios";
|
|
10
|
+
var TELEGRAM_ANDROID_TIMING_CONFIG = {
|
|
11
|
+
duration: 250,
|
|
12
|
+
easing: Easing.bezier(.19919472913616398, .010644531250000006, .27920937042459737, .91025390625)
|
|
13
|
+
};
|
|
14
|
+
var useSmoothKeyboardHandler = function useSmoothKeyboardHandler2(unstableHandler, deps) {
|
|
15
|
+
var handler = useMemo(function() {
|
|
16
|
+
return unstableHandler;
|
|
17
|
+
}, deps !== null && deps !== void 0 ? deps : []);
|
|
18
|
+
var target = useSharedValue(-1);
|
|
19
|
+
var height = useSharedValue(0);
|
|
20
|
+
var persistedHeight = useSharedValue(0);
|
|
21
|
+
var animatedKeyboardHeight = useSharedValue(0);
|
|
22
|
+
useAnimatedReaction(function() {
|
|
23
|
+
if (IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (persistedHeight.value === 0) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
var event = {
|
|
30
|
+
duration: TELEGRAM_ANDROID_TIMING_CONFIG.duration,
|
|
31
|
+
target: target.value,
|
|
32
|
+
height: animatedKeyboardHeight.value,
|
|
33
|
+
progress: animatedKeyboardHeight.value / persistedHeight.value
|
|
34
|
+
};
|
|
35
|
+
return event;
|
|
36
|
+
}, function(evt, previous) {
|
|
37
|
+
var _handler_onMove;
|
|
38
|
+
if (!evt || evt.height === (previous === null || previous === void 0 ? void 0 : previous.height) && evt.target === (previous === null || previous === void 0 ? void 0 : previous.target) && evt.progress === (previous === null || previous === void 0 ? void 0 : previous.progress)) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
(_handler_onMove = handler.onMove) === null || _handler_onMove === void 0 ? void 0 : _handler_onMove.call(handler, evt);
|
|
42
|
+
if (evt.height === height.value) {
|
|
43
|
+
var _handler_onEnd;
|
|
44
|
+
(_handler_onEnd = handler.onEnd) === null || _handler_onEnd === void 0 ? void 0 : _handler_onEnd.call(handler, evt);
|
|
45
|
+
persistedHeight.value = height.value;
|
|
46
|
+
}
|
|
47
|
+
}, deps ? [...deps] : deps);
|
|
48
|
+
useKeyboardHandler({
|
|
49
|
+
onStart: function onStart(e) {
|
|
50
|
+
"worklet";
|
|
51
|
+
var _handler_onStart;
|
|
52
|
+
if (!IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS && e.height === persistedHeight.value) {
|
|
53
|
+
var _handler_onStart1, _handler_onEnd;
|
|
54
|
+
(_handler_onStart1 = handler.onStart) === null || _handler_onStart1 === void 0 ? void 0 : _handler_onStart1.call(handler, e);
|
|
55
|
+
(_handler_onEnd = handler.onEnd) === null || _handler_onEnd === void 0 ? void 0 : _handler_onEnd.call(handler, e);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
target.value = e.target;
|
|
59
|
+
height.value = e.height;
|
|
60
|
+
if (e.height > 0) {
|
|
61
|
+
persistedHeight.value = e.height;
|
|
62
|
+
}
|
|
63
|
+
if (!IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {
|
|
64
|
+
animatedKeyboardHeight.value = withTiming(e.height, TELEGRAM_ANDROID_TIMING_CONFIG);
|
|
65
|
+
}
|
|
66
|
+
(_handler_onStart = handler.onStart) === null || _handler_onStart === void 0 ? void 0 : _handler_onStart.call(handler, {
|
|
67
|
+
...e,
|
|
68
|
+
duration: IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS ? e.duration : TELEGRAM_ANDROID_TIMING_CONFIG.duration
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
onMove: function onMove(e) {
|
|
72
|
+
"worklet";
|
|
73
|
+
if (IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {
|
|
74
|
+
var _handler_onMove;
|
|
75
|
+
(_handler_onMove = handler.onMove) === null || _handler_onMove === void 0 ? void 0 : _handler_onMove.call(handler, e);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
onEnd: function onEnd(e) {
|
|
79
|
+
"worklet";
|
|
80
|
+
if (IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {
|
|
81
|
+
var _handler_onEnd;
|
|
82
|
+
(_handler_onEnd = handler.onEnd) === null || _handler_onEnd === void 0 ? void 0 : _handler_onEnd.call(handler, e);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, deps);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export { useSmoothKeyboardHandler };
|
|
89
|
+
//# sourceMappingURL=useSmoothKeyboardHandler.native.js.map
|
package/dist/esm/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.native.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSmoothKeyboardHandler.native.js","names":[],"sources":["esm/keyboard/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.native.js"],"sourcesContent":["import { useMemo } from \"react\";\nimport { Platform } from \"react-native\";\nimport { Easing, useSharedValue, withTiming } from \"react-native-reanimated\";\nimport { useKeyboardHandler } from \"../../hooks\";\nimport { useAnimatedReaction } from \"../../reanimated\";\nvar IS_ANDROID_ELEVEN_OR_HIGHER = Platform.OS === \"android\" && Platform.Version >= 30;\nvar IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS = IS_ANDROID_ELEVEN_OR_HIGHER || Platform.OS === \"ios\";\nvar TELEGRAM_ANDROID_TIMING_CONFIG = {\n duration: 250,\n easing: Easing.bezier(0.19919472913616398, 0.010644531250000006, 0.27920937042459737, 0.91025390625)\n};\nvar useSmoothKeyboardHandler = function useSmoothKeyboardHandler2(unstableHandler, deps) {\n var handler = useMemo(function() {\n return unstableHandler;\n }, deps !== null && deps !== void 0 ? deps : []);\n var target = useSharedValue(-1);\n var height = useSharedValue(0);\n var persistedHeight = useSharedValue(0);\n var animatedKeyboardHeight = useSharedValue(0);\n useAnimatedReaction(\n function() {\n if (IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {\n return;\n }\n if (persistedHeight.value === 0) {\n return;\n }\n var event = {\n // it'll be always `TELEGRAM_ANDROID_TIMING_CONFIG.duration`, since we're running animation via `withTiming`\n duration: TELEGRAM_ANDROID_TIMING_CONFIG.duration,\n target: target.value,\n height: animatedKeyboardHeight.value,\n progress: animatedKeyboardHeight.value / persistedHeight.value\n };\n return event;\n },\n function(evt, previous) {\n var _handler_onMove;\n if (!evt || evt.height === (previous === null || previous === void 0 ? void 0 : previous.height) && evt.target === (previous === null || previous === void 0 ? void 0 : previous.target) && evt.progress === (previous === null || previous === void 0 ? void 0 : previous.progress)) {\n return;\n }\n (_handler_onMove = handler.onMove) === null || _handler_onMove === void 0 ? void 0 : _handler_onMove.call(handler, evt);\n if (evt.height === height.value) {\n var _handler_onEnd;\n (_handler_onEnd = handler.onEnd) === null || _handler_onEnd === void 0 ? void 0 : _handler_onEnd.call(handler, evt);\n persistedHeight.value = height.value;\n }\n },\n // create shallow copy (if deps specified) since `useAnimatedReaction` modifies them\n deps ? [\n ...deps\n ] : deps\n );\n useKeyboardHandler({\n onStart: function onStart(e) {\n \"worklet\";\n var _handler_onStart;\n if (!IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS && e.height === persistedHeight.value) {\n var _handler_onStart1, _handler_onEnd;\n (_handler_onStart1 = handler.onStart) === null || _handler_onStart1 === void 0 ? void 0 : _handler_onStart1.call(handler, e);\n (_handler_onEnd = handler.onEnd) === null || _handler_onEnd === void 0 ? void 0 : _handler_onEnd.call(handler, e);\n return;\n }\n target.value = e.target;\n height.value = e.height;\n if (e.height > 0) {\n persistedHeight.value = e.height;\n }\n if (!IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {\n animatedKeyboardHeight.value = withTiming(e.height, TELEGRAM_ANDROID_TIMING_CONFIG);\n }\n (_handler_onStart = handler.onStart) === null || _handler_onStart === void 0 ? void 0 : _handler_onStart.call(handler, {\n ...e,\n duration: IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS ? e.duration : TELEGRAM_ANDROID_TIMING_CONFIG.duration\n });\n },\n onMove: function onMove(e) {\n \"worklet\";\n if (IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {\n var _handler_onMove;\n (_handler_onMove = handler.onMove) === null || _handler_onMove === void 0 ? void 0 : _handler_onMove.call(handler, e);\n }\n },\n onEnd: function onEnd(e) {\n \"worklet\";\n if (IS_ANDROID_ELEVEN_OR_HIGHER_OR_IOS) {\n var _handler_onEnd;\n (_handler_onEnd = handler.onEnd) === null || _handler_onEnd === void 0 ? void 0 : _handler_onEnd.call(handler, e);\n }\n }\n }, deps);\n};\nexport {\n useSmoothKeyboardHandler\n};\n//# sourceMappingURL=useSmoothKeyboardHandler.js.map\n"],"mappings":";;;;;;;AAKA,IAAI,8BAA8B,SAAS,OAAO,aAAa,SAAS,WAAW;AACnF,IAAI,qCAAqC,+BAA+B,SAAS,OAAO;AACxF,IAAI,iCAAiC;CACnC,UAAU;CACV,QAAQ,OAAO,OAAO,oBAAqB,qBAAsB,oBAAqB,YAAa;AACrG;AACA,IAAI,2BAA2B,SAAS,0BAA0B,iBAAiB,MAAM;CACvF,IAAI,UAAU,QAAQ,WAAW;EAC/B,OAAO;CACT,GAAG,SAAS,QAAQ,SAAS,KAAK,IAAI,OAAO,CAAC,CAAC;CAC/C,IAAI,SAAS,eAAe,CAAC,CAAC;CAC9B,IAAI,SAAS,eAAe,CAAC;CAC7B,IAAI,kBAAkB,eAAe,CAAC;CACtC,IAAI,yBAAyB,eAAe,CAAC;CAC7C,oBACE,WAAW;EACT,IAAI,oCAAoC;GACtC;EACF;EACA,IAAI,gBAAgB,UAAU,GAAG;GAC/B;EACF;EACA,IAAI,QAAQ;GAEV,UAAU,+BAA+B;GACzC,QAAQ,OAAO;GACf,QAAQ,uBAAuB;GAC/B,UAAU,uBAAuB,QAAQ,gBAAgB;EAC3D;EACA,OAAO;CACT,GACA,SAAS,KAAK,UAAU;EACtB,IAAI;EACJ,IAAI,CAAC,OAAO,IAAI,YAAY,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,WAAW,IAAI,YAAY,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,WAAW,IAAI,cAAc,aAAa,QAA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KAAK,SAAS,CAAC;GACtH;EACF;EACA,OAAO,SAAS,MAAM,GAAG;GACvB;GACA,IAAI,oCAAoC;IACtC,IAAI;IACJ,CAAC,iBAAiB,QAAQ,WAAW,QAAQ,mBAAmB,KAAK,IAAI,KAAK,IAAI,eAAe,KAAK,SAAS,CAAC;GAClH;EACF;CACF,GAAG,IAAI;AACT"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// dist/esm/keyboard/components/KeyboardAwareScrollView/utils.js
|
|
2
|
+
const debounce = (worklet, wait = 0) => {
|
|
3
|
+
"worklet";
|
|
4
|
+
const value = { time: 0 };
|
|
5
|
+
return (...args) => {
|
|
6
|
+
"worklet";
|
|
7
|
+
const t = Date.now();
|
|
8
|
+
const now = t - value.time;
|
|
9
|
+
if (now < wait) {
|
|
10
|
+
value.time = t;
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
value.time = t;
|
|
14
|
+
return worklet(...args);
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const scrollDistanceWithRespectToSnapPoints = (defaultScrollValue, snapPoints) => {
|
|
18
|
+
"worklet";
|
|
19
|
+
let snapPoint;
|
|
20
|
+
if (snapPoints) {
|
|
21
|
+
snapPoint = snapPoints.find((offset) => offset >= defaultScrollValue);
|
|
22
|
+
}
|
|
23
|
+
return snapPoint ?? defaultScrollValue;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { debounce, scrollDistanceWithRespectToSnapPoints };
|
|
27
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["esm/keyboard/components/KeyboardAwareScrollView/utils.js"],"sourcesContent":["const debounce = (worklet, wait = 0) => {\n \"worklet\";\n const value = {\n time: 0\n };\n return (...args) => {\n \"worklet\";\n const t = Date.now();\n const now = t - value.time;\n if (now < wait) {\n value.time = t;\n return;\n }\n value.time = t;\n return worklet(...args);\n };\n};\nconst scrollDistanceWithRespectToSnapPoints = (defaultScrollValue, snapPoints) => {\n \"worklet\";\n let snapPoint;\n if (snapPoints) {\n snapPoint = snapPoints.find((offset) => offset >= defaultScrollValue);\n }\n return snapPoint ?? defaultScrollValue;\n};\nexport {\n debounce,\n scrollDistanceWithRespectToSnapPoints\n};\n//# sourceMappingURL=utils.js.map\n"],"mappings":";AAAA,MAAM,YAAY,SAAS,OAAO,MAAM;CACtC;CACA,MAAM,QAAQ,EACZ,MAAM,EACR;CACA,QAAQ,GAAG,SAAS;EAClB;EACA,MAAM,IAAI,KAAK,IAAI;EACnB,MAAM,MAAM,IAAI,MAAM;EACtB,IAAI,MAAM,MAAM;GACd,MAAM,OAAO;GACb;EACF;EACA,MAAM,OAAO;EACb,OAAO,QAAQ,GAAG,IAAI;CACxB;AACF;AACA,MAAM,yCAAyC,oBAAoB,eAAe;CAChF;CACA,IAAI;CACJ,IAAI,YAAY;EACd,YAAY,WAAW,MAAM,WAAW,UAAU,kBAAkB;CACtE;CACA,OAAO,aAAa;AACtB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// dist/esm/keyboard/components/KeyboardAwareScrollView/utils.native.js
|
|
2
|
+
var debounce = function debounce2(worklet) {
|
|
3
|
+
"worklet";
|
|
4
|
+
var wait = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
5
|
+
var value = { time: 0 };
|
|
6
|
+
return function() {
|
|
7
|
+
"worklet";
|
|
8
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9
|
+
args[_key] = arguments[_key];
|
|
10
|
+
}
|
|
11
|
+
var t = Date.now();
|
|
12
|
+
var now = t - value.time;
|
|
13
|
+
if (now < wait) {
|
|
14
|
+
value.time = t;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
value.time = t;
|
|
18
|
+
return worklet(...args);
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
var scrollDistanceWithRespectToSnapPoints = function scrollDistanceWithRespectToSnapPoints2(defaultScrollValue, snapPoints) {
|
|
22
|
+
"worklet";
|
|
23
|
+
var snapPoint;
|
|
24
|
+
if (snapPoints) {
|
|
25
|
+
snapPoint = snapPoints.find(function(offset) {
|
|
26
|
+
return offset >= defaultScrollValue;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return snapPoint !== null && snapPoint !== void 0 ? snapPoint : defaultScrollValue;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { debounce, scrollDistanceWithRespectToSnapPoints };
|
|
33
|
+
//# sourceMappingURL=utils.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.native.js","names":[],"sources":["esm/keyboard/components/KeyboardAwareScrollView/utils.native.js"],"sourcesContent":["var debounce = function debounce2(worklet) {\n \"worklet\";\n var wait = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;\n var value = {\n time: 0\n };\n return function() {\n \"worklet\";\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var t = Date.now();\n var now = t - value.time;\n if (now < wait) {\n value.time = t;\n return;\n }\n value.time = t;\n return worklet(...args);\n };\n};\nvar scrollDistanceWithRespectToSnapPoints = function scrollDistanceWithRespectToSnapPoints2(defaultScrollValue, snapPoints) {\n \"worklet\";\n var snapPoint;\n if (snapPoints) {\n snapPoint = snapPoints.find(function(offset) {\n return offset >= defaultScrollValue;\n });\n }\n return snapPoint !== null && snapPoint !== void 0 ? snapPoint : defaultScrollValue;\n};\nexport {\n debounce,\n scrollDistanceWithRespectToSnapPoints\n};\n//# sourceMappingURL=utils.js.map\n"],"mappings":";AAAA,IAAI,WAAW,SAAS,UAAU,SAAS;CACzC;CACA,IAAI,OAAO,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC5E,IAAI,QAAQ,EACV,MAAM,EACR;CACA,OAAO,WAAW;EAChB;EACA,KAAK,IAAI,OAAO,UAAU,QAAQ,OAAO,IAAI,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,MAAM,QAAQ;GACvF,KAAK,QAAQ,UAAU;EACzB;EACA,IAAI,IAAI,KAAK,IAAI;EACjB,IAAI,MAAM,IAAI,MAAM;EACpB,IAAI,MAAM,MAAM;GACd,MAAM,OAAO;GACb;EACF;EACA,MAAM,OAAO;EACb,OAAO,QAAQ,GAAG,IAAI;CACxB;AACF;AACA,IAAI,wCAAwC,SAAS,uCAAuC,oBAAoB,YAAY;CAC1H;CACA,IAAI;CACJ,IAAI,YAAY;EACd,YAAY,WAAW,KAAK,SAAS,QAAQ;GAC3C,OAAO,UAAU;EACnB,CAAC;CACH;CACA,OAAO,cAAc,QAAQ,cAAc,KAAK,IAAI,YAAY;AAClE"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { forwardRef, useCallback, useMemo } from "react";
|
|
2
|
+
import { Platform, StyleSheet } from "react-native-web";
|
|
3
|
+
import Reanimated, { makeMutable, useAnimatedRef } from "react-native-reanimated";
|
|
4
|
+
import { useAnimatedStyle, useDerivedValue } from "../../reanimated.mjs";
|
|
5
|
+
import useCombinedRef from "../hooks/useCombinedRef.mjs";
|
|
6
|
+
import ScrollViewWithBottomPadding from "../ScrollViewWithBottomPadding/index.mjs";
|
|
7
|
+
import { useChatKeyboard } from "./useChatKeyboard/index.mjs";
|
|
8
|
+
import { useEndVisible } from "./useEndVisible.mjs";
|
|
9
|
+
import { useExtraContentPadding } from "./useExtraContentPadding/index.mjs";
|
|
10
|
+
import { useFrozenPadding } from "./useFrozenPadding/index.mjs";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
|
|
13
|
+
// dist/esm/keyboard/components/KeyboardChatScrollView/index.js
|
|
14
|
+
const OS = Platform.OS;
|
|
15
|
+
const ZERO_CONTENT_PADDING = makeMutable(0);
|
|
16
|
+
const ZERO_BLANK_SPACE = makeMutable(0);
|
|
17
|
+
const KeyboardChatScrollView = forwardRef(({ children, ScrollViewComponent = Reanimated.ScrollView, inverted = false, keyboardLiftBehavior = "always", freeze = false, offset = 0, extraContentPadding = ZERO_CONTENT_PADDING, blankSpace = ZERO_BLANK_SPACE, applyWorkaroundForContentInsetHitTestBug = false, onLayout: onLayoutProp, onContentSizeChange: onContentSizeChangeProp, onEndVisible, ...rest }, ref) => {
|
|
18
|
+
const scrollViewRef = useAnimatedRef();
|
|
19
|
+
const onRef = useCombinedRef(ref, scrollViewRef);
|
|
20
|
+
const contentInsetTop = OS === "ios" ? rest.contentInset?.top ?? 0 : 0;
|
|
21
|
+
const minScroll = contentInsetTop > 0 ? -contentInsetTop : 0;
|
|
22
|
+
const freezeSV = useDerivedValue(() => typeof freeze === "boolean" ? freeze : freeze.value);
|
|
23
|
+
const { padding, currentHeight, contentOffsetY, scroll, layout, size, onLayout: onLayoutInternal, onContentSizeChange: onContentSizeChangeInternal } = useChatKeyboard(scrollViewRef, {
|
|
24
|
+
inverted,
|
|
25
|
+
keyboardLiftBehavior,
|
|
26
|
+
freeze: freezeSV,
|
|
27
|
+
offset,
|
|
28
|
+
minScroll,
|
|
29
|
+
blankSpace,
|
|
30
|
+
extraContentPadding,
|
|
31
|
+
initialContentOffsetY: rest.contentOffset?.y
|
|
32
|
+
});
|
|
33
|
+
useExtraContentPadding({
|
|
34
|
+
scrollViewRef,
|
|
35
|
+
extraContentPadding,
|
|
36
|
+
keyboardPadding: padding,
|
|
37
|
+
blankSpace,
|
|
38
|
+
scroll,
|
|
39
|
+
layout,
|
|
40
|
+
size,
|
|
41
|
+
contentOffsetY,
|
|
42
|
+
minScroll,
|
|
43
|
+
inverted,
|
|
44
|
+
keyboardLiftBehavior,
|
|
45
|
+
freeze: freezeSV
|
|
46
|
+
});
|
|
47
|
+
useFrozenPadding({
|
|
48
|
+
freeze: freezeSV,
|
|
49
|
+
offset,
|
|
50
|
+
padding
|
|
51
|
+
});
|
|
52
|
+
useEndVisible({
|
|
53
|
+
scroll,
|
|
54
|
+
layout,
|
|
55
|
+
size,
|
|
56
|
+
inverted,
|
|
57
|
+
onEndVisible
|
|
58
|
+
});
|
|
59
|
+
const totalPadding = useDerivedValue(() => Math.min(layout.value.height, Math.max(blankSpace.value, padding.value + extraContentPadding.value)));
|
|
60
|
+
const indicatorPadding = useDerivedValue(() => padding.value + extraContentPadding.value);
|
|
61
|
+
const onLayout = useCallback((e) => {
|
|
62
|
+
onLayoutInternal(e);
|
|
63
|
+
onLayoutProp?.(e);
|
|
64
|
+
}, [onLayoutInternal, onLayoutProp]);
|
|
65
|
+
const onContentSizeChange = useCallback((w, h) => {
|
|
66
|
+
onContentSizeChangeInternal(w, h);
|
|
67
|
+
onContentSizeChangeProp?.(w, h);
|
|
68
|
+
}, [onContentSizeChangeInternal, onContentSizeChangeProp]);
|
|
69
|
+
const commitStyle = useAnimatedStyle(() => ({ transform: [{ translateY: -currentHeight.value }] }), []);
|
|
70
|
+
const commit = useMemo(() => [styles.commitView, commitStyle], [commitStyle]);
|
|
71
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ScrollViewWithBottomPadding, {
|
|
72
|
+
ref: onRef,
|
|
73
|
+
...rest,
|
|
74
|
+
applyWorkaroundForContentInsetHitTestBug,
|
|
75
|
+
bottomPadding: totalPadding,
|
|
76
|
+
contentOffsetY,
|
|
77
|
+
inverted,
|
|
78
|
+
scrollIndicatorPadding: indicatorPadding,
|
|
79
|
+
ScrollViewComponent,
|
|
80
|
+
onContentSizeChange,
|
|
81
|
+
onLayout,
|
|
82
|
+
children
|
|
83
|
+
}), /* @__PURE__ */ jsx(Reanimated.View, { style: commit })] });
|
|
84
|
+
});
|
|
85
|
+
const styles = StyleSheet.create({ commitView: {
|
|
86
|
+
display: "none",
|
|
87
|
+
position: "absolute"
|
|
88
|
+
} });
|
|
89
|
+
var KeyboardChatScrollView_default = KeyboardChatScrollView;
|
|
90
|
+
|
|
91
|
+
export { KeyboardChatScrollView_default as default };
|
|
92
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/keyboard/components/KeyboardChatScrollView/index.js"],"sourcesContent":["import { forwardRef, useCallback, useMemo } from \"react\";\nimport { Platform, StyleSheet } from \"react-native-web\";\nimport { makeMutable, useAnimatedRef } from \"react-native-reanimated\";\nimport Reanimated from \"react-native-reanimated\";\nimport { useAnimatedStyle, useDerivedValue } from \"../../reanimated\";\nimport useCombinedRef from \"../hooks/useCombinedRef\";\nimport ScrollViewWithBottomPadding from \"../ScrollViewWithBottomPadding\";\nimport { useChatKeyboard } from \"./useChatKeyboard\";\nimport { useEndVisible } from \"./useEndVisible\";\nimport { useExtraContentPadding } from \"./useExtraContentPadding\";\nimport { useFrozenPadding } from \"./useFrozenPadding\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nconst OS = Platform.OS;\nconst ZERO_CONTENT_PADDING = makeMutable(0);\nconst ZERO_BLANK_SPACE = makeMutable(0);\nconst KeyboardChatScrollView = forwardRef(\n ({\n children,\n ScrollViewComponent = Reanimated.ScrollView,\n inverted = false,\n keyboardLiftBehavior = \"always\",\n freeze = false,\n offset = 0,\n extraContentPadding = ZERO_CONTENT_PADDING,\n blankSpace = ZERO_BLANK_SPACE,\n applyWorkaroundForContentInsetHitTestBug = false,\n onLayout: onLayoutProp,\n onContentSizeChange: onContentSizeChangeProp,\n onEndVisible,\n ...rest\n }, ref) => {\n const scrollViewRef = useAnimatedRef();\n const onRef = useCombinedRef(ref, scrollViewRef);\n const contentInsetTop = OS === \"ios\" ? rest.contentInset?.top ?? 0 : 0;\n const minScroll = contentInsetTop > 0 ? -contentInsetTop : 0;\n const freezeSV = useDerivedValue(\n () => typeof freeze === \"boolean\" ? freeze : freeze.value\n );\n const {\n padding,\n currentHeight,\n contentOffsetY,\n scroll,\n layout,\n size,\n onLayout: onLayoutInternal,\n onContentSizeChange: onContentSizeChangeInternal\n } = useChatKeyboard(scrollViewRef, {\n inverted,\n keyboardLiftBehavior,\n freeze: freezeSV,\n offset,\n minScroll,\n blankSpace,\n extraContentPadding,\n initialContentOffsetY: rest.contentOffset?.y\n });\n useExtraContentPadding({\n scrollViewRef,\n extraContentPadding,\n keyboardPadding: padding,\n blankSpace,\n scroll,\n layout,\n size,\n contentOffsetY,\n minScroll,\n inverted,\n keyboardLiftBehavior,\n freeze: freezeSV\n });\n useFrozenPadding({\n freeze: freezeSV,\n offset,\n padding\n });\n useEndVisible({\n scroll,\n layout,\n size,\n inverted,\n onEndVisible\n });\n const totalPadding = useDerivedValue(\n () => Math.min(\n layout.value.height,\n Math.max(blankSpace.value, padding.value + extraContentPadding.value)\n )\n );\n const indicatorPadding = useDerivedValue(\n () => padding.value + extraContentPadding.value\n );\n const onLayout = useCallback(\n (e) => {\n onLayoutInternal(e);\n onLayoutProp?.(e);\n },\n [onLayoutInternal, onLayoutProp]\n );\n const onContentSizeChange = useCallback(\n (w, h) => {\n onContentSizeChangeInternal(w, h);\n onContentSizeChangeProp?.(w, h);\n },\n [onContentSizeChangeInternal, onContentSizeChangeProp]\n );\n const commitStyle = useAnimatedStyle(\n () => ({\n transform: [{ translateY: -currentHeight.value }]\n }),\n []\n );\n const commit = useMemo(() => [styles.commitView, commitStyle], [commitStyle]);\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n ScrollViewWithBottomPadding,\n {\n ref: onRef,\n ...rest,\n applyWorkaroundForContentInsetHitTestBug,\n bottomPadding: totalPadding,\n contentOffsetY,\n inverted,\n scrollIndicatorPadding: indicatorPadding,\n ScrollViewComponent,\n onContentSizeChange,\n onLayout,\n children\n }\n ),\n /* @__PURE__ */ jsx(Reanimated.View, { style: commit })\n ] });\n }\n);\nconst styles = StyleSheet.create({\n commitView: {\n display: \"none\",\n position: \"absolute\"\n }\n});\nvar KeyboardChatScrollView_default = KeyboardChatScrollView;\nexport {\n KeyboardChatScrollView_default as default\n};\n//# sourceMappingURL=index.js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GAAG,CAAC;EAChC,0BAA0B,GAAG,CAAC;CAChC,GACA,CAAC,6BAA6B,uBAAuB,CACvD;CACA,MAAM,cAAc,wBACX,EACL,WAAW,CAAC,EAAE,YAAY,CAAC,cAAc,MAAM,CAAC,EAClD,IACA,CAAC,CACH;CACA,MAAM,SAAS,cAAc,CAAC,OAAO,YAAY,WAAW,GAAG,CAAC,WAAW,CAAC;CAC5E,OAAuB,qBAAK,UAAU,EAAE,UAAU,CAChC,oBACd,6BACA;EACE,KAAK;EACL,GAAG;EACH;EACA,eAAe;EACf;EACA;EACA,wBAAwB;EACxB;EACA;EACA;EACA;CACF,CACF,GACgB,oBAAI,WAAW,MAAM,EAAE,OAAO,OAAO,CAAC,CACxD,EAAE,CAAC;AACL,CACF;AACA,MAAM,SAAS,WAAW,OAAO,EAC/B,YAAY;CACV,SAAS;CACT,UAAU;AACZ,EACF,CAAC;AACD,IAAI,iCAAiC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useCallback, useMemo } from "react";
|
|
3
|
+
import { Platform, StyleSheet } from "react-native";
|
|
4
|
+
import Reanimated, { makeMutable, useAnimatedRef } from "react-native-reanimated";
|
|
5
|
+
import { useAnimatedStyle, useDerivedValue } from "../../reanimated.native.js";
|
|
6
|
+
import useCombinedRef from "../hooks/useCombinedRef.native.js";
|
|
7
|
+
import ScrollViewWithBottomPadding from "../ScrollViewWithBottomPadding/index.native.js";
|
|
8
|
+
import { useChatKeyboard } from "./useChatKeyboard";
|
|
9
|
+
import { useEndVisible } from "./useEndVisible.native.js";
|
|
10
|
+
import { useExtraContentPadding } from "./useExtraContentPadding/index.native.js";
|
|
11
|
+
import { useFrozenPadding } from "./useFrozenPadding/index.native.js";
|
|
12
|
+
|
|
13
|
+
// dist/esm/keyboard/components/KeyboardChatScrollView/index.native.js
|
|
14
|
+
var OS = Platform.OS;
|
|
15
|
+
var ZERO_CONTENT_PADDING = makeMutable(0);
|
|
16
|
+
var ZERO_BLANK_SPACE = makeMutable(0);
|
|
17
|
+
var KeyboardChatScrollView = /* @__PURE__ */ forwardRef(function(param, ref) {
|
|
18
|
+
var { children, ScrollViewComponent = Reanimated.ScrollView, inverted = false, keyboardLiftBehavior = "always", freeze = false, offset = 0, extraContentPadding = ZERO_CONTENT_PADDING, blankSpace = ZERO_BLANK_SPACE, applyWorkaroundForContentInsetHitTestBug = false, onLayout: onLayoutProp, onContentSizeChange: onContentSizeChangeProp, onEndVisible, ...rest } = param;
|
|
19
|
+
var _ref;
|
|
20
|
+
var _rest_contentInset, _rest_contentOffset;
|
|
21
|
+
var scrollViewRef = useAnimatedRef();
|
|
22
|
+
var onRef = useCombinedRef(ref, scrollViewRef);
|
|
23
|
+
var contentInsetTop = OS === "ios" ? (_ref = (_rest_contentInset = rest.contentInset) === null || _rest_contentInset === void 0 ? void 0 : _rest_contentInset.top) !== null && _ref !== void 0 ? _ref : 0 : 0;
|
|
24
|
+
var minScroll = contentInsetTop > 0 ? -contentInsetTop : 0;
|
|
25
|
+
var freezeSV = useDerivedValue(function() {
|
|
26
|
+
return typeof freeze === "boolean" ? freeze : freeze.value;
|
|
27
|
+
});
|
|
28
|
+
var { padding, currentHeight, contentOffsetY, scroll, layout, size, onLayout: onLayoutInternal, onContentSizeChange: onContentSizeChangeInternal } = useChatKeyboard(scrollViewRef, {
|
|
29
|
+
inverted,
|
|
30
|
+
keyboardLiftBehavior,
|
|
31
|
+
freeze: freezeSV,
|
|
32
|
+
offset,
|
|
33
|
+
minScroll,
|
|
34
|
+
blankSpace,
|
|
35
|
+
extraContentPadding,
|
|
36
|
+
initialContentOffsetY: (_rest_contentOffset = rest.contentOffset) === null || _rest_contentOffset === void 0 ? void 0 : _rest_contentOffset.y
|
|
37
|
+
});
|
|
38
|
+
useExtraContentPadding({
|
|
39
|
+
scrollViewRef,
|
|
40
|
+
extraContentPadding,
|
|
41
|
+
keyboardPadding: padding,
|
|
42
|
+
blankSpace,
|
|
43
|
+
scroll,
|
|
44
|
+
layout,
|
|
45
|
+
size,
|
|
46
|
+
contentOffsetY,
|
|
47
|
+
minScroll,
|
|
48
|
+
inverted,
|
|
49
|
+
keyboardLiftBehavior,
|
|
50
|
+
freeze: freezeSV
|
|
51
|
+
});
|
|
52
|
+
useFrozenPadding({
|
|
53
|
+
freeze: freezeSV,
|
|
54
|
+
offset,
|
|
55
|
+
padding
|
|
56
|
+
});
|
|
57
|
+
useEndVisible({
|
|
58
|
+
scroll,
|
|
59
|
+
layout,
|
|
60
|
+
size,
|
|
61
|
+
inverted,
|
|
62
|
+
onEndVisible
|
|
63
|
+
});
|
|
64
|
+
var totalPadding = useDerivedValue(function() {
|
|
65
|
+
return Math.min(layout.value.height, Math.max(blankSpace.value, padding.value + extraContentPadding.value));
|
|
66
|
+
});
|
|
67
|
+
var indicatorPadding = useDerivedValue(function() {
|
|
68
|
+
return padding.value + extraContentPadding.value;
|
|
69
|
+
});
|
|
70
|
+
var onLayout = useCallback(function(e) {
|
|
71
|
+
onLayoutInternal(e);
|
|
72
|
+
onLayoutProp === null || onLayoutProp === void 0 ? void 0 : onLayoutProp(e);
|
|
73
|
+
}, [onLayoutInternal, onLayoutProp]);
|
|
74
|
+
var onContentSizeChange = useCallback(function(w, h) {
|
|
75
|
+
onContentSizeChangeInternal(w, h);
|
|
76
|
+
onContentSizeChangeProp === null || onContentSizeChangeProp === void 0 ? void 0 : onContentSizeChangeProp(w, h);
|
|
77
|
+
}, [onContentSizeChangeInternal, onContentSizeChangeProp]);
|
|
78
|
+
var commitStyle = useAnimatedStyle(function() {
|
|
79
|
+
return { transform: [{ translateY: -currentHeight.value }] };
|
|
80
|
+
}, []);
|
|
81
|
+
var commit = useMemo(function() {
|
|
82
|
+
return [styles.commitView, commitStyle];
|
|
83
|
+
}, [commitStyle]);
|
|
84
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ScrollViewWithBottomPadding, {
|
|
85
|
+
ref: onRef,
|
|
86
|
+
...rest,
|
|
87
|
+
applyWorkaroundForContentInsetHitTestBug,
|
|
88
|
+
bottomPadding: totalPadding,
|
|
89
|
+
contentOffsetY,
|
|
90
|
+
inverted,
|
|
91
|
+
scrollIndicatorPadding: indicatorPadding,
|
|
92
|
+
ScrollViewComponent,
|
|
93
|
+
onContentSizeChange,
|
|
94
|
+
onLayout,
|
|
95
|
+
children
|
|
96
|
+
}), /* @__PURE__ */ jsx(Reanimated.View, { style: commit })] });
|
|
97
|
+
});
|
|
98
|
+
var styles = StyleSheet.create({ commitView: {
|
|
99
|
+
display: "none",
|
|
100
|
+
position: "absolute"
|
|
101
|
+
} });
|
|
102
|
+
var KeyboardChatScrollView_default = KeyboardChatScrollView;
|
|
103
|
+
|
|
104
|
+
export { KeyboardChatScrollView_default as default };
|
|
105
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["_Fragment"],"sources":["esm/keyboard/components/KeyboardChatScrollView/index.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport React, { forwardRef, useCallback, useMemo } from \"react\";\nimport { Platform, StyleSheet } from \"react-native\";\nimport { makeMutable, useAnimatedRef } from \"react-native-reanimated\";\nimport Reanimated from \"react-native-reanimated\";\nimport { useAnimatedStyle, useDerivedValue } from \"../../reanimated\";\nimport useCombinedRef from \"../hooks/useCombinedRef\";\nimport ScrollViewWithBottomPadding from \"../ScrollViewWithBottomPadding\";\nimport { useChatKeyboard } from \"./useChatKeyboard\";\nimport { useEndVisible } from \"./useEndVisible\";\nimport { useExtraContentPadding } from \"./useExtraContentPadding\";\nimport { useFrozenPadding } from \"./useFrozenPadding\";\nvar OS = Platform.OS;\nvar ZERO_CONTENT_PADDING = makeMutable(0);\nvar ZERO_BLANK_SPACE = makeMutable(0);\nvar KeyboardChatScrollView = /* @__PURE__ */ forwardRef(function(param, ref) {\n var { children, ScrollViewComponent = Reanimated.ScrollView, inverted = false, keyboardLiftBehavior = \"always\", freeze = false, offset = 0, extraContentPadding = ZERO_CONTENT_PADDING, blankSpace = ZERO_BLANK_SPACE, applyWorkaroundForContentInsetHitTestBug = false, onLayout: onLayoutProp, onContentSizeChange: onContentSizeChangeProp, onEndVisible, ...rest } = param;\n var _ref;\n var _rest_contentInset, _rest_contentOffset;\n var scrollViewRef = useAnimatedRef();\n var onRef = useCombinedRef(ref, scrollViewRef);\n var contentInsetTop = OS === \"ios\" ? (_ref = (_rest_contentInset = rest.contentInset) === null || _rest_contentInset === void 0 ? void 0 : _rest_contentInset.top) !== null && _ref !== void 0 ? _ref : 0 : 0;\n var minScroll = contentInsetTop > 0 ? -contentInsetTop : 0;\n var freezeSV = useDerivedValue(function() {\n return typeof freeze === \"boolean\" ? freeze : freeze.value;\n });\n var { padding, currentHeight, contentOffsetY, scroll, layout, size, onLayout: onLayoutInternal, onContentSizeChange: onContentSizeChangeInternal } = useChatKeyboard(scrollViewRef, {\n inverted,\n keyboardLiftBehavior,\n freeze: freezeSV,\n offset,\n minScroll,\n blankSpace,\n extraContentPadding,\n initialContentOffsetY: (_rest_contentOffset = rest.contentOffset) === null || _rest_contentOffset === void 0 ? void 0 : _rest_contentOffset.y\n });\n useExtraContentPadding({\n scrollViewRef,\n extraContentPadding,\n keyboardPadding: padding,\n blankSpace,\n scroll,\n layout,\n size,\n contentOffsetY,\n minScroll,\n inverted,\n keyboardLiftBehavior,\n freeze: freezeSV\n });\n useFrozenPadding({\n freeze: freezeSV,\n offset,\n padding\n });\n useEndVisible({\n scroll,\n layout,\n size,\n inverted,\n onEndVisible\n });\n var totalPadding = useDerivedValue(function() {\n return Math.min(layout.value.height, Math.max(blankSpace.value, padding.value + extraContentPadding.value));\n });\n var indicatorPadding = useDerivedValue(function() {\n return padding.value + extraContentPadding.value;\n });\n var onLayout = useCallback(function(e) {\n onLayoutInternal(e);\n onLayoutProp === null || onLayoutProp === void 0 ? void 0 : onLayoutProp(e);\n }, [\n onLayoutInternal,\n onLayoutProp\n ]);\n var onContentSizeChange = useCallback(function(w, h) {\n onContentSizeChangeInternal(w, h);\n onContentSizeChangeProp === null || onContentSizeChangeProp === void 0 ? void 0 : onContentSizeChangeProp(w, h);\n }, [\n onContentSizeChangeInternal,\n onContentSizeChangeProp\n ]);\n var commitStyle = useAnimatedStyle(function() {\n return {\n transform: [\n {\n translateY: -currentHeight.value\n }\n ]\n };\n }, []);\n var commit = useMemo(function() {\n return [\n styles.commitView,\n commitStyle\n ];\n }, [\n commitStyle\n ]);\n return /* @__PURE__ */ _jsxs(_Fragment, {\n children: [\n /* @__PURE__ */ _jsx(ScrollViewWithBottomPadding, {\n ref: onRef,\n ...rest,\n applyWorkaroundForContentInsetHitTestBug,\n bottomPadding: totalPadding,\n contentOffsetY,\n inverted,\n scrollIndicatorPadding: indicatorPadding,\n ScrollViewComponent,\n onContentSizeChange,\n onLayout,\n children\n }),\n /* @__PURE__ */ _jsx(Reanimated.View, {\n style: commit\n })\n ]\n });\n});\nvar styles = StyleSheet.create({\n commitView: {\n display: \"none\",\n position: \"absolute\"\n }\n});\nvar KeyboardChatScrollView_default = KeyboardChatScrollView;\nexport {\n KeyboardChatScrollView_default as default\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAI,KAAK,SAAS;AAClB,IAAI,uBAAuB,YAAY,CAAC;AACxC,IAAI,mBAAmB,YAAY,CAAC;AACpC,IAAI,yBAAyC,2BAAW,SAAS,OAAO,KAAK;CAC3E,IAAI,EAAE,UAAU,sBAAsB,WAAW,YAAY,WAAW,OAAO,uBAAuB,UAAU,SAAS,OAAO,SAAS,GAAG,sBAAsB,sBAAsB,aAAa,kBAAkB,2CAA2C,OAAO,UAAU,cAAc,qBAAqB,yBAAyB,cAAc,GAAG,SAAS;CACzW,IAAI;CACJ,IAAI,oBAAoB;CACxB,IAAI,gBAAgB,eAAe;CACnC,IAAI,QAAQ,e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K,IAAI,KAAK,IAAI,wBAAwB,GAAG,CAAC;CAChH,GAAG,CACD,6BACA,uBACF,CAAC;CACD,IAAI,cAAc,iBAAiB,WAAW;EAC5C,OAAO,EACL,WAAW,CACT,EACE,YAAY,CAAC,cAAc,MAC7B,CACF,EACF;CACF,GAAG,CAAC,CAAC;CACL,IAAI,SAAS,QAAQ,WAAW;EAC9B,OAAO,CACL,OAAO,YACP,WACF;CACF,GAAG,CACD,WACF,CAAC;CACD,OAAuB,qBAAMA,UAAW,EACtC,UAAU,CACQ,oBAAK,6BAA6B;EAChD,KAAK;EACL,GAAG;EACH;EACA,eAAe;EACf;EACA;EACA,wBAAwB;EACxB;EACA;EACA;EACA;CACF,CAAC,GACe,oBAAK,WAAW,MAAM,EACpC,OAAO,OACT,CAAC,CACH,EACF,CAAC;AACH,CAAC;AACD,IAAI,SAAS,WAAW,OAAO,EAC7B,YAAY;CACV,SAAS;CACT,UAAU;AACZ,EACF,CAAC;AACD,IAAI,iCAAiC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { interpolate } from "react-native-reanimated";
|
|
2
|
+
|
|
3
|
+
// dist/esm/keyboard/components/KeyboardChatScrollView/useChatKeyboard/helpers.js
|
|
4
|
+
const AT_END_THRESHOLD = 20;
|
|
5
|
+
const getEffectiveHeight = (height, targetKeyboardHeight, offset) => {
|
|
6
|
+
"worklet";
|
|
7
|
+
if (offset === 0 || targetKeyboardHeight === 0) {
|
|
8
|
+
return height;
|
|
9
|
+
}
|
|
10
|
+
return interpolate(height, [0, targetKeyboardHeight], [0, Math.max(targetKeyboardHeight - offset, 0)]);
|
|
11
|
+
};
|
|
12
|
+
const isScrollAtEnd = (scrollOffset, layoutHeight, contentHeight, inverted = false) => {
|
|
13
|
+
"worklet";
|
|
14
|
+
if (inverted) {
|
|
15
|
+
return scrollOffset <= AT_END_THRESHOLD;
|
|
16
|
+
}
|
|
17
|
+
return scrollOffset + layoutHeight >= contentHeight - AT_END_THRESHOLD;
|
|
18
|
+
};
|
|
19
|
+
const shouldShiftContent = (behavior, isAtEnd) => {
|
|
20
|
+
"worklet";
|
|
21
|
+
switch (behavior) {
|
|
22
|
+
case "always": return true;
|
|
23
|
+
case "never": return false;
|
|
24
|
+
case "whenAtEnd": return isAtEnd;
|
|
25
|
+
case "persistent": return true;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const getVisibleMinimumPaddingFraction = (scrollOffset, layoutHeight, contentHeight, blankSpace, inverted) => {
|
|
29
|
+
"worklet";
|
|
30
|
+
if (blankSpace <= 0) {
|
|
31
|
+
return 0;
|
|
32
|
+
}
|
|
33
|
+
if (inverted) {
|
|
34
|
+
return Math.max(0, Math.min(1, -scrollOffset / blankSpace));
|
|
35
|
+
}
|
|
36
|
+
const pastContentEnd = scrollOffset + layoutHeight - contentHeight;
|
|
37
|
+
return Math.max(0, Math.min(1, pastContentEnd / blankSpace));
|
|
38
|
+
};
|
|
39
|
+
const getMinimumPaddingAbsorbed = (blankSpace, extraContentPadding) => {
|
|
40
|
+
"worklet";
|
|
41
|
+
return Math.max(0, blankSpace - extraContentPadding);
|
|
42
|
+
};
|
|
43
|
+
const getScrollEffective = (rawEffective, minimumPaddingAbsorbed) => {
|
|
44
|
+
"worklet";
|
|
45
|
+
return Math.max(0, rawEffective - minimumPaddingAbsorbed);
|
|
46
|
+
};
|
|
47
|
+
const clampedScrollTarget = (offsetBeforeScroll, keyboardHeight, contentHeight, layoutHeight, totalPaddingForMaxScroll) => {
|
|
48
|
+
"worklet";
|
|
49
|
+
const paddingForMax = totalPaddingForMaxScroll !== void 0 ? totalPaddingForMaxScroll : keyboardHeight;
|
|
50
|
+
const maxScroll = Math.max(contentHeight - layoutHeight + paddingForMax, 0);
|
|
51
|
+
return Math.min(Math.max(offsetBeforeScroll + keyboardHeight, 0), maxScroll);
|
|
52
|
+
};
|
|
53
|
+
const computeIOSContentOffset = (relativeScroll, keyboardHeight, contentHeight, layoutHeight, inverted, totalPaddingForMaxScroll, minScroll = 0) => {
|
|
54
|
+
"worklet";
|
|
55
|
+
const paddingForMax = totalPaddingForMaxScroll !== void 0 ? totalPaddingForMaxScroll : keyboardHeight;
|
|
56
|
+
if (inverted) {
|
|
57
|
+
const maxScroll2 = Math.max(contentHeight - layoutHeight, 0);
|
|
58
|
+
return Math.max(Math.min(relativeScroll - keyboardHeight, maxScroll2), -paddingForMax);
|
|
59
|
+
}
|
|
60
|
+
const maxScroll = Math.max(contentHeight - layoutHeight + paddingForMax, minScroll);
|
|
61
|
+
return Math.min(Math.max(keyboardHeight + relativeScroll, minScroll), maxScroll);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export { clampedScrollTarget, computeIOSContentOffset, getEffectiveHeight, getMinimumPaddingAbsorbed, getScrollEffective, getVisibleMinimumPaddingFraction, isScrollAtEnd, shouldShiftContent };
|
|
65
|
+
//# sourceMappingURL=helpers.mjs.map
|