feat(cover-block): add support for insert from url #74303
Draft
+236
−2
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.
What?
Closes #10853
This PR adds "Insert from URL" support for the Cover block, allowing users to add image or video backgrounds by directly entering a URL instead of only being able to upload media or select from the Media Library.
Why?
Currently, the Cover block only allows users to add background media through uploading files or selecting from the Media Library. However, users often want to use images or videos hosted externally (e.g., CDN-hosted assets, stock photo URLs, etc.) without having to download and re-upload them.
Other media-related blocks like Image and Video already support "Insert from URL" functionality. This PR brings feature parity to the Cover block.
How?
onSelectURLprop toCoverPlaceholdercomponent, which is passed to the underlyingMediaPlaceholdercomponent to enable the URL input UI.getMediaTypeFromURL()async function inshared.jsthat detects whether a URL points to an image or video:Content-TypeheaderRange: bytes=0-0headerTesting Instructions
Screenshots or screencast