@tbvjaos510/react-native-paste-input 0.9.2 → 0.9.5
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/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 +11 -3
- package/ios/PasteTextInputManager.mm +20 -95
- package/lib/commonjs/PasteTextInputNativeComponent.js +33 -0
- package/lib/commonjs/PasteTextInputNativeComponent.js.map +1 -0
- package/lib/module/PasteTextInputNativeComponent.js +31 -0
- package/lib/module/PasteTextInputNativeComponent.js.map +1 -0
- package/lib/typescript/PasteTextInput.d.ts.map +1 -0
- package/lib/typescript/{src/PasteTextInputNativeComponent.d.ts → PasteTextInputNativeComponent.d.ts} +2 -1
- package/lib/typescript/PasteTextInputNativeComponent.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 +4 -16
- package/react-native-paste-input.podspec +12 -4
- package/react-native.config.js +5 -1
- package/src/PasteTextInputNativeComponent.ts +34 -6
- 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/module/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/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/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
|
package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/EventEmitters.cpp
DELETED
|
@@ -1,183 +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: GenerateEventEmitterCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include "EventEmitters.h"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
namespace facebook::react {
|
|
15
|
-
|
|
16
|
-
void PasteTextInputEventEmitter::onBlur(OnBlur $event) const {
|
|
17
|
-
dispatchEvent("blur", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
18
|
-
auto $payload = jsi::Object(runtime);
|
|
19
|
-
$payload.setProperty(runtime, "target", $event.target);
|
|
20
|
-
return $payload;
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
void PasteTextInputEventEmitter::onChange(OnChange $event) const {
|
|
26
|
-
dispatchEvent("change", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
27
|
-
auto $payload = jsi::Object(runtime);
|
|
28
|
-
$payload.setProperty(runtime, "target", $event.target);
|
|
29
|
-
$payload.setProperty(runtime, "eventCount", $event.eventCount);
|
|
30
|
-
$payload.setProperty(runtime, "text", $event.text);
|
|
31
|
-
return $payload;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
void PasteTextInputEventEmitter::onChangeText(OnChangeText $event) const {
|
|
37
|
-
dispatchEvent("changeText", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
38
|
-
auto $payload = jsi::Object(runtime);
|
|
39
|
-
$payload.setProperty(runtime, "target", $event.target);
|
|
40
|
-
$payload.setProperty(runtime, "eventCount", $event.eventCount);
|
|
41
|
-
$payload.setProperty(runtime, "text", $event.text);
|
|
42
|
-
return $payload;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
void PasteTextInputEventEmitter::onEndEditing(OnEndEditing $event) const {
|
|
48
|
-
dispatchEvent("endEditing", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
49
|
-
auto $payload = jsi::Object(runtime);
|
|
50
|
-
$payload.setProperty(runtime, "target", $event.target);
|
|
51
|
-
$payload.setProperty(runtime, "text", $event.text);
|
|
52
|
-
return $payload;
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
void PasteTextInputEventEmitter::onFocus(OnFocus $event) const {
|
|
58
|
-
dispatchEvent("focus", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
59
|
-
auto $payload = jsi::Object(runtime);
|
|
60
|
-
$payload.setProperty(runtime, "target", $event.target);
|
|
61
|
-
return $payload;
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
void PasteTextInputEventEmitter::onKeyPress(OnKeyPress $event) const {
|
|
67
|
-
dispatchEvent("keyPress", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
68
|
-
auto $payload = jsi::Object(runtime);
|
|
69
|
-
$payload.setProperty(runtime, "target", $event.target);
|
|
70
|
-
$payload.setProperty(runtime, "key", $event.key);
|
|
71
|
-
return $payload;
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
void PasteTextInputEventEmitter::onPaste(OnPaste $event) const {
|
|
77
|
-
dispatchEvent("paste", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
78
|
-
auto $payload = jsi::Object(runtime);
|
|
79
|
-
|
|
80
|
-
auto data = jsi::Array(runtime, $event.data.size());
|
|
81
|
-
size_t dataIndex = 0;
|
|
82
|
-
for (auto dataValue : $event.data) {
|
|
83
|
-
auto dataObject = jsi::Object(runtime);
|
|
84
|
-
dataObject.setProperty(runtime, "fileName", dataValue.fileName);
|
|
85
|
-
dataObject.setProperty(runtime, "fileSize", dataValue.fileSize);
|
|
86
|
-
dataObject.setProperty(runtime, "type", dataValue.type);
|
|
87
|
-
dataObject.setProperty(runtime, "uri", dataValue.uri);
|
|
88
|
-
data.setValueAtIndex(runtime, dataIndex++, dataObject);
|
|
89
|
-
}
|
|
90
|
-
$payload.setProperty(runtime, "data", data);
|
|
91
|
-
|
|
92
|
-
{
|
|
93
|
-
auto error = jsi::Object(runtime);
|
|
94
|
-
error.setProperty(runtime, "message", $event.error.message);
|
|
95
|
-
$payload.setProperty(runtime, "error", error);
|
|
96
|
-
}
|
|
97
|
-
return $payload;
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
void PasteTextInputEventEmitter::onSubmitEdition(OnSubmitEdition $event) const {
|
|
103
|
-
dispatchEvent("submitEdition", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
104
|
-
auto $payload = jsi::Object(runtime);
|
|
105
|
-
$payload.setProperty(runtime, "target", $event.target);
|
|
106
|
-
$payload.setProperty(runtime, "text", $event.text);
|
|
107
|
-
return $payload;
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
void PasteTextInputEventEmitter::onContentSizeChange(OnContentSizeChange $event) const {
|
|
113
|
-
dispatchEvent("contentSizeChange", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
114
|
-
auto $payload = jsi::Object(runtime);
|
|
115
|
-
$payload.setProperty(runtime, "target", $event.target);
|
|
116
|
-
{
|
|
117
|
-
auto contentSize = jsi::Object(runtime);
|
|
118
|
-
contentSize.setProperty(runtime, "width", $event.contentSize.width);
|
|
119
|
-
contentSize.setProperty(runtime, "height", $event.contentSize.height);
|
|
120
|
-
$payload.setProperty(runtime, "contentSize", contentSize);
|
|
121
|
-
}
|
|
122
|
-
return $payload;
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
void PasteTextInputEventEmitter::onScroll(OnScroll $event) const {
|
|
128
|
-
dispatchEvent("scroll", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
129
|
-
auto $payload = jsi::Object(runtime);
|
|
130
|
-
$payload.setProperty(runtime, "target", $event.target);
|
|
131
|
-
{
|
|
132
|
-
auto contentInset = jsi::Object(runtime);
|
|
133
|
-
contentInset.setProperty(runtime, "top", $event.contentInset.top);
|
|
134
|
-
contentInset.setProperty(runtime, "bottom", $event.contentInset.bottom);
|
|
135
|
-
contentInset.setProperty(runtime, "left", $event.contentInset.left);
|
|
136
|
-
contentInset.setProperty(runtime, "right", $event.contentInset.right);
|
|
137
|
-
$payload.setProperty(runtime, "contentInset", contentInset);
|
|
138
|
-
}
|
|
139
|
-
{
|
|
140
|
-
auto contentOffset = jsi::Object(runtime);
|
|
141
|
-
contentOffset.setProperty(runtime, "x", $event.contentOffset.x);
|
|
142
|
-
contentOffset.setProperty(runtime, "y", $event.contentOffset.y);
|
|
143
|
-
$payload.setProperty(runtime, "contentOffset", contentOffset);
|
|
144
|
-
}
|
|
145
|
-
{
|
|
146
|
-
auto contentSize = jsi::Object(runtime);
|
|
147
|
-
contentSize.setProperty(runtime, "width", $event.contentSize.width);
|
|
148
|
-
contentSize.setProperty(runtime, "height", $event.contentSize.height);
|
|
149
|
-
$payload.setProperty(runtime, "contentSize", contentSize);
|
|
150
|
-
}
|
|
151
|
-
{
|
|
152
|
-
auto layoutMeasurement = jsi::Object(runtime);
|
|
153
|
-
layoutMeasurement.setProperty(runtime, "width", $event.layoutMeasurement.width);
|
|
154
|
-
layoutMeasurement.setProperty(runtime, "height", $event.layoutMeasurement.height);
|
|
155
|
-
$payload.setProperty(runtime, "layoutMeasurement", layoutMeasurement);
|
|
156
|
-
}
|
|
157
|
-
$payload.setProperty(runtime, "responderIgnoreScroll", $event.responderIgnoreScroll);
|
|
158
|
-
{
|
|
159
|
-
auto velocity = jsi::Object(runtime);
|
|
160
|
-
velocity.setProperty(runtime, "x", $event.velocity.x);
|
|
161
|
-
velocity.setProperty(runtime, "y", $event.velocity.y);
|
|
162
|
-
$payload.setProperty(runtime, "velocity", velocity);
|
|
163
|
-
}
|
|
164
|
-
return $payload;
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
void PasteTextInputEventEmitter::onSelectionChange(OnSelectionChange $event) const {
|
|
170
|
-
dispatchEvent("selectionChange", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
171
|
-
auto $payload = jsi::Object(runtime);
|
|
172
|
-
$payload.setProperty(runtime, "target", $event.target);
|
|
173
|
-
{
|
|
174
|
-
auto selection = jsi::Object(runtime);
|
|
175
|
-
selection.setProperty(runtime, "start", $event.selection.start);
|
|
176
|
-
selection.setProperty(runtime, "end", $event.selection.end);
|
|
177
|
-
$payload.setProperty(runtime, "selection", selection);
|
|
178
|
-
}
|
|
179
|
-
return $payload;
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
} // namespace facebook::react
|
|
@@ -1,148 +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: GenerateEventEmitterH.js
|
|
9
|
-
*/
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
-
|
|
14
|
-
namespace facebook::react {
|
|
15
|
-
class PasteTextInputEventEmitter : public ViewEventEmitter {
|
|
16
|
-
public:
|
|
17
|
-
using ViewEventEmitter::ViewEventEmitter;
|
|
18
|
-
|
|
19
|
-
struct OnBlur {
|
|
20
|
-
int target;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
struct OnChange {
|
|
24
|
-
int target;
|
|
25
|
-
int eventCount;
|
|
26
|
-
std::string text;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
struct OnChangeText {
|
|
30
|
-
int target;
|
|
31
|
-
int eventCount;
|
|
32
|
-
std::string text;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
struct OnEndEditing {
|
|
36
|
-
int target;
|
|
37
|
-
std::string text;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
struct OnFocus {
|
|
41
|
-
int target;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
struct OnKeyPress {
|
|
45
|
-
int target;
|
|
46
|
-
std::string key;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
struct OnPasteData {
|
|
50
|
-
std::string fileName;
|
|
51
|
-
int fileSize;
|
|
52
|
-
std::string type;
|
|
53
|
-
std::string uri;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
struct OnPasteError {
|
|
57
|
-
std::string message;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
struct OnPaste {
|
|
61
|
-
std::vector<OnPasteData> data;
|
|
62
|
-
OnPasteError error;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
struct OnSubmitEdition {
|
|
66
|
-
int target;
|
|
67
|
-
std::string text;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
struct OnContentSizeChangeContentSize {
|
|
71
|
-
int width;
|
|
72
|
-
int height;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
struct OnContentSizeChange {
|
|
76
|
-
int target;
|
|
77
|
-
OnContentSizeChangeContentSize contentSize;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
struct OnScrollContentInset {
|
|
81
|
-
double top;
|
|
82
|
-
double bottom;
|
|
83
|
-
double left;
|
|
84
|
-
double right;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
struct OnScrollContentOffset {
|
|
88
|
-
double x;
|
|
89
|
-
double y;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
struct OnScrollContentSize {
|
|
93
|
-
double width;
|
|
94
|
-
double height;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
struct OnScrollLayoutMeasurement {
|
|
98
|
-
double width;
|
|
99
|
-
double height;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
struct OnScrollVelocity {
|
|
103
|
-
double x;
|
|
104
|
-
double y;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
struct OnScroll {
|
|
108
|
-
int target;
|
|
109
|
-
OnScrollContentInset contentInset;
|
|
110
|
-
OnScrollContentOffset contentOffset;
|
|
111
|
-
OnScrollContentSize contentSize;
|
|
112
|
-
OnScrollLayoutMeasurement layoutMeasurement;
|
|
113
|
-
bool responderIgnoreScroll;
|
|
114
|
-
OnScrollVelocity velocity;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
struct OnSelectionChangeSelection {
|
|
118
|
-
int start;
|
|
119
|
-
int end;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
struct OnSelectionChange {
|
|
123
|
-
int target;
|
|
124
|
-
OnSelectionChangeSelection selection;
|
|
125
|
-
};
|
|
126
|
-
void onBlur(OnBlur value) const;
|
|
127
|
-
|
|
128
|
-
void onChange(OnChange value) const;
|
|
129
|
-
|
|
130
|
-
void onChangeText(OnChangeText value) const;
|
|
131
|
-
|
|
132
|
-
void onEndEditing(OnEndEditing value) const;
|
|
133
|
-
|
|
134
|
-
void onFocus(OnFocus value) const;
|
|
135
|
-
|
|
136
|
-
void onKeyPress(OnKeyPress value) const;
|
|
137
|
-
|
|
138
|
-
void onPaste(OnPaste value) const;
|
|
139
|
-
|
|
140
|
-
void onSubmitEdition(OnSubmitEdition value) const;
|
|
141
|
-
|
|
142
|
-
void onContentSizeChange(OnContentSizeChange value) const;
|
|
143
|
-
|
|
144
|
-
void onScroll(OnScroll value) const;
|
|
145
|
-
|
|
146
|
-
void onSelectionChange(OnSelectionChange value) const;
|
|
147
|
-
};
|
|
148
|
-
} // namespace facebook::react
|
|
@@ -1,17 +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: GenerateModuleCpp.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#include "PasteTextInputSpecsJSI.h"
|
|
11
|
-
|
|
12
|
-
namespace facebook::react {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} // namespace facebook::react
|
package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/PasteTextInputSpecsJSI.h
DELETED
|
@@ -1,19 +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: 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
|