react-native-windows 0.0.0-canary.581 → 0.0.0-canary.583
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 +2 -2
- package/Folly/Folly.vcxproj +1 -1
- package/Folly/Folly.vcxproj.filters +0 -3
- package/Folly/TEMP_UntilFollyUpdate/dynamic-inl.h +59 -43
- package/Folly/TEMP_UntilFollyUpdate/lang/SafeAssert.h +192 -0
- package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.cpp +7 -5
- package/Folly/cgmanifest.json +1 -1
- package/{rntypes/Libraries → Libraries}/ActionSheetIOS/ActionSheetIOS.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Alert/Alert.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Animated/Animated.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Animated/Easing.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/AppState/AppState.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/BatchedBridge/NativeModules.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/AccessibilityInfo/AccessibilityInfo.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/ActivityIndicator/ActivityIndicator.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/Button.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/Clipboard/Clipboard.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/DatePicker/DatePickerIOS.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/Keyboard/Keyboard.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/Keyboard/KeyboardAvoidingView.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/Pressable/Pressable.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/ProgressViewIOS/ProgressViewIOS.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/RefreshControl/RefreshControl.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/SafeAreaView/SafeAreaView.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/ScrollView/ScrollView.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/Slider/Slider.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/StatusBar/StatusBar.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/Switch/Switch.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/TextInput/InputAccessoryView.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/TextInput/TextInput.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/ToastAndroid/ToastAndroid.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/Touchable/Touchable.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/Touchable/TouchableHighlight.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/Touchable/TouchableNativeFeedback.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/Touchable/TouchableOpacity.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/Touchable/TouchableWithoutFeedback.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/View/View.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/View/ViewAccessibility.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Components/View/ViewPropTypes.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/EventEmitter/NativeEventEmitter.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/EventEmitter/RCTDeviceEventEmitter.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/EventEmitter/RCTNativeAppEventEmitter.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Image/Image.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Image/ImagePickerIOS.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Image/ImageResizeMode.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Image/ImageSource.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Interaction/InteractionManager.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Interaction/PanResponder.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/LayoutAnimation/LayoutAnimation.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Linking/Linking.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Lists/FlatList.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Lists/SectionList.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Lists/VirtualizedList.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/LogBox/LogBox.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Modal/Modal.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Performance/Systrace.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/PermissionsAndroid/PermissionsAndroid.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/PushNotificationIOS/PushNotificationIOS.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/ReactNative/AppRegistry.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/ReactNative/I18nManager.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/ReactNative/RendererProxy.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/ReactNative/UIManager.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/ReactNative/requireNativeComponent.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Renderer/implementations/ReactNativeRenderer.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Renderer/shims/ReactNativeTypes.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Settings/Settings.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Share/Share.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Storage/AsyncStorage.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/StyleSheet/PlatformColorValueTypes.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/StyleSheet/PlatformColorValueTypesIOS.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/StyleSheet/StyleSheet.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/StyleSheet/StyleSheetTypes.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/StyleSheet/processColor.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Text/Text.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/TurboModule/RCTExport.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/TurboModule/TurboModuleRegistry.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Types/CoreEventTypes.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Utilities/Appearance.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Utilities/BackHandler.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Utilities/DevSettings.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Utilities/Dimensions.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Utilities/PixelRatio.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Utilities/Platform.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/Vibration/Vibration.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/YellowBox/YellowBoxDeprecated.d.ts +0 -0
- package/Libraries/platform-types.d.ts +17 -0
- package/{rntypes/Libraries → Libraries}/vendor/core/ErrorUtils.d.ts +0 -0
- package/{rntypes/Libraries → Libraries}/vendor/emitter/EventEmitter.d.ts +0 -0
- package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +8 -25
- package/Microsoft.ReactNative/CompositionSwitcher.idl +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +12 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +83 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +6 -0
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +1 -0
- package/Microsoft.ReactNative/Modules/Animated/AdditionAnimatedNode.cpp +1 -1
- package/Microsoft.ReactNative/Modules/Animated/CalculatedAnimationDriver.cpp +2 -2
- package/Microsoft.ReactNative/Modules/Animated/DiffClampAnimatedNode.cpp +1 -1
- package/Microsoft.ReactNative/Modules/Animated/DivisionAnimatedNode.cpp +1 -1
- package/Microsoft.ReactNative/Modules/Animated/FrameAnimationDriver.cpp +2 -2
- package/Microsoft.ReactNative/Modules/Animated/InterpolationAnimatedNode.cpp +1 -1
- package/Microsoft.ReactNative/Modules/Animated/ModulusAnimatedNode.cpp +1 -1
- package/Microsoft.ReactNative/Modules/Animated/MultiplicationAnimatedNode.cpp +1 -1
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedModule.cpp +1 -0
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedModule.h +1 -1
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedNodeManager.cpp +28 -0
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedNodeManager.h +4 -0
- package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.cpp +105 -17
- package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.h +21 -0
- package/Microsoft.ReactNative/Modules/Animated/SubtractionAnimatedNode.cpp +1 -1
- package/Microsoft.ReactNative/Modules/Animated/ValueAnimatedNode.cpp +1 -3
- package/Microsoft.ReactNative/Views/KeyboardEventHandler.cpp +16 -3
- package/Microsoft.ReactNative/Views/ViewControl.cpp +2 -2
- package/Microsoft.ReactNative/Views/ViewControl.h +1 -1
- package/Microsoft.ReactNative/Views/ViewViewManager.cpp +12 -12
- package/Microsoft.ReactNative/Views/cppwinrt/ViewPanel.idl +4 -4
- package/Microsoft.ReactNative.Managed/Microsoft.ReactNative.Managed.csproj +5 -4
- package/PropertySheets/External/Microsoft.ReactNative.CSharp.Dependencies.props +17 -0
- package/PropertySheets/External/Microsoft.ReactNative.Common.props +1 -0
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpApp.targets +1 -0
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpLib.targets +1 -0
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.targets +1 -0
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.targets +1 -0
- package/PropertySheets/Generated/PackageVersion.g.props +1 -1
- package/Scripts/rnw-dependencies.ps1 +315 -160
- package/Shared/Networking/WinRTHttpResource.cpp +18 -13
- package/Shared/OInstance.cpp +2 -8
- package/Shared/Shared.vcxitems +3 -1
- package/package.json +6 -6
- package/rntypes/types/BatchedBridge.d.ts +0 -32
- package/rntypes/types/Codegen.d.ts +0 -74
- package/rntypes/types/Devtools.d.ts +0 -31
- package/rntypes/types/LaunchScreen.d.ts +0 -18
- package/rntypes/types/Utilities.d.ts +0 -29
- package/rntypes/types/globals.d.ts +0 -577
- package/rntypes/types/index.d.ts +0 -211
- package/rntypes/types/legacy-properties.d.ts +0 -208
- package/typings-index.d.ts +0 -19
- package/typings-index.js +0 -44
- package/typings-index.js.map +0 -1
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file contains the windows extra types, which are not part of core.
|
|
3
|
+
*
|
|
4
|
+
* NOTE: Concrete classes, objects etc that actually need to be exported from the package,
|
|
5
|
+
* need to also be added to index.windows.js
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export * from './Components/Flyout/FlyoutProps';
|
|
9
|
+
export * from './Components/Flyout/Flyout';
|
|
10
|
+
export * from './Components/Glyph/Glyph';
|
|
11
|
+
export * from './Components/Popup/PopupProps';
|
|
12
|
+
export * from './Components/Popup/Popup';
|
|
13
|
+
export * from './Components/Keyboard/KeyboardExt';
|
|
14
|
+
export * from './Components/Keyboard/KeyboardExtProps';
|
|
15
|
+
export * from './Components/View/ViewWindowsProps';
|
|
16
|
+
export * from './Components/View/ViewWindows';
|
|
17
|
+
export * from './AppTheme/AppThemeTypes';
|
|
File without changes
|
|
File without changes
|
|
@@ -18,21 +18,6 @@
|
|
|
18
18
|
|
|
19
19
|
namespace Microsoft::ReactNative {
|
|
20
20
|
|
|
21
|
-
using winrt::Microsoft::ReactNative::ReactPropertyBag;
|
|
22
|
-
|
|
23
|
-
namespace {
|
|
24
|
-
|
|
25
|
-
using winrt::Microsoft::ReactNative::ReactPropertyId;
|
|
26
|
-
|
|
27
|
-
ReactPropertyId<bool> HttpUseMonolithicModuleProperty() noexcept {
|
|
28
|
-
static ReactPropertyId<bool> propId{
|
|
29
|
-
L"ReactNative.Http"
|
|
30
|
-
L"UseMonolithicModule"};
|
|
31
|
-
return propId;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
} // namespace
|
|
35
|
-
|
|
36
21
|
std::vector<facebook::react::NativeModuleDescription> GetCoreModules(
|
|
37
22
|
const std::shared_ptr<facebook::react::MessageQueueThread> &batchingUIMessageQueue,
|
|
38
23
|
const std::shared_ptr<facebook::react::MessageQueueThread>
|
|
@@ -45,17 +30,15 @@ std::vector<facebook::react::NativeModuleDescription> GetCoreModules(
|
|
|
45
30
|
[props = context->Properties()]() { return Microsoft::React::CreateHttpModule(props); },
|
|
46
31
|
jsMessageQueue);
|
|
47
32
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
batchingUIMessageQueue);
|
|
33
|
+
modules.emplace_back(
|
|
34
|
+
Microsoft::React::GetBlobModuleName(),
|
|
35
|
+
[props = context->Properties()]() { return Microsoft::React::CreateBlobModule(props); },
|
|
36
|
+
batchingUIMessageQueue);
|
|
53
37
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
38
|
+
modules.emplace_back(
|
|
39
|
+
Microsoft::React::GetFileReaderModuleName(),
|
|
40
|
+
[props = context->Properties()]() { return Microsoft::React::CreateFileReaderModule(props); },
|
|
41
|
+
batchingUIMessageQueue);
|
|
59
42
|
|
|
60
43
|
// AsyncStorageModule doesn't work without package identity (it indirectly depends on
|
|
61
44
|
// Windows.Storage.StorageFile), so check for package identity before adding it.
|
|
@@ -48,6 +48,7 @@ namespace Microsoft.ReactNative.Composition
|
|
|
48
48
|
IVisual GetAt(UInt32 index);
|
|
49
49
|
void Opacity(Single opacity);
|
|
50
50
|
void Scale(Windows.Foundation.Numerics.Vector3 scale);
|
|
51
|
+
void TransformMatrix(Windows.Foundation.Numerics.Matrix4x4 transform);
|
|
51
52
|
void RotationAngle(Single angle);
|
|
52
53
|
void IsVisible(Boolean isVisible);
|
|
53
54
|
void Size(Windows.Foundation.Numerics.Vector2 size);
|
|
@@ -207,6 +207,10 @@ struct CompVisual : public winrt::implements<
|
|
|
207
207
|
m_visual.Scale(scale);
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
void TransformMatrix(winrt::Windows::Foundation::Numerics::float4x4 const &transform) noexcept {
|
|
211
|
+
m_visual.TransformMatrix(transform);
|
|
212
|
+
}
|
|
213
|
+
|
|
210
214
|
void RotationAngle(float rotation) noexcept {
|
|
211
215
|
m_visual.RotationAngle(rotation);
|
|
212
216
|
}
|
|
@@ -289,6 +293,10 @@ struct CompSpriteVisual : winrt::Microsoft::ReactNative::Composition::implementa
|
|
|
289
293
|
m_visual.Scale(scale);
|
|
290
294
|
}
|
|
291
295
|
|
|
296
|
+
void TransformMatrix(winrt::Windows::Foundation::Numerics::float4x4 const &transform) noexcept {
|
|
297
|
+
m_visual.TransformMatrix(transform);
|
|
298
|
+
}
|
|
299
|
+
|
|
292
300
|
void RotationAngle(float rotation) noexcept {
|
|
293
301
|
m_visual.RotationAngle(rotation);
|
|
294
302
|
}
|
|
@@ -467,6 +475,10 @@ struct CompScrollerVisual : winrt::Microsoft::ReactNative::Composition::implemen
|
|
|
467
475
|
m_visual.Scale(scale);
|
|
468
476
|
}
|
|
469
477
|
|
|
478
|
+
void TransformMatrix(winrt::Windows::Foundation::Numerics::float4x4 const &transform) noexcept {
|
|
479
|
+
m_visual.TransformMatrix(transform);
|
|
480
|
+
}
|
|
481
|
+
|
|
470
482
|
void RotationAngle(float rotation) noexcept {
|
|
471
483
|
m_visual.RotationAngle(rotation);
|
|
472
484
|
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#include <Utils/ValueUtils.h>
|
|
11
11
|
#include <Views/FrameworkElementTransferProperties.h>
|
|
12
12
|
#include <winrt/Windows.UI.Composition.h>
|
|
13
|
+
#include "CompositionContextHelper.h"
|
|
13
14
|
#include "CompositionHelpers.h"
|
|
14
15
|
#include "d2d1helper.h"
|
|
15
16
|
|
|
@@ -975,6 +976,65 @@ void CompositionBaseComponentView::indexOffsetForBorder(uint32_t &index) const n
|
|
|
975
976
|
|
|
976
977
|
void CompositionBaseComponentView::OnRenderingDeviceLost() noexcept {}
|
|
977
978
|
|
|
979
|
+
comp::CompositionPropertySet CompositionBaseComponentView::EnsureCenterPointPropertySet() noexcept {
|
|
980
|
+
if (m_centerPropSet == nullptr) {
|
|
981
|
+
auto compositor =
|
|
982
|
+
winrt::Microsoft::ReactNative::Composition::implementation::CompositionContextHelper::InnerCompositor(
|
|
983
|
+
m_compContext);
|
|
984
|
+
|
|
985
|
+
m_centerPropSet = compositor.CreatePropertySet();
|
|
986
|
+
UpdateCenterPropertySet();
|
|
987
|
+
m_centerPropSet.InsertMatrix4x4(L"transform", winrt::Windows::Foundation::Numerics::float4x4::identity());
|
|
988
|
+
m_centerPropSet.InsertVector3(L"translation", {0, 0, 0});
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
return m_centerPropSet;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
// Create a PropertySet that will hold properties used for animation facades:
|
|
995
|
+
// "center": This is the center of the Visual, which is used by animations and transforms to rotate around the
|
|
996
|
+
// correct center
|
|
997
|
+
// "dpiScale3": This is a vector3 containing the scale factor for this view, used in expressions to convert from
|
|
998
|
+
// dips to px
|
|
999
|
+
// "dpiScale3": This is a vector3 containing the inverse scale factor for this view, used in expressions to
|
|
1000
|
+
// convert from px to dips "translation": An additional translation to apply to the to the visual in
|
|
1001
|
+
// addition to Offset. This is used to apply any translation properties set, or animated
|
|
1002
|
+
// "transform": A transform to apply to the visual. This transform is in dips.
|
|
1003
|
+
void CompositionBaseComponentView::UpdateCenterPropertySet() noexcept {
|
|
1004
|
+
if (m_centerPropSet != nullptr) {
|
|
1005
|
+
m_centerPropSet.InsertVector3(
|
|
1006
|
+
L"center",
|
|
1007
|
+
{m_layoutMetrics.frame.size.width * m_layoutMetrics.pointScaleFactor / 2,
|
|
1008
|
+
m_layoutMetrics.frame.size.height * m_layoutMetrics.pointScaleFactor / 2,
|
|
1009
|
+
0});
|
|
1010
|
+
m_centerPropSet.InsertVector3(
|
|
1011
|
+
L"dpiScale3",
|
|
1012
|
+
{m_layoutMetrics.pointScaleFactor, m_layoutMetrics.pointScaleFactor, m_layoutMetrics.pointScaleFactor});
|
|
1013
|
+
m_centerPropSet.InsertVector3(
|
|
1014
|
+
L"dpiScale3Inv",
|
|
1015
|
+
{1 / m_layoutMetrics.pointScaleFactor,
|
|
1016
|
+
1 / m_layoutMetrics.pointScaleFactor,
|
|
1017
|
+
1 / m_layoutMetrics.pointScaleFactor});
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
void CompositionBaseComponentView::EnsureTransformMatrixFacade() noexcept {
|
|
1022
|
+
if (m_hasTransformMatrixFacade)
|
|
1023
|
+
return;
|
|
1024
|
+
m_hasTransformMatrixFacade = true;
|
|
1025
|
+
|
|
1026
|
+
auto centerPointPropSet = EnsureCenterPointPropertySet();
|
|
1027
|
+
// TODO cache expression instead of creating new ones all the time
|
|
1028
|
+
auto expression =
|
|
1029
|
+
winrt::Microsoft::ReactNative::Composition::implementation::CompositionContextHelper::InnerCompositor(
|
|
1030
|
+
m_compContext)
|
|
1031
|
+
.CreateExpressionAnimation(
|
|
1032
|
+
L"Matrix4x4.CreateFromScale(PS.dpiScale3Inv) * Matrix4x4.CreateFromTranslation(PS.translation) * PS.transform * Matrix4x4.CreateFromScale(PS.dpiScale3)");
|
|
1033
|
+
expression.SetReferenceParameter(L"PS", centerPointPropSet);
|
|
1034
|
+
winrt::Microsoft::ReactNative::Composition::implementation::CompositionContextHelper::InnerVisual(Visual())
|
|
1035
|
+
.StartAnimation(L"TransformMatrix", expression);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
978
1038
|
CompositionViewComponentView::CompositionViewComponentView(
|
|
979
1039
|
const winrt::Microsoft::ReactNative::Composition::ICompositionContext &compContext,
|
|
980
1040
|
facebook::react::Tag tag)
|
|
@@ -1047,12 +1107,28 @@ void CompositionViewComponentView::updateProps(
|
|
|
1047
1107
|
|
|
1048
1108
|
// Transform - TODO doesn't handle multiple of the same kind of transform -- Doesn't handle hittesting updates
|
|
1049
1109
|
if (oldViewProps.transform != newViewProps.transform) {
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1110
|
+
winrt::Windows::Foundation::Numerics::float4x4 transformMatrix;
|
|
1111
|
+
transformMatrix.m11 = newViewProps.transform.matrix[0];
|
|
1112
|
+
transformMatrix.m12 = newViewProps.transform.matrix[1];
|
|
1113
|
+
transformMatrix.m13 = newViewProps.transform.matrix[2];
|
|
1114
|
+
transformMatrix.m14 = newViewProps.transform.matrix[3];
|
|
1115
|
+
transformMatrix.m21 = newViewProps.transform.matrix[4];
|
|
1116
|
+
transformMatrix.m22 = newViewProps.transform.matrix[5];
|
|
1117
|
+
transformMatrix.m23 = newViewProps.transform.matrix[6];
|
|
1118
|
+
transformMatrix.m24 = newViewProps.transform.matrix[7];
|
|
1119
|
+
transformMatrix.m31 = newViewProps.transform.matrix[8];
|
|
1120
|
+
transformMatrix.m32 = newViewProps.transform.matrix[9];
|
|
1121
|
+
transformMatrix.m33 = newViewProps.transform.matrix[10];
|
|
1122
|
+
transformMatrix.m34 = newViewProps.transform.matrix[11];
|
|
1123
|
+
transformMatrix.m41 = newViewProps.transform.matrix[12];
|
|
1124
|
+
transformMatrix.m42 = newViewProps.transform.matrix[13];
|
|
1125
|
+
transformMatrix.m43 = newViewProps.transform.matrix[14];
|
|
1126
|
+
transformMatrix.m44 = newViewProps.transform.matrix[15];
|
|
1127
|
+
|
|
1128
|
+
auto centerPointPropSet = EnsureCenterPointPropertySet();
|
|
1129
|
+
centerPointPropSet.InsertMatrix4x4(L"transform", transformMatrix);
|
|
1130
|
+
|
|
1131
|
+
EnsureTransformMatrixFacade();
|
|
1056
1132
|
}
|
|
1057
1133
|
|
|
1058
1134
|
m_props = std::static_pointer_cast<facebook::react::ViewProps const>(props);
|
|
@@ -1116,6 +1192,7 @@ void CompositionViewComponentView::updateLayoutMetrics(
|
|
|
1116
1192
|
|
|
1117
1193
|
m_layoutMetrics = layoutMetrics;
|
|
1118
1194
|
|
|
1195
|
+
UpdateCenterPropertySet();
|
|
1119
1196
|
m_visual.Size(
|
|
1120
1197
|
{layoutMetrics.frame.size.width * layoutMetrics.pointScaleFactor,
|
|
1121
1198
|
layoutMetrics.frame.size.height * layoutMetrics.pointScaleFactor});
|
|
@@ -50,6 +50,9 @@ struct CompositionBaseComponentView : public IComponentView {
|
|
|
50
50
|
|
|
51
51
|
virtual void OnRenderingDeviceLost() noexcept;
|
|
52
52
|
|
|
53
|
+
comp::CompositionPropertySet EnsureCenterPointPropertySet() noexcept;
|
|
54
|
+
void EnsureTransformMatrixFacade() noexcept;
|
|
55
|
+
|
|
53
56
|
protected:
|
|
54
57
|
std::array<winrt::Microsoft::ReactNative::Composition::SpriteVisual, SpecialBorderLayerCount>
|
|
55
58
|
FindSpecialBorderLayers() const noexcept;
|
|
@@ -60,14 +63,17 @@ struct CompositionBaseComponentView : public IComponentView {
|
|
|
60
63
|
void UpdateSpecialBorderLayers(
|
|
61
64
|
facebook::react::LayoutMetrics const &layoutMetrics,
|
|
62
65
|
const facebook::react::ViewProps &viewProps) noexcept;
|
|
66
|
+
void UpdateCenterPropertySet() noexcept;
|
|
63
67
|
|
|
64
68
|
winrt::Microsoft::ReactNative::Composition::ICompositionContext m_compContext;
|
|
69
|
+
comp::CompositionPropertySet m_centerPropSet{nullptr};
|
|
65
70
|
const facebook::react::Tag m_tag;
|
|
66
71
|
facebook::react::SharedViewEventEmitter m_eventEmitter;
|
|
67
72
|
std::vector<const IComponentView *> m_children;
|
|
68
73
|
IComponentView *m_parent{nullptr};
|
|
69
74
|
facebook::react::LayoutMetrics m_layoutMetrics;
|
|
70
75
|
bool m_needsBorderUpdate{false};
|
|
76
|
+
bool m_hasTransformMatrixFacade{false};
|
|
71
77
|
uint8_t m_numBorderVisuals{0};
|
|
72
78
|
};
|
|
73
79
|
|
|
@@ -178,6 +178,7 @@ void ImageComponentView::updateLayoutMetrics(
|
|
|
178
178
|
|
|
179
179
|
m_layoutMetrics = layoutMetrics;
|
|
180
180
|
|
|
181
|
+
UpdateCenterPropertySet();
|
|
181
182
|
m_visual.Size(
|
|
182
183
|
{layoutMetrics.frame.size.width * layoutMetrics.pointScaleFactor,
|
|
183
184
|
layoutMetrics.frame.size.height * layoutMetrics.pointScaleFactor});
|
|
@@ -88,6 +88,7 @@ void ParagraphComponentView::updateLayoutMetrics(
|
|
|
88
88
|
|
|
89
89
|
m_layoutMetrics = layoutMetrics;
|
|
90
90
|
|
|
91
|
+
UpdateCenterPropertySet();
|
|
91
92
|
m_visual.Size(
|
|
92
93
|
{layoutMetrics.frame.size.width * layoutMetrics.pointScaleFactor,
|
|
93
94
|
layoutMetrics.frame.size.height * layoutMetrics.pointScaleFactor});
|
|
@@ -197,6 +197,7 @@ void ScrollViewComponentView::updateLayoutMetrics(
|
|
|
197
197
|
// m_needsBorderUpdate = true;
|
|
198
198
|
m_layoutMetrics = layoutMetrics;
|
|
199
199
|
|
|
200
|
+
UpdateCenterPropertySet();
|
|
200
201
|
m_visual.Size(
|
|
201
202
|
{layoutMetrics.frame.size.width * layoutMetrics.pointScaleFactor,
|
|
202
203
|
layoutMetrics.frame.size.height * layoutMetrics.pointScaleFactor});
|
package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp
CHANGED
|
@@ -782,6 +782,7 @@ void WindowsTextInputComponentView::updateLayoutMetrics(
|
|
|
782
782
|
m_imgWidth = newWidth;
|
|
783
783
|
m_imgHeight = newHeight;
|
|
784
784
|
|
|
785
|
+
UpdateCenterPropertySet();
|
|
785
786
|
m_visual.Size(
|
|
786
787
|
{layoutMetrics.frame.size.width * layoutMetrics.pointScaleFactor,
|
|
787
788
|
layoutMetrics.frame.size.height * layoutMetrics.pointScaleFactor});
|
|
@@ -21,7 +21,7 @@ AdditionAnimatedNode::AdditionAnimatedNode(
|
|
|
21
21
|
|
|
22
22
|
if (m_useComposition) {
|
|
23
23
|
m_propertySet.StartAnimation(s_valueName, [nodes = m_inputNodes, manager]() {
|
|
24
|
-
const auto anim =
|
|
24
|
+
const auto anim = manager->Compositor().CreateExpressionAnimation();
|
|
25
25
|
|
|
26
26
|
anim.Expression([nodes, manager, anim]() {
|
|
27
27
|
winrt::hstring expr = L"0";
|
|
@@ -11,8 +11,8 @@ namespace Microsoft::ReactNative {
|
|
|
11
11
|
std::tuple<comp::CompositionAnimation, comp::CompositionScopedBatch> CalculatedAnimationDriver::MakeAnimation(
|
|
12
12
|
const winrt::Microsoft::ReactNative::JSValueObject & /*config*/) {
|
|
13
13
|
assert(m_useComposition);
|
|
14
|
-
const auto [scopedBatch, animation, easingFunction] = []() {
|
|
15
|
-
const auto compositor =
|
|
14
|
+
const auto [scopedBatch, animation, easingFunction] = [manager = m_manager.lock()]() {
|
|
15
|
+
const auto compositor = manager->Compositor();
|
|
16
16
|
return std::make_tuple(
|
|
17
17
|
compositor.CreateScopedBatch(comp::CompositionBatchTypes::AllAnimations),
|
|
18
18
|
compositor.CreateScalarKeyFrameAnimation(),
|
|
@@ -19,7 +19,7 @@ DiffClampAnimatedNode::DiffClampAnimatedNode(
|
|
|
19
19
|
|
|
20
20
|
if (m_useComposition) {
|
|
21
21
|
m_propertySet.StartAnimation(s_valueName, [node = m_inputNodeTag, min = m_min, max = m_max, manager]() {
|
|
22
|
-
const auto anim =
|
|
22
|
+
const auto anim = manager->Compositor().CreateExpressionAnimation();
|
|
23
23
|
anim.SetReferenceParameter(s_inputParameterName, manager->GetValueAnimatedNode(node)->PropertySet());
|
|
24
24
|
anim.SetScalarParameter(s_minParameterName, static_cast<float>(min));
|
|
25
25
|
anim.SetScalarParameter(s_maxParameterName, static_cast<float>(max));
|
|
@@ -24,7 +24,7 @@ DivisionAnimatedNode::DivisionAnimatedNode(
|
|
|
24
24
|
|
|
25
25
|
if (m_useComposition) {
|
|
26
26
|
m_propertySet.StartAnimation(s_valueName, [firstNode = m_firstInput, nodes = m_inputNodes, manager]() {
|
|
27
|
-
const auto anim =
|
|
27
|
+
const auto anim = manager->Compositor().CreateExpressionAnimation();
|
|
28
28
|
|
|
29
29
|
anim.Expression([firstNode, nodes, manager, anim]() {
|
|
30
30
|
anim.SetReferenceParameter(s_baseName, manager->GetValueAnimatedNode(firstNode)->PropertySet());
|
|
@@ -24,8 +24,8 @@ FrameAnimationDriver::FrameAnimationDriver(
|
|
|
24
24
|
std::tuple<comp::CompositionAnimation, comp::CompositionScopedBatch> FrameAnimationDriver::MakeAnimation(
|
|
25
25
|
const winrt::Microsoft::ReactNative::JSValueObject & /*config*/) {
|
|
26
26
|
assert(m_useComposition);
|
|
27
|
-
const auto [scopedBatch, animation] = []() {
|
|
28
|
-
const auto compositor =
|
|
27
|
+
const auto [scopedBatch, animation] = [manager = m_manager.lock()]() {
|
|
28
|
+
const auto compositor = manager->Compositor();
|
|
29
29
|
return std::make_tuple(
|
|
30
30
|
compositor.CreateScopedBatch(
|
|
31
31
|
IsRS5OrHigher() ? comp::CompositionBatchTypes::AllAnimations : comp::CompositionBatchTypes::Animation),
|
|
@@ -59,7 +59,7 @@ void InterpolationAnimatedNode::OnAttachToNode(int64_t animatedNodeTag) {
|
|
|
59
59
|
const auto [rawValueAnimation, offsetAnimation] = [this]() {
|
|
60
60
|
if (const auto manager = m_manager.lock()) {
|
|
61
61
|
if (const auto parent = manager->GetValueAnimatedNode(m_parentTag)) {
|
|
62
|
-
const auto compositor =
|
|
62
|
+
const auto compositor = manager->Compositor();
|
|
63
63
|
|
|
64
64
|
const auto rawValueAnimation = CreateExpressionAnimation(compositor, *parent);
|
|
65
65
|
rawValueAnimation.Expression(
|
|
@@ -18,7 +18,7 @@ ModulusAnimatedNode::ModulusAnimatedNode(
|
|
|
18
18
|
|
|
19
19
|
if (m_useComposition) {
|
|
20
20
|
m_propertySet.StartAnimation(s_valueName, [node = m_inputNodeTag, mod = m_modulus, manager]() {
|
|
21
|
-
const auto anim =
|
|
21
|
+
const auto anim = manager->Compositor().CreateExpressionAnimation();
|
|
22
22
|
anim.SetReferenceParameter(s_inputParameterName, manager->GetValueAnimatedNode(node)->PropertySet());
|
|
23
23
|
anim.SetScalarParameter(s_modName, static_cast<float>(mod));
|
|
24
24
|
anim.Expression(
|
|
@@ -20,7 +20,7 @@ MultiplicationAnimatedNode::MultiplicationAnimatedNode(
|
|
|
20
20
|
|
|
21
21
|
if (m_useComposition) {
|
|
22
22
|
m_propertySet.StartAnimation(s_valueName, [nodes = m_inputNodes, manager]() {
|
|
23
|
-
const auto anim =
|
|
23
|
+
const auto anim = manager->Compositor().CreateExpressionAnimation();
|
|
24
24
|
|
|
25
25
|
anim.Expression([nodes, manager, anim]() {
|
|
26
26
|
winrt::hstring expr = L"1";
|
|
@@ -12,6 +12,7 @@ namespace Microsoft::ReactNative {
|
|
|
12
12
|
|
|
13
13
|
void NativeAnimatedModule::Initialize(winrt::Microsoft::ReactNative::ReactContext const &reactContext) noexcept {
|
|
14
14
|
m_context = reactContext;
|
|
15
|
+
m_nodesManager = std::make_shared<NativeAnimatedNodeManager>(reactContext);
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
void NativeAnimatedModule::startOperationBatch() noexcept {
|
|
@@ -142,7 +142,7 @@ struct NativeAnimatedModule : std::enable_shared_from_this<NativeAnimatedModule>
|
|
|
142
142
|
void queueAndExecuteBatchedOperations(::React::JSValueArray &&operationsAndArgs) noexcept;
|
|
143
143
|
|
|
144
144
|
private:
|
|
145
|
-
std::shared_ptr<NativeAnimatedNodeManager> m_nodesManager
|
|
145
|
+
std::shared_ptr<NativeAnimatedNodeManager> m_nodesManager;
|
|
146
146
|
winrt::Microsoft::ReactNative::ReactContext m_context;
|
|
147
147
|
};
|
|
148
148
|
} // namespace Microsoft::ReactNative
|
|
@@ -27,7 +27,35 @@
|
|
|
27
27
|
#include <Windows.Foundation.h>
|
|
28
28
|
#include <queue>
|
|
29
29
|
|
|
30
|
+
#ifdef USE_FABRIC
|
|
31
|
+
#include <Fabric/Composition/CompositionContextHelper.h>
|
|
32
|
+
#include <Fabric/Composition/CompositionUIService.h>
|
|
33
|
+
#endif
|
|
34
|
+
|
|
30
35
|
namespace Microsoft::ReactNative {
|
|
36
|
+
|
|
37
|
+
NativeAnimatedNodeManager::NativeAnimatedNodeManager(winrt::Microsoft::ReactNative::ReactContext const &reactContext)
|
|
38
|
+
: m_context(reactContext) {}
|
|
39
|
+
|
|
40
|
+
const winrt::Microsoft::ReactNative::ReactContext &NativeAnimatedNodeManager::ReactContext() const noexcept {
|
|
41
|
+
return m_context;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
comp::Compositor NativeAnimatedNodeManager::Compositor() const noexcept {
|
|
45
|
+
#ifdef USE_FABRIC
|
|
46
|
+
auto compositionContext =
|
|
47
|
+
winrt::Microsoft::ReactNative::Composition::implementation::CompositionUIService::GetCompositionContext(
|
|
48
|
+
m_context.Properties().Handle());
|
|
49
|
+
if (compositionContext) {
|
|
50
|
+
return winrt::Microsoft::ReactNative::Composition::implementation::CompositionContextHelper::InnerCompositor(
|
|
51
|
+
compositionContext);
|
|
52
|
+
}
|
|
53
|
+
#endif
|
|
54
|
+
// TODO: Islands - need to get the XamlView associated with this animation in order to
|
|
55
|
+
// use the compositor Microsoft::ReactNative::GetCompositor(xamlView)
|
|
56
|
+
return Microsoft::ReactNative::GetCompositor();
|
|
57
|
+
}
|
|
58
|
+
|
|
31
59
|
void NativeAnimatedNodeManager::CreateAnimatedNode(
|
|
32
60
|
int64_t tag,
|
|
33
61
|
const ::React::JSValueObject &config,
|
|
@@ -43,6 +43,9 @@ class AnimationDriver;
|
|
|
43
43
|
class EventAnimationDriver;
|
|
44
44
|
class NativeAnimatedNodeManager {
|
|
45
45
|
public:
|
|
46
|
+
NativeAnimatedNodeManager(winrt::Microsoft::ReactNative::ReactContext const &reactContext);
|
|
47
|
+
const winrt::Microsoft::ReactNative::ReactContext &ReactContext() const noexcept;
|
|
48
|
+
comp::Compositor Compositor() const noexcept;
|
|
46
49
|
void CreateAnimatedNode(
|
|
47
50
|
int64_t tag,
|
|
48
51
|
const winrt::Microsoft::ReactNative::JSValueObject &config,
|
|
@@ -127,6 +130,7 @@ class NativeAnimatedNodeManager {
|
|
|
127
130
|
std::unordered_map<int64_t, int64_t> m_deferredAnimationForValues{};
|
|
128
131
|
std::vector<std::tuple<int64_t, int64_t>> m_trackingAndLeadNodeTags{};
|
|
129
132
|
std::vector<int64_t> m_delayedPropsNodes{};
|
|
133
|
+
winrt::Microsoft::ReactNative::ReactContext m_context;
|
|
130
134
|
|
|
131
135
|
std::unordered_set<int64_t> m_updatedNodes{};
|
|
132
136
|
std::vector<int64_t> m_activeAnimationIds{};
|