react-native-windows 0.75.4 → 0.76.0-preview.1
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/.flowconfig +6 -4
- package/Directory.Build.props +4 -0
- package/Directory.Build.targets +5 -0
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/Alert/Alert.windows.js +3 -0
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +7 -7
- package/Libraries/Animated/NativeAnimatedAllowlist.js +111 -0
- package/Libraries/Animated/animations/Animation.js +11 -1
- package/Libraries/Animated/animations/DecayAnimation.js +1 -1
- package/Libraries/Animated/animations/SpringAnimation.js +1 -1
- package/Libraries/Animated/animations/TimingAnimation.js +2 -1
- package/Libraries/Animated/components/AnimatedScrollView.js +3 -2
- package/Libraries/Animated/createAnimatedComponent.js +10 -9
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +3 -2
- package/Libraries/Animated/nodes/AnimatedNode.js +42 -33
- package/Libraries/Animated/nodes/AnimatedObject.js +56 -50
- package/Libraries/Animated/nodes/AnimatedProps.js +77 -40
- package/Libraries/Animated/nodes/AnimatedStyle.js +103 -59
- package/Libraries/Animated/nodes/AnimatedTracking.js +1 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +102 -67
- package/Libraries/Animated/nodes/AnimatedValue.js +2 -1
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +21 -22
- package/Libraries/Animated/useAnimatedProps.js +142 -7
- package/Libraries/BatchedBridge/NativeModules.js +2 -0
- package/Libraries/Blob/FileReader.js +1 -1
- package/Libraries/Blob/URL.js +2 -62
- package/Libraries/Blob/URLSearchParams.js +71 -0
- package/Libraries/Components/Button.windows.js +0 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
- package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +1 -1
- package/Libraries/Components/ScrollView/ScrollView.js +131 -169
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +3 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +32 -2
- package/Libraries/Components/TextInput/TextInput.js +230 -94
- package/Libraries/Components/TextInput/TextInput.windows.js +230 -105
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +22 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +2 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.windows.js +2 -0
- package/Libraries/Components/View/View.windows.js +32 -30
- package/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
- package/Libraries/Components/View/ViewNativeComponent.js +0 -1
- package/Libraries/Components/View/ViewPropTypes.js +14 -0
- package/Libraries/Components/View/ViewPropTypes.windows.js +14 -0
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/InitializeCore.js +3 -1
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -0
- package/Libraries/Core/ReactNativeVersion.js +4 -4
- package/Libraries/Core/setUpErrorHandling.js +7 -1
- package/Libraries/Core/setUpGlobals.js +1 -0
- package/Libraries/Core/setUpReactRefresh.js +0 -4
- package/Libraries/Image/AssetSourceResolver.js +28 -1
- package/Libraries/Image/AssetSourceResolver.windows.js +28 -1
- package/Libraries/Image/Image.android.js +9 -14
- package/Libraries/Image/Image.ios.js +11 -22
- package/Libraries/Image/Image.windows.js +11 -22
- package/Libraries/Image/ImageBackground.js +1 -8
- package/Libraries/Image/ImageUtils.js +9 -9
- package/Libraries/Image/ImageViewNativeComponent.js +1 -0
- package/Libraries/Inspector/Inspector.js +3 -2
- package/Libraries/Inspector/InspectorPanel.js +16 -10
- package/Libraries/Inspector/NetworkOverlay.js +1 -1
- package/Libraries/Interaction/TaskQueue.js +1 -0
- package/Libraries/Lists/FlatList.js +1 -1
- package/Libraries/Lists/SectionList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +3 -3
- package/Libraries/LogBox/Data/LogBoxData.js +24 -3
- package/Libraries/LogBox/LogBoxNotificationContainer.js +3 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +9 -8
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.windows.js +9 -8
- package/Libraries/Modal/Modal.js +0 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +8 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +7 -0
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +7 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +22 -22
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -21
- package/Libraries/Network/XMLHttpRequest.js +4 -2
- package/Libraries/ReactNative/AppContainer-dev.js +1 -5
- package/Libraries/ReactNative/AppContainer-prod.js +1 -5
- package/Libraries/ReactNative/AppContainer.js +1 -2
- package/Libraries/ReactNative/AppRegistry.d.ts +0 -4
- package/Libraries/ReactNative/AppRegistry.js +1 -7
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +5 -5
- package/Libraries/ReactNative/RendererImplementation.js +26 -4
- package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -0
- package/Libraries/ReactNative/renderApplication.js +1 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +11 -4
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +57 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +60 -5
- package/Libraries/StyleSheet/processBackgroundImage.js +384 -0
- package/Libraries/StyleSheet/processBoxShadow.js +211 -0
- package/Libraries/StyleSheet/processFilter.js +231 -42
- package/Libraries/Text/Text.js +394 -196
- package/Libraries/Text/Text.windows.js +476 -300
- package/Libraries/Text/TextNativeComponent.js +2 -1
- package/Libraries/TurboModule/TurboModuleRegistry.js +13 -50
- package/Libraries/Types/CodegenTypes.js +3 -1
- package/Libraries/Utilities/Appearance.js +108 -84
- package/Libraries/Utilities/DevLoadingView.js +2 -4
- package/Libraries/Utilities/HMRClient.js +2 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/Utilities/createPerformanceLogger.js +0 -9
- package/Libraries/Utilities/stringifyViewConfig.js +22 -0
- package/Libraries/Utilities/useColorScheme.js +3 -3
- package/Libraries/WebSocket/WebSocket.js +1 -1
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +6 -5
- package/Microsoft.ReactNative/ComponentView.idl +11 -0
- package/Microsoft.ReactNative/Composition.Input.idl +1 -0
- package/Microsoft.ReactNative/CompositionSwitcher.idl +3 -0
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +9 -9
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +9 -9
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +7 -9
- package/Microsoft.ReactNative/Fabric/ComponentView.h +5 -6
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +44 -13
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +42 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +81 -63
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +2 -3
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +8 -6
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.cpp +20 -6
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.h +13 -6
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +2 -3
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +72 -54
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +14 -4
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +26 -8
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +5 -2
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +18 -7
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +6 -6
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +97 -140
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +8 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +18 -11
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +5 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +0 -13
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +0 -3
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +29 -4
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +28 -12
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/HostPlatformColor.h +33 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +26 -9
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +10 -4
- package/Microsoft.ReactNative/IReactModuleBuilder.cpp +5 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.h +1 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.idl +9 -0
- package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +8 -1
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +2 -0
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +3 -1
- package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +1 -1
- package/Microsoft.ReactNative/Modules/AppearanceModule.h +7 -1
- package/Microsoft.ReactNative/Modules/DevSettingsModule.cpp +3 -3
- package/Microsoft.ReactNative/Modules/DevSettingsModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp +2 -2
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +9 -0
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +2 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.cpp +121 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.h +90 -0
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.cpp +0 -7
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.h +0 -5
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +5 -1
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.cpp +59 -0
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.h +23 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +179 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.h +35 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +69 -0
- package/Microsoft.ReactNative/ReactNativeIsland.idl +2 -0
- package/Microsoft.ReactNative/ReactNativeWin32App.cpp +82 -0
- package/Microsoft.ReactNative/ReactNativeWin32App.h +38 -0
- package/Microsoft.ReactNative/TurboModulesProvider.cpp +45 -0
- package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +2 -1
- package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +25 -16
- package/Microsoft.ReactNative/packages.fabric.lock.json +159 -0
- package/Microsoft.ReactNative/packages.lock.json +11 -12
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +3 -4
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +3 -0
- package/Microsoft.ReactNative.Cxx/ModuleRegistration.cpp +2 -2
- package/Microsoft.ReactNative.Cxx/ModuleRegistration.h +62 -4
- package/Microsoft.ReactNative.Cxx/NativeModules.h +131 -14
- package/Microsoft.ReactNative.Managed/packages.lock.json +9 -9
- package/Microsoft.ReactNative.Managed.CodeGen/ReactNativeNames.cs +10 -2
- package/PropertySheets/Autolink.props +1 -1
- package/PropertySheets/Bundle.props +1 -1
- package/PropertySheets/Codegen.props +1 -1
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/NuGet.LockFile.props +18 -0
- package/README.md +29 -29
- package/ReactCommon/ReactCommon.vcxproj +5 -1
- package/ReactCommon/ReactCommon.vcxproj.filters +11 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +2 -7
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +441 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +266 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +56 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Base.h +3 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Bridging.h +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Convert.h +172 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/EventEmitter.h +4 -5
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Function.h +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +3 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/scrollview/ScrollViewProps.cpp +9 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/LayoutableShadowNode.cpp +363 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/JSRuntimeFactory.h +22 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +118 -51
- package/ReactCommon/packages.lock.json +2 -2
- package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +8 -1
- package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +2 -2
- package/Shared/Modules/WebSocketModule.cpp +1 -2
- package/Shared/Networking/WinRTWebSocketResource.cpp +4 -1
- package/Shared/Shared.vcxitems +38 -2
- package/Shared/Shared.vcxitems.filters +6 -1
- package/Shared/TurboModuleManager.cpp +0 -3
- package/codegen/NativeLinkingManagerSpec.g.h +3 -3
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +198 -54
- package/codegen/NativeSampleTurboModuleSpec.g.h +35 -0
- package/codegen/rnwcoreJSI-generated.cpp +245 -101
- package/codegen/rnwcoreJSI.h +847 -548
- package/index.js +3 -1
- package/index.windows.js +3 -1
- package/jest/mockComponent.js +4 -1
- package/jest/mockModal.js +1 -3
- package/jest/mockScrollView.js +1 -1
- package/jest/renderer.js +2 -2
- package/jest/setup.js +16 -13
- package/package.json +29 -29
- package/src/private/animated/NativeAnimatedHelper.js +438 -0
- package/src/private/animated/NativeAnimatedValidation.js +64 -0
- package/src/private/components/HScrollViewNativeComponents.js +56 -0
- package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +27 -0
- package/src/private/components/VScrollViewNativeComponents.js +48 -0
- package/src/private/components/useSyncOnScroll.js +48 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +166 -16
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +29 -5
- package/src/private/fusebox/FuseboxSessionObserver.js +42 -0
- package/{Libraries/Core → src/private/renderer/errorhandling}/ErrorHandlers.js +14 -4
- package/src/private/setup/setUpDOM.js +28 -0
- package/src/private/setup/setUpIntersectionObserver.js +27 -0
- package/src/private/setup/setUpMutationObserver.js +26 -0
- package/src/private/setup/setUpPerformanceObserver.js +64 -0
- package/src/private/specs/modules/NativeAppearance.js +3 -3
- package/src/private/specs/modules/NativeLinkingManager.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsWindows.js +7 -0
- package/src/private/specs/modules/NativeSampleTurboModule.js +14 -1
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -4
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserver.js +5 -3
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverEntry.js +3 -3
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverManager.js +14 -17
- package/src/private/{specs/modules → webapis/intersectionobserver/specs}/NativeIntersectionObserver.js +2 -2
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver/specs}/__mocks__/NativeIntersectionObserver.js +4 -4
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js +5 -3
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserverManager.js +24 -15
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js +4 -6
- package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js +2 -2
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver/specs}/__mocks__/NativeMutationObserver.js +5 -5
- package/src/private/webapis/performance/{EventCounts.js → EventTiming.js} +65 -3
- package/src/private/webapis/performance/LongTasks.js +39 -0
- package/src/private/webapis/performance/Performance.js +22 -9
- package/src/private/webapis/performance/PerformanceEntry.js +36 -18
- package/src/private/webapis/performance/PerformanceObserver.js +29 -43
- package/src/private/webapis/performance/RawPerformanceEntry.js +24 -1
- package/src/private/webapis/performance/UserTiming.js +17 -12
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +1 -1
- package/template/cpp-app/src/AutolinkedNativeModules.g.cpp +1 -1
- package/template/cpp-app/src/AutolinkedNativeModules.g.h +1 -1
- package/template/cs-app/src/AutolinkedNativeModules.g.cs +1 -1
- package/template/index.windows.bundle +1 -1
- package/template/metro.config.js +2 -2
- package/template/shared-app/src/AutolinkedNativeModules.g.props +1 -1
- package/template/shared-app/src/AutolinkedNativeModules.g.targets +1 -1
- package/templates/cpp-app/metro.config.js +2 -2
- package/templates/cpp-app/template.config.js +5 -5
- package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.cpp +1 -1
- package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.h +1 -1
- package/templates/cpp-app/windows/MyApp/MyApp.cpp +2 -0
- package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +1 -1
- package/templates/cpp-lib/example/metro.config.js +2 -2
- package/templates/cpp-lib/template.config.js +3 -3
- package/templates/cpp-lib/windows/MyLib/MyLib.h +3 -3
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +1 -1
- package/types/experimental.d.ts +20 -1
- package/Libraries/Animated/NativeAnimatedHelper.js +0 -615
- package/Libraries/Core/setUpIntersectionObserver.js +0 -16
- package/Libraries/Core/setUpMutationObserver.js +0 -16
- package/Libraries/Core/setUpPerformanceObserver.js +0 -18
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +0 -13
- package/Libraries/MutationObserver/NativeMutationObserver.js +0 -13
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +0 -135
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/algorithm/CalculateLayout.cpp +0 -2396
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.cpp +0 -136
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.h +0 -92
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.cpp +0 -48
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.h +0 -122
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/Node.cpp +0 -388
- package/src/private/core/setUpDOM.js +0 -18
- package/src/private/webapis/performance/PerformanceEventTiming.js +0 -55
- /package/src/private/{core → styles}/composeStyles.js +0 -0
|
@@ -67,17 +67,21 @@ struct TraceUpdate {
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
void DebuggingOverlayComponentView::HandleCommand(
|
|
70
|
-
winrt::
|
|
71
|
-
|
|
70
|
+
const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept {
|
|
71
|
+
base_type::HandleCommand(args);
|
|
72
|
+
if (args.Handled())
|
|
73
|
+
return;
|
|
74
|
+
|
|
75
|
+
auto commandName = args.CommandName();
|
|
72
76
|
if (commandName == L"highlightTraceUpdates") {
|
|
73
77
|
std::vector<TraceUpdate> updates;
|
|
74
|
-
winrt::Microsoft::ReactNative::ReadArgs(args, updates);
|
|
78
|
+
winrt::Microsoft::ReactNative::ReadArgs(args.CommandArgs(), updates);
|
|
75
79
|
// TODO should create visuals that get removed after 2 seconds
|
|
76
80
|
return;
|
|
77
81
|
}
|
|
78
82
|
if (commandName == L"highlightElements") {
|
|
79
83
|
std::vector<ElementRectangle> elements;
|
|
80
|
-
winrt::Microsoft::ReactNative::ReadArgs(args, elements);
|
|
84
|
+
winrt::Microsoft::ReactNative::ReadArgs(args.CommandArgs(), elements);
|
|
81
85
|
|
|
82
86
|
if (auto root = rootComponentView()) {
|
|
83
87
|
auto rootVisual = root->OuterVisual();
|
|
@@ -106,8 +110,6 @@ void DebuggingOverlayComponentView::HandleCommand(
|
|
|
106
110
|
}
|
|
107
111
|
return;
|
|
108
112
|
}
|
|
109
|
-
|
|
110
|
-
base_type::HandleCommand(commandName, args);
|
|
111
113
|
}
|
|
112
114
|
|
|
113
115
|
} // namespace winrt::Microsoft::ReactNative::Composition::implementation
|
|
@@ -29,8 +29,7 @@ struct DebuggingOverlayComponentView
|
|
|
29
29
|
facebook::react::Tag tag,
|
|
30
30
|
winrt::Microsoft::ReactNative::ReactContext const &reactContext);
|
|
31
31
|
|
|
32
|
-
void HandleCommand(
|
|
33
|
-
override;
|
|
32
|
+
void HandleCommand(const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept override;
|
|
34
33
|
|
|
35
34
|
private:
|
|
36
35
|
uint32_t m_activeOverlays{0};
|
|
@@ -22,19 +22,26 @@ int32_t GotFocusEventArgs::OriginalSource() noexcept {
|
|
|
22
22
|
|
|
23
23
|
LosingFocusEventArgs::LosingFocusEventArgs(
|
|
24
24
|
const winrt::Microsoft::ReactNative::ComponentView &originalSource,
|
|
25
|
+
winrt::Microsoft::ReactNative::FocusNavigationDirection direction,
|
|
25
26
|
const winrt::Microsoft::ReactNative::ComponentView &oldFocusedComponent,
|
|
26
27
|
const winrt::Microsoft::ReactNative::ComponentView &newFocusedComponent)
|
|
27
28
|
: m_originalSource(originalSource ? originalSource.Tag() : -1),
|
|
29
|
+
m_direction(direction),
|
|
28
30
|
m_old(oldFocusedComponent),
|
|
29
31
|
m_new(newFocusedComponent) {}
|
|
30
32
|
|
|
31
|
-
int32_t LosingFocusEventArgs::OriginalSource() noexcept {
|
|
33
|
+
int32_t LosingFocusEventArgs::OriginalSource() const noexcept {
|
|
32
34
|
return m_originalSource;
|
|
33
35
|
}
|
|
34
|
-
|
|
36
|
+
|
|
37
|
+
winrt::Microsoft::ReactNative::FocusNavigationDirection LosingFocusEventArgs::Direction() const noexcept {
|
|
38
|
+
return m_direction;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
winrt::Microsoft::ReactNative::ComponentView LosingFocusEventArgs::NewFocusedComponent() const noexcept {
|
|
35
42
|
return m_new;
|
|
36
43
|
}
|
|
37
|
-
winrt::Microsoft::ReactNative::ComponentView LosingFocusEventArgs::OldFocusedComponent() noexcept {
|
|
44
|
+
winrt::Microsoft::ReactNative::ComponentView LosingFocusEventArgs::OldFocusedComponent() const noexcept {
|
|
38
45
|
return m_old;
|
|
39
46
|
}
|
|
40
47
|
|
|
@@ -58,19 +65,26 @@ void LosingFocusEventArgs::TrySetNewFocusedComponent(
|
|
|
58
65
|
|
|
59
66
|
GettingFocusEventArgs::GettingFocusEventArgs(
|
|
60
67
|
const winrt::Microsoft::ReactNative::ComponentView &originalSource,
|
|
68
|
+
winrt::Microsoft::ReactNative::FocusNavigationDirection direction,
|
|
61
69
|
const winrt::Microsoft::ReactNative::ComponentView &oldFocusedComponent,
|
|
62
70
|
const winrt::Microsoft::ReactNative::ComponentView &newFocusedComponent)
|
|
63
71
|
: m_originalSource(originalSource ? originalSource.Tag() : -1),
|
|
72
|
+
m_direction(direction),
|
|
64
73
|
m_old(oldFocusedComponent),
|
|
65
74
|
m_new(newFocusedComponent) {}
|
|
66
75
|
|
|
67
|
-
int32_t GettingFocusEventArgs::OriginalSource() noexcept {
|
|
76
|
+
int32_t GettingFocusEventArgs::OriginalSource() const noexcept {
|
|
68
77
|
return m_originalSource;
|
|
69
78
|
}
|
|
70
|
-
|
|
79
|
+
|
|
80
|
+
winrt::Microsoft::ReactNative::FocusNavigationDirection GettingFocusEventArgs::Direction() const noexcept {
|
|
81
|
+
return m_direction;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
winrt::Microsoft::ReactNative::ComponentView GettingFocusEventArgs::NewFocusedComponent() const noexcept {
|
|
71
85
|
return m_new;
|
|
72
86
|
}
|
|
73
|
-
winrt::Microsoft::ReactNative::ComponentView GettingFocusEventArgs::OldFocusedComponent() noexcept {
|
|
87
|
+
winrt::Microsoft::ReactNative::ComponentView GettingFocusEventArgs::OldFocusedComponent() const noexcept {
|
|
74
88
|
return m_old;
|
|
75
89
|
}
|
|
76
90
|
|
|
@@ -32,17 +32,21 @@ struct LosingFocusEventArgs
|
|
|
32
32
|
: winrt::Microsoft::ReactNative::implementation::LosingFocusEventArgsT<LosingFocusEventArgs> {
|
|
33
33
|
LosingFocusEventArgs(
|
|
34
34
|
const winrt::Microsoft::ReactNative::ComponentView &originalSource,
|
|
35
|
+
winrt::Microsoft::ReactNative::FocusNavigationDirection direction,
|
|
35
36
|
const winrt::Microsoft::ReactNative::ComponentView &oldFocusedComponent,
|
|
36
37
|
const winrt::Microsoft::ReactNative::ComponentView &newFocusedComponent);
|
|
37
|
-
int32_t OriginalSource() noexcept;
|
|
38
|
-
winrt::Microsoft::ReactNative::
|
|
39
|
-
|
|
38
|
+
int32_t OriginalSource() const noexcept;
|
|
39
|
+
winrt::Microsoft::ReactNative::FocusNavigationDirection Direction() const noexcept;
|
|
40
|
+
|
|
41
|
+
winrt::Microsoft::ReactNative::ComponentView NewFocusedComponent() const noexcept;
|
|
42
|
+
winrt::Microsoft::ReactNative::ComponentView OldFocusedComponent() const noexcept;
|
|
40
43
|
|
|
41
44
|
void TryCancel() noexcept;
|
|
42
45
|
void TrySetNewFocusedComponent(const winrt::Microsoft::ReactNative::ComponentView &newFocusedComponent) noexcept;
|
|
43
46
|
|
|
44
47
|
private:
|
|
45
48
|
const int32_t m_originalSource;
|
|
49
|
+
const winrt::Microsoft::ReactNative::FocusNavigationDirection m_direction;
|
|
46
50
|
winrt::Microsoft::ReactNative::ComponentView m_old{nullptr};
|
|
47
51
|
winrt::Microsoft::ReactNative::ComponentView m_new{nullptr};
|
|
48
52
|
};
|
|
@@ -51,17 +55,20 @@ struct GettingFocusEventArgs
|
|
|
51
55
|
: winrt::Microsoft::ReactNative::implementation::GettingFocusEventArgsT<GettingFocusEventArgs> {
|
|
52
56
|
GettingFocusEventArgs(
|
|
53
57
|
const winrt::Microsoft::ReactNative::ComponentView &originalSource,
|
|
58
|
+
winrt::Microsoft::ReactNative::FocusNavigationDirection direction,
|
|
54
59
|
const winrt::Microsoft::ReactNative::ComponentView &oldFocusedComponent,
|
|
55
60
|
const winrt::Microsoft::ReactNative::ComponentView &newFocusedComponent);
|
|
56
|
-
int32_t OriginalSource() noexcept;
|
|
57
|
-
winrt::Microsoft::ReactNative::
|
|
58
|
-
winrt::Microsoft::ReactNative::ComponentView
|
|
61
|
+
int32_t OriginalSource() const noexcept;
|
|
62
|
+
winrt::Microsoft::ReactNative::FocusNavigationDirection Direction() const noexcept;
|
|
63
|
+
winrt::Microsoft::ReactNative::ComponentView NewFocusedComponent() const noexcept;
|
|
64
|
+
winrt::Microsoft::ReactNative::ComponentView OldFocusedComponent() const noexcept;
|
|
59
65
|
|
|
60
66
|
void TryCancel() noexcept;
|
|
61
67
|
void TrySetNewFocusedComponent(const winrt::Microsoft::ReactNative::ComponentView &newFocusedComponent) noexcept;
|
|
62
68
|
|
|
63
69
|
private:
|
|
64
70
|
const int32_t m_originalSource;
|
|
71
|
+
const winrt::Microsoft::ReactNative::FocusNavigationDirection m_direction;
|
|
65
72
|
winrt::Microsoft::ReactNative::ComponentView m_old{nullptr};
|
|
66
73
|
winrt::Microsoft::ReactNative::ComponentView m_new{nullptr};
|
|
67
74
|
};
|
package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp
CHANGED
|
@@ -191,9 +191,8 @@ void WindowsModalHostComponentView::UnmountChildComponentView(
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
void WindowsModalHostComponentView::HandleCommand(
|
|
194
|
-
winrt::
|
|
195
|
-
|
|
196
|
-
Super::HandleCommand(commandName, args);
|
|
194
|
+
const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept {
|
|
195
|
+
Super::HandleCommand(args);
|
|
197
196
|
}
|
|
198
197
|
|
|
199
198
|
void WindowsModalHostComponentView::updateProps(
|
|
@@ -28,8 +28,7 @@ struct WindowsModalHostComponentView
|
|
|
28
28
|
void UnmountChildComponentView(
|
|
29
29
|
const winrt::Microsoft::ReactNative::ComponentView &childComponentView,
|
|
30
30
|
uint32_t index) noexcept override;
|
|
31
|
-
void HandleCommand(
|
|
32
|
-
override;
|
|
31
|
+
void HandleCommand(const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept override;
|
|
33
32
|
void updateState(facebook::react::State::Shared const &state, facebook::react::State::Shared const &oldState) noexcept
|
|
34
33
|
override;
|
|
35
34
|
|
|
@@ -58,10 +58,6 @@ struct CompositionReactViewInstance
|
|
|
58
58
|
void UpdateRootView() noexcept;
|
|
59
59
|
void UninitRootView() noexcept;
|
|
60
60
|
|
|
61
|
-
private:
|
|
62
|
-
template <class TAction>
|
|
63
|
-
Mso::Future<void> PostInUIQueue(TAction &&action) noexcept;
|
|
64
|
-
|
|
65
61
|
private:
|
|
66
62
|
winrt::weak_ref<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland> m_weakRootControl;
|
|
67
63
|
IReactDispatcher m_uiDispatcher{nullptr};
|
|
@@ -102,44 +98,36 @@ void CompositionReactViewInstance::UninitRootView() noexcept {
|
|
|
102
98
|
}
|
|
103
99
|
}
|
|
104
100
|
|
|
105
|
-
|
|
106
|
-
// ReactViewInstance inline implementation
|
|
107
|
-
//===========================================================================
|
|
108
|
-
|
|
109
|
-
template <class TAction>
|
|
110
|
-
inline Mso::Future<void> CompositionReactViewInstance::PostInUIQueue(TAction &&action) noexcept {
|
|
111
|
-
// ReactViewInstance has shorter lifetime than ReactRootControl. Thus, we capture this WeakPtr.
|
|
112
|
-
auto promise = Mso::Promise<void>();
|
|
113
|
-
|
|
114
|
-
m_uiDispatcher.Post([promise, weakThis{get_weak()}, action{std::forward<TAction>(action)}]() mutable {
|
|
115
|
-
if (auto strongThis = weakThis.get()) {
|
|
116
|
-
if (auto rootControl = strongThis->m_weakRootControl.get()) {
|
|
117
|
-
action(rootControl);
|
|
118
|
-
promise.SetValue();
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
promise.TryCancel();
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
return promise.AsFuture();
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
void ApplyConstraints(
|
|
101
|
+
void ReactNativeIsland::ApplyConstraints(
|
|
129
102
|
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraintsIn,
|
|
130
|
-
facebook::react::LayoutConstraints &layoutConstraintsOut) noexcept {
|
|
103
|
+
facebook::react::LayoutConstraints &layoutConstraintsOut) const noexcept {
|
|
131
104
|
layoutConstraintsOut.minimumSize = {layoutConstraintsIn.MinimumSize.Width, layoutConstraintsIn.MinimumSize.Height};
|
|
132
105
|
layoutConstraintsOut.maximumSize = {layoutConstraintsIn.MaximumSize.Width, layoutConstraintsIn.MaximumSize.Height};
|
|
133
|
-
|
|
134
|
-
|
|
106
|
+
if (layoutConstraintsIn.LayoutDirection == winrt::Microsoft::ReactNative::LayoutDirection::Undefined) {
|
|
107
|
+
if (m_island) {
|
|
108
|
+
layoutConstraintsOut.layoutDirection =
|
|
109
|
+
(m_island.LayoutDirection() == winrt::Microsoft::UI::Content::ContentLayoutDirection::LeftToRight)
|
|
110
|
+
? facebook::react::LayoutDirection::LeftToRight
|
|
111
|
+
: facebook::react::LayoutDirection::RightToLeft;
|
|
112
|
+
} else if (m_hwnd) {
|
|
113
|
+
auto styles = GetWindowLongPtrW(m_hwnd, GWL_EXSTYLE);
|
|
114
|
+
layoutConstraintsOut.layoutDirection = ((styles & WS_EX_LAYOUTRTL) == WS_EX_LAYOUTRTL)
|
|
115
|
+
? facebook::react::LayoutDirection::RightToLeft
|
|
116
|
+
: facebook::react::LayoutDirection::LeftToRight;
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
layoutConstraintsOut.layoutDirection =
|
|
120
|
+
static_cast<facebook::react::LayoutDirection>(layoutConstraintsIn.LayoutDirection);
|
|
121
|
+
}
|
|
135
122
|
}
|
|
136
123
|
|
|
137
|
-
ReactNativeIsland::ReactNativeIsland() noexcept {}
|
|
138
|
-
|
|
139
|
-
#ifdef USE_WINUI3
|
|
140
124
|
ReactNativeIsland::ReactNativeIsland(const winrt::Microsoft::UI::Composition::Compositor &compositor) noexcept
|
|
141
|
-
: m_compositor(compositor)
|
|
142
|
-
|
|
125
|
+
: m_compositor(compositor),
|
|
126
|
+
m_layoutConstraints({{0, 0}, {0, 0}, winrt::Microsoft::ReactNative::LayoutDirection::Undefined}) {
|
|
127
|
+
InitTextScaleMultiplier();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
ReactNativeIsland::ReactNativeIsland() noexcept : ReactNativeIsland(nullptr) {}
|
|
143
131
|
|
|
144
132
|
ReactNativeIsland::~ReactNativeIsland() noexcept {
|
|
145
133
|
#ifdef USE_WINUI3
|
|
@@ -275,6 +263,10 @@ void ReactNativeIsland::ScaleFactor(float value) noexcept {
|
|
|
275
263
|
}
|
|
276
264
|
}
|
|
277
265
|
|
|
266
|
+
float ReactNativeIsland::FontSizeMultiplier() const noexcept {
|
|
267
|
+
return m_textScaleMultiplier;
|
|
268
|
+
}
|
|
269
|
+
|
|
278
270
|
int64_t ReactNativeIsland::RootTag() const noexcept {
|
|
279
271
|
return m_rootTag;
|
|
280
272
|
}
|
|
@@ -458,10 +450,9 @@ void ReactNativeIsland::UninitRootView() noexcept {
|
|
|
458
450
|
uiManager->stopSurface(static_cast<facebook::react::SurfaceId>(RootTag()));
|
|
459
451
|
|
|
460
452
|
// This is needed to ensure that the unmount JS logic is completed before the the instance is shutdown during
|
|
461
|
-
// instance destruction. Aligns with similar code in ReactInstanceWin::DetachRootView for paper Future: Instead
|
|
462
|
-
// method should return a Promise, which should be resolved when the JS logic is complete.
|
|
463
|
-
//
|
|
464
|
-
// shutdown
|
|
453
|
+
// instance destruction. Aligns with similar code in ReactInstanceWin::DetachRootView for paper Future: Instead
|
|
454
|
+
// this method should return a Promise, which should be resolved when the JS logic is complete. The task will auto
|
|
455
|
+
// set the event on destruction to ensure that the event is set if the JS Queue has already been shutdown
|
|
465
456
|
Mso::ManualResetEvent mre;
|
|
466
457
|
m_context.JSDispatcher().Post([autoMRE = std::make_unique<AutoMRE>(AutoMRE{mre})]() {});
|
|
467
458
|
mre.Wait();
|
|
@@ -526,9 +517,8 @@ facebook::react::AttributedStringBox CreateLoadingAttributedString() noexcept {
|
|
|
526
517
|
return facebook::react::AttributedStringBox{attributedString};
|
|
527
518
|
}
|
|
528
519
|
|
|
529
|
-
facebook::react::Size MeasureLoading(
|
|
530
|
-
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints
|
|
531
|
-
float scaleFactor) {
|
|
520
|
+
facebook::react::Size ReactNativeIsland::MeasureLoading(
|
|
521
|
+
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints) const noexcept {
|
|
532
522
|
facebook::react::LayoutConstraints fbLayoutConstraints;
|
|
533
523
|
ApplyConstraints(layoutConstraints, fbLayoutConstraints);
|
|
534
524
|
|
|
@@ -541,7 +531,7 @@ facebook::react::Size MeasureLoading(
|
|
|
541
531
|
winrt::check_hresult(textLayout->GetMetrics(&tm));
|
|
542
532
|
|
|
543
533
|
return fbLayoutConstraints.clamp(
|
|
544
|
-
{loadingActivityHorizontalOffset *
|
|
534
|
+
{loadingActivityHorizontalOffset * m_scaleFactor + tm.width, loadingBarHeight * m_scaleFactor});
|
|
545
535
|
}
|
|
546
536
|
|
|
547
537
|
winrt::event_token ReactNativeIsland::SizeChanged(
|
|
@@ -571,7 +561,7 @@ void ReactNativeIsland::NotifySizeChanged() noexcept {
|
|
|
571
561
|
if (rootComponentView) {
|
|
572
562
|
size = rootComponentView->layoutMetrics().frame.size;
|
|
573
563
|
} else if (m_loadingVisual) {
|
|
574
|
-
size = MeasureLoading(m_layoutConstraints
|
|
564
|
+
size = MeasureLoading(m_layoutConstraints);
|
|
575
565
|
}
|
|
576
566
|
|
|
577
567
|
m_size = {size.width, size.height};
|
|
@@ -665,11 +655,34 @@ void ReactNativeIsland::ShowInstanceLoading() noexcept {
|
|
|
665
655
|
InternalRootVisual().InsertAt(m_loadingVisual, m_hasRenderedVisual ? 1 : 0);
|
|
666
656
|
}
|
|
667
657
|
|
|
658
|
+
void ReactNativeIsland::InitTextScaleMultiplier() noexcept {
|
|
659
|
+
m_uiSettings = winrt::Windows::UI::ViewManagement::UISettings();
|
|
660
|
+
m_textScaleMultiplier = static_cast<float>(m_uiSettings.TextScaleFactor());
|
|
661
|
+
m_textScaleChangedRevoker = m_uiSettings.TextScaleFactorChanged(
|
|
662
|
+
winrt::auto_revoke,
|
|
663
|
+
[this](const winrt::Windows::UI::ViewManagement::UISettings &uiSettings, const winrt::IInspectable &) {
|
|
664
|
+
if (m_context) {
|
|
665
|
+
m_context.UIDispatcher().Post(
|
|
666
|
+
[wkThis = get_weak(), textScaleMultiplier = static_cast<float>(uiSettings.TextScaleFactor())]() {
|
|
667
|
+
if (auto strongThis = wkThis.get()) {
|
|
668
|
+
strongThis->m_textScaleMultiplier = textScaleMultiplier;
|
|
669
|
+
strongThis->Arrange(strongThis->m_layoutConstraints, strongThis->m_viewportOffset);
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
|
|
668
676
|
winrt::Windows::Foundation::Size ReactNativeIsland::Measure(
|
|
669
677
|
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints,
|
|
670
|
-
const winrt::Windows::Foundation::Point &viewportOffset) const
|
|
678
|
+
const winrt::Windows::Foundation::Point &viewportOffset) const {
|
|
671
679
|
facebook::react::Size size{0, 0};
|
|
672
680
|
|
|
681
|
+
if (layoutConstraints.LayoutDirection != winrt::Microsoft::ReactNative::LayoutDirection::LeftToRight &&
|
|
682
|
+
layoutConstraints.LayoutDirection != winrt::Microsoft::ReactNative::LayoutDirection::RightToLeft &&
|
|
683
|
+
layoutConstraints.LayoutDirection != winrt::Microsoft::ReactNative::LayoutDirection::Undefined)
|
|
684
|
+
winrt::throw_hresult(E_INVALIDARG);
|
|
685
|
+
|
|
673
686
|
facebook::react::LayoutConstraints constraints;
|
|
674
687
|
ApplyConstraints(layoutConstraints, constraints);
|
|
675
688
|
|
|
@@ -677,15 +690,14 @@ winrt::Windows::Foundation::Size ReactNativeIsland::Measure(
|
|
|
677
690
|
if (auto fabricuiManager = ::Microsoft::ReactNative::FabricUIManager::FromProperties(
|
|
678
691
|
winrt::Microsoft::ReactNative::ReactPropertyBag(m_context.Properties()))) {
|
|
679
692
|
facebook::react::LayoutContext context;
|
|
680
|
-
|
|
693
|
+
context.fontSizeMultiplier = m_textScaleMultiplier;
|
|
681
694
|
context.pointScaleFactor = static_cast<facebook::react::Float>(m_scaleFactor);
|
|
682
|
-
context.fontSizeMultiplier = static_cast<facebook::react::Float>(m_scaleFactor);
|
|
683
695
|
context.viewportOffset = {viewportOffset.X, viewportOffset.Y};
|
|
684
696
|
|
|
685
697
|
size = fabricuiManager->measureSurface(static_cast<facebook::react::SurfaceId>(m_rootTag), constraints, context);
|
|
686
698
|
}
|
|
687
699
|
} else if (m_loadingVisual) {
|
|
688
|
-
size = MeasureLoading(layoutConstraints
|
|
700
|
+
size = MeasureLoading(layoutConstraints);
|
|
689
701
|
}
|
|
690
702
|
|
|
691
703
|
auto clampedSize = constraints.clamp(size);
|
|
@@ -694,7 +706,12 @@ winrt::Windows::Foundation::Size ReactNativeIsland::Measure(
|
|
|
694
706
|
|
|
695
707
|
void ReactNativeIsland::Arrange(
|
|
696
708
|
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints,
|
|
697
|
-
const winrt::Windows::Foundation::Point &viewportOffset)
|
|
709
|
+
const winrt::Windows::Foundation::Point &viewportOffset) {
|
|
710
|
+
if (layoutConstraints.LayoutDirection != winrt::Microsoft::ReactNative::LayoutDirection::LeftToRight &&
|
|
711
|
+
layoutConstraints.LayoutDirection != winrt::Microsoft::ReactNative::LayoutDirection::RightToLeft &&
|
|
712
|
+
layoutConstraints.LayoutDirection != winrt::Microsoft::ReactNative::LayoutDirection::Undefined)
|
|
713
|
+
winrt::throw_hresult(E_INVALIDARG);
|
|
714
|
+
|
|
698
715
|
m_layoutConstraints = layoutConstraints;
|
|
699
716
|
m_viewportOffset = viewportOffset;
|
|
700
717
|
facebook::react::LayoutConstraints fbLayoutConstraints;
|
|
@@ -704,8 +721,8 @@ void ReactNativeIsland::Arrange(
|
|
|
704
721
|
if (auto fabricuiManager = ::Microsoft::ReactNative::FabricUIManager::FromProperties(
|
|
705
722
|
winrt::Microsoft::ReactNative::ReactPropertyBag(m_context.Properties()))) {
|
|
706
723
|
facebook::react::LayoutContext context;
|
|
724
|
+
context.fontSizeMultiplier = m_textScaleMultiplier;
|
|
707
725
|
context.pointScaleFactor = static_cast<facebook::react::Float>(m_scaleFactor);
|
|
708
|
-
context.fontSizeMultiplier = static_cast<facebook::react::Float>(m_scaleFactor);
|
|
709
726
|
context.viewportOffset = {viewportOffset.X, viewportOffset.Y};
|
|
710
727
|
|
|
711
728
|
fabricuiManager->constraintSurfaceLayout(
|
|
@@ -713,12 +730,11 @@ void ReactNativeIsland::Arrange(
|
|
|
713
730
|
}
|
|
714
731
|
} else if (m_loadingVisual) {
|
|
715
732
|
// TODO: Resize to align loading
|
|
716
|
-
auto s = fbLayoutConstraints.clamp(MeasureLoading(layoutConstraints
|
|
733
|
+
auto s = fbLayoutConstraints.clamp(MeasureLoading(layoutConstraints));
|
|
717
734
|
NotifySizeChanged();
|
|
718
735
|
}
|
|
719
736
|
}
|
|
720
737
|
|
|
721
|
-
#ifdef USE_WINUI3
|
|
722
738
|
winrt::Microsoft::UI::Content::ContentIsland ReactNativeIsland::Island() {
|
|
723
739
|
if (!m_compositor) {
|
|
724
740
|
return nullptr;
|
|
@@ -772,6 +788,9 @@ winrt::Microsoft::UI::Content::ContentIsland ReactNativeIsland::Island() {
|
|
|
772
788
|
if (args.DidRasterizationScaleChange()) {
|
|
773
789
|
pThis->ScaleFactor(island.RasterizationScale());
|
|
774
790
|
}
|
|
791
|
+
if (args.DidLayoutDirectionChange()) {
|
|
792
|
+
pThis->Arrange(pThis->m_layoutConstraints, pThis->m_viewportOffset);
|
|
793
|
+
}
|
|
775
794
|
#ifndef USE_EXPERIMENTAL_WINUI3 // Use this in place of Connected/Disconnected events for now. -- Its not quite what we
|
|
776
795
|
// want, but it will do for now.
|
|
777
796
|
if (args.DidSiteVisibleChange()) {
|
|
@@ -804,7 +823,6 @@ winrt::Microsoft::UI::Content::ContentIsland ReactNativeIsland::Island() {
|
|
|
804
823
|
}
|
|
805
824
|
return m_island;
|
|
806
825
|
}
|
|
807
|
-
#endif
|
|
808
826
|
|
|
809
827
|
void ReactNativeIsland::OnMounted() noexcept {
|
|
810
828
|
if (m_mounted)
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#include <react/renderer/core/LayoutConstraints.h>
|
|
11
11
|
#include <winrt/Microsoft.ReactNative.Composition.Experimental.h>
|
|
12
12
|
#include <winrt/Microsoft.ReactNative.h>
|
|
13
|
+
#include <winrt/Windows.UI.ViewManagement.h>
|
|
13
14
|
#include "CompositionEventHandler.h"
|
|
14
15
|
#include "ReactHost/React.h"
|
|
15
16
|
|
|
@@ -46,10 +47,8 @@ struct ReactNativeIsland
|
|
|
46
47
|
ReactNativeIsland() noexcept;
|
|
47
48
|
~ReactNativeIsland() noexcept;
|
|
48
49
|
|
|
49
|
-
#ifdef USE_WINUI3
|
|
50
50
|
ReactNativeIsland(const winrt::Microsoft::UI::Composition::Compositor &compositor) noexcept;
|
|
51
51
|
winrt::Microsoft::UI::Content::ContentIsland Island();
|
|
52
|
-
#endif
|
|
53
52
|
|
|
54
53
|
// property ReactViewHost
|
|
55
54
|
ReactNative::IReactViewHost ReactViewHost() noexcept;
|
|
@@ -72,6 +71,8 @@ struct ReactNativeIsland
|
|
|
72
71
|
float ScaleFactor() noexcept;
|
|
73
72
|
void ScaleFactor(float value) noexcept;
|
|
74
73
|
|
|
74
|
+
float FontSizeMultiplier() const noexcept;
|
|
75
|
+
|
|
75
76
|
winrt::event_token SizeChanged(
|
|
76
77
|
winrt::Windows::Foundation::EventHandler<winrt::Microsoft::ReactNative::RootViewSizeChangedEventArgs> const
|
|
77
78
|
&handler) noexcept;
|
|
@@ -90,10 +91,10 @@ struct ReactNativeIsland
|
|
|
90
91
|
|
|
91
92
|
winrt::Windows::Foundation::Size Measure(
|
|
92
93
|
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints,
|
|
93
|
-
const winrt::Windows::Foundation::Point &viewportOffset) const
|
|
94
|
+
const winrt::Windows::Foundation::Point &viewportOffset) const;
|
|
94
95
|
void Arrange(
|
|
95
96
|
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints,
|
|
96
|
-
const winrt::Windows::Foundation::Point &viewportOffset)
|
|
97
|
+
const winrt::Windows::Foundation::Point &viewportOffset);
|
|
97
98
|
|
|
98
99
|
winrt::Microsoft::ReactNative::FocusNavigationResult NavigateFocus(
|
|
99
100
|
const winrt::Microsoft::ReactNative::FocusNavigationRequest &request) noexcept;
|
|
@@ -143,6 +144,9 @@ struct ReactNativeIsland
|
|
|
143
144
|
winrt::IInspectable m_uiaProvider{nullptr};
|
|
144
145
|
int64_t m_rootTag{-1};
|
|
145
146
|
float m_scaleFactor{1.0};
|
|
147
|
+
float m_textScaleMultiplier{1.0};
|
|
148
|
+
winrt::Windows::UI::ViewManagement::UISettings::TextScaleFactorChanged_revoker m_textScaleChangedRevoker;
|
|
149
|
+
winrt::Windows::UI::ViewManagement::UISettings m_uiSettings{nullptr};
|
|
146
150
|
winrt::Windows::Foundation::Size m_size{0, 0};
|
|
147
151
|
winrt::Microsoft::ReactNative::ReactContext m_context;
|
|
148
152
|
winrt::Microsoft::ReactNative::IReactViewHost m_reactViewHost;
|
|
@@ -168,6 +172,12 @@ struct ReactNativeIsland
|
|
|
168
172
|
void UpdateRootVisualSize() noexcept;
|
|
169
173
|
void UpdateLoadingVisualSize() noexcept;
|
|
170
174
|
Composition::Experimental::IDrawingSurfaceBrush CreateLoadingVisualBrush() noexcept;
|
|
175
|
+
void ApplyConstraints(
|
|
176
|
+
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraintsIn,
|
|
177
|
+
facebook::react::LayoutConstraints &layoutConstraintsOut) const noexcept;
|
|
178
|
+
facebook::react::Size MeasureLoading(
|
|
179
|
+
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints) const noexcept;
|
|
180
|
+
void InitTextScaleMultiplier() noexcept;
|
|
171
181
|
};
|
|
172
182
|
|
|
173
183
|
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -40,8 +40,8 @@ winrt::Microsoft::ReactNative::ComponentView RootComponentView::Create(
|
|
|
40
40
|
return winrt::make<RootComponentView>(compContext, tag, reactContext);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
RootComponentView *RootComponentView::rootComponentView() noexcept {
|
|
44
|
-
return this;
|
|
43
|
+
RootComponentView *RootComponentView::rootComponentView() const noexcept {
|
|
44
|
+
return const_cast<RootComponentView *>(this);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
void RootComponentView::updateLayoutMetrics(
|
|
@@ -91,12 +91,18 @@ bool RootComponentView::NavigateFocus(const winrt::Microsoft::ReactNative::Focus
|
|
|
91
91
|
? FocusManager::FindFirstFocusableElement(*this)
|
|
92
92
|
: FocusManager::FindLastFocusableElement(*this);
|
|
93
93
|
if (view) {
|
|
94
|
-
TrySetFocusedComponent(
|
|
94
|
+
TrySetFocusedComponent(
|
|
95
|
+
view,
|
|
96
|
+
request.Reason() == winrt::Microsoft::ReactNative::FocusNavigationReason::First
|
|
97
|
+
? winrt::Microsoft::ReactNative::FocusNavigationDirection::First
|
|
98
|
+
: winrt::Microsoft::ReactNative::FocusNavigationDirection::Last);
|
|
95
99
|
}
|
|
96
100
|
return view != nullptr;
|
|
97
101
|
}
|
|
98
102
|
|
|
99
|
-
bool RootComponentView::TrySetFocusedComponent(
|
|
103
|
+
bool RootComponentView::TrySetFocusedComponent(
|
|
104
|
+
const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
105
|
+
winrt::Microsoft::ReactNative::FocusNavigationDirection direction) noexcept {
|
|
100
106
|
auto target = view;
|
|
101
107
|
auto selfView = winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(target);
|
|
102
108
|
if (selfView && !selfView->focusable()) {
|
|
@@ -110,7 +116,7 @@ bool RootComponentView::TrySetFocusedComponent(const winrt::Microsoft::ReactNati
|
|
|
110
116
|
return false;
|
|
111
117
|
|
|
112
118
|
auto losingFocusArgs = winrt::make<winrt::Microsoft::ReactNative::implementation::LosingFocusEventArgs>(
|
|
113
|
-
target, m_focusedComponent, target);
|
|
119
|
+
target, direction, m_focusedComponent, target);
|
|
114
120
|
if (m_focusedComponent) {
|
|
115
121
|
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(m_focusedComponent)
|
|
116
122
|
->onLosingFocus(losingFocusArgs);
|
|
@@ -118,7 +124,7 @@ bool RootComponentView::TrySetFocusedComponent(const winrt::Microsoft::ReactNati
|
|
|
118
124
|
|
|
119
125
|
if (losingFocusArgs.NewFocusedComponent()) {
|
|
120
126
|
auto gettingFocusArgs = winrt::make<winrt::Microsoft::ReactNative::implementation::GettingFocusEventArgs>(
|
|
121
|
-
target, m_focusedComponent, losingFocusArgs.NewFocusedComponent());
|
|
127
|
+
target, direction, m_focusedComponent, losingFocusArgs.NewFocusedComponent());
|
|
122
128
|
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(losingFocusArgs.NewFocusedComponent())
|
|
123
129
|
->onGettingFocus(gettingFocusArgs);
|
|
124
130
|
|
|
@@ -138,13 +144,16 @@ bool RootComponentView::TryMoveFocus(bool next) noexcept {
|
|
|
138
144
|
}
|
|
139
145
|
|
|
140
146
|
Mso::Functor<bool(const winrt::Microsoft::ReactNative::ComponentView &)> fn =
|
|
141
|
-
[currentlyFocused = m_focusedComponent](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
|
|
147
|
+
[currentlyFocused = m_focusedComponent, next](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
|
|
142
148
|
if (view == currentlyFocused)
|
|
143
149
|
return false;
|
|
144
150
|
|
|
145
151
|
return winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(view)
|
|
146
152
|
->rootComponentView()
|
|
147
|
-
->TrySetFocusedComponent(
|
|
153
|
+
->TrySetFocusedComponent(
|
|
154
|
+
view,
|
|
155
|
+
next ? winrt::Microsoft::ReactNative::FocusNavigationDirection::Next
|
|
156
|
+
: winrt::Microsoft::ReactNative::FocusNavigationDirection::Previous);
|
|
148
157
|
};
|
|
149
158
|
|
|
150
159
|
return winrt::Microsoft::ReactNative::implementation::walkTree(m_focusedComponent, next, fn);
|
|
@@ -202,6 +211,15 @@ winrt::IInspectable RootComponentView::UiaProviderFromPoint(const POINT &ptPixel
|
|
|
202
211
|
return winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(view)->EnsureUiaProvider();
|
|
203
212
|
}
|
|
204
213
|
|
|
214
|
+
float RootComponentView::FontSizeMultiplier() const noexcept {
|
|
215
|
+
if (auto rootView = m_wkRootView.get()) {
|
|
216
|
+
return winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(rootView)
|
|
217
|
+
->FontSizeMultiplier();
|
|
218
|
+
}
|
|
219
|
+
assert(false);
|
|
220
|
+
return 1.0f;
|
|
221
|
+
}
|
|
222
|
+
|
|
205
223
|
winrt::Microsoft::UI::Content::ContentIsland RootComponentView::parentContentIsland() noexcept {
|
|
206
224
|
if (auto rootView = m_wkRootView.get()) {
|
|
207
225
|
return winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(rootView)->Island();
|
|
@@ -28,13 +28,15 @@ struct RootComponentView : RootComponentViewT<RootComponentView, ViewComponentVi
|
|
|
28
28
|
|
|
29
29
|
winrt::Microsoft::ReactNative::ComponentView GetFocusedComponent() noexcept;
|
|
30
30
|
void SetFocusedComponent(const winrt::Microsoft::ReactNative::ComponentView &value) noexcept;
|
|
31
|
-
bool TrySetFocusedComponent(
|
|
31
|
+
bool TrySetFocusedComponent(
|
|
32
|
+
const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
33
|
+
winrt::Microsoft::ReactNative::FocusNavigationDirection direction) noexcept;
|
|
32
34
|
|
|
33
35
|
bool NavigateFocus(const winrt::Microsoft::ReactNative::FocusNavigationRequest &request) noexcept;
|
|
34
36
|
|
|
35
37
|
bool TryMoveFocus(bool next) noexcept;
|
|
36
38
|
|
|
37
|
-
RootComponentView *rootComponentView() noexcept override;
|
|
39
|
+
RootComponentView *rootComponentView() const noexcept override;
|
|
38
40
|
|
|
39
41
|
winrt::Microsoft::UI::Content::ContentIsland parentContentIsland() noexcept;
|
|
40
42
|
|
|
@@ -44,6 +46,7 @@ struct RootComponentView : RootComponentViewT<RootComponentView, ViewComponentVi
|
|
|
44
46
|
|
|
45
47
|
HRESULT GetFragmentRoot(IRawElementProviderFragmentRoot **pRetVal) noexcept;
|
|
46
48
|
winrt::Microsoft::ReactNative::implementation::ClipState getClipState() noexcept override;
|
|
49
|
+
float FontSizeMultiplier() const noexcept;
|
|
47
50
|
|
|
48
51
|
void updateLayoutMetrics(
|
|
49
52
|
facebook::react::LayoutMetrics const &layoutMetrics,
|
|
@@ -749,6 +749,10 @@ void ScrollViewComponentView::updateProps(
|
|
|
749
749
|
m_horizontalScrollbarComponent->UpdateColorForScrollBarRegions();
|
|
750
750
|
m_verticalScrollbarComponent->UpdateColorForScrollBarRegions();
|
|
751
751
|
}
|
|
752
|
+
|
|
753
|
+
if (!oldProps || oldViewProps.horizontal != newViewProps.horizontal) {
|
|
754
|
+
m_scrollVisual.Horizontal(newViewProps.horizontal);
|
|
755
|
+
}
|
|
752
756
|
}
|
|
753
757
|
|
|
754
758
|
void ScrollViewComponentView::updateState(
|
|
@@ -886,6 +890,12 @@ void ScrollViewComponentView::OnPointerPressed(
|
|
|
886
890
|
m_verticalScrollbarComponent->OnPointerPressed(args);
|
|
887
891
|
m_horizontalScrollbarComponent->OnPointerPressed(args);
|
|
888
892
|
Super::OnPointerPressed(args);
|
|
893
|
+
|
|
894
|
+
if (!args.Handled()) {
|
|
895
|
+
auto f = args.Pointer();
|
|
896
|
+
auto g = f.PointerDeviceType();
|
|
897
|
+
m_scrollVisual.OnPointerPressed(args);
|
|
898
|
+
}
|
|
889
899
|
}
|
|
890
900
|
|
|
891
901
|
void ScrollViewComponentView::OnPointerReleased(
|
|
@@ -1045,13 +1055,16 @@ bool ScrollViewComponentView::scrollRight(float delta, bool animate) noexcept {
|
|
|
1045
1055
|
return true;
|
|
1046
1056
|
}
|
|
1047
1057
|
|
|
1048
|
-
void ScrollViewComponentView::HandleCommand(
|
|
1049
|
-
|
|
1050
|
-
|
|
1058
|
+
void ScrollViewComponentView::HandleCommand(const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept {
|
|
1059
|
+
Super::HandleCommand(args);
|
|
1060
|
+
if (args.Handled())
|
|
1061
|
+
return;
|
|
1062
|
+
|
|
1063
|
+
auto commandName = args.CommandName();
|
|
1051
1064
|
if (commandName == L"scrollTo") {
|
|
1052
1065
|
double x, y;
|
|
1053
1066
|
bool animate;
|
|
1054
|
-
winrt::Microsoft::ReactNative::ReadArgs(args, x, y, animate);
|
|
1067
|
+
winrt::Microsoft::ReactNative::ReadArgs(args.CommandArgs(), x, y, animate);
|
|
1055
1068
|
scrollTo(
|
|
1056
1069
|
{static_cast<float>(x) * m_layoutMetrics.pointScaleFactor,
|
|
1057
1070
|
static_cast<float>(y) * m_layoutMetrics.pointScaleFactor,
|
|
@@ -1061,12 +1074,10 @@ void ScrollViewComponentView::HandleCommand(
|
|
|
1061
1074
|
// No-op for now
|
|
1062
1075
|
} else if (commandName == L"scrollToEnd") {
|
|
1063
1076
|
bool animate;
|
|
1064
|
-
winrt::Microsoft::ReactNative::ReadArgs(args, animate);
|
|
1077
|
+
winrt::Microsoft::ReactNative::ReadArgs(args.CommandArgs(), animate);
|
|
1065
1078
|
scrollToEnd(animate);
|
|
1066
1079
|
} else if (commandName == L"zoomToRect") {
|
|
1067
1080
|
// No-op for now
|
|
1068
|
-
} else {
|
|
1069
|
-
Super::HandleCommand(commandName, args);
|
|
1070
1081
|
}
|
|
1071
1082
|
}
|
|
1072
1083
|
|
|
@@ -74,8 +74,7 @@ struct ScrollInteractionTrackerOwner : public winrt::implements<
|
|
|
74
74
|
void prepareForRecycle() noexcept override;
|
|
75
75
|
void OnKeyDown(const winrt::Microsoft::ReactNative::Composition::Input::KeyRoutedEventArgs &args) noexcept override;
|
|
76
76
|
|
|
77
|
-
void HandleCommand(
|
|
78
|
-
override;
|
|
77
|
+
void HandleCommand(const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept override;
|
|
79
78
|
facebook::react::Tag hitTest(facebook::react::Point pt, facebook::react::Point &localPt, bool ignorePointerEvents)
|
|
80
79
|
const noexcept override;
|
|
81
80
|
facebook::react::Point getClientOffset() const noexcept override;
|