react-native-keyboard-controller 1.11.2 → 1.11.4

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 (129) hide show
  1. package/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt +52 -60
  2. package/ios/KeyboardController.xcodeproj/project.pbxproj +4 -0
  3. package/ios/observers/KeyboardMovementObserver.swift +1 -25
  4. package/ios/traversal/KeyboardView.swift +36 -0
  5. package/lib/commonjs/animated.js +14 -12
  6. package/lib/commonjs/animated.js.map +1 -1
  7. package/lib/commonjs/bindings.js +5 -10
  8. package/lib/commonjs/bindings.js.map +1 -1
  9. package/lib/commonjs/bindings.native.js +7 -15
  10. package/lib/commonjs/bindings.native.js.map +1 -1
  11. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js.map +1 -1
  12. package/lib/commonjs/components/KeyboardAvoidingView/index.js +16 -23
  13. package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
  14. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +17 -19
  15. package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
  16. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +7 -7
  17. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
  18. package/lib/commonjs/components/KeyboardAwareScrollView/utils.js +3 -4
  19. package/lib/commonjs/components/KeyboardAwareScrollView/utils.js.map +1 -1
  20. package/lib/commonjs/components/KeyboardStickyView/index.js +15 -21
  21. package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -1
  22. package/lib/commonjs/components/KeyboardToolbar/Arrow.js +8 -10
  23. package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -1
  24. package/lib/commonjs/components/KeyboardToolbar/Button.js +23 -26
  25. package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -1
  26. package/lib/commonjs/components/KeyboardToolbar/colors.js +1 -2
  27. package/lib/commonjs/components/KeyboardToolbar/colors.js.map +1 -1
  28. package/lib/commonjs/components/KeyboardToolbar/colors.native.js +1 -2
  29. package/lib/commonjs/components/KeyboardToolbar/colors.native.js.map +1 -1
  30. package/lib/commonjs/components/KeyboardToolbar/index.js +13 -14
  31. package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
  32. package/lib/commonjs/components/KeyboardToolbar/types.js.map +1 -1
  33. package/lib/commonjs/components/hooks/useColorScheme.js +1 -2
  34. package/lib/commonjs/components/hooks/useColorScheme.js.map +1 -1
  35. package/lib/commonjs/components/index.js +2 -8
  36. package/lib/commonjs/components/index.js.map +1 -1
  37. package/lib/commonjs/constants.js +3 -4
  38. package/lib/commonjs/constants.js.map +1 -1
  39. package/lib/commonjs/context.js +1 -2
  40. package/lib/commonjs/context.js.map +1 -1
  41. package/lib/commonjs/hooks.js.map +1 -1
  42. package/lib/commonjs/index.js +1 -8
  43. package/lib/commonjs/index.js.map +1 -1
  44. package/lib/commonjs/internal.js +1 -1
  45. package/lib/commonjs/internal.js.map +1 -1
  46. package/lib/commonjs/monkey-patch.android.js +38 -26
  47. package/lib/commonjs/monkey-patch.android.js.map +1 -1
  48. package/lib/commonjs/monkey-patch.js +2 -4
  49. package/lib/commonjs/monkey-patch.js.map +1 -1
  50. package/lib/commonjs/reanimated.js +3 -6
  51. package/lib/commonjs/reanimated.js.map +1 -1
  52. package/lib/commonjs/reanimated.native.js.map +1 -1
  53. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js +1 -2
  54. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  55. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js +1 -2
  56. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  57. package/lib/commonjs/specs/NativeKeyboardController.js +1 -2
  58. package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
  59. package/lib/commonjs/specs/NativeStatusBarManagerCompat.js +1 -2
  60. package/lib/commonjs/specs/NativeStatusBarManagerCompat.js.map +1 -1
  61. package/lib/commonjs/types.js.map +1 -1
  62. package/lib/commonjs/utils.js.map +1 -1
  63. package/lib/module/animated.js +12 -10
  64. package/lib/module/animated.js.map +1 -1
  65. package/lib/module/bindings.js.map +1 -1
  66. package/lib/module/bindings.native.js +3 -6
  67. package/lib/module/bindings.native.js.map +1 -1
  68. package/lib/module/components/KeyboardAvoidingView/hooks.js.map +1 -1
  69. package/lib/module/components/KeyboardAvoidingView/index.js +14 -19
  70. package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
  71. package/lib/module/components/KeyboardAwareScrollView/index.js +15 -16
  72. package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
  73. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +7 -7
  74. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
  75. package/lib/module/components/KeyboardAwareScrollView/utils.js +3 -4
  76. package/lib/module/components/KeyboardAwareScrollView/utils.js.map +1 -1
  77. package/lib/module/components/KeyboardStickyView/index.js +13 -17
  78. package/lib/module/components/KeyboardStickyView/index.js.map +1 -1
  79. package/lib/module/components/KeyboardToolbar/Arrow.js +5 -6
  80. package/lib/module/components/KeyboardToolbar/Arrow.js.map +1 -1
  81. package/lib/module/components/KeyboardToolbar/Button.js +20 -22
  82. package/lib/module/components/KeyboardToolbar/Button.js.map +1 -1
  83. package/lib/module/components/KeyboardToolbar/colors.js.map +1 -1
  84. package/lib/module/components/KeyboardToolbar/colors.native.js.map +1 -1
  85. package/lib/module/components/KeyboardToolbar/index.js +10 -10
  86. package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
  87. package/lib/module/components/KeyboardToolbar/types.js.map +1 -1
  88. package/lib/module/components/hooks/useColorScheme.js.map +1 -1
  89. package/lib/module/components/index.js +1 -1
  90. package/lib/module/components/index.js.map +1 -1
  91. package/lib/module/constants.js +3 -3
  92. package/lib/module/constants.js.map +1 -1
  93. package/lib/module/context.js.map +1 -1
  94. package/lib/module/hooks.js.map +1 -1
  95. package/lib/module/index.js +1 -1
  96. package/lib/module/index.js.map +1 -1
  97. package/lib/module/internal.js +1 -1
  98. package/lib/module/internal.js.map +1 -1
  99. package/lib/module/monkey-patch.android.js +36 -24
  100. package/lib/module/monkey-patch.android.js.map +1 -1
  101. package/lib/module/monkey-patch.js.map +1 -1
  102. package/lib/module/reanimated.js.map +1 -1
  103. package/lib/module/reanimated.native.js.map +1 -1
  104. package/lib/module/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  105. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  106. package/lib/module/specs/NativeKeyboardController.js.map +1 -1
  107. package/lib/module/specs/NativeStatusBarManagerCompat.js.map +1 -1
  108. package/lib/module/types.js.map +1 -1
  109. package/lib/module/utils.js.map +1 -1
  110. package/lib/typescript/animated.d.ts +1 -1
  111. package/lib/typescript/components/KeyboardToolbar/Button.d.ts +1 -1
  112. package/lib/typescript/components/KeyboardToolbar/index.d.ts +5 -0
  113. package/lib/typescript/components/index.d.ts +2 -1
  114. package/lib/typescript/index.d.ts +2 -1
  115. package/package.json +7 -7
  116. package/src/animated.tsx +7 -3
  117. package/src/components/KeyboardAvoidingView/index.tsx +7 -8
  118. package/src/components/KeyboardAwareScrollView/index.tsx +4 -4
  119. package/src/components/KeyboardStickyView/index.tsx +6 -6
  120. package/src/components/KeyboardToolbar/index.tsx +38 -20
  121. package/src/components/index.ts +1 -1
  122. package/src/index.ts +1 -1
  123. package/src/monkey-patch.android.ts +31 -26
  124. package/lib/commonjs/components/hooks/useKeyboardInterpolation.js +0 -89
  125. package/lib/commonjs/components/hooks/useKeyboardInterpolation.js.map +0 -1
  126. package/lib/module/components/hooks/useKeyboardInterpolation.js +0 -82
  127. package/lib/module/components/hooks/useKeyboardInterpolation.js.map +0 -1
  128. package/lib/typescript/components/hooks/useKeyboardInterpolation.d.ts +0 -20
  129. package/src/components/hooks/useKeyboardInterpolation.ts +0 -109
