react-native-keyboard-controller 1.17.2 → 1.17.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 (36) hide show
  1. package/android/src/fabric/java/com/reactnativekeyboardcontroller/KeyboardControllerViewManager.kt +15 -4
  2. package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/ThemedReactContext.kt +20 -5
  3. package/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt +4 -0
  4. package/android/src/main/java/com/reactnativekeyboardcontroller/listeners/WindowDimensionListener.kt +13 -4
  5. package/android/src/main/java/com/reactnativekeyboardcontroller/managers/KeyboardControllerViewManagerImpl.kt +14 -2
  6. package/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt +12 -6
  7. package/android/src/main/java/com/reactnativekeyboardcontroller/views/overlay/OverKeyboardViewGroup.kt +11 -0
  8. package/android/src/paper/java/com/reactnativekeyboardcontroller/KeyboardControllerViewManager.kt +13 -3
  9. package/ios/KeyboardControllerModule.mm +2 -0
  10. package/ios/swizzling/UIResponderSwizzle.swift +57 -10
  11. package/ios/views/KeyboardControllerView.mm +18 -0
  12. package/ios/views/KeyboardControllerViewManager.swift +19 -0
  13. package/ios/views/KeyboardGestureAreaManager.mm +1 -0
  14. package/lib/commonjs/components/KeyboardAvoidingView/index.js +3 -2
  15. package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
  16. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +3 -0
  17. package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
  18. package/lib/commonjs/hooks/useWindowDimensions/index.js +29 -6
  19. package/lib/commonjs/hooks/useWindowDimensions/index.js.map +1 -1
  20. package/lib/module/components/KeyboardAvoidingView/index.js +3 -2
  21. package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
  22. package/lib/module/components/KeyboardAwareScrollView/index.js +5 -2
  23. package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
  24. package/lib/module/hooks/useWindowDimensions/index.js +28 -1
  25. package/lib/module/hooks/useWindowDimensions/index.js.map +1 -1
  26. package/lib/typescript/hooks/useWindowDimensions/index.d.ts +2 -1
  27. package/package.json +1 -1
  28. package/src/components/KeyboardAvoidingView/index.tsx +3 -2
  29. package/src/components/KeyboardAwareScrollView/index.tsx +6 -1
  30. package/src/hooks/useWindowDimensions/index.ts +41 -1
  31. package/lib/commonjs/hooks/useWindowDimensions/index.android.js +0 -34
  32. package/lib/commonjs/hooks/useWindowDimensions/index.android.js.map +0 -1
  33. package/lib/module/hooks/useWindowDimensions/index.android.js +0 -27
  34. package/lib/module/hooks/useWindowDimensions/index.android.js.map +0 -1
  35. package/lib/typescript/hooks/useWindowDimensions/index.android.d.ts +0 -2
  36. package/src/hooks/useWindowDimensions/index.android.ts +0 -38
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","useState","WindowDimensionsEvents","initialDimensions","width","height","addListener","e","useWindowDimensions","dimensions","setDimensions","subscription","remove"],"sources":["index.android.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\n\nimport { WindowDimensionsEvents } from \"../../bindings\";\n\nimport type { WindowDimensionsEventData } from \"../../types\";\n\nlet initialDimensions: WindowDimensionsEventData = {\n width: 0,\n height: 0,\n};\n\nWindowDimensionsEvents.addListener(\"windowDidResize\", (e) => {\n initialDimensions = e;\n});\n\nexport const useWindowDimensions = () => {\n const [dimensions, setDimensions] = useState(initialDimensions);\n\n useEffect(() => {\n const subscription = WindowDimensionsEvents.addListener(\n \"windowDidResize\",\n (e) => {\n setDimensions(e);\n },\n );\n\n // we might have missed an update between reading a value in render and\n // `addListener` in this handler, so we set it here. If there was\n // no change, React will filter out this update as a no-op.\n setDimensions(initialDimensions);\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n return dimensions;\n};\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE3C,SAASC,sBAAsB,QAAQ,gBAAgB;AAIvD,IAAIC,iBAA4C,GAAG;EACjDC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE;AACV,CAAC;AAEDH,sBAAsB,CAACI,WAAW,CAAC,iBAAiB,EAAGC,CAAC,IAAK;EAC3DJ,iBAAiB,GAAGI,CAAC;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGT,QAAQ,CAACE,iBAAiB,CAAC;EAE/DH,SAAS,CAAC,MAAM;IACd,MAAMW,YAAY,GAAGT,sBAAsB,CAACI,WAAW,CACrD,iBAAiB,EAChBC,CAAC,IAAK;MACLG,aAAa,CAACH,CAAC,CAAC;IAClB,CACF,CAAC;;IAED;IACA;IACA;IACAG,aAAa,CAACP,iBAAiB,CAAC;IAEhC,OAAO,MAAM;MACXQ,YAAY,CAACC,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOH,UAAU;AACnB,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import type { WindowDimensionsEventData } from "../../types";
2
- export declare const useWindowDimensions: () => WindowDimensionsEventData;
@@ -1,38 +0,0 @@
1
- import { useEffect, useState } from "react";
2
-
3
- import { WindowDimensionsEvents } from "../../bindings";
4
-
5
- import type { WindowDimensionsEventData } from "../../types";
6
-
7
- let initialDimensions: WindowDimensionsEventData = {
8
- width: 0,
9
- height: 0,
10
- };
11
-
12
- WindowDimensionsEvents.addListener("windowDidResize", (e) => {
13
- initialDimensions = e;
14
- });
15
-
16
- export const useWindowDimensions = () => {
17
- const [dimensions, setDimensions] = useState(initialDimensions);
18
-
19
- useEffect(() => {
20
- const subscription = WindowDimensionsEvents.addListener(
21
- "windowDidResize",
22
- (e) => {
23
- setDimensions(e);
24
- },
25
- );
26
-
27
- // we might have missed an update between reading a value in render and
28
- // `addListener` in this handler, so we set it here. If there was
29
- // no change, React will filter out this update as a no-op.
30
- setDimensions(initialDimensions);
31
-
32
- return () => {
33
- subscription.remove();
34
- };
35
- }, []);
36
-
37
- return dimensions;
38
- };