Problem/Motivation
The CKEditor 5 dialog offers every component of the site. A site builder may want to limit a text format to a few of them, and the limit must also hold for text written in source mode or through the API, not only in the dialog.
Proposed resolution
Add an "Allowed components" setting to the component_embed filter: checkboxes grouped by module or theme, none checked means all allowed. The filter drops a component outside the list when rendering, the dialog only offers the allowed ones and refuses a component outside the list, the preview returns 403 for it.
Component_form element gets a #component_filter option. The selected component always stays in the list so a saved configuration remains editable. The matching lives in ComponentPluginManager::filterDefinitions() so other modules and slot restrictions from #3551587: Slots restrictions according to suggestions and cardinality would reuse it.
Nested components inside a slot are not restricted, a follow-up ?
API changes
New #component_filter option on the component_form element. New ComponentPluginManager::filterDefinitions() method. New allowed_components setting on the component_embed filter.
Issue fork ui_patterns-3619582
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
just_like_good_vibesComment #4
just_like_good_vibesi implemented the component restrictions for nested components
the component_filter proposition is also made in #3551587: Slots restrictions according to suggestions and cardinality, depending on which one we want to merge first
Comment #6
just_like_good_vibes