Граф коммитов

788 Коммитов

Автор SHA1 Сообщение Дата
Nishan 9f3a3e13cc feat: flex gap bindings (#34974)
Summary:
This PR adds React native binding for https://github.com/facebook/yoga/pull/1116

## Changelog

[General] [Added] - Flex gap yoga bindings

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

Pull Request resolved: https://github.com/facebook/react-native/pull/34974

Test Plan:
Run rn tester app and go to view example. You'll find a flex gap example. Example location - `packages/rn-tester/js/examples/View/ViewExample.js`

### Tested on
- [x] iOS Fabric
- [x] iOS non-fabric
- [x] Android Fabric
- [x] Android non-fabric

To test on non-fabric Android, I just switched these booleans. Let me know if there's anything else I might have missed.

<img width="674" alt="Screenshot 2022-10-14 at 3 30 48 AM" src="https://user-images.githubusercontent.com/23293248/195718971-7aee4e7e-dbf0-4452-9d47-7925919c61dc.png">

Reviewed By: mdvacca

Differential Revision: D40527474

Pulled By: NickGerleman

fbshipit-source-id: 81c2c97c76f58fad3bb40fb378aaf8b6ebd30d63
2022-10-20 14:53:32 -07:00
Paige Sun 5745c1df26 Modularlize RCTConstants.h - Move Bridge-only constants into a separate file
Summary:
Changelog: [Internal] Move Bridge-only constants into a separate file

- Move Bridge only constants from RCTBridge.h into  RCTBridgeConstants.h.
- Move shared constants from RCTBridge.h into RCTConstants.h.

This way, new architecture does not need to import RCTBridge.h just for the constants.

Reviewed By: sammy-SC

Differential Revision: D39085713

fbshipit-source-id: 40177cbed72a326b40ec448c98751d1dd3464504
2022-09-08 19:56:22 -07:00
Thuong Tran 163636db75 feat(font-feature): adding stylistics from ss01 to ss20 as new fontVariant values (#34003)
Summary:
Add new fontVariant values: stylistic-one(ss01) -> stylistic-twenty(ss20)

stylistic-three(ss01)
stylistic-two(ss02)
stylistic-three(ss03)
stylistic-four(ss04)
stylistic-five(ss05)
stylistic-six(ss06)
stylistic-seven(ss07)
stylistic-eight(ss08)
stylistic-nine(ss09)
stylistic-ten(ss10)
stylistic-eleven(ss11)
stylistic-twelve(ss12)
stylistic-thirteen(ss13)
stylistic-fourteen(ss14)
stylistic-fifteen(ss15)
stylistic-sixteen(ss16)
stylistic-seventeen(ss17)
stylistic-eighteen(ss18)
stylistic-nineteen(ss19)
stylistic-twenty(ss20)

References:
https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html#Type3
https://docs.microsoft.com/en-us/typography/opentype/spec/featurelist

Example:
`<Text
      style={{
          fontVariant: ['stylistic-three', 'stylistic-five']
        }}>
      Hello World!
    </Text>`

## Changelog

[iOS] [Added] - Add new fontVariant values: stylistic-one(ss01) -> stylistic-twenty(ss20)
[Android] [Added] - Add new fontVariant values: stylistic-one(ss01) -> stylistic-twenty(ss20)

Pull Request resolved: https://github.com/facebook/react-native/pull/34003

Test Plan: ![Screen Shot 2022-06-13 at 16 02 46](https://user-images.githubusercontent.com/62107729/173318839-69da379c-df13-4351-9dfa-4b548664e43d.png)

Reviewed By: cipolleschi

Differential Revision: D37118078

Pulled By: cortinico

fbshipit-source-id: 6a8366638f8181b5db6b2c12c48a5ad65e1e598f
2022-08-17 03:07:09 -07:00
Michael Sokolnicki a67360b0f3 Remove MaskedViewIOS from react-native-github
Summary:
Remove MaskedViewIOS from react-native-github, update deprecation warnings, rebuild CocoaPods.

Changelog:
[General][Removed] - Remove MaskedViewIOS

Reviewed By: lunaleaps

Differential Revision: D37860775

fbshipit-source-id: 963b4b9891eecf5610cfad1e93ac8bf83f29f521
2022-07-22 17:07:26 -07:00
Eric Edouard 8993ffc82e Added border curve style prop ("Squircle" effect - iOS only) (#33783)
Summary:
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
NOTE: PR is based on https://github.com/facebook/react-native/pull/32017 which went stale for quite a long time but can now safely be closed

![](https://preview.redd.it/nuvl4746ys471.png?width=960&crop=smart&auto=webp&s=084a517a645364ac246b70b7fa8e0f2470cc7af3)

Since iOS 13+, it is possible to change the corner curve property on iOS in order to smoothen border radius and make it more "rounded" (also called "squircle")
Here's an [article](https://medium.com/arthurofbabylon/a-smooth-corner-radius-in-ios-54b80aa2d372) explaining in details what it is.
This property is also built in figma, but currently there is no way to implement this directly with react-native despite it being available natively on iOS.

Many open source react-native libraries were created in order to simulate this behaviour:
[react-native-super-ellipse-mask](https://github.com/everdrone/react-native-super-ellipse-mask)
[react-native-squircle-view](https://github.com/everdrone/react-native-squircle-view)
[react-native-figma-squircle](https://github.com/tienphaw/react-native-figma-squircle)

But they rely on creating an SVG shape with the smoothed corners and masking the view behind. This makes it not very performant (flickering on mounting was a common side-effect)

This PR aims at implementing the property natively.

PR for the docs update: https://github.com/facebook/react-native-website/pull/2785

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Added] - Added `borderCurve` style prop for smooth border radius (squircle effect)

Pull Request resolved: https://github.com/facebook/react-native/pull/33783

Test Plan:
We used the RNTester app and added an example with `cornerCurve ` set to `'continuous'` (only on iOS).

As the difference is quite subtle, we also made some more tests to better illustrate the difference (these are not in the RN-tester app):

![IMG_0810](https://user-images.githubusercontent.com/19872411/133893536-26207c53-aade-4583-9eef-7a1739b6907b.PNG)

We overlapped two views with `position: absolute`, the one in the background has a red background and has `cornerRadius` set to `false`, and the one in the foreground is set to `true`. We can clearly see where the borders differs on the corners.

Reviewed By: sammy-SC

Differential Revision: D37883631

Pulled By: cipolleschi

fbshipit-source-id: 09f06de9628fa326323eba63875de30102c4a59e
2022-07-21 04:11:30 -07:00
Ruslan Latypov b66db7a840 fix more imports
Summary:
There are many files across fbobjc relying on -include_pch and therefore they miss Foundation.h and UIKit.h includes. This diff was generated by a codemod and fixes these missing includes.
More details on the missing imports https://fb.workplace.com/groups/929548250966094/permalink/981237982463787/

Changelog: [Internal]

Reviewed By: yannickl

Differential Revision: D37282740

fbshipit-source-id: 0f419025b3cf2f811e96ff464cb19e8e5a25aa09
2022-07-19 12:53:11 -07:00
Paige Sun 674609757b Minor: Rename RCTNotAllowedInAppWideFabric to RCTNotAllowedInFabricWithoutLegacy
Summary:
Changelog: [Internal][iOS] Minor: Rename RCTNotAllowedInAppWideFabric to RCTNotAllowedInFabricWithoutLegacy

`RCTNewArchitectureValidationPlaceholder(RCTNotAllowedInBridgeless` is to track Bridge APIs that are okay in Fabric but not in Bridgeless.

`RCTNewArchitectureValidationPlaceholder(RCTNotAllowedInFabricWithoutLegacy` is to track legacy APIs that should not exist if the app was using Fabric **without any legacy architecture**. e.g. RCTBridgeModule, legacy interop view components.

Reviewed By: fkgozali

Differential Revision: D37659105

fbshipit-source-id: aee4e083820e83a8dac19eb3b5efc49b37d90039
2022-07-08 15:07:55 -07:00
Paige Sun 501e9b3180 Add validation placeholders for legacy components that need migration
Summary:
Changelog: [Internal]

Add `RCTNewArchitectureValidationPlaceholder(RCTNotAllowedInAppWideFabric)` to track RCTViewManagers used in Fabric using the legacy interop layer. They work for now in the interop layer, but they need to be migrated to Fabric to remove potential issues with using the legacy architecture and the new architecture simultaneously. RCTNewArchitectureValidationPlaceholder is a no-op used for tracking unmigrated callsites that may be used often.

`RCTNewArchitectureValidationPlaceholder(RCTNotAllowedInBridgeless` is to track Bridge APIs that are okay in Fabric but not in Bridgeless.

This diff adds the validation placeholder to legacy components registered in [RCTLegacyViewManagerInteropComponentView.mm](743d0706e2/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm (L92-L99)).

Reviewed By: fkgozali

Differential Revision: D37635613

fbshipit-source-id: 5399dad822c8f5c11ef3b32297bf25214fd857dd
2022-07-06 12:56:24 -07:00
Luna Wei 8be49e8746 PointerEvents: Remove '2' suffix
Summary: Changelog: [Internal] - We can now remove the '2' suffix as we had an internal implementation that was not truly aligned with W3C pointers but used the same name. We have aligned the internal types to match w3c so we can now remove the suffix that differentiates them.

Reviewed By: vincentriemer

Differential Revision: D37545813

fbshipit-source-id: 6f2336ae9e314066c340161113268c1f28621a71
2022-07-05 20:00:42 -07:00
Paige Sun 873ff0c13b xplat - Add internal patternline to monitor Bridgless violations
Summary: Changelog: [Interna]

Reviewed By: fkgozali

Differential Revision: D37573895

fbshipit-source-id: 840995c68e84e86260a07a5f771f7019a62e9759
2022-07-01 00:03:37 -07:00
Dusan Klinec 4ea38e16bf fix(build): fixes React-RCTText build with RN 0.69.0 (#34064)
Summary:
Fixes iOS build for React-RCTText with RN 0.69.0, fixes https://github.com/facebook/react-native/issues/33976

PR contains changes from https://github.com/facebook/react-native/issues/33976#issuecomment-1164973209

PoC repo: https://github.com/ph4r05/poc-rn-34064

Related issues:
- https://github.com/expo/expo/issues/16283
- https://github.com/facebook/react-native/issues/33815
- https://github.com/facebook/react-native/issues/33976

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Fixed] - Fix build for React-RCTText

Pull Request resolved: https://github.com/facebook/react-native/pull/34064

Reviewed By: cortinico

Differential Revision: D37420163

Pulled By: cipolleschi

fbshipit-source-id: 68a831bce9f449348d13e040a1ba12726a66667d
2022-06-29 02:36:50 -07:00
Vincent Riemer 21a4c1f6d6 Add dispatch of pointerover/pointerout events
Summary: Changelog: [iOS][Internal] - Add dispatching of pointerover/pointerout events

Reviewed By: lunaleaps

Differential Revision: D36718156

fbshipit-source-id: c2fee2332ac52e617db938e321e3b38fd5c35ad3
2022-06-07 16:08:50 -07:00
Ken Tominaga c73e021a4b Remove iOS 11 deprecation warnings around SafeArea (#32851)
Summary:
We don't have to check or emulate the safe area for iOS 11 above. I deleted the unnecessary check for the safe area.

This is a continuation pull request of these iOS 11 availability check.
* [Remove iOS 11 version check by ken0nek · Pull Request https://github.com/facebook/react-native/issues/32151 · facebook/react-native](https://github.com/facebook/react-native/pull/32151)
* [Remove iOS 11 availability check by ken0nek · Pull Request https://github.com/facebook/react-native/issues/32488 · facebook/react-native](https://github.com/facebook/react-native/pull/32488)

-----

- Stop using layout guide (`topLayoutGuide`, `bottomLayoutGuide`)
- Refactor `RCTSafeAreaView`
- Delete `emulateUnlessSupported` property

Docs PR: https://github.com/facebook/react-native-website/pull/2919

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Removed] - Remove `emulateUnlessSupported`

Pull Request resolved: https://github.com/facebook/react-native/pull/32851

Reviewed By: philIip, sammy-SC

Differential Revision: D33586023

Pulled By: cortinico

fbshipit-source-id: 75fc1037141f71d9340c7b875a6bf86f9cfd6a02
2022-05-16 09:27:43 -07:00
Chaoshuai Lu d70d7fd0b3 Adopt UIGraphicsImageRenderer API
Summary:
Apple suggested to this new API on iOS 10+.

> // Any new bitmap drawing code is encouraged to use UIGraphicsImageRenderer in lieu of this API.

WWDC18 Reference: https://developer.apple.com/videos/play/wwdc2018/219/
> Use UIGraphicsImageRenderer to create and draw to an image buffer
Supports Wide Color, unlike UIGraphicsBeginImageContext()
Combine with UIImageView for efficient offscreen rendering

Per https://nshipster.com/image-resizing/#performance-benchmarks, the new API runs even faster than the C version, probably due to more smart context reuses/management.

Changelog:
[iOS][Changed] - Adopt UIGraphicsImageRenderer API

Reviewed By: philIip

Differential Revision: D35699584

fbshipit-source-id: 7a1e2109d5e121fb396c1014f4ed0a892211b0cc
2022-04-22 17:02:51 -07:00
Vincent Riemer a40747e2d8 Add experimental disclaimers to pointer event APIs
Summary: Changelog: [Internal] - Add experimental disclaimers to pointer event APIs

Reviewed By: lunaleaps, p-sun

Differential Revision: D35682318

fbshipit-source-id: e85a37a2eb9568df636352e170bd42a3bb30a2f6
2022-04-18 15:47:55 -07:00
Vincent Riemer 8e58f685a2 Fix pointer-events crash in catalyst-ios when running RNTester in legacy mode
Summary: Changelog: [Internal] Fix pointer-events setter crash in Paper

Reviewed By: appden

Differential Revision: D35617077

fbshipit-source-id: 975840a2474235a027279035ac327e9eb88d3f08
2022-04-14 10:40:54 -07:00
Vincent Riemer c5cb707ba8 Add basic onPointerEnter/Leave event emitting to iOS
Summary: Changelog: [Internal] Add basic onPointerEnter/Leave event emitting to iOS

Reviewed By: lunaleaps

Differential Revision: D35414116

fbshipit-source-id: dd62cf7736c466e328b9ebbf51bf010610f4bd92
2022-04-11 15:49:30 -07:00
Vincent Riemer 3693928fb8 Add mechanism for iOS native components to expose capturing-only events
Summary: Changelog: [Internal] Add mechanism for iOS native components to expose capturing-only events

Reviewed By: lunaleaps

Differential Revision: D35328883

fbshipit-source-id: 0becb5e26ede3a12a69b0eb41fb15742422f5a4f
2022-04-07 14:07:58 -07:00
Vincent Riemer 179c24e255 Emit touch-equivalent W3C pointer events on iOS
Summary: Changelog: [Internal] Emit touch-equivalent W3C pointer events on iOS

Reviewed By: lunaleaps

Differential Revision: D35295104

fbshipit-source-id: 1c1d5a4159bbfed92df151f7e12a4973ec44e970
2022-04-07 14:07:58 -07:00
Paige Sun 743d0706e2 1/3 Add validation reporting APIs for unexpected uses of Paper when Fabric is enabled, in Bridge mode
Summary:
Changelog: [Internal][iOS] Add validation reporting APIs for unexpected uses of Paper when Fabric is enabled

## RCTNotAllowedInBridgeless
Previously, we only had violation reporting APIs for when **Bridge APIs** are used in **Bridgeless mode**, which was only enabled in Bridgeless mode.

## RCTNotAllowedInFabric
This diff adds violation reporting APIs to use when **pre-Fabric Bridge APIs** are used in **Bridge or Bridgeless mode**. This allows us to add RCTAssert/RCTError/RCTLog to more APIs in Bridge mode. The main purpose is to distinguish between Bridge APIs that still work in Fabric, versus Bridge APIs that are no longer used in Fabric, so that the latter can be removed.

Reviewed By: philIip

Differential Revision: D35015758

fbshipit-source-id: 35366bc5143a59ee9a16d75da4de546ebfe250e6
2022-03-22 20:14:32 -07:00
Diego Pasquali 7b05b091fd Integrated iOS-only `accessibilityLanguage` prop (#33090)
Summary:
This PR fixes https://github.com/facebook/react-native/issues/30891

This PR is going to add an `accessibilityLanguage` prop to all the available components. This props is currently working only on iOS and should follow the [guidelines of the relative configuration](https://developer.apple.com/documentation/objectivec/nsobject/1615192-accessibilitylanguage).

I'm in no way an expert on native programming (especially Objective-C) so I'm open to changes / improvements 🙂

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Added] - Integrated the `accessibilityLanguage` prop to all the available components. The prop is available for any platform but it will work only on iOS.

Pull Request resolved: https://github.com/facebook/react-native/pull/33090

Test Plan:
This has been tested using both the Simulator, checking for the `Language` attribute, and using a physical device with the Voice Over enabled.

<img width="1083" alt="Screenshot 2022-02-11 at 13 17 32" src="https://user-images.githubusercontent.com/5963683/153590415-65fcb4ff-8f31-4a0f-90e5-8eb1aae6aa3d.png">

Reviewed By: philIip

Differential Revision: D34523608

Pulled By: rh389

fbshipit-source-id: b5d77fc0b3d76ea8ed8f30c8385459ba98122ff6
2022-03-07 09:43:30 -08:00
HeyImChris 46f68aceb2 onDismiss to be an RCTDirectEventBlock (#33222)
Summary:
We're seeing a red box that `Component 'RCTModalHostView' re-registered bubbling event 'topDismiss' as a direct event moduleConstantsForComponent` in some downstream react-native-macOS builds.

Looking at other usage of this object, we treat it as a direct event block everywhere else, just this one spot it's a bubbling event block. It was added with [this PR](7bf78eae5e) which doesn't explicitly address the desire for the prop to bubble up through the view hierarchy or not, so I'm guessing it was just mislabeled and should be direct like the other usages.

## Changelog

[iOS] [Bug] - Fix modal redbox for onDismiss

Pull Request resolved: https://github.com/facebook/react-native/pull/33222

Test Plan: We don't redbox downstream anymore

Reviewed By: p-sun, RSNara

Differential Revision: D34628759

Pulled By: philIip

fbshipit-source-id: bb3cc78fa43d20808579c614e25716880d002d88
2022-03-03 18:06:08 -08:00
Paige Sun 260c5fab9f (Easy) Migrate DatePickerIOS for Bridgeless
Summary: Changelog: [iOS][Internal] Migrate DatePickerIOS for Bridgeless mode

Reviewed By: RSNara

Differential Revision: D34595944

fbshipit-source-id: b20050dd5b350c186e4d1062c5d796a26d6aeb3e
2022-03-02 17:42:13 -08:00
Paige Sun 6e03945c7f Use @synthesize viewRegistry_DEPRECATED for Keyframes to remove RCTWeakViewHolder hack
Summary:
Changelog: [iOS][Internal] Use synthesize viewRegistry_DEPRECATED for Keyframes to remove RCTWeakViewHolder

Remove the `RCTWeakViewHolder` hack, since it can be replaced with `viewRegistry_DEPRECATED viewForReactTag`.

Reviewed By: RSNara

Differential Revision: D34468082

fbshipit-source-id: be41ed2df6ee195409724f6069fd99a793dca01a
2022-02-25 13:45:22 -08:00
Danilo Bürger 267d36d0af Updated borderColor view property to UIColor (#33176)
Summary:
In c974cbff04 I changed the borderColor from CGColor to UIColor. I missed this view property which should also be updated to reflect the original change.

## Changelog

[iOS] [Fixed] - Set RCTView borderColor to UIColor

Pull Request resolved: https://github.com/facebook/react-native/pull/33176

Test Plan: Nothing to test. See PR https://github.com/facebook/react-native/pull/29728

Reviewed By: javache

Differential Revision: D34461141

Pulled By: genkikondo

fbshipit-source-id: 51adf39c1cebe8e3b53285961358e4c7f26192db
2022-02-25 08:59:09 -08:00
Paige Sun 3c4850d76b (Easy) Log errors to Logview when Bridge is used in Bridgeless
Summary:
Changelog: [Internal]

# Diff Changes
- Set `RCTEnableNewArchitectureViolationReporting` to YES in app-wide Bridgeless mode.
- Rename `RCTWarnNotAllowedForNewArchitecture` to `RCTErrorNotAllowedForNewArchitecture`, and use `RCTLogError` instead of `RCTLogWarn` so the error goes to Logview.

Reviewed By: RSNara

Differential Revision: D34202682

fbshipit-source-id: 471486c65f7a42f8f11140e61ff60592dc826f61
2022-02-14 19:42:07 -08:00
Phillip Pan 7cece34233 test RCTView with c swizzling example
Summary:
writing a test that has an example of c swizzling in oss. testing this:

https://www.internalfb.com/code/fbsource/[c58818169205f1e0fa816968efdb4c3fac8333e9]/xplat/js/react-native-github/React/Views/RCTView.m?lines=452-454%2C460-468

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D31949237

fbshipit-source-id: f16c98ec1a736f3f2152d1e411b693083519a7b9
2022-02-11 13:46:02 -08:00
Andrei Shikov 980c52de41 Disable view flattening when the view has event handlers on Android
Summary:
The views with touch event props are currently flattened by Fabric core, as we don't take event listeners into account when calculating whether the view should be flattened. This results in a confusing situation when components with touch event listeners (e.g. `<View onTouchStart={() => {}} /> `) or ones using `PanResponder` are either ignored (iOS) or cause a crash (Android).

This change passes touch event props to C++ layer and uses them to calculate whether the view node should be flattened or not. It also refactors events to be kept as a singular bitset with 32 bit (~`uint32_t`).

Changelog: [Changed][General] Avoid flattening nodes with event props

Reviewed By: sammy-SC

Differential Revision: D34005536

fbshipit-source-id: 96255b389a7bfff4aa208a96fd0c173d9edf1512
2022-02-10 06:07:39 -08:00
Danilo Bürger 9a35818797 Use trait collection to resolve border colors (#32492)
Summary:
c974cbff04 changed the border colors to be of UIColor instead of CGColor. This allowed working with dark mode to switch the border colors automatically. However, in certain situation the system can't resolve the current trait collection (see https://stackoverflow.com/a/57177411/2525941). This commit resolves the colors with the current trait collection to ensure the right colors are selected. This matches with the behavior of how the background color is resolved (also in displayLayer:).

## Changelog

[iOS] [Fixed] - Resolve border platform color based on current trait collection

Pull Request resolved: https://github.com/facebook/react-native/pull/32492

Test Plan: Same test plan as https://github.com/facebook/react-native/pull/29728

Reviewed By: sammy-SC

Differential Revision: D33819225

Pulled By: cortinico

fbshipit-source-id: 2f8024be7ee7b32d1852373b47fa1437cc569391
2022-02-07 10:24:47 -08:00
Danilo Bürger 89efa1a0c1 Only find closest font if system font was not found (#32482)
Summary:
Before f951da912d finding a system font used to return early. In order to allow variants, the referenced patch removed the early return so that variants could be applied later. However, there is no need to find the closest font as we already selected the proper system font. This also fixes a bug with setting a custom font handler via RCTSetDefaultFontHandler whos return could get overwritten by the closest font search.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Fixed] - Respect RCTSetDefaultFontHandler chosen font

Pull Request resolved: https://github.com/facebook/react-native/pull/32482

Reviewed By: ShikaSD

Differential Revision: D33844138

Pulled By: cortinico

fbshipit-source-id: 05c01fc358cd19f8be342218cdba944b303073ed
2022-01-28 07:38:39 -08:00
CodemodService FBSourceClangFormatLinterBot 45d196a9e5 Daily `arc lint --take CLANGFORMAT`
Reviewed By: zertosh

Differential Revision: D33762300

fbshipit-source-id: 34957241276cf9cdcdcf175cc73accd837ff7a54
2022-01-25 03:30:00 -08:00
Mattéo Martin e6a3410afe Add allowsEdgeAntialiasing on views with rotations or skew tr… (#32920)
Summary:
…ansforms

On iOS, if a View is rotated with the a transform (e.g. <View style={{transform: {rotationZ: 5}}} />), the view has aliasing  (see screenshot). Same for a skew transformation. We don't have the issue on Android

This behavior had originally being fixed by this PR https://github.com/facebook/react-native/pull/1999

However a new PR was merge ( https://github.com/facebook/react-native/pull/19360 ) that broke this. I think it was made to add antialiasing during perspective transforms but seems to have broken the antialiasing when rotationZ transforms

This PR adds back the antialising during rotation transform , while keeping it during perspective transform.

## Changelog

I changed the allowsEdgeAntialiasing condition, making it "true" when the m12 or m21 is not 0. From this article https://medium.com/swlh/understanding-3d-matrix-transforms-with-pixijs-c76da3f8bd8 , I've understood that in all rotation or skew transformations, m12 or m21 is different than 0 . In the other transformation (e.g. scale or translate) it stays at 0.

Although, I'm not a matrix transformation expert so I may be mistaken

Pull Request resolved: https://github.com/facebook/react-native/pull/32920

Test Plan:
I've written several views with all rotateX/Y/Z , skewX,Y and perpective transformation. Before the PR some transformation was showing aliasing on iOS (e.g. top-left view in the screenshot, don't hesitate to zoom in the image if you don't see it) and with this PR it does not have anymore

Before

![Simulator Screen Shot - iPhone 13 - 2022-01-19 at 10 09 35](https://user-images.githubusercontent.com/6890533/150100149-5370c0fc-ba4f-499f-8e41-a40a10b466a9.png)

After
![Simulator Screen Shot - iPhone 13 - 2022-01-19 at 10 10 39](https://user-images.githubusercontent.com/6890533/150100229-1bb5077f-d6bb-48a2-b852-acf726fcb59e.png)

Code I used to test

```
const commonStyle = {
  width: 150,
  height: 100,
  backgroundColor: "red",
  margin: 10,
}

const Test = () => (
  <View style={{ flexDirection: "row" }}>
    <View>
      <View
        style={[
          commonStyle,
          {
            transform: [{ rotateZ: "4deg" }],
          },
        ]}
      />

      <View
        style={[
          commonStyle,
          {
            transform: [{ rotateX: "30deg" }],
          },
        ]}
      />

      <View
        style={[
          commonStyle,
          {
            transform: [{ rotateY: "30deg" }],
          },
        ]}
      />
      <View
        style={[
          commonStyle,
          {
            transform: [{ rotateX: "30deg" }, { rotateY: "30deg" }, { rotateZ: "3deg" }],
          },
        ]}
      />
    </View>

    <View>
      <View
        style={[
          commonStyle,
          {
            transform: [{ skewX: "4deg" }],
          },
        ]}
      />

      <View
        style={[
          commonStyle,
          {
            transform: [{ skewY: "4deg" }],
          },
        ]}
      />

      <View
        style={[
          commonStyle,
          {
            transform: [{ skewY: "4deg" }, { rotateZ: "3deg" }],
          },
        ]}
      />

      <View
        style={[
          commonStyle,
          {
            transform: [{ perspective: 1000 }],
          },
        ]}
      />
    </View>
  </View>
)
```

Reviewed By: lunaleaps

Differential Revision: D33665910

Pulled By: sshic

fbshipit-source-id: 91163ec2a0897a73ddf0310d86afacea04b89bc7
2022-01-24 07:21:57 -08:00
Ramanpreet Nara 6b42bcc1f4 Fix NVC for RCTModalHostView
Summary:
## iOS Failure
```
 LOG  SVC RCTModalHostView Invalid
 LOG  {
  "missing": {},
  "unexpected": {
    "validAttributes": {
      "statusBarTranslucent": true,
      "hardwareAccelerated": true,
      "animated": true
    }
  },
  "unequal": {}
}
```

Reviewed By: sshic

Differential Revision: D33409398

fbshipit-source-id: 4651878207d0dca1a559fef2191f7538217c093a
2022-01-14 16:31:50 -08:00
Ramanpreet Nara 28f5abc717 Fix NVC for RCTSlider
Summary:
## Android Failures
```
LOG  SVC RCTSlider Invalid
 LOG  {
  "missing": {
    "directEventTypes": {
      "topSlidingComplete": {
        "registrationName": "onSlidingComplete"
      }
    }
  },
  "unexpected": {
    "bubblingEventTypes": {
      "paperValueChange": {
        "phasedRegistrationNames": {
          "captured": "onValueChangeCapture",
          "bubbled": "onValueChange"
        }
      },
      "topValueChange": {
        "phasedRegistrationNames": {
          "captured": "onValueChangeCapture",
          "bubbled": "onValueChange"
        }
      }
    },
    "directEventTypes": {
      "paperSlidingComplete": {
        "registrationName": "onSlidingComplete"
      }
    },
    "validAttributes": {
      "disabled": true,
      "maximumTrackImage": {
        "process": "[Function resolveAssetSource]"
      },
      "minimumTrackImage": {
        "process": "[Function resolveAssetSource]"
      },
      "thumbImage": {
        "process": "[Function resolveAssetSource]"
      },
      "trackImage": {
        "process": "[Function resolveAssetSource]"
      }
    }
  },
  "unequal": {}
}
```

## iOS Failures
```
 LOG  SVC RCTSlider Invalid
 LOG  {
  "missing": {},
  "unexpected": {
    "bubblingEventTypes": {
      "paperValueChange": {
        "phasedRegistrationNames": {
          "captured": "onValueChangeCapture",
          "bubbled": "onValueChange"
        }
      }
    },
    "directEventTypes": {
      "paperSlidingComplete": {
        "registrationName": "onSlidingComplete"
      }
    },
    "validAttributes": {
      "enabled": true
    }
  },
  "unequal": []
}
```

Reviewed By: yungsters

Differential Revision: D33409401

fbshipit-source-id: 519b6e35246e6671dbea1f374435d92937d96c1d
2022-01-14 16:31:50 -08:00
Ramanpreet Nara ca5aaa7663 Remove {eventName}: true from ViewConfig validAttributes
Summary:
For every direct and bubbling event, RCTComponentData (iOS-only) creates a {eventName}: true entry in the component's ViewConfig validAttributes. This entry is unnecessary, and creates a discrepancy between ViewConfigs on iOS vs Android.

This diff removes this entry for all events to:
1. Reduce bloat in native ViewConfigs
2. Create consistency betweeen Android and iOS.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D33303950

fbshipit-source-id: 870c8a2a6d41156ac89bd8554eb09f292bb6108e
2022-01-06 19:09:53 -08:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Marc Rousavy 49a1460a37 Feature: ScrollView `automaticallyAdjustKeyboardInsets` (#31402)
Summary:
Retrying D30015799 (6e903b07fa) with a fix where ScrollViewNativeComponent was missing the automaticallyAdjustKeyboardInsets prop.
----- Original Summary
Currently, ScrollViews provide the prop `keyboardDismissMode` which lets you choose `"interactive"`. However when the keyboard is shown, it will be rendered above the ScrollView, potentially blocking content.

With the `automaticallyAdjustKeyboardInsets` prop the ScrollView will automatically adjust it's `contentInset`, `scrollIndicatorInsets` and `contentOffset` (scroll Y) props to push the content up so nothing gets blocked.

* The animation curve and duration of the Keyboard is exactly matched.
* The absolute position of the ScrollView is respected, so if the Keyboard only overlaps 10 pixels of the ScrollView, it will only get inset by 10 pixels.
* By respecting the absolute position on screen, this automatically makes it fully compatible with phones with notches (custom safe areas)
* By using the keyboard frame, this also works for different sized keyboards and even `<InputAccessoryView>`s
* This also supports `maintainVisibleContentPosition` and `autoscrollToTopThreshold`.
* I also fixed an issue with the `maintainVisibleContentPosition` (`autoscrollToTopThreshold`) prop(s), so they behave more reliably when `contentInset`s are applied. (This makes automatically scrolling to new items fully compatible with `automaticallyAdjustKeyboardInsets`)

## Changelog

* [iOS] [Added] - ScrollView: `automaticallyAdjustKeyboardInsets` prop: Automatically animate `contentInset`, `scrollIndicatorInsets` and `contentOffset` (scroll Y) to avoid the Keyboard. (respecting absolute position on screen and safe-areas)
* [iOS] [Fixed] - ScrollView: Respect `contentInset` when animating new items with `autoscrollToTopThreshold`, make `automaticallyAdjustKeyboardInsets` work with `autoscrollToTopThreshold` (includes vertical, vertical-inverted, horizontal and horizontal-inverted ScrollViews)

Pull Request resolved: https://github.com/facebook/react-native/pull/31402

Test Plan:
<table>
<tr>
<th>Before</th>
<th>After</th>
</tr>
<tr>
<td>

https://user-images.githubusercontent.com/15199031/115708680-9700aa80-a370-11eb-8016-e75d81a92cd7.MP4

</td>

<td>

https://user-images.githubusercontent.com/15199031/115708699-9b2cc800-a370-11eb-976f-c4010cd96d55.MP4

</td>
</table>

### "Why not just use `<KeyboardAvoidingView>`?"

<table>
<tr>
<th>Before (with <code>&lt;KeyboardAvoidingView&gt;</code>)</th>
<th>After (with <code>automaticallyAdjustKeyboardInsets</code>)</th>
</tr>
<tr>
<td>

https://user-images.githubusercontent.com/15199031/115708749-abdd3e00-a370-11eb-8e09-a27ffaef12b8.MP4

</td>

<td>

https://user-images.githubusercontent.com/15199031/115708777-b3044c00-a370-11eb-9b7a-e040ccb3ef8c.MP4

</td>
</table>

> Also notice how the `<KeyboardAvoidingView>` does not match the animation curve of the Keyboard

### Usage

```jsx
export const ChatPage = ({
  flatListProps,
  textInputProps
}: Props): React.ReactElement => (
  <>
    <FlatList
      {...flatListProps}
      keyboardDismissMode="interactive"
      automaticallyAdjustContentInsets={false}
      contentInsetAdjustmentBehavior="never"
      maintainVisibleContentPosition={{ minIndexForVisible: 0, autoscrollToTopThreshold: 100 }}
      automaticallyAdjustKeyboardInsets={true}
    />
    <InputAccessoryView backgroundColor={colors.white}>
      <ChatInput {...textInputProps} />
    </InputAccessoryView>
  </>
);
```

## Related Issues

* Fixes https://github.com/facebook/react-native/issues/31394
* Fixes https://github.com/facebook/react-native/issues/13073

Reviewed By: yungsters

Differential Revision: D32578661

Pulled By: sota000

fbshipit-source-id: 45985e2844275fe96304eccfd1901907dc4f9279
2021-12-06 13:31:13 -08:00
Phillip Pan f10741a946 replace contentInsetsForView: with RCTContentInsets()
Summary:
as title

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D31949240

fbshipit-source-id: 2660a4b44fd2aad5cda52ec61e741e7b4e9eb442
2021-11-10 13:56:52 -08:00
Phillip Pan 83fab36b93 clean up unneeded imports in RCTView
Summary:
just cleaning up some unused stuff

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D31949239

fbshipit-source-id: f6542a01a879cd9ee10903d99de32e6537aa573b
2021-11-10 12:01:07 -08:00
Phillip Pan 9fc3fc83ac introduce RCTViewUtils
Summary:
Changelog: [Internal]

in this diff, i convert the following method to a C function.
https://www.internalfb.com/code/fbsource/[c58818169205f1e0fa816968efdb4c3fac8333e9]/xplat/js/react-native-github/React/Views/RCTView.h?lines=43

besides for testing demonstration purposes later in the stack, C functions are a superior choice to static class methods because they incur less binary size cost (see section 4.3 of https://swolchok.github.io/objcperf/ if you're curious, and https://fb.workplace.com/groups/aexpixfn/posts/1909150855887748 for the impact of a conversion)

Reviewed By: RSNara

Differential Revision: D31949241

fbshipit-source-id: dd40871d48f1de168d360168c4dd60015145d7e3
2021-11-09 20:42:13 -08:00
Ken Tominaga 9b059b6709 Remove iOS 11 availability check (#32488)
Summary:
This pull request aims to remove iOS 11 availability check which is no longer needed.

The minimum iOS deployment target for React Native is iOS 11 but we still have iOS 11 version check like below.

```
if (available(iOS 11.0, *)) {
```

This is a continuation pull request of https://github.com/facebook/react-native/pull/32151

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Changed] - Remove iOS 11 availability check

Pull Request resolved: https://github.com/facebook/react-native/pull/32488

Reviewed By: yungsters

Differential Revision: D32006312

Pulled By: ryancat

fbshipit-source-id: 0ee6579e433a15d3d220a52d2ccd6931b0513971
2021-11-03 09:06:06 -07:00
Phillip Pan def7dd857d use new instead of alloc init
Summary:
i saw this a lot in the codebase, it's not optimal bc we're using two selectors when we only need one.

  fastmod --extensions m,mm '\[\[(.*) alloc] init]' '[${1} new]' --dir xplat/js/react-native-github/*

i manually updated the callsites that this codemod couldn't handle (e.g., where there were more than one of these instances in a single line)

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D31776561

fbshipit-source-id: 1b16da240e8a79b54da67383d548921b82b05a9f
2021-10-20 22:18:38 -07:00
Sota Ogo 8595f3f22c Back out "Feature: ScrollView `automaticallyAdjustKeyboardInsets`"
Summary:
Original commit changeset: 9ccfb4b6d477 / D30015799 (6e903b07fa)

The diff caused a redbox/error in some products. Reverting now and will try it again.

Changelog: Backing out PR: 31402

Differential Revision: D31238961

fbshipit-source-id: b2ccd3d3ab9d7e764e41fb54d8a7e60882d1405f
2021-09-28 14:05:00 -07:00
Marc Rousavy 6e903b07fa Feature: ScrollView `automaticallyAdjustKeyboardInsets` (#31402)
Summary:
Currently, ScrollViews provide the prop `keyboardDismissMode` which lets you choose `"interactive"`. However when the keyboard is shown, it will be rendered above the ScrollView, potentially blocking content.

With the `automaticallyAdjustKeyboardInsets` prop the ScrollView will automatically adjust it's `contentInset`, `scrollIndicatorInsets` and `contentOffset` (scroll Y) props to push the content up so nothing gets blocked.

* The animation curve and duration of the Keyboard is exactly matched.
* The absolute position of the ScrollView is respected, so if the Keyboard only overlaps 10 pixels of the ScrollView, it will only get inset by 10 pixels.
* By respecting the absolute position on screen, this automatically makes it fully compatible with phones with notches (custom safe areas)
* By using the keyboard frame, this also works for different sized keyboards and even `<InputAccessoryView>`s
* This also supports `maintainVisibleContentPosition` and `autoscrollToTopThreshold`.
* I also fixed an issue with the `maintainVisibleContentPosition` (`autoscrollToTopThreshold`) prop(s), so they behave more reliably when `contentInset`s are applied. (This makes automatically scrolling to new items fully compatible with `automaticallyAdjustKeyboardInsets`)

## Changelog

* [iOS] [Added] - ScrollView: `automaticallyAdjustKeyboardInsets` prop: Automatically animate `contentInset`, `scrollIndicatorInsets` and `contentOffset` (scroll Y) to avoid the Keyboard. (respecting absolute position on screen and safe-areas)
* [iOS] [Fixed] - ScrollView: Respect `contentInset` when animating new items with `autoscrollToTopThreshold`, make `automaticallyAdjustKeyboardInsets` work with `autoscrollToTopThreshold` (includes vertical, vertical-inverted, horizontal and horizontal-inverted ScrollViews)

Pull Request resolved: https://github.com/facebook/react-native/pull/31402

Test Plan:
<table>
<tr>
<th>Before</th>
<th>After</th>
</tr>
<tr>
<td>

https://user-images.githubusercontent.com/15199031/115708680-9700aa80-a370-11eb-8016-e75d81a92cd7.MP4

</td>

<td>

https://user-images.githubusercontent.com/15199031/115708699-9b2cc800-a370-11eb-976f-c4010cd96d55.MP4

</td>
</table>

### "Why not just use `<KeyboardAvoidingView>`?"

<table>
<tr>
<th>Before (with <code>&lt;KeyboardAvoidingView&gt;</code>)</th>
<th>After (with <code>automaticallyAdjustKeyboardInsets</code>)</th>
</tr>
<tr>
<td>

https://user-images.githubusercontent.com/15199031/115708749-abdd3e00-a370-11eb-8e09-a27ffaef12b8.MP4

</td>

<td>

https://user-images.githubusercontent.com/15199031/115708777-b3044c00-a370-11eb-9b7a-e040ccb3ef8c.MP4

</td>
</table>

> Also notice how the `<KeyboardAvoidingView>` does not match the animation curve of the Keyboard

### Usage

```jsx
export const ChatPage = ({
  flatListProps,
  textInputProps
}: Props): React.ReactElement => (
  <>
    <FlatList
      {...flatListProps}
      keyboardDismissMode="interactive"
      automaticallyAdjustContentInsets={false}
      contentInsetAdjustmentBehavior="never"
      maintainVisibleContentPosition={{ minIndexForVisible: 0, autoscrollToTopThreshold: 100 }}
      automaticallyAdjustKeyboardInsets={true}
    />
    <InputAccessoryView backgroundColor={colors.white}>
      <ChatInput {...textInputProps} />
    </InputAccessoryView>
  </>
);
```

## Related Issues

* Fixes https://github.com/facebook/react-native/issues/31394
* Fixes https://github.com/facebook/react-native/issues/13073

Reviewed By: yungsters

Differential Revision: D30015799

Pulled By: sota000

fbshipit-source-id: 9ccfb4b6d477da192a96db4cfa07c31a2d2cefcb
2021-09-24 18:46:00 -07:00
Ken Tominaga 398595e074 Remove iOS 11 version check (#32151)
Summary:
This pull request aims to remove iOS 11 version check which is no longer needed.

The minimum iOS deployment target for React Native is `iOS 11` but we still have iOS 11 version check like below.

```
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
        if (available(iOS 11.0, *)) {
```

> React Native apps may target iOS 11.0 and Android 5.0 (API 21) or newer.

ref: https://github.com/facebook/react-native#-requirements

------

If there is a team motivation to remove the deprecated methods and classes before iOS 10, I can continue the work in this pull request or in the continuing pull requests.

We have deprecated warnings for these in the project.

- `UIUserNotificationSettings`
- `UILocalNotification`
- `topLayoutGuide` and `bottomLayoutGuide`
- `automaticallyAdjustsScrollViewInsets`

## Changelog

[iOS] [Changed] - Remove iOS 11 version check

Pull Request resolved: https://github.com/facebook/react-native/pull/32151

Reviewed By: sammy-SC

Differential Revision: D30877917

Pulled By: yungsters

fbshipit-source-id: d903ea5d557beeb65ef87bfce572e4db3532b3c5
2021-09-22 10:37:09 -07:00
Tim Yung 5683932862 RN: Fix NSInvalidArgumentException for Invalid Font Family Name
Summary:
We observed that in certain production scenarios, `[UIFont fontNamesForFamilyName:familyName]` returns `nil`.

This is problematic because we cannot insert `nil` (which is not an object type) into `NSCache`. Currently, this is causing `NSInvalidArgumentException` to be thrown.

This fix works around the problem by guarding against `nil`.

Changelog:
[iOS][Fixed] - Fix NSInvalidArgumentException for invalid font family names.

Reviewed By: fkgozali

Differential Revision: D31011394

fbshipit-source-id: a9eb9ce69efd832acca65787c665fcbb7b42a795
2021-09-16 23:23:33 -07:00
Adlai Holler 4ac42d88ef Optimize font handling on iOS (#31764)
Summary:
Few issues I saw when profiling RNTester:
- Repeatedly calling `-lowercaseString` during `weightOfFont` causes a TON of extra memory traffic, for no reason.
- `NSCache` is thread-safe, so no need for a mutex.
- Using `stringWithFormat:` for the cache key is slow. Use `NSValue` to store the data directly instead.
- Calling `-fontDescriptor` in `isItalicFont` and `isCondensedFont` is overly expensive and unnecessary.
- `+fontNamesForFamilyName:` is insanely expensive. Wrap it in a cache.

Unscientific test on RNTester iPhone 11 Pro, memory & time. Before:
<img width="1656" alt="Screen Shot 2021-06-23 at 7 40 06 AM" src="https://user-images.githubusercontent.com/2466893/123092882-f4f55100-d3f8-11eb-906f-d25086049a18.png">
<img width="1656" alt="Screen Shot 2021-06-23 at 7 41 30 AM" src="https://user-images.githubusercontent.com/2466893/123092886-f6267e00-d3f8-11eb-89f6-cfd2cae9f7b6.png">

After:
<img width="1455" alt="Screen Shot 2021-06-23 at 9 02 54 AM" src="https://user-images.githubusercontent.com/2466893/123101899-7d2c2400-d402-11eb-97f8-2ee97ee69ec4.png">
<img width="1455" alt="Screen Shot 2021-06-23 at 8 59 44 AM" src="https://user-images.githubusercontent.com/2466893/123101892-7bfaf700-d402-11eb-9a10-def46b37b87f.png">

Changelog:
[iOS][Changed] - Optimized font handling

Pull Request resolved: https://github.com/facebook/react-native/pull/31764

Reviewed By: appden

Differential Revision: D30241725

Pulled By: yungsters

fbshipit-source-id: 342e4f6e5492926acd2afc7d645e6878846369fc
2021-08-26 22:47:41 -07:00
Jimmy Zhang 1a42bd6e97 Add UIAccessibilityTraitUpdatesFrequently to progressBar role
Summary:
Changelog:
Add UIAccessibilityTraitUpdatesFrequently when the AccessibilityRole is set to progressBar. This trait tells the accessibility system where content may change with every percentage point, but without annoying the user with constant announcements.

Reviewed By: ikenwoo

Differential Revision: D30510587

fbshipit-source-id: e75690a2a56ce42476dc999383cf58c0811fcbdf
2021-08-25 05:10:27 -07:00
Jimmy Zhang 11f8d9c7cd Add support for the UIAccessibilityTraitsTabBar
Summary:
Changelog:
Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar

Reviewed By: yungsters

Differential Revision: D30490752

fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3
2021-08-24 02:31:17 -07:00
Nishan Bende c29ec46b0e fix#29319 - ios dismiss modal (#31500)
Summary:
This PR aims to resolve iOS can't dismiss Modal on swipe gesture.
https://github.com/facebook/react-native/issues/29319

When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature
## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Added] - Support for onRequestClose for iOS Modal component.

Pull Request resolved: https://github.com/facebook/react-native/pull/31500

Test Plan:
- If onRequestClose updates the visibility state, modal will be closed.

```
<Modal
    visible={visible}
    animationType="slide"
    presentationStyle="pageSheet"
    onRequestClose={dismiss}>
</Modal>
```

https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov

## Notes
- In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](bb65b9a60d) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know.

<!--

 the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. -->

Reviewed By: p-sun

Differential Revision: D30041625

Pulled By: sammy-SC

fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998
2021-08-16 11:25:57 -07:00