react-native-windows 0.74.33 → 0.74.34

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 (43) hide show
  1. package/Libraries/Modal/Modal.windows.js +4 -1
  2. package/Microsoft.ReactNative/Fabric/AbiPortalShadowNode.cpp +97 -0
  3. package/Microsoft.ReactNative/Fabric/AbiPortalShadowNode.h +53 -0
  4. package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.h +161 -17
  5. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +18 -0
  6. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +10 -0
  7. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +74 -42
  8. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +2 -0
  9. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +152 -1
  10. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +16 -0
  11. package/Microsoft.ReactNative/Fabric/Composition/FocusManager.cpp +4 -2
  12. package/Microsoft.ReactNative/Fabric/Composition/FocusManager.h +9 -1
  13. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +179 -12
  14. package/Microsoft.ReactNative/Fabric/Composition/PortalComponentView.cpp +12 -0
  15. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +2 -1
  16. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +0 -1
  17. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +16 -14
  18. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +6 -4
  19. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +3 -1
  20. package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +5 -0
  21. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorParser.h +1 -1
  22. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +10 -1
  23. package/Microsoft.ReactNative/Modules/ClipboardModule.cpp +1 -1
  24. package/Microsoft.ReactNative/Modules/ClipboardModule.h +1 -1
  25. package/Microsoft.ReactNative.Cxx/NativeModules.h +20 -0
  26. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  27. package/Shared/Shared.vcxitems +3 -3
  28. package/Shared/Shared.vcxitems.filters +1 -1
  29. package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +1 -1
  30. package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +1 -1
  31. package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +1 -1
  32. package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +1 -1
  33. package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +1 -1
  34. package/codegen/react/components/rnwcore/AndroidSwitch.g.h +1 -1
  35. package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +1 -1
  36. package/codegen/react/components/rnwcore/InputAccessory.g.h +1 -1
  37. package/codegen/react/components/rnwcore/ModalHostView.g.h +1 -1
  38. package/codegen/react/components/rnwcore/PullToRefreshView.g.h +1 -1
  39. package/codegen/react/components/rnwcore/SafeAreaView.g.h +1 -1
  40. package/codegen/react/components/rnwcore/Switch.g.h +1 -1
  41. package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +1 -1
  42. package/package.json +3 -3
  43. package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +0 -191