@@ -5,42 +5,54 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.revertMonkeyPatch = exports.applyMonkeyPatch = void 0;
7
7
  var NativeAndroidManager = _interopRequireWildcard(require("react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid"));
8
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
9
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
8
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
10
  // @ts-expect-error because there is no corresponding type definition
11
11
 
12
- const DefaultNativeAndroidManager = NativeAndroidManager.default;
13
- const getConstants = NativeAndroidManager.default.getConstants;
14
- const RCTStatusBarManagerCompat = require("./specs/NativeStatusBarManagerCompat").default;
12
+ const RCTStatusBarManagerCompat =
13
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
14
+ require("./specs/NativeStatusBarManagerCompat").default;
15
15
 
16
+ // Copy original default manager to keep its original state and methods
17
+ const OriginalNativeAndroidManager = {
18
+ ...NativeAndroidManager.default
19
+ };
20
+
21
+ // Create a new object that modifies the necessary methods
16
22
  // On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so
17
23
  // in order to use library on all available platforms we have to monkey patch
18
24
  // default RN implementation and use modern `WindowInsetsControllerCompat`.
25
+ const ModifiedNativeAndroidManager = {
26
+ ...NativeAndroidManager.default,
27
+ // Spread original properties to keep existing functionality
28
+ setColor: (color, animated) => {
29
+ RCTStatusBarManagerCompat.setColor(color, animated);
30
+ },
31
+ setTranslucent: translucent => {
32
+ RCTStatusBarManagerCompat.setTranslucent(translucent);
33
+ },
34
+ /**
35
+ * - statusBarStyles can be:
36
+ * - 'default'
37
+ * - 'dark-content'
38
+ */
39
+ setStyle: statusBarStyle => {
40
+ RCTStatusBarManagerCompat.setStyle(statusBarStyle);
41
+ },
42
+ setHidden: hidden => {
43
+ RCTStatusBarManagerCompat.setHidden(hidden);
44
+ }
45
+ };
46
+
47
+ // Define a function to apply the monkey patch
19
48
  const applyMonkeyPatch = () => {
20
- NativeAndroidManager.default = {
21
- getConstants,
22
- setColor(color, animated) {
23
- RCTStatusBarManagerCompat.setColor(color, animated);
24
- },
25
- setTranslucent(translucent) {
26
- RCTStatusBarManagerCompat.setTranslucent(translucent);
27
- },
28
- /**
29
- * - statusBarStyles can be:
30
- * - 'default'
31
- * - 'dark-content'
32
- */
33
- setStyle(statusBarStyle) {
34
- RCTStatusBarManagerCompat.setStyle(statusBarStyle);
35
- },
36
- setHidden(hidden) {
37
- RCTStatusBarManagerCompat.setHidden(hidden);
38
- }
39
- };
49
+ Object.assign(NativeAndroidManager.default, ModifiedNativeAndroidManager);
40
50
  };
51
+
52
+ // Define a function to revert changes back to the original state
41
53
  exports.applyMonkeyPatch = applyMonkeyPatch;
42
54
  const revertMonkeyPatch = () => {
43
- NativeAndroidManager.default = DefaultNativeAndroidManager;
55
+ Object.assign(NativeAndroidManager.default, OriginalNativeAndroidManager);
44
56
  };
45
57
  exports.revertMonkeyPatch = revertMonkeyPatch;
46
58
  //# sourceMappingURL=monkey-patch.android.js.map
