react-native-keyboard-controller 1.18.6 → 1.19.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 (105) hide show
  1. package/android/src/fabric/java/com/reactnativekeyboardcontroller/KeyboardControllerModule.kt +5 -2
  2. package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/EditText.kt +8 -1
  3. package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/View.kt +41 -0
  4. package/android/src/main/java/com/reactnativekeyboardcontroller/modules/KeyboardControllerModuleImpl.kt +25 -5
  5. package/android/src/main/java/com/reactnativekeyboardcontroller/modules/statusbar/StatusBarManagerCompatModuleImpl.kt +4 -4
  6. package/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt +2 -8
  7. package/android/src/paper/java/com/reactnativekeyboardcontroller/KeyboardControllerModule.kt +5 -2
  8. package/ios/KeyboardControllerModule.mm +3 -3
  9. package/ios/KeyboardControllerModuleImpl.swift +26 -16
  10. package/ios/views/KeyboardControllerView.mm +6 -1
  11. package/ios/views/KeyboardControllerViewManager.swift +2 -1
  12. package/ios/views/KeyboardExtenderManager.mm +1 -2
  13. package/lib/commonjs/animated.js +1 -2
  14. package/lib/commonjs/animated.js.map +1 -1
  15. package/lib/commonjs/components/KeyboardAvoidingView/index.js +1 -2
  16. package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
  17. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +1 -2
  18. package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
  19. package/lib/commonjs/components/KeyboardStickyView/index.js +1 -2
  20. package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -1
  21. package/lib/commonjs/components/KeyboardToolbar/Arrow.js +1 -2
  22. package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -1
  23. package/lib/commonjs/components/KeyboardToolbar/Button.js +1 -2
  24. package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -1
  25. package/lib/commonjs/components/KeyboardToolbar/compound/components/Background.js +13 -0
  26. package/lib/commonjs/components/KeyboardToolbar/compound/components/Background.js.map +1 -0
  27. package/lib/commonjs/components/KeyboardToolbar/compound/components/Content.js +25 -0
  28. package/lib/commonjs/components/KeyboardToolbar/compound/components/Content.js.map +1 -0
  29. package/lib/commonjs/components/KeyboardToolbar/compound/components/Done.js +61 -0
  30. package/lib/commonjs/components/KeyboardToolbar/compound/components/Done.js.map +1 -0
  31. package/lib/commonjs/components/KeyboardToolbar/compound/components/Next.js +52 -0
  32. package/lib/commonjs/components/KeyboardToolbar/compound/components/Next.js.map +1 -0
  33. package/lib/commonjs/components/KeyboardToolbar/compound/components/Prev.js +52 -0
  34. package/lib/commonjs/components/KeyboardToolbar/compound/components/Prev.js.map +1 -0
  35. package/lib/commonjs/components/KeyboardToolbar/compound/components/index.js +42 -0
  36. package/lib/commonjs/components/KeyboardToolbar/compound/components/index.js.map +1 -0
  37. package/lib/commonjs/components/KeyboardToolbar/compound/components/types.js +6 -0
  38. package/lib/commonjs/components/KeyboardToolbar/compound/components/types.js.map +1 -0
  39. package/lib/commonjs/components/KeyboardToolbar/compound/context.js +17 -0
  40. package/lib/commonjs/components/KeyboardToolbar/compound/context.js.map +1 -0
  41. package/lib/commonjs/components/KeyboardToolbar/index.js +76 -78
  42. package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
  43. package/lib/commonjs/components/KeyboardToolbar/types.js.map +1 -1
  44. package/lib/commonjs/components/index.js +1 -2
  45. package/lib/commonjs/components/index.js.map +1 -1
  46. package/lib/commonjs/hooks/useWindowDimensions/index.js +3 -3
  47. package/lib/commonjs/hooks/useWindowDimensions/index.js.map +1 -1
  48. package/lib/commonjs/module.js +2 -1
  49. package/lib/commonjs/module.js.map +1 -1
  50. package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
  51. package/lib/commonjs/types/module.js.map +1 -1
  52. package/lib/commonjs/views/OverKeyboardView/index.js +1 -2
  53. package/lib/commonjs/views/OverKeyboardView/index.js.map +1 -1
  54. package/lib/module/components/KeyboardToolbar/compound/components/Background.js +6 -0
  55. package/lib/module/components/KeyboardToolbar/compound/components/Background.js.map +1 -0
  56. package/lib/module/components/KeyboardToolbar/compound/components/Content.js +18 -0
  57. package/lib/module/components/KeyboardToolbar/compound/components/Content.js.map +1 -0
  58. package/lib/module/components/KeyboardToolbar/compound/components/Done.js +54 -0
  59. package/lib/module/components/KeyboardToolbar/compound/components/Done.js.map +1 -0
  60. package/lib/module/components/KeyboardToolbar/compound/components/Next.js +44 -0
  61. package/lib/module/components/KeyboardToolbar/compound/components/Next.js.map +1 -0
  62. package/lib/module/components/KeyboardToolbar/compound/components/Prev.js +45 -0
  63. package/lib/module/components/KeyboardToolbar/compound/components/Prev.js.map +1 -0
  64. package/lib/module/components/KeyboardToolbar/compound/components/index.js +6 -0
  65. package/lib/module/components/KeyboardToolbar/compound/components/index.js.map +1 -0
  66. package/lib/module/components/KeyboardToolbar/compound/components/types.js +2 -0
  67. package/lib/module/components/KeyboardToolbar/compound/components/types.js.map +1 -0
  68. package/lib/module/components/KeyboardToolbar/compound/context.js +10 -0
  69. package/lib/module/components/KeyboardToolbar/compound/context.js.map +1 -0
  70. package/lib/module/components/KeyboardToolbar/index.js +78 -79
  71. package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
  72. package/lib/module/components/KeyboardToolbar/types.js.map +1 -1
  73. package/lib/module/hooks/useWindowDimensions/index.js +3 -3
  74. package/lib/module/hooks/useWindowDimensions/index.js.map +1 -1
  75. package/lib/module/module.js +2 -1
  76. package/lib/module/module.js.map +1 -1
  77. package/lib/module/specs/NativeKeyboardController.js.map +1 -1
  78. package/lib/module/types/module.js.map +1 -1
  79. package/lib/typescript/components/KeyboardToolbar/compound/components/Background.d.ts +6 -0
  80. package/lib/typescript/components/KeyboardToolbar/compound/components/Content.d.ts +7 -0
  81. package/lib/typescript/components/KeyboardToolbar/compound/components/Done.d.ts +7 -0
  82. package/lib/typescript/components/KeyboardToolbar/compound/components/Next.d.ts +4 -0
  83. package/lib/typescript/components/KeyboardToolbar/compound/components/Prev.d.ts +4 -0
  84. package/lib/typescript/components/KeyboardToolbar/compound/components/index.d.ts +5 -0
  85. package/lib/typescript/components/KeyboardToolbar/compound/components/types.d.ts +14 -0
  86. package/lib/typescript/components/KeyboardToolbar/compound/context.d.ts +9 -0
  87. package/lib/typescript/components/KeyboardToolbar/index.d.ts +13 -54
  88. package/lib/typescript/components/KeyboardToolbar/types.d.ts +92 -5
  89. package/lib/typescript/specs/NativeKeyboardController.d.ts +1 -1
  90. package/lib/typescript/types/module.d.ts +5 -1
  91. package/package.json +5 -5
  92. package/src/components/KeyboardToolbar/compound/components/Background.tsx +9 -0
  93. package/src/components/KeyboardToolbar/compound/components/Content.tsx +25 -0
  94. package/src/components/KeyboardToolbar/compound/components/Done.tsx +70 -0
  95. package/src/components/KeyboardToolbar/compound/components/Next.tsx +55 -0
  96. package/src/components/KeyboardToolbar/compound/components/Prev.tsx +56 -0
  97. package/src/components/KeyboardToolbar/compound/components/index.ts +5 -0
  98. package/src/components/KeyboardToolbar/compound/components/types.ts +15 -0
  99. package/src/components/KeyboardToolbar/compound/context.ts +25 -0
  100. package/src/components/KeyboardToolbar/index.tsx +105 -165
  101. package/src/components/KeyboardToolbar/types.ts +101 -5
  102. package/src/hooks/useWindowDimensions/index.ts +3 -3
  103. package/src/module.ts +3 -2
  104. package/src/specs/NativeKeyboardController.ts +1 -1
  105. package/src/types/module.ts +5 -1
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type Arrow from \"../../Arrow\";\nimport type Button from \"../../Button\";\nimport type { ReactNode } from \"react\";\nimport type { GestureResponderEvent, ViewStyle } from \"react-native\";\n\nexport type ButtonSubProps = {\n children?: ReactNode;\n onPress?: (event: GestureResponderEvent) => void;\n disabled?: boolean;\n testID?: string;\n rippleRadius?: number;\n style?: ViewStyle;\n button?: typeof Button;\n icon?: typeof Arrow;\n};\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useToolbarContext = exports.ToolbarContext = void 0;
7
+ var _react = require("react");
8
+ const ToolbarContext = exports.ToolbarContext = /*#__PURE__*/(0, _react.createContext)(undefined);
9
+ const useToolbarContext = () => {
10
+ const context = (0, _react.useContext)(ToolbarContext);
11
+ if (!context) {
12
+ throw new Error("KeyboardToolbar.* component must be used inside <KeyboardToolbar>");
13
+ }
14
+ return context;
15
+ };
16
+ exports.useToolbarContext = useToolbarContext;
17
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","ToolbarContext","exports","createContext","undefined","useToolbarContext","context","useContext","Error"],"sources":["context.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\nimport type { KeyboardToolbarTheme } from \"../types\";\n\ntype ToolbarContextType = {\n theme: KeyboardToolbarTheme;\n isPrevDisabled: boolean;\n isNextDisabled: boolean;\n};\n\nexport const ToolbarContext = createContext<ToolbarContextType | undefined>(\n undefined,\n);\n\nexport const useToolbarContext = () => {\n const context = useContext(ToolbarContext);\n\n if (!context) {\n throw new Error(\n \"KeyboardToolbar.* component must be used inside <KeyboardToolbar>\",\n );\n }\n\n return context;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAUO,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,gBAAG,IAAAE,oBAAa,EACzCC,SACF,CAAC;AAEM,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACrC,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACN,cAAc,CAAC;EAE1C,IAAI,CAACK,OAAO,EAAE;IACZ,MAAM,IAAIE,KAAK,CACb,mEACF,CAAC;EACH;EAEA,OAAOF,OAAO;AAChB,CAAC;AAACJ,OAAA,CAAAG,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -14,15 +14,15 @@ var _react = _interopRequireWildcard(require("react"));
14
14
  var _reactNative = require("react-native");
