Background
In 5) Create a discovery mechanism to associate a block plugin with a React component) we will convert InlineBlock to React. These represent the best way to demonstrate the functionality of the decoupled concept.
We'll need React versions of many of our widgets to allow editing inline blocks in a decoupled fashion.
For some widgets, this will be difficult (e.g. media library and files), but for things like text fields, and select lists, this should be able to leverage the existing library of control components from WordPress.
Proposed resolution
Identify a list of initial widget plugins that make sense to convert to React as an initial proof of concept. Create a React version of these widget plugins using @wordpress/components.
Create a registry component that can translate widget plugin IDs to these components. Allow modules to register a component as a React version of a Drupal widget plugin so the decoupled layout builder knows how to use it to edit an inline block.
Out of scope but for future consideration:
- A React-powered media library widget
Comments
Comment #2
griffynh commentedComment #3
griffynh commentedComment #4
griffynh commentedComment #5
larowlanWidget components need to be implemented like so https://project.pages.drupalcode.org/decoupled_lb/?path=/docs/developmen...
Plugins can be associated with a component by adding an entry to the plugin definition with keys 'componentPath' which points to the transpiled JS file and an optional 'library' key if any CSS needs to also be added to the page.
Example https://git.drupalcode.org/project/decoupled_lb_api/-/blob/1.x/decoupled...