react-native-windows 0.77.0 → 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 +25 -26
- package/src/private/animated/NativeAnimatedValidation.js +1 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +33 -27
- 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
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
#pragma once
|
|
5
|
-
|
|
6
|
-
#include <nativeModules.h>
|
|
7
|
-
#include <react/config/ReactNativeConfig.h>
|
|
8
|
-
#include <string>
|
|
9
|
-
|
|
10
|
-
namespace Microsoft::ReactNative {
|
|
11
|
-
|
|
12
|
-
class ReactNativeConfigProperties final : public facebook::react::ReactNativeConfig {
|
|
13
|
-
public:
|
|
14
|
-
ReactNativeConfigProperties(winrt::Microsoft::ReactNative::ReactPropertyBag const &properties);
|
|
15
|
-
virtual ~ReactNativeConfigProperties();
|
|
16
|
-
|
|
17
|
-
virtual bool getBool(const std::string ¶m) const override;
|
|
18
|
-
virtual std::string getString(const std::string ¶m) const override;
|
|
19
|
-
virtual int64_t getInt64(const std::string ¶m) const override;
|
|
20
|
-
virtual double getDouble(const std::string ¶m) const override;
|
|
21
|
-
|
|
22
|
-
private:
|
|
23
|
-
winrt::Microsoft::ReactNative::ReactPropertyBag m_properties;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
} // namespace Microsoft::ReactNative
|
package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/LayoutableShadowNode.cpp
DELETED
|
@@ -1,363 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#include "LayoutableShadowNode.h"
|
|
9
|
-
|
|
10
|
-
#include <react/renderer/core/LayoutConstraints.h>
|
|
11
|
-
#include <react/renderer/core/LayoutContext.h>
|
|
12
|
-
#include <react/renderer/core/LayoutMetrics.h>
|
|
13
|
-
#include <react/renderer/core/ShadowNode.h>
|
|
14
|
-
#include <react/renderer/core/graphicsConversions.h>
|
|
15
|
-
#include <react/renderer/debug/DebugStringConvertibleItem.h>
|
|
16
|
-
|
|
17
|
-
namespace facebook::react {
|
|
18
|
-
|
|
19
|
-
template <class T>
|
|
20
|
-
using LayoutableSmallVector = std::vector<T>;
|
|
21
|
-
|
|
22
|
-
LayoutableShadowNode::LayoutableShadowNode(
|
|
23
|
-
const ShadowNodeFragment& fragment,
|
|
24
|
-
const ShadowNodeFamily::Shared& family,
|
|
25
|
-
ShadowNodeTraits traits)
|
|
26
|
-
: ShadowNode(fragment, family, traits), layoutMetrics_({}) {}
|
|
27
|
-
|
|
28
|
-
LayoutableShadowNode::LayoutableShadowNode(
|
|
29
|
-
const ShadowNode& sourceShadowNode,
|
|
30
|
-
const ShadowNodeFragment& fragment)
|
|
31
|
-
: ShadowNode(sourceShadowNode, fragment),
|
|
32
|
-
layoutMetrics_(static_cast<const LayoutableShadowNode&>(sourceShadowNode)
|
|
33
|
-
.layoutMetrics_) {}
|
|
34
|
-
|
|
35
|
-
LayoutMetrics LayoutableShadowNode::computeRelativeLayoutMetrics(
|
|
36
|
-
const ShadowNodeFamily& descendantNodeFamily,
|
|
37
|
-
const LayoutableShadowNode& ancestorNode,
|
|
38
|
-
LayoutInspectingPolicy policy) {
|
|
39
|
-
// Prelude.
|
|
40
|
-
|
|
41
|
-
if (&descendantNodeFamily == &ancestorNode.getFamily()) {
|
|
42
|
-
// Layout metrics of a node computed relatively to the same node are equal
|
|
43
|
-
// to `transform`-ed layout metrics of the node with zero `origin`.
|
|
44
|
-
auto layoutMetrics = ancestorNode.getLayoutMetrics();
|
|
45
|
-
if (layoutMetrics.displayType == DisplayType::None) {
|
|
46
|
-
return EmptyLayoutMetrics;
|
|
47
|
-
}
|
|
48
|
-
if (policy.includeTransform) {
|
|
49
|
-
layoutMetrics.frame = layoutMetrics.frame * ancestorNode.getTransform();
|
|
50
|
-
}
|
|
51
|
-
layoutMetrics.frame.origin = {0, 0};
|
|
52
|
-
return layoutMetrics;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
auto ancestors = descendantNodeFamily.getAncestors(ancestorNode);
|
|
56
|
-
return computeRelativeLayoutMetrics(ancestors, policy);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
LayoutMetrics LayoutableShadowNode::computeRelativeLayoutMetrics(
|
|
60
|
-
const AncestorList& ancestors,
|
|
61
|
-
LayoutInspectingPolicy policy) {
|
|
62
|
-
if (ancestors.empty()) {
|
|
63
|
-
// Specified nodes do not form an ancestor-descender relationship
|
|
64
|
-
// in the same tree. Aborting.
|
|
65
|
-
return EmptyLayoutMetrics;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// ------------------------------
|
|
69
|
-
|
|
70
|
-
// Step 1.
|
|
71
|
-
// Creating a list of nodes that form a chain from the descender node to
|
|
72
|
-
// ancestor node inclusively.
|
|
73
|
-
auto shadowNodeList = LayoutableSmallVector<const ShadowNode*>{};
|
|
74
|
-
|
|
75
|
-
// Finding the measured node.
|
|
76
|
-
// The last element in the `AncestorList` is a pair of a parent of the node
|
|
77
|
-
// and an index of this node in the parent's children list.
|
|
78
|
-
auto& pair = ancestors.at(ancestors.size() - 1);
|
|
79
|
-
auto descendantNode = pair.first.get().getChildren().at(pair.second).get();
|
|
80
|
-
|
|
81
|
-
// Putting the node inside the list.
|
|
82
|
-
// Even if this is a node with a `RootNodeKind` trait, we don't treat it as
|
|
83
|
-
// root because we measure it from an outside tree perspective.
|
|
84
|
-
shadowNodeList.push_back(descendantNode);
|
|
85
|
-
|
|
86
|
-
for (auto it = ancestors.rbegin(); it != ancestors.rend(); it++) {
|
|
87
|
-
auto& shadowNode = it->first.get();
|
|
88
|
-
|
|
89
|
-
shadowNodeList.push_back(&shadowNode);
|
|
90
|
-
|
|
91
|
-
if (shadowNode.getTraits().check(ShadowNodeTraits::Trait::RootNodeKind)) {
|
|
92
|
-
// If this is a node with a `RootNodeKind` trait, we need to stop right
|
|
93
|
-
// there.
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// ------------------------------
|
|
99
|
-
|
|
100
|
-
// Step 2.
|
|
101
|
-
// Computing the initial size of the measured node.
|
|
102
|
-
auto descendantLayoutableNode =
|
|
103
|
-
dynamic_cast<const LayoutableShadowNode*>(descendantNode);
|
|
104
|
-
|
|
105
|
-
if (descendantLayoutableNode == nullptr) {
|
|
106
|
-
return EmptyLayoutMetrics;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
auto layoutMetrics = descendantLayoutableNode->getLayoutMetrics();
|
|
110
|
-
auto& resultFrame = layoutMetrics.frame;
|
|
111
|
-
resultFrame.origin = {0, 0};
|
|
112
|
-
|
|
113
|
-
// Step 3.
|
|
114
|
-
// Iterating on a list of nodes computing compound offset and size.
|
|
115
|
-
auto size = shadowNodeList.size();
|
|
116
|
-
for (size_t i = 0; i < size; i++) {
|
|
117
|
-
auto currentShadowNode =
|
|
118
|
-
dynamic_cast<const LayoutableShadowNode*>(shadowNodeList.at(i));
|
|
119
|
-
|
|
120
|
-
if (currentShadowNode == nullptr) {
|
|
121
|
-
return EmptyLayoutMetrics;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// Descendants of display: none don't have relative layout metrics.
|
|
125
|
-
if (currentShadowNode->getLayoutMetrics().displayType ==
|
|
126
|
-
DisplayType::None) {
|
|
127
|
-
return EmptyLayoutMetrics;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
auto currentFrame = currentShadowNode->getLayoutMetrics().frame;
|
|
131
|
-
if (i == size - 1) {
|
|
132
|
-
// If it's the last element, its origin is irrelevant.
|
|
133
|
-
currentFrame.origin = {0, 0};
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
auto isRootNode = currentShadowNode->getTraits().check(
|
|
137
|
-
ShadowNodeTraits::Trait::RootNodeKind);
|
|
138
|
-
|
|
139
|
-
auto shouldApplyTransformation = (policy.includeTransform && !isRootNode) ||
|
|
140
|
-
(policy.includeViewportOffset && isRootNode);
|
|
141
|
-
|
|
142
|
-
// Move frame to the coordinate space of the current node.
|
|
143
|
-
resultFrame.origin += currentFrame.origin;
|
|
144
|
-
|
|
145
|
-
if (shouldApplyTransformation) {
|
|
146
|
-
// If a node has a transform, we need to use the center of that node as
|
|
147
|
-
// the origin of the transform when transforming its children (which
|
|
148
|
-
// affects the result of transforms like `scale` and `rotate`).
|
|
149
|
-
resultFrame = currentShadowNode->getTransform().applyWithCenter(
|
|
150
|
-
resultFrame, currentFrame.getCenter());
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (i != 0 && policy.includeTransform) {
|
|
154
|
-
// Transformation is not applied here and instead we delegated out in
|
|
155
|
-
// getContentOriginOffset. The reason is that for `ScrollViewShadowNode`,
|
|
156
|
-
// we need to consider `scrollAwayPaddingTop` which should NOT be included
|
|
157
|
-
// in the transform.
|
|
158
|
-
resultFrame.origin += currentShadowNode->getContentOriginOffset(true);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (policy.enableOverflowClipping) {
|
|
162
|
-
auto overflowInset = currentShadowNode->getLayoutMetrics().overflowInset;
|
|
163
|
-
auto overflowRect = insetBy(
|
|
164
|
-
currentFrame * currentShadowNode->getTransform(), overflowInset);
|
|
165
|
-
resultFrame = Rect::intersect(resultFrame, overflowRect);
|
|
166
|
-
if (resultFrame.size.width == 0 && resultFrame.size.height == 0) {
|
|
167
|
-
return EmptyLayoutMetrics;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// ------------------------------
|
|
173
|
-
|
|
174
|
-
return layoutMetrics;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
LayoutMetrics LayoutableShadowNode::getLayoutMetrics() const {
|
|
178
|
-
return layoutMetrics_;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
void LayoutableShadowNode::setLayoutMetrics(LayoutMetrics layoutMetrics) {
|
|
182
|
-
ensureUnsealed();
|
|
183
|
-
|
|
184
|
-
if (layoutMetrics_ == layoutMetrics) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
layoutMetrics_ = layoutMetrics;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
Transform LayoutableShadowNode::getTransform() const {
|
|
192
|
-
return Transform::Identity();
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
Point LayoutableShadowNode::getContentOriginOffset(
|
|
196
|
-
bool /*includeTransform*/) const {
|
|
197
|
-
return {0, 0};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
bool LayoutableShadowNode::canBeTouchTarget() const {
|
|
201
|
-
return false;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
bool LayoutableShadowNode::canChildrenBeTouchTarget() const {
|
|
205
|
-
return true;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
LayoutableShadowNode::UnsharedList
|
|
209
|
-
LayoutableShadowNode::getLayoutableChildNodes() const {
|
|
210
|
-
LayoutableShadowNode::UnsharedList layoutableChildren;
|
|
211
|
-
for (const auto& childShadowNode : getChildren()) {
|
|
212
|
-
auto layoutableChildShadowNode =
|
|
213
|
-
dynamic_cast<const LayoutableShadowNode*>(childShadowNode.get());
|
|
214
|
-
if (layoutableChildShadowNode != nullptr) {
|
|
215
|
-
layoutableChildren.push_back(
|
|
216
|
-
const_cast<LayoutableShadowNode*>(layoutableChildShadowNode));
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
return layoutableChildren;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
Size LayoutableShadowNode::measureContent(
|
|
223
|
-
const LayoutContext& /*layoutContext*/,
|
|
224
|
-
const LayoutConstraints& /*layoutConstraints*/) const {
|
|
225
|
-
return {};
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
Size LayoutableShadowNode::measure(
|
|
229
|
-
const LayoutContext& layoutContext,
|
|
230
|
-
const LayoutConstraints& layoutConstraints) const {
|
|
231
|
-
auto clonedShadowNode = clone({});
|
|
232
|
-
auto& layoutableShadowNode =
|
|
233
|
-
static_cast<LayoutableShadowNode&>(*clonedShadowNode);
|
|
234
|
-
|
|
235
|
-
auto localLayoutContext = layoutContext;
|
|
236
|
-
localLayoutContext.affectedNodes = nullptr;
|
|
237
|
-
|
|
238
|
-
layoutableShadowNode.layoutTree(localLayoutContext, layoutConstraints);
|
|
239
|
-
|
|
240
|
-
return layoutableShadowNode.getLayoutMetrics().frame.size;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
Float LayoutableShadowNode::baseline(
|
|
244
|
-
const LayoutContext& /*layoutContext*/,
|
|
245
|
-
Size /*size*/) const {
|
|
246
|
-
return 0;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
ShadowNode::Shared LayoutableShadowNode::findNodeAtPoint(
|
|
250
|
-
const ShadowNode::Shared& node,
|
|
251
|
-
Point point) {
|
|
252
|
-
auto layoutableShadowNode =
|
|
253
|
-
dynamic_cast<const LayoutableShadowNode*>(node.get());
|
|
254
|
-
|
|
255
|
-
if (layoutableShadowNode == nullptr) {
|
|
256
|
-
return nullptr;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
if (!layoutableShadowNode->canBeTouchTarget() &&
|
|
260
|
-
!layoutableShadowNode->canChildrenBeTouchTarget()) {
|
|
261
|
-
return nullptr;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
auto transform = layoutableShadowNode->getTransform();
|
|
265
|
-
auto frame = layoutableShadowNode->getLayoutMetrics().frame;
|
|
266
|
-
auto transformedFrame = frame * transform;
|
|
267
|
-
auto isPointInside = transformedFrame.containsPoint(point);
|
|
268
|
-
|
|
269
|
-
if (!isPointInside) {
|
|
270
|
-
return nullptr;
|
|
271
|
-
} else if (!layoutableShadowNode->canChildrenBeTouchTarget()) {
|
|
272
|
-
return node;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
if (Transform::isVerticalInversion(transform) ||
|
|
276
|
-
Transform::isHorizontalInversion(transform)) {
|
|
277
|
-
auto centerX =
|
|
278
|
-
transformedFrame.origin.x + transformedFrame.size.width / 2.0;
|
|
279
|
-
auto centerY =
|
|
280
|
-
transformedFrame.origin.y + transformedFrame.size.height / 2.0;
|
|
281
|
-
|
|
282
|
-
// [Windows - #13644
|
|
283
|
-
auto relativeX = point.x - centerX;
|
|
284
|
-
auto relativeY = point.y - centerY;
|
|
285
|
-
// Windows]
|
|
286
|
-
|
|
287
|
-
if (Transform::isVerticalInversion(transform)) {
|
|
288
|
-
relativeY = -relativeY;
|
|
289
|
-
}
|
|
290
|
-
if (Transform::isHorizontalInversion(transform)) {
|
|
291
|
-
relativeX = -relativeX;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
// [Windows - #13644
|
|
295
|
-
point.x = float(centerX + relativeX);
|
|
296
|
-
point.y = float(centerY + relativeY);
|
|
297
|
-
// Windows]
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
auto newPoint = point - transformedFrame.origin -
|
|
301
|
-
layoutableShadowNode->getContentOriginOffset(false);
|
|
302
|
-
|
|
303
|
-
auto sortedChildren = node->getChildren();
|
|
304
|
-
std::stable_sort(
|
|
305
|
-
sortedChildren.begin(),
|
|
306
|
-
sortedChildren.end(),
|
|
307
|
-
[](const auto& lhs, const auto& rhs) -> bool {
|
|
308
|
-
return lhs->getOrderIndex() < rhs->getOrderIndex();
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
for (auto it = sortedChildren.rbegin(); it != sortedChildren.rend(); it++) {
|
|
312
|
-
const auto& childShadowNode = *it;
|
|
313
|
-
auto hitView = findNodeAtPoint(childShadowNode, newPoint);
|
|
314
|
-
if (hitView) {
|
|
315
|
-
return hitView;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return layoutableShadowNode->canBeTouchTarget() ? node : nullptr;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
#if RN_DEBUG_STRING_CONVERTIBLE
|
|
322
|
-
SharedDebugStringConvertibleList LayoutableShadowNode::getDebugProps() const {
|
|
323
|
-
auto list = ShadowNode::getDebugProps();
|
|
324
|
-
|
|
325
|
-
auto layoutInfo = SharedDebugStringConvertibleList{};
|
|
326
|
-
|
|
327
|
-
if (!getIsLayoutClean()) {
|
|
328
|
-
layoutInfo.push_back(std::make_shared<DebugStringConvertibleItem>("dirty"));
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
auto layoutMetrics = getLayoutMetrics();
|
|
332
|
-
auto defaultLayoutMetrics = LayoutMetrics();
|
|
333
|
-
|
|
334
|
-
layoutInfo.push_back(std::make_shared<DebugStringConvertibleItem>(
|
|
335
|
-
"frame", toString(layoutMetrics.frame)));
|
|
336
|
-
|
|
337
|
-
if (layoutMetrics.borderWidth != defaultLayoutMetrics.borderWidth) {
|
|
338
|
-
layoutInfo.push_back(std::make_shared<DebugStringConvertibleItem>(
|
|
339
|
-
"borderWidth", toString(layoutMetrics.borderWidth)));
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
if (layoutMetrics.contentInsets != defaultLayoutMetrics.contentInsets) {
|
|
343
|
-
layoutInfo.push_back(std::make_shared<DebugStringConvertibleItem>(
|
|
344
|
-
"contentInsets", toString(layoutMetrics.contentInsets)));
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
if (layoutMetrics.displayType == DisplayType::None) {
|
|
348
|
-
layoutInfo.push_back(
|
|
349
|
-
std::make_shared<DebugStringConvertibleItem>("hidden"));
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
if (layoutMetrics.layoutDirection == LayoutDirection::RightToLeft) {
|
|
353
|
-
layoutInfo.push_back(std::make_shared<DebugStringConvertibleItem>("rtl"));
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
list.push_back(
|
|
357
|
-
std::make_shared<DebugStringConvertibleItem>("layout", "", layoutInfo));
|
|
358
|
-
|
|
359
|
-
return list;
|
|
360
|
-
}
|
|
361
|
-
#endif
|
|
362
|
-
|
|
363
|
-
} // namespace facebook::react
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/*
|
|
3
|
-
* This file is auto-generated from a NativeModule spec file in js.
|
|
4
|
-
*
|
|
5
|
-
* This is a C++ Spec class that should be used with MakeTurboModuleProvider to register native modules
|
|
6
|
-
* in a way that also verifies at compile time that the native module matches the interface required
|
|
7
|
-
* by the TurboModule JS spec.
|
|
8
|
-
*/
|
|
9
|
-
#pragma once
|
|
10
|
-
// clang-format off
|
|
11
|
-
|
|
12
|
-
#include <NativeModules.h>
|
|
13
|
-
#include <tuple>
|
|
14
|
-
|
|
15
|
-
namespace Microsoft::ReactNativeSpecs {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
struct JSCSamplingProfilerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec {
|
|
19
|
-
static constexpr auto methods = std::tuple{
|
|
20
|
-
Method<void(double, std::optional<std::string>, std::optional<std::string>) noexcept>{0, L"operationComplete"},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
template <class TModule>
|
|
24
|
-
static constexpr void ValidateModule() noexcept {
|
|
25
|
-
constexpr auto methodCheckResults = CheckMethods<TModule, JSCSamplingProfilerSpec>();
|
|
26
|
-
|
|
27
|
-
REACT_SHOW_METHOD_SPEC_ERRORS(
|
|
28
|
-
0,
|
|
29
|
-
"operationComplete",
|
|
30
|
-
" REACT_METHOD(operationComplete) void operationComplete(double token, std::optional<std::string> result, std::optional<std::string> error) noexcept { /* implementation */ }\n"
|
|
31
|
-
" REACT_METHOD(operationComplete) static void operationComplete(double token, std::optional<std::string> result, std::optional<std::string> error) noexcept { /* implementation */ }\n");
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
} // namespace Microsoft::ReactNativeSpecs
|