-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Enhance link control UI with rich URL previews #31464
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
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
057adfc
Add new helper to utilise new REST endpoint
getdave d095a91
Provide docblock
getdave d3b0f24
Provide docblock
getdave 81b2ec2
Get title tag contents from remote URL
getdave 7eb2240
Create distinct data object for rich meta rather than rely on overidi…
getdave 1d0eae8
Add example of adding rich details to the link preview
getdave 50ad09c
Add icon, image and description
getdave 28353a2
Add icon, image and description
getdave dee6d6f
Add in description
getdave fece66f
Remove url data to hook and prevent setting state on unmounted
getdave 47edef2
Avoid ref destructure
getdave e6633aa
Add loading animation
getdave 21fb199
Clear richdata on url change
getdave 5920515
Avoid rich data in search items
getdave 48f9090
Account for preview layout variation requirements
getdave b0d4a33
Only fetch if fetchRemoteUrlData is available
getdave f89d4ab
Fix text overflow ellipsis
getdave 74501fb
Improve icon visual scaling
getdave 5f1688a
Manage fetching as state
getdave 03e4ab6
Add tests for rich data and resolve exposed bugs
getdave 9a108af
Fix broken async/await code and restore test running
getdave b15ad00
Tidy code comments
getdave b4df9d2
Updates to use visually truncated description text
getdave 5b9736b
Clip image height, center and provide border-radius and background
getdave 03bcacd
Apply correct spacing as per design provided
getdave 8189a80
Allow text to flow (almost) to edge of `Edit` button before ellipsis
getdave b3551c6
Constrain image height to 140px as per Figma design
getdave 1516592
Add tests to cover missing data edge cases
getdave 7d91aba
Fix cancel pending fetch when URL changes.
getdave 0acd56c
Remove isMounted anti pattern in favour of explictly cancelled promis…
getdave ba57bb1
Update comments to make reason for cancelling on URL change clearer
getdave cfa5775
Fix broken tests by disabling rich reviews in those tests which do no…
getdave fecdf86
Move make cancelable util into own file
getdave 5030f96
Allow for passing options to fetchRemoteUrlData
getdave 08d3e39
Use AbortController to cancel requests rather than cancellable promis…
getdave 7749b6e
Force remount preview when the URL changes
getdave 1d694c9
Implement simpler hook via abortable fetch
getdave 621119c
Fix to ensure correct handling of aborted vs standard fetch errors
getdave 1bdce6d
Add test to cover resetting fetching state if rich data requests fails
getdave dad3a70
Simplify hook implementation
getdave d726883
Guard for legacy browsers
getdave 429a42a
Refactor to useReducer
getdave 654b0d4
Disable rich previews by default and enable only in inline text by de…
getdave b722bd7
Update packages/editor/src/components/provider/use-block-editor-setti…
getdave b236b71
Update to hasRichPreviews
getdave e450f66
Use correct prop to enable rich previews in rich text
getdave 4e48952
Fix e2e test to allow unlinking when rich data obscures block toolbar
getdave de2824e
Add permenant missing data placeholders with loading animation
getdave 0d55791
Fix tests
getdave ebb9346
Update snapshots
getdave 939f7be
Update doc block
getdave bf22b24
Restore makecancellable to a local util
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 hidden or 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 hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.