react-native-keyboard-controller 1.10.0 → 1.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/EditText.kt +31 -1
  2. package/ios/.clang-format +30 -30
  3. package/ios/.swiftlint.yml +1 -1
  4. package/ios/observers/FocusedInputObserver.swift +1 -0
  5. package/ios/views/KeyboardControllerViewManager.swift +12 -2
  6. package/jest/index.js +14 -4
  7. package/lib/commonjs/animated.js +19 -19
  8. package/lib/commonjs/animated.js.map +1 -1
  9. package/lib/commonjs/bindings.js.map +1 -1
  10. package/lib/commonjs/bindings.native.js +6 -6
  11. package/lib/commonjs/bindings.native.js.map +1 -1
  12. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js +19 -5
  13. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js.map +1 -1
  14. package/lib/commonjs/components/KeyboardAvoidingView/index.js +12 -7
  15. package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
  16. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +10 -8
  17. package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
  18. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +5 -5
  19. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
  20. package/lib/commonjs/components/KeyboardAwareScrollView/utils.js +2 -2
  21. package/lib/commonjs/components/KeyboardAwareScrollView/utils.js.map +1 -1
  22. package/lib/commonjs/components/KeyboardStickyView/index.js +9 -5
  23. package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -1
  24. package/lib/commonjs/components/hooks/useKeyboardInterpolation.js +88 -0
  25. package/lib/commonjs/components/hooks/useKeyboardInterpolation.js.map +1 -0
  26. package/lib/commonjs/components/index.js.map +1 -1
  27. package/lib/commonjs/constants.js.map +1 -1
  28. package/lib/commonjs/context.js.map +1 -1
  29. package/lib/commonjs/hooks.js.map +1 -1
  30. package/lib/commonjs/index.js.map +1 -1
  31. package/lib/commonjs/internal.js +1 -1
  32. package/lib/commonjs/internal.js.map +1 -1
  33. package/lib/commonjs/monkey-patch.android.js +1 -1
  34. package/lib/commonjs/monkey-patch.android.js.map +1 -1
  35. package/lib/commonjs/monkey-patch.js.map +1 -1
  36. package/lib/commonjs/reanimated.js.map +1 -1
  37. package/lib/commonjs/reanimated.native.js +12 -12
  38. package/lib/commonjs/reanimated.native.js.map +1 -1
  39. package/lib/commonjs/replicas.js +5 -5
  40. package/lib/commonjs/replicas.js.map +1 -1
  41. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js +1 -1
  42. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  43. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js +2 -2
  44. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  45. package/lib/commonjs/specs/NativeKeyboardController.js +1 -1
  46. package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
  47. package/lib/commonjs/specs/NativeStatusBarManagerCompat.js +1 -1
  48. package/lib/commonjs/specs/NativeStatusBarManagerCompat.js.map +1 -1
  49. package/lib/commonjs/types.js.map +1 -1
  50. package/lib/commonjs/utils.js.map +1 -1
  51. package/lib/module/animated.js +27 -27
  52. package/lib/module/animated.js.map +1 -1
  53. package/lib/module/bindings.js +1 -1
  54. package/lib/module/bindings.js.map +1 -1
  55. package/lib/module/bindings.native.js +7 -7
  56. package/lib/module/bindings.native.js.map +1 -1
  57. package/lib/module/components/KeyboardAvoidingView/hooks.js +19 -5
  58. package/lib/module/components/KeyboardAvoidingView/hooks.js.map +1 -1
  59. package/lib/module/components/KeyboardAvoidingView/index.js +15 -11
  60. package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
  61. package/lib/module/components/KeyboardAwareScrollView/index.js +16 -14
  62. package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
  63. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +8 -8
  64. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
  65. package/lib/module/components/KeyboardAwareScrollView/utils.js +2 -2
  66. package/lib/module/components/KeyboardAwareScrollView/utils.js.map +1 -1
  67. package/lib/module/components/KeyboardStickyView/index.js +9 -6
  68. package/lib/module/components/KeyboardStickyView/index.js.map +1 -1
  69. package/lib/module/components/hooks/useKeyboardInterpolation.js +81 -0
  70. package/lib/module/components/hooks/useKeyboardInterpolation.js.map +1 -0
  71. package/lib/module/components/index.js +3 -3
  72. package/lib/module/components/index.js.map +1 -1
  73. package/lib/module/context.js +2 -2
  74. package/lib/module/context.js.map +1 -1
  75. package/lib/module/hooks.js +5 -5
  76. package/lib/module/hooks.js.map +1 -1
  77. package/lib/module/index.js +8 -8
  78. package/lib/module/index.js.map +1 -1
  79. package/lib/module/internal.js +4 -4
  80. package/lib/module/internal.js.map +1 -1
  81. package/lib/module/monkey-patch.android.js +2 -2
  82. package/lib/module/monkey-patch.android.js.map +1 -1
  83. package/lib/module/monkey-patch.js.map +1 -1
  84. package/lib/module/reanimated.js.map +1 -1
  85. package/lib/module/reanimated.native.js +13 -13
  86. package/lib/module/reanimated.native.js.map +1 -1
  87. package/lib/module/replicas.js +11 -11
  88. package/lib/module/replicas.js.map +1 -1
  89. package/lib/module/specs/KeyboardControllerViewNativeComponent.js +2 -2
  90. package/lib/module/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  91. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js +3 -3
  92. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  93. package/lib/module/specs/NativeKeyboardController.js +2 -2
  94. package/lib/module/specs/NativeKeyboardController.js.map +1 -1
  95. package/lib/module/specs/NativeStatusBarManagerCompat.js +2 -2
  96. package/lib/module/specs/NativeStatusBarManagerCompat.js.map +1 -1
  97. package/lib/module/types.js.map +1 -1
  98. package/lib/module/utils.js.map +1 -1
  99. package/lib/typescript/animated.d.ts +1 -1
  100. package/lib/typescript/bindings.d.ts +1 -1
  101. package/lib/typescript/bindings.native.d.ts +1 -1
  102. package/lib/typescript/components/KeyboardAvoidingView/index.d.ts +4 -4
  103. package/lib/typescript/components/KeyboardAwareScrollView/index.d.ts +2 -2
  104. package/lib/typescript/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.d.ts +1 -1
  105. package/lib/typescript/components/KeyboardStickyView/index.d.ts +2 -2
  106. package/lib/typescript/components/hooks/useKeyboardInterpolation.d.ts +20 -0
  107. package/lib/typescript/components/index.d.ts +3 -3
  108. package/lib/typescript/context.d.ts +4 -4
  109. package/lib/typescript/hooks.d.ts +3 -3
  110. package/lib/typescript/index.d.ts +8 -8
  111. package/lib/typescript/internal.d.ts +2 -2
  112. package/lib/typescript/reanimated.d.ts +1 -1
  113. package/lib/typescript/reanimated.native.d.ts +1 -1
  114. package/lib/typescript/replicas.d.ts +1 -1
  115. package/lib/typescript/specs/KeyboardControllerViewNativeComponent.d.ts +3 -3
  116. package/lib/typescript/specs/KeyboardGestureAreaNativeComponent.d.ts +4 -4
  117. package/lib/typescript/specs/NativeKeyboardController.d.ts +1 -1
  118. package/lib/typescript/specs/NativeStatusBarManagerCompat.d.ts +1 -1
  119. package/lib/typescript/types.d.ts +3 -3
  120. package/package.json +8 -10
  121. package/src/animated.tsx +39 -39
  122. package/src/bindings.native.ts +11 -11
  123. package/src/bindings.ts +3 -3
  124. package/src/components/KeyboardAvoidingView/hooks.ts +20 -6
  125. package/src/components/KeyboardAvoidingView/index.tsx +25 -24
  126. package/src/components/KeyboardAwareScrollView/index.tsx +29 -25
  127. package/src/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +13 -13
  128. package/src/components/KeyboardAwareScrollView/utils.ts +3 -3
  129. package/src/components/KeyboardStickyView/index.tsx +12 -12
  130. package/src/components/hooks/useKeyboardInterpolation.ts +108 -0
  131. package/src/components/index.ts +3 -3
  132. package/src/context.ts +7 -7
  133. package/src/hooks.ts +12 -12
  134. package/src/index.ts +8 -8
  135. package/src/internal.ts +9 -9
  136. package/src/monkey-patch.android.ts +2 -2
  137. package/src/reanimated.native.ts +20 -20
  138. package/src/reanimated.ts +1 -1
  139. package/src/replicas.ts +16 -16
  140. package/src/specs/KeyboardControllerViewNativeComponent.ts +5 -5
  141. package/src/specs/KeyboardGestureAreaNativeComponent.ts +7 -7
  142. package/src/specs/NativeKeyboardController.ts +3 -3
  143. package/src/specs/NativeStatusBarManagerCompat.ts +3 -3
  144. package/src/types.ts +21 -21
