react-native 0.70.1 → 0.70.3
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/Libraries/Animated/createAnimatedComponent.js +13 -6
- package/Libraries/Animated/nodes/AnimatedProps.js +1 -3
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.flow.js +208 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +32 -2
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js +4 -0
- package/Libraries/Components/Keyboard/Keyboard.js +28 -3
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +2 -2
- package/Libraries/Components/ScrollView/ScrollView.js +12 -16
- package/Libraries/Components/TextInput/TextInput.js +0 -2
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpReactDevTools.js +4 -1
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/RCTAccessibilityManager.h +1 -0
- package/React/CoreModules/RCTAccessibilityManager.mm +11 -0
- package/ReactAndroid/cmake-utils/ReactNative-application.cmake +9 -4
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/hermes-engine/build.gradle +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java +4 -8
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevLoadingViewController.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/android/com/facebook/react/hermes-engine/{0.70.1/hermes-engine-0.70.1-debug-sources.jar → 0.70.3/hermes-engine-0.70.3-debug-sources.jar} +0 -0
- package/android/com/facebook/react/hermes-engine/{0.70.1/hermes-engine-0.70.1-debug-sources.jar.md5 → 0.70.3/hermes-engine-0.70.3-debug-sources.jar.md5} +0 -0
- package/android/com/facebook/react/hermes-engine/{0.70.1/hermes-engine-0.70.1-debug-sources.jar.sha1 → 0.70.3/hermes-engine-0.70.3-debug-sources.jar.sha1} +0 -0
- package/android/com/facebook/react/hermes-engine/{0.70.1/hermes-engine-0.70.1-debug-sources.jar.sha256 → 0.70.3/hermes-engine-0.70.3-debug-sources.jar.sha256} +0 -0
- package/android/com/facebook/react/hermes-engine/{0.70.1/hermes-engine-0.70.1-debug-sources.jar.sha512 → 0.70.3/hermes-engine-0.70.3-debug-sources.jar.sha512} +0 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3-debug.aar +0 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3-debug.aar.md5 +1 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3-debug.aar.sha1 +1 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3-debug.aar.sha256 +1 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3-debug.aar.sha512 +1 -0
- package/android/com/facebook/react/hermes-engine/{0.70.1/hermes-engine-0.70.1-release-sources.jar → 0.70.3/hermes-engine-0.70.3-release-sources.jar} +0 -0
- package/android/com/facebook/react/hermes-engine/{0.70.1/hermes-engine-0.70.1-release-sources.jar.md5 → 0.70.3/hermes-engine-0.70.3-release-sources.jar.md5} +0 -0
- package/android/com/facebook/react/hermes-engine/{0.70.1/hermes-engine-0.70.1-release-sources.jar.sha1 → 0.70.3/hermes-engine-0.70.3-release-sources.jar.sha1} +0 -0
- package/android/com/facebook/react/hermes-engine/{0.70.1/hermes-engine-0.70.1-release-sources.jar.sha256 → 0.70.3/hermes-engine-0.70.3-release-sources.jar.sha256} +0 -0
- package/android/com/facebook/react/hermes-engine/{0.70.1/hermes-engine-0.70.1-release-sources.jar.sha512 → 0.70.3/hermes-engine-0.70.3-release-sources.jar.sha512} +0 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3-release.aar +0 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3-release.aar.md5 +1 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3-release.aar.sha1 +1 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3-release.aar.sha256 +1 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3-release.aar.sha512 +1 -0
- package/android/com/facebook/react/hermes-engine/{0.70.1/hermes-engine-0.70.1.module → 0.70.3/hermes-engine-0.70.3.module} +33 -33
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3.module.md5 +1 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3.module.sha1 +1 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3.module.sha256 +1 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3.module.sha512 +1 -0
- package/android/com/facebook/react/hermes-engine/{0.70.1/hermes-engine-0.70.1.pom → 0.70.3/hermes-engine-0.70.3.pom} +1 -1
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3.pom.md5 +1 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3.pom.sha1 +1 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3.pom.sha256 +1 -0
- package/android/com/facebook/react/hermes-engine/0.70.3/hermes-engine-0.70.3.pom.sha512 +1 -0
- package/android/com/facebook/react/hermes-engine/maven-metadata.xml +4 -4
- package/android/com/facebook/react/hermes-engine/maven-metadata.xml.md5 +1 -1
- package/android/com/facebook/react/hermes-engine/maven-metadata.xml.sha1 +1 -1
- package/android/com/facebook/react/hermes-engine/maven-metadata.xml.sha256 +1 -1
- package/android/com/facebook/react/hermes-engine/maven-metadata.xml.sha512 +1 -1
- package/android/com/facebook/react/react-native/{0.70.1/react-native-0.70.1-debug-sources.jar → 0.70.3/react-native-0.70.3-debug-sources.jar} +0 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-debug-sources.jar.md5 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-debug-sources.jar.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-debug-sources.jar.sha256 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-debug-sources.jar.sha512 +1 -0
- package/android/com/facebook/react/react-native/{0.70.1/react-native-0.70.1-debug.aar → 0.70.3/react-native-0.70.3-debug.aar} +0 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-debug.aar.md5 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-debug.aar.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-debug.aar.sha256 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-debug.aar.sha512 +1 -0
- package/android/com/facebook/react/react-native/{0.70.1/react-native-0.70.1-release-sources.jar → 0.70.3/react-native-0.70.3-release-sources.jar} +0 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-release-sources.jar.md5 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-release-sources.jar.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-release-sources.jar.sha256 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-release-sources.jar.sha512 +1 -0
- package/android/com/facebook/react/react-native/{0.70.1/react-native-0.70.1-release.aar → 0.70.3/react-native-0.70.3-release.aar} +0 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-release.aar.md5 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-release.aar.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-release.aar.sha256 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3-release.aar.sha512 +1 -0
- package/android/com/facebook/react/react-native/{0.70.1/react-native-0.70.1.module → 0.70.3/react-native-0.70.3.module} +43 -43
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3.module.md5 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3.module.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3.module.sha256 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3.module.sha512 +1 -0
- package/android/com/facebook/react/react-native/{0.70.1/react-native-0.70.1.pom → 0.70.3/react-native-0.70.3.pom} +1 -1
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3.pom.md5 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3.pom.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3.pom.sha256 +1 -0
- package/android/com/facebook/react/react-native/0.70.3/react-native-0.70.3.pom.sha512 +1 -0
- package/android/com/facebook/react/react-native/maven-metadata.xml +4 -4
- package/android/com/facebook/react/react-native/maven-metadata.xml.md5 +1 -1
- package/android/com/facebook/react/react-native/maven-metadata.xml.sha1 +1 -1
- package/android/com/facebook/react/react-native/maven-metadata.xml.sha256 +1 -1
- package/android/com/facebook/react/react-native/maven-metadata.xml.sha512 +1 -1
- package/jest/setup.js +2 -1
- package/package.json +9 -9
- package/scripts/cocoapods/utils.rb +14 -0
- package/scripts/react_native_pods.rb +2 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/template/package.json +2 -2
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1-debug.aar +0 -0
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1-debug.aar.md5 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1-debug.aar.sha1 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1-debug.aar.sha256 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1-debug.aar.sha512 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1-release.aar +0 -0
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1-release.aar.md5 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1-release.aar.sha1 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1-release.aar.sha256 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1-release.aar.sha512 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1.module.md5 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1.module.sha1 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1.module.sha256 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1.module.sha512 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1.pom.md5 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1.pom.sha1 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1.pom.sha256 +0 -1
- package/android/com/facebook/react/hermes-engine/0.70.1/hermes-engine-0.70.1.pom.sha512 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-debug-sources.jar.md5 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-debug-sources.jar.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-debug-sources.jar.sha256 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-debug-sources.jar.sha512 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-debug.aar.md5 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-debug.aar.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-debug.aar.sha256 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-debug.aar.sha512 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-release-sources.jar.md5 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-release-sources.jar.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-release-sources.jar.sha256 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-release-sources.jar.sha512 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-release.aar.md5 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-release.aar.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-release.aar.sha256 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1-release.aar.sha512 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1.module.md5 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1.module.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1.module.sha256 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1.module.sha512 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1.pom.md5 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1.pom.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1.pom.sha256 +0 -1
- package/android/com/facebook/react/react-native/0.70.1/react-native-0.70.1.pom.sha512 +0 -1
|
@@ -200,18 +200,25 @@ function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
|
|
|
200
200
|
},
|
|
201
201
|
});
|
|
202
202
|
|
|
203
|
-
render() {
|
|
203
|
+
render(): React.Node {
|
|
204
|
+
// When rendering in Fabric and an AnimatedValue is used, we keep track of
|
|
205
|
+
// the initial value of that Value, to avoid additional prop updates when
|
|
206
|
+
// this component re-renders
|
|
207
|
+
const initialPropsIfFabric = this._isFabric()
|
|
208
|
+
? this._initialAnimatedProps
|
|
209
|
+
: null;
|
|
210
|
+
|
|
204
211
|
const animatedProps =
|
|
205
|
-
this._propsAnimated.__getValue(
|
|
212
|
+
this._propsAnimated.__getValue(initialPropsIfFabric) || {};
|
|
213
|
+
if (!this._initialAnimatedProps) {
|
|
214
|
+
this._initialAnimatedProps = animatedProps;
|
|
215
|
+
}
|
|
216
|
+
|
|
206
217
|
const {style = {}, ...props} = animatedProps;
|
|
207
218
|
const {style: passthruStyle = {}, ...passthruProps} =
|
|
208
219
|
this.props.passthroughAnimatedPropExplicitValues || {};
|
|
209
220
|
const mergedStyle = {...style, ...passthruStyle};
|
|
210
221
|
|
|
211
|
-
if (!this._initialAnimatedProps) {
|
|
212
|
-
this._initialAnimatedProps = animatedProps;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
222
|
// Force `collapsable` to be false so that native view is not flattened.
|
|
216
223
|
// Flattened views cannot be accurately referenced by a native driver.
|
|
217
224
|
return (
|
|
@@ -46,9 +46,7 @@ class AnimatedProps extends AnimatedNode {
|
|
|
46
46
|
// as they may not be up to date, so we use the initial value to ensure that values of
|
|
47
47
|
// native animated nodes do not impact rerenders.
|
|
48
48
|
if (value instanceof AnimatedStyle) {
|
|
49
|
-
props[key] = value.__getValue(
|
|
50
|
-
initialProps ? initialProps.style : null,
|
|
51
|
-
);
|
|
49
|
+
props[key] = value.__getValue(initialProps?.style);
|
|
52
50
|
} else if (!initialProps || !value.__isNative) {
|
|
53
51
|
props[key] = value.__getValue();
|
|
54
52
|
} else if (initialProps.hasOwnProperty(key)) {
|
|
@@ -0,0 +1,208 @@
|
|
|
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
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
12
|
+
import type {EventSubscription} from '../../vendor/emitter/EventEmitter';
|
|
13
|
+
import type {ElementRef} from 'react';
|
|
14
|
+
|
|
15
|
+
// Events that are only supported on Android.
|
|
16
|
+
type AccessibilityEventDefinitionsAndroid = {
|
|
17
|
+
accessibilityServiceChanged: [boolean],
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Events that are only supported on iOS.
|
|
21
|
+
type AccessibilityEventDefinitionsIOS = {
|
|
22
|
+
announcementFinished: [{announcement: string, success: boolean}],
|
|
23
|
+
boldTextChanged: [boolean],
|
|
24
|
+
grayscaleChanged: [boolean],
|
|
25
|
+
invertColorsChanged: [boolean],
|
|
26
|
+
reduceTransparencyChanged: [boolean],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
type AccessibilityEventDefinitions = {
|
|
30
|
+
...AccessibilityEventDefinitionsAndroid,
|
|
31
|
+
...AccessibilityEventDefinitionsIOS,
|
|
32
|
+
change: [boolean], // screenReaderChanged
|
|
33
|
+
reduceMotionChanged: [boolean],
|
|
34
|
+
screenReaderChanged: [boolean],
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type AccessibilityEventTypes = 'click' | 'focus';
|
|
38
|
+
/**
|
|
39
|
+
* Sometimes it's useful to know whether or not the device has a screen reader
|
|
40
|
+
* that is currently active. The `AccessibilityInfo` API is designed for this
|
|
41
|
+
* purpose. You can use it to query the current state of the screen reader as
|
|
42
|
+
* well as to register to be notified when the state of the screen reader
|
|
43
|
+
* changes.
|
|
44
|
+
*
|
|
45
|
+
* See https://reactnative.dev/docs/accessibilityinfo
|
|
46
|
+
*/
|
|
47
|
+
export interface AccessibilityInfo {
|
|
48
|
+
/**
|
|
49
|
+
* Query whether bold text is currently enabled.
|
|
50
|
+
*
|
|
51
|
+
* Returns a promise which resolves to a boolean.
|
|
52
|
+
* The result is `true` when bold text is enabled and `false` otherwise.
|
|
53
|
+
*
|
|
54
|
+
* See https://reactnative.dev/docs/accessibilityinfo#isBoldTextEnabled
|
|
55
|
+
*/
|
|
56
|
+
isBoldTextEnabled: () => Promise<boolean>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Query whether grayscale is currently enabled.
|
|
60
|
+
*
|
|
61
|
+
* Returns a promise which resolves to a boolean.
|
|
62
|
+
* The result is `true` when grayscale is enabled and `false` otherwise.
|
|
63
|
+
*
|
|
64
|
+
* See https://reactnative.dev/docs/accessibilityinfo#isGrayscaleEnabled
|
|
65
|
+
*/
|
|
66
|
+
isGrayscaleEnabled: () => Promise<boolean>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Query whether inverted colors are currently enabled.
|
|
70
|
+
*
|
|
71
|
+
* Returns a promise which resolves to a boolean.
|
|
72
|
+
* The result is `true` when invert color is enabled and `false` otherwise.
|
|
73
|
+
*
|
|
74
|
+
* See https://reactnative.dev/docs/accessibilityinfo#isInvertColorsEnabled
|
|
75
|
+
*/
|
|
76
|
+
isInvertColorsEnabled: () => Promise<boolean>;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Query whether reduced motion is currently enabled.
|
|
80
|
+
*
|
|
81
|
+
* Returns a promise which resolves to a boolean.
|
|
82
|
+
* The result is `true` when a reduce motion is enabled and `false` otherwise.
|
|
83
|
+
*
|
|
84
|
+
* See https://reactnative.dev/docs/accessibilityinfo#isReduceMotionEnabled
|
|
85
|
+
*/
|
|
86
|
+
isReduceMotionEnabled: () => Promise<boolean>;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Query whether reduce motion and prefer cross-fade transitions settings are currently enabled.
|
|
90
|
+
*
|
|
91
|
+
* Returns a promise which resolves to a boolean.
|
|
92
|
+
* The result is `true` when prefer cross-fade transitions is enabled and `false` otherwise.
|
|
93
|
+
*
|
|
94
|
+
* See https://reactnative.dev/docs/accessibilityinfo#prefersCrossFadeTransitions
|
|
95
|
+
*/
|
|
96
|
+
prefersCrossFadeTransitions: () => Promise<boolean>;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Query whether reduced transparency is currently enabled.
|
|
100
|
+
*
|
|
101
|
+
* Returns a promise which resolves to a boolean.
|
|
102
|
+
* The result is `true` when a reduce transparency is enabled and `false` otherwise.
|
|
103
|
+
*
|
|
104
|
+
* See https://reactnative.dev/docs/accessibilityinfo#isReduceTransparencyEnabled
|
|
105
|
+
*/
|
|
106
|
+
isReduceTransparencyEnabled: () => Promise<boolean>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Query whether a screen reader is currently enabled.
|
|
110
|
+
*
|
|
111
|
+
* Returns a promise which resolves to a boolean.
|
|
112
|
+
* The result is `true` when a screen reader is enabled and `false` otherwise.
|
|
113
|
+
*
|
|
114
|
+
* See https://reactnative.dev/docs/accessibilityinfo#isScreenReaderEnabled
|
|
115
|
+
*/
|
|
116
|
+
isScreenReaderEnabled: () => Promise<boolean>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Query whether Accessibility Service is currently enabled.
|
|
120
|
+
*
|
|
121
|
+
* Returns a promise which resolves to a boolean.
|
|
122
|
+
* The result is `true` when any service is enabled and `false` otherwise.
|
|
123
|
+
*
|
|
124
|
+
* @platform android
|
|
125
|
+
*
|
|
126
|
+
* See https://reactnative.dev/docs/accessibilityinfo/#isaccessibilityserviceenabled-android
|
|
127
|
+
*/
|
|
128
|
+
isAccessibilityServiceEnabled: () => Promise<boolean>;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Add an event handler. Supported events:
|
|
132
|
+
*
|
|
133
|
+
* - `reduceMotionChanged`: Fires when the state of the reduce motion toggle changes.
|
|
134
|
+
* The argument to the event handler is a boolean. The boolean is `true` when a reduce
|
|
135
|
+
* motion is enabled (or when "Transition Animation Scale" in "Developer options" is
|
|
136
|
+
* "Animation off") and `false` otherwise.
|
|
137
|
+
* - `screenReaderChanged`: Fires when the state of the screen reader changes. The argument
|
|
138
|
+
* to the event handler is a boolean. The boolean is `true` when a screen
|
|
139
|
+
* reader is enabled and `false` otherwise.
|
|
140
|
+
*
|
|
141
|
+
* These events are only supported on iOS:
|
|
142
|
+
*
|
|
143
|
+
* - `boldTextChanged`: iOS-only event. Fires when the state of the bold text toggle changes.
|
|
144
|
+
* The argument to the event handler is a boolean. The boolean is `true` when a bold text
|
|
145
|
+
* is enabled and `false` otherwise.
|
|
146
|
+
* - `grayscaleChanged`: iOS-only event. Fires when the state of the gray scale toggle changes.
|
|
147
|
+
* The argument to the event handler is a boolean. The boolean is `true` when a gray scale
|
|
148
|
+
* is enabled and `false` otherwise.
|
|
149
|
+
* - `invertColorsChanged`: iOS-only event. Fires when the state of the invert colors toggle
|
|
150
|
+
* changes. The argument to the event handler is a boolean. The boolean is `true` when a invert
|
|
151
|
+
* colors is enabled and `false` otherwise.
|
|
152
|
+
* - `reduceTransparencyChanged`: iOS-only event. Fires when the state of the reduce transparency
|
|
153
|
+
* toggle changes. The argument to the event handler is a boolean. The boolean is `true`
|
|
154
|
+
* when a reduce transparency is enabled and `false` otherwise.
|
|
155
|
+
* - `announcementFinished`: iOS-only event. Fires when the screen reader has
|
|
156
|
+
* finished making an announcement. The argument to the event handler is a
|
|
157
|
+
* dictionary with these keys:
|
|
158
|
+
* - `announcement`: The string announced by the screen reader.
|
|
159
|
+
* - `success`: A boolean indicating whether the announcement was
|
|
160
|
+
* successfully made.
|
|
161
|
+
*
|
|
162
|
+
* See https://reactnative.dev/docs/accessibilityinfo#addeventlistener
|
|
163
|
+
*/
|
|
164
|
+
addEventListener<K: $Keys<AccessibilityEventDefinitions>>(
|
|
165
|
+
eventName: K,
|
|
166
|
+
handler: (...$ElementType<AccessibilityEventDefinitions, K>) => void,
|
|
167
|
+
): EventSubscription;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Set accessibility focus to a React component.
|
|
171
|
+
*
|
|
172
|
+
* See https://reactnative.dev/docs/accessibilityinfo#setaccessibilityfocus
|
|
173
|
+
*/
|
|
174
|
+
setAccessibilityFocus: (reactTag: number) => void;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Send a named accessibility event to a HostComponent.
|
|
178
|
+
*/
|
|
179
|
+
sendAccessibilityEvent: (
|
|
180
|
+
handle: ElementRef<HostComponent<mixed>>,
|
|
181
|
+
eventType: AccessibilityEventTypes,
|
|
182
|
+
) => void;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Post a string to be announced by the screen reader.
|
|
186
|
+
*
|
|
187
|
+
* See https://reactnative.dev/docs/accessibilityinfo#announceforaccessibility
|
|
188
|
+
*/
|
|
189
|
+
announceForAccessibility: (announcement: string) => void;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Post a string to be announced by the screen reader.
|
|
193
|
+
* - `announcement`: The string announced by the screen reader.
|
|
194
|
+
* - `options`: An object that configures the reading options.
|
|
195
|
+
* - `queue`: The announcement will be queued behind existing announcements. iOS only.
|
|
196
|
+
*/
|
|
197
|
+
announceForAccessibilityWithOptions: (
|
|
198
|
+
announcement: string,
|
|
199
|
+
options: {queue?: boolean},
|
|
200
|
+
) => void;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Get the recommended timeout for changes to the UI needed by this user.
|
|
204
|
+
*
|
|
205
|
+
* See https://reactnative.dev/docs/accessibilityinfo#getrecommendedtimeoutmillis
|
|
206
|
+
*/
|
|
207
|
+
getRecommendedTimeoutMillis: (originalTimeout: number) => Promise<number>;
|
|
208
|
+
}
|
|
@@ -17,6 +17,7 @@ import NativeAccessibilityInfoAndroid from './NativeAccessibilityInfo';
|
|
|
17
17
|
import NativeAccessibilityManagerIOS from './NativeAccessibilityManager';
|
|
18
18
|
import legacySendAccessibilityEvent from './legacySendAccessibilityEvent';
|
|
19
19
|
import type {ElementRef} from 'react';
|
|
20
|
+
import type {AccessibilityInfo as AccessibilityInfoType} from './AccessibilityInfo.flow';
|
|
20
21
|
|
|
21
22
|
// Events that are only supported on Android.
|
|
22
23
|
type AccessibilityEventDefinitionsAndroid = {
|
|
@@ -73,7 +74,7 @@ const EventNames: Map<
|
|
|
73
74
|
*
|
|
74
75
|
* See https://reactnative.dev/docs/accessibilityinfo
|
|
75
76
|
*/
|
|
76
|
-
const AccessibilityInfo = {
|
|
77
|
+
const AccessibilityInfo: AccessibilityInfoType = {
|
|
77
78
|
/**
|
|
78
79
|
* Query whether bold text is currently enabled.
|
|
79
80
|
*
|
|
@@ -178,6 +179,34 @@ const AccessibilityInfo = {
|
|
|
178
179
|
});
|
|
179
180
|
},
|
|
180
181
|
|
|
182
|
+
/**
|
|
183
|
+
* Query whether reduce motion and prefer cross-fade transitions settings are currently enabled.
|
|
184
|
+
*
|
|
185
|
+
* Returns a promise which resolves to a boolean.
|
|
186
|
+
* The result is `true` when prefer cross-fade transitions is enabled and `false` otherwise.
|
|
187
|
+
*
|
|
188
|
+
* See https://reactnative.dev/docs/accessibilityinfo#prefersCrossFadeTransitions
|
|
189
|
+
*/
|
|
190
|
+
prefersCrossFadeTransitions(): Promise<boolean> {
|
|
191
|
+
return new Promise((resolve, reject) => {
|
|
192
|
+
if (Platform.OS === 'android') {
|
|
193
|
+
return Promise.resolve(false);
|
|
194
|
+
} else {
|
|
195
|
+
if (
|
|
196
|
+
NativeAccessibilityManagerIOS?.getCurrentPrefersCrossFadeTransitionsState !=
|
|
197
|
+
null
|
|
198
|
+
) {
|
|
199
|
+
NativeAccessibilityManagerIOS.getCurrentPrefersCrossFadeTransitionsState(
|
|
200
|
+
resolve,
|
|
201
|
+
reject,
|
|
202
|
+
);
|
|
203
|
+
} else {
|
|
204
|
+
reject(null);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
|
|
181
210
|
/**
|
|
182
211
|
* Query whether reduced transparency is currently enabled.
|
|
183
212
|
*
|
|
@@ -295,6 +324,7 @@ const AccessibilityInfo = {
|
|
|
295
324
|
*/
|
|
296
325
|
addEventListener<K: $Keys<AccessibilityEventDefinitions>>(
|
|
297
326
|
eventName: K,
|
|
327
|
+
// $FlowIssue[incompatible-type] - Flow bug with unions and generics (T128099423)
|
|
298
328
|
handler: (...$ElementType<AccessibilityEventDefinitions, K>) => void,
|
|
299
329
|
): EventSubscription {
|
|
300
330
|
const deviceEventName = EventNames.get(eventName);
|
|
@@ -315,7 +345,7 @@ const AccessibilityInfo = {
|
|
|
315
345
|
/**
|
|
316
346
|
* Send a named accessibility event to a HostComponent.
|
|
317
347
|
*/
|
|
318
|
-
|
|
348
|
+
sendAccessibilityEvent(
|
|
319
349
|
handle: ElementRef<HostComponent<mixed>>,
|
|
320
350
|
eventType: AccessibilityEventTypes,
|
|
321
351
|
) {
|
|
@@ -28,6 +28,10 @@ export interface Spec extends TurboModule {
|
|
|
28
28
|
onSuccess: (isReduceMotionEnabled: boolean) => void,
|
|
29
29
|
onError: (error: Object) => void,
|
|
30
30
|
) => void;
|
|
31
|
+
+getCurrentPrefersCrossFadeTransitionsState?: (
|
|
32
|
+
onSuccess: (prefersCrossFadeTransitions: boolean) => void,
|
|
33
|
+
onError: (error: Object) => void,
|
|
34
|
+
) => void;
|
|
31
35
|
+getCurrentReduceTransparencyState: (
|
|
32
36
|
onSuccess: (isReduceTransparencyEnabled: boolean) => void,
|
|
33
37
|
onError: (error: Object) => void,
|
|
@@ -24,7 +24,7 @@ export type KeyboardEventEasing =
|
|
|
24
24
|
| 'linear'
|
|
25
25
|
| 'keyboard';
|
|
26
26
|
|
|
27
|
-
export type
|
|
27
|
+
export type KeyboardMetrics = $ReadOnly<{|
|
|
28
28
|
screenX: number,
|
|
29
29
|
screenY: number,
|
|
30
30
|
width: number,
|
|
@@ -36,7 +36,7 @@ export type KeyboardEvent = AndroidKeyboardEvent | IOSKeyboardEvent;
|
|
|
36
36
|
type BaseKeyboardEvent = {|
|
|
37
37
|
duration: number,
|
|
38
38
|
easing: KeyboardEventEasing,
|
|
39
|
-
endCoordinates:
|
|
39
|
+
endCoordinates: KeyboardMetrics,
|
|
40
40
|
|};
|
|
41
41
|
|
|
42
42
|
export type AndroidKeyboardEvent = $ReadOnly<{|
|
|
@@ -47,7 +47,7 @@ export type AndroidKeyboardEvent = $ReadOnly<{|
|
|
|
47
47
|
|
|
48
48
|
export type IOSKeyboardEvent = $ReadOnly<{|
|
|
49
49
|
...BaseKeyboardEvent,
|
|
50
|
-
startCoordinates:
|
|
50
|
+
startCoordinates: KeyboardMetrics,
|
|
51
51
|
isEventFromThisApp: boolean,
|
|
52
52
|
|}>;
|
|
53
53
|
|
|
@@ -103,6 +103,8 @@ type KeyboardEventDefinitions = {
|
|
|
103
103
|
*/
|
|
104
104
|
|
|
105
105
|
class Keyboard {
|
|
106
|
+
_currentlyShowing: ?KeyboardEvent;
|
|
107
|
+
|
|
106
108
|
_emitter: NativeEventEmitter<KeyboardEventDefinitions> =
|
|
107
109
|
new NativeEventEmitter(
|
|
108
110
|
// T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior
|
|
@@ -110,6 +112,15 @@ class Keyboard {
|
|
|
110
112
|
Platform.OS !== 'ios' ? null : NativeKeyboardObserver,
|
|
111
113
|
);
|
|
112
114
|
|
|
115
|
+
constructor() {
|
|
116
|
+
this.addListener('keyboardDidShow', ev => {
|
|
117
|
+
this._currentlyShowing = ev;
|
|
118
|
+
});
|
|
119
|
+
this.addListener('keyboardDidHide', _ev => {
|
|
120
|
+
this._currentlyShowing = null;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
113
124
|
/**
|
|
114
125
|
* The `addListener` function connects a JavaScript function to an identified native
|
|
115
126
|
* keyboard notification event.
|
|
@@ -157,6 +168,20 @@ class Keyboard {
|
|
|
157
168
|
dismissKeyboard();
|
|
158
169
|
}
|
|
159
170
|
|
|
171
|
+
/**
|
|
172
|
+
* Whether the keyboard is last known to be visible.
|
|
173
|
+
*/
|
|
174
|
+
isVisible(): boolean {
|
|
175
|
+
return !!this._currentlyShowing;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Return the metrics of the soft-keyboard if visible.
|
|
180
|
+
*/
|
|
181
|
+
metrics(): ?KeyboardMetrics {
|
|
182
|
+
return this._currentlyShowing?.endCoordinates;
|
|
183
|
+
}
|
|
184
|
+
|
|
160
185
|
/**
|
|
161
186
|
* Useful for syncing TextInput (or other keyboard accessory view) size of
|
|
162
187
|
* position changes with keyboard movements.
|
|
@@ -22,7 +22,7 @@ import type {
|
|
|
22
22
|
ViewLayout,
|
|
23
23
|
ViewLayoutEvent,
|
|
24
24
|
} from '../View/ViewPropTypes';
|
|
25
|
-
import type {KeyboardEvent,
|
|
25
|
+
import type {KeyboardEvent, KeyboardMetrics} from './Keyboard';
|
|
26
26
|
import AccessibilityInfo from '../AccessibilityInfo/AccessibilityInfo';
|
|
27
27
|
|
|
28
28
|
type Props = $ReadOnly<{|
|
|
@@ -73,7 +73,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
async _relativeKeyboardHeight(
|
|
76
|
-
keyboardFrame:
|
|
76
|
+
keyboardFrame: KeyboardMetrics,
|
|
77
77
|
): Promise<number> {
|
|
78
78
|
const frame = this._frame;
|
|
79
79
|
if (!frame || !keyboardFrame) {
|
|
@@ -42,7 +42,7 @@ import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
|
42
42
|
import type {ViewProps} from '../View/ViewPropTypes';
|
|
43
43
|
import ScrollViewContext, {HORIZONTAL, VERTICAL} from './ScrollViewContext';
|
|
44
44
|
import type {Props as ScrollViewStickyHeaderProps} from './ScrollViewStickyHeader';
|
|
45
|
-
import type {KeyboardEvent} from '../Keyboard/Keyboard';
|
|
45
|
+
import type {KeyboardEvent, KeyboardMetrics} from '../Keyboard/Keyboard';
|
|
46
46
|
import type {EventSubscription} from '../../vendor/emitter/EventEmitter';
|
|
47
47
|
|
|
48
48
|
import Commands from './ScrollViewCommands';
|
|
@@ -731,7 +731,7 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
731
731
|
new Map();
|
|
732
732
|
_headerLayoutYs: Map<string, number> = new Map();
|
|
733
733
|
|
|
734
|
-
|
|
734
|
+
_keyboardMetrics: ?KeyboardMetrics = null;
|
|
735
735
|
_additionalScrollOffset: number = 0;
|
|
736
736
|
_isTouching: boolean = false;
|
|
737
737
|
_lastMomentumScrollBeginTime: number = 0;
|
|
@@ -769,7 +769,7 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
769
769
|
);
|
|
770
770
|
}
|
|
771
771
|
|
|
772
|
-
this.
|
|
772
|
+
this._keyboardMetrics = Keyboard.metrics();
|
|
773
773
|
this._additionalScrollOffset = 0;
|
|
774
774
|
|
|
775
775
|
this._subscriptionKeyboardWillShow = Keyboard.addListener(
|
|
@@ -1075,8 +1075,8 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1075
1075
|
let keyboardScreenY = Dimensions.get('window').height;
|
|
1076
1076
|
|
|
1077
1077
|
const scrollTextInputIntoVisibleRect = () => {
|
|
1078
|
-
if (this.
|
|
1079
|
-
keyboardScreenY = this.
|
|
1078
|
+
if (this._keyboardMetrics != null) {
|
|
1079
|
+
keyboardScreenY = this._keyboardMetrics.screenY;
|
|
1080
1080
|
}
|
|
1081
1081
|
let scrollOffsetY =
|
|
1082
1082
|
top - keyboardScreenY + height + this._additionalScrollOffset;
|
|
@@ -1094,8 +1094,8 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1094
1094
|
this._preventNegativeScrollOffset = false;
|
|
1095
1095
|
};
|
|
1096
1096
|
|
|
1097
|
-
if (this.
|
|
1098
|
-
// `
|
|
1097
|
+
if (this._keyboardMetrics == null) {
|
|
1098
|
+
// `_keyboardMetrics` is set inside `scrollResponderKeyboardWillShow` which
|
|
1099
1099
|
// is not guaranteed to be called before `_inputMeasureAndScrollToKeyboard` but native has already scheduled it.
|
|
1100
1100
|
// In case it was not called before `_inputMeasureAndScrollToKeyboard`, we postpone scrolling to
|
|
1101
1101
|
// text input.
|
|
@@ -1243,32 +1243,28 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1243
1243
|
scrollResponderKeyboardWillShow: (e: KeyboardEvent) => void = (
|
|
1244
1244
|
e: KeyboardEvent,
|
|
1245
1245
|
) => {
|
|
1246
|
-
this.
|
|
1246
|
+
this._keyboardMetrics = e.endCoordinates;
|
|
1247
1247
|
this.props.onKeyboardWillShow && this.props.onKeyboardWillShow(e);
|
|
1248
1248
|
};
|
|
1249
1249
|
|
|
1250
1250
|
scrollResponderKeyboardWillHide: (e: KeyboardEvent) => void = (
|
|
1251
1251
|
e: KeyboardEvent,
|
|
1252
1252
|
) => {
|
|
1253
|
-
this.
|
|
1253
|
+
this._keyboardMetrics = null;
|
|
1254
1254
|
this.props.onKeyboardWillHide && this.props.onKeyboardWillHide(e);
|
|
1255
1255
|
};
|
|
1256
1256
|
|
|
1257
1257
|
scrollResponderKeyboardDidShow: (e: KeyboardEvent) => void = (
|
|
1258
1258
|
e: KeyboardEvent,
|
|
1259
1259
|
) => {
|
|
1260
|
-
|
|
1261
|
-
// Use the one from WillShow and do not assign.
|
|
1262
|
-
if (e) {
|
|
1263
|
-
this._keyboardWillOpenTo = e;
|
|
1264
|
-
}
|
|
1260
|
+
this._keyboardMetrics = e.endCoordinates;
|
|
1265
1261
|
this.props.onKeyboardDidShow && this.props.onKeyboardDidShow(e);
|
|
1266
1262
|
};
|
|
1267
1263
|
|
|
1268
1264
|
scrollResponderKeyboardDidHide: (e: KeyboardEvent) => void = (
|
|
1269
1265
|
e: KeyboardEvent,
|
|
1270
1266
|
) => {
|
|
1271
|
-
this.
|
|
1267
|
+
this._keyboardMetrics = null;
|
|
1272
1268
|
this.props.onKeyboardDidHide && this.props.onKeyboardDidHide(e);
|
|
1273
1269
|
};
|
|
1274
1270
|
|
|
@@ -1547,7 +1543,7 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1547
1543
|
// keyboard, except on Android where setting windowSoftInputMode to
|
|
1548
1544
|
// adjustNone leads to missing keyboard events.
|
|
1549
1545
|
const softKeyboardMayBeOpen =
|
|
1550
|
-
this.
|
|
1546
|
+
this._keyboardMetrics != null || Platform.OS === 'android';
|
|
1551
1547
|
|
|
1552
1548
|
return hasFocusedTextInput && softKeyboardMayBeOpen;
|
|
1553
1549
|
};
|
|
@@ -976,8 +976,6 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
976
976
|
const text =
|
|
977
977
|
typeof props.value === 'string'
|
|
978
978
|
? props.value
|
|
979
|
-
: typeof lastNativeText === 'string'
|
|
980
|
-
? lastNativeText
|
|
981
979
|
: typeof props.defaultValue === 'string'
|
|
982
980
|
? props.defaultValue
|
|
983
981
|
: '';
|
|
@@ -39,7 +39,10 @@ if (__DEV__) {
|
|
|
39
39
|
// Get hostname from development server (packager)
|
|
40
40
|
const devServer = getDevServer();
|
|
41
41
|
const host = devServer.bundleLoadedFromServer
|
|
42
|
-
? devServer.url
|
|
42
|
+
? devServer.url
|
|
43
|
+
.replace(/https?:\/\//, '')
|
|
44
|
+
.replace(/\/$/, '')
|
|
45
|
+
.split(':')[0]
|
|
43
46
|
: 'localhost';
|
|
44
47
|
|
|
45
48
|
// Read the optional global variable for backward compatibility.
|
|
@@ -146,7 +146,7 @@ module.exports = {
|
|
|
146
146
|
errorMessageForMethod('setLayoutAnimationEnabledExperimental'),
|
|
147
147
|
);
|
|
148
148
|
},
|
|
149
|
-
// Please use AccessibilityInfo.
|
|
149
|
+
// Please use AccessibilityInfo.sendAccessibilityEvent instead.
|
|
150
150
|
// See SetAccessibilityFocusExample in AccessibilityExample.js for a migration example.
|
|
151
151
|
sendAccessibilityEvent: (reactTag: ?number, eventType: number): void =>
|
|
152
152
|
console.error(errorMessageForMethod('sendAccessibilityEvent')),
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -23,6 +23,7 @@ extern NSString *const RCTAccessibilityManagerDidUpdateMultiplierNotification; /
|
|
|
23
23
|
@property (nonatomic, assign) BOOL isGrayscaleEnabled;
|
|
24
24
|
@property (nonatomic, assign) BOOL isInvertColorsEnabled;
|
|
25
25
|
@property (nonatomic, assign) BOOL isReduceMotionEnabled;
|
|
26
|
+
@property (nonatomic, assign) BOOL prefersCrossFadeTransitions;
|
|
26
27
|
@property (nonatomic, assign) BOOL isReduceTransparencyEnabled;
|
|
27
28
|
@property (nonatomic, assign) BOOL isVoiceOverEnabled;
|
|
28
29
|
|
|
@@ -358,6 +358,17 @@ RCT_EXPORT_METHOD(getCurrentReduceMotionState
|
|
|
358
358
|
onSuccess(@[ @(_isReduceMotionEnabled) ]);
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
+
RCT_EXPORT_METHOD(getCurrentPrefersCrossFadeTransitionsState
|
|
362
|
+
: (RCTResponseSenderBlock)onSuccess onError
|
|
363
|
+
: (__unused RCTResponseSenderBlock)onError)
|
|
364
|
+
{
|
|
365
|
+
if (@available(iOS 14.0, *)) {
|
|
366
|
+
onSuccess(@[ @(UIAccessibilityPrefersCrossFadeTransitions()) ]);
|
|
367
|
+
} else {
|
|
368
|
+
onSuccess(@[ @(false) ]);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
361
372
|
RCT_EXPORT_METHOD(getCurrentReduceTransparencyState
|
|
362
373
|
: (RCTResponseSenderBlock)onSuccess onError
|
|
363
374
|
: (__unused RCTResponseSenderBlock)onError)
|
|
@@ -18,14 +18,19 @@ set(CMAKE_VERBOSE_MAKEFILE on)
|
|
|
18
18
|
|
|
19
19
|
include(${REACT_ANDROID_DIR}/cmake-utils/Android-prebuilt.cmake)
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
set(BUILD_DIR ${PROJECT_BUILD_DIR})
|
|
22
|
+
if(CMAKE_HOST_WIN32)
|
|
23
|
+
string(REPLACE "\\" "/" BUILD_DIR ${BUILD_DIR})
|
|
24
|
+
endif()
|
|
25
|
+
|
|
26
|
+
file(GLOB input_SRC CONFIGURE_DEPENDS
|
|
22
27
|
*.cpp
|
|
23
|
-
${
|
|
28
|
+
${BUILD_DIR}/generated/rncli/src/main/jni/*.cpp)
|
|
24
29
|
|
|
25
30
|
add_library(${CMAKE_PROJECT_NAME} SHARED ${input_SRC})
|
|
26
31
|
|
|
27
|
-
target_include_directories(${CMAKE_PROJECT_NAME}
|
|
28
|
-
PUBLIC
|
|
32
|
+
target_include_directories(${CMAKE_PROJECT_NAME}
|
|
33
|
+
PUBLIC
|
|
29
34
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
30
35
|
${PROJECT_BUILD_DIR}/generated/rncli/src/main/jni)
|
|
31
36
|
|
|
@@ -86,7 +86,7 @@ task unzipHermes(dependsOn: downloadHermes, type: Copy) {
|
|
|
86
86
|
|
|
87
87
|
task configureBuildForHermes(type: Exec) {
|
|
88
88
|
workingDir(hermesDir)
|
|
89
|
-
commandLine(windowsAwareCommandLine(findCmakePath(cmakeVersion), "-S", ".", "-B", hermesBuildDir.toString(), "-DJSI_DIR=" + jsiDir.absolutePath))
|
|
89
|
+
commandLine(windowsAwareCommandLine(findCmakePath(cmakeVersion), Os.isFamily(Os.FAMILY_WINDOWS) ? "-GNMake Makefiles" : "", "-S", ".", "-B", hermesBuildDir.toString(), "-DJSI_DIR=" + jsiDir.absolutePath))
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
task buildHermes(dependsOn: configureBuildForHermes, type: Exec) {
|