@dongsuo/react-native-uitextview 1.0.3 → 1.0.4

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.
@@ -192,16 +192,28 @@ static inline NSString *_Nullable RNStringFromStdString(const std::string &value
192
192
  }
193
193
  if (newViewProps.customMenuItems.size() > 0) {
194
194
  NSMutableArray<NSDictionary *> *items = [NSMutableArray array];
195
- for (const auto &item : newViewProps.customMenuItems) {
196
- NSString *title = RNStringFromStdString(item.title);
197
- NSString *actionId = RNStringFromStdString(item.actionId);
198
-
199
- if (title.length == 0 || actionId.length == 0) {
200
- NSLog(@"[RNUITextView] Skipping invalid custom menu item (title length: %lu, actionId length: %lu)", (unsigned long)title.length, (unsigned long)actionId.length);
201
- continue;
195
+ try {
196
+ for (const auto &item : newViewProps.customMenuItems) {
197
+ try {
198
+ NSString *title = RNStringFromStdString(item.title);
199
+ NSString *actionId = RNStringFromStdString(item.actionId);
200
+
201
+ if (title.length == 0 || actionId.length == 0) {
202
+ NSLog(@"[RNUITextView] Skipping invalid custom menu item (title length: %lu, actionId length: %lu)", (unsigned long)title.length, (unsigned long)actionId.length);
203
+ continue;
204
+ }
205
+
206
+ [items addObject:@{ @"title": title, @"actionId": actionId }];
207
+ } catch (const std::exception &e) {
208
+ NSLog(@"[RNUITextView] C++ exception processing custom menu item: %s", e.what());
209
+ } catch (...) {
210
+ NSLog(@"[RNUITextView] Unknown exception processing custom menu item");
211
+ }
202
212
  }
203
-
204
- [items addObject:@{ @"title": title, @"actionId": actionId }];
213
+ } catch (const std::exception &e) {
214
+ NSLog(@"[RNUITextView] C++ exception iterating custom menu items: %s", e.what());
215
+ } catch (...) {
216
+ NSLog(@"[RNUITextView] Unknown exception iterating custom menu items");
205
217
  }
206
218
 
207
219
  self.customMenuItems = items.count > 0 ? items : nil;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dongsuo/react-native-uitextview",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Enhanced UITextView for React Native with custom context menu support",
5
5
  "repository": {
6
6
  "type": "git",