@onekeyfe/react-native-text-input 0.3.0 → 3.0.91

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 (77) hide show
  1. package/OneKeyTextInput.podspec +18 -0
  2. package/README.md +10 -28
  3. package/android/build.gradle +3 -3
  4. package/android/gradle.properties +5 -5
  5. package/android/src/main/java/com/textinput/TextInputViewManager.kt +2 -2
  6. package/ios/OneKeyTextInputPasteObserver.h +11 -0
  7. package/ios/OneKeyTextInputPasteObserver.mm +204 -0
  8. package/lib/module/AndroidTextInputNativeComponent.js +111 -0
  9. package/lib/{commonjs → module}/Input.js +127 -107
  10. package/lib/module/enum.js +7 -0
  11. package/lib/module/index.js +11 -0
  12. package/lib/module/package.json +1 -0
  13. package/lib/module/type.js +4 -0
  14. package/lib/typescript/package.json +1 -0
  15. package/lib/typescript/src/index.d.ts +4 -4
  16. package/lib/typescript/src/type.d.ts +2 -2
  17. package/package.json +32 -117
  18. package/react-native.config.js +12 -0
  19. package/src/AndroidTextInputNativeComponent.js +77 -88
  20. package/src/Input.js +242 -1027
  21. package/src/enum.ts +1 -1
  22. package/src/index.tsx +5 -5
  23. package/src/type.ts +2 -2
  24. package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/OneKeyTextInputManagerDelegate.java +0 -26
  25. package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/OneKeyTextInputManagerInterface.java +0 -17
  26. package/android/generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
  27. package/android/generated/android/app/build/generated/source/codegen/jni/RNTextInputViewSpec-generated.cpp +0 -22
  28. package/android/generated/android/app/build/generated/source/codegen/jni/RNTextInputViewSpec.h +0 -24
  29. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/ComponentDescriptors.cpp +0 -22
  30. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/ComponentDescriptors.h +0 -24
  31. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/EventEmitters.cpp +0 -24
  32. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/EventEmitters.h +0 -25
  33. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/Props.cpp +0 -25
  34. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/Props.h +0 -27
  35. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/RNTextInputViewSpecJSI-generated.cpp +0 -17
  36. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/RNTextInputViewSpecJSI.h +0 -19
  37. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/ShadowNodes.cpp +0 -17
  38. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/ShadowNodes.h +0 -32
  39. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/States.cpp +0 -16
  40. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/States.h +0 -29
  41. package/android/src/newarch/TextInputViewManagerSpec.kt +0 -21
  42. package/android/src/oldarch/TextInputViewManagerSpec.kt +0 -9
  43. package/ios/TextInputViewManager.mm +0 -23
  44. package/ios/Utils.h +0 -8
  45. package/ios/Utils.m +0 -26
  46. package/ios/generated/build/generated/ios/RNTextInputViewSpec/RNTextInputViewSpec-generated.mm +0 -16
  47. package/ios/generated/build/generated/ios/RNTextInputViewSpec/RNTextInputViewSpec.h +0 -38
  48. package/ios/generated/build/generated/ios/RNTextInputViewSpecJSI-generated.cpp +0 -17
  49. package/ios/generated/build/generated/ios/RNTextInputViewSpecJSI.h +0 -19
  50. package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/ComponentDescriptors.cpp +0 -22
  51. package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/ComponentDescriptors.h +0 -24
  52. package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/EventEmitters.cpp +0 -24
  53. package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/EventEmitters.h +0 -25
  54. package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/Props.cpp +0 -25
  55. package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/Props.h +0 -27
  56. package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/RCTComponentViewHelpers.h +0 -20
  57. package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/ShadowNodes.cpp +0 -17
  58. package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/ShadowNodes.h +0 -32
  59. package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/States.cpp +0 -16
  60. package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/States.h +0 -29
  61. package/lib/commonjs/AndroidTextInputNativeComponent.js +0 -152
  62. package/lib/commonjs/AndroidTextInputNativeComponent.js.map +0 -1
  63. package/lib/commonjs/Input.js.map +0 -1
  64. package/lib/commonjs/TextInputViewNativeComponent.ts +0 -9
  65. package/lib/commonjs/enum.js +0 -11
  66. package/lib/commonjs/enum.js.map +0 -1
  67. package/lib/commonjs/index.js +0 -28
  68. package/lib/commonjs/index.js.map +0 -1
  69. package/lib/commonjs/package.json +0 -1
  70. package/lib/commonjs/type.js +0 -6
  71. package/lib/commonjs/type.js.map +0 -1
  72. package/lib/typescript/src/TextInputViewNativeComponent.d.ts +0 -8
  73. package/lib/typescript/src/TextInputViewNativeComponent.d.ts.map +0 -1
  74. package/lib/typescript/src/enum.d.ts.map +0 -1
  75. package/lib/typescript/src/index.d.ts.map +0 -1
  76. package/lib/typescript/src/type.d.ts.map +0 -1
  77. package/src/TextInputViewNativeComponent.ts +0 -9
