@ukeyfe/react-native-text-input 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +33 -0
- package/android/build.gradle +126 -0
- package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/UKeyTextInputManagerDelegate.java +26 -0
- package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/UKeyTextInputManagerInterface.java +17 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/RNTextInputViewSpec-generated.cpp +22 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/RNTextInputViewSpec.h +24 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/ComponentDescriptors.cpp +22 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/ComponentDescriptors.h +24 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/EventEmitters.cpp +24 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/EventEmitters.h +25 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/Props.cpp +25 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/Props.h +27 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/RNTextInputViewSpecJSI-generated.cpp +17 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/RNTextInputViewSpecJSI.h +19 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/ShadowNodes.cpp +17 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/ShadowNodes.h +32 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/States.cpp +16 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNTextInputViewSpec/States.h +29 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/textinput/PasteWatcher.kt +10 -0
- package/android/src/main/java/com/textinput/TextInputPackage.kt +19 -0
- package/android/src/main/java/com/textinput/TextInputPasteEvent.kt +48 -0
- package/android/src/main/java/com/textinput/TextInputView.kt +80 -0
- package/android/src/main/java/com/textinput/TextInputViewManager.kt +68 -0
- package/android/src/newarch/TextInputViewManagerSpec.kt +21 -0
- package/android/src/oldarch/TextInputViewManagerSpec.kt +9 -0
- package/ios/TextInputViewManager.mm +23 -0
- package/ios/Utils.h +8 -0
- package/ios/Utils.m +26 -0
- package/ios/generated/build/generated/ios/RNTextInputViewSpec/RNTextInputViewSpec-generated.mm +16 -0
- package/ios/generated/build/generated/ios/RNTextInputViewSpec/RNTextInputViewSpec.h +38 -0
- package/ios/generated/build/generated/ios/RNTextInputViewSpecJSI-generated.cpp +17 -0
- package/ios/generated/build/generated/ios/RNTextInputViewSpecJSI.h +19 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/ComponentDescriptors.cpp +22 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/ComponentDescriptors.h +24 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/EventEmitters.cpp +24 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/EventEmitters.h +25 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/Props.cpp +25 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/Props.h +27 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/RCTComponentViewHelpers.h +20 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/ShadowNodes.cpp +17 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/ShadowNodes.h +32 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/States.cpp +16 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/States.h +29 -0
- package/lib/commonjs/AndroidTextInputNativeComponent.js +152 -0
- package/lib/commonjs/AndroidTextInputNativeComponent.js.map +1 -0
- package/lib/commonjs/Input.js +537 -0
- package/lib/commonjs/Input.js.map +1 -0
- package/lib/commonjs/TextInputViewNativeComponent.ts +9 -0
- package/lib/commonjs/enum.js +11 -0
- package/lib/commonjs/enum.js.map +1 -0
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/type.js +6 -0
- package/lib/commonjs/type.js.map +1 -0
- package/lib/typescript/src/TextInputViewNativeComponent.d.ts +8 -0
- package/lib/typescript/src/TextInputViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/enum.d.ts +4 -0
- package/lib/typescript/src/enum.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +7 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/type.d.ts +16 -0
- package/lib/typescript/src/type.d.ts.map +1 -0
- package/package.json +178 -0
- package/src/AndroidTextInputNativeComponent.js +767 -0
- package/src/Input.js +1910 -0
- package/src/TextInputViewNativeComponent.ts +9 -0
- package/src/enum.ts +3 -0
- package/src/index.tsx +17 -0
- package/src/type.ts +13 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
package com.textinput
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Nullable
|
|
4
|
+
import com.facebook.react.bridge.Arguments
|
|
5
|
+
import com.facebook.react.bridge.WritableMap
|
|
6
|
+
import com.facebook.react.bridge.WritableArray
|
|
7
|
+
import com.facebook.react.uimanager.common.ViewUtil
|
|
8
|
+
import com.facebook.react.uimanager.events.Event
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Event emitted by EditText native view when clipboard content is pasted
|
|
12
|
+
*/
|
|
13
|
+
class TextInputPasteEvent : Event<TextInputPasteEvent> {
|
|
14
|
+
|
|
15
|
+
companion object {
|
|
16
|
+
private const val EVENT_NAME = "topPaste"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
private val mType: String
|
|
20
|
+
private val mData: String
|
|
21
|
+
|
|
22
|
+
@Deprecated("Use the constructor with surfaceId")
|
|
23
|
+
constructor(viewId: Int, type: String, data: String) : this(ViewUtil.NO_SURFACE_ID, viewId, type, data)
|
|
24
|
+
|
|
25
|
+
constructor(surfaceId: Int, viewId: Int, type: String, data: String) : super(surfaceId, viewId) {
|
|
26
|
+
mType = type
|
|
27
|
+
mData = data
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
override fun getEventName(): String = EVENT_NAME
|
|
31
|
+
|
|
32
|
+
override fun canCoalesce(): Boolean = false
|
|
33
|
+
|
|
34
|
+
@Nullable
|
|
35
|
+
override fun getEventData(): WritableMap? {
|
|
36
|
+
val eventData = Arguments.createMap()
|
|
37
|
+
|
|
38
|
+
val items = Arguments.createArray()
|
|
39
|
+
val item = Arguments.createMap()
|
|
40
|
+
item.putString("type", mType)
|
|
41
|
+
item.putString("data", mData)
|
|
42
|
+
items.pushMap(item)
|
|
43
|
+
|
|
44
|
+
eventData.putArray("items", items)
|
|
45
|
+
|
|
46
|
+
return eventData
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
package com.textinput
|
|
2
|
+
|
|
3
|
+
import android.content.ClipData
|
|
4
|
+
import android.content.ClipDescription
|
|
5
|
+
import android.content.ClipboardManager
|
|
6
|
+
import android.content.Context
|
|
7
|
+
import android.os.Build
|
|
8
|
+
import android.text.Spanned
|
|
9
|
+
import androidx.annotation.Nullable
|
|
10
|
+
import com.facebook.react.uimanager.UIManagerHelper
|
|
11
|
+
import com.facebook.react.views.textinput.ReactEditText
|
|
12
|
+
import com.ukey.app.wallet.pasteinput.PasteWatcher
|
|
13
|
+
import android.view.Gravity
|
|
14
|
+
|
|
15
|
+
class TextInputView(context: Context) : ReactEditText(context) {
|
|
16
|
+
|
|
17
|
+
private var mPasteWatcher: PasteWatcher? = null
|
|
18
|
+
|
|
19
|
+
init {
|
|
20
|
+
includeFontPadding = false
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
override fun scrollTo(x: Int, y: Int) {
|
|
24
|
+
if (gravity and Gravity.VERTICAL_GRAVITY_MASK == Gravity.CENTER_VERTICAL) {
|
|
25
|
+
super.scrollTo(x, 0)
|
|
26
|
+
} else {
|
|
27
|
+
super.scrollTo(x, y)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
override fun onTextContextMenuItem(id: Int): Boolean {
|
|
32
|
+
if (id == android.R.id.paste || id == android.R.id.pasteAsPlainText) {
|
|
33
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
34
|
+
val newId = android.R.id.pasteAsPlainText
|
|
35
|
+
mPasteWatcher?.let { pasteWatcher ->
|
|
36
|
+
val clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
|
37
|
+
val clipData = clipboardManager.primaryClip
|
|
38
|
+
var type: String? = null
|
|
39
|
+
var data: String? = null
|
|
40
|
+
if (clipData?.description?.hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN) == true) {
|
|
41
|
+
type = ClipDescription.MIMETYPE_TEXT_PLAIN
|
|
42
|
+
data = clipData.getItemAt(0).text.toString()
|
|
43
|
+
} else {
|
|
44
|
+
val itemUri = clipData?.getItemAt(0)?.uri
|
|
45
|
+
itemUri?.let {
|
|
46
|
+
val cr = UIManagerHelper.getReactContext(this)?.contentResolver
|
|
47
|
+
type = cr?.getType(it)
|
|
48
|
+
data = it.toString()
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (type != null && data != null) {
|
|
52
|
+
pasteWatcher.onPaste(type!!, data!!)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return super.onTextContextMenuItem(newId)
|
|
56
|
+
} else {
|
|
57
|
+
val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
|
58
|
+
val previousClipData = clipboard.primaryClip
|
|
59
|
+
previousClipData?.let {
|
|
60
|
+
for (i in 0 until it.itemCount) {
|
|
61
|
+
val text = it.getItemAt(i).coerceToText(context)
|
|
62
|
+
val paste = if (text is Spanned) text.toString() else text
|
|
63
|
+
paste?.let { pasteText ->
|
|
64
|
+
val clipData = ClipData.newPlainText(null, pasteText)
|
|
65
|
+
clipboard.setPrimaryClip(clipData)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
val actionPerformed = super.onTextContextMenuItem(id)
|
|
69
|
+
clipboard.setPrimaryClip(previousClipData)
|
|
70
|
+
return actionPerformed
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return super.onTextContextMenuItem(id)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
fun setPasteWatcher(@Nullable pasteWatcher: PasteWatcher?) {
|
|
78
|
+
mPasteWatcher = pasteWatcher
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
package com.textinput
|
|
2
|
+
|
|
3
|
+
import android.text.InputType
|
|
4
|
+
import android.view.ViewGroup
|
|
5
|
+
import com.facebook.react.common.MapBuilder
|
|
6
|
+
import com.facebook.react.module.annotations.ReactModule
|
|
7
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
8
|
+
import com.facebook.react.uimanager.UIManagerHelper
|
|
9
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
10
|
+
import com.facebook.react.uimanager.events.EventDispatcher
|
|
11
|
+
import com.facebook.react.views.textinput.ReactEditText
|
|
12
|
+
import com.facebook.react.views.textinput.ReactTextInputManager
|
|
13
|
+
import com.ukey.app.wallet.pasteinput.PasteWatcher
|
|
14
|
+
|
|
15
|
+
@ReactModule(name = ReactTextInputManager.REACT_CLASS)
|
|
16
|
+
class TextInputViewManager() : ReactTextInputManager() {
|
|
17
|
+
|
|
18
|
+
companion object {
|
|
19
|
+
const val REACT_CLASS = "UKeyTextInput"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
override fun getName(): String = REACT_CLASS
|
|
23
|
+
|
|
24
|
+
override fun createViewInstance(context: ThemedReactContext): ReactEditText {
|
|
25
|
+
val editText = TextInputView(context)
|
|
26
|
+
val inputType = editText.inputType
|
|
27
|
+
editText.inputType = inputType and InputType.TYPE_TEXT_FLAG_MULTI_LINE.inv()
|
|
28
|
+
editText.returnKeyType = "done"
|
|
29
|
+
editText.layoutParams = ViewGroup.LayoutParams(
|
|
30
|
+
ViewGroup.LayoutParams.WRAP_CONTENT,
|
|
31
|
+
ViewGroup.LayoutParams.WRAP_CONTENT
|
|
32
|
+
)
|
|
33
|
+
return editText
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
override fun getExportedCustomDirectEventTypeConstants(): Map<String, Any>? {
|
|
37
|
+
val baseEventTypeConstants = super.getExportedCustomDirectEventTypeConstants()?.toMutableMap()
|
|
38
|
+
baseEventTypeConstants?.put("topPaste", MapBuilder.of("registrationName", "onPaste"))
|
|
39
|
+
return baseEventTypeConstants
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@ReactProp(name = "onPaste", defaultBoolean = false)
|
|
43
|
+
fun setOnPaste(view: TextInputView, onPaste: Boolean) {
|
|
44
|
+
if (onPaste) {
|
|
45
|
+
view.setPasteWatcher(ReactPasteWatcher(view))
|
|
46
|
+
} else {
|
|
47
|
+
view.setPasteWatcher(null)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private class ReactPasteWatcher(editText: TextInputView) : PasteWatcher {
|
|
52
|
+
private val mReactEditText: TextInputView = editText
|
|
53
|
+
private val mEventDispatcher: EventDispatcher
|
|
54
|
+
private val mSurfaceId: Int
|
|
55
|
+
|
|
56
|
+
init {
|
|
57
|
+
val reactContext = UIManagerHelper.getReactContext(editText)
|
|
58
|
+
mEventDispatcher = UIManagerHelper.getEventDispatcherForReactTag(reactContext, editText.id)!!
|
|
59
|
+
mSurfaceId = UIManagerHelper.getSurfaceId(reactContext)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
override fun onPaste(type: String, data: String) {
|
|
63
|
+
mEventDispatcher.dispatchEvent(
|
|
64
|
+
TextInputPasteEvent(mSurfaceId, mReactEditText.id, type, data)
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
package com.textinput
|
|
2
|
+
|
|
3
|
+
import android.view.View
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
7
|
+
import com.facebook.react.uimanager.ViewManagerDelegate
|
|
8
|
+
import com.facebook.react.viewmanagers.UKeyTextInputManagerDelegate
|
|
9
|
+
import com.facebook.react.viewmanagers.UKeyTextInputManagerInterface
|
|
10
|
+
|
|
11
|
+
abstract class TextInputViewManagerSpec<T : View> : SimpleViewManager<T>(), UKeyTextInputManagerInterface<T> {
|
|
12
|
+
private val mDelegate: ViewManagerDelegate<T>
|
|
13
|
+
|
|
14
|
+
init {
|
|
15
|
+
mDelegate = UKeyTextInputManagerDelegate(this)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
override fun getDelegate(): ViewManagerDelegate<T>? {
|
|
19
|
+
return mDelegate
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
package com.textinput
|
|
2
|
+
|
|
3
|
+
import android.view.View
|
|
4
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
6
|
+
|
|
7
|
+
abstract class TextInputViewManagerSpec<T : View> : SimpleViewManager<T>() {
|
|
8
|
+
abstract fun setColor(view: T?, value: String?)
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#import <React/RCTViewManager.h>
|
|
2
|
+
#import <React/RCTUIManager.h>
|
|
3
|
+
#import "RCTBridge.h"
|
|
4
|
+
#import "Utils.h"
|
|
5
|
+
|
|
6
|
+
@interface TextInputViewManager : RCTViewManager
|
|
7
|
+
@end
|
|
8
|
+
|
|
9
|
+
@implementation TextInputViewManager
|
|
10
|
+
|
|
11
|
+
RCT_EXPORT_MODULE(TextInputView)
|
|
12
|
+
|
|
13
|
+
- (UIView *)view
|
|
14
|
+
{
|
|
15
|
+
return [[UIView alloc] init];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
RCT_CUSTOM_VIEW_PROPERTY(color, NSString, UIView)
|
|
19
|
+
{
|
|
20
|
+
[view setBackgroundColor: [Utils hexStringToColor:json]];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@end
|
package/ios/Utils.h
ADDED
package/ios/Utils.m
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
#import "Utils.h"
|
|
3
|
+
#import <UIKit/UIKit.h>
|
|
4
|
+
|
|
5
|
+
@implementation Utils
|
|
6
|
+
|
|
7
|
+
+ hexStringToColor:(NSString *)stringToConvert
|
|
8
|
+
{
|
|
9
|
+
NSString *noHashString = [stringToConvert stringByReplacingOccurrencesOfString:@"#" withString:@""];
|
|
10
|
+
NSScanner *stringScanner = [NSScanner scannerWithString:noHashString];
|
|
11
|
+
|
|
12
|
+
unsigned hex;
|
|
13
|
+
if (![stringScanner scanHexInt:&hex]) return nil;
|
|
14
|
+
int r = (hex >> 16) & 0xFF;
|
|
15
|
+
int g = (hex >> 8) & 0xFF;
|
|
16
|
+
int b = (hex) & 0xFF;
|
|
17
|
+
|
|
18
|
+
return [UIColor colorWithRed:r / 255.0f green:g / 255.0f blue:b / 255.0f alpha:1.0f];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
+ (id)alloc {
|
|
22
|
+
[NSException raise:@"Cannot be instantiated!" format:@"Static class 'Utils' cannot be instantiated!"];
|
|
23
|
+
return nil;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@end
|
package/ios/generated/build/generated/ios/RNTextInputViewSpec/RNTextInputViewSpec-generated.mm
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleObjCpp
|
|
8
|
+
*
|
|
9
|
+
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
+
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
+
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#import "RNTextInputViewSpec.h"
|
|
15
|
+
|
|
16
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleObjCpp
|
|
8
|
+
*
|
|
9
|
+
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
+
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
+
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#ifndef __cplusplus
|
|
15
|
+
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
// Avoid multiple includes of RNTextInputViewSpec symbols
|
|
19
|
+
#ifndef RNTextInputViewSpec_H
|
|
20
|
+
#define RNTextInputViewSpec_H
|
|
21
|
+
|
|
22
|
+
#import <Foundation/Foundation.h>
|
|
23
|
+
#import <RCTRequired/RCTRequired.h>
|
|
24
|
+
#import <RCTTypeSafety/RCTConvertHelpers.h>
|
|
25
|
+
#import <RCTTypeSafety/RCTTypedModuleConstants.h>
|
|
26
|
+
#import <React/RCTBridgeModule.h>
|
|
27
|
+
#import <React/RCTCxxConvert.h>
|
|
28
|
+
#import <React/RCTManagedPointer.h>
|
|
29
|
+
#import <ReactCommon/RCTTurboModule.h>
|
|
30
|
+
#import <optional>
|
|
31
|
+
#import <vector>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
NS_ASSUME_NONNULL_END
|
|
38
|
+
#endif // RNTextInputViewSpec_H
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#include "RNTextInputViewSpecJSI.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleH.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <ReactCommon/TurboModule.h>
|
|
13
|
+
#include <react/bridging/Bridging.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/RNTextInputViewSpec/ComponentDescriptors.h>
|
|
12
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
13
|
+
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
void RNTextInputViewSpec_registerComponentDescriptorsFromCodegen(
|
|
18
|
+
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
|
19
|
+
registry->add(concreteComponentDescriptorProvider<UKeyTextInputComponentDescriptor>());
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <react/renderer/components/RNTextInputViewSpec/ShadowNodes.h>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
16
|
+
|
|
17
|
+
namespace facebook::react {
|
|
18
|
+
|
|
19
|
+
using UKeyTextInputComponentDescriptor = ConcreteComponentDescriptor<UKeyTextInputShadowNode>;
|
|
20
|
+
|
|
21
|
+
void RNTextInputViewSpec_registerComponentDescriptorsFromCodegen(
|
|
22
|
+
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
|
23
|
+
|
|
24
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/RNTextInputViewSpec/EventEmitters.h>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
namespace facebook::react {
|
|
15
|
+
|
|
16
|
+
void UKeyTextInputEventEmitter::onPaste(OnPaste $event) const {
|
|
17
|
+
dispatchEvent("paste", [](jsi::Runtime &runtime) {
|
|
18
|
+
auto $payload = jsi::Object(runtime);
|
|
19
|
+
|
|
20
|
+
return $payload;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
class UKeyTextInputEventEmitter : public ViewEventEmitter {
|
|
17
|
+
public:
|
|
18
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
19
|
+
|
|
20
|
+
struct OnPaste {
|
|
21
|
+
|
|
22
|
+
};
|
|
23
|
+
void onPaste(OnPaste value) const;
|
|
24
|
+
};
|
|
25
|
+
} // namespace facebook::react
|
package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/Props.cpp
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GeneratePropsCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/RNTextInputViewSpec/Props.h>
|
|
12
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
13
|
+
#include <react/renderer/core/propsConversions.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
UKeyTextInputProps::UKeyTextInputProps(
|
|
18
|
+
const PropsParserContext &context,
|
|
19
|
+
const UKeyTextInputProps &sourceProps,
|
|
20
|
+
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
{}
|
|
24
|
+
|
|
25
|
+
} // namespace facebook::react
|
package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/Props.h
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GeneratePropsH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
13
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
class UKeyTextInputProps final : public ViewProps {
|
|
18
|
+
public:
|
|
19
|
+
UKeyTextInputProps() = default;
|
|
20
|
+
UKeyTextInputProps(const PropsParserContext& context, const UKeyTextInputProps &sourceProps, const RawProps &rawProps);
|
|
21
|
+
|
|
22
|
+
#pragma mark - Props
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateComponentHObjCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
#import <React/RCTDefines.h>
|
|
12
|
+
#import <React/RCTLog.h>
|
|
13
|
+
|
|
14
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
15
|
+
|
|
16
|
+
@protocol RCTUKeyTextInputViewProtocol <NSObject>
|
|
17
|
+
|
|
18
|
+
@end
|
|
19
|
+
|
|
20
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateShadowNodeCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/RNTextInputViewSpec/ShadowNodes.h>
|
|
12
|
+
|
|
13
|
+
namespace facebook::react {
|
|
14
|
+
|
|
15
|
+
extern const char UKeyTextInputComponentName[] = "UKeyTextInput";
|
|
16
|
+
|
|
17
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateShadowNodeH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <react/renderer/components/RNTextInputViewSpec/EventEmitters.h>
|
|
14
|
+
#include <react/renderer/components/RNTextInputViewSpec/Props.h>
|
|
15
|
+
#include <react/renderer/components/RNTextInputViewSpec/States.h>
|
|
16
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
17
|
+
#include <jsi/jsi.h>
|
|
18
|
+
|
|
19
|
+
namespace facebook::react {
|
|
20
|
+
|
|
21
|
+
JSI_EXPORT extern const char UKeyTextInputComponentName[];
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* `ShadowNode` for <UKeyTextInput> component.
|
|
25
|
+
*/
|
|
26
|
+
using UKeyTextInputShadowNode = ConcreteViewShadowNode<
|
|
27
|
+
UKeyTextInputComponentName,
|
|
28
|
+
UKeyTextInputProps,
|
|
29
|
+
UKeyTextInputEventEmitter,
|
|
30
|
+
UKeyTextInputState>;
|
|
31
|
+
|
|
32
|
+
} // namespace facebook::react
|
package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/States.cpp
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateStateCpp.js
|
|
9
|
+
*/
|
|
10
|
+
#include <react/renderer/components/RNTextInputViewSpec/States.h>
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
} // namespace facebook::react
|
package/ios/generated/build/generated/ios/react/renderer/components/RNTextInputViewSpec/States.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateStateH.js
|
|
8
|
+
*/
|
|
9
|
+
#pragma once
|
|
10
|
+
|
|
11
|
+
#ifdef ANDROID
|
|
12
|
+
#include <folly/dynamic.h>
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
class UKeyTextInputState {
|
|
18
|
+
public:
|
|
19
|
+
UKeyTextInputState() = default;
|
|
20
|
+
|
|
21
|
+
#ifdef ANDROID
|
|
22
|
+
UKeyTextInputState(UKeyTextInputState const &previousState, folly::dynamic data){};
|
|
23
|
+
folly::dynamic getDynamic() const {
|
|
24
|
+
return {};
|
|
25
|
+
};
|
|
26
|
+
#endif
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
} // namespace facebook::react
|