@@ -76,7 +76,9 @@ void RootComponentView::updateLayoutMetrics(
76
76
  winrt::Microsoft::ReactNative::ComponentView RootComponentView::GetFocusedComponent() noexcept {
77
77
  return m_focusedComponent;
78
78
  }
79
- void RootComponentView::SetFocusedComponent(const winrt::Microsoft::ReactNative::ComponentView &value) noexcept {
79
+ void RootComponentView::SetFocusedComponent(
80
+ const winrt::Microsoft::ReactNative::ComponentView &value,
81
+ winrt::Microsoft::ReactNative::FocusNavigationDirection direction) noexcept {
80
82
  if (m_focusedComponent == value)
81
83
  return;
82
84
 
@@ -90,7 +92,7 @@ void RootComponentView::SetFocusedComponent(const winrt::Microsoft::ReactNative:
90
92
  if (auto rootView = m_wkRootView.get()) {
91
93
  winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(rootView)->TrySetFocus();
92
94
  }
93
- auto args = winrt::make<winrt::Microsoft::ReactNative::implementation::GotFocusEventArgs>(value);
95
+ auto args = winrt::make<winrt::Microsoft::ReactNative::implementation::GotFocusEventArgs>(value, direction);
94
96
  winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(value)->onGotFocus(args);
95
97
  }
96
98
 
@@ -151,7 +153,7 @@ bool RootComponentView::TrySetFocusedComponent(
151
153
 
152
154
  winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(losingFocusArgs.NewFocusedComponent())
153
155
  ->rootComponentView()
154
- ->SetFocusedComponent(gettingFocusArgs.NewFocusedComponent());
156
+ ->SetFocusedComponent(gettingFocusArgs.NewFocusedComponent(), direction);
155
157
  }
156
158
 
157
159
  return true;
@@ -241,7 +243,7 @@ void RootComponentView::start(const winrt::Microsoft::ReactNative::ReactNativeIs
241
243
  }
242
244
 
243
245
  void RootComponentView::stop() noexcept {
244
- SetFocusedComponent(nullptr);
246
+ SetFocusedComponent(nullptr, winrt::Microsoft::ReactNative::FocusNavigationDirection::None);
245
247
  if (m_visualAddedToIsland) {
246
248
  if (auto rootView = m_wkRootView.get()) {
247
249
  winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(rootView)->RemoveRenderedVisual(
@@ -27,7 +27,9 @@ struct RootComponentView : RootComponentViewT<RootComponentView, ViewComponentVi
27
27
  winrt::Microsoft::ReactNative::ReactContext const &reactContext) noexcept;
28
28
 
29
29
  winrt::Microsoft::ReactNative::ComponentView GetFocusedComponent() noexcept;
30
- void SetFocusedComponent(const winrt::Microsoft::ReactNative::ComponentView &value) noexcept;
30
+ void SetFocusedComponent(
31
+ const winrt::Microsoft::ReactNative::ComponentView &value,
32
+ winrt::Microsoft::ReactNative::FocusNavigationDirection direction) noexcept;
31
33
  bool TrySetFocusedComponent(
32
34
  const winrt::Microsoft::ReactNative::ComponentView &view,
33
35
  winrt::Microsoft::ReactNative::FocusNavigationDirection direction) noexcept;
@@ -241,15 +241,20 @@ bool Theme::TryGetPlatformColor(const std::string &platformColor, winrt::Windows
241
241
  {"ButtonForegroundPressed", "TextFillColorSecondary"},
242
242
  {"ButtonForegroundPointerOver", "TextFillColorPrimary"},
243
243
  {"ButtonBackground", "ControlFillColorDefault"},
244
+ {"ButtonBorderBrush", "ButtonBorder"},
244
245
  {"ButtonBorder", "ControlElevationBorder"},
245
246
  {"ControlElevationBorder",
246
247
  "ControlStrokeColorSecondary"}, // TODO ControlElevationBorderBrush is actually gradient brush
247
248
  {"ButtonForeground", "TextFillColorPrimary"},
249
+ {"SolidBackgroundFillColorBaseBrush", "SolidBackgroundFillColorBase"},
248
250
  {"ButtonBackgroundDisabled", "ControlFillColorDisabled"},
251
+ {"ButtonBorderBrushDisabled", "ButtonBorderDisabled"},
249
252
  {"ButtonBorderDisabled", "ControlStrokeColorDefault"},
250
253
  {"ButtonForegroundDisabled", "TextFillColorDisabled"},
251
254
  {"ButtonBackgroundPointerOver", "ControlFillColorSecondary"},
255
+ {"ButtonBorderBrushPointerOver", "ButtonBorderPointerOver"},
252
256
  {"ButtonBorderPointerOver", "ControlElevationBorder"},
257
+ {"ButtonBorderBrushPressed", "ButtonBorderPressed"},
253
258
  {"ButtonBorderPressed", "ControlFillColorTransparent"},
254
259
  {"ToggleSwitchFillOff", "ControlAltFillColorSecondary"},
255
260
  {"ToggleSwitchFillOffPointerOver", "ControlAltFillColorTertiary"},
@@ -15,7 +15,7 @@ namespace facebook::react {
15
15
 
16
16
  inline SharedColor
17
17
  parsePlatformColor(const ContextContainer &contextContainer, int32_t surfaceId, const RawValue &value) {
18
- if (value.hasType<std::unordered_map<std::string, std::string>>()) {
18
+ if (value.hasType<std::unordered_map<std::string, std::vector<std::string>>>()) {
19
19
  auto map = (std::unordered_map<std::string, std::vector<std::string>>)value;
20
20
  if (map.find("windowsbrush") != map.end()) {
21
21
  facebook::react::Color color = {
@@ -52,6 +52,15 @@ namespace Microsoft.ReactNative.Composition
52
52
  };
53
53
  }
54
54
 
55
+ [webhosthidden]
56
+ [experimental]
57
+ DOC_STRING("StateData type to be used with a PortalComponentView. The LayoutConstraints and PointScaleFactor will be used to layout the content of the Portal")
58
+ interface IPortalStateData
59
+ {
60
+ Microsoft.ReactNative.LayoutConstraints LayoutConstraints { get; };
61
+ Single PointScaleFactor { get; };
62
+ };
63
+
55
64
  [webhosthidden]
56
65
  [experimental]
57
66
  DOC_STRING(".")
@@ -66,4 +75,4 @@ namespace Microsoft.ReactNative.Composition
66
75
  void SetVisualToMountChildrenIntoHandler(VisualToMountChildrenIntoDelegate impl);
67
76
  };
68
77
 
69
- } // namespace Microsoft.ReactNative
78
+ } // namespace Microsoft.ReactNative.Composition
@@ -48,7 +48,7 @@ void Clipboard::getString(React::ReactPromise<std::string> result) noexcept {
48
48
  );
49
49
  }
50
50
 
51
- void Clipboard::setString(std::wstring content) noexcept {
51
+ void Clipboard::setString(winrt::hstring content) noexcept {
52
52
  m_reactContext.UIDispatcher().Post([=] {
53
53
  DataTransfer::DataPackage data;
54
54
  data.SetText(content);
@@ -18,7 +18,7 @@ struct Clipboard {
18
18
  void getString(winrt::Microsoft::ReactNative::ReactPromise<std::string> result) noexcept;
19
19
 
20
20
  REACT_METHOD(setString)
21
- void setString(std::wstring content) noexcept;
21
+ void setString(winrt::hstring content) noexcept;
22
22
 
23
23
  winrt::Microsoft::ReactNative::ReactContext m_reactContext;
24
24
  };
@@ -371,6 +371,26 @@ constexpr bool MatchInputArg<std::string, std::wstring>() noexcept {
371
371
  return true;
372
372
  }
373
373
 
374
+ template <>
375
+ constexpr bool MatchInputArg<std::string, winrt::hstring>() noexcept {
376
+ return true;
377
+ }
378
+
379
+ template <>
380
+ constexpr bool MatchInputArg<winrt::hstring, std::string>() noexcept {
381
+ return true;
382
+ }
383
+
384
+ template <>
385
+ constexpr bool MatchInputArg<std::wstring, winrt::hstring>() noexcept {
386
+ return true;
387
+ }
388
+
389
+ template <>
390
+ constexpr bool MatchInputArg<winrt::hstring, std::wstring>() noexcept {
391
+ return true;
392
+ }
393
+
374
394
  template <class TResult, class TInputArgs, class TOutputCallbacks, class TOutputPromises>
375
395
  struct MethodSignature {
376
396
  using Result = TResult;
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.74.33</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.74.34</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>74</ReactNativeWindowsMinor>
16
- <ReactNativeWindowsPatch>33</ReactNativeWindowsPatch>
16
+ <ReactNativeWindowsPatch>34</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>b2f3b756abab8c47977afbf0534e6fa5c6ce68b9</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>bf15804e00e3369083e8213a331753952b706204</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -162,9 +162,6 @@
162
162
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiComponentDescriptor.cpp">
163
163
  <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
164
164
  </ClCompile>
165
- <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiViewComponentDescriptor.cpp">
166
- <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
167
- </ClCompile>
168
165
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiEventEmitter.cpp">
169
166
  <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
170
167
  </ClCompile>
@@ -174,6 +171,9 @@
174
171
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiShadowNode.cpp">
175
172
  <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
176
173
  </ClCompile>
174
+ <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiPortalShadowNode.cpp">
175
+ <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
176
+ </ClCompile>
177
177
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiViewShadowNode.cpp">
178
178
  <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
179
179
  </ClCompile>
@@ -239,7 +239,6 @@
239
239
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\PortalComponentView.cpp" />
240
240
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\RootComponentView.cpp" />
241
241
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\UnimplementedNativeViewComponentView.cpp" />
242
- <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiViewComponentDescriptor.cpp" />
243
242
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiViewProps.cpp" />
244
243
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\WindowsComponentDescriptorRegistry.cpp" />
245
244
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\UiaHelpers.cpp" />
@@ -293,6 +292,7 @@
293
292
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\runtimescheduler\Task.cpp" />
294
293
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\utils\CoreFeatures.cpp" />
295
294
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\platform\react\renderer\graphics\PlatformColorUtils.cpp" />
295
+ <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiPortalShadowNode.cpp" />
296
296
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiViewShadowNode.cpp" />
297
297
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiState.cpp" />
298
298
  <ClCompile Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\Utils\ThemeUtils.cpp" />
@@ -159,7 +159,7 @@ void RegisterActivityIndicatorViewNativeComponent(
159
159
  builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
160
160
  const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
161
161
  auto userData = view.UserData().as<TUserData>();
162
- userData->member(view, newState);
162
+ userData->UpdateState(view, newState);
163
163
  });
164
164
  }
165
165
 
@@ -236,7 +236,7 @@ void RegisterAndroidDrawerLayoutNativeComponent(
236
236
  builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
237
237
  const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
238
238
  auto userData = view.UserData().as<TUserData>();
239
- userData->member(view, newState);
239
+ userData->UpdateState(view, newState);
240
240
  });
241
241
  }
242
242
 
@@ -147,7 +147,7 @@ void RegisterAndroidHorizontalScrollContentViewNativeComponent(
147
147
  builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
148
148
  const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
149
149
  auto userData = view.UserData().as<TUserData>();
150
- userData->member(view, newState);
150
+ userData->UpdateState(view, newState);
151
151
  });
152
152
  }
153
153
 
@@ -171,7 +171,7 @@ void RegisterAndroidProgressBarNativeComponent(
171
171
  builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
172
172
  const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
173
173
  auto userData = view.UserData().as<TUserData>();
174
- userData->member(view, newState);
174
+ userData->UpdateState(view, newState);
175
175
  });
176
176
  }
177
177
 
@@ -191,7 +191,7 @@ void RegisterAndroidSwipeRefreshLayoutNativeComponent(
191
191
  builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
192
192
  const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
193
193
  auto userData = view.UserData().as<TUserData>();
194
- userData->member(view, newState);
194
+ userData->UpdateState(view, newState);
195
195
  });
196
196
  }
197
197
 
@@ -208,7 +208,7 @@ void RegisterAndroidSwitchNativeComponent(
208
208
  builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
209
209
  const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
210
210
  auto userData = view.UserData().as<TUserData>();
211
- userData->member(view, newState);
211
+ userData->UpdateState(view, newState);
212
212
  });
213
213
  }
