3 namespace Drupal\image\Plugin\InPlaceEditor;
5 use Drupal\Core\Field\FieldItemListInterface;
6 use Drupal\quickedit\Plugin\InPlaceEditorBase;
9 * Defines the image text in-place editor.
15 class Image extends InPlaceEditorBase {
20 public function isCompatible(FieldItemListInterface $items) {
21 $field_definition = $items->getFieldDefinition();
23 // This editor is only compatible with single-value image fields.
24 return $field_definition->getFieldStorageDefinition()->getCardinality() === 1
25 && $field_definition->getType() === 'image';
31 public function getAttachments() {
34 'image/quickedit.inPlaceEditor.image',