You are here

public function CKEditor5PluginManager::getEnabledLibraries in Drupal 10

Gets a list of libraries required for the editor.

This list is filtered by enabled plugins because it is needed at runtime.

Parameters

\Drupal\editor\EditorInterface $editor: A configured text editor object.

Return value

string[] The list of enabled libraries.

Overrides CKEditor5PluginManagerInterface::getEnabledLibraries

File

core/modules/ckeditor5/src/Plugin/CKEditor5PluginManager.php, line 120

Class

CKEditor5PluginManager
Provides a CKEditor5 plugin manager.

Namespace

Drupal\ckeditor5\Plugin

Code

public function getEnabledLibraries(EditorInterface $editor) : array {
  $list = $this
    ->mergeDefinitionValues('getLibrary', $this
    ->getEnabledDefinitions($editor));
  $list = array_unique($list);

  // Include main library.
  array_unshift($list, 'ckeditor5/drupal.ckeditor5');
  sort($list);
  return $list;
}