react-native-keyboard-controller 1.21.5 → 1.21.7

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 (65) hide show
  1. package/android/src/main/java/com/reactnativekeyboardcontroller/modules/KeyboardControllerModuleImpl.kt +11 -1
  2. package/android/src/main/java/com/reactnativekeyboardcontroller/views/ClippingScrollViewDecoratorView.kt +1 -1
  3. package/lib/commonjs/components/KeyboardChatScrollView/index.js +12 -2
  4. package/lib/commonjs/components/KeyboardChatScrollView/index.js.map +1 -1
  5. package/lib/commonjs/components/KeyboardChatScrollView/types.js.map +1 -1
  6. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js +3 -3
  7. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js.map +1 -1
  8. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.js +4 -4
  9. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.js.map +1 -1
  10. package/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/types.js.map +1 -1
  11. package/lib/commonjs/components/KeyboardChatScrollView/useEndVisible.js +40 -0
  12. package/lib/commonjs/components/KeyboardChatScrollView/useEndVisible.js.map +1 -0
  13. package/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js +2 -2
  14. package/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js.map +1 -1
  15. package/lib/commonjs/components/KeyboardStickyView/index.js +10 -14
  16. package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -1
  17. package/lib/commonjs/components/KeyboardToolbar/index.js +12 -3
  18. package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
  19. package/lib/commonjs/components/ScrollViewWithBottomPadding/index.js +35 -23
  20. package/lib/commonjs/components/ScrollViewWithBottomPadding/index.js.map +1 -1
  21. package/lib/commonjs/hooks/useKeyboardState/index.js +1 -7
  22. package/lib/commonjs/hooks/useKeyboardState/index.js.map +1 -1
  23. package/lib/commonjs/module.js +1 -1
  24. package/lib/commonjs/module.js.map +1 -1
  25. package/lib/module/components/KeyboardChatScrollView/index.js +12 -2
  26. package/lib/module/components/KeyboardChatScrollView/index.js.map +1 -1
  27. package/lib/module/components/KeyboardChatScrollView/types.js.map +1 -1
  28. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js +3 -3
  29. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js.map +1 -1
  30. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.js +4 -4
  31. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.js.map +1 -1
  32. package/lib/module/components/KeyboardChatScrollView/useChatKeyboard/types.js.map +1 -1
  33. package/lib/module/components/KeyboardChatScrollView/useEndVisible.js +33 -0
  34. package/lib/module/components/KeyboardChatScrollView/useEndVisible.js.map +1 -0
  35. package/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js +2 -2
  36. package/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js.map +1 -1
  37. package/lib/module/components/KeyboardStickyView/index.js +11 -15
  38. package/lib/module/components/KeyboardStickyView/index.js.map +1 -1
  39. package/lib/module/components/KeyboardToolbar/index.js +12 -3
  40. package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
  41. package/lib/module/components/ScrollViewWithBottomPadding/index.js +37 -25
  42. package/lib/module/components/ScrollViewWithBottomPadding/index.js.map +1 -1
  43. package/lib/module/hooks/useKeyboardState/index.js +1 -7
  44. package/lib/module/hooks/useKeyboardState/index.js.map +1 -1
  45. package/lib/module/module.js +1 -1
  46. package/lib/module/module.js.map +1 -1
  47. package/lib/typescript/components/KeyboardChatScrollView/index.d.ts +3 -1
  48. package/lib/typescript/components/KeyboardChatScrollView/types.d.ts +26 -2
  49. package/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/types.d.ts +1 -1
  50. package/lib/typescript/components/KeyboardChatScrollView/useEndVisible.d.ts +17 -0
  51. package/lib/typescript/components/KeyboardChatScrollView/useExtraContentPadding/index.d.ts +1 -1
  52. package/lib/typescript/components/ScrollViewWithBottomPadding/index.d.ts +12 -0
  53. package/package.json +1 -1
  54. package/src/components/KeyboardChatScrollView/index.tsx +15 -2
  55. package/src/components/KeyboardChatScrollView/types.ts +29 -2
  56. package/src/components/KeyboardChatScrollView/useChatKeyboard/index.ios.ts +3 -3
  57. package/src/components/KeyboardChatScrollView/useChatKeyboard/index.ts +4 -4
  58. package/src/components/KeyboardChatScrollView/useChatKeyboard/types.ts +1 -1
  59. package/src/components/KeyboardChatScrollView/useEndVisible.ts +66 -0
  60. package/src/components/KeyboardChatScrollView/useExtraContentPadding/index.ts +3 -3
  61. package/src/components/KeyboardStickyView/index.tsx +18 -19
  62. package/src/components/KeyboardToolbar/index.tsx +13 -4
  63. package/src/components/ScrollViewWithBottomPadding/index.tsx +67 -28
  64. package/src/hooks/useKeyboardState/index.ts +1 -8
  65. package/src/module.ts +1 -1
@@ -5,7 +5,7 @@ import { KeyboardController } from "../../module";
5
5
 
6
6
  import type { IKeyboardState } from "../../types";
7
7
 
8
- const EVENTS = ["keyboardDidShow", "keyboardDidHide"] as const;
8
+ const EVENTS = ["keyboardWillShow", "keyboardDidHide"] as const;
9
9
 
10
10
  const getLatestState = () => ({
11
11
  ...KeyboardController.state(),
@@ -53,12 +53,6 @@ function useKeyboardState<T = IKeyboardState>(
53
53
  setState(selector(getLatestState())),
54
54
  ),
55
55
  );
56
- // update `appearance` prematurely
57
- const willShowSubscription = KeyboardEvents.addListener(
58
- "keyboardWillShow",
59
- (e) =>
60
- setState(selector({ ...getLatestState(), appearance: e.appearance })),
61
- );
62
56
 
63
57
  // we might have missed an update between reading a value in render and
64
58
  // `addListener` in this handler, so we set it here. If there was
@@ -67,7 +61,6 @@ function useKeyboardState<T = IKeyboardState>(
67
61
 
68
62
  return () => {
69
63
  subscriptions.forEach((subscription) => subscription.remove());
70
- willShowSubscription.remove();
71
64
  };
72
65
  }, []);
73
66
 
package/src/module.ts CHANGED
@@ -21,7 +21,7 @@ KeyboardEvents.addListener("keyboardDidHide", (e) => {
21
21
  lastState = e;
22
22
  });
23
23
 
24
- KeyboardEvents.addListener("keyboardDidShow", (e) => {
24
+ KeyboardEvents.addListener("keyboardWillShow", (e) => {
25
25
  isClosed = false;
26
26
  lastState = e;
27
27
  });