@@ -1 +1 @@
1
- {"version":3,"names":["useSharedHandlers","handlers","useSharedValue","jsHandlers","useRef","updateSharedHandlers","value","current","setHandlers","useCallback","handler","broadcast","type","event","Object","keys","forEach","key","useAnimatedValue","initialValue","config","ref","Animated","Value"],"sources":["internal.ts"],"sourcesContent":["import { useCallback, useRef } from 'react';\nimport { Animated } from 'react-native';\nimport { useSharedValue } from 'react-native-reanimated';\n\nimport type { Handlers } from './types';\n\ntype UntypedHandler = Record<string, (event: never) => void>;\ntype SharedHandlersReturnType<T extends UntypedHandler> = [\n (handler: Handlers<T>) => void,\n <K extends keyof T>(type: K, event: Parameters<T[K]>[0]) => void\n];\n\n/**\n * Hook for storing worklet handlers (objects with keys, where values are worklets).\n * Returns methods for setting handlers and broadcasting events in them.\n *\n * T is a generic that looks like:\n * @example\n * {\n * onEvent: () => {},\n * onEvent2: () => {},\n * }\n */\nexport function useSharedHandlers<\n T extends UntypedHandler\n>(): SharedHandlersReturnType<T> {\n const handlers = useSharedValue<Handlers<T>>({});\n const jsHandlers = useRef<Handlers<T>>({});\n\n // since js -> worklet -> js call is asynchronous, we can not write handlers\n // straight into shared variable (using current shared value as a previous result),\n // since there may be a race condition in a call, and closure may have out-of-dated\n // values. As a result, some of handlers may be not written to \"all handlers\" object.\n // Below we are writing all handlers to `ref` and afterwards synchronize them with\n // shared value (since `refs` are not referring to actual value in worklets).\n // This approach allow us to update synchronously handlers in js thread (and it assures,\n // that it will have all of them) and then update them in worklet thread (calls are\n // happening in FIFO order, so we will always have actual value).\n const updateSharedHandlers = () => {\n handlers.value = jsHandlers.current;\n };\n const setHandlers = useCallback((handler: Handlers<T>) => {\n jsHandlers.current = {\n ...jsHandlers.current,\n ...handler,\n };\n updateSharedHandlers();\n }, []);\n const broadcast = <K extends keyof T>(\n type: K,\n event: Parameters<T[K]>[0]\n ) => {\n 'worklet';\n\n Object.keys(handlers.value).forEach((key) => {\n handlers.value[key]?.[type]?.(event);\n });\n };\n\n return [setHandlers, broadcast];\n}\n\n/**\n * TS variant of `useAnimatedValue` hook which is added in RN 0.71\n * A better alternative of storing animated values in refs, since\n * it doesn't recreate a new `Animated.Value` object on every re-render\n * and therefore consumes less memory. We can not use a variant from\n * RN, since this library supports earlier versions of RN.\n *\n * @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937\n */\nexport function useAnimatedValue(\n initialValue: number,\n config?: Animated.AnimatedConfig\n): Animated.Value {\n const ref = useRef<Animated.Value | null>(null);\n\n if (ref.current == null) {\n ref.current = new Animated.Value(initialValue, config);\n }\n\n return ref.current;\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,iBAAiB,GAEA;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,GAAG,MAAM;IACjCJ,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,EAAE;EACxB,CAAC,EAAE,EAAE,CAAC;EACN,MAAMM,SAAS,GAAG,CAChBC,IAAO,EACPC,KAA0B,KACvB;IACH,SAAS;;IAETC,MAAM,CAACC,IAAI,CAACd,QAAQ,CAACK,KAAK,CAAC,CAACU,OAAO,CAAEC,GAAG,IAAK;MAAA;MAC3C,uBAAAhB,QAAQ,CAACK,KAAK,CAACW,GAAG,CAAC,iFAAnB,oBAAsBL,IAAI,CAAC,0DAA3B,gDAA8BC,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,SAASO,gBAAgB,CAC9BC,YAAoB,EACpBC,MAAgC,EAChB;EAChB,MAAMC,GAAG,GAAG,IAAAjB,aAAM,EAAwB,IAAI,CAAC;EAE/C,IAAIiB,GAAG,CAACd,OAAO,IAAI,IAAI,EAAE;IACvBc,GAAG,CAACd,OAAO,GAAG,IAAIe,qBAAQ,CAACC,KAAK,CAACJ,YAAY,EAAEC,MAAM,CAAC;EACxD;EAEA,OAAOC,GAAG,CAACd,OAAO;AACpB"}
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\";\nimport { Animated } from \"react-native\";\nimport { useSharedValue } from \"react-native-reanimated\";\n\nimport type { Handlers } from \"./types\";\n\ntype UntypedHandler = Record<string, (event: never) => void>;\ntype SharedHandlersReturnType<T extends UntypedHandler> = [\n (handler: Handlers<T>) => void,\n <K extends keyof T>(type: K, event: Parameters<T[K]>[0]) => void,\n];\n\n/**\n * Hook for storing worklet handlers (objects with keys, where values are worklets).\n * Returns methods for setting handlers and broadcasting events in them.\n *\n * T is a generic that looks like:\n * @example\n * {\n * onEvent: () => {},\n * onEvent2: () => {},\n * }\n */\nexport function useSharedHandlers<\n T extends UntypedHandler,\n>(): SharedHandlersReturnType<T> {\n const handlers = useSharedValue<Handlers<T>>({});\n const jsHandlers = useRef<Handlers<T>>({});\n\n // since js -> worklet -> js call is asynchronous, we can not write handlers\n // straight into shared variable (using current shared value as a previous result),\n // since there may be a race condition in a call, and closure may have out-of-dated\n // values. As a result, some of handlers may be not written to \"all handlers\" object.\n // Below we are writing all handlers to `ref` and afterwards synchronize them with\n // shared value (since `refs` are not referring to actual value in worklets).\n // This approach allow us to update synchronously handlers in js thread (and it assures,\n // that it will have all of them) and then update them in worklet thread (calls are\n // happening in FIFO order, so we will always have actual value).\n const updateSharedHandlers = () => {\n handlers.value = jsHandlers.current;\n };\n const setHandlers = useCallback((handler: Handlers<T>) => {\n jsHandlers.current = {\n ...jsHandlers.current,\n ...handler,\n };\n updateSharedHandlers();\n }, []);\n const broadcast = <K extends keyof T>(\n type: K,\n event: Parameters<T[K]>[0],\n ) => {\n \"worklet\";\n\n Object.keys(handlers.value).forEach((key) => {\n handlers.value[key]?.[type]?.(event);\n });\n };\n\n return [setHandlers, broadcast];\n}\n\n/**\n * TS variant of `useAnimatedValue` hook which is added in RN 0.71\n * A better alternative of storing animated values in refs, since\n * it doesn't recreate a new `Animated.Value` object on every re-render\n * and therefore consumes less memory. We can not use a variant from\n * RN, since this library supports earlier versions of RN.\n *\n * @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937\n */\nexport function useAnimatedValue(\n initialValue: number,\n config?: Animated.AnimatedConfig,\n): Animated.Value {\n const ref = useRef<Animated.Value | null>(null);\n\n if (ref.current == null) {\n ref.current = new Animated.Value(initialValue, config);\n }\n\n return ref.current;\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA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;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"}
@@ -11,7 +11,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
11
11
 
12
12
  const DefaultNativeAndroidManager = NativeAndroidManager.default;
13
13
  const getConstants = NativeAndroidManager.default.getConstants;
14
- const RCTStatusBarManagerCompat = require('./specs/NativeStatusBarManagerCompat').default;
14
+ const RCTStatusBarManagerCompat = require("./specs/NativeStatusBarManagerCompat").default;
15
15
 
16
16
  // On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so
17
17
  // in order to use library on all available platforms we have to monkey patch
