react-native-windows 0.82.0-preview.11 → 0.82.0-preview.13
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/Microsoft.ReactNative/CompositionSwitcher.idl +8 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +15 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +80 -3
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +6 -3
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/package.json +1 -1
|
@@ -45,9 +45,16 @@ enum SnapPointsAlignment {
|
|
|
45
45
|
void Opacity(Single value);
|
|
46
46
|
void BlurRadius(Single value);
|
|
47
47
|
void Color(Windows.UI.Color value);
|
|
48
|
+
void Mask(IBrush mask);
|
|
49
|
+
void SourcePolicy(CompositionDropShadowSourcePolicy policy);
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
[webhosthidden][experimental] enum CompositionDropShadowSourcePolicy {
|
|
53
|
+
Default = 0,
|
|
54
|
+
InheritedOnly = 1
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
[webhosthidden][experimental] interface IVisual {
|
|
51
58
|
void InsertAt(IVisual visual, Int32 index);
|
|
52
59
|
void Remove(IVisual visual);
|
|
53
60
|
IVisual GetAt(UInt32 index);
|
|
@@ -50,6 +50,7 @@ struct CompositionTypeTraits<WindowsTypeTag> {
|
|
|
50
50
|
using CompositionStretch = winrt::Windows::UI::Composition::CompositionStretch;
|
|
51
51
|
using CompositionStrokeCap = winrt::Windows::UI::Composition::CompositionStrokeCap;
|
|
52
52
|
using CompositionSurfaceBrush = winrt::Windows::UI::Composition::CompositionSurfaceBrush;
|
|
53
|
+
using CompositionDropShadowSourcePolicy = winrt::Windows::UI::Composition::CompositionDropShadowSourcePolicy;
|
|
53
54
|
using Compositor = winrt::Windows::UI::Composition::Compositor;
|
|
54
55
|
using ContainerVisual = winrt::Windows::UI::Composition::ContainerVisual;
|
|
55
56
|
using CubicBezierEasingFunction = winrt::Windows::UI::Composition::CubicBezierEasingFunction;
|
|
@@ -122,6 +123,7 @@ struct CompositionTypeTraits<MicrosoftTypeTag> {
|
|
|
122
123
|
using CompositionStretch = winrt::Microsoft::UI::Composition::CompositionStretch;
|
|
123
124
|
using CompositionStrokeCap = winrt::Microsoft::UI::Composition::CompositionStrokeCap;
|
|
124
125
|
using CompositionSurfaceBrush = winrt::Microsoft::UI::Composition::CompositionSurfaceBrush;
|
|
126
|
+
using CompositionDropShadowSourcePolicy = winrt::Microsoft::UI::Composition::CompositionDropShadowSourcePolicy;
|
|
125
127
|
using Compositor = winrt::Microsoft::UI::Composition::Compositor;
|
|
126
128
|
using ContainerVisual = winrt::Microsoft::UI::Composition::ContainerVisual;
|
|
127
129
|
using CubicBezierEasingFunction = winrt::Microsoft::UI::Composition::CubicBezierEasingFunction;
|
|
@@ -218,6 +220,19 @@ struct CompDropShadow : public winrt::implements<
|
|
|
218
220
|
m_shadow.Color(color);
|
|
219
221
|
}
|
|
220
222
|
|
|
223
|
+
void Mask(winrt::Microsoft::ReactNative::Composition::Experimental::IBrush const &mask) noexcept {
|
|
224
|
+
if (mask) {
|
|
225
|
+
m_shadow.Mask(mask.as<typename TTypeRedirects::IInnerCompositionBrush>()->InnerBrush());
|
|
226
|
+
} else {
|
|
227
|
+
m_shadow.Mask(nullptr);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
void SourcePolicy(
|
|
232
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::CompositionDropShadowSourcePolicy policy) noexcept {
|
|
233
|
+
m_shadow.SourcePolicy(static_cast<typename TTypeRedirects::CompositionDropShadowSourcePolicy>(policy));
|
|
234
|
+
}
|
|
235
|
+
|
|
221
236
|
private:
|
|
222
237
|
typename TTypeRedirects::DropShadow m_shadow;
|
|
223
238
|
};
|
|
@@ -709,9 +709,86 @@ void ComponentView::applyShadowProps(const facebook::react::ViewProps &viewProps
|
|
|
709
709
|
shadow.Color(theme()->Color(*viewProps.shadowColor));
|
|
710
710
|
}
|
|
711
711
|
|
|
712
|
-
//
|
|
713
|
-
|
|
714
|
-
|
|
712
|
+
// Check if any border radius is set
|
|
713
|
+
auto borderMetrics = BorderPrimitive::resolveAndAlignBorderMetrics(m_layoutMetrics, viewProps);
|
|
714
|
+
bool hasBorderRadius = borderMetrics.borderRadii.topLeft.horizontal != 0 ||
|
|
715
|
+
borderMetrics.borderRadii.topRight.horizontal != 0 || borderMetrics.borderRadii.bottomLeft.horizontal != 0 ||
|
|
716
|
+
borderMetrics.borderRadii.bottomRight.horizontal != 0 || borderMetrics.borderRadii.topLeft.vertical != 0 ||
|
|
717
|
+
borderMetrics.borderRadii.topRight.vertical != 0 || borderMetrics.borderRadii.bottomLeft.vertical != 0 ||
|
|
718
|
+
borderMetrics.borderRadii.bottomRight.vertical != 0;
|
|
719
|
+
|
|
720
|
+
if (hasBorderRadius) {
|
|
721
|
+
// When borderRadius is set, we need to create a shadow mask that follows the rounded rectangle shape.
|
|
722
|
+
// Use CompositionVisualSurface to capture the clipped visual's appearance as the shadow mask.
|
|
723
|
+
bool maskSet = false;
|
|
724
|
+
|
|
725
|
+
// Try Microsoft (WinUI3) Composition first
|
|
726
|
+
auto msCompositor =
|
|
727
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerCompositor(
|
|
728
|
+
m_compContext);
|
|
729
|
+
if (msCompositor) {
|
|
730
|
+
auto innerVisual =
|
|
731
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerVisual(
|
|
732
|
+
Visual());
|
|
733
|
+
if (innerVisual) {
|
|
734
|
+
// Create a VisualSurface that captures the visual (with its clip applied)
|
|
735
|
+
auto visualSurface = msCompositor.CreateVisualSurface();
|
|
736
|
+
visualSurface.SourceVisual(innerVisual);
|
|
737
|
+
visualSurface.SourceSize(
|
|
738
|
+
{m_layoutMetrics.frame.size.width * m_layoutMetrics.pointScaleFactor,
|
|
739
|
+
m_layoutMetrics.frame.size.height * m_layoutMetrics.pointScaleFactor});
|
|
740
|
+
|
|
741
|
+
// Create a brush from the visual surface to use as shadow mask
|
|
742
|
+
auto maskBrush = msCompositor.CreateSurfaceBrush(visualSurface);
|
|
743
|
+
maskBrush.Stretch(winrt::Microsoft::UI::Composition::CompositionStretch::Fill);
|
|
744
|
+
|
|
745
|
+
// Get the inner shadow and set the mask
|
|
746
|
+
auto innerShadow = winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::
|
|
747
|
+
InnerDropShadow(shadow);
|
|
748
|
+
if (innerShadow) {
|
|
749
|
+
innerShadow.Mask(maskBrush);
|
|
750
|
+
maskSet = true;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
// Fallback to System (Windows.UI) Composition if Microsoft Composition is not available
|
|
756
|
+
if (!maskSet) {
|
|
757
|
+
auto sysCompositor =
|
|
758
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::SystemCompositionContextHelper::InnerCompositor(
|
|
759
|
+
m_compContext);
|
|
760
|
+
if (sysCompositor) {
|
|
761
|
+
auto innerVisual =
|
|
762
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::SystemCompositionContextHelper::InnerVisual(
|
|
763
|
+
Visual());
|
|
764
|
+
if (innerVisual) {
|
|
765
|
+
auto visualSurface = sysCompositor.CreateVisualSurface();
|
|
766
|
+
visualSurface.SourceVisual(innerVisual);
|
|
767
|
+
visualSurface.SourceSize(
|
|
768
|
+
{m_layoutMetrics.frame.size.width * m_layoutMetrics.pointScaleFactor,
|
|
769
|
+
m_layoutMetrics.frame.size.height * m_layoutMetrics.pointScaleFactor});
|
|
770
|
+
|
|
771
|
+
auto maskBrush = sysCompositor.CreateSurfaceBrush(visualSurface);
|
|
772
|
+
maskBrush.Stretch(winrt::Windows::UI::Composition::CompositionStretch::Fill);
|
|
773
|
+
|
|
774
|
+
auto innerShadow =
|
|
775
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::SystemCompositionContextHelper::InnerDropShadow(
|
|
776
|
+
shadow);
|
|
777
|
+
if (innerShadow) {
|
|
778
|
+
innerShadow.Mask(maskBrush);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
// Apply shadow to OuterVisual (which is not clipped) so the shadow can extend beyond the clip
|
|
785
|
+
OuterVisual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(shadow);
|
|
786
|
+
Visual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(nullptr);
|
|
787
|
+
} else {
|
|
788
|
+
// No border radius - apply shadow directly to Visual (original behavior)
|
|
789
|
+
Visual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(shadow);
|
|
790
|
+
OuterVisual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(nullptr);
|
|
791
|
+
}
|
|
715
792
|
}
|
|
716
793
|
|
|
717
794
|
void ComponentView::updateTransformProps(
|
package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp
CHANGED
|
@@ -1227,8 +1227,11 @@ void WindowsTextInputComponentView::updateState(
|
|
|
1227
1227
|
if (m_mostRecentEventCount == m_state->getData().mostRecentEventCount) {
|
|
1228
1228
|
m_comingFromState = true;
|
|
1229
1229
|
auto &fragments = m_state->getData().attributedStringBox.getValue().getFragments();
|
|
1230
|
-
|
|
1231
|
-
|
|
1230
|
+
{
|
|
1231
|
+
// DrawBlock defers DrawText() until after UpdateText completes
|
|
1232
|
+
DrawBlock db(*this);
|
|
1233
|
+
UpdateText(fragments.size() ? fragments[0].string : "");
|
|
1234
|
+
}
|
|
1232
1235
|
m_comingFromState = false;
|
|
1233
1236
|
}
|
|
1234
1237
|
}
|
|
@@ -1377,7 +1380,7 @@ void WindowsTextInputComponentView::EmitOnScrollEvent() noexcept {
|
|
|
1377
1380
|
}
|
|
1378
1381
|
|
|
1379
1382
|
void WindowsTextInputComponentView::OnSelectionChanged(LONG start, LONG end) noexcept {
|
|
1380
|
-
if (m_eventEmitter && !m_comingFromState
|
|
1383
|
+
if (m_eventEmitter && !m_comingFromState && !m_comingFromJS) {
|
|
1381
1384
|
auto emitter = std::static_pointer_cast<const facebook::react::WindowsTextInputEventEmitter>(m_eventEmitter);
|
|
1382
1385
|
facebook::react::WindowsTextInputEventEmitter::OnSelectionChange onSelectionChangeArgs;
|
|
1383
1386
|
onSelectionChangeArgs.selection.start = start;
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.82.0-preview.
|
|
13
|
+
<ReactNativeWindowsVersion>0.82.0-preview.13</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>82</ReactNativeWindowsMinor>
|
|
16
16
|
<ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>72dd76c1c4a8a931426c6a69dc92d87a7dc4737d</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|