react-native-tvos 0.85.2-0 → 0.86.0-0rc2
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/Libraries/Animated/AnimatedImplementation.js +6 -6
- package/Libraries/Animated/NativeAnimatedAllowlist.js +21 -0
- package/Libraries/Animated/components/AnimatedImage.js +3 -3
- package/Libraries/Animated/components/AnimatedText.js +3 -3
- package/Libraries/Animated/createAnimatedComponent.js +7 -7
- package/Libraries/Animated/nodes/AnimatedAddition.js +1 -1
- package/Libraries/Animated/nodes/AnimatedColor.js +7 -7
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +1 -1
- package/Libraries/Animated/nodes/AnimatedDivision.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +22 -24
- package/Libraries/Animated/nodes/AnimatedModulo.js +1 -1
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +1 -1
- package/Libraries/Animated/nodes/AnimatedStyle.js +2 -2
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +1 -1
- package/Libraries/Animated/nodes/AnimatedTracking.js +1 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +2 -2
- package/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +4 -0
- package/Libraries/AppDelegate/RCTRootViewFactory.h +5 -5
- package/Libraries/AppDelegate/RCTRootViewFactory.mm +2 -2
- package/Libraries/AppState/AppState.js +1 -1
- package/Libraries/BatchedBridge/NativeModules.js +1 -1
- package/Libraries/Blob/RCTBlobCollector.h +1 -1
- package/Libraries/Blob/RCTBlobCollector.mm +14 -26
- package/Libraries/Blob/RCTBlobManager.mm +11 -3
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +29 -23
- package/Libraries/Components/Keyboard/Keyboard.js +4 -2
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +1 -1
- package/Libraries/Components/LayoutConformance/LayoutConformance.js +1 -27
- package/Libraries/Components/Pressable/Pressable.d.ts +1 -0
- package/Libraries/Components/Pressable/Pressable.js +2 -2
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +7 -8
- package/Libraries/Components/ScrollView/ScrollView.js +3 -3
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +2 -2
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +2 -2
- package/Libraries/Components/Switch/Switch.js +1 -1
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +25 -1
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +1 -1
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +2 -2
- package/Libraries/Components/TextInput/TextInput.d.ts +24 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +24 -0
- package/Libraries/Components/TextInput/TextInput.js +5 -5
- package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +5 -5
- package/Libraries/Components/ToastAndroid/ToastAndroidFallback.js +5 -5
- package/Libraries/Components/Touchable/PooledClass.js +4 -4
- package/Libraries/Components/Touchable/Touchable.js +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -10
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +10 -2
- package/Libraries/Components/View/View.js +96 -91
- package/Libraries/Components/View/ViewPropTypes.js +3 -1
- package/Libraries/Core/Devtools/loadBundleFromServer.js +8 -0
- package/Libraries/Core/ExceptionsManager.js +2 -8
- package/Libraries/Core/InitializeCore.js +0 -13
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -3
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/ReactNativeVersionCheck.js +1 -1
- package/Libraries/Core/Timers/JSTimers.js +2 -2
- package/Libraries/Core/Timers/immediateShim.js +1 -1
- package/Libraries/Core/setUpBatchedBridge.js +1 -1
- package/Libraries/Core/setUpSegmentFetcher.js +1 -1
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +1 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +9 -5
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +2 -2
- package/Libraries/Image/Image.android.js +15 -35
- package/Libraries/Image/RCTImageLoader.mm +4 -2
- package/Libraries/Image/RelativeImageStub.js +2 -2
- package/Libraries/LayoutAnimation/LayoutAnimation.js +12 -12
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.js +1 -1
- package/Libraries/LogBox/LogBox.js +2 -2
- package/Libraries/LogBox/LogBoxInspectorContainer.js +24 -2
- package/Libraries/LogBox/LogBoxNotificationContainer.js +27 -4
- package/Libraries/LogBox/UI/LogBoxButton.js +47 -33
- package/Libraries/LogBox/UI/LogBoxInspector.js +61 -1
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +6 -0
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +3 -1
- package/Libraries/LogBox/UI/LogBoxNotification.js +2 -0
- package/Libraries/Modal/Modal.js +12 -7
- package/Libraries/NativeAnimation/Nodes/RCTInterpolationAnimatedNode.mm +0 -2
- package/Libraries/NativeComponent/BaseViewConfig.android.js +15 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +17 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -2
- package/Libraries/NativeComponent/ViewConfigIgnore.js +4 -2
- package/Libraries/Network/RCTNetworking.android.js +1 -1
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.js.flow +1 -1
- package/Libraries/Network/RCTNetworking.mm +1 -2
- package/Libraries/Network/XMLHttpRequest.js +29 -12
- package/Libraries/Pressability/Pressability.js +2 -2
- package/Libraries/ReactNative/AppContainer-dev.js +2 -3
- package/Libraries/ReactNative/AppContainer-prod.js +1 -2
- package/Libraries/ReactNative/AppContainer.js +0 -1
- package/Libraries/ReactNative/AppRegistry.d.ts +1 -1
- package/Libraries/ReactNative/AppRegistry.flow.js +1 -2
- package/Libraries/ReactNative/AppRegistryImpl.js +16 -16
- package/Libraries/ReactNative/DeprecatedPerformanceLoggerStub.js +83 -0
- package/Libraries/ReactNative/FabricUIManager.js +6 -0
- package/Libraries/{Utilities → ReactNative}/IPerformanceLogger.d.ts +8 -5
- package/Libraries/{Utilities/IPerformanceLogger.js → ReactNative/IPerformanceLogger.flow.js} +12 -9
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +14 -14
- package/Libraries/ReactNative/RendererImplementation.js +26 -143
- package/Libraries/ReactNative/RendererProxy.js +4 -15
- package/Libraries/ReactNative/renderApplication.js +33 -59
- package/Libraries/ReactNative/requireNativeComponent.js +3 -3
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +5 -0
- package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -32
- package/Libraries/Settings/Settings.ios.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +2 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +3 -3
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.js.flow +2 -2
- package/Libraries/StyleSheet/StyleSheetExports.js +1 -1
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +6 -8
- package/Libraries/StyleSheet/StyleSheetTypes.js +11 -11
- package/Libraries/StyleSheet/flattenStyle.js +1 -1
- package/Libraries/StyleSheet/private/_TransformStyle.js +1 -1
- package/Libraries/StyleSheet/processBackgroundImage.js +19 -9
- package/Libraries/StyleSheet/processBackgroundSize.js +7 -12
- package/Libraries/StyleSheet/processBoxShadow.js +9 -47
- package/Libraries/StyleSheet/processFilter.js +16 -8
- package/Libraries/StyleSheet/processTransformOrigin.js +10 -3
- package/Libraries/Text/Text.js +4 -4
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.mm +16 -2
- package/Libraries/Text/TextNativeComponent.js +4 -4
- package/Libraries/TurboModule/RCTExport.js +1 -1
- package/Libraries/TurboModule/TurboModuleRegistry.js +3 -3
- package/Libraries/Types/CodegenTypes.js +7 -4
- package/Libraries/Types/ReactDevToolsTypes.js +1 -1
- package/Libraries/Utilities/BackHandler.android.js +11 -3
- package/Libraries/Utilities/BackHandler.d.ts +11 -1
- package/Libraries/Utilities/BackHandler.ios.js +3 -1
- package/Libraries/Utilities/BackHandler.js.flow +6 -1
- package/Libraries/Utilities/HMRClient.js +28 -1
- package/Libraries/Utilities/HardwareBackPressEvent.js +22 -0
- package/Libraries/Utilities/ReactNativeTestTools.js +4 -4
- package/Libraries/Utilities/binaryToBase64.js +1 -1
- package/Libraries/Utilities/codegenNativeCommands.js +2 -2
- package/Libraries/Utilities/codegenNativeComponent.js +4 -4
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -2
- package/Libraries/Utilities/stringifySafe.js +1 -1
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/Libraries/vendor/core/ErrorUtils.js +4 -4
- package/Libraries/vendor/emitter/EventEmitter.js +27 -13
- package/React/Base/RCTBundleURLProvider.h +19 -1
- package/React/Base/RCTBundleURLProvider.mm +82 -0
- package/React/Base/RCTDefines.h +1 -1
- package/React/Base/RCTMultipartDataTask.h +1 -1
- package/React/Base/RCTMultipartDataTask.m +0 -3
- package/React/Base/RCTRootView.h +4 -0
- package/React/Base/RCTRootViewDelegate.h +5 -2
- package/React/Base/RCTVersion.m +3 -3
- package/React/Base/Surface/RCTSurface.h +3 -0
- package/React/Base/Surface/RCTSurfaceDelegate.h +7 -3
- package/React/Base/Surface/RCTSurfaceRootView.mm +1 -1
- package/React/Base/Surface/RCTSurfaceView.mm +2 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +2 -0
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.h +0 -3
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +3 -1
- package/React/CoreModules/RCTDevMenuConfigurationDecorator.h +2 -2
- package/React/CoreModules/RCTJscSafeUrl+Internal.h +23 -0
- package/React/CoreModules/RCTJscSafeUrl.mm +38 -0
- package/React/CoreModules/RCTRedBox+Internal.h +42 -0
- package/React/CoreModules/RCTRedBox.mm +30 -471
- package/React/CoreModules/RCTRedBox2AnsiParser+Internal.h +22 -0
- package/React/CoreModules/RCTRedBox2AnsiParser.mm +55 -0
- package/React/CoreModules/RCTRedBox2Controller+Internal.h +34 -0
- package/React/CoreModules/RCTRedBox2Controller.mm +764 -0
- package/React/CoreModules/RCTRedBox2ErrorParser+Internal.h +46 -0
- package/React/CoreModules/RCTRedBox2ErrorParser.mm +57 -0
- package/React/CoreModules/RCTRedBoxController+Internal.h +31 -0
- package/React/CoreModules/RCTRedBoxController.mm +447 -0
- package/React/CoreModules/RCTRedBoxHMRClient+Internal.h +26 -0
- package/React/CoreModules/RCTRedBoxHMRClient.mm +125 -0
- package/React/CoreModules/RCTWebSocketModule.mm +45 -6
- package/React/CoreModules/React-CoreModules.podspec +1 -0
- package/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm +0 -1
- package/React/DevSupport/RCTFrameTimingsObserver.h +24 -0
- package/React/DevSupport/RCTFrameTimingsObserver.mm +298 -0
- package/React/DevSupport/RCTInspectorDevServerHelper.mm +4 -0
- package/React/DevSupport/RCTPackagerConnection.mm +13 -11
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +148 -43
- package/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h +1 -0
- package/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm +1 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +2 -2
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +70 -8
- package/React/Fabric/RCTConversions.h +14 -0
- package/React/Fabric/RCTScheduler.mm +18 -0
- package/React/Fabric/RCTSurfacePointerHandler.mm +8 -2
- package/React/Fabric/RCTSurfaceTouchHandler.mm +1 -0
- package/React/Fabric/Surface/RCTFabricSurface.mm +3 -0
- package/React/I18n/strings/pt.lproj/fbt_language_pack.bin +0 -0
- package/React/Modules/RCTUIManager.mm +1 -1
- package/React/Profiler/RCTProfile.h +5 -0
- package/React/Profiler/RCTProfile.m +2 -1
- package/React/Profiler/RCTProfileTrampoline-arm.S +1 -1
- package/React/Profiler/RCTProfileTrampoline-arm64.S +1 -1
- package/React/Profiler/RCTProfileTrampoline-i386.S +1 -1
- package/React/Profiler/RCTProfileTrampoline-x86_64.S +1 -1
- package/React/Tests/Mounting/RCTViewComponentViewTests.mm +186 -0
- package/React/Tests/Text/RCTAttributedTextUtilsTest.mm +5 -5
- package/React/Views/RCTLayout.m +4 -3
- package/React/Views/ScrollView/RCTScrollView.h +6 -2
- package/ReactAndroid/api/ReactAndroid.api +37 -27
- package/ReactAndroid/build.gradle.kts +28 -21
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/hermes-engine/build.gradle.kts +17 -0
- package/ReactAndroid/publish.gradle +20 -46
- package/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesSamplingProfiler.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +40 -110
- package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +32 -87
- package/ReactAndroid/src/main/java/com/facebook/react/animated/EventAnimationDriver.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.kt +9 -99
- package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.kt +7 -28
- package/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt +2 -19
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaModuleWrapper.kt +15 -23
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +36 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactNativeJNISoLoader.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactNativeJniCommonSoLoader.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactSoftExceptionLogger.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultSoLoader.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/FpsView.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorFlags.kt +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/LogBoxDialogSurfaceDelegate.kt +15 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/RedBoxDialogSurfaceDelegate.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/DevSupportHttpClient.kt +9 -34
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingSequence.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingsObserver.kt +135 -35
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/InspectorNetworkRequestListener.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayView.kt +10 -10
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/AnimationBackendChoreographer.kt +15 -13
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/DevToolsReactPerfLogger.kt +4 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +139 -43
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/ViewTransitionSnapshotManager.kt +223 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/EventEmitterWrapper.kt +25 -8
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/FabricEventEmitter.kt +34 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.kt +104 -65
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.kt +9 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt +172 -36
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/PreAllocateViewMountItem.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/interfaces/ExtraWindowEventListener.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +71 -29
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +121 -51
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +25 -11
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +26 -12
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +134 -57
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android.kt +1 -4
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +25 -11
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlagsDefaults.kt +5 -9
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/rewrite_feature_flag_defaults.py +76 -0
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/tests/test_rewrite_feature_flag_defaults.py +63 -0
- package/ReactAndroid/src/main/java/com/facebook/react/internal/tracing/PerformanceTracer.kt +40 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.kt +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.kt +10 -5
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobProvider.kt +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/ClipboardModule.kt +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/DeviceEventManagerModule.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/ReactChoreographer.kt +21 -20
- package/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/DeviceInfoModule.kt +63 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt +59 -62
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.kt +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt +45 -36
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.kt +5 -2
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/CoreReactPackage.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +68 -15
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImplDevHelper.kt +8 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceView.kt +21 -19
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/soloader/OpenSourceMergedSoMapping.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt +77 -72
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +7 -16
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BlendModeHelper.kt +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/DisplayMetricsHolder.kt +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/FilterHelper.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +25 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactRootViewTagGenerator.kt +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/RootViewUtil.kt +17 -7
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ThemedReactContext.kt +18 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.kt +20 -12
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.kt +18 -24
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIConstantsProviderBinding.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.kt +11 -71
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +10 -17
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.kt +29 -30
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/BackgroundImageDrawable.kt +5 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/InsetBoxShadowDrawable.kt +12 -13
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTModernEventEmitter.kt +30 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/SynchronousEventReceiver.kt +28 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.kt +9 -9
- package/ReactAndroid/src/main/java/com/facebook/react/util/AndroidVersion.kt +27 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/MaintainVisibleScrollPositionHelper.kt +1 -14
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager.kt +1 -22
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +18 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.java +20 -21
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +19 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.kt +14 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.kt +2 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +5 -162
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt +71 -97
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/CustomStyleSpan.kt +1 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/DrawCommandSpan.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +7 -13
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +40 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactDrawableHelper.kt +59 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +84 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +41 -65
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/WindowUtil.kt +85 -13
- package/ReactAndroid/src/main/java/com/facebook/soloader/annotation/SoLoaderLibrary.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.java +5 -1
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIFinalizer.kt +30 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.java +39 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.java +20 -12
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java +101 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIFinalizer.kt +33 -0
- package/ReactAndroid/src/main/jni/CMakeLists.txt +17 -1
- package/ReactAndroid/src/main/jni/react/devsupport/JInspectorFlags.cpp +22 -0
- package/ReactAndroid/src/main/jni/react/devsupport/JInspectorFlags.h +2 -0
- package/ReactAndroid/src/main/jni/react/fabric/ComponentFactory.cpp +0 -1
- package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +0 -2
- package/ReactAndroid/src/main/jni/react/fabric/EventEmitterWrapper.cpp +26 -6
- package/ReactAndroid/src/main/jni/react/fabric/EventEmitterWrapper.h +3 -3
- package/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp +47 -0
- package/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.h +20 -6
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +24 -1
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.h +6 -0
- package/ReactAndroid/src/main/jni/react/fabric/FocusOrderingHelper.cpp +0 -1
- package/ReactAndroid/src/main/jni/react/fabric/SurfaceHandlerBinding.cpp +1 -0
- package/ReactAndroid/src/main/jni/react/fabric/test_helper/FabricMountingManagerTestHelper.cpp +85 -0
- package/ReactAndroid/src/main/jni/react/fabric/test_helper/FabricMountingManagerTestHelper.h +46 -0
- package/ReactAndroid/src/main/jni/react/fabric/test_helper/OnLoad.cpp +16 -0
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +167 -69
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +36 -15
- package/ReactAndroid/src/main/jni/react/hermes/instrumentation/HermesSamplingProfiler.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/jni/OnLoad-common.cpp +0 -2
- package/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp +2 -1
- package/ReactAndroid/src/main/jni/react/reactnativeblob/BlobCollector.cpp +37 -30
- package/ReactAndroid/src/main/jni/react/reactnativeblob/BlobCollector.h +11 -8
- package/ReactAndroid/src/main/jni/react/reactnativeblob/CMakeLists.txt +2 -1
- package/ReactAndroid/src/main/jni/react/reactnativeblob/OnLoad.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.cpp +24 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.h +25 -4
- package/ReactAndroid/src/main/jni/react/tracing/CMakeLists.txt +28 -0
- package/ReactCommon/React-Fabric.podspec +13 -0
- package/ReactCommon/React-FabricComponents.podspec +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +5 -5
- package/ReactCommon/jsc/JSCRuntime.cpp +9 -0
- package/ReactCommon/jserrorhandler/JsErrorHandler.cpp +1 -0
- package/ReactCommon/jserrorhandler/JsErrorHandler.h +1 -1
- package/ReactCommon/jsi/jsi/JSIDynamic.cpp +1 -0
- package/ReactCommon/jsi/jsi/decorator.h +93 -0
- package/ReactCommon/jsi/jsi/jsi-inl.h +97 -68
- package/ReactCommon/jsi/jsi/jsi.cpp +208 -27
- package/ReactCommon/jsi/jsi/jsi.h +553 -224
- package/ReactCommon/jsi/jsi/test/testlib.cpp +453 -0
- package/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +1 -1
- package/ReactCommon/jsinspector-modern/EmulationAgent.cpp +108 -0
- package/ReactCommon/jsinspector-modern/EmulationAgent.h +47 -0
- package/ReactCommon/jsinspector-modern/HostAgent.cpp +46 -1
- package/ReactCommon/jsinspector-modern/HostTarget.cpp +7 -1
- package/ReactCommon/jsinspector-modern/HostTarget.h +50 -0
- package/ReactCommon/jsinspector-modern/HostTargetTracing.cpp +1 -1
- package/ReactCommon/jsinspector-modern/HostTargetTracing.h +4 -4
- package/ReactCommon/jsinspector-modern/InspectorFlags.cpp +18 -2
- package/ReactCommon/jsinspector-modern/InspectorFlags.h +17 -2
- package/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp +19 -2
- package/ReactCommon/jsinspector-modern/InspectorPackagerConnectionImpl.h +3 -0
- package/ReactCommon/jsinspector-modern/NetworkIOAgent.cpp +1 -1
- package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +19 -0
- package/ReactCommon/jsinspector-modern/RuntimeAgent.h +7 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +33 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.h +6 -0
- package/ReactCommon/jsinspector-modern/TracingAgent.cpp +10 -0
- package/ReactCommon/jsinspector-modern/tests/HostTargetTest.cpp +12 -0
- package/ReactCommon/jsinspector-modern/tests/InspectorMocks.h +3 -2
- package/ReactCommon/jsinspector-modern/tests/JsiIntegrationTest.cpp +1 -0
- package/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +1 -1
- package/ReactCommon/jsinspector-modern/tests/TracingTest.cpp +1 -1
- package/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.cpp +10 -0
- package/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.h +3 -1
- package/ReactCommon/jsinspector-modern/tracing/CMakeLists.txt +1 -0
- package/ReactCommon/jsinspector-modern/tracing/FrameTimingSequence.h +7 -3
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.cpp +52 -29
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.h +6 -6
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracerSection.h +113 -0
- package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +1 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.cpp +12 -5
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h +3 -1
- package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.cpp +42 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.h +7 -0
- package/ReactCommon/jsinspector-modern/tracing/TracingCategory.h +0 -1
- package/ReactCommon/logger/react_native_log.cpp +0 -1
- package/ReactCommon/react/bridging/Array.h +1 -1
- package/ReactCommon/react/debug/CMakeLists.txt +2 -1
- package/ReactCommon/react/debug/React-debug.podspec +7 -1
- package/ReactCommon/react/debug/redbox/AnsiParser.cpp +139 -0
- package/ReactCommon/react/debug/redbox/AnsiParser.h +35 -0
- package/ReactCommon/react/debug/redbox/JscSafeUrl.cpp +179 -0
- package/ReactCommon/react/debug/redbox/JscSafeUrl.h +27 -0
- package/ReactCommon/react/debug/redbox/RedBoxErrorParser.cpp +171 -0
- package/ReactCommon/react/debug/redbox/RedBoxErrorParser.h +40 -0
- package/ReactCommon/react/debug/redbox/tests/AnsiParserTest.cpp +97 -0
- package/ReactCommon/react/debug/redbox/tests/JscSafeUrlTest.cpp +173 -0
- package/ReactCommon/react/debug/redbox/tests/RedBoxErrorParserTest.cpp +107 -0
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +49 -21
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +60 -25
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +267 -141
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +28 -14
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +48 -20
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +106 -43
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +3 -3
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +14 -7
- package/ReactCommon/react/featureflags/rewrite_feature_flag_defaults.py +111 -0
- package/ReactCommon/react/featureflags/tests/test_rewrite_feature_flag_defaults.py +60 -0
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.h +3 -9
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +0 -1
- package/ReactCommon/react/nativemodule/defaults/CMakeLists.txt +2 -0
- package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +14 -0
- package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +2 -0
- package/ReactCommon/react/nativemodule/fantomtestspecificmethods/NativeFantomTestSpecificMethods.cpp +2 -2
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +60 -25
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +25 -11
- package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.cpp +3 -2
- package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.h +4 -0
- package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec +66 -0
- package/ReactCommon/react/nativemodule/viewtransition/CMakeLists.txt +24 -0
- package/ReactCommon/react/nativemodule/viewtransition/NativeViewTransition.cpp +92 -0
- package/ReactCommon/react/nativemodule/viewtransition/NativeViewTransition.h +37 -0
- package/ReactCommon/react/nativemodule/viewtransition/React-viewtransitionnativemodule.podspec +58 -0
- package/ReactCommon/react/nativemodule/webperformance/NativePerformance.cpp +10 -1
- package/ReactCommon/react/networking/NetworkReporter.h +0 -1
- package/ReactCommon/react/performance/cdpmetrics/CdpPerfIssuesReporter.h +0 -1
- package/ReactCommon/react/performance/timeline/PerformanceEntry.h +1 -1
- package/ReactCommon/react/performance/timeline/PerformanceObserver.cpp +18 -6
- package/ReactCommon/react/performance/timeline/PerformanceObserver.h +2 -0
- package/ReactCommon/react/performance/timeline/tests/PerformanceEntryTest.cpp +62 -0
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +24 -12
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.h +1 -1
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropSerializer.cpp +3 -0
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.cpp +10 -3
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h +1 -0
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +4 -0
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.h +1 -1
- package/ReactCommon/react/renderer/animationbackend/AnimationBackendCommitHook.h +0 -1
- package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp +8 -3
- package/ReactCommon/react/renderer/animations/tests/MutationComparatorTest.cpp +273 -0
- package/ReactCommon/react/renderer/animations/utils.h +12 -1
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +1 -1
- package/ReactCommon/react/renderer/attributedstring/conversions.h +104 -3
- package/ReactCommon/react/renderer/components/image/conversions.h +2 -3
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewEventEmitter.h +0 -1
- package/ReactCommon/react/renderer/components/scrollview/conversions.h +0 -1
- package/ReactCommon/react/renderer/components/text/stateConversions.h +0 -1
- package/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +531 -21
- package/ReactCommon/react/renderer/components/view/AccessibilityProps.h +9 -0
- package/ReactCommon/react/renderer/components/view/BaseTouch.cpp +3 -2
- package/ReactCommon/react/renderer/components/view/BaseTouch.h +7 -0
- package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +8 -0
- package/ReactCommon/react/renderer/components/view/PointerEvent.cpp +2 -0
- package/ReactCommon/react/renderer/components/view/PointerEvent.h +5 -0
- package/ReactCommon/react/renderer/components/view/TouchEvent.h +0 -2
- package/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +23 -5
- package/ReactCommon/react/renderer/components/view/TouchEventEmitter.h +1 -0
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +5 -0
- package/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +33 -28
- package/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +0 -1
- package/ReactCommon/react/renderer/components/view/conversions.h +44 -28
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +53 -5
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/NativeDrawable.h +47 -16
- package/ReactCommon/react/renderer/components/view/platform/cxx/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +2 -2
- package/ReactCommon/react/renderer/{graphics/DoubleConversions.h → components/view/platform/tvos/react/renderer/components/view/HostPlatformTouch.h} +2 -4
- package/ReactCommon/react/renderer/components/view/platform/tvos/react/renderer/components/view/HostPlatformViewEventEmitter.h +14 -0
- package/ReactCommon/react/renderer/components/view/platform/tvos/react/renderer/components/view/HostPlatformViewProps.cpp +38 -0
- package/ReactCommon/react/renderer/components/view/platform/tvos/react/renderer/components/view/HostPlatformViewProps.h +29 -0
- package/ReactCommon/react/renderer/components/view/platform/tvos/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +30 -0
- package/ReactCommon/react/renderer/components/view/propsConversions.h +8 -2
- package/ReactCommon/react/renderer/components/view/tests/ConversionsTest.cpp +86 -0
- package/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp +34 -0
- package/ReactCommon/react/renderer/core/EventEmitter.cpp +67 -2
- package/ReactCommon/react/renderer/core/EventEmitter.h +25 -0
- package/ReactCommon/react/renderer/core/EventPipe.h +3 -1
- package/ReactCommon/react/renderer/core/EventQueueProcessor.cpp +18 -10
- package/ReactCommon/react/renderer/core/EventTarget.cpp +8 -5
- package/ReactCommon/react/renderer/core/LayoutContext.h +9 -2
- package/ReactCommon/react/renderer/core/LayoutMetrics.cpp +5 -3
- package/ReactCommon/react/renderer/core/LayoutPrimitives.h +1 -0
- package/ReactCommon/react/renderer/core/Props.cpp +20 -0
- package/ReactCommon/react/renderer/core/RawEvent.cpp +4 -2
- package/ReactCommon/react/renderer/core/RawEvent.h +6 -6
- package/ReactCommon/react/renderer/core/ShadowNode.h +2 -2
- package/ReactCommon/react/renderer/core/conversions.h +4 -0
- package/ReactCommon/react/renderer/core/graphicsConversions.h +4 -4
- package/ReactCommon/react/renderer/core/propsConversions.h +1 -1
- package/ReactCommon/react/renderer/core/tests/EventQueueProcessorTest.cpp +52 -3
- package/ReactCommon/react/renderer/core/tests/EventTargetTests.cpp +26 -0
- package/ReactCommon/react/renderer/css/tests/CSSValueParserTest.cpp +1 -1
- package/ReactCommon/react/renderer/debug/DebugStringConvertible.cpp +42 -26
- package/ReactCommon/react/renderer/debug/DebugStringConvertible.h +4 -2
- package/ReactCommon/react/renderer/debug/tests/DebugStringConvertibleTest.cpp +34 -3
- package/ReactCommon/react/renderer/graphics/BlendMode.h +5 -0
- package/ReactCommon/react/renderer/graphics/CMakeLists.txt +1 -0
- package/ReactCommon/react/renderer/graphics/ColorStop.h +3 -0
- package/ReactCommon/react/renderer/graphics/LinearGradient.h +3 -0
- package/ReactCommon/react/renderer/graphics/RadialGradient.h +4 -0
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -0
- package/ReactCommon/react/renderer/graphics/ValueUnit.cpp +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/ImageFetcher.cpp +0 -5
- package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/ImageManager.cpp +2 -2
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTImagePrimitivesConversions.h +0 -4
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTSyncImageManager.mm +5 -1
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +12 -4
- package/ReactCommon/react/renderer/mounting/CMakeLists.txt +1 -0
- package/ReactCommon/react/renderer/mounting/Differentiator.cpp +307 -4
- package/ReactCommon/react/renderer/mounting/ShadowTree.cpp +27 -2
- package/ReactCommon/react/renderer/mounting/internal/LongestIncreasingSubsequence.h +95 -0
- package/ReactCommon/react/renderer/mounting/tests/DifferentiatorUnflattenTest.cpp +212 -0
- package/ReactCommon/react/renderer/mounting/tests/LongestIncreasingSubsequenceTest.cpp +154 -0
- package/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +314 -18
- package/ReactCommon/react/renderer/mounting/updateMountedFlag.cpp +38 -20
- package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +20 -22
- package/ReactCommon/react/renderer/scheduler/CMakeLists.txt +1 -0
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +76 -3
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +12 -0
- package/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h +5 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +0 -7
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +2 -1
- package/ReactCommon/react/renderer/uimanager/UIManager.cpp +16 -1
- package/ReactCommon/react/renderer/uimanager/UIManager.h +8 -0
- package/ReactCommon/react/renderer/uimanager/UIManagerAnimationBackend.h +1 -0
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +347 -5
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.h +5 -3
- package/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h +5 -0
- package/ReactCommon/react/renderer/uimanager/UIManagerViewTransitionDelegate.h +82 -0
- package/ReactCommon/react/renderer/viewtransition/CMakeLists.txt +22 -0
- package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.cpp +520 -0
- package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.h +161 -0
- package/ReactCommon/react/runtime/TimerManager.cpp +4 -2
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +152 -0
- package/ReactCommon/react/timing/PrivacyInfo.xcprivacy +21 -0
- package/ReactCommon/react/timing/React-timing.podspec +2 -0
- package/ReactCommon/react/timing/primitives.h +33 -1
- package/ReactCommon/{jsinspector-modern → react/utils}/Base64.h +2 -2
- package/ReactCommon/yoga/yoga/YGEnums.cpp +32 -0
- package/ReactCommon/yoga/yoga/YGEnums.h +20 -4
- package/ReactCommon/yoga/yoga/YGMacros.h +2 -0
- package/ReactCommon/yoga/yoga/YGNode.h +1 -1
- package/ReactCommon/yoga/yoga/YGNodeStyle.cpp +269 -0
- package/ReactCommon/yoga/yoga/YGNodeStyle.h +93 -1
- package/ReactCommon/yoga/yoga/algorithm/AbsoluteLayout.cpp +40 -9
- package/ReactCommon/yoga/yoga/algorithm/Align.h +12 -1
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +106 -14
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.h +22 -0
- package/ReactCommon/yoga/yoga/enums/Align.h +3 -1
- package/ReactCommon/yoga/yoga/enums/Display.h +2 -1
- package/ReactCommon/yoga/yoga/enums/ExperimentalFeature.h +2 -1
- package/ReactCommon/yoga/yoga/enums/GridTrackType.h +43 -0
- package/ReactCommon/yoga/yoga/enums/Justify.h +5 -1
- package/ReactCommon/yoga/yoga/event/event.cpp +2 -0
- package/ReactCommon/yoga/yoga/event/event.h +1 -0
- package/ReactCommon/yoga/yoga/node/Node.cpp +6 -1
- package/ReactCommon/yoga/yoga/node/Node.h +4 -4
- package/ReactCommon/yoga/yoga/style/GridLine.h +53 -0
- package/ReactCommon/yoga/yoga/style/GridTrack.h +63 -0
- package/ReactCommon/yoga/yoga/style/Style.h +261 -71
- package/ReactCommon/yoga/yoga/style/StyleSizeLength.h +7 -1
- package/ReactCommon/yoga/yoga/style/StyleValueHandle.h +8 -0
- package/ReactCommon/yoga/yoga/style/StyleValuePool.h +10 -0
- package/cli.js +1 -1
- package/flow/HermesInternalType.js +1 -1
- package/flow/bom.js.flow +95 -3
- package/flow/dom.js.flow +89 -89
- package/gradle/libs.versions.toml +3 -1
- package/index.js +30 -3
- package/index.js.flow +23 -1
- package/package.json +13 -13
- package/react-native.config.js +3 -3
- package/scripts/cocoapods/rncore.rb +65 -11
- package/scripts/cocoapods/rndependencies.rb +65 -11
- package/scripts/cocoapods/utils.rb +53 -0
- package/scripts/codegen/generate-artifacts-executor/generateCustomURLHandlers.js +1 -1
- package/scripts/codegen/generate-artifacts-executor/generateNativeCode.js +13 -4
- package/scripts/codegen/generate-artifacts-executor/generateRCTModuleProviders.js +1 -1
- package/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js +1 -1
- package/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js +17 -6
- package/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js +1 -1
- package/scripts/codegen/generate-artifacts-executor/generateUnstableModulesRequiringMainQueueSetupProvider.js +1 -1
- package/scripts/codegen/generate-artifacts-executor/index.js +2 -0
- package/scripts/codegen/generate-artifacts-executor/utils.js +1 -1
- package/scripts/codegen/generate-specs-cli-executor.js +1 -1
- package/scripts/generate-codegen-artifacts.js +20 -2
- package/scripts/generate-provider-cli.js +1 -1
- package/scripts/react_native_pods.rb +26 -2
- package/scripts/react_native_pods_utils/script_phases.rb +9 -3
- package/scripts/replace-rncore-version.js +91 -14
- package/scripts/xcode/with-environment.sh +7 -1
- package/sdks/.hermesv1version +1 -1
- package/sdks/.hermesversion +1 -1
- package/sdks/hermes-engine/hermes-utils.rb +92 -5
- package/sdks/hermes-engine/version.properties +2 -2
- package/src/private/animated/NativeAnimatedValidation.js +1 -1
- package/src/private/animated/createAnimatedPropsHook.js +2 -2
- package/src/private/components/virtualcollection/FlingConstants.js +21 -0
- package/src/private/components/virtualcollection/Virtual.js +62 -0
- package/src/private/components/virtualcollection/VirtualCollectionView.js +238 -0
- package/src/private/components/virtualcollection/column/VirtualColumn.js +43 -0
- package/src/private/components/virtualcollection/column/VirtualColumnGenerator.js +72 -0
- package/src/private/components/virtualcollection/debug/FlingItemOverlay.js +13 -0
- package/src/private/components/virtualcollection/dom/getScrollParent.js +43 -0
- package/src/private/components/virtualcollection/dom/isScrollableNode.js +22 -0
- package/src/private/components/virtualcollection/row/VirtualRow.js +43 -0
- package/src/private/components/virtualcollection/row/VirtualRowGenerator.js +72 -0
- package/src/private/devsupport/devmenu/elementinspector/getInspectorDataForViewAtPoint.js +2 -2
- package/src/private/devsupport/devmenu/elementinspector/useExternalInspection.js +1 -1
- package/src/private/devsupport/devmenu/specs/NativeDevMenu.js +1 -1
- package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +2 -2
- package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsSettingsManager.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +66 -37
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +3 -3
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +14 -7
- package/src/private/renderer/errorhandling/ErrorHandlers.js +3 -3
- package/src/private/renderer/events/LegacySyntheticEvent.js +90 -0
- package/src/private/renderer/events/ReactNativeEventTypeMapping.js +103 -0
- package/src/private/renderer/events/ReactNativeResponder.js +687 -0
- package/src/private/renderer/events/ResponderEvent.js +40 -0
- package/src/private/renderer/events/ResponderTouchHistoryStore.js +258 -0
- package/src/private/renderer/events/dispatchNativeEvent.js +83 -0
- package/src/private/setup/setUpDOM.js +20 -0
- package/src/private/setup/setUpDefaultReactNativeEnvironment.js +6 -0
- package/src/private/specs_DEPRECATED/components/ActivityIndicatorViewNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/AndroidDrawerLayoutNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/AndroidHorizontalScrollContentViewNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/AndroidSwipeRefreshLayoutNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/DebuggingOverlayNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/PullToRefreshViewNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/RCTInputAccessoryViewNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/RCTSafeAreaViewNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/components/UnimplementedNativeViewNativeComponent.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeAccessibilityInfo.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeAccessibilityManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeActionSheetManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeAlertManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeAppState.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeAppearance.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeBlobModule.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeClipboard.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeDevLoadingView.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeDevSettings.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeDeviceEventManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeFileReaderModule.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeFrameRateLogger.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeHeadlessJsTaskSupport.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeI18nManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeImageEditor.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeImageLoaderAndroid.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeImageLoaderIOS.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeImageStoreAndroid.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeImageStoreIOS.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeIntentAndroid.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeJSCHeapCapture.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeKeyboardObserver.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeLinkingManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeLogBox.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeModalManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeNetworkingAndroid.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativePermissionsAndroid.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsAndroid.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsIOS.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativePushNotificationManagerIOS.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeRedBox.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeSegmentFetcher.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeSettingsManager.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeShareModule.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeSoundManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeTiming.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeToastAndroid.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeVibration.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeWebSocketModule.js +2 -2
- package/src/private/styles/composeStyles.js +1 -1
- package/src/private/types/HostComponent.js +1 -1
- package/src/private/utilities/toExtendedError.js +1 -1
- package/src/private/viewtransition/specs/NativeViewTransition.js +33 -0
- package/src/private/webapis/dom/events/Event.js +10 -1
- package/src/private/webapis/dom/events/EventTarget.js +60 -18
- package/src/private/webapis/dom/events/internals/EventInternals.js +18 -1
- package/src/private/webapis/dom/events/internals/EventTargetInternals.js +12 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +24 -0
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +4 -6
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +70 -1
- package/src/private/webapis/dom/nodes/internals/NodeInternals.js +10 -0
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +1 -1
- package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +2 -2
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +5 -9
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +2 -2
- package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +2 -2
- package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +2 -2
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +1 -1
- package/src/private/webapis/performance/specs/NativePerformance.js +1 -1
- package/src/private/webapis/structuredClone/structuredClone.js +1 -1
- package/src/private/webapis/webidl/PlatformObjects.js +4 -4
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +0 -19669
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +0 -11129
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +0 -12930
- package/Libraries/Renderer/shims/ReactNative.js +0 -27
- package/Libraries/Utilities/GlobalPerformanceLogger.js +0 -24
- package/Libraries/Utilities/PerformanceLoggerContext.js +0 -33
- package/Libraries/Utilities/createPerformanceLogger.js +0 -329
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaMethodWrapper.kt +0 -442
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobCollector.kt +0 -31
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollContainerLegacyView.kt +0 -47
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIFinalizer.java +0 -31
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIFinalizer.java +0 -35
- package/ReactCommon/react/renderer/graphics/DoubleConversions.cpp +0 -38
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
#import <UIKit/UIKit.h>
|
|
10
|
+
|
|
11
|
+
#if RCT_DEV_MENU
|
|
12
|
+
|
|
13
|
+
@class RCTJSStackFrame;
|
|
14
|
+
|
|
15
|
+
@protocol RCTRedBoxControllerActionDelegate <NSObject>
|
|
16
|
+
|
|
17
|
+
- (void)redBoxController:(UIViewController *)redBoxController openStackFrameInEditor:(RCTJSStackFrame *)stackFrame;
|
|
18
|
+
- (void)reloadFromRedBoxController:(UIViewController *)redBoxController;
|
|
19
|
+
- (void)loadExtraDataViewController;
|
|
20
|
+
|
|
21
|
+
@end
|
|
22
|
+
|
|
23
|
+
@protocol RCTRedBoxControlling <NSObject>
|
|
24
|
+
|
|
25
|
+
@property (nonatomic, weak) id<RCTRedBoxControllerActionDelegate> actionDelegate;
|
|
26
|
+
|
|
27
|
+
- (void)showErrorMessage:(NSString *)message
|
|
28
|
+
withStack:(NSArray<RCTJSStackFrame *> *)stack
|
|
29
|
+
isUpdate:(BOOL)isUpdate
|
|
30
|
+
errorCookie:(int)errorCookie;
|
|
31
|
+
|
|
32
|
+
- (void)dismiss;
|
|
33
|
+
|
|
34
|
+
@end
|
|
35
|
+
|
|
36
|
+
@protocol RCTRedBox2Controlling <RCTRedBoxControlling>
|
|
37
|
+
|
|
38
|
+
@property (nonatomic, strong, nullable) NSURL *bundleURL;
|
|
39
|
+
|
|
40
|
+
@end
|
|
41
|
+
|
|
42
|
+
#endif
|
|
@@ -16,472 +16,15 @@
|
|
|
16
16
|
#import <React/RCTRedBoxExtraDataViewController.h>
|
|
17
17
|
#import <React/RCTReloadCommand.h>
|
|
18
18
|
#import <React/RCTUtils.h>
|
|
19
|
-
|
|
20
|
-
#import <objc/runtime.h>
|
|
19
|
+
#import <react/featureflags/ReactNativeFeatureFlags.h>
|
|
21
20
|
|
|
22
21
|
#import "CoreModulesPlugins.h"
|
|
22
|
+
#import "RCTRedBox+Internal.h"
|
|
23
|
+
#import "RCTRedBox2Controller+Internal.h"
|
|
24
|
+
#import "RCTRedBoxController+Internal.h"
|
|
23
25
|
|
|
24
26
|
#if RCT_DEV_MENU
|
|
25
27
|
|
|
26
|
-
@class RCTRedBoxController;
|
|
27
|
-
|
|
28
|
-
@interface UIButton (RCTRedBox)
|
|
29
|
-
|
|
30
|
-
@property (nonatomic) RCTRedBoxButtonPressHandler rct_handler;
|
|
31
|
-
|
|
32
|
-
- (void)rct_addBlock:(RCTRedBoxButtonPressHandler)handler forControlEvents:(UIControlEvents)controlEvents;
|
|
33
|
-
|
|
34
|
-
@end
|
|
35
|
-
|
|
36
|
-
@implementation UIButton (RCTRedBox)
|
|
37
|
-
|
|
38
|
-
- (RCTRedBoxButtonPressHandler)rct_handler
|
|
39
|
-
{
|
|
40
|
-
return objc_getAssociatedObject(self, @selector(rct_handler));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
- (void)setRct_handler:(RCTRedBoxButtonPressHandler)rct_handler
|
|
44
|
-
{
|
|
45
|
-
objc_setAssociatedObject(self, @selector(rct_handler), rct_handler, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
- (void)rct_callBlock
|
|
49
|
-
{
|
|
50
|
-
if (self.rct_handler) {
|
|
51
|
-
self.rct_handler();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
- (void)rct_addBlock:(RCTRedBoxButtonPressHandler)handler forControlEvents:(UIControlEvents)controlEvents
|
|
56
|
-
{
|
|
57
|
-
self.rct_handler = handler;
|
|
58
|
-
[self addTarget:self action:@selector(rct_callBlock) forControlEvents:controlEvents];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@end
|
|
62
|
-
|
|
63
|
-
@protocol RCTRedBoxControllerActionDelegate <NSObject>
|
|
64
|
-
|
|
65
|
-
- (void)redBoxController:(RCTRedBoxController *)redBoxController openStackFrameInEditor:(RCTJSStackFrame *)stackFrame;
|
|
66
|
-
- (void)reloadFromRedBoxController:(RCTRedBoxController *)redBoxController;
|
|
67
|
-
- (void)loadExtraDataViewController;
|
|
68
|
-
|
|
69
|
-
@end
|
|
70
|
-
|
|
71
|
-
@interface RCTRedBoxController : UIViewController <UITableViewDelegate, UITableViewDataSource>
|
|
72
|
-
@property (nonatomic, weak) id<RCTRedBoxControllerActionDelegate> actionDelegate;
|
|
73
|
-
@end
|
|
74
|
-
|
|
75
|
-
@implementation RCTRedBoxController {
|
|
76
|
-
UITableView *_stackTraceTableView;
|
|
77
|
-
NSString *_lastErrorMessage;
|
|
78
|
-
NSArray<RCTJSStackFrame *> *_lastStackTrace;
|
|
79
|
-
NSArray<NSString *> *_customButtonTitles;
|
|
80
|
-
NSArray<RCTRedBoxButtonPressHandler> *_customButtonHandlers;
|
|
81
|
-
int _lastErrorCookie;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
- (instancetype)initWithCustomButtonTitles:(NSArray<NSString *> *)customButtonTitles
|
|
85
|
-
customButtonHandlers:(NSArray<RCTRedBoxButtonPressHandler> *)customButtonHandlers
|
|
86
|
-
{
|
|
87
|
-
if (self = [super init]) {
|
|
88
|
-
_lastErrorCookie = -1;
|
|
89
|
-
_customButtonTitles = customButtonTitles;
|
|
90
|
-
_customButtonHandlers = customButtonHandlers;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return self;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
- (void)viewDidLoad
|
|
97
|
-
{
|
|
98
|
-
[super viewDidLoad];
|
|
99
|
-
self.view.backgroundColor = [UIColor blackColor];
|
|
100
|
-
|
|
101
|
-
const CGFloat buttonHeight = 60;
|
|
102
|
-
|
|
103
|
-
CGRect detailsFrame = self.view.bounds;
|
|
104
|
-
detailsFrame.size.height -= buttonHeight + (double)[self bottomSafeViewHeight];
|
|
105
|
-
|
|
106
|
-
_stackTraceTableView = [[UITableView alloc] initWithFrame:detailsFrame style:UITableViewStylePlain];
|
|
107
|
-
_stackTraceTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
108
|
-
_stackTraceTableView.delegate = self;
|
|
109
|
-
_stackTraceTableView.dataSource = self;
|
|
110
|
-
_stackTraceTableView.backgroundColor = [UIColor clearColor];
|
|
111
|
-
#if !TARGET_OS_TV
|
|
112
|
-
_stackTraceTableView.separatorColor = [UIColor colorWithWhite:1 alpha:0.3];
|
|
113
|
-
_stackTraceTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
|
114
|
-
#endif
|
|
115
|
-
_stackTraceTableView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
|
|
116
|
-
[self.view addSubview:_stackTraceTableView];
|
|
117
|
-
|
|
118
|
-
#if TARGET_OS_SIMULATOR || TARGET_OS_MACCATALYST
|
|
119
|
-
NSString *reloadText = @"Reload\n(\u2318R)";
|
|
120
|
-
NSString *dismissText = @"Dismiss\n(ESC)";
|
|
121
|
-
NSString *copyText = @"Copy\n(\u2325\u2318C)";
|
|
122
|
-
NSString *extraText = @"Extra Info\n(\u2318E)";
|
|
123
|
-
#else
|
|
124
|
-
NSString *reloadText = @"Reload JS";
|
|
125
|
-
NSString *dismissText = @"Dismiss";
|
|
126
|
-
NSString *copyText = @"Copy";
|
|
127
|
-
NSString *extraText = @"Extra Info";
|
|
128
|
-
#endif
|
|
129
|
-
|
|
130
|
-
UIButton *dismissButton = [self redBoxButton:dismissText
|
|
131
|
-
accessibilityIdentifier:@"redbox-dismiss"
|
|
132
|
-
selector:@selector(dismiss)
|
|
133
|
-
block:nil];
|
|
134
|
-
UIButton *reloadButton = [self redBoxButton:reloadText
|
|
135
|
-
accessibilityIdentifier:@"redbox-reload"
|
|
136
|
-
selector:@selector(reload)
|
|
137
|
-
block:nil];
|
|
138
|
-
UIButton *copyButton = [self redBoxButton:copyText
|
|
139
|
-
accessibilityIdentifier:@"redbox-copy"
|
|
140
|
-
selector:@selector(copyStack)
|
|
141
|
-
block:nil];
|
|
142
|
-
UIButton *extraButton = [self redBoxButton:extraText
|
|
143
|
-
accessibilityIdentifier:@"redbox-extra"
|
|
144
|
-
selector:@selector(showExtraDataViewController)
|
|
145
|
-
block:nil];
|
|
146
|
-
|
|
147
|
-
[NSLayoutConstraint activateConstraints:@[
|
|
148
|
-
[dismissButton.heightAnchor constraintEqualToConstant:buttonHeight],
|
|
149
|
-
[reloadButton.heightAnchor constraintEqualToConstant:buttonHeight],
|
|
150
|
-
[copyButton.heightAnchor constraintEqualToConstant:buttonHeight],
|
|
151
|
-
[extraButton.heightAnchor constraintEqualToConstant:buttonHeight]
|
|
152
|
-
]];
|
|
153
|
-
|
|
154
|
-
UIStackView *buttonStackView = [[UIStackView alloc] init];
|
|
155
|
-
buttonStackView.translatesAutoresizingMaskIntoConstraints = NO;
|
|
156
|
-
buttonStackView.axis = UILayoutConstraintAxisHorizontal;
|
|
157
|
-
buttonStackView.distribution = UIStackViewDistributionFillEqually;
|
|
158
|
-
buttonStackView.alignment = UIStackViewAlignmentTop;
|
|
159
|
-
buttonStackView.backgroundColor = [UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:1];
|
|
160
|
-
|
|
161
|
-
[buttonStackView addArrangedSubview:dismissButton];
|
|
162
|
-
[buttonStackView addArrangedSubview:reloadButton];
|
|
163
|
-
[buttonStackView addArrangedSubview:copyButton];
|
|
164
|
-
[buttonStackView addArrangedSubview:extraButton];
|
|
165
|
-
|
|
166
|
-
[self.view addSubview:buttonStackView];
|
|
167
|
-
|
|
168
|
-
[NSLayoutConstraint activateConstraints:@[
|
|
169
|
-
[buttonStackView.heightAnchor constraintEqualToConstant:buttonHeight + [self bottomSafeViewHeight]],
|
|
170
|
-
[buttonStackView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor],
|
|
171
|
-
[buttonStackView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor],
|
|
172
|
-
[buttonStackView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor]
|
|
173
|
-
]];
|
|
174
|
-
|
|
175
|
-
for (NSUInteger i = 0; i < [_customButtonTitles count]; i++) {
|
|
176
|
-
UIButton *button = [self redBoxButton:_customButtonTitles[i]
|
|
177
|
-
accessibilityIdentifier:@""
|
|
178
|
-
selector:nil
|
|
179
|
-
block:_customButtonHandlers[i]];
|
|
180
|
-
[button.heightAnchor constraintEqualToConstant:buttonHeight].active = YES;
|
|
181
|
-
[buttonStackView addArrangedSubview:button];
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
UIView *topBorder = [[UIView alloc] init];
|
|
185
|
-
topBorder.translatesAutoresizingMaskIntoConstraints = NO;
|
|
186
|
-
topBorder.backgroundColor = [UIColor colorWithRed:0.70 green:0.70 blue:0.70 alpha:1.0];
|
|
187
|
-
[topBorder.heightAnchor constraintEqualToConstant:1].active = YES;
|
|
188
|
-
|
|
189
|
-
[self.view addSubview:topBorder];
|
|
190
|
-
|
|
191
|
-
[NSLayoutConstraint activateConstraints:@[
|
|
192
|
-
[topBorder.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor],
|
|
193
|
-
[topBorder.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor],
|
|
194
|
-
[topBorder.bottomAnchor constraintEqualToAnchor:buttonStackView.topAnchor],
|
|
195
|
-
]];
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
- (UIButton *)redBoxButton:(NSString *)title
|
|
199
|
-
accessibilityIdentifier:(NSString *)accessibilityIdentifier
|
|
200
|
-
selector:(SEL)selector
|
|
201
|
-
block:(RCTRedBoxButtonPressHandler)block
|
|
202
|
-
{
|
|
203
|
-
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
204
|
-
button.autoresizingMask =
|
|
205
|
-
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleRightMargin;
|
|
206
|
-
button.accessibilityIdentifier = accessibilityIdentifier;
|
|
207
|
-
button.titleLabel.font = [UIFont systemFontOfSize:13];
|
|
208
|
-
button.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
|
|
209
|
-
button.titleLabel.textAlignment = NSTextAlignmentCenter;
|
|
210
|
-
button.backgroundColor = [UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:1];
|
|
211
|
-
[button setTitle:title forState:UIControlStateNormal];
|
|
212
|
-
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
|
213
|
-
[button setTitleColor:[UIColor colorWithWhite:1 alpha:0.5] forState:UIControlStateHighlighted];
|
|
214
|
-
if (selector) {
|
|
215
|
-
[button addTarget:self action:selector forControlEvents:UIControlEventTouchUpInside];
|
|
216
|
-
} else if (block) {
|
|
217
|
-
[button rct_addBlock:block forControlEvents:UIControlEventTouchUpInside];
|
|
218
|
-
}
|
|
219
|
-
return button;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
- (NSInteger)bottomSafeViewHeight
|
|
223
|
-
{
|
|
224
|
-
#if TARGET_OS_MACCATALYST
|
|
225
|
-
return 0;
|
|
226
|
-
#else
|
|
227
|
-
return RCTKeyWindow().safeAreaInsets.bottom;
|
|
228
|
-
#endif
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
|
232
|
-
|
|
233
|
-
- (NSString *)stripAnsi:(NSString *)text
|
|
234
|
-
{
|
|
235
|
-
NSError *error = nil;
|
|
236
|
-
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"\\x1b\\[[0-9;]*m"
|
|
237
|
-
options:NSRegularExpressionCaseInsensitive
|
|
238
|
-
error:&error];
|
|
239
|
-
return [regex stringByReplacingMatchesInString:text options:0 range:NSMakeRange(0, [text length]) withTemplate:@""];
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
- (void)showErrorMessage:(NSString *)message
|
|
243
|
-
withStack:(NSArray<RCTJSStackFrame *> *)stack
|
|
244
|
-
isUpdate:(BOOL)isUpdate
|
|
245
|
-
errorCookie:(int)errorCookie
|
|
246
|
-
{
|
|
247
|
-
// Remove ANSI color codes from the message
|
|
248
|
-
NSString *messageWithoutAnsi = [self stripAnsi:message];
|
|
249
|
-
|
|
250
|
-
BOOL isRootViewControllerPresented = self.presentingViewController != nil;
|
|
251
|
-
// Show if this is a new message, or if we're updating the previous message
|
|
252
|
-
BOOL isNew = !isRootViewControllerPresented && !isUpdate;
|
|
253
|
-
BOOL isUpdateForSameMessage = !isNew &&
|
|
254
|
-
(isRootViewControllerPresented && isUpdate &&
|
|
255
|
-
((errorCookie == -1 && [_lastErrorMessage isEqualToString:messageWithoutAnsi]) ||
|
|
256
|
-
(errorCookie == _lastErrorCookie)));
|
|
257
|
-
if (isNew || isUpdateForSameMessage) {
|
|
258
|
-
_lastStackTrace = stack;
|
|
259
|
-
// message is displayed using UILabel, which is unable to render text of
|
|
260
|
-
// unlimited length, so we truncate it
|
|
261
|
-
_lastErrorMessage = [messageWithoutAnsi substringToIndex:MIN((NSUInteger)10000, messageWithoutAnsi.length)];
|
|
262
|
-
_lastErrorCookie = errorCookie;
|
|
263
|
-
|
|
264
|
-
[_stackTraceTableView reloadData];
|
|
265
|
-
|
|
266
|
-
if (!isRootViewControllerPresented) {
|
|
267
|
-
[_stackTraceTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]
|
|
268
|
-
atScrollPosition:UITableViewScrollPositionTop
|
|
269
|
-
animated:NO];
|
|
270
|
-
[RCTKeyWindow().rootViewController presentViewController:self animated:YES completion:nil];
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
- (void)dismiss
|
|
276
|
-
{
|
|
277
|
-
[self dismissViewControllerAnimated:YES completion:nil];
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
- (void)reload
|
|
281
|
-
{
|
|
282
|
-
if (_actionDelegate != nil) {
|
|
283
|
-
[_actionDelegate reloadFromRedBoxController:self];
|
|
284
|
-
} else {
|
|
285
|
-
// In bridgeless mode `RCTRedBox` gets deallocated, we need to notify listeners anyway.
|
|
286
|
-
RCTTriggerReloadCommandListeners(@"Redbox");
|
|
287
|
-
[self dismiss];
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
- (void)showExtraDataViewController
|
|
292
|
-
{
|
|
293
|
-
[_actionDelegate loadExtraDataViewController];
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
- (void)copyStack
|
|
297
|
-
{
|
|
298
|
-
NSMutableString *fullStackTrace;
|
|
299
|
-
|
|
300
|
-
if (_lastErrorMessage != nil) {
|
|
301
|
-
fullStackTrace = [_lastErrorMessage mutableCopy];
|
|
302
|
-
[fullStackTrace appendString:@"\n\n"];
|
|
303
|
-
} else {
|
|
304
|
-
fullStackTrace = [NSMutableString string];
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
for (RCTJSStackFrame *stackFrame in _lastStackTrace) {
|
|
308
|
-
[fullStackTrace appendString:[NSString stringWithFormat:@"%@\n", stackFrame.methodName]];
|
|
309
|
-
if (stackFrame.file) {
|
|
310
|
-
[fullStackTrace appendFormat:@" %@\n", [self formatFrameSource:stackFrame]];
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
#if !TARGET_OS_TV
|
|
314
|
-
UIPasteboard *pb = [UIPasteboard generalPasteboard];
|
|
315
|
-
[pb setString:fullStackTrace];
|
|
316
|
-
#endif
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
- (NSString *)formatFrameSource:(RCTJSStackFrame *)stackFrame
|
|
320
|
-
{
|
|
321
|
-
NSString *fileName = RCTNilIfNull(stackFrame.file) ? [stackFrame.file lastPathComponent] : @"<unknown file>";
|
|
322
|
-
NSString *lineInfo = [NSString stringWithFormat:@"%@:%lld", fileName, (long long)stackFrame.lineNumber];
|
|
323
|
-
|
|
324
|
-
if (stackFrame.column != 0) {
|
|
325
|
-
lineInfo = [lineInfo stringByAppendingFormat:@":%lld", (long long)stackFrame.column];
|
|
326
|
-
}
|
|
327
|
-
return lineInfo;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
- (void)tableView:(UITableView *)tableView didUpdateFocusInContext:(UITableViewFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
|
|
331
|
-
{
|
|
332
|
-
UITableViewCell *previouslyFocusedItem = (UITableViewCell *)context.previouslyFocusedItem;
|
|
333
|
-
if ([previouslyFocusedItem isKindOfClass:[UITableViewCell class]]) {
|
|
334
|
-
[coordinator addCoordinatedUnfocusingAnimations:^(id<UIFocusAnimationContext> _Nonnull animationContext) {
|
|
335
|
-
previouslyFocusedItem.textLabel.textColor = [UIColor whiteColor];
|
|
336
|
-
} completion:nil];
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
UITableViewCell *nextFocusedItem = (UITableViewCell *)context.nextFocusedItem;
|
|
340
|
-
if ([nextFocusedItem isKindOfClass:[UITableViewCell class]]) {
|
|
341
|
-
[coordinator addCoordinatedFocusingAnimations:^(id<UIFocusAnimationContext> _Nonnull animationContext) {
|
|
342
|
-
nextFocusedItem.textLabel.textColor = [UIColor blackColor];
|
|
343
|
-
} completion:nil];
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
#pragma mark - TableView
|
|
348
|
-
|
|
349
|
-
- (NSInteger)numberOfSectionsInTableView:(__unused UITableView *)tableView
|
|
350
|
-
{
|
|
351
|
-
return 2;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
- (NSInteger)tableView:(__unused UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
|
355
|
-
{
|
|
356
|
-
return section == 0 ? 1 : _lastStackTrace.count;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
|
360
|
-
{
|
|
361
|
-
if (indexPath.section == 0) {
|
|
362
|
-
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"msg-cell"];
|
|
363
|
-
return [self reuseCell:cell forErrorMessage:_lastErrorMessage];
|
|
364
|
-
}
|
|
365
|
-
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
|
|
366
|
-
NSUInteger index = indexPath.row;
|
|
367
|
-
RCTJSStackFrame *stackFrame = _lastStackTrace[index];
|
|
368
|
-
return [self reuseCell:cell forStackFrame:stackFrame];
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
- (UITableViewCell *)reuseCell:(UITableViewCell *)cell forErrorMessage:(NSString *)message
|
|
372
|
-
{
|
|
373
|
-
if (!cell) {
|
|
374
|
-
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"msg-cell"];
|
|
375
|
-
cell.textLabel.accessibilityIdentifier = @"redbox-error";
|
|
376
|
-
cell.textLabel.textColor = [UIColor whiteColor];
|
|
377
|
-
|
|
378
|
-
// Prefer a monofont for formatting messages that were designed
|
|
379
|
-
// to be displayed in a terminal.
|
|
380
|
-
cell.textLabel.font = [UIFont monospacedSystemFontOfSize:14 weight:UIFontWeightBold];
|
|
381
|
-
|
|
382
|
-
cell.textLabel.lineBreakMode = NSLineBreakByWordWrapping;
|
|
383
|
-
cell.textLabel.numberOfLines = 0;
|
|
384
|
-
cell.detailTextLabel.textColor = [UIColor whiteColor];
|
|
385
|
-
cell.backgroundColor = [UIColor colorWithRed:0.82 green:0.10 blue:0.15 alpha:1.0];
|
|
386
|
-
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
cell.textLabel.text = message;
|
|
390
|
-
|
|
391
|
-
return cell;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
- (UITableViewCell *)reuseCell:(UITableViewCell *)cell forStackFrame:(RCTJSStackFrame *)stackFrame
|
|
395
|
-
{
|
|
396
|
-
if (!cell) {
|
|
397
|
-
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
|
|
398
|
-
cell.textLabel.font = [UIFont fontWithName:@"Menlo-Regular" size:14];
|
|
399
|
-
cell.textLabel.lineBreakMode = NSLineBreakByCharWrapping;
|
|
400
|
-
cell.textLabel.numberOfLines = 2;
|
|
401
|
-
cell.detailTextLabel.textColor = [UIColor colorWithRed:0.70 green:0.70 blue:0.70 alpha:1.0];
|
|
402
|
-
cell.detailTextLabel.font = [UIFont fontWithName:@"Menlo-Regular" size:11];
|
|
403
|
-
cell.detailTextLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
|
|
404
|
-
cell.backgroundColor = [UIColor clearColor];
|
|
405
|
-
cell.selectedBackgroundView = [UIView new];
|
|
406
|
-
cell.selectedBackgroundView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.2];
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
cell.textLabel.text = stackFrame.methodName ?: @"(unnamed method)";
|
|
410
|
-
if (stackFrame.file) {
|
|
411
|
-
cell.detailTextLabel.text = [self formatFrameSource:stackFrame];
|
|
412
|
-
} else {
|
|
413
|
-
cell.detailTextLabel.text = @"";
|
|
414
|
-
}
|
|
415
|
-
cell.textLabel.textColor = stackFrame.collapse ? [UIColor lightGrayColor] : [UIColor whiteColor];
|
|
416
|
-
cell.detailTextLabel.textColor = stackFrame.collapse ? [UIColor colorWithRed:0.50 green:0.50 blue:0.50 alpha:1.0]
|
|
417
|
-
: [UIColor colorWithRed:0.70 green:0.70 blue:0.70 alpha:1.0];
|
|
418
|
-
return cell;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
|
422
|
-
{
|
|
423
|
-
if (indexPath.section == 0) {
|
|
424
|
-
NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
|
|
425
|
-
paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
|
|
426
|
-
|
|
427
|
-
NSDictionary *attributes =
|
|
428
|
-
@{NSFontAttributeName : [UIFont boldSystemFontOfSize:16], NSParagraphStyleAttributeName : paragraphStyle};
|
|
429
|
-
CGRect boundingRect =
|
|
430
|
-
[_lastErrorMessage boundingRectWithSize:CGSizeMake(tableView.frame.size.width - 30, CGFLOAT_MAX)
|
|
431
|
-
options:NSStringDrawingUsesLineFragmentOrigin
|
|
432
|
-
attributes:attributes
|
|
433
|
-
context:nil];
|
|
434
|
-
return ceil(boundingRect.size.height) + 40;
|
|
435
|
-
} else {
|
|
436
|
-
return 50;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
|
441
|
-
{
|
|
442
|
-
if (indexPath.section == 1) {
|
|
443
|
-
NSUInteger row = indexPath.row;
|
|
444
|
-
RCTJSStackFrame *stackFrame = _lastStackTrace[row];
|
|
445
|
-
[_actionDelegate redBoxController:self openStackFrameInEditor:stackFrame];
|
|
446
|
-
}
|
|
447
|
-
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
#pragma mark - Key commands
|
|
451
|
-
|
|
452
|
-
- (NSArray<UIKeyCommand *> *)keyCommands
|
|
453
|
-
{
|
|
454
|
-
// NOTE: We could use RCTKeyCommands for this, but since
|
|
455
|
-
// we control this window, we can use the standard, non-hacky
|
|
456
|
-
// mechanism instead
|
|
457
|
-
|
|
458
|
-
return @[
|
|
459
|
-
// Dismiss red box
|
|
460
|
-
[UIKeyCommand keyCommandWithInput:UIKeyInputEscape modifierFlags:0 action:@selector(dismiss)],
|
|
461
|
-
|
|
462
|
-
// Reload
|
|
463
|
-
[UIKeyCommand keyCommandWithInput:@"r" modifierFlags:UIKeyModifierCommand action:@selector(reload)],
|
|
464
|
-
|
|
465
|
-
// Copy = Cmd-Option C since Cmd-C in the simulator copies the pasteboard from
|
|
466
|
-
// the simulator to the desktop pasteboard.
|
|
467
|
-
[UIKeyCommand keyCommandWithInput:@"c"
|
|
468
|
-
modifierFlags:UIKeyModifierCommand | UIKeyModifierAlternate
|
|
469
|
-
action:@selector(copyStack)],
|
|
470
|
-
|
|
471
|
-
// Extra data
|
|
472
|
-
[UIKeyCommand keyCommandWithInput:@"e"
|
|
473
|
-
modifierFlags:UIKeyModifierCommand
|
|
474
|
-
action:@selector(showExtraDataViewController)]
|
|
475
|
-
];
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
- (BOOL)canBecomeFirstResponder
|
|
479
|
-
{
|
|
480
|
-
return YES;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
@end
|
|
484
|
-
|
|
485
28
|
@interface RCTRedBox () <
|
|
486
29
|
RCTInvalidating,
|
|
487
30
|
RCTRedBoxControllerActionDelegate,
|
|
@@ -490,7 +33,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
|
|
490
33
|
@end
|
|
491
34
|
|
|
492
35
|
@implementation RCTRedBox {
|
|
493
|
-
|
|
36
|
+
id<RCTRedBoxControlling> _controller;
|
|
494
37
|
NSMutableArray<id<RCTErrorCustomizer>> *_errorCustomizers;
|
|
495
38
|
RCTRedBoxExtraDataViewController *_extraDataViewController;
|
|
496
39
|
NSMutableArray<NSString *> *_customButtonTitles;
|
|
@@ -622,6 +165,14 @@ RCT_EXPORT_MODULE()
|
|
|
622
165
|
[self showErrorMessage:message withParsedStack:stack isUpdate:YES errorCookie:errorCookie];
|
|
623
166
|
}
|
|
624
167
|
|
|
168
|
+
- (id<RCTRedBox2Controlling>)_redBox2Controller
|
|
169
|
+
{
|
|
170
|
+
if ([_controller conformsToProtocol:@protocol(RCTRedBox2Controlling)]) {
|
|
171
|
+
return (id<RCTRedBox2Controlling>)_controller;
|
|
172
|
+
}
|
|
173
|
+
return nil;
|
|
174
|
+
}
|
|
175
|
+
|
|
625
176
|
- (void)showErrorMessage:(NSString *)message
|
|
626
177
|
withParsedStack:(NSArray<RCTJSStackFrame *> *)stack
|
|
627
178
|
isUpdate:(BOOL)isUpdate
|
|
@@ -638,14 +189,21 @@ RCT_EXPORT_MODULE()
|
|
|
638
189
|
[[self->_moduleRegistry moduleForName:"EventDispatcher"] sendDeviceEventWithName:@"collectRedBoxExtraData"
|
|
639
190
|
body:nil];
|
|
640
191
|
#pragma clang diagnostic pop
|
|
641
|
-
if (!self->_controller) {
|
|
642
|
-
self->_controller = [[RCTRedBoxController alloc] initWithCustomButtonTitles:self->_customButtonTitles
|
|
643
|
-
customButtonHandlers:self->_customButtonHandlers];
|
|
644
|
-
self->_controller.actionDelegate = self;
|
|
645
|
-
}
|
|
646
192
|
|
|
647
193
|
RCTErrorInfo *errorInfo = [[RCTErrorInfo alloc] initWithErrorMessage:message stack:stack];
|
|
648
194
|
errorInfo = [self _customizeError:errorInfo];
|
|
195
|
+
|
|
196
|
+
if (self->_controller == nullptr) {
|
|
197
|
+
if (facebook::react::ReactNativeFeatureFlags::redBoxV2IOS()) {
|
|
198
|
+
self->_controller = [[RCTRedBox2Controller alloc] initWithCustomButtonTitles:self->_customButtonTitles
|
|
199
|
+
customButtonHandlers:self->_customButtonHandlers];
|
|
200
|
+
} else {
|
|
201
|
+
self->_controller = [[RCTRedBoxController alloc] initWithCustomButtonTitles:self->_customButtonTitles
|
|
202
|
+
customButtonHandlers:self->_customButtonHandlers];
|
|
203
|
+
}
|
|
204
|
+
self->_controller.actionDelegate = self;
|
|
205
|
+
}
|
|
206
|
+
[self _redBox2Controller].bundleURL = self->_overrideBundleURL ?: self->_bundleManager.bundleURL;
|
|
649
207
|
[self->_controller showErrorMessage:errorInfo.errorMessage
|
|
650
208
|
withStack:errorInfo.stack
|
|
651
209
|
isUpdate:isUpdate
|
|
@@ -656,9 +214,10 @@ RCT_EXPORT_MODULE()
|
|
|
656
214
|
- (void)loadExtraDataViewController
|
|
657
215
|
{
|
|
658
216
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
217
|
+
UIViewController *controller = static_cast<UIViewController *>(self->_controller);
|
|
659
218
|
// Make sure the CMD+E shortcut doesn't call this twice
|
|
660
|
-
if (self->_extraDataViewController != nil &&
|
|
661
|
-
[
|
|
219
|
+
if (self->_extraDataViewController != nil && ([controller presentedViewController] == nullptr)) {
|
|
220
|
+
[controller presentViewController:self->_extraDataViewController animated:YES completion:nil];
|
|
662
221
|
}
|
|
663
222
|
});
|
|
664
223
|
}
|
|
@@ -680,7 +239,7 @@ RCT_EXPORT_METHOD(dismiss)
|
|
|
680
239
|
[self dismiss];
|
|
681
240
|
}
|
|
682
241
|
|
|
683
|
-
- (void)redBoxController:(__unused
|
|
242
|
+
- (void)redBoxController:(__unused UIViewController *)redBoxController
|
|
684
243
|
openStackFrameInEditor:(RCTJSStackFrame *)stackFrame
|
|
685
244
|
{
|
|
686
245
|
NSURL *const bundleURL = _overrideBundleURL ?: _bundleManager.bundleURL;
|
|
@@ -707,7 +266,7 @@ RCT_EXPORT_METHOD(dismiss)
|
|
|
707
266
|
[self reloadFromRedBoxController:nil];
|
|
708
267
|
}
|
|
709
268
|
|
|
710
|
-
- (void)reloadFromRedBoxController:(__unused
|
|
269
|
+
- (void)reloadFromRedBoxController:(__unused UIViewController *)redBoxController
|
|
711
270
|
{
|
|
712
271
|
if (_overrideReloadAction) {
|
|
713
272
|
_overrideReloadAction();
|
|
@@ -0,0 +1,22 @@
|
|
|
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 <UIKit/UIKit.h>
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Parses ANSI escape sequences in text and produces an NSAttributedString
|
|
12
|
+
* with the corresponding foreground/background colors applied.
|
|
13
|
+
*
|
|
14
|
+
* Uses the Afterglow color theme (matching LogBox's AnsiHighlight.js).
|
|
15
|
+
*/
|
|
16
|
+
@interface RCTRedBox2AnsiParser : NSObject
|
|
17
|
+
|
|
18
|
+
+ (NSAttributedString *)attributedStringFromAnsiText:(NSString *)text
|
|
19
|
+
baseFont:(UIFont *)font
|
|
20
|
+
baseColor:(UIColor *)color;
|
|
21
|
+
|
|
22
|
+
@end
|
|
@@ -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
|