react-native 0.83.6 → 0.83.8

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 (52) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/React/Base/RCTVersion.m +1 -1
  3. package/React/CoreModules/RCTJscSafeUrl+Internal.h +23 -0
  4. package/React/CoreModules/RCTJscSafeUrl.mm +38 -0
  5. package/React/CoreModules/RCTRedBox+Internal.h +42 -0
  6. package/React/CoreModules/RCTRedBox.mm +30 -450
  7. package/React/CoreModules/RCTRedBox2AnsiParser+Internal.h +22 -0
  8. package/React/CoreModules/RCTRedBox2AnsiParser.mm +55 -0
  9. package/React/CoreModules/RCTRedBox2Controller+Internal.h +34 -0
  10. package/React/CoreModules/RCTRedBox2Controller.mm +764 -0
  11. package/React/CoreModules/RCTRedBox2ErrorParser+Internal.h +46 -0
  12. package/React/CoreModules/RCTRedBox2ErrorParser.mm +57 -0
  13. package/React/CoreModules/RCTRedBoxController+Internal.h +31 -0
  14. package/React/CoreModules/RCTRedBoxController.mm +447 -0
  15. package/React/CoreModules/RCTRedBoxHMRClient+Internal.h +26 -0
  16. package/React/CoreModules/RCTRedBoxHMRClient.mm +125 -0
  17. package/React/CoreModules/React-CoreModules.podspec +1 -0
  18. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +16 -0
  19. package/ReactAndroid/gradle.properties +1 -1
  20. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +13 -1
  21. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +21 -1
  22. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +5 -1
  23. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +5 -1
  24. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +23 -1
  25. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +5 -1
  26. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  27. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +29 -1
  28. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +7 -1
  29. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  30. package/ReactCommon/react/debug/CMakeLists.txt +2 -1
  31. package/ReactCommon/react/debug/React-debug.podspec +7 -1
  32. package/ReactCommon/react/debug/redbox/AnsiParser.cpp +139 -0
  33. package/ReactCommon/react/debug/redbox/AnsiParser.h +35 -0
  34. package/ReactCommon/react/debug/redbox/JscSafeUrl.cpp +179 -0
  35. package/ReactCommon/react/debug/redbox/JscSafeUrl.h +27 -0
  36. package/ReactCommon/react/debug/redbox/RedBoxErrorParser.cpp +171 -0
  37. package/ReactCommon/react/debug/redbox/RedBoxErrorParser.h +40 -0
  38. package/ReactCommon/react/debug/redbox/tests/AnsiParserTest.cpp +97 -0
  39. package/ReactCommon/react/debug/redbox/tests/JscSafeUrlTest.cpp +173 -0
  40. package/ReactCommon/react/debug/redbox/tests/RedBoxErrorParserTest.cpp +107 -0
  41. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +9 -1
  42. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +11 -1
  43. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +58 -22
  44. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +6 -2
  45. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +9 -1
  46. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +19 -1
  47. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +3 -1
  48. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +11 -1
  49. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +5 -1
  50. package/package.json +8 -8
  51. package/src/private/featureflags/ReactNativeFeatureFlags.js +11 -1
  52. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +3 -1
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import "RCTRedBox2AnsiParser+Internal.h"
9
+
10
+ #import <React/RCTDefines.h>
11
+ #import <react/debug/redbox/AnsiParser.h>
12
+
13
+ #if RCT_DEV_MENU
14
+
15
+ using facebook::react::unstable_redbox::AnsiColor;
16
+ using facebook::react::unstable_redbox::parseAnsi;
17
+
18
+ static UIColor *RCTUIColorFromAnsiColor(const AnsiColor &c)
19
+ {
20
+ return [UIColor colorWithRed:c.r / 255.0 green:c.g / 255.0 blue:c.b / 255.0 alpha:1.0];
21
+ }
22
+
23
+ @implementation RCTRedBox2AnsiParser
24
+
25
+ + (NSAttributedString *)attributedStringFromAnsiText:(NSString *)text baseFont:(UIFont *)font baseColor:(UIColor *)color
26
+ {
27
+ if (text == nil) {
28
+ return [[NSAttributedString alloc] init];
29
+ }
30
+
31
+ auto spans = parseAnsi(text.UTF8String);
32
+ NSMutableAttributedString *result =[NSMutableAttributedString new];
33
+ NSDictionary *baseAttributes = @{NSFontAttributeName : font, NSForegroundColorAttributeName : color};
34
+
35
+ for (const auto &span : spans) {
36
+ NSString *str = [NSString stringWithUTF8String:span.text.c_str()];
37
+ if (str == nil) {
38
+ continue;
39
+ }
40
+ NSMutableDictionary *attrs = [baseAttributes mutableCopy];
41
+ if (span.foregroundColor.has_value()) {
42
+ attrs[NSForegroundColorAttributeName] = RCTUIColorFromAnsiColor(*span.foregroundColor);
43
+ }
44
+ if (span.backgroundColor.has_value()) {
45
+ attrs[NSBackgroundColorAttributeName] = RCTUIColorFromAnsiColor(*span.backgroundColor);
46
+ }
47
+ [result appendAttributedString:[[NSAttributedString alloc] initWithString:str attributes:attrs]];
48
+ }
49
+
50
+ return result;
51
+ }
52
+
53
+ @end
54
+
55
+ #endif
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import <React/RCTDefines.h>
9
+
10
+ #import "RCTRedBox+Internal.h"
11
+
12
+ #if RCT_DEV_MENU
13
+
14
+ typedef void (^RCTRedBox2ButtonPressHandler)(void);
15
+
16
+ @interface RCTRedBox2Controller : UIViewController <RCTRedBox2Controlling, UITableViewDelegate, UITableViewDataSource>
17
+
18
+ @property (nonatomic, weak) id<RCTRedBoxControllerActionDelegate> actionDelegate;
19
+
20
+ - (instancetype)initWithCustomButtonTitles:(NSArray<NSString *> *)customButtonTitles
21
+ customButtonHandlers:(NSArray<RCTRedBox2ButtonPressHandler> *)customButtonHandlers;
22
+
23
+ - (void)showErrorMessage:(NSString *)message
24
+ withStack:(NSArray<RCTJSStackFrame *> *)stack
25
+ isUpdate:(BOOL)isUpdate
26
+ errorCookie:(int)errorCookie;
27
+
28
+ /// The bundle URL used by the app, for the native HMR connection.
29
+ @property (nonatomic, strong, nullable) NSURL *bundleURL;
30
+
31
+ - (void)dismiss;
32
+ @end
33
+
34
+ #endif