react-native-keyboard-controller 1.11.3 → 1.11.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/ios/KeyboardController.xcodeproj/project.pbxproj +4 -0
- package/ios/observers/KeyboardMovementObserver.swift +1 -25
- package/ios/traversal/KeyboardView.swift +36 -0
- package/lib/commonjs/animated.js +14 -12
- package/lib/commonjs/animated.js.map +1 -1
- package/lib/commonjs/bindings.js +5 -10
- package/lib/commonjs/bindings.js.map +1 -1
- package/lib/commonjs/bindings.native.js +7 -15
- package/lib/commonjs/bindings.native.js.map +1 -1
- package/lib/commonjs/components/KeyboardAvoidingView/hooks.js.map +1 -1
- package/lib/commonjs/components/KeyboardAvoidingView/index.js +15 -17
- package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js +13 -16
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +7 -7
- package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/utils.js +3 -4
- package/lib/commonjs/components/KeyboardAwareScrollView/utils.js.map +1 -1
- package/lib/commonjs/components/KeyboardStickyView/index.js +12 -14
- package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/Arrow.js +8 -10
- package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/Button.js +23 -26
- package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/colors.js +1 -2
- package/lib/commonjs/components/KeyboardToolbar/colors.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/colors.native.js +1 -2
- package/lib/commonjs/components/KeyboardToolbar/colors.native.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/index.js +11 -13
- package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/types.js.map +1 -1
- package/lib/commonjs/components/hooks/useColorScheme.js +1 -2
- package/lib/commonjs/components/hooks/useColorScheme.js.map +1 -1
- package/lib/commonjs/components/index.js +2 -2
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/constants.js +3 -4
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/context.js +1 -2
- package/lib/commonjs/context.js.map +1 -1
- package/lib/commonjs/hooks.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal.js +1 -1
- package/lib/commonjs/internal.js.map +1 -1
- package/lib/commonjs/monkey-patch.android.js +2 -2
- package/lib/commonjs/monkey-patch.android.js.map +1 -1
- package/lib/commonjs/monkey-patch.js +2 -4
- package/lib/commonjs/monkey-patch.js.map +1 -1
- package/lib/commonjs/reanimated.js +3 -6
- package/lib/commonjs/reanimated.js.map +1 -1
- package/lib/commonjs/reanimated.native.js.map +1 -1
- package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js +1 -2
- package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js +1 -2
- package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/NativeKeyboardController.js +1 -2
- package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
- package/lib/commonjs/specs/NativeStatusBarManagerCompat.js +1 -2
- package/lib/commonjs/specs/NativeStatusBarManagerCompat.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/animated.js +12 -10
- package/lib/module/animated.js.map +1 -1
- package/lib/module/bindings.js.map +1 -1
- package/lib/module/bindings.native.js +3 -6
- package/lib/module/bindings.native.js.map +1 -1
- package/lib/module/components/KeyboardAvoidingView/hooks.js.map +1 -1
- package/lib/module/components/KeyboardAvoidingView/index.js +12 -13
- package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/index.js +10 -12
- package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +7 -7
- package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/utils.js +3 -4
- package/lib/module/components/KeyboardAwareScrollView/utils.js.map +1 -1
- package/lib/module/components/KeyboardStickyView/index.js +9 -10
- package/lib/module/components/KeyboardStickyView/index.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/Arrow.js +5 -6
- package/lib/module/components/KeyboardToolbar/Arrow.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/Button.js +20 -22
- package/lib/module/components/KeyboardToolbar/Button.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/colors.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/colors.native.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/index.js +8 -9
- package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/types.js.map +1 -1
- package/lib/module/components/hooks/useColorScheme.js.map +1 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/constants.js +3 -3
- package/lib/module/constants.js.map +1 -1
- package/lib/module/context.js.map +1 -1
- package/lib/module/hooks.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal.js +1 -1
- package/lib/module/internal.js.map +1 -1
- package/lib/module/monkey-patch.android.js.map +1 -1
- package/lib/module/monkey-patch.js.map +1 -1
- package/lib/module/reanimated.js.map +1 -1
- package/lib/module/reanimated.native.js.map +1 -1
- package/lib/module/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
- package/lib/module/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
- package/lib/module/specs/NativeKeyboardController.js.map +1 -1
- package/lib/module/specs/NativeStatusBarManagerCompat.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/animated.d.ts +1 -1
- package/lib/typescript/components/KeyboardToolbar/Button.d.ts +1 -1
- package/package.json +7 -7
- package/src/animated.tsx +7 -3
- package/src/components/KeyboardAvoidingView/index.tsx +1 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
2
|
import { Animated, StyleSheet, View } from "react-native";
|
|
3
3
|
import useColorScheme from "../hooks/useColorScheme";
|
|
4
|
-
const ArrowComponent =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} = _ref;
|
|
4
|
+
const ArrowComponent = ({
|
|
5
|
+
type,
|
|
6
|
+
disabled,
|
|
7
|
+
theme
|
|
8
|
+
}) => {
|
|
10
9
|
const colorScheme = useColorScheme();
|
|
11
10
|
const color = useMemo(() => ({
|
|
12
11
|
backgroundColor: disabled ? theme[colorScheme].disabled : theme[colorScheme].primary
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","Animated","StyleSheet","View","useColorScheme","ArrowComponent","
|
|
1
|
+
{"version":3,"names":["React","useMemo","Animated","StyleSheet","View","useColorScheme","ArrowComponent","type","disabled","theme","colorScheme","color","backgroundColor","primary","left","styles","arrowLeftLine","right","arrowRightLine","createElement","style","arrowDownContainer","arrowUpContainer","arrow","arrowLine","width","height","borderRadius","marginHorizontal","justifyContent","alignItems","create","transform","rotate","flexDirection"],"sources":["Arrow.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Animated, StyleSheet, View } from \"react-native\";\n\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { ViewStyle } from \"react-native\";\n\ntype ArrowProps = {\n type: \"prev\" | \"next\";\n disabled?: boolean;\n theme: KeyboardToolbarTheme;\n};\n\nconst ArrowComponent: React.FC<ArrowProps> = ({ type, disabled, theme }) => {\n const colorScheme = useColorScheme();\n\n const color = useMemo(\n () => ({\n backgroundColor: disabled\n ? theme[colorScheme].disabled\n : theme[colorScheme].primary,\n }),\n [disabled, theme, colorScheme],\n );\n const left = useMemo(() => [styles.arrowLeftLine, color], [color]);\n const right = useMemo(() => [styles.arrowRightLine, color], [color]);\n\n return (\n <View\n style={\n type === \"next\" ? styles.arrowDownContainer : styles.arrowUpContainer\n }\n >\n <View style={styles.arrow}>\n <Animated.View style={left} />\n <Animated.View style={right} />\n </View>\n </View>\n );\n};\n\nconst arrowLine: ViewStyle = {\n width: 13,\n height: 2,\n borderRadius: 1,\n};\nconst arrowUpContainer: ViewStyle = {\n marginHorizontal: 5,\n width: 30,\n height: 30,\n justifyContent: \"center\",\n alignItems: \"center\",\n};\nconst styles = StyleSheet.create({\n arrowUpContainer: arrowUpContainer,\n arrowDownContainer: {\n ...arrowUpContainer,\n transform: [{ rotate: \"180deg\" }],\n },\n arrow: {\n width: 20,\n height: 20,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n },\n arrowLeftLine: {\n ...arrowLine,\n transform: [{ rotate: \"-45deg\" }],\n left: -0.5,\n },\n arrowRightLine: {\n ...arrowLine,\n transform: [{ rotate: \"45deg\" }],\n left: -5.5,\n },\n});\n\nexport default ArrowComponent;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEzD,OAAOC,cAAc,MAAM,yBAAyB;AAWpD,MAAMC,cAAoC,GAAGA,CAAC;EAAEC,IAAI;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EAC1E,MAAMC,WAAW,GAAGL,cAAc,CAAC,CAAC;EAEpC,MAAMM,KAAK,GAAGV,OAAO,CACnB,OAAO;IACLW,eAAe,EAAEJ,QAAQ,GACrBC,KAAK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C;MAAEC,MAAM,EAAE;IAAS,CAAC;EAClC,CAAC;EACDV,KAAK,EAAE;IACLE,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVQ,aAAa,EAAE,KAAK;IACpBJ,UAAU,EAAE,QAAQ;IACpBD,cAAc,EAAE;EAClB,CAAC;EACDb,aAAa,EAAE;IACb,GAAGQ,SAAS;IACZQ,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC,CAAC;IACjCnB,IAAI,EAAE,CAAC;EACT,CAAC;EACDI,cAAc,EAAE;IACd,GAAGM,SAAS;IACZQ,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAQ,CAAC,CAAC;IAChCnB,IAAI,EAAE,CAAC;EACT;AACF,CAAC,CAAC;AAEF,eAAeR,cAAc","ignoreList":[]}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
2
|
import { Platform, TouchableNativeFeedback, TouchableOpacity, View } from "react-native";
|
|
3
3
|
import useColorScheme from "../hooks/useColorScheme";
|
|
4
|
-
const ButtonIOS =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} = _ref;
|
|
4
|
+
const ButtonIOS = ({
|
|
5
|
+
children,
|
|
6
|
+
onPress,
|
|
7
|
+
disabled,
|
|
8
|
+
accessibilityLabel,
|
|
9
|
+
accessibilityHint,
|
|
10
|
+
testID,
|
|
11
|
+
style
|
|
12
|
+
}) => {
|
|
14
13
|
// immediately switch to plain view to avoid animation flickering
|
|
15
14
|
// when fade out animation happens and view becomes disabled
|
|
16
15
|
const Container = disabled ? View : TouchableOpacity;
|
|
@@ -27,18 +26,17 @@ const ButtonIOS = _ref => {
|
|
|
27
26
|
testID: testID
|
|
28
27
|
}, children);
|
|
29
28
|
};
|
|
30
|
-
const ButtonAndroid =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} = _ref2;
|
|
29
|
+
const ButtonAndroid = ({
|
|
30
|
+
children,
|
|
31
|
+
onPress,
|
|
32
|
+
disabled,
|
|
33
|
+
accessibilityLabel,
|
|
34
|
+
accessibilityHint,
|
|
35
|
+
testID,
|
|
36
|
+
rippleRadius = 18,
|
|
37
|
+
style,
|
|
38
|
+
theme
|
|
39
|
+
}) => {
|
|
42
40
|
const colorScheme = useColorScheme();
|
|
43
41
|
const accessibilityState = useMemo(() => ({
|
|
44
42
|
disabled
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","Platform","TouchableNativeFeedback","TouchableOpacity","View","useColorScheme","ButtonIOS","
|
|
1
|
+
{"version":3,"names":["React","useMemo","Platform","TouchableNativeFeedback","TouchableOpacity","View","useColorScheme","ButtonIOS","children","onPress","disabled","accessibilityLabel","accessibilityHint","testID","style","Container","accessibilityState","createElement","accessibilityRole","ButtonAndroid","rippleRadius","theme","colorScheme","ripple","Ripple","background","select","android","default"],"sources":["Button.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport {\n Platform,\n TouchableNativeFeedback,\n TouchableOpacity,\n View,\n} from \"react-native\";\n\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { PropsWithChildren } from \"react\";\nimport type { ViewStyle } from \"react-native\";\n\ntype ButtonProps = {\n disabled?: boolean;\n onPress: () => void;\n accessibilityLabel: string;\n accessibilityHint: string;\n testID: string;\n rippleRadius?: number;\n style?: ViewStyle;\n theme: KeyboardToolbarTheme;\n};\n\nconst ButtonIOS = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n style,\n}: PropsWithChildren<ButtonProps>) => {\n // immediately switch to plain view to avoid animation flickering\n // when fade out animation happens and view becomes disabled\n const Container = disabled\n ? (View as unknown as typeof TouchableOpacity)\n : TouchableOpacity;\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n\n return (\n <Container\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n style={style}\n testID={testID}\n >\n {children}\n </Container>\n );\n};\nconst ButtonAndroid = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n rippleRadius = 18,\n style,\n theme,\n}: PropsWithChildren<ButtonProps>) => {\n const colorScheme = useColorScheme();\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n const ripple = useMemo(\n () =>\n TouchableNativeFeedback.Ripple(\n theme[colorScheme].ripple,\n true,\n rippleRadius,\n ),\n [colorScheme, rippleRadius, theme],\n );\n\n return (\n <TouchableNativeFeedback\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n background={ripple}\n testID={testID}\n style={style}\n >\n <View style={style}>{children}</View>\n </TouchableNativeFeedback>\n );\n};\n\nexport default Platform.select({\n android: ButtonAndroid,\n default: ButtonIOS,\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SACEC,QAAQ,EACRC,uBAAuB,EACvBC,gBAAgB,EAChBC,IAAI,QACC,cAAc;AAErB,OAAOC,cAAc,MAAM,yBAAyB;AAiBpD,MAAMC,SAAS,GAAGA,CAAC;EACjBC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,kBAAkB;EAClBC,iBAAiB;EACjBC,MAAM;EACNC;AAC8B,CAAC,KAAK;EACpC;EACA;EACA,MAAMC,SAAS,GAAGL,QAAQ,GACrBL,IAAI,GACLD,gBAAgB;EACpB,MAAMY,kBAAkB,GAAGf,OAAO,CAAC,OAAO;IAAES;EAAS,CAAC,CAAC,EAAE,CAACA,QAAQ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AAC;EAC7BC,OAAO,EAAER,aAAa;EACtBS,OAAO,EAAErB;AACX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["colors","light","primary","disabled","background","ripple","dark"],"sources":["colors.ts"],"sourcesContent":["import type { KeyboardToolbarTheme } from \"./types\";\n\nexport const colors: KeyboardToolbarTheme = {\n light: {\n primary: \"#2c2c2c\",\n disabled: \"#B0BEC5\",\n background: \"#f3f3f4\",\n ripple: \"#bcbcbcbc\",\n },\n dark: {\n primary: \"#fafafa\",\n disabled: \"#707070\",\n background: \"#2C2C2E\",\n ripple: \"#F8F8F888\",\n },\n};\n"],"mappings":"AAEA,OAAO,MAAMA,MAA4B,GAAG;EAC1CC,KAAK,EAAE;IACLC,OAAO,EAAE,SAAS;IAClBC,QAAQ,EAAE,SAAS;IACnBC,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJJ,OAAO,EAAE,SAAS;IAClBC,QAAQ,EAAE,SAAS;IACnBC,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE;EACV;AACF,CAAC"}
|
|
1
|
+
{"version":3,"names":["colors","light","primary","disabled","background","ripple","dark"],"sources":["colors.ts"],"sourcesContent":["import type { KeyboardToolbarTheme } from \"./types\";\n\nexport const colors: KeyboardToolbarTheme = {\n light: {\n primary: \"#2c2c2c\",\n disabled: \"#B0BEC5\",\n background: \"#f3f3f4\",\n ripple: \"#bcbcbcbc\",\n },\n dark: {\n primary: \"#fafafa\",\n disabled: \"#707070\",\n background: \"#2C2C2E\",\n ripple: \"#F8F8F888\",\n },\n};\n"],"mappings":"AAEA,OAAO,MAAMA,MAA4B,GAAG;EAC1CC,KAAK,EAAE;IACLC,OAAO,EAAE,SAAS;IAClBC,QAAQ,EAAE,SAAS;IACnBC,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJJ,OAAO,EAAE,SAAS;IAClBC,QAAQ,EAAE,SAAS;IACnBC,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE;EACV;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","PlatformColor","colors","light","primary","select","ios","default","disabled","background","ripple","dark"],"sources":["colors.native.ts"],"sourcesContent":["import { Platform, PlatformColor } from \"react-native\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { ColorValue } from \"react-native\";\n\nexport const colors: KeyboardToolbarTheme = {\n light: {\n primary: Platform.select<ColorValue>({\n ios: PlatformColor(\"link\"),\n default: \"#2c2c2c\",\n }),\n disabled: Platform.select<ColorValue>({\n ios: PlatformColor(\"systemGray4\"),\n default: \"#B0BEC5\",\n }),\n background: Platform.select({\n ios: \"#F8F8F8\",\n default: \"#f3f3f4\",\n }),\n ripple: \"#bcbcbcbc\",\n },\n dark: {\n primary: Platform.select<ColorValue>({\n ios: PlatformColor(\"label\"),\n default: \"#fafafa\",\n }),\n disabled: Platform.select<ColorValue>({\n ios: PlatformColor(\"systemGray\"),\n default: \"#707070\",\n }),\n background: Platform.select({\n ios: \"#555756\",\n default: \"#2C2C2E\",\n }),\n ripple: \"#F8F8F888\",\n },\n};\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,aAAa,QAAQ,cAAc;AAKtD,OAAO,MAAMC,MAA4B,GAAG;EAC1CC,KAAK,EAAE;IACLC,OAAO,EAAEJ,QAAQ,CAACK,MAAM,CAAa;MACnCC,GAAG,EAAEL,aAAa,CAAC,MAAM,CAAC;MAC1BM,OAAO,EAAE;IACX,CAAC,CAAC;IACFC,QAAQ,EAAER,QAAQ,CAACK,MAAM,CAAa;MACpCC,GAAG,EAAEL,aAAa,CAAC,aAAa,CAAC;MACjCM,OAAO,EAAE;IACX,CAAC,CAAC;IACFE,UAAU,EAAET,QAAQ,CAACK,MAAM,CAAC;MAC1BC,GAAG,EAAE,SAAS;MACdC,OAAO,EAAE;IACX,CAAC,CAAC;IACFG,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJP,OAAO,EAAEJ,QAAQ,CAACK,MAAM,CAAa;MACnCC,GAAG,EAAEL,aAAa,CAAC,OAAO,CAAC;MAC3BM,OAAO,EAAE;IACX,CAAC,CAAC;IACFC,QAAQ,EAAER,QAAQ,CAACK,MAAM,CAAa;MACpCC,GAAG,EAAEL,aAAa,CAAC,YAAY,CAAC;MAChCM,OAAO,EAAE;IACX,CAAC,CAAC;IACFE,UAAU,EAAET,QAAQ,CAACK,MAAM,CAAC;MAC1BC,GAAG,EAAE,SAAS;MACdC,OAAO,EAAE;IACX,CAAC,CAAC;IACFG,MAAM,EAAE;EACV;AACF,CAAC"}
|
|
1
|
+
{"version":3,"names":["Platform","PlatformColor","colors","light","primary","select","ios","default","disabled","background","ripple","dark"],"sources":["colors.native.ts"],"sourcesContent":["import { Platform, PlatformColor } from \"react-native\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { ColorValue } from \"react-native\";\n\nexport const colors: KeyboardToolbarTheme = {\n light: {\n primary: Platform.select<ColorValue>({\n ios: PlatformColor(\"link\"),\n default: \"#2c2c2c\",\n }),\n disabled: Platform.select<ColorValue>({\n ios: PlatformColor(\"systemGray4\"),\n default: \"#B0BEC5\",\n }),\n background: Platform.select({\n ios: \"#F8F8F8\",\n default: \"#f3f3f4\",\n }),\n ripple: \"#bcbcbcbc\",\n },\n dark: {\n primary: Platform.select<ColorValue>({\n ios: PlatformColor(\"label\"),\n default: \"#fafafa\",\n }),\n disabled: Platform.select<ColorValue>({\n ios: PlatformColor(\"systemGray\"),\n default: \"#707070\",\n }),\n background: Platform.select({\n ios: \"#555756\",\n default: \"#2C2C2E\",\n }),\n ripple: \"#F8F8F888\",\n },\n};\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,aAAa,QAAQ,cAAc;AAKtD,OAAO,MAAMC,MAA4B,GAAG;EAC1CC,KAAK,EAAE;IACLC,OAAO,EAAEJ,QAAQ,CAACK,MAAM,CAAa;MACnCC,GAAG,EAAEL,aAAa,CAAC,MAAM,CAAC;MAC1BM,OAAO,EAAE;IACX,CAAC,CAAC;IACFC,QAAQ,EAAER,QAAQ,CAACK,MAAM,CAAa;MACpCC,GAAG,EAAEL,aAAa,CAAC,aAAa,CAAC;MACjCM,OAAO,EAAE;IACX,CAAC,CAAC;IACFE,UAAU,EAAET,QAAQ,CAACK,MAAM,CAAC;MAC1BC,GAAG,EAAE,SAAS;MACdC,OAAO,EAAE;IACX,CAAC,CAAC;IACFG,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJP,OAAO,EAAEJ,QAAQ,CAACK,MAAM,CAAa;MACnCC,GAAG,EAAEL,aAAa,CAAC,OAAO,CAAC;MAC3BM,OAAO,EAAE;IACX,CAAC,CAAC;IACFC,QAAQ,EAAER,QAAQ,CAACK,MAAM,CAAa;MACpCC,GAAG,EAAEL,aAAa,CAAC,YAAY,CAAC;MAChCM,OAAO,EAAE;IACX,CAAC,CAAC;IACFE,UAAU,EAAET,QAAQ,CAACK,MAAM,CAAC;MAC1BC,GAAG,EAAE,SAAS;MACdC,OAAO,EAAE;IACX,CAAC,CAAC;IACFG,MAAM,EAAE;EACV;AACF,CAAC","ignoreList":[]}
|
|
@@ -23,15 +23,14 @@ const goToPrevField = () => KeyboardController.setFocusTo("prev");
|
|
|
23
23
|
* `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and
|
|
24
24
|
* `Done` buttons.
|
|
25
25
|
*/
|
|
26
|
-
const KeyboardToolbar =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} = _ref;
|
|
26
|
+
const KeyboardToolbar = ({
|
|
27
|
+
content,
|
|
28
|
+
theme = colors,
|
|
29
|
+
doneText,
|
|
30
|
+
button,
|
|
31
|
+
icon,
|
|
32
|
+
showArrows = true
|
|
33
|
+
}) => {
|
|
35
34
|
const colorScheme = useColorScheme();
|
|
36
35
|
const [inputs, setInputs] = useState({
|
|
37
36
|
current: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useMemo","useState","StyleSheet","Text","View","FocusedInputEvents","KeyboardStickyView","KeyboardController","useColorScheme","Arrow","Button","colors","TEST_ID_KEYBOARD_TOOLBAR","TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS","TEST_ID_KEYBOARD_TOOLBAR_NEXT","TEST_ID_KEYBOARD_TOOLBAR_CONTENT","TEST_ID_KEYBOARD_TOOLBAR_DONE","KEYBOARD_TOOLBAR_HEIGHT","offset","closed","dismissKeyboard","dismiss","goToNextField","setFocusTo","goToPrevField","KeyboardToolbar","_ref","content","theme","doneText","button","icon","showArrows","colorScheme","inputs","setInputs","current","count","isPrevDisabled","isNextDisabled","subscription","addListener","e","remove","doneStyle","styles","doneButton","color","primary","toolbarStyle","toolbar","backgroundColor","background","ButtonContainer","IconContainer","createElement","style","testID","Fragment","accessibilityLabel","accessibilityHint","disabled","onPress","type","flex","rippleRadius","doneButtonContainer","maxFontSizeMultiplier","create","position","bottom","alignItems","width","flexDirection","height","paddingHorizontal","fontWeight","fontSize","marginRight","DefaultKeyboardToolbarTheme"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\n\nimport {\n FocusedInputEvents,\n KeyboardStickyView,\n} from \"react-native-keyboard-controller\";\n\nimport { KeyboardController } from \"../../bindings\";\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport Arrow from \"./Arrow\";\nimport Button from \"./Button\";\nimport { colors } from \"./colors\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { ReactNode } from \"react\";\n\nexport type KeyboardToolbarProps = {\n /** An element that is shown in the middle of the toolbar. */\n content?: JSX.Element | null;\n /** A set of dark/light colors consumed by toolbar component. */\n theme?: KeyboardToolbarTheme;\n /** Custom text for done button. */\n doneText?: ReactNode;\n /** Custom touchable component for toolbar (used for prev/next/done buttons). */\n button?: typeof Button;\n /** Custom icon component used to display next/prev buttons. */\n icon?: typeof Arrow;\n /**\n * Whether to show next and previous buttons. Can be useful to set it to `false` if you have only one input\n * and want to show only `Done` button. Default to `true`.\n */\n showArrows?: boolean;\n};\nconst TEST_ID_KEYBOARD_TOOLBAR = \"keyboard.toolbar\";\nconst TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;\nconst TEST_ID_KEYBOARD_TOOLBAR_NEXT = `${TEST_ID_KEYBOARD_TOOLBAR}.next`;\nconst TEST_ID_KEYBOARD_TOOLBAR_CONTENT = `${TEST_ID_KEYBOARD_TOOLBAR}.content`;\nconst TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;\n\nconst KEYBOARD_TOOLBAR_HEIGHT = 42;\nconst offset = { closed: KEYBOARD_TOOLBAR_HEIGHT };\n\nconst dismissKeyboard = () => KeyboardController.dismiss();\nconst goToNextField = () => KeyboardController.setFocusTo(\"next\");\nconst goToPrevField = () => KeyboardController.setFocusTo(\"prev\");\n\n/**\n * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and\n * `Done` buttons.\n */\nconst KeyboardToolbar: React.FC<KeyboardToolbarProps> = ({\n content,\n theme = colors,\n doneText,\n button,\n icon,\n showArrows = true,\n}) => {\n const colorScheme = useColorScheme();\n const [inputs, setInputs] = useState({\n current: 0,\n count: 0,\n });\n const isPrevDisabled = inputs.current === 0;\n const isNextDisabled = inputs.current === inputs.count - 1;\n\n useEffect(() => {\n const subscription = FocusedInputEvents.addListener(\"focusDidSet\", (e) => {\n setInputs(e);\n });\n\n return subscription.remove;\n }, []);\n const doneStyle = useMemo(\n () => [styles.doneButton, { color: theme[colorScheme].primary }],\n [colorScheme, theme],\n );\n const toolbarStyle = useMemo(\n () => [\n styles.toolbar,\n {\n backgroundColor: theme[colorScheme].background,\n },\n ],\n [colorScheme, theme],\n );\n const ButtonContainer = button || Button;\n const IconContainer = icon || Arrow;\n\n return (\n <KeyboardStickyView offset={offset}>\n <View style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>\n {showArrows && (\n <>\n <ButtonContainer\n accessibilityLabel=\"Previous\"\n accessibilityHint=\"Will move focus to previous field\"\n disabled={isPrevDisabled}\n onPress={goToPrevField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS}\n theme={theme}\n >\n <IconContainer\n disabled={isPrevDisabled}\n type=\"prev\"\n theme={theme}\n />\n </ButtonContainer>\n <ButtonContainer\n accessibilityLabel=\"Next\"\n accessibilityHint=\"Will move focus to next field\"\n disabled={isNextDisabled}\n onPress={goToNextField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_NEXT}\n theme={theme}\n >\n <IconContainer\n disabled={isNextDisabled}\n type=\"next\"\n theme={theme}\n />\n </ButtonContainer>\n </>\n )}\n\n <View style={styles.flex} testID={TEST_ID_KEYBOARD_TOOLBAR_CONTENT}>\n {content}\n </View>\n <ButtonContainer\n accessibilityLabel=\"Done\"\n accessibilityHint=\"Will close the keyboard\"\n onPress={dismissKeyboard}\n testID={TEST_ID_KEYBOARD_TOOLBAR_DONE}\n rippleRadius={28}\n style={styles.doneButtonContainer}\n theme={theme}\n >\n <Text style={doneStyle} maxFontSizeMultiplier={1.3}>\n {doneText || \"Done\"}\n </Text>\n </ButtonContainer>\n </View>\n </KeyboardStickyView>\n );\n};\n\nconst styles = StyleSheet.create({\n flex: {\n flex: 1,\n },\n toolbar: {\n position: \"absolute\",\n bottom: 0,\n alignItems: \"center\",\n width: \"100%\",\n flexDirection: \"row\",\n height: KEYBOARD_TOOLBAR_HEIGHT,\n paddingHorizontal: 8,\n },\n doneButton: {\n fontWeight: \"600\",\n fontSize: 15,\n },\n doneButtonContainer: {\n marginRight: 8,\n },\n});\n\nexport { colors as DefaultKeyboardToolbarTheme };\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/BJ,IAAI,EAAE;IACJA,IAAI,EAAE;EACR,CAAC;EACDd,OAAO,EAAE;IACPmB,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,KAAK;IACpBC,MAAM,EAAEzD,uBAAuB;IAC/B0D,iBAAiB,EAAE;EACrB,CAAC;EACD7B,UAAU,EAAE;IACV8B,UAAU,EAAE,KAAK;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACDX,mBAAmB,EAAE;IACnBY,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAEF,SAASnE,MAAM,IAAIoE,2BAA2B;AAC9C,eAAetD,eAAe"}
|
|
1
|
+
{"version":3,"names":["React","useEffect","useMemo","useState","StyleSheet","Text","View","FocusedInputEvents","KeyboardStickyView","KeyboardController","useColorScheme","Arrow","Button","colors","TEST_ID_KEYBOARD_TOOLBAR","TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS","TEST_ID_KEYBOARD_TOOLBAR_NEXT","TEST_ID_KEYBOARD_TOOLBAR_CONTENT","TEST_ID_KEYBOARD_TOOLBAR_DONE","KEYBOARD_TOOLBAR_HEIGHT","offset","closed","dismissKeyboard","dismiss","goToNextField","setFocusTo","goToPrevField","KeyboardToolbar","content","theme","doneText","button","icon","showArrows","colorScheme","inputs","setInputs","current","count","isPrevDisabled","isNextDisabled","subscription","addListener","e","remove","doneStyle","styles","doneButton","color","primary","toolbarStyle","toolbar","backgroundColor","background","ButtonContainer","IconContainer","createElement","style","testID","Fragment","accessibilityLabel","accessibilityHint","disabled","onPress","type","flex","rippleRadius","doneButtonContainer","maxFontSizeMultiplier","create","position","bottom","alignItems","width","flexDirection","height","paddingHorizontal","fontWeight","fontSize","marginRight","DefaultKeyboardToolbarTheme"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\n\nimport {\n FocusedInputEvents,\n KeyboardStickyView,\n} from \"react-native-keyboard-controller\";\n\nimport { KeyboardController } from \"../../bindings\";\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport Arrow from \"./Arrow\";\nimport Button from \"./Button\";\nimport { colors } from \"./colors\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { ReactNode } from \"react\";\n\nexport type KeyboardToolbarProps = {\n /** An element that is shown in the middle of the toolbar. */\n content?: JSX.Element | null;\n /** A set of dark/light colors consumed by toolbar component. */\n theme?: KeyboardToolbarTheme;\n /** Custom text for done button. */\n doneText?: ReactNode;\n /** Custom touchable component for toolbar (used for prev/next/done buttons). */\n button?: typeof Button;\n /** Custom icon component used to display next/prev buttons. */\n icon?: typeof Arrow;\n /**\n * Whether to show next and previous buttons. Can be useful to set it to `false` if you have only one input\n * and want to show only `Done` button. Default to `true`.\n */\n showArrows?: boolean;\n};\nconst TEST_ID_KEYBOARD_TOOLBAR = \"keyboard.toolbar\";\nconst TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;\nconst TEST_ID_KEYBOARD_TOOLBAR_NEXT = `${TEST_ID_KEYBOARD_TOOLBAR}.next`;\nconst TEST_ID_KEYBOARD_TOOLBAR_CONTENT = `${TEST_ID_KEYBOARD_TOOLBAR}.content`;\nconst TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;\n\nconst KEYBOARD_TOOLBAR_HEIGHT = 42;\nconst offset = { closed: KEYBOARD_TOOLBAR_HEIGHT };\n\nconst dismissKeyboard = () => KeyboardController.dismiss();\nconst goToNextField = () => KeyboardController.setFocusTo(\"next\");\nconst goToPrevField = () => KeyboardController.setFocusTo(\"prev\");\n\n/**\n * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and\n * `Done` buttons.\n */\nconst KeyboardToolbar: React.FC<KeyboardToolbarProps> = ({\n content,\n theme = colors,\n doneText,\n button,\n icon,\n showArrows = true,\n}) => {\n const colorScheme = useColorScheme();\n const [inputs, setInputs] = useState({\n current: 0,\n count: 0,\n });\n const isPrevDisabled = inputs.current === 0;\n const isNextDisabled = inputs.current === inputs.count - 1;\n\n useEffect(() => {\n const subscription = FocusedInputEvents.addListener(\"focusDidSet\", (e) => {\n setInputs(e);\n });\n\n return subscription.remove;\n }, []);\n const doneStyle = useMemo(\n () => [styles.doneButton, { color: theme[colorScheme].primary }],\n [colorScheme, theme],\n );\n const toolbarStyle = useMemo(\n () => [\n styles.toolbar,\n {\n backgroundColor: theme[colorScheme].background,\n },\n ],\n [colorScheme, theme],\n );\n const ButtonContainer = button || Button;\n const IconContainer = icon || Arrow;\n\n return (\n <KeyboardStickyView offset={offset}>\n <View style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>\n {showArrows && (\n <>\n <ButtonContainer\n accessibilityLabel=\"Previous\"\n accessibilityHint=\"Will move focus to previous field\"\n disabled={isPrevDisabled}\n onPress={goToPrevField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS}\n theme={theme}\n >\n <IconContainer\n disabled={isPrevDisabled}\n type=\"prev\"\n theme={theme}\n />\n </ButtonContainer>\n <ButtonContainer\n accessibilityLabel=\"Next\"\n accessibilityHint=\"Will move focus to next field\"\n disabled={isNextDisabled}\n onPress={goToNextField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_NEXT}\n theme={theme}\n >\n <IconContainer\n disabled={isNextDisabled}\n type=\"next\"\n theme={theme}\n />\n </ButtonContainer>\n </>\n )}\n\n <View style={styles.flex} testID={TEST_ID_KEYBOARD_TOOLBAR_CONTENT}>\n {content}\n </View>\n <ButtonContainer\n accessibilityLabel=\"Done\"\n accessibilityHint=\"Will close the keyboard\"\n onPress={dismissKeyboard}\n testID={TEST_ID_KEYBOARD_TOOLBAR_DONE}\n rippleRadius={28}\n style={styles.doneButtonContainer}\n theme={theme}\n >\n <Text style={doneStyle} maxFontSizeMultiplier={1.3}>\n {doneText || \"Done\"}\n </Text>\n </ButtonContainer>\n </View>\n </KeyboardStickyView>\n );\n};\n\nconst styles = StyleSheet.create({\n flex: {\n flex: 1,\n },\n toolbar: {\n position: \"absolute\",\n bottom: 0,\n alignItems: \"center\",\n width: \"100%\",\n flexDirection: \"row\",\n height: KEYBOARD_TOOLBAR_HEIGHT,\n paddingHorizontal: 8,\n },\n doneButton: {\n fontWeight: \"600\",\n fontSize: 15,\n },\n doneButtonContainer: {\n marginRight: 8,\n },\n});\n\nexport { colors as DefaultKeyboardToolbarTheme };\nexport default KeyboardToolbar;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC3D,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAErD,SACEC,kBAAkB,EAClBC,kBAAkB,QACb,kCAAkC;AAEzC,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,OAAOC,cAAc,MAAM,yBAAyB;AAEpD,OAAOC,KAAK,MAAM,SAAS;AAC3B,OAAOC,MAAM,MAAM,UAAU;AAC7B,SAASC,MAAM,QAAQ,UAAU;AAsBjC,MAAMC,wBAAwB,GAAG,kBAAkB;AACnD,MAAMC,iCAAiC,GAAI,GAAED,wBAAyB,WAAU;AAChF,MAAME,6BAA6B,GAAI,GAAEF,wBAAyB,OAAM;AACxE,MAAMG,gCAAgC,GAAI,GAAEH,wBAAyB,UAAS;AAC9E,MAAMI,6BAA6B,GAAI,GAAEJ,wBAAyB,OAAM;AAExE,MAAMK,uBAAuB,GAAG,EAAE;AAClC,MAAMC,MAAM,GAAG;EAAEC,MAAM,EAAEF;AAAwB,CAAC;AAElD,MAAMG,eAAe,GAAGA,CAAA,KAAMb,kBAAkB,CAACc,OAAO,CAAC,CAAC;AAC1D,MAAMC,aAAa,GAAGA,CAAA,KAAMf,kBAAkB,CAACgB,UAAU,CAAC,MAAM,CAAC;AACjE,MAAMC,aAAa,GAAGA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AA8B;IACtCgD,YAAY,EAAE,EAAG;IACjBT,KAAK,EAAEX,MAAM,CAACqB,mBAAoB;IAClCtC,KAAK,EAAEA;EAAM,gBAEb7B,KAAA,CAAAwD,aAAA,CAACnD,IAAI;IAACoD,KAAK,EAAEZ,SAAU;IAACuB,qBAAqB,EAAE;EAAI,GAChDtC,QAAQ,IAAI,MACT,CACS,CACb,CACY,CAAC;AAEzB,CAAC;AAED,MAAMgB,MAAM,GAAG1C,UAAU,CAACiE,MAAM,CAAC;EAC/BJ,IAAI,EAAE;IACJA,IAAI,EAAE;EACR,CAAC;EACDd,OAAO,EAAE;IACPmB,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,KAAK;IACpBC,MAAM,EAAExD,uBAAuB;IAC/ByD,iBAAiB,EAAE;EACrB,CAAC;EACD7B,UAAU,EAAE;IACV8B,UAAU,EAAE,KAAK;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACDX,mBAAmB,EAAE;IACnBY,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAEF,SAASlE,MAAM,IAAImE,2BAA2B;AAC9C,eAAerD,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { ColorValue } from \"react-native\";\n\ntype Theme = {\n /** Color for arrow when it's enabled */\n primary: ColorValue;\n /** Color for arrow when it's disabled */\n disabled: ColorValue;\n /** Keyboard toolbar background color */\n background: ColorValue;\n /** Color for ripple effect (on button touch) on Android */\n ripple: ColorValue;\n};\nexport type KeyboardToolbarTheme = {\n light: Theme;\n dark: Theme;\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { ColorValue } from \"react-native\";\n\ntype Theme = {\n /** Color for arrow when it's enabled */\n primary: ColorValue;\n /** Color for arrow when it's disabled */\n disabled: ColorValue;\n /** Keyboard toolbar background color */\n background: ColorValue;\n /** Color for ripple effect (on button touch) on Android */\n ripple: ColorValue;\n};\nexport type KeyboardToolbarTheme = {\n light: Theme;\n dark: Theme;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useColorScheme","useColorSchemeRN"],"sources":["useColorScheme.ts"],"sourcesContent":["import { useColorScheme as useColorSchemeRN } from \"react-native\";\n\nconst useColorScheme = () => useColorSchemeRN() || \"light\";\n\nexport default useColorScheme;\n"],"mappings":"AAAA,SAASA,cAAc,IAAIC,gBAAgB,QAAQ,cAAc;AAEjE,MAAMD,cAAc,GAAGA,CAAA,KAAMC,gBAAgB,CAAC,CAAC,IAAI,OAAO;AAE1D,eAAeD,cAAc"}
|
|
1
|
+
{"version":3,"names":["useColorScheme","useColorSchemeRN"],"sources":["useColorScheme.ts"],"sourcesContent":["import { useColorScheme as useColorSchemeRN } from \"react-native\";\n\nconst useColorScheme = () => useColorSchemeRN() || \"light\";\n\nexport default useColorScheme;\n"],"mappings":"AAAA,SAASA,cAAc,IAAIC,gBAAgB,QAAQ,cAAc;AAEjE,MAAMD,cAAc,GAAGA,CAAA,KAAMC,gBAAgB,CAAC,CAAC,IAAI,OAAO;AAE1D,eAAeD,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","KeyboardAvoidingView","KeyboardStickyView","KeyboardAwareScrollView","KeyboardToolbar","DefaultKeyboardToolbarTheme"],"sources":["index.ts"],"sourcesContent":["export { default as KeyboardAvoidingView } from \"./KeyboardAvoidingView\";\nexport { default as KeyboardStickyView } from \"./KeyboardStickyView\";\nexport { default as KeyboardAwareScrollView } from \"./KeyboardAwareScrollView\";\nexport {\n default as KeyboardToolbar,\n DefaultKeyboardToolbarTheme,\n} from \"./KeyboardToolbar\";\nexport type { KeyboardToolbarProps } from \"./KeyboardToolbar\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,oBAAoB,QAAQ,wBAAwB;AACxE,SAASD,OAAO,IAAIE,kBAAkB,QAAQ,sBAAsB;AACpE,SAASF,OAAO,IAAIG,uBAAuB,QAAQ,2BAA2B;AAC9E,SACEH,OAAO,IAAII,eAAe,EAC1BC,2BAA2B,QACtB,mBAAmB"}
|
|
1
|
+
{"version":3,"names":["default","KeyboardAvoidingView","KeyboardStickyView","KeyboardAwareScrollView","KeyboardToolbar","DefaultKeyboardToolbarTheme"],"sources":["index.ts"],"sourcesContent":["export { default as KeyboardAvoidingView } from \"./KeyboardAvoidingView\";\nexport { default as KeyboardStickyView } from \"./KeyboardStickyView\";\nexport { default as KeyboardAwareScrollView } from \"./KeyboardAwareScrollView\";\nexport {\n default as KeyboardToolbar,\n DefaultKeyboardToolbarTheme,\n} from \"./KeyboardToolbar\";\nexport type { KeyboardToolbarProps } from \"./KeyboardToolbar\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,oBAAoB,QAAQ,wBAAwB;AACxE,SAASD,OAAO,IAAIE,kBAAkB,QAAQ,sBAAsB;AACpE,SAASF,OAAO,IAAIG,uBAAuB,QAAQ,2BAA2B;AAC9E,SACEH,OAAO,IAAII,eAAe,EAC1BC,2BAA2B,QACtB,mBAAmB","ignoreList":[]}
|
package/lib/module/constants.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// copied from `android.view.WindowManager.LayoutParams`
|
|
2
|
-
export let AndroidSoftInputModes
|
|
3
|
-
(function (AndroidSoftInputModes) {
|
|
2
|
+
export let AndroidSoftInputModes = /*#__PURE__*/function (AndroidSoftInputModes) {
|
|
4
3
|
AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_ADJUST_NOTHING"] = 48] = "SOFT_INPUT_ADJUST_NOTHING";
|
|
5
4
|
AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_ADJUST_PAN"] = 32] = "SOFT_INPUT_ADJUST_PAN";
|
|
6
5
|
AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_ADJUST_RESIZE"] = 16] = "SOFT_INPUT_ADJUST_RESIZE";
|
|
@@ -15,5 +14,6 @@ export let AndroidSoftInputModes;
|
|
|
15
14
|
AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_STATE_UNCHANGED"] = 1] = "SOFT_INPUT_STATE_UNCHANGED";
|
|
16
15
|
AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_STATE_UNSPECIFIED"] = 0] = "SOFT_INPUT_STATE_UNSPECIFIED";
|
|
17
16
|
AndroidSoftInputModes[AndroidSoftInputModes["SOFT_INPUT_STATE_VISIBLE"] = 4] = "SOFT_INPUT_STATE_VISIBLE";
|
|
18
|
-
|
|
17
|
+
return AndroidSoftInputModes;
|
|
18
|
+
}({});
|
|
19
19
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AndroidSoftInputModes"],"sources":["constants.ts"],"sourcesContent":["// copied from `android.view.WindowManager.LayoutParams`\nexport enum AndroidSoftInputModes {\n SOFT_INPUT_ADJUST_NOTHING = 48,\n SOFT_INPUT_ADJUST_PAN = 32,\n SOFT_INPUT_ADJUST_RESIZE = 16,\n SOFT_INPUT_ADJUST_UNSPECIFIED = 0,\n SOFT_INPUT_IS_FORWARD_NAVIGATION = 256,\n SOFT_INPUT_MASK_ADJUST = 240,\n SOFT_INPUT_MASK_STATE = 15,\n SOFT_INPUT_MODE_CHANGED = 512,\n SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3,\n SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5,\n SOFT_INPUT_STATE_HIDDEN = 2,\n SOFT_INPUT_STATE_UNCHANGED = 1,\n // temporarily disable this rule to avoid breaking changes.\n // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values\n SOFT_INPUT_STATE_UNSPECIFIED = 0,\n SOFT_INPUT_STATE_VISIBLE = 4,\n}\n"],"mappings":"AAAA;AACA,WAAYA,qBAAqB
|
|
1
|
+
{"version":3,"names":["AndroidSoftInputModes"],"sources":["constants.ts"],"sourcesContent":["// copied from `android.view.WindowManager.LayoutParams`\nexport enum AndroidSoftInputModes {\n SOFT_INPUT_ADJUST_NOTHING = 48,\n SOFT_INPUT_ADJUST_PAN = 32,\n SOFT_INPUT_ADJUST_RESIZE = 16,\n SOFT_INPUT_ADJUST_UNSPECIFIED = 0,\n SOFT_INPUT_IS_FORWARD_NAVIGATION = 256,\n SOFT_INPUT_MASK_ADJUST = 240,\n SOFT_INPUT_MASK_STATE = 15,\n SOFT_INPUT_MODE_CHANGED = 512,\n SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3,\n SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5,\n SOFT_INPUT_STATE_HIDDEN = 2,\n SOFT_INPUT_STATE_UNCHANGED = 1,\n // temporarily disable this rule to avoid breaking changes.\n // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values\n SOFT_INPUT_STATE_UNSPECIFIED = 0,\n SOFT_INPUT_STATE_VISIBLE = 4,\n}\n"],"mappings":"AAAA;AACA,WAAYA,qBAAqB,0BAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","useContext","Animated","NOOP","withSharedValue","value","addListener","removeListener","modify","DEFAULT_SHARED_VALUE","DEFAULT_LAYOUT","defaultContext","enabled","animated","progress","Value","height","reanimated","layout","setKeyboardHandlers","setInputHandlers","setEnabled","KeyboardContext","useKeyboardContext","context","__DEV__","console","warn"],"sources":["context.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport { Animated } from \"react-native\";\n\nimport type {\n FocusedInputHandlers,\n FocusedInputLayoutChangedEvent,\n KeyboardHandlers,\n} from \"./types\";\nimport type React from \"react\";\nimport type { SharedValue } from \"react-native-reanimated\";\n\nexport type AnimatedContext = {\n progress: Animated.Value;\n height: Animated.AnimatedMultiplication<number>;\n};\nexport type ReanimatedContext = {\n progress: SharedValue<number>;\n height: SharedValue<number>;\n};\nexport type KeyboardAnimationContext = {\n enabled: boolean;\n animated: AnimatedContext;\n reanimated: ReanimatedContext;\n layout: SharedValue<FocusedInputLayoutChangedEvent | null>;\n setKeyboardHandlers: (handlers: KeyboardHandlers) => void;\n setInputHandlers: (handlers: FocusedInputHandlers) => void;\n setEnabled: React.Dispatch<React.SetStateAction<boolean>>;\n};\nconst NOOP = () => {};\nconst withSharedValue = <T>(value: T): SharedValue<T> => ({\n value,\n addListener: NOOP,\n removeListener: NOOP,\n modify: NOOP,\n});\nconst DEFAULT_SHARED_VALUE = withSharedValue(0);\nconst DEFAULT_LAYOUT = withSharedValue<FocusedInputLayoutChangedEvent | null>(\n null,\n);\nconst defaultContext: KeyboardAnimationContext = {\n enabled: true,\n animated: {\n progress: new Animated.Value(0),\n height: new Animated.Value(0),\n },\n reanimated: {\n progress: DEFAULT_SHARED_VALUE,\n height: DEFAULT_SHARED_VALUE,\n },\n layout: DEFAULT_LAYOUT,\n setKeyboardHandlers: NOOP,\n setInputHandlers: NOOP,\n setEnabled: NOOP,\n};\nexport const KeyboardContext = createContext(defaultContext);\nexport const useKeyboardContext = () => {\n const context = useContext(KeyboardContext);\n\n if (__DEV__ && context === defaultContext) {\n console.warn(\n \"Couldn't find real values for `KeyboardContext`. Please make sure you're inside of `KeyboardProvider` - otherwise functionality of `react-native-keyboard-controller` will not work.\",\n );\n }\n\n return context;\n};\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,UAAU,QAAQ,OAAO;AACjD,SAASC,QAAQ,QAAQ,cAAc;AA2BvC,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,MAAMC,eAAe,GAAOC,KAAQ,KAAsB;EACxDA,KAAK;EACLC,WAAW,EAAEH,IAAI;EACjBI,cAAc,EAAEJ,IAAI;EACpBK,MAAM,EAAEL;AACV,CAAC,CAAC;AACF,MAAMM,oBAAoB,GAAGL,eAAe,CAAC,CAAC,CAAC;AAC/C,MAAMM,cAAc,GAAGN,eAAe,CACpC,IACF,CAAC;AACD,MAAMO,cAAwC,GAAG;EAC/CC,OAAO,EAAE,IAAI;EACbC,QAAQ,EAAE;IACRC,QAAQ,EAAE,IAAIZ,QAAQ,CAACa,KAAK,CAAC,CAAC,CAAC;IAC/BC,MAAM,EAAE,IAAId,QAAQ,CAACa,KAAK,CAAC,CAAC;EAC9B,CAAC;EACDE,UAAU,EAAE;IACVH,QAAQ,EAAEL,oBAAoB;IAC9BO,MAAM,EAAEP;EACV,CAAC;EACDS,MAAM,EAAER,cAAc;EACtBS,mBAAmB,EAAEhB,IAAI;EACzBiB,gBAAgB,EAAEjB,IAAI;EACtBkB,UAAU,EAAElB;AACd,CAAC;AACD,OAAO,MAAMmB,eAAe,gBAAGtB,aAAa,CAACW,cAAc,CAAC;AAC5D,OAAO,MAAMY,kBAAkB,GAAGA,CAAA,KAAM;EACtC,MAAMC,OAAO,GAAGvB,UAAU,CAACqB,eAAe,CAAC;EAE3C,IAAIG,OAAO,IAAID,OAAO,KAAKb,cAAc,EAAE;IACzCe,OAAO,CAACC,IAAI,CACV,sLACF,CAAC;EACH;EAEA,OAAOH,OAAO;AAChB,CAAC"}
|
|
1
|
+
{"version":3,"names":["createContext","useContext","Animated","NOOP","withSharedValue","value","addListener","removeListener","modify","DEFAULT_SHARED_VALUE","DEFAULT_LAYOUT","defaultContext","enabled","animated","progress","Value","height","reanimated","layout","setKeyboardHandlers","setInputHandlers","setEnabled","KeyboardContext","useKeyboardContext","context","__DEV__","console","warn"],"sources":["context.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport { Animated } from \"react-native\";\n\nimport type {\n FocusedInputHandlers,\n FocusedInputLayoutChangedEvent,\n KeyboardHandlers,\n} from \"./types\";\nimport type React from \"react\";\nimport type { SharedValue } from \"react-native-reanimated\";\n\nexport type AnimatedContext = {\n progress: Animated.Value;\n height: Animated.AnimatedMultiplication<number>;\n};\nexport type ReanimatedContext = {\n progress: SharedValue<number>;\n height: SharedValue<number>;\n};\nexport type KeyboardAnimationContext = {\n enabled: boolean;\n animated: AnimatedContext;\n reanimated: ReanimatedContext;\n layout: SharedValue<FocusedInputLayoutChangedEvent | null>;\n setKeyboardHandlers: (handlers: KeyboardHandlers) => void;\n setInputHandlers: (handlers: FocusedInputHandlers) => void;\n setEnabled: React.Dispatch<React.SetStateAction<boolean>>;\n};\nconst NOOP = () => {};\nconst withSharedValue = <T>(value: T): SharedValue<T> => ({\n value,\n addListener: NOOP,\n removeListener: NOOP,\n modify: NOOP,\n});\nconst DEFAULT_SHARED_VALUE = withSharedValue(0);\nconst DEFAULT_LAYOUT = withSharedValue<FocusedInputLayoutChangedEvent | null>(\n null,\n);\nconst defaultContext: KeyboardAnimationContext = {\n enabled: true,\n animated: {\n progress: new Animated.Value(0),\n height: new Animated.Value(0),\n },\n reanimated: {\n progress: DEFAULT_SHARED_VALUE,\n height: DEFAULT_SHARED_VALUE,\n },\n layout: DEFAULT_LAYOUT,\n setKeyboardHandlers: NOOP,\n setInputHandlers: NOOP,\n setEnabled: NOOP,\n};\nexport const KeyboardContext = createContext(defaultContext);\nexport const useKeyboardContext = () => {\n const context = useContext(KeyboardContext);\n\n if (__DEV__ && context === defaultContext) {\n console.warn(\n \"Couldn't find real values for `KeyboardContext`. Please make sure you're inside of `KeyboardProvider` - otherwise functionality of `react-native-keyboard-controller` will not work.\",\n );\n }\n\n return context;\n};\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,UAAU,QAAQ,OAAO;AACjD,SAASC,QAAQ,QAAQ,cAAc;AA2BvC,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,MAAMC,eAAe,GAAOC,KAAQ,KAAsB;EACxDA,KAAK;EACLC,WAAW,EAAEH,IAAI;EACjBI,cAAc,EAAEJ,IAAI;EACpBK,MAAM,EAAEL;AACV,CAAC,CAAC;AACF,MAAMM,oBAAoB,GAAGL,eAAe,CAAC,CAAC,CAAC;AAC/C,MAAMM,cAAc,GAAGN,eAAe,CACpC,IACF,CAAC;AACD,MAAMO,cAAwC,GAAG;EAC/CC,OAAO,EAAE,IAAI;EACbC,QAAQ,EAAE;IACRC,QAAQ,EAAE,IAAIZ,QAAQ,CAACa,KAAK,CAAC,CAAC,CAAC;IAC/BC,MAAM,EAAE,IAAId,QAAQ,CAACa,KAAK,CAAC,CAAC;EAC9B,CAAC;EACDE,UAAU,EAAE;IACVH,QAAQ,EAAEL,oBAAoB;IAC9BO,MAAM,EAAEP;EACV,CAAC;EACDS,MAAM,EAAER,cAAc;EACtBS,mBAAmB,EAAEhB,IAAI;EACzBiB,gBAAgB,EAAEjB,IAAI;EACtBkB,UAAU,EAAElB;AACd,CAAC;AACD,OAAO,MAAMmB,eAAe,gBAAGtB,aAAa,CAACW,cAAc,CAAC;AAC5D,OAAO,MAAMY,kBAAkB,GAAGA,CAAA,KAAM;EACtC,MAAMC,OAAO,GAAGvB,UAAU,CAACqB,eAAe,CAAC;EAE3C,IAAIG,OAAO,IAAID,OAAO,KAAKb,cAAc,EAAE;IACzCe,OAAO,CAACC,IAAI,CACV,sLACF,CAAC;EACH;EAEA,OAAOH,OAAO;AAChB,CAAC","ignoreList":[]}
|
package/lib/module/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","KeyboardController","AndroidSoftInputModes","useKeyboardContext","uuid","useResizeMode","setInputMode","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode","useKeyboardAnimation","context","animated","useReanimatedKeyboardAnimation","reanimated","useGenericKeyboardHandler","handler","deps","key","setKeyboardHandlers","undefined","useKeyboardHandler","useKeyboardController","setEnabled","enabled","useReanimatedFocusedInput","input","layout","useFocusedInputHandler","setInputHandlers"],"sources":["hooks.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport { KeyboardController } from \"./bindings\";\nimport { AndroidSoftInputModes } from \"./constants\";\nimport { useKeyboardContext } from \"./context\";\nimport { uuid } from \"./utils\";\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 useEffect(() => {\n const key = uuid();\n\n context.setKeyboardHandlers({ [key]: handler });\n\n return () => {\n context.setKeyboardHandlers({ [key]: undefined });\n };\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 useEffect(() => {\n const key = uuid();\n\n context.setInputHandlers({ [key]: handler });\n\n return () => {\n context.setInputHandlers({ [key]: undefined });\n };\n }, deps);\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SAASC,kBAAkB,QAAQ,YAAY;AAC/C,SAASC,qBAAqB,QAAQ,aAAa;AACnD,SAASC,kBAAkB,QAAQ,WAAW;AAC9C,SAASC,IAAI,QAAQ,SAAS;AAM9B,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;EAEpCH,SAAS,CAAC,MAAM;IACd,MAAMiB,GAAG,GAAGb,IAAI,CAAC,CAAC;IAElBM,OAAO,CAACQ,mBAAmB,CAAC;MAAE,CAACD,GAAG,GAAGF;IAAQ,CAAC,CAAC;IAE/C,OAAO,MAAM;MACXL,OAAO,CAACQ,mBAAmB,CAAC;QAAE,CAACD,GAAG,GAAGE;MAAU,CAAC,CAAC;IACnD,CAAC;EACH,CAAC,EAAEH,IAAI,CAAC;AACV;AAEA,OAAO,SAASI,kBAAkBA,CAChCL,OAAwB,EACxBC,IAAqB,EACrB;EACAX,aAAa,CAAC,CAAC;EACfS,yBAAyB,CAACC,OAAO,EAAEC,IAAI,CAAC;AAC1C;AAEA,OAAO,SAASK,qBAAqBA,CAAA,EAAG;EACtC,MAAMX,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpC,OAAO;IAAEmB,UAAU,EAAEZ,OAAO,CAACY,UAAU;IAAEC,OAAO,EAAEb,OAAO,CAACa;EAAQ,CAAC;AACrE;AAEA,OAAO,SAASC,yBAAyBA,CAAA,EAAG;EAC1C,MAAMd,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpC,OAAO;IAAEsB,KAAK,EAAEf,OAAO,CAACgB;EAAO,CAAC;AAClC;AAEA,OAAO,SAASC,sBAAsBA,CACpCZ,OAA6B,EAC7BC,IAAqB,EACrB;EACA,MAAMN,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpCH,SAAS,CAAC,MAAM;IACd,MAAMiB,GAAG,GAAGb,IAAI,CAAC,CAAC;IAElBM,OAAO,CAACkB,gBAAgB,CAAC;MAAE,CAACX,GAAG,GAAGF;IAAQ,CAAC,CAAC;IAE5C,OAAO,MAAM;MACXL,OAAO,CAACkB,gBAAgB,CAAC;QAAE,CAACX,GAAG,GAAGE;MAAU,CAAC,CAAC;IAChD,CAAC;EACH,CAAC,EAAEH,IAAI,CAAC;AACV"}
|
|
1
|
+
{"version":3,"names":["useEffect","KeyboardController","AndroidSoftInputModes","useKeyboardContext","uuid","useResizeMode","setInputMode","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode","useKeyboardAnimation","context","animated","useReanimatedKeyboardAnimation","reanimated","useGenericKeyboardHandler","handler","deps","key","setKeyboardHandlers","undefined","useKeyboardHandler","useKeyboardController","setEnabled","enabled","useReanimatedFocusedInput","input","layout","useFocusedInputHandler","setInputHandlers"],"sources":["hooks.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport { KeyboardController } from \"./bindings\";\nimport { AndroidSoftInputModes } from \"./constants\";\nimport { useKeyboardContext } from \"./context\";\nimport { uuid } from \"./utils\";\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 useEffect(() => {\n const key = uuid();\n\n context.setKeyboardHandlers({ [key]: handler });\n\n return () => {\n context.setKeyboardHandlers({ [key]: undefined });\n };\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 useEffect(() => {\n const key = uuid();\n\n context.setInputHandlers({ [key]: handler });\n\n return () => {\n context.setInputHandlers({ [key]: undefined });\n };\n }, deps);\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ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AAC1C;AAEA,OAAO,SAASK,qBAAqBA,CAAA,EAAG;EACtC,MAAMX,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpC,OAAO;IAAEmB,UAAU,EAAEZ,OAAO,CAACY,UAAU;IAAEC,OAAO,EAAEb,OAAO,CAACa;EAAQ,CAAC;AACrE;AAEA,OAAO,SAASC,yBAAyBA,CAAA,EAAG;EAC1C,MAAMd,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpC,OAAO;IAAEsB,KAAK,EAAEf,OAAO,CAACgB;EAAO,CAAC;AAClC;AAEA,OAAO,SAASC,sBAAsBA,CACpCZ,OAA6B,EAC7BC,IAAqB,EACrB;EACA,MAAMN,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpCH,SAAS,CAAC,MAAM;IACd,MAAMiB,GAAG,GAAGb,IAAI,CAAC,CAAC;IAElBM,OAAO,CAACkB,gBAAgB,CAAC;MAAE,CAACX,GAAG,GAAGF;IAAQ,CAAC,CAAC;IAE5C,OAAO,MAAM;MACXL,OAAO,CAACkB,gBAAgB,CAAC;QAAE,CAACX,GAAG,GAAGE;MAAU,CAAC,CAAC;IAChD,CAAC;EACH,CAAC,EAAEH,IAAI,CAAC;AACV","ignoreList":[]}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["KeyboardAvoidingView","KeyboardStickyView","KeyboardAwareScrollView","KeyboardToolbar","DefaultKeyboardToolbarTheme"],"sources":["index.ts"],"sourcesContent":["export * from \"./bindings\";\nexport * from \"./animated\";\nexport * from \"./context\";\nexport * from \"./hooks\";\nexport * from \"./constants\";\nexport * from \"./types\";\n\nexport {\n KeyboardAvoidingView,\n KeyboardStickyView,\n KeyboardAwareScrollView,\n // keyboard toolbar\n KeyboardToolbar,\n DefaultKeyboardToolbarTheme,\n} from \"./components\";\nexport type { KeyboardToolbarProps } from \"./components\";\n"],"mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,YAAY;AAC1B,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,aAAa;AAC3B,cAAc,SAAS;AAEvB,SACEA,oBAAoB,EACpBC,kBAAkB,EAClBC,uBAAuB;AACvB;AACAC,eAAe,EACfC,2BAA2B,QACtB,cAAc"}
|
|
1
|
+
{"version":3,"names":["KeyboardAvoidingView","KeyboardStickyView","KeyboardAwareScrollView","KeyboardToolbar","DefaultKeyboardToolbarTheme"],"sources":["index.ts"],"sourcesContent":["export * from \"./bindings\";\nexport * from \"./animated\";\nexport * from \"./context\";\nexport * from \"./hooks\";\nexport * from \"./constants\";\nexport * from \"./types\";\n\nexport {\n KeyboardAvoidingView,\n KeyboardStickyView,\n KeyboardAwareScrollView,\n // keyboard toolbar\n KeyboardToolbar,\n DefaultKeyboardToolbarTheme,\n} from \"./components\";\nexport type { KeyboardToolbarProps } from \"./components\";\n"],"mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,YAAY;AAC1B,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,aAAa;AAC3B,cAAc,SAAS;AAEvB,SACEA,oBAAoB,EACpBC,kBAAkB,EAClBC,uBAAuB;AACvB;AACAC,eAAe,EACfC,2BAA2B,QACtB,cAAc","ignoreList":[]}
|
package/lib/module/internal.js
CHANGED
|
@@ -40,7 +40,7 @@ export function useSharedHandlers() {
|
|
|
40
40
|
|
|
41
41
|
Object.keys(handlers.value).forEach(key => {
|
|
42
42
|
var _handlers$value$key, _handlers$value$key$t;
|
|
43
|
-
(_handlers$value$key = handlers.value[key]) === null || _handlers$value$key === void 0
|
|
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);
|
|
44
44
|
});
|
|
45
45
|
};
|
|
46
46
|
return [setHandlers, broadcast];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useRef","Animated","useSharedValue","useSharedHandlers","handlers","jsHandlers","updateSharedHandlers","value","current","setHandlers","handler","broadcast","type","event","Object","keys","forEach","key","_handlers$value$key","_handlers$value$key$t","call","useAnimatedValue","initialValue","config","ref","Value"],"sources":["internal.ts"],"sourcesContent":["import { useCallback, useRef } from \"react\";\nimport { Animated } from \"react-native\";\nimport { useSharedValue } from \"react-native-reanimated\";\n\nimport type { Handlers } from \"./types\";\n\ntype UntypedHandler = Record<string, (event: never) => void>;\ntype SharedHandlersReturnType<T extends UntypedHandler> = [\n (handler: Handlers<T>) => void,\n <K extends keyof T>(type: K, event: Parameters<T[K]>[0]) => void,\n];\n\n/**\n * Hook for storing worklet handlers (objects with keys, where values are worklets).\n * Returns methods for setting handlers and broadcasting events in them.\n *\n * T is a generic that looks like:\n * @example\n * {\n * onEvent: () => {},\n * onEvent2: () => {},\n * }\n */\nexport function useSharedHandlers<\n T extends UntypedHandler,\n>(): SharedHandlersReturnType<T> {\n const handlers = useSharedValue<Handlers<T>>({});\n const jsHandlers = useRef<Handlers<T>>({});\n\n // since js -> worklet -> js call is asynchronous, we can not write handlers\n // straight into shared variable (using current shared value as a previous result),\n // since there may be a race condition in a call, and closure may have out-of-dated\n // values. As a result, some of handlers may be not written to \"all handlers\" object.\n // Below we are writing all handlers to `ref` and afterwards synchronize them with\n // shared value (since `refs` are not referring to actual value in worklets).\n // This approach allow us to update synchronously handlers in js thread (and it assures,\n // that it will have all of them) and then update them in worklet thread (calls are\n // happening in FIFO order, so we will always have actual value).\n const updateSharedHandlers = () => {\n handlers.value = jsHandlers.current;\n };\n const setHandlers = useCallback((handler: Handlers<T>) => {\n jsHandlers.current = {\n ...jsHandlers.current,\n ...handler,\n };\n updateSharedHandlers();\n }, []);\n const broadcast = <K extends keyof T>(\n type: K,\n event: Parameters<T[K]>[0],\n ) => {\n \"worklet\";\n\n Object.keys(handlers.value).forEach((key) => {\n handlers.value[key]?.[type]?.(event);\n });\n };\n\n return [setHandlers, broadcast];\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,WAAW,EAAEC,MAAM,QAAQ,OAAO;AAC3C,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,cAAc,QAAQ,yBAAyB;AAUxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAA,EAEA;EAC/B,MAAMC,QAAQ,GAAGF,cAAc,CAAc,CAAC,CAAC,CAAC;EAChD,MAAMG,UAAU,GAAGL,MAAM,CAAc,CAAC,CAAC,CAAC;;EAE1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMM,oBAAoB,GAAGA,CAAA,KAAM;IACjCF,QAAQ,CAACG,KAAK,GAAGF,UAAU,CAACG,OAAO;EACrC,CAAC;EACD,MAAMC,WAAW,GAAGV,WAAW,CAAEW,OAAoB,IAAK;IACxDL,UAAU,CAACG,OAAO,GAAG;MACnB,GAAGH,UAAU,CAACG,OAAO;MACrB,GAAGE;IACL,CAAC;IACDJ,oBAAoB,CAAC,CAAC;EACxB,CAAC,EAAE,EAAE,CAAC;EACN,MAAMK,SAAS,GAAGA,CAChBC,IAAO,EACPC,KAA0B,KACvB;IACH,SAAS;;IAETC,MAAM,CAACC,IAAI,CAACX,QAAQ,CAACG,KAAK,CAAC,CAACS,OAAO,CAAEC,GAAG,IAAK;MAAA,IAAAC,mBAAA,EAAAC,qBAAA;MAC3C,CAAAD,mBAAA,GAAAd,QAAQ,CAACG,KAAK,CAACU,GAAG,CAAC,cAAAC,mBAAA,
|
|
1
|
+
{"version":3,"names":["useCallback","useRef","Animated","useSharedValue","useSharedHandlers","handlers","jsHandlers","updateSharedHandlers","value","current","setHandlers","handler","broadcast","type","event","Object","keys","forEach","key","_handlers$value$key","_handlers$value$key$t","call","useAnimatedValue","initialValue","config","ref","Value"],"sources":["internal.ts"],"sourcesContent":["import { useCallback, useRef } from \"react\";\nimport { Animated } from \"react-native\";\nimport { useSharedValue } from \"react-native-reanimated\";\n\nimport type { Handlers } from \"./types\";\n\ntype UntypedHandler = Record<string, (event: never) => void>;\ntype SharedHandlersReturnType<T extends UntypedHandler> = [\n (handler: Handlers<T>) => void,\n <K extends keyof T>(type: K, event: Parameters<T[K]>[0]) => void,\n];\n\n/**\n * Hook for storing worklet handlers (objects with keys, where values are worklets).\n * Returns methods for setting handlers and broadcasting events in them.\n *\n * T is a generic that looks like:\n * @example\n * {\n * onEvent: () => {},\n * onEvent2: () => {},\n * }\n */\nexport function useSharedHandlers<\n T extends UntypedHandler,\n>(): SharedHandlersReturnType<T> {\n const handlers = useSharedValue<Handlers<T>>({});\n const jsHandlers = useRef<Handlers<T>>({});\n\n // since js -> worklet -> js call is asynchronous, we can not write handlers\n // straight into shared variable (using current shared value as a previous result),\n // since there may be a race condition in a call, and closure may have out-of-dated\n // values. As a result, some of handlers may be not written to \"all handlers\" object.\n // Below we are writing all handlers to `ref` and afterwards synchronize them with\n // shared value (since `refs` are not referring to actual value in worklets).\n // This approach allow us to update synchronously handlers in js thread (and it assures,\n // that it will have all of them) and then update them in worklet thread (calls are\n // happening in FIFO order, so we will always have actual value).\n const updateSharedHandlers = () => {\n handlers.value = jsHandlers.current;\n };\n const setHandlers = useCallback((handler: Handlers<T>) => {\n jsHandlers.current = {\n ...jsHandlers.current,\n ...handler,\n };\n updateSharedHandlers();\n }, []);\n const broadcast = <K extends keyof T>(\n type: K,\n event: Parameters<T[K]>[0],\n ) => {\n \"worklet\";\n\n Object.keys(handlers.value).forEach((key) => {\n handlers.value[key]?.[type]?.(event);\n });\n };\n\n return [setHandlers, broadcast];\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,WAAW,EAAEC,MAAM,QAAQ,OAAO;AAC3C,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,cAAc,QAAQ,yBAAyB;AAUxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAA,EAEA;EAC/B,MAAMC,QAAQ,GAAGF,cAAc,CAAc,CAAC,CAAC,CAAC;EAChD,MAAMG,UAAU,GAAGL,MAAM,CAAc,CAAC,CAAC,CAAC;;EAE1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMM,oBAAoB,GAAGA,CAAA,KAAM;IACjCF,QAAQ,CAACG,KAAK,GAAGF,UAAU,CAACG,OAAO;EACrC,CAAC;EACD,MAAMC,WAAW,GAAGV,WAAW,CAAEW,OAAoB,IAAK;IACxDL,UAAU,CAACG,OAAO,GAAG;MACnB,GAAGH,UAAU,CAACG,OAAO;MACrB,GAAGE;IACL,CAAC;IACDJ,oBAAoB,CAAC,CAAC;EACxB,CAAC,EAAE,EAAE,CAAC;EACN,MAAMK,SAAS,GAAGA,CAChBC,IAAO,EACPC,KAA0B,KACvB;IACH,SAAS;;IAETC,MAAM,CAACC,IAAI,CAACX,QAAQ,CAACG,KAAK,CAAC,CAACS,OAAO,CAAEC,GAAG,IAAK;MAAA,IAAAC,mBAAA,EAAAC,qBAAA;MAC3C,CAAAD,mBAAA,GAAAd,QAAQ,CAACG,KAAK,CAACU,GAAG,CAAC,cAAAC,mBAAA,gBAAAC,qBAAA,GAAnBD,mBAAA,CAAsBN,IAAI,CAAC,cAAAO,qBAAA,eAA3BA,qBAAA,CAAAC,IAAA,CAAAF,mBAAA,EAA8BL,KAAK,CAAC;IACtC,CAAC,CAAC;EACJ,CAAC;EAED,OAAO,CAACJ,WAAW,EAAEE,SAAS,CAAC;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,gBAAgBA,CAC9BC,YAAoB,EACpBC,MAAgC,EAChB;EAChB,MAAMC,GAAG,GAAGxB,MAAM,CAAwB,IAAI,CAAC;EAE/C,IAAIwB,GAAG,CAAChB,OAAO,IAAI,IAAI,EAAE;IACvBgB,GAAG,CAAChB,OAAO,GAAG,IAAIP,QAAQ,CAACwB,KAAK,CAACH,YAAY,EAAEC,MAAM,CAAC;EACxD;EAEA,OAAOC,GAAG,CAAChB,OAAO;AACpB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeAndroidManager","RCTStatusBarManagerCompat","require","default","OriginalNativeAndroidManager","ModifiedNativeAndroidManager","setColor","color","animated","setTranslucent","translucent","setStyle","statusBarStyle","setHidden","hidden","applyMonkeyPatch","Object","assign","revertMonkeyPatch"],"sources":["monkey-patch.android.ts"],"sourcesContent":["// @ts-expect-error because there is no corresponding type definition\nimport * as NativeAndroidManager from \"react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid\";\n\nconst RCTStatusBarManagerCompat =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"./specs/NativeStatusBarManagerCompat\").default;\n\n// Copy original default manager to keep its original state and methods\nconst OriginalNativeAndroidManager = { ...NativeAndroidManager.default };\n\n// Create a new object that modifies the necessary methods\n// On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so\n// in order to use library on all available platforms we have to monkey patch\n// default RN implementation and use modern `WindowInsetsControllerCompat`.\nconst ModifiedNativeAndroidManager = {\n ...NativeAndroidManager.default, // Spread original properties to keep existing functionality\n setColor: (color: number, animated: boolean): void => {\n RCTStatusBarManagerCompat.setColor(color, animated);\n },\n setTranslucent: (translucent: boolean): void => {\n RCTStatusBarManagerCompat.setTranslucent(translucent);\n },\n /**\n * - statusBarStyles can be:\n * - 'default'\n * - 'dark-content'\n */\n setStyle: (statusBarStyle?: string): void => {\n RCTStatusBarManagerCompat.setStyle(statusBarStyle);\n },\n setHidden: (hidden: boolean): void => {\n RCTStatusBarManagerCompat.setHidden(hidden);\n },\n};\n\n// Define a function to apply the monkey patch\nexport const applyMonkeyPatch = () => {\n Object.assign(NativeAndroidManager.default, ModifiedNativeAndroidManager);\n};\n\n// Define a function to revert changes back to the original state\nexport const revertMonkeyPatch = () => {\n Object.assign(NativeAndroidManager.default, OriginalNativeAndroidManager);\n};\n"],"mappings":"AAAA;AACA,OAAO,KAAKA,oBAAoB,MAAM,2EAA2E;AAEjH,MAAMC,yBAAyB;AAC7B;AACAC,OAAO,CAAC,sCAAsC,CAAC,CAACC,OAAO;;AAEzD;AACA,MAAMC,4BAA4B,GAAG;EAAE,GAAGJ,oBAAoB,CAACG;AAAQ,CAAC;;AAExE;AACA;AACA;AACA;AACA,MAAME,4BAA4B,GAAG;EACnC,GAAGL,oBAAoB,CAACG,OAAO;EAAE;EACjCG,QAAQ,EAAEA,CAACC,KAAa,EAAEC,QAAiB,KAAW;IACpDP,yBAAyB,CAACK,QAAQ,CAACC,KAAK,EAAEC,QAAQ,CAAC;EACrD,CAAC;EACDC,cAAc,EAAGC,WAAoB,IAAW;IAC9CT,yBAAyB,CAACQ,cAAc,CAACC,WAAW,CAAC;EACvD,CAAC;EACD;AACF;AACA;AACA;AACA;EACEC,QAAQ,EAAGC,cAAuB,IAAW;IAC3CX,yBAAyB,CAACU,QAAQ,CAACC,cAAc,CAAC;EACpD,CAAC;EACDC,SAAS,EAAGC,MAAe,IAAW;IACpCb,yBAAyB,CAACY,SAAS,CAACC,MAAM,CAAC;EAC7C;AACF,CAAC;;AAED;AACA,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EACpCC,MAAM,CAACC,MAAM,CAACjB,oBAAoB,CAACG,OAAO,EAAEE,4BAA4B,CAAC;AAC3E,CAAC;;AAED;AACA,OAAO,MAAMa,iBAAiB,GAAGA,CAAA,KAAM;EACrCF,MAAM,CAACC,MAAM,CAACjB,oBAAoB,CAACG,OAAO,EAAEC,4BAA4B,CAAC;AAC3E,CAAC"}
|
|
1
|
+
{"version":3,"names":["NativeAndroidManager","RCTStatusBarManagerCompat","require","default","OriginalNativeAndroidManager","ModifiedNativeAndroidManager","setColor","color","animated","setTranslucent","translucent","setStyle","statusBarStyle","setHidden","hidden","applyMonkeyPatch","Object","assign","revertMonkeyPatch"],"sources":["monkey-patch.android.ts"],"sourcesContent":["// @ts-expect-error because there is no corresponding type definition\nimport * as NativeAndroidManager from \"react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid\";\n\nconst RCTStatusBarManagerCompat =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"./specs/NativeStatusBarManagerCompat\").default;\n\n// Copy original default manager to keep its original state and methods\nconst OriginalNativeAndroidManager = { ...NativeAndroidManager.default };\n\n// Create a new object that modifies the necessary methods\n// On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so\n// in order to use library on all available platforms we have to monkey patch\n// default RN implementation and use modern `WindowInsetsControllerCompat`.\nconst ModifiedNativeAndroidManager = {\n ...NativeAndroidManager.default, // Spread original properties to keep existing functionality\n setColor: (color: number, animated: boolean): void => {\n RCTStatusBarManagerCompat.setColor(color, animated);\n },\n setTranslucent: (translucent: boolean): void => {\n RCTStatusBarManagerCompat.setTranslucent(translucent);\n },\n /**\n * - statusBarStyles can be:\n * - 'default'\n * - 'dark-content'\n */\n setStyle: (statusBarStyle?: string): void => {\n RCTStatusBarManagerCompat.setStyle(statusBarStyle);\n },\n setHidden: (hidden: boolean): void => {\n RCTStatusBarManagerCompat.setHidden(hidden);\n },\n};\n\n// Define a function to apply the monkey patch\nexport const applyMonkeyPatch = () => {\n Object.assign(NativeAndroidManager.default, ModifiedNativeAndroidManager);\n};\n\n// Define a function to revert changes back to the original state\nexport const revertMonkeyPatch = () => {\n Object.assign(NativeAndroidManager.default, OriginalNativeAndroidManager);\n};\n"],"mappings":"AAAA;AACA,OAAO,KAAKA,oBAAoB,MAAM,2EAA2E;AAEjH,MAAMC,yBAAyB;AAC7B;AACAC,OAAO,CAAC,sCAAsC,CAAC,CAACC,OAAO;;AAEzD;AACA,MAAMC,4BAA4B,GAAG;EAAE,GAAGJ,oBAAoB,CAACG;AAAQ,CAAC;;AAExE;AACA;AACA;AACA;AACA,MAAME,4BAA4B,GAAG;EACnC,GAAGL,oBAAoB,CAACG,OAAO;EAAE;EACjCG,QAAQ,EAAEA,CAACC,KAAa,EAAEC,QAAiB,KAAW;IACpDP,yBAAyB,CAACK,QAAQ,CAACC,KAAK,EAAEC,QAAQ,CAAC;EACrD,CAAC;EACDC,cAAc,EAAGC,WAAoB,IAAW;IAC9CT,yBAAyB,CAACQ,cAAc,CAACC,WAAW,CAAC;EACvD,CAAC;EACD;AACF;AACA;AACA;AACA;EACEC,QAAQ,EAAGC,cAAuB,IAAW;IAC3CX,yBAAyB,CAACU,QAAQ,CAACC,cAAc,CAAC;EACpD,CAAC;EACDC,SAAS,EAAGC,MAAe,IAAW;IACpCb,yBAAyB,CAACY,SAAS,CAACC,MAAM,CAAC;EAC7C;AACF,CAAC;;AAED;AACA,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EACpCC,MAAM,CAACC,MAAM,CAACjB,oBAAoB,CAACG,OAAO,EAAEE,4BAA4B,CAAC;AAC3E,CAAC;;AAED;AACA,OAAO,MAAMa,iBAAiB,GAAGA,CAAA,KAAM;EACrCF,MAAM,CAACC,MAAM,CAACjB,oBAAoB,CAACG,OAAO,EAAEC,4BAA4B,CAAC;AAC3E,CAAC","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;AACrB,OAAO,MAAMC,gBAAgB,GAAGD,IAAI;AACpC,OAAO,MAAME,iBAAiB,GAAGF,IAAI"}
|
|
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;AACrB,OAAO,MAAMC,gBAAgB,GAAGD,IAAI;AACpC,OAAO,MAAME,iBAAiB,GAAGF,IAAI","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NOOP","useAnimatedKeyboardHandler","useFocusedInputLayoutHandler","useFocusedInputTextHandler"],"sources":["reanimated.ts"],"sourcesContent":["import type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n FocusedInputTextChangedEvent,\n FocusedInputTextHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from \"./types\";\n\nconst NOOP = () => () => {};\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;\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputTextChangedEvent>\n> = NOOP;\n"],"mappings":"AAUA,MAAMA,IAAI,GAAGA,CAAA,KAAM,MAAM,CAAC,CAAC;AAC3B,OAAO,MAAMC,0BAGZ,GAAGD,IAAI;AACR,OAAO,MAAME,4BAGZ,GAAGF,IAAI;AACR,OAAO,MAAMG,0BAGZ,GAAGH,IAAI"}
|
|
1
|
+
{"version":3,"names":["NOOP","useAnimatedKeyboardHandler","useFocusedInputLayoutHandler","useFocusedInputTextHandler"],"sources":["reanimated.ts"],"sourcesContent":["import type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n FocusedInputTextChangedEvent,\n FocusedInputTextHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from \"./types\";\n\nconst NOOP = () => () => {};\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;\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputTextChangedEvent>\n> = NOOP;\n"],"mappings":"AAUA,MAAMA,IAAI,GAAGA,CAAA,KAAM,MAAM,CAAC,CAAC;AAC3B,OAAO,MAAMC,0BAGZ,GAAGD,IAAI;AACR,OAAO,MAAME,4BAGZ,GAAGF,IAAI;AACR,OAAO,MAAMG,0BAGZ,GAAGH,IAAI","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEvent","useHandler","useAnimatedKeyboardHandler","handlers","dependencies","context","doDependenciesDiffer","event","onKeyboardMoveStart","onKeyboardMove","onKeyboardMoveEnd","onKeyboardMoveInteractive","eventName","endsWith","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged","useFocusedInputTextHandler","onFocusedInputTextChanged"],"sources":["reanimated.native.ts"],"sourcesContent":["import { useEvent, useHandler } from \"react-native-reanimated\";\n\nimport type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n FocusedInputTextChangedEvent,\n FocusedInputTextHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from \"./types\";\n\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\n Record<string, unknown>,\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 Record<string, unknown>,\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\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputTextChangedEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const { onFocusedInputTextChanged } = handlers;\n\n if (\n onFocusedInputTextChanged &&\n event.eventName.endsWith(\"onFocusedInputTextChanged\")\n ) {\n onFocusedInputTextChanged(event, context);\n }\n },\n [\"onFocusedInputTextChanged\"],\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;IAC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KeyboardHandler","handlers","dependencies","context","doDependenciesDiffer","event","onKeyboardMoveStart","onKeyboardMove","onKeyboardMoveEnd","onKeyboardMoveInteractive","eventName","endsWith","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged","useFocusedInputTextHandler","onFocusedInputTextChanged"],"sources":["reanimated.native.ts"],"sourcesContent":["import { useEvent, useHandler } from \"react-native-reanimated\";\n\nimport type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n FocusedInputTextChangedEvent,\n FocusedInputTextHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from \"./types\";\n\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\n Record<string, unknown>,\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 Record<string, unknown>,\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\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputTextChangedEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const { onFocusedInputTextChanged } = handlers;\n\n if (\n onFocusedInputTextChanged &&\n event.eventName.endsWith(\"onFocusedInputTextChanged\")\n ) {\n onFocusedInputTextChanged(event, context);\n }\n },\n [\"onFocusedInputTextChanged\"],\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,CA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,CAAC,2BAA2B,CAAC,EAC7BC,oBACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["codegenNativeComponent"],"sources":["KeyboardControllerViewNativeComponent.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 DirectEventHandler,\n Double,\n Int32,\n} from \"react-native/Libraries/Types/CodegenTypes\";\n\ntype KeyboardMoveEvent = Readonly<{\n height: Double;\n progress: Double;\n duration: Int32;\n target: Int32;\n}>;\n\ntype FocusedInputLayoutChangedEvent = Readonly<{\n target: Int32;\n parentScrollViewTarget: Int32;\n layout: {\n x: Double;\n y: Double;\n width: Double;\n height: Double;\n absoluteX: Double;\n absoluteY: Double;\n };\n}>;\n\ntype FocusedInputTextChangedEvent = Readonly<{\n text: string;\n}>;\n\nexport interface NativeProps extends ViewProps {\n // props\n enabled?: boolean;\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n // callbacks\n /// keyboard\n onKeyboardMoveStart?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveEnd?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveInteractive?: DirectEventHandler<KeyboardMoveEvent>;\n /// focused input\n onFocusedInputLayoutChanged?: DirectEventHandler<FocusedInputLayoutChangedEvent>;\n onFocusedInputTextChanged?: DirectEventHandler<FocusedInputTextChangedEvent>;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n \"KeyboardControllerView\",\n) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAkD5F,eAAeA,sBAAsB,CACnC,wBACF,CAAC"}
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent"],"sources":["KeyboardControllerViewNativeComponent.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 DirectEventHandler,\n Double,\n Int32,\n} from \"react-native/Libraries/Types/CodegenTypes\";\n\ntype KeyboardMoveEvent = Readonly<{\n height: Double;\n progress: Double;\n duration: Int32;\n target: Int32;\n}>;\n\ntype FocusedInputLayoutChangedEvent = Readonly<{\n target: Int32;\n parentScrollViewTarget: Int32;\n layout: {\n x: Double;\n y: Double;\n width: Double;\n height: Double;\n absoluteX: Double;\n absoluteY: Double;\n };\n}>;\n\ntype FocusedInputTextChangedEvent = Readonly<{\n text: string;\n}>;\n\nexport interface NativeProps extends ViewProps {\n // props\n enabled?: boolean;\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n // callbacks\n /// keyboard\n onKeyboardMoveStart?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveEnd?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveInteractive?: DirectEventHandler<KeyboardMoveEvent>;\n /// focused input\n onFocusedInputLayoutChanged?: DirectEventHandler<FocusedInputLayoutChangedEvent>;\n onFocusedInputTextChanged?: DirectEventHandler<FocusedInputTextChangedEvent>;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n \"KeyboardControllerView\",\n) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAkD5F,eAAeA,sBAAsB,CACnC,wBACF,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 { WithDefault } 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}\n\nexport default codegenNativeComponent<NativeProps>(\"KeyboardGestureArea\", {\n excludedPlatforms: [\"iOS\"],\n}) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAY5F,eAAeA,sBAAsB,CAAc,qBAAqB,EAAE;EACxEC,iBAAiB,EAAE,CAAC,KAAK;AAC3B,CAAC,CAAC"}
|
|
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 { WithDefault } 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}\n\nexport default codegenNativeComponent<NativeProps>(\"KeyboardGestureArea\", {\n excludedPlatforms: [\"iOS\"],\n}) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAY5F,eAAeA,sBAAsB,CAAc,qBAAqB,EAAE;EACxEC,iBAAiB,EAAE,CAAC,KAAK;AAC3B,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeKeyboardController.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\n\nimport type { TurboModule } from \"react-native\";\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n // methods\n setInputMode(mode: number): void;\n setDefaultMode(): void;\n dismiss(): void;\n setFocusTo(direction: string): void;\n\n // event emitter\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n}\n\nexport default TurboModuleRegistry.get<Spec>(\"KeyboardController\");\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAkBlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeKeyboardController.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\n\nimport type { TurboModule } from \"react-native\";\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n // methods\n setInputMode(mode: number): void;\n setDefaultMode(): void;\n dismiss(): void;\n setFocusTo(direction: string): void;\n\n // event emitter\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n}\n\nexport default TurboModuleRegistry.get<Spec>(\"KeyboardController\");\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAkBlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeStatusBarManagerCompat.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\n\nimport type { TurboModule } from \"react-native\";\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n setHidden(hidden: boolean): void;\n setColor(color: number, animated: boolean): void;\n setTranslucent(translucent: boolean): void;\n setStyle(style: string): void;\n}\n\nexport default TurboModuleRegistry.get<Spec>(\"StatusBarManagerCompat\");\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAalD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeStatusBarManagerCompat.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\n\nimport type { TurboModule } from \"react-native\";\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n setHidden(hidden: boolean): void;\n setColor(color: number, animated: boolean): void;\n setTranslucent(translucent: boolean): void;\n setStyle(style: string): void;\n}\n\nexport default TurboModuleRegistry.get<Spec>(\"StatusBarManagerCompat\");\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAalD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,wBAAwB,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 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 // 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 // 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};\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;\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}>;\nexport type FocusedInputHandlers = Handlers<FocusedInputHandler>;\n"],"mappings":""}
|
|
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 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 // 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 // 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};\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;\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}>;\nexport type FocusedInputHandlers = Handlers<FocusedInputHandler>;\n"],"mappings":"","ignoreList":[]}
|
package/lib/module/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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"}
|
|
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":[]}
|
|
@@ -27,5 +27,5 @@ type KeyboardProviderProps = {
|
|
|
27
27
|
*/
|
|
28
28
|
enabled?: boolean;
|
|
29
29
|
};
|
|
30
|
-
export declare const KeyboardProvider: ({ children, statusBarTranslucent, navigationBarTranslucent, enabled: initiallyEnabled, }: KeyboardProviderProps) => JSX.Element;
|
|
30
|
+
export declare const KeyboardProvider: ({ children, statusBarTranslucent, navigationBarTranslucent, enabled: initiallyEnabled, }: KeyboardProviderProps) => React.JSX.Element;
|
|
31
31
|
export {};
|
|
@@ -11,5 +11,5 @@ type ButtonProps = {
|
|
|
11
11
|
style?: ViewStyle;
|
|
12
12
|
theme: KeyboardToolbarTheme;
|
|
13
13
|
};
|
|
14
|
-
declare const _default: ({ children, onPress, disabled, accessibilityLabel, accessibilityHint, testID, style, }: React.PropsWithChildren<ButtonProps>) => JSX.Element;
|
|
14
|
+
declare const _default: ({ children, onPress, disabled, accessibilityLabel, accessibilityHint, testID, style, }: React.PropsWithChildren<ButtonProps>) => React.JSX.Element;
|
|
15
15
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-keyboard-controller",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.4",
|
|
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",
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@commitlint/config-conventional": "^11.0.0",
|
|
70
|
-
"@react-native/eslint-config": "^0.
|
|
70
|
+
"@react-native/eslint-config": "^0.73.2",
|
|
71
71
|
"@release-it/conventional-changelog": "^2.0.0",
|
|
72
72
|
"@types/jest": "^29.2.1",
|
|
73
|
-
"@types/react": "^18.
|
|
73
|
+
"@types/react": "^18.2.6",
|
|
74
74
|
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
|
75
75
|
"@typescript-eslint/parser": "^6.7.4",
|
|
76
76
|
"clang-format": "^1.8.0",
|
|
@@ -82,15 +82,15 @@
|
|
|
82
82
|
"eslint-plugin-jest": "^26.5.3",
|
|
83
83
|
"eslint-plugin-prettier": "^4.2.1",
|
|
84
84
|
"husky": "^6.0.0",
|
|
85
|
-
"jest": "^29.
|
|
85
|
+
"jest": "^29.6.3",
|
|
86
86
|
"pod-install": "^0.1.0",
|
|
87
87
|
"prettier": "^2.8.8",
|
|
88
88
|
"react": "18.2.0",
|
|
89
|
-
"react-native": "0.
|
|
89
|
+
"react-native": "0.73.6",
|
|
90
90
|
"react-native-builder-bob": "^0.18.0",
|
|
91
|
-
"react-native-reanimated": "3.
|
|
91
|
+
"react-native-reanimated": "3.8.0",
|
|
92
92
|
"release-it": "^14.2.2",
|
|
93
|
-
"typescript": "
|
|
93
|
+
"typescript": "5.0.4"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
96
|
"react": "*",
|