Description
The blokkli editor UI allows dragging/dropping fragments into BlokkliField components even when the underlying Drupal field does not have blokkli_fragment in its target_bundles configuration. The editor should check the field's allowedBundles before showing fragments as droppable options.
Steps to Reproduce
- Create a Drupal paragraph field that does NOT include
blokkli_fragment in its target_bundles (e.g., a field that only allows text, image, video)
- Define a frontend fragment using
defineBlokkliFragment():
defineBlokkliFragment({
name: 'my_fragment',
label: 'My Fragment',
})
- Open the blokkli editor on a page with a
BlokkliField for that field
- Try to add a fragment via the "Add" menu or drag-and-drop
Expected Behavior
- Fragments should NOT appear in the "Add" menu for fields that don't allow
blokkli_fragment
- Drag-and-drop of fragments should be rejected for fields that don't allow
blokkli_fragment
- Only fields with
blokkli_fragment in their allowedBundles (from pbGetFieldConfig or paragraphsBlokkliAllowedTypes) should accept fragments
Actual Behavior
- Fragments can be added to any field regardless of
allowedBundles
- The operation appears to succeed in the UI
- Validation errors only surface at publish time (server-side Drupal validation)
Additional Context
The :allowed-fragments prop on BlokkliField filters which specific fragment names are allowed, but it doesn't prevent fragments from being added to fields where blokkli_fragment bundle itself isn't allowed.
GraphQL data available:
paragraphsBlokkliAllowedTypes returns allowedTypes per field
pbGetFieldConfig returns allowedBundles per field
The editor already receives this data but doesn't use it to filter fragment availability.
Environment
@blokkli/editor: 2.0.0-alpha.31
drupal/paragraphs_blokkli: 2.0.x-dev
- Nuxt 4
Description
The blokkli editor UI allows dragging/dropping fragments into
BlokkliFieldcomponents even when the underlying Drupal field does not haveblokkli_fragmentin itstarget_bundlesconfiguration. The editor should check the field'sallowedBundlesbefore showing fragments as droppable options.Steps to Reproduce
blokkli_fragmentin itstarget_bundles(e.g., a field that only allowstext,image,video)defineBlokkliFragment():BlokkliFieldfor that fieldExpected Behavior
blokkli_fragmentblokkli_fragmentblokkli_fragmentin theirallowedBundles(frompbGetFieldConfigorparagraphsBlokkliAllowedTypes) should accept fragmentsActual Behavior
allowedBundlesAdditional Context
The
:allowed-fragmentsprop onBlokkliFieldfilters which specific fragment names are allowed, but it doesn't prevent fragments from being added to fields whereblokkli_fragmentbundle itself isn't allowed.GraphQL data available:
paragraphsBlokkliAllowedTypesreturnsallowedTypesper fieldpbGetFieldConfigreturnsallowedBundlesper fieldThe editor already receives this data but doesn't use it to filter fragment availability.
Environment
@blokkli/editor: 2.0.0-alpha.31drupal/paragraphs_blokkli: 2.0.x-dev