3 namespace Drupal\quickedit_test\Plugin\InPlaceEditor;
5 use Drupal\Core\Field\FieldItemListInterface;
6 use Drupal\quickedit\Plugin\InPlaceEditorBase;
9 * Defines the 'wysiwyg' in-place editor.
15 class WysiwygEditor extends InPlaceEditorBase {
20 public function isCompatible(FieldItemListInterface $items) {
21 $field_definition = $items->getFieldDefinition();
23 // This editor is incompatible with multivalued fields.
24 if ($field_definition->getFieldStorageDefinition()->getCardinality() != 1) {
27 // This editor is compatible with formatted ("rich") text fields; but only
28 // if there is a currently active text format and that text format is the
29 // 'full_html' text format.
30 return $items[0]->format === 'full_html';
36 public function getMetadata(FieldItemListInterface $items) {
37 $metadata['format'] = $items[0]->format;
44 public function getAttachments() {
47 'quickedit_test/not-existing-wysiwyg',