react-native-tvos 0.72.6-0 → 0.73.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec +2 -2
- package/Libraries/Alert/RCTAlertManager.js.flow +18 -0
- package/Libraries/Animated/Animated.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +1 -1
- package/Libraries/Animated/NativeAnimatedHelper.js +14 -10
- package/Libraries/Animated/NativeAnimatedModule.js +6 -2
- package/Libraries/Animated/NativeAnimatedTurboModule.js +7 -4
- package/Libraries/Animated/animations/Animation.js +57 -3
- package/Libraries/Animated/animations/DecayAnimation.js +9 -0
- package/Libraries/Animated/animations/SpringAnimation.js +8 -0
- package/Libraries/Animated/animations/TimingAnimation.js +8 -0
- package/Libraries/Animated/components/AnimatedFlatList.js +2 -1
- package/Libraries/Animated/components/AnimatedScrollView.js +2 -0
- package/Libraries/Animated/components/AnimatedSectionList.js +2 -1
- package/Libraries/Animated/createAnimatedComponent.js +1 -0
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedObject.js +146 -0
- package/Libraries/Animated/nodes/AnimatedProps.js +19 -7
- package/Libraries/Animated/nodes/AnimatedStyle.js +30 -56
- package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -17
- package/Libraries/Animated/shouldUseTurboAnimatedModule.js +17 -0
- package/Libraries/Animated/useAnimatedProps.js +9 -10
- package/Libraries/AppDelegate/RCTAppDelegate.h +31 -7
- package/Libraries/AppDelegate/RCTAppDelegate.mm +134 -30
- package/Libraries/AppDelegate/RCTAppSetupUtils.h +3 -3
- package/Libraries/AppDelegate/RCTAppSetupUtils.mm +29 -28
- package/Libraries/AppDelegate/RCTLegacyInteropComponents.mm +1 -1
- package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +42 -31
- package/Libraries/AppState/AppState.d.ts +1 -1
- package/Libraries/AppState/NativeAppState.js +8 -4
- package/Libraries/BatchedBridge/MessageQueue.js +45 -36
- package/Libraries/Blob/Blob.js +6 -2
- package/Libraries/Blob/BlobManager.js +9 -10
- package/Libraries/Blob/BlobRegistry.js +14 -9
- package/Libraries/Blob/File.js +1 -1
- package/Libraries/Blob/FileReader.js +1 -2
- package/Libraries/Blob/RCTBlobCollector.h +2 -4
- package/Libraries/Blob/RCTBlobCollector.mm +2 -4
- package/Libraries/Blob/RCTBlobPlugins.h +1 -1
- package/Libraries/Blob/RCTBlobPlugins.mm +1 -1
- package/Libraries/Blob/React-RCTBlob.podspec +12 -18
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.js.flow +20 -0
- package/Libraries/Components/Clipboard/Clipboard.d.ts +4 -4
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +3 -1
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +26 -6
- package/Libraries/Components/Pressable/Pressable.js +3 -2
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +1 -1
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +20 -0
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +7 -7
- package/Libraries/Components/ScrollView/ScrollView.js +3 -1
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +39 -46
- package/Libraries/Components/Switch/Switch.js +1 -0
- package/Libraries/Components/TabBarIOS/RCTTabBarItemNativeComponent.js +1 -1
- package/Libraries/Components/TabBarIOS/RCTTabBarNativeComponent.js +1 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/TextInput.d.ts +49 -7
- package/Libraries/Components/TextInput/TextInput.flow.js +43 -10
- package/Libraries/Components/TextInput/TextInput.js +62 -10
- package/Libraries/Components/ToastAndroid/ToastAndroid.js +45 -0
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
- package/Libraries/Components/Touchable/TouchableOpacity.js +4 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -0
- package/Libraries/Components/TraceUpdateOverlay/TraceUpdateOverlay.js +16 -6
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +9 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/View.js +70 -56
- package/Libraries/Components/View/ViewNativeComponent.js +1 -0
- package/Libraries/Components/View/ViewPropTypes.js +18 -3
- package/Libraries/Core/Devtools/loadBundleFromServer.js +152 -0
- package/Libraries/Core/Devtools/symbolicateStackTrace.js +2 -1
- package/Libraries/Core/ExceptionsManager.js +16 -7
- package/Libraries/Core/ExtendedError.js +12 -0
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/ReactNativeVersionCheck.js +0 -2
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +20 -0
- package/Libraries/Core/setUpDeveloperTools.js +5 -1
- package/Libraries/Core/setUpIntersectionObserver.js +16 -0
- package/Libraries/Core/setUpMutationObserver.js +16 -0
- package/Libraries/Core/setUpPerformance.js +6 -13
- package/Libraries/Core/setUpPerformanceObserver.js +16 -0
- package/Libraries/Core/setUpRegeneratorRuntime.js +4 -2
- package/Libraries/DOM/Nodes/ReactNativeElement.js +135 -18
- package/Libraries/DOM/Nodes/ReadOnlyCharacterData.js +72 -0
- package/Libraries/DOM/Nodes/ReadOnlyElement.js +209 -21
- package/Libraries/DOM/Nodes/ReadOnlyNode.js +206 -17
- package/Libraries/DOM/Nodes/ReadOnlyText.js +30 -0
- package/Libraries/DOM/Nodes/Utilities/Traversal.js +54 -0
- package/Libraries/DevToolsSettings/DevToolsSettingsManager.js.flow +19 -0
- package/Libraries/EventEmitter/NativeEventEmitter.d.ts +0 -6
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +15 -4
- package/Libraries/FBLazyVector/FBLazyVector/FBLazyIterator.h +12 -12
- package/Libraries/FBLazyVector/FBLazyVector.podspec +1 -1
- package/Libraries/Image/Image.android.js +8 -2
- package/Libraries/Image/Image.d.ts +1 -1
- package/Libraries/Image/Image.ios.js +4 -1
- package/Libraries/Image/Image.js.flow +40 -0
- package/Libraries/Image/ImageBackground.js +3 -0
- package/Libraries/Image/RCTAnimatedImage.mm +175 -0
- package/Libraries/Image/RCTBundleAssetImageLoader.h +12 -0
- package/Libraries/Image/RCTBundleAssetImageLoader.mm +83 -0
- package/Libraries/Image/RCTImageBlurUtils.mm +100 -0
- package/Libraries/Image/RCTImageLoader.h +7 -0
- package/Libraries/Image/RCTImageLoader.mm +9 -0
- package/Libraries/Image/RCTImageStoreManager.h +7 -0
- package/Libraries/Image/RCTImageStoreManager.mm +9 -0
- package/Libraries/Image/RCTImageURLLoaderWithAttribution.h +2 -4
- package/Libraries/Image/RCTImageUtils.mm +387 -0
- package/Libraries/Image/RCTImageView.mm +4 -9
- package/Libraries/Image/RCTLocalAssetImageLoader.h +2 -1
- package/Libraries/Image/RCTLocalAssetImageLoader.mm +6 -1
- package/Libraries/Image/RCTUIImageViewAnimated.mm +347 -0
- package/Libraries/Image/React-RCTImage.podspec +14 -17
- package/Libraries/Inspector/DevtoolsOverlay.js +6 -3
- package/Libraries/Inspector/NetworkOverlay.js +2 -2
- package/Libraries/Interaction/JSEventLoopWatchdog.js +1 -5
- package/Libraries/Interaction/PanResponder.js +1 -4
- package/Libraries/IntersectionObserver/IntersectionObserver.js +252 -0
- package/Libraries/IntersectionObserver/IntersectionObserverEntry.js +140 -0
- package/Libraries/IntersectionObserver/IntersectionObserverManager.js +221 -0
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.cpp +118 -0
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.h +109 -0
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +41 -0
- package/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js +162 -0
- package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
- package/Libraries/LinkingIOS/RCTLinkingManager.h +2 -9
- package/Libraries/LinkingIOS/RCTLinkingManager.mm +1 -7
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +8 -16
- package/Libraries/Lists/FlatList.d.ts +2 -1
- package/Libraries/Lists/FlatList.js +15 -5
- package/Libraries/Lists/SectionList.js +4 -0
- package/Libraries/LogBox/Data/LogBoxData.js +2 -1
- package/Libraries/LogBox/Data/LogBoxLog.js +4 -1
- package/Libraries/LogBox/Data/LogBoxSymbolication.js +5 -2
- package/Libraries/LogBox/Data/parseLogBoxLog.js +57 -20
- package/Libraries/LogBox/UI/AnsiHighlight.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +24 -33
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
- package/Libraries/LogBox/UI/LogBoxMessage.js +4 -7
- package/Libraries/MutationObserver/MutationObserver.js +184 -0
- package/Libraries/MutationObserver/MutationObserverManager.js +218 -0
- package/Libraries/MutationObserver/MutationRecord.js +82 -0
- package/Libraries/MutationObserver/NativeMutationObserver.cpp +165 -0
- package/Libraries/MutationObserver/NativeMutationObserver.h +104 -0
- package/Libraries/MutationObserver/NativeMutationObserver.js +58 -0
- package/Libraries/MutationObserver/__mocks__/NativeMutationObserver.js +327 -0
- package/Libraries/NativeAnimation/Drivers/RCTDecayAnimation.mm +125 -0
- package/Libraries/NativeAnimation/Drivers/RCTFrameAnimation.mm +151 -0
- package/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.mm +200 -0
- package/Libraries/NativeAnimation/Nodes/RCTInterpolationAnimatedNode.h +1 -1
- package/Libraries/NativeAnimation/Nodes/RCTInterpolationAnimatedNode.mm +171 -0
- package/Libraries/NativeAnimation/Nodes/RCTObjectAnimatedNode.h +14 -0
- package/Libraries/NativeAnimation/Nodes/RCTObjectAnimatedNode.mm +66 -0
- package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.mm +146 -0
- package/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.mm +62 -0
- package/Libraries/NativeAnimation/RCTAnimationUtils.mm +129 -0
- package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.mm +484 -0
- package/Libraries/NativeAnimation/React-RCTAnimation.podspec +11 -17
- package/Libraries/NativeComponent/BaseViewConfig.android.js +18 -3
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +33 -0
- package/Libraries/NativeComponent/BaseViewConfig.js.flow +14 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +13 -9
- package/Libraries/NativeModules/specs/NativeSourceCode.js +6 -6
- package/Libraries/Network/RCTNetworkPlugins.h +1 -1
- package/Libraries/Network/RCTNetworkPlugins.mm +1 -1
- package/Libraries/Network/RCTNetworking.android.js +2 -1
- package/Libraries/Network/RCTNetworking.h +7 -0
- package/Libraries/Network/RCTNetworking.js.flow +88 -0
- package/Libraries/Network/RCTNetworking.mm +9 -0
- package/Libraries/Network/React-RCTNetwork.podspec +11 -21
- package/Libraries/Network/XMLHttpRequest.js +1 -1
- package/Libraries/NewAppScreen/components/DebugInstructions.js +4 -6
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +9 -2
- package/Libraries/Performance/QuickPerformanceLogger.js +1 -1
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +1 -0
- package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +1 -0
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +3 -1
- package/Libraries/Pressability/Pressability.js +28 -3
- package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +11 -17
- package/Libraries/RCTRequired/RCTRequired/RCTRequired.h +8 -8
- package/Libraries/RCTRequired/RCTRequired.podspec +1 -1
- package/Libraries/ReactNative/AppContainer.js +2 -3
- package/Libraries/ReactNative/AppRegistry.d.ts +0 -5
- package/Libraries/ReactNative/AppRegistry.js +66 -53
- package/Libraries/ReactNative/BridgelessUIManager.js +38 -9
- package/Libraries/ReactNative/FabricUIManager.js +143 -34
- package/Libraries/ReactNative/I18nManager.js +5 -11
- package/Libraries/ReactNative/NativeI18nManager.js +7 -5
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +151 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +81 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +492 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/warnForStyleProps.js +32 -0
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +19 -3
- package/Libraries/ReactNative/UIManager.js +8 -0
- package/Libraries/ReactNative/__mocks__/FabricUIManager.js +648 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +38 -2
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +27 -27
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -3
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -3
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +27 -27
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3 -3
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +3 -3
- package/Libraries/Renderer/shims/ReactFabric.js +5 -6
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -3
- package/Libraries/Renderer/shims/ReactNative.js +2 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +35 -17
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -3
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -3
- package/Libraries/Settings/React-RCTSettings.podspec +11 -20
- package/Libraries/Settings/Settings.js +33 -0
- package/Libraries/Share/Share.d.ts +3 -9
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +9 -4
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +28 -13
- package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +22 -0
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.d.ts +10 -1
- package/Libraries/StyleSheet/StyleSheet.js +3 -0
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +31 -17
- package/Libraries/StyleSheet/StyleSheetTypes.js +90 -6
- package/Libraries/StyleSheet/flattenStyle.js +4 -0
- package/Libraries/StyleSheet/private/_TransformStyle.js +16 -2
- package/Libraries/StyleSheet/processColor.js +1 -2
- package/Libraries/StyleSheet/processTransformOrigin.js +136 -0
- package/Libraries/StyleSheet/splitLayoutProps.js +1 -0
- package/Libraries/Text/BaseText/RCTBaseTextShadowView.mm +158 -0
- package/Libraries/Text/RCTConvert+Text.h +1 -0
- package/Libraries/Text/RCTConvert+Text.mm +44 -0
- package/Libraries/Text/React-RCTText.podspec +5 -2
- package/Libraries/Text/Text/RCTTextShadowView.mm +420 -0
- package/Libraries/Text/Text/RCTTextView.h +5 -0
- package/Libraries/Text/Text.d.ts +5 -5
- package/Libraries/Text/Text.js +17 -11
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.h +1 -0
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +321 -0
- package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +1 -0
- package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.mm +316 -0
- package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +752 -0
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm +178 -0
- package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.mm +20 -0
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.h +1 -0
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +237 -0
- package/Libraries/Text/VirtualText/RCTVirtualTextView.h +23 -0
- package/Libraries/Text/VirtualText/RCTVirtualTextView.mm +12 -0
- package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm +26 -0
- package/Libraries/TurboModule/TurboModuleRegistry.js +47 -7
- package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +6 -0
- package/Libraries/TypeSafety/RCTConvertHelpers.h +2 -4
- package/Libraries/TypeSafety/RCTTypeSafety.podspec +2 -2
- package/Libraries/TypeSafety/RCTTypedModuleConstants.h +2 -4
- package/Libraries/Types/CoreEventTypes.d.ts +5 -2
- package/Libraries/Utilities/BackHandler.js.flow +27 -0
- package/Libraries/Utilities/GlobalPerformanceLogger.js +2 -12
- package/Libraries/Utilities/NativeDeviceInfo.js +8 -9
- package/Libraries/Utilities/NativePlatformConstantsAndroid.js +23 -18
- package/Libraries/Utilities/NativePlatformConstantsIOS.js +16 -13
- package/Libraries/Utilities/PerformanceLoggerContext.js +1 -1
- package/Libraries/Utilities/Platform.android.js +12 -8
- package/Libraries/Utilities/Platform.d.ts +1 -0
- package/Libraries/Utilities/Platform.flow.js +84 -0
- package/Libraries/Utilities/Platform.ios.js +12 -8
- package/Libraries/Utilities/Platform.js.flow +13 -0
- package/Libraries/Utilities/PolyfillFunctions.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -2
- package/Libraries/Utilities/SceneTracker.js +1 -1
- package/Libraries/Utilities/createPerformanceLogger.js +63 -32
- package/Libraries/Utilities/useColorScheme.js +7 -8
- package/Libraries/Vibration/React-RCTVibration.podspec +10 -18
- package/Libraries/WebPerformance/BoundedConsumableBuffer.h +244 -0
- package/Libraries/WebPerformance/MemoryInfo.js +1 -1
- package/Libraries/WebPerformance/NativePerformance.cpp +38 -17
- package/Libraries/WebPerformance/NativePerformance.h +5 -21
- package/Libraries/WebPerformance/NativePerformance.js +3 -8
- package/Libraries/WebPerformance/NativePerformanceObserver.cpp +20 -10
- package/Libraries/WebPerformance/NativePerformanceObserver.h +14 -9
- package/Libraries/WebPerformance/NativePerformanceObserver.js +4 -0
- package/Libraries/WebPerformance/Performance.js +42 -15
- package/Libraries/WebPerformance/PerformanceEntry.js +14 -6
- package/Libraries/WebPerformance/PerformanceEntryReporter.cpp +220 -195
- package/Libraries/WebPerformance/PerformanceEntryReporter.h +78 -101
- package/Libraries/WebPerformance/PerformanceEventTiming.js +18 -1
- package/Libraries/WebPerformance/ReactNativeStartupTiming.js +40 -14
- package/Libraries/WebPerformance/__mocks__/NativePerformance.js +4 -2
- package/Libraries/WebPerformance/__mocks__/NativePerformanceObserver.js +21 -3
- package/Libraries/Wrapper/RCTWrapperShadowView.m +1 -1
- package/Libraries/promiseRejectionTrackingOptions.js +21 -9
- package/Libraries/vendor/emitter/EventEmitter.js +17 -17
- package/README.md +20 -26
- package/React/Base/RCTAssert.m +1 -1
- package/React/Base/RCTBridge.h +23 -22
- package/React/Base/RCTBridge.mm +423 -0
- package/React/Base/RCTBridgeModule.h +1 -13
- package/React/Base/RCTBridgeProxy.h +36 -0
- package/React/Base/RCTBridgeProxy.mm +467 -0
- package/React/Base/RCTBundleURLProvider.h +1 -1
- package/React/Base/RCTBundleURLProvider.mm +3 -5
- package/React/Base/RCTConstants.h +11 -20
- package/React/Base/RCTConstants.m +23 -7
- package/React/Base/RCTConvert.h +1 -0
- package/React/Base/RCTConvert.m +30 -27
- package/React/Base/RCTEventDispatcher.m +9 -0
- package/React/Base/RCTEventDispatcherProtocol.h +7 -0
- package/React/Base/RCTJSStackFrame.m +1 -1
- package/React/Base/RCTJavaScriptLoader.h +0 -2
- package/React/Base/RCTJavaScriptLoader.mm +2 -11
- package/React/Base/RCTManagedPointer.h +2 -4
- package/React/Base/RCTMockDef.h +2 -2
- package/React/Base/RCTModuleData.h +0 -4
- package/React/Base/RCTModuleData.mm +1 -12
- package/React/Base/RCTModuleRegistry.m +17 -0
- package/React/Base/RCTPLTag.h +2 -0
- package/React/Base/RCTPerformanceLogger.mm +135 -0
- package/React/Base/RCTPerformanceLoggerLabels.m +4 -0
- package/React/Base/RCTRedBoxSetEnabled.m +1 -1
- package/React/Base/RCTRootView.h +5 -13
- package/React/Base/RCTRootView.m +5 -12
- package/React/Base/RCTTouchHandlerTV.m +35 -0
- package/React/Base/RCTTurboModuleRegistry.h +0 -3
- package/React/Base/RCTUtils.h +4 -4
- package/React/Base/RCTUtils.m +10 -10
- package/React/Base/RCTVersion.m +2 -2
- package/React/Base/Surface/RCTSurfaceRootShadowView.h +1 -1
- package/React/Base/Surface/RCTSurfaceRootShadowView.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +2 -18
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +9 -68
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.h +0 -17
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +2 -23
- package/React/CoreModules/CoreModulesPlugins.h +13 -14
- package/React/CoreModules/CoreModulesPlugins.mm +14 -15
- package/React/CoreModules/RCTAccessibilityManager+Internal.h +1 -1
- package/React/CoreModules/RCTAccessibilityManager.h +7 -0
- package/React/CoreModules/RCTAccessibilityManager.mm +18 -13
- package/React/CoreModules/RCTActionSheetManager.mm +25 -28
- package/React/CoreModules/RCTAlertController.mm +80 -0
- package/React/CoreModules/RCTAlertManager.mm +2 -7
- package/React/CoreModules/RCTAppState.mm +5 -1
- package/React/CoreModules/RCTAppearance.h +1 -0
- package/React/CoreModules/RCTAppearance.mm +40 -43
- package/React/CoreModules/RCTDevLoadingView.mm +20 -36
- package/React/CoreModules/RCTDevMenu.h +7 -0
- package/React/CoreModules/RCTDevMenu.mm +28 -63
- package/React/CoreModules/RCTDevSettings.h +7 -0
- package/React/CoreModules/RCTDevSettings.mm +24 -16
- package/React/CoreModules/RCTDeviceInfo.mm +41 -40
- package/React/CoreModules/RCTFPSGraph.mm +128 -0
- package/React/CoreModules/RCTLogBoxView.mm +2 -10
- package/React/CoreModules/RCTPerfMonitor.mm +13 -45
- package/React/CoreModules/RCTRedBox.h +7 -0
- package/React/CoreModules/RCTRedBox.mm +23 -7
- package/React/CoreModules/RCTSourceCode.mm +0 -3
- package/React/CoreModules/RCTStatusBarManager.mm +5 -19
- package/React/CoreModules/RCTTiming.mm +2 -2
- package/React/CoreModules/RCTWebSocketExecutor.mm +4 -1
- package/React/CoreModules/RCTWebSocketModule.h +7 -0
- package/React/CoreModules/RCTWebSocketModule.mm +9 -0
- package/React/CoreModules/React-CoreModules.podspec +9 -15
- package/React/CxxBridge/JSCExecutorFactory.h +2 -4
- package/React/CxxBridge/JSCExecutorFactory.mm +2 -4
- package/React/CxxBridge/NSDataBigString.h +2 -4
- package/React/CxxBridge/NSDataBigString.mm +2 -4
- package/React/CxxBridge/RCTCxxBridge.mm +25 -101
- package/React/CxxBridge/RCTCxxBridgeDelegate.h +2 -4
- package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.h +2 -4
- package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.mm +2 -5
- package/React/CxxBridge/RCTMessageThread.h +8 -9
- package/React/CxxBridge/RCTMessageThread.mm +2 -4
- package/React/CxxBridge/RCTObjcExecutor.h +2 -4
- package/React/CxxBridge/RCTObjcExecutor.mm +2 -4
- package/React/CxxLogUtils/RCTDefaultCxxLogFunction.h +3 -5
- package/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm +2 -4
- package/React/CxxModule/DispatchMessageQueueThread.h +2 -4
- package/React/CxxModule/RCTCxxModule.h +2 -6
- package/React/CxxModule/RCTCxxUtils.h +2 -4
- package/React/CxxModule/RCTCxxUtils.mm +2 -4
- package/React/CxxModule/RCTNativeModule.h +7 -9
- package/React/CxxModule/RCTNativeModule.mm +2 -4
- package/React/CxxUtils/RCTFollyConvert.h +3 -5
- package/React/CxxUtils/RCTFollyConvert.mm +2 -4
- package/React/DevSupport/RCTDevLoadingViewSetEnabled.m +2 -2
- package/React/DevSupport/RCTInspectorDevServerHelper.h +1 -1
- package/React/DevSupport/RCTInspectorDevServerHelper.mm +64 -12
- package/React/DevSupport/RCTPackagerConnection.mm +2 -1
- package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +4 -4
- package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +5 -5
- package/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +18 -21
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +5 -5
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +5 -5
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +2 -7
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +12 -12
- package/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h +5 -9
- package/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm +5 -9
- package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +4 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +6 -6
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +50 -38
- package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +6 -6
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +7 -7
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +29 -28
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputNativeCommands.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +4 -2
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +33 -12
- package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +3 -3
- package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +4 -4
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +5 -11
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +90 -33
- package/React/Fabric/Mounting/RCTComponentViewDescriptor.h +3 -3
- package/React/Fabric/Mounting/RCTComponentViewFactory.h +17 -1
- package/React/Fabric/Mounting/RCTComponentViewFactory.mm +22 -10
- package/React/Fabric/Mounting/RCTComponentViewProtocol.h +8 -8
- package/React/Fabric/Mounting/RCTComponentViewRegistry.h +2 -2
- package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +5 -6
- package/React/Fabric/Mounting/RCTMountingManager.h +2 -2
- package/React/Fabric/Mounting/RCTMountingManager.mm +18 -17
- package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.h +11 -11
- package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm +8 -8
- package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +4 -4
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +7 -7
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +6 -6
- package/React/Fabric/RCTConversions.h +5 -5
- package/React/Fabric/RCTImageResponseDelegate.h +3 -3
- package/React/Fabric/RCTImageResponseObserverProxy.h +3 -5
- package/React/Fabric/RCTImageResponseObserverProxy.mm +3 -5
- package/React/Fabric/RCTScheduler.h +15 -13
- package/React/Fabric/RCTScheduler.mm +18 -13
- package/React/Fabric/RCTSurfacePointerHandler.mm +143 -152
- package/React/Fabric/RCTSurfacePointerHandlerTV.mm +37 -0
- package/React/Fabric/RCTSurfacePresenter.h +1 -1
- package/React/Fabric/RCTSurfacePresenter.mm +40 -28
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +3 -0
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm +38 -2
- package/React/Fabric/RCTSurfaceTouchHandler.mm +1 -1
- package/React/Fabric/RCTSurfaceTouchHandlerTV.mm +30 -0
- package/React/Fabric/Surface/RCTFabricSurface.h +1 -1
- package/React/Fabric/Surface/RCTFabricSurface.mm +1 -1
- package/React/Fabric/Utils/PlatformRunLoopObserver.h +4 -6
- package/React/Fabric/Utils/PlatformRunLoopObserver.mm +3 -5
- package/React/Fabric/Utils/RCTIdentifierPool.h +2 -4
- package/React/I18n/.clang-format-ignore +2 -0
- package/React/I18n/FBXXHashUtils.h +118 -0
- package/React/I18n/RCTLocalizedString.h +34 -0
- package/React/I18n/RCTLocalizedString.mm +46 -0
- package/React/I18n/strings/ar.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/ar.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/cs.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/cs.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/da.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/da.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/de.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/de.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/el.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/el.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/en-GB.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/en-GB.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/en.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/es-ES.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/es-ES.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/es.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/es.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/fi.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/fi.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/fr.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/fr.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/he.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/he.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/hi.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/hi.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/hr.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/hr.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/hu.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/hu.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/id.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/id.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/it.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/it.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/ja.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/ja.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/ko.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/ko.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/ms.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/ms.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/nb.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/nb.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/nl.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/nl.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/pl.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/pl.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/pt-PT.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/pt-PT.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/pt.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/pt.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/ro.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/ro.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/ru.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/ru.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/sk.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/sk.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/sv.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/sv.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/th.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/th.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/tr.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/tr.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/uk.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/uk.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/vi.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/vi.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/zh-Hans.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/zh-Hans.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/zh-Hant-HK.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/zh-Hant-HK.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/zh-Hant.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/zh-Hant.lproj/fbt_language_pack.bin +0 -0
- package/React/I18n/strings/zu.lproj/Localizable.strings +2 -0
- package/React/I18n/strings/zu.lproj/fbt_language_pack.bin +0 -0
- package/React/Inspector/RCTInspector.mm +3 -2
- package/React/Modules/RCTSurfacePresenterStub.h +8 -0
- package/React/Modules/RCTSurfacePresenterStub.m +14 -0
- package/React/Modules/RCTUIManager.h +14 -0
- package/React/Modules/RCTUIManager.m +32 -12
- package/React/Modules/RCTUIManagerUtils.m +3 -3
- package/React/React-RCTFabric.podspec +39 -28
- package/React/Tests/Text/RCTParagraphComponentViewTests.mm +17 -16
- package/React/UIUtils/RCTUIUtils.h +1 -1
- package/React/Views/RCTActivityIndicatorViewManager.m +3 -3
- package/React/Views/RCTComponentData.h +3 -0
- package/React/Views/RCTComponentData.m +67 -15
- package/React/Views/RCTFont.mm +32 -0
- package/React/Views/RCTLayout.h +1 -1
- package/React/Views/RCTModalHostView.m +3 -3
- package/React/Views/RCTModalHostViewController.m +3 -34
- package/React/Views/RCTRootShadowView.h +1 -1
- package/React/Views/RCTRootShadowView.m +1 -1
- package/React/Views/RCTSegmentedControl.m +7 -21
- package/React/Views/RCTShadowView.m +4 -4
- package/React/Views/RCTTVView.m +2 -2
- package/React/Views/RCTTransformOrigin.h +15 -0
- package/React/Views/RCTView.h +3 -0
- package/React/Views/RCTView.m +56 -63
- package/React/Views/RCTViewManager.m +123 -50
- package/React/Views/SafeAreaView/RCTSafeAreaView.m +6 -1
- package/React/Views/ScrollView/RCTScrollView.h +8 -0
- package/React/Views/ScrollView/RCTScrollView.m +27 -7
- package/React/Views/ScrollView/RCTScrollViewManager.m +0 -2
- package/React/Views/UIView+React.h +11 -0
- package/React/Views/UIView+React.m +111 -0
- package/React/third-party.xcconfig +2 -2
- package/React-Core.podspec +20 -24
- package/React.podspec +2 -4
- package/ReactAndroid/build.gradle +151 -105
- package/ReactAndroid/cmake-utils/ReactNative-application.cmake +4 -2
- package/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp +8 -10
- package/ReactAndroid/cmake-utils/folly-flags.cmake +2 -1
- package/ReactAndroid/external-artifacts/build.gradle.kts +70 -0
- package/ReactAndroid/flipper-integration/build.gradle.kts +64 -0
- package/ReactAndroid/flipper-integration/src/debug/java/com/facebook/react/flipper/ReactNativeFlipper.kt +66 -0
- package/ReactAndroid/flipper-integration/src/release/java/com/facebook/react/flipper/ReactNativeFlipper.kt +23 -0
- package/ReactAndroid/gradle.properties +8 -33
- package/ReactAndroid/hermes-engine/build.gradle +52 -15
- package/ReactAndroid/src/debug/AndroidManifest.xml +15 -0
- package/ReactAndroid/src/main/AndroidManifest.xml +15 -0
- package/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/HermesExecutor.java +1 -14
- package/ReactAndroid/src/main/java/com/facebook/react/CompositeReactPackageTurboModuleManagerDelegate.java +0 -14
- package/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java +1 -13
- package/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java +6 -19
- package/ReactAndroid/src/main/java/com/facebook/react/LazyReactPackage.java +9 -18
- package/ReactAndroid/src/main/java/com/facebook/react/LazyTurboModuleManagerDelegate.java +104 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +46 -27
- package/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.java +98 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.kt +24 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +90 -29
- package/ReactAndroid/src/main/java/com/facebook/react/ReactHost.kt +107 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +147 -156
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +7 -6
- package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactPackage.java +21 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactPackageHelper.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.java +91 -52
- package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +17 -58
- package/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.java +11 -16
- package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java +12 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/ObjectAnimatedNode.java +159 -0
- package/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/StyleAnimatedNode.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/TransformAnimatedNode.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseJavaModule.java +0 -5
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/Callback.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +7 -13
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/FallbackJSBundleLoader.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/GuardedAsyncTask.java +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/GuardedResultAsyncTask.java +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/GuardedRunnable.java +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/Inspector.java +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JSBundleLoader.java +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JSCJavaScriptExecutor.java +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JSCJavaScriptExecutorFactory.java +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaMethodWrapper.java +13 -7
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaModuleWrapper.java +3 -42
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.java +0 -5
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModule.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.java +0 -22
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +17 -7
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarker.java +85 -10
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java +29 -10
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactModuleWithSpec.java +2 -4
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManagerProvider.java +18 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThread.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadImpl.java +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadSpec.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/common/DebugServerException.java +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/common/StandardCharsets.java +6 -1
- package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/DeprecatedInNewArchitecture.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/FrameworkAPI.kt +18 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/UnstableReactNativeAPI.kt +15 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/VisibleForTesting.kt +14 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/assets/ReactFontManager.java +239 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/build/ReactBuildConfig.java +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +47 -27
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultBindingsInstaller.kt +18 -0
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultJSIModulePackage.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +12 -1
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt +109 -0
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt +56 -0
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.java +0 -32
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DefaultDevLoadingViewImplementation.java +25 -15
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevInternalSettings.java +29 -29
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java +126 -182
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +202 -339
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorPackagerConnection.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/JSDebuggerWebSocketClient.java +10 -5
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/PerftestDevSupportManager.java +2 -6
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/ReactInstanceDevHelper.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevOptionHandler.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSupportManager.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/Binding.java +15 -57
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/BindingImpl.java +122 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/DevToolsReactPerfLogger.java +67 -21
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +149 -108
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/GuardedFrameCallback.java +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/ReactNativeConfig.kt +54 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/StateWrapperImpl.java +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/SurfaceHandlerBinding.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/EventBeatManager.java +6 -3
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/EventEmitterWrapper.java +12 -14
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/FabricEventEmitter.java +7 -6
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/LayoutMetricsConversions.java +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java +12 -13
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.java +20 -11
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +109 -100
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/BatchMountItem.java +14 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/DispatchIntCommandMountItem.java +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/DispatchStringCommandMountItem.java +3 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/FabricNameComponentMapping.java +50 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java +6 -5
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/MountItemFactory.java +57 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/PreAllocateViewMountItem.java +10 -5
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/SendAccessibilityEventMountItem.java +55 -0
- package/ReactAndroid/src/main/java/com/facebook/react/interfaces/TaskInterface.kt +44 -0
- package/ReactAndroid/src/main/java/com/facebook/react/interfaces/exceptionmanager/ReactJsExceptionHandler.kt +18 -0
- package/ReactAndroid/src/main/java/com/facebook/react/interfaces/fabric/ReactSurface.kt +49 -0
- package/ReactAndroid/src/main/java/com/facebook/react/interfaces/fabric/SurfaceHandler.kt +51 -0
- package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/JSCExecutor.kt +36 -0
- package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/JSCExecutorFactory.kt +37 -0
- package/ReactAndroid/src/main/java/com/facebook/react/module/annotations/ReactModule.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.java +20 -5
- package/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java +0 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appstate/AppStateModule.java +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/common/ModuleDataCleaner.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/ReactAndroidHWInputDeviceHelper.java +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/FpsDebugFrameCallback.java +9 -7
- package/ReactAndroid/src/main/java/com/facebook/react/modules/devloading/DevLoadingModule.java +6 -10
- package/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/CustomClientBuilder.java +14 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java +1 -87
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java +39 -38
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/RequestBodyUtil.java +7 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java +12 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.java +0 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java +20 -4
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/.clang-format +91 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/.clang-tidy +22 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BindingsInstaller.kt +22 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BoltsFutureTask.java +93 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessAtomicRef.java +131 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessDevSupportManager.java +154 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.java +167 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactStateTracker.java +32 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/CoreReactPackage.java +118 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/JSCInstance.java +27 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/JSEngineInstance.java +26 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/JSTimerExecutor.java +50 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/README.md +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostDelegate.kt +82 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +1757 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.java +581 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactLifecycleStateManager.java +90 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceImpl.java +251 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceView.java +248 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/hermes/HermesInstance.kt +24 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/AggregateException.java +129 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/AndroidExecutors.java +137 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/BoltsExecutors.java +120 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/CancellationToken.java +74 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/CancellationTokenRegistration.java +60 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/CancellationTokenSource.java +216 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Capture.java +33 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Continuation.java +24 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/ExecutorException.java +21 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Task.java +1022 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/TaskCompletionSource.java +71 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/UnobservedErrorNotifier.java +42 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/UnobservedTaskException.java +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +34 -151
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/CallInvokerHolderImpl.java +6 -12
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/NativeMethodCallInvokerHolderImpl.java +31 -0
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/NativeModuleSoLoader.kt +25 -0
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleInteropUtils.java +290 -0
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java +186 -69
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManagerDelegate.java +26 -13
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModulePerfLogger.java +6 -11
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/CallInvokerHolder.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/NativeMethodCallInvokerHolder.kt +13 -0
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/TurboModule.kt +19 -0
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/TurboModuleRegistry.kt +37 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +110 -35
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManagerAdapter.java +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManagerDelegate.java +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManagerInterface.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/FabricViewStateManager.java +10 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java +181 -44
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +2 -7
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java +179 -8
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +25 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactYogaConfigProvider.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/RootView.java +4 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.java +100 -44
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIConstantsProvider.java +18 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIConstantsProviderManager.java +41 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +34 -23
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstants.java +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java +35 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +12 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +11 -17
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerRegistry.java +22 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.java +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.java +35 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java +0 -28
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.java +187 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.java +51 -11
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEventHelper.java +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/ReactEventEmitter.java +13 -15
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.java +62 -59
- package/ReactAndroid/src/main/java/com/facebook/react/util/RNLog.java +4 -18
- package/ReactAndroid/src/main/java/com/facebook/react/views/common/ViewUtils.java +34 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayout.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayoutManager.java +6 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerClosedEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerOpenedEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerSlideEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/events/DrawerStateChangedEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/image/ImageLoadEvent.java +6 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java +26 -29
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/RequestCloseEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ShowEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollContainerView.java +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +148 -29
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java +4 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +28 -29
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewAccessibilityDelegate.java +4 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.java +39 -51
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/RefreshEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitch.java +0 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/CustomLetterSpacingSpan.java +0 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/CustomStyleSpan.java +5 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java +22 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactFontManager.java +14 -129
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java +10 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +40 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTypefaceUtils.java +31 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/SetSpanOperation.java +7 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +50 -16
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +12 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +50 -32
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ContentSizeWatcher.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactContentSizeChangedEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +37 -110
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputBlurEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputEndEditingEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputFocusEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputKeyPressEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +10 -21
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputSelectionEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.java +10 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputSubmitEditingEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactDrawableHelper.java +0 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactMapBufferPropSetter.kt +10 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +0 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +0 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java +11 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManagerWrapper.kt +13 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ViewGroupClickEvent.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.java +4 -6
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIBase.java +6 -7
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.java +37 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java +1 -3
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNative.java +5 -4
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIFinalizer.java +1 -1
- package/ReactAndroid/src/main/jni/CMakeLists.txt +19 -26
- package/ReactAndroid/src/main/jni/first-party/fb/CMakeLists.txt +1 -1
- package/ReactAndroid/src/main/jni/first-party/fb/assert.cpp +2 -2
- package/ReactAndroid/src/main/jni/first-party/fb/include/fb/ALog.h +8 -8
- package/ReactAndroid/src/main/jni/first-party/fb/include/fb/Environment.h +11 -11
- package/ReactAndroid/src/main/jni/first-party/fb/include/fb/ProgramLocation.h +6 -6
- package/ReactAndroid/src/main/jni/first-party/fb/include/fb/RefPtr.h +33 -35
- package/ReactAndroid/src/main/jni/first-party/fb/include/fb/StaticInitialized.h +3 -3
- package/ReactAndroid/src/main/jni/first-party/fb/include/fb/ThreadLocal.h +12 -12
- package/ReactAndroid/src/main/jni/first-party/fb/include/fb/assert.h +2 -2
- package/ReactAndroid/src/main/jni/first-party/fb/include/fb/log.h +7 -7
- package/ReactAndroid/src/main/jni/first-party/fb/include/fb/noncopyable.h +2 -2
- package/ReactAndroid/src/main/jni/first-party/fb/include/fb/nonmovable.h +2 -2
- package/ReactAndroid/src/main/jni/first-party/fb/log.cpp +8 -8
- package/ReactAndroid/src/main/jni/first-party/fbgloginit/fb/glog_init.h +1 -1
- package/ReactAndroid/src/main/jni/first-party/fbgloginit/glog_init.cpp +14 -14
- package/ReactAndroid/src/main/jni/first-party/jni-hack/real/jni.h +381 -432
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/LayoutContext.cpp +34 -0
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/LayoutContext.h +29 -0
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/ScopedGlobalRef.h +14 -12
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/ScopedLocalRef.h +14 -12
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNI.h +15 -9
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp +320 -331
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJTypesVanilla.h +17 -12
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/YogaJniException.cpp +4 -7
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/YogaJniException.h +5 -8
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/common.cpp +7 -12
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/common.h +5 -11
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/corefunctions.cpp +5 -8
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/corefunctions.h +2 -6
- package/ReactAndroid/src/main/jni/react/fabric/AsyncEventBeat.cpp +3 -3
- package/ReactAndroid/src/main/jni/react/fabric/AsyncEventBeat.h +3 -3
- package/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +93 -102
- package/ReactAndroid/src/main/jni/react/fabric/Binding.h +39 -34
- package/ReactAndroid/src/main/jni/react/fabric/CMakeLists.txt +1 -2
- package/ReactAndroid/src/main/jni/react/fabric/ComponentFactory.cpp +2 -4
- package/ReactAndroid/src/main/jni/react/fabric/ComponentFactory.h +3 -5
- package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +9 -12
- package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.h +6 -8
- package/ReactAndroid/src/main/jni/react/fabric/EventBeatManager.cpp +7 -9
- package/ReactAndroid/src/main/jni/react/fabric/EventBeatManager.h +6 -8
- package/ReactAndroid/src/main/jni/react/fabric/EventEmitterWrapper.cpp +8 -18
- package/ReactAndroid/src/main/jni/react/fabric/EventEmitterWrapper.h +8 -13
- package/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp +131 -171
- package/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.h +27 -34
- package/ReactAndroid/src/main/jni/react/fabric/JBackgroundExecutor.cpp +4 -6
- package/ReactAndroid/src/main/jni/react/fabric/JBackgroundExecutor.h +3 -5
- package/ReactAndroid/src/main/jni/react/fabric/JFabricUIManager.cpp +6 -3
- package/ReactAndroid/src/main/jni/react/fabric/JFabricUIManager.h +3 -3
- package/ReactAndroid/src/main/jni/react/fabric/MountItem.cpp +64 -0
- package/ReactAndroid/src/main/jni/react/fabric/MountItem.h +86 -0
- package/ReactAndroid/src/main/jni/react/fabric/OnLoad.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/fabric/ReactNativeConfigHolder.cpp +4 -4
- package/ReactAndroid/src/main/jni/react/fabric/ReactNativeConfigHolder.h +6 -8
- package/ReactAndroid/src/main/jni/react/fabric/StateWrapperImpl.cpp +21 -13
- package/ReactAndroid/src/main/jni/react/fabric/StateWrapperImpl.h +5 -7
- package/ReactAndroid/src/main/jni/react/fabric/SurfaceHandlerBinding.cpp +5 -7
- package/ReactAndroid/src/main/jni/react/fabric/SurfaceHandlerBinding.h +6 -8
- package/ReactAndroid/src/main/jni/react/fabric/viewPropConversions.h +17 -19
- package/ReactAndroid/src/main/jni/react/hermes/instrumentation/OnLoad.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/hermes/reactexecutor/CMakeLists.txt +1 -1
- package/ReactAndroid/src/main/jni/react/hermes/reactexecutor/OnLoad.cpp +8 -24
- package/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt +1 -2
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +38 -68
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +16 -19
- package/ReactAndroid/src/main/jni/react/jni/CxxModuleWrapper.cpp +7 -9
- package/ReactAndroid/src/main/jni/react/jni/CxxModuleWrapper.h +5 -7
- package/ReactAndroid/src/main/jni/react/jni/CxxModuleWrapperBase.h +4 -6
- package/ReactAndroid/src/main/jni/react/jni/CxxSharedModuleWrapper.h +2 -4
- package/ReactAndroid/src/main/jni/react/jni/JCallback.h +3 -5
- package/ReactAndroid/src/main/jni/react/jni/JInspector.cpp +13 -12
- package/ReactAndroid/src/main/jni/react/jni/JInspector.h +11 -11
- package/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.cpp +8 -10
- package/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.h +2 -2
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.h +3 -5
- package/ReactAndroid/src/main/jni/react/jni/JReactMarker.cpp +75 -18
- package/ReactAndroid/src/main/jni/react/jni/JReactMarker.h +14 -12
- package/ReactAndroid/src/main/jni/react/jni/JReactSoftExceptionLogger.h +3 -5
- package/ReactAndroid/src/main/jni/react/jni/JRuntimeExecutor.cpp +2 -4
- package/ReactAndroid/src/main/jni/react/jni/JRuntimeExecutor.h +2 -4
- package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.cpp +2 -4
- package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.h +2 -4
- package/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp +10 -12
- package/ReactAndroid/src/main/jni/react/jni/JSLoader.h +5 -7
- package/ReactAndroid/src/main/jni/react/jni/JSLogging.cpp +4 -6
- package/ReactAndroid/src/main/jni/react/jni/JSLogging.h +4 -6
- package/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp +7 -9
- package/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.h +4 -6
- package/ReactAndroid/src/main/jni/react/jni/JavaScriptExecutorHolder.h +2 -4
- package/ReactAndroid/src/main/jni/react/jni/JniJSModulesUnbundle.cpp +14 -16
- package/ReactAndroid/src/main/jni/react/jni/JniJSModulesUnbundle.h +11 -13
- package/ReactAndroid/src/main/jni/react/jni/MethodInvoker.cpp +16 -18
- package/ReactAndroid/src/main/jni/react/jni/MethodInvoker.h +4 -6
- package/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.cpp +5 -7
- package/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.h +3 -5
- package/ReactAndroid/src/main/jni/react/jni/NativeArray.cpp +2 -4
- package/ReactAndroid/src/main/jni/react/jni/NativeArray.h +6 -8
- package/ReactAndroid/src/main/jni/react/jni/NativeCommon.cpp +4 -6
- package/ReactAndroid/src/main/jni/react/jni/NativeCommon.h +4 -6
- package/ReactAndroid/src/main/jni/react/jni/NativeMap.cpp +2 -4
- package/ReactAndroid/src/main/jni/react/jni/NativeMap.h +5 -7
- package/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp +5 -5
- package/ReactAndroid/src/main/jni/react/jni/OnLoad.h +2 -4
- package/ReactAndroid/src/main/jni/react/jni/ProxyExecutor.cpp +11 -13
- package/ReactAndroid/src/main/jni/react/jni/ProxyExecutor.h +9 -11
- package/ReactAndroid/src/main/jni/react/jni/ReadableNativeArray.cpp +3 -13
- package/ReactAndroid/src/main/jni/react/jni/ReadableNativeArray.h +4 -7
- package/ReactAndroid/src/main/jni/react/jni/ReadableNativeMap.cpp +8 -18
- package/ReactAndroid/src/main/jni/react/jni/ReadableNativeMap.h +4 -7
- package/ReactAndroid/src/main/jni/react/jni/WritableNativeArray.cpp +5 -7
- package/ReactAndroid/src/main/jni/react/jni/WritableNativeArray.h +6 -8
- package/ReactAndroid/src/main/jni/react/jni/WritableNativeMap.cpp +6 -8
- package/ReactAndroid/src/main/jni/react/jni/WritableNativeMap.h +6 -8
- package/ReactAndroid/src/main/jni/react/jscexecutor/OnLoad.cpp +6 -9
- package/ReactAndroid/src/main/jni/react/mapbuffer/CMakeLists.txt +1 -1
- package/ReactAndroid/src/main/jni/react/mapbuffer/react/common/mapbuffer/JReadableMapBuffer.cpp +4 -6
- package/ReactAndroid/src/main/jni/react/mapbuffer/react/common/mapbuffer/JReadableMapBuffer.h +4 -6
- package/ReactAndroid/src/main/jni/react/mapbuffer/react/common/mapbuffer/OnLoad.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/newarchdefaults/CMakeLists.txt +1 -1
- package/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultComponentsRegistry.cpp +10 -14
- package/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultComponentsRegistry.h +7 -9
- package/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultTurboModuleManagerDelegate.cpp +10 -12
- package/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultTurboModuleManagerDelegate.h +10 -12
- package/ReactAndroid/src/main/jni/react/newarchdefaults/OnLoad.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/perftests/OnLoad.cpp +12 -14
- package/ReactAndroid/src/main/jni/react/reactnativeblob/BlobCollector.cpp +7 -9
- package/ReactAndroid/src/main/jni/react/reactnativeblob/BlobCollector.h +3 -5
- package/ReactAndroid/src/main/jni/react/reactnativeblob/OnLoad.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/reactperflogger/CMakeLists.txt +1 -1
- package/ReactAndroid/src/main/jni/react/reactperflogger/reactperflogger/JNativeModulePerfLogger.h +2 -4
- package/ReactAndroid/src/main/jni/react/reactperflogger/reactperflogger/OnLoad.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/runtime/hermes/jni/.clang-tidy +20 -0
- package/ReactAndroid/src/main/jni/react/runtime/hermes/jni/CMakeLists.txt +29 -0
- package/ReactAndroid/src/main/jni/react/runtime/hermes/jni/JHermesInstance.cpp +31 -0
- package/ReactAndroid/src/main/jni/react/runtime/hermes/jni/JHermesInstance.h +42 -0
- package/ReactAndroid/src/main/jni/react/runtime/hermes/jni/OnLoad.cpp +15 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/.clang-tidy +20 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/CMakeLists.txt +31 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JBindingsInstaller.h +32 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JJSEngineInstance.h +26 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JJSTimerExecutor.cpp +34 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JJSTimerExecutor.h +37 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JJavaTimerManager.cpp +30 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JJavaTimerManager.h +26 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactExceptionManager.cpp +26 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactExceptionManager.h +25 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp +236 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.h +110 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JavaTimerRegistry.cpp +28 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JavaTimerRegistry.h +38 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/OnLoad.cpp +20 -0
- package/ReactAndroid/src/main/jni/react/runtime/jsc/jni/CMakeLists.txt +22 -0
- package/ReactAndroid/src/main/jni/react/runtime/jsc/jni/OnLoad.cpp +48 -0
- package/ReactAndroid/src/main/jni/react/turbomodule/CMakeLists.txt +2 -1
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/CallInvokerHolder.cpp +2 -4
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/CallInvokerHolder.h +2 -4
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/CompositeTurboModuleManagerDelegate.cpp +12 -13
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/CompositeTurboModuleManagerDelegate.h +11 -12
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/NativeMethodCallInvokerHolder.cpp +23 -0
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/NativeMethodCallInvokerHolder.h +32 -0
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/OnLoad.cpp +1 -1
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.cpp +249 -88
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.h +14 -10
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManagerDelegate.h +6 -8
- package/ReactAndroid/src/main/jni/react/uimanager/CMakeLists.txt +2 -1
- package/ReactAndroid/src/main/jni/react/uimanager/ComponentNameResolverManager.cpp +5 -8
- package/ReactAndroid/src/main/jni/react/uimanager/ComponentNameResolverManager.h +2 -4
- package/ReactAndroid/src/main/jni/react/uimanager/OnLoad.cpp +3 -1
- package/ReactAndroid/src/main/jni/react/uimanager/UIConstantsProviderManager.cpp +64 -0
- package/ReactAndroid/src/main/jni/react/uimanager/UIConstantsProviderManager.h +47 -0
- package/ReactAndroid/src/main/jni/third-party/boost/CMakeLists.txt +1 -1
- package/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt +3 -8
- package/ReactAndroid/src/main/res/devsupport/values/strings.xml +4 -7
- package/ReactAndroid/src/main/res/devsupport/values-af/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-ar/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-bg/strings.xml +1 -0
- package/ReactAndroid/src/main/res/devsupport/values-bn/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-bs/strings.xml +1 -0
- package/ReactAndroid/src/main/res/devsupport/values-cs/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-da/strings.xml +1 -0
- package/ReactAndroid/src/main/res/devsupport/values-el/strings.xml +1 -0
- package/ReactAndroid/src/main/res/devsupport/values-en-rGB/strings.xml +1 -0
- package/ReactAndroid/src/main/res/devsupport/values-es/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-es-rES/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-et/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-fa/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-fb/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-fb-rLS/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-fi/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-fr/strings.xml +1 -0
- package/ReactAndroid/src/main/res/devsupport/values-fr-rCA/strings.xml +1 -0
- package/ReactAndroid/src/main/res/devsupport/values-gu/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-ha/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-hi/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-hr/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-hu/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-in/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-it/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-iw/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-ja/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-jv/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-ka/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-km/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-kn/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-ko/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-lt/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-lv/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-mk/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-ml/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-mr/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-ms/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-my/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-nb/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-nl/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-pa/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-pl/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-pt/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-pt-rPT/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-ro/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-ru/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-si/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-sk/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-sl/strings.xml +1 -0
- package/ReactAndroid/src/main/res/devsupport/values-sq/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-sr/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-sv/strings.xml +1 -0
- package/ReactAndroid/src/main/res/devsupport/values-sw/strings.xml +1 -0
- package/ReactAndroid/src/main/res/devsupport/values-ta/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-te/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-th/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-tl/strings.xml +1 -0
- package/ReactAndroid/src/main/res/devsupport/values-tr/strings.xml +1 -0
- package/ReactAndroid/src/main/res/devsupport/values-uk/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-ur/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-vi/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-zh-rCN/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-zh-rHK/strings.xml +2 -0
- package/ReactAndroid/src/main/res/devsupport/values-zh-rTW/strings.xml +2 -0
- package/ReactAndroid/src/main/res/shell/values/styles.xml +4 -0
- package/ReactAndroid/src/main/res/views/uimanager/values/ids.xml +12 -0
- package/ReactAndroid/src/main/res/views/uimanager/values/strings.xml +103 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-af/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ar/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-as/strings.xml +13 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-az/strings.xml +13 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-be/strings.xml +8 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-bn/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-bs/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ca/strings.xml +6 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-cb/strings.xml +13 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-cs/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-da/strings.xml +28 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml +28 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-el/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-en-rGB/strings.xml +16 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-es/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-es-rES/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml +30 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-fb/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-fb-rLS/strings.xml +26 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-fi/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-fr/strings.xml +29 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml +29 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ha/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-hi/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-hr/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-hu/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-hy/strings.xml +13 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml +29 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-is/strings.xml +6 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml +27 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ja/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-jv/strings.xml +28 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ka/strings.xml +30 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-kk/strings.xml +12 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ko/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ku/strings.xml +12 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ky/strings.xml +12 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-lo/strings.xml +13 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-lt/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-lv/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-mk/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ml/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-mn/strings.xml +12 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-mr/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ms/strings.xml +29 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ne/strings.xml +13 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-nl/strings.xml +28 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-pa/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-pl/strings.xml +28 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ps/strings.xml +13 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-pt-rPT/strings.xml +30 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-qz/strings.xml +6 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml +29 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-sl/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-sn/strings.xml +6 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-so/strings.xml +12 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-sq/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml +30 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-sw/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ta/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-te/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-tg/strings.xml +12 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-th/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-tk/strings.xml +6 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-tl/strings.xml +14 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-tr/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-uk/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-uz/strings.xml +13 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-vi/strings.xml +29 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-wo/strings.xml +6 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-zh-rCN/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-zh-rHK/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml +31 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-zu/strings.xml +6 -0
- package/ReactCommon/React-Fabric.podspec +25 -62
- package/ReactCommon/React-FabricImage.podspec +93 -0
- package/ReactCommon/React-Mapbuffer.podspec +43 -0
- package/ReactCommon/React-nativeconfig.podspec +36 -0
- package/ReactCommon/React-rncore.podspec +4 -5
- package/ReactCommon/ReactCommon.podspec +6 -5
- package/ReactCommon/butter/CMakeLists.txt +1 -1
- package/ReactCommon/butter/butter.h +1 -1
- package/ReactCommon/callinvoker/CMakeLists.txt +1 -1
- package/ReactCommon/callinvoker/React-callinvoker.podspec +3 -3
- package/ReactCommon/callinvoker/ReactCommon/CallInvoker.h +12 -7
- package/ReactCommon/callinvoker/ReactCommon/SchedulerPriority.h +2 -4
- package/ReactCommon/cxxreact/CMakeLists.txt +1 -1
- package/ReactCommon/cxxreact/CxxModule.h +16 -18
- package/ReactCommon/cxxreact/CxxNativeModule.cpp +15 -17
- package/ReactCommon/cxxreact/CxxNativeModule.h +7 -9
- package/ReactCommon/cxxreact/ErrorUtils.h +3 -5
- package/ReactCommon/cxxreact/Instance.cpp +30 -30
- package/ReactCommon/cxxreact/Instance.h +24 -26
- package/ReactCommon/cxxreact/JSBigString.cpp +36 -18
- package/ReactCommon/cxxreact/JSBigString.h +12 -14
- package/ReactCommon/cxxreact/JSBundleType.cpp +5 -12
- package/ReactCommon/cxxreact/JSBundleType.h +5 -8
- package/ReactCommon/cxxreact/JSExecutor.cpp +3 -5
- package/ReactCommon/cxxreact/JSExecutor.h +14 -16
- package/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp +8 -11
- package/ReactCommon/cxxreact/JSIndexedRAMBundle.h +5 -7
- package/ReactCommon/cxxreact/JSModulesUnbundle.h +3 -5
- package/ReactCommon/cxxreact/JsArgumentHelpers-inl.h +19 -19
- package/ReactCommon/cxxreact/JsArgumentHelpers.h +16 -16
- package/ReactCommon/cxxreact/MessageQueueThread.h +4 -6
- package/ReactCommon/cxxreact/MethodCall.cpp +7 -9
- package/ReactCommon/cxxreact/MethodCall.h +4 -6
- package/ReactCommon/cxxreact/ModuleRegistry.cpp +7 -9
- package/ReactCommon/cxxreact/ModuleRegistry.h +6 -8
- package/ReactCommon/cxxreact/NativeModule.h +4 -6
- package/ReactCommon/cxxreact/NativeToJsBridge.cpp +40 -38
- package/ReactCommon/cxxreact/NativeToJsBridge.h +14 -16
- package/ReactCommon/cxxreact/RAMBundleRegistry.cpp +6 -5
- package/ReactCommon/cxxreact/RAMBundleRegistry.h +5 -7
- package/ReactCommon/cxxreact/React-cxxreact.podspec +9 -6
- package/ReactCommon/cxxreact/ReactMarker.cpp +53 -21
- package/ReactCommon/cxxreact/ReactMarker.h +37 -23
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/cxxreact/RecoverableError.h +5 -7
- package/ReactCommon/cxxreact/SampleCxxModule.cpp +5 -5
- package/ReactCommon/cxxreact/SampleCxxModule.h +3 -3
- package/ReactCommon/cxxreact/SystraceSection.h +6 -8
- package/ReactCommon/cxxreact/tests/RecoverableErrorTest.cpp +3 -3
- package/ReactCommon/cxxreact/tests/jsarg_helpers.cpp +4 -4
- package/ReactCommon/cxxreact/tests/jsbigstring.cpp +1 -1
- package/ReactCommon/cxxreact/tests/main.cpp +1 -1
- package/ReactCommon/cxxreact/tests/methodcall.cpp +7 -7
- package/ReactCommon/hermes/React-hermes.podspec +10 -12
- package/ReactCommon/hermes/executor/CMakeLists.txt +2 -2
- package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +33 -22
- package/ReactCommon/hermes/executor/HermesExecutorFactory.h +5 -7
- package/ReactCommon/hermes/executor/JSITracing.cpp +1 -1
- package/ReactCommon/hermes/executor/JSITracing.h +1 -1
- package/ReactCommon/hermes/executor/React-jsitracing.podspec +41 -0
- package/ReactCommon/hermes/inspector-modern/AsyncPauseState.h +34 -0
- package/ReactCommon/hermes/inspector-modern/CMakeLists.txt +40 -0
- package/ReactCommon/hermes/inspector-modern/Exceptions.h +60 -0
- package/ReactCommon/hermes/inspector-modern/Inspector.cpp +745 -0
- package/ReactCommon/hermes/inspector-modern/Inspector.h +384 -0
- package/ReactCommon/hermes/inspector-modern/InspectorState.cpp +511 -0
- package/ReactCommon/hermes/inspector-modern/InspectorState.h +412 -0
- package/ReactCommon/hermes/inspector-modern/README.md +113 -0
- package/ReactCommon/hermes/inspector-modern/RuntimeAdapter.cpp +30 -0
- package/ReactCommon/hermes/inspector-modern/RuntimeAdapter.h +76 -0
- package/ReactCommon/hermes/inspector-modern/chrome/Connection.cpp +1667 -0
- package/ReactCommon/hermes/inspector-modern/chrome/Connection.h +68 -0
- package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.cpp +147 -0
- package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.h +68 -0
- package/ReactCommon/hermes/inspector-modern/chrome/MessageConverters.cpp +378 -0
- package/ReactCommon/hermes/inspector-modern/chrome/MessageConverters.h +136 -0
- package/ReactCommon/hermes/inspector-modern/chrome/MessageInterfaces.h +74 -0
- package/ReactCommon/hermes/inspector-modern/chrome/MessageTypes.cpp +1948 -0
- package/ReactCommon/hermes/inspector-modern/chrome/MessageTypes.h +1129 -0
- package/ReactCommon/hermes/inspector-modern/chrome/MessageTypesInlines.h +190 -0
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp +43 -0
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.h +47 -0
- package/ReactCommon/hermes/inspector-modern/chrome/RemoteObjectsTable.cpp +146 -0
- package/ReactCommon/hermes/inspector-modern/chrome/RemoteObjectsTable.h +124 -0
- package/ReactCommon/hermes/inspector-modern/chrome/cli/main.cpp +275 -0
- package/ReactCommon/hermes/inspector-modern/chrome/tests/ConnectionDemuxTests.cpp +148 -0
- package/ReactCommon/hermes/inspector-modern/detail/CallbackOStream.cpp +77 -0
- package/ReactCommon/hermes/inspector-modern/detail/CallbackOStream.h +89 -0
- package/ReactCommon/hermes/inspector-modern/detail/SerialExecutor.cpp +60 -0
- package/ReactCommon/hermes/inspector-modern/detail/SerialExecutor.h +57 -0
- package/ReactCommon/hermes/inspector-modern/detail/Thread.cpp +39 -0
- package/ReactCommon/hermes/inspector-modern/detail/Thread.h +85 -0
- package/ReactCommon/hermes/inspector-modern/tools/run_msggen +32 -0
- package/ReactCommon/hermes/inspector-modern/tools/sandcastle/build_and_test.sh +13 -0
- package/ReactCommon/jsc/CMakeLists.txt +1 -1
- package/ReactCommon/jsc/JSCRuntime.cpp +239 -304
- package/ReactCommon/jsc/React-jsc.podspec +1 -1
- package/ReactCommon/jserrorhandler/CMakeLists.txt +22 -0
- package/ReactCommon/jserrorhandler/JsErrorHandler.cpp +4 -6
- package/ReactCommon/jserrorhandler/JsErrorHandler.h +5 -5
- package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +52 -0
- package/ReactCommon/jsi/React-jsi.podspec +17 -17
- package/ReactCommon/jsi/jsi/jsi.cpp +6 -0
- package/ReactCommon/jsi/jsi/jsi.h +21 -12
- package/ReactCommon/jsi/jsi/test/testlib.cpp +32 -5
- package/ReactCommon/jsiexecutor/CMakeLists.txt +1 -1
- package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +6 -5
- package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +46 -42
- package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h +21 -23
- package/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +5 -7
- package/ReactCommon/jsiexecutor/jsireact/JSINativeModules.h +5 -7
- package/ReactCommon/jsinspector-modern/CMakeLists.txt +16 -0
- package/ReactCommon/jsinspector-modern/InspectorInterfaces.cpp +106 -0
- package/ReactCommon/jsinspector-modern/InspectorInterfaces.h +92 -0
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +31 -0
- package/ReactCommon/logger/React-logger.podspec +3 -3
- package/ReactCommon/logger/react_native_log.cpp +6 -6
- package/ReactCommon/logger/react_native_log.h +7 -7
- package/ReactCommon/react/bridging/AString.h +5 -5
- package/ReactCommon/react/bridging/Array.h +16 -16
- package/ReactCommon/react/bridging/Base.h +20 -21
- package/ReactCommon/react/bridging/Bool.h +2 -2
- package/ReactCommon/react/bridging/Bridging.h +1 -0
- package/ReactCommon/react/bridging/CMakeLists.txt +2 -2
- package/ReactCommon/react/bridging/CallbackWrapper.h +10 -12
- package/ReactCommon/react/bridging/Class.h +6 -8
- package/ReactCommon/react/bridging/Convert.h +15 -7
- package/ReactCommon/react/bridging/Dynamic.h +26 -0
- package/ReactCommon/react/bridging/Error.h +6 -6
- package/ReactCommon/react/bridging/Function.h +36 -39
- package/ReactCommon/react/bridging/LongLivedObject.cpp +8 -10
- package/ReactCommon/react/bridging/LongLivedObject.h +6 -8
- package/ReactCommon/react/bridging/Number.h +8 -8
- package/ReactCommon/react/bridging/Object.h +12 -19
- package/ReactCommon/react/bridging/Promise.h +3 -3
- package/ReactCommon/react/bridging/Value.h +20 -20
- package/ReactCommon/react/bridging/tests/BridgingTest.cpp +116 -42
- package/ReactCommon/react/bridging/tests/BridgingTest.h +5 -5
- package/ReactCommon/react/bridging/tests/ClassTest.cpp +5 -5
- package/ReactCommon/react/config/CMakeLists.txt +1 -1
- package/ReactCommon/react/config/ReactNativeConfig.cpp +6 -8
- package/ReactCommon/react/config/ReactNativeConfig.h +10 -12
- package/ReactCommon/react/debug/CMakeLists.txt +2 -2
- package/ReactCommon/react/debug/React-debug.podspec +3 -2
- package/ReactCommon/react/debug/flags.h +11 -10
- package/ReactCommon/react/debug/react_native_assert.cpp +6 -6
- package/ReactCommon/react/debug/react_native_assert.h +3 -3
- package/ReactCommon/react/nativemodule/core/CMakeLists.txt +2 -1
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboCxxModule.cpp +22 -23
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboCxxModule.h +8 -10
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.cpp +5 -22
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h +43 -35
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp +129 -37
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.h +11 -18
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModulePerfLogger.cpp +92 -94
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModulePerfLogger.h +52 -54
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.cpp +13 -15
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +11 -13
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.cpp +190 -0
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.h +50 -0
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +190 -82
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.h +10 -12
- package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +9 -6
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.h +95 -0
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +654 -0
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h +65 -16
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +213 -152
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h +24 -9
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +370 -188
- package/ReactCommon/react/nativemodule/samples/ReactCommon/NativeSampleTurboCxxModuleSpecJSI.cpp +46 -48
- package/ReactCommon/react/nativemodule/samples/ReactCommon/NativeSampleTurboCxxModuleSpecJSI.h +16 -18
- package/ReactCommon/react/nativemodule/samples/ReactCommon/SampleTurboCxxModule.cpp +20 -22
- package/ReactCommon/react/nativemodule/samples/ReactCommon/SampleTurboCxxModule.h +15 -17
- package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +23 -8
- package/ReactCommon/react/nativemodule/samples/platform/android/CMakeLists.txt +1 -1
- package/ReactCommon/react/nativemodule/samples/platform/android/NativeSampleTurboModuleSpec.java +19 -2
- package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.cpp +167 -55
- package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.h +5 -7
- package/ReactCommon/react/nativemodule/samples/platform/android/SampleLegacyModule.java +246 -0
- package/ReactCommon/react/nativemodule/samples/platform/android/SampleTurboModule.java +45 -2
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.h +8 -4
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.mm +68 -4
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.h +16 -0
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.mm +222 -0
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm +47 -0
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/SampleTurboCxxModuleLegacyImpl.cpp +11 -13
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/SampleTurboCxxModuleLegacyImpl.h +11 -13
- package/ReactCommon/react/renderer/animations/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/animations/LayoutAnimationCallbackWrapper.h +4 -6
- package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp +9 -9
- package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.h +5 -7
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +138 -107
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +42 -34
- package/ReactCommon/react/renderer/animations/conversions.h +12 -14
- package/ReactCommon/react/renderer/animations/primitives.h +2 -4
- package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +6 -8
- package/ReactCommon/react/renderer/animations/utils.cpp +2 -2
- package/ReactCommon/react/renderer/animations/utils.h +8 -10
- package/ReactCommon/react/renderer/attributedstring/AttributedString.cpp +21 -16
- package/ReactCommon/react/renderer/attributedstring/AttributedString.h +22 -26
- package/ReactCommon/react/renderer/attributedstring/AttributedStringBox.cpp +13 -13
- package/ReactCommon/react/renderer/attributedstring/AttributedStringBox.h +12 -14
- package/ReactCommon/react/renderer/attributedstring/CMakeLists.txt +2 -2
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +2 -2
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +7 -10
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +6 -2
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +9 -8
- package/ReactCommon/react/renderer/attributedstring/conversions.h +97 -223
- package/ReactCommon/react/renderer/attributedstring/primitives.h +14 -54
- package/ReactCommon/react/renderer/attributedstring/tests/AttributedStringTest.cpp +2 -4
- package/ReactCommon/react/renderer/attributedstring/tests/TextAttributesTest.cpp +2 -4
- package/ReactCommon/react/renderer/componentregistry/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorFactory.h +4 -6
- package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorProvider.h +6 -8
- package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorProviderRegistry.cpp +5 -5
- package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h +7 -8
- package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +17 -17
- package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.h +17 -18
- package/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.cpp +1 -0
- package/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.h +2 -4
- package/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt +2 -1
- package/ReactCommon/react/renderer/componentregistry/native/NativeComponentRegistryBinding.cpp +6 -44
- package/ReactCommon/react/renderer/componentregistry/native/NativeComponentRegistryBinding.h +9 -39
- package/ReactCommon/react/renderer/components/image/CMakeLists.txt +2 -1
- package/ReactCommon/react/renderer/components/image/ImageComponentDescriptor.h +6 -9
- package/ReactCommon/react/renderer/components/image/ImageEventEmitter.cpp +1 -1
- package/ReactCommon/react/renderer/components/image/ImageEventEmitter.h +2 -4
- package/ReactCommon/react/renderer/components/image/ImageProps.cpp +7 -7
- package/ReactCommon/react/renderer/components/image/ImageProps.h +8 -10
- package/ReactCommon/react/renderer/components/image/ImageShadowNode.cpp +3 -3
- package/ReactCommon/react/renderer/components/image/ImageShadowNode.h +7 -8
- package/ReactCommon/react/renderer/components/image/ImageState.cpp +1 -1
- package/ReactCommon/react/renderer/components/image/ImageState.h +7 -9
- package/ReactCommon/react/renderer/components/image/conversions.h +14 -15
- package/ReactCommon/react/renderer/components/inputaccessory/InputAccessoryComponentDescriptor.h +11 -16
- package/ReactCommon/react/renderer/components/inputaccessory/InputAccessoryShadowNode.cpp +2 -4
- package/ReactCommon/react/renderer/components/inputaccessory/InputAccessoryShadowNode.h +2 -4
- package/ReactCommon/react/renderer/components/inputaccessory/InputAccessoryState.h +2 -4
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h +5 -7
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +41 -16
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.cpp +2 -4
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.h +2 -4
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropState.h +2 -4
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropState.mm +2 -4
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewEventEmitter.cpp +4 -6
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewEventEmitter.h +3 -5
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.cpp +5 -7
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.h +5 -7
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +4 -2
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +47 -11
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerInteropComponentDescriptor.h +4 -6
- package/ReactCommon/react/renderer/components/modal/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/modal/ModalHostViewComponentDescriptor.h +11 -17
- package/ReactCommon/react/renderer/components/modal/ModalHostViewShadowNode.h +2 -4
- package/ReactCommon/react/renderer/components/modal/ModalHostViewState.h +3 -5
- package/ReactCommon/react/renderer/components/progressbar/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarComponentDescriptor.h +8 -10
- package/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.cpp +4 -4
- package/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.h +4 -6
- package/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.cpp +4 -4
- package/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.h +6 -8
- package/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/conversions.h +3 -5
- package/ReactCommon/react/renderer/components/root/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/root/RootComponentDescriptor.h +2 -4
- package/ReactCommon/react/renderer/components/root/RootProps.cpp +7 -7
- package/ReactCommon/react/renderer/components/root/RootProps.h +9 -11
- package/ReactCommon/react/renderer/components/root/RootShadowNode.cpp +5 -5
- package/ReactCommon/react/renderer/components/root/RootShadowNode.h +7 -9
- package/ReactCommon/react/renderer/components/safeareaview/SafeAreaViewComponentDescriptor.h +9 -22
- package/ReactCommon/react/renderer/components/safeareaview/SafeAreaViewShadowNode.cpp +2 -4
- package/ReactCommon/react/renderer/components/safeareaview/SafeAreaViewShadowNode.h +2 -11
- package/ReactCommon/react/renderer/components/safeareaview/SafeAreaViewState.cpp +1 -3
- package/ReactCommon/react/renderer/components/safeareaview/SafeAreaViewState.h +2 -4
- package/ReactCommon/react/renderer/components/scrollview/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/scrollview/RCTComponentViewHelpers.h +1 -1
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewComponentDescriptor.h +2 -4
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewEventEmitter.cpp +10 -10
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewEventEmitter.h +8 -10
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp +7 -7
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h +8 -10
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp +8 -1
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.h +8 -4
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewState.cpp +8 -0
- package/ReactCommon/react/renderer/components/scrollview/ScrollViewState.h +9 -6
- package/ReactCommon/react/renderer/components/scrollview/conversions.h +24 -25
- package/ReactCommon/react/renderer/components/scrollview/primitives.h +5 -6
- package/ReactCommon/react/renderer/components/switch/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchComponentDescriptor.h +8 -10
- package/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchMeasurementsManager.cpp +3 -3
- package/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchMeasurementsManager.h +3 -5
- package/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchShadowNode.cpp +4 -4
- package/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchShadowNode.h +6 -8
- package/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +19 -11
- package/ReactCommon/react/renderer/components/text/BaseTextProps.h +8 -10
- package/ReactCommon/react/renderer/components/text/BaseTextShadowNode.cpp +8 -8
- package/ReactCommon/react/renderer/components/text/BaseTextShadowNode.h +7 -9
- package/ReactCommon/react/renderer/components/text/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.h +7 -10
- package/ReactCommon/react/renderer/components/text/ParagraphEventEmitter.cpp +6 -6
- package/ReactCommon/react/renderer/components/text/ParagraphEventEmitter.h +3 -5
- package/ReactCommon/react/renderer/components/text/ParagraphLayoutManager.cpp +54 -41
- package/ReactCommon/react/renderer/components/text/ParagraphLayoutManager.h +32 -11
- package/ReactCommon/react/renderer/components/text/ParagraphProps.cpp +7 -7
- package/ReactCommon/react/renderer/components/text/ParagraphProps.h +8 -10
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp +36 -22
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +15 -13
- package/ReactCommon/react/renderer/components/text/ParagraphState.h +5 -5
- package/ReactCommon/react/renderer/components/text/RawTextComponentDescriptor.h +2 -4
- package/ReactCommon/react/renderer/components/text/RawTextProps.cpp +3 -3
- package/ReactCommon/react/renderer/components/text/RawTextProps.h +5 -7
- package/ReactCommon/react/renderer/components/text/RawTextShadowNode.h +2 -4
- package/ReactCommon/react/renderer/components/text/TextComponentDescriptor.h +2 -4
- package/ReactCommon/react/renderer/components/text/TextProps.cpp +6 -6
- package/ReactCommon/react/renderer/components/text/TextProps.h +8 -10
- package/ReactCommon/react/renderer/components/text/TextShadowNode.h +4 -6
- package/ReactCommon/react/renderer/components/text/conversions.h +4 -6
- package/ReactCommon/react/renderer/components/text/tests/ParagraphLocalDataTest.cpp +2 -4
- package/ReactCommon/react/renderer/components/textinput/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputComponentDescriptor.h +46 -53
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputEventEmitter.h +2 -4
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp +8 -8
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.h +15 -19
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.cpp +5 -15
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h +6 -8
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.cpp +2 -8
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.h +4 -22
- package/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputComponentDescriptor.h +8 -12
- package/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputEventEmitter.cpp +25 -25
- package/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputEventEmitter.h +17 -19
- package/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputProps.cpp +6 -6
- package/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputProps.h +15 -17
- package/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputShadowNode.cpp +8 -8
- package/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputShadowNode.h +9 -11
- package/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputState.cpp +2 -2
- package/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputState.h +5 -7
- package/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/conversions.h +20 -22
- package/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/primitives.h +11 -4
- package/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/propsConversions.h +18 -14
- package/ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp +5 -5
- package/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.h +5 -7
- package/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewProps.h +2 -4
- package/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewShadowNode.h +2 -4
- package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +145 -20
- package/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +31 -18
- package/ReactCommon/react/renderer/components/view/AccessibilityProps.h +10 -11
- package/ReactCommon/react/renderer/components/view/BaseTouch.cpp +50 -0
- package/ReactCommon/react/renderer/components/view/BaseTouch.h +91 -0
- package/ReactCommon/react/renderer/components/view/BaseViewEventEmitter.cpp +121 -0
- package/ReactCommon/react/renderer/components/view/BaseViewEventEmitter.h +67 -0
- package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +505 -0
- package/ReactCommon/react/renderer/components/view/BaseViewProps.h +101 -0
- package/ReactCommon/react/renderer/components/view/CMakeLists.txt +10 -3
- package/ReactCommon/react/renderer/components/view/ConcreteViewShadowNode.h +12 -30
- package/ReactCommon/react/renderer/components/view/PointerEvent.cpp +41 -2
- package/ReactCommon/react/renderer/components/view/PointerEvent.h +12 -7
- package/ReactCommon/react/renderer/components/view/Touch.h +4 -78
- package/ReactCommon/react/renderer/components/view/TouchEvent.cpp +2 -2
- package/ReactCommon/react/renderer/components/view/TouchEvent.h +4 -6
- package/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +48 -81
- package/ReactCommon/react/renderer/components/view/TouchEventEmitter.h +21 -20
- package/ReactCommon/react/renderer/components/view/ViewComponentDescriptor.h +3 -5
- package/ReactCommon/react/renderer/components/view/ViewEventEmitter.h +4 -62
- package/ReactCommon/react/renderer/components/view/ViewProps.h +5 -124
- package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +11 -13
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +20 -36
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +9 -11
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +295 -177
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.h +65 -39
- package/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +228 -38
- package/ReactCommon/react/renderer/components/view/YogaStylableProps.h +24 -18
- package/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +515 -33
- package/ReactCommon/react/renderer/components/view/conversions.h +255 -219
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/AccessibilityPropsMapBuffer.cpp +165 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/AccessibilityPropsMapBuffer.h +35 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformTouch.h +14 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewEventEmitter.h +14 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +162 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.h +68 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +31 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/NativeDrawable.h +106 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/ViewPropsMapBuffer.cpp +191 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/ViewPropsMapBuffer.h +51 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/YogaStylablePropsMapBuffer.cpp +80 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/YogaStylablePropsMapBuffer.h +22 -0
- package/ReactCommon/react/renderer/components/view/platform/cxx/react/renderer/components/view/HostPlatformTouch.h +14 -0
- package/ReactCommon/react/renderer/components/view/platform/cxx/react/renderer/components/view/HostPlatformViewEventEmitter.h +14 -0
- package/ReactCommon/react/renderer/components/view/platform/cxx/react/renderer/components/view/HostPlatformViewProps.h +14 -0
- package/ReactCommon/react/renderer/components/view/platform/cxx/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +27 -0
- package/ReactCommon/react/renderer/components/view/primitives.h +22 -58
- package/ReactCommon/react/renderer/components/view/propsConversions.h +126 -133
- package/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp +18 -18
- package/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp +22 -23
- package/ReactCommon/react/renderer/components/view/viewPropConversions.h +16 -18
- package/ReactCommon/react/renderer/core/BatchedEventQueue.h +2 -4
- package/ReactCommon/react/renderer/core/CMakeLists.txt +3 -1
- package/ReactCommon/react/renderer/core/ComponentDescriptor.cpp +2 -2
- package/ReactCommon/react/renderer/core/ComponentDescriptor.h +47 -35
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +39 -77
- package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +22 -23
- package/ReactCommon/react/renderer/core/ConcreteState.h +28 -22
- package/ReactCommon/react/renderer/core/DynamicPropsUtilities.cpp +3 -3
- package/ReactCommon/react/renderer/core/DynamicPropsUtilities.h +2 -2
- package/ReactCommon/react/renderer/core/EventBeat.cpp +1 -1
- package/ReactCommon/react/renderer/core/EventBeat.h +6 -8
- package/ReactCommon/react/renderer/core/EventDispatcher.cpp +11 -11
- package/ReactCommon/react/renderer/core/EventDispatcher.h +14 -16
- package/ReactCommon/react/renderer/core/EventEmitter.cpp +34 -11
- package/ReactCommon/react/renderer/core/EventEmitter.h +20 -11
- package/ReactCommon/react/renderer/core/EventHandler.h +2 -4
- package/ReactCommon/react/renderer/core/EventListener.cpp +6 -4
- package/ReactCommon/react/renderer/core/EventListener.h +7 -9
- package/ReactCommon/react/renderer/core/EventLogger.cpp +3 -3
- package/ReactCommon/react/renderer/core/EventLogger.h +5 -3
- package/ReactCommon/react/renderer/core/EventPayload.h +40 -0
- package/ReactCommon/react/renderer/core/EventPayloadType.h +14 -0
- package/ReactCommon/react/renderer/core/EventPipe.h +9 -8
- package/ReactCommon/react/renderer/core/EventPriority.h +2 -4
- package/ReactCommon/react/renderer/core/EventQueue.cpp +12 -12
- package/ReactCommon/react/renderer/core/EventQueue.h +7 -9
- package/ReactCommon/react/renderer/core/EventQueueProcessor.cpp +30 -10
- package/ReactCommon/react/renderer/core/EventQueueProcessor.h +11 -9
- package/ReactCommon/react/renderer/core/EventTarget.cpp +17 -14
- package/ReactCommon/react/renderer/core/EventTarget.h +10 -12
- package/ReactCommon/react/renderer/core/InstanceHandle.cpp +28 -0
- package/ReactCommon/react/renderer/core/InstanceHandle.h +41 -0
- package/ReactCommon/react/renderer/core/LayoutConstraints.cpp +1 -1
- package/ReactCommon/react/renderer/core/LayoutConstraints.h +10 -13
- package/ReactCommon/react/renderer/core/LayoutContext.h +5 -7
- package/ReactCommon/react/renderer/core/LayoutMetrics.cpp +2 -2
- package/ReactCommon/react/renderer/core/LayoutMetrics.h +38 -14
- package/ReactCommon/react/renderer/core/LayoutPrimitives.h +4 -6
- package/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp +74 -47
- package/ReactCommon/react/renderer/core/LayoutableShadowNode.h +22 -18
- package/ReactCommon/react/renderer/core/Props.cpp +41 -22
- package/ReactCommon/react/renderer/core/Props.h +18 -14
- package/ReactCommon/react/renderer/core/PropsParserContext.cpp +27 -0
- package/ReactCommon/react/renderer/core/PropsParserContext.h +19 -8
- package/ReactCommon/react/renderer/core/RawEvent.cpp +2 -2
- package/ReactCommon/react/renderer/core/RawEvent.h +5 -7
- package/ReactCommon/react/renderer/core/RawProps.cpp +11 -12
- package/ReactCommon/react/renderer/core/RawProps.h +16 -26
- package/ReactCommon/react/renderer/core/RawPropsKey.cpp +4 -4
- package/ReactCommon/react/renderer/core/RawPropsKey.h +8 -10
- package/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +27 -15
- package/ReactCommon/react/renderer/core/RawPropsKeyMap.h +10 -14
- package/ReactCommon/react/renderer/core/RawPropsParser.cpp +29 -28
- package/ReactCommon/react/renderer/core/RawPropsParser.h +9 -14
- package/ReactCommon/react/renderer/core/RawPropsPrimitives.h +2 -18
- package/ReactCommon/react/renderer/core/RawValue.h +59 -60
- package/ReactCommon/react/renderer/core/ReactEventPriority.h +2 -4
- package/ReactCommon/react/renderer/core/ReactPrimitives.h +3 -7
- package/ReactCommon/react/renderer/core/Sealable.cpp +4 -4
- package/ReactCommon/react/renderer/core/Sealable.h +6 -8
- package/ReactCommon/react/renderer/core/ShadowNode.cpp +56 -38
- package/ReactCommon/react/renderer/core/ShadowNode.h +48 -42
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp +19 -13
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +48 -30
- package/ReactCommon/react/renderer/core/ShadowNodeFragment.cpp +13 -7
- package/ReactCommon/react/renderer/core/ShadowNodeFragment.h +9 -11
- package/ReactCommon/react/renderer/core/ShadowNodeTraits.h +3 -5
- package/ReactCommon/react/renderer/core/State.cpp +4 -4
- package/ReactCommon/react/renderer/core/State.h +6 -8
- package/ReactCommon/react/renderer/core/StateData.h +4 -6
- package/ReactCommon/react/renderer/core/StatePipe.h +3 -5
- package/ReactCommon/react/renderer/core/StateUpdate.h +4 -6
- package/ReactCommon/react/renderer/core/TraitCast.h +10 -10
- package/ReactCommon/react/renderer/core/UnbatchedEventQueue.h +2 -4
- package/ReactCommon/react/renderer/core/ValueFactory.h +3 -5
- package/ReactCommon/react/renderer/core/ValueFactoryEventPayload.cpp +23 -0
- package/ReactCommon/react/renderer/core/ValueFactoryEventPayload.h +25 -0
- package/ReactCommon/react/renderer/core/conversions.h +8 -10
- package/ReactCommon/react/renderer/core/graphicsConversions.h +41 -41
- package/ReactCommon/react/renderer/core/propsConversions.h +26 -28
- package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +31 -41
- package/ReactCommon/react/renderer/core/tests/EventQueueProcessorTest.cpp +16 -14
- package/ReactCommon/react/renderer/core/tests/FindNodeAtPointTest.cpp +2 -1
- package/ReactCommon/react/renderer/core/tests/LayoutableShadowNodeTest.cpp +249 -101
- package/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp +27 -27
- package/ReactCommon/react/renderer/core/tests/ShadowNodeTest.cpp +19 -21
- package/ReactCommon/react/renderer/core/tests/TestComponent.h +23 -6
- package/ReactCommon/react/renderer/core/tests/benchmarks/RawPropsBenchmark.cpp +6 -6
- package/ReactCommon/react/renderer/core/tests/traitCastTest.cpp +39 -41
- package/ReactCommon/react/renderer/debug/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/debug/DebugStringConvertible.cpp +8 -8
- package/ReactCommon/react/renderer/debug/DebugStringConvertible.h +34 -35
- package/ReactCommon/react/renderer/debug/DebugStringConvertibleItem.h +3 -5
- package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +61 -0
- package/ReactCommon/react/renderer/debug/SystraceSection.h +6 -8
- package/ReactCommon/react/renderer/debug/debugStringConvertibleUtils.h +6 -7
- package/ReactCommon/react/renderer/debug/flags.h +4 -0
- package/ReactCommon/react/renderer/element/CMakeLists.txt +1 -2
- package/ReactCommon/react/renderer/element/ComponentBuilder.cpp +9 -11
- package/ReactCommon/react/renderer/element/ComponentBuilder.h +7 -10
- package/ReactCommon/react/renderer/element/Element.h +30 -26
- package/ReactCommon/react/renderer/element/ElementFragment.h +6 -7
- package/ReactCommon/react/renderer/element/testUtils.h +6 -6
- package/ReactCommon/react/renderer/graphics/CMakeLists.txt +2 -3
- package/ReactCommon/react/renderer/graphics/Color.cpp +3 -14
- package/ReactCommon/react/renderer/graphics/Color.h +8 -8
- package/ReactCommon/react/renderer/graphics/ColorComponents.h +2 -4
- package/ReactCommon/react/renderer/graphics/Point.h +12 -14
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +8 -4
- package/ReactCommon/react/renderer/graphics/Rect.h +30 -14
- package/ReactCommon/react/renderer/graphics/RectangleCorners.h +7 -10
- package/ReactCommon/react/renderer/graphics/RectangleEdges.h +16 -18
- package/ReactCommon/react/renderer/graphics/Size.h +9 -11
- package/ReactCommon/react/renderer/graphics/Transform.cpp +35 -32
- package/ReactCommon/react/renderer/graphics/Transform.h +41 -24
- package/ReactCommon/react/renderer/graphics/ValueUnit.h +32 -0
- package/ReactCommon/react/renderer/graphics/Vector.h +2 -4
- package/ReactCommon/react/renderer/graphics/platform/android/react/renderer/graphics/Float.h +2 -4
- package/ReactCommon/react/renderer/graphics/platform/android/react/renderer/graphics/HostPlatformColor.h +39 -0
- package/ReactCommon/react/renderer/graphics/platform/android/react/renderer/graphics/PlatformColorParser.h +13 -13
- package/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/Float.h +2 -4
- package/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/HostPlatformColor.h +39 -0
- package/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/PlatformColorParser.h +7 -9
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/Float.h +2 -4
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h +39 -0
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/PlatformColorParser.h +12 -12
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.h +1 -1
- package/ReactCommon/react/renderer/graphics/rounding.h +2 -4
- package/ReactCommon/react/renderer/graphics/tests/TransformTest.cpp +16 -0
- package/ReactCommon/react/renderer/imagemanager/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/imagemanager/ImageManager.h +5 -7
- package/ReactCommon/react/renderer/imagemanager/ImageRequest.h +9 -11
- package/ReactCommon/react/renderer/imagemanager/ImageResponse.h +2 -4
- package/ReactCommon/react/renderer/imagemanager/ImageResponseObserver.h +3 -5
- package/ReactCommon/react/renderer/imagemanager/ImageResponseObserverCoordinator.cpp +4 -4
- package/ReactCommon/react/renderer/imagemanager/ImageResponseObserverCoordinator.h +6 -9
- package/ReactCommon/react/renderer/imagemanager/ImageTelemetry.h +3 -5
- package/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageManager.cpp +2 -2
- package/ReactCommon/react/renderer/imagemanager/platform/cxx/react/renderer/imagemanager/ImageRequest.cpp +3 -3
- package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +15 -17
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/ImageManager.mm +3 -5
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/ImageRequest.cpp +7 -9
- package/ReactCommon/react/renderer/imagemanager/primitives.h +4 -6
- package/ReactCommon/react/renderer/leakchecker/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/leakchecker/LeakChecker.cpp +3 -3
- package/ReactCommon/react/renderer/leakchecker/LeakChecker.h +4 -6
- package/ReactCommon/react/renderer/leakchecker/WeakFamilyRegistry.cpp +4 -4
- package/ReactCommon/react/renderer/leakchecker/WeakFamilyRegistry.h +3 -5
- package/ReactCommon/react/renderer/mapbuffer/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +10 -10
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.h +7 -9
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +16 -16
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h +7 -9
- package/ReactCommon/react/renderer/mounting/CMakeLists.txt +1 -2
- package/ReactCommon/react/renderer/mounting/Differentiator.cpp +118 -119
- package/ReactCommon/react/renderer/mounting/Differentiator.h +7 -9
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +19 -8
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +20 -11
- package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +3 -5
- package/ReactCommon/react/renderer/mounting/MountingTransaction.cpp +3 -3
- package/ReactCommon/react/renderer/mounting/MountingTransaction.h +9 -11
- package/ReactCommon/react/renderer/mounting/ShadowTree.cpp +126 -54
- package/ReactCommon/react/renderer/mounting/ShadowTree.h +19 -16
- package/ReactCommon/react/renderer/mounting/ShadowTreeDelegate.h +5 -7
- package/ReactCommon/react/renderer/mounting/ShadowTreeRegistry.cpp +5 -5
- package/ReactCommon/react/renderer/mounting/ShadowTreeRegistry.h +8 -11
- package/ReactCommon/react/renderer/mounting/ShadowTreeRevision.h +2 -4
- package/ReactCommon/react/renderer/mounting/ShadowView.cpp +12 -12
- package/ReactCommon/react/renderer/mounting/ShadowView.h +24 -31
- package/ReactCommon/react/renderer/mounting/ShadowViewMutation.cpp +2 -2
- package/ReactCommon/react/renderer/mounting/ShadowViewMutation.h +4 -6
- package/ReactCommon/react/renderer/mounting/StubView.cpp +7 -7
- package/ReactCommon/react/renderer/mounting/StubView.h +9 -11
- package/ReactCommon/react/renderer/mounting/StubViewTree.cpp +60 -60
- package/ReactCommon/react/renderer/mounting/StubViewTree.h +18 -14
- package/ReactCommon/react/renderer/mounting/TelemetryController.cpp +5 -5
- package/ReactCommon/react/renderer/mounting/TelemetryController.h +11 -13
- package/ReactCommon/react/renderer/mounting/stubs.cpp +8 -8
- package/ReactCommon/react/renderer/mounting/stubs.h +4 -6
- package/ReactCommon/react/renderer/mounting/tests/MountingTest.cpp +50 -40
- package/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +20 -20
- package/ReactCommon/react/renderer/mounting/tests/StackingContextTest.cpp +82 -66
- package/ReactCommon/react/renderer/mounting/tests/StateReconciliationTest.cpp +167 -46
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.cpp +202 -0
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.h +80 -0
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserverManager.cpp +213 -0
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserverManager.h +74 -0
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.cpp +60 -0
- package/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.h +46 -0
- package/ReactCommon/react/renderer/observers/mutation/MutationObserver.cpp +200 -0
- package/ReactCommon/react/renderer/observers/mutation/MutationObserver.h +64 -0
- package/ReactCommon/react/renderer/observers/mutation/MutationObserverManager.cpp +142 -0
- package/ReactCommon/react/renderer/observers/mutation/MutationObserverManager.h +63 -0
- package/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt +2 -1
- package/ReactCommon/react/renderer/runtimescheduler/ErrorUtils.h +4 -6
- package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +12 -9
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +46 -30
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +15 -12
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +23 -25
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.h +6 -8
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.cpp +7 -7
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h +5 -8
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerClock.h +2 -4
- package/ReactCommon/react/renderer/runtimescheduler/Task.cpp +2 -2
- package/ReactCommon/react/renderer/runtimescheduler/Task.h +4 -4
- package/ReactCommon/react/renderer/runtimescheduler/primitives.h +20 -11
- package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +20 -20
- package/ReactCommon/react/renderer/runtimescheduler/tests/StubErrorUtils.h +7 -9
- package/ReactCommon/react/renderer/runtimescheduler/tests/StubQueue.h +8 -7
- package/ReactCommon/react/renderer/scheduler/AsynchronousEventBeat.cpp +2 -2
- package/ReactCommon/react/renderer/scheduler/AsynchronousEventBeat.h +1 -1
- package/ReactCommon/react/renderer/scheduler/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/scheduler/InspectorData.h +2 -4
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +71 -51
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +27 -27
- package/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h +8 -8
- package/ReactCommon/react/renderer/scheduler/SchedulerToolbox.h +3 -6
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +43 -24
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +16 -18
- package/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp +15 -15
- package/ReactCommon/react/renderer/scheduler/SurfaceManager.h +15 -17
- package/ReactCommon/react/renderer/scheduler/SynchronousEventBeat.cpp +3 -3
- package/ReactCommon/react/renderer/scheduler/SynchronousEventBeat.h +3 -5
- package/ReactCommon/react/renderer/telemetry/CMakeLists.txt +1 -2
- package/ReactCommon/react/renderer/telemetry/SurfaceTelemetry.cpp +1 -1
- package/ReactCommon/react/renderer/telemetry/SurfaceTelemetry.h +4 -9
- package/ReactCommon/react/renderer/telemetry/TransactionTelemetry.cpp +11 -2
- package/ReactCommon/react/renderer/telemetry/TransactionTelemetry.h +8 -5
- package/ReactCommon/react/renderer/templateprocessor/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/templateprocessor/UITemplateProcessor.cpp +25 -25
- package/ReactCommon/react/renderer/templateprocessor/UITemplateProcessor.h +18 -20
- package/ReactCommon/react/renderer/templateprocessor/tests/UITemplateProcessorTest.cpp +14 -14
- package/ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.cpp +3 -3
- package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +23 -26
- package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +29 -29
- package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.h +20 -22
- package/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.cpp +5 -7
- package/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.h +4 -6
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +5 -3
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +11 -92
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/TextLayoutManager.h +3 -5
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/TextLayoutManager.mm +4 -6
- package/ReactCommon/react/renderer/timeline/Timeline.cpp +18 -17
- package/ReactCommon/react/renderer/timeline/Timeline.h +11 -14
- package/ReactCommon/react/renderer/timeline/TimelineController.cpp +12 -13
- package/ReactCommon/react/renderer/timeline/TimelineController.h +14 -19
- package/ReactCommon/react/renderer/timeline/TimelineFrame.h +4 -6
- package/ReactCommon/react/renderer/timeline/TimelineHandler.cpp +4 -4
- package/ReactCommon/react/renderer/timeline/TimelineHandler.h +9 -11
- package/ReactCommon/react/renderer/timeline/TimelineSnapshot.h +2 -4
- package/ReactCommon/react/renderer/uimanager/CMakeLists.txt +2 -1
- package/ReactCommon/react/renderer/uimanager/PointerEventsProcessor.cpp +399 -0
- package/ReactCommon/react/renderer/uimanager/PointerEventsProcessor.h +84 -0
- package/ReactCommon/react/renderer/uimanager/SurfaceRegistryBinding.cpp +66 -90
- package/ReactCommon/react/renderer/uimanager/SurfaceRegistryBinding.h +7 -7
- package/ReactCommon/react/renderer/uimanager/UIManager.cpp +241 -98
- package/ReactCommon/react/renderer/uimanager/UIManager.h +78 -51
- package/ReactCommon/react/renderer/uimanager/UIManagerAnimationDelegate.h +5 -5
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +920 -185
- package/ReactCommon/react/renderer/uimanager/UIManagerBinding.h +27 -12
- package/ReactCommon/react/renderer/uimanager/UIManagerCommitHook.h +5 -6
- package/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h +7 -7
- package/ReactCommon/react/renderer/uimanager/UIManagerMountHook.h +34 -0
- package/ReactCommon/react/renderer/uimanager/bindingUtils.cpp +7 -7
- package/ReactCommon/react/renderer/uimanager/bindingUtils.h +3 -3
- package/ReactCommon/react/renderer/uimanager/primitives.h +102 -29
- package/ReactCommon/react/runtime/.clang-tidy +17 -0
- package/ReactCommon/react/runtime/BindingsInstaller.h +21 -0
- package/ReactCommon/react/runtime/BridgelessJSCallInvoker.cpp +28 -0
- package/ReactCommon/react/runtime/BridgelessJSCallInvoker.h +28 -0
- package/ReactCommon/react/runtime/BridgelessNativeMethodCallInvoker.cpp +28 -0
- package/ReactCommon/react/runtime/BridgelessNativeMethodCallInvoker.h +28 -0
- package/ReactCommon/react/runtime/BufferedRuntimeExecutor.cpp +60 -0
- package/ReactCommon/react/runtime/BufferedRuntimeExecutor.h +49 -0
- package/ReactCommon/react/runtime/CMakeLists.txt +37 -0
- package/ReactCommon/react/runtime/JSEngineInstance.h +27 -0
- package/ReactCommon/react/runtime/PlatformTimerRegistry.h +32 -0
- package/ReactCommon/react/runtime/README.md +3 -0
- package/ReactCommon/react/runtime/React-RuntimeCore.podspec +62 -0
- package/ReactCommon/react/runtime/React-RuntimeHermes.podspec +58 -0
- package/ReactCommon/react/runtime/ReactInstance.cpp +468 -0
- package/ReactCommon/react/runtime/ReactInstance.h +78 -0
- package/ReactCommon/react/runtime/TimerManager.cpp +414 -0
- package/ReactCommon/react/runtime/TimerManager.h +115 -0
- package/ReactCommon/react/runtime/hermes/CMakeLists.txt +33 -0
- package/ReactCommon/react/runtime/hermes/HermesInstance.cpp +144 -0
- package/ReactCommon/react/runtime/hermes/HermesInstance.h +25 -0
- package/ReactCommon/react/runtime/iostests/RCTHostTests.mm +158 -0
- package/ReactCommon/react/runtime/nativeviewconfig/CMakeLists.txt +19 -0
- package/ReactCommon/react/runtime/nativeviewconfig/LegacyUIManagerConstantsProviderBinding.cpp +30 -0
- package/ReactCommon/react/runtime/nativeviewconfig/LegacyUIManagerConstantsProviderBinding.h +22 -0
- package/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec +76 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/ObjCTimerRegistry.h +32 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/ObjCTimerRegistry.mm +73 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTContextContainerHandling.h +16 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHermesInstance.h +40 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHermesInstance.mm +31 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost+Internal.h +20 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h +75 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +318 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h +75 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +460 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTJSThreadManager.h +21 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTJSThreadManager.mm +124 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTJscInstance.h +25 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTJscInstance.mm +23 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTLegacyUIManagerConstantsProvider.h +19 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTLegacyUIManagerConstantsProvider.mm +44 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTPerformanceLoggerUtils.h +16 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTPerformanceLoggerUtils.mm +74 -0
- package/ReactCommon/react/runtime/tests/cxx/ReactInstanceTest.cpp +868 -0
- package/ReactCommon/react/test_utils/Entropy.h +8 -10
- package/ReactCommon/react/test_utils/MockSurfaceHandler.h +2 -4
- package/ReactCommon/react/test_utils/ios/Memory/RCTMemoryUtils.h +19 -0
- package/ReactCommon/react/test_utils/ios/Memory/RCTMemoryUtils.m +45 -0
- package/ReactCommon/react/test_utils/ios/RCTSwizzleHelpers.h +19 -0
- package/ReactCommon/react/test_utils/ios/RCTSwizzleHelpers.m +17 -0
- package/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h +21 -0
- package/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm +72 -0
- package/ReactCommon/react/test_utils/shadowTreeGeneration.h +51 -50
- package/ReactCommon/react/utils/CMakeLists.txt +1 -1
- package/ReactCommon/react/utils/CalledOnceMovableOnlyFunction.h +9 -11
- package/ReactCommon/react/utils/ContextContainer.h +13 -16
- package/ReactCommon/react/utils/CoreFeatures.cpp +27 -0
- package/ReactCommon/react/utils/CoreFeatures.h +72 -0
- package/ReactCommon/react/utils/FloatComparison.h +2 -4
- package/ReactCommon/react/utils/ManagedObjectWrapper.h +4 -6
- package/ReactCommon/react/utils/ManagedObjectWrapper.mm +2 -4
- package/ReactCommon/react/utils/React-utils.podspec +8 -11
- package/ReactCommon/react/utils/RunLoopObserver.cpp +4 -6
- package/ReactCommon/react/utils/RunLoopObserver.h +12 -14
- package/ReactCommon/react/utils/SharedFunction.h +10 -10
- package/ReactCommon/react/utils/SimpleThreadSafeCache.h +5 -7
- package/ReactCommon/react/utils/Telemetry.h +3 -5
- package/ReactCommon/react/utils/hash_combine.h +31 -0
- package/ReactCommon/react/utils/tests/hash_combineTests.cpp +82 -0
- package/ReactCommon/reactperflogger/CMakeLists.txt +1 -1
- package/ReactCommon/reactperflogger/React-perflogger.podspec +4 -3
- package/ReactCommon/reactperflogger/reactperflogger/BridgeNativeModulePerfLogger.cpp +92 -94
- package/ReactCommon/reactperflogger/reactperflogger/BridgeNativeModulePerfLogger.h +52 -54
- package/ReactCommon/reactperflogger/reactperflogger/NativeModulePerfLogger.h +59 -61
- package/ReactCommon/runtimeexecutor/CMakeLists.txt +1 -1
- package/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +3 -3
- package/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h +15 -17
- package/ReactCommon/yoga/CMakeLists.txt +5 -13
- package/ReactCommon/yoga/Yoga.podspec +12 -5
- package/ReactCommon/yoga/cmake/project-defaults.cmake +52 -0
- package/ReactCommon/yoga/cmake/yoga-config.cmake.in +10 -0
- package/ReactCommon/yoga/yoga/CMakeLists.txt +1 -1
- package/ReactCommon/yoga/yoga/YGEnums.cpp +16 -4
- package/ReactCommon/yoga/yoga/YGEnums.h +12 -7
- package/ReactCommon/yoga/yoga/YGMacros.h +73 -42
- package/ReactCommon/yoga/yoga/YGValue.cpp +1 -1
- package/ReactCommon/yoga/yoga/YGValue.h +12 -48
- package/ReactCommon/yoga/yoga/Yoga-internal.h +4 -140
- package/ReactCommon/yoga/yoga/Yoga.cpp +499 -3897
- package/ReactCommon/yoga/yoga/Yoga.h +177 -226
- package/ReactCommon/yoga/yoga/algorithm/Align.h +29 -0
- package/ReactCommon/yoga/yoga/algorithm/Baseline.cpp +82 -0
- package/ReactCommon/yoga/yoga/algorithm/Baseline.h +21 -0
- package/ReactCommon/yoga/yoga/algorithm/BoundAxis.h +73 -0
- package/ReactCommon/yoga/yoga/algorithm/Cache.cpp +121 -0
- package/ReactCommon/yoga/yoga/algorithm/Cache.h +30 -0
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +2753 -0
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.h +21 -0
- package/ReactCommon/yoga/yoga/algorithm/FlexDirection.h +94 -0
- package/ReactCommon/yoga/yoga/algorithm/FlexLine.cpp +107 -0
- package/ReactCommon/yoga/yoga/algorithm/FlexLine.h +74 -0
- package/ReactCommon/yoga/yoga/algorithm/PixelGrid.cpp +132 -0
- package/ReactCommon/yoga/yoga/algorithm/PixelGrid.h +29 -0
- package/ReactCommon/yoga/yoga/algorithm/ResolveValue.h +32 -0
- package/ReactCommon/yoga/yoga/bits/BitCast.h +30 -0
- package/ReactCommon/yoga/yoga/bits/NumericBitfield.h +67 -0
- package/ReactCommon/yoga/yoga/config/Config.cpp +128 -0
- package/ReactCommon/yoga/yoga/config/Config.h +93 -0
- package/ReactCommon/yoga/yoga/debug/AssertFatal.cpp +50 -0
- package/ReactCommon/yoga/yoga/debug/AssertFatal.h +28 -0
- package/ReactCommon/yoga/yoga/debug/Log.cpp +107 -0
- package/ReactCommon/yoga/yoga/debug/Log.h +34 -0
- package/ReactCommon/yoga/yoga/debug/NodeToString.cpp +244 -0
- package/ReactCommon/yoga/yoga/debug/NodeToString.h +29 -0
- package/ReactCommon/yoga/yoga/enums/Align.h +51 -0
- package/ReactCommon/yoga/yoga/enums/Dimension.h +45 -0
- package/ReactCommon/yoga/yoga/enums/Direction.h +46 -0
- package/ReactCommon/yoga/yoga/enums/Display.h +45 -0
- package/ReactCommon/yoga/yoga/enums/Edge.h +52 -0
- package/ReactCommon/yoga/yoga/enums/Errata.h +49 -0
- package/ReactCommon/yoga/yoga/enums/ExperimentalFeature.h +45 -0
- package/ReactCommon/yoga/yoga/enums/FlexDirection.h +47 -0
- package/ReactCommon/yoga/yoga/enums/Gutter.h +46 -0
- package/ReactCommon/yoga/yoga/enums/Justify.h +49 -0
- package/ReactCommon/yoga/yoga/enums/LogLevel.h +49 -0
- package/ReactCommon/yoga/yoga/enums/MeasureMode.h +46 -0
- package/ReactCommon/yoga/yoga/enums/NodeType.h +45 -0
- package/ReactCommon/yoga/yoga/enums/Overflow.h +46 -0
- package/ReactCommon/yoga/yoga/enums/PositionType.h +46 -0
- package/ReactCommon/yoga/yoga/enums/PrintOptions.h +48 -0
- package/ReactCommon/yoga/yoga/enums/Unit.h +47 -0
- package/ReactCommon/yoga/yoga/enums/Wrap.h +46 -0
- package/ReactCommon/yoga/yoga/enums/YogaEnums.h +18 -0
- package/ReactCommon/yoga/yoga/event/event.cpp +6 -5
- package/ReactCommon/yoga/yoga/event/event.h +16 -33
- package/ReactCommon/yoga/yoga/node/CachedMeasurement.h +53 -0
- package/ReactCommon/yoga/yoga/node/LayoutResults.cpp +47 -0
- package/ReactCommon/yoga/yoga/node/LayoutResults.h +88 -0
- package/ReactCommon/yoga/yoga/node/Node.cpp +606 -0
- package/ReactCommon/yoga/yoga/node/Node.h +344 -0
- package/ReactCommon/yoga/yoga/numeric/Comparison.h +91 -0
- package/ReactCommon/yoga/yoga/numeric/FloatOptional.h +77 -0
- package/ReactCommon/yoga/yoga/style/CompactValue.h +184 -0
- package/ReactCommon/yoga/yoga/style/Style.h +333 -0
- package/build.gradle.kts +4 -4
- package/cli.js +60 -2
- package/flow/global.js +1 -3
- package/flow/jest.js +5 -1
- package/gradle/libs.versions.toml +80 -0
- package/jest/ReactNativeInternalFeatureFlagsMock.js +13 -0
- package/jest/__tests__/setup-test.js +18 -0
- package/jest/mockModal.js +6 -4
- package/jest/setup.js +61 -30
- package/package.json +44 -26
- package/react-native.config.js +12 -13
- package/scripts/cocoapods/codegen.rb +17 -19
- package/scripts/cocoapods/codegen_utils.rb +26 -21
- package/scripts/cocoapods/fabric.rb +2 -1
- package/scripts/cocoapods/flipper.rb +1 -9
- package/scripts/cocoapods/helpers.rb +1 -1
- package/scripts/cocoapods/jsengine.rb +1 -8
- package/scripts/cocoapods/new_architecture.rb +74 -12
- package/scripts/cocoapods/runtime.rb +18 -0
- package/scripts/cocoapods/utils.rb +182 -66
- package/scripts/codegen/generate-artifacts-executor.js +34 -24
- package/scripts/codegen/generate-legacy-interop-components.js +8 -2
- package/scripts/find-node-for-xcode.sh +4 -4
- package/scripts/packager.sh +0 -5
- package/scripts/react-native-xcode.sh +4 -17
- package/scripts/react_native_pods.rb +88 -56
- package/scripts/react_native_pods_utils/script_phases.sh +1 -1
- package/sdks/.hermesversion +1 -1
- package/sdks/hermes-engine/hermes-engine.podspec +74 -43
- package/sdks/hermes-engine/hermes-utils.rb +196 -81
- package/sdks/hermes-engine/utils/build-apple-framework.sh +73 -7
- package/sdks/hermes-engine/utils/build-hermes-xcode.sh +4 -10
- package/sdks/hermes-engine/utils/build-hermesc-xcode.sh +3 -2
- package/sdks/hermes-engine/utils/build-ios-framework.sh +68 -12
- package/sdks/hermes-engine/utils/replace_hermes_version.js +106 -0
- package/sdks/hermesc/linux64-bin/hermesc +0 -0
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermes-lit +15 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/settings.gradle.kts +8 -1
- package/template/App.tsx +2 -2
- package/template/__tests__/App.test.tsx +1 -1
- package/template/android/app/build.gradle +7 -12
- package/template/android/app/src/debug/AndroidManifest.xml +1 -5
- package/template/android/app/src/main/java/com/helloworld/MainActivity.kt +22 -0
- package/template/android/app/src/main/java/com/helloworld/MainApplication.kt +43 -0
- package/template/android/build.gradle +8 -8
- package/template/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template/android/gradle/wrapper/gradle-wrapper.properties +2 -1
- package/template/android/gradle.properties +0 -3
- package/template/android/gradlew +12 -7
- package/template/babel.config.js +1 -1
- package/template/ios/HelloWorld/AppDelegate.mm +5 -0
- package/template/ios/HelloWorld/Info.plist +5 -8
- package/template/ios/Podfile +13 -14
- package/template/package.json +11 -11
- package/template/tsconfig.json +1 -1
- package/third-party-podspecs/DoubleConversion.podspec +1 -1
- package/third-party-podspecs/RCT-Folly.podspec +17 -20
- package/third-party-podspecs/boost.podspec +4 -4
- package/third-party-podspecs/fmt.podspec +2 -2
- package/third-party-podspecs/glog.podspec +19 -3
- package/types/experimental.d.ts +44 -0
- package/types/index.d.ts +2 -1
- package/types/modules/Devtools.d.ts +1 -0
- package/types/modules/globals.d.ts +16 -1
- package/types/public/ReactNativeTVTypes.d.ts +25 -25
- package/Libraries/Alert/Alert.js.flow +0 -49
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.ios.js +0 -12
- package/Libraries/Components/TextInput/InputAccessoryView.js.flow +0 -25
- package/Libraries/Components/ToastAndroid/ToastAndroid.ios.js +0 -37
- package/Libraries/FBLazyVector/BUCK +0 -22
- package/Libraries/Image/ImageBackground.js.flow +0 -17
- package/Libraries/Image/ImageViewNativeComponent.js.flow +0 -42
- package/Libraries/Image/RCTAnimatedImage.m +0 -175
- package/Libraries/Image/RCTImageBlurUtils.m +0 -101
- package/Libraries/Image/RCTImageUtils.m +0 -387
- package/Libraries/Image/RCTUIImageViewAnimated.m +0 -347
- package/Libraries/Image/TextInlineImageNativeComponent.js.flow +0 -27
- package/Libraries/Lists/FlatList.js.flow +0 -116
- package/Libraries/NativeAnimation/Drivers/RCTDecayAnimation.m +0 -125
- package/Libraries/NativeAnimation/Drivers/RCTFrameAnimation.m +0 -151
- package/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m +0 -200
- package/Libraries/NativeAnimation/Nodes/RCTInterpolationAnimatedNode.m +0 -171
- package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +0 -142
- package/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.m +0 -58
- package/Libraries/NativeAnimation/RCTAnimationUtils.m +0 -129
- package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m +0 -482
- package/Libraries/RCTRequired/BUCK +0 -19
- package/Libraries/Renderer/REVISION +0 -1
- package/Libraries/Settings/Settings.android.js +0 -33
- package/Libraries/SurfaceBackedComponent/RCTSurfaceBackedComponent.h +0 -28
- package/Libraries/SurfaceBackedComponent/RCTSurfaceBackedComponent.mm +0 -76
- package/Libraries/SurfaceBackedComponent/RCTSurfaceBackedComponentState.h +0 -18
- package/Libraries/SurfaceBackedComponent/RCTSurfaceBackedComponentState.mm +0 -26
- package/Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponent+Internal.h +0 -19
- package/Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponent.h +0 -19
- package/Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponent.mm +0 -116
- package/Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponentController.h +0 -12
- package/Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponentController.mm +0 -161
- package/Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponentOptions.h +0 -20
- package/Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponentState.h +0 -19
- package/Libraries/SurfaceHostingComponent/RCTSurfaceHostingComponentState.mm +0 -36
- package/Libraries/Text/BaseText/RCTBaseTextShadowView.m +0 -158
- package/Libraries/Text/RCTConvert+Text.m +0 -37
- package/Libraries/Text/Text/RCTTextShadowView.m +0 -416
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +0 -308
- package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m +0 -316
- package/Libraries/Text/TextInput/RCTBaseTextInputView.m +0 -713
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +0 -177
- package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.m +0 -20
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +0 -224
- package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.m +0 -26
- package/Libraries/Utilities/AcessibilityMapping.js +0 -154
- package/Libraries/Utilities/NativeDevSplitBundleLoader.js +0 -19
- package/React/AccessibilityResources/en.lproj/Localizable.strings +0 -26
- package/React/Base/RCTBridge.m +0 -410
- package/React/Base/RCTJSScriptLoaderModule.h +0 -22
- package/React/Base/RCTPerformanceLogger.m +0 -99
- package/React/Base/RCTRuntimeExecutorFromBridge.h +0 -19
- package/React/Base/RCTRuntimeExecutorFromBridge.mm +0 -56
- package/React/CoreModules/BUCK +0 -139
- package/React/CoreModules/RCTAlertController.m +0 -79
- package/React/CoreModules/RCTDevSplitBundleLoader.h +0 -13
- package/React/CoreModules/RCTDevSplitBundleLoader.mm +0 -108
- package/React/CoreModules/RCTFPSGraph.m +0 -128
- package/React/Fabric/Surface/RCTFabricSurfaceHostingProxyRootView.h +0 -15
- package/React/Fabric/Surface/RCTFabricSurfaceHostingProxyRootView.mm +0 -21
- package/ReactAndroid/external-artifacts/build.gradle +0 -44
- package/ReactAndroid/libs/BUCK +0 -25
- package/ReactAndroid/src/main/java/com/facebook/BUCK +0 -14
- package/ReactAndroid/src/main/java/com/facebook/debug/debugoverlay/model/BUCK +0 -14
- package/ReactAndroid/src/main/java/com/facebook/debug/holder/BUCK +0 -20
- package/ReactAndroid/src/main/java/com/facebook/debug/tags/BUCK +0 -20
- package/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/BUCK +0 -28
- package/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/BUCK +0 -40
- package/ReactAndroid/src/main/java/com/facebook/hermes/unicode/BUCK +0 -14
- package/ReactAndroid/src/main/java/com/facebook/perftest/BUCK +0 -11
- package/ReactAndroid/src/main/java/com/facebook/proguard/annotations/BUCK +0 -28
- package/ReactAndroid/src/main/java/com/facebook/react/BUCK +0 -61
- package/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.java +0 -14
- package/ReactAndroid/src/main/java/com/facebook/react/animated/BUCK +0 -34
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/BUCK +0 -92
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ContextBaseJavaModule.java +0 -27
- package/ReactAndroid/src/main/java/com/facebook/react/common/ArrayUtils.java +0 -26
- package/ReactAndroid/src/main/java/com/facebook/react/common/BUCK +0 -48
- package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/VisibleForTesting.java +0 -14
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/BUCK +0 -32
- package/ReactAndroid/src/main/java/com/facebook/react/common/network/BUCK +0 -18
- package/ReactAndroid/src/main/java/com/facebook/react/config/BUCK +0 -17
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BUCK +0 -64
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/BUCK +0 -51
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/CppComponentRegistry.java +0 -28
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/ReactNativeConfig.java +0 -59
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/SurfaceHandler.java +0 -50
- package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/BUCK +0 -19
- package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/JSCExecutor.java +0 -37
- package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/JSCExecutorFactory.java +0 -48
- package/ReactAndroid/src/main/java/com/facebook/react/jstasks/BUCK +0 -22
- package/ReactAndroid/src/main/java/com/facebook/react/module/annotations/BUCK +0 -20
- package/ReactAndroid/src/main/java/com/facebook/react/module/model/BUCK +0 -17
- package/ReactAndroid/src/main/java/com/facebook/react/module/processing/BUCK +0 -31
- package/ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/BUCK +0 -25
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/BUCK +0 -24
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appregistry/BUCK +0 -17
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appstate/BUCK +0 -24
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BUCK +0 -36
- package/ReactAndroid/src/main/java/com/facebook/react/modules/bundleloader/BUCK +0 -22
- package/ReactAndroid/src/main/java/com/facebook/react/modules/bundleloader/NativeDevSplitBundleLoaderModule.java +0 -50
- package/ReactAndroid/src/main/java/com/facebook/react/modules/camera/BUCK +0 -26
- package/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/BUCK +0 -25
- package/ReactAndroid/src/main/java/com/facebook/react/modules/common/BUCK +0 -21
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/BUCK +0 -29
- package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/BUCK +0 -46
- package/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/BUCK +0 -27
- package/ReactAndroid/src/main/java/com/facebook/react/modules/devloading/BUCK +0 -25
- package/ReactAndroid/src/main/java/com/facebook/react/modules/devtoolssettings/BUCK +0 -25
- package/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/BUCK +0 -24
- package/ReactAndroid/src/main/java/com/facebook/react/modules/fabric/BUCK +0 -17
- package/ReactAndroid/src/main/java/com/facebook/react/modules/fabric/ReactFabric.java +0 -25
- package/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/BUCK +0 -41
- package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/BUCK +0 -26
- package/ReactAndroid/src/main/java/com/facebook/react/modules/image/BUCK +0 -32
- package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/BUCK +0 -23
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/BUCK +0 -32
- package/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/BUCK +0 -23
- package/ReactAndroid/src/main/java/com/facebook/react/modules/share/BUCK +0 -23
- package/ReactAndroid/src/main/java/com/facebook/react/modules/sound/BUCK +0 -24
- package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/BUCK +0 -28
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/BUCK +0 -53
- package/ReactAndroid/src/main/java/com/facebook/react/modules/toast/BUCK +0 -22
- package/ReactAndroid/src/main/java/com/facebook/react/modules/vibration/BUCK +0 -24
- package/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/BUCK +0 -30
- package/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/BUCK +0 -28
- package/ReactAndroid/src/main/java/com/facebook/react/processing/BUCK +0 -31
- package/ReactAndroid/src/main/java/com/facebook/react/reactperflogger/BUCK +0 -24
- package/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK +0 -69
- package/ReactAndroid/src/main/java/com/facebook/react/surface/BUCK +0 -27
- package/ReactAndroid/src/main/java/com/facebook/react/touch/BUCK +0 -19
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/BUCK +0 -60
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/BUCK +0 -21
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/CallInvokerHolder.java +0 -18
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/TurboModule.java +0 -17
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/TurboModuleRegistry.java +0 -37
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BUCK +0 -112
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/annotations/BUCK +0 -19
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/BUCK +0 -22
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/util/BUCK +0 -19
- package/ReactAndroid/src/main/java/com/facebook/react/util/BUCK +0 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/common/BUCK +0 -21
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/BUCK +0 -32
- package/ReactAndroid/src/main/java/com/facebook/react/views/image/BUCK +0 -67
- package/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/BUCK +0 -44
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/BUCK +0 -34
- package/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/BUCK +0 -27
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/BUCK +0 -34
- package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/BUCK +0 -31
- package/ReactAndroid/src/main/java/com/facebook/react/views/switchview/BUCK +0 -28
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/BUCK +0 -39
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TypefaceStyle.java +0 -72
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/BUCK +0 -33
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/BUCK +0 -41
- package/ReactAndroid/src/main/java/com/facebook/react/views/traceupdateoverlay/BUCK +0 -29
- package/ReactAndroid/src/main/java/com/facebook/react/views/unimplementedview/BUCK +0 -28
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/BUCK +0 -39
- package/ReactAndroid/src/main/java/com/facebook/systrace/BUCK +0 -14
- package/ReactAndroid/src/main/jni/CircularDepsValidator.cmake +0 -32
- package/ReactAndroid/src/main/jni/first-party/fb/BUCK +0 -35
- package/ReactAndroid/src/main/jni/first-party/fbgloginit/BUCK +0 -21
- package/ReactAndroid/src/main/jni/first-party/jni-hack/BUCK +0 -17
- package/ReactAndroid/src/main/jni/first-party/yogajni/BUCK +0 -22
- package/ReactAndroid/src/main/jni/prebuilt/BUCK +0 -21
- package/ReactAndroid/src/main/jni/react/fabric/BUCK +0 -54
- package/ReactAndroid/src/main/jni/react/fabric/FabricMountItem.cpp +0 -66
- package/ReactAndroid/src/main/jni/react/fabric/FabricMountItem.h +0 -88
- package/ReactAndroid/src/main/jni/react/hermes/instrumentation/BUCK +0 -27
- package/ReactAndroid/src/main/jni/react/hermes/reactexecutor/BUCK +0 -19
- package/ReactAndroid/src/main/jni/react/jni/BUCK +0 -76
- package/ReactAndroid/src/main/jni/react/jscexecutor/BUCK +0 -22
- package/ReactAndroid/src/main/jni/react/mapbuffer/BUCK +0 -30
- package/ReactAndroid/src/main/jni/react/perftests/BUCK +0 -16
- package/ReactAndroid/src/main/jni/react/reactnativeblob/BUCK +0 -19
- package/ReactAndroid/src/main/jni/react/reactperflogger/BUCK +0 -31
- package/ReactAndroid/src/main/jni/react/turbomodule/BUCK +0 -69
- package/ReactAndroid/src/main/jni/react/uimanager/BUCK +0 -36
- package/ReactAndroid/src/main/jni/third-party/glibc/BUCK +0 -69
- package/ReactAndroid/src/main/libraries/fbcore/src/main/java/com/facebook/common/logging/BUCK +0 -11
- package/ReactAndroid/src/main/libraries/fbjni/BUCK +0 -20
- package/ReactAndroid/src/main/libraries/fresco/fresco-react-native/BUCK +0 -189
- package/ReactAndroid/src/main/libraries/soloader/java/com/facebook/soloader/BUCK +0 -44
- package/ReactAndroid/src/main/res/BUCK +0 -51
- package/ReactAndroid/src/main/res/views/uimanager/values/strings_unlocalized.xml +0 -103
- package/ReactCommon/butter/BUCK +0 -47
- package/ReactCommon/butter/function.h +0 -51
- package/ReactCommon/butter/set.h +0 -38
- package/ReactCommon/butter/small_vector.h +0 -39
- package/ReactCommon/callinvoker/BUCK +0 -25
- package/ReactCommon/cxxreact/BUCK +0 -163
- package/ReactCommon/cxxreact/tests/BUCK +0 -28
- package/ReactCommon/hermes/inspector/AsyncPauseState.h +0 -34
- package/ReactCommon/hermes/inspector/BUCK +0 -234
- package/ReactCommon/hermes/inspector/CMakeLists.txt +0 -40
- package/ReactCommon/hermes/inspector/DEFS.bzl +0 -7
- package/ReactCommon/hermes/inspector/Exceptions.h +0 -60
- package/ReactCommon/hermes/inspector/Inspector.cpp +0 -744
- package/ReactCommon/hermes/inspector/Inspector.h +0 -384
- package/ReactCommon/hermes/inspector/InspectorState.cpp +0 -511
- package/ReactCommon/hermes/inspector/InspectorState.h +0 -412
- package/ReactCommon/hermes/inspector/README.md +0 -113
- package/ReactCommon/hermes/inspector/RuntimeAdapter.cpp +0 -30
- package/ReactCommon/hermes/inspector/RuntimeAdapter.h +0 -76
- package/ReactCommon/hermes/inspector/chrome/Connection.cpp +0 -1626
- package/ReactCommon/hermes/inspector/chrome/Connection.h +0 -67
- package/ReactCommon/hermes/inspector/chrome/ConnectionDemux.cpp +0 -131
- package/ReactCommon/hermes/inspector/chrome/ConnectionDemux.h +0 -59
- package/ReactCommon/hermes/inspector/chrome/MessageConverters.cpp +0 -258
- package/ReactCommon/hermes/inspector/chrome/MessageConverters.h +0 -135
- package/ReactCommon/hermes/inspector/chrome/MessageInterfaces.h +0 -74
- package/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp +0 -1856
- package/ReactCommon/hermes/inspector/chrome/MessageTypes.h +0 -974
- package/ReactCommon/hermes/inspector/chrome/MessageTypesInlines.h +0 -160
- package/ReactCommon/hermes/inspector/chrome/Registration.cpp +0 -38
- package/ReactCommon/hermes/inspector/chrome/Registration.h +0 -43
- package/ReactCommon/hermes/inspector/chrome/RemoteObjectsTable.cpp +0 -146
- package/ReactCommon/hermes/inspector/chrome/RemoteObjectsTable.h +0 -124
- package/ReactCommon/hermes/inspector/chrome/cli/main.cpp +0 -274
- package/ReactCommon/hermes/inspector/chrome/tests/AsyncHermesRuntime.cpp +0 -166
- package/ReactCommon/hermes/inspector/chrome/tests/AsyncHermesRuntime.h +0 -148
- package/ReactCommon/hermes/inspector/chrome/tests/ConnectionDemuxTests.cpp +0 -147
- package/ReactCommon/hermes/inspector/chrome/tests/ConnectionTests.cpp +0 -2939
- package/ReactCommon/hermes/inspector/chrome/tests/MessageTests.cpp +0 -1535
- package/ReactCommon/hermes/inspector/chrome/tests/RemoteObjectsTableTest.cpp +0 -111
- package/ReactCommon/hermes/inspector/chrome/tests/SyncConnection.cpp +0 -133
- package/ReactCommon/hermes/inspector/chrome/tests/SyncConnection.h +0 -69
- package/ReactCommon/hermes/inspector/detail/CallbackOStream.cpp +0 -77
- package/ReactCommon/hermes/inspector/detail/CallbackOStream.h +0 -89
- package/ReactCommon/hermes/inspector/detail/SerialExecutor.cpp +0 -60
- package/ReactCommon/hermes/inspector/detail/SerialExecutor.h +0 -57
- package/ReactCommon/hermes/inspector/detail/Thread.cpp +0 -39
- package/ReactCommon/hermes/inspector/detail/Thread.h +0 -85
- package/ReactCommon/hermes/inspector/detail/tests/CallbackOStreamTests.cpp +0 -104
- package/ReactCommon/hermes/inspector/detail/tests/SerialExecutorTests.cpp +0 -41
- package/ReactCommon/hermes/inspector/tests/InspectorTests.cpp +0 -410
- package/ReactCommon/hermes/inspector/tools/run_msggen +0 -32
- package/ReactCommon/hermes/inspector/tools/sandcastle/build_and_test.sh +0 -13
- package/ReactCommon/jsc/BUCK +0 -34
- package/ReactCommon/jserrorhandler/BUCK +0 -30
- package/ReactCommon/jsi/BUCK +0 -58
- package/ReactCommon/jsiexecutor/BUCK +0 -45
- package/ReactCommon/jsinspector/BUCK +0 -40
- package/ReactCommon/jsinspector/CMakeLists.txt +0 -16
- package/ReactCommon/jsinspector/InspectorInterfaces.cpp +0 -108
- package/ReactCommon/jsinspector/InspectorInterfaces.h +0 -94
- package/ReactCommon/jsinspector/React-jsinspector.podspec +0 -31
- package/ReactCommon/libraries/fbcore/src/test/java/com/facebook/powermock/BUCK +0 -179
- package/ReactCommon/logger/BUCK +0 -41
- package/ReactCommon/react/bridging/BUCK +0 -56
- package/ReactCommon/react/config/BUCK +0 -43
- package/ReactCommon/react/debug/BUCK +0 -65
- package/ReactCommon/react/nativemodule/core/BUCK +0 -87
- package/ReactCommon/react/nativemodule/samples/BUCK +0 -103
- package/ReactCommon/react/renderer/animations/BUCK +0 -94
- package/ReactCommon/react/renderer/attributedstring/BUCK +0 -83
- package/ReactCommon/react/renderer/componentregistry/BUCK +0 -53
- package/ReactCommon/react/renderer/componentregistry/native/BUCK +0 -49
- package/ReactCommon/react/renderer/components/image/BUCK +0 -76
- package/ReactCommon/react/renderer/components/inputaccessory/BUCK +0 -45
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/BUCK +0 -50
- package/ReactCommon/react/renderer/components/modal/BUCK +0 -87
- package/ReactCommon/react/renderer/components/progressbar/BUCK +0 -116
- package/ReactCommon/react/renderer/components/root/BUCK +0 -74
- package/ReactCommon/react/renderer/components/safeareaview/BUCK +0 -45
- package/ReactCommon/react/renderer/components/scrollview/BUCK +0 -81
- package/ReactCommon/react/renderer/components/switch/BUCK +0 -87
- package/ReactCommon/react/renderer/components/text/BUCK +0 -99
- package/ReactCommon/react/renderer/components/textinput/BUCK +0 -97
- package/ReactCommon/react/renderer/components/textinput/iostextinput/BUCK +0 -95
- package/ReactCommon/react/renderer/components/unimplementedview/BUCK +0 -69
- package/ReactCommon/react/renderer/components/view/AccessibilityPropsMapBuffer.cpp +0 -166
- package/ReactCommon/react/renderer/components/view/AccessibilityPropsMapBuffer.h +0 -35
- package/ReactCommon/react/renderer/components/view/BUCK +0 -87
- package/ReactCommon/react/renderer/components/view/Touch.cpp +0 -34
- package/ReactCommon/react/renderer/components/view/ViewEventEmitter.cpp +0 -117
- package/ReactCommon/react/renderer/components/view/ViewProps.cpp +0 -564
- package/ReactCommon/react/renderer/components/view/ViewPropsMapBuffer.cpp +0 -202
- package/ReactCommon/react/renderer/components/view/ViewPropsMapBuffer.h +0 -56
- package/ReactCommon/react/renderer/components/view/YogaStylablePropsMapBuffer.cpp +0 -87
- package/ReactCommon/react/renderer/components/view/YogaStylablePropsMapBuffer.h +0 -24
- package/ReactCommon/react/renderer/core/BUCK +0 -115
- package/ReactCommon/react/renderer/core/CoreFeatures.cpp +0 -22
- package/ReactCommon/react/renderer/core/CoreFeatures.h +0 -54
- package/ReactCommon/react/renderer/core/PropsMapBuffer.cpp +0 -36
- package/ReactCommon/react/renderer/core/PropsMapBuffer.h +0 -24
- package/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.cpp +0 -34
- package/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.h +0 -55
- package/ReactCommon/react/renderer/debug/BUCK +0 -75
- package/ReactCommon/react/renderer/element/BUCK +0 -86
- package/ReactCommon/react/renderer/graphics/BUCK +0 -128
- package/ReactCommon/react/renderer/imagemanager/BUCK +0 -113
- package/ReactCommon/react/renderer/leakchecker/BUCK +0 -51
- package/ReactCommon/react/renderer/mapbuffer/BUCK +0 -73
- package/ReactCommon/react/renderer/mounting/BUCK +0 -87
- package/ReactCommon/react/renderer/runtimescheduler/BUCK +0 -76
- package/ReactCommon/react/renderer/scheduler/BUCK +0 -63
- package/ReactCommon/react/renderer/scheduler/SchedulerToolbox.cpp +0 -8
- package/ReactCommon/react/renderer/telemetry/BUCK +0 -77
- package/ReactCommon/react/renderer/templateprocessor/BUCK +0 -89
- package/ReactCommon/react/renderer/textlayoutmanager/BUCK +0 -155
- package/ReactCommon/react/renderer/timeline/BUCK +0 -75
- package/ReactCommon/react/renderer/uimanager/BUCK +0 -92
- package/ReactCommon/react/test_utils/BUCK +0 -54
- package/ReactCommon/react/utils/BUCK +0 -67
- package/ReactCommon/reactperflogger/BUCK +0 -27
- package/ReactCommon/runtimeexecutor/BUCK +0 -50
- package/ReactCommon/yoga/BUCK +0 -16
- package/ReactCommon/yoga/yoga/BitUtils.h +0 -71
- package/ReactCommon/yoga/yoga/CompactValue.h +0 -216
- package/ReactCommon/yoga/yoga/Utils.cpp +0 -83
- package/ReactCommon/yoga/yoga/Utils.h +0 -150
- package/ReactCommon/yoga/yoga/YGConfig.cpp +0 -44
- package/ReactCommon/yoga/yoga/YGConfig.h +0 -81
- package/ReactCommon/yoga/yoga/YGFloatOptional.h +0 -74
- package/ReactCommon/yoga/yoga/YGLayout.cpp +0 -42
- package/ReactCommon/yoga/yoga/YGLayout.h +0 -67
- package/ReactCommon/yoga/yoga/YGNode.cpp +0 -579
- package/ReactCommon/yoga/yoga/YGNode.h +0 -355
- package/ReactCommon/yoga/yoga/YGNodePrint.cpp +0 -244
- package/ReactCommon/yoga/yoga/YGNodePrint.h +0 -32
- package/ReactCommon/yoga/yoga/YGStyle.cpp +0 -56
- package/ReactCommon/yoga/yoga/YGStyle.h +0 -241
- package/ReactCommon/yoga/yoga/log.cpp +0 -64
- package/ReactCommon/yoga/yoga/log.h +0 -42
- package/flow/use-sync-external-store.js +0 -20
- package/flow-typed/npm/base64-js_v1.x.x.js +0 -12
- package/flow-typed/npm/glob_v7.x.x.js +0 -79
- package/flow-typed/npm/pretty-format_v26.x.x.js +0 -49
- package/flow-typed/npm/promise_v8.x.x.js +0 -30
- package/flow-typed/npm/react-dom_v17.x.x.js +0 -139
- package/flow-typed/npm/react-test-renderer_v16.x.x.js +0 -79
- package/flow-typed/npm/stacktrace-parser_v0.1.x.js +0 -17
- package/flow-typed/npm/yargs_v17.x.x.js +0 -341
- package/scripts/launchPackager.bat +0 -12
- package/scripts/launchPackager.command +0 -34
- package/template/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java +0 -75
- package/template/android/app/src/main/java/com/helloworld/MainActivity.java +0 -32
- package/template/android/app/src/main/java/com/helloworld/MainApplication.java +0 -64
- package/template/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java +0 -20
- package/third-party-podspecs/hermes-engine.podspec +0 -45
- /package/Libraries/Components/DrawerAndroid/{DrawerLayoutAndroid.ios.js → DrawerLayoutAndroid.js} +0 -0
- /package/Libraries/Image/{RCTDisplayWeakRefreshable.m → RCTDisplayWeakRefreshable.mm} +0 -0
- /package/Libraries/Image/{RCTImageCache.m → RCTImageCache.mm} +0 -0
- /package/Libraries/Image/{RCTImageShadowView.m → RCTImageShadowView.mm} +0 -0
- /package/Libraries/Image/{RCTResizeMode.m → RCTResizeMode.mm} +0 -0
- /package/Libraries/NativeAnimation/Drivers/{RCTEventAnimation.m → RCTEventAnimation.mm} +0 -0
- /package/Libraries/NativeAnimation/Nodes/{RCTAdditionAnimatedNode.m → RCTAdditionAnimatedNode.mm} +0 -0
- /package/Libraries/NativeAnimation/Nodes/{RCTAnimatedNode.m → RCTAnimatedNode.mm} +0 -0
- /package/Libraries/NativeAnimation/Nodes/{RCTColorAnimatedNode.m → RCTColorAnimatedNode.mm} +0 -0
- /package/Libraries/NativeAnimation/Nodes/{RCTDiffClampAnimatedNode.m → RCTDiffClampAnimatedNode.mm} +0 -0
- /package/Libraries/NativeAnimation/Nodes/{RCTDivisionAnimatedNode.m → RCTDivisionAnimatedNode.mm} +0 -0
- /package/Libraries/NativeAnimation/Nodes/{RCTModuloAnimatedNode.m → RCTModuloAnimatedNode.mm} +0 -0
- /package/Libraries/NativeAnimation/Nodes/{RCTMultiplicationAnimatedNode.m → RCTMultiplicationAnimatedNode.mm} +0 -0
- /package/Libraries/NativeAnimation/Nodes/{RCTSubtractionAnimatedNode.m → RCTSubtractionAnimatedNode.mm} +0 -0
- /package/Libraries/NativeAnimation/Nodes/{RCTTrackingAnimatedNode.m → RCTTrackingAnimatedNode.mm} +0 -0
- /package/Libraries/NativeAnimation/Nodes/{RCTTransformAnimatedNode.m → RCTTransformAnimatedNode.mm} +0 -0
- /package/Libraries/NativeAnimation/Nodes/{RCTValueAnimatedNode.m → RCTValueAnimatedNode.mm} +0 -0
- /package/Libraries/{Renderer/public → ReactNative/ReactFabricPublicInstance}/ReactFabricPublicInstanceUtils.js +0 -0
- /package/Libraries/Text/BaseText/{RCTBaseTextViewManager.m → RCTBaseTextViewManager.mm} +0 -0
- /package/Libraries/Text/{RCTTextAttributes.m → RCTTextAttributes.mm} +0 -0
- /package/Libraries/Text/RawText/{RCTRawTextShadowView.m → RCTRawTextShadowView.mm} +0 -0
- /package/Libraries/Text/RawText/{RCTRawTextViewManager.m → RCTRawTextViewManager.mm} +0 -0
- /package/Libraries/Text/Text/{RCTDynamicTypeRamp.m → RCTDynamicTypeRamp.mm} +0 -0
- /package/Libraries/Text/Text/{RCTTextView.m → RCTTextView.mm} +0 -0
- /package/Libraries/Text/Text/{RCTTextViewManager.m → RCTTextViewManager.mm} +0 -0
- /package/Libraries/Text/TextInput/Multiline/{RCTMultilineTextInputView.m → RCTMultilineTextInputView.mm} +0 -0
- /package/Libraries/Text/TextInput/Multiline/{RCTMultilineTextInputViewManager.m → RCTMultilineTextInputViewManager.mm} +0 -0
- /package/Libraries/Text/TextInput/{RCTBackedTextInputDelegateAdapter.m → RCTBackedTextInputDelegateAdapter.mm} +0 -0
- /package/Libraries/Text/TextInput/{RCTInputAccessoryView.m → RCTInputAccessoryView.mm} +0 -0
- /package/Libraries/Text/TextInput/{RCTInputAccessoryViewContent.m → RCTInputAccessoryViewContent.mm} +0 -0
- /package/Libraries/Text/TextInput/{RCTInputAccessoryViewManager.m → RCTInputAccessoryViewManager.mm} +0 -0
- /package/Libraries/Text/TextInput/{RCTTextSelection.m → RCTTextSelection.mm} +0 -0
- /package/Libraries/Text/TextInput/Singleline/{RCTSinglelineTextInputView.m → RCTSinglelineTextInputView.mm} +0 -0
- /package/Libraries/Text/TextInput/Singleline/{RCTSinglelineTextInputViewManager.m → RCTSinglelineTextInputViewManager.mm} +0 -0
- /package/Libraries/Text/VirtualText/{RCTVirtualTextShadowView.m → RCTVirtualTextShadowView.mm} +0 -0
- /package/ReactCommon/hermes/{inspector → inspector-modern}/.clang-format +0 -0
- /package/ReactCommon/hermes/{inspector → inspector-modern}/docs/GenerateInspectorFSM.sh +0 -0
- /package/ReactCommon/hermes/{inspector → inspector-modern}/docs/InspectorFSM.gv +0 -0
- /package/ReactCommon/hermes/{inspector → inspector-modern}/docs/InspectorFSM.pdf +0 -0
- /package/ReactCommon/hermes/{inspector → inspector-modern}/tools/format +0 -0
- /package/ReactCommon/hermes/{inspector → inspector-modern}/tools/message_types.txt +0 -0
- /package/ReactCommon/hermes/{inspector → inspector-modern}/tools/sandcastle/setup.sh +0 -0
- /package/ReactCommon/{jsinspector → jsinspector-modern}/.clang-tidy +0 -0
|
@@ -5,210 +5,118 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#include
|
|
9
|
-
#include
|
|
10
|
-
|
|
11
|
-
#include <
|
|
12
|
-
#include <algorithm>
|
|
13
|
-
#include <
|
|
14
|
-
#include <
|
|
15
|
-
#include
|
|
16
|
-
#include
|
|
17
|
-
#include
|
|
18
|
-
#include
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
#include <float.h>
|
|
22
|
-
|
|
23
|
-
/* define fmaxf if < VC12 */
|
|
24
|
-
#if _MSC_VER < 1800
|
|
25
|
-
__forceinline const float fmaxf(const float a, const float b) {
|
|
26
|
-
return (a > b) ? a : b;
|
|
27
|
-
}
|
|
28
|
-
#endif
|
|
29
|
-
#endif
|
|
30
|
-
|
|
8
|
+
#include <yoga/Yoga-internal.h>
|
|
9
|
+
#include <yoga/Yoga.h>
|
|
10
|
+
|
|
11
|
+
#include <yoga/algorithm/Cache.h>
|
|
12
|
+
#include <yoga/algorithm/CalculateLayout.h>
|
|
13
|
+
#include <yoga/algorithm/PixelGrid.h>
|
|
14
|
+
#include <yoga/debug/AssertFatal.h>
|
|
15
|
+
#include <yoga/debug/Log.h>
|
|
16
|
+
#include <yoga/debug/NodeToString.h>
|
|
17
|
+
#include <yoga/event/event.h>
|
|
18
|
+
#include <yoga/node/Node.h>
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
31
21
|
using namespace facebook::yoga;
|
|
32
|
-
using detail::Log;
|
|
33
|
-
|
|
34
|
-
#ifdef ANDROID
|
|
35
|
-
static int YGAndroidLog(
|
|
36
|
-
const YGConfigRef config,
|
|
37
|
-
const YGNodeRef node,
|
|
38
|
-
YGLogLevel level,
|
|
39
|
-
const char* format,
|
|
40
|
-
va_list args);
|
|
41
|
-
#else
|
|
42
|
-
static int YGDefaultLog(
|
|
43
|
-
const YGConfigRef config,
|
|
44
|
-
const YGNodeRef node,
|
|
45
|
-
YGLogLevel level,
|
|
46
|
-
const char* format,
|
|
47
|
-
va_list args);
|
|
48
|
-
#endif
|
|
49
22
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
static int YGAndroidLog(
|
|
53
|
-
const YGConfigRef config,
|
|
54
|
-
const YGNodeRef node,
|
|
55
|
-
YGLogLevel level,
|
|
56
|
-
const char* format,
|
|
57
|
-
va_list args) {
|
|
58
|
-
int androidLevel = YGLogLevelDebug;
|
|
59
|
-
switch (level) {
|
|
60
|
-
case YGLogLevelFatal:
|
|
61
|
-
androidLevel = ANDROID_LOG_FATAL;
|
|
62
|
-
break;
|
|
63
|
-
case YGLogLevelError:
|
|
64
|
-
androidLevel = ANDROID_LOG_ERROR;
|
|
65
|
-
break;
|
|
66
|
-
case YGLogLevelWarn:
|
|
67
|
-
androidLevel = ANDROID_LOG_WARN;
|
|
68
|
-
break;
|
|
69
|
-
case YGLogLevelInfo:
|
|
70
|
-
androidLevel = ANDROID_LOG_INFO;
|
|
71
|
-
break;
|
|
72
|
-
case YGLogLevelDebug:
|
|
73
|
-
androidLevel = ANDROID_LOG_DEBUG;
|
|
74
|
-
break;
|
|
75
|
-
case YGLogLevelVerbose:
|
|
76
|
-
androidLevel = ANDROID_LOG_VERBOSE;
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
const int result = __android_log_vprint(androidLevel, "yoga", format, args);
|
|
80
|
-
return result;
|
|
23
|
+
bool YGFloatIsUndefined(const float value) {
|
|
24
|
+
return yoga::isUndefined(value);
|
|
81
25
|
}
|
|
82
|
-
#else
|
|
83
|
-
#define YG_UNUSED(x) (void) (x);
|
|
84
26
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const YGNodeRef node,
|
|
88
|
-
YGLogLevel level,
|
|
89
|
-
const char* format,
|
|
90
|
-
va_list args) {
|
|
91
|
-
YG_UNUSED(config);
|
|
92
|
-
YG_UNUSED(node);
|
|
93
|
-
switch (level) {
|
|
94
|
-
case YGLogLevelError:
|
|
95
|
-
case YGLogLevelFatal:
|
|
96
|
-
return vfprintf(stderr, format, args);
|
|
97
|
-
case YGLogLevelWarn:
|
|
98
|
-
case YGLogLevelInfo:
|
|
99
|
-
case YGLogLevelDebug:
|
|
100
|
-
case YGLogLevelVerbose:
|
|
101
|
-
default:
|
|
102
|
-
return vprintf(format, args);
|
|
103
|
-
}
|
|
27
|
+
void* YGNodeGetContext(YGNodeConstRef node) {
|
|
28
|
+
return resolveRef(node)->getContext();
|
|
104
29
|
}
|
|
105
30
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
static inline bool YGDoubleIsUndefined(const double value) {
|
|
110
|
-
return facebook::yoga::isUndefined(value);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
YOGA_EXPORT bool YGFloatIsUndefined(const float value) {
|
|
114
|
-
return facebook::yoga::isUndefined(value);
|
|
31
|
+
void YGNodeSetContext(YGNodeRef node, void* context) {
|
|
32
|
+
return resolveRef(node)->setContext(context);
|
|
115
33
|
}
|
|
116
34
|
|
|
117
|
-
|
|
118
|
-
return node->
|
|
35
|
+
YGConfigConstRef YGNodeGetConfig(YGNodeRef node) {
|
|
36
|
+
return resolveRef(node)->getConfig();
|
|
119
37
|
}
|
|
120
38
|
|
|
121
|
-
|
|
122
|
-
|
|
39
|
+
void YGNodeSetConfig(YGNodeRef node, YGConfigRef config) {
|
|
40
|
+
resolveRef(node)->setConfig(resolveRef(config));
|
|
123
41
|
}
|
|
124
42
|
|
|
125
|
-
|
|
126
|
-
return node->hasMeasureFunc();
|
|
43
|
+
bool YGNodeHasMeasureFunc(YGNodeConstRef node) {
|
|
44
|
+
return resolveRef(node)->hasMeasureFunc();
|
|
127
45
|
}
|
|
128
46
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
YGMeasureFunc measureFunc) {
|
|
132
|
-
node->setMeasureFunc(measureFunc);
|
|
47
|
+
void YGNodeSetMeasureFunc(YGNodeRef node, YGMeasureFunc measureFunc) {
|
|
48
|
+
resolveRef(node)->setMeasureFunc(measureFunc);
|
|
133
49
|
}
|
|
134
50
|
|
|
135
|
-
|
|
136
|
-
return node->hasBaselineFunc();
|
|
51
|
+
bool YGNodeHasBaselineFunc(YGNodeConstRef node) {
|
|
52
|
+
return resolveRef(node)->hasBaselineFunc();
|
|
137
53
|
}
|
|
138
54
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
YGBaselineFunc baselineFunc) {
|
|
142
|
-
node->setBaselineFunc(baselineFunc);
|
|
55
|
+
void YGNodeSetBaselineFunc(YGNodeRef node, YGBaselineFunc baselineFunc) {
|
|
56
|
+
resolveRef(node)->setBaselineFunc(baselineFunc);
|
|
143
57
|
}
|
|
144
58
|
|
|
145
|
-
|
|
146
|
-
return node->
|
|
59
|
+
YGDirtiedFunc YGNodeGetDirtiedFunc(YGNodeConstRef node) {
|
|
60
|
+
return resolveRef(node)->getDirtiedFunc();
|
|
147
61
|
}
|
|
148
62
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
YGDirtiedFunc dirtiedFunc) {
|
|
152
|
-
node->setDirtiedFunc(dirtiedFunc);
|
|
63
|
+
void YGNodeSetDirtiedFunc(YGNodeRef node, YGDirtiedFunc dirtiedFunc) {
|
|
64
|
+
resolveRef(node)->setDirtiedFunc(dirtiedFunc);
|
|
153
65
|
}
|
|
154
66
|
|
|
155
|
-
|
|
156
|
-
node->setPrintFunc(printFunc);
|
|
67
|
+
void YGNodeSetPrintFunc(YGNodeRef node, YGPrintFunc printFunc) {
|
|
68
|
+
resolveRef(node)->setPrintFunc(printFunc);
|
|
157
69
|
}
|
|
158
70
|
|
|
159
|
-
|
|
160
|
-
return node->getHasNewLayout();
|
|
71
|
+
bool YGNodeGetHasNewLayout(YGNodeConstRef node) {
|
|
72
|
+
return resolveRef(node)->getHasNewLayout();
|
|
161
73
|
}
|
|
162
74
|
|
|
163
|
-
|
|
164
|
-
config->
|
|
75
|
+
void YGConfigSetPrintTreeFlag(YGConfigRef config, bool enabled) {
|
|
76
|
+
resolveRef(config)->setShouldPrintTree(enabled);
|
|
165
77
|
}
|
|
166
78
|
|
|
167
|
-
|
|
168
|
-
node->setHasNewLayout(hasNewLayout);
|
|
79
|
+
void YGNodeSetHasNewLayout(YGNodeRef node, bool hasNewLayout) {
|
|
80
|
+
resolveRef(node)->setHasNewLayout(hasNewLayout);
|
|
169
81
|
}
|
|
170
82
|
|
|
171
|
-
|
|
172
|
-
return node->getNodeType();
|
|
83
|
+
YGNodeType YGNodeGetNodeType(YGNodeConstRef node) {
|
|
84
|
+
return unscopedEnum(resolveRef(node)->getNodeType());
|
|
173
85
|
}
|
|
174
86
|
|
|
175
|
-
|
|
176
|
-
return node->setNodeType(nodeType);
|
|
87
|
+
void YGNodeSetNodeType(YGNodeRef node, YGNodeType nodeType) {
|
|
88
|
+
return resolveRef(node)->setNodeType(scopedEnum(nodeType));
|
|
177
89
|
}
|
|
178
90
|
|
|
179
|
-
|
|
180
|
-
return node->isDirty();
|
|
91
|
+
bool YGNodeIsDirty(YGNodeConstRef node) {
|
|
92
|
+
return resolveRef(node)->isDirty();
|
|
181
93
|
}
|
|
182
94
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return node->markDirtyAndPropogateDownwards();
|
|
95
|
+
void YGNodeMarkDirtyAndPropagateToDescendants(const YGNodeRef node) {
|
|
96
|
+
return resolveRef(node)->markDirtyAndPropagateDownwards();
|
|
186
97
|
}
|
|
187
98
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
YGAssert(config != nullptr, "Tried to construct YGNode with null config");
|
|
193
|
-
YGAssertWithConfig(
|
|
194
|
-
config, node != nullptr, "Could not allocate memory for node");
|
|
99
|
+
YGNodeRef YGNodeNewWithConfig(const YGConfigConstRef config) {
|
|
100
|
+
auto* node = new yoga::Node{resolveRef(config)};
|
|
101
|
+
yoga::assertFatal(
|
|
102
|
+
config != nullptr, "Tried to construct YGNode with null config");
|
|
195
103
|
Event::publish<Event::NodeAllocation>(node, {config});
|
|
196
104
|
|
|
197
105
|
return node;
|
|
198
106
|
}
|
|
199
107
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
return defaultConfig;
|
|
108
|
+
YGConfigConstRef YGConfigGetDefault() {
|
|
109
|
+
return &yoga::Config::getDefault();
|
|
203
110
|
}
|
|
204
111
|
|
|
205
|
-
|
|
112
|
+
YGNodeRef YGNodeNew(void) {
|
|
206
113
|
return YGNodeNewWithConfig(YGConfigGetDefault());
|
|
207
114
|
}
|
|
208
115
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
116
|
+
YGNodeRef YGNodeClone(YGNodeConstRef oldNodeRef) {
|
|
117
|
+
auto oldNode = resolveRef(oldNodeRef);
|
|
118
|
+
const auto node = new yoga::Node(*oldNode);
|
|
119
|
+
yoga::assertFatalWithConfig(
|
|
212
120
|
oldNode->getConfig(),
|
|
213
121
|
node != nullptr,
|
|
214
122
|
"Could not allocate memory for node");
|
|
@@ -217,29 +125,37 @@ YOGA_EXPORT YGNodeRef YGNodeClone(YGNodeRef oldNode) {
|
|
|
217
125
|
return node;
|
|
218
126
|
}
|
|
219
127
|
|
|
220
|
-
|
|
221
|
-
|
|
128
|
+
void YGNodeFree(const YGNodeRef nodeRef) {
|
|
129
|
+
const auto node = resolveRef(nodeRef);
|
|
130
|
+
|
|
131
|
+
if (auto owner = node->getOwner()) {
|
|
222
132
|
owner->removeChild(node);
|
|
223
133
|
node->setOwner(nullptr);
|
|
224
134
|
}
|
|
225
135
|
|
|
226
|
-
const
|
|
227
|
-
for (
|
|
228
|
-
|
|
136
|
+
const size_t childCount = node->getChildCount();
|
|
137
|
+
for (size_t i = 0; i < childCount; i++) {
|
|
138
|
+
auto child = node->getChild(i);
|
|
229
139
|
child->setOwner(nullptr);
|
|
230
140
|
}
|
|
231
141
|
|
|
232
142
|
node->clearChildren();
|
|
233
|
-
|
|
234
|
-
|
|
143
|
+
YGNodeDeallocate(node);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
void YGNodeDeallocate(const YGNodeRef node) {
|
|
147
|
+
Event::publish<Event::NodeDeallocation>(node, {YGNodeGetConfig(node)});
|
|
148
|
+
delete resolveRef(node);
|
|
235
149
|
}
|
|
236
150
|
|
|
237
|
-
|
|
238
|
-
const YGNodeRef
|
|
151
|
+
void YGNodeFreeRecursiveWithCleanupFunc(
|
|
152
|
+
const YGNodeRef rootRef,
|
|
239
153
|
YGNodeCleanupFunc cleanup) {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
154
|
+
const auto root = resolveRef(rootRef);
|
|
155
|
+
|
|
156
|
+
size_t skipped = 0;
|
|
157
|
+
while (root->getChildCount() > skipped) {
|
|
158
|
+
const auto child = root->getChild(skipped);
|
|
243
159
|
if (child->getOwner() != root) {
|
|
244
160
|
// Don't free shared nodes that we don't own.
|
|
245
161
|
skipped += 1;
|
|
@@ -254,81 +170,74 @@ YOGA_EXPORT void YGNodeFreeRecursiveWithCleanupFunc(
|
|
|
254
170
|
YGNodeFree(root);
|
|
255
171
|
}
|
|
256
172
|
|
|
257
|
-
|
|
173
|
+
void YGNodeFreeRecursive(const YGNodeRef root) {
|
|
258
174
|
return YGNodeFreeRecursiveWithCleanupFunc(root, nullptr);
|
|
259
175
|
}
|
|
260
176
|
|
|
261
|
-
|
|
262
|
-
node->reset();
|
|
177
|
+
void YGNodeReset(YGNodeRef node) {
|
|
178
|
+
resolveRef(node)->reset();
|
|
263
179
|
}
|
|
264
180
|
|
|
265
|
-
|
|
266
|
-
return
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
YOGA_EXPORT YGConfigRef YGConfigNew(void) {
|
|
270
|
-
#ifdef ANDROID
|
|
271
|
-
const YGConfigRef config = new YGConfig(YGAndroidLog);
|
|
272
|
-
#else
|
|
273
|
-
const YGConfigRef config = new YGConfig(YGDefaultLog);
|
|
274
|
-
#endif
|
|
275
|
-
gConfigInstanceCount++;
|
|
276
|
-
return config;
|
|
181
|
+
YGConfigRef YGConfigNew(void) {
|
|
182
|
+
return new yoga::Config(getDefaultLogger());
|
|
277
183
|
}
|
|
278
184
|
|
|
279
|
-
|
|
280
|
-
delete config;
|
|
281
|
-
gConfigInstanceCount--;
|
|
185
|
+
void YGConfigFree(const YGConfigRef config) {
|
|
186
|
+
delete resolveRef(config);
|
|
282
187
|
}
|
|
283
188
|
|
|
284
|
-
void
|
|
285
|
-
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
YOGA_EXPORT void YGNodeSetIsReferenceBaseline(
|
|
289
|
-
YGNodeRef node,
|
|
290
|
-
bool isReferenceBaseline) {
|
|
189
|
+
void YGNodeSetIsReferenceBaseline(YGNodeRef nodeRef, bool isReferenceBaseline) {
|
|
190
|
+
const auto node = resolveRef(nodeRef);
|
|
291
191
|
if (node->isReferenceBaseline() != isReferenceBaseline) {
|
|
292
192
|
node->setIsReferenceBaseline(isReferenceBaseline);
|
|
293
|
-
node->
|
|
193
|
+
node->markDirtyAndPropagate();
|
|
294
194
|
}
|
|
295
195
|
}
|
|
296
196
|
|
|
297
|
-
|
|
298
|
-
return node->isReferenceBaseline();
|
|
197
|
+
bool YGNodeIsReferenceBaseline(YGNodeConstRef node) {
|
|
198
|
+
return resolveRef(node)->isReferenceBaseline();
|
|
299
199
|
}
|
|
300
200
|
|
|
301
|
-
|
|
302
|
-
const YGNodeRef
|
|
303
|
-
const YGNodeRef
|
|
304
|
-
const
|
|
305
|
-
|
|
201
|
+
void YGNodeInsertChild(
|
|
202
|
+
const YGNodeRef ownerRef,
|
|
203
|
+
const YGNodeRef childRef,
|
|
204
|
+
const size_t index) {
|
|
205
|
+
auto owner = resolveRef(ownerRef);
|
|
206
|
+
auto child = resolveRef(childRef);
|
|
207
|
+
|
|
208
|
+
yoga::assertFatalWithNode(
|
|
306
209
|
owner,
|
|
307
210
|
child->getOwner() == nullptr,
|
|
308
211
|
"Child already has a owner, it must be removed first.");
|
|
309
212
|
|
|
310
|
-
|
|
213
|
+
yoga::assertFatalWithNode(
|
|
311
214
|
owner,
|
|
312
215
|
!owner->hasMeasureFunc(),
|
|
313
216
|
"Cannot add child: Nodes with measure functions cannot have children.");
|
|
314
217
|
|
|
315
218
|
owner->insertChild(child, index);
|
|
316
219
|
child->setOwner(owner);
|
|
317
|
-
owner->
|
|
220
|
+
owner->markDirtyAndPropagate();
|
|
318
221
|
}
|
|
319
222
|
|
|
320
|
-
|
|
321
|
-
const YGNodeRef
|
|
322
|
-
const YGNodeRef
|
|
323
|
-
const
|
|
223
|
+
void YGNodeSwapChild(
|
|
224
|
+
const YGNodeRef ownerRef,
|
|
225
|
+
const YGNodeRef childRef,
|
|
226
|
+
const size_t index) {
|
|
227
|
+
auto owner = resolveRef(ownerRef);
|
|
228
|
+
auto child = resolveRef(childRef);
|
|
229
|
+
|
|
324
230
|
owner->replaceChild(child, index);
|
|
325
231
|
child->setOwner(owner);
|
|
326
232
|
}
|
|
327
233
|
|
|
328
|
-
|
|
329
|
-
const YGNodeRef
|
|
330
|
-
const YGNodeRef
|
|
331
|
-
|
|
234
|
+
void YGNodeRemoveChild(
|
|
235
|
+
const YGNodeRef ownerRef,
|
|
236
|
+
const YGNodeRef excludedChildRef) {
|
|
237
|
+
auto owner = resolveRef(ownerRef);
|
|
238
|
+
auto excludedChild = resolveRef(excludedChildRef);
|
|
239
|
+
|
|
240
|
+
if (owner->getChildCount() == 0) {
|
|
332
241
|
// This is an empty set. Nothing to remove.
|
|
333
242
|
return;
|
|
334
243
|
}
|
|
@@ -342,133 +251,135 @@ YOGA_EXPORT void YGNodeRemoveChild(
|
|
|
342
251
|
excludedChild->setLayout({}); // layout is no longer valid
|
|
343
252
|
excludedChild->setOwner(nullptr);
|
|
344
253
|
}
|
|
345
|
-
owner->
|
|
254
|
+
owner->markDirtyAndPropagate();
|
|
346
255
|
}
|
|
347
256
|
}
|
|
348
257
|
|
|
349
|
-
|
|
350
|
-
|
|
258
|
+
void YGNodeRemoveAllChildren(const YGNodeRef ownerRef) {
|
|
259
|
+
auto owner = resolveRef(ownerRef);
|
|
260
|
+
|
|
261
|
+
const size_t childCount = owner->getChildCount();
|
|
351
262
|
if (childCount == 0) {
|
|
352
263
|
// This is an empty set already. Nothing to do.
|
|
353
264
|
return;
|
|
354
265
|
}
|
|
355
|
-
|
|
266
|
+
auto* firstChild = owner->getChild(0);
|
|
356
267
|
if (firstChild->getOwner() == owner) {
|
|
357
268
|
// If the first child has this node as its owner, we assume that this child
|
|
358
269
|
// set is unique.
|
|
359
|
-
for (
|
|
360
|
-
|
|
361
|
-
oldChild->setLayout(
|
|
270
|
+
for (size_t i = 0; i < childCount; i++) {
|
|
271
|
+
yoga::Node* oldChild = owner->getChild(i);
|
|
272
|
+
oldChild->setLayout({}); // layout is no longer valid
|
|
362
273
|
oldChild->setOwner(nullptr);
|
|
363
274
|
}
|
|
364
275
|
owner->clearChildren();
|
|
365
|
-
owner->
|
|
276
|
+
owner->markDirtyAndPropagate();
|
|
366
277
|
return;
|
|
367
278
|
}
|
|
368
279
|
// Otherwise, we are not the owner of the child set. We don't have to do
|
|
369
280
|
// anything to clear it.
|
|
370
|
-
owner->setChildren(
|
|
371
|
-
owner->
|
|
281
|
+
owner->setChildren({});
|
|
282
|
+
owner->markDirtyAndPropagate();
|
|
372
283
|
}
|
|
373
284
|
|
|
374
|
-
|
|
375
|
-
YGNodeRef
|
|
376
|
-
const
|
|
285
|
+
void YGNodeSetChildren(
|
|
286
|
+
const YGNodeRef ownerRef,
|
|
287
|
+
const YGNodeRef* childrenRefs,
|
|
288
|
+
const size_t count) {
|
|
289
|
+
auto owner = resolveRef(ownerRef);
|
|
290
|
+
auto children = reinterpret_cast<yoga::Node* const*>(childrenRefs);
|
|
291
|
+
|
|
377
292
|
if (!owner) {
|
|
378
293
|
return;
|
|
379
294
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
295
|
+
|
|
296
|
+
const std::vector<yoga::Node*> childrenVector = {children, children + count};
|
|
297
|
+
if (childrenVector.size() == 0) {
|
|
298
|
+
if (owner->getChildCount() > 0) {
|
|
299
|
+
for (auto* child : owner->getChildren()) {
|
|
300
|
+
child->setLayout({});
|
|
384
301
|
child->setOwner(nullptr);
|
|
385
302
|
}
|
|
386
|
-
owner->setChildren(
|
|
387
|
-
owner->
|
|
303
|
+
owner->setChildren({});
|
|
304
|
+
owner->markDirtyAndPropagate();
|
|
388
305
|
}
|
|
389
306
|
} else {
|
|
390
|
-
if (
|
|
391
|
-
for (
|
|
307
|
+
if (owner->getChildCount() > 0) {
|
|
308
|
+
for (auto* oldChild : owner->getChildren()) {
|
|
392
309
|
// Our new children may have nodes in common with the old children. We
|
|
393
310
|
// don't reset these common nodes.
|
|
394
|
-
if (std::find(
|
|
395
|
-
|
|
396
|
-
oldChild->setLayout(
|
|
311
|
+
if (std::find(childrenVector.begin(), childrenVector.end(), oldChild) ==
|
|
312
|
+
childrenVector.end()) {
|
|
313
|
+
oldChild->setLayout({});
|
|
397
314
|
oldChild->setOwner(nullptr);
|
|
398
315
|
}
|
|
399
316
|
}
|
|
400
317
|
}
|
|
401
|
-
owner->setChildren(
|
|
402
|
-
for (
|
|
318
|
+
owner->setChildren(childrenVector);
|
|
319
|
+
for (yoga::Node* child : childrenVector) {
|
|
403
320
|
child->setOwner(owner);
|
|
404
321
|
}
|
|
405
|
-
owner->
|
|
322
|
+
owner->markDirtyAndPropagate();
|
|
406
323
|
}
|
|
407
324
|
}
|
|
408
325
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
const YGNodeRef c[],
|
|
412
|
-
const uint32_t count) {
|
|
413
|
-
const YGVector children = {c, c + count};
|
|
414
|
-
YGNodeSetChildrenInternal(owner, children);
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
YOGA_EXPORT void YGNodeSetChildren(
|
|
418
|
-
YGNodeRef const owner,
|
|
419
|
-
const std::vector<YGNodeRef>& children) {
|
|
420
|
-
YGNodeSetChildrenInternal(owner, children);
|
|
421
|
-
}
|
|
326
|
+
YGNodeRef YGNodeGetChild(const YGNodeRef nodeRef, const size_t index) {
|
|
327
|
+
const auto node = resolveRef(nodeRef);
|
|
422
328
|
|
|
423
|
-
YOGA_EXPORT YGNodeRef
|
|
424
|
-
YGNodeGetChild(const YGNodeRef node, const uint32_t index) {
|
|
425
329
|
if (index < node->getChildren().size()) {
|
|
426
330
|
return node->getChild(index);
|
|
427
331
|
}
|
|
428
332
|
return nullptr;
|
|
429
333
|
}
|
|
430
334
|
|
|
431
|
-
|
|
432
|
-
return
|
|
335
|
+
size_t YGNodeGetChildCount(const YGNodeConstRef node) {
|
|
336
|
+
return resolveRef(node)->getChildren().size();
|
|
433
337
|
}
|
|
434
338
|
|
|
435
|
-
|
|
436
|
-
return node->getOwner();
|
|
339
|
+
YGNodeRef YGNodeGetOwner(const YGNodeRef node) {
|
|
340
|
+
return resolveRef(node)->getOwner();
|
|
437
341
|
}
|
|
438
342
|
|
|
439
|
-
|
|
440
|
-
return node->getOwner();
|
|
343
|
+
YGNodeRef YGNodeGetParent(const YGNodeRef node) {
|
|
344
|
+
return resolveRef(node)->getOwner();
|
|
441
345
|
}
|
|
442
346
|
|
|
443
|
-
|
|
444
|
-
|
|
347
|
+
void YGNodeMarkDirty(const YGNodeRef nodeRef) {
|
|
348
|
+
const auto node = resolveRef(nodeRef);
|
|
349
|
+
|
|
350
|
+
yoga::assertFatalWithNode(
|
|
445
351
|
node,
|
|
446
352
|
node->hasMeasureFunc(),
|
|
447
|
-
"Only leaf nodes with custom measure functions"
|
|
353
|
+
"Only leaf nodes with custom measure functions "
|
|
448
354
|
"should manually mark themselves as dirty");
|
|
449
355
|
|
|
450
|
-
node->
|
|
356
|
+
node->markDirtyAndPropagate();
|
|
451
357
|
}
|
|
452
358
|
|
|
453
|
-
|
|
454
|
-
const YGNodeRef
|
|
455
|
-
const
|
|
359
|
+
void YGNodeCopyStyle(
|
|
360
|
+
const YGNodeRef dstNodeRef,
|
|
361
|
+
const YGNodeConstRef srcNodeRef) {
|
|
362
|
+
auto dstNode = resolveRef(dstNodeRef);
|
|
363
|
+
auto srcNode = resolveRef(srcNodeRef);
|
|
364
|
+
|
|
456
365
|
if (!(dstNode->getStyle() == srcNode->getStyle())) {
|
|
457
366
|
dstNode->setStyle(srcNode->getStyle());
|
|
458
|
-
dstNode->
|
|
367
|
+
dstNode->markDirtyAndPropagate();
|
|
459
368
|
}
|
|
460
369
|
}
|
|
461
370
|
|
|
462
|
-
|
|
371
|
+
float YGNodeStyleGetFlexGrow(const YGNodeConstRef nodeRef) {
|
|
372
|
+
const auto node = resolveRef(nodeRef);
|
|
463
373
|
return node->getStyle().flexGrow().isUndefined()
|
|
464
|
-
?
|
|
374
|
+
? Style::DefaultFlexGrow
|
|
465
375
|
: node->getStyle().flexGrow().unwrap();
|
|
466
376
|
}
|
|
467
377
|
|
|
468
|
-
|
|
378
|
+
float YGNodeStyleGetFlexShrink(const YGNodeConstRef nodeRef) {
|
|
379
|
+
const auto node = resolveRef(nodeRef);
|
|
469
380
|
return node->getStyle().flexShrink().isUndefined()
|
|
470
|
-
? (node->getConfig()->useWebDefaults ?
|
|
471
|
-
|
|
381
|
+
? (node->getConfig()->useWebDefaults() ? Style::WebDefaultFlexShrink
|
|
382
|
+
: Style::DefaultFlexShrink)
|
|
472
383
|
: node->getStyle().flexShrink().unwrap();
|
|
473
384
|
}
|
|
474
385
|
|
|
@@ -476,37 +387,45 @@ namespace {
|
|
|
476
387
|
|
|
477
388
|
template <typename T, typename NeedsUpdate, typename Update>
|
|
478
389
|
void updateStyle(
|
|
479
|
-
|
|
390
|
+
yoga::Node* node,
|
|
480
391
|
T value,
|
|
481
392
|
NeedsUpdate&& needsUpdate,
|
|
482
393
|
Update&& update) {
|
|
483
394
|
if (needsUpdate(node->getStyle(), value)) {
|
|
484
395
|
update(node->getStyle(), value);
|
|
485
|
-
node->
|
|
396
|
+
node->markDirtyAndPropagate();
|
|
486
397
|
}
|
|
487
398
|
}
|
|
488
399
|
|
|
489
400
|
template <typename Ref, typename T>
|
|
490
|
-
void updateStyle(
|
|
401
|
+
void updateStyle(YGNodeRef node, Ref (Style::*prop)(), T value) {
|
|
491
402
|
updateStyle(
|
|
492
|
-
node,
|
|
403
|
+
resolveRef(node),
|
|
493
404
|
value,
|
|
494
|
-
[prop](
|
|
495
|
-
[prop](
|
|
405
|
+
[prop](Style& s, T x) { return (s.*prop)() != x; },
|
|
406
|
+
[prop](Style& s, T x) { (s.*prop)() = x; });
|
|
496
407
|
}
|
|
497
408
|
|
|
498
409
|
template <typename Ref, typename Idx>
|
|
499
410
|
void updateIndexedStyleProp(
|
|
500
|
-
|
|
501
|
-
Ref (
|
|
411
|
+
YGNodeRef node,
|
|
412
|
+
Ref (Style::*prop)(),
|
|
502
413
|
Idx idx,
|
|
503
|
-
|
|
504
|
-
using detail::CompactValue;
|
|
414
|
+
CompactValue value) {
|
|
505
415
|
updateStyle(
|
|
506
|
-
node,
|
|
416
|
+
resolveRef(node),
|
|
417
|
+
value,
|
|
418
|
+
[idx, prop](Style& s, CompactValue x) { return (s.*prop)()[idx] != x; },
|
|
419
|
+
[idx, prop](Style& s, CompactValue x) { (s.*prop)()[idx] = x; });
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
template <auto GetterT, auto SetterT, typename IdxT>
|
|
423
|
+
void updateIndexedStyleProp(YGNodeRef node, IdxT idx, CompactValue value) {
|
|
424
|
+
updateStyle(
|
|
425
|
+
resolveRef(node),
|
|
507
426
|
value,
|
|
508
|
-
[idx
|
|
509
|
-
[idx
|
|
427
|
+
[idx](Style& s, CompactValue x) { return (s.*GetterT)(idx) != x; },
|
|
428
|
+
[idx](Style& s, CompactValue x) { (s.*SetterT)(idx, x); });
|
|
510
429
|
}
|
|
511
430
|
|
|
512
431
|
} // namespace
|
|
@@ -514,264 +433,214 @@ void updateIndexedStyleProp(
|
|
|
514
433
|
// MSVC has trouble inferring the return type of pointer to member functions
|
|
515
434
|
// with const and non-const overloads, instead of preferring the non-const
|
|
516
435
|
// overload like clang and GCC. For the purposes of updateStyle(), we can help
|
|
517
|
-
// MSVC by specifying that return type
|
|
436
|
+
// MSVC by specifying that return type explicitly. In combination with
|
|
518
437
|
// decltype, MSVC will prefer the non-const version.
|
|
519
|
-
#define MSVC_HINT(PROP) decltype(
|
|
438
|
+
#define MSVC_HINT(PROP) decltype(Style{}.PROP())
|
|
520
439
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
const YGDirection value) {
|
|
524
|
-
updateStyle<MSVC_HINT(direction)>(node, &YGStyle::direction, value);
|
|
440
|
+
void YGNodeStyleSetDirection(const YGNodeRef node, const YGDirection value) {
|
|
441
|
+
updateStyle<MSVC_HINT(direction)>(node, &Style::direction, scopedEnum(value));
|
|
525
442
|
}
|
|
526
|
-
|
|
527
|
-
return node->getStyle().direction();
|
|
443
|
+
YGDirection YGNodeStyleGetDirection(const YGNodeConstRef node) {
|
|
444
|
+
return unscopedEnum(resolveRef(node)->getStyle().direction());
|
|
528
445
|
}
|
|
529
446
|
|
|
530
|
-
|
|
447
|
+
void YGNodeStyleSetFlexDirection(
|
|
531
448
|
const YGNodeRef node,
|
|
532
449
|
const YGFlexDirection flexDirection) {
|
|
533
450
|
updateStyle<MSVC_HINT(flexDirection)>(
|
|
534
|
-
node, &
|
|
451
|
+
node, &Style::flexDirection, scopedEnum(flexDirection));
|
|
535
452
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
return node->getStyle().flexDirection();
|
|
453
|
+
YGFlexDirection YGNodeStyleGetFlexDirection(const YGNodeConstRef node) {
|
|
454
|
+
return unscopedEnum(resolveRef(node)->getStyle().flexDirection());
|
|
539
455
|
}
|
|
540
456
|
|
|
541
|
-
|
|
457
|
+
void YGNodeStyleSetJustifyContent(
|
|
542
458
|
const YGNodeRef node,
|
|
543
459
|
const YGJustify justifyContent) {
|
|
544
460
|
updateStyle<MSVC_HINT(justifyContent)>(
|
|
545
|
-
node, &
|
|
461
|
+
node, &Style::justifyContent, scopedEnum(justifyContent));
|
|
546
462
|
}
|
|
547
|
-
|
|
548
|
-
return node->getStyle().justifyContent();
|
|
463
|
+
YGJustify YGNodeStyleGetJustifyContent(const YGNodeConstRef node) {
|
|
464
|
+
return unscopedEnum(resolveRef(node)->getStyle().justifyContent());
|
|
549
465
|
}
|
|
550
466
|
|
|
551
|
-
|
|
467
|
+
void YGNodeStyleSetAlignContent(
|
|
552
468
|
const YGNodeRef node,
|
|
553
469
|
const YGAlign alignContent) {
|
|
554
470
|
updateStyle<MSVC_HINT(alignContent)>(
|
|
555
|
-
node, &
|
|
471
|
+
node, &Style::alignContent, scopedEnum(alignContent));
|
|
556
472
|
}
|
|
557
|
-
|
|
558
|
-
return node->getStyle().alignContent();
|
|
473
|
+
YGAlign YGNodeStyleGetAlignContent(const YGNodeConstRef node) {
|
|
474
|
+
return unscopedEnum(resolveRef(node)->getStyle().alignContent());
|
|
559
475
|
}
|
|
560
476
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
updateStyle<MSVC_HINT(alignItems)>(node, &YGStyle::alignItems, alignItems);
|
|
477
|
+
void YGNodeStyleSetAlignItems(const YGNodeRef node, const YGAlign alignItems) {
|
|
478
|
+
updateStyle<MSVC_HINT(alignItems)>(
|
|
479
|
+
node, &Style::alignItems, scopedEnum(alignItems));
|
|
565
480
|
}
|
|
566
|
-
|
|
567
|
-
return node->getStyle().alignItems();
|
|
481
|
+
YGAlign YGNodeStyleGetAlignItems(const YGNodeConstRef node) {
|
|
482
|
+
return unscopedEnum(resolveRef(node)->getStyle().alignItems());
|
|
568
483
|
}
|
|
569
484
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
updateStyle<MSVC_HINT(alignSelf)>(node, &YGStyle::alignSelf, alignSelf);
|
|
485
|
+
void YGNodeStyleSetAlignSelf(const YGNodeRef node, const YGAlign alignSelf) {
|
|
486
|
+
updateStyle<MSVC_HINT(alignSelf)>(
|
|
487
|
+
node, &Style::alignSelf, scopedEnum(alignSelf));
|
|
574
488
|
}
|
|
575
|
-
|
|
576
|
-
return node->getStyle().alignSelf();
|
|
489
|
+
YGAlign YGNodeStyleGetAlignSelf(const YGNodeConstRef node) {
|
|
490
|
+
return unscopedEnum(resolveRef(node)->getStyle().alignSelf());
|
|
577
491
|
}
|
|
578
492
|
|
|
579
|
-
|
|
493
|
+
void YGNodeStyleSetPositionType(
|
|
580
494
|
const YGNodeRef node,
|
|
581
495
|
const YGPositionType positionType) {
|
|
582
496
|
updateStyle<MSVC_HINT(positionType)>(
|
|
583
|
-
node, &
|
|
497
|
+
node, &Style::positionType, scopedEnum(positionType));
|
|
584
498
|
}
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
return node->getStyle().positionType();
|
|
499
|
+
YGPositionType YGNodeStyleGetPositionType(const YGNodeConstRef node) {
|
|
500
|
+
return unscopedEnum(resolveRef(node)->getStyle().positionType());
|
|
588
501
|
}
|
|
589
502
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
updateStyle<MSVC_HINT(flexWrap)>(node, &YGStyle::flexWrap, flexWrap);
|
|
503
|
+
void YGNodeStyleSetFlexWrap(const YGNodeRef node, const YGWrap flexWrap) {
|
|
504
|
+
updateStyle<MSVC_HINT(flexWrap)>(
|
|
505
|
+
node, &Style::flexWrap, scopedEnum(flexWrap));
|
|
594
506
|
}
|
|
595
|
-
|
|
596
|
-
return node->getStyle().flexWrap();
|
|
507
|
+
YGWrap YGNodeStyleGetFlexWrap(const YGNodeConstRef node) {
|
|
508
|
+
return unscopedEnum(resolveRef(node)->getStyle().flexWrap());
|
|
597
509
|
}
|
|
598
510
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
updateStyle<MSVC_HINT(overflow)>(node, &YGStyle::overflow, overflow);
|
|
511
|
+
void YGNodeStyleSetOverflow(const YGNodeRef node, const YGOverflow overflow) {
|
|
512
|
+
updateStyle<MSVC_HINT(overflow)>(
|
|
513
|
+
node, &Style::overflow, scopedEnum(overflow));
|
|
603
514
|
}
|
|
604
|
-
|
|
605
|
-
return node->getStyle().overflow();
|
|
515
|
+
YGOverflow YGNodeStyleGetOverflow(const YGNodeConstRef node) {
|
|
516
|
+
return unscopedEnum(resolveRef(node)->getStyle().overflow());
|
|
606
517
|
}
|
|
607
518
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
const YGDisplay display) {
|
|
611
|
-
updateStyle<MSVC_HINT(display)>(node, &YGStyle::display, display);
|
|
519
|
+
void YGNodeStyleSetDisplay(const YGNodeRef node, const YGDisplay display) {
|
|
520
|
+
updateStyle<MSVC_HINT(display)>(node, &Style::display, scopedEnum(display));
|
|
612
521
|
}
|
|
613
|
-
|
|
614
|
-
return node->getStyle().display();
|
|
522
|
+
YGDisplay YGNodeStyleGetDisplay(const YGNodeConstRef node) {
|
|
523
|
+
return unscopedEnum(resolveRef(node)->getStyle().display());
|
|
615
524
|
}
|
|
616
525
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
updateStyle<MSVC_HINT(flex)>(node, &YGStyle::flex, YGFloatOptional{flex});
|
|
526
|
+
void YGNodeStyleSetFlex(const YGNodeRef node, const float flex) {
|
|
527
|
+
updateStyle<MSVC_HINT(flex)>(node, &Style::flex, FloatOptional{flex});
|
|
620
528
|
}
|
|
621
529
|
|
|
622
|
-
|
|
623
|
-
|
|
530
|
+
float YGNodeStyleGetFlex(const YGNodeConstRef nodeRef) {
|
|
531
|
+
const auto node = resolveRef(nodeRef);
|
|
624
532
|
return node->getStyle().flex().isUndefined()
|
|
625
533
|
? YGUndefined
|
|
626
534
|
: node->getStyle().flex().unwrap();
|
|
627
535
|
}
|
|
628
536
|
|
|
629
|
-
|
|
630
|
-
YOGA_EXPORT void YGNodeStyleSetFlexGrow(
|
|
631
|
-
const YGNodeRef node,
|
|
632
|
-
const float flexGrow) {
|
|
537
|
+
void YGNodeStyleSetFlexGrow(const YGNodeRef node, const float flexGrow) {
|
|
633
538
|
updateStyle<MSVC_HINT(flexGrow)>(
|
|
634
|
-
node, &
|
|
539
|
+
node, &Style::flexGrow, FloatOptional{flexGrow});
|
|
635
540
|
}
|
|
636
541
|
|
|
637
|
-
|
|
638
|
-
YOGA_EXPORT void YGNodeStyleSetFlexShrink(
|
|
639
|
-
const YGNodeRef node,
|
|
640
|
-
const float flexShrink) {
|
|
542
|
+
void YGNodeStyleSetFlexShrink(const YGNodeRef node, const float flexShrink) {
|
|
641
543
|
updateStyle<MSVC_HINT(flexShrink)>(
|
|
642
|
-
node, &
|
|
544
|
+
node, &Style::flexShrink, FloatOptional{flexShrink});
|
|
643
545
|
}
|
|
644
546
|
|
|
645
|
-
|
|
646
|
-
YGValue flexBasis = node->getStyle().flexBasis();
|
|
547
|
+
YGValue YGNodeStyleGetFlexBasis(const YGNodeConstRef node) {
|
|
548
|
+
YGValue flexBasis = resolveRef(node)->getStyle().flexBasis();
|
|
647
549
|
if (flexBasis.unit == YGUnitUndefined || flexBasis.unit == YGUnitAuto) {
|
|
648
|
-
// TODO(T26792433): Get rid off the use of YGUndefined at client side
|
|
649
550
|
flexBasis.value = YGUndefined;
|
|
650
551
|
}
|
|
651
552
|
return flexBasis;
|
|
652
553
|
}
|
|
653
554
|
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
auto value = detail::CompactValue::ofMaybe<YGUnitPoint>(flexBasis);
|
|
658
|
-
updateStyle<MSVC_HINT(flexBasis)>(node, &YGStyle::flexBasis, value);
|
|
555
|
+
void YGNodeStyleSetFlexBasis(const YGNodeRef node, const float flexBasis) {
|
|
556
|
+
auto value = CompactValue::ofMaybe<YGUnitPoint>(flexBasis);
|
|
557
|
+
updateStyle<MSVC_HINT(flexBasis)>(node, &Style::flexBasis, value);
|
|
659
558
|
}
|
|
660
559
|
|
|
661
|
-
|
|
560
|
+
void YGNodeStyleSetFlexBasisPercent(
|
|
662
561
|
const YGNodeRef node,
|
|
663
562
|
const float flexBasisPercent) {
|
|
664
|
-
auto value =
|
|
665
|
-
updateStyle<MSVC_HINT(flexBasis)>(node, &
|
|
563
|
+
auto value = CompactValue::ofMaybe<YGUnitPercent>(flexBasisPercent);
|
|
564
|
+
updateStyle<MSVC_HINT(flexBasis)>(node, &Style::flexBasis, value);
|
|
666
565
|
}
|
|
667
566
|
|
|
668
|
-
|
|
567
|
+
void YGNodeStyleSetFlexBasisAuto(const YGNodeRef node) {
|
|
669
568
|
updateStyle<MSVC_HINT(flexBasis)>(
|
|
670
|
-
node, &
|
|
569
|
+
node, &Style::flexBasis, CompactValue::ofAuto());
|
|
671
570
|
}
|
|
672
571
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
YGEdge edge,
|
|
676
|
-
float points) {
|
|
677
|
-
auto value = detail::CompactValue::ofMaybe<YGUnitPoint>(points);
|
|
572
|
+
void YGNodeStyleSetPosition(YGNodeRef node, YGEdge edge, float points) {
|
|
573
|
+
auto value = CompactValue::ofMaybe<YGUnitPoint>(points);
|
|
678
574
|
updateIndexedStyleProp<MSVC_HINT(position)>(
|
|
679
|
-
node, &
|
|
575
|
+
node, &Style::position, edge, value);
|
|
680
576
|
}
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
YGEdge edge,
|
|
684
|
-
float percent) {
|
|
685
|
-
auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(percent);
|
|
577
|
+
void YGNodeStyleSetPositionPercent(YGNodeRef node, YGEdge edge, float percent) {
|
|
578
|
+
auto value = CompactValue::ofMaybe<YGUnitPercent>(percent);
|
|
686
579
|
updateIndexedStyleProp<MSVC_HINT(position)>(
|
|
687
|
-
node, &
|
|
580
|
+
node, &Style::position, edge, value);
|
|
688
581
|
}
|
|
689
|
-
|
|
690
|
-
return node->getStyle().position()[edge];
|
|
582
|
+
YGValue YGNodeStyleGetPosition(YGNodeConstRef node, YGEdge edge) {
|
|
583
|
+
return resolveRef(node)->getStyle().position()[edge];
|
|
691
584
|
}
|
|
692
585
|
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
float points) {
|
|
697
|
-
auto value = detail::CompactValue::ofMaybe<YGUnitPoint>(points);
|
|
698
|
-
updateIndexedStyleProp<MSVC_HINT(margin)>(
|
|
699
|
-
node, &YGStyle::margin, edge, value);
|
|
586
|
+
void YGNodeStyleSetMargin(YGNodeRef node, YGEdge edge, float points) {
|
|
587
|
+
auto value = CompactValue::ofMaybe<YGUnitPoint>(points);
|
|
588
|
+
updateIndexedStyleProp<MSVC_HINT(margin)>(node, &Style::margin, edge, value);
|
|
700
589
|
}
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
float percent) {
|
|
705
|
-
auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(percent);
|
|
706
|
-
updateIndexedStyleProp<MSVC_HINT(margin)>(
|
|
707
|
-
node, &YGStyle::margin, edge, value);
|
|
590
|
+
void YGNodeStyleSetMarginPercent(YGNodeRef node, YGEdge edge, float percent) {
|
|
591
|
+
auto value = CompactValue::ofMaybe<YGUnitPercent>(percent);
|
|
592
|
+
updateIndexedStyleProp<MSVC_HINT(margin)>(node, &Style::margin, edge, value);
|
|
708
593
|
}
|
|
709
|
-
|
|
594
|
+
void YGNodeStyleSetMarginAuto(YGNodeRef node, YGEdge edge) {
|
|
710
595
|
updateIndexedStyleProp<MSVC_HINT(margin)>(
|
|
711
|
-
node, &
|
|
596
|
+
node, &Style::margin, edge, CompactValue::ofAuto());
|
|
712
597
|
}
|
|
713
|
-
|
|
714
|
-
return node->getStyle().margin()[edge];
|
|
598
|
+
YGValue YGNodeStyleGetMargin(YGNodeConstRef node, YGEdge edge) {
|
|
599
|
+
return resolveRef(node)->getStyle().margin()[edge];
|
|
715
600
|
}
|
|
716
601
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
YGEdge edge,
|
|
720
|
-
float points) {
|
|
721
|
-
auto value = detail::CompactValue::ofMaybe<YGUnitPoint>(points);
|
|
602
|
+
void YGNodeStyleSetPadding(YGNodeRef node, YGEdge edge, float points) {
|
|
603
|
+
auto value = CompactValue::ofMaybe<YGUnitPoint>(points);
|
|
722
604
|
updateIndexedStyleProp<MSVC_HINT(padding)>(
|
|
723
|
-
node, &
|
|
605
|
+
node, &Style::padding, edge, value);
|
|
724
606
|
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
YGEdge edge,
|
|
728
|
-
float percent) {
|
|
729
|
-
auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(percent);
|
|
607
|
+
void YGNodeStyleSetPaddingPercent(YGNodeRef node, YGEdge edge, float percent) {
|
|
608
|
+
auto value = CompactValue::ofMaybe<YGUnitPercent>(percent);
|
|
730
609
|
updateIndexedStyleProp<MSVC_HINT(padding)>(
|
|
731
|
-
node, &
|
|
610
|
+
node, &Style::padding, edge, value);
|
|
732
611
|
}
|
|
733
|
-
|
|
734
|
-
return node->getStyle().padding()[edge];
|
|
612
|
+
YGValue YGNodeStyleGetPadding(YGNodeConstRef node, YGEdge edge) {
|
|
613
|
+
return resolveRef(node)->getStyle().padding()[edge];
|
|
735
614
|
}
|
|
736
615
|
|
|
737
|
-
|
|
738
|
-
YOGA_EXPORT void YGNodeStyleSetBorder(
|
|
616
|
+
void YGNodeStyleSetBorder(
|
|
739
617
|
const YGNodeRef node,
|
|
740
618
|
const YGEdge edge,
|
|
741
619
|
const float border) {
|
|
742
|
-
auto value =
|
|
743
|
-
updateIndexedStyleProp<MSVC_HINT(border)>(
|
|
744
|
-
node, &YGStyle::border, edge, value);
|
|
620
|
+
auto value = CompactValue::ofMaybe<YGUnitPoint>(border);
|
|
621
|
+
updateIndexedStyleProp<MSVC_HINT(border)>(node, &Style::border, edge, value);
|
|
745
622
|
}
|
|
746
623
|
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
const YGEdge edge) {
|
|
750
|
-
auto border = node->getStyle().border()[edge];
|
|
624
|
+
float YGNodeStyleGetBorder(const YGNodeConstRef node, const YGEdge edge) {
|
|
625
|
+
auto border = resolveRef(node)->getStyle().border()[edge];
|
|
751
626
|
if (border.isUndefined() || border.isAuto()) {
|
|
752
|
-
// TODO(T26792433): Rather than returning YGUndefined, change the api to
|
|
753
|
-
// return YGFloatOptional.
|
|
754
627
|
return YGUndefined;
|
|
755
628
|
}
|
|
756
629
|
|
|
757
630
|
return static_cast<YGValue>(border).value;
|
|
758
631
|
}
|
|
759
632
|
|
|
760
|
-
|
|
633
|
+
void YGNodeStyleSetGap(
|
|
761
634
|
const YGNodeRef node,
|
|
762
635
|
const YGGutter gutter,
|
|
763
636
|
const float gapLength) {
|
|
764
|
-
auto length =
|
|
765
|
-
updateIndexedStyleProp<MSVC_HINT(gap)>(node, &
|
|
637
|
+
auto length = CompactValue::ofMaybe<YGUnitPoint>(gapLength);
|
|
638
|
+
updateIndexedStyleProp<MSVC_HINT(gap)>(node, &Style::gap, gutter, length);
|
|
766
639
|
}
|
|
767
640
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
const YGGutter gutter) {
|
|
771
|
-
auto gapLength = node->getStyle().gap()[gutter];
|
|
641
|
+
float YGNodeStyleGetGap(const YGNodeConstRef node, const YGGutter gutter) {
|
|
642
|
+
auto gapLength = resolveRef(node)->getStyle().gap()[gutter];
|
|
772
643
|
if (gapLength.isUndefined() || gapLength.isAuto()) {
|
|
773
|
-
// TODO(T26792433): Rather than returning YGUndefined, change the api to
|
|
774
|
-
// return YGFloatOptional.
|
|
775
644
|
return YGUndefined;
|
|
776
645
|
}
|
|
777
646
|
|
|
@@ -780,3581 +649,314 @@ YOGA_EXPORT float YGNodeStyleGetGap(
|
|
|
780
649
|
|
|
781
650
|
// Yoga specific properties, not compatible with flexbox specification
|
|
782
651
|
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
const YGFloatOptional op = node->getStyle().aspectRatio();
|
|
652
|
+
float YGNodeStyleGetAspectRatio(const YGNodeConstRef node) {
|
|
653
|
+
const FloatOptional op = resolveRef(node)->getStyle().aspectRatio();
|
|
786
654
|
return op.isUndefined() ? YGUndefined : op.unwrap();
|
|
787
655
|
}
|
|
788
656
|
|
|
789
|
-
|
|
790
|
-
YOGA_EXPORT void YGNodeStyleSetAspectRatio(
|
|
791
|
-
const YGNodeRef node,
|
|
792
|
-
const float aspectRatio) {
|
|
657
|
+
void YGNodeStyleSetAspectRatio(const YGNodeRef node, const float aspectRatio) {
|
|
793
658
|
updateStyle<MSVC_HINT(aspectRatio)>(
|
|
794
|
-
node, &
|
|
659
|
+
node, &Style::aspectRatio, FloatOptional{aspectRatio});
|
|
795
660
|
}
|
|
796
661
|
|
|
797
|
-
|
|
798
|
-
auto value =
|
|
799
|
-
updateIndexedStyleProp
|
|
800
|
-
node,
|
|
662
|
+
void YGNodeStyleSetWidth(YGNodeRef node, float points) {
|
|
663
|
+
auto value = CompactValue::ofMaybe<YGUnitPoint>(points);
|
|
664
|
+
updateIndexedStyleProp<&Style::dimension, &Style::setDimension>(
|
|
665
|
+
node, YGDimensionWidth, value);
|
|
801
666
|
}
|
|
802
|
-
|
|
803
|
-
auto value =
|
|
804
|
-
updateIndexedStyleProp
|
|
805
|
-
node,
|
|
667
|
+
void YGNodeStyleSetWidthPercent(YGNodeRef node, float percent) {
|
|
668
|
+
auto value = CompactValue::ofMaybe<YGUnitPercent>(percent);
|
|
669
|
+
updateIndexedStyleProp<&Style::dimension, &Style::setDimension>(
|
|
670
|
+
node, YGDimensionWidth, value);
|
|
806
671
|
}
|
|
807
|
-
|
|
808
|
-
updateIndexedStyleProp
|
|
809
|
-
node,
|
|
810
|
-
&YGStyle::dimensions,
|
|
811
|
-
YGDimensionWidth,
|
|
812
|
-
detail::CompactValue::ofAuto());
|
|
672
|
+
void YGNodeStyleSetWidthAuto(YGNodeRef node) {
|
|
673
|
+
updateIndexedStyleProp<&Style::dimension, &Style::setDimension>(
|
|
674
|
+
node, YGDimensionWidth, CompactValue::ofAuto());
|
|
813
675
|
}
|
|
814
|
-
|
|
815
|
-
return node->getStyle().
|
|
676
|
+
YGValue YGNodeStyleGetWidth(YGNodeConstRef node) {
|
|
677
|
+
return resolveRef(node)->getStyle().dimension(YGDimensionWidth);
|
|
816
678
|
}
|
|
817
679
|
|
|
818
|
-
|
|
819
|
-
auto value =
|
|
820
|
-
updateIndexedStyleProp
|
|
821
|
-
node,
|
|
680
|
+
void YGNodeStyleSetHeight(YGNodeRef node, float points) {
|
|
681
|
+
auto value = CompactValue::ofMaybe<YGUnitPoint>(points);
|
|
682
|
+
updateIndexedStyleProp<&Style::dimension, &Style::setDimension>(
|
|
683
|
+
node, YGDimensionHeight, value);
|
|
822
684
|
}
|
|
823
|
-
|
|
824
|
-
auto value =
|
|
825
|
-
updateIndexedStyleProp
|
|
826
|
-
node,
|
|
685
|
+
void YGNodeStyleSetHeightPercent(YGNodeRef node, float percent) {
|
|
686
|
+
auto value = CompactValue::ofMaybe<YGUnitPercent>(percent);
|
|
687
|
+
updateIndexedStyleProp<&Style::dimension, &Style::setDimension>(
|
|
688
|
+
node, YGDimensionHeight, value);
|
|
827
689
|
}
|
|
828
|
-
|
|
829
|
-
updateIndexedStyleProp
|
|
830
|
-
node,
|
|
831
|
-
&YGStyle::dimensions,
|
|
832
|
-
YGDimensionHeight,
|
|
833
|
-
detail::CompactValue::ofAuto());
|
|
690
|
+
void YGNodeStyleSetHeightAuto(YGNodeRef node) {
|
|
691
|
+
updateIndexedStyleProp<&Style::dimension, &Style::setDimension>(
|
|
692
|
+
node, YGDimensionHeight, CompactValue::ofAuto());
|
|
834
693
|
}
|
|
835
|
-
|
|
836
|
-
return node->getStyle().
|
|
694
|
+
YGValue YGNodeStyleGetHeight(YGNodeConstRef node) {
|
|
695
|
+
return resolveRef(node)->getStyle().dimension(YGDimensionHeight);
|
|
837
696
|
}
|
|
838
697
|
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
updateIndexedStyleProp<MSVC_HINT(minDimensions)>(
|
|
844
|
-
node, &YGStyle::minDimensions, YGDimensionWidth, value);
|
|
698
|
+
void YGNodeStyleSetMinWidth(const YGNodeRef node, const float minWidth) {
|
|
699
|
+
auto value = CompactValue::ofMaybe<YGUnitPoint>(minWidth);
|
|
700
|
+
updateIndexedStyleProp<&Style::minDimension, &Style::setMinDimension>(
|
|
701
|
+
node, YGDimensionWidth, value);
|
|
845
702
|
}
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
updateIndexedStyleProp<MSVC_HINT(minDimensions)>(
|
|
851
|
-
node, &YGStyle::minDimensions, YGDimensionWidth, value);
|
|
703
|
+
void YGNodeStyleSetMinWidthPercent(const YGNodeRef node, const float minWidth) {
|
|
704
|
+
auto value = CompactValue::ofMaybe<YGUnitPercent>(minWidth);
|
|
705
|
+
updateIndexedStyleProp<&Style::minDimension, &Style::setMinDimension>(
|
|
706
|
+
node, YGDimensionWidth, value);
|
|
852
707
|
}
|
|
853
|
-
|
|
854
|
-
return node->getStyle().
|
|
855
|
-
};
|
|
856
|
-
|
|
857
|
-
YOGA_EXPORT void YGNodeStyleSetMinHeight(
|
|
858
|
-
const YGNodeRef node,
|
|
859
|
-
const float minHeight) {
|
|
860
|
-
auto value = detail::CompactValue::ofMaybe<YGUnitPoint>(minHeight);
|
|
861
|
-
updateIndexedStyleProp<MSVC_HINT(minDimensions)>(
|
|
862
|
-
node, &YGStyle::minDimensions, YGDimensionHeight, value);
|
|
863
|
-
}
|
|
864
|
-
YOGA_EXPORT void YGNodeStyleSetMinHeightPercent(
|
|
865
|
-
const YGNodeRef node,
|
|
866
|
-
const float minHeight) {
|
|
867
|
-
auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(minHeight);
|
|
868
|
-
updateIndexedStyleProp<MSVC_HINT(minDimensions)>(
|
|
869
|
-
node, &YGStyle::minDimensions, YGDimensionHeight, value);
|
|
708
|
+
YGValue YGNodeStyleGetMinWidth(const YGNodeConstRef node) {
|
|
709
|
+
return resolveRef(node)->getStyle().minDimension(YGDimensionWidth);
|
|
870
710
|
}
|
|
871
|
-
YOGA_EXPORT YGValue YGNodeStyleGetMinHeight(const YGNodeConstRef node) {
|
|
872
|
-
return node->getStyle().minDimensions()[YGDimensionHeight];
|
|
873
|
-
};
|
|
874
711
|
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
updateIndexedStyleProp<MSVC_HINT(maxDimensions)>(
|
|
880
|
-
node, &YGStyle::maxDimensions, YGDimensionWidth, value);
|
|
881
|
-
}
|
|
882
|
-
YOGA_EXPORT void YGNodeStyleSetMaxWidthPercent(
|
|
883
|
-
const YGNodeRef node,
|
|
884
|
-
const float maxWidth) {
|
|
885
|
-
auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(maxWidth);
|
|
886
|
-
updateIndexedStyleProp<MSVC_HINT(maxDimensions)>(
|
|
887
|
-
node, &YGStyle::maxDimensions, YGDimensionWidth, value);
|
|
712
|
+
void YGNodeStyleSetMinHeight(const YGNodeRef node, const float minHeight) {
|
|
713
|
+
auto value = CompactValue::ofMaybe<YGUnitPoint>(minHeight);
|
|
714
|
+
updateIndexedStyleProp<&Style::minDimension, &Style::setMinDimension>(
|
|
715
|
+
node, YGDimensionHeight, value);
|
|
888
716
|
}
|
|
889
|
-
|
|
890
|
-
return node->getStyle().maxDimensions()[YGDimensionWidth];
|
|
891
|
-
};
|
|
892
|
-
|
|
893
|
-
YOGA_EXPORT void YGNodeStyleSetMaxHeight(
|
|
717
|
+
void YGNodeStyleSetMinHeightPercent(
|
|
894
718
|
const YGNodeRef node,
|
|
895
|
-
const float
|
|
896
|
-
auto value =
|
|
897
|
-
updateIndexedStyleProp
|
|
898
|
-
node,
|
|
899
|
-
}
|
|
900
|
-
YOGA_EXPORT void YGNodeStyleSetMaxHeightPercent(
|
|
901
|
-
const YGNodeRef node,
|
|
902
|
-
const float maxHeight) {
|
|
903
|
-
auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(maxHeight);
|
|
904
|
-
updateIndexedStyleProp<MSVC_HINT(maxDimensions)>(
|
|
905
|
-
node, &YGStyle::maxDimensions, YGDimensionHeight, value);
|
|
906
|
-
}
|
|
907
|
-
YOGA_EXPORT YGValue YGNodeStyleGetMaxHeight(const YGNodeConstRef node) {
|
|
908
|
-
return node->getStyle().maxDimensions()[YGDimensionHeight];
|
|
909
|
-
};
|
|
910
|
-
|
|
911
|
-
#define YG_NODE_LAYOUT_PROPERTY_IMPL(type, name, instanceName) \
|
|
912
|
-
YOGA_EXPORT type YGNodeLayoutGet##name(const YGNodeRef node) { \
|
|
913
|
-
return node->getLayout().instanceName; \
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
#define YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(type, name, instanceName) \
|
|
917
|
-
YOGA_EXPORT type YGNodeLayoutGet##name( \
|
|
918
|
-
const YGNodeRef node, const YGEdge edge) { \
|
|
919
|
-
YGAssertWithNode( \
|
|
920
|
-
node, \
|
|
921
|
-
edge <= YGEdgeEnd, \
|
|
922
|
-
"Cannot get layout properties of multi-edge shorthands"); \
|
|
923
|
-
\
|
|
924
|
-
if (edge == YGEdgeStart) { \
|
|
925
|
-
if (node->getLayout().direction() == YGDirectionRTL) { \
|
|
926
|
-
return node->getLayout().instanceName[YGEdgeRight]; \
|
|
927
|
-
} else { \
|
|
928
|
-
return node->getLayout().instanceName[YGEdgeLeft]; \
|
|
929
|
-
} \
|
|
930
|
-
} \
|
|
931
|
-
\
|
|
932
|
-
if (edge == YGEdgeEnd) { \
|
|
933
|
-
if (node->getLayout().direction() == YGDirectionRTL) { \
|
|
934
|
-
return node->getLayout().instanceName[YGEdgeLeft]; \
|
|
935
|
-
} else { \
|
|
936
|
-
return node->getLayout().instanceName[YGEdgeRight]; \
|
|
937
|
-
} \
|
|
938
|
-
} \
|
|
939
|
-
\
|
|
940
|
-
return node->getLayout().instanceName[edge]; \
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
YG_NODE_LAYOUT_PROPERTY_IMPL(float, Left, position[YGEdgeLeft]);
|
|
944
|
-
YG_NODE_LAYOUT_PROPERTY_IMPL(float, Top, position[YGEdgeTop]);
|
|
945
|
-
YG_NODE_LAYOUT_PROPERTY_IMPL(float, Right, position[YGEdgeRight]);
|
|
946
|
-
YG_NODE_LAYOUT_PROPERTY_IMPL(float, Bottom, position[YGEdgeBottom]);
|
|
947
|
-
YG_NODE_LAYOUT_PROPERTY_IMPL(float, Width, dimensions[YGDimensionWidth]);
|
|
948
|
-
YG_NODE_LAYOUT_PROPERTY_IMPL(float, Height, dimensions[YGDimensionHeight]);
|
|
949
|
-
YG_NODE_LAYOUT_PROPERTY_IMPL(YGDirection, Direction, direction());
|
|
950
|
-
YG_NODE_LAYOUT_PROPERTY_IMPL(bool, HadOverflow, hadOverflow());
|
|
951
|
-
|
|
952
|
-
YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(float, Margin, margin);
|
|
953
|
-
YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(float, Border, border);
|
|
954
|
-
YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(float, Padding, padding);
|
|
955
|
-
|
|
956
|
-
std::atomic<uint32_t> gCurrentGenerationCount(0);
|
|
957
|
-
|
|
958
|
-
bool YGLayoutNodeInternal(
|
|
959
|
-
const YGNodeRef node,
|
|
960
|
-
const float availableWidth,
|
|
961
|
-
const float availableHeight,
|
|
962
|
-
const YGDirection ownerDirection,
|
|
963
|
-
const YGMeasureMode widthMeasureMode,
|
|
964
|
-
const YGMeasureMode heightMeasureMode,
|
|
965
|
-
const float ownerWidth,
|
|
966
|
-
const float ownerHeight,
|
|
967
|
-
const bool performLayout,
|
|
968
|
-
const LayoutPassReason reason,
|
|
969
|
-
const YGConfigRef config,
|
|
970
|
-
LayoutData& layoutMarkerData,
|
|
971
|
-
void* const layoutContext,
|
|
972
|
-
const uint32_t depth,
|
|
973
|
-
const uint32_t generationCount);
|
|
974
|
-
|
|
975
|
-
#ifdef DEBUG
|
|
976
|
-
static void YGNodePrintInternal(
|
|
977
|
-
const YGNodeRef node,
|
|
978
|
-
const YGPrintOptions options) {
|
|
979
|
-
std::string str;
|
|
980
|
-
facebook::yoga::YGNodeToString(str, node, options, 0);
|
|
981
|
-
Log::log(node, YGLogLevelDebug, nullptr, str.c_str());
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
YOGA_EXPORT void YGNodePrint(
|
|
985
|
-
const YGNodeRef node,
|
|
986
|
-
const YGPrintOptions options) {
|
|
987
|
-
YGNodePrintInternal(node, options);
|
|
719
|
+
const float minHeight) {
|
|
720
|
+
auto value = CompactValue::ofMaybe<YGUnitPercent>(minHeight);
|
|
721
|
+
updateIndexedStyleProp<&Style::minDimension, &Style::setMinDimension>(
|
|
722
|
+
node, YGDimensionHeight, value);
|
|
988
723
|
}
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
const std::array<YGEdge, 4> leading = {
|
|
992
|
-
{YGEdgeTop, YGEdgeBottom, YGEdgeLeft, YGEdgeRight}};
|
|
993
|
-
|
|
994
|
-
const std::array<YGEdge, 4> trailing = {
|
|
995
|
-
{YGEdgeBottom, YGEdgeTop, YGEdgeRight, YGEdgeLeft}};
|
|
996
|
-
static const std::array<YGEdge, 4> pos = {{
|
|
997
|
-
YGEdgeTop,
|
|
998
|
-
YGEdgeBottom,
|
|
999
|
-
YGEdgeLeft,
|
|
1000
|
-
YGEdgeRight,
|
|
1001
|
-
}};
|
|
1002
|
-
|
|
1003
|
-
static const std::array<YGDimension, 4> dim = {
|
|
1004
|
-
{YGDimensionHeight, YGDimensionHeight, YGDimensionWidth, YGDimensionWidth}};
|
|
1005
|
-
|
|
1006
|
-
static inline float YGNodePaddingAndBorderForAxis(
|
|
1007
|
-
const YGNodeConstRef node,
|
|
1008
|
-
const YGFlexDirection axis,
|
|
1009
|
-
const float widthSize) {
|
|
1010
|
-
return (node->getLeadingPaddingAndBorder(axis, widthSize) +
|
|
1011
|
-
node->getTrailingPaddingAndBorder(axis, widthSize))
|
|
1012
|
-
.unwrap();
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
static inline YGAlign YGNodeAlignItem(const YGNode* node, const YGNode* child) {
|
|
1016
|
-
const YGAlign align = child->getStyle().alignSelf() == YGAlignAuto
|
|
1017
|
-
? node->getStyle().alignItems()
|
|
1018
|
-
: child->getStyle().alignSelf();
|
|
1019
|
-
if (align == YGAlignBaseline &&
|
|
1020
|
-
YGFlexDirectionIsColumn(node->getStyle().flexDirection())) {
|
|
1021
|
-
return YGAlignFlexStart;
|
|
1022
|
-
}
|
|
1023
|
-
return align;
|
|
724
|
+
YGValue YGNodeStyleGetMinHeight(const YGNodeConstRef node) {
|
|
725
|
+
return resolveRef(node)->getStyle().minDimension(YGDimensionHeight);
|
|
1024
726
|
}
|
|
1025
727
|
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
const float baseline = node->baseline(
|
|
1032
|
-
node->getLayout().measuredDimensions[YGDimensionWidth],
|
|
1033
|
-
node->getLayout().measuredDimensions[YGDimensionHeight],
|
|
1034
|
-
layoutContext);
|
|
1035
|
-
|
|
1036
|
-
Event::publish<Event::NodeBaselineEnd>(node);
|
|
1037
|
-
|
|
1038
|
-
YGAssertWithNode(
|
|
1039
|
-
node,
|
|
1040
|
-
!YGFloatIsUndefined(baseline),
|
|
1041
|
-
"Expect custom baseline function to not return NaN");
|
|
1042
|
-
return baseline;
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
YGNodeRef baselineChild = nullptr;
|
|
1046
|
-
const uint32_t childCount = YGNodeGetChildCount(node);
|
|
1047
|
-
for (uint32_t i = 0; i < childCount; i++) {
|
|
1048
|
-
const YGNodeRef child = YGNodeGetChild(node, i);
|
|
1049
|
-
if (child->getLineIndex() > 0) {
|
|
1050
|
-
break;
|
|
1051
|
-
}
|
|
1052
|
-
if (child->getStyle().positionType() == YGPositionTypeAbsolute) {
|
|
1053
|
-
continue;
|
|
1054
|
-
}
|
|
1055
|
-
if (YGNodeAlignItem(node, child) == YGAlignBaseline ||
|
|
1056
|
-
child->isReferenceBaseline()) {
|
|
1057
|
-
baselineChild = child;
|
|
1058
|
-
break;
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
if (baselineChild == nullptr) {
|
|
1062
|
-
baselineChild = child;
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
if (baselineChild == nullptr) {
|
|
1067
|
-
return node->getLayout().measuredDimensions[YGDimensionHeight];
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
const float baseline = YGBaseline(baselineChild, layoutContext);
|
|
1071
|
-
return baseline + baselineChild->getLayout().position[YGEdgeTop];
|
|
728
|
+
void YGNodeStyleSetMaxWidth(const YGNodeRef node, const float maxWidth) {
|
|
729
|
+
auto value = CompactValue::ofMaybe<YGUnitPoint>(maxWidth);
|
|
730
|
+
updateIndexedStyleProp<&Style::maxDimension, &Style::setMaxDimension>(
|
|
731
|
+
node, YGDimensionWidth, value);
|
|
1072
732
|
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
}
|
|
1078
|
-
if (node->getStyle().alignItems() == YGAlignBaseline) {
|
|
1079
|
-
return true;
|
|
1080
|
-
}
|
|
1081
|
-
const uint32_t childCount = YGNodeGetChildCount(node);
|
|
1082
|
-
for (uint32_t i = 0; i < childCount; i++) {
|
|
1083
|
-
const YGNodeRef child = YGNodeGetChild(node, i);
|
|
1084
|
-
if (child->getStyle().positionType() != YGPositionTypeAbsolute &&
|
|
1085
|
-
child->getStyle().alignSelf() == YGAlignBaseline) {
|
|
1086
|
-
return true;
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
return false;
|
|
733
|
+
void YGNodeStyleSetMaxWidthPercent(const YGNodeRef node, const float maxWidth) {
|
|
734
|
+
auto value = CompactValue::ofMaybe<YGUnitPercent>(maxWidth);
|
|
735
|
+
updateIndexedStyleProp<&Style::maxDimension, &Style::setMaxDimension>(
|
|
736
|
+
node, YGDimensionWidth, value);
|
|
1091
737
|
}
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
const YGNodeRef node,
|
|
1095
|
-
const YGFlexDirection axis,
|
|
1096
|
-
const float widthSize) {
|
|
1097
|
-
return node->getLayout().measuredDimensions[dim[axis]] +
|
|
1098
|
-
(node->getLeadingMargin(axis, widthSize) +
|
|
1099
|
-
node->getTrailingMargin(axis, widthSize))
|
|
1100
|
-
.unwrap();
|
|
738
|
+
YGValue YGNodeStyleGetMaxWidth(const YGNodeConstRef node) {
|
|
739
|
+
return resolveRef(node)->getStyle().maxDimension(YGDimensionWidth);
|
|
1101
740
|
}
|
|
1102
741
|
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
bool isUndefined =
|
|
1108
|
-
YGFloatIsUndefined(node->getResolvedDimension(dim[axis]).value);
|
|
1109
|
-
return !(
|
|
1110
|
-
node->getResolvedDimension(dim[axis]).unit == YGUnitAuto ||
|
|
1111
|
-
node->getResolvedDimension(dim[axis]).unit == YGUnitUndefined ||
|
|
1112
|
-
(node->getResolvedDimension(dim[axis]).unit == YGUnitPoint &&
|
|
1113
|
-
!isUndefined && node->getResolvedDimension(dim[axis]).value < 0.0f) ||
|
|
1114
|
-
(node->getResolvedDimension(dim[axis]).unit == YGUnitPercent &&
|
|
1115
|
-
!isUndefined &&
|
|
1116
|
-
(node->getResolvedDimension(dim[axis]).value < 0.0f ||
|
|
1117
|
-
YGFloatIsUndefined(ownerSize))));
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
static inline bool YGNodeIsLayoutDimDefined(
|
|
1121
|
-
const YGNodeRef node,
|
|
1122
|
-
const YGFlexDirection axis) {
|
|
1123
|
-
const float value = node->getLayout().measuredDimensions[dim[axis]];
|
|
1124
|
-
return !YGFloatIsUndefined(value) && value >= 0.0f;
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
static YGFloatOptional YGNodeBoundAxisWithinMinAndMax(
|
|
1128
|
-
const YGNodeConstRef node,
|
|
1129
|
-
const YGFlexDirection axis,
|
|
1130
|
-
const YGFloatOptional value,
|
|
1131
|
-
const float axisSize) {
|
|
1132
|
-
YGFloatOptional min;
|
|
1133
|
-
YGFloatOptional max;
|
|
1134
|
-
|
|
1135
|
-
if (YGFlexDirectionIsColumn(axis)) {
|
|
1136
|
-
min = YGResolveValue(
|
|
1137
|
-
node->getStyle().minDimensions()[YGDimensionHeight], axisSize);
|
|
1138
|
-
max = YGResolveValue(
|
|
1139
|
-
node->getStyle().maxDimensions()[YGDimensionHeight], axisSize);
|
|
1140
|
-
} else if (YGFlexDirectionIsRow(axis)) {
|
|
1141
|
-
min = YGResolveValue(
|
|
1142
|
-
node->getStyle().minDimensions()[YGDimensionWidth], axisSize);
|
|
1143
|
-
max = YGResolveValue(
|
|
1144
|
-
node->getStyle().maxDimensions()[YGDimensionWidth], axisSize);
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
if (max >= YGFloatOptional{0} && value > max) {
|
|
1148
|
-
return max;
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
if (min >= YGFloatOptional{0} && value < min) {
|
|
1152
|
-
return min;
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
return value;
|
|
742
|
+
void YGNodeStyleSetMaxHeight(const YGNodeRef node, const float maxHeight) {
|
|
743
|
+
auto value = CompactValue::ofMaybe<YGUnitPoint>(maxHeight);
|
|
744
|
+
updateIndexedStyleProp<&Style::maxDimension, &Style::setMaxDimension>(
|
|
745
|
+
node, YGDimensionHeight, value);
|
|
1156
746
|
}
|
|
1157
|
-
|
|
1158
|
-
// Like YGNodeBoundAxisWithinMinAndMax but also ensures that the value doesn't
|
|
1159
|
-
// go below the padding and border amount.
|
|
1160
|
-
static inline float YGNodeBoundAxis(
|
|
747
|
+
void YGNodeStyleSetMaxHeightPercent(
|
|
1161
748
|
const YGNodeRef node,
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
return YGFloatMax(
|
|
1167
|
-
YGNodeBoundAxisWithinMinAndMax(
|
|
1168
|
-
node, axis, YGFloatOptional{value}, axisSize)
|
|
1169
|
-
.unwrap(),
|
|
1170
|
-
YGNodePaddingAndBorderForAxis(node, axis, widthSize));
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
static void YGNodeSetChildTrailingPosition(
|
|
1174
|
-
const YGNodeRef node,
|
|
1175
|
-
const YGNodeRef child,
|
|
1176
|
-
const YGFlexDirection axis) {
|
|
1177
|
-
const float size = child->getLayout().measuredDimensions[dim[axis]];
|
|
1178
|
-
child->setLayoutPosition(
|
|
1179
|
-
node->getLayout().measuredDimensions[dim[axis]] - size -
|
|
1180
|
-
child->getLayout().position[pos[axis]],
|
|
1181
|
-
trailing[axis]);
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
static void YGConstrainMaxSizeForMode(
|
|
1185
|
-
const YGNodeConstRef node,
|
|
1186
|
-
const enum YGFlexDirection axis,
|
|
1187
|
-
const float ownerAxisSize,
|
|
1188
|
-
const float ownerWidth,
|
|
1189
|
-
YGMeasureMode* mode,
|
|
1190
|
-
float* size) {
|
|
1191
|
-
const YGFloatOptional maxSize =
|
|
1192
|
-
YGResolveValue(
|
|
1193
|
-
node->getStyle().maxDimensions()[dim[axis]], ownerAxisSize) +
|
|
1194
|
-
YGFloatOptional(node->getMarginForAxis(axis, ownerWidth));
|
|
1195
|
-
switch (*mode) {
|
|
1196
|
-
case YGMeasureModeExactly:
|
|
1197
|
-
case YGMeasureModeAtMost:
|
|
1198
|
-
*size = (maxSize.isUndefined() || *size < maxSize.unwrap())
|
|
1199
|
-
? *size
|
|
1200
|
-
: maxSize.unwrap();
|
|
1201
|
-
break;
|
|
1202
|
-
case YGMeasureModeUndefined:
|
|
1203
|
-
if (!maxSize.isUndefined()) {
|
|
1204
|
-
*mode = YGMeasureModeAtMost;
|
|
1205
|
-
*size = maxSize.unwrap();
|
|
1206
|
-
}
|
|
1207
|
-
break;
|
|
1208
|
-
}
|
|
749
|
+
const float maxHeight) {
|
|
750
|
+
auto value = CompactValue::ofMaybe<YGUnitPercent>(maxHeight);
|
|
751
|
+
updateIndexedStyleProp<&Style::maxDimension, &Style::setMaxDimension>(
|
|
752
|
+
node, YGDimensionHeight, value);
|
|
1209
753
|
}
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
const YGNodeRef node,
|
|
1213
|
-
const YGNodeRef child,
|
|
1214
|
-
const float width,
|
|
1215
|
-
const YGMeasureMode widthMode,
|
|
1216
|
-
const float height,
|
|
1217
|
-
const float ownerWidth,
|
|
1218
|
-
const float ownerHeight,
|
|
1219
|
-
const YGMeasureMode heightMode,
|
|
1220
|
-
const YGDirection direction,
|
|
1221
|
-
const YGConfigRef config,
|
|
1222
|
-
LayoutData& layoutMarkerData,
|
|
1223
|
-
void* const layoutContext,
|
|
1224
|
-
const uint32_t depth,
|
|
1225
|
-
const uint32_t generationCount) {
|
|
1226
|
-
const YGFlexDirection mainAxis =
|
|
1227
|
-
YGResolveFlexDirection(node->getStyle().flexDirection(), direction);
|
|
1228
|
-
const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis);
|
|
1229
|
-
const float mainAxisSize = isMainAxisRow ? width : height;
|
|
1230
|
-
const float mainAxisownerSize = isMainAxisRow ? ownerWidth : ownerHeight;
|
|
1231
|
-
|
|
1232
|
-
float childWidth;
|
|
1233
|
-
float childHeight;
|
|
1234
|
-
YGMeasureMode childWidthMeasureMode;
|
|
1235
|
-
YGMeasureMode childHeightMeasureMode;
|
|
1236
|
-
|
|
1237
|
-
const YGFloatOptional resolvedFlexBasis =
|
|
1238
|
-
YGResolveValue(child->resolveFlexBasisPtr(), mainAxisownerSize);
|
|
1239
|
-
const bool isRowStyleDimDefined =
|
|
1240
|
-
YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, ownerWidth);
|
|
1241
|
-
const bool isColumnStyleDimDefined =
|
|
1242
|
-
YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn, ownerHeight);
|
|
1243
|
-
|
|
1244
|
-
if (!resolvedFlexBasis.isUndefined() && !YGFloatIsUndefined(mainAxisSize)) {
|
|
1245
|
-
if (child->getLayout().computedFlexBasis.isUndefined() ||
|
|
1246
|
-
(YGConfigIsExperimentalFeatureEnabled(
|
|
1247
|
-
child->getConfig(), YGExperimentalFeatureWebFlexBasis) &&
|
|
1248
|
-
child->getLayout().computedFlexBasisGeneration != generationCount)) {
|
|
1249
|
-
const YGFloatOptional paddingAndBorder = YGFloatOptional(
|
|
1250
|
-
YGNodePaddingAndBorderForAxis(child, mainAxis, ownerWidth));
|
|
1251
|
-
child->setLayoutComputedFlexBasis(
|
|
1252
|
-
YGFloatOptionalMax(resolvedFlexBasis, paddingAndBorder));
|
|
1253
|
-
}
|
|
1254
|
-
} else if (isMainAxisRow && isRowStyleDimDefined) {
|
|
1255
|
-
// The width is definite, so use that as the flex basis.
|
|
1256
|
-
const YGFloatOptional paddingAndBorder = YGFloatOptional(
|
|
1257
|
-
YGNodePaddingAndBorderForAxis(child, YGFlexDirectionRow, ownerWidth));
|
|
1258
|
-
|
|
1259
|
-
child->setLayoutComputedFlexBasis(YGFloatOptionalMax(
|
|
1260
|
-
YGResolveValue(
|
|
1261
|
-
child->getResolvedDimensions()[YGDimensionWidth], ownerWidth),
|
|
1262
|
-
paddingAndBorder));
|
|
1263
|
-
} else if (!isMainAxisRow && isColumnStyleDimDefined) {
|
|
1264
|
-
// The height is definite, so use that as the flex basis.
|
|
1265
|
-
const YGFloatOptional paddingAndBorder =
|
|
1266
|
-
YGFloatOptional(YGNodePaddingAndBorderForAxis(
|
|
1267
|
-
child, YGFlexDirectionColumn, ownerWidth));
|
|
1268
|
-
child->setLayoutComputedFlexBasis(YGFloatOptionalMax(
|
|
1269
|
-
YGResolveValue(
|
|
1270
|
-
child->getResolvedDimensions()[YGDimensionHeight], ownerHeight),
|
|
1271
|
-
paddingAndBorder));
|
|
1272
|
-
} else {
|
|
1273
|
-
// Compute the flex basis and hypothetical main size (i.e. the clamped flex
|
|
1274
|
-
// basis).
|
|
1275
|
-
childWidth = YGUndefined;
|
|
1276
|
-
childHeight = YGUndefined;
|
|
1277
|
-
childWidthMeasureMode = YGMeasureModeUndefined;
|
|
1278
|
-
childHeightMeasureMode = YGMeasureModeUndefined;
|
|
1279
|
-
|
|
1280
|
-
auto marginRow =
|
|
1281
|
-
child->getMarginForAxis(YGFlexDirectionRow, ownerWidth).unwrap();
|
|
1282
|
-
auto marginColumn =
|
|
1283
|
-
child->getMarginForAxis(YGFlexDirectionColumn, ownerWidth).unwrap();
|
|
1284
|
-
|
|
1285
|
-
if (isRowStyleDimDefined) {
|
|
1286
|
-
childWidth =
|
|
1287
|
-
YGResolveValue(
|
|
1288
|
-
child->getResolvedDimensions()[YGDimensionWidth], ownerWidth)
|
|
1289
|
-
.unwrap() +
|
|
1290
|
-
marginRow;
|
|
1291
|
-
childWidthMeasureMode = YGMeasureModeExactly;
|
|
1292
|
-
}
|
|
1293
|
-
if (isColumnStyleDimDefined) {
|
|
1294
|
-
childHeight =
|
|
1295
|
-
YGResolveValue(
|
|
1296
|
-
child->getResolvedDimensions()[YGDimensionHeight], ownerHeight)
|
|
1297
|
-
.unwrap() +
|
|
1298
|
-
marginColumn;
|
|
1299
|
-
childHeightMeasureMode = YGMeasureModeExactly;
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
// The W3C spec doesn't say anything about the 'overflow' property, but all
|
|
1303
|
-
// major browsers appear to implement the following logic.
|
|
1304
|
-
if ((!isMainAxisRow && node->getStyle().overflow() == YGOverflowScroll) ||
|
|
1305
|
-
node->getStyle().overflow() != YGOverflowScroll) {
|
|
1306
|
-
if (YGFloatIsUndefined(childWidth) && !YGFloatIsUndefined(width)) {
|
|
1307
|
-
childWidth = width;
|
|
1308
|
-
childWidthMeasureMode = YGMeasureModeAtMost;
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
if ((isMainAxisRow && node->getStyle().overflow() == YGOverflowScroll) ||
|
|
1313
|
-
node->getStyle().overflow() != YGOverflowScroll) {
|
|
1314
|
-
if (YGFloatIsUndefined(childHeight) && !YGFloatIsUndefined(height)) {
|
|
1315
|
-
childHeight = height;
|
|
1316
|
-
childHeightMeasureMode = YGMeasureModeAtMost;
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
|
|
1320
|
-
const auto& childStyle = child->getStyle();
|
|
1321
|
-
if (!childStyle.aspectRatio().isUndefined()) {
|
|
1322
|
-
if (!isMainAxisRow && childWidthMeasureMode == YGMeasureModeExactly) {
|
|
1323
|
-
childHeight = marginColumn +
|
|
1324
|
-
(childWidth - marginRow) / childStyle.aspectRatio().unwrap();
|
|
1325
|
-
childHeightMeasureMode = YGMeasureModeExactly;
|
|
1326
|
-
} else if (
|
|
1327
|
-
isMainAxisRow && childHeightMeasureMode == YGMeasureModeExactly) {
|
|
1328
|
-
childWidth = marginRow +
|
|
1329
|
-
(childHeight - marginColumn) * childStyle.aspectRatio().unwrap();
|
|
1330
|
-
childWidthMeasureMode = YGMeasureModeExactly;
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
// If child has no defined size in the cross axis and is set to stretch, set
|
|
1335
|
-
// the cross axis to be measured exactly with the available inner width
|
|
1336
|
-
|
|
1337
|
-
const bool hasExactWidth =
|
|
1338
|
-
!YGFloatIsUndefined(width) && widthMode == YGMeasureModeExactly;
|
|
1339
|
-
const bool childWidthStretch =
|
|
1340
|
-
YGNodeAlignItem(node, child) == YGAlignStretch &&
|
|
1341
|
-
childWidthMeasureMode != YGMeasureModeExactly;
|
|
1342
|
-
if (!isMainAxisRow && !isRowStyleDimDefined && hasExactWidth &&
|
|
1343
|
-
childWidthStretch) {
|
|
1344
|
-
childWidth = width;
|
|
1345
|
-
childWidthMeasureMode = YGMeasureModeExactly;
|
|
1346
|
-
if (!childStyle.aspectRatio().isUndefined()) {
|
|
1347
|
-
childHeight =
|
|
1348
|
-
(childWidth - marginRow) / childStyle.aspectRatio().unwrap();
|
|
1349
|
-
childHeightMeasureMode = YGMeasureModeExactly;
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
const bool hasExactHeight =
|
|
1354
|
-
!YGFloatIsUndefined(height) && heightMode == YGMeasureModeExactly;
|
|
1355
|
-
const bool childHeightStretch =
|
|
1356
|
-
YGNodeAlignItem(node, child) == YGAlignStretch &&
|
|
1357
|
-
childHeightMeasureMode != YGMeasureModeExactly;
|
|
1358
|
-
if (isMainAxisRow && !isColumnStyleDimDefined && hasExactHeight &&
|
|
1359
|
-
childHeightStretch) {
|
|
1360
|
-
childHeight = height;
|
|
1361
|
-
childHeightMeasureMode = YGMeasureModeExactly;
|
|
1362
|
-
|
|
1363
|
-
if (!childStyle.aspectRatio().isUndefined()) {
|
|
1364
|
-
childWidth =
|
|
1365
|
-
(childHeight - marginColumn) * childStyle.aspectRatio().unwrap();
|
|
1366
|
-
childWidthMeasureMode = YGMeasureModeExactly;
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
YGConstrainMaxSizeForMode(
|
|
1371
|
-
child,
|
|
1372
|
-
YGFlexDirectionRow,
|
|
1373
|
-
ownerWidth,
|
|
1374
|
-
ownerWidth,
|
|
1375
|
-
&childWidthMeasureMode,
|
|
1376
|
-
&childWidth);
|
|
1377
|
-
YGConstrainMaxSizeForMode(
|
|
1378
|
-
child,
|
|
1379
|
-
YGFlexDirectionColumn,
|
|
1380
|
-
ownerHeight,
|
|
1381
|
-
ownerWidth,
|
|
1382
|
-
&childHeightMeasureMode,
|
|
1383
|
-
&childHeight);
|
|
1384
|
-
|
|
1385
|
-
// Measure the child
|
|
1386
|
-
YGLayoutNodeInternal(
|
|
1387
|
-
child,
|
|
1388
|
-
childWidth,
|
|
1389
|
-
childHeight,
|
|
1390
|
-
direction,
|
|
1391
|
-
childWidthMeasureMode,
|
|
1392
|
-
childHeightMeasureMode,
|
|
1393
|
-
ownerWidth,
|
|
1394
|
-
ownerHeight,
|
|
1395
|
-
false,
|
|
1396
|
-
LayoutPassReason::kMeasureChild,
|
|
1397
|
-
config,
|
|
1398
|
-
layoutMarkerData,
|
|
1399
|
-
layoutContext,
|
|
1400
|
-
depth,
|
|
1401
|
-
generationCount);
|
|
1402
|
-
|
|
1403
|
-
child->setLayoutComputedFlexBasis(YGFloatOptional(YGFloatMax(
|
|
1404
|
-
child->getLayout().measuredDimensions[dim[mainAxis]],
|
|
1405
|
-
YGNodePaddingAndBorderForAxis(child, mainAxis, ownerWidth))));
|
|
1406
|
-
}
|
|
1407
|
-
child->setLayoutComputedFlexBasisGeneration(generationCount);
|
|
754
|
+
YGValue YGNodeStyleGetMaxHeight(const YGNodeConstRef node) {
|
|
755
|
+
return resolveRef(node)->getStyle().maxDimension(YGDimensionHeight);
|
|
1408
756
|
}
|
|
1409
757
|
|
|
1410
|
-
|
|
1411
|
-
const YGNodeRef node,
|
|
1412
|
-
const YGNodeRef child,
|
|
1413
|
-
const float width,
|
|
1414
|
-
const YGMeasureMode widthMode,
|
|
1415
|
-
const float height,
|
|
1416
|
-
const YGDirection direction,
|
|
1417
|
-
const YGConfigRef config,
|
|
1418
|
-
LayoutData& layoutMarkerData,
|
|
1419
|
-
void* const layoutContext,
|
|
1420
|
-
const uint32_t depth,
|
|
1421
|
-
const uint32_t generationCount) {
|
|
1422
|
-
const YGFlexDirection mainAxis =
|
|
1423
|
-
YGResolveFlexDirection(node->getStyle().flexDirection(), direction);
|
|
1424
|
-
const YGFlexDirection crossAxis = YGFlexDirectionCross(mainAxis, direction);
|
|
1425
|
-
const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis);
|
|
1426
|
-
|
|
1427
|
-
float childWidth = YGUndefined;
|
|
1428
|
-
float childHeight = YGUndefined;
|
|
1429
|
-
YGMeasureMode childWidthMeasureMode = YGMeasureModeUndefined;
|
|
1430
|
-
YGMeasureMode childHeightMeasureMode = YGMeasureModeUndefined;
|
|
1431
|
-
|
|
1432
|
-
auto marginRow = child->getMarginForAxis(YGFlexDirectionRow, width).unwrap();
|
|
1433
|
-
auto marginColumn =
|
|
1434
|
-
child->getMarginForAxis(YGFlexDirectionColumn, width).unwrap();
|
|
1435
|
-
|
|
1436
|
-
if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, width)) {
|
|
1437
|
-
childWidth =
|
|
1438
|
-
YGResolveValue(child->getResolvedDimensions()[YGDimensionWidth], width)
|
|
1439
|
-
.unwrap() +
|
|
1440
|
-
marginRow;
|
|
1441
|
-
} else {
|
|
1442
|
-
// If the child doesn't have a specified width, compute the width based on
|
|
1443
|
-
// the left/right offsets if they're defined.
|
|
1444
|
-
if (child->isLeadingPositionDefined(YGFlexDirectionRow) &&
|
|
1445
|
-
child->isTrailingPosDefined(YGFlexDirectionRow)) {
|
|
1446
|
-
childWidth = node->getLayout().measuredDimensions[YGDimensionWidth] -
|
|
1447
|
-
(node->getLeadingBorder(YGFlexDirectionRow) +
|
|
1448
|
-
node->getTrailingBorder(YGFlexDirectionRow)) -
|
|
1449
|
-
(child->getLeadingPosition(YGFlexDirectionRow, width) +
|
|
1450
|
-
child->getTrailingPosition(YGFlexDirectionRow, width))
|
|
1451
|
-
.unwrap();
|
|
1452
|
-
childWidth =
|
|
1453
|
-
YGNodeBoundAxis(child, YGFlexDirectionRow, childWidth, width, width);
|
|
1454
|
-
}
|
|
1455
|
-
}
|
|
758
|
+
namespace {
|
|
1456
759
|
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
child->isTrailingPosDefined(YGFlexDirectionColumn)) {
|
|
1467
|
-
childHeight = node->getLayout().measuredDimensions[YGDimensionHeight] -
|
|
1468
|
-
(node->getLeadingBorder(YGFlexDirectionColumn) +
|
|
1469
|
-
node->getTrailingBorder(YGFlexDirectionColumn)) -
|
|
1470
|
-
(child->getLeadingPosition(YGFlexDirectionColumn, height) +
|
|
1471
|
-
child->getTrailingPosition(YGFlexDirectionColumn, height))
|
|
1472
|
-
.unwrap();
|
|
1473
|
-
childHeight = YGNodeBoundAxis(
|
|
1474
|
-
child, YGFlexDirectionColumn, childHeight, height, width);
|
|
1475
|
-
}
|
|
1476
|
-
}
|
|
760
|
+
template <auto LayoutMember>
|
|
761
|
+
float getResolvedLayoutProperty(
|
|
762
|
+
const YGNodeConstRef nodeRef,
|
|
763
|
+
const YGEdge edge) {
|
|
764
|
+
const auto node = resolveRef(nodeRef);
|
|
765
|
+
yoga::assertFatalWithNode(
|
|
766
|
+
node,
|
|
767
|
+
edge <= YGEdgeEnd,
|
|
768
|
+
"Cannot get layout properties of multi-edge shorthands");
|
|
1477
769
|
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
if (!childStyle.aspectRatio().isUndefined()) {
|
|
1484
|
-
if (YGFloatIsUndefined(childWidth)) {
|
|
1485
|
-
childWidth = marginRow +
|
|
1486
|
-
(childHeight - marginColumn) * childStyle.aspectRatio().unwrap();
|
|
1487
|
-
} else if (YGFloatIsUndefined(childHeight)) {
|
|
1488
|
-
childHeight = marginColumn +
|
|
1489
|
-
(childWidth - marginRow) / childStyle.aspectRatio().unwrap();
|
|
1490
|
-
}
|
|
770
|
+
if (edge == YGEdgeStart) {
|
|
771
|
+
if (node->getLayout().direction() == Direction::RTL) {
|
|
772
|
+
return (node->getLayout().*LayoutMember)[YGEdgeRight];
|
|
773
|
+
} else {
|
|
774
|
+
return (node->getLayout().*LayoutMember)[YGEdgeLeft];
|
|
1491
775
|
}
|
|
1492
776
|
}
|
|
1493
777
|
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
childHeightMeasureMode = YGFloatIsUndefined(childHeight)
|
|
1500
|
-
? YGMeasureModeUndefined
|
|
1501
|
-
: YGMeasureModeExactly;
|
|
1502
|
-
|
|
1503
|
-
// If the size of the owner is defined then try to constrain the absolute
|
|
1504
|
-
// child to that size as well. This allows text within the absolute child to
|
|
1505
|
-
// wrap to the size of its owner. This is the same behavior as many browsers
|
|
1506
|
-
// implement.
|
|
1507
|
-
if (!isMainAxisRow && YGFloatIsUndefined(childWidth) &&
|
|
1508
|
-
widthMode != YGMeasureModeUndefined && !YGFloatIsUndefined(width) &&
|
|
1509
|
-
width > 0) {
|
|
1510
|
-
childWidth = width;
|
|
1511
|
-
childWidthMeasureMode = YGMeasureModeAtMost;
|
|
778
|
+
if (edge == YGEdgeEnd) {
|
|
779
|
+
if (node->getLayout().direction() == Direction::RTL) {
|
|
780
|
+
return (node->getLayout().*LayoutMember)[YGEdgeLeft];
|
|
781
|
+
} else {
|
|
782
|
+
return (node->getLayout().*LayoutMember)[YGEdgeRight];
|
|
1512
783
|
}
|
|
1513
|
-
|
|
1514
|
-
YGLayoutNodeInternal(
|
|
1515
|
-
child,
|
|
1516
|
-
childWidth,
|
|
1517
|
-
childHeight,
|
|
1518
|
-
direction,
|
|
1519
|
-
childWidthMeasureMode,
|
|
1520
|
-
childHeightMeasureMode,
|
|
1521
|
-
childWidth,
|
|
1522
|
-
childHeight,
|
|
1523
|
-
false,
|
|
1524
|
-
LayoutPassReason::kAbsMeasureChild,
|
|
1525
|
-
config,
|
|
1526
|
-
layoutMarkerData,
|
|
1527
|
-
layoutContext,
|
|
1528
|
-
depth,
|
|
1529
|
-
generationCount);
|
|
1530
|
-
childWidth = child->getLayout().measuredDimensions[YGDimensionWidth] +
|
|
1531
|
-
child->getMarginForAxis(YGFlexDirectionRow, width).unwrap();
|
|
1532
|
-
childHeight = child->getLayout().measuredDimensions[YGDimensionHeight] +
|
|
1533
|
-
child->getMarginForAxis(YGFlexDirectionColumn, width).unwrap();
|
|
1534
|
-
}
|
|
1535
|
-
|
|
1536
|
-
YGLayoutNodeInternal(
|
|
1537
|
-
child,
|
|
1538
|
-
childWidth,
|
|
1539
|
-
childHeight,
|
|
1540
|
-
direction,
|
|
1541
|
-
YGMeasureModeExactly,
|
|
1542
|
-
YGMeasureModeExactly,
|
|
1543
|
-
childWidth,
|
|
1544
|
-
childHeight,
|
|
1545
|
-
true,
|
|
1546
|
-
LayoutPassReason::kAbsLayout,
|
|
1547
|
-
config,
|
|
1548
|
-
layoutMarkerData,
|
|
1549
|
-
layoutContext,
|
|
1550
|
-
depth,
|
|
1551
|
-
generationCount);
|
|
1552
|
-
|
|
1553
|
-
auto trailingMarginOuterSize =
|
|
1554
|
-
YGConfigIsExperimentalFeatureEnabled(
|
|
1555
|
-
node->getConfig(),
|
|
1556
|
-
YGExperimentalFeatureFixAbsoluteTrailingColumnMargin)
|
|
1557
|
-
? isMainAxisRow ? height : width
|
|
1558
|
-
: width;
|
|
1559
|
-
|
|
1560
|
-
if (child->isTrailingPosDefined(mainAxis) &&
|
|
1561
|
-
!child->isLeadingPositionDefined(mainAxis)) {
|
|
1562
|
-
child->setLayoutPosition(
|
|
1563
|
-
node->getLayout().measuredDimensions[dim[mainAxis]] -
|
|
1564
|
-
child->getLayout().measuredDimensions[dim[mainAxis]] -
|
|
1565
|
-
node->getTrailingBorder(mainAxis) -
|
|
1566
|
-
child->getTrailingMargin(mainAxis, trailingMarginOuterSize)
|
|
1567
|
-
.unwrap() -
|
|
1568
|
-
child->getTrailingPosition(mainAxis, isMainAxisRow ? width : height)
|
|
1569
|
-
.unwrap(),
|
|
1570
|
-
leading[mainAxis]);
|
|
1571
|
-
} else if (
|
|
1572
|
-
!child->isLeadingPositionDefined(mainAxis) &&
|
|
1573
|
-
node->getStyle().justifyContent() == YGJustifyCenter) {
|
|
1574
|
-
child->setLayoutPosition(
|
|
1575
|
-
(node->getLayout().measuredDimensions[dim[mainAxis]] -
|
|
1576
|
-
child->getLayout().measuredDimensions[dim[mainAxis]]) /
|
|
1577
|
-
2.0f,
|
|
1578
|
-
leading[mainAxis]);
|
|
1579
|
-
} else if (
|
|
1580
|
-
!child->isLeadingPositionDefined(mainAxis) &&
|
|
1581
|
-
node->getStyle().justifyContent() == YGJustifyFlexEnd) {
|
|
1582
|
-
child->setLayoutPosition(
|
|
1583
|
-
(node->getLayout().measuredDimensions[dim[mainAxis]] -
|
|
1584
|
-
child->getLayout().measuredDimensions[dim[mainAxis]]),
|
|
1585
|
-
leading[mainAxis]);
|
|
1586
|
-
} else if (
|
|
1587
|
-
YGConfigIsExperimentalFeatureEnabled(
|
|
1588
|
-
node->getConfig(),
|
|
1589
|
-
YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge) &&
|
|
1590
|
-
child->isLeadingPositionDefined(mainAxis)) {
|
|
1591
|
-
child->setLayoutPosition(
|
|
1592
|
-
child->getLeadingPosition(
|
|
1593
|
-
mainAxis, node->getLayout().measuredDimensions[dim[mainAxis]])
|
|
1594
|
-
.unwrap() +
|
|
1595
|
-
node->getLeadingBorder(mainAxis) +
|
|
1596
|
-
child
|
|
1597
|
-
->getLeadingMargin(
|
|
1598
|
-
mainAxis,
|
|
1599
|
-
node->getLayout().measuredDimensions[dim[mainAxis]])
|
|
1600
|
-
.unwrap(),
|
|
1601
|
-
leading[mainAxis]);
|
|
1602
784
|
}
|
|
1603
785
|
|
|
1604
|
-
|
|
1605
|
-
!child->isLeadingPositionDefined(crossAxis)) {
|
|
1606
|
-
child->setLayoutPosition(
|
|
1607
|
-
node->getLayout().measuredDimensions[dim[crossAxis]] -
|
|
1608
|
-
child->getLayout().measuredDimensions[dim[crossAxis]] -
|
|
1609
|
-
node->getTrailingBorder(crossAxis) -
|
|
1610
|
-
child->getTrailingMargin(crossAxis, trailingMarginOuterSize)
|
|
1611
|
-
.unwrap() -
|
|
1612
|
-
child
|
|
1613
|
-
->getTrailingPosition(crossAxis, isMainAxisRow ? height : width)
|
|
1614
|
-
.unwrap(),
|
|
1615
|
-
leading[crossAxis]);
|
|
1616
|
-
|
|
1617
|
-
} else if (
|
|
1618
|
-
!child->isLeadingPositionDefined(crossAxis) &&
|
|
1619
|
-
YGNodeAlignItem(node, child) == YGAlignCenter) {
|
|
1620
|
-
child->setLayoutPosition(
|
|
1621
|
-
(node->getLayout().measuredDimensions[dim[crossAxis]] -
|
|
1622
|
-
child->getLayout().measuredDimensions[dim[crossAxis]]) /
|
|
1623
|
-
2.0f,
|
|
1624
|
-
leading[crossAxis]);
|
|
1625
|
-
} else if (
|
|
1626
|
-
!child->isLeadingPositionDefined(crossAxis) &&
|
|
1627
|
-
((YGNodeAlignItem(node, child) == YGAlignFlexEnd) ^
|
|
1628
|
-
(node->getStyle().flexWrap() == YGWrapWrapReverse))) {
|
|
1629
|
-
child->setLayoutPosition(
|
|
1630
|
-
(node->getLayout().measuredDimensions[dim[crossAxis]] -
|
|
1631
|
-
child->getLayout().measuredDimensions[dim[crossAxis]]),
|
|
1632
|
-
leading[crossAxis]);
|
|
1633
|
-
} else if (
|
|
1634
|
-
YGConfigIsExperimentalFeatureEnabled(
|
|
1635
|
-
node->getConfig(),
|
|
1636
|
-
YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge) &&
|
|
1637
|
-
child->isLeadingPositionDefined(crossAxis)) {
|
|
1638
|
-
child->setLayoutPosition(
|
|
1639
|
-
child->getLeadingPosition(
|
|
1640
|
-
crossAxis,
|
|
1641
|
-
node->getLayout().measuredDimensions[dim[crossAxis]])
|
|
1642
|
-
.unwrap() +
|
|
1643
|
-
node->getLeadingBorder(crossAxis) +
|
|
1644
|
-
child
|
|
1645
|
-
->getLeadingMargin(
|
|
1646
|
-
crossAxis,
|
|
1647
|
-
node->getLayout().measuredDimensions[dim[crossAxis]])
|
|
1648
|
-
.unwrap(),
|
|
1649
|
-
leading[crossAxis]);
|
|
1650
|
-
}
|
|
786
|
+
return (node->getLayout().*LayoutMember)[edge];
|
|
1651
787
|
}
|
|
1652
788
|
|
|
1653
|
-
|
|
1654
|
-
const YGNodeRef node,
|
|
1655
|
-
float availableWidth,
|
|
1656
|
-
float availableHeight,
|
|
1657
|
-
const YGMeasureMode widthMeasureMode,
|
|
1658
|
-
const YGMeasureMode heightMeasureMode,
|
|
1659
|
-
const float ownerWidth,
|
|
1660
|
-
const float ownerHeight,
|
|
1661
|
-
LayoutData& layoutMarkerData,
|
|
1662
|
-
void* const layoutContext,
|
|
1663
|
-
const LayoutPassReason reason) {
|
|
1664
|
-
YGAssertWithNode(
|
|
1665
|
-
node,
|
|
1666
|
-
node->hasMeasureFunc(),
|
|
1667
|
-
"Expected node to have custom measure function");
|
|
1668
|
-
|
|
1669
|
-
if (widthMeasureMode == YGMeasureModeUndefined) {
|
|
1670
|
-
availableWidth = YGUndefined;
|
|
1671
|
-
}
|
|
1672
|
-
if (heightMeasureMode == YGMeasureModeUndefined) {
|
|
1673
|
-
availableHeight = YGUndefined;
|
|
1674
|
-
}
|
|
789
|
+
} // namespace
|
|
1675
790
|
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
const float paddingAndBorderAxisRow = padding[YGEdgeLeft] +
|
|
1679
|
-
padding[YGEdgeRight] + border[YGEdgeLeft] + border[YGEdgeRight];
|
|
1680
|
-
const float paddingAndBorderAxisColumn = padding[YGEdgeTop] +
|
|
1681
|
-
padding[YGEdgeBottom] + border[YGEdgeTop] + border[YGEdgeBottom];
|
|
1682
|
-
|
|
1683
|
-
// We want to make sure we don't call measure with negative size
|
|
1684
|
-
const float innerWidth = YGFloatIsUndefined(availableWidth)
|
|
1685
|
-
? availableWidth
|
|
1686
|
-
: YGFloatMax(0, availableWidth - paddingAndBorderAxisRow);
|
|
1687
|
-
const float innerHeight = YGFloatIsUndefined(availableHeight)
|
|
1688
|
-
? availableHeight
|
|
1689
|
-
: YGFloatMax(0, availableHeight - paddingAndBorderAxisColumn);
|
|
1690
|
-
|
|
1691
|
-
if (widthMeasureMode == YGMeasureModeExactly &&
|
|
1692
|
-
heightMeasureMode == YGMeasureModeExactly) {
|
|
1693
|
-
// Don't bother sizing the text if both dimensions are already defined.
|
|
1694
|
-
node->setLayoutMeasuredDimension(
|
|
1695
|
-
YGNodeBoundAxis(
|
|
1696
|
-
node, YGFlexDirectionRow, availableWidth, ownerWidth, ownerWidth),
|
|
1697
|
-
YGDimensionWidth);
|
|
1698
|
-
node->setLayoutMeasuredDimension(
|
|
1699
|
-
YGNodeBoundAxis(
|
|
1700
|
-
node,
|
|
1701
|
-
YGFlexDirectionColumn,
|
|
1702
|
-
availableHeight,
|
|
1703
|
-
ownerHeight,
|
|
1704
|
-
ownerWidth),
|
|
1705
|
-
YGDimensionHeight);
|
|
1706
|
-
} else {
|
|
1707
|
-
Event::publish<Event::MeasureCallbackStart>(node);
|
|
1708
|
-
|
|
1709
|
-
// Measure the text under the current constraints.
|
|
1710
|
-
const YGSize measuredSize = node->measure(
|
|
1711
|
-
innerWidth,
|
|
1712
|
-
widthMeasureMode,
|
|
1713
|
-
innerHeight,
|
|
1714
|
-
heightMeasureMode,
|
|
1715
|
-
layoutContext);
|
|
1716
|
-
|
|
1717
|
-
layoutMarkerData.measureCallbacks += 1;
|
|
1718
|
-
layoutMarkerData.measureCallbackReasonsCount[static_cast<size_t>(reason)] +=
|
|
1719
|
-
1;
|
|
1720
|
-
|
|
1721
|
-
Event::publish<Event::MeasureCallbackEnd>(
|
|
1722
|
-
node,
|
|
1723
|
-
{layoutContext,
|
|
1724
|
-
innerWidth,
|
|
1725
|
-
widthMeasureMode,
|
|
1726
|
-
innerHeight,
|
|
1727
|
-
heightMeasureMode,
|
|
1728
|
-
measuredSize.width,
|
|
1729
|
-
measuredSize.height,
|
|
1730
|
-
reason});
|
|
1731
|
-
|
|
1732
|
-
node->setLayoutMeasuredDimension(
|
|
1733
|
-
YGNodeBoundAxis(
|
|
1734
|
-
node,
|
|
1735
|
-
YGFlexDirectionRow,
|
|
1736
|
-
(widthMeasureMode == YGMeasureModeUndefined ||
|
|
1737
|
-
widthMeasureMode == YGMeasureModeAtMost)
|
|
1738
|
-
? measuredSize.width + paddingAndBorderAxisRow
|
|
1739
|
-
: availableWidth,
|
|
1740
|
-
ownerWidth,
|
|
1741
|
-
ownerWidth),
|
|
1742
|
-
YGDimensionWidth);
|
|
1743
|
-
|
|
1744
|
-
node->setLayoutMeasuredDimension(
|
|
1745
|
-
YGNodeBoundAxis(
|
|
1746
|
-
node,
|
|
1747
|
-
YGFlexDirectionColumn,
|
|
1748
|
-
(heightMeasureMode == YGMeasureModeUndefined ||
|
|
1749
|
-
heightMeasureMode == YGMeasureModeAtMost)
|
|
1750
|
-
? measuredSize.height + paddingAndBorderAxisColumn
|
|
1751
|
-
: availableHeight,
|
|
1752
|
-
ownerHeight,
|
|
1753
|
-
ownerWidth),
|
|
1754
|
-
YGDimensionHeight);
|
|
1755
|
-
}
|
|
791
|
+
float YGNodeLayoutGetLeft(const YGNodeConstRef node) {
|
|
792
|
+
return resolveRef(node)->getLayout().position[YGEdgeLeft];
|
|
1756
793
|
}
|
|
1757
794
|
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
static void YGNodeEmptyContainerSetMeasuredDimensions(
|
|
1761
|
-
const YGNodeRef node,
|
|
1762
|
-
const float availableWidth,
|
|
1763
|
-
const float availableHeight,
|
|
1764
|
-
const YGMeasureMode widthMeasureMode,
|
|
1765
|
-
const YGMeasureMode heightMeasureMode,
|
|
1766
|
-
const float ownerWidth,
|
|
1767
|
-
const float ownerHeight) {
|
|
1768
|
-
const auto& padding = node->getLayout().padding;
|
|
1769
|
-
const auto& border = node->getLayout().border;
|
|
1770
|
-
|
|
1771
|
-
float width = availableWidth;
|
|
1772
|
-
if (widthMeasureMode == YGMeasureModeUndefined ||
|
|
1773
|
-
widthMeasureMode == YGMeasureModeAtMost) {
|
|
1774
|
-
width = padding[YGEdgeLeft] + padding[YGEdgeRight] + border[YGEdgeLeft] +
|
|
1775
|
-
border[YGEdgeRight];
|
|
1776
|
-
}
|
|
1777
|
-
node->setLayoutMeasuredDimension(
|
|
1778
|
-
YGNodeBoundAxis(node, YGFlexDirectionRow, width, ownerWidth, ownerWidth),
|
|
1779
|
-
YGDimensionWidth);
|
|
1780
|
-
|
|
1781
|
-
float height = availableHeight;
|
|
1782
|
-
if (heightMeasureMode == YGMeasureModeUndefined ||
|
|
1783
|
-
heightMeasureMode == YGMeasureModeAtMost) {
|
|
1784
|
-
height = padding[YGEdgeTop] + padding[YGEdgeBottom] + border[YGEdgeTop] +
|
|
1785
|
-
border[YGEdgeBottom];
|
|
1786
|
-
}
|
|
1787
|
-
node->setLayoutMeasuredDimension(
|
|
1788
|
-
YGNodeBoundAxis(
|
|
1789
|
-
node, YGFlexDirectionColumn, height, ownerHeight, ownerWidth),
|
|
1790
|
-
YGDimensionHeight);
|
|
795
|
+
float YGNodeLayoutGetTop(const YGNodeConstRef node) {
|
|
796
|
+
return resolveRef(node)->getLayout().position[YGEdgeTop];
|
|
1791
797
|
}
|
|
1792
798
|
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
const float availableWidth,
|
|
1796
|
-
const float availableHeight,
|
|
1797
|
-
const YGMeasureMode widthMeasureMode,
|
|
1798
|
-
const YGMeasureMode heightMeasureMode,
|
|
1799
|
-
const float ownerWidth,
|
|
1800
|
-
const float ownerHeight) {
|
|
1801
|
-
if ((!YGFloatIsUndefined(availableWidth) &&
|
|
1802
|
-
widthMeasureMode == YGMeasureModeAtMost && availableWidth <= 0.0f) ||
|
|
1803
|
-
(!YGFloatIsUndefined(availableHeight) &&
|
|
1804
|
-
heightMeasureMode == YGMeasureModeAtMost && availableHeight <= 0.0f) ||
|
|
1805
|
-
(widthMeasureMode == YGMeasureModeExactly &&
|
|
1806
|
-
heightMeasureMode == YGMeasureModeExactly)) {
|
|
1807
|
-
node->setLayoutMeasuredDimension(
|
|
1808
|
-
YGNodeBoundAxis(
|
|
1809
|
-
node,
|
|
1810
|
-
YGFlexDirectionRow,
|
|
1811
|
-
YGFloatIsUndefined(availableWidth) ||
|
|
1812
|
-
(widthMeasureMode == YGMeasureModeAtMost &&
|
|
1813
|
-
availableWidth < 0.0f)
|
|
1814
|
-
? 0.0f
|
|
1815
|
-
: availableWidth,
|
|
1816
|
-
ownerWidth,
|
|
1817
|
-
ownerWidth),
|
|
1818
|
-
YGDimensionWidth);
|
|
1819
|
-
|
|
1820
|
-
node->setLayoutMeasuredDimension(
|
|
1821
|
-
YGNodeBoundAxis(
|
|
1822
|
-
node,
|
|
1823
|
-
YGFlexDirectionColumn,
|
|
1824
|
-
YGFloatIsUndefined(availableHeight) ||
|
|
1825
|
-
(heightMeasureMode == YGMeasureModeAtMost &&
|
|
1826
|
-
availableHeight < 0.0f)
|
|
1827
|
-
? 0.0f
|
|
1828
|
-
: availableHeight,
|
|
1829
|
-
ownerHeight,
|
|
1830
|
-
ownerWidth),
|
|
1831
|
-
YGDimensionHeight);
|
|
1832
|
-
return true;
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
return false;
|
|
799
|
+
float YGNodeLayoutGetRight(const YGNodeConstRef node) {
|
|
800
|
+
return resolveRef(node)->getLayout().position[YGEdgeRight];
|
|
1836
801
|
}
|
|
1837
802
|
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
void* layoutContext) {
|
|
1841
|
-
node->getLayout() = {};
|
|
1842
|
-
node->setLayoutDimension(0, 0);
|
|
1843
|
-
node->setLayoutDimension(0, 1);
|
|
1844
|
-
node->setHasNewLayout(true);
|
|
1845
|
-
|
|
1846
|
-
node->iterChildrenAfterCloningIfNeeded(
|
|
1847
|
-
YGZeroOutLayoutRecursivly, layoutContext);
|
|
1848
|
-
}
|
|
1849
|
-
|
|
1850
|
-
static float YGNodeCalculateAvailableInnerDim(
|
|
1851
|
-
const YGNodeConstRef node,
|
|
1852
|
-
const YGDimension dimension,
|
|
1853
|
-
const float availableDim,
|
|
1854
|
-
const float paddingAndBorder,
|
|
1855
|
-
const float ownerDim) {
|
|
1856
|
-
float availableInnerDim = availableDim - paddingAndBorder;
|
|
1857
|
-
// Max dimension overrides predefined dimension value; Min dimension in turn
|
|
1858
|
-
// overrides both of the above
|
|
1859
|
-
if (!YGFloatIsUndefined(availableInnerDim)) {
|
|
1860
|
-
// We want to make sure our available height does not violate min and max
|
|
1861
|
-
// constraints
|
|
1862
|
-
const YGFloatOptional minDimensionOptional =
|
|
1863
|
-
YGResolveValue(node->getStyle().minDimensions()[dimension], ownerDim);
|
|
1864
|
-
const float minInnerDim = minDimensionOptional.isUndefined()
|
|
1865
|
-
? 0.0f
|
|
1866
|
-
: minDimensionOptional.unwrap() - paddingAndBorder;
|
|
1867
|
-
|
|
1868
|
-
const YGFloatOptional maxDimensionOptional =
|
|
1869
|
-
YGResolveValue(node->getStyle().maxDimensions()[dimension], ownerDim);
|
|
1870
|
-
|
|
1871
|
-
const float maxInnerDim = maxDimensionOptional.isUndefined()
|
|
1872
|
-
? FLT_MAX
|
|
1873
|
-
: maxDimensionOptional.unwrap() - paddingAndBorder;
|
|
1874
|
-
availableInnerDim =
|
|
1875
|
-
YGFloatMax(YGFloatMin(availableInnerDim, maxInnerDim), minInnerDim);
|
|
1876
|
-
}
|
|
1877
|
-
|
|
1878
|
-
return availableInnerDim;
|
|
803
|
+
float YGNodeLayoutGetBottom(const YGNodeConstRef node) {
|
|
804
|
+
return resolveRef(node)->getLayout().position[YGEdgeBottom];
|
|
1879
805
|
}
|
|
1880
806
|
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
const float availableInnerWidth,
|
|
1884
|
-
const float availableInnerHeight,
|
|
1885
|
-
YGMeasureMode widthMeasureMode,
|
|
1886
|
-
YGMeasureMode heightMeasureMode,
|
|
1887
|
-
YGDirection direction,
|
|
1888
|
-
YGFlexDirection mainAxis,
|
|
1889
|
-
const YGConfigRef config,
|
|
1890
|
-
bool performLayout,
|
|
1891
|
-
LayoutData& layoutMarkerData,
|
|
1892
|
-
void* const layoutContext,
|
|
1893
|
-
const uint32_t depth,
|
|
1894
|
-
const uint32_t generationCount) {
|
|
1895
|
-
float totalOuterFlexBasis = 0.0f;
|
|
1896
|
-
YGNodeRef singleFlexChild = nullptr;
|
|
1897
|
-
const YGVector& children = node->getChildren();
|
|
1898
|
-
YGMeasureMode measureModeMainDim =
|
|
1899
|
-
YGFlexDirectionIsRow(mainAxis) ? widthMeasureMode : heightMeasureMode;
|
|
1900
|
-
// If there is only one child with flexGrow + flexShrink it means we can set
|
|
1901
|
-
// the computedFlexBasis to 0 instead of measuring and shrinking / flexing the
|
|
1902
|
-
// child to exactly match the remaining space
|
|
1903
|
-
if (measureModeMainDim == YGMeasureModeExactly) {
|
|
1904
|
-
for (auto child : children) {
|
|
1905
|
-
if (child->isNodeFlexible()) {
|
|
1906
|
-
if (singleFlexChild != nullptr ||
|
|
1907
|
-
YGFloatsEqual(child->resolveFlexGrow(), 0.0f) ||
|
|
1908
|
-
YGFloatsEqual(child->resolveFlexShrink(), 0.0f)) {
|
|
1909
|
-
// There is already a flexible child, or this flexible child doesn't
|
|
1910
|
-
// have flexGrow and flexShrink, abort
|
|
1911
|
-
singleFlexChild = nullptr;
|
|
1912
|
-
break;
|
|
1913
|
-
} else {
|
|
1914
|
-
singleFlexChild = child;
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
|
|
1920
|
-
for (auto child : children) {
|
|
1921
|
-
child->resolveDimension();
|
|
1922
|
-
if (child->getStyle().display() == YGDisplayNone) {
|
|
1923
|
-
YGZeroOutLayoutRecursivly(child, layoutContext);
|
|
1924
|
-
child->setHasNewLayout(true);
|
|
1925
|
-
child->setDirty(false);
|
|
1926
|
-
continue;
|
|
1927
|
-
}
|
|
1928
|
-
if (performLayout) {
|
|
1929
|
-
// Set the initial position (relative to the owner).
|
|
1930
|
-
const YGDirection childDirection = child->resolveDirection(direction);
|
|
1931
|
-
const float mainDim = YGFlexDirectionIsRow(mainAxis)
|
|
1932
|
-
? availableInnerWidth
|
|
1933
|
-
: availableInnerHeight;
|
|
1934
|
-
const float crossDim = YGFlexDirectionIsRow(mainAxis)
|
|
1935
|
-
? availableInnerHeight
|
|
1936
|
-
: availableInnerWidth;
|
|
1937
|
-
child->setPosition(
|
|
1938
|
-
childDirection, mainDim, crossDim, availableInnerWidth);
|
|
1939
|
-
}
|
|
1940
|
-
|
|
1941
|
-
if (child->getStyle().positionType() == YGPositionTypeAbsolute) {
|
|
1942
|
-
continue;
|
|
1943
|
-
}
|
|
1944
|
-
if (child == singleFlexChild) {
|
|
1945
|
-
child->setLayoutComputedFlexBasisGeneration(generationCount);
|
|
1946
|
-
child->setLayoutComputedFlexBasis(YGFloatOptional(0));
|
|
1947
|
-
} else {
|
|
1948
|
-
YGNodeComputeFlexBasisForChild(
|
|
1949
|
-
node,
|
|
1950
|
-
child,
|
|
1951
|
-
availableInnerWidth,
|
|
1952
|
-
widthMeasureMode,
|
|
1953
|
-
availableInnerHeight,
|
|
1954
|
-
availableInnerWidth,
|
|
1955
|
-
availableInnerHeight,
|
|
1956
|
-
heightMeasureMode,
|
|
1957
|
-
direction,
|
|
1958
|
-
config,
|
|
1959
|
-
layoutMarkerData,
|
|
1960
|
-
layoutContext,
|
|
1961
|
-
depth,
|
|
1962
|
-
generationCount);
|
|
1963
|
-
}
|
|
1964
|
-
|
|
1965
|
-
totalOuterFlexBasis +=
|
|
1966
|
-
(child->getLayout().computedFlexBasis +
|
|
1967
|
-
child->getMarginForAxis(mainAxis, availableInnerWidth))
|
|
1968
|
-
.unwrap();
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
return totalOuterFlexBasis;
|
|
1972
|
-
}
|
|
1973
|
-
|
|
1974
|
-
// This function assumes that all the children of node have their
|
|
1975
|
-
// computedFlexBasis properly computed(To do this use
|
|
1976
|
-
// YGNodeComputeFlexBasisForChildren function). This function calculates
|
|
1977
|
-
// YGCollectFlexItemsRowMeasurement
|
|
1978
|
-
static YGCollectFlexItemsRowValues YGCalculateCollectFlexItemsRowValues(
|
|
1979
|
-
const YGNodeRef& node,
|
|
1980
|
-
const YGDirection ownerDirection,
|
|
1981
|
-
const float mainAxisownerSize,
|
|
1982
|
-
const float availableInnerWidth,
|
|
1983
|
-
const float availableInnerMainDim,
|
|
1984
|
-
const uint32_t startOfLineIndex,
|
|
1985
|
-
const uint32_t lineCount) {
|
|
1986
|
-
YGCollectFlexItemsRowValues flexAlgoRowMeasurement = {};
|
|
1987
|
-
flexAlgoRowMeasurement.relativeChildren.reserve(node->getChildren().size());
|
|
1988
|
-
|
|
1989
|
-
float sizeConsumedOnCurrentLineIncludingMinConstraint = 0;
|
|
1990
|
-
const YGFlexDirection mainAxis = YGResolveFlexDirection(
|
|
1991
|
-
node->getStyle().flexDirection(), node->resolveDirection(ownerDirection));
|
|
1992
|
-
const bool isNodeFlexWrap = node->getStyle().flexWrap() != YGWrapNoWrap;
|
|
1993
|
-
const float gap = node->getGapForAxis(mainAxis, availableInnerWidth).unwrap();
|
|
1994
|
-
|
|
1995
|
-
// Add items to the current line until it's full or we run out of items.
|
|
1996
|
-
uint32_t endOfLineIndex = startOfLineIndex;
|
|
1997
|
-
for (; endOfLineIndex < node->getChildren().size(); endOfLineIndex++) {
|
|
1998
|
-
const YGNodeRef child = node->getChild(endOfLineIndex);
|
|
1999
|
-
if (child->getStyle().display() == YGDisplayNone ||
|
|
2000
|
-
child->getStyle().positionType() == YGPositionTypeAbsolute) {
|
|
2001
|
-
continue;
|
|
2002
|
-
}
|
|
2003
|
-
|
|
2004
|
-
const bool isFirstElementInLine = (endOfLineIndex - startOfLineIndex) == 0;
|
|
2005
|
-
|
|
2006
|
-
child->setLineIndex(lineCount);
|
|
2007
|
-
const float childMarginMainAxis =
|
|
2008
|
-
child->getMarginForAxis(mainAxis, availableInnerWidth).unwrap();
|
|
2009
|
-
const float childLeadingGapMainAxis = isFirstElementInLine ? 0.0f : gap;
|
|
2010
|
-
const float flexBasisWithMinAndMaxConstraints =
|
|
2011
|
-
YGNodeBoundAxisWithinMinAndMax(
|
|
2012
|
-
child,
|
|
2013
|
-
mainAxis,
|
|
2014
|
-
child->getLayout().computedFlexBasis,
|
|
2015
|
-
mainAxisownerSize)
|
|
2016
|
-
.unwrap();
|
|
2017
|
-
|
|
2018
|
-
// If this is a multi-line flow and this item pushes us over the available
|
|
2019
|
-
// size, we've hit the end of the current line. Break out of the loop and
|
|
2020
|
-
// lay out the current line.
|
|
2021
|
-
if (sizeConsumedOnCurrentLineIncludingMinConstraint +
|
|
2022
|
-
flexBasisWithMinAndMaxConstraints + childMarginMainAxis +
|
|
2023
|
-
childLeadingGapMainAxis >
|
|
2024
|
-
availableInnerMainDim &&
|
|
2025
|
-
isNodeFlexWrap && flexAlgoRowMeasurement.itemsOnLine > 0) {
|
|
2026
|
-
break;
|
|
2027
|
-
}
|
|
2028
|
-
|
|
2029
|
-
sizeConsumedOnCurrentLineIncludingMinConstraint +=
|
|
2030
|
-
flexBasisWithMinAndMaxConstraints + childMarginMainAxis +
|
|
2031
|
-
childLeadingGapMainAxis;
|
|
2032
|
-
flexAlgoRowMeasurement.sizeConsumedOnCurrentLine +=
|
|
2033
|
-
flexBasisWithMinAndMaxConstraints + childMarginMainAxis +
|
|
2034
|
-
childLeadingGapMainAxis;
|
|
2035
|
-
flexAlgoRowMeasurement.itemsOnLine++;
|
|
2036
|
-
|
|
2037
|
-
if (child->isNodeFlexible()) {
|
|
2038
|
-
flexAlgoRowMeasurement.totalFlexGrowFactors += child->resolveFlexGrow();
|
|
2039
|
-
|
|
2040
|
-
// Unlike the grow factor, the shrink factor is scaled relative to the
|
|
2041
|
-
// child dimension.
|
|
2042
|
-
flexAlgoRowMeasurement.totalFlexShrinkScaledFactors +=
|
|
2043
|
-
-child->resolveFlexShrink() *
|
|
2044
|
-
child->getLayout().computedFlexBasis.unwrap();
|
|
2045
|
-
}
|
|
2046
|
-
|
|
2047
|
-
flexAlgoRowMeasurement.relativeChildren.push_back(child);
|
|
2048
|
-
}
|
|
2049
|
-
|
|
2050
|
-
// The total flex factor needs to be floored to 1.
|
|
2051
|
-
if (flexAlgoRowMeasurement.totalFlexGrowFactors > 0 &&
|
|
2052
|
-
flexAlgoRowMeasurement.totalFlexGrowFactors < 1) {
|
|
2053
|
-
flexAlgoRowMeasurement.totalFlexGrowFactors = 1;
|
|
2054
|
-
}
|
|
2055
|
-
|
|
2056
|
-
// The total flex shrink factor needs to be floored to 1.
|
|
2057
|
-
if (flexAlgoRowMeasurement.totalFlexShrinkScaledFactors > 0 &&
|
|
2058
|
-
flexAlgoRowMeasurement.totalFlexShrinkScaledFactors < 1) {
|
|
2059
|
-
flexAlgoRowMeasurement.totalFlexShrinkScaledFactors = 1;
|
|
2060
|
-
}
|
|
2061
|
-
flexAlgoRowMeasurement.endOfLineIndex = endOfLineIndex;
|
|
2062
|
-
return flexAlgoRowMeasurement;
|
|
807
|
+
float YGNodeLayoutGetWidth(const YGNodeConstRef node) {
|
|
808
|
+
return resolveRef(node)->getLayout().dimension(YGDimensionWidth);
|
|
2063
809
|
}
|
|
2064
810
|
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
// function the child nodes would have proper size. Prior using this function
|
|
2068
|
-
// please ensure that YGDistributeFreeSpaceFirstPass is called.
|
|
2069
|
-
static float YGDistributeFreeSpaceSecondPass(
|
|
2070
|
-
YGCollectFlexItemsRowValues& collectedFlexItemsValues,
|
|
2071
|
-
const YGNodeRef node,
|
|
2072
|
-
const YGFlexDirection mainAxis,
|
|
2073
|
-
const YGFlexDirection crossAxis,
|
|
2074
|
-
const float mainAxisownerSize,
|
|
2075
|
-
const float availableInnerMainDim,
|
|
2076
|
-
const float availableInnerCrossDim,
|
|
2077
|
-
const float availableInnerWidth,
|
|
2078
|
-
const float availableInnerHeight,
|
|
2079
|
-
const bool mainAxisOverflows,
|
|
2080
|
-
const YGMeasureMode measureModeCrossDim,
|
|
2081
|
-
const bool performLayout,
|
|
2082
|
-
const YGConfigRef config,
|
|
2083
|
-
LayoutData& layoutMarkerData,
|
|
2084
|
-
void* const layoutContext,
|
|
2085
|
-
const uint32_t depth,
|
|
2086
|
-
const uint32_t generationCount) {
|
|
2087
|
-
float childFlexBasis = 0;
|
|
2088
|
-
float flexShrinkScaledFactor = 0;
|
|
2089
|
-
float flexGrowFactor = 0;
|
|
2090
|
-
float deltaFreeSpace = 0;
|
|
2091
|
-
const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis);
|
|
2092
|
-
const bool isNodeFlexWrap = node->getStyle().flexWrap() != YGWrapNoWrap;
|
|
2093
|
-
|
|
2094
|
-
for (auto currentRelativeChild : collectedFlexItemsValues.relativeChildren) {
|
|
2095
|
-
childFlexBasis = YGNodeBoundAxisWithinMinAndMax(
|
|
2096
|
-
currentRelativeChild,
|
|
2097
|
-
mainAxis,
|
|
2098
|
-
currentRelativeChild->getLayout().computedFlexBasis,
|
|
2099
|
-
mainAxisownerSize)
|
|
2100
|
-
.unwrap();
|
|
2101
|
-
float updatedMainSize = childFlexBasis;
|
|
2102
|
-
|
|
2103
|
-
if (!YGFloatIsUndefined(collectedFlexItemsValues.remainingFreeSpace) &&
|
|
2104
|
-
collectedFlexItemsValues.remainingFreeSpace < 0) {
|
|
2105
|
-
flexShrinkScaledFactor =
|
|
2106
|
-
-currentRelativeChild->resolveFlexShrink() * childFlexBasis;
|
|
2107
|
-
// Is this child able to shrink?
|
|
2108
|
-
if (flexShrinkScaledFactor != 0) {
|
|
2109
|
-
float childSize;
|
|
2110
|
-
|
|
2111
|
-
if (!YGFloatIsUndefined(
|
|
2112
|
-
collectedFlexItemsValues.totalFlexShrinkScaledFactors) &&
|
|
2113
|
-
collectedFlexItemsValues.totalFlexShrinkScaledFactors == 0) {
|
|
2114
|
-
childSize = childFlexBasis + flexShrinkScaledFactor;
|
|
2115
|
-
} else {
|
|
2116
|
-
childSize = childFlexBasis +
|
|
2117
|
-
(collectedFlexItemsValues.remainingFreeSpace /
|
|
2118
|
-
collectedFlexItemsValues.totalFlexShrinkScaledFactors) *
|
|
2119
|
-
flexShrinkScaledFactor;
|
|
2120
|
-
}
|
|
2121
|
-
|
|
2122
|
-
updatedMainSize = YGNodeBoundAxis(
|
|
2123
|
-
currentRelativeChild,
|
|
2124
|
-
mainAxis,
|
|
2125
|
-
childSize,
|
|
2126
|
-
availableInnerMainDim,
|
|
2127
|
-
availableInnerWidth);
|
|
2128
|
-
}
|
|
2129
|
-
} else if (
|
|
2130
|
-
!YGFloatIsUndefined(collectedFlexItemsValues.remainingFreeSpace) &&
|
|
2131
|
-
collectedFlexItemsValues.remainingFreeSpace > 0) {
|
|
2132
|
-
flexGrowFactor = currentRelativeChild->resolveFlexGrow();
|
|
2133
|
-
|
|
2134
|
-
// Is this child able to grow?
|
|
2135
|
-
if (!YGFloatIsUndefined(flexGrowFactor) && flexGrowFactor != 0) {
|
|
2136
|
-
updatedMainSize = YGNodeBoundAxis(
|
|
2137
|
-
currentRelativeChild,
|
|
2138
|
-
mainAxis,
|
|
2139
|
-
childFlexBasis +
|
|
2140
|
-
collectedFlexItemsValues.remainingFreeSpace /
|
|
2141
|
-
collectedFlexItemsValues.totalFlexGrowFactors *
|
|
2142
|
-
flexGrowFactor,
|
|
2143
|
-
availableInnerMainDim,
|
|
2144
|
-
availableInnerWidth);
|
|
2145
|
-
}
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2148
|
-
deltaFreeSpace += updatedMainSize - childFlexBasis;
|
|
2149
|
-
|
|
2150
|
-
const float marginMain =
|
|
2151
|
-
currentRelativeChild->getMarginForAxis(mainAxis, availableInnerWidth)
|
|
2152
|
-
.unwrap();
|
|
2153
|
-
const float marginCross =
|
|
2154
|
-
currentRelativeChild->getMarginForAxis(crossAxis, availableInnerWidth)
|
|
2155
|
-
.unwrap();
|
|
2156
|
-
|
|
2157
|
-
float childCrossSize;
|
|
2158
|
-
float childMainSize = updatedMainSize + marginMain;
|
|
2159
|
-
YGMeasureMode childCrossMeasureMode;
|
|
2160
|
-
YGMeasureMode childMainMeasureMode = YGMeasureModeExactly;
|
|
2161
|
-
|
|
2162
|
-
const auto& childStyle = currentRelativeChild->getStyle();
|
|
2163
|
-
if (!childStyle.aspectRatio().isUndefined()) {
|
|
2164
|
-
childCrossSize = isMainAxisRow
|
|
2165
|
-
? (childMainSize - marginMain) / childStyle.aspectRatio().unwrap()
|
|
2166
|
-
: (childMainSize - marginMain) * childStyle.aspectRatio().unwrap();
|
|
2167
|
-
childCrossMeasureMode = YGMeasureModeExactly;
|
|
2168
|
-
|
|
2169
|
-
childCrossSize += marginCross;
|
|
2170
|
-
} else if (
|
|
2171
|
-
!YGFloatIsUndefined(availableInnerCrossDim) &&
|
|
2172
|
-
!YGNodeIsStyleDimDefined(
|
|
2173
|
-
currentRelativeChild, crossAxis, availableInnerCrossDim) &&
|
|
2174
|
-
measureModeCrossDim == YGMeasureModeExactly &&
|
|
2175
|
-
!(isNodeFlexWrap && mainAxisOverflows) &&
|
|
2176
|
-
YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch &&
|
|
2177
|
-
currentRelativeChild->marginLeadingValue(crossAxis).unit !=
|
|
2178
|
-
YGUnitAuto &&
|
|
2179
|
-
currentRelativeChild->marginTrailingValue(crossAxis).unit !=
|
|
2180
|
-
YGUnitAuto) {
|
|
2181
|
-
childCrossSize = availableInnerCrossDim;
|
|
2182
|
-
childCrossMeasureMode = YGMeasureModeExactly;
|
|
2183
|
-
} else if (!YGNodeIsStyleDimDefined(
|
|
2184
|
-
currentRelativeChild, crossAxis, availableInnerCrossDim)) {
|
|
2185
|
-
childCrossSize = availableInnerCrossDim;
|
|
2186
|
-
childCrossMeasureMode = YGFloatIsUndefined(childCrossSize)
|
|
2187
|
-
? YGMeasureModeUndefined
|
|
2188
|
-
: YGMeasureModeAtMost;
|
|
2189
|
-
} else {
|
|
2190
|
-
childCrossSize =
|
|
2191
|
-
YGResolveValue(
|
|
2192
|
-
currentRelativeChild->getResolvedDimension(dim[crossAxis]),
|
|
2193
|
-
availableInnerCrossDim)
|
|
2194
|
-
.unwrap() +
|
|
2195
|
-
marginCross;
|
|
2196
|
-
const bool isLoosePercentageMeasurement =
|
|
2197
|
-
currentRelativeChild->getResolvedDimension(dim[crossAxis]).unit ==
|
|
2198
|
-
YGUnitPercent &&
|
|
2199
|
-
measureModeCrossDim != YGMeasureModeExactly;
|
|
2200
|
-
childCrossMeasureMode =
|
|
2201
|
-
YGFloatIsUndefined(childCrossSize) || isLoosePercentageMeasurement
|
|
2202
|
-
? YGMeasureModeUndefined
|
|
2203
|
-
: YGMeasureModeExactly;
|
|
2204
|
-
}
|
|
2205
|
-
|
|
2206
|
-
YGConstrainMaxSizeForMode(
|
|
2207
|
-
currentRelativeChild,
|
|
2208
|
-
mainAxis,
|
|
2209
|
-
availableInnerMainDim,
|
|
2210
|
-
availableInnerWidth,
|
|
2211
|
-
&childMainMeasureMode,
|
|
2212
|
-
&childMainSize);
|
|
2213
|
-
YGConstrainMaxSizeForMode(
|
|
2214
|
-
currentRelativeChild,
|
|
2215
|
-
crossAxis,
|
|
2216
|
-
availableInnerCrossDim,
|
|
2217
|
-
availableInnerWidth,
|
|
2218
|
-
&childCrossMeasureMode,
|
|
2219
|
-
&childCrossSize);
|
|
2220
|
-
|
|
2221
|
-
const bool requiresStretchLayout =
|
|
2222
|
-
!YGNodeIsStyleDimDefined(
|
|
2223
|
-
currentRelativeChild, crossAxis, availableInnerCrossDim) &&
|
|
2224
|
-
YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch &&
|
|
2225
|
-
currentRelativeChild->marginLeadingValue(crossAxis).unit !=
|
|
2226
|
-
YGUnitAuto &&
|
|
2227
|
-
currentRelativeChild->marginTrailingValue(crossAxis).unit != YGUnitAuto;
|
|
2228
|
-
|
|
2229
|
-
const float childWidth = isMainAxisRow ? childMainSize : childCrossSize;
|
|
2230
|
-
const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize;
|
|
2231
|
-
|
|
2232
|
-
const YGMeasureMode childWidthMeasureMode =
|
|
2233
|
-
isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode;
|
|
2234
|
-
const YGMeasureMode childHeightMeasureMode =
|
|
2235
|
-
!isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode;
|
|
2236
|
-
|
|
2237
|
-
const bool isLayoutPass = performLayout && !requiresStretchLayout;
|
|
2238
|
-
// Recursively call the layout algorithm for this child with the updated
|
|
2239
|
-
// main size.
|
|
2240
|
-
YGLayoutNodeInternal(
|
|
2241
|
-
currentRelativeChild,
|
|
2242
|
-
childWidth,
|
|
2243
|
-
childHeight,
|
|
2244
|
-
node->getLayout().direction(),
|
|
2245
|
-
childWidthMeasureMode,
|
|
2246
|
-
childHeightMeasureMode,
|
|
2247
|
-
availableInnerWidth,
|
|
2248
|
-
availableInnerHeight,
|
|
2249
|
-
isLayoutPass,
|
|
2250
|
-
isLayoutPass ? LayoutPassReason::kFlexLayout
|
|
2251
|
-
: LayoutPassReason::kFlexMeasure,
|
|
2252
|
-
config,
|
|
2253
|
-
layoutMarkerData,
|
|
2254
|
-
layoutContext,
|
|
2255
|
-
depth,
|
|
2256
|
-
generationCount);
|
|
2257
|
-
node->setLayoutHadOverflow(
|
|
2258
|
-
node->getLayout().hadOverflow() ||
|
|
2259
|
-
currentRelativeChild->getLayout().hadOverflow());
|
|
2260
|
-
}
|
|
2261
|
-
return deltaFreeSpace;
|
|
2262
|
-
}
|
|
2263
|
-
|
|
2264
|
-
// It distributes the free space to the flexible items.For those flexible items
|
|
2265
|
-
// whose min and max constraints are triggered, those flex item's clamped size
|
|
2266
|
-
// is removed from the remaingfreespace.
|
|
2267
|
-
static void YGDistributeFreeSpaceFirstPass(
|
|
2268
|
-
YGCollectFlexItemsRowValues& collectedFlexItemsValues,
|
|
2269
|
-
const YGFlexDirection mainAxis,
|
|
2270
|
-
const float mainAxisownerSize,
|
|
2271
|
-
const float availableInnerMainDim,
|
|
2272
|
-
const float availableInnerWidth) {
|
|
2273
|
-
float flexShrinkScaledFactor = 0;
|
|
2274
|
-
float flexGrowFactor = 0;
|
|
2275
|
-
float baseMainSize = 0;
|
|
2276
|
-
float boundMainSize = 0;
|
|
2277
|
-
float deltaFreeSpace = 0;
|
|
2278
|
-
|
|
2279
|
-
for (auto currentRelativeChild : collectedFlexItemsValues.relativeChildren) {
|
|
2280
|
-
float childFlexBasis =
|
|
2281
|
-
YGNodeBoundAxisWithinMinAndMax(
|
|
2282
|
-
currentRelativeChild,
|
|
2283
|
-
mainAxis,
|
|
2284
|
-
currentRelativeChild->getLayout().computedFlexBasis,
|
|
2285
|
-
mainAxisownerSize)
|
|
2286
|
-
.unwrap();
|
|
2287
|
-
|
|
2288
|
-
if (collectedFlexItemsValues.remainingFreeSpace < 0) {
|
|
2289
|
-
flexShrinkScaledFactor =
|
|
2290
|
-
-currentRelativeChild->resolveFlexShrink() * childFlexBasis;
|
|
2291
|
-
|
|
2292
|
-
// Is this child able to shrink?
|
|
2293
|
-
if (!YGFloatIsUndefined(flexShrinkScaledFactor) &&
|
|
2294
|
-
flexShrinkScaledFactor != 0) {
|
|
2295
|
-
baseMainSize = childFlexBasis +
|
|
2296
|
-
collectedFlexItemsValues.remainingFreeSpace /
|
|
2297
|
-
collectedFlexItemsValues.totalFlexShrinkScaledFactors *
|
|
2298
|
-
flexShrinkScaledFactor;
|
|
2299
|
-
boundMainSize = YGNodeBoundAxis(
|
|
2300
|
-
currentRelativeChild,
|
|
2301
|
-
mainAxis,
|
|
2302
|
-
baseMainSize,
|
|
2303
|
-
availableInnerMainDim,
|
|
2304
|
-
availableInnerWidth);
|
|
2305
|
-
if (!YGFloatIsUndefined(baseMainSize) &&
|
|
2306
|
-
!YGFloatIsUndefined(boundMainSize) &&
|
|
2307
|
-
baseMainSize != boundMainSize) {
|
|
2308
|
-
// By excluding this item's size and flex factor from remaining, this
|
|
2309
|
-
// item's min/max constraints should also trigger in the second pass
|
|
2310
|
-
// resulting in the item's size calculation being identical in the
|
|
2311
|
-
// first and second passes.
|
|
2312
|
-
deltaFreeSpace += boundMainSize - childFlexBasis;
|
|
2313
|
-
collectedFlexItemsValues.totalFlexShrinkScaledFactors -=
|
|
2314
|
-
(-currentRelativeChild->resolveFlexShrink() *
|
|
2315
|
-
currentRelativeChild->getLayout().computedFlexBasis.unwrap());
|
|
2316
|
-
}
|
|
2317
|
-
}
|
|
2318
|
-
} else if (
|
|
2319
|
-
!YGFloatIsUndefined(collectedFlexItemsValues.remainingFreeSpace) &&
|
|
2320
|
-
collectedFlexItemsValues.remainingFreeSpace > 0) {
|
|
2321
|
-
flexGrowFactor = currentRelativeChild->resolveFlexGrow();
|
|
2322
|
-
|
|
2323
|
-
// Is this child able to grow?
|
|
2324
|
-
if (!YGFloatIsUndefined(flexGrowFactor) && flexGrowFactor != 0) {
|
|
2325
|
-
baseMainSize = childFlexBasis +
|
|
2326
|
-
collectedFlexItemsValues.remainingFreeSpace /
|
|
2327
|
-
collectedFlexItemsValues.totalFlexGrowFactors * flexGrowFactor;
|
|
2328
|
-
boundMainSize = YGNodeBoundAxis(
|
|
2329
|
-
currentRelativeChild,
|
|
2330
|
-
mainAxis,
|
|
2331
|
-
baseMainSize,
|
|
2332
|
-
availableInnerMainDim,
|
|
2333
|
-
availableInnerWidth);
|
|
2334
|
-
|
|
2335
|
-
if (!YGFloatIsUndefined(baseMainSize) &&
|
|
2336
|
-
!YGFloatIsUndefined(boundMainSize) &&
|
|
2337
|
-
baseMainSize != boundMainSize) {
|
|
2338
|
-
// By excluding this item's size and flex factor from remaining, this
|
|
2339
|
-
// item's min/max constraints should also trigger in the second pass
|
|
2340
|
-
// resulting in the item's size calculation being identical in the
|
|
2341
|
-
// first and second passes.
|
|
2342
|
-
deltaFreeSpace += boundMainSize - childFlexBasis;
|
|
2343
|
-
collectedFlexItemsValues.totalFlexGrowFactors -= flexGrowFactor;
|
|
2344
|
-
}
|
|
2345
|
-
}
|
|
2346
|
-
}
|
|
2347
|
-
}
|
|
2348
|
-
collectedFlexItemsValues.remainingFreeSpace -= deltaFreeSpace;
|
|
2349
|
-
}
|
|
2350
|
-
|
|
2351
|
-
// Do two passes over the flex items to figure out how to distribute the
|
|
2352
|
-
// remaining space.
|
|
2353
|
-
//
|
|
2354
|
-
// The first pass finds the items whose min/max constraints trigger, freezes
|
|
2355
|
-
// them at those sizes, and excludes those sizes from the remaining space.
|
|
2356
|
-
//
|
|
2357
|
-
// The second pass sets the size of each flexible item. It distributes the
|
|
2358
|
-
// remaining space amongst the items whose min/max constraints didn't trigger in
|
|
2359
|
-
// the first pass. For the other items, it sets their sizes by forcing their
|
|
2360
|
-
// min/max constraints to trigger again.
|
|
2361
|
-
//
|
|
2362
|
-
// This two pass approach for resolving min/max constraints deviates from the
|
|
2363
|
-
// spec. The spec
|
|
2364
|
-
// (https://www.w3.org/TR/CSS-flexbox-1/#resolve-flexible-lengths) describes a
|
|
2365
|
-
// process that needs to be repeated a variable number of times. The algorithm
|
|
2366
|
-
// implemented here won't handle all cases but it was simpler to implement and
|
|
2367
|
-
// it mitigates performance concerns because we know exactly how many passes
|
|
2368
|
-
// it'll do.
|
|
2369
|
-
//
|
|
2370
|
-
// At the end of this function the child nodes would have the proper size
|
|
2371
|
-
// assigned to them.
|
|
2372
|
-
//
|
|
2373
|
-
static void YGResolveFlexibleLength(
|
|
2374
|
-
const YGNodeRef node,
|
|
2375
|
-
YGCollectFlexItemsRowValues& collectedFlexItemsValues,
|
|
2376
|
-
const YGFlexDirection mainAxis,
|
|
2377
|
-
const YGFlexDirection crossAxis,
|
|
2378
|
-
const float mainAxisownerSize,
|
|
2379
|
-
const float availableInnerMainDim,
|
|
2380
|
-
const float availableInnerCrossDim,
|
|
2381
|
-
const float availableInnerWidth,
|
|
2382
|
-
const float availableInnerHeight,
|
|
2383
|
-
const bool mainAxisOverflows,
|
|
2384
|
-
const YGMeasureMode measureModeCrossDim,
|
|
2385
|
-
const bool performLayout,
|
|
2386
|
-
const YGConfigRef config,
|
|
2387
|
-
LayoutData& layoutMarkerData,
|
|
2388
|
-
void* const layoutContext,
|
|
2389
|
-
const uint32_t depth,
|
|
2390
|
-
const uint32_t generationCount) {
|
|
2391
|
-
const float originalFreeSpace = collectedFlexItemsValues.remainingFreeSpace;
|
|
2392
|
-
// First pass: detect the flex items whose min/max constraints trigger
|
|
2393
|
-
YGDistributeFreeSpaceFirstPass(
|
|
2394
|
-
collectedFlexItemsValues,
|
|
2395
|
-
mainAxis,
|
|
2396
|
-
mainAxisownerSize,
|
|
2397
|
-
availableInnerMainDim,
|
|
2398
|
-
availableInnerWidth);
|
|
2399
|
-
|
|
2400
|
-
// Second pass: resolve the sizes of the flexible items
|
|
2401
|
-
const float distributedFreeSpace = YGDistributeFreeSpaceSecondPass(
|
|
2402
|
-
collectedFlexItemsValues,
|
|
2403
|
-
node,
|
|
2404
|
-
mainAxis,
|
|
2405
|
-
crossAxis,
|
|
2406
|
-
mainAxisownerSize,
|
|
2407
|
-
availableInnerMainDim,
|
|
2408
|
-
availableInnerCrossDim,
|
|
2409
|
-
availableInnerWidth,
|
|
2410
|
-
availableInnerHeight,
|
|
2411
|
-
mainAxisOverflows,
|
|
2412
|
-
measureModeCrossDim,
|
|
2413
|
-
performLayout,
|
|
2414
|
-
config,
|
|
2415
|
-
layoutMarkerData,
|
|
2416
|
-
layoutContext,
|
|
2417
|
-
depth,
|
|
2418
|
-
generationCount);
|
|
2419
|
-
|
|
2420
|
-
collectedFlexItemsValues.remainingFreeSpace =
|
|
2421
|
-
originalFreeSpace - distributedFreeSpace;
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
|
-
static void YGJustifyMainAxis(
|
|
2425
|
-
const YGNodeRef node,
|
|
2426
|
-
YGCollectFlexItemsRowValues& collectedFlexItemsValues,
|
|
2427
|
-
const uint32_t startOfLineIndex,
|
|
2428
|
-
const YGFlexDirection mainAxis,
|
|
2429
|
-
const YGFlexDirection crossAxis,
|
|
2430
|
-
const YGMeasureMode measureModeMainDim,
|
|
2431
|
-
const YGMeasureMode measureModeCrossDim,
|
|
2432
|
-
const float mainAxisownerSize,
|
|
2433
|
-
const float ownerWidth,
|
|
2434
|
-
const float availableInnerMainDim,
|
|
2435
|
-
const float availableInnerCrossDim,
|
|
2436
|
-
const float availableInnerWidth,
|
|
2437
|
-
const bool performLayout,
|
|
2438
|
-
void* const layoutContext) {
|
|
2439
|
-
const auto& style = node->getStyle();
|
|
2440
|
-
const float leadingPaddingAndBorderMain =
|
|
2441
|
-
node->getLeadingPaddingAndBorder(mainAxis, ownerWidth).unwrap();
|
|
2442
|
-
const float trailingPaddingAndBorderMain =
|
|
2443
|
-
node->getTrailingPaddingAndBorder(mainAxis, ownerWidth).unwrap();
|
|
2444
|
-
const float gap = node->getGapForAxis(mainAxis, ownerWidth).unwrap();
|
|
2445
|
-
// If we are using "at most" rules in the main axis, make sure that
|
|
2446
|
-
// remainingFreeSpace is 0 when min main dimension is not given
|
|
2447
|
-
if (measureModeMainDim == YGMeasureModeAtMost &&
|
|
2448
|
-
collectedFlexItemsValues.remainingFreeSpace > 0) {
|
|
2449
|
-
if (!style.minDimensions()[dim[mainAxis]].isUndefined() &&
|
|
2450
|
-
!YGResolveValue(style.minDimensions()[dim[mainAxis]], mainAxisownerSize)
|
|
2451
|
-
.isUndefined()) {
|
|
2452
|
-
// This condition makes sure that if the size of main dimension(after
|
|
2453
|
-
// considering child nodes main dim, leading and trailing padding etc)
|
|
2454
|
-
// falls below min dimension, then the remainingFreeSpace is reassigned
|
|
2455
|
-
// considering the min dimension
|
|
2456
|
-
|
|
2457
|
-
// `minAvailableMainDim` denotes minimum available space in which child
|
|
2458
|
-
// can be laid out, it will exclude space consumed by padding and border.
|
|
2459
|
-
const float minAvailableMainDim =
|
|
2460
|
-
YGResolveValue(
|
|
2461
|
-
style.minDimensions()[dim[mainAxis]], mainAxisownerSize)
|
|
2462
|
-
.unwrap() -
|
|
2463
|
-
leadingPaddingAndBorderMain - trailingPaddingAndBorderMain;
|
|
2464
|
-
const float occupiedSpaceByChildNodes =
|
|
2465
|
-
availableInnerMainDim - collectedFlexItemsValues.remainingFreeSpace;
|
|
2466
|
-
collectedFlexItemsValues.remainingFreeSpace =
|
|
2467
|
-
YGFloatMax(0, minAvailableMainDim - occupiedSpaceByChildNodes);
|
|
2468
|
-
} else {
|
|
2469
|
-
collectedFlexItemsValues.remainingFreeSpace = 0;
|
|
2470
|
-
}
|
|
2471
|
-
}
|
|
2472
|
-
|
|
2473
|
-
int numberOfAutoMarginsOnCurrentLine = 0;
|
|
2474
|
-
for (uint32_t i = startOfLineIndex;
|
|
2475
|
-
i < collectedFlexItemsValues.endOfLineIndex;
|
|
2476
|
-
i++) {
|
|
2477
|
-
const YGNodeRef child = node->getChild(i);
|
|
2478
|
-
if (child->getStyle().positionType() != YGPositionTypeAbsolute) {
|
|
2479
|
-
if (child->marginLeadingValue(mainAxis).unit == YGUnitAuto) {
|
|
2480
|
-
numberOfAutoMarginsOnCurrentLine++;
|
|
2481
|
-
}
|
|
2482
|
-
if (child->marginTrailingValue(mainAxis).unit == YGUnitAuto) {
|
|
2483
|
-
numberOfAutoMarginsOnCurrentLine++;
|
|
2484
|
-
}
|
|
2485
|
-
}
|
|
2486
|
-
}
|
|
2487
|
-
|
|
2488
|
-
// In order to position the elements in the main axis, we have two controls.
|
|
2489
|
-
// The space between the beginning and the first element and the space between
|
|
2490
|
-
// each two elements.
|
|
2491
|
-
float leadingMainDim = 0;
|
|
2492
|
-
float betweenMainDim = gap;
|
|
2493
|
-
const YGJustify justifyContent = node->getStyle().justifyContent();
|
|
2494
|
-
|
|
2495
|
-
if (numberOfAutoMarginsOnCurrentLine == 0) {
|
|
2496
|
-
switch (justifyContent) {
|
|
2497
|
-
case YGJustifyCenter:
|
|
2498
|
-
leadingMainDim = collectedFlexItemsValues.remainingFreeSpace / 2;
|
|
2499
|
-
break;
|
|
2500
|
-
case YGJustifyFlexEnd:
|
|
2501
|
-
leadingMainDim = collectedFlexItemsValues.remainingFreeSpace;
|
|
2502
|
-
break;
|
|
2503
|
-
case YGJustifySpaceBetween:
|
|
2504
|
-
if (collectedFlexItemsValues.itemsOnLine > 1) {
|
|
2505
|
-
betweenMainDim +=
|
|
2506
|
-
YGFloatMax(collectedFlexItemsValues.remainingFreeSpace, 0) /
|
|
2507
|
-
(collectedFlexItemsValues.itemsOnLine - 1);
|
|
2508
|
-
}
|
|
2509
|
-
break;
|
|
2510
|
-
case YGJustifySpaceEvenly:
|
|
2511
|
-
// Space is distributed evenly across all elements
|
|
2512
|
-
leadingMainDim = collectedFlexItemsValues.remainingFreeSpace /
|
|
2513
|
-
(collectedFlexItemsValues.itemsOnLine + 1);
|
|
2514
|
-
betweenMainDim += leadingMainDim;
|
|
2515
|
-
break;
|
|
2516
|
-
case YGJustifySpaceAround:
|
|
2517
|
-
// Space on the edges is half of the space between elements
|
|
2518
|
-
leadingMainDim = 0.5f * collectedFlexItemsValues.remainingFreeSpace /
|
|
2519
|
-
collectedFlexItemsValues.itemsOnLine;
|
|
2520
|
-
betweenMainDim += leadingMainDim * 2;
|
|
2521
|
-
break;
|
|
2522
|
-
case YGJustifyFlexStart:
|
|
2523
|
-
break;
|
|
2524
|
-
}
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
-
collectedFlexItemsValues.mainDim =
|
|
2528
|
-
leadingPaddingAndBorderMain + leadingMainDim;
|
|
2529
|
-
collectedFlexItemsValues.crossDim = 0;
|
|
2530
|
-
|
|
2531
|
-
float maxAscentForCurrentLine = 0;
|
|
2532
|
-
float maxDescentForCurrentLine = 0;
|
|
2533
|
-
bool isNodeBaselineLayout = YGIsBaselineLayout(node);
|
|
2534
|
-
for (uint32_t i = startOfLineIndex;
|
|
2535
|
-
i < collectedFlexItemsValues.endOfLineIndex;
|
|
2536
|
-
i++) {
|
|
2537
|
-
const YGNodeRef child = node->getChild(i);
|
|
2538
|
-
const YGStyle& childStyle = child->getStyle();
|
|
2539
|
-
const YGLayout childLayout = child->getLayout();
|
|
2540
|
-
const bool isLastChild = i == collectedFlexItemsValues.endOfLineIndex - 1;
|
|
2541
|
-
// remove the gap if it is the last element of the line
|
|
2542
|
-
if (isLastChild) {
|
|
2543
|
-
betweenMainDim -= gap;
|
|
2544
|
-
}
|
|
2545
|
-
if (childStyle.display() == YGDisplayNone) {
|
|
2546
|
-
continue;
|
|
2547
|
-
}
|
|
2548
|
-
if (childStyle.positionType() == YGPositionTypeAbsolute &&
|
|
2549
|
-
child->isLeadingPositionDefined(mainAxis)) {
|
|
2550
|
-
if (performLayout) {
|
|
2551
|
-
// In case the child is position absolute and has left/top being
|
|
2552
|
-
// defined, we override the position to whatever the user said (and
|
|
2553
|
-
// margin/border).
|
|
2554
|
-
child->setLayoutPosition(
|
|
2555
|
-
child->getLeadingPosition(mainAxis, availableInnerMainDim)
|
|
2556
|
-
.unwrap() +
|
|
2557
|
-
node->getLeadingBorder(mainAxis) +
|
|
2558
|
-
child->getLeadingMargin(mainAxis, availableInnerWidth).unwrap(),
|
|
2559
|
-
pos[mainAxis]);
|
|
2560
|
-
}
|
|
2561
|
-
} else {
|
|
2562
|
-
// Now that we placed the element, we need to update the variables.
|
|
2563
|
-
// We need to do that only for relative elements. Absolute elements do not
|
|
2564
|
-
// take part in that phase.
|
|
2565
|
-
if (childStyle.positionType() != YGPositionTypeAbsolute) {
|
|
2566
|
-
if (child->marginLeadingValue(mainAxis).unit == YGUnitAuto) {
|
|
2567
|
-
collectedFlexItemsValues.mainDim +=
|
|
2568
|
-
collectedFlexItemsValues.remainingFreeSpace /
|
|
2569
|
-
numberOfAutoMarginsOnCurrentLine;
|
|
2570
|
-
}
|
|
2571
|
-
|
|
2572
|
-
if (performLayout) {
|
|
2573
|
-
child->setLayoutPosition(
|
|
2574
|
-
childLayout.position[pos[mainAxis]] +
|
|
2575
|
-
collectedFlexItemsValues.mainDim,
|
|
2576
|
-
pos[mainAxis]);
|
|
2577
|
-
}
|
|
2578
|
-
|
|
2579
|
-
if (child->marginTrailingValue(mainAxis).unit == YGUnitAuto) {
|
|
2580
|
-
collectedFlexItemsValues.mainDim +=
|
|
2581
|
-
collectedFlexItemsValues.remainingFreeSpace /
|
|
2582
|
-
numberOfAutoMarginsOnCurrentLine;
|
|
2583
|
-
}
|
|
2584
|
-
bool canSkipFlex =
|
|
2585
|
-
!performLayout && measureModeCrossDim == YGMeasureModeExactly;
|
|
2586
|
-
if (canSkipFlex) {
|
|
2587
|
-
// If we skipped the flex step, then we can't rely on the measuredDims
|
|
2588
|
-
// because they weren't computed. This means we can't call
|
|
2589
|
-
// YGNodeDimWithMargin.
|
|
2590
|
-
collectedFlexItemsValues.mainDim += betweenMainDim +
|
|
2591
|
-
child->getMarginForAxis(mainAxis, availableInnerWidth).unwrap() +
|
|
2592
|
-
childLayout.computedFlexBasis.unwrap();
|
|
2593
|
-
collectedFlexItemsValues.crossDim = availableInnerCrossDim;
|
|
2594
|
-
} else {
|
|
2595
|
-
// The main dimension is the sum of all the elements dimension plus
|
|
2596
|
-
// the spacing.
|
|
2597
|
-
collectedFlexItemsValues.mainDim += betweenMainDim +
|
|
2598
|
-
YGNodeDimWithMargin(child, mainAxis, availableInnerWidth);
|
|
2599
|
-
|
|
2600
|
-
if (isNodeBaselineLayout) {
|
|
2601
|
-
// If the child is baseline aligned then the cross dimension is
|
|
2602
|
-
// calculated by adding maxAscent and maxDescent from the baseline.
|
|
2603
|
-
const float ascent = YGBaseline(child, layoutContext) +
|
|
2604
|
-
child
|
|
2605
|
-
->getLeadingMargin(
|
|
2606
|
-
YGFlexDirectionColumn, availableInnerWidth)
|
|
2607
|
-
.unwrap();
|
|
2608
|
-
const float descent =
|
|
2609
|
-
child->getLayout().measuredDimensions[YGDimensionHeight] +
|
|
2610
|
-
child
|
|
2611
|
-
->getMarginForAxis(
|
|
2612
|
-
YGFlexDirectionColumn, availableInnerWidth)
|
|
2613
|
-
.unwrap() -
|
|
2614
|
-
ascent;
|
|
2615
|
-
|
|
2616
|
-
maxAscentForCurrentLine =
|
|
2617
|
-
YGFloatMax(maxAscentForCurrentLine, ascent);
|
|
2618
|
-
maxDescentForCurrentLine =
|
|
2619
|
-
YGFloatMax(maxDescentForCurrentLine, descent);
|
|
2620
|
-
} else {
|
|
2621
|
-
// The cross dimension is the max of the elements dimension since
|
|
2622
|
-
// there can only be one element in that cross dimension in the case
|
|
2623
|
-
// when the items are not baseline aligned
|
|
2624
|
-
collectedFlexItemsValues.crossDim = YGFloatMax(
|
|
2625
|
-
collectedFlexItemsValues.crossDim,
|
|
2626
|
-
YGNodeDimWithMargin(child, crossAxis, availableInnerWidth));
|
|
2627
|
-
}
|
|
2628
|
-
}
|
|
2629
|
-
} else if (performLayout) {
|
|
2630
|
-
child->setLayoutPosition(
|
|
2631
|
-
childLayout.position[pos[mainAxis]] +
|
|
2632
|
-
node->getLeadingBorder(mainAxis) + leadingMainDim,
|
|
2633
|
-
pos[mainAxis]);
|
|
2634
|
-
}
|
|
2635
|
-
}
|
|
2636
|
-
}
|
|
2637
|
-
collectedFlexItemsValues.mainDim += trailingPaddingAndBorderMain;
|
|
2638
|
-
|
|
2639
|
-
if (isNodeBaselineLayout) {
|
|
2640
|
-
collectedFlexItemsValues.crossDim =
|
|
2641
|
-
maxAscentForCurrentLine + maxDescentForCurrentLine;
|
|
2642
|
-
}
|
|
811
|
+
float YGNodeLayoutGetHeight(const YGNodeConstRef node) {
|
|
812
|
+
return resolveRef(node)->getLayout().dimension(YGDimensionHeight);
|
|
2643
813
|
}
|
|
2644
814
|
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
// algorithm described in the W3C CSS documentation:
|
|
2648
|
-
// https://www.w3.org/TR/CSS3-flexbox/.
|
|
2649
|
-
//
|
|
2650
|
-
// Limitations of this algorithm, compared to the full standard:
|
|
2651
|
-
// * Display property is always assumed to be 'flex' except for Text nodes,
|
|
2652
|
-
// which are assumed to be 'inline-flex'.
|
|
2653
|
-
// * The 'zIndex' property (or any form of z ordering) is not supported. Nodes
|
|
2654
|
-
// are stacked in document order.
|
|
2655
|
-
// * The 'order' property is not supported. The order of flex items is always
|
|
2656
|
-
// defined by document order.
|
|
2657
|
-
// * The 'visibility' property is always assumed to be 'visible'. Values of
|
|
2658
|
-
// 'collapse' and 'hidden' are not supported.
|
|
2659
|
-
// * There is no support for forced breaks.
|
|
2660
|
-
// * It does not support vertical inline directions (top-to-bottom or
|
|
2661
|
-
// bottom-to-top text).
|
|
2662
|
-
//
|
|
2663
|
-
// Deviations from standard:
|
|
2664
|
-
// * Section 4.5 of the spec indicates that all flex items have a default
|
|
2665
|
-
// minimum main size. For text blocks, for example, this is the width of the
|
|
2666
|
-
// widest word. Calculating the minimum width is expensive, so we forego it
|
|
2667
|
-
// and assume a default minimum main size of 0.
|
|
2668
|
-
// * Min/Max sizes in the main axis are not honored when resolving flexible
|
|
2669
|
-
// lengths.
|
|
2670
|
-
// * The spec indicates that the default value for 'flexDirection' is 'row',
|
|
2671
|
-
// but the algorithm below assumes a default of 'column'.
|
|
2672
|
-
//
|
|
2673
|
-
// Input parameters:
|
|
2674
|
-
// - node: current node to be sized and laid out
|
|
2675
|
-
// - availableWidth & availableHeight: available size to be used for sizing
|
|
2676
|
-
// the node or YGUndefined if the size is not available; interpretation
|
|
2677
|
-
// depends on layout flags
|
|
2678
|
-
// - ownerDirection: the inline (text) direction within the owner
|
|
2679
|
-
// (left-to-right or right-to-left)
|
|
2680
|
-
// - widthMeasureMode: indicates the sizing rules for the width (see below
|
|
2681
|
-
// for explanation)
|
|
2682
|
-
// - heightMeasureMode: indicates the sizing rules for the height (see below
|
|
2683
|
-
// for explanation)
|
|
2684
|
-
// - performLayout: specifies whether the caller is interested in just the
|
|
2685
|
-
// dimensions of the node or it requires the entire node and its subtree to
|
|
2686
|
-
// be laid out (with final positions)
|
|
2687
|
-
//
|
|
2688
|
-
// Details:
|
|
2689
|
-
// This routine is called recursively to lay out subtrees of flexbox
|
|
2690
|
-
// elements. It uses the information in node.style, which is treated as a
|
|
2691
|
-
// read-only input. It is responsible for setting the layout.direction and
|
|
2692
|
-
// layout.measuredDimensions fields for the input node as well as the
|
|
2693
|
-
// layout.position and layout.lineIndex fields for its child nodes. The
|
|
2694
|
-
// layout.measuredDimensions field includes any border or padding for the
|
|
2695
|
-
// node but does not include margins.
|
|
2696
|
-
//
|
|
2697
|
-
// The spec describes four different layout modes: "fill available", "max
|
|
2698
|
-
// content", "min content", and "fit content". Of these, we don't use "min
|
|
2699
|
-
// content" because we don't support default minimum main sizes (see above
|
|
2700
|
-
// for details). Each of our measure modes maps to a layout mode from the
|
|
2701
|
-
// spec (https://www.w3.org/TR/CSS3-sizing/#terms):
|
|
2702
|
-
// - YGMeasureModeUndefined: max content
|
|
2703
|
-
// - YGMeasureModeExactly: fill available
|
|
2704
|
-
// - YGMeasureModeAtMost: fit content
|
|
2705
|
-
//
|
|
2706
|
-
// When calling YGNodelayoutImpl and YGLayoutNodeInternal, if the caller
|
|
2707
|
-
// passes an available size of undefined then it must also pass a measure
|
|
2708
|
-
// mode of YGMeasureModeUndefined in that dimension.
|
|
2709
|
-
//
|
|
2710
|
-
static void YGNodelayoutImpl(
|
|
2711
|
-
const YGNodeRef node,
|
|
2712
|
-
const float availableWidth,
|
|
2713
|
-
const float availableHeight,
|
|
2714
|
-
const YGDirection ownerDirection,
|
|
2715
|
-
const YGMeasureMode widthMeasureMode,
|
|
2716
|
-
const YGMeasureMode heightMeasureMode,
|
|
2717
|
-
const float ownerWidth,
|
|
2718
|
-
const float ownerHeight,
|
|
2719
|
-
const bool performLayout,
|
|
2720
|
-
const YGConfigRef config,
|
|
2721
|
-
LayoutData& layoutMarkerData,
|
|
2722
|
-
void* const layoutContext,
|
|
2723
|
-
const uint32_t depth,
|
|
2724
|
-
const uint32_t generationCount,
|
|
2725
|
-
const LayoutPassReason reason) {
|
|
2726
|
-
YGAssertWithNode(
|
|
2727
|
-
node,
|
|
2728
|
-
YGFloatIsUndefined(availableWidth)
|
|
2729
|
-
? widthMeasureMode == YGMeasureModeUndefined
|
|
2730
|
-
: true,
|
|
2731
|
-
"availableWidth is indefinite so widthMeasureMode must be "
|
|
2732
|
-
"YGMeasureModeUndefined");
|
|
2733
|
-
YGAssertWithNode(
|
|
2734
|
-
node,
|
|
2735
|
-
YGFloatIsUndefined(availableHeight)
|
|
2736
|
-
? heightMeasureMode == YGMeasureModeUndefined
|
|
2737
|
-
: true,
|
|
2738
|
-
"availableHeight is indefinite so heightMeasureMode must be "
|
|
2739
|
-
"YGMeasureModeUndefined");
|
|
2740
|
-
|
|
2741
|
-
(performLayout ? layoutMarkerData.layouts : layoutMarkerData.measures) += 1;
|
|
2742
|
-
|
|
2743
|
-
// Set the resolved resolution in the node's layout.
|
|
2744
|
-
const YGDirection direction = node->resolveDirection(ownerDirection);
|
|
2745
|
-
node->setLayoutDirection(direction);
|
|
2746
|
-
|
|
2747
|
-
const YGFlexDirection flexRowDirection =
|
|
2748
|
-
YGResolveFlexDirection(YGFlexDirectionRow, direction);
|
|
2749
|
-
const YGFlexDirection flexColumnDirection =
|
|
2750
|
-
YGResolveFlexDirection(YGFlexDirectionColumn, direction);
|
|
2751
|
-
|
|
2752
|
-
const YGEdge startEdge =
|
|
2753
|
-
direction == YGDirectionLTR ? YGEdgeLeft : YGEdgeRight;
|
|
2754
|
-
const YGEdge endEdge = direction == YGDirectionLTR ? YGEdgeRight : YGEdgeLeft;
|
|
2755
|
-
|
|
2756
|
-
const float marginRowLeading =
|
|
2757
|
-
node->getLeadingMargin(flexRowDirection, ownerWidth).unwrap();
|
|
2758
|
-
node->setLayoutMargin(marginRowLeading, startEdge);
|
|
2759
|
-
const float marginRowTrailing =
|
|
2760
|
-
node->getTrailingMargin(flexRowDirection, ownerWidth).unwrap();
|
|
2761
|
-
node->setLayoutMargin(marginRowTrailing, endEdge);
|
|
2762
|
-
const float marginColumnLeading =
|
|
2763
|
-
node->getLeadingMargin(flexColumnDirection, ownerWidth).unwrap();
|
|
2764
|
-
node->setLayoutMargin(marginColumnLeading, YGEdgeTop);
|
|
2765
|
-
const float marginColumnTrailing =
|
|
2766
|
-
node->getTrailingMargin(flexColumnDirection, ownerWidth).unwrap();
|
|
2767
|
-
node->setLayoutMargin(marginColumnTrailing, YGEdgeBottom);
|
|
2768
|
-
|
|
2769
|
-
const float marginAxisRow = marginRowLeading + marginRowTrailing;
|
|
2770
|
-
const float marginAxisColumn = marginColumnLeading + marginColumnTrailing;
|
|
2771
|
-
|
|
2772
|
-
node->setLayoutBorder(node->getLeadingBorder(flexRowDirection), startEdge);
|
|
2773
|
-
node->setLayoutBorder(node->getTrailingBorder(flexRowDirection), endEdge);
|
|
2774
|
-
node->setLayoutBorder(node->getLeadingBorder(flexColumnDirection), YGEdgeTop);
|
|
2775
|
-
node->setLayoutBorder(
|
|
2776
|
-
node->getTrailingBorder(flexColumnDirection), YGEdgeBottom);
|
|
2777
|
-
|
|
2778
|
-
node->setLayoutPadding(
|
|
2779
|
-
node->getLeadingPadding(flexRowDirection, ownerWidth).unwrap(),
|
|
2780
|
-
startEdge);
|
|
2781
|
-
node->setLayoutPadding(
|
|
2782
|
-
node->getTrailingPadding(flexRowDirection, ownerWidth).unwrap(), endEdge);
|
|
2783
|
-
node->setLayoutPadding(
|
|
2784
|
-
node->getLeadingPadding(flexColumnDirection, ownerWidth).unwrap(),
|
|
2785
|
-
YGEdgeTop);
|
|
2786
|
-
node->setLayoutPadding(
|
|
2787
|
-
node->getTrailingPadding(flexColumnDirection, ownerWidth).unwrap(),
|
|
2788
|
-
YGEdgeBottom);
|
|
2789
|
-
|
|
2790
|
-
if (node->hasMeasureFunc()) {
|
|
2791
|
-
YGNodeWithMeasureFuncSetMeasuredDimensions(
|
|
2792
|
-
node,
|
|
2793
|
-
availableWidth - marginAxisRow,
|
|
2794
|
-
availableHeight - marginAxisColumn,
|
|
2795
|
-
widthMeasureMode,
|
|
2796
|
-
heightMeasureMode,
|
|
2797
|
-
ownerWidth,
|
|
2798
|
-
ownerHeight,
|
|
2799
|
-
layoutMarkerData,
|
|
2800
|
-
layoutContext,
|
|
2801
|
-
reason);
|
|
2802
|
-
return;
|
|
2803
|
-
}
|
|
2804
|
-
|
|
2805
|
-
const uint32_t childCount = YGNodeGetChildCount(node);
|
|
2806
|
-
if (childCount == 0) {
|
|
2807
|
-
YGNodeEmptyContainerSetMeasuredDimensions(
|
|
2808
|
-
node,
|
|
2809
|
-
availableWidth - marginAxisRow,
|
|
2810
|
-
availableHeight - marginAxisColumn,
|
|
2811
|
-
widthMeasureMode,
|
|
2812
|
-
heightMeasureMode,
|
|
2813
|
-
ownerWidth,
|
|
2814
|
-
ownerHeight);
|
|
2815
|
-
return;
|
|
2816
|
-
}
|
|
2817
|
-
|
|
2818
|
-
// If we're not being asked to perform a full layout we can skip the algorithm
|
|
2819
|
-
// if we already know the size
|
|
2820
|
-
if (!performLayout &&
|
|
2821
|
-
YGNodeFixedSizeSetMeasuredDimensions(
|
|
2822
|
-
node,
|
|
2823
|
-
availableWidth - marginAxisRow,
|
|
2824
|
-
availableHeight - marginAxisColumn,
|
|
2825
|
-
widthMeasureMode,
|
|
2826
|
-
heightMeasureMode,
|
|
2827
|
-
ownerWidth,
|
|
2828
|
-
ownerHeight)) {
|
|
2829
|
-
return;
|
|
2830
|
-
}
|
|
2831
|
-
|
|
2832
|
-
// At this point we know we're going to perform work. Ensure that each child
|
|
2833
|
-
// has a mutable copy.
|
|
2834
|
-
node->cloneChildrenIfNeeded(layoutContext);
|
|
2835
|
-
// Reset layout flags, as they could have changed.
|
|
2836
|
-
node->setLayoutHadOverflow(false);
|
|
2837
|
-
|
|
2838
|
-
// STEP 1: CALCULATE VALUES FOR REMAINDER OF ALGORITHM
|
|
2839
|
-
const YGFlexDirection mainAxis =
|
|
2840
|
-
YGResolveFlexDirection(node->getStyle().flexDirection(), direction);
|
|
2841
|
-
const YGFlexDirection crossAxis = YGFlexDirectionCross(mainAxis, direction);
|
|
2842
|
-
const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis);
|
|
2843
|
-
const bool isNodeFlexWrap = node->getStyle().flexWrap() != YGWrapNoWrap;
|
|
2844
|
-
|
|
2845
|
-
const float mainAxisownerSize = isMainAxisRow ? ownerWidth : ownerHeight;
|
|
2846
|
-
const float crossAxisownerSize = isMainAxisRow ? ownerHeight : ownerWidth;
|
|
2847
|
-
|
|
2848
|
-
const float paddingAndBorderAxisMain =
|
|
2849
|
-
YGNodePaddingAndBorderForAxis(node, mainAxis, ownerWidth);
|
|
2850
|
-
const float leadingPaddingAndBorderCross =
|
|
2851
|
-
node->getLeadingPaddingAndBorder(crossAxis, ownerWidth).unwrap();
|
|
2852
|
-
const float trailingPaddingAndBorderCross =
|
|
2853
|
-
node->getTrailingPaddingAndBorder(crossAxis, ownerWidth).unwrap();
|
|
2854
|
-
const float paddingAndBorderAxisCross =
|
|
2855
|
-
leadingPaddingAndBorderCross + trailingPaddingAndBorderCross;
|
|
2856
|
-
|
|
2857
|
-
YGMeasureMode measureModeMainDim =
|
|
2858
|
-
isMainAxisRow ? widthMeasureMode : heightMeasureMode;
|
|
2859
|
-
YGMeasureMode measureModeCrossDim =
|
|
2860
|
-
isMainAxisRow ? heightMeasureMode : widthMeasureMode;
|
|
2861
|
-
|
|
2862
|
-
const float paddingAndBorderAxisRow =
|
|
2863
|
-
isMainAxisRow ? paddingAndBorderAxisMain : paddingAndBorderAxisCross;
|
|
2864
|
-
const float paddingAndBorderAxisColumn =
|
|
2865
|
-
isMainAxisRow ? paddingAndBorderAxisCross : paddingAndBorderAxisMain;
|
|
2866
|
-
|
|
2867
|
-
// STEP 2: DETERMINE AVAILABLE SIZE IN MAIN AND CROSS DIRECTIONS
|
|
2868
|
-
|
|
2869
|
-
float availableInnerWidth = YGNodeCalculateAvailableInnerDim(
|
|
2870
|
-
node,
|
|
2871
|
-
YGDimensionWidth,
|
|
2872
|
-
availableWidth - marginAxisRow,
|
|
2873
|
-
paddingAndBorderAxisRow,
|
|
2874
|
-
ownerWidth);
|
|
2875
|
-
float availableInnerHeight = YGNodeCalculateAvailableInnerDim(
|
|
2876
|
-
node,
|
|
2877
|
-
YGDimensionHeight,
|
|
2878
|
-
availableHeight - marginAxisColumn,
|
|
2879
|
-
paddingAndBorderAxisColumn,
|
|
2880
|
-
ownerHeight);
|
|
2881
|
-
|
|
2882
|
-
float availableInnerMainDim =
|
|
2883
|
-
isMainAxisRow ? availableInnerWidth : availableInnerHeight;
|
|
2884
|
-
const float availableInnerCrossDim =
|
|
2885
|
-
isMainAxisRow ? availableInnerHeight : availableInnerWidth;
|
|
2886
|
-
|
|
2887
|
-
// STEP 3: DETERMINE FLEX BASIS FOR EACH ITEM
|
|
2888
|
-
|
|
2889
|
-
// Computed basis + margins + gap
|
|
2890
|
-
float totalMainDim = 0;
|
|
2891
|
-
totalMainDim += YGNodeComputeFlexBasisForChildren(
|
|
2892
|
-
node,
|
|
2893
|
-
availableInnerWidth,
|
|
2894
|
-
availableInnerHeight,
|
|
2895
|
-
widthMeasureMode,
|
|
2896
|
-
heightMeasureMode,
|
|
2897
|
-
direction,
|
|
2898
|
-
mainAxis,
|
|
2899
|
-
config,
|
|
2900
|
-
performLayout,
|
|
2901
|
-
layoutMarkerData,
|
|
2902
|
-
layoutContext,
|
|
2903
|
-
depth,
|
|
2904
|
-
generationCount);
|
|
2905
|
-
|
|
2906
|
-
if (childCount > 1) {
|
|
2907
|
-
totalMainDim +=
|
|
2908
|
-
node->getGapForAxis(mainAxis, availableInnerCrossDim).unwrap() *
|
|
2909
|
-
(childCount - 1);
|
|
2910
|
-
}
|
|
2911
|
-
|
|
2912
|
-
const bool mainAxisOverflows =
|
|
2913
|
-
(measureModeMainDim != YGMeasureModeUndefined) &&
|
|
2914
|
-
totalMainDim > availableInnerMainDim;
|
|
2915
|
-
|
|
2916
|
-
if (isNodeFlexWrap && mainAxisOverflows &&
|
|
2917
|
-
measureModeMainDim == YGMeasureModeAtMost) {
|
|
2918
|
-
measureModeMainDim = YGMeasureModeExactly;
|
|
2919
|
-
}
|
|
2920
|
-
// STEP 4: COLLECT FLEX ITEMS INTO FLEX LINES
|
|
2921
|
-
|
|
2922
|
-
// Indexes of children that represent the first and last items in the line.
|
|
2923
|
-
uint32_t startOfLineIndex = 0;
|
|
2924
|
-
uint32_t endOfLineIndex = 0;
|
|
2925
|
-
|
|
2926
|
-
// Number of lines.
|
|
2927
|
-
uint32_t lineCount = 0;
|
|
2928
|
-
|
|
2929
|
-
// Accumulated cross dimensions of all lines so far.
|
|
2930
|
-
float totalLineCrossDim = 0;
|
|
2931
|
-
|
|
2932
|
-
const float crossAxisGap =
|
|
2933
|
-
node->getGapForAxis(crossAxis, availableInnerCrossDim).unwrap();
|
|
2934
|
-
|
|
2935
|
-
// Max main dimension of all the lines.
|
|
2936
|
-
float maxLineMainDim = 0;
|
|
2937
|
-
YGCollectFlexItemsRowValues collectedFlexItemsValues;
|
|
2938
|
-
for (; endOfLineIndex < childCount;
|
|
2939
|
-
lineCount++, startOfLineIndex = endOfLineIndex) {
|
|
2940
|
-
collectedFlexItemsValues = YGCalculateCollectFlexItemsRowValues(
|
|
2941
|
-
node,
|
|
2942
|
-
ownerDirection,
|
|
2943
|
-
mainAxisownerSize,
|
|
2944
|
-
availableInnerWidth,
|
|
2945
|
-
availableInnerMainDim,
|
|
2946
|
-
startOfLineIndex,
|
|
2947
|
-
lineCount);
|
|
2948
|
-
endOfLineIndex = collectedFlexItemsValues.endOfLineIndex;
|
|
2949
|
-
|
|
2950
|
-
// If we don't need to measure the cross axis, we can skip the entire flex
|
|
2951
|
-
// step.
|
|
2952
|
-
const bool canSkipFlex =
|
|
2953
|
-
!performLayout && measureModeCrossDim == YGMeasureModeExactly;
|
|
2954
|
-
|
|
2955
|
-
// STEP 5: RESOLVING FLEXIBLE LENGTHS ON MAIN AXIS
|
|
2956
|
-
// Calculate the remaining available space that needs to be allocated. If
|
|
2957
|
-
// the main dimension size isn't known, it is computed based on the line
|
|
2958
|
-
// length, so there's no more space left to distribute.
|
|
2959
|
-
|
|
2960
|
-
bool sizeBasedOnContent = false;
|
|
2961
|
-
// If we don't measure with exact main dimension we want to ensure we don't
|
|
2962
|
-
// violate min and max
|
|
2963
|
-
if (measureModeMainDim != YGMeasureModeExactly) {
|
|
2964
|
-
const auto& minDimensions = node->getStyle().minDimensions();
|
|
2965
|
-
const auto& maxDimensions = node->getStyle().maxDimensions();
|
|
2966
|
-
const float minInnerWidth =
|
|
2967
|
-
YGResolveValue(minDimensions[YGDimensionWidth], ownerWidth).unwrap() -
|
|
2968
|
-
paddingAndBorderAxisRow;
|
|
2969
|
-
const float maxInnerWidth =
|
|
2970
|
-
YGResolveValue(maxDimensions[YGDimensionWidth], ownerWidth).unwrap() -
|
|
2971
|
-
paddingAndBorderAxisRow;
|
|
2972
|
-
const float minInnerHeight =
|
|
2973
|
-
YGResolveValue(minDimensions[YGDimensionHeight], ownerHeight)
|
|
2974
|
-
.unwrap() -
|
|
2975
|
-
paddingAndBorderAxisColumn;
|
|
2976
|
-
const float maxInnerHeight =
|
|
2977
|
-
YGResolveValue(maxDimensions[YGDimensionHeight], ownerHeight)
|
|
2978
|
-
.unwrap() -
|
|
2979
|
-
paddingAndBorderAxisColumn;
|
|
2980
|
-
|
|
2981
|
-
const float minInnerMainDim =
|
|
2982
|
-
isMainAxisRow ? minInnerWidth : minInnerHeight;
|
|
2983
|
-
const float maxInnerMainDim =
|
|
2984
|
-
isMainAxisRow ? maxInnerWidth : maxInnerHeight;
|
|
2985
|
-
|
|
2986
|
-
if (!YGFloatIsUndefined(minInnerMainDim) &&
|
|
2987
|
-
collectedFlexItemsValues.sizeConsumedOnCurrentLine <
|
|
2988
|
-
minInnerMainDim) {
|
|
2989
|
-
availableInnerMainDim = minInnerMainDim;
|
|
2990
|
-
} else if (
|
|
2991
|
-
!YGFloatIsUndefined(maxInnerMainDim) &&
|
|
2992
|
-
collectedFlexItemsValues.sizeConsumedOnCurrentLine >
|
|
2993
|
-
maxInnerMainDim) {
|
|
2994
|
-
availableInnerMainDim = maxInnerMainDim;
|
|
2995
|
-
} else {
|
|
2996
|
-
if (!node->getConfig()->useLegacyStretchBehaviour &&
|
|
2997
|
-
((!YGFloatIsUndefined(
|
|
2998
|
-
collectedFlexItemsValues.totalFlexGrowFactors) &&
|
|
2999
|
-
collectedFlexItemsValues.totalFlexGrowFactors == 0) ||
|
|
3000
|
-
(!YGFloatIsUndefined(node->resolveFlexGrow()) &&
|
|
3001
|
-
node->resolveFlexGrow() == 0))) {
|
|
3002
|
-
// If we don't have any children to flex or we can't flex the node
|
|
3003
|
-
// itself, space we've used is all space we need. Root node also
|
|
3004
|
-
// should be shrunk to minimum
|
|
3005
|
-
availableInnerMainDim =
|
|
3006
|
-
collectedFlexItemsValues.sizeConsumedOnCurrentLine;
|
|
3007
|
-
}
|
|
3008
|
-
|
|
3009
|
-
sizeBasedOnContent = !node->getConfig()->useLegacyStretchBehaviour;
|
|
3010
|
-
}
|
|
3011
|
-
}
|
|
3012
|
-
|
|
3013
|
-
if (!sizeBasedOnContent && !YGFloatIsUndefined(availableInnerMainDim)) {
|
|
3014
|
-
collectedFlexItemsValues.remainingFreeSpace = availableInnerMainDim -
|
|
3015
|
-
collectedFlexItemsValues.sizeConsumedOnCurrentLine;
|
|
3016
|
-
} else if (collectedFlexItemsValues.sizeConsumedOnCurrentLine < 0) {
|
|
3017
|
-
// availableInnerMainDim is indefinite which means the node is being sized
|
|
3018
|
-
// based on its content. sizeConsumedOnCurrentLine is negative which means
|
|
3019
|
-
// the node will allocate 0 points for its content. Consequently,
|
|
3020
|
-
// remainingFreeSpace is 0 - sizeConsumedOnCurrentLine.
|
|
3021
|
-
collectedFlexItemsValues.remainingFreeSpace =
|
|
3022
|
-
-collectedFlexItemsValues.sizeConsumedOnCurrentLine;
|
|
3023
|
-
}
|
|
3024
|
-
|
|
3025
|
-
if (!canSkipFlex) {
|
|
3026
|
-
YGResolveFlexibleLength(
|
|
3027
|
-
node,
|
|
3028
|
-
collectedFlexItemsValues,
|
|
3029
|
-
mainAxis,
|
|
3030
|
-
crossAxis,
|
|
3031
|
-
mainAxisownerSize,
|
|
3032
|
-
availableInnerMainDim,
|
|
3033
|
-
availableInnerCrossDim,
|
|
3034
|
-
availableInnerWidth,
|
|
3035
|
-
availableInnerHeight,
|
|
3036
|
-
mainAxisOverflows,
|
|
3037
|
-
measureModeCrossDim,
|
|
3038
|
-
performLayout,
|
|
3039
|
-
config,
|
|
3040
|
-
layoutMarkerData,
|
|
3041
|
-
layoutContext,
|
|
3042
|
-
depth,
|
|
3043
|
-
generationCount);
|
|
3044
|
-
}
|
|
3045
|
-
|
|
3046
|
-
node->setLayoutHadOverflow(
|
|
3047
|
-
node->getLayout().hadOverflow() |
|
|
3048
|
-
(collectedFlexItemsValues.remainingFreeSpace < 0));
|
|
3049
|
-
|
|
3050
|
-
// STEP 6: MAIN-AXIS JUSTIFICATION & CROSS-AXIS SIZE DETERMINATION
|
|
3051
|
-
|
|
3052
|
-
// At this point, all the children have their dimensions set in the main
|
|
3053
|
-
// axis. Their dimensions are also set in the cross axis with the exception
|
|
3054
|
-
// of items that are aligned "stretch". We need to compute these stretch
|
|
3055
|
-
// values and set the final positions.
|
|
3056
|
-
|
|
3057
|
-
YGJustifyMainAxis(
|
|
3058
|
-
node,
|
|
3059
|
-
collectedFlexItemsValues,
|
|
3060
|
-
startOfLineIndex,
|
|
3061
|
-
mainAxis,
|
|
3062
|
-
crossAxis,
|
|
3063
|
-
measureModeMainDim,
|
|
3064
|
-
measureModeCrossDim,
|
|
3065
|
-
mainAxisownerSize,
|
|
3066
|
-
ownerWidth,
|
|
3067
|
-
availableInnerMainDim,
|
|
3068
|
-
availableInnerCrossDim,
|
|
3069
|
-
availableInnerWidth,
|
|
3070
|
-
performLayout,
|
|
3071
|
-
layoutContext);
|
|
3072
|
-
|
|
3073
|
-
float containerCrossAxis = availableInnerCrossDim;
|
|
3074
|
-
if (measureModeCrossDim == YGMeasureModeUndefined ||
|
|
3075
|
-
measureModeCrossDim == YGMeasureModeAtMost) {
|
|
3076
|
-
// Compute the cross axis from the max cross dimension of the children.
|
|
3077
|
-
containerCrossAxis =
|
|
3078
|
-
YGNodeBoundAxis(
|
|
3079
|
-
node,
|
|
3080
|
-
crossAxis,
|
|
3081
|
-
collectedFlexItemsValues.crossDim + paddingAndBorderAxisCross,
|
|
3082
|
-
crossAxisownerSize,
|
|
3083
|
-
ownerWidth) -
|
|
3084
|
-
paddingAndBorderAxisCross;
|
|
3085
|
-
}
|
|
3086
|
-
|
|
3087
|
-
// If there's no flex wrap, the cross dimension is defined by the container.
|
|
3088
|
-
if (!isNodeFlexWrap && measureModeCrossDim == YGMeasureModeExactly) {
|
|
3089
|
-
collectedFlexItemsValues.crossDim = availableInnerCrossDim;
|
|
3090
|
-
}
|
|
3091
|
-
|
|
3092
|
-
// Clamp to the min/max size specified on the container.
|
|
3093
|
-
collectedFlexItemsValues.crossDim =
|
|
3094
|
-
YGNodeBoundAxis(
|
|
3095
|
-
node,
|
|
3096
|
-
crossAxis,
|
|
3097
|
-
collectedFlexItemsValues.crossDim + paddingAndBorderAxisCross,
|
|
3098
|
-
crossAxisownerSize,
|
|
3099
|
-
ownerWidth) -
|
|
3100
|
-
paddingAndBorderAxisCross;
|
|
3101
|
-
|
|
3102
|
-
// STEP 7: CROSS-AXIS ALIGNMENT
|
|
3103
|
-
// We can skip child alignment if we're just measuring the container.
|
|
3104
|
-
if (performLayout) {
|
|
3105
|
-
for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) {
|
|
3106
|
-
const YGNodeRef child = node->getChild(i);
|
|
3107
|
-
if (child->getStyle().display() == YGDisplayNone) {
|
|
3108
|
-
continue;
|
|
3109
|
-
}
|
|
3110
|
-
if (child->getStyle().positionType() == YGPositionTypeAbsolute) {
|
|
3111
|
-
// If the child is absolutely positioned and has a
|
|
3112
|
-
// top/left/bottom/right set, override all the previously computed
|
|
3113
|
-
// positions to set it correctly.
|
|
3114
|
-
const bool isChildLeadingPosDefined =
|
|
3115
|
-
child->isLeadingPositionDefined(crossAxis);
|
|
3116
|
-
if (isChildLeadingPosDefined) {
|
|
3117
|
-
child->setLayoutPosition(
|
|
3118
|
-
child->getLeadingPosition(crossAxis, availableInnerCrossDim)
|
|
3119
|
-
.unwrap() +
|
|
3120
|
-
node->getLeadingBorder(crossAxis) +
|
|
3121
|
-
child->getLeadingMargin(crossAxis, availableInnerWidth)
|
|
3122
|
-
.unwrap(),
|
|
3123
|
-
pos[crossAxis]);
|
|
3124
|
-
}
|
|
3125
|
-
// If leading position is not defined or calculations result in Nan,
|
|
3126
|
-
// default to border + margin
|
|
3127
|
-
if (!isChildLeadingPosDefined ||
|
|
3128
|
-
YGFloatIsUndefined(child->getLayout().position[pos[crossAxis]])) {
|
|
3129
|
-
child->setLayoutPosition(
|
|
3130
|
-
node->getLeadingBorder(crossAxis) +
|
|
3131
|
-
child->getLeadingMargin(crossAxis, availableInnerWidth)
|
|
3132
|
-
.unwrap(),
|
|
3133
|
-
pos[crossAxis]);
|
|
3134
|
-
}
|
|
3135
|
-
} else {
|
|
3136
|
-
float leadingCrossDim = leadingPaddingAndBorderCross;
|
|
3137
|
-
|
|
3138
|
-
// For a relative children, we're either using alignItems (owner) or
|
|
3139
|
-
// alignSelf (child) in order to determine the position in the cross
|
|
3140
|
-
// axis
|
|
3141
|
-
const YGAlign alignItem = YGNodeAlignItem(node, child);
|
|
3142
|
-
|
|
3143
|
-
// If the child uses align stretch, we need to lay it out one more
|
|
3144
|
-
// time, this time forcing the cross-axis size to be the computed
|
|
3145
|
-
// cross size for the current line.
|
|
3146
|
-
if (alignItem == YGAlignStretch &&
|
|
3147
|
-
child->marginLeadingValue(crossAxis).unit != YGUnitAuto &&
|
|
3148
|
-
child->marginTrailingValue(crossAxis).unit != YGUnitAuto) {
|
|
3149
|
-
// If the child defines a definite size for its cross axis, there's
|
|
3150
|
-
// no need to stretch.
|
|
3151
|
-
if (!YGNodeIsStyleDimDefined(
|
|
3152
|
-
child, crossAxis, availableInnerCrossDim)) {
|
|
3153
|
-
float childMainSize =
|
|
3154
|
-
child->getLayout().measuredDimensions[dim[mainAxis]];
|
|
3155
|
-
const auto& childStyle = child->getStyle();
|
|
3156
|
-
float childCrossSize = !childStyle.aspectRatio().isUndefined()
|
|
3157
|
-
? child->getMarginForAxis(crossAxis, availableInnerWidth)
|
|
3158
|
-
.unwrap() +
|
|
3159
|
-
(isMainAxisRow
|
|
3160
|
-
? childMainSize / childStyle.aspectRatio().unwrap()
|
|
3161
|
-
: childMainSize * childStyle.aspectRatio().unwrap())
|
|
3162
|
-
: collectedFlexItemsValues.crossDim;
|
|
3163
|
-
|
|
3164
|
-
childMainSize +=
|
|
3165
|
-
child->getMarginForAxis(mainAxis, availableInnerWidth)
|
|
3166
|
-
.unwrap();
|
|
3167
|
-
|
|
3168
|
-
YGMeasureMode childMainMeasureMode = YGMeasureModeExactly;
|
|
3169
|
-
YGMeasureMode childCrossMeasureMode = YGMeasureModeExactly;
|
|
3170
|
-
YGConstrainMaxSizeForMode(
|
|
3171
|
-
child,
|
|
3172
|
-
mainAxis,
|
|
3173
|
-
availableInnerMainDim,
|
|
3174
|
-
availableInnerWidth,
|
|
3175
|
-
&childMainMeasureMode,
|
|
3176
|
-
&childMainSize);
|
|
3177
|
-
YGConstrainMaxSizeForMode(
|
|
3178
|
-
child,
|
|
3179
|
-
crossAxis,
|
|
3180
|
-
availableInnerCrossDim,
|
|
3181
|
-
availableInnerWidth,
|
|
3182
|
-
&childCrossMeasureMode,
|
|
3183
|
-
&childCrossSize);
|
|
3184
|
-
|
|
3185
|
-
const float childWidth =
|
|
3186
|
-
isMainAxisRow ? childMainSize : childCrossSize;
|
|
3187
|
-
const float childHeight =
|
|
3188
|
-
!isMainAxisRow ? childMainSize : childCrossSize;
|
|
3189
|
-
|
|
3190
|
-
auto alignContent = node->getStyle().alignContent();
|
|
3191
|
-
auto crossAxisDoesNotGrow =
|
|
3192
|
-
alignContent != YGAlignStretch && isNodeFlexWrap;
|
|
3193
|
-
const YGMeasureMode childWidthMeasureMode =
|
|
3194
|
-
YGFloatIsUndefined(childWidth) ||
|
|
3195
|
-
(!isMainAxisRow && crossAxisDoesNotGrow)
|
|
3196
|
-
? YGMeasureModeUndefined
|
|
3197
|
-
: YGMeasureModeExactly;
|
|
3198
|
-
const YGMeasureMode childHeightMeasureMode =
|
|
3199
|
-
YGFloatIsUndefined(childHeight) ||
|
|
3200
|
-
(isMainAxisRow && crossAxisDoesNotGrow)
|
|
3201
|
-
? YGMeasureModeUndefined
|
|
3202
|
-
: YGMeasureModeExactly;
|
|
3203
|
-
|
|
3204
|
-
YGLayoutNodeInternal(
|
|
3205
|
-
child,
|
|
3206
|
-
childWidth,
|
|
3207
|
-
childHeight,
|
|
3208
|
-
direction,
|
|
3209
|
-
childWidthMeasureMode,
|
|
3210
|
-
childHeightMeasureMode,
|
|
3211
|
-
availableInnerWidth,
|
|
3212
|
-
availableInnerHeight,
|
|
3213
|
-
true,
|
|
3214
|
-
LayoutPassReason::kStretch,
|
|
3215
|
-
config,
|
|
3216
|
-
layoutMarkerData,
|
|
3217
|
-
layoutContext,
|
|
3218
|
-
depth,
|
|
3219
|
-
generationCount);
|
|
3220
|
-
}
|
|
3221
|
-
} else {
|
|
3222
|
-
const float remainingCrossDim = containerCrossAxis -
|
|
3223
|
-
YGNodeDimWithMargin(child, crossAxis, availableInnerWidth);
|
|
3224
|
-
|
|
3225
|
-
if (child->marginLeadingValue(crossAxis).unit == YGUnitAuto &&
|
|
3226
|
-
child->marginTrailingValue(crossAxis).unit == YGUnitAuto) {
|
|
3227
|
-
leadingCrossDim += YGFloatMax(0.0f, remainingCrossDim / 2);
|
|
3228
|
-
} else if (
|
|
3229
|
-
child->marginTrailingValue(crossAxis).unit == YGUnitAuto) {
|
|
3230
|
-
// No-Op
|
|
3231
|
-
} else if (
|
|
3232
|
-
child->marginLeadingValue(crossAxis).unit == YGUnitAuto) {
|
|
3233
|
-
leadingCrossDim += YGFloatMax(0.0f, remainingCrossDim);
|
|
3234
|
-
} else if (alignItem == YGAlignFlexStart) {
|
|
3235
|
-
// No-Op
|
|
3236
|
-
} else if (alignItem == YGAlignCenter) {
|
|
3237
|
-
leadingCrossDim += remainingCrossDim / 2;
|
|
3238
|
-
} else {
|
|
3239
|
-
leadingCrossDim += remainingCrossDim;
|
|
3240
|
-
}
|
|
3241
|
-
}
|
|
3242
|
-
// And we apply the position
|
|
3243
|
-
child->setLayoutPosition(
|
|
3244
|
-
child->getLayout().position[pos[crossAxis]] + totalLineCrossDim +
|
|
3245
|
-
leadingCrossDim,
|
|
3246
|
-
pos[crossAxis]);
|
|
3247
|
-
}
|
|
3248
|
-
}
|
|
3249
|
-
}
|
|
3250
|
-
|
|
3251
|
-
const float appliedCrossGap = lineCount != 0 ? crossAxisGap : 0.0f;
|
|
3252
|
-
totalLineCrossDim += collectedFlexItemsValues.crossDim + appliedCrossGap;
|
|
3253
|
-
maxLineMainDim =
|
|
3254
|
-
YGFloatMax(maxLineMainDim, collectedFlexItemsValues.mainDim);
|
|
3255
|
-
}
|
|
3256
|
-
|
|
3257
|
-
// STEP 8: MULTI-LINE CONTENT ALIGNMENT
|
|
3258
|
-
// currentLead stores the size of the cross dim
|
|
3259
|
-
if (performLayout && (isNodeFlexWrap || YGIsBaselineLayout(node))) {
|
|
3260
|
-
float crossDimLead = 0;
|
|
3261
|
-
float currentLead = leadingPaddingAndBorderCross;
|
|
3262
|
-
if (!YGFloatIsUndefined(availableInnerCrossDim)) {
|
|
3263
|
-
const float remainingAlignContentDim =
|
|
3264
|
-
availableInnerCrossDim - totalLineCrossDim;
|
|
3265
|
-
switch (node->getStyle().alignContent()) {
|
|
3266
|
-
case YGAlignFlexEnd:
|
|
3267
|
-
currentLead += remainingAlignContentDim;
|
|
3268
|
-
break;
|
|
3269
|
-
case YGAlignCenter:
|
|
3270
|
-
currentLead += remainingAlignContentDim / 2;
|
|
3271
|
-
break;
|
|
3272
|
-
case YGAlignStretch:
|
|
3273
|
-
if (availableInnerCrossDim > totalLineCrossDim) {
|
|
3274
|
-
crossDimLead = remainingAlignContentDim / lineCount;
|
|
3275
|
-
}
|
|
3276
|
-
break;
|
|
3277
|
-
case YGAlignSpaceAround:
|
|
3278
|
-
if (availableInnerCrossDim > totalLineCrossDim) {
|
|
3279
|
-
currentLead += remainingAlignContentDim / (2 * lineCount);
|
|
3280
|
-
if (lineCount > 1) {
|
|
3281
|
-
crossDimLead = remainingAlignContentDim / lineCount;
|
|
3282
|
-
}
|
|
3283
|
-
} else {
|
|
3284
|
-
currentLead += remainingAlignContentDim / 2;
|
|
3285
|
-
}
|
|
3286
|
-
break;
|
|
3287
|
-
case YGAlignSpaceBetween:
|
|
3288
|
-
if (availableInnerCrossDim > totalLineCrossDim && lineCount > 1) {
|
|
3289
|
-
crossDimLead = remainingAlignContentDim / (lineCount - 1);
|
|
3290
|
-
}
|
|
3291
|
-
break;
|
|
3292
|
-
case YGAlignAuto:
|
|
3293
|
-
case YGAlignFlexStart:
|
|
3294
|
-
case YGAlignBaseline:
|
|
3295
|
-
break;
|
|
3296
|
-
}
|
|
3297
|
-
}
|
|
3298
|
-
uint32_t endIndex = 0;
|
|
3299
|
-
for (uint32_t i = 0; i < lineCount; i++) {
|
|
3300
|
-
const uint32_t startIndex = endIndex;
|
|
3301
|
-
uint32_t ii;
|
|
3302
|
-
|
|
3303
|
-
// compute the line's height and find the endIndex
|
|
3304
|
-
float lineHeight = 0;
|
|
3305
|
-
float maxAscentForCurrentLine = 0;
|
|
3306
|
-
float maxDescentForCurrentLine = 0;
|
|
3307
|
-
for (ii = startIndex; ii < childCount; ii++) {
|
|
3308
|
-
const YGNodeRef child = node->getChild(ii);
|
|
3309
|
-
if (child->getStyle().display() == YGDisplayNone) {
|
|
3310
|
-
continue;
|
|
3311
|
-
}
|
|
3312
|
-
if (child->getStyle().positionType() != YGPositionTypeAbsolute) {
|
|
3313
|
-
if (child->getLineIndex() != i) {
|
|
3314
|
-
break;
|
|
3315
|
-
}
|
|
3316
|
-
if (YGNodeIsLayoutDimDefined(child, crossAxis)) {
|
|
3317
|
-
lineHeight = YGFloatMax(
|
|
3318
|
-
lineHeight,
|
|
3319
|
-
child->getLayout().measuredDimensions[dim[crossAxis]] +
|
|
3320
|
-
child->getMarginForAxis(crossAxis, availableInnerWidth)
|
|
3321
|
-
.unwrap());
|
|
3322
|
-
}
|
|
3323
|
-
if (YGNodeAlignItem(node, child) == YGAlignBaseline) {
|
|
3324
|
-
const float ascent = YGBaseline(child, layoutContext) +
|
|
3325
|
-
child
|
|
3326
|
-
->getLeadingMargin(
|
|
3327
|
-
YGFlexDirectionColumn, availableInnerWidth)
|
|
3328
|
-
.unwrap();
|
|
3329
|
-
const float descent =
|
|
3330
|
-
child->getLayout().measuredDimensions[YGDimensionHeight] +
|
|
3331
|
-
child
|
|
3332
|
-
->getMarginForAxis(
|
|
3333
|
-
YGFlexDirectionColumn, availableInnerWidth)
|
|
3334
|
-
.unwrap() -
|
|
3335
|
-
ascent;
|
|
3336
|
-
maxAscentForCurrentLine =
|
|
3337
|
-
YGFloatMax(maxAscentForCurrentLine, ascent);
|
|
3338
|
-
maxDescentForCurrentLine =
|
|
3339
|
-
YGFloatMax(maxDescentForCurrentLine, descent);
|
|
3340
|
-
lineHeight = YGFloatMax(
|
|
3341
|
-
lineHeight, maxAscentForCurrentLine + maxDescentForCurrentLine);
|
|
3342
|
-
}
|
|
3343
|
-
}
|
|
3344
|
-
}
|
|
3345
|
-
endIndex = ii;
|
|
3346
|
-
lineHeight += crossDimLead;
|
|
3347
|
-
currentLead += i != 0 ? crossAxisGap : 0;
|
|
3348
|
-
|
|
3349
|
-
if (performLayout) {
|
|
3350
|
-
for (ii = startIndex; ii < endIndex; ii++) {
|
|
3351
|
-
const YGNodeRef child = node->getChild(ii);
|
|
3352
|
-
if (child->getStyle().display() == YGDisplayNone) {
|
|
3353
|
-
continue;
|
|
3354
|
-
}
|
|
3355
|
-
if (child->getStyle().positionType() != YGPositionTypeAbsolute) {
|
|
3356
|
-
switch (YGNodeAlignItem(node, child)) {
|
|
3357
|
-
case YGAlignFlexStart: {
|
|
3358
|
-
child->setLayoutPosition(
|
|
3359
|
-
currentLead +
|
|
3360
|
-
child->getLeadingMargin(crossAxis, availableInnerWidth)
|
|
3361
|
-
.unwrap(),
|
|
3362
|
-
pos[crossAxis]);
|
|
3363
|
-
break;
|
|
3364
|
-
}
|
|
3365
|
-
case YGAlignFlexEnd: {
|
|
3366
|
-
child->setLayoutPosition(
|
|
3367
|
-
currentLead + lineHeight -
|
|
3368
|
-
child->getTrailingMargin(crossAxis, availableInnerWidth)
|
|
3369
|
-
.unwrap() -
|
|
3370
|
-
child->getLayout().measuredDimensions[dim[crossAxis]],
|
|
3371
|
-
pos[crossAxis]);
|
|
3372
|
-
break;
|
|
3373
|
-
}
|
|
3374
|
-
case YGAlignCenter: {
|
|
3375
|
-
float childHeight =
|
|
3376
|
-
child->getLayout().measuredDimensions[dim[crossAxis]];
|
|
3377
|
-
|
|
3378
|
-
child->setLayoutPosition(
|
|
3379
|
-
currentLead + (lineHeight - childHeight) / 2,
|
|
3380
|
-
pos[crossAxis]);
|
|
3381
|
-
break;
|
|
3382
|
-
}
|
|
3383
|
-
case YGAlignStretch: {
|
|
3384
|
-
child->setLayoutPosition(
|
|
3385
|
-
currentLead +
|
|
3386
|
-
child->getLeadingMargin(crossAxis, availableInnerWidth)
|
|
3387
|
-
.unwrap(),
|
|
3388
|
-
pos[crossAxis]);
|
|
3389
|
-
|
|
3390
|
-
// Remeasure child with the line height as it as been only
|
|
3391
|
-
// measured with the owners height yet.
|
|
3392
|
-
if (!YGNodeIsStyleDimDefined(
|
|
3393
|
-
child, crossAxis, availableInnerCrossDim)) {
|
|
3394
|
-
const float childWidth = isMainAxisRow
|
|
3395
|
-
? (child->getLayout()
|
|
3396
|
-
.measuredDimensions[YGDimensionWidth] +
|
|
3397
|
-
child->getMarginForAxis(mainAxis, availableInnerWidth)
|
|
3398
|
-
.unwrap())
|
|
3399
|
-
: lineHeight;
|
|
3400
|
-
|
|
3401
|
-
const float childHeight = !isMainAxisRow
|
|
3402
|
-
? (child->getLayout()
|
|
3403
|
-
.measuredDimensions[YGDimensionHeight] +
|
|
3404
|
-
child->getMarginForAxis(crossAxis, availableInnerWidth)
|
|
3405
|
-
.unwrap())
|
|
3406
|
-
: lineHeight;
|
|
3407
|
-
|
|
3408
|
-
if (!(YGFloatsEqual(
|
|
3409
|
-
childWidth,
|
|
3410
|
-
child->getLayout()
|
|
3411
|
-
.measuredDimensions[YGDimensionWidth]) &&
|
|
3412
|
-
YGFloatsEqual(
|
|
3413
|
-
childHeight,
|
|
3414
|
-
child->getLayout()
|
|
3415
|
-
.measuredDimensions[YGDimensionHeight]))) {
|
|
3416
|
-
YGLayoutNodeInternal(
|
|
3417
|
-
child,
|
|
3418
|
-
childWidth,
|
|
3419
|
-
childHeight,
|
|
3420
|
-
direction,
|
|
3421
|
-
YGMeasureModeExactly,
|
|
3422
|
-
YGMeasureModeExactly,
|
|
3423
|
-
availableInnerWidth,
|
|
3424
|
-
availableInnerHeight,
|
|
3425
|
-
true,
|
|
3426
|
-
LayoutPassReason::kMultilineStretch,
|
|
3427
|
-
config,
|
|
3428
|
-
layoutMarkerData,
|
|
3429
|
-
layoutContext,
|
|
3430
|
-
depth,
|
|
3431
|
-
generationCount);
|
|
3432
|
-
}
|
|
3433
|
-
}
|
|
3434
|
-
break;
|
|
3435
|
-
}
|
|
3436
|
-
case YGAlignBaseline: {
|
|
3437
|
-
child->setLayoutPosition(
|
|
3438
|
-
currentLead + maxAscentForCurrentLine -
|
|
3439
|
-
YGBaseline(child, layoutContext) +
|
|
3440
|
-
child
|
|
3441
|
-
->getLeadingPosition(
|
|
3442
|
-
YGFlexDirectionColumn, availableInnerCrossDim)
|
|
3443
|
-
.unwrap(),
|
|
3444
|
-
YGEdgeTop);
|
|
3445
|
-
|
|
3446
|
-
break;
|
|
3447
|
-
}
|
|
3448
|
-
case YGAlignAuto:
|
|
3449
|
-
case YGAlignSpaceBetween:
|
|
3450
|
-
case YGAlignSpaceAround:
|
|
3451
|
-
break;
|
|
3452
|
-
}
|
|
3453
|
-
}
|
|
3454
|
-
}
|
|
3455
|
-
}
|
|
3456
|
-
currentLead += lineHeight;
|
|
3457
|
-
}
|
|
3458
|
-
}
|
|
3459
|
-
|
|
3460
|
-
// STEP 9: COMPUTING FINAL DIMENSIONS
|
|
3461
|
-
|
|
3462
|
-
node->setLayoutMeasuredDimension(
|
|
3463
|
-
YGNodeBoundAxis(
|
|
3464
|
-
node,
|
|
3465
|
-
YGFlexDirectionRow,
|
|
3466
|
-
availableWidth - marginAxisRow,
|
|
3467
|
-
ownerWidth,
|
|
3468
|
-
ownerWidth),
|
|
3469
|
-
YGDimensionWidth);
|
|
3470
|
-
|
|
3471
|
-
node->setLayoutMeasuredDimension(
|
|
3472
|
-
YGNodeBoundAxis(
|
|
3473
|
-
node,
|
|
3474
|
-
YGFlexDirectionColumn,
|
|
3475
|
-
availableHeight - marginAxisColumn,
|
|
3476
|
-
ownerHeight,
|
|
3477
|
-
ownerWidth),
|
|
3478
|
-
YGDimensionHeight);
|
|
3479
|
-
|
|
3480
|
-
// If the user didn't specify a width or height for the node, set the
|
|
3481
|
-
// dimensions based on the children.
|
|
3482
|
-
if (measureModeMainDim == YGMeasureModeUndefined ||
|
|
3483
|
-
(node->getStyle().overflow() != YGOverflowScroll &&
|
|
3484
|
-
measureModeMainDim == YGMeasureModeAtMost)) {
|
|
3485
|
-
// Clamp the size to the min/max size, if specified, and make sure it
|
|
3486
|
-
// doesn't go below the padding and border amount.
|
|
3487
|
-
node->setLayoutMeasuredDimension(
|
|
3488
|
-
YGNodeBoundAxis(
|
|
3489
|
-
node, mainAxis, maxLineMainDim, mainAxisownerSize, ownerWidth),
|
|
3490
|
-
dim[mainAxis]);
|
|
3491
|
-
|
|
3492
|
-
} else if (
|
|
3493
|
-
measureModeMainDim == YGMeasureModeAtMost &&
|
|
3494
|
-
node->getStyle().overflow() == YGOverflowScroll) {
|
|
3495
|
-
node->setLayoutMeasuredDimension(
|
|
3496
|
-
YGFloatMax(
|
|
3497
|
-
YGFloatMin(
|
|
3498
|
-
availableInnerMainDim + paddingAndBorderAxisMain,
|
|
3499
|
-
YGNodeBoundAxisWithinMinAndMax(
|
|
3500
|
-
node,
|
|
3501
|
-
mainAxis,
|
|
3502
|
-
YGFloatOptional{maxLineMainDim},
|
|
3503
|
-
mainAxisownerSize)
|
|
3504
|
-
.unwrap()),
|
|
3505
|
-
paddingAndBorderAxisMain),
|
|
3506
|
-
dim[mainAxis]);
|
|
3507
|
-
}
|
|
3508
|
-
|
|
3509
|
-
if (measureModeCrossDim == YGMeasureModeUndefined ||
|
|
3510
|
-
(node->getStyle().overflow() != YGOverflowScroll &&
|
|
3511
|
-
measureModeCrossDim == YGMeasureModeAtMost)) {
|
|
3512
|
-
// Clamp the size to the min/max size, if specified, and make sure it
|
|
3513
|
-
// doesn't go below the padding and border amount.
|
|
3514
|
-
node->setLayoutMeasuredDimension(
|
|
3515
|
-
YGNodeBoundAxis(
|
|
3516
|
-
node,
|
|
3517
|
-
crossAxis,
|
|
3518
|
-
totalLineCrossDim + paddingAndBorderAxisCross,
|
|
3519
|
-
crossAxisownerSize,
|
|
3520
|
-
ownerWidth),
|
|
3521
|
-
dim[crossAxis]);
|
|
3522
|
-
|
|
3523
|
-
} else if (
|
|
3524
|
-
measureModeCrossDim == YGMeasureModeAtMost &&
|
|
3525
|
-
node->getStyle().overflow() == YGOverflowScroll) {
|
|
3526
|
-
node->setLayoutMeasuredDimension(
|
|
3527
|
-
YGFloatMax(
|
|
3528
|
-
YGFloatMin(
|
|
3529
|
-
availableInnerCrossDim + paddingAndBorderAxisCross,
|
|
3530
|
-
YGNodeBoundAxisWithinMinAndMax(
|
|
3531
|
-
node,
|
|
3532
|
-
crossAxis,
|
|
3533
|
-
YGFloatOptional{
|
|
3534
|
-
totalLineCrossDim + paddingAndBorderAxisCross},
|
|
3535
|
-
crossAxisownerSize)
|
|
3536
|
-
.unwrap()),
|
|
3537
|
-
paddingAndBorderAxisCross),
|
|
3538
|
-
dim[crossAxis]);
|
|
3539
|
-
}
|
|
3540
|
-
|
|
3541
|
-
// As we only wrapped in normal direction yet, we need to reverse the
|
|
3542
|
-
// positions on wrap-reverse.
|
|
3543
|
-
if (performLayout && node->getStyle().flexWrap() == YGWrapWrapReverse) {
|
|
3544
|
-
for (uint32_t i = 0; i < childCount; i++) {
|
|
3545
|
-
const YGNodeRef child = YGNodeGetChild(node, i);
|
|
3546
|
-
if (child->getStyle().positionType() != YGPositionTypeAbsolute) {
|
|
3547
|
-
child->setLayoutPosition(
|
|
3548
|
-
node->getLayout().measuredDimensions[dim[crossAxis]] -
|
|
3549
|
-
child->getLayout().position[pos[crossAxis]] -
|
|
3550
|
-
child->getLayout().measuredDimensions[dim[crossAxis]],
|
|
3551
|
-
pos[crossAxis]);
|
|
3552
|
-
}
|
|
3553
|
-
}
|
|
3554
|
-
}
|
|
3555
|
-
|
|
3556
|
-
if (performLayout) {
|
|
3557
|
-
// STEP 10: SIZING AND POSITIONING ABSOLUTE CHILDREN
|
|
3558
|
-
for (auto child : node->getChildren()) {
|
|
3559
|
-
if (child->getStyle().display() == YGDisplayNone ||
|
|
3560
|
-
child->getStyle().positionType() != YGPositionTypeAbsolute) {
|
|
3561
|
-
continue;
|
|
3562
|
-
}
|
|
3563
|
-
YGNodeAbsoluteLayoutChild(
|
|
3564
|
-
node,
|
|
3565
|
-
child,
|
|
3566
|
-
YGConfigIsExperimentalFeatureEnabled(
|
|
3567
|
-
node->getConfig(),
|
|
3568
|
-
YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge)
|
|
3569
|
-
? node->getLayout().measuredDimensions[YGDimensionWidth]
|
|
3570
|
-
: availableInnerWidth,
|
|
3571
|
-
isMainAxisRow ? measureModeMainDim : measureModeCrossDim,
|
|
3572
|
-
YGConfigIsExperimentalFeatureEnabled(
|
|
3573
|
-
node->getConfig(),
|
|
3574
|
-
YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge)
|
|
3575
|
-
? node->getLayout().measuredDimensions[YGDimensionHeight]
|
|
3576
|
-
: availableInnerHeight,
|
|
3577
|
-
direction,
|
|
3578
|
-
config,
|
|
3579
|
-
layoutMarkerData,
|
|
3580
|
-
layoutContext,
|
|
3581
|
-
depth,
|
|
3582
|
-
generationCount);
|
|
3583
|
-
}
|
|
3584
|
-
|
|
3585
|
-
// STEP 11: SETTING TRAILING POSITIONS FOR CHILDREN
|
|
3586
|
-
const bool needsMainTrailingPos = mainAxis == YGFlexDirectionRowReverse ||
|
|
3587
|
-
mainAxis == YGFlexDirectionColumnReverse;
|
|
3588
|
-
const bool needsCrossTrailingPos = crossAxis == YGFlexDirectionRowReverse ||
|
|
3589
|
-
crossAxis == YGFlexDirectionColumnReverse;
|
|
3590
|
-
|
|
3591
|
-
// Set trailing position if necessary.
|
|
3592
|
-
if (needsMainTrailingPos || needsCrossTrailingPos) {
|
|
3593
|
-
for (uint32_t i = 0; i < childCount; i++) {
|
|
3594
|
-
const YGNodeRef child = node->getChild(i);
|
|
3595
|
-
if (child->getStyle().display() == YGDisplayNone) {
|
|
3596
|
-
continue;
|
|
3597
|
-
}
|
|
3598
|
-
if (needsMainTrailingPos) {
|
|
3599
|
-
YGNodeSetChildTrailingPosition(node, child, mainAxis);
|
|
3600
|
-
}
|
|
3601
|
-
|
|
3602
|
-
if (needsCrossTrailingPos) {
|
|
3603
|
-
YGNodeSetChildTrailingPosition(node, child, crossAxis);
|
|
3604
|
-
}
|
|
3605
|
-
}
|
|
3606
|
-
}
|
|
3607
|
-
}
|
|
815
|
+
YGDirection YGNodeLayoutGetDirection(const YGNodeConstRef node) {
|
|
816
|
+
return unscopedEnum(resolveRef(node)->getLayout().direction());
|
|
3608
817
|
}
|
|
3609
818
|
|
|
3610
|
-
bool
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
static const char* spacer =
|
|
3614
|
-
" ";
|
|
3615
|
-
|
|
3616
|
-
static const char* YGSpacer(const unsigned long level) {
|
|
3617
|
-
const size_t spacerLen = strlen(spacer);
|
|
3618
|
-
if (level > spacerLen) {
|
|
3619
|
-
return &spacer[0];
|
|
3620
|
-
} else {
|
|
3621
|
-
return &spacer[spacerLen - level];
|
|
3622
|
-
}
|
|
819
|
+
bool YGNodeLayoutGetHadOverflow(const YGNodeConstRef node) {
|
|
820
|
+
return resolveRef(node)->getLayout().hadOverflow();
|
|
3623
821
|
}
|
|
3624
822
|
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
const bool performLayout) {
|
|
3628
|
-
constexpr auto N = enums::count<YGMeasureMode>();
|
|
3629
|
-
const char* kMeasureModeNames[N] = {"UNDEFINED", "EXACTLY", "AT_MOST"};
|
|
3630
|
-
const char* kLayoutModeNames[N] = {
|
|
3631
|
-
"LAY_UNDEFINED", "LAY_EXACTLY", "LAY_AT_MOST"};
|
|
3632
|
-
|
|
3633
|
-
if (mode >= N) {
|
|
3634
|
-
return "";
|
|
3635
|
-
}
|
|
3636
|
-
|
|
3637
|
-
return performLayout ? kLayoutModeNames[mode] : kMeasureModeNames[mode];
|
|
823
|
+
float YGNodeLayoutGetMargin(YGNodeConstRef node, YGEdge edge) {
|
|
824
|
+
return getResolvedLayoutProperty<&LayoutResults::margin>(node, edge);
|
|
3638
825
|
}
|
|
3639
826
|
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
float size,
|
|
3643
|
-
float lastComputedSize) {
|
|
3644
|
-
return sizeMode == YGMeasureModeExactly &&
|
|
3645
|
-
YGFloatsEqual(size, lastComputedSize);
|
|
827
|
+
float YGNodeLayoutGetBorder(YGNodeConstRef node, YGEdge edge) {
|
|
828
|
+
return getResolvedLayoutProperty<&LayoutResults::border>(node, edge);
|
|
3646
829
|
}
|
|
3647
830
|
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
float size,
|
|
3651
|
-
YGMeasureMode lastSizeMode,
|
|
3652
|
-
float lastComputedSize) {
|
|
3653
|
-
return sizeMode == YGMeasureModeAtMost &&
|
|
3654
|
-
lastSizeMode == YGMeasureModeUndefined &&
|
|
3655
|
-
(size >= lastComputedSize || YGFloatsEqual(size, lastComputedSize));
|
|
831
|
+
float YGNodeLayoutGetPadding(YGNodeConstRef node, YGEdge edge) {
|
|
832
|
+
return getResolvedLayoutProperty<&LayoutResults::padding>(node, edge);
|
|
3656
833
|
}
|
|
3657
834
|
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
YGMeasureMode lastSizeMode,
|
|
3662
|
-
float lastSize,
|
|
3663
|
-
float lastComputedSize) {
|
|
3664
|
-
return lastSizeMode == YGMeasureModeAtMost &&
|
|
3665
|
-
sizeMode == YGMeasureModeAtMost && !YGFloatIsUndefined(lastSize) &&
|
|
3666
|
-
!YGFloatIsUndefined(size) && !YGFloatIsUndefined(lastComputedSize) &&
|
|
3667
|
-
lastSize > size &&
|
|
3668
|
-
(lastComputedSize <= size || YGFloatsEqual(size, lastComputedSize));
|
|
835
|
+
#ifdef DEBUG
|
|
836
|
+
void YGNodePrint(const YGNodeConstRef node, const YGPrintOptions options) {
|
|
837
|
+
yoga::print(resolveRef(node), scopedEnum(options));
|
|
3669
838
|
}
|
|
839
|
+
#endif
|
|
3670
840
|
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
const bool forceCeil,
|
|
3675
|
-
const bool forceFloor) {
|
|
3676
|
-
double scaledValue = value * pointScaleFactor;
|
|
3677
|
-
// We want to calculate `fractial` such that `floor(scaledValue) = scaledValue
|
|
3678
|
-
// - fractial`.
|
|
3679
|
-
double fractial = fmod(scaledValue, 1.0);
|
|
3680
|
-
if (fractial < 0) {
|
|
3681
|
-
// This branch is for handling negative numbers for `value`.
|
|
3682
|
-
//
|
|
3683
|
-
// Regarding `floor` and `ceil`. Note that for a number x, `floor(x) <= x <=
|
|
3684
|
-
// ceil(x)` even for negative numbers. Here are a couple of examples:
|
|
3685
|
-
// - x = 2.2: floor( 2.2) = 2, ceil( 2.2) = 3
|
|
3686
|
-
// - x = -2.2: floor(-2.2) = -3, ceil(-2.2) = -2
|
|
3687
|
-
//
|
|
3688
|
-
// Regarding `fmodf`. For fractional negative numbers, `fmodf` returns a
|
|
3689
|
-
// negative number. For example, `fmodf(-2.2) = -0.2`. However, we want
|
|
3690
|
-
// `fractial` to be the number such that subtracting it from `value` will
|
|
3691
|
-
// give us `floor(value)`. In the case of negative numbers, adding 1 to
|
|
3692
|
-
// `fmodf(value)` gives us this. Let's continue the example from above:
|
|
3693
|
-
// - fractial = fmodf(-2.2) = -0.2
|
|
3694
|
-
// - Add 1 to the fraction: fractial2 = fractial + 1 = -0.2 + 1 = 0.8
|
|
3695
|
-
// - Finding the `floor`: -2.2 - fractial2 = -2.2 - 0.8 = -3
|
|
3696
|
-
++fractial;
|
|
3697
|
-
}
|
|
3698
|
-
if (YGDoubleEqual(fractial, 0)) {
|
|
3699
|
-
// First we check if the value is already rounded
|
|
3700
|
-
scaledValue = scaledValue - fractial;
|
|
3701
|
-
} else if (YGDoubleEqual(fractial, 1.0)) {
|
|
3702
|
-
scaledValue = scaledValue - fractial + 1.0;
|
|
3703
|
-
} else if (forceCeil) {
|
|
3704
|
-
// Next we check if we need to use forced rounding
|
|
3705
|
-
scaledValue = scaledValue - fractial + 1.0;
|
|
3706
|
-
} else if (forceFloor) {
|
|
3707
|
-
scaledValue = scaledValue - fractial;
|
|
3708
|
-
} else {
|
|
3709
|
-
// Finally we just round the value
|
|
3710
|
-
scaledValue = scaledValue - fractial +
|
|
3711
|
-
(!YGDoubleIsUndefined(fractial) &&
|
|
3712
|
-
(fractial > 0.5 || YGDoubleEqual(fractial, 0.5))
|
|
3713
|
-
? 1.0
|
|
3714
|
-
: 0.0);
|
|
3715
|
-
}
|
|
3716
|
-
return (YGDoubleIsUndefined(scaledValue) ||
|
|
3717
|
-
YGDoubleIsUndefined(pointScaleFactor))
|
|
3718
|
-
? YGUndefined
|
|
3719
|
-
: (float) (scaledValue / pointScaleFactor);
|
|
3720
|
-
}
|
|
3721
|
-
|
|
3722
|
-
YOGA_EXPORT bool YGNodeCanUseCachedMeasurement(
|
|
3723
|
-
const YGMeasureMode widthMode,
|
|
3724
|
-
const float width,
|
|
3725
|
-
const YGMeasureMode heightMode,
|
|
3726
|
-
const float height,
|
|
3727
|
-
const YGMeasureMode lastWidthMode,
|
|
3728
|
-
const float lastWidth,
|
|
3729
|
-
const YGMeasureMode lastHeightMode,
|
|
3730
|
-
const float lastHeight,
|
|
3731
|
-
const float lastComputedWidth,
|
|
3732
|
-
const float lastComputedHeight,
|
|
3733
|
-
const float marginRow,
|
|
3734
|
-
const float marginColumn,
|
|
3735
|
-
const YGConfigRef config) {
|
|
3736
|
-
if ((!YGFloatIsUndefined(lastComputedHeight) && lastComputedHeight < 0) ||
|
|
3737
|
-
(!YGFloatIsUndefined(lastComputedWidth) && lastComputedWidth < 0)) {
|
|
3738
|
-
return false;
|
|
3739
|
-
}
|
|
3740
|
-
bool useRoundedComparison =
|
|
3741
|
-
config != nullptr && config->pointScaleFactor != 0;
|
|
3742
|
-
const float effectiveWidth = useRoundedComparison
|
|
3743
|
-
? YGRoundValueToPixelGrid(width, config->pointScaleFactor, false, false)
|
|
3744
|
-
: width;
|
|
3745
|
-
const float effectiveHeight = useRoundedComparison
|
|
3746
|
-
? YGRoundValueToPixelGrid(height, config->pointScaleFactor, false, false)
|
|
3747
|
-
: height;
|
|
3748
|
-
const float effectiveLastWidth = useRoundedComparison
|
|
3749
|
-
? YGRoundValueToPixelGrid(
|
|
3750
|
-
lastWidth, config->pointScaleFactor, false, false)
|
|
3751
|
-
: lastWidth;
|
|
3752
|
-
const float effectiveLastHeight = useRoundedComparison
|
|
3753
|
-
? YGRoundValueToPixelGrid(
|
|
3754
|
-
lastHeight, config->pointScaleFactor, false, false)
|
|
3755
|
-
: lastHeight;
|
|
3756
|
-
|
|
3757
|
-
const bool hasSameWidthSpec = lastWidthMode == widthMode &&
|
|
3758
|
-
YGFloatsEqual(effectiveLastWidth, effectiveWidth);
|
|
3759
|
-
const bool hasSameHeightSpec = lastHeightMode == heightMode &&
|
|
3760
|
-
YGFloatsEqual(effectiveLastHeight, effectiveHeight);
|
|
3761
|
-
|
|
3762
|
-
const bool widthIsCompatible =
|
|
3763
|
-
hasSameWidthSpec ||
|
|
3764
|
-
YGMeasureModeSizeIsExactAndMatchesOldMeasuredSize(
|
|
3765
|
-
widthMode, width - marginRow, lastComputedWidth) ||
|
|
3766
|
-
YGMeasureModeOldSizeIsUnspecifiedAndStillFits(
|
|
3767
|
-
widthMode, width - marginRow, lastWidthMode, lastComputedWidth) ||
|
|
3768
|
-
YGMeasureModeNewMeasureSizeIsStricterAndStillValid(
|
|
3769
|
-
widthMode,
|
|
3770
|
-
width - marginRow,
|
|
3771
|
-
lastWidthMode,
|
|
3772
|
-
lastWidth,
|
|
3773
|
-
lastComputedWidth);
|
|
3774
|
-
|
|
3775
|
-
const bool heightIsCompatible =
|
|
3776
|
-
hasSameHeightSpec ||
|
|
3777
|
-
YGMeasureModeSizeIsExactAndMatchesOldMeasuredSize(
|
|
3778
|
-
heightMode, height - marginColumn, lastComputedHeight) ||
|
|
3779
|
-
YGMeasureModeOldSizeIsUnspecifiedAndStillFits(
|
|
3780
|
-
heightMode,
|
|
3781
|
-
height - marginColumn,
|
|
3782
|
-
lastHeightMode,
|
|
3783
|
-
lastComputedHeight) ||
|
|
3784
|
-
YGMeasureModeNewMeasureSizeIsStricterAndStillValid(
|
|
3785
|
-
heightMode,
|
|
3786
|
-
height - marginColumn,
|
|
3787
|
-
lastHeightMode,
|
|
3788
|
-
lastHeight,
|
|
3789
|
-
lastComputedHeight);
|
|
3790
|
-
|
|
3791
|
-
return widthIsCompatible && heightIsCompatible;
|
|
3792
|
-
}
|
|
3793
|
-
|
|
3794
|
-
//
|
|
3795
|
-
// This is a wrapper around the YGNodelayoutImpl function. It determines whether
|
|
3796
|
-
// the layout request is redundant and can be skipped.
|
|
3797
|
-
//
|
|
3798
|
-
// Parameters:
|
|
3799
|
-
// Input parameters are the same as YGNodelayoutImpl (see above)
|
|
3800
|
-
// Return parameter is true if layout was performed, false if skipped
|
|
3801
|
-
//
|
|
3802
|
-
bool YGLayoutNodeInternal(
|
|
3803
|
-
const YGNodeRef node,
|
|
3804
|
-
const float availableWidth,
|
|
3805
|
-
const float availableHeight,
|
|
3806
|
-
const YGDirection ownerDirection,
|
|
3807
|
-
const YGMeasureMode widthMeasureMode,
|
|
3808
|
-
const YGMeasureMode heightMeasureMode,
|
|
3809
|
-
const float ownerWidth,
|
|
3810
|
-
const float ownerHeight,
|
|
3811
|
-
const bool performLayout,
|
|
3812
|
-
const LayoutPassReason reason,
|
|
3813
|
-
const YGConfigRef config,
|
|
3814
|
-
LayoutData& layoutMarkerData,
|
|
3815
|
-
void* const layoutContext,
|
|
3816
|
-
uint32_t depth,
|
|
3817
|
-
const uint32_t generationCount) {
|
|
3818
|
-
YGLayout* layout = &node->getLayout();
|
|
3819
|
-
|
|
3820
|
-
depth++;
|
|
3821
|
-
|
|
3822
|
-
const bool needToVisitNode =
|
|
3823
|
-
(node->isDirty() && layout->generationCount != generationCount) ||
|
|
3824
|
-
layout->lastOwnerDirection != ownerDirection;
|
|
3825
|
-
|
|
3826
|
-
if (needToVisitNode) {
|
|
3827
|
-
// Invalidate the cached results.
|
|
3828
|
-
layout->nextCachedMeasurementsIndex = 0;
|
|
3829
|
-
layout->cachedLayout.availableWidth = -1;
|
|
3830
|
-
layout->cachedLayout.availableHeight = -1;
|
|
3831
|
-
layout->cachedLayout.widthMeasureMode = YGMeasureModeUndefined;
|
|
3832
|
-
layout->cachedLayout.heightMeasureMode = YGMeasureModeUndefined;
|
|
3833
|
-
layout->cachedLayout.computedWidth = -1;
|
|
3834
|
-
layout->cachedLayout.computedHeight = -1;
|
|
3835
|
-
}
|
|
3836
|
-
|
|
3837
|
-
YGCachedMeasurement* cachedResults = nullptr;
|
|
3838
|
-
|
|
3839
|
-
// Determine whether the results are already cached. We maintain a separate
|
|
3840
|
-
// cache for layouts and measurements. A layout operation modifies the
|
|
3841
|
-
// positions and dimensions for nodes in the subtree. The algorithm assumes
|
|
3842
|
-
// that each node gets laid out a maximum of one time per tree layout, but
|
|
3843
|
-
// multiple measurements may be required to resolve all of the flex
|
|
3844
|
-
// dimensions. We handle nodes with measure functions specially here because
|
|
3845
|
-
// they are the most expensive to measure, so it's worth avoiding redundant
|
|
3846
|
-
// measurements if at all possible.
|
|
3847
|
-
if (node->hasMeasureFunc()) {
|
|
3848
|
-
const float marginAxisRow =
|
|
3849
|
-
node->getMarginForAxis(YGFlexDirectionRow, ownerWidth).unwrap();
|
|
3850
|
-
const float marginAxisColumn =
|
|
3851
|
-
node->getMarginForAxis(YGFlexDirectionColumn, ownerWidth).unwrap();
|
|
3852
|
-
|
|
3853
|
-
// First, try to use the layout cache.
|
|
3854
|
-
if (YGNodeCanUseCachedMeasurement(
|
|
3855
|
-
widthMeasureMode,
|
|
3856
|
-
availableWidth,
|
|
3857
|
-
heightMeasureMode,
|
|
3858
|
-
availableHeight,
|
|
3859
|
-
layout->cachedLayout.widthMeasureMode,
|
|
3860
|
-
layout->cachedLayout.availableWidth,
|
|
3861
|
-
layout->cachedLayout.heightMeasureMode,
|
|
3862
|
-
layout->cachedLayout.availableHeight,
|
|
3863
|
-
layout->cachedLayout.computedWidth,
|
|
3864
|
-
layout->cachedLayout.computedHeight,
|
|
3865
|
-
marginAxisRow,
|
|
3866
|
-
marginAxisColumn,
|
|
3867
|
-
config)) {
|
|
3868
|
-
cachedResults = &layout->cachedLayout;
|
|
3869
|
-
} else {
|
|
3870
|
-
// Try to use the measurement cache.
|
|
3871
|
-
for (uint32_t i = 0; i < layout->nextCachedMeasurementsIndex; i++) {
|
|
3872
|
-
if (YGNodeCanUseCachedMeasurement(
|
|
3873
|
-
widthMeasureMode,
|
|
3874
|
-
availableWidth,
|
|
3875
|
-
heightMeasureMode,
|
|
3876
|
-
availableHeight,
|
|
3877
|
-
layout->cachedMeasurements[i].widthMeasureMode,
|
|
3878
|
-
layout->cachedMeasurements[i].availableWidth,
|
|
3879
|
-
layout->cachedMeasurements[i].heightMeasureMode,
|
|
3880
|
-
layout->cachedMeasurements[i].availableHeight,
|
|
3881
|
-
layout->cachedMeasurements[i].computedWidth,
|
|
3882
|
-
layout->cachedMeasurements[i].computedHeight,
|
|
3883
|
-
marginAxisRow,
|
|
3884
|
-
marginAxisColumn,
|
|
3885
|
-
config)) {
|
|
3886
|
-
cachedResults = &layout->cachedMeasurements[i];
|
|
3887
|
-
break;
|
|
3888
|
-
}
|
|
3889
|
-
}
|
|
3890
|
-
}
|
|
3891
|
-
} else if (performLayout) {
|
|
3892
|
-
if (YGFloatsEqual(layout->cachedLayout.availableWidth, availableWidth) &&
|
|
3893
|
-
YGFloatsEqual(layout->cachedLayout.availableHeight, availableHeight) &&
|
|
3894
|
-
layout->cachedLayout.widthMeasureMode == widthMeasureMode &&
|
|
3895
|
-
layout->cachedLayout.heightMeasureMode == heightMeasureMode) {
|
|
3896
|
-
cachedResults = &layout->cachedLayout;
|
|
3897
|
-
}
|
|
3898
|
-
} else {
|
|
3899
|
-
for (uint32_t i = 0; i < layout->nextCachedMeasurementsIndex; i++) {
|
|
3900
|
-
if (YGFloatsEqual(
|
|
3901
|
-
layout->cachedMeasurements[i].availableWidth, availableWidth) &&
|
|
3902
|
-
YGFloatsEqual(
|
|
3903
|
-
layout->cachedMeasurements[i].availableHeight, availableHeight) &&
|
|
3904
|
-
layout->cachedMeasurements[i].widthMeasureMode == widthMeasureMode &&
|
|
3905
|
-
layout->cachedMeasurements[i].heightMeasureMode ==
|
|
3906
|
-
heightMeasureMode) {
|
|
3907
|
-
cachedResults = &layout->cachedMeasurements[i];
|
|
3908
|
-
break;
|
|
3909
|
-
}
|
|
3910
|
-
}
|
|
3911
|
-
}
|
|
3912
|
-
|
|
3913
|
-
if (!needToVisitNode && cachedResults != nullptr) {
|
|
3914
|
-
layout->measuredDimensions[YGDimensionWidth] = cachedResults->computedWidth;
|
|
3915
|
-
layout->measuredDimensions[YGDimensionHeight] =
|
|
3916
|
-
cachedResults->computedHeight;
|
|
3917
|
-
|
|
3918
|
-
(performLayout ? layoutMarkerData.cachedLayouts
|
|
3919
|
-
: layoutMarkerData.cachedMeasures) += 1;
|
|
3920
|
-
|
|
3921
|
-
if (gPrintChanges && gPrintSkips) {
|
|
3922
|
-
Log::log(
|
|
3923
|
-
node,
|
|
3924
|
-
YGLogLevelVerbose,
|
|
3925
|
-
nullptr,
|
|
3926
|
-
"%s%d.{[skipped] ",
|
|
3927
|
-
YGSpacer(depth),
|
|
3928
|
-
depth);
|
|
3929
|
-
node->print(layoutContext);
|
|
3930
|
-
Log::log(
|
|
3931
|
-
node,
|
|
3932
|
-
YGLogLevelVerbose,
|
|
3933
|
-
nullptr,
|
|
3934
|
-
"wm: %s, hm: %s, aw: %f ah: %f => d: (%f, %f) %s\n",
|
|
3935
|
-
YGMeasureModeName(widthMeasureMode, performLayout),
|
|
3936
|
-
YGMeasureModeName(heightMeasureMode, performLayout),
|
|
3937
|
-
availableWidth,
|
|
3938
|
-
availableHeight,
|
|
3939
|
-
cachedResults->computedWidth,
|
|
3940
|
-
cachedResults->computedHeight,
|
|
3941
|
-
LayoutPassReasonToString(reason));
|
|
3942
|
-
}
|
|
3943
|
-
} else {
|
|
3944
|
-
if (gPrintChanges) {
|
|
3945
|
-
Log::log(
|
|
3946
|
-
node,
|
|
3947
|
-
YGLogLevelVerbose,
|
|
3948
|
-
nullptr,
|
|
3949
|
-
"%s%d.{%s",
|
|
3950
|
-
YGSpacer(depth),
|
|
3951
|
-
depth,
|
|
3952
|
-
needToVisitNode ? "*" : "");
|
|
3953
|
-
node->print(layoutContext);
|
|
3954
|
-
Log::log(
|
|
3955
|
-
node,
|
|
3956
|
-
YGLogLevelVerbose,
|
|
3957
|
-
nullptr,
|
|
3958
|
-
"wm: %s, hm: %s, aw: %f ah: %f %s\n",
|
|
3959
|
-
YGMeasureModeName(widthMeasureMode, performLayout),
|
|
3960
|
-
YGMeasureModeName(heightMeasureMode, performLayout),
|
|
3961
|
-
availableWidth,
|
|
3962
|
-
availableHeight,
|
|
3963
|
-
LayoutPassReasonToString(reason));
|
|
3964
|
-
}
|
|
3965
|
-
|
|
3966
|
-
YGNodelayoutImpl(
|
|
3967
|
-
node,
|
|
3968
|
-
availableWidth,
|
|
3969
|
-
availableHeight,
|
|
3970
|
-
ownerDirection,
|
|
3971
|
-
widthMeasureMode,
|
|
3972
|
-
heightMeasureMode,
|
|
3973
|
-
ownerWidth,
|
|
3974
|
-
ownerHeight,
|
|
3975
|
-
performLayout,
|
|
3976
|
-
config,
|
|
3977
|
-
layoutMarkerData,
|
|
3978
|
-
layoutContext,
|
|
3979
|
-
depth,
|
|
3980
|
-
generationCount,
|
|
3981
|
-
reason);
|
|
3982
|
-
|
|
3983
|
-
if (gPrintChanges) {
|
|
3984
|
-
Log::log(
|
|
3985
|
-
node,
|
|
3986
|
-
YGLogLevelVerbose,
|
|
3987
|
-
nullptr,
|
|
3988
|
-
"%s%d.}%s",
|
|
3989
|
-
YGSpacer(depth),
|
|
3990
|
-
depth,
|
|
3991
|
-
needToVisitNode ? "*" : "");
|
|
3992
|
-
node->print(layoutContext);
|
|
3993
|
-
Log::log(
|
|
3994
|
-
node,
|
|
3995
|
-
YGLogLevelVerbose,
|
|
3996
|
-
nullptr,
|
|
3997
|
-
"wm: %s, hm: %s, d: (%f, %f) %s\n",
|
|
3998
|
-
YGMeasureModeName(widthMeasureMode, performLayout),
|
|
3999
|
-
YGMeasureModeName(heightMeasureMode, performLayout),
|
|
4000
|
-
layout->measuredDimensions[YGDimensionWidth],
|
|
4001
|
-
layout->measuredDimensions[YGDimensionHeight],
|
|
4002
|
-
LayoutPassReasonToString(reason));
|
|
4003
|
-
}
|
|
4004
|
-
|
|
4005
|
-
layout->lastOwnerDirection = ownerDirection;
|
|
4006
|
-
|
|
4007
|
-
if (cachedResults == nullptr) {
|
|
4008
|
-
if (layout->nextCachedMeasurementsIndex + 1 >
|
|
4009
|
-
(uint32_t) layoutMarkerData.maxMeasureCache) {
|
|
4010
|
-
layoutMarkerData.maxMeasureCache =
|
|
4011
|
-
layout->nextCachedMeasurementsIndex + 1;
|
|
4012
|
-
}
|
|
4013
|
-
if (layout->nextCachedMeasurementsIndex == YG_MAX_CACHED_RESULT_COUNT) {
|
|
4014
|
-
if (gPrintChanges) {
|
|
4015
|
-
Log::log(node, YGLogLevelVerbose, nullptr, "Out of cache entries!\n");
|
|
4016
|
-
}
|
|
4017
|
-
layout->nextCachedMeasurementsIndex = 0;
|
|
4018
|
-
}
|
|
4019
|
-
|
|
4020
|
-
YGCachedMeasurement* newCacheEntry;
|
|
4021
|
-
if (performLayout) {
|
|
4022
|
-
// Use the single layout cache entry.
|
|
4023
|
-
newCacheEntry = &layout->cachedLayout;
|
|
4024
|
-
} else {
|
|
4025
|
-
// Allocate a new measurement cache entry.
|
|
4026
|
-
newCacheEntry =
|
|
4027
|
-
&layout->cachedMeasurements[layout->nextCachedMeasurementsIndex];
|
|
4028
|
-
layout->nextCachedMeasurementsIndex++;
|
|
4029
|
-
}
|
|
4030
|
-
|
|
4031
|
-
newCacheEntry->availableWidth = availableWidth;
|
|
4032
|
-
newCacheEntry->availableHeight = availableHeight;
|
|
4033
|
-
newCacheEntry->widthMeasureMode = widthMeasureMode;
|
|
4034
|
-
newCacheEntry->heightMeasureMode = heightMeasureMode;
|
|
4035
|
-
newCacheEntry->computedWidth =
|
|
4036
|
-
layout->measuredDimensions[YGDimensionWidth];
|
|
4037
|
-
newCacheEntry->computedHeight =
|
|
4038
|
-
layout->measuredDimensions[YGDimensionHeight];
|
|
4039
|
-
}
|
|
4040
|
-
}
|
|
4041
|
-
|
|
4042
|
-
if (performLayout) {
|
|
4043
|
-
node->setLayoutDimension(
|
|
4044
|
-
node->getLayout().measuredDimensions[YGDimensionWidth],
|
|
4045
|
-
YGDimensionWidth);
|
|
4046
|
-
node->setLayoutDimension(
|
|
4047
|
-
node->getLayout().measuredDimensions[YGDimensionHeight],
|
|
4048
|
-
YGDimensionHeight);
|
|
4049
|
-
|
|
4050
|
-
node->setHasNewLayout(true);
|
|
4051
|
-
node->setDirty(false);
|
|
4052
|
-
}
|
|
4053
|
-
|
|
4054
|
-
layout->generationCount = generationCount;
|
|
4055
|
-
|
|
4056
|
-
LayoutType layoutType;
|
|
4057
|
-
if (performLayout) {
|
|
4058
|
-
layoutType = !needToVisitNode && cachedResults == &layout->cachedLayout
|
|
4059
|
-
? LayoutType::kCachedLayout
|
|
4060
|
-
: LayoutType::kLayout;
|
|
841
|
+
void YGConfigSetLogger(const YGConfigRef config, YGLogger logger) {
|
|
842
|
+
if (logger != nullptr) {
|
|
843
|
+
resolveRef(config)->setLogger(logger);
|
|
4061
844
|
} else {
|
|
4062
|
-
|
|
4063
|
-
: LayoutType::kMeasure;
|
|
845
|
+
resolveRef(config)->setLogger(getDefaultLogger());
|
|
4064
846
|
}
|
|
4065
|
-
Event::publish<Event::NodeLayout>(node, {layoutType, layoutContext});
|
|
4066
|
-
|
|
4067
|
-
return (needToVisitNode || cachedResults == nullptr);
|
|
4068
847
|
}
|
|
4069
848
|
|
|
4070
|
-
|
|
849
|
+
void YGConfigSetPointScaleFactor(
|
|
4071
850
|
const YGConfigRef config,
|
|
4072
851
|
const float pixelsInPoint) {
|
|
4073
|
-
|
|
4074
|
-
config,
|
|
852
|
+
yoga::assertFatalWithConfig(
|
|
853
|
+
resolveRef(config),
|
|
4075
854
|
pixelsInPoint >= 0.0f,
|
|
4076
855
|
"Scale factor should not be less than zero");
|
|
4077
856
|
|
|
4078
857
|
// We store points for Pixel as we will use it for rounding
|
|
4079
858
|
if (pixelsInPoint == 0.0f) {
|
|
4080
859
|
// Zero is used to skip rounding
|
|
4081
|
-
config->
|
|
860
|
+
resolveRef(config)->setPointScaleFactor(0.0f);
|
|
4082
861
|
} else {
|
|
4083
|
-
config->
|
|
862
|
+
resolveRef(config)->setPointScaleFactor(pixelsInPoint);
|
|
4084
863
|
}
|
|
4085
864
|
}
|
|
4086
865
|
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
const double pointScaleFactor,
|
|
4090
|
-
const double absoluteLeft,
|
|
4091
|
-
const double absoluteTop) {
|
|
4092
|
-
if (pointScaleFactor == 0.0f) {
|
|
4093
|
-
return;
|
|
4094
|
-
}
|
|
4095
|
-
|
|
4096
|
-
const double nodeLeft = node->getLayout().position[YGEdgeLeft];
|
|
4097
|
-
const double nodeTop = node->getLayout().position[YGEdgeTop];
|
|
4098
|
-
|
|
4099
|
-
const double nodeWidth = node->getLayout().dimensions[YGDimensionWidth];
|
|
4100
|
-
const double nodeHeight = node->getLayout().dimensions[YGDimensionHeight];
|
|
4101
|
-
|
|
4102
|
-
const double absoluteNodeLeft = absoluteLeft + nodeLeft;
|
|
4103
|
-
const double absoluteNodeTop = absoluteTop + nodeTop;
|
|
4104
|
-
|
|
4105
|
-
const double absoluteNodeRight = absoluteNodeLeft + nodeWidth;
|
|
4106
|
-
const double absoluteNodeBottom = absoluteNodeTop + nodeHeight;
|
|
4107
|
-
|
|
4108
|
-
// If a node has a custom measure function we never want to round down its
|
|
4109
|
-
// size as this could lead to unwanted text truncation.
|
|
4110
|
-
const bool textRounding = node->getNodeType() == YGNodeTypeText;
|
|
4111
|
-
|
|
4112
|
-
node->setLayoutPosition(
|
|
4113
|
-
YGRoundValueToPixelGrid(nodeLeft, pointScaleFactor, false, textRounding),
|
|
4114
|
-
YGEdgeLeft);
|
|
4115
|
-
|
|
4116
|
-
node->setLayoutPosition(
|
|
4117
|
-
YGRoundValueToPixelGrid(nodeTop, pointScaleFactor, false, textRounding),
|
|
4118
|
-
YGEdgeTop);
|
|
4119
|
-
|
|
4120
|
-
// We multiply dimension by scale factor and if the result is close to the
|
|
4121
|
-
// whole number, we don't have any fraction To verify if the result is close
|
|
4122
|
-
// to whole number we want to check both floor and ceil numbers
|
|
4123
|
-
const bool hasFractionalWidth =
|
|
4124
|
-
!YGDoubleEqual(fmod(nodeWidth * pointScaleFactor, 1.0), 0) &&
|
|
4125
|
-
!YGDoubleEqual(fmod(nodeWidth * pointScaleFactor, 1.0), 1.0);
|
|
4126
|
-
const bool hasFractionalHeight =
|
|
4127
|
-
!YGDoubleEqual(fmod(nodeHeight * pointScaleFactor, 1.0), 0) &&
|
|
4128
|
-
!YGDoubleEqual(fmod(nodeHeight * pointScaleFactor, 1.0), 1.0);
|
|
4129
|
-
|
|
4130
|
-
node->setLayoutDimension(
|
|
4131
|
-
YGRoundValueToPixelGrid(
|
|
4132
|
-
absoluteNodeRight,
|
|
4133
|
-
pointScaleFactor,
|
|
4134
|
-
(textRounding && hasFractionalWidth),
|
|
4135
|
-
(textRounding && !hasFractionalWidth)) -
|
|
4136
|
-
YGRoundValueToPixelGrid(
|
|
4137
|
-
absoluteNodeLeft, pointScaleFactor, false, textRounding),
|
|
4138
|
-
YGDimensionWidth);
|
|
4139
|
-
|
|
4140
|
-
node->setLayoutDimension(
|
|
4141
|
-
YGRoundValueToPixelGrid(
|
|
4142
|
-
absoluteNodeBottom,
|
|
4143
|
-
pointScaleFactor,
|
|
4144
|
-
(textRounding && hasFractionalHeight),
|
|
4145
|
-
(textRounding && !hasFractionalHeight)) -
|
|
4146
|
-
YGRoundValueToPixelGrid(
|
|
4147
|
-
absoluteNodeTop, pointScaleFactor, false, textRounding),
|
|
4148
|
-
YGDimensionHeight);
|
|
4149
|
-
|
|
4150
|
-
const uint32_t childCount = YGNodeGetChildCount(node);
|
|
4151
|
-
for (uint32_t i = 0; i < childCount; i++) {
|
|
4152
|
-
YGRoundToPixelGrid(
|
|
4153
|
-
YGNodeGetChild(node, i),
|
|
4154
|
-
pointScaleFactor,
|
|
4155
|
-
absoluteNodeLeft,
|
|
4156
|
-
absoluteNodeTop);
|
|
4157
|
-
}
|
|
4158
|
-
}
|
|
4159
|
-
|
|
4160
|
-
YOGA_EXPORT void YGNodeCalculateLayoutWithContext(
|
|
4161
|
-
const YGNodeRef node,
|
|
4162
|
-
const float ownerWidth,
|
|
4163
|
-
const float ownerHeight,
|
|
4164
|
-
const YGDirection ownerDirection,
|
|
4165
|
-
void* layoutContext) {
|
|
4166
|
-
|
|
4167
|
-
Event::publish<Event::LayoutPassStart>(node, {layoutContext});
|
|
4168
|
-
LayoutData markerData = {};
|
|
4169
|
-
|
|
4170
|
-
// Increment the generation count. This will force the recursive routine to
|
|
4171
|
-
// visit all dirty nodes at least once. Subsequent visits will be skipped if
|
|
4172
|
-
// the input parameters don't change.
|
|
4173
|
-
gCurrentGenerationCount.fetch_add(1, std::memory_order_relaxed);
|
|
4174
|
-
node->resolveDimension();
|
|
4175
|
-
float width = YGUndefined;
|
|
4176
|
-
YGMeasureMode widthMeasureMode = YGMeasureModeUndefined;
|
|
4177
|
-
const auto& maxDimensions = node->getStyle().maxDimensions();
|
|
4178
|
-
if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow, ownerWidth)) {
|
|
4179
|
-
width =
|
|
4180
|
-
(YGResolveValue(
|
|
4181
|
-
node->getResolvedDimension(dim[YGFlexDirectionRow]), ownerWidth) +
|
|
4182
|
-
node->getMarginForAxis(YGFlexDirectionRow, ownerWidth))
|
|
4183
|
-
.unwrap();
|
|
4184
|
-
widthMeasureMode = YGMeasureModeExactly;
|
|
4185
|
-
} else if (!YGResolveValue(maxDimensions[YGDimensionWidth], ownerWidth)
|
|
4186
|
-
.isUndefined()) {
|
|
4187
|
-
width =
|
|
4188
|
-
YGResolveValue(maxDimensions[YGDimensionWidth], ownerWidth).unwrap();
|
|
4189
|
-
widthMeasureMode = YGMeasureModeAtMost;
|
|
4190
|
-
} else {
|
|
4191
|
-
width = ownerWidth;
|
|
4192
|
-
widthMeasureMode = YGFloatIsUndefined(width) ? YGMeasureModeUndefined
|
|
4193
|
-
: YGMeasureModeExactly;
|
|
4194
|
-
}
|
|
4195
|
-
|
|
4196
|
-
float height = YGUndefined;
|
|
4197
|
-
YGMeasureMode heightMeasureMode = YGMeasureModeUndefined;
|
|
4198
|
-
if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn, ownerHeight)) {
|
|
4199
|
-
height = (YGResolveValue(
|
|
4200
|
-
node->getResolvedDimension(dim[YGFlexDirectionColumn]),
|
|
4201
|
-
ownerHeight) +
|
|
4202
|
-
node->getMarginForAxis(YGFlexDirectionColumn, ownerWidth))
|
|
4203
|
-
.unwrap();
|
|
4204
|
-
heightMeasureMode = YGMeasureModeExactly;
|
|
4205
|
-
} else if (!YGResolveValue(maxDimensions[YGDimensionHeight], ownerHeight)
|
|
4206
|
-
.isUndefined()) {
|
|
4207
|
-
height =
|
|
4208
|
-
YGResolveValue(maxDimensions[YGDimensionHeight], ownerHeight).unwrap();
|
|
4209
|
-
heightMeasureMode = YGMeasureModeAtMost;
|
|
4210
|
-
} else {
|
|
4211
|
-
height = ownerHeight;
|
|
4212
|
-
heightMeasureMode = YGFloatIsUndefined(height) ? YGMeasureModeUndefined
|
|
4213
|
-
: YGMeasureModeExactly;
|
|
4214
|
-
}
|
|
4215
|
-
if (YGLayoutNodeInternal(
|
|
4216
|
-
node,
|
|
4217
|
-
width,
|
|
4218
|
-
height,
|
|
4219
|
-
ownerDirection,
|
|
4220
|
-
widthMeasureMode,
|
|
4221
|
-
heightMeasureMode,
|
|
4222
|
-
ownerWidth,
|
|
4223
|
-
ownerHeight,
|
|
4224
|
-
true,
|
|
4225
|
-
LayoutPassReason::kInitial,
|
|
4226
|
-
node->getConfig(),
|
|
4227
|
-
markerData,
|
|
4228
|
-
layoutContext,
|
|
4229
|
-
0, // tree root
|
|
4230
|
-
gCurrentGenerationCount.load(std::memory_order_relaxed))) {
|
|
4231
|
-
node->setPosition(
|
|
4232
|
-
node->getLayout().direction(), ownerWidth, ownerHeight, ownerWidth);
|
|
4233
|
-
YGRoundToPixelGrid(node, node->getConfig()->pointScaleFactor, 0.0f, 0.0f);
|
|
4234
|
-
|
|
4235
|
-
#ifdef DEBUG
|
|
4236
|
-
if (node->getConfig()->printTree) {
|
|
4237
|
-
YGNodePrint(
|
|
4238
|
-
node,
|
|
4239
|
-
(YGPrintOptions) (YGPrintOptionsLayout | YGPrintOptionsChildren | YGPrintOptionsStyle));
|
|
4240
|
-
}
|
|
4241
|
-
#endif
|
|
4242
|
-
}
|
|
4243
|
-
|
|
4244
|
-
Event::publish<Event::LayoutPassEnd>(node, {layoutContext, &markerData});
|
|
4245
|
-
}
|
|
4246
|
-
|
|
4247
|
-
YOGA_EXPORT void YGNodeCalculateLayout(
|
|
4248
|
-
const YGNodeRef node,
|
|
4249
|
-
const float ownerWidth,
|
|
4250
|
-
const float ownerHeight,
|
|
4251
|
-
const YGDirection ownerDirection) {
|
|
4252
|
-
YGNodeCalculateLayoutWithContext(
|
|
4253
|
-
node, ownerWidth, ownerHeight, ownerDirection, nullptr);
|
|
4254
|
-
}
|
|
4255
|
-
|
|
4256
|
-
YOGA_EXPORT void YGConfigSetLogger(const YGConfigRef config, YGLogger logger) {
|
|
4257
|
-
if (logger != nullptr) {
|
|
4258
|
-
config->setLogger(logger);
|
|
4259
|
-
} else {
|
|
4260
|
-
#ifdef ANDROID
|
|
4261
|
-
config->setLogger(&YGAndroidLog);
|
|
4262
|
-
#else
|
|
4263
|
-
config->setLogger(&YGDefaultLog);
|
|
4264
|
-
#endif
|
|
4265
|
-
}
|
|
4266
|
-
}
|
|
4267
|
-
|
|
4268
|
-
void YGAssert(const bool condition, const char* message) {
|
|
4269
|
-
if (!condition) {
|
|
4270
|
-
Log::log(YGNodeRef{nullptr}, YGLogLevelFatal, nullptr, "%s\n", message);
|
|
4271
|
-
throwLogicalErrorWithMessage(message);
|
|
4272
|
-
}
|
|
866
|
+
float YGConfigGetPointScaleFactor(const YGConfigConstRef config) {
|
|
867
|
+
return resolveRef(config)->getPointScaleFactor();
|
|
4273
868
|
}
|
|
4274
869
|
|
|
4275
|
-
|
|
4276
|
-
const
|
|
4277
|
-
const
|
|
4278
|
-
const
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
}
|
|
4283
|
-
}
|
|
4284
|
-
|
|
4285
|
-
void YGAssertWithConfig(
|
|
4286
|
-
const YGConfigRef config,
|
|
4287
|
-
const bool condition,
|
|
4288
|
-
const char* message) {
|
|
4289
|
-
if (!condition) {
|
|
4290
|
-
Log::log(config, YGLogLevelFatal, nullptr, "%s\n", message);
|
|
4291
|
-
throwLogicalErrorWithMessage(message);
|
|
4292
|
-
}
|
|
870
|
+
float YGRoundValueToPixelGrid(
|
|
871
|
+
const double value,
|
|
872
|
+
const double pointScaleFactor,
|
|
873
|
+
const bool forceCeil,
|
|
874
|
+
const bool forceFloor) {
|
|
875
|
+
return yoga::roundValueToPixelGrid(
|
|
876
|
+
value, pointScaleFactor, forceCeil, forceFloor);
|
|
4293
877
|
}
|
|
4294
878
|
|
|
4295
|
-
|
|
879
|
+
void YGConfigSetExperimentalFeatureEnabled(
|
|
4296
880
|
const YGConfigRef config,
|
|
4297
881
|
const YGExperimentalFeature feature,
|
|
4298
882
|
const bool enabled) {
|
|
4299
|
-
config->
|
|
883
|
+
resolveRef(config)->setExperimentalFeatureEnabled(
|
|
884
|
+
scopedEnum(feature), enabled);
|
|
4300
885
|
}
|
|
4301
886
|
|
|
4302
|
-
|
|
4303
|
-
const
|
|
887
|
+
bool YGConfigIsExperimentalFeatureEnabled(
|
|
888
|
+
const YGConfigConstRef config,
|
|
4304
889
|
const YGExperimentalFeature feature) {
|
|
4305
|
-
return config->
|
|
890
|
+
return resolveRef(config)->isExperimentalFeatureEnabled(scopedEnum(feature));
|
|
4306
891
|
}
|
|
4307
892
|
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
const bool enabled) {
|
|
4311
|
-
config->useWebDefaults = enabled;
|
|
893
|
+
void YGConfigSetUseWebDefaults(const YGConfigRef config, const bool enabled) {
|
|
894
|
+
resolveRef(config)->setUseWebDefaults(enabled);
|
|
4312
895
|
}
|
|
4313
896
|
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
return config->useLegacyStretchBehaviour;
|
|
897
|
+
bool YGConfigGetUseWebDefaults(const YGConfigConstRef config) {
|
|
898
|
+
return resolveRef(config)->useWebDefaults();
|
|
4317
899
|
}
|
|
4318
900
|
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
const bool useLegacyStretchBehaviour) {
|
|
4322
|
-
config->useLegacyStretchBehaviour = useLegacyStretchBehaviour;
|
|
901
|
+
void YGConfigSetContext(const YGConfigRef config, void* context) {
|
|
902
|
+
resolveRef(config)->setContext(context);
|
|
4323
903
|
}
|
|
4324
904
|
|
|
4325
|
-
|
|
4326
|
-
return config->
|
|
905
|
+
void* YGConfigGetContext(const YGConfigConstRef config) {
|
|
906
|
+
return resolveRef(config)->getContext();
|
|
4327
907
|
}
|
|
4328
908
|
|
|
4329
|
-
|
|
4330
|
-
config->
|
|
909
|
+
void YGConfigSetErrata(YGConfigRef config, YGErrata errata) {
|
|
910
|
+
resolveRef(config)->setErrata(scopedEnum(errata));
|
|
4331
911
|
}
|
|
4332
912
|
|
|
4333
|
-
|
|
4334
|
-
return config->
|
|
913
|
+
YGErrata YGConfigGetErrata(YGConfigConstRef config) {
|
|
914
|
+
return unscopedEnum(resolveRef(config)->getErrata());
|
|
4335
915
|
}
|
|
4336
916
|
|
|
4337
|
-
|
|
917
|
+
void YGConfigSetCloneNodeFunc(
|
|
4338
918
|
const YGConfigRef config,
|
|
4339
919
|
const YGCloneNodeFunc callback) {
|
|
4340
|
-
config->setCloneNodeCallback(callback);
|
|
920
|
+
resolveRef(config)->setCloneNodeCallback(callback);
|
|
4341
921
|
}
|
|
4342
922
|
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
923
|
+
// TODO: This should not be part of the public API. Remove after removing
|
|
924
|
+
// ComponentKit usage of it.
|
|
925
|
+
bool YGNodeCanUseCachedMeasurement(
|
|
926
|
+
YGMeasureMode widthMode,
|
|
927
|
+
float availableWidth,
|
|
928
|
+
YGMeasureMode heightMode,
|
|
929
|
+
float availableHeight,
|
|
930
|
+
YGMeasureMode lastWidthMode,
|
|
931
|
+
float lastAvailableWidth,
|
|
932
|
+
YGMeasureMode lastHeightMode,
|
|
933
|
+
float lastAvailableHeight,
|
|
934
|
+
float lastComputedWidth,
|
|
935
|
+
float lastComputedHeight,
|
|
936
|
+
float marginRow,
|
|
937
|
+
float marginColumn,
|
|
938
|
+
YGConfigRef config) {
|
|
939
|
+
return yoga::canUseCachedMeasurement(
|
|
940
|
+
scopedEnum(widthMode),
|
|
941
|
+
availableWidth,
|
|
942
|
+
scopedEnum(heightMode),
|
|
943
|
+
availableHeight,
|
|
944
|
+
scopedEnum(lastWidthMode),
|
|
945
|
+
lastAvailableWidth,
|
|
946
|
+
scopedEnum(lastHeightMode),
|
|
947
|
+
lastAvailableHeight,
|
|
948
|
+
lastComputedWidth,
|
|
949
|
+
lastComputedHeight,
|
|
950
|
+
marginRow,
|
|
951
|
+
marginColumn,
|
|
952
|
+
resolveRef(config));
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
void YGNodeCalculateLayout(
|
|
956
|
+
const YGNodeRef node,
|
|
957
|
+
const float ownerWidth,
|
|
958
|
+
const float ownerHeight,
|
|
959
|
+
const YGDirection ownerDirection) {
|
|
960
|
+
yoga::calculateLayout(
|
|
961
|
+
resolveRef(node), ownerWidth, ownerHeight, scopedEnum(ownerDirection));
|
|
4360
962
|
}
|