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
package/src/hooks/index.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { useEffect } from "react";
|
|
|
3
3
|
import { KeyboardController } from "../bindings";
|
|
4
4
|
import { AndroidSoftInputModes } from "../constants";
|
|
5
5
|
import { useKeyboardContext } from "../context";
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
import useSyncEffect from "./useSyncEffect";
|
|
7
8
|
|
|
8
9
|
import type { AnimatedContext, ReanimatedContext } from "../context";
|
|
9
10
|
import type { FocusedInputHandler, KeyboardHandler } from "../types";
|
|
@@ -39,14 +40,10 @@ export function useGenericKeyboardHandler(
|
|
|
39
40
|
) {
|
|
40
41
|
const context = useKeyboardContext();
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
context.setKeyboardHandlers({ [key]: handler });
|
|
43
|
+
useSyncEffect(() => {
|
|
44
|
+
const cleanup = context.setKeyboardHandlers(handler);
|
|
46
45
|
|
|
47
|
-
return () =>
|
|
48
|
-
context.setKeyboardHandlers({ [key]: undefined });
|
|
49
|
-
};
|
|
46
|
+
return () => cleanup();
|
|
50
47
|
}, deps);
|
|
51
48
|
}
|
|
52
49
|
|
|
@@ -71,19 +68,15 @@ export function useReanimatedFocusedInput() {
|
|
|
71
68
|
}
|
|
72
69
|
|
|
73
70
|
export function useFocusedInputHandler(
|
|
74
|
-
handler
|
|
71
|
+
handler: FocusedInputHandler,
|
|
75
72
|
deps?: DependencyList,
|
|
76
73
|
) {
|
|
77
74
|
const context = useKeyboardContext();
|
|
78
75
|
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
context.setInputHandlers({ [key]: handler });
|
|
76
|
+
useSyncEffect(() => {
|
|
77
|
+
const cleanup = context.setInputHandlers(handler);
|
|
83
78
|
|
|
84
|
-
return () =>
|
|
85
|
-
context.setInputHandlers({ [key]: undefined });
|
|
86
|
-
};
|
|
79
|
+
return () => cleanup();
|
|
87
80
|
}, deps);
|
|
88
81
|
}
|
|
89
82
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
|
|
3
|
+
import type { DependencyList } from "react";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description
|
|
7
|
+
* Equivalent to `useEffect` but will run the effect synchronously, i. e. before render.
|
|
8
|
+
*
|
|
9
|
+
* @param {effect} - imperative function
|
|
10
|
+
* @param {deps} - if present, effect will only activate if the values in the list change
|
|
11
|
+
*
|
|
12
|
+
* @author Kiryl Ziusko
|
|
13
|
+
* @since 1.13.0
|
|
14
|
+
* @version 1.0.0
|
|
15
|
+
*/
|
|
16
|
+
const useSyncEffect: typeof useEffect = (effect, deps) => {
|
|
17
|
+
const cachedDeps = useRef<DependencyList | undefined | null>(null);
|
|
18
|
+
const areDepsEqual = deps?.every(
|
|
19
|
+
(el, index) => cachedDeps.current && el === cachedDeps.current[index],
|
|
20
|
+
);
|
|
21
|
+
const cleanupRef = useRef<(() => void) | void>();
|
|
22
|
+
|
|
23
|
+
if (!areDepsEqual || !cachedDeps.current) {
|
|
24
|
+
cleanupRef.current?.();
|
|
25
|
+
cleanupRef.current = effect();
|
|
26
|
+
cachedDeps.current = deps;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
return () => {
|
|
31
|
+
cleanupRef.current?.();
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default useSyncEffect;
|
package/src/internal.ts
CHANGED
|
@@ -1,63 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Animated } from "react-native";
|
|
3
|
-
import { useSharedValue } from "react-native-reanimated";
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
import { Animated, findNodeHandle } from "react-native";
|
|
4
3
|
|
|
5
|
-
import
|
|
4
|
+
import { registerEventHandler, unregisterEventHandler } from "./event-handler";
|
|
6
5
|
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
(handler: Handlers<T>) => void,
|
|
10
|
-
<K extends keyof T>(type: K, event: Parameters<T[K]>[0]) => void,
|
|
11
|
-
];
|
|
6
|
+
type EventHandler = (event: never) => void;
|
|
7
|
+
type ComponentOrHandle = Parameters<typeof findNodeHandle>[0];
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export function useSharedHandlers<
|
|
25
|
-
T extends UntypedHandler,
|
|
26
|
-
>(): SharedHandlersReturnType<T> {
|
|
27
|
-
const handlers = useSharedValue<Handlers<T>>({});
|
|
28
|
-
const jsHandlers = useRef<Handlers<T>>({});
|
|
9
|
+
export function useEventHandlerRegistration<
|
|
10
|
+
H extends Partial<Record<string, EventHandler>>,
|
|
11
|
+
>(
|
|
12
|
+
map: Map<keyof H, string>,
|
|
13
|
+
viewTagRef: React.MutableRefObject<ComponentOrHandle>,
|
|
14
|
+
) {
|
|
15
|
+
const onRegisterHandler = (handler: H) => {
|
|
16
|
+
const viewTag = findNodeHandle(viewTagRef.current);
|
|
17
|
+
const ids = Object.keys(handler).map((handlerName) => {
|
|
18
|
+
const eventName = map.get(handlerName as keyof H);
|
|
19
|
+
const functionToCall = handler[handlerName as keyof H];
|
|
29
20
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
const setHandlers = useCallback((handler: Handlers<T>) => {
|
|
43
|
-
jsHandlers.current = {
|
|
44
|
-
...jsHandlers.current,
|
|
45
|
-
...handler,
|
|
46
|
-
};
|
|
47
|
-
updateSharedHandlers();
|
|
48
|
-
}, []);
|
|
49
|
-
const broadcast = <K extends keyof T>(
|
|
50
|
-
type: K,
|
|
51
|
-
event: Parameters<T[K]>[0],
|
|
52
|
-
) => {
|
|
53
|
-
"worklet";
|
|
21
|
+
if (eventName && viewTag) {
|
|
22
|
+
return registerEventHandler(
|
|
23
|
+
(event: Parameters<NonNullable<H[keyof H]>>[0]) => {
|
|
24
|
+
"worklet";
|
|
25
|
+
|
|
26
|
+
functionToCall?.(event);
|
|
27
|
+
},
|
|
28
|
+
eventName,
|
|
29
|
+
viewTag,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
54
32
|
|
|
55
|
-
|
|
56
|
-
handlers.value[key]?.[type]?.(event);
|
|
33
|
+
return null;
|
|
57
34
|
});
|
|
35
|
+
|
|
36
|
+
return () => {
|
|
37
|
+
ids.forEach((id) => (id ? unregisterEventHandler(id) : null));
|
|
38
|
+
};
|
|
58
39
|
};
|
|
59
40
|
|
|
60
|
-
return
|
|
41
|
+
return onRegisterHandler;
|
|
61
42
|
}
|
|
62
43
|
|
|
63
44
|
/**
|
|
@@ -75,7 +56,7 @@ export function useAnimatedValue(
|
|
|
75
56
|
): Animated.Value {
|
|
76
57
|
const ref = useRef<Animated.Value | null>(null);
|
|
77
58
|
|
|
78
|
-
if (ref.current
|
|
59
|
+
if (ref.current === null) {
|
|
79
60
|
ref.current = new Animated.Value(initialValue, config);
|
|
80
61
|
}
|
|
81
62
|
|
package/src/monkey-patch.ts
CHANGED
package/src/reanimated.native.ts
CHANGED
|
@@ -4,10 +4,6 @@ import type {
|
|
|
4
4
|
EventWithName,
|
|
5
5
|
FocusedInputLayoutChangedEvent,
|
|
6
6
|
FocusedInputLayoutHandlerHook,
|
|
7
|
-
FocusedInputSelectionChangedEvent,
|
|
8
|
-
FocusedInputSelectionHandlerHook,
|
|
9
|
-
FocusedInputTextChangedEvent,
|
|
10
|
-
FocusedInputTextHandlerHook,
|
|
11
7
|
KeyboardHandlerHook,
|
|
12
8
|
NativeEvent,
|
|
13
9
|
} from "./types";
|
|
@@ -84,49 +80,3 @@ export const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<
|
|
|
84
80
|
doDependenciesDiffer,
|
|
85
81
|
);
|
|
86
82
|
};
|
|
87
|
-
|
|
88
|
-
export const useFocusedInputTextHandler: FocusedInputTextHandlerHook<
|
|
89
|
-
EventContext,
|
|
90
|
-
EventWithName<FocusedInputTextChangedEvent>
|
|
91
|
-
> = (handlers, dependencies) => {
|
|
92
|
-
const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);
|
|
93
|
-
|
|
94
|
-
return useEvent(
|
|
95
|
-
(event) => {
|
|
96
|
-
"worklet";
|
|
97
|
-
const { onFocusedInputTextChanged } = handlers;
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
onFocusedInputTextChanged &&
|
|
101
|
-
event.eventName.endsWith("onFocusedInputTextChanged")
|
|
102
|
-
) {
|
|
103
|
-
onFocusedInputTextChanged(event, context);
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
["onFocusedInputTextChanged"],
|
|
107
|
-
doDependenciesDiffer,
|
|
108
|
-
);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export const useFocusedInputSelectionHandler: FocusedInputSelectionHandlerHook<
|
|
112
|
-
EventContext,
|
|
113
|
-
EventWithName<FocusedInputSelectionChangedEvent>
|
|
114
|
-
> = (handlers, dependencies) => {
|
|
115
|
-
const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);
|
|
116
|
-
|
|
117
|
-
return useEvent(
|
|
118
|
-
(event) => {
|
|
119
|
-
"worklet";
|
|
120
|
-
const { onFocusedInputSelectionChanged } = handlers;
|
|
121
|
-
|
|
122
|
-
if (
|
|
123
|
-
onFocusedInputSelectionChanged &&
|
|
124
|
-
event.eventName.endsWith("onFocusedInputSelectionChanged")
|
|
125
|
-
) {
|
|
126
|
-
onFocusedInputSelectionChanged(event, context);
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
["onFocusedInputSelectionChanged"],
|
|
130
|
-
doDependenciesDiffer,
|
|
131
|
-
);
|
|
132
|
-
};
|
package/src/reanimated.ts
CHANGED
|
@@ -2,15 +2,12 @@ import type {
|
|
|
2
2
|
EventWithName,
|
|
3
3
|
FocusedInputLayoutChangedEvent,
|
|
4
4
|
FocusedInputLayoutHandlerHook,
|
|
5
|
-
FocusedInputSelectionChangedEvent,
|
|
6
|
-
FocusedInputSelectionHandlerHook,
|
|
7
|
-
FocusedInputTextChangedEvent,
|
|
8
|
-
FocusedInputTextHandlerHook,
|
|
9
5
|
KeyboardHandlerHook,
|
|
10
6
|
NativeEvent,
|
|
11
7
|
} from "./types";
|
|
12
8
|
|
|
13
9
|
const NOOP = () => () => {};
|
|
10
|
+
|
|
14
11
|
export const useAnimatedKeyboardHandler: KeyboardHandlerHook<
|
|
15
12
|
Record<string, unknown>,
|
|
16
13
|
EventWithName<NativeEvent>
|
|
@@ -19,11 +16,3 @@ export const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<
|
|
|
19
16
|
Record<string, unknown>,
|
|
20
17
|
EventWithName<FocusedInputLayoutChangedEvent>
|
|
21
18
|
> = NOOP;
|
|
22
|
-
export const useFocusedInputTextHandler: FocusedInputTextHandlerHook<
|
|
23
|
-
Record<string, unknown>,
|
|
24
|
-
EventWithName<FocusedInputTextChangedEvent>
|
|
25
|
-
> = NOOP;
|
|
26
|
-
export const useFocusedInputSelectionHandler: FocusedInputSelectionHandlerHook<
|
|
27
|
-
Record<string, unknown>,
|
|
28
|
-
EventWithName<FocusedInputSelectionChangedEvent>
|
|
29
|
-
> = NOOP;
|
|
@@ -2,12 +2,16 @@ import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNati
|
|
|
2
2
|
|
|
3
3
|
import type { HostComponent } from "react-native";
|
|
4
4
|
import type { ViewProps } from "react-native/Libraries/Components/View/ViewPropTypes";
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
Double,
|
|
7
|
+
WithDefault,
|
|
8
|
+
} from "react-native/Libraries/Types/CodegenTypes";
|
|
6
9
|
|
|
7
10
|
export interface NativeProps extends ViewProps {
|
|
8
11
|
interpolator?: WithDefault<"linear" | "ios", "linear">;
|
|
9
12
|
showOnSwipeUp?: boolean;
|
|
10
13
|
enableSwipeToDismiss?: boolean;
|
|
14
|
+
offset?: Double;
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
export default codegenNativeComponent<NativeProps>("KeyboardGestureArea", {
|
package/src/types.ts
CHANGED
|
@@ -47,6 +47,8 @@ export type EventWithName<T> = {
|
|
|
47
47
|
|
|
48
48
|
// native View/Module declarations
|
|
49
49
|
export type KeyboardControllerProps = {
|
|
50
|
+
//ref prop
|
|
51
|
+
ref?: React.Ref<React.Component<KeyboardControllerProps>>;
|
|
50
52
|
// callback props
|
|
51
53
|
onKeyboardMoveStart?: (
|
|
52
54
|
e: NativeSyntheticEvent<EventWithName<NativeEvent>>,
|
|
@@ -101,6 +103,10 @@ export type KeyboardGestureAreaProps = {
|
|
|
101
103
|
* Defaults to `true`.
|
|
102
104
|
*/
|
|
103
105
|
enableSwipeToDismiss?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Extra distance to the keyboard.
|
|
108
|
+
*/
|
|
109
|
+
offset?: number;
|
|
104
110
|
} & ViewProps;
|
|
105
111
|
|
|
106
112
|
export type Direction = "next" | "prev" | "current";
|
package/lib/commonjs/utils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|
package/lib/module/utils.js
DELETED
package/lib/module/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["uuid","Math","random","toString","slice"],"sources":["utils.ts"],"sourcesContent":["export const uuid = () => Math.random().toString(36).slice(-6);\n"],"mappings":"AAAA,OAAO,MAAMA,IAAI,GAAGA,CAAA,KAAMC,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const uuid: () => string;
|
package/src/utils.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const uuid = () => Math.random().toString(36).slice(-6);
|