react-native-keyboard-controller 1.0.0-alpha.1 → 1.0.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/README.md +4 -7
- package/android/build.gradle +1 -1
- package/android/gradle.properties +2 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/EdgeToEdgeReactViewGroup.kt +2 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/KeyboardControllerPackage.kt +6 -6
- package/android/src/main/java/com/reactnativekeyboardcontroller/KeyboardControllerViewManager.kt +14 -3
- package/android/src/main/java/com/reactnativekeyboardcontroller/StatusBarManagerCompatModule.kt +81 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/TranslateDeferringInsetsAnimationCallback.kt +41 -41
- package/ios/.swift-version +1 -0
- package/ios/.swiftformat +5 -0
- package/ios/.swiftlint.yml +5 -0
- package/ios/KeyboardControllerModule.m +2 -2
- package/ios/KeyboardControllerModule.swift +17 -17
- package/ios/KeyboardControllerViewManager.m +1 -1
- package/ios/KeyboardControllerViewManager.swift +86 -54
- package/ios/KeyboardMoveEvent.swift +31 -27
- package/lib/commonjs/animated.js +19 -14
- package/lib/commonjs/animated.js.map +1 -1
- package/lib/commonjs/index.js +2 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/monkey-patch.js +44 -0
- package/lib/commonjs/monkey-patch.js.map +1 -0
- package/lib/commonjs/native.js.map +1 -1
- package/lib/module/animated.js +18 -15
- package/lib/module/animated.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/monkey-patch.js +36 -0
- package/lib/module/monkey-patch.js.map +1 -0
- package/lib/module/native.js.map +1 -1
- package/lib/typescript/animated.d.ts +18 -2
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/monkey-patch.d.ts +1 -0
- package/lib/typescript/native.d.ts +3 -5
- package/package.json +6 -3
- package/src/animated.tsx +34 -14
- package/src/index.ts +2 -0
- package/src/monkey-patch.tsx +36 -0
- package/src/native.ts +4 -5
- package/android/.gradle/6.8/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.8/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/ios/KeyboardController.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/KeyboardController.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/KeyboardController.xcodeproj/project.xcworkspace/xcuserdata/kiryl.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/KeyboardController.xcodeproj/xcuserdata/kiryl.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
// @ts-expect-error because there is no corresponding type definition
|
|
3
|
+
import * as NativeAndroidManager from 'react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid';
|
|
4
|
+
|
|
5
|
+
const getConstants = NativeAndroidManager.default.getConstants;
|
|
6
|
+
|
|
7
|
+
const RCTStatusBarManagerCompat = NativeModules.StatusBarManagerCompat;
|
|
8
|
+
|
|
9
|
+
// On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so
|
|
10
|
+
// in order to use library on all available platforms we have to monkey patch
|
|
11
|
+
// default RN implementation and use modern `WindowInsetsControllerCompat`.
|
|
12
|
+
if (Platform.OS === 'android') {
|
|
13
|
+
NativeAndroidManager.default = {
|
|
14
|
+
getConstants,
|
|
15
|
+
setColor(color: number, animated: boolean): void {
|
|
16
|
+
RCTStatusBarManagerCompat.setColor(color, animated);
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
setTranslucent(translucent: boolean): void {
|
|
20
|
+
RCTStatusBarManagerCompat.setTranslucent(translucent);
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* - statusBarStyles can be:
|
|
25
|
+
* - 'default'
|
|
26
|
+
* - 'dark-content'
|
|
27
|
+
*/
|
|
28
|
+
setStyle(statusBarStyle?: string): void {
|
|
29
|
+
RCTStatusBarManagerCompat.setStyle(statusBarStyle);
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
setHidden(hidden: boolean): void {
|
|
33
|
+
RCTStatusBarManagerCompat.setHidden(hidden);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
package/src/native.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
requireNativeComponent,
|
|
4
4
|
UIManager,
|
|
5
5
|
Platform,
|
|
6
|
-
ViewStyle,
|
|
7
6
|
NativeModules,
|
|
8
7
|
NativeEventEmitter,
|
|
9
8
|
NativeSyntheticEvent,
|
|
9
|
+
ViewProps,
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
|
|
12
12
|
const LINKING_ERROR =
|
|
@@ -30,14 +30,13 @@ export type EventWithName<T> = {
|
|
|
30
30
|
eventName: string;
|
|
31
31
|
} & T;
|
|
32
32
|
export type KeyboardControllerProps = {
|
|
33
|
-
style?: ViewStyle;
|
|
34
|
-
children: React.ReactNode;
|
|
35
33
|
onKeyboardMove: (e: NativeSyntheticEvent<EventWithName<NativeEvent>>) => void;
|
|
36
34
|
// fake prop used to activate reanimated bindings
|
|
37
35
|
onKeyboardMoveReanimated: (
|
|
38
36
|
e: NativeSyntheticEvent<EventWithName<NativeEvent>>
|
|
39
37
|
) => void;
|
|
40
|
-
|
|
38
|
+
statusBarTranslucent?: boolean;
|
|
39
|
+
} & ViewProps;
|
|
41
40
|
type KeyboardController = {
|
|
42
41
|
// android only
|
|
43
42
|
setDefaultMode: () => void;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
Binary file
|
|
@@ -1,14 +0,0 @@
|
|
|
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>
|