Skip to content

Commit

Permalink
Merge pull request #1 from digital-brew/link
Browse files Browse the repository at this point in the history
Link component
  • Loading branch information
yarovikov authored Nov 1, 2024
2 parents ef4f7c8 + f5308bb commit d4767f8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Editor/AbstractBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function getDefaultAttribute(string $type, mixed $value): ?array
'type' => 'boolean',
'default' => (bool) ($value ?? ''),
],
'File' => [
'File', 'Link' => [
'type' => 'object',
'default' => !empty($value) ? (object) $value : (object)[],
],
Expand Down
13 changes: 13 additions & 0 deletions src/Editor/GutengoodBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,19 @@ public function addFile(string $name, array $args = []): self
return $this->addComponent($name, 'File', $args);
}

/**
* Link component
*
* @param string $name The name of the component.
* @param array $args (string label, bool use_title)
*
* @return self
*/
public function addLink(string $name, array $args = []): self
{
return $this->addComponent($name, 'Link', $args);
}

/**
* Text control component
*
Expand Down

0 comments on commit d4767f8

Please sign in to comment.