214
214
 
@@ -175,7 +175,7 @@ void RegisterDebuggingOverlayNativeComponent(
175
175
  builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
176
176
  const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
177
177
  auto userData = view.UserData().as<TUserData>();
178
- userData->member(view, newState);
178
+ userData->UpdateState(view, newState);
179
179
  });
180
180
  }
181
181
 
@@ -147,7 +147,7 @@ void RegisterInputAccessoryNativeComponent(
147
147
  builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
148
148
  const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
149
149
  auto userData = view.UserData().as<TUserData>();
150
- userData->member(view, newState);
150
+ userData->UpdateState(view, newState);
151
151
  });
152
152
  }
153
153
 
@@ -226,7 +226,7 @@ void RegisterModalHostViewNativeComponent(
226
226
  builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
227
227
  const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
228
228
  auto userData = view.UserData().as<TUserData>();
229
- userData->member(view, newState);
229
+ userData->UpdateState(view, newState);
230
230
  });
231
231
  }
232
232
 
@@ -187,7 +187,7 @@ void RegisterPullToRefreshViewNativeComponent(
187
187
  builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
188
188
  const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
189
189
  auto userData = view.UserData().as<TUserData>();
190
- userData->member(view, newState);
190
+ userData->UpdateState(view, newState);
191
191
  });
