react-native-keyboard-controller 1.10.5 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +1 -0
  2. package/android/build.gradle +6 -0
  3. package/android/src/fabric/java/com/reactnativekeyboardcontroller/KeyboardControllerModule.kt +4 -0
  4. package/android/src/main/java/com/reactnativekeyboardcontroller/events/FocusedInputLayoutChangedEvent.kt +2 -0
  5. package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/EditText.kt +22 -0
  6. package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/ThemedReactContext.kt +9 -0
  7. package/android/src/main/java/com/reactnativekeyboardcontroller/{InteractiveKeyboardProvider.kt → interactive/InteractiveKeyboardProvider.kt} +1 -1
  8. package/android/src/main/java/com/reactnativekeyboardcontroller/{KeyboardAnimationController.kt → interactive/KeyboardAnimationController.kt} +1 -1
  9. package/android/src/main/java/com/reactnativekeyboardcontroller/{interpolators → interactive/interpolators}/Interpolator.kt +1 -1
  10. package/android/src/main/java/com/reactnativekeyboardcontroller/{interpolators → interactive/interpolators}/IosInterpolator.kt +1 -1
  11. package/android/src/main/java/com/reactnativekeyboardcontroller/{interpolators → interactive/interpolators}/LinearInterpolator.kt +1 -1
  12. package/android/src/main/java/com/reactnativekeyboardcontroller/listeners/FocusedInputObserver.kt +20 -0
  13. package/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt +8 -14
  14. package/android/src/main/java/com/reactnativekeyboardcontroller/modules/KeyboardControllerModuleImpl.kt +15 -0
  15. package/android/src/main/java/com/reactnativekeyboardcontroller/traversal/FocusedInputHolder.kt +16 -0
  16. package/android/src/main/java/com/reactnativekeyboardcontroller/traversal/ViewHierarchyNavigator.kt +101 -0
  17. package/android/src/main/java/com/reactnativekeyboardcontroller/views/KeyboardGestureAreaReactViewGroup.kt +4 -4
  18. package/android/src/paper/java/com/reactnativekeyboardcontroller/KeyboardControllerModule.kt +5 -0
  19. package/android/src/test/java/com/reactnativekeyboardcontroller/traversal/ViewHierarchyNavigatorTest.kt +188 -0
  20. package/ios/.swiftlint.yml +4 -0
  21. package/ios/Extensions.swift +29 -0
  22. package/ios/KeyboardController.xcodeproj/project.pbxproj +20 -0
  23. package/ios/KeyboardControllerModule.mm +18 -0
  24. package/ios/events/FocusedInputLayoutChangedEvent.m +3 -0
  25. package/ios/observers/FocusedInputObserver.swift +20 -4
  26. package/ios/observers/KeyboardMovementObserver.swift +5 -4
  27. package/ios/traversal/FocusedInputHolder.swift +32 -0
  28. package/ios/traversal/TextInput.swift +26 -0
  29. package/ios/traversal/ViewHierarchyNavigator.swift +116 -0
  30. package/ios/views/KeyboardControllerView.mm +10 -0
  31. package/ios/views/KeyboardControllerViewManager.swift +4 -1
  32. package/jest/index.js +20 -0
  33. package/lib/commonjs/bindings.js +12 -1
  34. package/lib/commonjs/bindings.js.map +1 -1
  35. package/lib/commonjs/bindings.native.js +11 -2
  36. package/lib/commonjs/bindings.native.js.map +1 -1
  37. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +18 -6
  38. package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
  39. package/lib/commonjs/components/KeyboardToolbar/Arrow.js +79 -0
  40. package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -0
  41. package/lib/commonjs/components/KeyboardToolbar/Button.js +74 -0
  42. package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -0
  43. package/lib/commonjs/components/KeyboardToolbar/colors.js +41 -0
  44. package/lib/commonjs/components/KeyboardToolbar/colors.js.map +1 -0
  45. package/lib/commonjs/components/KeyboardToolbar/index.js +136 -0
  46. package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -0
  47. package/lib/commonjs/components/hooks/useColorScheme.js +11 -0
  48. package/lib/commonjs/components/hooks/useColorScheme.js.map +1 -0
  49. package/lib/commonjs/components/hooks/useKeyboardInterpolation.js +3 -2
  50. package/lib/commonjs/components/hooks/useKeyboardInterpolation.js.map +1 -1
  51. package/lib/commonjs/components/index.js +21 -0
  52. package/lib/commonjs/components/index.js.map +1 -1
  53. package/lib/commonjs/index.js +22 -13
  54. package/lib/commonjs/index.js.map +1 -1
  55. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  56. package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
  57. package/lib/commonjs/types.js.map +1 -1
  58. package/lib/module/bindings.js +10 -0
  59. package/lib/module/bindings.js.map +1 -1
  60. package/lib/module/bindings.native.js +9 -1
  61. package/lib/module/bindings.native.js.map +1 -1
  62. package/lib/module/components/KeyboardAwareScrollView/index.js +18 -6
  63. package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
  64. package/lib/module/components/KeyboardToolbar/Arrow.js +69 -0
  65. package/lib/module/components/KeyboardToolbar/Arrow.js.map +1 -0
  66. package/lib/module/components/KeyboardToolbar/Button.js +64 -0
  67. package/lib/module/components/KeyboardToolbar/Button.js.map +1 -0
  68. package/lib/module/components/KeyboardToolbar/colors.js +34 -0
  69. package/lib/module/components/KeyboardToolbar/colors.js.map +1 -0
  70. package/lib/module/components/KeyboardToolbar/index.js +121 -0
  71. package/lib/module/components/KeyboardToolbar/index.js.map +1 -0
  72. package/lib/module/components/hooks/useColorScheme.js +4 -0
  73. package/lib/module/components/hooks/useColorScheme.js.map +1 -0
  74. package/lib/module/components/hooks/useKeyboardInterpolation.js +3 -2
  75. package/lib/module/components/hooks/useKeyboardInterpolation.js.map +1 -1
  76. package/lib/module/components/index.js +1 -0
  77. package/lib/module/components/index.js.map +1 -1
  78. package/lib/module/index.js +3 -2
  79. package/lib/module/index.js.map +1 -1
  80. package/lib/module/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  81. package/lib/module/specs/NativeKeyboardController.js.map +1 -1
  82. package/lib/module/types.js.map +1 -1
  83. package/lib/typescript/bindings.d.ts +6 -1
  84. package/lib/typescript/bindings.native.d.ts +6 -1
  85. package/lib/typescript/components/KeyboardToolbar/Arrow.d.ts +9 -0
  86. package/lib/typescript/components/KeyboardToolbar/Button.d.ts +15 -0
  87. package/lib/typescript/components/KeyboardToolbar/colors.d.ts +17 -0
  88. package/lib/typescript/components/KeyboardToolbar/index.d.ts +25 -0
  89. package/lib/typescript/components/hooks/useColorScheme.d.ts +2 -0
  90. package/lib/typescript/components/index.d.ts +1 -0
  91. package/lib/typescript/index.d.ts +1 -2
  92. package/lib/typescript/specs/KeyboardControllerViewNativeComponent.d.ts +1 -0
  93. package/lib/typescript/specs/NativeKeyboardController.d.ts +1 -0
  94. package/lib/typescript/types.d.ts +11 -0
  95. package/package.json +5 -1
  96. package/src/bindings.native.ts +11 -1
  97. package/src/bindings.ts +9 -0
  98. package/src/components/KeyboardAwareScrollView/index.tsx +22 -2
  99. package/src/components/KeyboardToolbar/Arrow.tsx +80 -0
  100. package/src/components/KeyboardToolbar/Button.tsx +98 -0
  101. package/src/components/KeyboardToolbar/colors.ts +51 -0
  102. package/src/components/KeyboardToolbar/index.tsx +154 -0
  103. package/src/components/hooks/useColorScheme.ts +5 -0
  104. package/src/components/hooks/useKeyboardInterpolation.ts +3 -2
  105. package/src/components/index.ts +5 -0
  106. package/src/index.ts +4 -1
  107. package/src/specs/KeyboardControllerViewNativeComponent.ts +1 -0
  108. package/src/specs/NativeKeyboardController.ts +1 -0
  109. package/src/types.ts +14 -0
  110. package/lib/commonjs/replicas.js +0 -125
  111. package/lib/commonjs/replicas.js.map +0 -1
  112. package/lib/module/replicas.js +0 -115
  113. package/lib/module/replicas.js.map +0 -1
  114. package/lib/typescript/replicas.d.ts +0 -38
  115. package/src/replicas.ts +0 -154
