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.
- package/android/src/fabric/java/com/reactnativekeyboardcontroller/KeyboardControllerViewManager.kt +15 -4
- package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/ThemedReactContext.kt +20 -5
- package/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt +4 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/listeners/WindowDimensionListener.kt +13 -4
- package/android/src/main/java/com/reactnativekeyboardcontroller/managers/KeyboardControllerViewManagerImpl.kt +14 -2
- package/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt +12 -6
- package/android/src/main/java/com/reactnativekeyboardcontroller/views/overlay/OverKeyboardViewGroup.kt +11 -0
- package/android/src/paper/java/com/reactnativekeyboardcontroller/KeyboardControllerViewManager.kt +13 -3
- package/ios/KeyboardControllerModule.mm +2 -0
- package/ios/swizzling/UIResponderSwizzle.swift +57 -10
- package/ios/views/KeyboardControllerView.mm +18 -0
- package/ios/views/KeyboardControllerViewManager.swift +19 -0
- package/ios/views/KeyboardGestureAreaManager.mm +1 -0
- package/lib/commonjs/components/KeyboardAvoidingView/index.js +3 -2
- package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js +3 -0
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/commonjs/hooks/useWindowDimensions/index.js +29 -6
- package/lib/commonjs/hooks/useWindowDimensions/index.js.map +1 -1
- package/lib/module/components/KeyboardAvoidingView/index.js +3 -2
- package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/index.js +5 -2
- package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/module/hooks/useWindowDimensions/index.js +28 -1
- package/lib/module/hooks/useWindowDimensions/index.js.map +1 -1
- package/lib/typescript/hooks/useWindowDimensions/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/KeyboardAvoidingView/index.tsx +3 -2
- package/src/components/KeyboardAwareScrollView/index.tsx +6 -1
- package/src/hooks/useWindowDimensions/index.ts +41 -1
- package/lib/commonjs/hooks/useWindowDimensions/index.android.js +0 -34
- package/lib/commonjs/hooks/useWindowDimensions/index.android.js.map +0 -1
- package/lib/module/hooks/useWindowDimensions/index.android.js +0 -27
- package/lib/module/hooks/useWindowDimensions/index.android.js.map +0 -1
- package/lib/typescript/hooks/useWindowDimensions/index.android.d.ts +0 -2
- 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,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
|
-
};
|