react-native-enriched 0.0.0 → 0.1.1

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.
Files changed (169) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +875 -0
  3. package/ReactNativeEnriched.podspec +27 -0
  4. package/android/build.gradle +101 -0
  5. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedTextInputViewManagerDelegate.java +146 -0
  6. package/android/generated/java/com/facebook/react/viewmanagers/EnrichedTextInputViewManagerInterface.java +55 -0
  7. package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/ComponentDescriptors.cpp +22 -0
  8. package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/ComponentDescriptors.h +24 -0
  9. package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/EventEmitters.cpp +118 -0
  10. package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/EventEmitters.h +95 -0
  11. package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/Props.cpp +128 -0
  12. package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/Props.h +577 -0
  13. package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/ShadowNodes.cpp +17 -0
  14. package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/ShadowNodes.h +23 -0
  15. package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/States.cpp +16 -0
  16. package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/States.h +20 -0
  17. package/android/gradle.properties +5 -0
  18. package/android/src/main/AndroidManifest.xml +3 -0
  19. package/android/src/main/AndroidManifestNew.xml +2 -0
  20. package/android/src/main/java/com/swmansion/enriched/EnrichedTextInputView.kt +535 -0
  21. package/android/src/main/java/com/swmansion/enriched/EnrichedTextInputViewLayoutManager.kt +64 -0
  22. package/android/src/main/java/com/swmansion/enriched/EnrichedTextInputViewManager.kt +292 -0
  23. package/android/src/main/java/com/swmansion/enriched/EnrichedTextInputViewPackage.kt +19 -0
  24. package/android/src/main/java/com/swmansion/enriched/events/MentionHandler.kt +40 -0
  25. package/android/src/main/java/com/swmansion/enriched/events/OnChangeHtmlEvent.kt +28 -0
  26. package/android/src/main/java/com/swmansion/enriched/events/OnChangeSelectionEvent.kt +29 -0
  27. package/android/src/main/java/com/swmansion/enriched/events/OnChangeStateEvent.kt +24 -0
  28. package/android/src/main/java/com/swmansion/enriched/events/OnChangeTextEvent.kt +30 -0
  29. package/android/src/main/java/com/swmansion/enriched/events/OnInputBlurEvent.kt +27 -0
  30. package/android/src/main/java/com/swmansion/enriched/events/OnInputFocusEvent.kt +27 -0
  31. package/android/src/main/java/com/swmansion/enriched/events/OnLinkDetectedEvent.kt +30 -0
  32. package/android/src/main/java/com/swmansion/enriched/events/OnMentionDetectedEvent.kt +29 -0
  33. package/android/src/main/java/com/swmansion/enriched/events/OnMentionEvent.kt +33 -0
  34. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedBlockQuoteSpan.kt +34 -0
  35. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedBoldSpan.kt +10 -0
  36. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedCodeBlockSpan.kt +38 -0
  37. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedH1Span.kt +17 -0
  38. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedH2Span.kt +17 -0
  39. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedH3Span.kt +17 -0
  40. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedImageSpan.kt +41 -0
  41. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedInlineCodeSpan.kt +16 -0
  42. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedItalicSpan.kt +10 -0
  43. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedLinkSpan.kt +24 -0
  44. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedMentionSpan.kt +36 -0
  45. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedOrderedListSpan.kt +71 -0
  46. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedSpans.kt +111 -0
  47. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedStrikeThroughSpan.kt +9 -0
  48. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedUnderlineSpan.kt +9 -0
  49. package/android/src/main/java/com/swmansion/enriched/spans/EnrichedUnorderedListSpan.kt +49 -0
  50. package/android/src/main/java/com/swmansion/enriched/spans/interfaces/EnrichedBlockSpan.kt +4 -0
  51. package/android/src/main/java/com/swmansion/enriched/spans/interfaces/EnrichedHeadingSpan.kt +4 -0
  52. package/android/src/main/java/com/swmansion/enriched/spans/interfaces/EnrichedInlineSpan.kt +4 -0
  53. package/android/src/main/java/com/swmansion/enriched/spans/interfaces/EnrichedParagraphSpan.kt +4 -0
  54. package/android/src/main/java/com/swmansion/enriched/spans/interfaces/EnrichedSpan.kt +4 -0
  55. package/android/src/main/java/com/swmansion/enriched/spans/interfaces/EnrichedZeroWidthSpaceSpan.kt +5 -0
  56. package/android/src/main/java/com/swmansion/enriched/styles/HtmlStyle.kt +227 -0
  57. package/android/src/main/java/com/swmansion/enriched/styles/InlineStyles.kt +146 -0
  58. package/android/src/main/java/com/swmansion/enriched/styles/ListStyles.kt +173 -0
  59. package/android/src/main/java/com/swmansion/enriched/styles/ParagraphStyles.kt +186 -0
  60. package/android/src/main/java/com/swmansion/enriched/styles/ParametrizedStyles.kt +223 -0
  61. package/android/src/main/java/com/swmansion/enriched/utils/EnrichedParser.java +857 -0
  62. package/android/src/main/java/com/swmansion/enriched/utils/EnrichedSelection.kt +285 -0
  63. package/android/src/main/java/com/swmansion/enriched/utils/EnrichedSpanState.kt +204 -0
  64. package/android/src/main/java/com/swmansion/enriched/utils/Utils.kt +91 -0
  65. package/android/src/main/java/com/swmansion/enriched/watchers/EnrichedSpanWatcher.kt +73 -0
  66. package/android/src/main/java/com/swmansion/enriched/watchers/EnrichedTextWatcher.kt +51 -0
  67. package/android/src/main/new_arch/CMakeLists.txt +56 -0
  68. package/android/src/main/new_arch/RNEnrichedTextInputViewSpec.cpp +22 -0
  69. package/android/src/main/new_arch/RNEnrichedTextInputViewSpec.h +26 -0
  70. package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputComponentDescriptor.h +35 -0
  71. package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputMeasurementManager.cpp +51 -0
  72. package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputMeasurementManager.h +26 -0
  73. package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputShadowNode.cpp +34 -0
  74. package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputShadowNode.h +54 -0
  75. package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputState.cpp +9 -0
  76. package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputState.h +25 -0
  77. package/ios/EnrichedTextInputView.h +33 -0
  78. package/ios/EnrichedTextInputView.mm +1190 -0
  79. package/ios/EnrichedTextInputViewManager.mm +13 -0
  80. package/ios/config/InputConfig.h +67 -0
  81. package/ios/config/InputConfig.mm +382 -0
  82. package/ios/generated/RNEnrichedTextInputViewSpec/ComponentDescriptors.cpp +22 -0
  83. package/ios/generated/RNEnrichedTextInputViewSpec/ComponentDescriptors.h +24 -0
  84. package/ios/generated/RNEnrichedTextInputViewSpec/EventEmitters.cpp +118 -0
  85. package/ios/generated/RNEnrichedTextInputViewSpec/EventEmitters.h +95 -0
  86. package/ios/generated/RNEnrichedTextInputViewSpec/Props.cpp +128 -0
  87. package/ios/generated/RNEnrichedTextInputViewSpec/Props.h +577 -0
  88. package/ios/generated/RNEnrichedTextInputViewSpec/RCTComponentViewHelpers.h +384 -0
  89. package/ios/generated/RNEnrichedTextInputViewSpec/ShadowNodes.cpp +17 -0
  90. package/ios/generated/RNEnrichedTextInputViewSpec/ShadowNodes.h +23 -0
  91. package/ios/generated/RNEnrichedTextInputViewSpec/States.cpp +16 -0
  92. package/ios/generated/RNEnrichedTextInputViewSpec/States.h +20 -0
  93. package/ios/inputParser/InputParser.h +11 -0
  94. package/ios/inputParser/InputParser.mm +659 -0
  95. package/ios/inputTextView/InputTextView.h +6 -0
  96. package/ios/inputTextView/InputTextView.mm +115 -0
  97. package/ios/internals/EnrichedTextInputViewComponentDescriptor.h +17 -0
  98. package/ios/internals/EnrichedTextInputViewShadowNode.h +40 -0
  99. package/ios/internals/EnrichedTextInputViewShadowNode.mm +83 -0
  100. package/ios/internals/EnrichedTextInputViewState.cpp +10 -0
  101. package/ios/internals/EnrichedTextInputViewState.h +20 -0
  102. package/ios/styles/BlockQuoteStyle.mm +248 -0
  103. package/ios/styles/BoldStyle.mm +122 -0
  104. package/ios/styles/H1Style.mm +10 -0
  105. package/ios/styles/H2Style.mm +10 -0
  106. package/ios/styles/H3Style.mm +10 -0
  107. package/ios/styles/HeadingStyleBase.mm +144 -0
  108. package/ios/styles/InlineCodeStyle.mm +163 -0
  109. package/ios/styles/ItalicStyle.mm +110 -0
  110. package/ios/styles/LinkStyle.mm +463 -0
  111. package/ios/styles/MentionStyle.mm +476 -0
  112. package/ios/styles/OrderedListStyle.mm +225 -0
  113. package/ios/styles/StrikethroughStyle.mm +80 -0
  114. package/ios/styles/UnderlineStyle.mm +112 -0
  115. package/ios/styles/UnorderedListStyle.mm +225 -0
  116. package/ios/utils/BaseStyleProtocol.h +16 -0
  117. package/ios/utils/ColorExtension.h +6 -0
  118. package/ios/utils/ColorExtension.mm +27 -0
  119. package/ios/utils/FontExtension.h +13 -0
  120. package/ios/utils/FontExtension.mm +91 -0
  121. package/ios/utils/LayoutManagerExtension.h +6 -0
  122. package/ios/utils/LayoutManagerExtension.mm +171 -0
  123. package/ios/utils/LinkData.h +9 -0
  124. package/ios/utils/LinkData.mm +4 -0
  125. package/ios/utils/MentionParams.h +9 -0
  126. package/ios/utils/MentionParams.mm +4 -0
  127. package/ios/utils/MentionStyleProps.h +13 -0
  128. package/ios/utils/MentionStyleProps.mm +56 -0
  129. package/ios/utils/OccurenceUtils.h +37 -0
  130. package/ios/utils/OccurenceUtils.mm +124 -0
  131. package/ios/utils/ParagraphsUtils.h +7 -0
  132. package/ios/utils/ParagraphsUtils.mm +54 -0
  133. package/ios/utils/StringExtension.h +15 -0
  134. package/ios/utils/StringExtension.mm +57 -0
  135. package/ios/utils/StyleHeaders.h +74 -0
  136. package/ios/utils/StylePair.h +9 -0
  137. package/ios/utils/StylePair.mm +4 -0
  138. package/ios/utils/StyleTypeEnum.h +22 -0
  139. package/ios/utils/TextDecorationLineEnum.h +6 -0
  140. package/ios/utils/TextDecorationLineEnum.mm +4 -0
  141. package/ios/utils/TextInsertionUtils.h +6 -0
  142. package/ios/utils/TextInsertionUtils.mm +48 -0
  143. package/ios/utils/WordsUtils.h +6 -0
  144. package/ios/utils/WordsUtils.mm +88 -0
  145. package/ios/utils/ZeroWidthSpaceUtils.h +7 -0
  146. package/ios/utils/ZeroWidthSpaceUtils.mm +164 -0
  147. package/lib/module/EnrichedTextInput.js +191 -0
  148. package/lib/module/EnrichedTextInput.js.map +1 -0
  149. package/lib/module/EnrichedTextInputNativeComponent.ts +235 -0
  150. package/lib/module/index.js +4 -0
  151. package/lib/module/index.js.map +1 -0
  152. package/lib/module/normalizeHtmlStyle.js +141 -0
  153. package/lib/module/normalizeHtmlStyle.js.map +1 -0
  154. package/lib/module/package.json +1 -0
  155. package/lib/typescript/package.json +1 -0
  156. package/lib/typescript/src/EnrichedTextInput.d.ts +113 -0
  157. package/lib/typescript/src/EnrichedTextInput.d.ts.map +1 -0
  158. package/lib/typescript/src/EnrichedTextInputNativeComponent.d.ts +160 -0
  159. package/lib/typescript/src/EnrichedTextInputNativeComponent.d.ts.map +1 -0
  160. package/lib/typescript/src/index.d.ts +3 -0
  161. package/lib/typescript/src/index.d.ts.map +1 -0
  162. package/lib/typescript/src/normalizeHtmlStyle.d.ts +4 -0
  163. package/lib/typescript/src/normalizeHtmlStyle.d.ts.map +1 -0
  164. package/package.json +172 -1
  165. package/react-native.config.js +13 -0
  166. package/src/EnrichedTextInput.tsx +358 -0
  167. package/src/EnrichedTextInputNativeComponent.ts +235 -0
  168. package/src/index.tsx +9 -0
  169. package/src/normalizeHtmlStyle.ts +188 -0