@@ -1 +1 @@
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,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AADlH;;AAGA,MAAMW,2BAA2B,GAAGzB,oBAAoB,CAACU,OAAO;AAChE,MAAMgB,YAAY,GAAG1B,oBAAoB,CAACU,OAAO,CAACgB,YAAY;AAC9D,MAAMC,yBAAyB,GAC7BzB,OAAO,CAAC,sCAAsC,CAAC,CAACQ,OAAO;;AAEzD;AACA;AACA;AACO,MAAMkB,gBAAgB,GAAGA,CAAA,KAAM;EACpC5B,oBAAoB,CAACU,OAAO,GAAG;IAC7BgB,YAAY;IACZG,QAAQA,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
+ {"version":3,"names":["NativeAndroidManager","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","RCTStatusBarManagerCompat","OriginalNativeAndroidManager","ModifiedNativeAndroidManager","setColor","color","animated","setTranslucent","translucent","setStyle","statusBarStyle","setHidden","hidden","applyMonkeyPatch","assign","exports","revertMonkeyPatch"],"sources":["monkey-patch.android.ts"],"sourcesContent":["// @ts-expect-error because there is no corresponding type definition\nimport * as NativeAndroidManager from \"react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid\";\n\nconst RCTStatusBarManagerCompat =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"./specs/NativeStatusBarManagerCompat\").default;\n\n// Copy original default manager to keep its original state and methods\nconst OriginalNativeAndroidManager = { ...NativeAndroidManager.default };\n\n// Create a new object that modifies the necessary methods\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`.\nconst ModifiedNativeAndroidManager = {\n ...NativeAndroidManager.default, // Spread original properties to keep existing functionality\n setColor: (color: number, animated: boolean): void => {\n RCTStatusBarManagerCompat.setColor(color, animated);\n },\n setTranslucent: (translucent: boolean): void => {\n RCTStatusBarManagerCompat.setTranslucent(translucent);\n },\n /**\n * - statusBarStyles can be:\n * - 'default'\n * - 'dark-content'\n */\n setStyle: (statusBarStyle?: string): void => {\n RCTStatusBarManagerCompat.setStyle(statusBarStyle);\n },\n setHidden: (hidden: boolean): void => {\n RCTStatusBarManagerCompat.setHidden(hidden);\n },\n};\n\n// Define a function to apply the monkey patch\nexport const applyMonkeyPatch = () => {\n Object.assign(NativeAndroidManager.default, ModifiedNativeAndroidManager);\n};\n\n// Define a function to revert changes back to the original state\nexport const revertMonkeyPatch = () => {\n Object.assign(NativeAndroidManager.default, OriginalNativeAndroidManager);\n};\n"],"mappings":";;;;;;AACA,IAAAA,oBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAkH,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE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AG;EACnC,GAAG1B,oBAAoB,CAACS,OAAO;EAAE;EACjCkB,QAAQ,EAAEA,CAACC,KAAa,EAAEC,QAAiB,KAAW;IACpDL,yBAAyB,CAACG,QAAQ,CAACC,KAAK,EAAEC,QAAQ,CAAC;EACrD,CAAC;EACDC,cAAc,EAAGC,WAAoB,IAAW;IAC9CP,yBAAyB,CAACM,cAAc,CAACC,WAAW,CAAC;EACvD,CAAC;EACD;AACF;AACA;AACA;AACA;EACEC,QAAQ,EAAGC,cAAuB,IAAW;IAC3CT,yBAAyB,CAACQ,QAAQ,CAACC,cAAc,CAAC;EACpD,CAAC;EACDC,SAAS,EAAGC,MAAe,IAAW;IACpCX,yBAAyB,CAACU,SAAS,CAACC,MAAM,CAAC;EAC7C;AACF,CAAC;;AAED;AACO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EACpCrB,MAAM,CAACsB,MAAM,CAACrC,oBAAoB,CAACS,OAAO,EAAEiB,4BAA4B,CAAC;AAC3E,CAAC;;AAED;AAAAY,OAAA,CAAAF,gBAAA,GAAAA,gBAAA;AACO,MAAMG,iBAAiB,GAAGA,CAAA,KAAM;EACrCxB,MAAM,CAACsB,MAAM,CAACrC,oBAAoB,CAACS,OAAO,EAAEgB,4BAA4B,CAAC;AAC3E,CAAC;AAACa,OAAA,CAAAC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.revertMonkeyPatch = exports.applyMonkeyPatch = void 0;
7
7
  // stub for all platforms
8
8
  const NOOP = () => {};
9
- const applyMonkeyPatch = NOOP;
10
- exports.applyMonkeyPatch = applyMonkeyPatch;
11
- const revertMonkeyPatch = NOOP;
12
- exports.revertMonkeyPatch = revertMonkeyPatch;
9
+ const applyMonkeyPatch = exports.applyMonkeyPatch = NOOP;
10
+ const revertMonkeyPatch = exports.revertMonkeyPatch = NOOP;
13
11
  //# sourceMappingURL=monkey-patch.js.map
@@ -1 +1 @@
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
+ {"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,GAAAC,OAAA,CAAAD,gBAAA,GAAGD,IAAI;AAC7B,MAAMG,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,GAAGH,IAAI","ignoreList":[]}
@@ -5,10 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useFocusedInputTextHandler = exports.useFocusedInputLayoutHandler = exports.useAnimatedKeyboardHandler = void 0;
7
7
  const NOOP = () => () => {};
8
- const useAnimatedKeyboardHandler = NOOP;
9
- exports.useAnimatedKeyboardHandler = useAnimatedKeyboardHandler;
10
- const useFocusedInputLayoutHandler = NOOP;
11
- exports.useFocusedInputLayoutHandler = useFocusedInputLayoutHandler;
12
- const useFocusedInputTextHandler = NOOP;
13
- exports.useFocusedInputTextHandler = useFocusedInputTextHandler;
8
+ const useAnimatedKeyboardHandler = exports.useAnimatedKeyboardHandler = NOOP;
9
+ const useFocusedInputLayoutHandler = exports.useFocusedInputLayoutHandler = NOOP;
10
+ const useFocusedInputTextHandler = exports.useFocusedInputTextHandler = NOOP;
14
11
  //# sourceMappingURL=reanimated.js.map
@@ -1 +1 @@
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"}
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,GAAAC,OAAA,CAAAD,0BAAA,GAAGD,IAAI;AACD,MAAMG,4BAGZ,GAAAD,OAAA,CAAAC,4BAAA,GAAGH,IAAI;AACD,MAAMI,0BAGZ,GAAAF,OAAA,CAAAE,0BAAA,GAAGJ,IAAI","ignoreList":[]}
@@ -1 +1 @@
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,EA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QAAQ;IAEhD,IACEe,2BAA2B,IAC3BT,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,6BAA6B,CAAC,EACvD;MACAG,2BAA2B,CAACT,KAAK,EAAEJ,OAAO,CAAC;IAC7C;EACF,CAAC,EACD,CAAC,6BAA6B,CAAC,EAC/BC,oBACF,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"}
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,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,mBAAmB,CAACD,KAAK,EAAEJ,OAAO,CAAC;IACrC;IAEA,IAAIM,cAAc,IAAIF,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;MAChEJ,cAAc,CAACF,KAAK,EAAEJ,OAAO,CAAC;IAChC;IAEA,IAAIO,iBAAiB,IAAIH,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,mBAAmB,CAAC,EAAE;MACtEH,iBAAiB,CAACH,KAAK,EAAEJ,OAAO,CAAC;IACnC;IAEA,IACEQ,yBAAyB,IACzBJ,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,2BAA2B,CAAC,EACrD;MACAF,yBAAyB,CAACJ,KAAK,EAAEJ,OAAO,CAAC;IAC3C;EACF,CAAC,EACD,CACE,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,2BAA2B,CAC5B,EACDC,oBACF,CAAC;AACH,CAAC;AAACU,OAAA,CAAAd,0BAAA,GAAAA,0BAAA;AAEK,MAAMe,4BAGZ,GAAGA,CAACd,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;MAAES;IAA4B,CAAC,GAAGf,QAAQ;IAEhD,IACEe,2BAA2B,IAC3BT,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,6BAA6B,CAAC,EACvD;MACAG,2BAA2B,CAACT,KAAK,EAAEJ,OAAO,CAAC;IAC7C;EACF,CAAC,EACD,CAAC,6BAA6B,CAAC,EAC/BC,oBACF,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","ignoreList":[]}
@@ -6,6 +6,5 @@ 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");
10
- exports.default = _default;
9
+ var _default = exports.default = (0, _codegenNativeComponent.default)("KeyboardControllerView");
11
10
  //# sourceMappingURL=KeyboardControllerViewNativeComponent.js.map
@@ -1 +1 @@
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 parentScrollViewTarget: 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,GAkD9E,IAAAC,+BAAsB,EACnC,wBACF,CAAC;AAAAC,OAAA,CAAAH,OAAA,GAAAC,QAAA"}
1
+ {"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","obj","__esModule","default","_default","exports","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 parentScrollViewTarget: 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,GAAAC,OAAA,CAAAF,OAAA,GAkD9E,IAAAG,+BAAsB,EACnC,wBACF,CAAC","ignoreList":[]}
@@ -6,8 +6,7 @@ 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", {
9
+ var _default = exports.default = (0, _codegenNativeComponent.default)("KeyboardGestureArea", {
10
10
  excludedPlatforms: ["iOS"]
11
11
  });
12
- exports.default = _default;
13
12
  //# sourceMappingURL=KeyboardGestureAreaNativeComponent.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","obj","__esModule","default","_default","exports","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,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,GAAAC,OAAA,CAAAF,OAAA,GAY9E,IAAAG,+BAAsB,EAAc,qBAAqB,EAAE;EACxEC,iBAAiB,EAAE,CAAC,KAAK;AAC3B,CAAC,CAAC","ignoreList":[]}
@@ -5,6 +5,5 @@ 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");
9
- exports.default = _default;
8
+ var _default = exports.default = _reactNative.TurboModuleRegistry.get("KeyboardController");
10
9
  //# sourceMappingURL=NativeKeyboardController.js.map
@@ -1 +1 @@
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 setFocusTo(direction: string): 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,GAkBpCC,gCAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAJ,QAAA"}
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","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 setFocusTo(direction: string): 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,GAAAC,OAAA,CAAAC,OAAA,GAkBpCC,gCAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC","ignoreList":[]}
@@ -5,6 +5,5 @@ 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");
9
- exports.default = _default;
8
+ var _default = exports.default = _reactNative.TurboModuleRegistry.get("StatusBarManagerCompat");
10
9
  //# sourceMappingURL=NativeStatusBarManagerCompat.js.map
@@ -1 +1 @@
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
+ {"version":3,"names":["_reactNative","require","_default","exports","default","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,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAapCC,gCAAmB,CAACC,GAAG,CAAO,wBAAwB,CAAC","ignoreList":[]}
@@ -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 parentScrollViewTarget: 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 Direction = \"next\" | \"prev\" | \"current\";\nexport type KeyboardControllerModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // all platforms\n dismiss: () => void;\n setFocusTo: (direction: Direction) => 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};\nexport type FocusedInputAvailableEvents = \"focusDidSet\";\nexport type FocusedInputEventData = {\n current: number;\n count: number;\n};\nexport type FocusedInputEventsModule = {\n addListener: (\n name: FocusedInputAvailableEvents,\n cb: (e: FocusedInputEventData) => 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 parentScrollViewTarget: 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 Direction = \"next\" | \"prev\" | \"current\";\nexport type KeyboardControllerModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // all platforms\n dismiss: () => void;\n setFocusTo: (direction: Direction) => 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};\nexport type FocusedInputAvailableEvents = \"focusDidSet\";\nexport type FocusedInputEventData = {\n current: number;\n count: number;\n};\nexport type FocusedInputEventsModule = {\n addListener: (\n name: FocusedInputAvailableEvents,\n cb: (e: FocusedInputEventData) => 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":"","ignoreList":[]}
@@ -1 +1 @@
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
+ {"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","ignoreList":[]}
@@ -16,13 +16,15 @@ const styles = StyleSheet.create({
16
16
  position: "absolute"
17
17
  }
18
18
  });
