'#type' => 'status_messages',
'#weight' => -10,
];
$response->
addCommand(new HtmlCommand('#editor-media-dialog-form',
$form));
} else { // Only send back the relevant values.
$values =
[ 'hasCaption' =>
$form_state->
getValue('hasCaption'
),
'attributes' =>
$form_state->
getValue('attributes'
),
];
$response->
addCommand(new EditorDialogSave($values));
$response->
addCommand(new CloseModalDialogCommand());
} return $response;
} /**
* Gets the default value for the view mode form element.
*
* @param array $view_mode_options
* The array of options for the view mode form element.
* @param \Drupal\filter\Plugin\FilterInterface $media_embed_filter
* The media embed filter.
* @param string $media_element_view_mode_attribute
* The data-view-mode attribute on the <drupal-media> element.
*
* @return string|null
* The default value for the view mode form element.
*/