@@ -0,0 +1,34 @@
1
+ import { Platform, PlatformColor } from "react-native";
2
+ export const colors = {
3
+ light: {
4
+ primary: Platform.select({
5
+ ios: PlatformColor("link"),
6
+ default: "#2c2c2c"
7
+ }),
8
+ disabled: Platform.select({
9
+ ios: PlatformColor("systemGray4"),
10
+ default: "#B0BEC5"
11
+ }),
12
+ background: Platform.select({
13
+ ios: "#F8F8F8",
14
+ default: "#f3f3f4"
15
+ }),
16
+ ripple: "#bcbcbcbc"
17
+ },
18
+ dark: {
19
+ primary: Platform.select({
20
+ ios: PlatformColor("label"),
21
+ default: "#fafafa"
22
+ }),
23
+ disabled: Platform.select({
24
+ ios: PlatformColor("systemGray"),
25
+ default: "#707070"
26
+ }),
27
+ background: Platform.select({
28
+ ios: "#555756",
29
+ default: "#2C2C2E"
30
+ }),
31
+ ripple: "#F8F8F888"
32
+ }
33
+ };
34
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Platform","PlatformColor","colors","light","primary","select","ios","default","disabled","background","ripple","dark"],"sources":["colors.ts"],"sourcesContent":["import { Platform, PlatformColor } from \"react-native\";\n\nimport type { ColorValue } from \"react-native\";\n\ntype Theme = {\n /** Color for arrow when it's enabled */\n primary: ColorValue;\n /** Color for arrow when it's disabled */\n disabled: ColorValue;\n /** Keyboard toolbar background color */\n background: ColorValue;\n /** Color for ripple effect (on button touch) on Android */\n ripple: ColorValue;\n};\nexport type KeyboardToolbarTheme = {\n light: Theme;\n dark: Theme;\n};\n\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;AAmBtD,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"}
@@ -0,0 +1,121 @@
1
+ import React, { useEffect, useMemo, useState } from "react";
2
+ import { StyleSheet, Text, View } from "react-native";
3
+ import { FocusedInputEvents, KeyboardStickyView } from "react-native-keyboard-controller";
4
+ import { KeyboardController } from "../../bindings";
5
+ import useColorScheme from "../hooks/useColorScheme";
6
+ import Arrow from "./Arrow";
7
+ import Button from "./Button";
8
+ import { colors } from "./colors";
9
+ const TEST_ID_KEYBOARD_TOOLBAR = "keyboard.toolbar";
10
+ const TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;
11
+ const TEST_ID_KEYBOARD_TOOLBAR_NEXT = `${TEST_ID_KEYBOARD_TOOLBAR}.next`;
12
+ const TEST_ID_KEYBOARD_TOOLBAR_CONTENT = `${TEST_ID_KEYBOARD_TOOLBAR}.content`;
13
+ const TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;
14
+ const KEYBOARD_TOOLBAR_HEIGHT = 42;
15
+ const offset = {
16
+ closed: KEYBOARD_TOOLBAR_HEIGHT
17
+ };
18
+ const dismissKeyboard = () => KeyboardController.dismiss();
19
+ const goToNextField = () => KeyboardController.setFocusTo("next");
20
+ const goToPrevField = () => KeyboardController.setFocusTo("prev");
21
+
22
+ /**
23
+ * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and
24
+ * `Done` buttons.
25
+ */
26
+ const KeyboardToolbar = _ref => {
27
+ let {
28
+ content,
29
+ theme = colors,
30
+ doneText,
31
+ button,
32
+ icon
33
+ } = _ref;
34
+ const colorScheme = useColorScheme();
35
+ const [inputs, setInputs] = useState({
36
+ current: 0,
37
+ count: 0
38
+ });
39
+ const isPrevDisabled = inputs.current === 0;
40
+ const isNextDisabled = inputs.current === inputs.count - 1;
41
+ useEffect(() => {
42
+ const subscription = FocusedInputEvents.addListener("focusDidSet", e => {
43
+ setInputs(e);
44
+ });
45
+ return subscription.remove;
46
+ }, []);
47
+ const doneStyle = useMemo(() => [styles.doneButton, {
48
+ color: theme[colorScheme].primary
49
+ }], [colorScheme, theme]);
50
+ const toolbarStyle = useMemo(() => [styles.toolbar, {
51
+ backgroundColor: theme[colorScheme].background
52
+ }], [colorScheme, theme]);
53
+ const ButtonContainer = button || Button;
54
+ const IconContainer = icon || Arrow;
55
+ return /*#__PURE__*/React.createElement(KeyboardStickyView, {
56
+ offset: offset
57
+ }, /*#__PURE__*/React.createElement(View, {
58
+ style: toolbarStyle,
59
+ testID: TEST_ID_KEYBOARD_TOOLBAR
60
+ }, /*#__PURE__*/React.createElement(ButtonContainer, {
61
+ accessibilityLabel: "Previous",
62
+ accessibilityHint: "Will move focus to previous field",
63
+ disabled: isPrevDisabled,
64
+ onPress: goToPrevField,
65
+ testID: TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS,
66
+ theme: theme
67
+ }, /*#__PURE__*/React.createElement(IconContainer, {
68
+ disabled: isPrevDisabled,
69
+ type: "prev",
70
+ theme: theme
71
+ })), /*#__PURE__*/React.createElement(ButtonContainer, {
72
+ accessibilityLabel: "Next",
73
+ accessibilityHint: "Will move focus to next field",
74
+ disabled: isNextDisabled,
75
+ onPress: goToNextField,
76
+ testID: TEST_ID_KEYBOARD_TOOLBAR_NEXT,
77
+ theme: theme
78
+ }, /*#__PURE__*/React.createElement(IconContainer, {
79
+ disabled: isNextDisabled,
80
+ type: "next",
81
+ theme: theme
82
+ })), /*#__PURE__*/React.createElement(View, {
83
+ style: styles.flex,
84
+ testID: TEST_ID_KEYBOARD_TOOLBAR_CONTENT
85
+ }, content), /*#__PURE__*/React.createElement(ButtonContainer, {
86
+ accessibilityLabel: "Done",
87
+ accessibilityHint: "Will close the keyboard",
88
+ onPress: dismissKeyboard,
89
+ testID: TEST_ID_KEYBOARD_TOOLBAR_DONE,
90
+ rippleRadius: 28,
91
+ style: styles.doneButtonContainer,
92
+ theme: theme
93
+ }, /*#__PURE__*/React.createElement(Text, {
94
+ style: doneStyle,
95
+ maxFontSizeMultiplier: 1.3
96
+ }, doneText || "Done"))));
97
+ };
98
+ const styles = StyleSheet.create({
99
+ flex: {
100
+ flex: 1
101
+ },
102
+ toolbar: {
103
+ position: "absolute",
104
+ bottom: 0,
105
+ alignItems: "center",
106
+ width: "100%",
107
+ flexDirection: "row",
108
+ height: KEYBOARD_TOOLBAR_HEIGHT,
109
+ paddingHorizontal: 8
110
+ },
111
+ doneButton: {
112
+ fontWeight: "600",
113
+ fontSize: 15
114
+ },
115
+ doneButtonContainer: {
116
+ marginRight: 8
117
+ }
118
+ });
119
+ export { colors as DefaultKeyboardToolbarTheme };
120
+ export default KeyboardToolbar;
121
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useEffect","useMemo","useState","StyleSheet","Text","View","FocusedInputEvents","KeyboardStickyView","KeyboardController","useColorScheme","Arrow","Button","colors","TEST_ID_KEYBOARD_TOOLBAR","TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS","TEST_ID_KEYBOARD_TOOLBAR_NEXT","TEST_ID_KEYBOARD_TOOLBAR_CONTENT","TEST_ID_KEYBOARD_TOOLBAR_DONE","KEYBOARD_TOOLBAR_HEIGHT","offset","closed","dismissKeyboard","dismiss","goToNextField","setFocusTo","goToPrevField","KeyboardToolbar","_ref","content","theme","doneText","button","icon","colorScheme","inputs","setInputs","current","count","isPrevDisabled","isNextDisabled","subscription","addListener","e","remove","doneStyle","styles","doneButton","color","primary","toolbarStyle","toolbar","backgroundColor","background","ButtonContainer","IconContainer","createElement","style","testID","accessibilityLabel","accessibilityHint","disabled","onPress","type","flex","rippleRadius","doneButtonContainer","maxFontSizeMultiplier","create","position","bottom","alignItems","width","flexDirection","height","paddingHorizontal","fontWeight","fontSize","marginRight","DefaultKeyboardToolbarTheme"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\n\nimport {\n FocusedInputEvents,\n KeyboardStickyView,\n} from \"react-native-keyboard-controller\";\n\nimport { KeyboardController } from \"../../bindings\";\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport Arrow from \"./Arrow\";\nimport Button from \"./Button\";\nimport { colors } from \"./colors\";\n\nimport type { KeyboardToolbarTheme } from \"./colors\";\nimport type { ReactNode } from \"react\";\n\nexport type KeyboardToolbarProps = {\n /** An element that is shown in the middle of the toolbar. */\n content?: JSX.Element | null;\n /** A set of dark/light colors consumed by toolbar component. */\n theme?: KeyboardToolbarTheme;\n /** Custom text for done button. */\n doneText?: ReactNode;\n /** Custom touchable component for toolbar (used for prev/next/done buttons). */\n button?: typeof Button;\n /** Custom icon component used to display next/prev buttons. */\n icon?: typeof Arrow;\n};\nconst TEST_ID_KEYBOARD_TOOLBAR = \"keyboard.toolbar\";\nconst TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;\nconst TEST_ID_KEYBOARD_TOOLBAR_NEXT = `${TEST_ID_KEYBOARD_TOOLBAR}.next`;\nconst TEST_ID_KEYBOARD_TOOLBAR_CONTENT = `${TEST_ID_KEYBOARD_TOOLBAR}.content`;\nconst TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;\n\nconst KEYBOARD_TOOLBAR_HEIGHT = 42;\nconst offset = { closed: KEYBOARD_TOOLBAR_HEIGHT };\n\nconst dismissKeyboard = () => KeyboardController.dismiss();\nconst goToNextField = () => KeyboardController.setFocusTo(\"next\");\nconst goToPrevField = () => KeyboardController.setFocusTo(\"prev\");\n\n/**\n * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and\n * `Done` buttons.\n */\nconst KeyboardToolbar: React.FC<KeyboardToolbarProps> = ({\n content,\n theme = colors,\n doneText,\n button,\n icon,\n}) => {\n const colorScheme = useColorScheme();\n const [inputs, setInputs] = useState({\n current: 0,\n count: 0,\n });\n const isPrevDisabled = inputs.current === 0;\n const isNextDisabled = inputs.current === inputs.count - 1;\n\n useEffect(() => {\n const subscription = FocusedInputEvents.addListener(\"focusDidSet\", (e) => {\n setInputs(e);\n });\n\n return subscription.remove;\n }, []);\n const doneStyle = useMemo(\n () => [styles.doneButton, { color: theme[colorScheme].primary }],\n [colorScheme, theme],\n );\n const toolbarStyle = useMemo(\n () => [\n styles.toolbar,\n {\n backgroundColor: theme[colorScheme].background,\n },\n ],\n [colorScheme, theme],\n );\n const ButtonContainer = button || Button;\n const IconContainer = icon || Arrow;\n\n return (\n <KeyboardStickyView offset={offset}>\n <View style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>\n <ButtonContainer\n accessibilityLabel=\"Previous\"\n accessibilityHint=\"Will move focus to previous field\"\n disabled={isPrevDisabled}\n onPress={goToPrevField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS}\n theme={theme}\n >\n <IconContainer disabled={isPrevDisabled} type=\"prev\" theme={theme} />\n </ButtonContainer>\n <ButtonContainer\n accessibilityLabel=\"Next\"\n accessibilityHint=\"Will move focus to next field\"\n disabled={isNextDisabled}\n onPress={goToNextField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_NEXT}\n theme={theme}\n >\n <IconContainer disabled={isNextDisabled} type=\"next\" theme={theme} />\n </ButtonContainer>\n\n <View style={styles.flex} testID={TEST_ID_KEYBOARD_TOOLBAR_CONTENT}>\n {content}\n </View>\n <ButtonContainer\n accessibilityLabel=\"Done\"\n accessibilityHint=\"Will close the keyboard\"\n onPress={dismissKeyboard}\n testID={TEST_ID_KEYBOARD_TOOLBAR_DONE}\n rippleRadius={28}\n style={styles.doneButtonContainer}\n theme={theme}\n >\n <Text style={doneStyle} maxFontSizeMultiplier={1.3}>\n {doneText || \"Done\"}\n </Text>\n </ButtonContainer>\n </View>\n </KeyboardStickyView>\n );\n};\n\nconst styles = StyleSheet.create({\n flex: {\n flex: 1,\n },\n toolbar: {\n position: \"absolute\",\n bottom: 0,\n alignItems: \"center\",\n width: \"100%\",\n flexDirection: \"row\",\n height: KEYBOARD_TOOLBAR_HEIGHT,\n paddingHorizontal: 8,\n },\n doneButton: {\n fontWeight: \"600\",\n fontSize: 15,\n },\n doneButtonContainer: {\n marginRight: 8,\n },\n});\n\nexport { colors as DefaultKeyboardToolbarTheme };\nexport default KeyboardToolbar;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC3D,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAErD,SACEC,kBAAkB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6B,UAAU,EAAE,KAAK;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACDX,mBAAmB,EAAE;IACnBY,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAEF,SAASjE,MAAM,IAAIkE,2BAA2B;AAC9C,eAAepD,eAAe"}
@@ -0,0 +1,4 @@
1
+ import { useColorScheme as useColorSchemeRN } from "react-native";
2
+ const useColorScheme = () => useColorSchemeRN() || "light";
3
+ export default useColorScheme;
4
+ //# sourceMappingURL=useColorScheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useColorScheme","useColorSchemeRN"],"sources":["useColorScheme.ts"],"sourcesContent":["import { useColorScheme as useColorSchemeRN } from \"react-native\";\n\nconst useColorScheme = () => useColorSchemeRN() || \"light\";\n\nexport default useColorScheme;\n"],"mappings":"AAAA,SAASA,cAAc,IAAIC,gBAAgB,QAAQ,cAAc;AAEjE,MAAMD,cAAc,GAAGA,CAAA,KAAMC,gBAAgB,CAAC,CAAC,IAAI,OAAO;AAE1D,eAAeD,cAAc"}
@@ -33,8 +33,9 @@ const useKeyboardInterpolation = () => {
33
33
  if (Platform.OS === "ios") {
34
34
  return interpolateREA(keyboardPosition, [0, nextKeyboardHeight.value], output);
35
35
  }
36
- lastInterpolation.value = interpolateREA(keyboardPosition, [prevKeyboardHeight.value, nextKeyboardHeight.value], shouldUseInternalInterpolation.value ? [lastInterpolation.value, output[1]] : output);
37
- return lastInterpolation.value;
36
+ const interpolation = interpolateREA(keyboardPosition, [prevKeyboardHeight.value, nextKeyboardHeight.value], shouldUseInternalInterpolation.value ? [lastInterpolation.value, output[1]] : output);
37
+ lastInterpolation.value = interpolation;
38
+ return interpolation;
38
39
  };