192
192
  }
193
193
 
@@ -144,7 +144,7 @@ void RegisterSafeAreaViewNativeComponent(
144
144
  builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
145
145
  const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
146
146
  auto userData = view.UserData().as<TUserData>();
147
- userData->member(view, newState);
147
+ userData->UpdateState(view, newState);
148
148
  });
149
149
  }
150
150
 
@@ -204,7 +204,7 @@ void RegisterSwitchNativeComponent(
204
204
  builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
205
205
  const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
206
206
  auto userData = view.UserData().as<TUserData>();
207
- userData->member(view, newState);
207
+ userData->UpdateState(view, newState);
208
208
  });
209
209
  }
210
210
 
@@ -147,7 +147,7 @@ void RegisterUnimplementedNativeViewNativeComponent(
147
147
  builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
148
148
  const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
149
149
  auto userData = view.UserData().as<TUserData>();
150
- userData->member(view, newState);
150
+ userData->UpdateState(view, newState);
151
151
  });
152
152
  }
153
153
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.74.33",
3
+ "version": "0.74.34",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "@react-native-community/cli": "13.6.9",
27
27
  "@react-native-community/cli-platform-android": "13.6.9",
28
28
  "@react-native-community/cli-platform-ios": "13.6.9",
29
- "@react-native-windows/cli": "0.74.9",
29
+ "@react-native-windows/cli": "0.74.10",
30
30
  "@react-native/assets": "1.0.0",
31
31
  "@react-native/assets-registry": "0.74.87",
32
32
  "@react-native/codegen": "0.74.87",
@@ -64,7 +64,7 @@
64
64
  "yargs": "^17.6.2"
65
65
  },
66
66
  "devDependencies": {
67
- "@react-native-windows/codegen": "0.74.6",
67
+ "@react-native-windows/codegen": "0.74.7",
68
68
  "@react-native/metro-config": "0.74.87",
69
69
  "@rnw-scripts/babel-react-native-config": "0.0.0",
70
70
  "@rnw-scripts/eslint-config": "1.2.9",
@@ -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 &parameters)
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
- rawProps.iterateOverValues(
110
- [&](facebook::react::RawPropsPropNameHash hash, const char *propName, facebook::react::RawValue const &fn) {
111
- shadowNodeProps.get()->setProp(context, hash, propName, fn);
112
- userProps.SetProp(
113
- hash,
114
- winrt::to_hstring(propName),
115
- winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(folly::dynamic(fn)));
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), 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