@tbvjaos510/react-native-paste-input 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -22
- package/android/build.gradle +5 -27
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputActionCallback.kt +10 -9
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputEditText.kt +1 -2
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputListener.kt +91 -44
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteTextInputManager.kt +33 -0
- package/ios/PasteTextInput.mm +15 -5
- package/ios/PasteTextInputManager.mm +28 -93
- package/lib/commonjs/PasteTextInput.js +5 -5
- package/lib/commonjs/PasteTextInput.js.map +1 -1
- package/lib/commonjs/PasteTextInputSpec.js +33 -0
- package/lib/commonjs/PasteTextInputSpec.js.map +1 -0
- package/lib/module/PasteTextInput.js +1 -1
- package/lib/module/PasteTextInput.js.map +1 -1
- package/lib/module/PasteTextInputSpec.js +31 -0
- package/lib/module/PasteTextInputSpec.js.map +1 -0
- package/lib/typescript/PasteTextInput.d.ts.map +1 -0
- package/lib/typescript/{src/PasteTextInputNativeComponent.d.ts → PasteTextInputSpec.d.ts} +4 -4
- package/lib/typescript/PasteTextInputSpec.d.ts.map +1 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/types.d.ts.map +1 -0
- package/package.json +5 -17
- package/react-native-paste-input.podspec +12 -4
- package/react-native.config.js +5 -1
- package/src/PasteTextInput.tsx +1 -3
- package/{lib/module/PasteTextInputNativeComponent.ts → src/PasteTextInputSpec.ts} +34 -7
- package/android/generated/java/com/facebook/react/viewmanagers/PasteTextInputManagerDelegate.java +0 -236
- package/android/generated/java/com/facebook/react/viewmanagers/PasteTextInputManagerInterface.java +0 -84
- package/android/generated/jni/CMakeLists.txt +0 -36
- package/android/generated/jni/PasteTextInputSpecs-generated.cpp +0 -27
- package/android/generated/jni/PasteTextInputSpecs.h +0 -28
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ComponentDescriptors.cpp +0 -22
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ComponentDescriptors.h +0 -166
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/EventEmitters.cpp +0 -183
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/EventEmitters.h +0 -148
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/PasteTextInputSpecsJSI-generated.cpp +0 -17
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/PasteTextInputSpecsJSI.h +0 -19
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/Props.cpp +0 -640
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/Props.h +0 -144
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ShadowNodes.cpp +0 -247
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ShadowNodes.h +0 -95
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/States.cpp +0 -14
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/States.h +0 -19
- package/lib/commonjs/PasteTextInputNativeComponent.ts +0 -277
- package/lib/typescript/src/PasteTextInput.d.ts.map +0 -1
- package/lib/typescript/src/PasteTextInputNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/types.d.ts.map +0 -1
- package/src/PasteTextInputNativeComponent.ts +0 -277
- /package/lib/typescript/{src/PasteTextInput.d.ts → PasteTextInput.d.ts} +0 -0
- /package/lib/typescript/{src/index.d.ts → index.d.ts} +0 -0
- /package/lib/typescript/{src/types.d.ts → types.d.ts} +0 -0
package/android/generated/java/com/facebook/react/viewmanagers/PasteTextInputManagerDelegate.java
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
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: GeneratePropsJavaDelegate.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.viewmanagers;
|
|
11
|
-
|
|
12
|
-
import android.view.View;
|
|
13
|
-
import androidx.annotation.Nullable;
|
|
14
|
-
import com.facebook.react.bridge.ColorPropConverter;
|
|
15
|
-
import com.facebook.react.bridge.ReadableArray;
|
|
16
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
17
|
-
import com.facebook.react.uimanager.BaseViewManager;
|
|
18
|
-
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
19
|
-
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
20
|
-
|
|
21
|
-
public class PasteTextInputManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & PasteTextInputManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
22
|
-
public PasteTextInputManagerDelegate(U viewManager) {
|
|
23
|
-
super(viewManager);
|
|
24
|
-
}
|
|
25
|
-
@Override
|
|
26
|
-
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
27
|
-
switch (propName) {
|
|
28
|
-
case "allowFontScaling":
|
|
29
|
-
mViewManager.setAllowFontScaling(view, value == null ? false : (boolean) value);
|
|
30
|
-
break;
|
|
31
|
-
case "autoCapitalize":
|
|
32
|
-
mViewManager.setAutoCapitalize(view, (String) value);
|
|
33
|
-
break;
|
|
34
|
-
case "autoComplete":
|
|
35
|
-
mViewManager.setAutoComplete(view, (String) value);
|
|
36
|
-
break;
|
|
37
|
-
case "autoCorrect":
|
|
38
|
-
mViewManager.setAutoCorrect(view, value == null ? false : (boolean) value);
|
|
39
|
-
break;
|
|
40
|
-
case "autoFocus":
|
|
41
|
-
mViewManager.setAutoFocus(view, value == null ? false : (boolean) value);
|
|
42
|
-
break;
|
|
43
|
-
case "blurOnSubmit":
|
|
44
|
-
mViewManager.setBlurOnSubmit(view, value == null ? false : (boolean) value);
|
|
45
|
-
break;
|
|
46
|
-
case "caretHidden":
|
|
47
|
-
mViewManager.setCaretHidden(view, value == null ? false : (boolean) value);
|
|
48
|
-
break;
|
|
49
|
-
case "clearButtonMode":
|
|
50
|
-
mViewManager.setClearButtonMode(view, value == null ? null : (String) value);
|
|
51
|
-
break;
|
|
52
|
-
case "clearTextOnFocus":
|
|
53
|
-
mViewManager.setClearTextOnFocus(view, value == null ? false : (boolean) value);
|
|
54
|
-
break;
|
|
55
|
-
case "contextMenuHidden":
|
|
56
|
-
mViewManager.setContextMenuHidden(view, value == null ? false : (boolean) value);
|
|
57
|
-
break;
|
|
58
|
-
case "defaultValue":
|
|
59
|
-
mViewManager.setDefaultValue(view, value == null ? null : (String) value);
|
|
60
|
-
break;
|
|
61
|
-
case "disableCopyPaste":
|
|
62
|
-
mViewManager.setDisableCopyPaste(view, value == null ? false : (boolean) value);
|
|
63
|
-
break;
|
|
64
|
-
case "disableFullscreenUI":
|
|
65
|
-
mViewManager.setDisableFullscreenUI(view, value == null ? false : (boolean) value);
|
|
66
|
-
break;
|
|
67
|
-
case "editable":
|
|
68
|
-
mViewManager.setEditable(view, value == null ? false : (boolean) value);
|
|
69
|
-
break;
|
|
70
|
-
case "enablesReturnKeyAutomatically":
|
|
71
|
-
mViewManager.setEnablesReturnKeyAutomatically(view, value == null ? false : (boolean) value);
|
|
72
|
-
break;
|
|
73
|
-
case "importantForAutofill":
|
|
74
|
-
mViewManager.setImportantForAutofill(view, value == null ? null : (String) value);
|
|
75
|
-
break;
|
|
76
|
-
case "inlineImageLeft":
|
|
77
|
-
mViewManager.setInlineImageLeft(view, value == null ? null : (String) value);
|
|
78
|
-
break;
|
|
79
|
-
case "inlineImagePadding":
|
|
80
|
-
mViewManager.setInlineImagePadding(view, value == null ? 0 : ((Double) value).intValue());
|
|
81
|
-
break;
|
|
82
|
-
case "inputAccessoryViewID":
|
|
83
|
-
mViewManager.setInputAccessoryViewID(view, value == null ? null : (String) value);
|
|
84
|
-
break;
|
|
85
|
-
case "keyboardAppearance":
|
|
86
|
-
mViewManager.setKeyboardAppearance(view, value == null ? null : (String) value);
|
|
87
|
-
break;
|
|
88
|
-
case "keyboardType":
|
|
89
|
-
mViewManager.setKeyboardType(view, (String) value);
|
|
90
|
-
break;
|
|
91
|
-
case "maxFontSizeMultiplier":
|
|
92
|
-
mViewManager.setMaxFontSizeMultiplier(view, value == null ? 0f : ((Double) value).floatValue());
|
|
93
|
-
break;
|
|
94
|
-
case "maxLength":
|
|
95
|
-
mViewManager.setMaxLength(view, value == null ? 0 : ((Double) value).intValue());
|
|
96
|
-
break;
|
|
97
|
-
case "mostRecentEventCount":
|
|
98
|
-
mViewManager.setMostRecentEventCount(view, value == null ? 0 : ((Double) value).intValue());
|
|
99
|
-
break;
|
|
100
|
-
case "multiline":
|
|
101
|
-
mViewManager.setMultiline(view, value == null ? false : (boolean) value);
|
|
102
|
-
break;
|
|
103
|
-
case "numberOfLines":
|
|
104
|
-
mViewManager.setNumberOfLines(view, value == null ? 0 : ((Double) value).intValue());
|
|
105
|
-
break;
|
|
106
|
-
case "passwordRules":
|
|
107
|
-
mViewManager.setPasswordRules(view, value == null ? null : (String) value);
|
|
108
|
-
break;
|
|
109
|
-
case "placeholder":
|
|
110
|
-
mViewManager.setPlaceholder(view, value == null ? null : (String) value);
|
|
111
|
-
break;
|
|
112
|
-
case "placeholderTextColor":
|
|
113
|
-
mViewManager.setPlaceholderTextColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
114
|
-
break;
|
|
115
|
-
case "returnKeyLabel":
|
|
116
|
-
mViewManager.setReturnKeyLabel(view, value == null ? null : (String) value);
|
|
117
|
-
break;
|
|
118
|
-
case "returnKeyType":
|
|
119
|
-
mViewManager.setReturnKeyType(view, (String) value);
|
|
120
|
-
break;
|
|
121
|
-
case "scrollEnabled":
|
|
122
|
-
mViewManager.setScrollEnabled(view, value == null ? false : (boolean) value);
|
|
123
|
-
break;
|
|
124
|
-
case "secureTextEntry":
|
|
125
|
-
mViewManager.setSecureTextEntry(view, value == null ? false : (boolean) value);
|
|
126
|
-
break;
|
|
127
|
-
case "selection":
|
|
128
|
-
mViewManager.setSelection(view, (ReadableMap) value);
|
|
129
|
-
break;
|
|
130
|
-
case "selectionColor":
|
|
131
|
-
mViewManager.setSelectionColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
132
|
-
break;
|
|
133
|
-
case "selectionHandleColor":
|
|
134
|
-
mViewManager.setSelectionHandleColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
135
|
-
break;
|
|
136
|
-
case "selectTextOnFocus":
|
|
137
|
-
mViewManager.setSelectTextOnFocus(view, value == null ? false : (boolean) value);
|
|
138
|
-
break;
|
|
139
|
-
case "showSoftInputOnFocus":
|
|
140
|
-
mViewManager.setShowSoftInputOnFocus(view, value == null ? false : (boolean) value);
|
|
141
|
-
break;
|
|
142
|
-
case "smartInsertDelete":
|
|
143
|
-
mViewManager.setSmartInsertDelete(view, value == null ? false : (boolean) value);
|
|
144
|
-
break;
|
|
145
|
-
case "smartPunctuation":
|
|
146
|
-
mViewManager.setSmartPunctuation(view, value == null ? null : (String) value);
|
|
147
|
-
break;
|
|
148
|
-
case "spellCheck":
|
|
149
|
-
mViewManager.setSpellCheck(view, value == null ? false : (boolean) value);
|
|
150
|
-
break;
|
|
151
|
-
case "submitBehavior":
|
|
152
|
-
mViewManager.setSubmitBehavior(view, (String) value);
|
|
153
|
-
break;
|
|
154
|
-
case "text":
|
|
155
|
-
mViewManager.setText(view, value == null ? null : (String) value);
|
|
156
|
-
break;
|
|
157
|
-
case "textBreakStrategy":
|
|
158
|
-
mViewManager.setTextBreakStrategy(view, (String) value);
|
|
159
|
-
break;
|
|
160
|
-
case "textContentType":
|
|
161
|
-
mViewManager.setTextContentType(view, value == null ? null : (String) value);
|
|
162
|
-
break;
|
|
163
|
-
case "underlineColorAndroid":
|
|
164
|
-
mViewManager.setUnderlineColorAndroid(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
165
|
-
break;
|
|
166
|
-
case "value":
|
|
167
|
-
mViewManager.setValue(view, value == null ? null : (String) value);
|
|
168
|
-
break;
|
|
169
|
-
case "textShadowColor":
|
|
170
|
-
mViewManager.setTextShadowColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
171
|
-
break;
|
|
172
|
-
case "textShadowRadius":
|
|
173
|
-
mViewManager.setTextShadowRadius(view, value == null ? 0f : ((Double) value).floatValue());
|
|
174
|
-
break;
|
|
175
|
-
case "textDecorationLine":
|
|
176
|
-
mViewManager.setTextDecorationLine(view, value == null ? null : (String) value);
|
|
177
|
-
break;
|
|
178
|
-
case "fontStyle":
|
|
179
|
-
mViewManager.setFontStyle(view, value == null ? null : (String) value);
|
|
180
|
-
break;
|
|
181
|
-
case "textShadowOffset":
|
|
182
|
-
mViewManager.setTextShadowOffset(view, (ReadableMap) value);
|
|
183
|
-
break;
|
|
184
|
-
case "lineHeight":
|
|
185
|
-
mViewManager.setLineHeight(view, value == null ? 0f : ((Double) value).floatValue());
|
|
186
|
-
break;
|
|
187
|
-
case "textTransform":
|
|
188
|
-
mViewManager.setTextTransform(view, value == null ? null : (String) value);
|
|
189
|
-
break;
|
|
190
|
-
case "color":
|
|
191
|
-
mViewManager.setColor(view, value == null ? 0 : ((Double) value).intValue());
|
|
192
|
-
break;
|
|
193
|
-
case "letterSpacing":
|
|
194
|
-
mViewManager.setLetterSpacing(view, value == null ? 0f : ((Double) value).floatValue());
|
|
195
|
-
break;
|
|
196
|
-
case "fontSize":
|
|
197
|
-
mViewManager.setFontSize(view, value == null ? 0f : ((Double) value).floatValue());
|
|
198
|
-
break;
|
|
199
|
-
case "textAlign":
|
|
200
|
-
mViewManager.setTextAlign(view, value == null ? null : (String) value);
|
|
201
|
-
break;
|
|
202
|
-
case "includeFontPadding":
|
|
203
|
-
mViewManager.setIncludeFontPadding(view, value == null ? false : (boolean) value);
|
|
204
|
-
break;
|
|
205
|
-
case "fontWeight":
|
|
206
|
-
mViewManager.setFontWeight(view, value == null ? null : (String) value);
|
|
207
|
-
break;
|
|
208
|
-
case "fontFamily":
|
|
209
|
-
mViewManager.setFontFamily(view, value == null ? null : (String) value);
|
|
210
|
-
break;
|
|
211
|
-
case "textAlignVertical":
|
|
212
|
-
mViewManager.setTextAlignVertical(view, value == null ? null : (String) value);
|
|
213
|
-
break;
|
|
214
|
-
case "cursorColor":
|
|
215
|
-
mViewManager.setCursorColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
216
|
-
break;
|
|
217
|
-
default:
|
|
218
|
-
super.setProperty(view, propName, value);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
@Override
|
|
223
|
-
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
|
|
224
|
-
switch (commandName) {
|
|
225
|
-
case "focus":
|
|
226
|
-
mViewManager.focus(view);
|
|
227
|
-
break;
|
|
228
|
-
case "blur":
|
|
229
|
-
mViewManager.blur(view);
|
|
230
|
-
break;
|
|
231
|
-
case "setTextAndSelection":
|
|
232
|
-
mViewManager.setTextAndSelection(view, args.getInt(0), args.getString(1), args.getInt(2), args.getInt(3));
|
|
233
|
-
break;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
package/android/generated/java/com/facebook/react/viewmanagers/PasteTextInputManagerInterface.java
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
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: GeneratePropsJavaInterface.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.viewmanagers;
|
|
11
|
-
|
|
12
|
-
import android.view.View;
|
|
13
|
-
import androidx.annotation.Nullable;
|
|
14
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
15
|
-
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
|
|
16
|
-
|
|
17
|
-
public interface PasteTextInputManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
|
|
18
|
-
void setAllowFontScaling(T view, boolean value);
|
|
19
|
-
void setAutoCapitalize(T view, @Nullable String value);
|
|
20
|
-
void setAutoComplete(T view, @Nullable String value);
|
|
21
|
-
void setAutoCorrect(T view, boolean value);
|
|
22
|
-
void setAutoFocus(T view, boolean value);
|
|
23
|
-
void setBlurOnSubmit(T view, boolean value);
|
|
24
|
-
void setCaretHidden(T view, boolean value);
|
|
25
|
-
void setClearButtonMode(T view, @Nullable String value);
|
|
26
|
-
void setClearTextOnFocus(T view, boolean value);
|
|
27
|
-
void setContextMenuHidden(T view, boolean value);
|
|
28
|
-
void setDefaultValue(T view, @Nullable String value);
|
|
29
|
-
void setDisableCopyPaste(T view, boolean value);
|
|
30
|
-
void setDisableFullscreenUI(T view, boolean value);
|
|
31
|
-
void setEditable(T view, boolean value);
|
|
32
|
-
void setEnablesReturnKeyAutomatically(T view, boolean value);
|
|
33
|
-
void setImportantForAutofill(T view, @Nullable String value);
|
|
34
|
-
void setInlineImageLeft(T view, @Nullable String value);
|
|
35
|
-
void setInlineImagePadding(T view, int value);
|
|
36
|
-
void setInputAccessoryViewID(T view, @Nullable String value);
|
|
37
|
-
void setKeyboardAppearance(T view, @Nullable String value);
|
|
38
|
-
void setKeyboardType(T view, @Nullable String value);
|
|
39
|
-
void setMaxFontSizeMultiplier(T view, float value);
|
|
40
|
-
void setMaxLength(T view, int value);
|
|
41
|
-
void setMostRecentEventCount(T view, int value);
|
|
42
|
-
void setMultiline(T view, boolean value);
|
|
43
|
-
void setNumberOfLines(T view, int value);
|
|
44
|
-
void setPasswordRules(T view, @Nullable String value);
|
|
45
|
-
void setPlaceholder(T view, @Nullable String value);
|
|
46
|
-
void setPlaceholderTextColor(T view, @Nullable Integer value);
|
|
47
|
-
void setReturnKeyLabel(T view, @Nullable String value);
|
|
48
|
-
void setReturnKeyType(T view, @Nullable String value);
|
|
49
|
-
void setScrollEnabled(T view, boolean value);
|
|
50
|
-
void setSecureTextEntry(T view, boolean value);
|
|
51
|
-
void setSelection(T view, @Nullable ReadableMap value);
|
|
52
|
-
void setSelectionColor(T view, @Nullable Integer value);
|
|
53
|
-
void setSelectionHandleColor(T view, @Nullable Integer value);
|
|
54
|
-
void setSelectTextOnFocus(T view, boolean value);
|
|
55
|
-
void setShowSoftInputOnFocus(T view, boolean value);
|
|
56
|
-
void setSmartInsertDelete(T view, boolean value);
|
|
57
|
-
void setSmartPunctuation(T view, @Nullable String value);
|
|
58
|
-
void setSpellCheck(T view, boolean value);
|
|
59
|
-
void setSubmitBehavior(T view, @Nullable String value);
|
|
60
|
-
void setText(T view, @Nullable String value);
|
|
61
|
-
void setTextBreakStrategy(T view, @Nullable String value);
|
|
62
|
-
void setTextContentType(T view, @Nullable String value);
|
|
63
|
-
void setUnderlineColorAndroid(T view, @Nullable Integer value);
|
|
64
|
-
void setValue(T view, @Nullable String value);
|
|
65
|
-
void setTextShadowColor(T view, @Nullable Integer value);
|
|
66
|
-
void setTextShadowRadius(T view, float value);
|
|
67
|
-
void setTextDecorationLine(T view, @Nullable String value);
|
|
68
|
-
void setFontStyle(T view, @Nullable String value);
|
|
69
|
-
void setTextShadowOffset(T view, @Nullable ReadableMap value);
|
|
70
|
-
void setLineHeight(T view, float value);
|
|
71
|
-
void setTextTransform(T view, @Nullable String value);
|
|
72
|
-
void setColor(T view, int value);
|
|
73
|
-
void setLetterSpacing(T view, float value);
|
|
74
|
-
void setFontSize(T view, float value);
|
|
75
|
-
void setTextAlign(T view, @Nullable String value);
|
|
76
|
-
void setIncludeFontPadding(T view, boolean value);
|
|
77
|
-
void setFontWeight(T view, @Nullable String value);
|
|
78
|
-
void setFontFamily(T view, @Nullable String value);
|
|
79
|
-
void setTextAlignVertical(T view, @Nullable String value);
|
|
80
|
-
void setCursorColor(T view, @Nullable Integer value);
|
|
81
|
-
void focus(T view);
|
|
82
|
-
void blur(T view);
|
|
83
|
-
void setTextAndSelection(T view, int mostRecentEventCount, String value, int start, int end);
|
|
84
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
cmake_minimum_required(VERSION 3.13)
|
|
7
|
-
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
-
|
|
9
|
-
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/PasteTextInputSpecs/*.cpp)
|
|
10
|
-
|
|
11
|
-
add_library(
|
|
12
|
-
react_codegen_PasteTextInputSpecs
|
|
13
|
-
OBJECT
|
|
14
|
-
${react_codegen_SRCS}
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
target_include_directories(react_codegen_PasteTextInputSpecs PUBLIC . react/renderer/components/PasteTextInputSpecs)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(
|
|
20
|
-
react_codegen_PasteTextInputSpecs
|
|
21
|
-
fbjni
|
|
22
|
-
jsi
|
|
23
|
-
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
24
|
-
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
|
25
|
-
reactnative
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
target_compile_options(
|
|
29
|
-
react_codegen_PasteTextInputSpecs
|
|
30
|
-
PRIVATE
|
|
31
|
-
-DLOG_TAG=\"ReactNative\"
|
|
32
|
-
-fexceptions
|
|
33
|
-
-frtti
|
|
34
|
-
-std=c++20
|
|
35
|
-
-Wall
|
|
36
|
-
)
|
|
@@ -1,27 +0,0 @@
|
|
|
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: GenerateModuleJniCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include "PasteTextInputSpecs.h"
|
|
12
|
-
|
|
13
|
-
namespace facebook::react {
|
|
14
|
-
|
|
15
|
-
PasteTextInputSpecsJSI::PasteTextInputSpecsJSI(
|
|
16
|
-
const JavaTurboModule::InitParams ¶ms)
|
|
17
|
-
: JavaTurboModule(params) {
|
|
18
|
-
// methodMap_["install"] =
|
|
19
|
-
// MethodMetadata{0, __hostFunction_NativeLiveMarkdownModuleSpecJSI_install};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
std::shared_ptr<TurboModule> PasteTextInputSpecs_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
23
|
-
|
|
24
|
-
return nullptr;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
} // namespace facebook::react
|
|
@@ -1,28 +0,0 @@
|
|
|
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: GenerateModuleJniH.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include <ReactCommon/JavaTurboModule.h>
|
|
14
|
-
#include <ReactCommon/TurboModule.h>
|
|
15
|
-
#include <jsi/jsi.h>
|
|
16
|
-
#include <react/renderer/components/PasteTextInputSpecs/ComponentDescriptors.h>
|
|
17
|
-
|
|
18
|
-
namespace facebook::react {
|
|
19
|
-
|
|
20
|
-
class JSI_EXPORT PasteTextInputSpecsJSI : public JavaTurboModule {
|
|
21
|
-
public:
|
|
22
|
-
PasteTextInputSpecsJSI(const JavaTurboModule::InitParams ¶ms);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
JSI_EXPORT
|
|
26
|
-
std::shared_ptr<TurboModule> PasteTextInputSpecs_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
27
|
-
|
|
28
|
-
} // namespace facebook::react
|
package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ComponentDescriptors.cpp
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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 "ComponentDescriptors.h"
|
|
12
|
-
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
13
|
-
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
void PasteTextInputSpecs_registerComponentDescriptorsFromCodegen(
|
|
18
|
-
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
|
19
|
-
registry->add(concreteComponentDescriptorProvider<PasteTextInputComponentDescriptor>());
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
} // namespace facebook::react
|
package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ComponentDescriptors.h
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
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 "ShadowNodes.h"
|
|
14
|
-
#include <unordered_map>
|
|
15
|
-
#include <yoga/YGEnums.h>
|
|
16
|
-
#include <yoga/YGValue.h>
|
|
17
|
-
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
18
|
-
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
19
|
-
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
20
|
-
|
|
21
|
-
namespace facebook::react {
|
|
22
|
-
class PasteTextInputComponentDescriptor final
|
|
23
|
-
: public ConcreteComponentDescriptor<PasteTextInputShadowNode> {
|
|
24
|
-
public:
|
|
25
|
-
PasteTextInputComponentDescriptor(
|
|
26
|
-
const ComponentDescriptorParameters& parameters)
|
|
27
|
-
: ConcreteComponentDescriptor<PasteTextInputShadowNode>(parameters),
|
|
28
|
-
textLayoutManager_(
|
|
29
|
-
std::make_shared<TextLayoutManager>(contextContainer_)) {}
|
|
30
|
-
|
|
31
|
-
virtual State::Shared createInitialState(
|
|
32
|
-
const Props::Shared& props,
|
|
33
|
-
const ShadowNodeFamily::Shared& family) const override {
|
|
34
|
-
int surfaceId = family->getSurfaceId();
|
|
35
|
-
|
|
36
|
-
ThemePadding theme;
|
|
37
|
-
// TODO: figure out RTL/start/end/left/right stuff here
|
|
38
|
-
if (surfaceIdToThemePaddingMap_.find(surfaceId) !=
|
|
39
|
-
surfaceIdToThemePaddingMap_.end()) {
|
|
40
|
-
theme = surfaceIdToThemePaddingMap_[surfaceId];
|
|
41
|
-
} else {
|
|
42
|
-
const jni::global_ref<jobject>& fabricUIManager =
|
|
43
|
-
contextContainer_->at<jni::global_ref<jobject>>("FabricUIManager");
|
|
44
|
-
|
|
45
|
-
auto env = jni::Environment::current();
|
|
46
|
-
auto defaultTextInputPaddingArray = env->NewFloatArray(4);
|
|
47
|
-
static auto getThemeData =
|
|
48
|
-
jni::findClassStatic(UIManagerJavaDescriptor)
|
|
49
|
-
->getMethod<jboolean(jint, jfloatArray)>("getThemeData");
|
|
50
|
-
|
|
51
|
-
if (getThemeData(
|
|
52
|
-
fabricUIManager, surfaceId, defaultTextInputPaddingArray)) {
|
|
53
|
-
jfloat* defaultTextInputPadding =
|
|
54
|
-
env->GetFloatArrayElements(defaultTextInputPaddingArray, 0);
|
|
55
|
-
theme.start = defaultTextInputPadding[0];
|
|
56
|
-
theme.end = defaultTextInputPadding[1];
|
|
57
|
-
theme.top = defaultTextInputPadding[2];
|
|
58
|
-
theme.bottom = defaultTextInputPadding[3];
|
|
59
|
-
surfaceIdToThemePaddingMap_.emplace(std::make_pair(surfaceId, theme));
|
|
60
|
-
env->ReleaseFloatArrayElements(
|
|
61
|
-
defaultTextInputPaddingArray, defaultTextInputPadding, JNI_ABORT);
|
|
62
|
-
}
|
|
63
|
-
env->DeleteLocalRef(defaultTextInputPaddingArray);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return std::make_shared<PasteTextInputShadowNode::ConcreteState>(
|
|
67
|
-
std::make_shared<const TextInputState>(TextInputState({}, {}, {}, 0)),
|
|
68
|
-
family);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
protected:
|
|
72
|
-
void adopt(ShadowNode& shadowNode) const override {
|
|
73
|
-
auto& textInputShadowNode =
|
|
74
|
-
static_cast<PasteTextInputShadowNode&>(shadowNode);
|
|
75
|
-
|
|
76
|
-
// `TextInputShadowNode` uses `TextLayoutManager` to measure text content
|
|
77
|
-
// and communicate text rendering metrics to mounting layer.
|
|
78
|
-
textInputShadowNode.setTextLayoutManager(textLayoutManager_);
|
|
79
|
-
|
|
80
|
-
int surfaceId = textInputShadowNode.getSurfaceId();
|
|
81
|
-
if (surfaceIdToThemePaddingMap_.find(surfaceId) !=
|
|
82
|
-
surfaceIdToThemePaddingMap_.end()) {
|
|
83
|
-
const auto& theme = surfaceIdToThemePaddingMap_[surfaceId];
|
|
84
|
-
|
|
85
|
-
auto& textInputProps = textInputShadowNode.getConcreteProps();
|
|
86
|
-
|
|
87
|
-
// Override padding
|
|
88
|
-
// Node is still unsealed during adoption, before layout is complete
|
|
89
|
-
// TODO: T62959168 account for RTL and paddingLeft when setting default
|
|
90
|
-
// paddingStart, and vice-versa with paddingRight/paddingEnd.
|
|
91
|
-
// For now this assumes no RTL.
|
|
92
|
-
auto& style = const_cast<yoga::Style&>(textInputProps.yogaStyle);
|
|
93
|
-
bool changedPadding = false;
|
|
94
|
-
if (!textInputProps.hasPadding && !textInputProps.hasPaddingStart &&
|
|
95
|
-
!textInputProps.hasPaddingLeft &&
|
|
96
|
-
!textInputProps.hasPaddingHorizontal) {
|
|
97
|
-
changedPadding = true;
|
|
98
|
-
style.setPadding(
|
|
99
|
-
yoga::Edge::Start, yoga::StyleLength::points(theme.start));
|
|
100
|
-
}
|
|
101
|
-
if (!textInputProps.hasPadding && !textInputProps.hasPaddingEnd &&
|
|
102
|
-
!textInputProps.hasPaddingRight &&
|
|
103
|
-
!textInputProps.hasPaddingHorizontal) {
|
|
104
|
-
changedPadding = true;
|
|
105
|
-
style.setPadding(yoga::Edge::End, yoga::StyleLength::points(theme.end));
|
|
106
|
-
}
|
|
107
|
-
if (!textInputProps.hasPadding && !textInputProps.hasPaddingTop &&
|
|
108
|
-
!textInputProps.hasPaddingVertical) {
|
|
109
|
-
changedPadding = true;
|
|
110
|
-
style.setPadding(yoga::Edge::Top, yoga::StyleLength::points(theme.top));
|
|
111
|
-
}
|
|
112
|
-
if (!textInputProps.hasPadding && !textInputProps.hasPaddingBottom &&
|
|
113
|
-
!textInputProps.hasPaddingVertical) {
|
|
114
|
-
changedPadding = true;
|
|
115
|
-
style.setPadding(
|
|
116
|
-
yoga::Edge::Bottom, yoga::StyleLength::points(theme.bottom));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// If the TextInput initially does not have paddingLeft or paddingStart, a
|
|
120
|
-
// paddingStart may be set from the theme. If that happens, when there's a
|
|
121
|
-
// paddingLeft update, we must explicitly unset paddingStart... (same with
|
|
122
|
-
// paddingEnd)
|
|
123
|
-
// TODO: support RTL
|
|
124
|
-
if ((textInputProps.hasPadding || textInputProps.hasPaddingLeft ||
|
|
125
|
-
textInputProps.hasPaddingHorizontal) &&
|
|
126
|
-
!textInputProps.hasPaddingStart) {
|
|
127
|
-
style.setPadding(yoga::Edge::Start, yoga::StyleLength::undefined());
|
|
128
|
-
}
|
|
129
|
-
if ((textInputProps.hasPadding || textInputProps.hasPaddingRight ||
|
|
130
|
-
textInputProps.hasPaddingHorizontal) &&
|
|
131
|
-
!textInputProps.hasPaddingEnd) {
|
|
132
|
-
style.setPadding(yoga::Edge::End, yoga::StyleLength::undefined());
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Note that this is expensive: on every adopt, we need to set the Yoga
|
|
136
|
-
// props again, which normally only happens during prop parsing. Every
|
|
137
|
-
// commit, state update, etc, will incur this cost.
|
|
138
|
-
if (changedPadding) {
|
|
139
|
-
// Communicate new props to Yoga part of the node
|
|
140
|
-
textInputShadowNode.updateYogaProps();
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
textInputShadowNode.dirtyLayout();
|
|
145
|
-
|
|
146
|
-
ConcreteComponentDescriptor::adopt(shadowNode);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
private:
|
|
150
|
-
struct ThemePadding {
|
|
151
|
-
float start{};
|
|
152
|
-
float end{};
|
|
153
|
-
float top{};
|
|
154
|
-
float bottom{};
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
// TODO T68526882: Unify with Binding::UIManagerJavaDescriptor
|
|
158
|
-
constexpr static auto UIManagerJavaDescriptor =
|
|
159
|
-
"com/facebook/react/fabric/FabricUIManager";
|
|
160
|
-
|
|
161
|
-
const std::shared_ptr<TextLayoutManager> textLayoutManager_;
|
|
162
|
-
mutable std::unordered_map<int, ThemePadding> surfaceIdToThemePaddingMap_;
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
} // namespace facebook::react
|