react-native 0.80.0-rc.1 → 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.
Files changed (48) hide show
  1. package/Libraries/Animated/AnimatedExports.js.flow +1 -1
  2. package/Libraries/Animated/nodes/AnimatedProps.js +1 -1
  3. package/Libraries/AppState/AppState.js +6 -1
  4. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -0
  5. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +7 -1
  6. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
  7. package/Libraries/Core/ReactNativeVersion.js +1 -1
  8. package/Libraries/EventEmitter/NativeEventEmitter.js +1 -1
  9. package/Libraries/StyleSheet/StyleSheetExports.js.flow +3 -1
  10. package/Libraries/StyleSheet/StyleSheetTypes.js +4 -2
  11. package/Libraries/Text/TextProps.js +2 -31
  12. package/Libraries/vendor/core/ErrorUtils.js +1 -1
  13. package/React/Base/RCTVersion.m +1 -1
  14. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +18 -4
  15. package/ReactAndroid/api/ReactAndroid.api +7 -7
  16. package/ReactAndroid/gradle.properties +1 -1
  17. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +20 -0
  18. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.kt +6 -6
  19. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  20. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java +2 -2
  21. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactStylesDiffMap.kt +6 -1
  22. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupManager.kt +6 -1
  23. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +1 -1
  24. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderRadiusStyle.kt +2 -2
  25. package/ReactAndroid/src/main/java/com/facebook/react/util/AndroidVersion.kt +30 -0
  26. package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +31 -17
  27. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  28. package/jest/resolver.js +31 -0
  29. package/jest-preset.js +1 -0
  30. package/package.json +9 -8
  31. package/scripts/codegen/generate-artifacts-executor/generateCustomURLHandlers.js +11 -3
  32. package/sdks/hermesc/osx-bin/hermes +0 -0
  33. package/sdks/hermesc/osx-bin/hermesc +0 -0
  34. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  35. package/src/private/styles/composeStyles.js +12 -5
  36. package/src/types/globals.d.ts +42 -0
  37. package/types_generated/Libraries/Animated/AnimatedExports.d.ts +2 -2
  38. package/types_generated/Libraries/Animated/nodes/AnimatedProps.d.ts +2 -2
  39. package/types_generated/Libraries/AppState/AppState.d.ts +2 -2
  40. package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +3 -2
  41. package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.d.ts +6 -30
  42. package/types_generated/Libraries/EventEmitter/NativeEventEmitter.d.ts +2 -2
  43. package/types_generated/Libraries/StyleSheet/StyleSheetExports.d.ts +2 -2
  44. package/types_generated/Libraries/StyleSheet/StyleSheetTypes.d.ts +8 -5
  45. package/types_generated/Libraries/Text/TextProps.d.ts +3 -31
  46. package/types_generated/Libraries/vendor/core/ErrorUtils.d.ts +2 -2
  47. package/types_generated/index.d.ts +2 -2
  48. package/types_generated/src/private/styles/composeStyles.d.ts +4 -2
@@ -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,7 @@ import invariant from 'invariant';
22
22
 
23
23
  export type AnimatedPropsAllowlist = $ReadOnly<{
24
24
  style?: ?AnimatedStyleAllowlist,
25
- [string]: true,
25
+ [key: string]: true | AnimatedStyleAllowlist,
26
26
  }>;
27
27
 