39
40
  useKeyboardHandler({
40
41
  onStart: e => {
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","interpolate","interpolateREA","useSharedValue","useKeyboardHandler","useKeyboardInterpolation","nextKeyboardHeight","prevKeyboardHeight","lastInterpolation","shouldUseInternalInterpolation","keyboardPosition","output","OS","value","onStart","e","keyboardWillBeHidden","height","onEnd"],"sources":["useKeyboardInterpolation.ts"],"sourcesContent":["import { Platform } from \"react-native\";\nimport {\n interpolate as interpolateREA,\n useSharedValue,\n} from \"react-native-reanimated\";\n\nimport { useKeyboardHandler } from \"react-native-keyboard-controller\";\n\ntype KeyboardInterpolationOutput = [number, number];\n\n/**\n * Hook that can be used for interpolation keyboard movement. The main concern is the thing\n * when keyboard is opened and gets resized on Android. Let's say we are interpolating from\n * closed to open [0, 200] and we want to interpolate it to [0, 230] (to achieve nice parallax effect).\n * Then let's say keyboard changes its height to 220 (and we want to interpolate the value to 250, +30\n * to keyboard height). If we interpolate based on `progress` value, then we will have a jump on first frame:\n * the last interpolated position was 230, now we will interpolate to 250, but first frame will be calculated\n * as 200 / 220 * 250 = 227 (and last interpolated position was 230) so we will have a jump.\n *\n * This hook handles it, and when keyboard changes its size it does an interpolation as:\n * [200, 220] -> [230, 250], i. e. we preserve last interpolated value and use it as initial value for interpolation\n * and because of that we will not have a jump and animation will start from the last frame and will be smooth.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/315\n */\nconst useKeyboardInterpolation = () => {\n // keyboard heights\n const nextKeyboardHeight = useSharedValue(0);\n const prevKeyboardHeight = useSharedValue(0);\n // save latest interpolated position\n const lastInterpolation = useSharedValue(0);\n // boolean flag indicating which output range should be used\n const shouldUseInternalInterpolation = useSharedValue(false);\n\n const interpolate = (\n keyboardPosition: number,\n output: KeyboardInterpolationOutput,\n ) => {\n \"worklet\";\n\n // on iOS it's safe to interpolate between 0 and `fullKeyboardSize` because when\n // keyboard resized we will not have intermediate values and transition will be instant\n // see: https://github.com/kirillzyusko/react-native-keyboard-controller/issues/327\n if (Platform.OS === \"ios\") {\n return interpolateREA(\n keyboardPosition,\n [0, nextKeyboardHeight.value],\n output,\n );\n }\n\n lastInterpolation.value = interpolateREA(\n keyboardPosition,\n [prevKeyboardHeight.value, nextKeyboardHeight.value],\n shouldUseInternalInterpolation.value\n ? [lastInterpolation.value, output[1]]\n : output,\n );\n\n return lastInterpolation.value;\n };\n\n useKeyboardHandler(\n {\n onStart: (e) => {\n \"worklet\";\n\n const keyboardWillBeHidden = e.height === 0;\n\n // keyboard will be hidden\n if (keyboardWillBeHidden) {\n shouldUseInternalInterpolation.value = false;\n prevKeyboardHeight.value = 0;\n }\n\n // keyboard will change its size\n if (\n // keyboard is shown on screen\n nextKeyboardHeight.value !== 0 &&\n // it really changes size (handles iOS case when after interactive keyboard gets shown again)\n nextKeyboardHeight.value !== e.height &&\n // keyboard is not hiding\n !keyboardWillBeHidden\n ) {\n prevKeyboardHeight.value = nextKeyboardHeight.value;\n shouldUseInternalInterpolation.value = true;\n }\n\n // keyboard will show or change size\n if (!keyboardWillBeHidden) {\n nextKeyboardHeight.value = e.height;\n }\n },\n onEnd: (e) => {\n \"worklet\";\n\n // handles case show -> resize -> hide -> show\n // here we reset value to 0 when keyboard is hidden\n nextKeyboardHeight.value = e.height;\n },\n },\n [],\n );\n\n return { interpolate };\n};\n\nexport default useKeyboardInterpolation;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SACEC,WAAW,IAAIC,cAAc,EAC7BC,cAAc,QACT,yBAAyB;AAEhC,SAASC,kBAAkB,QAAQ,kCAAkC;AAIrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,GAAGA,CAAA,KAAM;EACrC;EACA,MAAMC,kBAAkB,GAAGH,cAAc,CAAC,CAAC,CAAC;EAC5C,MAAMI,kBAAkB,GAAGJ,cAAc,CAAC,CAAC,CAAC;EAC5C;EACA,MAAMK,iBAAiB,GAAGL,cAAc,CAAC,CAAC,CAAC;EAC3C;EACA,MAAMM,8BAA8B,GAAGN,cAAc,CAAC,KAAK,CAAC;EAE5D,MAAMF,WAAW,GAAGA,CAClBS,gBAAwB,EACxBC,MAAmC,KAChC;IACH,SAAS;;IAET;IACA;IACA;IACA,I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eI,wBAAwB"}
1
+ {"version":3,"names":["Platform","interpolate","interpolateREA","useSharedValue","useKeyboardHandler","useKeyboardInterpolation","nextKeyboardHeight","prevKeyboardHeight","lastInterpolation","shouldUseInternalInterpolation","keyboardPosition","output","OS","value","interpolation","onStart","e","keyboardWillBeHidden","height","onEnd"],"sources":["useKeyboardInterpolation.ts"],"sourcesContent":["import { Platform } from \"react-native\";\nimport {\n interpolate as interpolateREA,\n useSharedValue,\n} from \"react-native-reanimated\";\n\nimport { useKeyboardHandler } from \"react-native-keyboard-controller\";\n\ntype KeyboardInterpolationOutput = [number, number];\n\n/**\n * Hook that can be used for interpolation keyboard movement. The main concern is the thing\n * when keyboard is opened and gets resized on Android. Let's say we are interpolating from\n * closed to open [0, 200] and we want to interpolate it to [0, 230] (to achieve nice parallax effect).\n * Then let's say keyboard changes its height to 220 (and we want to interpolate the value to 250, +30\n * to keyboard height). If we interpolate based on `progress` value, then we will have a jump on first frame:\n * the last interpolated position was 230, now we will interpolate to 250, but first frame will be calculated\n * as 200 / 220 * 250 = 227 (and last interpolated position was 230) so we will have a jump.\n *\n * This hook handles it, and when keyboard changes its size it does an interpolation as:\n * [200, 220] -> [230, 250], i. e. we preserve last interpolated value and use it as initial value for interpolation\n * and because of that we will not have a jump and animation will start from the last frame and will be smooth.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/315\n */\nconst useKeyboardInterpolation = () => {\n // keyboard heights\n const nextKeyboardHeight = useSharedValue(0);\n const prevKeyboardHeight = useSharedValue(0);\n // save latest interpolated position\n const lastInterpolation = useSharedValue(0);\n // boolean flag indicating which output range should be used\n const shouldUseInternalInterpolation = useSharedValue(false);\n\n const interpolate = (\n keyboardPosition: number,\n output: KeyboardInterpolationOutput,\n ) => {\n \"worklet\";\n\n // on iOS it's safe to interpolate between 0 and `fullKeyboardSize` because when\n // keyboard resized we will not have intermediate values and transition will be instant\n // see: https://github.com/kirillzyusko/react-native-keyboard-controller/issues/327\n if (Platform.OS === \"ios\") {\n return interpolateREA(\n keyboardPosition,\n [0, nextKeyboardHeight.value],\n output,\n );\n }\n\n const interpolation = interpolateREA(\n keyboardPosition,\n [prevKeyboardHeight.value, nextKeyboardHeight.value],\n shouldUseInternalInterpolation.value\n ? [lastInterpolation.value, output[1]]\n : output,\n );\n lastInterpolation.value = interpolation;\n\n return interpolation;\n };\n\n useKeyboardHandler(\n {\n onStart: (e) => {\n \"worklet\";\n\n const keyboardWillBeHidden = e.height === 0;\n\n // keyboard will be hidden\n if (keyboardWillBeHidden) {\n shouldUseInternalInterpolation.value = false;\n prevKeyboardHeight.value = 0;\n }\n\n // keyboard will change its size\n if (\n // keyboard is shown on screen\n nextKeyboardHeight.value !== 0 &&\n // it really changes size (handles iOS case when after interactive keyboard gets shown again)\n nextKeyboardHeight.value !== e.height &&\n // keyboard is not hiding\n !keyboardWillBeHidden\n ) {\n prevKeyboardHeight.value = nextKeyboardHeight.value;\n shouldUseInternalInterpolation.value = true;\n }\n\n // keyboard will show or change size\n if (!keyboardWillBeHidden) {\n nextKeyboardHeight.value = e.height;\n }\n },\n onEnd: (e) => {\n \"worklet\";\n\n // handles case show -> resize -> hide -> show\n // here we reset value to 0 when keyboard is hidden\n nextKeyboardHeight.value = e.height;\n },\n },\n [],\n );\n\n return { interpolate };\n};\n\nexport default useKeyboardInterpolation;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SACEC,WAAW,IAAIC,cAAc,EAC7BC,cAAc,QACT,yBAAyB;AAEhC,SAASC,kBAAkB,QAAQ,kCAAkC;AAIrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,GAAGA,CAAA,KAAM;EACrC;EACA,MAAMC,kBAAkB,GAAGH,cAAc,CAAC,CAAC,CAAC;EAC5C,MAAMI,kBAAkB,GAAGJ,cAAc,CAAC,CAAC,CAAC;EAC5C;EACA,MAAMK,iBAAiB,GAAGL,cAAc,C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C;IACDC,KAAK,EAAGH,CAAC,IAAK;MACZ,SAAS;;MAET;MACA;MACAV,kBAAkB,CAACO,KAAK,GAAGG,CAAC,CAACE,MAAM;IACrC;EACF,CAAC,EACD,EACF,CAAC;EAED,OAAO;IAAEjB;EAAY,CAAC;AACxB,CAAC;AAED,eAAeI,wBAAwB"}
@@ -1,4 +1,5 @@
1
1
  export { default as KeyboardAvoidingView } from "./KeyboardAvoidingView";
2
2
  export { default as KeyboardStickyView } from "./KeyboardStickyView";
3
3
  export { default as KeyboardAwareScrollView } from "./KeyboardAwareScrollView";
4
+ export { default as KeyboardToolbar, DefaultKeyboardToolbarTheme, KeyboardToolbarProps } from "./KeyboardToolbar";
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default","KeyboardAvoidingView","KeyboardStickyView","KeyboardAwareScrollView"],"sources":["index.ts"],"sourcesContent":["export { default as KeyboardAvoidingView } from \"./KeyboardAvoidingView\";\nexport { default as KeyboardStickyView } from \"./KeyboardStickyView\";\nexport { default as KeyboardAwareScrollView } from \"./KeyboardAwareScrollView\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,oBAAoB,QAAQ,wBAAwB;AACxE,SAASD,OAAO,IAAIE,kBAAkB,QAAQ,sBAAsB;AACpE,SAASF,OAAO,IAAIG,uBAAuB,QAAQ,2BAA2B"}
1
+ {"version":3,"names":["default","KeyboardAvoidingView","KeyboardStickyView","KeyboardAwareScrollView","KeyboardToolbar","DefaultKeyboardToolbarTheme","KeyboardToolbarProps"],"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 KeyboardToolbarProps,\n} 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,EAC3BC,oBAAoB,QACf,mBAAmB"}
@@ -1,9 +1,10 @@
1
1
  export * from "./bindings";
2
2
  export * from "./animated";
3
- export * from "./replicas";
4
3
  export * from "./context";
5
4
  export * from "./hooks";
6
5
  export * from "./constants";
7
6
  export * from "./types";
8
- export { KeyboardAvoidingView, KeyboardStickyView, KeyboardAwareScrollView } from "./components";
7
+ export { KeyboardAvoidingView, KeyboardStickyView, KeyboardAwareScrollView,
8
+ // keyboard toolbar
9
+ KeyboardToolbar, DefaultKeyboardToolbarTheme, KeyboardToolbarProps } from "./components";
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["KeyboardAvoidingView","KeyboardStickyView","KeyboardAwareScrollView"],"sources":["index.ts"],"sourcesContent":["export * from \"./bindings\";\nexport * from \"./animated\";\nexport * from \"./replicas\";\nexport * from \"./context\";\nexport * from \"./hooks\";\nexport * from \"./constants\";\nexport * from \"./types\";\n\nexport {\n KeyboardAvoidingView,\n KeyboardStickyView,\n KeyboardAwareScrollView,\n} from \"./components\";\n"],"mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,YAAY;AAC1B,cAAc,YAAY;AAC1B,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,aAAa;AAC3B,cAAc,SAAS;AAEvB,SACEA,oBAAoB,EACpBC,kBAAkB,EAClBC,uBAAuB,QAClB,cAAc"}
1
+ {"version":3,"names":["KeyboardAvoidingView","KeyboardStickyView","KeyboardAwareScrollView","KeyboardToolbar","DefaultKeyboardToolbarTheme","KeyboardToolbarProps"],"sources":["index.ts"],"sourcesContent":["export * from \"./bindings\";\nexport * from \"./animated\";\nexport * from \"./context\";\nexport * from \"./hooks\";\nexport * from \"./constants\";\nexport * from \"./types\";\n\nexport {\n KeyboardAvoidingView,\n KeyboardStickyView,\n KeyboardAwareScrollView,\n // keyboard toolbar\n KeyboardToolbar,\n DefaultKeyboardToolbarTheme,\n KeyboardToolbarProps,\n} from \"./components\";\n"],"mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,YAAY;AAC1B,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,aAAa;AAC3B,cAAc,SAAS;AAEvB,SACEA,oBAAoB,EACpBC,kBAAkB,EAClBC,uBAAuB;AACvB;AACAC,eAAe,EACfC,2BAA2B,EAC3BC,oBAAoB,QACf,cAAc"}
@@ -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 layout: {\n x: Double;\n y: Double;\n width: Double;\n height: Double;\n absoluteX: Double;\n absoluteY: Double;\n };\n}>;\n\ntype FocusedInputTextChangedEvent = Readonly<{\n text: string;\n}>;\n\nexport interface NativeProps extends ViewProps {\n // props\n enabled?: boolean;\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n // callbacks\n /// keyboard\n onKeyboardMoveStart?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveEnd?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveInteractive?: DirectEventHandler<KeyboardMoveEvent>;\n /// focused input\n onFocusedInputLayoutChanged?: DirectEventHandler<FocusedInputLayoutChangedEvent>;\n onFocusedInputTextChanged?: DirectEventHandler<FocusedInputTextChangedEvent>;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n \"KeyboardControllerView\",\n) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAiD5F,eAAeA,sBAAsB,CACnC,wBACF,CAAC"}
1
+ {"version":3,"names":["codegenNativeComponent"],"sources":["KeyboardControllerViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\nimport type {\n DirectEventHandler,\n Double,\n Int32,\n} from \"react-native/Libraries/Types/CodegenTypes\";\n\ntype KeyboardMoveEvent = Readonly<{\n height: Double;\n progress: Double;\n duration: Int32;\n target: Int32;\n}>;\n\ntype FocusedInputLayoutChangedEvent = Readonly<{\n target: Int32;\n parentScrollViewTarget: Int32;\n layout: {\n x: Double;\n y: Double;\n width: Double;\n height: Double;\n absoluteX: Double;\n absoluteY: Double;\n };\n}>;\n\ntype FocusedInputTextChangedEvent = Readonly<{\n text: string;\n}>;\n\nexport interface NativeProps extends ViewProps {\n // props\n enabled?: boolean;\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n // callbacks\n /// keyboard\n onKeyboardMoveStart?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveEnd?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveInteractive?: DirectEventHandler<KeyboardMoveEvent>;\n /// focused input\n onFocusedInputLayoutChanged?: DirectEventHandler<FocusedInputLayoutChangedEvent>;\n onFocusedInputTextChanged?: DirectEventHandler<FocusedInputTextChangedEvent>;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n \"KeyboardControllerView\",\n) as HostComponent<NativeProps>;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAkD5F,eAAeA,sBAAsB,CACnC,wBACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeKeyboardController.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\n\nimport type { TurboModule } from \"react-native\";\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n // methods\n setInputMode(mode: number): void;\n setDefaultMode(): void;\n dismiss(): void;\n\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;AAiBlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC"}
1
+ {"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeKeyboardController.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\n\nimport type { TurboModule } from \"react-native\";\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n // methods\n setInputMode(mode: number): void;\n setDefaultMode(): void;\n dismiss(): void;\n setFocusTo(direction: string): void;\n\n // event emitter\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n}\n\nexport default TurboModuleRegistry.get<Spec>(\"KeyboardController\");\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAkBlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n EmitterSubscription,\n NativeSyntheticEvent,\n ViewProps,\n} from \"react-native\";\n\n// DirectEventHandler events declaration\nexport type NativeEvent = {\n progress: number;\n height: number;\n duration: number;\n target: number;\n};\nexport type FocusedInputLayoutChangedEvent = {\n target: number;\n layout: {\n x: number;\n y: number;\n width: number;\n height: number;\n absoluteX: number;\n absoluteY: number;\n };\n};\nexport type FocusedInputTextChangedEvent = {\n text: string;\n};\nexport type EventWithName<T> = {\n eventName: string;\n} & T;\n\n// native View/Module declarations\nexport type KeyboardControllerProps = {\n // callback props\n onKeyboardMoveStart?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMove?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveEnd?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveInteractive?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n // fake props used to activate reanimated bindings\n onKeyboardMoveReanimated?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n // props\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n enabled?: boolean;\n} & ViewProps;\n\nexport type KeyboardGestureAreaProps = {\n interpolator: \"ios\" | \"linear\";\n /**\n * Whether to allow to show a keyboard from dismissed state by swipe up.\n * Default to `false`.\n */\n showOnSwipeUp?: boolean;\n /**\n * Whether to allow to control a keyboard by gestures. The strategy how\n * it should be controlled is determined by `interpolator` property.\n * Defaults to `true`.\n */\n enableSwipeToDismiss?: boolean;\n} & ViewProps;\n\nexport type KeyboardControllerModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // all platforms\n dismiss: () => void;\n // native event module stuff\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n};\n\n// Event module declarations\nexport type KeyboardControllerEvents =\n | \"keyboardWillShow\"\n | \"keyboardDidShow\"\n | \"keyboardWillHide\"\n | \"keyboardDidHide\";\nexport type KeyboardEventData = {\n height: number;\n duration: number;\n timestamp: number;\n target: number;\n};\nexport type KeyboardEventsModule = {\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEventData) => void,\n ) => EmitterSubscription;\n};\n\n// reanimated hook declaration\nexport type KeyboardHandlerHook<TContext, Event> = (\n handlers: {\n onKeyboardMoveStart?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMove?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveEnd?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveInteractive?: (e: NativeEvent, context: TContext) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputLayoutHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputLayoutChanged?: (\n e: FocusedInputLayoutChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputTextHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputTextChanged?: (\n e: FocusedInputTextChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\n\n// package types\nexport type Handlers<T> = Record<string, T | undefined>;\nexport type KeyboardHandler = Partial<{\n onStart: (e: NativeEvent) => void;\n onMove: (e: NativeEvent) => void;\n onEnd: (e: NativeEvent) => void;\n onInteractive: (e: NativeEvent) => void;\n}>;\nexport type KeyboardHandlers = Handlers<KeyboardHandler>;\nexport type FocusedInputHandler = Partial<{\n onChangeText: (e: FocusedInputTextChangedEvent) => void;\n}>;\nexport type FocusedInputHandlers = Handlers<FocusedInputHandler>;\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n EmitterSubscription,\n NativeSyntheticEvent,\n ViewProps,\n} from \"react-native\";\n\n// DirectEventHandler events declaration\nexport type NativeEvent = {\n progress: number;\n height: number;\n duration: number;\n target: number;\n};\nexport type FocusedInputLayoutChangedEvent = {\n target: number;\n parentScrollViewTarget: number;\n layout: {\n x: number;\n y: number;\n width: number;\n height: number;\n absoluteX: number;\n absoluteY: number;\n };\n};\nexport type FocusedInputTextChangedEvent = {\n text: string;\n};\nexport type EventWithName<T> = {\n eventName: string;\n} & T;\n\n// native View/Module declarations\nexport type KeyboardControllerProps = {\n // callback props\n onKeyboardMoveStart?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMove?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveEnd?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveInteractive?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n // fake props used to activate reanimated bindings\n onKeyboardMoveReanimated?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n // props\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n enabled?: boolean;\n} & ViewProps;\n\nexport type KeyboardGestureAreaProps = {\n interpolator: \"ios\" | \"linear\";\n /**\n * Whether to allow to show a keyboard from dismissed state by swipe up.\n * Default to `false`.\n */\n showOnSwipeUp?: boolean;\n /**\n * Whether to allow to control a keyboard by gestures. The strategy how\n * it should be controlled is determined by `interpolator` property.\n * Defaults to `true`.\n */\n enableSwipeToDismiss?: boolean;\n} & ViewProps;\n\nexport type Direction = \"next\" | \"prev\" | \"current\";\nexport type KeyboardControllerModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // all platforms\n dismiss: () => void;\n setFocusTo: (direction: Direction) => void;\n // native event module stuff\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n};\n\n// Event module declarations\nexport type KeyboardControllerEvents =\n | \"keyboardWillShow\"\n | \"keyboardDidShow\"\n | \"keyboardWillHide\"\n | \"keyboardDidHide\";\nexport type KeyboardEventData = {\n height: number;\n duration: number;\n timestamp: number;\n target: number;\n};\nexport type KeyboardEventsModule = {\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEventData) => void,\n ) => EmitterSubscription;\n};\nexport type FocusedInputAvailableEvents = \"focusDidSet\";\nexport type FocusedInputEventData = {\n current: number;\n count: number;\n};\nexport type FocusedInputEventsModule = {\n addListener: (\n name: FocusedInputAvailableEvents,\n cb: (e: FocusedInputEventData) => void,\n ) => EmitterSubscription;\n};\n\n// reanimated hook declaration\nexport type KeyboardHandlerHook<TContext, Event> = (\n handlers: {\n onKeyboardMoveStart?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMove?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveEnd?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveInteractive?: (e: NativeEvent, context: TContext) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputLayoutHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputLayoutChanged?: (\n e: FocusedInputLayoutChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputTextHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputTextChanged?: (\n e: FocusedInputTextChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\n\n// package types\nexport type Handlers<T> = Record<string, T | undefined>;\nexport type KeyboardHandler = Partial<{\n onStart: (e: NativeEvent) => void;\n onMove: (e: NativeEvent) => void;\n onEnd: (e: NativeEvent) => void;\n onInteractive: (e: NativeEvent) => void;\n}>;\nexport type KeyboardHandlers = Handlers<KeyboardHandler>;\nexport type FocusedInputHandler = Partial<{\n onChangeText: (e: FocusedInputTextChangedEvent) => void;\n}>;\nexport type FocusedInputHandlers = Handlers<FocusedInputHandler>;\n"],"mappings":""}
@@ -1,6 +1,11 @@
1
1
  /// <reference types="react" />
2
- import type { KeyboardControllerModule, KeyboardControllerProps, KeyboardEventsModule, KeyboardGestureAreaProps } from "./types";
2
+ import type { FocusedInputEventsModule, KeyboardControllerModule, KeyboardControllerProps, KeyboardEventsModule, KeyboardGestureAreaProps } from "./types";
3
3
  export declare const KeyboardController: KeyboardControllerModule;
4
4
  export declare const KeyboardEvents: KeyboardEventsModule;
5
+ /**
6
+ * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.
7
+ * Use it with cautious.
8
+ */
9
+ export declare const FocusedInputEvents: FocusedInputEventsModule;
5
10
  export declare const KeyboardControllerView: import("react").FC<KeyboardControllerProps>;
6
11
  export declare const KeyboardGestureArea: import("react").FC<KeyboardGestureAreaProps>;
@@ -1,6 +1,11 @@
1
1
  /// <reference types="react" />
2
- import type { KeyboardControllerModule, KeyboardControllerProps, KeyboardEventsModule, KeyboardGestureAreaProps } from "./types";
2
+ import type { FocusedInputEventsModule, KeyboardControllerModule, KeyboardControllerProps, KeyboardEventsModule, KeyboardGestureAreaProps } from "./types";
3
3
  export declare const KeyboardController: KeyboardControllerModule;
4
4
  export declare const KeyboardEvents: KeyboardEventsModule;
5
+ /**
6
+ * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.
7
+ * Use it with cautious.
8
+ */
9
+ export declare const FocusedInputEvents: FocusedInputEventsModule;
5
10
  export declare const KeyboardControllerView: React.FC<KeyboardControllerProps>;
6
11
  export declare const KeyboardGestureArea: React.FC<KeyboardGestureAreaProps>;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { KeyboardToolbarTheme } from "./colors";
3
+ type ArrowProps = {
4
+ type: "prev" | "next";
5
+ disabled?: boolean;
6
+ theme: KeyboardToolbarTheme;
7
+ };
8
+ declare const ArrowComponent: React.FC<ArrowProps>;
9
+ export default ArrowComponent;
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import type { KeyboardToolbarTheme } from "./colors";
3
+ import type { ViewStyle } from "react-native";
4
+ type ButtonProps = {
5
+ disabled?: boolean;
6
+ onPress: () => void;
7
+ accessibilityLabel: string;
8
+ accessibilityHint: string;
9
+ testID: string;
10
+ rippleRadius?: number;
11
+ style?: ViewStyle;
12
+ theme: KeyboardToolbarTheme;
13
+ };
14
+ declare const _default: ({ children, onPress, disabled, accessibilityLabel, accessibilityHint, testID, style, }: React.PropsWithChildren<ButtonProps>) => JSX.Element;
15
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import type { ColorValue } from "react-native";
2
+ type Theme = {
3
+ /** Color for arrow when it's enabled */
4
+ primary: ColorValue;
5
+ /** Color for arrow when it's disabled */
6
+ disabled: ColorValue;
7
+ /** Keyboard toolbar background color */
8
+ background: ColorValue;
9
+ /** Color for ripple effect (on button touch) on Android */
10
+ ripple: ColorValue;
11
+ };
12
+ export type KeyboardToolbarTheme = {
13
+ light: Theme;
14
+ dark: Theme;
15
+ };
16
+ export declare const colors: KeyboardToolbarTheme;
17
+ export {};
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import Arrow from "./Arrow";
3
+ import Button from "./Button";
4
+ import { colors } from "./colors";
5
+ import type { KeyboardToolbarTheme } from "./colors";
6
+ import type { ReactNode } from "react";
7
+ export type KeyboardToolbarProps = {
8
+ /** An element that is shown in the middle of the toolbar. */
9
+ content?: JSX.Element | null;
10
+ /** A set of dark/light colors consumed by toolbar component. */
11
+ theme?: KeyboardToolbarTheme;
12
+ /** Custom text for done button. */
13
+ doneText?: ReactNode;
14
+ /** Custom touchable component for toolbar (used for prev/next/done buttons). */
15
+ button?: typeof Button;
16
+ /** Custom icon component used to display next/prev buttons. */
17
+ icon?: typeof Arrow;
18
+ };
19
+ /**
20
+ * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and
21
+ * `Done` buttons.
22
+ */
23
+ declare const KeyboardToolbar: React.FC<KeyboardToolbarProps>;
24
+ export { colors as DefaultKeyboardToolbarTheme };
25
+ export default KeyboardToolbar;
@@ -0,0 +1,2 @@
1
+ declare const useColorScheme: () => "light" | "dark";
2
+ export default useColorScheme;
@@ -1,3 +1,4 @@
1
1
  export { default as KeyboardAvoidingView } from "./KeyboardAvoidingView";
2
2
  export { default as KeyboardStickyView } from "./KeyboardStickyView";
3
3
  export { default as KeyboardAwareScrollView } from "./KeyboardAwareScrollView";
4
+ export { default as KeyboardToolbar, DefaultKeyboardToolbarTheme, KeyboardToolbarProps, } from "./KeyboardToolbar";
@@ -1,8 +1,7 @@
1
1
  export * from "./bindings";
2
2
  export * from "./animated";
3
- export * from "./replicas";
4
3
  export * from "./context";
5
4
  export * from "./hooks";
6
5
  export * from "./constants";
7
6
  export * from "./types";
8
- export { KeyboardAvoidingView, KeyboardStickyView, KeyboardAwareScrollView, } from "./components";
7
+ export { KeyboardAvoidingView, KeyboardStickyView, KeyboardAwareScrollView, KeyboardToolbar, DefaultKeyboardToolbarTheme, KeyboardToolbarProps, } from "./components";
@@ -9,6 +9,7 @@ type KeyboardMoveEvent = Readonly<{
9
9
  }>;
10
10
  type FocusedInputLayoutChangedEvent = Readonly<{
11
11
  target: Int32;
12
+ parentScrollViewTarget: Int32;
12
13
  layout: {
13
14
  x: Double;
14
15
  y: Double;
@@ -4,6 +4,7 @@ export interface Spec extends TurboModule {
4
4
  setInputMode(mode: number): void;
5
5
  setDefaultMode(): void;
6
6
  dismiss(): void;
7
+ setFocusTo(direction: string): void;
7
8
  addListener: (eventName: string) => void;
8
9
  removeListeners: (count: number) => void;
9
10
  }
@@ -7,6 +7,7 @@ export type NativeEvent = {
7
7
  };
8
8
  export type FocusedInputLayoutChangedEvent = {
9
9
  target: number;
10
+ parentScrollViewTarget: number;
10
11
  layout: {
11
12
  x: number;
12
13
  y: number;
@@ -50,10 +51,12 @@ export type KeyboardGestureAreaProps = {
50
51
  */
51
52
  enableSwipeToDismiss?: boolean;
52
53
  } & ViewProps;
54
+ export type Direction = "next" | "prev" | "current";
53
55
  export type KeyboardControllerModule = {
54
56
  setDefaultMode: () => void;
55
57
  setInputMode: (mode: number) => void;
56
58
  dismiss: () => void;
59
+ setFocusTo: (direction: Direction) => void;
57
60
  addListener: (eventName: string) => void;
58
61
  removeListeners: (count: number) => void;
59
62
  };
@@ -67,6 +70,14 @@ export type KeyboardEventData = {
67
70
  export type KeyboardEventsModule = {
68
71
  addListener: (name: KeyboardControllerEvents, cb: (e: KeyboardEventData) => void) => EmitterSubscription;
69
72
  };
73
+ export type FocusedInputAvailableEvents = "focusDidSet";
74
+ export type FocusedInputEventData = {
75
+ current: number;
76
+ count: number;
77
+ };
78
+ export type FocusedInputEventsModule = {
79
+ addListener: (name: FocusedInputAvailableEvents, cb: (e: FocusedInputEventData) => void) => EmitterSubscription;
80
+ };
70
81
  export type KeyboardHandlerHook<TContext, Event> = (handlers: {
71
82
  onKeyboardMoveStart?: (e: NativeEvent, context: TContext) => void;
72
83
  onKeyboardMove?: (e: NativeEvent, context: TContext) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-keyboard-controller",
3
- "version": "1.10.5",
3
+ "version": "1.11.0",
4
4
  "description": "Keyboard manager which works in identical way on both iOS and Android",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -48,6 +48,10 @@
48
48
  "avoiding view",
49
49
  "sticky view",
50
50
  "keyboard aware scroll view",
51
+ "keyboard toolbar",
52
+ "keyboard done button",
53
+ "keyboard next button",
54
+ "keyboard previous button",
51
55
  "ios",
52
56
  "android"
53
57
  ],
@@ -1,6 +1,7 @@
1
1
  import { NativeEventEmitter, Platform } from "react-native";
2
2
 
3
3
  import type {
4
+ FocusedInputEventsModule,
4
5
  KeyboardControllerModule,
5
6
  KeyboardControllerProps,
6
7
  KeyboardEventsModule,
@@ -28,11 +29,20 @@ export const KeyboardController = (
28
29
  )
29
30
  ) as KeyboardControllerModule;
30
31
 
32
+ const KEYBOARD_CONTROLLER_NAMESPACE = "KeyboardController::";
31
33
  const eventEmitter = new NativeEventEmitter(KeyboardController);
32
34
 
33
35
  export const KeyboardEvents: KeyboardEventsModule = {
34
36
  addListener: (name, cb) =>
35
- eventEmitter.addListener("KeyboardController::" + name, cb),
37
+ eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),
38
+ };
39
+ /**
40
+ * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.
41
+ * Use it with cautious.
42
+ */
43
+ export const FocusedInputEvents: FocusedInputEventsModule = {
44
+ addListener: (name, cb) =>
45
+ eventEmitter.addListener(KEYBOARD_CONTROLLER_NAMESPACE + name, cb),
36
46
  };
37
47
  export const KeyboardControllerView: React.FC<KeyboardControllerProps> =
38
48
  require("./specs/KeyboardControllerViewNativeComponent").default;
package/src/bindings.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { View } from "react-native";
2
2
 
3
3
  import type {
4
+ FocusedInputEventsModule,
4
5
  KeyboardControllerModule,
5
6
  KeyboardControllerProps,
6
7
  KeyboardEventsModule,
@@ -13,12 +14,20 @@ export const KeyboardController: KeyboardControllerModule = {
13
14
  setDefaultMode: NOOP,
14
15
  setInputMode: NOOP,
15
16
  dismiss: NOOP,
17
+ setFocusTo: NOOP,
16
18
  addListener: NOOP,
17
19
  removeListeners: NOOP,
18
20
  };
19
21
  export const KeyboardEvents: KeyboardEventsModule = {
20
22
  addListener: () => ({ remove: NOOP } as EmitterSubscription),
21
23
  };
24
+ /**
25
+ * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.
26
+ * Use it with cautious.
27
+ */
28
+ export const FocusedInputEvents: FocusedInputEventsModule = {
29
+ addListener: () => ({ remove: NOOP } as EmitterSubscription),
30
+ };
22
31
  export const KeyboardControllerView =
23
32
  View as unknown as React.FC<KeyboardControllerProps>;
24
33
  export const KeyboardGestureArea =