@onekeyfe/react-native-text-input 0.2.9 → 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 +11 -7
  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 +128 -156
  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 +243 -1121
  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
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-text-input",
3
- "version": "0.2.9",
4
- "description": "text-input",
3
+ "version": "3.0.91",
4
+ "description": "React Native TextInput with native paste events",
5
5
  "source": "./src/index.tsx",
6
+ "main": "./lib/module/index.js",
6
7
  "types": "./lib/typescript/src/index.d.ts",
7
- "main": "./src/index.tsx",
8
8
  "files": [
9
9
  "src",
10
10
  "lib",
11
11
  "android",
12
12
  "ios",
13
- "cpp",
14
- "*.podspec",
13
+ "OneKeyTextInput.podspec",
14
+ "react-native.config.js",
15
15
  "!ios/build",
16
16
  "!android/build",
17
17
  "!android/gradle",
@@ -21,135 +21,58 @@
21
21
  "!**/__tests__",
22
22
  "!**/__fixtures__",
23
23
  "!**/__mocks__",
24
- "!**/.*"
24
+ "!**/.*",
25
+ "!**/*.map"
25
26
  ],
26
27
  "scripts": {
27
- "example": "yarn workspace react-native-text-input-example",
28
- "test": "jest",
28
+ "clean": "del-cli android/build lib",
29
+ "prepare": "rm -rf lib && bob build",
29
30
  "typecheck": "tsc",
30
- "lint": "eslint \"**/*.{ts,tsx}\"",
31
- "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
32
- "prepare": "bob build",
33
- "release": "release-it"
31
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
32
+ "test": "jest",
33
+ "release": "yarn prepare && npm whoami && npm publish --access public"
34
34
  },
35
35
  "keywords": [
36
36
  "react-native",
37
37
  "ios",
38
- "android"
38
+ "android",
39
+ "text-input",
40
+ "paste"
39
41
  ],
42
+ "homepage": "https://github.com/OneKeyHQ/app-modules#readme",
40
43
  "repository": {
41
44
  "type": "git",
42
- "url": "git+https://github.com/OneKeyHQ/react-native-text.git"
45
+ "url": "git+https://github.com/OneKeyHQ/app-modules.git",
46
+ "directory": "native-views/react-native-text-input"
43
47
  },
44
- "author": "huhuanming <workboring@gmail.com> (https://github.com/huhuanming)",
48
+ "author": "@onekeyfe <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
45
49
  "license": "MIT",
46
- "bugs": {
47
- "url": "https://github.com/OneKeyHQ/react-native-text/issues"
48
- },
49
- "homepage": "https://github.com/OneKeyHQ/react-native-text/issues#readme",
50
50
  "publishConfig": {
51
51
  "registry": "https://registry.npmjs.org/"
52
52
  },
53
53
  "devDependencies": {
54
- "@commitlint/config-conventional": "^17.0.2",
55
- "@evilmartians/lefthook": "^1.5.0",
56
- "@react-native-community/cli": "^19.1.0",
57
- "@react-native/eslint-config": "^0.73.1",
58
- "@release-it/conventional-changelog": "^5.0.0",
59
- "@types/jest": "^29.5.5",
60
- "@types/react": "^18.2.44",
61
- "commitlint": "^17.0.2",
62
- "del-cli": "^5.1.0",
63
- "eslint": "^8.51.0",
64
- "eslint-config-prettier": "^9.0.0",
65
- "eslint-plugin-prettier": "^5.0.1",
66
- "jest": "^29.7.0",
67
- "prettier": "^3.0.3",
68
- "react": "18.3.1",
69
- "react-native": "0.79.5",
70
- "react-native-builder-bob": "^0.40.12",
71
- "release-it": "^19.0.0",
72
- "turbo": "^1.10.7",
73
- "typescript": "^5.2.2"
74
- },
75
- "resolutions": {
76
- "@types/react": "^18.2.44"
54
+ "@react-native/babel-preset": "0.86.2",
55
+ "@types/react": "^19.2.0",
56
+ "del-cli": "^6.0.0",
57
+ "react": "19.2.3",
58
+ "react-native": "patch:react-native@npm%3A0.86.2#~/.yarn/patches/react-native-npm-0.86.2-c9d546616f.patch",
59
+ "react-native-builder-bob": "^0.40.13",
60
+ "typescript": "^5.9.2"
77
61
  },
