You are here

public function Gutenberg::getLibraries in Gutenberg 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Editor/Gutenberg.php \Drupal\gutenberg\Plugin\Editor\Gutenberg::getLibraries()

Returns libraries to be attached.

Because this is a method, plugins can dynamically choose to attach a different library for different configurations, instead of being forced to always use the same method.

Parameters

\Drupal\editor\Entity\Editor $editor: A configured text editor object.

Return value

array An array of libraries that will be added to the page for use by this text editor.

Overrides EditorPluginInterface::getLibraries

See also

\Drupal\Core\Render\AttachmentsResponseProcessorInterface::processAttachments()

EditorManager::getAttachments()

File

src/Plugin/Editor/Gutenberg.php, line 178

Class

Gutenberg
Defines a Gutenberg-based text editor for Drupal.

Namespace

Drupal\gutenberg\Plugin\Editor

Code

public function getLibraries(Editor $editor) {
  $libraries = [
    'gutenberg/edit-node',
    // Media attributes overrides must come after all
    // Gutenberg initialization.
    'gutenberg/g-media-attributes',
    'gutenberg/blocks-edit',
    'gutenberg/drupal-blocks',
  ];
  return $libraries;
}