@react-native-ohos/react-native-keyboard-controller 1.16.6-rc.1 → 1.17.0-beta.2
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/LICENSE +21 -21
- package/README.OpenSource +10 -10
- package/README.md +19 -19
- package/harmony/keyboard_controller/BuildProfile.ets +16 -16
- package/harmony/keyboard_controller/Index.ets +28 -7
- package/harmony/keyboard_controller/build-profile.json5 +31 -31
- package/harmony/keyboard_controller/hvigorfile.ts +6 -6
- package/harmony/keyboard_controller/obfuscation-rules.txt +17 -17
- package/harmony/keyboard_controller/oh-package-lock.json5 +19 -0
- package/harmony/keyboard_controller/oh-package.json5 +10 -10
- package/harmony/keyboard_controller/src/main/cpp/CMakeLists.txt +7 -7
- package/harmony/keyboard_controller/src/main/cpp/EventEmitters.cpp +95 -95
- package/harmony/keyboard_controller/src/main/cpp/EventEmitters.h +111 -90
- package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentDescriptor.h +94 -73
- package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.cpp +287 -171
- package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.h +103 -76
- package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewJSIBinder.h +65 -44
- package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentDescriptor.h +79 -58
- package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.cpp +107 -86
- package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.h +83 -62
- package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaJSIBinder.h +60 -39
- package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.cpp +46 -25
- package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.h +48 -27
- package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.cpp +45 -24
- package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.h +49 -28
- package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.cpp +186 -0
- package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.h +112 -0
- package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.cpp +64 -43
- package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.h +77 -56
- package/harmony/keyboard_controller/src/main/ets/Logger.ts +66 -45
- package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerPackage.ts +66 -45
- package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerTurboModule.ts +273 -238
- package/harmony/keyboard_controller/src/main/ets/RNStatusBarManagerCompatTurboModule.ts +119 -98
- package/harmony/keyboard_controller/src/main/ets/Type.ts +62 -41
- package/harmony/keyboard_controller/src/main/module.json5 +11 -11
- package/harmony/keyboard_controller/src/main/resources/base/element/string.json +8 -8
- package/harmony/keyboard_controller/src/main/resources/en_US/element/string.json +8 -8
- package/harmony/keyboard_controller/src/main/resources/zh_CN/element/string.json +8 -8
- package/harmony/keyboard_controller/ts.ts +29 -8
- package/harmony/keyboard_controller.har +0 -0
- package/lib/commonjs/animated.js +2 -2
- package/lib/commonjs/animated.js.map +1 -1
- package/lib/commonjs/bindings.js +3 -3
- package/lib/commonjs/bindings.js.map +1 -1
- package/lib/commonjs/bindings.native.js +3 -3
- 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 +3 -3
- package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js +39 -39
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +3 -3
- package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
- package/lib/commonjs/components/KeyboardAwareScrollView/utils.js.map +1 -1
- package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/colors.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/colors.native.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/index.js +3 -3
- 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 -1
- package/lib/commonjs/components/hooks/useColorScheme.js.map +1 -1
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/context.js.map +1 -1
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useWindowDimensions/index.android.js.map +1 -1
- package/lib/commonjs/hooks/useWindowDimensions/index.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal.js +18 -18
- package/lib/commonjs/internal.js.map +1 -1
- package/lib/commonjs/module.js.map +1 -1
- package/lib/commonjs/monkey-patch.android.js +4 -4
- package/lib/commonjs/monkey-patch.android.js.map +1 -1
- package/lib/commonjs/monkey-patch.js.map +1 -1
- package/lib/commonjs/reanimated.js.map +1 -1
- package/lib/commonjs/reanimated.native.js.map +1 -1
- package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
- package/lib/commonjs/specs/NativeStatusBarManagerCompat.js.map +1 -1
- package/lib/commonjs/specs/OverKeyboardViewNativeComponent.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/views/OverKeyboardView/index.js.map +1 -1
- package/lib/commonjs/views/index.js.map +1 -1
- package/lib/module/animated.js +2 -2
- package/lib/module/animated.js.map +1 -1
- package/lib/module/bindings.js +3 -3
- package/lib/module/bindings.js.map +1 -1
- package/lib/module/bindings.native.js +3 -3
- 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 +3 -3
- package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/index.js +39 -39
- package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +3 -3
- package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
- package/lib/module/components/KeyboardAwareScrollView/utils.js.map +1 -1
- package/lib/module/components/KeyboardStickyView/index.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/Arrow.js.map +1 -1
- 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 +3 -3
- 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 +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.map +1 -1
- package/lib/module/context.js.map +1 -1
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useWindowDimensions/index.android.js.map +1 -1
- package/lib/module/hooks/useWindowDimensions/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal.js +18 -18
- package/lib/module/internal.js.map +1 -1
- package/lib/module/module.js.map +1 -1
- package/lib/module/monkey-patch.android.js +4 -4
- 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/specs/OverKeyboardViewNativeComponent.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/module/views/OverKeyboardView/index.js.map +1 -1
- package/lib/module/views/index.js.map +1 -1
- package/package.json +174 -173
- package/src/animated.tsx +255 -256
- package/src/bindings.native.ts +62 -62
- package/src/bindings.ts +42 -42
- package/src/components/KeyboardAvoidingView/hooks.ts +123 -123
- package/src/components/KeyboardAvoidingView/index.tsx +188 -188
- package/src/components/KeyboardAwareScrollView/index.tsx +389 -389
- package/src/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +133 -133
- package/src/components/KeyboardAwareScrollView/utils.ts +41 -41
- package/src/components/KeyboardStickyView/index.tsx +66 -66
- package/src/components/KeyboardToolbar/Arrow.tsx +80 -80
- package/src/components/KeyboardToolbar/Button.tsx +98 -98
- package/src/components/KeyboardToolbar/colors.native.ts +37 -37
- package/src/components/KeyboardToolbar/colors.ts +16 -16
- package/src/components/KeyboardToolbar/index.tsx +223 -223
- package/src/components/KeyboardToolbar/types.ts +40 -40
- package/src/components/hooks/useColorScheme.ts +6 -5
- package/src/components/index.ts +11 -11
- package/src/constants.ts +19 -19
- package/src/context.ts +68 -68
- package/src/hooks/index.ts +90 -90
- package/src/hooks/useWindowDimensions/index.android.ts +38 -38
- package/src/hooks/useWindowDimensions/index.ts +1 -1
- package/src/index.ts +23 -23
- package/src/internal.ts +84 -84
- package/src/module.ts +52 -52
- package/src/monkey-patch.android.ts +44 -44
- package/src/monkey-patch.ts +4 -4
- package/src/reanimated.native.ts +132 -132
- package/src/reanimated.ts +29 -29
- package/src/specs/KeyboardControllerViewNativeComponent.ts +71 -71
- package/src/specs/KeyboardGestureAreaNativeComponent.ts +20 -20
- package/src/specs/NativeKeyboardController.ts +19 -19
- package/src/specs/NativeStatusBarManagerCompat.ts +14 -14
- package/src/specs/OverKeyboardViewNativeComponent.ts +12 -12
- package/src/types.ts +243 -243
- package/src/utils.ts +1 -1
- package/src/views/OverKeyboardView/index.tsx +43 -43
- package/src/views/index.ts +1 -1
- package/react-native-keyboard-controller.podspec +0 -61
|
@@ -1 +1 @@
|
|
|
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,CAACC,WAAW,CAAC,CAACF,QAAQ,GAC3BC,KAAK,CAACC,WAAW,CAAC,CAACG;EACzB,CAAC,CAAC,EACF,CAACL,QAAQ,EAAEC,KAAK,EAAEC,WAAW,CAC/B,CAAC;EACD,MAAMI,IAAI,GAAGb,OAAO,CAAC,MAAM,CAACc,MAAM,CAACC,aAAa,EAAEL,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAClE,MAAMM,KAAK,GAAGhB,OAAO,CAAC,MAAM,CAACc,MAAM,CAACG,cAAc,EAAEP,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAEpE,oBACEX,KAAA,CAAAmB,aAAA,CAACf,IAAI;IACHg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AChCnB,IAAI,EAAE,CAAC;EACT;AACF,CAAC,CAAC;AAEF,eAAeR,cAAc","ignoreList":[]}
|
|
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\";\r\nimport { Animated, StyleSheet, View } from \"react-native\";\r\n\r\nimport useColorScheme from \"../hooks/useColorScheme\";\r\n\r\nimport type { KeyboardToolbarTheme } from \"./types\";\r\nimport type { ViewStyle } from \"react-native\";\r\n\r\ntype ArrowProps = {\r\n type: \"prev\" | \"next\";\r\n disabled?: boolean;\r\n theme: KeyboardToolbarTheme;\r\n};\r\n\r\nconst ArrowComponent: React.FC<ArrowProps> = ({ type, disabled, theme }) => {\r\n const colorScheme = useColorScheme();\r\n\r\n const color = useMemo(\r\n () => ({\r\n backgroundColor: disabled\r\n ? theme[colorScheme].disabled\r\n : theme[colorScheme].primary,\r\n }),\r\n [disabled, theme, colorScheme],\r\n );\r\n const left = useMemo(() => [styles.arrowLeftLine, color], [color]);\r\n const right = useMemo(() => [styles.arrowRightLine, color], [color]);\r\n\r\n return (\r\n <View\r\n style={\r\n type === \"next\" ? styles.arrowDownContainer : styles.arrowUpContainer\r\n }\r\n >\r\n <View style={styles.arrow}>\r\n <Animated.View style={left} />\r\n <Animated.View style={right} />\r\n </View>\r\n </View>\r\n );\r\n};\r\n\r\nconst arrowLine: ViewStyle = {\r\n width: 13,\r\n height: 2,\r\n borderRadius: 1,\r\n};\r\nconst arrowUpContainer: ViewStyle = {\r\n marginHorizontal: 5,\r\n width: 30,\r\n height: 30,\r\n justifyContent: \"center\",\r\n alignItems: \"center\",\r\n};\r\nconst styles = StyleSheet.create({\r\n arrowUpContainer: arrowUpContainer,\r\n arrowDownContainer: {\r\n ...arrowUpContainer,\r\n transform: [{ rotate: \"180deg\" }],\r\n },\r\n arrow: {\r\n width: 20,\r\n height: 20,\r\n flexDirection: \"row\",\r\n alignItems: \"center\",\r\n justifyContent: \"space-between\",\r\n },\r\n arrowLeftLine: {\r\n ...arrowLine,\r\n transform: [{ rotate: \"-45deg\" }],\r\n left: -0.5,\r\n },\r\n arrowRightLine: {\r\n ...arrowLine,\r\n transform: [{ rotate: \"45deg\" }],\r\n left: -5.5,\r\n },\r\n});\r\n\r\nexport default ArrowComponent;\r\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,CAACC,WAAW,CAAC,CAACF,QAAQ,GAC3BC,KAAK,CAACC,WAAW,CAAC,CAACG;EACzB,CAAC,CAAC,EACF,CAACL,QAAQ,EAAEC,KAAK,EAAEC,WAAW,CAC/B,CAAC;EACD,MAAMI,IAAI,GAAGb,OAAO,CAAC,MAAM,CAACc,MAAM,CAACC,aAAa,EAAEL,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAClE,MAAMM,KAAK,GAAGhB,OAAO,CAAC,MAAM,CAACc,MAAM,CAACG,cAAc,EAAEP,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAEpE,oBACEX,KAAA,CAAAmB,aAAA,CAACf,IAAI;IACHgB,KAAK,EACHb,IAAI,KAAK,MAAM,GAAGQ,MAAM,CAACM,kBAAkB,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AAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
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,CAAC,CAAC;EAEpE,oBACEV,KAAA,CAAAiB,aAAA,CAACF,SAAS;IACRC,kBAAkB,EAAEA,kBAAmB;IACvCE,iBAAiB,EAAC,QAAQ;IAC1BP,kBAAkB,EAAEA,kBAAmB;IACvCC,iBAAiB,EAAEA,iBAAkB;IACrCH,OAAO,EAAEA,OAAQ;IACjBK,KAAK,EAAEA,KAAM;IACbD,MAAM,EAAEA;EAAO,GAEdL,QACQ,CAAC;AAEhB,CAAC;AACD,MAAMW,aAAa,GAAGA,CAAC;EACrBX,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,kBAAkB;EAClBC,iBAAiB;EACjBC,MAAM;EACNO,YAAY,GAAG,EAAE;EACjBN,KAAK;EACLO;AAC8B,CAAC,KAAK;EACpC,MAAMC,WAAW,GAAGhB,cAAc,CAAC,CAAC;EACpC,MAAMU,kBAAkB,GAAGf,OAAO,CAAC,OAAO;IAAES;EAAS,CAAC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EACpE,MAAMa,MAAM,GAAGtB,OAAO,CACpB,MACEE,uBAAuB,CAACqB,MAAM,CAC5BH,KAAK,CAACC,WAAW,CAAC,CAACC,MAAM,EACzB,IAAI,EACJH,YACF,CAAC,EACH,CAACE,WAAW,EAAEF,YAAY,EAAEC,KAAK,CACnC,CAAC;EAED,oBACErB,KAAA,CAAAiB,aAAA,CAACd,uBAAuB;IACtBa,kBAAkB,EAAEA,kBAAmB;IACvCE,iBAAiB,EAAC,QAAQ;IAC1BP,kBAAkB,EAAEA,kBAAmB;IACvCC,iBAAiB,EAAEA,iBAAkB;IACrCH,OAAO,EAAEA,OAAQ;IACjBgB,UAAU,EAAEF,MAAO;IACnBV,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA;EAAM,gBAEbd,KAAA,CAAAiB,aAAA,CAACZ,IAAI;IAACS,KAAK,EAAEA;EAAM,GAAEN,QAAe,CACb,CAAC;AAE9B,CAAC;AAED,eAAeN,QAAQ,CAACwB,MAAM,CAAC;EAC7BC,OAAO,EAAER,aAAa;EACtBS,OAAO,EAAErB;AACX,CAAC,CAAC","ignoreList":[]}
|
|
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\";\r\nimport {\r\n Platform,\r\n TouchableNativeFeedback,\r\n TouchableOpacity,\r\n View,\r\n} from \"react-native\";\r\n\r\nimport useColorScheme from \"../hooks/useColorScheme\";\r\n\r\nimport type { KeyboardToolbarTheme } from \"./types\";\r\nimport type { PropsWithChildren } from \"react\";\r\nimport type { ViewStyle } from \"react-native\";\r\n\r\ntype ButtonProps = {\r\n disabled?: boolean;\r\n onPress: () => void;\r\n accessibilityLabel: string;\r\n accessibilityHint: string;\r\n testID: string;\r\n rippleRadius?: number;\r\n style?: ViewStyle;\r\n theme: KeyboardToolbarTheme;\r\n};\r\n\r\nconst ButtonIOS = ({\r\n children,\r\n onPress,\r\n disabled,\r\n accessibilityLabel,\r\n accessibilityHint,\r\n testID,\r\n style,\r\n}: PropsWithChildren<ButtonProps>) => {\r\n // immediately switch to plain view to avoid animation flickering\r\n // when fade out animation happens and view becomes disabled\r\n const Container = disabled\r\n ? (View as unknown as typeof TouchableOpacity)\r\n : TouchableOpacity;\r\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\r\n\r\n return (\r\n <Container\r\n accessibilityState={accessibilityState}\r\n accessibilityRole=\"button\"\r\n accessibilityLabel={accessibilityLabel}\r\n accessibilityHint={accessibilityHint}\r\n onPress={onPress}\r\n style={style}\r\n testID={testID}\r\n >\r\n {children}\r\n </Container>\r\n );\r\n};\r\nconst ButtonAndroid = ({\r\n children,\r\n onPress,\r\n disabled,\r\n accessibilityLabel,\r\n accessibilityHint,\r\n testID,\r\n rippleRadius = 18,\r\n style,\r\n theme,\r\n}: PropsWithChildren<ButtonProps>) => {\r\n const colorScheme = useColorScheme();\r\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\r\n const ripple = useMemo(\r\n () =>\r\n TouchableNativeFeedback.Ripple(\r\n theme[colorScheme].ripple,\r\n true,\r\n rippleRadius,\r\n ),\r\n [colorScheme, rippleRadius, theme],\r\n );\r\n\r\n return (\r\n <TouchableNativeFeedback\r\n accessibilityState={accessibilityState}\r\n accessibilityRole=\"button\"\r\n accessibilityLabel={accessibilityLabel}\r\n accessibilityHint={accessibilityHint}\r\n onPress={onPress}\r\n background={ripple}\r\n testID={testID}\r\n style={style}\r\n >\r\n <View style={style}>{children}</View>\r\n </TouchableNativeFe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M,CAC5BH,KAAK,CAACC,WAAW,CAAC,CAACC,MAAM,EACzB,IAAI,EACJH,YACF,CAAC,EACH,CAACE,WAAW,EAAEF,YAAY,EAAEC,KAAK,CACnC,CAAC;EAED,oBACErB,KAAA,CAAAiB,aAAA,CAACd,uBAAuB;IACtBa,kBAAkB,EAAEA,kBAAmB;IACvCE,iBAAiB,EAAC,QAAQ;IAC1BP,kBAAkB,EAAEA,kBAAmB;IACvCC,iBAAiB,EAAEA,iBAAkB;IACrCH,OAAO,EAAEA,OAAQ;IACjBgB,UAAU,EAAEF,MAAO;IACnBV,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA;EAAM,gBAEbd,KAAA,CAAAiB,aAAA,CAACZ,IAAI;IAACS,KAAK,EAAEA;EAAM,GAAEN,QAAe,CACb,CAAC;AAE9B,CAAC;AAED,eAAeN,QAAQ,CAACwB,MAAM,CAAC;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","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["colors","light","primary","disabled","background","ripple","dark"],"sources":["colors.ts"],"sourcesContent":["import type { KeyboardToolbarTheme } from \"./types\";\r\n\r\nexport const colors: KeyboardToolbarTheme = {\r\n light: {\r\n primary: \"#2c2c2c\",\r\n disabled: \"#B0BEC5\",\r\n background: \"#f3f3f4\",\r\n ripple: \"#bcbcbcbc\",\r\n },\r\n dark: {\r\n primary: \"#fafafa\",\r\n disabled: \"#707070\",\r\n background: \"#2C2C2E\",\r\n ripple: \"#F8F8F888\",\r\n },\r\n};\r\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","ignoreList":[]}
|
|
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\";\r\n\r\nimport type { KeyboardToolbarTheme } from \"./types\";\r\nimport type { ColorValue } from \"react-native\";\r\n\r\nexport const colors: KeyboardToolbarTheme = {\r\n light: {\r\n primary: Platform.select<ColorValue>({\r\n ios: PlatformColor(\"link\"),\r\n default: \"#2c2c2c\",\r\n }),\r\n disabled: Platform.select<ColorValue>({\r\n ios: PlatformColor(\"systemGray4\"),\r\n default: \"#B0BEC5\",\r\n }),\r\n background: Platform.select({\r\n ios: \"#F8F8F8\",\r\n default: \"#f3f3f4\",\r\n }),\r\n ripple: \"#bcbcbcbc\",\r\n },\r\n dark: {\r\n primary: Platform.select<ColorValue>({\r\n ios: PlatformColor(\"label\"),\r\n default: \"#fafafa\",\r\n }),\r\n disabled: Platform.select<ColorValue>({\r\n ios: PlatformColor(\"systemGray\"),\r\n default: \"#707070\",\r\n }),\r\n background: Platform.select({\r\n ios: \"#555756\",\r\n default: \"#2C2C2E\",\r\n }),\r\n ripple: \"#F8F8F888\",\r\n },\r\n};\r\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":[]}
|
|
@@ -19,9 +19,9 @@ const dismissKeyboard = () => KeyboardControllerNative.dismiss(false);
|
|
|
19
19
|
const goToNextField = () => KeyboardControllerNative.setFocusTo("next");
|
|
20
20
|
const goToPrevField = () => KeyboardControllerNative.setFocusTo("prev");
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and
|
|
24
|
-
* `Done` buttons.
|
|
22
|
+
/**
|
|
23
|
+
* `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and
|
|
24
|
+
* `Done` buttons.
|
|
25
25
|
*/
|
|
26
26
|
const KeyboardToolbar = ({
|
|
27
27
|
content,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","StyleSheet","Text","View","FocusedInputEvents","KeyboardStickyView","KeyboardControllerNative","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","DEFAULT_OPACITY","dismissKeyboard","dismiss","goToNextField","setFocusTo","goToPrevField","KeyboardToolbar","content","theme","doneText","button","icon","showArrows","onNextCallback","onPrevCallback","onDoneCallback","blur","opacity","offset","closed","opened","enabled","rest","colorScheme","inputs","setInputs","current","count","isPrevDisabled","isNextDisabled","subscription","addListener","e","remove","doneStyle","styles","doneButton","color","primary","toolbarStyle","toolbar","backgroundColor","background","ButtonContainer","IconContainer","onPressNext","onPressPrev","onPressDone","createElement","_extends","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, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\n\nimport {\n FocusedInputEvents,\n} from \"../../bindings\";\nimport KeyboardStickyView from \"../KeyboardStickyView\"\nimport { KeyboardControllerNative } from \"../../bindings\";\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport Arrow from \"./Arrow\";\nimport Button from \"./Button\";\nimport { colors } from \"./colors\";\n\nimport type { HEX, KeyboardToolbarTheme } from \"./types\";\nimport type { KeyboardStickyViewProps } from \"../KeyboardStickyView\";\nimport type { ReactNode } from \"react\";\nimport type { ViewProps } from \"react-native\";\n\nexport type KeyboardToolbarProps = Omit<\n ViewProps,\n \"style\" | \"testID\" | \"children\"\n> & {\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 /**\n * A callback that is called when the user presses the next button along with the default action.\n */\n onNextCallback?: () => void;\n /**\n * A callback that is called when the user presses the previous button along with the default action.\n */\n onPrevCallback?: () => void;\n /**\n * A callback that is called when the user presses the done button along with the default action.\n */\n onDoneCallback?: () => void;\n /**\n * A component that applies blur effect to the toolbar.\n */\n blur?: JSX.Element | null;\n /**\n * A value for container opacity in hexadecimal format (e.g. `ff`). Default value is `ff`.\n */\n opacity?: HEX;\n} & Pick<KeyboardStickyViewProps, \"offset\" | \"enabled\">;\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 DEFAULT_OPACITY: HEX = \"FF\";\n\nconst dismissKeyboard = () => KeyboardControllerNative.dismiss(false);\nconst goToNextField = () => KeyboardControllerNative.setFocusTo(\"next\");\nconst goToPrevField = () => KeyboardControllerNative.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 onNextCallback,\n onPrevCallback,\n onDoneCallback,\n blur = null,\n opacity = DEFAULT_OPACITY,\n offset: { closed = 0, opened = 0 } = {},\n enabled = true,\n ...rest\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}${opacity}`,\n },\n ],\n [colorScheme, opacity, theme],\n );\n const offset = useMemo(\n () => ({ closed: closed + KEYBOARD_TOOLBAR_HEIGHT, opened }),\n [closed, opened],\n );\n const ButtonContainer = button || Button;\n const IconContainer = icon || Arrow;\n\n const onPressNext = useCallback(() => {\n goToNextField();\n onNextCallback?.();\n }, [onNextCallback]);\n const onPressPrev = useCallback(() => {\n goToPrevField();\n onPrevCallback?.();\n }, [onPrevCallback]);\n const onPressDone = useCallback(() => {\n dismissKeyboard();\n onDoneCallback?.();\n }, [onDoneCallback]);\n\n return (\n <KeyboardStickyView enabled={enabled} offset={offset}>\n <View {...rest} style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>\n {blur}\n {showArrows && (\n <>\n <ButtonContainer\n accessibilityLabel=\"Previous\"\n accessibilityHint=\"Will move focus to previous field\"\n disabled={isPrevDisabled}\n onPress={onPressPrev}\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={onPressNext}\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={onPressDone}\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,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACxE,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAErD,SACEC,kBAAkB,QACb,gBAAgB;AACvB,OAAOC,kBAAkB,MAAM,uBAAuB;AACtD,SAASC,wBAAwB,QAAQ,gBAAgB;AACzD,OAAOC,cAAc,MAAM,yBAAyB;AAEpD,OAAOC,KAAK,MAAM,SAAS;AAC3B,OAAOC,MAAM,MAAM,UAAU;AAC7B,SAASC,MAAM,QAAQ,UAAU;AAgDjC,MAAMC,wBAAwB,GAAG,kBAAkB;AACnD,MAAMC,iCAAiC,GAAG,GAAGD,wBAAwB,WAAW;AAChF,MAAME,6BAA6B,GAAG,GAAGF,wBAAwB,OAAO;AACxE,MAAMG,gCAAgC,GAAG,GAAGH,wBAAwB,UAAU;AAC9E,MAAMI,6BAA6B,GAAG,GAAGJ,wBAAwB,OAAO;AAExE,MAAMK,uBAAuB,GAAG,EAAE;AAClC,MAAMC,eAAoB,GAAG,IAAI;AAEjC,MAAMC,eAAe,GAAGA,CAAA,KAAMZ,wBAAwB,CAACa,OAAO,CAAC,KAAK,CAAC;AACrE,MAAMC,aAAa,GAAGA,CAAA,KAAMd,wBAAwB,CAACe,UAAU,CAAC,MAAM,CAAC;AACvE,MAAMC,aAAa,GA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b,CACY,CAAC;AAEzB,CAAC;AAED,MAAM0B,MAAM,GAAGnD,UAAU,CAAC8E,MAAM,CAAC;EAC/BJ,IAAI,EAAE;IACJA,IAAI,EAAE;EACR,CAAC;EACDlB,OAAO,EAAE;IACPuB,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,KAAK;IACpBC,MAAM,EAAErE,uBAAuB;IAC/BsE,iBAAiB,EAAE;EACrB,CAAC;EACDjC,UAAU,EAAE;IACVkC,UAAU,EAAE,KAAK;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACDX,mBAAmB,EAAE;IACnBY,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAEF,SAAS/E,MAAM,IAAIgF,2BAA2B;AAC9C,eAAenE,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","StyleSheet","Text","View","FocusedInputEvents","KeyboardStickyView","KeyboardControllerNative","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","DEFAULT_OPACITY","dismissKeyboard","dismiss","goToNextField","setFocusTo","goToPrevField","KeyboardToolbar","content","theme","doneText","button","icon","showArrows","onNextCallback","onPrevCallback","onDoneCallback","blur","opacity","offset","closed","opened","enabled","rest","colorScheme","inputs","setInputs","current","count","isPrevDisabled","isNextDisabled","subscription","addListener","e","remove","doneStyle","styles","doneButton","color","primary","toolbarStyle","toolbar","backgroundColor","background","ButtonContainer","IconContainer","onPressNext","onPressPrev","onPressDone","createElement","_extends","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, { useCallback, useEffect, useMemo, useState } from \"react\";\r\nimport { StyleSheet, Text, View } from \"react-native\";\r\n\r\nimport {\r\n FocusedInputEvents,\r\n} from \"../../bindings\";\r\nimport KeyboardStickyView from \"../KeyboardStickyView\"\r\nimport { KeyboardControllerNative } from \"../../bindings\";\r\nimport useColorScheme from \"../hooks/useColorScheme\";\r\n\r\nimport Arrow from \"./Arrow\";\r\nimport Button from \"./Button\";\r\nimport { colors } from \"./colors\";\r\n\r\nimport type { HEX, KeyboardToolbarTheme } from \"./types\";\r\nimport type { KeyboardStickyViewProps } from \"../KeyboardStickyView\";\r\nimport type { ReactNode } from \"react\";\r\nimport type { ViewProps } from \"react-native\";\r\n\r\nexport type KeyboardToolbarProps = Omit<\r\n ViewProps,\r\n \"style\" | \"testID\" | \"children\"\r\n> & {\r\n /** An element that is shown in the middle of the toolbar. */\r\n content?: JSX.Element | null;\r\n /** A set of dark/light colors consumed by toolbar component. */\r\n theme?: KeyboardToolbarTheme;\r\n /** Custom text for done button. */\r\n doneText?: ReactNode;\r\n /** Custom touchable component for toolbar (used for prev/next/done buttons). */\r\n button?: typeof Button;\r\n /** Custom icon component used to display next/prev buttons. */\r\n icon?: typeof Arrow;\r\n /**\r\n * Whether to show next and previous buttons. Can be useful to set it to `false` if you have only one input\r\n * and want to show only `Done` button. Default to `true`.\r\n */\r\n showArrows?: boolean;\r\n /**\r\n * A callback that is called when the user presses the next button along with the default action.\r\n */\r\n onNextCallback?: () => void;\r\n /**\r\n * A callback that is called when the user presses the previous button along with the default action.\r\n */\r\n onPrevCallback?: () => void;\r\n /**\r\n * A callback that is called when the user presses the done button along with the default action.\r\n */\r\n onDoneCallback?: () => void;\r\n /**\r\n * A component that applies blur effect to the toolbar.\r\n */\r\n blur?: JSX.Element | null;\r\n /**\r\n * A value for container opacity in hexadecimal format (e.g. `ff`). Default value is `ff`.\r\n */\r\n opacity?: HEX;\r\n} & Pick<KeyboardStickyViewProps, \"offset\" | \"enabled\">;\r\n\r\nconst TEST_ID_KEYBOARD_TOOLBAR = \"keyboard.toolbar\";\r\nconst TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;\r\nconst TEST_ID_KEYBOARD_TOOLBAR_NEXT = `${TEST_ID_KEYBOARD_TOOLBAR}.next`;\r\nconst TEST_ID_KEYBOARD_TOOLBAR_CONTENT = `${TEST_ID_KEYBOARD_TOOLBAR}.content`;\r\nconst TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;\r\n\r\nconst KEYBOARD_TOOLBAR_HEIGHT = 42;\r\nconst DEFAULT_OPACITY: HEX = \"FF\";\r\n\r\nconst dismissKeyboard = () => KeyboardControllerNative.dismiss(false);\r\nconst goToNextField = () => KeyboardControllerNative.setFocusTo(\"next\");\r\nconst goToPrevField = () => KeyboardControllerNative.setFocusTo(\"prev\");\r\n\r\n/**\r\n * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and\r\n * `Done` buttons.\r\n */\r\nconst KeyboardToolbar: React.FC<KeyboardToolbarProps> = ({\r\n content,\r\n theme = colors,\r\n doneText,\r\n button,\r\n icon,\r\n showArrows = true,\r\n onNextCallback,\r\n onPrevCallback,\r\n onDoneCallback,\r\n blur = null,\r\n opacity = DEFAULT_OPACITY,\r\n offset: { closed = 0, opened = 0 } = {},\r\n enabled = true,\r\n ...rest\r\n}) => {\r\n const colorScheme = useColorScheme();\r\n const [inputs, setInputs] = useState({\r\n current: 0,\r\n count: 0,\r\n });\r\n const isPrevDisabled = inputs.current === 0;\r\n const isNextDisabled = inputs.current === inputs.count - 1;\r\n\r\n useEffect(() => {\r\n const subscription = FocusedInputEvents.addListener(\"focusDidSet\", (e) => {\r\n setInputs(e);\r\n });\r\n\r\n return subscription.remove;\r\n }, []);\r\n const doneStyle = useMemo(\r\n () => [styles.doneButton, { color: theme[colorScheme].primary }],\r\n [colorScheme, theme],\r\n );\r\n const toolbarStyle = useMemo(\r\n () => [\r\n styles.toolbar,\r\n {\r\n backgroundColor: `${theme[colorScheme].background}${opacity}`,\r\n },\r\n ],\r\n [colorScheme, opacity, theme],\r\n );\r\n const offset = useMemo(\r\n () => ({ closed: closed + KEYBOARD_TOOLBAR_HEIGHT, opened }),\r\n [closed, opened],\r\n );\r\n const ButtonContainer = button || Button;\r\n const IconContainer = icon || Arrow;\r\n\r\n const onPressNext = useCallback(() => {\r\n goToNextField();\r\n onNextCallback?.();\r\n }, [onNextCallback]);\r\n const onPressPrev = useCallback(() => {\r\n goToPrevField();\r\n onPrevCallback?.();\r\n }, [onPrevCallback]);\r\n const onPressDone = useCallback(() => {\r\n dismissKeyboard();\r\n onDoneCallback?.();\r\n }, [onDoneCallback]);\r\n\r\n return (\r\n <KeyboardStickyView enabled={enabled} offset={offset}>\r\n <View {...rest} style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>\r\n {blur}\r\n {showArrows && (\r\n <>\r\n <ButtonContainer\r\n accessibilityLabel=\"Previous\"\r\n accessibilityHint=\"Will move focus to previous field\"\r\n disabled={isPrevDisabled}\r\n onPress={onPressPrev}\r\n testID={TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS}\r\n theme={theme}\r\n >\r\n <IconContainer\r\n disabled={isPrevDisabled}\r\n type=\"prev\"\r\n theme={theme}\r\n />\r\n </ButtonContainer>\r\n <ButtonContainer\r\n accessibilityLabel=\"Next\"\r\n accessibilityHint=\"Will move focus to next field\"\r\n disabled={isNextDisabled}\r\n onPress={onPressNext}\r\n testID={TEST_ID_KEYBOARD_TOOLBAR_NEXT}\r\n theme={theme}\r\n >\r\n <IconContainer\r\n disabled={isNextDisabled}\r\n type=\"next\"\r\n theme={theme}\r\n />\r\n </ButtonContainer>\r\n </>\r\n )}\r\n\r\n <View style={styles.flex} testID={TEST_ID_KEYBOARD_TOOLBAR_CONTENT}>\r\n {content}\r\n </View>\r\n <ButtonContainer\r\n accessibilityLabel=\"Done\"\r\n accessibilityHint=\"Will close the keyboard\"\r\n onPress={onPressDone}\r\n testID={TEST_ID_KEYBOARD_TOOLBAR_DONE}\r\n rippleRadius={28}\r\n style={styles.doneButtonContainer}\r\n theme={theme}\r\n >\r\n <Text style={doneStyle} maxFontSizeMultiplier={1.3}>\r\n {doneText || \"Done\"}\r\n </Text>\r\n </ButtonContainer>\r\n </View>\r\n </KeyboardStickyView>\r\n );\r\n};\r\n\r\nconst styles = StyleSheet.create({\r\n flex: {\r\n flex: 1,\r\n },\r\n toolbar: {\r\n position: \"absolute\",\r\n bottom: 0,\r\n alignItems: \"center\",\r\n width: \"100%\",\r\n flexDirection: \"row\",\r\n height: KEYBOARD_TOOLBAR_HEIGHT,\r\n paddingHorizontal: 8,\r\n },\r\n doneButton: {\r\n fontWeight: \"600\",\r\n fontSize: 15,\r\n },\r\n doneButtonContainer: {\r\n marginRight: 8,\r\n },\r\n});\r\n\r\nexport { colors as DefaultKeyboardToolbarTheme };\r\nexport default KeyboardToolbar;\r\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACxE,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAErD,SACEC,kBAAkB,QACb,gBAAgB;AACvB,OAAOC,kBAAkB,MAAM,uBAAuB;AACtD,SAASC,wBAAwB,QAAQ,gBAAgB;AACzD,OAAOC,cAAc,MAAM,yBAAyB;AAEpD,OAAOC,KAAK,MAAM,SAAS;AAC3B,OAAOC,MAAM,MAAM,UAAU;AAC7B,SAASC,MAAM,QAAQ,UAAU;AAgDjC,MAAMC,wBAAwB,GAAG,kBAAkB;AACnD,MAAMC,iCAAiC,GAAG,GAAGD,wBAAwB,WAAW;AAChF,MAAME,6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eACP5B,KAAA,CAAAqE,aAAA,CAACL,eAAe;IACdU,kBAAkB,EAAC,MAAM;IACzBC,iBAAiB,EAAC,yBAAyB;IAC3CE,OAAO,EAAET,WAAY;IACrBI,MAAM,EAAErD,6BAA8B;IACtC6D,YAAY,EAAE,EAAG;IACjBT,KAAK,EAAEf,MAAM,CAACyB,mBAAoB;IAClCpD,KAAK,EAAEA;EAAM,gBAEb7B,KAAA,CAAAqE,aAAA,CAAC/D,IAAI;IAACiE,KAAK,EAAEhB,SAAU;IAAC2B,qBAAqB,EAAE;EAAI,GAChDpD,QAAQ,IAAI,MACT,CACS,CACb,CACY,CAAC;AAEzB,CAAC;AAED,MAAM0B,MAAM,GAAGnD,UAAU,CAAC8E,MAAM,CAAC;EAC/BJ,IAAI,EAAE;IACJA,IAAI,EAAE;EACR,CAAC;EACDlB,OAAO,EAAE;IACPuB,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,KAAK;IACpBC,MAAM,EAAErE,uBAAuB;IAC/BsE,iBAAiB,EAAE;EACrB,CAAC;EACDjC,UAAU,EAAE;IACVkC,UAAU,EAAE,KAAK;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACDX,mBAAmB,EAAE;IACnBY,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAEF,SAAS/E,MAAM,IAAIgF,2BAA2B;AAC9C,eAAenE,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: string;\n /** Color for ripple effect (on button touch) on Android */\n ripple: ColorValue;\n};\nexport type KeyboardToolbarTheme = {\n light: Theme;\n dark: Theme;\n};\ntype HexSymbol =\n | \"0\"\n | \"1\"\n | \"2\"\n | \"3\"\n | \"4\"\n | \"5\"\n | \"6\"\n | \"7\"\n | \"8\"\n | \"9\"\n | \"A\"\n | \"B\"\n | \"C\"\n | \"D\"\n | \"E\"\n | \"F\"\n | \"a\"\n | \"b\"\n | \"c\"\n | \"d\"\n | \"e\"\n | \"f\";\nexport type HEX = `${HexSymbol}${HexSymbol}`;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { ColorValue } from \"react-native\";\r\n\r\ntype Theme = {\r\n /** Color for arrow when it's enabled */\r\n primary: ColorValue;\r\n /** Color for arrow when it's disabled */\r\n disabled: ColorValue;\r\n /** Keyboard toolbar background color */\r\n background: string;\r\n /** Color for ripple effect (on button touch) on Android */\r\n ripple: ColorValue;\r\n};\r\nexport type KeyboardToolbarTheme = {\r\n light: Theme;\r\n dark: Theme;\r\n};\r\ntype HexSymbol =\r\n | \"0\"\r\n | \"1\"\r\n | \"2\"\r\n | \"3\"\r\n | \"4\"\r\n | \"5\"\r\n | \"6\"\r\n | \"7\"\r\n | \"8\"\r\n | \"9\"\r\n | \"A\"\r\n | \"B\"\r\n | \"C\"\r\n | \"D\"\r\n | \"E\"\r\n | \"F\"\r\n | \"a\"\r\n | \"b\"\r\n | \"c\"\r\n | \"d\"\r\n | \"e\"\r\n | \"f\";\r\nexport type HEX = `${HexSymbol}${HexSymbol}`;\r\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { useColorScheme as useColorSchemeRN } from "react-native";
|
|
2
|
-
const useColorScheme = () => useColorSchemeRN()
|
|
2
|
+
const useColorScheme = () => useColorSchemeRN() === "dark" ? "dark" : "light";
|
|
3
3
|
export default useColorScheme;
|
|
4
4
|
//# sourceMappingURL=useColorScheme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useColorScheme","useColorSchemeRN"],"sources":["useColorScheme.ts"],"sourcesContent":["import { useColorScheme as useColorSchemeRN } from \"react-native\";\n\nconst useColorScheme = ()
|
|
1
|
+
{"version":3,"names":["useColorScheme","useColorSchemeRN"],"sources":["useColorScheme.ts"],"sourcesContent":["import { useColorScheme as useColorSchemeRN } from \"react-native\";\r\n\r\nconst useColorScheme = (): \"light\" | \"dark\" =>\r\n\tuseColorSchemeRN() === \"dark\" ? \"dark\" : \"light\";\r\n\r\nexport default useColorScheme;\r\n"],"mappings":"AAAA,SAASA,cAAc,IAAIC,gBAAgB,QAAQ,cAAc;AAEjE,MAAMD,cAAc,GAAGA,CAAA,KACtBC,gBAAgB,CAAC,CAAC,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO;AAEjD,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 { KeyboardAvoidingViewProps } from \"./KeyboardAvoidingView\";\nexport type { KeyboardStickyViewProps } from \"./KeyboardStickyView\";\nexport type { KeyboardAwareScrollViewProps } from \"./KeyboardAwareScrollView\";\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":[]}
|
|
1
|
+
{"version":3,"names":["default","KeyboardAvoidingView","KeyboardStickyView","KeyboardAwareScrollView","KeyboardToolbar","DefaultKeyboardToolbarTheme"],"sources":["index.ts"],"sourcesContent":["export { default as KeyboardAvoidingView } from \"./KeyboardAvoidingView\";\r\nexport { default as KeyboardStickyView } from \"./KeyboardStickyView\";\r\nexport { default as KeyboardAwareScrollView } from \"./KeyboardAwareScrollView\";\r\nexport {\r\n default as KeyboardToolbar,\r\n DefaultKeyboardToolbarTheme,\r\n} from \"./KeyboardToolbar\";\r\nexport type { KeyboardAvoidingViewProps } from \"./KeyboardAvoidingView\";\r\nexport type { KeyboardStickyViewProps } from \"./KeyboardStickyView\";\r\nexport type { KeyboardAwareScrollViewProps } from \"./KeyboardAwareScrollView\";\r\nexport type { KeyboardToolbarProps } from \"./KeyboardToolbar\";\r\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":[]}
|
|
@@ -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,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;EAa/B;EACA;EAdUA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["AndroidSoftInputModes"],"sources":["constants.ts"],"sourcesContent":["// copied from `android.view.WindowManager.LayoutParams`\r\nexport enum AndroidSoftInputModes {\r\n SOFT_INPUT_ADJUST_NOTHING = 48,\r\n SOFT_INPUT_ADJUST_PAN = 32,\r\n SOFT_INPUT_ADJUST_RESIZE = 16,\r\n SOFT_INPUT_ADJUST_UNSPECIFIED = 0,\r\n SOFT_INPUT_IS_FORWARD_NAVIGATION = 256,\r\n SOFT_INPUT_MASK_ADJUST = 240,\r\n SOFT_INPUT_MASK_STATE = 15,\r\n SOFT_INPUT_MODE_CHANGED = 512,\r\n SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3,\r\n SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5,\r\n SOFT_INPUT_STATE_HIDDEN = 2,\r\n SOFT_INPUT_STATE_UNCHANGED = 1,\r\n // temporarily disable this rule to avoid breaking changes.\r\n // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values\r\n SOFT_INPUT_STATE_UNSPECIFIED = 0,\r\n SOFT_INPUT_STATE_VISIBLE = 4,\r\n}\r\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;EAa/B;EACA;EAdUA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","useContext","Animated","NOOP","NESTED_NOOP","withSharedValue","value","addListener","removeListener","modify","get","set","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 NESTED_NOOP = () => NOOP;\nconst withSharedValue = <T>(value: T): SharedValue<T> => ({\n value,\n addListener: NOOP,\n removeListener: NOOP,\n modify: NOOP,\n get: () => value,\n set: 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: NESTED_NOOP,\n setInputHandlers: NESTED_NOOP,\n setEnabled: NOOP,\n};\nexport const KeyboardContext = createContext(defaultContext);\nexport const useKeyboardContext = () => {\n const context = useContext(KeyboardContext);\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,WAAW,GAAGA,CAAA,KAAMD,IAAI;AAC9B,MAAME,eAAe,GAAOC,KAAQ,KAAsB;EACxDA,KAAK;EACLC,WAAW,EAAEJ,IAAI;EACjBK,cAAc,EAAEL,IAAI;EACpBM,MAAM,EAAEN,IAAI;EACZO,GAAG,EAAEA,CAAA,KAAMJ,KAAK;EAChBK,GAAG,EAAER;AACP,CAAC,CAAC;AACF,MAAMS,oBAAoB,GAAGP,eAAe,CAAC,CAAC,CAAC;AAC/C,MAAMQ,cAAc,GAAGR,eAAe,CACpC,IACF,CAAC;AACD,MAAMS,cAAwC,GAAG;EAC/CC,OAAO,EAAE,IAAI;EACbC,QAAQ,EAAE;IACRC,QAAQ,EAAE,IAAIf,QAAQ,CAACgB,KAAK,CAAC,CAAC,CAAC;IAC/BC,MAAM,EAAE,IAAIjB,QAAQ,CAACgB,KAAK,CAAC,CAAC;EAC9B,CAAC;EACDE,UAAU,EAAE;IACVH,QAAQ,EAAEL,oBAAoB;IAC9BO,MAAM,EAAEP;EACV,CAAC;EACDS,MAAM,EAAER,cAAc;EACtBS,mBAAmB,EAAElB,WAAW;EAChCmB,gBAAgB,EAAEnB,WAAW;EAC7BoB,UAAU,EAAErB;AACd,CAAC;AACD,OAAO,MAAMsB,eAAe,gBAAGzB,aAAa,CAACc,cAAc,CAAC;AAC5D,OAAO,MAAMY,kBAAkB,GAAGA,CAAA,KAAM;EACtC,MAAMC,OAAO,GAAG1B,UAAU,CAACwB,eAAe,CAAC;EAC3C,IAAIG,OAAO,IAAID,OAAO,KAAKb,cAAc,EAAE;IACzCe,OAAO,CAACC,IAAI,CACV,sLACF,CAAC;EACH;EAEA,OAAOH,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["createContext","useContext","Animated","NOOP","NESTED_NOOP","withSharedValue","value","addListener","removeListener","modify","get","set","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\";\r\nimport { Animated } from \"react-native\";\r\n\r\nimport type {\r\n FocusedInputHandlers,\r\n FocusedInputLayoutChangedEvent,\r\n KeyboardHandlers,\r\n} from \"./types\";\r\nimport type React from \"react\";\r\nimport type { SharedValue } from \"react-native-reanimated\";\r\n\r\nexport type AnimatedContext = {\r\n progress: Animated.Value;\r\n height: Animated.AnimatedMultiplication<number>;\r\n};\r\nexport type ReanimatedContext = {\r\n progress: SharedValue<number>;\r\n height: SharedValue<number>;\r\n};\r\nexport type KeyboardAnimationContext = {\r\n enabled: boolean;\r\n animated: AnimatedContext;\r\n reanimated: ReanimatedContext;\r\n layout: SharedValue<FocusedInputLayoutChangedEvent | null>;\r\n setKeyboardHandlers: (handlers: KeyboardHandlers) => void;\r\n setInputHandlers: (handlers: FocusedInputHandlers) => void;\r\n setEnabled: React.Dispatch<React.SetStateAction<boolean>>;\r\n};\r\nconst NOOP = () => {};\r\nconst NESTED_NOOP = () => NOOP;\r\nconst withSharedValue = <T>(value: T): SharedValue<T> => ({\r\n value,\r\n addListener: NOOP,\r\n removeListener: NOOP,\r\n modify: NOOP,\r\n get: () => value,\r\n set: NOOP,\r\n});\r\nconst DEFAULT_SHARED_VALUE = withSharedValue(0);\r\nconst DEFAULT_LAYOUT = withSharedValue<FocusedInputLayoutChangedEvent | null>(\r\n null,\r\n);\r\nconst defaultContext: KeyboardAnimationContext = {\r\n enabled: true,\r\n animated: {\r\n progress: new Animated.Value(0),\r\n height: new Animated.Value(0),\r\n },\r\n reanimated: {\r\n progress: DEFAULT_SHARED_VALUE,\r\n height: DEFAULT_SHARED_VALUE,\r\n },\r\n layout: DEFAULT_LAYOUT,\r\n setKeyboardHandlers: NESTED_NOOP,\r\n setInputHandlers: NESTED_NOOP,\r\n setEnabled: NOOP,\r\n};\r\nexport const KeyboardContext = createContext(defaultContext);\r\nexport const useKeyboardContext = () => {\r\n const context = useContext(KeyboardContext);\r\n if (__DEV__ && context === defaultContext) {\r\n console.warn(\r\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.\",\r\n );\r\n }\r\n\r\n return context;\r\n};\r\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,UAAU,QAAQ,OAAO;AACjD,SAASC,QAAQ,QAAQ,cAAc;AA2BvC,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,MAAMC,WAAW,GAAGA,CAAA,KAAMD,IAAI;AAC9B,MAAME,eAAe,GAAOC,KAAQ,KAAsB;EACxDA,KAAK;EACLC,WAAW,EAAEJ,IAAI;EACjBK,cAAc,EAAEL,IAAI;EACpBM,MAAM,EAAEN,IAAI;EACZO,GAAG,EAAEA,CAAA,KAAMJ,KAAK;EAChBK,GAAG,EAAER;AACP,CAAC,CAAC;AACF,MAAMS,oBAAoB,GAAGP,eAAe,CAAC,CAAC,CAAC;AAC/C,MAAMQ,cAAc,GAAGR,eAAe,CACpC,IACF,CAAC;AACD,MAAMS,cAAwC,GAAG;EAC/CC,OAAO,EAAE,IAAI;EACbC,QAAQ,EAAE;IACRC,QAAQ,EAAE,IAAIf,QAAQ,CAACgB,KAAK,CAAC,CAAC,CAAC;IAC/BC,MAAM,EAAE,IAAIjB,QAAQ,CAACgB,KAAK,CAAC,CAAC;EAC9B,CAAC;EACDE,UAAU,EAAE;IACVH,QAAQ,EAAEL,oBAAoB;IAC9BO,MAAM,EAAEP;EACV,CAAC;EACDS,MAAM,EAAER,cAAc;EACtBS,mBAAmB,EAAElB,WAAW;EAChCmB,gBAAgB,EAAEnB,WAAW;EAC7BoB,UAAU,EAAErB;AACd,CAAC;AACD,OAAO,MAAMsB,eAAe,gBAAGzB,aAAa,CAACc,cAAc,CAAC;AAC5D,OAAO,MAAMY,kBAAkB,GAAGA,CAAA,KAAM;EACtC,MAAMC,OAAO,GAAG1B,UAAU,CAACwB,eAAe,CAAC;EAC3C,IAAIG,OAAO,IAAID,OAAO,KAAKb,cAAc,EAAE;IACzCe,OAAO,CAACC,IAAI,CACV,sLACF,CAAC;EACH;EAEA,OAAOH,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","AndroidSoftInputModes","useKeyboardContext","uuid","KeyboardController","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":["index.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport { AndroidSoftInputModes } from \"../constants\";\nimport { useKeyboardContext } from \"../context\";\nimport { uuid } from \"../utils\";\nimport { KeyboardController } from \"../module\";\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\nexport * from \"./useWindowDimensions\";\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SAASC,qBAAqB,QAAQ,cAAc;AACpD,SAASC,kBAAkB,QAAQ,YAAY;AAC/C,SAASC,IAAI,QAAQ,UAAU;AAC/B,SAASC,kBAAkB,QAAQ,WAAW;AAM9C,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjCL,SAAS,CAAC,MAAM;IACdI,kBAAkB,CAACE,YAAY,CAC7BL,qBAAqB,CAACM,wBACxB,CAAC;IAED,OAAO,MAAMH,kBAAkB,CAACI,cAAc,CAAC,CAAC;EAClD,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAED,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAAuB;EACzDJ,aAAa,CAAC,CAAC;EACf,MAAMK,OAAO,GAAGR,kBAAkB,CAAC,CAAC;EAEpC,OAAOQ,OAAO,CAACC,QAAQ;AACzB,CAAC;AAED,OAAO,MAAMC,8BAA8B,GAAGA,CAAA,KAAyB;EACrEP,aAAa,CAAC,CAAC;EACf,MAAMK,OAAO,GAAGR,kBAAkB,CAAC,CAAC;EAEpC,OAAOQ,OAAO,CAACG,UAAU;AAC3B,CAAC;AAED,OAAO,SAASC,yBAAyBA,CACvCC,OAAwB,EACxBC,IAAqB,EACrB;EACA,MAAMN,OAAO,GAAGR,kBAAkB,CAAC,CAAC;EAEpCF,SAAS,CAAC,MAAM;IACd,MAAMiB,GAAG,GAAGd,IAAI,CAAC,CAAC;IAElBO,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,GAAGR,kBAAkB,CAAC,CAAC;EAEpC,OAAO;IAAEoB,UAAU,EAAEZ,OAAO,CAACY,UAAU;IAAEC,OAAO,EAAEb,OAAO,CAACa;EAAQ,CAAC;AACrE;AAEA,OAAO,SAASC,yBAAyBA,CAAA,EAAG;EAC1C,MAAMd,OAAO,GAAGR,kBAAkB,CAAC,CAAC;EAEpC,OAAO;IAAEuB,KAAK,EAAEf,OAAO,CAACgB;EAAO,CAAC;AAClC;AAEA,OAAO,SAASC,sBAAsBA,CACpCZ,OAA6B,EAC7BC,IAAqB,EACrB;EACA,MAAMN,OAAO,GAAGR,kBAAkB,CAAC,CAAC;EAEpCF,SAAS,CAAC,MAAM;IACd,MAAMiB,GAAG,GAAGd,IAAI,CAAC,CAAC;IAElBO,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;AAEA,cAAc,uBAAuB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useEffect","AndroidSoftInputModes","useKeyboardContext","uuid","KeyboardController","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":["index.ts"],"sourcesContent":["import { useEffect } from \"react\";\r\n\r\nimport { AndroidSoftInputModes } from \"../constants\";\r\nimport { useKeyboardContext } from \"../context\";\r\nimport { uuid } from \"../utils\";\r\nimport { KeyboardController } from \"../module\";\r\n\r\nimport type { AnimatedContext, ReanimatedContext } from \"../context\";\r\nimport type { FocusedInputHandler, KeyboardHandler } from \"../types\";\r\nimport type { DependencyList } from \"react\";\r\n\r\nexport const useResizeMode = () => {\r\n useEffect(() => {\r\n KeyboardController.setInputMode(\r\n AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,\r\n );\r\n\r\n return () => KeyboardController.setDefaultMode();\r\n }, []);\r\n};\r\n\r\nexport const useKeyboardAnimation = (): AnimatedContext => {\r\n useResizeMode();\r\n const context = useKeyboardContext();\r\n\r\n return context.animated;\r\n};\r\n\r\nexport const useReanimatedKeyboardAnimation = (): ReanimatedContext => {\r\n useResizeMode();\r\n const context = useKeyboardContext();\r\n\r\n return context.reanimated;\r\n};\r\n\r\nexport function useGenericKeyboardHandler(\r\n handler: KeyboardHandler,\r\n deps?: DependencyList,\r\n) {\r\n const context = useKeyboardContext();\r\n\r\n useEffect(() => {\r\n const key = uuid();\r\n\r\n context.setKeyboardHandlers({ [key]: handler });\r\n\r\n return () => {\r\n context.setKeyboardHandlers({ [key]: undefined });\r\n };\r\n }, deps);\r\n}\r\n\r\nexport function useKeyboardHandler(\r\n handler: KeyboardHandler,\r\n deps?: DependencyList,\r\n) {\r\n useResizeMode();\r\n useGenericKeyboardHandler(handler, deps);\r\n}\r\n\r\nexport function useKeyboardController() {\r\n const context = useKeyboardContext();\r\n\r\n return { setEnabled: context.setEnabled, enabled: context.enabled };\r\n}\r\n\r\nexport function useReanimatedFocusedInput() {\r\n const context = useKeyboardContext();\r\n\r\n return { input: context.layout };\r\n}\r\n\r\nexport function useFocusedInputHandler(\r\n handler?: FocusedInputHandler,\r\n deps?: DependencyList,\r\n) {\r\n const context = useKeyboardContext();\r\n\r\n useEffect(() => {\r\n const key = uuid();\r\n\r\n context.setInputHandlers({ [key]: handler });\r\n\r\n return () => {\r\n context.setInputHandlers({ [key]: undefined });\r\n };\r\n }, deps);\r\n}\r\n\r\nexport * from \"./useWindowDimensions\";\r\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SAASC,qBAAqB,QAAQ,cAAc;AACpD,SAASC,kBAAkB,QAAQ,YAAY;AAC/C,SAASC,IAAI,QAAQ,UAAU;AAC/B,SAASC,kBAAkB,QAAQ,WAAW;AAM9C,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjCL,SAAS,CAAC,MAAM;IACdI,kBAAkB,CAACE,YAAY,CAC7BL,qBAAqB,CAACM,wBACxB,CAAC;IAED,OAAO,MAAMH,kBAAkB,CAACI,cAAc,CAAC,CAAC;EAClD,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAED,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAAuB;EACzDJ,aAAa,CAAC,CAAC;EACf,MAAMK,OAAO,GAAGR,kBAAkB,CAAC,CAAC;EAEpC,OAAOQ,OAAO,CAACC,QAAQ;AACzB,CAAC;AAED,OAAO,MAAMC,8BAA8B,GAAGA,CAAA,KAAyB;EACrEP,aAAa,CAAC,CAAC;EACf,MAAMK,OAAO,GAAGR,kBAAkB,CAAC,CAAC;EAEpC,OAAOQ,OAAO,CAACG,UAAU;AAC3B,CAAC;AAED,OAAO,SAASC,yBAAyBA,CACvCC,OAAwB,EACxBC,IAAqB,EACrB;EACA,MAAMN,OAAO,GAAGR,kBAAkB,CAAC,CAAC;EAEpCF,SAAS,CAAC,MAAM;IACd,MAAMiB,GAAG,GAAGd,IAA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Dimensions","width","height","addListener","e","useWindowDimensions","dimensions","setDimensions","subscription","remove"],"sources":["index.android.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\n\nimport { WindowDimensionsEvents } from \"../../bindings\";\n\nimport type { WindowDimensionsEventData } from \"../../types\";\n\nlet initialDimensions: WindowDimensionsEventData = {\n width: 0,\n height: 0,\n};\n\nWindowDimensionsEvents.addListener(\"windowDidResize\", (e) => {\n initialDimensions = e;\n});\n\nexport const useWindowDimensions = () => {\n const [dimensions, setDimensions] = useState(initialDimensions);\n\n useEffect(() => {\n const subscription = WindowDimensionsEvents.addListener(\n \"windowDidResize\",\n (e) => {\n setDimensions(e);\n },\n );\n\n // we might have missed an update between reading a value in render and\n // `addListener` in this handler, so we set it here. If there was\n // no change, React will filter out this update as a no-op.\n setDimensions(initialDimensions);\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n return dimensions;\n};\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE3C,SAASC,sBAAsB,QAAQ,gBAAgB;AAIvD,IAAIC,iBAA4C,GAAG;EACjDC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE;AACV,CAAC;AAEDH,sBAAsB,CAACI,WAAW,CAAC,iBAAiB,EAAGC,CAAC,IAAK;EAC3DJ,iBAAiB,GAAGI,CAAC;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGT,QAAQ,CAACE,iBAAiB,CAAC;EAE/DH,SAAS,CAAC,MAAM;IACd,MAAMW,YAAY,GAAGT,sBAAsB,CAACI,WAAW,CACrD,iBAAiB,EAChBC,CAAC,IAAK;MACLG,aAAa,CAACH,CAAC,CAAC;IAClB,CACF,CAAC;;IAED;IACA;IACA;IACAG,aAAa,CAACP,iBAAiB,CAAC;IAEhC,OAAO,MAAM;MACXQ,YAAY,CAACC,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOH,UAAU;AACnB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useEffect","useState","WindowDimensionsEvents","initialDimensions","width","height","addListener","e","useWindowDimensions","dimensions","setDimensions","subscription","remove"],"sources":["index.android.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\r\n\r\nimport { WindowDimensionsEvents } from \"../../bindings\";\r\n\r\nimport type { WindowDimensionsEventData } from \"../../types\";\r\n\r\nlet initialDimensions: WindowDimensionsEventData = {\r\n width: 0,\r\n height: 0,\r\n};\r\n\r\nWindowDimensionsEvents.addListener(\"windowDidResize\", (e) => {\r\n initialDimensions = e;\r\n});\r\n\r\nexport const useWindowDimensions = () => {\r\n const [dimensions, setDimensions] = useState(initialDimensions);\r\n\r\n useEffect(() => {\r\n const subscription = WindowDimensionsEvents.addListener(\r\n \"windowDidResize\",\r\n (e) => {\r\n setDimensions(e);\r\n },\r\n );\r\n\r\n // we might have missed an update between reading a value in render and\r\n // `addListener` in this handler, so we set it here. If there was\r\n // no change, React will filter out this update as a no-op.\r\n setDimensions(initialDimensions);\r\n\r\n return () => {\r\n subscription.remove();\r\n };\r\n }, []);\r\n\r\n return dimensions;\r\n};\r\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE3C,SAASC,sBAAsB,QAAQ,gBAAgB;AAIvD,IAAIC,iBAA4C,GAAG;EACjDC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE;AACV,CAAC;AAEDH,sBAAsB,CAACI,WAAW,CAAC,iBAAiB,EAAGC,CAAC,IAAK;EAC3DJ,iBAAiB,GAAGI,CAAC;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGT,QAAQ,CAACE,iBAAiB,CAAC;EAE/DH,SAAS,CAAC,MAAM;IACd,MAAMW,YAAY,GAAGT,sBAAsB,CAACI,WAAW,CACrD,iBAAiB,EAChBC,CAAC,IAAK;MACLG,aAAa,CAACH,CAAC,CAAC;IAClB,CACF,CAAC;;IAED;IACA;IACA;IACAG,aAAa,CAACP,iBAAiB,CAAC;IAEhC,OAAO,MAAM;MACXQ,YAAY,CAACC,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOH,UAAU;AACnB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useWindowDimensions"],"sources":["index.ts"],"sourcesContent":["export { useWindowDimensions } from \"react-native\";\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useWindowDimensions"],"sources":["index.ts"],"sourcesContent":["export { useWindowDimensions } from \"react-native\";\r\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc","ignoreList":[]}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["KeyboardAvoidingView","KeyboardStickyView","KeyboardAwareScrollView","KeyboardToolbar","DefaultKeyboardToolbarTheme","OverKeyboardView"],"sources":["index.ts"],"sourcesContent":["export * from \"./bindings\";\nexport * from \"./animated\";\nexport * from \"./context\";\nexport * from \"./hooks\";\nexport * from \"./constants\";\nexport * from \"./module\";\nexport * from \"./types\";\n\nexport {\n KeyboardAvoidingView,\n KeyboardStickyView,\n KeyboardAwareScrollView,\n // keyboard toolbar\n KeyboardToolbar,\n DefaultKeyboardToolbarTheme,\n} from \"./components\";\nexport type {\n KeyboardAvoidingViewProps,\n KeyboardStickyViewProps,\n KeyboardAwareScrollViewProps,\n KeyboardToolbarProps,\n} from \"./components\";\nexport { OverKeyboardView } from \"./views\";\n"],"mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,YAAY;AAC1B,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,aAAa;AAC3B,cAAc,UAAU;AACxB,cAAc,SAAS;AAEvB,SACEA,oBAAoB,EACpBC,kBAAkB,EAClBC,uBAAuB;AACvB;AACAC,eAAe,EACfC,2BAA2B,QACtB,cAAc;AAOrB,SAASC,gBAAgB,QAAQ,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["KeyboardAvoidingView","KeyboardStickyView","KeyboardAwareScrollView","KeyboardToolbar","DefaultKeyboardToolbarTheme","OverKeyboardView"],"sources":["index.ts"],"sourcesContent":["export * from \"./bindings\";\r\nexport * from \"./animated\";\r\nexport * from \"./context\";\r\nexport * from \"./hooks\";\r\nexport * from \"./constants\";\r\nexport * from \"./module\";\r\nexport * from \"./types\";\r\n\r\nexport {\r\n KeyboardAvoidingView,\r\n KeyboardStickyView,\r\n KeyboardAwareScrollView,\r\n // keyboard toolbar\r\n KeyboardToolbar,\r\n DefaultKeyboardToolbarTheme,\r\n} from \"./components\";\r\nexport type {\r\n KeyboardAvoidingViewProps,\r\n KeyboardStickyViewProps,\r\n KeyboardAwareScrollViewProps,\r\n KeyboardToolbarProps,\r\n} from \"./components\";\r\nexport { OverKeyboardView } from \"./views\";\r\n"],"mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,YAAY;AAC1B,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,aAAa;AAC3B,cAAc,UAAU;AACxB,cAAc,SAAS;AAEvB,SACEA,oBAAoB,EACpBC,kBAAkB,EAClBC,uBAAuB;AACvB;AACAC,eAAe,EACfC,2BAA2B,QACtB,cAAc;AAOrB,SAASC,gBAAgB,QAAQ,SAAS","ignoreList":[]}
|
package/lib/module/internal.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useCallback, useRef } from "react";
|
|
2
2
|
import { Animated } from "react-native";
|
|
3
3
|
import { useSharedValue } from "react-native-reanimated";
|
|
4
|
-
/**
|
|
5
|
-
* Hook for storing worklet handlers (objects with keys, where values are worklets).
|
|
6
|
-
* Returns methods for setting handlers and broadcasting events in them.
|
|
7
|
-
*
|
|
8
|
-
* T is a generic that looks like:
|
|
9
|
-
* @example
|
|
10
|
-
* {
|
|
11
|
-
* onEvent: () => {},
|
|
12
|
-
* onEvent2: () => {},
|
|
13
|
-
* }
|
|
4
|
+
/**
|
|
5
|
+
* Hook for storing worklet handlers (objects with keys, where values are worklets).
|
|
6
|
+
* Returns methods for setting handlers and broadcasting events in them.
|
|
7
|
+
*
|
|
8
|
+
* T is a generic that looks like:
|
|
9
|
+
* @example
|
|
10
|
+
* {
|
|
11
|
+
* onEvent: () => {},
|
|
12
|
+
* onEvent2: () => {},
|
|
13
|
+
* }
|
|
14
14
|
*/
|
|
15
15
|
export function useSharedHandlers() {
|
|
16
16
|
const handlers = useSharedValue({});
|
|
@@ -47,14 +47,14 @@ export function useSharedHandlers() {
|
|
|
47
47
|
return [setHandlers, broadcast];
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
/**
|
|
51
|
-
* TS variant of `useAnimatedValue` hook which is added in RN 0.71
|
|
52
|
-
* A better alternative of storing animated values in refs, since
|
|
53
|
-
* it doesn't recreate a new `Animated.Value` object on every re-render
|
|
54
|
-
* and therefore consumes less memory. We can not use a variant from
|
|
55
|
-
* RN, since this library supports earlier versions of RN.
|
|
56
|
-
*
|
|
57
|
-
* @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937
|
|
50
|
+
/**
|
|
51
|
+
* TS variant of `useAnimatedValue` hook which is added in RN 0.71
|
|
52
|
+
* A better alternative of storing animated values in refs, since
|
|
53
|
+
* it doesn't recreate a new `Animated.Value` object on every re-render
|
|
54
|
+
* and therefore consumes less memory. We can not use a variant from
|
|
55
|
+
* RN, since this library supports earlier versions of RN.
|
|
56
|
+
*
|
|
57
|
+
* @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937
|
|
58
58
|
*/
|
|
59
59
|
export function useAnimatedValue(initialValue, config) {
|
|
60
60
|
const ref = useRef(null);
|
|
@@ -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 // eslint-disable-next-line react-compiler/react-compiler\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;IACjC;IACAF,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
|
+
{"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\";\r\nimport { Animated } from \"react-native\";\r\nimport { useSharedValue } from \"react-native-reanimated\";\r\n\r\nimport type { Handlers } from \"./types\";\r\n\r\ntype UntypedHandler = Record<string, (event: never) => void>;\r\ntype SharedHandlersReturnType<T extends UntypedHandler> = [\r\n (handler: Handlers<T>) => void,\r\n <K extends keyof T>(type: K, event: Parameters<T[K]>[0]) => void,\r\n];\r\n\r\n/**\r\n * Hook for storing worklet handlers (objects with keys, where values are worklets).\r\n * Returns methods for setting handlers and broadcasting events in them.\r\n *\r\n * T is a generic that looks like:\r\n * @example\r\n * {\r\n * onEvent: () => {},\r\n * onEvent2: () => {},\r\n * }\r\n */\r\nexport function useSharedHandlers<\r\n T extends UntypedHandler,\r\n>(): SharedHandlersReturnType<T> {\r\n const handlers = useSharedValue<Handlers<T>>({});\r\n const jsHandlers = useRef<Handlers<T>>({});\r\n\r\n // since js -> worklet -> js call is asynchronous, we can not write handlers\r\n // straight into shared variable (using current shared value as a previous result),\r\n // since there may be a race condition in a call, and closure may have out-of-dated\r\n // values. As a result, some of handlers may be not written to \"all handlers\" object.\r\n // Below we are writing all handlers to `ref` and afterwards synchronize them with\r\n // shared value (since `refs` are not referring to actual value in worklets).\r\n // This approach allow us to update synchronously handlers in js thread (and it assures,\r\n // that it will have all of them) and then update them in worklet thread (calls are\r\n // happening in FIFO order, so we will always have actual value).\r\n const updateSharedHandlers = () => {\r\n // eslint-disable-next-line react-compiler/react-compiler\r\n handlers.value = jsHandlers.current;\r\n };\r\n const setHandlers = useCallback((handler: Handlers<T>) => {\r\n jsHandlers.current = {\r\n ...jsHandlers.current,\r\n ...handler,\r\n };\r\n updateSharedHandlers();\r\n }, []);\r\n const broadcast = <K extends keyof T>(\r\n type: K,\r\n event: Parameters<T[K]>[0],\r\n ) => {\r\n \"worklet\";\r\n\r\n Object.keys(handlers.value).forEach((key) => {\r\n handlers.value[key]?.[type]?.(event);\r\n });\r\n };\r\n\r\n return [setHandlers, broadcast];\r\n}\r\n\r\n/**\r\n * TS variant of `useAnimatedValue` hook which is added in RN 0.71\r\n * A better alternative of storing animated values in refs, since\r\n * it doesn't recreate a new `Animated.Value` object on every re-render\r\n * and therefore consumes less memory. We can not use a variant from\r\n * RN, since this library supports earlier versions of RN.\r\n *\r\n * @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937\r\n */\r\nexport function useAnimatedValue(\r\n initialValue: number,\r\n config?: Animated.AnimatedConfig,\r\n): Animated.Value {\r\n const ref = useRef<Animated.Value | null>(null);\r\n\r\n if (ref.current == null) {\r\n ref.current = new Animated.Value(initialValue, config);\r\n }\r\n\r\n return ref.current;\r\n}\r\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;IACjC;IACAF,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":[]}
|
package/lib/module/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["KeyboardControllerNative","KeyboardEvents","isClosed","lastEvent","addListener","e","dismiss","keepFocus","Promise","resolve","subscription","undefined","remove","isVisible","state","KeyboardController","setDefaultMode","setInputMode","setFocusTo","removeListeners"],"sources":["module.ts"],"sourcesContent":["import { KeyboardControllerNative, KeyboardEvents } from \"./bindings\";\n\nimport type {\n DismissOptions,\n KeyboardControllerModule,\n KeyboardEventData,\n} from \"./types\";\n\nlet isClosed = false;\nlet lastEvent: KeyboardEventData | null = null;\n\nKeyboardEvents.addListener(\"keyboardDidHide\", (e) => {\n isClosed = true;\n lastEvent = e;\n});\n\nKeyboardEvents.addListener(\"keyboardDidShow\", (e) => {\n isClosed = false;\n lastEvent = e;\n});\n\nconst dismiss = async (\n { keepFocus }: DismissOptions = { keepFocus: false },\n): Promise<void> => {\n return new Promise((resolve) => {\n if (isClosed) {\n resolve();\n\n return;\n }\n\n const subscription = KeyboardEvents.addListener(\"keyboardDidHide\", () => {\n resolve(undefined);\n subscription.remove();\n });\n\n KeyboardControllerNative.dismiss(keepFocus);\n });\n};\nconst isVisible = () => !isClosed;\nconst state = () => lastEvent;\n\nexport const KeyboardController: KeyboardControllerModule = {\n setDefaultMode: KeyboardControllerNative.setDefaultMode,\n setInputMode: KeyboardControllerNative.setInputMode,\n setFocusTo: KeyboardControllerNative.setFocusTo,\n dismiss,\n isVisible,\n state,\n addListener: KeyboardControllerNative.addListener,\n removeListeners: KeyboardControllerNative.removeListeners,\n};\n"],"mappings":"AAAA,SAASA,wBAAwB,EAAEC,cAAc,QAAQ,YAAY;AAQrE,IAAIC,QAAQ,GAAG,KAAK;AACpB,IAAIC,SAAmC,GAAG,IAAI;AAE9CF,cAAc,CAACG,WAAW,CAAC,iBAAiB,EAAGC,CAAC,IAAK;EACnDH,QAAQ,GAAG,IAAI;EACfC,SAAS,GAAGE,CAAC;AACf,CAAC,CAAC;AAEFJ,cAAc,CAACG,WAAW,CAAC,iBAAiB,EAAGC,CAAC,IAAK;EACnDH,QAAQ,GAAG,KAAK;EAChBC,SAAS,GAAGE,CAAC;AACf,CAAC,CAAC;AAEF,MAAMC,OAAO,GAAG,MAAAA,CACd;EAAEC;AAA0B,CAAC,GAAG;EAAEA,SAAS,EAAE;AAAM,CAAC,KAClC;EAClB,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;IAC9B,IAAIP,QAAQ,EAAE;MACZO,OAAO,CAAC,CAAC;MAET;IACF;IAEA,MAAMC,YAAY,GAAGT,cAAc,CAACG,WAAW,CAAC,iBAAiB,EAAE,MAAM;MACvEK,OAAO,CAACE,SAAS,CAAC;MAClBD,YAAY,CAACE,MAAM,CAAC,CAAC;IACvB,CAAC,CAAC;IAEFZ,wBAAwB,CAACM,OAAO,CAACC,SAAS,CAAC;EAC7C,CAAC,CAAC;AACJ,CAAC;AACD,MAAMM,SAAS,GAAGA,CAAA,KAAM,CAACX,QAAQ;AACjC,MAAMY,KAAK,GAAGA,CAAA,KAAMX,SAAS;AAE7B,OAAO,MAAMY,kBAA4C,GAAG;EAC1DC,cAAc,EAAEhB,wBAAwB,CAACgB,cAAc;EACvDC,YAAY,EAAEjB,wBAAwB,CAACiB,YAAY;EACnDC,UAAU,EAAElB,wBAAwB,CAACkB,UAAU;EAC/CZ,OAAO;EACPO,SAAS;EACTC,KAAK;EACLV,WAAW,EAAEJ,wBAAwB,CAACI,WAAW;EACjDe,eAAe,EAAEnB,wBAAwB,CAACmB;AAC5C,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["KeyboardControllerNative","KeyboardEvents","isClosed","lastEvent","addListener","e","dismiss","keepFocus","Promise","resolve","subscription","undefined","remove","isVisible","state","KeyboardController","setDefaultMode","setInputMode","setFocusTo","removeListeners"],"sources":["module.ts"],"sourcesContent":["import { KeyboardControllerNative, KeyboardEvents } from \"./bindings\";\r\n\r\nimport type {\r\n DismissOptions,\r\n KeyboardControllerModule,\r\n KeyboardEventData,\r\n} from \"./types\";\r\n\r\nlet isClosed = false;\r\nlet lastEvent: KeyboardEventData | null = null;\r\n\r\nKeyboardEvents.addListener(\"keyboardDidHide\", (e) => {\r\n isClosed = true;\r\n lastEvent = e;\r\n});\r\n\r\nKeyboardEvents.addListener(\"keyboardDidShow\", (e) => {\r\n isClosed = false;\r\n lastEvent = e;\r\n});\r\n\r\nconst dismiss = async (\r\n { keepFocus }: DismissOptions = { keepFocus: false },\r\n): Promise<void> => {\r\n return new Promise((resolve) => {\r\n if (isClosed) {\r\n resolve();\r\n\r\n return;\r\n }\r\n\r\n const subscription = KeyboardEvents.addListener(\"keyboardDidHide\", () => {\r\n resolve(undefined);\r\n subscription.remove();\r\n });\r\n\r\n KeyboardControllerNative.dismiss(keepFocus);\r\n });\r\n};\r\nconst isVisible = () => !isClosed;\r\nconst state = () => lastEvent;\r\n\r\nexport const KeyboardController: KeyboardControllerModule = {\r\n setDefaultMode: KeyboardControllerNative.setDefaultMode,\r\n setInputMode: KeyboardControllerNative.setInputMode,\r\n setFocusTo: KeyboardControllerNative.setFocusTo,\r\n dismiss,\r\n isVisible,\r\n state,\r\n addListener: KeyboardControllerNative.addListener,\r\n removeListeners: KeyboardControllerNative.removeListeners,\r\n};\r\n"],"mappings":"AAAA,SAASA,wBAA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edNativeAndroidManager = {
|
|
|
22
22
|
setTranslucent: translucent => {
|
|
23
23
|
RCTStatusBarManagerCompat.setTranslucent(translucent);
|
|
24
24
|
},
|
|
25
|
-
/**
|
|
26
|
-
* - statusBarStyles can be:
|
|
27
|
-
* - 'default'
|
|
28
|
-
* - 'dark-content'
|
|
25
|
+
/**
|
|
26
|
+
* - statusBarStyles can be:
|
|
27
|
+
* - 'default'
|
|
28
|
+
* - 'dark-content'
|
|
29
29
|
*/
|
|
30
30
|
setStyle: statusBarStyle => {
|
|
31
31
|
RCTStatusBarManagerCompat.setStyle(statusBarStyle);
|
|
@@ -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","ignoreList":[]}
|
|
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\r\nimport * as NativeAndroidManager from \"react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid\";\r\n\r\nconst RCTStatusBarManagerCompat =\r\n // eslint-disable-next-line @typescript-eslint/no-var-requires\r\n require(\"./specs/NativeStatusBarManagerCompat\").default;\r\n\r\n// Copy original default manager to keep its original state and methods\r\nconst OriginalNativeAndroidManager = { ...NativeAndroidManager.default };\r\n\r\n// Create a new object that modifies the necessary methods\r\n// On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so\r\n// in order to use library on all available platforms we have to monkey patch\r\n// default RN implementation and use modern `WindowInsetsControllerCompat`.\r\nconst ModifiedNativeAndroidManager = {\r\n ...NativeAndroidManager.default, // Spread original properties to keep existing functionality\r\n setColor: (color: number, animated: boolean): void => {\r\n RCTStatusBarManagerCompat.setColor(color, animated);\r\n },\r\n setTranslucent: (translucent: boolean): void => {\r\n RCTStatusBarManagerCompat.setTranslucent(translucent);\r\n },\r\n /**\r\n * - statusBarStyles can be:\r\n * - 'default'\r\n * - 'dark-content'\r\n */\r\n setStyle: (statusBarStyle?: string): void => {\r\n RCTStatusBarManagerCompat.setStyle(statusBarStyle);\r\n },\r\n setHidden: (hidden: boolean): void => {\r\n RCTStatusBarManagerCompat.setHidden(hidden);\r\n },\r\n};\r\n\r\n// Define a function to apply the monkey patch\r\nexport const applyMonkeyPatch = () => {\r\n Object.assign(NativeAndroidManager.default, ModifiedNativeAndroidManager);\r\n};\r\n\r\n// Define a function to revert changes back to the original state\r\nexport const revertMonkeyPatch = () => {\r\n Object.assign(NativeAndroidManager.default, OriginalNativeAndroidManager);\r\n};\r\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","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["NOOP","applyMonkeyPatch","revertMonkeyPatch"],"sources":["monkey-patch.ts"],"sourcesContent":["// stub for all platforms\r\nconst NOOP = () => {};\r\nexport const applyMonkeyPatch = NOOP;\r\nexport const revertMonkeyPatch = NOOP;\r\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","useFocusedInputSelectionHandler"],"sources":["reanimated.ts"],"sourcesContent":["import type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n FocusedInputSelectionChangedEvent,\n FocusedInputSelectionHandlerHook,\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;\nexport const useFocusedInputSelectionHandler: FocusedInputSelectionHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputSelectionChangedEvent>\n> = NOOP;\n"],"mappings":"AAYA,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;AACR,OAAO,MAAMI,+BAGZ,GAAGJ,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["NOOP","useAnimatedKeyboardHandler","useFocusedInputLayoutHandler","useFocusedInputTextHandler","useFocusedInputSelectionHandler"],"sources":["reanimated.ts"],"sourcesContent":["import type {\r\n EventWithName,\r\n FocusedInputLayoutChangedEvent,\r\n FocusedInputLayoutHandlerHook,\r\n FocusedInputSelectionChangedEvent,\r\n FocusedInputSelectionHandlerHook,\r\n FocusedInputTextChangedEvent,\r\n FocusedInputTextHandlerHook,\r\n KeyboardHandlerHook,\r\n NativeEvent,\r\n} from \"./types\";\r\n\r\nconst NOOP = () => () => {};\r\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\r\n Record<string, unknown>,\r\n EventWithName<NativeEvent>\r\n> = NOOP;\r\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\r\n Record<string, unknown>,\r\n EventWithName<FocusedInputLayoutChangedEvent>\r\n> = NOOP;\r\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\r\n Record<string, unknown>,\r\n EventWithName<FocusedInputTextChangedEvent>\r\n> = NOOP;\r\nexport const useFocusedInputSelectionHandler: FocusedInputSelectionHandlerHook<\r\n Record<string, unknown>,\r\n EventWithName<FocusedInputSelectionChangedEvent>\r\n> = NOOP;\r\n"],"mappings":"AAYA,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;AACR,OAAO,MAAMI,+BAGZ,GAAGJ,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","useFocusedInputSelectionHandler","onFocusedInputSelectionChanged"],"sources":["reanimated.native.ts"],"sourcesContent":["import { useEvent, useHandler } from \"react-native-reanimated\";\n\nimport type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n FocusedInputSelectionChangedEvent,\n FocusedInputSelectionHandlerHook,\n FocusedInputTextChangedEvent,\n FocusedInputTextHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from \"./types\";\n\ntype EventContext = Record<string, unknown>;\n\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\n EventContext,\n EventWithName<NativeEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const {\n onKeyboardMoveStart,\n onKeyboardMove,\n onKeyboardMoveEnd,\n onKeyboardMoveInteractive,\n } = handlers;\n\n if (\n onKeyboardMoveStart &&\n event.eventName.endsWith(\"onKeyboardMoveStart\")\n ) {\n onKeyboardMoveStart(event, context);\n }\n\n if (onKeyboardMove && event.eventName.endsWith(\"onKeyboardMove\")) {\n onKeyboardMove(event, context);\n }\n\n if (onKeyboardMoveEnd && event.eventName.endsWith(\"onKeyboardMoveEnd\")) {\n onKeyboardMoveEnd(event, context);\n }\n\n if (\n onKeyboardMoveInteractive &&\n event.eventName.endsWith(\"onKeyboardMoveInteractive\")\n ) {\n onKeyboardMoveInteractive(event, context);\n }\n },\n [\n \"onKeyboardMoveStart\",\n \"onKeyboardMove\",\n \"onKeyboardMoveEnd\",\n \"onKeyboardMoveInteractive\",\n ],\n doDependenciesDiffer,\n );\n};\n\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\n EventContext,\n EventWithName<FocusedInputLayoutChangedEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const { onFocusedInputLayoutChanged } = handlers;\n\n if (\n onFocusedInputLayoutChanged &&\n event.eventName.endsWith(\"onFocusedInputLayoutChanged\")\n ) {\n onFocusedInputLayoutChanged(event, context);\n }\n },\n [\"onFocusedInputLayoutChanged\"],\n doDependenciesDiffer,\n );\n};\n\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\n EventContext,\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\nexport const useFocusedInputSelectionHandler: FocusedInputSelectionHandlerHook<\n EventContext,\n EventWithName<FocusedInputSelectionChangedEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const { onFocusedInputSelectionChanged } = handlers;\n\n if (\n onFocusedInputSelectionChanged &&\n event.eventName.endsWith(\"onFocusedInputSelectionChanged\")\n ) {\n onFocusedInputSelectionChanged(event, context);\n }\n },\n [\"onFocusedInputSelectionChanged\"],\n doDependenciesDiffer,\n );\n};\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,UAAU,QAAQ,yBAAyB;AAgB9D,OAAO,MAAMC,0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KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,6BAA6B,CAAC,EACvD;MACAE,2BAA2B,CAACR,KAAK,EAAEF,OAAO,CAAC;IAC7C;EACF,CAAC,EACD,CAAC,6BAA6B,CAAC,EAC/BC,oBACF,CAAC;AACH,CAAC;AAED,OAAO,MAAMU,0BAGZ,GAAGA,CAACb,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;MAAEU;IAA0B,CAAC,GAAGd,QAAQ;IAE9C,IACEc,yBAAyB,IACzBV,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,2BAA2B,CAAC,EACrD;MACAI,yBAAyB,CAACV,KAAK,EAAEF,OAAO,CAAC;IAC3C;EACF,CAAC,EACD,CAAC,2BAA2B,CAAC,EAC7BC,oBACF,CAAC;AACH,CAAC;AAED,OAAO,MAAMY,+BAGZ,GAAGA,CAACf,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;MAAEY;IAA+B,CAAC,GAAGhB,QAAQ;IAEnD,IACEgB,8BAA8B,IAC9BZ,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,gCAAgC,CAAC,EAC1D;MACAM,8BAA8B,CAACZ,KAAK,EAAEF,OAAO,CAAC;IAChD;EACF,CAAC,EACD,CAAC,gCAAgC,CAAC,EAClCC,oBACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useEvent","useHandler","useAnimatedKeyboardHandler","handlers","dependencies","context","doDependenciesDiffer","event","onKeyboardMoveStart","onKeyboardMove","onKeyboardMoveEnd","onKeyboardMoveInteractive","eventName","endsWith","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged","useFocusedInputTextHandler","onFocusedInputTextChanged","useFocusedInputSelectionHandler","onFocusedInputSelectionChanged"],"sources":["reanimated.native.ts"],"sourcesContent":["import { useEvent, useHandler } from \"react-native-reanimated\";\r\n\r\nimport type {\r\n EventWithName,\r\n FocusedInputLayoutChangedEvent,\r\n FocusedInputLayoutHandlerHook,\r\n FocusedInputSelectionChangedEvent,\r\n FocusedInputSelectionHandlerHook,\r\n FocusedInputTextChangedEvent,\r\n FocusedInputTextHandlerHook,\r\n KeyboardHandlerHook,\r\n NativeEvent,\r\n} from \"./types\";\r\n\r\ntype EventContext = Record<string, unknown>;\r\n\r\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\r\n EventContext,\r\n EventWithName<NativeEvent>\r\n> = (handlers, dependencies) => {\r\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\r\n\r\n return useEvent(\r\n (event) => {\r\n \"worklet\";\r\n const {\r\n onKeyboardMoveStart,\r\n onKeyboardMove,\r\n onKeyboardMoveEnd,\r\n onKeyboardMoveInteractive,\r\n } = handlers;\r\n\r\n if (\r\n onKeyboardMoveStart &&\r\n event.eventName.endsWith(\"onKeyboardMoveStart\")\r\n ) {\r\n onKeyboardMoveStart(event, context);\r\n }\r\n\r\n if (onKeyboardMove && event.eventName.endsWith(\"onKeyboardMove\")) {\r\n onKeyboardMove(event, context);\r\n }\r\n\r\n if (onKeyboardMoveEnd && event.eventName.endsWith(\"onKeyboardMoveEnd\")) {\r\n onKeyboardMoveEnd(event, context);\r\n }\r\n\r\n if (\r\n onKeyboardMoveInteractive &&\r\n event.eventName.endsWith(\"onKeyboardMoveInteractive\")\r\n ) {\r\n onKeyboardMoveInteractive(event, context);\r\n }\r\n },\r\n [\r\n \"onKeyboardMoveStart\",\r\n \"onKeyboardMove\",\r\n \"onKeyboardMoveEnd\",\r\n \"onKeyboardMoveInteractive\",\r\n ],\r\n doDependenciesDiffer,\r\n );\r\n};\r\n\r\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\r\n EventContext,\r\n EventWithName<FocusedInputLayoutChangedEvent>\r\n> = (handlers, dependencies) => {\r\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\r\n\r\n return useEvent(\r\n (event) => {\r\n \"worklet\";\r\n const { onFocusedInputLayoutChanged } = handlers;\r\n\r\n if (\r\n onFocusedInputLayoutChanged &&\r\n event.eventName.endsWith(\"onFocusedInputLayoutChanged\")\r\n ) {\r\n onFocusedInputLayoutChanged(event, context);\r\n }\r\n },\r\n [\"onFocusedInputLayoutChanged\"],\r\n doDependenciesDiffer,\r\n );\r\n};\r\n\r\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\r\n EventContext,\r\n EventWithName<FocusedInputTextChangedEvent>\r\n> = (handlers, dependencies) => {\r\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\r\n\r\n return useEvent(\r\n (event) => {\r\n \"worklet\";\r\n const { onFocusedInputTextChanged } = handlers;\r\n\r\n if (\r\n onFocusedInputTextChanged &&\r\n event.eventName.endsWith(\"onFocusedInputTextChanged\")\r\n ) {\r\n onFocusedInputTextChanged(event, context);\r\n }\r\n },\r\n [\"onFocusedInputTextChanged\"],\r\n doDependenciesDiffer,\r\n );\r\n};\r\n\r\nexport const useFocusedInputSelectionHandler: FocusedInputSelectionHandlerHook<\r\n EventContext,\r\n EventWithName<FocusedInputSelectionChangedEvent>\r\n> = (handlers, dependencies) => {\r\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\r\n\r\n return useEvent(\r\n (event) => {\r\n \"worklet\";\r\n const { onFocusedInputSelectionChanged } = handlers;\r\n\r\n if (\r\n onFocusedInputSelectionChanged &&\r\n event.eventName.endsWith(\"onFocusedInputSelectionChanged\")\r\n ) {\r\n onFocusedInputSelectionChanged(event, context);\r\n }\r\n },\r\n [\"onFocusedInputSelectionChanged\"],\r\n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}
|
|
@@ -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\ntype FocusedInputSelectionChangedEvent = Readonly<{\n target: Int32;\n selection: {\n start: {\n x: Double;\n y: Double;\n position: Int32;\n };\n end: {\n x: Double;\n y: Double;\n position: Int32;\n };\n };\n}>;\n\nexport interface NativeProps extends ViewProps {\n // props\n enabled?: boolean;\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n preserveEdgeToEdge?: 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 onFocusedInputSelectionChanged?: DirectEventHandler<FocusedInputSelectionChangedEvent>;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n \"RNKeyboardControllerView\",\n) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAoE5F,eAAeA,sBAAsB,CACnC,0BACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent"],"sources":["KeyboardControllerViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\r\n\r\nimport type { HostComponent } from \"react-native\";\r\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\r\nimport type {\r\n DirectEventHandler,\r\n Double,\r\n Int32,\r\n} from \"react-native/Libraries/Types/CodegenTypes\";\r\n\r\ntype KeyboardMoveEvent = Readonly<{\r\n height: Double;\r\n progress: Double;\r\n duration: Int32;\r\n target: Int32;\r\n}>;\r\n\r\ntype FocusedInputLayoutChangedEvent = Readonly<{\r\n target: Int32;\r\n parentScrollViewTarget: Int32;\r\n layout: {\r\n x: Double;\r\n y: Double;\r\n width: Double;\r\n height: Double;\r\n absoluteX: Double;\r\n absoluteY: Double;\r\n };\r\n}>;\r\n\r\ntype FocusedInputTextChangedEvent = Readonly<{\r\n text: string;\r\n}>;\r\n\r\ntype FocusedInputSelectionChangedEvent = Readonly<{\r\n target: Int32;\r\n selection: {\r\n start: {\r\n x: Double;\r\n y: Double;\r\n position: Int32;\r\n };\r\n end: {\r\n x: Double;\r\n y: Double;\r\n position: Int32;\r\n };\r\n };\r\n}>;\r\n\r\nexport interface NativeProps extends ViewProps {\r\n // props\r\n enabled?: boolean;\r\n statusBarTranslucent?: boolean;\r\n navigationBarTranslucent?: boolean;\r\n preserveEdgeToEdge?: boolean;\r\n // callbacks\r\n /// keyboard\r\n onKeyboardMoveStart?: DirectEventHandler<KeyboardMoveEvent>;\r\n onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;\r\n onKeyboardMoveEnd?: DirectEventHandler<KeyboardMoveEvent>;\r\n onKeyboardMoveInteractive?: DirectEventHandler<KeyboardMoveEvent>;\r\n /// focused input\r\n onFocusedInputLayoutChanged?: DirectEventHandler<FocusedInputLayoutChangedEvent>;\r\n onFocusedInputTextChanged?: DirectEventHandler<FocusedInputTextChangedEvent>;\r\n onFocusedInputSelectionChanged?: DirectEventHandler<FocusedInputSelectionChangedEvent>;\r\n}\r\n\r\nexport default codegenNativeComponent<NativeProps>(\r\n \"RNKeyboardControllerView\",\r\n) as HostComponent<NativeProps>;\r\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAoE5F,eAAeA,sBAAsB,CACnC,0BACF,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 {\n Double,\n WithDefault,\n} from \"react-native/Libraries/Types/CodegenTypes\";\n\nexport interface NativeProps extends ViewProps {\n interpolator?: WithDefault<\"linear\" | \"ios\", \"linear\">;\n showOnSwipeUp?: boolean;\n enableSwipeToDismiss?: boolean;\n offset?: Double;\n textInputNativeID?: string;\n}\n\nexport default codegenNativeComponent<NativeProps>(\"RNKeyboardGestureArea\", {\n excludedPlatforms: [\"iOS\"],\n}) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAiB5F,eAAeA,sBAAsB,CAAc,uBAAuB,EAAE;EAC1EC,iBAAiB,EAAE,CAAC,KAAK;AAC3B,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent","excludedPlatforms"],"sources":["KeyboardGestureAreaNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\r\n\r\nimport type { HostComponent } from \"react-native\";\r\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\r\nimport type {\r\n Double,\r\n WithDefault,\r\n} from \"react-native/Libraries/Types/CodegenTypes\";\r\n\r\nexport interface NativeProps extends ViewProps {\r\n interpolator?: WithDefault<\"linear\" | \"ios\", \"linear\">;\r\n showOnSwipeUp?: boolean;\r\n enableSwipeToDismiss?: boolean;\r\n offset?: Double;\r\n textInputNativeID?: string;\r\n}\r\n\r\nexport default codegenNativeComponent<NativeProps>(\"RNKeyboardGestureArea\", {\r\n excludedPlatforms: [\"iOS\"],\r\n}) as HostComponent<NativeProps>;\r\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAiB5F,eAAeA,sBAAsB,CAAc,uBAAuB,EAAE;EAC1EC,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(keepFocus: boolean): 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
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeKeyboardController.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\r\n\r\nimport type { TurboModule } from \"react-native\";\r\n\r\nexport interface Spec extends TurboModule {\r\n readonly getConstants: () => {};\r\n\r\n // methods\r\n setInputMode(mode: number): void;\r\n setDefaultMode(): void;\r\n dismiss(keepFocus: boolean): void;\r\n setFocusTo(direction: string): void;\r\n\r\n // event emitter\r\n addListener: (eventName: string) => void;\r\n removeListeners: (count: number) => void;\r\n}\r\n\r\nexport default TurboModuleRegistry.get<Spec>(\"KeyboardController\");\r\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","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeStatusBarManagerCompat.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\r\n\r\nimport type { TurboModule } from \"react-native\";\r\n\r\nexport interface Spec extends TurboModule {\r\n readonly getConstants: () => {};\r\n\r\n setHidden(hidden: boolean): void;\r\n setColor(color: number, animated: boolean): void;\r\n setTranslucent(translucent: boolean): void;\r\n setStyle(style: string): void;\r\n}\r\n\r\nexport default TurboModuleRegistry.get<Spec>(\"StatusBarManagerCompat\");\r\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAalD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,wBAAwB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["codegenNativeComponent"],"sources":["OverKeyboardViewNativeComponent.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\";\n\nexport interface NativeProps extends ViewProps {\n visible?: boolean;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n \"OverKeyboardView\",\n) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAS5F,eAAeA,sBAAsB,CACnC,kBACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent"],"sources":["OverKeyboardViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\r\n\r\nimport type { HostComponent } from \"react-native\";\r\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\r\n\r\nexport interface NativeProps extends ViewProps {\r\n visible?: boolean;\r\n}\r\n\r\nexport default codegenNativeComponent<NativeProps>(\r\n \"OverKeyboardView\",\r\n) as HostComponent<NativeProps>;\r\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAS5F,eAAeA,sBAAsB,CACnC,kBACF,CAAC","ignoreList":[]}
|