Skip to content

Commit

Permalink
Merge pull request #1 from martin-ro/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
martin-ro authored Sep 30, 2024
2 parents fef3c47 + 87e7bd7 commit 9228632
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to `filament-blocks` will be documented in this file.

## 1.0.3 - 2024-10-01

- Hide the label of `FilamentBlockBuilder` by default
- Add a `@props` tag to the block view stub
- Replace the default icon with a Heroicon
- Fixed label generation
- Update README to reflect changes above

## 1.0.2 - 2024-09-05

- Update README to include CHANGELOG reference
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class MyHero extends FilamentBlock
public static function getBlockSchema(): Block
{
return Block::make('hero.my-hero')
->label('My Hero')
->icon('phosphor-cards-three')
->label('Hero: My Hero')
->icon('heroicon-o-rectangle-stack')
->preview('components.blocks.hero.my-hero')
->schema([
//
Expand Down
7 changes: 5 additions & 2 deletions src/Commands/MakeBlockCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ final class MakeBlockCommand extends Command

public function handle(): int
{
$block = (string) Str::of($this->argument('name') ?? text(label: 'Name (e.g. `Hero`)', required: true))
$block = (string) Str::of($this->argument('name') ?? text(
label: 'Name (e.g. `Hero`)',
required: true,
))
->trim('/')
->trim('\\')
->trim(' ')
Expand All @@ -34,7 +37,7 @@ public function handle(): int
$label = Str::of($block)
->beforeLast('Block')
->explode('\\')
->map(fn ($segment) => Str::title($segment))
->map(fn ($segment) => Str::studly($segment))
->implode(': ');

$shortName = Str::of($block)
Expand Down
2 changes: 1 addition & 1 deletion src/Components/FilamentBlockBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ protected function setUp(): void
{
parent::setUp();

$this->label(null);
$this->hiddenLabel();

$this->addActionLabel('Add Block');

Expand Down
2 changes: 1 addition & 1 deletion stubs/Block.stub
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class {{ class }} extends FilamentBlock
{
return Block::make('{{ shortName }}')
->label('{{ label }}')
->icon('phosphor-cards-three')
->icon('heroicon-o-rectangle-stack')
->preview('{{ componentPath }}')
->schema([
//
Expand Down
4 changes: 4 additions & 0 deletions stubs/BlockView.stub
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@props([
//
])

<div>
//
</div>

0 comments on commit 9228632

Please sign in to comment.