@@ -1,35 +1,30 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _usePressability = _interopRequireDefault(require("react-native/Libraries/Pressability/usePressability.js"));
8
- var _flattenStyle = _interopRequireDefault(require("react-native/Libraries/StyleSheet/flattenStyle.js"));
9
- var _StyleSheet = _interopRequireDefault(require("react-native/Libraries/StyleSheet/StyleSheet"));
10
- var _Text = _interopRequireDefault(require("react-native/Libraries/Text/Text"));
11
- var _TextAncestor = _interopRequireDefault(require("react-native/Libraries/Text/TextAncestor"));
12
- var _Platform = _interopRequireDefault(require("react-native/Libraries/Utilities/Platform"));
13
- var _useMergeRefs = _interopRequireDefault(require("react-native/Libraries/Utilities/useMergeRefs"));
14
- var _TextInputState = _interopRequireDefault(require("react-native/Libraries/Components/TextInput/TextInputState"));
15
- var _invariant = _interopRequireDefault(require("invariant"));
16
- var _nullthrows = _interopRequireDefault(require("nullthrows"));
17
- var _react = _interopRequireWildcard(require("react"));
18
- var React = _react;
19
- var _jsxRuntime = require("react/jsx-runtime");
20
- 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); }
21
- 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; }
22
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
3
+ import usePressability from 'react-native/Libraries/Pressability/usePressability';
4
+ import flattenStyle from 'react-native/Libraries/StyleSheet/flattenStyle';
5
+ import StyleSheet from 'react-native/Libraries/StyleSheet/StyleSheet';
6
+ import Text from 'react-native/Libraries/Text/Text';
7
+ import TextAncestorContext from 'react-native/Libraries/Text/TextAncestorContext';
8
+ import Platform from 'react-native/Libraries/Utilities/Platform';
9
+ import useMergeRefs from 'react-native/Libraries/Utilities/useMergeRefs';
10
+ import TextInputState from 'react-native/Libraries/Components/TextInput/TextInputState';
11
+ import invariant from 'invariant';
12
+ import nullthrows from 'nullthrows';
13
+ import * as React from 'react';
14
+ import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
15
+ import { findNodeHandle, NativeEventEmitter, NativeModules } from 'react-native';
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ const iosPasteEmitter = Platform.OS === 'ios' && NativeModules.OneKeyTextInputPasteObserver != null ? new NativeEventEmitter(NativeModules.OneKeyTextInputPasteObserver) : null;
23
18
  let AndroidTextInput;
24
19
  let AndroidTextInputCommands;
25
20
  let RCTSinglelineTextInputView;
26
21
  let RCTSinglelineTextInputNativeCommands;
27
22
  let RCTMultilineTextInputView;
28
23
  let RCTMultilineTextInputNativeCommands;
