-
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
BlockEditor: Add BlockCanvas component = Iframe + BlockList + WritingFlow #54149
Conversation
Size Change: +83 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
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.
The change looks good I think we can merge it right after resolving the conflict.
It sounds like a good idea. Even knowing how some of these components work, I have a hard time tracing through what does what. |
4205b93
to
1489bb5
Compare
What should be the default "height" of the new BlockCanvas component?
After several considerations, I'm going with the last option as it's the nicest in terms of combination between API and behavior. By default it works but it also allows you to support the "fit container" use case by passing 100% to the prop. We may support the first use-case at some point by passing "auto" but because of the complexity, I think it's not worth addressing for now. |
I marked most of the props of the |
I think we're now ready to merge the initial version of this component (intentionally limited in terms of customization options and props).
@ellatrix you might want to be aware of this, I think we can probably debug that separately though. |
Size Change: +83 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
Related #53874
What and why?
Gutenberg can be used as a platform/framework to build block editors. Mainly thanks to the @wordpress/block-editor package. That said, the experience today is not as straightforward as it can be. There can be a lot of small gotchas and hacks you need to do in order to achieve the desired result. One of these small things is the need to manually render
WritingFlow
,BlockList
and potentiallyIframe
component. this PR proposes the addition of a new component calledBlockCanvas
whose purpose is to bundle all of these into a single component that represents the "canvas" of the editor.Principles:
<BlockCanvas />
should be enough to render the block list and have all the keyboard behaviors setup (writing flow, is typing flag...)EditorStyles
component) using astyles
prop.Todo and open questions:
iframeProps
andcontentRef
props should private to start with. We need to check whether these behaviors can be bundled or replaced with more meaningful props.Testing Instructions
1- E2E tests should pass.