expo-rich-input 0.1.1 → 0.1.2
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.
|
@@ -51,7 +51,7 @@ class RichInputView(context: Context, appContext: AppContext) : ExpoView(context
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
action?.let {
|
|
54
|
-
|
|
54
|
+
sendEvent("onKeyboardAction", mapOf("action" to it))
|
|
55
55
|
return true
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -73,10 +73,11 @@ class RichInputView(context: Context, appContext: AppContext) : ExpoView(context
|
|
|
73
73
|
|
|
74
74
|
// 🔥 Core Input Engine
|
|
75
75
|
inner class EditorInputConnection(view: View) : BaseInputConnection(view, false) {
|
|
76
|
+
|
|
76
77
|
override fun commitText(text: CharSequence?, newCursorPosition: Int): Boolean {
|
|
77
78
|
val str = text?.toString() ?: return false
|
|
78
79
|
|
|
79
|
-
|
|
80
|
+
sendEvent("onEditEvent", mapOf(
|
|
80
81
|
"type" to "insert",
|
|
81
82
|
"text" to str,
|
|
82
83
|
"cursor" to cursorPosition
|
|
@@ -92,7 +93,7 @@ class RichInputView(context: Context, appContext: AppContext) : ExpoView(context
|
|
|
92
93
|
override fun setComposingText(text: CharSequence?, newCursorPosition: Int): Boolean {
|
|
93
94
|
val str = text?.toString() ?: ""
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
sendEvent("onEditEvent", mapOf(
|
|
96
97
|
"type" to "compose",
|
|
97
98
|
"text" to str,
|
|
98
99
|
"cursor" to cursorPosition
|
|
@@ -102,7 +103,7 @@ class RichInputView(context: Context, appContext: AppContext) : ExpoView(context
|
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
override fun finishComposingText(): Boolean {
|
|
105
|
-
|
|
106
|
+
sendEvent("onEditEvent", mapOf(
|
|
106
107
|
"type" to "composeCommit",
|
|
107
108
|
"cursor" to cursorPosition
|
|
108
109
|
))
|
|
@@ -113,7 +114,7 @@ class RichInputView(context: Context, appContext: AppContext) : ExpoView(context
|
|
|
113
114
|
if (beforeLength > 0) {
|
|
114
115
|
val deleteCount = minOf(beforeLength, cursorPosition)
|
|
115
116
|
|
|
116
|
-
|
|
117
|
+
sendEvent("onEditEvent", mapOf(
|
|
117
118
|
"type" to "delete",
|
|
118
119
|
"count" to deleteCount,
|
|
119
120
|
"cursor" to cursorPosition
|
|
@@ -131,7 +132,7 @@ class RichInputView(context: Context, appContext: AppContext) : ExpoView(context
|
|
|
131
132
|
selectionEnd = end
|
|
132
133
|
cursorPosition = end
|
|
133
134
|
|
|
134
|
-
|
|
135
|
+
sendEvent("onSelectionChange", mapOf(
|
|
135
136
|
"start" to start,
|
|
136
137
|
"end" to end
|
|
137
138
|
))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-rich-input",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A native Expo module that replaces `TextInput` entirely, giving the editor raw OS-level edit deltas — insert, delete, and IME compose events — directly from `UIKeyInput` on iOS and `InputConnection` on Android, so the Rope never has to diff a full string.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|