react-native-windows 0.0.0-canary.447 → 0.0.0-canary.451
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/Microsoft.ReactNative/ABIViewManager.cpp +10 -1
- package/Microsoft.ReactNative/ABIViewManager.h +4 -0
- package/Microsoft.ReactNative/IViewManager.idl +7 -0
- package/Microsoft.ReactNative/Views/ShadowNodeBase.cpp +1 -0
- package/Microsoft.ReactNative/Views/TouchEventHandler.cpp +4 -9
- package/Microsoft.ReactNative/Views/ViewManagerBase.h +2 -0
- package/Microsoft.ReactNative.Cxx/NativeModules.h +1 -1
- package/PropertySheets/Generated/PackageVersion.g.props +1 -1
- package/Scripts/rnw-dependencies.ps1 +1 -1
- package/package.json +8 -8
|
@@ -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
|
|
@@ -127,9 +127,6 @@ void TouchEventHandler::OnPointerPressed(
|
|
|
127
127
|
assert(!tagsForBranch.empty());
|
|
128
128
|
const auto tag = tagsForBranch.front();
|
|
129
129
|
|
|
130
|
-
// Pointer pressing updates the enter/leave state
|
|
131
|
-
UpdatePointersInViews(args, sourceElement, std::move(tagsForBranch));
|
|
132
|
-
|
|
133
130
|
size_t pointerIndex = AddReactPointer(args, tag, sourceElement);
|
|
134
131
|
|
|
135
132
|
// For now, when using the mouse we only want to send click events for the left button.
|
|
@@ -189,10 +186,11 @@ void TouchEventHandler::OnPointerMoved(
|
|
|
189
186
|
if (optPointerIndex) {
|
|
190
187
|
UpdateReactPointer(m_pointers[*optPointerIndex], args, sourceElement);
|
|
191
188
|
DispatchTouchEvent(eventType, *optPointerIndex);
|
|
192
|
-
} else {
|
|
193
|
-
// Move with no buttons pressed
|
|
194
|
-
UpdatePointersInViews(args, sourceElement, std::move(tagsForBranch));
|
|
195
189
|
}
|
|
190
|
+
|
|
191
|
+
// If we re-introduce onMouseMove to react-native-windows, we should add an
|
|
192
|
+
// argument to ensure we do not emit these events while the pointer is down.
|
|
193
|
+
UpdatePointersInViews(args, sourceElement, std::move(tagsForBranch));
|
|
196
194
|
}
|
|
197
195
|
|
|
198
196
|
void TouchEventHandler::OnPointerConcluded(TouchEventType eventType, const winrt::PointerRoutedEventArgs &args) {
|
|
@@ -227,9 +225,6 @@ void TouchEventHandler::OnPointerConcluded(TouchEventType eventType, const winrt
|
|
|
227
225
|
m_touchId = 0;
|
|
228
226
|
|
|
229
227
|
m_xamlView.as<xaml::FrameworkElement>().ReleasePointerCapture(args.Pointer());
|
|
230
|
-
|
|
231
|
-
// Updates the enter/leave state when pointer was being tracked
|
|
232
|
-
UpdatePointersInViews(args, sourceElement, std::move(tagsForBranch));
|
|
233
228
|
}
|
|
234
229
|
|
|
235
230
|
size_t TouchEventHandler::AddReactPointer(
|
|
@@ -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
|
|
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.
|
|
13
|
+
<ReactNativeWindowsVersion>0.0.0-canary.451</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.
|
|
3
|
+
"version": "0.0.0-canary.451",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@react-native-community/cli": "^6.0.0",
|
|
27
27
|
"@react-native-community/cli-platform-android": "^6.0.0",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "^6.0.0",
|
|
29
|
-
"@react-native-windows/cli": "0.0.0-canary.
|
|
30
|
-
"@react-native-windows/virtualized-list": "0.0.0-canary.
|
|
29
|
+
"@react-native-windows/cli": "0.0.0-canary.113",
|
|
30
|
+
"@react-native-windows/virtualized-list": "0.0.0-canary.28",
|
|
31
31
|
"@react-native/assets": "1.0.0",
|
|
32
32
|
"@react-native/normalize-color": "2.0.0",
|
|
33
33
|
"@react-native/polyfills": "2.0.0",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"ws": "^6.1.4"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@react-native-windows/codegen": "0.0.0-canary.
|
|
62
|
-
"@rnw-scripts/eslint-config": "1.1.
|
|
63
|
-
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.0.
|
|
61
|
+
"@react-native-windows/codegen": "0.0.0-canary.25",
|
|
62
|
+
"@rnw-scripts/eslint-config": "1.1.11",
|
|
63
|
+
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.0.5",
|
|
64
64
|
"@rnx-kit/jest-preset": "^0.1.0",
|
|
65
65
|
"@types/node": "^14.14.22",
|
|
66
66
|
"@types/react": "^17.0.21",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"prettier": "^2.4.1",
|
|
75
75
|
"react": "17.0.2",
|
|
76
76
|
"react-native": "0.0.0-20220127-2008-20b9ed91c",
|
|
77
|
-
"react-native-platform-override": "^1.6.
|
|
77
|
+
"react-native-platform-override": "^1.6.5",
|
|
78
78
|
"react-refresh": "^0.4.0",
|
|
79
79
|
"react-shallow-renderer": "16.14.1",
|
|
80
80
|
"typescript": "^4.4.4"
|
|
@@ -139,6 +139,6 @@
|
|
|
139
139
|
],
|
|
140
140
|
"promoteRelease": true,
|
|
141
141
|
"engines": {
|
|
142
|
-
"node": ">=
|
|
142
|
+
"node": ">= 14"
|
|
143
143
|
}
|
|
144
144
|
}
|