react-native-tvos 0.80.1-0 → 0.81.0-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/NativeActionSheetManager.js +1 -0
- package/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec +1 -1
- package/Libraries/Alert/Alert.js +3 -3
- package/Libraries/Alert/NativeAlertManager.js +1 -0
- package/Libraries/Alert/RCTAlertManager.android.js +19 -13
- package/Libraries/Alert/RCTAlertManager.ios.js +10 -12
- package/Libraries/Alert/RCTAlertManager.js +1 -3
- package/Libraries/Alert/RCTAlertManager.js.flow +5 -7
- package/Libraries/Animated/Animated.js +0 -1
- package/Libraries/Animated/Animated.js.flow +0 -1
- package/Libraries/Animated/AnimatedEvent.js +4 -3
- package/Libraries/Animated/AnimatedExports.js +0 -1
- package/Libraries/Animated/AnimatedExports.js.flow +5 -1
- package/Libraries/Animated/AnimatedImplementation.js +44 -44
- package/Libraries/Animated/AnimatedMock.js +2 -2
- package/Libraries/Animated/Easing.js +1 -1
- package/Libraries/Animated/NativeAnimatedModule.js +1 -0
- package/Libraries/Animated/NativeAnimatedTurboModule.js +1 -0
- package/Libraries/Animated/SpringConfig.js +1 -1
- package/Libraries/Animated/animations/Animation.js +10 -2
- package/Libraries/Animated/components/AnimatedScrollView.js +58 -56
- package/Libraries/Animated/components/AnimatedText.js +2 -5
- package/Libraries/Animated/components/AnimatedView.js +2 -1
- package/Libraries/Animated/createAnimatedComponent.js +39 -37
- package/Libraries/Animated/nodes/AnimatedObject.js +2 -3
- package/Libraries/Animated/nodes/AnimatedProps.js +31 -4
- package/Libraries/Animated/nodes/AnimatedStyle.js +35 -34
- package/Libraries/Animated/shouldUseTurboAnimatedModule.js +6 -1
- package/Libraries/AppDelegate/RCTAppSetupUtils.h +1 -7
- package/Libraries/AppDelegate/RCTAppSetupUtils.mm +4 -16
- package/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +2 -8
- package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +8 -7
- package/Libraries/AppState/NativeAppState.js +1 -0
- package/Libraries/BatchedBridge/BatchedBridge.js +1 -1
- package/Libraries/BatchedBridge/NativeModules.js +1 -1
- package/Libraries/Blob/BlobManager.js +4 -0
- package/Libraries/Blob/NativeBlobModule.js +1 -0
- package/Libraries/Blob/NativeFileReaderModule.js +1 -0
- package/Libraries/Blob/React-RCTBlob.podspec +3 -2
- package/Libraries/Blob/URL.js +1 -1
- package/Libraries/Blob/URLSearchParams.js +5 -1
- package/Libraries/Blob/URLSearchParams.js.flow +2 -1
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js +1 -2
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js +1 -2
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.android.js +1 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.ios.js +1 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.js.flow +1 -1
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +19 -19
- package/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +2 -3
- package/Libraries/Components/Button.js +10 -7
- package/Libraries/Components/Clipboard/Clipboard.js +1 -1
- package/Libraries/Components/Clipboard/NativeClipboard.js +1 -2
- package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +2 -3
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +3 -4
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js +1 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +1 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js.flow +1 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidFallback.js +1 -1
- package/Libraries/Components/Keyboard/Keyboard.js +1 -1
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +3 -2
- package/Libraries/Components/Keyboard/NativeKeyboardObserver.js +1 -2
- package/Libraries/Components/LayoutConformance/LayoutConformance.js +0 -1
- package/Libraries/Components/Pressable/Pressable.js +21 -18
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +14 -13
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +1 -1
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +2 -3
- package/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +2 -3
- package/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +2 -1
- package/Libraries/Components/RefreshControl/RefreshControl.js +1 -1
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +2 -3
- package/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +9 -0
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +3 -2
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +2 -3
- package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +1 -1
- package/Libraries/Components/ScrollView/ScrollView.d.ts +33 -6
- package/Libraries/Components/ScrollView/ScrollView.js +25 -15
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -1
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +19 -6
- package/Libraries/Components/ScrollView/processDecelerationRate.js +1 -1
- package/Libraries/Components/Sound/NativeSoundManager.js +1 -2
- package/Libraries/Components/Sound/SoundManager.js +1 -1
- package/Libraries/Components/StaticRenderer.js +1 -1
- package/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js +1 -2
- package/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js +1 -2
- package/Libraries/Components/StatusBar/StatusBar.d.ts +4 -0
- package/Libraries/Components/StatusBar/StatusBar.js +6 -1
- package/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +2 -3
- package/Libraries/Components/Switch/Switch.js +10 -3
- package/Libraries/Components/Switch/SwitchNativeComponent.js +2 -3
- package/Libraries/Components/TV/TVEventControl.js +7 -6
- package/Libraries/Components/TV/TVFocusGuideView.js +29 -24
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +9 -12
- package/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +2 -3
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -1
- package/Libraries/Components/TextInput/TextInput.flow.js +2 -6
- package/Libraries/Components/TextInput/TextInput.js +36 -37
- package/Libraries/Components/TextInput/TextInputState.js +1 -1
- package/Libraries/Components/ToastAndroid/NativeToastAndroid.js +1 -2
- package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +1 -1
- package/Libraries/Components/ToastAndroid/ToastAndroid.ios.js +1 -1
- package/Libraries/Components/ToastAndroid/ToastAndroid.js +1 -1
- package/Libraries/Components/ToastAndroid/ToastAndroid.js.flow +1 -1
- package/Libraries/Components/ToastAndroid/ToastAndroidFallback.js +1 -1
- package/Libraries/Components/Touchable/BoundingDimensions.js +1 -1
- package/Libraries/Components/Touchable/PooledClass.js +1 -1
- package/Libraries/Components/Touchable/Position.js +1 -1
- package/Libraries/Components/Touchable/Touchable.js +17 -3
- package/Libraries/Components/Touchable/TouchableBounce.js +9 -3
- package/Libraries/Components/Touchable/TouchableHighlight.js +16 -11
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +5 -3
- package/Libraries/Components/Touchable/TouchableOpacity.d.ts +1 -0
- package/Libraries/Components/Touchable/TouchableOpacity.js +10 -5
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
- package/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +2 -3
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +7 -16
- package/Libraries/Components/View/View.js +144 -54
- package/Libraries/Components/View/ViewAccessibility.js +1 -8
- package/Libraries/Components/View/ViewPropTypes.d.ts +4 -0
- package/Libraries/Components/View/ViewPropTypes.js +8 -1
- package/Libraries/Core/Devtools/getDevServer.js +1 -1
- package/Libraries/Core/Devtools/loadBundleFromServer.js +49 -7
- package/Libraries/Core/Devtools/openFileInEditor.js +1 -1
- package/Libraries/Core/Devtools/openURLInBrowser.js +1 -1
- package/Libraries/Core/Devtools/parseErrorStack.js +1 -1
- package/Libraries/Core/Devtools/parseHermesStack.js +1 -1
- package/Libraries/Core/Devtools/symbolicateStackTrace.js +1 -1
- package/Libraries/Core/ExceptionsManager.js +27 -16
- package/Libraries/Core/InitializeCore.js +2 -23
- package/Libraries/Core/NativeExceptionsManager.js +1 -0
- package/Libraries/Core/ReactFiberErrorDialog.js +1 -1
- package/Libraries/Core/ReactNativeVersion.js +4 -6
- package/Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js +1 -0
- package/Libraries/Core/Timers/JSTimers.js +1 -1
- package/Libraries/Core/Timers/NativeTiming.js +1 -0
- package/Libraries/Core/Timers/immediateShim.js +1 -1
- package/Libraries/Core/Timers/queueMicrotask.js +1 -1
- package/Libraries/Core/checkNativeVersion.js +1 -0
- package/Libraries/Core/setUpDeveloperTools.js +13 -11
- package/Libraries/Core/setUpReactDevTools.js +21 -4
- package/Libraries/Debugging/DebuggingOverlay.js +12 -14
- package/Libraries/Debugging/DebuggingOverlayNativeComponent.js +2 -1
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +0 -1
- package/Libraries/Debugging/useSubscribeToDebuggingOverlayRegistry.js +0 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +3 -3
- package/Libraries/EventEmitter/RCTEventEmitter.js +1 -1
- package/Libraries/EventEmitter/RCTNativeAppEventEmitter.js +1 -1
- package/Libraries/FBLazyVector/FBLazyVector.podspec +1 -1
- package/Libraries/Image/AssetRegistry.js +4 -10
- package/Libraries/Image/Image.android.js +113 -107
- package/Libraries/Image/Image.ios.js +10 -2
- package/Libraries/Image/ImageAnalyticsTagContext.js +2 -2
- package/Libraries/Image/ImageInjection.js +1 -1
- package/Libraries/Image/ImageSource.d.ts +5 -0
- package/Libraries/Image/ImageViewNativeComponent.js +3 -3
- package/Libraries/Image/NativeImageEditor.js +1 -0
- package/Libraries/Image/NativeImageLoaderAndroid.js +1 -0
- package/Libraries/Image/NativeImageLoaderIOS.js +1 -0
- package/Libraries/Image/NativeImageStoreAndroid.js +1 -0
- package/Libraries/Image/NativeImageStoreIOS.js +1 -0
- package/Libraries/Image/RCTImageURLLoaderWithAttribution.h +2 -1
- package/Libraries/Image/RCTImageUtils.mm +1 -1
- package/Libraries/Image/RCTResizeMode.h +3 -7
- package/Libraries/Image/React-RCTImage.podspec +4 -2
- package/Libraries/Image/RelativeImageStub.js +2 -1
- package/Libraries/Image/TextInlineImageNativeComponent.js +4 -4
- package/Libraries/Image/resolveAssetSource.js +1 -1
- package/Libraries/Interaction/FrameRateLogger.js +1 -1
- package/Libraries/Interaction/InteractionManager.js +64 -54
- package/Libraries/Interaction/NativeFrameRateLogger.js +1 -0
- package/Libraries/Interaction/TaskQueue.js +8 -9
- package/Libraries/Interaction/TouchHistoryMath.js +1 -1
- package/Libraries/LayoutAnimation/LayoutAnimation.js +12 -8
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Linking/NativeIntentAndroid.js +1 -0
- package/Libraries/Linking/NativeLinkingManager.js +1 -0
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
- package/Libraries/Lists/FlatList.d.ts +9 -5
- package/Libraries/Lists/FlatList.js +6 -7
- package/Libraries/Lists/SectionList.js +4 -4
- package/Libraries/Lists/SectionListModern.js +9 -3
- package/Libraries/Lists/VirtualizedList.js +3 -2
- package/Libraries/LogBox/Data/LogBoxData.js +7 -4
- package/Libraries/LogBox/Data/parseLogBoxLog.js +2 -0
- package/Libraries/LogBox/LogBox.js +72 -99
- package/Libraries/LogBox/UI/LogBoxButton.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +3 -2
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +2 -1
- package/Libraries/Modal/Modal.d.ts +8 -2
- package/Libraries/Modal/Modal.js +24 -3
- package/Libraries/Modal/NativeModalManager.js +1 -0
- package/Libraries/Modal/RCTModalHostViewNativeComponent.js +2 -1
- package/Libraries/NativeAnimation/React-RCTAnimation.podspec +2 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +9 -18
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +8 -17
- package/Libraries/NativeComponent/BaseViewConfig.js.flow +1 -1
- package/Libraries/NativeComponent/PlatformBaseViewConfig.js +1 -1
- package/Libraries/NativeComponent/ViewConfigIgnore.js +3 -3
- package/Libraries/NativeModules/specs/NativeDevMenu.js +1 -0
- package/Libraries/NativeModules/specs/NativeDevSettings.js +1 -0
- package/Libraries/NativeModules/specs/NativeDeviceEventManager.js +1 -0
- package/Libraries/NativeModules/specs/NativeDialogManagerAndroid.js +1 -0
- package/Libraries/NativeModules/specs/NativeLogBox.js +1 -0
- package/Libraries/NativeModules/specs/NativeRedBox.js +1 -0
- package/Libraries/NativeModules/specs/NativeSourceCode.js +1 -0
- package/Libraries/Network/FormData.js +1 -1
- package/Libraries/Network/NativeNetworkingAndroid.js +1 -0
- package/Libraries/Network/NativeNetworkingIOS.js +1 -0
- package/Libraries/Network/RCTInspectorNetworkReporter.h +64 -0
- package/Libraries/Network/RCTInspectorNetworkReporter.mm +105 -0
- package/Libraries/Network/RCTNetworkConversions.h +23 -0
- package/Libraries/Network/RCTNetworking.android.js +2 -2
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.js.flow +1 -1
- package/Libraries/Network/RCTNetworking.mm +31 -4
- package/Libraries/Network/React-RCTNetwork.podspec +2 -1
- package/Libraries/Network/XMLHttpRequest.js +3 -3
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +1 -0
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -3
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/Promise.js +1 -1
- package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +1 -0
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +3 -2
- package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +2 -0
- package/Libraries/ReactNative/AppContainer-dev.js +2 -3
- package/Libraries/ReactNative/AppContainer-prod.js +0 -1
- package/Libraries/ReactNative/AppContainer.js +1 -1
- package/Libraries/ReactNative/AppRegistry.flow.js +2 -2
- package/Libraries/ReactNative/AppRegistryImpl.js +2 -13
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -1
- package/Libraries/ReactNative/NativeHeadlessJsTaskSupport.js +1 -0
- package/Libraries/ReactNative/NativeI18nManager.js +1 -0
- package/Libraries/ReactNative/NativeUIManager.js +1 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +81 -62
- package/Libraries/ReactNative/ReactFabricPublicInstance/warnForStyleProps.js +1 -1
- package/Libraries/ReactNative/RendererImplementation.js +1 -1
- package/Libraries/ReactNative/RendererProxy.js +1 -1
- package/Libraries/ReactNative/RootTag.js +2 -2
- package/Libraries/ReactNative/renderApplication.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInitializeCore.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +2 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +3 -3
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +3 -1
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -1
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeTypes.js +23 -36
- package/Libraries/Required/RCTRequired.podspec +1 -1
- package/Libraries/Settings/NativeSettingsManager.js +1 -0
- package/Libraries/Settings/React-RCTSettings.podspec +2 -1
- package/Libraries/Settings/Settings.ios.js +1 -1
- package/Libraries/Settings/Settings.js +1 -1
- package/Libraries/Settings/SettingsFallback.js +1 -1
- package/Libraries/Share/NativeShareModule.js +1 -0
- package/Libraries/Share/Share.js +1 -1
- package/Libraries/StyleSheet/EdgeInsetsPropType.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.js +1 -1
- package/Libraries/StyleSheet/PointPropType.js +1 -1
- package/Libraries/StyleSheet/Rect.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.js +1 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +0 -1
- package/Libraries/StyleSheet/normalizeColor.js +1 -1
- package/Libraries/StyleSheet/processAspectRatio.js +1 -1
- package/Libraries/StyleSheet/processBackgroundImage.js +1 -1
- package/Libraries/StyleSheet/processBoxShadow.js +0 -1
- package/Libraries/StyleSheet/processColor.js +1 -1
- package/Libraries/StyleSheet/processColorArray.js +1 -1
- package/Libraries/StyleSheet/processFilter.js +1 -2
- package/Libraries/StyleSheet/processFontVariant.js +1 -1
- package/Libraries/StyleSheet/processTransform.js +1 -1
- package/Libraries/StyleSheet/processTransformOrigin.js +1 -1
- package/Libraries/StyleSheet/setNormalizedColorAlpha.js +1 -1
- package/Libraries/Text/React-RCTText.podspec +1 -1
- package/Libraries/Text/Text.d.ts +9 -0
- package/Libraries/Text/Text.js +255 -246
- package/Libraries/Text/TextAncestor.js +3 -9
- package/Libraries/Text/TextAncestorContext.js +23 -0
- package/Libraries/Text/TextNativeComponent.js +4 -0
- package/Libraries/Text/TextProps.js +2 -5
- package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +1 -0
- package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
- package/Libraries/Types/CodegenTypes.js +1 -1
- package/Libraries/Types/CodegenTypesNamespace.js +2 -1
- package/Libraries/Types/CoreEventTypes.d.ts +0 -4
- package/Libraries/Types/ReactDevToolsTypes.js +0 -1
- package/Libraries/Utilities/Appearance.js +1 -1
- package/Libraries/Utilities/BackHandler.js.flow +1 -1
- package/Libraries/Utilities/DevLoadingView.js +1 -1
- package/Libraries/Utilities/DeviceInfo.js +1 -1
- package/Libraries/Utilities/Dimensions.js +1 -1
- package/Libraries/Utilities/HMRClient.js +13 -3
- package/Libraries/Utilities/HMRClientProdShim.js +1 -1
- package/Libraries/Utilities/NativeAppearance.js +1 -0
- package/Libraries/Utilities/NativeDevLoadingView.js +1 -0
- package/Libraries/Utilities/NativeDeviceInfo.js +1 -2
- package/Libraries/Utilities/NativePlatformConstantsAndroid.js +1 -0
- package/Libraries/Utilities/NativePlatformConstantsIOS.js +1 -0
- package/Libraries/Utilities/PerformanceLoggerContext.js +2 -2
- package/Libraries/Utilities/PixelRatio.js +1 -1
- package/Libraries/Utilities/Platform.android.js +2 -5
- package/Libraries/Utilities/Platform.ios.js +2 -5
- package/Libraries/Utilities/Platform.js +1 -1
- package/Libraries/Utilities/Platform.js.flow +2 -2
- package/Libraries/Utilities/PlatformTypes.js +2 -2
- package/Libraries/Utilities/RCTLog.js +1 -1
- package/Libraries/Utilities/SceneTracker.js +1 -1
- package/Libraries/Utilities/binaryToBase64.js +1 -1
- package/Libraries/Utilities/codegenNativeCommands.js +5 -3
- package/Libraries/Utilities/codegenNativeComponent.js +4 -4
- package/Libraries/Utilities/createPerformanceLogger.js +27 -20
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +1 -1
- package/Libraries/Utilities/defineLazyObjectProperty.js +1 -1
- package/Libraries/Utilities/differ/deepDiffer.js +1 -1
- package/Libraries/Utilities/differ/insetsDiffer.js +1 -1
- package/Libraries/Utilities/differ/matricesDiffer.js +1 -1
- package/Libraries/Utilities/differ/pointsDiffer.js +1 -1
- package/Libraries/Utilities/logError.js +1 -1
- package/Libraries/Utilities/mapWithSeparator.js +1 -1
- package/Libraries/Utilities/stringifySafe.js +1 -1
- package/Libraries/Utilities/stringifyViewConfig.js +1 -1
- package/Libraries/Utilities/useColorScheme.js +1 -1
- package/Libraries/Utilities/useWindowDimensions.js +1 -1
- package/Libraries/Utilities/warnOnce.js +1 -1
- package/Libraries/Vibration/NativeVibration.js +1 -0
- package/Libraries/Vibration/React-RCTVibration.podspec +2 -1
- package/Libraries/Vibration/Vibration.js +1 -2
- package/Libraries/WebSocket/NativeWebSocketModule.js +1 -0
- package/Libraries/WebSocket/WebSocket.js +1 -1
- package/Libraries/WebSocket/WebSocketInterceptor.js +1 -1
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/Libraries/vendor/core/ErrorUtils.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +6 -6
- package/React/Base/RCTBridge+Private.h +5 -0
- package/React/Base/RCTBridge.mm +108 -0
- package/React/Base/RCTBridgeDelegate.h +2 -0
- package/React/Base/RCTBridgeMethod.h +3 -2
- package/React/Base/RCTBridgeModule.h +6 -0
- package/React/Base/RCTBridgeProxy.mm +2 -0
- package/React/Base/RCTBundleManager.h +2 -0
- package/React/Base/RCTBundleManager.m +10 -0
- package/React/Base/RCTCallInvokerModule.h +2 -0
- package/React/Base/RCTCallableJSModules.m +6 -0
- package/React/Base/RCTDisplayLink.h +8 -1
- package/React/Base/RCTDisplayLink.m +15 -14
- package/React/Base/RCTJavaScriptExecutor.h +2 -0
- package/React/Base/RCTModuleData.mm +37 -0
- package/React/Base/RCTModuleMethod.mm +1 -0
- package/React/Base/RCTModuleRegistry.m +8 -0
- package/React/Base/RCTRootContentView.h +4 -0
- package/React/Base/RCTRootContentView.m +4 -0
- package/React/Base/RCTRootView.m +32 -0
- package/React/Base/RCTRootViewInternal.h +4 -0
- package/React/Base/RCTTVNavigationEventNotification.h +2 -0
- package/React/Base/RCTTVRemoteHandler.h +3 -0
- package/React/Base/RCTTVRemoteHandler.m +2 -0
- package/React/Base/RCTTVRemoteHandlerConstants.h +2 -0
- package/React/Base/RCTTVRemoteSelectHandler.h +2 -0
- package/React/Base/RCTTVRemoteSelectHandler.m +2 -0
- package/React/Base/RCTTouchHandler.m +2 -0
- package/React/Base/RCTTouchHandlerTV.m +2 -0
- package/React/Base/RCTUtils.h +0 -2
- package/React/Base/RCTUtils.mm +65 -35
- package/React/Base/RCTVersion.m +2 -2
- package/React/Base/RCTViewRegistry.m +16 -7
- package/React/Base/Surface/RCTSurface.mm +68 -0
- package/React/Base/Surface/RCTSurfaceRootShadowView.m +17 -0
- package/React/Base/Surface/RCTSurfaceView.h +3 -3
- package/React/Base/Surface/RCTSurfaceView.mm +2 -1
- package/React/CoreModules/RCTDeviceInfo.mm +4 -3
- package/React/CoreModules/RCTLogBox.mm +4 -1
- package/React/CoreModules/RCTLogBoxView.h +2 -0
- package/React/CoreModules/RCTLogBoxView.mm +6 -0
- package/React/CoreModules/RCTStatusBarManager.mm +2 -0
- package/React/CoreModules/RCTTVNavigationEventEmitter.mm +3 -1
- package/React/CoreModules/React-CoreModules.podspec +4 -1
- package/React/CxxBridge/RCTCxxBridge.mm +47 -11
- package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.h +4 -0
- package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.mm +4 -0
- package/React/CxxBridge/RCTObjcExecutor.h +4 -0
- package/React/CxxBridge/RCTObjcExecutor.mm +5 -1
- package/React/CxxModule/DispatchMessageQueueThread.h +4 -0
- package/React/CxxModule/RCTCxxMethod.mm +1 -1
- package/React/CxxModule/RCTCxxModule.mm +1 -1
- package/React/CxxModule/RCTCxxUtils.h +4 -0
- package/React/CxxModule/RCTCxxUtils.mm +4 -1
- package/React/CxxModule/RCTNativeModule.h +4 -0
- package/React/CxxModule/RCTNativeModule.mm +5 -1
- package/React/CxxUtils/RCTFollyConvert.h +8 -6
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +0 -31
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +3 -28
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI-generated.cpp +153 -40
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +243 -108
- package/{ReactCommon/react/renderer/components/rncore → React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec}/ComponentDescriptors.cpp +2 -2
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.h +30 -0
- package/{ReactCommon/react/renderer/components/rncore → React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec}/EventEmitters.cpp +26 -1
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.h +194 -0
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.cpp +663 -0
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.h +535 -0
- package/{ReactCommon/react/renderer/components/rncore → React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec}/RCTComponentViewHelpers.h +4 -0
- package/{ReactCommon/react/renderer/components/rncore → React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec}/ShadowNodes.cpp +1 -1
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.h +98 -0
- package/{ReactCommon/react/renderer/components/rncore → React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec}/States.cpp +1 -1
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/States.h +32 -0
- package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +3 -3
- package/React/Fabric/Mounting/ComponentViews/DebuggingOverlay/RCTDebuggingOverlayComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/DebuggingOverlay/RCTDebuggingOverlayComponentView.mm +4 -4
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +0 -2
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +18 -2
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +4 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +7 -1
- package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +4 -4
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +2 -1
- package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +3 -3
- package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +3 -3
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +20 -7
- package/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.h +24 -0
- package/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm +384 -0
- package/React/Fabric/Mounting/RCTMountingManager.h +1 -1
- package/React/Fabric/Mounting/RCTMountingManager.mm +15 -6
- package/React/Fabric/RCTScheduler.h +1 -0
- package/React/Fabric/RCTScheduler.mm +6 -2
- package/React/Fabric/RCTSurfacePointerHandler.mm +2 -0
- package/React/Fabric/RCTSurfacePointerHandlerTV.mm +2 -0
- package/React/Fabric/RCTSurfacePresenter.h +2 -1
- package/React/Fabric/RCTSurfacePresenter.mm +14 -8
- package/React/Fabric/RCTSurfaceTouchHandler.mm +2 -0
- package/React/Fabric/RCTSurfaceTouchHandlerTV.mm +2 -0
- package/React/Fabric/Surface/RCTFabricSurface.mm +4 -4
- package/React/Fabric/Utils/RCTGradientUtils.h +12 -0
- package/React/Fabric/Utils/RCTGradientUtils.mm +213 -6
- package/React/Fabric/Utils/RCTLinearGradient.mm +37 -42
- package/React/Fabric/Utils/RCTRadialGradient.mm +29 -64
- package/React/Modules/RCTSurfacePresenterStub.h +1 -1
- package/React/Modules/RCTUIManager.mm +206 -93
- package/React/React-RCTFBReactNativeSpec.podspec +33 -8
- package/React/React-RCTFabric.podspec +8 -3
- package/React/Runtime/React-RCTRuntime.podspec +7 -6
- package/React/Views/RCTBorderDrawing.h +5 -0
- package/React/Views/RCTBorderDrawing.m +37 -4
- package/React/Views/RCTModalHostView.h +1 -0
- package/React/Views/RCTModalHostView.m +16 -0
- package/React/Views/RCTModalHostViewController.m +0 -1
- package/React/Views/RCTModalHostViewManager.m +1 -0
- package/React/Views/RCTSwitch.h +2 -0
- package/React/Views/RCTSwitch.m +2 -0
- package/React/Views/RCTSwitchManager.h +2 -0
- package/React/Views/RCTSwitchManager.m +2 -0
- package/React/Views/RCTTVView.h +2 -0
- package/React/Views/RCTTVView.m +2 -0
- package/React/Views/RCTView.m +4 -1
- package/React/Views/RefreshControl/RCTRefreshControl.h +2 -0
- package/React/Views/RefreshControl/RCTRefreshControl.m +2 -0
- package/React/Views/RefreshControl/RCTRefreshControlManager.h +2 -0
- package/React/Views/RefreshControl/RCTRefreshControlManager.m +2 -0
- package/React/Views/RefreshControl/RCTRefreshableProtocol.h +2 -0
- package/React/Views/ScrollView/RCTScrollView.h +2 -0
- package/React/Views/ScrollView/RCTScrollView.m +2 -0
- package/React/Views/ScrollView/RCTScrollViewManager.m +2 -0
- package/React-Core-prebuilt.podspec +78 -0
- package/React-Core.podspec +29 -28
- package/ReactAndroid/api/ReactAndroid.api +294 -506
- package/ReactAndroid/build.gradle.kts +20 -55
- package/ReactAndroid/cmake-utils/ReactNative-application.cmake +1 -1
- package/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp +2 -2
- package/ReactAndroid/external-artifacts/build.gradle.kts +52 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/hermes-engine/build.gradle.kts +25 -0
- package/ReactAndroid/publish.gradle +2 -2
- package/ReactAndroid/src/main/AndroidManifest.xml +1 -1
- package/ReactAndroid/src/main/java/com/facebook/debug/tags/ReactDebugOverlayTags.kt +0 -9
- package/ReactAndroid/src/main/java/com/facebook/react/BaseReactPackage.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.kt +194 -0
- package/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.kt +1 -5
- package/ReactAndroid/src/main/java/com/facebook/react/HeadlessJsTaskService.kt +5 -4
- package/ReactAndroid/src/main/java/com/facebook/react/LazyReactPackage.kt +146 -0
- package/ReactAndroid/src/main/java/com/facebook/react/MemoryPressureRouter.kt +6 -5
- package/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +57 -30
- package/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt +451 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactFragment.kt +237 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +11 -10
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.kt +396 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +7 -16
- package/ReactAndroid/src/main/java/com/facebook/react/ReactPackage.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/ReactPackageHelper.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactPackageLogger.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.kt +244 -0
- package/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/EventAnimationDriver.kt +4 -3
- package/ReactAndroid/src/main/java/com/facebook/react/animated/InterpolationAnimatedNode.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.kt +59 -77
- package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.kt +43 -37
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseActivityEventListener.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseJavaModule.java +0 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.java +20 -11
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CallbackImpl.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.kt +3 -4
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CxxModuleWrapperBase.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/GuardedAsyncTask.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JSONArguments.kt +37 -40
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaMethodWrapper.kt +399 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaModuleWrapper.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaOnlyArray.kt +8 -9
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaScriptModuleRegistry.kt +93 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/MemoryPressureListener.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.kt +227 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleSpec.kt +59 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeArgumentsParseException.kt +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModule.java +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.kt +156 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/OnBatchCompleteListener.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/PromiseImpl.kt +240 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactApplicationContext.kt +20 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContextBaseJavaModule.kt +33 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactInstanceManagerInspectorTarget.kt +69 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarker.kt +212 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactModuleWithSpec.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactNoCrashBridgeNotAllowedSoftException.kt +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactNoCrashSoftException.kt +4 -3
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactSoftExceptionLogger.kt +30 -21
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableArrayBuilder.kt +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableMapBuilder.kt +21 -7
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeMap.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/RetryableMountingLayerException.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/SoftAssertions.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManagerProvider.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfigurationImpl.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/common/DebugServerException.kt +8 -8
- package/ReactAndroid/src/main/java/com/facebook/react/common/MapBuilder.kt +107 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/ShakeDetector.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/LegacyArchitectureShadowNodeWithCxxImpl.kt +6 -4
- package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/internal/InteropLegacyArchitecture.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/common/build/ReactBuildConfig.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt +16 -4
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +53 -1
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt +4 -3
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +9 -15
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DefaultDevLoadingViewImplementation.kt +0 -3
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DefaultDevSupportManagerFactory.kt +5 -7
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevInternalSettings.kt +0 -4
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.kt +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DoubleTapReloadRecognizer.kt +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/FpsView.kt +16 -7
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/PackagerStatusCheck.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/StackTraceHelper.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevOptionHandler.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/RedBoxHandler.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/StackFrame.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +65 -68
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/LongStreamingStats.kt +6 -5
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/EventBeatManager.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/FabricEventEmitter.kt +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/internal/interop/InteropUiBlockListener.kt +27 -16
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.kt +365 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.kt +373 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +48 -50
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/DispatchIntCommandMountItem.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/DispatchStringCommandMountItem.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/MountItemFactory.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +77 -5
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +131 -11
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +27 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +27 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +145 -13
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +27 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleInteropUtils.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManagerDelegate.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/jstasks/HeadlessJsTaskContext.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/AccessibilityInfoModule.kt +21 -30
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.kt +4 -11
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appstate/AppStateModule.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.kt +6 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobProvider.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/camera/ImageStoreManager.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/ClipboardModule.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/DeviceEventManagerModule.kt +3 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/HeadlessJsTaskSupportModule.kt +6 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/DevMenuModule.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/DevSettingsModule.kt +2 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/DidJSUpdateUiDuringFrameDetector.kt +10 -9
- package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/FpsDebugFrameCallback.kt +23 -55
- package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/SourceCodeModule.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/interfaces/DeveloperSettings.kt +0 -5
- package/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/DeviceInfoModule.kt +8 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/DialogModule.kt +0 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/FrescoModule.kt +9 -5
- package/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/ReactOkHttpNetworkFetcher.kt +5 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nManagerModule.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt +23 -21
- package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.kt +7 -10
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.kt +9 -9
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressiveStringDecoder.kt +5 -5
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ResponseUtil.kt +24 -23
- package/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/share/ShareModule.kt +3 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/sound/SoundManagerModule.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt +17 -20
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.kt +11 -14
- package/ReactAndroid/src/main/java/com/facebook/react/modules/vibration/VibrationModule.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.kt +52 -40
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessAtomicRef.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +22 -18
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.kt +6 -4
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/JSRuntimeFactory.kt +6 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +1472 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImplDevHelper.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostInspectorTarget.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.kt +14 -14
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceImpl.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceView.kt +6 -2
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/ExecutorException.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Task.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.kt +9 -2
- package/ReactAndroid/src/main/java/com/facebook/react/soloader/OpenSourceMergedSoMapping.kt +0 -17
- package/ReactAndroid/src/main/java/com/facebook/react/touch/OnInterceptTouchEventListener.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/CallInvokerHolderImpl.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/NativeMethodCallInvokerHolderImpl.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +80 -63
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManagerDelegate.kt +1 -5
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/DisplayMetricsHolder.kt +17 -5
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/FloatUtil.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt +238 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutDirectionUtil.kt +4 -10
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/MatrixMathHelper.kt +25 -20
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeKind.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NoSuchNativeViewException.kt +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/OnLayoutEvent.kt +9 -9
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/PointerEvents.kt +6 -7
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java +0 -14
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAxOrderHelper.kt +63 -106
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactClippingViewGroup.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactClippingViewGroupHelper.kt +5 -4
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactStylesDiffMap.kt +7 -7
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactYogaConfigProvider.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ShadowNodeRegistry.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/Spacing.kt +4 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ThemedReactContext.kt +151 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.kt +232 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +5 -5
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstants.kt +0 -4
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.kt +238 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleListener.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewAtIndex.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupDrawingOrderHelper.kt +5 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +15 -62
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerDelegate.kt +18 -4
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerPropertyUpdater.kt +2 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerRegistry.kt +161 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerWithGeneratedInterface.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.kt +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/YogaNodePool.kt +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/annotations/ReactProp.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/UIManagerType.kt +0 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/BorderDrawable.kt +0 -5
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/CSSBackgroundDrawable.java +0 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.kt +8 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcherImpl.kt +334 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventEmitterImpl.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.kt +12 -12
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.kt +340 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/internal/LegacyArchitectureShadowNodeLogger.kt +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/AbstractLayoutAnimation.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/AnimatedPropertyType.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/BaseLayoutAnimation.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/InterpolatorType.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationController.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationListener.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationType.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutCreateAnimation.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutDeleteAnimation.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutHandlingAnimation.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutUpdateAnimation.kt +8 -8
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/OpacityAnimation.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/PositionAndSizeAnimation.kt +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/SimpleSpringInterpolator.kt +9 -11
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BoxShadow.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/ColorStop.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/Gradient.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/common/ContextUtils.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/common/UiModeUtils.kt +26 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager.kt +5 -17
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayoutManager.kt +4 -15
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerClosedEvent.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerOpenedEvent.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerSlideEvent.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerStateChangedEvent.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageDownloadListener.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/ImageSource.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/MultiSourceHelper.kt +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.kt +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +80 -9
- package/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarShadowNode.kt +10 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/safeareaview/ReactSafeAreaViewShadowNode.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/MaintainVisibleScrollPositionHelper.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +52 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.kt +37 -7
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +45 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.kt +19 -28
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.kt +34 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEvent.kt +28 -17
- package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager.kt +0 -14
- package/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.kt +0 -7
- package/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchShadowNode.kt +10 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/DefaultStyleValuesUtil.kt +7 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.kt +15 -21
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayout.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt +103 -159
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextViewManager.kt +29 -21
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java +11 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactRawTextManager.kt +4 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactRawTextShadowNode.kt +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.kt +25 -22
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.kt +349 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewAccessibilityDelegate.kt +87 -84
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt +181 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactVirtualTextShadowNode.kt +10 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactVirtualTextViewManager.kt +8 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributes.kt +137 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt +1203 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextTransform.kt +2 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode.kt +17 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageSpan.kt +7 -7
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/CustomLetterSpacingSpan.kt +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactContentSizeChangedEvent.kt +5 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +8 -15
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputSelectionEvent.kt +5 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.kt +8 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +1586 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +38 -44
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ViewGroupClickEvent.kt +1 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/WindowUtil.kt +77 -43
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtualview/ReactVirtualView.kt +382 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtualview/ReactVirtualViewManager.kt +102 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtualview/VirtualViewMode.kt +14 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtualview/VirtualViewModeChangeEvent.kt +49 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtualview/VirtualViewRenderState.kt +20 -0
- package/ReactAndroid/src/main/java/com/facebook/systrace/Systrace.kt +1 -1
- package/ReactAndroid/src/main/jni/CMakeLists.txt +1 -98
- package/ReactAndroid/src/main/jni/first-party/fbgloginit/fb/glog_init.h +1 -3
- package/ReactAndroid/src/main/jni/first-party/fbgloginit/glog_init.cpp +2 -4
- package/ReactAndroid/src/main/jni/first-party/jni-lib-merge/SoMerging-utils.cmake +4 -0
- package/ReactAndroid/src/main/jni/react/devsupport/CMakeLists.txt +1 -1
- package/ReactAndroid/src/main/jni/react/fabric/CMakeLists.txt +1 -1
- package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +4 -1
- package/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp +4 -2
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +13 -10
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.h +6 -1
- package/ReactAndroid/src/main/jni/react/fabric/FocusOrderingHelper.cpp +105 -13
- package/ReactAndroid/src/main/jni/react/fabric/FocusOrderingHelper.h +8 -6
- package/ReactAndroid/src/main/jni/react/featureflags/CMakeLists.txt +1 -1
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +181 -13
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +39 -3
- package/ReactAndroid/src/main/jni/react/hermes/instrumentation/HermesSamplingProfiler.cpp +11 -9
- package/ReactAndroid/src/main/jni/react/hermes/instrumentation/HermesSamplingProfiler.h +2 -6
- package/ReactAndroid/src/main/jni/react/hermes/reactexecutor/OnLoad.cpp +10 -2
- package/ReactAndroid/src/main/jni/react/hermes/tooling/CMakeLists.txt +0 -1
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +4 -0
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +4 -0
- package/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp +4 -0
- package/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.h +4 -0
- package/ReactAndroid/src/main/jni/react/jni/JavaScriptExecutorHolder.h +4 -0
- package/ReactAndroid/src/main/jni/react/jni/JniJSModulesUnbundle.cpp +4 -0
- package/ReactAndroid/src/main/jni/react/jni/JniJSModulesUnbundle.h +4 -0
- package/ReactAndroid/src/main/jni/react/jni/MethodInvoker.cpp +4 -0
- package/ReactAndroid/src/main/jni/react/jni/MethodInvoker.h +4 -0
- package/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.cpp +4 -0
- package/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.h +4 -0
- package/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp +2 -0
- package/ReactAndroid/src/main/jni/react/mapbuffer/CMakeLists.txt +1 -1
- package/ReactAndroid/src/main/jni/react/newarchdefaults/CMakeLists.txt +1 -1
- package/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultComponentsRegistry.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/newarchdefaults/rncore.h +20 -0
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/BindingsInstallerHolder.h +1 -1
- package/ReactAndroid/src/main/jni/react/uimanager/CMakeLists.txt +1 -1
- package/ReactAndroid/src/main/res/systeminfo/values-am/strings.xml +6 -0
- package/ReactAndroid/src/main/res/views/uimanager/values/ids.xml +3 -9
- package/ReactApple/Libraries/RCTFoundation/RCTDeprecation/RCTDeprecation.podspec +1 -1
- package/ReactCommon/React-Fabric.podspec +32 -43
- package/ReactCommon/React-FabricComponents.podspec +54 -57
- package/ReactCommon/React-FabricImage.podspec +2 -1
- package/ReactCommon/React-Mapbuffer.podspec +2 -2
- package/ReactCommon/ReactCommon.podspec +6 -7
- package/ReactCommon/callinvoker/React-callinvoker.podspec +1 -1
- package/ReactCommon/callinvoker/ReactCommon/CallInvoker.h +5 -5
- package/ReactCommon/callinvoker/ReactCommon/SchedulerPriority.h +0 -2
- package/ReactCommon/cmake-utils/internal/react-native-platform-selector.cmake +24 -0
- package/ReactCommon/cmake-utils/react-native-flags.cmake +7 -11
- package/ReactCommon/cxxreact/CMakeLists.txt +1 -1
- package/ReactCommon/cxxreact/CxxModule.h +3 -7
- package/ReactCommon/cxxreact/CxxNativeModule.cpp +5 -0
- package/ReactCommon/cxxreact/CxxNativeModule.h +4 -0
- package/ReactCommon/cxxreact/Instance.cpp +4 -0
- package/ReactCommon/cxxreact/Instance.h +5 -1
- package/ReactCommon/cxxreact/JSBigString.cpp +3 -3
- package/ReactCommon/cxxreact/JSBigString.h +3 -2
- package/ReactCommon/cxxreact/JSExecutor.cpp +2 -6
- package/ReactCommon/cxxreact/JSExecutor.h +5 -4
- package/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp +7 -1
- package/ReactCommon/cxxreact/JSIndexedRAMBundle.h +6 -0
- package/ReactCommon/cxxreact/JSModulesUnbundle.h +5 -1
- package/ReactCommon/cxxreact/JsArgumentHelpers.h +2 -4
- package/ReactCommon/cxxreact/MessageQueueThread.h +1 -3
- package/ReactCommon/cxxreact/MethodCall.cpp +4 -0
- package/ReactCommon/cxxreact/MethodCall.h +4 -0
- package/ReactCommon/cxxreact/ModuleRegistry.cpp +4 -0
- package/ReactCommon/cxxreact/ModuleRegistry.h +4 -0
- package/ReactCommon/cxxreact/NativeModule.h +5 -1
- package/ReactCommon/cxxreact/NativeToJsBridge.cpp +4 -0
- package/ReactCommon/cxxreact/NativeToJsBridge.h +4 -0
- package/ReactCommon/cxxreact/RAMBundleRegistry.cpp +4 -0
- package/ReactCommon/cxxreact/RAMBundleRegistry.h +5 -1
- package/ReactCommon/cxxreact/React-cxxreact.podspec +4 -4
- package/ReactCommon/cxxreact/ReactMarker.cpp +2 -4
- package/ReactCommon/cxxreact/ReactMarker.h +2 -4
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/cxxreact/SharedProxyCxxModule.h +2 -6
- package/ReactCommon/devtoolsruntimesettings/CMakeLists.txt +5 -5
- package/ReactCommon/hermes/React-hermes.podspec +6 -3
- package/ReactCommon/hermes/executor/CMakeLists.txt +4 -1
- package/ReactCommon/hermes/executor/React-jsitracing.podspec +1 -1
- package/ReactCommon/hermes/inspector-modern/CMakeLists.txt +4 -1
- package/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeSamplingProfileSerializer.cpp +10 -6
- package/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeSamplingProfileSerializer.h +11 -1
- package/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeTargetDelegate.cpp +58 -9
- package/ReactCommon/jsc/JSCRuntime.cpp +2 -4
- package/ReactCommon/jsc/JSCRuntime.h +2 -4
- package/ReactCommon/jserrorhandler/CMakeLists.txt +3 -1
- package/ReactCommon/jserrorhandler/JsErrorHandler.cpp +4 -9
- package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +4 -3
- package/ReactCommon/jserrorhandler/StackTraceParser.cpp +3 -1
- package/ReactCommon/jsi/CMakeLists.txt +1 -1
- package/ReactCommon/jsi/React-jsi.podspec +3 -6
- package/ReactCommon/jsi/jsi/CMakeLists.txt +1 -1
- package/ReactCommon/jsi/jsi/decorator.h +33 -0
- package/ReactCommon/jsi/jsi/jsi-inl.h +14 -0
- package/ReactCommon/jsi/jsi/jsi.cpp +119 -0
- package/ReactCommon/jsi/jsi/jsi.h +153 -1
- package/ReactCommon/jsi/jsi/test/testlib.cpp +111 -4
- package/ReactCommon/jsi/jsi/test/testlib.h +2 -2
- package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +4 -2
- package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +54 -1
- package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h +4 -0
- package/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +5 -0
- package/ReactCommon/jsiexecutor/jsireact/JSINativeModules.h +4 -0
- package/ReactCommon/jsinspector-modern/InspectorFlags.cpp +0 -6
- package/ReactCommon/jsinspector-modern/NetworkIOAgent.cpp +54 -2
- package/ReactCommon/jsinspector-modern/NetworkIOAgent.h +16 -0
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +4 -3
- package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +1 -1
- package/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp +157 -27
- package/ReactCommon/jsinspector-modern/TracingAgent.cpp +4 -3
- package/ReactCommon/jsinspector-modern/TracingAgent.h +5 -2
- package/ReactCommon/jsinspector-modern/cdp/React-jsinspectorcdp.podspec +3 -2
- package/ReactCommon/jsinspector-modern/network/BoundedRequestBuffer.cpp +77 -0
- package/ReactCommon/jsinspector-modern/network/BoundedRequestBuffer.h +67 -0
- package/ReactCommon/jsinspector-modern/network/CMakeLists.txt +3 -1
- package/ReactCommon/jsinspector-modern/network/CdpNetwork.cpp +35 -0
- package/ReactCommon/jsinspector-modern/network/CdpNetwork.h +43 -0
- package/ReactCommon/jsinspector-modern/network/NetworkReporter.cpp +144 -23
- package/ReactCommon/jsinspector-modern/network/NetworkReporter.h +91 -19
- package/ReactCommon/jsinspector-modern/network/React-jsinspectornetwork.podspec +6 -2
- package/ReactCommon/jsinspector-modern/tests/ConsoleTimeStampTest.cpp +146 -0
- package/ReactCommon/jsinspector-modern/tests/InspectorPackagerConnectionTest.cpp +37 -36
- package/ReactCommon/jsinspector-modern/tests/JsiIntegrationTest.cpp +9 -9
- package/ReactCommon/jsinspector-modern/tracing/CMakeLists.txt +1 -0
- package/ReactCommon/jsinspector-modern/tracing/ConsoleTimeStamp.h +91 -0
- package/ReactCommon/jsinspector-modern/tracing/EventLoopReporter.cpp +5 -18
- package/ReactCommon/jsinspector-modern/tracing/EventLoopReporter.h +4 -2
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +141 -84
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h +59 -18
- package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +4 -2
- package/ReactCommon/jsinspector-modern/tracing/RuntimeSamplingProfile.h +28 -8
- package/ReactCommon/jsinspector-modern/tracing/RuntimeSamplingProfileTraceEventSerializer.cpp +41 -32
- package/ReactCommon/jsinspector-modern/tracing/RuntimeSamplingProfileTraceEventSerializer.h +9 -7
- package/ReactCommon/jsinspector-modern/tracing/Timing.h +42 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEvent.h +6 -8
- package/ReactCommon/jsinspector-modern/tracing/TraceEventProfile.h +10 -2
- package/ReactCommon/jsinspector-modern/tracing/tests/RuntimeSamplingProfileTraceEventSerializerTest.cpp +13 -13
- package/ReactCommon/jsitooling/CMakeLists.txt +1 -1
- package/ReactCommon/jsitooling/React-jsitooling.podspec +4 -2
- package/ReactCommon/logger/React-logger.podspec +2 -1
- package/ReactCommon/oscompat/React-oscompat.podspec +1 -1
- package/ReactCommon/react/bridging/Base.h +45 -34
- package/ReactCommon/react/bridging/Bool.h +1 -1
- package/ReactCommon/react/bridging/Bridging.h +1 -0
- package/ReactCommon/react/bridging/CMakeLists.txt +2 -2
- package/ReactCommon/react/bridging/Class.h +36 -33
- package/ReactCommon/react/bridging/HighResTimeStamp.h +41 -0
- package/ReactCommon/react/bridging/Number.h +10 -10
- package/ReactCommon/react/bridging/Promise.h +14 -8
- package/ReactCommon/react/bridging/tests/BridgingTest.cpp +35 -6
- package/ReactCommon/react/bridging/tests/ClassTest.cpp +58 -0
- package/ReactCommon/react/debug/CMakeLists.txt +6 -2
- package/ReactCommon/react/debug/React-debug.podspec +2 -2
- package/ReactCommon/react/featureflags/CMakeLists.txt +1 -1
- package/ReactCommon/react/featureflags/React-featureflags.podspec +3 -2
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +53 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +65 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +269 -53
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +30 -6
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +52 -4
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +115 -7
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +4 -2
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +15 -3
- package/ReactCommon/react/nativemodule/core/CMakeLists.txt +9 -5
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModulePerfLogger.cpp +2 -4
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModulePerfLogger.h +2 -4
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +0 -19
- package/ReactCommon/react/nativemodule/core/iostests/RCTTurboModuleTests.mm +108 -0
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +7 -2
- package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +4 -3
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.h +2 -4
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +2 -4
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h +3 -4
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +25 -26
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +1 -1
- package/ReactCommon/react/nativemodule/cputime/CMakeLists.txt +20 -0
- package/ReactCommon/react/nativemodule/defaults/CMakeLists.txt +3 -1
- package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +2 -1
- package/ReactCommon/react/nativemodule/devtoolsruntimesettings/CMakeLists.txt +2 -2
- package/ReactCommon/react/nativemodule/devtoolsruntimesettings/DevToolsRuntimeSettingsModule.cpp +2 -0
- package/ReactCommon/react/nativemodule/devtoolsruntimesettings/DevToolsRuntimeSettingsModule.h +1 -1
- package/ReactCommon/react/nativemodule/dom/CMakeLists.txt +2 -1
- package/ReactCommon/react/nativemodule/dom/NativeDOM.cpp +62 -51
- package/ReactCommon/react/nativemodule/dom/NativeDOM.h +33 -18
- package/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +4 -1
- package/ReactCommon/react/nativemodule/fantomtestspecificmethods/CMakeLists.txt +29 -0
- package/ReactCommon/react/nativemodule/fantomtestspecificmethods/NativeFantomTestSpecificMethods.cpp +52 -0
- package/ReactCommon/react/nativemodule/{fantomforcedclonecommithook/NativeFantomForcedCloneCommitHook.h → fantomtestspecificmethods/NativeFantomTestSpecificMethods.h} +7 -6
- package/ReactCommon/react/nativemodule/fantomtestspecificmethods/internal/FantomForcedCloneCommitHook.cpp +56 -0
- package/ReactCommon/react/nativemodule/fantomtestspecificmethods/internal/FantomForcedCloneCommitHook.h +29 -0
- package/ReactCommon/react/nativemodule/featureflags/CMakeLists.txt +1 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +66 -6
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +31 -8
- package/ReactCommon/react/nativemodule/featureflags/React-featureflagsnativemodule.podspec +2 -1
- package/ReactCommon/react/nativemodule/idlecallbacks/CMakeLists.txt +1 -1
- package/ReactCommon/react/nativemodule/idlecallbacks/NativeIdleCallbacks.cpp +10 -17
- package/ReactCommon/react/nativemodule/idlecallbacks/NativeIdleCallbacks.h +3 -4
- package/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +3 -1
- package/ReactCommon/react/nativemodule/intersectionobserver/CMakeLists.txt +28 -0
- package/ReactCommon/react/nativemodule/intersectionobserver/NativeIntersectionObserver.cpp +66 -11
- package/ReactCommon/react/nativemodule/intersectionobserver/NativeIntersectionObserver.h +20 -4
- package/ReactCommon/react/nativemodule/microtasks/CMakeLists.txt +1 -1
- package/ReactCommon/react/nativemodule/microtasks/NativeMicrotasks.h +1 -3
- package/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec +2 -1
- package/ReactCommon/react/nativemodule/mutationobserver/CMakeLists.txt +27 -0
- package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.cpp +7 -8
- package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.h +5 -5
- package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -0
- package/ReactCommon/react/nativemodule/samples/platform/android/CMakeLists.txt +1 -1
- package/ReactCommon/react/nativemodule/webperformance/CMakeLists.txt +21 -0
- package/ReactCommon/react/nativemodule/webperformance/NativePerformance.cpp +45 -12
- package/ReactCommon/react/nativemodule/webperformance/NativePerformance.h +20 -22
- package/ReactCommon/react/performance/timeline/CMakeLists.txt +2 -1
- package/ReactCommon/react/performance/timeline/PerformanceEntry.h +11 -10
- package/ReactCommon/react/performance/timeline/PerformanceEntryBuffer.h +2 -2
- package/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp +56 -47
- package/ReactCommon/react/performance/timeline/PerformanceEntryReporter.h +33 -20
- package/ReactCommon/react/performance/timeline/PerformanceObserver.h +8 -5
- package/ReactCommon/react/performance/timeline/React-performancetimeline.podspec +3 -2
- package/ReactCommon/react/performance/timeline/tests/PerformanceEntryReporterTest.cpp +196 -79
- package/ReactCommon/react/performance/timeline/tests/PerformanceObserverTest.cpp +238 -44
- package/ReactCommon/react/renderer/animations/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +5 -4
- package/ReactCommon/react/renderer/attributedstring/AttributedString.h +0 -6
- package/ReactCommon/react/renderer/attributedstring/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +9 -3
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +8 -1
- package/ReactCommon/react/renderer/attributedstring/PlaceholderAttributedString.h +34 -0
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +3 -16
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +1 -5
- package/ReactCommon/react/renderer/attributedstring/conversions.h +14 -7
- package/ReactCommon/react/renderer/bridging/CMakeLists.txt +15 -0
- package/ReactCommon/react/renderer/bridging/bridging.h +52 -0
- package/ReactCommon/react/renderer/componentregistry/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/image/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/image/ImageProps.cpp +108 -0
- package/ReactCommon/react/renderer/components/image/ImageProps.h +5 -0
- package/ReactCommon/react/renderer/components/image/ImageShadowNode.cpp +16 -0
- package/ReactCommon/react/renderer/components/inputaccessory/InputAccessoryShadowNode.h +2 -2
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +18 -7
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +1 -1
- package/ReactCommon/react/renderer/components/modal/CMakeLists.txt +9 -2
- package/ReactCommon/react/renderer/components/modal/ModalHostViewComponentDescriptor.h +3 -2
- package/ReactCommon/react/renderer/components/modal/ModalHostViewShadowNode.h +5 -2
- package/ReactCommon/react/renderer/components/modal/ModalHostViewState.cpp +1 -1
- package/ReactCommon/react/renderer/components/modal/ModalHostViewState.h +7 -15
- package/ReactCommon/react/renderer/components/modal/ModalHostViewUtils.h +2 -2
- package/ReactCommon/react/renderer/components/modal/ModalHostViewUtils.mm +1 -1
- package/ReactCommon/react/renderer/components/modal/platform/android/JReactModalHostView.h +38 -0
- package/ReactCommon/react/renderer/components/modal/platform/android/ModalHostViewUtils.cpp +18 -0
- package/ReactCommon/react/renderer/components/modal/platform/cxx/ModalHostViewUtils.cpp +17 -0
- package/ReactCommon/react/renderer/components/progressbar/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.cpp +2 -12
- package/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.h +1 -5
- package/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.h +2 -2
- package/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/conversions.h +2 -2
- package/ReactCommon/react/renderer/components/rncore/ComponentDescriptors.h +10 -26
- package/ReactCommon/react/renderer/components/rncore/EventEmitters.h +10 -165
- package/ReactCommon/react/renderer/components/rncore/Props.h +10 -393
- package/ReactCommon/react/renderer/components/rncore/ShadowNodes.h +10 -94
- package/ReactCommon/react/renderer/components/rncore/States.h +10 -97
- package/ReactCommon/react/renderer/components/root/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/safeareaview/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/safeareaview/SafeAreaViewShadowNode.h +2 -2
- package/ReactCommon/react/renderer/components/scrollview/{ScrollViewProps.cpp → BaseScrollViewProps.cpp} +29 -22
- package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.h +87 -0
- package/ReactCommon/react/renderer/components/scrollview/CMakeLists.txt +16 -3
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h +3 -73
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewState.h +2 -2
- package/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.cpp +354 -0
- package/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.h +46 -0
- package/{React/Runtime/RCTJscInstanceFactory.h → ReactCommon/react/renderer/components/scrollview/platform/cxx/react/renderer/components/scrollview/HostPlatformScrollViewProps.h} +4 -10
- package/ReactCommon/react/renderer/components/switch/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchMeasurementsManager.cpp +32 -41
- package/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchMeasurementsManager.h +0 -3
- package/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchShadowNode.h +2 -2
- package/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +192 -13
- package/ReactCommon/react/renderer/components/text/BaseTextProps.h +6 -0
- package/ReactCommon/react/renderer/components/text/BaseTextShadowNode.h +0 -7
- package/ReactCommon/react/renderer/components/text/CMakeLists.txt +15 -6
- package/ReactCommon/react/renderer/components/text/ParagraphProps.cpp +93 -0
- package/ReactCommon/react/renderer/components/text/ParagraphProps.h +5 -0
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp +143 -80
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +26 -7
- package/ReactCommon/react/renderer/components/text/RawTextProps.cpp +28 -0
- package/ReactCommon/react/renderer/components/text/RawTextProps.h +5 -0
- package/ReactCommon/react/renderer/components/text/TextProps.cpp +21 -0
- package/ReactCommon/react/renderer/components/text/TextProps.h +5 -0
- package/ReactCommon/react/renderer/components/text/conversions.h +2 -2
- package/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.cpp +8 -0
- package/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +23 -2
- package/ReactCommon/react/renderer/components/textinput/BaseTextInputProps.cpp +6 -0
- package/ReactCommon/react/renderer/components/textinput/BaseTextInputShadowNode.h +9 -15
- package/ReactCommon/react/renderer/components/textinput/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.cpp +11 -7
- package/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.h +2 -1
- package/ReactCommon/react/renderer/components/textinput/TextInputState.h +5 -22
- package/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputComponentDescriptor.h +4 -2
- package/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp +277 -0
- package/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputProps.h +10 -1
- package/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.cpp +10 -21
- package/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h +2 -2
- package/ReactCommon/react/renderer/components/textinput/{TextInputState.cpp → platform/android/react/renderer/components/androidtextinput/AndroidTextInputState.cpp} +3 -32
- package/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputState.h +83 -0
- package/ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewProps.cpp +21 -0
- package/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewProps.h +4 -0
- package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +33 -0
- package/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +28 -1
- package/ReactCommon/react/renderer/components/view/AccessibilityProps.h +4 -1
- package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +8 -0
- package/ReactCommon/react/renderer/components/view/CMakeLists.txt +11 -7
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +51 -27
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.h +14 -3
- package/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +144 -516
- package/ReactCommon/react/renderer/components/view/conversions.h +114 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +119 -5
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.h +2 -3
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/NativeDrawable.h +1 -0
- package/ReactCommon/react/renderer/components/view/propsConversions.h +537 -2
- package/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp +6 -2
- package/ReactCommon/react/renderer/components/virtualview/VirtualViewComponentDescriptor.h +20 -0
- package/ReactCommon/react/renderer/components/virtualview/VirtualViewShadowNode.h +37 -0
- package/ReactCommon/react/renderer/consistency/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/consistency/React-rendererconsistency.podspec +1 -1
- package/ReactCommon/react/renderer/core/CMakeLists.txt +3 -2
- package/ReactCommon/react/renderer/core/ComponentDescriptor.h +3 -3
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +9 -6
- package/ReactCommon/react/renderer/core/ConcreteState.h +7 -9
- package/ReactCommon/react/renderer/core/EventEmitter.cpp +7 -0
- package/ReactCommon/react/renderer/core/EventEmitter.h +7 -0
- package/ReactCommon/react/renderer/core/EventLogger.h +3 -2
- package/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp +24 -2
- package/ReactCommon/react/renderer/core/LayoutableShadowNode.h +12 -3
- package/ReactCommon/react/renderer/core/Props.cpp +1 -1
- package/ReactCommon/react/renderer/core/Props.h +5 -2
- package/ReactCommon/react/renderer/core/RawEvent.cpp +2 -0
- package/ReactCommon/react/renderer/core/RawEvent.h +6 -1
- package/ReactCommon/react/renderer/core/ShadowNode.cpp +127 -23
- package/ReactCommon/react/renderer/core/ShadowNode.h +69 -26
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp +8 -0
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +2 -1
- package/ReactCommon/react/renderer/core/ShadowNodeTraits.h +26 -16
- package/ReactCommon/react/renderer/core/State.cpp +2 -2
- package/ReactCommon/react/renderer/core/State.h +3 -5
- package/ReactCommon/react/renderer/core/StateData.h +2 -2
- package/ReactCommon/react/renderer/core/graphicsConversions.h +47 -5
- package/ReactCommon/react/renderer/core/propsConversions.h +37 -0
- package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +7 -6
- package/ReactCommon/react/renderer/core/tests/EventQueueProcessorTest.cpp +9 -1
- package/ReactCommon/react/renderer/core/tests/LayoutableShadowNodeTest.cpp +5 -0
- package/ReactCommon/react/renderer/core/tests/ShadowNodeTest.cpp +38 -5
- package/ReactCommon/react/renderer/css/CMakeLists.txt +2 -2
- package/ReactCommon/react/renderer/css/CSSTokenizer.h +0 -1
- package/ReactCommon/react/renderer/css/React-renderercss.podspec +3 -3
- package/ReactCommon/react/renderer/debug/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +3 -2
- package/ReactCommon/react/renderer/debug/debugStringConvertibleUtils.h +0 -2
- package/ReactCommon/react/renderer/dom/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/dom/DOM.cpp +28 -31
- package/ReactCommon/react/renderer/dom/DOM.h +3 -4
- package/ReactCommon/react/renderer/element/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/element/ComponentBuilder.cpp +4 -3
- package/ReactCommon/react/renderer/element/ComponentBuilder.h +2 -1
- package/ReactCommon/react/renderer/element/Element.h +7 -5
- package/ReactCommon/react/renderer/element/ElementFragment.h +1 -1
- package/ReactCommon/react/renderer/element/tests/ElementTest.cpp +4 -2
- package/ReactCommon/react/renderer/graphics/BlendMode.h +37 -0
- package/ReactCommon/react/renderer/graphics/CMakeLists.txt +12 -4
- package/ReactCommon/react/renderer/graphics/Color.cpp +1 -1
- package/ReactCommon/react/renderer/graphics/Color.h +10 -0
- package/ReactCommon/react/renderer/graphics/Filter.h +25 -0
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +4 -3
- package/ReactCommon/react/renderer/graphics/Transform.cpp +2 -15
- package/ReactCommon/react/renderer/graphics/Transform.h +0 -7
- package/ReactCommon/react/renderer/graphics/platform/android/react/renderer/graphics/HostPlatformColor.h +5 -2
- package/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/HostPlatformColor.h +5 -2
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h +4 -0
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.h +2 -4
- package/ReactCommon/react/renderer/imagemanager/CMakeLists.txt +14 -5
- package/ReactCommon/react/renderer/imagemanager/ImageRequest.h +11 -0
- package/ReactCommon/react/renderer/imagemanager/ImageResponseObserverCoordinator.cpp +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/ImageManager.cpp +1 -2
- package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +2 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTImagePrimitivesConversions.h +1 -1
- package/ReactCommon/react/renderer/imagemanager/primitives.h +59 -0
- package/ReactCommon/react/renderer/leakchecker/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/mapbuffer/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +0 -2
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +0 -2
- package/ReactCommon/react/renderer/mounting/CMakeLists.txt +2 -1
- package/ReactCommon/react/renderer/mounting/Differentiator.cpp +34 -21
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +0 -1
- package/ReactCommon/react/renderer/mounting/ShadowTree.cpp +67 -25
- package/ReactCommon/react/renderer/mounting/ShadowTree.h +13 -0
- package/ReactCommon/react/renderer/mounting/internal/CullingContext.cpp +11 -6
- package/ReactCommon/react/renderer/mounting/internal/sliceChildShadowNodeViewPairs.cpp +6 -2
- package/ReactCommon/react/renderer/mounting/stubs/StubViewTree.cpp +3 -53
- package/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +9 -7
- package/ReactCommon/react/renderer/mounting/tests/StateReconciliationTest.cpp +2 -2
- package/ReactCommon/react/renderer/mounting/updateMountedFlag.cpp +9 -6
- package/ReactCommon/react/renderer/mounting/updateMountedFlag.h +4 -2
- package/ReactCommon/react/renderer/observers/events/CMakeLists.txt +4 -2
- package/ReactCommon/react/renderer/observers/events/EventPerformanceLogger.cpp +27 -10
- package/ReactCommon/react/renderer/observers/events/EventPerformanceLogger.h +9 -7
- package/ReactCommon/react/renderer/observers/intersection/CMakeLists.txt +28 -0
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.cpp +74 -31
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.h +19 -13
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserverManager.cpp +136 -63
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserverManager.h +34 -8
- package/ReactCommon/react/renderer/observers/mutation/CMakeLists.txt +24 -0
- package/ReactCommon/react/renderer/observers/mutation/MutationObserver.cpp +34 -46
- package/ReactCommon/react/renderer/observers/mutation/MutationObserver.h +15 -15
- package/ReactCommon/react/renderer/observers/mutation/MutationObserverManager.cpp +17 -32
- package/ReactCommon/react/renderer/observers/mutation/MutationObserverManager.h +2 -4
- package/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +4 -3
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +12 -6
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +16 -10
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +3 -5
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h +1 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerIntersectionObserverDelegate.h +25 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.cpp +11 -4
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.h +11 -8
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp +61 -62
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.h +25 -21
- package/ReactCommon/react/renderer/runtimescheduler/SchedulerPriorityUtils.h +8 -7
- package/ReactCommon/react/renderer/runtimescheduler/Task.cpp +17 -5
- package/ReactCommon/react/renderer/runtimescheduler/Task.h +6 -4
- package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +43 -31
- package/ReactCommon/react/renderer/runtimescheduler/tests/StubClock.h +6 -11
- package/ReactCommon/react/renderer/scheduler/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +10 -3
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +5 -3
- package/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h +3 -0
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +5 -4
- package/ReactCommon/react/renderer/telemetry/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt +16 -6
- package/ReactCommon/react/renderer/textlayoutmanager/TextLayoutManagerExtended.h +6 -0
- package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +81 -10
- package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +116 -104
- package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.h +5 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/react/renderer/textlayoutmanager/TextLayoutManager.cpp +5 -2
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +23 -6
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/TextLayoutManager.mm +27 -28
- package/ReactCommon/react/renderer/uimanager/CMakeLists.txt +2 -1
- package/ReactCommon/react/renderer/uimanager/PointerEventsProcessor.cpp +15 -10
- package/ReactCommon/react/renderer/uimanager/PointerEventsProcessor.h +6 -7
- package/ReactCommon/react/renderer/uimanager/PointerHoverTracker.cpp +2 -3
- package/ReactCommon/react/renderer/uimanager/PointerHoverTracker.h +5 -3
- package/ReactCommon/react/renderer/uimanager/UIManager.cpp +21 -19
- package/ReactCommon/react/renderer/uimanager/UIManager.h +13 -12
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +47 -23
- package/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h +9 -3
- package/ReactCommon/react/renderer/uimanager/UIManagerMountHook.h +2 -2
- package/ReactCommon/react/renderer/uimanager/UIManagerUpdateShadowTree.cpp +6 -1
- package/ReactCommon/react/renderer/uimanager/consistency/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/uimanager/consistency/tests/LazyShadowTreeRevisionConsistencyManagerTest.cpp +1 -1
- package/ReactCommon/react/renderer/uimanager/primitives.h +10 -18
- package/ReactCommon/react/renderer/uimanager/tests/PointerEventsProcessorTest.cpp +1 -1
- package/ReactCommon/react/runtime/BridgelessNativeMethodCallInvoker.h +0 -1
- package/ReactCommon/react/runtime/BufferedRuntimeExecutor.h +1 -0
- package/ReactCommon/react/runtime/CMakeLists.txt +8 -3
- package/ReactCommon/react/runtime/React-RuntimeCore.podspec +4 -3
- package/ReactCommon/react/runtime/React-RuntimeHermes.podspec +4 -2
- package/ReactCommon/react/runtime/ReactInstance.cpp +2 -1
- package/ReactCommon/react/runtime/ReactInstance.h +1 -0
- package/ReactCommon/react/runtime/hermes/CMakeLists.txt +5 -2
- package/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec +8 -10
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +43 -20
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTLegacyUIManagerConstantsProvider.mm +1 -1
- package/ReactCommon/react/test_utils/shadowTreeGeneration.h +16 -16
- package/ReactCommon/react/timing/React-timing.podspec +1 -1
- package/ReactCommon/react/timing/primitives.h +280 -15
- package/ReactCommon/react/timing/tests/PrimitivesTest.cpp +82 -24
- package/ReactCommon/react/utils/CMakeLists.txt +13 -3
- package/ReactCommon/react/utils/FloatComparison.h +8 -2
- package/ReactCommon/react/utils/ManagedObjectWrapper.mm +2 -4
- package/ReactCommon/react/utils/OnScopeExit.h +1 -1
- package/ReactCommon/react/utils/PackTraits.h +0 -2
- package/ReactCommon/react/utils/React-utils.podspec +4 -3
- package/ReactCommon/react/utils/SimpleThreadSafeCache.h +40 -28
- package/ReactCommon/react/utils/iequals.h +1 -3
- package/ReactCommon/react/utils/platform/ios/react/utils/FollyConvert.h +18 -0
- package/{React/CxxUtils/RCTFollyConvert.mm → ReactCommon/react/utils/platform/ios/react/utils/FollyConvert.mm} +17 -1
- package/ReactCommon/react/utils/tests/SimpleThreadSafeCacheTest.cpp +40 -0
- package/ReactCommon/reactperflogger/React-perflogger.podspec +2 -1
- package/ReactCommon/reactperflogger/reactperflogger/BridgeNativeModulePerfLogger.cpp +2 -4
- package/ReactCommon/reactperflogger/reactperflogger/BridgeNativeModulePerfLogger.h +2 -6
- package/ReactCommon/reactperflogger/reactperflogger/FuseboxPerfettoDataSource.cpp +6 -2
- package/ReactCommon/reactperflogger/reactperflogger/HermesPerfettoDataSource.cpp +10 -4
- package/ReactCommon/reactperflogger/reactperflogger/NativeModulePerfLogger.h +1 -1
- package/ReactCommon/reactperflogger/reactperflogger/ReactPerfetto.cpp +10 -6
- package/ReactCommon/reactperflogger/reactperflogger/ReactPerfetto.h +2 -1
- package/ReactCommon/reactperflogger/reactperflogger/ReactPerfettoLogger.cpp +9 -12
- package/ReactCommon/reactperflogger/reactperflogger/ReactPerfettoLogger.h +4 -3
- package/ReactCommon/runtimeexecutor/CMakeLists.txt +2 -2
- package/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +24 -1
- package/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h +0 -72
- package/ReactCommon/runtimeexecutor/platform/cxx/ReactCommon/RuntimeExecutorSyncUIThreadUtils.cpp +61 -0
- package/ReactCommon/runtimeexecutor/platform/cxx/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h +36 -0
- package/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h +39 -0
- package/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm +260 -0
- package/ReactCommon/yoga/Yoga.podspec +1 -1
- package/ReactCommon/yoga/yoga/YGNodeLayout.cpp +8 -0
- package/ReactCommon/yoga/yoga/YGNodeLayout.h +10 -0
- package/ReactCommon/yoga/yoga/YGValue.h +2 -2
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +21 -16
- package/ReactCommon/yoga/yoga/algorithm/PixelGrid.cpp +6 -6
- package/ReactCommon/yoga/yoga/node/LayoutResults.h +9 -0
- package/ReactCommon/yoga/yoga/node/Node.cpp +29 -0
- package/ReactCommon/yoga/yoga/node/Node.h +6 -4
- package/cli.js +52 -33
- package/{src/types → flow}/bom.js.flow +0 -10
- package/{src/types → flow}/cssom.js.flow +0 -1
- package/{src/types → flow}/dom.js.flow +0 -1
- package/{src/types → flow}/streams.js.flow +0 -1
- package/gradle/libs.versions.toml +6 -5
- package/index.js +22 -2
- package/index.js.flow +10 -1
- package/interface.js +1 -1
- package/jest/MockNativeMethods.js +9 -3
- package/jest/assetFileTransformer.js +1 -0
- package/jest/local-setup.js +4 -3
- package/jest/mock.js +39 -0
- package/jest/mockComponent.js +47 -17
- package/jest/mockNativeComponent.js +26 -15
- package/jest/mocks/AccessibilityInfo.js +62 -0
- package/jest/mocks/ActivityIndicator.js +23 -0
- package/jest/mocks/AppState.js +19 -0
- package/jest/mocks/Clipboard.js +16 -0
- package/jest/mocks/Image.js +23 -0
- package/jest/mocks/InitializeCore.js +9 -0
- package/jest/mocks/Linking.js +28 -0
- package/jest/mocks/Modal.js +33 -0
- package/jest/mocks/NativeComponentRegistry.js +30 -0
- package/jest/mocks/NativeModules.js +239 -0
- package/jest/mocks/RefreshControl.js +31 -0
- package/jest/mocks/RendererProxy.js +45 -0
- package/jest/mocks/ScrollView.js +58 -0
- package/jest/mocks/Text.js +27 -0
- package/jest/mocks/TextInput.js +32 -0
- package/jest/mocks/UIManager.js +60 -0
- package/jest/mocks/Vibration.js +16 -0
- package/jest/mocks/View.js +27 -0
- package/jest/mocks/ViewNativeComponent.js +23 -0
- package/jest/mocks/requireNativeComponent.js +22 -0
- package/{Libraries/Utilities/infoLog.js → jest/mocks/useColorScheme.js} +7 -9
- package/jest/react-native-env.js +1 -0
- package/jest/renderer.js +1 -2
- package/jest/resolver.js +1 -0
- package/jest/setup.js +64 -443
- package/jest-preset.js +1 -0
- package/package.json +16 -22
- package/react-native.config.js +18 -5
- package/scripts/bundle.js +10 -2
- package/scripts/cocoapods/helpers.rb +1 -1
- package/scripts/cocoapods/jsengine.rb +28 -16
- package/scripts/cocoapods/new_architecture.rb +1 -0
- package/scripts/cocoapods/rncore.rb +247 -0
- package/scripts/cocoapods/rndependencies.rb +86 -26
- package/scripts/cocoapods/utils.rb +73 -44
- package/scripts/codegen/codegen-utils.js +9 -4
- package/scripts/codegen/generate-artifacts-executor/constants.js +30 -36
- package/scripts/codegen/generate-artifacts-executor/generateAppDependencyProvider.js +2 -1
- package/scripts/codegen/generate-artifacts-executor/generateCustomURLHandlers.js +10 -4
- package/scripts/codegen/generate-artifacts-executor/generateFBReactNativeSpecIOS.js +8 -4
- package/scripts/codegen/generate-artifacts-executor/generateNativeCode.js +21 -29
- package/scripts/codegen/generate-artifacts-executor/generateRCTModuleProviders.js +7 -6
- package/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js +13 -6
- package/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js +8 -7
- package/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js +15 -5
- package/scripts/codegen/generate-artifacts-executor/generateUnstableModulesRequiringMainQueueSetupProvider.js +4 -3
- package/scripts/codegen/generate-artifacts-executor/index.js +24 -10
- package/scripts/codegen/generate-artifacts-executor/utils.js +51 -23
- package/scripts/codegen/generate-specs-cli-executor.js +36 -30
- package/scripts/codegen/templates/ReactCodegen.podspec.template +5 -2
- package/scripts/compose-source-maps.js +3 -2
- package/scripts/generate-codegen-artifacts.js +2 -0
- package/scripts/generate-provider-cli.js +11 -5
- package/scripts/generate-specs-cli.js +7 -0
- package/scripts/hermes/hermes-utils.js +2 -2
- package/scripts/hermes/prepare-hermes-for-build.js +2 -1
- package/scripts/packager-reporter.js +9 -3
- package/scripts/react_native_pods.rb +56 -24
- package/scripts/replace-rncore-version.js +120 -0
- package/sdks/.hermesversion +1 -1
- package/sdks/hermes-engine/hermes-utils.rb +25 -23
- package/sdks/hermes-engine/utils/build-hermesc-xcode.sh +11 -3
- package/sdks/hermes-engine/utils/replace_hermes_version.js +1 -0
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/sdks/hermesc/win64-bin/msvcp140.dll +0 -0
- package/sdks/hermesc/win64-bin/vcruntime140.dll +0 -0
- package/sdks/hermesc/win64-bin/vcruntime140_1.dll +0 -0
- package/src/private/animated/NativeAnimatedHelper.js +8 -1
- package/src/private/animated/createAnimatedPropsHook.js +14 -4
- package/src/private/animated/createAnimatedPropsMemoHook.js +2 -3
- package/src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js +0 -1
- package/src/private/components/scrollview/HScrollViewNativeComponents.js +0 -1
- package/src/private/components/scrollview/VScrollViewNativeComponents.js +0 -1
- package/src/private/components/virtualview/VirtualView.js +145 -0
- package/src/private/components/virtualview/VirtualViewNativeComponent.js +90 -0
- package/src/private/devsupport/devmenu/elementinspector/BorderBox.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/BoxInspector.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/ElementBox.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/ElementProperties.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/Inspector.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/InspectorOverlay.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/InspectorPanel.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/NetworkOverlay.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/ReactDevToolsOverlay.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/StyleInspector.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/XHRInterceptor.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/getInspectorDataForViewAtPoint.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/resolveBoxStyle.js +1 -1
- package/src/private/devsupport/devmenu/perfmonitor/PerformanceOverlay.js +1 -1
- package/src/private/devsupport/rndevtools/FuseboxSessionObserver.js +0 -1
- package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.android.js +8 -9
- package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.ios.js +12 -15
- package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.js.flow +3 -7
- package/src/private/devsupport/rndevtools/setUpFuseboxReactDevToolsDispatcher.js +0 -1
- package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +0 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +93 -8
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +2 -0
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +16 -3
- package/src/private/renderer/errorhandling/ErrorHandlers.js +1 -1
- package/src/private/setup/setUpDefaultReactNativeEnvironment.js +44 -0
- package/src/private/setup/setUpPerformanceObserver.js +7 -0
- package/src/private/specs_DEPRECATED/components/ActivityIndicatorViewNativeComponent.js +8 -5
- package/src/private/specs_DEPRECATED/components/AndroidDrawerLayoutNativeComponent.js +4 -4
- package/src/private/specs_DEPRECATED/components/AndroidHorizontalScrollContentViewNativeComponent.js +4 -4
- package/src/private/specs_DEPRECATED/components/AndroidSwipeRefreshLayoutNativeComponent.js +4 -4
- package/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.js +10 -7
- package/src/private/specs_DEPRECATED/components/DebuggingOverlayNativeComponent.js +5 -4
- package/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.js +7 -4
- package/src/private/specs_DEPRECATED/components/PullToRefreshViewNativeComponent.js +10 -7
- package/src/private/specs_DEPRECATED/components/RCTInputAccessoryViewNativeComponent.js +9 -6
- package/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js +15 -6
- package/src/private/specs_DEPRECATED/components/RCTSafeAreaViewNativeComponent.js +9 -6
- package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +5 -5
- package/src/private/specs_DEPRECATED/components/UnimplementedNativeViewNativeComponent.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.js +1 -0
- package/src/private/specs_DEPRECATED/modules/NativeFrameRateLogger.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativePermissionsAndroid.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativePushNotificationManagerIOS.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +9 -6
- package/src/private/styles/composeStyles.js +5 -12
- package/src/private/types/HostInstance.js +1 -1
- package/src/private/webapis/dom/events/Event.js +3 -0
- package/src/private/webapis/dom/events/EventTarget.js +3 -0
- package/src/private/webapis/dom/nodes/ReactNativeDocument.js +1 -1
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +7 -24
- package/src/private/webapis/dom/nodes/ReadOnlyCharacterData.js +1 -1
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +1 -1
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +4 -2
- package/src/private/webapis/dom/nodes/ReadOnlyText.js +1 -1
- package/src/private/webapis/dom/nodes/internals/NodeInternals.js +1 -1
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentElementInstanceHandle.js +1 -1
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -1
- package/src/private/webapis/dom/nodes/internals/Traversal.js +1 -1
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +38 -0
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +4 -1
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js.flow +1 -1
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +4 -1
- package/src/private/webapis/dom/oldstylecollections/NodeList.js.flow +1 -1
- package/src/private/webapis/errors/DOMException.js +166 -0
- package/src/private/webapis/geometry/DOMRect.js +5 -0
- package/src/private/webapis/geometry/DOMRectList.js +4 -1
- package/src/private/webapis/geometry/DOMRectList.js.flow +1 -1
- package/src/private/webapis/geometry/DOMRectReadOnly.js +6 -0
- package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +4 -2
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +15 -7
- package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +3 -0
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +83 -18
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +12 -0
- package/src/private/webapis/mutationobserver/MutationObserver.js +13 -38
- package/src/private/webapis/mutationobserver/MutationRecord.js +3 -0
- package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +7 -29
- package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +1 -4
- package/src/private/webapis/performance/EventTiming.js +1 -1
- package/src/private/webapis/performance/LongTasks.js +1 -1
- package/src/private/webapis/performance/MemoryInfo.js +4 -1
- package/src/private/webapis/performance/Performance.js +20 -9
- package/src/private/webapis/performance/PerformanceEntry.js +5 -1
- package/src/private/webapis/performance/PerformanceObserver.js +32 -28
- package/src/private/webapis/performance/ReactNativeStartupTiming.js +4 -1
- package/src/private/webapis/performance/ResourceTiming.js +108 -0
- package/src/private/webapis/performance/UserTiming.js +1 -1
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +50 -33
- package/src/private/webapis/performance/internals/Utilities.js +1 -1
- package/src/private/webapis/performance/specs/NativePerformance.js +1 -1
- package/src/private/webapis/structuredClone/structuredClone.js +233 -0
- package/src/private/webapis/utils/ArrayLikeUtils.js +1 -1
- package/src/private/webapis/webidl/PlatformObjects.js +59 -0
- package/third-party-podspecs/ReactNativeDependencies.podspec +14 -1
- package/third-party-podspecs/replace_dependencies_version.js +37 -6
- package/types/modules/Devtools.d.ts +23 -9
- package/types_generated/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +101 -0
- package/types_generated/Libraries/Alert/Alert.d.ts +55 -0
- package/types_generated/Libraries/Animated/Animated.d.ts +14 -0
- package/types_generated/Libraries/Animated/AnimatedEvent.d.ts +30 -0
- package/types_generated/Libraries/Animated/AnimatedExports.d.ts +190 -0
- package/types_generated/Libraries/Animated/AnimatedImplementation.d.ts +128 -0
- package/types_generated/Libraries/Animated/AnimatedPlatformConfig.d.ts +13 -0
- package/types_generated/Libraries/Animated/Easing.d.ts +171 -0
- package/types_generated/Libraries/Animated/animations/Animation.d.ts +35 -0
- package/types_generated/Libraries/Animated/animations/DecayAnimation.d.ts +42 -0
- package/types_generated/Libraries/Animated/animations/SpringAnimation.d.ts +130 -0
- package/types_generated/Libraries/Animated/animations/TimingAnimation.d.ts +54 -0
- package/types_generated/Libraries/Animated/components/AnimatedFlatList.d.ts +22 -0
- package/types_generated/Libraries/Animated/components/AnimatedImage.d.ts +18 -0
- package/types_generated/Libraries/Animated/components/AnimatedScrollView.d.ts +23 -0
- package/types_generated/Libraries/Animated/components/AnimatedSectionList.d.ts +22 -0
- package/types_generated/Libraries/Animated/components/AnimatedText.d.ts +18 -0
- package/types_generated/Libraries/Animated/components/AnimatedView.d.ts +19 -0
- package/types_generated/Libraries/Animated/createAnimatedComponent.d.ts +42 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedAddition.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedColor.d.ts +76 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedDiffClamp.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedDivision.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedInterpolation.d.ts +36 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedModulo.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedMultiplication.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedNode.d.ts +46 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedProps.d.ts +29 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedStyle.d.ts +32 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedSubtraction.d.ts +22 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedTracking.d.ts +21 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedValue.d.ts +126 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedValueXY.d.ts +135 -0
- package/types_generated/Libraries/Animated/nodes/AnimatedWithChildren.d.ts +15 -0
- package/types_generated/Libraries/Animated/useAnimatedValue.d.ts +15 -0
- package/types_generated/Libraries/AppState/AppState.d.ts +63 -0
- package/types_generated/Libraries/BatchedBridge/BatchedBridge.d.ts +17 -0
- package/types_generated/Libraries/BatchedBridge/MessageQueue.d.ts +39 -0
- package/types_generated/Libraries/BatchedBridge/NativeModules.d.ts +20 -0
- package/types_generated/Libraries/Blob/Blob.d.ts +80 -0
- package/types_generated/Libraries/Blob/BlobTypes.d.ts +27 -0
- package/types_generated/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +220 -0
- package/types_generated/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.d.ts +20 -0
- package/types_generated/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +84 -0
- package/types_generated/Libraries/Components/Button.d.ts +251 -0
- package/types_generated/Libraries/Components/Clipboard/Clipboard.d.ts +38 -0
- package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +17 -0
- package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidFallback.d.ts +27 -0
- package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.d.ts +176 -0
- package/types_generated/Libraries/Components/Keyboard/Keyboard.d.ts +146 -0
- package/types_generated/Libraries/Components/Keyboard/KeyboardAvoidingView.d.ts +73 -0
- package/types_generated/Libraries/Components/LayoutConformance/LayoutConformance.d.ts +24 -0
- package/types_generated/Libraries/Components/Pressable/Pressable.d.ts +141 -0
- package/types_generated/Libraries/Components/Pressable/useAndroidRippleForView.d.ts +45 -0
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +32 -0
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.d.ts +14 -0
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.d.ts +50 -0
- package/types_generated/Libraries/Components/RefreshControl/RefreshControl.d.ts +113 -0
- package/types_generated/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +33 -0
- package/types_generated/Libraries/Components/ScrollView/ScrollView.d.ts +560 -0
- package/types_generated/Libraries/Components/ScrollView/ScrollViewContext.d.ts +24 -0
- package/types_generated/Libraries/Components/ScrollView/ScrollViewNativeComponent.d.ts +21 -0
- package/types_generated/Libraries/Components/ScrollView/ScrollViewNativeComponentType.d.ts +134 -0
- package/types_generated/Libraries/Components/ScrollView/ScrollViewStickyHeader.d.ts +36 -0
- package/types_generated/Libraries/Components/StatusBar/StatusBar.d.ts +222 -0
- package/types_generated/Libraries/Components/Switch/AndroidSwitchNativeComponent.d.ts +14 -0
- package/types_generated/Libraries/Components/Switch/Switch.d.ts +138 -0
- package/types_generated/Libraries/Components/Switch/SwitchNativeComponent.d.ts +14 -0
- package/types_generated/Libraries/Components/TV/TVEventControl.d.ts +23 -0
- package/types_generated/Libraries/Components/TV/TVEventHandler.d.ts +21 -0
- package/types_generated/Libraries/Components/TV/TVFocusGuideView.d.ts +71 -0
- package/types_generated/Libraries/Components/TV/TVTextScrollView.d.ts +97 -0
- package/types_generated/Libraries/Components/TV/TVViewPropTypes.d.ts +79 -0
- package/types_generated/Libraries/Components/TV/tagForComponentOrHandle.d.ts +24 -0
- package/types_generated/Libraries/Components/TV/useTVEventHandler.d.ts +20 -0
- package/types_generated/Libraries/Components/TextInput/InputAccessoryView.d.ts +86 -0
- package/types_generated/Libraries/Components/TextInput/TextInput.d.ts +47 -0
- package/types_generated/Libraries/Components/TextInput/TextInput.flow.d.ts +984 -0
- package/types_generated/Libraries/Components/TextInput/TextInputState.d.ts +54 -0
- package/types_generated/Libraries/Components/ToastAndroid/ToastAndroid.d.ts +99 -0
- package/types_generated/Libraries/Components/Touchable/Touchable.d.ts +257 -0
- package/types_generated/Libraries/Components/Touchable/TouchableHighlight.d.ts +71 -0
- package/types_generated/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts +228 -0
- package/types_generated/Libraries/Components/Touchable/TouchableOpacity.d.ts +76 -0
- package/types_generated/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +121 -0
- package/types_generated/Libraries/Components/View/View.d.ts +30 -0
- package/types_generated/Libraries/Components/View/ViewAccessibility.d.ts +415 -0
- package/types_generated/Libraries/Components/View/ViewNativeComponent.d.ts +29 -0
- package/types_generated/Libraries/Components/View/ViewPropTypes.d.ts +431 -0
- package/types_generated/Libraries/Core/Devtools/symbolicateStackTrace.d.ts +27 -0
- package/types_generated/Libraries/Core/ExceptionsManager.d.ts +43 -0
- package/types_generated/Libraries/Core/ExtendedError.d.ts +26 -0
- package/types_generated/Libraries/Core/NativeExceptionsManager.d.ts +17 -0
- package/types_generated/Libraries/Core/RawEventEmitter.d.ts +26 -0
- package/types_generated/Libraries/Core/ReactFiberErrorDialog.d.ts +27 -0
- package/types_generated/Libraries/Core/registerCallableModule.d.ts +18 -0
- package/types_generated/Libraries/EventEmitter/NativeEventEmitter.d.ts +42 -0
- package/types_generated/Libraries/EventEmitter/RCTDeviceEventEmitter.d.ts +19 -0
- package/types_generated/Libraries/EventEmitter/RCTEventEmitter.d.ts +18 -0
- package/types_generated/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +21 -0
- package/types_generated/Libraries/Image/AssetSourceResolver.d.ts +71 -0
- package/types_generated/Libraries/Image/Image.d.ts +18 -0
- package/types_generated/Libraries/Image/ImageBackground.d.ts +44 -0
- package/types_generated/Libraries/Image/ImageProps.d.ts +512 -0
- package/types_generated/Libraries/Image/ImageResizeMode.d.ts +17 -0
- package/types_generated/Libraries/Image/ImageSource.d.ts +94 -0
- package/types_generated/Libraries/Image/ImageTypes.flow.d.ts +64 -0
- package/types_generated/Libraries/Image/ImageViewNativeComponent.d.ts +68 -0
- package/types_generated/Libraries/Image/TextInlineImageNativeComponent.d.ts +42 -0
- package/types_generated/Libraries/Interaction/InteractionManager.d.ts +100 -0
- package/types_generated/Libraries/Interaction/PanResponder.d.ts +231 -0
- package/types_generated/Libraries/Interaction/TaskQueue.d.ts +73 -0
- package/types_generated/Libraries/LayoutAnimation/LayoutAnimation.d.ts +76 -0
- package/types_generated/Libraries/Linking/Linking.d.ts +68 -0
- package/types_generated/Libraries/Lists/FlatList.d.ts +317 -0
- package/types_generated/Libraries/Lists/SectionList.d.ts +172 -0
- package/types_generated/Libraries/Lists/VirtualizedList.d.ts +19 -0
- package/types_generated/Libraries/Lists/VirtualizedSectionList.d.ts +19 -0
- package/types_generated/Libraries/LogBox/Data/LogBoxData.d.ts +78 -0
- package/types_generated/Libraries/LogBox/Data/LogBoxLog.d.ts +88 -0
- package/types_generated/Libraries/LogBox/Data/LogBoxSymbolication.d.ts +17 -0
- package/types_generated/Libraries/LogBox/Data/parseLogBoxLog.d.ts +53 -0
- package/types_generated/Libraries/LogBox/LogBox.d.ts +29 -0
- package/types_generated/Libraries/Modal/Modal.d.ts +110 -0
- package/types_generated/Libraries/NativeModules/specs/NativeDialogManagerAndroid.d.ts +17 -0
- package/types_generated/Libraries/Network/FormData.d.ts +56 -0
- package/types_generated/Libraries/Network/RCTNetworking.d.ts +25 -0
- package/types_generated/Libraries/Network/RCTNetworkingEventDefinitions.flow.d.ts +22 -0
- package/types_generated/Libraries/Network/XMLHttpRequest.d.ts +96 -0
- package/types_generated/Libraries/Network/convertRequestBody.d.ts +21 -0
- package/types_generated/Libraries/Performance/Systrace.d.ts +61 -0
- package/types_generated/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +129 -0
- package/types_generated/Libraries/Pressability/Pressability.d.ts +241 -0
- package/types_generated/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts +323 -0
- package/types_generated/Libraries/ReactNative/AppRegistry.d.ts +14 -0
- package/types_generated/Libraries/ReactNative/AppRegistry.flow.d.ts +44 -0
- package/types_generated/Libraries/ReactNative/AppRegistryImpl.d.ts +73 -0
- package/types_generated/Libraries/ReactNative/DisplayMode.d.ts +24 -0
- package/types_generated/Libraries/ReactNative/I18nManager.d.ts +23 -0
- package/types_generated/Libraries/ReactNative/NativeI18nManager.d.ts +17 -0
- package/types_generated/Libraries/ReactNative/NativeUIManager.d.ts +17 -0
- package/types_generated/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.d.ts +28 -0
- package/types_generated/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.d.ts +32 -0
- package/types_generated/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.d.ts +15 -0
- package/types_generated/Libraries/ReactNative/RendererImplementation.d.ts +37 -0
- package/types_generated/Libraries/ReactNative/RendererProxy.d.ts +28 -0
- package/types_generated/Libraries/ReactNative/RootTag.d.ts +22 -0
- package/types_generated/Libraries/ReactNative/UIManager.d.ts +17 -0
- package/types_generated/Libraries/ReactNative/requireNativeComponent.d.ts +25 -0
- package/types_generated/Libraries/ReactPrivate/ReactNativePrivateInterface.d.ts +33 -0
- package/types_generated/Libraries/Renderer/shims/ReactNativeTypes.d.ts +169 -0
- package/types_generated/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.d.ts +41 -0
- package/types_generated/Libraries/Settings/Settings.d.ts +21 -0
- package/types_generated/Libraries/Share/Share.d.ts +85 -0
- package/types_generated/Libraries/StyleSheet/EdgeInsetsPropType.d.ts +15 -0
- package/types_generated/Libraries/StyleSheet/PlatformColorValueTypes.d.ts +17 -0
- package/types_generated/Libraries/StyleSheet/PlatformColorValueTypesIOS.d.ts +27 -0
- package/types_generated/Libraries/StyleSheet/PointPropType.d.ts +16 -0
- package/types_generated/Libraries/StyleSheet/Rect.d.ts +22 -0
- package/types_generated/Libraries/StyleSheet/StyleSheet.d.ts +153 -0
- package/types_generated/Libraries/StyleSheet/StyleSheetExports.d.ts +107 -0
- package/types_generated/Libraries/StyleSheet/StyleSheetTypes.d.ts +826 -0
- package/types_generated/Libraries/StyleSheet/flattenStyle.d.ts +19 -0
- package/types_generated/Libraries/StyleSheet/private/_StyleSheetTypesOverrides.d.ts +17 -0
- package/types_generated/Libraries/StyleSheet/private/_TransformStyle.d.ts +76 -0
- package/types_generated/Libraries/StyleSheet/processColor.d.ts +18 -0
- package/types_generated/Libraries/Text/Text.d.ts +30 -0
- package/types_generated/Libraries/Text/TextAncestorContext.d.ts +20 -0
- package/types_generated/Libraries/Text/TextNativeComponent.d.ts +31 -0
- package/types_generated/Libraries/Text/TextProps.d.ts +220 -0
- package/types_generated/Libraries/TurboModule/RCTExport.d.ts +35 -0
- package/types_generated/Libraries/TurboModule/TurboModuleRegistry.d.ts +15 -0
- package/types_generated/Libraries/Types/CodegenTypes.d.ts +24 -0
- package/types_generated/Libraries/Types/CodegenTypesNamespace.d.ts +14 -0
- package/types_generated/Libraries/Types/CoreEventTypes.d.ts +327 -0
- package/types_generated/Libraries/Types/RootTagTypes.d.ts +13 -0
- package/types_generated/Libraries/Types/UIManagerJSInterface.d.ts +17 -0
- package/types_generated/Libraries/UTFSequence.d.ts +39 -0
- package/types_generated/Libraries/Utilities/Appearance.d.ts +31 -0
- package/types_generated/Libraries/Utilities/BackHandler.d.ts +23 -0
- package/types_generated/Libraries/Utilities/DevSettings.d.ts +34 -0
- package/types_generated/Libraries/Utilities/DeviceInfo.d.ts +17 -0
- package/types_generated/Libraries/Utilities/Dimensions.d.ts +54 -0
- package/types_generated/Libraries/Utilities/IPerformanceLogger.d.ts +51 -0
- package/types_generated/Libraries/Utilities/NativeAppearance.d.ts +17 -0
- package/types_generated/Libraries/Utilities/NativeDeviceInfo.d.ts +14 -0
- package/types_generated/Libraries/Utilities/PixelRatio.d.ts +110 -0
- package/types_generated/Libraries/Utilities/Platform.d.ts +16 -0
- package/types_generated/Libraries/Utilities/PlatformTypes.d.ts +134 -0
- package/types_generated/Libraries/Utilities/codegenNativeCommands.d.ts +19 -0
- package/types_generated/Libraries/Utilities/codegenNativeComponent.d.ts +24 -0
- package/types_generated/Libraries/Utilities/createPerformanceLogger.d.ts +23 -0
- package/types_generated/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.d.ts +33 -0
- package/types_generated/Libraries/Utilities/differ/deepDiffer.d.ts +19 -0
- package/types_generated/Libraries/Utilities/useColorScheme.d.ts +15 -0
- package/types_generated/Libraries/Utilities/useWindowDimensions.d.ts +15 -0
- package/types_generated/Libraries/Vibration/Vibration.d.ts +29 -0
- package/types_generated/Libraries/vendor/core/ErrorUtils.d.ts +39 -0
- package/types_generated/Libraries/vendor/emitter/EventEmitter.d.ts +67 -0
- package/types_generated/index.d.ts +164 -0
- package/types_generated/src/private/components/virtualview/VirtualView.d.ts +70 -0
- package/types_generated/src/private/components/virtualview/VirtualViewNativeComponent.d.ts +97 -0
- package/types_generated/src/private/devsupport/devmenu/DevMenu.d.ts +28 -0
- package/types_generated/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.d.ts +53 -0
- package/types_generated/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.d.ts +36 -0
- package/types_generated/src/private/specs_DEPRECATED/components/SwitchNativeComponent.d.ts +51 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeAppearance.d.ts +26 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.d.ts +46 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.d.ts +37 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.d.ts +45 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeI18nManager.d.ts +27 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeUIManager.d.ts +109 -0
- package/types_generated/src/private/styles/composeStyles.d.ts +19 -0
- package/types_generated/src/private/types/HostComponent.d.ts +19 -0
- package/types_generated/src/private/types/HostInstance.d.ts +91 -0
- package/types_generated/src/private/webapis/dom/events/CustomEvent.d.ts +27 -0
- package/types_generated/src/private/webapis/dom/events/Event.d.ts +58 -0
- package/types_generated/src/private/webapis/dom/events/EventTarget.d.ts +48 -0
- package/types_generated/src/private/webapis/dom/nodes/ReactNativeDocument.d.ts +32 -0
- package/types_generated/src/private/webapis/dom/nodes/ReactNativeElement.d.ts +36 -0
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyCharacterData.d.ts +30 -0
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyElement.d.ts +54 -0
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyNode.d.ts +126 -0
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyText.d.ts +24 -0
- package/types_generated/src/private/webapis/dom/nodes/internals/NodeInternals.d.ts +29 -0
- package/types_generated/src/private/webapis/dom/nodes/internals/ReactNativeDocumentElementInstanceHandle.d.ts +23 -0
- package/types_generated/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.d.ts +22 -0
- package/types_generated/src/private/webapis/dom/nodes/specs/NativeDOM.d.ts +222 -0
- package/types_generated/src/private/webapis/dom/oldstylecollections/HTMLCollection.d.ts +22 -0
- package/types_generated/src/private/webapis/dom/oldstylecollections/NodeList.d.ts +25 -0
- package/types_generated/src/private/webapis/geometry/DOMRect.d.ts +46 -0
- package/types_generated/src/private/webapis/geometry/DOMRectReadOnly.d.ts +73 -0
- package/types_generated/src/private/webapis/utils/ArrayLikeUtils.d.ts +27 -0
- package/types_generated/tsconfig.json +3 -0
- package/types_generated/tsconfig.test.json +16 -0
- package/Libraries/BugReporting/BugReporting.js +0 -140
- package/Libraries/BugReporting/NativeBugReporting.js +0 -13
- package/Libraries/BugReporting/dumpReactTree.js +0 -151
- package/Libraries/BugReporting/getReactData.js +0 -187
- package/Libraries/Interaction/JSEventLoopWatchdog.js +0 -88
- package/React/CxxBridge/JSCExecutorFactory.h +0 -27
- package/React/CxxBridge/JSCExecutorFactory.mm +0 -24
- package/React/Runtime/RCTJscInstanceFactory.mm +0 -20
- package/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java +0 -222
- package/ReactAndroid/src/main/java/com/facebook/react/JSEngineResolutionAlgorithm.kt +0 -21
- package/ReactAndroid/src/main/java/com/facebook/react/LazyReactPackage.java +0 -144
- package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +0 -420
- package/ReactAndroid/src/main/java/com/facebook/react/ReactFragment.java +0 -270
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +0 -421
- package/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.java +0 -269
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaMethodWrapper.java +0 -413
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaScriptModuleRegistry.java +0 -102
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.java +0 -247
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleSpec.java +0 -75
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.java +0 -169
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/PromiseImpl.java +0 -257
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactApplicationContext.java +0 -25
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContextBaseJavaModule.java +0 -44
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactInstanceManagerInspectorTarget.java +0 -75
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarker.java +0 -233
- package/ReactAndroid/src/main/java/com/facebook/react/common/MapBuilder.java +0 -136
- package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/DeprecatedInNewArchitecture.kt +0 -16
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java +0 -410
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.java +0 -474
- package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/JSCExecutor.kt +0 -41
- package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/JSCExecutorFactory.kt +0 -44
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/OkHttpCompat.java +0 -38
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/JSCInstance.kt +0 -24
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +0 -1825
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.java +0 -247
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ThemedReactContext.java +0 -203
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java +0 -235
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java +0 -244
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerRegistry.java +0 -190
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcherImpl.java +0 -372
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.java +0 -417
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +0 -383
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java +0 -235
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributes.java +0 -208
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +0 -968
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +0 -1559
- package/ReactAndroid/src/main/jni/react/jscexecutor/CMakeLists.txt +0 -37
- package/ReactAndroid/src/main/jni/react/jscexecutor/OnLoad.cpp +0 -74
- package/ReactAndroid/src/main/jni/react/jsctooling/CMakeLists.txt +0 -36
- package/ReactAndroid/src/main/jni/react/runtime/jsc/jni/CMakeLists.txt +0 -26
- package/ReactAndroid/src/main/jni/react/runtime/jsc/jni/OnLoad.cpp +0 -48
- package/ReactCommon/React-rncore.podspec +0 -52
- package/ReactCommon/cxxreact/SampleCxxModule.cpp +0 -182
- package/ReactCommon/cxxreact/SampleCxxModule.h +0 -59
- package/ReactCommon/jsc/CMakeLists.txt +0 -34
- package/ReactCommon/jsc/React-jsc.podspec +0 -37
- package/ReactCommon/react/nativemodule/fantomforcedclonecommithook/NativeFantomForcedCloneCommitHook.cpp +0 -84
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboCxxModule.h +0 -18
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboCxxModule.mm +0 -31
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/SampleTurboCxxModuleLegacyImpl.cpp +0 -177
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/SampleTurboCxxModuleLegacyImpl.h +0 -46
- package/ReactCommon/react/renderer/components/rncore/Props.cpp +0 -156
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerClock.h +0 -22
- package/jest/mockModal.js +0 -32
- package/jest/mockScrollView.js +0 -35
- package/scripts/codegen/generate-artifacts-executor/generateRNCoreComponentsIOS.js +0 -38
- package/src/private/specs_DEPRECATED/modules/NativeBugReporting.js +0 -20
- package/types/tsconfig.test.json +0 -16
- package/types/tslint.json +0 -24
|
@@ -0,0 +1,1586 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
@file:Suppress("DEPRECATION")
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.views.view
|
|
11
|
+
|
|
12
|
+
import android.annotation.SuppressLint
|
|
13
|
+
import android.annotation.TargetApi
|
|
14
|
+
import android.content.Context
|
|
15
|
+
import android.graphics.BlendMode
|
|
16
|
+
import android.graphics.Canvas
|
|
17
|
+
import android.graphics.Paint
|
|
18
|
+
import android.graphics.Rect
|
|
19
|
+
import android.graphics.drawable.Drawable
|
|
20
|
+
import android.os.Build
|
|
21
|
+
import android.os.Bundle
|
|
22
|
+
import android.view.FocusFinder
|
|
23
|
+
import android.view.KeyEvent
|
|
24
|
+
import android.view.MotionEvent
|
|
25
|
+
import android.view.View
|
|
26
|
+
import android.view.ViewGroup
|
|
27
|
+
import android.view.ViewParent
|
|
28
|
+
import android.view.ViewStructure
|
|
29
|
+
import android.view.accessibility.AccessibilityNodeInfo
|
|
30
|
+
import android.view.accessibility.AccessibilityManager
|
|
31
|
+
import androidx.core.view.ViewCompat
|
|
32
|
+
import androidx.core.view.isNotEmpty
|
|
33
|
+
import com.facebook.common.logging.FLog
|
|
34
|
+
import com.facebook.react.R
|
|
35
|
+
import com.facebook.react.bridge.ReactContext
|
|
36
|
+
import com.facebook.react.bridge.ReactNoCrashSoftException
|
|
37
|
+
import com.facebook.react.bridge.ReactSoftExceptionLogger
|
|
38
|
+
import com.facebook.react.bridge.ReactSoftExceptionLogger.logSoftException
|
|
39
|
+
import com.facebook.react.bridge.UiThreadUtil.assertOnUiThread
|
|
40
|
+
import com.facebook.react.bridge.UiThreadUtil.runOnUiThread
|
|
41
|
+
import com.facebook.react.common.ReactConstants.TAG
|
|
42
|
+
import com.facebook.react.config.ReactFeatureFlags
|
|
43
|
+
import com.facebook.react.touch.OnInterceptTouchEventListener
|
|
44
|
+
import com.facebook.react.touch.ReactHitSlopView
|
|
45
|
+
import com.facebook.react.touch.ReactInterceptingViewGroup
|
|
46
|
+
import com.facebook.react.uimanager.BackgroundStyleApplicator.clipToPaddingBox
|
|
47
|
+
import com.facebook.react.uimanager.BackgroundStyleApplicator.setBackgroundColor
|
|
48
|
+
import com.facebook.react.uimanager.BackgroundStyleApplicator.setBorderColor
|
|
49
|
+
import com.facebook.react.uimanager.BackgroundStyleApplicator.setBorderRadius
|
|
50
|
+
import com.facebook.react.uimanager.BackgroundStyleApplicator.setBorderStyle
|
|
51
|
+
import com.facebook.react.uimanager.BackgroundStyleApplicator.setBorderWidth
|
|
52
|
+
import com.facebook.react.uimanager.BackgroundStyleApplicator.setFeedbackUnderlay
|
|
53
|
+
import com.facebook.react.uimanager.BlendModeHelper.needsIsolatedLayer
|
|
54
|
+
import com.facebook.react.uimanager.LengthPercentage
|
|
55
|
+
import com.facebook.react.uimanager.LengthPercentageType
|
|
56
|
+
import com.facebook.react.uimanager.MeasureSpecAssertions.assertExplicitMeasureSpec
|
|
57
|
+
import com.facebook.react.uimanager.PixelUtil.toDIPFromPixel
|
|
58
|
+
import com.facebook.react.uimanager.PointerEvents
|
|
59
|
+
import com.facebook.react.uimanager.PointerEvents.Companion.canBeTouchTarget
|
|
60
|
+
import com.facebook.react.uimanager.PointerEvents.Companion.canChildrenBeTouchTarget
|
|
61
|
+
import com.facebook.react.uimanager.ReactAccessibilityDelegate
|
|
62
|
+
import com.facebook.react.uimanager.ReactAxOrderHelper
|
|
63
|
+
import com.facebook.react.uimanager.ReactClippingProhibitedView
|
|
64
|
+
import com.facebook.react.uimanager.ReactClippingViewGroup
|
|
65
|
+
import com.facebook.react.uimanager.ReactClippingViewGroupHelper.calculateClippingRect
|
|
66
|
+
import com.facebook.react.uimanager.ReactOverflowViewWithInset
|
|
67
|
+
import com.facebook.react.uimanager.ReactPointerEventsView
|
|
68
|
+
import com.facebook.react.uimanager.ReactZIndexedViewGroup
|
|
69
|
+
import com.facebook.react.uimanager.UIManagerHelper
|
|
70
|
+
import com.facebook.react.uimanager.ViewGroupDrawingOrderHelper
|
|
71
|
+
import com.facebook.react.uimanager.common.UIManagerType
|
|
72
|
+
import com.facebook.react.uimanager.common.ViewUtil.getUIManagerType
|
|
73
|
+
import com.facebook.react.uimanager.events.BlurEvent
|
|
74
|
+
import com.facebook.react.uimanager.events.EventDispatcher
|
|
75
|
+
import com.facebook.react.uimanager.events.FocusEvent
|
|
76
|
+
import com.facebook.react.uimanager.events.PressInEvent
|
|
77
|
+
import com.facebook.react.uimanager.events.PressOutEvent
|
|
78
|
+
import com.facebook.react.uimanager.style.BorderRadiusProp
|
|
79
|
+
import com.facebook.react.uimanager.style.BorderStyle
|
|
80
|
+
import com.facebook.react.uimanager.style.LogicalEdge
|
|
81
|
+
import com.facebook.react.uimanager.style.Overflow
|
|
82
|
+
import com.facebook.react.views.view.CanvasUtil.enableZ
|
|
83
|
+
import java.lang.ref.WeakReference
|
|
84
|
+
import java.util.ArrayList
|
|
85
|
+
import kotlin.concurrent.Volatile
|
|
86
|
+
import kotlin.math.max
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Backing for a React View. Has support for borders, but since borders aren't common, lazy
|
|
90
|
+
* initializes most of the storage needed for them.
|
|
91
|
+
*
|
|
92
|
+
* @param context A [Context] instance. It's Nullable to not break compatibility with OSS users
|
|
93
|
+
* (could be made non-null in the future but requires proper comms).
|
|
94
|
+
*/
|
|
95
|
+
public open class ReactViewGroup public constructor(context: Context?) :
|
|
96
|
+
ViewGroup(context),
|
|
97
|
+
ReactInterceptingViewGroup,
|
|
98
|
+
ReactClippingViewGroup,
|
|
99
|
+
ReactPointerEventsView,
|
|
100
|
+
ReactHitSlopView,
|
|
101
|
+
ReactZIndexedViewGroup,
|
|
102
|
+
ReactOverflowViewWithInset {
|
|
103
|
+
|
|
104
|
+
public override val overflowInset: Rect = Rect()
|
|
105
|
+
|
|
106
|
+
private var focusDestinations = IntArray(0)
|
|
107
|
+
private var autoFocus = false
|
|
108
|
+
private var isFocusGuideTalkbackAccessibilityDelegateSet = false
|
|
109
|
+
private var lastFocusedElement: WeakReference<View?>? = null
|
|
110
|
+
private var mRecoverFocus = false
|
|
111
|
+
private var originalIsFocusable = false
|
|
112
|
+
private var trapFocusUp = false
|
|
113
|
+
private var trapFocusDown = false
|
|
114
|
+
private var trapFocusLeft = false
|
|
115
|
+
private var trapFocusRight = false
|
|
116
|
+
public var hasTVPreferredFocus: Boolean = false
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* This listener will be set for child views when `removeClippedSubview` property is enabled. When
|
|
120
|
+
* children layout is updated, it will call [updateSubviewClipStatus] to notify parent view about
|
|
121
|
+
* that fact so that view can be attached/detached if necessary.
|
|
122
|
+
*
|
|
123
|
+
* TODO(7728005): Attach/detach views in batch - once per frame in case when multiple children
|
|
124
|
+
* update their layout.
|
|
125
|
+
*/
|
|
126
|
+
public class ChildrenLayoutChangeListener(private var parent: ReactViewGroup?) :
|
|
127
|
+
OnLayoutChangeListener {
|
|
128
|
+
override fun onLayoutChange(
|
|
129
|
+
v: View,
|
|
130
|
+
left: Int,
|
|
131
|
+
top: Int,
|
|
132
|
+
right: Int,
|
|
133
|
+
bottom: Int,
|
|
134
|
+
oldLeft: Int,
|
|
135
|
+
oldTop: Int,
|
|
136
|
+
oldRight: Int,
|
|
137
|
+
oldBottom: Int
|
|
138
|
+
) {
|
|
139
|
+
if (parent?.removeClippedSubviews == true) {
|
|
140
|
+
parent?.updateSubviewClipStatus(v)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
public fun shutdown() {
|
|
145
|
+
parent = null
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
private var recycleCount = 0
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Following properties are here to support the option [removeClippedSubviews]. This is a
|
|
153
|
+
* temporary optimization/hack that is mainly applicable to the large list of images. The way it's
|
|
154
|
+
* implemented is that we store an additional array of children in view node. We selectively
|
|
155
|
+
* remove some of the views (detach) from it while still storing them in that additional array. We
|
|
156
|
+
* override all possible add methods for [ViewGroup] so that we can control this process whenever
|
|
157
|
+
* the option is set. We also override [ViewGroup#getChildAt] and [ViewGroup#getChildCount] so
|
|
158
|
+
* those methods may return views that are not attached. This is risky but allows us to perform a
|
|
159
|
+
* correct cleanup in `NativeViewHierarchyManager`.
|
|
160
|
+
*/
|
|
161
|
+
private var _removeClippedSubviews = false
|
|
162
|
+
|
|
163
|
+
@Volatile private var inSubviewClippingLoop = false
|
|
164
|
+
private var allChildren: Array<View?>? = null
|
|
165
|
+
internal var allChildrenCount: Int = 0
|
|
166
|
+
private set
|
|
167
|
+
|
|
168
|
+
private var clippingRect: Rect? = null
|
|
169
|
+
|
|
170
|
+
public override var hitSlopRect: Rect? = null
|
|
171
|
+
public override var pointerEvents: PointerEvents = PointerEvents.AUTO
|
|
172
|
+
|
|
173
|
+
public var axOrderList: MutableList<String>? = null
|
|
174
|
+
|
|
175
|
+
private var childrenLayoutChangeListener: ChildrenLayoutChangeListener? = null
|
|
176
|
+
private var onInterceptTouchEventListener: OnInterceptTouchEventListener? = null
|
|
177
|
+
private var needsOffscreenAlphaCompositing = false
|
|
178
|
+
private var backfaceOpacity = 0f
|
|
179
|
+
private var backfaceVisible = false
|
|
180
|
+
private var childrenRemovedWhileTransitioning: MutableSet<Int>? = null
|
|
181
|
+
private var accessibilityStateChangeListener:
|
|
182
|
+
AccessibilityManager.AccessibilityStateChangeListener? =
|
|
183
|
+
null
|
|
184
|
+
|
|
185
|
+
init {
|
|
186
|
+
initView()
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Set all default values here as opposed to in the constructor or field defaults. It is important
|
|
191
|
+
* that these properties are set during the constructor, but also on-demand whenever an existing
|
|
192
|
+
* ReactViewGroup is recycled.
|
|
193
|
+
*/
|
|
194
|
+
private fun initView() {
|
|
195
|
+
clipChildren = false
|
|
196
|
+
|
|
197
|
+
_removeClippedSubviews = false
|
|
198
|
+
inSubviewClippingLoop = false
|
|
199
|
+
allChildren = null
|
|
200
|
+
allChildrenCount = 0
|
|
201
|
+
clippingRect = null
|
|
202
|
+
hitSlopRect = null
|
|
203
|
+
_overflow = Overflow.VISIBLE
|
|
204
|
+
pointerEvents = PointerEvents.AUTO
|
|
205
|
+
childrenLayoutChangeListener = null
|
|
206
|
+
onInterceptTouchEventListener = null
|
|
207
|
+
needsOffscreenAlphaCompositing = false
|
|
208
|
+
_drawingOrderHelper = null
|
|
209
|
+
backfaceOpacity = 1f
|
|
210
|
+
backfaceVisible = true
|
|
211
|
+
childrenRemovedWhileTransitioning = null
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
internal open fun recycleView() {
|
|
215
|
+
recycleCount++
|
|
216
|
+
|
|
217
|
+
// Remove dangling listeners
|
|
218
|
+
val allChildren = allChildren
|
|
219
|
+
if (allChildren != null && childrenLayoutChangeListener != null) {
|
|
220
|
+
childrenLayoutChangeListener?.shutdown()
|
|
221
|
+
for (i in 0..<allChildrenCount) {
|
|
222
|
+
allChildren[i]?.removeOnLayoutChangeListener(childrenLayoutChangeListener)
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Set default field values
|
|
227
|
+
initView()
|
|
228
|
+
overflowInset.setEmpty()
|
|
229
|
+
|
|
230
|
+
// Remove any children
|
|
231
|
+
removeAllViews()
|
|
232
|
+
|
|
233
|
+
// If the view is still attached to a parent, we need to remove it from the parent
|
|
234
|
+
// before we can recycle it.
|
|
235
|
+
if (parent != null) {
|
|
236
|
+
(parent as ViewGroup).removeView(this)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Reset background, borders
|
|
240
|
+
updateBackgroundDrawable(null)
|
|
241
|
+
|
|
242
|
+
resetPointerEvents()
|
|
243
|
+
|
|
244
|
+
cleanupFocusGuideTalkbackAccessibilityDelegate()
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
private var _drawingOrderHelper: ViewGroupDrawingOrderHelper? = null
|
|
248
|
+
private val drawingOrderHelper: ViewGroupDrawingOrderHelper
|
|
249
|
+
get() {
|
|
250
|
+
if (_drawingOrderHelper == null) {
|
|
251
|
+
_drawingOrderHelper = ViewGroupDrawingOrderHelper(this)
|
|
252
|
+
}
|
|
253
|
+
return requireNotNull(_drawingOrderHelper)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
|
|
257
|
+
assertExplicitMeasureSpec(widthMeasureSpec, heightMeasureSpec)
|
|
258
|
+
|
|
259
|
+
setMeasuredDimension(
|
|
260
|
+
MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.getSize(heightMeasureSpec))
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
|
|
264
|
+
// No-op since UIManager handles actually laying out children.
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
@SuppressLint("MissingSuperCall")
|
|
268
|
+
override fun requestLayout() {
|
|
269
|
+
// No-op, terminate `requestLayout` here, UIManager handles laying out children and
|
|
270
|
+
// `layout` is called on all RN-managed views by `NativeViewHierarchyManager`
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
@TargetApi(23)
|
|
274
|
+
override fun dispatchProvideStructure(structure: ViewStructure) {
|
|
275
|
+
try {
|
|
276
|
+
super.dispatchProvideStructure(structure)
|
|
277
|
+
} catch (e: NullPointerException) {
|
|
278
|
+
FLog.e(TAG, "NullPointerException when executing dispatchProvideStructure", e)
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
override fun setBackgroundColor(color: Int) {
|
|
283
|
+
setBackgroundColor(this, color)
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
@Deprecated(
|
|
287
|
+
"setTranslucentBackgroundDrawable is deprecated since React Native 0.76.0 and will be removed in a future version")
|
|
288
|
+
public fun setTranslucentBackgroundDrawable(background: Drawable?) {
|
|
289
|
+
setFeedbackUnderlay(this, background)
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
public override fun setOnInterceptTouchEventListener(listener: OnInterceptTouchEventListener) {
|
|
293
|
+
onInterceptTouchEventListener = listener
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
|
|
297
|
+
if (onInterceptTouchEventListener?.onInterceptTouchEvent(this, event) == true) {
|
|
298
|
+
return true
|
|
299
|
+
}
|
|
300
|
+
// We intercept the touch event if the children are not supposed to receive it.
|
|
301
|
+
if (!canChildrenBeTouchTarget(pointerEvents)) {
|
|
302
|
+
return true
|
|
303
|
+
}
|
|
304
|
+
return super.onInterceptTouchEvent(event)
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
override fun onTouchEvent(event: MotionEvent): Boolean {
|
|
308
|
+
// We do not accept the touch event if this view is not supposed to receive it.
|
|
309
|
+
if (!canBeTouchTarget(pointerEvents)) {
|
|
310
|
+
return false
|
|
311
|
+
}
|
|
312
|
+
// The root view always assumes any view that was tapped wants the touch
|
|
313
|
+
// and sends the event to JS as such.
|
|
314
|
+
// We don't need to do bubbling in native (it's already happening in JS).
|
|
315
|
+
// For an explanation of bubbling and capturing, see
|
|
316
|
+
// http://javascript.info/tutorial/bubbling-and-capturing#capturing
|
|
317
|
+
return true
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
override fun onHoverEvent(event: MotionEvent): Boolean {
|
|
321
|
+
@Suppress("DEPRECATION")
|
|
322
|
+
if (ReactFeatureFlags.dispatchPointerEvents) {
|
|
323
|
+
// Match the logic from onTouchEvent if pointer events are enabled
|
|
324
|
+
return canBeTouchTarget(pointerEvents)
|
|
325
|
+
}
|
|
326
|
+
return super.onHoverEvent(event)
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
override fun dispatchGenericMotionEvent(ev: MotionEvent): Boolean {
|
|
330
|
+
// We do not dispatch the motion event if its children are not supposed to receive it
|
|
331
|
+
if (!canChildrenBeTouchTarget(pointerEvents)) {
|
|
332
|
+
return false
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return super.dispatchGenericMotionEvent(ev)
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* We override this to allow developers to determine whether they need offscreen alpha compositing
|
|
340
|
+
* or not. See the documentation of needsOffscreenAlphaCompositing in View.js.
|
|
341
|
+
*/
|
|
342
|
+
override fun hasOverlappingRendering(): Boolean = needsOffscreenAlphaCompositing
|
|
343
|
+
|
|
344
|
+
/** See the documentation of needsOffscreenAlphaCompositing in View.js. */
|
|
345
|
+
public fun setNeedsOffscreenAlphaCompositing(needsOffscreenAlphaCompositing: Boolean) {
|
|
346
|
+
this.needsOffscreenAlphaCompositing = needsOffscreenAlphaCompositing
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
public fun setBorderWidth(position: Int, width: Float) {
|
|
350
|
+
setBorderWidth(this, LogicalEdge.entries[position], toDIPFromPixel(width))
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
public fun setBorderColor(position: Int, color: Int?) {
|
|
354
|
+
setBorderColor(this, LogicalEdge.entries[position], color)
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
@Deprecated(
|
|
358
|
+
message = "setBorderRadius(Float) is deprecated and will be removed in the future.",
|
|
359
|
+
replaceWith = ReplaceWith("setBorderRadius(Float,LengthPercentage)"))
|
|
360
|
+
public fun setBorderRadius(borderRadius: Float) {
|
|
361
|
+
val radius =
|
|
362
|
+
if (borderRadius.isNaN()) null
|
|
363
|
+
else LengthPercentage(borderRadius, LengthPercentageType.POINT)
|
|
364
|
+
setBorderRadius(this, BorderRadiusProp.BORDER_RADIUS, radius)
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
@Deprecated(
|
|
368
|
+
message = "setBorderRadius(Float) is deprecated and will be removed in the future.",
|
|
369
|
+
replaceWith = ReplaceWith("setBorderRadius(Float,LengthPercentage)"))
|
|
370
|
+
public fun setBorderRadius(borderRadius: Float, position: Int) {
|
|
371
|
+
val radius =
|
|
372
|
+
if (borderRadius.isNaN()) null
|
|
373
|
+
else LengthPercentage(borderRadius, LengthPercentageType.POINT)
|
|
374
|
+
setBorderRadius(this, BorderRadiusProp.entries[position], radius)
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
public fun setBorderRadius(property: BorderRadiusProp, borderRadius: LengthPercentage?) {
|
|
378
|
+
setBorderRadius(this, property, borderRadius)
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
public fun setBorderStyle(style: String?) {
|
|
382
|
+
setBorderStyle(this, style?.let { BorderStyle.fromString(it) })
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
override var removeClippedSubviews: Boolean
|
|
386
|
+
get() = _removeClippedSubviews
|
|
387
|
+
set(newValue) {
|
|
388
|
+
if (newValue == _removeClippedSubviews) {
|
|
389
|
+
return
|
|
390
|
+
}
|
|
391
|
+
_removeClippedSubviews = newValue
|
|
392
|
+
childrenRemovedWhileTransitioning = null
|
|
393
|
+
if (newValue) {
|
|
394
|
+
val clippingRect = Rect()
|
|
395
|
+
calculateClippingRect(this, clippingRect)
|
|
396
|
+
this.clippingRect = clippingRect
|
|
397
|
+
|
|
398
|
+
allChildrenCount = childCount
|
|
399
|
+
val allChildren = arrayOfNulls<View?>(max(12, allChildrenCount))
|
|
400
|
+
childrenLayoutChangeListener = ChildrenLayoutChangeListener(this)
|
|
401
|
+
for (i in 0..<allChildrenCount) {
|
|
402
|
+
val child = getChildAt(i)
|
|
403
|
+
allChildren[i] = child
|
|
404
|
+
child.addOnLayoutChangeListener(childrenLayoutChangeListener)
|
|
405
|
+
setViewClipped(child, false)
|
|
406
|
+
}
|
|
407
|
+
this.allChildren = allChildren
|
|
408
|
+
updateClippingRect()
|
|
409
|
+
} else {
|
|
410
|
+
// Add all clipped views back, deallocate additional arrays, remove layoutChangeListener
|
|
411
|
+
val childArray = checkNotNull(allChildren)
|
|
412
|
+
checkNotNull(childrenLayoutChangeListener)
|
|
413
|
+
for (i in 0..<allChildrenCount) {
|
|
414
|
+
childArray[i]?.removeOnLayoutChangeListener(childrenLayoutChangeListener)
|
|
415
|
+
}
|
|
416
|
+
val clippingRect = checkNotNull(clippingRect)
|
|
417
|
+
getDrawingRect(clippingRect)
|
|
418
|
+
updateClippingToRect(clippingRect)
|
|
419
|
+
this.allChildren = null
|
|
420
|
+
this.clippingRect = null
|
|
421
|
+
allChildrenCount = 0
|
|
422
|
+
childrenLayoutChangeListener = null
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
override fun getClippingRect(outClippingRect: Rect) {
|
|
427
|
+
outClippingRect.set(checkNotNull(clippingRect))
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
override fun updateClippingRect() {
|
|
431
|
+
updateClippingRect(null)
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
override fun updateClippingRect(excludedViews: Set<Int>?) {
|
|
435
|
+
if (!_removeClippedSubviews) {
|
|
436
|
+
return
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
val clippingRect = checkNotNull(clippingRect)
|
|
440
|
+
calculateClippingRect(this, clippingRect)
|
|
441
|
+
updateClippingToRect(clippingRect, excludedViews)
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
override fun endViewTransition(view: View) {
|
|
445
|
+
super.endViewTransition(view)
|
|
446
|
+
childrenRemovedWhileTransitioning?.remove(view.id)
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
private fun trackChildViewTransition(childId: Int) {
|
|
450
|
+
if (childrenRemovedWhileTransitioning == null) {
|
|
451
|
+
childrenRemovedWhileTransitioning = mutableSetOf()
|
|
452
|
+
}
|
|
453
|
+
childrenRemovedWhileTransitioning?.add(childId)
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
private fun isChildRemovedWhileTransitioning(child: View): Boolean =
|
|
457
|
+
childrenRemovedWhileTransitioning?.contains(child.id) == true
|
|
458
|
+
|
|
459
|
+
private fun updateClippingToRect(clippingRect: Rect, excludedViewsSet: Set<Int>? = null) {
|
|
460
|
+
val childArray = checkNotNull(allChildren)
|
|
461
|
+
inSubviewClippingLoop = true
|
|
462
|
+
var clippedSoFar = 0
|
|
463
|
+
for (i in 0..<allChildrenCount) {
|
|
464
|
+
try {
|
|
465
|
+
updateSubviewClipStatus(clippingRect, i, clippedSoFar, excludedViewsSet)
|
|
466
|
+
} catch (ex: IndexOutOfBoundsException) {
|
|
467
|
+
var realClippedSoFar = 0
|
|
468
|
+
val uniqueViews: MutableSet<View?> = HashSet()
|
|
469
|
+
var j = 0
|
|
470
|
+
while (j < i) {
|
|
471
|
+
realClippedSoFar += if (isViewClipped(childArray[j], j)) 1 else 0
|
|
472
|
+
uniqueViews.add(childArray[j])
|
|
473
|
+
j++
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
throw IllegalStateException(
|
|
477
|
+
"Invalid clipping state. i=$i clippedSoFar=$clippedSoFar count=$childCount allChildrenCount=$allChildrenCount recycleCount=$recycleCount realClippedSoFar=$realClippedSoFar uniqueViewsCount=${uniqueViews.size} excludedViews=${excludedViewsSet?.size ?: 0}",
|
|
478
|
+
ex)
|
|
479
|
+
}
|
|
480
|
+
if (isViewClipped(childArray[i], i)) {
|
|
481
|
+
clippedSoFar++
|
|
482
|
+
}
|
|
483
|
+
if (i - clippedSoFar > childCount) {
|
|
484
|
+
throw IllegalStateException(
|
|
485
|
+
"Invalid clipping state. i=$i clippedSoFar=$clippedSoFar count=$childCount allChildrenCount=$allChildrenCount recycleCount=$recycleCount excludedViews=${excludedViewsSet?.size ?: 0}")
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
inSubviewClippingLoop = false
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
private fun updateSubviewClipStatus(
|
|
492
|
+
clippingRect: Rect,
|
|
493
|
+
idx: Int,
|
|
494
|
+
clippedSoFar: Int,
|
|
495
|
+
excludedViewsSet: Set<Int>? = null
|
|
496
|
+
) {
|
|
497
|
+
assertOnUiThread()
|
|
498
|
+
|
|
499
|
+
val child = checkNotNull(allChildren?.get(idx))
|
|
500
|
+
val intersects = clippingRect.intersects(child.left, child.top, child.right, child.bottom)
|
|
501
|
+
var needUpdateClippingRecursive = false
|
|
502
|
+
|
|
503
|
+
// We never want to clip children that are being animated, as this can easily break layout :
|
|
504
|
+
// when layout animation changes size and/or position of views contained inside a listview that
|
|
505
|
+
// clips offscreen children, we need to ensure that, when view exits the viewport, final size
|
|
506
|
+
// and position is set prior to removing the view from its listview parent.
|
|
507
|
+
// Otherwise, when view gets re-attached again, i.e when it re-enters the viewport after scroll,
|
|
508
|
+
// it won't be size and located properly.
|
|
509
|
+
val isAnimating = child.animation?.hasEnded() == false
|
|
510
|
+
|
|
511
|
+
val shouldSkipView = excludedViewsSet?.contains(child.id) == true
|
|
512
|
+
if (excludedViewsSet != null) {
|
|
513
|
+
needUpdateClippingRecursive = true
|
|
514
|
+
}
|
|
515
|
+
// We don't want to clip a view that is currently focused at that might break focus navigation
|
|
516
|
+
if (!intersects &&
|
|
517
|
+
!isViewClipped(child, idx) &&
|
|
518
|
+
!isAnimating &&
|
|
519
|
+
child !== focusedChild &&
|
|
520
|
+
!shouldSkipView) {
|
|
521
|
+
setViewClipped(child, true)
|
|
522
|
+
recoverFocus(child)
|
|
523
|
+
// We can try saving on invalidate call here as the view that we remove is out of visible area
|
|
524
|
+
// therefore invalidation is not necessary.
|
|
525
|
+
removeViewInLayout(child)
|
|
526
|
+
needUpdateClippingRecursive = true
|
|
527
|
+
} else if ((shouldSkipView || intersects) && isViewClipped(child, idx)) {
|
|
528
|
+
val adjustedIdx = idx - clippedSoFar
|
|
529
|
+
check(adjustedIdx >= 0)
|
|
530
|
+
setViewClipped(child, false)
|
|
531
|
+
addViewInLayout(child, adjustedIdx, defaultLayoutParam, true)
|
|
532
|
+
invalidate()
|
|
533
|
+
needUpdateClippingRecursive = true
|
|
534
|
+
} else if (intersects) {
|
|
535
|
+
// If there is any intersection we need to inform the child to update its clipping rect
|
|
536
|
+
needUpdateClippingRecursive = true
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
if (needUpdateClippingRecursive) {
|
|
540
|
+
if ((child as? ReactClippingViewGroup)?.removeClippedSubviews == true) {
|
|
541
|
+
child.updateClippingRect(excludedViewsSet)
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
public fun updateSubviewClipStatus(subview: View) {
|
|
547
|
+
if (!_removeClippedSubviews || parent == null) {
|
|
548
|
+
return
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
val clippingRect = checkNotNull(clippingRect)
|
|
552
|
+
val allChildren = checkNotNull(allChildren)
|
|
553
|
+
|
|
554
|
+
// do fast check whether intersect state changed
|
|
555
|
+
val intersects =
|
|
556
|
+
clippingRect.intersects(subview.left, subview.top, subview.right, subview.bottom)
|
|
557
|
+
|
|
558
|
+
// If it was intersecting before, should be attached to the parent
|
|
559
|
+
val oldIntersects = !isViewClipped(subview, null)
|
|
560
|
+
|
|
561
|
+
if (intersects != oldIntersects) {
|
|
562
|
+
inSubviewClippingLoop = true
|
|
563
|
+
var clippedSoFar = 0
|
|
564
|
+
for (i in 0..<allChildrenCount) {
|
|
565
|
+
if (allChildren[i] === subview) {
|
|
566
|
+
updateSubviewClipStatus(clippingRect, i, clippedSoFar)
|
|
567
|
+
break
|
|
568
|
+
}
|
|
569
|
+
if (isViewClipped(allChildren[i], i)) {
|
|
570
|
+
clippedSoFar++
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
inSubviewClippingLoop = false
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
private fun getFirstFocusableView(viewGroup: ReactViewGroup): View? {
|
|
578
|
+
val focusables = ArrayList<View>(0)
|
|
579
|
+
/**
|
|
580
|
+
* `addFocusables` is the method used by `FocusFinder` to determine
|
|
581
|
+
* which elements are `focusable` within the given view.
|
|
582
|
+
* Here we use it for the exact purpose. It mutates/populates the `focusables` array list.
|
|
583
|
+
* Focus direction (FOCUS_DOWN) doesn't matter at all because
|
|
584
|
+
* it's not being used by the underlying implementation.
|
|
585
|
+
*
|
|
586
|
+
* Here we intentionally call `super` method to bypass `ReactViewGroup`'s
|
|
587
|
+
* overriden `addFocusables` logic.
|
|
588
|
+
*/
|
|
589
|
+
super.addFocusables(focusables, FOCUS_DOWN, FOCUSABLES_ALL)
|
|
590
|
+
/**
|
|
591
|
+
* Depending on ViewGroup's `descendantFocusability` property,
|
|
592
|
+
* the first element can be the ViewGroup itself.
|
|
593
|
+
* The other ones on the list can be non-focusable as well.
|
|
594
|
+
* So, we run a loop till finding the first real focusable element.
|
|
595
|
+
*/
|
|
596
|
+
if (focusables.size <= 0) return null
|
|
597
|
+
|
|
598
|
+
var firstFocusableElement: View? = null
|
|
599
|
+
var index = 0
|
|
600
|
+
while (index < focusables.size) {
|
|
601
|
+
val elem = focusables[index]
|
|
602
|
+
if (elem !== viewGroup) {
|
|
603
|
+
firstFocusableElement = elem
|
|
604
|
+
break
|
|
605
|
+
}
|
|
606
|
+
index++
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
return firstFocusableElement!!
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
private fun moveFocusToFirstFocusable(viewGroup: ReactViewGroup): Boolean {
|
|
613
|
+
val firstFocusableElement = this.getFirstFocusableView(viewGroup)
|
|
614
|
+
|
|
615
|
+
if (firstFocusableElement != null) return firstFocusableElement.requestFocus()
|
|
616
|
+
|
|
617
|
+
return false
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
private fun recoverFocus(view: View) {
|
|
621
|
+
if (!view.hasFocus() || view !is ReactViewGroup) return
|
|
622
|
+
|
|
623
|
+
val parentFocusGuide = findParentFocusGuide(view) ?: return
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Making `parentFocusGuide` focusable for a brief time to
|
|
627
|
+
* temporarily move the focus to it. We do this to prevent
|
|
628
|
+
* Android from moving the focus to top-left-most element of the screen.
|
|
629
|
+
*/
|
|
630
|
+
parentFocusGuide.mRecoverFocus = true
|
|
631
|
+
parentFocusGuide.isFocusable = true
|
|
632
|
+
parentFocusGuide.requestFocus()
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* We set a Runnable to wait and make sure every layout related action gets completed
|
|
636
|
+
* before trying to find a new focus candidate inside the `parentFocusGuide`.
|
|
637
|
+
*/
|
|
638
|
+
runOnUiThread(
|
|
639
|
+
Runnable {
|
|
640
|
+
/**
|
|
641
|
+
* Focus can move to an another element while waiting for the next frame.
|
|
642
|
+
* E.g: An element with `hasTVPreferredFocus` can appear.
|
|
643
|
+
*
|
|
644
|
+
* We check here to make sure `parentFocusGuide` still remains the focus
|
|
645
|
+
* before recovering the focus to make sure we don't accidentally override it.
|
|
646
|
+
*/
|
|
647
|
+
/**
|
|
648
|
+
* Focus can move to an another element while waiting for the next frame.
|
|
649
|
+
* E.g: An element with `hasTVPreferredFocus` can appear.
|
|
650
|
+
*
|
|
651
|
+
* We check here to make sure `parentFocusGuide` still remains the focus
|
|
652
|
+
* before recovering the focus to make sure we don't accidentally override it.
|
|
653
|
+
*//**
|
|
654
|
+
* Focus can move to an another element while waiting for the next frame.
|
|
655
|
+
* E.g: An element with `hasTVPreferredFocus` can appear.
|
|
656
|
+
*
|
|
657
|
+
* We check here to make sure `parentFocusGuide` still remains the focus
|
|
658
|
+
* before recovering the focus to make sure we don't accidentally override it.
|
|
659
|
+
*/
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Focus can move to an another element while waiting for the next frame.
|
|
663
|
+
* E.g: An element with `hasTVPreferredFocus` can appear.
|
|
664
|
+
*
|
|
665
|
+
* We check here to make sure `parentFocusGuide` still remains the focus
|
|
666
|
+
* before recovering the focus to make sure we don't accidentally override it.
|
|
667
|
+
*/
|
|
668
|
+
/**
|
|
669
|
+
* Focus can move to an another element while waiting for the next frame.
|
|
670
|
+
* E.g: An element with `hasTVPreferredFocus` can appear.
|
|
671
|
+
*
|
|
672
|
+
* We check here to make sure `parentFocusGuide` still remains the focus
|
|
673
|
+
* before recovering the focus to make sure we don't accidentally override it.
|
|
674
|
+
*/
|
|
675
|
+
/**
|
|
676
|
+
* Focus can move to an another element while waiting for the next frame.
|
|
677
|
+
* E.g: An element with `hasTVPreferredFocus` can appear.
|
|
678
|
+
*
|
|
679
|
+
* We check here to make sure `parentFocusGuide` still remains the focus
|
|
680
|
+
* before recovering the focus to make sure we don't accidentally override it.
|
|
681
|
+
*/
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Focus can move to an another element while waiting for the next frame.
|
|
685
|
+
* E.g: An element with `hasTVPreferredFocus` can appear.
|
|
686
|
+
*
|
|
687
|
+
* We check here to make sure `parentFocusGuide` still remains the focus
|
|
688
|
+
* before recovering the focus to make sure we don't accidentally override it.
|
|
689
|
+
*/
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* Focus can move to an another element while waiting for the next frame.
|
|
693
|
+
* E.g: An element with `hasTVPreferredFocus` can appear.
|
|
694
|
+
*
|
|
695
|
+
* We check here to make sure `parentFocusGuide` still remains the focus
|
|
696
|
+
* before recovering the focus to make sure we don't accidentally override it.
|
|
697
|
+
*/
|
|
698
|
+
if (parentFocusGuide.isFocused) {
|
|
699
|
+
moveFocusToFirstFocusable(parentFocusGuide)
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
parentFocusGuide.isFocusable = false
|
|
703
|
+
parentFocusGuide.mRecoverFocus = false
|
|
704
|
+
})
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
|
708
|
+
super.onSizeChanged(w, h, oldw, oldh)
|
|
709
|
+
if (_removeClippedSubviews) {
|
|
710
|
+
updateClippingRect()
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
override fun onAttachedToWindow() {
|
|
715
|
+
super.onAttachedToWindow()
|
|
716
|
+
if (_removeClippedSubviews) {
|
|
717
|
+
updateClippingRect()
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
private fun customDrawOrderDisabled(): Boolean {
|
|
722
|
+
if (id == NO_ID) {
|
|
723
|
+
return false
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// Custom draw order is disabled for Fabric.
|
|
727
|
+
return getUIManagerType(id) == UIManagerType.FABRIC
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
override fun onViewAdded(child: View) {
|
|
731
|
+
assertOnUiThread()
|
|
732
|
+
checkViewClippingTag(child, false)
|
|
733
|
+
if (!customDrawOrderDisabled()) {
|
|
734
|
+
drawingOrderHelper.handleAddView(child)
|
|
735
|
+
isChildrenDrawingOrderEnabled = drawingOrderHelper.shouldEnableCustomDrawingOrder()
|
|
736
|
+
} else {
|
|
737
|
+
isChildrenDrawingOrderEnabled = false
|
|
738
|
+
}
|
|
739
|
+
super.onViewAdded(child)
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
override fun onViewRemoved(child: View) {
|
|
743
|
+
assertOnUiThread()
|
|
744
|
+
checkViewClippingTag(child, true)
|
|
745
|
+
if (!customDrawOrderDisabled()) {
|
|
746
|
+
drawingOrderHelper.handleRemoveView(child)
|
|
747
|
+
isChildrenDrawingOrderEnabled = drawingOrderHelper.shouldEnableCustomDrawingOrder()
|
|
748
|
+
} else {
|
|
749
|
+
isChildrenDrawingOrderEnabled = false
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
// The parent might not be null in case the child is transitioning.
|
|
753
|
+
if (child.parent != null) {
|
|
754
|
+
trackChildViewTransition(child.id)
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
super.onViewRemoved(child)
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
private fun checkViewClippingTag(child: View, expectedTag: Boolean) {
|
|
761
|
+
if (inSubviewClippingLoop) {
|
|
762
|
+
val tag = child.getTag(R.id.view_clipped)
|
|
763
|
+
if (expectedTag != tag) {
|
|
764
|
+
logSoftException(
|
|
765
|
+
ReactSoftExceptionLogger.Categories.RVG_ON_VIEW_REMOVED,
|
|
766
|
+
ReactNoCrashSoftException("View clipping tag mismatch: tag=$tag expected=$expectedTag"))
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
if (_removeClippedSubviews) {
|
|
770
|
+
child.setTag(R.id.view_clipped, expectedTag)
|
|
771
|
+
} else {
|
|
772
|
+
child.setTag(R.id.view_clipped, null)
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
override fun getChildDrawingOrder(childCount: Int, index: Int): Int {
|
|
777
|
+
assertOnUiThread()
|
|
778
|
+
|
|
779
|
+
return if (!customDrawOrderDisabled()) {
|
|
780
|
+
drawingOrderHelper.getChildDrawingOrder(childCount, index)
|
|
781
|
+
} else {
|
|
782
|
+
index
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
override fun getZIndexMappedChildIndex(index: Int): Int {
|
|
787
|
+
assertOnUiThread()
|
|
788
|
+
|
|
789
|
+
if (!customDrawOrderDisabled() && drawingOrderHelper.shouldEnableCustomDrawingOrder()) {
|
|
790
|
+
return drawingOrderHelper.getChildDrawingOrder(childCount, index)
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
// Fabric behavior
|
|
794
|
+
return index
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
override fun updateDrawingOrder() {
|
|
798
|
+
if (customDrawOrderDisabled()) {
|
|
799
|
+
return
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
drawingOrderHelper.update()
|
|
803
|
+
isChildrenDrawingOrderEnabled = drawingOrderHelper.shouldEnableCustomDrawingOrder()
|
|
804
|
+
invalidate()
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
override fun dispatchSetPressed(pressed: Boolean) {
|
|
808
|
+
// Prevents the ViewGroup from dispatching the pressed state
|
|
809
|
+
// to it's children.
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
private fun resetPointerEvents() {
|
|
813
|
+
pointerEvents = PointerEvents.AUTO
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
internal fun getChildAtWithSubviewClippingEnabled(index: Int): View? =
|
|
817
|
+
if (index in 0..<allChildrenCount) checkNotNull(allChildren)[index] else null
|
|
818
|
+
|
|
819
|
+
internal fun addViewWithSubviewClippingEnabled(
|
|
820
|
+
child: View,
|
|
821
|
+
index: Int,
|
|
822
|
+
) {
|
|
823
|
+
check(_removeClippedSubviews)
|
|
824
|
+
setViewClipped(child, true) // the view has not been added, so it is "clipped"
|
|
825
|
+
addInArray(child, index)
|
|
826
|
+
|
|
827
|
+
// we add view as "clipped" and then run {@link #updateSubviewClipStatus} to conditionally
|
|
828
|
+
// attach it
|
|
829
|
+
val clippingRect = checkNotNull(clippingRect)
|
|
830
|
+
val allChildren = checkNotNull(allChildren)
|
|
831
|
+
inSubviewClippingLoop = true
|
|
832
|
+
var clippedSoFar = 0
|
|
833
|
+
for (i in 0..<index) {
|
|
834
|
+
if (isViewClipped(allChildren[i], i)) {
|
|
835
|
+
clippedSoFar++
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
updateSubviewClipStatus(clippingRect, index, clippedSoFar)
|
|
839
|
+
inSubviewClippingLoop = false
|
|
840
|
+
child.addOnLayoutChangeListener(childrenLayoutChangeListener)
|
|
841
|
+
|
|
842
|
+
if (child is ReactClippingProhibitedView) {
|
|
843
|
+
runOnUiThread(
|
|
844
|
+
object : Runnable {
|
|
845
|
+
override fun run() {
|
|
846
|
+
if (!child.isShown) {
|
|
847
|
+
logSoftException(
|
|
848
|
+
ReactSoftExceptionLogger.Categories.CLIPPING_PROHIBITED_VIEW,
|
|
849
|
+
ReactNoCrashSoftException(
|
|
850
|
+
"Child view has been added to Parent view in which it is clipped and not visible. This is not legal for this particular child view. Child: [${child.id}] $child Parent: [$id] ${toString()}"))
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
})
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
internal fun removeViewWithSubviewClippingEnabled(view: View) {
|
|
858
|
+
assertOnUiThread()
|
|
859
|
+
|
|
860
|
+
check(_removeClippedSubviews)
|
|
861
|
+
val allChildren = checkNotNull(allChildren)
|
|
862
|
+
view.removeOnLayoutChangeListener(childrenLayoutChangeListener)
|
|
863
|
+
val index = indexOfChildInAllChildren(view)
|
|
864
|
+
if (!isViewClipped(allChildren[index], index)) {
|
|
865
|
+
var clippedSoFar = 0
|
|
866
|
+
for (i in 0..<index) {
|
|
867
|
+
if (isViewClipped(allChildren[i], i)) {
|
|
868
|
+
clippedSoFar++
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
removeViewsInLayout(index - clippedSoFar, 1)
|
|
872
|
+
invalidate()
|
|
873
|
+
}
|
|
874
|
+
removeFromArray(index)
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
internal fun removeAllViewsWithSubviewClippingEnabled() {
|
|
878
|
+
check(_removeClippedSubviews)
|
|
879
|
+
val allChildren = checkNotNull(allChildren)
|
|
880
|
+
for (i in 0..<allChildrenCount) {
|
|
881
|
+
allChildren[i]?.removeOnLayoutChangeListener(childrenLayoutChangeListener)
|
|
882
|
+
}
|
|
883
|
+
removeAllViewsInLayout()
|
|
884
|
+
allChildrenCount = 0
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* @param index For logging - index of the view in `allChildren`, or `null` to skip logging.
|
|
889
|
+
* @return `true` if the view has been removed from the ViewGroup.
|
|
890
|
+
*/
|
|
891
|
+
private fun isViewClipped(view: View?, index: Int?): Boolean {
|
|
892
|
+
val view = checkNotNull(view)
|
|
893
|
+
val tag = view.getTag(R.id.view_clipped)
|
|
894
|
+
if (tag != null) {
|
|
895
|
+
return tag as Boolean
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
val parent = view.parent
|
|
899
|
+
val transitioning = isChildRemovedWhileTransitioning(view)
|
|
900
|
+
if (index != null) {
|
|
901
|
+
logSoftException(
|
|
902
|
+
ReactSoftExceptionLogger.Categories.RVG_IS_VIEW_CLIPPED,
|
|
903
|
+
ReactNoCrashSoftException(
|
|
904
|
+
"View missing clipping tag: index=$index parentNull=${parent == null} parentThis=${parent === this} transitioning=$transitioning"))
|
|
905
|
+
}
|
|
906
|
+
// fallback - should be transitioning or have no parent if the view was removed
|
|
907
|
+
if (parent == null || transitioning) {
|
|
908
|
+
return true
|
|
909
|
+
} else {
|
|
910
|
+
check(parent === this)
|
|
911
|
+
return false
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
private fun indexOfChildInAllChildren(child: View): Int {
|
|
916
|
+
val count = allChildrenCount
|
|
917
|
+
val childArray = checkNotNull(allChildren)
|
|
918
|
+
for (i in 0..<count) {
|
|
919
|
+
if (childArray[i] === child) {
|
|
920
|
+
return i
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
return -1
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
private fun addInArray(child: View, index: Int) {
|
|
927
|
+
var childArray = checkNotNull(allChildren)
|
|
928
|
+
val count = allChildrenCount
|
|
929
|
+
val size = childArray.size
|
|
930
|
+
if (index == count) {
|
|
931
|
+
if (size == count) {
|
|
932
|
+
val allChildren = arrayOfNulls<View?>(size + ARRAY_CAPACITY_INCREMENT)
|
|
933
|
+
System.arraycopy(childArray, 0, allChildren, 0, size)
|
|
934
|
+
childArray = allChildren
|
|
935
|
+
this.allChildren = childArray
|
|
936
|
+
}
|
|
937
|
+
childArray[allChildrenCount++] = child
|
|
938
|
+
} else if (index < count) {
|
|
939
|
+
if (size == count) {
|
|
940
|
+
val allChildren = arrayOfNulls<View?>(size + ARRAY_CAPACITY_INCREMENT)
|
|
941
|
+
System.arraycopy(childArray, 0, allChildren, 0, index)
|
|
942
|
+
System.arraycopy(childArray, index, allChildren, index + 1, count - index)
|
|
943
|
+
childArray = allChildren
|
|
944
|
+
this.allChildren = childArray
|
|
945
|
+
} else {
|
|
946
|
+
System.arraycopy(childArray, index, childArray, index + 1, count - index)
|
|
947
|
+
}
|
|
948
|
+
childArray[index] = child
|
|
949
|
+
allChildrenCount++
|
|
950
|
+
} else {
|
|
951
|
+
throw IndexOutOfBoundsException("index=$index count=$count")
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
private fun removeFromArray(index: Int) {
|
|
956
|
+
val childArray = checkNotNull(allChildren)
|
|
957
|
+
val count = allChildrenCount
|
|
958
|
+
when (index) {
|
|
959
|
+
count - 1 -> childArray[--allChildrenCount] = null
|
|
960
|
+
in 0..<count -> {
|
|
961
|
+
System.arraycopy(childArray, index + 1, childArray, index, count - index - 1)
|
|
962
|
+
childArray[--allChildrenCount] = null
|
|
963
|
+
}
|
|
964
|
+
else -> throw IndexOutOfBoundsException()
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
private var _overflow: Overflow? = null
|
|
969
|
+
override var overflow: String?
|
|
970
|
+
get() =
|
|
971
|
+
when (_overflow) {
|
|
972
|
+
Overflow.HIDDEN -> "hidden"
|
|
973
|
+
Overflow.SCROLL -> "scroll"
|
|
974
|
+
Overflow.VISIBLE -> "visible"
|
|
975
|
+
else -> null
|
|
976
|
+
}
|
|
977
|
+
set(overflow) {
|
|
978
|
+
_overflow =
|
|
979
|
+
if (overflow == null) {
|
|
980
|
+
Overflow.VISIBLE
|
|
981
|
+
} else {
|
|
982
|
+
Overflow.fromString(overflow)
|
|
983
|
+
}
|
|
984
|
+
invalidate()
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
override fun setOverflowInset(left: Int, top: Int, right: Int, bottom: Int) {
|
|
988
|
+
if (needsIsolatedLayer(this) &&
|
|
989
|
+
(overflowInset.left != left ||
|
|
990
|
+
overflowInset.top != top ||
|
|
991
|
+
overflowInset.right != right ||
|
|
992
|
+
overflowInset.bottom != bottom)) {
|
|
993
|
+
invalidate()
|
|
994
|
+
}
|
|
995
|
+
overflowInset[left, top, right] = bottom
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
/**
|
|
999
|
+
* Set the background for the view or remove the background. It calls [setBackground].
|
|
1000
|
+
*
|
|
1001
|
+
* @param drawable The [Drawable] to use as the background, or null to remove the background
|
|
1002
|
+
*/
|
|
1003
|
+
private fun updateBackgroundDrawable(drawable: Drawable?) {
|
|
1004
|
+
super.setBackground(drawable)
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
override fun draw(canvas: Canvas) {
|
|
1008
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q &&
|
|
1009
|
+
getUIManagerType(this) == UIManagerType.FABRIC &&
|
|
1010
|
+
needsIsolatedLayer(this)) {
|
|
1011
|
+
// Check if the view is a stacking context and has children, if it does, do the rendering
|
|
1012
|
+
// offscreen and then composite back. This follows the idea of group isolation on blending
|
|
1013
|
+
// https://www.w3.org/TR/compositing-1/#isolationblending
|
|
1014
|
+
|
|
1015
|
+
val overflowInset = overflowInset
|
|
1016
|
+
canvas.saveLayer(
|
|
1017
|
+
overflowInset.left.toFloat(),
|
|
1018
|
+
overflowInset.top.toFloat(),
|
|
1019
|
+
(width + -overflowInset.right).toFloat(),
|
|
1020
|
+
(height + -overflowInset.bottom).toFloat(),
|
|
1021
|
+
null)
|
|
1022
|
+
super.draw(canvas)
|
|
1023
|
+
canvas.restore()
|
|
1024
|
+
} else {
|
|
1025
|
+
super.draw(canvas)
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
override fun dispatchDraw(canvas: Canvas) {
|
|
1030
|
+
if (_overflow != Overflow.VISIBLE || getTag(R.id.filter) != null) {
|
|
1031
|
+
clipToPaddingBox(this, canvas)
|
|
1032
|
+
}
|
|
1033
|
+
super.dispatchDraw(canvas)
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
override fun drawChild(canvas: Canvas, child: View, drawingTime: Long): Boolean {
|
|
1037
|
+
val drawWithZ = child.elevation > 0
|
|
1038
|
+
|
|
1039
|
+
if (drawWithZ) {
|
|
1040
|
+
enableZ(canvas, true)
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
var mixBlendMode: BlendMode? = null
|
|
1044
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q &&
|
|
1045
|
+
getUIManagerType(this) == UIManagerType.FABRIC &&
|
|
1046
|
+
needsIsolatedLayer(this)) {
|
|
1047
|
+
mixBlendMode = child.getTag(R.id.mix_blend_mode) as? BlendMode
|
|
1048
|
+
if (mixBlendMode != null) {
|
|
1049
|
+
val p = Paint()
|
|
1050
|
+
p.blendMode = mixBlendMode
|
|
1051
|
+
val overflowInset = overflowInset
|
|
1052
|
+
canvas.saveLayer(
|
|
1053
|
+
overflowInset.left.toFloat(),
|
|
1054
|
+
overflowInset.top.toFloat(),
|
|
1055
|
+
(width + -overflowInset.right).toFloat(),
|
|
1056
|
+
(height + -overflowInset.bottom).toFloat(),
|
|
1057
|
+
p)
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
val result = super.drawChild(canvas, child, drawingTime)
|
|
1062
|
+
|
|
1063
|
+
if (mixBlendMode != null) {
|
|
1064
|
+
canvas.restore()
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
if (drawWithZ) {
|
|
1068
|
+
enableZ(canvas, false)
|
|
1069
|
+
}
|
|
1070
|
+
return result
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
public fun setOpacityIfPossible(opacity: Float) {
|
|
1074
|
+
backfaceOpacity = opacity
|
|
1075
|
+
setBackfaceVisibilityDependantOpacity()
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
public fun setBackfaceVisibility(backfaceVisibility: String) {
|
|
1079
|
+
backfaceVisible = "visible" == backfaceVisibility
|
|
1080
|
+
setBackfaceVisibilityDependantOpacity()
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
public fun setBackfaceVisibilityDependantOpacity() {
|
|
1084
|
+
if (backfaceVisible) {
|
|
1085
|
+
alpha = backfaceOpacity
|
|
1086
|
+
return
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
val rotationX = rotationX
|
|
1090
|
+
val rotationY = rotationY
|
|
1091
|
+
|
|
1092
|
+
val isFrontfaceVisible =
|
|
1093
|
+
(rotationX >= -90f && rotationX < 90f) && (rotationY >= -90f && rotationY < 90f)
|
|
1094
|
+
|
|
1095
|
+
if (isFrontfaceVisible) {
|
|
1096
|
+
alpha = backfaceOpacity
|
|
1097
|
+
return
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
alpha = 0f
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
public fun initializeFocusGuideTalkbackAccessibilityDelegate() {
|
|
1104
|
+
if (!this.isTVFocusGuide) {
|
|
1105
|
+
return
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
this.originalIsFocusable = this.isFocusable
|
|
1109
|
+
|
|
1110
|
+
val viewAccessibilityDelegate: ReactAccessibilityDelegate = object : ReactAccessibilityDelegate(
|
|
1111
|
+
this, originalIsFocusable, this.importantForAccessibility
|
|
1112
|
+
) {
|
|
1113
|
+
override fun performAccessibilityAction(host: View, action: Int, args: Bundle?): Boolean {
|
|
1114
|
+
if (host !is ReactViewGroup) {
|
|
1115
|
+
return super.performAccessibilityAction(host, action, args)
|
|
1116
|
+
}
|
|
1117
|
+
if (action == AccessibilityNodeInfo.ACTION_FOCUS) {
|
|
1118
|
+
if (args?.let { host.interceptAccessibilityEvents(action, it) } == true) {
|
|
1119
|
+
return true
|
|
1120
|
+
}
|
|
1121
|
+
// Handle case when focus guide cannot find any focusable child
|
|
1122
|
+
if (host.isTVFocusGuide && host.getFirstFocusableView(host) == null) {
|
|
1123
|
+
if (host.isNotEmpty()) {
|
|
1124
|
+
val child = host.getChildAt(0)
|
|
1125
|
+
val childFocusables = ArrayList<View>(0)
|
|
1126
|
+
child.addFocusables(childFocusables, FOCUS_DOWN, 0)
|
|
1127
|
+
if (childFocusables.isNotEmpty()) {
|
|
1128
|
+
childFocusables[0].performAccessibilityAction(action, args)
|
|
1129
|
+
return true
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
return super.performAccessibilityAction(host, action, args)
|
|
1134
|
+
}
|
|
1135
|
+
if (action == AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS) {
|
|
1136
|
+
if (args?.let { host.interceptAccessibilityEvents(action, it) } == true) {
|
|
1137
|
+
return true
|
|
1138
|
+
}
|
|
1139
|
+
// Handle case when focus guide cannot find any focusable child
|
|
1140
|
+
if (host.isTVFocusGuide && host.getFirstFocusableView(host) == null) {
|
|
1141
|
+
if (host.isNotEmpty()) {
|
|
1142
|
+
val child = host.getChildAt(0)
|
|
1143
|
+
val childFocusables = ArrayList<View>(0)
|
|
1144
|
+
child.addFocusables(childFocusables, FOCUS_DOWN, 0)
|
|
1145
|
+
if (childFocusables.isNotEmpty()) {
|
|
1146
|
+
/*
|
|
1147
|
+
* Instead of forwarding AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS,
|
|
1148
|
+
* let's invoke AccessibilityNodeInfo.ACTION_FOCUS
|
|
1149
|
+
* to trigger focus events on JS side - the AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS
|
|
1150
|
+
* will be automatically invoked later
|
|
1151
|
+
*/
|
|
1152
|
+
childFocusables[0].performAccessibilityAction(
|
|
1153
|
+
AccessibilityNodeInfo.ACTION_FOCUS,
|
|
1154
|
+
args
|
|
1155
|
+
)
|
|
1156
|
+
return true
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
/*
|
|
1160
|
+
* Let's consume event here, otherwise there might be an issue with
|
|
1161
|
+
* FocusGuide receiving focus instead of one of its child views
|
|
1162
|
+
*/
|
|
1163
|
+
return true
|
|
1164
|
+
}
|
|
1165
|
+
return super.performAccessibilityAction(host, action, args)
|
|
1166
|
+
}
|
|
1167
|
+
return super.performAccessibilityAction(host, action, args)
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
ViewCompat.setAccessibilityDelegate(this, viewAccessibilityDelegate)
|
|
1171
|
+
this.isFocusable = true
|
|
1172
|
+
this.isFocusableInTouchMode = true
|
|
1173
|
+
// To force Talkback to give the a11y event to the FocusGuide
|
|
1174
|
+
// we need to make it look like it has some a11y label to be announced.
|
|
1175
|
+
// Because FocusGuide should always have at least one focusable child view,
|
|
1176
|
+
// which will receive forwarded a11y event from this FocusGuide,
|
|
1177
|
+
// the following fake label will never be announced
|
|
1178
|
+
this.contentDescription = "FocusGuide"
|
|
1179
|
+
this.isFocusGuideTalkbackAccessibilityDelegateSet = true
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
public fun cleanupFocusGuideTalkbackAccessibilityDelegate() {
|
|
1183
|
+
ViewCompat.setAccessibilityDelegate(this, null)
|
|
1184
|
+
this.isFocusable = this.originalIsFocusable
|
|
1185
|
+
this.isFocusableInTouchMode = this.originalIsFocusable
|
|
1186
|
+
this.originalIsFocusable = false
|
|
1187
|
+
this.contentDescription = null
|
|
1188
|
+
this.isFocusGuideTalkbackAccessibilityDelegateSet = false
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
public fun hasFocusGuideTalkbackAccessibilityDelegate(): Boolean {
|
|
1192
|
+
return this.isFocusGuideTalkbackAccessibilityDelegateSet
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
private fun interceptAccessibilityEvents(action: Int, args: Bundle): Boolean {
|
|
1196
|
+
if (!this.isTVFocusGuide) {
|
|
1197
|
+
return false
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
// If it's "FocusGuide", we want to intercept
|
|
1201
|
+
// the event and redirect it to either:
|
|
1202
|
+
// 1) first available destination view from "destinations" prop
|
|
1203
|
+
// 2) last focused element saved when "autoFocus" prop is `true`
|
|
1204
|
+
// 3) first focusable child view
|
|
1205
|
+
val destinationView = this.findDestinationView()
|
|
1206
|
+
if (destinationView != null) {
|
|
1207
|
+
try {
|
|
1208
|
+
destinationView.performAccessibilityAction(action, args)
|
|
1209
|
+
return true
|
|
1210
|
+
} catch (e: Exception) {
|
|
1211
|
+
FLog.e(
|
|
1212
|
+
TAG,
|
|
1213
|
+
"Exception when performing accessibility action on destination view - falling back to next case (last focused view): $e"
|
|
1214
|
+
)
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
val lastFocusedView = lastFocusedElement!!.get()
|
|
1218
|
+
if (lastFocusedView != null) {
|
|
1219
|
+
try {
|
|
1220
|
+
lastFocusedView.performAccessibilityAction(action, args)
|
|
1221
|
+
return true
|
|
1222
|
+
} catch (e: Exception) {
|
|
1223
|
+
FLog.e(
|
|
1224
|
+
TAG,
|
|
1225
|
+
"Exception when performing accessibility action on last focused view - falling back to next case (first focusable view): $e"
|
|
1226
|
+
)
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
val firstFocusableView = this.getFirstFocusableView(this)
|
|
1230
|
+
if (firstFocusableView != null) {
|
|
1231
|
+
try {
|
|
1232
|
+
firstFocusableView.performAccessibilityAction(action, args)
|
|
1233
|
+
return true
|
|
1234
|
+
} catch (e: Exception) {
|
|
1235
|
+
FLog.e(
|
|
1236
|
+
TAG,
|
|
1237
|
+
"Exception when performing accessibility action on first focusable view - focus guide will not handle focus: $e"
|
|
1238
|
+
)
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
return false
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
private fun findDestinationView(): View? {
|
|
1245
|
+
for (focusDestination in focusDestinations) {
|
|
1246
|
+
val childViewWithTag = findViewById<View>(focusDestination)
|
|
1247
|
+
if (childViewWithTag != null) return childViewWithTag
|
|
1248
|
+
val viewWithTag = rootView.findViewById<View>(focusDestination)
|
|
1249
|
+
if (viewWithTag != null) return viewWithTag
|
|
1250
|
+
}
|
|
1251
|
+
return null
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
private val isFocusDestinationsSet: Boolean
|
|
1255
|
+
get() = focusDestinations.isNotEmpty()
|
|
1256
|
+
|
|
1257
|
+
public val isTVFocusGuide: Boolean
|
|
1258
|
+
get() =
|
|
1259
|
+
/**
|
|
1260
|
+
* We don't count a view as `TVFocusGuide` if it has `trapFocus*` props enabled.
|
|
1261
|
+
* The reason is, it's a seperate functionality that has nothing to do with other
|
|
1262
|
+
* TVFocusGuide features that involves heavy focus management. So, the feature
|
|
1263
|
+
* is not directly tied to `TVFocusGuide`.
|
|
1264
|
+
*/
|
|
1265
|
+
isFocusDestinationsSet || autoFocus
|
|
1266
|
+
|
|
1267
|
+
private fun findParentFocusGuide(view: View): ReactViewGroup? {
|
|
1268
|
+
var parent: ViewParent? = view.parent
|
|
1269
|
+
|
|
1270
|
+
while (parent != null) {
|
|
1271
|
+
if (parent is ReactViewGroup) {
|
|
1272
|
+
val elem = parent
|
|
1273
|
+
if (elem.isTVFocusGuide) return elem
|
|
1274
|
+
}
|
|
1275
|
+
parent = parent.parent
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
return null
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
private val focusedChildOfFocusGuide: View?
|
|
1282
|
+
/***
|
|
1283
|
+
* This is meant to be used only for TVFocusGuide.
|
|
1284
|
+
* @return View | null
|
|
1285
|
+
*/
|
|
1286
|
+
get() {
|
|
1287
|
+
if (!isTVFocusGuide) return null
|
|
1288
|
+
|
|
1289
|
+
/*
|
|
1290
|
+
* We can have nested `TVFocusGuide`s, this is a typical scenario.
|
|
1291
|
+
* The problem is, returned element from `getFocusedChild` can be
|
|
1292
|
+
* either a direct `child` of the `TVFocusGuide` or a `descendant` of it.
|
|
1293
|
+
* Let's say if we run `getFocusedChild` for the Root element, it will always
|
|
1294
|
+
* give us an element even though the Root element is not the direct parent
|
|
1295
|
+
* of the focused element.
|
|
1296
|
+
* So, we need to find the closest `TVFocusGuide` to the focused child
|
|
1297
|
+
* to make sure the focused element's closest `TVFocusGuide` is "this" one.
|
|
1298
|
+
*/
|
|
1299
|
+
val focusedChild = this.focusedChild ?: return null
|
|
1300
|
+
|
|
1301
|
+
val parentFocusGuide =
|
|
1302
|
+
findParentFocusGuide(focusedChild)
|
|
1303
|
+
if (parentFocusGuide === this) return focusedChild
|
|
1304
|
+
|
|
1305
|
+
return null
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
override fun addFocusables(views: ArrayList<View>, direction: Int, focusableMode: Int) {
|
|
1309
|
+
/**
|
|
1310
|
+
* TVFocusGuides should reveral their children when `mRecoverFocus` is set.
|
|
1311
|
+
* `mRecoverFocus` flag indicates a temporary focus recovery mode it's in which
|
|
1312
|
+
* requires full access to children focusable elements.
|
|
1313
|
+
*/
|
|
1314
|
+
if (isTVFocusGuide && !mRecoverFocus && this.descendantFocusability != FOCUS_BLOCK_DESCENDANTS) {
|
|
1315
|
+
val focusedChild = focusedChildOfFocusGuide
|
|
1316
|
+
|
|
1317
|
+
/*
|
|
1318
|
+
* We only include the view's (TVFocusGuide) itself if it doesn't have a child that currently has the focus.
|
|
1319
|
+
* Otherwise, it means focus is already in the `TVFocusGuide` and all of it's descendants should be included
|
|
1320
|
+
* for focus calculations.
|
|
1321
|
+
*/
|
|
1322
|
+
if (focusedChild == null) {
|
|
1323
|
+
views.add(this)
|
|
1324
|
+
return
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
super.addFocusables(views, direction, focusableMode)
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
override fun requestChildFocus(child: View, focused: View) {
|
|
1332
|
+
super.requestChildFocus(child, focused)
|
|
1333
|
+
|
|
1334
|
+
if (autoFocus) {
|
|
1335
|
+
lastFocusedElement = WeakReference(focused)
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
override fun onFocusChanged(gainFocus: Boolean, direction: Int, previouslyFocusedRect: Rect?) {
|
|
1340
|
+
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect)
|
|
1341
|
+
|
|
1342
|
+
val mEventDispatcher: EventDispatcher? =
|
|
1343
|
+
UIManagerHelper.getEventDispatcherForReactTag(
|
|
1344
|
+
this.context as ReactContext, this.id
|
|
1345
|
+
)
|
|
1346
|
+
|
|
1347
|
+
if (mEventDispatcher == null) {
|
|
1348
|
+
return
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
if (gainFocus) {
|
|
1352
|
+
mEventDispatcher.dispatchEvent(
|
|
1353
|
+
FocusEvent(
|
|
1354
|
+
UIManagerHelper.getSurfaceId(this.context), this.id
|
|
1355
|
+
)
|
|
1356
|
+
)
|
|
1357
|
+
} else {
|
|
1358
|
+
mEventDispatcher.dispatchEvent(
|
|
1359
|
+
BlurEvent(
|
|
1360
|
+
UIManagerHelper.getSurfaceId(this.context), this.id
|
|
1361
|
+
)
|
|
1362
|
+
)
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
|
|
1367
|
+
if ((keyCode == KeyEvent.KEYCODE_DPAD_CENTER || keyCode == KeyEvent.KEYCODE_ENTER) && event.repeatCount == 0 && !this.isTVFocusGuide) {
|
|
1368
|
+
val mEventDispatcher: EventDispatcher? =
|
|
1369
|
+
UIManagerHelper.getEventDispatcherForReactTag(
|
|
1370
|
+
this.context as ReactContext, this.id
|
|
1371
|
+
)
|
|
1372
|
+
|
|
1373
|
+
if (mEventDispatcher == null) {
|
|
1374
|
+
return super.onKeyDown(keyCode, event)
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
mEventDispatcher.dispatchEvent(
|
|
1378
|
+
PressInEvent(
|
|
1379
|
+
UIManagerHelper.getSurfaceId(this.context),
|
|
1380
|
+
this.id
|
|
1381
|
+
)
|
|
1382
|
+
)
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
|
|
1386
|
+
return super.onKeyDown(keyCode, event)
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean {
|
|
1390
|
+
if ((keyCode == KeyEvent.KEYCODE_DPAD_CENTER || keyCode == KeyEvent.KEYCODE_ENTER) && !this.isTVFocusGuide) {
|
|
1391
|
+
val mEventDispatcher: EventDispatcher? =
|
|
1392
|
+
UIManagerHelper.getEventDispatcherForReactTag(
|
|
1393
|
+
this.context as ReactContext, this.id
|
|
1394
|
+
)
|
|
1395
|
+
|
|
1396
|
+
if (mEventDispatcher == null) {
|
|
1397
|
+
return super.onKeyUp(keyCode, event)
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
mEventDispatcher.dispatchEvent(
|
|
1401
|
+
PressOutEvent(
|
|
1402
|
+
UIManagerHelper.getSurfaceId(this.context),
|
|
1403
|
+
this.id
|
|
1404
|
+
)
|
|
1405
|
+
)
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
return super.onKeyUp(keyCode, event)
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
override fun requestFocus(direction: Int, previouslyFocusedRect: Rect?): Boolean {
|
|
1412
|
+
if (!isTVFocusGuide || mRecoverFocus) {
|
|
1413
|
+
return super.requestFocus(direction, previouslyFocusedRect)
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
if (isFocusDestinationsSet) {
|
|
1417
|
+
val destination = findDestinationView()
|
|
1418
|
+
|
|
1419
|
+
if (destination != null && requestFocusViewOrAncestor(destination)) {
|
|
1420
|
+
return true
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
if (this.autoFocus) {
|
|
1425
|
+
val lastFocusedElem = lastFocusedElement!!.get()
|
|
1426
|
+
|
|
1427
|
+
if (lastFocusedElem != null) {
|
|
1428
|
+
if (lastFocusedElem.isAttachedToWindow) {
|
|
1429
|
+
lastFocusedElem.requestFocus()
|
|
1430
|
+
return true
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
/**
|
|
1434
|
+
* `lastFocusedElem` can get detached based on application logic.
|
|
1435
|
+
* If the code reaches here, that means we're dealing with that case.
|
|
1436
|
+
* We should set `lastFocusedElem` to null and let the focus determination
|
|
1437
|
+
* logic below to do its magic and redirect focus to the first element.
|
|
1438
|
+
*/
|
|
1439
|
+
lastFocusedElement = WeakReference(null)
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
// Try moving the focus to the first focusable element otherwise.
|
|
1443
|
+
if (moveFocusToFirstFocusable(this)) {
|
|
1444
|
+
return true
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
return super.requestFocus(direction, previouslyFocusedRect)
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
override fun focusSearch(focused: View, direction: Int): View? {
|
|
1452
|
+
/**
|
|
1453
|
+
* FocusSearch recursively goes all the way up to the Root view
|
|
1454
|
+
* and runs `FocusFinder.findNextFocus()` to determine the next focusable.
|
|
1455
|
+
* It finds the next focusable by accounting *every* focusable elements on the screen.
|
|
1456
|
+
*
|
|
1457
|
+
* That is exactly the thing we want to prevent if the view has a `focusTrap` enabled
|
|
1458
|
+
* matching the `direction`. We interrupt `focusSearch` to make the `FocusFinder` run
|
|
1459
|
+
* the algorithm only accounting the children elements of the focus trap.
|
|
1460
|
+
* This ensures that focus will always stay inside the container until trap gets disabled.
|
|
1461
|
+
*/
|
|
1462
|
+
if ((trapFocusUp && direction == FOCUS_UP)
|
|
1463
|
+
|| (trapFocusDown && direction == FOCUS_DOWN)
|
|
1464
|
+
|| (trapFocusLeft && direction == FOCUS_LEFT)
|
|
1465
|
+
|| (trapFocusRight && direction == FOCUS_RIGHT)
|
|
1466
|
+
) {
|
|
1467
|
+
return FocusFinder.getInstance().findNextFocus(this, focused, direction)
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
return super.focusSearch(focused, direction)
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
public fun setFocusDestinations(focusDestinations: IntArray) {
|
|
1474
|
+
this.focusDestinations = focusDestinations
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
public fun setAutoFocusTV(autoFocus: Boolean) {
|
|
1478
|
+
this.autoFocus = autoFocus
|
|
1479
|
+
lastFocusedElement = WeakReference(null)
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
public fun setTrapFocusUp(enabled: Boolean) {
|
|
1483
|
+
this.trapFocusUp = enabled
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
public fun setTrapFocusDown(enabled: Boolean) {
|
|
1487
|
+
this.trapFocusDown = enabled
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
public fun setTrapFocusLeft(enabled: Boolean) {
|
|
1491
|
+
this.trapFocusLeft = enabled
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
public fun setTrapFocusRight(enabled: Boolean) {
|
|
1495
|
+
this.trapFocusRight = enabled
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
override fun addChildrenForAccessibility(outChildren: ArrayList<View>) {
|
|
1499
|
+
val axOrderParentOrderList =
|
|
1500
|
+
(getTag(R.id.accessibility_order_parent) as ReactViewGroup?)?.axOrderList
|
|
1501
|
+
val axOrder: MutableList<*>? = axOrderList
|
|
1502
|
+
if (axOrder != null) {
|
|
1503
|
+
|
|
1504
|
+
val am: AccessibilityManager? =
|
|
1505
|
+
this.getContext().getSystemService(Context.ACCESSIBILITY_SERVICE) as AccessibilityManager?
|
|
1506
|
+
if (accessibilityStateChangeListener == null && am != null) {
|
|
1507
|
+
val newAccessibilityStateChangeListener =
|
|
1508
|
+
AccessibilityManager.AccessibilityStateChangeListener { enabled ->
|
|
1509
|
+
if (!enabled) {
|
|
1510
|
+
ReactAxOrderHelper.restoreFocusability(this)
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
am.addAccessibilityStateChangeListener(newAccessibilityStateChangeListener)
|
|
1515
|
+
accessibilityStateChangeListener = newAccessibilityStateChangeListener
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
val result = arrayOfNulls<View?>(axOrder.size)
|
|
1519
|
+
|
|
1520
|
+
for (i in 0..<childCount) {
|
|
1521
|
+
ReactAxOrderHelper.buildAxOrderList(getChildAt(i), axOrder, result)
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
for (i in result.indices) {
|
|
1525
|
+
val view = result[i]
|
|
1526
|
+
if (view != null) {
|
|
1527
|
+
if (view.isFocusable) {
|
|
1528
|
+
outChildren.add(view)
|
|
1529
|
+
} else {
|
|
1530
|
+
view.addChildrenForAccessibility(outChildren)
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
} else if (axOrderParentOrderList != null) {
|
|
1535
|
+
// view is a container so add its children normally
|
|
1536
|
+
if (!isFocusable) {
|
|
1537
|
+
super.addChildrenForAccessibility(outChildren)
|
|
1538
|
+
return
|
|
1539
|
+
|
|
1540
|
+
// If this view can coopt, turn the focusability off its children but add them to the tree
|
|
1541
|
+
} else if (isFocusable && (contentDescription == null || contentDescription == "")) {
|
|
1542
|
+
super.addChildrenForAccessibility(outChildren)
|
|
1543
|
+
ReactAxOrderHelper.disableFocusForSubtree(this, axOrderParentOrderList)
|
|
1544
|
+
// if this view is focusable and has a contentDescription then we don't care about its
|
|
1545
|
+
// descendants for accessibility
|
|
1546
|
+
} else if (isFocusable && !(contentDescription == null || contentDescription == "")) {
|
|
1547
|
+
return
|
|
1548
|
+
}
|
|
1549
|
+
} else {
|
|
1550
|
+
super.addChildrenForAccessibility(outChildren)
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
public fun cleanUpAxOrderListener() {
|
|
1555
|
+
val am = this.context.getSystemService(Context.ACCESSIBILITY_SERVICE) as? AccessibilityManager
|
|
1556
|
+
if (am != null) {
|
|
1557
|
+
accessibilityStateChangeListener?.let { am.removeAccessibilityStateChangeListener(it) }
|
|
1558
|
+
}
|
|
1559
|
+
accessibilityStateChangeListener = null
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
private companion object {
|
|
1563
|
+
const val ARRAY_CAPACITY_INCREMENT = 12
|
|
1564
|
+
private val defaultLayoutParam = LayoutParams(0, 0)
|
|
1565
|
+
|
|
1566
|
+
fun setViewClipped(view: View, clipped: Boolean) {
|
|
1567
|
+
view.setTag(R.id.view_clipped, clipped)
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
private fun requestFocusViewOrAncestor(destination: View): Boolean {
|
|
1571
|
+
var v: View? = destination
|
|
1572
|
+
while (v != null) {
|
|
1573
|
+
if (v.requestFocus()) {
|
|
1574
|
+
return true
|
|
1575
|
+
}
|
|
1576
|
+
val parent = v.parent
|
|
1577
|
+
v = if (parent is View) {
|
|
1578
|
+
parent
|
|
1579
|
+
} else {
|
|
1580
|
+
null
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
return false
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
}
|