react-native-keyboard-controller 1.0.1 → 1.2.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.
Files changed (78) hide show
  1. package/android/build.gradle +72 -3
  2. package/android/gradle.properties +1 -1
  3. package/android/src/fabric/java/com/reactnativekeyboardcontroller/KeyboardControllerComponentsRegistry.kt +31 -0
  4. package/android/src/fabric/java/com/reactnativekeyboardcontroller/KeyboardControllerModule.kt +25 -0
  5. package/android/src/fabric/java/com/reactnativekeyboardcontroller/KeyboardControllerViewManager.kt +32 -0
  6. package/android/src/fabric/java/com/reactnativekeyboardcontroller/StatusBarManagerCompatModule.kt +25 -0
  7. package/android/src/main/java/com/reactnativekeyboardcontroller/KeyboardAnimationCallback.kt +188 -0
  8. package/android/src/main/java/com/reactnativekeyboardcontroller/{KeyboardControllerModule.kt → KeyboardControllerModuleImpl.kt} +5 -17
  9. package/android/src/main/java/com/reactnativekeyboardcontroller/KeyboardControllerPackage.kt +5 -0
  10. package/android/src/main/java/com/reactnativekeyboardcontroller/KeyboardControllerViewManagerImpl.kt +71 -0
  11. package/android/src/main/java/com/reactnativekeyboardcontroller/{StatusBarManagerCompatModule.kt → StatusBarManagerCompatImpl.kt} +10 -14
  12. package/android/src/main/jni/Android.mk +42 -0
  13. package/android/src/main/jni/KeyboardControllerComponentsRegistry.cpp +71 -0
  14. package/android/src/main/jni/KeyboardControllerComponentsRegistry.h +35 -0
  15. package/android/src/main/jni/OnLoad.cpp +9 -0
  16. package/android/src/paper/java/com/reactnativekeyboardcontroller/KeyboardControllerModule.kt +31 -0
  17. package/android/src/paper/java/com/reactnativekeyboardcontroller/KeyboardControllerViewManager.kt +26 -0
  18. package/android/src/paper/java/com/reactnativekeyboardcontroller/StatusBarManagerCompatModule.kt +34 -0
  19. package/ios/.clang-format +90 -0
  20. package/ios/KeyboardController.xcodeproj/project.pbxproj +22 -14
  21. package/ios/KeyboardControllerModule-Header.h +6 -2
  22. package/ios/KeyboardControllerModule.mm +105 -0
  23. package/ios/KeyboardControllerView.h +23 -0
  24. package/ios/KeyboardControllerView.mm +81 -0
  25. package/ios/{KeyboardControllerViewManager.m → KeyboardControllerViewManager.mm} +1 -1
  26. package/ios/KeyboardControllerViewManager.swift +13 -64
  27. package/ios/KeyboardMoveEvent.h +18 -0
  28. package/ios/KeyboardMoveEvent.m +74 -0
  29. package/ios/KeyboardMovementObserver.swift +90 -0
  30. package/lib/commonjs/KeyboardControllerViewNativeComponent.js +16 -0
  31. package/lib/commonjs/KeyboardControllerViewNativeComponent.js.map +1 -0
  32. package/lib/commonjs/NativeKeyboardController.js +13 -0
  33. package/lib/commonjs/NativeKeyboardController.js.map +1 -0
  34. package/lib/commonjs/NativeStatusBarManagerCompat.js +13 -0
  35. package/lib/commonjs/NativeStatusBarManagerCompat.js.map +1 -0
  36. package/lib/commonjs/animated.js.map +1 -1
  37. package/lib/commonjs/architecture.js +13 -0
  38. package/lib/commonjs/architecture.js.map +1 -0
  39. package/lib/commonjs/index.js.map +1 -1
  40. package/lib/commonjs/monkey-patch.js +3 -1
  41. package/lib/commonjs/monkey-patch.js.map +1 -1
  42. package/lib/commonjs/native.js +4 -2
  43. package/lib/commonjs/native.js.map +1 -1
  44. package/lib/commonjs/replicas.js.map +1 -1
  45. package/lib/module/KeyboardControllerViewNativeComponent.js +4 -0
  46. package/lib/module/KeyboardControllerViewNativeComponent.js.map +1 -0
  47. package/lib/module/NativeKeyboardController.js +3 -0
  48. package/lib/module/NativeKeyboardController.js.map +1 -0
  49. package/lib/module/NativeStatusBarManagerCompat.js +3 -0
  50. package/lib/module/NativeStatusBarManagerCompat.js.map +1 -0
  51. package/lib/module/animated.js.map +1 -1
  52. package/lib/module/architecture.js +5 -0
  53. package/lib/module/architecture.js.map +1 -0
  54. package/lib/module/index.js.map +1 -1
  55. package/lib/module/monkey-patch.js +2 -1
  56. package/lib/module/monkey-patch.js.map +1 -1
  57. package/lib/module/native.js +3 -2
  58. package/lib/module/native.js.map +1 -1
  59. package/lib/module/replicas.js.map +1 -1
  60. package/lib/typescript/KeyboardControllerViewNativeComponent.d.ts +13 -0
  61. package/lib/typescript/NativeKeyboardController.d.ts +10 -0
  62. package/lib/typescript/NativeStatusBarManagerCompat.d.ts +10 -0
  63. package/lib/typescript/architecture.d.ts +2 -0
  64. package/lib/typescript/native.d.ts +1 -1
  65. package/lib/typescript/replicas.d.ts +3 -5
  66. package/package.json +23 -6
  67. package/react-native-keyboard-controller.podspec +19 -0
  68. package/src/KeyboardControllerViewNativeComponent.ts +23 -0
  69. package/src/NativeKeyboardController.ts +16 -0
  70. package/src/NativeStatusBarManagerCompat.ts +13 -0
  71. package/src/architecture.ts +4 -0
  72. package/src/monkey-patch.tsx +5 -1
  73. package/src/native.ts +12 -7
  74. package/android/src/main/java/com/reactnativekeyboardcontroller/KeyboardControllerViewManager.kt +0 -77
  75. package/android/src/main/java/com/reactnativekeyboardcontroller/TranslateDeferringInsetsAnimationCallback.kt +0 -158
  76. package/ios/KeyboardControllerModule.m +0 -21
  77. package/ios/KeyboardControllerModule.swift +0 -53
  78. package/ios/KeyboardMoveEvent.swift +0 -41
