@react-native-ohos/react-native-keyboard-controller 1.12.8-beta.9

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 (251) hide show
  1. package/LICENSE +21 -0
  2. package/README.OpenSource +11 -0
  3. package/README.md +19 -0
  4. package/harmony/keyboard_controller/BuildProfile.ets +17 -0
  5. package/harmony/keyboard_controller/Index.ets +30 -0
  6. package/harmony/keyboard_controller/ResourceTable.txt +9 -0
  7. package/harmony/keyboard_controller/build-profile.json5 +31 -0
  8. package/harmony/keyboard_controller/consumer-rules.txt +0 -0
  9. package/harmony/keyboard_controller/hvigorfile.ts +6 -0
  10. package/harmony/keyboard_controller/obfuscation-rules.txt +18 -0
  11. package/harmony/keyboard_controller/oh-package-lock.json5 +19 -0
  12. package/harmony/keyboard_controller/oh-package.json5 +11 -0
  13. package/harmony/keyboard_controller/src/main/cpp/CMakeLists.txt +7 -0
  14. package/harmony/keyboard_controller/src/main/cpp/EventEmitters.cpp +96 -0
  15. package/harmony/keyboard_controller/src/main/cpp/EventEmitters.h +111 -0
  16. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentDescriptor.h +98 -0
  17. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.cpp +274 -0
  18. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.h +101 -0
  19. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewJSIBinder.h +64 -0
  20. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentDescriptor.h +85 -0
  21. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.cpp +110 -0
  22. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.h +84 -0
  23. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaJSIBinder.h +60 -0
  24. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.cpp +46 -0
  25. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.h +48 -0
  26. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardControllerPackage.cpp +64 -0
  27. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardControllerPackage.h +77 -0
  28. package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.cpp +45 -0
  29. package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.h +49 -0
  30. package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.cpp +186 -0
  31. package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.h +112 -0
  32. package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.cpp +64 -0
  33. package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.h +77 -0
  34. package/harmony/keyboard_controller/src/main/ets/Logger.ts +67 -0
  35. package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerPackage.ets +70 -0
  36. package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerTurboModule.ts +245 -0
  37. package/harmony/keyboard_controller/src/main/ets/RNStatusBarManagerCompatTurboModule.ts +119 -0
  38. package/harmony/keyboard_controller/src/main/ets/Type.ts +62 -0
  39. package/harmony/keyboard_controller/src/main/module.json +29 -0
  40. package/harmony/keyboard_controller/src/main/module.json5 +11 -0
  41. package/harmony/keyboard_controller/src/main/resources/base/element/string.json +8 -0
  42. package/harmony/keyboard_controller/src/main/resources/en_US/element/string.json +8 -0
  43. package/harmony/keyboard_controller/src/main/resources/zh_CN/element/string.json +8 -0
  44. package/harmony/keyboard_controller/ts.ets +30 -0
  45. package/harmony/keyboard_controller.har +0 -0
  46. package/lib/commonjs/animated.js +188 -0
  47. package/lib/commonjs/animated.js.map +1 -0
  48. package/lib/commonjs/bindings.js +38 -0
  49. package/lib/commonjs/bindings.js.map +1 -0
  50. package/lib/commonjs/bindings.native.js +37 -0
  51. package/lib/commonjs/bindings.native.js.map +1 -0
  52. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js +66 -0
  53. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js.map +1 -0
  54. package/lib/commonjs/components/KeyboardAvoidingView/index.js +102 -0
  55. package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -0
  56. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +255 -0
  57. package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -0
  58. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +110 -0
  59. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -0
  60. package/lib/commonjs/components/KeyboardAwareScrollView/utils.js +37 -0
  61. package/lib/commonjs/components/KeyboardAwareScrollView/utils.js.map +1 -0
  62. package/lib/commonjs/components/KeyboardStickyView/index.js +40 -0
  63. package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -0
  64. package/lib/commonjs/components/KeyboardToolbar/Arrow.js +76 -0
  65. package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -0
  66. package/lib/commonjs/components/KeyboardToolbar/Button.js +70 -0
  67. package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -0
  68. package/lib/commonjs/components/KeyboardToolbar/colors.js +21 -0
  69. package/lib/commonjs/components/KeyboardToolbar/colors.js.map +1 -0
  70. package/lib/commonjs/components/KeyboardToolbar/colors.native.js +40 -0
  71. package/lib/commonjs/components/KeyboardToolbar/colors.native.js.map +1 -0
  72. package/lib/commonjs/components/KeyboardToolbar/index.js +152 -0
  73. package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -0
  74. package/lib/commonjs/components/KeyboardToolbar/types.js +6 -0
  75. package/lib/commonjs/components/KeyboardToolbar/types.js.map +1 -0
  76. package/lib/commonjs/components/hooks/useColorScheme.js +10 -0
  77. package/lib/commonjs/components/hooks/useColorScheme.js.map +1 -0
  78. package/lib/commonjs/components/index.js +42 -0
  79. package/lib/commonjs/components/index.js.map +1 -0
  80. package/lib/commonjs/constants.js +27 -0
  81. package/lib/commonjs/constants.js.map +1 -0
  82. package/lib/commonjs/context.js +42 -0
  83. package/lib/commonjs/context.js.map +1 -0
  84. package/lib/commonjs/hooks/index.js +104 -0
  85. package/lib/commonjs/hooks/index.js.map +1 -0
  86. package/lib/commonjs/hooks/useWindowDimensions/index.android.js +29 -0
  87. package/lib/commonjs/hooks/useWindowDimensions/index.android.js.map +1 -0
  88. package/lib/commonjs/hooks/useWindowDimensions/index.js +13 -0
  89. package/lib/commonjs/hooks/useWindowDimensions/index.js.map +1 -0
  90. package/lib/commonjs/index.js +116 -0
  91. package/lib/commonjs/index.js.map +1 -0
  92. package/lib/commonjs/internal.js +73 -0
  93. package/lib/commonjs/internal.js.map +1 -0
  94. package/lib/commonjs/monkey-patch.android.js +57 -0
  95. package/lib/commonjs/monkey-patch.android.js.map +1 -0
  96. package/lib/commonjs/monkey-patch.js +11 -0
  97. package/lib/commonjs/monkey-patch.js.map +1 -0
  98. package/lib/commonjs/reanimated.js +12 -0
  99. package/lib/commonjs/reanimated.js.map +1 -0
  100. package/lib/commonjs/reanimated.native.js +88 -0
  101. package/lib/commonjs/reanimated.native.js.map +1 -0
  102. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js +10 -0
  103. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -0
  104. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js +12 -0
  105. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -0
  106. package/lib/commonjs/specs/NativeKeyboardController.js +9 -0
  107. package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -0
  108. package/lib/commonjs/specs/NativeStatusBarManagerCompat.js +9 -0
  109. package/lib/commonjs/specs/NativeStatusBarManagerCompat.js.map +1 -0
  110. package/lib/commonjs/types.js +6 -0
  111. package/lib/commonjs/types.js.map +1 -0
  112. package/lib/commonjs/utils.js +9 -0
  113. package/lib/commonjs/utils.js.map +1 -0
  114. package/lib/module/animated.js +180 -0
  115. package/lib/module/animated.js.map +1 -0
  116. package/lib/module/bindings.js +32 -0
  117. package/lib/module/bindings.js.map +1 -0
  118. package/lib/module/bindings.native.js +31 -0
  119. package/lib/module/bindings.native.js.map +1 -0
  120. package/lib/module/components/KeyboardAvoidingView/hooks.js +59 -0
  121. package/lib/module/components/KeyboardAvoidingView/hooks.js.map +1 -0
  122. package/lib/module/components/KeyboardAvoidingView/index.js +95 -0
  123. package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -0
  124. package/lib/module/components/KeyboardAwareScrollView/index.js +248 -0
  125. package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -0
  126. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +103 -0
  127. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -0
  128. package/lib/module/components/KeyboardAwareScrollView/utils.js +29 -0
  129. package/lib/module/components/KeyboardAwareScrollView/utils.js.map +1 -0
  130. package/lib/module/components/KeyboardStickyView/index.js +33 -0
  131. package/lib/module/components/KeyboardStickyView/index.js.map +1 -0
  132. package/lib/module/components/KeyboardToolbar/Arrow.js +68 -0
  133. package/lib/module/components/KeyboardToolbar/Arrow.js.map +1 -0
  134. package/lib/module/components/KeyboardToolbar/Button.js +62 -0
  135. package/lib/module/components/KeyboardToolbar/Button.js.map +1 -0
  136. package/lib/module/components/KeyboardToolbar/colors.js +15 -0
  137. package/lib/module/components/KeyboardToolbar/colors.js.map +1 -0
  138. package/lib/module/components/KeyboardToolbar/colors.native.js +34 -0
  139. package/lib/module/components/KeyboardToolbar/colors.native.js.map +1 -0
  140. package/lib/module/components/KeyboardToolbar/index.js +140 -0
  141. package/lib/module/components/KeyboardToolbar/index.js.map +1 -0
  142. package/lib/module/components/KeyboardToolbar/types.js +2 -0
  143. package/lib/module/components/KeyboardToolbar/types.js.map +1 -0
  144. package/lib/module/components/hooks/useColorScheme.js +4 -0
  145. package/lib/module/components/hooks/useColorScheme.js.map +1 -0
  146. package/lib/module/components/index.js +5 -0
  147. package/lib/module/components/index.js.map +1 -0
  148. package/lib/module/constants.js +21 -0
  149. package/lib/module/constants.js.map +1 -0
  150. package/lib/module/context.js +35 -0
  151. package/lib/module/context.js.map +1 -0
  152. package/lib/module/hooks/index.js +68 -0
  153. package/lib/module/hooks/index.js.map +1 -0
  154. package/lib/module/hooks/useWindowDimensions/index.android.js +22 -0
  155. package/lib/module/hooks/useWindowDimensions/index.android.js.map +1 -0
  156. package/lib/module/hooks/useWindowDimensions/index.js +2 -0
  157. package/lib/module/hooks/useWindowDimensions/index.js.map +1 -0
  158. package/lib/module/index.js +10 -0
  159. package/lib/module/index.js.map +1 -0
  160. package/lib/module/internal.js +66 -0
  161. package/lib/module/internal.js.map +1 -0
  162. package/lib/module/monkey-patch.android.js +47 -0
  163. package/lib/module/monkey-patch.android.js.map +1 -0
  164. package/lib/module/monkey-patch.js +5 -0
  165. package/lib/module/monkey-patch.js.map +1 -0
  166. package/lib/module/reanimated.js +6 -0
  167. package/lib/module/reanimated.js.map +1 -0
  168. package/lib/module/reanimated.native.js +78 -0
  169. package/lib/module/reanimated.native.js.map +1 -0
  170. package/lib/module/specs/KeyboardControllerViewNativeComponent.js +3 -0
  171. package/lib/module/specs/KeyboardControllerViewNativeComponent.js.map +1 -0
  172. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js +5 -0
  173. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js.map +1 -0
  174. package/lib/module/specs/NativeKeyboardController.js +3 -0
  175. package/lib/module/specs/NativeKeyboardController.js.map +1 -0
  176. package/lib/module/specs/NativeStatusBarManagerCompat.js +3 -0
  177. package/lib/module/specs/NativeStatusBarManagerCompat.js.map +1 -0
  178. package/lib/module/types.js +2 -0
  179. package/lib/module/types.js.map +1 -0
  180. package/lib/module/utils.js +2 -0
  181. package/lib/module/utils.js.map +1 -0
  182. package/lib/typescript/animated.d.ts +31 -0
  183. package/lib/typescript/bindings.d.ts +12 -0
  184. package/lib/typescript/bindings.native.d.ts +12 -0
  185. package/lib/typescript/components/KeyboardAvoidingView/hooks.d.ts +6 -0
  186. package/lib/typescript/components/KeyboardAvoidingView/index.d.ts +50 -0
  187. package/lib/typescript/components/KeyboardAwareScrollView/index.d.ts +25 -0
  188. package/lib/typescript/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.d.ts +6 -0
  189. package/lib/typescript/components/KeyboardAwareScrollView/utils.d.ts +2 -0
  190. package/lib/typescript/components/KeyboardStickyView/index.d.ts +35 -0
  191. package/lib/typescript/components/KeyboardToolbar/Arrow.d.ts +9 -0
  192. package/lib/typescript/components/KeyboardToolbar/Button.d.ts +15 -0
  193. package/lib/typescript/components/KeyboardToolbar/colors.d.ts +2 -0
  194. package/lib/typescript/components/KeyboardToolbar/colors.native.d.ts +2 -0
  195. package/lib/typescript/components/KeyboardToolbar/index.d.ts +50 -0
  196. package/lib/typescript/components/KeyboardToolbar/types.d.ts +18 -0
  197. package/lib/typescript/components/hooks/useColorScheme.d.ts +2 -0
  198. package/lib/typescript/components/index.d.ts +8 -0
  199. package/lib/typescript/constants.d.ts +16 -0
  200. package/lib/typescript/context.d.ts +23 -0
  201. package/lib/typescript/hooks/index.d.ts +17 -0
  202. package/lib/typescript/hooks/useWindowDimensions/index.android.d.ts +2 -0
  203. package/lib/typescript/hooks/useWindowDimensions/index.d.ts +1 -0
  204. package/lib/typescript/index.d.ts +8 -0
  205. package/lib/typescript/internal.d.ts +30 -0
  206. package/lib/typescript/monkey-patch.android.d.ts +2 -0
  207. package/lib/typescript/monkey-patch.d.ts +2 -0
  208. package/lib/typescript/reanimated.d.ts +5 -0
  209. package/lib/typescript/reanimated.native.d.ts +7 -0
  210. package/lib/typescript/specs/KeyboardControllerViewNativeComponent.d.ts +53 -0
  211. package/lib/typescript/specs/KeyboardGestureAreaNativeComponent.d.ts +10 -0
  212. package/lib/typescript/specs/NativeKeyboardController.d.ts +12 -0
  213. package/lib/typescript/specs/NativeStatusBarManagerCompat.d.ts +10 -0
  214. package/lib/typescript/types.d.ts +133 -0
  215. package/lib/typescript/utils.d.ts +1 -0
  216. package/package.json +178 -0
  217. package/react-native-keyboard-controller.podspec +61 -0
  218. package/src/animated.tsx +253 -0
  219. package/src/bindings.native.ts +57 -0
  220. package/src/bindings.ts +38 -0
  221. package/src/components/KeyboardAvoidingView/hooks.ts +58 -0
  222. package/src/components/KeyboardAvoidingView/index.tsx +156 -0
  223. package/src/components/KeyboardAwareScrollView/index.tsx +373 -0
  224. package/src/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +133 -0
  225. package/src/components/KeyboardAwareScrollView/utils.ts +41 -0
  226. package/src/components/KeyboardStickyView/index.tsx +57 -0
  227. package/src/components/KeyboardToolbar/Arrow.tsx +80 -0
  228. package/src/components/KeyboardToolbar/Button.tsx +98 -0
  229. package/src/components/KeyboardToolbar/colors.native.ts +37 -0
  230. package/src/components/KeyboardToolbar/colors.ts +16 -0
  231. package/src/components/KeyboardToolbar/index.tsx +211 -0
  232. package/src/components/KeyboardToolbar/types.ts +40 -0
  233. package/src/components/hooks/useColorScheme.ts +5 -0
  234. package/src/components/index.ts +11 -0
  235. package/src/constants.ts +19 -0
  236. package/src/context.ts +65 -0
  237. package/src/hooks/index.ts +90 -0
  238. package/src/hooks/useWindowDimensions/index.android.ts +33 -0
  239. package/src/hooks/useWindowDimensions/index.ts +1 -0
  240. package/src/index.ts +21 -0
  241. package/src/internal.ts +84 -0
  242. package/src/monkey-patch.android.ts +44 -0
  243. package/src/monkey-patch.ts +4 -0
  244. package/src/reanimated.native.ts +132 -0
  245. package/src/reanimated.ts +29 -0
  246. package/src/specs/KeyboardControllerViewNativeComponent.ts +70 -0
  247. package/src/specs/KeyboardGestureAreaNativeComponent.ts +15 -0
  248. package/src/specs/NativeKeyboardController.ts +19 -0
  249. package/src/specs/NativeStatusBarManagerCompat.ts +14 -0
  250. package/src/types.ts +211 -0
  251. package/src/utils.ts +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_KeyboardAvoidingView","_interopRequireDefault","require","_KeyboardStickyView","_KeyboardAwareScrollView","_KeyboardToolbar","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["index.ts"],"sourcesContent":["export { default as KeyboardAvoidingView } from \"./KeyboardAvoidingView\";\r\nexport { default as KeyboardStickyView } from \"./KeyboardStickyView\";\r\nexport { default as KeyboardAwareScrollView } from \"./KeyboardAwareScrollView\";\r\nexport {\r\n default as KeyboardToolbar,\r\n DefaultKeyboardToolbarTheme,\r\n} from \"./KeyboardToolbar\";\r\nexport type { KeyboardAvoidingViewProps } from \"./KeyboardAvoidingView\";\r\nexport type { KeyboardStickyViewProps } from \"./KeyboardStickyView\";\r\nexport type { KeyboardAwareScrollViewProps } from \"./KeyboardAwareScrollView\";\r\nexport type { KeyboardToolbarProps } from \"./KeyboardToolbar\";\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,wBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,gBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAG2B,SAAAI,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,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,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAAA,SAAAP,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAK,UAAA,GAAAL,CAAA,KAAAU,OAAA,EAAAV,CAAA","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AndroidSoftInputModes = void 0;
7
+ // copied from `android.view.WindowManager.LayoutParams`
8
+ let AndroidSoftInputModes = exports.AndroidSoftInputModes = /*#__PURE__*/function (AndroidSoftInputModes) {
9
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_ADJUST_NOTHING"] = 48] = "SOFT_INPUT_ADJUST_NOTHING";
10
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_ADJUST_PAN"] = 32] = "SOFT_INPUT_ADJUST_PAN";
11
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_ADJUST_RESIZE"] = 16] = "SOFT_INPUT_ADJUST_RESIZE";
12
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_ADJUST_UNSPECIFIED"] = 0] = "SOFT_INPUT_ADJUST_UNSPECIFIED";
13
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_IS_FORWARD_NAVIGATION"] = 256] = "SOFT_INPUT_IS_FORWARD_NAVIGATION";
14
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_MASK_ADJUST"] = 240] = "SOFT_INPUT_MASK_ADJUST";
15
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_MASK_STATE"] = 15] = "SOFT_INPUT_MASK_STATE";
16
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_MODE_CHANGED"] = 512] = "SOFT_INPUT_MODE_CHANGED";
17
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_STATE_ALWAYS_HIDDEN"] = 3] = "SOFT_INPUT_STATE_ALWAYS_HIDDEN";
18
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_STATE_ALWAYS_VISIBLE"] = 5] = "SOFT_INPUT_STATE_ALWAYS_VISIBLE";
19
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_STATE_HIDDEN"] = 2] = "SOFT_INPUT_STATE_HIDDEN";
20
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_STATE_UNCHANGED"] = 1] = "SOFT_INPUT_STATE_UNCHANGED";
21
+ // temporarily disable this rule to avoid breaking changes.
22
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
23
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_STATE_UNSPECIFIED"] = 0] = "SOFT_INPUT_STATE_UNSPECIFIED";
24
+ AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_STATE_VISIBLE"] = 4] = "SOFT_INPUT_STATE_VISIBLE";
25
+ return AndroidSoftInputModes;
26
+ }({});
27
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AndroidSoftInputModes","exports"],"sources":["constants.ts"],"sourcesContent":["// copied from `android.view.WindowManager.LayoutParams`\r\nexport enum AndroidSoftInputModes {\r\n SOFT_INPUT_ADJUST_NOTHING = 48,\r\n SOFT_INPUT_ADJUST_PAN = 32,\r\n SOFT_INPUT_ADJUST_RESIZE = 16,\r\n SOFT_INPUT_ADJUST_UNSPECIFIED = 0,\r\n SOFT_INPUT_IS_FORWARD_NAVIGATION = 256,\r\n SOFT_INPUT_MASK_ADJUST = 240,\r\n SOFT_INPUT_MASK_STATE = 15,\r\n SOFT_INPUT_MODE_CHANGED = 512,\r\n SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3,\r\n SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5,\r\n SOFT_INPUT_STATE_HIDDEN = 2,\r\n SOFT_INPUT_STATE_UNCHANGED = 1,\r\n // temporarily disable this rule to avoid breaking changes.\r\n // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values\r\n SOFT_INPUT_STATE_UNSPECIFIED = 0,\r\n SOFT_INPUT_STATE_VISIBLE = 4,\r\n}\r\n"],"mappings":";;;;;;AAAA;AAAA,IACYA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,0BAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAa/B;EACA;EAdUA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useKeyboardContext = exports.KeyboardContext = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ const NOOP = () => {};
10
+ const withSharedValue = value => ({
11
+ value,
12
+ addListener: NOOP,
13
+ removeListener: NOOP,
14
+ modify: NOOP
15
+ });
16
+ const DEFAULT_SHARED_VALUE = withSharedValue(0);
17
+ const DEFAULT_LAYOUT = withSharedValue(null);
18
+ const defaultContext = {
19
+ enabled: true,
20
+ animated: {
21
+ progress: new _reactNative.Animated.Value(0),
22
+ height: new _reactNative.Animated.Value(0)
23
+ },
24
+ reanimated: {
25
+ progress: DEFAULT_SHARED_VALUE,
26
+ height: DEFAULT_SHARED_VALUE
27
+ },
28
+ layout: DEFAULT_LAYOUT,
29
+ setKeyboardHandlers: NOOP,
30
+ setInputHandlers: NOOP,
31
+ setEnabled: NOOP
32
+ };
33
+ const KeyboardContext = exports.KeyboardContext = /*#__PURE__*/(0, _react.createContext)(defaultContext);
34
+ const useKeyboardContext = () => {
35
+ const context = (0, _react.useContext)(KeyboardContext);
36
+ if (__DEV__ && context === defaultContext) {
37
+ console.warn("Couldn't find real values for `KeyboardContext`. Please make sure you're inside of `KeyboardProvider` - otherwise functionality of `react-native-keyboard-controller` will not work.");
38
+ }
39
+ return context;
40
+ };
41
+ exports.useKeyboardContext = useKeyboardContext;
42
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","NOOP","withSharedValue","value","addListener","removeListener","modify","DEFAULT_SHARED_VALUE","DEFAULT_LAYOUT","defaultContext","enabled","animated","progress","Animated","Value","height","reanimated","layout","setKeyboardHandlers","setInputHandlers","setEnabled","KeyboardContext","exports","createContext","useKeyboardContext","context","useContext","__DEV__","console","warn"],"sources":["context.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\r\nimport { Animated } from \"react-native\";\r\n\r\nimport type {\r\n FocusedInputHandlers,\r\n FocusedInputLayoutChangedEvent,\r\n KeyboardHandlers,\r\n} from \"./types\";\r\nimport type React from \"react\";\r\nimport type { SharedValue } from \"react-native-reanimated\";\r\n\r\nexport type AnimatedContext = {\r\n progress: Animated.Value;\r\n height: Animated.AnimatedMultiplication<number>;\r\n};\r\nexport type ReanimatedContext = {\r\n progress: SharedValue<number>;\r\n height: SharedValue<number>;\r\n};\r\nexport type KeyboardAnimationContext = {\r\n enabled: boolean;\r\n animated: AnimatedContext;\r\n reanimated: ReanimatedContext;\r\n layout: SharedValue<FocusedInputLayoutChangedEvent | null>;\r\n setKeyboardHandlers: (handlers: KeyboardHandlers) => void;\r\n setInputHandlers: (handlers: FocusedInputHandlers) => void;\r\n setEnabled: React.Dispatch<React.SetStateAction<boolean>>;\r\n};\r\nconst NOOP = () => {};\r\nconst withSharedValue = <T>(value: T): SharedValue<T> => ({\r\n value,\r\n addListener: NOOP,\r\n removeListener: NOOP,\r\n modify: NOOP,\r\n});\r\nconst DEFAULT_SHARED_VALUE = withSharedValue(0);\r\nconst DEFAULT_LAYOUT = withSharedValue<FocusedInputLayoutChangedEvent | null>(\r\n null,\r\n);\r\nconst defaultContext: KeyboardAnimationContext = {\r\n enabled: true,\r\n animated: {\r\n progress: new Animated.Value(0),\r\n height: new Animated.Value(0),\r\n },\r\n reanimated: {\r\n progress: DEFAULT_SHARED_VALUE,\r\n height: DEFAULT_SHARED_VALUE,\r\n },\r\n layout: DEFAULT_LAYOUT,\r\n setKeyboardHandlers: NOOP,\r\n setInputHandlers: NOOP,\r\n setEnabled: NOOP,\r\n};\r\nexport const KeyboardContext = createContext(defaultContext);\r\nexport const useKeyboardContext = () => {\r\n const context = useContext(KeyboardContext);\r\n if (__DEV__ && context === defaultContext) {\r\n console.warn(\r\n \"Couldn't find real values for `KeyboardContext`. Please make sure you're inside of `KeyboardProvider` - otherwise functionality of `react-native-keyboard-controller` will not work.\",\r\n );\r\n }\r\n\r\n return context;\r\n};\r\n"],"mappings":";;;;;;AAAA,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7
+ useResizeMode: true,
8
+ useKeyboardAnimation: true,
9
+ useReanimatedKeyboardAnimation: true,
10
+ useGenericKeyboardHandler: true,
11
+ useKeyboardHandler: true,
12
+ useKeyboardController: true,
13
+ useReanimatedFocusedInput: true,
14
+ useFocusedInputHandler: true
15
+ };
16
+ exports.useFocusedInputHandler = useFocusedInputHandler;
17
+ exports.useGenericKeyboardHandler = useGenericKeyboardHandler;
18
+ exports.useKeyboardAnimation = void 0;
19
+ exports.useKeyboardController = useKeyboardController;
20
+ exports.useKeyboardHandler = useKeyboardHandler;
21
+ exports.useReanimatedFocusedInput = useReanimatedFocusedInput;
22
+ exports.useResizeMode = exports.useReanimatedKeyboardAnimation = void 0;
23
+ var _react = require("react");
24
+ var _bindings = require("../bindings");
25
+ var _constants = require("../constants");
26
+ var _context = require("../context");
27
+ var _utils = require("../utils");
28
+ var _useWindowDimensions = require("./useWindowDimensions");
29
+ Object.keys(_useWindowDimensions).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
32
+ if (key in exports && exports[key] === _useWindowDimensions[key]) return;
33
+ Object.defineProperty(exports, key, {
34
+ enumerable: true,
35
+ get: function () {
36
+ return _useWindowDimensions[key];
37
+ }
38
+ });
39
+ });
40
+ const useResizeMode = () => {
41
+ (0, _react.useEffect)(() => {
42
+ _bindings.KeyboardController.setInputMode(_constants.AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE);
43
+ return () => _bindings.KeyboardController.setDefaultMode();
44
+ }, []);
45
+ };
46
+ exports.useResizeMode = useResizeMode;
47
+ const useKeyboardAnimation = () => {
48
+ useResizeMode();
49
+ const context = (0, _context.useKeyboardContext)();
50
+ return context.animated;
51
+ };
52
+ exports.useKeyboardAnimation = useKeyboardAnimation;
53
+ const useReanimatedKeyboardAnimation = () => {
54
+ useResizeMode();
55
+ const context = (0, _context.useKeyboardContext)();
56
+ return context.reanimated;
57
+ };
58
+ exports.useReanimatedKeyboardAnimation = useReanimatedKeyboardAnimation;
59
+ function useGenericKeyboardHandler(handler, deps) {
60
+ const context = (0, _context.useKeyboardContext)();
61
+ (0, _react.useEffect)(() => {
62
+ const key = (0, _utils.uuid)();
63
+ context.setKeyboardHandlers({
64
+ [key]: handler
65
+ });
66
+ return () => {
67
+ context.setKeyboardHandlers({
68
+ [key]: undefined
69
+ });
70
+ };
71
+ }, deps);
72
+ }
73
+ function useKeyboardHandler(handler, deps) {
74
+ useResizeMode();
75
+ useGenericKeyboardHandler(handler, deps);
76
+ }
77
+ function useKeyboardController() {
78
+ const context = (0, _context.useKeyboardContext)();
79
+ return {
80
+ setEnabled: context.setEnabled,
81
+ enabled: context.enabled
82
+ };
83
+ }
84
+ function useReanimatedFocusedInput() {
85
+ const context = (0, _context.useKeyboardContext)();
86
+ return {
87
+ input: context.layout
88
+ };
89
+ }
90
+ function useFocusedInputHandler(handler, deps) {
91
+ const context = (0, _context.useKeyboardContext)();
92
+ (0, _react.useEffect)(() => {
93
+ const key = (0, _utils.uuid)();
94
+ context.setInputHandlers({
95
+ [key]: handler
96
+ });
97
+ return () => {
98
+ context.setInputHandlers({
99
+ [key]: undefined
100
+ });
101
+ };
102
+ }, deps);
103
+ }
104
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_bindings","_constants","_context","_utils","_useWindowDimensions","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","useResizeMode","useEffect","KeyboardController","setInputMode","AndroidSoftInputModes","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode","useKeyboardAnimation","context","useKeyboardContext","animated","useReanimatedKeyboardAnimation","reanimated","useGenericKeyboardHandler","handler","deps","uuid","setKeyboardHandlers","undefined","useKeyboardHandler","useKeyboardController","setEnabled","enabled","useReanimatedFocusedInput","input","layout","useFocusedInputHandler","setInputHandlers"],"sources":["index.ts"],"sourcesContent":["import { useEffect } from \"react\";\r\n\r\nimport { KeyboardController } from \"../bindings\";\r\nimport { AndroidSoftInputModes } from \"../constants\";\r\nimport { useKeyboardContext } from \"../context\";\r\nimport { uuid } from \"../utils\";\r\n\r\nimport type { AnimatedContext, ReanimatedContext } from \"../context\";\r\nimport type { FocusedInputHandler, KeyboardHandler } from \"../types\";\r\nimport type { DependencyList } from \"react\";\r\n\r\nexport const useResizeMode = () => {\r\n useEffect(() => {\r\n KeyboardController.setInputMode(\r\n AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,\r\n );\r\n\r\n return () => KeyboardController.setDefaultMode();\r\n }, []);\r\n};\r\n\r\nexport const useKeyboardAnimation = (): AnimatedContext => {\r\n useResizeMode();\r\n const context = useKeyboardContext();\r\n\r\n return context.animated;\r\n};\r\n\r\nexport const useReanimatedKeyboardAnimation = (): ReanimatedContext => {\r\n useResizeMode();\r\n const context = useKeyboardContext();\r\n\r\n return context.reanimated;\r\n};\r\n\r\nexport function useGenericKeyboardHandler(\r\n handler: KeyboardHandler,\r\n deps?: DependencyList,\r\n) {\r\n const context = useKeyboardContext();\r\n\r\n useEffect(() => {\r\n const key = uuid();\r\n\r\n context.setKeyboardHandlers({ [key]: handler });\r\n\r\n return () => {\r\n context.setKeyboardHandlers({ [key]: undefined });\r\n };\r\n }, deps);\r\n}\r\n\r\nexport function useKeyboardHandler(\r\n handler: KeyboardHandler,\r\n deps?: DependencyList,\r\n) {\r\n useResizeMode();\r\n useGenericKeyboardHandler(handler, deps);\r\n}\r\n\r\nexport function useKeyboardController() {\r\n const context = useKeyboardContext();\r\n\r\n return { setEnabled: context.setEnabled, enabled: context.enabled };\r\n}\r\n\r\nexport function useReanimatedFocusedInput() {\r\n const context = useKeyboardContext();\r\n\r\n return { input: context.layout };\r\n}\r\n\r\nexport function useFocusedInputHandler(\r\n handler?: FocusedInputHandler,\r\n deps?: DependencyList,\r\n) {\r\n const context = useKeyboardContext();\r\n\r\n useEffect(() => {\r\n const key = uuid();\r\n\r\n context.setInputHandlers({ [key]: handler });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AC,MAAM;IACd,MAAMV,GAAG,GAAG,IAAAyB,WAAI,EAAC,CAAC;IAElBR,OAAO,CAACmB,gBAAgB,CAAC;MAAE,CAACpC,GAAG,GAAGuB;IAAQ,CAAC,CAAC;IAE5C,OAAO,MAAM;MACXN,OAAO,CAACmB,gBAAgB,CAAC;QAAE,CAACpC,GAAG,GAAG2B;MAAU,CAAC,CAAC;IAChD,CAAC;EACH,CAAC,EAAEH,IAAI,CAAC;AACV","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useWindowDimensions = void 0;
7
+ var _react = require("react");
8
+ var _bindings = require("../../bindings");
9
+ let initialDimensions = {
10
+ width: 0,
11
+ height: 0
12
+ };
13
+ _bindings.WindowDimensionsEvents.addListener("windowDidResize", e => {
14
+ initialDimensions = e;
15
+ });
16
+ const useWindowDimensions = () => {
17
+ const [dimensions, setDimensions] = (0, _react.useState)(initialDimensions);
18
+ (0, _react.useEffect)(() => {
19
+ const subscription = _bindings.WindowDimensionsEvents.addListener("windowDidResize", e => {
20
+ setDimensions(e);
21
+ });
22
+ return () => {
23
+ subscription.remove();
24
+ };
25
+ }, []);
26
+ return dimensions;
27
+ };
28
+ exports.useWindowDimensions = useWindowDimensions;
29
+ //# sourceMappingURL=index.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_bindings","initialDimensions","width","height","WindowDimensionsEvents","addListener","e","useWindowDimensions","dimensions","setDimensions","useState","useEffect","subscription","remove","exports"],"sources":["index.android.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\r\n\r\nimport { WindowDimensionsEvents } from \"../../bindings\";\r\n\r\nimport type { WindowDimensionsEventData } from \"../../types\";\r\n\r\nlet initialDimensions: WindowDimensionsEventData = {\r\n width: 0,\r\n height: 0,\r\n};\r\n\r\nWindowDimensionsEvents.addListener(\"windowDidResize\", (e) => {\r\n initialDimensions = e;\r\n});\r\n\r\nexport const useWindowDimensions = () => {\r\n const [dimensions, setDimensions] = useState(initialDimensions);\r\n\r\n useEffect(() => {\r\n const subscription = WindowDimensionsEvents.addListener(\r\n \"windowDidResize\",\r\n (e) => {\r\n setDimensions(e);\r\n },\r\n );\r\n\r\n return () => {\r\n subscription.remove();\r\n };\r\n }, []);\r\n\r\n return dimensions;\r\n};\r\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAIA,IAAIE,iBAA4C,GAAG;EACjDC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE;AACV,CAAC;AAEDC,gCAAsB,CAACC,WAAW,CAAC,iBAAiB,EAAGC,CAAC,IAAK;EAC3DL,iBAAiB,GAAGK,CAAC;AACvB,CAAC,CAAC;AAEK,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,EAACT,iBAAiB,CAAC;EAE/D,IAAAU,gBAAS,EAAC,MAAM;IACd,MAAMC,YAAY,GAAGR,gCAAsB,CAACC,WAAW,CACrD,iBAAiB,EAChBC,CAAC,IAAK;MACLG,aAAa,CAACH,CAAC,CAAC;IAClB,CACF,CAAC;IAED,OAAO,MAAM;MACXM,YAAY,CAACC,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOL,UAAU;AACnB,CAAC;AAACM,OAAA,CAAAP,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "useWindowDimensions", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _reactNative.useWindowDimensions;
10
+ }
11
+ });
12
+ var _reactNative = require("react-native");
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require"],"sources":["index.ts"],"sourcesContent":["export { useWindowDimensions } from \"react-native\";\r\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ KeyboardAvoidingView: true,
8
+ KeyboardStickyView: true,
9
+ KeyboardAwareScrollView: true,
10
+ KeyboardToolbar: true,
11
+ DefaultKeyboardToolbarTheme: true
12
+ };
13
+ Object.defineProperty(exports, "DefaultKeyboardToolbarTheme", {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _components.DefaultKeyboardToolbarTheme;
17
+ }
18
+ });
19
+ Object.defineProperty(exports, "KeyboardAvoidingView", {
20
+ enumerable: true,
21
+ get: function () {
22
+ return _components.KeyboardAvoidingView;
23
+ }
24
+ });
25
+ Object.defineProperty(exports, "KeyboardAwareScrollView", {
26
+ enumerable: true,
27
+ get: function () {
28
+ return _components.KeyboardAwareScrollView;
29
+ }
30
+ });
31
+ Object.defineProperty(exports, "KeyboardStickyView", {
32
+ enumerable: true,
33
+ get: function () {
34
+ return _components.KeyboardStickyView;
35
+ }
36
+ });
37
+ Object.defineProperty(exports, "KeyboardToolbar", {
38
+ enumerable: true,
39
+ get: function () {
40
+ return _components.KeyboardToolbar;
41
+ }
42
+ });
43
+ var _bindings = require("./bindings");
44
+ Object.keys(_bindings).forEach(function (key) {
45
+ if (key === "default" || key === "__esModule") return;
46
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
47
+ if (key in exports && exports[key] === _bindings[key]) return;
48
+ Object.defineProperty(exports, key, {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _bindings[key];
52
+ }
53
+ });
54
+ });
55
+ var _animated = require("./animated");
56
+ Object.keys(_animated).forEach(function (key) {
57
+ if (key === "default" || key === "__esModule") return;
58
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
59
+ if (key in exports && exports[key] === _animated[key]) return;
60
+ Object.defineProperty(exports, key, {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _animated[key];
64
+ }
65
+ });
66
+ });
67
+ var _context = require("./context");
68
+ Object.keys(_context).forEach(function (key) {
69
+ if (key === "default" || key === "__esModule") return;
70
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
71
+ if (key in exports && exports[key] === _context[key]) return;
72
+ Object.defineProperty(exports, key, {
73
+ enumerable: true,
74
+ get: function () {
75
+ return _context[key];
76
+ }
77
+ });
78
+ });
79
+ var _hooks = require("./hooks");
80
+ Object.keys(_hooks).forEach(function (key) {
81
+ if (key === "default" || key === "__esModule") return;
82
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
83
+ if (key in exports && exports[key] === _hooks[key]) return;
84
+ Object.defineProperty(exports, key, {
85
+ enumerable: true,
86
+ get: function () {
87
+ return _hooks[key];
88
+ }
89
+ });
90
+ });
91
+ var _constants = require("./constants");
92
+ Object.keys(_constants).forEach(function (key) {
93
+ if (key === "default" || key === "__esModule") return;
94
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
95
+ if (key in exports && exports[key] === _constants[key]) return;
96
+ Object.defineProperty(exports, key, {
97
+ enumerable: true,
98
+ get: function () {
99
+ return _constants[key];
100
+ }
101
+ });
102
+ });
103
+ var _types = require("./types");
104
+ Object.keys(_types).forEach(function (key) {
105
+ if (key === "default" || key === "__esModule") return;
106
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
107
+ if (key in exports && exports[key] === _types[key]) return;
108
+ Object.defineProperty(exports, key, {
109
+ enumerable: true,
110
+ get: function () {
111
+ return _types[key];
112
+ }
113
+ });
114
+ });
115
+ var _components = require("./components");
116
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_bindings","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_animated","_context","_hooks","_constants","_types","_components"],"sources":["index.ts"],"sourcesContent":["export * from \"./bindings\";\r\nexport * from \"./animated\";\r\nexport * from \"./context\";\r\nexport * from \"./hooks\";\r\nexport * from \"./constants\";\r\nexport * from \"./types\";\r\n\r\nexport {\r\n KeyboardAvoidingView,\r\n KeyboardStickyView,\r\n KeyboardAwareScrollView,\r\n // keyboard toolbar\r\n KeyboardToolbar,\r\n DefaultKeyboardToolbarTheme,\r\n} from \"./components\";\r\nexport type {\r\n KeyboardAvoidingViewProps,\r\n KeyboardStickyViewProps,\r\n KeyboardAwareScrollViewProps,\r\n KeyboardToolbarProps,\r\n} from \"./components\";\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,SAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,SAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,SAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,O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A,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAY,UAAA,CAAAZ,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,UAAA,CAAAZ,GAAA;IAAA;EAAA;AAAA;AACA,IAAAa,MAAA,GAAAjB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAe,MAAA,EAAAd,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAa,MAAA,CAAAb,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,MAAA,CAAAb,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAc,WAAA,GAAAlB,OAAA","ignoreList":[]}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useAnimatedValue = useAnimatedValue;
7
+ exports.useSharedHandlers = useSharedHandlers;
8
+ var _react = require("react");
9
+ var _reactNative = require("react-native");
10
+ var _reactNativeReanimated = require("react-native-reanimated");
11
+ /**
12
+ * Hook for storing worklet handlers (objects with keys, where values are worklets).
13
+ * Returns methods for setting handlers and broadcasting events in them.
14
+ *
15
+ * T is a generic that looks like:
16
+ * @example
17
+ * {
18
+ * onEvent: () => {},
19
+ * onEvent2: () => {},
20
+ * }
21
+ */
22
+ function useSharedHandlers() {
23
+ const handlers = (0, _reactNativeReanimated.useSharedValue)({});
24
+ const jsHandlers = (0, _react.useRef)({});
25
+
26
+ // since js -> worklet -> js call is asynchronous, we can not write handlers
27
+ // straight into shared variable (using current shared value as a previous result),
28
+ // since there may be a race condition in a call, and closure may have out-of-dated
29
+ // values. As a result, some of handlers may be not written to "all handlers" object.
30
+ // Below we are writing all handlers to `ref` and afterwards synchronize them with
31
+ // shared value (since `refs` are not referring to actual value in worklets).
32
+ // This approach allow us to update synchronously handlers in js thread (and it assures,
33
+ // that it will have all of them) and then update them in worklet thread (calls are
34
+ // happening in FIFO order, so we will always have actual value).
35
+ const updateSharedHandlers = () => {
36
+ // eslint-disable-next-line react-compiler/react-compiler
37
+ handlers.value = jsHandlers.current;
38
+ };
39
+ const setHandlers = (0, _react.useCallback)(handler => {
40
+ jsHandlers.current = {
41
+ ...jsHandlers.current,
42
+ ...handler
43
+ };
44
+ updateSharedHandlers();
45
+ }, []);
46
+ const broadcast = (type, event) => {
47
+ "worklet";
48
+
49
+ Object.keys(handlers.value).forEach(key => {
50
+ var _handlers$value$key, _handlers$value$key$t;
51
+ (_handlers$value$key = handlers.value[key]) === null || _handlers$value$key === void 0 || (_handlers$value$key$t = _handlers$value$key[type]) === null || _handlers$value$key$t === void 0 || _handlers$value$key$t.call(_handlers$value$key, event);
52
+ });
53
+ };
54
+ return [setHandlers, broadcast];
55
+ }
56
+
57
+ /**
58
+ * TS variant of `useAnimatedValue` hook which is added in RN 0.71
59
+ * A better alternative of storing animated values in refs, since
60
+ * it doesn't recreate a new `Animated.Value` object on every re-render
61
+ * and therefore consumes less memory. We can not use a variant from
62
+ * RN, since this library supports earlier versions of RN.
63
+ *
64
+ * @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937
65
+ */
66
+ function useAnimatedValue(initialValue, config) {
67
+ const ref = (0, _react.useRef)(null);
68
+ if (ref.current == null) {
69
+ ref.current = new _reactNative.Animated.Value(initialValue, config);
70
+ }
71
+ return ref.current;
72
+ }
73
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","useSharedHandlers","handlers","useSharedValue","jsHandlers","useRef","updateSharedHandlers","value","current","setHandlers","useCallback","handler","broadcast","type","event","Object","keys","forEach","key","_handlers$value$key","_handlers$value$key$t","call","useAnimatedValue","initialValue","config","ref","Animated","Value"],"sources":["internal.ts"],"sourcesContent":["import { useCallback, useRef } from \"react\";\r\nimport { Animated } from \"react-native\";\r\nimport { useSharedValue } from \"react-native-reanimated\";\r\n\r\nimport type { Handlers } from \"./types\";\r\n\r\ntype UntypedHandler = Record<string, (event: never) => void>;\r\ntype SharedHandlersReturnType<T extends UntypedHandler> = [\r\n (handler: Handlers<T>) => void,\r\n <K extends keyof T>(type: K, event: Parameters<T[K]>[0]) => void,\r\n];\r\n\r\n/**\r\n * Hook for storing worklet handlers (objects with keys, where values are worklets).\r\n * Returns methods for setting handlers and broadcasting events in them.\r\n *\r\n * T is a generic that looks like:\r\n * @example\r\n * {\r\n * onEvent: () => {},\r\n * onEvent2: () => {},\r\n * }\r\n */\r\nexport function useSharedHandlers<\r\n T extends UntypedHandler,\r\n>(): SharedHandlersReturnType<T> {\r\n const handlers = useSharedValue<Handlers<T>>({});\r\n const jsHandlers = useRef<Handlers<T>>({});\r\n\r\n // since js -> worklet -> js call is asynchronous, we can not write handlers\r\n // straight into shared variable (using current shared value as a previous result),\r\n // since there may be a race condition in a call, and closure may have out-of-dated\r\n // values. As a result, some of handlers may be not written to \"all handlers\" object.\r\n // Below we are writing all handlers to `ref` and afterwards synchronize them with\r\n // shared value (since `refs` are not referring to actual value in worklets).\r\n // This approach allow us to update synchronously handlers in js thread (and it assures,\r\n // that it will have all of them) and then update them in worklet thread (calls are\r\n // happening in FIFO order, so we will always have actual value).\r\n const updateSharedHandlers = () => {\r\n // eslint-disable-next-line react-compiler/react-compiler\r\n handlers.value = jsHandlers.current;\r\n };\r\n const setHandlers = useCallback((handler: Handlers<T>) => {\r\n jsHandlers.current = {\r\n ...jsHandlers.current,\r\n ...handler,\r\n };\r\n updateSharedHandlers();\r\n }, []);\r\n const broadcast = <K extends keyof T>(\r\n type: K,\r\n event: Parameters<T[K]>[0],\r\n ) => {\r\n \"worklet\";\r\n\r\n Object.keys(handlers.value).forEach((key) => {\r\n handlers.value[key]?.[type]?.(event);\r\n });\r\n };\r\n\r\n return [setHandlers, broadcast];\r\n}\r\n\r\n/**\r\n * TS variant of `useAnimatedValue` hook which is added in RN 0.71\r\n * A better alternative of storing animated values in refs, since\r\n * it doesn't recreate a new `Animated.Value` object on every re-render\r\n * and therefore consumes less memory. We can not use a variant from\r\n * RN, since this library supports earlier versions of RN.\r\n *\r\n * @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937\r\n */\r\nexport function useAnimatedValue(\r\n initialValue: number,\r\n config?: Animated.AnimatedConfig,\r\n): Animated.Value {\r\n const ref = useRef<Animated.Value | null>(null);\r\n\r\n if (ref.current == null) {\r\n ref.current = new Animated.Value(initialValue, config);\r\n }\r\n\r\n return ref.current;\r\n}\r\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,iBAAiBA,CAAA,EAEA;EAC/B,MAAMC,QAAQ,GAAG,IAAAC,qCAAc,EAAc,CAAC,CAAC,CAAC;EAChD,MAAMC,UAAU,GAAG,IAAAC,aAAM,EAAc,CAAC,CAAC,CAAC;;EAE1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;IACjC;IACAJ,QAAQ,CAACK,KAAK,GAAGH,UAAU,CAACI,OAAO;EACrC,CAAC;EACD,MAAMC,WAAW,GAAG,IAAAC,kBAAW,EAAEC,OAAoB,IAAK;IACxDP,UAAU,CAACI,OAAO,GAAG;MACnB,GAAGJ,UAAU,CAACI,OAAO;MACrB,GAAGG;IACL,CAAC;IACDL,oBAAoB,CAAC,CAAC;EACxB,CAAC,EAAE,EAAE,CAAC;EACN,MAAMM,SAAS,GAAGA,CAChBC,IAAO,EACPC,KAA0B,KACvB;IACH,SAAS;;IAETC,MAAM,CAACC,IAAI,CAACd,QAAQ,CAACK,KAAK,CAAC,CAACU,OAAO,CAAEC,GAAG,IAAK;MAAA,IAAAC,mBAAA,EAAAC,qBAAA;MAC3C,CAAAD,mBAAA,GAAAjB,QAAQ,CAACK,KAAK,CAACW,GAAG,CAAC,cAAAC,mBAAA,gBAAAC,qBAAA,GAAnBD,mBAAA,CAAsBN,IAAI,CAAC,cAAAO,qBAAA,eAA3BA,qBAAA,CAAAC,IAAA,CAAAF,mBAAA,EAA8BL,KAAK,CAAC;IACtC,CAAC,CAAC;EACJ,CAAC;EAED,OAAO,CAACL,WAAW,EAAEG,SAAS,CAAC;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASU,gBAAgBA,CAC9BC,YAAoB,EACpBC,MAAgC,EAChB;EAChB,MAAMC,GAAG,GAAG,IAAApB,aAAM,EAAwB,IAAI,CAAC;EAE/C,IAAIoB,GAAG,CAACjB,OAAO,IAAI,IAAI,EAAE;IACvBiB,GAAG,CAACjB,OAAO,GAAG,IAAIkB,qBAAQ,CAACC,KAAK,CAACJ,YAAY,EAAEC,MAAM,CAAC;EACxD;EAEA,OAAOC,GAAG,CAACjB,OAAO;AACpB","ignoreList":[]}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.revertMonkeyPatch = exports.applyMonkeyPatch = void 0;
7
+ var NativeAndroidManager = _interopRequireWildcard(require("react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid"));
8
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
9
+ // @ts-expect-error because there is no corresponding type definition
10
+
11
+ const RCTStatusBarManagerCompat =
12
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
13
+ require("./specs/NativeStatusBarManagerCompat").default;
14
+
15
+ // Copy original default manager to keep its original state and methods
16
+ const OriginalNativeAndroidManager = {
17
+ ...NativeAndroidManager.default
18
+ };
19
+
20
+ // Create a new object that modifies the necessary methods
21
+ // On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so
22
+ // in order to use library on all available platforms we have to monkey patch
23
+ // default RN implementation and use modern `WindowInsetsControllerCompat`.
24
+ const ModifiedNativeAndroidManager = {
25
+ ...NativeAndroidManager.default,
26
+ // Spread original properties to keep existing functionality
27
+ setColor: (color, animated) => {
28
+ RCTStatusBarManagerCompat.setColor(color, animated);
29
+ },
30
+ setTranslucent: translucent => {
31
+ RCTStatusBarManagerCompat.setTranslucent(translucent);
32
+ },
33
+ /**
34
+ * - statusBarStyles can be:
35
+ * - 'default'
36
+ * - 'dark-content'
37
+ */
38
+ setStyle: statusBarStyle => {
39
+ RCTStatusBarManagerCompat.setStyle(statusBarStyle);
40
+ },
41
+ setHidden: hidden => {
42
+ RCTStatusBarManagerCompat.setHidden(hidden);
43
+ }
44
+ };
45
+
46
+ // Define a function to apply the monkey patch
47
+ const applyMonkeyPatch = () => {
48
+ Object.assign(NativeAndroidManager.default, ModifiedNativeAndroidManager);
49
+ };
50
+
51
+ // Define a function to revert changes back to the original state
52
+ exports.applyMonkeyPatch = applyMonkeyPatch;
53
+ const revertMonkeyPatch = () => {
54
+ Object.assign(NativeAndroidManager.default, OriginalNativeAndroidManager);
55
+ };
56
+ exports.revertMonkeyPatch = revertMonkeyPatch;
57
+ //# sourceMappingURL=monkey-patch.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeAndroidManager","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","RCTStatusBarManagerCompat","OriginalNativeAndroidManager","ModifiedNativeAndroidManager","setColor","color","animated","setTranslucent","translucent","setStyle","statusBarStyle","setHidden","hidden","applyMonkeyPatch","assign","exports","revertMonkeyPatch"],"sources":["monkey-patch.android.ts"],"sourcesContent":["// @ts-expect-error because there is no corresponding type definition\r\nimport * as NativeAndroidManager from \"react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid\";\r\n\r\nconst RCTStatusBarManagerCompat =\r\n // eslint-disable-next-line @typescript-eslint/no-var-requires\r\n require(\"./specs/NativeStatusBarManagerCompat\").default;\r\n\r\n// Copy original default manager to keep its original state and methods\r\nconst OriginalNativeAndroidManager = { ...NativeAndroidManager.default };\r\n\r\n// Create a new object that modifies the necessary methods\r\n// On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so\r\n// in order to use library on all available platforms we have to monkey patch\r\n// default RN implementation and use modern `WindowInsetsControllerCompat`.\r\nconst ModifiedNativeAndroidManager = {\r\n ...NativeAndroidManager.default, // Spread original properties to keep existing functionality\r\n setColor: (color: number, animated: boolean): void => {\r\n RCTStatusBarManagerCompat.setColor(color, animated);\r\n },\r\n setTranslucent: (translucent: boolean): void => {\r\n RCTStatusBarManagerCompat.setTranslucent(translucent);\r\n },\r\n /**\r\n * - statusBarStyles can be:\r\n * - 'default'\r\n * - 'dark-content'\r\n */\r\n setStyle: (statusBarStyle?: string): void => {\r\n RCTStatusBarManagerCompat.setStyle(statusBarStyle);\r\n },\r\n setHidden: (hidden: boolean): void => {\r\n RCTStatusBarManagerCompat.setHidden(hidden);\r\n },\r\n};\r\n\r\n// Define a function to apply the monkey patch\r\nexport const applyMonkeyPatch = () => {\r\n Object.assign(NativeAndroidManager.default, ModifiedNativeAndroidManager);\r\n};\r\n\r\n// Define a function to revert changes back to the original state\r\nexport const revertMonkeyPatch = () => {\r\n Object.assign(NativeAndroidManager.default, OriginalNativeAndroidManager);\r\n};\r\n"],"mappings":";;;;;;AACA,IAAAA,oBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAkH,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,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,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AADlH;;AAGA,MAAMkB,yBAAyB;AAC7B;AACApB,OAAO,CAAC,sCAAsC,CAAC,CAACW,OAAO;;AAEzD;AACA,MAAMU,4BAA4B,GAAG;EAAE,GAAGvB,oBAAoB,CAACa;AAAQ,CAAC;;AAExE;AACA;AACA;AACA;AACA,MAAMW,4BAA4B,GAAG;EACnC,GAAGxB,oBAAoB,CAACa,OAAO;EAAE;EACjCY,QAAQ,EAAEA,CAACC,KAAa,EAAEC,QAAiB,KAAW;IACpDL,yBAAyB,CAACG,QAAQ,CAACC,KAAK,EAAEC,QAAQ,CAAC;EACrD,CAAC;EACDC,cAAc,EAAGC,WAAoB,IAAW;IAC9CP,yBAAyB,CAACM,cAAc,CAACC,WAAW,CAAC;EACvD,CAAC;EACD;AACF;AACA;AACA;AACA;EACEC,QAAQ,EAAGC,cAAuB,IAAW;IAC3CT,yBAAyB,CAACQ,QAAQ,CAACC,cAAc,CAAC;EACpD,CAAC;EACDC,SAAS,EAAGC,MAAe,IAAW;IACpCX,yBAAyB,CAACU,SAAS,CAACC,MAAM,CAAC;EAC7C;AACF,CAAC;;AAED;AACO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EACpCf,MAAM,CAACgB,MAAM,CAACnC,oBAAoB,CAACa,OAAO,EAAEW,4BAA4B,CAAC;AAC3E,CAAC;;AAED;AAAAY,OAAA,CAAAF,gBAAA,GAAAA,gBAAA;AACO,MAAMG,iBAAiB,GAAGA,CAAA,KAAM;EACrClB,MAAM,CAACgB,MAAM,CAACnC,oBAAoB,CAACa,OAAO,EAAEU,4BAA4B,CAAC;AAC3E,CAAC;AAACa,OAAA,CAAAC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.revertMonkeyPatch = exports.applyMonkeyPatch = void 0;
7
+ // stub for all platforms
8
+ const NOOP = () => {};
9
+ const applyMonkeyPatch = exports.applyMonkeyPatch = NOOP;
10
+ const revertMonkeyPatch = exports.revertMonkeyPatch = NOOP;
11
+ //# sourceMappingURL=monkey-patch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NOOP","applyMonkeyPatch","exports","revertMonkeyPatch"],"sources":["monkey-patch.ts"],"sourcesContent":["// stub for all platforms\r\nconst NOOP = () => {};\r\nexport const applyMonkeyPatch = NOOP;\r\nexport const revertMonkeyPatch = NOOP;\r\n"],"mappings":";;;;;;AAAA;AACA,MAAMA,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACd,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGD,IAAI;AAC7B,MAAMG,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,GAAGH,IAAI","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useFocusedInputTextHandler = exports.useFocusedInputSelectionHandler = exports.useFocusedInputLayoutHandler = exports.useAnimatedKeyboardHandler = void 0;
7
+ const NOOP = () => () => {};
8
+ const useAnimatedKeyboardHandler = exports.useAnimatedKeyboardHandler = NOOP;
9
+ const useFocusedInputLayoutHandler = exports.useFocusedInputLayoutHandler = NOOP;
10
+ const useFocusedInputTextHandler = exports.useFocusedInputTextHandler = NOOP;
11
+ const useFocusedInputSelectionHandler = exports.useFocusedInputSelectionHandler = NOOP;
12
+ //# sourceMappingURL=reanimated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NOOP","useAnimatedKeyboardHandler","exports","useFocusedInputLayoutHandler","useFocusedInputTextHandler","useFocusedInputSelectionHandler"],"sources":["reanimated.ts"],"sourcesContent":["import type {\r\n EventWithName,\r\n FocusedInputLayoutChangedEvent,\r\n FocusedInputLayoutHandlerHook,\r\n FocusedInputSelectionChangedEvent,\r\n FocusedInputSelectionHandlerHook,\r\n FocusedInputTextChangedEvent,\r\n FocusedInputTextHandlerHook,\r\n KeyboardHandlerHook,\r\n NativeEvent,\r\n} from \"./types\";\r\n\r\nconst NOOP = () => () => {};\r\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\r\n Record<string, unknown>,\r\n EventWithName<NativeEvent>\r\n> = NOOP;\r\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\r\n Record<string, unknown>,\r\n EventWithName<FocusedInputLayoutChangedEvent>\r\n> = NOOP;\r\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\r\n Record<string, unknown>,\r\n EventWithName<FocusedInputTextChangedEvent>\r\n> = NOOP;\r\nexport const useFocusedInputSelectionHandler: FocusedInputSelectionHandlerHook<\r\n Record<string, unknown>,\r\n EventWithName<FocusedInputSelectionChangedEvent>\r\n> = NOOP;\r\n"],"mappings":";;;;;;AAYA,MAAMA,IAAI,GAAGA,CAAA,KAAM,MAAM,CAAC,CAAC;AACpB,MAAMC,0BAGZ,GAAAC,OAAA,CAAAD,0BAAA,GAAGD,IAAI;AACD,MAAMG,4BAGZ,GAAAD,OAAA,CAAAC,4BAAA,GAAGH,IAAI;AACD,MAAMI,0BAGZ,GAAAF,OAAA,CAAAE,0BAAA,GAAGJ,IAAI;AACD,MAAMK,+BAGZ,GAAAH,OAAA,CAAAG,+BAAA,GAAGL,IAAI","ignoreList":[]}