15
15
  var _bindings = require("../../bindings");
16
16
  var _hooks = require("../../hooks");
17
- var _module = require("../../module");
18
17
  var _KeyboardStickyView = _interopRequireDefault(require("../KeyboardStickyView"));
19
18
  var _Arrow = _interopRequireDefault(require("./Arrow"));
20
19
  var _Button = _interopRequireDefault(require("./Button"));
21
20
  var _colors = require("./colors");
21
+ var _components = require("./compound/components");
22
+ var _context = require("./compound/context");
22
23
  var _constants = require("./constants");
23
24
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
24
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
25
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
25
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
26
26
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
27
27
  /**
28
28
  * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` buttons from left and
@@ -33,11 +33,14 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
33
33
  * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/components/keyboard-toolbar|Documentation} page for more details.
34
34
  * @example
35
35
  * ```tsx
36
- * <KeyboardToolbar doneText="Close" />
36
+ * <KeyboardToolbar>
37
+ * <KeyboardToolbar.Done text="Close" />
38
+ * </KeyboardToolbar>
37
39
  * ```
38
40
  */
39
41
  const KeyboardToolbar = props => {
40
42
  const {
43
+ children,
41
44
  content,
42
45
  theme = _colors.colors,
43
46
  doneText = "Done",
@@ -64,15 +67,14 @@ const KeyboardToolbar = props => {
64
67
  });
65
68
  const isPrevDisabled = inputs.current === 0;
66
69
  const isNextDisabled = inputs.current === inputs.count - 1;
70
+ const buttonContainer = button ?? _Button.default;
71
+ const iconContainer = icon ?? _Arrow.default;
67
72
  (0, _react.useEffect)(() => {
68
73
  const subscription = _bindings.FocusedInputEvents.addListener("focusDidSet", e => {
69
74
  setInputs(e);
70
75
  });
71
76
  return subscription.remove;
72
77
  }, []);
73
- const doneStyle = (0, _react.useMemo)(() => [styles.doneButton, {
74
- color: theme[colorScheme].primary
75
- }], [colorScheme, theme]);
76
78
  const toolbarStyle = (0, _react.useMemo)(() => [styles.toolbar, {
77
79
  backgroundColor: `${theme[colorScheme].background}${opacity}`
78
80
  }, !_constants.KEYBOARD_HAS_ROUNDED_CORNERS ? {
@@ -87,77 +89,76 @@ const KeyboardToolbar = props => {
87
89
  closed: closed + _constants.KEYBOARD_TOOLBAR_HEIGHT,
88
90
  opened: opened + _constants.OPENED_OFFSET
89
91
  }), [closed, opened]);
90
- const ButtonContainer = button || _Button.default;
91
- const IconContainer = icon || _Arrow.default;
92
- const onPressNext = (0, _react.useCallback)(event => {
93
- onNextCallback === null || onNextCallback === void 0 || onNextCallback(event);
94
- if (!event.isDefaultPrevented()) {
95
- _module.KeyboardController.setFocusTo("next");
96
- }
97
- }, [onNextCallback]);
98
- const onPressPrev = (0, _react.useCallback)(event => {
99
- onPrevCallback === null || onPrevCallback === void 0 || onPrevCallback(event);
100
- if (!event.isDefaultPrevented()) {
101
- _module.KeyboardController.setFocusTo("prev");
102
- }
103
- }, [onPrevCallback]);
104
- const onPressDone = (0, _react.useCallback)(event => {
105
- onDoneCallback === null || onDoneCallback === void 0 || onDoneCallback(event);
106
- if (!event.isDefaultPrevented()) {
107
- _module.KeyboardController.dismiss();
108
- }
109
- }, [onDoneCallback]);
110
- return /*#__PURE__*/_react.default.createElement(_KeyboardStickyView.default, {
92
+ let backgroundElement = null;
93
+ let arrowsElement = null;
94
+ let contentContainer = null;
95
+ let doneElement = null;
96
+ if (children) {
97
+ let prevChild = null;
98
+ let nextChild = null;
99
+ let contentChild = null;
100
+ let doneChild = null;
101
+ let backgroundChild = null;
102
+ _react.default.Children.forEach(children, child => {
103
+ if (! /*#__PURE__*/_react.default.isValidElement(child)) {
104
+ return;
105
+ }
106
+ const type = child.type;
107
+ if (type === _components.Background) {
108
+ backgroundChild = child;
109
+ } else if (type === _components.Content) {
110
+ contentChild = child;
111
+ } else if (type === _components.Prev) {
112
+ prevChild = child;
113
+ } else if (type === _components.Next) {
114
+ nextChild = child;
115
+ } else if (type === _components.Done) {
116
+ doneChild = child;
117
+ }
118
+ });
119
+ backgroundElement = backgroundChild;
120
+ doneElement = doneChild;
121
+ arrowsElement = prevChild || nextChild ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
122
+ style: styles.arrows
123
+ }, prevChild, nextChild) : null;
124
+ contentContainer = contentChild ?? /*#__PURE__*/_react.default.createElement(_components.Content, null, contentChild);
125
+ } else {
126
+ backgroundElement = blur;
127
+ arrowsElement = showArrows ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
128
+ style: styles.arrows
129
+ }, /*#__PURE__*/_react.default.createElement(_components.Prev, {
130
+ button: buttonContainer,
131
+ icon: iconContainer,
132
+ onPress: onPrevCallback
133
+ }), /*#__PURE__*/_react.default.createElement(_components.Next, {
134
+ button: buttonContainer,
135
+ icon: iconContainer,
136
+ onPress: onNextCallback
137
+ })) : null;
138
+ contentContainer = /*#__PURE__*/_react.default.createElement(_components.Content, null, content);
139
+ doneElement = doneText ? /*#__PURE__*/_react.default.createElement(_components.Done, {
140
+ button: buttonContainer,
141
+ text: doneText,
142
+ onPress: onDoneCallback
143
+ }) : null;
144
+ }
145
+ const contextValue = (0, _react.useMemo)(() => ({
146
+ theme,
147
+ isPrevDisabled,
148
+ isNextDisabled
149
+ }), [theme, isPrevDisabled, isNextDisabled]);
150
+ return /*#__PURE__*/_react.default.createElement(_context.ToolbarContext.Provider, {
151
+ value: contextValue
152
+ }, /*#__PURE__*/_react.default.createElement(_KeyboardStickyView.default, {
111
153
  enabled: enabled,
112
154
  offset: offset,
113
155
  style: containerStyle
114
156
  }, /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
115
157
  style: toolbarStyle,
116
158
  testID: _constants.TEST_ID_KEYBOARD_TOOLBAR
117
- }), blur, showArrows && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
118
- style: styles.arrows
119
- }, /*#__PURE__*/_react.default.createElement(ButtonContainer, {
120
- accessibilityHint: "Moves focus to the previous field",
121
- accessibilityLabel: "Previous",
122
- disabled: isPrevDisabled,
123
- testID: _constants.TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS,
124
- theme: theme,
125
- onPress: onPressPrev
126
- }, /*#__PURE__*/_react.default.createElement(IconContainer, {
127
- disabled: isPrevDisabled,
128
- theme: theme,
129
- type: "prev"
130
- })), /*#__PURE__*/_react.default.createElement(ButtonContainer, {
131
- accessibilityHint: "Moves focus to the next field",
132
- accessibilityLabel: "Next",
133
- disabled: isNextDisabled,
134
- testID: _constants.TEST_ID_KEYBOARD_TOOLBAR_NEXT,
135
- theme: theme,
136
- onPress: onPressNext
137
- }, /*#__PURE__*/_react.default.createElement(IconContainer, {
138
- disabled: isNextDisabled,
139
- theme: theme,
140
- type: "next"
141
- }))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
142
- style: styles.flex,
143
- testID: _constants.TEST_ID_KEYBOARD_TOOLBAR_CONTENT
144
- }, content), doneText && /*#__PURE__*/_react.default.createElement(ButtonContainer, {
145
- accessibilityHint: "Closes the keyboard",
146
- accessibilityLabel: "Done",
147
- rippleRadius: 28,
148
- style: styles.doneButtonContainer,
149
- testID: _constants.TEST_ID_KEYBOARD_TOOLBAR_DONE,
150
- theme: theme,
151
- onPress: onPressDone
152
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
153
- maxFontSizeMultiplier: 1.3,
154
- style: doneStyle
155
- }, doneText))));
159
+ }), backgroundElement, arrowsElement, contentContainer, doneElement)));
156
160
  };
