@office-iss/react-native-win32 0.0.0-canary.258 → 0.0.0-canary.259
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 -4
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +16 -8
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/Animated/nodes/AnimatedValue.js +1 -0
- package/Libraries/Animated/useAnimatedProps.js +68 -3
- package/Libraries/BatchedBridge/NativeModules.js +2 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +3 -0
- package/Libraries/Components/TextInput/TextInput.js +204 -73
- package/Libraries/Components/TextInput/TextInput.win32.js +204 -79
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +11 -0
- package/Libraries/Core/ErrorHandlers.js +9 -0
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpReactRefresh.js +0 -4
- package/Libraries/Image/ImageViewNativeComponent.js +1 -0
- package/Libraries/Interaction/TaskQueue.js +1 -0
- package/Libraries/Lists/SectionList.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +3 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +3 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +9 -2
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -0
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +46 -19
- package/Libraries/StyleSheet/StyleSheetTypes.js +48 -23
- package/Libraries/StyleSheet/processBoxShadow.js +211 -0
- package/Libraries/StyleSheet/processFilter.js +24 -14
- package/Libraries/Text/Text.js +394 -212
- package/Libraries/Text/Text.win32.js +442 -245
- package/Libraries/TurboModule/TurboModuleRegistry.js +13 -50
- package/Libraries/Types/CodegenTypes.js +3 -1
- package/Libraries/Utilities/HMRClient.js +1 -0
- package/Libraries/Utilities/Platform.android.js +1 -1
- package/Libraries/Utilities/Platform.d.ts +1 -1
- package/Libraries/Utilities/Platform.flow.js +2 -2
- package/Libraries/Utilities/Platform.flow.win32.js +3 -3
- package/Libraries/Utilities/Platform.ios.js +1 -1
- package/Libraries/Utilities/Platform.win32.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +1 -0
- package/jest/setup.js +8 -1
- package/overrides.json +9 -9
- package/package.json +12 -12
- package/src/private/featureflags/ReactNativeFeatureFlags.js +65 -18
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +11 -4
- package/src/private/specs/modules/NativeLinkingManager.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsAndroid.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsIOS.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsWin.js +8 -1
- package/src/private/webapis/performance/PerformanceEntry.js +1 -1
- package/src/private/webapis/performance/RawPerformanceEntry.js +5 -0
- package/types/experimental.d.ts +12 -1
- package/Libraries/Text/TextOptimized.js +0 -538
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
import type {ViewProps} from '../View/ViewPropTypes';
|
|
18
18
|
import type {TextInputType} from './TextInput.flow';
|
|
19
19
|
|
|
20
|
+
import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
|
|
20
21
|
import usePressability from '../../Pressability/usePressability';
|
|
21
22
|
import flattenStyle from '../../StyleSheet/flattenStyle';
|
|
22
23
|
import StyleSheet, {
|
|
@@ -1000,8 +1001,188 @@ export type Props = $ReadOnly<{|
|
|
|
1000
1001
|
value?: ?Stringish,
|
|
1001
1002
|
|}>;
|
|
1002
1003
|
|
|
1004
|
+
type ViewCommands = $NonMaybeType<
|
|
1005
|
+
| typeof AndroidTextInputCommands
|
|
1006
|
+
| typeof RCTMultilineTextInputNativeCommands
|
|
1007
|
+
| typeof RCTSinglelineTextInputNativeCommands,
|
|
1008
|
+
>;
|
|
1009
|
+
|
|
1010
|
+
type LastNativeSelection = {|
|
|
1011
|
+
selection: Selection,
|
|
1012
|
+
mostRecentEventCount: number,
|
|
1013
|
+
|};
|
|
1014
|
+
|
|
1003
1015
|
const emptyFunctionThatReturnsTrue = () => true;
|
|
1004
1016
|
|
|
1017
|
+
/**
|
|
1018
|
+
* This hook handles the synchronization between the state of the text input
|
|
1019
|
+
* in native and in JavaScript. This is necessary due to the asynchronous nature
|
|
1020
|
+
* of text input events.
|
|
1021
|
+
*/
|
|
1022
|
+
function useTextInputStateSynchronization_STATE({
|
|
1023
|
+
props,
|
|
1024
|
+
mostRecentEventCount,
|
|
1025
|
+
selection,
|
|
1026
|
+
inputRef,
|
|
1027
|
+
text,
|
|
1028
|
+
viewCommands,
|
|
1029
|
+
}: {
|
|
1030
|
+
props: Props,
|
|
1031
|
+
mostRecentEventCount: number,
|
|
1032
|
+
selection: ?Selection,
|
|
1033
|
+
inputRef: React.RefObject<null | React.ElementRef<HostComponent<mixed>>>,
|
|
1034
|
+
text: string,
|
|
1035
|
+
viewCommands: ViewCommands,
|
|
1036
|
+
}): {
|
|
1037
|
+
setLastNativeText: string => void,
|
|
1038
|
+
setLastNativeSelection: LastNativeSelection => void,
|
|
1039
|
+
} {
|
|
1040
|
+
const [lastNativeText, setLastNativeText] = useState<?Stringish>(props.value);
|
|
1041
|
+
const [lastNativeSelectionState, setLastNativeSelection] =
|
|
1042
|
+
useState<LastNativeSelection>({
|
|
1043
|
+
selection: {start: -1, end: -1},
|
|
1044
|
+
mostRecentEventCount: mostRecentEventCount,
|
|
1045
|
+
});
|
|
1046
|
+
|
|
1047
|
+
const lastNativeSelection = lastNativeSelectionState.selection;
|
|
1048
|
+
|
|
1049
|
+
// This is necessary in case native updates the text and JS decides
|
|
1050
|
+
// that the update should be ignored and we should stick with the value
|
|
1051
|
+
// that we have in JS.
|
|
1052
|
+
useLayoutEffect(() => {
|
|
1053
|
+
const nativeUpdate: {text?: string, selection?: Selection} = {};
|
|
1054
|
+
|
|
1055
|
+
if (lastNativeText !== props.value && typeof props.value === 'string') {
|
|
1056
|
+
nativeUpdate.text = props.value;
|
|
1057
|
+
setLastNativeText(props.value);
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
if (
|
|
1061
|
+
selection &&
|
|
1062
|
+
lastNativeSelection &&
|
|
1063
|
+
(lastNativeSelection.start !== selection.start ||
|
|
1064
|
+
lastNativeSelection.end !== selection.end)
|
|
1065
|
+
) {
|
|
1066
|
+
nativeUpdate.selection = selection;
|
|
1067
|
+
setLastNativeSelection({selection, mostRecentEventCount});
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
if (Object.keys(nativeUpdate).length === 0) {
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
if (inputRef.current != null) {
|
|
1075
|
+
viewCommands.setTextAndSelection(
|
|
1076
|
+
inputRef.current,
|
|
1077
|
+
mostRecentEventCount,
|
|
1078
|
+
text,
|
|
1079
|
+
selection?.start ?? -1,
|
|
1080
|
+
selection?.end ?? -1,
|
|
1081
|
+
);
|
|
1082
|
+
}
|
|
1083
|
+
}, [
|
|
1084
|
+
mostRecentEventCount,
|
|
1085
|
+
inputRef,
|
|
1086
|
+
props.value,
|
|
1087
|
+
props.defaultValue,
|
|
1088
|
+
lastNativeText,
|
|
1089
|
+
selection,
|
|
1090
|
+
lastNativeSelection,
|
|
1091
|
+
text,
|
|
1092
|
+
viewCommands,
|
|
1093
|
+
]);
|
|
1094
|
+
|
|
1095
|
+
return {setLastNativeText, setLastNativeSelection};
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
/**
|
|
1099
|
+
* This hook handles the synchronization between the state of the text input
|
|
1100
|
+
* in native and in JavaScript. This is necessary due to the asynchronous nature
|
|
1101
|
+
* of text input events.
|
|
1102
|
+
*/
|
|
1103
|
+
function useTextInputStateSynchronization_REFS({
|
|
1104
|
+
props,
|
|
1105
|
+
mostRecentEventCount,
|
|
1106
|
+
selection,
|
|
1107
|
+
inputRef,
|
|
1108
|
+
text,
|
|
1109
|
+
viewCommands,
|
|
1110
|
+
}: {
|
|
1111
|
+
props: Props,
|
|
1112
|
+
mostRecentEventCount: number,
|
|
1113
|
+
selection: ?Selection,
|
|
1114
|
+
inputRef: React.RefObject<null | React.ElementRef<HostComponent<mixed>>>,
|
|
1115
|
+
text: string,
|
|
1116
|
+
viewCommands: ViewCommands,
|
|
1117
|
+
}): {
|
|
1118
|
+
setLastNativeText: string => void,
|
|
1119
|
+
setLastNativeSelection: LastNativeSelection => void,
|
|
1120
|
+
} {
|
|
1121
|
+
const lastNativeTextRef = useRef<?Stringish>(props.value);
|
|
1122
|
+
const lastNativeSelectionRef = useRef<LastNativeSelection>({
|
|
1123
|
+
selection: {start: -1, end: -1},
|
|
1124
|
+
mostRecentEventCount: mostRecentEventCount,
|
|
1125
|
+
});
|
|
1126
|
+
|
|
1127
|
+
// This is necessary in case native updates the text and JS decides
|
|
1128
|
+
// that the update should be ignored and we should stick with the value
|
|
1129
|
+
// that we have in JS.
|
|
1130
|
+
useLayoutEffect(() => {
|
|
1131
|
+
const nativeUpdate: {text?: string, selection?: Selection} = {};
|
|
1132
|
+
|
|
1133
|
+
const lastNativeSelection = lastNativeSelectionRef.current.selection;
|
|
1134
|
+
|
|
1135
|
+
if (
|
|
1136
|
+
lastNativeTextRef.current !== props.value &&
|
|
1137
|
+
typeof props.value === 'string'
|
|
1138
|
+
) {
|
|
1139
|
+
nativeUpdate.text = props.value;
|
|
1140
|
+
lastNativeTextRef.current = props.value;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
if (
|
|
1144
|
+
selection &&
|
|
1145
|
+
lastNativeSelection &&
|
|
1146
|
+
(lastNativeSelection.start !== selection.start ||
|
|
1147
|
+
lastNativeSelection.end !== selection.end)
|
|
1148
|
+
) {
|
|
1149
|
+
nativeUpdate.selection = selection;
|
|
1150
|
+
lastNativeSelectionRef.current = {selection, mostRecentEventCount};
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
if (Object.keys(nativeUpdate).length === 0) {
|
|
1154
|
+
return;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
if (inputRef.current != null) {
|
|
1158
|
+
viewCommands.setTextAndSelection(
|
|
1159
|
+
inputRef.current,
|
|
1160
|
+
mostRecentEventCount,
|
|
1161
|
+
text,
|
|
1162
|
+
selection?.start ?? -1,
|
|
1163
|
+
selection?.end ?? -1,
|
|
1164
|
+
);
|
|
1165
|
+
}
|
|
1166
|
+
}, [
|
|
1167
|
+
mostRecentEventCount,
|
|
1168
|
+
inputRef,
|
|
1169
|
+
props.value,
|
|
1170
|
+
props.defaultValue,
|
|
1171
|
+
selection,
|
|
1172
|
+
text,
|
|
1173
|
+
viewCommands,
|
|
1174
|
+
]);
|
|
1175
|
+
|
|
1176
|
+
return {
|
|
1177
|
+
setLastNativeText: lastNativeText => {
|
|
1178
|
+
lastNativeTextRef.current = lastNativeText;
|
|
1179
|
+
},
|
|
1180
|
+
setLastNativeSelection: lastNativeSelection => {
|
|
1181
|
+
lastNativeSelectionRef.current = lastNativeSelection;
|
|
1182
|
+
},
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1005
1186
|
/**
|
|
1006
1187
|
* A foundational component for inputting text into the app via a
|
|
1007
1188
|
* keyboard. Props provide configurability for several features, such as
|
|
@@ -1134,7 +1315,6 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1134
1315
|
|
|
1135
1316
|
const inputRef = useRef<null | React.ElementRef<HostComponent<mixed>>>(null);
|
|
1136
1317
|
|
|
1137
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1138
1318
|
const selection: ?Selection =
|
|
1139
1319
|
propsSelection == null
|
|
1140
1320
|
? null
|
|
@@ -1143,34 +1323,6 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1143
1323
|
end: propsSelection.end ?? propsSelection.start,
|
|
1144
1324
|
};
|
|
1145
1325
|
|
|
1146
|
-
const [mostRecentEventCount, setMostRecentEventCount] = useState<number>(0);
|
|
1147
|
-
const [lastNativeText, setLastNativeText] = useState<?Stringish>(props.value);
|
|
1148
|
-
const [lastNativeSelectionState, setLastNativeSelection] = useState<{|
|
|
1149
|
-
selection: Selection,
|
|
1150
|
-
mostRecentEventCount: number,
|
|
1151
|
-
|}>({
|
|
1152
|
-
selection: {start: -1, end: -1},
|
|
1153
|
-
mostRecentEventCount: mostRecentEventCount,
|
|
1154
|
-
});
|
|
1155
|
-
|
|
1156
|
-
const lastNativeSelection = lastNativeSelectionState.selection;
|
|
1157
|
-
|
|
1158
|
-
let viewCommands;
|
|
1159
|
-
if (AndroidTextInputCommands) {
|
|
1160
|
-
viewCommands = AndroidTextInputCommands;
|
|
1161
|
-
}
|
|
1162
|
-
// [Windows
|
|
1163
|
-
else if (WindowsTextInputCommands) {
|
|
1164
|
-
viewCommands = WindowsTextInputCommands;
|
|
1165
|
-
}
|
|
1166
|
-
// Windows]
|
|
1167
|
-
else {
|
|
1168
|
-
viewCommands =
|
|
1169
|
-
props.multiline === true
|
|
1170
|
-
? RCTMultilineTextInputNativeCommands
|
|
1171
|
-
: RCTSinglelineTextInputNativeCommands;
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
1326
|
const text =
|
|
1175
1327
|
typeof props.value === 'string'
|
|
1176
1328
|
? props.value
|
|
@@ -1178,51 +1330,26 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1178
1330
|
? props.defaultValue
|
|
1179
1331
|
: '';
|
|
1180
1332
|
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
if (lastNativeText !== props.value && typeof props.value === 'string') {
|
|
1188
|
-
nativeUpdate.text = props.value;
|
|
1189
|
-
setLastNativeText(props.value);
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
if (
|
|
1193
|
-
selection &&
|
|
1194
|
-
lastNativeSelection &&
|
|
1195
|
-
(lastNativeSelection.start !== selection.start ||
|
|
1196
|
-
lastNativeSelection.end !== selection.end)
|
|
1197
|
-
) {
|
|
1198
|
-
nativeUpdate.selection = selection;
|
|
1199
|
-
setLastNativeSelection({selection, mostRecentEventCount});
|
|
1200
|
-
}
|
|
1333
|
+
const viewCommands =
|
|
1334
|
+
WindowsTextInputCommands || AndroidTextInputCommands || // [Windows]
|
|
1335
|
+
(props.multiline === true
|
|
1336
|
+
? RCTMultilineTextInputNativeCommands
|
|
1337
|
+
: RCTSinglelineTextInputNativeCommands)
|
|
1201
1338
|
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
mostRecentEventCount,
|
|
1217
|
-
inputRef,
|
|
1218
|
-
props.value,
|
|
1219
|
-
props.defaultValue,
|
|
1220
|
-
lastNativeText,
|
|
1221
|
-
selection,
|
|
1222
|
-
lastNativeSelection,
|
|
1223
|
-
text,
|
|
1224
|
-
viewCommands,
|
|
1225
|
-
]);
|
|
1339
|
+
const [mostRecentEventCount, setMostRecentEventCount] = useState<number>(0);
|
|
1340
|
+
const useTextInputStateSynchronization =
|
|
1341
|
+
ReactNativeFeatureFlags.useRefsForTextInputState()
|
|
1342
|
+
? useTextInputStateSynchronization_REFS
|
|
1343
|
+
: useTextInputStateSynchronization_STATE;
|
|
1344
|
+
const {setLastNativeText, setLastNativeSelection} =
|
|
1345
|
+
useTextInputStateSynchronization({
|
|
1346
|
+
props,
|
|
1347
|
+
inputRef,
|
|
1348
|
+
mostRecentEventCount,
|
|
1349
|
+
selection,
|
|
1350
|
+
text,
|
|
1351
|
+
viewCommands,
|
|
1352
|
+
});
|
|
1226
1353
|
|
|
1227
1354
|
useLayoutEffect(() => {
|
|
1228
1355
|
const inputRefValue = inputRef.current;
|
|
@@ -1238,7 +1365,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1238
1365
|
}
|
|
1239
1366
|
};
|
|
1240
1367
|
}
|
|
1241
|
-
}, [
|
|
1368
|
+
}, []);
|
|
1242
1369
|
|
|
1243
1370
|
const setLocalRef = useCallback(
|
|
1244
1371
|
(instance: TextInputInstance | null) => {
|
|
@@ -1514,12 +1641,10 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1514
1641
|
};
|
|
1515
1642
|
}
|
|
1516
1643
|
|
|
1517
|
-
|
|
1518
|
-
|
|
1644
|
+
let style = flattenStyle<TextStyleProp>(props.style);
|
|
1519
1645
|
if (typeof style?.fontWeight === 'number') {
|
|
1520
|
-
// $FlowFixMe
|
|
1521
|
-
|
|
1522
|
-
style.fontWeight = style?.fontWeight.toString();
|
|
1646
|
+
// $FlowFixMe
|
|
1647
|
+
style = [style, {fontWeight: style.fontWeight.toString()}];
|
|
1523
1648
|
}
|
|
1524
1649
|
|
|
1525
1650
|
if (Platform.OS === 'ios') {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import type {AnyAttributeType} from '../../Renderer/shims/ReactNativeTypes';
|
|
12
12
|
|
|
13
13
|
import processAspectRatio from '../../StyleSheet/processAspectRatio';
|
|
14
|
+
import processBoxShadow from '../../StyleSheet/processBoxShadow';
|
|
14
15
|
import processColor from '../../StyleSheet/processColor';
|
|
15
16
|
import processFilter from '../../StyleSheet/processFilter';
|
|
16
17
|
import processFontVariant from '../../StyleSheet/processFontVariant';
|
|
@@ -120,6 +121,16 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
|
|
|
120
121
|
*/
|
|
121
122
|
experimental_filter: {process: processFilter},
|
|
122
123
|
|
|
124
|
+
/**
|
|
125
|
+
* MixBlendMode
|
|
126
|
+
*/
|
|
127
|
+
experimental_mixBlendMode: true,
|
|
128
|
+
|
|
129
|
+
/*
|
|
130
|
+
* BoxShadow
|
|
131
|
+
*/
|
|
132
|
+
experimental_boxShadow: {process: processBoxShadow},
|
|
133
|
+
|
|
123
134
|
/**
|
|
124
135
|
* View
|
|
125
136
|
*/
|
|
@@ -28,14 +28,17 @@ export function onUncaughtError(errorValue: mixed, errorInfo: ErrorInfo): void {
|
|
|
28
28
|
if (errorValue instanceof Error) {
|
|
29
29
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
30
30
|
* this parameters */
|
|
31
|
+
// $FlowFixMe[incompatible-cast]
|
|
31
32
|
error = (errorValue: ExtendedError);
|
|
32
33
|
} else if (typeof errorValue === 'string') {
|
|
33
34
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
34
35
|
* this parameters */
|
|
36
|
+
// $FlowFixMe[incompatible-cast]
|
|
35
37
|
error = (new SyntheticError(errorValue): ExtendedError);
|
|
36
38
|
} else {
|
|
37
39
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
38
40
|
* this parameters */
|
|
41
|
+
// $FlowFixMe[incompatible-cast]
|
|
39
42
|
error = (new SyntheticError('Unspecified error'): ExtendedError);
|
|
40
43
|
}
|
|
41
44
|
try {
|
|
@@ -58,14 +61,17 @@ export function onCaughtError(errorValue: mixed, errorInfo: ErrorInfo): void {
|
|
|
58
61
|
if (errorValue instanceof Error) {
|
|
59
62
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
60
63
|
* this parameters */
|
|
64
|
+
// $FlowFixMe[incompatible-cast]
|
|
61
65
|
error = (errorValue: ExtendedError);
|
|
62
66
|
} else if (typeof errorValue === 'string') {
|
|
63
67
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
64
68
|
* this parameters */
|
|
69
|
+
// $FlowFixMe[incompatible-cast]
|
|
65
70
|
error = (new SyntheticError(errorValue): ExtendedError);
|
|
66
71
|
} else {
|
|
67
72
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
68
73
|
* this parameters */
|
|
74
|
+
// $FlowFixMe[incompatible-cast]
|
|
69
75
|
error = (new SyntheticError('Unspecified error'): ExtendedError);
|
|
70
76
|
}
|
|
71
77
|
try {
|
|
@@ -91,14 +97,17 @@ export function onRecoverableError(
|
|
|
91
97
|
if (errorValue instanceof Error) {
|
|
92
98
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
93
99
|
* this parameters */
|
|
100
|
+
// $FlowFixMe[incompatible-cast]
|
|
94
101
|
error = (errorValue: ExtendedError);
|
|
95
102
|
} else if (typeof errorValue === 'string') {
|
|
96
103
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
97
104
|
* this parameters */
|
|
105
|
+
// $FlowFixMe[incompatible-cast]
|
|
98
106
|
error = (new SyntheticError(errorValue): ExtendedError);
|
|
99
107
|
} else {
|
|
100
108
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
101
109
|
* this parameters */
|
|
110
|
+
// $FlowFixMe[incompatible-cast]
|
|
102
111
|
error = (new SyntheticError('Unspecified error'): ExtendedError);
|
|
103
112
|
}
|
|
104
113
|
try {
|
|
@@ -154,6 +154,7 @@ function handleException(e: mixed, isFatal: boolean) {
|
|
|
154
154
|
inExceptionHandler = true;
|
|
155
155
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
|
156
156
|
* parameters */
|
|
157
|
+
// $FlowFixMe[incompatible-call]
|
|
157
158
|
reportException(error, isFatal, /*reportToConsole*/ true);
|
|
158
159
|
} finally {
|
|
159
160
|
inExceptionHandler = false;
|
|
@@ -225,6 +226,7 @@ function reactConsoleErrorHandler(...args) {
|
|
|
225
226
|
reportException(
|
|
226
227
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
|
227
228
|
* parameters */
|
|
229
|
+
// $FlowFixMe[incompatible-call]
|
|
228
230
|
error,
|
|
229
231
|
false, // isFatal
|
|
230
232
|
false, // reportToConsole
|
|
@@ -32,14 +32,17 @@ const ReactFiberErrorDialog = {
|
|
|
32
32
|
if (errorValue instanceof Error) {
|
|
33
33
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
34
34
|
* this parameters */
|
|
35
|
+
// $FlowFixMe[incompatible-cast]
|
|
35
36
|
error = (errorValue: ExtendedError);
|
|
36
37
|
} else if (typeof errorValue === 'string') {
|
|
37
38
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
38
39
|
* this parameters */
|
|
40
|
+
// $FlowFixMe[incompatible-cast]
|
|
39
41
|
error = (new SyntheticError(errorValue): ExtendedError);
|
|
40
42
|
} else {
|
|
41
43
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
42
44
|
* this parameters */
|
|
45
|
+
// $FlowFixMe[incompatible-cast]
|
|
43
46
|
error = (new SyntheticError('Unspecified error'): ExtendedError);
|
|
44
47
|
}
|
|
45
48
|
try {
|
|
@@ -36,10 +36,6 @@ if (__DEV__) {
|
|
|
36
36
|
register: ReactRefreshRuntime.register,
|
|
37
37
|
|
|
38
38
|
performReactRefresh() {
|
|
39
|
-
if (ReactRefreshRuntime.hasUnrecoverableErrors()) {
|
|
40
|
-
DevSettings.reload('Fast Refresh - Unrecoverable');
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
39
|
ReactRefreshRuntime.performReactRefresh();
|
|
44
40
|
DevSettings.onFastRefresh();
|
|
45
41
|
},
|
|
@@ -55,7 +55,7 @@ type OptionalProps<SectionT: SectionBase<any>> = {|
|
|
|
55
55
|
...
|
|
56
56
|
},
|
|
57
57
|
...
|
|
58
|
-
}) => null | React.
|
|
58
|
+
}) => null | React.Node,
|
|
59
59
|
/**
|
|
60
60
|
* A marker property for telling the list to re-render (since it implements `PureComponent`). If
|
|
61
61
|
* any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the
|
|
@@ -419,6 +419,7 @@ export function withSubscription(
|
|
|
419
419
|
componentDidCatch(err: Error, errorInfo: {componentStack: string, ...}) {
|
|
420
420
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
421
421
|
* this parameters */
|
|
422
|
+
// $FlowFixMe[incompatible-call]
|
|
422
423
|
reportLogBoxError(err, errorInfo.componentStack);
|
|
423
424
|
}
|
|
424
425
|
|
|
@@ -169,6 +169,7 @@ const validAttributesForNonEventProps = {
|
|
|
169
169
|
experimental_filter: {
|
|
170
170
|
process: require('../StyleSheet/processFilter').default,
|
|
171
171
|
},
|
|
172
|
+
experimental_mixBlendMode: true,
|
|
172
173
|
opacity: true,
|
|
173
174
|
elevation: true,
|
|
174
175
|
shadowColor: {process: require('../StyleSheet/processColor').default},
|
|
@@ -223,6 +223,9 @@ const validAttributesForNonEventProps = {
|
|
|
223
223
|
experimental_filter: {
|
|
224
224
|
process: require('../StyleSheet/processFilter').default,
|
|
225
225
|
},
|
|
226
|
+
experimental_boxShadow: {
|
|
227
|
+
process: require('../StyleSheet/processBoxShadow').default,
|
|
228
|
+
},
|
|
226
229
|
|
|
227
230
|
borderTopWidth: true,
|
|
228
231
|
borderTopColor: {process: require('../StyleSheet/processColor').default},
|
|
@@ -223,6 +223,9 @@ const validAttributesForNonEventProps = {
|
|
|
223
223
|
experimental_filter: {
|
|
224
224
|
process: require('../StyleSheet/processFilter').default,
|
|
225
225
|
},
|
|
226
|
+
experimental_boxShadow: {
|
|
227
|
+
process: require('../StyleSheet/processBoxShadow').default,
|
|
228
|
+
},
|
|
226
229
|
|
|
227
230
|
borderTopWidth: true,
|
|
228
231
|
borderTopColor: {process: require('../StyleSheet/processColor').default},
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import type {
|
|
12
12
|
HostComponent,
|
|
13
13
|
PartialViewConfig,
|
|
14
|
+
ViewConfig,
|
|
14
15
|
} from '../Renderer/shims/ReactNativeTypes';
|
|
15
16
|
|
|
16
17
|
import getNativeComponentAttributes from '../ReactNative/getNativeComponentAttributes';
|
|
@@ -60,7 +61,7 @@ export function get<Config>(
|
|
|
60
61
|
verify: false,
|
|
61
62
|
};
|
|
62
63
|
|
|
63
|
-
let viewConfig;
|
|
64
|
+
let viewConfig: ViewConfig;
|
|
64
65
|
if (native) {
|
|
65
66
|
viewConfig =
|
|
66
67
|
getNativeComponentAttributes(name) ??
|
|
@@ -81,7 +82,13 @@ export function get<Config>(
|
|
|
81
82
|
const nativeViewConfig = native
|
|
82
83
|
? viewConfig
|
|
83
84
|
: getNativeComponentAttributes(name);
|
|
84
|
-
|
|
85
|
+
|
|
86
|
+
if (nativeViewConfig == null) {
|
|
87
|
+
// Defer to static view config if native view config is missing.
|
|
88
|
+
return viewConfig;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const staticViewConfig: ViewConfig = native
|
|
85
92
|
? createViewConfig(viewConfigProvider())
|
|
86
93
|
: viewConfig;
|
|
87
94
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @noformat
|
|
8
8
|
* @nolint
|
|
9
9
|
* @flow strict
|
|
10
|
-
* @generated SignedSource<<
|
|
10
|
+
* @generated SignedSource<<4405023a5d82ddc01db31d8eb46a7aa0>>
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type {ElementRef, ElementType, Element, AbstractComponent} from 'react';
|
|
@@ -86,6 +86,7 @@ export type ViewConfig = $ReadOnly<{
|
|
|
86
86
|
}>,
|
|
87
87
|
...
|
|
88
88
|
}>,
|
|
89
|
+
supportsRawText?: boolean,
|
|
89
90
|
uiViewClassName: string,
|
|
90
91
|
validAttributes: AttributeConfiguration,
|
|
91
92
|
}>;
|
|
@@ -93,6 +94,7 @@ export type ViewConfig = $ReadOnly<{
|
|
|
93
94
|
export type PartialViewConfig = $ReadOnly<{
|
|
94
95
|
bubblingEventTypes?: $PropertyType<ViewConfig, 'bubblingEventTypes'>,
|
|
95
96
|
directEventTypes?: $PropertyType<ViewConfig, 'directEventTypes'>,
|
|
97
|
+
supportsRawText?: boolean,
|
|
96
98
|
uiViewClassName: string,
|
|
97
99
|
validAttributes?: PartialAttributeConfiguration,
|
|
98
100
|
}>;
|
|
@@ -11,25 +11,6 @@ import {Animated} from '../Animated/Animated';
|
|
|
11
11
|
import {ImageResizeMode} from '../Image/ImageResizeMode';
|
|
12
12
|
import {ColorValue} from './StyleSheet';
|
|
13
13
|
|
|
14
|
-
export type FilterPrimitive =
|
|
15
|
-
| {brightness: number | string}
|
|
16
|
-
| {blur: number | string}
|
|
17
|
-
| {contrast: number | string}
|
|
18
|
-
| {grayscale: number | string}
|
|
19
|
-
| {'hue-rotate': number | string}
|
|
20
|
-
| {invert: number | string}
|
|
21
|
-
| {opacity: number | string}
|
|
22
|
-
| {saturate: number | string}
|
|
23
|
-
| {sepia: number | string}
|
|
24
|
-
| {'drop-shadow': DropShadowPrimitive | string};
|
|
25
|
-
|
|
26
|
-
export type DropShadowPrimitive = {
|
|
27
|
-
offsetX: number | string;
|
|
28
|
-
offsetY: number | string;
|
|
29
|
-
standardDeviation?: number | string | undefined;
|
|
30
|
-
color?: ColorValue | number | undefined;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
14
|
type FlexAlignType =
|
|
34
15
|
| 'flex-start'
|
|
35
16
|
| 'flex-end'
|
|
@@ -246,6 +227,52 @@ export interface TransformsStyle {
|
|
|
246
227
|
translateY?: AnimatableNumericValue | undefined;
|
|
247
228
|
}
|
|
248
229
|
|
|
230
|
+
export type FilterFunction =
|
|
231
|
+
| {brightness: number | string}
|
|
232
|
+
| {blur: number | string}
|
|
233
|
+
| {contrast: number | string}
|
|
234
|
+
| {grayscale: number | string}
|
|
235
|
+
| {hueRotate: number | string}
|
|
236
|
+
| {invert: number | string}
|
|
237
|
+
| {opacity: number | string}
|
|
238
|
+
| {saturate: number | string}
|
|
239
|
+
| {sepia: number | string}
|
|
240
|
+
| {dropShadow: DropShadowPrimitive | string};
|
|
241
|
+
|
|
242
|
+
export type DropShadowPrimitive = {
|
|
243
|
+
offsetX: number | string;
|
|
244
|
+
offsetY: number | string;
|
|
245
|
+
standardDeviation?: number | string | undefined;
|
|
246
|
+
color?: ColorValue | number | undefined;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export type BoxShadowPrimitive = {
|
|
250
|
+
offsetX: number | string;
|
|
251
|
+
offsetY: number | string;
|
|
252
|
+
color?: string | undefined;
|
|
253
|
+
blurRadius?: ColorValue | number | undefined;
|
|
254
|
+
spreadDistance?: number | string | undefined;
|
|
255
|
+
inset?: boolean | undefined;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
export type BlendMode =
|
|
259
|
+
| 'normal'
|
|
260
|
+
| 'multiply'
|
|
261
|
+
| 'screen'
|
|
262
|
+
| 'overlay'
|
|
263
|
+
| 'darken'
|
|
264
|
+
| 'lighten'
|
|
265
|
+
| 'color-dodge'
|
|
266
|
+
| 'color-burn'
|
|
267
|
+
| 'hard-light'
|
|
268
|
+
| 'soft-light'
|
|
269
|
+
| 'difference'
|
|
270
|
+
| 'exclusion'
|
|
271
|
+
| 'hue'
|
|
272
|
+
| 'saturation'
|
|
273
|
+
| 'color'
|
|
274
|
+
| 'luminosity';
|
|
275
|
+
|
|
249
276
|
/**
|
|
250
277
|
* @see https://reactnative.dev/docs/view#style
|
|
251
278
|
*/
|