@@ -0,0 +1,5 @@
1
+ // @ts-expect-error because `__turboModuleProxy` has any type (maybe think about own types declaration)
2
+ export const isTurboModuleEnabled = global.__turboModuleProxy != null; // @ts-expect-error because `nativeFabricUIManager` has any type (maybe think about own types declaration)
3
+
4
+ export const isFabricEnabled = global.nativeFabricUIManager != null;
5
+ //# sourceMappingURL=architecture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isTurboModuleEnabled","global","__turboModuleProxy","isFabricEnabled","nativeFabricUIManager"],"sources":["architecture.ts"],"sourcesContent":["// @ts-expect-error because `__turboModuleProxy` has any type (maybe think about own types declaration)\nexport const isTurboModuleEnabled = global.__turboModuleProxy != null;\n// @ts-expect-error because `nativeFabricUIManager` has any type (maybe think about own types declaration)\nexport const isFabricEnabled = global.nativeFabricUIManager != null;\n"],"mappings":"AAAA;AACA,OAAO,MAAMA,oBAAoB,GAAGC,MAAM,CAACC,kBAAP,IAA6B,IAA1D,C,CACP;;AACA,OAAO,MAAMC,eAAe,GAAGF,MAAM,CAACG,qBAAP,IAAgC,IAAxD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAP;AAEA,cAAc,UAAd;AACA,cAAc,YAAd;AACA,cAAc,YAAd","sourcesContent":["import './monkey-patch';\n\nexport * from './native';\nexport * from './animated';\nexport * from './replicas';\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import './monkey-patch';\n\nexport * from './native';\nexport * from './animated';\nexport * from './replicas';\n"],"mappings":"AAAA,OAAO,gBAAP;AAEA,cAAc,UAAd;AACA,cAAc,YAAd;AACA,cAAc,YAAd"}
@@ -1,8 +1,9 @@
1
1
  import { NativeModules, Platform } from 'react-native'; // @ts-expect-error because there is no corresponding type definition
2
2
 
3
3
  import * as NativeAndroidManager from 'react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid';
4
+ import { isTurboModuleEnabled } from './architecture';
4
5
  const getConstants = NativeAndroidManager.default.getConstants;
5
- const RCTStatusBarManagerCompat = NativeModules.StatusBarManagerCompat; // On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so
6
+ const RCTStatusBarManagerCompat = isTurboModuleEnabled ? require('./NativeStatusBarManagerCompat').default : NativeModules.StatusBarManagerCompat; // On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so
6
7
  // in order to use library on all available platforms we have to monkey patch
7
8
  // default RN implementation and use modern `WindowInsetsControllerCompat`.
8
9
 