@@ -1 +1 @@
1
- {"version":3,"names":["DefaultNativeAndroidManager","NativeAndroidManager","default","getConstants","RCTStatusBarManagerCompat","require","applyMonkeyPatch","setColor","color","animated","setTranslucent","translucent","setStyle","statusBarStyle","setHidden","hidden","revertMonkeyPatch"],"sources":["monkey-patch.android.ts"],"sourcesContent":["// @ts-expect-error because there is no corresponding type definition\nimport * as NativeAndroidManager from 'react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid';\n\nconst DefaultNativeAndroidManager = NativeAndroidManager.default;\nconst getConstants = NativeAndroidManager.default.getConstants;\nconst RCTStatusBarManagerCompat =\n require('./specs/NativeStatusBarManagerCompat').default;\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`.\nexport const applyMonkeyPatch = () => {\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};\nexport const revertMonkeyPatch = () => {\n NativeAndroidManager.default = DefaultNativeAndroidManager;\n};\n"],"mappings":";;;;;;AACA;AAAkH;AAAA;AADlH;;AAGA,MAAMA,2BAA2B,GAAGC,oBAAoB,CAACC,OAAO;AAChE,MAAMC,YAAY,GAAGF,oBAAoB,CAACC,OAAO,CAACC,YAAY;AAC9D,MAAMC,yBAAyB,GAC7BC,OAAO,CAAC,sCAAsC,CAAC,CAACH,OAAO;;AAEzD;AACA;AACA;AACO,MAAMI,gBAAgB,GAAG,MAAM;EACpCL,oBAAoB,CAACC,OAAO,GAAG;IAC7BC,YAAY;IACZI,QAAQ,CAACC,KAAa,EAAEC,QAAiB,EAAQ;MAC/CL,yBAAyB,CAACG,QAAQ,CAACC,KAAK,EAAEC,QAAQ,CAAC;IACrD,CAAC;IAEDC,cAAc,CAACC,WAAoB,EAAQ;MACzCP,yBAAyB,CAACM,cAAc,CAACC,WAAW,CAAC;IACvD,CAAC;IAED;AACJ;AACA;AACA;AACA;IACIC,QAAQ,CAACC,cAAuB,EAAQ;MACtCT,yBAAyB,CAACQ,QAAQ,CAACC,cAAc,CAAC;IACpD,CAAC;IAEDC,SAAS,CAACC,MAAe,EAAQ;MAC/BX,yBAAyB,CAACU,SAAS,CAACC,MAAM,CAAC;IAC7C;EACF,CAAC;AACH,CAAC;AAAC;AACK,MAAMC,iBAAiB,GAAG,MAAM;EACrCf,oBAAoB,CAACC,OAAO,GAAGF,2BAA2B;AAC5D,CAAC;AAAC"}
1
+ {"version":3,"names":["NativeAndroidManager","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DefaultNativeAndroidManager","getConstants","RCTStatusBarManagerCompat","applyMonkeyPatch","setColor","color","animated","setTranslucent","translucent","setStyle","statusBarStyle","setHidden","hidden","exports","revertMonkeyPatch"],"sources":["monkey-patch.android.ts"],"sourcesContent":["// @ts-expect-error because there is no corresponding type definition\nimport * as NativeAndroidManager from \"react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid\";\n\nconst DefaultNativeAndroidManager = NativeAndroidManager.default;\nconst getConstants = NativeAndroidManager.default.getConstants;\nconst RCTStatusBarManagerCompat =\n require(\"./specs/NativeStatusBarManagerCompat\").default;\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`.\nexport const applyMonkeyPatch = () => {\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};\nexport const revertMonkeyPatch = () => {\n NativeAndroidManager.default = DefaultNativeAndroidManager;\n};\n"],"mappings":";;;;;;AACA,IAAAA,oBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAkH,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,i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AAQA,CAACC,KAAa,EAAEC,QAAiB,EAAQ;MAC/CJ,yBAAyB,CAACE,QAAQ,CAACC,KAAK,EAAEC,QAAQ,CAAC;IACrD,CAAC;IAEDC,cAAcA,CAACC,WAAoB,EAAQ;MACzCN,yBAAyB,CAACK,cAAc,CAACC,WAAW,CAAC;IACvD,CAAC;IAED;AACJ;AACA;AACA;AACA;IACIC,QAAQA,CAACC,cAAuB,EAAQ;MACtCR,yBAAyB,CAACO,QAAQ,CAACC,cAAc,CAAC;IACpD,CAAC;IAEDC,SAASA,CAACC,MAAe,EAAQ;MAC/BV,yBAAyB,CAACS,SAAS,CAACC,MAAM,CAAC;IAC7C;EACF,CAAC;AACH,CAAC;AAACC,OAAA,CAAAV,gBAAA,GAAAA,gBAAA;AACK,MAAMW,iBAAiB,GAAGA,CAAA,KAAM;EACrCvC,oBAAoB,CAACU,OAAO,GAAGe,2BAA2B;AAC5D,CAAC;AAACa,OAAA,CAAAC,iBAAA,GAAAA,iBAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["NOOP","applyMonkeyPatch","revertMonkeyPatch"],"sources":["monkey-patch.ts"],"sourcesContent":["// stub for all platforms\nconst NOOP = () => {};\nexport const applyMonkeyPatch = NOOP;\nexport const revertMonkeyPatch = NOOP;\n"],"mappings":";;;;;;AAAA;AACA,MAAMA,IAAI,GAAG,MAAM,CAAC,CAAC;AACd,MAAMC,gBAAgB,GAAGD,IAAI;AAAC;AAC9B,MAAME,iBAAiB,GAAGF,IAAI;AAAC"}
1
+ {"version":3,"names":["NOOP","applyMonkeyPatch","exports","revertMonkeyPatch"],"sources":["monkey-patch.ts"],"sourcesContent":["// stub for all platforms\nconst NOOP = () => {};\nexport const applyMonkeyPatch = NOOP;\nexport const revertMonkeyPatch = NOOP;\n"],"mappings":";;;;;;AAAA;AACA,MAAMA,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACd,MAAMC,gBAAgB,GAAGD,IAAI;AAACE,OAAA,CAAAD,gBAAA,GAAAA,gBAAA;AAC9B,MAAME,iBAAiB,GAAGH,IAAI;AAACE,OAAA,CAAAC,iBAAA,GAAAA,iBAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["NOOP","useAnimatedKeyboardHandler","useFocusedInputLayoutHandler","useFocusedInputTextHandler"],"sources":["reanimated.ts"],"sourcesContent":["import type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n FocusedInputTextChangedEvent,\n FocusedInputTextHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from './types';\n\nconst NOOP = () => () => {};\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\n Record<string, unknown>,\n EventWithName<NativeEvent>\n> = NOOP;\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputLayoutChangedEvent>\n> = NOOP;\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputTextChangedEvent>\n> = NOOP;\n"],"mappings":";;;;;;AAUA,MAAMA,IAAI,GAAG,MAAM,MAAM,CAAC,CAAC;AACpB,MAAMC,0BAGZ,GAAGD,IAAI;AAAC;AACF,MAAME,4BAGZ,GAAGF,IAAI;AAAC;AACF,MAAMG,0BAGZ,GAAGH,IAAI;AAAC"}
1
+ {"version":3,"names":["NOOP","useAnimatedKeyboardHandler","exports","useFocusedInputLayoutHandler","useFocusedInputTextHandler"],"sources":["reanimated.ts"],"sourcesContent":["import type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n FocusedInputTextChangedEvent,\n FocusedInputTextHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from \"./types\";\n\nconst NOOP = () => () => {};\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\n Record<string, unknown>,\n EventWithName<NativeEvent>\n> = NOOP;\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputLayoutChangedEvent>\n> = NOOP;\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputTextChangedEvent>\n> = NOOP;\n"],"mappings":";;;;;;AAUA,MAAMA,IAAI,GAAGA,CAAA,KAAM,MAAM,CAAC,CAAC;AACpB,MAAMC,0BAGZ,GAAGD,IAAI;AAACE,OAAA,CAAAD,0BAAA,GAAAA,0BAAA;AACF,MAAME,4BAGZ,GAAGH,IAAI;AAACE,OAAA,CAAAC,4BAAA,GAAAA,4BAAA;AACF,MAAMC,0BAGZ,GAAGJ,IAAI;AAACE,OAAA,CAAAE,0BAAA,GAAAA,0BAAA"}
@@ -11,7 +11,7 @@ const useAnimatedKeyboardHandler = (handlers, dependencies) => {
11
11
  doDependenciesDiffer
12
12
  } = (0, _reactNativeReanimated.useHandler)(handlers, dependencies);
13
13
  return (0, _reactNativeReanimated.useEvent)(event => {
14
- 'worklet';
14
+ "worklet";
15
15
 
16
16
  const {
17
17
  onKeyboardMoveStart,
@@ -19,19 +19,19 @@ const useAnimatedKeyboardHandler = (handlers, dependencies) => {
19
19
  onKeyboardMoveEnd,
20
20
  onKeyboardMoveInteractive
21
21
  } = handlers;
22
- if (onKeyboardMoveStart && event.eventName.endsWith('onKeyboardMoveStart')) {
22
+ if (onKeyboardMoveStart && event.eventName.endsWith("onKeyboardMoveStart")) {
23
23
  onKeyboardMoveStart(event, context);
24
24
  }
25
- if (onKeyboardMove && event.eventName.endsWith('onKeyboardMove')) {
25
+ if (onKeyboardMove && event.eventName.endsWith("onKeyboardMove")) {
26
26
  onKeyboardMove(event, context);
27
27
  }
28
- if (onKeyboardMoveEnd && event.eventName.endsWith('onKeyboardMoveEnd')) {
28
+ if (onKeyboardMoveEnd && event.eventName.endsWith("onKeyboardMoveEnd")) {
29
29
  onKeyboardMoveEnd(event, context);
30
30
  }
31
- if (onKeyboardMoveInteractive && event.eventName.endsWith('onKeyboardMoveInteractive')) {
31
+ if (onKeyboardMoveInteractive && event.eventName.endsWith("onKeyboardMoveInteractive")) {
32
32
  onKeyboardMoveInteractive(event, context);
33
33
  }
34
- }, ['onKeyboardMoveStart', 'onKeyboardMove', 'onKeyboardMoveEnd', 'onKeyboardMoveInteractive'], doDependenciesDiffer);
34
+ }, ["onKeyboardMoveStart", "onKeyboardMove", "onKeyboardMoveEnd", "onKeyboardMoveInteractive"], doDependenciesDiffer);
35
35
  };
36
36
  exports.useAnimatedKeyboardHandler = useAnimatedKeyboardHandler;
37
37
  const useFocusedInputLayoutHandler = (handlers, dependencies) => {
@@ -40,15 +40,15 @@ const useFocusedInputLayoutHandler = (handlers, dependencies) => {
40
40
  doDependenciesDiffer
41
41
  } = (0, _reactNativeReanimated.useHandler)(handlers, dependencies);
42
42
  return (0, _reactNativeReanimated.useEvent)(event => {
43
- 'worklet';
43
+ "worklet";
44
44
 
45
45
  const {
46
46
  onFocusedInputLayoutChanged
47
47
  } = handlers;
48
- if (onFocusedInputLayoutChanged && event.eventName.endsWith('onFocusedInputLayoutChanged')) {
48
+ if (onFocusedInputLayoutChanged && event.eventName.endsWith("onFocusedInputLayoutChanged")) {
49
49
  onFocusedInputLayoutChanged(event, context);
50
50
  }
51
- }, ['onFocusedInputLayoutChanged'], doDependenciesDiffer);
51
+ }, ["onFocusedInputLayoutChanged"], doDependenciesDiffer);
52
52
  };
53
53
  exports.useFocusedInputLayoutHandler = useFocusedInputLayoutHandler;
54
54
  const useFocusedInputTextHandler = (handlers, dependencies) => {
@@ -57,15 +57,15 @@ const useFocusedInputTextHandler = (handlers, dependencies) => {
57
57
  doDependenciesDiffer
58
58
  } = (0, _reactNativeReanimated.useHandler)(handlers, dependencies);
59
59
  return (0, _reactNativeReanimated.useEvent)(event => {
60
- 'worklet';
60
+ "worklet";
61
61
 
62
62
  const {
63
63
  onFocusedInputTextChanged
64
64
  } = handlers;
65
- if (onFocusedInputTextChanged && event.eventName.endsWith('onFocusedInputTextChanged')) {
65
+ if (onFocusedInputTextChanged && event.eventName.endsWith("onFocusedInputTextChanged")) {
66
66
  onFocusedInputTextChanged(event, context);
67
67
  }
68
- }, ['onFocusedInputTextChanged'], doDependenciesDiffer);
68
+ }, ["onFocusedInputTextChanged"], doDependenciesDiffer);
69
69
  };
70
70
  exports.useFocusedInputTextHandler = useFocusedInputTextHandler;
71
71
  //# sourceMappingURL=reanimated.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useAnimatedKeyboardHandler","handlers","dependencies","context","doDependenciesDiffer","useHandler","useEvent","event","onKeyboardMoveStart","onKeyboardMove","onKeyboardMoveEnd","onKeyboardMoveInteractive","eventName","endsWith","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged","useFocusedInputTextHandler","onFocusedInputTextChanged"],"sources":["reanimated.native.ts"],"sourcesContent":["import { useEvent, useHandler } from 'react-native-reanimated';\n\nimport type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n FocusedInputTextChangedEvent,\n FocusedInputTextHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from './types';\n\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\n Record<string, unknown>,\n EventWithName<NativeEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n 'worklet';\n const {\n onKeyboardMoveStart,\n onKeyboardMove,\n onKeyboardMoveEnd,\n onKeyboardMoveInteractive,\n } = handlers;\n\n if (\n onKeyboardMoveStart &&\n event.eventName.endsWith('onKeyboardMoveStart')\n ) {\n onKeyboardMoveStart(event, context);\n }\n\n if (onKeyboardMove && event.eventName.endsWith('onKeyboardMove')) {\n onKeyboardMove(event, context);\n }\n\n if (onKeyboardMoveEnd && event.eventName.endsWith('onKeyboardMoveEnd')) {\n onKeyboardMoveEnd(event, context);\n }\n\n if (\n onKeyboardMoveInteractive &&\n event.eventName.endsWith('onKeyboardMoveInteractive')\n ) {\n onKeyboardMoveInteractive(event, context);\n }\n },\n [\n 'onKeyboardMoveStart',\n 'onKeyboardMove',\n 'onKeyboardMoveEnd',\n 'onKeyboardMoveInteractive',\n ],\n doDependenciesDiffer\n );\n};\n\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputLayoutChangedEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n 'worklet';\n const { onFocusedInputLayoutChanged } = handlers;\n\n if (\n onFocusedInputLayoutChanged &&\n event.eventName.endsWith('onFocusedInputLayoutChanged')\n ) {\n onFocusedInputLayoutChanged(event, context);\n }\n },\n ['onFocusedInputLayoutChanged'],\n doDependenciesDiffer\n );\n};\n\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputTextChangedEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n 'worklet';\n const { onFocusedInputTextChanged } = handlers;\n\n if (\n onFocusedInputTextChanged &&\n event.eventName.endsWith('onFocusedInputTextChanged')\n ) {\n onFocusedInputTextChanged(event, context);\n }\n },\n ['onFocusedInputTextChanged'],\n doDependenciesDiffer\n );\n};\n"],"mappings":";;;;;;AAAA;AAYO,MAAMA,0BAGZ,GAAG,CAACC,QAAQ,EAAEC,YAAY,KAAK;EAC9B,MAAM;IAAEC,OAAO;IAAEC;EAAqB,CAAC,GAAG,IAAAC,iCAAU,EAACJ,QAAQ,EAAEC,YAAY,CAAC;EAE5E,OAAO,IAAAI,+BAAQ,EACZC,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MACJC,mBAAmB;MACnBC,cAAc;MACdC,iBAAiB;MACjBC;IACF,CAAC,GAAGV,QAAQ;IAEZ,IACEO,mBAAmB,IACnBD,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,qBAAqB,CAAC,EAC/C;MACAL,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AE5E,OAAO,IAAAI,+BAAQ,EACZC,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MAAEU;IAA0B,CAAC,GAAGhB,QAAQ;IAE9C,IACEgB,yBAAyB,IACzBV,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,2BAA2B,CAAC,EACrD;MACAI,yBAAyB,CAACV,KAAK,EAAEJ,OAAO,CAAC;IAC3C;EACF,CAAC,EACD,CAAC,2BAA2B,CAAC,EAC7BC,oBAAoB,CACrB;AACH,CAAC;AAAC"}
1
+ {"version":3,"names":["_reactNativeReanimated","require","useAnimatedKeyboardHandler","handlers","dependencies","context","doDependenciesDiffer","useHandler","useEvent","event","onKeyboardMoveStart","onKeyboardMove","onKeyboardMoveEnd","onKeyboardMoveInteractive","eventName","endsWith","exports","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged","useFocusedInputTextHandler","onFocusedInputTextChanged"],"sources":["reanimated.native.ts"],"sourcesContent":["import { useEvent, useHandler } from \"react-native-reanimated\";\n\nimport type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n FocusedInputTextChangedEvent,\n FocusedInputTextHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from \"./types\";\n\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\n Record<string, unknown>,\n EventWithName<NativeEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const {\n onKeyboardMoveStart,\n onKeyboardMove,\n onKeyboardMoveEnd,\n onKeyboardMoveInteractive,\n } = handlers;\n\n if (\n onKeyboardMoveStart &&\n event.eventName.endsWith(\"onKeyboardMoveStart\")\n ) {\n onKeyboardMoveStart(event, context);\n }\n\n if (onKeyboardMove && event.eventName.endsWith(\"onKeyboardMove\")) {\n onKeyboardMove(event, context);\n }\n\n if (onKeyboardMoveEnd && event.eventName.endsWith(\"onKeyboardMoveEnd\")) {\n onKeyboardMoveEnd(event, context);\n }\n\n if (\n onKeyboardMoveInteractive &&\n event.eventName.endsWith(\"onKeyboardMoveInteractive\")\n ) {\n onKeyboardMoveInteractive(event, context);\n }\n },\n [\n \"onKeyboardMoveStart\",\n \"onKeyboardMove\",\n \"onKeyboardMoveEnd\",\n \"onKeyboardMoveInteractive\",\n ],\n doDependenciesDiffer,\n );\n};\n\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputLayoutChangedEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const { onFocusedInputLayoutChanged } = handlers;\n\n if (\n onFocusedInputLayoutChanged &&\n event.eventName.endsWith(\"onFocusedInputLayoutChanged\")\n ) {\n onFocusedInputLayoutChanged(event, context);\n }\n },\n [\"onFocusedInputLayoutChanged\"],\n doDependenciesDiffer,\n );\n};\n\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputTextChangedEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const { onFocusedInputTextChanged } = handlers;\n\n if (\n onFocusedInputTextChanged &&\n event.eventName.endsWith(\"onFocusedInputTextChanged\")\n ) {\n onFocusedInputTextChanged(event, context);\n }\n },\n [\"onFocusedInputTextChanged\"],\n doDependenciesDiffer,\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAYO,MAAMC,0BAGZ,GAAGA,CAACC,QAAQ,EAAEC,YAAY,KAAK;EAC9B,MAAM;IAAEC,OAAO;IAAEC;EAAqB,CAAC,GAAG,IAAAC,iCAAU,EAACJ,QAAQ,EAAEC,YAAY,CAAC;EAE5E,OAAO,IAAAI,+BAAQ,EACZC,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MACJC,m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BACF,CAAC;AACH,CAAC;AAACU,OAAA,CAAAC,4BAAA,GAAAA,4BAAA;AAEK,MAAME,0BAGZ,GAAGA,CAAChB,QAAQ,EAAEC,YAAY,KAAK;EAC9B,MAAM;IAAEC,OAAO;IAAEC;EAAqB,CAAC,GAAG,IAAAC,iCAAU,EAACJ,QAAQ,EAAEC,YAAY,CAAC;EAE5E,OAAO,IAAAI,+BAAQ,EACZC,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MAAEW;IAA0B,CAAC,GAAGjB,QAAQ;IAE9C,IACEiB,yBAAyB,IACzBX,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,2BAA2B,CAAC,EACrD;MACAK,yBAAyB,CAACX,KAAK,EAAEJ,OAAO,CAAC;IAC3C;EACF,CAAC,EACD,CAAC,2BAA2B,CAAC,EAC7BC,oBACF,CAAC;AACH,CAAC;AAACU,OAAA,CAAAG,0BAAA,GAAAA,0BAAA"}
@@ -10,7 +10,7 @@ var _reactNativeReanimated = require("react-native-reanimated");
10
10
  var _bindings = require("./bindings");
11
11
  var _constants = require("./constants");
12
12
  var _hooks = require("./hooks");
13
- const availableOSEventType = _reactNative.Platform.OS === 'ios' ? 'Will' : 'Did';
13
+ const availableOSEventType = _reactNative.Platform.OS === "ios" ? "Will" : "Did";
14
14
 
15
15
  // cubic-bezier(.17,.67,.34,.94)
16
16
  const defaultAndroidEasing = _reactNative.Easing.bezier(0.4, 0.0, 0.2, 1);
@@ -87,7 +87,7 @@ const useReanimatedKeyboardAnimationReplica = () => {
87
87
  const heightEvent = (0, _reactNativeReanimated.useSharedValue)(0);
88
88
  const progress = (0, _reactNativeReanimated.useDerivedValue)(() => height.value / heightEvent.value);
89
89
  const handler = (0, _react.useCallback)(_height => {
90
- 'worklet';
90
+ "worklet";
91
91
 
92
92
  heightEvent.value = _height;
93
93
  }, []);
@@ -103,10 +103,10 @@ const useReanimatedKeyboardAnimationReplica = () => {
103
103
  }
104
104
  }, []);
105
105
  (0, _react.useEffect)(() => {
106
- const show = _reactNative.Keyboard.addListener('keyboardWillShow', e => {
106
+ const show = _reactNative.Keyboard.addListener("keyboardWillShow", e => {
107
107
  (0, _reactNativeReanimated.runOnUI)(handler)(-e.endCoordinates.height);
108
108
  });
109
- const hide = _reactNative.Keyboard.addListener('keyboardWillHide', () => {
109
+ const hide = _reactNative.Keyboard.addListener("keyboardWillHide", () => {
110
110
  (0, _reactNativeReanimated.runOnUI)(handler)(0);
111
111
  });
112
112
  return () => {
@@ -120,6 +120,6 @@ const useReanimatedKeyboardAnimationReplica = () => {
120
120
  };
121
121
  };
122
122
  exports.useReanimatedKeyboardAnimationReplica = useReanimatedKeyboardAnimationReplica;
123
- const useGradualKeyboardAnimation = _reactNative.Platform.OS === 'ios' ? useReanimatedKeyboardAnimationReplica : _hooks.useReanimatedKeyboardAnimation;
123
+ const useGradualKeyboardAnimation = _reactNative.Platform.OS === "ios" ? useReanimatedKeyboardAnimationReplica : _hooks.useReanimatedKeyboardAnimation;
124
124
  exports.useGradualKeyboardAnimation = useGradualKeyboardAnimation;
125
125
  //# sourceMappingURL=replicas.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["availableOSEventType","Platform","OS","defaultAndroidEasing","Easing","bezier","useKeyboardAnimationReplica","height","useRef","Animated","Value","progress","animation","useMemo","current","useEffect","KeyboardController","setInputMode","AndroidSoftInputModes","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode","listener","Keyboard","addListener","e","timing","toValue","endCoordinates","duration","easing","useNativeDriver","start","remove","IOS_SPRING_CONFIG","damping","stiffness","mass","overshootClamping","restDisplacementThreshold","restSpeedThreshold","useReanimatedKeyboardAnimationReplica","useSharedValue","heightEvent","useDerivedValue","value","handler","useCallback","_height","useAnimatedReaction","_keyboardHeight","result","_previousResult","_previousKeyboardHeight","withSpring","show","runOnUI","hide","useGradualKeyboardAnimation","useReanimatedKeyboardAnimation"],"sources":["replicas.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { Animated, Easing, Keyboard, Platform } from 'react-native';\nimport {\n runOnUI,\n useAnimatedReaction,\n useDerivedValue,\n useSharedValue,\n withSpring,\n} from 'react-native-reanimated';\n\nimport { KeyboardController } from './bindings';\nimport { AndroidSoftInputModes } from './constants';\nimport { useReanimatedKeyboardAnimation } from './hooks';\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 = useCallback((_height: number) => {\n 'worklet';\n\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;AACA;AACA;AAQA;AACA;AACA;AAEA,MAAMA,oBAAoB,GAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAG,MAAM,GAAG,KAAK;;AAEnE;AACO,MAAMC,oBAAoB,GAAGC,mBAAM,C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AO;EAC7B,CAAC,EAAE,EAAE,CAAC;EAEN,IAAAC,0CAAmB,EACjB,OAAO;IACLC,eAAe,EAAEP,WAAW,CAACE;EAC/B,CAAC,CAAC,EACF,CAACM,MAAM,EAAEC,eAAe,KAAK;IAC3B,MAAM;MAAEF;IAAgB,CAAC,GAAGC,MAAM;IAClC,MAAME,uBAAuB,GAAGD,eAAe,aAAfA,eAAe,uBAAfA,eAAe,CAAEF,eAAe;IAEhE,IAAIA,eAAe,KAAKG,uBAAuB,EAAE;MAC/C7C,MAAM,CAACqC,KAAK,GAAG,IAAAS,iCAAU,EAACJ,eAAe,EAAEhB,iBAAiB,CAAC;IAC/D;EACF,CAAC,EACD,EAAE,CACH;EAED,IAAAlB,gBAAS,EAAC,MAAM;IACd,MAAMuC,IAAI,GAAGhC,qBAAQ,CAACC,WAAW,CAAC,kBAAkB,EAAGC,CAAC,IAAK;MAC3D,IAAA+B,8BAAO,EAACV,OAAO,CAAC,CAAC,CAACrB,CAAC,CAACG,cAAc,CAACpB,MAAM,CAAC;IAC5C,CAAC,CAAC;IACF,MAAMiD,IAAI,GAAGlC,qBAAQ,CAACC,WAAW,CAAC,kBAAkB,EAAE,MAAM;MAC1D,IAAAgC,8BAAO,EAACV,OAAO,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,OAAO,MAAM;MACXS,IAAI,CAACtB,MAAM,EAAE;MACbwB,IAAI,CAACxB,MAAM,EAAE;IACf,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IAAEzB,MAAM;IAAEI;EAAS,CAAC;AAC7B,CAAC;AAAC;AAEK,MAAM8C,2BAA2B,GACtCxD,qBAAQ,CAACC,EAAE,KAAK,KAAK,GACjBsC,qCAAqC,GACrCkB,qCAA8B;AAAC"}
1
+ {"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_bindings","_constants","_hooks","availableOSEventType","Platform","OS","defaultAndroidEasing","Easing","bezier","exports","useKeyboardAnimationReplica","height","useRef","Animated","Value","progress","animation","useMemo","current","useEffect","KeyboardController","setInputMode","AndroidSoftInputModes","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode","listener","Keyboard","addListener","e","timing","toValue","endCoordinates","duration","easing","useNativeDriver","start","remove","IOS_SPRING_CONFIG","damping","stiffness","mass","overshootClamping","restDisplacementThreshold","restSpeedThreshold","useReanimatedKeyboardAnimationReplica","useSharedValue","heightEvent","useDerivedValue","value","handler","useCallback","_height","useAnimatedReaction","_keyboardHeight","result","_previousResult","_previousKeyboardHeight","withSpring","show","runOnUI","hide","useGradualKeyboardAnimation","useReanimatedKeyboardAnimation"],"sources":["replicas.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { Animated, Easing, Keyboard, Platform } from \"react-native\";\nimport {\n runOnUI,\n useAnimatedReaction,\n useDerivedValue,\n useSharedValue,\n withSpring,\n} from \"react-native-reanimated\";\n\nimport { KeyboardController } from \"./bindings\";\nimport { AndroidSoftInputModes } from \"./constants\";\nimport { useReanimatedKeyboardAnimation } from \"./hooks\";\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 = useCallback((_height: number) => {\n \"worklet\";\n\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,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAQA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAEA,MAAMM,oBAAoB,GAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAG,MAAM,GAAG,KAAK;;AAEnE;AACO,MAAMC,oBAAoB,GAAGC,mBAAM,CAACC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;AAACC,OAAA,CAAAH,oBAAA,GAAAA,oBAAA;AAMpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,2BAA2B,GAAGA,CAAA,KAAyB;EAClE,MAAMC,MAAM,GAAG,IAAAC,aAAM,EAAC,IAAIC,qBAAQ,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EAC5C,MAAMC,QAAQ,GAAG,IAAAH,aAAM,EAAC,IAAIC,qBAAQ,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EAC9C,MAAME,SAAS,GAAG,IAAAC,cAAO,EACvB,OAAO;IACLN,MAAM,EAAEA,MAAM,CAACO,OAAO;IACtBH,QAAQ,EAAEA,QAAQ,CAACG;EACrB,CAAC,CAAC,EACF,EACF,CAAC;EAED,IAAAC,gBAAS,EAAC,MAAM;IACdC,4BAAkB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ACd,MAAMuC,IAAI,GAAGhC,qBAAQ,CAACC,WAAW,CAAC,kBAAkB,EAAGC,CAAC,IAAK;MAC3D,IAAA+B,8BAAO,EAACV,OAAO,CAAC,CAAC,CAACrB,CAAC,CAACG,cAAc,CAACpB,MAAM,CAAC;IAC5C,CAAC,CAAC;IACF,MAAMiD,IAAI,GAAGlC,qBAAQ,CAACC,WAAW,CAAC,kBAAkB,EAAE,MAAM;MAC1D,IAAAgC,8BAAO,EAACV,OAAO,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,OAAO,MAAM;MACXS,IAAI,CAACtB,MAAM,CAAC,CAAC;MACbwB,IAAI,CAACxB,MAAM,CAAC,CAAC;IACf,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IAAEzB,MAAM;IAAEI;EAAS,CAAC;AAC7B,CAAC;AAACN,OAAA,CAAAmC,qCAAA,GAAAA,qCAAA;AAEK,MAAMiB,2BAA2B,GACtCzD,qBAAQ,CAACC,EAAE,KAAK,KAAK,GACjBuC,qCAAqC,GACrCkB,qCAA8B;AAACrD,OAAA,CAAAoD,2BAAA,GAAAA,2BAAA"}
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- var _default = (0, _codegenNativeComponent.default)('KeyboardControllerView');
9
+ var _default = (0, _codegenNativeComponent.default)("KeyboardControllerView");
10
10
  exports.default = _default;
11
11
  //# sourceMappingURL=KeyboardControllerViewNativeComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["codegenNativeComponent"],"sources":["KeyboardControllerViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\n\nimport type { HostComponent } from 'react-native';\nimport type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';\nimport type {\n DirectEventHandler,\n Double,\n Int32,\n} from 'react-native/Libraries/Types/CodegenTypes';\n\ntype KeyboardMoveEvent = Readonly<{\n height: Double;\n progress: Double;\n duration: Int32;\n target: Int32;\n}>;\n\ntype FocusedInputLayoutChangedEvent = Readonly<{\n target: Int32;\n layout: {\n x: Double;\n y: Double;\n width: Double;\n height: Double;\n absoluteX: Double;\n absoluteY: Double;\n };\n}>;\n\ntype FocusedInputTextChangedEvent = Readonly<{\n text: string;\n}>;\n\nexport interface NativeProps extends ViewProps {\n // props\n enabled?: boolean;\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n // callbacks\n /// keyboard\n onKeyboardMoveStart?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveEnd?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveInteractive?: DirectEventHandler<KeyboardMoveEvent>;\n /// focused input\n onFocusedInputLayoutChanged?: DirectEventHandler<FocusedInputLayoutChangedEvent>;\n onFocusedInputTextChanged?: DirectEventHandler<FocusedInputTextChangedEvent>;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n 'KeyboardControllerView'\n) as HostComponent<NativeProps>;\n"],"mappings":";;;;;;AAAA;AAA6F;AAAA,eAiD9E,IAAAA,+BAAsB,EACnC,wBAAwB,CACzB;AAAA"}
1
+ {"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","obj","__esModule","default","_default","codegenNativeComponent","exports"],"sources":["KeyboardControllerViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\nimport type {\n DirectEventHandler,\n Double,\n Int32,\n} from \"react-native/Libraries/Types/CodegenTypes\";\n\ntype KeyboardMoveEvent = Readonly<{\n height: Double;\n progress: Double;\n duration: Int32;\n target: Int32;\n}>;\n\ntype FocusedInputLayoutChangedEvent = Readonly<{\n target: Int32;\n layout: {\n x: Double;\n y: Double;\n width: Double;\n height: Double;\n absoluteX: Double;\n absoluteY: Double;\n };\n}>;\n\ntype FocusedInputTextChangedEvent = Readonly<{\n text: string;\n}>;\n\nexport interface NativeProps extends ViewProps {\n // props\n enabled?: boolean;\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n // callbacks\n /// keyboard\n onKeyboardMoveStart?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveEnd?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveInteractive?: DirectEventHandler<KeyboardMoveEvent>;\n /// focused input\n onFocusedInputLayoutChanged?: DirectEventHandler<FocusedInputLayoutChangedEvent>;\n onFocusedInputTextChanged?: DirectEventHandler<FocusedInputTextChangedEvent>;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n \"KeyboardControllerView\",\n) as HostComponent<NativeProps>;\n"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAiD9E,IAAAC,+BAAsB,EACnC,wBACF,CAAC;AAAAC,OAAA,CAAAH,OAAA,GAAAC,QAAA"}
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- var _default = (0, _codegenNativeComponent.default)('KeyboardGestureArea', {
10
- excludedPlatforms: ['iOS']
9
+ var _default = (0, _codegenNativeComponent.default)("KeyboardGestureArea", {
10
+ excludedPlatforms: ["iOS"]
11
11
  });
12
12
  exports.default = _default;
13
13
  //# sourceMappingURL=KeyboardGestureAreaNativeComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["codegenNativeComponent","excludedPlatforms"],"sources":["KeyboardGestureAreaNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\n\nimport type { HostComponent } from 'react-native';\nimport type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';\nimport type { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';\n\nexport interface NativeProps extends ViewProps {\n interpolator?: WithDefault<'linear' | 'ios', 'linear'>;\n showOnSwipeUp?: boolean;\n enableSwipeToDismiss?: boolean;\n}\n\nexport default codegenNativeComponent<NativeProps>('KeyboardGestureArea', {\n excludedPlatforms: ['iOS'],\n}) as HostComponent<NativeProps>;\n"],"mappings":";;;;;;AAAA;AAA6F;AAAA,eAY9E,IAAAA,+BAAsB,EAAc,qBAAqB,EAAE;EACxEC,iBAAiB,EAAE,CAAC,KAAK;AAC3B,CAAC,CAAC;AAAA"}
1
+ {"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","obj","__esModule","default","_default","codegenNativeComponent","excludedPlatforms","exports"],"sources":["KeyboardGestureAreaNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\nimport type { WithDefault } from \"react-native/Libraries/Types/CodegenTypes\";\n\nexport interface NativeProps extends ViewProps {\n interpolator?: WithDefault<\"linear\" | \"ios\", \"linear\">;\n showOnSwipeUp?: boolean;\n enableSwipeToDismiss?: boolean;\n}\n\nexport default codegenNativeComponent<NativeProps>(\"KeyboardGestureArea\", {\n excludedPlatforms: [\"iOS\"],\n}) as HostComponent<NativeProps>;\n"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAY9E,IAAAC,+BAAsB,EAAc,qBAAqB,EAAE;EACxEC,iBAAiB,EAAE,CAAC,KAAK;AAC3B,CAAC,CAAC;AAAAC,OAAA,CAAAJ,OAAA,GAAAC,QAAA"}
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _reactNative = require("react-native");
8
- var _default = _reactNative.TurboModuleRegistry.get('KeyboardController');
8
+ var _default = _reactNative.TurboModuleRegistry.get("KeyboardController");
9
9
  exports.default = _default;
10
10
  //# sourceMappingURL=NativeKeyboardController.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeKeyboardController.ts"],"sourcesContent":["import { TurboModuleRegistry } from 'react-native';\n\nimport type { TurboModule } from 'react-native';\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n // methods\n setInputMode(mode: number): void;\n setDefaultMode(): void;\n dismiss(): void;\n\n // event emitter\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n}\n\nexport default TurboModuleRegistry.get<Spec>('KeyboardController');\n"],"mappings":";;;;;;AAAA;AAAmD,eAiBpCA,gCAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC;AAAA"}
1
+ {"version":3,"names":["_reactNative","require","_default","TurboModuleRegistry","get","exports","default"],"sources":["NativeKeyboardController.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\n\nimport type { TurboModule } from \"react-native\";\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n // methods\n setInputMode(mode: number): void;\n setDefaultMode(): void;\n dismiss(): void;\n\n // event emitter\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n}\n\nexport default TurboModuleRegistry.get<Spec>(\"KeyboardController\");\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAiBpCC,gCAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAJ,QAAA"}
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _reactNative = require("react-native");
8
- var _default = _reactNative.TurboModuleRegistry.get('StatusBarManagerCompat');
8
+ var _default = _reactNative.TurboModuleRegistry.get("StatusBarManagerCompat");
9
9
  exports.default = _default;
10
10
  //# sourceMappingURL=NativeStatusBarManagerCompat.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeStatusBarManagerCompat.ts"],"sourcesContent":["import { TurboModuleRegistry } from 'react-native';\n\nimport type { TurboModule } from 'react-native';\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n setHidden(hidden: boolean): void;\n setColor(color: number, animated: boolean): void;\n setTranslucent(translucent: boolean): void;\n setStyle(style: string): void;\n}\n\nexport default TurboModuleRegistry.get<Spec>('StatusBarManagerCompat');\n"],"mappings":";;;;;;AAAA;AAAmD,eAapCA,gCAAmB,CAACC,GAAG,CAAO,wBAAwB,CAAC;AAAA"}
1
+ {"version":3,"names":["_reactNative","require","_default","TurboModuleRegistry","get","exports","default"],"sources":["NativeStatusBarManagerCompat.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\n\nimport type { TurboModule } from \"react-native\";\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n setHidden(hidden: boolean): void;\n setColor(color: number, animated: boolean): void;\n setTranslucent(translucent: boolean): void;\n setStyle(style: string): void;\n}\n\nexport default TurboModuleRegistry.get<Spec>(\"StatusBarManagerCompat\");\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAapCC,gCAAmB,CAACC,GAAG,CAAO,wBAAwB,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAJ,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n EmitterSubscription,\n NativeSyntheticEvent,\n ViewProps,\n} from 'react-native';\n\n// DirectEventHandler events declaration\nexport type NativeEvent = {\n progress: number;\n height: number;\n duration: number;\n target: number;\n};\nexport type FocusedInputLayoutChangedEvent = {\n target: number;\n layout: {\n x: number;\n y: number;\n width: number;\n height: number;\n absoluteX: number;\n absoluteY: number;\n };\n};\nexport type FocusedInputTextChangedEvent = {\n text: string;\n};\nexport type EventWithName<T> = {\n eventName: string;\n} & T;\n\n// native View/Module declarations\nexport type KeyboardControllerProps = {\n // callback props\n onKeyboardMoveStart?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>\n ) => void;\n onKeyboardMove?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>\n ) => void;\n onKeyboardMoveEnd?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>\n ) => void;\n onKeyboardMoveInteractive?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>\n ) => void;\n onFocusedInputLayoutChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>\n ) => void;\n onFocusedInputTextChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>\n ) => void;\n // fake props used to activate reanimated bindings\n onKeyboardMoveReanimated?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>\n ) => void;\n onFocusedInputLayoutChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>\n ) => void;\n onFocusedInputTextChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>\n ) => void;\n // props\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n enabled?: boolean;\n} & ViewProps;\n\nexport type KeyboardGestureAreaProps = {\n interpolator: 'ios' | 'linear';\n /**\n * Whether to allow to show a keyboard from dismissed state by swipe up.\n * Default to `false`.\n */\n showOnSwipeUp?: boolean;\n /**\n * Whether to allow to control a keyboard by gestures. The strategy how\n * it should be controlled is determined by `interpolator` property.\n * Defaults to `true`.\n */\n enableSwipeToDismiss?: boolean;\n} & ViewProps;\n\nexport type KeyboardControllerModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // all platforms\n dismiss: () => void;\n // native event module stuff\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n};\n\n// Event module declarations\nexport type KeyboardControllerEvents =\n | 'keyboardWillShow'\n | 'keyboardDidShow'\n | 'keyboardWillHide'\n | 'keyboardDidHide';\nexport type KeyboardEventData = {\n height: number;\n duration: number;\n timestamp: number;\n target: number;\n};\nexport type KeyboardEventsModule = {\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEventData) => void\n ) => EmitterSubscription;\n};\n\n// reanimated hook declaration\nexport type KeyboardHandlerHook<TContext, Event> = (\n handlers: {\n onKeyboardMoveStart?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMove?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveEnd?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveInteractive?: (e: NativeEvent, context: TContext) => void;\n },\n dependencies?: unknown[]\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputLayoutHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputLayoutChanged?: (\n e: FocusedInputLayoutChangedEvent,\n context: TContext\n ) => void;\n },\n dependencies?: unknown[]\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputTextHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputTextChanged?: (\n e: FocusedInputTextChangedEvent,\n context: TContext\n ) => void;\n },\n dependencies?: unknown[]\n) => (e: NativeSyntheticEvent<Event>) => void;\n\n// package types\nexport type Handlers<T> = Record<string, T | undefined>;\nexport type KeyboardHandler = Partial<{\n onStart: (e: NativeEvent) => void;\n onMove: (e: NativeEvent) => void;\n onEnd: (e: NativeEvent) => void;\n onInteractive: (e: NativeEvent) => void;\n}>;\nexport type KeyboardHandlers = Handlers<KeyboardHandler>;\nexport type FocusedInputHandler = Partial<{\n onChangeText: (e: FocusedInputTextChangedEvent) => void;\n}>;\nexport type FocusedInputHandlers = Handlers<FocusedInputHandler>;\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n EmitterSubscription,\n NativeSyntheticEvent,\n ViewProps,\n} from \"react-native\";\n\n// DirectEventHandler events declaration\nexport type NativeEvent = {\n progress: number;\n height: number;\n duration: number;\n target: number;\n};\nexport type FocusedInputLayoutChangedEvent = {\n target: number;\n layout: {\n x: number;\n y: number;\n width: number;\n height: number;\n absoluteX: number;\n absoluteY: number;\n };\n};\nexport type FocusedInputTextChangedEvent = {\n text: string;\n};\nexport type EventWithName<T> = {\n eventName: string;\n} & T;\n\n// native View/Module declarations\nexport type KeyboardControllerProps = {\n // callback props\n onKeyboardMoveStart?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMove?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveEnd?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveInteractive?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n // fake props used to activate reanimated bindings\n onKeyboardMoveReanimated?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n // props\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n enabled?: boolean;\n} & ViewProps;\n\nexport type KeyboardGestureAreaProps = {\n interpolator: \"ios\" | \"linear\";\n /**\n * Whether to allow to show a keyboard from dismissed state by swipe up.\n * Default to `false`.\n */\n showOnSwipeUp?: boolean;\n /**\n * Whether to allow to control a keyboard by gestures. The strategy how\n * it should be controlled is determined by `interpolator` property.\n * Defaults to `true`.\n */\n enableSwipeToDismiss?: boolean;\n} & ViewProps;\n\nexport type KeyboardControllerModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // all platforms\n dismiss: () => void;\n // native event module stuff\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n};\n\n// Event module declarations\nexport type KeyboardControllerEvents =\n | \"keyboardWillShow\"\n | \"keyboardDidShow\"\n | \"keyboardWillHide\"\n | \"keyboardDidHide\";\nexport type KeyboardEventData = {\n height: number;\n duration: number;\n timestamp: number;\n target: number;\n};\nexport type KeyboardEventsModule = {\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEventData) => void,\n ) => EmitterSubscription;\n};\n\n// reanimated hook declaration\nexport type KeyboardHandlerHook<TContext, Event> = (\n handlers: {\n onKeyboardMoveStart?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMove?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveEnd?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveInteractive?: (e: NativeEvent, context: TContext) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputLayoutHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputLayoutChanged?: (\n e: FocusedInputLayoutChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputTextHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputTextChanged?: (\n e: FocusedInputTextChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\n\n// package types\nexport type Handlers<T> = Record<string, T | undefined>;\nexport type KeyboardHandler = Partial<{\n onStart: (e: NativeEvent) => void;\n onMove: (e: NativeEvent) => void;\n onEnd: (e: NativeEvent) => void;\n onInteractive: (e: NativeEvent) => void;\n}>;\nexport type KeyboardHandlers = Handlers<KeyboardHandler>;\nexport type FocusedInputHandler = Partial<{\n onChangeText: (e: FocusedInputTextChangedEvent) => void;\n}>;\nexport type FocusedInputHandlers = Handlers<FocusedInputHandler>;\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":["uuid","Math","random","toString","slice"],"sources":["utils.ts"],"sourcesContent":["export const uuid = () => Math.random().toString(36).slice(-6);\n"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAG,MAAMC,IAAI,CAACC,MAAM,EAAE,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;AAAC"}
1
+ {"version":3,"names":["uuid","Math","random","toString","slice","exports"],"sources":["utils.ts"],"sourcesContent":["export const uuid = () => Math.random().toString(36).slice(-6);\n"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAGA,CAAA,KAAMC,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;AAACC,OAAA,CAAAL,IAAA,GAAAA,IAAA"}
@@ -1,19 +1,19 @@
1
- import React, { useEffect, useMemo, useState } from 'react';
2
- import { Animated, Platform, StyleSheet } from 'react-native';
3
- import Reanimated, { useSharedValue } from 'react-native-reanimated';
4
- import { KeyboardControllerView } from './bindings';
5
- import { KeyboardContext } from './context';
6
- import { useAnimatedValue, useSharedHandlers } from './internal';
7
- import { applyMonkeyPatch, revertMonkeyPatch } from './monkey-patch';
8
- import { useAnimatedKeyboardHandler, useFocusedInputLayoutHandler, useFocusedInputTextHandler } from './reanimated';
1
+ import React, { useEffect, useMemo, useState } from "react";
2
+ import { Animated, Platform, StyleSheet } from "react-native";
3
+ import Reanimated, { useSharedValue } from "react-native-reanimated";
4
+ import { KeyboardControllerView } from "./bindings";
5
+ import { KeyboardContext } from "./context";
6
+ import { useAnimatedValue, useSharedHandlers } from "./internal";
7
+ import { applyMonkeyPatch, revertMonkeyPatch } from "./monkey-patch";
8
+ import { useAnimatedKeyboardHandler, useFocusedInputLayoutHandler, useFocusedInputTextHandler } from "./reanimated";
9
9
  const KeyboardControllerViewAnimated = Reanimated.createAnimatedComponent(Animated.createAnimatedComponent(KeyboardControllerView));
10
10
  const styles = StyleSheet.create({
11
11
  container: {
12
12
  flex: 1
13
13
  },
14
14
  hidden: {
15
- display: 'none',
16
- position: 'absolute'
15
+ display: "none",
16
+ position: "absolute"
17
17
  }
18
18
  });
19
19
  export const KeyboardProvider = _ref => {
@@ -67,7 +67,7 @@ export const KeyboardProvider = _ref => {
67
67
  }), []);
68
68
  // handlers
69
69
  const updateSharedValues = (event, platforms) => {
70
- 'worklet';
70
+ "worklet";
71
71
 
72
72
  if (platforms.includes(Platform.OS)) {
73
73
  progressSV.value = event.progress;
@@ -76,32 +76,32 @@ export const KeyboardProvider = _ref => {
76
76
  };
77
77
  const keyboardHandler = useAnimatedKeyboardHandler({
78
78
  onKeyboardMoveStart: event => {
79
- 'worklet';
79
+ "worklet";
80
80
 
81
- broadcastKeyboardEvents('onStart', event);
82
- updateSharedValues(event, ['ios']);
81
+ broadcastKeyboardEvents("onStart", event);
82
+ updateSharedValues(event, ["ios"]);
83
83
  },
84
84
  onKeyboardMove: event => {
85
- 'worklet';
85
+ "worklet";
86
86
 
87
- broadcastKeyboardEvents('onMove', event);
88
- updateSharedValues(event, ['android']);
87
+ broadcastKeyboardEvents("onMove", event);
88
+ updateSharedValues(event, ["android"]);
89
89
  },
90
90
  onKeyboardMoveEnd: event => {
91
- 'worklet';
91
+ "worklet";
92
92
 
93
- broadcastKeyboardEvents('onEnd', event);
93
+ broadcastKeyboardEvents("onEnd", event);
94
94
  },
95
95
  onKeyboardMoveInteractive: event => {
96
- 'worklet';
96
+ "worklet";
97
97
 
98
- updateSharedValues(event, ['android', 'ios']);
99
- broadcastKeyboardEvents('onInteractive', event);
98
+ updateSharedValues(event, ["android", "ios"]);
99
+ broadcastKeyboardEvents("onInteractive", event);
100
100
  }
101
101
  }, []);
102
102
  const inputLayoutHandler = useFocusedInputLayoutHandler({
103
103
  onFocusedInputLayoutChanged: e => {
104
- 'worklet';
104
+ "worklet";
105
105
 
106
106
  if (e.target !== -1) {
107
107
  layout.value = e;
@@ -112,9 +112,9 @@ export const KeyboardProvider = _ref => {
112
112
  }, []);
113
113
  const inputTextHandler = useFocusedInputTextHandler({
114
114
  onFocusedInputTextChanged: e => {
115
- 'worklet';
115
+ "worklet";
116
116
 
117
- broadcastInputEvents('onChangeText', e);
117
+ broadcastInputEvents("onChangeText", e);
118
118
  }
119
119
  }, []);
120
120
  // effects
@@ -130,8 +130,8 @@ export const KeyboardProvider = _ref => {
130
130
  }, /*#__PURE__*/React.createElement(KeyboardControllerViewAnimated, {
131
131
  enabled: enabled,
132
132
  onKeyboardMoveReanimated: keyboardHandler,
133
- onKeyboardMoveStart: Platform.OS === 'ios' ? onKeyboardMove : undefined,
134
- onKeyboardMove: Platform.OS === 'android' ? onKeyboardMove : undefined,
133
+ onKeyboardMoveStart: Platform.OS === "ios" ? onKeyboardMove : undefined,
134
+ onKeyboardMove: Platform.OS === "android" ? onKeyboardMove : undefined,
135
135
  onKeyboardMoveInteractive: onKeyboardMove,
136
136
  onFocusedInputLayoutChangedReanimated: inputLayoutHandler,
137
137
  onFocusedInputTextChangedReanimated: inputTextHandler,
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useMemo","useState","Animated","Platform","StyleSheet","Reanimated","useSharedValue","KeyboardControllerView","KeyboardContext","useAnimatedValue","useSharedHandlers","applyMonkeyPatch","revertMonkeyPatch","useAnimatedKeyboardHandler","useFocusedInputLayoutHandler","useFocusedInputTextHandler","KeyboardControllerViewAnimated","createAnimatedComponent","styles","create","container","flex","hidden","display","position","KeyboardProvider","children","statusBarTranslucent","navigationBarTranslucent","enabled","initiallyEnabled","setEnabled","progress","height","progressSV","heightSV","layout","setKeyboardHandlers","broadcastKeyboardEvents","setInputHandlers","broadcastInputEvents","context","animated","multiply","reanimated","style","transform","translateX","translateY","onKeyboardMove","event","nativeEvent","useNativeDriver","updateSharedValues","platforms","includes","OS","value","keyboardHandler","onKeyboardMoveStart","onKeyboardMoveEnd","onKeyboardMoveInteractive","inputLayoutHandler","onFocusedInputLayoutChanged","e","target","inputTextHandler","onFocusedInputTextChanged","undefined"],"sources":["animated.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport { Animated, Platform, StyleSheet } from 'react-native';\nimport Reanimated, { useSharedValue } from 'react-native-reanimated';\n\nimport { KeyboardControllerView } from './bindings';\nimport { KeyboardContext } from './context';\nimport { useAnimatedValue, useSharedHandlers } from './internal';\nimport { applyMonkeyPatch, revertMonkeyPatch } from './monkey-patch';\nimport {\n useAnimatedKeyboardHandler,\n useFocusedInputLayoutHandler,\n useFocusedInputTextHandler,\n} from './reanimated';\n\nimport type { KeyboardAnimationContext } from './context';\nimport type {\n FocusedInputHandler,\n FocusedInputLayoutChangedEvent,\n KeyboardControllerProps,\n KeyboardHandler,\n NativeEvent,\n} from './types';\nimport type { ViewStyle } from 'react-native';\n\nconst KeyboardControllerViewAnimated = Reanimated.createAnimatedComponent(\n Animated.createAnimatedComponent(\n KeyboardControllerView\n ) as React.FC<KeyboardControllerProps>\n);\n\ntype Styles = {\n container: ViewStyle;\n hidden: ViewStyle;\n};\n\nconst styles = StyleSheet.create<Styles>({\n container: {\n flex: 1,\n },\n hidden: {\n display: 'none',\n position: 'absolute',\n },\n});\n\ntype KeyboardProviderProps = {\n children: React.ReactNode;\n /**\n * Set the value to `true`, if you use translucent status bar on Android.\n * If you already control status bar translucency via `react-native-screens`\n * or `StatusBar` component from `react-native`, you can ignore it.\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/14\n * @platform android\n */\n statusBarTranslucent?: boolean;\n /**\n * Set the value to `true`, if you use translucent navigation bar on Android.\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/119\n * @platform android\n */\n navigationBarTranslucent?: boolean;\n /**\n * A boolean prop indicating whether the module is enabled. It indicate only initial state,\n * i. e. if you try to change this prop after component mount it will not have any effect.\n * To change the property in runtime use `useKeyboardController` hook and `setEnabled` method.\n * Defaults to `true`.\n */\n enabled?: boolean;\n};\n\nexport const KeyboardProvider = ({\n children,\n statusBarTranslucent,\n navigationBarTranslucent,\n enabled: initiallyEnabled = true,\n}: KeyboardProviderProps) => {\n // state\n const [enabled, setEnabled] = useState(initiallyEnabled);\n // animated values\n const progress = useAnimatedValue(0);\n const height = useAnimatedValue(0);\n // shared values\n const progressSV = useSharedValue(0);\n const heightSV = useSharedValue(0);\n const layout = useSharedValue<FocusedInputLayoutChangedEvent | null>(null);\n const [setKeyboardHandlers, broadcastKeyboardEvents] =\n useSharedHandlers<KeyboardHandler>();\n const [setInputHandlers, broadcastInputEvents] =\n useSharedHandlers<FocusedInputHandler>();\n // memo\n const context = useMemo<KeyboardAnimationContext>(\n () => ({\n enabled,\n animated: { progress: progress, height: Animated.multiply(height, -1) },\n reanimated: { progress: progressSV, height: heightSV },\n layout,\n setKeyboardHandlers,\n setInputHandlers,\n setEnabled,\n }),\n [enabled]\n );\n const style = useMemo(\n () => [\n styles.hidden,\n { transform: [{ translateX: height }, { translateY: progress }] },\n ],\n []\n );\n const onKeyboardMove = useMemo(\n () =>\n Animated.event(\n [\n {\n nativeEvent: {\n progress,\n height,\n },\n },\n ],\n { useNativeDriver: true }\n ),\n []\n );\n // handlers\n const updateSharedValues = (event: NativeEvent, platforms: string[]) => {\n 'worklet';\n\n if (platforms.includes(Platform.OS)) {\n progressSV.value = event.progress;\n heightSV.value = -event.height;\n }\n };\n const keyboardHandler = useAnimatedKeyboardHandler(\n {\n onKeyboardMoveStart: (event: NativeEvent) => {\n 'worklet';\n\n broadcastKeyboardEvents('onStart', event);\n updateSharedValues(event, ['ios']);\n },\n onKeyboardMove: (event: NativeEvent) => {\n 'worklet';\n\n broadcastKeyboardEvents('onMove', event);\n updateSharedValues(event, ['android']);\n },\n onKeyboardMoveEnd: (event: NativeEvent) => {\n 'worklet';\n\n broadcastKeyboardEvents('onEnd', event);\n },\n onKeyboardMoveInteractive: (event: NativeEvent) => {\n 'worklet';\n\n updateSharedValues(event, ['android', 'ios']);\n broadcastKeyboardEvents('onInteractive', event);\n },\n },\n []\n );\n const inputLayoutHandler = useFocusedInputLayoutHandler(\n {\n onFocusedInputLayoutChanged: (e) => {\n 'worklet';\n\n if (e.target !== -1) {\n layout.value = e;\n } else {\n layout.value = null;\n }\n },\n },\n []\n );\n const inputTextHandler = useFocusedInputTextHandler(\n {\n onFocusedInputTextChanged: (e) => {\n 'worklet';\n\n broadcastInputEvents('onChangeText', e);\n },\n },\n []\n );\n // effects\n useEffect(() => {\n if (enabled) {\n applyMonkeyPatch();\n } else {\n revertMonkeyPatch();\n }\n }, [enabled]);\n\n return (\n <KeyboardContext.Provider value={context}>\n <KeyboardControllerViewAnimated\n enabled={enabled}\n onKeyboardMoveReanimated={keyboardHandler}\n onKeyboardMoveStart={Platform.OS === 'ios' ? onKeyboardMove : undefined}\n onKeyboardMove={Platform.OS === 'android' ? onKeyboardMove : undefined}\n onKeyboardMoveInteractive={onKeyboardMove}\n onFocusedInputLayoutChangedReanimated={inputLayoutHandler}\n onFocusedInputTextChangedReanimated={inputTextHandler}\n navigationBarTranslucent={navigationBarTranslucent}\n statusBarTranslucent={statusBarTranslucent}\n style={styles.container}\n >\n {children}\n </KeyboardControllerViewAnimated>\n <Animated.View\n // we are using this small hack, because if the component (where\n // animated value has been used) is unmounted, then animation will\n // stop receiving events (seems like it's react-native optimization).\n // So we need to keep a reference to the animated value, to keep it's\n // always mounted (keep a reference to an animated value).\n //\n // To test why it's needed, try to open screen which consumes Animated.Value\n // then close it and open it again (for example 'Animated transition').\n style={style}\n />\n </KeyboardContext.Provider>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC3D,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAC7D,OAAOC,UAAU,IAAIC,cAAc,QAAQ,yBAAyB;AAEpE,SAASC,sBAAsB,QAAQ,YAAY;AACnD,SAASC,eAAe,QAAQ,WAAW;AAC3C,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,YAAY;AAChE,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,gBAAgB;AACpE,SACEC,0BAA0B,EAC1BC,4BAA4B,EAC5BC,0BAA0B,QACrB,cAAc;AAYrB,MAAMC,8BAA8B,GAAGX,UAAU,CAACY,uBAAuB,CACvEf,QAAQ,CAACe,uBAAuB,CAC9BV,sBAAsB,CACvB,CACF;AAOD,MAAMW,MAAM,GAAGd,UAAU,CAACe,MAAM,CAAS;EACvCC,SAAS,EAAE;IACTC,IAAI,EAAE;EACR,CAAC;EACDC,MAAM,EAAE;IACNC,OAAO,EAAE,MAAM;IACfC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AA+BF,OAAO,MAAMC,gBAAgB,GAAG,QAKH;EAAA,IALI;IAC/BC,QAAQ;IACRC,oBAAoB;IACpBC,wBAAwB;IACxBC,OAAO,EAAEC,gBAAgB,GAAG;EACP,CAAC;EACtB;EACA,MAAM,CAACD,OAAO,EAAEE,UAAU,CAAC,GAAG9B,QAAQ,CAAC6B,gBAAgB,CAAC;EACxD;EACA,MAAME,QAAQ,GAAGvB,gBAAgB,CAAC,CAAC,CAAC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,IAAK;MAChC,SAAS;;MAETxB,oBAAoB,CAAC,cAAc,EAAEwB,CAAC,CAAC;IACzC;EACF,CAAC,EACD,EAAE,CACH;EACD;EACAjE,SAAS,CAAC,MAAM;IACd,IAAI8B,OAAO,EAAE;MACXlB,gBAAgB,EAAE;IACpB,CAAC,MAAM;MACLC,iBAAiB,EAAE;IACrB;EACF,CAAC,EAAE,CAACiB,OAAO,CAAC,CAAC;EAEb,oBACE,oBAAC,eAAe,CAAC,QAAQ;IAAC,KAAK,EAAEY;EAAQ,gBACvC,oBAAC,8BAA8B;IAC7B,OAAO,EAAEZ,OAAQ;IACjB,wBAAwB,EAAE6B,eAAgB;IAC1C,mBAAmB,EAAEvD,QAAQ,CAACqD,EAAE,KAAK,KAAK,GAAGP,cAAc,GAAGmB,SAAU;IACxE,cAAc,EAAEjE,QAAQ,CAACqD,EAAE,KAAK,SAAS,GAAGP,cAAc,GAAGmB,SAAU;IACvE,yBAAyB,EAAEnB,cAAe;IAC1C,qCAAqC,EAAEa,kBAAmB;IAC1D,mCAAmC,EAAEI,gBAAiB;IACtD,wBAAwB,EAAEtC,wBAAyB;IACnD,oBAAoB,EAAED,oBAAqB;IAC3C,KAAK,EAAET,MAAM,CAACE;EAAU,GAEvBM,QAAQ,CACsB,eACjC,oBAAC,QAAQ,CAAC,IAAI;IACZ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,KAAK,EAAEmB;EAAM,EACb,CACuB;AAE/B,CAAC"}
1
+ {"version":3,"names":["React","useEffect","useMemo","useState","Animated","Platform","StyleSheet","Reanimated","useSharedValue","KeyboardControllerView","KeyboardContext","useAnimatedValue","useSharedHandlers","applyMonkeyPatch","revertMonkeyPatch","useAnimatedKeyboardHandler","useFocusedInputLayoutHandler","useFocusedInputTextHandler","KeyboardControllerViewAnimated","createAnimatedComponent","styles","create","container","flex","hidden","display","position","KeyboardProvider","_ref","children","statusBarTranslucent","navigationBarTranslucent","enabled","initiallyEnabled","setEnabled","progress","height","progressSV","heightSV","layout","setKeyboardHandlers","broadcastKeyboardEvents","setInputHandlers","broadcastInputEvents","context","animated","multiply","reanimated","style","transform","translateX","translateY","onKeyboardMove","event","nativeEvent","useNativeDriver","updateSharedValues","platforms","includes","OS","value","keyboardHandler","onKeyboardMoveStart","onKeyboardMoveEnd","onKeyboardMoveInteractive","inputLayoutHandler","onFocusedInputLayoutChanged","e","target","inputTextHandler","onFocusedInputTextChanged","createElement","Provider","onKeyboardMoveReanimated","undefined","onFocusedInputLayoutChangedReanimated","onFocusedInputTextChangedReanimated","View"],"sources":["animated.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { Animated, Platform, StyleSheet } from \"react-native\";\nimport Reanimated, { useSharedValue } from \"react-native-reanimated\";\n\nimport { KeyboardControllerView } from \"./bindings\";\nimport { KeyboardContext } from \"./context\";\nimport { useAnimatedValue, useSharedHandlers } from \"./internal\";\nimport { applyMonkeyPatch, revertMonkeyPatch } from \"./monkey-patch\";\nimport {\n useAnimatedKeyboardHandler,\n useFocusedInputLayoutHandler,\n useFocusedInputTextHandler,\n} from \"./reanimated\";\n\nimport type { KeyboardAnimationContext } from \"./context\";\nimport type {\n FocusedInputHandler,\n FocusedInputLayoutChangedEvent,\n KeyboardControllerProps,\n KeyboardHandler,\n NativeEvent,\n} from \"./types\";\nimport type { ViewStyle } from \"react-native\";\n\nconst KeyboardControllerViewAnimated = Reanimated.createAnimatedComponent(\n Animated.createAnimatedComponent(\n KeyboardControllerView,\n ) as React.FC<KeyboardControllerProps>,\n);\n\ntype Styles = {\n container: ViewStyle;\n hidden: ViewStyle;\n};\n\nconst styles = StyleSheet.create<Styles>({\n container: {\n flex: 1,\n },\n hidden: {\n display: \"none\",\n position: \"absolute\",\n },\n});\n\ntype KeyboardProviderProps = {\n children: React.ReactNode;\n /**\n * Set the value to `true`, if you use translucent status bar on Android.\n * If you already control status bar translucency via `react-native-screens`\n * or `StatusBar` component from `react-native`, you can ignore it.\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/14\n * @platform android\n */\n statusBarTranslucent?: boolean;\n /**\n * Set the value to `true`, if you use translucent navigation bar on Android.\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/119\n * @platform android\n */\n navigationBarTranslucent?: boolean;\n /**\n * A boolean prop indicating whether the module is enabled. It indicate only initial state,\n * i. e. if you try to change this prop after component mount it will not have any effect.\n * To change the property in runtime use `useKeyboardController` hook and `setEnabled` method.\n * Defaults to `true`.\n */\n enabled?: boolean;\n};\n\nexport const KeyboardProvider = ({\n children,\n statusBarTranslucent,\n navigationBarTranslucent,\n enabled: initiallyEnabled = true,\n}: KeyboardProviderProps) => {\n // state\n const [enabled, setEnabled] = useState(initiallyEnabled);\n // animated values\n const progress = useAnimatedValue(0);\n const height = useAnimatedValue(0);\n // shared values\n const progressSV = useSharedValue(0);\n const heightSV = useSharedValue(0);\n const layout = useSharedValue<FocusedInputLayoutChangedEvent | null>(null);\n const [setKeyboardHandlers, broadcastKeyboardEvents] =\n useSharedHandlers<KeyboardHandler>();\n const [setInputHandlers, broadcastInputEvents] =\n useSharedHandlers<FocusedInputHandler>();\n // memo\n const context = useMemo<KeyboardAnimationContext>(\n () => ({\n enabled,\n animated: { progress: progress, height: Animated.multiply(height, -1) },\n reanimated: { progress: progressSV, height: heightSV },\n layout,\n setKeyboardHandlers,\n setInputHandlers,\n setEnabled,\n }),\n [enabled],\n );\n const style = useMemo(\n () => [\n styles.hidden,\n { transform: [{ translateX: height }, { translateY: progress }] },\n ],\n [],\n );\n const onKeyboardMove = useMemo(\n () =>\n Animated.event(\n [\n {\n nativeEvent: {\n progress,\n height,\n },\n },\n ],\n { useNativeDriver: true },\n ),\n [],\n );\n // handlers\n const updateSharedValues = (event: NativeEvent, platforms: string[]) => {\n \"worklet\";\n\n if (platforms.includes(Platform.OS)) {\n progressSV.value = event.progress;\n heightSV.value = -event.height;\n }\n };\n const keyboardHandler = useAnimatedKeyboardHandler(\n {\n onKeyboardMoveStart: (event: NativeEvent) => {\n \"worklet\";\n\n broadcastKeyboardEvents(\"onStart\", event);\n updateSharedValues(event, [\"ios\"]);\n },\n onKeyboardMove: (event: NativeEvent) => {\n \"worklet\";\n\n broadcastKeyboardEvents(\"onMove\", event);\n updateSharedValues(event, [\"android\"]);\n },\n onKeyboardMoveEnd: (event: NativeEvent) => {\n \"worklet\";\n\n broadcastKeyboardEvents(\"onEnd\", event);\n },\n onKeyboardMoveInteractive: (event: NativeEvent) => {\n \"worklet\";\n\n updateSharedValues(event, [\"android\", \"ios\"]);\n broadcastKeyboardEvents(\"onInteractive\", event);\n },\n },\n [],\n );\n const inputLayoutHandler = useFocusedInputLayoutHandler(\n {\n onFocusedInputLayoutChanged: (e) => {\n \"worklet\";\n\n if (e.target !== -1) {\n layout.value = e;\n } else {\n layout.value = null;\n }\n },\n },\n [],\n );\n const inputTextHandler = useFocusedInputTextHandler(\n {\n onFocusedInputTextChanged: (e) => {\n \"worklet\";\n\n broadcastInputEvents(\"onChangeText\", e);\n },\n },\n [],\n );\n // effects\n useEffect(() => {\n if (enabled) {\n applyMonkeyPatch();\n } else {\n revertMonkeyPatch();\n }\n }, [enabled]);\n\n return (\n <KeyboardContext.Provider value={context}>\n <KeyboardControllerViewAnimated\n enabled={enabled}\n onKeyboardMoveReanimated={keyboardHandler}\n onKeyboardMoveStart={Platform.OS === \"ios\" ? onKeyboardMove : undefined}\n onKeyboardMove={Platform.OS === \"android\" ? onKeyboardMove : undefined}\n onKeyboardMoveInteractive={onKeyboardMove}\n onFocusedInputLayoutChangedReanimated={inputLayoutHandler}\n onFocusedInputTextChangedReanimated={inputTextHandler}\n navigationBarTranslucent={navigationBarTranslucent}\n statusBarTranslucent={statusBarTranslucent}\n style={styles.container}\n >\n {children}\n </KeyboardControllerViewAnimated>\n <Animated.View\n // we are using this small hack, because if the component (where\n // animated value has been used) is unmounted, then animation will\n // stop receiving events (seems like it's react-native optimization).\n // So we need to keep a reference to the animated value, to keep it's\n // always mounted (keep a reference to an animated value).\n //\n // To test why it's needed, try to open screen which consumes Animated.Value\n // then close it and open it again (for example 'Animated transition').\n style={style}\n />\n </KeyboardContext.Provider>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC3D,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAC7D,OAAOC,UAAU,IAAIC,cAAc,QAAQ,yBAAyB;AAEpE,SAASC,sBAAsB,QAAQ,YAAY;AACnD,SAASC,eAAe,QAAQ,WAAW;AAC3C,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,YAAY;AAChE,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,gBAAgB;AACpE,SACEC,0BAA0B,EAC1BC,4BAA4B,EAC5BC,0BAA0B,QACrB,cAAc;AAYrB,MAAMC,8BAA8B,GAAGX,UAAU,CAACY,uBAAuB,CACvEf,QAAQ,CAACe,uBAAuB,CAC9BV,sBACF,CACF,CAAC;AAOD,MAAMW,MAAM,GAAGd,UAAU,CAACe,MAAM,CAAS;EACvCC,SAAS,EAAE;IACTC,IAAI,EAAE;EACR,CAAC;EACDC,MAAM,EAAE;IACNC,OAAO,EAAE,MAAM;IACfC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AA+BF,OAAO,MAAMC,gBAAgB,GAAGC,IAAA,IAKH;EAAA,IALI;IAC/BC,QAAQ;IACRC,oBAAoB;IACpBC,wBAAwB;IACxBC,OAAO,EAAEC,gBAAgB,GAAG;EACP,CAAC,GAAAL,IAAA;EACtB;EACA,MAAM,CAACI,OAAO,EAAEE,UAAU,CAAC,GAAG/B,QAAQ,CAAC8B,gBAAgB,CAAC;EACxD;EACA,MAAME,QAAQ,GAAGxB,gBAAgB,CAAC,CAAC,CAAC;EACpC,MAAMyB,MAAM,GAAGzB,gBAAgB,CAAC,CAAC,CAAC;EAClC;EACA,MAAM0B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,CAAC;IACzC;EACF,CAAC,EACD,EACF,CAAC;EACD;EACAlE,SAAS,CAAC,MAAM;IACd,IAAI+B,OAAO,EAAE;MACXnB,gBAAgB,CAAC,CAAC;IACpB,CAAC,MAAM;MACLC,iBAAiB,CAAC,CAAC;IACrB;EACF,CAAC,EAAE,CAACkB,OAAO,CAAC,CAAC;EAEb,oBACEhC,KAAA,CAAAuE,aAAA,CAAC7D,eAAe,CAAC8D,QAAQ;IAACZ,KAAK,EAAEhB;EAAQ,gBACvC5C,KAAA,CAAAuE,aAAA,CAACrD,8BAA8B;IAC7Bc,OAAO,EAAEA,OAAQ;IACjByC,wBAAwB,EAAEZ,eAAgB;IAC1CC,mBAAmB,EAAEzD,QAAQ,CAACsD,EAAE,KAAK,KAAK,GAAGP,cAAc,GAAGsB,SAAU;IACxEtB,cAAc,EAAE/C,QAAQ,CAACsD,EAAE,KAAK,SAAS,GAAGP,cAAc,GAAGsB,SAAU;IACvEV,yBAAyB,EAAEZ,cAAe;IAC1CuB,qCAAqC,EAAEV,kBAAmB;IAC1DW,mCAAmC,EAAEP,gBAAiB;IACtDtC,wBAAwB,EAAEA,wBAAyB;IACnDD,oBAAoB,EAAEA,oBAAqB;IAC3CkB,KAAK,EAAE5B,MAAM,CAACE;EAAU,GAEvBO,QAC6B,CAAC,eACjC7B,KAAA,CAAAuE,aAAA,CAACnE,QAAQ,CAACyE,IAAI;IACZ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA7B,KAAK,EAAEA;EAAM,CACd,CACuB,CAAC;AAE/B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { View } from 'react-native';
1
+ import { View } from "react-native";
2
2
  const NOOP = () => {};
3
3
  export const KeyboardController = {
4
4
  setDefaultMode: NOOP,
@@ -1 +1 @@
1
- {"version":3,"names":["View","NOOP","KeyboardController","setDefaultMode","setInputMode","dismiss","addListener","removeListeners","KeyboardEvents","remove","KeyboardControllerView","KeyboardGestureArea"],"sources":["bindings.ts"],"sourcesContent":["import { View } from 'react-native';\n\nimport type {\n KeyboardControllerModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardGestureAreaProps,\n} from './types';\nimport type { EmitterSubscription } from 'react-native';\n\nconst NOOP = () => {};\nexport const KeyboardController: KeyboardControllerModule = {\n setDefaultMode: NOOP,\n setInputMode: NOOP,\n dismiss: NOOP,\n addListener: NOOP,\n removeListeners: NOOP,\n};\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\nexport const KeyboardControllerView =\n View as unknown as React.FC<KeyboardControllerProps>;\nexport const KeyboardGestureArea =\n View as unknown as React.FC<KeyboardGestureAreaProps>;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,cAAc;AAUnC,MAAMC,IAAI,GAAG,MAAM,CAAC,CAAC;AACrB,OAAO,MAAMC,kBAA4C,GAAG;EAC1DC,cAAc,EAAEF,IAAI;EACpBG,YAAY,EAAEH,IAAI;EAClBI,OAAO,EAAEJ,IAAI;EACbK,WAAW,EAAEL,IAAI;EACjBM,eAAe,EAAEN;AACnB,CAAC;AACD,OAAO,MAAMO,cAAoC,GAAG;EAClDF,WAAW,EAAE,OAAO;IAAEG,MAAM,EAAER;EAAK,CAAC;AACtC,CAAC;AACD,OAAO,MAAMS,sBAAsB,GACjCV,IAAoD;AACtD,OAAO,MAAMW,mBAAmB,GAC9BX,IAAqD"}
1
+ {"version":3,"names":["View","NOOP","KeyboardController","setDefaultMode","setInputMode","dismiss","addListener","removeListeners","KeyboardEvents","remove","KeyboardControllerView","KeyboardGestureArea"],"sources":["bindings.ts"],"sourcesContent":["import { View } from \"react-native\";\n\nimport type {\n KeyboardControllerModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardGestureAreaProps,\n} from \"./types\";\nimport type { EmitterSubscription } from \"react-native\";\n\nconst NOOP = () => {};\nexport const KeyboardController: KeyboardControllerModule = {\n setDefaultMode: NOOP,\n setInputMode: NOOP,\n dismiss: NOOP,\n addListener: NOOP,\n removeListeners: NOOP,\n};\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\nexport const KeyboardControllerView =\n View as unknown as React.FC<KeyboardControllerProps>;\nexport const KeyboardGestureArea =\n View as unknown as React.FC<KeyboardGestureAreaProps>;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,cAAc;AAUnC,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,OAAO,MAAMC,kBAA4C,GAAG;EAC1DC,cAAc,EAAEF,IAAI;EACpBG,YAAY,EAAEH,IAAI;EAClBI,OAAO,EAAEJ,IAAI;EACbK,WAAW,EAAEL,IAAI;EACjBM,eAAe,EAAEN;AACnB,CAAC;AACD,OAAO,MAAMO,cAAoC,GAAG;EAClDF,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAER;EAAK,CAAC;AACtC,CAAC;AACD,OAAO,MAAMS,sBAAsB,GACjCV,IAAoD;AACtD,OAAO,MAAMW,mBAAmB,GAC9BX,IAAqD"}