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

26485 Коммитов

Автор SHA1 Сообщение Дата
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
chiuam a019ab9165
Improve VoiceOver accessibility support for Flatlist (#1341) 2022-08-12 11:43:19 -04:00
Julio César Rocha b9fb2dd1a0
Fix BAT line endings (#1142)
Co-authored-by: Saad Najmi <sanajmi@microsoft.com>
2022-08-11 21:56:18 -07:00
Ryan Linton 4eb3cd5585 remove view prop and fix build errors 2022-08-11 19:38:34 -06:00
Adam Gleitman 3e45617371 Remove .circleci folder 2022-08-11 17:51:15 -07:00
lyzhan7 8ed4340a48
Merge pull request #1352 from lyzhan7/lyzhan-shadowconsistency
Fix inconsistent shadows
2022-08-10 18:38:48 -07:00
lyzhan7 5c7a48c039 Fix build break attempt 2022-08-10 17:46:49 -07:00
lyzhan7 14bc46a090 Formatting in response to comments 2022-08-10 17:08:31 -07:00
lyzhan7 0051dac56d Update with shadowOpacity 2022-08-10 16:23:50 -07:00
lyzhan7 5f594b4c23 Copy Liron's fix 2022-08-10 16:23:33 -07:00
Christoph Purrer 2190b3b978
Cache local images into memory (#1279)
This introduces a cache for local image on macOS. There are no predefined limits set here (at least yet) since presumably we are loading a finite number of resources and we have the benefit of virtual memory swap on desktop so we don't really need to sweat a few extra megabytes of in-memory cache for images we know we'll need to repeatedly load.

Local images don't use the shared RN image cache, and on macOS there's no automatic in-memory cache for local resources (other than the OS-level disk cache) so the `RCTImageFromLocalBundleAssetURL` function will synchronously access the disk on the main thread many times over during thread switching in Messenger Desktop.

Added logging to confirmed cache works as expected in rn-tester, and instrumentation also confirms it.

Co-authored-by: Scott Kyle <skyle@fb.com>
2022-08-10 15:09:20 -07:00
Christoph Purrer 4b9ab10e10
Refactor handling of keyDown/keyUp (#1338)
This refactors / simplifies certain keyUp|Down event handling.
It will make a later change (adding textInput handling for textInput fields) easier (to review)

Co-authored-by: Scott Kyle <skyle@fb.com>
2022-08-09 17:45:14 -07:00
Christoph Purrer c3e847a890
Fix Appearance module to observe application appearance (#1340)
This fixes the `Appearance.getColorScheme()` API to return the application-level appearance instead of the last appearance of any root view, which breaks down in multi-window applications.

In Messenger Desktop we always respect the OS appearance for main and setting windows, but force a darkTheme in the calling UI.
W/o this change returning from the calling UI would result in a wrong appearance setting on light theme OS setting

Co-authored-by: Scott Kyle <skyle@fb.com>
2022-08-09 17:34:46 -07:00
Christoph Purrer 24acd4090c
Pass callbacks for when grammarCheck, spellCheck and autoCorrect are changed on Mac [RFC] (#1325)
When users change spellCheck, grammarCheck or autoCorrect in the context menu, one of 3 callbacks for MULTILINE inputs are called:
- toggleGrammarChecking
- toggleContinuousSpellChecking
- toggleAutomaticSpellingCorrection

If JS is going to be the source of truth for text proofing settings, we should have a way to notify JS when these settings are changed from the native side.

Co-authored-by: Alex Chiu <ackchiu@fb.com>
2022-08-09 17:11:54 -07:00
Christoph Purrer 8c5d0eced6
Fix cursor not showing when tabbing into multiline TextInput (#1342)
This bug happens because `RCTUITextView` (which multiline TextInput uses) was overriding NSTextView's `becomeFirstResponder` method and didn't call `[super becomeFirstResponder]`.
This seems to mess with AppKit's logic of drawing the cursor initially.

This is alluded to in the [docs](https://developer.apple.com/documentation/appkit/nstextview/1807130-becomefirstresponder?language=objc#) for `[NSTextView becomeFirstResponder]`:

> If the previous first responder was not a text view on the same layout manager as the receiving text view, this method draws the selection and updates the insertion point if necessary.

Simply switching to call `[super becomeFirstResponder]` led to a cryptic exception within AppKit. This was likely because in the `reactFocus` (and `reactFocusIfNeeded`) we were calling `becomeFirstResponder` directly.
The [docs](https://developer.apple.com/documentation/appkit/nsresponder/1526750-becomefirstresponder?language=objc#) for `[NSResponder becomeFirstResponder]` say:

> Use the NSWindow makeFirstResponder: method, not this method, to make an object the first responder. Never invoke this method directly.

This fixed the issue

Co-authored-by: Liron Yahdav <lyahdav@fb.com>
2022-08-09 16:08:29 -07:00
Christoph Purrer 2b31eb9dec
Add fragmentLinePadding for multiline shadow view to track TextView correctly (#1332)
Shadow views are used to calculate the container's size using NSTextContainer + NSLayoutManager + NSTextStorage according to https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TextLayout/Tasks/StringHeight.html.

However, when typing certain text, the TextView itself overflows, but its container doesn't.
This means our shadow view isn't tracking the TextView correctly.
Root cause was that we added a 1px lineFragmentPadding in https://github.com/microsoft/react-native-macos/pull/640, but we didn't add the save padding in our shadow view.

Test Plan:
- Shrink app to minimum width
- Type some text which overflows

Co-authored-by: Alex Chiu <ackchiu@fb.com>
2022-08-09 15:44:13 -07:00
Christoph Purrer 3ebfa694f3
Fix RCTImageCache on macOS (#1272)
The cache's `totalCostLimit` and the `_cacheStaleTimes` ivar were not getting set for Mac, presumably due to a merge mistake. I'm not sure what (if any) positive impact this will realistically have on memory consumption.

Tested rn-tester scrolling through several threads with lots of images. Everything works well.

Co-authored-by: Scott Kyle <skyle@fb.com>
2022-08-09 15:23:10 -07:00
Ryan Linton 43542f8acb satisfy linter 2022-08-09 15:37:40 -06:00
Liron Yahdav 3205f54d3b Add cursor style to View
Summary: This brings in PR https://github.com/microsoft/react-native-macos/pull/760 to our repo.

Test Plan:
RNTester > View:

{F612877442}

Reviewers: skyle

Reviewed By: skyle

Subscribers: necolas, eliwhite

Differential Revision: https://phabricator.intern.facebook.com/D28158243

Tasks: T78743077

Signature: 28158243:1620330169:72c6c9e2371f2ac1a9edabedf3fd9d68468ccb8c

Remove Cursor for Text Component
2022-08-09 12:07:04 -07:00
Adam Gleitman 0890b47d2b Move `RCTRootShadowView` creation to main thread 2022-08-09 11:52:42 -07:00
Shawn Dempsey ae09ae4adb Merge remote-tracking branch 'microsoft/main' into feat/cursor
# Conflicts:
#	Libraries/Components/Touchable/TouchableBounce.js
#	Libraries/Components/Touchable/TouchableHighlight.js
#	Libraries/Components/Touchable/TouchableOpacity.js
#	Libraries/Components/View/ReactNativeViewViewConfigMacOS.js
#	Libraries/Components/View/ViewPropTypes.js
#	Libraries/StyleSheet/StyleSheetTypes.js
#	React/Views/RCTView.h
#	React/Views/RCTViewManager.m
2022-08-09 11:16:20 -07:00
Saad Najmi 90a371a413
Remove more stale folders/files/changes (#1337)
* Delete more stuff

* Remove some stale looking SDX platform scripts

* Remove remnant of `acceptsKeyboardFocus`

* Add back some missing newlines
2022-08-08 12:22:38 -07:00
Saad Najmi fdcec4d55b
Match package.json dependencies with RN Core + prettier (#1333)
* update package.json files and yarn lock

* yarn prettier --fix

* Fix remaining yarn lint issues

* Fix integration CI
2022-08-05 16:46:51 -07:00
Saad Najmi 9421f1a5d0
Remove stale files and folders from the root of our repo (#1328)
* 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 pull yml

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-08-05 11:16:51 -07:00
Saad Najmi 3b1f575937
Ensure we pass `--frozen-lockfile` (#1329) 2022-08-05 09:14:54 -07:00
Christoph Purrer 0f665ba655
Remove TextInput setting insertionPointColor (#1321) 2022-08-05 09:45:41 -04:00
rasaha91 e960741886
Merge pull request #1323 from rasaha91/cherry-pick-ndk-fixes
Cherry pick ndk fixes
2022-08-04 16:36:45 -07:00
Christoph Purrer e6482e0c24
Revert "Alleviate excessive layout jittering when resizing window (#439)" (#1318)
This change reverts https://github.com/microsoft/react-native-macos/issues/459 - but still tries to address the original issues:
- https://github.com/microsoft/react-native-macos/issues/422
- https://github.com/microsoft/react-native-macos/issues/322

This also addresses an issue when programmatically resizing windows where the RCTRootContentView may end up at the wrong size because an in-flight layout gets resolved after the resize on the main thread.
We now keep sync dispatch on the shadow queue for live resizing windows (to prevent tearing) but also dispatch async (as done on iOS) so the latest new size is sure to win.
The block has a check to bail if the size doesn't change, so this isn't a perf drain running the block twice.

Co-authored-by: Scott Kyle <skyle@fb.com>
2022-08-04 08:35:54 -07:00
rasaha91 c83c522236 Merge pull request #1319 from rasaha91/fix-incorrect-version
set version before build
2022-08-02 19:49:04 -07:00