-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split control for URL and Text within Link UI #33849
Merged
Merged
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
c778a74
Implement basic mechanics and UI
getdave 81f1c69
Grab the selected/link text to use in Link UI
getdave d61170b
Try to update the existing value with the new link and text
getdave 371492d
Retain existing formats when applying new link format
getdave 8d1bd59
Document scenarios for clarity
getdave 7e1b1fb
Only show text control once a link has been committed
getdave 571cb2b
Strip HTML from Link Preview
getdave 1676091
Strip HTML from link text control
getdave 9df74e8
Allow submission of text changes via enter key
getdave f5f5776
Ensure user provided text has length before commiting as label value
getdave 1b98c5a
Migrate to using existing title prop of LinkControl
getdave f49931f
Undo overzealous stripping of HTML. Leave this to escape on output.
getdave 317fc29
No change to text should preserve all formatting
getdave 265f83a
Avoid complications of preserving existing formats when amending link…
getdave e4c604a
Expand boundary seek algorithm in order to fix bugs
getdave dfb2e9a
Abstract walking loops to functions
getdave ba30f1a
Reduce and simplify boundary algorithm
getdave 788f20a
Avoid reassignment of startIndex and prefer self documenting variable
getdave 5357a80
Improve edge case handling and function naming
getdave 4c65aff
Add initial unit tests for Text control
getdave bb61a49
Add tests for more edge cases
getdave 94d5211
Correct text naming
getdave 0a232c6
Don't modify value internally.
getdave 1bada04
Add tests to ensure LinkControl does not modify the value's title pro…
getdave 2c875b0
Have Nav Link block strip HTML formatting before passing to LinkControl
getdave 8cf8915
Avoid passing new function ref for handleSubmit
getdave 2cc7638
Remove outdated reference to `text` prop of value
getdave ed8ac7a
Add guard against empty label
getdave 2b2a8e7
Move utils to utils to expose for testing purposes
getdave 374c44c
Slice target text +1 beyond the end of the format boundary
getdave 57e2103
Add tests for getFormatValue and adjust implementation to get correct…
getdave 75085eb
Augment tests for getFormatBoundary
getdave b1612fd
Fix bug whereby rich text value passed to LinkControl when no active …
getdave 3a3e773
Extract function for retrieving RichTextValue for a given selection
getdave c56b9e0
Add basic e2e tests for link text
getdave 5e5da0b
Add test for preservation of whitespace
getdave 979276a
Add e2e test covering modification of link text via Link UI
getdave 9a94ffa
Ensure focus is reliably placed within Link UI
getdave a761a39
Fix test name typo
getdave d52a063
Standardise test nomenclature on "submit" not "commit"
getdave 91c9d79
Restore avoiding focus on mount to ensure collapsed selection can be …
getdave 87821d4
Improve e2e test code comments to explain creation of a collapsed sel…
getdave 28d111c
Remove duplicate test
getdave ef76e08
Add doc block to getFormatBoundary function
getdave 2a3f25b
Conditionally show the visible URL input label
getdave 773fc9a
Remove magic numbers from submit button positioning
getdave 03df167
Fix overflow bug introduced in earlier commit
getdave 58f8123
Remove stripHTML dependency and hand roll internal method
getdave 3b53454
Re-inline utility function to simplify.
getdave 7e3d9ed
Reduce verbosity of walkToBoundary method
getdave e81ed6e
Add doc block to walkToBoundary
getdave 77a5b99
Refactor to reduce verbosity of getFormatBoundary
getdave 50e65d9
Improve comments and self documentation of e2e test
getdave 5c7582f
Remove unwanted comment
getdave 71a4ace
Rename helper util to disambiguate from text input focus
getdave 00f6296
Refine e2e tests
getdave 7d26660
Rename an annotate unit tests
getdave 77fbb5e
Ensure boundary tests actually exercise code under test
getdave ab7298b
Refactor getFormatBoundary to handle more edge cases and put more of …
getdave ea952d2
Fix to target icon based Edit button
getdave 6bc185b
For currently active links use the full link text as the value of Lin…
getdave e1f0231
Conform to style guide for coercion of Booleans
getdave 1e94414
Fix outdated test helper refs
getdave File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll probably want to hand roll an implementation of this whilst we wait on #35539