react-native-windows 0.78.5 → 0.78.6
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/Directory.Build.props +6 -4
- package/Folly/Folly.vcxproj +46 -6
- package/Folly/Folly.vcxproj.filters +16 -4
- package/Folly/TEMP_UntilFollyUpdate/ConstexprMath.h +26 -18
- package/Folly/TEMP_UntilFollyUpdate/Conv.cpp +1205 -0
- package/Folly/TEMP_UntilFollyUpdate/chrono/Hardware.h +155 -0
- package/Folly/TEMP_UntilFollyUpdate/concurrency/CacheLocality.cpp +633 -0
- package/Folly/TEMP_UntilFollyUpdate/{dynamic-inl.h → json/dynamic-inl.h} +3 -4
- package/Folly/TEMP_UntilFollyUpdate/{json.cpp → json/json.cpp} +14 -10
- package/Folly/TEMP_UntilFollyUpdate/lang/SafeAssert.h +7 -14
- package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.h +6 -6
- package/Folly/ThreadNameStub.cpp +10 -0
- package/Folly/cgmanifest.json +11 -1
- package/Libraries/Components/View/View.windows.js +107 -56
- package/Libraries/Components/View/ViewAccessibility.d.ts +60 -1
- package/Libraries/Image/Image.windows.js +42 -21
- package/Libraries/Modal/Modal.d.ts +7 -0
- package/Libraries/Modal/Modal.windows.js +7 -1
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +3 -0
- package/Libraries/Text/Text.d.ts +18 -0
- package/Microsoft.ReactNative/AsynchronousEventBeat.cpp +4 -25
- package/Microsoft.ReactNative/AsynchronousEventBeat.h +0 -3
- package/Microsoft.ReactNative/Base/FollyIncludes.h +1 -0
- package/Microsoft.ReactNative/CallInvoker.cpp +42 -0
- package/Microsoft.ReactNative/CallInvoker.h +34 -0
- package/Microsoft.ReactNative/{JSDispatcherWriter.cpp → CallInvokerWriter.cpp} +35 -47
- package/Microsoft.ReactNative/CallInvokerWriter.h +74 -0
- package/Microsoft.ReactNative/CompositionComponentView.idl +0 -5
- package/Microsoft.ReactNative/CompositionSwitcher.idl +7 -0
- package/Microsoft.ReactNative/Fabric/AbiViewProps.cpp +8 -10
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +4 -1
- package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.cpp +12 -2
- package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionAnnotationProvider.cpp +100 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionAnnotationProvider.h +31 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +77 -11
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +43 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +7 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +86 -56
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +5 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +0 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionUIService.cpp +0 -2
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +118 -63
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +133 -8
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +16 -2
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.cpp +4 -2
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.h +9 -1
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +34 -11
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +133 -135
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +9 -6
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +46 -49
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +6 -1
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +13 -8
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +5 -2
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +146 -25
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +14 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +160 -12
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +6 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.cpp +47 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.h +15 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.cpp +6 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.h +4 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +7 -9
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +4 -1
- package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +5 -0
- package/Microsoft.ReactNative/Fabric/Composition/TooltipService.cpp +40 -36
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +68 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +11 -0
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +70 -13
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +10 -2
- package/Microsoft.ReactNative/Fabric/ImageManager.cpp +5 -5
- package/Microsoft.ReactNative/Fabric/ImageRequestParams.cpp +26 -0
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +47 -8
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.h +10 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/CompositionAccessibilityProps.h +67 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +22 -4
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.h +15 -2
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +20 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h +5 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/MouseEvent.h +20 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/HostPlatformColor.h +5 -8
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorParser.h +1 -2
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +247 -45
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +15 -0
- package/Microsoft.ReactNative/Fabric/platform/react/threading/MessageQueueThreadImpl.cpp +39 -0
- package/Microsoft.ReactNative/Fabric/platform/react/threading/MessageQueueThreadImpl.h +54 -0
- package/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.cpp +126 -0
- package/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.h +73 -0
- package/Microsoft.ReactNative/IReactContext.cpp +17 -0
- package/Microsoft.ReactNative/IReactContext.h +1 -0
- package/Microsoft.ReactNative/IReactContext.idl +18 -1
- package/Microsoft.ReactNative/IReactDispatcher.idl +1 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.cpp +12 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.h +2 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.idl +8 -0
- package/Microsoft.ReactNative/JsiApi.cpp +10 -2
- package/Microsoft.ReactNative/JsiApi.h +1 -0
- package/Microsoft.ReactNative/JsiApi.idl +1 -0
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +0 -3
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +2 -3
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +7 -12
- package/Microsoft.ReactNative/Modules/Animated/AnimationDriver.cpp +2 -1
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedModule.cpp +4 -8
- package/Microsoft.ReactNative/Modules/AppStateModule.cpp +2 -2
- package/Microsoft.ReactNative/Modules/ClipboardModule.cpp +6 -8
- package/Microsoft.ReactNative/Modules/ClipboardModule.h +1 -1
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +6 -15
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +13 -24
- package/Microsoft.ReactNative/QuirkSettings.cpp +0 -16
- package/Microsoft.ReactNative/QuirkSettings.h +0 -3
- package/Microsoft.ReactNative/ReactHost/ReactHost.cpp +11 -1
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +78 -68
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -2
- package/Microsoft.ReactNative/ReactInstanceSettings.cpp +12 -0
- package/Microsoft.ReactNative/ReactInstanceSettings.h +2 -0
- package/Microsoft.ReactNative/ReactInstanceSettings.idl +6 -0
- package/Microsoft.ReactNative/ReactNativeIsland.idl +3 -0
- package/Microsoft.ReactNative/ReactSupport.cpp +44 -11
- package/Microsoft.ReactNative/RedBox.cpp +30 -1
- package/Microsoft.ReactNative/SchedulerSettings.cpp +4 -4
- package/Microsoft.ReactNative/SchedulerSettings.h +1 -1
- package/Microsoft.ReactNative/TurboModulesProvider.cpp +30 -12
- package/Microsoft.ReactNative/Utils/ImageUtils.h +1 -0
- package/Microsoft.ReactNative/Utils/LocalBundleReader.cpp +37 -31
- package/Microsoft.ReactNative.Cxx/ApiLoaders/JSRuntimeApi.cpp +1 -0
- package/Microsoft.ReactNative.Cxx/ApiLoaders/JSRuntimeApi.inc +2 -0
- package/Microsoft.ReactNative.Cxx/ApiLoaders/NodeApi_posix.cpp +1 -1
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.cpp +94 -27
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +27 -6
- package/Microsoft.ReactNative.Cxx/JSI/JsiApiContext.cpp +45 -11
- package/Microsoft.ReactNative.Cxx/JSI/JsiApiContext.h +6 -0
- package/Microsoft.ReactNative.Cxx/JSI/decorator.h +220 -0
- package/Microsoft.ReactNative.Cxx/JSI/instrumentation.h +28 -0
- package/Microsoft.ReactNative.Cxx/JSI/jsi-inl.h +6 -0
- package/Microsoft.ReactNative.Cxx/JSI/jsi.cpp +241 -4
- package/Microsoft.ReactNative.Cxx/JSI/jsi.h +207 -19
- package/Microsoft.ReactNative.Cxx/JSValue.cpp +19 -3
- package/Microsoft.ReactNative.Cxx/JSValue.h +15 -7
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +2 -2
- package/Microsoft.ReactNative.Cxx/NativeModules.h +60 -2
- package/Microsoft.ReactNative.Cxx/NodeApiJsiRuntime.cpp +1267 -614
- package/Microsoft.ReactNative.Cxx/NodeApiJsiRuntime.h +4 -2
- package/Microsoft.ReactNative.Cxx/ReactContext.h +7 -0
- package/Microsoft.ReactNative.Cxx/TurboModuleProvider.cpp +11 -13
- package/Microsoft.ReactNative.Cxx/TurboModuleProvider.h +2 -3
- package/Microsoft.ReactNative.Cxx/node-api/js_native_api.h +81 -20
- package/Microsoft.ReactNative.Cxx/node-api/js_native_api_types.h +47 -2
- package/Microsoft.ReactNative.Cxx/node-api/js_runtime_api.h +13 -0
- package/Microsoft.ReactNative.Cxx/stubs/glog/logging.h +1 -1
- package/Microsoft.ReactNative.Managed/ReactContext.cs +3 -1
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/JSEngine.props +1 -1
- package/PropertySheets/React.Cpp.props +2 -1
- package/PropertySheets/WebView2.props +1 -1
- package/PropertySheets/WinUI.props +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jserrorhandler/JsErrorHandler.cpp +429 -0
- package/ReactCommon/cgmanifest.json +1 -1
- package/Shared/HermesRuntimeHolder.cpp +6 -0
- package/Shared/JSI/ChakraRuntime.cpp +4 -0
- package/Shared/JSI/ChakraRuntime.h +2 -0
- package/Shared/Modules/BlobModule.cpp +14 -16
- package/Shared/Modules/BlobModule.h +3 -1
- package/Shared/Shared.vcxitems +11 -7
- package/Shared/Shared.vcxitems.filters +6 -1
- package/Shared/TurboModuleManager.cpp +0 -15
- package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +6 -6
- package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +6 -6
- package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +6 -6
- package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +6 -6
- package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +6 -6
- package/codegen/react/components/rnwcore/AndroidSwitch.g.h +6 -6
- package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +6 -6
- package/codegen/react/components/rnwcore/InputAccessory.g.h +6 -6
- package/codegen/react/components/rnwcore/ModalHostView.g.h +11 -7
- package/codegen/react/components/rnwcore/Props.cpp +2 -1
- package/codegen/react/components/rnwcore/Props.h +1 -0
- package/codegen/react/components/rnwcore/PullToRefreshView.g.h +6 -6
- package/codegen/react/components/rnwcore/SafeAreaView.g.h +6 -6
- package/codegen/react/components/rnwcore/Switch.g.h +6 -6
- package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +6 -6
- package/index.windows.js +4 -2
- package/package.json +3 -4
- package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
- package/stubs/glog/logging.h +1 -1
- package/Microsoft.ReactNative/JSDispatcherWriter.h +0 -47
- package/Microsoft.ReactNative/SynchronousEventBeat.cpp +0 -51
- package/Microsoft.ReactNative/SynchronousEventBeat.h +0 -31
|
@@ -708,10 +708,19 @@ struct CompScrollerVisual : winrt::implements<
|
|
|
708
708
|
typename TTypeRedirects::InteractionTrackerInertiaStateEnteredArgs args) noexcept {
|
|
709
709
|
m_outer->m_custom = false;
|
|
710
710
|
m_outer->m_inertia = true;
|
|
711
|
+
m_outer->m_currentPosition = args.NaturalRestingPosition();
|
|
712
|
+
// When the user stops interacting with the object, tracker can go into two paths:
|
|
713
|
+
// 1. tracker goes into idle state immediately
|
|
714
|
+
// 2. tracker has just started gliding into Inertia state
|
|
715
|
+
// Fire ScrollEndDrag
|
|
716
|
+
m_outer->FireScrollEndDrag({args.NaturalRestingPosition().x, args.NaturalRestingPosition().y});
|
|
711
717
|
}
|
|
712
718
|
void InteractingStateEntered(
|
|
713
719
|
typename TTypeRedirects::InteractionTracker sender,
|
|
714
|
-
typename TTypeRedirects::InteractionTrackerInteractingStateEnteredArgs args) noexcept {
|
|
720
|
+
typename TTypeRedirects::InteractionTrackerInteractingStateEnteredArgs args) noexcept {
|
|
721
|
+
// Fire when the user starts dragging the object
|
|
722
|
+
m_outer->FireScrollBeginDrag({sender.Position().x, sender.Position().y});
|
|
723
|
+
}
|
|
715
724
|
void RequestIgnored(
|
|
716
725
|
typename TTypeRedirects::InteractionTracker sender,
|
|
717
726
|
typename TTypeRedirects::InteractionTrackerRequestIgnoredArgs args) noexcept {}
|
|
@@ -834,6 +843,18 @@ struct CompScrollerVisual : winrt::implements<
|
|
|
834
843
|
UpdateInteractionModes();
|
|
835
844
|
}
|
|
836
845
|
|
|
846
|
+
void SetDecelerationRate(winrt::Windows::Foundation::Numerics::float3 const &decelerationRate) noexcept {
|
|
847
|
+
m_interactionTracker.PositionInertiaDecayRate(decelerationRate);
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
void SetMaximumZoomScale(float maximumZoomScale) const noexcept {
|
|
851
|
+
m_interactionTracker.MaxScale(maximumZoomScale);
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
void SetMinimumZoomScale(float minimumZoomScale) noexcept {
|
|
855
|
+
m_interactionTracker.MinScale(minimumZoomScale);
|
|
856
|
+
}
|
|
857
|
+
|
|
837
858
|
void Opacity(float opacity) noexcept {
|
|
838
859
|
m_visual.Opacity(opacity);
|
|
839
860
|
}
|
|
@@ -918,10 +939,32 @@ struct CompScrollerVisual : winrt::implements<
|
|
|
918
939
|
return m_scrollPositionChangedEvent.add(handler);
|
|
919
940
|
}
|
|
920
941
|
|
|
942
|
+
winrt::event_token ScrollBeginDrag(
|
|
943
|
+
winrt::Windows::Foundation::EventHandler<
|
|
944
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::IScrollPositionChangedArgs> const
|
|
945
|
+
&handler) noexcept {
|
|
946
|
+
return m_scrollBeginDragEvent.add(handler);
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
winrt::event_token ScrollEndDrag(
|
|
950
|
+
winrt::Windows::Foundation::EventHandler<
|
|
951
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::IScrollPositionChangedArgs> const
|
|
952
|
+
&handler) noexcept {
|
|
953
|
+
return m_scrollEndDragEvent.add(handler);
|
|
954
|
+
}
|
|
955
|
+
|
|
921
956
|
void ScrollPositionChanged(winrt::event_token const &token) noexcept {
|
|
922
957
|
m_scrollPositionChangedEvent.remove(token);
|
|
923
958
|
}
|
|
924
959
|
|
|
960
|
+
void ScrollBeginDrag(winrt::event_token const &token) noexcept {
|
|
961
|
+
m_scrollBeginDragEvent.remove(token);
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
void ScrollEndDrag(winrt::event_token const &token) noexcept {
|
|
965
|
+
m_scrollEndDragEvent.remove(token);
|
|
966
|
+
}
|
|
967
|
+
|
|
925
968
|
void ContentSize(winrt::Windows::Foundation::Numerics::float2 const &size) noexcept {
|
|
926
969
|
m_contentSize = size;
|
|
927
970
|
m_contentVisual.Size(size);
|
|
@@ -992,6 +1035,14 @@ struct CompScrollerVisual : winrt::implements<
|
|
|
992
1035
|
m_scrollPositionChangedEvent(*this, winrt::make<CompScrollPositionChangedArgs>(position));
|
|
993
1036
|
}
|
|
994
1037
|
|
|
1038
|
+
void FireScrollBeginDrag(winrt::Windows::Foundation::Numerics::float2 position) noexcept {
|
|
1039
|
+
m_scrollBeginDragEvent(*this, winrt::make<CompScrollPositionChangedArgs>(position));
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
void FireScrollEndDrag(winrt::Windows::Foundation::Numerics::float2 position) noexcept {
|
|
1043
|
+
m_scrollEndDragEvent(*this, winrt::make<CompScrollPositionChangedArgs>(position));
|
|
1044
|
+
}
|
|
1045
|
+
|
|
995
1046
|
void UpdateMaxPosition() noexcept {
|
|
996
1047
|
m_interactionTracker.MaxPosition(
|
|
997
1048
|
{std::max<float>(m_contentSize.x - m_visualSize.x, 0),
|
|
@@ -1010,6 +1061,12 @@ struct CompScrollerVisual : winrt::implements<
|
|
|
1010
1061
|
winrt::event<winrt::Windows::Foundation::EventHandler<
|
|
1011
1062
|
winrt::Microsoft::ReactNative::Composition::Experimental::IScrollPositionChangedArgs>>
|
|
1012
1063
|
m_scrollPositionChangedEvent;
|
|
1064
|
+
winrt::event<winrt::Windows::Foundation::EventHandler<
|
|
1065
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::IScrollPositionChangedArgs>>
|
|
1066
|
+
m_scrollBeginDragEvent;
|
|
1067
|
+
winrt::event<winrt::Windows::Foundation::EventHandler<
|
|
1068
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::IScrollPositionChangedArgs>>
|
|
1069
|
+
m_scrollEndDragEvent;
|
|
1013
1070
|
typename TTypeRedirects::SpriteVisual m_visual{nullptr};
|
|
1014
1071
|
typename TTypeRedirects::SpriteVisual m_contentVisual{nullptr};
|
|
1015
1072
|
typename TTypeRedirects::InteractionTracker m_interactionTracker{nullptr};
|
|
@@ -1357,16 +1414,7 @@ struct CompActivityVisual : winrt::implements<
|
|
|
1357
1414
|
_themeProperties.InsertVector4(L"Foreground", ColorAsVector4({0, 0, 0, 0}));
|
|
1358
1415
|
|
|
1359
1416
|
visual.Children().InsertAtTop(Root());
|
|
1360
|
-
|
|
1361
|
-
auto easing = _c.CreateLinearEasingFunction();
|
|
1362
|
-
const auto progressAnimation = _c.CreateScalarKeyFrameAnimation();
|
|
1363
|
-
progressAnimation.Duration(winrt::Windows::Foundation::TimeSpan{c_durationTicks});
|
|
1364
|
-
progressAnimation.InsertKeyFrame(0.0f, 0.0f);
|
|
1365
|
-
progressAnimation.InsertKeyFrame(1.0f, 1.0f, easing);
|
|
1366
|
-
progressAnimation.IterationBehavior(TTypeRedirects::AnimationIterationBehavior::Forever);
|
|
1367
|
-
|
|
1368
|
-
_root.Properties().StartAnimation(L"Progress", progressAnimation);
|
|
1369
|
-
_root.StartAnimation(L"Progress", progressAnimation);
|
|
1417
|
+
StartAnimation();
|
|
1370
1418
|
}
|
|
1371
1419
|
|
|
1372
1420
|
void Brush(winrt::Microsoft::ReactNative::Composition::Experimental::IBrush brush) noexcept {
|
|
@@ -1492,6 +1540,24 @@ struct CompActivityVisual : winrt::implements<
|
|
|
1492
1540
|
SetAnimationClass<TTypeRedirects>(value, m_visual);
|
|
1493
1541
|
}
|
|
1494
1542
|
|
|
1543
|
+
void StartAnimation() noexcept {
|
|
1544
|
+
auto easing = _c.CreateLinearEasingFunction();
|
|
1545
|
+
const auto progressAnimation = _c.CreateScalarKeyFrameAnimation();
|
|
1546
|
+
progressAnimation.Duration(winrt::Windows::Foundation::TimeSpan{c_durationTicks});
|
|
1547
|
+
progressAnimation.InsertKeyFrame(0.0f, 0.0f);
|
|
1548
|
+
progressAnimation.InsertKeyFrame(1.0f, 1.0f, easing);
|
|
1549
|
+
progressAnimation.IterationBehavior(TTypeRedirects::AnimationIterationBehavior::Forever);
|
|
1550
|
+
|
|
1551
|
+
_root.Properties().StartAnimation(L"Progress", progressAnimation);
|
|
1552
|
+
_root.StartAnimation(L"Progress", progressAnimation);
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
void StopAnimation() noexcept {
|
|
1556
|
+
_root.Properties().InsertScalar(L"Progress", 0.7f);
|
|
1557
|
+
_root.Properties().StopAnimation(L"Progress");
|
|
1558
|
+
_root.StopAnimation(L"Progress");
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1495
1561
|
private:
|
|
1496
1562
|
typename TTypeRedirects::SpriteVisual m_visual{nullptr};
|
|
1497
1563
|
typename TTypeRedirects::SpriteVisual m_contentVisual{nullptr};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
#include "pch.h"
|
|
2
2
|
#include "CompositionDynamicAutomationProvider.h"
|
|
3
3
|
#include <Fabric/ComponentView.h>
|
|
4
|
+
#include <Fabric/Composition/CompositionAnnotationProvider.h>
|
|
4
5
|
#include <Fabric/Composition/CompositionTextRangeProvider.h>
|
|
5
6
|
#include <Fabric/Composition/ParagraphComponentView.h>
|
|
6
7
|
#include <Fabric/Composition/ScrollViewComponentView.h>
|
|
7
8
|
#include <Fabric/Composition/SwitchComponentView.h>
|
|
8
9
|
#include <Fabric/Composition/TextInput/WindowsTextInputComponentView.h>
|
|
9
10
|
#include <Unicode.h>
|
|
11
|
+
#include <winrt/Microsoft.UI.Content.h>
|
|
10
12
|
#include "RootComponentView.h"
|
|
11
13
|
#include "UiaHelpers.h"
|
|
12
14
|
|
|
@@ -35,14 +37,33 @@ CompositionDynamicAutomationProvider::CompositionDynamicAutomationProvider(
|
|
|
35
37
|
strongView.as<winrt::Microsoft::ReactNative::Composition::ComponentView>(), this)
|
|
36
38
|
.try_as<ITextProvider2>();
|
|
37
39
|
}
|
|
40
|
+
|
|
41
|
+
if (strongView.try_as<winrt::Microsoft::ReactNative::Composition::implementation::ViewComponentView>()) {
|
|
42
|
+
m_annotationProvider = winrt::make<CompositionAnnotationProvider>(
|
|
43
|
+
strongView.as<winrt::Microsoft::ReactNative::Composition::ComponentView>(), this)
|
|
44
|
+
.try_as<IAnnotationProvider>();
|
|
45
|
+
}
|
|
38
46
|
}
|
|
39
47
|
|
|
48
|
+
CompositionDynamicAutomationProvider::CompositionDynamicAutomationProvider(
|
|
49
|
+
const winrt::Microsoft::ReactNative::Composition::ComponentView &componentView,
|
|
50
|
+
const winrt::Microsoft::UI::Content::ChildSiteLink &childSiteLink) noexcept
|
|
51
|
+
: m_view{componentView}, m_childSiteLink{childSiteLink} {}
|
|
52
|
+
|
|
40
53
|
HRESULT __stdcall CompositionDynamicAutomationProvider::Navigate(
|
|
41
54
|
NavigateDirection direction,
|
|
42
55
|
IRawElementProviderFragment **pRetVal) {
|
|
43
56
|
if (pRetVal == nullptr)
|
|
44
57
|
return E_POINTER;
|
|
45
58
|
|
|
59
|
+
if (m_childSiteLink) {
|
|
60
|
+
if (direction == NavigateDirection_FirstChild || direction == NavigateDirection_LastChild) {
|
|
61
|
+
auto fragment = m_childSiteLink.AutomationProvider().try_as<IRawElementProviderFragment>();
|
|
62
|
+
*pRetVal = fragment.detach();
|
|
63
|
+
return S_OK;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
46
67
|
return UiaNavigateHelper(m_view.view(), direction, *pRetVal);
|
|
47
68
|
}
|
|
48
69
|
|
|
@@ -268,6 +289,11 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPatternProvider(PATTE
|
|
|
268
289
|
strongView.try_as<winrt::Microsoft::ReactNative::Composition::implementation::WindowsTextInputComponentView>()) {
|
|
269
290
|
m_textProvider.as<IUnknown>().copy_to(pRetVal);
|
|
270
291
|
}
|
|
292
|
+
if (patternId == UIA_AnnotationPatternId &&
|
|
293
|
+
strongView.try_as<winrt::Microsoft::ReactNative::Composition::implementation::ViewComponentView>() &&
|
|
294
|
+
accessibilityAnnotationHasValue(props->accessibilityAnnotation)) {
|
|
295
|
+
m_annotationProvider.as<IUnknown>().copy_to(pRetVal);
|
|
296
|
+
}
|
|
271
297
|
|
|
272
298
|
return S_OK;
|
|
273
299
|
}
|
|
@@ -545,8 +571,24 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERT
|
|
|
545
571
|
: SysAllocString(L"");
|
|
546
572
|
break;
|
|
547
573
|
}
|
|
574
|
+
case UIA_LevelPropertyId: {
|
|
575
|
+
pRetVal->vt = VT_I4;
|
|
576
|
+
pRetVal->lVal = props->accessibilityLevel;
|
|
577
|
+
break;
|
|
578
|
+
}
|
|
579
|
+
case UIA_AccessKeyPropertyId: {
|
|
580
|
+
pRetVal->vt = VT_BSTR;
|
|
581
|
+
auto accessKey = ::Microsoft::Common::Unicode::Utf8ToUtf16(props->accessibilityAccessKey.value_or(""));
|
|
582
|
+
pRetVal->bstrVal = SysAllocString(accessKey.c_str());
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
case UIA_ItemTypePropertyId: {
|
|
586
|
+
pRetVal->vt = VT_BSTR;
|
|
587
|
+
auto itemtype = ::Microsoft::Common::Unicode::Utf8ToUtf16(props->accessibilityItemType.value_or(""));
|
|
588
|
+
pRetVal->bstrVal = SysAllocString(itemtype.c_str());
|
|
589
|
+
break;
|
|
590
|
+
}
|
|
548
591
|
}
|
|
549
|
-
|
|
550
592
|
return hr;
|
|
551
593
|
}
|
|
552
594
|
|
|
@@ -26,6 +26,10 @@ class CompositionDynamicAutomationProvider : public winrt::implements<
|
|
|
26
26
|
CompositionDynamicAutomationProvider(
|
|
27
27
|
const winrt::Microsoft::ReactNative::Composition::ComponentView &componentView) noexcept;
|
|
28
28
|
|
|
29
|
+
CompositionDynamicAutomationProvider(
|
|
30
|
+
const winrt::Microsoft::ReactNative::Composition::ComponentView &componentView,
|
|
31
|
+
const winrt::Microsoft::UI::Content::ChildSiteLink &childContentLink) noexcept;
|
|
32
|
+
|
|
29
33
|
// inherited via IRawElementProviderFragment
|
|
30
34
|
virtual HRESULT __stdcall Navigate(NavigateDirection direction, IRawElementProviderFragment **pRetVal) override;
|
|
31
35
|
virtual HRESULT __stdcall GetRuntimeId(SAFEARRAY **pRetVal) override;
|
|
@@ -97,7 +101,10 @@ class CompositionDynamicAutomationProvider : public winrt::implements<
|
|
|
97
101
|
private:
|
|
98
102
|
::Microsoft::ReactNative::ReactTaggedView m_view;
|
|
99
103
|
winrt::com_ptr<ITextProvider2> m_textProvider;
|
|
104
|
+
winrt::com_ptr<IAnnotationProvider> m_annotationProvider;
|
|
100
105
|
std::vector<winrt::com_ptr<IRawElementProviderSimple>> m_selectionItems;
|
|
106
|
+
// Non-null when this UIA node is the peer of a ContentIslandComponentView.
|
|
107
|
+
winrt::Microsoft::UI::Content::ChildSiteLink m_childSiteLink{nullptr};
|
|
101
108
|
};
|
|
102
109
|
|
|
103
110
|
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -196,6 +196,20 @@ void CompositionEventHandler::Initialize() noexcept {
|
|
|
196
196
|
}
|
|
197
197
|
});
|
|
198
198
|
|
|
199
|
+
m_pointerExitedToken = pointerSource.PointerExited([wkThis = weak_from_this()](
|
|
200
|
+
winrt::Microsoft::UI::Input::InputPointerSource const &,
|
|
201
|
+
winrt::Microsoft::UI::Input::PointerEventArgs const &args) {
|
|
202
|
+
if (auto strongThis = wkThis.lock()) {
|
|
203
|
+
if (auto strongRootView = strongThis->m_wkRootView.get()) {
|
|
204
|
+
if (strongThis->SurfaceId() == -1)
|
|
205
|
+
return;
|
|
206
|
+
auto pp = winrt::make<winrt::Microsoft::ReactNative::Composition::Input::implementation::PointerPoint>(
|
|
207
|
+
args.CurrentPoint(), strongRootView.ScaleFactor());
|
|
208
|
+
strongThis->onPointerExited(pp, args.KeyModifiers());
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
|
|
199
213
|
m_pointerCaptureLostToken =
|
|
200
214
|
pointerSource.PointerCaptureLost([wkThis = weak_from_this()](
|
|
201
215
|
winrt::Microsoft::UI::Input::InputPointerSource const &,
|
|
@@ -622,17 +636,6 @@ void CompositionEventHandler::HandleIncomingPointerEvent(
|
|
|
622
636
|
|
|
623
637
|
auto eventPathViews = GetTouchableViewsInPathToRoot(targetView);
|
|
624
638
|
|
|
625
|
-
// Over
|
|
626
|
-
if (targetView != nullptr && previousTargetTag != targetView.Tag()) {
|
|
627
|
-
bool shouldEmitOverEvent =
|
|
628
|
-
IsAnyViewInPathListeningToEvent(eventPathViews, facebook::react::ViewEvents::Offset::PointerOver);
|
|
629
|
-
const auto eventEmitter = winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(targetView)
|
|
630
|
-
->eventEmitterAtPoint(event.offsetPoint);
|
|
631
|
-
if (shouldEmitOverEvent && eventEmitter != nullptr) {
|
|
632
|
-
eventEmitter->onPointerOver(event);
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
|
|
636
639
|
// Entering
|
|
637
640
|
|
|
638
641
|
// We only want to emit events to JS if there is a view that is currently listening to said event
|
|
@@ -649,7 +652,6 @@ void CompositionEventHandler::HandleIncomingPointerEvent(
|
|
|
649
652
|
auto componentView = *itComponentView;
|
|
650
653
|
bool shouldEmitEvent = componentView != nullptr &&
|
|
651
654
|
(hasParentEnterListener ||
|
|
652
|
-
IsViewListeningToEvent(componentView, facebook::react::ViewEvents::Offset::PointerEnter) ||
|
|
653
655
|
IsViewListeningToEvent(componentView, facebook::react::WindowsViewEvents::Offset::MouseEnter));
|
|
654
656
|
|
|
655
657
|
if (std::find(currentlyHoveredViews.begin(), currentlyHoveredViews.end(), componentView) ==
|
|
@@ -659,16 +661,12 @@ void CompositionEventHandler::HandleIncomingPointerEvent(
|
|
|
659
661
|
m_context, componentView.Tag(), pointerPoint, keyModifiers);
|
|
660
662
|
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(componentView)
|
|
661
663
|
->OnPointerEntered(args);
|
|
662
|
-
|
|
663
664
|
if (shouldEmitEvent) {
|
|
664
665
|
const auto eventEmitter =
|
|
665
666
|
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(componentView)
|
|
666
667
|
->eventEmitter();
|
|
667
|
-
if (eventEmitter) {
|
|
668
|
-
eventEmitter->
|
|
669
|
-
if (IsMousePointerEvent(event)) {
|
|
670
|
-
eventEmitter->onMouseEnter(event);
|
|
671
|
-
}
|
|
668
|
+
if (eventEmitter && IsMousePointerEvent(event)) {
|
|
669
|
+
eventEmitter->onMouseEnter(event);
|
|
672
670
|
}
|
|
673
671
|
}
|
|
674
672
|
}
|
|
@@ -681,26 +679,13 @@ void CompositionEventHandler::HandleIncomingPointerEvent(
|
|
|
681
679
|
// Call the underlaying pointer handler
|
|
682
680
|
handler(eventPathViews);
|
|
683
681
|
|
|
684
|
-
// Out
|
|
685
|
-
if (previousTargetTag != -1 && previousTargetTag != (targetView ? targetView.Tag() : -1)) {
|
|
686
|
-
bool shouldEmitOutEvent =
|
|
687
|
-
IsAnyViewInPathListeningToEvent(currentlyHoveredViews, facebook::react::ViewEvents::Offset::PointerOut);
|
|
688
|
-
const auto eventEmitter =
|
|
689
|
-
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(prevTargetView)->eventEmitter();
|
|
690
|
-
if (shouldEmitOutEvent && eventEmitter != nullptr) {
|
|
691
|
-
eventEmitter->onPointerOut(event);
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
|
|
695
682
|
// Leaving
|
|
696
683
|
|
|
697
684
|
// pointerleave events need to be emitted from the deepest target to the root but
|
|
698
685
|
// we also need to efficiently keep track of if a view has a parent which is listening to the leave events,
|
|
699
686
|
// so we first iterate from the root to the target, collecting the views which need events fired for, of which
|
|
700
687
|
// we reverse iterate (now from target to root), actually emitting the events.
|
|
701
|
-
std::vector<winrt::Microsoft::ReactNative::ComponentView>
|
|
702
|
-
viewsToEmitJSLeaveEventsTo; // NSMutableOrderedSet<UIView *> *viewsToEmitLeaveEventsTo =
|
|
703
|
-
// [NSMutableOrderedSet orderedSet];
|
|
688
|
+
std::vector<winrt::Microsoft::ReactNative::ComponentView> viewsToEmitJSLeaveEventsTo;
|
|
704
689
|
|
|
705
690
|
std::vector<winrt::Microsoft::ReactNative::ComponentView> viewsToEmitLeaveEventsTo;
|
|
706
691
|
|
|
@@ -708,14 +693,11 @@ void CompositionEventHandler::HandleIncomingPointerEvent(
|
|
|
708
693
|
|
|
709
694
|
bool hasParentLeaveListener = false;
|
|
710
695
|
for (auto itComponentView = currentlyHoveredViews.rbegin(); itComponentView != currentlyHoveredViews.rend();
|
|
711
|
-
itComponentView++) {
|
|
712
|
-
// reverseObjectEnumerator])
|
|
713
|
-
// {
|
|
696
|
+
itComponentView++) {
|
|
714
697
|
auto componentView = *itComponentView;
|
|
715
698
|
|
|
716
699
|
bool shouldEmitJSEvent = componentView != nullptr &&
|
|
717
700
|
(hasParentLeaveListener ||
|
|
718
|
-
IsViewListeningToEvent(componentView, facebook::react::ViewEvents::Offset::PointerLeave) ||
|
|
719
701
|
IsViewListeningToEvent(componentView, facebook::react::WindowsViewEvents::Offset::MouseLeave));
|
|
720
702
|
|
|
721
703
|
if (std::find(eventPathViews.begin(), eventPathViews.end(), componentView) == eventPathViews.end()) {
|
|
@@ -740,17 +722,13 @@ void CompositionEventHandler::HandleIncomingPointerEvent(
|
|
|
740
722
|
}
|
|
741
723
|
|
|
742
724
|
for (auto itComponentView = viewsToEmitJSLeaveEventsTo.rbegin(); itComponentView != viewsToEmitJSLeaveEventsTo.rend();
|
|
743
|
-
itComponentView++) {
|
|
744
|
-
// reverseObjectEnumerator]) {
|
|
725
|
+
itComponentView++) {
|
|
745
726
|
auto componentView = *itComponentView;
|
|
746
727
|
|
|
747
728
|
const auto eventEmitter =
|
|
748
729
|
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(componentView)->eventEmitter();
|
|
749
|
-
if (eventEmitter) {
|
|
750
|
-
eventEmitter->
|
|
751
|
-
if (IsMousePointerEvent(event)) {
|
|
752
|
-
eventEmitter->onMouseLeave(event);
|
|
753
|
-
}
|
|
730
|
+
if (eventEmitter && IsMousePointerEvent(event)) {
|
|
731
|
+
eventEmitter->onMouseLeave(event);
|
|
754
732
|
}
|
|
755
733
|
}
|
|
756
734
|
|
|
@@ -1045,21 +1023,78 @@ void CompositionEventHandler::onPointerMoved(
|
|
|
1045
1023
|
|
|
1046
1024
|
facebook::react::PointerEvent pointerEvent = CreatePointerEventFromIncompleteHoverData(ptScaled, ptLocal);
|
|
1047
1025
|
|
|
1048
|
-
|
|
1049
|
-
|
|
1026
|
+
// check if this pointer corresponds to active touch that has a responder
|
|
1027
|
+
auto activeTouch = m_activeTouches.find(pointerId);
|
|
1028
|
+
bool isActiveTouch = activeTouch != m_activeTouches.end() && activeTouch->second.eventEmitter != nullptr;
|
|
1029
|
+
|
|
1030
|
+
auto handler = [&, targetView, pointerEvent, isActiveTouch](
|
|
1031
|
+
std::vector<winrt::Microsoft::ReactNative::ComponentView> &eventPathViews) {
|
|
1050
1032
|
const auto eventEmitter = targetView
|
|
1051
1033
|
? winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(targetView)
|
|
1052
1034
|
->eventEmitterAtPoint(pointerEvent.offsetPoint)
|
|
1053
|
-
:
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
IsAnyViewInPathListeningToEvent(eventPathViews, facebook::react::ViewEvents::Offset::PointerMoveCapture);
|
|
1057
|
-
if (eventEmitter != nullptr && hasMoveEventListeners) {
|
|
1035
|
+
: RootComponentView().eventEmitterAtPoint(pointerEvent.offsetPoint);
|
|
1036
|
+
|
|
1037
|
+
if (eventEmitter != nullptr) {
|
|
1058
1038
|
eventEmitter->onPointerMove(pointerEvent);
|
|
1039
|
+
} else {
|
|
1040
|
+
ClearAllHoveredForPointer(pointerEvent);
|
|
1059
1041
|
}
|
|
1060
1042
|
};
|
|
1061
1043
|
|
|
1062
1044
|
HandleIncomingPointerEvent(pointerEvent, targetView, pointerPoint, keyModifiers, handler);
|
|
1045
|
+
|
|
1046
|
+
if (isActiveTouch) {
|
|
1047
|
+
// For active touches with responders, also dispatch through touch event system
|
|
1048
|
+
UpdateActiveTouch(activeTouch->second, ptScaled, ptLocal);
|
|
1049
|
+
DispatchTouchEvent(TouchEventType::Move, pointerId, pointerPoint, keyModifiers);
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
void CompositionEventHandler::ClearAllHoveredForPointer(const facebook::react::PointerEvent &pointerEvent) noexcept {
|
|
1055
|
+
// special case if we have no target
|
|
1056
|
+
// PointerEventsProcessor requires move events to keep track of the hovered components in core.
|
|
1057
|
+
// It also treats a onPointerLeave event as a special case that removes the hover state of all currently hovered
|
|
1058
|
+
// events. If we get null for the targetView, that means that the mouse is no over any components, so we have no
|
|
1059
|
+
// element to send the move event to. However we need to send something so that any previously hovered elements
|
|
1060
|
+
// are no longer hovered.
|
|
1061
|
+
auto children = RootComponentView().Children();
|
|
1062
|
+
if (auto size = children.Size()) {
|
|
1063
|
+
auto firstChild = children.GetAt(0);
|
|
1064
|
+
if (auto childEventEmitter =
|
|
1065
|
+
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(firstChild)->eventEmitter()) {
|
|
1066
|
+
childEventEmitter->onPointerLeave(pointerEvent);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
void CompositionEventHandler::onPointerExited(
|
|
1072
|
+
const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
|
|
1073
|
+
winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept {
|
|
1074
|
+
if (SurfaceId() == -1)
|
|
1075
|
+
return;
|
|
1076
|
+
|
|
1077
|
+
int pointerId = pointerPoint.PointerId();
|
|
1078
|
+
auto position = pointerPoint.Position();
|
|
1079
|
+
|
|
1080
|
+
if (std::shared_ptr<FabricUIManager> fabricuiManager =
|
|
1081
|
+
::Microsoft::ReactNative::FabricUIManager::FromProperties(m_context.Properties())) {
|
|
1082
|
+
facebook::react::Tag tag = -1;
|
|
1083
|
+
facebook::react::Point ptLocal, ptScaled;
|
|
1084
|
+
getTargetPointerArgs(fabricuiManager, pointerPoint, tag, ptScaled, ptLocal);
|
|
1085
|
+
|
|
1086
|
+
tag = -1;
|
|
1087
|
+
|
|
1088
|
+
auto args = winrt::make<winrt::Microsoft::ReactNative::Composition::Input::implementation::PointerRoutedEventArgs>(
|
|
1089
|
+
m_context, tag, pointerPoint, keyModifiers);
|
|
1090
|
+
|
|
1091
|
+
facebook::react::PointerEvent pointerEvent = CreatePointerEventFromIncompleteHoverData(ptScaled, ptLocal);
|
|
1092
|
+
|
|
1093
|
+
auto handler = [&](std::vector<winrt::Microsoft::ReactNative::ComponentView> &eventPathViews) {
|
|
1094
|
+
ClearAllHoveredForPointer(pointerEvent);
|
|
1095
|
+
};
|
|
1096
|
+
|
|
1097
|
+
HandleIncomingPointerEvent(pointerEvent, nullptr, pointerPoint, keyModifiers, handler);
|
|
1063
1098
|
}
|
|
1064
1099
|
}
|
|
1065
1100
|
|
|
@@ -1345,12 +1380,7 @@ void CompositionEventHandler::DispatchTouchEvent(
|
|
|
1345
1380
|
activeTouch.eventEmitter->onPointerDown(pointerEvent);
|
|
1346
1381
|
break;
|
|
1347
1382
|
case TouchEventType::Move: {
|
|
1348
|
-
|
|
1349
|
-
IsAnyViewInPathListeningToEvent(eventPathViews, facebook::react::ViewEvents::Offset::PointerMove) ||
|
|
1350
|
-
IsAnyViewInPathListeningToEvent(eventPathViews, facebook::react::ViewEvents::Offset::PointerMoveCapture);
|
|
1351
|
-
if (hasMoveEventListeners) {
|
|
1352
|
-
activeTouch.eventEmitter->onPointerMove(pointerEvent);
|
|
1353
|
-
}
|
|
1383
|
+
activeTouch.eventEmitter->onPointerMove(pointerEvent);
|
|
1354
1384
|
break;
|
|
1355
1385
|
}
|
|
1356
1386
|
case TouchEventType::End:
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
#include <winrt/Windows.Devices.Input.h>
|
|
15
15
|
#include <optional>
|
|
16
16
|
#include <set>
|
|
17
|
-
#include "Utils/BatchingEventEmitter.h"
|
|
18
17
|
|
|
19
18
|
namespace winrt {
|
|
20
19
|
using namespace Windows::UI;
|
|
@@ -57,6 +56,9 @@ class CompositionEventHandler : public std::enable_shared_from_this<CompositionE
|
|
|
57
56
|
void onPointerMoved(
|
|
58
57
|
const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
|
|
59
58
|
winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept;
|
|
59
|
+
void onPointerExited(
|
|
60
|
+
const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
|
|
61
|
+
winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept;
|
|
60
62
|
void onPointerWheelChanged(
|
|
61
63
|
const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
|
|
62
64
|
winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept;
|
|
@@ -96,6 +98,7 @@ class CompositionEventHandler : public std::enable_shared_from_this<CompositionE
|
|
|
96
98
|
const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
|
|
97
99
|
winrt::Windows::System::VirtualKeyModifiers keyModifiers,
|
|
98
100
|
std::function<void(std::vector<winrt::Microsoft::ReactNative::ComponentView> &)> handler);
|
|
101
|
+
void ClearAllHoveredForPointer(const facebook::react::PointerEvent &pointerEvent) noexcept;
|
|
99
102
|
|
|
100
103
|
struct ActiveTouch {
|
|
101
104
|
facebook::react::Touch touch;
|
|
@@ -169,6 +172,7 @@ class CompositionEventHandler : public std::enable_shared_from_this<CompositionE
|
|
|
169
172
|
winrt::event_token m_pointerMovedToken;
|
|
170
173
|
winrt::event_token m_pointerWheelChangedToken;
|
|
171
174
|
winrt::event_token m_pointerCaptureLostToken;
|
|
175
|
+
winrt::event_token m_pointerExitedToken;
|
|
172
176
|
winrt::event_token m_keyDownToken;
|
|
173
177
|
winrt::event_token m_keyUpToken;
|
|
174
178
|
winrt::event_token m_characterReceivedToken;
|
|
@@ -174,7 +174,6 @@ HRESULT __stdcall CompositionRootAutomationProvider::get_FragmentRoot(IRawElemen
|
|
|
174
174
|
|
|
175
175
|
*pRetVal = nullptr;
|
|
176
176
|
|
|
177
|
-
#ifdef USE_EXPERIMENTAL_WINUI3
|
|
178
177
|
if (m_island) {
|
|
179
178
|
auto parentRoot = m_island.FragmentRootAutomationProvider();
|
|
180
179
|
auto spFragment = parentRoot.try_as<IRawElementProviderFragmentRoot>();
|
|
@@ -183,7 +182,6 @@ HRESULT __stdcall CompositionRootAutomationProvider::get_FragmentRoot(IRawElemen
|
|
|
183
182
|
return S_OK;
|
|
184
183
|
}
|
|
185
184
|
}
|
|
186
|
-
#endif
|
|
187
185
|
|
|
188
186
|
return S_OK;
|
|
189
187
|
}
|
|
@@ -288,7 +286,6 @@ HRESULT __stdcall CompositionRootAutomationProvider::Navigate(
|
|
|
288
286
|
}
|
|
289
287
|
}
|
|
290
288
|
} else if (direction == NavigateDirection_Parent) {
|
|
291
|
-
#ifdef USE_EXPERIMENTAL_WINUI3
|
|
292
289
|
if (m_island) {
|
|
293
290
|
auto parent = m_island.ParentAutomationProvider();
|
|
294
291
|
auto spFragment = parent.try_as<IRawElementProviderFragment>();
|
|
@@ -297,7 +294,6 @@ HRESULT __stdcall CompositionRootAutomationProvider::Navigate(
|
|
|
297
294
|
return S_OK;
|
|
298
295
|
}
|
|
299
296
|
}
|
|
300
|
-
#endif
|
|
301
297
|
}
|
|
302
298
|
*pRetVal = nullptr;
|
|
303
299
|
return S_OK;
|
|
@@ -25,8 +25,6 @@ void CompositionUIService::SetCompositor(
|
|
|
25
25
|
CompositionContextPropertyId(),
|
|
26
26
|
winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::CreateContext(
|
|
27
27
|
compositor));
|
|
28
|
-
// Default to using Bridgeless mode when using fabric
|
|
29
|
-
winrt::Microsoft::ReactNative::implementation::QuirkSettings::SetIsBridgeless(properties, !!compositor);
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
winrt::Microsoft::UI::Composition::Compositor CompositionUIService::GetCompositor(
|