react-native 0.80.0-rc.0 → 0.80.0-rc.2
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/AnimatedExports.js.flow +1 -1
- package/Libraries/Animated/nodes/AnimatedProps.js +1 -1
- package/Libraries/AppState/AppState.js +6 -1
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -0
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +13 -1
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +1 -1
- package/Libraries/Image/AssetSourceResolver.js +17 -4
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +3 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +4 -2
- package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
- package/Libraries/Text/TextProps.js +2 -31
- package/Libraries/vendor/core/ErrorUtils.js +28 -4
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +18 -4
- package/ReactAndroid/api/ReactAndroid.api +7 -7
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +20 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.kt +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactStylesDiffMap.kt +6 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupManager.kt +6 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderRadiusStyle.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/util/AndroidVersion.kt +30 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +31 -17
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/jsc/React-jsc.podspec +1 -1
- package/jest/resolver.js +31 -0
- package/jest-preset.js +1 -0
- package/package.json +9 -8
- package/scripts/codegen/generate-artifacts-executor/generateCustomURLHandlers.js +11 -3
- package/scripts/codegen/generate-artifacts-executor/index.js +21 -2
- package/scripts/codegen/generate-artifacts-executor/utils.js +30 -14
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/src/private/styles/composeStyles.js +12 -5
- package/src/types/globals.d.ts +42 -0
- package/types_generated/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +9 -9
- package/types_generated/Libraries/Animated/AnimatedExports.d.ts +2 -2
- package/types_generated/Libraries/Animated/AnimatedImplementation.d.ts +4 -4
- package/types_generated/Libraries/Animated/Easing.d.ts +49 -49
- package/types_generated/Libraries/Animated/components/AnimatedFlatList.d.ts +4 -4
- package/types_generated/Libraries/Animated/components/AnimatedImage.d.ts +4 -4
- package/types_generated/Libraries/Animated/components/AnimatedScrollView.d.ts +5 -5
- package/types_generated/Libraries/Animated/components/AnimatedSectionList.d.ts +4 -4
- package/types_generated/Libraries/Animated/components/AnimatedText.d.ts +4 -4
- package/types_generated/Libraries/Animated/components/AnimatedView.d.ts +4 -4
- package/types_generated/Libraries/Animated/nodes/AnimatedProps.d.ts +2 -2
- package/types_generated/Libraries/AppState/AppState.d.ts +5 -5
- package/types_generated/Libraries/BatchedBridge/BatchedBridge.d.ts +4 -4
- package/types_generated/Libraries/BatchedBridge/NativeModules.d.ts +4 -4
- package/types_generated/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +13 -13
- package/types_generated/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.d.ts +4 -4
- package/types_generated/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +9 -10
- package/types_generated/Libraries/Components/Button.d.ts +4 -4
- package/types_generated/Libraries/Components/Clipboard/Clipboard.d.ts +4 -4
- package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +4 -4
- package/types_generated/Libraries/Components/Keyboard/Keyboard.d.ts +4 -4
- package/types_generated/Libraries/Components/LayoutConformance/LayoutConformance.d.ts +4 -4
- package/types_generated/Libraries/Components/Pressable/Pressable.d.ts +4 -4
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +12 -5
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.d.ts +4 -4
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.d.ts +6 -30
- package/types_generated/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +9 -9
- package/types_generated/Libraries/Components/ScrollView/ScrollView.d.ts +4 -4
- package/types_generated/Libraries/Components/ScrollView/ScrollViewContext.d.ts +4 -4
- package/types_generated/Libraries/Components/ScrollView/ScrollViewNativeComponent.d.ts +4 -4
- package/types_generated/Libraries/Components/ScrollView/ScrollViewStickyHeader.d.ts +4 -4
- package/types_generated/Libraries/Components/Switch/AndroidSwitchNativeComponent.d.ts +4 -4
- package/types_generated/Libraries/Components/Switch/Switch.d.ts +9 -9
- package/types_generated/Libraries/Components/Switch/SwitchNativeComponent.d.ts +4 -4
- package/types_generated/Libraries/Components/TextInput/InputAccessoryView.d.ts +4 -4
- package/types_generated/Libraries/Components/TextInput/TextInput.d.ts +4 -4
- package/types_generated/Libraries/Components/TextInput/TextInputState.d.ts +4 -4
- package/types_generated/Libraries/Components/ToastAndroid/ToastAndroid.d.ts +4 -4
- package/types_generated/Libraries/Components/Touchable/Touchable.d.ts +4 -4
- package/types_generated/Libraries/Components/Touchable/TouchableHighlight.d.ts +4 -4
- package/types_generated/Libraries/Components/Touchable/TouchableOpacity.d.ts +4 -4
- package/types_generated/Libraries/Components/View/View.d.ts +9 -9
- package/types_generated/Libraries/Components/View/ViewNativeComponent.d.ts +4 -4
- package/types_generated/Libraries/Core/ExceptionsManager.d.ts +4 -4
- package/types_generated/Libraries/Core/NativeExceptionsManager.d.ts +4 -4
- package/types_generated/Libraries/Core/RawEventEmitter.d.ts +4 -4
- package/types_generated/Libraries/Core/ReactFiberErrorDialog.d.ts +4 -4
- package/types_generated/Libraries/Core/registerCallableModule.d.ts +4 -4
- package/types_generated/Libraries/EventEmitter/NativeEventEmitter.d.ts +2 -2
- package/types_generated/Libraries/EventEmitter/RCTDeviceEventEmitter.d.ts +4 -4
- package/types_generated/Libraries/EventEmitter/RCTEventEmitter.d.ts +4 -4
- package/types_generated/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +5 -5
- package/types_generated/Libraries/Image/AssetSourceResolver.d.ts +13 -2
- package/types_generated/Libraries/Image/Image.d.ts +4 -4
- package/types_generated/Libraries/Image/ImageViewNativeComponent.d.ts +4 -4
- package/types_generated/Libraries/Image/TextInlineImageNativeComponent.d.ts +4 -4
- package/types_generated/Libraries/Interaction/InteractionManager.d.ts +4 -4
- package/types_generated/Libraries/Interaction/PanResponder.d.ts +4 -4
- package/types_generated/Libraries/LayoutAnimation/LayoutAnimation.d.ts +14 -14
- package/types_generated/Libraries/Linking/Linking.d.ts +4 -4
- package/types_generated/Libraries/Lists/VirtualizedList.d.ts +4 -4
- package/types_generated/Libraries/Lists/VirtualizedSectionList.d.ts +4 -4
- package/types_generated/Libraries/LogBox/LogBox.d.ts +4 -4
- package/types_generated/Libraries/Modal/Modal.d.ts +4 -4
- package/types_generated/Libraries/NativeModules/specs/NativeDialogManagerAndroid.d.ts +4 -4
- package/types_generated/Libraries/Network/RCTNetworking.d.ts +4 -4
- package/types_generated/Libraries/Network/convertRequestBody.d.ts +4 -4
- package/types_generated/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +4 -4
- package/types_generated/Libraries/ReactNative/DisplayMode.d.ts +6 -6
- package/types_generated/Libraries/ReactNative/I18nManager.d.ts +4 -4
- package/types_generated/Libraries/ReactNative/NativeI18nManager.d.ts +4 -4
- package/types_generated/Libraries/ReactNative/NativeUIManager.d.ts +4 -4
- package/types_generated/Libraries/ReactNative/UIManager.d.ts +4 -4
- package/types_generated/Libraries/ReactNative/requireNativeComponent.d.ts +5 -6
- package/types_generated/Libraries/Settings/Settings.d.ts +4 -4
- package/types_generated/Libraries/StyleSheet/StyleSheetExports.d.ts +2 -2
- package/types_generated/Libraries/StyleSheet/StyleSheetTypes.d.ts +8 -5
- package/types_generated/Libraries/StyleSheet/flattenStyle.d.ts +4 -4
- package/types_generated/Libraries/StyleSheet/private/_TransformStyle.d.ts +7 -3
- package/types_generated/Libraries/StyleSheet/processColor.d.ts +4 -4
- package/types_generated/Libraries/Text/Text.d.ts +9 -9
- package/types_generated/Libraries/Text/TextProps.d.ts +3 -31
- package/types_generated/Libraries/UTFSequence.d.ts +11 -11
- package/types_generated/Libraries/Utilities/BackHandler.d.ts +4 -4
- package/types_generated/Libraries/Utilities/DevSettings.d.ts +7 -7
- package/types_generated/Libraries/Utilities/DeviceInfo.d.ts +4 -4
- package/types_generated/Libraries/Utilities/NativeAppearance.d.ts +4 -4
- package/types_generated/Libraries/Utilities/NativeDeviceInfo.d.ts +4 -4
- package/types_generated/Libraries/Utilities/Platform.d.ts +4 -4
- package/types_generated/Libraries/Utilities/codegenNativeCommands.d.ts +4 -4
- package/types_generated/Libraries/Utilities/codegenNativeComponent.d.ts +4 -4
- package/types_generated/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.d.ts +4 -4
- package/types_generated/Libraries/Utilities/differ/deepDiffer.d.ts +4 -4
- package/types_generated/Libraries/Vibration/Vibration.d.ts +4 -4
- package/types_generated/Libraries/vendor/core/ErrorUtils.d.ts +16 -6
- package/types_generated/index.d.ts +2 -2
- package/types_generated/src/private/devsupport/devmenu/DevMenu.d.ts +4 -4
- package/types_generated/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.d.ts +4 -4
- package/types_generated/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.d.ts +4 -4
- package/types_generated/src/private/specs_DEPRECATED/components/SwitchNativeComponent.d.ts +4 -4
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeAppearance.d.ts +4 -4
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.d.ts +4 -4
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.d.ts +4 -4
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.d.ts +4 -4
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeI18nManager.d.ts +4 -4
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeUIManager.d.ts +4 -4
- package/types_generated/src/private/styles/composeStyles.d.ts +4 -2
- package/types_generated/src/private/webapis/dom/nodes/specs/NativeDOM.d.ts +4 -4
|
@@ -37,7 +37,7 @@ export type {default as AnimatedDivision} from './nodes/AnimatedDivision';
|
|
|
37
37
|
export type {default as AnimatedModulo} from './nodes/AnimatedModulo';
|
|
38
38
|
export type {default as AnimatedMultiplication} from './nodes/AnimatedMultiplication';
|
|
39
39
|
export type {default as AnimatedSubtraction} from './nodes/AnimatedSubtraction';
|
|
40
|
-
export type {WithAnimatedValue} from './createAnimatedComponent';
|
|
40
|
+
export type {WithAnimatedValue, AnimatedProps} from './createAnimatedComponent';
|
|
41
41
|
export type {AnimatedComponentType as AnimatedComponent} from './createAnimatedComponent';
|
|
42
42
|
|
|
43
43
|
/**
|
|
@@ -22,7 +22,12 @@ import NativeAppState from './NativeAppState';
|
|
|
22
22
|
* - @platform android - on another Activity (even if it was launched by your app)
|
|
23
23
|
* @platform ios - inactive - This is a state that occurs when transitioning between foreground & background, and during periods of inactivity such as entering the multitasking view, opening the Notification Center or in the event of an incoming call.
|
|
24
24
|
*/
|
|
25
|
-
export type AppStateStatus =
|
|
25
|
+
export type AppStateStatus =
|
|
26
|
+
| 'inactive'
|
|
27
|
+
| 'background'
|
|
28
|
+
| 'active'
|
|
29
|
+
| 'extension'
|
|
30
|
+
| 'unknown';
|
|
26
31
|
|
|
27
32
|
/**
|
|
28
33
|
* change - This even is received when the app state has changed.
|
|
@@ -110,6 +110,7 @@ const ActivityIndicator = (
|
|
|
110
110
|
style={StyleSheet.compose(styles.container, style)}>
|
|
111
111
|
{Platform.OS === 'android' ? (
|
|
112
112
|
// $FlowFixMe[prop-missing] Flow doesn't know when this is the android component
|
|
113
|
+
// $FlowFixMe[incompatible-type]
|
|
113
114
|
<PlatformActivityIndicator {...nativeProps} {...androidProps} />
|
|
114
115
|
) : (
|
|
115
116
|
/* $FlowFixMe[incompatible-type] (>=0.106.0 site=react_native_android_fb) This comment
|
|
@@ -17,11 +17,23 @@ import Platform from '../../Utilities/Platform';
|
|
|
17
17
|
|
|
18
18
|
export type {ProgressBarAndroidProps};
|
|
19
19
|
|
|
20
|
+
// A utility type to preserve the semantics of the union uses in the definition
|
|
21
|
+
// of ProgressBarAndroidProps. TS's Omit does not distribute over unions, so
|
|
22
|
+
// we define our own version which does. This does not affect Flow.
|
|
23
|
+
// $FlowExpectedError[unclear-type]
|
|
24
|
+
type Omit<T, K> = T extends any ? Pick<T, Exclude<$Keys<T>, K>> : T;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* ProgressBarAndroid has been extracted from react-native core and will be removed in a future release.
|
|
28
|
+
* It can now be installed and imported from `@react-native-community/progress-bar-android` instead of 'react-native'.
|
|
29
|
+
* @see https://github.com/react-native-community/progress-bar-android
|
|
30
|
+
* @deprecated
|
|
31
|
+
*/
|
|
20
32
|
let ProgressBarAndroid: component(
|
|
21
33
|
ref?: React.RefSetter<
|
|
22
34
|
React.ElementRef<ProgressBarAndroidNativeComponentType>,
|
|
23
35
|
>,
|
|
24
|
-
...props: ProgressBarAndroidProps
|
|
36
|
+
...props: Omit<ProgressBarAndroidProps, empty>
|
|
25
37
|
);
|
|
26
38
|
|
|
27
39
|
if (Platform.OS === 'android') {
|
|
@@ -17,28 +17,25 @@ import type {ViewProps} from '../View/ViewPropTypes';
|
|
|
17
17
|
* `indeterminate` can only be false if `styleAttr` is Horizontal, and requires a
|
|
18
18
|
* `progress` value.
|
|
19
19
|
*/
|
|
20
|
-
type
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
| {
|
|
27
|
-
styleAttr:
|
|
28
|
-
| 'Horizontal'
|
|
29
|
-
| 'Normal'
|
|
30
|
-
| 'Small'
|
|
31
|
-
| 'Large'
|
|
32
|
-
| 'Inverse'
|
|
33
|
-
| 'SmallInverse'
|
|
34
|
-
| 'LargeInverse',
|
|
35
|
-
indeterminate: true,
|
|
36
|
-
};
|
|
20
|
+
type DeterminateProgressBarAndroidStyleAttrProp = {
|
|
21
|
+
styleAttr: 'Horizontal',
|
|
22
|
+
indeterminate: false,
|
|
23
|
+
progress: number,
|
|
24
|
+
};
|
|
37
25
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
type IndeterminateProgressBarAndroidStyleAttrProp = {
|
|
27
|
+
styleAttr:
|
|
28
|
+
| 'Horizontal'
|
|
29
|
+
| 'Normal'
|
|
30
|
+
| 'Small'
|
|
31
|
+
| 'Large'
|
|
32
|
+
| 'Inverse'
|
|
33
|
+
| 'SmallInverse'
|
|
34
|
+
| 'LargeInverse',
|
|
35
|
+
indeterminate: true,
|
|
36
|
+
};
|
|
41
37
|
|
|
38
|
+
type ProgressBarAndroidBaseProps = $ReadOnly<{
|
|
42
39
|
/**
|
|
43
40
|
* Whether to show the ProgressBar (true, the default) or hide it (false).
|
|
44
41
|
*/
|
|
@@ -52,3 +49,15 @@ export type ProgressBarAndroidProps = $ReadOnly<{
|
|
|
52
49
|
*/
|
|
53
50
|
testID?: ?string,
|
|
54
51
|
}>;
|
|
52
|
+
|
|
53
|
+
export type ProgressBarAndroidProps =
|
|
54
|
+
| $ReadOnly<{
|
|
55
|
+
...ViewProps,
|
|
56
|
+
...ProgressBarAndroidBaseProps,
|
|
57
|
+
...DeterminateProgressBarAndroidStyleAttrProp,
|
|
58
|
+
}>
|
|
59
|
+
| $ReadOnly<{
|
|
60
|
+
...ViewProps,
|
|
61
|
+
...ProgressBarAndroidBaseProps,
|
|
62
|
+
...IndeterminateProgressBarAndroidStyleAttrProp,
|
|
63
|
+
}>;
|
|
@@ -18,10 +18,23 @@ export type ResolvedAssetSource = {
|
|
|
18
18
|
+scale: number,
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
// From @react-native/assets-registry
|
|
22
|
+
type AssetDestPathResolver = 'android' | 'generic';
|
|
23
|
+
|
|
24
|
+
// From @react-native/assets-registry
|
|
25
|
+
type PackagerAsset = $ReadOnly<{
|
|
26
|
+
__packager_asset: boolean,
|
|
27
|
+
fileSystemLocation: string,
|
|
28
|
+
httpServerLocation: string,
|
|
29
|
+
width: ?number,
|
|
30
|
+
height: ?number,
|
|
31
|
+
scales: Array<number>,
|
|
32
|
+
hash: string,
|
|
33
|
+
name: string,
|
|
34
|
+
type: string,
|
|
35
|
+
resolver?: AssetDestPathResolver,
|
|
36
|
+
...
|
|
37
|
+
}>;
|
|
25
38
|
|
|
26
39
|
const PixelRatio = require('../Utilities/PixelRatio').default;
|
|
27
40
|
const Platform = require('../Utilities/Platform').default;
|
|
@@ -107,4 +107,6 @@ declare export const setStyleAttributePreprocessor: (
|
|
|
107
107
|
* An identity function for creating style sheets.
|
|
108
108
|
*/
|
|
109
109
|
// $FlowFixMe[unsupported-variance-annotation]
|
|
110
|
-
declare export const create: <+S: ____Styles_Internal>(
|
|
110
|
+
declare export const create: <+S: ____Styles_Internal>(
|
|
111
|
+
obj: S & ____Styles_Internal,
|
|
112
|
+
) => $ReadOnly<S>;
|
|
@@ -21,6 +21,7 @@ import type {
|
|
|
21
21
|
____ViewStyle_InternalOverrides,
|
|
22
22
|
} from './private/_StyleSheetTypesOverrides';
|
|
23
23
|
import type {____TransformStyle_Internal} from './private/_TransformStyle';
|
|
24
|
+
import type {ColorValue} from './StyleSheet';
|
|
24
25
|
|
|
25
26
|
export type {____TransformStyle_Internal};
|
|
26
27
|
|
|
@@ -1001,7 +1002,8 @@ export type ____ImageStyle_InternalCore = $ReadOnly<{
|
|
|
1001
1002
|
resizeMode?: ImageResizeMode,
|
|
1002
1003
|
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
|
|
1003
1004
|
tintColor?: ____ColorValue_Internal,
|
|
1004
|
-
overlayColor?:
|
|
1005
|
+
overlayColor?: ColorValue,
|
|
1006
|
+
overflow?: 'visible' | 'hidden',
|
|
1005
1007
|
}>;
|
|
1006
1008
|
|
|
1007
1009
|
export type ____ImageStyle_Internal = $ReadOnly<{
|
|
@@ -1014,7 +1016,7 @@ export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
|
|
|
1014
1016
|
resizeMode?: ImageResizeMode,
|
|
1015
1017
|
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
|
|
1016
1018
|
tintColor?: ____ColorValue_Internal,
|
|
1017
|
-
overlayColor?:
|
|
1019
|
+
overlayColor?: ColorValue,
|
|
1018
1020
|
}>;
|
|
1019
1021
|
|
|
1020
1022
|
export type ____DangerouslyImpreciseStyle_Internal = $ReadOnly<{
|
|
@@ -10,6 +10,25 @@
|
|
|
10
10
|
|
|
11
11
|
import type AnimatedNode from '../../Animated/nodes/AnimatedNode';
|
|
12
12
|
|
|
13
|
+
// Helper types to enforce that a single key is used in a transform object
|
|
14
|
+
// after generating a TypeScript definition file from the Flow types.
|
|
15
|
+
// $FlowExpectedError[unclear-type]
|
|
16
|
+
type KeysOfUnion<T> = T extends any ? $Keys<T> : empty;
|
|
17
|
+
// $FlowExpectedError[unclear-type]
|
|
18
|
+
type ValueOfUnion<T, K> = T extends any
|
|
19
|
+
? K extends $Keys<T>
|
|
20
|
+
? T[K]
|
|
21
|
+
: empty
|
|
22
|
+
: empty;
|
|
23
|
+
type MergeUnion<T> = {
|
|
24
|
+
[K in KeysOfUnion<T>]?: ValueOfUnion<T, K>,
|
|
25
|
+
};
|
|
26
|
+
type MaximumOneOf<T: {...}> = $Values<{
|
|
27
|
+
[K in keyof T]: $Exact<{
|
|
28
|
+
[P in keyof T]?: P extends K ? T[P] : empty,
|
|
29
|
+
}>,
|
|
30
|
+
}>;
|
|
31
|
+
|
|
13
32
|
export type ____TransformStyle_Internal = $ReadOnly<{
|
|
14
33
|
/**
|
|
15
34
|
* `transform` accepts an array of transformation objects. Each object specifies
|
|
@@ -29,27 +48,36 @@ export type ____TransformStyle_Internal = $ReadOnly<{
|
|
|
29
48
|
*/
|
|
30
49
|
transform?:
|
|
31
50
|
| $ReadOnlyArray<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
$ReadOnly<
|
|
52
|
+
MaximumOneOf<
|
|
53
|
+
MergeUnion<
|
|
54
|
+
| {+perspective: number | AnimatedNode}
|
|
55
|
+
| {+rotate: string | AnimatedNode}
|
|
56
|
+
| {+rotateX: string | AnimatedNode}
|
|
57
|
+
| {+rotateY: string | AnimatedNode}
|
|
58
|
+
| {+rotateZ: string | AnimatedNode}
|
|
59
|
+
| {+scale: number | AnimatedNode}
|
|
60
|
+
| {+scaleX: number | AnimatedNode}
|
|
61
|
+
| {+scaleY: number | AnimatedNode}
|
|
62
|
+
| {+translateX: number | string | AnimatedNode}
|
|
63
|
+
| {+translateY: number | string | AnimatedNode}
|
|
64
|
+
| {
|
|
65
|
+
+translate:
|
|
66
|
+
| [
|
|
67
|
+
number | string | AnimatedNode,
|
|
68
|
+
number | string | AnimatedNode,
|
|
69
|
+
]
|
|
70
|
+
| AnimatedNode,
|
|
71
|
+
}
|
|
72
|
+
| {+skewX: string | AnimatedNode}
|
|
73
|
+
| {+skewY: string | AnimatedNode}
|
|
74
|
+
// TODO: what is the actual type it expects?
|
|
75
|
+
| {
|
|
76
|
+
+matrix: $ReadOnlyArray<number | AnimatedNode> | AnimatedNode,
|
|
77
|
+
},
|
|
78
|
+
>,
|
|
79
|
+
>,
|
|
80
|
+
>,
|
|
53
81
|
>
|
|
54
82
|
| string,
|
|
55
83
|
/**
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import type {
|
|
14
14
|
AccessibilityActionEvent,
|
|
15
15
|
AccessibilityActionInfo,
|
|
16
|
+
AccessibilityProps,
|
|
16
17
|
AccessibilityRole,
|
|
17
18
|
AccessibilityState,
|
|
18
19
|
Role,
|
|
@@ -124,20 +125,7 @@ export type TextPropsAndroid = {
|
|
|
124
125
|
};
|
|
125
126
|
|
|
126
127
|
type TextBaseProps = $ReadOnly<{
|
|
127
|
-
/**
|
|
128
|
-
* Indicates whether the view is an accessibility element.
|
|
129
|
-
*
|
|
130
|
-
* See https://reactnative.dev/docs/text#accessible
|
|
131
|
-
*/
|
|
132
|
-
accessible?: ?boolean,
|
|
133
|
-
accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
|
|
134
128
|
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
|
|
135
|
-
accessibilityHint?: ?Stringish,
|
|
136
|
-
accessibilityLanguage?: ?Stringish,
|
|
137
|
-
accessibilityLabel?: ?Stringish,
|
|
138
|
-
accessibilityRole?: ?AccessibilityRole,
|
|
139
|
-
accessibilityState?: ?AccessibilityState,
|
|
140
|
-
'aria-label'?: ?string,
|
|
141
129
|
|
|
142
130
|
/**
|
|
143
131
|
* Whether fonts should scale to respect Text Size accessibility settings.
|
|
@@ -152,24 +140,6 @@ type TextBaseProps = $ReadOnly<{
|
|
|
152
140
|
*
|
|
153
141
|
*/
|
|
154
142
|
android_hyphenationFrequency?: ?('normal' | 'none' | 'full'),
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* alias for accessibilityState
|
|
158
|
-
*
|
|
159
|
-
* see https://reactnative.dev/docs/accessibility#accessibilitystate
|
|
160
|
-
*/
|
|
161
|
-
'aria-busy'?: ?boolean,
|
|
162
|
-
'aria-checked'?: ?boolean | 'mixed',
|
|
163
|
-
'aria-disabled'?: ?boolean,
|
|
164
|
-
'aria-expanded'?: ?boolean,
|
|
165
|
-
'aria-selected'?: ?boolean,
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Represents the nativeID of the associated label text. When the assistive technology focuses on the component with this props, the text is read aloud.
|
|
169
|
-
* This prop is listed for cross-platform reasons and has no real effect on Android or iOS.
|
|
170
|
-
*/
|
|
171
|
-
'aria-labelledby'?: ?string,
|
|
172
|
-
|
|
173
143
|
children?: ?React.Node,
|
|
174
144
|
|
|
175
145
|
/**
|
|
@@ -306,4 +276,5 @@ export type TextProps = $ReadOnly<{
|
|
|
306
276
|
...TextPropsIOS,
|
|
307
277
|
...TextPropsAndroid,
|
|
308
278
|
...TextBaseProps,
|
|
279
|
+
...AccessibilityProps,
|
|
309
280
|
}>;
|
|
@@ -8,9 +8,33 @@
|
|
|
8
8
|
* @flow strict
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
// From @react-native/js-polyfills
|
|
12
|
+
type ErrorHandler = (error: mixed, isFatal: boolean) => void;
|
|
13
|
+
type Fn<Args: $ReadOnlyArray<mixed>, Return> = (...Args) => Return;
|
|
14
|
+
export type ErrorUtils = {
|
|
15
|
+
applyWithGuard<TArgs: $ReadOnlyArray<mixed>, TOut>(
|
|
16
|
+
fun: Fn<TArgs, TOut>,
|
|
17
|
+
context?: mixed,
|
|
18
|
+
args?: ?TArgs,
|
|
19
|
+
unused_onError?: null,
|
|
20
|
+
unused_name?: ?string,
|
|
21
|
+
): ?TOut,
|
|
22
|
+
applyWithGuardIfNeeded<TArgs: $ReadOnlyArray<mixed>, TOut>(
|
|
23
|
+
fun: Fn<TArgs, TOut>,
|
|
24
|
+
context?: mixed,
|
|
25
|
+
args?: ?TArgs,
|
|
26
|
+
): ?TOut,
|
|
27
|
+
getGlobalHandler(): ErrorHandler,
|
|
28
|
+
guard<TArgs: $ReadOnlyArray<mixed>, TOut>(
|
|
29
|
+
fun: Fn<TArgs, TOut>,
|
|
30
|
+
name?: ?string,
|
|
31
|
+
context?: mixed,
|
|
32
|
+
): ?(...TArgs) => ?TOut,
|
|
33
|
+
inGuard(): boolean,
|
|
34
|
+
reportError(error: mixed): void,
|
|
35
|
+
reportFatalError(error: mixed): void,
|
|
36
|
+
setGlobalHandler(fun: ErrorHandler): void,
|
|
37
|
+
};
|
|
14
38
|
|
|
15
39
|
/**
|
|
16
40
|
* The particular require runtime that we are using looks for a global
|
|
@@ -24,4 +48,4 @@ export type ErrorUtils = ErrorUtilsT;
|
|
|
24
48
|
* that use it aren't just using a global variable, so simply export the global
|
|
25
49
|
* variable here. ErrorUtils is originally defined in a file named error-guard.js.
|
|
26
50
|
*/
|
|
27
|
-
export default
|
|
51
|
+
export default global.ErrorUtils as ErrorUtils;
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -170,10 +170,24 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
|
|
170
170
|
|
|
171
171
|
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
172
172
|
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
if (_adapter && index == _adapter.paperView.reactSubviews.count) {
|
|
174
|
+
// This is a new child view that is being added to the end of the children array.
|
|
175
|
+
// After the children is added, we need to call didUpdateReactSubviews to make sure that it is rendered.
|
|
176
|
+
// Without this change, the new child will not be rendered right away because the didUpdateReactSubviews is not
|
|
177
|
+
// called and the `finalizeUpdate` is not invoked.
|
|
178
|
+
if ([childComponentView isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) {
|
|
179
|
+
UIView *target = ((RCTLegacyViewManagerInteropComponentView *)childComponentView).contentView;
|
|
180
|
+
[_adapter.paperView insertReactSubview:target atIndex:index];
|
|
181
|
+
} else {
|
|
182
|
+
[_adapter.paperView insertReactSubview:childComponentView atIndex:index];
|
|
183
|
+
}
|
|
184
|
+
[_adapter.paperView didUpdateReactSubviews];
|
|
185
|
+
} else {
|
|
186
|
+
[_viewsToBeMounted addObject:@{
|
|
187
|
+
kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
|
|
188
|
+
kRCTLegacyInteropChildComponentKey : childComponentView
|
|
189
|
+
}];
|
|
190
|
+
}
|
|
177
191
|
}
|
|
178
192
|
|
|
179
193
|
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
@@ -2006,7 +2006,7 @@ public final class com/facebook/react/devsupport/DefaultDevLoadingViewImplementa
|
|
|
2006
2006
|
public final fun setDevLoadingEnabled (Z)V
|
|
2007
2007
|
}
|
|
2008
2008
|
|
|
2009
|
-
public
|
|
2009
|
+
public class com/facebook/react/devsupport/DevServerHelper {
|
|
2010
2010
|
public fun <init> (Lcom/facebook/react/modules/debug/interfaces/DeveloperSettings;Landroid/content/Context;Lcom/facebook/react/packagerconnection/PackagerConnectionSettings;)V
|
|
2011
2011
|
public final fun closeInspectorConnection ()V
|
|
2012
2012
|
public final fun closePackagerConnection ()V
|
|
@@ -2015,12 +2015,12 @@ public final class com/facebook/react/devsupport/DevServerHelper {
|
|
|
2015
2015
|
public final fun downloadBundleFromURL (Lcom/facebook/react/devsupport/interfaces/DevBundleDownloadListener;Ljava/io/File;Ljava/lang/String;Lcom/facebook/react/devsupport/BundleDownloader$BundleInfo;Lokhttp3/Request$Builder;)V
|
|
2016
2016
|
public static synthetic fun downloadBundleFromURL$default (Lcom/facebook/react/devsupport/DevServerHelper;Lcom/facebook/react/devsupport/interfaces/DevBundleDownloadListener;Ljava/io/File;Ljava/lang/String;Lcom/facebook/react/devsupport/BundleDownloader$BundleInfo;Lokhttp3/Request$Builder;ILjava/lang/Object;)V
|
|
2017
2017
|
public final fun downloadBundleResourceFromUrlSync (Ljava/lang/String;Ljava/io/File;)Ljava/io/File;
|
|
2018
|
-
public
|
|
2019
|
-
public
|
|
2020
|
-
public
|
|
2021
|
-
public
|
|
2018
|
+
public fun getDevServerBundleURL (Ljava/lang/String;)Ljava/lang/String;
|
|
2019
|
+
public fun getDevServerSplitBundleURL (Ljava/lang/String;)Ljava/lang/String;
|
|
2020
|
+
public fun getSourceMapUrl (Ljava/lang/String;)Ljava/lang/String;
|
|
2021
|
+
public fun getSourceUrl (Ljava/lang/String;)Ljava/lang/String;
|
|
2022
2022
|
public final fun getWebsocketProxyURL ()Ljava/lang/String;
|
|
2023
|
-
public
|
|
2023
|
+
public fun isPackagerRunning (Lcom/facebook/react/devsupport/interfaces/PackagerStatusCallback;)V
|
|
2024
2024
|
public final fun openDebugger (Lcom/facebook/react/bridge/ReactContext;Ljava/lang/String;)V
|
|
2025
2025
|
public final fun openInspectorConnection ()V
|
|
2026
2026
|
public final fun openPackagerConnection (Ljava/lang/String;Lcom/facebook/react/devsupport/DevServerHelper$PackagerCommandListener;)V
|
|
@@ -4656,7 +4656,7 @@ public abstract class com/facebook/react/uimanager/ViewGroupManager : com/facebo
|
|
|
4656
4656
|
public fun getShadowNodeClass ()Ljava/lang/Class;
|
|
4657
4657
|
public static final fun getViewZIndex (Landroid/view/View;)Ljava/lang/Integer;
|
|
4658
4658
|
public fun needsCustomLayoutForChildren ()Z
|
|
4659
|
-
public
|
|
4659
|
+
public fun removeView (Landroid/view/ViewGroup;Landroid/view/View;)V
|
|
4660
4660
|
public synthetic fun removeViewAt (Landroid/view/View;I)V
|
|
4661
4661
|
public fun removeViewAt (Landroid/view/ViewGroup;I)V
|
|
4662
4662
|
public static final fun setViewZIndex (Landroid/view/View;I)V
|
|
@@ -11,11 +11,13 @@ import android.content.Intent;
|
|
|
11
11
|
import android.content.res.Configuration;
|
|
12
12
|
import android.os.Bundle;
|
|
13
13
|
import android.view.KeyEvent;
|
|
14
|
+
import androidx.activity.OnBackPressedCallback;
|
|
14
15
|
import androidx.annotation.Nullable;
|
|
15
16
|
import androidx.appcompat.app.AppCompatActivity;
|
|
16
17
|
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
|
|
17
18
|
import com.facebook.react.modules.core.PermissionAwareActivity;
|
|
18
19
|
import com.facebook.react.modules.core.PermissionListener;
|
|
20
|
+
import com.facebook.react.util.AndroidVersion;
|
|
19
21
|
import org.jetbrains.annotations.NotNull;
|
|
20
22
|
|
|
21
23
|
/** Base Activity for React Native applications. */
|
|
@@ -24,6 +26,18 @@ public abstract class ReactActivity extends AppCompatActivity
|
|
|
24
26
|
|
|
25
27
|
private final ReactActivityDelegate mDelegate;
|
|
26
28
|
|
|
29
|
+
// Due to enforced predictive back on targetSdk 36, 'onBackPressed()' is disabled by default.
|
|
30
|
+
// Using a workaround to trigger it manually.
|
|
31
|
+
private final OnBackPressedCallback mBackPressedCallback =
|
|
32
|
+
new OnBackPressedCallback(true) {
|
|
33
|
+
@Override
|
|
34
|
+
public void handleOnBackPressed() {
|
|
35
|
+
setEnabled(false);
|
|
36
|
+
onBackPressed();
|
|
37
|
+
setEnabled(true);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
27
41
|
protected ReactActivity() {
|
|
28
42
|
mDelegate = createReactActivityDelegate();
|
|
29
43
|
}
|
|
@@ -45,6 +59,9 @@ public abstract class ReactActivity extends AppCompatActivity
|
|
|
45
59
|
protected void onCreate(Bundle savedInstanceState) {
|
|
46
60
|
super.onCreate(savedInstanceState);
|
|
47
61
|
mDelegate.onCreate(savedInstanceState);
|
|
62
|
+
if (AndroidVersion.isAtLeastTargetSdk36(this)) {
|
|
63
|
+
getOnBackPressedDispatcher().addCallback(this, mBackPressedCallback);
|
|
64
|
+
}
|
|
48
65
|
}
|
|
49
66
|
|
|
50
67
|
@Override
|
|
@@ -103,6 +120,9 @@ public abstract class ReactActivity extends AppCompatActivity
|
|
|
103
120
|
|
|
104
121
|
@Override
|
|
105
122
|
public void invokeDefaultOnBackPressed() {
|
|
123
|
+
// Disabling callback so the fallback logic (finish activity) can run
|
|
124
|
+
// as super.onBackPressed() will call all enabled callbacks in the dispatcher.
|
|
125
|
+
mBackPressedCallback.setEnabled(false);
|
|
106
126
|
super.onBackPressed();
|
|
107
127
|
}
|
|
108
128
|
|
|
@@ -59,7 +59,7 @@ import okio.Okio
|
|
|
59
59
|
*/
|
|
60
60
|
@SuppressLint(
|
|
61
61
|
"StaticFieldLeak") // TODO: This entire class should be rewritten to don't use AsyncTask
|
|
62
|
-
public class DevServerHelper(
|
|
62
|
+
public open class DevServerHelper(
|
|
63
63
|
private val settings: DeveloperSettings,
|
|
64
64
|
private val applicationContext: Context,
|
|
65
65
|
private val packagerConnectionSettings: PackagerConnectionSettings
|
|
@@ -287,20 +287,20 @@ public class DevServerHelper(
|
|
|
287
287
|
additionalOptionsBuilder.toString())
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
public fun getDevServerBundleURL(jsModulePath: String): String =
|
|
290
|
+
public open fun getDevServerBundleURL(jsModulePath: String): String =
|
|
291
291
|
createBundleURL(jsModulePath, BundleType.BUNDLE, packagerConnectionSettings.debugServerHost)
|
|
292
292
|
|
|
293
|
-
public fun getDevServerSplitBundleURL(jsModulePath: String): String =
|
|
293
|
+
public open fun getDevServerSplitBundleURL(jsModulePath: String): String =
|
|
294
294
|
createSplitBundleURL(jsModulePath, packagerConnectionSettings.debugServerHost)
|
|
295
295
|
|
|
296
|
-
public fun isPackagerRunning(callback: PackagerStatusCallback) {
|
|
296
|
+
public open fun isPackagerRunning(callback: PackagerStatusCallback) {
|
|
297
297
|
packagerStatusCheck.run(packagerConnectionSettings.debugServerHost, callback)
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
public fun getSourceMapUrl(mainModuleName: String): String =
|
|
300
|
+
public open fun getSourceMapUrl(mainModuleName: String): String =
|
|
301
301
|
createBundleURL(mainModuleName, BundleType.MAP)
|
|
302
302
|
|
|
303
|
-
public fun getSourceUrl(mainModuleName: String): String =
|
|
303
|
+
public open fun getSourceUrl(mainModuleName: String): String =
|
|
304
304
|
createBundleURL(mainModuleName, BundleType.BUNDLE)
|
|
305
305
|
|
|
306
306
|
/**
|
package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java
CHANGED
|
@@ -462,9 +462,9 @@ public class NativeViewHierarchyOptimizer {
|
|
|
462
462
|
return false;
|
|
463
463
|
}
|
|
464
464
|
|
|
465
|
-
ReadableMapKeySetIterator keyIterator = props.
|
|
465
|
+
ReadableMapKeySetIterator keyIterator = props.internal_backingMap().keySetIterator();
|
|
466
466
|
while (keyIterator.hasNextKey()) {
|
|
467
|
-
if (!ViewProps.isLayoutOnly(props.
|
|
467
|
+
if (!ViewProps.isLayoutOnly(props.internal_backingMap(), keyIterator.nextKey())) {
|
|
468
468
|
return false;
|
|
469
469
|
}
|
|
470
470
|
}
|
|
@@ -31,7 +31,12 @@ import com.facebook.react.bridge.ReadableMap
|
|
|
31
31
|
*/
|
|
32
32
|
public class ReactStylesDiffMap(props: ReadableMap) {
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
/**
|
|
35
|
+
* This backing map is annotated as JvmName("internal_backingMap") so can be accessed by Java
|
|
36
|
+
* consumers. This is used in Expo to override setting properties in some subclassed view-manager
|
|
37
|
+
* as this provides faster access to the underlying values.
|
|
38
|
+
*/
|
|
39
|
+
@get:JvmName("internal_backingMap") internal val backingMap: ReadableMap = props
|
|
35
40
|
|
|
36
41
|
public fun toMap(): Map<String, Any?> = backingMap.toHashMap()
|
|
37
42
|
|
|
@@ -49,7 +49,12 @@ constructor(reactContext: ReactApplicationContext? = null) :
|
|
|
49
49
|
parent.removeViewAt(index)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Expo overrides this function GroupViewManagerWrapper.kt`, which is a replacement view manager
|
|
54
|
+
* adding support for delegates receiving callbacks whenever one of the methods in the view
|
|
55
|
+
* manager are called.
|
|
56
|
+
*/
|
|
57
|
+
public open fun removeView(parent: T, view: View) {
|
|
53
58
|
UiThreadUtil.assertOnUiThread()
|
|
54
59
|
|
|
55
60
|
for (i in 0 until getChildCount(parent)) {
|
|
@@ -97,7 +97,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
|
|
|
97
97
|
*/
|
|
98
98
|
public void updateProperties(@NonNull T viewToUpdate, ReactStylesDiffMap props) {
|
|
99
99
|
ViewManagerDelegate<T> delegate = getOrCreateViewManagerDelegate();
|
|
100
|
-
Iterator<Map.Entry<String, Object>> iterator = props.
|
|
100
|
+
Iterator<Map.Entry<String, Object>> iterator = props.internal_backingMap().getEntryIterator();
|
|
101
101
|
while (iterator.hasNext()) {
|
|
102
102
|
Map.Entry<String, Object> entry = iterator.next();
|
|
103
103
|
delegate.setProperty(viewToUpdate, entry.getKey(), entry.getValue());
|
|
@@ -143,11 +143,11 @@ internal data class BorderRadiusStyle(
|
|
|
143
143
|
CornerRadii(it, width, height)
|
|
144
144
|
} ?: zeroRadii,
|
|
145
145
|
bottomLeft =
|
|
146
|
-
(endEnd ?:
|
|
146
|
+
(endEnd ?: bottomEnd ?: bottomRight ?: uniform)?.let {
|
|
147
147
|
CornerRadii(it, width, height)
|
|
148
148
|
} ?: zeroRadii,
|
|
149
149
|
bottomRight =
|
|
150
|
-
(startEnd ?:
|
|
150
|
+
(startEnd ?: bottomStart ?: bottomLeft ?: uniform)?.let {
|
|
151
151
|
CornerRadii(it, width, height)
|
|
152
152
|
} ?: zeroRadii,
|
|
153
153
|
width = width,
|