react-native-windows 0.77.7 → 0.77.9
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/Libraries/Modal/Modal.windows.js +4 -1
- package/Microsoft.ReactNative/CompositionComponentView.idl +13 -1
- package/Microsoft.ReactNative/Fabric/AbiPortalShadowNode.cpp +97 -0
- package/Microsoft.ReactNative/Fabric/AbiPortalShadowNode.h +53 -0
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.h +160 -17
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +0 -1
- package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +0 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +0 -2
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +13 -32
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +1 -3
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.h +2 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +25 -20
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +313 -319
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +3 -61
- package/Microsoft.ReactNative/Fabric/Composition/PortalComponentView.cpp +78 -0
- package/Microsoft.ReactNative/Fabric/Composition/PortalComponentView.h +52 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +22 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +7 -5
- 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 +73 -19
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +16 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +2 -2
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +38 -23
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +1 -6
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +0 -3
- package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +0 -2
- package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +15 -1
- package/Microsoft.ReactNative/ReactNativeHost.cpp +5 -0
- package/Microsoft.ReactNative/ReactNativeIsland.idl +5 -1
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/Shared/Networking/WinRTWebSocketResource.cpp +82 -96
- package/Shared/Networking/WinRTWebSocketResource.h +91 -7
- package/Shared/Shared.vcxitems +6 -5
- package/Shared/Shared.vcxitems.filters +3 -4
- 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/just-task.js +1 -1
- package/package.json +3 -3
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +0 -191
- 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
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
#include "pch.h"
|
|
5
|
-
|
|
6
|
-
#include "AbiViewComponentDescriptor.h"
|
|
7
|
-
|
|
8
|
-
#include <Fabric/WindowsComponentDescriptorRegistry.h>
|
|
9
|
-
#include <ReactContext.h>
|
|
10
|
-
#include <react/renderer/components/view/ViewPropsInterpolation.h>
|
|
11
|
-
#include <type_traits>
|
|
12
|
-
#include "DynamicReader.h"
|
|
13
|
-
|
|
14
|
-
namespace Microsoft::ReactNative {
|
|
15
|
-
|
|
16
|
-
AbiViewComponentDescriptor::AbiViewComponentDescriptor(facebook::react::ComponentDescriptorParameters const ¶meters)
|
|
17
|
-
: ComponentDescriptor(parameters) {
|
|
18
|
-
auto flavor = std::static_pointer_cast<std::string const>(this->flavor_);
|
|
19
|
-
m_builder = WindowsComponentDescriptorRegistry::FromProperties(
|
|
20
|
-
parameters.contextContainer->at<winrt::Microsoft::ReactNative::ReactContext>("MSRN.ReactContext")
|
|
21
|
-
.Properties())
|
|
22
|
-
->GetDescriptor(flavor);
|
|
23
|
-
|
|
24
|
-
rawPropsParser_.prepare<ConcreteProps>();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
facebook::react::ComponentHandle AbiViewComponentDescriptor::getComponentHandle() const {
|
|
28
|
-
return reinterpret_cast<facebook::react::ComponentHandle>(getComponentName());
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
facebook::react::ComponentName AbiViewComponentDescriptor::getComponentName() const {
|
|
32
|
-
return std::static_pointer_cast<std::string const>(this->flavor_)->c_str();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
facebook::react::ShadowNodeTraits AbiViewComponentDescriptor::getTraits() const {
|
|
36
|
-
auto traits = ShadowNodeT::BaseTraits();
|
|
37
|
-
if (winrt::get_self<winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder>(m_builder)
|
|
38
|
-
->MeasureContentHandler()) {
|
|
39
|
-
traits.set(facebook::react::ShadowNodeTraits::LeafYogaNode);
|
|
40
|
-
traits.set(facebook::react::ShadowNodeTraits::MeasurableYogaNode);
|
|
41
|
-
}
|
|
42
|
-
return traits;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
std::shared_ptr<facebook::react::ShadowNode> AbiViewComponentDescriptor::createShadowNode(
|
|
46
|
-
const facebook::react::ShadowNodeFragment &fragment,
|
|
47
|
-
facebook::react::ShadowNodeFamily::Shared const &family) const {
|
|
48
|
-
auto shadowNode = std::make_shared<ShadowNodeT>(fragment, family, getTraits());
|
|
49
|
-
|
|
50
|
-
shadowNode->Proxy(winrt::make<winrt::Microsoft::ReactNative::implementation::YogaLayoutableShadowNode>(shadowNode));
|
|
51
|
-
winrt::get_self<winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder>(m_builder)
|
|
52
|
-
->CreateShadowNode(shadowNode->Proxy());
|
|
53
|
-
|
|
54
|
-
adopt(*shadowNode);
|
|
55
|
-
return shadowNode;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
facebook::react::ShadowNode::Unshared AbiViewComponentDescriptor::cloneShadowNode(
|
|
59
|
-
const facebook::react::ShadowNode &sourceShadowNode,
|
|
60
|
-
const facebook::react::ShadowNodeFragment &fragment) const {
|
|
61
|
-
auto shadowNode = std::make_shared<ShadowNodeT>(sourceShadowNode, fragment);
|
|
62
|
-
|
|
63
|
-
shadowNode->Proxy(winrt::make<winrt::Microsoft::ReactNative::implementation::YogaLayoutableShadowNode>(shadowNode));
|
|
64
|
-
winrt::get_self<winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder>(m_builder)
|
|
65
|
-
->CloneShadowNode(shadowNode->Proxy(), static_cast<const ShadowNodeT &>(sourceShadowNode).Proxy());
|
|
66
|
-
|
|
67
|
-
adopt(*shadowNode);
|
|
68
|
-
return shadowNode;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
void AbiViewComponentDescriptor::appendChild(
|
|
72
|
-
const facebook::react::ShadowNode::Shared &parentShadowNode,
|
|
73
|
-
const facebook::react::ShadowNode::Shared &childShadowNode) const {
|
|
74
|
-
auto concreteParentShadowNode = std::static_pointer_cast<const ShadowNodeT>(parentShadowNode);
|
|
75
|
-
auto concreteNonConstParentShadowNode = std::const_pointer_cast<ShadowNodeT>(concreteParentShadowNode);
|
|
76
|
-
concreteNonConstParentShadowNode->appendChild(childShadowNode);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
facebook::react::Props::Shared AbiViewComponentDescriptor::cloneProps(
|
|
80
|
-
const facebook::react::PropsParserContext &context,
|
|
81
|
-
const facebook::react::Props::Shared &props,
|
|
82
|
-
facebook::react::RawProps rawProps) const {
|
|
83
|
-
// Optimization:
|
|
84
|
-
// Quite often nodes are constructed with default/empty props: the base
|
|
85
|
-
// `props` object is `null` (there no base because it's not cloning) and the
|
|
86
|
-
// `rawProps` is empty. In this case, we can return the default props object
|
|
87
|
-
// of a concrete type entirely bypassing parsing.
|
|
88
|
-
if (!props && rawProps.isEmpty()) {
|
|
89
|
-
return ShadowNodeT::defaultSharedProps();
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if constexpr (facebook::react::RawPropsFilterable<ShadowNodeT>) {
|
|
93
|
-
ShadowNodeT::filterRawProps(rawProps);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
rawProps.parse(rawPropsParser_);
|
|
97
|
-
|
|
98
|
-
// Call old-style constructor
|
|
99
|
-
// auto shadowNodeProps = std::make_shared<ShadowNodeT::Props>(context, rawProps, props);
|
|
100
|
-
auto shadowNodeProps = std::make_shared<AbiViewProps>(
|
|
101
|
-
context, props ? static_cast<AbiViewProps const &>(*props) : *ShadowNodeT::defaultSharedProps(), rawProps);
|
|
102
|
-
auto viewProps =
|
|
103
|
-
winrt::make<winrt::Microsoft::ReactNative::implementation::ViewProps>(shadowNodeProps, false /*holdRef*/);
|
|
104
|
-
auto userProps =
|
|
105
|
-
winrt::get_self<winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder>(m_builder)
|
|
106
|
-
->CreateProps(viewProps, props ? static_cast<AbiViewProps const &>(*props).UserProps() : nullptr);
|
|
107
|
-
shadowNodeProps->SetUserProps(userProps, viewProps);
|
|
108
|
-
|
|
109
|
-
const auto &dynamic = static_cast<folly::dynamic>(rawProps);
|
|
110
|
-
for (const auto &pair : dynamic.items()) {
|
|
111
|
-
const auto &propName = pair.first.getString();
|
|
112
|
-
auto hash = RAW_PROPS_KEY_HASH(propName);
|
|
113
|
-
shadowNodeProps.get()->setProp(context, hash, propName.c_str(), facebook::react::RawValue(pair.second));
|
|
114
|
-
userProps.SetProp(
|
|
115
|
-
hash, winrt::to_hstring(propName), winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(pair.second));
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return shadowNodeProps;
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
AbiViewComponentDescriptor::ConcreteStateData AbiViewComponentDescriptor::initialStateData(
|
|
122
|
-
const facebook::react::Props::Shared &props,
|
|
123
|
-
const facebook::react::ShadowNodeFamily::Shared & /*family*/,
|
|
124
|
-
const facebook::react::ComponentDescriptor &componentDescriptor) noexcept {
|
|
125
|
-
return {winrt::get_self<winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder>(
|
|
126
|
-
static_cast<const AbiViewComponentDescriptor &>(componentDescriptor).m_builder)
|
|
127
|
-
->InitialStateData(std::static_pointer_cast<AbiViewProps const>(props)->UserProps())};
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
facebook::react::State::Shared AbiViewComponentDescriptor::createInitialState(
|
|
131
|
-
facebook::react::Props::Shared const &props,
|
|
132
|
-
facebook::react::ShadowNodeFamily::Shared const &family) const {
|
|
133
|
-
if (std::is_same<ConcreteStateData, facebook::react::StateData>::value) {
|
|
134
|
-
// Default case: Returning `null` for nodes that don't use `State`.
|
|
135
|
-
return nullptr;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return std::make_shared<ConcreteState>(
|
|
139
|
-
std::make_shared<ConcreteStateData const>(AbiViewComponentDescriptor::initialStateData(props, family, *this)),
|
|
140
|
-
family);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
facebook::react::State::Shared AbiViewComponentDescriptor::createState(
|
|
144
|
-
facebook::react::ShadowNodeFamily const &family,
|
|
145
|
-
facebook::react::StateData::Shared const &data) const {
|
|
146
|
-
if (std::is_same<ConcreteStateData, facebook::react::StateData>::value) {
|
|
147
|
-
// Default case: Returning `null` for nodes that don't use `State`.
|
|
148
|
-
return nullptr;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
react_native_assert(data && "Provided `data` is nullptr.");
|
|
152
|
-
|
|
153
|
-
return std::make_shared<ConcreteState const>(
|
|
154
|
-
std::static_pointer_cast<ConcreteStateData const>(data), *family.getMostRecentState());
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
facebook::react::ShadowNodeFamily::Shared AbiViewComponentDescriptor::createFamily(
|
|
158
|
-
facebook::react::ShadowNodeFamilyFragment const &fragment) const {
|
|
159
|
-
auto eventEmitter = std::make_shared<const ConcreteEventEmitter>(
|
|
160
|
-
std::make_shared<facebook::react::EventTarget>(fragment.instanceHandle, fragment.surfaceId), eventDispatcher_);
|
|
161
|
-
return std::make_shared<facebook::react::ShadowNodeFamily>(
|
|
162
|
-
fragment, std::move(eventEmitter), eventDispatcher_, *this);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/*
|
|
166
|
-
* Called immediately after `ShadowNode` is created or cloned.
|
|
167
|
-
*
|
|
168
|
-
* Override this method to pass information from custom `ComponentDescriptor`
|
|
169
|
-
* to new instance of `ShadowNode`.
|
|
170
|
-
*
|
|
171
|
-
* Example usages:
|
|
172
|
-
* - Inject image manager to `ImageShadowNode` in
|
|
173
|
-
* `ImageComponentDescriptor`.
|
|
174
|
-
* - Set `ShadowNode`'s size from state in
|
|
175
|
-
* `ModalHostViewComponentDescriptor`.
|
|
176
|
-
*/
|
|
177
|
-
void AbiViewComponentDescriptor::adopt(facebook::react::ShadowNode &shadowNode) const {
|
|
178
|
-
react_native_assert(shadowNode.getComponentHandle() == getComponentHandle());
|
|
179
|
-
|
|
180
|
-
auto &abiViewShadowNode = static_cast<AbiViewShadowNode &>(shadowNode);
|
|
181
|
-
|
|
182
|
-
abiViewShadowNode.Builder(m_builder);
|
|
183
|
-
|
|
184
|
-
if (winrt::get_self<winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder>(m_builder)
|
|
185
|
-
->MeasureContentHandler()) {
|
|
186
|
-
abiViewShadowNode.dirtyLayout();
|
|
187
|
-
abiViewShadowNode.enableMeasurement();
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
} // namespace Microsoft::ReactNative
|
package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentDescriptor.h
DELETED
|
@@ -1,39 +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
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include <glog/logging.h>
|
|
11
|
-
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
12
|
-
// [Windows
|
|
13
|
-
#include "WindowsModalHostViewShadowNode.h"
|
|
14
|
-
// ]
|
|
15
|
-
|
|
16
|
-
namespace facebook::react {
|
|
17
|
-
|
|
18
|
-
/*
|
|
19
|
-
* Descriptor for <WindowsModalHostView> component.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
class WindowsModalHostViewComponentDescriptor final
|
|
23
|
-
: public ConcreteComponentDescriptor<WindowsModalHostViewShadowNode> {
|
|
24
|
-
public:
|
|
25
|
-
using ConcreteComponentDescriptor::ConcreteComponentDescriptor;
|
|
26
|
-
|
|
27
|
-
void adopt(ShadowNode &shadowNode) const override {
|
|
28
|
-
auto &layoutableShadowNode = static_cast<YogaLayoutableShadowNode &>(shadowNode);
|
|
29
|
-
auto &stateData =
|
|
30
|
-
static_cast<const WindowsModalHostViewShadowNode::ConcreteState &>(*shadowNode.getState()).getData();
|
|
31
|
-
|
|
32
|
-
layoutableShadowNode.setSize(Size{stateData.screenSize.width, stateData.screenSize.height});
|
|
33
|
-
layoutableShadowNode.setPositionType(YGPositionTypeAbsolute);
|
|
34
|
-
|
|
35
|
-
ConcreteComponentDescriptor::adopt(shadowNode);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
} // namespace facebook::react
|
|
@@ -1,18 +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
|
-
// [Windows
|
|
9
|
-
#include "WindowsModalHostViewShadowNode.h"
|
|
10
|
-
// ]
|
|
11
|
-
|
|
12
|
-
#include <react/renderer/core/LayoutContext.h>
|
|
13
|
-
|
|
14
|
-
namespace facebook::react {
|
|
15
|
-
|
|
16
|
-
extern const char WindowsModalHostViewComponentName[] = "ModalHostView";
|
|
17
|
-
|
|
18
|
-
} // namespace facebook::react
|
|
@@ -1,39 +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
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include <react/renderer/components/modal/ModalHostViewState.h>
|
|
11
|
-
// [Windows
|
|
12
|
-
#include <react/components/rnwcore/EventEmitters.h>
|
|
13
|
-
#include <react/components/rnwcore/Props.h>
|
|
14
|
-
// ]
|
|
15
|
-
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
16
|
-
|
|
17
|
-
namespace facebook::react {
|
|
18
|
-
|
|
19
|
-
extern const char WindowsModalHostViewComponentName[];
|
|
20
|
-
|
|
21
|
-
/*
|
|
22
|
-
* `ShadowNode` for <WindowsModalHostView> component.
|
|
23
|
-
*/
|
|
24
|
-
class WindowsModalHostViewShadowNode final : public ConcreteViewShadowNode<
|
|
25
|
-
WindowsModalHostViewComponentName,
|
|
26
|
-
ModalHostViewProps,
|
|
27
|
-
ModalHostViewEventEmitter,
|
|
28
|
-
ModalHostViewState> {
|
|
29
|
-
public:
|
|
30
|
-
using ConcreteViewShadowNode::ConcreteViewShadowNode;
|
|
31
|
-
|
|
32
|
-
static ShadowNodeTraits BaseTraits() {
|
|
33
|
-
auto traits = ConcreteViewShadowNode::BaseTraits();
|
|
34
|
-
traits.set(ShadowNodeTraits::Trait::RootNodeKind);
|
|
35
|
-
return traits;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
} // namespace facebook::react
|