react-native-windows 0.77.0-preview.4 → 0.78.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 +1 -1
- package/Chakra/ChakraTracing.cpp +1 -1
- package/Libraries/Animated/animations/Animation.js +22 -1
- package/Libraries/Animated/animations/DecayAnimation.js +1 -0
- package/Libraries/Animated/animations/SpringAnimation.js +1 -0
- package/Libraries/Animated/animations/TimingAnimation.js +1 -0
- package/Libraries/Animated/nodes/AnimatedAddition.js +9 -2
- package/Libraries/Animated/nodes/AnimatedColor.js +4 -1
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +10 -2
- package/Libraries/Animated/nodes/AnimatedDivision.js +9 -2
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +5 -1
- package/Libraries/Animated/nodes/AnimatedModulo.js +5 -2
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +9 -2
- package/Libraries/Animated/nodes/AnimatedNode.js +25 -46
- package/Libraries/Animated/nodes/AnimatedObject.js +9 -2
- package/Libraries/Animated/nodes/AnimatedProps.js +5 -1
- package/Libraries/Animated/nodes/AnimatedStyle.js +5 -1
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +9 -2
- package/Libraries/Animated/nodes/AnimatedTracking.js +5 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +5 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +49 -4
- package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
- package/Libraries/Animated/useAnimatedProps.js +0 -43
- package/Libraries/Components/Button.windows.js +3 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +1 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +3 -1
- package/Libraries/Components/LayoutConformance/LayoutConformance.d.ts +21 -0
- package/Libraries/Components/LayoutConformance/LayoutConformance.js +59 -0
- package/Libraries/Components/LayoutConformance/LayoutConformanceNativeComponent.js +29 -0
- package/Libraries/Components/Pressable/Pressable.windows.js +3 -0
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/TextInput.d.ts +5 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +6 -0
- package/Libraries/Components/TextInput/TextInput.js +6 -0
- package/Libraries/Components/TextInput/TextInput.windows.js +9 -0
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +2 -0
- package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +2 -0
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +2 -0
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +2 -0
- package/Libraries/Components/View/View.windows.js +3 -0
- package/Libraries/Components/View/ViewAccessibility.d.ts +7 -2
- package/Libraries/Components/View/ViewAccessibility.windows.js +1 -0
- package/Libraries/Components/View/ViewPropTypes.d.ts +0 -7
- package/Libraries/Components/View/ViewPropTypes.js +0 -9
- package/Libraries/Components/View/ViewPropTypes.windows.js +1 -9
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/setUpBatchedBridge.js +1 -16
- package/Libraries/EventEmitter/RCTEventEmitter.js +2 -6
- package/Libraries/Image/AssetSourceResolver.js +11 -0
- package/Libraries/Image/AssetSourceResolver.windows.js +11 -0
- package/Libraries/Image/Image.windows.js +2 -0
- package/Libraries/Inspector/BorderBox.js +26 -14
- package/Libraries/Inspector/BoxInspector.js +60 -42
- package/Libraries/Inspector/ElementBox.js +55 -48
- package/Libraries/Inspector/StyleInspector.js +36 -30
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
- package/Libraries/Lists/FlatList.d.ts +1 -1
- package/Libraries/Modal/Modal.js +2 -0
- package/Libraries/Modal/Modal.windows.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.android.js +0 -2
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +0 -2
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +0 -2
- package/Libraries/Network/RCTNetworking.android.js +24 -16
- package/Libraries/Network/RCTNetworking.ios.js +1 -46
- package/Libraries/Network/RCTNetworking.windows.js +1 -46
- package/Libraries/Network/RCTNetworkingEventDefinitions.flow.js +57 -0
- package/Libraries/ReactNative/UIManagerProperties.js +3 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +15828 -26461
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +3907 -2560
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4399 -2878
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +16102 -26908
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +4034 -2695
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4535 -3045
- package/Libraries/Renderer/shims/ReactNativeTypes.js +5 -6
- package/Libraries/StyleSheet/processTransform.js +6 -0
- package/Libraries/Text/Text.d.ts +6 -1
- package/Libraries/Text/Text.windows.js +4 -0
- package/Libraries/Text/TextProps.js +2 -2
- package/Libraries/Text/TextProps.windows.js +3 -2
- package/Libraries/Utilities/BackHandler.android.js +5 -4
- package/Libraries/Utilities/BackHandler.ios.js +4 -5
- package/Libraries/Utilities/BackHandler.windows.js +5 -4
- package/Microsoft.ReactNative/CompositionComponentView.idl +13 -1
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +0 -1
- package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +0 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +92 -17
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +9 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +13 -33
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +1 -3
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +43 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.h +2 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +12 -10
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +11 -9
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +191 -329
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +3 -61
- package/Microsoft.ReactNative/Fabric/Composition/PortalComponentView.cpp +66 -0
- package/Microsoft.ReactNative/Fabric/Composition/PortalComponentView.h +52 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +21 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +7 -4
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +79 -19
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +12 -6
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +71 -17
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +16 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +5 -10
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +4 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +138 -110
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +27 -27
- package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +38 -33
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +0 -2
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +5 -16
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +0 -3
- package/Microsoft.ReactNative/Fabric/ImageManager.cpp +9 -0
- package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +0 -2
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.cpp +1 -1
- package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +5 -0
- package/Microsoft.ReactNative/IReactContext.cpp +2 -2
- package/Microsoft.ReactNative/IReactContext.h +1 -1
- package/Microsoft.ReactNative/IReactContext.idl +2 -2
- package/Microsoft.ReactNative/IReactPackageBuilder.idl +3 -3
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +97 -87
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +4 -0
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +9 -4
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedNodeManager.cpp +1 -1
- package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.cpp +32 -35
- package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.h +7 -4
- package/Microsoft.ReactNative/Modules/AppStateModule.cpp +1 -1
- package/Microsoft.ReactNative/Modules/AppThemeModuleUwp.cpp +2 -2
- package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +2 -2
- package/Microsoft.ReactNative/Modules/DeviceInfoModule.cpp +3 -3
- package/Microsoft.ReactNative/Modules/I18nManagerModule.cpp +1 -1
- package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +7 -5
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +2 -1
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +10 -10
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +24 -24
- package/Microsoft.ReactNative/Modules/Timing.cpp +2 -2
- package/Microsoft.ReactNative/ReactHost/IReactInstance.h +5 -0
- package/Microsoft.ReactNative/ReactHost/React.h +0 -3
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +39 -16
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +4 -2
- package/Microsoft.ReactNative/ReactNativeHost.cpp +9 -4
- package/Microsoft.ReactNative/ReactNativeIsland.idl +5 -1
- package/Microsoft.ReactNative/ReactPackageBuilder.cpp +3 -3
- package/Microsoft.ReactNative/ReactPackageBuilder.h +4 -4
- package/Microsoft.ReactNative/Utils/Helpers.cpp +0 -2
- package/Microsoft.ReactNative/Views/DevMenu.cpp +6 -6
- package/Microsoft.ReactNative/Views/DevMenu.h +1 -1
- package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +2 -2
- package/Microsoft.ReactNative/Views/ViewPanel.cpp +1 -1
- package/Microsoft.ReactNative/Views/ViewViewManager.cpp +2 -2
- package/Microsoft.ReactNative/XamlUIService.cpp +13 -7
- package/Microsoft.ReactNative/XamlUIService.h +4 -1
- package/Microsoft.ReactNative/XamlUIService.idl +2 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +6 -2
- package/Microsoft.ReactNative.Cxx/ReactContext.h +1 -1
- package/Microsoft.ReactNative.Cxx/XamlUtils.h +12 -0
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/React.Cpp.props +3 -0
- package/PropertySheets/WebView2.props +1 -1
- package/PropertySheets/WinUI.props +5 -4
- package/ReactCommon/ReactCommon.vcxproj +5 -1
- package/ReactCommon/ReactCommon.vcxproj.filters +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +3 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +3 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +91 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +1 -12
- package/{Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h → ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/textinput/TextInputState.h} +37 -35
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +1 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +4 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/ImageRequestParams.h +30 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/runtimescheduler/SchedulerPriorityUtils.h +4 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/primitives.h +179 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +43 -57
- package/Shared/HermesRuntimeHolder.cpp +2 -2
- package/Shared/Shared.vcxitems +8 -14
- package/Shared/Shared.vcxitems.filters +4 -16
- package/Shared/Threading/BatchingQueueThread.cpp +3 -3
- package/codegen/NativeCPUTimeSpec.g.h +41 -0
- package/codegen/NativeFantomSpec.g.h +78 -0
- package/codegen/NativePerformanceSpec.g.h +31 -43
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +84 -84
- package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +212 -0
- package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +295 -0
- package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +200 -0
- package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +224 -0
- package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +250 -0
- package/codegen/react/components/rnwcore/AndroidSwitch.g.h +267 -0
- package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +234 -0
- package/codegen/react/components/rnwcore/InputAccessory.g.h +200 -0
- package/codegen/react/components/rnwcore/ModalHostView.g.h +283 -0
- package/codegen/react/components/rnwcore/PullToRefreshView.g.h +246 -0
- package/codegen/react/components/rnwcore/SafeAreaView.g.h +197 -0
- package/codegen/react/components/rnwcore/Switch.g.h +263 -0
- package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +200 -0
- package/codegen/rnwcoreJSI-generated.cpp +90 -57
- package/codegen/rnwcoreJSI.h +241 -104
- package/index.js +5 -0
- package/index.windows.js +5 -0
- package/just-task.js +1 -1
- package/package.json +23 -24
- package/src/private/animated/NativeAnimatedValidation.js +1 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +32 -26
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -5
- package/src/private/renderer/errorhandling/ErrorHandlers.js +12 -55
- package/src/private/specs/modules/{NativeJSCSamplingProfiler.js → NativeCPUTime.js} +7 -2
- package/src/private/specs/modules/NativeFantom.js +37 -0
- package/src/private/utilities/ensureInstance.js +21 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +49 -6
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +17 -9
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +11 -11
- package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +1 -1
- package/src/private/webapis/intersectionobserver/IntersectionObserverManager.js +1 -1
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
- package/src/private/webapis/performance/Performance.js +0 -12
- package/src/private/webapis/performance/specs/NativePerformance.js +0 -11
- package/types/index.d.ts +1 -0
- package/Libraries/HeapCapture/HeapCapture.js +0 -29
- package/Libraries/HeapCapture/NativeJSCHeapCapture.js +0 -13
- package/Libraries/Performance/NativeJSCSamplingProfiler.js +0 -13
- package/Libraries/Performance/SamplingProfiler.js +0 -39
- package/Libraries/ReactNative/__mocks__/FabricUIManager.js +0 -334
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentDescriptor.h +0 -39
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewShadowNode.cpp +0 -18
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewShadowNode.h +0 -39
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +0 -34
- package/Microsoft.ReactNative/Fabric/ReactNativeConfigProperties.cpp +0 -53
- package/Microsoft.ReactNative/Fabric/ReactNativeConfigProperties.h +0 -26
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/LayoutableShadowNode.cpp +0 -363
- package/codegen/NativeJSCSamplingProfilerSpec.g.h +0 -35
- package/src/private/webapis/dom/nodes/specs/__mocks__/NativeDOMMock.js +0 -413
- package/src/private/webapis/intersectionobserver/specs/__mocks__/NativeIntersectionObserver.js +0 -181
- package/src/private/webapis/mutationobserver/specs/__mocks__/NativeMutationObserver.js +0 -327
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
#include "pch.h"
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
7
7
|
#include <Modules/NativeUIManager.h>
|
|
8
8
|
#include <Modules/PaperUIManagerModule.h>
|
|
9
|
+
#include <Views/ShadowNodeBase.h>
|
|
9
10
|
#endif
|
|
10
11
|
|
|
11
12
|
#include <Utils/Helpers.h>
|
|
12
|
-
#include <Views/ShadowNodeBase.h>
|
|
13
13
|
#include <Views/XamlFeatures.h>
|
|
14
14
|
#include "NativeAnimatedNodeManager.h"
|
|
15
15
|
#include "PropsAnimatedNode.h"
|
|
@@ -84,9 +84,11 @@ void PropsAnimatedNode::DisconnectFromView(int64_t viewTag) {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
if (m_centerPointAnimation) {
|
|
87
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
87
88
|
if (const auto target = GetUIElement()) {
|
|
88
89
|
target.StopAnimation(m_centerPointAnimation);
|
|
89
90
|
}
|
|
91
|
+
#endif
|
|
90
92
|
m_centerPointAnimation = nullptr;
|
|
91
93
|
}
|
|
92
94
|
m_needsCenterPointAnimation = false;
|
|
@@ -140,6 +142,7 @@ void PropsAnimatedNode::UpdateView() {
|
|
|
140
142
|
}
|
|
141
143
|
}
|
|
142
144
|
|
|
145
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
143
146
|
static void EnsureUIElementDirtyForRender(xaml::UIElement uiElement) {
|
|
144
147
|
auto compositeMode = uiElement.CompositeMode();
|
|
145
148
|
switch (compositeMode) {
|
|
@@ -153,16 +156,19 @@ static void EnsureUIElementDirtyForRender(xaml::UIElement uiElement) {
|
|
|
153
156
|
}
|
|
154
157
|
uiElement.CompositeMode(compositeMode);
|
|
155
158
|
}
|
|
159
|
+
#endif
|
|
156
160
|
|
|
157
161
|
void PropsAnimatedNode::StartAnimations() {
|
|
158
162
|
assert(m_useComposition);
|
|
159
163
|
if (m_expressionAnimations.size()) {
|
|
160
164
|
AnimationView view = GetAnimationView();
|
|
161
165
|
if (view) {
|
|
166
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
162
167
|
// Work around for https://github.com/microsoft/microsoft-ui-xaml/issues/2511
|
|
163
168
|
if (view.m_element) {
|
|
164
169
|
EnsureUIElementDirtyForRender(view.m_element);
|
|
165
170
|
}
|
|
171
|
+
#endif
|
|
166
172
|
for (const auto &anim : m_expressionAnimations) {
|
|
167
173
|
if (anim.second.Target() == L"Translation.X") {
|
|
168
174
|
m_subchannelPropertySet.StartAnimation(L"TranslationX", anim.second);
|
|
@@ -177,18 +183,20 @@ void PropsAnimatedNode::StartAnimations() {
|
|
|
177
183
|
m_subchannelPropertySet.StartAnimation(L"ScaleY", anim.second);
|
|
178
184
|
StartAnimation(view, m_scaleCombined);
|
|
179
185
|
} else if (anim.second.Target() == L"Rotation") {
|
|
186
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
180
187
|
if (view.m_element) {
|
|
181
188
|
view.m_element.RotationAxis(m_rotationAxis);
|
|
182
|
-
|
|
183
|
-
|
|
189
|
+
}
|
|
190
|
+
#else
|
|
191
|
+
if (view.m_componentView) {
|
|
184
192
|
auto visual =
|
|
185
193
|
winrt::Microsoft::ReactNative::Composition::Experimental::CompositionContextHelper::InnerVisual(
|
|
186
194
|
view.m_componentView
|
|
187
195
|
.as<winrt::Microsoft::ReactNative::Composition::implementation::ComponentView>()
|
|
188
196
|
->Visual());
|
|
189
197
|
visual.RotationAxis(m_rotationAxis);
|
|
190
|
-
#endif
|
|
191
198
|
}
|
|
199
|
+
#endif
|
|
192
200
|
StartAnimation(view, anim.second);
|
|
193
201
|
} else {
|
|
194
202
|
StartAnimation(view, anim.second);
|
|
@@ -322,20 +330,18 @@ void PropsAnimatedNode::MakeAnimation(int64_t valueNodeTag, FacadeType facadeTyp
|
|
|
322
330
|
}
|
|
323
331
|
}
|
|
324
332
|
|
|
333
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
325
334
|
Microsoft::ReactNative::ShadowNodeBase *PropsAnimatedNode::GetShadowNodeBase() {
|
|
326
|
-
#ifndef CORE_ABI
|
|
327
335
|
if (const auto uiManager = Microsoft::ReactNative::GetNativeUIManager(m_context).lock()) {
|
|
328
336
|
if (const auto nativeUIManagerHost = uiManager->getHost()) {
|
|
329
337
|
return static_cast<Microsoft::ReactNative::ShadowNodeBase *>(
|
|
330
338
|
nativeUIManagerHost->FindShadowNodeForTag(m_connectedViewTag));
|
|
331
339
|
}
|
|
332
340
|
}
|
|
333
|
-
#endif
|
|
334
341
|
return nullptr;
|
|
335
342
|
}
|
|
336
343
|
|
|
337
344
|
xaml::UIElement PropsAnimatedNode::GetUIElement() {
|
|
338
|
-
#ifndef CORE_ABI
|
|
339
345
|
if (IsRS5OrHigher()) {
|
|
340
346
|
if (const auto shadowNodeBase = GetShadowNodeBase()) {
|
|
341
347
|
if (const auto shadowNodeView = shadowNodeBase->GetView()) {
|
|
@@ -343,12 +349,12 @@ xaml::UIElement PropsAnimatedNode::GetUIElement() {
|
|
|
343
349
|
}
|
|
344
350
|
}
|
|
345
351
|
}
|
|
346
|
-
#endif
|
|
347
352
|
return nullptr;
|
|
348
353
|
}
|
|
354
|
+
#endif
|
|
349
355
|
|
|
350
356
|
void PropsAnimatedNode::CommitProps() {
|
|
351
|
-
#
|
|
357
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
352
358
|
if (const auto node = GetShadowNodeBase()) {
|
|
353
359
|
if (!node->m_zombie) {
|
|
354
360
|
node->updateProperties(m_props);
|
|
@@ -358,43 +364,35 @@ void PropsAnimatedNode::CommitProps() {
|
|
|
358
364
|
}
|
|
359
365
|
|
|
360
366
|
PropsAnimatedNode::AnimationView PropsAnimatedNode::GetAnimationView() {
|
|
361
|
-
#
|
|
362
|
-
if (auto fabricuiManager = FabricUIManager::FromProperties(m_context.Properties())) {
|
|
363
|
-
auto componentView = fabricuiManager->GetViewRegistry().findComponentViewWithTag(
|
|
364
|
-
static_cast<facebook::react::Tag>(m_connectedViewTag));
|
|
365
|
-
if (componentView) {
|
|
366
|
-
return {nullptr, componentView};
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
#endif // USE_FABRIC
|
|
370
|
-
#ifndef CORE_ABI
|
|
367
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
371
368
|
if (IsRS5OrHigher()) {
|
|
372
369
|
if (const auto shadowNodeBase = GetShadowNodeBase()) {
|
|
373
370
|
if (const auto shadowNodeView = shadowNodeBase->GetView()) {
|
|
374
|
-
#ifdef USE_FABRIC
|
|
375
|
-
return {shadowNodeView.as<xaml::UIElement>(), nullptr};
|
|
376
|
-
#else
|
|
377
371
|
return {shadowNodeView.as<xaml::UIElement>()};
|
|
378
|
-
#endif
|
|
379
372
|
}
|
|
380
373
|
}
|
|
381
374
|
}
|
|
382
|
-
#endif // CORE_ABI
|
|
383
|
-
|
|
384
|
-
#ifdef USE_FABRIC
|
|
385
|
-
return {nullptr, nullptr};
|
|
386
375
|
#else
|
|
387
|
-
|
|
376
|
+
if (auto fabricuiManager = FabricUIManager::FromProperties(m_context.Properties())) {
|
|
377
|
+
auto componentView = fabricuiManager->GetViewRegistry().findComponentViewWithTag(
|
|
378
|
+
static_cast<facebook::react::Tag>(m_connectedViewTag));
|
|
379
|
+
if (componentView) {
|
|
380
|
+
return {componentView};
|
|
381
|
+
}
|
|
382
|
+
}
|
|
388
383
|
#endif
|
|
384
|
+
return {nullptr};
|
|
389
385
|
}
|
|
390
386
|
|
|
391
387
|
void PropsAnimatedNode::StartAnimation(
|
|
392
388
|
const AnimationView &view,
|
|
393
389
|
const comp::CompositionAnimation &animation) noexcept {
|
|
390
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
394
391
|
if (view.m_element) {
|
|
395
392
|
view.m_element.StartAnimation(animation);
|
|
396
|
-
|
|
397
|
-
|
|
393
|
+
}
|
|
394
|
+
#else
|
|
395
|
+
if (view.m_componentView) {
|
|
398
396
|
auto baseComponentView =
|
|
399
397
|
view.m_componentView.as<winrt::Microsoft::ReactNative::Composition::implementation::ComponentView>();
|
|
400
398
|
auto visual = winrt::Microsoft::ReactNative::Composition::Experimental::CompositionContextHelper::InnerVisual(
|
|
@@ -414,17 +412,16 @@ void PropsAnimatedNode::StartAnimation(
|
|
|
414
412
|
}
|
|
415
413
|
visual.StartAnimation(targetProp, animation);
|
|
416
414
|
}
|
|
417
|
-
#endif
|
|
418
415
|
}
|
|
416
|
+
#endif
|
|
419
417
|
}
|
|
420
418
|
|
|
421
419
|
comp::CompositionPropertySet PropsAnimatedNode::EnsureCenterPointPropertySet(const AnimationView &view) noexcept {
|
|
422
|
-
#
|
|
420
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
423
421
|
if (view.m_element) {
|
|
424
422
|
return GetShadowNodeBase()->EnsureTransformPS();
|
|
425
423
|
}
|
|
426
|
-
#
|
|
427
|
-
#ifdef USE_FABRIC
|
|
424
|
+
#else
|
|
428
425
|
if (view.m_componentView) {
|
|
429
426
|
return view.m_componentView.as<winrt::Microsoft::ReactNative::Composition::implementation::ComponentView>()
|
|
430
427
|
->EnsureCenterPointPropertySet();
|
|
@@ -36,23 +36,26 @@ class PropsAnimatedNode final : public AnimatedNode {
|
|
|
36
36
|
|
|
37
37
|
private:
|
|
38
38
|
struct AnimationView {
|
|
39
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
39
40
|
xaml::UIElement m_element;
|
|
40
|
-
#
|
|
41
|
+
#else
|
|
41
42
|
winrt::Microsoft::ReactNative::ComponentView m_componentView;
|
|
42
43
|
#endif
|
|
43
44
|
operator bool() const noexcept {
|
|
44
|
-
#
|
|
45
|
-
return m_element || m_componentView;
|
|
46
|
-
#else
|
|
45
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
47
46
|
return m_element != nullptr;
|
|
47
|
+
#else
|
|
48
|
+
return m_componentView != nullptr;
|
|
48
49
|
#endif
|
|
49
50
|
}
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
void CommitProps();
|
|
53
54
|
void MakeAnimation(int64_t valueNodeTag, FacadeType facadeType);
|
|
55
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
54
56
|
Microsoft::ReactNative::ShadowNodeBase *GetShadowNodeBase();
|
|
55
57
|
xaml::UIElement GetUIElement();
|
|
58
|
+
#endif
|
|
56
59
|
AnimationView GetAnimationView();
|
|
57
60
|
void StartAnimation(const AnimationView &view, const comp::CompositionAnimation &animation) noexcept;
|
|
58
61
|
comp::CompositionPropertySet EnsureCenterPointPropertySet(const AnimationView &view) noexcept;
|
|
@@ -21,7 +21,7 @@ void AppState::Initialize(winrt::Microsoft::ReactNative::ReactContext const &rea
|
|
|
21
21
|
// We need to register for notifications from the XAML thread.
|
|
22
22
|
if (auto dispatcher = reactContext.UIDispatcher()) {
|
|
23
23
|
dispatcher.Post([this]() {
|
|
24
|
-
auto currentApp = xaml::
|
|
24
|
+
auto currentApp = xaml::TryGetCurrentUwpXamlApplication();
|
|
25
25
|
|
|
26
26
|
if (!IsWinUI3Island() && currentApp != nullptr) {
|
|
27
27
|
#ifndef USE_WINUI3
|
|
@@ -44,7 +44,7 @@ static const React::ReactPropertyId<React::ReactNonAbiValue<std::shared_ptr<AppT
|
|
|
44
44
|
AppThemeHolder::AppThemeHolder(const Mso::React::IReactContext &context) : m_context(&context) {
|
|
45
45
|
NotifyHighContrastChanged();
|
|
46
46
|
|
|
47
|
-
if (auto currentApp = xaml::
|
|
47
|
+
if (auto currentApp = xaml::TryGetCurrentUwpXamlApplication()) {
|
|
48
48
|
if (IsWinUI3Island()) {
|
|
49
49
|
m_wmSubscription = SubscribeToWindowMessage(
|
|
50
50
|
ReactNotificationService(m_context->Notifications()), WM_THEMECHANGED, [this](const auto &, const auto &) {
|
|
@@ -77,7 +77,7 @@ void AppThemeHolder::SetCallback(
|
|
|
77
77
|
|
|
78
78
|
void AppThemeHolder::NotifyHighContrastChanged() noexcept {
|
|
79
79
|
m_appThemeData.isHighContrast =
|
|
80
|
-
xaml::
|
|
80
|
+
xaml::TryGetCurrentUwpXamlApplication() ? m_accessibilitySettings.HighContrast() : IsInHighContrastWin32();
|
|
81
81
|
m_appThemeData.highContrastColors.ButtonFaceColor =
|
|
82
82
|
FormatRGB(m_uiSettings.UIElementColor(winrt::UIElementType::ButtonFace));
|
|
83
83
|
m_appThemeData.highContrastColors.ButtonTextColor =
|
|
@@ -50,7 +50,7 @@ ApplicationTheme CurrentThemeFromUISettings(const winrt::Windows::UI::ViewManage
|
|
|
50
50
|
|
|
51
51
|
ApplicationTheme Appearance::GetCurrentTheme() noexcept {
|
|
52
52
|
assert(m_context.UIDispatcher().HasThreadAccess()); // xaml::Application is only accessible on the UI thread
|
|
53
|
-
if (auto currentApp = xaml::
|
|
53
|
+
if (auto currentApp = xaml::TryGetCurrentUwpXamlApplication()) {
|
|
54
54
|
return currentApp.RequestedTheme();
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -74,7 +74,7 @@ void Appearance::RequeryTheme() noexcept {
|
|
|
74
74
|
|
|
75
75
|
void Appearance::InitOnUIThread(const Mso::React::IReactContext &context) noexcept {
|
|
76
76
|
xaml::ApplicationTheme theme = ApplicationTheme::Light;
|
|
77
|
-
if (auto currentApp = xaml::
|
|
77
|
+
if (auto currentApp = xaml::TryGetCurrentUwpXamlApplication()) {
|
|
78
78
|
theme = currentApp.RequestedTheme();
|
|
79
79
|
} else {
|
|
80
80
|
theme = CurrentThemeFromUISettings(winrt::Windows::UI::ViewManagement::UISettings());
|
|
@@ -36,7 +36,7 @@ DeviceInfoHolder::DeviceInfoHolder(const Mso::React::IReactContext &context) : m
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
void DeviceInfoHolder::InitDeviceInfoHolder(const Mso::React::IReactContext &context) noexcept {
|
|
39
|
-
if (xaml::
|
|
39
|
+
if (xaml::TryGetCurrentUwpXamlApplication() || IsFabricEnabled(context.Properties())) {
|
|
40
40
|
auto deviceInfoHolder = std::make_shared<DeviceInfoHolder>(context);
|
|
41
41
|
|
|
42
42
|
deviceInfoHolder->updateDeviceInfo();
|
|
@@ -51,7 +51,7 @@ void DeviceInfoHolder::InitDeviceInfoHolder(const Mso::React::IReactContext &con
|
|
|
51
51
|
}
|
|
52
52
|
#endif
|
|
53
53
|
|
|
54
|
-
if (xaml::
|
|
54
|
+
if (xaml::TryGetCurrentUwpXamlApplication()) {
|
|
55
55
|
if (auto window = xaml::Window::Current()) {
|
|
56
56
|
auto const &coreWindow = window.CoreWindow();
|
|
57
57
|
|
|
@@ -157,7 +157,7 @@ void DeviceInfoHolder::SetCallback(
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
void DeviceInfoHolder::updateDeviceInfo() noexcept {
|
|
160
|
-
if (xaml::
|
|
160
|
+
if (xaml::TryGetCurrentUwpXamlApplication() && xaml::Window::Current()) {
|
|
161
161
|
auto const window = xaml::Window::Current().CoreWindow();
|
|
162
162
|
|
|
163
163
|
m_windowWidth = window.Bounds().Width;
|
|
@@ -28,7 +28,7 @@ static const React::ReactPropertyId<bool> &ForceRTLPropertyId() noexcept {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
void I18nManager::InitI18nInfo(const winrt::Microsoft::ReactNative::ReactPropertyBag &propertyBag) noexcept {
|
|
31
|
-
if (xaml::
|
|
31
|
+
if (xaml::TryGetCurrentUwpXamlApplication() && !IsXamlIsland()) {
|
|
32
32
|
// TODO: Figure out packaged win32 app story for WinUI 3
|
|
33
33
|
auto layoutDirection = winrt::Windows::ApplicationModel::Resources::Core::ResourceContext()
|
|
34
34
|
.GetForCurrentView()
|
|
@@ -8,14 +8,15 @@
|
|
|
8
8
|
#include "ReactHost/ReactInstanceWin.h"
|
|
9
9
|
#include "ReactNativeHost.h"
|
|
10
10
|
#include "Utils/Helpers.h"
|
|
11
|
-
#include "XamlUtils.h"
|
|
12
11
|
|
|
13
12
|
#ifdef USE_FABRIC
|
|
14
13
|
#include <Fabric/Composition/CompositionContextHelper.h>
|
|
15
14
|
#include <Fabric/Composition/CompositionUIService.h>
|
|
16
15
|
#include <winrt/Windows.UI.Composition.h>
|
|
17
|
-
#
|
|
16
|
+
#else
|
|
18
17
|
#include <UI.Xaml.Controls.Primitives.h>
|
|
18
|
+
#include "XamlUtils.h"
|
|
19
|
+
#endif
|
|
19
20
|
|
|
20
21
|
namespace Microsoft::ReactNative {
|
|
21
22
|
|
|
@@ -121,7 +122,7 @@ void LogBox::ShowOnUIThread() noexcept {
|
|
|
121
122
|
auto host = React::implementation::ReactNativeHost::GetReactNativeHost(m_context.Properties());
|
|
122
123
|
if (!host)
|
|
123
124
|
return;
|
|
124
|
-
|
|
125
|
+
#ifndef USE_FABRIC
|
|
125
126
|
if (!IsFabricEnabled(m_context.Properties().Handle())) {
|
|
126
127
|
m_logBoxContent = React::ReactRootView();
|
|
127
128
|
m_logBoxContent.ComponentName(L"LogBox");
|
|
@@ -170,7 +171,7 @@ void LogBox::ShowOnUIThread() noexcept {
|
|
|
170
171
|
m_popup.Child(m_logBoxContent);
|
|
171
172
|
m_popup.IsOpen(true);
|
|
172
173
|
}
|
|
173
|
-
#
|
|
174
|
+
#else
|
|
174
175
|
else {
|
|
175
176
|
RegisterWndClass();
|
|
176
177
|
|
|
@@ -212,7 +213,7 @@ void LogBox::HideOnUIThread() noexcept {
|
|
|
212
213
|
if (m_hwnd) {
|
|
213
214
|
::ShowWindow(m_hwnd, SW_HIDE);
|
|
214
215
|
}
|
|
215
|
-
#
|
|
216
|
+
#else // USE_FABRIC
|
|
216
217
|
if (m_popup) {
|
|
217
218
|
m_popup.Closed(m_tokenClosed);
|
|
218
219
|
m_sizeChangedRevoker.revoke();
|
|
@@ -220,6 +221,7 @@ void LogBox::HideOnUIThread() noexcept {
|
|
|
220
221
|
m_popup = nullptr;
|
|
221
222
|
m_logBoxContent = nullptr;
|
|
222
223
|
}
|
|
224
|
+
#endif // USE_FABRIC
|
|
223
225
|
}
|
|
224
226
|
|
|
225
227
|
void LogBox::Initialize(React::ReactContext const &reactContext) noexcept {
|
|
@@ -32,9 +32,10 @@ struct LogBox : public std::enable_shared_from_this<LogBox> {
|
|
|
32
32
|
winrt::Microsoft::ReactNative::ReactContext m_context;
|
|
33
33
|
#ifdef USE_FABRIC
|
|
34
34
|
HWND m_hwnd{nullptr};
|
|
35
|
-
#
|
|
35
|
+
#else
|
|
36
36
|
xaml::Controls::Primitives::Popup m_popup{nullptr};
|
|
37
37
|
winrt::Microsoft::ReactNative::ReactRootView m_logBoxContent{nullptr};
|
|
38
|
+
#endif // USE_FABRIC
|
|
38
39
|
xaml::FrameworkElement::SizeChanged_revoker m_sizeChangedRevoker;
|
|
39
40
|
winrt::event_token m_tokenClosed;
|
|
40
41
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
#include <UI.Xaml.Input.h>
|
|
9
9
|
#include <UI.Xaml.Media.h>
|
|
10
10
|
#include <Views/ShadowNodeBase.h>
|
|
11
|
-
#include <cxxreact/
|
|
11
|
+
#include <cxxreact/TraceSection.h>
|
|
12
12
|
#include "Modules/I18nManagerModule.h"
|
|
13
13
|
#include "NativeUIManager.h"
|
|
14
14
|
|
|
@@ -215,7 +215,7 @@ int64_t NativeUIManager::AddMeasuredRootView(facebook::react::IReactRootView *ro
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
void NativeUIManager::AddRootView(ShadowNode &shadowNode, facebook::react::IReactRootView *pReactRootView) {
|
|
218
|
-
|
|
218
|
+
TraceSection s("NativeUIManager::AddRootView");
|
|
219
219
|
auto xamlRootView = static_cast<IXamlRootView *>(pReactRootView);
|
|
220
220
|
XamlView view = xamlRootView->GetXamlView();
|
|
221
221
|
const auto rootTag = shadowNode.m_tag;
|
|
@@ -243,14 +243,14 @@ void NativeUIManager::AddRootView(ShadowNode &shadowNode, facebook::react::IReac
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
void NativeUIManager::removeRootView(Microsoft::ReactNative::ShadowNode &shadow) {
|
|
246
|
-
|
|
246
|
+
TraceSection s("NativeUIManager::removeRootView");
|
|
247
247
|
m_tagsToXamlReactControl.erase(shadow.m_tag);
|
|
248
248
|
m_sizeChangedMap.erase(shadow.m_tag);
|
|
249
249
|
RemoveView(shadow, true);
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
void NativeUIManager::onBatchComplete() {
|
|
253
|
-
|
|
253
|
+
TraceSection s("NativeUIManager::onBatchComplete");
|
|
254
254
|
if (m_inBatch) {
|
|
255
255
|
DoLayout();
|
|
256
256
|
m_inBatch = false;
|
|
@@ -783,7 +783,7 @@ static void StyleYogaNode(
|
|
|
783
783
|
}
|
|
784
784
|
|
|
785
785
|
void NativeUIManager::CreateView(ShadowNode &shadowNode, React::JSValueObject &props) {
|
|
786
|
-
|
|
786
|
+
TraceSection s("NativeUIManager::CreateView");
|
|
787
787
|
ShadowNodeBase &node = static_cast<ShadowNodeBase &>(shadowNode);
|
|
788
788
|
auto *pViewManager = node.GetViewManager();
|
|
789
789
|
|
|
@@ -874,7 +874,7 @@ void NativeUIManager::ReplaceView(ShadowNode &shadowNode) {
|
|
|
874
874
|
}
|
|
875
875
|
|
|
876
876
|
void NativeUIManager::UpdateView(ShadowNode &shadowNode, winrt::Microsoft::ReactNative::JSValueObject &props) {
|
|
877
|
-
|
|
877
|
+
TraceSection s("NativeUIManager::UpdateView");
|
|
878
878
|
ShadowNodeBase &node = static_cast<ShadowNodeBase &>(shadowNode);
|
|
879
879
|
auto *pViewManager = node.GetViewManager();
|
|
880
880
|
|
|
@@ -885,10 +885,10 @@ void NativeUIManager::UpdateView(ShadowNode &shadowNode, winrt::Microsoft::React
|
|
|
885
885
|
}
|
|
886
886
|
|
|
887
887
|
void NativeUIManager::DoLayout() {
|
|
888
|
-
|
|
888
|
+
TraceSection s("NativeUIManager::DoLayout");
|
|
889
889
|
|
|
890
890
|
{
|
|
891
|
-
|
|
891
|
+
TraceSection s("NativeUIManager::DoLayout::UpdateLayout");
|
|
892
892
|
// Process vector of RN controls needing extra layout here.
|
|
893
893
|
const auto extraLayoutNodes = m_extraLayoutNodes;
|
|
894
894
|
for (const int64_t tag : extraLayoutNodes) {
|
|
@@ -914,7 +914,7 @@ void NativeUIManager::DoLayout() {
|
|
|
914
914
|
|
|
915
915
|
void NativeUIManager::ApplyLayout(int64_t tag, float width, float height) {
|
|
916
916
|
if (YGNodeRef rootNode = GetYogaNode(tag)) {
|
|
917
|
-
|
|
917
|
+
TraceSection s("NativeUIManager::DoLayout::YGNodeCalculateLayout");
|
|
918
918
|
// We must always run layout in LTR mode, which might seem unintuitive.
|
|
919
919
|
// We will flip the root of the tree into RTL by forcing the root XAML node's FlowDirection to RightToLeft
|
|
920
920
|
// which will inherit down the XAML tree, allowing all native controls to pick it up.
|
|
@@ -925,7 +925,7 @@ void NativeUIManager::ApplyLayout(int64_t tag, float width, float height) {
|
|
|
925
925
|
}
|
|
926
926
|
|
|
927
927
|
{
|
|
928
|
-
|
|
928
|
+
TraceSection s("NativeUIManager::DoLayout::SetLayoutProps");
|
|
929
929
|
SetLayoutPropsRecursive(tag);
|
|
930
930
|
}
|
|
931
931
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
#include <Modules/PaperUIManagerModule.h>
|
|
11
11
|
#include <Views/ViewManager.h>
|
|
12
12
|
#include <XamlUtils.h>
|
|
13
|
-
#include <cxxreact/
|
|
13
|
+
#include <cxxreact/TraceSection.h>
|
|
14
14
|
#include <glog/logging.h>
|
|
15
15
|
#include "ShadowNodeBase.h"
|
|
16
16
|
#include "Unicode.h"
|
|
@@ -580,7 +580,7 @@ void UIManager::createView(
|
|
|
580
580
|
viewName = std::move(viewName),
|
|
581
581
|
rootTag,
|
|
582
582
|
props = std::move(props)]() mutable {
|
|
583
|
-
|
|
583
|
+
TraceSection s("UIManager::createView");
|
|
584
584
|
if (auto module = m.lock()) {
|
|
585
585
|
module->createView(static_cast<int64_t>(reactTag), viewName, static_cast<int64_t>(rootTag), std::move(props));
|
|
586
586
|
}
|
|
@@ -592,7 +592,7 @@ void UIManager::updateView(double reactTag, std::string viewName, React::JSValue
|
|
|
592
592
|
reactTag,
|
|
593
593
|
viewName = std::move(viewName),
|
|
594
594
|
props = std::move(props)]() mutable {
|
|
595
|
-
|
|
595
|
+
TraceSection s("UIManager::updateView");
|
|
596
596
|
if (auto module = m.lock()) {
|
|
597
597
|
module->updateView(static_cast<int64_t>(reactTag), viewName, std::move(props));
|
|
598
598
|
}
|
|
@@ -601,7 +601,7 @@ void UIManager::updateView(double reactTag, std::string viewName, React::JSValue
|
|
|
601
601
|
|
|
602
602
|
void UIManager::focus(double reactTag) noexcept {
|
|
603
603
|
m_batchingUIMessageQueue->runOnQueue([m = std::weak_ptr<UIManagerModule>(m_module), reactTag]() {
|
|
604
|
-
|
|
604
|
+
TraceSection s("UIManager::focus");
|
|
605
605
|
if (auto module = m.lock()) {
|
|
606
606
|
module->focus(static_cast<int64_t>(reactTag));
|
|
607
607
|
}
|
|
@@ -610,7 +610,7 @@ void UIManager::focus(double reactTag) noexcept {
|
|
|
610
610
|
|
|
611
611
|
void UIManager::blur(double reactTag) noexcept {
|
|
612
612
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), reactTag]() {
|
|
613
|
-
|
|
613
|
+
TraceSection s("UIManager::blur");
|
|
614
614
|
if (auto module = m.lock()) {
|
|
615
615
|
module->blur(static_cast<int64_t>(reactTag));
|
|
616
616
|
}
|
|
@@ -626,7 +626,7 @@ void UIManager::findSubviewIn(
|
|
|
626
626
|
reactTag,
|
|
627
627
|
point = std::move(point),
|
|
628
628
|
callback = std::move(callback)]() mutable {
|
|
629
|
-
|
|
629
|
+
TraceSection s("UIManager::findSubviewIn");
|
|
630
630
|
if (auto module = m.lock()) {
|
|
631
631
|
module->findSubviewIn(static_cast<int64_t>(reactTag), std::move(point), std::move(callback));
|
|
632
632
|
}
|
|
@@ -641,7 +641,7 @@ void UIManager::dispatchViewManagerCommand(
|
|
|
641
641
|
reactTag,
|
|
642
642
|
commandID = std::move(commandID),
|
|
643
643
|
commandArgs = std::move(commandArgs)]() mutable {
|
|
644
|
-
|
|
644
|
+
TraceSection s("UIManager::dispatchViewManagerCommand");
|
|
645
645
|
if (auto module = m.lock()) {
|
|
646
646
|
module->dispatchViewManagerCommand(static_cast<int64_t>(reactTag), std::move(commandID), std::move(commandArgs));
|
|
647
647
|
}
|
|
@@ -654,7 +654,7 @@ void UIManager::measure(
|
|
|
654
654
|
&callback) noexcept {
|
|
655
655
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor(
|
|
656
656
|
[m = std::weak_ptr<UIManagerModule>(m_module), reactTag, callback = std::move(callback)]() mutable {
|
|
657
|
-
|
|
657
|
+
TraceSection s("UIManager::measure");
|
|
658
658
|
if (auto module = m.lock()) {
|
|
659
659
|
module->measure(static_cast<int64_t>(reactTag), std::move(callback));
|
|
660
660
|
}
|
|
@@ -666,7 +666,7 @@ void UIManager::measureInWindow(
|
|
|
666
666
|
std::function<void(double x, double y, double width, double height)> const &callback) noexcept {
|
|
667
667
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor(
|
|
668
668
|
[m = std::weak_ptr<UIManagerModule>(m_module), reactTag, callback = std::move(callback)]() mutable {
|
|
669
|
-
|
|
669
|
+
TraceSection s("UIManager::measureInWindow");
|
|
670
670
|
if (auto module = m.lock()) {
|
|
671
671
|
module->measureInWindow(static_cast<int64_t>(reactTag), std::move(callback));
|
|
672
672
|
}
|
|
@@ -681,7 +681,7 @@ void UIManager::viewIsDescendantOf(
|
|
|
681
681
|
reactTag,
|
|
682
682
|
ancestorReactTag,
|
|
683
683
|
callback = std::move(callback)]() mutable {
|
|
684
|
-
|
|
684
|
+
TraceSection s("UIManager::viewIsDescendantOf");
|
|
685
685
|
if (auto module = m.lock()) {
|
|
686
686
|
module->viewIsDescendantOf(
|
|
687
687
|
static_cast<int64_t>(reactTag), static_cast<int64_t>(ancestorReactTag), std::move(callback));
|
|
@@ -699,7 +699,7 @@ void UIManager::measureLayout(
|
|
|
699
699
|
ancestorReactTag,
|
|
700
700
|
errorCallback = std::move(errorCallback),
|
|
701
701
|
callback = std::move(callback)]() mutable {
|
|
702
|
-
|
|
702
|
+
TraceSection s("UIManager::measureLayout");
|
|
703
703
|
if (auto module = m.lock()) {
|
|
704
704
|
module->measureLayout(
|
|
705
705
|
static_cast<int64_t>(reactTag),
|
|
@@ -718,7 +718,7 @@ void UIManager::measureLayoutRelativeToParent(
|
|
|
718
718
|
reactTag,
|
|
719
719
|
errorCallback = std::move(errorCallback),
|
|
720
720
|
callback = std::move(callback)]() mutable {
|
|
721
|
-
|
|
721
|
+
TraceSection s("UIManager::measureLayoutRelativeToParent");
|
|
722
722
|
if (auto module = m.lock()) {
|
|
723
723
|
module->measureLayoutRelativeToParent(
|
|
724
724
|
static_cast<int64_t>(reactTag), std::move(errorCallback), std::move(callback));
|
|
@@ -729,7 +729,7 @@ void UIManager::measureLayoutRelativeToParent(
|
|
|
729
729
|
void UIManager::setJSResponder(double reactTag, bool blockNativeResponder) noexcept {
|
|
730
730
|
m_batchingUIMessageQueue->runOnQueue(
|
|
731
731
|
Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), reactTag, blockNativeResponder]() mutable {
|
|
732
|
-
|
|
732
|
+
TraceSection s("UIManager::setJSResponder");
|
|
733
733
|
if (auto module = m.lock()) {
|
|
734
734
|
module->setJSResponder(static_cast<int64_t>(reactTag), blockNativeResponder);
|
|
735
735
|
}
|
|
@@ -738,7 +738,7 @@ void UIManager::setJSResponder(double reactTag, bool blockNativeResponder) noexc
|
|
|
738
738
|
|
|
739
739
|
void UIManager::clearJSResponder() noexcept {
|
|
740
740
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module)]() mutable {
|
|
741
|
-
|
|
741
|
+
TraceSection s("UIManager::clearJSResponder");
|
|
742
742
|
if (auto module = m.lock()) {
|
|
743
743
|
module->clearJSResponder();
|
|
744
744
|
}
|
|
@@ -753,7 +753,7 @@ void UIManager::configureNextLayoutAnimation(
|
|
|
753
753
|
config = std::move(config),
|
|
754
754
|
callback = std::move(callback),
|
|
755
755
|
errorCallback = std::move(errorCallback)]() mutable {
|
|
756
|
-
|
|
756
|
+
TraceSection s("UIManager::configureNextLayoutAnimation");
|
|
757
757
|
if (auto module = m.lock()) {
|
|
758
758
|
module->configureNextLayoutAnimation(std::move(config), std::move(callback), std::move(errorCallback));
|
|
759
759
|
}
|
|
@@ -762,7 +762,7 @@ void UIManager::configureNextLayoutAnimation(
|
|
|
762
762
|
|
|
763
763
|
void UIManager::removeSubviewsFromContainerWithID(double containerID) noexcept {
|
|
764
764
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), containerID]() {
|
|
765
|
-
|
|
765
|
+
TraceSection s("UIManager::removeSubviewsFromContainerWithID");
|
|
766
766
|
if (auto module = m.lock()) {
|
|
767
767
|
module->removeSubviewsFromContainerWithID(static_cast<int64_t>(containerID));
|
|
768
768
|
}
|
|
@@ -772,7 +772,7 @@ void UIManager::removeSubviewsFromContainerWithID(double containerID) noexcept {
|
|
|
772
772
|
void UIManager::replaceExistingNonRootView(double reactTag, double newReactTag) noexcept {
|
|
773
773
|
m_batchingUIMessageQueue->runOnQueue(
|
|
774
774
|
Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), reactTag, newReactTag]() {
|
|
775
|
-
|
|
775
|
+
TraceSection s("UIManager::replaceExistingNonRootView");
|
|
776
776
|
if (auto module = m.lock()) {
|
|
777
777
|
module->replaceExistingNonRootView(static_cast<int64_t>(reactTag), static_cast<int64_t>(newReactTag));
|
|
778
778
|
}
|
|
@@ -781,7 +781,7 @@ void UIManager::replaceExistingNonRootView(double reactTag, double newReactTag)
|
|
|
781
781
|
|
|
782
782
|
void UIManager::removeRootView(double reactTag) noexcept {
|
|
783
783
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), reactTag]() {
|
|
784
|
-
|
|
784
|
+
TraceSection s("UIManager::removeRootView");
|
|
785
785
|
if (auto module = m.lock()) {
|
|
786
786
|
module->removeRootView(static_cast<int64_t>(reactTag));
|
|
787
787
|
}
|
|
@@ -791,7 +791,7 @@ void UIManager::removeRootView(double reactTag) noexcept {
|
|
|
791
791
|
void UIManager::setChildren(double containerTag, React::JSValueArray &&reactTags) noexcept {
|
|
792
792
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor(
|
|
793
793
|
[m = std::weak_ptr<UIManagerModule>(m_module), containerTag, reactTags = std::move(reactTags)]() mutable {
|
|
794
|
-
|
|
794
|
+
TraceSection s("UIManager::setChildren");
|
|
795
795
|
if (auto module = m.lock()) {
|
|
796
796
|
module->setChildren(static_cast<int64_t>(containerTag), std::move(reactTags));
|
|
797
797
|
}
|
|
@@ -812,7 +812,7 @@ void UIManager::manageChildren(
|
|
|
812
812
|
addChildReactTags = std::move(addChildReactTags),
|
|
813
813
|
addAtIndices = std::move(addAtIndices),
|
|
814
814
|
removeAtIndices = std::move(removeAtIndices)]() mutable {
|
|
815
|
-
|
|
815
|
+
TraceSection s("UIManager::manageChildren");
|
|
816
816
|
if (auto module = m.lock()) {
|
|
817
817
|
module->manageChildren(
|
|
818
818
|
static_cast<int64_t>(containerTag),
|
|
@@ -828,7 +828,7 @@ void UIManager::manageChildren(
|
|
|
828
828
|
void UIManager::setLayoutAnimationEnabledExperimental(bool enabled) noexcept {
|
|
829
829
|
m_batchingUIMessageQueue->runOnQueue(
|
|
830
830
|
Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), enabled]() mutable {
|
|
831
|
-
|
|
831
|
+
TraceSection s("UIManager::setLayoutAnimationEnabledExperimental");
|
|
832
832
|
if (auto module = m.lock()) {
|
|
833
833
|
module->setLayoutAnimationEnabledExperimental(enabled);
|
|
834
834
|
}
|
|
@@ -838,7 +838,7 @@ void UIManager::setLayoutAnimationEnabledExperimental(bool enabled) noexcept {
|
|
|
838
838
|
void UIManager::sendAccessibilityEvent(double reactTag, double eventType) noexcept {
|
|
839
839
|
m_batchingUIMessageQueue->runOnQueue(
|
|
840
840
|
Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module), reactTag, eventType]() mutable {
|
|
841
|
-
|
|
841
|
+
TraceSection s("UIManager::sendAccessibilityEvent");
|
|
842
842
|
if (auto module = m.lock()) {
|
|
843
843
|
module->sendAccessibilityEvent(static_cast<int64_t>(reactTag), eventType);
|
|
844
844
|
}
|
|
@@ -855,7 +855,7 @@ void UIManager::showPopupMenu(
|
|
|
855
855
|
items = std::move(items),
|
|
856
856
|
error = std::move(error),
|
|
857
857
|
success = std::move(success)]() mutable {
|
|
858
|
-
|
|
858
|
+
TraceSection s("UIManager::showPopupMenu");
|
|
859
859
|
if (auto module = m.lock()) {
|
|
860
860
|
module->showPopupMenu(static_cast<int64_t>(reactTag), std::move(items), std::move(error), std::move(success));
|
|
861
861
|
}
|
|
@@ -864,7 +864,7 @@ void UIManager::showPopupMenu(
|
|
|
864
864
|
|
|
865
865
|
void UIManager::dismissPopupMenu() noexcept {
|
|
866
866
|
m_batchingUIMessageQueue->runOnQueue(Mso::VoidFunctor([m = std::weak_ptr<UIManagerModule>(m_module)]() mutable {
|
|
867
|
-
|
|
867
|
+
TraceSection s("UIManager::dismissPopupMenu");
|
|
868
868
|
if (auto module = m.lock()) {
|
|
869
869
|
module->dismissPopupMenu();
|
|
870
870
|
}
|