react-native 0.77.0-rc.0 → 0.77.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -106,17 +106,17 @@ export function allowTransformProp(prop: string): void {
106
106
  }
107
107
 
108
108
  export function isSupportedColorStyleProp(prop: string): boolean {
109
- return Object.hasOwn(SUPPORTED_COLOR_STYLES, prop);
109
+ return SUPPORTED_COLOR_STYLES.hasOwnProperty(prop);
110
110
  }
111
111
 
112
112
  export function isSupportedInterpolationParam(param: string): boolean {
113
- return Object.hasOwn(SUPPORTED_INTERPOLATION_PARAMS, param);
113
+ return SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(param);
114
114
  }
115
115
 
116
116
  export function isSupportedStyleProp(prop: string): boolean {
117
- return Object.hasOwn(SUPPORTED_STYLES, prop);
117
+ return SUPPORTED_STYLES.hasOwnProperty(prop);
118
118
  }
119
119
 
120
120
  export function isSupportedTransformProp(prop: string): boolean {
121
- return Object.hasOwn(SUPPORTED_TRANSFORMS, prop);
121
+ return SUPPORTED_TRANSFORMS.hasOwnProperty(prop);
122
122
  }
@@ -37,7 +37,7 @@ function createAnimatedProps(
37
37
  const key = keys[ii];
38
38
  const value = inputProps[key];
39
39
 
40
- if (allowlist == null || Object.hasOwn(allowlist, key)) {
40
+ if (allowlist == null || hasOwn(allowlist, key)) {
41
41
  let node;
42
42
  if (key === 'style') {
43
43
  node = AnimatedStyle.from(value, allowlist?.style);
@@ -271,3 +271,11 @@ export default class AnimatedProps extends AnimatedNode {
271
271
  };
272
272
  }
273
273
  }
274
+
275
+ // Supported versions of JSC do not implement the newer Object.hasOwn. Remove
276
+ // this shim when they do.
277
+ // $FlowIgnore[method-unbinding]
278
+ const _hasOwnProp = Object.prototype.hasOwnProperty;
279
+ const hasOwn: (obj: $ReadOnly<{...}>, prop: string) => boolean =
280
+ // $FlowIgnore[method-unbinding]
281
+ Object.hasOwn ?? ((obj, prop) => _hasOwnProp.call(obj, prop));
@@ -35,7 +35,7 @@ function createAnimatedStyle(
35
35
  const key = keys[ii];
36
36
  const value = inputStyle[key];
37
37
 
38
- if (allowlist == null || Object.hasOwn(allowlist, key)) {
38
+ if (allowlist == null || hasOwn(allowlist, key)) {
39
39
  let node;
40
40
  if (value != null && key === 'transform') {
41
41
  node = ReactNativeFeatureFlags.shouldUseAnimatedObjectForTransform()
@@ -241,3 +241,11 @@ export default class AnimatedStyle extends AnimatedWithChildren {
241
241
  };
242
242
  }
243
243
  }
244
+
245
+ // Supported versions of JSC do not implement the newer Object.hasOwn. Remove
246
+ // this shim when they do.
247
+ // $FlowIgnore[method-unbinding]
248
+ const _hasOwnProp = Object.prototype.hasOwnProperty;
249
+ const hasOwn: (obj: $ReadOnly<{...}>, prop: string) => boolean =
250
+ // $FlowIgnore[method-unbinding]
251
+ Object.hasOwn ?? ((obj, prop) => _hasOwnProp.call(obj, prop));
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 77,
19
19
  patch: 0,
20
- prerelease: 'rc.0',
20
+ prerelease: 'rc.1',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -28,6 +28,15 @@ type FormDataPart =
28
28
  ...
29
29
  };
30
30
 
31
+ /**
32
+ * Encode a FormData filename compliant with RFC 2183
33
+ *
34
+ * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#directives
35
+ */
36
+ function encodeFilename(filename: string): string {
37
+ return encodeURIComponent(filename.replace(/\//g, '_'));
38
+ }
39
+
31
40
  /**
32
41
  * Polyfill for XMLHttpRequest2 FormData API, allowing multipart POST requests
33
42
  * with mixed data (string, native files) to be submitted via XMLHttpRequest.
@@ -82,9 +91,8 @@ class FormData {
82
91
  // content type (cf. web Blob interface.)
83
92
  if (typeof value === 'object' && !Array.isArray(value) && value) {
84
93
  if (typeof value.name === 'string') {
85
- headers['content-disposition'] += `; filename="${
86
- value.name
87
- }"; filename*=utf-8''${encodeURI(value.name)}`;
94
+ headers['content-disposition'] +=
95
+ `; filename="${encodeFilename(value.name)}"`;
88
96
  }
89
97
  if (typeof value.type === 'string') {
90
98
  headers['content-type'] = value.type;
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(77),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.0",
27
+ RCTVersionPrerelease: @"rc.1",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -10,7 +10,7 @@
10
10
  /**
11
11
  * UIView class for root <ModalHostView> component.
12
12
  */
13
- @interface RCTModalHostViewComponentView : RCTViewComponentView
13
+ @interface RCTModalHostViewComponentView : RCTViewComponentView <UIAdaptivePresentationControllerDelegate>
14
14
 
15
15
  /**
16
16
  * Subclasses may override this method and present the modal on different view controller.
@@ -149,6 +149,8 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
149
149
  {
150
150
  BOOL shouldBePresented = !_isPresented && _shouldPresent && self.window;
151
151
  if (shouldBePresented) {
152
+ self.viewController.presentationController.delegate = self;
153
+
152
154
  _isPresented = YES;
153
155
  [self presentViewController:self.viewController
154
156
  animated:_shouldAnimatePresentation
@@ -274,6 +276,16 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
274
276
  [childComponentView removeFromSuperview];
275
277
  }
276
278
 
279
+ #pragma mark - UIAdaptivePresentationControllerDelegate
280
+
281
+ - (void)presentationControllerDidAttemptToDismiss:(UIPresentationController *)controller
282
+ {
283
+ auto eventEmitter = [self modalEventEmitter];
284
+ if (eventEmitter) {
285
+ eventEmitter->onRequestClose({});
286
+ }
287
+ }
288
+
277
289
  @end
278
290
 
279
291
  #ifdef __cplusplus
@@ -426,6 +426,10 @@ public abstract interface class com/facebook/react/ReactRootView$ReactRootViewEv
426
426
  public abstract fun onAttachedToReactInstance (Lcom/facebook/react/ReactRootView;)V
427
427
  }
428
428
 
429
+ public abstract class com/facebook/react/TurboReactPackage : com/facebook/react/BaseReactPackage {
430
+ public fun <init> ()V
431
+ }
432
+
429
433
  public abstract interface class com/facebook/react/ViewManagerOnDemandReactPackage {
430
434
  public abstract fun createViewManager (Lcom/facebook/react/bridge/ReactApplicationContext;Ljava/lang/String;)Lcom/facebook/react/uimanager/ViewManager;
431
435
  public abstract fun getViewManagerNames (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/Collection;
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.77.0-rc.0
1
+ VERSION_NAME=0.77.0-rc.1
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -0,0 +1,13 @@
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
9
+
10
+ @Deprecated(
11
+ message = "Use BaseReactPackage instead",
12
+ replaceWith = ReplaceWith(expression = "BaseReactPackage"))
13
+ public abstract class TurboReactPackage : BaseReactPackage() {}
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 77,
20
20
  "patch", 0,
21
- "prerelease", "rc.0");
21
+ "prerelease", "rc.1");
22
22
  }
@@ -622,11 +622,12 @@ public class ReactViewGroup extends ViewGroup
622
622
  /*package*/ void addViewWithSubviewClippingEnabled(
623
623
  final View child, int index, ViewGroup.LayoutParams params) {
624
624
  Assertions.assertCondition(mRemoveClippedSubviews);
625
- Rect clippingRect = Assertions.assertNotNull(mClippingRect);
626
- View[] childArray = Assertions.assertNotNull(mAllChildren);
627
625
  addInArray(child, index);
626
+
628
627
  // we add view as "clipped" and then run {@link #updateSubviewClipStatus} to conditionally
629
628
  // attach it
629
+ Rect clippingRect = Assertions.assertNotNull(mClippingRect);
630
+ View[] childArray = Assertions.assertNotNull(mAllChildren);
630
631
  int clippedSoFar = 0;
631
632
  for (int i = 0; i < index; i++) {
632
633
  if (isViewClipped(childArray[i])) {
@@ -18,7 +18,7 @@ constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 77;
20
20
  int32_t Patch = 0;
21
- std::string_view Prerelease = "rc.0";
21
+ std::string_view Prerelease = "rc.1";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.77.0-rc.0",
3
+ "version": "0.77.0-rc.1",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -108,13 +108,13 @@
108
108
  },
109
109
  "dependencies": {
110
110
  "@jest/create-cache-key-function": "^29.6.3",
111
- "@react-native/assets-registry": "0.77.0-rc.0",
112
- "@react-native/codegen": "0.77.0-rc.0",
113
- "@react-native/community-cli-plugin": "0.77.0-rc.0",
114
- "@react-native/gradle-plugin": "0.77.0-rc.0",
115
- "@react-native/js-polyfills": "0.77.0-rc.0",
116
- "@react-native/normalize-colors": "0.77.0-rc.0",
117
- "@react-native/virtualized-lists": "0.77.0-rc.0",
111
+ "@react-native/assets-registry": "0.77.0-rc.1",
112
+ "@react-native/codegen": "0.77.0-rc.1",
113
+ "@react-native/community-cli-plugin": "0.77.0-rc.1",
114
+ "@react-native/gradle-plugin": "0.77.0-rc.1",
115
+ "@react-native/js-polyfills": "0.77.0-rc.1",
116
+ "@react-native/normalize-colors": "0.77.0-rc.1",
117
+ "@react-native/virtualized-lists": "0.77.0-rc.1",
118
118
  "abort-controller": "^3.0.0",
119
119
  "anser": "^1.4.9",
120
120
  "ansi-regex": "^5.0.0",
Binary file
Binary file
Binary file
@@ -113,7 +113,7 @@ export function createCompositeKeyForProps(
113
113
  const key = keys[ii];
114
114
  const value = props[key];
115
115
 
116
- if (allowlist == null || Object.hasOwn(allowlist, key)) {
116
+ if (allowlist == null || hasOwn(allowlist, key)) {
117
117
  let compositeKeyComponent;
118
118
  if (key === 'style') {
119
119
  // $FlowFixMe[incompatible-call] - `style` is a valid argument.
@@ -205,7 +205,7 @@ function createCompositeKeyForObject(
205
205
  for (let ii = 0, length = keys.length; ii < length; ii++) {
206
206
  const key = keys[ii];
207
207
 
208
- if (allowlist == null || Object.hasOwn(allowlist, key)) {
208
+ if (allowlist == null || hasOwn(allowlist, key)) {
209
209
  const value = object[key];
210
210
 
211
211
  let compositeKeyComponent;
@@ -250,7 +250,7 @@ export function areCompositeKeysEqual(
250
250
  }
251
251
  for (let ii = 0; ii < length; ii++) {
252
252
  const key = keys[ii];
253
- if (!Object.hasOwn(next, key)) {
253
+ if (!hasOwn(next, key)) {
254
254
  return false;
255
255
  }
256
256
  const prevComponent = prev[key];
@@ -336,7 +336,7 @@ function areCompositeKeyComponentsEqual(
336
336
  for (let ii = 0; ii < length; ii++) {
337
337
  const key = keys[ii];
338
338
  if (
339
- !Object.hasOwn(nullthrows(next), key) ||
339
+ !hasOwn(nullthrows(next), key) ||
340
340
  !areCompositeKeyComponentsEqual(prev[key], next[key])
341
341
  ) {
342
342
  return false;
@@ -346,3 +346,11 @@ function areCompositeKeyComponentsEqual(
346
346
  }
347
347
  return false;
348
348
  }
349
+
350
+ // Supported versions of JSC do not implement the newer Object.hasOwn. Remove
351
+ // this shim when they do.
352
+ // $FlowIgnore[method-unbinding]
353
+ const _hasOwnProp = Object.prototype.hasOwnProperty;
354
+ const hasOwn: (obj: $ReadOnly<{...}>, prop: string) => boolean =
355
+ // $FlowIgnore[method-unbinding]
356
+ Object.hasOwn ?? ((obj, prop) => _hasOwnProp.call(obj, prop));