Description
openedon Jun 3, 2024
Background
The Editor Canvas Container is a slot for the Site Editor that was intended to act as an "alternative" editor canvas to render blocks and styles independently of the main canvas container.
It was first added in #45960 and refined in #49973
The important feature, at least for global style revisions, was to have a "separate" editor view that could be edited independently of the main editor canvas. So changes could be made to styles and so on in the alternative canvas view. When it closes, the user is returned to the main editor canvas in whatever state they left it.
The slot is currently used by:
- The Style Book
- Global Styles revisions
What is your proposed solution?
Refactor the way Gutenberg displays these alternative slots.
Options could be:
- move away from slots, and rather use editor context or children props
- create a new editor UI for such alternative editor views, e.g., removing unnecessary controls and views such as the list view, inserter and so on.
See feedback:
There are a lot of unknowns. An approach needs to be confirmed.
What problem does this address?
Since #62146, the Site Editor uses the editor interface from the editor package, which means that the post editor could theoretically fill the Editor Canvas Container is a slot. Currently the only use case for the slot is to house alternative Site Editor views.
Also the way the alternative views are rendered and tracked by is cumbersome and not scalable. Example.
Beyond
The potential is there for Global Styles could be "promoted" to be a top-level entity.
So much like the editor can load a template or a page, it could "load" the site's merged global styles entity with the style book, in conjunction with the global style panel and controls, being the "interface".