@office-iss/react-native-win32 0.67.0-preview.2 → 0.67.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 +5 -0
- package/CHANGELOG.json +108 -0
- package/CHANGELOG.md +56 -5
- package/Libraries/Components/Keyboard/Keyboard.js +2 -2
- package/Libraries/Components/Pressable/Pressable.win32.js +384 -0
- package/Libraries/Components/View/View.win32.js +58 -2
- package/Libraries/Components/View/ViewPropTypes.win32.js +546 -0
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Pressability/HoverState.win32.js +60 -0
- package/Libraries/Pressability/Pressability.win32.js +962 -0
- package/Libraries/Types/CoreEventTypes.win32.js +191 -0
- package/jest/preprocessor.js +7 -75
- package/overrides.json +36 -1
- package/package.json +6 -6
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its 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
|
+
import * as React from 'react';
|
|
12
|
+
import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
|
|
13
|
+
|
|
14
|
+
export type SyntheticEvent<T> = $ReadOnly<{|
|
|
15
|
+
bubbles: ?boolean,
|
|
16
|
+
cancelable: ?boolean,
|
|
17
|
+
currentTarget: number | React.ElementRef<HostComponent<mixed>>,
|
|
18
|
+
defaultPrevented: ?boolean,
|
|
19
|
+
dispatchConfig: $ReadOnly<{|
|
|
20
|
+
registrationName: string,
|
|
21
|
+
|}>,
|
|
22
|
+
eventPhase: ?number,
|
|
23
|
+
preventDefault: () => void,
|
|
24
|
+
isDefaultPrevented: () => boolean,
|
|
25
|
+
stopPropagation: () => void,
|
|
26
|
+
isPropagationStopped: () => boolean,
|
|
27
|
+
isTrusted: ?boolean,
|
|
28
|
+
nativeEvent: T,
|
|
29
|
+
persist: () => void,
|
|
30
|
+
target: ?number | React.ElementRef<HostComponent<mixed>>,
|
|
31
|
+
timeStamp: number,
|
|
32
|
+
type: ?string,
|
|
33
|
+
|}>;
|
|
34
|
+
|
|
35
|
+
export type ResponderSyntheticEvent<T> = $ReadOnly<{|
|
|
36
|
+
...SyntheticEvent<T>,
|
|
37
|
+
touchHistory: $ReadOnly<{|
|
|
38
|
+
indexOfSingleActiveTouch: number,
|
|
39
|
+
mostRecentTimeStamp: number,
|
|
40
|
+
numberActiveTouches: number,
|
|
41
|
+
touchBank: $ReadOnlyArray<
|
|
42
|
+
$ReadOnly<{|
|
|
43
|
+
touchActive: boolean,
|
|
44
|
+
startPageX: number,
|
|
45
|
+
startPageY: number,
|
|
46
|
+
startTimeStamp: number,
|
|
47
|
+
currentPageX: number,
|
|
48
|
+
currentPageY: number,
|
|
49
|
+
currentTimeStamp: number,
|
|
50
|
+
previousPageX: number,
|
|
51
|
+
previousPageY: number,
|
|
52
|
+
previousTimeStamp: number,
|
|
53
|
+
|}>,
|
|
54
|
+
>,
|
|
55
|
+
|}>,
|
|
56
|
+
|}>;
|
|
57
|
+
|
|
58
|
+
export type Layout = $ReadOnly<{|
|
|
59
|
+
x: number,
|
|
60
|
+
y: number,
|
|
61
|
+
width: number,
|
|
62
|
+
height: number,
|
|
63
|
+
|}>;
|
|
64
|
+
|
|
65
|
+
export type TextLayout = $ReadOnly<{|
|
|
66
|
+
...Layout,
|
|
67
|
+
ascender: number,
|
|
68
|
+
capHeight: number,
|
|
69
|
+
descender: number,
|
|
70
|
+
text: string,
|
|
71
|
+
xHeight: number,
|
|
72
|
+
|}>;
|
|
73
|
+
|
|
74
|
+
export type LayoutEvent = SyntheticEvent<
|
|
75
|
+
$ReadOnly<{|
|
|
76
|
+
layout: Layout,
|
|
77
|
+
|}>,
|
|
78
|
+
>;
|
|
79
|
+
|
|
80
|
+
export type TextLayoutEvent = SyntheticEvent<
|
|
81
|
+
$ReadOnly<{|
|
|
82
|
+
lines: Array<TextLayout>,
|
|
83
|
+
|}>,
|
|
84
|
+
>;
|
|
85
|
+
|
|
86
|
+
export type PressEvent = ResponderSyntheticEvent<
|
|
87
|
+
$ReadOnly<{|
|
|
88
|
+
altKey: ?boolean, // TODO(macOS)
|
|
89
|
+
button: ?number, // TODO(macOS)
|
|
90
|
+
changedTouches: $ReadOnlyArray<$PropertyType<PressEvent, 'nativeEvent'>>,
|
|
91
|
+
ctrlKey: ?boolean, // TODO(macOS)
|
|
92
|
+
force?: number,
|
|
93
|
+
identifier: number,
|
|
94
|
+
locationX: number,
|
|
95
|
+
locationY: number,
|
|
96
|
+
metaKey: ?boolean, // TODO(macOS)
|
|
97
|
+
pageX: number,
|
|
98
|
+
pageY: number,
|
|
99
|
+
shiftKey: ?boolean, // TODO(macOS)
|
|
100
|
+
target: ?number,
|
|
101
|
+
timestamp: number,
|
|
102
|
+
touches: $ReadOnlyArray<$PropertyType<PressEvent, 'nativeEvent'>>,
|
|
103
|
+
|}>,
|
|
104
|
+
>;
|
|
105
|
+
|
|
106
|
+
export type ScrollEvent = SyntheticEvent<
|
|
107
|
+
$ReadOnly<{|
|
|
108
|
+
contentInset: $ReadOnly<{|
|
|
109
|
+
bottom: number,
|
|
110
|
+
left: number,
|
|
111
|
+
right: number,
|
|
112
|
+
top: number,
|
|
113
|
+
|}>,
|
|
114
|
+
contentOffset: $ReadOnly<{|
|
|
115
|
+
y: number,
|
|
116
|
+
x: number,
|
|
117
|
+
|}>,
|
|
118
|
+
contentSize: $ReadOnly<{|
|
|
119
|
+
height: number,
|
|
120
|
+
width: number,
|
|
121
|
+
|}>,
|
|
122
|
+
layoutMeasurement: $ReadOnly<{|
|
|
123
|
+
height: number,
|
|
124
|
+
width: number,
|
|
125
|
+
|}>,
|
|
126
|
+
targetContentOffset?: $ReadOnly<{|
|
|
127
|
+
y: number,
|
|
128
|
+
x: number,
|
|
129
|
+
|}>,
|
|
130
|
+
velocity?: $ReadOnly<{|
|
|
131
|
+
y: number,
|
|
132
|
+
x: number,
|
|
133
|
+
|}>,
|
|
134
|
+
zoomScale?: number,
|
|
135
|
+
responderIgnoreScroll?: boolean,
|
|
136
|
+
key?: string, // TODO(macOS)
|
|
137
|
+
|}>,
|
|
138
|
+
>;
|
|
139
|
+
|
|
140
|
+
export type BlurEvent = SyntheticEvent<
|
|
141
|
+
$ReadOnly<{|
|
|
142
|
+
target: number,
|
|
143
|
+
|}>,
|
|
144
|
+
>;
|
|
145
|
+
|
|
146
|
+
export type FocusEvent = SyntheticEvent<
|
|
147
|
+
$ReadOnly<{|
|
|
148
|
+
target: number,
|
|
149
|
+
|}>,
|
|
150
|
+
>;
|
|
151
|
+
|
|
152
|
+
// [Windows Mouse events on Windows don't match up with the version in core
|
|
153
|
+
// introduced for react-native-web. Replace typings with our values to catch
|
|
154
|
+
// anything dependent on react-native-web specific values
|
|
155
|
+
export type MouseEvent = SyntheticEvent<
|
|
156
|
+
$ReadOnly<{|
|
|
157
|
+
target: number,
|
|
158
|
+
identifier: number,
|
|
159
|
+
pageX: number,
|
|
160
|
+
pageY: number,
|
|
161
|
+
locationX: number,
|
|
162
|
+
locationY: number,
|
|
163
|
+
timestamp: number,
|
|
164
|
+
pointerType: string,
|
|
165
|
+
force: number,
|
|
166
|
+
isLeftButton: boolean,
|
|
167
|
+
isRightButton: boolean,
|
|
168
|
+
isMiddleButton: boolean,
|
|
169
|
+
isBarrelButtonPressed: boolean,
|
|
170
|
+
isHorizontalScrollWheel: boolean,
|
|
171
|
+
isEraser: boolean,
|
|
172
|
+
shiftKey: boolean,
|
|
173
|
+
ctrlKey: boolean,
|
|
174
|
+
altKey: boolean,
|
|
175
|
+
|}>,
|
|
176
|
+
>;
|
|
177
|
+
// Windows]
|
|
178
|
+
|
|
179
|
+
// [Windows
|
|
180
|
+
export type KeyEvent = SyntheticEvent<
|
|
181
|
+
$ReadOnly<{|
|
|
182
|
+
altKey: boolean,
|
|
183
|
+
ctrlKey: boolean,
|
|
184
|
+
metaKey: boolean,
|
|
185
|
+
shiftKey: boolean,
|
|
186
|
+
key: string,
|
|
187
|
+
code: string,
|
|
188
|
+
eventPhase: number,
|
|
189
|
+
|}>,
|
|
190
|
+
>;
|
|
191
|
+
// Windows]
|
package/jest/preprocessor.js
CHANGED
|
@@ -13,42 +13,10 @@
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
15
|
const babelRegisterOnly = require('metro-babel-register');
|
|
16
|
-
const nullthrows = require('nullthrows');
|
|
17
16
|
const createCacheKeyFunction = require('@jest/create-cache-key-function')
|
|
18
17
|
.default;
|
|
19
|
-
const t = require('@babel/types');
|
|
20
|
-
const {statements} = require('@babel/template').default;
|
|
21
18
|
|
|
22
|
-
const
|
|
23
|
-
const importAll = '__importAll__';
|
|
24
|
-
|
|
25
|
-
// prelude
|
|
26
|
-
const importPrelude = statements(`
|
|
27
|
-
function ${importDefault}(moduleId) {
|
|
28
|
-
const exports = require(moduleId);
|
|
29
|
-
|
|
30
|
-
if (exports && exports.__esModule) {
|
|
31
|
-
return exports.default;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return exports;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
function ${importAll}(moduleId) {
|
|
38
|
-
const exports = require(moduleId);
|
|
39
|
-
|
|
40
|
-
if (exports && exports.__esModule) {
|
|
41
|
-
return exports;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return Object.assign({}, exports, {default: exports});
|
|
45
|
-
};
|
|
46
|
-
`);
|
|
47
|
-
|
|
48
|
-
const {
|
|
49
|
-
transformSync: babelTransformSync,
|
|
50
|
-
transformFromAstSync: babelTransformFromAstSync,
|
|
51
|
-
} = require('@babel/core');
|
|
19
|
+
const {transformSync: babelTransformSync} = require('@babel/core');
|
|
52
20
|
const generate = require('@babel/generator').default;
|
|
53
21
|
|
|
54
22
|
const nodeFiles = new RegExp(
|
|
@@ -73,13 +41,13 @@ module.exports = {
|
|
|
73
41
|
}).code;
|
|
74
42
|
}
|
|
75
43
|
|
|
76
|
-
|
|
44
|
+
const {ast} = transformer.transform({
|
|
77
45
|
filename: file,
|
|
78
46
|
options: {
|
|
79
47
|
ast: true, // needed for open source (?) https://github.com/facebook/react-native/commit/f8d6b97140cffe8d18b2558f94570c8d1b410d5c#r28647044
|
|
80
48
|
dev: true,
|
|
81
49
|
enableBabelRuntime: false,
|
|
82
|
-
experimentalImportSupport:
|
|
50
|
+
experimentalImportSupport: false,
|
|
83
51
|
globalPrefix: '',
|
|
84
52
|
hot: false,
|
|
85
53
|
inlineRequires: true,
|
|
@@ -111,6 +79,10 @@ module.exports = {
|
|
|
111
79
|
[require('@babel/plugin-transform-regenerator')],
|
|
112
80
|
[require('@babel/plugin-transform-sticky-regex')],
|
|
113
81
|
[require('@babel/plugin-transform-unicode-regex')],
|
|
82
|
+
[
|
|
83
|
+
require('@babel/plugin-transform-modules-commonjs'),
|
|
84
|
+
{strict: false, allowTopLevelThis: true},
|
|
85
|
+
],
|
|
114
86
|
[require('@babel/plugin-transform-classes')],
|
|
115
87
|
[require('@babel/plugin-transform-arrow-functions')],
|
|
116
88
|
[require('@babel/plugin-transform-spread')],
|
|
@@ -127,46 +99,6 @@ module.exports = {
|
|
|
127
99
|
],
|
|
128
100
|
});
|
|
129
101
|
|
|
130
|
-
// We're not using @babel/plugin-transform-modules-commonjs so
|
|
131
|
-
// we need to add 'use strict' manually
|
|
132
|
-
const directives = ast.program.directives;
|
|
133
|
-
|
|
134
|
-
if (
|
|
135
|
-
ast.program.sourceType === 'module' &&
|
|
136
|
-
(directives == null ||
|
|
137
|
-
directives.findIndex(d => d.value.value === 'use strict') === -1)
|
|
138
|
-
) {
|
|
139
|
-
ast.program.directives = [
|
|
140
|
-
...(directives || []),
|
|
141
|
-
t.directive(t.directiveLiteral('use strict')),
|
|
142
|
-
];
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Postprocess the transformed module to handle ESM and inline requires.
|
|
146
|
-
// We need to do this in a separate pass to avoid issues tracking references.
|
|
147
|
-
const babelTransformResult = babelTransformFromAstSync(ast, src, {
|
|
148
|
-
ast: true,
|
|
149
|
-
retainLines: true,
|
|
150
|
-
plugins: [
|
|
151
|
-
[
|
|
152
|
-
require('metro-transform-plugins').importExportPlugin,
|
|
153
|
-
{importDefault, importAll},
|
|
154
|
-
],
|
|
155
|
-
[
|
|
156
|
-
require('babel-preset-fbjs/plugins/inline-requires.js'),
|
|
157
|
-
{inlineableCalls: [importDefault, importAll]},
|
|
158
|
-
],
|
|
159
|
-
],
|
|
160
|
-
sourceType: 'module',
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
ast = nullthrows(babelTransformResult.ast);
|
|
164
|
-
|
|
165
|
-
// Inject import helpers *after* running the inline-requires transform,
|
|
166
|
-
// because otherwise it will assume they are user code and bail out of
|
|
167
|
-
// inlining calls to them.
|
|
168
|
-
ast.program.body.unshift(...importPrelude());
|
|
169
|
-
|
|
170
102
|
return generate(
|
|
171
103
|
ast,
|
|
172
104
|
// $FlowFixMe[prop-missing] Error found when improving flow typing for libs
|
package/overrides.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"**/__snapshots__/**",
|
|
8
8
|
"src/rntypes/**"
|
|
9
9
|
],
|
|
10
|
-
"baseVersion": "0.67.
|
|
10
|
+
"baseVersion": "0.67.1",
|
|
11
11
|
"overrides": [
|
|
12
12
|
{
|
|
13
13
|
"type": "derived",
|
|
@@ -74,6 +74,13 @@
|
|
|
74
74
|
"baseHash": "0b409391c852a1001cee74a84414a13c4fe88f8b",
|
|
75
75
|
"issue": 4378
|
|
76
76
|
},
|
|
77
|
+
{
|
|
78
|
+
"type": "patch",
|
|
79
|
+
"file": "src/Libraries/Components/Pressable/Pressable.win32.js",
|
|
80
|
+
"baseFile": "Libraries/Components/Pressable/Pressable.js",
|
|
81
|
+
"baseHash": "614553aa8396b42e932f8c717ebc8b493d772d93",
|
|
82
|
+
"issue": 6240
|
|
83
|
+
},
|
|
77
84
|
{
|
|
78
85
|
"type": "copy",
|
|
79
86
|
"file": "src/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js",
|
|
@@ -185,6 +192,13 @@
|
|
|
185
192
|
"baseFile": "Libraries/Components/View/View.js",
|
|
186
193
|
"baseHash": "689895e8755aed42e913460d1fa964907a74f06c"
|
|
187
194
|
},
|
|
195
|
+
{
|
|
196
|
+
"type": "patch",
|
|
197
|
+
"file": "src/Libraries/Components/View/ViewPropTypes.win32.js",
|
|
198
|
+
"baseFile": "Libraries/Components/View/ViewPropTypes.js",
|
|
199
|
+
"baseHash": "2b12228aa1ab0e12844996a99ff5d38fbff689a1",
|
|
200
|
+
"issue": 6240
|
|
201
|
+
},
|
|
188
202
|
{
|
|
189
203
|
"type": "platform",
|
|
190
204
|
"file": "src/Libraries/Components/View/ViewWin32.Props.ts"
|
|
@@ -364,6 +378,20 @@
|
|
|
364
378
|
"type": "platform",
|
|
365
379
|
"file": "src/Libraries/PersonaCoin/PersonaCoinTypes.ts"
|
|
366
380
|
},
|
|
381
|
+
{
|
|
382
|
+
"type": "patch",
|
|
383
|
+
"file": "src/Libraries/Pressability/HoverState.win32.js",
|
|
384
|
+
"baseFile": "Libraries/Pressability/HoverState.js",
|
|
385
|
+
"baseHash": "2807a1cddb7c5135f63e5dd4d0706ac660f25d76",
|
|
386
|
+
"issue": 6240
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"type": "patch",
|
|
390
|
+
"file": "src/Libraries/Pressability/Pressability.win32.js",
|
|
391
|
+
"baseFile": "Libraries/Pressability/Pressability.js",
|
|
392
|
+
"baseHash": "05c53428a4b7b142fabb6833ecf54ba88c0aa05d",
|
|
393
|
+
"issue": 6240
|
|
394
|
+
},
|
|
367
395
|
{
|
|
368
396
|
"type": "platform",
|
|
369
397
|
"file": "src/Libraries/QuirkSettings/CachingNativeQuirkSettings.js"
|
|
@@ -417,6 +445,13 @@
|
|
|
417
445
|
"baseHash": "1a196691fb0e9b656c348b7d42427c1c6163c9bb",
|
|
418
446
|
"issue": 7074
|
|
419
447
|
},
|
|
448
|
+
{
|
|
449
|
+
"type": "patch",
|
|
450
|
+
"file": "src/Libraries/Types/CoreEventTypes.win32.js",
|
|
451
|
+
"baseFile": "Libraries/Types/CoreEventTypes.js",
|
|
452
|
+
"baseHash": "22c50d13820ca4db6c6cf5e6563f8437d55c24af",
|
|
453
|
+
"issue": 6240
|
|
454
|
+
},
|
|
420
455
|
{
|
|
421
456
|
"type": "copy",
|
|
422
457
|
"file": "src/Libraries/Utilities/BackHandler.win32.js",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
|
-
"version": "0.67.
|
|
3
|
+
"version": "0.67.1",
|
|
4
4
|
"description": "Implementation of react native on top of Office's Win32 platform.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./index.win32.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@react-native-community/cli": "^6.0.0",
|
|
26
26
|
"@react-native-community/cli-platform-android": "^6.0.0",
|
|
27
27
|
"@react-native-community/cli-platform-ios": "^6.0.0",
|
|
28
|
-
"@react-native-windows/virtualized-list": "0.67.
|
|
28
|
+
"@react-native-windows/virtualized-list": "0.67.1",
|
|
29
29
|
"@react-native/assets": "1.0.0",
|
|
30
30
|
"@react-native/normalize-color": "2.0.0",
|
|
31
31
|
"@react-native/polyfills": "2.0.0",
|
|
@@ -70,21 +70,21 @@
|
|
|
70
70
|
"just-scripts": "^1.3.3",
|
|
71
71
|
"prettier": "1.19.1",
|
|
72
72
|
"react": "17.0.2",
|
|
73
|
-
"react-native": "0.67.
|
|
73
|
+
"react-native": "0.67.1",
|
|
74
74
|
"react-native-platform-override": "^1.5.1",
|
|
75
75
|
"react-shallow-renderer": "16.14.1",
|
|
76
76
|
"typescript": "^4.4.4"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"react": "17.0.2",
|
|
80
|
-
"react-native": "0.67.0
|
|
80
|
+
"react-native": "^0.67.0"
|
|
81
81
|
},
|
|
82
82
|
"beachball": {
|
|
83
|
-
"defaultNpmTag": "
|
|
83
|
+
"defaultNpmTag": "v0.67-stable",
|
|
84
84
|
"disallowedChangeTypes": [
|
|
85
85
|
"major",
|
|
86
86
|
"minor",
|
|
87
|
-
"
|
|
87
|
+
"prerelease"
|
|
88
88
|
]
|
|
89
89
|
},
|
|
90
90
|
"promoteRelease": true,
|