@depup/react-native 0.86.2-depup.0 → 0.87.1-depup.0
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/ActionSheetIOS/ActionSheetIOS.js +19 -24
- package/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec +1 -1
- package/Libraries/Alert/Alert.js +38 -1
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedExports.js +22 -0
- package/Libraries/Animated/AnimatedExports.js.flow +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +126 -5
- package/Libraries/Animated/Easing.js +4 -3
- package/Libraries/Animated/NativeAnimatedAllowlist.js +37 -0
- package/Libraries/Animated/animations/Animation.js +14 -5
- package/Libraries/Animated/animations/DecayAnimation.js +1 -0
- package/Libraries/Animated/animations/SpringAnimation.js +1 -0
- package/Libraries/Animated/animations/TimingAnimation.js +9 -0
- package/Libraries/Animated/components/AnimatedScrollView.js +1 -1
- package/Libraries/Animated/createAnimatedComponent.js +3 -3
- package/Libraries/Animated/nodes/AnimatedColor.js +8 -8
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +106 -0
- package/Libraries/Animated/nodes/AnimatedNode.js +1 -1
- package/Libraries/Animated/nodes/AnimatedProps.js +27 -3
- package/Libraries/Animated/nodes/AnimatedValue.js +10 -2
- package/Libraries/Animated/nodes/AnimatedValueXY.js +2 -2
- package/Libraries/AppDelegate/RCTAppDelegate.h +5 -9
- package/Libraries/AppDelegate/RCTAppDelegate.mm +0 -20
- package/Libraries/AppDelegate/RCTAppSetupUtils.h +0 -18
- package/Libraries/AppDelegate/RCTAppSetupUtils.mm +0 -78
- package/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +18 -21
- package/Libraries/AppDelegate/RCTReactNativeFactory.h +5 -41
- package/Libraries/AppDelegate/RCTReactNativeFactory.mm +0 -82
- package/Libraries/AppDelegate/RCTRootViewFactory.h +4 -1
- package/Libraries/AppDelegate/RCTRootViewFactory.mm +3 -101
- package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +2 -1
- package/Libraries/AppState/AppState.d.ts +4 -1
- package/Libraries/AppState/AppState.js +32 -17
- package/Libraries/BatchedBridge/MessageQueue.js +42 -51
- package/Libraries/BatchedBridge/NativeModules.js +7 -0
- package/Libraries/Blob/Blob.js +7 -1
- package/Libraries/Blob/FileReader.js +6 -0
- package/Libraries/Blob/React-RCTBlob.podspec +1 -1
- package/Libraries/Blob/URLSearchParams.js.flow +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +20 -9
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +30 -43
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +59 -49
- package/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +2 -2
- package/Libraries/Components/Button.js +98 -183
- package/Libraries/Components/Clipboard/Clipboard.js +5 -0
- package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +2 -2
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +8 -69
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +10 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js +2 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +26 -31
- package/Libraries/Components/Keyboard/Keyboard.js +23 -60
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +15 -7
- package/Libraries/Components/Pressable/Pressable.js +39 -17
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +5 -6
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +4 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +2 -2
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +17 -0
- package/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +2 -2
- package/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +2 -2
- package/Libraries/Components/RefreshControl/RefreshControl.js +40 -50
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +2 -2
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +8 -8
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +2 -2
- package/Libraries/Components/ScrollView/ScrollView.d.ts +55 -43
- package/Libraries/Components/ScrollView/ScrollView.js +205 -118
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +4 -4
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.d.ts +7 -54
- package/Libraries/Components/StatusBar/StatusBar.js +84 -160
- package/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +2 -2
- package/Libraries/Components/Switch/Switch.js +76 -75
- package/Libraries/Components/Switch/SwitchNativeComponent.js +2 -2
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +1 -1
- package/Libraries/Components/TextInput/InputAccessoryView.js +13 -61
- package/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +2 -2
- package/Libraries/Components/TextInput/TextInput.d.ts +9 -2
- package/Libraries/Components/TextInput/TextInput.flow.js +20 -3
- package/Libraries/Components/TextInput/TextInput.js +116 -111
- package/Libraries/Components/TextInput/TextInputNativeCommands.js +3 -3
- package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +25 -19
- package/Libraries/Components/Touchable/Touchable.d.ts +1 -1
- package/Libraries/Components/Touchable/Touchable.js +94 -95
- package/Libraries/Components/Touchable/TouchableHighlight.js +45 -112
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +13 -25
- package/Libraries/Components/Touchable/TouchableOpacity.js +14 -84
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +4 -3
- package/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +2 -2
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
- package/Libraries/Components/View/View.js +83 -86
- package/Libraries/Components/View/ViewAccessibility.d.ts +12 -2
- package/Libraries/Components/View/ViewAccessibility.js +17 -6
- package/Libraries/Components/View/ViewNativeComponent.js +4 -6
- package/Libraries/Components/View/ViewPropTypes.js +65 -13
- package/Libraries/Core/InitializeCore.js +9 -1
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -3
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/Timers/JSTimers.js +53 -52
- package/Libraries/Core/setUpGlobals.js +9 -4
- package/Libraries/Core/setUpNavigator.js +7 -2
- package/Libraries/Core/setUpReactDevTools.js +0 -118
- package/Libraries/Core/setUpXHR.js +6 -2
- package/Libraries/Debugging/DebuggingOverlay.js +2 -2
- package/Libraries/Debugging/DebuggingOverlayNativeComponent.js +2 -2
- package/Libraries/EventEmitter/NativeEventEmitter.js +29 -0
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +7 -7
- package/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +1 -1
- package/Libraries/EventEmitter/RCTNativeAppEventEmitter.js +3 -0
- package/Libraries/FBLazyVector/FBLazyVector.podspec +1 -1
- package/Libraries/Image/AssetSourceResolver.js +18 -27
- package/Libraries/Image/Image.android.js +13 -2
- package/Libraries/Image/Image.ios.js +3 -1
- package/Libraries/Image/ImageBackground.js +30 -18
- package/Libraries/Image/ImageProps.js +116 -117
- package/Libraries/Image/ImageSource.d.ts +1 -1
- package/Libraries/Image/ImageSource.js +9 -9
- package/Libraries/Image/ImageSourceUtils.js +10 -7
- package/Libraries/Image/ImageTypes.flow.js +2 -0
- package/Libraries/Image/ImageViewNativeComponent.js +1 -1
- package/Libraries/Image/RCTImageLoader.mm +61 -64
- package/Libraries/Image/RCTImageStoreManager.h +0 -2
- package/Libraries/Image/React-RCTImage.podspec +1 -1
- package/Libraries/Image/RelativeImageStub.js +1 -1
- package/Libraries/Image/resolveAssetSource.js +1 -1
- package/Libraries/Interaction/PanResponder.js +102 -97
- package/Libraries/LayoutAnimation/LayoutAnimation.js +22 -6
- package/Libraries/Linking/Linking.js +24 -23
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
- package/Libraries/Lists/FlatList.d.ts +6 -17
- package/Libraries/Lists/FlatList.js +7 -8
- package/Libraries/Lists/SectionList.js +7 -0
- package/Libraries/Lists/VirtualizedList.js +3 -0
- package/Libraries/Lists/VirtualizedSectionList.js +4 -0
- package/Libraries/LogBox/LogBox.js +3 -3
- package/Libraries/LogBox/UI/AnsiHighlight.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +4 -1
- package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +3 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +8 -2
- package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +9 -2
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +17 -4
- package/Libraries/LogBox/UI/LogBoxInspectorSection.js +3 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +3 -1
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +2 -0
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +4 -2
- package/Libraries/LogBox/UI/LogBoxMessage.js +18 -5
- package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +4 -1
- package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +1 -0
- package/Libraries/LogBox/UI/LogBoxStyle.js +0 -4
- package/Libraries/Modal/Modal.d.ts +5 -4
- package/Libraries/Modal/Modal.js +71 -37
- package/Libraries/Modal/RCTModalHostViewNativeComponent.js +2 -2
- package/Libraries/NativeAnimation/React-RCTAnimation.podspec +1 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +17 -0
- package/Libraries/NativeComponent/ViewConfig.js +3 -3
- package/Libraries/NativeComponent/ViewConfigIgnore.js +1 -1
- package/Libraries/Network/RCTHTTPRequestHandler.h +1 -1
- package/Libraries/Network/React-RCTNetwork.podspec +1 -1
- package/Libraries/Performance/Systrace.js +36 -0
- package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +4 -2
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +29 -17
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +4 -0
- package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
- package/Libraries/ReactNative/AppContainer-dev.js +3 -1
- package/Libraries/ReactNative/AppRegistry.flow.js +1 -0
- package/Libraries/ReactNative/AppRegistry.js +15 -11
- package/Libraries/ReactNative/AppRegistryImpl.js +57 -11
- package/Libraries/ReactNative/DisplayMode.js +1 -1
- package/Libraries/ReactNative/FabricUIManager.js +29 -26
- package/Libraries/ReactNative/I18nManager.js +20 -0
- package/Libraries/ReactNative/UIManager.js +53 -0
- package/Libraries/ReactNative/renderApplication.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +5 -126
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +5 -41
- package/Libraries/Renderer/README.md +2 -2
- package/Libraries/Renderer/shims/ReactNativeTypes.js +36 -36
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +4 -4
- package/Libraries/Required/RCTRequired.podspec +1 -1
- package/Libraries/Settings/React-RCTSettings.podspec +1 -1
- package/Libraries/Settings/Settings.ios.js +22 -0
- package/Libraries/Share/Share.js +25 -28
- package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +6 -0
- package/Libraries/StyleSheet/StyleSheet.js +42 -2
- package/Libraries/StyleSheet/StyleSheet.js.flow +1 -1
- package/Libraries/StyleSheet/StyleSheetExports.js +7 -5
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +24 -3
- package/Libraries/StyleSheet/StyleSheetTypes.js +34 -6
- package/Libraries/StyleSheet/flattenStyle.js +28 -13
- package/Libraries/StyleSheet/private/_TransformStyle.js +16 -14
- package/Libraries/Text/React-RCTText.podspec +1 -1
- package/Libraries/Text/Text.js +12 -9
- package/Libraries/Text/TextEffectNativeComponent.js +31 -0
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +0 -1
- package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +0 -1
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +0 -1
- package/Libraries/Text/TextProps.js +59 -93
- package/Libraries/Text/requireNativeTextEffect.js +28 -0
- package/Libraries/TurboModule/RCTExport.js +1 -1
- package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
- package/Libraries/Types/CoreEventTypes.d.ts +8 -0
- package/Libraries/Types/CoreEventTypes.js +32 -29
- package/Libraries/Types/UIManagerJSInterface.js +2 -2
- package/Libraries/Utilities/Appearance.d.ts +32 -17
- package/Libraries/Utilities/Appearance.js +35 -18
- package/Libraries/Utilities/BackHandler.android.js +13 -28
- package/Libraries/Utilities/BackHandler.js.flow +18 -2
- package/Libraries/Utilities/DevSettings.js +8 -1
- package/Libraries/Utilities/Dimensions.js +18 -12
- package/Libraries/Utilities/PixelRatio.js +5 -2
- package/Libraries/Utilities/Platform.js.flow +4 -0
- package/Libraries/Utilities/PlatformTypes.js +77 -0
- package/Libraries/Utilities/PolyfillFunctions.js +1 -1
- package/Libraries/Utilities/differ/deepDiffer.js +5 -2
- package/Libraries/Utilities/useColorScheme.js +11 -1
- package/Libraries/Utilities/useWindowDimensions.js +6 -0
- package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
- package/Libraries/Vibration/Vibration.js +14 -11
- package/Libraries/vendor/emitter/EventEmitter.js +3 -3
- package/README.md +7 -9
- package/React/Base/RCTBridge+Private.h +0 -22
- package/React/Base/RCTBridge.h +10 -8
- package/React/Base/RCTBridge.mm +5 -447
- package/React/Base/RCTBridgeDelegate.h +1 -56
- package/React/Base/RCTBridgeModule.h +0 -9
- package/React/Base/RCTBridgeProxy.h +8 -0
- package/React/Base/RCTBridgeProxy.mm +3 -20
- package/React/Base/RCTBundleManager.h +0 -3
- package/React/Base/RCTBundleManager.m +0 -31
- package/React/Base/RCTBundleURLProvider.mm +4 -4
- package/React/Base/RCTCallableJSModules.m +0 -18
- package/React/Base/RCTConstants.h +1 -0
- package/React/Base/RCTConstants.m +1 -0
- package/React/Base/RCTConvert.mm +3 -0
- package/React/Base/RCTDisplayLink.h +3 -1
- package/React/Base/RCTJavaScriptExecutor.h +0 -69
- package/React/Base/RCTModuleData.mm +2 -483
- package/React/Base/RCTModuleRegistry.m +0 -25
- package/React/Base/RCTRootView.m +3 -374
- package/React/Base/RCTUtils.h +0 -3
- package/React/Base/RCTUtils.mm +17 -27
- package/React/Base/RCTVersion.m +2 -2
- package/React/Base/RCTViewRegistry.m +1 -29
- package/React/Base/Surface/RCTSurface.mm +1 -582
- package/React/Base/Surface/RCTSurfaceRootShadowView.m +0 -89
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +0 -1
- package/React/CoreModules/PlatformStubs/RCTStatusBarManager.mm +0 -2
- package/React/CoreModules/RCTAlertController.mm +1 -0
- package/React/CoreModules/RCTAlertManager.mm +0 -5
- package/React/CoreModules/RCTLogBox.mm +0 -11
- package/React/CoreModules/RCTLogBoxView.h +0 -3
- package/React/CoreModules/RCTLogBoxView.mm +0 -31
- package/React/CoreModules/RCTPerfMonitor.mm +0 -2
- package/React/CoreModules/RCTStatusBarManager.mm +0 -11
- package/React/CoreModules/React-CoreModules.podspec +1 -1
- package/React/CxxModule/RCTCxxUtils.h +0 -8
- package/React/CxxModule/RCTCxxUtils.mm +0 -17
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +179 -7
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +100 -2
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +373 -119
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.cpp +1 -1
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.h +1 -1
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.cpp +71 -71
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.h +96 -96
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.cpp +357 -363
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.h +211 -212
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/RCTComponentViewHelpers.h +107 -107
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.cpp +1 -1
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.h +11 -11
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/States.h +2 -2
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +4 -0
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +4 -0
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +4 -0
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +5 -0
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +0 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +14 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +13 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTVirtualViewContainerState.mm +12 -26
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +39 -4
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +5 -5
- package/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm +0 -18
- package/React/Fabric/Mounting/RCTComponentViewFactory.mm +9 -5
- package/React/Fabric/RCTSurfacePresenter.mm +86 -5
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +2 -0
- package/React/I18n/RCTLocalizedString.mm +38 -2
- package/React/Modules/RCTEventEmitter.m +30 -10
- package/React/Modules/RCTI18nUtil.m +3 -1
- package/React/Modules/RCTUIManager.mm +0 -1501
- package/React/React-RCTFBReactNativeSpec.podspec +2 -2
- package/React/React-RCTFabric.podspec +1 -1
- package/React/Runtime/React-RCTRuntime.podspec +1 -1
- package/React/Tests/Text/RCTAttributedTextUtilsTest.mm +27 -0
- package/React/Views/RCTModalHostViewController.h +0 -15
- package/React/Views/RCTModalHostViewManager.h +0 -24
- package/React/Views/RCTShadowView.h +0 -2
- package/React/Views/RCTShadowView.m +0 -723
- package/React/Views/ScrollView/RCTScrollView.h +0 -81
- package/React/Views/ScrollView/RCTScrollableProtocol.h +0 -4
- package/React-Core-prebuilt.podspec +45 -17
- package/React-Core.podspec +10 -3
- package/React.podspec +1 -1
- package/ReactAndroid/api/ReactAndroid.api +128 -142
- package/ReactAndroid/build.gradle.kts +27 -22
- package/ReactAndroid/external-artifacts/build.gradle.kts +49 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/hermes-engine/build.gradle.kts +14 -14
- package/ReactAndroid/publish.gradle +5 -5
- package/ReactAndroid/src/debug/AndroidManifest.xml +6 -0
- package/ReactAndroid/src/debugOptimized/AndroidManifest.xml +22 -0
- package/ReactAndroid/src/main/java/com/facebook/react/BaseReactPackage.kt +3 -7
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt +4 -6
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +0 -3
- package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.kt +212 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +0 -16
- package/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt +6 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.kt +287 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ColorPropConverter.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +15 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/interop/InteropModuleRegistry.kt +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/common/build/ReactBuildConfig.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/MapBuffer.kt +50 -2
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt +63 -22
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt +33 -0
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +4 -12
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactActivityDelegate.kt +14 -10
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BundleDownloader.kt +50 -47
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.kt +0 -4
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerFactory.kt +10 -10
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/LocalNetworkPermissionUtil.kt +49 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/MultipartStreamReader.kt +101 -26
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +40 -38
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManagerBinding.kt +1 -10
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManagerProviderImpl.kt +0 -3
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/ViewTransitionSnapshotManager.kt +15 -11
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.kt +7 -13
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt +160 -187
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/SynchronousMountItem.kt +12 -8
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +30 -66
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +51 -111
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +11 -23
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +12 -24
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +57 -123
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android.kt +7 -5
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt +3 -5
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +11 -23
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlags.kt +0 -24
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlagsDefaults.kt +0 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.kt +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt +50 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.kt +8 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt +53 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt +2 -77
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.kt +9 -4
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +4 -19
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.kt +2 -6
- package/ReactAndroid/src/main/java/com/facebook/react/touch/ReactInterceptingViewGroup.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +47 -10
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/DisplayMetricsHolder.kt +1 -49
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/HasChildPressedStateDelay.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.kt +796 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt +2 -4
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.kt +27 -27
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.kt +184 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.kt +486 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +8 -8
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ShadowNodeRegistry.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/SkewMatrixHelper.kt +200 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ThemedReactContext.kt +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.kt +6 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.kt +7 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.kt +645 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.kt +2 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.kt +142 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupManager.kt +0 -10
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.kt +527 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderRadiusStyle.kt +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/ColorStop.kt +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/util/AndroidVersion.kt +7 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayout.kt +8 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.kt +0 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/safeareaview/ReactSafeAreaView.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.kt +1640 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.kt +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.kt +1317 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollViewManager.kt +8 -8
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.kt +1309 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.kt +7 -7
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt +19 -33
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt +8 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/generate-nested-scroll-view.js +13 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.kt +7 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/MutableSpannableLayout.kt +107 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt +122 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +92 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTypefaceUtils.kt +41 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt +48 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextDecorationStyle.kt +200 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextEffectRegistry.kt +45 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextEffectSpanFactory.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt +361 -15
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/AnimatedEffectSpan.kt +37 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/{DrawCommandSpan.kt → CanvasEffectSpan.kt} +3 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/CustomStyleSpan.kt +23 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactStrikethroughSpan.kt +30 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactUnderlineSpan.kt +25 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/SetSpanOperation.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/StatefulSpan.kt +21 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TextEffectSpan.kt +19 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TouchableSpan.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +83 -11
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +6 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextSelectionWatcher.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +3 -17
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/WindowUtil.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/VirtualViewRenderState.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt +7 -8
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.kt +45 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.kt +15 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIBase.kt +6 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.kt +31 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.kt +41 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.kt +37 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.kt +31 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.kt +33 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.kt +43 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.kt +39 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureMode.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNative.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.kt +12 -2
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.kt +762 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIFinalizer.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaProps.kt +24 -2
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.kt +37 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.kt +29 -0
- package/ReactAndroid/src/main/jni/CMakeLists.txt +1 -2
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp +94 -0
- package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionDelegateImpl.cpp +3 -0
- package/ReactAndroid/src/main/jni/react/fabric/AndroidAnimationChoreographer.h +10 -10
- package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +3 -0
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +12 -15
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.h +1 -3
- package/ReactAndroid/src/main/jni/react/fabric/test/FabricMountingManagerTest.cpp +159 -0
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +69 -153
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +15 -33
- package/ReactAndroid/src/main/jni/react/jni/JReactMarker.cpp +10 -24
- package/ReactAndroid/src/main/jni/react/jni/JReactMarker.h +0 -2
- package/ReactAndroid/src/main/jni/react/mapbuffer/react/common/mapbuffer/JWritableMapBuffer.cpp +13 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp +4 -1
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.cpp +8 -0
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.h +4 -0
- package/ReactAndroid/src/main/res/views/uimanager/values/ids.xml +5 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-zu/strings.xml +3 -0
- package/ReactApple/Libraries/RCTFoundation/RCTDeprecation/RCTDeprecation.podspec +1 -1
- package/ReactApple/RCTAnimatedModuleProvider/React-RCTAnimatedModuleProvider.podspec +63 -0
- package/ReactApple/RCTSwiftUI/RCTSwiftUI.podspec +1 -1
- package/ReactApple/RCTSwiftUIWrapper/RCTSwiftUIWrapper.podspec +1 -1
- package/ReactCommon/React-Fabric.podspec +3 -1
- package/ReactCommon/React-FabricComponents.podspec +1 -1
- package/ReactCommon/React-FabricImage.podspec +1 -1
- package/ReactCommon/React-Mapbuffer.podspec +1 -1
- package/ReactCommon/ReactCommon.podspec +3 -13
- package/ReactCommon/callinvoker/React-callinvoker.podspec +1 -1
- package/ReactCommon/cmake-utils/react-native-flags.cmake +1 -3
- package/ReactCommon/cxxreact/CMakeLists.txt +1 -0
- package/ReactCommon/cxxreact/ErrorUtils.h +2 -32
- package/ReactCommon/cxxreact/Instance.cpp +1 -26
- package/ReactCommon/cxxreact/Instance.h +0 -2
- package/ReactCommon/cxxreact/NativeToJsBridge.cpp +3 -2
- package/ReactCommon/cxxreact/RAMBundleRegistry.cpp +0 -12
- package/ReactCommon/cxxreact/RAMBundleRegistry.h +0 -5
- package/ReactCommon/cxxreact/React-cxxreact.podspec +3 -2
- package/ReactCommon/cxxreact/ReactMarker.cpp +4 -30
- package/ReactCommon/cxxreact/ReactMarker.h +38 -21
- package/ReactCommon/cxxreact/ReactNativeVersion.h +4 -4
- package/ReactCommon/cxxreact/TraceSection.h +1 -1
- package/ReactCommon/cxxreact/tests/methodcall.cpp +4 -0
- package/ReactCommon/hermes/React-hermes.podspec +1 -1
- package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +6 -79
- package/ReactCommon/hermes/executor/React-jsitracing.podspec +1 -1
- package/ReactCommon/jserrorhandler/ErrorUtils.cpp +42 -0
- package/{React/CxxLogUtils/RCTDefaultCxxLogFunction.h → ReactCommon/jserrorhandler/ErrorUtils.h} +2 -2
- package/ReactCommon/jserrorhandler/JsErrorHandler.cpp +1 -1
- package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +3 -4
- package/ReactCommon/jsi/React-jsi.podspec +1 -1
- package/ReactCommon/jsi/jsi/hermes-interfaces.h +53 -0
- package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +3 -2
- package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +3 -14
- package/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +4 -13
- package/ReactCommon/jsinspector-modern/HostAgent.cpp +54 -0
- package/ReactCommon/jsinspector-modern/HostTarget.h +0 -7
- package/ReactCommon/jsinspector-modern/HostTargetTraceRecording.cpp +10 -7
- package/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp +4 -1
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +1 -1
- package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +7 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +20 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.h +16 -0
- package/ReactCommon/jsinspector-modern/SessionState.h +31 -0
- package/ReactCommon/jsinspector-modern/cdp/React-jsinspectorcdp.podspec +1 -1
- package/ReactCommon/jsinspector-modern/network/React-jsinspectornetwork.podspec +1 -1
- package/ReactCommon/jsinspector-modern/tests/HostTargetTest.cpp +53 -0
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfile.h +14 -1
- package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +1 -1
- package/ReactCommon/jsinspector-modern/tracing/TraceRecordingState.h +11 -0
- package/ReactCommon/jsitooling/React-jsitooling.podspec +1 -1
- package/ReactCommon/logger/React-logger.podspec +1 -1
- package/ReactCommon/oscompat/React-oscompat.podspec +1 -1
- package/ReactCommon/react/bridging/ArrayBuffer.h +180 -0
- package/ReactCommon/react/bridging/Bridging.h +1 -0
- package/ReactCommon/react/bridging/Convert.h +12 -0
- package/ReactCommon/react/bridging/React-bridging.podspec +44 -0
- package/ReactCommon/react/bridging/tests/BridgingTest.cpp +185 -11
- package/ReactCommon/react/bridging/tests/ClassTest.cpp +22 -0
- package/ReactCommon/react/cxxstableapi/CMakeLists.txt +18 -0
- package/ReactCommon/react/cxxstableapi/FrameworksGuard.h +35 -0
- package/ReactCommon/react/cxxstableapi/PrivateGuard.h +34 -0
- package/ReactCommon/react/cxxstableapi/React-cxxstableapi.podspec +34 -0
- package/ReactCommon/react/cxxstableapi/UmbrellaGuard.h +53 -0
- package/ReactCommon/react/debug/React-debug.podspec +1 -1
- package/ReactCommon/react/debug/redbox/JscSafeUrl.h +1 -1
- package/ReactCommon/react/featureflags/React-featureflags.podspec +1 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +21 -45
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +26 -56
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +134 -242
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +14 -26
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +20 -44
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +43 -97
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +10 -6
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +3 -7
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h +0 -8
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +7 -13
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h +1 -0
- package/ReactCommon/react/nativemodule/core/iostests/RCTTurboModuleTests.mm +49 -0
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.cpp +4 -0
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.h +4 -0
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +2 -2
- package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +2 -2
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.h +4 -0
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +5 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +61 -4
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h +0 -9
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +37 -139
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleWithJSIBindings.h +0 -3
- package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +6 -0
- package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/dom/NativeDOM.cpp +10 -4
- package/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +2 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +25 -55
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +11 -23
- package/ReactCommon/react/nativemodule/featureflags/React-featureflagsnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +2 -1
- package/ReactCommon/react/nativemodule/intersectionobserver/React-intersectionobservernativemodule.podspec +2 -1
- package/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.cpp +4 -0
- package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec +2 -1
- package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -1
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.h +1 -1
- package/ReactCommon/react/nativemodule/viewtransition/React-viewtransitionnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/webperformance/React-webperformancenativemodule.podspec +2 -1
- package/ReactCommon/react/networking/React-networking.podspec +1 -1
- package/ReactCommon/react/performance/cdpmetrics/React-performancecdpmetrics.podspec +1 -1
- package/ReactCommon/react/performance/timeline/React-performancetimeline.podspec +1 -1
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +95 -63
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.h +20 -1
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.cpp +7 -10
- package/ReactCommon/react/renderer/animated/drivers/FrameAnimationDriver.cpp +20 -1
- package/ReactCommon/react/renderer/animated/drivers/FrameAnimationDriver.h +1 -0
- package/ReactCommon/react/renderer/animated/internal/primitives.h +1 -1
- package/ReactCommon/react/renderer/animated/nodes/InterpolationAnimatedNode.cpp +67 -6
- package/ReactCommon/react/renderer/animated/nodes/InterpolationAnimatedNode.h +12 -0
- package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.cpp +25 -13
- package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.h +7 -0
- package/ReactCommon/react/renderer/animated/tests/AnimationDriverTests.cpp +48 -0
- package/ReactCommon/react/renderer/animated/tests/DecayAnimationDriverTest.cpp +245 -0
- package/ReactCommon/react/renderer/animated/tests/ManagedPropsMountingOverrideTests.cpp +204 -0
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.cpp +10 -1
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h +1 -0
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +17 -0
- package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +0 -2
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +6 -2
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +25 -1
- package/ReactCommon/react/renderer/attributedstring/conversions.h +29 -1
- package/ReactCommon/react/renderer/attributedstring/primitives.h +4 -2
- package/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp +73 -0
- package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +6 -0
- package/ReactCommon/react/renderer/components/image/ImageProps.cpp +79 -126
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.cpp +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropState.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.cpp +5 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.cpp +5 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticShadowNode.cpp +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticShadowNode.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerInteropComponentDescriptor.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +5 -0
- package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.cpp +235 -352
- package/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.cpp +30 -46
- package/ReactCommon/react/renderer/components/text/BaseParagraphProps.cpp +17 -27
- package/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +8 -10
- package/ReactCommon/react/renderer/components/text/BaseTextShadowNode.cpp +19 -0
- package/ReactCommon/react/renderer/components/text/TextEffectComponentDescriptor.h +17 -0
- package/ReactCommon/react/renderer/components/text/TextEffectProps.cpp +59 -0
- package/ReactCommon/react/renderer/components/text/TextEffectProps.h +30 -0
- package/{Libraries/Text/VirtualText/RCTVirtualTextView.mm → ReactCommon/react/renderer/components/text/TextEffectShadowNode.cpp} +4 -6
- package/ReactCommon/react/renderer/components/text/TextEffectShadowNode.h +26 -0
- package/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/HostPlatformParagraphProps.cpp +18 -28
- package/ReactCommon/react/renderer/components/text/tests/BaseTextShadowNodeTest.cpp +15 -0
- package/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp +42 -50
- package/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +168 -754
- package/ReactCommon/react/renderer/components/view/AccessibilityProps.h +0 -9
- package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +248 -312
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +0 -6
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +2 -12
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +73 -27
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.h +7 -9
- package/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +3 -11
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +82 -162
- package/ReactCommon/react/renderer/components/view/primitives.h +5 -0
- package/ReactCommon/react/renderer/components/view/propsConversions.h +74 -42
- package/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp +5 -5
- package/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp +353 -6
- package/ReactCommon/react/renderer/consistency/React-rendererconsistency.podspec +1 -1
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +41 -16
- package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +19 -0
- package/ReactCommon/react/renderer/core/EventEmitter.cpp +20 -4
- package/ReactCommon/react/renderer/core/LayoutMetrics.h +3 -0
- package/ReactCommon/react/renderer/core/Props.cpp +8 -39
- package/ReactCommon/react/renderer/core/Props.h +63 -13
- package/ReactCommon/react/renderer/core/RawProps.cpp +20 -3
- package/ReactCommon/react/renderer/core/RawProps.h +44 -0
- package/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +11 -27
- package/ReactCommon/react/renderer/core/RawPropsKeyMap.h +3 -3
- package/ReactCommon/react/renderer/core/RawPropsParser.cpp +4 -6
- package/ReactCommon/react/renderer/core/RawPropsParser.h +3 -3
- package/ReactCommon/react/renderer/core/StateData.h +4 -4
- package/ReactCommon/react/renderer/core/propsConversions.h +3 -7
- package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +8 -0
- package/ReactCommon/react/renderer/core/tests/FindNodeAtPointTest.cpp +7 -7
- package/ReactCommon/react/renderer/core/tests/LayoutableShadowNodeTest.cpp +19 -19
- package/ReactCommon/react/renderer/core/tests/PropsConceptsTest.cpp +135 -0
- package/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp +43 -53
- package/ReactCommon/react/renderer/css/React-renderercss.podspec +1 -1
- package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +1 -1
- package/ReactCommon/react/renderer/element/tests/ElementTest.cpp +3 -3
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/conversions.h +17 -0
- package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTSyncImageManager.mm +1 -1
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +123 -33
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.h +26 -14
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +96 -53
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h +4 -0
- package/ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp +96 -1
- package/ReactCommon/react/renderer/mounting/Differentiator.cpp +29 -318
- package/ReactCommon/react/renderer/mounting/ShadowTree.cpp +105 -33
- package/ReactCommon/react/renderer/mounting/ShadowTree.h +2 -0
- package/ReactCommon/react/renderer/mounting/internal/CullingContext.cpp +1 -1
- package/ReactCommon/react/renderer/mounting/tests/DifferentiatorUnflattenTest.cpp +11 -3
- package/ReactCommon/react/renderer/mounting/tests/OrderIndexTest.cpp +1 -1
- package/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +15 -250
- package/ReactCommon/react/renderer/mounting/tests/ShadowTreeReactBranchingTest.cpp +141 -0
- package/ReactCommon/react/renderer/mounting/tests/StackingContextTest.cpp +1 -1
- package/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt +1 -0
- package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +2 -1
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +22 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +13 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.cpp +13 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.h +9 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp +43 -5
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.h +17 -1
- package/ReactCommon/react/renderer/runtimescheduler/Task.h +4 -0
- package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +113 -8
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +14 -6
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +3 -2
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +1 -85
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +0 -6
- package/ReactCommon/react/renderer/scheduler/tests/SchedulerDelegateInvalidationTest.cpp +671 -0
- package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +22 -5
- package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +4 -2
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +11 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +65 -26
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +193 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h +14 -2
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/TextLayoutManager.mm +2 -1
- package/ReactCommon/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp +86 -5
- package/ReactCommon/react/renderer/uimanager/UIManager.cpp +31 -41
- package/ReactCommon/react/renderer/uimanager/UIManager.h +2 -2
- package/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h +1 -1
- package/ReactCommon/react/renderer/uimanager/tests/FindShadowNodeByTagTest.cpp +1 -52
- package/ReactCommon/react/renderer/uimanager/tests/PointerEventsProcessorTest.cpp +4 -4
- package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.cpp +88 -39
- package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.h +12 -2
- package/ReactCommon/react/runtime/PlatformTimerRegistry.h +10 -0
- package/ReactCommon/react/runtime/React-RuntimeCore.podspec +1 -1
- package/ReactCommon/react/runtime/React-RuntimeHermes.podspec +1 -1
- package/ReactCommon/react/runtime/ReactInstance.cpp +79 -64
- package/ReactCommon/react/runtime/hermes/HermesInstance.cpp +0 -89
- package/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm +99 -0
- package/ReactCommon/react/runtime/iostests/RCTInstanceTests.mm +244 -0
- package/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec +1 -1
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/ObjCTimerRegistry.h +1 -1
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +47 -30
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTJscInstance.mm +3 -2
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTPerformanceLoggerUtils.mm +3 -2
- package/ReactCommon/react/runtime/tests/cxx/ReactInstanceTest.cpp +27 -3
- package/ReactCommon/react/runtime/tests/cxx/RuntimeExecutorShutdownTest.cpp +155 -0
- package/ReactCommon/react/timing/React-timing.podspec +1 -1
- package/ReactCommon/react/utils/React-utils.podspec +1 -1
- package/ReactCommon/react/utils/Telemetry.h +0 -13
- package/ReactCommon/react/utils/tests/Base64Tests.cpp +36 -0
- package/ReactCommon/reactperflogger/React-perflogger.podspec +1 -1
- package/ReactCommon/reactperflogger/reactperflogger/ReactPerfettoLogger.cpp +0 -1
- package/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +1 -1
- package/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm +21 -38
- package/ReactCommon/yoga/Yoga.podspec +2 -2
- package/ReactCommon/yoga/yoga/YGEnums.cpp +2 -0
- package/ReactCommon/yoga/yoga/YGEnums.h +1 -0
- package/ReactCommon/yoga/yoga/YGNode.cpp +27 -0
- package/ReactCommon/yoga/yoga/YGNode.h +69 -0
- package/ReactCommon/yoga/yoga/YGNodeLayout.h +0 -2
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +283 -10
- package/ReactCommon/yoga/yoga/config/Config.h +1 -1
- package/ReactCommon/yoga/yoga/enums/Errata.h +1 -0
- package/ReactCommon/yoga/yoga/node/LayoutResults.h +8 -0
- package/ReactCommon/yoga/yoga/node/Node.cpp +32 -0
- package/ReactCommon/yoga/yoga/node/Node.h +33 -0
- package/changes.json +6 -14
- package/cli.js +3 -182
- package/flow/bom.js.flow +42 -42
- package/flow/cssom.js.flow +21 -21
- package/flow/dom.js.flow +128 -128
- package/flow/global.js +6 -0
- package/gradle/libs.versions.toml +7 -5
- package/index.js +53 -86
- package/index.js.flow +53 -23
- package/package.json +47 -66
- package/react-native.config.js +82 -1
- package/scripts/cocoapods/fabric.rb +1 -1
- package/scripts/cocoapods/jsengine.rb +1 -1
- package/scripts/cocoapods/new_architecture.rb +1 -1
- package/scripts/cocoapods/rncore.rb +36 -78
- package/scripts/cocoapods/rncore_facades.rb +232 -0
- package/scripts/cocoapods/rndependencies.rb +83 -16
- package/scripts/cocoapods/rndeps_facades.rb +193 -0
- package/scripts/cocoapods/spm.rb +79 -12
- package/scripts/cocoapods/utils.rb +7 -9
- package/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js +0 -1
- package/scripts/codegen/templates/Package.swift.spm-template +97 -0
- package/scripts/codegen/templates/ReactAppDependencyProvider.podspec.template +1 -1
- package/scripts/codegen/templates/ReactCodegen.podspec.template +2 -2
- package/scripts/hermes/hermes-utils.js +27 -58
- package/scripts/ios-configure-glog.sh +1 -1
- package/scripts/react-native-xcode.sh +20 -0
- package/scripts/react_native_pods.rb +71 -21
- package/scripts/react_native_pods_utils/script_phases.sh +4 -3
- package/scripts/replace-rncore-version.js +75 -88
- package/scripts/setup-apple-spm.js +1283 -0
- package/scripts/spm/autolinking-plugins.js +411 -0
- package/scripts/spm/download-spm-artifacts.js +1467 -0
- package/scripts/spm/expand-spm-dependencies.js +435 -0
- package/scripts/spm/flavored-frameworks.js +1008 -0
- package/scripts/spm/generate-spm-autolinking-config.js +221 -0
- package/scripts/spm/generate-spm-autolinking.js +2005 -0
- package/scripts/spm/generate-spm-package.js +314 -0
- package/scripts/spm/generate-spm-xcodeproj.js +2790 -0
- package/scripts/spm/read-podspec.js +695 -0
- package/scripts/spm/scaffold-package-swift.js +1247 -0
- package/scripts/spm/spm-pbxproj.js +784 -0
- package/scripts/spm/spm-types.js +546 -0
- package/scripts/spm/spm-utils.js +760 -0
- package/scripts/spm/sync-spm-autolinking.js +160 -0
- package/sdks/.hermesv1version +1 -1
- package/sdks/hermes-engine/hermes-engine.podspec +9 -39
- package/sdks/hermes-engine/hermes-utils.rb +19 -73
- package/sdks/hermes-engine/utils/replace_hermes_version.js +18 -4
- package/sdks/hermes-engine/version.properties +1 -2
- package/settings.gradle.kts +0 -43
- package/src/asset-registry.js +29 -0
- package/src/private/animated/NativeAnimatedHelper.js +45 -21
- package/src/private/assets/AssetRegistry.js +52 -0
- package/src/private/{specs_DEPRECATED/components → components/activityindicator/specs}/ActivityIndicatorViewNativeComponent.js +5 -5
- package/src/private/{specs_DEPRECATED/components → components/debuggingoverlay/specs}/DebuggingOverlayNativeComponent.js +8 -8
- package/src/private/{specs_DEPRECATED/components → components/drawerlayoutandroid/specs}/AndroidDrawerLayoutNativeComponent.js +8 -8
- package/src/private/{specs_DEPRECATED/components → components/inputaccessoryview/specs}/RCTInputAccessoryViewNativeComponent.js +4 -4
- package/src/private/{specs_DEPRECATED/components → components/modal/specs}/RCTModalHostViewNativeComponent.js +4 -9
- package/src/private/{specs_DEPRECATED/components → components/progressbarandroid/specs}/ProgressBarAndroidNativeComponent.js +5 -5
- package/src/private/{specs_DEPRECATED/components → components/refreshcontrol/specs}/AndroidSwipeRefreshLayoutNativeComponent.js +7 -7
- package/src/private/{specs_DEPRECATED/components → components/refreshcontrol/specs}/PullToRefreshViewNativeComponent.js +7 -7
- package/src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js +2 -2
- package/src/private/{specs_DEPRECATED/components → components/safeareaview/specs}/RCTSafeAreaViewNativeComponent.js +3 -3
- package/src/private/components/scrollview/HScrollViewNativeComponents.js +1 -1
- package/src/private/{specs_DEPRECATED/components → components/scrollview/specs}/AndroidHorizontalScrollContentViewNativeComponent.js +3 -3
- package/src/private/{specs_DEPRECATED/components → components/switch/specs}/AndroidSwitchNativeComponent.js +7 -7
- package/src/private/{specs_DEPRECATED/components → components/switch/specs}/SwitchNativeComponent.js +10 -7
- package/src/private/{specs_DEPRECATED/components → components/unimplementedview/specs}/UnimplementedNativeViewNativeComponent.js +4 -4
- package/src/private/components/virtualcollection/Virtual.js +5 -5
- package/src/private/components/virtualcollection/VirtualCollectionView.js +2 -6
- package/src/private/components/virtualcollection/column/VirtualColumn.js +1 -1
- package/src/private/components/virtualcollection/row/VirtualRow.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/Inspector.js +3 -1
- package/src/private/devsupport/devmenu/specs/NativeDevMenu.js +4 -4
- package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +4 -2
- package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsSettingsManager.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +46 -70
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +88 -94
- package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -2
- package/src/private/renderer/events/ReactNativeResponder.js +49 -4
- package/src/private/renderer/events/ResponderTouchHistoryStore.js +11 -2
- package/src/private/renderer/events/dispatchNativeEvent.js +71 -36
- package/src/private/setup/setUpDOM.js +19 -9
- package/src/private/setup/setUpIntersectionObserver.js +7 -0
- package/src/private/setup/setUpMutationObserver.js +3 -1
- package/src/private/specs_DEPRECATED/modules/NativeAccessibilityInfo.js +9 -9
- package/src/private/specs_DEPRECATED/modules/NativeAccessibilityManager.js +24 -24
- package/src/private/specs_DEPRECATED/modules/NativeActionSheetManager.js +28 -28
- package/src/private/specs_DEPRECATED/modules/NativeAlertManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +45 -25
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedTurboModule.js +44 -24
- package/src/private/specs_DEPRECATED/modules/NativeAppState.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeAppearance.js +8 -6
- package/src/private/specs_DEPRECATED/modules/NativeBlobModule.js +7 -7
- package/src/private/specs_DEPRECATED/modules/NativeClipboard.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeDevLoadingView.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeDevSettings.js +11 -11
- package/src/private/specs_DEPRECATED/modules/NativeDeviceEventManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.js +7 -7
- package/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeFileReaderModule.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeFrameRateLogger.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeHeadlessJsTaskSupport.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeI18nManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeImageEditor.js +13 -13
- package/src/private/specs_DEPRECATED/modules/NativeImageLoaderAndroid.js +9 -6
- package/src/private/specs_DEPRECATED/modules/NativeImageLoaderIOS.js +6 -6
- package/src/private/specs_DEPRECATED/modules/NativeImageStoreAndroid.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeImageStoreIOS.js +8 -5
- package/src/private/specs_DEPRECATED/modules/NativeIntentAndroid.js +5 -5
- package/src/private/specs_DEPRECATED/modules/NativeJSCHeapCapture.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeKeyboardObserver.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeLinkingManager.js +6 -6
- package/src/private/specs_DEPRECATED/modules/NativeLogBox.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeModalManager.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeNetworkingAndroid.js +5 -5
- package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +6 -6
- package/src/private/specs_DEPRECATED/modules/NativePermissionsAndroid.js +6 -4
- package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsAndroid.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsIOS.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativePushNotificationManagerIOS.js +35 -31
- package/src/private/specs_DEPRECATED/modules/NativeRedBox.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +24 -24
- package/src/private/specs_DEPRECATED/modules/NativeSegmentFetcher.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeSettingsManager.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeShareModule.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeSoundManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeSourceCode.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeStatusBarManagerAndroid.js +5 -17
- package/src/private/specs_DEPRECATED/modules/NativeStatusBarManagerIOS.js +10 -15
- package/src/private/specs_DEPRECATED/modules/NativeTiming.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeToastAndroid.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +35 -22
- package/src/private/specs_DEPRECATED/modules/NativeVibration.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeWebSocketModule.js +7 -7
- package/src/private/types/HostInstance.js +38 -80
- package/src/private/viewtransition/specs/NativeViewTransition.js +6 -4
- package/src/private/webapis/dom/abort-api/AbortController.js +92 -0
- package/src/private/webapis/dom/abort-api/AbortSignal.js +243 -0
- package/src/private/webapis/dom/events/CustomEvent.js +1 -1
- package/src/private/webapis/dom/events/Event.js +12 -12
- package/src/private/webapis/dom/events/EventTarget.js +146 -37
- package/src/private/webapis/dom/events/internals/EventInternals.js +36 -0
- package/src/private/webapis/dom/events/internals/EventTargetInternals.js +38 -3
- package/src/private/webapis/dom/nodes/ReactNativeDocument.js +11 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +105 -4
- package/src/private/webapis/dom/nodes/ReadOnlyCharacterData.js +11 -0
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +9 -0
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +34 -7
- package/src/private/webapis/dom/nodes/ReadOnlyText.js +33 -0
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +46 -42
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +12 -0
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js.flow +4 -2
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +10 -0
- package/src/private/webapis/dom/oldstylecollections/NodeList.js.flow +4 -3
- package/src/private/webapis/errors/DOMException.js +50 -50
- package/src/private/webapis/geometry/DOMRectList.js +12 -0
- package/src/private/webapis/geometry/DOMRectList.js.flow +3 -1
- package/src/private/webapis/html/events/MessageEvent.js +3 -3
- package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +2 -2
- package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +13 -0
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +3 -7
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +5 -5
- package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +1 -1
- package/src/private/webapis/mutationobserver/MutationObserver.js +7 -7
- package/src/private/webapis/mutationobserver/MutationRecord.js +12 -0
- package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +5 -7
- package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +5 -5
- package/src/private/webapis/performance/EventTiming.js +3 -3
- package/src/private/webapis/performance/PerformanceEntry.js +3 -3
- package/src/private/webapis/performance/PerformanceObserver.js +4 -4
- package/src/private/webapis/performance/ResourceTiming.js +13 -13
- package/src/private/webapis/performance/UserTiming.js +3 -3
- package/src/private/webapis/performance/internals/Utilities.js +1 -1
- package/src/private/webapis/performance/specs/NativePerformance.js +26 -20
- package/src/private/webapis/utils/ArrayLikeUtils.js +1 -1
- package/src/private/webapis/websockets/events/CloseEvent.js +3 -3
- package/src/private/webapis/xhr/events/ProgressEvent.js +3 -3
- package/src/react-private-interface.js +145 -0
- package/src/react-private-interface.js.flow +48 -0
- package/src/setup-env.js +22 -0
- package/src/types/globals.d.ts +35 -3
- package/src/unstable-internals-do-not-use.d.ts +214 -0
- package/src/unstable-internals-do-not-use.js +76 -0
- package/third-party-podspecs/RCT-Folly.podspec +1 -1
- package/third-party-podspecs/ReactNativeDependencies.podspec +3 -3
- package/third-party-podspecs/glog.podspec +1 -1
- package/types/index.d.ts +0 -1
- package/types/public/DeprecatedPropertiesAlias.d.ts +0 -4
- package/types/public/ReactNativeTypes.d.ts +6 -4
- package/types_generated/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +26 -31
- package/types_generated/Libraries/Alert/Alert.d.ts +44 -7
- package/types_generated/Libraries/Animated/AnimatedEvent.d.ts +2 -2
- package/types_generated/Libraries/Animated/AnimatedExports.d.ts +2 -2
- package/types_generated/Libraries/Animated/AnimatedImplementation.d.ts +108 -4
- package/types_generated/Libraries/Animated/Easing.d.ts +5 -4
- package/types_generated/Libraries/Animated/animations/Animation.d.ts +7 -7
- package/types_generated/Libraries/Animated/animations/DecayAnimation.d.ts +5 -5
- package/types_generated/Libraries/Animated/animations/SpringAnimation.d.ts +49 -49
- package/types_generated/Libraries/Animated/animations/TimingAnimation.d.ts +13 -13
- package/types_generated/Libraries/Animated/components/AnimatedFlatList.d.ts +3 -3
- package/types_generated/Libraries/Animated/components/AnimatedScrollView.d.ts +2 -2
- package/types_generated/Libraries/Animated/components/AnimatedSectionList.d.ts +3 -3
- package/types_generated/Libraries/Animated/createAnimatedComponent.d.ts +4 -4
- package/types_generated/Libraries/Animated/nodes/AnimatedColor.d.ts +2 -2
- package/types_generated/Libraries/Animated/nodes/AnimatedInterpolation.d.ts +9 -9
- package/types_generated/Libraries/Animated/nodes/AnimatedNode.d.ts +6 -3
- package/types_generated/Libraries/Animated/nodes/AnimatedValue.d.ts +3 -3
- package/types_generated/Libraries/AppState/AppState.d.ts +41 -22
- package/types_generated/Libraries/BatchedBridge/NativeModules.d.ts +8 -1
- package/types_generated/Libraries/Blob/BlobTypes.d.ts +4 -4
- package/types_generated/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +37 -46
- package/types_generated/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +92 -43
- package/types_generated/Libraries/Components/Button.d.ts +118 -197
- package/types_generated/Libraries/Components/Clipboard/Clipboard.d.ts +6 -1
- package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.d.ts +44 -63
- package/types_generated/Libraries/Components/Keyboard/Keyboard.d.ts +30 -61
- package/types_generated/Libraries/Components/Keyboard/KeyboardAvoidingView.d.ts +30 -21
- package/types_generated/Libraries/Components/Pressable/Pressable.d.ts +41 -17
- package/types_generated/Libraries/Components/Pressable/useAndroidRippleForView.d.ts +6 -6
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +5 -5
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.d.ts +18 -1
- package/types_generated/Libraries/Components/RefreshControl/RefreshControl.d.ts +35 -52
- package/types_generated/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +9 -11
- package/types_generated/Libraries/Components/ScrollView/ScrollView.d.ts +212 -88
- package/types_generated/Libraries/Components/ScrollView/ScrollViewStickyHeader.d.ts +4 -4
- package/types_generated/Libraries/Components/StatusBar/StatusBar.d.ts +29 -62
- package/types_generated/Libraries/Components/Switch/Switch.d.ts +75 -70
- package/types_generated/Libraries/Components/TextInput/InputAccessoryView.d.ts +16 -65
- package/types_generated/Libraries/Components/TextInput/TextInput.d.ts +118 -3
- package/types_generated/Libraries/Components/TextInput/TextInput.flow.d.ts +24 -9
- package/types_generated/Libraries/Components/ToastAndroid/ToastAndroid.d.ts +18 -18
- package/types_generated/Libraries/Components/Touchable/TouchableHighlight.d.ts +24 -13
- package/types_generated/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts +27 -64
- package/types_generated/Libraries/Components/Touchable/TouchableOpacity.d.ts +18 -6
- package/types_generated/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +28 -28
- package/types_generated/Libraries/Components/View/View.d.ts +13 -9
- package/types_generated/Libraries/Components/View/ViewAccessibility.d.ts +31 -20
- package/types_generated/Libraries/Components/View/ViewNativeComponent.d.ts +1 -2
- package/types_generated/Libraries/Components/View/ViewPropTypes.d.ts +75 -24
- package/types_generated/Libraries/Core/ExtendedError.d.ts +10 -10
- package/types_generated/Libraries/EventEmitter/NativeEventEmitter.d.ts +34 -1
- package/types_generated/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +4 -1
- package/types_generated/Libraries/Image/AssetSourceResolver.d.ts +2 -13
- package/types_generated/Libraries/Image/ImageBackground.d.ts +33 -22
- package/types_generated/Libraries/Image/ImageProps.d.ts +201 -251
- package/types_generated/Libraries/Image/ImageTypes.flow.d.ts +6 -5
- package/types_generated/Libraries/Interaction/PanResponder.d.ts +103 -97
- package/types_generated/Libraries/LayoutAnimation/LayoutAnimation.d.ts +18 -7
- package/types_generated/Libraries/Linking/Linking.d.ts +28 -20
- package/types_generated/Libraries/Lists/FlatList.d.ts +17 -18
- package/types_generated/Libraries/Lists/SectionList.d.ts +10 -5
- package/types_generated/Libraries/Lists/VirtualizedList.d.ts +3 -1
- package/types_generated/Libraries/Lists/VirtualizedSectionList.d.ts +3 -1
- package/types_generated/Libraries/LogBox/Data/LogBoxData.d.ts +2 -2
- package/types_generated/Libraries/LogBox/Data/LogBoxLog.d.ts +2 -2
- package/types_generated/Libraries/LogBox/Data/parseLogBoxLog.d.ts +2 -2
- package/types_generated/Libraries/LogBox/LogBox.d.ts +4 -1
- package/types_generated/Libraries/Modal/Modal.d.ts +70 -35
- package/types_generated/Libraries/Network/FormData.d.ts +5 -5
- package/types_generated/Libraries/Performance/Systrace.d.ts +11 -1
- package/types_generated/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +31 -21
- package/types_generated/Libraries/Pressability/Pressability.d.ts +5 -5
- package/types_generated/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts +15 -11
- package/types_generated/Libraries/ReactNative/AppRegistry.flow.d.ts +5 -5
- package/types_generated/Libraries/ReactNative/AppRegistryImpl.d.ts +56 -9
- package/types_generated/Libraries/ReactNative/I18nManager.d.ts +20 -1
- package/types_generated/Libraries/ReactNative/IPerformanceLogger.flow.d.ts +5 -5
- package/types_generated/Libraries/ReactPrivate/ReactNativePrivateInterface.d.ts +6 -22
- package/types_generated/Libraries/Renderer/shims/ReactNativeTypes.d.ts +34 -34
- package/types_generated/Libraries/Share/Share.d.ts +36 -39
- package/types_generated/Libraries/StyleSheet/PlatformColorValueTypes.d.ts +7 -1
- package/types_generated/Libraries/StyleSheet/PlatformColorValueTypesIOS.d.ts +3 -3
- package/types_generated/Libraries/StyleSheet/StyleSheetTypes.d.ts +202 -181
- package/types_generated/Libraries/StyleSheet/private/_TransformStyle.d.ts +3 -3
- package/types_generated/Libraries/Text/Text.d.ts +10 -6
- package/types_generated/Libraries/Text/TextProps.d.ts +57 -102
- package/types_generated/Libraries/TurboModule/RCTExport.d.ts +2 -2
- package/types_generated/Libraries/Types/CoreEventTypes.d.ts +14 -8
- package/types_generated/Libraries/Utilities/Appearance.d.ts +25 -13
- package/types_generated/Libraries/Utilities/BackHandler.d.ts +17 -1
- package/types_generated/Libraries/Utilities/DevSettings.d.ts +9 -2
- package/types_generated/Libraries/Utilities/Dimensions.d.ts +19 -13
- package/types_generated/Libraries/Utilities/PixelRatio.d.ts +6 -3
- package/types_generated/Libraries/Utilities/Platform.d.ts +5 -1
- package/types_generated/Libraries/Utilities/PlatformTypes.d.ts +65 -6
- package/types_generated/Libraries/Utilities/codegenNativeComponent.d.ts +5 -5
- package/types_generated/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.d.ts +2 -2
- package/types_generated/Libraries/Utilities/differ/deepDiffer.d.ts +2 -2
- package/types_generated/Libraries/Utilities/useColorScheme.d.ts +12 -2
- package/types_generated/Libraries/Utilities/useWindowDimensions.d.ts +7 -1
- package/types_generated/Libraries/Vibration/Vibration.d.ts +14 -6
- package/types_generated/index.d.ts +31 -25
- package/types_generated/src/private/assets/AssetRegistry.d.ts +42 -0
- package/types_generated/src/private/components/virtualcollection/VirtualCollectionView.d.ts +5 -5
- package/types_generated/src/private/components/virtualcollection/column/VirtualColumn.d.ts +3 -3
- package/types_generated/src/private/components/virtualcollection/row/VirtualRow.d.ts +3 -3
- package/types_generated/src/private/components/virtualview/VirtualView.d.ts +7 -7
- package/types_generated/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.d.ts +5 -5
- package/types_generated/src/private/components/virtualview/VirtualViewNativeComponent.d.ts +5 -5
- package/types_generated/src/private/renderer/events/dispatchNativeEvent.d.ts +26 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeAppearance.d.ts +6 -5
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.d.ts +7 -7
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.d.ts +5 -5
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeUIManager.d.ts +8 -8
- package/types_generated/src/private/types/HostComponent.d.ts +3 -3
- package/types_generated/src/private/types/HostInstance.d.ts +39 -74
- package/types_generated/src/private/webapis/dom/events/CustomEvent.d.ts +2 -2
- package/types_generated/src/private/webapis/dom/events/Event.d.ts +4 -4
- package/types_generated/src/private/webapis/dom/events/EventTarget.d.ts +8 -8
- package/types_generated/src/private/webapis/dom/nodes/ReactNativeDocument.d.ts +3 -1
- package/types_generated/src/private/webapis/dom/nodes/ReactNativeElement.d.ts +57 -4
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyCharacterData.d.ts +3 -1
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyElement.d.ts +3 -1
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyNode.d.ts +4 -2
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyText.d.ts +3 -1
- package/types_generated/src/private/webapis/dom/nodes/specs/NativeDOM.d.ts +3 -3
- package/types_generated/src/private/webapis/dom/oldstylecollections/HTMLCollection.d.ts +3 -1
- package/types_generated/src/private/webapis/dom/oldstylecollections/NodeList.d.ts +3 -1
- package/types_generated/src/react-private-interface.d.ts +33 -0
- package/Libraries/AppDelegate/RCTArchConfiguratorProtocol.h +0 -38
- package/Libraries/Image/AssetRegistry.js +0 -14
- package/Libraries/Image/RCTImageShadowView.h +0 -17
- package/Libraries/Image/RCTImageShadowView.mm +0 -28
- package/Libraries/Image/RCTImageView.h +0 -32
- package/Libraries/Image/RCTImageView.mm +0 -508
- package/Libraries/Image/RCTImageViewManager.h +0 -17
- package/Libraries/Image/RCTImageViewManager.mm +0 -115
- package/Libraries/Interaction/InteractionManager.d.ts +0 -87
- package/Libraries/Interaction/InteractionManager.js +0 -189
- package/Libraries/Text/BaseText/RCTBaseTextShadowView.h +0 -35
- package/Libraries/Text/BaseText/RCTBaseTextShadowView.mm +0 -162
- package/Libraries/Text/BaseText/RCTBaseTextViewManager.h +0 -21
- package/Libraries/Text/BaseText/RCTBaseTextViewManager.mm +0 -64
- package/Libraries/Text/RCTTextAttributes.h +0 -107
- package/Libraries/Text/RCTTextAttributes.mm +0 -358
- package/Libraries/Text/RawText/RCTRawTextShadowView.h +0 -23
- package/Libraries/Text/RawText/RCTRawTextShadowView.mm +0 -38
- package/Libraries/Text/RawText/RCTRawTextViewManager.h +0 -21
- package/Libraries/Text/RawText/RCTRawTextViewManager.mm +0 -32
- package/Libraries/Text/Text/RCTTextShadowView.h +0 -33
- package/Libraries/Text/Text/RCTTextShadowView.mm +0 -469
- package/Libraries/Text/Text/RCTTextView.h +0 -34
- package/Libraries/Text/Text/RCTTextView.mm +0 -298
- package/Libraries/Text/Text/RCTTextViewManager.h +0 -19
- package/Libraries/Text/Text/RCTTextViewManager.mm +0 -97
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +0 -21
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.mm +0 -67
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.h +0 -21
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm +0 -28
- package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.h +0 -30
- package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.mm +0 -367
- package/Libraries/Text/TextInput/RCTBaseTextInputView.h +0 -68
- package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +0 -849
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.h +0 -17
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm +0 -181
- package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.h +0 -17
- package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.mm +0 -24
- package/Libraries/Text/TextInput/RCTInputAccessoryView.h +0 -22
- package/Libraries/Text/TextInput/RCTInputAccessoryView.mm +0 -82
- package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.h +0 -17
- package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.mm +0 -78
- package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.h +0 -17
- package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm +0 -33
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.h +0 -21
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.mm +0 -43
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.h +0 -21
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm +0 -35
- package/Libraries/Text/VirtualText/RCTVirtualTextShadowView.h +0 -17
- package/Libraries/Text/VirtualText/RCTVirtualTextShadowView.mm +0 -42
- package/Libraries/Text/VirtualText/RCTVirtualTextView.h +0 -28
- package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.h +0 -17
- package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm +0 -30
- package/Libraries/Utilities/SceneTracker.js +0 -42
- package/Libraries/Wrapper/Example/RCTWrapperExampleView.h +0 -21
- package/Libraries/Wrapper/Example/RCTWrapperExampleView.m +0 -57
- package/Libraries/Wrapper/Example/RCTWrapperExampleViewController.h +0 -21
- package/Libraries/Wrapper/Example/RCTWrapperExampleViewController.m +0 -27
- package/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.h +0 -25
- package/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.m +0 -50
- package/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.h +0 -23
- package/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.m +0 -35
- package/Libraries/Wrapper/RCTWrapper.h +0 -73
- package/Libraries/Wrapper/RCTWrapperShadowView.h +0 -27
- package/Libraries/Wrapper/RCTWrapperShadowView.m +0 -138
- package/Libraries/Wrapper/RCTWrapperView.h +0 -42
- package/Libraries/Wrapper/RCTWrapperView.m +0 -99
- package/Libraries/Wrapper/RCTWrapperViewControllerHostingView.h +0 -30
- package/Libraries/Wrapper/RCTWrapperViewControllerHostingView.m +0 -137
- package/Libraries/Wrapper/RCTWrapperViewManager.h +0 -25
- package/Libraries/Wrapper/RCTWrapperViewManager.m +0 -31
- package/React/Base/RCTRootContentView.h +0 -43
- package/React/Base/RCTRootContentView.m +0 -111
- package/React/Base/RCTRootViewInternal.h +0 -28
- package/React/CxxBridge/RCTCxxBridge.mm +0 -1572
- package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.h +0 -25
- package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.mm +0 -34
- package/React/CxxBridge/RCTObjcExecutor.h +0 -34
- package/React/CxxBridge/RCTObjcExecutor.mm +0 -150
- package/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm +0 -34
- package/React/CxxModule/DispatchMessageQueueThread.h +0 -50
- package/React/CxxModule/RCTCxxMethod.h +0 -17
- package/React/CxxModule/RCTCxxMethod.mm +0 -147
- package/React/CxxModule/RCTNativeModule.h +0 -34
- package/React/CxxModule/RCTNativeModule.mm +0 -241
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm +0 -205
- package/React/Tests/Text/RCTTextAttributesTest.mm +0 -49
- package/React/Views/RCTActivityIndicatorView.h +0 -16
- package/React/Views/RCTActivityIndicatorView.m +0 -26
- package/React/Views/RCTActivityIndicatorViewManager.h +0 -23
- package/React/Views/RCTActivityIndicatorViewManager.m +0 -65
- package/React/Views/RCTDebuggingOverlayManager.h +0 -17
- package/React/Views/RCTDebuggingOverlayManager.m +0 -68
- package/React/Views/RCTModalHostView.h +0 -64
- package/React/Views/RCTModalHostView.m +0 -264
- package/React/Views/RCTModalHostViewController.m +0 -74
- package/React/Views/RCTModalHostViewManager.m +0 -131
- package/React/Views/RCTModalManager.h +0 -22
- package/React/Views/RCTModalManager.m +0 -46
- package/React/Views/RCTRootShadowView.h +0 -35
- package/React/Views/RCTRootShadowView.m +0 -53
- package/React/Views/RCTShadowView+Internal.h +0 -18
- package/React/Views/RCTShadowView+Internal.m +0 -23
- package/React/Views/RCTSwitch.h +0 -22
- package/React/Views/RCTSwitch.m +0 -24
- package/React/Views/RCTSwitchManager.h +0 -17
- package/React/Views/RCTSwitchManager.m +0 -70
- package/React/Views/RefreshControl/RCTRefreshControl.h +0 -24
- package/React/Views/RefreshControl/RCTRefreshControl.m +0 -230
- package/React/Views/RefreshControl/RCTRefreshControlManager.h +0 -17
- package/React/Views/RefreshControl/RCTRefreshControlManager.m +0 -47
- package/React/Views/SafeAreaView/RCTSafeAreaShadowView.h +0 -21
- package/React/Views/SafeAreaView/RCTSafeAreaShadowView.m +0 -57
- package/React/Views/SafeAreaView/RCTSafeAreaView.h +0 -27
- package/React/Views/SafeAreaView/RCTSafeAreaView.m +0 -79
- package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +0 -25
- package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.m +0 -25
- package/React/Views/SafeAreaView/RCTSafeAreaViewManager.h +0 -21
- package/React/Views/SafeAreaView/RCTSafeAreaViewManager.m +0 -32
- package/React/Views/ScrollView/RCTScrollContentShadowView.h +0 -19
- package/React/Views/ScrollView/RCTScrollContentShadowView.m +0 -35
- package/React/Views/ScrollView/RCTScrollContentView.h +0 -19
- package/React/Views/ScrollView/RCTScrollContentView.m +0 -36
- package/React/Views/ScrollView/RCTScrollContentViewManager.h +0 -17
- package/React/Views/ScrollView/RCTScrollContentViewManager.m +0 -31
- package/React/Views/ScrollView/RCTScrollView.m +0 -1168
- package/React/Views/ScrollView/RCTScrollViewManager.h +0 -25
- package/React/Views/ScrollView/RCTScrollViewManager.m +0 -202
- package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +0 -251
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.java +0 -315
- package/ReactAndroid/src/main/java/com/facebook/react/common/ClearableSynchronizedPool.kt +0 -51
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/AnimationBackendChoreographer.kt +0 -89
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java +0 -736
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +0 -221
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +0 -399
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactZIndexedViewGroup.kt +0 -35
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +0 -346
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +0 -666
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +0 -147
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupDrawingOrderHelper.kt +0 -113
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java +0 -614
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +0 -1838
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.java +0 -1646
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +0 -1638
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.java +0 -51
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.java +0 -33
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.java +0 -33
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.java +0 -37
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.java +0 -47
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.java +0 -41
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java +0 -33
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.java +0 -37
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.java +0 -39
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.java +0 -49
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.java +0 -45
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureMode.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java +0 -928
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.java +0 -33
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.java +0 -43
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.java +0 -35
- package/ReactAndroid/src/main/jni/react/fabric/JAnimationBackendChoreographer.cpp +0 -23
- package/ReactAndroid/src/main/jni/react/fabric/JAnimationBackendChoreographer.h +0 -37
- package/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp +0 -135
- package/ReactCommon/cxxreact/JSIndexedRAMBundle.h +0 -72
- package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.cpp +0 -143
- package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.h +0 -55
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp +0 -78
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.h +0 -39
- package/ReactCommon/hermes/inspector-modern/chrome/tests/ConnectionDemuxTests.cpp +0 -148
- package/ReactCommon/react/nativemodule/samples/platform/android/NativeSampleTurboModuleSpec.java +0 -168
- package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.cpp +0 -416
- package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.h +0 -31
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.h +0 -134
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.mm +0 -290
- package/ReactCommon/react/renderer/core/RawPropsKey.cpp +0 -62
- package/ReactCommon/react/renderer/core/RawPropsKey.h +0 -39
- package/ReactCommon/react/renderer/mounting/internal/DiffMap.h +0 -170
- package/ReactCommon/react/renderer/mounting/internal/LongestIncreasingSubsequence.h +0 -95
- package/ReactCommon/react/renderer/mounting/internal/TinyMap.h +0 -147
- package/ReactCommon/react/renderer/mounting/tests/LongestIncreasingSubsequenceTest.cpp +0 -154
- package/interface.js +0 -21
- package/jest-preset.js +0 -26
- package/rn-get-polyfills.js +0 -13
- package/sdks/.hermesversion +0 -1
- package/src/private/components/virtualcollection/debug/FlingItemOverlay.js +0 -13
- package/types/tsconfig.json +0 -15
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.d.ts +0 -14
- package/types_generated/Libraries/Components/ScrollView/ScrollViewNativeComponent.d.ts +0 -21
- package/types_generated/Libraries/Components/ScrollView/ScrollViewNativeComponentType.d.ts +0 -134
- package/types_generated/Libraries/Components/Switch/AndroidSwitchNativeComponent.d.ts +0 -14
- package/types_generated/Libraries/Components/Switch/SwitchNativeComponent.d.ts +0 -14
- package/types_generated/Libraries/Components/Touchable/Touchable.d.ts +0 -262
- package/types_generated/Libraries/Interaction/InteractionManager.d.ts +0 -117
- package/types_generated/Libraries/NativeModules/specs/NativeDialogManagerAndroid.d.ts +0 -17
- package/types_generated/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.d.ts +0 -53
- package/types_generated/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.d.ts +0 -36
- package/types_generated/src/private/specs_DEPRECATED/components/SwitchNativeComponent.d.ts +0 -51
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.d.ts +0 -37
- package/types_generated/tsconfig.test.json +0 -16
- /package/ReactCommon/{cxxreact → react/utils}/MoveWrapper.h +0 -0
|
@@ -25,11 +25,7 @@
|
|
|
25
25
|
#import "RCTModuleData.h"
|
|
26
26
|
#import "RCTModuleMethod.h"
|
|
27
27
|
#import "RCTProfile.h"
|
|
28
|
-
#import "RCTRootContentView.h"
|
|
29
|
-
#import "RCTRootShadowView.h"
|
|
30
|
-
#import "RCTRootViewInternal.h"
|
|
31
28
|
#import "RCTScrollableProtocol.h"
|
|
32
|
-
#import "RCTShadowView+Internal.h"
|
|
33
29
|
#import "RCTShadowView.h"
|
|
34
30
|
#import "RCTSurfaceRootShadowView.h"
|
|
35
31
|
#import "RCTSurfaceRootView.h"
|
|
@@ -133,1501 +129,6 @@ NSMutableDictionary<NSString *, id> *RCTModuleConstantsForDestructuredComponent(
|
|
|
133
129
|
return moduleConstants;
|
|
134
130
|
}
|
|
135
131
|
|
|
136
|
-
#ifndef RCT_REMOVE_LEGACY_ARCH
|
|
137
|
-
|
|
138
|
-
static void RCTTraverseViewNodes(id<RCTComponent> view, void (^block)(id<RCTComponent>))
|
|
139
|
-
{
|
|
140
|
-
if (view.reactTag) {
|
|
141
|
-
block(view);
|
|
142
|
-
|
|
143
|
-
for (id<RCTComponent> subview in view.reactSubviews) {
|
|
144
|
-
RCTTraverseViewNodes(subview, block);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
static NSString *RCTNativeIDRegistryKey(NSString *nativeID, NSNumber *rootTag)
|
|
150
|
-
{
|
|
151
|
-
if (!nativeID || !rootTag) {
|
|
152
|
-
return @"";
|
|
153
|
-
}
|
|
154
|
-
return [NSString stringWithFormat:@"%@-%@", rootTag, nativeID];
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
NSString *const RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification =
|
|
158
|
-
@"RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification";
|
|
159
|
-
|
|
160
|
-
@implementation RCTUIManager {
|
|
161
|
-
// Root views are only mutated on the shadow queue
|
|
162
|
-
NSMutableSet<NSNumber *> *_rootViewTags;
|
|
163
|
-
NSMutableArray<RCTViewManagerUIBlock> *_pendingUIBlocks;
|
|
164
|
-
|
|
165
|
-
// Animation
|
|
166
|
-
RCTLayoutAnimationGroup *_layoutAnimationGroup; // Main thread only
|
|
167
|
-
|
|
168
|
-
NSMutableDictionary<NSNumber *, RCTShadowView *> *_shadowViewRegistry; // RCT thread only
|
|
169
|
-
NSMutableDictionary<NSNumber *, UIView *> *_viewRegistry; // Main thread only
|
|
170
|
-
NSMapTable<NSString *, UIView *> *_nativeIDRegistry;
|
|
171
|
-
|
|
172
|
-
NSMapTable<RCTShadowView *, NSArray<NSString *> *> *_shadowViewsWithUpdatedProps; // UIManager queue only.
|
|
173
|
-
NSHashTable<RCTShadowView *> *_shadowViewsWithUpdatedChildren; // UIManager queue only.
|
|
174
|
-
|
|
175
|
-
// Keyed by viewName
|
|
176
|
-
NSMutableDictionary *_componentDataByName;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
@synthesize bridge = _bridge;
|
|
180
|
-
@synthesize moduleRegistry = _moduleRegistry;
|
|
181
|
-
|
|
182
|
-
RCT_EXPORT_MODULE()
|
|
183
|
-
|
|
184
|
-
+ (BOOL)requiresMainQueueSetup
|
|
185
|
-
{
|
|
186
|
-
return NO;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
- (void)invalidate
|
|
190
|
-
{
|
|
191
|
-
/**
|
|
192
|
-
* Called on the JS Thread since all modules are invalidated on the JS thread
|
|
193
|
-
*/
|
|
194
|
-
|
|
195
|
-
// This only accessed from the shadow queue
|
|
196
|
-
_pendingUIBlocks = nil;
|
|
197
|
-
|
|
198
|
-
RCTExecuteOnMainQueue(^{
|
|
199
|
-
RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @"UIManager invalidate", nil);
|
|
200
|
-
NSMutableDictionary<NSNumber *, id<RCTComponent>> *viewRegistry =
|
|
201
|
-
(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)self->_viewRegistry;
|
|
202
|
-
for (NSNumber *rootViewTag in self->_rootViewTags) {
|
|
203
|
-
id<RCTComponent> rootView = viewRegistry[rootViewTag];
|
|
204
|
-
[self _purgeChildren:[rootView reactSubviews] fromRegistry:viewRegistry];
|
|
205
|
-
if ([rootView conformsToProtocol:@protocol(RCTInvalidating)]) {
|
|
206
|
-
[(id<RCTInvalidating>)rootView invalidate];
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
self->_rootViewTags = nil;
|
|
211
|
-
self->_shadowViewRegistry = nil;
|
|
212
|
-
self->_viewRegistry = nil;
|
|
213
|
-
self->_nativeIDRegistry = nil;
|
|
214
|
-
self->_bridge = nil;
|
|
215
|
-
|
|
216
|
-
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
217
|
-
RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @"");
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
- (NSMutableDictionary<NSNumber *, RCTShadowView *> *)shadowViewRegistry
|
|
222
|
-
{
|
|
223
|
-
// NOTE: this method only exists so that it can be accessed by unit tests
|
|
224
|
-
if (!_shadowViewRegistry) {
|
|
225
|
-
_shadowViewRegistry = [NSMutableDictionary new];
|
|
226
|
-
}
|
|
227
|
-
return _shadowViewRegistry;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
- (NSMutableDictionary<NSNumber *, UIView *> *)viewRegistry
|
|
231
|
-
{
|
|
232
|
-
// NOTE: this method only exists so that it can be accessed by unit tests
|
|
233
|
-
if (!_viewRegistry) {
|
|
234
|
-
_viewRegistry = [NSMutableDictionary new];
|
|
235
|
-
}
|
|
236
|
-
return _viewRegistry;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
- (NSMapTable *)nativeIDRegistry
|
|
240
|
-
{
|
|
241
|
-
if (!_nativeIDRegistry) {
|
|
242
|
-
_nativeIDRegistry = [NSMapTable strongToWeakObjectsMapTable];
|
|
243
|
-
}
|
|
244
|
-
return _nativeIDRegistry;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
- (void)setBridge:(RCTBridge *)bridge
|
|
248
|
-
{
|
|
249
|
-
RCTAssert(_bridge == nil, @"Should not re-use same UIManager instance");
|
|
250
|
-
_bridge = bridge;
|
|
251
|
-
|
|
252
|
-
_shadowViewRegistry = [NSMutableDictionary new];
|
|
253
|
-
_viewRegistry = [NSMutableDictionary new];
|
|
254
|
-
_nativeIDRegistry = [NSMapTable strongToWeakObjectsMapTable];
|
|
255
|
-
|
|
256
|
-
_shadowViewsWithUpdatedProps = [NSMapTable weakToStrongObjectsMapTable];
|
|
257
|
-
_shadowViewsWithUpdatedChildren = [NSHashTable weakObjectsHashTable];
|
|
258
|
-
|
|
259
|
-
// Internal resources
|
|
260
|
-
_pendingUIBlocks = [NSMutableArray new];
|
|
261
|
-
_rootViewTags = [NSMutableSet new];
|
|
262
|
-
|
|
263
|
-
_observerCoordinator = [RCTUIManagerObserverCoordinator new];
|
|
264
|
-
|
|
265
|
-
// Get view managers from bridge=
|
|
266
|
-
_componentDataByName = [NSMutableDictionary new];
|
|
267
|
-
for (Class moduleClass in _bridge.moduleClasses) {
|
|
268
|
-
if ([moduleClass isSubclassOfClass:[RCTViewManager class]]) {
|
|
269
|
-
RCTComponentData *componentData = [[RCTComponentData alloc] initWithManagerClass:moduleClass
|
|
270
|
-
bridge:_bridge
|
|
271
|
-
eventDispatcher:_bridge.eventDispatcher];
|
|
272
|
-
_componentDataByName[componentData.name] = componentData;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// Preload the a11yManager as the RCTUIManager needs it to listen for notification
|
|
277
|
-
// By eagerly preloading it in the setBridge method, we make sure that the manager is
|
|
278
|
-
// properly initialized in the Main Thread and that we do not incur in any race condition
|
|
279
|
-
// or concurrency problem.
|
|
280
|
-
id<RCTBridgeModule> a11yManager = [bridge moduleForName:@"AccessibilityManager" lazilyLoadIfNecessary:YES];
|
|
281
|
-
|
|
282
|
-
// This dispatch_async avoids a deadlock while configuring native modules
|
|
283
|
-
dispatch_queue_t accessibilityManagerInitQueue = RCTUIManagerDispatchAccessibilityManagerInitOntoMain()
|
|
284
|
-
? dispatch_get_main_queue()
|
|
285
|
-
: dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0);
|
|
286
|
-
dispatch_async(accessibilityManagerInitQueue, ^{
|
|
287
|
-
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
288
|
-
selector:@selector(didReceiveNewContentSizeMultiplier)
|
|
289
|
-
name:@"RCTAccessibilityManagerDidUpdateMultiplierNotification"
|
|
290
|
-
object:a11yManager];
|
|
291
|
-
});
|
|
292
|
-
#if TARGET_OS_IOS
|
|
293
|
-
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
294
|
-
selector:@selector(namedOrientationDidChange)
|
|
295
|
-
name:UIDeviceOrientationDidChangeNotification
|
|
296
|
-
object:nil];
|
|
297
|
-
#endif
|
|
298
|
-
[RCTLayoutAnimation initializeStatics];
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
#pragma mark - Event emitting
|
|
302
|
-
|
|
303
|
-
- (void)didReceiveNewContentSizeMultiplier
|
|
304
|
-
{
|
|
305
|
-
// Report the event across the bridge.
|
|
306
|
-
#pragma clang diagnostic push
|
|
307
|
-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
308
|
-
id multiplier = [[self->_bridge moduleForName:@"AccessibilityManager"
|
|
309
|
-
lazilyLoadIfNecessary:YES] valueForKey:@"multiplier"];
|
|
310
|
-
if (multiplier) {
|
|
311
|
-
[[_moduleRegistry moduleForName:"EventDispatcher"] sendDeviceEventWithName:@"didUpdateContentSizeMultiplier"
|
|
312
|
-
body:multiplier];
|
|
313
|
-
}
|
|
314
|
-
#pragma clang diagnostic pop
|
|
315
|
-
|
|
316
|
-
RCTExecuteOnUIManagerQueue(^{
|
|
317
|
-
[[NSNotificationCenter defaultCenter]
|
|
318
|
-
postNotificationName:RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification
|
|
319
|
-
object:self];
|
|
320
|
-
[self setNeedsLayout];
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
#if TARGET_OS_IOS
|
|
325
|
-
// Names and coordinate system from html5 spec:
|
|
326
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Screen.orientation
|
|
327
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Screen.lockOrientation
|
|
328
|
-
static NSDictionary *deviceOrientationEventBody(UIDeviceOrientation orientation)
|
|
329
|
-
{
|
|
330
|
-
NSString *name;
|
|
331
|
-
NSNumber *degrees = @0;
|
|
332
|
-
BOOL isLandscape = NO;
|
|
333
|
-
switch (orientation) {
|
|
334
|
-
case UIDeviceOrientationPortrait:
|
|
335
|
-
name = @"portrait-primary";
|
|
336
|
-
break;
|
|
337
|
-
case UIDeviceOrientationPortraitUpsideDown:
|
|
338
|
-
name = @"portrait-secondary";
|
|
339
|
-
degrees = @180;
|
|
340
|
-
break;
|
|
341
|
-
case UIDeviceOrientationLandscapeRight:
|
|
342
|
-
name = @"landscape-primary";
|
|
343
|
-
degrees = @-90;
|
|
344
|
-
isLandscape = YES;
|
|
345
|
-
break;
|
|
346
|
-
case UIDeviceOrientationLandscapeLeft:
|
|
347
|
-
name = @"landscape-secondary";
|
|
348
|
-
degrees = @90;
|
|
349
|
-
isLandscape = YES;
|
|
350
|
-
break;
|
|
351
|
-
case UIDeviceOrientationFaceDown:
|
|
352
|
-
case UIDeviceOrientationFaceUp:
|
|
353
|
-
case UIDeviceOrientationUnknown:
|
|
354
|
-
// Unsupported
|
|
355
|
-
return nil;
|
|
356
|
-
}
|
|
357
|
-
return @{
|
|
358
|
-
@"name" : name,
|
|
359
|
-
@"rotationDegrees" : degrees,
|
|
360
|
-
@"isLandscape" : @(isLandscape),
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
- (void)namedOrientationDidChange
|
|
365
|
-
{
|
|
366
|
-
NSDictionary *orientationEvent = deviceOrientationEventBody([UIDevice currentDevice].orientation);
|
|
367
|
-
if (!orientationEvent) {
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
#pragma clang diagnostic push
|
|
372
|
-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
373
|
-
[[_moduleRegistry moduleForName:"EventDispatcher"] sendDeviceEventWithName:@"namedOrientationDidChange"
|
|
374
|
-
body:orientationEvent];
|
|
375
|
-
#pragma clang diagnostic pop
|
|
376
|
-
}
|
|
377
|
-
#endif
|
|
378
|
-
|
|
379
|
-
- (dispatch_queue_t)methodQueue
|
|
380
|
-
{
|
|
381
|
-
return RCTGetUIManagerQueue();
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
- (void)registerRootViewTag:(NSNumber *)rootTag
|
|
385
|
-
{
|
|
386
|
-
RCTAssertUIManagerQueue();
|
|
387
|
-
|
|
388
|
-
RCTAssert(RCTIsReactRootView(rootTag), @"Attempt to register rootTag (%@) which is not actually root tag.", rootTag);
|
|
389
|
-
|
|
390
|
-
RCTAssert(
|
|
391
|
-
![_rootViewTags containsObject:rootTag],
|
|
392
|
-
@"Attempt to register rootTag (%@) which was already registered.",
|
|
393
|
-
rootTag);
|
|
394
|
-
|
|
395
|
-
[_rootViewTags addObject:rootTag];
|
|
396
|
-
|
|
397
|
-
// Registering root shadow view
|
|
398
|
-
RCTSurfaceRootShadowView *shadowView = [RCTSurfaceRootShadowView new];
|
|
399
|
-
shadowView.reactTag = rootTag;
|
|
400
|
-
_shadowViewRegistry[rootTag] = shadowView;
|
|
401
|
-
|
|
402
|
-
// Registering root view
|
|
403
|
-
RCTExecuteOnMainQueue(^{
|
|
404
|
-
RCTSurfaceRootView *rootView = [RCTSurfaceRootView new];
|
|
405
|
-
rootView.reactTag = rootTag;
|
|
406
|
-
self->_viewRegistry[rootTag] = rootView;
|
|
407
|
-
});
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
- (void)registerRootView:(RCTRootContentView *)rootView
|
|
411
|
-
{
|
|
412
|
-
RCTAssertMainQueue();
|
|
413
|
-
|
|
414
|
-
NSNumber *reactTag = rootView.reactTag;
|
|
415
|
-
RCTAssert(RCTIsReactRootView(reactTag), @"View %@ with tag #%@ is not a root view", rootView, reactTag);
|
|
416
|
-
|
|
417
|
-
RCTAssert(
|
|
418
|
-
_viewRegistry[reactTag] == nil || _viewRegistry[reactTag] == rootView,
|
|
419
|
-
@"Expect all root views to have unique tag. Added %@ twice",
|
|
420
|
-
reactTag);
|
|
421
|
-
|
|
422
|
-
CGSize availableSize = rootView.availableSize;
|
|
423
|
-
|
|
424
|
-
// Register view
|
|
425
|
-
_viewRegistry[reactTag] = rootView;
|
|
426
|
-
|
|
427
|
-
// Register shadow view
|
|
428
|
-
RCTExecuteOnUIManagerQueue(^{
|
|
429
|
-
if (!self->_viewRegistry) {
|
|
430
|
-
return;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
RCTRootShadowView *shadowView = [RCTRootShadowView new];
|
|
434
|
-
shadowView.availableSize = availableSize;
|
|
435
|
-
shadowView.reactTag = reactTag;
|
|
436
|
-
shadowView.viewName = NSStringFromClass([rootView class]);
|
|
437
|
-
self->_shadowViewRegistry[shadowView.reactTag] = shadowView;
|
|
438
|
-
[self->_rootViewTags addObject:reactTag];
|
|
439
|
-
});
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
- (NSString *)viewNameForReactTag:(NSNumber *)reactTag
|
|
443
|
-
{
|
|
444
|
-
RCTAssertUIManagerQueue();
|
|
445
|
-
NSString *name = _shadowViewRegistry[reactTag].viewName;
|
|
446
|
-
if (name) {
|
|
447
|
-
return name;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
__block UIView *view;
|
|
451
|
-
RCTUnsafeExecuteOnMainQueueSync(^{
|
|
452
|
-
view = self->_viewRegistry[reactTag];
|
|
453
|
-
});
|
|
454
|
-
|
|
455
|
-
#pragma clang diagnostic push
|
|
456
|
-
#pragma clang diagnostic ignored "-Wundeclared-selector"
|
|
457
|
-
|
|
458
|
-
if ([view respondsToSelector:@selector(componentViewName_DO_NOT_USE_THIS_IS_BROKEN)]) {
|
|
459
|
-
return [view performSelector:@selector(componentViewName_DO_NOT_USE_THIS_IS_BROKEN)];
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
#pragma clang diagnostic pop
|
|
463
|
-
return nil;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
- (UIView *)viewForReactTag:(NSNumber *)reactTag
|
|
467
|
-
{
|
|
468
|
-
RCTAssertMainQueue();
|
|
469
|
-
UIView *view = [_bridge.surfacePresenter findComponentViewWithTag_DO_NOT_USE_DEPRECATED:reactTag.integerValue];
|
|
470
|
-
if (!view) {
|
|
471
|
-
view = _viewRegistry[reactTag];
|
|
472
|
-
}
|
|
473
|
-
return RCTPaperViewOrCurrentView(view);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
- (RCTShadowView *)shadowViewForReactTag:(NSNumber *)reactTag
|
|
477
|
-
{
|
|
478
|
-
RCTAssertUIManagerQueue();
|
|
479
|
-
return _shadowViewRegistry[reactTag];
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
- (void)_executeBlockWithShadowView:(void (^)(RCTShadowView *shadowView))block forTag:(NSNumber *)tag
|
|
483
|
-
{
|
|
484
|
-
RCTAssertMainQueue();
|
|
485
|
-
|
|
486
|
-
RCTExecuteOnUIManagerQueue(^{
|
|
487
|
-
RCTShadowView *shadowView = self->_shadowViewRegistry[tag];
|
|
488
|
-
|
|
489
|
-
if (shadowView == nil) {
|
|
490
|
-
RCTLogInfo(
|
|
491
|
-
@"Could not locate shadow view with tag #%@, this is probably caused by a temporary inconsistency between native views and shadow views.",
|
|
492
|
-
tag);
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
block(shadowView);
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
- (void)setAvailableSize:(CGSize)availableSize forRootView:(UIView *)rootView
|
|
501
|
-
{
|
|
502
|
-
RCTAssertMainQueue();
|
|
503
|
-
[self
|
|
504
|
-
_executeBlockWithShadowView:^(RCTShadowView *shadowView) {
|
|
505
|
-
RCTAssert(
|
|
506
|
-
[shadowView isKindOfClass:[RCTRootShadowView class]], @"Located shadow view is actually not root view.");
|
|
507
|
-
|
|
508
|
-
RCTRootShadowView *rootShadowView = (RCTRootShadowView *)shadowView;
|
|
509
|
-
|
|
510
|
-
if (CGSizeEqualToSize(availableSize, rootShadowView.availableSize)) {
|
|
511
|
-
return;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
rootShadowView.availableSize = availableSize;
|
|
515
|
-
[self setNeedsLayout];
|
|
516
|
-
}
|
|
517
|
-
forTag:rootView.reactTag];
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
- (void)setLocalData:(NSObject *)localData forView:(UIView *)view
|
|
521
|
-
{
|
|
522
|
-
RCTAssertMainQueue();
|
|
523
|
-
[self
|
|
524
|
-
_executeBlockWithShadowView:^(RCTShadowView *shadowView) {
|
|
525
|
-
shadowView.localData = localData;
|
|
526
|
-
[self setNeedsLayout];
|
|
527
|
-
}
|
|
528
|
-
forTag:view.reactTag];
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
- (UIView *)viewForNativeID:(NSString *)nativeID withRootTag:(NSNumber *)rootTag
|
|
532
|
-
{
|
|
533
|
-
if (!nativeID || !rootTag) {
|
|
534
|
-
return nil;
|
|
535
|
-
}
|
|
536
|
-
UIView *view;
|
|
537
|
-
@synchronized(self) {
|
|
538
|
-
view = [_nativeIDRegistry objectForKey:RCTNativeIDRegistryKey(nativeID, rootTag)];
|
|
539
|
-
}
|
|
540
|
-
return view;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
- (void)setNativeID:(NSString *)nativeID forView:(UIView *)view
|
|
544
|
-
{
|
|
545
|
-
if (!nativeID || !view) {
|
|
546
|
-
return;
|
|
547
|
-
}
|
|
548
|
-
__weak RCTUIManager *weakSelf = self;
|
|
549
|
-
RCTExecuteOnUIManagerQueue(^{
|
|
550
|
-
NSNumber *rootTag = [weakSelf shadowViewForReactTag:view.reactTag].rootView.reactTag;
|
|
551
|
-
@synchronized(weakSelf) {
|
|
552
|
-
[weakSelf.nativeIDRegistry setObject:view forKey:RCTNativeIDRegistryKey(nativeID, rootTag)];
|
|
553
|
-
}
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
- (void)setSize:(CGSize)size forView:(UIView *)view
|
|
558
|
-
{
|
|
559
|
-
RCTAssertMainQueue();
|
|
560
|
-
[self
|
|
561
|
-
_executeBlockWithShadowView:^(RCTShadowView *shadowView) {
|
|
562
|
-
if (CGSizeEqualToSize(size, shadowView.size)) {
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
shadowView.size = size;
|
|
567
|
-
[self setNeedsLayout];
|
|
568
|
-
}
|
|
569
|
-
forTag:view.reactTag];
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
- (void)setIntrinsicContentSize:(CGSize)intrinsicContentSize forView:(UIView *)view
|
|
573
|
-
{
|
|
574
|
-
RCTAssertMainQueue();
|
|
575
|
-
[self
|
|
576
|
-
_executeBlockWithShadowView:^(RCTShadowView *shadowView) {
|
|
577
|
-
if (CGSizeEqualToSize(shadowView.intrinsicContentSize, intrinsicContentSize)) {
|
|
578
|
-
return;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
shadowView.intrinsicContentSize = intrinsicContentSize;
|
|
582
|
-
[self setNeedsLayout];
|
|
583
|
-
}
|
|
584
|
-
forTag:view.reactTag];
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
/**
|
|
588
|
-
* Unregisters views from registries
|
|
589
|
-
*/
|
|
590
|
-
- (void)_purgeChildren:(NSArray<id<RCTComponent>> *)children
|
|
591
|
-
fromRegistry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)registry
|
|
592
|
-
{
|
|
593
|
-
for (id<RCTComponent> child in children) {
|
|
594
|
-
RCTTraverseViewNodes(registry[child.reactTag], ^(id<RCTComponent> subview) {
|
|
595
|
-
RCTAssert(![subview isReactRootView], @"Root views should not be unregistered");
|
|
596
|
-
if ([subview conformsToProtocol:@protocol(RCTInvalidating)]) {
|
|
597
|
-
[(id<RCTInvalidating>)subview invalidate];
|
|
598
|
-
}
|
|
599
|
-
[registry removeObjectForKey:subview.reactTag];
|
|
600
|
-
});
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
- (void)addUIBlock:(RCTViewManagerUIBlock)block
|
|
605
|
-
{
|
|
606
|
-
RCTAssertUIManagerQueue();
|
|
607
|
-
|
|
608
|
-
if (!block || !_viewRegistry) {
|
|
609
|
-
return;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
[_pendingUIBlocks addObject:block];
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
- (void)prependUIBlock:(RCTViewManagerUIBlock)block
|
|
616
|
-
{
|
|
617
|
-
RCTAssertUIManagerQueue();
|
|
618
|
-
|
|
619
|
-
if (!block || !_viewRegistry) {
|
|
620
|
-
return;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
[_pendingUIBlocks insertObject:block atIndex:0];
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
- (void)setNextLayoutAnimationGroup:(RCTLayoutAnimationGroup *)layoutAnimationGroup
|
|
627
|
-
{
|
|
628
|
-
RCTAssertMainQueue();
|
|
629
|
-
|
|
630
|
-
if (_layoutAnimationGroup && ![_layoutAnimationGroup isEqual:layoutAnimationGroup]) {
|
|
631
|
-
RCTLogWarn(
|
|
632
|
-
@"Warning: Overriding previous layout animation with new one before the first began:\n%@ -> %@.",
|
|
633
|
-
[_layoutAnimationGroup description],
|
|
634
|
-
[layoutAnimationGroup description]);
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
_layoutAnimationGroup = layoutAnimationGroup;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
- (RCTViewManagerUIBlock)uiBlockWithLayoutUpdateForRootView:(RCTRootShadowView *)rootShadowView
|
|
641
|
-
{
|
|
642
|
-
RCTAssertUIManagerQueue();
|
|
643
|
-
|
|
644
|
-
NSPointerArray *affectedShadowViews = [NSPointerArray weakObjectsPointerArray];
|
|
645
|
-
[rootShadowView layoutWithAffectedShadowViews:affectedShadowViews];
|
|
646
|
-
|
|
647
|
-
if (!affectedShadowViews.count) {
|
|
648
|
-
// no frame change results in no UI update block
|
|
649
|
-
return nil;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
typedef struct {
|
|
653
|
-
CGRect frame;
|
|
654
|
-
UIUserInterfaceLayoutDirection layoutDirection;
|
|
655
|
-
BOOL isNew;
|
|
656
|
-
BOOL parentIsNew;
|
|
657
|
-
RCTDisplayType displayType;
|
|
658
|
-
} RCTFrameData;
|
|
659
|
-
|
|
660
|
-
// Construct arrays then hand off to main thread
|
|
661
|
-
NSUInteger count = affectedShadowViews.count;
|
|
662
|
-
NSMutableArray *reactTags = [[NSMutableArray alloc] initWithCapacity:count];
|
|
663
|
-
NSMutableData *framesData = [[NSMutableData alloc] initWithLength:sizeof(RCTFrameData) * count];
|
|
664
|
-
{
|
|
665
|
-
NSUInteger index = 0;
|
|
666
|
-
RCTFrameData *frameDataArray = (RCTFrameData *)framesData.mutableBytes;
|
|
667
|
-
for (RCTShadowView *shadowView in affectedShadowViews) {
|
|
668
|
-
reactTags[index] = shadowView.reactTag;
|
|
669
|
-
RCTLayoutMetrics layoutMetrics = shadowView.layoutMetrics;
|
|
670
|
-
frameDataArray[index++] = (RCTFrameData){layoutMetrics.frame,
|
|
671
|
-
layoutMetrics.layoutDirection,
|
|
672
|
-
shadowView.isNewView,
|
|
673
|
-
shadowView.superview.isNewView,
|
|
674
|
-
layoutMetrics.displayType};
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
for (RCTShadowView *shadowView in affectedShadowViews) {
|
|
679
|
-
// We have to do this after we build the parentsAreNew array.
|
|
680
|
-
shadowView.newView = NO;
|
|
681
|
-
|
|
682
|
-
NSNumber *reactTag = shadowView.reactTag;
|
|
683
|
-
|
|
684
|
-
if (shadowView.onLayout) {
|
|
685
|
-
CGRect frame = shadowView.layoutMetrics.frame;
|
|
686
|
-
shadowView.onLayout(@{
|
|
687
|
-
@"layout" : @{
|
|
688
|
-
@"x" : @(frame.origin.x),
|
|
689
|
-
@"y" : @(frame.origin.y),
|
|
690
|
-
@"width" : @(frame.size.width),
|
|
691
|
-
@"height" : @(frame.size.height),
|
|
692
|
-
},
|
|
693
|
-
});
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
if (RCTIsReactRootView(reactTag) && [shadowView isKindOfClass:[RCTRootShadowView class]]) {
|
|
697
|
-
CGSize contentSize = shadowView.layoutMetrics.frame.size;
|
|
698
|
-
|
|
699
|
-
RCTExecuteOnMainQueue(^{
|
|
700
|
-
UIView *view = self->_viewRegistry[reactTag];
|
|
701
|
-
RCTAssert(view != nil, @"view (for ID %@) not found", reactTag);
|
|
702
|
-
|
|
703
|
-
RCTRootView *rootView = (RCTRootView *)[view superview];
|
|
704
|
-
if ([rootView isKindOfClass:[RCTRootView class]]) {
|
|
705
|
-
rootView.intrinsicContentSize = contentSize;
|
|
706
|
-
}
|
|
707
|
-
});
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
// Perform layout (possibly animated)
|
|
712
|
-
return ^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
713
|
-
const RCTFrameData *frameDataArray = (const RCTFrameData *)framesData.bytes;
|
|
714
|
-
RCTLayoutAnimationGroup *layoutAnimationGroup = uiManager->_layoutAnimationGroup;
|
|
715
|
-
|
|
716
|
-
__block NSUInteger completionsCalled = 0;
|
|
717
|
-
|
|
718
|
-
NSInteger index = 0;
|
|
719
|
-
for (NSNumber *reactTag in reactTags) {
|
|
720
|
-
RCTFrameData frameData = frameDataArray[index++];
|
|
721
|
-
|
|
722
|
-
UIView *view = viewRegistry[reactTag];
|
|
723
|
-
CGRect frame = frameData.frame;
|
|
724
|
-
|
|
725
|
-
UIUserInterfaceLayoutDirection layoutDirection = frameData.layoutDirection;
|
|
726
|
-
BOOL isNew = frameData.isNew;
|
|
727
|
-
RCTLayoutAnimation *updatingLayoutAnimation = isNew ? nil : layoutAnimationGroup.updatingLayoutAnimation;
|
|
728
|
-
BOOL shouldAnimateCreation = isNew && !frameData.parentIsNew;
|
|
729
|
-
RCTLayoutAnimation *creatingLayoutAnimation =
|
|
730
|
-
shouldAnimateCreation ? layoutAnimationGroup.creatingLayoutAnimation : nil;
|
|
731
|
-
BOOL isHidden = frameData.displayType == RCTDisplayTypeNone;
|
|
732
|
-
|
|
733
|
-
void (^completion)(BOOL) = ^(BOOL finished) {
|
|
734
|
-
completionsCalled++;
|
|
735
|
-
if (layoutAnimationGroup.callback && completionsCalled == count) {
|
|
736
|
-
layoutAnimationGroup.callback(@[ @(finished) ]);
|
|
737
|
-
|
|
738
|
-
// It's unsafe to call this callback more than once, so we nil it out here
|
|
739
|
-
// to make sure that doesn't happen.
|
|
740
|
-
layoutAnimationGroup.callback = nil;
|
|
741
|
-
}
|
|
742
|
-
};
|
|
743
|
-
|
|
744
|
-
if (view.reactLayoutDirection != layoutDirection) {
|
|
745
|
-
view.reactLayoutDirection = layoutDirection;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
if (view.isHidden != isHidden) {
|
|
749
|
-
view.hidden = isHidden;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
if (creatingLayoutAnimation) {
|
|
753
|
-
// Animate view creation
|
|
754
|
-
[view reactSetFrame:frame];
|
|
755
|
-
|
|
756
|
-
CATransform3D finalTransform = view.layer.transform;
|
|
757
|
-
CGFloat finalOpacity = view.layer.opacity;
|
|
758
|
-
|
|
759
|
-
NSString *property = creatingLayoutAnimation.property;
|
|
760
|
-
if ([property isEqualToString:@"scaleXY"]) {
|
|
761
|
-
view.layer.transform = CATransform3DMakeScale(0, 0, 0);
|
|
762
|
-
} else if ([property isEqualToString:@"scaleX"]) {
|
|
763
|
-
view.layer.transform = CATransform3DMakeScale(0, 1, 0);
|
|
764
|
-
} else if ([property isEqualToString:@"scaleY"]) {
|
|
765
|
-
view.layer.transform = CATransform3DMakeScale(1, 0, 0);
|
|
766
|
-
} else if ([property isEqualToString:@"opacity"]) {
|
|
767
|
-
view.layer.opacity = 0.0;
|
|
768
|
-
} else {
|
|
769
|
-
RCTLogError(@"Unsupported layout animation createConfig property %@", creatingLayoutAnimation.property);
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
[creatingLayoutAnimation
|
|
773
|
-
performAnimations:^{
|
|
774
|
-
if ([property isEqualToString:@"scaleX"] || [property isEqualToString:@"scaleY"] ||
|
|
775
|
-
[property isEqualToString:@"scaleXY"]) {
|
|
776
|
-
view.layer.transform = finalTransform;
|
|
777
|
-
} else if ([property isEqualToString:@"opacity"]) {
|
|
778
|
-
view.layer.opacity = finalOpacity;
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
withCompletionBlock:completion];
|
|
782
|
-
|
|
783
|
-
} else if (updatingLayoutAnimation) {
|
|
784
|
-
// Animate view update
|
|
785
|
-
[updatingLayoutAnimation
|
|
786
|
-
performAnimations:^{
|
|
787
|
-
[view reactSetFrame:frame];
|
|
788
|
-
}
|
|
789
|
-
withCompletionBlock:completion];
|
|
790
|
-
|
|
791
|
-
} else {
|
|
792
|
-
// Update without animation
|
|
793
|
-
[view reactSetFrame:frame];
|
|
794
|
-
completion(YES);
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
// Clean up
|
|
799
|
-
uiManager->_layoutAnimationGroup = nil;
|
|
800
|
-
};
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
/**
|
|
804
|
-
* Disassociates children from container. Doesn't remove from registries.
|
|
805
|
-
* TODO: use [NSArray getObjects:buffer] to reuse same fast buffer each time.
|
|
806
|
-
*
|
|
807
|
-
* @returns Array of removed items.
|
|
808
|
-
*/
|
|
809
|
-
- (NSArray<id<RCTComponent>> *)_childrenToRemoveFromContainer:(id<RCTComponent>)container
|
|
810
|
-
atIndices:(NSArray<NSNumber *> *)atIndices
|
|
811
|
-
{
|
|
812
|
-
// If there are no indices to move or the container has no subviews don't bother
|
|
813
|
-
// We support parents with nil subviews so long as they're all nil so this allows for this behavior
|
|
814
|
-
if (atIndices.count == 0 || [container reactSubviews].count == 0) {
|
|
815
|
-
return nil;
|
|
816
|
-
}
|
|
817
|
-
// Construction of removed children must be done "up front", before indices are disturbed by removals.
|
|
818
|
-
NSMutableArray<id<RCTComponent>> *removedChildren = [NSMutableArray arrayWithCapacity:atIndices.count];
|
|
819
|
-
RCTAssert(container != nil, @"container view (for ID %@) not found", container);
|
|
820
|
-
for (NSNumber *indexNumber in atIndices) {
|
|
821
|
-
NSUInteger index = indexNumber.unsignedIntegerValue;
|
|
822
|
-
if (index < [container reactSubviews].count) {
|
|
823
|
-
[removedChildren addObject:[container reactSubviews][index]];
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
if (removedChildren.count != atIndices.count) {
|
|
827
|
-
NSString *message = [NSString stringWithFormat:@"removedChildren count (%tu) was not what we expected (%tu)",
|
|
828
|
-
removedChildren.count,
|
|
829
|
-
atIndices.count];
|
|
830
|
-
RCTFatal(RCTErrorWithMessage(message));
|
|
831
|
-
}
|
|
832
|
-
return removedChildren;
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
- (void)_removeChildren:(NSArray<id<RCTComponent>> *)children fromContainer:(id<RCTComponent>)container
|
|
836
|
-
{
|
|
837
|
-
for (id<RCTComponent> removedChild in children) {
|
|
838
|
-
[container removeReactSubview:removedChild];
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
/**
|
|
843
|
-
* Remove subviews from their parent with an animation.
|
|
844
|
-
*/
|
|
845
|
-
- (void)_removeChildren:(NSArray<UIView *> *)children
|
|
846
|
-
fromContainer:(UIView *)container
|
|
847
|
-
withAnimation:(RCTLayoutAnimationGroup *)animation
|
|
848
|
-
{
|
|
849
|
-
RCTAssertMainQueue();
|
|
850
|
-
RCTLayoutAnimation *deletingLayoutAnimation = animation.deletingLayoutAnimation;
|
|
851
|
-
|
|
852
|
-
__block NSUInteger completionsCalled = 0;
|
|
853
|
-
for (UIView *removedChild in children) {
|
|
854
|
-
void (^completion)(BOOL) = ^(BOOL finished) {
|
|
855
|
-
completionsCalled++;
|
|
856
|
-
|
|
857
|
-
[removedChild removeFromSuperview];
|
|
858
|
-
|
|
859
|
-
if (animation.callback && completionsCalled == children.count) {
|
|
860
|
-
animation.callback(@[ @(finished) ]);
|
|
861
|
-
|
|
862
|
-
// It's unsafe to call this callback more than once, so we nil it out here
|
|
863
|
-
// to make sure that doesn't happen.
|
|
864
|
-
animation.callback = nil;
|
|
865
|
-
}
|
|
866
|
-
};
|
|
867
|
-
|
|
868
|
-
// Hack: At this moment we have two contradict intents.
|
|
869
|
-
// First one: We want to delete the view from view hierarchy.
|
|
870
|
-
// Second one: We want to animate this view, which implies the existence of this view in the hierarchy.
|
|
871
|
-
// So, we have to remove this view from React's view hierarchy but postpone removing from UIKit's hierarchy.
|
|
872
|
-
// Here the problem: the default implementation of `-[UIView removeReactSubview:]` also removes the view from
|
|
873
|
-
// UIKit's hierarchy. So, let's temporary restore the view back after removing. To do so, we have to memorize
|
|
874
|
-
// original `superview` (which can differ from `container`) and an index of removed view.
|
|
875
|
-
UIView *originalSuperview = removedChild.superview;
|
|
876
|
-
NSUInteger originalIndex = [originalSuperview.subviews indexOfObjectIdenticalTo:removedChild];
|
|
877
|
-
[container removeReactSubview:removedChild];
|
|
878
|
-
// Disable user interaction while the view is animating
|
|
879
|
-
// since the view is (conceptually) deleted and not supposed to be interactive.
|
|
880
|
-
removedChild.userInteractionEnabled = NO;
|
|
881
|
-
[originalSuperview insertSubview:removedChild atIndex:originalIndex];
|
|
882
|
-
|
|
883
|
-
NSString *property = deletingLayoutAnimation.property;
|
|
884
|
-
[deletingLayoutAnimation
|
|
885
|
-
performAnimations:^{
|
|
886
|
-
if ([property isEqualToString:@"scaleXY"]) {
|
|
887
|
-
removedChild.layer.transform = CATransform3DMakeScale(0.001, 0.001, 0.001);
|
|
888
|
-
} else if ([property isEqualToString:@"scaleX"]) {
|
|
889
|
-
removedChild.layer.transform = CATransform3DMakeScale(0.001, 1, 0.001);
|
|
890
|
-
} else if ([property isEqualToString:@"scaleY"]) {
|
|
891
|
-
removedChild.layer.transform = CATransform3DMakeScale(1, 0.001, 0.001);
|
|
892
|
-
} else if ([property isEqualToString:@"opacity"]) {
|
|
893
|
-
removedChild.layer.opacity = 0.0;
|
|
894
|
-
} else {
|
|
895
|
-
RCTLogError(@"Unsupported layout animation createConfig property %@", deletingLayoutAnimation.property);
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
withCompletionBlock:completion];
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
RCT_EXPORT_METHOD(removeRootView : (nonnull NSNumber *)rootReactTag)
|
|
903
|
-
{
|
|
904
|
-
RCTShadowView *rootShadowView = _shadowViewRegistry[rootReactTag];
|
|
905
|
-
RCTAssert(rootShadowView.superview == nil, @"root view cannot have superview (ID %@)", rootReactTag);
|
|
906
|
-
[self _purgeChildren:(NSArray<id<RCTComponent>> *)rootShadowView.reactSubviews
|
|
907
|
-
fromRegistry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)_shadowViewRegistry];
|
|
908
|
-
[_shadowViewRegistry removeObjectForKey:rootReactTag];
|
|
909
|
-
[_rootViewTags removeObject:rootReactTag];
|
|
910
|
-
|
|
911
|
-
[self addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
912
|
-
RCTAssertMainQueue();
|
|
913
|
-
UIView *rootView = viewRegistry[rootReactTag];
|
|
914
|
-
[uiManager _purgeChildren:(NSArray<id<RCTComponent>> *)rootView.reactSubviews
|
|
915
|
-
fromRegistry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)viewRegistry];
|
|
916
|
-
[(NSMutableDictionary *)viewRegistry removeObjectForKey:rootReactTag];
|
|
917
|
-
}];
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
RCT_EXPORT_METHOD(setChildren : (nonnull NSNumber *)containerTag reactTags : (NSArray<NSNumber *> *)reactTags)
|
|
921
|
-
{
|
|
922
|
-
RCTSetChildren(containerTag, reactTags, (NSDictionary<NSNumber *, id<RCTComponent>> *)_shadowViewRegistry);
|
|
923
|
-
|
|
924
|
-
[self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
925
|
-
RCTSetChildren(containerTag, reactTags, (NSDictionary<NSNumber *, id<RCTComponent>> *)viewRegistry);
|
|
926
|
-
}];
|
|
927
|
-
|
|
928
|
-
[self _shadowViewDidReceiveUpdatedChildren:_shadowViewRegistry[containerTag]];
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
static void RCTSetChildren(
|
|
932
|
-
NSNumber *containerTag,
|
|
933
|
-
NSArray<NSNumber *> *reactTags,
|
|
934
|
-
NSDictionary<NSNumber *, id<RCTComponent>> *registry)
|
|
935
|
-
{
|
|
936
|
-
id<RCTComponent> container = registry[containerTag];
|
|
937
|
-
NSInteger index = 0;
|
|
938
|
-
for (NSNumber *reactTag in reactTags) {
|
|
939
|
-
id<RCTComponent> view = registry[reactTag];
|
|
940
|
-
if (view) {
|
|
941
|
-
[container insertReactSubview:view atIndex:index++];
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
RCT_EXPORT_METHOD(
|
|
947
|
-
manageChildren : (nonnull NSNumber *)containerTag moveFromIndices : (NSArray<NSNumber *> *)
|
|
948
|
-
moveFromIndices moveToIndices : (NSArray<NSNumber *> *)moveToIndices addChildReactTags : (NSArray<NSNumber *> *)
|
|
949
|
-
addChildReactTags addAtIndices : (NSArray<NSNumber *> *)
|
|
950
|
-
addAtIndices removeAtIndices : (NSArray<NSNumber *> *)removeAtIndices)
|
|
951
|
-
{
|
|
952
|
-
[self _manageChildren:containerTag
|
|
953
|
-
moveFromIndices:moveFromIndices
|
|
954
|
-
moveToIndices:moveToIndices
|
|
955
|
-
addChildReactTags:addChildReactTags
|
|
956
|
-
addAtIndices:addAtIndices
|
|
957
|
-
removeAtIndices:removeAtIndices
|
|
958
|
-
registry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)_shadowViewRegistry];
|
|
959
|
-
|
|
960
|
-
[self addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
961
|
-
[uiManager _manageChildren:containerTag
|
|
962
|
-
moveFromIndices:moveFromIndices
|
|
963
|
-
moveToIndices:moveToIndices
|
|
964
|
-
addChildReactTags:addChildReactTags
|
|
965
|
-
addAtIndices:addAtIndices
|
|
966
|
-
removeAtIndices:removeAtIndices
|
|
967
|
-
registry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)viewRegistry];
|
|
968
|
-
}];
|
|
969
|
-
|
|
970
|
-
[self _shadowViewDidReceiveUpdatedChildren:_shadowViewRegistry[containerTag]];
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
- (void)_manageChildren:(NSNumber *)containerTag
|
|
974
|
-
moveFromIndices:(NSArray<NSNumber *> *)moveFromIndices
|
|
975
|
-
moveToIndices:(NSArray<NSNumber *> *)moveToIndices
|
|
976
|
-
addChildReactTags:(NSArray<NSNumber *> *)addChildReactTags
|
|
977
|
-
addAtIndices:(NSArray<NSNumber *> *)addAtIndices
|
|
978
|
-
removeAtIndices:(NSArray<NSNumber *> *)removeAtIndices
|
|
979
|
-
registry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)registry
|
|
980
|
-
{
|
|
981
|
-
id<RCTComponent> container = registry[containerTag];
|
|
982
|
-
RCTAssert(
|
|
983
|
-
moveFromIndices.count == moveToIndices.count,
|
|
984
|
-
@"moveFromIndices had size %tu, moveToIndices had size %tu",
|
|
985
|
-
moveFromIndices.count,
|
|
986
|
-
moveToIndices.count);
|
|
987
|
-
RCTAssert(addChildReactTags.count == addAtIndices.count, @"there should be at least one React child to add");
|
|
988
|
-
|
|
989
|
-
// Removes (both permanent and temporary moves) are using "before" indices
|
|
990
|
-
NSArray<id<RCTComponent>> *permanentlyRemovedChildren = [self _childrenToRemoveFromContainer:container
|
|
991
|
-
atIndices:removeAtIndices];
|
|
992
|
-
NSArray<id<RCTComponent>> *temporarilyRemovedChildren = [self _childrenToRemoveFromContainer:container
|
|
993
|
-
atIndices:moveFromIndices];
|
|
994
|
-
|
|
995
|
-
BOOL isUIViewRegistry = ((id)registry == (id)_viewRegistry);
|
|
996
|
-
if (isUIViewRegistry && _layoutAnimationGroup.deletingLayoutAnimation) {
|
|
997
|
-
[self _removeChildren:(NSArray<UIView *> *)permanentlyRemovedChildren
|
|
998
|
-
fromContainer:(UIView *)container
|
|
999
|
-
withAnimation:_layoutAnimationGroup];
|
|
1000
|
-
} else {
|
|
1001
|
-
[self _removeChildren:permanentlyRemovedChildren fromContainer:container];
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
[self _removeChildren:temporarilyRemovedChildren fromContainer:container];
|
|
1005
|
-
[self _purgeChildren:permanentlyRemovedChildren fromRegistry:registry];
|
|
1006
|
-
|
|
1007
|
-
// Figure out what to insert - merge temporary inserts and adds
|
|
1008
|
-
NSMutableDictionary *destinationsToChildrenToAdd = [NSMutableDictionary dictionary];
|
|
1009
|
-
for (NSInteger index = 0, length = temporarilyRemovedChildren.count; index < length; index++) {
|
|
1010
|
-
destinationsToChildrenToAdd[moveToIndices[index]] = temporarilyRemovedChildren[index];
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
for (NSInteger index = 0, length = addAtIndices.count; index < length; index++) {
|
|
1014
|
-
id<RCTComponent> view = registry[addChildReactTags[index]];
|
|
1015
|
-
if (view) {
|
|
1016
|
-
destinationsToChildrenToAdd[addAtIndices[index]] = view;
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
NSArray<NSNumber *> *sortedIndices =
|
|
1021
|
-
[destinationsToChildrenToAdd.allKeys sortedArrayUsingSelector:@selector(compare:)];
|
|
1022
|
-
for (NSNumber *reactIndex in sortedIndices) {
|
|
1023
|
-
[container insertReactSubview:destinationsToChildrenToAdd[reactIndex] atIndex:reactIndex.integerValue];
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
|
-
RCT_EXPORT_METHOD(
|
|
1028
|
-
createView : (nonnull NSNumber *)reactTag viewName : (NSString *)viewName rootTag : (nonnull NSNumber *)
|
|
1029
|
-
rootTag props : (NSDictionary *)props)
|
|
1030
|
-
{
|
|
1031
|
-
RCTComponentData *componentData = _componentDataByName[viewName];
|
|
1032
|
-
if (componentData == nil) {
|
|
1033
|
-
RCTLogError(@"No component found for view with name \"%@\"", viewName);
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
// Register shadow view
|
|
1037
|
-
RCTShadowView *shadowView = [componentData createShadowViewWithTag:reactTag];
|
|
1038
|
-
if (shadowView) {
|
|
1039
|
-
[componentData setProps:props forShadowView:shadowView];
|
|
1040
|
-
_shadowViewRegistry[reactTag] = shadowView;
|
|
1041
|
-
RCTShadowView *rootView = _shadowViewRegistry[rootTag];
|
|
1042
|
-
RCTAssert(
|
|
1043
|
-
[rootView isKindOfClass:[RCTRootShadowView class]] || [rootView isKindOfClass:[RCTSurfaceRootShadowView class]],
|
|
1044
|
-
@"Given `rootTag` (%@) does not correspond to a valid root shadow view instance.",
|
|
1045
|
-
rootTag);
|
|
1046
|
-
shadowView.rootView = (RCTRootShadowView *)rootView;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
// Dispatch view creation directly to the main thread instead of adding to
|
|
1050
|
-
// UIBlocks array. This way, it doesn't get deferred until after layout.
|
|
1051
|
-
__block UIView *preliminaryCreatedView = nil;
|
|
1052
|
-
|
|
1053
|
-
void (^createViewBlock)(void) = ^{
|
|
1054
|
-
// Do nothing on the second run.
|
|
1055
|
-
if (preliminaryCreatedView) {
|
|
1056
|
-
return;
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
preliminaryCreatedView = [componentData createViewWithTag:reactTag rootTag:rootTag];
|
|
1060
|
-
|
|
1061
|
-
if (preliminaryCreatedView) {
|
|
1062
|
-
self->_viewRegistry[reactTag] = preliminaryCreatedView;
|
|
1063
|
-
}
|
|
1064
|
-
};
|
|
1065
|
-
|
|
1066
|
-
// We cannot guarantee that asynchronously scheduled block will be executed
|
|
1067
|
-
// *before* a block is added to the regular mounting process (simply because
|
|
1068
|
-
// mounting process can be managed externally while the main queue is
|
|
1069
|
-
// locked).
|
|
1070
|
-
// So, we positively dispatch it asynchronously and double check inside
|
|
1071
|
-
// the regular mounting block.
|
|
1072
|
-
|
|
1073
|
-
RCTExecuteOnMainQueue(createViewBlock);
|
|
1074
|
-
|
|
1075
|
-
[self addUIBlock:^(__unused RCTUIManager *uiManager, __unused NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
1076
|
-
createViewBlock();
|
|
1077
|
-
|
|
1078
|
-
if (preliminaryCreatedView) {
|
|
1079
|
-
[componentData setProps:props forView:preliminaryCreatedView];
|
|
1080
|
-
}
|
|
1081
|
-
}];
|
|
1082
|
-
|
|
1083
|
-
[self _shadowView:shadowView didReceiveUpdatedProps:[props allKeys]];
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
RCT_EXPORT_METHOD(
|
|
1087
|
-
updateView : (nonnull NSNumber *)reactTag viewName : (NSString *)
|
|
1088
|
-
viewName // not always reliable, use shadowView.viewName if available
|
|
1089
|
-
props : (NSDictionary *)props)
|
|
1090
|
-
{
|
|
1091
|
-
RCTShadowView *shadowView = _shadowViewRegistry[reactTag];
|
|
1092
|
-
RCTComponentData *componentData = _componentDataByName[shadowView.viewName ?: viewName];
|
|
1093
|
-
[componentData setProps:props forShadowView:shadowView];
|
|
1094
|
-
|
|
1095
|
-
[self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
1096
|
-
UIView *view = viewRegistry[reactTag];
|
|
1097
|
-
[componentData setProps:props forView:view];
|
|
1098
|
-
}];
|
|
1099
|
-
|
|
1100
|
-
[self _shadowView:shadowView didReceiveUpdatedProps:[props allKeys]];
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
- (void)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag viewName:(NSString *)viewName props:(NSDictionary *)props
|
|
1104
|
-
{
|
|
1105
|
-
RCTAssertMainQueue();
|
|
1106
|
-
RCTComponentData *componentData = _componentDataByName[viewName];
|
|
1107
|
-
UIView *view = _viewRegistry[reactTag];
|
|
1108
|
-
[componentData setProps:props forView:view];
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
RCT_EXPORT_METHOD(focus : (nonnull NSNumber *)reactTag)
|
|
1112
|
-
{
|
|
1113
|
-
[self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
1114
|
-
UIView *newResponder = viewRegistry[reactTag];
|
|
1115
|
-
[newResponder reactFocus];
|
|
1116
|
-
}];
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
RCT_EXPORT_METHOD(blur : (nonnull NSNumber *)reactTag)
|
|
1120
|
-
{
|
|
1121
|
-
[self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
1122
|
-
UIView *currentResponder = viewRegistry[reactTag];
|
|
1123
|
-
[currentResponder reactBlur];
|
|
1124
|
-
}];
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
RCT_EXPORT_METHOD(
|
|
1128
|
-
findSubviewIn : (nonnull NSNumber *)reactTag atPoint : (CGPoint)point callback : (RCTResponseSenderBlock)callback)
|
|
1129
|
-
{
|
|
1130
|
-
[self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
1131
|
-
UIView *view = viewRegistry[reactTag];
|
|
1132
|
-
UIView *target = [view hitTest:point withEvent:nil];
|
|
1133
|
-
CGRect frame = [target convertRect:target.bounds toView:view];
|
|
1134
|
-
|
|
1135
|
-
while (target.reactTag == nil && target.superview != nil) {
|
|
1136
|
-
target = target.superview;
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
callback(@[
|
|
1140
|
-
RCTNullIfNil(target.reactTag),
|
|
1141
|
-
@(frame.origin.x),
|
|
1142
|
-
@(frame.origin.y),
|
|
1143
|
-
@(frame.size.width),
|
|
1144
|
-
@(frame.size.height),
|
|
1145
|
-
]);
|
|
1146
|
-
}];
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
RCT_EXPORT_METHOD(
|
|
1150
|
-
dispatchViewManagerCommand : (nonnull NSNumber *)reactTag commandID : (id /*(NSString or NSNumber) */)
|
|
1151
|
-
commandID commandArgs : (NSArray<id> *)commandArgs)
|
|
1152
|
-
{
|
|
1153
|
-
RCTShadowView *shadowView = _shadowViewRegistry[reactTag];
|
|
1154
|
-
RCTComponentData *componentData = _componentDataByName[shadowView.viewName];
|
|
1155
|
-
|
|
1156
|
-
// Achtung! Achtung!
|
|
1157
|
-
// This is a remarkably hacky and ugly workaround.
|
|
1158
|
-
// We need this only temporary for some testing. We need this hack until Fabric fully implements command-execution
|
|
1159
|
-
// pipeline. This does not affect non-Fabric apps.
|
|
1160
|
-
#pragma clang diagnostic push
|
|
1161
|
-
#pragma clang diagnostic ignored "-Wundeclared-selector"
|
|
1162
|
-
if (!componentData) {
|
|
1163
|
-
__block UIView *view;
|
|
1164
|
-
RCTUnsafeExecuteOnMainQueueSync(^{
|
|
1165
|
-
view = self->_viewRegistry[reactTag];
|
|
1166
|
-
});
|
|
1167
|
-
if ([view respondsToSelector:@selector(componentViewName_DO_NOT_USE_THIS_IS_BROKEN)]) {
|
|
1168
|
-
NSString *name = [view performSelector:@selector(componentViewName_DO_NOT_USE_THIS_IS_BROKEN)];
|
|
1169
|
-
componentData = _componentDataByName[[NSString stringWithFormat:@"RCT%@", name]];
|
|
1170
|
-
}
|
|
1171
|
-
}
|
|
1172
|
-
#pragma clang diagnostic pop
|
|
1173
|
-
|
|
1174
|
-
Class managerClass = componentData.managerClass;
|
|
1175
|
-
RCTModuleData *moduleData = [_bridge moduleDataForName:RCTBridgeModuleNameForClass(managerClass)];
|
|
1176
|
-
|
|
1177
|
-
id<RCTBridgeMethod> method;
|
|
1178
|
-
if ([commandID isKindOfClass:[NSNumber class]]) {
|
|
1179
|
-
method = moduleData.methods[[commandID intValue]];
|
|
1180
|
-
} else if ([commandID isKindOfClass:[NSString class]]) {
|
|
1181
|
-
method = moduleData.methodsByName[commandID];
|
|
1182
|
-
if (method == nil) {
|
|
1183
|
-
RCTLogError(@"No command found with name \"%@\"", commandID);
|
|
1184
|
-
}
|
|
1185
|
-
} else {
|
|
1186
|
-
RCTLogError(@"dispatchViewManagerCommand must be called with a string or integer command");
|
|
1187
|
-
return;
|
|
1188
|
-
}
|
|
1189
|
-
|
|
1190
|
-
NSArray *args = [@[ reactTag ] arrayByAddingObjectsFromArray:commandArgs];
|
|
1191
|
-
[method invokeWithBridge:_bridge module:componentData.manager arguments:args];
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
- (void)batchDidComplete
|
|
1195
|
-
{
|
|
1196
|
-
[self _layoutAndMount];
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
/**
|
|
1200
|
-
* Sets up animations, computes layout, creates UI mounting blocks for computed layout,
|
|
1201
|
-
* runs these blocks and all other already existing blocks.
|
|
1202
|
-
*/
|
|
1203
|
-
- (void)_layoutAndMount
|
|
1204
|
-
{
|
|
1205
|
-
[self _dispatchPropsDidChangeEvents];
|
|
1206
|
-
[self _dispatchChildrenDidChangeEvents];
|
|
1207
|
-
|
|
1208
|
-
[_observerCoordinator uiManagerWillPerformLayout:self];
|
|
1209
|
-
|
|
1210
|
-
// Perform layout
|
|
1211
|
-
for (NSNumber *reactTag in _rootViewTags) {
|
|
1212
|
-
RCTRootShadowView *rootView = (RCTRootShadowView *)_shadowViewRegistry[reactTag];
|
|
1213
|
-
[self addUIBlock:[self uiBlockWithLayoutUpdateForRootView:rootView]];
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
[_observerCoordinator uiManagerDidPerformLayout:self];
|
|
1217
|
-
|
|
1218
|
-
[_observerCoordinator uiManagerWillPerformMounting:self];
|
|
1219
|
-
|
|
1220
|
-
[self flushUIBlocksWithCompletion:^{
|
|
1221
|
-
[self->_observerCoordinator uiManagerDidPerformMounting:self];
|
|
1222
|
-
}];
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
- (void)flushUIBlocksWithCompletion:(void (^)(void))completion
|
|
1226
|
-
{
|
|
1227
|
-
RCTAssertUIManagerQueue();
|
|
1228
|
-
|
|
1229
|
-
// First copy the previous blocks into a temporary variable, then reset the
|
|
1230
|
-
// pending blocks to a new array. This guards against mutation while
|
|
1231
|
-
// processing the pending blocks in another thread.
|
|
1232
|
-
NSArray<RCTViewManagerUIBlock> *previousPendingUIBlocks = _pendingUIBlocks;
|
|
1233
|
-
_pendingUIBlocks = [NSMutableArray new];
|
|
1234
|
-
|
|
1235
|
-
if (previousPendingUIBlocks.count == 0) {
|
|
1236
|
-
completion();
|
|
1237
|
-
return;
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
__weak __typeof(self) weakSelf = self;
|
|
1241
|
-
|
|
1242
|
-
void (^mountingBlock)(void) = ^{
|
|
1243
|
-
__typeof(self) strongSelf = weakSelf;
|
|
1244
|
-
|
|
1245
|
-
@try {
|
|
1246
|
-
for (RCTViewManagerUIBlock block in previousPendingUIBlocks) {
|
|
1247
|
-
RCTComposedViewRegistry *composedViewRegistry =
|
|
1248
|
-
[[RCTComposedViewRegistry alloc] initWithUIManager:strongSelf andRegistry:strongSelf->_viewRegistry];
|
|
1249
|
-
block(strongSelf, composedViewRegistry);
|
|
1250
|
-
}
|
|
1251
|
-
} @catch (NSException *__unused exception) {
|
|
1252
|
-
RCTLogError(@"Exception thrown while executing UI block: %@", exception);
|
|
1253
|
-
}
|
|
1254
|
-
};
|
|
1255
|
-
|
|
1256
|
-
if ([self.observerCoordinator uiManager:self performMountingWithBlock:mountingBlock]) {
|
|
1257
|
-
completion();
|
|
1258
|
-
return;
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
// Execute the previously queued UI blocks
|
|
1262
|
-
RCTProfileBeginFlowEvent();
|
|
1263
|
-
RCTExecuteOnMainQueue(^{
|
|
1264
|
-
RCTProfileEndFlowEvent();
|
|
1265
|
-
RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @"-[UIManager flushUIBlocks]", (@{
|
|
1266
|
-
@"count" : [@(previousPendingUIBlocks.count) stringValue],
|
|
1267
|
-
}));
|
|
1268
|
-
|
|
1269
|
-
mountingBlock();
|
|
1270
|
-
|
|
1271
|
-
RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @"");
|
|
1272
|
-
|
|
1273
|
-
RCTExecuteOnUIManagerQueue(completion);
|
|
1274
|
-
});
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
- (void)setNeedsLayout
|
|
1278
|
-
{
|
|
1279
|
-
// If there is an active batch layout will happen when batch finished, so we will wait for that.
|
|
1280
|
-
// Otherwise we immediately trigger layout.
|
|
1281
|
-
if (![_bridge isBatchActive] && ![_bridge isLoading]) {
|
|
1282
|
-
[self _layoutAndMount];
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
- (void)_shadowView:(RCTShadowView *)shadowView didReceiveUpdatedProps:(NSArray<NSString *> *)props
|
|
1287
|
-
{
|
|
1288
|
-
// We collect a set with changed `shadowViews` and its changed props,
|
|
1289
|
-
// so we have to maintain this collection properly.
|
|
1290
|
-
NSArray<NSString *> *previousProps;
|
|
1291
|
-
if ((previousProps = [_shadowViewsWithUpdatedProps objectForKey:shadowView])) {
|
|
1292
|
-
// Merging already registered changed props and new ones.
|
|
1293
|
-
NSMutableSet *set = [NSMutableSet setWithArray:previousProps];
|
|
1294
|
-
[set addObjectsFromArray:props];
|
|
1295
|
-
props = [set allObjects];
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
[_shadowViewsWithUpdatedProps setObject:props forKey:shadowView];
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
- (void)_shadowViewDidReceiveUpdatedChildren:(RCTShadowView *)shadowView
|
|
1302
|
-
{
|
|
1303
|
-
[_shadowViewsWithUpdatedChildren addObject:shadowView];
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
- (void)_dispatchChildrenDidChangeEvents
|
|
1307
|
-
{
|
|
1308
|
-
if (_shadowViewsWithUpdatedChildren.count == 0) {
|
|
1309
|
-
return;
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
NSHashTable<RCTShadowView *> *shadowViews = _shadowViewsWithUpdatedChildren;
|
|
1313
|
-
_shadowViewsWithUpdatedChildren = [NSHashTable weakObjectsHashTable];
|
|
1314
|
-
|
|
1315
|
-
NSMutableArray *tags = [NSMutableArray arrayWithCapacity:shadowViews.count];
|
|
1316
|
-
|
|
1317
|
-
for (RCTShadowView *shadowView in shadowViews) {
|
|
1318
|
-
[shadowView didUpdateReactSubviews];
|
|
1319
|
-
[tags addObject:shadowView.reactTag];
|
|
1320
|
-
}
|
|
1321
|
-
|
|
1322
|
-
[self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
1323
|
-
for (NSNumber *tag in tags) {
|
|
1324
|
-
UIView<RCTComponent> *view = viewRegistry[tag];
|
|
1325
|
-
[view didUpdateReactSubviews];
|
|
1326
|
-
}
|
|
1327
|
-
}];
|
|
1328
|
-
}
|
|
1329
|
-
|
|
1330
|
-
- (void)_dispatchPropsDidChangeEvents
|
|
1331
|
-
{
|
|
1332
|
-
if (_shadowViewsWithUpdatedProps.count == 0) {
|
|
1333
|
-
return;
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
NSMapTable<RCTShadowView *, NSArray<NSString *> *> *shadowViews = _shadowViewsWithUpdatedProps;
|
|
1337
|
-
_shadowViewsWithUpdatedProps = [NSMapTable weakToStrongObjectsMapTable];
|
|
1338
|
-
|
|
1339
|
-
NSMapTable<NSNumber *, NSArray<NSString *> *> *tags = [NSMapTable strongToStrongObjectsMapTable];
|
|
1340
|
-
|
|
1341
|
-
for (RCTShadowView *shadowView in shadowViews) {
|
|
1342
|
-
NSArray<NSString *> *props = [shadowViews objectForKey:shadowView];
|
|
1343
|
-
[shadowView didSetProps:props];
|
|
1344
|
-
[tags setObject:props forKey:shadowView.reactTag];
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
[self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
1348
|
-
for (NSNumber *tag in tags) {
|
|
1349
|
-
UIView<RCTComponent> *view = viewRegistry[tag];
|
|
1350
|
-
[view didSetProps:[tags objectForKey:tag]];
|
|
1351
|
-
}
|
|
1352
|
-
}];
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
|
-
RCT_EXPORT_METHOD(measure : (nonnull NSNumber *)reactTag callback : (RCTResponseSenderBlock)callback)
|
|
1356
|
-
{
|
|
1357
|
-
[self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
1358
|
-
UIView *view = viewRegistry[reactTag];
|
|
1359
|
-
if (!view) {
|
|
1360
|
-
// this view was probably collapsed out
|
|
1361
|
-
RCTLogWarn(@"measure cannot find view with tag #%@", reactTag);
|
|
1362
|
-
callback(@[]);
|
|
1363
|
-
return;
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
|
-
// If in a <Modal>, rootView will be the root of the modal container.
|
|
1367
|
-
UIView *rootView = view;
|
|
1368
|
-
while (rootView.superview && ![rootView isReactRootView]) {
|
|
1369
|
-
rootView = rootView.superview;
|
|
1370
|
-
}
|
|
1371
|
-
|
|
1372
|
-
// By convention, all coordinates, whether they be touch coordinates, or
|
|
1373
|
-
// measurement coordinates are with respect to the root view.
|
|
1374
|
-
CGRect frame = view.frame;
|
|
1375
|
-
CGRect globalBounds = [view convertRect:view.bounds toView:rootView];
|
|
1376
|
-
|
|
1377
|
-
callback(@[
|
|
1378
|
-
@(frame.origin.x),
|
|
1379
|
-
@(frame.origin.y),
|
|
1380
|
-
@(globalBounds.size.width),
|
|
1381
|
-
@(globalBounds.size.height),
|
|
1382
|
-
@(globalBounds.origin.x),
|
|
1383
|
-
@(globalBounds.origin.y),
|
|
1384
|
-
]);
|
|
1385
|
-
}];
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
RCT_EXPORT_METHOD(measureInWindow : (nonnull NSNumber *)reactTag callback : (RCTResponseSenderBlock)callback)
|
|
1389
|
-
{
|
|
1390
|
-
[self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
1391
|
-
UIView *view = viewRegistry[reactTag];
|
|
1392
|
-
if (!view) {
|
|
1393
|
-
// this view was probably collapsed out
|
|
1394
|
-
RCTLogWarn(@"measure cannot find view with tag #%@", reactTag);
|
|
1395
|
-
callback(@[]);
|
|
1396
|
-
return;
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
// Return frame coordinates in window
|
|
1400
|
-
CGRect windowFrame = [view.window convertRect:view.frame fromView:view.superview];
|
|
1401
|
-
callback(@[
|
|
1402
|
-
@(windowFrame.origin.x),
|
|
1403
|
-
@(windowFrame.origin.y),
|
|
1404
|
-
@(windowFrame.size.width),
|
|
1405
|
-
@(windowFrame.size.height),
|
|
1406
|
-
]);
|
|
1407
|
-
}];
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
/**
|
|
1411
|
-
* Returns if the shadow view provided has the `ancestor` shadow view as
|
|
1412
|
-
* an actual ancestor.
|
|
1413
|
-
*/
|
|
1414
|
-
RCT_EXPORT_METHOD(
|
|
1415
|
-
viewIsDescendantOf : (nonnull NSNumber *)reactTag ancestor : (nonnull NSNumber *)
|
|
1416
|
-
ancestorReactTag callback : (RCTResponseSenderBlock)callback)
|
|
1417
|
-
{
|
|
1418
|
-
RCTShadowView *shadowView = _shadowViewRegistry[reactTag];
|
|
1419
|
-
RCTShadowView *ancestorShadowView = _shadowViewRegistry[ancestorReactTag];
|
|
1420
|
-
if (!shadowView) {
|
|
1421
|
-
return;
|
|
1422
|
-
}
|
|
1423
|
-
if (!ancestorShadowView) {
|
|
1424
|
-
return;
|
|
1425
|
-
}
|
|
1426
|
-
BOOL viewIsAncestor = [shadowView viewIsDescendantOf:ancestorShadowView];
|
|
1427
|
-
callback(@[ @(viewIsAncestor) ]);
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
static void RCTMeasureLayout(RCTShadowView *view, RCTShadowView *ancestor, RCTResponseSenderBlock callback)
|
|
1431
|
-
{
|
|
1432
|
-
if (!view) {
|
|
1433
|
-
return;
|
|
1434
|
-
}
|
|
1435
|
-
if (!ancestor) {
|
|
1436
|
-
return;
|
|
1437
|
-
}
|
|
1438
|
-
CGRect result = [view measureLayoutRelativeToAncestor:ancestor];
|
|
1439
|
-
if (CGRectIsNull(result)) {
|
|
1440
|
-
RCTLogError(
|
|
1441
|
-
@"view %@ (tag #%@) is not a descendant of %@ (tag #%@)", view, view.reactTag, ancestor, ancestor.reactTag);
|
|
1442
|
-
return;
|
|
1443
|
-
}
|
|
1444
|
-
CGFloat leftOffset = result.origin.x;
|
|
1445
|
-
CGFloat topOffset = result.origin.y;
|
|
1446
|
-
CGFloat width = result.size.width;
|
|
1447
|
-
CGFloat height = result.size.height;
|
|
1448
|
-
if (isnan(leftOffset) || isnan(topOffset) || isnan(width) || isnan(height)) {
|
|
1449
|
-
RCTLogError(@"Attempted to measure layout but offset or dimensions were NaN");
|
|
1450
|
-
return;
|
|
1451
|
-
}
|
|
1452
|
-
callback(@[ @(leftOffset), @(topOffset), @(width), @(height) ]);
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
/**
|
|
1456
|
-
* Returns the computed recursive offset layout in a dictionary form. The
|
|
1457
|
-
* returned values are relative to the `ancestor` shadow view. Returns `nil`, if
|
|
1458
|
-
* the `ancestor` shadow view is not actually an `ancestor`. Does not touch
|
|
1459
|
-
* anything on the main UI thread. Invokes supplied callback with (x, y, width,
|
|
1460
|
-
* height).
|
|
1461
|
-
*/
|
|
1462
|
-
RCT_EXPORT_METHOD(
|
|
1463
|
-
measureLayout : (nonnull NSNumber *)reactTag relativeTo : (nonnull NSNumber *)ancestorReactTag errorCallback : (
|
|
1464
|
-
__unused RCTResponseSenderBlock)errorCallback callback : (RCTResponseSenderBlock)callback)
|
|
1465
|
-
{
|
|
1466
|
-
RCTShadowView *shadowView = _shadowViewRegistry[reactTag];
|
|
1467
|
-
RCTShadowView *ancestorShadowView = _shadowViewRegistry[ancestorReactTag];
|
|
1468
|
-
RCTMeasureLayout(shadowView, ancestorShadowView, callback);
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
/**
|
|
1472
|
-
* JS sets what *it* considers to be the responder. Later, scroll views can use
|
|
1473
|
-
* this in order to determine if scrolling is appropriate.
|
|
1474
|
-
*/
|
|
1475
|
-
RCT_EXPORT_METHOD(
|
|
1476
|
-
setJSResponder : (nonnull NSNumber *)reactTag blockNativeResponder : (__unused BOOL)blockNativeResponder)
|
|
1477
|
-
{
|
|
1478
|
-
[self addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
1479
|
-
_jsResponder = viewRegistry[reactTag];
|
|
1480
|
-
// Fabric view's are not stored in viewRegistry. We avoid logging a warning in that case.
|
|
1481
|
-
if (!_jsResponder && !RCTUIManagerTypeForTagIsFabric(reactTag)) {
|
|
1482
|
-
RCTLogWarn(@"Invalid view set to be the JS responder - tag %@", reactTag);
|
|
1483
|
-
}
|
|
1484
|
-
}];
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
|
-
RCT_EXPORT_METHOD(clearJSResponder)
|
|
1488
|
-
{
|
|
1489
|
-
[self addUIBlock:^(__unused RCTUIManager *uiManager, __unused NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
1490
|
-
_jsResponder = nil;
|
|
1491
|
-
}];
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
static NSMutableDictionary<NSString *, id> *moduleConstantsForComponentData(
|
|
1495
|
-
NSMutableDictionary<NSString *, NSDictionary *> *directEvents,
|
|
1496
|
-
NSMutableDictionary<NSString *, NSDictionary *> *bubblingEvents,
|
|
1497
|
-
RCTComponentData *componentData)
|
|
1498
|
-
{
|
|
1499
|
-
return RCTModuleConstantsForDestructuredComponent(
|
|
1500
|
-
directEvents, bubblingEvents, componentData.managerClass, componentData.name, componentData.viewConfig);
|
|
1501
|
-
}
|
|
1502
|
-
|
|
1503
|
-
- (NSDictionary<NSString *, id> *)constantsToExport
|
|
1504
|
-
{
|
|
1505
|
-
return [self getConstants];
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
|
-
- (NSDictionary<NSString *, id> *)getConstants
|
|
1509
|
-
{
|
|
1510
|
-
NSMutableDictionary<NSString *, NSDictionary *> *constants = [NSMutableDictionary new];
|
|
1511
|
-
NSMutableDictionary<NSString *, NSDictionary *> *directEvents = [NSMutableDictionary new];
|
|
1512
|
-
NSMutableDictionary<NSString *, NSDictionary *> *bubblingEvents = [NSMutableDictionary new];
|
|
1513
|
-
|
|
1514
|
-
[_componentDataByName
|
|
1515
|
-
enumerateKeysAndObjectsUsingBlock:^(NSString *name, RCTComponentData *componentData, __unused BOOL *stop) {
|
|
1516
|
-
RCTAssert(!constants[name], @"UIManager already has constants for %@", componentData.name);
|
|
1517
|
-
NSMutableDictionary<NSString *, id> *moduleConstants =
|
|
1518
|
-
moduleConstantsForComponentData(directEvents, bubblingEvents, componentData);
|
|
1519
|
-
constants[name] = moduleConstants;
|
|
1520
|
-
}];
|
|
1521
|
-
|
|
1522
|
-
return constants;
|
|
1523
|
-
}
|
|
1524
|
-
|
|
1525
|
-
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(lazilyLoadView : (NSString *)name)
|
|
1526
|
-
{
|
|
1527
|
-
if (_componentDataByName[name]) {
|
|
1528
|
-
return @{};
|
|
1529
|
-
}
|
|
1530
|
-
|
|
1531
|
-
id<RCTBridgeDelegate> delegate = self.bridge.delegate;
|
|
1532
|
-
if (![delegate respondsToSelector:@selector(bridge:didNotFindModule:)]) {
|
|
1533
|
-
return @{};
|
|
1534
|
-
}
|
|
1535
|
-
|
|
1536
|
-
NSString *moduleName = name;
|
|
1537
|
-
BOOL result = [delegate bridge:self.bridge didNotFindModule:moduleName];
|
|
1538
|
-
if (!result) {
|
|
1539
|
-
moduleName = [name stringByAppendingString:@"Manager"];
|
|
1540
|
-
result = [delegate bridge:self.bridge didNotFindModule:moduleName];
|
|
1541
|
-
}
|
|
1542
|
-
if (!result) {
|
|
1543
|
-
return @{};
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
id module = [self.bridge moduleForName:moduleName lazilyLoadIfNecessary:RCTTurboModuleEnabled()];
|
|
1547
|
-
if (module == nil) {
|
|
1548
|
-
// There is all sorts of code in this codebase that drops prefixes.
|
|
1549
|
-
//
|
|
1550
|
-
// If we didn't find a module, it's possible because it's stored under a key
|
|
1551
|
-
// which had RCT Prefixes stripped. Lets check one more time...
|
|
1552
|
-
module = [self.bridge moduleForName:RCTDropReactPrefixes(moduleName) lazilyLoadIfNecessary:RCTTurboModuleEnabled()];
|
|
1553
|
-
}
|
|
1554
|
-
|
|
1555
|
-
if (!module) {
|
|
1556
|
-
return @{};
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
RCTComponentData *componentData = [[RCTComponentData alloc] initWithManagerClass:[module class]
|
|
1560
|
-
bridge:self.bridge
|
|
1561
|
-
eventDispatcher:self.bridge.eventDispatcher];
|
|
1562
|
-
_componentDataByName[componentData.name] = componentData;
|
|
1563
|
-
NSMutableDictionary *directEvents = [NSMutableDictionary new];
|
|
1564
|
-
NSMutableDictionary *bubblingEvents = [NSMutableDictionary new];
|
|
1565
|
-
NSMutableDictionary<NSString *, id> *moduleConstants =
|
|
1566
|
-
moduleConstantsForComponentData(directEvents, bubblingEvents, componentData);
|
|
1567
|
-
return @{
|
|
1568
|
-
@"viewConfig" : moduleConstants,
|
|
1569
|
-
};
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
RCT_EXPORT_METHOD(
|
|
1573
|
-
configureNextLayoutAnimation : (NSDictionary *)config withCallback : (RCTResponseSenderBlock)
|
|
1574
|
-
callback errorCallback : (__unused RCTResponseSenderBlock)errorCallback)
|
|
1575
|
-
{
|
|
1576
|
-
RCTLayoutAnimationGroup *layoutAnimationGroup = [[RCTLayoutAnimationGroup alloc] initWithConfig:config
|
|
1577
|
-
callback:callback];
|
|
1578
|
-
|
|
1579
|
-
[self addUIBlock:^(RCTUIManager *uiManager, __unused NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
|
1580
|
-
[uiManager setNextLayoutAnimationGroup:layoutAnimationGroup];
|
|
1581
|
-
}];
|
|
1582
|
-
}
|
|
1583
|
-
|
|
1584
|
-
- (void)rootViewForReactTag:(NSNumber *)reactTag withCompletion:(void (^)(UIView *view))completion
|
|
1585
|
-
{
|
|
1586
|
-
RCTAssertMainQueue();
|
|
1587
|
-
RCTAssert(completion != nil, @"Attempted to resolve rootView for tag %@ without a completion block", reactTag);
|
|
1588
|
-
|
|
1589
|
-
if (reactTag == nil) {
|
|
1590
|
-
completion(nil);
|
|
1591
|
-
return;
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
RCTExecuteOnUIManagerQueue(^{
|
|
1595
|
-
NSNumber *rootTag = [self shadowViewForReactTag:reactTag].rootView.reactTag;
|
|
1596
|
-
RCTExecuteOnMainQueue(^{
|
|
1597
|
-
UIView *rootView = nil;
|
|
1598
|
-
if (rootTag != nil) {
|
|
1599
|
-
rootView = [self viewForReactTag:rootTag];
|
|
1600
|
-
}
|
|
1601
|
-
completion(rootView);
|
|
1602
|
-
});
|
|
1603
|
-
});
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
static UIView *_jsResponder;
|
|
1607
|
-
|
|
1608
|
-
+ (UIView *)JSResponder
|
|
1609
|
-
{
|
|
1610
|
-
return _jsResponder;
|
|
1611
|
-
}
|
|
1612
|
-
|
|
1613
|
-
- (void)removeViewFromRegistry:(NSNumber *)reactTag
|
|
1614
|
-
{
|
|
1615
|
-
[_viewRegistry removeObjectForKey:reactTag];
|
|
1616
|
-
}
|
|
1617
|
-
|
|
1618
|
-
@end
|
|
1619
|
-
|
|
1620
|
-
@implementation RCTBridge (RCTUIManager)
|
|
1621
|
-
|
|
1622
|
-
- (RCTUIManager *)uiManager
|
|
1623
|
-
{
|
|
1624
|
-
return [self moduleForClass:[RCTUIManager class]];
|
|
1625
|
-
}
|
|
1626
|
-
|
|
1627
|
-
@end
|
|
1628
|
-
|
|
1629
|
-
#else // RCT_REMOVE_LEGACY_ARCH
|
|
1630
|
-
|
|
1631
132
|
@implementation RCTUIManager
|
|
1632
133
|
- (void)registerRootViewTag:(NSNumber *)rootTag
|
|
1633
134
|
{
|
|
@@ -1730,8 +231,6 @@ static UIView *_jsResponder;
|
|
|
1730
231
|
|
|
1731
232
|
@end
|
|
1732
233
|
|
|
1733
|
-
#endif // RCT_REMOVE_LEGACY_ARCH
|
|
1734
|
-
|
|
1735
234
|
UIView *RCTPaperViewOrCurrentView(UIView *view)
|
|
1736
235
|
{
|
|
1737
236
|
if ([view respondsToSelector:@selector(paperView)]) {
|