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

26614 Коммитов

Автор SHA1 Сообщение Дата
Adam Gleitman 1bf9c1e35c RCTFontScaleRamp -> RCTDynamicTypeRamp 2022-10-03 17:05:04 -07:00
Adam Gleitman ba23e7bab5 Rename files 2022-10-03 16:58:46 -07:00
Adam Gleitman 053ef2c596 Merge branch 'main' into dynamic-text-support 2022-10-03 13:11:00 -07:00
Adam Gleitman c56ccdfa90 Add Dynamic Text support plus test page 2022-09-30 16:23:23 -07:00
chiuam 8c3fcb33d3
Update yaml to add homebrew to PATH (#1441) 2022-09-30 15:49:17 -04:00
Christoph Purrer ab720113d4
Fix resizeMode="cover" when image is resized (#1273)
* Fix resizeMode="cover" when image is resized

Since `RCTResizeModeCover` is implemented manually on macOS (iOS benefits from `UIViewContentModeScaleAspectFill` API), we need to reprocess the image any time the bounds of the view update. The `updateImage:` method was already called on resize, so this instead stores the original image in an ivar so it can call `RCTFillImagePreservingAspectRatio` from `updateImage:` instead.

* Fix rendering template images with tintColor

This fixes a regression introduced by the previous commit, where images would no longer render with the `tintColor` on release builds. We must call `setTemplate:` (using `.template` property is illegal in Objective-C++ since `template` is reserved in C++) on the newly resized image instead of the original image.

Confirmed icons look correct in the release build of Messenger Desktop.

Co-authored-by: Scott Kyle <skyle@fb.com>
2022-09-22 11:35:00 -07:00
Christoph Purrer bb8a035dbb
Workaround to open file handles for loaded assets (#1287)
We ran into an issue that our production app was crashing on certain devices as we opened too many file descriptors (> 256). See some details here: https://wilsonmar.github.io/maximum-limits/

We found that macOS will keep image files handles open for `NSImage` lifetime in some cases:
```
  // this will keep file open only if image is loaded from app bundle
  NSString *path = [[NSBundle mainBundle] pathForResource:@"slider" ofType:@"png" inDirectory:@"assets"];
  _image = [[NSImage alloc] initWithContentsOfFile:path];

  // this will not keep file open
  _image = [[NSImage alloc] initWithContentsOfFile:@"/Users/theUser/Downloads/slider.png"];

  // this will not keep file open
  NSData *data = [NSData dataWithContentsOfFile:path];
  _image = [[NSImage alloc] initWithData:data];
```
This can be documented behavior, but I didn't find any reference in documentation or headers.

Test Plan:
- build and run prod version of app
- explore open files for Messenger process in Activity Monitor
- confirm no assets are open

Co-authored-by: Scott Kyle <skyle@fb.com>
2022-09-22 11:30:52 -07:00
Christoph Purrer d8612d0376
Add option to enforce pasting plain text (#1429)
There are use cases in which we want to ignore the base class [NSTextView readablePasteboardTypes] return values, which mostly, include RTF and formatted URL types
We want to ignore them in favor of plain text (NSPasteboardTypeString).

This change allows to opt into a custom list of supported paste types.

This is a follow-up to https://github.com/microsoft/react-native-macos/pull/1350
2022-09-21 16:42:58 +00:00
Christoph Purrer 377063c627
Adds declarative props to clear/submit MultilineTextInput (#1423)
This brings macOS parity with react-native-windows https://github.com/microsoft/react-native-windows/pull/7333 for MultilineTextInput fields
See react-native-windows PR for desired feature set.

We can't do it for SinglelineTextInput fields (at least not w/o hacks) as it does not support overriding the keyDown event :-(
https://stackoverflow.com/a/6076492

Co-authored-by: Alex Chiu <ackchiu@fb.com>
2022-09-21 00:48:40 -07:00
Adam Gleitman f81497bfe6
Merge pull request #1435 from amgleitman/beachball-2.30.1
Bump beachball to 2.30.1
2022-09-16 14:28:38 -07:00
Adam Gleitman 52639c555d Bump beachball to 2.30.1 2022-09-16 13:37:38 -07:00
Christoph Purrer 1d0e105ab3
Fix insertion point and placeholder placement for TextInput (#1322) 2022-09-15 17:48:16 -04:00
Christoph Purrer c8a7ae6230
Fix rn-tester TextInput warning for missing image.source.uri (#1434)
This fixes an rn-tester only warning introduced in https://github.com/microsoft/react-native-macos/pull/1350/files as the image.source.uri should not be empty
2022-09-13 03:12:44 +00:00
Saad Najmi 8f5b6f6915
Don't install boost twice (#1330)
* add pull yml

* match handleOpenURLNotification event payload with iOS (#755) (#2)

Co-authored-by: Ryan Linton <ryanlntn@gmail.com>

* [pull] master from microsoft:master (#11)

* Deprecated api (#853)

* Remove deprecated/unused context param
* Update a few Mac deprecated APIs

* Packing RN dependencies, hermes and ignoring javadoc failure,  (#852)

* Ignore javadoc failure

* Bringing few more changes from 0.63-stable

* Fixing a patch in engine selection

* Fixing a patch in nuget spec

* Fixing the output directory of nuget pack

* Packaging dependencies in the nuget

* Fix onMouseEnter/onMouseLeave callbacks not firing on Pressable (#855)

* add pull yml

* match handleOpenURLNotification event payload with iOS (#755) (#2)

Co-authored-by: Ryan Linton <ryanlntn@gmail.com>

* fix mouse evetns on pressable

* delete extra yml from this branch

* Add macOS tags

* reorder props to have onMouseEnter/onMouseLeave always be before onPress

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <ryanlntn@gmail.com>

* Grammar fixes. (#856)

Updates simple grammar issues.

Co-authored-by: Nick Trescases <42704557+ntre@users.noreply.github.com>
Co-authored-by: Anandraj <anandrag@microsoft.com>
Co-authored-by: Saad Najmi <saadnajmi2@gmail.com>
Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <ryanlntn@gmail.com>
Co-authored-by: Muhammad Hamza Zaman <mh.zaman.4069@gmail.com>

* remove boost-for-react-native

* remove more

* remove pull

* add back header search path

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <ryanlntn@gmail.com>
Co-authored-by: Nick Trescases <42704557+ntre@users.noreply.github.com>
Co-authored-by: Anandraj <anandrag@microsoft.com>
Co-authored-by: Muhammad Hamza Zaman <mh.zaman.4069@gmail.com>
2022-09-12 09:55:48 -07:00
rasaha91 af4495485b
Merge pull request #1431 from microsoft/revert-1430-publish-main
Revert "Remove branch check on publishing tasks"
2022-09-09 17:01:40 -07:00
rasaha91 d7df0ef7e1
Revert "Remove branch check on publishing tasks" 2022-09-09 16:26:05 -07:00
rasaha91 f4967f3022
Merge pull request #1430 from rasaha91/publish-main
Remove branch check on publishing tasks
2022-09-09 15:55:20 -07:00
Ranesh Saha 588a55fb1a remove branch check on publishing tasks 2022-09-09 15:00:55 -07:00
Adam Gleitman 15d2dbd2f3
Merge pull request #1426 from amgleitman/perfmonitor-devsettings-bridge
Grab RCTPerfMonitor's devSettings from the bridge
2022-09-08 15:01:14 -07:00
Christoph Purrer b0aff93e9f
Add TextInput paste support (#1350)
This adds an `onPaste` event for `MultilineTextInput` that is fired when a pasting into the input, and includes the same `dataTransfer` info as the `onDrop` callback which is discussed here https://github.com/microsoft/react-native-macos/issues/842
This also fixes a typo in the API name

```onPaste``` exists atm only for macOS, but we have the corresponding change to also add it rnw if that is desired
Should we also add a property ```pasteTypes``` similar to drag&drag drag(ged)Types?

Co-authored-by: Scott Kyle <skyle@fb.com>
2022-09-08 21:07:43 +00:00
Adam Gleitman d8dd3fc798 Grab RCTPerfMonitor's devSettings from the bridge 2022-09-08 13:52:34 -07:00
Saad Najmi aa963410b8
Remove redundant podfile targets (#1416) 2022-09-08 11:49:04 -07:00
Christoph Purrer 081d66e4e3
Add MultilineTextInput drag/drop support (#1351)
This allows `MultilineTextInput` to also accept and respond to the same drag and drop props as `View` (and as SingleLineTextInput) which is discussed here https://github.com/microsoft/react-native-macos/issues/842

Co-authored-by: Scott Kyle <skyle@fb.com>
2022-09-08 09:05:04 -07:00
Navneet Kambo 8b8fc61969
Fixing setting focus when RCTView is not yet in window (#1398)
* Fixing setting focus when RCTView is not yet in window

I have a scenario where I send the `focus` command to a component from it's `componentDidMount` lifecycle, which leads native code to try to set focus to a RCTView with a zero frame (okay...) that isn't in a window (also seems unexpected).

I see there's existing code that tries to deal with this for a particular RCTBaseTextInputView, but nothing generically for RCTView. I'm trying to extend that to the RCTView. As part of that, I considered using the existing pending focus flag, but that seems suspect because we could have multiple views competing for focus -- so I am opting to change it to a single, weak ref for the currently *pending* focus view (which we clear if someone else grabs, or attempts to grab focus, or if the pending view later resigns focus, in addition to the scenario already handled viz. pending focus view gets focus).

I have been able to validate these changes against 0.66 for my scenario.

* add diff tags

* add tester app page to demo (and test) focus issue

* update tags to reference new issue

* fix flow + lint

* Fix tags

Co-authored-by: Navneet Kambo <nakambo@nakambo-mm.guest.corp.microsoft.com>
Co-authored-by: Saad Najmi <sanajmi@microsoft.com>
2022-09-07 16:11:53 -07:00
Christoph Purrer e9791d24c7
Fix handling of keyDown/keyUp events by TextInput (#1345)
This extends the ability to intercept `keyDown` and `keyUp` events to `TextInput`.
We need this for the ability to insert newlines when holding shift in chat, along with support arrow up/down from the search input.

Co-authored-by: Scott Kyle <skyle@fb.com>
Co-authored-by: Saad Najmi <sanajmi@microsoft.com>
2022-09-07 13:38:04 -07:00
Christoph Purrer 6876a334b4
Support inverted ScrollView on macOS (#1264)
Allow to render a scrollView's content in inverted order which is especially helpful in messaging applications.

We can't rely on -1 scale hacks on macOS because of inverse issues with trackpad/scrollwheel, dragging scrollbars, tracking hovers, etc.

Hence we added 'native' support for inverted views

Co-authored-by: Scott Kyle <skyle@fb.com>
2022-09-07 13:02:33 -07:00
Saad Najmi 04ff142305
Fix macOS 13 build error 2022-09-01 15:49:46 -07:00
lyzhan7 19a62d9f57
Add shadow inconsistency opacity fix with updated tests (#1402)
* Redo shadow opacity consistency fix

* Update test that was introducing redboxes

* Fix yarn flow-check-ios errors

* Add comment linking to github issue

* Update comment
2022-09-01 10:14:51 -07:00
Saad Najmi 29a1c7db6d
Allow clients to override keyboard focus props on FlatList (#1403)
* Allow client to override keyboard focus props on Flatlist

* typo

* Update flow type
2022-08-31 14:33:19 -07:00
Saad Najmi 235603d588
Update VirtualizedList.js (#1399) 2022-08-31 11:54:17 -07:00
rasaha91 10f4c5a9c8
Merge pull request #1396 from rasaha91/cherry-pick-restore-exclude-so
Merge pull request #1391 from rasaha91/restore-exclude-so
2022-08-29 19:30:16 -07:00
Ranesh Saha 21de264eea rebase patch 2022-08-29 14:39:32 -07:00
rasaha91 85f269f6c2 Merge pull request #1391 from rasaha91/restore-exclude-so
restore exclude so
2022-08-28 16:10:08 -07:00
lyzhan7 7e8402d338
Revert shadow inconsistency opacity fix (#1385) 2022-08-25 21:33:49 +00:00
Saad Najmi 806753a0cd
RNTester: only show the Flatlist keyboard navigation switch on macOS (#1381) 2022-08-25 13:58:58 -07:00
chiuam 0c88572ea8
Don't set accessibilityRole by default in Flatlist (#1382) 2022-08-25 16:12:26 -04:00
Shawn Dempsey aace54cae5
Fix build errors with codegen discovery flag enabled (#1320)
* Revert "Use execFileSync over execSync when messing with file paths in generate-artifacts.js"

This reverts commit d68d2095e9.

* [RN][macos] Don't try and build Fabric example when USE_CODEGEN_DISCOVERY=1

* use `execFileSync` for secure argument passing

* Fix tag comments

* Don't use template literals as arguments

Co-authored-by: Shawn Dempsey <shawndempsey@fb.com>
2022-08-24 22:18:42 -07:00
Saad Najmi 8a4ade21e3
Deprecate onScrollKeyDown, refactor Flatlist selection logic (#1365)
* Deprecate onScrollKeyDown

remove pressable diff

Remove JS handling for PageUp/Down, fix flow errors

Add back "autoscroll to focused view" behavior

remove commented code

remove change to pressable

Update documentation

fix flow error

fix lint issue

Fix 'selectRowAtIndex'

More simplification

lock

* Make method public again

* Add initialSelectedIndex

* macOS tags

* fix lint
2022-08-24 21:53:38 -07:00
Christoph Purrer a4ade0a520
Fix TextInput interfering with Japanese conversion (#1358) 2022-08-24 11:21:06 -04:00
Adam Gleitman 6b42bafdf3
Merge pull request #1344 from amgleitman/prevent-rct18nutil-deadlock
Move `RCTRootShadowView` creation to main thread
2022-08-23 16:40:52 -07:00
Adam Gleitman 4161f9323f
Merge branch 'main' into prevent-rct18nutil-deadlock 2022-08-23 16:09:38 -07:00
chiuam 96be39d8cd
Add scrollbar to multiline TextInput (#1366) 2022-08-23 16:50:55 -04:00
Christoph Purrer 5596c26744
Provide option to not blindly foreground app's lastWindow from deepLinks (#1355)
Messenger Desktop is a multi-window application (chat, calling, settings, …) and we maintain the various windows with a windowNativeModule which allows JS interaction.

When receiving deep-links from other apps we don’t want to necessary re-open the lastWindow open as the deep-link might contain information about a particular scenario (open login page, start a call). Hence, we need to disable this behavior app wide and use our windowNativeModule to forward the specific window related to the deep link.

- This change has 0 effect on other apps
- We could make this property an ivar, but then we need to manually register RCTLinkingManager.mm ….
- We could append a special url property to deep-links, but I think that would make the ‘API’ harder to use`
2022-08-23 10:47:53 -07:00
lyzhan7 a598ee4eff
Merge pull request #1367 from lyzhan7/lyzhan-shadow-rct-custom-view-property
Fix for shadow opacity getting set to 1 when appearance changes
2022-08-22 14:15:04 -07:00
Mike Schreiber 0ef79926b6
Merge pull request #760 from ryanlntn/feat/cursor
Add cursor prop to View and Touchables
2022-08-22 14:04:39 -07:00
Mike Schreiber e6a4b5dde2
Merge branch 'main' into feat/cursor 2022-08-22 11:37:54 -07:00
lyzhan7 27293e80a9 Fix using RCT_REMAP_VIEW_PROPERTY 2022-08-22 10:50:49 -07:00
lyzhan7 2b2bbe28d3 RCTViewManager fix with RCT_CUSTOM_VIEW_PROPERTY 2022-08-19 15:25:32 -07:00
lyzhan7 5ceb5856d7 Try RCT_CUSTOM_VIEW_PROPERTY fix 2022-08-18 15:11:51 -07:00
Adam Gleitman 9f2304937e
Merge pull request #1360 from amgleitman/remove-circleci
Remove .circleci folder
2022-08-12 13:51:50 -07:00