@office-iss/react-native-win32 0.0.0-canary.248 → 0.0.0-canary.249
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 -2
- package/CHANGELOG.json +48 -1
- package/CHANGELOG.md +21 -9
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +1 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +2 -1
- package/Libraries/Components/TextInput/TextInput.js +6 -3
- package/Libraries/Components/TextInput/TextInput.win32.js +6 -3
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +6 -0
- package/Libraries/Core/Devtools/loadBundleFromServer.win32.js +153 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/IntersectionObserver/IntersectionObserverManager.js +6 -26
- package/Libraries/LogBox/Data/LogBoxData.js +0 -25
- package/Libraries/NativeComponent/BaseViewConfig.android.js +3 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +3 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +3 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +6 -0
- package/Libraries/StyleSheet/processFilter.js +132 -0
- package/jest/mockComponent.js +7 -0
- package/overrides.json +11 -4
- package/package.json +17 -17
- package/rn-get-polyfills.js +1 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +1 -6
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +1 -2
- package/jest/ReactNativeInternalFeatureFlagsMock.js +0 -13
package/.flowconfig
CHANGED
|
@@ -96,7 +96,6 @@ flow/
|
|
|
96
96
|
../../../node_modules/.flow/flow-typed/
|
|
97
97
|
|
|
98
98
|
[options]
|
|
99
|
-
experimental.global_find_ref=true
|
|
100
99
|
enums=true
|
|
101
100
|
casting_syntax=both
|
|
102
101
|
|
|
@@ -154,4 +153,4 @@ untyped-import
|
|
|
154
153
|
untyped-type-import
|
|
155
154
|
|
|
156
155
|
[version]
|
|
157
|
-
^0.
|
|
156
|
+
^0.236.0
|
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,54 @@
|
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Thu,
|
|
5
|
+
"date": "Thu, 30 May 2024 05:15:53 GMT",
|
|
6
|
+
"version": "0.0.0-canary.249",
|
|
7
|
+
"tag": "@office-iss/react-native-win32_v0.0.0-canary.249",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "1422161+marlenecota@users.noreply.github.com",
|
|
12
|
+
"package": "@office-iss/react-native-win32",
|
|
13
|
+
"commit": "1304e2f0aa0f074550f4a10de439188749590547",
|
|
14
|
+
"comment": "RN Integration 05/11"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@office-iss/react-native-win32",
|
|
19
|
+
"comment": "Bump @rnw-scripts/eslint-config to v1.2.19",
|
|
20
|
+
"commit": "not available"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@office-iss/react-native-win32",
|
|
25
|
+
"comment": "Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.23",
|
|
26
|
+
"commit": "not available"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@office-iss/react-native-win32",
|
|
31
|
+
"comment": "Bump @rnw-scripts/just-task to v2.3.35",
|
|
32
|
+
"commit": "not available"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@office-iss/react-native-win32",
|
|
37
|
+
"comment": "Bump react-native-platform-override to v1.9.36",
|
|
38
|
+
"commit": "not available"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"none": [
|
|
42
|
+
{
|
|
43
|
+
"author": "1422161+marlenecota@users.noreply.github.com",
|
|
44
|
+
"package": "@office-iss/react-native-win32",
|
|
45
|
+
"commit": "b06795ef7c683825358c8150adb2107a816d98ac",
|
|
46
|
+
"comment": "CodeQL patch"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"date": "Thu, 23 May 2024 05:17:48 GMT",
|
|
6
53
|
"version": "0.0.0-canary.248",
|
|
7
54
|
"tag": "@office-iss/react-native-win32_v0.0.0-canary.248",
|
|
8
55
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
# Change Log - @office-iss/react-native-win32
|
|
2
2
|
|
|
3
|
-
This log was last generated on Thu,
|
|
3
|
+
This log was last generated on Thu, 30 May 2024 05:15:53 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 0.0.0-canary.
|
|
7
|
+
## 0.0.0-canary.249
|
|
8
8
|
|
|
9
|
-
Thu,
|
|
9
|
+
Thu, 30 May 2024 05:15:53 GMT
|
|
10
10
|
|
|
11
11
|
### Changes
|
|
12
12
|
|
|
13
|
-
- RN Integration
|
|
14
|
-
-
|
|
15
|
-
- Bump @rnw-scripts/
|
|
16
|
-
- Bump @rnw-scripts/
|
|
17
|
-
- Bump
|
|
18
|
-
- Bump react-native-platform-override to v1.9.35
|
|
13
|
+
- RN Integration 05/11 (1422161+marlenecota@users.noreply.github.com)
|
|
14
|
+
- Bump @rnw-scripts/eslint-config to v1.2.19
|
|
15
|
+
- Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.23
|
|
16
|
+
- Bump @rnw-scripts/just-task to v2.3.35
|
|
17
|
+
- Bump react-native-platform-override to v1.9.36
|
|
19
18
|
|
|
19
|
+
## 0.0.0-canary.248
|
|
20
|
+
|
|
21
|
+
Thu, 23 May 2024 05:17:48 GMT
|
|
22
|
+
|
|
23
|
+
### Changes
|
|
24
|
+
|
|
25
|
+
- RN Integration 04/27 (1422161+marlenecota@users.noreply.github.com)
|
|
26
|
+
- RN Integration 05/02 (1422161+marlenecota@users.noreply.github.com)
|
|
27
|
+
- Bump @rnw-scripts/eslint-config to v1.2.18
|
|
28
|
+
- Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.22
|
|
29
|
+
- Bump @rnw-scripts/just-task to v2.3.34
|
|
30
|
+
- Bump react-native-platform-override to v1.9.35
|
|
31
|
+
|
|
20
32
|
## 0.0.0-canary.247
|
|
21
33
|
|
|
22
34
|
Wed, 22 May 2024 05:18:16 GMT
|
|
@@ -45,6 +45,7 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
45
45
|
diff: require('../../Utilities/differ/pointsDiffer'),
|
|
46
46
|
},
|
|
47
47
|
decelerationRate: true,
|
|
48
|
+
enableSyncOnScroll: true, // Fabric only.
|
|
48
49
|
disableIntervalMomentum: true,
|
|
49
50
|
maintainVisibleContentPosition: true,
|
|
50
51
|
pagingEnabled: true,
|
|
@@ -134,7 +135,7 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
134
135
|
contentInsetAdjustmentBehavior: true,
|
|
135
136
|
decelerationRate: true,
|
|
136
137
|
endDraggingSensitivityMultiplier: true,
|
|
137
|
-
enableSyncOnScroll: true, //
|
|
138
|
+
enableSyncOnScroll: true, // Fabric only.
|
|
138
139
|
directionalLockEnabled: true,
|
|
139
140
|
disableIntervalMomentum: true,
|
|
140
141
|
indicatorStyle: true,
|
|
@@ -1099,12 +1099,14 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1099
1099
|
};
|
|
1100
1100
|
|
|
1101
1101
|
const [mostRecentEventCount, setMostRecentEventCount] = useState<number>(0);
|
|
1102
|
-
|
|
1103
1102
|
const [lastNativeText, setLastNativeText] = useState<?Stringish>(props.value);
|
|
1104
1103
|
const [lastNativeSelectionState, setLastNativeSelection] = useState<{|
|
|
1105
|
-
selection:
|
|
1104
|
+
selection: Selection,
|
|
1106
1105
|
mostRecentEventCount: number,
|
|
1107
|
-
|}>({
|
|
1106
|
+
|}>({
|
|
1107
|
+
selection: {start: -1, end: -1},
|
|
1108
|
+
mostRecentEventCount: mostRecentEventCount,
|
|
1109
|
+
});
|
|
1108
1110
|
|
|
1109
1111
|
const lastNativeSelection = lastNativeSelectionState.selection;
|
|
1110
1112
|
|
|
@@ -1442,6 +1444,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1442
1444
|
onSelectionChange={_onSelectionChange}
|
|
1443
1445
|
onSelectionChangeShouldSetResponder={emptyFunctionThatReturnsTrue}
|
|
1444
1446
|
selection={selection}
|
|
1447
|
+
selectionColor={selectionColor}
|
|
1445
1448
|
style={StyleSheet.compose(
|
|
1446
1449
|
useMultilineDefaultStyle ? styles.multilineDefault : null,
|
|
1447
1450
|
style,
|
|
@@ -1144,12 +1144,14 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1144
1144
|
};
|
|
1145
1145
|
|
|
1146
1146
|
const [mostRecentEventCount, setMostRecentEventCount] = useState<number>(0);
|
|
1147
|
-
|
|
1148
1147
|
const [lastNativeText, setLastNativeText] = useState<?Stringish>(props.value);
|
|
1149
1148
|
const [lastNativeSelectionState, setLastNativeSelection] = useState<{|
|
|
1150
|
-
selection:
|
|
1149
|
+
selection: Selection,
|
|
1151
1150
|
mostRecentEventCount: number,
|
|
1152
|
-
|}>({
|
|
1151
|
+
|}>({
|
|
1152
|
+
selection: {start: -1, end: -1},
|
|
1153
|
+
mostRecentEventCount: mostRecentEventCount,
|
|
1154
|
+
});
|
|
1153
1155
|
|
|
1154
1156
|
const lastNativeSelection = lastNativeSelectionState.selection;
|
|
1155
1157
|
|
|
@@ -1556,6 +1558,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1556
1558
|
onSelectionChange={_onSelectionChange}
|
|
1557
1559
|
onSelectionChangeShouldSetResponder={emptyFunctionThatReturnsTrue}
|
|
1558
1560
|
selection={selection}
|
|
1561
|
+
selectionColor={selectionColor}
|
|
1559
1562
|
style={StyleSheet.compose(
|
|
1560
1563
|
useMultilineDefaultStyle ? styles.multilineDefault : null,
|
|
1561
1564
|
style,
|
|
@@ -12,6 +12,7 @@ import type {AnyAttributeType} from '../../Renderer/shims/ReactNativeTypes';
|
|
|
12
12
|
|
|
13
13
|
import processAspectRatio from '../../StyleSheet/processAspectRatio';
|
|
14
14
|
import processColor from '../../StyleSheet/processColor';
|
|
15
|
+
import processFilter from '../../StyleSheet/processFilter';
|
|
15
16
|
import processFontVariant from '../../StyleSheet/processFontVariant';
|
|
16
17
|
import processTransform from '../../StyleSheet/processTransform';
|
|
17
18
|
import processTransformOrigin from '../../StyleSheet/processTransformOrigin';
|
|
@@ -114,6 +115,11 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
|
|
|
114
115
|
transform: {process: processTransform},
|
|
115
116
|
transformOrigin: {process: processTransformOrigin},
|
|
116
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Filter
|
|
120
|
+
*/
|
|
121
|
+
experimental_filter: {process: processFilter},
|
|
122
|
+
|
|
117
123
|
/**
|
|
118
124
|
* View
|
|
119
125
|
*/
|
|
@@ -0,0 +1,153 @@
|
|
|
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-local
|
|
8
|
+
* @format
|
|
9
|
+
* @oncall react_native
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import Networking from '../../Network/RCTNetworking';
|
|
13
|
+
import DevLoadingView from '../../Utilities/DevLoadingView';
|
|
14
|
+
import HMRClient from '../../Utilities/HMRClient';
|
|
15
|
+
import getDevServer from './getDevServer';
|
|
16
|
+
|
|
17
|
+
declare var global: {globalEvalWithSourceUrl?: (string, string) => mixed, ...};
|
|
18
|
+
|
|
19
|
+
let pendingRequests = 0;
|
|
20
|
+
|
|
21
|
+
const cachedPromisesByUrl = new Map<string, Promise<void>>();
|
|
22
|
+
|
|
23
|
+
function asyncRequest(
|
|
24
|
+
url: string,
|
|
25
|
+
): Promise<{body: string, headers: {[string]: string}}> {
|
|
26
|
+
let id = null;
|
|
27
|
+
let responseText = null;
|
|
28
|
+
let headers = null;
|
|
29
|
+
let dataListener;
|
|
30
|
+
let completeListener;
|
|
31
|
+
let responseListener;
|
|
32
|
+
let incrementalDataListener;
|
|
33
|
+
return new Promise<{body: string, headers: {[string]: string}}>(
|
|
34
|
+
(resolve, reject) => {
|
|
35
|
+
dataListener = Networking.addListener(
|
|
36
|
+
'didReceiveNetworkData',
|
|
37
|
+
([requestId, response]) => {
|
|
38
|
+
if (requestId === id) {
|
|
39
|
+
responseText = response;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
);
|
|
43
|
+
incrementalDataListener = Networking.addListener(
|
|
44
|
+
'didReceiveNetworkIncrementalData',
|
|
45
|
+
([requestId, data]) => {
|
|
46
|
+
if (requestId === id) {
|
|
47
|
+
if (responseText != null) {
|
|
48
|
+
responseText += data;
|
|
49
|
+
} else {
|
|
50
|
+
responseText = data;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
);
|
|
55
|
+
responseListener = Networking.addListener(
|
|
56
|
+
'didReceiveNetworkResponse',
|
|
57
|
+
([requestId, status, responseHeaders]) => {
|
|
58
|
+
if (requestId === id) {
|
|
59
|
+
headers = responseHeaders;
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
);
|
|
63
|
+
completeListener = Networking.addListener(
|
|
64
|
+
'didCompleteNetworkResponse',
|
|
65
|
+
([requestId, error]) => {
|
|
66
|
+
if (requestId === id) {
|
|
67
|
+
if (error) {
|
|
68
|
+
reject(error);
|
|
69
|
+
} else {
|
|
70
|
+
//$FlowFixMe[incompatible-call]
|
|
71
|
+
resolve({body: responseText, headers});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
Networking.sendRequest(
|
|
77
|
+
'GET',
|
|
78
|
+
'asyncRequest',
|
|
79
|
+
url,
|
|
80
|
+
{},
|
|
81
|
+
'',
|
|
82
|
+
'text',
|
|
83
|
+
true,
|
|
84
|
+
0,
|
|
85
|
+
requestId => {
|
|
86
|
+
id = requestId;
|
|
87
|
+
},
|
|
88
|
+
true,
|
|
89
|
+
);
|
|
90
|
+
},
|
|
91
|
+
).finally(() => {
|
|
92
|
+
dataListener?.remove();
|
|
93
|
+
completeListener?.remove();
|
|
94
|
+
responseListener?.remove();
|
|
95
|
+
incrementalDataListener?.remove();
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function buildUrlForBundle(bundlePathAndQuery: string) {
|
|
100
|
+
const {url: serverUrl} = getDevServer();
|
|
101
|
+
return (
|
|
102
|
+
serverUrl.replace(/\/+$/, '') + '/' + bundlePathAndQuery.replace(/^\/+/, '')
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
module.exports = function (bundlePathAndQuery: string): Promise<void> {
|
|
107
|
+
const requestUrl = buildUrlForBundle(bundlePathAndQuery);
|
|
108
|
+
let loadPromise = cachedPromisesByUrl.get(requestUrl);
|
|
109
|
+
|
|
110
|
+
if (loadPromise) {
|
|
111
|
+
return loadPromise;
|
|
112
|
+
}
|
|
113
|
+
DevLoadingView.showMessage('Downloading...', 'load');
|
|
114
|
+
++pendingRequests;
|
|
115
|
+
|
|
116
|
+
loadPromise = asyncRequest(requestUrl)
|
|
117
|
+
.then<void>(({body, headers}) => {
|
|
118
|
+
if (
|
|
119
|
+
headers['Content-Type'] != null &&
|
|
120
|
+
headers['Content-Type'].indexOf('application/json') >= 0
|
|
121
|
+
) {
|
|
122
|
+
// Errors are returned as JSON.
|
|
123
|
+
throw new Error(
|
|
124
|
+
JSON.parse(body).message ||
|
|
125
|
+
`Unknown error fetching '${bundlePathAndQuery}'`,
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
HMRClient.registerBundle(requestUrl);
|
|
130
|
+
|
|
131
|
+
// Some engines do not support `sourceURL` as a comment. We expose a
|
|
132
|
+
// `globalEvalWithSourceUrl` function to handle updates in that case.
|
|
133
|
+
if (global.globalEvalWithSourceUrl) {
|
|
134
|
+
global.globalEvalWithSourceUrl(body, requestUrl);
|
|
135
|
+
} else {
|
|
136
|
+
// [Windows #12704 - CodeQL patch]
|
|
137
|
+
// eslint-disable-next-line no-eval
|
|
138
|
+
eval(body); // CodeQL [js/eval-usage] Debug only. Developer inner loop.
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
.catch<void>(e => {
|
|
142
|
+
cachedPromisesByUrl.delete(requestUrl);
|
|
143
|
+
throw e;
|
|
144
|
+
})
|
|
145
|
+
.finally(() => {
|
|
146
|
+
if (!--pendingRequests) {
|
|
147
|
+
DevLoadingView.hide();
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
cachedPromisesByUrl.set(requestUrl, loadPromise);
|
|
152
|
+
return loadPromise;
|
|
153
|
+
};
|
|
@@ -67,19 +67,11 @@ function setTargetForInstanceHandle(
|
|
|
67
67
|
instanceHandleToTargetMap.set(key, target);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
function unsetTargetForInstanceHandle(instanceHandle: mixed): void {
|
|
71
|
-
// $FlowExpectedError[incompatible-type] instanceHandle is typed as mixed but we know it's an object and we need it to be to use it as a key in a WeakMap.
|
|
72
|
-
const key: interface {} = instanceHandle;
|
|
73
|
-
instanceHandleToTargetMap.delete(key);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
70
|
// The mapping between ReactNativeElement and their corresponding shadow node
|
|
77
71
|
// also needs to be kept here because React removes the link when unmounting.
|
|
78
|
-
|
|
79
|
-
// from the target to unobserve.
|
|
80
|
-
const targetToShadowNodeAndInstanceHandleMap: WeakMap<
|
|
72
|
+
const targetToShadowNodeMap: WeakMap<
|
|
81
73
|
ReactNativeElement,
|
|
82
|
-
|
|
74
|
+
ReturnType<typeof getShadowNode>,
|
|
83
75
|
> = new WeakMap();
|
|
84
76
|
|
|
85
77
|
/**
|
|
@@ -163,12 +155,8 @@ export function observe({
|
|
|
163
155
|
// access it even after the instance handle has been unmounted.
|
|
164
156
|
setTargetForInstanceHandle(instanceHandle, target);
|
|
165
157
|
|
|
166
|
-
// Same for the mapping between the target and its shadow node
|
|
167
|
-
|
|
168
|
-
targetToShadowNodeAndInstanceHandleMap.set(target, [
|
|
169
|
-
targetShadowNode,
|
|
170
|
-
instanceHandle,
|
|
171
|
-
]);
|
|
158
|
+
// Same for the mapping between the target and its shadow node.
|
|
159
|
+
targetToShadowNodeMap.set(target, targetShadowNode);
|
|
172
160
|
|
|
173
161
|
if (!isConnected) {
|
|
174
162
|
NativeIntersectionObserver.connect(notifyIntersectionObservers);
|
|
@@ -201,26 +189,18 @@ export function unobserve(
|
|
|
201
189
|
return;
|
|
202
190
|
}
|
|
203
191
|
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
if (targetShadowNodeAndInstanceHandle == null) {
|
|
192
|
+
const targetShadowNode = targetToShadowNodeMap.get(target);
|
|
193
|
+
if (targetShadowNode == null) {
|
|
207
194
|
console.error(
|
|
208
195
|
'IntersectionObserverManager: could not find registration data for target',
|
|
209
196
|
);
|
|
210
197
|
return;
|
|
211
198
|
}
|
|
212
199
|
|
|
213
|
-
const [targetShadowNode, instanceHandle] = targetShadowNodeAndInstanceHandle;
|
|
214
|
-
|
|
215
200
|
NativeIntersectionObserver.unobserve(
|
|
216
201
|
intersectionObserverId,
|
|
217
202
|
targetShadowNode,
|
|
218
203
|
);
|
|
219
|
-
|
|
220
|
-
// We can guarantee we won't receive any more entries for this target,
|
|
221
|
-
// so we don't need to keep the mappings anymore.
|
|
222
|
-
unsetTargetForInstanceHandle(instanceHandle);
|
|
223
|
-
targetToShadowNodeAndInstanceHandleMap.delete(target);
|
|
224
204
|
}
|
|
225
205
|
|
|
226
206
|
/**
|
|
@@ -449,31 +449,6 @@ export function withSubscription(
|
|
|
449
449
|
this._subscription.unsubscribe();
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
|
-
|
|
453
|
-
_handleDismiss = (): void => {
|
|
454
|
-
// Here we handle the cases when the log is dismissed and it
|
|
455
|
-
// was either the last log, or when the current index
|
|
456
|
-
// is now outside the bounds of the log array.
|
|
457
|
-
const {selectedLogIndex, logs: stateLogs} = this.state;
|
|
458
|
-
const logsArray = Array.from(stateLogs);
|
|
459
|
-
if (selectedLogIndex != null) {
|
|
460
|
-
if (logsArray.length - 1 <= 0) {
|
|
461
|
-
setSelectedLog(-1);
|
|
462
|
-
} else if (selectedLogIndex >= logsArray.length - 1) {
|
|
463
|
-
setSelectedLog(selectedLogIndex - 1);
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
dismiss(logsArray[selectedLogIndex]);
|
|
467
|
-
}
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
_handleMinimize = (): void => {
|
|
471
|
-
setSelectedLog(-1);
|
|
472
|
-
};
|
|
473
|
-
|
|
474
|
-
_handleSetSelectedLog = (index: number): void => {
|
|
475
|
-
setSelectedLog(index);
|
|
476
|
-
};
|
|
477
452
|
}
|
|
478
453
|
|
|
479
454
|
return LogBoxStateSubscription;
|
|
@@ -166,6 +166,9 @@ const validAttributesForNonEventProps = {
|
|
|
166
166
|
backgroundColor: {process: require('../StyleSheet/processColor').default},
|
|
167
167
|
transform: true,
|
|
168
168
|
transformOrigin: true,
|
|
169
|
+
experimental_filter: {
|
|
170
|
+
process: require('../StyleSheet/processFilter').default,
|
|
171
|
+
},
|
|
169
172
|
opacity: true,
|
|
170
173
|
elevation: true,
|
|
171
174
|
shadowColor: {process: require('../StyleSheet/processColor').default},
|
|
@@ -220,6 +220,9 @@ const validAttributesForNonEventProps = {
|
|
|
220
220
|
hitSlop: {diff: require('../Utilities/differ/insetsDiffer')},
|
|
221
221
|
collapsable: true,
|
|
222
222
|
collapsableChildren: true,
|
|
223
|
+
experimental_filter: {
|
|
224
|
+
process: require('../StyleSheet/processFilter').default,
|
|
225
|
+
},
|
|
223
226
|
|
|
224
227
|
borderTopWidth: true,
|
|
225
228
|
borderTopColor: {process: require('../StyleSheet/processColor').default},
|
|
@@ -220,6 +220,9 @@ const validAttributesForNonEventProps = {
|
|
|
220
220
|
hitSlop: {diff: require('../Utilities/differ/insetsDiffer')},
|
|
221
221
|
collapsable: true,
|
|
222
222
|
collapsableChildren: true,
|
|
223
|
+
experimental_filter: {
|
|
224
|
+
process: require('../StyleSheet/processFilter').default,
|
|
225
|
+
},
|
|
223
226
|
|
|
224
227
|
borderTopWidth: true,
|
|
225
228
|
borderTopColor: {process: require('../StyleSheet/processColor').default},
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
import type AnimatedNode from '../Animated/nodes/AnimatedNode';
|
|
14
|
+
import type {FilterPrimitive} from '../StyleSheet/processFilter';
|
|
14
15
|
import type {
|
|
15
16
|
____DangerouslyImpreciseStyle_InternalOverrides,
|
|
16
17
|
____ImageStyle_InternalOverrides,
|
|
@@ -690,10 +691,15 @@ export type ____ShadowStyle_Internal = $ReadOnly<{
|
|
|
690
691
|
...____ShadowStyle_InternalOverrides,
|
|
691
692
|
}>;
|
|
692
693
|
|
|
694
|
+
type ____FilterStyle_Internal = $ReadOnly<{
|
|
695
|
+
experimental_filter?: $ReadOnlyArray<FilterPrimitive>,
|
|
696
|
+
}>;
|
|
697
|
+
|
|
693
698
|
export type ____ViewStyle_InternalCore = $ReadOnly<{
|
|
694
699
|
...$Exact<____LayoutStyle_Internal>,
|
|
695
700
|
...$Exact<____ShadowStyle_Internal>,
|
|
696
701
|
...$Exact<____TransformStyle_Internal>,
|
|
702
|
+
...____FilterStyle_Internal,
|
|
697
703
|
backfaceVisibility?: 'visible' | 'hidden',
|
|
698
704
|
backgroundColor?: ____ColorValue_Internal,
|
|
699
705
|
borderColor?: ____ColorValue_Internal,
|
|
@@ -0,0 +1,132 @@
|
|
|
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
|
+
export type FilterPrimitive =
|
|
14
|
+
| {brightness: number | string}
|
|
15
|
+
| {blur: number | string}
|
|
16
|
+
| {contrast: number | string}
|
|
17
|
+
| {grayscale: number | string}
|
|
18
|
+
| {hueRotate: number | string}
|
|
19
|
+
| {invert: number | string}
|
|
20
|
+
| {opacity: number | string}
|
|
21
|
+
| {saturate: number | string}
|
|
22
|
+
| {sepia: number | string};
|
|
23
|
+
|
|
24
|
+
export default function processFilter(
|
|
25
|
+
filter: $ReadOnlyArray<FilterPrimitive> | string,
|
|
26
|
+
): $ReadOnlyArray<FilterPrimitive> {
|
|
27
|
+
let result: Array<FilterPrimitive> = [];
|
|
28
|
+
if (typeof filter === 'string') {
|
|
29
|
+
// matches on functions with args like "brightness(1.5)"
|
|
30
|
+
const regex = new RegExp(/(\w+)\(([^)]+)\)/g);
|
|
31
|
+
let matches;
|
|
32
|
+
|
|
33
|
+
while ((matches = regex.exec(filter))) {
|
|
34
|
+
const amount = _getFilterAmount(matches[1], matches[2]);
|
|
35
|
+
|
|
36
|
+
if (amount != null) {
|
|
37
|
+
const filterPrimitive = {};
|
|
38
|
+
// $FlowFixMe The key will be the correct one but flow can't see that.
|
|
39
|
+
filterPrimitive[matches[1]] = amount;
|
|
40
|
+
// $FlowFixMe The key will be the correct one but flow can't see that.
|
|
41
|
+
result.push(filterPrimitive);
|
|
42
|
+
} else {
|
|
43
|
+
// If any primitive is invalid then apply none of the filters. This is how
|
|
44
|
+
// web works and makes it clear that something is wrong becuase no
|
|
45
|
+
// graphical effects are happening.
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
for (const filterPrimitive of filter) {
|
|
51
|
+
const [filterName, filterValue] = Object.entries(filterPrimitive)[0];
|
|
52
|
+
const amount = _getFilterAmount(filterName, filterValue);
|
|
53
|
+
|
|
54
|
+
if (amount != null) {
|
|
55
|
+
const resultObject = {};
|
|
56
|
+
// $FlowFixMe
|
|
57
|
+
resultObject[filterName] = amount;
|
|
58
|
+
// $FlowFixMe
|
|
59
|
+
result.push(resultObject);
|
|
60
|
+
} else {
|
|
61
|
+
// If any primitive is invalid then apply none of the filters. This is how
|
|
62
|
+
// web works and makes it clear that something is wrong becuase no
|
|
63
|
+
// graphical effects are happening.
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function _getFilterAmount(filterName: string, filterArgs: mixed): ?number {
|
|
73
|
+
let filterArgAsNumber: number;
|
|
74
|
+
let unit: string;
|
|
75
|
+
if (typeof filterArgs === 'string') {
|
|
76
|
+
// matches on args with units like "1.5 5% -80deg"
|
|
77
|
+
const argsWithUnitsRegex = new RegExp(/([+-]?\d*(\.\d+)?)([a-zA-Z%]+)?/g);
|
|
78
|
+
const match = argsWithUnitsRegex.exec(filterArgs);
|
|
79
|
+
|
|
80
|
+
if (!match || isNaN(Number(match[1]))) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
filterArgAsNumber = Number(match[1]);
|
|
85
|
+
unit = match[3];
|
|
86
|
+
} else if (typeof filterArgs === 'number') {
|
|
87
|
+
filterArgAsNumber = filterArgs;
|
|
88
|
+
} else {
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
switch (filterName) {
|
|
93
|
+
// Hue rotate takes some angle that can have a unit and can be
|
|
94
|
+
// negative. Additionally, 0 with no unit is allowed.
|
|
95
|
+
case 'hueRotate':
|
|
96
|
+
if (filterArgAsNumber === 0) {
|
|
97
|
+
return 0;
|
|
98
|
+
}
|
|
99
|
+
if (unit !== 'deg' && unit !== 'rad') {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
return unit === 'rad'
|
|
103
|
+
? (180 * filterArgAsNumber) / Math.PI
|
|
104
|
+
: filterArgAsNumber;
|
|
105
|
+
// blur takes any positive CSS length that is not a percent. In RN
|
|
106
|
+
// we currently only have DIPs, so we are not parsing units here.
|
|
107
|
+
case 'blur':
|
|
108
|
+
if ((unit && unit !== 'px') || filterArgAsNumber < 0) {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
return filterArgAsNumber;
|
|
112
|
+
// All other filters except take a non negative number or percentage. There
|
|
113
|
+
// are no units associated with this value and percentage numbers map 1-to-1
|
|
114
|
+
// to a non-percentage number (e.g. 50% == 0.5).
|
|
115
|
+
case 'brightness':
|
|
116
|
+
case 'contrast':
|
|
117
|
+
case 'grayscale':
|
|
118
|
+
case 'invert':
|
|
119
|
+
case 'opacity':
|
|
120
|
+
case 'saturate':
|
|
121
|
+
case 'sepia':
|
|
122
|
+
if ((unit && unit !== '%' && unit !== 'px') || filterArgAsNumber < 0) {
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
if (unit === '%') {
|
|
126
|
+
filterArgAsNumber /= 100;
|
|
127
|
+
}
|
|
128
|
+
return filterArgAsNumber;
|
|
129
|
+
default:
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
}
|
package/jest/mockComponent.js
CHANGED
|
@@ -50,6 +50,13 @@ module.exports = (moduleName, instanceMethods, isESModule) => {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
+
Object.defineProperty(Component, 'name', {
|
|
54
|
+
value: name,
|
|
55
|
+
writable: false,
|
|
56
|
+
enumerable: false,
|
|
57
|
+
configurable: true,
|
|
58
|
+
});
|
|
59
|
+
|
|
53
60
|
Component.displayName = nameWithoutPrefix;
|
|
54
61
|
|
|
55
62
|
Object.keys(RealComponent).forEach(classStatic => {
|
package/overrides.json
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"**/__snapshots__/**",
|
|
8
8
|
"src-win/rntypes/**"
|
|
9
9
|
],
|
|
10
|
-
"baseVersion": "0.75.0-nightly-
|
|
10
|
+
"baseVersion": "0.75.0-nightly-20240511-3f17c8b5f",
|
|
11
11
|
"overrides": [
|
|
12
12
|
{
|
|
13
13
|
"type": "derived",
|
|
14
14
|
"file": ".flowconfig",
|
|
15
15
|
"baseFile": ".flowconfig",
|
|
16
|
-
"baseHash": "
|
|
16
|
+
"baseHash": "bd274caf8faae09b1f0513a4086c07b778072e78"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"type": "derived",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"type": "derived",
|
|
117
117
|
"file": "src-win/Libraries/Components/TextInput/TextInput.win32.js",
|
|
118
118
|
"baseFile": "packages/react-native/Libraries/Components/TextInput/TextInput.js",
|
|
119
|
-
"baseHash": "
|
|
119
|
+
"baseHash": "dad569fd3dd81f212afd7b35ffe75108e926eb5e"
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
"type": "patch",
|
|
@@ -217,6 +217,13 @@
|
|
|
217
217
|
"type": "platform",
|
|
218
218
|
"file": "src-win/Libraries/Components/View/ViewWin32.js"
|
|
219
219
|
},
|
|
220
|
+
{
|
|
221
|
+
"type": "patch",
|
|
222
|
+
"file": "src-win/Libraries/Core/Devtools/loadBundleFromServer.win32.js",
|
|
223
|
+
"baseFile": "packages/react-native/Libraries/Core/Devtools/loadBundleFromServer.js",
|
|
224
|
+
"baseHash": "14662281c97222b45893308b744a7dc7c2000801",
|
|
225
|
+
"issue": 12704
|
|
226
|
+
},
|
|
220
227
|
{
|
|
221
228
|
"type": "patch",
|
|
222
229
|
"file": "src-win/Libraries/Core/ReactNativeVersionCheck.win32.js",
|
|
@@ -337,7 +344,7 @@
|
|
|
337
344
|
"type": "derived",
|
|
338
345
|
"file": "src-win/Libraries/NativeComponent/BaseViewConfig.win32.js",
|
|
339
346
|
"baseFile": "packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js",
|
|
340
|
-
"baseHash": "
|
|
347
|
+
"baseHash": "d7b9540d5e637cb86b29d119838a4024bfc2b7d6"
|
|
341
348
|
},
|
|
342
349
|
{
|
|
343
350
|
"type": "copy",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
|
-
"version": "0.0.0-canary.
|
|
3
|
+
"version": "0.0.0-canary.249",
|
|
4
4
|
"description": "Implementation of react native on top of Office's Win32 platform.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"@react-native-community/cli-platform-android": "14.0.0-alpha.2",
|
|
31
31
|
"@react-native-community/cli-platform-ios": "14.0.0-alpha.2",
|
|
32
32
|
"@react-native/assets": "1.0.0",
|
|
33
|
-
"@react-native/assets-registry": "0.75.0-nightly-
|
|
34
|
-
"@react-native/codegen": "0.75.0-nightly-
|
|
35
|
-
"@react-native/community-cli-plugin": "0.75.0-nightly-
|
|
36
|
-
"@react-native/gradle-plugin": "0.75.0-nightly-
|
|
37
|
-
"@react-native/js-polyfills": "0.75.0-nightly-
|
|
38
|
-
"@react-native/normalize-colors": "0.75.0-nightly-
|
|
39
|
-
"@react-native/virtualized-lists": "0.75.0-nightly-
|
|
33
|
+
"@react-native/assets-registry": "0.75.0-nightly-20240511-3f17c8b5f",
|
|
34
|
+
"@react-native/codegen": "0.75.0-nightly-20240511-3f17c8b5f",
|
|
35
|
+
"@react-native/community-cli-plugin": "0.75.0-nightly-20240511-3f17c8b5f",
|
|
36
|
+
"@react-native/gradle-plugin": "0.75.0-nightly-20240511-3f17c8b5f",
|
|
37
|
+
"@react-native/js-polyfills": "0.75.0-nightly-20240511-3f17c8b5f",
|
|
38
|
+
"@react-native/normalize-colors": "0.75.0-nightly-20240511-3f17c8b5f",
|
|
39
|
+
"@react-native/virtualized-lists": "0.75.0-nightly-20240511-3f17c8b5f",
|
|
40
40
|
"abort-controller": "^3.0.0",
|
|
41
41
|
"anser": "^1.4.9",
|
|
42
42
|
"ansi-regex": "^5.0.0",
|
|
@@ -70,11 +70,11 @@
|
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@babel/core": "^7.20.0",
|
|
72
72
|
"@babel/eslint-parser": "^7.20.0",
|
|
73
|
-
"@react-native/metro-config": "0.75.0-nightly-
|
|
73
|
+
"@react-native/metro-config": "0.75.0-nightly-20240511-3f17c8b5f",
|
|
74
74
|
"@rnw-scripts/babel-react-native-config": "0.0.0",
|
|
75
|
-
"@rnw-scripts/eslint-config": "1.2.
|
|
76
|
-
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.
|
|
77
|
-
"@rnw-scripts/just-task": "2.3.
|
|
75
|
+
"@rnw-scripts/eslint-config": "1.2.19",
|
|
76
|
+
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.23",
|
|
77
|
+
"@rnw-scripts/just-task": "2.3.35",
|
|
78
78
|
"@rnw-scripts/metro-dev-config": "0.0.0",
|
|
79
79
|
"@rnx-kit/jest-preset": "^0.1.0",
|
|
80
80
|
"@types/node": "^18.0.0",
|
|
@@ -85,15 +85,15 @@
|
|
|
85
85
|
"jscodeshift": "^0.14.0",
|
|
86
86
|
"just-scripts": "^1.3.3",
|
|
87
87
|
"prettier": "2.8.8",
|
|
88
|
-
"react": "18.
|
|
89
|
-
"react-native": "0.75.0-nightly-
|
|
90
|
-
"react-native-platform-override": "^1.9.
|
|
88
|
+
"react": "18.3.1",
|
|
89
|
+
"react-native": "0.75.0-nightly-20240511-3f17c8b5f",
|
|
90
|
+
"react-native-platform-override": "^1.9.36",
|
|
91
91
|
"typescript": "5.0.4"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"@types/react": "^18.2.6",
|
|
95
|
-
"react": "18.2.0",
|
|
96
|
-
"react-native": "0.75.0-nightly-
|
|
95
|
+
"react": "^18.2.0",
|
|
96
|
+
"react-native": "0.75.0-nightly-20240511-3f17c8b5f"
|
|
97
97
|
},
|
|
98
98
|
"beachball": {
|
|
99
99
|
"defaultNpmTag": "canary",
|
package/rn-get-polyfills.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<953d2d7e7adb016bf30c2be62ee0d89a>>
|
|
8
8
|
* @flow strict-local
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -51,7 +51,6 @@ export type ReactNativeFeatureFlags = {
|
|
|
51
51
|
enableMicrotasks: Getter<boolean>,
|
|
52
52
|
enableSynchronousStateUpdates: Getter<boolean>,
|
|
53
53
|
enableUIConsistency: Getter<boolean>,
|
|
54
|
-
fixMountedFlagAndFixPreallocationClone: Getter<boolean>,
|
|
55
54
|
forceBatchingMountItemsOnAndroid: Getter<boolean>,
|
|
56
55
|
inspectorEnableCxxInspectorPackagerConnection: Getter<boolean>,
|
|
57
56
|
inspectorEnableModernCDPRegistry: Getter<boolean>,
|
|
@@ -146,10 +145,6 @@ export const enableSynchronousStateUpdates: Getter<boolean> = createNativeFlagGe
|
|
|
146
145
|
* Ensures that JavaScript always has a consistent view of the state of the UI (e.g.: commits done in other threads are not immediately propagated to JS during its execution).
|
|
147
146
|
*/
|
|
148
147
|
export const enableUIConsistency: Getter<boolean> = createNativeFlagGetter('enableUIConsistency', false);
|
|
149
|
-
/**
|
|
150
|
-
* Splits hasBeenMounted and promoted.
|
|
151
|
-
*/
|
|
152
|
-
export const fixMountedFlagAndFixPreallocationClone: Getter<boolean> = createNativeFlagGetter('fixMountedFlagAndFixPreallocationClone', false);
|
|
153
148
|
/**
|
|
154
149
|
* Forces the mounting layer on Android to always batch mount items instead of dispatching them immediately. This might fix some crashes related to synchronous state updates, where some views dispatch state updates during mount.
|
|
155
150
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<446991ce24c5765399940bfda55c0e5c>>
|
|
8
8
|
* @flow strict-local
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -34,7 +34,6 @@ export interface Spec extends TurboModule {
|
|
|
34
34
|
+enableMicrotasks?: () => boolean;
|
|
35
35
|
+enableSynchronousStateUpdates?: () => boolean;
|
|
36
36
|
+enableUIConsistency?: () => boolean;
|
|
37
|
-
+fixMountedFlagAndFixPreallocationClone?: () => boolean;
|
|
38
37
|
+forceBatchingMountItemsOnAndroid?: () => boolean;
|
|
39
38
|
+inspectorEnableCxxInspectorPackagerConnection?: () => boolean;
|
|
40
39
|
+inspectorEnableModernCDPRegistry?: () => boolean;
|
|
@@ -1,13 +0,0 @@
|
|
|
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 strict
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
module.exports = {};
|