react-native-keyboard-controller 1.12.6 → 1.13.0
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/KeyboardGestureAreaViewManager.kt +5 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/ReactContext.kt +13 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/ThemedReactContext.kt +0 -10
- package/android/src/main/java/com/reactnativekeyboardcontroller/interactive/interpolators/Interpolator.kt +2 -1
- package/android/src/main/java/com/reactnativekeyboardcontroller/interactive/interpolators/IosInterpolator.kt +2 -1
- package/android/src/main/java/com/reactnativekeyboardcontroller/interactive/interpolators/LinearInterpolator.kt +1 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/listeners/FocusedInputObserver.kt +15 -8
- package/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt +71 -59
- package/android/src/main/java/com/reactnativekeyboardcontroller/managers/KeyboardGestureAreaViewManagerImpl.kt +4 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/modal/ModalAttachedWatcher.kt +80 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/modules/StatusBarManagerCompatModuleImpl.kt +6 -12
- package/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt +31 -4
- package/android/src/main/java/com/reactnativekeyboardcontroller/views/KeyboardGestureAreaReactViewGroup.kt +7 -0
- package/android/src/paper/java/com/reactnativekeyboardcontroller/KeyboardGestureAreaViewManager.kt +5 -0
- package/ios/core/KeyboardAnimation.swift +1 -1
- package/ios/core/TimingAnimation.swift +108 -0
- package/ios/extensions/UIApplication.swift +29 -0
- package/ios/extensions/UIView.swift +10 -0
- package/ios/observers/FocusedInputObserver.swift +2 -0
- package/ios/observers/KeyboardMovementObserver.swift +19 -10
- package/ios/traversal/ViewHierarchyNavigator.swift +1 -1
- package/ios/views/KeyboardControllerView.mm +30 -39
- package/lib/commonjs/animated.js +16 -30
- package/lib/commonjs/animated.js.map +1 -1
- package/lib/commonjs/bindings.js.map +1 -1
- package/lib/commonjs/bindings.native.js.map +1 -1
- package/lib/commonjs/components/KeyboardAvoidingView/hooks.js +3 -14
- package/lib/commonjs/components/KeyboardAvoidingView/hooks.js.map +1 -1
- package/lib/commonjs/components/KeyboardAvoidingView/index.js +5 -4
- package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js +42 -16
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +1 -0
- package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/utils.js.map +1 -1
- package/lib/commonjs/components/KeyboardStickyView/index.js +2 -2
- package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/Arrow.js +2 -2
- package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/Button.js +12 -12
- package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/index.js +33 -27
- package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/commonjs/components/index.js +2 -2
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/context.js +3 -2
- package/lib/commonjs/context.js.map +1 -1
- package/lib/commonjs/event-handler.js +19 -0
- package/lib/commonjs/event-handler.js.map +1 -0
- package/lib/commonjs/event-handler.web.js +10 -0
- package/lib/commonjs/event-handler.web.js.map +1 -0
- package/lib/commonjs/event-mappings.js +9 -0
- package/lib/commonjs/event-mappings.js.map +1 -0
- package/lib/commonjs/hooks/index.js +8 -21
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useSyncEffect/index.js +37 -0
- package/lib/commonjs/hooks/useSyncEffect/index.js.map +1 -0
- package/lib/commonjs/internal.js +20 -43
- package/lib/commonjs/internal.js.map +1 -1
- package/lib/commonjs/monkey-patch.android.js +1 -1
- package/lib/commonjs/monkey-patch.android.js.map +1 -1
- package/lib/commonjs/monkey-patch.js.map +1 -1
- package/lib/commonjs/reanimated.js +1 -3
- package/lib/commonjs/reanimated.js.map +1 -1
- package/lib/commonjs/reanimated.native.js +1 -35
- package/lib/commonjs/reanimated.native.js.map +1 -1
- package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js +1 -1
- package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js +1 -1
- package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/animated.js +17 -32
- package/lib/module/animated.js.map +1 -1
- package/lib/module/bindings.js.map +1 -1
- package/lib/module/bindings.native.js.map +1 -1
- package/lib/module/components/KeyboardAvoidingView/hooks.js +3 -14
- package/lib/module/components/KeyboardAvoidingView/hooks.js.map +1 -1
- package/lib/module/components/KeyboardAvoidingView/index.js +4 -3
- package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/index.js +41 -15
- package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +1 -0
- package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/utils.js.map +1 -1
- package/lib/module/components/KeyboardStickyView/index.js +1 -1
- package/lib/module/components/KeyboardToolbar/Button.js +10 -10
- package/lib/module/components/KeyboardToolbar/Button.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/index.js +31 -25
- package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/module/context.js +3 -2
- package/lib/module/context.js.map +1 -1
- package/lib/module/event-handler.js +13 -0
- package/lib/module/event-handler.js.map +1 -0
- package/lib/module/event-handler.web.js +5 -0
- package/lib/module/event-handler.web.js.map +1 -0
- package/lib/module/event-mappings.js +3 -0
- package/lib/module/event-mappings.js.map +1 -0
- package/lib/module/hooks/index.js +7 -21
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useSyncEffect/index.js +31 -0
- package/lib/module/hooks/useSyncEffect/index.js.map +1 -0
- package/lib/module/internal.js +21 -44
- package/lib/module/internal.js.map +1 -1
- package/lib/module/monkey-patch.js.map +1 -1
- package/lib/module/reanimated.js +0 -2
- package/lib/module/reanimated.js.map +1 -1
- package/lib/module/reanimated.native.js +0 -32
- package/lib/module/reanimated.native.js.map +1 -1
- package/lib/module/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/components/KeyboardToolbar/Button.d.ts +2 -2
- package/lib/typescript/components/KeyboardToolbar/index.d.ts +4 -3
- package/lib/typescript/context.d.ts +3 -3
- package/lib/typescript/event-handler.d.ts +3 -0
- package/lib/typescript/event-mappings.d.ts +2 -0
- package/lib/typescript/hooks/index.d.ts +1 -1
- package/lib/typescript/hooks/useSyncEffect/index.d.ts +14 -0
- package/lib/typescript/internal.d.ts +5 -19
- package/lib/typescript/reanimated.d.ts +1 -3
- package/lib/typescript/reanimated.native.d.ts +1 -3
- package/lib/typescript/specs/KeyboardGestureAreaNativeComponent.d.ts +2 -1
- package/lib/typescript/types.d.ts +6 -0
- package/package.json +14 -7
- package/src/animated.tsx +21 -43
- package/src/bindings.native.ts +1 -0
- package/src/bindings.ts +1 -0
- package/src/components/KeyboardAvoidingView/hooks.ts +3 -13
- package/src/components/KeyboardAvoidingView/index.tsx +2 -1
- package/src/components/KeyboardAwareScrollView/index.tsx +51 -13
- package/src/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +2 -0
- package/src/components/KeyboardAwareScrollView/utils.ts +1 -0
- package/src/components/KeyboardToolbar/Button.tsx +11 -11
- package/src/components/KeyboardToolbar/index.tsx +45 -25
- package/src/context.ts +8 -6
- package/src/event-handler.js +15 -0
- package/src/event-handler.ts +8 -0
- package/src/event-handler.web.js +5 -0
- package/src/event-mappings.ts +14 -0
- package/src/hooks/index.ts +9 -16
- package/src/hooks/useSyncEffect/index.ts +36 -0
- package/src/internal.ts +34 -53
- package/src/monkey-patch.ts +1 -0
- package/src/reanimated.native.ts +0 -50
- package/src/reanimated.ts +1 -12
- package/src/specs/KeyboardGestureAreaNativeComponent.ts +5 -1
- package/src/types.ts +6 -0
- package/lib/commonjs/utils.js +0 -9
- package/lib/commonjs/utils.js.map +0 -1
- package/lib/module/utils.js +0 -2
- package/lib/module/utils.js.map +0 -1
- package/lib/typescript/utils.d.ts +0 -1
- package/src/utils.ts +0 -1
|
@@ -2,7 +2,7 @@ import { useEffect } from "react";
|
|
|
2
2
|
import { KeyboardController } from "../bindings";
|
|
3
3
|
import { AndroidSoftInputModes } from "../constants";
|
|
4
4
|
import { useKeyboardContext } from "../context";
|
|
5
|
-
import
|
|
5
|
+
import useSyncEffect from "./useSyncEffect";
|
|
6
6
|
export const useResizeMode = () => {
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
KeyboardController.setInputMode(AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE);
|
|
@@ -21,16 +21,9 @@ export const useReanimatedKeyboardAnimation = () => {
|
|
|
21
21
|
};
|
|
22
22
|
export function useGenericKeyboardHandler(handler, deps) {
|
|
23
23
|
const context = useKeyboardContext();
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
[key]: handler
|
|
28
|
-
});
|
|
29
|
-
return () => {
|
|
30
|
-
context.setKeyboardHandlers({
|
|
31
|
-
[key]: undefined
|
|
32
|
-
});
|
|
33
|
-
};
|
|
24
|
+
useSyncEffect(() => {
|
|
25
|
+
const cleanup = context.setKeyboardHandlers(handler);
|
|
26
|
+
return () => cleanup();
|
|
34
27
|
}, deps);
|
|
35
28
|
}
|
|
36
29
|
export function useKeyboardHandler(handler, deps) {
|
|
@@ -52,16 +45,9 @@ export function useReanimatedFocusedInput() {
|
|
|
52
45
|
}
|
|
53
46
|
export function useFocusedInputHandler(handler, deps) {
|
|
54
47
|
const context = useKeyboardContext();
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
[key]: handler
|
|
59
|
-
});
|
|
60
|
-
return () => {
|
|
61
|
-
context.setInputHandlers({
|
|
62
|
-
[key]: undefined
|
|
63
|
-
});
|
|
64
|
-
};
|
|
48
|
+
useSyncEffect(() => {
|
|
49
|
+
const cleanup = context.setInputHandlers(handler);
|
|
50
|
+
return () => cleanup();
|
|
65
51
|
}, deps);
|
|
66
52
|
}
|
|
67
53
|
export * from "./useWindowDimensions";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","KeyboardController","AndroidSoftInputModes","useKeyboardContext","
|
|
1
|
+
{"version":3,"names":["useEffect","KeyboardController","AndroidSoftInputModes","useKeyboardContext","useSyncEffect","useResizeMode","setInputMode","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode","useKeyboardAnimation","context","animated","useReanimatedKeyboardAnimation","reanimated","useGenericKeyboardHandler","handler","deps","cleanup","setKeyboardHandlers","useKeyboardHandler","useKeyboardController","setEnabled","enabled","useReanimatedFocusedInput","input","layout","useFocusedInputHandler","setInputHandlers"],"sources":["index.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport { KeyboardController } from \"../bindings\";\nimport { AndroidSoftInputModes } from \"../constants\";\nimport { useKeyboardContext } from \"../context\";\n\nimport useSyncEffect from \"./useSyncEffect\";\n\nimport type { AnimatedContext, ReanimatedContext } from \"../context\";\nimport type { FocusedInputHandler, KeyboardHandler } from \"../types\";\nimport type { DependencyList } from \"react\";\n\nexport const useResizeMode = () => {\n useEffect(() => {\n KeyboardController.setInputMode(\n AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,\n );\n\n return () => KeyboardController.setDefaultMode();\n }, []);\n};\n\nexport const useKeyboardAnimation = (): AnimatedContext => {\n useResizeMode();\n const context = useKeyboardContext();\n\n return context.animated;\n};\n\nexport const useReanimatedKeyboardAnimation = (): ReanimatedContext => {\n useResizeMode();\n const context = useKeyboardContext();\n\n return context.reanimated;\n};\n\nexport function useGenericKeyboardHandler(\n handler: KeyboardHandler,\n deps?: DependencyList,\n) {\n const context = useKeyboardContext();\n\n useSyncEffect(() => {\n const cleanup = context.setKeyboardHandlers(handler);\n\n return () => cleanup();\n }, deps);\n}\n\nexport function useKeyboardHandler(\n handler: KeyboardHandler,\n deps?: DependencyList,\n) {\n useResizeMode();\n useGenericKeyboardHandler(handler, deps);\n}\n\nexport function useKeyboardController() {\n const context = useKeyboardContext();\n\n return { setEnabled: context.setEnabled, enabled: context.enabled };\n}\n\nexport function useReanimatedFocusedInput() {\n const context = useKeyboardContext();\n\n return { input: context.layout };\n}\n\nexport function useFocusedInputHandler(\n handler: FocusedInputHandler,\n deps?: DependencyList,\n) {\n const context = useKeyboardContext();\n\n useSyncEffect(() => {\n const cleanup = context.setInputHandlers(handler);\n\n return () => cleanup();\n }, deps);\n}\n\nexport * from \"./useWindowDimensions\";\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SAASC,kBAAkB,QAAQ,aAAa;AAChD,SAASC,qBAAqB,QAAQ,cAAc;AACpD,SAASC,kBAAkB,QAAQ,YAAY;AAE/C,OAAOC,aAAa,MAAM,iBAAiB;AAM3C,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjCL,SAAS,CAAC,MAAM;IACdC,kBAAkB,CAACK,YAAY,CAC7BJ,qBAAqB,CAACK,wBACxB,CAAC;IAED,OAAO,MAAMN,kBAAkB,CAACO,cAAc,CAAC,CAAC;EAClD,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAED,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAAuB;EACzDJ,aAAa,CAAC,CAAC;EACf,MAAMK,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpC,OAAOO,OAAO,CAACC,QAAQ;AACzB,CAAC;AAED,OAAO,MAAMC,8BAA8B,GAAGA,CAAA,KAAyB;EACrEP,aAAa,CAAC,CAAC;EACf,MAAMK,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpC,OAAOO,OAAO,CAACG,UAAU;AAC3B,CAAC;AAED,OAAO,SAASC,yBAAyBA,CACvCC,OAAwB,EACxBC,IAAqB,EACrB;EACA,MAAMN,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpCC,aAAa,CAAC,MAAM;IAClB,MAAMa,OAAO,GAAGP,OAAO,CAACQ,mBAAmB,CAACH,OAAO,CAAC;IAEpD,OAAO,MAAME,OAAO,CAAC,CAAC;EACxB,CAAC,EAAED,IAAI,CAAC;AACV;AAEA,OAAO,SAASG,kBAAkBA,CAChCJ,OAAwB,EACxBC,IAAqB,EACrB;EACAX,aAAa,CAAC,CAAC;EACfS,yBAAyB,CAACC,OAAO,EAAEC,IAAI,CAAC;AAC1C;AAEA,OAAO,SAASI,qBAAqBA,CAAA,EAAG;EACtC,MAAMV,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpC,OAAO;IAAEkB,UAAU,EAAEX,OAAO,CAACW,UAAU;IAAEC,OAAO,EAAEZ,OAAO,CAACY;EAAQ,CAAC;AACrE;AAEA,OAAO,SAASC,yBAAyBA,CAAA,EAAG;EAC1C,MAAMb,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpC,OAAO;IAAEqB,KAAK,EAAEd,OAAO,CAACe;EAAO,CAAC;AAClC;AAEA,OAAO,SAASC,sBAAsBA,CACpCX,OAA4B,EAC5BC,IAAqB,EACrB;EACA,MAAMN,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpCC,aAAa,CAAC,MAAM;IAClB,MAAMa,OAAO,GAAGP,OAAO,CAACiB,gBAAgB,CAACZ,OAAO,CAAC;IAEjD,OAAO,MAAME,OAAO,CAAC,CAAC;EACxB,CAAC,EAAED,IAAI,CAAC;AACV;AAEA,cAAc,uBAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* Equivalent to `useEffect` but will run the effect synchronously, i. e. before render.
|
|
5
|
+
*
|
|
6
|
+
* @param {effect} - imperative function
|
|
7
|
+
* @param {deps} - if present, effect will only activate if the values in the list change
|
|
8
|
+
*
|
|
9
|
+
* @author Kiryl Ziusko
|
|
10
|
+
* @since 1.13.0
|
|
11
|
+
* @version 1.0.0
|
|
12
|
+
*/
|
|
13
|
+
const useSyncEffect = (effect, deps) => {
|
|
14
|
+
const cachedDeps = useRef(null);
|
|
15
|
+
const areDepsEqual = deps === null || deps === void 0 ? void 0 : deps.every((el, index) => cachedDeps.current && el === cachedDeps.current[index]);
|
|
16
|
+
const cleanupRef = useRef();
|
|
17
|
+
if (!areDepsEqual || !cachedDeps.current) {
|
|
18
|
+
var _cleanupRef$current;
|
|
19
|
+
(_cleanupRef$current = cleanupRef.current) === null || _cleanupRef$current === void 0 || _cleanupRef$current.call(cleanupRef);
|
|
20
|
+
cleanupRef.current = effect();
|
|
21
|
+
cachedDeps.current = deps;
|
|
22
|
+
}
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
return () => {
|
|
25
|
+
var _cleanupRef$current2;
|
|
26
|
+
(_cleanupRef$current2 = cleanupRef.current) === null || _cleanupRef$current2 === void 0 || _cleanupRef$current2.call(cleanupRef);
|
|
27
|
+
};
|
|
28
|
+
}, []);
|
|
29
|
+
};
|
|
30
|
+
export default useSyncEffect;
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useSyncEffect","effect","deps","cachedDeps","areDepsEqual","every","el","index","current","cleanupRef","_cleanupRef$current","call","_cleanupRef$current2"],"sources":["index.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nimport type { DependencyList } from \"react\";\n\n/**\n * @description\n * Equivalent to `useEffect` but will run the effect synchronously, i. e. before render.\n *\n * @param {effect} - imperative function\n * @param {deps} - if present, effect will only activate if the values in the list change\n *\n * @author Kiryl Ziusko\n * @since 1.13.0\n * @version 1.0.0\n */\nconst useSyncEffect: typeof useEffect = (effect, deps) => {\n const cachedDeps = useRef<DependencyList | undefined | null>(null);\n const areDepsEqual = deps?.every(\n (el, index) => cachedDeps.current && el === cachedDeps.current[index],\n );\n const cleanupRef = useRef<(() => void) | void>();\n\n if (!areDepsEqual || !cachedDeps.current) {\n cleanupRef.current?.();\n cleanupRef.current = effect();\n cachedDeps.current = deps;\n }\n\n useEffect(() => {\n return () => {\n cleanupRef.current?.();\n };\n }, []);\n};\n\nexport default useSyncEffect;\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAIzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,aAA+B,GAAGA,CAACC,MAAM,EAAEC,IAAI,KAAK;EACxD,MAAMC,UAAU,GAAGJ,MAAM,CAAoC,IAAI,CAAC;EAClE,MAAMK,YAAY,GAAGF,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEG,KAAK,CAC9B,CAACC,EAAE,EAAEC,KAAK,KAAKJ,UAAU,CAACK,OAAO,IAAIF,EAAE,KAAKH,UAAU,CAACK,OAAO,CAACD,KAAK,CACtE,CAAC;EACD,MAAME,UAAU,GAAGV,MAAM,CAAsB,CAAC;EAEhD,IAAI,CAACK,YAAY,IAAI,CAACD,UAAU,CAACK,OAAO,EAAE;IAAA,IAAAE,mBAAA;IACxC,CAAAA,mBAAA,GAAAD,UAAU,CAACD,OAAO,cAAAE,mBAAA,eAAlBA,mBAAA,CAAAC,IAAA,CAAAF,UAAqB,CAAC;IACtBA,UAAU,CAACD,OAAO,GAAGP,MAAM,CAAC,CAAC;IAC7BE,UAAU,CAACK,OAAO,GAAGN,IAAI;EAC3B;EAEAJ,SAAS,CAAC,MAAM;IACd,OAAO,MAAM;MAAA,IAAAc,oBAAA;MACX,CAAAA,oBAAA,GAAAH,UAAU,CAACD,OAAO,cAAAI,oBAAA,eAAlBA,oBAAA,CAAAD,IAAA,CAAAF,UAAqB,CAAC;IACxB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAED,eAAeT,aAAa","ignoreList":[]}
|
package/lib/module/internal.js
CHANGED
|
@@ -1,49 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Animated } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export function useSharedHandlers() {
|
|
16
|
-
const handlers = useSharedValue({});
|
|
17
|
-
const jsHandlers = useRef({});
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
import { Animated, findNodeHandle } from "react-native";
|
|
3
|
+
import { registerEventHandler, unregisterEventHandler } from "./event-handler";
|
|
4
|
+
export function useEventHandlerRegistration(map, viewTagRef) {
|
|
5
|
+
const onRegisterHandler = handler => {
|
|
6
|
+
const viewTag = findNodeHandle(viewTagRef.current);
|
|
7
|
+
const ids = Object.keys(handler).map(handlerName => {
|
|
8
|
+
const eventName = map.get(handlerName);
|
|
9
|
+
const functionToCall = handler[handlerName];
|
|
10
|
+
if (eventName && viewTag) {
|
|
11
|
+
return registerEventHandler(event => {
|
|
12
|
+
"worklet";
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// Below we are writing all handlers to `ref` and afterwards synchronize them with
|
|
24
|
-
// shared value (since `refs` are not referring to actual value in worklets).
|
|
25
|
-
// This approach allow us to update synchronously handlers in js thread (and it assures,
|
|
26
|
-
// that it will have all of them) and then update them in worklet thread (calls are
|
|
27
|
-
// happening in FIFO order, so we will always have actual value).
|
|
28
|
-
const updateSharedHandlers = () => {
|
|
29
|
-
handlers.value = jsHandlers.current;
|
|
30
|
-
};
|
|
31
|
-
const setHandlers = useCallback(handler => {
|
|
32
|
-
jsHandlers.current = {
|
|
33
|
-
...jsHandlers.current,
|
|
34
|
-
...handler
|
|
35
|
-
};
|
|
36
|
-
updateSharedHandlers();
|
|
37
|
-
}, []);
|
|
38
|
-
const broadcast = (type, event) => {
|
|
39
|
-
"worklet";
|
|
40
|
-
|
|
41
|
-
Object.keys(handlers.value).forEach(key => {
|
|
42
|
-
var _handlers$value$key, _handlers$value$key$t;
|
|
43
|
-
(_handlers$value$key = handlers.value[key]) === null || _handlers$value$key === void 0 || (_handlers$value$key$t = _handlers$value$key[type]) === null || _handlers$value$key$t === void 0 || _handlers$value$key$t.call(_handlers$value$key, event);
|
|
14
|
+
functionToCall === null || functionToCall === void 0 || functionToCall(event);
|
|
15
|
+
}, eventName, viewTag);
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
44
18
|
});
|
|
19
|
+
return () => {
|
|
20
|
+
ids.forEach(id => id ? unregisterEventHandler(id) : null);
|
|
21
|
+
};
|
|
45
22
|
};
|
|
46
|
-
return
|
|
23
|
+
return onRegisterHandler;
|
|
47
24
|
}
|
|
48
25
|
|
|
49
26
|
/**
|
|
@@ -57,7 +34,7 @@ export function useSharedHandlers() {
|
|
|
57
34
|
*/
|
|
58
35
|
export function useAnimatedValue(initialValue, config) {
|
|
59
36
|
const ref = useRef(null);
|
|
60
|
-
if (ref.current
|
|
37
|
+
if (ref.current === null) {
|
|
61
38
|
ref.current = new Animated.Value(initialValue, config);
|
|
62
39
|
}
|
|
63
40
|
return ref.current;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useRef","Animated","findNodeHandle","registerEventHandler","unregisterEventHandler","useEventHandlerRegistration","map","viewTagRef","onRegisterHandler","handler","viewTag","current","ids","Object","keys","handlerName","eventName","get","functionToCall","event","forEach","id","useAnimatedValue","initialValue","config","ref","Value"],"sources":["internal.ts"],"sourcesContent":["import { useRef } from \"react\";\nimport { Animated, findNodeHandle } from \"react-native\";\n\nimport { registerEventHandler, unregisterEventHandler } from \"./event-handler\";\n\ntype EventHandler = (event: never) => void;\ntype ComponentOrHandle = Parameters<typeof findNodeHandle>[0];\n\nexport function useEventHandlerRegistration<\n H extends Partial<Record<string, EventHandler>>,\n>(\n map: Map<keyof H, string>,\n viewTagRef: React.MutableRefObject<ComponentOrHandle>,\n) {\n const onRegisterHandler = (handler: H) => {\n const viewTag = findNodeHandle(viewTagRef.current);\n const ids = Object.keys(handler).map((handlerName) => {\n const eventName = map.get(handlerName as keyof H);\n const functionToCall = handler[handlerName as keyof H];\n\n if (eventName && viewTag) {\n return registerEventHandler(\n (event: Parameters<NonNullable<H[keyof H]>>[0]) => {\n \"worklet\";\n\n functionToCall?.(event);\n },\n eventName,\n viewTag,\n );\n }\n\n return null;\n });\n\n return () => {\n ids.forEach((id) => (id ? unregisterEventHandler(id) : null));\n };\n };\n\n return onRegisterHandler;\n}\n\n/**\n * TS variant of `useAnimatedValue` hook which is added in RN 0.71\n * A better alternative of storing animated values in refs, since\n * it doesn't recreate a new `Animated.Value` object on every re-render\n * and therefore consumes less memory. We can not use a variant from\n * RN, since this library supports earlier versions of RN.\n *\n * @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937\n */\nexport function useAnimatedValue(\n initialValue: number,\n config?: Animated.AnimatedConfig,\n): Animated.Value {\n const ref = useRef<Animated.Value | null>(null);\n\n if (ref.current === null) {\n ref.current = new Animated.Value(initialValue, config);\n }\n\n return ref.current;\n}\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,OAAO;AAC9B,SAASC,QAAQ,EAAEC,cAAc,QAAQ,cAAc;AAEvD,SAASC,oBAAoB,EAAEC,sBAAsB,QAAQ,iBAAiB;AAK9E,OAAO,SAASC,2BAA2BA,CAGzCC,GAAyB,EACzBC,UAAqD,EACrD;EACA,MAAMC,iBAAiB,GAAIC,OAAU,IAAK;IACxC,MAAMC,OAAO,GAAGR,cAAc,CAACK,UAAU,CAACI,OAAO,CAAC;IAClD,MAAMC,GAAG,GAAGC,MAAM,CAACC,IAAI,CAACL,OAAO,CAAC,CAACH,GAAG,CAAES,WAAW,IAAK;MACpD,MAAMC,SAAS,GAAGV,GAAG,CAACW,GAAG,CAACF,WAAsB,CAAC;MACjD,MAAMG,cAAc,GAAGT,OAAO,CAACM,WAAW,CAAY;MAEtD,IAAIC,SAAS,IAAIN,OAAO,EAAE;QACxB,OAAOP,oBAAoB,CACxBgB,KAA6C,IAAK;UACjD,SAAS;;UAETD,cAAc,aAAdA,cAAc,eAAdA,cAAc,CAAGC,KAAK,CAAC;QACzB,CAAC,EACDH,SAAS,EACTN,OACF,CAAC;MACH;MAEA,OAAO,IAAI;IACb,CAAC,CAAC;IAEF,OAAO,MAAM;MACXE,GAAG,CAACQ,OAAO,CAAEC,EAAE,IAAMA,EAAE,GAAGjB,sBAAsB,CAACiB,EAAE,CAAC,GAAG,IAAK,CAAC;IAC/D,CAAC;EACH,CAAC;EAED,OAAOb,iBAAiB;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASc,gBAAgBA,CAC9BC,YAAoB,EACpBC,MAAgC,EAChB;EAChB,MAAMC,GAAG,GAAGzB,MAAM,CAAwB,IAAI,CAAC;EAE/C,IAAIyB,GAAG,CAACd,OAAO,KAAK,IAAI,EAAE;IACxBc,GAAG,CAACd,OAAO,GAAG,IAAIV,QAAQ,CAACyB,KAAK,CAACH,YAAY,EAAEC,MAAM,CAAC;EACxD;EAEA,OAAOC,GAAG,CAACd,OAAO;AACpB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NOOP","applyMonkeyPatch","revertMonkeyPatch"],"sources":["monkey-patch.ts"],"sourcesContent":["// stub for all platforms\nconst NOOP = () => {};\nexport const applyMonkeyPatch = NOOP;\nexport const revertMonkeyPatch = NOOP;\n"],"mappings":"AAAA;AACA,MAAMA,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"names":["NOOP","applyMonkeyPatch","revertMonkeyPatch"],"sources":["monkey-patch.ts"],"sourcesContent":["// stub for all platforms\nconst NOOP = () => {};\n\nexport const applyMonkeyPatch = NOOP;\nexport const revertMonkeyPatch = NOOP;\n"],"mappings":"AAAA;AACA,MAAMA,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,OAAO,MAAMC,gBAAgB,GAAGD,IAAI;AACpC,OAAO,MAAME,iBAAiB,GAAGF,IAAI","ignoreList":[]}
|
package/lib/module/reanimated.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
const NOOP = () => () => {};
|
|
2
2
|
export const useAnimatedKeyboardHandler = NOOP;
|
|
3
3
|
export const useFocusedInputLayoutHandler = NOOP;
|
|
4
|
-
export const useFocusedInputTextHandler = NOOP;
|
|
5
|
-
export const useFocusedInputSelectionHandler = NOOP;
|
|
6
4
|
//# sourceMappingURL=reanimated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NOOP","useAnimatedKeyboardHandler","useFocusedInputLayoutHandler"
|
|
1
|
+
{"version":3,"names":["NOOP","useAnimatedKeyboardHandler","useFocusedInputLayoutHandler"],"sources":["reanimated.ts"],"sourcesContent":["import type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from \"./types\";\n\nconst NOOP = () => () => {};\n\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;\n"],"mappings":"AAQA,MAAMA,IAAI,GAAGA,CAAA,KAAM,MAAM,CAAC,CAAC;AAE3B,OAAO,MAAMC,0BAGZ,GAAGD,IAAI;AACR,OAAO,MAAME,4BAGZ,GAAGF,IAAI","ignoreList":[]}
|
|
@@ -43,36 +43,4 @@ export const useFocusedInputLayoutHandler = (handlers, dependencies) => {
|
|
|
43
43
|
}
|
|
44
44
|
}, ["onFocusedInputLayoutChanged"], doDependenciesDiffer);
|
|
45
45
|
};
|
|
46
|
-
export const useFocusedInputTextHandler = (handlers, dependencies) => {
|
|
47
|
-
const {
|
|
48
|
-
context,
|
|
49
|
-
doDependenciesDiffer
|
|
50
|
-
} = useHandler(handlers, dependencies);
|
|
51
|
-
return useEvent(event => {
|
|
52
|
-
"worklet";
|
|
53
|
-
|
|
54
|
-
const {
|
|
55
|
-
onFocusedInputTextChanged
|
|
56
|
-
} = handlers;
|
|
57
|
-
if (onFocusedInputTextChanged && event.eventName.endsWith("onFocusedInputTextChanged")) {
|
|
58
|
-
onFocusedInputTextChanged(event, context);
|
|
59
|
-
}
|
|
60
|
-
}, ["onFocusedInputTextChanged"], doDependenciesDiffer);
|
|
61
|
-
};
|
|
62
|
-
export const useFocusedInputSelectionHandler = (handlers, dependencies) => {
|
|
63
|
-
const {
|
|
64
|
-
context,
|
|
65
|
-
doDependenciesDiffer
|
|
66
|
-
} = useHandler(handlers, dependencies);
|
|
67
|
-
return useEvent(event => {
|
|
68
|
-
"worklet";
|
|
69
|
-
|
|
70
|
-
const {
|
|
71
|
-
onFocusedInputSelectionChanged
|
|
72
|
-
} = handlers;
|
|
73
|
-
if (onFocusedInputSelectionChanged && event.eventName.endsWith("onFocusedInputSelectionChanged")) {
|
|
74
|
-
onFocusedInputSelectionChanged(event, context);
|
|
75
|
-
}
|
|
76
|
-
}, ["onFocusedInputSelectionChanged"], doDependenciesDiffer);
|
|
77
|
-
};
|
|
78
46
|
//# sourceMappingURL=reanimated.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEvent","useHandler","useAnimatedKeyboardHandler","handlers","dependencies","context","doDependenciesDiffer","event","onKeyboardMoveStart","onKeyboardMove","onKeyboardMoveEnd","onKeyboardMoveInteractive","eventName","endsWith","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged"
|
|
1
|
+
{"version":3,"names":["useEvent","useHandler","useAnimatedKeyboardHandler","handlers","dependencies","context","doDependenciesDiffer","event","onKeyboardMoveStart","onKeyboardMove","onKeyboardMoveEnd","onKeyboardMoveInteractive","eventName","endsWith","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged"],"sources":["reanimated.native.ts"],"sourcesContent":["import { useEvent, useHandler } from \"react-native-reanimated\";\n\nimport type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from \"./types\";\n\ntype EventContext = Record<string, unknown>;\n\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\n EventContext,\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 EventContext,\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"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,UAAU,QAAQ,yBAAyB;AAY9D,OAAO,MAAMC,0BAGZ,GAAGA,CAACC,QAAQ,EAAEC,YAAY,KAAK;EAC9B,MAAM;IAAEC,OAAO;IAAEC;EAAqB,CAAC,GAAGL,UAAU,CAACE,QAAQ,EAAEC,YAAY,CAAC;EAE5E,OAAOJ,QAAQ,CACZO,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MACJC,mBAAmB;MACnBC,cAAc;MACdC,iBAAiB;MACjBC;IACF,CAAC,GAAGR,QAAQ;IAEZ,IACEK,mBAAmB,IACnBD,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,qBAAqB,CAAC,EAC/C;MACAL,mBAAmB,CAACD,KAAK,EAAEF,OAAO,CAAC;IACrC;IAEA,IAAII,cAAc,IAAIF,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;MAChEJ,cAAc,CAACF,KAAK,EAAEF,OAAO,CAAC;IAChC;IAEA,IAAIK,iBAAiB,IAAIH,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,mBAAmB,CAAC,EAAE;MACtEH,iBAAiB,CAACH,KAAK,EAAEF,OAAO,CAAC;IACnC;IAEA,IACEM,yBAAyB,IACzBJ,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,2BAA2B,CAAC,EACrD;MACAF,yBAAyB,CAACJ,KAAK,EAAEF,OAAO,CAAC;IAC3C;EACF,CAAC,EACD,CACE,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,2BAA2B,CAC5B,EACDC,oBACF,CAAC;AACH,CAAC;AAED,OAAO,MAAMQ,4BAGZ,GAAGA,CAACX,QAAQ,EAAEC,YAAY,KAAK;EAC9B,MAAM;IAAEC,OAAO;IAAEC;EAAqB,CAAC,GAAGL,UAAU,CAACE,QAAQ,EAAEC,YAAY,CAAC;EAE5E,OAAOJ,QAAQ,CACZO,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MAAEQ;IAA4B,CAAC,GAAGZ,QAAQ;IAEhD,IACEY,2BAA2B,IAC3BR,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,6BAA6B,CAAC,EACvD;MACAE,2BAA2B,CAACR,KAAK,EAAEF,OAAO,CAAC;IAC7C;EACF,CAAC,EACD,CAAC,6BAA6B,CAAC,EAC/BC,oBACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["codegenNativeComponent","excludedPlatforms"],"sources":["KeyboardGestureAreaNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\nimport type {
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent","excludedPlatforms"],"sources":["KeyboardGestureAreaNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\nimport type {\n Double,\n WithDefault,\n} 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 offset?: Double;\n}\n\nexport default codegenNativeComponent<NativeProps>(\"KeyboardGestureArea\", {\n excludedPlatforms: [\"iOS\"],\n}) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAgB5F,eAAeA,sBAAsB,CAAc,qBAAqB,EAAE;EACxEC,iBAAiB,EAAE,CAAC,KAAK;AAC3B,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/types.js.map
CHANGED
|
@@ -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 FocusedInputSelectionChangedEvent = {\n target: number;\n selection: {\n start: {\n x: number;\n y: number;\n position: number;\n };\n end: {\n x: number;\n y: number;\n position: number;\n };\n };\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 onFocusedInputSelectionChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\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 onFocusedInputSelectionChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\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};\nexport type WindowDimensionsAvailableEvents = \"windowDidResize\";\nexport type WindowDimensionsEventData = {\n width: number;\n height: number;\n};\nexport type WindowDimensionsEventsModule = {\n addListener: (\n name: WindowDimensionsAvailableEvents,\n cb: (e: WindowDimensionsEventData) => 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;\nexport type FocusedInputSelectionHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputSelectionChanged?: (\n e: FocusedInputSelectionChangedEvent,\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 onSelectionChange: (e: FocusedInputSelectionChangedEvent) => void;\n}>;\nexport type FocusedInputHandlers = Handlers<FocusedInputHandler>;\n"],"mappings":"","ignoreList":[]}
|
|
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 FocusedInputSelectionChangedEvent = {\n target: number;\n selection: {\n start: {\n x: number;\n y: number;\n position: number;\n };\n end: {\n x: number;\n y: number;\n position: number;\n };\n };\n};\nexport type EventWithName<T> = {\n eventName: string;\n} & T;\n\n// native View/Module declarations\nexport type KeyboardControllerProps = {\n //ref prop\n ref?: React.Ref<React.Component<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 onFocusedInputSelectionChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\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 onFocusedInputSelectionChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\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 /**\n * Extra distance to the keyboard.\n */\n offset?: number;\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};\nexport type WindowDimensionsAvailableEvents = \"windowDidResize\";\nexport type WindowDimensionsEventData = {\n width: number;\n height: number;\n};\nexport type WindowDimensionsEventsModule = {\n addListener: (\n name: WindowDimensionsAvailableEvents,\n cb: (e: WindowDimensionsEventData) => 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;\nexport type FocusedInputSelectionHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputSelectionChanged?: (\n e: FocusedInputSelectionChangedEvent,\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 onSelectionChange: (e: FocusedInputSelectionChangedEvent) => void;\n}>;\nexport type FocusedInputHandlers = Handlers<FocusedInputHandler>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { KeyboardToolbarTheme } from "./types";
|
|
3
|
-
import type { ViewStyle } from "react-native";
|
|
3
|
+
import type { GestureResponderEvent, ViewStyle } from "react-native";
|
|
4
4
|
type ButtonProps = {
|
|
5
5
|
disabled?: boolean;
|
|
6
|
-
onPress: () => void;
|
|
6
|
+
onPress: (event: GestureResponderEvent) => void;
|
|
7
7
|
accessibilityLabel: string;
|
|
8
8
|
accessibilityHint: string;
|
|
9
9
|
testID: string;
|
|
@@ -4,6 +4,7 @@ import Button from "./Button";
|
|
|
4
4
|
import { colors } from "./colors";
|
|
5
5
|
import type { HEX, KeyboardToolbarTheme } from "./types";
|
|
6
6
|
import type { ReactNode } from "react";
|
|
7
|
+
import type { GestureResponderEvent } from "react-native";
|
|
7
8
|
export type KeyboardToolbarProps = {
|
|
8
9
|
/** An element that is shown in the middle of the toolbar. */
|
|
9
10
|
content?: JSX.Element | null;
|
|
@@ -23,15 +24,15 @@ export type KeyboardToolbarProps = {
|
|
|
23
24
|
/**
|
|
24
25
|
* A callback that is called when the user presses the next button along with the default action.
|
|
25
26
|
*/
|
|
26
|
-
onNextCallback?: () => void;
|
|
27
|
+
onNextCallback?: (event: GestureResponderEvent) => void;
|
|
27
28
|
/**
|
|
28
29
|
* A callback that is called when the user presses the previous button along with the default action.
|
|
29
30
|
*/
|
|
30
|
-
onPrevCallback?: () => void;
|
|
31
|
+
onPrevCallback?: (event: GestureResponderEvent) => void;
|
|
31
32
|
/**
|
|
32
33
|
* A callback that is called when the user presses the done button along with the default action.
|
|
33
34
|
*/
|
|
34
|
-
onDoneCallback?: () => void;
|
|
35
|
+
onDoneCallback?: (event: GestureResponderEvent) => void;
|
|
35
36
|
/**
|
|
36
37
|
* A component that applies blur effect to the toolbar.
|
|
37
38
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Animated } from "react-native";
|
|
2
|
-
import type {
|
|
2
|
+
import type { FocusedInputHandler, FocusedInputLayoutChangedEvent, KeyboardHandler } from "./types";
|
|
3
3
|
import type React from "react";
|
|
4
4
|
import type { SharedValue } from "react-native-reanimated";
|
|
5
5
|
export type AnimatedContext = {
|
|
@@ -15,8 +15,8 @@ export type KeyboardAnimationContext = {
|
|
|
15
15
|
animated: AnimatedContext;
|
|
16
16
|
reanimated: ReanimatedContext;
|
|
17
17
|
layout: SharedValue<FocusedInputLayoutChangedEvent | null>;
|
|
18
|
-
setKeyboardHandlers: (handlers:
|
|
19
|
-
setInputHandlers: (handlers:
|
|
18
|
+
setKeyboardHandlers: (handlers: KeyboardHandler) => () => void;
|
|
19
|
+
setInputHandlers: (handlers: FocusedInputHandler) => () => void;
|
|
20
20
|
setEnabled: React.Dispatch<React.SetStateAction<boolean>>;
|
|
21
21
|
};
|
|
22
22
|
export declare const KeyboardContext: React.Context<KeyboardAnimationContext>;
|
|
@@ -13,5 +13,5 @@ export declare function useKeyboardController(): {
|
|
|
13
13
|
export declare function useReanimatedFocusedInput(): {
|
|
14
14
|
input: import("react-native-reanimated").SharedValue<import("../types").FocusedInputLayoutChangedEvent | null>;
|
|
15
15
|
};
|
|
16
|
-
export declare function useFocusedInputHandler(handler
|
|
16
|
+
export declare function useFocusedInputHandler(handler: FocusedInputHandler, deps?: DependencyList): void;
|
|
17
17
|
export * from "./useWindowDimensions";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* Equivalent to `useEffect` but will run the effect synchronously, i. e. before render.
|
|
5
|
+
*
|
|
6
|
+
* @param {effect} - imperative function
|
|
7
|
+
* @param {deps} - if present, effect will only activate if the values in the list change
|
|
8
|
+
*
|
|
9
|
+
* @author Kiryl Ziusko
|
|
10
|
+
* @since 1.13.0
|
|
11
|
+
* @version 1.0.0
|
|
12
|
+
*/
|
|
13
|
+
declare const useSyncEffect: typeof useEffect;
|
|
14
|
+
export default useSyncEffect;
|
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
type
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
<K extends keyof T>(type: K, event: Parameters<T[K]>[0]) => void
|
|
7
|
-
];
|
|
8
|
-
/**
|
|
9
|
-
* Hook for storing worklet handlers (objects with keys, where values are worklets).
|
|
10
|
-
* Returns methods for setting handlers and broadcasting events in them.
|
|
11
|
-
*
|
|
12
|
-
* T is a generic that looks like:
|
|
13
|
-
* @example
|
|
14
|
-
* {
|
|
15
|
-
* onEvent: () => {},
|
|
16
|
-
* onEvent2: () => {},
|
|
17
|
-
* }
|
|
18
|
-
*/
|
|
19
|
-
export declare function useSharedHandlers<T extends UntypedHandler>(): SharedHandlersReturnType<T>;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Animated, findNodeHandle } from "react-native";
|
|
3
|
+
type EventHandler = (event: never) => void;
|
|
4
|
+
type ComponentOrHandle = Parameters<typeof findNodeHandle>[0];
|
|
5
|
+
export declare function useEventHandlerRegistration<H extends Partial<Record<string, EventHandler>>>(map: Map<keyof H, string>, viewTagRef: React.MutableRefObject<ComponentOrHandle>): (handler: H) => () => void;
|
|
20
6
|
/**
|
|
21
7
|
* TS variant of `useAnimatedValue` hook which is added in RN 0.71
|
|
22
8
|
* A better alternative of storing animated values in refs, since
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { EventWithName, FocusedInputLayoutChangedEvent, FocusedInputLayoutHandlerHook,
|
|
1
|
+
import type { EventWithName, FocusedInputLayoutChangedEvent, FocusedInputLayoutHandlerHook, KeyboardHandlerHook, NativeEvent } from "./types";
|
|
2
2
|
export declare const useAnimatedKeyboardHandler: KeyboardHandlerHook<Record<string, unknown>, EventWithName<NativeEvent>>;
|
|
3
3
|
export declare const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<Record<string, unknown>, EventWithName<FocusedInputLayoutChangedEvent>>;
|
|
4
|
-
export declare const useFocusedInputTextHandler: FocusedInputTextHandlerHook<Record<string, unknown>, EventWithName<FocusedInputTextChangedEvent>>;
|
|
5
|
-
export declare const useFocusedInputSelectionHandler: FocusedInputSelectionHandlerHook<Record<string, unknown>, EventWithName<FocusedInputSelectionChangedEvent>>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type { EventWithName, FocusedInputLayoutChangedEvent, FocusedInputLayoutHandlerHook,
|
|
1
|
+
import type { EventWithName, FocusedInputLayoutChangedEvent, FocusedInputLayoutHandlerHook, KeyboardHandlerHook, NativeEvent } from "./types";
|
|
2
2
|
type EventContext = Record<string, unknown>;
|
|
3
3
|
export declare const useAnimatedKeyboardHandler: KeyboardHandlerHook<EventContext, EventWithName<NativeEvent>>;
|
|
4
4
|
export declare const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<EventContext, EventWithName<FocusedInputLayoutChangedEvent>>;
|
|
5
|
-
export declare const useFocusedInputTextHandler: FocusedInputTextHandlerHook<EventContext, EventWithName<FocusedInputTextChangedEvent>>;
|
|
6
|
-
export declare const useFocusedInputSelectionHandler: FocusedInputSelectionHandlerHook<EventContext, EventWithName<FocusedInputSelectionChangedEvent>>;
|
|
7
5
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { HostComponent } from "react-native";
|
|
2
2
|
import type { ViewProps } from "react-native/Libraries/Components/View/ViewPropTypes";
|
|
3
|
-
import type { WithDefault } from "react-native/Libraries/Types/CodegenTypes";
|
|
3
|
+
import type { Double, WithDefault } from "react-native/Libraries/Types/CodegenTypes";
|
|
4
4
|
export interface NativeProps extends ViewProps {
|
|
5
5
|
interpolator?: WithDefault<"linear" | "ios", "linear">;
|
|
6
6
|
showOnSwipeUp?: boolean;
|
|
7
7
|
enableSwipeToDismiss?: boolean;
|
|
8
|
+
offset?: Double;
|
|
8
9
|
}
|
|
9
10
|
declare const _default: HostComponent<NativeProps>;
|
|
10
11
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { EmitterSubscription, NativeSyntheticEvent, ViewProps } from "react-native";
|
|
2
3
|
export type NativeEvent = {
|
|
3
4
|
progress: number;
|
|
@@ -39,6 +40,7 @@ export type EventWithName<T> = {
|
|
|
39
40
|
eventName: string;
|
|
40
41
|
} & T;
|
|
41
42
|
export type KeyboardControllerProps = {
|
|
43
|
+
ref?: React.Ref<React.Component<KeyboardControllerProps>>;
|
|
42
44
|
onKeyboardMoveStart?: (e: NativeSyntheticEvent<EventWithName<NativeEvent>>) => void;
|
|
43
45
|
onKeyboardMove?: (e: NativeSyntheticEvent<EventWithName<NativeEvent>>) => void;
|
|
44
46
|
onKeyboardMoveEnd?: (e: NativeSyntheticEvent<EventWithName<NativeEvent>>) => void;
|
|
@@ -67,6 +69,10 @@ export type KeyboardGestureAreaProps = {
|
|
|
67
69
|
* Defaults to `true`.
|
|
68
70
|
*/
|
|
69
71
|
enableSwipeToDismiss?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Extra distance to the keyboard.
|
|
74
|
+
*/
|
|
75
|
+
offset?: number;
|
|
70
76
|
} & ViewProps;
|
|
71
77
|
export type Direction = "next" | "prev" | "current";
|
|
72
78
|
export type KeyboardControllerModule = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-keyboard-controller",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "Keyboard manager which works in identical way on both iOS and Android",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -42,10 +42,12 @@
|
|
|
42
42
|
"keywords": [
|
|
43
43
|
"react-native",
|
|
44
44
|
"keyboard",
|
|
45
|
-
"
|
|
45
|
+
"interactive",
|
|
46
46
|
"dismiss",
|
|
47
|
+
"animation",
|
|
47
48
|
"focused input",
|
|
48
49
|
"text changed",
|
|
50
|
+
"selection changed",
|
|
49
51
|
"avoiding view",
|
|
50
52
|
"avoid keyboard",
|
|
51
53
|
"sticky view",
|
|
@@ -69,8 +71,9 @@
|
|
|
69
71
|
},
|
|
70
72
|
"devDependencies": {
|
|
71
73
|
"@commitlint/config-conventional": "^11.0.0",
|
|
72
|
-
"@react-native/eslint-config": "^0.
|
|
74
|
+
"@react-native/eslint-config": "^0.75.0-rc.6",
|
|
73
75
|
"@release-it/conventional-changelog": "^2.0.0",
|
|
76
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
74
77
|
"@types/jest": "^29.2.1",
|
|
75
78
|
"@types/react": "^18.2.6",
|
|
76
79
|
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
|
@@ -80,24 +83,28 @@
|
|
|
80
83
|
"eslint": "^8.19.0",
|
|
81
84
|
"eslint-config-prettier": "^8.5.0",
|
|
82
85
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
86
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
83
87
|
"eslint-plugin-import": "^2.28.1",
|
|
84
88
|
"eslint-plugin-jest": "^26.5.3",
|
|
85
89
|
"eslint-plugin-prettier": "^4.2.1",
|
|
90
|
+
"eslint-plugin-react-compiler": "^0.0.0-experimental-0998c1e-20240625",
|
|
91
|
+
"eslint-plugin-react-perf": "^3.3.2",
|
|
86
92
|
"husky": "^6.0.0",
|
|
87
93
|
"jest": "^29.6.3",
|
|
88
94
|
"pod-install": "^0.1.0",
|
|
89
95
|
"prettier": "^2.8.8",
|
|
90
|
-
"react": "18.
|
|
91
|
-
"react-native": "0.
|
|
96
|
+
"react": "18.3.1",
|
|
97
|
+
"react-native": "0.75.0-rc.6",
|
|
92
98
|
"react-native-builder-bob": "^0.18.0",
|
|
93
|
-
"react-native-reanimated": "3.
|
|
99
|
+
"react-native-reanimated": "3.15.0",
|
|
100
|
+
"react-test-renderer": "18.2.0",
|
|
94
101
|
"release-it": "^14.2.2",
|
|
95
102
|
"typescript": "5.0.4"
|
|
96
103
|
},
|
|
97
104
|
"peerDependencies": {
|
|
98
105
|
"react": "*",
|
|
99
106
|
"react-native": "*",
|
|
100
|
-
"react-native-reanimated": ">=
|
|
107
|
+
"react-native-reanimated": ">=3.0.0"
|
|
101
108
|
},
|
|
102
109
|
"jest": {
|
|
103
110
|
"preset": "react-native",
|