react-native-enriched 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.
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<img src="https://github.com/user-attachments/assets/abc75d3b-495b-4a76-a72f-d87ce3ca1ff9" alt="react-native-enriched by Software Mansion" width="100%">
|
|
2
|
+
|
|
1
3
|
# react-native-enriched
|
|
2
4
|
|
|
3
5
|
`react-native-enriched` is a powerful React Native library that exposes a rich text editor component:
|
|
@@ -19,6 +21,11 @@ Built by [Software Mansion](https://swmansion.com/) and sponsored by [Filament](
|
|
|
19
21
|
|
|
20
22
|
<img width="80" height="80" alt="Filament Logo" src="https://github.com/user-attachments/assets/4103ab79-da34-4164-aa5f-dcf08815bf65" />
|
|
21
23
|
|
|
24
|
+
\
|
|
25
|
+
Since 2012 [Software Mansion](https://swmansion.com) is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues.
|
|
26
|
+
We can help you build your next dream product –
|
|
27
|
+
[Hire us](https://swmansion.com/contact/projects?utm_source=react-native-enriched&utm_medium=readme).
|
|
28
|
+
|
|
22
29
|
## Table of Contents
|
|
23
30
|
|
|
24
31
|
- [Prerequisites](#prerequisites)
|
|
@@ -119,6 +126,7 @@ const styles = StyleSheet.create({
|
|
|
119
126
|
alignItems: 'center',
|
|
120
127
|
},
|
|
121
128
|
input: {
|
|
129
|
+
width: '100%',
|
|
122
130
|
fontSize: 20,
|
|
123
131
|
padding: 10,
|
|
124
132
|
maxHeight: 200,
|
|
@@ -148,7 +148,7 @@ class ParametrizedStyles(private val view: EnrichedTextInputView) {
|
|
|
148
148
|
mentionStart = start
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
mentionHandler.onMention(indicator,
|
|
151
|
+
mentionHandler.onMention(indicator, text)
|
|
152
152
|
} else {
|
|
153
153
|
mentionHandler.endMention()
|
|
154
154
|
}
|
|
@@ -208,6 +208,11 @@ class ParametrizedStyles(private val view: EnrichedTextInputView) {
|
|
|
208
208
|
val (safeStart, safeEnd) = spannable.getSafeSpanBoundaries(start, spanEnd)
|
|
209
209
|
spannable.setSpan(span, safeStart, safeEnd, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
|
|
210
210
|
|
|
211
|
+
val hasSpaceAtTheEnd = spannable.length > safeEnd && spannable[safeEnd] == ' '
|
|
212
|
+
if (!hasSpaceAtTheEnd) {
|
|
213
|
+
spannable.insert(safeEnd, " ")
|
|
214
|
+
}
|
|
215
|
+
|
|
211
216
|
view.selection.validateStyles()
|
|
212
217
|
}
|
|
213
218
|
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
|
|
77
77
|
- (void)tryHandlingPlainTextItemsIn:(UIPasteboard *)pasteboard range:(NSRange)range input:(EnrichedTextInputView *)input {
|
|
78
78
|
NSArray *existingTypes = pasteboard.pasteboardTypes;
|
|
79
|
-
NSArray *handledTypes = @[UTTypeUTF8PlainText.identifier, UTTypePlainText.identifier];
|
|
79
|
+
NSArray *handledTypes = @[UTTypeUTF8PlainText.identifier, UTTypePlainText.identifier, UTTypeURL.identifier];
|
|
80
80
|
NSString *plainText;
|
|
81
81
|
|
|
82
82
|
for(NSString *type in handledTypes) {
|
|
@@ -90,6 +90,8 @@
|
|
|
90
90
|
plainText = [[NSString alloc]initWithData:value encoding:NSUTF8StringEncoding];
|
|
91
91
|
} else if([value isKindOfClass:[NSString class]]) {
|
|
92
92
|
plainText = (NSString *)value;
|
|
93
|
+
} else if([value isKindOfClass:[NSURL class]]) {
|
|
94
|
+
plainText = [(NSURL *)value absoluteString];
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
97
|
|