react-native-keyboard-controller 1.21.14 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/android/src/fabric/java/com/reactnativekeyboardcontroller/KeyboardControllerModule.kt +4 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/modules/KeyboardControllerModuleImpl.kt +5 -0
- package/android/src/paper/java/com/reactnativekeyboardcontroller/KeyboardControllerModule.kt +5 -0
- package/ios/KeyboardBackdropController.swift +64 -0
- package/ios/KeyboardControllerModule.mm +11 -0
- package/ios/KeyboardControllerModuleImpl.swift +5 -0
- package/jest/index.js +1 -0
- package/lib/commonjs/bindings.js +1 -0
- package/lib/commonjs/bindings.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js +5 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardEffects/index.js +92 -0
- package/lib/commonjs/components/KeyboardEffects/index.js.map +1 -0
- package/lib/commonjs/components/KeyboardToolbar/constants.js +2 -3
- package/lib/commonjs/components/KeyboardToolbar/constants.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/index.js +8 -7
- package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/commonjs/components/index.js +7 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/constants.js +2 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/module.js +1 -0
- package/lib/commonjs/module.js.map +1 -1
- package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
- package/lib/commonjs/types/module.js.map +1 -1
- package/lib/module/bindings.js +1 -0
- package/lib/module/bindings.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/index.js +5 -1
- package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/module/components/KeyboardEffects/index.js +84 -0
- package/lib/module/components/KeyboardEffects/index.js.map +1 -0
- package/lib/module/components/KeyboardToolbar/constants.js +1 -2
- package/lib/module/components/KeyboardToolbar/constants.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/index.js +2 -1
- package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/constants.js +1 -0
- package/lib/module/constants.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/module.js +1 -0
- package/lib/module/module.js.map +1 -1
- package/lib/module/specs/NativeKeyboardController.js.map +1 -1
- package/lib/module/types/module.js.map +1 -1
- package/lib/typescript/components/KeyboardEffects/index.d.ts +44 -0
- package/lib/typescript/components/KeyboardToolbar/constants.d.ts +0 -1
- package/lib/typescript/components/index.d.ts +2 -0
- package/lib/typescript/constants.d.ts +1 -0
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/specs/NativeKeyboardController.d.ts +1 -0
- package/lib/typescript/types/module.d.ts +7 -0
- package/package.json +2 -1
- package/src/bindings.ts +1 -0
- package/src/components/KeyboardAwareScrollView/index.tsx +8 -1
- package/src/components/KeyboardEffects/index.tsx +121 -0
- package/src/components/KeyboardToolbar/constants.ts +1 -2
- package/src/components/KeyboardToolbar/index.tsx +1 -1
- package/src/components/index.ts +2 -0
- package/src/constants.ts +1 -0
- package/src/index.ts +2 -0
- package/src/module.ts +1 -0
- package/src/specs/NativeKeyboardController.ts +1 -0
- package/src/types/module.ts +7 -0
package/README.md
CHANGED
|
@@ -19,6 +19,7 @@ A universal keyboard handling solution for React Native — lightweight, fully c
|
|
|
19
19
|
- 🌐 Display anything over the keyboard (without dismissing it) using `OverKeyboardView`
|
|
20
20
|
- 🎨 Match keyboard background with `KeyboardBackgroundView`
|
|
21
21
|
- 🧩 Extend keyboard with custom buttons/UI via `KeyboardExtender`
|
|
22
|
+
- 🌈 Enhance keyboard UI with `KeyboardEffects`
|
|
22
23
|
- 💬 Build chat interfaces (messenger and 🤖 AI chats) easily with `KeyboardChatScrollView`
|
|
23
24
|
- 📝 Easy retrieval of focused input info
|
|
24
25
|
- 🧭 Compatible with any navigation library
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//
|
|
2
|
+
// KeyboardBackdropController.swift
|
|
3
|
+
// Pods
|
|
4
|
+
//
|
|
5
|
+
// Created by Kiryl Ziusko on 29/06/2026.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import UIKit
|
|
10
|
+
|
|
11
|
+
final class KeyboardBackdropController: NSObject {
|
|
12
|
+
static let shared = KeyboardBackdropController()
|
|
13
|
+
|
|
14
|
+
private var isTranslucent = false
|
|
15
|
+
|
|
16
|
+
override init() {
|
|
17
|
+
super.init()
|
|
18
|
+
|
|
19
|
+
NotificationCenter.default.addObserver(
|
|
20
|
+
self,
|
|
21
|
+
selector: #selector(keyboardWillShow(_:)),
|
|
22
|
+
name: UIResponder.keyboardWillShowNotification,
|
|
23
|
+
object: nil
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
func setTranslucent(_ translucent: Bool) {
|
|
28
|
+
isTranslucent = translucent
|
|
29
|
+
applyTranslucency()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@objc private func keyboardWillShow(_: Notification) {
|
|
33
|
+
guard isTranslucent else {
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
applyTranslucency()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
private func applyTranslucency() {
|
|
41
|
+
guard let keyboardWindow = UIWindow.keyboardWindow else {
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
applyTranslucency(in: keyboardWindow)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private func applyTranslucency(in view: UIView) {
|
|
49
|
+
if isKeyboardBackdropView(view) {
|
|
50
|
+
view.alpha = isTranslucent ? 0 : 1
|
|
51
|
+
return
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
for subview in view.subviews {
|
|
55
|
+
applyTranslucency(in: subview)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private func isKeyboardBackdropView(_ view: UIView) -> Bool {
|
|
60
|
+
let type = NSStringFromClass(type(of: view))
|
|
61
|
+
|
|
62
|
+
return type.hasSuffix("UIKBBackdropView")
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -90,6 +90,17 @@ RCT_EXPORT_METHOD(preload)
|
|
|
90
90
|
[UIResponder preloadKeyboardIfNeeded];
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
94
|
+
- (void)setTranslucent:(BOOL)translucent
|
|
95
|
+
#else
|
|
96
|
+
RCT_EXPORT_METHOD(setTranslucent : (BOOL)translucent)
|
|
97
|
+
#endif
|
|
98
|
+
{
|
|
99
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
100
|
+
[KeyboardControllerModuleImpl setTranslucent:translucent];
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
93
104
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
94
105
|
- (void)dismiss:(BOOL)keepFocus animated:(BOOL)animated
|
|
95
106
|
#else
|
|
@@ -12,6 +12,11 @@ import UIKit
|
|
|
12
12
|
public class KeyboardControllerModuleImpl: NSObject {
|
|
13
13
|
private static let keyboardRevealGestureName = "keyboardRevealGesture"
|
|
14
14
|
|
|
15
|
+
@objc
|
|
16
|
+
public static func setTranslucent(_ translucent: Bool) {
|
|
17
|
+
KeyboardBackdropController.shared.setTranslucent(translucent)
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
@objc
|
|
16
21
|
public static func dismiss(_ keepFocus: Bool, animated: Bool) {
|
|
17
22
|
let work = {
|
package/jest/index.js
CHANGED
package/lib/commonjs/bindings.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","NOOP","KeyboardControllerNative","exports","setDefaultMode","setInputMode","preload","dismiss","setFocusTo","viewPositionInWindow","Promise","resolve","x","y","width","height","addListener","removeListeners","getConstants","keyboardBorderRadius","KeyboardEvents","remove","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","View","KeyboardControllerViewCommands","synchronizeFocusedInputLayout","_ref","KeyboardGestureArea","RCTOverKeyboardView","KeyboardBackgroundView","RCTKeyboardExtender","ClippingScrollView","RCTKeyboardToolbarGroupView"],"sources":["bindings.ts"],"sourcesContent":["import { View } from \"react-native\";\n\nimport type {\n ClippingScrollViewProps,\n FocusedInputEventsModule,\n KeyboardBackgroundViewProps,\n KeyboardControllerNativeModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardExtenderProps,\n KeyboardGestureAreaProps,\n KeyboardToolbarGroupViewProps,\n OverKeyboardViewProps,\n WindowDimensionsEventsModule,\n} from \"./types\";\nimport type { EmitterSubscription } from \"react-native\";\n\nconst NOOP = () => {};\n\nexport const KeyboardControllerNative: KeyboardControllerNativeModule = {\n setDefaultMode: NOOP,\n setInputMode: NOOP,\n preload: NOOP,\n dismiss: NOOP,\n setFocusTo: NOOP,\n viewPositionInWindow: () =>\n Promise.resolve({ x: 0, y: 0, width: 0, height: 0 }),\n addListener: NOOP,\n removeListeners: NOOP,\n getConstants: () => ({\n keyboardBorderRadius: 0,\n }),\n};\n/**\n * An event emitter that provides a way to subscribe to next keyboard events:\n * - `keyboardWillShow`;\n * - `keyboardDidShow`;\n * - `keyboardWillHide`;\n * - `keyboardDidHide`.\n *\n * Use `addListener` function to add your event listener for a specific keyboard event.\n */\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\n/**\n * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.\n * Use it with cautious.\n */\nexport const FocusedInputEvents: FocusedInputEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\nexport const WindowDimensionsEvents: WindowDimensionsEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\n/**\n * A view that sends events whenever keyboard or focused events are happening.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller-view|Documentation} page for more details.\n */\nexport const KeyboardControllerView =\n View as unknown as React.FC<KeyboardControllerProps>;\nexport const KeyboardControllerViewCommands = {\n synchronizeFocusedInputLayout: (\n _ref: React.Component<KeyboardControllerProps> | null,\n ) => {},\n};\n/**\n * A view that defines a region on the screen, where gestures will control the keyboard position.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-gesture-area|Documentation} page for more details.\n */\nexport const KeyboardGestureArea =\n View as unknown as React.FC<KeyboardGestureAreaProps>;\nexport const RCTOverKeyboardView =\n View as unknown as React.FC<OverKeyboardViewProps>;\n/**\n * A view that matches keyboard background.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-background-view|Documentation} page for more details.\n */\nexport const KeyboardBackgroundView =\n View as unknown as React.FC<KeyboardBackgroundViewProps>;\n/**\n * A container that will embed its children into the keyboard\n * and will always show them above the keyboard.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-extender|Documentation} page for more details.\n */\nexport const RCTKeyboardExtender =\n View as unknown as React.FC<KeyboardExtenderProps>;\n/**\n * A decorator that will clip the content of the `ScrollView`. It helps to simulate `contentInset` behavior on Android\n * Supports only `bottom` property (`paddingBottom` is not supported property of `ScrollView.style`).\n * Using this component we can modify bottom inset without having a fake view.\n *\n * On iOS we use swizzling to apply runtime patches to fix some broken internal methods.\n * Ideally this component shouldn't exist and all its fixes/polyfills must be added directly to react-native and\n * we will port features/fixes back to upstream, but at the moment we use this view to\n * deliver desired functionality regardless of react-native version used.\n */\nexport const ClippingScrollView =\n View as unknown as React.FC<ClippingScrollViewProps>;\n/**\n * A View that defines a group of `TextInput`s.\n * Used in toolbar navigation to assure that you can navigate only between inputs withing the same group.\n */\nexport const RCTKeyboardToolbarGroupView =\n View as unknown as React.FC<KeyboardToolbarGroupViewProps>;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAiBA,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAEd,MAAMC,wBAAwD,GAAAC,OAAA,CAAAD,wBAAA,GAAG;EACtEE,cAAc,EAAEH,IAAI;EACpBI,YAAY,EAAEJ,IAAI;EAClBK,OAAO,EAAEL,IAAI;EACbM,
|
|
1
|
+
{"version":3,"names":["_reactNative","require","NOOP","KeyboardControllerNative","exports","setDefaultMode","setInputMode","preload","setTranslucent","dismiss","setFocusTo","viewPositionInWindow","Promise","resolve","x","y","width","height","addListener","removeListeners","getConstants","keyboardBorderRadius","KeyboardEvents","remove","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","View","KeyboardControllerViewCommands","synchronizeFocusedInputLayout","_ref","KeyboardGestureArea","RCTOverKeyboardView","KeyboardBackgroundView","RCTKeyboardExtender","ClippingScrollView","RCTKeyboardToolbarGroupView"],"sources":["bindings.ts"],"sourcesContent":["import { View } from \"react-native\";\n\nimport type {\n ClippingScrollViewProps,\n FocusedInputEventsModule,\n KeyboardBackgroundViewProps,\n KeyboardControllerNativeModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardExtenderProps,\n KeyboardGestureAreaProps,\n KeyboardToolbarGroupViewProps,\n OverKeyboardViewProps,\n WindowDimensionsEventsModule,\n} from \"./types\";\nimport type { EmitterSubscription } from \"react-native\";\n\nconst NOOP = () => {};\n\nexport const KeyboardControllerNative: KeyboardControllerNativeModule = {\n setDefaultMode: NOOP,\n setInputMode: NOOP,\n preload: NOOP,\n setTranslucent: NOOP,\n dismiss: NOOP,\n setFocusTo: NOOP,\n viewPositionInWindow: () =>\n Promise.resolve({ x: 0, y: 0, width: 0, height: 0 }),\n addListener: NOOP,\n removeListeners: NOOP,\n getConstants: () => ({\n keyboardBorderRadius: 0,\n }),\n};\n/**\n * An event emitter that provides a way to subscribe to next keyboard events:\n * - `keyboardWillShow`;\n * - `keyboardDidShow`;\n * - `keyboardWillHide`;\n * - `keyboardDidHide`.\n *\n * Use `addListener` function to add your event listener for a specific keyboard event.\n */\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\n/**\n * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.\n * Use it with cautious.\n */\nexport const FocusedInputEvents: FocusedInputEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\nexport const WindowDimensionsEvents: WindowDimensionsEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\n/**\n * A view that sends events whenever keyboard or focused events are happening.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller-view|Documentation} page for more details.\n */\nexport const KeyboardControllerView =\n View as unknown as React.FC<KeyboardControllerProps>;\nexport const KeyboardControllerViewCommands = {\n synchronizeFocusedInputLayout: (\n _ref: React.Component<KeyboardControllerProps> | null,\n ) => {},\n};\n/**\n * A view that defines a region on the screen, where gestures will control the keyboard position.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-gesture-area|Documentation} page for more details.\n */\nexport const KeyboardGestureArea =\n View as unknown as React.FC<KeyboardGestureAreaProps>;\nexport const RCTOverKeyboardView =\n View as unknown as React.FC<OverKeyboardViewProps>;\n/**\n * A view that matches keyboard background.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-background-view|Documentation} page for more details.\n */\nexport const KeyboardBackgroundView =\n View as unknown as React.FC<KeyboardBackgroundViewProps>;\n/**\n * A container that will embed its children into the keyboard\n * and will always show them above the keyboard.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-extender|Documentation} page for more details.\n */\nexport const RCTKeyboardExtender =\n View as unknown as React.FC<KeyboardExtenderProps>;\n/**\n * A decorator that will clip the content of the `ScrollView`. It helps to simulate `contentInset` behavior on Android\n * Supports only `bottom` property (`paddingBottom` is not supported property of `ScrollView.style`).\n * Using this component we can modify bottom inset without having a fake view.\n *\n * On iOS we use swizzling to apply runtime patches to fix some broken internal methods.\n * Ideally this component shouldn't exist and all its fixes/polyfills must be added directly to react-native and\n * we will port features/fixes back to upstream, but at the moment we use this view to\n * deliver desired functionality regardless of react-native version used.\n */\nexport const ClippingScrollView =\n View as unknown as React.FC<ClippingScrollViewProps>;\n/**\n * A View that defines a group of `TextInput`s.\n * Used in toolbar navigation to assure that you can navigate only between inputs withing the same group.\n */\nexport const RCTKeyboardToolbarGroupView =\n View as unknown as React.FC<KeyboardToolbarGroupViewProps>;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAiBA,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAEd,MAAMC,wBAAwD,GAAAC,OAAA,CAAAD,wBAAA,GAAG;EACtEE,cAAc,EAAEH,IAAI;EACpBI,YAAY,EAAEJ,IAAI;EAClBK,OAAO,EAAEL,IAAI;EACbM,cAAc,EAAEN,IAAI;EACpBO,OAAO,EAAEP,IAAI;EACbQ,UAAU,EAAER,IAAI;EAChBS,oBAAoB,EAAEA,CAAA,KACpBC,OAAO,CAACC,OAAO,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEC,KAAK,EAAE,CAAC;IAAEC,MAAM,EAAE;EAAE,CAAC,CAAC;EACtDC,WAAW,EAAEhB,IAAI;EACjBiB,eAAe,EAAEjB,IAAI;EACrBkB,YAAY,EAAEA,CAAA,MAAO;IACnBC,oBAAoB,EAAE;EACxB,CAAC;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAoC,GAAAlB,OAAA,CAAAkB,cAAA,GAAG;EAClDJ,WAAW,EAAEA,CAAA,MAAO;IAAEK,MAAM,EAAErB;EAAK,CAAC;AACtC,CAAC;AACD;AACA;AACA;AACA;AACO,MAAMsB,kBAA4C,GAAApB,OAAA,CAAAoB,kBAAA,GAAG;EAC1DN,WAAW,EAAEA,CAAA,MAAO;IAAEK,MAAM,EAAErB;EAAK,CAAC;AACtC,CAAC;AACM,MAAMuB,sBAAoD,GAAArB,OAAA,CAAAqB,sBAAA,GAAG;EAClEP,WAAW,EAAEA,CAAA,MAAO;IAAEK,MAAM,EAAErB;EAAK,CAAC;AACtC,CAAC;AACD;AACA;AACA;AACA;AACA;AACO,MAAMwB,sBAAsB,GAAAtB,OAAA,CAAAsB,sBAAA,GACjCC,iBAAoD;AAC/C,MAAMC,8BAA8B,GAAAxB,OAAA,CAAAwB,8BAAA,GAAG;EAC5CC,6BAA6B,EAC3BC,IAAqD,IAClD,CAAC;AACR,CAAC;AACD;AACA;AACA;AACA;AACA;AACO,MAAMC,mBAAmB,GAAA3B,OAAA,CAAA2B,mBAAA,GAC9BJ,iBAAqD;AAChD,MAAMK,mBAAmB,GAAA5B,OAAA,CAAA4B,mBAAA,GAC9BL,iBAAkD;AACpD;AACA;AACA;AACA;AACA;AACO,MAAMM,sBAAsB,GAAA7B,OAAA,CAAA6B,sBAAA,GACjCN,iBAAwD;AAC1D;AACA;AACA;AACA;AACA;AACA;AACO,MAAMO,mBAAmB,GAAA9B,OAAA,CAAA8B,mBAAA,GAC9BP,iBAAkD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMQ,kBAAkB,GAAA/B,OAAA,CAAA+B,kBAAA,GAC7BR,iBAAoD;AACtD;AACA;AACA;AACA;AACO,MAAMS,2BAA2B,GAAAhC,OAAA,CAAAgC,2BAAA,GACtCT,iBAA0D","ignoreList":[]}
|
|
@@ -199,7 +199,7 @@ const KeyboardAwareScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
199
199
|
|
|
200
200
|
var _lastSelection$value, _input$value;
|
|
201
201
|
const customHeight = (_lastSelection$value = lastSelection.value) === null || _lastSelection$value === void 0 ? void 0 : _lastSelection$value.selection.end.y;
|
|
202
|
-
if (!((_input$value = input.value) !== null && _input$value !== void 0 && _input$value.layout) ||
|
|
202
|
+
if (!((_input$value = input.value) !== null && _input$value !== void 0 && _input$value.layout) || customHeight === undefined) {
|
|
203
203
|
return false;
|
|
204
204
|
}
|
|
205
205
|
layout.value = {
|
|
@@ -341,6 +341,10 @@ const KeyboardAwareScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
341
341
|
onMove: e => {
|
|
342
342
|
"worklet";
|
|
343
343
|
|
|
344
|
+
var _lastSelection$value6;
|
|
345
|
+
if (pendingSelectionForFocus.value && ((_lastSelection$value6 = lastSelection.value) === null || _lastSelection$value6 === void 0 ? void 0 : _lastSelection$value6.target) !== tag.value) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
344
348
|
if (removeGhostPadding(e.height)) {
|
|
345
349
|
return;
|
|
346
350
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeReanimated","_bindings","_hooks","_findNodeHandle","_useCombinedRef","_interopRequireDefault","_useScrollState","_ScrollViewWithBottomPadding","_useSmoothKeyboardHandler","_utils","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","KeyboardAwareScrollView","forwardRef","children","onLayout","bottomOffset","disableScrollOnKeyboardHide","enabled","extraKeyboardSpace","mode","ScrollViewComponent","Reanimated","ScrollView","snapToOffsets","rest","ref","scrollViewAnimatedRef","useAnimatedRef","scrollViewRef","React","useRef","onRef","useCombinedRef","scrollViewTarget","useSharedValue","scrollPosition","offset","position","layout","scrollViewLayout","size","scrollViewContentSize","useScrollState","currentKeyboardFrameHeight","keyboardHeight","keyboardWillAppear","tag","initialKeyboardSize","scrollBeforeKeyboardMovement","input","update","useReanimatedFocusedInput","lastSelection","ghostViewSpace","pendingSelectionForFocus","selectionUpdatedSinceHide","scrollViewPageY","height","useWindowDimensions","onScrollViewLayout","useCallback","handle","findNodeHandle","current","value","y","KeyboardControllerNative","viewPositionInWindow","maybeScroll","animated","_layout$value","_layout$value2","_layout$value3","parentScrollViewTarget","visibleRect","absoluteY","inputHeight","point","relativeScrollTo","interpolatedScrollTo","interpolate","scrollDistanceWithRespectToSnapPoints","targetScrollY","Math","max","scrollTo","positionOnScreen","topOfScreen","removeGhostPadding","performScrollWithPositionRestoration","newPosition","prevScroll","syncKeyboardFrame","keyboardFrame","updateLayoutFromSelection","_lastSelection$value","_input$value","customHeight","selection","end","clamp","scrollFromCurrentPosition","prevLayout","onChangeText","onChangeTextHandler","useMemo","debounce","onSelectionChange","_lastSelection$value2","_lastSelection$value3","lastTarget","target","latestSelection","start","useFocusedInputHandler","useSmoothKeyboardHandler","onStart","keyboardWillChangeSize","keyboardWillHide","focusWasChanged","_lastSelection$value4","_lastSelection$value5","onMove","onEnd","synchronize","requestAnimationFrame","runOnUI","useImperativeHandle","scrollView","scrollViewWithMethods","assureFocusedInputVisible","useEffect","useAnimatedReaction","previous","padding","useDerivedValue","layoutSpacerStyle","useAnimatedStyle","paddingBottom","createElement","scrollEventThrottle","View","style","bottomPadding","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n} from \"react\";\nimport Reanimated, {\n clamp,\n interpolate,\n runOnUI,\n scrollTo,\n useAnimatedReaction,\n useAnimatedRef,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n} from \"react-native-reanimated\";\n\nimport { KeyboardControllerNative } from \"../../bindings\";\nimport {\n useFocusedInputHandler,\n useReanimatedFocusedInput,\n useWindowDimensions,\n} from \"../../hooks\";\nimport { findNodeHandle } from \"../../utils/findNodeHandle\";\nimport useCombinedRef from \"../hooks/useCombinedRef\";\nimport useScrollState from \"../hooks/useScrollState\";\nimport ScrollViewWithBottomPadding from \"../ScrollViewWithBottomPadding\";\n\nimport { useSmoothKeyboardHandler } from \"./useSmoothKeyboardHandler\";\nimport { debounce, scrollDistanceWithRespectToSnapPoints } from \"./utils\";\n\nimport type { LayoutChangeEvent, ScrollView } from \"react-native\";\nimport type {\n FocusedInputLayoutChangedEvent,\n FocusedInputSelectionChangedEvent,\n KeyboardAwareScrollViewProps,\n KeyboardAwareScrollViewRef,\n NativeEvent,\n} from \"react-native-keyboard-controller\";\n\n// Everything begins from `onStart` handler. This handler is called every time,\n// when keyboard changes its size or when focused `TextInput` was changed. In\n// this handler we are calculating/memoizing values which later will be used\n// during layout movement. For that we calculate:\n// - layout of focused field (`layout`) - to understand whether there will be overlap\n// - initial keyboard size (`initialKeyboardSize`) - used in scroll interpolation\n// - future keyboard height (`keyboardHeight`) - used in scroll interpolation\n// - current scroll position (`scrollPosition`) - used to scroll from this point\n//\n// Once we've calculated all necessary variables - we can actually start to use them.\n// It happens in `onMove` handler - this function simply calls `maybeScroll` with\n// current keyboard frame height. This functions makes the smooth transition.\n//\n// When the transition has finished we go to `onEnd` handler. In this handler\n// we verify, that the current field is not overlapped within a keyboard frame.\n// For full `onStart`/`onMove`/`onEnd` flow it may look like a redundant thing,\n// however there could be some cases, when `onMove` is not called:\n// - on iOS when TextInput was changed - keyboard transition is instant\n// - on Android when TextInput was changed and keyboard size wasn't changed\n// So `onEnd` handler handle the case, when `onMove` wasn't triggered.\n//\n// ====================================================================================================================+\n// -----------------------------------------------------Flow chart-----------------------------------------------------+\n// ====================================================================================================================+\n//\n// +============================+ +============================+ +==================================+\n// + User Press on TextInput + => + Keyboard starts showing + => + As keyboard moves frame by frame + =>\n// + + + (run `onStart`) + + `onMove` is getting called +\n// +============================+ +============================+ +==================================+\n//\n// +============================+ +============================+ +=====================================+\n// + Keyboard is shown and we + => + User moved focus to + => + Only `onStart`/`onEnd` maybe called +\n// + call `onEnd` handler + + another `TextInput` + + (without involving `onMove`) +\n// +============================+ +============================+ +=====================================+\n//\n\n/**\n * A ScrollView component that automatically handles keyboard appearance and disappearance\n * by adjusting its content position to ensure the focused input remains visible.\n *\n * The component uses a sophisticated animation system to smoothly handle keyboard transitions\n * and maintain proper scroll position during keyboard interactions.\n *\n * @returns A ScrollView component that handles keyboard interactions.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/components/keyboard-aware-scroll-view|Documentation} page for more details.\n * @example\n * ```tsx\n * <KeyboardAwareScrollView bottomOffset={20}>\n * <TextInput placeholder=\"Enter text\" />\n * <TextInput placeholder=\"Another input\" />\n * </KeyboardAwareScrollView>\n * ```\n */\nconst KeyboardAwareScrollView = forwardRef<\n KeyboardAwareScrollViewRef,\n React.PropsWithChildren<KeyboardAwareScrollViewProps>\n>(\n (\n {\n children,\n onLayout,\n bottomOffset = 0,\n disableScrollOnKeyboardHide = false,\n enabled = true,\n extraKeyboardSpace = 0,\n mode = \"insets\",\n ScrollViewComponent = Reanimated.ScrollView,\n snapToOffsets,\n ...rest\n },\n ref,\n ) => {\n const scrollViewAnimatedRef = useAnimatedRef<Reanimated.ScrollView>();\n const scrollViewRef = React.useRef<ScrollView>(null);\n const onRef = useCombinedRef(scrollViewAnimatedRef, scrollViewRef);\n const scrollViewTarget = useSharedValue<number | null>(null);\n const scrollPosition = useSharedValue(0);\n const {\n offset: position,\n layout: scrollViewLayout,\n size: scrollViewContentSize,\n } = useScrollState(scrollViewAnimatedRef);\n const currentKeyboardFrameHeight = useSharedValue(0);\n const keyboardHeight = useSharedValue(0);\n const keyboardWillAppear = useSharedValue(false);\n const tag = useSharedValue(-1);\n const initialKeyboardSize = useSharedValue(0);\n const scrollBeforeKeyboardMovement = useSharedValue(0);\n const { input, update } = useReanimatedFocusedInput();\n const layout = useSharedValue<FocusedInputLayoutChangedEvent | null>(null);\n const lastSelection =\n useSharedValue<FocusedInputSelectionChangedEvent | null>(null);\n const ghostViewSpace = useSharedValue(-1);\n const pendingSelectionForFocus = useSharedValue(false);\n const selectionUpdatedSinceHide = useSharedValue(false);\n const scrollViewPageY = useSharedValue(0);\n\n const { height } = useWindowDimensions();\n\n const onScrollViewLayout = useCallback(\n async (e: LayoutChangeEvent) => {\n const handle = findNodeHandle(scrollViewAnimatedRef.current);\n\n scrollViewTarget.value = handle;\n\n onLayout?.(e);\n\n if (handle !== null) {\n try {\n const { y } = await KeyboardControllerNative.viewPositionInWindow(\n handle,\n );\n\n scrollViewPageY.value = y;\n } catch {\n // ignore\n }\n }\n },\n [onLayout],\n );\n\n /**\n * Function that will scroll a ScrollView as keyboard gets moving.\n */\n const maybeScroll = useCallback(\n (e: number, animated: boolean = false) => {\n \"worklet\";\n\n if (!enabled) {\n return 0;\n }\n\n // input belongs to ScrollView\n if (layout.value?.parentScrollViewTarget !== scrollViewTarget.value) {\n return 0;\n }\n\n const visibleRect = height - keyboardHeight.value;\n const absoluteY = layout.value?.layout.absoluteY || 0;\n const inputHeight = layout.value?.layout.height || 0;\n const point = absoluteY + inputHeight;\n\n if (visibleRect - point <= bottomOffset) {\n const relativeScrollTo =\n keyboardHeight.value - (height - point) + bottomOffset;\n const interpolatedScrollTo = interpolate(\n e,\n [initialKeyboardSize.value, keyboardHeight.value],\n [\n 0,\n scrollDistanceWithRespectToSnapPoints(\n relativeScrollTo + scrollPosition.value,\n snapToOffsets,\n ) - scrollPosition.value,\n ],\n );\n const targetScrollY =\n Math.max(interpolatedScrollTo, 0) + scrollPosition.value;\n\n scrollTo(scrollViewAnimatedRef, 0, targetScrollY, animated);\n\n return interpolatedScrollTo;\n }\n\n if (point < scrollViewPageY.value) {\n const positionOnScreen = visibleRect - bottomOffset;\n const topOfScreen = scrollPosition.value + point;\n\n scrollTo(\n scrollViewAnimatedRef,\n 0,\n topOfScreen - positionOnScreen,\n animated,\n );\n }\n\n return 0;\n },\n [bottomOffset, enabled, height, snapToOffsets],\n );\n const removeGhostPadding = useCallback(\n (e: number) => {\n \"worklet\";\n\n // layout mode: the spacer view participates in layout, so the ScrollView\n // reflows naturally when it shrinks — no manual scroll correction needed.\n if (mode === \"layout\") {\n return false;\n }\n\n // insets mode: `ScrollViewWithBottomPadding` extends scrollable area without\n // changing layout, so when the keyboard hides and we're at the end of the\n // ScrollView we must manually scroll back.\n if (!keyboardWillAppear.value && ghostViewSpace.value > 0) {\n scrollTo(\n scrollViewAnimatedRef,\n 0,\n scrollPosition.value -\n interpolate(\n e,\n [initialKeyboardSize.value, keyboardHeight.value],\n [ghostViewSpace.value, 0],\n ),\n false,\n );\n\n return true;\n }\n\n return false;\n },\n [mode],\n );\n const performScrollWithPositionRestoration = useCallback(\n (newPosition: number) => {\n \"worklet\";\n\n const prevScroll = scrollPosition.value;\n\n // eslint-disable-next-line react-compiler/react-compiler\n scrollPosition.value = newPosition;\n maybeScroll(keyboardHeight.value, true);\n scrollPosition.value = prevScroll;\n },\n [scrollPosition, keyboardHeight, maybeScroll],\n );\n const syncKeyboardFrame = useCallback(\n (e: NativeEvent) => {\n \"worklet\";\n\n const keyboardFrame = interpolate(\n e.height,\n [0, keyboardHeight.value],\n [0, keyboardHeight.value + extraKeyboardSpace],\n );\n\n currentKeyboardFrameHeight.value = keyboardFrame;\n },\n [extraKeyboardSpace],\n );\n\n const updateLayoutFromSelection = useCallback(() => {\n \"worklet\";\n\n const customHeight = lastSelection.value?.selection.end.y;\n\n if (!input.value?.layout || !customHeight) {\n return false;\n }\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\n return true;\n }, [input, lastSelection, layout]);\n const scrollFromCurrentPosition = useCallback(() => {\n \"worklet\";\n\n const prevLayout = layout.value;\n\n if (!updateLayoutFromSelection()) {\n return;\n }\n\n performScrollWithPositionRestoration(position.value);\n\n layout.value = prevLayout;\n }, [performScrollWithPositionRestoration]);\n const onChangeText = useCallback(() => {\n \"worklet\";\n scrollFromCurrentPosition();\n }, [scrollFromCurrentPosition]);\n const onChangeTextHandler = useMemo(\n () => debounce(onChangeText, 200),\n [onChangeText],\n );\n const onSelectionChange = useCallback(\n (e: FocusedInputSelectionChangedEvent) => {\n \"worklet\";\n\n const lastTarget = lastSelection.value?.target;\n const latestSelection = lastSelection.value?.selection;\n\n lastSelection.value = e;\n selectionUpdatedSinceHide.value = true;\n\n if (e.target !== lastTarget || pendingSelectionForFocus.value) {\n if (pendingSelectionForFocus.value) {\n // selection arrived after onStart - complete the deferred setup\n pendingSelectionForFocus.value = false;\n updateLayoutFromSelection();\n\n // if keyboard was already visible (focus change, no onMove expected),\n // perform the deferred scroll now\n if (!keyboardWillAppear.value && keyboardHeight.value > 0) {\n position.value += maybeScroll(keyboardHeight.value, true);\n }\n }\n\n return;\n }\n // caret in the end + end coordinates has been changed -> we moved to a new line\n // so input may grow\n if (\n e.selection.end.position === e.selection.start.position &&\n latestSelection?.end.y !== e.selection.end.y\n ) {\n return scrollFromCurrentPosition();\n }\n // selection has been changed\n if (e.selection.start.position !== e.selection.end.position) {\n return scrollFromCurrentPosition();\n }\n\n onChangeTextHandler();\n },\n [\n scrollFromCurrentPosition,\n onChangeTextHandler,\n updateLayoutFromSelection,\n maybeScroll,\n ],\n );\n\n useFocusedInputHandler(\n {\n onSelectionChange: onSelectionChange,\n },\n [onSelectionChange],\n );\n\n useSmoothKeyboardHandler(\n {\n onStart: (e) => {\n \"worklet\";\n\n const keyboardWillChangeSize =\n keyboardHeight.value !== e.height && e.height > 0;\n\n keyboardWillAppear.value = e.height > 0 && keyboardHeight.value === 0;\n\n const keyboardWillHide = e.height === 0;\n const focusWasChanged =\n (tag.value !== e.target && e.target !== -1) ||\n keyboardWillChangeSize;\n\n if (keyboardWillChangeSize) {\n initialKeyboardSize.value = keyboardHeight.value;\n }\n\n if (keyboardWillHide) {\n // on back transition need to interpolate as [0, keyboardHeight]\n initialKeyboardSize.value = 0;\n scrollPosition.value = scrollBeforeKeyboardMovement.value;\n pendingSelectionForFocus.value = false;\n }\n\n if (\n keyboardWillAppear.value ||\n keyboardWillChangeSize ||\n focusWasChanged\n ) {\n // persist scroll value\n scrollPosition.value = position.value;\n // just persist height - later will be used in interpolation\n keyboardHeight.value = e.height;\n\n // insets mode: set the full contentInset upfront so that maybeScroll\n // calculations are correct from the very first onMove frame.\n // layout mode: do NOT set it here — the spacer must grow frame-by-frame\n // in onMove to avoid a premature full-height jump before the keyboard moves.\n if (mode === \"insets\") {\n syncKeyboardFrame(e);\n }\n }\n\n // focus was changed\n if (focusWasChanged) {\n tag.value = e.target;\n\n if (\n lastSelection.value?.target === e.target &&\n selectionUpdatedSinceHide.value\n ) {\n // fresh selection arrived before onStart - use it to update layout\n updateLayoutFromSelection();\n pendingSelectionForFocus.value = false;\n } else {\n // selection hasn't arrived yet for the new target (iOS 15),\n // or it's stale from previous session (Android refocus same input).\n // Use stale selection as best-effort fallback if available for same target,\n // otherwise fall back to full input layout.\n // Will be corrected if a fresh onSelectionChange arrives.\n if (lastSelection.value?.target === e.target) {\n updateLayoutFromSelection();\n } else if (input.value) {\n layout.value = input.value;\n }\n pendingSelectionForFocus.value = true;\n }\n\n // save current scroll position - when keyboard will hide we'll reuse\n // this value to achieve smooth hide effect\n scrollBeforeKeyboardMovement.value = position.value;\n }\n\n if (focusWasChanged && !keyboardWillAppear.value) {\n if (!pendingSelectionForFocus.value) {\n // update position on scroll value, so `onEnd` handler\n // will pick up correct values\n position.value += maybeScroll(e.height, true);\n }\n }\n\n if (mode === \"insets\") {\n ghostViewSpace.value =\n position.value +\n scrollViewLayout.value.height -\n scrollViewContentSize.value.height;\n\n if (ghostViewSpace.value > 0) {\n scrollPosition.value = position.value;\n }\n }\n },\n onMove: (e) => {\n \"worklet\";\n\n if (removeGhostPadding(e.height)) {\n return;\n }\n\n // layout mode: drive the spacer view animation frame-by-frame\n if (mode === \"layout\") {\n syncKeyboardFrame(e);\n }\n\n // if the user has set disableScrollOnKeyboardHide, only auto-scroll when the keyboard opens\n if (!disableScrollOnKeyboardHide || keyboardWillAppear.value) {\n maybeScroll(e.height);\n }\n },\n onEnd: (e) => {\n \"worklet\";\n\n if (e.height === 0) {\n removeGhostPadding(e.height);\n }\n\n keyboardHeight.value = e.height;\n scrollPosition.value = position.value;\n\n if (e.height === 0) {\n selectionUpdatedSinceHide.value = false;\n } else if (keyboardWillAppear.value) {\n // keyboard fully shown after appearing from hidden state — clear\n // pending flag to prevent leaking into next focus-change session.\n // Only when the keyboard was actually appearing (not a focus switch\n // with same keyboard height), otherwise we'd clear the flag before\n // onSelectionChange has a chance to process it.\n pendingSelectionForFocus.value = false;\n }\n\n syncKeyboardFrame(e);\n },\n },\n [\n mode,\n maybeScroll,\n removeGhostPadding,\n disableScrollOnKeyboardHide,\n syncKeyboardFrame,\n ],\n );\n\n const synchronize = useCallback(async () => {\n await update();\n\n requestAnimationFrame(() => {\n runOnUI(() => {\n \"worklet\";\n\n scrollFromCurrentPosition();\n })();\n });\n }, [update, scrollFromCurrentPosition]);\n\n useImperativeHandle(\n ref,\n () => {\n const scrollView = scrollViewRef.current;\n\n if (scrollView) {\n const scrollViewWithMethods =\n scrollView as KeyboardAwareScrollViewRef;\n\n scrollViewWithMethods.assureFocusedInputVisible = () => {\n synchronize();\n };\n\n return scrollViewWithMethods;\n }\n\n return {\n assureFocusedInputVisible: () => {\n synchronize();\n },\n } as KeyboardAwareScrollViewRef;\n },\n [synchronize],\n );\n\n useEffect(() => {\n synchronize();\n }, [bottomOffset]);\n\n useAnimatedReaction(\n () => input.value,\n (current, previous) => {\n if (\n current?.target === previous?.target &&\n current?.layout.height !== previous?.layout.height\n ) {\n // input has changed layout - let's check if we need to scroll\n // may happen when you paste text, then onSelectionChange will be\n // fired earlier than text actually changes its layout\n scrollFromCurrentPosition();\n }\n },\n [],\n );\n\n const padding = useDerivedValue(\n () => (enabled ? currentKeyboardFrameHeight.value : 0),\n [enabled],\n );\n // layout mode only: a spacer view whose paddingBottom grows with the keyboard.\n // The `+ 1` ensures the scroll view never reaches its absolute end during animation,\n // avoiding the layout recalculation that triggers on every frame at the boundary.\n // see: https://github.com/kirillzyusko/react-native-keyboard-controller/pull/342\n const layoutSpacerStyle = useAnimatedStyle(\n () =>\n enabled && mode === \"layout\"\n ? { paddingBottom: currentKeyboardFrameHeight.value + 1 }\n : {},\n [enabled, mode],\n );\n\n if (mode === \"layout\") {\n return (\n <ScrollViewComponent\n ref={onRef}\n {...rest}\n scrollEventThrottle={16}\n onLayout={onScrollViewLayout}\n >\n {children}\n {enabled && <Reanimated.View style={layoutSpacerStyle} />}\n </ScrollViewComponent>\n );\n }\n\n return (\n <ScrollViewWithBottomPadding\n ref={onRef}\n {...rest}\n bottomPadding={padding}\n scrollEventThrottle={16}\n ScrollViewComponent={ScrollViewComponent}\n onLayout={onScrollViewLayout}\n >\n {children}\n </ScrollViewWithBottomPadding>\n );\n },\n);\n\nexport default KeyboardAwareScrollView;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,sBAAA,GAAAF,uBAAA,CAAAC,OAAA;AAYA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,eAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,4BAAA,GAAAF,sBAAA,CAAAN,OAAA;AAEA,IAAAS,yBAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAA0E,SAAAM,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAhB,uBAAA,YAAAA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AAAe,OAAA,CAAAuJ,aAAA,CAACnK,sBAAA,CAAAY,OAAU,CAACyJ,IAAI;MAACC,KAAK,EAAEN;IAAkB,CAAE,CACrC,CAAC;EAE1B;EAEA,oBACEnK,MAAA,CAAAe,OAAA,CAAAuJ,aAAA,CAAC5J,4BAAA,CAAAK,OAA2B,EAAAiB,QAAA;IAC1BoB,GAAG,EAAEM;EAAM,GACPP,IAAI;IACRuH,aAAa,EAAET,OAAQ;IACvBM,mBAAmB,EAAE,EAAG;IACxBxH,mBAAmB,EAAEA,mBAAoB;IACzCN,QAAQ,EAAE6C;EAAmB,IAE5B9C,QAC0B,CAAC;AAElC,CACF,CAAC;AAAC,IAAAmI,QAAA,GAAAC,OAAA,CAAA7J,OAAA,GAEauB,uBAAuB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeReanimated","_bindings","_hooks","_findNodeHandle","_useCombinedRef","_interopRequireDefault","_useScrollState","_ScrollViewWithBottomPadding","_useSmoothKeyboardHandler","_utils","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","KeyboardAwareScrollView","forwardRef","children","onLayout","bottomOffset","disableScrollOnKeyboardHide","enabled","extraKeyboardSpace","mode","ScrollViewComponent","Reanimated","ScrollView","snapToOffsets","rest","ref","scrollViewAnimatedRef","useAnimatedRef","scrollViewRef","React","useRef","onRef","useCombinedRef","scrollViewTarget","useSharedValue","scrollPosition","offset","position","layout","scrollViewLayout","size","scrollViewContentSize","useScrollState","currentKeyboardFrameHeight","keyboardHeight","keyboardWillAppear","tag","initialKeyboardSize","scrollBeforeKeyboardMovement","input","update","useReanimatedFocusedInput","lastSelection","ghostViewSpace","pendingSelectionForFocus","selectionUpdatedSinceHide","scrollViewPageY","height","useWindowDimensions","onScrollViewLayout","useCallback","handle","findNodeHandle","current","value","y","KeyboardControllerNative","viewPositionInWindow","maybeScroll","animated","_layout$value","_layout$value2","_layout$value3","parentScrollViewTarget","visibleRect","absoluteY","inputHeight","point","relativeScrollTo","interpolatedScrollTo","interpolate","scrollDistanceWithRespectToSnapPoints","targetScrollY","Math","max","scrollTo","positionOnScreen","topOfScreen","removeGhostPadding","performScrollWithPositionRestoration","newPosition","prevScroll","syncKeyboardFrame","keyboardFrame","updateLayoutFromSelection","_lastSelection$value","_input$value","customHeight","selection","end","undefined","clamp","scrollFromCurrentPosition","prevLayout","onChangeText","onChangeTextHandler","useMemo","debounce","onSelectionChange","_lastSelection$value2","_lastSelection$value3","lastTarget","target","latestSelection","start","useFocusedInputHandler","useSmoothKeyboardHandler","onStart","keyboardWillChangeSize","keyboardWillHide","focusWasChanged","_lastSelection$value4","_lastSelection$value5","onMove","_lastSelection$value6","onEnd","synchronize","requestAnimationFrame","runOnUI","useImperativeHandle","scrollView","scrollViewWithMethods","assureFocusedInputVisible","useEffect","useAnimatedReaction","previous","padding","useDerivedValue","layoutSpacerStyle","useAnimatedStyle","paddingBottom","createElement","scrollEventThrottle","View","style","bottomPadding","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n} from \"react\";\nimport Reanimated, {\n clamp,\n interpolate,\n runOnUI,\n scrollTo,\n useAnimatedReaction,\n useAnimatedRef,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n} from \"react-native-reanimated\";\n\nimport { KeyboardControllerNative } from \"../../bindings\";\nimport {\n useFocusedInputHandler,\n useReanimatedFocusedInput,\n useWindowDimensions,\n} from \"../../hooks\";\nimport { findNodeHandle } from \"../../utils/findNodeHandle\";\nimport useCombinedRef from \"../hooks/useCombinedRef\";\nimport useScrollState from \"../hooks/useScrollState\";\nimport ScrollViewWithBottomPadding from \"../ScrollViewWithBottomPadding\";\n\nimport { useSmoothKeyboardHandler } from \"./useSmoothKeyboardHandler\";\nimport { debounce, scrollDistanceWithRespectToSnapPoints } from \"./utils\";\n\nimport type { LayoutChangeEvent, ScrollView } from \"react-native\";\nimport type {\n FocusedInputLayoutChangedEvent,\n FocusedInputSelectionChangedEvent,\n KeyboardAwareScrollViewProps,\n KeyboardAwareScrollViewRef,\n NativeEvent,\n} from \"react-native-keyboard-controller\";\n\n// Everything begins from `onStart` handler. This handler is called every time,\n// when keyboard changes its size or when focused `TextInput` was changed. In\n// this handler we are calculating/memoizing values which later will be used\n// during layout movement. For that we calculate:\n// - layout of focused field (`layout`) - to understand whether there will be overlap\n// - initial keyboard size (`initialKeyboardSize`) - used in scroll interpolation\n// - future keyboard height (`keyboardHeight`) - used in scroll interpolation\n// - current scroll position (`scrollPosition`) - used to scroll from this point\n//\n// Once we've calculated all necessary variables - we can actually start to use them.\n// It happens in `onMove` handler - this function simply calls `maybeScroll` with\n// current keyboard frame height. This functions makes the smooth transition.\n//\n// When the transition has finished we go to `onEnd` handler. In this handler\n// we verify, that the current field is not overlapped within a keyboard frame.\n// For full `onStart`/`onMove`/`onEnd` flow it may look like a redundant thing,\n// however there could be some cases, when `onMove` is not called:\n// - on iOS when TextInput was changed - keyboard transition is instant\n// - on Android when TextInput was changed and keyboard size wasn't changed\n// So `onEnd` handler handle the case, when `onMove` wasn't triggered.\n//\n// ====================================================================================================================+\n// -----------------------------------------------------Flow chart-----------------------------------------------------+\n// ====================================================================================================================+\n//\n// +============================+ +============================+ +==================================+\n// + User Press on TextInput + => + Keyboard starts showing + => + As keyboard moves frame by frame + =>\n// + + + (run `onStart`) + + `onMove` is getting called +\n// +============================+ +============================+ +==================================+\n//\n// +============================+ +============================+ +=====================================+\n// + Keyboard is shown and we + => + User moved focus to + => + Only `onStart`/`onEnd` maybe called +\n// + call `onEnd` handler + + another `TextInput` + + (without involving `onMove`) +\n// +============================+ +============================+ +=====================================+\n//\n\n/**\n * A ScrollView component that automatically handles keyboard appearance and disappearance\n * by adjusting its content position to ensure the focused input remains visible.\n *\n * The component uses a sophisticated animation system to smoothly handle keyboard transitions\n * and maintain proper scroll position during keyboard interactions.\n *\n * @returns A ScrollView component that handles keyboard interactions.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/components/keyboard-aware-scroll-view|Documentation} page for more details.\n * @example\n * ```tsx\n * <KeyboardAwareScrollView bottomOffset={20}>\n * <TextInput placeholder=\"Enter text\" />\n * <TextInput placeholder=\"Another input\" />\n * </KeyboardAwareScrollView>\n * ```\n */\nconst KeyboardAwareScrollView = forwardRef<\n KeyboardAwareScrollViewRef,\n React.PropsWithChildren<KeyboardAwareScrollViewProps>\n>(\n (\n {\n children,\n onLayout,\n bottomOffset = 0,\n disableScrollOnKeyboardHide = false,\n enabled = true,\n extraKeyboardSpace = 0,\n mode = \"insets\",\n ScrollViewComponent = Reanimated.ScrollView,\n snapToOffsets,\n ...rest\n },\n ref,\n ) => {\n const scrollViewAnimatedRef = useAnimatedRef<Reanimated.ScrollView>();\n const scrollViewRef = React.useRef<ScrollView>(null);\n const onRef = useCombinedRef(scrollViewAnimatedRef, scrollViewRef);\n const scrollViewTarget = useSharedValue<number | null>(null);\n const scrollPosition = useSharedValue(0);\n const {\n offset: position,\n layout: scrollViewLayout,\n size: scrollViewContentSize,\n } = useScrollState(scrollViewAnimatedRef);\n const currentKeyboardFrameHeight = useSharedValue(0);\n const keyboardHeight = useSharedValue(0);\n const keyboardWillAppear = useSharedValue(false);\n const tag = useSharedValue(-1);\n const initialKeyboardSize = useSharedValue(0);\n const scrollBeforeKeyboardMovement = useSharedValue(0);\n const { input, update } = useReanimatedFocusedInput();\n const layout = useSharedValue<FocusedInputLayoutChangedEvent | null>(null);\n const lastSelection =\n useSharedValue<FocusedInputSelectionChangedEvent | null>(null);\n const ghostViewSpace = useSharedValue(-1);\n const pendingSelectionForFocus = useSharedValue(false);\n const selectionUpdatedSinceHide = useSharedValue(false);\n const scrollViewPageY = useSharedValue(0);\n\n const { height } = useWindowDimensions();\n\n const onScrollViewLayout = useCallback(\n async (e: LayoutChangeEvent) => {\n const handle = findNodeHandle(scrollViewAnimatedRef.current);\n\n scrollViewTarget.value = handle;\n\n onLayout?.(e);\n\n if (handle !== null) {\n try {\n const { y } = await KeyboardControllerNative.viewPositionInWindow(\n handle,\n );\n\n scrollViewPageY.value = y;\n } catch {\n // ignore\n }\n }\n },\n [onLayout],\n );\n\n /**\n * Function that will scroll a ScrollView as keyboard gets moving.\n */\n const maybeScroll = useCallback(\n (e: number, animated: boolean = false) => {\n \"worklet\";\n\n if (!enabled) {\n return 0;\n }\n\n // input belongs to ScrollView\n if (layout.value?.parentScrollViewTarget !== scrollViewTarget.value) {\n return 0;\n }\n\n const visibleRect = height - keyboardHeight.value;\n const absoluteY = layout.value?.layout.absoluteY || 0;\n const inputHeight = layout.value?.layout.height || 0;\n const point = absoluteY + inputHeight;\n\n if (visibleRect - point <= bottomOffset) {\n const relativeScrollTo =\n keyboardHeight.value - (height - point) + bottomOffset;\n const interpolatedScrollTo = interpolate(\n e,\n [initialKeyboardSize.value, keyboardHeight.value],\n [\n 0,\n scrollDistanceWithRespectToSnapPoints(\n relativeScrollTo + scrollPosition.value,\n snapToOffsets,\n ) - scrollPosition.value,\n ],\n );\n const targetScrollY =\n Math.max(interpolatedScrollTo, 0) + scrollPosition.value;\n\n scrollTo(scrollViewAnimatedRef, 0, targetScrollY, animated);\n\n return interpolatedScrollTo;\n }\n\n if (point < scrollViewPageY.value) {\n const positionOnScreen = visibleRect - bottomOffset;\n const topOfScreen = scrollPosition.value + point;\n\n scrollTo(\n scrollViewAnimatedRef,\n 0,\n topOfScreen - positionOnScreen,\n animated,\n );\n }\n\n return 0;\n },\n [bottomOffset, enabled, height, snapToOffsets],\n );\n const removeGhostPadding = useCallback(\n (e: number) => {\n \"worklet\";\n\n // layout mode: the spacer view participates in layout, so the ScrollView\n // reflows naturally when it shrinks — no manual scroll correction needed.\n if (mode === \"layout\") {\n return false;\n }\n\n // insets mode: `ScrollViewWithBottomPadding` extends scrollable area without\n // changing layout, so when the keyboard hides and we're at the end of the\n // ScrollView we must manually scroll back.\n if (!keyboardWillAppear.value && ghostViewSpace.value > 0) {\n scrollTo(\n scrollViewAnimatedRef,\n 0,\n scrollPosition.value -\n interpolate(\n e,\n [initialKeyboardSize.value, keyboardHeight.value],\n [ghostViewSpace.value, 0],\n ),\n false,\n );\n\n return true;\n }\n\n return false;\n },\n [mode],\n );\n const performScrollWithPositionRestoration = useCallback(\n (newPosition: number) => {\n \"worklet\";\n\n const prevScroll = scrollPosition.value;\n\n // eslint-disable-next-line react-compiler/react-compiler\n scrollPosition.value = newPosition;\n maybeScroll(keyboardHeight.value, true);\n scrollPosition.value = prevScroll;\n },\n [scrollPosition, keyboardHeight, maybeScroll],\n );\n const syncKeyboardFrame = useCallback(\n (e: NativeEvent) => {\n \"worklet\";\n\n const keyboardFrame = interpolate(\n e.height,\n [0, keyboardHeight.value],\n [0, keyboardHeight.value + extraKeyboardSpace],\n );\n\n currentKeyboardFrameHeight.value = keyboardFrame;\n },\n [extraKeyboardSpace],\n );\n\n const updateLayoutFromSelection = useCallback(() => {\n \"worklet\";\n\n const customHeight = lastSelection.value?.selection.end.y;\n\n if (!input.value?.layout || customHeight === undefined) {\n return false;\n }\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\n return true;\n }, [input, lastSelection, layout]);\n const scrollFromCurrentPosition = useCallback(() => {\n \"worklet\";\n\n const prevLayout = layout.value;\n\n if (!updateLayoutFromSelection()) {\n return;\n }\n\n performScrollWithPositionRestoration(position.value);\n\n layout.value = prevLayout;\n }, [performScrollWithPositionRestoration]);\n const onChangeText = useCallback(() => {\n \"worklet\";\n scrollFromCurrentPosition();\n }, [scrollFromCurrentPosition]);\n const onChangeTextHandler = useMemo(\n () => debounce(onChangeText, 200),\n [onChangeText],\n );\n const onSelectionChange = useCallback(\n (e: FocusedInputSelectionChangedEvent) => {\n \"worklet\";\n\n const lastTarget = lastSelection.value?.target;\n const latestSelection = lastSelection.value?.selection;\n\n lastSelection.value = e;\n selectionUpdatedSinceHide.value = true;\n\n if (e.target !== lastTarget || pendingSelectionForFocus.value) {\n if (pendingSelectionForFocus.value) {\n // selection arrived after onStart - complete the deferred setup\n pendingSelectionForFocus.value = false;\n updateLayoutFromSelection();\n\n // if keyboard was already visible (focus change, no onMove expected),\n // perform the deferred scroll now\n if (!keyboardWillAppear.value && keyboardHeight.value > 0) {\n position.value += maybeScroll(keyboardHeight.value, true);\n }\n }\n\n return;\n }\n // caret in the end + end coordinates has been changed -> we moved to a new line\n // so input may grow\n if (\n e.selection.end.position === e.selection.start.position &&\n latestSelection?.end.y !== e.selection.end.y\n ) {\n return scrollFromCurrentPosition();\n }\n // selection has been changed\n if (e.selection.start.position !== e.selection.end.position) {\n return scrollFromCurrentPosition();\n }\n\n onChangeTextHandler();\n },\n [\n scrollFromCurrentPosition,\n onChangeTextHandler,\n updateLayoutFromSelection,\n maybeScroll,\n ],\n );\n\n useFocusedInputHandler(\n {\n onSelectionChange: onSelectionChange,\n },\n [onSelectionChange],\n );\n\n useSmoothKeyboardHandler(\n {\n onStart: (e) => {\n \"worklet\";\n\n const keyboardWillChangeSize =\n keyboardHeight.value !== e.height && e.height > 0;\n\n keyboardWillAppear.value = e.height > 0 && keyboardHeight.value === 0;\n\n const keyboardWillHide = e.height === 0;\n const focusWasChanged =\n (tag.value !== e.target && e.target !== -1) ||\n keyboardWillChangeSize;\n\n if (keyboardWillChangeSize) {\n initialKeyboardSize.value = keyboardHeight.value;\n }\n\n if (keyboardWillHide) {\n // on back transition need to interpolate as [0, keyboardHeight]\n initialKeyboardSize.value = 0;\n scrollPosition.value = scrollBeforeKeyboardMovement.value;\n pendingSelectionForFocus.value = false;\n }\n\n if (\n keyboardWillAppear.value ||\n keyboardWillChangeSize ||\n focusWasChanged\n ) {\n // persist scroll value\n scrollPosition.value = position.value;\n // just persist height - later will be used in interpolation\n keyboardHeight.value = e.height;\n\n // insets mode: set the full contentInset upfront so that maybeScroll\n // calculations are correct from the very first onMove frame.\n // layout mode: do NOT set it here — the spacer must grow frame-by-frame\n // in onMove to avoid a premature full-height jump before the keyboard moves.\n if (mode === \"insets\") {\n syncKeyboardFrame(e);\n }\n }\n\n // focus was changed\n if (focusWasChanged) {\n tag.value = e.target;\n\n if (\n lastSelection.value?.target === e.target &&\n selectionUpdatedSinceHide.value\n ) {\n // fresh selection arrived before onStart - use it to update layout\n updateLayoutFromSelection();\n pendingSelectionForFocus.value = false;\n } else {\n // selection hasn't arrived yet for the new target (iOS 15),\n // or it's stale from previous session (Android refocus same input).\n // Use stale selection as best-effort fallback if available for same target,\n // otherwise fall back to full input layout.\n // Will be corrected if a fresh onSelectionChange arrives.\n if (lastSelection.value?.target === e.target) {\n updateLayoutFromSelection();\n } else if (input.value) {\n layout.value = input.value;\n }\n pendingSelectionForFocus.value = true;\n }\n\n // save current scroll position - when keyboard will hide we'll reuse\n // this value to achieve smooth hide effect\n scrollBeforeKeyboardMovement.value = position.value;\n }\n\n if (focusWasChanged && !keyboardWillAppear.value) {\n if (!pendingSelectionForFocus.value) {\n // update position on scroll value, so `onEnd` handler\n // will pick up correct values\n position.value += maybeScroll(e.height, true);\n }\n }\n\n if (mode === \"insets\") {\n ghostViewSpace.value =\n position.value +\n scrollViewLayout.value.height -\n scrollViewContentSize.value.height;\n\n if (ghostViewSpace.value > 0) {\n scrollPosition.value = position.value;\n }\n }\n },\n onMove: (e) => {\n \"worklet\";\n\n if (\n pendingSelectionForFocus.value &&\n lastSelection.value?.target !== tag.value\n ) {\n return;\n }\n\n if (removeGhostPadding(e.height)) {\n return;\n }\n\n // layout mode: drive the spacer view animation frame-by-frame\n if (mode === \"layout\") {\n syncKeyboardFrame(e);\n }\n\n // if the user has set disableScrollOnKeyboardHide, only auto-scroll when the keyboard opens\n if (!disableScrollOnKeyboardHide || keyboardWillAppear.value) {\n maybeScroll(e.height);\n }\n },\n onEnd: (e) => {\n \"worklet\";\n\n if (e.height === 0) {\n removeGhostPadding(e.height);\n }\n\n keyboardHeight.value = e.height;\n scrollPosition.value = position.value;\n\n if (e.height === 0) {\n selectionUpdatedSinceHide.value = false;\n } else if (keyboardWillAppear.value) {\n // keyboard fully shown after appearing from hidden state — clear\n // pending flag to prevent leaking into next focus-change session.\n // Only when the keyboard was actually appearing (not a focus switch\n // with same keyboard height), otherwise we'd clear the flag before\n // onSelectionChange has a chance to process it.\n pendingSelectionForFocus.value = false;\n }\n\n syncKeyboardFrame(e);\n },\n },\n [\n mode,\n maybeScroll,\n removeGhostPadding,\n disableScrollOnKeyboardHide,\n syncKeyboardFrame,\n ],\n );\n\n const synchronize = useCallback(async () => {\n await update();\n\n requestAnimationFrame(() => {\n runOnUI(() => {\n \"worklet\";\n\n scrollFromCurrentPosition();\n })();\n });\n }, [update, scrollFromCurrentPosition]);\n\n useImperativeHandle(\n ref,\n () => {\n const scrollView = scrollViewRef.current;\n\n if (scrollView) {\n const scrollViewWithMethods =\n scrollView as KeyboardAwareScrollViewRef;\n\n scrollViewWithMethods.assureFocusedInputVisible = () => {\n synchronize();\n };\n\n return scrollViewWithMethods;\n }\n\n return {\n assureFocusedInputVisible: () => {\n synchronize();\n },\n } as KeyboardAwareScrollViewRef;\n },\n [synchronize],\n );\n\n useEffect(() => {\n synchronize();\n }, [bottomOffset]);\n\n useAnimatedReaction(\n () => input.value,\n (current, previous) => {\n if (\n current?.target === previous?.target &&\n current?.layout.height !== previous?.layout.height\n ) {\n // input has changed layout - let's check if we need to scroll\n // may happen when you paste text, then onSelectionChange will be\n // fired earlier than text actually changes its layout\n scrollFromCurrentPosition();\n }\n },\n [],\n );\n\n const padding = useDerivedValue(\n () => (enabled ? currentKeyboardFrameHeight.value : 0),\n [enabled],\n );\n // layout mode only: a spacer view whose paddingBottom grows with the keyboard.\n // The `+ 1` ensures the scroll view never reaches its absolute end during animation,\n // avoiding the layout recalculation that triggers on every frame at the boundary.\n // see: https://github.com/kirillzyusko/react-native-keyboard-controller/pull/342\n const layoutSpacerStyle = useAnimatedStyle(\n () =>\n enabled && mode === \"layout\"\n ? { paddingBottom: currentKeyboardFrameHeight.value + 1 }\n : {},\n [enabled, mode],\n );\n\n if (mode === \"layout\") {\n return (\n <ScrollViewComponent\n ref={onRef}\n {...rest}\n scrollEventThrottle={16}\n onLayout={onScrollViewLayout}\n >\n {children}\n {enabled && <Reanimated.View style={layoutSpacerStyle} />}\n </ScrollViewComponent>\n );\n }\n\n return (\n <ScrollViewWithBottomPadding\n ref={onRef}\n {...rest}\n bottomPadding={padding}\n scrollEventThrottle={16}\n ScrollViewComponent={ScrollViewComponent}\n onLayout={onScrollViewLayout}\n >\n {children}\n </ScrollViewWithBottomPadding>\n );\n },\n);\n\nexport default KeyboardAwareScrollView;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,sBAAA,GAAAF,uBAAA,CAAAC,OAAA;AAYA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,eAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,4BAAA,GAAAF,sBAAA,CAAAN,OAAA;AAEA,IAAAS,yBAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAA0E,SAAAM,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAhB,uBAAA,YAAAA,CAAAY,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,M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GACPP,IAAI;MACRsH,mBAAmB,EAAE,EAAG;MACxBhI,QAAQ,EAAE6C;IAAmB,IAE5B9C,QAAQ,EACRI,OAAO,iBAAI5C,MAAA,CAAAe,OAAA,CAAAyJ,aAAA,CAACrK,sBAAA,CAAAY,OAAU,CAAC2J,IAAI;MAACC,KAAK,EAAEN;IAAkB,CAAE,CACrC,CAAC;EAE1B;EAEA,oBACErK,MAAA,CAAAe,OAAA,CAAAyJ,aAAA,CAAC9J,4BAAA,CAAAK,OAA2B,EAAAiB,QAAA;IAC1BoB,GAAG,EAAEM;EAAM,GACPP,IAAI;IACRyH,aAAa,EAAET,OAAQ;IACvBM,mBAAmB,EAAE,EAAG;IACxB1H,mBAAmB,EAAEA,mBAAoB;IACzCN,QAAQ,EAAE6C;EAAmB,IAE5B9C,QAC0B,CAAC;AAElC,CACF,CAAC;AAAC,IAAAqI,QAAA,GAAAC,OAAA,CAAA/J,OAAA,GAEauB,uBAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _constants = require("../../constants");
|
|
10
|
+
var _module = require("../../module");
|
|
11
|
+
var _KeyboardStickyView = _interopRequireDefault(require("../KeyboardStickyView"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
|
+
const translucentStack = [];
|
|
16
|
+
let currentTranslucent = false;
|
|
17
|
+
const applyTranslucent = () => {
|
|
18
|
+
const next = translucentStack.length > 0 ? translucentStack[translucentStack.length - 1].translucent : false;
|
|
19
|
+
if (next !== currentTranslucent) {
|
|
20
|
+
currentTranslucent = next;
|
|
21
|
+
_module.KeyboardController.setTranslucent(next);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const pushTranslucentEntry = entry => {
|
|
25
|
+
translucentStack.push(entry);
|
|
26
|
+
applyTranslucent();
|
|
27
|
+
};
|
|
28
|
+
const removeTranslucentEntry = entry => {
|
|
29
|
+
const index = translucentStack.indexOf(entry);
|
|
30
|
+
if (index !== -1) {
|
|
31
|
+
translucentStack.splice(index, 1);
|
|
32
|
+
}
|
|
33
|
+
applyTranslucent();
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* A component that renders content behind the keyboard. Since the keyboard
|
|
37
|
+
* is translucent, the content (colors, gradients, animations) will blend
|
|
38
|
+
* through and create visual effects on the keyboard.
|
|
39
|
+
*
|
|
40
|
+
* On iOS 26+ the keyboard has rounded corners, and the effect view
|
|
41
|
+
* automatically matches that shape.
|
|
42
|
+
*
|
|
43
|
+
* @returns A view component positioned behind the keyboard.
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <KeyboardEffects>
|
|
47
|
+
* <View style={{ flex: 1, backgroundColor: "purple" }} />
|
|
48
|
+
* </KeyboardEffects>
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
const KeyboardEffects = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
52
|
+
translucent,
|
|
53
|
+
children,
|
|
54
|
+
...props
|
|
55
|
+
}, ref) => {
|
|
56
|
+
const stackEntry = (0, _react.useRef)({
|
|
57
|
+
translucent: Boolean(translucent)
|
|
58
|
+
}).current;
|
|
59
|
+
const containerStyle = (0, _react.useMemo)(() => [styles.container, _constants.KEYBOARD_HAS_ROUNDED_CORNERS && !translucent && styles.rounded], [translucent]);
|
|
60
|
+
(0, _react.useEffect)(() => {
|
|
61
|
+
pushTranslucentEntry(stackEntry);
|
|
62
|
+
return () => {
|
|
63
|
+
removeTranslucentEntry(stackEntry);
|
|
64
|
+
};
|
|
65
|
+
}, [stackEntry]);
|
|
66
|
+
(0, _react.useEffect)(() => {
|
|
67
|
+
stackEntry.translucent = Boolean(translucent);
|
|
68
|
+
applyTranslucent();
|
|
69
|
+
}, [stackEntry, translucent]);
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement(_KeyboardStickyView.default, _extends({
|
|
71
|
+
ref: ref
|
|
72
|
+
}, props), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
73
|
+
style: containerStyle
|
|
74
|
+
}, children));
|
|
75
|
+
});
|
|
76
|
+
const styles = _reactNative.StyleSheet.create({
|
|
77
|
+
container: {
|
|
78
|
+
position: "absolute",
|
|
79
|
+
bottom: 0,
|
|
80
|
+
top: 0,
|
|
81
|
+
left: 0,
|
|
82
|
+
right: 0,
|
|
83
|
+
height: 999
|
|
84
|
+
},
|
|
85
|
+
rounded: {
|
|
86
|
+
borderTopLeftRadius: _constants.KEYBOARD_BORDER_RADIUS,
|
|
87
|
+
borderTopRightRadius: _constants.KEYBOARD_BORDER_RADIUS,
|
|
88
|
+
overflow: "hidden"
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
var _default = exports.default = KeyboardEffects;
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_constants","_module","_KeyboardStickyView","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","translucentStack","currentTranslucent","applyTranslucent","next","translucent","KeyboardController","setTranslucent","pushTranslucentEntry","entry","push","removeTranslucentEntry","index","indexOf","splice","KeyboardEffects","forwardRef","children","props","ref","stackEntry","useRef","Boolean","current","containerStyle","useMemo","styles","container","KEYBOARD_HAS_ROUNDED_CORNERS","rounded","useEffect","createElement","View","style","StyleSheet","create","position","bottom","top","left","right","height","borderTopLeftRadius","KEYBOARD_BORDER_RADIUS","borderTopRightRadius","overflow","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useMemo, useRef } from \"react\";\nimport { StyleSheet, View } from \"react-native\";\n\nimport {\n KEYBOARD_BORDER_RADIUS,\n KEYBOARD_HAS_ROUNDED_CORNERS,\n} from \"../../constants\";\nimport { KeyboardController } from \"../../module\";\nimport KeyboardStickyView from \"../KeyboardStickyView\";\n\nimport type { KeyboardStickyViewProps } from \"../KeyboardStickyView\";\n\ntype TranslucentStackEntry = { translucent: boolean };\n\nconst translucentStack: TranslucentStackEntry[] = [];\nlet currentTranslucent = false;\n\nconst applyTranslucent = () => {\n const next =\n translucentStack.length > 0\n ? translucentStack[translucentStack.length - 1].translucent\n : false;\n\n if (next !== currentTranslucent) {\n currentTranslucent = next;\n KeyboardController.setTranslucent(next);\n }\n};\n\nconst pushTranslucentEntry = (entry: TranslucentStackEntry) => {\n translucentStack.push(entry);\n applyTranslucent();\n};\n\nconst removeTranslucentEntry = (entry: TranslucentStackEntry) => {\n const index = translucentStack.indexOf(entry);\n\n if (index !== -1) {\n translucentStack.splice(index, 1);\n }\n\n applyTranslucent();\n};\n\nexport type KeyboardEffectsProps = {\n /**\n * Whether the keyboard backdrop should be translucent.\n *\n * @default false\n */\n translucent?: boolean;\n} & KeyboardStickyViewProps;\n\n/**\n * A component that renders content behind the keyboard. Since the keyboard\n * is translucent, the content (colors, gradients, animations) will blend\n * through and create visual effects on the keyboard.\n *\n * On iOS 26+ the keyboard has rounded corners, and the effect view\n * automatically matches that shape.\n *\n * @returns A view component positioned behind the keyboard.\n * @example\n * ```tsx\n * <KeyboardEffects>\n * <View style={{ flex: 1, backgroundColor: \"purple\" }} />\n * </KeyboardEffects>\n * ```\n */\nconst KeyboardEffects = forwardRef<\n View,\n React.PropsWithChildren<KeyboardEffectsProps>\n>(({ translucent, children, ...props }, ref) => {\n const stackEntry = useRef<TranslucentStackEntry>({\n translucent: Boolean(translucent),\n }).current;\n const containerStyle = useMemo(\n () => [\n styles.container,\n KEYBOARD_HAS_ROUNDED_CORNERS && !translucent && styles.rounded,\n ],\n [translucent],\n );\n\n useEffect(() => {\n pushTranslucentEntry(stackEntry);\n\n return () => {\n removeTranslucentEntry(stackEntry);\n };\n }, [stackEntry]);\n\n useEffect(() => {\n stackEntry.translucent = Boolean(translucent);\n applyTranslucent();\n }, [stackEntry, translucent]);\n\n return (\n <KeyboardStickyView ref={ref} {...props}>\n <View style={containerStyle}>{children}</View>\n </KeyboardStickyView>\n );\n});\n\nconst styles = StyleSheet.create({\n container: {\n position: \"absolute\",\n bottom: 0,\n top: 0,\n left: 0,\n right: 0,\n height: 999,\n },\n rounded: {\n borderTopLeftRadius: KEYBOARD_BORDER_RADIUS,\n borderTopRightRadius: KEYBOARD_BORDER_RADIUS,\n overflow: \"hidden\",\n },\n});\n\nexport default KeyboardEffects;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAIA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAuD,SAAAK,uBAAAC,CAAA,WAAAA,CAAA,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A,CAAArE,OAAA,GAEYqC,eAAe","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = exports.TEST_ID_KEYBOARD_TOOLBAR_NEXT = exports.TEST_ID_KEYBOARD_TOOLBAR_DONE = exports.TEST_ID_KEYBOARD_TOOLBAR_CONTENT = exports.TEST_ID_KEYBOARD_TOOLBAR = exports.OPENED_OFFSET = exports.KEYBOARD_TOOLBAR_HEIGHT = exports.
|
|
6
|
+
exports.TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = exports.TEST_ID_KEYBOARD_TOOLBAR_NEXT = exports.TEST_ID_KEYBOARD_TOOLBAR_DONE = exports.TEST_ID_KEYBOARD_TOOLBAR_CONTENT = exports.TEST_ID_KEYBOARD_TOOLBAR = exports.OPENED_OFFSET = exports.KEYBOARD_TOOLBAR_HEIGHT = exports.DEFAULT_OPACITY = void 0;
|
|
7
7
|
var _constants = require("../../constants");
|
|
8
8
|
const TEST_ID_KEYBOARD_TOOLBAR = exports.TEST_ID_KEYBOARD_TOOLBAR = "keyboard.toolbar";
|
|
9
9
|
const TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = exports.TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;
|
|
@@ -12,6 +12,5 @@ const TEST_ID_KEYBOARD_TOOLBAR_CONTENT = exports.TEST_ID_KEYBOARD_TOOLBAR_CONTEN
|
|
|
12
12
|
const TEST_ID_KEYBOARD_TOOLBAR_DONE = exports.TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;
|
|
13
13
|
const KEYBOARD_TOOLBAR_HEIGHT = exports.KEYBOARD_TOOLBAR_HEIGHT = 42;
|
|
14
14
|
const DEFAULT_OPACITY = exports.DEFAULT_OPACITY = "FF";
|
|
15
|
-
const
|
|
16
|
-
const OPENED_OFFSET = exports.OPENED_OFFSET = KEYBOARD_HAS_ROUNDED_CORNERS ? -11 : 0;
|
|
15
|
+
const OPENED_OFFSET = exports.OPENED_OFFSET = _constants.KEYBOARD_HAS_ROUNDED_CORNERS ? -11 : 0;
|
|
17
16
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_constants","require","TEST_ID_KEYBOARD_TOOLBAR","exports","TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS","TEST_ID_KEYBOARD_TOOLBAR_NEXT","TEST_ID_KEYBOARD_TOOLBAR_CONTENT","TEST_ID_KEYBOARD_TOOLBAR_DONE","KEYBOARD_TOOLBAR_HEIGHT","DEFAULT_OPACITY","
|
|
1
|
+
{"version":3,"names":["_constants","require","TEST_ID_KEYBOARD_TOOLBAR","exports","TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS","TEST_ID_KEYBOARD_TOOLBAR_NEXT","TEST_ID_KEYBOARD_TOOLBAR_CONTENT","TEST_ID_KEYBOARD_TOOLBAR_DONE","KEYBOARD_TOOLBAR_HEIGHT","DEFAULT_OPACITY","OPENED_OFFSET","KEYBOARD_HAS_ROUNDED_CORNERS"],"sources":["constants.ts"],"sourcesContent":["import { KEYBOARD_HAS_ROUNDED_CORNERS } from \"../../constants\";\n\nimport type { HEX } from \"./types\";\n\nexport const TEST_ID_KEYBOARD_TOOLBAR = \"keyboard.toolbar\";\nexport const TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;\nexport const TEST_ID_KEYBOARD_TOOLBAR_NEXT = `${TEST_ID_KEYBOARD_TOOLBAR}.next`;\nexport const TEST_ID_KEYBOARD_TOOLBAR_CONTENT = `${TEST_ID_KEYBOARD_TOOLBAR}.content`;\nexport const TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;\n\nexport const KEYBOARD_TOOLBAR_HEIGHT = 42;\nexport const DEFAULT_OPACITY: HEX = \"FF\";\nexport const OPENED_OFFSET = KEYBOARD_HAS_ROUNDED_CORNERS ? -11 : 0;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAIO,MAAMC,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,GAAG,kBAAkB;AACnD,MAAME,iCAAiC,GAAAD,OAAA,CAAAC,iCAAA,GAAG,GAAGF,wBAAwB,WAAW;AAChF,MAAMG,6BAA6B,GAAAF,OAAA,CAAAE,6BAAA,GAAG,GAAGH,wBAAwB,OAAO;AACxE,MAAMI,gCAAgC,GAAAH,OAAA,CAAAG,gCAAA,GAAG,GAAGJ,wBAAwB,UAAU;AAC9E,MAAMK,6BAA6B,GAAAJ,OAAA,CAAAI,6BAAA,GAAG,GAAGL,wBAAwB,OAAO;AAExE,MAAMM,uBAAuB,GAAAL,OAAA,CAAAK,uBAAA,GAAG,EAAE;AAClC,MAAMC,eAAoB,GAAAN,OAAA,CAAAM,eAAA,GAAG,IAAI;AACjC,MAAMC,aAAa,GAAAP,OAAA,CAAAO,aAAA,GAAGC,uCAA4B,GAAG,CAAC,EAAE,GAAG,CAAC","ignoreList":[]}
|
|
@@ -13,6 +13,7 @@ exports.default = void 0;
|
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _reactNative = require("react-native");
|
|
15
15
|
var _bindings = require("../../bindings");
|
|
16
|
+
var _constants = require("../../constants");
|
|
16
17
|
var _hooks = require("../../hooks");
|
|
17
18
|
var _KeyboardStickyView = _interopRequireDefault(require("../KeyboardStickyView"));
|
|
18
19
|
var _Arrow = _interopRequireDefault(require("./Arrow"));
|
|
@@ -20,7 +21,7 @@ var _Button = _interopRequireDefault(require("./Button"));
|
|
|
20
21
|
var _colors = require("./colors");
|
|
21
22
|
var _components = require("./compound/components");
|
|
22
23
|
var _context = require("./compound/context");
|
|
23
|
-
var
|
|
24
|
+
var _constants2 = require("./constants");
|
|
24
25
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
25
26
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
26
27
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
@@ -51,7 +52,7 @@ const KeyboardToolbar = props => {
|
|
|
51
52
|
onPrevCallback,
|
|
52
53
|
onDoneCallback,
|
|
53
54
|
blur = null,
|
|
54
|
-
opacity =
|
|
55
|
+
opacity = _constants2.DEFAULT_OPACITY,
|
|
55
56
|
offset: {
|
|
56
57
|
closed = 0,
|
|
57
58
|
opened = 0
|
|
@@ -88,8 +89,8 @@ const KeyboardToolbar = props => {
|
|
|
88
89
|
right: ((insets === null || insets === void 0 ? void 0 : insets.right) ?? 0) + 16
|
|
89
90
|
} : null], [insets]);
|
|
90
91
|
const offset = (0, _react.useMemo)(() => ({
|
|
91
|
-
closed: closed +
|
|
92
|
-
opened: opened +
|
|
92
|
+
closed: closed + _constants2.KEYBOARD_TOOLBAR_HEIGHT,
|
|
93
|
+
opened: opened + _constants2.OPENED_OFFSET
|
|
93
94
|
}), [closed, opened]);
|
|
94
95
|
let backgroundElement = null;
|
|
95
96
|
let arrowsElement = null;
|
|
@@ -157,7 +158,7 @@ const KeyboardToolbar = props => {
|
|
|
157
158
|
style: containerStyle
|
|
158
159
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
|
|
159
160
|
style: toolbarStyle,
|
|
160
|
-
testID:
|
|
161
|
+
testID: _constants2.TEST_ID_KEYBOARD_TOOLBAR
|
|
161
162
|
}), backgroundElement, arrowsElement, contentContainer, doneElement)));
|
|
162
163
|
};
|
|
163
164
|
const styles = _reactNative.StyleSheet.create({
|
|
@@ -166,7 +167,7 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
166
167
|
left: 0,
|
|
167
168
|
right: 0,
|
|
168
169
|
bottom: 0,
|
|
169
|
-
height:
|
|
170
|
+
height: _constants2.KEYBOARD_TOOLBAR_HEIGHT
|
|
170
171
|
},
|
|
171
172
|
toolbar: {
|
|
172
173
|
position: "absolute",
|
|
@@ -174,7 +175,7 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
174
175
|
alignItems: "center",
|
|
175
176
|
width: "100%",
|
|
176
177
|
flexDirection: "row",
|
|
177
|
-
height:
|
|
178
|
+
height: _constants2.KEYBOARD_TOOLBAR_HEIGHT
|
|
178
179
|
},
|
|
179
180
|
arrows: {
|
|
180
181
|
flexDirection: "row",
|