28
28
  type TargetView = {
@@ -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 = 'inactive' | 'background' | 'active';
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,6 +17,12 @@ 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
+
20
26
  /**
21
27
  * ProgressBarAndroid has been extracted from react-native core and will be removed in a future release.
22
28
  * It can now be installed and imported from `@react-native-community/progress-bar-android` instead of 'react-native'.
@@ -27,7 +33,7 @@ let ProgressBarAndroid: component(
27
33
  ref?: React.RefSetter<
28
34
  React.ElementRef<ProgressBarAndroidNativeComponentType>,
29
35
  >,
30
- ...props: ProgressBarAndroidProps
36
+ ...props: Omit<ProgressBarAndroidProps, empty>
31
37
  );
32
38
 
33
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 ProgressBarAndroidStyleAttrProp =
21
- | {
22
- styleAttr: 'Horizontal',
23
- indeterminate: false,
24
- progress: number,
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
- export type ProgressBarAndroidProps = $ReadOnly<{
39
- ...ViewProps,
40
- ...ProgressBarAndroidStyleAttrProp,
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
+ }>;
@@ -17,5 +17,5 @@ export const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 80,
19
19
  patch: 0,
20
- prerelease: 'rc.1',
20
+ prerelease: 'rc.2',
21
21
  };
@@ -52,7 +52,7 @@ export default class NativeEventEmitter<
52
52
  {
53
53
  _nativeModule: ?NativeModule;
54
54
 
55
- constructor(nativeModule: ?NativeModule) {
55
+ constructor(nativeModule?: ?NativeModule) {
56
56
  if (Platform.OS === 'ios') {
57
57
  invariant(
58
58
  nativeModule != null,
@@ -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>(obj: S) => $ReadOnly<S>;
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?: string,
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?: string,
1019
+ overlayColor?: ColorValue,
1018
1020
  }>;
1019
1021
 
1020
1022
  export type ____DangerouslyImpreciseStyle_Internal = $ReadOnly<{
@@ -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
  }>;
@@ -10,7 +10,7 @@
10
10
 
11
11
  // From @react-native/js-polyfills
12
12
  type ErrorHandler = (error: mixed, isFatal: boolean) => void;
13
- type Fn<Args, Return> = (...Args) => Return;
13
+ type Fn<Args: $ReadOnlyArray<mixed>, Return> = (...Args) => Return;
14
14
  export type ErrorUtils = {
15
15
  applyWithGuard<TArgs: $ReadOnlyArray<mixed>, TOut>(
16
16
  fun: Fn<TArgs, TOut>,
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(80),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.1",
27
+ RCTVersionPrerelease: @"rc.2",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -170,10 +170,24 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
170
170
 
171
171
  - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
172
172
  {
173
- [_viewsToBeMounted addObject:@{
174
- kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
175
- kRCTLegacyInteropChildComponentKey : childComponentView
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 final class com/facebook/react/devsupport/DevServerHelper {
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 final fun getDevServerBundleURL (Ljava/lang/String;)Ljava/lang/String;
2019
- public final fun getDevServerSplitBundleURL (Ljava/lang/String;)Ljava/lang/String;
2020
- public final fun getSourceMapUrl (Ljava/lang/String;)Ljava/lang/String;
2021
- public final fun getSourceUrl (Ljava/lang/String;)Ljava/lang/String;
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 final fun isPackagerRunning (Lcom/facebook/react/devsupport/interfaces/PackagerStatusCallback;)V
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 final fun removeView (Landroid/view/ViewGroup;Landroid/view/View;)V
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
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.80.0-rc.1
1
+ VERSION_NAME=0.80.0-rc.2
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -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
  /**
@@ -15,6 +15,6 @@ public object ReactNativeVersion {
15
15
  "major" to 0,
16
16
  "minor" to 80,
17
17
  "patch" to 0,
18
- "prerelease" to "rc.1"
18
+ "prerelease" to "rc.2"
19
19
  )
20
20
  }
@@ -462,9 +462,9 @@ public class NativeViewHierarchyOptimizer {
462
462
  return false;
463
463
  }
464
464
 
465
- ReadableMapKeySetIterator keyIterator = props.backingMap.keySetIterator();
465
+ ReadableMapKeySetIterator keyIterator = props.internal_backingMap().keySetIterator();
466
466
  while (keyIterator.hasNextKey()) {
467
- if (!ViewProps.isLayoutOnly(props.backingMap, keyIterator.nextKey())) {
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
- @JvmField internal val backingMap: ReadableMap = props
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
- public fun removeView(parent: T, view: View) {
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.backingMap.getEntryIterator();
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 ?: bottomStart ?: bottomRight ?: uniform)?.let {
146
+ (endEnd ?: bottomEnd ?: bottomRight ?: uniform)?.let {
147
147
  CornerRadii(it, width, height)
148
148
  } ?: zeroRadii,
149
149
  bottomRight =
150
- (startEnd ?: bottomEnd ?: bottomLeft ?: uniform)?.let {
150
+ (startEnd ?: bottomStart ?: bottomLeft ?: uniform)?.let {
151
151
  CornerRadii(it, width, height)
152
152
  } ?: zeroRadii,
153
153
  width = width,
@@ -0,0 +1,30 @@
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
+
8
+ package com.facebook.react.util
9
+
10
+ import android.content.Context
11
+ import android.os.Build
12
+
13
+ /** Helper class for checking Android version-related information. */
14
+ internal object AndroidVersion {
15
+
16
+ /**
17
+ * This is the version code for Android 16 (SDK Level 36). Delete it once we bump up the default
18
+ * compile SDK version to 36.
19
+ */
20
+ private const val VERSION_CODE_BAKLAVA: Int = 36
21
+
22
+ /**
23
+ * This method is used to check if the current device is running Android 16 (SDK Level 36) or
24
+ * higher and the app is targeting Android 16 (SDK Level 36) or higher.
25
+ */
26
+ @JvmStatic
27
+ fun isAtLeastTargetSdk36(context: Context): Boolean =
28
+ Build.VERSION.SDK_INT >= VERSION_CODE_BAKLAVA &&
29
+ context.applicationInfo.targetSdkVersion >= VERSION_CODE_BAKLAVA
30
+ }
@@ -20,11 +20,12 @@ import android.view.MotionEvent
20
20
  import android.view.View
21
21
  import android.view.ViewGroup
22
22
  import android.view.ViewStructure
23
- import android.view.Window
24
23
  import android.view.WindowManager
25
24
  import android.view.accessibility.AccessibilityEvent
26
25
  import android.view.accessibility.AccessibilityNodeInfo
27
26
  import android.widget.FrameLayout
27
+ import androidx.activity.ComponentDialog
28
+ import androidx.activity.OnBackPressedCallback
28
29
  import androidx.annotation.UiThread
29
30
  import androidx.core.view.WindowInsetsCompat
30
31
  import androidx.core.view.WindowInsetsControllerCompat
@@ -49,10 +50,10 @@ import com.facebook.react.uimanager.ThemedReactContext
49
50
  import com.facebook.react.uimanager.UIManagerModule
50
51
  import com.facebook.react.uimanager.events.EventDispatcher
51
52
  import com.facebook.react.views.common.ContextUtils
53
+ import com.facebook.react.views.modal.ReactModalHostView.DialogRootViewGroup
52
54
  import com.facebook.react.views.view.ReactViewGroup
53
55
  import com.facebook.react.views.view.setStatusBarTranslucency
54
56
  import com.facebook.react.views.view.setSystemBarsTranslucency
55
- import java.util.Objects
56
57
 
57
58
  /**
58
59
  * ReactModalHostView is a view that sits in the view hierarchy representing a Modal view.
@@ -71,7 +72,7 @@ public class ReactModalHostView(context: ThemedReactContext) :
71
72
  ViewGroup(context), LifecycleEventListener {
72
73
 
73
74
  @get:VisibleForTesting
74
- public var dialog: Dialog? = null
75
+ public var dialog: ComponentDialog? = null
75
76
  private set
76
77
 
77
78
  public var transparent: Boolean = false
@@ -260,17 +261,34 @@ public class ReactModalHostView(context: ThemedReactContext) :
260
261
  }
261
262
 
262
263
  val currentActivity = getCurrentActivity()
263
- val newDialog = Dialog(currentActivity ?: context, theme)
264
+ val newDialog = ComponentDialog(currentActivity ?: context, theme)
264
265
  dialog = newDialog
265
- Objects.requireNonNull<Window>(newDialog.window)
266
- .setFlags(
267
- WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
268
- WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
266
+ val window = requireNotNull(newDialog.window)
267
+ window.setFlags(
268
+ WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
269
+ WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
269
270
 
270
271
  newDialog.setContentView(contentView)
271
272
  updateProperties()
272
273
 
273
274
  newDialog.setOnShowListener(onShowListener)
275
+
276
+ val handleCloseAction: () -> Unit = {
277
+ val listener =
278
+ checkNotNull(onRequestCloseListener) {
279
+ "onRequestClose callback must be set if back key is expected to close the modal"
280
+ }
281
+ listener.onRequestClose(newDialog)
282
+ }
283
+
284
+ val backPressedCallback: OnBackPressedCallback =
285
+ object : OnBackPressedCallback(true) {
286
+ override fun handleOnBackPressed() {
287
+ handleCloseAction()
288
+ }
289
+ }
290
+
291
+ newDialog.onBackPressedDispatcher.addCallback(newDialog, backPressedCallback)
274
292
  newDialog.setOnKeyListener(
275
293
  object : DialogInterface.OnKeyListener {
276
294
  override fun onKey(dialog: DialogInterface, keyCode: Int, event: KeyEvent): Boolean {
@@ -280,11 +298,7 @@ public class ReactModalHostView(context: ThemedReactContext) :
280
298
  // to whether or not to allow the back/escape key to close the dialog. If it chooses
281
299
  // to, it can just set visible to false on the Modal and the Modal will go away
282
300
  if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE) {
283
- val listener =
284
- checkNotNull(onRequestCloseListener) {
285
- "onRequestClose callback must be set if back key is expected to close the modal"
286
- }
287
- listener.onRequestClose(dialog)
301
+ handleCloseAction()
288
302
  return true
289
303
  } else {
290
304
  // We redirect the rest of the key events to the current activity, since the
@@ -301,19 +315,19 @@ public class ReactModalHostView(context: ThemedReactContext) :
301
315
  }
302
316
  })
303
317
 
304
- newDialog.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
318
+ window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
305
319
  if (hardwareAccelerated) {
306
- newDialog.window?.addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED)
320
+ window.addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED)
307
321
  }
308
322
  val flagSecureSet = isFlagSecureSet(currentActivity)
309
323
  if (flagSecureSet) {
310
- newDialog.window?.setFlags(
324
+ window.setFlags(
311
325
  WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
312
326
  }
313
327
  if (currentActivity?.isFinishing == false) {
314
328
  newDialog.show()
315
329
  updateSystemAppearance()
316
- newDialog.window?.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
330
+ window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
317
331
  }
318
332
  }
319
333
 
@@ -22,7 +22,7 @@ constexpr struct {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 80;
24
24
  int32_t Patch = 0;
25
- std::string_view Prerelease = "rc.1";
25
+ std::string_view Prerelease = "rc.2";
26
26
  } ReactNativeVersion;
27
27
 
28
28
  } // namespace facebook::react
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+
10
+ 'use strict';
11
+
12
+ module.exports = (path, options) => {
13
+ const originalPackageFilter = options.packageFilter;
14
+
15
+ return options.defaultResolver(path, {
16
+ ...options,
17
+ packageFilter: pkg => {
18
+ const filteredPkg = originalPackageFilter
19
+ ? originalPackageFilter(pkg)
20
+ : pkg;
21
+
22
+ // Temporarily allow any react-native subpaths to be resolved and
23
+ // mocked by Jest (backwards compatibility around RFC0894)
24
+ if (filteredPkg.name === 'react-native') {
25
+ delete filteredPkg.exports;
26
+ }
27
+
28
+ return filteredPkg;
29
+ },
30
+ });
31
+ };
package/jest-preset.js CHANGED
@@ -14,6 +14,7 @@ module.exports = {
14
14
  defaultPlatform: 'ios',
15
15
  platforms: ['android', 'ios', 'native'],
16
16
  },
17
+ resolver: require.resolve('./jest/resolver.js'),
17
18
  transform: {
18
19
  '^.+\\.(js|ts|tsx)$': 'babel-jest',
19
20
  '^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': require.resolve(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.80.0-rc.1",
3
+ "version": "0.80.0-rc.2",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -64,6 +64,7 @@
64
64
  "./src/*": null,
65
65
  "./third-party-podspecs/*": null,
66
66
  "./types/*": null,
67
+ "./types_generated/*": null,
67
68
  "./package.json": "./package.json"
68
69
  },
69
70
  "jest-junit": {
@@ -154,13 +155,13 @@
154
155
  },
155
156
  "dependencies": {
156
157
  "@jest/create-cache-key-function": "^29.7.0",
157
- "@react-native/assets-registry": "0.80.0-rc.1",
158
- "@react-native/codegen": "0.80.0-rc.1",
159
- "@react-native/community-cli-plugin": "0.80.0-rc.1",
160
- "@react-native/gradle-plugin": "0.80.0-rc.1",
161
- "@react-native/js-polyfills": "0.80.0-rc.1",
162
- "@react-native/normalize-colors": "0.80.0-rc.1",
163
- "@react-native/virtualized-lists": "0.80.0-rc.1",
158
+ "@react-native/assets-registry": "0.80.0-rc.2",
159
+ "@react-native/codegen": "0.80.0-rc.2",
160
+ "@react-native/community-cli-plugin": "0.80.0-rc.2",
161
+ "@react-native/gradle-plugin": "0.80.0-rc.2",
162
+ "@react-native/js-polyfills": "0.80.0-rc.2",
163
+ "@react-native/normalize-colors": "0.80.0-rc.2",
164
+ "@react-native/virtualized-lists": "0.80.0-rc.2",
164
165
  "abort-controller": "^3.0.0",
165
166
  "anser": "^1.4.9",
166
167
  "ansi-regex": "^5.0.0",
@@ -30,6 +30,8 @@ function generateCustomURLHandlers(libraries, outputDir) {
30
30
  const imageDataDecoderModules = new Set();
31
31
  const urlRequestHandlersModules = new Set();
32
32
 
33
+ const wrapInArrayIfNecessary = value =>
34
+ Array.isArray(value) || value == null ? value : [value];
33
35
  // Old API
34
36
  for (const library of libraries) {
35
37
  const modulesConformingToProtocol =
@@ -38,13 +40,19 @@ function generateCustomURLHandlers(libraries, outputDir) {
38
40
  continue;
39
41
  }
40
42
 
41
- modulesConformingToProtocol.RCTImageURLLoader.forEach(moduleName => {
43
+ wrapInArrayIfNecessary(
44
+ modulesConformingToProtocol.RCTImageURLLoader,
45
+ )?.forEach(moduleName => {
42
46
  imageURLLoaderModules.add(moduleName);
43
47
  });
44
- modulesConformingToProtocol.RCTImageDataDecoder.forEach(moduleName => {
48
+ wrapInArrayIfNecessary(
49
+ modulesConformingToProtocol.RCTImageDataDecoder,
50
+ )?.forEach(moduleName => {
45
51
  imageDataDecoderModules.add(moduleName);
46
52
  });
47
- modulesConformingToProtocol.RCTURLRequestHandler.forEach(moduleName => {
53
+ wrapInArrayIfNecessary(
54
+ modulesConformingToProtocol.RCTURLRequestHandler,
55
+ )?.forEach(moduleName => {
48
56
  urlRequestHandlersModules.add(moduleName);
49
57
  });
50
58
  }
Binary file
Binary file
Binary file
@@ -4,19 +4,26 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @flow strict
8
7
  * @format
9
8
  */
10
9
 
10
+ import type {
11
+ ImageStyle,
12
+ TextStyle,
13
+ ViewStyle,
14
+ } from '../../../Libraries/StyleSheet/StyleSheet';
15
+ import type {StyleProp} from '../../../Libraries/StyleSheet/StyleSheetTypes';
16
+
11
17
  /**
12
18
  * Combines two styles such that `style2` will override any styles in `style1`.
13
19
  * If either style is null or undefined, the other one is returned without
14
20
  * allocating an array, saving allocations and enabling memoization.
15
21
  */
16
- export default function composeStyles<T1, T2>(
17
- style1: ?T1,
18
- style2: ?T2,
19
- ): ?(T1 | T2 | $ReadOnlyArray<T1 | T2>) {
22
+ export default function composeStyles<
23
+ T: ViewStyle | ImageStyle | TextStyle,
24
+ U: T,
25
+ V: T,
26
+ >(style1: ?StyleProp<U>, style2: ?StyleProp<V>): ?StyleProp<T> {
20
27
  if (style1 == null) {
21
28
  return style2;
22
29
  }
@@ -57,6 +57,48 @@ declare global {
57
57
 
58
58
  const HermesInternal: null | {};
59
59
 
60
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly) */
61
+ interface DOMRectReadOnly {
62
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/bottom) */
63
+ readonly bottom: number;
64
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/height) */
65
+ readonly height: number;
66
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/left) */
67
+ readonly left: number;
68
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/right) */
69
+ readonly right: number;
70
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/top) */
71
+ readonly top: number;
72
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/width) */
73
+ readonly width: number;
74
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/x) */
75
+ readonly x: number;
76
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/y) */
77
+ readonly y: number;
78
+ toJSON(): any;
79
+ }
80
+
81
+ interface DOMRect extends DOMRectReadOnly {
82
+ height: number;
83
+ width: number;
84
+ x: number;
85
+ y: number;
86
+ }
87
+
88
+ interface DOMRectInit {
89
+ height?: number | undefined;
90
+ width?: number | undefined;
91
+ x?: number | undefined;
92
+ y?: number | undefined;
93
+ }
94
+
95
+ var DOMRect: {
96
+ prototype: DOMRect;
97
+ new (x?: number, y?: number, width?: number, height?: number): DOMRect;
98
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRect/fromRect_static) */
99
+ fromRect(other?: DOMRectInit): DOMRect;
100
+ };
101
+
60
102
  // #region Timer Functions
