feat(admin): widget field payload and summer-result data channel (quick-261006-eyj)

- WidgetField posts the summer-action event's detail.payload as payload only
  when the detail carries one; a payload-less post body is unchanged
- after a successful action the response data is set on the element as the
  data attribute (removed when the answer has none) and announced with a
  summer-result event carrying {data, fill, message}; failures dispatch nothing
- WIDGET_RESULT_EVENT exported from formContext; unit tests for both directions
- modules/boardwalk/dist rebuilt
This commit is contained in:
Jakub Zych
2026-10-06 11:16:46 +02:00
parent 6af88f9df6
commit c6f68e4639
5 changed files with 187 additions and 22 deletions

View File

@@ -82,5 +82,12 @@ export const FORM_SESSION: InjectionKey<FormSession> = Symbol('summer.form.sessi
/** Event a widget element dispatches to run its action (bubbles, composed). */
export const WIDGET_EVENT = 'summer-action'
/**
* Event the SPA dispatches on the plugin element after each successful action,
* with detail {data, fill, message}: the response data as returned (undefined
* when the answer carried none), the fill object and the message.
*/
export const WIDGET_RESULT_EVENT = 'summer-result'
/** How long a widget waits for its custom element to be defined. */
export const WIDGET_TIMEOUT = 5000