react-native-windows 0.77.6 → 0.77.8

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.
Files changed (59) hide show
  1. package/Directory.Build.props +2 -2
  2. package/Folly/TEMP_UntilFollyUpdate/json.cpp +4 -0
  3. package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.cpp +23 -15
  4. package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.h +5 -5
  5. package/Folly/cgmanifest.json +1 -1
  6. package/Libraries/Modal/Modal.windows.js +4 -1
  7. package/Microsoft.ReactNative/CompositionComponentView.idl +13 -1
  8. package/Microsoft.ReactNative/Fabric/AbiPortalShadowNode.cpp +97 -0
  9. package/Microsoft.ReactNative/Fabric/AbiPortalShadowNode.h +53 -0
  10. package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.h +160 -17
  11. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +0 -1
  12. package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +0 -5
  13. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +0 -2
  14. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +13 -32
  15. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +1 -3
  16. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +1 -1
  17. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.h +2 -1
  18. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +25 -20
  19. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +313 -319
  20. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +3 -61
  21. package/Microsoft.ReactNative/Fabric/Composition/PortalComponentView.cpp +78 -0
  22. package/Microsoft.ReactNative/Fabric/Composition/PortalComponentView.h +52 -0
  23. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +22 -0
  24. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +7 -5
  25. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +79 -19
  26. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +12 -6
  27. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +73 -19
  28. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +16 -0
  29. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +2 -2
  30. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +38 -23
  31. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +1 -6
  32. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +0 -3
  33. package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +0 -2
  34. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +15 -1
  35. package/Microsoft.ReactNative/ReactNativeHost.cpp +5 -0
  36. package/Microsoft.ReactNative/ReactNativeIsland.idl +5 -1
  37. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  38. package/Shared/Networking/WinRTWebSocketResource.cpp +5 -0
  39. package/Shared/Shared.vcxitems +6 -5
  40. package/Shared/Shared.vcxitems.filters +3 -4
  41. package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +212 -0
  42. package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +295 -0
  43. package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +200 -0
  44. package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +224 -0
  45. package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +250 -0
  46. package/codegen/react/components/rnwcore/AndroidSwitch.g.h +267 -0
  47. package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +234 -0
  48. package/codegen/react/components/rnwcore/InputAccessory.g.h +200 -0
  49. package/codegen/react/components/rnwcore/ModalHostView.g.h +283 -0
  50. package/codegen/react/components/rnwcore/PullToRefreshView.g.h +246 -0
  51. package/codegen/react/components/rnwcore/SafeAreaView.g.h +197 -0
  52. package/codegen/react/components/rnwcore/Switch.g.h +263 -0
  53. package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +200 -0
  54. package/just-task.js +1 -1
  55. package/package.json +6 -6
  56. package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +0 -191
  57. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentDescriptor.h +0 -39
  58. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewShadowNode.cpp +0 -18
  59. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewShadowNode.h +0 -39