61
103
 
62
104
  function clearInterval(handle: number): void;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<3da869fe51112b92862821c8380dd539>>
7
+ * @generated SignedSource<<7ae3445609ede227d692e29af4ddafa2>>
8
8
  *
9
9
  * This file was translated from Flow by scripts/build-types/index.js.
10
10
  * Original file: packages/react-native/Libraries/Animated/AnimatedExports.js.flow
@@ -35,7 +35,7 @@ export type { default as AnimatedDivision } from "./nodes/AnimatedDivision";
35
35
  export type { default as AnimatedModulo } from "./nodes/AnimatedModulo";
36
36
  export type { default as AnimatedMultiplication } from "./nodes/AnimatedMultiplication";
37
37
  export type { default as AnimatedSubtraction } from "./nodes/AnimatedSubtraction";
38
- export type { WithAnimatedValue } from "./createAnimatedComponent";
38
+ export type { WithAnimatedValue, AnimatedProps } from "./createAnimatedComponent";
39
39
  export type { AnimatedComponentType as AnimatedComponent } from "./createAnimatedComponent";
40
40
  /**
41
41
  * Creates a new Animated value composed from two Animated values added
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<5fc014658614c9f000b6ae783b74ec86>>
7
+ * @generated SignedSource<<fbb08335c0ecc21da5a2c9de6337be8c>>
8
8
  *
9
9
  * This file was translated from Flow by scripts/build-types/index.js.
10
10
  * Original file: packages/react-native/Libraries/Animated/nodes/AnimatedProps.js
@@ -16,7 +16,7 @@ import type { AnimatedStyleAllowlist } from "./AnimatedStyle";
16
16
  import AnimatedNode from "./AnimatedNode";
17
17
  export type AnimatedPropsAllowlist = Readonly<{
18
18
  style?: AnimatedStyleAllowlist | undefined;
19
- [$$Key$$: string]: true;
19
+ [key: string]: true | AnimatedStyleAllowlist;
20
20
  }>;
21
21
  type TargetViewInstance = React.ComponentRef<React.ElementType>;
22
22
  declare class AnimatedProps extends AnimatedNode {
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<378c7cb27c255f7a59b71607c022c76e>>
7
+ * @generated SignedSource<<5a862471b9390d8830905ee2b8dcdbdb>>
8
8
  *
9
9
  * This file was translated from Flow by scripts/build-types/index.js.
10
10
  * Original file: packages/react-native/Libraries/AppState/AppState.js
@@ -19,7 +19,7 @@ import { type EventSubscription } from "../vendor/emitter/EventEmitter";
19
19
  * - @platform android - on another Activity (even if it was launched by your app)
20
20
  * @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.
21
21
  */