157
161
  const styles = _reactNative.StyleSheet.create({
158
- flex: {
159
- flex: 1
160
- },
161
162
  toolbar: {
162
163
  position: "absolute",
163
164
  bottom: 0,
@@ -170,19 +171,16 @@ const styles = _reactNative.StyleSheet.create({
170
171
  flexDirection: "row",
171
172
  paddingLeft: 8
172
173
  },
173
- doneButton: {
174
- fontWeight: "600",
175
- fontSize: 15
176
- },
177
- doneButtonContainer: {
178
- marginRight: 16,
179
- marginLeft: 8
180
- },
181
174
  floating: {
182
175
  alignSelf: "center",
183
176
  borderRadius: 20,
184
177
  overflow: "hidden"
185
178
  }
186
179
  });
180
+ KeyboardToolbar.Background = _components.Background;
181
+ KeyboardToolbar.Content = _components.Content;
182
+ KeyboardToolbar.Prev = _components.Prev;
183
+ KeyboardToolbar.Next = _components.Next;
184
+ KeyboardToolbar.Done = _components.Done;
187
185
  var _default = exports.default = KeyboardToolbar;
188
186
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_bindings","_hooks","_module","_KeyboardStickyView","_interopRequireDefault","_Arrow","_Button","_colors","_constants","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","KeyboardToolbar","props","content","theme","colors","doneText","button","icon","showArrows","onNextCallback","onPrevCallback","onDoneCallback","blur","opacity","DEFAULT_OPACITY","offset","closed","opened","enabled","insets","rest","colorScheme","useKeyboardState","state","appearance","inputs","setInputs","useState","current","count","isPrevDisabled","isNextDisabled","useEffect","subscription","FocusedInputEvents","addListener","remove","doneStyle","useMemo","styles","doneButton","color","primary","toolbarStyle","toolbar","backgroundColor","background","KEYBOARD_HAS_ROUNDED_CORNERS","paddingLeft","left","paddingRight","right","floating","containerStyle","marginLeft","marginRight","KEYBOARD_TOOLBAR_HEIGHT","OPENED_OFFSET","ButtonContainer","Button","IconContainer","Arrow","onPressNext","useCallback","event","isDefaultPrevented","KeyboardController","setFocusTo","onPressPrev","onPressDone","dismiss","createElement","style","View","testID","TEST_ID_KEYBOARD_TOOLBAR","arrows","accessibilityHint","accessibilityLabel","disabled","TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS","onPress","type","TEST_ID_KEYBOARD_TOOLBAR_NEXT","flex","TEST_ID_KEYBOARD_TOOLBAR_CONTENT","rippleRadius","doneButtonContainer","TEST_ID_KEYBOARD_TOOLBAR_DONE","Text","maxFontSizeMultiplier","StyleSheet","create","position","bottom","alignItems","width","flexDirection","height","fontWeight","fontSize","alignSelf","borderRadius","overflow","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\n\nimport { FocusedInputEvents } from \"../../bindings\";\nimport { useKeyboardState } from \"../../hooks\";\nimport { KeyboardController } from \"../../module\";\nimport KeyboardStickyView from \"../KeyboardStickyView\";\n\nimport Arrow from \"./Arrow\";\nimport Button from \"./Button\";\nimport { colors } from \"./colors\";\nimport {\n DEFAULT_OPACITY,\n KEYBOARD_HAS_ROUNDED_CORNERS,\n KEYBOARD_TOOLBAR_HEIGHT,\n OPENED_OFFSET,\n TEST_ID_KEYBOARD_TOOLBAR,\n TEST_ID_KEYBOARD_TOOLBAR_CONTENT,\n TEST_ID_KEYBOARD_TOOLBAR_DONE,\n TEST_ID_KEYBOARD_TOOLBAR_NEXT,\n TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS,\n} from \"./constants\";\n\nimport type { HEX, KeyboardToolbarTheme } from \"./types\";\nimport type { KeyboardStickyViewProps } from \"../KeyboardStickyView\";\nimport type { ReactNode } from \"react\";\nimport type { GestureResponderEvent, ViewProps } from \"react-native\";\n\ntype SafeAreaInsets = {\n left: number;\n right: number;\n};\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?: React.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?: (event: GestureResponderEvent) => void;\n /**\n * A callback that is called when the user presses the previous button along with the default action.\n */\n onPrevCallback?: (event: GestureResponderEvent) => void;\n /**\n * A callback that is called when the user presses the done button along with the default action.\n */\n onDoneCallback?: (event: GestureResponderEvent) => void;\n /**\n * A component that applies blur effect to the toolbar.\n */\n blur?: React.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 /**\n * A object containing `left`/`right` properties. Used to specify proper container padding in landscape mode.\n */\n insets?: SafeAreaInsets;\n} & Pick<KeyboardStickyViewProps, \"offset\" | \"enabled\">;\n\n/**\n * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` buttons from left and\n * `Done` button from the right (to dismiss the keyboard). Allows to add customizable content (yours UI elements) in the middle.\n *\n * @param props - Component props.\n * @returns A component that is shown above the keyboard with `Prev`/`Next` and `Done` buttons.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/components/keyboard-toolbar|Documentation} page for more details.\n * @example\n * ```tsx\n * <KeyboardToolbar doneText=\"Close\" />\n * ```\n */\nconst KeyboardToolbar: React.FC<KeyboardToolbarProps> = (props) => {\n const {\n content,\n theme = colors,\n doneText = \"Done\",\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 insets,\n ...rest\n } = props;\n const colorScheme = useKeyboardState((state) => state.appearance);\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 !KEYBOARD_HAS_ROUNDED_CORNERS\n ? {\n paddingLeft: insets?.left,\n paddingRight: insets?.right,\n }\n : null,\n KEYBOARD_HAS_ROUNDED_CORNERS ? styles.floating : null,\n ],\n [colorScheme, opacity, theme, insets],\n );\n const containerStyle = useMemo(\n () => [\n KEYBOARD_HAS_ROUNDED_CORNERS\n ? {\n marginLeft: (insets?.left ?? 0) + 16,\n marginRight: (insets?.right ?? 0) + 16,\n }\n : null,\n ],\n [insets],\n );\n const offset = useMemo(\n () => ({\n closed: closed + KEYBOARD_TOOLBAR_HEIGHT,\n opened: opened + OPENED_OFFSET,\n }),\n [closed, opened],\n );\n const ButtonContainer = button || Button;\n const IconContainer = icon || Arrow;\n\n const onPressNext = useCallback(\n (event: GestureResponderEvent) => {\n onNextCallback?.(event);\n\n if (!event.isDefaultPrevented()) {\n KeyboardController.setFocusTo(\"next\");\n }\n },\n [onNextCallback],\n );\n const onPressPrev = useCallback(\n (event: GestureResponderEvent) => {\n onPrevCallback?.(event);\n\n if (!event.isDefaultPrevented()) {\n KeyboardController.setFocusTo(\"prev\");\n }\n },\n [onPrevCallback],\n );\n const onPressDone = useCallback(\n (event: GestureResponderEvent) => {\n onDoneCallback?.(event);\n\n if (!event.isDefaultPrevented()) {\n KeyboardController.dismiss();\n }\n },\n [onDoneCallback],\n );\n\n return (\n <KeyboardStickyView\n enabled={enabled}\n offset={offset}\n style={containerStyle}\n >\n <View {...rest} style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>\n {blur}\n {showArrows && (\n <View style={styles.arrows}>\n <ButtonContainer\n accessibilityHint=\"Moves focus to the previous field\"\n accessibilityLabel=\"Previous\"\n disabled={isPrevDisabled}\n testID={TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS}\n theme={theme}\n onPress={onPressPrev}\n >\n <IconContainer\n disabled={isPrevDisabled}\n theme={theme}\n type=\"prev\"\n />\n </ButtonContainer>\n <ButtonContainer\n accessibilityHint=\"Moves focus to the next field\"\n accessibilityLabel=\"Next\"\n disabled={isNextDisabled}\n testID={TEST_ID_KEYBOARD_TOOLBAR_NEXT}\n theme={theme}\n onPress={onPressNext}\n >\n <IconContainer\n disabled={isNextDisabled}\n theme={theme}\n type=\"next\"\n />\n </ButtonContainer>\n </View>\n )}\n\n <View style={styles.flex} testID={TEST_ID_KEYBOARD_TOOLBAR_CONTENT}>\n {content}\n </View>\n {doneText && (\n <ButtonContainer\n accessibilityHint=\"Closes the keyboard\"\n accessibilityLabel=\"Done\"\n rippleRadius={28}\n style={styles.doneButtonContainer}\n testID={TEST_ID_KEYBOARD_TOOLBAR_DONE}\n theme={theme}\n onPress={onPressDone}\n >\n <Text maxFontSizeMultiplier={1.3} style={doneStyle}>\n {doneText}\n </Text>\n </ButtonContainer>\n )}\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 },\n arrows: {\n flexDirection: \"row\",\n paddingLeft: 8,\n },\n doneButton: {\n fontWeight: \"600\",\n fontSize: 15,\n },\n doneButtonContainer: {\n marginRight: 16,\n marginLeft: 8,\n },\n floating: {\n alignSelf: \"center\",\n borderRadius: 20,\n overflow: \"hidden\",\n },\n});\n\nexport { colors as DefaultKeyboardToolbarTheme };\nexport default KeyboardToolbar;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAC,sBAAA,CAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,OAAA,GAAAF,sBAAA,CAAAN,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAUqB,SAAAM,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAA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,kBAAkB,EAAC,MAAM;IACzBQ,YAAY,EAAE,EAAG;IACjBd,KAAK,EAAEjC,MAAM,CAACgD,mBAAoB;IAClCb,MAAM,EAAEc,wCAA8B;IACtCrF,KAAK,EAAEA,KAAM;IACb8E,OAAO,EAAEZ;EAAY,gBAErB5G,MAAA,CAAAe,OAAA,CAAA+F,aAAA,CAAC3G,YAAA,CAAA6H,IAAI;IAACC,qBAAqB,EAAE,GAAI;IAAClB,KAAK,EAAEnC;EAAU,GAChDhC,QACG,CACS,CAEf,CACY,CAAC;AAEzB,CAAC;AAED,MAAMkC,MAAM,GAAGoD,uBAAU,CAACC,MAAM,CAAC;EAC/BR,IAAI,EAAE;IACJA,IAAI,EAAE;EACR,CAAC;EACDxC,OAAO,EAAE;IACPiD,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,KAAK;IACpBC,MAAM,EAAE1C;EACV,CAAC;EACDoB,MAAM,EAAE;IACNqB,aAAa,EAAE,KAAK;IACpBjD,WAAW,EAAE;EACf,CAAC;EACDR,UAAU,EAAE;IACV2D,UAAU,EAAE,KAAK;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACDb,mBAAmB,EAAE;IACnBhC,WAAW,EAAE,EAAE;IACfD,UAAU,EAAE;EACd,CAAC;EACDF,QAAQ,EAAE;IACRiD,SAAS,EAAE,QAAQ;IACnBC,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjI,OAAA,GAGYwB,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_bindings","_hooks","_KeyboardStickyView","_interopRequireDefault","_Arrow","_Button","_colors","_components","_context","_constants","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","KeyboardToolbar","props","children","content","theme","colors","doneText","button","icon","showArrows","onNextCallback","onPrevCallback","onDoneCallback","blur","opacity","DEFAULT_OPACITY","offset","closed","opened","enabled","insets","rest","colorScheme","useKeyboardState","state","appearance","inputs","setInputs","useState","current","count","isPrevDisabled","isNextDisabled","buttonContainer","Button","iconContainer","Arrow","useEffect","subscription","FocusedInputEvents","addListener","remove","toolbarStyle","useMemo","styles","toolbar","backgroundColor","background","KEYBOARD_HAS_ROUNDED_CORNERS","paddingLeft","left","paddingRight","right","floating","containerStyle","marginLeft","marginRight","KEYBOARD_TOOLBAR_HEIGHT","OPENED_OFFSET","backgroundElement","arrowsElement","contentContainer","doneElement","prevChild","nextChild","contentChild","doneChild","backgroundChild","React","Children","forEach","child","isValidElement","type","Background","Content","Prev","Next","Done","createElement","View","style","arrows","onPress","text","contextValue","ToolbarContext","Provider","value","testID","TEST_ID_KEYBOARD_TOOLBAR","StyleSheet","create","position","bottom","alignItems","width","flexDirection","height","alignSelf","borderRadius","overflow","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { StyleSheet, View } from \"react-native\";\n\nimport { FocusedInputEvents } from \"../../bindings\";\nimport { useKeyboardState } from \"../../hooks\";\nimport KeyboardStickyView from \"../KeyboardStickyView\";\n\nimport Arrow from \"./Arrow\";\nimport Button from \"./Button\";\nimport { colors } from \"./colors\";\nimport { Background, Content, Done, Next, Prev } from \"./compound/components\";\nimport { ToolbarContext } from \"./compound/context\";\nimport {\n DEFAULT_OPACITY,\n KEYBOARD_HAS_ROUNDED_CORNERS,\n KEYBOARD_TOOLBAR_HEIGHT,\n OPENED_OFFSET,\n TEST_ID_KEYBOARD_TOOLBAR,\n} from \"./constants\";\n\nimport type { KeyboardToolbarProps } from \"./types\";\nimport type { ReactNode } from \"react\";\n\n/**\n * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` buttons from left and\n * `Done` button from the right (to dismiss the keyboard). Allows to add customizable content (yours UI elements) in the middle.\n *\n * @param props - Component props.\n * @returns A component that is shown above the keyboard with `Prev`/`Next` and `Done` buttons.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/components/keyboard-toolbar|Documentation} page for more details.\n * @example\n * ```tsx\n * <KeyboardToolbar>\n * <KeyboardToolbar.Done text=\"Close\" />\n * </KeyboardToolbar>\n * ```\n */\nconst KeyboardToolbar: React.FC<KeyboardToolbarProps> & {\n Background: typeof Background;\n Content: typeof Content;\n Prev: typeof Prev;\n Next: typeof Next;\n Done: typeof Done;\n} = (props) => {\n const {\n children,\n content,\n theme = colors,\n doneText = \"Done\",\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 insets,\n ...rest\n } = props;\n const colorScheme = useKeyboardState((state) => state.appearance);\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 const buttonContainer = button ?? Button;\n const iconContainer = icon ?? Arrow;\n\n useEffect(() => {\n const subscription = FocusedInputEvents.addListener(\"focusDidSet\", (e) => {\n setInputs(e);\n });\n\n return subscription.remove;\n }, []);\n const toolbarStyle = useMemo(\n () => [\n styles.toolbar,\n {\n backgroundColor: `${theme[colorScheme].background}${opacity}`,\n },\n !KEYBOARD_HAS_ROUNDED_CORNERS\n ? {\n paddingLeft: insets?.left,\n paddingRight: insets?.right,\n }\n : null,\n KEYBOARD_HAS_ROUNDED_CORNERS ? styles.floating : null,\n ],\n [colorScheme, opacity, theme, insets],\n );\n const containerStyle = useMemo(\n () => [\n KEYBOARD_HAS_ROUNDED_CORNERS\n ? {\n marginLeft: (insets?.left ?? 0) + 16,\n marginRight: (insets?.right ?? 0) + 16,\n }\n : null,\n ],\n [insets],\n );\n const offset = useMemo(\n () => ({\n closed: closed + KEYBOARD_TOOLBAR_HEIGHT,\n opened: opened + OPENED_OFFSET,\n }),\n [closed, opened],\n );\n\n let backgroundElement: ReactNode = null;\n let arrowsElement: ReactNode = null;\n let contentContainer: ReactNode = null;\n let doneElement: ReactNode = null;\n\n if (children) {\n let prevChild: ReactNode = null;\n let nextChild: ReactNode = null;\n let contentChild: ReactNode = null;\n let doneChild: ReactNode = null;\n let backgroundChild: ReactNode = null;\n\n React.Children.forEach(children, (child) => {\n if (!React.isValidElement(child)) {\n return;\n }\n const type = child.type;\n\n if (type === Background) {\n backgroundChild = child;\n } else if (type === Content) {\n contentChild = child;\n } else if (type === Prev) {\n prevChild = child;\n } else if (type === Next) {\n nextChild = child;\n } else if (type === Done) {\n doneChild = child;\n }\n });\n\n backgroundElement = backgroundChild;\n doneElement = doneChild;\n arrowsElement =\n prevChild || nextChild ? (\n <View style={styles.arrows}>\n {prevChild}\n {nextChild}\n </View>\n ) : null;\n contentContainer = contentChild ?? <Content>{contentChild}</Content>;\n } else {\n backgroundElement = blur;\n arrowsElement = showArrows ? (\n <View style={styles.arrows}>\n <Prev\n button={buttonContainer}\n icon={iconContainer}\n onPress={onPrevCallback}\n />\n <Next\n button={buttonContainer}\n icon={iconContainer}\n onPress={onNextCallback}\n />\n </View>\n ) : null;\n contentContainer = <Content>{content}</Content>;\n doneElement = doneText ? (\n <Done button={buttonContainer} text={doneText} onPress={onDoneCallback} />\n ) : null;\n }\n\n const contextValue = useMemo(\n () => ({\n theme,\n isPrevDisabled,\n isNextDisabled,\n }),\n [theme, isPrevDisabled, isNextDisabled],\n );\n\n return (\n <ToolbarContext.Provider value={contextValue}>\n <KeyboardStickyView\n enabled={enabled}\n offset={offset}\n style={containerStyle}\n >\n <View {...rest} style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>\n {backgroundElement}\n {arrowsElement}\n {contentContainer}\n {doneElement}\n </View>\n </KeyboardStickyView>\n </ToolbarContext.Provider>\n );\n};\n\nconst styles = StyleSheet.create({\n toolbar: {\n position: \"absolute\",\n bottom: 0,\n alignItems: \"center\",\n width: \"100%\",\n flexDirection: \"row\",\n height: KEYBOARD_TOOLBAR_HEIGHT,\n },\n arrows: {\n flexDirection: \"row\",\n paddingLeft: 8,\n },\n floating: {\n alignSelf: \"center\",\n borderRadius: 20,\n overflow: \"hidden\",\n },\n});\n\nKeyboardToolbar.Background = Background;\nKeyboardToolbar.Content = Content;\nKeyboardToolbar.Prev = Prev;\nKeyboardToolbar.Next = Next;\nKeyboardToolbar.Done = Done;\n\nexport { colors as DefaultKeyboardToolbarTheme, KeyboardToolbarProps };\nexport default KeyboardToolbar;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,OAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AAMqB,SAAAK,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAb,wBAAAa,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAjB,uBAAA,YAAAA,CAAAa,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,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C,OAAO,EAAE;IACPgD,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,KAAK;IACpBC,MAAM,EAAEzC;EACV,CAAC;EACDyB,MAAM,EAAE;IACNe,aAAa,EAAE,KAAK;IACpBhD,WAAW,EAAE;EACf,CAAC;EACDI,QAAQ,EAAE;IACR8C,SAAS,EAAE,QAAQ;IACnBC,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEFrG,eAAe,CAAC0E,UAAU,GAAGA,sBAAU;AACvC1E,eAAe,CAAC2E,OAAO,GAAGA,mBAAO;AACjC3E,eAAe,CAAC4E,IAAI,GAAGA,gBAAI;AAC3B5E,eAAe,CAAC6E,IAAI,GAAGA,gBAAI;AAC3B7E,eAAe,CAAC8E,IAAI,GAAGA,gBAAI;AAAC,IAAAwB,QAAA,GAAAC,OAAA,CAAA9H,OAAA,GAGbuB,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 Arrow from \"./Arrow\";\nimport type Button from \"./Button\";\nimport type { KeyboardStickyViewProps } from \"../KeyboardStickyView\";\nimport type { ReactNode } from \"react\";\nimport type {\n ColorValue,\n GestureResponderEvent,\n ViewProps,\n} 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\ntype SafeAreaInsets = {\n left: number;\n right: number;\n};\n\nexport type KeyboardToolbarProps = Omit<\n ViewProps,\n \"style\" | \"testID\" | \"children\"\n> & {\n /**\n * An element that is shown in the middle of the toolbar.\n *\n * @deprecated Use compound API with `<KeyboardToolbar.Content />` component instead.\n */\n content?: React.JSX.Element | null;\n /** A set of dark/light colors consumed by toolbar component. */\n theme?: KeyboardToolbarTheme;\n /**\n * Custom text for done button.\n *\n * @deprecated Use compound API with `<KeyboardToolbar.Done />` component and `text` prop instead.\n */\n doneText?: ReactNode;\n /**\n * Custom touchable component for toolbar (used for prev/next/done buttons).\n *\n * @deprecated Use `button` property for corresponding element instead:\n * ```tsx\n * <KeyboardToolbar>\n * <KeyboardToolbar.Prev button={MyCustomButton} />\n * </KeyboardToolbar>\n * ```.\n */\n button?: typeof Button;\n /**\n * Custom icon component used to display next/prev buttons.\n *\n * @deprecated Use `icon` property for corresponding element instead:\n * ```tsx\n * <KeyboardToolbar>\n * <KeyboardToolbar.Prev icon={MyCustomIcon} />\n * </KeyboardToolbar>\n * ```.\n */\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 * @deprecated Use compound API and conditional rendering for `<KeyboardToolbar.Next />` and `<KeyboardToolbar.Prev />`.\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 * @deprecated Use compound API with `<KeyboardToolbar.Next />` and `onPress` callback instead.\n */\n onNextCallback?: (event: GestureResponderEvent) => void;\n /**\n * A callback that is called when the user presses the previous button along with the default action.\n *\n * @deprecated Use compound API with `<KeyboardToolbar.Prev />` and `onPress` callback instead.\n */\n onPrevCallback?: (event: GestureResponderEvent) => void;\n /**\n * A callback that is called when the user presses the done button along with the default action.\n *\n * @deprecated Use compound API with `<KeyboardToolbar.Done />` and `onPress` callback instead.\n */\n onDoneCallback?: (event: GestureResponderEvent) => void;\n /**\n * A component that applies blur effect to the toolbar.\n *\n * @deprecated Use compound API and `<KeyboardToolbar.Effect />` instead.\n */\n blur?: React.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 /**\n * A object containing `left`/`right` properties. Used to specify proper container padding in landscape mode.\n */\n insets?: SafeAreaInsets;\n /** JSX children in case if compound API is used. */\n children?: ReactNode;\n} & Pick<KeyboardStickyViewProps, \"offset\" | \"enabled\">;\n"],"mappings":"","ignoreList":[]}
@@ -37,7 +37,6 @@ var _KeyboardAvoidingView = _interopRequireDefault(require("./KeyboardAvoidingVi
37
37
  var _KeyboardStickyView = _interopRequireDefault(require("./KeyboardStickyView"));
38
38
  var _KeyboardAwareScrollView = _interopRequireDefault(require("./KeyboardAwareScrollView"));
39
39
  var _KeyboardToolbar = _interopRequireWildcard(require("./KeyboardToolbar"));
40
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
41
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
40
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
42
41
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
43
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_KeyboardAvoidingView","_interopRequireDefault","require","_KeyboardStickyView","_KeyboardAwareScrollView","_KeyboardToolbar","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set"],"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,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,wBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,gBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAG2B,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAAA,SAAAf,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAI,UAAA,GAAAJ,CAAA,KAAAK,OAAA,EAAAL,CAAA","ignoreList":[]}
1
+ {"version":3,"names":["_KeyboardAvoidingView","_interopRequireDefault","require","_KeyboardStickyView","_KeyboardAwareScrollView","_KeyboardToolbar","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"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,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,wBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,gBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAG2B,SAAAI,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAAA,SAAAP,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAK,UAAA,GAAAL,CAAA,KAAAU,OAAA,EAAAV,CAAA","ignoreList":[]}
@@ -7,10 +7,10 @@ exports.useWindowDimensions = void 0;
7
7
  var _react = require("react");
8
8
  var _reactNative = require("react-native");
9
9
  var _bindings = require("../../bindings");
10
- const screen = _reactNative.Dimensions.get("screen");
10
+ const window = _reactNative.Dimensions.get("window");
11
11
  let initialDimensions = {
12
- width: screen.width,
13
- height: screen.height
12
+ width: window.width,
13
+ height: window.height
14
14
  };
15
15
  _bindings.WindowDimensionsEvents.addListener("windowDidResize", e => {
16
16
  initialDimensions = e;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_reactNative","_bindings","screen","Dimensions","get","initialDimensions","width","height","WindowDimensionsEvents","addListener","e","useWindowDimensions","dimensions","setDimensions","useState","useEffect","subscription","remove","exports"],"sources":["index.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { Dimensions } from \"react-native\";\n\nimport { WindowDimensionsEvents } from \"../../bindings\";\n\nimport type { WindowDimensionsEventData } from \"../../types\";\n\nconst screen = Dimensions.get(\"screen\");\n\nlet initialDimensions: WindowDimensionsEventData = {\n width: screen.width,\n height: screen.height,\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,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAIA,MAAMG,MAAM,GAAGC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC;AAEvC,IAAIC,iBAA4C,GAAG;EACjDC,KAAK,EAAEJ,MAAM,CAACI,KAAK;EACnBC,MAAM,EAAEL,MAAM,CAACK;AACjB,CAAC;AAEDC,gCAAsB,CAACC,WAAW,CAAC,iBAAiB,EAAGC,CAAC,IAAK;EAC3DL,iBAAiB,GAAGK,CAAC;AACvB,CAAC,CAAC;AAEK,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,EAACT,iBAAiB,CAAC;EAE/D,IAAAU,gBAAS,EAAC,MAAM;IACd,MAAMC,YAAY,GAAGR,gCAAsB,CAACC,WAAW,CACrD,iBAAiB,EAChBC,CAAC,IAAK;MACLG,aAAa,CAACH,CAAC,CAAC;IAClB,CACF,CAAC;;IAED;IACA;IACA;IACAG,aAAa,CAACR,iBAAiB,CAAC;IAEhC,OAAO,MAAM;MACXW,YAAY,CAACC,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOL,UAAU;AACnB,CAAC;AAACM,OAAA,CAAAP,mBAAA,GAAAA,mBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_reactNative","_bindings","window","Dimensions","get","initialDimensions","width","height","WindowDimensionsEvents","addListener","e","useWindowDimensions","dimensions","setDimensions","useState","useEffect","subscription","remove","exports"],"sources":["index.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { Dimensions } from \"react-native\";\n\nimport { WindowDimensionsEvents } from \"../../bindings\";\n\nimport type { WindowDimensionsEventData } from \"../../types\";\n\nconst window = Dimensions.get(\"window\");\n\nlet initialDimensions: WindowDimensionsEventData = {\n width: window.width,\n height: window.height,\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,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAIA,MAAMG,MAAM,GAAGC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC;AAEvC,IAAIC,iBAA4C,GAAG;EACjDC,KAAK,EAAEJ,MAAM,CAACI,KAAK;EACnBC,MAAM,EAAEL,MAAM,CAACK;AACjB,CAAC;AAEDC,gCAAsB,CAACC,WAAW,CAAC,iBAAiB,EAAGC,CAAC,IAAK;EAC3DL,iBAAiB,GAAGK,CAAC;AACvB,CAAC,CAAC;AAEK,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,EAACT,iBAAiB,CAAC;EAE/D,IAAAU,gBAAS,EAAC,MAAM;IACd,MAAMC,YAAY,GAAGR,gCAAsB,CAACC,WAAW,CACrD,iBAAiB,EAChBC,CAAC,IAAK;MACLG,aAAa,CAACH,CAAC,CAAC;IAClB,CACF,CAAC;;IAED;IACA;IACA;IACAG,aAAa,CAACR,iBAAiB,CAAC;IAEhC,OAAO,MAAM;MACXW,YAAY,CAACC,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOL,UAAU;AACnB,CAAC;AAACM,OAAA,CAAAP,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -24,6 +24,7 @@ _bindings.KeyboardEvents.addListener("keyboardDidShow", e => {
24
24
  });
25
25
  const dismiss = async options => {
26
26
  const keepFocus = (options === null || options === void 0 ? void 0 : options.keepFocus) ?? false;
27
+ const animated = (options === null || options === void 0 ? void 0 : options.animated) ?? true;
27
28
  return new Promise(resolve => {
28
29
  if (isClosed) {
29
30
  resolve();
@@ -33,7 +34,7 @@ const dismiss = async options => {
33
34
  resolve(undefined);
34
35
  subscription.remove();
35
36
  });
36
- _bindings.KeyboardControllerNative.dismiss(keepFocus);
37
+ _bindings.KeyboardControllerNative.dismiss(keepFocus, animated);
37
38
  });
38
39
  };
39
40
  const isVisible = () => !isClosed;
@@ -1 +1 @@
1
- {"version":3,"names":["_bindings","require","isClosed","lastState","height","duration","timestamp","Date","getTime","target","type","appearance","KeyboardEvents","addListener","e","dismiss","options","keepFocus","Promise","resolve","subscription","undefined","remove","KeyboardControllerNative","isVisible","state","KeyboardController","exports","setDefaultMode","setInputMode","setFocusTo","preload"],"sources":["module.ts"],"sourcesContent":["import { KeyboardControllerNative, KeyboardEvents } from \"./bindings\";\n\nimport type {\n DismissOptions,\n KeyboardControllerModule,\n KeyboardEventData,\n} from \"./types\";\n\nlet isClosed = true;\nlet lastState: KeyboardEventData = {\n height: 0,\n duration: 0,\n timestamp: new Date().getTime(),\n target: -1,\n type: \"default\",\n appearance: \"light\",\n};\n\nKeyboardEvents.addListener(\"keyboardDidHide\", (e) => {\n isClosed = true;\n lastState = e;\n});\n\nKeyboardEvents.addListener(\"keyboardDidShow\", (e) => {\n isClosed = false;\n lastState = e;\n});\n\nconst dismiss = async (options?: DismissOptions): Promise<void> => {\n const keepFocus = options?.keepFocus ?? false;\n\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 = () => lastState;\n\n/**\n * KeyboardController module. Helps to perform imperative actions/checks with keyboard.\n */\nexport const KeyboardController: KeyboardControllerModule = {\n setDefaultMode: KeyboardControllerNative.setDefaultMode,\n setInputMode: KeyboardControllerNative.setInputMode,\n setFocusTo: KeyboardControllerNative.setFocusTo,\n preload: KeyboardControllerNative.preload,\n dismiss,\n isVisible,\n state,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAQA,IAAIC,QAAQ,GAAG,IAAI;AACnB,IAAIC,SAA4B,GAAG;EACjCC,MAAM,EAA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/CC,OAAO,EAAER,kCAAwB,CAACQ,OAAO;EACzChB,OAAO;EACPS,SAAS;EACTC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_bindings","require","isClosed","lastState","height","duration","timestamp","Date","getTime","target","type","appearance","KeyboardEvents","addListener","e","dismiss","options","keepFocus","animated","Promise","resolve","subscription","undefined","remove","KeyboardControllerNative","isVisible","state","KeyboardController","exports","setDefaultMode","setInputMode","setFocusTo","preload"],"sources":["module.ts"],"sourcesContent":["import { KeyboardControllerNative, KeyboardEvents } from \"./bindings\";\n\nimport type {\n DismissOptions,\n KeyboardControllerModule,\n KeyboardEventData,\n} from \"./types\";\n\nlet isClosed = true;\nlet lastState: KeyboardEventData = {\n height: 0,\n duration: 0,\n timestamp: new Date().getTime(),\n target: -1,\n type: \"default\",\n appearance: \"light\",\n};\n\nKeyboardEvents.addListener(\"keyboardDidHide\", (e) => {\n isClosed = true;\n lastState = e;\n});\n\nKeyboardEvents.addListener(\"keyboardDidShow\", (e) => {\n isClosed = false;\n lastState = e;\n});\n\nconst dismiss = async (options?: Partial<DismissOptions>): Promise<void> => {\n const keepFocus = options?.keepFocus ?? false;\n const animated = options?.animated ?? true;\n\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, animated);\n });\n};\nconst isVisible = () => !isClosed;\nconst state = () => lastState;\n\n/**\n * KeyboardController module. Helps to perform imperative actions/checks with keyboard.\n */\nexport const KeyboardController: KeyboardControllerModule = {\n setDefaultMode: KeyboardControllerNative.setDefaultMode,\n setInputMode: KeyboardControllerNative.setInputMode,\n setFocusTo: KeyboardControllerNative.setFocusTo,\n preload: KeyboardControllerNative.preload,\n dismiss,\n isVisible,\n state,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAQA,IAAIC,QAAQ,GAAG,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AAC,OAAA,CAAAD,kBAAA,GAAG;EAC1DE,cAAc,EAAEL,kCAAwB,CAACK,cAAc;EACvDC,YAAY,EAAEN,kCAAwB,CAACM,YAAY;EACnDC,UAAU,EAAEP,kCAAwB,CAACO,UAAU;EAC/CC,OAAO,EAAER,kCAAwB,CAACQ,OAAO;EACzCjB,OAAO;EACPU,SAAS;EACTC;AACF,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_default","exports","default","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 preload(): 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,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAmBpCC,gCAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","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 preload(): void;\n dismiss(keepFocus: boolean, animated: 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,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAmBpCC,gCAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["module.ts"],"sourcesContent":["import type { EmitterSubscription, TextInputProps } from \"react-native\";\n\n// Event module declarations\nexport type KeyboardControllerEvents =\n | \"keyboardWillShow\"\n | \"keyboardDidShow\"\n | \"keyboardWillHide\"\n | \"keyboardDidHide\";\nexport type KeyboardEventData = {\n /** Height of the keyboard. */\n height: number;\n /** Duration of the keyboard animation. */\n duration: number;\n /** Timestamp of the last keyboard event. */\n timestamp: number;\n /** Tag of the focused `TextInput`. */\n target: number;\n /** `keyboardType` property from focused `TextInput`. */\n type: NonNullable<TextInputProps[\"keyboardType\"]>;\n /** Keyboard appearance. Can be one of `dark` or `light`. */\n appearance: \"dark\" | \"light\";\n};\n/**\n * An object that represent current keyboard state.\n */\nexport type KeyboardState = {\n /** Whether the keyboard is currently visible. */\n isVisible: boolean;\n} & KeyboardEventData;\nexport type KeyboardEventsModule = {\n /**\n * The `addListener` function connects a JavaScript function to an identified native\n * keyboard notification event.\n *\n * This function then returns the reference to the listener.\n *\n * `name` is the string that identifies the event you're listening for. This\n * can be any of the following:\n *\n * - `keyboardWillShow`;\n * - `keyboardDidShow`;\n * - `keyboardWillHide`;\n * - `keyboardDidHide`.\n */\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEventData) => void,\n ) => EmitterSubscription;\n};\nexport type Direction = \"next\" | \"prev\" | \"current\";\nexport type DismissOptions = {\n /**\n * A boolean property indicating whether focus should be kept on the input after dismissing the keyboard. Default is `false`.\n */\n keepFocus: boolean;\n};\nexport type KeyboardControllerModule = {\n // android only\n /**\n * Sets default `windowSoftInputMode` (the one that declared in `AndroidManifest.xml`).\n *\n * @platform android\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setdefaultmode-|docs} page for more details.\n */\n setDefaultMode: () => void;\n /**\n * Changes `windowSoftInputMode` on Android.\n *\n * @platform android\n * @see AndroidSoftInputModes for all possible values and {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setinputmode-|docs} page for more details.\n */\n setInputMode: (mode: number) => void;\n // ios only\n /**\n * A method that preloads the keyboard. It's useful when you want to avoid a delay when the user focuses the first input.\n *\n * @platform ios\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#preload-|docs} page for more details.\n */\n preload: () => void;\n // all platforms\n /**\n * Dismisses the active keyboard. Removes a focus by default, but allows to pass `{keepFocus: true}` to keep focus.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#dismiss|docs} page for more details.\n */\n dismiss: (options?: DismissOptions) => Promise<void>;\n /**\n * Moves focus to the specified direction (`next`, `prev` or `current` to restore a focus).\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setfocusto|docs} page for more details.\n */\n setFocusTo: (direction: Direction) => void;\n /**\n * Whether the keyboard is fully visible.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#isvisible|docs} page for more details.\n */\n isVisible: () => boolean;\n /**\n * Method that returns current keyboard state.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#state|docs} page for more details.\n */\n state: () => KeyboardEventData;\n};\nexport type KeyboardControllerNativeModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // ios only\n preload: () => void;\n // all platforms\n dismiss: (keepFocus: boolean) => void;\n setFocusTo: (direction: Direction) => void;\n // native event module stuff\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["module.ts"],"sourcesContent":["import type { EmitterSubscription, TextInputProps } from \"react-native\";\n\n// Event module declarations\nexport type KeyboardControllerEvents =\n | \"keyboardWillShow\"\n | \"keyboardDidShow\"\n | \"keyboardWillHide\"\n | \"keyboardDidHide\";\nexport type KeyboardEventData = {\n /** Height of the keyboard. */\n height: number;\n /** Duration of the keyboard animation. */\n duration: number;\n /** Timestamp of the last keyboard event. */\n timestamp: number;\n /** Tag of the focused `TextInput`. */\n target: number;\n /** `keyboardType` property from focused `TextInput`. */\n type: NonNullable<TextInputProps[\"keyboardType\"]>;\n /** Keyboard appearance. Can be one of `dark` or `light`. */\n appearance: \"dark\" | \"light\";\n};\n/**\n * An object that represent current keyboard state.\n */\nexport type KeyboardState = {\n /** Whether the keyboard is currently visible. */\n isVisible: boolean;\n} & KeyboardEventData;\nexport type KeyboardEventsModule = {\n /**\n * The `addListener` function connects a JavaScript function to an identified native\n * keyboard notification event.\n *\n * This function then returns the reference to the listener.\n *\n * `name` is the string that identifies the event you're listening for. This\n * can be any of the following:\n *\n * - `keyboardWillShow`;\n * - `keyboardDidShow`;\n * - `keyboardWillHide`;\n * - `keyboardDidHide`.\n */\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEventData) => void,\n ) => EmitterSubscription;\n};\nexport type Direction = \"next\" | \"prev\" | \"current\";\nexport type DismissOptions = {\n /**\n * A boolean property indicating whether focus should be kept on the input after dismissing the keyboard. Default is `false`.\n */\n keepFocus: boolean;\n /**\n * A boolean property controlling whether dismissal should be animated. Default is `true`.\n */\n animated: boolean;\n};\nexport type KeyboardControllerModule = {\n // android only\n /**\n * Sets default `windowSoftInputMode` (the one that declared in `AndroidManifest.xml`).\n *\n * @platform android\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setdefaultmode-|docs} page for more details.\n */\n setDefaultMode: () => void;\n /**\n * Changes `windowSoftInputMode` on Android.\n *\n * @platform android\n * @see AndroidSoftInputModes for all possible values and {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setinputmode-|docs} page for more details.\n */\n setInputMode: (mode: number) => void;\n // ios only\n /**\n * A method that preloads the keyboard. It's useful when you want to avoid a delay when the user focuses the first input.\n *\n * @platform ios\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#preload-|docs} page for more details.\n */\n preload: () => void;\n // all platforms\n /**\n * Dismisses the active keyboard. Removes a focus by default, but allows to pass `{keepFocus: true}` to keep focus.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#dismiss|docs} page for more details.\n */\n dismiss: (options?: DismissOptions) => Promise<void>;\n /**\n * Moves focus to the specified direction (`next`, `prev` or `current` to restore a focus).\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setfocusto|docs} page for more details.\n */\n setFocusTo: (direction: Direction) => void;\n /**\n * Whether the keyboard is fully visible.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#isvisible|docs} page for more details.\n */\n isVisible: () => boolean;\n /**\n * Method that returns current keyboard state.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#state|docs} page for more details.\n */\n state: () => KeyboardEventData;\n};\nexport type KeyboardControllerNativeModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // ios only\n preload: () => void;\n // all platforms\n dismiss: (keepFocus: boolean, animated: boolean) => void;\n setFocusTo: (direction: Direction) => void;\n // native event module stuff\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n};\n"],"mappings":"","ignoreList":[]}
@@ -8,8 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _bindings = require("../../bindings");
10
10
  var _hooks = require("../../hooks");
11
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
12
  /**
14
13
  * A view component that renders its children over the keyboard without closing the keyboard.
15
14
  * Acts similar to modal, but doesn't close the keyboard when it's visible.
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_bindings","_hooks","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","OverKeyboardView","props","children","visible","height","width","useWindowDimensions","inner","useMemo","style","styles","absolute","Platform","OS","undefined","stretch","createElement","RCTOverKeyboardView","View","collapsable","StyleSheet","create","position","top","bottom","left","right","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Platform, StyleSheet, View } from \"react-native\";\n\nimport { RCTOverKeyboardView } from \"../../bindings\";\nimport { useWindowDimensions } from \"../../hooks\";\n\nimport type { OverKeyboardViewProps } from \"../../types\";\nimport type { PropsWithChildren } from \"react\";\n\n/**\n * A view component that renders its children over the keyboard without closing the keyboard.\n * Acts similar to modal, but doesn't close the keyboard when it's visible.\n *\n * @param props - Component props.\n * @returns A view component that renders over the keyboard.\n * @example\n * ```tsx\n * <OverKeyboardView visible={true}>\n * <Text>This will appear over the keyboard</Text>\n * </OverKeyboardView>\n * ```\n */\nconst OverKeyboardView = (props: PropsWithChildren<OverKeyboardViewProps>) => {\n const { children, visible } = props;\n const { height, width } = useWindowDimensions();\n const inner = useMemo(() => ({ height, width }), [height, width]);\n const style = useMemo(\n () => [\n styles.absolute,\n // On iOS - stretch view to full window dimensions to make yoga work\n Platform.OS === \"ios\" ? inner : undefined,\n // On Android - we are laid out by ShadowNode, so just stretch to full container\n Platform.OS === \"android\" ? styles.stretch : undefined,\n ],\n [inner],\n );\n\n return (\n <RCTOverKeyboardView visible={visible}>\n {/* `OverKeyboardView` should always have a single child */}\n <View collapsable={false} style={style}>\n {/* Match RN behavior and trigger mount/unmount when visibility changes */}\n {visible && children}\n </View>\n </RCTOverKeyboardView>\n );\n};\n\nconst styles = StyleSheet.create({\n absolute: {\n position: \"absolute\",\n },\n stretch: {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n },\n});\n\nexport default OverKeyboardView;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAkD,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAA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AK,GAAGN,KAAK,GAAGO,SAAS;EACzC;EACAF,qBAAQ,CAACC,EAAE,KAAK,SAAS,GAAGH,MAAM,CAACK,OAAO,GAAGD,SAAS,CACvD,EACD,CAACP,KAAK,CACR,CAAC;EAED,oBACEjC,MAAA,CAAAY,OAAA,CAAA8B,aAAA,CAACtC,SAAA,CAAAuC,mBAAmB;IAACd,OAAO,EAAEA;EAAQ,gBAEpC7B,MAAA,CAAAY,OAAA,CAAA8B,aAAA,CAACvC,YAAA,CAAAyC,IAAI;IAACC,WAAW,EAAE,KAAM;IAACV,KAAK,EAAEA;EAAM,GAEpCN,OAAO,IAAID,QACR,CACa,CAAC;AAE1B,CAAC;AAED,MAAMQ,MAAM,GAAGU,uBAAU,CAACC,MAAM,CAAC;EAC/BV,QAAQ,EAAE;IACRW,QAAQ,EAAE;EACZ,CAAC;EACDP,OAAO,EAAE;IACPQ,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1C,OAAA,GAEYc,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_bindings","_hooks","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","OverKeyboardView","props","children","visible","height","width","useWindowDimensions","inner","useMemo","style","styles","absolute","Platform","OS","undefined","stretch","createElement","RCTOverKeyboardView","View","collapsable","StyleSheet","create","position","top","bottom","left","right","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Platform, StyleSheet, View } from \"react-native\";\n\nimport { RCTOverKeyboardView } from \"../../bindings\";\nimport { useWindowDimensions } from \"../../hooks\";\n\nimport type { OverKeyboardViewProps } from \"../../types\";\nimport type { PropsWithChildren } from \"react\";\n\n/**\n * A view component that renders its children over the keyboard without closing the keyboard.\n * Acts similar to modal, but doesn't close the keyboard when it's visible.\n *\n * @param props - Component props.\n * @returns A view component that renders over the keyboard.\n * @example\n * ```tsx\n * <OverKeyboardView visible={true}>\n * <Text>This will appear over the keyboard</Text>\n * </OverKeyboardView>\n * ```\n */\nconst OverKeyboardView = (props: PropsWithChildren<OverKeyboardViewProps>) => {\n const { children, visible } = props;\n const { height, width } = useWindowDimensions();\n const inner = useMemo(() => ({ height, width }), [height, width]);\n const style = useMemo(\n () => [\n styles.absolute,\n // On iOS - stretch view to full window dimensions to make yoga work\n Platform.OS === \"ios\" ? inner : undefined,\n // On Android - we are laid out by ShadowNode, so just stretch to full container\n Platform.OS === \"android\" ? styles.stretch : undefined,\n ],\n [inner],\n );\n\n return (\n <RCTOverKeyboardView visible={visible}>\n {/* `OverKeyboardView` should always have a single child */}\n <View collapsable={false} style={style}>\n {/* Match RN behavior and trigger mount/unmount when visibility changes */}\n {visible && children}\n </View>\n </RCTOverKeyboardView>\n );\n};\n\nconst styles = StyleSheet.create({\n absolute: {\n position: \"absolute\",\n },\n stretch: {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n },\n});\n\nexport default OverKeyboardView;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAkD,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAA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D,CAACP,KAAK,CACR,CAAC;EAED,oBACEhC,MAAA,CAAAgB,OAAA,CAAAyB,aAAA,CAACrC,SAAA,CAAAsC,mBAAmB;IAACd,OAAO,EAAEA;EAAQ,gBAEpC5B,MAAA,CAAAgB,OAAA,CAAAyB,aAAA,CAACtC,YAAA,CAAAwC,IAAI;IAACC,WAAW,EAAE,KAAM;IAACV,KAAK,EAAEA;EAAM,GAEpCN,OAAO,IAAID,QACR,CACa,CAAC;AAE1B,CAAC;AAED,MAAMQ,MAAM,GAAGU,uBAAU,CAACC,MAAM,CAAC;EAC/BV,QAAQ,EAAE;IACRW,QAAQ,EAAE;EACZ,CAAC;EACDP,OAAO,EAAE;IACPQ,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArC,OAAA,GAEYS,gBAAgB","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ const Background = ({
3
+ children
4
+ }) => /*#__PURE__*/React.createElement(React.Fragment, null, children);
5
+ export default Background;
6
+ //# sourceMappingURL=Background.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Background","children","createElement","Fragment"],"sources":["Background.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { ReactNode } from \"react\";\n\nconst Background: React.FC<{ children: ReactNode }> = ({ children }) => (\n <>{children}</>\n);\n\nexport default Background;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAIzB,MAAMC,UAA6C,GAAGA,CAAC;EAAEC;AAAS,CAAC,kBACjEF,KAAA,CAAAG,aAAA,CAAAH,KAAA,CAAAI,QAAA,QAAGF,QAAW,CACf;AAED,eAAeD,UAAU","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { StyleSheet, View } from "react-native";
3
+ import { TEST_ID_KEYBOARD_TOOLBAR_CONTENT } from "../../constants";
4
+ const Content = ({
5
+ children
6
+ }) => {
7
+ return /*#__PURE__*/React.createElement(View, {
8
+ style: styles.flex,
9
+ testID: TEST_ID_KEYBOARD_TOOLBAR_CONTENT
10
+ }, children);
11
+ };
12
+ const styles = StyleSheet.create({
13
+ flex: {
14
+ flex: 1
15
+ }
16
+ });
17
+ export default Content;
18
+ //# sourceMappingURL=Content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","TEST_ID_KEYBOARD_TOOLBAR_CONTENT","Content","children","createElement","style","styles","flex","testID","create"],"sources":["Content.tsx"],"sourcesContent":["import React from \"react\";\nimport { StyleSheet, View } from \"react-native\";\n\nimport { TEST_ID_KEYBOARD_TOOLBAR_CONTENT } from \"../../constants\";\n\nimport type { ReactNode } from \"react\";\nimport type { ViewProps } from \"react-native\";\n\nconst Content: React.FC<ViewProps & { children?: ReactNode }> = ({\n children,\n}) => {\n return (\n <View style={styles.flex} testID={TEST_ID_KEYBOARD_TOOLBAR_CONTENT}>\n {children}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n flex: {\n flex: 1,\n },\n});\n\nexport default Content;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,gCAAgC,QAAQ,iBAAiB;AAKlE,MAAMC,OAAuD,GAAGA,CAAC;EAC/DC;AACF,CAAC,KAAK;EACJ,oBACEL,KAAA,CAAAM,aAAA,CAACJ,IAAI;IAACK,KAAK,EAAEC,MAAM,CAACC,IAAK;IAACC,MAAM,EAAEP;EAAiC,GAChEE,QACG,CAAC;AAEX,CAAC;AAED,MAAMG,MAAM,GAAGP,UAAU,CAACU,MAAM,CAAC;EAC/BF,IAAI,EAAE;IACJA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,eAAeL,OAAO","ignoreList":[]}