react-native-windows 0.82.3 → 0.83.0-preview.1
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/.flowconfig +2 -7
- package/Libraries/Animated/components/AnimatedFlatList.js +5 -3
- package/Libraries/Animated/components/AnimatedImage.js +4 -3
- package/Libraries/Animated/components/AnimatedSectionList.js +2 -2
- package/Libraries/Animated/components/AnimatedText.js +7 -3
- package/Libraries/Animated/components/AnimatedView.js +3 -2
- package/Libraries/Animated/createAnimatedComponent.js +24 -12
- package/Libraries/Animated/nodes/AnimatedColor.js +26 -10
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +43 -15
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +43 -15
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +2 -2
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +2 -2
- package/Libraries/Components/Glyph/Glyph.js +4 -1
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +2 -2
- package/Libraries/Components/RefreshControl/RefreshControl.d.ts +3 -3
- package/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +2 -2
- package/Libraries/Components/ScrollView/ScrollView.js +1 -0
- package/Libraries/Components/ScrollView/ScrollView.windows.js +1 -0
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +6 -6
- package/Libraries/Components/Switch/Switch.d.ts +2 -2
- package/Libraries/Components/Switch/Switch.windows.js +1 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +2 -5
- package/Libraries/Components/TextInput/TextInput.js +6 -0
- package/Libraries/Components/TextInput/TextInput.windows.js +6 -0
- package/Libraries/Components/Touchable/TouchableBounce.js +7 -7
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +7 -7
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +1 -1
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +19 -1
- package/Libraries/Components/View/View.d.ts +2 -2
- package/Libraries/Components/View/View.windows.js +0 -1
- package/Libraries/Components/View/ViewNativeComponent.js +13 -1
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/setUpPerformance.js +2 -0
- package/Libraries/Debugging/DebuggingOverlay.js +14 -14
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +8 -2
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +5 -2
- package/Libraries/Image/Image.d.ts +3 -3
- package/Libraries/Image/ImageInjection.js +3 -6
- package/Libraries/Image/ImageTypes.flow.js +3 -7
- package/Libraries/Lists/FlatList.js +8 -8
- package/Libraries/Lists/SectionList.d.ts +5 -1
- package/Libraries/Lists/ViewabilityHelper.js +1 -1
- package/Libraries/Lists/VirtualizedList.js +1 -0
- package/Libraries/LogBox/UI/AnsiHighlight.js +4 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +11 -2
- package/Libraries/NativeComponent/NativeComponentRegistry.d.ts +98 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -0
- package/Libraries/NativeComponent/NativeComponentRegistryUnstable.js +3 -1
- package/Libraries/NativeComponent/ViewConfigIgnore.windows.js +45 -0
- package/Libraries/Network/RCTNetworking.android.js +3 -1
- package/Libraries/Network/RCTNetworking.ios.js +3 -0
- package/Libraries/Network/RCTNetworking.windows.js +3 -0
- package/Libraries/Network/XMLHttpRequest.js +1 -41
- package/Libraries/Pressability/usePressability.js +14 -3
- package/Libraries/ReactNative/PaperUIManager.windows.js +3 -3
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +20 -82
- package/Libraries/ReactNative/getNativeComponentAttributes.js +12 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +6759 -4478
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +3169 -3119
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4732 -3535
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +6646 -4070
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3136 -2825
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4761 -3312
- package/Libraries/Renderer/shims/ReactNative.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
- package/Libraries/Renderer/shims/ReactNativeTypes.windows.js +2 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +44 -0
- package/Libraries/StyleSheet/processBackgroundPosition.js +284 -0
- package/Libraries/StyleSheet/processBackgroundRepeat.js +105 -0
- package/Libraries/StyleSheet/processBackgroundSize.js +104 -0
- package/Libraries/Text/Text.d.ts +2 -2
- package/Libraries/Text/TextNativeComponent.js +10 -0
- package/Libraries/TurboModule/TurboModuleRegistry.js +3 -9
- package/Libraries/Utilities/DevLoadingView.js +14 -6
- package/Libraries/Utilities/HMRClient.js +13 -5
- package/Microsoft.ReactNative/CompositionComponentView.idl +2 -0
- package/Microsoft.ReactNative/CompositionHwndHost.idl +1 -0
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +10 -40
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +3 -80
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +45 -12
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +8 -0
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +61 -74
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +4 -3
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +2 -1
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeWindow.cpp +245 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeWindow.h +80 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +20 -36
- package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.cpp +5 -0
- package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +1 -0
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +1 -1
- package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +20 -94
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +1 -3
- package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +0 -41
- package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +0 -11
- package/Microsoft.ReactNative/ReactNativeIsland.idl +2 -3
- package/Microsoft.ReactNative/ReactNativeWin32App.cpp +31 -101
- package/Microsoft.ReactNative/ReactNativeWin32App.h +2 -13
- package/Microsoft.ReactNative/ReactNativeWindow.idl +44 -0
- package/Microsoft.ReactNative.Cxx/AutoDraw.h +9 -1
- package/Microsoft.ReactNative.Cxx/ReactCommon/CallInvoker.h +13 -16
- package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModule.h +24 -36
- package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModuleUtils.h +5 -8
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/AString.h +8 -6
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Array.h +32 -49
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Base.h +27 -76
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bool.h +4 -2
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/CallbackWrapper.h +19 -18
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Class.h +25 -48
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Convert.h +38 -31
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Error.h +11 -6
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/EventEmitter.h +47 -45
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Function.h +69 -89
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/HighResTimeStamp.h +8 -8
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/LongLivedObject.h +6 -6
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Number.h +16 -8
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Object.h +17 -24
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Promise.h +17 -17
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Value.h +20 -29
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/debug/react_native_assert.h +2 -7
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/timing/primitives.h +127 -115
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/Warnings.props +2 -1
- package/ReactCommon/ReactCommon.vcxproj +11 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/CxxNativeModule.cpp +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/Instance.cpp +4 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +4 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSIndexedRAMBundle.cpp +4 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/MethodCall.cpp +4 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ModuleRegistry.cpp +5 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +4 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/RAMBundleRegistry.cpp +6 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ReactMarker.cpp +2 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +25 -35
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +86 -67
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSIExecutor.cpp +15 -8
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSINativeModules.cpp +4 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +84 -68
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +31 -35
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +4 -5
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/network/HttpUtils.cpp +2 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +24 -36
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h +28 -66
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/webperformance/NativePerformance.cpp +5 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +3 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h +8 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp +19 -16
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +8 -9
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +25 -95
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/BaseViewProps.cpp +36 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +85 -42
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventDispatcher.cpp +2 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventQueueProcessor.cpp +2 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h +25 -31
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/UIManager.cpp +19 -5
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +16 -1
- package/Scripts/Tfs/Layout-Desktop-Headers.ps1 +1 -15
- package/Scripts/creaternwapp.cmd +1 -1
- package/Scripts/perf/compare-results.js +357 -0
- package/Scripts/perf/create-perf-test.js +343 -0
- package/Scripts/perf/post-pr-comment.js +210 -0
- package/Shared/Hermes/HermesRuntimeTargetDelegate.cpp +8 -0
- package/Shared/Hermes/HermesRuntimeTargetDelegate.h +3 -0
- package/Shared/Shared.vcxitems +15 -3
- package/Shared/Shared.vcxitems.filters +11 -3
- package/codegen/NativeIntersectionObserverSpec.g.h +2 -0
- package/codegen/NativeNetworkingIOSSpec.g.h +2 -0
- package/codegen/NativePerformanceSpec.g.h +6 -0
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +229 -139
- package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +2 -1
- package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +42 -25
- package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +2 -1
- package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +2 -1
- package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +11 -6
- package/codegen/react/components/rnwcore/AndroidSwitch.g.h +11 -6
- package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +1 -0
- package/codegen/react/components/rnwcore/InputAccessory.g.h +2 -1
- package/codegen/react/components/rnwcore/ModalHostView.g.h +40 -23
- package/codegen/react/components/rnwcore/Props.cpp +6 -1
- package/codegen/react/components/rnwcore/Props.h +1 -0
- package/codegen/react/components/rnwcore/PullToRefreshView.g.h +11 -6
- package/codegen/react/components/rnwcore/SafeAreaView.g.h +1 -0
- package/codegen/react/components/rnwcore/Switch.g.h +11 -6
- package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +2 -1
- package/codegen/react/components/rnwcore/VirtualView.g.h +41 -8
- package/codegen/react/components/rnwcore/VirtualViewExperimental.g.h +45 -8
- package/codegen/rnwcoreJSI.h +3973 -6059
- package/index.js +6 -0
- package/index.windows.js +6 -0
- package/jest/mockComponent.js +6 -6
- package/jest/setup.js +15 -10
- package/package.json +27 -27
- package/src/private/components/virtualview/VirtualView.js +22 -27
- package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +6 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +100 -19
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +18 -3
- package/src/private/setup/setUpDefaultReactNativeEnvironment.js +6 -0
- package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +1 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +12 -2
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +76 -15
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +1 -0
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
- package/src/private/webapis/performance/ResourceTiming.js +31 -4
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +4 -1
- package/src/private/webapis/performance/specs/NativePerformance.js +3 -0
- package/stubs/double-conversion/double-conversion.h +5 -0
- package/templates/cpp-app/template.config.js +1 -1
- package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +1 -1
- package/templates/cpp-lib/template.config.js +1 -1
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +1 -1
- package/types/index.d.ts +1 -0
- package/types/public/ReactNativeTypes.d.ts +115 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +0 -152
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h +0 -1574
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp +0 -528
- package/Scripts/OpenSSL.nuspec +0 -39
- package/Scripts/OpenSSL.targets +0 -36
- package/codegen/rnwcoreJSI-generated.cpp +0 -3470
|
@@ -14,29 +14,37 @@ import NativeDevLoadingView from './NativeDevLoadingView';
|
|
|
14
14
|
|
|
15
15
|
const COLOR_SCHEME = {
|
|
16
16
|
dark: {
|
|
17
|
+
load: {
|
|
18
|
+
backgroundColor: '#fafafa',
|
|
19
|
+
textColor: '#242526',
|
|
20
|
+
},
|
|
17
21
|
refresh: {
|
|
18
22
|
backgroundColor: '#2584e8',
|
|
19
23
|
textColor: '#ffffff',
|
|
20
24
|
},
|
|
21
|
-
|
|
22
|
-
backgroundColor: '#
|
|
23
|
-
textColor: '#
|
|
25
|
+
error: {
|
|
26
|
+
backgroundColor: '#1065AF',
|
|
27
|
+
textColor: '#ffffff',
|
|
24
28
|
},
|
|
25
29
|
},
|
|
26
30
|
default: {
|
|
31
|
+
load: {
|
|
32
|
+
backgroundColor: '#404040',
|
|
33
|
+
textColor: '#ffffff',
|
|
34
|
+
},
|
|
27
35
|
refresh: {
|
|
28
36
|
backgroundColor: '#2584e8',
|
|
29
37
|
textColor: '#ffffff',
|
|
30
38
|
},
|
|
31
|
-
|
|
32
|
-
backgroundColor: '#
|
|
39
|
+
error: {
|
|
40
|
+
backgroundColor: '#1065AF',
|
|
33
41
|
textColor: '#ffffff',
|
|
34
42
|
},
|
|
35
43
|
},
|
|
36
44
|
};
|
|
37
45
|
|
|
38
46
|
export default {
|
|
39
|
-
showMessage(message: string, type: 'load' | 'refresh') {
|
|
47
|
+
showMessage(message: string, type: 'load' | 'refresh' | 'error') {
|
|
40
48
|
if (NativeDevLoadingView) {
|
|
41
49
|
const colorScheme =
|
|
42
50
|
getColorScheme() === 'dark' ? COLOR_SCHEME.dark : COLOR_SCHEME.default;
|
|
@@ -211,7 +211,9 @@ Error: ${e.message}`;
|
|
|
211
211
|
setHMRUnavailableReason(error);
|
|
212
212
|
});
|
|
213
213
|
|
|
214
|
+
let pendingUpdatesCount = 0;
|
|
214
215
|
client.on('update-start', ({isInitialUpdate}) => {
|
|
216
|
+
pendingUpdatesCount++;
|
|
215
217
|
currentCompileErrorMessage = null;
|
|
216
218
|
didConnect = true;
|
|
217
219
|
|
|
@@ -228,12 +230,13 @@ Error: ${e.message}`;
|
|
|
228
230
|
});
|
|
229
231
|
|
|
230
232
|
client.on('update-done', () => {
|
|
231
|
-
|
|
233
|
+
pendingUpdatesCount--;
|
|
234
|
+
if (pendingUpdatesCount === 0) {
|
|
235
|
+
DevLoadingView.hide();
|
|
236
|
+
}
|
|
232
237
|
});
|
|
233
238
|
|
|
234
239
|
client.on('error', data => {
|
|
235
|
-
DevLoadingView.hide();
|
|
236
|
-
|
|
237
240
|
if (data.type === 'GraphNotFoundError') {
|
|
238
241
|
client.close();
|
|
239
242
|
setHMRUnavailableReason(
|
|
@@ -253,8 +256,6 @@ Error: ${e.message}`;
|
|
|
253
256
|
});
|
|
254
257
|
|
|
255
258
|
client.on('close', closeEvent => {
|
|
256
|
-
DevLoadingView.hide();
|
|
257
|
-
|
|
258
259
|
// https://www.rfc-editor.org/rfc/rfc6455.html#section-7.4.1
|
|
259
260
|
// https://www.rfc-editor.org/rfc/rfc6455.html#section-7.1.5
|
|
260
261
|
const isNormalOrUnsetCloseReason =
|
|
@@ -296,10 +297,17 @@ function setHMRUnavailableReason(reason: string) {
|
|
|
296
297
|
}
|
|
297
298
|
hmrUnavailableReason = reason;
|
|
298
299
|
|
|
300
|
+
const DevLoadingView = require('./DevLoadingView').default;
|
|
301
|
+
DevLoadingView.hide();
|
|
302
|
+
|
|
299
303
|
// We only want to show a warning if Fast Refresh is on *and* if we ever
|
|
300
304
|
// previously managed to connect successfully. We don't want to show
|
|
301
305
|
// the warning to native engineers who use cached bundles without Metro.
|
|
302
306
|
if (hmrClient.isEnabled() && didConnect) {
|
|
307
|
+
DevLoadingView.showMessage(
|
|
308
|
+
'Fast Refresh disconnected. Reload app to reconnect.',
|
|
309
|
+
'error',
|
|
310
|
+
);
|
|
303
311
|
console.warn(reason);
|
|
304
312
|
// (Not using the `warning` module to prevent a Buck cycle.)
|
|
305
313
|
}
|
|
@@ -93,6 +93,8 @@ namespace Microsoft.ReactNative.Composition
|
|
|
93
93
|
[webhosthidden]
|
|
94
94
|
runtimeclass ContentIslandComponentView : ViewComponentView {
|
|
95
95
|
void Connect(Microsoft.UI.Content.ContentIsland contentIsland);
|
|
96
|
+
DOC_STRING("The ChildSiteLink will be unavailable until after the ContentIslandComponentView is mounted")
|
|
97
|
+
Microsoft.UI.Content.ChildSiteLink ChildSiteLink { get; };
|
|
96
98
|
};
|
|
97
99
|
|
|
98
100
|
[experimental]
|
|
@@ -13,6 +13,7 @@ namespace Microsoft.ReactNative
|
|
|
13
13
|
[default_interface]
|
|
14
14
|
[webhosthidden]
|
|
15
15
|
[experimental]
|
|
16
|
+
[deprecated("Use @ReactNativeWindow instead", deprecate, 1)]
|
|
16
17
|
DOC_STRING("An HWND based host of RNW running on windows composition."
|
|
17
18
|
"Provided as an ease of use function - most of the time HWND-less hosting would be preferable."
|
|
18
19
|
"In the long term this is likely to be replaced with a more modern hosting interface.")
|
|
@@ -121,7 +121,7 @@ struct ComponentView
|
|
|
121
121
|
virtual void onLostFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept;
|
|
122
122
|
virtual void onGotFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept;
|
|
123
123
|
virtual void onMounted() noexcept;
|
|
124
|
-
bool isMounted() noexcept;
|
|
124
|
+
bool isMounted() const noexcept;
|
|
125
125
|
virtual void onUnmounted() noexcept;
|
|
126
126
|
void onDestroying() noexcept;
|
|
127
127
|
|
|
@@ -30,50 +30,20 @@ CompositionHwndHost::CompositionHwndHost() noexcept {}
|
|
|
30
30
|
void CompositionHwndHost::Initialize(uint64_t hwnd) noexcept {
|
|
31
31
|
m_hwnd = (HWND)hwnd;
|
|
32
32
|
|
|
33
|
-
auto
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (auto liftedCompositor =
|
|
37
|
-
winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerCompositor(
|
|
38
|
-
compositionContext)) {
|
|
39
|
-
m_compRootView = winrt::Microsoft::ReactNative::ReactNativeIsland(liftedCompositor);
|
|
33
|
+
auto compositor = winrt::Microsoft::ReactNative::Composition::implementation::CompositionUIService::GetCompositor(
|
|
34
|
+
ReactViewHost().ReactNativeHost().InstanceSettings().Properties());
|
|
35
|
+
m_compRootView = winrt::Microsoft::ReactNative::ReactNativeIsland(compositor);
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
auto bridge = winrt::Microsoft::UI::Content::DesktopChildSiteBridge::Create(
|
|
38
|
+
compositor, winrt::Microsoft::UI::GetWindowIdFromWindow(m_hwnd));
|
|
43
39
|
|
|
44
|
-
|
|
40
|
+
auto island = m_compRootView.Island();
|
|
45
41
|
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
bridge.Connect(island);
|
|
43
|
+
bridge.Show();
|
|
48
44
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} else {
|
|
52
|
-
m_compRootView = winrt::Microsoft::ReactNative::ReactNativeIsland();
|
|
53
|
-
m_compRootView.as<winrt::Microsoft::ReactNative::Composition::Experimental::IInternalCompositionRootView>()
|
|
54
|
-
.SetWindow(reinterpret_cast<uint64_t>(m_hwnd));
|
|
55
|
-
|
|
56
|
-
auto compositor =
|
|
57
|
-
winrt::Microsoft::ReactNative::Composition::Experimental::SystemCompositionContextHelper::InnerCompositor(
|
|
58
|
-
compositionContext);
|
|
59
|
-
auto interop = compositor.as<ABI::Windows::UI::Composition::Desktop::ICompositorDesktopInterop>();
|
|
60
|
-
winrt::Windows::UI::Composition::Desktop::DesktopWindowTarget target{nullptr};
|
|
61
|
-
check_hresult(interop->CreateDesktopWindowTarget(
|
|
62
|
-
m_hwnd,
|
|
63
|
-
false,
|
|
64
|
-
reinterpret_cast<ABI::Windows::UI::Composition::Desktop::IDesktopWindowTarget **>(put_abi(target))));
|
|
65
|
-
|
|
66
|
-
auto root = compositor.CreateContainerVisual();
|
|
67
|
-
root.RelativeSizeAdjustment({1.0f, 1.0f});
|
|
68
|
-
root.Offset({0, 0, 0});
|
|
69
|
-
root.Comment(L"Root Visual");
|
|
70
|
-
target.Root(root);
|
|
71
|
-
|
|
72
|
-
m_compRootView.as<winrt::Microsoft::ReactNative::Composition::Experimental::IInternalCompositionRootView>()
|
|
73
|
-
.InternalRootVisual(
|
|
74
|
-
winrt::Microsoft::ReactNative::Composition::Experimental::SystemCompositionContextHelper::CreateVisual(
|
|
75
|
-
target.Root()));
|
|
76
|
-
}
|
|
45
|
+
m_compRootView.ScaleFactor(ScaleFactor());
|
|
46
|
+
bridge.ResizePolicy(winrt::Microsoft::UI::Content::ContentSizePolicy::ResizeContentToParentWindow);
|
|
77
47
|
|
|
78
48
|
m_compRootView.ReactViewHost(std::move(m_reactViewHost));
|
|
79
49
|
m_compRootView.ScaleFactor(ScaleFactor());
|
|
@@ -709,86 +709,9 @@ void ComponentView::applyShadowProps(const facebook::react::ViewProps &viewProps
|
|
|
709
709
|
shadow.Color(theme()->Color(*viewProps.shadowColor));
|
|
710
710
|
}
|
|
711
711
|
|
|
712
|
-
//
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
borderMetrics.borderRadii.topRight.horizontal != 0 || borderMetrics.borderRadii.bottomLeft.horizontal != 0 ||
|
|
716
|
-
borderMetrics.borderRadii.bottomRight.horizontal != 0 || borderMetrics.borderRadii.topLeft.vertical != 0 ||
|
|
717
|
-
borderMetrics.borderRadii.topRight.vertical != 0 || borderMetrics.borderRadii.bottomLeft.vertical != 0 ||
|
|
718
|
-
borderMetrics.borderRadii.bottomRight.vertical != 0;
|
|
719
|
-
|
|
720
|
-
if (hasBorderRadius) {
|
|
721
|
-
// When borderRadius is set, we need to create a shadow mask that follows the rounded rectangle shape.
|
|
722
|
-
// Use CompositionVisualSurface to capture the clipped visual's appearance as the shadow mask.
|
|
723
|
-
bool maskSet = false;
|
|
724
|
-
|
|
725
|
-
// Try Microsoft (WinUI3) Composition first
|
|
726
|
-
auto msCompositor =
|
|
727
|
-
winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerCompositor(
|
|
728
|
-
m_compContext);
|
|
729
|
-
if (msCompositor) {
|
|
730
|
-
auto innerVisual =
|
|
731
|
-
winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerVisual(
|
|
732
|
-
Visual());
|
|
733
|
-
if (innerVisual) {
|
|
734
|
-
// Create a VisualSurface that captures the visual (with its clip applied)
|
|
735
|
-
auto visualSurface = msCompositor.CreateVisualSurface();
|
|
736
|
-
visualSurface.SourceVisual(innerVisual);
|
|
737
|
-
visualSurface.SourceSize(
|
|
738
|
-
{m_layoutMetrics.frame.size.width * m_layoutMetrics.pointScaleFactor,
|
|
739
|
-
m_layoutMetrics.frame.size.height * m_layoutMetrics.pointScaleFactor});
|
|
740
|
-
|
|
741
|
-
// Create a brush from the visual surface to use as shadow mask
|
|
742
|
-
auto maskBrush = msCompositor.CreateSurfaceBrush(visualSurface);
|
|
743
|
-
maskBrush.Stretch(winrt::Microsoft::UI::Composition::CompositionStretch::Fill);
|
|
744
|
-
|
|
745
|
-
// Get the inner shadow and set the mask
|
|
746
|
-
auto innerShadow = winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::
|
|
747
|
-
InnerDropShadow(shadow);
|
|
748
|
-
if (innerShadow) {
|
|
749
|
-
innerShadow.Mask(maskBrush);
|
|
750
|
-
maskSet = true;
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
// Fallback to System (Windows.UI) Composition if Microsoft Composition is not available
|
|
756
|
-
if (!maskSet) {
|
|
757
|
-
auto sysCompositor =
|
|
758
|
-
winrt::Microsoft::ReactNative::Composition::Experimental::SystemCompositionContextHelper::InnerCompositor(
|
|
759
|
-
m_compContext);
|
|
760
|
-
if (sysCompositor) {
|
|
761
|
-
auto innerVisual =
|
|
762
|
-
winrt::Microsoft::ReactNative::Composition::Experimental::SystemCompositionContextHelper::InnerVisual(
|
|
763
|
-
Visual());
|
|
764
|
-
if (innerVisual) {
|
|
765
|
-
auto visualSurface = sysCompositor.CreateVisualSurface();
|
|
766
|
-
visualSurface.SourceVisual(innerVisual);
|
|
767
|
-
visualSurface.SourceSize(
|
|
768
|
-
{m_layoutMetrics.frame.size.width * m_layoutMetrics.pointScaleFactor,
|
|
769
|
-
m_layoutMetrics.frame.size.height * m_layoutMetrics.pointScaleFactor});
|
|
770
|
-
|
|
771
|
-
auto maskBrush = sysCompositor.CreateSurfaceBrush(visualSurface);
|
|
772
|
-
maskBrush.Stretch(winrt::Windows::UI::Composition::CompositionStretch::Fill);
|
|
773
|
-
|
|
774
|
-
auto innerShadow =
|
|
775
|
-
winrt::Microsoft::ReactNative::Composition::Experimental::SystemCompositionContextHelper::InnerDropShadow(
|
|
776
|
-
shadow);
|
|
777
|
-
if (innerShadow) {
|
|
778
|
-
innerShadow.Mask(maskBrush);
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
// Apply shadow to OuterVisual (which is not clipped) so the shadow can extend beyond the clip
|
|
785
|
-
OuterVisual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(shadow);
|
|
786
|
-
Visual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(nullptr);
|
|
787
|
-
} else {
|
|
788
|
-
// No border radius - apply shadow directly to Visual (original behavior)
|
|
789
|
-
Visual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(shadow);
|
|
790
|
-
OuterVisual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(nullptr);
|
|
791
|
-
}
|
|
712
|
+
// Apply shadow to OuterVisual (not Visual) because Visual may have a rounded-corner clip
|
|
713
|
+
// from updateClippingPath, which would clip the shadow. OuterVisual is not clipped.
|
|
714
|
+
OuterVisual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(shadow);
|
|
792
715
|
}
|
|
793
716
|
|
|
794
717
|
void ComponentView::updateTransformProps(
|
|
@@ -43,12 +43,30 @@ ContentIslandComponentView::ContentIslandComponentView(
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
winrt::Microsoft::UI::Content::ContentIsland ContentIslandComponentView::ParentContentIsland() noexcept {
|
|
47
|
+
auto root = rootComponentView();
|
|
48
|
+
if (!root)
|
|
49
|
+
return nullptr;
|
|
50
|
+
return root->parentContentIsland();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
winrt::Microsoft::UI::Content::ChildSiteLink ContentIslandComponentView::ChildSiteLink() noexcept {
|
|
54
|
+
if (!isMounted())
|
|
55
|
+
return nullptr;
|
|
56
|
+
if (!m_childSiteLink) {
|
|
57
|
+
m_childSiteLink = winrt::Microsoft::UI::Content::ChildSiteLink::Create(
|
|
58
|
+
m_parentContentIsland,
|
|
59
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::CompositionContextHelper::InnerVisual(Visual())
|
|
60
|
+
.as<winrt::Microsoft::UI::Composition::ContainerVisual>());
|
|
61
|
+
}
|
|
62
|
+
return m_childSiteLink;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
void ContentIslandComponentView::ConnectInternal() noexcept {
|
|
66
|
+
if (!m_islandToConnect)
|
|
67
|
+
return;
|
|
68
|
+
|
|
69
|
+
ChildSiteLink().ActualSize({m_layoutMetrics.frame.size.width, m_layoutMetrics.frame.size.height});
|
|
52
70
|
|
|
53
71
|
// Issue #15557: Set initial LocalToParentTransformMatrix synchronously before Connect.
|
|
54
72
|
// This fixes popup position being wrong even without scrolling.
|
|
@@ -74,10 +92,19 @@ void ContentIslandComponentView::OnMounted() noexcept {
|
|
|
74
92
|
ConfigureChildSiteLinkAutomation();
|
|
75
93
|
|
|
76
94
|
if (m_islandToConnect) {
|
|
95
|
+
Assert(m_childSiteLink.SiteView().IsConnected());
|
|
96
|
+
Assert(!m_islandToConnect.IsConnected());
|
|
97
|
+
|
|
77
98
|
m_childSiteLink.Connect(m_islandToConnect);
|
|
78
99
|
m_islandToConnect = nullptr;
|
|
79
100
|
}
|
|
80
101
|
|
|
102
|
+
if (m_pendingNavigateFocus) {
|
|
103
|
+
m_navigationHost.NavigateFocus(
|
|
104
|
+
winrt::Microsoft::UI::Input::FocusNavigationRequest::Create(*m_pendingNavigateFocus));
|
|
105
|
+
m_pendingNavigateFocus.reset();
|
|
106
|
+
}
|
|
107
|
+
|
|
81
108
|
ParentLayoutChanged();
|
|
82
109
|
auto view = Parent();
|
|
83
110
|
while (view) {
|
|
@@ -106,6 +133,11 @@ void ContentIslandComponentView::OnMounted() noexcept {
|
|
|
106
133
|
}
|
|
107
134
|
}
|
|
108
135
|
|
|
136
|
+
void ContentIslandComponentView::OnMounted() noexcept {
|
|
137
|
+
m_parentContentIsland = ParentContentIsland();
|
|
138
|
+
ConnectInternal();
|
|
139
|
+
}
|
|
140
|
+
|
|
109
141
|
void ContentIslandComponentView::OnUnmounted() noexcept {
|
|
110
142
|
m_layoutMetricChangedRevokers.clear();
|
|
111
143
|
|
|
@@ -198,7 +230,10 @@ void ContentIslandComponentView::onGotFocus(
|
|
|
198
230
|
const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept {
|
|
199
231
|
auto gotFocusEventArgs = args.as<winrt::Microsoft::ReactNative::implementation::GotFocusEventArgs>();
|
|
200
232
|
const auto navigationReason = GetFocusNavigationReason(gotFocusEventArgs->Direction());
|
|
201
|
-
m_navigationHost
|
|
233
|
+
if (m_navigationHost)
|
|
234
|
+
m_navigationHost.NavigateFocus(winrt::Microsoft::UI::Input::FocusNavigationRequest::Create(navigationReason));
|
|
235
|
+
else
|
|
236
|
+
m_pendingNavigateFocus = navigationReason;
|
|
202
237
|
}
|
|
203
238
|
|
|
204
239
|
ContentIslandComponentView::~ContentIslandComponentView() noexcept {
|
|
@@ -239,6 +274,9 @@ void ContentIslandComponentView::Connect(const winrt::Microsoft::UI::Content::Co
|
|
|
239
274
|
m_childSiteLink.Connect(contentIsland);
|
|
240
275
|
} else {
|
|
241
276
|
m_islandToConnect = contentIsland;
|
|
277
|
+
if (isMounted()) {
|
|
278
|
+
ConnectInternal();
|
|
279
|
+
}
|
|
242
280
|
}
|
|
243
281
|
}
|
|
244
282
|
|
|
@@ -247,13 +285,8 @@ void ContentIslandComponentView::prepareForRecycle() noexcept {
|
|
|
247
285
|
}
|
|
248
286
|
|
|
249
287
|
void ContentIslandComponentView::ConfigureChildSiteLinkAutomation() noexcept {
|
|
250
|
-
// Use FrameworkBased to let the XamlIsland manage its own framework-level accessibility tree
|
|
251
|
-
// and raise focus events naturally. This tells the system that the child island has its own
|
|
252
|
-
// framework (WinUI/XAML) that manages automation.
|
|
253
288
|
m_childSiteLink.AutomationOption(winrt::Microsoft::UI::Content::ContentAutomationOptions::FrameworkBased);
|
|
254
289
|
|
|
255
|
-
// When using FrameworkBased mode, we don't register automation callbacks - let the XamlIsland handle its own UIA
|
|
256
|
-
// tree.
|
|
257
290
|
if (m_innerAutomationProvider) {
|
|
258
291
|
m_innerAutomationProvider->SetChildSiteLink(m_childSiteLink);
|
|
259
292
|
}
|
|
@@ -32,6 +32,8 @@ struct ContentIslandComponentView : ContentIslandComponentViewT<ContentIslandCom
|
|
|
32
32
|
uint32_t index) noexcept override;
|
|
33
33
|
void Connect(const winrt::Microsoft::UI::Content::ContentIsland &contentIsland) noexcept;
|
|
34
34
|
|
|
35
|
+
winrt::Microsoft::UI::Content::ChildSiteLink ChildSiteLink() noexcept;
|
|
36
|
+
|
|
35
37
|
void updateLayoutMetrics(
|
|
36
38
|
facebook::react::LayoutMetrics const &layoutMetrics,
|
|
37
39
|
facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept;
|
|
@@ -58,15 +60,21 @@ struct ContentIslandComponentView : ContentIslandComponentViewT<ContentIslandCom
|
|
|
58
60
|
void OnMounted() noexcept;
|
|
59
61
|
void OnUnmounted() noexcept;
|
|
60
62
|
void ParentLayoutChanged() noexcept;
|
|
63
|
+
void ConnectInternal() noexcept;
|
|
64
|
+
winrt::Microsoft::UI::Content::ContentIsland ParentContentIsland() noexcept;
|
|
61
65
|
|
|
62
66
|
bool m_layoutChangePosted{false};
|
|
67
|
+
winrt::Microsoft::UI::Content::ContentIsland m_parentContentIsland{nullptr};
|
|
63
68
|
winrt::Microsoft::UI::Content::ContentIsland m_islandToConnect{nullptr};
|
|
69
|
+
std::optional<winrt::Microsoft::UI::Input::FocusNavigationReason> m_pendingNavigateFocus;
|
|
70
|
+
|
|
64
71
|
winrt::event_token m_mountedToken;
|
|
65
72
|
winrt::event_token m_unmountedToken;
|
|
66
73
|
std::vector<winrt::Microsoft::ReactNative::ComponentView::LayoutMetricsChanged_revoker> m_layoutMetricChangedRevokers;
|
|
67
74
|
winrt::Microsoft::UI::Content::ChildSiteLink m_childSiteLink{nullptr};
|
|
68
75
|
winrt::Microsoft::UI::Input::InputFocusNavigationHost m_navigationHost{nullptr};
|
|
69
76
|
winrt::event_token m_navigationHostDepartFocusRequestedToken{};
|
|
77
|
+
std::optional<winrt::Microsoft::UI::Input::FocusNavigationReason> m_pendingFocus;
|
|
70
78
|
|
|
71
79
|
// Issue #15557: Store ViewChanged subscriptions to parent ScrollViews for transform updates
|
|
72
80
|
struct ViewChangedSubscription {
|