22
- export type AppStateStatus = "inactive" | "background" | "active";
22
+ export type AppStateStatus = "inactive" | "background" | "active" | "extension" | "unknown";
23
23
  /**
24
24
  * change - This even is received when the app state has changed.
25
25
  * memoryWarning - This event is used in the need of throwing memory warning or releasing it.
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<eaa169b72881d7524c9a9e9b8d5ea943>>
7
+ * @generated SignedSource<<dcb9fe4ce55279385a0a42d98baac3b4>>
8
8
  *
9
9
  * This file was translated from Flow by scripts/build-types/index.js.
10
10
  * Original file: packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js
@@ -15,7 +15,8 @@ import type $$IMPORT_TYPEOF_1$$ from "./ProgressBarAndroidNativeComponent";
15
15
  type ProgressBarAndroidNativeComponentType = typeof $$IMPORT_TYPEOF_1$$;
16
16
  import type { ProgressBarAndroidProps } from "./ProgressBarAndroidTypes";
17
17
  export type { ProgressBarAndroidProps };
18
- declare let ProgressBarAndroid: (props: Omit<ProgressBarAndroidProps, keyof {
18
+ type Omit<T, K> = T extends any ? Pick<T, Exclude<keyof T, K>> : T;
19
+ declare let ProgressBarAndroid: (props: Omit<Omit<ProgressBarAndroidProps, never>, keyof {
19
20
  ref?: React.Ref<React.ComponentRef<ProgressBarAndroidNativeComponentType>>;
20
21
  }> & {
21
22
  ref?: React.Ref<React.ComponentRef<ProgressBarAndroidNativeComponentType>>;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<48f346679fde81902d869bda34035973>>
7
+ * @generated SignedSource<<64474a1a4cec74315af1e305eccd1f06>>
8
8
  *
9
9
  * This file was translated from Flow by scripts/build-types/index.js.
10
10
  * Original file: packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js
@@ -24,41 +24,16 @@ import type { ViewProps } from "../View/ViewPropTypes";
24
24
  * `indeterminate` can only be false if `styleAttr` is Horizontal, and requires a
25
25
  * `progress` value.
26
26
  */
