-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'insert from url' for image block (#9264)
* Extract isBlobURL into blob package and update usage Co-authored-by: imath <[email protected]> * Add ability to insert an image in image block using a url Co-authored-by: imath <[email protected]> * Position url input underneath upload file buttons and apply margin Co-authored-by: imath <[email protected]> * Refactor styles to avoid use of element selector Co-authored-by: imath <[email protected]> * Ensure form elements have bottom margin to separate them on tiny screens Co-authored-by: imath <[email protected]> * Change type of block used in e2e test to a separator As mentioned in the comment above, this test will not work for blocks that contain an input. The image block now contains a url input field causing the test to fail. Co-authored-by: imath <[email protected]> * Fix invalid reference to this.isBlobURL * Add expandable section for url form on media placeholder * Change icon for media placeholder button to left/right chevron * Update snapshots * Try: expanding url input based on whether text is entered * Try: use link popver for Insert from URL in media placeholder * Implement URLPopover in MediaPlaceholder * Use consistent declaration of defaults for props * Use a generalized selector for buttons in the media placeholder * Improve copy in URL input placeholder * Make behaviour when selecting a differnent url the same as other media blocks * Update snapshot tests * Revert "Change type of block used in e2e test to a separator" This reverts commit 6c8546c. * Use onClose over onClickOutside (onClose implements onClickOutside) * Rename functions * Address code review feedback * Update changelog for blob package * Updated changelog for editor package
- Loading branch information
Showing
17 changed files
with
267 additions
and
99 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { | ||
isBlobURL, | ||
} from '../'; | ||
|
||
describe( 'isBlobURL', () => { | ||
it( 'returns true if the url starts with "blob:"', () => { | ||
expect( isBlobURL( 'blob:thisbitdoesnotmatter' ) ).toBe( true ); | ||
} ); | ||
|
||
it( 'returns false if the url does not start with "blob:"', () => { | ||
expect( isBlobURL( 'https://www.example.com' ) ).toBe( false ); | ||
} ); | ||
|
||
it( 'returns false if the url is not defined', () => { | ||
expect( isBlobURL() ).toBe( false ); | ||
} ); | ||
} ); |
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
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.