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
package/.flowconfig
CHANGED
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
<PROJECT_ROOT>/Libraries/LogBox/UI/LogBoxInspectorHeader.js
|
|
38
38
|
<PROJECT_ROOT>/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js
|
|
39
39
|
<PROJECT_ROOT>/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js
|
|
40
|
+
<PROJECT_ROOT>/Libraries/Utilities/Platform.flow.js
|
|
40
41
|
|
|
41
42
|
; Ignore react-native files in node_modules since they are copied into project root
|
|
42
43
|
.*/node_modules/react-native/.*
|
|
@@ -133,4 +134,4 @@ untyped-import
|
|
|
133
134
|
untyped-type-import
|
|
134
135
|
|
|
135
136
|
[version]
|
|
136
|
-
^0.
|
|
137
|
+
^0.214.0
|
|
@@ -23,7 +23,7 @@ const FlatListWithEventThrottle = React.forwardRef(
|
|
|
23
23
|
ref:
|
|
24
24
|
| ((null | FlatList<mixed>) => mixed)
|
|
25
25
|
| {current: null | FlatList<mixed>, ...},
|
|
26
|
-
) => <FlatList
|
|
26
|
+
) => <FlatList {...props} ref={ref} />,
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
export default (createAnimatedComponent(
|
|
@@ -27,7 +27,7 @@ const SectionListWithEventThrottle = React.forwardRef(
|
|
|
27
27
|
current: null | SectionList<SectionBase<$FlowFixMe>>,
|
|
28
28
|
...
|
|
29
29
|
},
|
|
30
|
-
) => <SectionList
|
|
30
|
+
) => <SectionList {...props} ref={ref} />,
|
|
31
31
|
);
|
|
32
32
|
|
|
33
33
|
export default (createAnimatedComponent(
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
import type {NativeColorValue} from '../../StyleSheet/PlatformColorValueTypes';
|
|
14
13
|
import type {ProcessedColorValue} from '../../StyleSheet/processColor';
|
|
15
14
|
import type {ColorValue} from '../../StyleSheet/StyleSheet';
|
|
15
|
+
import type {NativeColorValue} from '../../StyleSheet/StyleSheetTypes';
|
|
16
16
|
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
17
17
|
|
|
18
18
|
import normalizeColor from '../../StyleSheet/normalizeColor';
|
|
@@ -181,7 +181,9 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
|
|
|
181
181
|
...props
|
|
182
182
|
} = this.props;
|
|
183
183
|
const drawStatusBar =
|
|
184
|
-
Platform.
|
|
184
|
+
Platform.OS === 'android' &&
|
|
185
|
+
Platform.Version >= 21 &&
|
|
186
|
+
this.props.statusBarBackgroundColor != null;
|
|
185
187
|
const drawerViewWrapper = (
|
|
186
188
|
<View
|
|
187
189
|
style={[
|
|
@@ -1380,6 +1380,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1380
1380
|
|
|
1381
1381
|
const config = React.useMemo(
|
|
1382
1382
|
() => ({
|
|
1383
|
+
hitSlop: props.hitSlop,
|
|
1383
1384
|
onPress: (event: PressEvent) => {
|
|
1384
1385
|
if (props.editable !== false) {
|
|
1385
1386
|
if (inputRef.current != null) {
|
|
@@ -1394,6 +1395,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1394
1395
|
}),
|
|
1395
1396
|
[
|
|
1396
1397
|
props.editable,
|
|
1398
|
+
props.hitSlop,
|
|
1397
1399
|
props.onPressIn,
|
|
1398
1400
|
props.onPressOut,
|
|
1399
1401
|
props.rejectResponderTermination,
|
|
@@ -1469,6 +1469,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1469
1469
|
|
|
1470
1470
|
const config = React.useMemo(
|
|
1471
1471
|
() => ({
|
|
1472
|
+
hitSlop: props.hitSlop,
|
|
1472
1473
|
onPress: (event: PressEvent) => {
|
|
1473
1474
|
if (props.editable !== false) {
|
|
1474
1475
|
if (inputRef.current != null) {
|
|
@@ -1483,6 +1484,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1483
1484
|
}),
|
|
1484
1485
|
[
|
|
1485
1486
|
props.editable,
|
|
1487
|
+
props.hitSlop,
|
|
1486
1488
|
props.onPressIn,
|
|
1487
1489
|
props.onPressOut,
|
|
1488
1490
|
props.rejectResponderTermination,
|
|
@@ -5,12 +5,20 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @format
|
|
8
|
-
* @
|
|
8
|
+
* @flow strict-local
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
const ToastAndroid = {
|
|
14
|
+
// Dummy fallback toast duration constants
|
|
15
|
+
SHORT: (0: number),
|
|
16
|
+
LONG: (0: number),
|
|
17
|
+
// Dummy fallback toast gravity constants
|
|
18
|
+
TOP: (0: number),
|
|
19
|
+
BOTTOM: (0: number),
|
|
20
|
+
CENTER: (0: number),
|
|
21
|
+
|
|
14
22
|
show: function (message: string, duration: number): void {
|
|
15
23
|
console.warn('ToastAndroid is not supported on this platform.');
|
|
16
24
|
},
|
|
@@ -5,12 +5,20 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @format
|
|
8
|
-
* @
|
|
8
|
+
* @flow strict-local
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
const ToastAndroid = {
|
|
14
|
+
// Dummy fallback toast duration constants
|
|
15
|
+
SHORT: (0: number),
|
|
16
|
+
LONG: (0: number),
|
|
17
|
+
// Dummy fallback toast gravity constants
|
|
18
|
+
TOP: (0: number),
|
|
19
|
+
BOTTOM: (0: number),
|
|
20
|
+
CENTER: (0: number),
|
|
21
|
+
|
|
14
22
|
show: function (message: string, duration: number): void {
|
|
15
23
|
console.warn('ToastAndroid is not supported on this platform.');
|
|
16
24
|
},
|
|
@@ -568,6 +568,15 @@ export type ViewProps = $ReadOnly<{|
|
|
|
568
568
|
*/
|
|
569
569
|
collapsable?: ?boolean,
|
|
570
570
|
|
|
571
|
+
/**
|
|
572
|
+
* Contols whether this view, and its transitive children, are laid in a way
|
|
573
|
+
* consistent with web browsers ('strict'), or consistent with existing
|
|
574
|
+
* React Native code which may rely on incorrect behavior ('classic').
|
|
575
|
+
*
|
|
576
|
+
* This prop only works when using Fabric.
|
|
577
|
+
*/
|
|
578
|
+
experimental_layoutConformance?: ?('strict' | 'classic'),
|
|
579
|
+
|
|
571
580
|
/**
|
|
572
581
|
* Used to locate this view from native classes. Has precedence over `nativeID` prop.
|
|
573
582
|
*
|
|
@@ -634,6 +634,15 @@ export type ViewProps = $ReadOnly<{|
|
|
|
634
634
|
*/
|
|
635
635
|
collapsable?: ?boolean,
|
|
636
636
|
|
|
637
|
+
/**
|
|
638
|
+
* Contols whether this view, and its transitive children, are laid in a way
|
|
639
|
+
* consistent with web browsers ('strict'), or consistent with existing
|
|
640
|
+
* React Native code which may rely on incorrect behavior ('classic').
|
|
641
|
+
*
|
|
642
|
+
* This prop only works when using Fabric.
|
|
643
|
+
*/
|
|
644
|
+
experimental_layoutConformance?: ?('strict' | 'classic'),
|
|
645
|
+
|
|
637
646
|
/**
|
|
638
647
|
* Used to locate this view from native classes. Has precedence over `nativeID` prop.
|
|
639
648
|
*
|
|
@@ -170,6 +170,34 @@ export default class ReadOnlyElement extends ReadOnlyNode {
|
|
|
170
170
|
getClientRects(): DOMRectList {
|
|
171
171
|
throw new TypeError('Unimplemented');
|
|
172
172
|
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Pointer Capture APIs
|
|
176
|
+
*/
|
|
177
|
+
hasPointerCapture(pointerId: number): boolean {
|
|
178
|
+
const node = getShadowNode(this);
|
|
179
|
+
if (node != null) {
|
|
180
|
+
return nullthrows(getFabricUIManager()).hasPointerCapture(
|
|
181
|
+
node,
|
|
182
|
+
pointerId,
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
setPointerCapture(pointerId: number): void {
|
|
189
|
+
const node = getShadowNode(this);
|
|
190
|
+
if (node != null) {
|
|
191
|
+
nullthrows(getFabricUIManager()).setPointerCapture(node, pointerId);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
releasePointerCapture(pointerId: number): void {
|
|
196
|
+
const node = getShadowNode(this);
|
|
197
|
+
if (node != null) {
|
|
198
|
+
nullthrows(getFabricUIManager()).releasePointerCapture(node, pointerId);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
173
201
|
}
|
|
174
202
|
|
|
175
203
|
function getChildElements(node: ReadOnlyNode): $ReadOnlyArray<ReadOnlyElement> {
|
|
@@ -112,7 +112,7 @@ export type ImageComponentStatics = $ReadOnly<{|
|
|
|
112
112
|
getSizeWithHeaders: typeof getSizeWithHeaders,
|
|
113
113
|
prefetch: typeof prefetch,
|
|
114
114
|
prefetchWithMetadata: typeof prefetchWithMetadata,
|
|
115
|
-
abortPrefetch
|
|
115
|
+
abortPrefetch?: typeof abortPrefetch,
|
|
116
116
|
queryCache: typeof queryCache,
|
|
117
117
|
resolveAssetSource: typeof resolveAssetSource,
|
|
118
118
|
|}>;
|
|
@@ -91,6 +91,7 @@ export type ImageComponentStatics = $ReadOnly<{|
|
|
|
91
91
|
getSizeWithHeaders: typeof getSizeWithHeaders,
|
|
92
92
|
prefetch: typeof prefetch,
|
|
93
93
|
prefetchWithMetadata: typeof prefetchWithMetadata,
|
|
94
|
+
abortPrefetch?: number => void,
|
|
94
95
|
queryCache: typeof queryCache,
|
|
95
96
|
resolveAssetSource: typeof resolveAssetSource,
|
|
96
97
|
|}>;
|
|
@@ -93,6 +93,7 @@ export type ImageComponentStatics = $ReadOnly<{|
|
|
|
93
93
|
getSizeWithHeaders: typeof getSizeWithHeaders,
|
|
94
94
|
prefetch: typeof prefetch,
|
|
95
95
|
prefetchWithMetadata: typeof prefetchWithMetadata,
|
|
96
|
+
abortPrefetch?: number => void,
|
|
96
97
|
queryCache: typeof queryCache,
|
|
97
98
|
resolveAssetSource: typeof resolveAssetSource,
|
|
98
99
|
|}>;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {RequestBody} from './convertRequestBody';
|
|
12
|
+
import type {NativeResponseType} from './XMLHttpRequest';
|
|
12
13
|
|
|
13
14
|
// Do not require the native RCTNetworking module directly! Use this wrapper module instead.
|
|
14
15
|
// It will add the necessary requestId, so that you don't have to generate it yourself.
|
|
@@ -54,7 +55,7 @@ class RCTNetworking extends NativeEventEmitter<$FlowFixMe> {
|
|
|
54
55
|
url: string,
|
|
55
56
|
headers: Object,
|
|
56
57
|
data: RequestBody,
|
|
57
|
-
responseType:
|
|
58
|
+
responseType: NativeResponseType,
|
|
58
59
|
incrementalUpdates: boolean,
|
|
59
60
|
timeout: number,
|
|
60
61
|
callback: (requestId: number) => mixed,
|
|
@@ -65,6 +65,8 @@ const PERMISSIONS = Object.freeze({
|
|
|
65
65
|
READ_MEDIA_IMAGES: 'android.permission.READ_MEDIA_IMAGES',
|
|
66
66
|
READ_MEDIA_VIDEO: 'android.permission.READ_MEDIA_VIDEO',
|
|
67
67
|
READ_MEDIA_AUDIO: 'android.permission.READ_MEDIA_AUDIO',
|
|
68
|
+
READ_MEDIA_VISUAL_USER_SELECTED:
|
|
69
|
+
'android.permission.READ_MEDIA_VISUAL_USER_SELECTED',
|
|
68
70
|
WRITE_EXTERNAL_STORAGE: 'android.permission.WRITE_EXTERNAL_STORAGE',
|
|
69
71
|
BLUETOOTH_CONNECT: 'android.permission.BLUETOOTH_CONNECT',
|
|
70
72
|
BLUETOOTH_SCAN: 'android.permission.BLUETOOTH_SCAN',
|
|
@@ -115,6 +117,7 @@ class PermissionsAndroid {
|
|
|
115
117
|
READ_MEDIA_IMAGES: string,
|
|
116
118
|
READ_MEDIA_VIDEO: string,
|
|
117
119
|
READ_MEDIA_AUDIO: string,
|
|
120
|
+
READ_MEDIA_VISUAL_USER_SELECTED: string,
|
|
118
121
|
READ_PHONE_NUMBERS: string,
|
|
119
122
|
READ_PHONE_STATE: string,
|
|
120
123
|
READ_SMS: string,
|
|
@@ -287,7 +290,6 @@ class PermissionsAndroid {
|
|
|
287
290
|
NativePermissionsAndroid,
|
|
288
291
|
'PermissionsAndroid is not installed correctly.',
|
|
289
292
|
);
|
|
290
|
-
|
|
291
293
|
return NativePermissionsAndroid.requestMultiplePermissions(permissions);
|
|
292
294
|
}
|
|
293
295
|
}
|
|
@@ -131,6 +131,12 @@ export type PressabilityConfig = $ReadOnly<{|
|
|
|
131
131
|
*/
|
|
132
132
|
onPressOut?: ?(event: PressEvent) => mixed,
|
|
133
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Whether to prevent any other native components from becoming responder
|
|
136
|
+
* while this pressable is responder.
|
|
137
|
+
*/
|
|
138
|
+
blockNativeResponder?: ?boolean,
|
|
139
|
+
|
|
134
140
|
/**
|
|
135
141
|
* Returns whether a long press gesture should cancel the press gesture.
|
|
136
142
|
* Defaults to true.
|
|
@@ -495,7 +501,7 @@ export default class Pressability {
|
|
|
495
501
|
this._handleLongPress(event);
|
|
496
502
|
}, delayLongPress + delayPressIn);
|
|
497
503
|
|
|
498
|
-
return this._config.
|
|
504
|
+
return this._config.blockNativeResponder === true;
|
|
499
505
|
},
|
|
500
506
|
|
|
501
507
|
onResponderMove: (event: PressEvent): void => {
|
|
@@ -142,6 +142,12 @@ export type PressabilityConfig = $ReadOnly<{|
|
|
|
142
142
|
*/
|
|
143
143
|
onPressOut?: ?(event: PressEvent) => mixed,
|
|
144
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Whether to prevent any other native components from becoming responder
|
|
147
|
+
* while this pressable is responder.
|
|
148
|
+
*/
|
|
149
|
+
blockNativeResponder?: ?boolean,
|
|
150
|
+
|
|
145
151
|
/**
|
|
146
152
|
* Returns whether a long press gesture should cancel the press gesture.
|
|
147
153
|
* Defaults to true.
|
|
@@ -528,7 +534,7 @@ export default class Pressability {
|
|
|
528
534
|
this._handleLongPress(event);
|
|
529
535
|
}, delayLongPress + delayPressIn);
|
|
530
536
|
|
|
531
|
-
return this._config.
|
|
537
|
+
return this._config.blockNativeResponder === true;
|
|
532
538
|
},
|
|
533
539
|
|
|
534
540
|
onResponderMove: (event: PressEvent): void => {
|
|
@@ -17,6 +17,8 @@ import {type EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
|
17
17
|
import {RootTagContext, createRootTag} from './RootTag';
|
|
18
18
|
import * as React from 'react';
|
|
19
19
|
|
|
20
|
+
const reactDevToolsHook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
21
|
+
|
|
20
22
|
type Props = $ReadOnly<{|
|
|
21
23
|
children?: React.Node,
|
|
22
24
|
fabric?: boolean,
|
|
@@ -45,9 +47,21 @@ class AppContainer extends React.Component<Props, State> {
|
|
|
45
47
|
};
|
|
46
48
|
_mainRef: ?React.ElementRef<typeof View>;
|
|
47
49
|
_subscription: ?EventSubscription = null;
|
|
50
|
+
_reactDevToolsAgentListener: ?() => void = null;
|
|
48
51
|
|
|
49
52
|
static getDerivedStateFromError: any = undefined;
|
|
50
53
|
|
|
54
|
+
mountReactDevToolsOverlays(): void {
|
|
55
|
+
const DevtoolsOverlay = require('../Inspector/DevtoolsOverlay').default;
|
|
56
|
+
const devtoolsOverlay = <DevtoolsOverlay inspectedView={this._mainRef} />;
|
|
57
|
+
|
|
58
|
+
const TraceUpdateOverlay =
|
|
59
|
+
require('../Components/TraceUpdateOverlay/TraceUpdateOverlay').default;
|
|
60
|
+
const traceUpdateOverlay = <TraceUpdateOverlay />;
|
|
61
|
+
|
|
62
|
+
this.setState({devtoolsOverlay, traceUpdateOverlay});
|
|
63
|
+
}
|
|
64
|
+
|
|
51
65
|
componentDidMount(): void {
|
|
52
66
|
if (__DEV__) {
|
|
53
67
|
if (!this.props.internal_excludeInspector) {
|
|
@@ -69,16 +83,21 @@ class AppContainer extends React.Component<Props, State> {
|
|
|
69
83
|
this.setState({inspector});
|
|
70
84
|
},
|
|
71
85
|
);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
86
|
+
|
|
87
|
+
if (reactDevToolsHook != null) {
|
|
88
|
+
if (reactDevToolsHook.reactDevtoolsAgent) {
|
|
89
|
+
// In case if this is not the first AppContainer rendered and React DevTools are already attached
|
|
90
|
+
this.mountReactDevToolsOverlays();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
this._reactDevToolsAgentListener = () =>
|
|
95
|
+
this.mountReactDevToolsOverlays();
|
|
96
|
+
|
|
97
|
+
reactDevToolsHook.on(
|
|
98
|
+
'react-devtools',
|
|
99
|
+
this._reactDevToolsAgentListener,
|
|
77
100
|
);
|
|
78
|
-
const TraceUpdateOverlay =
|
|
79
|
-
require('../Components/TraceUpdateOverlay/TraceUpdateOverlay').default;
|
|
80
|
-
const traceUpdateOverlay = <TraceUpdateOverlay />;
|
|
81
|
-
this.setState({devtoolsOverlay, traceUpdateOverlay});
|
|
82
101
|
}
|
|
83
102
|
}
|
|
84
103
|
}
|
|
@@ -88,6 +107,10 @@ class AppContainer extends React.Component<Props, State> {
|
|
|
88
107
|
if (this._subscription != null) {
|
|
89
108
|
this._subscription.remove();
|
|
90
109
|
}
|
|
110
|
+
|
|
111
|
+
if (reactDevToolsHook != null && this._reactDevToolsAgentListener != null) {
|
|
112
|
+
reactDevToolsHook.off('react-devtools', this._reactDevToolsAgentListener);
|
|
113
|
+
}
|
|
91
114
|
}
|
|
92
115
|
|
|
93
116
|
render(): React.Node {
|
|
@@ -91,6 +91,13 @@ export interface Spec {
|
|
|
91
91
|
+getScrollPosition: (
|
|
92
92
|
node: Node,
|
|
93
93
|
) => ?[/* scrollLeft: */ number, /* scrollTop: */ number];
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Support methods for the Pointer Capture APIs.
|
|
97
|
+
*/
|
|
98
|
+
+hasPointerCapture: (node: Node, pointerId: number) => boolean;
|
|
99
|
+
+setPointerCapture: (node: Node, pointerId: number) => void;
|
|
100
|
+
+releasePointerCapture: (node: Node, pointerId: number) => void;
|
|
94
101
|
}
|
|
95
102
|
|
|
96
103
|
let nativeFabricUIManagerProxy: ?Spec;
|
|
@@ -312,6 +312,9 @@ const FabricUIManagerMock: IFabricUIManagerMock = {
|
|
|
312
312
|
return [x, y, width, height];
|
|
313
313
|
},
|
|
314
314
|
),
|
|
315
|
+
hasPointerCapture: jest.fn((node: Node, pointerId: number): boolean => false),
|
|
316
|
+
setPointerCapture: jest.fn((node: Node, pointerId: number): void => {}),
|
|
317
|
+
releasePointerCapture: jest.fn((node: Node, pointerId: number): void => {}),
|
|
315
318
|
setNativeProps: jest.fn((node: Node, newProps: NodeProps): void => {}),
|
|
316
319
|
dispatchCommand: jest.fn(
|
|
317
320
|
(node: Node, commandName: string, args: Array<mixed>): void => {},
|
|
@@ -9,20 +9,25 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {ProcessedColorValue} from './processColor';
|
|
12
|
-
import type {ColorValue} from './StyleSheet';
|
|
12
|
+
import type {ColorValue, NativeColorValue} from './StyleSheet';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
/** The actual type of the opaque NativeColorValue on Android platform */
|
|
15
|
+
type LocalNativeColorValue = {
|
|
15
16
|
resource_paths?: Array<string>,
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
export const PlatformColor = (...names: Array<string>): ColorValue => {
|
|
19
|
-
return
|
|
20
|
+
/* $FlowExpectedError[incompatible-return]
|
|
21
|
+
* LocalNativeColorValue is the actual type of the opaque NativeColorValue on Android platform */
|
|
22
|
+
return ({resource_paths: names}: LocalNativeColorValue);
|
|
20
23
|
};
|
|
21
24
|
|
|
22
25
|
export const normalizeColorObject = (
|
|
23
26
|
color: NativeColorValue,
|
|
24
27
|
): ?ProcessedColorValue => {
|
|
25
|
-
|
|
28
|
+
/* $FlowExpectedError[incompatible-cast]
|
|
29
|
+
* LocalNativeColorValue is the actual type of the opaque NativeColorValue on Android platform */
|
|
30
|
+
if ('resource_paths' in (color: LocalNativeColorValue)) {
|
|
26
31
|
return color;
|
|
27
32
|
}
|
|
28
33
|
return null;
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {ProcessedColorValue} from './processColor';
|
|
12
|
-
import type {ColorValue} from './StyleSheet';
|
|
12
|
+
import type {ColorValue, NativeColorValue} from './StyleSheet';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
/** The actual type of the opaque NativeColorValue on iOS platform */
|
|
15
|
+
type LocalNativeColorValue = {
|
|
15
16
|
semantic?: Array<string>,
|
|
16
17
|
dynamic?: {
|
|
17
18
|
light: ?(ColorValue | ProcessedColorValue),
|
|
@@ -22,7 +23,8 @@ export opaque type NativeColorValue = {
|
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
export const PlatformColor = (...names: Array<string>): ColorValue => {
|
|
25
|
-
return
|
|
26
|
+
// $FlowExpectedError[incompatible-return] LocalNativeColorValue is the iOS LocalNativeColorValue type
|
|
27
|
+
return ({semantic: names}: LocalNativeColorValue);
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
export type DynamicColorIOSTuplePrivate = {
|
|
@@ -35,19 +37,21 @@ export type DynamicColorIOSTuplePrivate = {
|
|
|
35
37
|
export const DynamicColorIOSPrivate = (
|
|
36
38
|
tuple: DynamicColorIOSTuplePrivate,
|
|
37
39
|
): ColorValue => {
|
|
38
|
-
return {
|
|
40
|
+
return ({
|
|
39
41
|
dynamic: {
|
|
40
42
|
light: tuple.light,
|
|
41
43
|
dark: tuple.dark,
|
|
42
44
|
highContrastLight: tuple.highContrastLight,
|
|
43
45
|
highContrastDark: tuple.highContrastDark,
|
|
44
46
|
},
|
|
45
|
-
|
|
47
|
+
/* $FlowExpectedError[incompatible-return]
|
|
48
|
+
* LocalNativeColorValue is the actual type of the opaque NativeColorValue on iOS platform */
|
|
49
|
+
}: LocalNativeColorValue);
|
|
46
50
|
};
|
|
47
51
|
|
|
48
|
-
|
|
49
|
-
color:
|
|
50
|
-
): ?
|
|
52
|
+
const _normalizeColorObject = (
|
|
53
|
+
color: LocalNativeColorValue,
|
|
54
|
+
): ?LocalNativeColorValue => {
|
|
51
55
|
if ('semantic' in color) {
|
|
52
56
|
// an ios semantic color
|
|
53
57
|
return color;
|
|
@@ -56,7 +60,7 @@ export const normalizeColorObject = (
|
|
|
56
60
|
|
|
57
61
|
// a dynamic, appearance aware color
|
|
58
62
|
const dynamic = color.dynamic;
|
|
59
|
-
const dynamicColor:
|
|
63
|
+
const dynamicColor: LocalNativeColorValue = {
|
|
60
64
|
dynamic: {
|
|
61
65
|
// $FlowFixMe[incompatible-use]
|
|
62
66
|
light: normalizeColor(dynamic.light),
|
|
@@ -70,17 +74,22 @@ export const normalizeColorObject = (
|
|
|
70
74
|
};
|
|
71
75
|
return dynamicColor;
|
|
72
76
|
}
|
|
73
|
-
|
|
74
77
|
return null;
|
|
75
78
|
};
|
|
76
79
|
|
|
77
|
-
export const
|
|
80
|
+
export const normalizeColorObject: (
|
|
78
81
|
color: NativeColorValue,
|
|
79
|
-
|
|
82
|
+
/* $FlowExpectedError[incompatible-type]
|
|
83
|
+
* LocalNativeColorValue is the actual type of the opaque NativeColorValue on iOS platform */
|
|
84
|
+
) => ?ProcessedColorValue = _normalizeColorObject;
|
|
85
|
+
|
|
86
|
+
const _processColorObject = (
|
|
87
|
+
color: LocalNativeColorValue,
|
|
88
|
+
): ?LocalNativeColorValue => {
|
|
80
89
|
if ('dynamic' in color && color.dynamic != null) {
|
|
81
90
|
const processColor = require('./processColor').default;
|
|
82
91
|
const dynamic = color.dynamic;
|
|
83
|
-
const dynamicColor:
|
|
92
|
+
const dynamicColor: LocalNativeColorValue = {
|
|
84
93
|
dynamic: {
|
|
85
94
|
// $FlowFixMe[incompatible-use]
|
|
86
95
|
light: processColor(dynamic.light),
|
|
@@ -96,3 +105,9 @@ export const processColorObject = (
|
|
|
96
105
|
}
|
|
97
106
|
return color;
|
|
98
107
|
};
|
|
108
|
+
|
|
109
|
+
export const processColorObject: (
|
|
110
|
+
color: NativeColorValue,
|
|
111
|
+
/* $FlowExpectedError[incompatible-type]
|
|
112
|
+
* LocalNativeColorValue is the actual type of the opaque NativeColorValue on iOS platform */
|
|
113
|
+
) => ?NativeColorValue = _processColorObject;
|
|
@@ -10,21 +10,26 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
import type {ColorValue} from './StyleSheet';
|
|
13
|
+
import type {ColorValue, NativeColorValue} from './StyleSheet';
|
|
14
14
|
import type {ProcessedColorValue} from './processColor';
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
/** The actual type of the opaque NativeColorValue on Windows platform */
|
|
17
|
+
type LocalNativeColorValue = {
|
|
17
18
|
windowsbrush?: Array<string>,
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
export const PlatformColor = (...names: Array<string>): ColorValue => {
|
|
21
|
-
return
|
|
22
|
+
/* $FlowExpectedError[incompatible-return]
|
|
23
|
+
* LocalNativeColorValue is the actual type of the opaque NativeColorValue on Windows platform */
|
|
24
|
+
return ({windowsbrush: names}: LocalNativeColorValue);
|
|
22
25
|
};
|
|
23
26
|
|
|
24
27
|
export const normalizeColorObject = (
|
|
25
28
|
color: NativeColorValue,
|
|
26
29
|
): ?ProcessedColorValue => {
|
|
27
|
-
|
|
30
|
+
/* $FlowExpectedError[incompatible-cast]
|
|
31
|
+
* LocalNativeColorValue is the actual type of the opaque NativeColorValue on Windows platform */
|
|
32
|
+
if ('windowsbrush' in (color: LocalNativeColorValue)) {
|
|
28
33
|
return color;
|
|
29
34
|
}
|
|
30
35
|
return null;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import type {ColorValue} from './StyleSheet';
|
|
12
12
|
|
|
13
|
-
import {DynamicColorIOSPrivate} from './PlatformColorValueTypes';
|
|
13
|
+
import {DynamicColorIOSPrivate} from './PlatformColorValueTypes.ios';
|
|
14
14
|
|
|
15
15
|
export type DynamicColorIOSTuple = {
|
|
16
16
|
light: ColorValue,
|
|
@@ -27,6 +27,8 @@ const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleA
|
|
|
27
27
|
const PixelRatio = require('../Utilities/PixelRatio').default;
|
|
28
28
|
const flatten = require('./flattenStyle');
|
|
29
29
|
|
|
30
|
+
export type {NativeColorValue} from './StyleSheetTypes';
|
|
31
|
+
|
|
30
32
|
/**
|
|
31
33
|
* This type should be used as the type for anything that is a color. It is
|
|
32
34
|
* most useful when using DynamicColorIOS which can be a string or a dynamic
|