react-native-keyboard-controller 1.20.7 → 1.21.0-beta.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/android/.settings/org.eclipse.buildship.core.prefs +2 -0
- package/android/src/base/java/com/reactnativekeyboardcontroller/KeyboardControllerPackage.kt +2 -0
- package/android/src/fabric/java/com/reactnativekeyboardcontroller/ClippingScrollViewDecoratorViewManager.kt +30 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/managers/ClippingScrollViewDecoratorViewManagerImpl.kt +13 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/views/ClippingScrollViewDecoratorView.kt +37 -0
- package/android/src/paper/java/com/reactnativekeyboardcontroller/ClippingScrollViewDecoratorViewManager.kt +24 -0
- package/ios/KeyboardController.xcodeproj/xcuserdata/kirylziusko.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/ios/Tests/Tests.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Tests/Tests.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/Tests/Tests.xcodeproj/project.xcworkspace/xcuserdata/kirylziusko.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Tests/Tests.xcodeproj/xcuserdata/kirylziusko.xcuserdatad/xcschemes/xcschememanagement.plist +32 -0
- package/ios/animations/KeyboardAnimation.swift +2 -2
- package/ios/animations/SpringAnimation.swift +1 -1
- package/ios/animations/TimingAnimation.swift +1 -3
- package/ios/delegates/KCTextInputCompositeDelegate.swift +2 -2
- package/ios/extensions/CGFloat.swift +1 -3
- package/ios/interactive/KeyboardAreaExtender.swift +2 -1
- package/ios/observers/FocusedInputObserver.swift +4 -2
- package/ios/observers/movement/KeyboardTrackingView.swift +4 -1
- package/ios/observers/movement/observer/KeyboardMovementObserver+Interactive.swift +4 -0
- package/ios/protocols/TextInput.swift +1 -1
- package/ios/swizzling/UIResponderSwizzle.swift +2 -4
- package/ios/traversal/FocusedInputHolder.swift +3 -3
- package/ios/traversal/KeyboardView.swift +1 -1
- package/ios/traversal/ViewHierarchyNavigator.swift +2 -2
- package/ios/views/KeyboardControllerViewManager.swift +5 -5
- package/lib/commonjs/bindings.js +7 -1
- package/lib/commonjs/bindings.js.map +1 -1
- package/lib/commonjs/bindings.native.js +4 -1
- package/lib/commonjs/bindings.native.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js +77 -22
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/commonjs/components/ScrollViewWithBottomPadding/index.js +43 -0
- package/lib/commonjs/components/ScrollViewWithBottomPadding/index.js.map +1 -0
- package/lib/commonjs/components/ScrollViewWithBottomPadding/styles.js +14 -0
- package/lib/commonjs/components/ScrollViewWithBottomPadding/styles.js.map +1 -0
- package/lib/commonjs/components/hooks/useScrollState.js +43 -0
- package/lib/commonjs/components/hooks/useScrollState.js.map +1 -0
- package/lib/commonjs/specs/ClippingScrollViewDecoratorViewNativeComponent.js +12 -0
- package/lib/commonjs/specs/ClippingScrollViewDecoratorViewNativeComponent.js.map +1 -0
- package/lib/commonjs/types/views.js.map +1 -1
- package/lib/module/bindings.js +6 -0
- package/lib/module/bindings.js.map +1 -1
- package/lib/module/bindings.native.js +3 -0
- package/lib/module/bindings.native.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/index.js +78 -23
- package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/module/components/ScrollViewWithBottomPadding/index.js +35 -0
- package/lib/module/components/ScrollViewWithBottomPadding/index.js.map +1 -0
- package/lib/module/components/ScrollViewWithBottomPadding/styles.js +8 -0
- package/lib/module/components/ScrollViewWithBottomPadding/styles.js.map +1 -0
- package/lib/module/components/hooks/useScrollState.js +37 -0
- package/lib/module/components/hooks/useScrollState.js.map +1 -0
- package/lib/module/specs/ClippingScrollViewDecoratorViewNativeComponent.js +6 -0
- package/lib/module/specs/ClippingScrollViewDecoratorViewNativeComponent.js.map +1 -0
- package/lib/module/types/views.js.map +1 -1
- package/lib/typescript/bindings.d.ts +7 -1
- package/lib/typescript/bindings.native.d.ts +1 -0
- package/lib/typescript/components/KeyboardAwareScrollView/index.d.ts +3 -2
- package/lib/typescript/components/ScrollViewWithBottomPadding/index.d.ts +12 -0
- package/lib/typescript/components/ScrollViewWithBottomPadding/styles.d.ts +6 -0
- package/lib/typescript/components/hooks/useScrollState.d.ts +14 -0
- package/lib/typescript/specs/ClippingScrollViewDecoratorViewNativeComponent.d.ts +8 -0
- package/lib/typescript/types/views.d.ts +4 -0
- package/package.json +4 -3
- package/src/bindings.native.ts +5 -0
- package/src/bindings.ts +8 -0
- package/src/components/KeyboardAwareScrollView/index.tsx +111 -28
- package/src/components/ScrollViewWithBottomPadding/index.tsx +72 -0
- package/src/components/ScrollViewWithBottomPadding/styles.ts +9 -0
- package/src/components/hooks/useScrollState.ts +59 -0
- package/src/specs/ClippingScrollViewDecoratorViewNativeComponent.ts +17 -0
- package/src/types/views.ts +6 -0
package/android/src/base/java/com/reactnativekeyboardcontroller/KeyboardControllerPackage.kt
CHANGED
|
@@ -8,6 +8,7 @@ import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
|
8
8
|
import com.facebook.react.uimanager.ViewManager
|
|
9
9
|
import com.reactnativekeyboardcontroller.modules.KeyboardControllerModuleImpl
|
|
10
10
|
import com.reactnativekeyboardcontroller.modules.statusbar.StatusBarManagerCompatModuleImpl
|
|
11
|
+
import java.com.reactnativekeyboardcontroller.ClippingScrollViewDecoratorViewManager
|
|
11
12
|
|
|
12
13
|
class KeyboardControllerPackage : BaseReactPackage() {
|
|
13
14
|
override fun getModule(
|
|
@@ -58,5 +59,6 @@ class KeyboardControllerPackage : BaseReactPackage() {
|
|
|
58
59
|
KeyboardGestureAreaViewManager(),
|
|
59
60
|
OverKeyboardViewManager(),
|
|
60
61
|
KeyboardBackgroundViewManager(),
|
|
62
|
+
ClippingScrollViewDecoratorViewManager(),
|
|
61
63
|
)
|
|
62
64
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
package java.com.reactnativekeyboardcontroller
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
4
|
+
import com.facebook.react.uimanager.ViewGroupManager
|
|
5
|
+
import com.facebook.react.uimanager.ViewManagerDelegate
|
|
6
|
+
import com.facebook.react.viewmanagers.ClippingScrollViewDecoratorViewManagerDelegate
|
|
7
|
+
import com.facebook.react.viewmanagers.ClippingScrollViewDecoratorViewManagerInterface
|
|
8
|
+
import com.reactnativekeyboardcontroller.managers.ClippingScrollViewDecoratorViewManagerImpl
|
|
9
|
+
import com.reactnativekeyboardcontroller.views.ClippingScrollViewDecoratorView
|
|
10
|
+
|
|
11
|
+
class ClippingScrollViewDecoratorViewManager :
|
|
12
|
+
ViewGroupManager<ClippingScrollViewDecoratorView>(),
|
|
13
|
+
ClippingScrollViewDecoratorViewManagerInterface<ClippingScrollViewDecoratorView> {
|
|
14
|
+
private val manager = ClippingScrollViewDecoratorViewManagerImpl()
|
|
15
|
+
private val mDelegate = ClippingScrollViewDecoratorViewManagerDelegate(this)
|
|
16
|
+
|
|
17
|
+
override fun getDelegate(): ViewManagerDelegate<ClippingScrollViewDecoratorView> = mDelegate
|
|
18
|
+
|
|
19
|
+
override fun getName(): String = ClippingScrollViewDecoratorViewManagerImpl.NAME
|
|
20
|
+
|
|
21
|
+
override fun createViewInstance(context: ThemedReactContext): ClippingScrollViewDecoratorView =
|
|
22
|
+
manager.createViewInstance(context)
|
|
23
|
+
|
|
24
|
+
override fun setContentInsetBottom(
|
|
25
|
+
view: ClippingScrollViewDecoratorView?,
|
|
26
|
+
value: Double,
|
|
27
|
+
) {
|
|
28
|
+
view?.setContentInsetBottom(value)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
package com.reactnativekeyboardcontroller.managers
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
4
|
+
import com.reactnativekeyboardcontroller.views.ClippingScrollViewDecoratorView
|
|
5
|
+
|
|
6
|
+
class ClippingScrollViewDecoratorViewManagerImpl {
|
|
7
|
+
fun createViewInstance(reactContext: ThemedReactContext): ClippingScrollViewDecoratorView =
|
|
8
|
+
ClippingScrollViewDecoratorView(reactContext)
|
|
9
|
+
|
|
10
|
+
companion object {
|
|
11
|
+
const val NAME = "ClippingScrollViewDecoratorView"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
package com.reactnativekeyboardcontroller.views
|
|
2
|
+
|
|
3
|
+
import android.annotation.SuppressLint
|
|
4
|
+
import android.widget.ScrollView
|
|
5
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
6
|
+
import com.facebook.react.views.view.ReactViewGroup
|
|
7
|
+
import com.reactnativekeyboardcontroller.extensions.px
|
|
8
|
+
|
|
9
|
+
@SuppressLint("ViewConstructor")
|
|
10
|
+
class ClippingScrollViewDecoratorView(
|
|
11
|
+
val reactContext: ThemedReactContext,
|
|
12
|
+
) : ReactViewGroup(reactContext) {
|
|
13
|
+
private var insetBottom = 0.0
|
|
14
|
+
|
|
15
|
+
override fun onAttachedToWindow() {
|
|
16
|
+
super.onAttachedToWindow()
|
|
17
|
+
|
|
18
|
+
decorateScrollView()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
fun setContentInsetBottom(value: Double) {
|
|
22
|
+
insetBottom = value
|
|
23
|
+
decorateScrollView()
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
private fun decorateScrollView() {
|
|
27
|
+
val scrollView = getChildAt(0) as? ScrollView ?: return
|
|
28
|
+
|
|
29
|
+
scrollView.clipToPadding = false
|
|
30
|
+
scrollView.setPadding(
|
|
31
|
+
scrollView.paddingLeft,
|
|
32
|
+
scrollView.paddingTop,
|
|
33
|
+
scrollView.paddingRight,
|
|
34
|
+
insetBottom.toFloat().px.toInt(),
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package java.com.reactnativekeyboardcontroller
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
4
|
+
import com.facebook.react.uimanager.ViewGroupManager
|
|
5
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
6
|
+
import com.reactnativekeyboardcontroller.managers.ClippingScrollViewDecoratorViewManagerImpl
|
|
7
|
+
import com.reactnativekeyboardcontroller.views.ClippingScrollViewDecoratorView
|
|
8
|
+
|
|
9
|
+
class ClippingScrollViewDecoratorViewManager : ViewGroupManager<ClippingScrollViewDecoratorView>() {
|
|
10
|
+
private val manager = ClippingScrollViewDecoratorViewManagerImpl()
|
|
11
|
+
|
|
12
|
+
override fun getName(): String = ClippingScrollViewDecoratorViewManagerImpl.NAME
|
|
13
|
+
|
|
14
|
+
override fun createViewInstance(reactContext: ThemedReactContext): ClippingScrollViewDecoratorView =
|
|
15
|
+
manager.createViewInstance(reactContext)
|
|
16
|
+
|
|
17
|
+
@ReactProp(name = "contentInsetBottom")
|
|
18
|
+
fun setContentInsetBottom(
|
|
19
|
+
view: ClippingScrollViewDecoratorView,
|
|
20
|
+
value: Double,
|
|
21
|
+
) {
|
|
22
|
+
view.setContentInsetBottom(value)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>SchemeUserState</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>KeyboardController.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>0</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
</dict>
|
|
13
|
+
</dict>
|
|
14
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>SchemeUserState</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>Tests.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>0</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
</dict>
|
|
13
|
+
<key>SuppressBuildableAutocreation</key>
|
|
14
|
+
<dict>
|
|
15
|
+
<key>083F2DF22B860D89004A1AD1</key>
|
|
16
|
+
<dict>
|
|
17
|
+
<key>primary</key>
|
|
18
|
+
<true/>
|
|
19
|
+
</dict>
|
|
20
|
+
<key>083F2E022B860D8C004A1AD1</key>
|
|
21
|
+
<dict>
|
|
22
|
+
<key>primary</key>
|
|
23
|
+
<true/>
|
|
24
|
+
</dict>
|
|
25
|
+
<key>083F2E0C2B860D8C004A1AD1</key>
|
|
26
|
+
<dict>
|
|
27
|
+
<key>primary</key>
|
|
28
|
+
<true/>
|
|
29
|
+
</dict>
|
|
30
|
+
</dict>
|
|
31
|
+
</dict>
|
|
32
|
+
</plist>
|
|
@@ -26,7 +26,7 @@ public class KeyboardAnimation: KeyboardAnimationProtocol {
|
|
|
26
26
|
let duration: Double
|
|
27
27
|
let speed: Double
|
|
28
28
|
let timestamp: CFTimeInterval
|
|
29
|
-
|
|
29
|
+
/// internal state
|
|
30
30
|
var lastValue: Double
|
|
31
31
|
|
|
32
32
|
init(fromValue: Double, toValue: Double, animation: CAMediaTiming, duration: Double) {
|
|
@@ -39,7 +39,7 @@ public class KeyboardAnimation: KeyboardAnimationProtocol {
|
|
|
39
39
|
timestamp = CACurrentMediaTime()
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
/// public getters
|
|
43
43
|
var startTime: CFTimeInterval {
|
|
44
44
|
// when concurrent animation happens, then `.beginTime` remains the same
|
|
45
45
|
return max(animation?.beginTime ?? timestamp, timestamp)
|
|
@@ -60,7 +60,7 @@ public final class SpringAnimation: KeyboardAnimation {
|
|
|
60
60
|
super.init(fromValue: fromValue, toValue: toValue, animation: animation, duration: animation.settlingDuration)
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
/// public functions
|
|
64
64
|
override func valueAt(time: Double) -> Double {
|
|
65
65
|
let t = time * speed
|
|
66
66
|
|
|
@@ -51,7 +51,7 @@ class KCTextInputCompositeDelegate: NSObject, UITextViewDelegate, UITextFieldDel
|
|
|
51
51
|
weak var textViewDelegate: UITextViewDelegate?
|
|
52
52
|
weak var textFieldDelegate: UITextFieldDelegate?
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
/// Keep track of which textField we’re observing (iOS < 13 only)
|
|
55
55
|
private weak var observedTextFieldForSelection: UITextField?
|
|
56
56
|
|
|
57
57
|
init(
|
|
@@ -111,7 +111,7 @@ class KCTextInputCompositeDelegate: NSObject, UITextViewDelegate, UITextFieldDel
|
|
|
111
111
|
return true
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
/// Getter for the active delegate
|
|
115
115
|
var activeDelegate: AnyObject? {
|
|
116
116
|
return textViewDelegate ?? textFieldDelegate
|
|
117
117
|
}
|
|
@@ -16,8 +16,6 @@ public extension CGFloat {
|
|
|
16
16
|
let outputMax = outputRange.max() ?? 1
|
|
17
17
|
|
|
18
18
|
let normalizedValue = (currentValue - inputMin) / (inputMax - inputMin)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return interpolatedValue
|
|
19
|
+
return outputMin + (outputMax - outputMin) * normalizedValue
|
|
22
20
|
}
|
|
23
21
|
}
|
|
@@ -55,7 +55,8 @@ class KeyboardAreaExtender: NSObject {
|
|
|
55
55
|
let responder = UIResponder.current
|
|
56
56
|
if let activeTextInput = responder as? TextInput,
|
|
57
57
|
let offset = KeyboardOffsetProvider.shared.getOffset(
|
|
58
|
-
forTextInputNativeID: responder.nativeID
|
|
58
|
+
forTextInputNativeID: responder.nativeID
|
|
59
|
+
),
|
|
59
60
|
responder?.inputAccessoryView == nil
|
|
60
61
|
{
|
|
61
62
|
currentInputAccessoryView = InvisibleInputAccessoryView(height: CGFloat(truncating: offset))
|
|
@@ -32,7 +32,7 @@ public class FocusedInputObserver: NSObject {
|
|
|
32
32
|
var onFocusDidSet: (NSDictionary) -> Void
|
|
33
33
|
/// delegates
|
|
34
34
|
var delegate: KCTextInputCompositeDelegate
|
|
35
|
-
|
|
35
|
+
/// state variables
|
|
36
36
|
private var isMounted = false
|
|
37
37
|
// input tracking
|
|
38
38
|
private var currentInput: UIView?
|
|
@@ -142,7 +142,9 @@ public class FocusedInputObserver: NSObject {
|
|
|
142
142
|
setupObservers()
|
|
143
143
|
// dispatch onSelectionChange on focus
|
|
144
144
|
if let textInput = responder as? UITextInput {
|
|
145
|
-
|
|
145
|
+
DispatchQueue.main.async {
|
|
146
|
+
updateSelectionPosition(textInput: textInput, sendEvent: self.onSelectionChange)
|
|
147
|
+
}
|
|
146
148
|
}
|
|
147
149
|
|
|
148
150
|
syncUpLayout()
|
|
@@ -12,7 +12,10 @@ import UIKit
|
|
|
12
12
|
* and uses `keyboardLayoutGuide` on iOS 26+.
|
|
13
13
|
*/
|
|
14
14
|
public final class KeyboardTrackingView: UIView {
|
|
15
|
-
private var keyboardView: UIView? {
|
|
15
|
+
private var keyboardView: UIView? {
|
|
16
|
+
KeyboardViewLocator.shared.resolve()
|
|
17
|
+
}
|
|
18
|
+
|
|
16
19
|
private var keyboardHeight = 0.0
|
|
17
20
|
private weak var currentAttachedView: UIView?
|
|
18
21
|
private var isAttaching = false
|
|
@@ -15,7 +15,7 @@ public protocol TextInput: UIView {
|
|
|
15
15
|
var inputView: UIView? { get set }
|
|
16
16
|
var keyboardType: UIKeyboardType { get }
|
|
17
17
|
var keyboardAppearance: UIKeyboardAppearance { get }
|
|
18
|
-
|
|
18
|
+
/// custom methods/properties
|
|
19
19
|
func focus()
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -94,8 +94,7 @@ extension UIResponder {
|
|
|
94
94
|
let castOriginalResignFirstResponder = unsafeBitCast(
|
|
95
95
|
originalResignFirstResponder, to: Function.self
|
|
96
96
|
)
|
|
97
|
-
|
|
98
|
-
return result
|
|
97
|
+
return castOriginalResignFirstResponder(self, selector)
|
|
99
98
|
}
|
|
100
99
|
|
|
101
100
|
private func callOriginalBecomeFirstResponder(_ selector: Selector) -> Bool {
|
|
@@ -104,7 +103,6 @@ extension UIResponder {
|
|
|
104
103
|
let castOriginalBecomeFirstResponder = unsafeBitCast(
|
|
105
104
|
originalBecomeFirstResponder, to: Function.self
|
|
106
105
|
)
|
|
107
|
-
|
|
108
|
-
return result
|
|
106
|
+
return castOriginalBecomeFirstResponder(self, selector)
|
|
109
107
|
}
|
|
110
108
|
}
|
|
@@ -11,10 +11,10 @@ import Foundation
|
|
|
11
11
|
class FocusedInputHolder {
|
|
12
12
|
static let shared = FocusedInputHolder()
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
/// Using TextInput protocol as the type for currentFocusedInput
|
|
15
15
|
private weak var currentFocusedInput: TextInput?
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/// Sets the currentFocusedInput to the passed instance conforming to TextInput or clears it if nil is passed
|
|
18
18
|
func set(_ input: TextInput?) {
|
|
19
19
|
currentFocusedInput = input
|
|
20
20
|
}
|
|
@@ -23,7 +23,7 @@ class FocusedInputHolder {
|
|
|
23
23
|
return currentFocusedInput
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
/// Requests focus for the currentFocusedInput if it's set
|
|
27
27
|
func focus() {
|
|
28
28
|
currentFocusedInput?.focus()
|
|
29
29
|
}
|
|
@@ -13,7 +13,7 @@ enum KeyboardView {
|
|
|
13
13
|
private static let windowPrefix = "<UITextEffectsWindow"
|
|
14
14
|
private static let containerPrefixes = ["<UIInputSetContainerView", "<UITrackingWindowView"]
|
|
15
15
|
private static let hostPrefixes = ["<UIInputSetHostView", "<UIKeyboardItemContainerView"]
|
|
16
|
-
|
|
16
|
+
/// inspired by https://stackoverflow.com/questions/32598490/show-uiview-with-buttons-over-keyboard-like-in-skype-viber-messengers-swift-i
|
|
17
17
|
static func find() -> UIView? {
|
|
18
18
|
let windows = UIApplication.shared.windows
|
|
19
19
|
for window in windows {
|
|
@@ -36,7 +36,7 @@ public class ViewHierarchyNavigator: NSObject {
|
|
|
36
36
|
return []
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
/// Helper function to recursively search for TextInput views
|
|
40
40
|
func findTextInputs(in view: UIView?) {
|
|
41
41
|
guard let view = view else { return }
|
|
42
42
|
|
|
@@ -104,7 +104,7 @@ public class ViewHierarchyNavigator: NSObject {
|
|
|
104
104
|
return nil // No valid UITextField or UITextView found
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
/// Function to check if the view is a valid text field or text view
|
|
108
108
|
private static func isValidTextInput(_ view: UIView) -> TextInput? {
|
|
109
109
|
if let textField = view as? UITextField, textField.isEnabled {
|
|
110
110
|
return textField
|
|
@@ -27,7 +27,7 @@ class KeyboardControllerView: UIView {
|
|
|
27
27
|
var inputObserver: FocusedInputObserver?
|
|
28
28
|
private var eventDispatcher: RCTEventDispatcherProtocol
|
|
29
29
|
private var bridge: RCTBridge
|
|
30
|
-
|
|
30
|
+
/// internal state
|
|
31
31
|
private var lastScreenSize: CGSize = .zero
|
|
32
32
|
// react callbacks
|
|
33
33
|
/// keyboard
|
|
@@ -39,7 +39,7 @@ class KeyboardControllerView: UIView {
|
|
|
39
39
|
@objc var onFocusedInputLayoutChanged: RCTDirectEventBlock?
|
|
40
40
|
@objc var onFocusedInputTextChanged: RCTDirectEventBlock?
|
|
41
41
|
@objc var onFocusedInputSelectionChanged: RCTDirectEventBlock?
|
|
42
|
-
|
|
42
|
+
/// react props
|
|
43
43
|
@objc var enabled: ObjCBool = true {
|
|
44
44
|
didSet {
|
|
45
45
|
if enabled.boolValue {
|
|
@@ -83,9 +83,9 @@ class KeyboardControllerView: UIView {
|
|
|
83
83
|
fatalError("init(coder:) has not been implemented")
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
/// for mounting/unmounting observers for lifecycle events we're using willMove(toSuperview) method
|
|
87
|
+
/// not willMove(toWindow)
|
|
88
|
+
/// see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/271
|
|
89
89
|
override func willMove(toSuperview newSuperview: UIView?) {
|
|
90
90
|
super.willMove(toSuperview: newSuperview)
|
|
91
91
|
|
package/lib/commonjs/bindings.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.WindowDimensionsEvents = exports.RCTOverKeyboardView = exports.RCTKeyboardExtender = exports.KeyboardGestureArea = exports.KeyboardEvents = exports.KeyboardControllerViewCommands = exports.KeyboardControllerView = exports.KeyboardControllerNative = exports.KeyboardBackgroundView = exports.FocusedInputEvents = void 0;
|
|
6
|
+
exports.WindowDimensionsEvents = exports.RCTOverKeyboardView = exports.RCTKeyboardExtender = exports.KeyboardGestureArea = exports.KeyboardEvents = exports.KeyboardControllerViewCommands = exports.KeyboardControllerView = exports.KeyboardControllerNative = exports.KeyboardBackgroundView = exports.FocusedInputEvents = exports.ClippingScrollView = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
const NOOP = () => {};
|
|
9
9
|
const KeyboardControllerNative = exports.KeyboardControllerNative = {
|
|
@@ -72,4 +72,10 @@ const KeyboardBackgroundView = exports.KeyboardBackgroundView = _reactNative.Vie
|
|
|
72
72
|
* @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-extender|Documentation} page for more details.
|
|
73
73
|
*/
|
|
74
74
|
const RCTKeyboardExtender = exports.RCTKeyboardExtender = _reactNative.View;
|
|
75
|
+
/**
|
|
76
|
+
* A decorator that will clip the content of the `ScrollView`. It helps to simulate `contentInset` behavior on Android.
|
|
77
|
+
* Supports only `bottom` property (`paddingBottom` is not supported property of `ScrollView.style`).
|
|
78
|
+
* Using this component we can modify bottom inset without having a fake view.
|
|
79
|
+
*/
|
|
80
|
+
const ClippingScrollView = exports.ClippingScrollView = _reactNative.View;
|
|
75
81
|
//# sourceMappingURL=bindings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","NOOP","KeyboardControllerNative","exports","setDefaultMode","setInputMode","preload","dismiss","setFocusTo","addListener","removeListeners","KeyboardEvents","remove","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","View","KeyboardControllerViewCommands","synchronizeFocusedInputLayout","_ref","KeyboardGestureArea","RCTOverKeyboardView","KeyboardBackgroundView","RCTKeyboardExtender"],"sources":["bindings.ts"],"sourcesContent":["import { View } from \"react-native\";\n\nimport type {\n FocusedInputEventsModule,\n KeyboardBackgroundViewProps,\n KeyboardControllerNativeModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardExtenderProps,\n KeyboardGestureAreaProps,\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 addListener: NOOP,\n removeListeners: NOOP,\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"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","NOOP","KeyboardControllerNative","exports","setDefaultMode","setInputMode","preload","dismiss","setFocusTo","addListener","removeListeners","KeyboardEvents","remove","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","View","KeyboardControllerViewCommands","synchronizeFocusedInputLayout","_ref","KeyboardGestureArea","RCTOverKeyboardView","KeyboardBackgroundView","RCTKeyboardExtender","ClippingScrollView"],"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 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 addListener: NOOP,\n removeListeners: NOOP,\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 */\nexport const ClippingScrollView =\n View as unknown as React.FC<ClippingScrollViewProps>;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAgBA,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,OAAO,EAAEN,IAAI;EACbO,UAAU,EAAEP,IAAI;EAChBQ,WAAW,EAAER,IAAI;EACjBS,eAAe,EAAET;AACnB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMU,cAAoC,GAAAR,OAAA,CAAAQ,cAAA,GAAG;EAClDF,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAEX;EAAK,CAAC;AACtC,CAAC;AACD;AACA;AACA;AACA;AACO,MAAMY,kBAA4C,GAAAV,OAAA,CAAAU,kBAAA,GAAG;EAC1DJ,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAEX;EAAK,CAAC;AACtC,CAAC;AACM,MAAMa,sBAAoD,GAAAX,OAAA,CAAAW,sBAAA,GAAG;EAClEL,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAEX;EAAK,CAAC;AACtC,CAAC;AACD;AACA;AACA;AACA;AACA;AACO,MAAMc,sBAAsB,GAAAZ,OAAA,CAAAY,sBAAA,GACjCC,iBAAoD;AAC/C,MAAMC,8BAA8B,GAAAd,OAAA,CAAAc,8BAAA,GAAG;EAC5CC,6BAA6B,EAC3BC,IAAqD,IAClD,CAAC;AACR,CAAC;AACD;AACA;AACA;AACA;AACA;AACO,MAAMC,mBAAmB,GAAAjB,OAAA,CAAAiB,mBAAA,GAC9BJ,iBAAqD;AAChD,MAAMK,mBAAmB,GAAAlB,OAAA,CAAAkB,mBAAA,GAC9BL,iBAAkD;AACpD;AACA;AACA;AACA;AACA;AACO,MAAMM,sBAAsB,GAAAnB,OAAA,CAAAmB,sBAAA,GACjCN,iBAAwD;AAC1D;AACA;AACA;AACA;AACA;AACA;AACO,MAAMO,mBAAmB,GAAApB,OAAA,CAAAoB,mBAAA,GAC9BP,iBAAkD;AACpD;AACA;AACA;AACA;AACA;AACO,MAAMQ,kBAAkB,GAAArB,OAAA,CAAAqB,kBAAA,GAC7BR,iBAAoD","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.WindowDimensionsEvents = exports.RCTOverKeyboardView = exports.RCTKeyboardExtender = exports.KeyboardGestureArea = exports.KeyboardEvents = exports.KeyboardControllerViewCommands = exports.KeyboardControllerView = exports.KeyboardControllerNative = exports.KeyboardBackgroundView = exports.FocusedInputEvents = void 0;
|
|
6
|
+
exports.WindowDimensionsEvents = exports.RCTOverKeyboardView = exports.RCTKeyboardExtender = exports.KeyboardGestureArea = exports.KeyboardEvents = exports.KeyboardControllerViewCommands = exports.KeyboardControllerView = exports.KeyboardControllerNative = exports.KeyboardBackgroundView = exports.FocusedInputEvents = exports.ClippingScrollView = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
const LINKING_ERROR = `The package 'react-native-keyboard-controller' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
9
9
|
ios: "- You have run 'pod install'\n",
|
|
@@ -42,4 +42,7 @@ const KeyboardBackgroundView = exports.KeyboardBackgroundView = require("./specs
|
|
|
42
42
|
const RCTKeyboardExtender = exports.RCTKeyboardExtender = _reactNative.Platform.OS === "ios" ? require("./specs/KeyboardExtenderNativeComponent").default : ({
|
|
43
43
|
children
|
|
44
44
|
}) => children;
|
|
45
|
+
const ClippingScrollView = exports.ClippingScrollView = _reactNative.Platform.OS === "android" ? require("./specs/ClippingScrollViewDecoratorViewNativeComponent").default : ({
|
|
46
|
+
children
|
|
47
|
+
}) => children;
|
|
45
48
|
//# sourceMappingURL=bindings.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","KeyboardControllerViewNativeComponentModule","RCTKeyboardController","KeyboardControllerNative","exports","Proxy","get","Error","KEYBOARD_CONTROLLER_NAMESPACE","eventEmitter","NativeEventEmitter","KeyboardEvents","addListener","name","cb","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","KeyboardControllerViewCommands","Commands","KeyboardGestureArea","OS","Version","children","RCTOverKeyboardView","KeyboardBackgroundView","RCTKeyboardExtender"],"sources":["bindings.native.ts"],"sourcesContent":["import { NativeEventEmitter, Platform } from \"react-native\";\n\nimport type {\n FocusedInputEventsModule,\n KeyboardBackgroundViewProps,\n KeyboardControllerNativeModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardExtenderProps,\n KeyboardGestureAreaProps,\n OverKeyboardViewProps,\n WindowDimensionsEventsModule,\n} from \"./types\";\n\nconst LINKING_ERROR =\n `The package 'react-native-keyboard-controller' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: \"\" }) +\n \"- You rebuilt the app after installing the package\\n\" +\n \"- You are not using Expo Go\\n\";\n\nconst KeyboardControllerViewNativeComponentModule = require(\"./specs/KeyboardControllerViewNativeComponent\");\nconst RCTKeyboardController =\n require(\"./specs/NativeKeyboardController\").default;\n\nexport const KeyboardControllerNative = (\n RCTKeyboardController\n ? RCTKeyboardController\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n },\n )\n) as KeyboardControllerNativeModule;\n\nconst KEYBOARD_CONTROLLER_NAMESPACE = \"KeyboardController::\";\nconst eventEmitter = new NativeEventEmitter(KeyboardControllerNative);\n\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: (name, cb) =>\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\n};\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: (name, cb) =>\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\n};\nexport const WindowDimensionsEvents: WindowDimensionsEventsModule = {\n addListener: (name, cb) =>\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\n};\nexport const KeyboardControllerView: React.FC<KeyboardControllerProps> =\n KeyboardControllerViewNativeComponentModule.default;\nexport const KeyboardControllerViewCommands =\n KeyboardControllerViewNativeComponentModule.Commands;\nexport const KeyboardGestureArea: React.FC<KeyboardGestureAreaProps> =\n (Platform.OS === \"android\" && Platform.Version >= 30) || Platform.OS === \"ios\"\n ? require(\"./specs/KeyboardGestureAreaNativeComponent\").default\n : ({ children }: KeyboardGestureAreaProps) => children;\nexport const RCTOverKeyboardView: React.FC<OverKeyboardViewProps> =\n require(\"./specs/OverKeyboardViewNativeComponent\").default;\nexport const KeyboardBackgroundView: React.FC<KeyboardBackgroundViewProps> =\n require(\"./specs/KeyboardBackgroundViewNativeComponent\").default;\nexport const RCTKeyboardExtender: React.FC<KeyboardExtenderProps> =\n Platform.OS === \"ios\"\n ? require(\"./specs/KeyboardExtenderNativeComponent\").default\n : ({ children }: KeyboardExtenderProps) => children;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","KeyboardControllerViewNativeComponentModule","RCTKeyboardController","KeyboardControllerNative","exports","Proxy","get","Error","KEYBOARD_CONTROLLER_NAMESPACE","eventEmitter","NativeEventEmitter","KeyboardEvents","addListener","name","cb","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","KeyboardControllerViewCommands","Commands","KeyboardGestureArea","OS","Version","children","RCTOverKeyboardView","KeyboardBackgroundView","RCTKeyboardExtender","ClippingScrollView"],"sources":["bindings.native.ts"],"sourcesContent":["import { NativeEventEmitter, Platform } from \"react-native\";\n\nimport type {\n ClippingScrollViewProps,\n FocusedInputEventsModule,\n KeyboardBackgroundViewProps,\n KeyboardControllerNativeModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardExtenderProps,\n KeyboardGestureAreaProps,\n OverKeyboardViewProps,\n WindowDimensionsEventsModule,\n} from \"./types\";\n\nconst LINKING_ERROR =\n `The package 'react-native-keyboard-controller' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: \"\" }) +\n \"- You rebuilt the app after installing the package\\n\" +\n \"- You are not using Expo Go\\n\";\n\nconst KeyboardControllerViewNativeComponentModule = require(\"./specs/KeyboardControllerViewNativeComponent\");\nconst RCTKeyboardController =\n require(\"./specs/NativeKeyboardController\").default;\n\nexport const KeyboardControllerNative = (\n RCTKeyboardController\n ? RCTKeyboardController\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n },\n )\n) as KeyboardControllerNativeModule;\n\nconst KEYBOARD_CONTROLLER_NAMESPACE = \"KeyboardController::\";\nconst eventEmitter = new NativeEventEmitter(KeyboardControllerNative);\n\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: (name, cb) =>\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\n};\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: (name, cb) =>\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\n};\nexport const WindowDimensionsEvents: WindowDimensionsEventsModule = {\n addListener: (name, cb) =>\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\n};\nexport const KeyboardControllerView: React.FC<KeyboardControllerProps> =\n KeyboardControllerViewNativeComponentModule.default;\nexport const KeyboardControllerViewCommands =\n KeyboardControllerViewNativeComponentModule.Commands;\nexport const KeyboardGestureArea: React.FC<KeyboardGestureAreaProps> =\n (Platform.OS === \"android\" && Platform.Version >= 30) || Platform.OS === \"ios\"\n ? require(\"./specs/KeyboardGestureAreaNativeComponent\").default\n : ({ children }: KeyboardGestureAreaProps) => children;\nexport const RCTOverKeyboardView: React.FC<OverKeyboardViewProps> =\n require(\"./specs/OverKeyboardViewNativeComponent\").default;\nexport const KeyboardBackgroundView: React.FC<KeyboardBackgroundViewProps> =\n require(\"./specs/KeyboardBackgroundViewNativeComponent\").default;\nexport const RCTKeyboardExtender: React.FC<KeyboardExtenderProps> =\n Platform.OS === \"ios\"\n ? require(\"./specs/KeyboardExtenderNativeComponent\").default\n : ({ children }: KeyboardExtenderProps) => children;\nexport const ClippingScrollView: React.FC<KeyboardBackgroundViewProps> =\n Platform.OS === \"android\"\n ? require(\"./specs/ClippingScrollViewDecoratorViewNativeComponent\").default\n : ({ children }: ClippingScrollViewProps) => children;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAeA,MAAMC,aAAa,GACjB,2FAA2F,GAC3FC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,2CAA2C,GAAGN,OAAO,CAAC,+CAA+C,CAAC;AAC5G,MAAMO,qBAAqB,GACzBP,OAAO,CAAC,kCAAkC,CAAC,CAACK,OAAO;AAE9C,MAAMG,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,GACnCD,qBAAqB,GACjBA,qBAAqB,GACrB,IAAIG,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACX,aAAa,CAAC;EAChC;AACF,CACF,CAC6B;AAEnC,MAAMY,6BAA6B,GAAG,sBAAsB;AAC5D,MAAMC,YAAY,GAAG,IAAIC,+BAAkB,CAACP,wBAAwB,CAAC;AAE9D,MAAMQ,cAAoC,GAAAP,OAAA,CAAAO,cAAA,GAAG;EAClDC,WAAW,EAAEA,CAACC,IAAI,EAAEC,EAAE,KACpBL,YAAY,CAACG,WAAW,CAACJ,6BAA6B,GAAGK,IAAI,EAAEC,EAAE;AACrE,CAAC;;AAED;AACA;AACA;AACA;AACO,MAAMC,kBAA4C,GAAAX,OAAA,CAAAW,kBAAA,GAAG;EAC1DH,WAAW,EAAEA,CAACC,IAAI,EAAEC,EAAE,KACpBL,YAAY,CAACG,WAAW,CAACJ,6BAA6B,GAAGK,IAAI,EAAEC,EAAE;AACrE,CAAC;AACM,MAAME,sBAAoD,GAAAZ,OAAA,CAAAY,sBAAA,GAAG;EAClEJ,WAAW,EAAEA,CAACC,IAAI,EAAEC,EAAE,KACpBL,YAAY,CAACG,WAAW,CAACJ,6BAA6B,GAAGK,IAAI,EAAEC,EAAE;AACrE,CAAC;AACM,MAAMG,sBAAyD,GAAAb,OAAA,CAAAa,sBAAA,GACpEhB,2CAA2C,CAACD,OAAO;AAC9C,MAAMkB,8BAA8B,GAAAd,OAAA,CAAAc,8BAAA,GACzCjB,2CAA2C,CAACkB,QAAQ;AAC/C,MAAMC,mBAAuD,GAAAhB,OAAA,CAAAgB,mBAAA,GACjEvB,qBAAQ,CAACwB,EAAE,KAAK,SAAS,IAAIxB,qBAAQ,CAACyB,OAAO,IAAI,EAAE,IAAKzB,qBAAQ,CAACwB,EAAE,KAAK,KAAK,GAC1E1B,OAAO,CAAC,4CAA4C,CAAC,CAACK,OAAO,GAC7D,CAAC;EAAEuB;AAAmC,CAAC,KAAKA,QAAQ;AACnD,MAAMC,mBAAoD,GAAApB,OAAA,CAAAoB,mBAAA,GAC/D7B,OAAO,CAAC,yCAAyC,CAAC,CAACK,OAAO;AACrD,MAAMyB,sBAA6D,GAAArB,OAAA,CAAAqB,sBAAA,GACxE9B,OAAO,CAAC,+CAA+C,CAAC,CAACK,OAAO;AAC3D,MAAM0B,mBAAoD,GAAAtB,OAAA,CAAAsB,mBAAA,GAC/D7B,qBAAQ,CAACwB,EAAE,KAAK,KAAK,GACjB1B,OAAO,CAAC,yCAAyC,CAAC,CAACK,OAAO,GAC1D,CAAC;EAAEuB;AAAgC,CAAC,KAAKA,QAAQ;AAChD,MAAMI,kBAAyD,GAAAvB,OAAA,CAAAuB,kBAAA,GACpE9B,qBAAQ,CAACwB,EAAE,KAAK,SAAS,GACrB1B,OAAO,CAAC,wDAAwD,CAAC,CAACK,OAAO,GACzE,CAAC;EAAEuB;AAAkC,CAAC,KAAKA,QAAQ","ignoreList":[]}
|