- Issue created by @wim leers
XB generates an input UX for SDCs and code components automatically.
It achieves that through shape matching (see docs/shape-matching.md
).
The results are stored in the Component
config entity's source-specific settings — more precisely: type: experience_builder.generated_field_explicit_input_ux
's prop_field_definitions
. That has a key for every SDC prop, and a value that contains the field type, field storage settings, field instance settings, cardinality, default value, structured data prop expression and … the field widget plugin ID.
But … in principle it's possible to configure widgets differently. Right now, XB assumes that the default widget settings will suffice.
It's even possible that contrib/custom modules want to implement hook_storage_prop_shape_alter()
to control widget settings. Right now, to achieve that, they'd have to alter the results of \Drupal\experience_builder\Plugin\ExperienceBuilder\ComponentSource\GeneratedFieldExplicitInputUxComponentSourceBase::buildConfigurationForm()
, which would be a fairly complex undertaking.
\Drupal\experience_builder\PropShape\StorablePropShape
to contain widget settings.
\Drupal\experience_builder\PropShape\CandidateStorablePropShape
to similarly contain widget settings, and update the hook_storage_prop_shape_alter()
documentation. ⚠️👈 This is what makes this a stable blocker
: this modifies the public API.
diff --git a/config/schema/experience_builder.schema.yml b/config/schema/experience_builder.schema.yml
index 5f8d95ecb..10229bc9b 100644
--- a/config/schema/experience_builder.schema.yml
+++ b/config/schema/experience_builder.schema.yml
@@ -372,15 +372,16 @@ experience_builder.generated_field_explicit_input_ux:
type: field.field_settings.[%parent.field_type]
# Optional *if* the default instance settings should be used.
requiredKey: false
- # After a field type is selected, a field widget must be picked.
- # @todo MUCH later: widget settings.
field_widget:
type: string
- label: 'Default field widget'
+ label: 'Field widget'
constraints:
PluginExists:
manager: plugin.manager.field.widget
interface: '\Drupal\Core\Field\WidgetInterface'
+ field_widget_settings:
+ type: field.widget.settings.[%parent.type]
+ label: 'Widget settings'
# Then finally, a default value must be picked for every REQUIRED prop, using the aforementioned widget.
# This value uses the field type's default value config schema, and will be simplified to a
# StaticPropSource's `value`.
Active
0.0
Config management