19
- export const KeyboardProvider = _ref => {
20
- let {
21
- children,
22
- statusBarTranslucent,
23
- navigationBarTranslucent,
24
- enabled: initiallyEnabled = true
25
- } = _ref;
19
+ // capture `Platform.OS` in separate variable to avoid deep workletization of entire RN package
20
+ // see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/393 and https://github.com/kirillzyusko/react-native-keyboard-controller/issues/294 for more details
21
+ const OS = Platform.OS;
22
+ export const KeyboardProvider = ({
23
+ children,
24
+ statusBarTranslucent,
25
+ navigationBarTranslucent,
26
+ enabled: initiallyEnabled = true
27
+ }) => {
26
28
  // state
27
29
  const [enabled, setEnabled] = useState(initiallyEnabled);
28
30
  // animated values
@@ -69,7 +71,7 @@ export const KeyboardProvider = _ref => {
69
71
  const updateSharedValues = (event, platforms) => {
70
72
  "worklet";
71
73
 
72
- if (platforms.includes(Platform.OS)) {
74
+ if (platforms.includes(OS)) {
73
75
  progressSV.value = event.progress;
74
76
  heightSV.value = -event.height;
75
77
  }
@@ -130,8 +132,8 @@ export const KeyboardProvider = _ref => {
130
132
  }, /*#__PURE__*/React.createElement(KeyboardControllerViewAnimated, {
131
133
  enabled: enabled,
132
134
  onKeyboardMoveReanimated: keyboardHandler,
133
- onKeyboardMoveStart: Platform.OS === "ios" ? onKeyboardMove : undefined,
134
- onKeyboardMove: Platform.OS === "android" ? onKeyboardMove : undefined,
135
+ onKeyboardMoveStart: OS === "ios" ? onKeyboardMove : undefined,
136
+ onKeyboardMove: OS === "android" ? onKeyboardMove : undefined,
135
137
  onKeyboardMoveInteractive: onKeyboardMove,
136
138
  onFocusedInputLayoutChangedReanimated: inputLayoutHandler,
137
139
  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","_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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C7B,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
+ {"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","OS","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","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\n// capture `Platform.OS` in separate variable to avoid deep workletization of entire RN package\n// see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/393 and https://github.com/kirillzyusko/react-native-keyboard-controller/issues/294 for more details\nconst OS = Platform.OS;\n\nexport const KeyboardProvider = ({\n children,\n statusBarTranslucent,\n navigationBarTranslucent,\n 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(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={OS === \"ios\" ? onKeyboardMove : undefined}\n onKeyboardMove={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,uB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,kBAAmB;IAC1DW,mCAAmC,EAAEP,gBAAiB;IACtDrC,wBAAwB,EAAEA,wBAAyB;IACnDD,oBAAoB,EAAEA,oBAAqB;IAC3CkB,KAAK,EAAE5B,MAAM,CAACE;EAAU,GAEvBO,QAC6B,CAAC,eACjC7B,KAAA,CAAAsE,aAAA,CAAClE,QAAQ,CAACwE,IAAI;IACZ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA5B,KAAK,EAAEA;EAAM,CACd,CACuB,CAAC;AAE/B,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["View","NOOP","KeyboardController","setDefaultMode","setInputMode","dismiss","setFocusTo","addListener","removeListeners","KeyboardEvents","remove","FocusedInputEvents","KeyboardControllerView","KeyboardGestureArea"],"sources":["bindings.ts"],"sourcesContent":["import { View } from \"react-native\";\n\nimport type {\n FocusedInputEventsModule,\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 setFocusTo: NOOP,\n addListener: NOOP,\n removeListeners: NOOP,\n};\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\n/**\n * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.\n * Use it with cautious.\n */\nexport const FocusedInputEvents: FocusedInputEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\nexport const 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;AAWnC,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,UAAU,EAAEL,IAAI;EAChBM,WAAW,EAAEN,IAAI;EACjBO,eAAe,EAAEP;AACnB,CAAC;AACD,OAAO,MAAMQ,cAAoC,GAAG;EAClDF,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAET;EAAK,CAAC;AACtC,CAAC;AACD;AACA;AACA;AACA;AACA,OAAO,MAAMU,kBAA4C,GAAG;EAC1DJ,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAET;EAAK,CAAC;AACtC,CAAC;AACD,OAAO,MAAMW,sBAAsB,GACjCZ,IAAoD;AACtD,OAAO,MAAMa,mBAAmB,GAC9Bb,IAAqD"}
1
+ {"version":3,"names":["View","NOOP","KeyboardController","setDefaultMode","setInputMode","dismiss","setFocusTo","addListener","removeListeners","KeyboardEvents","remove","FocusedInputEvents","KeyboardControllerView","KeyboardGestureArea"],"sources":["bindings.ts"],"sourcesContent":["import { View } from \"react-native\";\n\nimport type {\n FocusedInputEventsModule,\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 setFocusTo: NOOP,\n addListener: NOOP,\n removeListeners: NOOP,\n};\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\n/**\n * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.\n * Use it with cautious.\n */\nexport const FocusedInputEvents: FocusedInputEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\nexport const 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;AAWnC,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,UAAU,EAAEL,IAAI;EAChBM,WAAW,EAAEN,IAAI;EACjBO,eAAe,EAAEP;AACnB,CAAC;AACD,OAAO,MAAMQ,cAAoC,GAAG;EAClDF,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAET;EAAK,CAAC;AACtC,CAAC;AACD;AACA;AACA;AACA;AACA,OAAO,MAAMU,kBAA4C,GAAG;EAC1DJ,WAAW,EAAEA,CAAA,MAAO;IAAEG,MAAM,EAAET;EAAK,CAAC;AACtC,CAAC;AACD,OAAO,MAAMW,sBAAsB,GACjCZ,IAAoD;AACtD,OAAO,MAAMa,mBAAmB,GAC9Bb,IAAqD","ignoreList":[]}
@@ -22,10 +22,7 @@ export const FocusedInputEvents = {
22
22
  addListener: (name, cb) => eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb)
23
23
  };
24
24
  export const KeyboardControllerView = require("./specs/KeyboardControllerViewNativeComponent").default;
25
- export const KeyboardGestureArea = Platform.OS === "android" && Platform.Version >= 30 ? require("./specs/KeyboardGestureAreaNativeComponent").default : _ref => {
26
- let {
27
- children
28
- } = _ref;
29
- return children;
30
- };
25
+ export const KeyboardGestureArea = Platform.OS === "android" && Platform.Version >= 30 ? require("./specs/KeyboardGestureAreaNativeComponent").default : ({
26
+ children
27
+ }) => children;
31
28
  //# sourceMappingURL=bindings.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","Platform","LINKING_ERROR","select","ios","default","RCTKeyboardController","require","KeyboardController","Proxy","get","Error","KEYBOARD_CONTROLLER_NAMESPACE","eventEmitter","KeyboardEvents","addListener","name","cb","FocusedInputEvents","KeyboardControllerView","KeyboardGestureArea","OS","Version","_ref","children"],"sources":["bindings.native.ts"],"sourcesContent":["import { NativeEventEmitter, Platform } from \"react-native\";\n\nimport type {\n FocusedInputEventsModule,\n KeyboardControllerModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardGestureAreaProps,\n} from \"./types\";\n\nconst LINKING_ERROR =\n `The package 'react-native-keyboard-controller' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: \"\" }) +\n \"- You rebuilt the app after installing the package\\n\" +\n \"- You are not using Expo Go\\n\";\n\nconst RCTKeyboardController =\n require(\"./specs/NativeKeyboardController\").default;\nexport const KeyboardController = (\n RCTKeyboardController\n ? RCTKeyboardController\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n },\n )\n) as KeyboardControllerModule;\n\nconst KEYBOARD_CONTROLLER_NAMESPACE = \"KeyboardController::\";\nconst eventEmitter = new NativeEventEmitter(KeyboardController);\n\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: (name, cb) =>\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\n};\n/**\n * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.\n * Use it with cautious.\n */\nexport const FocusedInputEvents: FocusedInputEventsModule = {\n addListener: (name, cb) =>\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\n};\nexport const KeyboardControllerView: React.FC<KeyboardControllerProps> =\n require(\"./specs/KeyboardControllerViewNativeComponent\").default;\nexport const KeyboardGestureArea: React.FC<KeyboardGestureAreaProps> =\n Platform.OS === \"android\" && Platform.Version >= 30\n ? require(\"./specs/KeyboardGestureAreaNativeComponent\").default\n : ({ children }: KeyboardGestureAreaProps) => children;\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAU3D,MAAMC,aAAa,GAChB,2FAA0F,GAC3FD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,qBAAqB,GACzBC,OAAO,CAAC,kCAAkC,CAAC,CAACF,OAAO;AACrD,OAAO,MAAMG,kBAAkB,GAC7BF,qBAAqB,GACjBA,qBAAqB,GACrB,IAAIG,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CACF,CACuB;AAE7B,MAAMU,6BAA6B,GAAG,sBAAsB;AAC5D,MAAMC,YAAY,GAAG,IAAIb,kBAAkB,CAACQ,kBAAkB,CAAC;AAE/D,OAAO,MAAMM,cAAoC,GAAG;EAClDC,WAAW,EAAEA,CAACC,IAAI,EAAEC,EAAE,KACpBJ,YAAY,CAACE,WAAW,CAACH,6BAA6B,GAAGI,IAAI,EAAEC,EAAE;AACrE,CAAC;AACD;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAA4C,GAAG;EAC1DH,WAAW,EAAEA,CAACC,IAAI,EAAEC,EAAE,KACpBJ,YAAY,CAACE,WAAW,CAACH,6BAA6B,GAAGI,IAAI,EAAEC,EAAE;AACrE,CAAC;AACD,OAAO,MAAME,sBAAyD,GACpEZ,OAAO,CAAC,+CAA+C,CAAC,CAACF,OAAO;AAClE,OAAO,MAAMe,mBAAuD,GAClEnB,QAAQ,CAACoB,EAAE,KAAK,SAAS,IAAIpB,QAAQ,CAACqB,OAAO,IAAI,EAAE,GAC/Cf,OAAO,CAAC,4CAA4C,CAAC,CAACF,OAAO,GAC7DkB,IAAA;EAAA,IAAC;IAAEC;EAAmC,CAAC,GAAAD,IAAA;EAAA,OAAKC,QAAQ;AAAA"}
1
+ {"version":3,"names":["NativeEventEmitter","Platform","LINKING_ERROR","select","ios","default","RCTKeyboardController","require","KeyboardController","Proxy","get","Error","KEYBOARD_CONTROLLER_NAMESPACE","eventEmitter","KeyboardEvents","addListener","name","cb","FocusedInputEvents","KeyboardControllerView","KeyboardGestureArea","OS","Version","children"],"sources":["bindings.native.ts"],"sourcesContent":["import { NativeEventEmitter, Platform } from \"react-native\";\n\nimport type {\n FocusedInputEventsModule,\n KeyboardControllerModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardGestureAreaProps,\n} from \"./types\";\n\nconst LINKING_ERROR =\n `The package 'react-native-keyboard-controller' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: \"\" }) +\n \"- You rebuilt the app after installing the package\\n\" +\n \"- You are not using Expo Go\\n\";\n\nconst RCTKeyboardController =\n require(\"./specs/NativeKeyboardController\").default;\nexport const KeyboardController = (\n RCTKeyboardController\n ? RCTKeyboardController\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n },\n )\n) as KeyboardControllerModule;\n\nconst KEYBOARD_CONTROLLER_NAMESPACE = \"KeyboardController::\";\nconst eventEmitter = new NativeEventEmitter(KeyboardController);\n\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: (name, cb) =>\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\n};\n/**\n * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.\n * Use it with cautious.\n */\nexport const FocusedInputEvents: FocusedInputEventsModule = {\n addListener: (name, cb) =>\n eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),\n};\nexport const KeyboardControllerView: React.FC<KeyboardControllerProps> =\n require(\"./specs/KeyboardControllerViewNativeComponent\").default;\nexport const KeyboardGestureArea: React.FC<KeyboardGestureAreaProps> =\n Platform.OS === \"android\" && Platform.Version >= 30\n ? require(\"./specs/KeyboardGestureAreaNativeComponent\").default\n : ({ children }: KeyboardGestureAreaProps) => children;\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,QAAQ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ightWhenOpened","height","progress","isClosed","onStart","e","value","onMove","onEnd","duration"],"sources":["hooks.ts"],"sourcesContent":["import { useSharedValue } from \"react-native-reanimated\";\n\nimport { useKeyboardHandler } from \"react-native-keyboard-controller\";\n\nexport const useKeyboardAnimation = () => {\n const heightWhenOpened = useSharedValue(0);\n const height = useSharedValue(0);\n const progress = useSharedValue(0);\n const isClosed = useSharedValue(true);\n\n useKeyboardHandler(\n {\n onStart: (e) => {\n \"worklet\";\n\n if (e.height > 0) {\n isClosed.value = false;\n heightWhenOpened.value = e.height;\n }\n },\n onMove: (e) => {\n \"worklet\";\n\n progress.value = e.progress;\n height.value = e.height;\n },\n onEnd: (e) => {\n \"worklet\";\n\n isClosed.value = e.height === 0;\n\n // `height` update happens in `onMove` handler\n // in `onEnd` we need to update only if `onMove`\n // wasn't called (i. e. duration === 0)\n //\n // we can not call this code without condition below\n // because in some corner cases (iOS with `secureTextEntry`)\n // `onEnd` can be emitted before `onMove` and in this case\n // it may lead to choppy/glitchy/jumpy UI\n // see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/327\n if (e.duration === 0) {\n progress.value = e.progress;\n height.value = e.height;\n }\n },\n },\n [],\n );\n\n return { height, progress, heightWhenOpened, isClosed };\n};\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,yBAAyB;AAExD,SAASC,kBAAkB,QAAQ,kCAAkC;AAErE,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACxC,MAAMC,gBAAgB,GAAGH,cAAc,CAAC,CAAC,CAAC;EAC1C,MAAMI,MAAM,GAAGJ,cAAc,CAAC,CAAC,CAAC;EAChC,MAAMK,QAAQ,GAAGL,cAAc,CAAC,CAAC,CAAC;EAClC,MAAMM,QAAQ,GAAGN,cAAc,CAAC,IAAI,CAAC;EAErCC,kBAAkB,CAChB;IACEM,OAAO,EAAGC,CAAC,IAAK;MACd,SAAS;;MAET,IAAIA,CAAC,CAACJ,MAAM,GAAG,CAAC,EAAE;QAChBE,QAAQ,CAACG,KAAK,GAAG,KAAK;QACtBN,gBAAgB,CAACM,KAAK,GAAGD,CAAC,CAACJ,MAAM;MACnC;IACF,CAAC;IACDM,MAAM,EAAGF,CAAC,IAAK;MACb,SAAS;;MAETH,QAAQ,CAACI,KAAK,GAAGD,CAAC,CAACH,QAAQ;MAC3BD,MAAM,CAACK,KAAK,GAAGD,CAAC,CAACJ,MAAM;IACzB,CAAC;IACDO,KAAK,EAAGH,CAAC,IAAK;MACZ,SAAS;;MAETF,QAAQ,CAACG,KAAK,GAAGD,CAAC,CAACJ,MAAM,KAAK,CAAC;;MAE/B;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,IAAII,CAAC,CAACI,QAAQ,KAAK,CAAC,EAAE;QACpBP,QAAQ,CAACI,KAAK,GAAGD,CAAC,CAACH,QAAQ;QAC3BD,MAAM,CAACK,KAAK,GAAGD,CAAC,CAACJ,MAAM;MACzB;IACF;EACF,CAAC,EACD,EACF,CAAC;EAED,OAAO;IAAEA,MAAM;IAAEC,QAAQ;IAAEF,gBAAgB;IAAEG;EAAS,CAAC;AACzD,CAAC"}
1
+ {"version":3,"names":["useSharedValue","useKeyboardHandler","useKeyboardAnimation","heightWhenOpened","height","progress","isClosed","onStart","e","value","onMove","onEnd","duration"],"sources":["hooks.ts"],"sourcesContent":["import { useSharedValue } from \"react-native-reanimated\";\n\nimport { useKeyboardHandler } from \"react-native-keyboard-controller\";\n\nexport const useKeyboardAnimation = () => {\n const heightWhenOpened = useSharedValue(0);\n const height = useSharedValue(0);\n const progress = useSharedValue(0);\n const isClosed = useSharedValue(true);\n\n useKeyboardHandler(\n {\n onStart: (e) => {\n \"worklet\";\n\n if (e.height > 0) {\n isClosed.value = false;\n heightWhenOpened.value = e.height;\n }\n },\n onMove: (e) => {\n \"worklet\";\n\n progress.value = e.progress;\n height.value = e.height;\n },\n onEnd: (e) => {\n \"worklet\";\n\n isClosed.value = e.height === 0;\n\n // `height` update happens in `onMove` handler\n // in `onEnd` we need to update only if `onMove`\n // wasn't called (i. e. duration === 0)\n //\n // we can not call this code without condition below\n // because in some corner cases (iOS with `secureTextEntry`)\n // `onEnd` can be emitted before `onMove` and in this case\n // it may lead to choppy/glitchy/jumpy UI\n // see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/327\n if (e.duration === 0) {\n progress.value = e.progress;\n height.value = e.height;\n }\n },\n },\n [],\n );\n\n return { height, progress, heightWhenOpened, isClosed };\n};\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,yBAAyB;AAExD,SAASC,kBAAkB,QAAQ,kCAAkC;AAErE,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACxC,MAAMC,gBAAgB,GAAGH,cAAc,CAAC,CAAC,CAAC;EAC1C,MAAMI,MAAM,GAAGJ,cAAc,CAAC,CAAC,CAAC;EAChC,MAAMK,QAAQ,GAAGL,cAAc,CAAC,CAAC,CAAC;EAClC,MAAMM,QAAQ,GAAGN,cAAc,CAAC,IAAI,CAAC;EAErCC,kBAAkB,CAChB;IACEM,OAAO,EAAGC,CAAC,IAAK;MACd,SAAS;;MAET,IAAIA,CAAC,CAACJ,MAAM,GAAG,CAAC,EAAE;QAChBE,QAAQ,CAACG,KAAK,GAAG,KAAK;QACtBN,gBAAgB,CAACM,KAAK,GAAGD,CAAC,CAACJ,MAAM;MACnC;IACF,CAAC;IACDM,MAAM,EAAGF,CAAC,IAAK;MACb,SAAS;;MAETH,QAAQ,CAACI,KAAK,GAAGD,CAAC,CAACH,QAAQ;MAC3BD,MAAM,CAACK,KAAK,GAAGD,CAAC,CAACJ,MAAM;IACzB,CAAC;IACDO,KAAK,EAAGH,CAAC,IAAK;MACZ,SAAS;;MAETF,QAAQ,CAACG,KAAK,GAAGD,CAAC,CAACJ,MAAM,KAAK,CAAC;;MAE/B;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,IAAII,CAAC,CAACI,QAAQ,KAAK,CAAC,EAAE;QACpBP,QAAQ,CAACI,KAAK,GAAGD,CAAC,CAACH,QAAQ;QAC3BD,MAAM,CAACK,KAAK,GAAGD,CAAC,CAACJ,MAAM;MACzB;IACF;EACF,CAAC,EACD,EACF,CAAC;EAED,OAAO;IAAEA,MAAM;IAAEC,QAAQ;IAAEF,gBAAgB;IAAEG;EAAS,CAAC;AACzD,CAAC","ignoreList":[]}
@@ -1,8 +1,7 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  import React, { forwardRef, useCallback, useMemo } from "react";
3
3
  import { View, useWindowDimensions } from "react-native";
4
- import Reanimated, { runOnUI, useAnimatedStyle, useDerivedValue, useSharedValue } from "react-native-reanimated";
5
- import useKeyboardInterpolation from "../hooks/useKeyboardInterpolation";
4
+ import Reanimated, { interpolate, runOnUI, useAnimatedStyle, useDerivedValue, useSharedValue } from "react-native-reanimated";
6
5
  import { useKeyboardAnimation } from "./hooks";
7
6
  const defaultLayout = {
8
7
  x: 0,
@@ -15,17 +14,16 @@ const defaultLayout = {
15
14
  * View that moves out of the way when the keyboard appears by automatically
16
15
  * adjusting its height, position, or bottom padding.
17
16
  */
18
- const KeyboardAvoidingView = /*#__PURE__*/forwardRef((_ref, ref) => {
19
- let {
20
- behavior,
21
- children,
22
- contentContainerStyle,
23
- enabled = true,
24
- keyboardVerticalOffset = 0,
25
- style,
26
- onLayout: onLayoutProps,
27
- ...props
28
- } = _ref;
17
+ const KeyboardAvoidingView = /*#__PURE__*/forwardRef(({
18
+ behavior,
19
+ children,
20
+ contentContainerStyle,
21
+ enabled = true,
22
+ keyboardVerticalOffset = 0,
23
+ style,
24
+ onLayout: onLayoutProps,
25
+ ...props
26
+ }, ref) => {
29
27
  const initialFrame = useSharedValue(null);
30
28
  const frame = useDerivedValue(() => initialFrame.value || defaultLayout);
31
29
  const keyboard = useKeyboardAnimation();
@@ -38,22 +36,19 @@ const KeyboardAvoidingView = /*#__PURE__*/forwardRef((_ref, ref) => {
38
36
  const keyboardY = screenHeight - keyboard.heightWhenOpened.value - keyboardVerticalOffset;
39
37
  return Math.max(frame.value.y + frame.value.height - keyboardY, 0);
40
38
  }, [screenHeight, keyboardVerticalOffset]);
41
- const {
42
- interpolate
43
- } = useKeyboardInterpolation();
44
39
  const onLayoutWorklet = useCallback(layout => {
45
40
  "worklet";
46
41
 
47
- if (keyboard.isClosed.value) {
42
+ if (keyboard.isClosed.value || initialFrame.value === null) {
48
43
  initialFrame.value = layout;
49
44
  }
50
45
  }, []);
51
46
  const onLayout = useCallback(e => {
52
47
  runOnUI(onLayoutWorklet)(e.nativeEvent.layout);
53
- onLayoutProps === null || onLayoutProps === void 0 ? void 0 : onLayoutProps(e);
48
+ onLayoutProps === null || onLayoutProps === void 0 || onLayoutProps(e);
54
49
  }, [onLayoutProps]);
55
50
  const animatedStyle = useAnimatedStyle(() => {
56
- const bottom = interpolate(keyboard.height.value, [0, relativeKeyboardHeight()]);
51
+ const bottom = interpolate(keyboard.progress.value, [0, 1], [0, relativeKeyboardHeight()]);
57
52
  const bottomHeight = enabled ? bottom : 0;
58
53
  switch (behavior) {
59
54
  case "height":