78
62
  "peerDependencies": {
79
63
  "react": "*",
80
64
  "react-native": "*"
81
65
  },
82
- "workspaces": [
83
- "example"
84
- ],
85
- "packageManager": "yarn@3.6.1",
86
- "jest": {
87
- "preset": "react-native",
88
- "modulePathIgnorePatterns": [
89
- "<rootDir>/example/node_modules",
90
- "<rootDir>/lib/"
91
- ]
92
- },
93
- "commitlint": {
94
- "extends": [
95
- "@commitlint/config-conventional"
96
- ]
97
- },
98
- "release-it": {
99
- "git": {
100
- "commitMessage": "chore: release ${version}",
101
- "tagName": "v${version}"
102
- },
103
- "npm": {
104
- "publish": true
105
- },
106
- "github": {
107
- "release": true
108
- },
109
- "plugins": {
110
- "@release-it/conventional-changelog": {
111
- "preset": "angular"
112
- }
113
- }
114
- },
115
- "eslintConfig": {
116
- "root": true,
117
- "extends": [
118
- "@react-native",
119
- "prettier"
120
- ],
121
- "rules": {
122
- "react/react-in-jsx-scope": "off",
123
- "prettier/prettier": [
124
- "error",
125
- {
126
- "quoteProps": "consistent",
127
- "singleQuote": true,
128
- "tabWidth": 2,
129
- "trailingComma": "es5",
130
- "useTabs": false
131
- }
132
- ]
133
- }
134
- },
135
- "eslintIgnore": [
136
- "node_modules/",
137
- "lib/"
138
- ],
139
- "prettier": {
140
- "quoteProps": "consistent",
141
- "singleQuote": true,
142
- "tabWidth": 2,
143
- "trailingComma": "es5",
144
- "useTabs": false
145
- },
66
+ "packageManager": "yarn@4.1.0",
146
67
  "react-native-builder-bob": {
147
68
  "source": "src",
148
69
  "output": "lib",
149
70
  "targets": [
150
- "codegen",
151
71
  [
152
- "commonjs"
72
+ "module",
73
+ {
74
+ "esm": true
75
+ }
153
76
  ],
154
77
  [
155
78
  "typescript",
@@ -161,18 +84,10 @@
161
84
  },
162
85
  "codegenConfig": {
163
86
  "name": "RNTextInputViewSpec",
164
- "type": "all",
87
+ "type": "components",
165
88
  "jsSrcsDir": "src",
166
- "outputDir": {
167
- "ios": "ios/generated",
168
- "android": "android/generated"
169
- },
170
89
  "android": {
171
90
  "javaPackageName": "com.textinput"
172
91
  }
173
- },
174
- "create-react-native-library": {
175
- "type": "view-mixed",
176
- "version": "0.41.2"
177
92
  }
178
93
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @type {import('@react-native-community/cli-types').UserDependencyConfig}
3
+ */
4
+ module.exports = {
5
+ dependency: {
6
+ platforms: {
7
+ android: {
8
+ cmakeListsPath: "build/generated/source/codegen/jni/CMakeLists.txt",
9
+ },
10
+ },
11
+ },
12
+ };
@@ -10,11 +10,7 @@
10
10
 
11
11
  import type {HostComponent} from 'react-native/src/private/types/HostComponent';
12
12
  import type {PartialViewConfig} from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
13
- import type {
14
- ColorValue,
15
- TextStyleProp,
16
- ViewStyleProp,
17
- } from 'react-native/Libraries/StyleSheet/StyleSheet';
13
+ import type {ColorValue, TextStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet';
18
14
  import type {
19
15
  BubblingEventHandler,
20
16
  DirectEventHandler,
@@ -28,6 +24,7 @@ import type {TextInputNativeCommands} from 'react-native/Libraries/Components/Te
28
24
 
29
25
  import * as NativeComponentRegistry from 'react-native/Libraries/NativeComponent/NativeComponentRegistry';
30
26
  import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
27
+ import {colorAttribute} from 'react-native/Libraries/Components/View/ReactNativeStyleAttributes';
31
28
 
32
29
  export type KeyboardType =
33
30
  // Cross Platform
@@ -67,10 +64,10 @@ export type ReturnKeyType =
67
64
 
68
65
  export type SubmitBehavior = 'submit' | 'blurAndSubmit' | 'newline';
69
66
 
70
- export type NativeProps = $ReadOnly<{
67
+ export type AndroidTextInputNativeProps = Readonly<{
71
68
  // This allows us to inherit everything from ViewProps except for style (see below)
72
69
  // This must be commented for Fabric codegen to work.
73
- ...$Diff<ViewProps, $ReadOnly<{style: ?ViewStyleProp}>>,
70
+ ...Omit<ViewProps, 'style'>,
74
71
 
75
72
  /**
76
73
  * Android props after this
@@ -93,8 +90,15 @@ export type NativeProps = $ReadOnly<{
93
90
  * - `cc-exp-month`
94
91
  * - `cc-exp-year`
95
92
  * - `cc-number`
93
+ * - `2fa-app-otp`
96
94
  * - `email`
95
+ * - `email-otp`
96
+ * - `flight-confirmation-code`
97
+ * - `flight-number`
97
98
  * - `gender`
99
+ * - `gift-card-number`
100
+ * - `gift-card-pin`
101
+ * - `loyalty-account-number`
98
102
  * - `name`
99
103
  * - `name-family`
100
104
  * - `name-given`
@@ -106,17 +110,22 @@ export type NativeProps = $ReadOnly<{
106
110
  * - `password-new`
107
111
  * - `postal-address`
108
112
  * - `postal-address-country`
113
+ * - `postal-address-dependent-locality`
109
114
  * - `postal-address-extended`
110
115
  * - `postal-address-extended-postal-code`
111
116
  * - `postal-address-locality`
112
117
  * - `postal-address-region`
118
+ * - `postal-address-unit`
113
119
  * - `postal-code`
120
+ * - `promo-code`
114
121
  * - `street-address`
115
122
  * - `sms-otp`
116
123
  * - `tel`
117
124
  * - `tel-country-code`
118
125
  * - `tel-national`
119
126
  * - `tel-device`
127
+ * - `upi-vpa`
128
+ * - `wifi-password`
120
129
  * - `username`
121
130
  * - `username-new`
122
131
  * - `off`
@@ -124,6 +133,7 @@ export type NativeProps = $ReadOnly<{
124
133
  * @platform android
125
134
  */
126
135
  autoComplete?: WithDefault<
136
+ | '2fa-app-otp'
127
137
  | 'birthdate-day'
128
138
  | 'birthdate-full'
129
139
  | 'birthdate-month'
@@ -135,7 +145,13 @@ export type NativeProps = $ReadOnly<{
135
145
  | 'cc-exp-year'
136
146
  | 'cc-number'
137
147
  | 'email'
148
+ | 'email-otp'
149
+ | 'flight-confirmation-code'
150
+ | 'flight-number'
138
151
  | 'gender'
152
+ | 'gift-card-number'
153
+ | 'gift-card-pin'
154
+ | 'loyalty-account-number'
139
155
  | 'name'
140
156
  | 'name-family'
141
157
  | 'name-given'
@@ -147,17 +163,22 @@ export type NativeProps = $ReadOnly<{
147
163
  | 'password-new'
148
164
  | 'postal-address'
149
165
  | 'postal-address-country'
166
+ | 'postal-address-dependent-locality'
150
167
  | 'postal-address-extended'
151
168
  | 'postal-address-extended-postal-code'
152
169
  | 'postal-address-locality'
153
170
  | 'postal-address-region'
171
+ | 'postal-address-unit'
154
172
  | 'postal-code'
173
+ | 'promo-code'
155
174
  | 'street-address'
156
175
  | 'sms-otp'
157
176
  | 'tel'
158
177
  | 'tel-country-code'
159
178
  | 'tel-national'
160
179
  | 'tel-device'
180
+ | 'upi-vpa'
181
+ | 'wifi-password'
161
182
  | 'username'
162
183
  | 'username-new'
163
184
  | 'off',
@@ -343,13 +364,13 @@ export type NativeProps = $ReadOnly<{
343
364
  * Callback that is called when the text input is blurred.
344
365
  * `target` is the reactTag of the element
345
366
  */
346
- onBlur?: ?BubblingEventHandler<$ReadOnly<{target: Int32}>>,
367
+ onBlur?: ?BubblingEventHandler<Readonly<{target: Int32}>>,
347
368
 
348
369
  /**
349
370
  * Callback that is called when the text input is focused.
350
371
  * `target` is the reactTag of the element
351
372
  */
352
- onFocus?: ?BubblingEventHandler<$ReadOnly<{target: Int32}>>,
373
+ onFocus?: ?BubblingEventHandler<Readonly<{target: Int32}>>,
353
374
 
354
375
  /**
355
376
  * Callback that is called when the text input's text changes.
@@ -357,7 +378,7 @@ export type NativeProps = $ReadOnly<{
357
378
  * TODO: differentiate between onChange and onChangeText
358
379
  */
359
380
  onChange?: ?BubblingEventHandler<
360
- $ReadOnly<{target: Int32, eventCount: Int32, text: string}>,
381
+ Readonly<{target: Int32, eventCount: Int32, text: string}>,
361
382
  >,
362
383
 
363
384
  /**
@@ -366,7 +387,7 @@ export type NativeProps = $ReadOnly<{
366
387
  * TODO: differentiate between onChange and onChangeText
367
388
  */
368
389
  onChangeText?: ?BubblingEventHandler<
369
- $ReadOnly<{target: Int32, eventCount: Int32, text: string}>,
390
+ Readonly<{target: Int32, eventCount: Int32, text: string}>,
370
391
  >,
371
392
 
372
393
  /**
@@ -377,18 +398,16 @@ export type NativeProps = $ReadOnly<{
377
398
  * Only called for multiline text inputs.
378
399
  */
379
400
  onContentSizeChange?: ?DirectEventHandler<
380
- $ReadOnly<{
401
+ Readonly<{
381
402
  target: Int32,
382
- contentSize: $ReadOnly<{width: Double, height: Double}>,
403
+ contentSize: Readonly<{width: Double, height: Double}>,
383
404
  }>,
384
405
  >,
385
406
 
386
407
  /**
387
408
  * Callback that is called when text input ends.
388
409
  */
389
- onEndEditing?: ?BubblingEventHandler<
390
- $ReadOnly<{target: Int32, text: string}>,
391
- >,
410
+ onEndEditing?: ?BubblingEventHandler<Readonly<{target: Int32, text: string}>>,
392
411
 
393
412
  /**
394
413
  * Callback that is called when the text input selection is changed.
@@ -396,9 +415,9 @@ export type NativeProps = $ReadOnly<{
396
415
  * `{ nativeEvent: { selection: { start, end } } }`.
397
416
  */
398
417
  onSelectionChange?: ?DirectEventHandler<
399
- $ReadOnly<{
418
+ Readonly<{
400
419
  target: Int32,
401
- selection: $ReadOnly<{start: Double, end: Double}>,
420
+ selection: Readonly<{start: Double, end: Double}>,
402
421
  }>,
403
422
  >,
404
423
 
@@ -407,7 +426,7 @@ export type NativeProps = $ReadOnly<{
407
426
  * Invalid if `multiline={true}` is specified.
408
427
  */
409
428
  onSubmitEditing?: ?BubblingEventHandler<
410
- $ReadOnly<{target: Int32, text: string}>,
429
+ Readonly<{target: Int32, text: string}>,
411
430
  >,
412
431
 
413
432
  /**
@@ -417,7 +436,7 @@ export type NativeProps = $ReadOnly<{
417
436
  * the typed-in character otherwise including `' '` for space.
418
437
  * Fires before `onChange` callbacks.
419
438
  */
420
- onKeyPress?: ?BubblingEventHandler<$ReadOnly<{target: Int32, key: string}>>,
439
+ onKeyPress?: ?BubblingEventHandler<Readonly<{target: Int32, key: string}>>,
421
440
 
422
441
  /**
423
442
  * Invoked on content scroll with `{ nativeEvent: { contentOffset: { x, y } } }`.
@@ -425,48 +444,42 @@ export type NativeProps = $ReadOnly<{
425
444
  * is not provided for performance reasons.
426
445
  */
427
446
  onScroll?: ?DirectEventHandler<
428
- $ReadOnly<{
447
+ Readonly<{
429
448
  target: Int32,
430
449
  responderIgnoreScroll: boolean,
431
- contentInset: $ReadOnly<{
450
+ contentInset: Readonly<{
432
451
  top: Double, // always 0 on Android
433
452
  bottom: Double, // always 0 on Android
434
453
  left: Double, // always 0 on Android
435
454
  right: Double, // always 0 on Android
436
455
  }>,
437
- contentOffset: $ReadOnly<{
456
+ contentOffset: Readonly<{
438
457
  x: Double,
439
458
  y: Double,
440
459
  }>,
441
- contentSize: $ReadOnly<{
460
+ contentSize: Readonly<{
442
461
  width: Double, // always 0 on Android
443
462
  height: Double, // always 0 on Android
444
463
  }>,
445
- layoutMeasurement: $ReadOnly<{
464
+ layoutMeasurement: Readonly<{
446
465
  width: Double,
447
466
  height: Double,
448
467
  }>,
449
- velocity: $ReadOnly<{
468
+ velocity: Readonly<{
450
469
  x: Double, // always 0 on Android
451
470
  y: Double, // always 0 on Android
452
471
  }>,
453
472
  }>,
454
473
  >,
455
474
 
456
- /**
457
- * Invoked when the user performs the paste action.
458
- */
459
- onPaste?: ?DirectEventHandler<
460
- $ReadOnly<{|
461
- target: Int32,
462
- items: $ReadOnlyArray<
463
- $ReadOnly<{|
464
- type: string,
465
- data: string,
466
- |}>,
467
- >,
468
- |}>,
469
- >,
475
+ /** Invoked when the user performs a paste action. */
476
+ onPaste?: ?DirectEventHandler<
477
+ Readonly<{
478
+ target: Int32,
479
+ items: ReadonlyArray<Readonly<{type: string, data: string}>>,
480
+ }>,
481
+ >,
482
+
470
483
  /**
471
484
  * The string that will be rendered before text input has been entered.
472
485
  */
@@ -497,7 +510,7 @@ export type NativeProps = $ReadOnly<{
497
510
  * The start and end of the text input's selection. Set start and end to
498
511
  * the same value to position the cursor.
499
512
  */
500
- selection?: ?$ReadOnly<{
513
+ selection?: ?Readonly<{
501
514
  start: Int32,
502
515
  end?: ?Int32,
503
516
  }>,
@@ -571,7 +584,7 @@ export type NativeProps = $ReadOnly<{
571
584
  * - `borderBottomRightRadius`
572
585
  * - `borderBottomLeftRadius`
573
586
  *
574
- * see [Issue#7070](https://github.com/facebook/react-native/issues/7070)
587
+ * see [Issue#7070](https://github.com/react/react-native/issues/7070)
575
588
  * for more detail.
576
589
  *
577
590
  * [Styles](docs/style.html)
@@ -600,7 +613,7 @@ export type NativeProps = $ReadOnly<{
600
613
  textShadowRadius?: ?Float,
601
614
  textDecorationLine?: ?string,
602
615
  fontStyle?: ?string,
603
- textShadowOffset?: ?$ReadOnly<{width?: ?Double, height?: ?Double}>,
616
+ textShadowOffset?: ?Readonly<{width?: ?Double, height?: ?Double}>,
604
617
  lineHeight?: ?Float,
605
618
  textTransform?: ?string,
606
619
  color?: ?Int32,
@@ -624,7 +637,7 @@ export type NativeProps = $ReadOnly<{
624
637
  text?: ?string,
625
638
  }>;
626
639
 
627
- type NativeType = HostComponent<NativeProps>;
640
+ type NativeType = HostComponent<AndroidTextInputNativeProps>;
628
641
 
629
642
  type NativeCommands = TextInputNativeCommands<NativeType>;
630
643
 
@@ -635,24 +648,12 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
635
648
  export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
636
649
  uiViewClassName: 'OneKeyTextInput',
637
650
  bubblingEventTypes: {
638
- topBlur: {
639
- phasedRegistrationNames: {
640
- bubbled: 'onBlur',
641
- captured: 'onBlurCapture',
642
- },
643
- },
644
651
  topEndEditing: {
645
652
  phasedRegistrationNames: {
646
653
  bubbled: 'onEndEditing',
647
654
  captured: 'onEndEditingCapture',
648
655
  },
649
656
  },
650
- topFocus: {
651
- phasedRegistrationNames: {
652
- bubbled: 'onFocus',
653
- captured: 'onFocusCapture',
654
- },
655
- },
656
657
  topKeyPress: {
657
658
  phasedRegistrationNames: {
658
659
  bubbled: 'onKeyPress',
@@ -675,6 +676,7 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
675
676
  },
676
677
  },
677
678
  validAttributes: {
679
+ acceptDragAndDropTypes: true,
678
680
  maxFontSizeMultiplier: true,
679
681
  adjustsFontSizeToFit: true,
680
682
  minimumFontScale: true,
@@ -682,41 +684,33 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
682
684
  placeholder: true,
683
685
  inlineImagePadding: true,
684
686
  contextMenuHidden: true,
685
- textShadowColor: {
686
- process: require('react-native/Libraries/StyleSheet/processColor').default,
687
- },
687
+ textShadowColor: colorAttribute,
688
688
  maxLength: true,
689
689
  selectTextOnFocus: true,
690
690
  textShadowRadius: true,
691
- underlineColorAndroid: {
692
- process: require('react-native/Libraries/StyleSheet/processColor').default,
693
- },
691
+ underlineColorAndroid: colorAttribute,
694
692
  textDecorationLine: true,
695
693
  submitBehavior: true,
696
694
  textAlignVertical: true,
697
695
  fontStyle: true,
698
696
  textShadowOffset: true,
699
- selectionColor: {process: require('react-native/Libraries/StyleSheet/processColor').default},
700
- selectionHandleColor: {
701
- process: require('react-native/Libraries/StyleSheet/processColor').default,
702
- },
703
- placeholderTextColor: {
704
- process: require('react-native/Libraries/StyleSheet/processColor').default,
705
- },
697
+ selectionColor: colorAttribute,
698
+ selectionHandleColor: colorAttribute,
699
+ placeholderTextColor: colorAttribute,
706
700
  importantForAutofill: true,
707
701
  lineHeight: true,
708
702
  textTransform: true,
709
703
  returnKeyType: true,
710
704
  keyboardType: true,
711
705
  multiline: true,
712
- color: {process: require('react-native/Libraries/StyleSheet/processColor').default},
706
+ color: colorAttribute,
713
707
  autoComplete: true,
714
708
  numberOfLines: true,
715
709
  letterSpacing: true,
716
710
  returnKeyLabel: true,
717
711
  fontSize: true,
718
712
  onKeyPress: true,
719
- cursorColor: {process: require('react-native/Libraries/StyleSheet/processColor').default},
713
+ cursorColor: colorAttribute,
720
714
  text: true,
721
715
  showSoftInputOnFocus: true,
722
716
  textAlign: true,
@@ -726,8 +720,8 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
726
720
  secureTextEntry: true,
727
721
  textBreakStrategy: true,
728
722
  onScroll: true,
729
- onContentSizeChange: true,
730
723
  onPaste: true,
724
+ onContentSizeChange: true,
731
725
  disableFullscreenUI: true,
732
726
  includeFontPadding: true,
733
727
  fontWeight: true,
@@ -739,29 +733,24 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
739
733
  editable: true,
740
734
  fontVariant: true,
741
735
  borderBottomRightRadius: true,
742
- borderBottomColor: {
743
- process: require('react-native/Libraries/StyleSheet/processColor').default,
744
- },
736
+ borderBottomColor: colorAttribute,
745
737
  borderRadius: true,
746
- borderRightColor: {
747
- process: require('react-native/Libraries/StyleSheet/processColor').default,
748
- },
749
- borderColor: {process: require('react-native/Libraries/StyleSheet/processColor').default},
738
+ borderRightColor: colorAttribute,
739
+ borderColor: colorAttribute,
750
740
  borderTopRightRadius: true,
751
741
  borderStyle: true,
752
742
  borderBottomLeftRadius: true,
753
- borderLeftColor: {
754
- process: require('react-native/Libraries/StyleSheet/processColor').default,
755
- },
743
+ borderLeftColor: colorAttribute,
756
744
  borderTopLeftRadius: true,
757
- borderTopColor: {process: require('react-native/Libraries/StyleSheet/processColor').default},
745
+ borderTopColor: colorAttribute,
758
746
  },
759
747
  };
760
748
 
761
- let AndroidTextInputNativeComponent = NativeComponentRegistry.get<NativeProps>(
762
- 'OneKeyTextInput',
763
- () => __INTERNAL_VIEW_CONFIG,
764
- );
749
+ let AndroidTextInputNativeComponent =
750
+ NativeComponentRegistry.get<AndroidTextInputNativeProps>(
751
+ 'OneKeyTextInput',
752
+ () => __INTERNAL_VIEW_CONFIG,
753
+ );
765
754
 
766
755
  // flowlint-next-line unclear-type:off
767
- export default ((AndroidTextInputNativeComponent: any): HostComponent<NativeProps>);
756
+ export default AndroidTextInputNativeComponent as any as HostComponent<AndroidTextInputNativeProps>;