react-native-windows 0.0.0-canary.705 → 0.0.0-canary.706
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 -1
- package/Libraries/Animated/components/AnimatedFlatList.js +1 -1
- package/Libraries/Animated/components/AnimatedSectionList.js +1 -1
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +3 -1
- package/Libraries/Components/TextInput/TextInput.js +2 -0
- package/Libraries/Components/TextInput/TextInput.windows.js +2 -0
- package/Libraries/Components/ToastAndroid/ToastAndroid.js +9 -1
- package/Libraries/Components/ToastAndroid/ToastAndroid.windows.js +9 -1
- package/Libraries/Components/View/ViewNativeComponent.js +1 -0
- package/Libraries/Components/View/ViewPropTypes.js +9 -0
- package/Libraries/Components/View/ViewPropTypes.windows.js +9 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/DOM/Nodes/ReadOnlyElement.js +28 -0
- package/Libraries/Image/Image.android.js +1 -1
- package/Libraries/Image/Image.ios.js +1 -0
- package/Libraries/Image/Image.windows.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.android.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +2 -0
- package/Libraries/Network/RCTNetworking.android.js +2 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +3 -1
- package/Libraries/Pressability/Pressability.js +7 -1
- package/Libraries/Pressability/Pressability.windows.js +7 -1
- package/Libraries/ReactNative/AppContainer.js +32 -9
- package/Libraries/ReactNative/FabricUIManager.js +7 -0
- package/Libraries/ReactNative/__mocks__/FabricUIManager.js +3 -0
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +9 -4
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +28 -13
- package/Libraries/StyleSheet/PlatformColorValueTypes.windows.js +9 -4
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.js +2 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +1 -1
- package/Libraries/StyleSheet/processColor.js +1 -2
- package/Libraries/Utilities/Platform.android.js +6 -8
- package/Libraries/Utilities/Platform.flow.js +84 -0
- package/Libraries/Utilities/Platform.flow.windows.js +111 -0
- package/Libraries/Utilities/Platform.ios.js +6 -8
- package/Libraries/Utilities/Platform.windows.js +6 -8
- package/Microsoft.ReactNative/Fabric/platform/react/components/view/windows/WindowsViewProps.cpp +85 -3
- package/Microsoft.ReactNative/Fabric/platform/react/components/view/windows/WindowsViewProps.h +27 -2
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformTouch.h +10 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.h +10 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +32 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/core/graphicsConversions.h +1 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/Color.h +3 -2
- package/Microsoft.ReactNative/packages.lock.json +40 -41
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/{ViewEventEmitter.cpp → BaseViewEventEmitter.cpp} +12 -12
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/{ViewEventEmitter.h → BaseViewEventEmitter.h} +2 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/{ViewProps.cpp → BaseViewProps.cpp} +14 -97
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/{ViewProps.h → BaseViewProps.h} +7 -8
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/TouchEventEmitter.cpp +0 -16
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/ViewShadowNode.cpp +7 -20
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/YogaLayoutableShadowNode.cpp +1020 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/YogaStylableProps.cpp +1 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/primitives.h +6 -43
- package/Shared/Shared.vcxitems +5 -2
- package/Shared/Shared.vcxitems.filters +2 -0
- package/package.json +8 -8
- package/types/experimental.d.ts +9 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +0 -1445
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
import type AnimatedNode from '../Animated/nodes/AnimatedNode';
|
|
14
|
-
import type {NativeColorValue} from './PlatformColorValueTypes';
|
|
15
14
|
import type {
|
|
16
15
|
____DangerouslyImpreciseStyle_InternalOverrides,
|
|
17
16
|
____ImageStyle_InternalOverrides,
|
|
@@ -21,6 +20,7 @@ import type {
|
|
|
21
20
|
} from './private/_StyleSheetTypesOverrides';
|
|
22
21
|
import type {____TransformStyle_Internal} from './private/_TransformStyle';
|
|
23
22
|
|
|
23
|
+
declare export opaque type NativeColorValue;
|
|
24
24
|
export type ____ColorValue_Internal = null | string | number | NativeColorValue;
|
|
25
25
|
export type ColorArrayValue = null | $ReadOnlyArray<____ColorValue_Internal>;
|
|
26
26
|
export type PointValue = {
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
import type {NativeColorValue} from './
|
|
14
|
-
import type {ColorValue} from './StyleSheet';
|
|
13
|
+
import type {ColorValue, NativeColorValue} from './StyleSheet';
|
|
15
14
|
|
|
16
15
|
const Platform = require('../Utilities/Platform');
|
|
17
16
|
const normalizeColor = require('./normalizeColor');
|
|
@@ -8,16 +8,14 @@
|
|
|
8
8
|
* @flow strict
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import type {
|
|
12
|
+
Platform as PlatformType,
|
|
13
|
+
PlatformSelectSpec,
|
|
14
|
+
} from './Platform.flow';
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
android?: T,
|
|
15
|
-
native?: T,
|
|
16
|
-
default?: T,
|
|
17
|
-
...
|
|
18
|
-
};
|
|
16
|
+
import NativePlatformConstantsAndroid from './NativePlatformConstantsAndroid';
|
|
19
17
|
|
|
20
|
-
const Platform = {
|
|
18
|
+
const Platform: PlatformType = {
|
|
21
19
|
__constants: null,
|
|
22
20
|
OS: 'android',
|
|
23
21
|
// $FlowFixMe[unsafe-getters-setters]
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export type PlatformSelectSpec<T> = {
|
|
12
|
+
default?: T,
|
|
13
|
+
native?: T,
|
|
14
|
+
ios?: T,
|
|
15
|
+
android?: T,
|
|
16
|
+
...
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type IOSPlatform = {
|
|
20
|
+
__constants: null,
|
|
21
|
+
OS: $TEMPORARY$string<'ios'>,
|
|
22
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
23
|
+
get Version(): string,
|
|
24
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
25
|
+
get constants(): {|
|
|
26
|
+
forceTouchAvailable: boolean,
|
|
27
|
+
interfaceIdiom: string,
|
|
28
|
+
isTesting: boolean,
|
|
29
|
+
isDisableAnimations?: boolean,
|
|
30
|
+
osVersion: string,
|
|
31
|
+
reactNativeVersion: {|
|
|
32
|
+
major: number,
|
|
33
|
+
minor: number,
|
|
34
|
+
patch: number,
|
|
35
|
+
prerelease: ?number,
|
|
36
|
+
|},
|
|
37
|
+
systemName: string,
|
|
38
|
+
|},
|
|
39
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
40
|
+
get isPad(): boolean,
|
|
41
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
42
|
+
get isTV(): boolean,
|
|
43
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
44
|
+
get isTesting(): boolean,
|
|
45
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
46
|
+
get isDisableAnimations(): boolean,
|
|
47
|
+
select: <T>(spec: PlatformSelectSpec<T>) => T,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
type AndroidPlatform = {
|
|
51
|
+
__constants: null,
|
|
52
|
+
OS: $TEMPORARY$string<'android'>,
|
|
53
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
54
|
+
get Version(): number,
|
|
55
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
56
|
+
get constants(): {|
|
|
57
|
+
isTesting: boolean,
|
|
58
|
+
isDisableAnimations?: boolean,
|
|
59
|
+
reactNativeVersion: {|
|
|
60
|
+
major: number,
|
|
61
|
+
minor: number,
|
|
62
|
+
patch: number,
|
|
63
|
+
prerelease: ?number,
|
|
64
|
+
|},
|
|
65
|
+
Version: number,
|
|
66
|
+
Release: string,
|
|
67
|
+
Serial: string,
|
|
68
|
+
Fingerprint: string,
|
|
69
|
+
Model: string,
|
|
70
|
+
ServerHost?: string,
|
|
71
|
+
uiMode: string,
|
|
72
|
+
Brand: string,
|
|
73
|
+
Manufacturer: string,
|
|
74
|
+
|},
|
|
75
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
76
|
+
get isTV(): boolean,
|
|
77
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
78
|
+
get isTesting(): boolean,
|
|
79
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
80
|
+
get isDisableAnimations(): boolean,
|
|
81
|
+
select: <T>(spec: PlatformSelectSpec<T>) => T,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export type Platform = IOSPlatform | AndroidPlatform;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export type PlatformSelectSpec<T> = {
|
|
12
|
+
default?: T,
|
|
13
|
+
native?: T,
|
|
14
|
+
ios?: T,
|
|
15
|
+
android?: T,
|
|
16
|
+
windows?: T,
|
|
17
|
+
...
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type IOSPlatform = {
|
|
21
|
+
__constants: null,
|
|
22
|
+
OS: $TEMPORARY$string<'ios'>,
|
|
23
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
24
|
+
get Version(): string,
|
|
25
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
26
|
+
get constants(): {|
|
|
27
|
+
forceTouchAvailable: boolean,
|
|
28
|
+
interfaceIdiom: string,
|
|
29
|
+
isTesting: boolean,
|
|
30
|
+
isDisableAnimations?: boolean,
|
|
31
|
+
osVersion: string,
|
|
32
|
+
reactNativeVersion: {|
|
|
33
|
+
major: number,
|
|
34
|
+
minor: number,
|
|
35
|
+
patch: number,
|
|
36
|
+
prerelease: ?number,
|
|
37
|
+
|},
|
|
38
|
+
systemName: string,
|
|
39
|
+
|},
|
|
40
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
41
|
+
get isPad(): boolean,
|
|
42
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
43
|
+
get isTV(): boolean,
|
|
44
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
45
|
+
get isTesting(): boolean,
|
|
46
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
47
|
+
get isDisableAnimations(): boolean,
|
|
48
|
+
select: <T>(spec: PlatformSelectSpec<T>) => T,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type AndroidPlatform = {
|
|
52
|
+
__constants: null,
|
|
53
|
+
OS: $TEMPORARY$string<'android'>,
|
|
54
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
55
|
+
get Version(): number,
|
|
56
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
57
|
+
get constants(): {|
|
|
58
|
+
isTesting: boolean,
|
|
59
|
+
isDisableAnimations?: boolean,
|
|
60
|
+
reactNativeVersion: {|
|
|
61
|
+
major: number,
|
|
62
|
+
minor: number,
|
|
63
|
+
patch: number,
|
|
64
|
+
prerelease: ?number,
|
|
65
|
+
|},
|
|
66
|
+
Version: number,
|
|
67
|
+
Release: string,
|
|
68
|
+
Serial: string,
|
|
69
|
+
Fingerprint: string,
|
|
70
|
+
Model: string,
|
|
71
|
+
ServerHost?: string,
|
|
72
|
+
uiMode: string,
|
|
73
|
+
Brand: string,
|
|
74
|
+
Manufacturer: string,
|
|
75
|
+
|},
|
|
76
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
77
|
+
get isTV(): boolean,
|
|
78
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
79
|
+
get isTesting(): boolean,
|
|
80
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
81
|
+
get isDisableAnimations(): boolean,
|
|
82
|
+
select: <T>(spec: PlatformSelectSpec<T>) => T,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
type WindowsPlatform = {
|
|
86
|
+
__constants: null,
|
|
87
|
+
OS: $TEMPORARY$string<'windows'>,
|
|
88
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
89
|
+
get Version(): number,
|
|
90
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
91
|
+
get constants(): {|
|
|
92
|
+
isTesting: boolean,
|
|
93
|
+
isDisableAnimations?: boolean,
|
|
94
|
+
reactNativeVersion: {|
|
|
95
|
+
major: number,
|
|
96
|
+
minor: number,
|
|
97
|
+
patch: number,
|
|
98
|
+
prerelease: ?string,
|
|
99
|
+
|},
|
|
100
|
+
osVersion: number,
|
|
101
|
+
|},
|
|
102
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
103
|
+
get isTV(): boolean,
|
|
104
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
105
|
+
get isTesting(): boolean,
|
|
106
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
107
|
+
get isDisableAnimations(): boolean,
|
|
108
|
+
select: <T>(spec: PlatformSelectSpec<T>) => T,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export type Platform = IOSPlatform | AndroidPlatform | WindowsPlatform;
|
|
@@ -8,16 +8,14 @@
|
|
|
8
8
|
* @flow strict
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import type {
|
|
12
|
+
Platform as PlatformType,
|
|
13
|
+
PlatformSelectSpec,
|
|
14
|
+
} from './Platform.flow';
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
default?: T,
|
|
15
|
-
native?: T,
|
|
16
|
-
ios?: T,
|
|
17
|
-
...
|
|
18
|
-
};
|
|
16
|
+
import NativePlatformConstantsIOS from './NativePlatformConstantsIOS';
|
|
19
17
|
|
|
20
|
-
const Platform = {
|
|
18
|
+
const Platform: PlatformType = {
|
|
21
19
|
__constants: null,
|
|
22
20
|
OS: 'ios',
|
|
23
21
|
// $FlowFixMe[unsafe-getters-setters]
|
|
@@ -6,16 +6,14 @@
|
|
|
6
6
|
* @flow strict
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import type {
|
|
10
|
+
Platform as PlatformType,
|
|
11
|
+
PlatformSelectSpec,
|
|
12
|
+
} from './Platform.flow';
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
windows?: T,
|
|
13
|
-
native?: T,
|
|
14
|
-
default?: T,
|
|
15
|
-
...
|
|
16
|
-
};
|
|
14
|
+
import NativePlatformConstantsWin from './NativePlatformConstantsWin';
|
|
17
15
|
|
|
18
|
-
const Platform = {
|
|
16
|
+
const Platform: PlatformType = {
|
|
19
17
|
__constants: null,
|
|
20
18
|
OS: 'windows',
|
|
21
19
|
// $FlowFixMe[unsafe-getters-setters]
|
package/Microsoft.ReactNative/Fabric/platform/react/components/view/windows/WindowsViewProps.cpp
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
#include "WindowsViewProps.h"
|
|
9
9
|
|
|
10
|
+
#include <react/renderer/components/view/conversions.h>
|
|
11
|
+
#include <react/renderer/core/graphicsConversions.h>
|
|
10
12
|
#include <react/renderer/core/propsConversions.h>
|
|
11
13
|
#include <react/utils/CoreFeatures.h>
|
|
12
14
|
|
|
@@ -17,9 +19,64 @@ WindowsViewProps::WindowsViewProps(
|
|
|
17
19
|
const WindowsViewProps &sourceProps,
|
|
18
20
|
const RawProps &rawProps,
|
|
19
21
|
bool shouldSetRawProps)
|
|
20
|
-
:
|
|
21
|
-
|
|
22
|
-
enableFocusRing(sourceProps.enableFocusRing)
|
|
22
|
+
: BaseViewProps(context, sourceProps, rawProps, shouldSetRawProps),
|
|
23
|
+
windowsEvents(sourceProps.windowsEvents),
|
|
24
|
+
enableFocusRing(sourceProps.enableFocusRing),
|
|
25
|
+
elevation(
|
|
26
|
+
CoreFeatures::enablePropIteratorSetter
|
|
27
|
+
? sourceProps.elevation
|
|
28
|
+
: convertRawProp(context, rawProps, "elevation", sourceProps.elevation, {})),
|
|
29
|
+
focusable(
|
|
30
|
+
CoreFeatures::enablePropIteratorSetter
|
|
31
|
+
? sourceProps.focusable
|
|
32
|
+
: convertRawProp(context, rawProps, "focusable", sourceProps.focusable, {})) {}
|
|
33
|
+
// [Windows
|
|
34
|
+
/*nativeBackground(
|
|
35
|
+
CoreFeatures::enablePropIteratorSetter
|
|
36
|
+
? sourceProps.nativeBackground
|
|
37
|
+
: convertRawProp(
|
|
38
|
+
context,
|
|
39
|
+
rawProps,
|
|
40
|
+
"nativeBackgroundAndroid",
|
|
41
|
+
sourceProps.nativeBackground,
|
|
42
|
+
{})),
|
|
43
|
+
nativeForeground(
|
|
44
|
+
CoreFeatures::enablePropIteratorSetter
|
|
45
|
+
? sourceProps.nativeForeground
|
|
46
|
+
: convertRawProp(
|
|
47
|
+
context,
|
|
48
|
+
rawProps,
|
|
49
|
+
"nativeForegroundAndroid",
|
|
50
|
+
sourceProps.nativeForeground,
|
|
51
|
+
{})),
|
|
52
|
+
hasTVPreferredFocus(
|
|
53
|
+
CoreFeatures::enablePropIteratorSetter
|
|
54
|
+
? sourceProps.hasTVPreferredFocus
|
|
55
|
+
: convertRawProp(
|
|
56
|
+
context,
|
|
57
|
+
rawProps,
|
|
58
|
+
"hasTVPreferredFocus",
|
|
59
|
+
sourceProps.hasTVPreferredFocus,
|
|
60
|
+
{})),
|
|
61
|
+
needsOffscreenAlphaCompositing(
|
|
62
|
+
CoreFeatures::enablePropIteratorSetter
|
|
63
|
+
? sourceProps.needsOffscreenAlphaCompositing
|
|
64
|
+
: convertRawProp(
|
|
65
|
+
context,
|
|
66
|
+
rawProps,
|
|
67
|
+
"needsOffscreenAlphaCompositing",
|
|
68
|
+
sourceProps.needsOffscreenAlphaCompositing,
|
|
69
|
+
{})),
|
|
70
|
+
renderToHardwareTextureAndroid(
|
|
71
|
+
CoreFeatures::enablePropIteratorSetter
|
|
72
|
+
? sourceProps.renderToHardwareTextureAndroid
|
|
73
|
+
: convertRawProp(
|
|
74
|
+
context,
|
|
75
|
+
rawProps,
|
|
76
|
+
"renderToHardwareTextureAndroid",
|
|
77
|
+
sourceProps.renderToHardwareTextureAndroid,
|
|
78
|
+
{})) {}*/
|
|
79
|
+
// Windows]
|
|
23
80
|
|
|
24
81
|
#define WINDOWS_VIEW_EVENT_CASE(eventType) \
|
|
25
82
|
case CONSTEXPR_RAW_PROPS_KEY_HASH("on" #eventType): { \
|
|
@@ -38,6 +95,11 @@ void WindowsViewProps::setProp(
|
|
|
38
95
|
RawPropsPropNameHash hash,
|
|
39
96
|
const char *propName,
|
|
40
97
|
RawValue const &value) {
|
|
98
|
+
// All Props structs setProp methods must always, unconditionally,
|
|
99
|
+
// call all super::setProp methods, since multiple structs may
|
|
100
|
+
// reuse the same values.
|
|
101
|
+
BaseViewProps::setProp(context, hash, propName, value);
|
|
102
|
+
|
|
41
103
|
static auto defaults = WindowsViewProps{};
|
|
42
104
|
|
|
43
105
|
switch (hash) {
|
|
@@ -47,9 +109,29 @@ void WindowsViewProps::setProp(
|
|
|
47
109
|
WINDOWS_VIEW_EVENT_CASE(KeyDown);
|
|
48
110
|
RAW_SET_PROP_SWITCH_CASE_BASIC(focusable);
|
|
49
111
|
RAW_SET_PROP_SWITCH_CASE_BASIC(enableFocusRing);
|
|
112
|
+
RAW_SET_PROP_SWITCH_CASE_BASIC(elevation);
|
|
113
|
+
// [Windows
|
|
114
|
+
// RAW_SET_PROP_SWITCH_CASE(nativeBackground, "nativeBackgroundAndroid");
|
|
115
|
+
// RAW_SET_PROP_SWITCH_CASE(nativeForeground, "nativeForegroundAndroid");
|
|
116
|
+
// RAW_SET_PROP_SWITCH_CASE_BASIC(hasTVPreferredFocus);
|
|
117
|
+
// RAW_SET_PROP_SWITCH_CASE_BASIC(needsOffscreenAlphaCompositing);
|
|
118
|
+
// RAW_SET_PROP_SWITCH_CASE_BASIC(renderToHardwareTextureAndroid);
|
|
119
|
+
// Windows]
|
|
50
120
|
}
|
|
51
121
|
}
|
|
52
122
|
|
|
123
|
+
#ifdef ANDROID
|
|
124
|
+
bool WindowsViewProps::getProbablyMoreHorizontalThanVertical_DEPRECATED() const {
|
|
125
|
+
return yogaStyle.flexDirection() == YGFlexDirectionRow;
|
|
126
|
+
}
|
|
127
|
+
#endif
|
|
128
|
+
|
|
129
|
+
#if RN_DEBUG_STRING_CONVERTIBLE
|
|
130
|
+
SharedDebugStringConvertibleList WindowsViewProps::getDebugProps() const {
|
|
131
|
+
return BaseViewProps::getDebugProps();
|
|
132
|
+
}
|
|
133
|
+
#endif
|
|
134
|
+
|
|
53
135
|
/*static*/ bool WindowsViewProps::requiresFormsStackingContext(const WindowsViewProps &props) noexcept {
|
|
54
136
|
return props.windowsEvents.bits.any();
|
|
55
137
|
}
|
package/Microsoft.ReactNative/Fabric/platform/react/components/view/windows/WindowsViewProps.h
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
#pragma once
|
|
5
5
|
|
|
6
6
|
#include <react/components/view/windows/primitives.h>
|
|
7
|
-
#include <react/renderer/
|
|
7
|
+
#include <react/renderer/components/view/BaseViewProps.h>
|
|
8
8
|
#include <react/renderer/core/PropsParserContext.h>
|
|
9
9
|
|
|
10
10
|
namespace facebook::react {
|
|
11
|
-
class WindowsViewProps {
|
|
11
|
+
class WindowsViewProps : public BaseViewProps {
|
|
12
12
|
public:
|
|
13
13
|
WindowsViewProps() = default;
|
|
14
14
|
WindowsViewProps(
|
|
@@ -20,15 +20,40 @@ class WindowsViewProps {
|
|
|
20
20
|
void
|
|
21
21
|
setProp(const PropsParserContext &context, RawPropsPropNameHash hash, const char *propName, RawValue const &value);
|
|
22
22
|
|
|
23
|
+
#ifdef ANDROID
|
|
24
|
+
void propsDiffMapBuffer(Props const *oldProps, MapBufferBuilder &builder) const override;
|
|
25
|
+
#endif
|
|
26
|
+
|
|
23
27
|
static bool requiresFormsStackingContext(const WindowsViewProps &props) noexcept;
|
|
24
28
|
static bool requiresFormsView(const WindowsViewProps &props) noexcept;
|
|
25
29
|
|
|
30
|
+
Float elevation{};
|
|
26
31
|
WindowsViewEvents windowsEvents{};
|
|
27
32
|
bool enableFocusRing{true};
|
|
28
33
|
bool focusable{false};
|
|
34
|
+
|
|
29
35
|
// std::optional<std::string> overflowAnchor{};
|
|
30
36
|
// std::optional<std::string> tooltip{};
|
|
31
37
|
// std::vector<HandledKeyEvent> keyDownEvents{};
|
|
32
38
|
// std::vector<HandledKeyEvent> keyUpEvents{};
|
|
39
|
+
|
|
40
|
+
#ifdef ANDROID
|
|
41
|
+
|
|
42
|
+
std::optional<NativeDrawable> nativeBackground{};
|
|
43
|
+
std::optional<NativeDrawable> nativeForeground{};
|
|
44
|
+
|
|
45
|
+
bool hasTVPreferredFocus{false};
|
|
46
|
+
bool needsOffscreenAlphaCompositing{false};
|
|
47
|
+
bool renderToHardwareTextureAndroid{false};
|
|
48
|
+
|
|
49
|
+
#endif
|
|
50
|
+
|
|
51
|
+
#ifdef ANDROID
|
|
52
|
+
bool getProbablyMoreHorizontalThanVertical_DEPRECATED() const override;
|
|
53
|
+
#endif
|
|
54
|
+
|
|
55
|
+
#if RN_DEBUG_STRING_CONVERTIBLE
|
|
56
|
+
SharedDebugStringConvertibleList getDebugProps() const override;
|
|
57
|
+
#endif
|
|
33
58
|
};
|
|
34
59
|
} // namespace facebook::react
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
#pragma once
|
|
5
|
+
|
|
6
|
+
#include <react/renderer/components/view/BaseViewEventEmitter.h>
|
|
7
|
+
|
|
8
|
+
namespace facebook::react {
|
|
9
|
+
using HostPlatformViewEventEmitter = BaseViewEventEmitter;
|
|
10
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
11
|
+
#include <react/renderer/core/ShadowNodeTraits.h>
|
|
12
|
+
|
|
13
|
+
namespace facebook::react::HostPlatformViewTraitsInitializer {
|
|
14
|
+
|
|
15
|
+
inline bool formsStackingContext(ViewProps const &viewProps) {
|
|
16
|
+
return viewProps.elevation != 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
inline bool formsView(ViewProps const &viewProps) {
|
|
20
|
+
#ifdef ANDROID
|
|
21
|
+
return viewProps.nativeBackground.has_value() || viewProps.nativeForeground.has_value() || viewProps.focusable ||
|
|
22
|
+
viewProps.hasTVPreferredFocus || viewProps.needsOffscreenAlphaCompositing ||
|
|
23
|
+
viewProps.renderToHardwareTextureAndroid;
|
|
24
|
+
#endif
|
|
25
|
+
return viewProps.focusable;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
inline ShadowNodeTraits::Trait extraTraits() {
|
|
29
|
+
return ShadowNodeTraits::Trait::AndroidMapBufferPropsSupported;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
} // namespace facebook::react::HostPlatformViewTraitsInitializer
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
-
#include <cmath>
|
|
11
10
|
#include <functional>
|
|
12
11
|
#include <limits>
|
|
13
12
|
|
|
@@ -35,7 +34,9 @@ struct Color {
|
|
|
35
34
|
* On Android, a color can be represented as 32 bits integer, so there is no
|
|
36
35
|
* need to instantiate complex color objects and then pass them as shared
|
|
37
36
|
* pointers. Hence instead of using shared_ptr, we use a simple wrapper class
|
|
38
|
-
* which provides a pointer-like interface.
|
|
37
|
+
* which provides a pointer-like interface. On other platforms, colors may be
|
|
38
|
+
* represented by more complex objects that cannot be represented as 32-bits
|
|
39
|
+
* integers, so we hide the implementation detail in HostPlatformColor.h.
|
|
39
40
|
*/
|
|
40
41
|
class SharedColor {
|
|
41
42
|
friend std::hash<SharedColor>;
|