29
- if (_Platform.default.OS === 'android') {
24
+ if (Platform.OS === 'android') {
30
25
  AndroidTextInput = require('./AndroidTextInputNativeComponent').default;
31
26
  AndroidTextInputCommands = require('./AndroidTextInputNativeComponent').Commands;
32
- } else if (_Platform.default.OS === 'ios') {
27
+ } else if (Platform.OS === 'ios') {
33
28
  RCTSinglelineTextInputView = require('react-native/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent').default;
34
29
  RCTSinglelineTextInputNativeCommands = require('react-native/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent').Commands;
35
30
  RCTMultilineTextInputView = require('react-native/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent').default;
@@ -44,16 +39,16 @@ function useTextInputStateSynchronization({
44
39
  text,
45
40
  viewCommands
46
41
  }) {
47
- const [lastNativeText, setLastNativeText] = (0, _react.useState)(props.value);
48
- const [lastNativeSelectionState, setLastNativeSelection] = (0, _react.useState)({
42
+ const [lastNativeText, setLastNativeText] = useState(props.value);
43
+ const [lastNativeSelectionState, setLastNativeSelection] = useState({
44
+ mostRecentEventCount,
49
45
  selection: {
50
- start: -1,
51
- end: -1
52
- },
53
- mostRecentEventCount: mostRecentEventCount
46
+ end: -1,
47
+ start: -1
48
+ }
54
49
  });
55
50
  const lastNativeSelection = lastNativeSelectionState.selection;
56
- (0, _react.useLayoutEffect)(() => {
51
+ useLayoutEffect(() => {
57
52
  const nativeUpdate = {};
58
53
  if (lastNativeText !== props.value && typeof props.value === 'string') {
59
54
  nativeUpdate.text = props.value;
@@ -62,8 +57,8 @@ function useTextInputStateSynchronization({
62
57
  if (selection && lastNativeSelection && (lastNativeSelection.start !== selection.start || lastNativeSelection.end !== selection.end)) {
63
58
  nativeUpdate.selection = selection;
64
59
  setLastNativeSelection({
65
- selection,
66
- mostRecentEventCount
60
+ mostRecentEventCount,
61
+ selection
67
62
  });
68
63
  }
69
64
  if (Object.keys(nativeUpdate).length === 0) {
@@ -74,8 +69,8 @@ function useTextInputStateSynchronization({
74
69
  }
75
70
  }, [mostRecentEventCount, inputRef, props.value, props.defaultValue, lastNativeText, selection, lastNativeSelection, text, viewCommands]);
76
71
  return {
77
- setLastNativeText,
78
- setLastNativeSelection
72
+ setLastNativeSelection,
73
+ setLastNativeText
79
74
  };
80
75
  }
81
76
  function InternalTextInput(props) {
@@ -92,54 +87,73 @@ function InternalTextInput(props) {
92
87
  selectionColor,
93
88
  selectionHandleColor,
94
89
  cursorColor,
90
+ onPaste,
95
91
  ...otherProps
96
92
  } = props;
97
- const inputRef = (0, _react.useRef)(null);
93
+ const inputRef = useRef(null);
94
+ useEffect(() => {
95
+ if (Platform.OS !== 'ios' || iosPasteEmitter == null || onPaste == null) {
96
+ return;
97
+ }
98
+ const subscription = iosPasteEmitter.addListener('OneKeyTextInputPaste', event => {
99
+ const target = findNodeHandle(inputRef.current);
100
+ if (target != null && target === event.target) {
101
+ onPaste({
102
+ nativeEvent: {
103
+ items: event.items
104
+ }
105
+ });
106
+ }
107
+ });
108
+ return () => subscription.remove();
109
+ }, [onPaste]);
98
110
  const selection = propsSelection == null ? null : {
99
- start: propsSelection.start,
100
- end: propsSelection.end ?? propsSelection.start
111
+ end: propsSelection.end ?? propsSelection.start,
112
+ start: propsSelection.start
101
113
  };
102
114
  const text = typeof props.value === 'string' ? props.value : typeof props.defaultValue === 'string' ? props.defaultValue : undefined;
103
115
  const viewCommands = AndroidTextInputCommands || (props.multiline === true ? RCTMultilineTextInputNativeCommands : RCTSinglelineTextInputNativeCommands);
104
- const [mostRecentEventCount, setMostRecentEventCount] = (0, _react.useState)(0);
116
+ const [mostRecentEventCount, setMostRecentEventCount] = useState(0);
105
117
  const {
106
118
  setLastNativeText,
107
119
  setLastNativeSelection
108
120
  } = useTextInputStateSynchronization({
109
- props,
110
121
  inputRef,
111
122
  mostRecentEventCount,
123
+ props,
112
124
  selection,
113
125
  text,
114
126
  viewCommands
115
127
  });
116
- (0, _react.useLayoutEffect)(() => {
128
+ useLayoutEffect(() => {
117
129
  const inputRefValue = inputRef.current;
118
130
  if (inputRefValue != null) {
119
- _TextInputState.default.registerInput(inputRefValue);
131
+ TextInputState.registerInput(inputRefValue);
120
132
  return () => {
121
- _TextInputState.default.unregisterInput(inputRefValue);
122
- if (_TextInputState.default.currentlyFocusedInput() === inputRefValue) {
123
- (0, _nullthrows.default)(inputRefValue).blur();
133
+ TextInputState.unregisterInput(inputRefValue);
134
+ if (TextInputState.currentlyFocusedInput() === inputRefValue) {
135
+ nullthrows(inputRefValue).blur();
124
136
  }
125
137
  };
126
138
  }
127
139
  }, []);
128
- const setLocalRef = (0, _react.useCallback)(instance => {
140
+ const setLocalRef = useCallback(instance => {
129
141
  inputRef.current = instance;
130
142
  if (instance != null) {
143
+ TextInputState.registerInput(instance);
131
144
  Object.assign(instance, {
132
145
  clear() {
133
146
  if (inputRef.current != null) {
134
147
  viewCommands.setTextAndSelection(inputRef.current, mostRecentEventCount, '', 0, 0);
135
148
  }
136
149
  },
137
- isFocused() {
138
- return _TextInputState.default.currentlyFocusedInput() === inputRef.current;
139
- },
140
150
  getNativeRef() {
141
151
  return inputRef.current;
142
152
  },
153
+ isFocused() {
154
+ const currentlyFocusedInput = TextInputState.currentlyFocusedInput();
155
+ return currentlyFocusedInput != null && currentlyFocusedInput === inputRef.current;
156
+ },
143
157
  setSelection(start, end) {
144
158
  if (inputRef.current != null) {
145
159
  viewCommands.setTextAndSelection(inputRef.current, mostRecentEventCount, null, start, end);
@@ -148,7 +162,7 @@ function InternalTextInput(props) {
148
162
  });
149
163
  }
150
164
  }, [mostRecentEventCount, viewCommands]);
151
- const ref = (0, _useMergeRefs.default)(setLocalRef, props.forwardedRef);
165
+ const ref = useMergeRefs(setLocalRef, props.forwardedRef);
152
166
  const _onChange = event => {
153
167
  const currentText = event.nativeEvent.text;
154
168
  props.onChange && props.onChange(event);
@@ -165,18 +179,18 @@ function InternalTextInput(props) {
165
179
  return;
166
180
  }
167
181
  setLastNativeSelection({
168
- selection: event.nativeEvent.selection,
169
- mostRecentEventCount
182
+ mostRecentEventCount,
183
+ selection: event.nativeEvent.selection
170
184
  });
171
185
  };
172
186
  const _onFocus = event => {
173
- _TextInputState.default.focusInput(inputRef.current);
187
+ TextInputState.focusInput(inputRef.current);
174
188
  if (props.onFocus) {
175
189
  props.onFocus(event);
176
190
  }
177
191
  };
178
192
  const _onBlur = event => {
179
- _TextInputState.default.blurInput(inputRef.current);
193
+ TextInputState.blurInput(inputRef.current);
180
194
  if (props.onBlur) {
181
195
  props.onBlur(event);
182
196
  }
@@ -216,7 +230,8 @@ function InternalTextInput(props) {
216
230
  onPressOut,
217
231
  rejectResponderTermination
218
232
  } = props;
219
- const config = React.useMemo(() => ({
233
+ const config = useMemo(() => ({
234
+ cancelable: Platform.OS === 'ios' ? !rejectResponderTermination : null,
220
235
  hitSlop,
221
236
  onPress: event => {
222
237
  onPress?.(event);
@@ -226,19 +241,19 @@ function InternalTextInput(props) {
226
241
  }
227
242
  }
228
243
  },
229
- onPressIn: onPressIn,
230
- onPressOut: onPressOut,
231
- cancelable: _Platform.default.OS === 'ios' ? !rejectResponderTermination : null
244
+ onPressIn,
245
+ onPressOut
232
246
  }), [editable, hitSlop, onPress, onPressIn, onPressOut, rejectResponderTermination]);
233
247
  let caretHidden = props.caretHidden;
234
- if (_Platform.default.isTesting) {
248
+ if (Platform.isTesting) {
235
249
  caretHidden = true;
236
250
  }
237
251
  const {
238
252
  onBlur,
239
253
  onFocus,
240
254
  ...eventHandlers
241
- } = (0, _usePressability.default)(config);
255
+ } = usePressability(config);
256
+ const _accessibilityLabel = props?.['aria-label'] ?? props?.accessibilityLabel;
242
257
  let _accessibilityState;
243
258
  if (accessibilityState != null || ariaBusy != null || ariaChecked != null || ariaDisabled != null || ariaExpanded != null || ariaSelected != null) {
244
259
  _accessibilityState = {
@@ -250,7 +265,7 @@ function InternalTextInput(props) {
250
265
  };
251
266
  }
252
267
  let _style = props.style;
253
- const flattenedStyle = (0, _flattenStyle.default)(props.style);
268
+ const flattenedStyle = flattenStyle(props.style);
254
269
  if (flattenedStyle != null) {
255
270
  let overrides = null;
256
271
  if (typeof flattenedStyle?.fontWeight === 'number') {
@@ -266,14 +281,18 @@ function InternalTextInput(props) {
266
281
  _style = [_style, overrides];
267
282
  }
268
283
  }
269
- if (_Platform.default.OS === 'ios') {
284
+ if (Platform.OS === 'ios') {
270
285
  const RCTTextInputView = props.multiline === true ? RCTMultilineTextInputView : RCTSinglelineTextInputView;
271
286
  const useMultilineDefaultStyle = props.multiline === true && (flattenedStyle == null || flattenedStyle.padding == null && flattenedStyle.paddingVertical == null && flattenedStyle.paddingTop == null);
272
- textInput = /*#__PURE__*/(0, _jsxRuntime.jsx)(RCTTextInputView, {
287
+ const _accessibilityElementsHidden = props['aria-hidden'] ?? props.accessibilityElementsHidden;
288
+ textInput = /*#__PURE__*/_jsx(RCTTextInputView, {
273
289
  ref: ref,
274
290
  ...otherProps,
275
291
  ...eventHandlers,
292
+ acceptDragAndDropTypes: props.experimental_acceptDragAndDropTypes,
293
+ accessibilityLabel: _accessibilityLabel,
276
294
  accessibilityState: _accessibilityState,
295
+ accessibilityElementsHidden: _accessibilityElementsHidden,
277
296
  accessible: accessible,
278
297
  submitBehavior: submitBehavior,
279
298
  caretHidden: caretHidden,
@@ -291,51 +310,51 @@ function InternalTextInput(props) {
291
310
  onSelectionChangeShouldSetResponder: emptyFunctionThatReturnsTrue,
292
311
  selection: selection,
293
312
  selectionColor: selectionColor,
294
- style: _StyleSheet.default.compose(useMultilineDefaultStyle ? styles.multilineDefault : null, _style),
313
+ style: StyleSheet.compose(useMultilineDefaultStyle ? styles.multilineDefault : null, _style),
295
314
  text: text
296
315
  });
297
- } else if (_Platform.default.OS === 'android') {
316
+ } else if (Platform.OS === 'android') {
298
317
  const autoCapitalize = props.autoCapitalize || 'sentences';
299
318
  const _accessibilityLabelledBy = props?.['aria-labelledby'] ?? props?.accessibilityLabelledBy;
319
+ const _importantForAccessibility = props['aria-hidden'] === true ? 'no-hide-descendants' : undefined;
300
320
  const placeholder = props.placeholder ?? '';
301
321
  let children = props.children;
302
322
  const childCount = React.Children.count(children);
303
- (0, _invariant.default)(!(props.value != null && childCount), 'Cannot specify both value and children.');
323
+ invariant(!(props.value != null && childCount), 'Cannot specify both value and children.');
304
324
  if (childCount > 1) {
305
- children = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
325
+ children = /*#__PURE__*/_jsx(Text, {
306
326
  children: children
307
327
  });
308
328
  }
309
329
  const colorProps = {
330
+ cursorColor: cursorColor === undefined ? selectionColor : cursorColor,
310
331
  selectionColor,
311
- selectionHandleColor: selectionHandleColor === undefined ? selectionColor : selectionHandleColor,
312
- cursorColor: cursorColor === undefined ? selectionColor : cursorColor
332
+ selectionHandleColor: selectionHandleColor === undefined ? selectionColor : selectionHandleColor
313
333
  };
314
- const {
315
- onPaste,
316
- ...rest
317
- } = otherProps;
318
- textInput = /*#__PURE__*/(0, _jsxRuntime.jsx)(AndroidTextInput, {
334
+ textInput = /*#__PURE__*/_jsx(AndroidTextInput, {
319
335
  ref: ref,
320
- ...rest,
336
+ ...otherProps,
321
337
  ...colorProps,
322
338
  ...eventHandlers,
323
- onPaste: onPaste,
324
- accessibilityState: _accessibilityState,
339
+ accessibilityLabel: _accessibilityLabel,
325
340
  accessibilityLabelledBy: _accessibilityLabelledBy,
341
+ accessibilityState: _accessibilityState,
326
342
  accessible: accessible,
343
+ acceptDragAndDropTypes: props.experimental_acceptDragAndDropTypes,
327
344
  autoCapitalize: autoCapitalize,
328
345
  submitBehavior: submitBehavior,
329
346
  caretHidden: caretHidden,
330
347
  children: children,
331
348
  disableFullscreenUI: props.disableFullscreenUI,
332
349
  focusable: tabIndex !== undefined ? !tabIndex : focusable,
350
+ importantForAccessibility: _importantForAccessibility,
333
351
  mostRecentEventCount: mostRecentEventCount,
334
352
  nativeID: id ?? props.nativeID,
335
353
  numberOfLines: props.rows ?? props.numberOfLines,
336
354
  onBlur: _onBlur,
337
355
  onChange: _onChange,
338
356
  onFocus: _onFocus,
357
+ onPaste: onPaste,
339
358
  onScroll: _onScroll,
340
359
  onSelectionChange: _onSelectionChange,
341
360
  placeholder: placeholder,
@@ -344,14 +363,14 @@ function InternalTextInput(props) {
344
363
  textBreakStrategy: props.textBreakStrategy
345
364
  });
346
365
  }
347
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextAncestor.default.Provider, {
366
+ return /*#__PURE__*/_jsx(TextAncestorContext, {
348
367
  value: true,
349
368
  children: textInput
350
369
  });
351
370
  }
352
371
  const enterKeyHintToReturnTypeMap = {
353
- enter: 'default',
354
372
  done: 'done',
373
+ enter: 'default',
355
374
  go: 'go',
356
375
  next: 'next',
357
376
  previous: 'previous',
@@ -359,16 +378,17 @@ const enterKeyHintToReturnTypeMap = {
359
378
  send: 'send'
360
379
  };
361
380
  const inputModeToKeyboardTypeMap = {
362
- none: 'default',
363
- text: 'default',
364
381
  decimal: 'decimal-pad',
382
+ email: 'email-address',
383
+ none: 'default',
365
384
  numeric: 'number-pad',
385
+ search: Platform.OS === 'ios' ? 'web-search' : 'default',
366
386
  tel: 'phone-pad',
367
- search: _Platform.default.OS === 'ios' ? 'web-search' : 'default',
368
- email: 'email-address',
387
+ text: 'default',
369
388
  url: 'url'
370
389
  };
371
390
  const autoCompleteWebToAutoCompleteAndroidMap = {
391
+ 'additional-name': 'name-middle',
372
392
  'address-line1': 'postal-address-region',
373
393
  'address-line2': 'postal-address-locality',
374
394
  bday: 'birthdate-full',
@@ -383,12 +403,11 @@ const autoCompleteWebToAutoCompleteAndroidMap = {
383
403
  country: 'postal-address-country',
384
404
  'current-password': 'password',
385
405
  email: 'email',
406
+ 'family-name': 'name-family',
407
+ 'given-name': 'name-given',
386
408
  'honorific-prefix': 'name-prefix',
387
409
  'honorific-suffix': 'name-suffix',
388
410
  name: 'name',
389
- 'additional-name': 'name-middle',
390
- 'family-name': 'name-family',
391
- 'given-name': 'name-given',
392
411
  'new-password': 'password-new',
393
412
  off: 'off',
394
413
  'one-time-code': 'sms-otp',
@@ -401,33 +420,33 @@ const autoCompleteWebToAutoCompleteAndroidMap = {
401
420
  username: 'username'
402
421
  };
403
422
  const autoCompleteWebToTextContentTypeMap = {
423
+ 'additional-name': 'middleName',
404
424
  'address-line1': 'streetAddressLine1',
405
425
  'address-line2': 'streetAddressLine2',
406
426
  bday: 'birthdate',
407
427
  'bday-day': 'birthdateDay',
408
428
  'bday-month': 'birthdateMonth',
409
429
  'bday-year': 'birthdateYear',
430
+ 'cc-additional-name': 'creditCardMiddleName',
410
431
  'cc-csc': 'creditCardSecurityCode',
432
+ 'cc-exp': 'creditCardExpiration',
411
433
  'cc-exp-month': 'creditCardExpirationMonth',
412
434
  'cc-exp-year': 'creditCardExpirationYear',
413
- 'cc-exp': 'creditCardExpiration',
414
- 'cc-given-name': 'creditCardGivenName',
415
- 'cc-additional-name': 'creditCardMiddleName',
416
435
  'cc-family-name': 'creditCardFamilyName',
436
+ 'cc-given-name': 'creditCardGivenName',
417
437
  'cc-name': 'creditCardName',
418
438
  'cc-number': 'creditCardNumber',
419
439
  'cc-type': 'creditCardType',
420
- 'current-password': 'password',
421
440
  country: 'countryName',
441
+ 'current-password': 'password',
422
442
  email: 'emailAddress',
423
- name: 'name',
424
- 'additional-name': 'middleName',
425
443
  'family-name': 'familyName',
426
444
  'given-name': 'givenName',
427
- nickname: 'nickname',
428
445
  'honorific-prefix': 'namePrefix',
429
446
  'honorific-suffix': 'nameSuffix',
447
+ name: 'name',
430
448
  'new-password': 'newPassword',
449
+ nickname: 'nickname',
431
450
  off: 'none',
432
451
  'one-time-code': 'oneTimeCode',
433
452
  organization: 'organizationName',
@@ -438,7 +457,8 @@ const autoCompleteWebToTextContentTypeMap = {
438
457
  url: 'URL',
439
458
  username: 'username'
440
459
  };
441
- const ExportedForwardRef = /*#__PURE__*/React.forwardRef(function TextInput({
460
+ const TextInput = function TextInput({
461
+ ref: forwardedRef,
442
462
  allowFontScaling = true,
443
463
  rejectResponderTermination = true,
444
464
  underlineColorAndroid = 'transparent',
@@ -452,8 +472,8 @@ const ExportedForwardRef = /*#__PURE__*/React.forwardRef(function TextInput({
452
472
  showSoftInputOnFocus,
453
473
  keyboardType,
454
474
  ...restProps
455
- }, forwardedRef) {
456
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalTextInput, {
475
+ }) {
476
+ return /*#__PURE__*/_jsx(InternalTextInput, {
457
477
  allowFontScaling: allowFontScaling,
458
478
  rejectResponderTermination: rejectResponderTermination,
459
479
  underlineColorAndroid: underlineColorAndroid,
@@ -461,29 +481,29 @@ const ExportedForwardRef = /*#__PURE__*/React.forwardRef(function TextInput({
461
481
  returnKeyType: enterKeyHint ? enterKeyHintToReturnTypeMap[enterKeyHint] : returnKeyType,
462
482
  keyboardType: inputMode ? inputModeToKeyboardTypeMap[inputMode] : keyboardType,
463
483
  showSoftInputOnFocus: inputMode == null ? showSoftInputOnFocus : inputMode !== 'none',
464
- autoComplete: _Platform.default.OS === 'android' ? autoCompleteWebToAutoCompleteAndroidMap[autoComplete] ?? autoComplete : undefined,
465
- textContentType: textContentType != null ? textContentType : _Platform.default.OS === 'ios' && autoComplete && autoComplete in autoCompleteWebToTextContentTypeMap ? autoCompleteWebToTextContentTypeMap[autoComplete] : textContentType,
484
+ autoComplete: Platform.OS === 'android' ? autoCompleteWebToAutoCompleteAndroidMap[autoComplete] ?? autoComplete : undefined,
485
+ textContentType: textContentType != null ? textContentType : Platform.OS === 'ios' && autoComplete && autoComplete in autoCompleteWebToTextContentTypeMap ? autoCompleteWebToTextContentTypeMap[autoComplete] : textContentType,
466
486
  ...restProps,
467
487
  forwardedRef: forwardedRef
468
488
  });
469
- });
470
- ExportedForwardRef.displayName = 'TextInput';
471
- ExportedForwardRef.State = {
472
- currentlyFocusedInput: _TextInputState.default.currentlyFocusedInput,
473
- currentlyFocusedField: _TextInputState.default.currentlyFocusedField,
474
- focusTextInput: _TextInputState.default.focusTextInput,
475
- blurTextInput: _TextInputState.default.blurTextInput
476
489
  };
477
- const styles = _StyleSheet.default.create({
490
+ TextInput.displayName = 'TextInput';
491
+ TextInput.State = {
492
+ blurTextInput: TextInputState.blurTextInput,
493
+ currentlyFocusedField: TextInputState.currentlyFocusedField,
494
+ currentlyFocusedInput: TextInputState.currentlyFocusedInput,
495
+ focusTextInput: TextInputState.focusTextInput
496
+ };
497
+ const styles = StyleSheet.create({
478
498
  multilineDefault: {
479
499
  paddingTop: 5
480
500
  }
481
501
  });
482
502
  const verticalAlignToTextAlignVerticalMap = {
483
503
  auto: 'auto',
484
- top: 'top',
485
504
  bottom: 'bottom',
486
- middle: 'center'
505
+ middle: 'center',
506
+ top: 'top'
487
507
  };
488
- var _default = exports.default = ExportedForwardRef;
508
+ export default TextInput;
489
509
  //# sourceMappingURL=Input.js.map
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ export let EPasteEventPayloadItemType = /*#__PURE__*/function (EPasteEventPayloadItemType) {
4
+ EPasteEventPayloadItemType["TextPlain"] = "text/plain";
5
+ return EPasteEventPayloadItemType;
6
+ }({});
7
+ //# sourceMappingURL=enum.js.map
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ // @ts-expect-error
4
+ import TextInputView from "./Input.js";
5
+
6
+ // export * from './TextInputViewNativeComponent';
7
+
8
+ export * from "./enum.js";
9
+ const TextInput = TextInputView;
10
+ export default TextInput;
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -1,7 +1,7 @@
1
- import type { ComponentType } from 'react';
2
- import type { ITextInputProps } from './type';
3
- export type { IPasteEventPayloadItem, IPasteEventPayload, IPasteEventParams, ITextInputProps, } from './type';
4
- export * from './enum';
1
+ import type { ComponentType } from "react";
2
+ import type { ITextInputProps } from "./type";
3
+ export type { IPasteEventPayloadItem, IPasteEventPayload, IPasteEventParams, ITextInputProps, } from "./type";
4
+ export * from "./enum";
5
5
  declare const TextInput: ComponentType<ITextInputProps>;
6
6
  export default TextInput;
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,5 @@
1
- import type { TextInputProps } from 'react-native';
2
- import type { EPasteEventPayloadItemType } from './enum';
1
+ import type { TextInputProps } from "react-native";
2
+ import type { EPasteEventPayloadItemType } from "./enum";
3
3
  export type IPasteEventPayloadItem = {
4
4
  data?: string;
5
5
  type?: EPasteEventPayloadItemType;