27
- type ProgressBarAndroidStyleAttrProp = {
27
+ type DeterminateProgressBarAndroidStyleAttrProp = {
28
28
  styleAttr: "Horizontal";
29
29
  indeterminate: false;
30
30
  progress: number;
31
- } | {
31
+ };
32
+ type IndeterminateProgressBarAndroidStyleAttrProp = {
32
33
  styleAttr: "Horizontal" | "Normal" | "Small" | "Large" | "Inverse" | "SmallInverse" | "LargeInverse";
33
34
  indeterminate: true;
34
35
  };
35
- export type ProgressBarAndroidProps = Readonly<Omit<ViewProps, keyof ProgressBarAndroidStyleAttrProp | keyof {
36
- /**
37
- * Whether to show the ProgressBar (true, the default) or hide it (false).
38
- */
39
- animating?: boolean | undefined;
40
- /**
41
- * Color of the progress bar.
42
- */
43
- color?: ColorValue | undefined;
44
- /**
45
- * Used to locate this view in end-to-end tests.
46
- */
47
- testID?: string | undefined;
48
- }> & Omit<ProgressBarAndroidStyleAttrProp, keyof {
49
- /**
50
- * Whether to show the ProgressBar (true, the default) or hide it (false).
51
- */
52
- animating?: boolean | undefined;
53
- /**
54
- * Color of the progress bar.
55
- */
56
- color?: ColorValue | undefined;
57
- /**
58
- * Used to locate this view in end-to-end tests.
59
- */
60
- testID?: string | undefined;
61
- }> & {
36
+ type ProgressBarAndroidBaseProps = Readonly<{
62
37
  /**
63
38
  * Whether to show the ProgressBar (true, the default) or hide it (false).
64
39
  */
@@ -72,3 +47,4 @@ export type ProgressBarAndroidProps = Readonly<Omit<ViewProps, keyof ProgressBar
72
47
  */
73
48
  testID?: string | undefined;
74
49
  }>;
50
+ export type ProgressBarAndroidProps = Readonly<Omit<ViewProps, keyof ProgressBarAndroidBaseProps | keyof DeterminateProgressBarAndroidStyleAttrProp | keyof {}> & Omit<ProgressBarAndroidBaseProps, keyof DeterminateProgressBarAndroidStyleAttrProp | keyof {}> & Omit<DeterminateProgressBarAndroidStyleAttrProp, keyof {}> & {}> | Readonly<Omit<ViewProps, keyof ProgressBarAndroidBaseProps | keyof IndeterminateProgressBarAndroidStyleAttrProp | keyof {}> & Omit<ProgressBarAndroidBaseProps, keyof IndeterminateProgressBarAndroidStyleAttrProp | keyof {}> & Omit<IndeterminateProgressBarAndroidStyleAttrProp, keyof {}> & {}>;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<19d6a54fd1c402d56b60cbe5f80329db>>
7
+ * @generated SignedSource<<84337174fd0b984be51e9d76317f61d5>>
8
8
  *
9
9
  * This file was translated from Flow by scripts/build-types/index.js.
10
10
  * Original file: packages/react-native/Libraries/EventEmitter/NativeEventEmitter.js
@@ -33,7 +33,7 @@ type UnsafeObject = Object;
33
33
  * can theoretically listen to `RCTDeviceEventEmitter` (although discouraged).
34
34
  */
35
35
  declare class NativeEventEmitter<TEventToArgsMap extends Readonly<Record<string, ReadonlyArray<UnsafeObject>>> = Readonly<Record<string, ReadonlyArray<UnsafeObject>>>> implements IEventEmitter<TEventToArgsMap> {
36
- constructor(nativeModule: null | undefined | NativeModule);
36
+ constructor(nativeModule?: null | undefined | NativeModule);
37
37
  addListener<TEvent extends keyof TEventToArgsMap>(eventType: TEvent, listener: (...args: TEventToArgsMap[TEvent]) => unknown, context?: unknown): EventSubscription;
38
38
  emit<TEvent extends keyof TEventToArgsMap>(eventType: TEvent, ...args: TEventToArgsMap[TEvent]): void;
39
39
  removeAllListeners<TEvent extends keyof TEventToArgsMap>(eventType?: null | undefined | TEvent): void;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<03d5e2bb9d6d4c641c6e2f3096266a21>>
7
+ * @generated SignedSource<<fabdc2c1c30842e3c26e05dd87efa447>>
8
8
  *
9
9
  * This file was translated from Flow by scripts/build-types/index.js.
10
10
  * Original file: packages/react-native/Libraries/StyleSheet/StyleSheetExports.js.flow
@@ -103,5 +103,5 @@ export declare type setStyleAttributePreprocessor = typeof setStyleAttributePrep
103
103
  /**
104
104
  * An identity function for creating style sheets.
105
105
  */
106
- export declare const create: <S extends ____Styles_Internal>(obj: S) => Readonly<S>;
106
+ export declare const create: <S extends ____Styles_Internal>(obj: S & ____Styles_Internal) => Readonly<S>;
107
107
  export declare type create = typeof create;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<1ffac1f628bd4d35b49ebfd5354cbef6>>
7
+ * @generated SignedSource<<5a60758fe3e45a1ede3edd4ea56800cb>>
8
8
  *
9
9
  * This file was translated from Flow by scripts/build-types/index.js.
10
10
  * Original file: packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js
@@ -14,6 +14,7 @@ import type { WithAnimatedValue } from "../Animated/createAnimatedComponent";
14
14
  import type { ImageResizeMode } from "./../Image/ImageResizeMode";
15
15
  import type { ____DangerouslyImpreciseStyle_InternalOverrides, ____ImageStyle_InternalOverrides, ____ShadowStyle_InternalOverrides, ____TextStyle_InternalOverrides, ____ViewStyle_InternalOverrides } from "./private/_StyleSheetTypesOverrides";
16
16
  import type { ____TransformStyle_Internal } from "./private/_TransformStyle";
17
+ import type { ColorValue } from "./StyleSheet";
17
18
  export type { ____TransformStyle_Internal };
18
19
  export declare type NativeColorValue = symbol & {
19
20
  __NativeColorValue__: string;
@@ -789,24 +790,26 @@ export type ____ImageStyle_InternalCore = Readonly<Omit<____ViewStyle_Internal,
789
790
  resizeMode?: ImageResizeMode;
790
791
  objectFit?: "cover" | "contain" | "fill" | "scale-down" | "none";
791
792
  tintColor?: ____ColorValue_Internal;
792
- overlayColor?: string;
793
+ overlayColor?: ColorValue;
794
+ overflow?: "visible" | "hidden";
793
795
  }> & {
794
796
  resizeMode?: ImageResizeMode;
795
797
  objectFit?: "cover" | "contain" | "fill" | "scale-down" | "none";
796
798
  tintColor?: ____ColorValue_Internal;
797
- overlayColor?: string;
799
+ overlayColor?: ColorValue;
800
+ overflow?: "visible" | "hidden";
798
801
  }>;
799
802
  export type ____ImageStyle_Internal = Readonly<Omit<____ImageStyle_InternalCore, keyof ____ImageStyle_InternalOverrides | keyof {}> & Omit<____ImageStyle_InternalOverrides, keyof {}> & {}>;
800
803
  export type ____DangerouslyImpreciseStyle_InternalCore = Readonly<Omit<____TextStyle_Internal, keyof {
801
804
  resizeMode?: ImageResizeMode;
802
805
  objectFit?: "cover" | "contain" | "fill" | "scale-down" | "none";
803
806
  tintColor?: ____ColorValue_Internal;
804
- overlayColor?: string;
807
+ overlayColor?: ColorValue;
805
808
  }> & {
806
809
  resizeMode?: ImageResizeMode;
807
810
  objectFit?: "cover" | "contain" | "fill" | "scale-down" | "none";
808
811
  tintColor?: ____ColorValue_Internal;
809
- overlayColor?: string;
812
+ overlayColor?: ColorValue;
810
813
  }>;
811
814
  export type ____DangerouslyImpreciseStyle_Internal = Readonly<Omit<____DangerouslyImpreciseStyle_InternalCore, keyof ____DangerouslyImpreciseStyle_InternalOverrides | keyof {}> & Omit<____DangerouslyImpreciseStyle_InternalOverrides, keyof {}> & {}>;
812
815
  export type StyleProp<T> = null | void | T | false | "" | ReadonlyArray<StyleProp<T>>;
@@ -4,13 +4,13 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<1f930175c2dba8c72d6728437586e0a8>>
7
+ * @generated SignedSource<<a52c932a016621f6a318a4327eae6af9>>
8
8
  *
9
9
  * This file was translated from Flow by scripts/build-types/index.js.
10
10
  * Original file: packages/react-native/Libraries/Text/TextProps.js
11
11
  */
12
12
 
13
- import type { AccessibilityActionEvent, AccessibilityActionInfo, AccessibilityRole, AccessibilityState, Role } from "../Components/View/ViewAccessibility";
13
+ import type { AccessibilityActionEvent, AccessibilityProps, Role } from "../Components/View/ViewAccessibility";
14
14
  import type { ColorValue, TextStyleProp } from "../StyleSheet/StyleSheet";
15
15
  import type { GestureResponderEvent, LayoutChangeEvent, PointerEvent, TextLayoutEvent } from "../Types/CoreEventTypes";
16
16
  import * as React from "react";
@@ -87,20 +87,7 @@ export type TextPropsAndroid = {
87
87
  minimumFontScale?: number | undefined;
88
88
  };
89
89
  type TextBaseProps = Readonly<{
90
- /**
91
- * Indicates whether the view is an accessibility element.
92
- *
93
- * See https://reactnative.dev/docs/text#accessible
94
- */
95
- accessible?: boolean | undefined;
96
- accessibilityActions?: ReadonlyArray<AccessibilityActionInfo> | undefined;
97
90
  onAccessibilityAction?: ((event: AccessibilityActionEvent) => unknown) | undefined;
98
- accessibilityHint?: string | undefined;
99
- accessibilityLanguage?: string | undefined;
100
- accessibilityLabel?: string | undefined;
101
- accessibilityRole?: AccessibilityRole | undefined;
102
- accessibilityState?: AccessibilityState | undefined;
103
- "aria-label"?: string | undefined;
104
91
  /**
105
92
  * Whether fonts should scale to respect Text Size accessibility settings.
106
93
  * The default is `true`.
@@ -113,21 +100,6 @@ type TextBaseProps = Readonly<{
113
100
  *
114
101
  */
115
102
  android_hyphenationFrequency?: ("normal" | "none" | "full") | undefined;
116
- /**
117
- * alias for accessibilityState
118
- *
119
- * see https://reactnative.dev/docs/accessibility#accessibilitystate
120
- */
121
- "aria-busy"?: boolean | undefined;
122
- "aria-checked"?: (boolean | undefined) | "mixed";
123
- "aria-disabled"?: boolean | undefined;
124
- "aria-expanded"?: boolean | undefined;
125
- "aria-selected"?: boolean | undefined;
126
- /**
127
- * Represents the nativeID of the associated label text. When the assistive technology focuses on the component with this props, the text is read aloud.
128
- * This prop is listed for cross-platform reasons and has no real effect on Android or iOS.
129
- */
130
- "aria-labelledby"?: string | undefined;
131
103
  children?: React.ReactNode | undefined;
132
104
  /**
133
105
  * When `numberOfLines` is set, this prop defines how text will be
@@ -245,4 +217,4 @@ type TextBaseProps = Readonly<{
245
217
  /**
246
218
  * @see https://reactnative.dev/docs/text#reference
247
219
  */
248
- export type TextProps = Readonly<Omit<PointerEventProps, keyof TextPropsIOS | keyof TextPropsAndroid | keyof TextBaseProps | keyof {}> & Omit<TextPropsIOS, keyof TextPropsAndroid | keyof TextBaseProps | keyof {}> & Omit<TextPropsAndroid, keyof TextBaseProps | keyof {}> & Omit<TextBaseProps, keyof {}> & {}>;
220
+ export type TextProps = Readonly<Omit<PointerEventProps, keyof TextPropsIOS | keyof TextPropsAndroid | keyof TextBaseProps | keyof AccessibilityProps | keyof {}> & Omit<TextPropsIOS, keyof TextPropsAndroid | keyof TextBaseProps | keyof AccessibilityProps | keyof {}> & Omit<TextPropsAndroid, keyof TextBaseProps | keyof AccessibilityProps | keyof {}> & Omit<TextBaseProps, keyof AccessibilityProps | keyof {}> & Omit<AccessibilityProps, keyof {}> & {}>;
@@ -4,14 +4,14 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<d4c1687a2a174b8be934d1b9bd3654a5>>
7
+ * @generated SignedSource<<a4e24b3ec287bfea18af250315acf306>>
8
8
  *
9
9
  * This file was translated from Flow by scripts/build-types/index.js.
10
10
  * Original file: packages/react-native/Libraries/vendor/core/ErrorUtils.js
11
11
  */
12
12
 
13
13
  type ErrorHandler = (error: unknown, isFatal: boolean) => void;
14
- type Fn<Args, Return> = (...$$REST$$: Args) => Return;
14
+ type Fn<Args extends ReadonlyArray<unknown>, Return> = (...$$REST$$: Args) => Return;
15
15
  export type ErrorUtils = {
16
16
  applyWithGuard<TArgs extends ReadonlyArray<unknown>, TOut>(fun: Fn<TArgs, TOut>, context?: unknown, args?: TArgs | undefined, unused_onError?: null, unused_name?: string | undefined): TOut | undefined;
17
17
  applyWithGuardIfNeeded<TArgs extends ReadonlyArray<unknown>, TOut>(fun: Fn<TArgs, TOut>, context?: unknown, args?: TArgs | undefined): TOut | undefined;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<a59144e42c3c810f21c03dc5d8acb5d6>>
7
+ * @generated SignedSource<<d1731a28e9a05aafdabd5a1f850fb49b>>
8
8
  *
9
9
  * This file was translated from Flow by scripts/build-types/index.js.
10
10
  * Original file: packages/react-native/index.js.flow
@@ -42,7 +42,7 @@ export { default as RefreshControl } from "./Libraries/Components/RefreshControl
42
42
  export { default as SafeAreaView } from "./Libraries/Components/SafeAreaView/SafeAreaView";
43
43
  export type { ScrollResponderType, ScrollViewProps, ScrollViewPropsAndroid, ScrollViewPropsIOS } from "./Libraries/Components/ScrollView/ScrollView";
44
44
  export { default as ScrollView } from "./Libraries/Components/ScrollView/ScrollView";
45
- export type { SectionListProps, SectionListRenderItem, SectionListRenderItemInfo } from "./Libraries/Lists/SectionList";
45
+ export type { SectionListProps, SectionListRenderItem, SectionListRenderItemInfo, SectionListData } from "./Libraries/Lists/SectionList";
46
46
  export { default as SectionList } from "./Libraries/Lists/SectionList";
47
47
  export type { StatusBarAnimation, StatusBarProps, StatusBarStyle } from "./Libraries/Components/StatusBar/StatusBar";
48
48
  export { default as StatusBar } from "./Libraries/Components/StatusBar/StatusBar";
@@ -4,16 +4,18 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<974c4c000e87e754b5049e347d9a0f8e>>
7
+ * @generated SignedSource<<7faa3377394c4af89922687d48617d9d>>
8
8
  *
9
9
  * This file was translated from Flow by scripts/build-types/index.js.
10
10
  * Original file: packages/react-native/src/private/styles/composeStyles.js
11
11
  */
12
12
 
13
+ import type { ImageStyle, TextStyle, ViewStyle } from "../../../Libraries/StyleSheet/StyleSheet";
14
+ import type { StyleProp } from "../../../Libraries/StyleSheet/StyleSheetTypes";
13
15
  /**
14
16
  * Combines two styles such that `style2` will override any styles in `style1`.
15
17
  * If either style is null or undefined, the other one is returned without
16
18
  * allocating an array, saving allocations and enabling memoization.
17
19
  */
18
- declare function composeStyles<T1, T2>(style1: null | undefined | T1, style2: null | undefined | T2): null | undefined | (T1 | T2 | ReadonlyArray<T1 | T2>);
20
+ declare function composeStyles<T extends ViewStyle | ImageStyle | TextStyle, U extends T, V extends T>(style1: null | undefined | StyleProp<U>, style2: null | undefined | StyleProp<V>): null | undefined | StyleProp<T>;
19
21
  export default composeStyles;