@@ -0,0 +1,263 @@
1
+
2
+ /*
3
+ * This file is auto-generated from SwitchNativeComponent spec file in flow / TypeScript.
4
+ */
5
+ // clang-format off
6
+ #pragma once
7
+
8
+ #include <NativeModules.h>
9
+
10
+ #ifdef RNW_NEW_ARCH
11
+ #include <JSValueComposition.h>
12
+
13
+ #include <winrt/Microsoft.ReactNative.Composition.h>
14
+ #include <winrt/Microsoft.UI.Composition.h>
15
+ #endif // #ifdef RNW_NEW_ARCH
16
+
17
+ #ifdef RNW_NEW_ARCH
18
+
19
+ namespace Microsoft::ReactNativeSpecs {
20
+
21
+ REACT_STRUCT(SwitchProps)
22
+ struct SwitchProps : winrt::implements<SwitchProps, winrt::Microsoft::ReactNative::IComponentProps> {
23
+ SwitchProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom)
24
+ : ViewProps(props)
25
+ {
26
+ if (cloneFrom) {
27
+ auto cloneFromProps = cloneFrom.as<SwitchProps>();
28
+ disabled = cloneFromProps->disabled;
29
+ value = cloneFromProps->value;
30
+ tintColor = cloneFromProps->tintColor;
31
+ onTintColor = cloneFromProps->onTintColor;
32
+ thumbTintColor = cloneFromProps->thumbTintColor;
33
+ thumbColor = cloneFromProps->thumbColor;
34
+ trackColorForFalse = cloneFromProps->trackColorForFalse;
35
+ trackColorForTrue = cloneFromProps->trackColorForTrue;
36
+ }
37
+ }
38
+
39
+ void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept {
40
+ winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this);
41
+ }
42
+
43
+ REACT_FIELD(disabled)
44
+ std::optional<bool> disabled{};
45
+
46
+ REACT_FIELD(value)
47
+ std::optional<bool> value{};
48
+
49
+ REACT_FIELD(tintColor)
50
+ winrt::Microsoft::ReactNative::Color tintColor{nullptr};
51
+
52
+ REACT_FIELD(onTintColor)
53
+ winrt::Microsoft::ReactNative::Color onTintColor{nullptr};
54
+
55
+ REACT_FIELD(thumbTintColor)
56
+ winrt::Microsoft::ReactNative::Color thumbTintColor{nullptr};
57
+
58
+ REACT_FIELD(thumbColor)
59
+ winrt::Microsoft::ReactNative::Color thumbColor{nullptr};
60
+
61
+ REACT_FIELD(trackColorForFalse)
62
+ winrt::Microsoft::ReactNative::Color trackColorForFalse{nullptr};
63
+
64
+ REACT_FIELD(trackColorForTrue)
65
+ winrt::Microsoft::ReactNative::Color trackColorForTrue{nullptr};
66
+
67
+ const winrt::Microsoft::ReactNative::ViewProps ViewProps;
68
+ };
69
+
70
+ REACT_STRUCT(Switch_OnChange)
71
+ struct Switch_OnChange {
72
+ REACT_FIELD(value)
73
+ bool value{};
74
+
75
+ REACT_FIELD(target)
76
+ int32_t target{};
77
+ };
78
+
79
+ struct SwitchEventEmitter {
80
+ SwitchEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter)
81
+ : m_eventEmitter(eventEmitter) {}
82
+
83
+ using OnChange = Switch_OnChange;
84
+
85
+ void onChange(OnChange &value) const {
86
+ m_eventEmitter.DispatchEvent(L"change", [value](const winrt::Microsoft::ReactNative::IJSValueWriter writer) {
87
+ winrt::Microsoft::ReactNative::WriteValue(writer, value);
88
+ });
89
+ }
90
+
91
+ private:
92
+ winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr};
93
+ };
94
+
95
+ template<typename TUserData>
96
+ struct BaseSwitch {
97
+
98
+ virtual void UpdateProps(
99
+ const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
100
+ const winrt::com_ptr<SwitchProps> &newProps,
101
+ const winrt::com_ptr<SwitchProps> &/*oldProps*/) noexcept {
102
+ m_props = newProps;
103
+ }
104
+
105
+ // UpdateLayoutMetrics will only be called if this method is overridden
106
+ virtual void UpdateLayoutMetrics(
107
+ const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
108
+ const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/,
109
+ const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept {
110
+ }
111
+
112
+ // UpdateState will only be called if this method is overridden
113
+ virtual void UpdateState(
114
+ const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
115
+ const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept {
116
+ }
117
+
118
+ virtual void UpdateEventEmitter(const std::shared_ptr<SwitchEventEmitter> &eventEmitter) noexcept {
119
+ m_eventEmitter = eventEmitter;
120
+ }
121
+
122
+ // MountChildComponentView will only be called if this method is overridden
123
+ virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
124
+ const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept {
125
+ }
126
+
127
+ // UnmountChildComponentView will only be called if this method is overridden
128
+ virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
129
+ const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept {
130
+ }
131
+
132
+ // Initialize will only be called if this method is overridden
133
+ virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept {
134
+ }
135
+
136
+ // CreateVisual will only be called if this method is overridden
137
+ virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
138
+ return view.as<winrt::Microsoft::ReactNative::Composition::ComponentView>().Compositor().CreateSpriteVisual();
139
+ }
140
+
141
+ // FinalizeUpdate will only be called if this method is overridden
142
+ virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
143
+ winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept {
144
+ }
145
+
146
+ // You must provide an implementation of this method to handle the "setValue" command
147
+ virtual void HandleSetValueCommand(bool value) noexcept = 0;
148
+
149
+ void HandleCommand(const winrt::Microsoft::ReactNative::ComponentView &view, const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept {
150
+ auto userData = view.UserData().as<TUserData>();
151
+ auto commandName = args.CommandName();
152
+ if (commandName == L"setValue") {
153
+ bool value;
154
+ winrt::Microsoft::ReactNative::ReadArgs(args.CommandArgs(), value);
155
+ userData->HandleSetValueCommand(value);
156
+ return;
157
+ }
158
+ }
159
+
160
+ const std::shared_ptr<SwitchEventEmitter>& EventEmitter() const { return m_eventEmitter; }
161
+ const winrt::com_ptr<SwitchProps>& Props() const { return m_props; }
162
+
163
+ private:
164
+ winrt::com_ptr<SwitchProps> m_props;
165
+ std::shared_ptr<SwitchEventEmitter> m_eventEmitter;
166
+ };
167
+
168
+ template <typename TUserData>
169
+ void RegisterSwitchNativeComponent(
170
+ winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder,
171
+ std::function<void(const winrt::Microsoft::ReactNative::Composition::IReactCompositionViewComponentBuilder&)> builderCallback) noexcept {
172
+ packageBuilder.as<winrt::Microsoft::ReactNative::IReactPackageBuilderFabric>().AddViewComponent(
173
+ L"Switch", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept {
174
+ auto compBuilder = builder.as<winrt::Microsoft::ReactNative::Composition::IReactCompositionViewComponentBuilder>();
175
+
176
+ builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props,
177
+ const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept {
178
+ return winrt::make<SwitchProps>(props, cloneFrom);
179
+ });
180
+
181
+ builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
182
+ const winrt::Microsoft::ReactNative::IComponentProps &newProps,
183
+ const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept {
184
+ auto userData = view.UserData().as<TUserData>();
185
+ userData->UpdateProps(view, newProps ? newProps.as<SwitchProps>() : nullptr, oldProps ? oldProps.as<SwitchProps>() : nullptr);
186
+ });
187
+
188
+ compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
189
+ const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics,
190
+ const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept {
191
+ auto userData = view.UserData().as<TUserData>();
192
+ userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics);
193
+ });
194
+
195
+ builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
196
+ const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept {
197
+ auto userData = view.UserData().as<TUserData>();
198
+ userData->UpdateEventEmitter(std::make_shared<SwitchEventEmitter>(eventEmitter));
199
+ });
200
+
201
+ if constexpr (&TUserData::FinalizeUpdate != &BaseSwitch<TUserData>::FinalizeUpdate) {
202
+ builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
203
+ winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept {
204
+ auto userData = view.UserData().as<TUserData>();
205
+ userData->FinalizeUpdate(view, mask);
206
+ });
207
+ }
208
+
209
+ if constexpr (&TUserData::UpdateState != &BaseSwitch<TUserData>::UpdateState) {
210
+ builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
211
+ const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
212
+ auto userData = view.UserData().as<TUserData>();
213
+ userData->UpdateState(view, newState);
214
+ });
215
+ }
216
+
217
+ builder.SetCustomCommandHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
218
+ const winrt::Microsoft::ReactNative::HandleCommandArgs& args) noexcept {
219
+ auto userData = view.UserData().as<TUserData>();
220
+ userData->HandleCommand(view, args);
221
+ });
222
+
223
+ if constexpr (&TUserData::MountChildComponentView != &BaseSwitch<TUserData>::MountChildComponentView) {
224
+ builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
225
+ const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept {
226
+ auto userData = view.UserData().as<TUserData>();
227
+ return userData->MountChildComponentView(view, args);
228
+ });
229
+ }
230
+
231
+ if constexpr (&TUserData::UnmountChildComponentView != &BaseSwitch<TUserData>::UnmountChildComponentView) {
232
+ builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
233
+ const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept {
234
+ auto userData = view.UserData().as<TUserData>();
235
+ return userData->UnmountChildComponentView(view, args);
236
+ });
237
+ }
238
+
239
+ compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
240
+ auto userData = winrt::make_self<TUserData>();
241
+ if constexpr (&TUserData::Initialize != &BaseSwitch<TUserData>::Initialize) {
242
+ userData->Initialize(view);
243
+ }
244
+ view.UserData(*userData);
245
+ });
246
+
247
+ if constexpr (&TUserData::CreateVisual != &BaseSwitch<TUserData>::CreateVisual) {
248
+ compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
249
+ auto userData = view.UserData().as<TUserData>();
250
+ return userData->CreateVisual(view);
251
+ });
252
+ }
253
+
254
+ // Allow app to further customize the builder
255
+ if (builderCallback) {
256
+ builderCallback(compBuilder);
257
+ }
258
+ });
259
+ }
260
+
261
+ } // namespace Microsoft::ReactNativeSpecs
262
+
263
+ #endif // #ifdef RNW_NEW_ARCH
@@ -0,0 +1,200 @@
1
+
2
+ /*
3
+ * This file is auto-generated from UnimplementedNativeViewNativeComponent spec file in flow / TypeScript.
4
+ */
5
+ // clang-format off
6
+ #pragma once
7
+
8
+ #include <NativeModules.h>
9
+
10
+ #ifdef RNW_NEW_ARCH
11
+ #include <JSValueComposition.h>
12
+
13
+ #include <winrt/Microsoft.ReactNative.Composition.h>
14
+ #include <winrt/Microsoft.UI.Composition.h>
15
+ #endif // #ifdef RNW_NEW_ARCH
16
+
17
+ #ifdef RNW_NEW_ARCH
18
+
19
+ namespace Microsoft::ReactNativeSpecs {
20
+
21
+ REACT_STRUCT(UnimplementedNativeViewProps)
22
+ struct UnimplementedNativeViewProps : winrt::implements<UnimplementedNativeViewProps, winrt::Microsoft::ReactNative::IComponentProps> {
23
+ UnimplementedNativeViewProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom)
24
+ : ViewProps(props)
25
+ {
26
+ if (cloneFrom) {
27
+ auto cloneFromProps = cloneFrom.as<UnimplementedNativeViewProps>();
28
+ name = cloneFromProps->name;
29
+ }
30
+ }
31
+
32
+ void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept {
33
+ winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this);
34
+ }
35
+
36
+ REACT_FIELD(name)
37
+ std::optional<std::string> name;
38
+
39
+ const winrt::Microsoft::ReactNative::ViewProps ViewProps;
40
+ };
41
+
42
+ struct UnimplementedNativeViewEventEmitter {
43
+ UnimplementedNativeViewEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter)
44
+ : m_eventEmitter(eventEmitter) {}
45
+
46
+ private:
47
+ winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr};
48
+ };
49
+
50
+ template<typename TUserData>
51
+ struct BaseUnimplementedNativeView {
52
+
53
+ virtual void UpdateProps(
54
+ const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
55
+ const winrt::com_ptr<UnimplementedNativeViewProps> &newProps,
56
+ const winrt::com_ptr<UnimplementedNativeViewProps> &/*oldProps*/) noexcept {
57
+ m_props = newProps;
58
+ }
59
+
60
+ // UpdateLayoutMetrics will only be called if this method is overridden
61
+ virtual void UpdateLayoutMetrics(
62
+ const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
63
+ const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/,
64
+ const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept {
65
+ }
66
+
67
+ // UpdateState will only be called if this method is overridden
68
+ virtual void UpdateState(
69
+ const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
70
+ const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept {
71
+ }
72
+
73
+ virtual void UpdateEventEmitter(const std::shared_ptr<UnimplementedNativeViewEventEmitter> &eventEmitter) noexcept {
74
+ m_eventEmitter = eventEmitter;
75
+ }
76
+
77
+ // MountChildComponentView will only be called if this method is overridden
78
+ virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
79
+ const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept {
80
+ }
81
+
82
+ // UnmountChildComponentView will only be called if this method is overridden
83
+ virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
84
+ const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept {
85
+ }
86
+
87
+ // Initialize will only be called if this method is overridden
88
+ virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept {
89
+ }
90
+
91
+ // CreateVisual will only be called if this method is overridden
92
+ virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
93
+ return view.as<winrt::Microsoft::ReactNative::Composition::ComponentView>().Compositor().CreateSpriteVisual();
94
+ }
95
+
96
+ // FinalizeUpdate will only be called if this method is overridden
97
+ virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
98
+ winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept {
99
+ }
100
+
101
+
102
+
103
+ const std::shared_ptr<UnimplementedNativeViewEventEmitter>& EventEmitter() const { return m_eventEmitter; }
104
+ const winrt::com_ptr<UnimplementedNativeViewProps>& Props() const { return m_props; }
105
+
106
+ private:
107
+ winrt::com_ptr<UnimplementedNativeViewProps> m_props;
108
+ std::shared_ptr<UnimplementedNativeViewEventEmitter> m_eventEmitter;
109
+ };
110
+
111
+ template <typename TUserData>
112
+ void RegisterUnimplementedNativeViewNativeComponent(
113
+ winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder,
114
+ std::function<void(const winrt::Microsoft::ReactNative::Composition::IReactCompositionViewComponentBuilder&)> builderCallback) noexcept {
115
+ packageBuilder.as<winrt::Microsoft::ReactNative::IReactPackageBuilderFabric>().AddViewComponent(
116
+ L"UnimplementedNativeView", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept {
117
+ auto compBuilder = builder.as<winrt::Microsoft::ReactNative::Composition::IReactCompositionViewComponentBuilder>();
118
+
119
+ builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props,
120
+ const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept {
121
+ return winrt::make<UnimplementedNativeViewProps>(props, cloneFrom);
122
+ });
123
+
124
+ builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
125
+ const winrt::Microsoft::ReactNative::IComponentProps &newProps,
126
+ const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept {
127
+ auto userData = view.UserData().as<TUserData>();
128
+ userData->UpdateProps(view, newProps ? newProps.as<UnimplementedNativeViewProps>() : nullptr, oldProps ? oldProps.as<UnimplementedNativeViewProps>() : nullptr);
129
+ });
130
+
131
+ compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
132
+ const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics,
133
+ const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept {
134
+ auto userData = view.UserData().as<TUserData>();
135
+ userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics);
136
+ });
137
+
138
+ builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
139
+ const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept {
140
+ auto userData = view.UserData().as<TUserData>();
141
+ userData->UpdateEventEmitter(std::make_shared<UnimplementedNativeViewEventEmitter>(eventEmitter));
142
+ });
143
+
144
+ if constexpr (&TUserData::FinalizeUpdate != &BaseUnimplementedNativeView<TUserData>::FinalizeUpdate) {
145
+ builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
146
+ winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept {
147
+ auto userData = view.UserData().as<TUserData>();
148
+ userData->FinalizeUpdate(view, mask);
149
+ });
150
+ }
151
+
152
+ if constexpr (&TUserData::UpdateState != &BaseUnimplementedNativeView<TUserData>::UpdateState) {
153
+ builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
154
+ const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
155
+ auto userData = view.UserData().as<TUserData>();
156
+ userData->UpdateState(view, newState);
157
+ });
158
+ }
159
+
160
+ if constexpr (&TUserData::MountChildComponentView != &BaseUnimplementedNativeView<TUserData>::MountChildComponentView) {
161
+ builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
162
+ const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept {
163
+ auto userData = view.UserData().as<TUserData>();
164
+ return userData->MountChildComponentView(view, args);
165
+ });
166
+ }
167
+
168
+ if constexpr (&TUserData::UnmountChildComponentView != &BaseUnimplementedNativeView<TUserData>::UnmountChildComponentView) {
169
+ builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
170
+ const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept {
171
+ auto userData = view.UserData().as<TUserData>();
172
+ return userData->UnmountChildComponentView(view, args);
173
+ });
174
+ }
175
+
176
+ compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
177
+ auto userData = winrt::make_self<TUserData>();
178
+ if constexpr (&TUserData::Initialize != &BaseUnimplementedNativeView<TUserData>::Initialize) {
179
+ userData->Initialize(view);
180
+ }
181
+ view.UserData(*userData);
182
+ });
183
+
184
+ if constexpr (&TUserData::CreateVisual != &BaseUnimplementedNativeView<TUserData>::CreateVisual) {
185
+ compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
186
+ auto userData = view.UserData().as<TUserData>();
187
+ return userData->CreateVisual(view);
188
+ });
189
+ }
190
+
191
+ // Allow app to further customize the builder
192
+ if (builderCallback) {
193
+ builderCallback(compBuilder);
194
+ }
195
+ });
196
+ }
197
+
198
+ } // namespace Microsoft::ReactNativeSpecs
199
+
200
+ #endif // #ifdef RNW_NEW_ARCH
package/just-task.js CHANGED
@@ -28,7 +28,7 @@ option('clean');
28
28
 
