Add Drupal Canvas integration for icon_widget
Drupal Canvas refuses to render any field widget for a component input unless the widget plugin definition carries `canvas.transforms` metadata, throwing: > Drupal Canvas determined the `icon_widget` field widget plugin must be used to populate the … prop … However, no `canvas.transforms` metadata is defined on the field widget plugin definition. This makes it impossible for this widget to work. So, today a `ui_icon` field cannot be edited as a Canvas component input, and the `ui_icon` field type cannot serve as the storage for an icon-shaped SDC prop. (Depends on issue https://git.drupalcode.org/project/ui_icons/-/work_items/3591877 for the value round-trip.) **Proposed resolution** 1. Register the transforms metadata when Canvas is installed (e.g. in a `ui_icons_canvas` submodule, or conditionally in `hook_field_widget_info_alter()`). 2. Ship the client-side transform as a `canvas.transform.uiIcon` library (Canvas auto-attaches any `canvas.transform.*` library to the builder UI). Both icon selectors (`icon_autocomplete`, and `icon_picker` which extends it) nest their form output under `value[icon_id]`, which is too deep for Canvas's built-in `mainProperty` transform. 3. (Optional, for content templates / dynamic binding UX.) Canvas's shape matcher only suggests a field property for a component prop when the property carries a validation constraint identical to the one derived from the prop's JSON schema. Adding a `Regex` constraint to `target_id` matching the documented icon id format would let icon-shaped props (`pattern: '^[a-z0-9_]+:.+$'`) find `ui_icon` fields. This also gives the field type real validation of the `pack_id:icon_id` format, which it currently lacks.
issue