react-native-windows 0.0.0-canary.447 → 0.0.0-canary.448

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.
@@ -41,7 +41,8 @@ ABIViewManager::ABIViewManager(
41
41
  m_viewManagerWithExportedEventTypeConstants{viewManager.try_as<IViewManagerWithExportedEventTypeConstants>()},
42
42
  m_viewManagerRequiresNativeLayout{viewManager.try_as<IViewManagerRequiresNativeLayout>()},
43
43
  m_viewManagerWithChildren{viewManager.try_as<IViewManagerWithChildren>()},
44
- m_viewManagerWithPointerEvents{viewManager.try_as<IViewManagerWithPointerEvents>()} {
44
+ m_viewManagerWithPointerEvents{viewManager.try_as<IViewManagerWithPointerEvents>()},
45
+ m_viewManagerWithDropViewInstance{viewManager.try_as<IViewManagerWithDropViewInstance>()} {
45
46
  if (m_viewManagerWithReactContext) {
46
47
  m_viewManagerWithReactContext.ReactContext(winrt::make<implementation::ReactContext>(Mso::Copy(reactContext)));
47
48
  }
@@ -228,6 +229,14 @@ void ABIViewManager::OnPointerEvent(::Microsoft::ReactNative::ShadowNodeBase *no
228
229
  Super::OnPointerEvent(node, args);
229
230
  }
230
231
 
232
+ void ABIViewManager::OnDropViewInstance(const ::Microsoft::ReactNative::XamlView &view) {
233
+ if (m_viewManagerWithDropViewInstance) {
234
+ m_viewManagerWithDropViewInstance.OnDropViewInstance(view.try_as<xaml::FrameworkElement>());
235
+ } else {
236
+ Super::OnDropViewInstance(view);
237
+ }
238
+ }
239
+
231
240
  ::Microsoft::ReactNative::ShadowNode *ABIViewManager::createShadow() const {
232
241
  return new ABIShadowNode(
233
242
  m_viewManagerRequiresNativeLayout && m_viewManagerRequiresNativeLayout.RequiresNativeLayout());
@@ -13,6 +13,7 @@
13
13
 
14
14
  #include <Views/FrameworkElementViewManager.h>
15
15
  #include <Views/ShadowNodeBase.h>
16
+ #include <XamlView.h>
16
17
  #include "ReactHost/React.h"
17
18
 
18
19
  #include "winrt/Microsoft.ReactNative.h"
@@ -67,6 +68,8 @@ class ABIViewManager : public ::Microsoft::ReactNative::FrameworkElementViewMana
67
68
 
68
69
  void OnPointerEvent(::Microsoft::ReactNative::ShadowNodeBase *node, const ReactPointerEventArgs &args) override;
69
70
 
71
+ void OnDropViewInstance(const ::Microsoft::ReactNative::XamlView &view);
72
+
70
73
  protected:
71
74
  xaml::DependencyObject CreateViewCore(int64_t, const winrt::Microsoft::ReactNative::JSValueObject &props) override;
72
75
 
@@ -80,6 +83,7 @@ class ABIViewManager : public ::Microsoft::ReactNative::FrameworkElementViewMana
80
83
  IViewManagerWithChildren m_viewManagerWithChildren;
81
84
  IViewManagerRequiresNativeLayout m_viewManagerRequiresNativeLayout;
82
85
  IViewManagerWithPointerEvents m_viewManagerWithPointerEvents;
86
+ IViewManagerWithDropViewInstance m_viewManagerWithDropViewInstance;
83
87
 
84
88
  winrt::Windows::Foundation::Collections::IMapView<winrt::hstring, ViewManagerPropertyType> m_nativeProps;
85
89
  };
@@ -88,4 +88,11 @@ namespace Microsoft.ReactNative
88
88
  )
89
89
  void OnPointerEvent(Object view, ReactPointerEventArgs args);
90
90
  };
91
+ interface IViewManagerWithDropViewInstance {
92
+ DOC_STRING(
93
+ "Enables the view manager to track when the view is "
94
+ "being removed from the visual tree. "
95
+ )
96
+ void OnDropViewInstance(XAML_NAMESPACE.FrameworkElement view);
97
+ };
91
98
  } // namespace Microsoft.ReactNative
@@ -65,6 +65,7 @@ void ShadowNodeBase::RemoveChildAt(int64_t indexToRemove) {
65
65
  }
66
66
 
67
67
  void ShadowNodeBase::onDropViewInstance() {
68
+ GetViewManager()->OnDropViewInstance(m_view);
68
69
  m_handledKeyboardEventHandler = nullptr;
69
70
  }
70
71
 
@@ -93,6 +93,8 @@ class REACTWINDOWS_EXPORT ViewManagerBase : public IViewManager {
93
93
 
94
94
  virtual void TransferProperties(const XamlView &oldView, const XamlView &newView);
95
95
 
96
+ virtual void OnDropViewInstance(const XamlView &view) {}
97
+
96
98
  protected:
97
99
  virtual XamlView CreateViewCore(int64_t tag, const winrt::Microsoft::ReactNative::JSValueObject &props) = 0;
98
100
  virtual void OnViewCreated(XamlView view) {}
@@ -301,7 +301,7 @@ constexpr void ValidateCoroutineArg() noexcept {
301
301
  static_assert(
302
302
  !std::is_reference_v<TArg> && !std::is_pointer_v<TArg>,
303
303
  "Coroutine parameter must be passed by value for safe access"
304
- #ifndef __APPLE__
304
+ #ifndef __clang__
305
305
  ": " __FUNCSIG__
306
306
  #endif
307
307
  );
@@ -10,7 +10,7 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.0.0-canary.447</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.0.0-canary.448</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>0</ReactNativeWindowsMinor>
16
16
  <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.0.0-canary.447",
3
+ "version": "0.0.0-canary.448",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",