@@ -0,0 +1,384 @@
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 RCTEnrichedTextInputViewViewProtocol <NSObject>
17
+ - (void)focus;
18
+ - (void)blur;
19
+ - (void)setValue:(NSString *)text;
20
+ - (void)toggleBold;
21
+ - (void)toggleItalic;
22
+ - (void)toggleUnderline;
23
+ - (void)toggleStrikeThrough;
24
+ - (void)toggleInlineCode;
25
+ - (void)toggleH1;
26
+ - (void)toggleH2;
27
+ - (void)toggleH3;
28
+ - (void)toggleCodeBlock;
29
+ - (void)toggleBlockQuote;
30
+ - (void)toggleOrderedList;
31
+ - (void)toggleUnorderedList;
32
+ - (void)addLink:(NSInteger)start end:(NSInteger)end text:(NSString *)text url:(NSString *)url;
33
+ - (void)addImage:(NSString *)uri;
34
+ - (void)startMention:(NSString *)indicator;
35
+ - (void)addMention:(NSString *)indicator text:(NSString *)text payload:(NSString *)payload;
36
+ @end
37
+
38
+ RCT_EXTERN inline void RCTEnrichedTextInputViewHandleCommand(
39
+ id<RCTEnrichedTextInputViewViewProtocol> componentView,
40
+ NSString const *commandName,
41
+ NSArray const *args)
42
+ {
43
+ if ([commandName isEqualToString:@"focus"]) {
44
+ #if RCT_DEBUG
45
+ if ([args count] != 0) {
46
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
47
+ return;
48
+ }
49
+ #endif
50
+
51
+
52
+
53
+ [componentView focus];
54
+ return;
55
+ }
56
+
57
+ if ([commandName isEqualToString:@"blur"]) {
58
+ #if RCT_DEBUG
59
+ if ([args count] != 0) {
60
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
61
+ return;
62
+ }
63
+ #endif
64
+
65
+
66
+
67
+ [componentView blur];
68
+ return;
69
+ }
70
+
71
+ if ([commandName isEqualToString:@"setValue"]) {
72
+ #if RCT_DEBUG
73
+ if ([args count] != 1) {
74
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 1);
75
+ return;
76
+ }
77
+ #endif
78
+
79
+ NSObject *arg0 = args[0];
80
+ #if RCT_DEBUG
81
+ if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSString class], @"string", @"EnrichedTextInputView", commandName, @"1st")) {
82
+ return;
83
+ }
84
+ #endif
85
+ NSString * text = (NSString *)arg0;
86
+
87
+ [componentView setValue:text];
88
+ return;
89
+ }
90
+
91
+ if ([commandName isEqualToString:@"toggleBold"]) {
92
+ #if RCT_DEBUG
93
+ if ([args count] != 0) {
94
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
95
+ return;
96
+ }
97
+ #endif
98
+
99
+
100
+
101
+ [componentView toggleBold];
102
+ return;
103
+ }
104
+
105
+ if ([commandName isEqualToString:@"toggleItalic"]) {
106
+ #if RCT_DEBUG
107
+ if ([args count] != 0) {
108
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
109
+ return;
110
+ }
111
+ #endif
112
+
113
+
114
+
115
+ [componentView toggleItalic];
116
+ return;
117
+ }
118
+
119
+ if ([commandName isEqualToString:@"toggleUnderline"]) {
120
+ #if RCT_DEBUG
121
+ if ([args count] != 0) {
122
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
123
+ return;
124
+ }
125
+ #endif
126
+
127
+
128
+
129
+ [componentView toggleUnderline];
130
+ return;
131
+ }
132
+
133
+ if ([commandName isEqualToString:@"toggleStrikeThrough"]) {
134
+ #if RCT_DEBUG
135
+ if ([args count] != 0) {
136
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
137
+ return;
138
+ }
139
+ #endif
140
+
141
+
142
+
143
+ [componentView toggleStrikeThrough];
144
+ return;
145
+ }
146
+
147
+ if ([commandName isEqualToString:@"toggleInlineCode"]) {
148
+ #if RCT_DEBUG
149
+ if ([args count] != 0) {
150
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
151
+ return;
152
+ }
153
+ #endif
154
+
155
+
156
+
157
+ [componentView toggleInlineCode];
158
+ return;
159
+ }
160
+
161
+ if ([commandName isEqualToString:@"toggleH1"]) {
162
+ #if RCT_DEBUG
163
+ if ([args count] != 0) {
164
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
165
+ return;
166
+ }
167
+ #endif
168
+
169
+
170
+
171
+ [componentView toggleH1];
172
+ return;
173
+ }
174
+
175
+ if ([commandName isEqualToString:@"toggleH2"]) {
176
+ #if RCT_DEBUG
177
+ if ([args count] != 0) {
178
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
179
+ return;
180
+ }
181
+ #endif
182
+
183
+
184
+
185
+ [componentView toggleH2];
186
+ return;
187
+ }
188
+
189
+ if ([commandName isEqualToString:@"toggleH3"]) {
190
+ #if RCT_DEBUG
191
+ if ([args count] != 0) {
192
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
193
+ return;
194
+ }
195
+ #endif
196
+
197
+
198
+
199
+ [componentView toggleH3];
200
+ return;
201
+ }
202
+
203
+ if ([commandName isEqualToString:@"toggleCodeBlock"]) {
204
+ #if RCT_DEBUG
205
+ if ([args count] != 0) {
206
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
207
+ return;
208
+ }
209
+ #endif
210
+
211
+
212
+
213
+ [componentView toggleCodeBlock];
214
+ return;
215
+ }
216
+
217
+ if ([commandName isEqualToString:@"toggleBlockQuote"]) {
218
+ #if RCT_DEBUG
219
+ if ([args count] != 0) {
220
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
221
+ return;
222
+ }
223
+ #endif
224
+
225
+
226
+
227
+ [componentView toggleBlockQuote];
228
+ return;
229
+ }
230
+
231
+ if ([commandName isEqualToString:@"toggleOrderedList"]) {
232
+ #if RCT_DEBUG
233
+ if ([args count] != 0) {
234
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
235
+ return;
236
+ }
237
+ #endif
238
+
239
+
240
+
241
+ [componentView toggleOrderedList];
242
+ return;
243
+ }
244
+
245
+ if ([commandName isEqualToString:@"toggleUnorderedList"]) {
246
+ #if RCT_DEBUG
247
+ if ([args count] != 0) {
248
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 0);
249
+ return;
250
+ }
251
+ #endif
252
+
253
+
254
+
255
+ [componentView toggleUnorderedList];
256
+ return;
257
+ }
258
+
259
+ if ([commandName isEqualToString:@"addLink"]) {
260
+ #if RCT_DEBUG
261
+ if ([args count] != 4) {
262
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 4);
263
+ return;
264
+ }
265
+ #endif
266
+
267
+ NSObject *arg0 = args[0];
268
+ #if RCT_DEBUG
269
+ if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSNumber class], @"number", @"EnrichedTextInputView", commandName, @"1st")) {
270
+ return;
271
+ }
272
+ #endif
273
+ NSInteger start = [(NSNumber *)arg0 intValue];
274
+
275
+ NSObject *arg1 = args[1];
276
+ #if RCT_DEBUG
277
+ if (!RCTValidateTypeOfViewCommandArgument(arg1, [NSNumber class], @"number", @"EnrichedTextInputView", commandName, @"2nd")) {
278
+ return;
279
+ }
280
+ #endif
281
+ NSInteger end = [(NSNumber *)arg1 intValue];
282
+
283
+ NSObject *arg2 = args[2];
284
+ #if RCT_DEBUG
285
+ if (!RCTValidateTypeOfViewCommandArgument(arg2, [NSString class], @"string", @"EnrichedTextInputView", commandName, @"3rd")) {
286
+ return;
287
+ }
288
+ #endif
289
+ NSString * text = (NSString *)arg2;
290
+
291
+ NSObject *arg3 = args[3];
292
+ #if RCT_DEBUG
293
+ if (!RCTValidateTypeOfViewCommandArgument(arg3, [NSString class], @"string", @"EnrichedTextInputView", commandName, @"4th")) {
294
+ return;
295
+ }
296
+ #endif
297
+ NSString * url = (NSString *)arg3;
298
+
299
+ [componentView addLink:start end:end text:text url:url];
300
+ return;
301
+ }
302
+
303
+ if ([commandName isEqualToString:@"addImage"]) {
304
+ #if RCT_DEBUG
305
+ if ([args count] != 1) {
306
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 1);
307
+ return;
308
+ }
309
+ #endif
310
+
311
+ NSObject *arg0 = args[0];
312
+ #if RCT_DEBUG
313
+ if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSString class], @"string", @"EnrichedTextInputView", commandName, @"1st")) {
314
+ return;
315
+ }
316
+ #endif
317
+ NSString * uri = (NSString *)arg0;
318
+
319
+ [componentView addImage:uri];
320
+ return;
321
+ }
322
+
323
+ if ([commandName isEqualToString:@"startMention"]) {
324
+ #if RCT_DEBUG
325
+ if ([args count] != 1) {
326
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 1);
327
+ return;
328
+ }
329
+ #endif
330
+
331
+ NSObject *arg0 = args[0];
332
+ #if RCT_DEBUG
333
+ if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSString class], @"string", @"EnrichedTextInputView", commandName, @"1st")) {
334
+ return;
335
+ }
336
+ #endif
337
+ NSString * indicator = (NSString *)arg0;
338
+
339
+ [componentView startMention:indicator];
340
+ return;
341
+ }
342
+
343
+ if ([commandName isEqualToString:@"addMention"]) {
344
+ #if RCT_DEBUG
345
+ if ([args count] != 3) {
346
+ RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"EnrichedTextInputView", commandName, (int)[args count], 3);
347
+ return;
348
+ }
349
+ #endif
350
+
351
+ NSObject *arg0 = args[0];
352
+ #if RCT_DEBUG
353
+ if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSString class], @"string", @"EnrichedTextInputView", commandName, @"1st")) {
354
+ return;
355
+ }
356
+ #endif
357
+ NSString * indicator = (NSString *)arg0;
358
+
359
+ NSObject *arg1 = args[1];
360
+ #if RCT_DEBUG
361
+ if (!RCTValidateTypeOfViewCommandArgument(arg1, [NSString class], @"string", @"EnrichedTextInputView", commandName, @"2nd")) {
362
+ return;
363
+ }
364
+ #endif
365
+ NSString * text = (NSString *)arg1;
366
+
367
+ NSObject *arg2 = args[2];
368
+ #if RCT_DEBUG
369
+ if (!RCTValidateTypeOfViewCommandArgument(arg2, [NSString class], @"string", @"EnrichedTextInputView", commandName, @"3rd")) {
370
+ return;
371
+ }
372
+ #endif
373
+ NSString * payload = (NSString *)arg2;
374
+
375
+ [componentView addMention:indicator text:text payload:payload];
376
+ return;
377
+ }
378
+
379
+ #if RCT_DEBUG
380
+ RCTLogError(@"%@ received command %@, which is not a supported command.", @"EnrichedTextInputView", commandName);
381
+ #endif
382
+ }
383
+
384
+ 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 "ShadowNodes.h"
12
+
13
+ namespace facebook::react {
14
+
15
+
16
+
17
+ } // namespace facebook::react
@@ -0,0 +1,23 @@
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 "EventEmitters.h"
14
+ #include "Props.h"
15
+ #include "States.h"
16
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
17
+ #include <jsi/jsi.h>
18
+
19
+ namespace facebook::react {
20
+
21
+
22
+
23
+ } // namespace facebook::react
@@ -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 "States.h"
11
+
12
+ namespace facebook::react {
13
+
14
+
15
+
16
+ } // 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: GenerateStateH.js
8
+ */
9
+ #pragma once
10
+
11
+ #include <react/renderer/core/StateData.h>
12
+ #ifdef RN_SERIALIZABLE_STATE
13
+ #include <folly/dynamic.h>
14
+ #endif
15
+
16
+ namespace facebook::react {
17
+
18
+
19
+
20
+ } // namespace facebook::react
@@ -0,0 +1,11 @@
1
+ #pragma once
2
+ #import <UIKit/UIKit.h>
3
+
4
+ @interface InputParser : NSObject
5
+ - (instancetype _Nonnull)initWithInput:(id _Nonnull)input;
6
+ - (NSString * _Nonnull)parseToHtmlFromRange:(NSRange)range;
7
+ - (void)replaceWholeFromHtml:(NSString * _Nonnull)html;
8
+ - (void)replaceFromHtml:(NSString * _Nonnull)html range:(NSRange)range;
9
+ - (void)insertFromHtml:(NSString * _Nonnull)html location:(NSInteger)location;
10
+ - (NSString * _Nullable)initiallyProcessHtml:(NSString * _Nonnull)html;
11
+ @end