@office-iss/react-native-win32 0.68.0 → 0.69.0-preview.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 +1 -3
- package/CHANGELOG.json +356 -32
- package/CHANGELOG.md +150 -19
- package/IntegrationTests/BUCK +4 -1
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +7 -0
- package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +1 -0
- package/Libraries/Alert/Alert.win32.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +1 -1
- package/Libraries/Animated/NativeAnimatedHelper.js +55 -9
- package/Libraries/Animated/NativeAnimatedModule.js +1 -0
- package/Libraries/Animated/NativeAnimatedTurboModule.js +1 -0
- package/Libraries/Animated/animations/TimingAnimation.js +6 -11
- package/Libraries/Animated/createAnimatedComponent.js +2 -2
- package/Libraries/Animated/nodes/AnimatedColor.js +95 -29
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +19 -22
- package/Libraries/Animated/nodes/AnimatedNode.js +2 -2
- package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
- package/Libraries/AppState/AppState.js +1 -1
- package/Libraries/Blob/URL.js +7 -1
- package/Libraries/Components/Button.js +3 -0
- package/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +5 -0
- package/Libraries/Components/Pressable/Pressable.js +3 -3
- package/Libraries/Components/Pressable/Pressable.win32.js +3 -3
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +47 -38
- package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +15 -7
- package/Libraries/Components/ScrollView/ScrollView.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +16 -3
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +3 -1
- package/Libraries/Components/Slider/Slider.js +0 -2
- package/Libraries/Components/Slider/SliderNativeComponent.js +0 -1
- package/Libraries/Components/StatusBar/StatusBar.js +6 -1
- package/Libraries/Components/Switch/Switch.js +11 -1
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +114 -109
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +17 -9
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +13 -5
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +10 -0
- package/Libraries/Components/TextInput/TextInput.js +1 -8
- package/Libraries/Components/TextInput/TextInputState.js +10 -2
- package/Libraries/Components/TextInput/TextInputState.win32.js +10 -2
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -0
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -0
- package/Libraries/Components/Touchable/TouchableOpacity.js +7 -1
- package/Libraries/Components/Touchable/TouchableWin32.Props.d.ts +3 -1
- package/Libraries/Components/Touchable/TouchableWin32.Props.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +1 -0
- package/Libraries/Components/View/View.win32.js +33 -1
- package/Libraries/Components/View/ViewNativeComponent.js +68 -8
- package/Libraries/Components/View/ViewPropTypes.js +36 -4
- package/Libraries/Components/View/ViewPropTypes.win32.js +36 -4
- package/Libraries/Components/View/ViewWin32.Props.d.ts +1 -1
- package/Libraries/Components/View/ViewWin32.Props.js.map +1 -1
- package/Libraries/Core/Devtools/parseHermesStack.js +1 -1
- package/Libraries/Core/ExceptionsManager.js +1 -1
- package/Libraries/Core/RawEventEmitter.js +38 -0
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/polyfillPromise.js +32 -0
- package/Libraries/Core/setUpReactDevTools.js +3 -2
- package/Libraries/EventEmitter/NativeEventEmitter.js +3 -3
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +2 -1
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +3 -3
- package/Libraries/Events/CustomEvent.js +32 -0
- package/Libraries/Events/EventPolyfill.js +239 -0
- package/Libraries/Image/Image.android.js +0 -6
- package/Libraries/Image/Image.ios.js +0 -6
- package/Libraries/Image/Image.win32.js +2 -8
- package/Libraries/Image/ImageViewNativeComponent.js +18 -3
- package/Libraries/Image/TextInlineImageNativeComponent.js +23 -15
- package/Libraries/Image/resolveAssetSource.win32.js +1 -1
- package/Libraries/Inspector/Inspector.js +2 -4
- package/Libraries/Inspector/Inspector.win32.js +7 -9
- package/Libraries/Interaction/BridgeSpyStallHandler.js +4 -3
- package/Libraries/Interaction/InteractionManager.js +1 -12
- package/Libraries/Interaction/TaskQueue.js +5 -4
- package/Libraries/LayoutAnimation/LayoutAnimation.js +13 -0
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.js +27 -6
- package/Libraries/Lists/VirtualizedList.js +71 -55
- package/Libraries/Lists/VirtualizedListContext.js +7 -3
- package/Libraries/Lists/VirtualizedSectionList.js +2 -2
- package/Libraries/Lists/__tests__/{FillRateHelper-test.windows.js → FillRateHelper-test.js} +2 -2
- package/Libraries/Lists/__tests__/{FlatList-test.windows.js → FlatList-test.js} +2 -2
- package/Libraries/Lists/__tests__/{SectionList-test.windows.js → SectionList-test.js} +14 -14
- package/Libraries/Lists/__tests__/{VirtualizeUtils-test.windows.js → VirtualizeUtils-test.js} +3 -3
- package/Libraries/Lists/__tests__/{VirtualizedList-test.windows.js → VirtualizedList-test.js} +92 -43
- package/Libraries/Lists/__tests__/{VirtualizedSectionList-test.windows.js → VirtualizedSectionList-test.js} +16 -14
- package/Libraries/LogBox/Data/LogBoxData.js +2 -2
- package/Libraries/LogBox/Data/LogBoxLog.js +1 -1
- package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/LogBox.js +2 -21
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -0
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +2 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +295 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +333 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +334 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +0 -2
- package/Libraries/NativeComponent/PlatformBaseViewConfig.js +24 -0
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +7 -42
- package/Libraries/NativeComponent/ViewConfig.js +4 -4
- package/Libraries/NativeComponent/ViewConfigIgnore.js +54 -0
- package/Libraries/Network/FormData.js +7 -1
- package/Libraries/Network/RCTNetworking.win32.js +1 -1
- package/Libraries/Pressability/Pressability.js +115 -46
- package/Libraries/Pressability/Pressability.win32.js +174 -69
- package/Libraries/Pressability/PressabilityDebug.js +5 -9
- package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +1 -0
- package/Libraries/ReactNative/AppContainer.js +1 -1
- package/Libraries/ReactNative/{DummyUIManager.js → BridgelessUIManager.js} +62 -40
- package/Libraries/ReactNative/PaperUIManager.win32.js +5 -5
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +39 -0
- package/Libraries/ReactNative/UIManager.js +2 -3
- package/Libraries/ReactNative/renderApplication.js +4 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +8 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +5908 -4906
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +2100 -1918
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +2567 -2352
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5610 -4844
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1710 -1556
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1830 -1639
- package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +2 -1
- package/Libraries/StyleSheet/EdgeInsetsPropType.js +4 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +59 -66
- package/Libraries/StyleSheet/normalizeColor.js +1 -1
- package/Libraries/StyleSheet/private/_StyleSheetTypesOverrides.js +15 -0
- package/Libraries/StyleSheet/private/_TransformStyle.js +53 -0
- package/Libraries/Text/Text.js +13 -7
- package/Libraries/Text/TextNativeComponent.js +2 -0
- package/Libraries/Text/TextNativeComponent.win32.js +2 -0
- package/Libraries/Text/TextProps.js +10 -0
- package/Libraries/Types/CoreEventTypes.js +13 -1
- package/Libraries/Types/CoreEventTypes.win32.js +26 -1
- package/Libraries/Utilities/Appearance.js +0 -8
- package/Libraries/Utilities/HMRClient.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -0
- package/Libraries/Utilities/codegenNativeComponent.js +17 -6
- package/Libraries/Utilities/stringifySafe.js +4 -1
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +3 -3
- package/Libraries/WebSocket/WebSocket.js +1 -1
- package/Libraries/vendor/emitter/_EmitterSubscription.js +1 -1
- package/Libraries/vendor/emitter/_EventEmitter.js +1 -1
- package/Libraries/vendor/emitter/_EventSubscription.js +1 -1
- package/index.js +30 -25
- package/index.win32.js +30 -25
- package/jest/preprocessor.js +24 -107
- package/jest/preprocessor_DO_NOT_USE.js +122 -0
- package/metro.config.js +3 -47
- package/overrides.json +39 -46
- package/package.json +30 -29
- package/rntypes/index.d.ts +19 -7
- package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +1 -1
- package/src/Libraries/Components/Touchable/TouchableWin32.Props.tsx +3 -1
- package/src/Libraries/Components/View/ViewWin32.Props.ts +1 -0
- package/src/Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap +427 -0
- package/src/Libraries/Lists/__tests__/__snapshots__/SectionList-test.js.snap +391 -0
- package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizeUtils-test.js.snap +3 -0
- package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap +4565 -0
- package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizedSectionList-test.js.snap +1153 -0
- package/src/rntypes/index.d.ts +19 -7
- package/typings-index.js +5 -1
- package/typings-index.js.map +1 -1
- package/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js +0 -44
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js +0 -45
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +0 -123
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.js +0 -45
- package/Libraries/Components/View/ReactNativeViewViewConfig.js +0 -360
- package/Libraries/Components/View/ReactNativeViewViewConfig.win32.js +0 -401
- package/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js +0 -83
- package/Libraries/ReactNative/UIManagerInjection.js +0 -15
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +0 -24527
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +0 -8309
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +0 -8961
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +0 -24948
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +0 -8400
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +0 -9049
- package/flow/Promise.js +0 -47
|
@@ -143,6 +143,13 @@ const ActionSheetIOS = {
|
|
|
143
143
|
successCallback,
|
|
144
144
|
);
|
|
145
145
|
},
|
|
146
|
+
|
|
147
|
+
dismissActionSheet: () => {
|
|
148
|
+
invariant(RCTActionSheetManager, "ActionSheetManager doesn't exist");
|
|
149
|
+
if (typeof RCTActionSheetManager.dismissActionSheet === 'function') {
|
|
150
|
+
RCTActionSheetManager.dismissActionSheet();
|
|
151
|
+
}
|
|
152
|
+
},
|
|
146
153
|
};
|
|
147
154
|
|
|
148
155
|
module.exports = ActionSheetIOS;
|
|
@@ -47,6 +47,7 @@ export interface Spec extends TurboModule {
|
|
|
47
47
|
|}) => void,
|
|
48
48
|
successCallback: (completed: boolean, activityType: ?string) => void,
|
|
49
49
|
) => void;
|
|
50
|
+
+dismissActionSheet?: () => void;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
export default (TurboModuleRegistry.get<Spec>('ActionSheetManager'): ?Spec);
|
|
@@ -90,6 +90,18 @@ const API = {
|
|
|
90
90
|
NativeAnimatedModule.createAnimatedNode(tag, config),
|
|
91
91
|
);
|
|
92
92
|
},
|
|
93
|
+
updateAnimatedNodeConfig: function (
|
|
94
|
+
tag: number,
|
|
95
|
+
config: AnimatedNodeConfig,
|
|
96
|
+
): void {
|
|
97
|
+
invariant(NativeAnimatedModule, 'Native animated module is not available');
|
|
98
|
+
if (typeof NativeAnimatedModule.updateAnimatedNodeConfig === 'function') {
|
|
99
|
+
API.queueOperation(() =>
|
|
100
|
+
// $FlowIgnore[not-a-function] - checked above
|
|
101
|
+
NativeAnimatedModule.updateAnimatedNodeConfig(tag, config),
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
},
|
|
93
105
|
startListeningToAnimatedNodeValue: function (tag: number) {
|
|
94
106
|
invariant(NativeAnimatedModule, 'Native animated module is not available');
|
|
95
107
|
API.queueOperation(() =>
|
|
@@ -222,22 +234,36 @@ const API = {
|
|
|
222
234
|
/**
|
|
223
235
|
* Styles allowed by the native animated implementation.
|
|
224
236
|
*
|
|
225
|
-
* In general native animated implementation should support any numeric property that
|
|
226
|
-
* to be updated through the shadow view hierarchy (all non-layout properties).
|
|
237
|
+
* In general native animated implementation should support any numeric or color property that
|
|
238
|
+
* doesn't need to be updated through the shadow view hierarchy (all non-layout properties).
|
|
227
239
|
*/
|
|
240
|
+
const SUPPORTED_COLOR_STYLES = {
|
|
241
|
+
backgroundColor: true,
|
|
242
|
+
borderBottomColor: true,
|
|
243
|
+
borderColor: true,
|
|
244
|
+
borderEndColor: true,
|
|
245
|
+
borderLeftColor: true,
|
|
246
|
+
borderRightColor: true,
|
|
247
|
+
borderStartColor: true,
|
|
248
|
+
borderTopColor: true,
|
|
249
|
+
color: true,
|
|
250
|
+
tintColor: true,
|
|
251
|
+
};
|
|
252
|
+
|
|
228
253
|
const SUPPORTED_STYLES = {
|
|
229
|
-
|
|
230
|
-
transform: true,
|
|
231
|
-
borderRadius: true,
|
|
254
|
+
...SUPPORTED_COLOR_STYLES,
|
|
232
255
|
borderBottomEndRadius: true,
|
|
233
256
|
borderBottomLeftRadius: true,
|
|
234
257
|
borderBottomRightRadius: true,
|
|
235
258
|
borderBottomStartRadius: true,
|
|
259
|
+
borderRadius: true,
|
|
236
260
|
borderTopEndRadius: true,
|
|
237
261
|
borderTopLeftRadius: true,
|
|
238
262
|
borderTopRightRadius: true,
|
|
239
263
|
borderTopStartRadius: true,
|
|
240
264
|
elevation: true,
|
|
265
|
+
opacity: true,
|
|
266
|
+
transform: true,
|
|
241
267
|
zIndex: true,
|
|
242
268
|
/* ios styles */
|
|
243
269
|
shadowOpacity: true,
|
|
@@ -282,6 +308,22 @@ function addWhitelistedInterpolationParam(param: string): void {
|
|
|
282
308
|
SUPPORTED_INTERPOLATION_PARAMS[param] = true;
|
|
283
309
|
}
|
|
284
310
|
|
|
311
|
+
function isSupportedColorStyleProp(prop: string): boolean {
|
|
312
|
+
return SUPPORTED_COLOR_STYLES.hasOwnProperty(prop);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function isSupportedStyleProp(prop: string): boolean {
|
|
316
|
+
return SUPPORTED_STYLES.hasOwnProperty(prop);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function isSupportedTransformProp(prop: string): boolean {
|
|
320
|
+
return SUPPORTED_TRANSFORMS.hasOwnProperty(prop);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function isSupportedInterpolationParam(param: string): boolean {
|
|
324
|
+
return SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(param);
|
|
325
|
+
}
|
|
326
|
+
|
|
285
327
|
function validateTransform(
|
|
286
328
|
configs: Array<
|
|
287
329
|
| {
|
|
@@ -299,7 +341,7 @@ function validateTransform(
|
|
|
299
341
|
>,
|
|
300
342
|
): void {
|
|
301
343
|
configs.forEach(config => {
|
|
302
|
-
if (!
|
|
344
|
+
if (!isSupportedTransformProp(config.property)) {
|
|
303
345
|
throw new Error(
|
|
304
346
|
`Property '${config.property}' is not supported by native animated module`,
|
|
305
347
|
);
|
|
@@ -309,7 +351,7 @@ function validateTransform(
|
|
|
309
351
|
|
|
310
352
|
function validateStyles(styles: {[key: string]: ?number, ...}): void {
|
|
311
353
|
for (const key in styles) {
|
|
312
|
-
if (!
|
|
354
|
+
if (!isSupportedStyleProp(key)) {
|
|
313
355
|
throw new Error(
|
|
314
356
|
`Style property '${key}' is not supported by native animated module`,
|
|
315
357
|
);
|
|
@@ -319,7 +361,7 @@ function validateStyles(styles: {[key: string]: ?number, ...}): void {
|
|
|
319
361
|
|
|
320
362
|
function validateInterpolation(config: InterpolationConfigType): void {
|
|
321
363
|
for (const key in config) {
|
|
322
|
-
if (!
|
|
364
|
+
if (!isSupportedInterpolationParam(key)) {
|
|
323
365
|
throw new Error(
|
|
324
366
|
`Interpolation property '${key}' is not supported by native animated module`,
|
|
325
367
|
);
|
|
@@ -342,7 +384,7 @@ function assertNativeAnimatedModule(): void {
|
|
|
342
384
|
let _warnedMissingNativeAnimated = false;
|
|
343
385
|
|
|
344
386
|
function shouldUseNativeDriver(
|
|
345
|
-
config: {...AnimationConfig, ...} | EventConfig,
|
|
387
|
+
config: $ReadOnly<{...AnimationConfig, ...}> | EventConfig,
|
|
346
388
|
): boolean {
|
|
347
389
|
if (config.useNativeDriver == null) {
|
|
348
390
|
console.warn(
|
|
@@ -385,6 +427,10 @@ function transformDataType(value: number | string): number | string {
|
|
|
385
427
|
|
|
386
428
|
module.exports = {
|
|
387
429
|
API,
|
|
430
|
+
isSupportedColorStyleProp,
|
|
431
|
+
isSupportedStyleProp,
|
|
432
|
+
isSupportedTransformProp,
|
|
433
|
+
isSupportedInterpolationParam,
|
|
388
434
|
addWhitelistedStyleProp,
|
|
389
435
|
addWhitelistedTransformProp,
|
|
390
436
|
addWhitelistedInterpolationParam,
|
|
@@ -29,6 +29,7 @@ export interface Spec extends TurboModule {
|
|
|
29
29
|
+startOperationBatch: () => void;
|
|
30
30
|
+finishOperationBatch: () => void;
|
|
31
31
|
+createAnimatedNode: (tag: number, config: AnimatedNodeConfig) => void;
|
|
32
|
+
+updateAnimatedNodeConfig?: (tag: number, config: AnimatedNodeConfig) => void;
|
|
32
33
|
+getValue: (tag: number, saveValueCallback: SaveValueCallback) => void;
|
|
33
34
|
+startListeningToAnimatedNodeValue: (tag: number) => void;
|
|
34
35
|
+stopListeningToAnimatedNodeValue: (tag: number) => void;
|
|
@@ -29,6 +29,7 @@ export interface Spec extends TurboModule {
|
|
|
29
29
|
+startOperationBatch: () => void;
|
|
30
30
|
+finishOperationBatch: () => void;
|
|
31
31
|
+createAnimatedNode: (tag: number, config: AnimatedNodeConfig) => void;
|
|
32
|
+
+updateAnimatedNodeConfig?: (tag: number, config: AnimatedNodeConfig) => void;
|
|
32
33
|
+getValue: (tag: number, saveValueCallback: SaveValueCallback) => void;
|
|
33
34
|
+startListeningToAnimatedNodeValue: (tag: number) => void;
|
|
34
35
|
+stopListeningToAnimatedNodeValue: (tag: number) => void;
|
|
@@ -19,10 +19,11 @@ const {shouldUseNativeDriver} = require('../NativeAnimatedHelper');
|
|
|
19
19
|
|
|
20
20
|
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
21
21
|
import type {AnimationConfig, EndCallback} from './Animation';
|
|
22
|
+
import type {RgbaValue} from '../nodes/AnimatedColor';
|
|
22
23
|
|
|
23
24
|
import AnimatedColor from '../nodes/AnimatedColor';
|
|
24
25
|
|
|
25
|
-
export type TimingAnimationConfig = {
|
|
26
|
+
export type TimingAnimationConfig = $ReadOnly<{
|
|
26
27
|
...AnimationConfig,
|
|
27
28
|
toValue:
|
|
28
29
|
| number
|
|
@@ -33,27 +34,21 @@ export type TimingAnimationConfig = {
|
|
|
33
34
|
...
|
|
34
35
|
}
|
|
35
36
|
| AnimatedValueXY
|
|
36
|
-
|
|
|
37
|
-
r: number,
|
|
38
|
-
g: number,
|
|
39
|
-
b: number,
|
|
40
|
-
a: number,
|
|
41
|
-
...
|
|
42
|
-
}
|
|
37
|
+
| RgbaValue
|
|
43
38
|
| AnimatedColor
|
|
44
39
|
| AnimatedInterpolation,
|
|
45
40
|
easing?: (value: number) => number,
|
|
46
41
|
duration?: number,
|
|
47
42
|
delay?: number,
|
|
48
|
-
}
|
|
43
|
+
}>;
|
|
49
44
|
|
|
50
|
-
export type TimingAnimationConfigSingle = {
|
|
45
|
+
export type TimingAnimationConfigSingle = $ReadOnly<{
|
|
51
46
|
...AnimationConfig,
|
|
52
47
|
toValue: number | AnimatedValue | AnimatedInterpolation,
|
|
53
48
|
easing?: (value: number) => number,
|
|
54
49
|
duration?: number,
|
|
55
50
|
delay?: number,
|
|
56
|
-
}
|
|
51
|
+
}>;
|
|
57
52
|
|
|
58
53
|
let _easeInOut;
|
|
59
54
|
function easeInOut() {
|
|
@@ -24,8 +24,8 @@ const setAndForwardRef = require('../Utilities/setAndForwardRef');
|
|
|
24
24
|
let animatedComponentNextId = 1;
|
|
25
25
|
|
|
26
26
|
export type AnimatedComponentType<
|
|
27
|
-
Props: {+[string]: mixed, ...},
|
|
28
|
-
Instance,
|
|
27
|
+
-Props: {+[string]: mixed, ...},
|
|
28
|
+
+Instance = mixed,
|
|
29
29
|
> = React.AbstractComponent<
|
|
30
30
|
$ObjMap<
|
|
31
31
|
Props &
|
|
@@ -14,12 +14,15 @@ import AnimatedValue from './AnimatedValue';
|
|
|
14
14
|
import AnimatedWithChildren from './AnimatedWithChildren';
|
|
15
15
|
import normalizeColor from '../../StyleSheet/normalizeColor';
|
|
16
16
|
import {processColorObject} from '../../StyleSheet/PlatformColorValueTypes';
|
|
17
|
+
import NativeAnimatedHelper from '../NativeAnimatedHelper';
|
|
17
18
|
|
|
19
|
+
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
18
20
|
import type {ColorValue} from '../../StyleSheet/StyleSheet';
|
|
19
21
|
import type {NativeColorValue} from '../../StyleSheet/PlatformColorValueTypes';
|
|
22
|
+
import type {ProcessedColorValue} from '../../StyleSheet/processColor';
|
|
20
23
|
|
|
21
24
|
type ColorListenerCallback = (value: string) => mixed;
|
|
22
|
-
type RgbaValue = {
|
|
25
|
+
export type RgbaValue = {
|
|
23
26
|
+r: number,
|
|
24
27
|
+g: number,
|
|
25
28
|
+b: number,
|
|
@@ -38,26 +41,37 @@ const defaultColor: RgbaValue = {r: 0, g: 0, b: 0, a: 1.0};
|
|
|
38
41
|
let _uniqueId = 1;
|
|
39
42
|
|
|
40
43
|
/* eslint no-bitwise: 0 */
|
|
41
|
-
function processColor(
|
|
44
|
+
function processColor(
|
|
45
|
+
color?: ?(ColorValue | RgbaValue),
|
|
46
|
+
): ?(RgbaValue | NativeColorValue) {
|
|
42
47
|
if (color === undefined || color === null) {
|
|
43
48
|
return null;
|
|
44
49
|
}
|
|
45
50
|
|
|
46
|
-
|
|
51
|
+
if (isRgbaValue(color)) {
|
|
52
|
+
// $FlowIgnore[incompatible-cast] - Type is verified above
|
|
53
|
+
return (color: RgbaValue);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let normalizedColor: ?ProcessedColorValue = normalizeColor(
|
|
57
|
+
// $FlowIgnore[incompatible-cast] - Type is verified above
|
|
58
|
+
(color: ColorValue),
|
|
59
|
+
);
|
|
47
60
|
if (normalizedColor === undefined || normalizedColor === null) {
|
|
48
61
|
return null;
|
|
49
62
|
}
|
|
50
63
|
|
|
51
64
|
if (typeof normalizedColor === 'object') {
|
|
52
|
-
const processedColorObj =
|
|
65
|
+
const processedColorObj: ?NativeColorValue =
|
|
66
|
+
processColorObject(normalizedColor);
|
|
53
67
|
if (processedColorObj != null) {
|
|
54
68
|
return processedColorObj;
|
|
55
69
|
}
|
|
56
70
|
} else if (typeof normalizedColor === 'number') {
|
|
57
|
-
const r = (normalizedColor & 0xff000000) >>> 24;
|
|
58
|
-
const g = (normalizedColor & 0x00ff0000) >>> 16;
|
|
59
|
-
const b = (normalizedColor & 0x0000ff00) >>> 8;
|
|
60
|
-
const a = (normalizedColor & 0x000000ff) / 255;
|
|
71
|
+
const r: number = (normalizedColor & 0xff000000) >>> 24;
|
|
72
|
+
const g: number = (normalizedColor & 0x00ff0000) >>> 16;
|
|
73
|
+
const b: number = (normalizedColor & 0x0000ff00) >>> 8;
|
|
74
|
+
const a: number = (normalizedColor & 0x000000ff) / 255;
|
|
61
75
|
|
|
62
76
|
return {r, g, b, a};
|
|
63
77
|
}
|
|
@@ -90,6 +104,7 @@ export default class AnimatedColor extends AnimatedWithChildren {
|
|
|
90
104
|
g: AnimatedValue;
|
|
91
105
|
b: AnimatedValue;
|
|
92
106
|
a: AnimatedValue;
|
|
107
|
+
nativeColor: ?NativeColorValue;
|
|
93
108
|
_listeners: {
|
|
94
109
|
[key: string]: {
|
|
95
110
|
r: string,
|
|
@@ -99,13 +114,12 @@ export default class AnimatedColor extends AnimatedWithChildren {
|
|
|
99
114
|
...
|
|
100
115
|
},
|
|
101
116
|
...
|
|
102
|
-
};
|
|
117
|
+
} = {};
|
|
103
118
|
|
|
104
119
|
constructor(valueIn?: ?(RgbaValue | RgbaAnimatedValue | ColorValue)) {
|
|
105
120
|
super();
|
|
106
121
|
let value: RgbaValue | RgbaAnimatedValue | ColorValue =
|
|
107
|
-
valueIn
|
|
108
|
-
|
|
122
|
+
valueIn ?? defaultColor;
|
|
109
123
|
if (isRgbaAnimatedValue(value)) {
|
|
110
124
|
// $FlowIgnore[incompatible-cast] - Type is verified above
|
|
111
125
|
const rgbaAnimatedValue: RgbaAnimatedValue = (value: RgbaAnimatedValue);
|
|
@@ -114,32 +128,65 @@ export default class AnimatedColor extends AnimatedWithChildren {
|
|
|
114
128
|
this.b = rgbaAnimatedValue.b;
|
|
115
129
|
this.a = rgbaAnimatedValue.a;
|
|
116
130
|
} else {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
131
|
+
const processedColor: RgbaValue | NativeColorValue =
|
|
132
|
+
// $FlowIgnore[incompatible-cast] - Type is verified above
|
|
133
|
+
processColor((value: ColorValue | RgbaValue)) ?? defaultColor;
|
|
134
|
+
let initColor: RgbaValue = defaultColor;
|
|
135
|
+
if (isRgbaValue(processedColor)) {
|
|
136
|
+
// $FlowIgnore[incompatible-cast] - Type is verified above
|
|
137
|
+
initColor = (processedColor: RgbaValue);
|
|
138
|
+
} else {
|
|
139
|
+
// $FlowIgnore[incompatible-cast] - Type is verified above
|
|
140
|
+
this.nativeColor = (processedColor: NativeColorValue);
|
|
122
141
|
}
|
|
123
142
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this.
|
|
127
|
-
this.
|
|
128
|
-
|
|
129
|
-
|
|
143
|
+
this.r = new AnimatedValue(initColor.r);
|
|
144
|
+
this.g = new AnimatedValue(initColor.g);
|
|
145
|
+
this.b = new AnimatedValue(initColor.b);
|
|
146
|
+
this.a = new AnimatedValue(initColor.a);
|
|
147
|
+
|
|
148
|
+
if (this.nativeColor) {
|
|
149
|
+
if (!this.__isNative) {
|
|
150
|
+
this.__makeNative();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
130
153
|
}
|
|
131
|
-
this._listeners = {};
|
|
132
154
|
}
|
|
133
155
|
|
|
134
156
|
/**
|
|
135
157
|
* Directly set the value. This will stop any animations running on the value
|
|
136
158
|
* and update all the bound properties.
|
|
137
159
|
*/
|
|
138
|
-
setValue(value:
|
|
139
|
-
this.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
160
|
+
setValue(value: RgbaValue | ColorValue): void {
|
|
161
|
+
this.nativeColor = null;
|
|
162
|
+
|
|
163
|
+
const processedColor: RgbaValue | NativeColorValue =
|
|
164
|
+
processColor(value) ?? defaultColor;
|
|
165
|
+
if (isRgbaValue(processedColor)) {
|
|
166
|
+
// $FlowIgnore[incompatible-cast] - Type is verified above
|
|
167
|
+
const rgbaValue: RgbaValue = (processedColor: RgbaValue);
|
|
168
|
+
this.r.setValue(rgbaValue.r);
|
|
169
|
+
this.g.setValue(rgbaValue.g);
|
|
170
|
+
this.b.setValue(rgbaValue.b);
|
|
171
|
+
this.a.setValue(rgbaValue.a);
|
|
172
|
+
} else {
|
|
173
|
+
// $FlowIgnore[incompatible-cast] - Type is verified above
|
|
174
|
+
this.nativeColor = (processedColor: NativeColorValue);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (this.nativeColor) {
|
|
178
|
+
if (!this.__isNative) {
|
|
179
|
+
this.__makeNative();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const nativeTag = this.__getNativeTag();
|
|
183
|
+
NativeAnimatedHelper.API.setWaitingForIdentifier(nativeTag.toString());
|
|
184
|
+
NativeAnimatedHelper.API.updateAnimatedNodeConfig(
|
|
185
|
+
nativeTag,
|
|
186
|
+
this.__getNativeConfig(),
|
|
187
|
+
);
|
|
188
|
+
NativeAnimatedHelper.API.unsetWaitingForIdentifier(nativeTag.toString());
|
|
189
|
+
}
|
|
143
190
|
}
|
|
144
191
|
|
|
145
192
|
/**
|
|
@@ -147,7 +194,7 @@ export default class AnimatedColor extends AnimatedWithChildren {
|
|
|
147
194
|
* via `setValue`, an animation, or `Animated.event`. Useful for compensating
|
|
148
195
|
* things like the start of a pan gesture.
|
|
149
196
|
*/
|
|
150
|
-
setOffset(offset:
|
|
197
|
+
setOffset(offset: RgbaValue): void {
|
|
151
198
|
this.r.setOffset(offset.r);
|
|
152
199
|
this.g.setOffset(offset.g);
|
|
153
200
|
this.b.setOffset(offset.b);
|
|
@@ -263,4 +310,23 @@ export default class AnimatedColor extends AnimatedWithChildren {
|
|
|
263
310
|
this.a.__removeChild(this);
|
|
264
311
|
super.__detach();
|
|
265
312
|
}
|
|
313
|
+
|
|
314
|
+
__makeNative(platformConfig: ?PlatformConfig) {
|
|
315
|
+
this.r.__makeNative(platformConfig);
|
|
316
|
+
this.g.__makeNative(platformConfig);
|
|
317
|
+
this.b.__makeNative(platformConfig);
|
|
318
|
+
this.a.__makeNative(platformConfig);
|
|
319
|
+
super.__makeNative(platformConfig);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
__getNativeConfig(): {...} {
|
|
323
|
+
return {
|
|
324
|
+
type: 'color',
|
|
325
|
+
r: this.r.__getNativeTag(),
|
|
326
|
+
g: this.g.__getNativeTag(),
|
|
327
|
+
b: this.b.__getNativeTag(),
|
|
328
|
+
a: this.a.__getNativeTag(),
|
|
329
|
+
nativeColor: this.nativeColor,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
266
332
|
}
|
|
@@ -23,14 +23,14 @@ import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
|
23
23
|
|
|
24
24
|
type ExtrapolateType = 'extend' | 'identity' | 'clamp';
|
|
25
25
|
|
|
26
|
-
export type InterpolationConfigType = {
|
|
26
|
+
export type InterpolationConfigType = $ReadOnly<{
|
|
27
27
|
inputRange: $ReadOnlyArray<number>,
|
|
28
28
|
outputRange: $ReadOnlyArray<number> | $ReadOnlyArray<string>,
|
|
29
29
|
easing?: (input: number) => number,
|
|
30
30
|
extrapolate?: ExtrapolateType,
|
|
31
31
|
extrapolateLeft?: ExtrapolateType,
|
|
32
32
|
extrapolateRight?: ExtrapolateType,
|
|
33
|
-
}
|
|
33
|
+
}>;
|
|
34
34
|
|
|
35
35
|
const linear = (t: number) => t;
|
|
36
36
|
|
|
@@ -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
|
|
|
@@ -130,12 +130,12 @@ class AnimatedNode {
|
|
|
130
130
|
if (data.tag !== this.__getNativeTag()) {
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
-
this.
|
|
133
|
+
this.__onAnimatedValueUpdateReceived(data.value);
|
|
134
134
|
},
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
__onAnimatedValueUpdateReceived(value: number) {
|
|
139
139
|
this.__callListeners(value);
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -154,7 +154,7 @@ class AppState {
|
|
|
154
154
|
case 'focus':
|
|
155
155
|
// $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type
|
|
156
156
|
// $FlowIssue[incompatible-call]
|
|
157
|
-
emitter.
|
|
157
|
+
emitter.removeListener('appStateFocusChange', listener);
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
throw new Error('Trying to unsubscribe from unknown event: ' + type);
|
package/Libraries/Blob/URL.js
CHANGED
|
@@ -101,7 +101,13 @@ export class URLSearchParams {
|
|
|
101
101
|
}
|
|
102
102
|
const last = this._searchParams.length - 1;
|
|
103
103
|
return this._searchParams.reduce((acc, curr, index) => {
|
|
104
|
-
return
|
|
104
|
+
return (
|
|
105
|
+
acc +
|
|
106
|
+
encodeURIComponent(curr[0]) +
|
|
107
|
+
'=' +
|
|
108
|
+
encodeURIComponent(curr[1]) +
|
|
109
|
+
(index === last ? '' : '&')
|
|
110
|
+
);
|
|
105
111
|
}, '');
|
|
106
112
|
}
|
|
107
113
|
}
|
|
@@ -146,6 +146,7 @@ type ButtonProps = $ReadOnly<{|
|
|
|
146
146
|
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
|
|
147
147
|
accessibilityState?: ?AccessibilityState,
|
|
148
148
|
accessibilityHint?: ?string,
|
|
149
|
+
accessibilityLanguage?: ?Stringish,
|
|
149
150
|
|}>;
|
|
150
151
|
|
|
151
152
|
/**
|
|
@@ -277,6 +278,7 @@ class Button extends React.Component<ButtonProps> {
|
|
|
277
278
|
accessible,
|
|
278
279
|
accessibilityActions,
|
|
279
280
|
accessibilityHint,
|
|
281
|
+
accessibilityLanguage,
|
|
280
282
|
onAccessibilityAction,
|
|
281
283
|
} = this.props;
|
|
282
284
|
const buttonStyles = [styles.button];
|
|
@@ -320,6 +322,7 @@ class Button extends React.Component<ButtonProps> {
|
|
|
320
322
|
onAccessibilityAction={onAccessibilityAction}
|
|
321
323
|
accessibilityLabel={accessibilityLabel}
|
|
322
324
|
accessibilityHint={accessibilityHint}
|
|
325
|
+
accessibilityLanguage={accessibilityLanguage}
|
|
323
326
|
accessibilityRole="button"
|
|
324
327
|
accessibilityState={accessibilityState}
|
|
325
328
|
hasTVPreferredFocus={hasTVPreferredFocus}
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
import type {TurboModule} from '../../TurboModule/RCTExport';
|
|
12
12
|
import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry';
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* This file backs native modules that are used internally at Meta
|
|
16
|
+
* and this JS spec was intentionally left here. In the meanwhile this
|
|
17
|
+
* file should not be deleted.
|
|
18
|
+
*/
|
|
14
19
|
export interface Spec extends TurboModule {
|
|
15
20
|
+open: (options: Object) => Promise<Object>;
|
|
16
21
|
}
|
|
@@ -22,7 +22,7 @@ import type {
|
|
|
22
22
|
} from '../View/ViewAccessibility';
|
|
23
23
|
import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
|
|
24
24
|
import usePressability from '../../Pressability/usePressability';
|
|
25
|
-
import {
|
|
25
|
+
import {type RectOrSize} from '../../StyleSheet/Rect';
|
|
26
26
|
import type {
|
|
27
27
|
LayoutEvent,
|
|
28
28
|
MouseEvent,
|
|
@@ -43,6 +43,7 @@ type Props = $ReadOnly<{|
|
|
|
43
43
|
accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
|
|
44
44
|
accessibilityElementsHidden?: ?boolean,
|
|
45
45
|
accessibilityHint?: ?Stringish,
|
|
46
|
+
accessibilityLanguage?: ?Stringish,
|
|
46
47
|
accessibilityIgnoresInvertColors?: ?boolean,
|
|
47
48
|
accessibilityLabel?: ?Stringish,
|
|
48
49
|
accessibilityLiveRegion?: ?('none' | 'polite' | 'assertive'),
|
|
@@ -181,6 +182,7 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
181
182
|
delayLongPress,
|
|
182
183
|
disabled,
|
|
183
184
|
focusable,
|
|
185
|
+
hitSlop,
|
|
184
186
|
onHoverIn,
|
|
185
187
|
onHoverOut,
|
|
186
188
|
onLongPress,
|
|
@@ -201,8 +203,6 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
201
203
|
|
|
202
204
|
const [pressed, setPressed] = usePressState(testOnly_pressed === true);
|
|
203
205
|
|
|
204
|
-
const hitSlop = normalizeRect(props.hitSlop);
|
|
205
|
-
|
|
206
206
|
const accessibilityState =
|
|
207
207
|
disabled != null
|
|
208
208
|
? {...props.accessibilityState, disabled}
|