@react-native-ohos/react-native-keyboard-controller 1.16.6-rc.1 → 1.17.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.OpenSource +10 -10
- package/README.md +19 -19
- package/harmony/keyboard_controller/BuildProfile.ets +16 -16
- package/harmony/keyboard_controller/Index.ets +28 -7
- package/harmony/keyboard_controller/build-profile.json5 +31 -31
- package/harmony/keyboard_controller/hvigorfile.ts +6 -6
- package/harmony/keyboard_controller/obfuscation-rules.txt +17 -17
- package/harmony/keyboard_controller/oh-package-lock.json5 +19 -0
- package/harmony/keyboard_controller/oh-package.json5 +10 -10
- package/harmony/keyboard_controller/src/main/cpp/CMakeLists.txt +7 -7
- package/harmony/keyboard_controller/src/main/cpp/EventEmitters.cpp +95 -95
- package/harmony/keyboard_controller/src/main/cpp/EventEmitters.h +111 -90
- package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentDescriptor.h +94 -73
- package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.cpp +287 -171
- package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.h +103 -76
- package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewJSIBinder.h +65 -44
- package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentDescriptor.h +79 -58
- package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.cpp +107 -86
- package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.h +83 -62
- package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaJSIBinder.h +60 -39
- package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.cpp +46 -25
- package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.h +48 -27
- package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.cpp +45 -24
- package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.h +49 -28
- package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.cpp +186 -0
- package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.h +112 -0
- package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.cpp +64 -43
- package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.h +77 -56
- package/harmony/keyboard_controller/src/main/ets/Logger.ts +66 -45
- package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerPackage.ts +66 -45
- package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerTurboModule.ts +273 -238
- package/harmony/keyboard_controller/src/main/ets/RNStatusBarManagerCompatTurboModule.ts +119 -98
- package/harmony/keyboard_controller/src/main/ets/Type.ts +62 -41
- package/harmony/keyboard_controller/src/main/module.json5 +11 -11
- package/harmony/keyboard_controller/src/main/resources/base/element/string.json +8 -8
- package/harmony/keyboard_controller/src/main/resources/en_US/element/string.json +8 -8
- package/harmony/keyboard_controller/src/main/resources/zh_CN/element/string.json +8 -8
- package/harmony/keyboard_controller/ts.ts +29 -8
- package/harmony/keyboard_controller.har +0 -0
- package/lib/commonjs/animated.js +2 -2
- package/lib/commonjs/animated.js.map +1 -1
- package/lib/commonjs/bindings.js +3 -3
- package/lib/commonjs/bindings.js.map +1 -1
- package/lib/commonjs/bindings.native.js +3 -3
- package/lib/commonjs/bindings.native.js.map +1 -1
- package/lib/commonjs/components/KeyboardAvoidingView/hooks.js.map +1 -1
- package/lib/commonjs/components/KeyboardAvoidingView/index.js +3 -3
- package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js +39 -39
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +3 -3
- package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/utils.js.map +1 -1
- package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/colors.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/colors.native.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/index.js +3 -3
- package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/types.js.map +1 -1
- package/lib/commonjs/components/hooks/useColorScheme.js +1 -1
- package/lib/commonjs/components/hooks/useColorScheme.js.map +1 -1
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/context.js.map +1 -1
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useWindowDimensions/index.android.js.map +1 -1
- package/lib/commonjs/hooks/useWindowDimensions/index.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal.js +18 -18
- package/lib/commonjs/internal.js.map +1 -1
- package/lib/commonjs/module.js.map +1 -1
- package/lib/commonjs/monkey-patch.android.js +4 -4
- package/lib/commonjs/monkey-patch.android.js.map +1 -1
- package/lib/commonjs/monkey-patch.js.map +1 -1
- package/lib/commonjs/reanimated.js.map +1 -1
- package/lib/commonjs/reanimated.native.js.map +1 -1
- package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
- package/lib/commonjs/specs/NativeStatusBarManagerCompat.js.map +1 -1
- package/lib/commonjs/specs/OverKeyboardViewNativeComponent.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/views/OverKeyboardView/index.js.map +1 -1
- package/lib/commonjs/views/index.js.map +1 -1
- package/lib/module/animated.js +2 -2
- package/lib/module/animated.js.map +1 -1
- package/lib/module/bindings.js +3 -3
- package/lib/module/bindings.js.map +1 -1
- package/lib/module/bindings.native.js +3 -3
- package/lib/module/bindings.native.js.map +1 -1
- package/lib/module/components/KeyboardAvoidingView/hooks.js.map +1 -1
- package/lib/module/components/KeyboardAvoidingView/index.js +3 -3
- package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/index.js +39 -39
- package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +3 -3
- package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/utils.js.map +1 -1
- package/lib/module/components/KeyboardStickyView/index.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/Arrow.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/Button.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/colors.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/colors.native.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/index.js +3 -3
- package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/types.js.map +1 -1
- package/lib/module/components/hooks/useColorScheme.js +1 -1
- package/lib/module/components/hooks/useColorScheme.js.map +1 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/constants.js.map +1 -1
- package/lib/module/context.js.map +1 -1
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useWindowDimensions/index.android.js.map +1 -1
- package/lib/module/hooks/useWindowDimensions/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal.js +18 -18
- package/lib/module/internal.js.map +1 -1
- package/lib/module/module.js.map +1 -1
- package/lib/module/monkey-patch.android.js +4 -4
- package/lib/module/monkey-patch.android.js.map +1 -1
- package/lib/module/monkey-patch.js.map +1 -1
- package/lib/module/reanimated.js.map +1 -1
- package/lib/module/reanimated.native.js.map +1 -1
- package/lib/module/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
- package/lib/module/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
- package/lib/module/specs/NativeKeyboardController.js.map +1 -1
- package/lib/module/specs/NativeStatusBarManagerCompat.js.map +1 -1
- package/lib/module/specs/OverKeyboardViewNativeComponent.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/module/views/OverKeyboardView/index.js.map +1 -1
- package/lib/module/views/index.js.map +1 -1
- package/package.json +174 -173
- package/src/animated.tsx +255 -256
- package/src/bindings.native.ts +62 -62
- package/src/bindings.ts +42 -42
- package/src/components/KeyboardAvoidingView/hooks.ts +123 -123
- package/src/components/KeyboardAvoidingView/index.tsx +188 -188
- package/src/components/KeyboardAwareScrollView/index.tsx +389 -389
- package/src/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +133 -133
- package/src/components/KeyboardAwareScrollView/utils.ts +41 -41
- package/src/components/KeyboardStickyView/index.tsx +66 -66
- package/src/components/KeyboardToolbar/Arrow.tsx +80 -80
- package/src/components/KeyboardToolbar/Button.tsx +98 -98
- package/src/components/KeyboardToolbar/colors.native.ts +37 -37
- package/src/components/KeyboardToolbar/colors.ts +16 -16
- package/src/components/KeyboardToolbar/index.tsx +223 -223
- package/src/components/KeyboardToolbar/types.ts +40 -40
- package/src/components/hooks/useColorScheme.ts +6 -5
- package/src/components/index.ts +11 -11
- package/src/constants.ts +19 -19
- package/src/context.ts +68 -68
- package/src/hooks/index.ts +90 -90
- package/src/hooks/useWindowDimensions/index.android.ts +38 -38
- package/src/hooks/useWindowDimensions/index.ts +1 -1
- package/src/index.ts +23 -23
- package/src/internal.ts +84 -84
- package/src/module.ts +52 -52
- package/src/monkey-patch.android.ts +44 -44
- package/src/monkey-patch.ts +4 -4
- package/src/reanimated.native.ts +132 -132
- package/src/reanimated.ts +29 -29
- package/src/specs/KeyboardControllerViewNativeComponent.ts +71 -71
- package/src/specs/KeyboardGestureAreaNativeComponent.ts +20 -20
- package/src/specs/NativeKeyboardController.ts +19 -19
- package/src/specs/NativeStatusBarManagerCompat.ts +14 -14
- package/src/specs/OverKeyboardViewNativeComponent.ts +12 -12
- package/src/types.ts +243 -243
- package/src/utils.ts +1 -1
- package/src/views/OverKeyboardView/index.tsx +43 -43
- package/src/views/index.ts +1 -1
- package/react-native-keyboard-controller.podspec +0 -61
|
@@ -1,98 +1,119 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c)
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
async
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Logger.
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
this.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
let newSystemBarProperty: window.SystemBarProperties = {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* MIT License
|
|
6
|
+
*
|
|
7
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
* in the Software without restriction, including without limitation the rights
|
|
12
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
* furnished to do so, subject to the following conditions:
|
|
15
|
+
*
|
|
16
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
* copies or substantial portions of the Software.
|
|
18
|
+
*
|
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
* SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import { TurboModule } from "@rnoh/react-native-openharmony/ts";
|
|
29
|
+
import window from '@ohos.window';
|
|
30
|
+
import common from '@ohos.app.ability.common';
|
|
31
|
+
import { BusinessError } from '@kit.BasicServicesKit';
|
|
32
|
+
import Logger from './Logger';
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
interface StatusBarManagerCompatSpec {
|
|
36
|
+
getConstants(): {};
|
|
37
|
+
setHidden(hidden: boolean): void;
|
|
38
|
+
setColor(color: number, animated: boolean): void;
|
|
39
|
+
setTranslucent(translucent: boolean): void;
|
|
40
|
+
setStyle(style: string): void;
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
export class RNStatusBarManagerCompatTurboModule extends TurboModule implements StatusBarManagerCompatSpec{
|
|
44
|
+
private context: common.UIAbilityContext;
|
|
45
|
+
constructor(ctx) {
|
|
46
|
+
super(ctx);
|
|
47
|
+
this.context = this.ctx.uiAbilityContext;
|
|
48
|
+
}
|
|
49
|
+
private async setWindowSystemBarProperties(properties:window.SystemBarProperties){
|
|
50
|
+
let windowInstance: window.Window | undefined = undefined;
|
|
51
|
+
windowInstance = await window.getLastWindow(this.context);
|
|
52
|
+
let systemBarProperty = windowInstance.getWindowSystemBarProperties();
|
|
53
|
+
let newSystemBarProperty: window.SystemBarProperties = {
|
|
54
|
+
...systemBarProperty,
|
|
55
|
+
...properties
|
|
56
|
+
};
|
|
57
|
+
try {
|
|
58
|
+
let promise = windowInstance.setWindowSystemBarProperties(newSystemBarProperty);
|
|
59
|
+
promise.then(() => {
|
|
60
|
+
Logger.info('Succeeded in setting the system bar properties.');
|
|
61
|
+
}).catch((err: BusinessError) => {
|
|
62
|
+
Logger.error(`Failed to set the system bar properties. Cause code: ${err.code}, message: ${err.message}`);
|
|
63
|
+
});
|
|
64
|
+
} catch (exception) {
|
|
65
|
+
Logger.error(`Failed to set the system bar properties. Cause code: ${exception.code}, message: ${exception.message}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
readonly getConstants:()=>{};
|
|
69
|
+
// set mode
|
|
70
|
+
async setHidden(hidden: boolean): Promise<void> {
|
|
71
|
+
Logger.info("###turboModule setHidden");
|
|
72
|
+
let windowInstance: window.Window | undefined = undefined;
|
|
73
|
+
windowInstance = await window.getLastWindow(this.context);
|
|
74
|
+
let names: Array<'status' | 'navigation'> = ['navigation'];
|
|
75
|
+
hidden && names.push('status');
|
|
76
|
+
try {
|
|
77
|
+
let promise = windowInstance.setWindowSystemBarEnable(names);
|
|
78
|
+
promise.then(() => {
|
|
79
|
+
Logger.info('Succeeded in setting the system bar to be invisible.');
|
|
80
|
+
}).catch((err: BusinessError) => {
|
|
81
|
+
Logger.error(`Failed to set the system bar to be invisible. Cause code: ${err.code}, message: ${err.message}`);
|
|
82
|
+
});
|
|
83
|
+
} catch (exception) {
|
|
84
|
+
Logger.error(`Failed to set the system bar to be invisible. Cause code: ${exception.code}, message: ${exception.message}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async setColor(color: number, animated: boolean): Promise<void> {
|
|
89
|
+
Logger.info("###turboModule setColor");
|
|
90
|
+
let newSystemBarProperty: window.SystemBarProperties = {
|
|
91
|
+
statusBarColor: color.toString(),
|
|
92
|
+
enableStatusBarAnimation:animated
|
|
93
|
+
};
|
|
94
|
+
this.setWindowSystemBarProperties(newSystemBarProperty)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async setTranslucent(translucent: boolean): Promise<void> {
|
|
98
|
+
Logger.info("###turboModule setTranslucent");
|
|
99
|
+
let windowInstance: window.Window | undefined = undefined;
|
|
100
|
+
windowInstance = await window.getLastWindow(this.context);
|
|
101
|
+
let systemBarProperty = windowInstance.getWindowSystemBarProperties();
|
|
102
|
+
let newSystemBarProperty: window.SystemBarProperties = {
|
|
103
|
+
statusBarColor:translucent?'#00000000':systemBarProperty.statusBarColor,
|
|
104
|
+
};
|
|
105
|
+
this.setWindowSystemBarProperties(newSystemBarProperty)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
setStyle(style: 'dark-content'|'light-content'): void {
|
|
109
|
+
Logger.info("###turboModule setStyle");
|
|
110
|
+
let themeFlag= style == "dark-content"
|
|
111
|
+
let newSystemBarProperty: window.SystemBarProperties = {
|
|
112
|
+
statusBarContentColor:themeFlag?"#000000":"#ffffff",
|
|
113
|
+
};
|
|
114
|
+
this.setWindowSystemBarProperties(newSystemBarProperty)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
@@ -1,41 +1,62 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c)
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* MIT License
|
|
6
|
+
*
|
|
7
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
* in the Software without restriction, including without limitation the rights
|
|
12
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
* furnished to do so, subject to the following conditions:
|
|
15
|
+
*
|
|
16
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
* copies or substantial portions of the Software.
|
|
18
|
+
*
|
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
* SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
export enum KeyboardControllerEventName {
|
|
29
|
+
KEYBOARD_WILL_SHOW="KeyboardController::keyboardWillShow",
|
|
30
|
+
KEYBOARD_DID_SHOW="KeyboardController::keyboardDidShow",
|
|
31
|
+
KEYBOARD_WILL_HIDE="KeyboardController::keyboardWillHide",
|
|
32
|
+
KEYBOARD_DID_HIDE="KeyboardController::keyboardDidHide",
|
|
33
|
+
FOCUS_DID_SET="KeyboardController::focusDidSet"
|
|
34
|
+
}
|
|
35
|
+
export type KeyboardChangeResult = {
|
|
36
|
+
code:number;
|
|
37
|
+
message:string;
|
|
38
|
+
data:number | undefined
|
|
39
|
+
}
|
|
40
|
+
export type KeyboardEvent ={
|
|
41
|
+
height:number;
|
|
42
|
+
duration:number;
|
|
43
|
+
timestamp:number;
|
|
44
|
+
target:number;
|
|
45
|
+
}
|
|
46
|
+
export enum KeyboardStatusType {
|
|
47
|
+
HIDE = 0,
|
|
48
|
+
SHOW = 1
|
|
49
|
+
};
|
|
50
|
+
export type RawTouchPoint={
|
|
51
|
+
pointerId: number;
|
|
52
|
+
windowX: number;
|
|
53
|
+
windowY: number;
|
|
54
|
+
}
|
|
55
|
+
export type RawTouchEvent = {
|
|
56
|
+
action: number;
|
|
57
|
+
actionTouch: RawTouchPoint;
|
|
58
|
+
touchPoints: RawTouchPoint[];
|
|
59
|
+
sourceType: number;
|
|
60
|
+
timestamp: number;
|
|
61
|
+
rootTag:number;
|
|
62
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
{
|
|
2
|
-
"module": {
|
|
3
|
-
"name": "keyboard_controller",
|
|
4
|
-
"type": "har",
|
|
5
|
-
"deviceTypes": [
|
|
6
|
-
"default",
|
|
7
|
-
"tablet",
|
|
8
|
-
"2in1"
|
|
9
|
-
]
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"module": {
|
|
3
|
+
"name": "keyboard_controller",
|
|
4
|
+
"type": "har",
|
|
5
|
+
"deviceTypes": [
|
|
6
|
+
"default",
|
|
7
|
+
"tablet",
|
|
8
|
+
"2in1"
|
|
9
|
+
]
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"string": [
|
|
3
|
-
{
|
|
4
|
-
"name": "page_show",
|
|
5
|
-
"value": "page from package"
|
|
6
|
-
}
|
|
7
|
-
]
|
|
8
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"string": [
|
|
3
|
+
{
|
|
4
|
+
"name": "page_show",
|
|
5
|
+
"value": "page from package"
|
|
6
|
+
}
|
|
7
|
+
]
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"string": [
|
|
3
|
-
{
|
|
4
|
-
"name": "page_show",
|
|
5
|
-
"value": "page from package"
|
|
6
|
-
}
|
|
7
|
-
]
|
|
8
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"string": [
|
|
3
|
+
{
|
|
4
|
+
"name": "page_show",
|
|
5
|
+
"value": "page from package"
|
|
6
|
+
}
|
|
7
|
+
]
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"string": [
|
|
3
|
-
{
|
|
4
|
-
"name": "page_show",
|
|
5
|
-
"value": "page from package"
|
|
6
|
-
}
|
|
7
|
-
]
|
|
8
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"string": [
|
|
3
|
+
{
|
|
4
|
+
"name": "page_show",
|
|
5
|
+
"value": "page from package"
|
|
6
|
+
}
|
|
7
|
+
]
|
|
8
|
+
}
|
|
@@ -1,9 +1,30 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c)
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* MIT License
|
|
6
|
+
*
|
|
7
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
* in the Software without restriction, including without limitation the rights
|
|
12
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
* furnished to do so, subject to the following conditions:
|
|
15
|
+
*
|
|
16
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
* copies or substantial portions of the Software.
|
|
18
|
+
*
|
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
* SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
export * from './src/main/ets/RNKeyboardControllerPackage';
|
|
29
|
+
export * from './src/main/ets/RNKeyboardControllerTurboModule';
|
|
9
30
|
export * from './src/main/ets/RNStatusBarManagerCompatTurboModule';
|
|
Binary file
|
package/lib/commonjs/animated.js
CHANGED
|
@@ -30,7 +30,7 @@ const KeyboardProvider = ({
|
|
|
30
30
|
children,
|
|
31
31
|
statusBarTranslucent,
|
|
32
32
|
navigationBarTranslucent,
|
|
33
|
-
preserveEdgeToEdge
|
|
33
|
+
preserveEdgeToEdge,
|
|
34
34
|
enabled: initiallyEnabled = true
|
|
35
35
|
}) => {
|
|
36
36
|
// state
|
|
@@ -160,7 +160,7 @@ const KeyboardProvider = ({
|
|
|
160
160
|
statusBarTranslucent: statusBarTranslucent,
|
|
161
161
|
preserveEdgeToEdge: preserveEdgeToEdge,
|
|
162
162
|
style: styles.container
|
|
163
|
-
},
|
|
163
|
+
}, children), /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
164
164
|
// we are using this small hack, because if the component (where
|
|
165
165
|
// animated value has been used) is unmounted, then animation will
|
|
166
166
|
// stop receiving events (seems like it's react-native optimization).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_bindings","_context","_internal","_monkeyPatch","_reanimated","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","KeyboardControllerViewAnimated","Reanimated","createAnimatedComponent","Animated","KeyboardControllerView","styles","StyleSheet","create","container","flex","hidden","display","position","OS","Platform","KeyboardProvider","children","statusBarTranslucent","navigationBarTranslucent","preserveEdgeToEdge","enabled","initiallyEnabled","setEnabled","useState","progress","useAnimatedValue","height","progressSV","useSharedValue","heightSV","layout","setKeyboardHandlers","broadcastKeyboardEvents","useSharedHandlers","setInputHandlers","broadcastInputEvents","context","useMemo","animated","multiply","reanimated","style","transform","translateX","translateY","onKeyboardMove","event","nativeEvent","useNativeDriver","updateSharedValues","platforms","includes","value","keyboardHandler","useAnimatedKeyboardHandler","onKeyboardMoveStart","onKeyboardMoveEnd","onKeyboardMoveInteractive","inputLayoutHandler","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged","target","inputTextHandler","useFocusedInputTextHandler","onFocusedInputTextChanged","inputSelectionHandler","useFocusedInputSelectionHandler","onFocusedInputSelectionChanged","useEffect","applyMonkeyPatch","revertMonkeyPatch","createElement","KeyboardContext","Provider","onKeyboardMoveReanimated","undefined","onFocusedInputLayoutChangedReanimated","onFocusedInputTextChangedReanimated","onFocusedInputSelectionChangedReanimated","View","exports"],"sources":["animated.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { Animated, Platform, StyleSheet } from \"react-native\";\nimport Reanimated, { useSharedValue } from \"react-native-reanimated\";\n\nimport { KeyboardControllerView } from \"./bindings\";\nimport { KeyboardContext } from \"./context\";\nimport { useAnimatedValue, useSharedHandlers } from \"./internal\";\nimport { applyMonkeyPatch, revertMonkeyPatch } from \"./monkey-patch\";\nimport {\n useAnimatedKeyboardHandler,\n useFocusedInputLayoutHandler,\n useFocusedInputSelectionHandler,\n useFocusedInputTextHandler,\n} from \"./reanimated\";\n\nimport type { KeyboardAnimationContext } from \"./context\";\nimport type {\n FocusedInputHandler,\n FocusedInputLayoutChangedEvent,\n KeyboardControllerProps,\n KeyboardHandler,\n NativeEvent,\n} from \"./types\";\nimport type { ViewStyle } from \"react-native\";\n\nconst KeyboardControllerViewAnimated = Reanimated.createAnimatedComponent(\n Animated.createAnimatedComponent(\n KeyboardControllerView,\n ) as React.FC<KeyboardControllerProps>,\n);\n\ntype Styles = {\n container: ViewStyle;\n hidden: ViewStyle;\n};\n\nconst styles = StyleSheet.create<Styles>({\n container: {\n flex: 1,\n },\n hidden: {\n display: \"none\",\n position: \"absolute\",\n },\n});\n\ntype KeyboardProviderProps = {\n children: React.ReactNode;\n /**\n * Set the value to `true`, if you use translucent status bar on Android.\n * If you already control status bar translucency via `react-native-screens`\n * or `StatusBar` component from `react-native`, you can ignore it.\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/14\n * @platform android\n */\n statusBarTranslucent?: boolean;\n /**\n * Set the value to `true`, if you use translucent navigation bar on Android.\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/119\n * @platform android\n */\n navigationBarTranslucent?: boolean;\n /**\n * A boolean property indicating whether to keep edge-to-edge mode always enabled (even when you disable the module).\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/592\n * @platform android\n */\n preserveEdgeToEdge?: boolean;\n /**\n * A boolean prop indicating whether the module is enabled. It indicate only initial state,\n * i. e. if you try to change this prop after component mount it will not have any effect.\n * To change the property in runtime use `useKeyboardController` hook and `setEnabled` method.\n * Defaults to `true`.\n */\n enabled?: boolean;\n};\n\n// capture `Platform.OS` in separate variable to avoid deep workletization of entire RN package\n// see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/393 and https://github.com/kirillzyusko/react-native-keyboard-controller/issues/294 for more details\nconst OS = Platform.OS;\n\nexport const KeyboardProvider = ({\n children,\n statusBarTranslucent,\n navigationBarTranslucent,\n preserveEdgeToEdge = true,\n enabled: initiallyEnabled = true,\n}: KeyboardProviderProps) => {\n // state\n const [enabled, setEnabled] = useState(initiallyEnabled);\n // animated values\n const progress = useAnimatedValue(0);\n const height = useAnimatedValue(0);\n // shared values\n const progressSV = useSharedValue(0);\n const heightSV = useSharedValue(0);\n const layout = useSharedValue<FocusedInputLayoutChangedEvent | null>(null);\n const [setKeyboardHandlers, broadcastKeyboardEvents] =\n useSharedHandlers<KeyboardHandler>();\n const [setInputHandlers, broadcastInputEvents] =\n useSharedHandlers<FocusedInputHandler>();\n // memo\n const context = useMemo<KeyboardAnimationContext>(\n () => ({\n enabled,\n animated: { progress: progress, height: Animated.multiply(height,-1) },\n reanimated: { progress: progressSV, height: heightSV },\n layout,\n setKeyboardHandlers,\n setInputHandlers,\n setEnabled,\n }),\n [enabled],\n );\n const style = useMemo(\n () => [\n styles.hidden,\n { transform: [{ translateX: height }, { translateY: progress }] },\n ],\n [],\n );\n const onKeyboardMove = useMemo(\n () =>\n Animated.event(\n [\n {\n nativeEvent: {\n progress,\n height,\n },\n },\n ],\n { useNativeDriver:Platform.OS as string=='harmony'?false:true },\n ),\n [],\n );\n // handlers\n const updateSharedValues = (event: NativeEvent, platforms: string[]) => {\n \"worklet\";\n\n if (platforms.includes(OS)) {\n // eslint-disable-next-line react-compiler/react-compiler\n progressSV.value = event.progress;\n heightSV.value = -event.height;\n }\n };\n const keyboardHandler = useAnimatedKeyboardHandler(\n {\n onKeyboardMoveStart: (event: NativeEvent) => {\n \"worklet\";\n\n broadcastKeyboardEvents(\"onStart\", event);\n updateSharedValues(event, [\"ios\"]);\n },\n onKeyboardMove: (event: NativeEvent) => {\n \"worklet\";\n\n broadcastKeyboardEvents(\"onMove\", event);\n updateSharedValues(event, [\"android\"]);\n },\n onKeyboardMoveEnd: (event: NativeEvent) => {\n \"worklet\";\n broadcastKeyboardEvents(\"onEnd\", event);\n updateSharedValues(event, ['harmony']);\n },\n onKeyboardMoveInteractive: (event: NativeEvent) => {\n \"worklet\";\n\n updateSharedValues(event, [\"android\", \"ios\"]);\n broadcastKeyboardEvents(\"onInteractive\", event);\n },\n },\n [],\n );\n const inputLayoutHandler = useFocusedInputLayoutHandler(\n {\n onFocusedInputLayoutChanged: (e) => {\n \"worklet\";\n\n if (e.target !== -1) {\n layout.value = e;\n } else {\n layout.value = null;\n }\n },\n },\n [],\n );\n const inputTextHandler = useFocusedInputTextHandler(\n {\n onFocusedInputTextChanged: (e) => {\n \"worklet\";\n\n broadcastInputEvents(\"onChangeText\", e);\n },\n },\n [],\n );\n const inputSelectionHandler = useFocusedInputSelectionHandler(\n {\n onFocusedInputSelectionChanged: (e) => {\n \"worklet\";\n broadcastInputEvents(\"onSelectionChange\", e);\n },\n },\n [],\n );\n // effects\n useEffect(() => {\n if (enabled) {\n applyMonkeyPatch();\n } else {\n revertMonkeyPatch();\n }\n }, [enabled]);\n\n return (\n <KeyboardContext.Provider value={context}>\n <KeyboardControllerViewAnimated\n enabled={enabled}\n onKeyboardMoveReanimated={keyboardHandler}\n onKeyboardMoveStart={OS === \"ios\" ? onKeyboardMove : undefined}\n onKeyboardMove={OS === \"android\" ? onKeyboardMove : undefined}\n onKeyboardMoveInteractive={onKeyboardMove}\n onKeyboardMoveEnd={ OS as string === \"harmony\"?onKeyboardMove:undefined}\n onFocusedInputLayoutChangedReanimated={inputLayoutHandler}\n onFocusedInputTextChangedReanimated={inputTextHandler}\n onFocusedInputSelectionChangedReanimated={inputSelectionHandler}\n navigationBarTranslucent={navigationBarTranslucent}\n statusBarTranslucent={statusBarTranslucent}\n preserveEdgeToEdge={preserveEdgeToEdge}\n style={styles.container}\n >\n <Reanimated.View>{children}</Reanimated.View>\n {/* {children} */}\n </KeyboardControllerViewAnimated>\n <Animated.View\n // we are using this small hack, because if the component (where\n // animated value has been used) is unmounted, then animation will\n // stop receiving events (seems like it's react-native optimization).\n // So we need to keep a reference to the animated value, to keep it's\n // always mounted (keep a reference to an animated value).\n //\n // To test why it's needed, try to open screen which consumes Animated.Value\n // then close it and open it again (for example 'Animated transition').\n style={style}\n />\n </KeyboardContext.Provider>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAKsB,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,G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EAAEA;EAAM,CACd,CACuB,CAAC;AAE/B,CAAC;AAACuC,OAAA,CAAAjE,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_bindings","_context","_internal","_monkeyPatch","_reanimated","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","KeyboardControllerViewAnimated","Reanimated","createAnimatedComponent","Animated","KeyboardControllerView","styles","StyleSheet","create","container","flex","hidden","display","position","OS","Platform","KeyboardProvider","children","statusBarTranslucent","navigationBarTranslucent","preserveEdgeToEdge","enabled","initiallyEnabled","setEnabled","useState","progress","useAnimatedValue","height","progressSV","useSharedValue","heightSV","layout","setKeyboardHandlers","broadcastKeyboardEvents","useSharedHandlers","setInputHandlers","broadcastInputEvents","context","useMemo","animated","multiply","reanimated","style","transform","translateX","translateY","onKeyboardMove","event","nativeEvent","useNativeDriver","updateSharedValues","platforms","includes","value","keyboardHandler","useAnimatedKeyboardHandler","onKeyboardMoveStart","onKeyboardMoveEnd","onKeyboardMoveInteractive","inputLayoutHandler","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged","target","inputTextHandler","useFocusedInputTextHandler","onFocusedInputTextChanged","inputSelectionHandler","useFocusedInputSelectionHandler","onFocusedInputSelectionChanged","useEffect","applyMonkeyPatch","revertMonkeyPatch","createElement","KeyboardContext","Provider","onKeyboardMoveReanimated","undefined","onFocusedInputLayoutChangedReanimated","onFocusedInputTextChangedReanimated","onFocusedInputSelectionChangedReanimated","View","exports"],"sources":["animated.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\r\nimport { Animated, Platform, StyleSheet } from \"react-native\";\r\nimport Reanimated, { useSharedValue } from \"react-native-reanimated\";\r\n\r\nimport { KeyboardControllerView } from \"./bindings\";\r\nimport { KeyboardContext } from \"./context\";\r\nimport { useAnimatedValue, useSharedHandlers } from \"./internal\";\r\nimport { applyMonkeyPatch, revertMonkeyPatch } from \"./monkey-patch\";\r\nimport {\r\n useAnimatedKeyboardHandler,\r\n useFocusedInputLayoutHandler,\r\n useFocusedInputSelectionHandler,\r\n useFocusedInputTextHandler,\r\n} from \"./reanimated\";\r\n\r\nimport type { KeyboardAnimationContext } from \"./context\";\r\nimport type {\r\n FocusedInputHandler,\r\n FocusedInputLayoutChangedEvent,\r\n KeyboardControllerProps,\r\n KeyboardHandler,\r\n NativeEvent,\r\n} from \"./types\";\r\nimport type { ViewStyle } from \"react-native\";\r\n\r\nconst KeyboardControllerViewAnimated = Reanimated.createAnimatedComponent(\r\n Animated.createAnimatedComponent(\r\n KeyboardControllerView,\r\n ) as React.FC<KeyboardControllerProps>,\r\n);\r\n\r\ntype Styles = {\r\n container: ViewStyle;\r\n hidden: ViewStyle;\r\n};\r\n\r\nconst styles = StyleSheet.create<Styles>({\r\n container: {\r\n flex: 1,\r\n },\r\n hidden: {\r\n display: \"none\",\r\n position: \"absolute\",\r\n },\r\n});\r\n\r\ntype KeyboardProviderProps = {\r\n children: React.ReactNode;\r\n /**\r\n * Set the value to `true`, if you use translucent status bar on Android.\r\n * If you already control status bar translucency via `react-native-screens`\r\n * or `StatusBar` component from `react-native`, you can ignore it.\r\n * Defaults to `false`.\r\n *\r\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/14\r\n * @platform android\r\n */\r\n statusBarTranslucent?: boolean;\r\n /**\r\n * Set the value to `true`, if you use translucent navigation bar on Android.\r\n * Defaults to `false`.\r\n *\r\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/119\r\n * @platform android\r\n */\r\n navigationBarTranslucent?: boolean;\r\n /**\r\n * A boolean property indicating whether to keep edge-to-edge mode always enabled (even when you disable the module).\r\n * Defaults to `false`.\r\n *\r\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/592\r\n * @platform android\r\n */\r\n preserveEdgeToEdge?: boolean;\r\n /**\r\n * A boolean prop indicating whether the module is enabled. It indicate only initial state,\r\n * i. e. if you try to change this prop after component mount it will not have any effect.\r\n * To change the property in runtime use `useKeyboardController` hook and `setEnabled` method.\r\n * Defaults to `true`.\r\n */\r\n enabled?: boolean;\r\n};\r\n\r\n// capture `Platform.OS` in separate variable to avoid deep workletization of entire RN package\r\n// see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/393 and https://github.com/kirillzyusko/react-native-keyboard-controller/issues/294 for more details\r\nconst OS = Platform.OS;\r\n\r\nexport const KeyboardProvider = ({\r\n children,\r\n statusBarTranslucent,\r\n navigationBarTranslucent,\r\n preserveEdgeToEdge,\r\n enabled: initiallyEnabled = true,\r\n}: KeyboardProviderProps) => {\r\n // state\r\n const [enabled, setEnabled] = useState(initiallyEnabled);\r\n // animated values\r\n const progress = useAnimatedValue(0);\r\n const height = useAnimatedValue(0);\r\n // shared values\r\n const progressSV = useSharedValue(0);\r\n const heightSV = useSharedValue(0);\r\n const layout = useSharedValue<FocusedInputLayoutChangedEvent | null>(null);\r\n const [setKeyboardHandlers, broadcastKeyboardEvents] =\r\n useSharedHandlers<KeyboardHandler>();\r\n const [setInputHandlers, broadcastInputEvents] =\r\n useSharedHandlers<FocusedInputHandler>();\r\n // memo\r\n const context = useMemo<KeyboardAnimationContext>(\r\n () => ({\r\n enabled,\r\n animated: { progress: progress, height: Animated.multiply(height,-1) },\r\n reanimated: { progress: progressSV, height: heightSV },\r\n layout,\r\n setKeyboardHandlers,\r\n setInputHandlers,\r\n setEnabled,\r\n }),\r\n [enabled],\r\n );\r\n const style = useMemo(\r\n () => [\r\n styles.hidden,\r\n { transform: [{ translateX: height }, { translateY: progress }] },\r\n ],\r\n [],\r\n );\r\n const onKeyboardMove = useMemo(\r\n () =>\r\n Animated.event(\r\n [\r\n {\r\n nativeEvent: {\r\n progress,\r\n height,\r\n },\r\n },\r\n ],\r\n { useNativeDriver:Platform.OS as string=='harmony'?false:true },\r\n ),\r\n [],\r\n );\r\n // handlers\r\n const updateSharedValues = (event: NativeEvent, platforms: string[]) => {\r\n \"worklet\";\r\n\r\n if (platforms.includes(OS)) {\r\n // eslint-disable-next-line react-compiler/react-compiler\r\n progressSV.value = event.progress;\r\n heightSV.value = -event.height;\r\n }\r\n };\r\n const keyboardHandler = useAnimatedKeyboardHandler(\r\n {\r\n onKeyboardMoveStart: (event: NativeEvent) => {\r\n \"worklet\";\r\n\r\n broadcastKeyboardEvents(\"onStart\", event);\r\n updateSharedValues(event, [\"ios\"]);\r\n },\r\n onKeyboardMove: (event: NativeEvent) => {\r\n \"worklet\";\r\n\r\n broadcastKeyboardEvents(\"onMove\", event);\r\n updateSharedValues(event, [\"android\"]);\r\n },\r\n onKeyboardMoveEnd: (event: NativeEvent) => {\r\n \"worklet\";\r\n broadcastKeyboardEvents(\"onEnd\", event);\r\n updateSharedValues(event, ['harmony']);\r\n },\r\n onKeyboardMoveInteractive: (event: NativeEvent) => {\r\n \"worklet\";\r\n\r\n updateSharedValues(event, [\"android\", \"ios\"]);\r\n broadcastKeyboardEvents(\"onInteractive\", event);\r\n },\r\n },\r\n [],\r\n );\r\n const inputLayoutHandler = useFocusedInputLayoutHandler(\r\n {\r\n onFocusedInputLayoutChanged: (e) => {\r\n \"worklet\";\r\n\r\n if (e.target !== -1) {\r\n layout.value = e;\r\n } else {\r\n layout.value = null;\r\n }\r\n },\r\n },\r\n [],\r\n );\r\n const inputTextHandler = useFocusedInputTextHandler(\r\n {\r\n onFocusedInputTextChanged: (e) => {\r\n \"worklet\";\r\n\r\n broadcastInputEvents(\"onChangeText\", e);\r\n },\r\n },\r\n [],\r\n );\r\n const inputSelectionHandler = useFocusedInputSelectionHandler(\r\n {\r\n onFocusedInputSelectionChanged: (e) => {\r\n \"worklet\";\r\n broadcastInputEvents(\"onSelectionChange\", e);\r\n },\r\n },\r\n [],\r\n );\r\n // effects\r\n useEffect(() => {\r\n if (enabled) {\r\n applyMonkeyPatch();\r\n } else {\r\n revertMonkeyPatch();\r\n }\r\n }, [enabled]);\r\n\r\n return (\r\n <KeyboardContext.Provider value={context}>\r\n <KeyboardControllerViewAnimated\r\n enabled={enabled}\r\n onKeyboardMoveReanimated={keyboardHandler}\r\n onKeyboardMoveStart={OS === \"ios\" ? onKeyboardMove : undefined}\r\n onKeyboardMove={OS === \"android\" ? onKeyboardMove : undefined}\r\n onKeyboardMoveInteractive={onKeyboardMove}\r\n onKeyboardMoveEnd={ OS as string === \"harmony\"?onKeyboardMove:undefined}\r\n onFocusedInputLayoutChangedReanimated={inputLayoutHandler}\r\n onFocusedInputTextChangedReanimated={inputTextHandler}\r\n onFocusedInputSelectionChangedReanimated={inputSelectionHandler}\r\n navigationBarTranslucent={navigationBarTranslucent}\r\n statusBarTranslucent={statusBarTranslucent}\r\n preserveEdgeToEdge={preserveEdgeToEdge}\r\n style={styles.container}\r\n >\r\n {children}\r\n </KeyboardControllerViewAnimated>\r\n <Animated.View\r\n // we are using this small hack, because if the component (where\r\n // animated value has been used) is unmounted, then animation will\r\n // stop receiving events (seems like it's react-native optimization).\r\n // So we need to keep a reference to the animated value, to keep it's\r\n // always mounted (keep a reference to an animated value).\r\n //\r\n // To test why it's needed, try to open screen which consumes Animated.Value\r\n // then close it and open it again (for example 'Animated transition').\r\n style={style}\r\n />\r\n </KeyboardContext.Provider>\r\n );\r\n};\r\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAKsB,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,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AK,SAAS,GAAGgC,cAAc,GAAG8B,SAAU;IAC9DlB,yBAAyB,EAAEZ,cAAe;IAC1CW,iBAAiB,EAAG3C,EAAE,KAAe,SAAS,GAACgC,cAAc,GAAC8B,SAAU;IACxEC,qCAAqC,EAAElB,kBAAmB;IAC1DmB,mCAAmC,EAAEf,gBAAiB;IACtDgB,wCAAwC,EAAEb,qBAAsB;IAChE/C,wBAAwB,EAAEA,wBAAyB;IACnDD,oBAAoB,EAAEA,oBAAqB;IAC3CE,kBAAkB,EAAEA,kBAAmB;IACvCsB,KAAK,EAAEpC,MAAM,CAACG;EAAU,GAEvBQ,QAC6B,CAAC,eACjC7C,MAAA,CAAAoB,OAAA,CAAAgF,aAAA,CAACjG,YAAA,CAAA6B,QAAQ,CAAC4E,IAAI;IACZ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACAtC,KAAK,EAAEA;EAAM,CACd,CACuB,CAAC;AAE/B,CAAC;AAACuC,OAAA,CAAAjE,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
package/lib/commonjs/bindings.js
CHANGED
|
@@ -19,9 +19,9 @@ const KeyboardEvents = exports.KeyboardEvents = {
|
|
|
19
19
|
remove: NOOP
|
|
20
20
|
})
|
|
21
21
|
};
|
|
22
|
-
/**
|
|
23
|
-
* This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.
|
|
24
|
-
* Use it with cautious.
|
|
22
|
+
/**
|
|
23
|
+
* This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.
|
|
24
|
+
* Use it with cautious.
|
|
25
25
|
*/
|
|
26
26
|
const FocusedInputEvents = exports.FocusedInputEvents = {
|
|
27
27
|
addListener: () => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","NOOP","KeyboardControllerNative","exports","setDefaultMode","setInputMode","dismiss","setFocusTo","addListener","removeListeners","KeyboardEvents","remove","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","View","KeyboardGestureArea","RCTOverKeyboardView"],"sources":["bindings.ts"],"sourcesContent":["import { View } from \"react-native\";\n\nimport type {\n FocusedInputEventsModule,\n KeyboardControllerNativeModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\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 dismiss: NOOP,\n setFocusTo: NOOP,\n addListener: NOOP,\n removeListeners: NOOP,\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};\nexport const KeyboardControllerView =\n View as unknown as React.FC<KeyboardControllerProps>;\nexport const KeyboardGestureArea =\n View as unknown as React.FC<KeyboardGestureAreaProps>;\nexport const RCTOverKeyboardView =\n View as unknown as React.FC<OverKeyboardViewProps>;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAaA,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,UAAU,EAAEN,IAAI;EAChBO,WAAW,EAAEP,IAAI;EACjBQ,eAAe,EAAER;AACnB,CAAC;AACM,MAAMS,cAAoC,GAAAP,OAAA,CAAAO,cAAA,GAAG;EAClDF,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAEV;EAAK,CAAC;AACtC,CAAC;AACD;AACA;AACA;AACA;AACO,MAAMW,kBAA4C,GAAAT,OAAA,CAAAS,kBAAA,GAAG;EAC1DJ,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAEV;EAAK,CAAC;AACtC,CAAC;AACM,MAAMY,sBAAoD,GAAAV,OAAA,CAAAU,sBAAA,GAAG;EAClEL,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAEV;EAAK,CAAC;AACtC,CAAC;AACM,MAAMa,sBAAsB,GAAAX,OAAA,CAAAW,sBAAA,GACjCC,iBAAoD;AAC/C,MAAMC,mBAAmB,GAAAb,OAAA,CAAAa,mBAAA,GAC9BD,iBAAqD;AAChD,MAAME,mBAAmB,GAAAd,OAAA,CAAAc,mBAAA,GAC9BF,iBAAkD","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","NOOP","KeyboardControllerNative","exports","setDefaultMode","setInputMode","dismiss","setFocusTo","addListener","removeListeners","KeyboardEvents","remove","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","View","KeyboardGestureArea","RCTOverKeyboardView"],"sources":["bindings.ts"],"sourcesContent":["import { View } from \"react-native\";\r\n\r\nimport type {\r\n FocusedInputEventsModule,\r\n KeyboardControllerNativeModule,\r\n KeyboardControllerProps,\r\n KeyboardEventsModule,\r\n KeyboardGestureAreaProps,\r\n OverKeyboardViewProps,\r\n WindowDimensionsEventsModule,\r\n} from \"./types\";\r\nimport type { EmitterSubscription } from \"react-native\";\r\n\r\nconst NOOP = () => {};\r\n\r\nexport const KeyboardControllerNative: KeyboardControllerNativeModule = {\r\n setDefaultMode: NOOP,\r\n setInputMode: NOOP,\r\n dismiss: NOOP,\r\n setFocusTo: NOOP,\r\n addListener: NOOP,\r\n removeListeners: NOOP,\r\n};\r\nexport const KeyboardEvents: KeyboardEventsModule = {\r\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\r\n};\r\n/**\r\n * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.\r\n * Use it with cautious.\r\n */\r\nexport const FocusedInputEvents: FocusedInputEventsModule = {\r\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\r\n};\r\nexport const WindowDimensionsEvents: WindowDimensionsEventsModule = {\r\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\r\n};\r\nexport const KeyboardControllerView =\r\n View as unknown as React.FC<KeyboardControllerProps>;\r\nexport const KeyboardGestureArea =\r\n View as unknown as React.FC<KeyboardGestureAreaProps>;\r\nexport const RCTOverKeyboardView =\r\n View as unknown as React.FC<OverKeyboardViewProps>;\r\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAaA,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,UAAU,EAAEN,IAAI;EAChBO,WAAW,EAAEP,IAAI;EACjBQ,eAAe,EAAER;AACnB,CAAC;AACM,MAAMS,cAAoC,GAAAP,OAAA,CAAAO,cAAA,GAAG;EAClDF,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAEV;EAAK,CAAC;AACtC,CAAC;AACD;AACA;AACA;AACA;AACO,MAAMW,kBAA4C,GAAAT,OAAA,CAAAS,kBAAA,GAAG;EAC1DJ,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAEV;EAAK,CAAC;AACtC,CAAC;AACM,MAAMY,sBAAoD,GAAAV,OAAA,CAAAU,sBAAA,GAAG;EAClEL,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAEV;EAAK,CAAC;AACtC,CAAC;AACM,MAAMa,sBAAsB,GAAAX,OAAA,CAAAW,sBAAA,GACjCC,iBAAoD;AAC/C,MAAMC,mBAAmB,GAAAb,OAAA,CAAAa,mBAAA,GAC9BD,iBAAqD;AAChD,MAAME,mBAAmB,GAAAd,OAAA,CAAAc,mBAAA,GAC9BF,iBAAkD","ignoreList":[]}
|
|
@@ -21,9 +21,9 @@ const KeyboardEvents = exports.KeyboardEvents = {
|
|
|
21
21
|
addListener: (name, cb) => eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb)
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.
|
|
26
|
-
* Use it with cautious.
|
|
24
|
+
/**
|
|
25
|
+
* This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.
|
|
26
|
+
* Use it with cautious.
|
|
27
27
|
*/
|
|
28
28
|
const FocusedInputEvents = exports.FocusedInputEvents = {
|
|
29
29
|
addListener: (name, cb) => eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","RCTKeyboardController","KeyboardControllerNative","exports","Proxy","get","Error","KEYBOARD_CONTROLLER_NAMESPACE","eventEmitter","NativeEventEmitter","KeyboardEvents","addListener","name","cb","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","KeyboardGestureArea","OS","Version","children","RCTOverKeyboardView"],"sources":["bindings.native.ts"],"sourcesContent":["import { NativeEventEmitter, Platform } from \"react-native\";\n\nimport type {\n FocusedInputEventsModule,\n KeyboardControllerNativeModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\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 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 require(\"./specs/KeyboardControllerViewNativeComponent\").default;\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;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAYA,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,qBAAqB,GACzBN,OAAO,CAAC,kCAAkC,CA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AAAmC,CAAC,KAAKA,QAAQ;AACnD,MAAMC,mBAAoD,GAAAlB,OAAA,CAAAkB,mBAAA,GAC/D1B,OAAO,CAAC,yCAAyC,CAAC,CAACK,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","RCTKeyboardController","KeyboardControllerNative","exports","Proxy","get","Error","KEYBOARD_CONTROLLER_NAMESPACE","eventEmitter","NativeEventEmitter","KeyboardEvents","addListener","name","cb","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","KeyboardGestureArea","OS","Version","children","RCTOverKeyboardView"],"sources":["bindings.native.ts"],"sourcesContent":["import { NativeEventEmitter, Platform } from \"react-native\";\r\n\r\nimport type {\r\n FocusedInputEventsModule,\r\n KeyboardControllerNativeModule,\r\n KeyboardControllerProps,\r\n KeyboardEventsModule,\r\n KeyboardGestureAreaProps,\r\n OverKeyboardViewProps,\r\n WindowDimensionsEventsModule,\r\n} from \"./types\";\r\n\r\nconst LINKING_ERROR =\r\n `The package 'react-native-keyboard-controller' doesn't seem to be linked. Make sure: \\n\\n` +\r\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: \"\" }) +\r\n \"- You rebuilt the app after installing the package\\n\" +\r\n \"- You are not using Expo Go\\n\";\r\n\r\nconst RCTKeyboardController =\r\n require(\"./specs/NativeKeyboardController\").default;\r\n\r\nexport const KeyboardControllerNative = (\r\n RCTKeyboardController\r\n ? RCTKeyboardController\r\n : new Proxy(\r\n {},\r\n {\r\n get() {\r\n throw new Error(LINKING_ERROR);\r\n },\r\n },\r\n )\r\n) as KeyboardControllerNativeModule;\r\n\r\nconst KEYBOARD_CONTROLLER_NAMESPACE = \"KeyboardController::\";\r\nconst eventEmitter = new NativeEventEmitter(KeyboardControllerNative);\r\n\r\nexport const KeyboardEvents: KeyboardEventsModule = {\r\n addListener: (name, cb) =>\r\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\r\n};\r\n\r\n/**\r\n * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.\r\n * Use it with cautious.\r\n */\r\nexport const FocusedInputEvents: FocusedInputEventsModule = {\r\n addListener: (name, cb) =>\r\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\r\n};\r\nexport const WindowDimensionsEvents: WindowDimensionsEventsModule = {\r\n addListener: (name, cb) =>\r\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\r\n};\r\nexport const KeyboardControllerView: React.FC<KeyboardControllerProps> =\r\n require(\"./specs/KeyboardControllerViewNativeComponent\").default;\r\nexport const KeyboardGestureArea: React.FC<KeyboardGestureAreaProps> =\r\n (Platform.OS === \"android\" && Platform.Version >= 30) || Platform.OS === \"ios\"\r\n ? require(\"./specs/KeyboardGestureAreaNativeComponent\").default\r\n : ({ children }: KeyboardGestureAreaProps) => children;\r\nexport const RCTOverKeyboardView: React.FC<OverKeyboardViewProps> =\r\n require(\"./specs/OverKeyboardViewNativeComponent\").default;\r\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAYA,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,qBAAqB,GACzBN,OAAO,CAAC,kCAAkC,CAAC,CAACK,OAAO;AAE9C,MAAME,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,GACnCD,qBAAqB,GACjBA,qBAAqB,GACrB,IAAIG,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACV,aAAa,CAAC;EAChC;AACF,CACF,CAC6B;AAEnC,MAAMW,6BAA6B,GAAG,sBAAsB;AAC5D,MAAMC,YAAY,GAAG,IAAIC,+BAAkB,CAACP,wBAAwB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