react-native 0.0.0-201c10733 → 0.0.0-268efb102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +14 -3
- package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +2 -2
- package/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec +1 -1
- package/Libraries/Alert/Alert.js +3 -5
- package/Libraries/Alert/NativeAlertManager.js +0 -2
- package/Libraries/Alert/RCTAlertManager.android.js +0 -2
- package/Libraries/Alert/RCTAlertManager.ios.js +0 -2
- package/Libraries/Animated/Animated.js +0 -2
- package/Libraries/Animated/AnimatedEvent.js +26 -7
- package/Libraries/Animated/AnimatedImplementation.js +0 -2
- package/Libraries/Animated/AnimatedMock.js +1 -8
- package/Libraries/Animated/AnimatedWeb.js +6 -3
- package/Libraries/Animated/NativeAnimatedHelper.js +10 -7
- package/Libraries/Animated/NativeAnimatedModule.js +0 -2
- package/Libraries/Animated/NativeAnimatedTurboModule.js +0 -2
- package/Libraries/Animated/animations/Animation.js +1 -0
- package/Libraries/Animated/animations/DecayAnimation.js +2 -0
- package/Libraries/Animated/animations/SpringAnimation.js +1 -0
- package/Libraries/Animated/animations/TimingAnimation.js +3 -0
- package/Libraries/Animated/components/AnimatedFlatList.js +0 -2
- package/Libraries/Animated/components/AnimatedImage.js +0 -2
- package/Libraries/Animated/components/AnimatedScrollView.js +0 -2
- package/Libraries/Animated/components/AnimatedSectionList.js +1 -3
- package/Libraries/Animated/components/AnimatedText.js +0 -2
- package/Libraries/Animated/components/AnimatedView.js +0 -2
- package/Libraries/Animated/createAnimatedComponent.js +25 -19
- package/Libraries/Animated/createAnimatedComponentInjection.js +48 -0
- package/Libraries/Animated/createAnimatedComponent_EXPERIMENTAL.js +48 -0
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +21 -22
- package/Libraries/Animated/nodes/AnimatedProps.js +0 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +24 -5
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +1 -0
- package/Libraries/Animated/useAnimatedProps.js +211 -0
- package/Libraries/AppState/AppState.js +90 -164
- package/Libraries/AppState/NativeAppState.js +0 -2
- package/Libraries/BatchedBridge/MessageQueue.js +19 -14
- package/Libraries/BatchedBridge/NativeModules.js +5 -1
- package/Libraries/Blob/BlobManager.js +0 -2
- package/Libraries/Blob/FileReader.js +1 -3
- package/Libraries/Blob/NativeBlobModule.js +0 -2
- package/Libraries/Blob/NativeFileReaderModule.js +0 -2
- package/Libraries/Blob/RCTBlobManager.h +2 -1
- package/Libraries/Blob/RCTBlobManager.mm +1 -3
- package/Libraries/Blob/RCTBlobPlugins.mm +4 -3
- package/Libraries/Blob/React-RCTBlob.podspec +3 -3
- package/Libraries/Blob/URL.js +18 -20
- package/Libraries/BugReporting/BugReporting.js +2 -2
- package/Libraries/BugReporting/getReactData.js +2 -2
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +350 -0
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js +4 -2
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js +0 -2
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.android.js +35 -0
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.ios.js +26 -0
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +6 -8
- package/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +0 -2
- package/Libraries/Components/Button.js +45 -15
- package/Libraries/Components/Clipboard/Clipboard.js +0 -2
- package/Libraries/Components/Clipboard/NativeClipboard.js +0 -2
- package/Libraries/Components/DatePicker/DatePickerIOS.android.js +4 -5
- package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +50 -14
- package/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js +1 -2
- package/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +0 -2
- package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +0 -2
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -9
- package/Libraries/Components/Keyboard/Keyboard.js +16 -17
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +17 -22
- package/Libraries/Components/Keyboard/NativeKeyboardObserver.js +0 -2
- package/Libraries/Components/MaskedView/MaskedViewIOS.ios.js +3 -3
- package/Libraries/Components/Pressable/Pressable.js +20 -7
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +18 -17
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +0 -2
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +0 -2
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js +4 -5
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +2 -5
- package/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js +0 -2
- package/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +0 -2
- package/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +9 -3
- package/Libraries/Components/RefreshControl/RefreshControl.js +5 -7
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +2 -3
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +0 -2
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +1 -1
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +11 -15
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +2 -4
- package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +2 -4
- package/Libraries/Components/ScrollView/ScrollView.js +754 -170
- package/Libraries/Components/ScrollView/ScrollViewContext.js +0 -2
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +3 -4
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +2 -0
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +31 -10
- package/Libraries/Components/ScrollView/ScrollViewViewConfig.js +2 -0
- package/Libraries/Components/ScrollView/processDecelerationRate.js +0 -2
- package/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js +0 -2
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js +4 -5
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +17 -11
- package/Libraries/Components/Slider/Slider.js +19 -8
- package/Libraries/Components/Slider/SliderNativeComponent.js +0 -2
- package/Libraries/Components/Sound/NativeSoundManager.js +0 -2
- package/Libraries/Components/Sound/SoundManager.js +0 -1
- package/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js +0 -2
- package/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js +0 -2
- package/Libraries/Components/StatusBar/StatusBar.js +10 -21
- package/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +0 -2
- package/Libraries/Components/Switch/Switch.js +98 -118
- package/Libraries/Components/Switch/SwitchNativeComponent.js +0 -2
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +9 -8
- package/Libraries/Components/TextInput/AndroidTextInputViewConfig.js +2 -3
- package/Libraries/Components/TextInput/InputAccessoryView.js +6 -8
- package/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +0 -2
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +6 -5
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +6 -16
- package/Libraries/Components/TextInput/{RCTSinglelineTextInputViewConfig.js → RCTTextInputViewConfig.js} +3 -5
- package/Libraries/Components/TextInput/TextInput.js +128 -69
- package/Libraries/Components/TextInput/TextInputNativeCommands.js +0 -2
- package/Libraries/Components/TextInput/TextInputState.js +1 -3
- package/Libraries/Components/ToastAndroid/NativeToastAndroid.js +0 -2
- package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +0 -1
- package/Libraries/Components/Touchable/BoundingDimensions.js +1 -2
- package/Libraries/Components/Touchable/PooledClass.js +1 -2
- package/Libraries/Components/Touchable/Position.js +1 -2
- package/Libraries/Components/Touchable/Touchable.js +26 -55
- package/Libraries/Components/Touchable/TouchableBounce.js +0 -2
- package/Libraries/Components/Touchable/TouchableHighlight.js +22 -6
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +16 -5
- package/Libraries/Components/Touchable/TouchableOpacity.js +19 -8
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +13 -4
- package/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +0 -2
- package/Libraries/Components/UnimplementedViews/UnimplementedView.js +2 -3
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +133 -68
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -2
- package/Libraries/Components/View/ReactNativeViewViewConfig.js +1 -3
- package/Libraries/Components/View/View.js +2 -4
- package/Libraries/Components/View/ViewAccessibility.js +3 -0
- package/Libraries/Components/View/ViewNativeComponent.js +0 -2
- package/Libraries/Core/Devtools/getDevServer.js +0 -2
- package/Libraries/Core/Devtools/parseErrorStack.js +0 -9
- package/Libraries/Core/Devtools/parseHermesStack.js +1 -1
- package/Libraries/Core/ExceptionsManager.js +51 -41
- package/Libraries/Core/ExtendedError.js +19 -0
- package/Libraries/Core/InitializeCore.js +1 -0
- package/Libraries/Core/NativeExceptionsManager.js +0 -2
- package/Libraries/Core/ReactFiberErrorDialog.js +44 -34
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/ReactNativeVersionCheck.js +0 -2
- package/Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js +0 -2
- package/Libraries/Core/Timers/JSTimers.js +41 -31
- package/Libraries/Core/Timers/NativeTiming.js +0 -2
- package/Libraries/Core/Timers/immediateShim.js +67 -0
- package/Libraries/Core/Timers/queueMicrotask.js +41 -0
- package/Libraries/Core/polyfillPromise.js +1 -1
- package/Libraries/Core/setUpBatchedBridge.js +1 -1
- package/Libraries/Core/setUpDeveloperTools.js +53 -58
- package/Libraries/Core/setUpGlobals.js +2 -0
- package/Libraries/Core/setUpReactDevTools.js +18 -1
- package/Libraries/Core/setUpRegeneratorRuntime.js +25 -8
- package/Libraries/Core/setUpTimers.js +65 -6
- package/Libraries/Core/setUpXHR.js +4 -4
- package/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.android.js +131 -0
- package/Libraries/DeprecatedPropTypes/{DeprecatedImagePropType.js → DeprecatedImagePropType.ios.js} +0 -0
- package/Libraries/DeprecatedPropTypes/DeprecatedTextInputPropTypes.js +5 -5
- package/Libraries/DeprecatedPropTypes/DeprecatedViewAccessibility.js +2 -0
- package/Libraries/EventEmitter/NativeEventEmitter.js +100 -51
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +9 -77
- package/Libraries/EventEmitter/RCTEventEmitter.js +5 -1
- package/Libraries/EventEmitter/RCTNativeAppEventEmitter.js +0 -2
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +31 -10
- package/Libraries/FBLazyVector/BUCK +5 -1
- package/Libraries/FBLazyVector/FBLazyVector.podspec +1 -1
- package/Libraries/HeapCapture/HeapCapture.js +0 -2
- package/Libraries/HeapCapture/NativeJSCHeapCapture.js +0 -2
- package/Libraries/Image/AssetUtils.js +0 -2
- package/Libraries/Image/Image.android.js +22 -133
- package/Libraries/Image/Image.ios.js +39 -33
- package/Libraries/Image/ImageAnalyticsTagContext.js +0 -2
- package/Libraries/Image/ImageBackground.js +10 -8
- package/Libraries/Image/ImageInjection.js +28 -0
- package/Libraries/Image/ImagePickerIOS.js +0 -2
- package/Libraries/Image/ImageProps.js +28 -0
- package/Libraries/Image/ImageSource.js +57 -14
- package/Libraries/Image/ImageViewNativeComponent.js +0 -2
- package/Libraries/Image/NativeImageEditor.js +0 -2
- package/Libraries/Image/NativeImageLoaderAndroid.js +0 -2
- package/Libraries/Image/NativeImageLoaderIOS.js +2 -3
- package/Libraries/Image/NativeImagePickerIOS.js +0 -2
- package/Libraries/Image/NativeImageStoreAndroid.js +0 -2
- package/Libraries/Image/NativeImageStoreIOS.js +0 -2
- package/Libraries/Image/RCTGIFImageDecoder.mm +6 -0
- package/Libraries/Image/RCTImageLoader.h +2 -2
- package/Libraries/Image/RCTImageLoader.mm +6 -18
- package/Libraries/Image/RCTImageLoaderWithAttributionProtocol.h +0 -5
- package/Libraries/Image/RCTImagePlugins.mm +4 -3
- package/Libraries/Image/RCTImageStoreManager.mm +5 -5
- package/Libraries/Image/RCTLocalAssetImageLoader.mm +5 -0
- package/Libraries/Image/React-RCTImage.podspec +3 -3
- package/Libraries/Image/TextInlineImageNativeComponent.js +84 -2
- package/Libraries/Image/nativeImageSource.js +0 -2
- package/Libraries/Inspector/ElementProperties.js +1 -1
- package/Libraries/Inspector/Inspector.js +13 -4
- package/Libraries/Inspector/InspectorPanel.js +1 -1
- package/Libraries/Interaction/FrameRateLogger.js +0 -2
- package/Libraries/Interaction/InteractionManager.js +3 -5
- package/Libraries/Interaction/PanResponder.js +1 -1
- package/Libraries/LayoutAnimation/LayoutAnimation.js +53 -17
- package/Libraries/Linking/Linking.js +5 -7
- package/Libraries/Linking/NativeIntentAndroid.js +0 -2
- package/Libraries/Linking/NativeLinkingManager.js +0 -2
- package/Libraries/LinkingIOS/RCTLinkingPlugins.mm +4 -3
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +3 -3
- package/Libraries/Lists/CellRenderMask.js +145 -0
- package/Libraries/Lists/FillRateHelper.js +1 -1
- package/Libraries/Lists/FlatList.js +77 -53
- package/Libraries/Lists/SectionList.js +20 -23
- package/Libraries/Lists/SectionListModern.js +249 -0
- package/Libraries/Lists/ViewabilityHelper.js +9 -9
- package/Libraries/Lists/VirtualizeUtils.js +18 -20
- package/Libraries/Lists/VirtualizedList.js +176 -132
- package/Libraries/Lists/VirtualizedListContext.js +0 -2
- package/Libraries/Lists/VirtualizedSectionList.js +247 -209
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +6 -6
- package/Libraries/LogBox/Data/LogBoxData.js +21 -19
- package/Libraries/LogBox/Data/LogBoxLog.js +0 -2
- package/Libraries/LogBox/Data/LogBoxSymbolication.js +0 -2
- package/Libraries/LogBox/Data/parseLogBoxLog.js +0 -2
- package/Libraries/LogBox/LogBox.js +114 -49
- package/Libraries/LogBox/LogBoxInspectorContainer.js +0 -2
- package/Libraries/LogBox/LogBoxNotificationContainer.js +0 -2
- package/Libraries/LogBox/UI/LogBoxButton.js +0 -2
- package/Libraries/LogBox/UI/LogBoxImages/alert-triangle.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-left.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-right.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/close.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/loader.png +0 -0
- package/Libraries/LogBox/UI/LogBoxInspector.js +0 -2
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +0 -2
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +0 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +0 -2
- package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +0 -2
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +0 -2
- package/Libraries/LogBox/UI/LogBoxInspectorSection.js +0 -2
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +4 -5
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +0 -2
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +4 -3
- package/Libraries/LogBox/UI/LogBoxMessage.js +0 -2
- package/Libraries/LogBox/UI/LogBoxNotification.js +3 -4
- package/Libraries/LogBox/UI/LogBoxStyle.js +0 -2
- package/Libraries/Modal/Modal.js +42 -21
- package/Libraries/{Text/TextInjection.js → Modal/ModalInjection.js} +3 -5
- package/Libraries/Modal/NativeModalManager.js +0 -2
- package/Libraries/Modal/RCTModalHostViewNativeComponent.js +8 -4
- package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +0 -3
- package/Libraries/NativeAnimation/RCTAnimationPlugins.mm +4 -3
- package/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +6 -3
- package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h +1 -1
- package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m +1 -1
- package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +32 -28
- package/Libraries/NativeAnimation/React-RCTAnimation.podspec +3 -3
- package/Libraries/NativeComponent/NativeComponentRegistry.js +34 -2
- package/Libraries/NativeModules/specs/NativeAnimationsDebugModule.js +0 -2
- package/Libraries/NativeModules/specs/NativeDevMenu.js +0 -2
- package/Libraries/NativeModules/specs/NativeDevSettings.js +0 -2
- package/Libraries/NativeModules/specs/NativeDeviceEventManager.js +0 -2
- package/Libraries/NativeModules/specs/NativeDialogManagerAndroid.js +0 -2
- package/Libraries/NativeModules/specs/NativeLogBox.js +0 -2
- package/Libraries/NativeModules/specs/NativeRedBox.js +0 -2
- package/Libraries/NativeModules/specs/NativeSourceCode.js +0 -2
- package/Libraries/Network/NativeNetworkingAndroid.js +0 -2
- package/Libraries/Network/NativeNetworkingIOS.js +0 -2
- package/Libraries/Network/RCTDataRequestHandler.mm +6 -0
- package/Libraries/Network/RCTFileRequestHandler.mm +6 -0
- package/Libraries/Network/RCTHTTPRequestHandler.h +5 -0
- package/Libraries/Network/RCTHTTPRequestHandler.mm +25 -7
- package/Libraries/Network/RCTNetworkPlugins.mm +4 -3
- package/Libraries/Network/RCTNetworking.android.js +6 -3
- package/Libraries/Network/RCTNetworking.h +1 -1
- package/Libraries/Network/RCTNetworking.ios.js +63 -21
- package/Libraries/Network/RCTNetworking.mm +3 -3
- package/Libraries/Network/React-RCTNetwork.podspec +2 -2
- package/Libraries/Network/XMLHttpRequest.js +5 -3
- package/Libraries/Network/convertRequestBody.js +2 -1
- package/Libraries/NewAppScreen/components/Colors.js +0 -2
- package/Libraries/NewAppScreen/components/Header.js +1 -1
- package/Libraries/NewAppScreen/components/HermesBadge.js +4 -1
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +0 -1
- package/Libraries/NewAppScreen/components/logo.png +0 -0
- package/Libraries/NewAppScreen/index.js +0 -2
- package/Libraries/Performance/NativeJSCSamplingProfiler.js +0 -2
- package/Libraries/Performance/QuickPerformanceLogger.js +4 -4
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +4 -3
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +10 -5
- package/Libraries/Pressability/HoverState.js +0 -2
- package/Libraries/Pressability/Pressability.js +18 -13
- package/Libraries/Pressability/PressabilityDebug.js +9 -4
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +48 -0
- package/Libraries/Pressability/PressabilityTypes.js +18 -0
- package/Libraries/Pressability/usePressability.js +0 -2
- package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +3 -0
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +18 -3
- package/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +13 -1
- package/Libraries/PushNotificationIOS/RCTPushNotificationPlugins.mm +4 -3
- package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +3 -3
- package/Libraries/RCTRequired/BUCK +4 -1
- package/Libraries/RCTRequired/RCTRequired.podspec +2 -2
- package/Libraries/ReactNative/AppContainer.js +3 -25
- package/Libraries/ReactNative/AppRegistry.js +48 -7
- package/Libraries/ReactNative/DisplayMode.js +32 -0
- package/Libraries/ReactNative/DummyUIManager.js +7 -2
- package/Libraries/ReactNative/FabricUIManager.js +6 -5
- package/Libraries/ReactNative/HeadlessJsTaskError.js +0 -2
- package/Libraries/ReactNative/I18nManager.js +23 -9
- package/Libraries/ReactNative/NativeHeadlessJsTaskSupport.js +0 -2
- package/Libraries/ReactNative/NativeI18nManager.js +1 -2
- package/Libraries/ReactNative/NativeUIManager.js +2 -3
- package/Libraries/ReactNative/PaperUIManager.js +13 -7
- package/Libraries/ReactNative/RootTag.js +2 -4
- package/Libraries/ReactNative/UIManager.js +2 -3
- package/Libraries/ReactNative/UIManagerInjection.js +0 -2
- package/Libraries/ReactNative/getCachedComponentWithDebugName.js +32 -0
- package/Libraries/ReactNative/renderApplication.js +24 -6
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +6 -3
- package/Libraries/Reliability/UserFlow.js +7 -0
- package/Libraries/Renderer/REVISION +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +9484 -7643
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +7877 -6935
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +3038 -2506
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +2112 -1937
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +3375 -2693
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +2568 -2244
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +9638 -7942
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5736 -4864
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +2865 -2464
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +2275 -2120
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +3190 -2643
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +2565 -2259
- package/Libraries/Renderer/shims/ReactFabric.js +5 -3
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +3 -0
- package/Libraries/Renderer/shims/ReactNative.js +3 -0
- package/Libraries/Renderer/shims/ReactNativeTypes.js +21 -15
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +5 -0
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +3 -0
- package/Libraries/Settings/NativeSettingsManager.js +0 -2
- package/Libraries/Settings/RCTSettingsPlugins.mm +4 -3
- package/Libraries/Settings/React-RCTSettings.podspec +2 -2
- package/Libraries/Settings/Settings.ios.js +4 -2
- package/Libraries/Share/NativeShareModule.js +0 -2
- package/Libraries/Share/Share.js +0 -2
- package/Libraries/Storage/AsyncStorage.js +1 -2
- package/Libraries/Storage/NativeAsyncLocalStorage.js +0 -2
- package/Libraries/Storage/NativeAsyncSQLiteDBStorage.js +0 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +0 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +16 -3
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js +8 -3
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.js +2 -2
- package/Libraries/StyleSheet/Rect.js +0 -2
- package/Libraries/StyleSheet/StyleSheet.js +3 -5
- package/Libraries/StyleSheet/normalizeColor.js +2 -4
- package/Libraries/StyleSheet/processColorArray.js +16 -6
- package/Libraries/StyleSheet/processTransform.js +6 -6
- package/Libraries/StyleSheet/splitLayoutProps.js +0 -4
- package/Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponent.mm +1 -1
- package/Libraries/Text/React-RCTText.podspec +2 -2
- package/Libraries/Text/Text.js +187 -235
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.h +0 -2
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +12 -2
- package/Libraries/Text/TextInput/RCTBaseTextInputView.m +10 -12
- package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.m +4 -11
- package/Libraries/Text/TextNativeComponent.js +0 -2
- package/Libraries/Text/TextProps.js +7 -7
- package/Libraries/TurboModule/RCTExport.js +1 -1
- package/Libraries/TurboModule/TurboModuleRegistry.js +1 -5
- package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +0 -2
- package/Libraries/TypeSafety/RCTTypeSafety.podspec +3 -3
- package/Libraries/Types/CoreEventTypes.js +0 -2
- package/Libraries/{Components/Picker/PickerAndroid.ios.js → Types/RootTagTypes.js} +2 -3
- package/Libraries/UTFSequence.js +1 -1
- package/Libraries/Utilities/Appearance.js +13 -7
- package/Libraries/Utilities/BackHandler.android.js +0 -2
- package/Libraries/Utilities/DebugEnvironment.js +0 -2
- package/Libraries/Utilities/DevSettings.js +48 -58
- package/Libraries/Utilities/DeviceInfo.js +0 -2
- package/Libraries/Utilities/Dimensions.js +19 -20
- package/Libraries/Utilities/FeatureDetection.js +31 -0
- package/Libraries/Utilities/GlobalPerformanceLogger.js +0 -2
- package/Libraries/Utilities/HMRClient.js +15 -10
- package/Libraries/Utilities/JSDevSupportModule.js +0 -2
- package/Libraries/Utilities/LoadingView.android.js +0 -2
- package/Libraries/Utilities/LoadingView.ios.js +0 -2
- package/Libraries/Utilities/MatrixMath.js +1 -1
- package/Libraries/Utilities/NativeAppearance.js +0 -2
- package/Libraries/Utilities/NativeDevLoadingView.js +0 -2
- package/Libraries/Utilities/NativeDevSplitBundleLoader.js +0 -2
- package/Libraries/Utilities/NativeDeviceInfo.js +1 -3
- package/Libraries/Utilities/NativeJSDevSupport.js +0 -2
- package/Libraries/Utilities/NativePlatformConstantsAndroid.js +0 -2
- package/Libraries/Utilities/NativePlatformConstantsIOS.js +0 -2
- package/Libraries/Utilities/PerformanceLoggerContext.js +8 -4
- package/Libraries/Utilities/Platform.android.js +0 -2
- package/Libraries/Utilities/Platform.ios.js +0 -2
- package/Libraries/Utilities/ReactNativeTestTools.js +12 -19
- package/Libraries/Utilities/codegenNativeCommands.js +1 -3
- package/Libraries/Utilities/codegenNativeComponent.js +0 -2
- package/Libraries/Utilities/createPerformanceLogger.js +0 -2
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +1 -0
- package/Libraries/Utilities/defineLazyObjectProperty.js +1 -1
- package/Libraries/Utilities/deprecatedPropType.js +2 -4
- package/Libraries/Utilities/stringifySafe.js +1 -3
- package/Libraries/Utilities/useColorScheme.js +4 -4
- package/Libraries/Utilities/useMergeRefs.js +44 -0
- package/Libraries/Utilities/useRefEffect.js +45 -0
- package/Libraries/Utilities/useWindowDimensions.js +9 -6
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +0 -2
- package/Libraries/Vibration/NativeVibration.js +0 -2
- package/Libraries/Vibration/RCTVibrationPlugins.mm +4 -3
- package/Libraries/Vibration/React-RCTVibration.podspec +2 -2
- package/Libraries/Vibration/Vibration.js +0 -2
- package/Libraries/WebSocket/NativeWebSocketModule.js +0 -2
- package/Libraries/WebSocket/WebSocket.js +12 -12
- package/Libraries/WebSocket/WebSocketInterceptor.js +6 -3
- package/Libraries/YellowBox/YellowBoxDeprecated.js +1 -0
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +0 -2
- package/Libraries/promiseRejectionTrackingOptions.js +2 -2
- package/Libraries/vendor/emitter/EventEmitter.js +36 -2
- package/Libraries/vendor/emitter/EventSubscription.js +19 -0
- package/Libraries/vendor/emitter/_EmitterSubscription.js +7 -7
- package/Libraries/vendor/emitter/_EventEmitter.js +28 -42
- package/Libraries/vendor/emitter/_EventSubscription.js +4 -2
- package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +1 -1
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +0 -2
- package/README.md +5 -5
- package/React/Base/RCTAssert.h +29 -11
- package/React/Base/RCTAssert.m +52 -0
- package/React/Base/RCTBridge+Private.h +8 -0
- package/React/Base/RCTBridge.h +20 -0
- package/React/Base/RCTBridge.m +39 -7
- package/React/Base/RCTBridgeModule.h +62 -12
- package/React/Base/RCTBundleManager.m +78 -0
- package/React/Base/RCTBundleURLProvider.h +35 -9
- package/React/Base/RCTBundleURLProvider.mm +90 -25
- package/React/Base/RCTCallableJSModules.m +47 -0
- package/React/Base/RCTConstants.h +3 -16
- package/React/Base/RCTConstants.m +6 -36
- package/React/Base/RCTConvert.h +1 -1
- package/React/Base/RCTConvert.m +31 -7
- package/React/Base/RCTCxxConvert.h +1 -1
- package/React/Base/RCTDefines.h +22 -3
- package/React/Base/RCTEventDispatcherProtocol.h +3 -2
- package/React/{Views/RCTPickerManager.h → Base/RCTInitializing.h} +4 -2
- package/React/Base/RCTJSThread.h +29 -0
- package/React/Base/RCTJSThread.m +19 -0
- package/React/Base/RCTModuleData.h +11 -3
- package/React/Base/RCTModuleData.mm +66 -1
- package/React/Base/RCTMultipartStreamReader.m +0 -2
- package/React/Base/RCTRootView.h +25 -1
- package/React/Base/RCTRootView.m +27 -4
- package/React/Base/RCTTouchHandler.m +3 -0
- package/React/Base/RCTUtils.h +3 -0
- package/React/Base/RCTUtils.m +14 -7
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/RCTSurfaceStage.h +6 -11
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +12 -0
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +46 -2
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +3 -0
- package/React/CoreModules/BUCK +4 -3
- package/React/CoreModules/CoreModulesPlugins.mm +4 -3
- package/React/CoreModules/RCTAccessibilityManager.mm +1 -1
- package/React/CoreModules/RCTActionSheetManager.mm +14 -5
- package/React/CoreModules/RCTAsyncLocalStorage.mm +4 -0
- package/React/CoreModules/RCTDevLoadingView.mm +25 -33
- package/React/CoreModules/RCTDevMenu.h +0 -5
- package/React/CoreModules/RCTDevMenu.mm +29 -60
- package/React/CoreModules/RCTDevSettings.h +12 -2
- package/React/CoreModules/RCTDevSettings.mm +96 -53
- package/React/CoreModules/RCTDevSplitBundleLoader.mm +3 -8
- package/React/CoreModules/RCTDeviceInfo.mm +4 -5
- package/React/CoreModules/RCTEventDispatcher.h +2 -1
- package/React/CoreModules/RCTEventDispatcher.mm +23 -25
- package/React/CoreModules/RCTKeyboardObserver.mm +1 -1
- package/React/CoreModules/RCTLogBox.mm +14 -10
- package/React/CoreModules/RCTPerfMonitor.mm +15 -4
- package/React/CoreModules/RCTRedBox.mm +3 -12
- package/React/CoreModules/RCTSourceCode.mm +2 -1
- package/React/CoreModules/RCTTiming.h +2 -1
- package/React/CoreModules/RCTTiming.mm +1 -3
- package/React/CoreModules/RCTWebSocketExecutor.mm +6 -0
- package/React/CoreModules/React-CoreModules.podspec +3 -3
- package/React/CxxBridge/RCTCxxBridge.mm +93 -33
- package/React/CxxModule/RCTNativeModule.mm +3 -1
- package/React/DevSupport/RCTPackagerConnection.h +3 -0
- package/React/DevSupport/RCTPackagerConnection.mm +19 -8
- package/{Libraries → React}/FBReactNativeSpec/FBReactNativeSpec.podspec +15 -8
- package/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.h +2 -1
- package/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +5 -10
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +4 -2
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +1 -3
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +7 -0
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +3 -1
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +62 -20
- package/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h +0 -1
- package/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm +0 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +5 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +135 -87
- package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +23 -0
- package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm +22 -0
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm +14 -9
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +104 -16
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +53 -17
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +48 -2
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +6 -0
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +122 -8
- package/React/Fabric/Mounting/RCTComponentViewFactory.h +10 -2
- package/React/Fabric/Mounting/RCTComponentViewFactory.mm +83 -46
- package/React/Fabric/Mounting/RCTComponentViewProtocol.h +3 -0
- package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +1 -12
- package/React/Fabric/Mounting/RCTMountingManager.h +22 -1
- package/React/Fabric/Mounting/RCTMountingManager.mm +57 -3
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +4 -0
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +30 -4
- package/React/Fabric/RCTConversions.h +3 -0
- package/React/Fabric/RCTScheduler.h +8 -16
- package/React/Fabric/RCTScheduler.mm +36 -54
- package/React/Fabric/RCTSurfacePresenter.h +8 -16
- package/React/Fabric/RCTSurfacePresenter.mm +49 -170
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +4 -2
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm +1 -1
- package/React/Fabric/RCTSurfaceRegistry.h +1 -1
- package/React/Fabric/Surface/RCTFabricSurface.h +2 -6
- package/React/Fabric/Surface/RCTFabricSurface.mm +132 -129
- package/React/Modules/RCTEventEmitter.h +1 -2
- package/React/Modules/RCTEventEmitter.m +8 -11
- package/React/Modules/RCTI18nUtil.h +14 -6
- package/React/Modules/RCTI18nUtil.m +1 -47
- package/React/Modules/RCTUIManager.m +8 -2
- package/React/Profiler/RCTProfileTrampoline-arm.S +1 -1
- package/React/Profiler/RCTProfileTrampoline-arm64.S +2 -2
- package/React/React-RCTFabric.podspec +5 -5
- package/React/Tests/Text/RCTParagraphComponentViewTests.mm +63 -0
- package/React/Views/RCTComponentData.h +10 -1
- package/React/Views/RCTComponentData.m +23 -8
- package/React/Views/RCTDatePickerManager.m +33 -0
- package/React/Views/RCTFont.mm +54 -38
- package/React/Views/RCTModalHostView.h +5 -1
- package/React/Views/RCTModalHostView.m +52 -20
- package/React/Views/RCTModalHostViewManager.m +5 -0
- package/React/Views/RCTView.h +7 -7
- package/React/Views/RCTView.m +32 -49
- package/React/Views/RCTViewManager.m +22 -4
- package/React/Views/RCTWeakViewHolder.h +19 -0
- package/React/Views/RefreshControl/RCTRefreshControl.m +26 -0
- package/React/Views/RefreshControl/RCTRefreshControlManager.m +1 -0
- package/React/Views/SafeAreaView/RCTSafeAreaView.m +1 -5
- package/React/Views/ScrollView/RCTScrollView.h +1 -0
- package/React/Views/ScrollView/RCTScrollView.m +123 -36
- package/React/Views/ScrollView/RCTScrollViewManager.m +4 -7
- package/React/Views/UIView+React.m +2 -11
- package/React/third-party.xcconfig +1 -1
- package/React-Core.podspec +5 -4
- package/React.podspec +2 -2
- package/ReactAndroid/Android-prebuilt.mk +19 -3
- package/ReactAndroid/README.md +2 -2
- package/ReactAndroid/build.gradle +137 -25
- package/ReactAndroid/gradle.properties +7 -5
- package/ReactAndroid/src/androidTest/buck-runner/BUCK +1 -0
- package/ReactAndroid/src/androidTest/java/com/facebook/react/testing/BUCK +1 -1
- package/ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactAppInstrumentationTestCase.java +1 -1
- package/ReactAndroid/src/androidTest/java/com/facebook/react/testing/idledetection/BUCK +1 -1
- package/ReactAndroid/src/androidTest/java/com/facebook/react/testing/idledetection/ReactIdleDetectionUtil.java +1 -1
- package/ReactAndroid/src/androidTest/java/com/facebook/react/testing/rule/BUCK +5 -5
- package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/BUCK +0 -2
- package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/BUCK +5 -5
- package/ReactAndroid/src/androidTest/js/BUCK +26 -0
- package/ReactAndroid/src/androidTest/js/TestBundle.js +0 -12
- package/ReactAndroid/src/androidTest/js/UIManagerTestModule.js +7 -6
- package/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/Android.mk +2 -2
- package/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk +4 -4
- package/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/HermesExecutorFactory.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/RuntimeConfig.java +0 -6
- package/ReactAndroid/src/main/java/com/facebook/proguard/annotations/BUCK +2 -2
- package/ReactAndroid/src/main/java/com/facebook/proguard/annotations/proguard_annotations.pro +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/BUCK +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.java +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactFragment.java +6 -2
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +184 -92
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +37 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +21 -1
- package/ReactAndroid/src/main/java/com/facebook/react/{turbomodule/core/ReactPackageTurboModuleManagerDelegate.java → ReactPackageTurboModuleManagerDelegate.java} +2 -3
- package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +40 -28
- package/ReactAndroid/src/main/java/com/facebook/react/animated/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java +10 -2
- package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java +5 -5
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/BackgroundExecutor.java +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseJavaModule.java +7 -5
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +11 -3
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CxxModuleWrapperBase.java +4 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleRegistry.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaModuleWrapper.java +37 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModule.java +8 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.java +26 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +46 -8
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContextBaseJavaModule.java +2 -3
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactCxxErrorHandler.java +39 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java +7 -3
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/{ReactSoftException.java → ReactSoftExceptionLogger.java} +8 -3
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/RuntimeScheduler.java +21 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/SoftAssertions.java +8 -7
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java +10 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/BUCK +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/BUCK +29 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.java +347 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBufferSoLoader.java +33 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/Android.mk +39 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/BUCK +34 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/OnLoad.cpp +15 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.cpp +76 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/react/common/mapbuffer/ReadableMapBuffer.h +51 -0
- package/ReactAndroid/src/main/java/com/facebook/react/config/BUCK +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +61 -29
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.java +275 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DefaultDevSupportManagerFactory.java +97 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevLoadingViewController.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java +9 -58
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +189 -352
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerFactory.java +4 -73
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DisabledDevSupportManager.java +13 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/LogBoxModule.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/PackagerStatusCheck.java +100 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/{ReactInstanceManagerDevHelper.java → ReactInstanceDevHelper.java} +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/RedBoxHandler.java +2 -16
- package/ReactAndroid/src/main/java/com/facebook/react/{modules/datepicker/DatePickerMode.java → devsupport/interfaces/BundleLoadCallback.java} +3 -6
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSupportManager.java +6 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/ErrorType.java +23 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/Binding.java +15 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricComponents.java +4 -3
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java +9 -64
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +317 -393
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/StateWrapperImpl.java +40 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/SurfaceHandler.java +50 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/SurfaceHandlerBinding.java +131 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/EventEmitterWrapper.java +36 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/FabricEventEmitter.java +14 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk +5 -3
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.cpp +69 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.h +40 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +308 -103
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h +33 -8
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/CoreComponentsRegistry.cpp +3 -6
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/EventEmitterWrapper.cpp +22 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/EventEmitterWrapper.h +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/OnLoad.cpp +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/StateWrapperImpl.cpp +16 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/StateWrapperImpl.h +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/SurfaceHandlerBinding.cpp +122 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/SurfaceHandlerBinding.h +68 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java +414 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.java +134 -71
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +247 -40
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java +4 -6
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/PreAllocateViewMountItem.java +13 -6
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/SendAccessibilityEvent.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/Android.mk +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/jstasks/HeadlessJsTaskContext.java +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/AccessibilityInfoModule.java +21 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appstate/AppStateModule.java +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appstate/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobProvider.java +35 -7
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/Android.mk +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/bundleloader/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/camera/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/{JavaScriptTimerManager.java → JavaScriptTimerExecutor.java} +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java +7 -7
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.java +7 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/AnimationsDebugModule.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/DeviceInfoModule.java +19 -8
- package/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/DialogModule.java +12 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/FrescoModule.java +10 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/BUCK +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nManagerModule.java +19 -13
- package/ReactAndroid/src/main/java/com/facebook/react/modules/image/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java +23 -19
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java +1 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/OkHttpClientProvider.java +1 -18
- package/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/share/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/sound/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/storage/AsyncStorageModule.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/storage/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/BUCK +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/toast/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/vibration/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java +11 -9
- package/ReactAndroid/src/main/java/com/facebook/react/reactperflogger/jni/Android.mk +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/reactperflogger/jni/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK +0 -2
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +0 -9
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/BUCK +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java +9 -6
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManagerDelegate.java +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/TurboModule.java +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/Android.mk +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/BUCK +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManager.cpp +40 -7
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManager.h +10 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BUCK +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +15 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ComponentNameResolver.java +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ComponentNameResolverManager.java +41 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/DisplayMetricsHolder.java +7 -28
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/FabricViewStateManager.java +2 -11
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.java +14 -5
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +4 -13
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java +10 -13
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/OnLayoutEvent.java +17 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/PixelUtil.java +1 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java +16 -10
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactClippingProhibitedView.java +26 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactClippingViewGroupHelper.java +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactOverflowView.java +25 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/RootViewUtil.java +18 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/StateWrapper.java +21 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.java +162 -66
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +4 -8
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementationProvider.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java +29 -20
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +15 -17
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +13 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +7 -4
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerRegistry.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerResolver.java +26 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java +16 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/ContentSizeChangeEvent.java +8 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java +100 -8
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/LockFreeEventDispatcherImpl.java +236 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTModernEventEmitter.java +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/ReactEventEmitter.java +21 -7
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchEvent.java +58 -4
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/interfaces/ViewProps.java +10 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/Android.mk +37 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/BUCK +41 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/ComponentNameResolverManager.cpp +77 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/ComponentNameResolverManager.h +54 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/OnLoad.cpp +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayoutManager.java +12 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerClosedEvent.java +9 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerOpenedEvent.java +9 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerSlideEvent.java +7 -13
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerStateChangedEvent.java +7 -13
- package/ReactAndroid/src/main/java/com/facebook/react/views/image/ImageLoadEvent.java +2 -16
- package/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java +10 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/BUCK +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java +12 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java +23 -12
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/RequestCloseEvent.java +12 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ShowEvent.java +12 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/BUCK +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollContainerView.java +29 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +184 -24
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java +9 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +109 -12
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.java +18 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java +9 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEvent.java +37 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/slider/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderEvent.java +0 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderManager.java +5 -7
- package/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSlidingCompleteEvent.java +13 -16
- package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/RefreshEvent.java +12 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/switchview/BUCK +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitch.java +13 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchEvent.java +9 -13
- package/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.java +6 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/BUCK +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/CustomStyleSpan.java +6 -8
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactClickableSpan.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactFontManager.java +59 -44
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java +0 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +32 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +19 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java +48 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTypefaceUtils.java +41 -59
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +230 -139
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +45 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +616 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TypefaceStyle.java +72 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/BUCK +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactContentSizeChangedEvent.java +3 -13
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +19 -8
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.java +3 -13
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputBlurEvent.java +3 -13
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputEndEditingEvent.java +3 -13
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputEvent.java +3 -13
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputFocusEvent.java +8 -18
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputKeyPressEvent.java +9 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +126 -63
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputSelectionEvent.java +3 -13
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputSubmitEditingEvent.java +8 -18
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/CanvasUtil.java +92 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +39 -8
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +49 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ViewGroupClickEvent.java +11 -4
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java +13 -7
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java +24 -2
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaProps.java +151 -0
- package/ReactAndroid/src/main/jni/first-party/fb/BUCK +4 -0
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp +2 -7
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJTypesVanilla.h +8 -4
- package/ReactAndroid/src/main/jni/react/jni/Android.mk +6 -3
- package/ReactAndroid/src/main/jni/react/jni/BUCK +5 -2
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +61 -0
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +8 -0
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.cpp +18 -0
- package/{ReactCommon/react/renderer/components/picker/iospicker/primitives.h → ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.h} +6 -10
- package/ReactAndroid/src/main/jni/react/jni/JReactSoftExceptionLogger.cpp +21 -0
- package/ReactAndroid/src/main/jni/react/jni/JReactSoftExceptionLogger.h +28 -0
- package/{ReactCommon/react/renderer/components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDialogPickerComponentDescriptor.h → ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.cpp} +8 -7
- package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.h +30 -0
- package/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp +0 -94
- package/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.h +0 -30
- package/ReactAndroid/src/main/jni/react/jni/ProxyExecutor.h +1 -0
- package/ReactAndroid/src/main/jni/third-party/boost/Android.mk +7 -2
- package/ReactAndroid/src/main/jni/third-party/boost/asm/arm/jump_arm_aapcs_elf_gas.S +86 -0
- package/ReactAndroid/src/main/jni/third-party/boost/asm/arm/make_arm_aapcs_elf_gas.S +79 -0
- package/ReactAndroid/src/main/jni/third-party/boost/asm/arm/ontop_arm_aapcs_elf_gas.S +91 -0
- package/ReactAndroid/src/main/jni/third-party/boost/asm/arm64/jump_arm64_aapcs_elf_gas.S +114 -0
- package/ReactAndroid/src/main/jni/third-party/boost/asm/arm64/make_arm64_aapcs_elf_gas.S +85 -0
- package/ReactAndroid/src/main/jni/third-party/boost/asm/arm64/ontop_arm64_aapcs_elf_gas.S +113 -0
- package/ReactAndroid/src/main/jni/third-party/boost/asm/x86/jump_i386_sysv_elf_gas.S +78 -0
- package/ReactAndroid/src/main/jni/third-party/boost/asm/x86/make_i386_sysv_elf_gas.S +106 -0
- package/ReactAndroid/src/main/jni/third-party/boost/asm/x86/ontop_i386_sysv_elf_gas.S +85 -0
- package/ReactAndroid/src/main/jni/third-party/boost/asm/x86_64/jump_x86_64_sysv_elf_gas.S +76 -0
- package/ReactAndroid/src/main/jni/third-party/boost/asm/x86_64/make_x86_64_sysv_elf_gas.S +81 -0
- package/ReactAndroid/src/main/jni/third-party/boost/asm/x86_64/ontop_x86_64_sysv_elf_gas.S +79 -0
- package/ReactAndroid/src/main/jni/third-party/fmt/Android.mk +15 -0
- package/ReactAndroid/src/main/jni/third-party/folly/Android.mk +36 -16
- package/ReactAndroid/src/main/jni/third-party/libevent/Android.mk +36 -0
- package/ReactAndroid/src/main/jni/third-party/libevent/evconfig-private.h +49 -0
- package/{third-party-podspecs/libevent.podspec → ReactAndroid/src/main/jni/third-party/libevent/event-config.h} +141 -366
- package/ReactAndroid/src/main/libraries/fbjni/BUCK +2 -2
- package/ReactAndroid/src/main/libraries/fresco/fresco-react-native/BUCK +26 -26
- package/ReactAndroid/src/main/libraries/soloader/java/com/facebook/soloader/BUCK +5 -5
- package/ReactAndroid/src/main/res/devsupport/values/strings.xml +2 -1
- package/ReactAndroid/src/main/res/views/uimanager/values/strings_unlocalized.xml +4 -8
- package/ReactAndroid/src/main/third-party/android/androidx/BUCK +63 -2
- package/ReactAndroid/src/main/third-party/java/infer-annotations/BUCK +2 -2
- package/ReactAndroid/src/main/third-party/java/okhttp/BUCK +29 -9
- package/ReactAndroid/src/main/third-party/java/okio/BUCK +15 -5
- package/ReactAndroid/src/main/third-party/java/robolectric/{4.4/BUCK → BUCK} +0 -0
- package/ReactAndroid/src/main/third-party/java/testing-support-lib/BUCK +0 -31
- package/ReactAndroid/src/main/third-party/kotlin/BUCK +91 -0
- package/ReactAndroid/src/test/java/com/facebook/react/RootViewTest.java +8 -3
- package/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.java +1 -1
- package/ReactAndroid/src/test/java/com/facebook/react/bridge/BUCK +1 -1
- package/ReactAndroid/src/test/java/com/facebook/react/bridge/ReactTestHelper.java +1 -0
- package/ReactAndroid/src/test/java/com/facebook/react/devsupport/JSDebuggerWebSocketClientTest.java +3 -1
- package/ReactAndroid/src/test/java/com/facebook/react/modules/BUCK +1 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java +168 -0
- package/ReactAndroid/src/test/java/com/facebook/react/modules/dialog/DialogModuleTest.java +1 -1
- package/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkingModuleTest.java +10 -10
- package/ReactAndroid/src/test/java/com/facebook/react/modules/timing/TimingModuleTest.java +1 -1
- package/ReactAndroid/src/test/java/com/facebook/react/uimanager/BaseViewManagerTest.java +32 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/image/ReactImagePropertyTest.java +8 -0
- package/ReactAndroid/src/test/java/com/facebook/react/views/textinput/ReactTextInputPropertyTest.java +4 -0
- package/ReactCommon/React-Fabric.podspec +58 -14
- package/ReactCommon/ReactCommon.podspec +8 -3
- package/ReactCommon/better/Android.mk +1 -1
- package/ReactCommon/better/BUCK +2 -2
- package/ReactCommon/callinvoker/Android.mk +1 -1
- package/ReactCommon/callinvoker/BUCK +3 -3
- package/ReactCommon/callinvoker/React-callinvoker.podspec +3 -3
- package/ReactCommon/cxxreact/Android.mk +2 -1
- package/ReactCommon/cxxreact/BUCK +2 -4
- package/ReactCommon/cxxreact/CxxNativeModule.cpp +28 -0
- package/ReactCommon/cxxreact/CxxNativeModule.h +9 -0
- package/ReactCommon/cxxreact/Instance.cpp +21 -1
- package/ReactCommon/cxxreact/MethodCall.cpp +2 -2
- package/ReactCommon/cxxreact/ModuleRegistry.cpp +5 -0
- package/ReactCommon/cxxreact/NativeToJsBridge.cpp +0 -21
- package/ReactCommon/cxxreact/NativeToJsBridge.h +0 -6
- package/ReactCommon/cxxreact/React-cxxreact.podspec +5 -4
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/React-hermes.podspec +5 -5
- package/ReactCommon/hermes/executor/Android.mk +4 -4
- package/ReactCommon/hermes/inspector/Android.mk +1 -2
- package/ReactCommon/hermes/inspector/BUCK +8 -5
- package/ReactCommon/hermes/inspector/chrome/Connection.cpp +115 -0
- package/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp +215 -1
- package/ReactCommon/hermes/inspector/chrome/MessageTypes.h +115 -1
- package/ReactCommon/hermes/inspector/chrome/tests/ConnectionTests.cpp +144 -0
- package/ReactCommon/hermes/inspector/tools/message_types.txt +4 -0
- package/ReactCommon/hermes/inspector/tools/msggen/__tests__/CommandTest.js +1 -3
- package/ReactCommon/hermes/inspector/tools/msggen/__tests__/EventTest.js +1 -3
- package/ReactCommon/hermes/inspector/tools/msggen/__tests__/GraphTest.js +1 -3
- package/ReactCommon/hermes/inspector/tools/msggen/__tests__/HeaderWriterTest.js +1 -3
- package/ReactCommon/hermes/inspector/tools/msggen/__tests__/ImplementationWriterTest.js +1 -3
- package/ReactCommon/hermes/inspector/tools/msggen/__tests__/PropertyTest.js +1 -3
- package/ReactCommon/hermes/inspector/tools/msggen/__tests__/TypeTest.js +1 -3
- package/ReactCommon/hermes/inspector/tools/msggen/package.json +8 -5
- package/ReactCommon/hermes/inspector/tools/msggen/src/Command.js +0 -2
- package/ReactCommon/hermes/inspector/tools/msggen/src/Converters.js +0 -2
- package/ReactCommon/hermes/inspector/tools/msggen/src/Event.js +0 -2
- package/ReactCommon/hermes/inspector/tools/msggen/src/Graph.js +0 -2
- package/ReactCommon/hermes/inspector/tools/msggen/src/HeaderWriter.js +0 -2
- package/ReactCommon/hermes/inspector/tools/msggen/src/ImplementationWriter.js +0 -2
- package/ReactCommon/hermes/inspector/tools/msggen/src/Property.js +1 -2
- package/ReactCommon/hermes/inspector/tools/msggen/src/TestHelpers.js +1 -3
- package/ReactCommon/hermes/inspector/tools/msggen/src/Type.js +0 -2
- package/ReactCommon/hermes/inspector/tools/msggen/src/index.js +1 -3
- package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +2246 -1419
- package/ReactCommon/jsi/Android.mk +1 -1
- package/ReactCommon/jsi/BUCK +1 -3
- package/ReactCommon/jsi/JSCRuntime.cpp +7 -0
- package/ReactCommon/jsi/React-jsi.podspec +4 -4
- package/ReactCommon/jsi/jsi/CMakeLists.txt +1 -1
- package/ReactCommon/jsi/jsi/decorator.h +15 -0
- package/ReactCommon/jsi/jsi/instrumentation.h +13 -0
- package/ReactCommon/jsi/jsi/jsi.cpp +3 -0
- package/ReactCommon/jsi/jsi/jsi.h +31 -2
- package/ReactCommon/jsi/jsi/jsilib-posix.cpp +1 -11
- package/ReactCommon/jsiexecutor/Android.mk +2 -2
- package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +3 -3
- package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +36 -3
- package/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +2 -0
- package/ReactCommon/jsinspector/BUCK +2 -0
- package/ReactCommon/jsinspector/React-jsinspector.podspec +1 -1
- package/ReactCommon/logger/Android.mk +23 -0
- package/ReactCommon/logger/BUCK +43 -0
- package/ReactCommon/logger/React-logger.podspec +40 -0
- package/ReactCommon/logger/react_native_log.cpp +52 -0
- package/ReactCommon/logger/react_native_log.h +33 -0
- package/ReactCommon/react/config/Android.mk +1 -1
- package/ReactCommon/react/config/BUCK +1 -1
- package/ReactCommon/react/debug/Android.mk +31 -0
- package/ReactCommon/react/debug/BUCK +69 -0
- package/ReactCommon/react/debug/flags.h +19 -0
- package/ReactCommon/react/debug/react_native_assert.cpp +45 -0
- package/ReactCommon/react/debug/react_native_assert.h +64 -0
- package/ReactCommon/react/nativemodule/core/Android.mk +3 -3
- package/ReactCommon/react/nativemodule/core/BUCK +3 -3
- package/ReactCommon/react/nativemodule/core/ReactCommon/LongLivedObject.cpp +1 -0
- package/ReactCommon/react/nativemodule/core/ReactCommon/LongLivedObject.h +3 -2
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.cpp +1 -1
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp +46 -1
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.h +10 -0
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +55 -1
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +76 -42
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.h +11 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/RCTBlockGuard.h +24 -0
- package/ReactCommon/react/nativemodule/core/platform/ios/RCTBlockGuard.mm +28 -0
- package/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.h +7 -16
- package/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm +79 -32
- package/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.h +0 -7
- package/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm +123 -127
- package/ReactCommon/react/nativemodule/samples/BUCK +4 -5
- package/ReactCommon/react/nativemodule/samples/platform/android/Android.mk +2 -2
- package/ReactCommon/react/nativemodule/samples/platform/ios/RCTSampleTurboCxxModule.mm +12 -0
- package/ReactCommon/react/nativemodule/samples/platform/ios/RCTSampleTurboModule.mm +0 -2
- package/ReactCommon/react/renderer/animations/Android.mk +3 -2
- package/ReactCommon/react/renderer/animations/BUCK +6 -3
- package/ReactCommon/react/renderer/animations/LayoutAnimationCallbackWrapper.h +34 -0
- package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp +11 -66
- package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.h +8 -13
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +1117 -1147
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +98 -243
- package/ReactCommon/react/renderer/animations/conversions.h +212 -0
- package/ReactCommon/react/renderer/animations/primitives.h +104 -0
- package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +544 -0
- package/ReactCommon/react/renderer/animations/utils.cpp +71 -0
- package/ReactCommon/react/renderer/animations/utils.h +80 -0
- package/ReactCommon/react/renderer/attributedstring/Android.mk +4 -2
- package/ReactCommon/react/renderer/attributedstring/AttributedString.h +0 -1
- package/ReactCommon/react/renderer/attributedstring/AttributedStringBox.cpp +28 -6
- package/ReactCommon/react/renderer/attributedstring/AttributedStringBox.h +2 -2
- package/ReactCommon/react/renderer/attributedstring/BUCK +9 -4
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +7 -3
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +12 -2
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +7 -2
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +3 -1
- package/ReactCommon/react/renderer/attributedstring/conversions.h +718 -305
- package/ReactCommon/react/renderer/attributedstring/primitives.h +34 -1
- package/ReactCommon/react/renderer/attributedstring/tests/AttributedStringBoxTest.cpp +105 -0
- package/ReactCommon/react/renderer/attributedstring/tests/AttributedStringTest.cpp +17 -20
- package/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp +7 -12
- package/ReactCommon/react/renderer/attributedstring/tests/TextAttributesTest.cpp +13 -15
- package/ReactCommon/react/renderer/componentregistry/Android.mk +3 -2
- package/ReactCommon/react/renderer/componentregistry/BUCK +5 -4
- package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorProviderRegistry.cpp +2 -2
- package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h +1 -0
- package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +17 -67
- package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.h +4 -1
- package/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.cpp +73 -0
- package/ReactCommon/react/renderer/{components/picker/iospicker/PickerShadowNode.cpp → componentregistry/componentNameByReactViewName.h} +7 -2
- package/ReactCommon/react/renderer/componentregistry/native/Android.mk +29 -0
- package/ReactCommon/react/renderer/componentregistry/native/BUCK +58 -0
- package/ReactCommon/react/renderer/componentregistry/native/NativeComponentRegistryBinding.cpp +68 -0
- package/ReactCommon/react/renderer/componentregistry/native/NativeComponentRegistryBinding.h +61 -0
- package/ReactCommon/react/renderer/components/image/Android.mk +5 -3
- package/ReactCommon/react/renderer/components/image/BUCK +7 -3
- package/ReactCommon/react/renderer/components/image/ImageComponentDescriptor.h +3 -2
- package/ReactCommon/react/renderer/components/image/ImageProps.cpp +28 -9
- package/ReactCommon/react/renderer/components/image/ImageProps.h +5 -1
- package/ReactCommon/react/renderer/components/image/ImageState.h +9 -1
- package/ReactCommon/react/renderer/components/image/conversions.h +29 -18
- package/ReactCommon/react/renderer/components/inputaccessory/BUCK +4 -3
- package/ReactCommon/react/renderer/components/inputaccessory/InputAccessoryComponentDescriptor.h +5 -3
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/BUCK +3 -3
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h +1 -1
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +17 -4
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.cpp +5 -10
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.h +2 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +1 -1
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +69 -12
- package/ReactCommon/react/renderer/components/modal/Android.mk +4 -3
- package/ReactCommon/react/renderer/components/modal/BUCK +6 -2
- package/ReactCommon/react/renderer/components/modal/ModalHostViewComponentDescriptor.h +5 -3
- package/ReactCommon/react/renderer/components/modal/ModalHostViewState.h +6 -0
- package/ReactCommon/react/renderer/components/progressbar/Android.mk +3 -3
- package/ReactCommon/react/renderer/components/progressbar/BUCK +4 -3
- package/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarComponentDescriptor.h +4 -2
- package/ReactCommon/react/renderer/components/root/Android.mk +4 -3
- package/ReactCommon/react/renderer/components/root/BUCK +4 -3
- package/ReactCommon/react/renderer/components/root/RootProps.cpp +12 -2
- package/ReactCommon/react/renderer/components/root/RootProps.h +6 -1
- package/ReactCommon/react/renderer/components/root/RootShadowNode.cpp +7 -1
- package/ReactCommon/react/renderer/components/root/RootShadowNode.h +2 -0
- package/ReactCommon/react/renderer/components/root/tests/RootShadowNodeTest.cpp +35 -3
- package/ReactCommon/react/renderer/components/safeareaview/BUCK +4 -3
- package/ReactCommon/react/renderer/components/safeareaview/SafeAreaViewComponentDescriptor.h +5 -3
- package/ReactCommon/react/renderer/components/scrollview/Android.mk +5 -3
- package/ReactCommon/react/renderer/components/scrollview/BUCK +6 -3
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp +59 -6
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h +10 -5
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp +23 -2
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.h +1 -0
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewState.cpp +1 -1
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewState.h +12 -2
- package/ReactCommon/react/renderer/components/scrollview/conversions.h +5 -0
- package/ReactCommon/react/renderer/components/slider/Android.mk +4 -3
- package/ReactCommon/react/renderer/components/slider/BUCK +5 -3
- package/ReactCommon/react/renderer/components/slider/SliderComponentDescriptor.h +4 -2
- package/ReactCommon/react/renderer/components/slider/SliderState.h +8 -0
- package/ReactCommon/react/renderer/components/slider/platform/ios/SliderMeasurementsManager.cpp +3 -1
- package/ReactCommon/react/renderer/components/switch/Android.mk +3 -3
- package/ReactCommon/react/renderer/components/switch/BUCK +3 -3
- package/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchComponentDescriptor.h +4 -2
- package/ReactCommon/react/renderer/components/text/Android.mk +5 -3
- package/ReactCommon/react/renderer/components/text/BUCK +10 -4
- package/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +32 -0
- package/ReactCommon/react/renderer/components/text/BaseTextProps.h +5 -1
- package/ReactCommon/react/renderer/components/text/BaseTextShadowNode.cpp +2 -3
- package/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.h +5 -24
- package/ReactCommon/react/renderer/components/text/ParagraphProps.cpp +15 -6
- package/ReactCommon/react/renderer/components/text/ParagraphProps.h +5 -1
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp +9 -16
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +7 -6
- package/ReactCommon/react/renderer/components/text/ParagraphState.cpp +4 -0
- package/ReactCommon/react/renderer/components/text/ParagraphState.h +8 -3
- package/ReactCommon/react/renderer/components/text/RawTextProps.cpp +3 -2
- package/ReactCommon/react/renderer/components/text/RawTextProps.h +5 -1
- package/ReactCommon/react/renderer/components/text/RawTextShadowNode.h +36 -2
- package/ReactCommon/react/renderer/components/text/TextProps.cpp +6 -3
- package/ReactCommon/react/renderer/components/text/TextProps.h +5 -1
- package/ReactCommon/react/renderer/components/text/TextShadowNode.h +23 -0
- package/ReactCommon/react/renderer/components/text/conversions.h +22 -0
- package/ReactCommon/react/renderer/components/text/tests/ParagraphLocalDataTest.cpp +8 -5
- package/ReactCommon/react/renderer/components/textinput/Android.mk +5 -3
- package/ReactCommon/react/renderer/components/textinput/BUCK +8 -4
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputComponentDescriptor.h +8 -5
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp +58 -91
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.h +10 -6
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.cpp +2 -8
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h +5 -5
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.cpp +0 -3
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.h +5 -8
- package/ReactCommon/react/renderer/components/textinput/iostextinput/BUCK +5 -4
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputComponentDescriptor.h +4 -2
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp +46 -22
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.h +6 -5
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputShadowNode.cpp +3 -2
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputShadowNode.h +6 -6
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputState.h +2 -0
- package/ReactCommon/react/renderer/components/textinput/iostextinput/conversions.h +19 -7
- package/ReactCommon/react/renderer/components/textinput/iostextinput/primitives.h +6 -0
- package/ReactCommon/react/renderer/components/textinput/iostextinput/propsConversions.h +63 -2
- package/ReactCommon/react/renderer/components/unimplementedview/Android.mk +4 -3
- package/ReactCommon/react/renderer/components/unimplementedview/BUCK +4 -3
- package/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp +8 -3
- package/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.h +5 -2
- package/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewProps.h +1 -0
- package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +28 -0
- package/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +24 -1
- package/ReactCommon/react/renderer/components/view/AccessibilityProps.h +4 -1
- package/ReactCommon/react/renderer/components/view/Android.mk +6 -4
- package/ReactCommon/react/renderer/components/view/BUCK +5 -3
- package/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +19 -5
- package/ReactCommon/react/renderer/components/view/TouchEventEmitter.h +2 -1
- package/ReactCommon/react/renderer/components/view/ViewComponentDescriptor.h +0 -22
- package/ReactCommon/react/renderer/components/view/ViewEventEmitter.cpp +1 -1
- package/ReactCommon/react/renderer/components/view/ViewProps.cpp +62 -14
- package/ReactCommon/react/renderer/components/view/ViewProps.h +7 -1
- package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +5 -8
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +5 -19
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +1 -1
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +147 -78
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.h +4 -9
- package/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +3 -2
- package/ReactCommon/react/renderer/components/view/YogaStylableProps.h +2 -0
- package/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +99 -24
- package/ReactCommon/react/renderer/components/view/conversions.h +89 -45
- package/ReactCommon/react/renderer/components/view/primitives.h +5 -4
- package/ReactCommon/react/renderer/components/view/propsConversions.h +163 -28
- package/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp +11 -2
- package/ReactCommon/react/renderer/core/Android.mk +4 -2
- package/ReactCommon/react/renderer/core/BUCK +7 -4
- package/ReactCommon/react/renderer/core/BatchedEventQueue.cpp +2 -34
- package/ReactCommon/react/renderer/core/BatchedEventQueue.h +2 -9
- package/ReactCommon/react/renderer/core/ComponentDescriptor.h +6 -3
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +28 -27
- package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +11 -5
- package/ReactCommon/react/renderer/core/ConcreteState.h +7 -3
- package/ReactCommon/react/renderer/core/DynamicPropsUtilities.cpp +35 -0
- package/ReactCommon/react/renderer/{components/picker/iospicker/PickerState.h → core/DynamicPropsUtilities.h} +5 -4
- package/ReactCommon/react/renderer/core/EventDispatcher.cpp +9 -15
- package/ReactCommon/react/renderer/core/EventDispatcher.h +5 -10
- package/ReactCommon/react/renderer/core/EventEmitter.cpp +22 -12
- package/ReactCommon/react/renderer/core/EventEmitter.h +7 -2
- package/ReactCommon/react/renderer/core/EventPipe.h +2 -0
- package/ReactCommon/react/renderer/core/EventPriority.h +1 -1
- package/ReactCommon/react/renderer/core/EventQueue.cpp +39 -36
- package/ReactCommon/react/renderer/core/EventQueue.h +14 -8
- package/ReactCommon/react/renderer/core/EventQueueProcessor.cpp +82 -0
- package/ReactCommon/react/renderer/core/EventQueueProcessor.h +36 -0
- package/ReactCommon/react/renderer/core/EventTarget.cpp +4 -2
- package/ReactCommon/react/renderer/core/LayoutConstraints.h +6 -0
- package/ReactCommon/react/renderer/core/LayoutMetrics.cpp +65 -0
- package/ReactCommon/react/renderer/core/LayoutMetrics.h +35 -2
- package/ReactCommon/react/renderer/core/LayoutPrimitives.h +14 -6
- package/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp +1 -1
- package/ReactCommon/react/renderer/core/LayoutableShadowNode.h +2 -7
- package/ReactCommon/react/renderer/core/Props.cpp +10 -2
- package/ReactCommon/react/renderer/core/Props.h +6 -1
- package/ReactCommon/react/renderer/core/PropsParserContext.h +29 -0
- package/ReactCommon/react/renderer/core/RawEvent.cpp +4 -2
- package/ReactCommon/react/renderer/core/RawEvent.h +40 -3
- package/ReactCommon/react/renderer/core/RawProps.cpp +5 -3
- package/ReactCommon/react/renderer/core/RawProps.h +3 -1
- package/ReactCommon/react/renderer/core/RawPropsKey.cpp +18 -7
- package/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +8 -6
- package/ReactCommon/react/renderer/core/RawPropsParser.cpp +10 -7
- package/ReactCommon/react/renderer/core/RawPropsParser.h +11 -2
- package/ReactCommon/react/renderer/core/RawValue.h +9 -7
- package/ReactCommon/react/renderer/core/ReactEventPriority.h +43 -0
- package/ReactCommon/react/renderer/core/ReactPrimitives.h +34 -2
- package/ReactCommon/react/renderer/core/Sealable.cpp +4 -3
- package/ReactCommon/react/renderer/core/Sealable.h +5 -1
- package/ReactCommon/react/renderer/core/ShadowNode.cpp +42 -13
- package/ReactCommon/react/renderer/core/ShadowNode.h +14 -4
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp +2 -1
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +2 -1
- package/ReactCommon/react/renderer/core/ShadowNodeTraits.h +17 -1
- package/ReactCommon/react/renderer/core/State.h +3 -0
- package/ReactCommon/react/renderer/core/StateData.h +3 -0
- package/ReactCommon/react/renderer/core/propsConversions.h +19 -9
- package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +16 -4
- package/ReactCommon/react/renderer/core/tests/ConcreteShadowNodeTest.cpp +1 -1
- package/ReactCommon/react/renderer/core/tests/DynamicPropsUtilitiesTest.cpp +66 -0
- package/ReactCommon/react/renderer/core/tests/EventQueueProcessorTest.cpp +134 -0
- package/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp +99 -30
- package/ReactCommon/react/renderer/core/tests/TestComponent.h +11 -7
- package/ReactCommon/react/renderer/core/tests/traitCastTest.cpp +31 -0
- package/ReactCommon/react/renderer/debug/Android.mk +1 -1
- package/ReactCommon/react/renderer/debug/BUCK +4 -6
- package/ReactCommon/react/renderer/debug/DebugStringConvertible.h +11 -25
- package/ReactCommon/react/renderer/debug/flags.h +50 -0
- package/ReactCommon/react/renderer/element/BUCK +3 -3
- package/ReactCommon/react/renderer/graphics/Android.mk +7 -3
- package/ReactCommon/react/renderer/graphics/BUCK +16 -4
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +4 -3
- package/ReactCommon/react/renderer/graphics/Transform.cpp +5 -4
- package/ReactCommon/react/renderer/graphics/Transform.h +1 -1
- package/ReactCommon/react/renderer/graphics/conversions.h +102 -44
- package/ReactCommon/react/renderer/graphics/platform/android/react/renderer/graphics/PlatformColorParser.h +67 -0
- package/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/Color.cpp +14 -6
- package/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/Color.h +2 -0
- package/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/PlatformColorParser.h +29 -0
- package/ReactCommon/react/renderer/graphics/platform/ios/Color.cpp +14 -6
- package/ReactCommon/react/renderer/graphics/platform/ios/Color.h +44 -1
- package/ReactCommon/react/renderer/graphics/platform/ios/PlatformColorParser.h +34 -0
- package/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.h +12 -0
- package/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm +206 -0
- package/ReactCommon/react/renderer/imagemanager/Android.mk +3 -2
- package/ReactCommon/react/renderer/imagemanager/BUCK +5 -4
- package/ReactCommon/react/renderer/imagemanager/ImageResponseObserverCoordinator.cpp +5 -4
- package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h +8 -6
- package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.mm +1 -1
- package/ReactCommon/react/renderer/leakchecker/Android.mk +29 -0
- package/ReactCommon/react/renderer/{components/picker/iospicker → leakchecker}/BUCK +8 -12
- package/ReactCommon/react/renderer/leakchecker/LeakChecker.cpp +60 -0
- package/ReactCommon/react/renderer/leakchecker/LeakChecker.h +39 -0
- package/ReactCommon/react/renderer/leakchecker/WeakFamilyRegistry.cpp +37 -0
- package/ReactCommon/react/renderer/leakchecker/WeakFamilyRegistry.h +39 -0
- package/ReactCommon/react/renderer/mapbuffer/Android.mk +9 -6
- package/ReactCommon/react/renderer/mapbuffer/BUCK +14 -5
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +131 -4
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.h +40 -4
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +226 -0
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h +94 -0
- package/ReactCommon/react/renderer/mapbuffer/primitives.h +91 -0
- package/ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp +141 -5
- package/ReactCommon/react/renderer/mounting/Android.mk +5 -2
- package/ReactCommon/react/renderer/mounting/BUCK +6 -3
- package/ReactCommon/react/renderer/mounting/Differentiator.cpp +794 -620
- package/ReactCommon/react/renderer/mounting/Differentiator.h +31 -4
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +4 -2
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +1 -4
- package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
- package/ReactCommon/react/renderer/mounting/MountingTransaction.h +2 -2
- package/ReactCommon/react/renderer/mounting/MountingTransactionMetadata.h +1 -1
- package/ReactCommon/react/renderer/mounting/ShadowTree.cpp +19 -15
- package/ReactCommon/react/renderer/mounting/ShadowTree.h +11 -4
- package/ReactCommon/react/renderer/mounting/ShadowTreeRegistry.cpp +3 -1
- package/ReactCommon/react/renderer/mounting/ShadowTreeRevision.h +1 -1
- package/ReactCommon/react/renderer/mounting/ShadowView.cpp +15 -1
- package/ReactCommon/react/renderer/mounting/ShadowView.h +45 -2
- package/ReactCommon/react/renderer/mounting/ShadowViewMutation.cpp +28 -0
- package/ReactCommon/react/renderer/mounting/ShadowViewMutation.h +17 -0
- package/ReactCommon/react/renderer/mounting/StubView.cpp +21 -2
- package/ReactCommon/react/renderer/mounting/StubView.h +3 -0
- package/ReactCommon/react/renderer/mounting/StubViewTree.cpp +204 -77
- package/ReactCommon/react/renderer/mounting/TelemetryController.cpp +1 -1
- package/ReactCommon/react/renderer/mounting/TelemetryController.h +1 -1
- package/ReactCommon/react/renderer/mounting/stubs.cpp +5 -4
- package/ReactCommon/react/renderer/mounting/tests/MountingTest.cpp +13 -2
- package/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +232 -9
- package/ReactCommon/react/renderer/mounting/tests/StateReconciliationTest.cpp +18 -8
- package/ReactCommon/react/renderer/runtimescheduler/Android.mk +28 -0
- package/ReactCommon/react/renderer/runtimescheduler/BUCK +77 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +118 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +105 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +171 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.h +44 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.cpp +30 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h +34 -0
- package/ReactCommon/react/renderer/{components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDropdownPickerComponentDescriptor.h → runtimescheduler/RuntimeSchedulerClock.h} +8 -5
- package/ReactCommon/react/renderer/runtimescheduler/SchedulerPriority.h +65 -0
- package/ReactCommon/react/renderer/runtimescheduler/Task.cpp +37 -0
- package/ReactCommon/react/renderer/runtimescheduler/Task.h +48 -0
- package/ReactCommon/react/renderer/runtimescheduler/primitives.h +41 -0
- package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +472 -0
- package/ReactCommon/react/renderer/runtimescheduler/tests/SchedulerPriorityTest.cpp +46 -0
- package/ReactCommon/react/renderer/runtimescheduler/tests/StubClock.h +41 -0
- package/ReactCommon/react/renderer/runtimescheduler/tests/StubQueue.h +38 -0
- package/ReactCommon/react/renderer/scheduler/Android.mk +4 -2
- package/ReactCommon/react/renderer/scheduler/AsynchronousEventBeat.cpp +16 -13
- package/ReactCommon/react/renderer/scheduler/AsynchronousEventBeat.h +4 -4
- package/ReactCommon/react/renderer/scheduler/BUCK +5 -3
- package/ReactCommon/react/renderer/{components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDialogPickerShadowNode.cpp → scheduler/InspectorData.h} +10 -2
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +81 -132
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +32 -35
- package/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h +12 -10
- package/ReactCommon/react/renderer/scheduler/SchedulerToolbox.h +2 -0
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +317 -0
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +209 -0
- package/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp +104 -0
- package/ReactCommon/react/renderer/scheduler/SurfaceManager.h +67 -0
- package/ReactCommon/react/renderer/scheduler/SynchronousEventBeat.cpp +14 -5
- package/ReactCommon/react/renderer/scheduler/SynchronousEventBeat.h +4 -1
- package/ReactCommon/react/renderer/telemetry/Android.mk +31 -0
- package/ReactCommon/react/renderer/telemetry/BUCK +84 -0
- package/ReactCommon/react/renderer/{mounting → telemetry}/SurfaceTelemetry.cpp +5 -0
- package/ReactCommon/react/renderer/{mounting → telemetry}/SurfaceTelemetry.h +3 -1
- package/ReactCommon/react/renderer/telemetry/TransactionTelemetry.cpp +163 -0
- package/ReactCommon/react/renderer/{mounting → telemetry}/TransactionTelemetry.h +11 -0
- package/ReactCommon/react/renderer/telemetry/tests/TransactionTelemetryTest.cpp +176 -0
- package/ReactCommon/react/renderer/templateprocessor/Android.mk +1 -1
- package/ReactCommon/react/renderer/templateprocessor/BUCK +3 -3
- package/ReactCommon/react/renderer/templateprocessor/UITemplateProcessor.cpp +5 -5
- package/ReactCommon/react/renderer/textlayoutmanager/Android.mk +5 -2
- package/ReactCommon/react/renderer/textlayoutmanager/BUCK +5 -3
- package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.cpp +12 -9
- package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +132 -3
- package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.h +17 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +2 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +22 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/TextLayoutManager.mm +25 -3
- package/ReactCommon/react/renderer/{components/picker → timeline}/BUCK +14 -28
- package/ReactCommon/react/renderer/timeline/Timeline.cpp +120 -0
- package/ReactCommon/react/renderer/timeline/Timeline.h +63 -0
- package/ReactCommon/react/renderer/timeline/TimelineController.cpp +77 -0
- package/ReactCommon/react/renderer/timeline/TimelineController.h +80 -0
- package/ReactCommon/react/renderer/timeline/TimelineFrame.cpp +25 -0
- package/ReactCommon/react/renderer/timeline/TimelineFrame.h +46 -0
- package/ReactCommon/react/renderer/timeline/TimelineHandler.cpp +97 -0
- package/ReactCommon/react/renderer/timeline/TimelineHandler.h +80 -0
- package/ReactCommon/react/renderer/timeline/TimelineSnapshot.cpp +30 -0
- package/ReactCommon/react/renderer/timeline/TimelineSnapshot.h +36 -0
- package/ReactCommon/react/renderer/uimanager/Android.mk +4 -2
- package/ReactCommon/react/renderer/uimanager/BUCK +5 -3
- package/ReactCommon/react/renderer/uimanager/LayoutAnimationStatusDelegate.h +2 -4
- package/ReactCommon/react/renderer/uimanager/UIManager.cpp +121 -36
- package/ReactCommon/react/renderer/uimanager/UIManager.h +40 -21
- package/ReactCommon/react/renderer/uimanager/UIManagerAnimationDelegate.h +3 -5
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +201 -77
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.h +29 -6
- package/ReactCommon/react/renderer/uimanager/UIManagerCommitHook.h +2 -4
- package/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h +16 -15
- package/ReactCommon/react/renderer/uimanager/primitives.h +57 -9
- package/ReactCommon/react/test_utils/BUCK +57 -0
- package/ReactCommon/react/{renderer/mounting/tests → test_utils}/Entropy.h +4 -0
- package/ReactCommon/react/test_utils/MockClock.h +29 -0
- package/ReactCommon/react/{renderer/components/picker/iospicker/PickerEventEmitter.h → test_utils/MockSurfaceHandler.h} +6 -9
- package/ReactCommon/react/{renderer/mounting/tests → test_utils}/shadowTreeGeneration.h +61 -5
- package/ReactCommon/react/utils/Android.mk +8 -3
- package/ReactCommon/react/utils/BUCK +9 -2
- package/ReactCommon/react/utils/CalledOnceMovableOnlyFunction.h +6 -4
- package/ReactCommon/react/utils/ContextContainer.h +4 -24
- package/ReactCommon/react/utils/LayoutManager.h +56 -0
- package/ReactCommon/react/utils/ManagedObjectWrapper.h +3 -1
- package/ReactCommon/react/utils/RunLoopObserver.cpp +5 -4
- package/ReactCommon/reactperflogger/Android.mk +1 -1
- package/ReactCommon/reactperflogger/BUCK +1 -1
- package/ReactCommon/reactperflogger/React-perflogger.podspec +2 -2
- package/ReactCommon/runtimeexecutor/Android.mk +1 -1
- package/ReactCommon/runtimeexecutor/BUCK +2 -2
- package/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +2 -2
- package/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h +14 -2
- package/ReactCommon/yoga/Yoga.podspec +1 -1
- package/ReactCommon/yoga/yoga/BitUtils.h +3 -2
- package/ReactCommon/yoga/yoga/Utils.cpp +1 -1
- package/ReactCommon/yoga/yoga/YGNode.cpp +111 -110
- package/ReactCommon/yoga/yoga/YGNode.h +11 -0
- package/ReactCommon/yoga/yoga/YGNodePrint.cpp +7 -4
- package/ReactCommon/yoga/yoga/Yoga-internal.h +4 -5
- package/ReactCommon/yoga/yoga/Yoga.cpp +114 -159
- package/ReactCommon/yoga/yoga/Yoga.h +1 -1
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.aar +0 -0
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.aar.md5 +1 -0
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.aar.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.aar.sha256 +1 -0
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.aar.sha512 +1 -0
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.module +272 -0
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.module.md5 +1 -0
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.module.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.module.sha256 +1 -0
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.module.sha512 +1 -0
- package/android/com/facebook/react/react-native/{0.0.0-201c10733/react-native-0.0.0-201c10733.pom → 0.0.0-268efb102/react-native-0.0.0-268efb102.pom} +24 -13
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.pom.md5 +1 -0
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.pom.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.pom.sha256 +1 -0
- package/android/com/facebook/react/react-native/0.0.0-268efb102/react-native-0.0.0-268efb102.pom.sha512 +1 -0
- package/android/com/facebook/react/react-native/maven-metadata.xml +4 -3
- package/android/com/facebook/react/react-native/maven-metadata.xml.md5 +1 -1
- package/android/com/facebook/react/react-native/maven-metadata.xml.sha1 +1 -1
- package/android/com/facebook/react/react-native/maven-metadata.xml.sha256 +1 -0
- package/android/com/facebook/react/react-native/maven-metadata.xml.sha512 +1 -0
- package/flow/HermesInternalType.js +114 -0
- package/flow/global.js +68 -0
- package/flow-typed/npm/react-test-renderer_v16.x.x.js +79 -0
- package/index.js +122 -60
- package/jest/preprocessor.js +75 -7
- package/jest/renderer.js +3 -9
- package/jest/setup.js +21 -15
- package/package.json +61 -21
- package/react.gradle +47 -25
- package/scripts/find-node.sh +39 -0
- package/scripts/generate-specs-cli.js +20 -2
- package/scripts/ios-configure-glog.sh +4 -0
- package/scripts/react-native-xcode.sh +7 -23
- package/scripts/react_native_pods.rb +215 -47
- package/template/_flowconfig +3 -4
- package/template/_gitignore +1 -0
- package/template/android/app/build.gradle +12 -7
- package/template/android/app/src/main/res/values/styles.xml +0 -1
- package/template/android/build.gradle +7 -8
- package/template/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/template/android/gradle.properties +1 -1
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj +2 -0
- package/template/ios/Podfile +1 -0
- package/template/package.json +4 -5
- package/third-party-podspecs/DoubleConversion.podspec +1 -1
- package/third-party-podspecs/RCT-Folly.podspec +31 -11
- package/third-party-podspecs/boost.podspec +23 -0
- package/third-party-podspecs/glog.podspec +1 -1
- package/Libraries/BUCK +0 -56
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js +0 -169
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js +0 -280
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -89
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
- package/Libraries/Components/Picker/AndroidDialogPickerNativeComponent.js +0 -82
- package/Libraries/Components/Picker/AndroidDialogPickerViewConfig.js +0 -30
- package/Libraries/Components/Picker/AndroidDropdownPickerNativeComponent.js +0 -69
- package/Libraries/Components/Picker/Picker.js +0 -165
- package/Libraries/Components/Picker/PickerAndroid.android.js +0 -145
- package/Libraries/Components/Picker/PickerIOS.android.js +0 -14
- package/Libraries/Components/Picker/PickerIOS.ios.js +0 -164
- package/Libraries/Components/Picker/RCTPickerNativeComponent.js +0 -72
- package/Libraries/Components/Picker/RCTPickerViewConfig.js +0 -41
- package/Libraries/Components/ScrollResponder.js +0 -797
- package/Libraries/Components/StaticContainer.react.js +0 -51
- package/Libraries/Components/StatusBar/StatusBarIOS.js +0 -35
- package/Libraries/Components/Touchable/ensurePositiveDelayProps.js +0 -26
- package/Libraries/Interaction/InteractionMixin.js +0 -55
- package/Libraries/ReactNative/queryLayoutByID.js +0 -58
- package/Libraries/StyleSheet/StyleSheetValidation.js +0 -100
- package/Libraries/Utilities/registerGeneratedViewConfig.js +0 -36
- package/Libraries/promiseRejectionIsError.js +0 -24
- package/React/Base/RCTJSInvokerModule.h +0 -18
- package/React/Fabric/Mounting/ComponentViews/Picker/RCTPickerComponentView.h +0 -19
- package/React/Fabric/Mounting/ComponentViews/Picker/RCTPickerComponentView.mm +0 -206
- package/React/Views/RCTPicker.h +0 -23
- package/React/Views/RCTPicker.m +0 -122
- package/React/Views/RCTPickerManager.m +0 -68
- package/ReactAndroid/release.gradle +0 -87
- package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/DatePickerDialogTestCase.java +0 -172
- package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/ReactPickerTestCase.java +0 -196
- package/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js +0 -45
- package/ReactAndroid/src/androidTest/js/PickerAndroidTestModule.js +0 -89
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerImpl.java +0 -82
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/BUCK +0 -27
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogFragment.java +0 -137
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java +0 -147
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DismissableDatePickerDialog.java +0 -117
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/AndroidDialogPickerManagerDelegate.java +0 -48
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/AndroidDialogPickerManagerInterface.java +0 -23
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/AndroidDropdownPickerManagerDelegate.java +0 -48
- package/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/AndroidDropdownPickerManagerInterface.java +0 -22
- package/ReactAndroid/src/main/java/com/facebook/react/views/picker/BUCK +0 -30
- package/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactDialogPickerManager.java +0 -51
- package/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactDropdownPickerManager.java +0 -50
- package/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPicker.java +0 -196
- package/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPickerAdapter.java +0 -95
- package/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPickerItem.java +0 -43
- package/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPickerManager.java +0 -97
- package/ReactAndroid/src/main/java/com/facebook/react/views/picker/events/PickerItemSelectEvent.java +0 -40
- package/ReactCommon/cxxreact/re_worker_requirements +0 -6
- package/ReactCommon/react/renderer/components/picker/Android.mk +0 -37
- package/ReactCommon/react/renderer/components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDialogPickerEventEmitter.cpp +0 -23
- package/ReactCommon/react/renderer/components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDialogPickerEventEmitter.h +0 -27
- package/ReactCommon/react/renderer/components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDialogPickerProps.cpp +0 -28
- package/ReactCommon/react/renderer/components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDialogPickerProps.h +0 -77
- package/ReactCommon/react/renderer/components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDialogPickerShadowNode.h +0 -29
- package/ReactCommon/react/renderer/components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDropdownPickerEventEmitter.cpp +0 -23
- package/ReactCommon/react/renderer/components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDropdownPickerEventEmitter.h +0 -27
- package/ReactCommon/react/renderer/components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDropdownPickerProps.cpp +0 -28
- package/ReactCommon/react/renderer/components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDropdownPickerProps.h +0 -77
- package/ReactCommon/react/renderer/components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDropdownPickerShadowNode.cpp +0 -17
- package/ReactCommon/react/renderer/components/picker/androidpicker/react/renderer/components/androidpicker/AndroidDropdownPickerShadowNode.h +0 -29
- package/ReactCommon/react/renderer/components/picker/iospicker/PickerComponentDescriptor.h +0 -26
- package/ReactCommon/react/renderer/components/picker/iospicker/PickerEventEmitter.cpp +0 -23
- package/ReactCommon/react/renderer/components/picker/iospicker/PickerProps.cpp +0 -46
- package/ReactCommon/react/renderer/components/picker/iospicker/PickerProps.h +0 -36
- package/ReactCommon/react/renderer/components/picker/iospicker/PickerShadowNode.h +0 -33
- package/ReactCommon/react/renderer/components/picker/iospicker/conversions.h +0 -47
- package/ReactCommon/react/renderer/mounting/TransactionTelemetry.cpp +0 -142
- package/ReactCommon/react/renderer/mounting/tests/TransactionTelemetryTest.cpp +0 -125
- package/android/com/facebook/react/react-native/0.0.0-201c10733/react-native-0.0.0-201c10733.aar +0 -0
- package/android/com/facebook/react/react-native/0.0.0-201c10733/react-native-0.0.0-201c10733.aar.md5 +0 -1
- package/android/com/facebook/react/react-native/0.0.0-201c10733/react-native-0.0.0-201c10733.aar.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.0.0-201c10733/react-native-0.0.0-201c10733.pom.md5 +0 -1
- package/android/com/facebook/react/react-native/0.0.0-201c10733/react-native-0.0.0-201c10733.pom.sha1 +0 -1
- package/scripts/generate-specs.sh +0 -91
|
@@ -8,22 +8,24 @@
|
|
|
8
8
|
#include "LayoutAnimationKeyFrameManager.h"
|
|
9
9
|
|
|
10
10
|
#include <algorithm>
|
|
11
|
-
#include <chrono>
|
|
12
11
|
|
|
12
|
+
#include <react/debug/flags.h>
|
|
13
|
+
#include <react/debug/react_native_assert.h>
|
|
14
|
+
|
|
15
|
+
#include <logger/react_native_log.h>
|
|
16
|
+
#include <react/renderer/animations/conversions.h>
|
|
17
|
+
#include <react/renderer/animations/utils.h>
|
|
13
18
|
#include <react/renderer/componentregistry/ComponentDescriptorFactory.h>
|
|
14
|
-
#include <react/renderer/components/
|
|
19
|
+
#include <react/renderer/components/image/ImageProps.h>
|
|
15
20
|
#include <react/renderer/components/view/ViewProps.h>
|
|
16
21
|
#include <react/renderer/core/ComponentDescriptor.h>
|
|
17
22
|
#include <react/renderer/core/LayoutMetrics.h>
|
|
18
|
-
#include <react/renderer/core/LayoutableShadowNode.h>
|
|
19
23
|
#include <react/renderer/core/Props.h>
|
|
24
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
20
25
|
#include <react/renderer/core/RawValue.h>
|
|
21
26
|
#include <react/renderer/mounting/MountingCoordinator.h>
|
|
22
|
-
#include <react/renderer/mounting/ShadowViewMutation.h>
|
|
23
|
-
|
|
24
|
-
#include <react/renderer/mounting/Differentiator.h>
|
|
25
|
-
#include <react/renderer/mounting/ShadowTreeRevision.h>
|
|
26
27
|
#include <react/renderer/mounting/ShadowView.h>
|
|
28
|
+
#include <react/renderer/mounting/ShadowViewMutation.h>
|
|
27
29
|
|
|
28
30
|
#include <glog/logging.h>
|
|
29
31
|
|
|
@@ -57,9 +59,21 @@ static std::string GetMutationInstructionString(
|
|
|
57
59
|
void PrintMutationInstruction(
|
|
58
60
|
std::string message,
|
|
59
61
|
ShadowViewMutation const &mutation) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
[&](std::ostream &stream) -> std::ostream & {
|
|
63
|
+
stream << message
|
|
64
|
+
<< " Mutation: " << GetMutationInstructionString(mutation);
|
|
65
|
+
if (mutation.oldChildShadowView.tag != 0) {
|
|
66
|
+
stream << " old hash: ##"
|
|
67
|
+
<< std::hash<ShadowView>{}(mutation.oldChildShadowView);
|
|
68
|
+
}
|
|
69
|
+
if (mutation.newChildShadowView.tag != 0) {
|
|
70
|
+
stream << " new hash: ##"
|
|
71
|
+
<< std::hash<ShadowView>{}(mutation.newChildShadowView);
|
|
72
|
+
}
|
|
73
|
+
return stream;
|
|
74
|
+
}(LOG(ERROR));
|
|
62
75
|
}
|
|
76
|
+
|
|
63
77
|
void PrintMutationInstructionRelative(
|
|
64
78
|
std::string message,
|
|
65
79
|
ShadowViewMutation const &mutation,
|
|
@@ -71,199 +85,27 @@ void PrintMutationInstructionRelative(
|
|
|
71
85
|
}
|
|
72
86
|
#endif
|
|
73
87
|
|
|
74
|
-
static
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
if (param == "linear") {
|
|
79
|
-
return AnimationType::Linear;
|
|
80
|
-
}
|
|
81
|
-
if (param == "easeInEaseOut") {
|
|
82
|
-
return AnimationType::EaseInEaseOut;
|
|
83
|
-
}
|
|
84
|
-
if (param == "easeIn") {
|
|
85
|
-
return AnimationType::EaseIn;
|
|
86
|
-
}
|
|
87
|
-
if (param == "easeOut") {
|
|
88
|
-
return AnimationType::EaseOut;
|
|
89
|
-
}
|
|
90
|
-
if (param == "keyboard") {
|
|
91
|
-
return AnimationType::Keyboard;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
LOG(ERROR) << "Error parsing animation type: " << param;
|
|
95
|
-
return {};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
static better::optional<AnimationProperty> parseAnimationProperty(
|
|
99
|
-
std::string param) {
|
|
100
|
-
if (param == "opacity") {
|
|
101
|
-
return AnimationProperty::Opacity;
|
|
102
|
-
}
|
|
103
|
-
if (param == "scaleX") {
|
|
104
|
-
return AnimationProperty::ScaleX;
|
|
105
|
-
}
|
|
106
|
-
if (param == "scaleY") {
|
|
107
|
-
return AnimationProperty::ScaleY;
|
|
108
|
-
}
|
|
109
|
-
if (param == "scaleXY") {
|
|
110
|
-
return AnimationProperty::ScaleXY;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
LOG(ERROR) << "Error parsing animation property: " << param;
|
|
114
|
-
return {};
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
static better::optional<AnimationConfig> parseAnimationConfig(
|
|
118
|
-
folly::dynamic const &config,
|
|
119
|
-
double defaultDuration,
|
|
120
|
-
bool parsePropertyType) {
|
|
121
|
-
if (config.empty() || !config.isObject()) {
|
|
122
|
-
return AnimationConfig{
|
|
123
|
-
AnimationType::Linear,
|
|
124
|
-
AnimationProperty::NotApplicable,
|
|
125
|
-
defaultDuration,
|
|
126
|
-
0,
|
|
127
|
-
0,
|
|
128
|
-
0};
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
auto const typeIt = config.find("type");
|
|
132
|
-
if (typeIt == config.items().end()) {
|
|
133
|
-
LOG(ERROR) << "Error parsing animation config: could not find field `type`";
|
|
134
|
-
return {};
|
|
135
|
-
}
|
|
136
|
-
auto const animationTypeParam = typeIt->second;
|
|
137
|
-
if (animationTypeParam.empty() || !animationTypeParam.isString()) {
|
|
138
|
-
LOG(ERROR)
|
|
139
|
-
<< "Error parsing animation config: could not unwrap field `type`";
|
|
140
|
-
return {};
|
|
141
|
-
}
|
|
142
|
-
const auto animationType = parseAnimationType(animationTypeParam.asString());
|
|
143
|
-
if (!animationType) {
|
|
144
|
-
LOG(ERROR)
|
|
145
|
-
<< "Error parsing animation config: could not parse field `type`";
|
|
146
|
-
return {};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
AnimationProperty animationProperty = AnimationProperty::NotApplicable;
|
|
150
|
-
if (parsePropertyType) {
|
|
151
|
-
auto const propertyIt = config.find("property");
|
|
152
|
-
if (propertyIt == config.items().end()) {
|
|
153
|
-
LOG(ERROR)
|
|
154
|
-
<< "Error parsing animation config: could not find field `property`";
|
|
155
|
-
return {};
|
|
156
|
-
}
|
|
157
|
-
auto const animationPropertyParam = propertyIt->second;
|
|
158
|
-
if (animationPropertyParam.empty() || !animationPropertyParam.isString()) {
|
|
159
|
-
LOG(ERROR)
|
|
160
|
-
<< "Error parsing animation config: could not unwrap field `property`";
|
|
161
|
-
return {};
|
|
162
|
-
}
|
|
163
|
-
const auto animationPropertyParsed =
|
|
164
|
-
parseAnimationProperty(animationPropertyParam.asString());
|
|
165
|
-
if (!animationPropertyParsed) {
|
|
166
|
-
LOG(ERROR)
|
|
167
|
-
<< "Error parsing animation config: could not parse field `property`";
|
|
168
|
-
return {};
|
|
169
|
-
}
|
|
170
|
-
animationProperty = *animationPropertyParsed;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
double duration = defaultDuration;
|
|
174
|
-
double delay = 0;
|
|
175
|
-
double springDamping = 0.5;
|
|
176
|
-
double initialVelocity = 0;
|
|
177
|
-
|
|
178
|
-
auto const durationIt = config.find("duration");
|
|
179
|
-
if (durationIt != config.items().end()) {
|
|
180
|
-
if (durationIt->second.isDouble()) {
|
|
181
|
-
duration = durationIt->second.asDouble();
|
|
182
|
-
} else {
|
|
183
|
-
LOG(ERROR)
|
|
184
|
-
<< "Error parsing animation config: field `duration` must be a number";
|
|
185
|
-
return {};
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
auto const delayIt = config.find("delay");
|
|
190
|
-
if (delayIt != config.items().end()) {
|
|
191
|
-
if (delayIt->second.isDouble()) {
|
|
192
|
-
delay = delayIt->second.asDouble();
|
|
193
|
-
} else {
|
|
194
|
-
LOG(ERROR)
|
|
195
|
-
<< "Error parsing animation config: field `delay` must be a number";
|
|
196
|
-
return {};
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
auto const springDampingIt = config.find("springDamping");
|
|
201
|
-
if (springDampingIt != config.items().end() &&
|
|
202
|
-
springDampingIt->second.isDouble()) {
|
|
203
|
-
if (springDampingIt->second.isDouble()) {
|
|
204
|
-
springDamping = springDampingIt->second.asDouble();
|
|
205
|
-
} else {
|
|
206
|
-
LOG(ERROR)
|
|
207
|
-
<< "Error parsing animation config: field `springDamping` must be a number";
|
|
208
|
-
return {};
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
auto const initialVelocityIt = config.find("initialVelocity");
|
|
213
|
-
if (initialVelocityIt != config.items().end()) {
|
|
214
|
-
if (initialVelocityIt->second.isDouble()) {
|
|
215
|
-
initialVelocity = initialVelocityIt->second.asDouble();
|
|
216
|
-
} else {
|
|
217
|
-
LOG(ERROR)
|
|
218
|
-
<< "Error parsing animation config: field `initialVelocity` must be a number";
|
|
219
|
-
return {};
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
return better::optional<AnimationConfig>(AnimationConfig{
|
|
224
|
-
*animationType,
|
|
225
|
-
animationProperty,
|
|
226
|
-
duration,
|
|
227
|
-
delay,
|
|
228
|
-
springDamping,
|
|
229
|
-
initialVelocity});
|
|
88
|
+
static inline float
|
|
89
|
+
interpolateFloats(float coefficient, float oldValue, float newValue) {
|
|
90
|
+
return oldValue + (newValue - oldValue) * coefficient;
|
|
230
91
|
}
|
|
231
92
|
|
|
232
|
-
|
|
233
|
-
static better::optional<LayoutAnimationConfig> parseLayoutAnimationConfig(
|
|
234
|
-
folly::dynamic const &config) {
|
|
235
|
-
if (config.empty() || !config.isObject()) {
|
|
236
|
-
return {};
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
const auto durationIt = config.find("duration");
|
|
240
|
-
if (durationIt == config.items().end() || !durationIt->second.isDouble()) {
|
|
241
|
-
return {};
|
|
242
|
-
}
|
|
243
|
-
const double duration = durationIt->second.asDouble();
|
|
244
|
-
|
|
245
|
-
const auto createConfigIt = config.find("create");
|
|
246
|
-
const auto createConfig = createConfigIt == config.items().end()
|
|
247
|
-
? better::optional<AnimationConfig>(AnimationConfig{})
|
|
248
|
-
: parseAnimationConfig(createConfigIt->second, duration, true);
|
|
249
|
-
|
|
250
|
-
const auto updateConfigIt = config.find("update");
|
|
251
|
-
const auto updateConfig = updateConfigIt == config.items().end()
|
|
252
|
-
? better::optional<AnimationConfig>(AnimationConfig{})
|
|
253
|
-
: parseAnimationConfig(updateConfigIt->second, duration, false);
|
|
93
|
+
#pragma mark -
|
|
254
94
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
95
|
+
LayoutAnimationKeyFrameManager::LayoutAnimationKeyFrameManager(
|
|
96
|
+
RuntimeExecutor runtimeExecutor,
|
|
97
|
+
ContextContainer::Shared &contextContainer,
|
|
98
|
+
LayoutAnimationStatusDelegate *delegate)
|
|
99
|
+
: runtimeExecutor_(runtimeExecutor),
|
|
100
|
+
contextContainer_(contextContainer),
|
|
101
|
+
layoutAnimationStatusDelegate_(delegate),
|
|
102
|
+
now_([]() {
|
|
103
|
+
return std::chrono::duration_cast<std::chrono::milliseconds>(
|
|
104
|
+
std::chrono::high_resolution_clock::now().time_since_epoch())
|
|
105
|
+
.count();
|
|
106
|
+
}) {}
|
|
259
107
|
|
|
260
|
-
|
|
261
|
-
return {};
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
return better::optional<LayoutAnimationConfig>(LayoutAnimationConfig{
|
|
265
|
-
duration, *createConfig, *updateConfig, *deleteConfig});
|
|
266
|
-
}
|
|
108
|
+
#pragma mark UIManagerAnimationDelegate methods
|
|
267
109
|
|
|
268
110
|
/**
|
|
269
111
|
* Globally configure next LayoutAnimation.
|
|
@@ -293,14 +135,14 @@ void LayoutAnimationKeyFrameManager::uiManagerDidConfigureNextLayoutAnimation(
|
|
|
293
135
|
if (layoutAnimationConfig) {
|
|
294
136
|
std::lock_guard<std::mutex> lock(currentAnimationMutex_);
|
|
295
137
|
|
|
296
|
-
|
|
138
|
+
uiManagerDidConfigureNextLayoutAnimation(LayoutAnimation{
|
|
297
139
|
-1,
|
|
298
140
|
0,
|
|
299
141
|
false,
|
|
300
142
|
*layoutAnimationConfig,
|
|
301
143
|
successCallback,
|
|
302
144
|
failureCallback,
|
|
303
|
-
{}}
|
|
145
|
+
{}});
|
|
304
146
|
} else {
|
|
305
147
|
LOG(ERROR) << "Parsing LayoutAnimationConfig failed: "
|
|
306
148
|
<< (folly::dynamic)config;
|
|
@@ -309,19 +151,9 @@ void LayoutAnimationKeyFrameManager::uiManagerDidConfigureNextLayoutAnimation(
|
|
|
309
151
|
}
|
|
310
152
|
}
|
|
311
153
|
|
|
312
|
-
void LayoutAnimationKeyFrameManager::
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
layoutAnimationStatusDelegate_ = delegate;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
bool LayoutAnimationKeyFrameManager::shouldOverridePullTransaction() const {
|
|
319
|
-
return shouldAnimateFrame();
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
void LayoutAnimationKeyFrameManager::stopSurface(SurfaceId surfaceId) {
|
|
323
|
-
std::lock_guard<std::mutex> lock(surfaceIdsToStopMutex_);
|
|
324
|
-
surfaceIdsToStop_.push_back(surfaceId);
|
|
154
|
+
void LayoutAnimationKeyFrameManager::setComponentDescriptorRegistry(
|
|
155
|
+
const SharedComponentDescriptorRegistry &componentDescriptorRegistry) {
|
|
156
|
+
componentDescriptorRegistry_ = componentDescriptorRegistry;
|
|
325
157
|
}
|
|
326
158
|
|
|
327
159
|
bool LayoutAnimationKeyFrameManager::shouldAnimateFrame() const {
|
|
@@ -329,573 +161,179 @@ bool LayoutAnimationKeyFrameManager::shouldAnimateFrame() const {
|
|
|
329
161
|
return currentAnimation_ || !inflightAnimations_.empty();
|
|
330
162
|
}
|
|
331
163
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
164
|
+
void LayoutAnimationKeyFrameManager::stopSurface(SurfaceId surfaceId) {
|
|
165
|
+
std::lock_guard<std::mutex> lock(surfaceIdsToStopMutex_);
|
|
166
|
+
surfaceIdsToStop_.insert(surfaceId);
|
|
335
167
|
}
|
|
336
168
|
|
|
337
|
-
|
|
338
|
-
LayoutAnimationKeyFrameManager::calculateAnimationProgress(
|
|
339
|
-
uint64_t now,
|
|
340
|
-
const LayoutAnimation &animation,
|
|
341
|
-
const AnimationConfig &mutationConfig) const {
|
|
342
|
-
if (mutationConfig.animationType == AnimationType::None) {
|
|
343
|
-
return {1, 1};
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
uint64_t startTime = animation.startTime;
|
|
347
|
-
uint64_t delay = mutationConfig.delay;
|
|
348
|
-
uint64_t endTime = startTime + delay + mutationConfig.duration;
|
|
169
|
+
#pragma mark - MountingOverrideDelegate methods
|
|
349
170
|
|
|
350
|
-
|
|
171
|
+
bool LayoutAnimationKeyFrameManager::shouldOverridePullTransaction() const {
|
|
172
|
+
return shouldAnimateFrame();
|
|
173
|
+
}
|
|
351
174
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
175
|
+
better::optional<MountingTransaction>
|
|
176
|
+
LayoutAnimationKeyFrameManager::pullTransaction(
|
|
177
|
+
SurfaceId surfaceId,
|
|
178
|
+
MountingTransaction::Number transactionNumber,
|
|
179
|
+
TransactionTelemetry const &telemetry,
|
|
180
|
+
ShadowViewMutationList mutations) const {
|
|
181
|
+
simulateImagePropsMemoryAccess(mutations);
|
|
182
|
+
// Current time in milliseconds
|
|
183
|
+
uint64_t now = now_();
|
|
358
184
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
if (mutationConfig.animationType == AnimationType::Linear) {
|
|
363
|
-
return {linearTimeProgression, linearTimeProgression};
|
|
364
|
-
} else if (mutationConfig.animationType == AnimationType::EaseIn) {
|
|
365
|
-
// This is an accelerator-style interpolator.
|
|
366
|
-
// In the future, this parameter (2.0) could be adjusted. This has been the
|
|
367
|
-
// default for Classic RN forever.
|
|
368
|
-
return {linearTimeProgression, pow(linearTimeProgression, 2.0)};
|
|
369
|
-
} else if (mutationConfig.animationType == AnimationType::EaseOut) {
|
|
370
|
-
// This is an decelerator-style interpolator.
|
|
371
|
-
// In the future, this parameter (2.0) could be adjusted. This has been the
|
|
372
|
-
// default for Classic RN forever.
|
|
373
|
-
return {linearTimeProgression, 1.0 - pow(1 - linearTimeProgression, 2.0)};
|
|
374
|
-
} else if (mutationConfig.animationType == AnimationType::EaseInEaseOut) {
|
|
375
|
-
// This is a combination of accelerate+decelerate.
|
|
376
|
-
// The animation starts and ends slowly, and speeds up in the middle.
|
|
377
|
-
return {
|
|
378
|
-
linearTimeProgression,
|
|
379
|
-
cos((linearTimeProgression + 1.0) * PI) / 2 + 0.5};
|
|
380
|
-
} else if (mutationConfig.animationType == AnimationType::Spring) {
|
|
381
|
-
// Using mSpringDamping in this equation is not really the exact
|
|
382
|
-
// mathematical springDamping, but a good approximation We need to replace
|
|
383
|
-
// this equation with the right Factor that accounts for damping and
|
|
384
|
-
// friction
|
|
385
|
-
double damping = mutationConfig.springDamping;
|
|
386
|
-
return {
|
|
387
|
-
linearTimeProgression,
|
|
388
|
-
(1 +
|
|
389
|
-
pow(2, -10 * linearTimeProgression) *
|
|
390
|
-
sin((linearTimeProgression - damping / 4) * PI * 2 / damping))};
|
|
391
|
-
} else {
|
|
392
|
-
return {linearTimeProgression, linearTimeProgression};
|
|
393
|
-
}
|
|
394
|
-
}
|
|
185
|
+
bool inflightAnimationsExistInitially = !inflightAnimations_.empty();
|
|
186
|
+
deleteAnimationsForStoppedSurfaces();
|
|
395
187
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
188
|
+
if (!mutations.empty()) {
|
|
189
|
+
#ifdef RN_SHADOW_TREE_INTROSPECTION
|
|
190
|
+
{
|
|
191
|
+
std::stringstream ss(getDebugDescription(mutations, {}));
|
|
192
|
+
std::string to;
|
|
193
|
+
while (std::getline(ss, to, '\n')) {
|
|
194
|
+
LOG(ERROR)
|
|
195
|
+
<< "LayoutAnimationKeyFrameManager.cpp: got mutation list: Line: "
|
|
196
|
+
<< to;
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
#endif
|
|
404
200
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
201
|
+
// DEBUG ONLY: list existing inflight animations
|
|
202
|
+
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
|
|
203
|
+
LOG(ERROR) << "BEGINNING DISPLAYING ONGOING inflightAnimations_!";
|
|
204
|
+
int i = 0;
|
|
205
|
+
int j = 0;
|
|
206
|
+
for (auto const &inflightAnimation : inflightAnimations_) {
|
|
207
|
+
i++;
|
|
208
|
+
j = 0;
|
|
209
|
+
if (inflightAnimation.completed) {
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
for (auto &keyframe : inflightAnimation.keyFrames) {
|
|
213
|
+
j++;
|
|
214
|
+
if (keyframe.invalidated) {
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
for (const auto &finalMutationForKeyFrame :
|
|
218
|
+
keyframe.finalMutationsForKeyFrame) {
|
|
219
|
+
if (finalMutationForKeyFrame.mutatedViewIsVirtual()) {
|
|
220
|
+
std::string msg = "Animation " + std::to_string(i) + " keyframe " +
|
|
221
|
+
std::to_string(j) + ": Final Animation";
|
|
222
|
+
PrintMutationInstruction(msg, finalMutationForKeyFrame);
|
|
223
|
+
} else {
|
|
224
|
+
LOG(ERROR) << "Animation " << i << " keyframe " << j
|
|
225
|
+
<< ": on tag: [" << keyframe.viewStart.tag << "]";
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
LOG(ERROR) << "BEGINNING DONE DISPLAYING ONGOING inflightAnimations_!";
|
|
231
|
+
#endif
|
|
412
232
|
|
|
413
|
-
|
|
414
|
-
"[IndexAdjustment] Calling adjustImmediateMutationIndicesForDelayedMutations for:",
|
|
415
|
-
mutation);
|
|
233
|
+
PropsParserContext propsParserContext{surfaceId, *contextContainer_};
|
|
416
234
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
235
|
+
// What to do if we detect a conflict? Get current value and make
|
|
236
|
+
// that the baseline of the next animation. Scale the remaining time
|
|
237
|
+
// in the animation
|
|
238
|
+
// Types of conflicts and how we handle them:
|
|
239
|
+
// Update -> update: remove the previous update, make it the baseline of the
|
|
240
|
+
// next update (with current progress) Update -> remove: same, with final
|
|
241
|
+
// mutation being a remove Insert -> update: treat as update->update Insert
|
|
242
|
+
// -> remove: same, as update->remove Remove -> update/insert: not possible
|
|
243
|
+
// We just collect pairs here of <Mutation, AnimationConfig> and delete them
|
|
244
|
+
// from active animations. If another animation is queued up from the
|
|
245
|
+
// current mutations then these deleted mutations will serve as the baseline
|
|
246
|
+
// for the next animation. If not, the current mutations are executed
|
|
247
|
+
// immediately without issues.
|
|
248
|
+
std::vector<AnimationKeyFrame> conflictingAnimations{};
|
|
249
|
+
getAndEraseConflictingAnimations(
|
|
250
|
+
surfaceId, mutations, conflictingAnimations);
|
|
420
251
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
if (inflightAnimation.completed) {
|
|
430
|
-
continue;
|
|
252
|
+
// Are we animating this list of mutations?
|
|
253
|
+
better::optional<LayoutAnimation> currentAnimation{};
|
|
254
|
+
{
|
|
255
|
+
std::lock_guard<std::mutex> lock(currentAnimationMutex_);
|
|
256
|
+
if (currentAnimation_) {
|
|
257
|
+
currentAnimation = std::move(currentAnimation_);
|
|
258
|
+
currentAnimation_.reset();
|
|
259
|
+
}
|
|
431
260
|
}
|
|
432
261
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
262
|
+
if (currentAnimation.hasValue()) {
|
|
263
|
+
LayoutAnimation animation = std::move(currentAnimation).value();
|
|
264
|
+
animation.surfaceId = surfaceId;
|
|
265
|
+
animation.startTime = now;
|
|
437
266
|
|
|
438
|
-
|
|
439
|
-
|
|
267
|
+
// Pre-process list to:
|
|
268
|
+
// Catch remove+reinsert (reorders)
|
|
269
|
+
// Catch delete+create (reparenting) (this should be optimized away at
|
|
270
|
+
// the diffing level eventually?)
|
|
271
|
+
// TODO: to prevent this step we could tag Remove/Insert mutations as
|
|
272
|
+
// being moves on the Differ level, since we know that there? We could use
|
|
273
|
+
// TinyMap here, but it's not exposed by Differentiator (yet).
|
|
274
|
+
better::set<Tag> insertedTags;
|
|
275
|
+
better::set<Tag> deletedTags;
|
|
276
|
+
better::set<Tag> reparentedTags; // tags that are deleted and recreated
|
|
277
|
+
std::unordered_map<Tag, ShadowViewMutation> movedTags;
|
|
278
|
+
for (const auto &mutation : mutations) {
|
|
279
|
+
if (mutation.type == ShadowViewMutation::Type::Insert) {
|
|
280
|
+
insertedTags.insert(mutation.newChildShadowView.tag);
|
|
281
|
+
}
|
|
282
|
+
if (mutation.type == ShadowViewMutation::Type::Delete) {
|
|
283
|
+
deletedTags.insert(mutation.oldChildShadowView.tag);
|
|
284
|
+
}
|
|
285
|
+
if (mutation.type == ShadowViewMutation::Type::Create) {
|
|
286
|
+
if (deletedTags.find(mutation.newChildShadowView.tag) !=
|
|
287
|
+
deletedTags.end()) {
|
|
288
|
+
reparentedTags.insert(mutation.newChildShadowView.tag);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
440
291
|
}
|
|
441
292
|
|
|
442
|
-
//
|
|
443
|
-
//
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
293
|
+
// Process mutations list into operations that can be sent to platform
|
|
294
|
+
// immediately, and those that need to be animated Deletions, removals,
|
|
295
|
+
// updates are delayed and animated. Creations and insertions are sent to
|
|
296
|
+
// platform and then "animated in" with opacity updates. Upon completion,
|
|
297
|
+
// removals and deletions are sent to platform
|
|
298
|
+
ShadowViewMutation::List immediateMutations;
|
|
447
299
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
300
|
+
// Remove operations that are actually moves should be copied to
|
|
301
|
+
// "immediate mutations". The corresponding "insert" will also be executed
|
|
302
|
+
// immediately and animated as an update.
|
|
303
|
+
std::vector<AnimationKeyFrame> keyFramesToAnimate;
|
|
304
|
+
auto const layoutAnimationConfig = animation.layoutAnimationConfig;
|
|
305
|
+
for (auto const &mutation : mutations) {
|
|
306
|
+
ShadowView baselineShadowView =
|
|
307
|
+
(mutation.type == ShadowViewMutation::Type::Delete ||
|
|
308
|
+
mutation.type == ShadowViewMutation::Type::Remove ||
|
|
309
|
+
mutation.type == ShadowViewMutation::Type::Update
|
|
310
|
+
? mutation.oldChildShadowView
|
|
311
|
+
: mutation.newChildShadowView);
|
|
312
|
+
react_native_assert(baselineShadowView.tag > 0);
|
|
313
|
+
bool haveComponentDescriptor =
|
|
314
|
+
hasComponentDescriptorForShadowView(baselineShadowView);
|
|
451
315
|
|
|
452
|
-
|
|
316
|
+
// Immediately execute any mutations on a root node
|
|
317
|
+
if (baselineShadowView.traits.check(
|
|
318
|
+
ShadowNodeTraits::Trait::RootNodeKind)) {
|
|
319
|
+
immediateMutations.push_back(mutation);
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
453
322
|
|
|
454
|
-
|
|
455
|
-
continue;
|
|
456
|
-
}
|
|
457
|
-
if (mutatedViewIsVirtual(delayedMutation)) {
|
|
458
|
-
continue;
|
|
459
|
-
}
|
|
460
|
-
if (delayedMutation.oldChildShadowView.tag ==
|
|
461
|
-
(isRemoveMutation ? mutation.oldChildShadowView.tag
|
|
462
|
-
: mutation.newChildShadowView.tag)) {
|
|
463
|
-
continue;
|
|
464
|
-
}
|
|
323
|
+
better::optional<ShadowViewMutation> executeMutationImmediately{};
|
|
465
324
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
candidateMutations.push_back(&delayedMutation);
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
if (lastAnimationOnly) {
|
|
474
|
-
break;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
// While the mutation keeps being affected, keep checking. We use the vector
|
|
479
|
-
// so we only perform one adjustment per delayed mutation. See comments at
|
|
480
|
-
// bottom of adjustDelayedMutationIndicesForMutation for further explanation.
|
|
481
|
-
bool changed = true;
|
|
482
|
-
int adjustedDelta = 0;
|
|
483
|
-
while (changed) {
|
|
484
|
-
changed = false;
|
|
485
|
-
candidateMutations.erase(
|
|
486
|
-
std::remove_if(
|
|
487
|
-
candidateMutations.begin(),
|
|
488
|
-
candidateMutations.end(),
|
|
489
|
-
[&changed, &mutation, &adjustedDelta, &isRemoveMutation](
|
|
490
|
-
ShadowViewMutation *candidateMutation) {
|
|
491
|
-
bool indexConflicts =
|
|
492
|
-
(candidateMutation->index < mutation.index ||
|
|
493
|
-
(isRemoveMutation &&
|
|
494
|
-
candidateMutation->index == mutation.index));
|
|
495
|
-
if (indexConflicts) {
|
|
496
|
-
mutation.index++;
|
|
497
|
-
adjustedDelta++;
|
|
498
|
-
changed = true;
|
|
499
|
-
PrintMutationInstructionRelative(
|
|
500
|
-
"[IndexAdjustment] adjustImmediateMutationIndicesForDelayedMutations: Adjusting mutation UPWARD",
|
|
501
|
-
mutation,
|
|
502
|
-
*candidateMutation);
|
|
503
|
-
return true;
|
|
504
|
-
}
|
|
505
|
-
return false;
|
|
506
|
-
}),
|
|
507
|
-
candidateMutations.end());
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
void LayoutAnimationKeyFrameManager::adjustDelayedMutationIndicesForMutation(
|
|
512
|
-
SurfaceId surfaceId,
|
|
513
|
-
ShadowViewMutation const &mutation,
|
|
514
|
-
bool skipLastAnimation) const {
|
|
515
|
-
bool isRemoveMutation = mutation.type == ShadowViewMutation::Type::Remove;
|
|
516
|
-
bool isInsertMutation = mutation.type == ShadowViewMutation::Type::Insert;
|
|
517
|
-
assert(isRemoveMutation || isInsertMutation);
|
|
518
|
-
|
|
519
|
-
if (mutatedViewIsVirtual(mutation)) {
|
|
520
|
-
PrintMutationInstruction(
|
|
521
|
-
"[IndexAdjustment] Not calling adjustDelayedMutationIndicesForMutation, is virtual, for:",
|
|
522
|
-
mutation);
|
|
523
|
-
return;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
// First, collect all final mutations that could impact this immediate
|
|
527
|
-
// mutation.
|
|
528
|
-
std::vector<ShadowViewMutation *> candidateMutations{};
|
|
529
|
-
|
|
530
|
-
for (auto inflightAnimationIt =
|
|
531
|
-
inflightAnimations_.rbegin() + (skipLastAnimation ? 1 : 0);
|
|
532
|
-
inflightAnimationIt != inflightAnimations_.rend();
|
|
533
|
-
inflightAnimationIt++) {
|
|
534
|
-
auto &inflightAnimation = *inflightAnimationIt;
|
|
535
|
-
|
|
536
|
-
if (inflightAnimation.surfaceId != surfaceId) {
|
|
537
|
-
continue;
|
|
538
|
-
}
|
|
539
|
-
if (inflightAnimation.completed) {
|
|
540
|
-
continue;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
for (auto it = inflightAnimation.keyFrames.begin();
|
|
544
|
-
it != inflightAnimation.keyFrames.end();
|
|
545
|
-
it++) {
|
|
546
|
-
auto &animatedKeyFrame = *it;
|
|
547
|
-
|
|
548
|
-
if (animatedKeyFrame.invalidated) {
|
|
549
|
-
continue;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
// Detect if they're in the same view hierarchy, but not equivalent
|
|
553
|
-
// (We've already detected direct conflicts and handled them above)
|
|
554
|
-
if (animatedKeyFrame.parentView.tag != mutation.parentShadowView.tag) {
|
|
555
|
-
continue;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
if (!animatedKeyFrame.finalMutationForKeyFrame.has_value()) {
|
|
559
|
-
continue;
|
|
560
|
-
}
|
|
561
|
-
ShadowViewMutation &finalAnimationMutation =
|
|
562
|
-
*animatedKeyFrame.finalMutationForKeyFrame;
|
|
563
|
-
|
|
564
|
-
if (finalAnimationMutation.oldChildShadowView.tag ==
|
|
565
|
-
(isRemoveMutation ? mutation.oldChildShadowView.tag
|
|
566
|
-
: mutation.newChildShadowView.tag)) {
|
|
567
|
-
continue;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
if (finalAnimationMutation.type != ShadowViewMutation::Type::Remove) {
|
|
571
|
-
continue;
|
|
572
|
-
}
|
|
573
|
-
if (mutatedViewIsVirtual(*animatedKeyFrame.finalMutationForKeyFrame)) {
|
|
574
|
-
continue;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
PrintMutationInstructionRelative(
|
|
578
|
-
"[IndexAdjustment] adjustDelayedMutationIndicesForMutation: CANDIDATE:",
|
|
579
|
-
mutation,
|
|
580
|
-
*animatedKeyFrame.finalMutationForKeyFrame);
|
|
581
|
-
candidateMutations.push_back(
|
|
582
|
-
animatedKeyFrame.finalMutationForKeyFrame.get_pointer());
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
// Because the finalAnimations are not sorted in any way, it is possible to
|
|
587
|
-
// have some sequence like:
|
|
588
|
-
// * DELAYED REMOVE 10 from {TAG}
|
|
589
|
-
// * DELAYED REMOVE 9 from {TAG}
|
|
590
|
-
// * ...
|
|
591
|
-
// * DELAYED REMOVE 5 from {TAG}
|
|
592
|
-
// with mutation: INSERT 6/REMOVE 6. This would cause the first few mutations
|
|
593
|
-
// to *not* be adjusted, even though they would be impacted by mutation or
|
|
594
|
-
// vice-versa after later adjustments are applied. Therefore, we just keep
|
|
595
|
-
// recursing while there are any changes. This isn't great, but is good enough
|
|
596
|
-
// for now until we change these data-structures.
|
|
597
|
-
bool changed = true;
|
|
598
|
-
while (changed) {
|
|
599
|
-
changed = false;
|
|
600
|
-
candidateMutations.erase(
|
|
601
|
-
std::remove_if(
|
|
602
|
-
candidateMutations.begin(),
|
|
603
|
-
candidateMutations.end(),
|
|
604
|
-
[&mutation, &isRemoveMutation, &isInsertMutation, &changed](
|
|
605
|
-
ShadowViewMutation *candidateMutation) {
|
|
606
|
-
if (isRemoveMutation &&
|
|
607
|
-
mutation.index <= candidateMutation->index) {
|
|
608
|
-
candidateMutation->index--;
|
|
609
|
-
changed = true;
|
|
610
|
-
PrintMutationInstructionRelative(
|
|
611
|
-
"[IndexAdjustment] adjustDelayedMutationIndicesForMutation: Adjusting mutation DOWNWARD",
|
|
612
|
-
mutation,
|
|
613
|
-
*candidateMutation);
|
|
614
|
-
return true;
|
|
615
|
-
} else if (
|
|
616
|
-
isInsertMutation &&
|
|
617
|
-
mutation.index <= candidateMutation->index) {
|
|
618
|
-
candidateMutation->index++;
|
|
619
|
-
changed = true;
|
|
620
|
-
PrintMutationInstructionRelative(
|
|
621
|
-
"[IndexAdjustment] adjustDelayedMutationIndicesForMutation: Adjusting mutation UPWARD",
|
|
622
|
-
mutation,
|
|
623
|
-
*candidateMutation);
|
|
624
|
-
return true;
|
|
625
|
-
}
|
|
626
|
-
return false;
|
|
627
|
-
}),
|
|
628
|
-
candidateMutations.end());
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
std::vector<AnimationKeyFrame>
|
|
633
|
-
LayoutAnimationKeyFrameManager::getAndEraseConflictingAnimations(
|
|
634
|
-
SurfaceId surfaceId,
|
|
635
|
-
ShadowViewMutationList const &mutations,
|
|
636
|
-
bool deletesOnly) const {
|
|
637
|
-
std::vector<AnimationKeyFrame> conflictingAnimations{};
|
|
638
|
-
|
|
639
|
-
for (auto const &mutation : mutations) {
|
|
640
|
-
if (deletesOnly && mutation.type != ShadowViewMutation::Type::Delete) {
|
|
641
|
-
continue;
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
auto const &baselineShadowView =
|
|
645
|
-
(mutation.type == ShadowViewMutation::Type::Insert ||
|
|
646
|
-
mutation.type == ShadowViewMutation::Type::Create)
|
|
647
|
-
? mutation.newChildShadowView
|
|
648
|
-
: mutation.oldChildShadowView;
|
|
649
|
-
|
|
650
|
-
for (auto &inflightAnimation : inflightAnimations_) {
|
|
651
|
-
if (inflightAnimation.surfaceId != surfaceId) {
|
|
652
|
-
continue;
|
|
653
|
-
}
|
|
654
|
-
if (inflightAnimation.completed) {
|
|
655
|
-
continue;
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
for (auto it = inflightAnimation.keyFrames.begin();
|
|
659
|
-
it != inflightAnimation.keyFrames.end();) {
|
|
660
|
-
auto &animatedKeyFrame = *it;
|
|
661
|
-
|
|
662
|
-
if (animatedKeyFrame.invalidated) {
|
|
663
|
-
continue;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
bool conflicting = animatedKeyFrame.tag == baselineShadowView.tag ||
|
|
667
|
-
((mutation.type == ShadowViewMutation::Type::Delete ||
|
|
668
|
-
mutation.type == ShadowViewMutation::Type::Create) &&
|
|
669
|
-
animatedKeyFrame.parentView.tag == baselineShadowView.tag);
|
|
670
|
-
|
|
671
|
-
// Conflicting animation detected: if we're mutating a tag under
|
|
672
|
-
// animation, or deleting the parent of a tag under animation, or
|
|
673
|
-
// reparenting.
|
|
674
|
-
if (conflicting) {
|
|
675
|
-
animatedKeyFrame.invalidated = true;
|
|
676
|
-
|
|
677
|
-
// We construct a list of all conflicting animations, whether or not
|
|
678
|
-
// they have a "final mutation" to execute. This is important with,
|
|
679
|
-
// for example, "insert" mutations where the final update needs to set
|
|
680
|
-
// opacity to "1", even if there's no final ShadowNode update.
|
|
681
|
-
if (!(animatedKeyFrame.finalMutationForKeyFrame.has_value() &&
|
|
682
|
-
mutatedViewIsVirtual(
|
|
683
|
-
*animatedKeyFrame.finalMutationForKeyFrame))) {
|
|
684
|
-
conflictingAnimations.push_back(animatedKeyFrame);
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
|
|
688
|
-
if (animatedKeyFrame.finalMutationForKeyFrame.has_value()) {
|
|
689
|
-
PrintMutationInstructionRelative(
|
|
690
|
-
"Found mutation that conflicts with existing in-flight animation:",
|
|
691
|
-
mutation,
|
|
692
|
-
*animatedKeyFrame.finalMutationForKeyFrame);
|
|
693
|
-
} else {
|
|
694
|
-
PrintMutationInstruction(
|
|
695
|
-
"Found mutation that conflicts with existing in-flight animation (no final mutation):",
|
|
696
|
-
mutation);
|
|
697
|
-
}
|
|
698
|
-
#endif
|
|
699
|
-
|
|
700
|
-
// Delete from existing animation
|
|
701
|
-
it = inflightAnimation.keyFrames.erase(it);
|
|
702
|
-
} else {
|
|
703
|
-
it++;
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
return conflictingAnimations;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
better::optional<MountingTransaction>
|
|
713
|
-
LayoutAnimationKeyFrameManager::pullTransaction(
|
|
714
|
-
SurfaceId surfaceId,
|
|
715
|
-
MountingTransaction::Number transactionNumber,
|
|
716
|
-
TransactionTelemetry const &telemetry,
|
|
717
|
-
ShadowViewMutationList mutations) const {
|
|
718
|
-
// Current time in milliseconds
|
|
719
|
-
uint64_t now =
|
|
720
|
-
std::chrono::duration_cast<std::chrono::milliseconds>(
|
|
721
|
-
std::chrono::high_resolution_clock::now().time_since_epoch())
|
|
722
|
-
.count();
|
|
723
|
-
|
|
724
|
-
bool inflightAnimationsExistInitially = !inflightAnimations_.empty();
|
|
725
|
-
|
|
726
|
-
// Execute stopSurface on any ongoing animations
|
|
727
|
-
if (inflightAnimationsExistInitially) {
|
|
728
|
-
std::vector<SurfaceId> surfaceIdsToStop{};
|
|
729
|
-
{
|
|
730
|
-
std::lock_guard<std::mutex> lock(surfaceIdsToStopMutex_);
|
|
731
|
-
surfaceIdsToStop = surfaceIdsToStop_;
|
|
732
|
-
surfaceIdsToStop_ = {};
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
for (auto it = inflightAnimations_.begin();
|
|
736
|
-
it != inflightAnimations_.end();) {
|
|
737
|
-
const auto &animation = *it;
|
|
738
|
-
|
|
739
|
-
if (std::find(
|
|
740
|
-
surfaceIdsToStop.begin(),
|
|
741
|
-
surfaceIdsToStop.end(),
|
|
742
|
-
animation.surfaceId) != surfaceIdsToStop.end()) {
|
|
743
|
-
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
|
|
744
|
-
LOG(ERROR)
|
|
745
|
-
<< "LayoutAnimations: stopping animation due to stopSurface on "
|
|
746
|
-
<< surfaceId;
|
|
747
|
-
#endif
|
|
748
|
-
it = inflightAnimations_.erase(it);
|
|
749
|
-
} else {
|
|
750
|
-
it++;
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
if (!mutations.empty()) {
|
|
756
|
-
#ifdef RN_SHADOW_TREE_INTROSPECTION
|
|
757
|
-
{
|
|
758
|
-
std::stringstream ss(getDebugDescription(mutations, {}));
|
|
759
|
-
std::string to;
|
|
760
|
-
while (std::getline(ss, to, '\n')) {
|
|
761
|
-
LOG(ERROR)
|
|
762
|
-
<< "LayoutAnimationKeyFrameManager.cpp: got mutation list: Line: "
|
|
763
|
-
<< to;
|
|
764
|
-
}
|
|
765
|
-
};
|
|
766
|
-
#endif
|
|
767
|
-
|
|
768
|
-
// DEBUG ONLY: list existing inflight animations
|
|
769
|
-
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
|
|
770
|
-
LOG(ERROR) << "BEGINNING DISPLAYING ONGOING inflightAnimations_!";
|
|
771
|
-
int i = 0;
|
|
772
|
-
int j = 0;
|
|
773
|
-
for (auto const &inflightAnimation : inflightAnimations_) {
|
|
774
|
-
i++;
|
|
775
|
-
j = 0;
|
|
776
|
-
if (inflightAnimation.completed) {
|
|
777
|
-
continue;
|
|
778
|
-
}
|
|
779
|
-
for (auto &keyframe : inflightAnimation.keyFrames) {
|
|
780
|
-
j++;
|
|
781
|
-
if (keyframe.invalidated) {
|
|
782
|
-
continue;
|
|
783
|
-
}
|
|
784
|
-
if (keyframe.finalMutationForKeyFrame &&
|
|
785
|
-
!mutatedViewIsVirtual(*keyframe.finalMutationForKeyFrame)) {
|
|
786
|
-
std::string msg = "Animation " + std::to_string(i) + " keyframe " +
|
|
787
|
-
std::to_string(j) + ": Final Animation";
|
|
788
|
-
PrintMutationInstruction(msg, *keyframe.finalMutationForKeyFrame);
|
|
789
|
-
} else {
|
|
790
|
-
LOG(ERROR) << "Animation " << i << " keyframe " << j << ": on tag: ["
|
|
791
|
-
<< keyframe.viewStart.tag << "]";
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
LOG(ERROR) << "BEGINNING DONE DISPLAYING ONGOING inflightAnimations_!";
|
|
796
|
-
#endif
|
|
797
|
-
|
|
798
|
-
// What to do if we detect a conflict? Get current value and make
|
|
799
|
-
// that the baseline of the next animation. Scale the remaining time
|
|
800
|
-
// in the animation
|
|
801
|
-
// Types of conflicts and how we handle them:
|
|
802
|
-
// Update -> update: remove the previous update, make it the baseline of the
|
|
803
|
-
// next update (with current progress) Update -> remove: same, with final
|
|
804
|
-
// mutation being a remove Insert -> update: treat as update->update Insert
|
|
805
|
-
// -> remove: same, as update->remove Remove -> update/insert: not possible
|
|
806
|
-
// We just collect pairs here of <Mutation, AnimationConfig> and delete them
|
|
807
|
-
// from active animations. If another animation is queued up from the
|
|
808
|
-
// current mutations then these deleted mutations will serve as the baseline
|
|
809
|
-
// for the next animation. If not, the current mutations are executed
|
|
810
|
-
// immediately without issues.
|
|
811
|
-
auto conflictingAnimations =
|
|
812
|
-
getAndEraseConflictingAnimations(surfaceId, mutations);
|
|
813
|
-
|
|
814
|
-
// Are we animating this list of mutations?
|
|
815
|
-
better::optional<LayoutAnimation> currentAnimation{};
|
|
816
|
-
{
|
|
817
|
-
std::lock_guard<std::mutex> lock(currentAnimationMutex_);
|
|
818
|
-
if (currentAnimation_) {
|
|
819
|
-
currentAnimation = std::move(currentAnimation_);
|
|
820
|
-
currentAnimation_ = {};
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
if (currentAnimation) {
|
|
825
|
-
LayoutAnimation animation = std::move(currentAnimation.value());
|
|
826
|
-
currentAnimation = {};
|
|
827
|
-
animation.surfaceId = surfaceId;
|
|
828
|
-
animation.startTime = now;
|
|
829
|
-
|
|
830
|
-
// Pre-process list to:
|
|
831
|
-
// Catch remove+reinsert (reorders)
|
|
832
|
-
// Catch delete+create (reparenting) (this should be optimized away at
|
|
833
|
-
// the diffing level eventually?)
|
|
834
|
-
// TODO: to prevent this step we could tag Remove/Insert mutations as
|
|
835
|
-
// being moves on the Differ level, since we know that there? We could use
|
|
836
|
-
// TinyMap here, but it's not exposed by Differentiator (yet).
|
|
837
|
-
std::vector<Tag> insertedTags;
|
|
838
|
-
std::vector<Tag> deletedTags;
|
|
839
|
-
std::vector<Tag> reparentedTags; // tags that are deleted and recreated
|
|
840
|
-
std::unordered_map<Tag, ShadowViewMutation> movedTags;
|
|
841
|
-
for (const auto &mutation : mutations) {
|
|
842
|
-
if (mutation.type == ShadowViewMutation::Type::Insert) {
|
|
843
|
-
insertedTags.push_back(mutation.newChildShadowView.tag);
|
|
844
|
-
}
|
|
845
|
-
if (mutation.type == ShadowViewMutation::Type::Delete) {
|
|
846
|
-
deletedTags.push_back(mutation.oldChildShadowView.tag);
|
|
847
|
-
}
|
|
848
|
-
if (mutation.type == ShadowViewMutation::Type::Create) {
|
|
849
|
-
if (std::find(
|
|
850
|
-
deletedTags.begin(),
|
|
851
|
-
deletedTags.end(),
|
|
852
|
-
mutation.newChildShadowView.tag) != deletedTags.end()) {
|
|
853
|
-
reparentedTags.push_back(mutation.newChildShadowView.tag);
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
// Process mutations list into operations that can be sent to platform
|
|
859
|
-
// immediately, and those that need to be animated Deletions, removals,
|
|
860
|
-
// updates are delayed and animated. Creations and insertions are sent to
|
|
861
|
-
// platform and then "animated in" with opacity updates. Upon completion,
|
|
862
|
-
// removals and deletions are sent to platform
|
|
863
|
-
ShadowViewMutation::List immediateMutations;
|
|
864
|
-
|
|
865
|
-
// Remove operations that are actually moves should be copied to
|
|
866
|
-
// "immediate mutations". The corresponding "insert" will also be executed
|
|
867
|
-
// immediately and animated as an update.
|
|
868
|
-
std::vector<AnimationKeyFrame> keyFramesToAnimate;
|
|
869
|
-
std::vector<AnimationKeyFrame> movesToAnimate;
|
|
870
|
-
auto const layoutAnimationConfig = animation.layoutAnimationConfig;
|
|
871
|
-
for (auto const &mutation : mutations) {
|
|
872
|
-
ShadowView baselineShadowView =
|
|
873
|
-
(mutation.type == ShadowViewMutation::Type::Delete ||
|
|
874
|
-
mutation.type == ShadowViewMutation::Type::Remove ||
|
|
875
|
-
mutation.type == ShadowViewMutation::Type::Update
|
|
876
|
-
? mutation.oldChildShadowView
|
|
877
|
-
: mutation.newChildShadowView);
|
|
878
|
-
bool haveComponentDescriptor =
|
|
879
|
-
hasComponentDescriptorForShadowView(baselineShadowView);
|
|
880
|
-
|
|
881
|
-
bool executeMutationImmediately = false;
|
|
882
|
-
|
|
883
|
-
bool isRemoveReinserted =
|
|
884
|
-
mutation.type == ShadowViewMutation::Type::Remove &&
|
|
885
|
-
std::find(
|
|
886
|
-
insertedTags.begin(),
|
|
887
|
-
insertedTags.end(),
|
|
888
|
-
mutation.oldChildShadowView.tag) != insertedTags.end();
|
|
325
|
+
bool isRemoveReinserted =
|
|
326
|
+
mutation.type == ShadowViewMutation::Type::Remove &&
|
|
327
|
+
insertedTags.find(mutation.oldChildShadowView.tag) !=
|
|
328
|
+
insertedTags.end();
|
|
889
329
|
|
|
890
330
|
// Reparenting can result in a node being removed, inserted (moved) and
|
|
891
331
|
// also deleted and created in the same frame, with the same props etc.
|
|
892
332
|
// This should eventually be optimized out of the diffing algorithm, but
|
|
893
333
|
// for now we detect reparenting and prevent the corresponding
|
|
894
334
|
// Delete/Create instructions from being animated.
|
|
895
|
-
bool isReparented =
|
|
896
|
-
|
|
897
|
-
reparentedTags.end(),
|
|
898
|
-
baselineShadowView.tag) != reparentedTags.end();
|
|
335
|
+
bool isReparented =
|
|
336
|
+
reparentedTags.find(baselineShadowView.tag) != reparentedTags.end();
|
|
899
337
|
|
|
900
338
|
if (isRemoveReinserted) {
|
|
901
339
|
movedTags.insert({mutation.oldChildShadowView.tag, mutation});
|
|
@@ -928,23 +366,13 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
928
366
|
bool haveConfiguration =
|
|
929
367
|
mutationConfig.animationType != AnimationType::None;
|
|
930
368
|
|
|
931
|
-
if (wasInsertedTagRemoved && haveConfiguration) {
|
|
932
|
-
movesToAnimate.push_back(AnimationKeyFrame{
|
|
933
|
-
{},
|
|
934
|
-
AnimationConfigurationType::Update,
|
|
935
|
-
mutation.newChildShadowView.tag,
|
|
936
|
-
mutation.parentShadowView,
|
|
937
|
-
movedIt->second.oldChildShadowView,
|
|
938
|
-
mutation.newChildShadowView});
|
|
939
|
-
}
|
|
940
|
-
|
|
941
369
|
// Creates and inserts should also be executed immediately.
|
|
942
370
|
// Mutations that would otherwise be animated, but have no
|
|
943
371
|
// configuration, are also executed immediately.
|
|
944
372
|
if (isRemoveReinserted || !haveConfiguration || isReparented ||
|
|
945
373
|
mutation.type == ShadowViewMutation::Type::Create ||
|
|
946
374
|
mutation.type == ShadowViewMutation::Type::Insert) {
|
|
947
|
-
executeMutationImmediately =
|
|
375
|
+
executeMutationImmediately = mutation;
|
|
948
376
|
|
|
949
377
|
// It is possible, especially in the case of "moves", that we have a
|
|
950
378
|
// sequence of operations like:
|
|
@@ -963,11 +391,49 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
963
391
|
// If there's already an animation queued up, followed by this
|
|
964
392
|
// Insert, it *must* be an Update mutation animation. Other
|
|
965
393
|
// sequences should not be possible.
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
394
|
+
react_native_assert(
|
|
395
|
+
keyframe.type == AnimationConfigurationType::Update);
|
|
396
|
+
|
|
397
|
+
// The mutation is an "insert", so it must have a
|
|
398
|
+
// "newChildShadowView"
|
|
399
|
+
react_native_assert(mutation.newChildShadowView.tag > 0);
|
|
400
|
+
|
|
401
|
+
// Those asserts don't run in prod. If there's some edge-case
|
|
402
|
+
// that we haven't caught yet, we'd crash in debug; make sure we
|
|
403
|
+
// don't mutate the prevView in prod.
|
|
404
|
+
if (keyframe.type == AnimationConfigurationType::Update &&
|
|
405
|
+
mutation.newChildShadowView.tag > 0) {
|
|
406
|
+
keyframe.viewPrev = mutation.newChildShadowView;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
} else if (mutation.type == ShadowViewMutation::Type::Remove) {
|
|
411
|
+
for (auto &keyframe : keyFramesToAnimate) {
|
|
412
|
+
if (keyframe.tag == baselineShadowView.tag) {
|
|
413
|
+
// If there's already an animation queued up, followed by this
|
|
414
|
+
// Insert, it *must* be an Update mutation animation. Other
|
|
415
|
+
// sequences should not be possible.
|
|
416
|
+
react_native_assert(
|
|
417
|
+
keyframe.type == AnimationConfigurationType::Update);
|
|
418
|
+
|
|
419
|
+
// The mutation is a "remove", so it must have a
|
|
420
|
+
// "oldChildShadowView"
|
|
421
|
+
react_native_assert(mutation.oldChildShadowView.tag > 0);
|
|
422
|
+
|
|
423
|
+
// Those asserts don't run in prod. If there's some edge-case
|
|
424
|
+
// that we haven't caught yet, we'd crash in debug; make sure we
|
|
425
|
+
// don't mutate the prevView in prod.
|
|
426
|
+
// Since normally the UPDATE would have been executed first and
|
|
427
|
+
// now it's deferred, we need to change the `oldChildShadowView`
|
|
428
|
+
// that is being referenced by the REMOVE mutation.
|
|
429
|
+
if (keyframe.type == AnimationConfigurationType::Update &&
|
|
430
|
+
mutation.oldChildShadowView.tag > 0) {
|
|
431
|
+
executeMutationImmediately =
|
|
432
|
+
ShadowViewMutation::RemoveMutation(
|
|
433
|
+
mutation.parentShadowView,
|
|
434
|
+
keyframe.viewPrev,
|
|
435
|
+
mutation.index);
|
|
436
|
+
}
|
|
971
437
|
}
|
|
972
438
|
}
|
|
973
439
|
}
|
|
@@ -981,11 +447,17 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
981
447
|
mutation.type == ShadowViewMutation::Type::Insert
|
|
982
448
|
? mutation.newChildShadowView
|
|
983
449
|
: mutation.oldChildShadowView);
|
|
450
|
+
react_native_assert(viewStart.tag > 0);
|
|
984
451
|
ShadowView viewFinal = ShadowView(
|
|
985
452
|
mutation.type == ShadowViewMutation::Type::Update
|
|
986
453
|
? mutation.newChildShadowView
|
|
987
454
|
: viewStart);
|
|
455
|
+
react_native_assert(viewFinal.tag > 0);
|
|
988
456
|
ShadowView parent = mutation.parentShadowView;
|
|
457
|
+
react_native_assert(
|
|
458
|
+
parent.tag > 0 ||
|
|
459
|
+
mutation.type == ShadowViewMutation::Type::Update ||
|
|
460
|
+
mutation.type == ShadowViewMutation::Type::Delete);
|
|
989
461
|
Tag tag = viewStart.tag;
|
|
990
462
|
|
|
991
463
|
AnimationKeyFrame keyFrame{};
|
|
@@ -995,55 +467,19 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
995
467
|
haveComponentDescriptor) {
|
|
996
468
|
auto props =
|
|
997
469
|
getComponentDescriptorForShadowView(baselineShadowView)
|
|
998
|
-
.cloneProps(viewStart.props, {});
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
}
|
|
1006
|
-
bool isScaleX =
|
|
1007
|
-
mutationConfig.animationProperty == AnimationProperty::ScaleX ||
|
|
1008
|
-
mutationConfig.animationProperty == AnimationProperty::ScaleXY;
|
|
1009
|
-
bool isScaleY =
|
|
1010
|
-
mutationConfig.animationProperty == AnimationProperty::ScaleY ||
|
|
1011
|
-
mutationConfig.animationProperty == AnimationProperty::ScaleXY;
|
|
1012
|
-
if ((isScaleX || isScaleY) && haveComponentDescriptor) {
|
|
1013
|
-
auto props =
|
|
1014
|
-
getComponentDescriptorForShadowView(baselineShadowView)
|
|
1015
|
-
.cloneProps(viewStart.props, {});
|
|
1016
|
-
const auto viewProps =
|
|
1017
|
-
dynamic_cast<const ViewProps *>(props.get());
|
|
1018
|
-
if (viewProps != nullptr) {
|
|
1019
|
-
const_cast<ViewProps *>(viewProps)->transform =
|
|
1020
|
-
Transform::Scale(isScaleX ? 0 : 1, isScaleY ? 0 : 1, 1);
|
|
470
|
+
.cloneProps(propsParserContext, viewStart.props, {});
|
|
471
|
+
|
|
472
|
+
if (baselineShadowView.traits.check(
|
|
473
|
+
ShadowNodeTraits::Trait::ViewKind)) {
|
|
474
|
+
auto const &viewProps =
|
|
475
|
+
*std::static_pointer_cast<ViewProps const>(props);
|
|
476
|
+
const_cast<ViewProps &>(viewProps).opacity = 0;
|
|
1021
477
|
}
|
|
1022
|
-
viewStart.props = props;
|
|
1023
|
-
}
|
|
1024
478
|
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
tag,
|
|
1029
|
-
parent,
|
|
1030
|
-
viewStart,
|
|
1031
|
-
viewFinal,
|
|
1032
|
-
baselineShadowView,
|
|
1033
|
-
0};
|
|
1034
|
-
} else if (mutation.type == ShadowViewMutation::Type::Delete) {
|
|
1035
|
-
if (mutationConfig.animationProperty ==
|
|
1036
|
-
AnimationProperty::Opacity &&
|
|
1037
|
-
haveComponentDescriptor) {
|
|
1038
|
-
auto props =
|
|
1039
|
-
getComponentDescriptorForShadowView(baselineShadowView)
|
|
1040
|
-
.cloneProps(viewFinal.props, {});
|
|
1041
|
-
const auto viewProps =
|
|
1042
|
-
dynamic_cast<const ViewProps *>(props.get());
|
|
1043
|
-
if (viewProps != nullptr) {
|
|
1044
|
-
const_cast<ViewProps *>(viewProps)->opacity = 0;
|
|
479
|
+
react_native_assert(props != nullptr);
|
|
480
|
+
if (props != nullptr) {
|
|
481
|
+
viewStart.props = props;
|
|
1045
482
|
}
|
|
1046
|
-
viewFinal.props = props;
|
|
1047
483
|
}
|
|
1048
484
|
bool isScaleX =
|
|
1049
485
|
mutationConfig.animationProperty == AnimationProperty::ScaleX ||
|
|
@@ -1054,43 +490,78 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1054
490
|
if ((isScaleX || isScaleY) && haveComponentDescriptor) {
|
|
1055
491
|
auto props =
|
|
1056
492
|
getComponentDescriptorForShadowView(baselineShadowView)
|
|
1057
|
-
.cloneProps(
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
493
|
+
.cloneProps(propsParserContext, viewStart.props, {});
|
|
494
|
+
if (baselineShadowView.traits.check(
|
|
495
|
+
ShadowNodeTraits::Trait::ViewKind)) {
|
|
496
|
+
auto const &viewProps =
|
|
497
|
+
*std::static_pointer_cast<ViewProps const>(props);
|
|
498
|
+
const_cast<ViewProps &>(viewProps).transform =
|
|
1062
499
|
Transform::Scale(isScaleX ? 0 : 1, isScaleY ? 0 : 1, 1);
|
|
1063
500
|
}
|
|
1064
|
-
|
|
501
|
+
|
|
502
|
+
react_native_assert(props != nullptr);
|
|
503
|
+
if (props != nullptr) {
|
|
504
|
+
viewStart.props = props;
|
|
505
|
+
}
|
|
1065
506
|
}
|
|
1066
507
|
|
|
508
|
+
PrintMutationInstruction(
|
|
509
|
+
"Setting up animation KeyFrame for INSERT mutation (Create animation)",
|
|
510
|
+
mutation);
|
|
511
|
+
|
|
1067
512
|
keyFrame = AnimationKeyFrame{
|
|
1068
|
-
|
|
1069
|
-
AnimationConfigurationType::
|
|
1070
|
-
tag,
|
|
1071
|
-
parent,
|
|
1072
|
-
viewStart,
|
|
1073
|
-
viewFinal,
|
|
1074
|
-
baselineShadowView,
|
|
1075
|
-
0};
|
|
513
|
+
/* .finalMutationsForKeyFrame = */ {},
|
|
514
|
+
/* .type = */ AnimationConfigurationType::Create,
|
|
515
|
+
/* .tag = */ tag,
|
|
516
|
+
/* .parentView = */ parent,
|
|
517
|
+
/* .viewStart = */ viewStart,
|
|
518
|
+
/* .viewEnd = */ viewFinal,
|
|
519
|
+
/* .viewPrev = */ baselineShadowView,
|
|
520
|
+
/* .initialProgress = */ 0};
|
|
521
|
+
} else if (mutation.type == ShadowViewMutation::Type::Delete) {
|
|
522
|
+
// This is just for assertion purposes.
|
|
523
|
+
// The NDEBUG check here is to satisfy the compiler in certain environments
|
|
524
|
+
// complaining about correspondingRemoveIt being unused.
|
|
525
|
+
#ifdef REACT_NATIVE_DEBUG
|
|
526
|
+
#ifndef NDEBUG
|
|
527
|
+
// This block is temporarily disabled to fix some internal builds.
|
|
528
|
+
// In some build configurations, we get a compiler error that
|
|
529
|
+
// `correspondingRemoveIt` is unused.
|
|
530
|
+
/* Tag deleteTag = mutation.oldChildShadowView.tag;
|
|
531
|
+
auto correspondingRemoveIt = std::find_if(
|
|
532
|
+
mutations.begin(),
|
|
533
|
+
mutations.end(),
|
|
534
|
+
[&deleteTag](auto &mutation) {
|
|
535
|
+
return mutation.type == ShadowViewMutation::Type::Remove &&
|
|
536
|
+
mutation.oldChildShadowView.tag == deleteTag;
|
|
537
|
+
});
|
|
538
|
+
react_native_assert(correspondingRemoveIt != mutations.end());
|
|
539
|
+
*/
|
|
540
|
+
#endif
|
|
541
|
+
#endif
|
|
542
|
+
continue;
|
|
1076
543
|
} else if (mutation.type == ShadowViewMutation::Type::Update) {
|
|
1077
544
|
viewFinal = ShadowView(mutation.newChildShadowView);
|
|
1078
545
|
|
|
546
|
+
PrintMutationInstruction(
|
|
547
|
+
"Setting up animation KeyFrame for UPDATE mutation (Update animation)",
|
|
548
|
+
mutation);
|
|
549
|
+
|
|
1079
550
|
keyFrame = AnimationKeyFrame{
|
|
1080
|
-
|
|
1081
|
-
AnimationConfigurationType::Update,
|
|
1082
|
-
tag,
|
|
1083
|
-
parent,
|
|
1084
|
-
viewStart,
|
|
1085
|
-
viewFinal,
|
|
1086
|
-
baselineShadowView,
|
|
1087
|
-
0};
|
|
551
|
+
/* .finalMutationsForKeyFrame = */ {mutation},
|
|
552
|
+
/* .type = */ AnimationConfigurationType::Update,
|
|
553
|
+
/* .tag = */ tag,
|
|
554
|
+
/* .parentView = */ parent,
|
|
555
|
+
/* .viewStart = */ viewStart,
|
|
556
|
+
/* .viewEnd = */ viewFinal,
|
|
557
|
+
/* .viewPrev = */ baselineShadowView,
|
|
558
|
+
/* .initialProgress = */ 0};
|
|
1088
559
|
} else {
|
|
1089
560
|
// This should just be "Remove" instructions that are not animated
|
|
1090
561
|
// (either this is a "move", or there's a corresponding "Delete"
|
|
1091
|
-
// that is animated).
|
|
1092
|
-
|
|
1093
|
-
|
|
562
|
+
// that is animated).
|
|
563
|
+
react_native_assert(
|
|
564
|
+
mutation.type == ShadowViewMutation::Type::Remove);
|
|
1094
565
|
|
|
1095
566
|
Tag removeTag = mutation.oldChildShadowView.tag;
|
|
1096
567
|
auto correspondingInsertIt = std::find_if(
|
|
@@ -1101,16 +572,78 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1101
572
|
mutation.newChildShadowView.tag == removeTag;
|
|
1102
573
|
});
|
|
1103
574
|
if (correspondingInsertIt == mutations.end()) {
|
|
1104
|
-
|
|
575
|
+
// This is a REMOVE not paired with an INSERT (move), so it must
|
|
576
|
+
// be paired with a DELETE.
|
|
577
|
+
auto correspondingDeleteIt = std::find_if(
|
|
578
|
+
mutations.begin(),
|
|
579
|
+
mutations.end(),
|
|
580
|
+
[&removeTag](auto &mutation) {
|
|
581
|
+
return mutation.type == ShadowViewMutation::Type::Delete &&
|
|
582
|
+
mutation.oldChildShadowView.tag == removeTag;
|
|
583
|
+
});
|
|
584
|
+
react_native_assert(correspondingDeleteIt != mutations.end());
|
|
585
|
+
|
|
586
|
+
auto deleteMutation = *correspondingDeleteIt;
|
|
587
|
+
|
|
588
|
+
if (mutationConfig.animationProperty ==
|
|
589
|
+
AnimationProperty::Opacity &&
|
|
590
|
+
haveComponentDescriptor) {
|
|
591
|
+
auto props =
|
|
592
|
+
getComponentDescriptorForShadowView(baselineShadowView)
|
|
593
|
+
.cloneProps(propsParserContext, viewFinal.props, {});
|
|
594
|
+
|
|
595
|
+
if (baselineShadowView.traits.check(
|
|
596
|
+
ShadowNodeTraits::Trait::ViewKind)) {
|
|
597
|
+
auto const &viewProps =
|
|
598
|
+
*std::static_pointer_cast<ViewProps const>(props);
|
|
599
|
+
const_cast<ViewProps &>(viewProps).opacity = 0;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
react_native_assert(props != nullptr);
|
|
603
|
+
if (props != nullptr) {
|
|
604
|
+
viewFinal.props = props;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
bool isScaleX = mutationConfig.animationProperty ==
|
|
608
|
+
AnimationProperty::ScaleX ||
|
|
609
|
+
mutationConfig.animationProperty ==
|
|
610
|
+
AnimationProperty::ScaleXY;
|
|
611
|
+
bool isScaleY = mutationConfig.animationProperty ==
|
|
612
|
+
AnimationProperty::ScaleY ||
|
|
613
|
+
mutationConfig.animationProperty ==
|
|
614
|
+
AnimationProperty::ScaleXY;
|
|
615
|
+
if ((isScaleX || isScaleY) && haveComponentDescriptor) {
|
|
616
|
+
auto props =
|
|
617
|
+
getComponentDescriptorForShadowView(baselineShadowView)
|
|
618
|
+
.cloneProps(propsParserContext, viewFinal.props, {});
|
|
619
|
+
|
|
620
|
+
if (baselineShadowView.traits.check(
|
|
621
|
+
ShadowNodeTraits::Trait::ViewKind)) {
|
|
622
|
+
auto const &viewProps =
|
|
623
|
+
*std::static_pointer_cast<ViewProps const>(props);
|
|
624
|
+
const_cast<ViewProps &>(viewProps).transform =
|
|
625
|
+
Transform::Scale(isScaleX ? 0 : 1, isScaleY ? 0 : 1, 1);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
react_native_assert(props != nullptr);
|
|
629
|
+
if (props != nullptr) {
|
|
630
|
+
viewFinal.props = props;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
PrintMutationInstruction(
|
|
635
|
+
"Setting up animation KeyFrame for REMOVE mutation (Delete animation)",
|
|
636
|
+
mutation);
|
|
637
|
+
|
|
1105
638
|
keyFrame = AnimationKeyFrame{
|
|
1106
|
-
|
|
1107
|
-
AnimationConfigurationType::
|
|
1108
|
-
tag,
|
|
1109
|
-
parent,
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
0};
|
|
639
|
+
/* .finalMutationsForKeyFrame */ {mutation, deleteMutation},
|
|
640
|
+
/* .type */ AnimationConfigurationType::Delete,
|
|
641
|
+
/* .tag */ tag,
|
|
642
|
+
/* .parentView */ parent,
|
|
643
|
+
/* .viewStart */ viewStart,
|
|
644
|
+
/* .viewEnd */ viewFinal,
|
|
645
|
+
/* .viewPrev */ baselineShadowView,
|
|
646
|
+
/* .initialProgress */ 0};
|
|
1114
647
|
} else {
|
|
1115
648
|
PrintMutationInstruction(
|
|
1116
649
|
"Executing Remove Immediately, due to reordering operation",
|
|
@@ -1127,12 +660,26 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1127
660
|
|
|
1128
661
|
// We've found a conflict.
|
|
1129
662
|
if (conflictingMutationBaselineShadowView.tag == tag) {
|
|
663
|
+
conflictingKeyFrame.generateFinalSyntheticMutations = false;
|
|
664
|
+
|
|
665
|
+
// Do NOT update viewStart for a CREATE animation.
|
|
666
|
+
if (keyFrame.type == AnimationConfigurationType::Create) {
|
|
667
|
+
break;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
|
|
671
|
+
LOG(ERROR)
|
|
672
|
+
<< "Due to conflict, replacing 'viewStart' of animated keyframe: ["
|
|
673
|
+
<< conflictingKeyFrame.viewPrev.tag << "] with ##"
|
|
674
|
+
<< std::hash<ShadowView>{}(conflictingKeyFrame.viewPrev);
|
|
675
|
+
#endif
|
|
1130
676
|
// Pick a Prop or layout property, depending on the current
|
|
1131
677
|
// animation configuration. Figure out how much progress we've
|
|
1132
678
|
// already made in the current animation, and start the animation
|
|
1133
679
|
// from this point.
|
|
680
|
+
keyFrame.viewPrev = conflictingKeyFrame.viewPrev;
|
|
1134
681
|
keyFrame.viewStart = conflictingKeyFrame.viewPrev;
|
|
1135
|
-
|
|
682
|
+
react_native_assert(keyFrame.viewStart.tag > 0);
|
|
1136
683
|
keyFrame.initialProgress = 0;
|
|
1137
684
|
|
|
1138
685
|
// We're guaranteed that a tag only has one animation associated
|
|
@@ -1143,16 +690,22 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1143
690
|
}
|
|
1144
691
|
}
|
|
1145
692
|
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
693
|
+
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
|
|
694
|
+
LOG(ERROR) << "Checking validity of keyframe: ["
|
|
695
|
+
<< keyFrame.viewStart.tag << "] [" << keyFrame.viewEnd.tag
|
|
696
|
+
<< "] [" << keyFrame.viewPrev.tag
|
|
697
|
+
<< "] animation type: " << (int)keyFrame.type;
|
|
698
|
+
#endif
|
|
699
|
+
react_native_assert(keyFrame.viewStart.tag > 0);
|
|
700
|
+
react_native_assert(keyFrame.viewEnd.tag > 0);
|
|
701
|
+
react_native_assert(keyFrame.viewPrev.tag > 0);
|
|
1149
702
|
keyFramesToAnimate.push_back(keyFrame);
|
|
1150
703
|
}
|
|
1151
704
|
|
|
1152
|
-
if (executeMutationImmediately) {
|
|
705
|
+
if (executeMutationImmediately.hasValue()) {
|
|
1153
706
|
PrintMutationInstruction(
|
|
1154
|
-
"Queue Up
|
|
1155
|
-
immediateMutations.push_back(
|
|
707
|
+
"Queue Up For Immediate Execution", *executeMutationImmediately);
|
|
708
|
+
immediateMutations.push_back(*executeMutationImmediately);
|
|
1156
709
|
}
|
|
1157
710
|
}
|
|
1158
711
|
|
|
@@ -1172,11 +725,12 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1172
725
|
{
|
|
1173
726
|
int idx = 0;
|
|
1174
727
|
for (const auto &keyframe : keyFramesToAnimate) {
|
|
1175
|
-
|
|
728
|
+
for (const auto &finalMutationForKeyFrame :
|
|
729
|
+
keyframe.finalMutationsForKeyFrame) {
|
|
1176
730
|
PrintMutationInstruction(
|
|
1177
731
|
std::string("FINAL list: ") + std::to_string(idx) + "/" +
|
|
1178
732
|
std::to_string(keyFramesToAnimate.size()),
|
|
1179
|
-
|
|
733
|
+
finalMutationForKeyFrame);
|
|
1180
734
|
}
|
|
1181
735
|
idx++;
|
|
1182
736
|
}
|
|
@@ -1223,56 +777,26 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1223
777
|
}
|
|
1224
778
|
}
|
|
1225
779
|
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
mutationInstruction.newChildShadowView.tag != 0 ||
|
|
1240
|
-
mutationInstruction.type == ShadowViewMutation::Delete ||
|
|
1241
|
-
mutationInstruction.type == ShadowViewMutation::Remove);
|
|
1242
|
-
finalConflictingMutations.push_back(mutationInstruction);
|
|
1243
|
-
} else {
|
|
1244
|
-
// If there's no final mutation associated, create a mutation that
|
|
1245
|
-
// corresponds to the animation being 100% complete. This is important
|
|
1246
|
-
// for, for example, INSERT mutations being animated from opacity 0
|
|
1247
|
-
// to 1. If the animation is interrupted we must force the View to be
|
|
1248
|
-
// at opacity 1.
|
|
1249
|
-
// For Android - since it passes along only deltas, not an entire bag
|
|
1250
|
-
// of props - generate an "animation" frame corresponding to a final
|
|
1251
|
-
// update for this view. Only then, generate an update that will cause
|
|
1252
|
-
// the ShadowTree to be consistent with the Mounting layer by passing
|
|
1253
|
-
// viewEnd, unmodified, to the mounting layer. This helps with, for
|
|
1254
|
-
// example, opacity animations.
|
|
1255
|
-
auto mutatedShadowView = createInterpolatedShadowView(
|
|
1256
|
-
1, keyFrame.viewStart, keyFrame.viewEnd);
|
|
1257
|
-
auto generatedPenultimateMutation =
|
|
1258
|
-
ShadowViewMutation::UpdateMutation(
|
|
1259
|
-
keyFrame.viewPrev, mutatedShadowView);
|
|
1260
|
-
assert(generatedPenultimateMutation.oldChildShadowView.tag != 0);
|
|
1261
|
-
assert(generatedPenultimateMutation.newChildShadowView.tag != 0);
|
|
1262
|
-
PrintMutationInstruction(
|
|
1263
|
-
"Queueing up penultimate mutation instruction - synthetic",
|
|
1264
|
-
generatedPenultimateMutation);
|
|
1265
|
-
finalConflictingMutations.push_back(generatedPenultimateMutation);
|
|
1266
|
-
|
|
1267
|
-
auto generatedMutation = ShadowViewMutation::UpdateMutation(
|
|
1268
|
-
mutatedShadowView, keyFrame.viewEnd);
|
|
1269
|
-
assert(generatedMutation.oldChildShadowView.tag != 0);
|
|
1270
|
-
assert(generatedMutation.newChildShadowView.tag != 0);
|
|
1271
|
-
PrintMutationInstruction(
|
|
1272
|
-
"Queueing up final mutation instruction - synthetic",
|
|
1273
|
-
generatedMutation);
|
|
1274
|
-
finalConflictingMutations.push_back(generatedMutation);
|
|
780
|
+
// If the "final" mutation is already accounted for, by previously
|
|
781
|
+
// setting the correct "viewPrev" of the next conflicting animation, we
|
|
782
|
+
// don't want to queue up any final UPDATE mutations here.
|
|
783
|
+
bool shouldGenerateSyntheticMutations =
|
|
784
|
+
keyFrame.generateFinalSyntheticMutations;
|
|
785
|
+
auto numFinalMutations = keyFrame.finalMutationsForKeyFrame.size();
|
|
786
|
+
bool onlyMutationIsUpdate =
|
|
787
|
+
(numFinalMutations == 1 &&
|
|
788
|
+
keyFrame.finalMutationsForKeyFrame[0].type ==
|
|
789
|
+
ShadowViewMutation::Update);
|
|
790
|
+
if (!shouldGenerateSyntheticMutations &&
|
|
791
|
+
(numFinalMutations == 0 || onlyMutationIsUpdate)) {
|
|
792
|
+
continue;
|
|
1275
793
|
}
|
|
794
|
+
|
|
795
|
+
queueFinalMutationsForCompletedKeyFrame(
|
|
796
|
+
keyFrame,
|
|
797
|
+
finalConflictingMutations,
|
|
798
|
+
true,
|
|
799
|
+
"KeyFrameManager: Finished Conflicting Keyframe");
|
|
1276
800
|
}
|
|
1277
801
|
|
|
1278
802
|
// Make sure that all operations execute in the proper order, since
|
|
@@ -1294,8 +818,8 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1294
818
|
// Knowledge Graph:
|
|
1295
819
|
// [ImmediateMutations] -> assumes [FinalConflicting], [FrameDelayed],
|
|
1296
820
|
// [Delayed] already executed [FrameDelayed] -> assumes
|
|
1297
|
-
// [FinalConflicting], [Delayed] already executed [FinalConflicting] ->
|
|
1298
|
-
// adjusted based on [Delayed], no dependency on [FinalConflicting],
|
|
821
|
+
// [FinalConflicting], [Delayed] already executed [FinalConflicting] ->
|
|
822
|
+
// is adjusted based on [Delayed], no dependency on [FinalConflicting],
|
|
1299
823
|
// [FrameDelayed] [Delayed] -> assumes [FinalConflicting],
|
|
1300
824
|
// [ImmediateMutations] not executed yet
|
|
1301
825
|
|
|
@@ -1303,8 +827,8 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1303
827
|
// Knowledge Graph:
|
|
1304
828
|
// [ImmediateMutations] -> assumes [FinalConflicting], [FrameDelayed],
|
|
1305
829
|
// [Delayed] already executed [FrameDelayed] -> assumes
|
|
1306
|
-
// [FinalConflicting], [Delayed] already executed [FinalConflicting] ->
|
|
1307
|
-
// adjusted based on [Delayed], no dependency on [FinalConflicting],
|
|
830
|
+
// [FinalConflicting], [Delayed] already executed [FinalConflicting] ->
|
|
831
|
+
// is adjusted based on [Delayed], no dependency on [FinalConflicting],
|
|
1308
832
|
// [FrameDelayed] [Delayed] -> adjusted for [FinalConflicting]; assumes
|
|
1309
833
|
// [ImmediateMutations] not executed yet
|
|
1310
834
|
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
|
|
@@ -1322,22 +846,21 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1322
846
|
// [ImmediateExecutions] -> assumes [FinalConflicting], [Delayed],
|
|
1323
847
|
// [FrameDelayed] already executed [FrameDelayed] -> adjusted for
|
|
1324
848
|
// [Delayed]; assumes [FinalConflicting] already executed
|
|
1325
|
-
// [FinalConflicting] -> is adjusted based on [Delayed], no dependency
|
|
1326
|
-
// [FinalConflicting], [FrameDelayed] [Delayed] -> adjusted for
|
|
849
|
+
// [FinalConflicting] -> is adjusted based on [Delayed], no dependency
|
|
850
|
+
// on [FinalConflicting], [FrameDelayed] [Delayed] -> adjusted for
|
|
1327
851
|
// [FinalConflicting]; assumes [ImmediateExecutions] not executed yet
|
|
1328
852
|
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
|
|
1329
853
|
LOG(ERROR) << "Adjust [FrameDelayed] based on [Delayed]";
|
|
1330
854
|
#endif
|
|
1331
855
|
for (auto &keyframe : inflightAnimations_.back().keyFrames) {
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
mutation.type == ShadowViewMutation::Type::Remove) {
|
|
856
|
+
for (auto &finalMutation : keyframe.finalMutationsForKeyFrame) {
|
|
857
|
+
if (finalMutation.type == ShadowViewMutation::Type::Insert ||
|
|
858
|
+
finalMutation.type == ShadowViewMutation::Type::Remove) {
|
|
1336
859
|
// When adjusting, skip adjusting against last animation - because
|
|
1337
860
|
// all `mutation`s here come from the last animation, so we can't
|
|
1338
861
|
// adjust a batch against itself.
|
|
1339
862
|
adjustImmediateMutationIndicesForDelayedMutations(
|
|
1340
|
-
surfaceId,
|
|
863
|
+
surfaceId, finalMutation, true);
|
|
1341
864
|
}
|
|
1342
865
|
}
|
|
1343
866
|
}
|
|
@@ -1345,21 +868,21 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1345
868
|
// Adjust [ImmediateExecutions] based on [Delayed]
|
|
1346
869
|
// Knowledge Graph:
|
|
1347
870
|
// [ImmediateExecutions] -> adjusted for [FrameDelayed], [Delayed];
|
|
1348
|
-
// assumes [FinalConflicting] already executed [FrameDelayed] ->
|
|
1349
|
-
// for [Delayed]; assumes [FinalConflicting] already executed
|
|
1350
|
-
// [FinalConflicting] -> is adjusted based on [Delayed], no dependency
|
|
1351
|
-
// [FinalConflicting], [FrameDelayed] [Delayed] -> adjusted for
|
|
871
|
+
// assumes [FinalConflicting] already executed [FrameDelayed] ->
|
|
872
|
+
// adjusted for [Delayed]; assumes [FinalConflicting] already executed
|
|
873
|
+
// [FinalConflicting] -> is adjusted based on [Delayed], no dependency
|
|
874
|
+
// on [FinalConflicting], [FrameDelayed] [Delayed] -> adjusted for
|
|
1352
875
|
// [FinalConflicting]; assumes [ImmediateExecutions] not executed yet
|
|
1353
876
|
//
|
|
1354
877
|
// THEN,
|
|
1355
|
-
// Adjust [Delayed] based on [ImmediateExecutions] and
|
|
1356
|
-
// Knowledge Graph:
|
|
1357
|
-
//
|
|
1358
|
-
//
|
|
1359
|
-
//
|
|
1360
|
-
//
|
|
1361
|
-
// [
|
|
1362
|
-
// [
|
|
878
|
+
// Adjust [Delayed] based on [ImmediateExecutions] and
|
|
879
|
+
// [FinalConflicting] Knowledge Graph: [ImmediateExecutions] -> adjusted
|
|
880
|
+
// for [FrameDelayed], [Delayed]; assumes [FinalConflicting] already
|
|
881
|
+
// executed [FrameDelayed] -> adjusted for [Delayed]; assumes
|
|
882
|
+
// [FinalConflicting] already executed [FinalConflicting] -> is adjusted
|
|
883
|
+
// based on [Delayed], no dependency on [FinalConflicting],
|
|
884
|
+
// [FrameDelayed] [Delayed] -> adjusted for [FinalConflicting],
|
|
885
|
+
// [ImmediateExecutions]
|
|
1363
886
|
//
|
|
1364
887
|
// We do these in the same loop because each immediate execution is
|
|
1365
888
|
// impacted by each delayed mutation, and also can impact each delayed
|
|
@@ -1371,9 +894,9 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1371
894
|
for (auto &mutation : immediateMutations) {
|
|
1372
895
|
// Note: when adjusting [ImmediateExecutions] based on [FrameDelayed],
|
|
1373
896
|
// we need only adjust Inserts. Since inserts are executed
|
|
1374
|
-
// highest-index-first, lower indices being delayed does not impact
|
|
1375
|
-
// higher-index removals; and conversely, higher indices being
|
|
1376
|
-
// cannot impact lower index removal, regardless of order.
|
|
897
|
+
// highest-index-first, lower indices being delayed does not impact
|
|
898
|
+
// the higher-index removals; and conversely, higher indices being
|
|
899
|
+
// delayed cannot impact lower index removal, regardless of order.
|
|
1377
900
|
if (mutation.type == ShadowViewMutation::Type::Insert ||
|
|
1378
901
|
mutation.type == ShadowViewMutation::Type::Remove) {
|
|
1379
902
|
adjustImmediateMutationIndicesForDelayedMutations(
|
|
@@ -1387,76 +910,36 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1387
910
|
}
|
|
1388
911
|
}
|
|
1389
912
|
|
|
1390
|
-
// If the knowledge graph progression above is correct, it is now safe
|
|
1391
|
-
// execute finalConflictingMutations and immediateMutations in that
|
|
1392
|
-
// and to queue the delayed animations from this frame.
|
|
913
|
+
// If the knowledge graph progression above is correct, it is now safe
|
|
914
|
+
// to execute finalConflictingMutations and immediateMutations in that
|
|
915
|
+
// order, and to queue the delayed animations from this frame.
|
|
1393
916
|
//
|
|
1394
917
|
// Execute the conflicting, delayed operations immediately. Any UPDATE
|
|
1395
918
|
// operations that smoothly transition into another animation will be
|
|
1396
919
|
// overridden by generated UPDATE operations at the end of the list, and
|
|
1397
920
|
// we want any REMOVE or DELETE operations to execute immediately.
|
|
1398
|
-
// Additionally, this should allow us to avoid performing index
|
|
1399
|
-
// between this list of conflicting animations and the batch
|
|
1400
|
-
// to execute.
|
|
921
|
+
// Additionally, this should allow us to avoid performing index
|
|
922
|
+
// adjustment between this list of conflicting animations and the batch
|
|
923
|
+
// we're about to execute.
|
|
1401
924
|
finalConflictingMutations.insert(
|
|
1402
925
|
finalConflictingMutations.end(),
|
|
1403
926
|
immediateMutations.begin(),
|
|
1404
927
|
immediateMutations.end());
|
|
1405
928
|
mutations = finalConflictingMutations;
|
|
1406
|
-
} /* if (currentAnimation) */
|
|
929
|
+
} /* if (currentAnimation) */
|
|
930
|
+
else {
|
|
1407
931
|
// If there's no "next" animation, make sure we queue up "final"
|
|
1408
932
|
// operations from all ongoing, conflicting animations.
|
|
1409
933
|
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
|
|
1410
|
-
LOG(ERROR) << "No Animation: Queue up final conflicting animations";
|
|
1411
|
-
#endif
|
|
1412
|
-
ShadowViewMutationList finalMutationsForConflictingAnimations{};
|
|
1413
|
-
for (auto const &keyFrame : conflictingAnimations) {
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
keyFrame.viewPrev,
|
|
1420
|
-
finalMutation.newChildShadowView,
|
|
1421
|
-
finalMutation.index};
|
|
1422
|
-
PrintMutationInstruction(
|
|
1423
|
-
"No Animation: Queueing up final conflicting mutation instruction",
|
|
1424
|
-
mutation);
|
|
1425
|
-
finalMutationsForConflictingAnimations.push_back(mutation);
|
|
1426
|
-
} else {
|
|
1427
|
-
// If there's no final mutation associated, create a mutation that
|
|
1428
|
-
// corresponds to the animation being 100% complete. This is important
|
|
1429
|
-
// for, for example, INSERT mutations being animated from opacity 0
|
|
1430
|
-
// to 1. If the animation is interrupted we must force the View to be
|
|
1431
|
-
// at opacity 1.
|
|
1432
|
-
// For Android - since it passes along only deltas, not an entire bag
|
|
1433
|
-
// of props - generate an "animation" frame corresponding to a final
|
|
1434
|
-
// update for this view. Only then, generate an update that will cause
|
|
1435
|
-
// the ShadowTree to be consistent with the Mounting layer by passing
|
|
1436
|
-
// viewEnd, unmodified, to the mounting layer. This helps with, for
|
|
1437
|
-
// example, opacity animations.
|
|
1438
|
-
auto mutatedShadowView = createInterpolatedShadowView(
|
|
1439
|
-
1, keyFrame.viewStart, keyFrame.viewEnd);
|
|
1440
|
-
auto generatedPenultimateMutation =
|
|
1441
|
-
ShadowViewMutation::UpdateMutation(
|
|
1442
|
-
keyFrame.viewPrev, mutatedShadowView);
|
|
1443
|
-
assert(generatedPenultimateMutation.oldChildShadowView.tag != 0);
|
|
1444
|
-
assert(generatedPenultimateMutation.newChildShadowView.tag != 0);
|
|
1445
|
-
PrintMutationInstruction(
|
|
1446
|
-
"No Animation: Queueing up penultimate mutation instruction - synthetic",
|
|
1447
|
-
generatedPenultimateMutation);
|
|
1448
|
-
finalMutationsForConflictingAnimations.push_back(
|
|
1449
|
-
generatedPenultimateMutation);
|
|
1450
|
-
|
|
1451
|
-
auto generatedMutation = ShadowViewMutation::UpdateMutation(
|
|
1452
|
-
mutatedShadowView, keyFrame.viewEnd);
|
|
1453
|
-
assert(generatedMutation.oldChildShadowView.tag != 0);
|
|
1454
|
-
assert(generatedMutation.newChildShadowView.tag != 0);
|
|
1455
|
-
PrintMutationInstruction(
|
|
1456
|
-
"No Animation: Queueing up final mutation instruction - synthetic",
|
|
1457
|
-
generatedMutation);
|
|
1458
|
-
finalMutationsForConflictingAnimations.push_back(generatedMutation);
|
|
1459
|
-
}
|
|
934
|
+
LOG(ERROR) << "No Animation: Queue up final conflicting animations";
|
|
935
|
+
#endif
|
|
936
|
+
ShadowViewMutationList finalMutationsForConflictingAnimations{};
|
|
937
|
+
for (auto const &keyFrame : conflictingAnimations) {
|
|
938
|
+
queueFinalMutationsForCompletedKeyFrame(
|
|
939
|
+
keyFrame,
|
|
940
|
+
finalMutationsForConflictingAnimations,
|
|
941
|
+
true,
|
|
942
|
+
"Conflict with non-animated mutation");
|
|
1460
943
|
}
|
|
1461
944
|
|
|
1462
945
|
// Make sure that all operations execute in the proper order.
|
|
@@ -1477,10 +960,10 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1477
960
|
}
|
|
1478
961
|
}
|
|
1479
962
|
|
|
1480
|
-
// The ShadowTree layer doesn't realize that certain operations have
|
|
1481
|
-
// delayed, so we must adjust all Remove and Insert operations
|
|
1482
|
-
// what else has been deferred, whether we are executing this
|
|
1483
|
-
// or later.
|
|
963
|
+
// The ShadowTree layer doesn't realize that certain operations have
|
|
964
|
+
// been delayed, so we must adjust all Remove and Insert operations
|
|
965
|
+
// based on what else has been deferred, whether we are executing this
|
|
966
|
+
// immediately or later.
|
|
1484
967
|
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
|
|
1485
968
|
LOG(ERROR)
|
|
1486
969
|
<< "No Animation: Adjust mutations based on remaining delayed mutations / adjust delayed, based on each";
|
|
@@ -1524,186 +1007,673 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
1524
1007
|
}
|
|
1525
1008
|
}
|
|
1526
1009
|
|
|
1527
|
-
mutations.insert(
|
|
1528
|
-
mutations.end(),
|
|
1529
|
-
mutationsForAnimation.begin(),
|
|
1530
|
-
mutationsForAnimation.end());
|
|
1010
|
+
mutations.insert(
|
|
1011
|
+
mutations.end(),
|
|
1012
|
+
mutationsForAnimation.begin(),
|
|
1013
|
+
mutationsForAnimation.end());
|
|
1014
|
+
|
|
1015
|
+
// DEBUG ONLY: list existing inflight animations
|
|
1016
|
+
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
|
|
1017
|
+
LOG(ERROR) << "FINISHING DISPLAYING ONGOING inflightAnimations_!";
|
|
1018
|
+
int i = 0;
|
|
1019
|
+
int j = 0;
|
|
1020
|
+
for (auto const &inflightAnimation : inflightAnimations_) {
|
|
1021
|
+
i++;
|
|
1022
|
+
j = 0;
|
|
1023
|
+
if (inflightAnimation.completed) {
|
|
1024
|
+
continue;
|
|
1025
|
+
}
|
|
1026
|
+
for (auto &keyframe : inflightAnimation.keyFrames) {
|
|
1027
|
+
j++;
|
|
1028
|
+
if (keyframe.invalidated) {
|
|
1029
|
+
continue;
|
|
1030
|
+
}
|
|
1031
|
+
for (auto const &finalMutation : keyframe.finalMutationsForKeyFrame) {
|
|
1032
|
+
if (!finalMutation.mutatedViewIsVirtual()) {
|
|
1033
|
+
std::string msg = "Animation " + std::to_string(i) + " keyframe " +
|
|
1034
|
+
std::to_string(j) + ": Final Animation";
|
|
1035
|
+
PrintMutationInstruction(msg, finalMutation);
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
LOG(ERROR) << "FINISHING DONE DISPLAYING ONGOING inflightAnimations_!";
|
|
1041
|
+
#endif
|
|
1042
|
+
|
|
1043
|
+
// Signal to delegate if all animations are complete, or if we were not
|
|
1044
|
+
// animating anything and now some animation exists.
|
|
1045
|
+
if (inflightAnimationsExistInitially && inflightAnimations_.empty()) {
|
|
1046
|
+
std::lock_guard<std::mutex> lock(layoutAnimationStatusDelegateMutex_);
|
|
1047
|
+
if (layoutAnimationStatusDelegate_ != nullptr) {
|
|
1048
|
+
layoutAnimationStatusDelegate_->onAllAnimationsComplete();
|
|
1049
|
+
}
|
|
1050
|
+
} else if (
|
|
1051
|
+
!inflightAnimationsExistInitially && !inflightAnimations_.empty()) {
|
|
1052
|
+
std::lock_guard<std::mutex> lock(layoutAnimationStatusDelegateMutex_);
|
|
1053
|
+
if (layoutAnimationStatusDelegate_ != nullptr) {
|
|
1054
|
+
layoutAnimationStatusDelegate_->onAnimationStarted();
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
simulateImagePropsMemoryAccess(mutations);
|
|
1059
|
+
|
|
1060
|
+
return MountingTransaction{
|
|
1061
|
+
surfaceId, transactionNumber, std::move(mutations), telemetry};
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
void LayoutAnimationKeyFrameManager::uiManagerDidConfigureNextLayoutAnimation(
|
|
1065
|
+
LayoutAnimation layoutAnimation) const {
|
|
1066
|
+
currentAnimation_ = better::optional<LayoutAnimation>{layoutAnimation};
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
void LayoutAnimationKeyFrameManager::setLayoutAnimationStatusDelegate(
|
|
1070
|
+
LayoutAnimationStatusDelegate *delegate) const {
|
|
1071
|
+
std::lock_guard<std::mutex> lock(layoutAnimationStatusDelegateMutex_);
|
|
1072
|
+
layoutAnimationStatusDelegate_ = delegate;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
void LayoutAnimationKeyFrameManager::setClockNow(
|
|
1076
|
+
std::function<uint64_t()> now) {
|
|
1077
|
+
now_ = now;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
void LayoutAnimationKeyFrameManager::enableSkipInvalidatedKeyFrames() {
|
|
1081
|
+
skipInvalidatedKeyFrames_ = true;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
void LayoutAnimationKeyFrameManager::enableCrashOnMissingComponentDescriptor() {
|
|
1085
|
+
crashOnMissingComponentDescriptor_ = true;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
void LayoutAnimationKeyFrameManager::enableSimulateImagePropsMemoryAccess() {
|
|
1089
|
+
simulateImagePropsMemoryAccess_ = true;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
#pragma mark - Protected
|
|
1093
|
+
|
|
1094
|
+
bool LayoutAnimationKeyFrameManager::hasComponentDescriptorForShadowView(
|
|
1095
|
+
ShadowView const &shadowView) const {
|
|
1096
|
+
auto hasComponentDescriptor =
|
|
1097
|
+
componentDescriptorRegistry_->hasComponentDescriptorAt(
|
|
1098
|
+
shadowView.componentHandle);
|
|
1099
|
+
|
|
1100
|
+
if (crashOnMissingComponentDescriptor_ && !hasComponentDescriptor) {
|
|
1101
|
+
LOG(FATAL) << "Component descriptor with handle: "
|
|
1102
|
+
<< shadowView.componentHandle
|
|
1103
|
+
<< " doesn't exist. The component name: "
|
|
1104
|
+
<< shadowView.componentName;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
return hasComponentDescriptor;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
ComponentDescriptor const &
|
|
1111
|
+
LayoutAnimationKeyFrameManager::getComponentDescriptorForShadowView(
|
|
1112
|
+
ShadowView const &shadowView) const {
|
|
1113
|
+
return componentDescriptorRegistry_->at(shadowView.componentHandle);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
ShadowView LayoutAnimationKeyFrameManager::createInterpolatedShadowView(
|
|
1117
|
+
double progress,
|
|
1118
|
+
ShadowView const &startingView,
|
|
1119
|
+
ShadowView const &finalView) const {
|
|
1120
|
+
react_native_assert(startingView.tag > 0);
|
|
1121
|
+
react_native_assert(finalView.tag > 0);
|
|
1122
|
+
if (!hasComponentDescriptorForShadowView(startingView)) {
|
|
1123
|
+
LOG(ERROR) << "No ComponentDescriptor for ShadowView being animated: ["
|
|
1124
|
+
<< startingView.tag << "]";
|
|
1125
|
+
react_native_assert(false);
|
|
1126
|
+
return finalView;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
ComponentDescriptor const &componentDescriptor =
|
|
1130
|
+
getComponentDescriptorForShadowView(startingView);
|
|
1131
|
+
|
|
1132
|
+
// Base the mutated view on the finalView, so that the following stay
|
|
1133
|
+
// consistent:
|
|
1134
|
+
// - state
|
|
1135
|
+
// - eventEmitter
|
|
1136
|
+
// For now, we do not allow interpolation of state. And we probably never
|
|
1137
|
+
// will, so make sure we always keep the mounting layer consistent with the
|
|
1138
|
+
// "final" state.
|
|
1139
|
+
auto mutatedShadowView = ShadowView(finalView);
|
|
1140
|
+
react_native_assert(mutatedShadowView.tag > 0);
|
|
1141
|
+
|
|
1142
|
+
react_native_assert(startingView.props != nullptr);
|
|
1143
|
+
react_native_assert(finalView.props != nullptr);
|
|
1144
|
+
if (startingView.props == nullptr || finalView.props == nullptr) {
|
|
1145
|
+
return finalView;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
// Animate opacity or scale/transform
|
|
1149
|
+
PropsParserContext propsParserContext{
|
|
1150
|
+
finalView.surfaceId, *contextContainer_};
|
|
1151
|
+
mutatedShadowView.props = componentDescriptor.interpolateProps(
|
|
1152
|
+
propsParserContext, progress, startingView.props, finalView.props);
|
|
1153
|
+
react_native_assert(mutatedShadowView.props != nullptr);
|
|
1154
|
+
if (mutatedShadowView.props == nullptr) {
|
|
1155
|
+
return finalView;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
// Interpolate LayoutMetrics
|
|
1159
|
+
LayoutMetrics const &finalLayoutMetrics = finalView.layoutMetrics;
|
|
1160
|
+
LayoutMetrics const &baselineLayoutMetrics = startingView.layoutMetrics;
|
|
1161
|
+
LayoutMetrics interpolatedLayoutMetrics = finalLayoutMetrics;
|
|
1162
|
+
interpolatedLayoutMetrics.frame.origin.x = interpolateFloats(
|
|
1163
|
+
progress,
|
|
1164
|
+
baselineLayoutMetrics.frame.origin.x,
|
|
1165
|
+
finalLayoutMetrics.frame.origin.x);
|
|
1166
|
+
interpolatedLayoutMetrics.frame.origin.y = interpolateFloats(
|
|
1167
|
+
progress,
|
|
1168
|
+
baselineLayoutMetrics.frame.origin.y,
|
|
1169
|
+
finalLayoutMetrics.frame.origin.y);
|
|
1170
|
+
interpolatedLayoutMetrics.frame.size.width = interpolateFloats(
|
|
1171
|
+
progress,
|
|
1172
|
+
baselineLayoutMetrics.frame.size.width,
|
|
1173
|
+
finalLayoutMetrics.frame.size.width);
|
|
1174
|
+
interpolatedLayoutMetrics.frame.size.height = interpolateFloats(
|
|
1175
|
+
progress,
|
|
1176
|
+
baselineLayoutMetrics.frame.size.height,
|
|
1177
|
+
finalLayoutMetrics.frame.size.height);
|
|
1178
|
+
mutatedShadowView.layoutMetrics = interpolatedLayoutMetrics;
|
|
1179
|
+
|
|
1180
|
+
return mutatedShadowView;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
void LayoutAnimationKeyFrameManager::callCallback(
|
|
1184
|
+
LayoutAnimationCallbackWrapper const &callback) const {
|
|
1185
|
+
runtimeExecutor_(
|
|
1186
|
+
[callback](jsi::Runtime &runtime) { callback.call(runtime); });
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
void LayoutAnimationKeyFrameManager::queueFinalMutationsForCompletedKeyFrame(
|
|
1190
|
+
AnimationKeyFrame const &keyframe,
|
|
1191
|
+
ShadowViewMutation::List &mutationsList,
|
|
1192
|
+
bool interrupted,
|
|
1193
|
+
const std::string &logPrefix) const {
|
|
1194
|
+
if (skipInvalidatedKeyFrames_ && keyframe.invalidated) {
|
|
1195
|
+
return;
|
|
1196
|
+
}
|
|
1197
|
+
if (keyframe.finalMutationsForKeyFrame.size() > 0) {
|
|
1198
|
+
// TODO: modularize this segment, it is repeated 2x in KeyFrameManager
|
|
1199
|
+
// as well.
|
|
1200
|
+
ShadowView prev = keyframe.viewPrev;
|
|
1201
|
+
for (auto const &finalMutation : keyframe.finalMutationsForKeyFrame) {
|
|
1202
|
+
PrintMutationInstruction(
|
|
1203
|
+
logPrefix + ": Queuing up Final Mutation:", finalMutation);
|
|
1204
|
+
// Copy so that if something else mutates the inflight animations,
|
|
1205
|
+
// it won't change this mutation after this point.
|
|
1206
|
+
switch (finalMutation.type) {
|
|
1207
|
+
// For CREATE/INSERT this will contain CREATE, INSERT in that order.
|
|
1208
|
+
// For REMOVE/DELETE, same.
|
|
1209
|
+
case ShadowViewMutation::Type::Create:
|
|
1210
|
+
mutationsList.push_back(ShadowViewMutation::CreateMutation(
|
|
1211
|
+
finalMutation.newChildShadowView));
|
|
1212
|
+
break;
|
|
1213
|
+
case ShadowViewMutation::Type::Delete:
|
|
1214
|
+
mutationsList.push_back(ShadowViewMutation::DeleteMutation(prev));
|
|
1215
|
+
break;
|
|
1216
|
+
case ShadowViewMutation::Type::Insert:
|
|
1217
|
+
mutationsList.push_back(ShadowViewMutation::InsertMutation(
|
|
1218
|
+
finalMutation.parentShadowView,
|
|
1219
|
+
finalMutation.newChildShadowView,
|
|
1220
|
+
finalMutation.index));
|
|
1221
|
+
break;
|
|
1222
|
+
case ShadowViewMutation::Type::Remove:
|
|
1223
|
+
mutationsList.push_back(ShadowViewMutation::RemoveMutation(
|
|
1224
|
+
finalMutation.parentShadowView, prev, finalMutation.index));
|
|
1225
|
+
break;
|
|
1226
|
+
case ShadowViewMutation::Type::Update:
|
|
1227
|
+
mutationsList.push_back(ShadowViewMutation::UpdateMutation(
|
|
1228
|
+
prev, finalMutation.newChildShadowView));
|
|
1229
|
+
break;
|
|
1230
|
+
}
|
|
1231
|
+
if (finalMutation.newChildShadowView.tag > 0) {
|
|
1232
|
+
prev = finalMutation.newChildShadowView;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
} else {
|
|
1236
|
+
// If there's no final mutation associated, create a mutation that
|
|
1237
|
+
// corresponds to the animation being 100% complete. This is
|
|
1238
|
+
// important for, for example, INSERT mutations being animated from
|
|
1239
|
+
// opacity 0 to 1. If the animation is interrupted we must force the
|
|
1240
|
+
// View to be at opacity 1. For Android - since it passes along only
|
|
1241
|
+
// deltas, not an entire bag of props - generate an "animation"
|
|
1242
|
+
// frame corresponding to a final update for this view. Only then,
|
|
1243
|
+
// generate an update that will cause the ShadowTree to be
|
|
1244
|
+
// consistent with the Mounting layer by passing viewEnd,
|
|
1245
|
+
// unmodified, to the mounting layer. This helps with, for example,
|
|
1246
|
+
// opacity animations.
|
|
1247
|
+
// This is necessary for INSERT (create) and UPDATE (update) mutations, but
|
|
1248
|
+
// not REMOVE/DELETE mutations ("delete" animations).
|
|
1249
|
+
if (interrupted) {
|
|
1250
|
+
auto mutatedShadowView =
|
|
1251
|
+
createInterpolatedShadowView(1, keyframe.viewStart, keyframe.viewEnd);
|
|
1252
|
+
auto generatedPenultimateMutation = ShadowViewMutation::UpdateMutation(
|
|
1253
|
+
keyframe.viewPrev, mutatedShadowView);
|
|
1254
|
+
react_native_assert(
|
|
1255
|
+
generatedPenultimateMutation.oldChildShadowView.tag > 0);
|
|
1256
|
+
react_native_assert(
|
|
1257
|
+
generatedPenultimateMutation.newChildShadowView.tag > 0);
|
|
1258
|
+
PrintMutationInstruction(
|
|
1259
|
+
"Queueing up penultimate mutation instruction - synthetic",
|
|
1260
|
+
generatedPenultimateMutation);
|
|
1261
|
+
mutationsList.push_back(generatedPenultimateMutation);
|
|
1262
|
+
|
|
1263
|
+
auto generatedMutation = ShadowViewMutation::UpdateMutation(
|
|
1264
|
+
mutatedShadowView, keyframe.viewEnd);
|
|
1265
|
+
react_native_assert(generatedMutation.oldChildShadowView.tag > 0);
|
|
1266
|
+
react_native_assert(generatedMutation.newChildShadowView.tag > 0);
|
|
1267
|
+
PrintMutationInstruction(
|
|
1268
|
+
"Queueing up final mutation instruction - synthetic",
|
|
1269
|
+
generatedMutation);
|
|
1270
|
+
mutationsList.push_back(generatedMutation);
|
|
1271
|
+
} else {
|
|
1272
|
+
auto mutation = ShadowViewMutation::UpdateMutation(
|
|
1273
|
+
keyframe.viewPrev, keyframe.viewEnd);
|
|
1274
|
+
PrintMutationInstruction(
|
|
1275
|
+
logPrefix +
|
|
1276
|
+
"Animation Complete: Queuing up Final Synthetic Mutation:",
|
|
1277
|
+
mutation);
|
|
1278
|
+
react_native_assert(mutation.oldChildShadowView.tag > 0);
|
|
1279
|
+
react_native_assert(mutation.newChildShadowView.tag > 0);
|
|
1280
|
+
mutationsList.push_back(std::move(mutation));
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
#pragma mark - Private
|
|
1286
|
+
|
|
1287
|
+
void LayoutAnimationKeyFrameManager::
|
|
1288
|
+
adjustImmediateMutationIndicesForDelayedMutations(
|
|
1289
|
+
SurfaceId surfaceId,
|
|
1290
|
+
ShadowViewMutation &mutation,
|
|
1291
|
+
bool skipLastAnimation,
|
|
1292
|
+
bool lastAnimationOnly) const {
|
|
1293
|
+
bool isRemoveMutation = mutation.type == ShadowViewMutation::Type::Remove;
|
|
1294
|
+
react_native_assert(
|
|
1295
|
+
isRemoveMutation || mutation.type == ShadowViewMutation::Type::Insert);
|
|
1296
|
+
|
|
1297
|
+
// TODO: turn all of this into a lambda and share code?
|
|
1298
|
+
if (mutation.mutatedViewIsVirtual()) {
|
|
1299
|
+
PrintMutationInstruction(
|
|
1300
|
+
"[IndexAdjustment] Not calling adjustImmediateMutationIndicesForDelayedMutations, is virtual, for:",
|
|
1301
|
+
mutation);
|
|
1302
|
+
return;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
PrintMutationInstruction(
|
|
1306
|
+
"[IndexAdjustment] Calling adjustImmediateMutationIndicesForDelayedMutations for:",
|
|
1307
|
+
mutation);
|
|
1308
|
+
|
|
1309
|
+
// First, collect all final mutations that could impact this immediate
|
|
1310
|
+
// mutation.
|
|
1311
|
+
std::vector<ShadowViewMutation *> candidateMutations{};
|
|
1312
|
+
|
|
1313
|
+
for (auto inflightAnimationIt =
|
|
1314
|
+
inflightAnimations_.rbegin() + (skipLastAnimation ? 1 : 0);
|
|
1315
|
+
inflightAnimationIt != inflightAnimations_.rend();
|
|
1316
|
+
inflightAnimationIt++) {
|
|
1317
|
+
auto &inflightAnimation = *inflightAnimationIt;
|
|
1318
|
+
if (inflightAnimation.surfaceId != surfaceId) {
|
|
1319
|
+
continue;
|
|
1320
|
+
}
|
|
1321
|
+
if (inflightAnimation.completed) {
|
|
1322
|
+
continue;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
for (auto it = inflightAnimation.keyFrames.begin();
|
|
1326
|
+
it != inflightAnimation.keyFrames.end();
|
|
1327
|
+
it++) {
|
|
1328
|
+
auto &animatedKeyFrame = *it;
|
|
1329
|
+
|
|
1330
|
+
if (animatedKeyFrame.invalidated) {
|
|
1331
|
+
continue;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
// Detect if they're in the same view hierarchy, but not equivalent
|
|
1335
|
+
// We've already detected direct conflicts and removed them.
|
|
1336
|
+
if (animatedKeyFrame.parentView.tag != mutation.parentShadowView.tag) {
|
|
1337
|
+
continue;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
for (auto &delayedMutation : animatedKeyFrame.finalMutationsForKeyFrame) {
|
|
1341
|
+
if (delayedMutation.type != ShadowViewMutation::Type::Remove) {
|
|
1342
|
+
continue;
|
|
1343
|
+
}
|
|
1344
|
+
if (delayedMutation.mutatedViewIsVirtual()) {
|
|
1345
|
+
continue;
|
|
1346
|
+
}
|
|
1347
|
+
if (delayedMutation.oldChildShadowView.tag ==
|
|
1348
|
+
(isRemoveMutation ? mutation.oldChildShadowView.tag
|
|
1349
|
+
: mutation.newChildShadowView.tag)) {
|
|
1350
|
+
continue;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
PrintMutationInstructionRelative(
|
|
1354
|
+
"[IndexAdjustment] adjustImmediateMutationIndicesForDelayedMutations CANDIDATE for:",
|
|
1355
|
+
mutation,
|
|
1356
|
+
delayedMutation);
|
|
1357
|
+
candidateMutations.push_back(&delayedMutation);
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
if (lastAnimationOnly) {
|
|
1362
|
+
break;
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
// While the mutation keeps being affected, keep checking. We use the vector
|
|
1367
|
+
// so we only perform one adjustment per delayed mutation. See comments at
|
|
1368
|
+
// bottom of adjustDelayedMutationIndicesForMutation for further explanation.
|
|
1369
|
+
bool changed = true;
|
|
1370
|
+
int adjustedDelta = 0;
|
|
1371
|
+
while (changed) {
|
|
1372
|
+
changed = false;
|
|
1373
|
+
candidateMutations.erase(
|
|
1374
|
+
std::remove_if(
|
|
1375
|
+
candidateMutations.begin(),
|
|
1376
|
+
candidateMutations.end(),
|
|
1377
|
+
[&changed, &mutation, &adjustedDelta, &isRemoveMutation](
|
|
1378
|
+
ShadowViewMutation *candidateMutation) {
|
|
1379
|
+
bool indexConflicts =
|
|
1380
|
+
(candidateMutation->index < mutation.index ||
|
|
1381
|
+
(isRemoveMutation &&
|
|
1382
|
+
candidateMutation->index == mutation.index));
|
|
1383
|
+
if (indexConflicts) {
|
|
1384
|
+
mutation.index++;
|
|
1385
|
+
adjustedDelta++;
|
|
1386
|
+
changed = true;
|
|
1387
|
+
PrintMutationInstructionRelative(
|
|
1388
|
+
"[IndexAdjustment] adjustImmediateMutationIndicesForDelayedMutations: Adjusting mutation UPWARD",
|
|
1389
|
+
mutation,
|
|
1390
|
+
*candidateMutation);
|
|
1391
|
+
return true;
|
|
1392
|
+
}
|
|
1393
|
+
return false;
|
|
1394
|
+
}),
|
|
1395
|
+
candidateMutations.end());
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
void LayoutAnimationKeyFrameManager::adjustDelayedMutationIndicesForMutation(
|
|
1400
|
+
SurfaceId surfaceId,
|
|
1401
|
+
ShadowViewMutation const &mutation,
|
|
1402
|
+
bool skipLastAnimation) const {
|
|
1403
|
+
bool isRemoveMutation = mutation.type == ShadowViewMutation::Type::Remove;
|
|
1404
|
+
bool isInsertMutation = mutation.type == ShadowViewMutation::Type::Insert;
|
|
1405
|
+
auto tag = isRemoveMutation ? mutation.oldChildShadowView.tag
|
|
1406
|
+
: mutation.newChildShadowView.tag;
|
|
1407
|
+
react_native_assert(isRemoveMutation || isInsertMutation);
|
|
1408
|
+
|
|
1409
|
+
if (mutation.mutatedViewIsVirtual()) {
|
|
1410
|
+
PrintMutationInstruction(
|
|
1411
|
+
"[IndexAdjustment] Not calling adjustDelayedMutationIndicesForMutation, is virtual, for:",
|
|
1412
|
+
mutation);
|
|
1413
|
+
return;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
// First, collect all final mutations that could impact this immediate
|
|
1417
|
+
// mutation.
|
|
1418
|
+
std::vector<ShadowViewMutation *> candidateMutations{};
|
|
1531
1419
|
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1420
|
+
for (auto inflightAnimationIt =
|
|
1421
|
+
inflightAnimations_.rbegin() + (skipLastAnimation ? 1 : 0);
|
|
1422
|
+
inflightAnimationIt != inflightAnimations_.rend();
|
|
1423
|
+
inflightAnimationIt++) {
|
|
1424
|
+
auto &inflightAnimation = *inflightAnimationIt;
|
|
1425
|
+
|
|
1426
|
+
if (inflightAnimation.surfaceId != surfaceId) {
|
|
1427
|
+
continue;
|
|
1428
|
+
}
|
|
1540
1429
|
if (inflightAnimation.completed) {
|
|
1541
1430
|
continue;
|
|
1542
1431
|
}
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1432
|
+
|
|
1433
|
+
for (auto it = inflightAnimation.keyFrames.begin();
|
|
1434
|
+
it != inflightAnimation.keyFrames.end();
|
|
1435
|
+
it++) {
|
|
1436
|
+
auto &animatedKeyFrame = *it;
|
|
1437
|
+
|
|
1438
|
+
if (animatedKeyFrame.invalidated) {
|
|
1546
1439
|
continue;
|
|
1547
1440
|
}
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
} else {
|
|
1554
|
-
LOG(ERROR) << "Animation " << i << " keyframe " << j << ": on tag: ["
|
|
1555
|
-
<< keyframe.viewStart.tag << "]";
|
|
1441
|
+
|
|
1442
|
+
// Detect if they're in the same view hierarchy, but not equivalent
|
|
1443
|
+
// (We've already detected direct conflicts and handled them above)
|
|
1444
|
+
if (animatedKeyFrame.parentView.tag != mutation.parentShadowView.tag) {
|
|
1445
|
+
continue;
|
|
1556
1446
|
}
|
|
1557
|
-
}
|
|
1558
|
-
}
|
|
1559
|
-
LOG(ERROR) << "FINISHING DONE DISPLAYING ONGOING inflightAnimations_!";
|
|
1560
|
-
#endif
|
|
1561
1447
|
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1448
|
+
for (auto &finalAnimationMutation :
|
|
1449
|
+
animatedKeyFrame.finalMutationsForKeyFrame) {
|
|
1450
|
+
if (finalAnimationMutation.oldChildShadowView.tag == tag) {
|
|
1451
|
+
continue;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
if (finalAnimationMutation.type != ShadowViewMutation::Type::Remove) {
|
|
1455
|
+
continue;
|
|
1456
|
+
}
|
|
1457
|
+
if (finalAnimationMutation.mutatedViewIsVirtual()) {
|
|
1458
|
+
continue;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
PrintMutationInstructionRelative(
|
|
1462
|
+
"[IndexAdjustment] adjustDelayedMutationIndicesForMutation: CANDIDATE:",
|
|
1463
|
+
mutation,
|
|
1464
|
+
finalAnimationMutation);
|
|
1465
|
+
candidateMutations.push_back(&finalAnimationMutation);
|
|
1466
|
+
}
|
|
1574
1467
|
}
|
|
1575
1468
|
}
|
|
1576
1469
|
|
|
1577
|
-
|
|
1578
|
-
|
|
1470
|
+
// Because the finalAnimations are not sorted in any way, it is possible to
|
|
1471
|
+
// have some sequence like:
|
|
1472
|
+
// * DELAYED REMOVE 10 from {TAG}
|
|
1473
|
+
// * DELAYED REMOVE 9 from {TAG}
|
|
1474
|
+
// * ...
|
|
1475
|
+
// * DELAYED REMOVE 5 from {TAG}
|
|
1476
|
+
// with mutation: INSERT 6/REMOVE 6. This would cause the first few mutations
|
|
1477
|
+
// to *not* be adjusted, even though they would be impacted by mutation or
|
|
1478
|
+
// vice-versa after later adjustments are applied. Therefore, we just keep
|
|
1479
|
+
// recursing while there are any changes. This isn't great, but is good enough
|
|
1480
|
+
// for now until we change these data-structures.
|
|
1481
|
+
bool changed = true;
|
|
1482
|
+
while (changed) {
|
|
1483
|
+
changed = false;
|
|
1484
|
+
candidateMutations.erase(
|
|
1485
|
+
std::remove_if(
|
|
1486
|
+
candidateMutations.begin(),
|
|
1487
|
+
candidateMutations.end(),
|
|
1488
|
+
[&mutation, &isRemoveMutation, &isInsertMutation, &changed](
|
|
1489
|
+
ShadowViewMutation *candidateMutation) {
|
|
1490
|
+
if (isRemoveMutation &&
|
|
1491
|
+
mutation.index <= candidateMutation->index) {
|
|
1492
|
+
candidateMutation->index--;
|
|
1493
|
+
changed = true;
|
|
1494
|
+
PrintMutationInstructionRelative(
|
|
1495
|
+
"[IndexAdjustment] adjustDelayedMutationIndicesForMutation: Adjusting mutation DOWNWARD",
|
|
1496
|
+
mutation,
|
|
1497
|
+
*candidateMutation);
|
|
1498
|
+
return true;
|
|
1499
|
+
} else if (
|
|
1500
|
+
isInsertMutation &&
|
|
1501
|
+
mutation.index <= candidateMutation->index) {
|
|
1502
|
+
candidateMutation->index++;
|
|
1503
|
+
changed = true;
|
|
1504
|
+
PrintMutationInstructionRelative(
|
|
1505
|
+
"[IndexAdjustment] adjustDelayedMutationIndicesForMutation: Adjusting mutation UPWARD",
|
|
1506
|
+
mutation,
|
|
1507
|
+
*candidateMutation);
|
|
1508
|
+
return true;
|
|
1509
|
+
}
|
|
1510
|
+
return false;
|
|
1511
|
+
}),
|
|
1512
|
+
candidateMutations.end());
|
|
1513
|
+
}
|
|
1579
1514
|
}
|
|
1580
1515
|
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1516
|
+
void LayoutAnimationKeyFrameManager::getAndEraseConflictingAnimations(
|
|
1517
|
+
SurfaceId surfaceId,
|
|
1518
|
+
ShadowViewMutationList const &mutations,
|
|
1519
|
+
std::vector<AnimationKeyFrame> &conflictingAnimations) const {
|
|
1520
|
+
ShadowViewMutationList localConflictingMutations{};
|
|
1521
|
+
for (auto const &mutation : mutations) {
|
|
1522
|
+
bool mutationIsCreateOrDelete =
|
|
1523
|
+
mutation.type == ShadowViewMutation::Type::Create ||
|
|
1524
|
+
mutation.type == ShadowViewMutation::Type::Delete;
|
|
1525
|
+
auto const &baselineShadowView =
|
|
1526
|
+
(mutation.type == ShadowViewMutation::Type::Insert ||
|
|
1527
|
+
mutation.type == ShadowViewMutation::Type::Create)
|
|
1528
|
+
? mutation.newChildShadowView
|
|
1529
|
+
: mutation.oldChildShadowView;
|
|
1530
|
+
auto baselineTag = baselineShadowView.tag;
|
|
1595
1531
|
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1532
|
+
for (auto &inflightAnimation : inflightAnimations_) {
|
|
1533
|
+
if (inflightAnimation.surfaceId != surfaceId) {
|
|
1534
|
+
continue;
|
|
1535
|
+
}
|
|
1536
|
+
if (inflightAnimation.completed) {
|
|
1537
|
+
continue;
|
|
1538
|
+
}
|
|
1601
1539
|
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
return componentDescriptorRegistry_->at(shadowView.componentHandle);
|
|
1606
|
-
}
|
|
1540
|
+
for (auto it = inflightAnimation.keyFrames.begin();
|
|
1541
|
+
it != inflightAnimation.keyFrames.end();) {
|
|
1542
|
+
auto &animatedKeyFrame = *it;
|
|
1607
1543
|
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
}
|
|
1544
|
+
if (animatedKeyFrame.invalidated) {
|
|
1545
|
+
continue;
|
|
1546
|
+
}
|
|
1612
1547
|
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
ShadowView finalView) const {
|
|
1626
|
-
if (!hasComponentDescriptorForShadowView(startingView)) {
|
|
1627
|
-
return finalView;
|
|
1628
|
-
}
|
|
1629
|
-
ComponentDescriptor const &componentDescriptor =
|
|
1630
|
-
getComponentDescriptorForShadowView(startingView);
|
|
1548
|
+
// A conflict is when either: the animated node itself is mutated
|
|
1549
|
+
// directly; or, the parent of the node is created or deleted. In cases
|
|
1550
|
+
// of reparenting - say, the parent is deleted but the node was moved to
|
|
1551
|
+
// a different parent first - the reparenting (remove/insert) conflict
|
|
1552
|
+
// will be detected before we process the parent DELETE.
|
|
1553
|
+
// Parent deletion is important because deleting a parent recursively
|
|
1554
|
+
// deletes all children. If we previously deferred deletion of a child,
|
|
1555
|
+
// we need to force deletion/removal to happen immediately.
|
|
1556
|
+
bool conflicting = animatedKeyFrame.tag == baselineTag ||
|
|
1557
|
+
(mutationIsCreateOrDelete &&
|
|
1558
|
+
animatedKeyFrame.parentView.tag == baselineTag &&
|
|
1559
|
+
animatedKeyFrame.parentView.tag != 0);
|
|
1631
1560
|
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
// will, so make sure we always keep the mounting layer consistent with the
|
|
1638
|
-
// "final" state.
|
|
1639
|
-
auto mutatedShadowView = ShadowView(finalView);
|
|
1561
|
+
// Conflicting animation detected: if we're mutating a tag under
|
|
1562
|
+
// animation, or deleting the parent of a tag under animation, or
|
|
1563
|
+
// reparenting.
|
|
1564
|
+
if (conflicting) {
|
|
1565
|
+
animatedKeyFrame.invalidated = true;
|
|
1640
1566
|
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1567
|
+
// We construct a list of all conflicting animations, whether or not
|
|
1568
|
+
// they have a "final mutation" to execute. This is important with,
|
|
1569
|
+
// for example, "insert" mutations where the final update needs to set
|
|
1570
|
+
// opacity to "1", even if there's no final ShadowNode update.
|
|
1571
|
+
// TODO: don't animate virtual views in the first place?
|
|
1572
|
+
bool isVirtual = false;
|
|
1573
|
+
for (const auto &finalMutationForKeyFrame :
|
|
1574
|
+
animatedKeyFrame.finalMutationsForKeyFrame) {
|
|
1575
|
+
isVirtual =
|
|
1576
|
+
isVirtual || finalMutationForKeyFrame.mutatedViewIsVirtual();
|
|
1644
1577
|
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1578
|
+
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
|
|
1579
|
+
PrintMutationInstructionRelative(
|
|
1580
|
+
"Found mutation that conflicts with existing in-flight animation:",
|
|
1581
|
+
mutation,
|
|
1582
|
+
finalMutationForKeyFrame);
|
|
1583
|
+
#endif
|
|
1584
|
+
}
|
|
1648
1585
|
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
progress,
|
|
1659
|
-
baselineLayoutMetrics.frame.origin.y,
|
|
1660
|
-
finalLayoutMetrics.frame.origin.y);
|
|
1661
|
-
interpolatedLayoutMetrics.frame.size.width = interpolateFloats(
|
|
1662
|
-
progress,
|
|
1663
|
-
baselineLayoutMetrics.frame.size.width,
|
|
1664
|
-
finalLayoutMetrics.frame.size.width);
|
|
1665
|
-
interpolatedLayoutMetrics.frame.size.height = interpolateFloats(
|
|
1666
|
-
progress,
|
|
1667
|
-
baselineLayoutMetrics.frame.size.height,
|
|
1668
|
-
finalLayoutMetrics.frame.size.height);
|
|
1669
|
-
mutatedShadowView.layoutMetrics = interpolatedLayoutMetrics;
|
|
1586
|
+
conflictingAnimations.push_back(animatedKeyFrame);
|
|
1587
|
+
for (const auto &finalMutationForKeyFrame :
|
|
1588
|
+
animatedKeyFrame.finalMutationsForKeyFrame) {
|
|
1589
|
+
if (!isVirtual ||
|
|
1590
|
+
finalMutationForKeyFrame.type ==
|
|
1591
|
+
ShadowViewMutation::Type::Delete) {
|
|
1592
|
+
localConflictingMutations.push_back(finalMutationForKeyFrame);
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1670
1595
|
|
|
1671
|
-
|
|
1672
|
-
|
|
1596
|
+
// Delete from existing animation
|
|
1597
|
+
it = inflightAnimation.keyFrames.erase(it);
|
|
1598
|
+
} else {
|
|
1599
|
+
it++;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1673
1604
|
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
if (
|
|
1677
|
-
|
|
1605
|
+
// Recurse, in case conflicting mutations conflict with other existing
|
|
1606
|
+
// animations
|
|
1607
|
+
if (!localConflictingMutations.empty()) {
|
|
1608
|
+
getAndEraseConflictingAnimations(
|
|
1609
|
+
surfaceId, localConflictingMutations, conflictingAnimations);
|
|
1678
1610
|
}
|
|
1611
|
+
}
|
|
1679
1612
|
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
std::make_unique<LayoutAnimationCallbackWrapper>(callback));
|
|
1613
|
+
void LayoutAnimationKeyFrameManager::deleteAnimationsForStoppedSurfaces()
|
|
1614
|
+
const {
|
|
1615
|
+
bool inflightAnimationsExistInitially = !inflightAnimations_.empty();
|
|
1684
1616
|
|
|
1685
|
-
//
|
|
1686
|
-
|
|
1617
|
+
// Execute stopSurface on any ongoing animations
|
|
1618
|
+
if (inflightAnimationsExistInitially) {
|
|
1619
|
+
better::set<SurfaceId> surfaceIdsToStop{};
|
|
1620
|
+
{
|
|
1621
|
+
std::lock_guard<std::mutex> lock(surfaceIdsToStopMutex_);
|
|
1622
|
+
surfaceIdsToStop = surfaceIdsToStop_;
|
|
1623
|
+
surfaceIdsToStop_.clear();
|
|
1624
|
+
}
|
|
1687
1625
|
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
std::lock_guard<std::mutex> lock(callbackWrappersPendingMutex_);
|
|
1626
|
+
for (auto it = inflightAnimations_.begin();
|
|
1627
|
+
it != inflightAnimations_.end();) {
|
|
1628
|
+
const auto &animation = *it;
|
|
1692
1629
|
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1630
|
+
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
|
|
1631
|
+
LOG(ERROR)
|
|
1632
|
+
<< "LayoutAnimations: stopping animation due to stopSurface on "
|
|
1633
|
+
<< surfaceId;
|
|
1634
|
+
#endif
|
|
1635
|
+
if (surfaceIdsToStop.find(animation.surfaceId) !=
|
|
1636
|
+
surfaceIdsToStop.end()) {
|
|
1637
|
+
it = inflightAnimations_.erase(it);
|
|
1638
|
+
} else {
|
|
1639
|
+
it++;
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1702
1644
|
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1645
|
+
void LayoutAnimationKeyFrameManager::simulateImagePropsMemoryAccess(
|
|
1646
|
+
ShadowViewMutationList const &mutations) const {
|
|
1647
|
+
if (!simulateImagePropsMemoryAccess_) {
|
|
1648
|
+
return;
|
|
1649
|
+
}
|
|
1650
|
+
for (auto const &mutation : mutations) {
|
|
1651
|
+
if (mutation.type != ShadowViewMutation::Type::Insert) {
|
|
1652
|
+
continue;
|
|
1653
|
+
}
|
|
1654
|
+
if (strcmp(mutation.newChildShadowView.componentName, "Image") == 0) {
|
|
1655
|
+
auto const &imageProps = *std::static_pointer_cast<ImageProps const>(
|
|
1656
|
+
mutation.newChildShadowView.props);
|
|
1657
|
+
int temp = 0;
|
|
1658
|
+
switch (imageProps.resizeMode) {
|
|
1659
|
+
case ImageResizeMode::Cover:
|
|
1660
|
+
temp = 1;
|
|
1661
|
+
break;
|
|
1662
|
+
case ImageResizeMode::Contain:
|
|
1663
|
+
temp = 2;
|
|
1664
|
+
break;
|
|
1665
|
+
case ImageResizeMode::Stretch:
|
|
1666
|
+
temp = 3;
|
|
1667
|
+
break;
|
|
1668
|
+
case ImageResizeMode::Center:
|
|
1669
|
+
temp = 4;
|
|
1670
|
+
break;
|
|
1671
|
+
case ImageResizeMode::Repeat:
|
|
1672
|
+
temp = 5;
|
|
1673
|
+
break;
|
|
1674
|
+
}
|
|
1675
|
+
(void)temp;
|
|
1676
|
+
}
|
|
1707
1677
|
}
|
|
1708
1678
|
}
|
|
1709
1679
|
|