Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ public function getConfigTreeBuilder()
->useAttributeAsKey('name')
->variablePrototype()->end()
->end()
->arrayNode('tunes')
->normalizeKeys(false)
->useAttributeAsKey('name')
->variablePrototype()->end()
->end()
->end()
->end()
->end()
Expand Down
1 change: 1 addition & 0 deletions src/DependencyInjection/TbmatukaEditorjsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function load(array $configs, ContainerBuilder $container): void
'inlineToolbar',
'toolbox',
'config',
'tunes',
];

foreach ($config['tools'] as $toolName => $toolConfig) {
Expand Down
17 changes: 16 additions & 1 deletion src/Editor/ToolConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ class ToolConfig
*/
private $config = [];

/**
* @var array
*/
private $tunes = [];

/**
* @param bool|array|null|mixed $inlineToolbar
*/
Expand All @@ -49,7 +54,8 @@ public function __construct(
?string $shortcut = null,
$inlineToolbar = null,
?array $toolbox = [],
?array $config = []
?array $config = [],
?array $tunes = []
) {
$this->name = $name;
$this->className = $className;
Expand All @@ -76,6 +82,10 @@ public function __construct(
if (is_array($config)) {
$this->config = $config;
}

if (is_array($tunes)) {
$this->tunes = $tunes;
}
}

public function getName(): string
Expand Down Expand Up @@ -115,4 +125,9 @@ public function getConfig(): array
{
return $this->config;
}

public function getTunes(): array
{
return $this->tunes;
}
}