react-native-windows 0.0.0-canary.485 → 0.0.0-canary.488
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 +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +17 -20
- package/Libraries/Components/View/ViewPropTypes.js +24 -17
- package/Libraries/Components/View/ViewPropTypes.windows.js +24 -17
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/NativeComponent/PlatformBaseViewConfig.js +26 -0
- package/Libraries/StyleSheet/processTransform.windows.js +272 -0
- package/Libraries/Text/TextProps.js +9 -0
- package/Libraries/Utilities/Appearance.js +0 -8
- package/Libraries/Utilities/HMRClient.js +1 -1
- package/Microsoft.ReactNative/ReactRootView.cpp +2 -1
- package/Microsoft.ReactNative/RedBox.cpp +2 -1
- package/Microsoft.ReactNative/Utils/ValueUtils.cpp +2 -1
- package/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp +90 -18
- package/Microsoft.ReactNative.Cxx/CppWinRTIncludes.h +0 -2
- package/Microsoft.ReactNative.Cxx/XamlUtils.h +5 -0
- package/Mso/src/dispatchQueue/threadPoolScheduler_win.cpp +96 -4
- package/PropertySheets/Generated/PackageVersion.g.props +1 -1
- package/Shared/DevSupportManager.cpp +21 -25
- package/Shared/DevSupportManager.h +1 -2
- package/Shared/HermesRuntimeHolder.cpp +23 -14
- package/Shared/HermesRuntimeHolder.h +8 -2
- package/Shared/IDevSupportManager.h +1 -2
- package/Shared/JSI/RuntimeHolder.h +2 -0
- package/Shared/OInstance.cpp +3 -3
- package/Shared/Shared.vcxitems +0 -1
- package/Shared/Shared.vcxitems.filters +0 -3
- package/include/Shared/cdebug.h +9 -9
- package/jest/preprocessor_DO_NOT_USE.js +3 -3
- package/package.json +10 -10
- package/Shared/cdebug.cpp +0 -6
package/.flowconfig
CHANGED
|
@@ -46,20 +46,23 @@ function createInterpolation(
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
const outputRange: Array<number> = (config.outputRange: any);
|
|
49
|
-
checkInfiniteRange('outputRange', outputRange);
|
|
50
49
|
|
|
51
50
|
const inputRange = config.inputRange;
|
|
52
|
-
checkInfiniteRange('inputRange', inputRange);
|
|
53
|
-
checkValidInputRange(inputRange);
|
|
54
51
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
'inputRange
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
if (__DEV__) {
|
|
53
|
+
checkInfiniteRange('outputRange', outputRange);
|
|
54
|
+
checkInfiniteRange('inputRange', inputRange);
|
|
55
|
+
checkValidInputRange(inputRange);
|
|
56
|
+
|
|
57
|
+
invariant(
|
|
58
|
+
inputRange.length === outputRange.length,
|
|
59
|
+
'inputRange (' +
|
|
60
|
+
inputRange.length +
|
|
61
|
+
') and outputRange (' +
|
|
62
|
+
outputRange.length +
|
|
63
|
+
') must have the same length',
|
|
64
|
+
);
|
|
65
|
+
}
|
|
63
66
|
|
|
64
67
|
const easing = config.easing || linear;
|
|
65
68
|
|
|
@@ -276,16 +279,10 @@ function findRange(input: number, inputRange: $ReadOnlyArray<number>) {
|
|
|
276
279
|
|
|
277
280
|
function checkValidInputRange(arr: $ReadOnlyArray<number>) {
|
|
278
281
|
invariant(arr.length >= 2, 'inputRange must have at least 2 elements');
|
|
282
|
+
const message =
|
|
283
|
+
'inputRange must be monotonically non-decreasing ' + String(arr);
|
|
279
284
|
for (let i = 1; i < arr.length; ++i) {
|
|
280
|
-
invariant(
|
|
281
|
-
arr[i] >= arr[i - 1],
|
|
282
|
-
/* $FlowFixMe[incompatible-type] (>=0.13.0) - In the addition expression
|
|
283
|
-
* below this comment, one or both of the operands may be something that
|
|
284
|
-
* doesn't cleanly convert to a string, like undefined, null, and object,
|
|
285
|
-
* etc. If you really mean this implicit string conversion, you can do
|
|
286
|
-
* something like String(myThing) */
|
|
287
|
-
'inputRange must be monotonically non-decreasing ' + arr,
|
|
288
|
-
);
|
|
285
|
+
invariant(arr[i] >= arr[i - 1], message);
|
|
289
286
|
}
|
|
290
287
|
}
|
|
291
288
|
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
BlurEvent,
|
|
15
15
|
FocusEvent,
|
|
16
16
|
MouseEvent,
|
|
17
|
+
PointerEvent,
|
|
17
18
|
PressEvent,
|
|
18
19
|
Layout,
|
|
19
20
|
LayoutEvent,
|
|
@@ -84,8 +85,28 @@ type DirectEventProps = $ReadOnly<{|
|
|
|
84
85
|
|}>;
|
|
85
86
|
|
|
86
87
|
type MouseEventProps = $ReadOnly<{|
|
|
87
|
-
onMouseEnter?: (event: MouseEvent) => void,
|
|
88
|
-
onMouseLeave?: (event: MouseEvent) => void,
|
|
88
|
+
onMouseEnter?: ?(event: MouseEvent) => void,
|
|
89
|
+
onMouseLeave?: ?(event: MouseEvent) => void,
|
|
90
|
+
|}>;
|
|
91
|
+
|
|
92
|
+
type PointerEventProps = $ReadOnly<{|
|
|
93
|
+
onPointerEnter?: ?(event: PointerEvent) => void,
|
|
94
|
+
onPointerLeave?: ?(event: PointerEvent) => void,
|
|
95
|
+
onPointerMove?: ?(event: PointerEvent) => void,
|
|
96
|
+
onPointerCancel?: ?(e: PointerEvent) => void,
|
|
97
|
+
onPointerCancelCapture?: ?(e: PointerEvent) => void,
|
|
98
|
+
onPointerDown?: ?(e: PointerEvent) => void,
|
|
99
|
+
onPointerDownCapture?: ?(e: PointerEvent) => void,
|
|
100
|
+
onPointerUp?: ?(e: PointerEvent) => void,
|
|
101
|
+
onPointerUpCapture?: ?(e: PointerEvent) => void,
|
|
102
|
+
|
|
103
|
+
// FIXME: these events are temporary while we converge pointer event handling
|
|
104
|
+
onPointerEnter2?: ?(e: PointerEvent) => void,
|
|
105
|
+
onPointerEnter2Capture?: ?(e: PointerEvent) => void,
|
|
106
|
+
onPointerLeave2?: ?(e: PointerEvent) => void,
|
|
107
|
+
onPointerLeave2Capture?: ?(e: PointerEvent) => void,
|
|
108
|
+
onPointerMove2?: ?(e: PointerEvent) => void,
|
|
109
|
+
onPointerMove2Capture?: ?(e: PointerEvent) => void,
|
|
89
110
|
|}>;
|
|
90
111
|
|
|
91
112
|
type TouchEventProps = $ReadOnly<{|
|
|
@@ -99,20 +120,6 @@ type TouchEventProps = $ReadOnly<{|
|
|
|
99
120
|
onTouchStartCapture?: ?(e: PressEvent) => void,
|
|
100
121
|
|}>;
|
|
101
122
|
|
|
102
|
-
type PointerEventCallbackProps = $ReadOnly<{|
|
|
103
|
-
onPointerCancel?: ?(e: PointerEvent) => void,
|
|
104
|
-
onPointerCancelCapture?: ?(e: PointerEvent) => void,
|
|
105
|
-
onPointerDown?: ?(e: PointerEvent) => void,
|
|
106
|
-
onPointerDownCapture?: ?(e: PointerEvent) => void,
|
|
107
|
-
onPointerEnter2?: ?(e: PointerEvent) => void,
|
|
108
|
-
onPointerLeave2?: ?(e: PointerEvent) => void,
|
|
109
|
-
onPointerEnter2Capture?: ?(e: PointerEvent) => void,
|
|
110
|
-
onPointerLeave2Capture?: ?(e: PointerEvent) => void,
|
|
111
|
-
onPointerMove2Capture?: ?(e: PointerEvent) => void,
|
|
112
|
-
onPointerUp?: ?(e: PointerEvent) => void,
|
|
113
|
-
onPointerUpCapture?: ?(e: PointerEvent) => void,
|
|
114
|
-
|}>;
|
|
115
|
-
|
|
116
123
|
/**
|
|
117
124
|
* For most touch interactions, you'll simply want to wrap your component in
|
|
118
125
|
* `TouchableHighlight` or `TouchableOpacity`. Check out `Touchable.js`,
|
|
@@ -395,8 +402,8 @@ export type ViewProps = $ReadOnly<{|
|
|
|
395
402
|
...DirectEventProps,
|
|
396
403
|
...GestureResponderEventProps,
|
|
397
404
|
...MouseEventProps,
|
|
405
|
+
...PointerEventProps,
|
|
398
406
|
...TouchEventProps,
|
|
399
|
-
...PointerEventCallbackProps,
|
|
400
407
|
...AndroidViewProps,
|
|
401
408
|
...IOSViewProps,
|
|
402
409
|
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
BlurEvent,
|
|
15
15
|
FocusEvent,
|
|
16
16
|
MouseEvent,
|
|
17
|
+
PointerEvent,
|
|
17
18
|
PressEvent,
|
|
18
19
|
Layout,
|
|
19
20
|
LayoutEvent,
|
|
@@ -85,8 +86,28 @@ type DirectEventProps = $ReadOnly<{|
|
|
|
85
86
|
|}>;
|
|
86
87
|
|
|
87
88
|
type MouseEventProps = $ReadOnly<{|
|
|
88
|
-
onMouseEnter?: (event: MouseEvent) => void,
|
|
89
|
-
onMouseLeave?: (event: MouseEvent) => void,
|
|
89
|
+
onMouseEnter?: ?(event: MouseEvent) => void,
|
|
90
|
+
onMouseLeave?: ?(event: MouseEvent) => void,
|
|
91
|
+
|}>;
|
|
92
|
+
|
|
93
|
+
type PointerEventProps = $ReadOnly<{|
|
|
94
|
+
onPointerEnter?: ?(event: PointerEvent) => void,
|
|
95
|
+
onPointerLeave?: ?(event: PointerEvent) => void,
|
|
96
|
+
onPointerMove?: ?(event: PointerEvent) => void,
|
|
97
|
+
onPointerCancel?: ?(e: PointerEvent) => void,
|
|
98
|
+
onPointerCancelCapture?: ?(e: PointerEvent) => void,
|
|
99
|
+
onPointerDown?: ?(e: PointerEvent) => void,
|
|
100
|
+
onPointerDownCapture?: ?(e: PointerEvent) => void,
|
|
101
|
+
onPointerUp?: ?(e: PointerEvent) => void,
|
|
102
|
+
onPointerUpCapture?: ?(e: PointerEvent) => void,
|
|
103
|
+
|
|
104
|
+
// FIXME: these events are temporary while we converge pointer event handling
|
|
105
|
+
onPointerEnter2?: ?(e: PointerEvent) => void,
|
|
106
|
+
onPointerEnter2Capture?: ?(e: PointerEvent) => void,
|
|
107
|
+
onPointerLeave2?: ?(e: PointerEvent) => void,
|
|
108
|
+
onPointerLeave2Capture?: ?(e: PointerEvent) => void,
|
|
109
|
+
onPointerMove2?: ?(e: PointerEvent) => void,
|
|
110
|
+
onPointerMove2Capture?: ?(e: PointerEvent) => void,
|
|
90
111
|
|}>;
|
|
91
112
|
|
|
92
113
|
type TouchEventProps = $ReadOnly<{|
|
|
@@ -100,20 +121,6 @@ type TouchEventProps = $ReadOnly<{|
|
|
|
100
121
|
onTouchStartCapture?: ?(e: PressEvent) => void,
|
|
101
122
|
|}>;
|
|
102
123
|
|
|
103
|
-
type PointerEventCallbackProps = $ReadOnly<{|
|
|
104
|
-
onPointerCancel?: ?(e: PointerEvent) => void,
|
|
105
|
-
onPointerCancelCapture?: ?(e: PointerEvent) => void,
|
|
106
|
-
onPointerDown?: ?(e: PointerEvent) => void,
|
|
107
|
-
onPointerDownCapture?: ?(e: PointerEvent) => void,
|
|
108
|
-
onPointerEnter2?: ?(e: PointerEvent) => void,
|
|
109
|
-
onPointerLeave2?: ?(e: PointerEvent) => void,
|
|
110
|
-
onPointerEnter2Capture?: ?(e: PointerEvent) => void,
|
|
111
|
-
onPointerLeave2Capture?: ?(e: PointerEvent) => void,
|
|
112
|
-
onPointerMove2Capture?: ?(e: PointerEvent) => void,
|
|
113
|
-
onPointerUp?: ?(e: PointerEvent) => void,
|
|
114
|
-
onPointerUpCapture?: ?(e: PointerEvent) => void,
|
|
115
|
-
|}>;
|
|
116
|
-
|
|
117
124
|
/**
|
|
118
125
|
* For most touch interactions, you'll simply want to wrap your component in
|
|
119
126
|
* `TouchableHighlight` or `TouchableOpacity`. Check out `Touchable.js`,
|
|
@@ -443,8 +450,8 @@ export type ViewProps = $ReadOnly<{|
|
|
|
443
450
|
...DirectEventProps,
|
|
444
451
|
...GestureResponderEventProps,
|
|
445
452
|
...MouseEventProps,
|
|
453
|
+
...PointerEventProps,
|
|
446
454
|
...TouchEventProps,
|
|
447
|
-
...PointerEventCallbackProps,
|
|
448
455
|
...AndroidViewProps,
|
|
449
456
|
...IOSViewProps,
|
|
450
457
|
...WindowsViewProps, // [Windows]
|
|
@@ -363,6 +363,32 @@ const PlatformBaseViewConfig: PartialViewConfigWithoutName =
|
|
|
363
363
|
captured: 'onTouchEndCapture',
|
|
364
364
|
},
|
|
365
365
|
},
|
|
366
|
+
|
|
367
|
+
// Pointer Events
|
|
368
|
+
topPointerCancel: {
|
|
369
|
+
phasedRegistrationNames: {
|
|
370
|
+
captured: 'onPointerCancelCapture',
|
|
371
|
+
bubbled: 'onPointerCancel',
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
topPointerDown: {
|
|
375
|
+
phasedRegistrationNames: {
|
|
376
|
+
captured: 'onPointerDownCapture',
|
|
377
|
+
bubbled: 'onPointerDown',
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
topPointerMove2: {
|
|
381
|
+
phasedRegistrationNames: {
|
|
382
|
+
captured: 'onPointerMove2Capture',
|
|
383
|
+
bubbled: 'onPointerMove2',
|
|
384
|
+
},
|
|
385
|
+
},
|
|
386
|
+
topPointerUp: {
|
|
387
|
+
phasedRegistrationNames: {
|
|
388
|
+
captured: 'onPointerUpCapture',
|
|
389
|
+
bubbled: 'onPointerUp',
|
|
390
|
+
},
|
|
391
|
+
},
|
|
366
392
|
},
|
|
367
393
|
directEventTypes: {
|
|
368
394
|
topAccessibilityAction: {
|
|
@@ -0,0 +1,272 @@
|
|
|
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
|
+
* @format
|
|
8
|
+
* @flow
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
const MatrixMath = require('../Utilities/MatrixMath');
|
|
14
|
+
const Platform = require('../Utilities/Platform');
|
|
15
|
+
|
|
16
|
+
const invariant = require('invariant');
|
|
17
|
+
const stringifySafe = require('../Utilities/stringifySafe').default;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Generate a transform matrix based on the provided transforms, and use that
|
|
21
|
+
* within the style object instead.
|
|
22
|
+
*
|
|
23
|
+
* This allows us to provide an API that is similar to CSS, where transforms may
|
|
24
|
+
* be applied in an arbitrary order, and yet have a universal, singular
|
|
25
|
+
* interface to native code.
|
|
26
|
+
*/
|
|
27
|
+
function processTransform(
|
|
28
|
+
transform: Array<Object>,
|
|
29
|
+
): Array<Object> | Array<number> {
|
|
30
|
+
if (__DEV__) {
|
|
31
|
+
_validateTransforms(transform);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Android & iOS implementations of transform property accept the list of
|
|
35
|
+
// transform properties as opposed to a transform Matrix. This is necessary
|
|
36
|
+
// to control transform property updates completely on the native thread.
|
|
37
|
+
if (
|
|
38
|
+
Platform.OS === 'android' ||
|
|
39
|
+
Platform.OS === 'ios' ||
|
|
40
|
+
Platform.OS === 'windows'
|
|
41
|
+
) {
|
|
42
|
+
return transform;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const result = MatrixMath.createIdentityMatrix();
|
|
46
|
+
|
|
47
|
+
transform.forEach((transformation) => {
|
|
48
|
+
const key = Object.keys(transformation)[0];
|
|
49
|
+
const value = transformation[key];
|
|
50
|
+
|
|
51
|
+
switch (key) {
|
|
52
|
+
case 'matrix':
|
|
53
|
+
MatrixMath.multiplyInto(result, result, value);
|
|
54
|
+
break;
|
|
55
|
+
case 'perspective':
|
|
56
|
+
_multiplyTransform(result, MatrixMath.reusePerspectiveCommand, [value]);
|
|
57
|
+
break;
|
|
58
|
+
case 'rotateX':
|
|
59
|
+
_multiplyTransform(result, MatrixMath.reuseRotateXCommand, [
|
|
60
|
+
_convertToRadians(value),
|
|
61
|
+
]);
|
|
62
|
+
break;
|
|
63
|
+
case 'rotateY':
|
|
64
|
+
_multiplyTransform(result, MatrixMath.reuseRotateYCommand, [
|
|
65
|
+
_convertToRadians(value),
|
|
66
|
+
]);
|
|
67
|
+
break;
|
|
68
|
+
case 'rotate':
|
|
69
|
+
case 'rotateZ':
|
|
70
|
+
_multiplyTransform(result, MatrixMath.reuseRotateZCommand, [
|
|
71
|
+
_convertToRadians(value),
|
|
72
|
+
]);
|
|
73
|
+
break;
|
|
74
|
+
case 'scale':
|
|
75
|
+
_multiplyTransform(result, MatrixMath.reuseScaleCommand, [value]);
|
|
76
|
+
break;
|
|
77
|
+
case 'scaleX':
|
|
78
|
+
_multiplyTransform(result, MatrixMath.reuseScaleXCommand, [value]);
|
|
79
|
+
break;
|
|
80
|
+
case 'scaleY':
|
|
81
|
+
_multiplyTransform(result, MatrixMath.reuseScaleYCommand, [value]);
|
|
82
|
+
break;
|
|
83
|
+
case 'translate':
|
|
84
|
+
_multiplyTransform(result, MatrixMath.reuseTranslate3dCommand, [
|
|
85
|
+
value[0],
|
|
86
|
+
value[1],
|
|
87
|
+
value[2] || 0,
|
|
88
|
+
]);
|
|
89
|
+
break;
|
|
90
|
+
case 'translateX':
|
|
91
|
+
_multiplyTransform(result, MatrixMath.reuseTranslate2dCommand, [
|
|
92
|
+
value,
|
|
93
|
+
0,
|
|
94
|
+
]);
|
|
95
|
+
break;
|
|
96
|
+
case 'translateY':
|
|
97
|
+
_multiplyTransform(result, MatrixMath.reuseTranslate2dCommand, [
|
|
98
|
+
0,
|
|
99
|
+
value,
|
|
100
|
+
]);
|
|
101
|
+
break;
|
|
102
|
+
case 'skewX':
|
|
103
|
+
_multiplyTransform(result, MatrixMath.reuseSkewXCommand, [
|
|
104
|
+
_convertToRadians(value),
|
|
105
|
+
]);
|
|
106
|
+
break;
|
|
107
|
+
case 'skewY':
|
|
108
|
+
_multiplyTransform(result, MatrixMath.reuseSkewYCommand, [
|
|
109
|
+
_convertToRadians(value),
|
|
110
|
+
]);
|
|
111
|
+
break;
|
|
112
|
+
default:
|
|
113
|
+
throw new Error('Invalid transform name: ' + key);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Performs a destructive operation on a transform matrix.
|
|
122
|
+
*/
|
|
123
|
+
function _multiplyTransform(
|
|
124
|
+
result: Array<number>,
|
|
125
|
+
matrixMathFunction: Function,
|
|
126
|
+
args: Array<number>,
|
|
127
|
+
): void {
|
|
128
|
+
const matrixToApply = MatrixMath.createIdentityMatrix();
|
|
129
|
+
const argsWithIdentity = [matrixToApply].concat(args);
|
|
130
|
+
matrixMathFunction.apply(this, argsWithIdentity);
|
|
131
|
+
MatrixMath.multiplyInto(result, result, matrixToApply);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Parses a string like '0.5rad' or '60deg' into radians expressed in a float.
|
|
136
|
+
* Note that validation on the string is done in `_validateTransform()`.
|
|
137
|
+
*/
|
|
138
|
+
function _convertToRadians(value: string): number {
|
|
139
|
+
const floatValue = parseFloat(value);
|
|
140
|
+
return value.indexOf('rad') > -1 ? floatValue : (floatValue * Math.PI) / 180;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function _validateTransforms(transform: Array<Object>): void {
|
|
144
|
+
transform.forEach((transformation) => {
|
|
145
|
+
const keys = Object.keys(transformation);
|
|
146
|
+
invariant(
|
|
147
|
+
keys.length === 1,
|
|
148
|
+
'You must specify exactly one property per transform object. Passed properties: %s',
|
|
149
|
+
stringifySafe(transformation),
|
|
150
|
+
);
|
|
151
|
+
const key = keys[0];
|
|
152
|
+
const value = transformation[key];
|
|
153
|
+
_validateTransform(key, value, transformation);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function _validateTransform(
|
|
158
|
+
key:
|
|
159
|
+
| string
|
|
160
|
+
| $TEMPORARY$string<'matrix'>
|
|
161
|
+
| $TEMPORARY$string<'perspective'>
|
|
162
|
+
| $TEMPORARY$string<'rotate'>
|
|
163
|
+
| $TEMPORARY$string<'rotateX'>
|
|
164
|
+
| $TEMPORARY$string<'rotateY'>
|
|
165
|
+
| $TEMPORARY$string<'rotateZ'>
|
|
166
|
+
| $TEMPORARY$string<'scale'>
|
|
167
|
+
| $TEMPORARY$string<'scaleX'>
|
|
168
|
+
| $TEMPORARY$string<'scaleY'>
|
|
169
|
+
| $TEMPORARY$string<'skewX'>
|
|
170
|
+
| $TEMPORARY$string<'skewY'>
|
|
171
|
+
| $TEMPORARY$string<'translate'>
|
|
172
|
+
| $TEMPORARY$string<'translateX'>
|
|
173
|
+
| $TEMPORARY$string<'translateY'>,
|
|
174
|
+
value: any | number | string,
|
|
175
|
+
transformation: any,
|
|
176
|
+
) {
|
|
177
|
+
invariant(
|
|
178
|
+
!value.getValue,
|
|
179
|
+
'You passed an Animated.Value to a normal component. ' +
|
|
180
|
+
'You need to wrap that component in an Animated. For example, ' +
|
|
181
|
+
'replace <View /> by <Animated.View />.',
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
const multivalueTransforms = ['matrix', 'translate'];
|
|
185
|
+
if (multivalueTransforms.indexOf(key) !== -1) {
|
|
186
|
+
invariant(
|
|
187
|
+
Array.isArray(value),
|
|
188
|
+
'Transform with key of %s must have an array as the value: %s',
|
|
189
|
+
key,
|
|
190
|
+
stringifySafe(transformation),
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
switch (key) {
|
|
194
|
+
case 'matrix':
|
|
195
|
+
invariant(
|
|
196
|
+
value.length === 9 || value.length === 16,
|
|
197
|
+
'Matrix transform must have a length of 9 (2d) or 16 (3d). ' +
|
|
198
|
+
'Provided matrix has a length of %s: %s',
|
|
199
|
+
/* $FlowFixMe[prop-missing] (>=0.84.0 site=react_native_fb) This
|
|
200
|
+
* comment suppresses an error found when Flow v0.84 was deployed. To
|
|
201
|
+
* see the error, delete this comment and run Flow. */
|
|
202
|
+
value.length,
|
|
203
|
+
stringifySafe(transformation),
|
|
204
|
+
);
|
|
205
|
+
break;
|
|
206
|
+
case 'translate':
|
|
207
|
+
invariant(
|
|
208
|
+
value.length === 2 || value.length === 3,
|
|
209
|
+
'Transform with key translate must be an array of length 2 or 3, found %s: %s',
|
|
210
|
+
/* $FlowFixMe[prop-missing] (>=0.84.0 site=react_native_fb) This
|
|
211
|
+
* comment suppresses an error found when Flow v0.84 was deployed. To
|
|
212
|
+
* see the error, delete this comment and run Flow. */
|
|
213
|
+
value.length,
|
|
214
|
+
stringifySafe(transformation),
|
|
215
|
+
);
|
|
216
|
+
break;
|
|
217
|
+
case 'rotateX':
|
|
218
|
+
case 'rotateY':
|
|
219
|
+
case 'rotateZ':
|
|
220
|
+
case 'rotate':
|
|
221
|
+
case 'skewX':
|
|
222
|
+
case 'skewY':
|
|
223
|
+
invariant(
|
|
224
|
+
typeof value === 'string',
|
|
225
|
+
'Transform with key of "%s" must be a string: %s',
|
|
226
|
+
key,
|
|
227
|
+
stringifySafe(transformation),
|
|
228
|
+
);
|
|
229
|
+
invariant(
|
|
230
|
+
value.indexOf('deg') > -1 || value.indexOf('rad') > -1,
|
|
231
|
+
'Rotate transform must be expressed in degrees (deg) or radians ' +
|
|
232
|
+
'(rad): %s',
|
|
233
|
+
stringifySafe(transformation),
|
|
234
|
+
);
|
|
235
|
+
break;
|
|
236
|
+
case 'perspective':
|
|
237
|
+
invariant(
|
|
238
|
+
typeof value === 'number',
|
|
239
|
+
'Transform with key of "%s" must be a number: %s',
|
|
240
|
+
key,
|
|
241
|
+
stringifySafe(transformation),
|
|
242
|
+
);
|
|
243
|
+
invariant(
|
|
244
|
+
value !== 0,
|
|
245
|
+
'Transform with key of "%s" cannot be zero: %s',
|
|
246
|
+
key,
|
|
247
|
+
stringifySafe(transformation),
|
|
248
|
+
);
|
|
249
|
+
break;
|
|
250
|
+
case 'translateX':
|
|
251
|
+
case 'translateY':
|
|
252
|
+
case 'scale':
|
|
253
|
+
case 'scaleX':
|
|
254
|
+
case 'scaleY':
|
|
255
|
+
invariant(
|
|
256
|
+
typeof value === 'number',
|
|
257
|
+
'Transform with key of "%s" must be a number: %s',
|
|
258
|
+
key,
|
|
259
|
+
stringifySafe(transformation),
|
|
260
|
+
);
|
|
261
|
+
break;
|
|
262
|
+
default:
|
|
263
|
+
invariant(
|
|
264
|
+
false,
|
|
265
|
+
'Invalid transform %s: %s',
|
|
266
|
+
key,
|
|
267
|
+
stringifySafe(transformation),
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
module.exports = processTransform;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import type {
|
|
14
14
|
LayoutEvent,
|
|
15
|
+
PointerEvent,
|
|
15
16
|
PressEvent,
|
|
16
17
|
TextLayoutEvent,
|
|
17
18
|
} from '../Types/CoreEventTypes';
|
|
@@ -31,10 +32,18 @@ export type PressRetentionOffset = $ReadOnly<{|
|
|
|
31
32
|
right: number,
|
|
32
33
|
|}>;
|
|
33
34
|
|
|
35
|
+
type PointerEventProps = $ReadOnly<{|
|
|
36
|
+
onPointerEnter?: (event: PointerEvent) => void,
|
|
37
|
+
onPointerLeave?: (event: PointerEvent) => void,
|
|
38
|
+
onPointerMove?: (event: PointerEvent) => void,
|
|
39
|
+
|}>;
|
|
40
|
+
|
|
34
41
|
/**
|
|
35
42
|
* @see https://reactnative.dev/docs/text#reference
|
|
36
43
|
*/
|
|
37
44
|
export type TextProps = $ReadOnly<{|
|
|
45
|
+
...PointerEventProps,
|
|
46
|
+
|
|
38
47
|
/**
|
|
39
48
|
* Indicates whether the view is an accessibility element.
|
|
40
49
|
*
|
|
@@ -91,12 +91,4 @@ module.exports = {
|
|
|
91
91
|
addChangeListener(listener: AppearanceListener): EventSubscription {
|
|
92
92
|
return eventEmitter.addListener('change', listener);
|
|
93
93
|
},
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* @deprecated Use `remove` on the EventSubscription from `addEventListener`.
|
|
97
|
-
*/
|
|
98
|
-
removeChangeListener(listener: AppearanceListener): void {
|
|
99
|
-
// NOTE: This will report a deprecation notice via `console.error`.
|
|
100
|
-
eventEmitter.removeListener('change', listener);
|
|
101
|
-
},
|
|
102
94
|
};
|
|
@@ -292,7 +292,7 @@ function registerBundleEntryPoints(client) {
|
|
|
292
292
|
|
|
293
293
|
function flushEarlyLogs(client) {
|
|
294
294
|
try {
|
|
295
|
-
pendingLogs.forEach(([level
|
|
295
|
+
pendingLogs.forEach(([level, data]) => {
|
|
296
296
|
HMRClient.log(level, data);
|
|
297
297
|
});
|
|
298
298
|
} finally {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
#include <winrt/Windows.UI.Core.h>
|
|
14
14
|
#include "ReactNativeHost.h"
|
|
15
15
|
#include "ReactViewInstance.h"
|
|
16
|
+
#include "XamlUtils.h"
|
|
16
17
|
|
|
17
18
|
#include <winrt/Microsoft.UI.Xaml.Controls.h>
|
|
18
19
|
|
|
@@ -269,7 +270,7 @@ void ReactRootView::EnsureLoadingUI() noexcept {
|
|
|
269
270
|
m_greenBoxGrid.ColumnDefinitions().Append(c);
|
|
270
271
|
|
|
271
272
|
m_waitingTextBlock.SetValue(xaml::Controls::Grid::ColumnProperty(), winrt::box_value(1));
|
|
272
|
-
m_greenBoxGrid.Background(xaml::Media::SolidColorBrush(
|
|
273
|
+
m_greenBoxGrid.Background(xaml::Media::SolidColorBrush(xaml::FromArgb(0x80, 0x03, 0x29, 0x29)));
|
|
273
274
|
m_greenBoxGrid.Children().Append(m_waitingTextBlock);
|
|
274
275
|
m_greenBoxGrid.VerticalAlignment(xaml::VerticalAlignment::Center);
|
|
275
276
|
Microsoft::UI::Xaml::Controls::ProgressRing ring{};
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
#include <winrt/Windows.Web.Http.h>
|
|
28
28
|
#include "CppWinRTIncludes.h"
|
|
29
29
|
#include "Utils/Helpers.h"
|
|
30
|
+
#include "XamlUtils.h"
|
|
30
31
|
#endif
|
|
31
32
|
|
|
32
33
|
using namespace winrt::Windows::Foundation;
|
|
@@ -274,7 +275,7 @@ struct RedBox : public std::enable_shared_from_this<RedBox> {
|
|
|
274
275
|
xaml::Documents::Run linkRun;
|
|
275
276
|
|
|
276
277
|
linkRun.Text(Microsoft::Common::Unicode::Utf8ToUtf16(METRO_TROUBLESHOOTING_URL));
|
|
277
|
-
link.Foreground(xaml::Media::SolidColorBrush(
|
|
278
|
+
link.Foreground(xaml::Media::SolidColorBrush(xaml::FromArgb(0xff, 0xff, 0xff, 0xff)));
|
|
278
279
|
link.Inlines().Append(linkRun);
|
|
279
280
|
xaml::Documents::Run normalRun;
|
|
280
281
|
normalRun.Text(Microsoft::Common::Unicode::Utf8ToUtf16(json["type"].asString() + (" ─ See ")));
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#include <Utils/ValueUtils.h>
|
|
10
10
|
#include <winrt/Windows.UI.ViewManagement.h>
|
|
11
11
|
#include "Unicode.h"
|
|
12
|
+
#include "XamlUtils.h"
|
|
12
13
|
|
|
13
14
|
#include <JSValue.h>
|
|
14
15
|
#include <folly/dynamic.h>
|
|
@@ -157,7 +158,7 @@ xaml::Media::Brush BrushFromColorObject(const winrt::Microsoft::ReactNative::JSV
|
|
|
157
158
|
}
|
|
158
159
|
|
|
159
160
|
winrt::Color ColorFromNumber(DWORD argb) noexcept {
|
|
160
|
-
return
|
|
161
|
+
return xaml::FromArgb(GetAFromArgb(argb), GetRFromArgb(argb), GetGFromArgb(argb), GetBFromArgb(argb));
|
|
161
162
|
}
|
|
162
163
|
|
|
163
164
|
REACTWINDOWS_API_(winrt::Color) ColorFrom(const folly::dynamic &d) {
|