29
29
  function codegen(test) {
30
30
  execSync(
31
- `react-native-windows-codegen --files src/**/*Native*.js --namespace Microsoft::ReactNativeSpecs --libraryName rnwcore --modulesWindows --internalComponents --modulesCxx${
31
+ `react-native-windows-codegen --files src/**/*Native*.js --namespace Microsoft::ReactNativeSpecs --libraryName rnwcore --componentsWindows --modulesWindows --internalComponents --modulesCxx${
32
32
  test ? ' --test' : ''
33
33
  }`,
34
34
  {env: process.env},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.77.6",
3
+ "version": "0.77.8",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,10 +23,10 @@
23
23
  "dependencies": {
24
24
  "@babel/runtime": "^7.0.0",
25
25
  "@jest/create-cache-key-function": "^29.6.3",
26
- "@react-native-community/cli": "15.0.0-alpha.2",
27
- "@react-native-community/cli-platform-android": "15.0.0-alpha.2",
28
- "@react-native-community/cli-platform-ios": "15.0.0-alpha.2",
29
- "@react-native-windows/cli": "0.77.1",
26
+ "@react-native-community/cli": "^15.0.0",
27
+ "@react-native-community/cli-platform-android": "^15.0.0",
28
+ "@react-native-community/cli-platform-ios": "^15.0.0",
29
+ "@react-native-windows/cli": "0.77.3",
30
30
  "@react-native/assets": "1.0.0",
31
31
  "@react-native/assets-registry": "0.77.1",
32
32
  "@react-native/codegen": "0.77.1",
@@ -69,7 +69,7 @@
69
69
  "yargs": "^17.6.2"
70
70
  },
71
71
  "devDependencies": {
72
- "@react-native-windows/codegen": "0.77.1",
72
+ "@react-native-windows/codegen": "0.77.2",
73
73
  "@react-native/metro-config": "0.77.0-nightly-20241001-223e98cc4",
74
74
  "@rnw-scripts/babel-react-native-config": "0.0.0",
75
75
  "@rnw-scripts/eslint-config": "1.2.30",