-
Notifications
You must be signed in to change notification settings - Fork 178
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
Web Story Embed block for Gutenberg #1249
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov Report
@@ Coverage Diff @@
## master #1249 +/- ##
=========================================
Coverage 63.78% 63.78%
Complexity 284 284
=========================================
Files 599 599
Lines 9888 9888
=========================================
Hits 6307 6307
Misses 3581 3581 |
Fixed. Max width has been reduced.
Fixed. Poster is now displayed in sidebar.
Fixed. An image with link is now shown in feeds, or just a link if there is no poster.
Seems like a Gutenberg issue? e.g. WordPress/gutenberg#10299
Cannot reproduce this in current version of Gutenberg:
Not really. It's a common issue in Gutenberg. Example: |
I still have issues with selecting the stories block. |
# Conflicts: # package-lock.json
They must have since improved the
Mind checking out the latest version? I tried adding an invisible overlay like Gutenberg does for its own embed blocks. This makes selection a bit better. |
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.
This is great work @swissspidy . I am very happy to approve it!
Summary
This PR adds a new
web-stories/embed
block to be used in Gutenberg. This new block can be used to display stories from the own site and other sites usingamp-story-player
.Relevant Technical Choices
save.js
is still used, as a fallback/cache should be plugin ever be disabled.To-do
Editor
amp-story-player
([AMP-STORY-PLAYER] Feature request : Control the player programmatically ampproject/amphtml#27331?)Suggestion: Implement in follow-up PR.
Suggestion: Implement in follow-up PR.
Frontend
render_callback
Got to URL? Or fullscreen iframe with history update?
Suggestion: Implement in follow-up PR.
Code
WP_Block_Type_Registry::register
notices in testsSuggestion: Implement in follow-up PR.
There are currently unresolved issues with mocking
@wordpress/element
that need to be figured out.Can perhaps use https://jestjs.io/docs/en/jest-object#jestgenmockfrommodulemodulename to mock
@wordpress/element
& co. See also https://github.com/ampproject/amp-wp/blob/1.4/tests/shared/test-utils/wp-element-mock.jsSuggestion: Implement in follow-up PR.
Demo
Click below to expand:
Screenshots
See #1118.