@@ -1 +1 @@
1
- {"version":3,"sources":["monkey-patch.tsx"],"names":["NativeModules","Platform","NativeAndroidManager","getConstants","default","RCTStatusBarManagerCompat","StatusBarManagerCompat","OS","setColor","color","animated","setTranslucent","translucent","setStyle","statusBarStyle","setHidden","hidden"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC,C,CACA;;AACA,OAAO,KAAKC,oBAAZ,MAAsC,2EAAtC;AAEA,MAAMC,YAAY,GAAGD,oBAAoB,CAACE,OAArB,CAA6BD,YAAlD;AAEA,MAAME,yBAAyB,GAAGL,aAAa,CAACM,sBAAhD,C,CAEA;AACA;AACA;;AACA,IAAIL,QAAQ,CAACM,EAAT,KAAgB,SAApB,EAA+B;AAC7BL,EAAAA,oBAAoB,CAACE,OAArB,GAA+B;AAC7BD,IAAAA,YAD6B;;AAE7BK,IAAAA,QAAQ,CAACC,KAAD,EAAgBC,QAAhB,EAAyC;AAC/CL,MAAAA,yBAAyB,CAACG,QAA1B,CAAmCC,KAAnC,EAA0CC,QAA1C;AACD,KAJ4B;;AAM7BC,IAAAA,cAAc,CAACC,WAAD,EAA6B;AACzCP,MAAAA,yBAAyB,CAACM,cAA1B,CAAyCC,WAAzC;AACD,KAR4B;;AAU7B;AACJ;AACA;AACA;AACA;AACIC,IAAAA,QAAQ,CAACC,cAAD,EAAgC;AACtCT,MAAAA,yBAAyB,CAACQ,QAA1B,CAAmCC,cAAnC;AACD,KAjB4B;;AAmB7BC,IAAAA,SAAS,CAACC,MAAD,EAAwB;AAC/BX,MAAAA,yBAAyB,CAACU,SAA1B,CAAoCC,MAApC;AACD;;AArB4B,GAA/B;AAuBD","sourcesContent":["import { NativeModules, Platform } from 'react-native';\n// @ts-expect-error because there is no corresponding type definition\nimport * as NativeAndroidManager from 'react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid';\n\nconst getConstants = NativeAndroidManager.default.getConstants;\n\nconst RCTStatusBarManagerCompat = NativeModules.StatusBarManagerCompat;\n\n// On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so\n// in order to use library on all available platforms we have to monkey patch\n// default RN implementation and use modern `WindowInsetsControllerCompat`.\nif (Platform.OS === 'android') {\n NativeAndroidManager.default = {\n getConstants,\n setColor(color: number, animated: boolean): void {\n RCTStatusBarManagerCompat.setColor(color, animated);\n },\n\n setTranslucent(translucent: boolean): void {\n RCTStatusBarManagerCompat.setTranslucent(translucent);\n },\n\n /**\n * - statusBarStyles can be:\n * - 'default'\n * - 'dark-content'\n */\n setStyle(statusBarStyle?: string): void {\n RCTStatusBarManagerCompat.setStyle(statusBarStyle);\n },\n\n setHidden(hidden: boolean): void {\n RCTStatusBarManagerCompat.setHidden(hidden);\n },\n };\n}\n"]}
1
+ {"version":3,"names":["NativeModules","Platform","NativeAndroidManager","isTurboModuleEnabled","getConstants","default","RCTStatusBarManagerCompat","require","StatusBarManagerCompat","OS","setColor","color","animated","setTranslucent","translucent","setStyle","statusBarStyle","setHidden","hidden"],"sources":["monkey-patch.tsx"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\n// @ts-expect-error because there is no corresponding type definition\nimport * as NativeAndroidManager from 'react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid';\n\nimport { isTurboModuleEnabled } from './architecture';\n\nconst getConstants = NativeAndroidManager.default.getConstants;\n\nconst RCTStatusBarManagerCompat = isTurboModuleEnabled\n ? require('./NativeStatusBarManagerCompat').default\n : NativeModules.StatusBarManagerCompat;\n\n// On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so\n// in order to use library on all available platforms we have to monkey patch\n// default RN implementation and use modern `WindowInsetsControllerCompat`.\nif (Platform.OS === 'android') {\n NativeAndroidManager.default = {\n getConstants,\n setColor(color: number, animated: boolean): void {\n RCTStatusBarManagerCompat.setColor(color, animated);\n },\n\n setTranslucent(translucent: boolean): void {\n RCTStatusBarManagerCompat.setTranslucent(translucent);\n },\n\n /**\n * - statusBarStyles can be:\n * - 'default'\n * - 'dark-content'\n */\n setStyle(statusBarStyle?: string): void {\n RCTStatusBarManagerCompat.setStyle(statusBarStyle);\n },\n\n setHidden(hidden: boolean): void {\n RCTStatusBarManagerCompat.setHidden(hidden);\n },\n };\n}\n"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC,C,CACA;;AACA,OAAO,KAAKC,oBAAZ,MAAsC,2EAAtC;AAEA,SAASC,oBAAT,QAAqC,gBAArC;AAEA,MAAMC,YAAY,GAAGF,oBAAoB,CAACG,OAArB,CAA6BD,YAAlD;AAEA,MAAME,yBAAyB,GAAGH,oBAAoB,GAClDI,OAAO,CAAC,gCAAD,CAAP,CAA0CF,OADQ,GAElDL,aAAa,CAACQ,sBAFlB,C,CAIA;AACA;AACA;;AACA,IAAIP,QAAQ,CAACQ,EAAT,KAAgB,SAApB,EAA+B;EAC7BP,oBAAoB,CAACG,OAArB,GAA+B;IAC7BD,YAD6B;;IAE7BM,QAAQ,CAACC,KAAD,EAAgBC,QAAhB,EAAyC;MAC/CN,yBAAyB,CAACI,QAA1B,CAAmCC,KAAnC,EAA0CC,QAA1C;IACD,CAJ4B;;IAM7BC,cAAc,CAACC,WAAD,EAA6B;MACzCR,yBAAyB,CAACO,cAA1B,CAAyCC,WAAzC;IACD,CAR4B;;IAU7B;AACJ;AACA;AACA;AACA;IACIC,QAAQ,CAACC,cAAD,EAAgC;MACtCV,yBAAyB,CAACS,QAA1B,CAAmCC,cAAnC;IACD,CAjB4B;;IAmB7BC,SAAS,CAACC,MAAD,EAAwB;MAC/BZ,yBAAyB,CAACW,SAA1B,CAAoCC,MAApC;IACD;;EArB4B,CAA/B;AAuBD"}
@@ -1,5 +1,6 @@
1
1
  import { useEffect } from 'react';
2
2
  import { requireNativeComponent, UIManager, Platform, NativeModules, NativeEventEmitter } from 'react-native';
3
+ import { isFabricEnabled, isTurboModuleEnabled } from './architecture';
3
4
  const LINKING_ERROR = `The package 'react-native-keyboard-controller' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
4
5
  ios: "- You have run 'pod install'\n",
5
6
  default: ''
@@ -14,13 +15,13 @@ export let AndroidSoftInputModes;
14
15
  })(AndroidSoftInputModes || (AndroidSoftInputModes = {}));
15
16
 
16
17
  const ComponentName = 'KeyboardControllerView';
17
- const RCTKeyboardController = NativeModules.KeyboardController;
18
+ const RCTKeyboardController = isTurboModuleEnabled ? require('./NativeKeyboardController').default : NativeModules.KeyboardController;
18
19
  export const KeyboardController = RCTKeyboardController;
19
20
  const eventEmitter = new NativeEventEmitter(RCTKeyboardController);
20
21
  export const KeyboardEvents = {
21
22
  addListener: (name, cb) => eventEmitter.addListener('KeyboardController::' + name, cb)
22
23
  };
23
- export const KeyboardControllerView = UIManager.getViewManagerConfig(ComponentName) != null ? requireNativeComponent(ComponentName) : () => {
24
+ export const KeyboardControllerView = isFabricEnabled ? require('./KeyboardControllerViewNativeComponent').default : UIManager.getViewManagerConfig(ComponentName) != null ? requireNativeComponent(ComponentName) : () => {
24
25
  throw new Error(LINKING_ERROR);
25
26
  };
26
27
  export const useResizeMode = () => {
@@ -1 +1 @@
1
- {"version":3,"sources":["native.ts"],"names":["useEffect","requireNativeComponent","UIManager","Platform","NativeModules","NativeEventEmitter","LINKING_ERROR","select","ios","default","AndroidSoftInputModes","ComponentName","RCTKeyboardController","KeyboardController","eventEmitter","KeyboardEvents","addListener","name","cb","KeyboardControllerView","getViewManagerConfig","Error","useResizeMode","setInputMode","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode"],"mappings":"AAAA,SAASA,SAAT,QAA0B,OAA1B;AACA,SACEC,sBADF,EAEEC,SAFF,EAGEC,QAHF,EAIEC,aAJF,EAKEC,kBALF,QAQO,cARP;AAUA,MAAMC,aAAa,GAChB,2FAAD,GACAH,QAAQ,CAACI,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,WAAYC,qBAAZ;;WAAYA,qB;AAAAA,EAAAA,qB,CAAAA,qB;AAAAA,EAAAA,qB,CAAAA,qB;AAAAA,EAAAA,qB,CAAAA,qB;AAAAA,EAAAA,qB,CAAAA,qB;GAAAA,qB,KAAAA,qB;;AA4BZ,MAAMC,aAAa,GAAG,wBAAtB;AAEA,MAAMC,qBAAqB,GAAGR,aAAa,CAACS,kBAA5C;AACA,OAAO,MAAMA,kBAAkB,GAAGD,qBAA3B;AAEP,MAAME,YAAY,GAAG,IAAIT,kBAAJ,CAAuBO,qBAAvB,CAArB;AASA,OAAO,MAAMG,cAAc,GAAG;AAC5BC,EAAAA,WAAW,EAAE,CACXC,IADW,EAEXC,EAFW,KAGRJ,YAAY,CAACE,WAAb,CAAyB,yBAAyBC,IAAlD,EAAwDC,EAAxD;AAJuB,CAAvB;AAMP,OAAO,MAAMC,sBAAsB,GACjCjB,SAAS,CAACkB,oBAAV,CAA+BT,aAA/B,KAAiD,IAAjD,GACIV,sBAAsB,CAA0BU,aAA1B,CAD1B,GAEI,MAAM;AACJ,QAAM,IAAIU,KAAJ,CAAUf,aAAV,CAAN;AACD,CALA;AAOP,OAAO,MAAMgB,aAAa,GAAG,MAAM;AACjCtB,EAAAA,SAAS,CAAC,MAAM;AACda,IAAAA,kBAAkB,CAACU,YAAnB,CACEb,qBAAqB,CAACc,wBADxB;AAIA,WAAO,MAAMX,kBAAkB,CAACY,cAAnB,EAAb;AACD,GANQ,EAMN,EANM,CAAT;AAOD,CARM","sourcesContent":["import { useEffect } from 'react';\nimport {\n requireNativeComponent,\n UIManager,\n Platform,\n NativeModules,\n NativeEventEmitter,\n NativeSyntheticEvent,\n ViewProps,\n} from 'react-native';\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 managed workflow\\n';\n\nexport enum AndroidSoftInputModes {\n SOFT_INPUT_ADJUST_NOTHING = 48,\n SOFT_INPUT_ADJUST_PAN = 32,\n SOFT_INPUT_ADJUST_RESIZE = 16,\n SOFT_INPUT_ADJUST_UNSPECIFIED = 0,\n}\n\nexport type NativeEvent = {\n progress: number;\n height: number;\n};\nexport type EventWithName<T> = {\n eventName: string;\n} & T;\nexport type KeyboardControllerProps = {\n onKeyboardMove: (e: NativeSyntheticEvent<EventWithName<NativeEvent>>) => void;\n // fake prop used to activate reanimated bindings\n onKeyboardMoveReanimated: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>\n ) => void;\n statusBarTranslucent?: boolean;\n} & ViewProps;\ntype KeyboardController = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: AndroidSoftInputModes) => void;\n};\n\nconst ComponentName = 'KeyboardControllerView';\n\nconst RCTKeyboardController = NativeModules.KeyboardController;\nexport const KeyboardController = RCTKeyboardController as KeyboardController;\n\nconst eventEmitter = new NativeEventEmitter(RCTKeyboardController);\ntype KeyboardControllerEvents =\n | 'keyboardWillShow'\n | 'keyboardDidShow'\n | 'keyboardWillHide'\n | 'keyboardDidHide';\ntype KeyboardEvent = {\n height: number;\n};\nexport const KeyboardEvents = {\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEvent) => void\n ) => eventEmitter.addListener('KeyboardController::' + name, cb),\n};\nexport const KeyboardControllerView =\n UIManager.getViewManagerConfig(ComponentName) != null\n ? requireNativeComponent<KeyboardControllerProps>(ComponentName)\n : () => {\n throw new Error(LINKING_ERROR);\n };\n\nexport const useResizeMode = () => {\n useEffect(() => {\n KeyboardController.setInputMode(\n AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE\n );\n\n return () => KeyboardController.setDefaultMode();\n }, []);\n};\n"]}
1
+ {"version":3,"names":["useEffect","requireNativeComponent","UIManager","Platform","NativeModules","NativeEventEmitter","isFabricEnabled","isTurboModuleEnabled","LINKING_ERROR","select","ios","default","AndroidSoftInputModes","ComponentName","RCTKeyboardController","require","KeyboardController","eventEmitter","KeyboardEvents","addListener","name","cb","KeyboardControllerView","getViewManagerConfig","Error","useResizeMode","setInputMode","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode"],"sources":["native.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport {\n requireNativeComponent,\n UIManager,\n Platform,\n NativeModules,\n NativeEventEmitter,\n NativeSyntheticEvent,\n ViewProps,\n} from 'react-native';\n\nimport { isFabricEnabled, isTurboModuleEnabled } from './architecture';\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 managed workflow\\n';\n\nexport enum AndroidSoftInputModes {\n SOFT_INPUT_ADJUST_NOTHING = 48,\n SOFT_INPUT_ADJUST_PAN = 32,\n SOFT_INPUT_ADJUST_RESIZE = 16,\n SOFT_INPUT_ADJUST_UNSPECIFIED = 0,\n}\n\nexport type NativeEvent = {\n progress: number;\n height: number;\n};\nexport type EventWithName<T> = {\n eventName: string;\n} & T;\nexport type KeyboardControllerProps = {\n onKeyboardMove: (e: NativeSyntheticEvent<EventWithName<NativeEvent>>) => void;\n // fake prop used to activate reanimated bindings\n onKeyboardMoveReanimated: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>\n ) => void;\n statusBarTranslucent?: boolean;\n} & ViewProps;\ntype KeyboardController = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: AndroidSoftInputModes) => void;\n};\n\nconst ComponentName = 'KeyboardControllerView';\n\nconst RCTKeyboardController = isTurboModuleEnabled\n ? require('./NativeKeyboardController').default\n : NativeModules.KeyboardController;\nexport const KeyboardController = RCTKeyboardController as KeyboardController;\n\nconst eventEmitter = new NativeEventEmitter(RCTKeyboardController);\ntype KeyboardControllerEvents =\n | 'keyboardWillShow'\n | 'keyboardDidShow'\n | 'keyboardWillHide'\n | 'keyboardDidHide';\ntype KeyboardEvent = {\n height: number;\n};\nexport const KeyboardEvents = {\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEvent) => void\n ) => eventEmitter.addListener('KeyboardController::' + name, cb),\n};\nexport const KeyboardControllerView = isFabricEnabled\n ? require('./KeyboardControllerViewNativeComponent').default\n : UIManager.getViewManagerConfig(ComponentName) != null\n ? requireNativeComponent<KeyboardControllerProps>(ComponentName)\n : () => {\n throw new Error(LINKING_ERROR);\n };\n\nexport const useResizeMode = () => {\n useEffect(() => {\n KeyboardController.setInputMode(\n AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE\n );\n\n return () => KeyboardController.setDefaultMode();\n }, []);\n};\n"],"mappings":"AAAA,SAASA,SAAT,QAA0B,OAA1B;AACA,SACEC,sBADF,EAEEC,SAFF,EAGEC,QAHF,EAIEC,aAJF,EAKEC,kBALF,QAQO,cARP;AAUA,SAASC,eAAT,EAA0BC,oBAA1B,QAAsD,gBAAtD;AAEA,MAAMC,aAAa,GAChB,2FAAD,GACAL,QAAQ,CAACM,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,WAAYC,qBAAZ;;WAAYA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;GAAAA,qB,KAAAA,qB;;AA4BZ,MAAMC,aAAa,GAAG,wBAAtB;AAEA,MAAMC,qBAAqB,GAAGP,oBAAoB,GAC9CQ,OAAO,CAAC,4BAAD,CAAP,CAAsCJ,OADQ,GAE9CP,aAAa,CAACY,kBAFlB;AAGA,OAAO,MAAMA,kBAAkB,GAAGF,qBAA3B;AAEP,MAAMG,YAAY,GAAG,IAAIZ,kBAAJ,CAAuBS,qBAAvB,CAArB;AASA,OAAO,MAAMI,cAAc,GAAG;EAC5BC,WAAW,EAAE,CACXC,IADW,EAEXC,EAFW,KAGRJ,YAAY,CAACE,WAAb,CAAyB,yBAAyBC,IAAlD,EAAwDC,EAAxD;AAJuB,CAAvB;AAMP,OAAO,MAAMC,sBAAsB,GAAGhB,eAAe,GACjDS,OAAO,CAAC,yCAAD,CAAP,CAAmDJ,OADF,GAEjDT,SAAS,CAACqB,oBAAV,CAA+BV,aAA/B,KAAiD,IAAjD,GACAZ,sBAAsB,CAA0BY,aAA1B,CADtB,GAEA,MAAM;EACJ,MAAM,IAAIW,KAAJ,CAAUhB,aAAV,CAAN;AACD,CANE;AAQP,OAAO,MAAMiB,aAAa,GAAG,MAAM;EACjCzB,SAAS,CAAC,MAAM;IACdgB,kBAAkB,CAACU,YAAnB,CACEd,qBAAqB,CAACe,wBADxB;IAIA,OAAO,MAAMX,kBAAkB,CAACY,cAAnB,EAAb;EACD,CANQ,EAMN,EANM,CAAT;AAOD,CARM"}
@@ -1 +1 @@
1
- {"version":3,"sources":["replicas.ts"],"names":["useRef","useEffect","useMemo","Animated","Easing","Keyboard","Platform","runOnUI","useAnimatedReaction","useDerivedValue","useSharedValue","useWorkletCallback","withSpring","useReanimatedKeyboardAnimation","AndroidSoftInputModes","KeyboardController","availableOSEventType","OS","defaultAndroidEasing","bezier","useKeyboardAnimationReplica","height","Value","progress","animation","current","setInputMode","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode","listener","addListener","e","timing","toValue","endCoordinates","duration","easing","useNativeDriver","start","remove","IOS_SPRING_CONFIG","damping","stiffness","mass","overshootClamping","restDisplacementThreshold","restSpeedThreshold","useReanimatedKeyboardAnimationReplica","heightEvent","value","handler","_height","_keyboardHeight","result","_previousResult","_previousKeyboardHeight","show","hide","useGradualKeyboardAnimation"],"mappings":"AAAA,SAASA,MAAT,EAAiBC,SAAjB,EAA4BC,OAA5B,QAA2C,OAA3C;AACA,SAASC,QAAT,EAAmBC,MAAnB,EAA2BC,QAA3B,EAAqCC,QAArC,QAAqD,cAArD;AACA,SACEC,OADF,EAEEC,mBAFF,EAGEC,eAHF,EAIEC,cAJF,EAKEC,kBALF,EAMEC,UANF,QAOO,yBAPP;AAQA,SAASC,8BAAT,QAA+C,YAA/C;AAEA,SAASC,qBAAT,EAAgCC,kBAAhC,QAA0D,UAA1D;AAEA,MAAMC,oBAAoB,GAAGV,QAAQ,CAACW,EAAT,KAAgB,KAAhB,GAAwB,MAAxB,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AxCM;AA0CP,OAAO,MAAMmC,2BAA2B,GACtCpD,QAAQ,CAACW,EAAT,KAAgB,KAAhB,GACI8B,qCADJ,GAEIlC,8BAHC","sourcesContent":["import { useRef, useEffect, useMemo } from 'react';\nimport { Animated, Easing, Keyboard, Platform } from 'react-native';\nimport {\n runOnUI,\n useAnimatedReaction,\n useDerivedValue,\n useSharedValue,\n useWorkletCallback,\n withSpring,\n} from 'react-native-reanimated';\nimport { useReanimatedKeyboardAnimation } from './animated';\n\nimport { AndroidSoftInputModes, KeyboardController } from './native';\n\nconst availableOSEventType = Platform.OS === 'ios' ? 'Will' : 'Did';\n\n// cubic-bezier(.17,.67,.34,.94)\nexport const defaultAndroidEasing = Easing.bezier(0.4, 0.0, 0.2, 1);\ntype KeyboardAnimation = {\n progress: Animated.Value;\n height: Animated.Value;\n};\n\n/**\n * An experimental implementation of tracing keyboard appearance.\n * Switch an input mode to adjust resize mode. In this case all did* events\n * are triggering before keyboard appears, and using some approximations\n * it tries to mimicries a native transition.\n *\n * @returns {Animated.Value}\n */\nexport const useKeyboardAnimationReplica = (): KeyboardAnimation => {\n const height = useRef(new Animated.Value(0));\n const progress = useRef(new Animated.Value(0));\n const animation = useMemo(\n () => ({\n height: height.current,\n progress: progress.current,\n }),\n []\n );\n\n useEffect(() => {\n KeyboardController.setInputMode(\n AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE\n );\n\n return () => KeyboardController.setDefaultMode();\n }, []);\n useEffect(() => {\n const listener = Keyboard.addListener(\n `keyboard${availableOSEventType}Show`,\n (e) => {\n Animated.timing(height.current, {\n toValue: -e.endCoordinates.height,\n duration: e.duration !== 0 ? e.duration : 300,\n easing: Easing.bezier(0.4, 0.0, 0.2, 1),\n useNativeDriver: true,\n }).start();\n\n return () => listener.remove();\n }\n );\n }, []);\n useEffect(() => {\n const listener = Keyboard.addListener(\n `keyboard${availableOSEventType}Hide`,\n (e) => {\n Animated.timing(height.current, {\n toValue: 0,\n duration: e.duration !== 0 ? e.duration : 300,\n easing: Easing.bezier(0.4, 0.0, 0.2, 1),\n useNativeDriver: true,\n }).start();\n\n return () => listener.remove();\n }\n );\n }, []);\n\n return animation;\n};\n\nconst IOS_SPRING_CONFIG = {\n damping: 500,\n stiffness: 1000,\n mass: 3,\n overshootClamping: true,\n restDisplacementThreshold: 10,\n restSpeedThreshold: 10,\n};\n\n/**\n * A close replica to native iOS keyboard animation. The problem is that\n * iOS (unlike Android) can not fire events for each keyboard frame movement.\n * As a result we can not get gradual values (for example, for progress it always\n * will be 1 or 0). So if you want to rely on gradual values you will need to use\n * this replica.\n *\n * The transition is hardcoded and may vary from one to another OS versions. But it\n * seems like last time it has been changed in iOS 7. Since RN supports at least iOS\n * 11 it doesn't make sense to replicate iOS 7 behavior. If it changes in next OS\n * versions, then this implementation should be revisited and reflect necessary changes.\n *\n * @returns {height, progress} - animated values\n */\nexport const useReanimatedKeyboardAnimationReplica = () => {\n const height = useSharedValue(0);\n const heightEvent = useSharedValue(0);\n\n const progress = useDerivedValue(() => height.value / heightEvent.value);\n\n const handler = useWorkletCallback((_height: number) => {\n heightEvent.value = _height;\n }, []);\n\n useAnimatedReaction(\n () => ({\n _keyboardHeight: heightEvent.value,\n }),\n (result, _previousResult) => {\n const { _keyboardHeight } = result;\n const _previousKeyboardHeight = _previousResult?._keyboardHeight;\n\n if (_keyboardHeight !== _previousKeyboardHeight) {\n height.value = withSpring(_keyboardHeight, IOS_SPRING_CONFIG);\n }\n },\n []\n );\n\n useEffect(() => {\n const show = Keyboard.addListener('keyboardWillShow', (e) => {\n runOnUI(handler)(-e.endCoordinates.height);\n });\n const hide = Keyboard.addListener('keyboardWillHide', () => {\n runOnUI(handler)(0);\n });\n\n return () => {\n show.remove();\n hide.remove();\n };\n }, []);\n\n return { height, progress };\n};\n\nexport const useGradualKeyboardAnimation =\n Platform.OS === 'ios'\n ? useReanimatedKeyboardAnimationReplica\n : useReanimatedKeyboardAnimation;\n"]}
1
+ {"version":3,"names":["useRef","useEffect","useMemo","Animated","Easing","Keyboard","Platform","runOnUI","useAnimatedReaction","useDerivedValue","useSharedValue","useWorkletCallback","withSpring","useReanimatedKeyboardAnimation","AndroidSoftInputModes","KeyboardController","availableOSEventType","OS","defaultAndroidEasing","bezier","useKeyboardAnimationReplica","height","Value","progress","animation","current","setInputMode","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode","listener","addListener","e","timing","toValue","endCoordinates","duration","easing","useNativeDriver","start","remove","IOS_SPRING_CONFIG","damping","stiffness","mass","overshootClamping","restDisplacementThreshold","restSpeedThreshold","useReanimatedKeyboardAnimationReplica","heightEvent","value","handler","_height","_keyboardHeight","result","_previousResult","_previousKeyboardHeight","show","hide","useGradualKeyboardAnimation"],"sources":["replicas.ts"],"sourcesContent":["import { useRef, useEffect, useMemo } from 'react';\nimport { Animated, Easing, Keyboard, Platform } from 'react-native';\nimport {\n runOnUI,\n useAnimatedReaction,\n useDerivedValue,\n useSharedValue,\n useWorkletCallback,\n withSpring,\n} from 'react-native-reanimated';\nimport { useReanimatedKeyboardAnimation } from './animated';\n\nimport { AndroidSoftInputModes, KeyboardController } from './native';\n\nconst availableOSEventType = Platform.OS === 'ios' ? 'Will' : 'Did';\n\n// cubic-bezier(.17,.67,.34,.94)\nexport const defaultAndroidEasing = Easing.bezier(0.4, 0.0, 0.2, 1);\ntype KeyboardAnimation = {\n progress: Animated.Value;\n height: Animated.Value;\n};\n\n/**\n * An experimental implementation of tracing keyboard appearance.\n * Switch an input mode to adjust resize mode. In this case all did* events\n * are triggering before keyboard appears, and using some approximations\n * it tries to mimicries a native transition.\n *\n * @returns {Animated.Value}\n */\nexport const useKeyboardAnimationReplica = (): KeyboardAnimation => {\n const height = useRef(new Animated.Value(0));\n const progress = useRef(new Animated.Value(0));\n const animation = useMemo(\n () => ({\n height: height.current,\n progress: progress.current,\n }),\n []\n );\n\n useEffect(() => {\n KeyboardController.setInputMode(\n AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE\n );\n\n return () => KeyboardController.setDefaultMode();\n }, []);\n useEffect(() => {\n const listener = Keyboard.addListener(\n `keyboard${availableOSEventType}Show`,\n (e) => {\n Animated.timing(height.current, {\n toValue: -e.endCoordinates.height,\n duration: e.duration !== 0 ? e.duration : 300,\n easing: Easing.bezier(0.4, 0.0, 0.2, 1),\n useNativeDriver: true,\n }).start();\n\n return () => listener.remove();\n }\n );\n }, []);\n useEffect(() => {\n const listener = Keyboard.addListener(\n `keyboard${availableOSEventType}Hide`,\n (e) => {\n Animated.timing(height.current, {\n toValue: 0,\n duration: e.duration !== 0 ? e.duration : 300,\n easing: Easing.bezier(0.4, 0.0, 0.2, 1),\n useNativeDriver: true,\n }).start();\n\n return () => listener.remove();\n }\n );\n }, []);\n\n return animation;\n};\n\nconst IOS_SPRING_CONFIG = {\n damping: 500,\n stiffness: 1000,\n mass: 3,\n overshootClamping: true,\n restDisplacementThreshold: 10,\n restSpeedThreshold: 10,\n};\n\n/**\n * A close replica to native iOS keyboard animation. The problem is that\n * iOS (unlike Android) can not fire events for each keyboard frame movement.\n * As a result we can not get gradual values (for example, for progress it always\n * will be 1 or 0). So if you want to rely on gradual values you will need to use\n * this replica.\n *\n * The transition is hardcoded and may vary from one to another OS versions. But it\n * seems like last time it has been changed in iOS 7. Since RN supports at least iOS\n * 11 it doesn't make sense to replicate iOS 7 behavior. If it changes in next OS\n * versions, then this implementation should be revisited and reflect necessary changes.\n *\n * @returns {height, progress} - animated values\n */\nexport const useReanimatedKeyboardAnimationReplica = () => {\n const height = useSharedValue(0);\n const heightEvent = useSharedValue(0);\n\n const progress = useDerivedValue(() => height.value / heightEvent.value);\n\n const handler = useWorkletCallback((_height: number) => {\n heightEvent.value = _height;\n }, []);\n\n useAnimatedReaction(\n () => ({\n _keyboardHeight: heightEvent.value,\n }),\n (result, _previousResult) => {\n const { _keyboardHeight } = result;\n const _previousKeyboardHeight = _previousResult?._keyboardHeight;\n\n if (_keyboardHeight !== _previousKeyboardHeight) {\n height.value = withSpring(_keyboardHeight, IOS_SPRING_CONFIG);\n }\n },\n []\n );\n\n useEffect(() => {\n const show = Keyboard.addListener('keyboardWillShow', (e) => {\n runOnUI(handler)(-e.endCoordinates.height);\n });\n const hide = Keyboard.addListener('keyboardWillHide', () => {\n runOnUI(handler)(0);\n });\n\n return () => {\n show.remove();\n hide.remove();\n };\n }, []);\n\n return { height, progress };\n};\n\nexport const useGradualKeyboardAnimation =\n Platform.OS === 'ios'\n ? useReanimatedKeyboardAnimationReplica\n : useReanimatedKeyboardAnimation;\n"],"mappings":"AAAA,SAASA,MAAT,EAAiBC,SAAjB,EAA4BC,OAA5B,QAA2C,OAA3C;AACA,SAASC,QAAT,EAAmBC,MAAnB,EAA2BC,QAA3B,EAAqCC,QAArC,QAAqD,cAArD;AACA,SACEC,OADF,EAEEC,mBAFF,EAGEC,eAHF,EAIEC,cAJF,EAKEC,kBALF,EAMEC,UANF,QAOO,yBAPP;AAQA,SAASC,8BAAT,QAA+C,YAA/C;AAEA,SAASC,qBAAT,EAAgCC,kBAAhC,QAA0D,UAA1D;AAEA,MAAMC,oBAAoB,GAAGV,QAAQ,CAACW,EAAT,KAAgB,KAAhB,GAAwB,MAAxB,GAAiC,KAA9D,C,CAEA;;AACA,OAAO,MAAMC,oBAAoB,GAAGd,MAAM,CAACe,MAAP,CAAc,GAAd,EAAmB,GAAnB,EAAwB,GAAxB,EAA6B,CAA7B,CAA7B;;AAMP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,2BAA2B,GAAG,MAAyB;EAClE,MAAMC,MAAM,GAAGrB,MAAM,CAAC,IAAIG,QAAQ,CAACmB,KAAb,CAAmB,CAAnB,CAAD,CAArB;EACA,MAAMC,QAAQ,GAAGvB,MAAM,CAAC,IAAIG,QAAQ,CAACmB,KAAb,CAAmB,CAAnB,CAAD,CAAvB;EACA,MAAME,SAAS,GAAGtB,OAAO,CACvB,OAAO;IACLmB,MAAM,EAAEA,MAAM,CAACI,OADV;IAELF,QAAQ,EAAEA,Q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IAAI,GAAGnD,QAAQ,CAACyB,WAAT,CAAqB,kBAArB,EAA0CC,CAAD,IAAO;MAC3DxB,OAAO,CAAC2C,OAAD,CAAP,CAAiB,CAACnB,CAAC,CAACG,cAAF,CAAiBb,MAAnC;IACD,CAFY,CAAb;IAGA,MAAMoC,IAAI,GAAGpD,QAAQ,CAACyB,WAAT,CAAqB,kBAArB,EAAyC,MAAM;MAC1DvB,OAAO,CAAC2C,OAAD,CAAP,CAAiB,CAAjB;IACD,CAFY,CAAb;IAIA,OAAO,MAAM;MACXM,IAAI,CAACjB,MAAL;MACAkB,IAAI,CAAClB,MAAL;IACD,CAHD;EAID,CAZQ,EAYN,EAZM,CAAT;EAcA,OAAO;IAAElB,MAAF;IAAUE;EAAV,CAAP;AACD,CAxCM;AA0CP,OAAO,MAAMmC,2BAA2B,GACtCpD,QAAQ,CAACW,EAAT,KAAgB,KAAhB,GACI8B,qCADJ,GAEIlC,8BAHC"}
@@ -0,0 +1,13 @@
1
+ import type { HostComponent } from 'react-native';
2
+ import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
3
+ import type { DirectEventHandler, Float, Int32 } from 'react-native/Libraries/Types/CodegenTypes';
4
+ declare type KeyboardMoveEvent = Readonly<{
5
+ height: Int32;
6
+ progress: Float;
7
+ }>;
8
+ export interface NativeProps extends ViewProps {
9
+ statusBarTranslucent?: boolean;
10
+ onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;
11
+ }
12
+ declare const _default: HostComponent<NativeProps>;
13
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import type { TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ readonly getConstants: () => {};
4
+ setInputMode(mode: number): void;
5
+ setDefaultMode(): void;
6
+ addListener: (eventName: string) => void;
7
+ removeListeners: (count: number) => void;
8
+ }
9
+ declare const _default: Spec | null;
10
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import type { TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ readonly getConstants: () => {};
4
+ setHidden(hidden: boolean): void;
5
+ setColor(color: number, animated: boolean): void;
6
+ setTranslucent(translucent: boolean): void;
7
+ setStyle(style: string): void;
8
+ }
9
+ declare const _default: Spec | null;
10
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export declare const isTurboModuleEnabled: boolean;
2
+ export declare const isFabricEnabled: boolean;
@@ -29,6 +29,6 @@ declare type KeyboardEvent = {
29
29
  export declare const KeyboardEvents: {
30
30
  addListener: (name: KeyboardControllerEvents, cb: (e: KeyboardEvent) => void) => import("react-native").EmitterSubscription;
31
31
  };
32
- export declare const KeyboardControllerView: import("react-native").HostComponent<KeyboardControllerProps> | (() => never);
32
+ export declare const KeyboardControllerView: any;
33
33
  export declare const useResizeMode: () => void;
34
34
  export {};
@@ -35,11 +35,9 @@ export declare const useReanimatedKeyboardAnimationReplica: () => {
35
35
  }>;
36
36
  };
37
37
  export declare const useGradualKeyboardAnimation: () => {
38
- progress: {
39
- value: number;
40
- };
41
- height: {
38
+ height: import("react-native-reanimated").SharedValue<number>;
39
+ progress: Readonly<{
42
40
  value: number;
43
- };
41
+ }>;
44
42
  };
45
43
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-keyboard-controller",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "description": "Keyboard manager which works in identical way on both iOS and Android",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -16,6 +16,7 @@
16
16
  "react-native-keyboard-controller.podspec",
17
17
  "!lib/typescript/example",
18
18
  "!android/build",
19
+ "!android/.gradle",
19
20
  "!ios/build",
20
21
  "!**/__tests__",
21
22
  "!**/__fixtures__",
@@ -25,6 +26,7 @@
25
26
  "test": "jest",
26
27
  "typescript": "tsc --noEmit --project tsconfig.build.json",
27
28
  "lint": "eslint --quiet \"**/*.{js,ts,tsx}\"",
29
+ "lint-clang": "find ios/ -iname *.h -o -iname *.m -o -iname *.mm | grep -v -e Pods -e build | xargs clang-format -i -n --Werror",
28
30
  "prepare": "bob build",
29
31
  "release": "release-it",
30
32
  "example": "yarn --cwd example",
@@ -53,9 +55,10 @@
53
55
  "@react-native-community/eslint-config": "^2.0.0",
54
56
  "@release-it/conventional-changelog": "^2.0.0",
55
57
  "@types/jest": "^27.4.1",
56
- "@types/react": "^17.0.39",
57
- "@types/react-native": "0.67.6",
58
+ "@types/react": "^18.0.17",
59
+ "@types/react-native": "0.69.5",
58
60
  "commitlint": "^11.0.0",
61
+ "clang-format": "^1.8.0",
59
62
  "eslint": "^7.2.0",
60
63
  "eslint-config-prettier": "^7.0.0",
61
64
  "eslint-plugin-prettier": "^3.1.3",
@@ -63,10 +66,10 @@
63
66
  "jest": "^27.5.1",
64
67
  "pod-install": "^0.1.0",
65
68
  "prettier": "^2.6.2",
66
- "react": "17.0.2",
67
- "react-native": "0.68.1",
69
+ "react": "18.0.0",
70
+ "react-native": "0.69.4",
68
71
  "react-native-builder-bob": "^0.18.0",
69
- "react-native-reanimated": "2.8.0",
72
+ "react-native-reanimated": "2.9.1",
70
73
  "release-it": "^14.2.2",
71
74
  "typescript": "^4.6.3"
72
75
  },
@@ -148,5 +151,19 @@
148
151
  }
149
152
  ]
150
153
  ]
154
+ },
155
+ "codegenConfig": {
156
+ "libraries": [
157
+ {
158
+ "name": "RNKeyboardControllerSpec",
159
+ "type": "modules",
160
+ "jsSrcsDir": "src"
161
+ },
162
+ {
163
+ "name": "RNKeyboardControllerViewSpec",
164
+ "type": "components",
165
+ "jsSrcsDir": "src"
166
+ }
167
+ ]
151
168
  }
152
169
  }
@@ -2,6 +2,8 @@ require "json"
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
4
 
5
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
6
+
5
7
  Pod::Spec.new do |s|
6
8
  s.name = "react-native-keyboard-controller"
7
9
  s.version = package["version"]
@@ -14,6 +16,23 @@ Pod::Spec.new do |s|
14
16
  s.source = { :git => "https://github.com/kirillzyusko/react-native-keyboard-controller.git", :tag => "#{s.version}" }
15
17
 
16
18
  s.source_files = "ios/**/*.{h,m,mm,swift}"
19
+ s.public_header_files = "ios/**/*.h"
17
20
 
18
21
  s.dependency "React-Core"
22
+
23
+ # This guard prevent to install the dependencies when we run `pod install` in the old architecture.
24
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
25
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
26
+ s.pod_target_xcconfig = {
27
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
28
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
29
+ }
30
+
31
+ s.dependency "React-RCTFabric"
32
+ s.dependency "React-Codegen"
33
+ s.dependency "RCT-Folly"
34
+ s.dependency "RCTRequired"
35
+ s.dependency "RCTTypeSafety"
36
+ s.dependency "ReactCommon/turbomodule/core"
37
+ end
19
38
  end
@@ -0,0 +1,23 @@
1
+ import type { HostComponent } from 'react-native';
2
+ // @ts-expect-error - no type definition
3
+ import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
4
+ import type {
5
+ DirectEventHandler,
6
+ Float,
7
+ Int32,
8
+ } from 'react-native/Libraries/Types/CodegenTypes';
9
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
10
+
11
+ type KeyboardMoveEvent = Readonly<{
12
+ height: Int32;
13
+ progress: Float;
14
+ }>;
15
+
16
+ export interface NativeProps extends ViewProps {
17
+ statusBarTranslucent?: boolean;
18
+ onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;
19
+ }
20
+
21
+ export default codegenNativeComponent<NativeProps>(
22
+ 'KeyboardControllerView'
23
+ ) as HostComponent<NativeProps>;
@@ -0,0 +1,16 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import { TurboModuleRegistry } from 'react-native';
3
+
4
+ export interface Spec extends TurboModule {
5
+ readonly getConstants: () => {};
6
+
7
+ // methods
8
+ setInputMode(mode: number): void;
9
+ setDefaultMode(): void;
10
+
11
+ // event emitter
12
+ addListener: (eventName: string) => void;
13
+ removeListeners: (count: number) => void;
14
+ }
15
+
16
+ export default TurboModuleRegistry.get<Spec>('KeyboardController');
@@ -0,0 +1,13 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import { TurboModuleRegistry } from 'react-native';
3
+
4
+ export interface Spec extends TurboModule {
5
+ readonly getConstants: () => {};
6
+
7
+ setHidden(hidden: boolean): void;
8
+ setColor(color: number, animated: boolean): void;
9
+ setTranslucent(translucent: boolean): void;
10
+ setStyle(style: string): void;
11
+ }
12
+
13
+ export default TurboModuleRegistry.get<Spec>('StatusBarManagerCompat');
@@ -0,0 +1,4 @@
1
+ // @ts-expect-error because `__turboModuleProxy` has any type (maybe think about own types declaration)
2
+ export const isTurboModuleEnabled = global.__turboModuleProxy != null;
3
+ // @ts-expect-error because `nativeFabricUIManager` has any type (maybe think about own types declaration)
4
+ export const isFabricEnabled = global.nativeFabricUIManager != null;
@@ -2,9 +2,13 @@ import { NativeModules, Platform } from 'react-native';
2
2
  // @ts-expect-error because there is no corresponding type definition
3
3
  import * as NativeAndroidManager from 'react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid';
4
4
 
5
+ import { isTurboModuleEnabled } from './architecture';
6
+
5
7
  const getConstants = NativeAndroidManager.default.getConstants;
6
8
 
7
- const RCTStatusBarManagerCompat = NativeModules.StatusBarManagerCompat;
9
+ const RCTStatusBarManagerCompat = isTurboModuleEnabled
10
+ ? require('./NativeStatusBarManagerCompat').default
11
+ : NativeModules.StatusBarManagerCompat;
8
12
 
9
13
  // On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so
10
14
  // in order to use library on all available platforms we have to monkey patch
package/src/native.ts CHANGED
@@ -9,6 +9,8 @@ import {
9
9
  ViewProps,
10
10
  } from 'react-native';
11
11
 
12
+ import { isFabricEnabled, isTurboModuleEnabled } from './architecture';
13
+
12
14
  const LINKING_ERROR =
13
15
  `The package 'react-native-keyboard-controller' doesn't seem to be linked. Make sure: \n\n` +
14
16
  Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
@@ -45,7 +47,9 @@ type KeyboardController = {
45
47
 
46
48
  const ComponentName = 'KeyboardControllerView';
47
49
 
48
- const RCTKeyboardController = NativeModules.KeyboardController;
50
+ const RCTKeyboardController = isTurboModuleEnabled
51
+ ? require('./NativeKeyboardController').default
52
+ : NativeModules.KeyboardController;
49
53
  export const KeyboardController = RCTKeyboardController as KeyboardController;
50
54
 
51
55
  const eventEmitter = new NativeEventEmitter(RCTKeyboardController);
@@ -63,12 +67,13 @@ export const KeyboardEvents = {
63
67
  cb: (e: KeyboardEvent) => void
64
68
  ) => eventEmitter.addListener('KeyboardController::' + name, cb),
65
69
  };
66
- export const KeyboardControllerView =
67
- UIManager.getViewManagerConfig(ComponentName) != null
68
- ? requireNativeComponent<KeyboardControllerProps>(ComponentName)
69
- : () => {
70
- throw new Error(LINKING_ERROR);
71
- };
70
+ export const KeyboardControllerView = isFabricEnabled
71
+ ? require('./KeyboardControllerViewNativeComponent').default
72
+ : UIManager.getViewManagerConfig(ComponentName) != null
73
+ ? requireNativeComponent<KeyboardControllerProps>(ComponentName)
74
+ : () => {
75
+ throw new Error(LINKING_ERROR);
76
+ };
72
77
 
73
78
  export const useResizeMode = () => {
74
79
  useEffect(() => {
@@ -1,77 +0,0 @@
1
- package com.reactnativekeyboardcontroller
2
-
3
- import android.util.Log
4
- import androidx.appcompat.widget.FitWindowsLinearLayout
5
- import androidx.core.view.ViewCompat
6
- import androidx.core.view.WindowInsetsAnimationCompat
7
- import androidx.core.view.WindowInsetsCompat
8
- import com.facebook.react.bridge.ReactApplicationContext
9
- import com.facebook.react.common.MapBuilder
10
- import com.facebook.react.uimanager.ThemedReactContext
11
- import com.facebook.react.uimanager.annotations.ReactProp
12
- import com.facebook.react.views.view.ReactViewGroup
13
- import com.facebook.react.views.view.ReactViewManager
14
- import com.reactnativekeyboardcontroller.events.KeyboardTransitionEvent
15
-
16
- class KeyboardControllerViewManager(reactContext: ReactApplicationContext) : ReactViewManager() {
17
- private val TAG = KeyboardControllerViewManager::class.qualifiedName
18
- private var mReactContext = reactContext
19
- private var isStatusBarTranslucent = false
20
-
21
- override fun getName() = "KeyboardControllerView"
22
-
23
- override fun createViewInstance(reactContext: ThemedReactContext): ReactViewGroup {
24
- val view = EdgeToEdgeReactViewGroup(reactContext)
25
- val activity = mReactContext.currentActivity
26
-
27
- if (activity == null) {
28
- Log.w(TAG, "Can not setup keyboard animation listener, since `currentActivity` is null")
29
- return view
30
- }
31
-
32
- val window = activity.window
33
- val decorView = window.decorView
34
-
35
- ViewCompat.setOnApplyWindowInsetsListener(view) { v, insets ->
36
- val content =
37
- mReactContext.currentActivity?.window?.decorView?.rootView?.findViewById<FitWindowsLinearLayout>(
38
- R.id.action_bar_root
39
- )
40
- content?.setPadding(
41
- 0, if (this.isStatusBarTranslucent) 0 else insets?.getInsets(WindowInsetsCompat.Type.systemBars())?.top ?: 0, 0,
42
- insets?.getInsets(WindowInsetsCompat.Type.navigationBars())?.bottom ?: 0
43
- )
44
-
45
- insets
46
- }
47
-
48
- ViewCompat.setWindowInsetsAnimationCallback(
49
- decorView,
50
- TranslateDeferringInsetsAnimationCallback(
51
- view = view,
52
- persistentInsetTypes = WindowInsetsCompat.Type.systemBars(),
53
- deferredInsetTypes = WindowInsetsCompat.Type.ime(),
54
- // We explicitly allow dispatch to continue down to binding.messageHolder's
55
- // child views, so that step 2.5 below receives the call
56
- dispatchMode = WindowInsetsAnimationCompat.Callback.DISPATCH_MODE_CONTINUE_ON_SUBTREE,
57
- context = mReactContext
58
- )
59
- )
60
-
61
- return view
62
- }
63
-
64
- @ReactProp(name = "statusBarTranslucent")
65
- fun setStatusBarTranslucent(view: ReactViewGroup, isStatusBarTranslucent: Boolean) {
66
- this.isStatusBarTranslucent = isStatusBarTranslucent
67
- }
68
-
69
- override fun getExportedCustomDirectEventTypeConstants(): MutableMap<String, Any> {
70
- val map: MutableMap<String, Any> = MapBuilder.of(
71
- KeyboardTransitionEvent.EVENT_NAME,
72
- MapBuilder.of("registrationName", "onKeyboardMove")
73
- )
74
-
75
- return map
76
- }
77
- }