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
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
"license": "MIT",
"require": {
"php": "^8.2",
"awcodes/filament-tiptap-editor": "^3.2",
"codedor/filament-image-or-video": "^1.1",
"codedor/filament-link-picker": "^1.6",
"codedor/filament-media-library": "^2.0|^3.0",
"filament/filament": "^3.1",
"codedor/filament-image-or-video": "dev-feature/filament-v4",
"codedor/filament-link-picker": "dev-feature/filament-v4",
"codedor/filament-media-library": "dev-feature/filament-v4",
"filament/filament": "^4.0",
"illuminate/contracts": "^10.0|^11.0|^12.0",
"spatie/laravel-package-tools": "^1.12"
},
"require-dev": {
"filament/upgrade": "^4.0",
"larastan/larastan": "^2.0|^3.0",
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.0|^8.0",
"larastan/larastan": "^2.0|^3.0",
"orchestra/testbench": "^8.0|^9.0|^10.0",
"pestphp/pest": "^2.0|^3.0",
"pestphp/pest-plugin-laravel": "^2.0|^3.0",
Expand Down
10 changes: 1 addition & 9 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ parameters:
message: "#^Access to an undefined property Codedor\\\\FilamentArchitect\\\\Livewire\\\\EditModal\\:\\:\\$form.$#"
count: 3
path: src/Livewire/EditModal.php
-
message: "#^Access to an undefined property Filament\\\\Forms\\\\Contracts\\\\HasForms\\:\\:\\$mountedFormComponentActionsArguments.$#"
count: 1
path: src/Filament/Fields/ArchitectInput.php
-
message: "#^Unsafe usage of new static\\(\\).$#"
count: 1
Expand All @@ -17,7 +13,7 @@ parameters:
count: 1
path: src/Filament/Architect/BaseBlock.php
-
message: "#^Parameter \\#1 \\$callback of method Illuminate\\\\Support\\\\Collection\\<int,int\\>\\:\\:map\\(\\) expects callable\\(int, int\\)\\: FilamentTiptapEditor\\\\TiptapEditor, Closure\\(string\\)\\: FilamentTiptapEditor\\\\TiptapEditor given.$#"
message: "#^Parameter \\#1 \\$callback of method Illuminate\\\\Support\\\\Collection\\<int,int\\>\\:\\:map\\(\\) expects callable\\(int, int\\)\\: Filament\\\\Forms\\\\Components\\\\RichEditor, Closure\\(string\\)\\: Filament\\\\Forms\\\\Components\\\\RichEditor given.$#"
count: 1
path: src/Filament/Architect/TextBlock.php
-
Expand All @@ -32,10 +28,6 @@ parameters:
message: "#^Parameter \\#1 \\$view of function view expects view-string\\|null, string given.$#"
count: 1
path: src/Filament/Fields/ArchitectInput.php
-
message: "#^Property Codedor\\\\FilamentArchitect\\\\Filament\\\\Fields\\\\ArchitectInput\\:\\:\\$view \\(view-string\\) does not accept default value of type string.$#"
count: 1
path: src/Filament/Fields/ArchitectInput.php
-
message: "#^Parameter \\#1 \\$view of method Filament\\\\Support\\\\Components\\\\ViewComponent\\:\\:view\\(\\) expects view-string\\|null, string given.$#"
count: 1
Expand Down
7 changes: 4 additions & 3 deletions resources/views/architect-input.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
@php
use Filament\Support\Enums\ActionSize;
use Filament\Support\Enums\Size;
use Filament\Support\Enums\IconSize;

$state = $getState() ?? [];
$statePath = $getStatePath();
$locales = $getLocales();
$key = $getKey();
@endphp

<x-dynamic-component :component="$getFieldWrapperView()" :field="$field">
Expand All @@ -27,7 +28,7 @@
<div
class="w-full flex flex-col gap-2"
x-sortable
x-on:end.stop="$wire.dispatchFormEvent('reorder-row', '{{ $statePath }}', {
x-on:end.stop="$wire.callSchemaComponentMethod(@js($key), 'reorderRow', {
newKeys: $event.target.sortable.toArray(),
})"
>
Expand Down Expand Up @@ -63,7 +64,7 @@ class="border-2 dark:bg-white/5 dark:hover:bg-white/10 dark:border-gray-700 curs
<div
class="grow w-full grid gap-2 grid-cols-12"
x-sortable
x-on:end.stop="$wire.dispatchFormEvent('reorder-column', '{{ $statePath }}', {
x-on:end.stop="$wire.callSchemaComponentMethod(@js($key), 'reorder-column', {
newKeys: $event.target.sortable.toArray(),
row: '{{ $rowKey }}',
})"
Expand Down
7 changes: 4 additions & 3 deletions resources/views/components/icon-button.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@php
use Filament\Support\Enums\ActionSize;
use Filament\Support\Enums\Size;
use Filament\Support\Enums\IconSize;
@endphp

Expand All @@ -15,7 +15,8 @@

@php
$wireClickActionArguments = \Illuminate\Support\Js::from($arguments);
$wireClickAction = "mountFormComponentAction('{$statePath}', '{$action->getName()}', {$wireClickActionArguments})"
$wireClickActionMeta = \Illuminate\Support\Js::from(['schemaComponent' => str_replace('data.', 'form.', $statePath)]);
$wireClickAction = "mountAction('{$action->getName()}', {$wireClickActionArguments}, {$wireClickActionMeta})"
@endphp

<x-dynamic-component
Expand All @@ -27,7 +28,7 @@
:color="$color"
:wire:click="$wireClickAction"
:icon="$action->getIcon()"
:size="ActionSize::Small"
:size="Size::Small"
:icon-size="IconSize::Small"
:label="$label"
:$tooltip
Expand Down
4 changes: 2 additions & 2 deletions resources/views/components/input-row.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@php
use Filament\Support\Enums\ActionSize;
use Filament\Support\Enums\Size;
use Filament\Support\Enums\IconSize;

$blockClassName = get_architect_block($blocks, $block['type']);
Expand Down Expand Up @@ -57,7 +57,7 @@ class="w-full flex gap-2 items-center"
color="gray"
icon="heroicon-o-arrows-right-left"
class="border-2 bg-white dark:bg-gray-800 dark:hover:bg-gray-700 dark:border-gray-700 dark:text-gray-100 dark:hover:text-white cursor-move m-0"
:size="ActionSize::Small"
:size="Size::Small"
:icon-size="IconSize::Small"
x-sortable-handle
/>
Expand Down
1 change: 1 addition & 0 deletions resources/views/edit-modal.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<livewire:filament-architect-edit-modal
:state-path="$statePath"
:arguments="$arguments"
:form-key="$key"
/>
36 changes: 0 additions & 36 deletions resources/views/livewire/edit-modal.blade.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/Filament/Architect/CardBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Codedor\MediaLibrary\Filament\AttachmentInput;
use Codedor\MediaLibrary\Models\Attachment;
use Filament\Forms\Components\Repeater;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\TextInput;
use FilamentTiptapEditor\TiptapEditor;
use Illuminate\View\View;

class CardBlock extends BaseBlock
Expand All @@ -35,7 +35,7 @@ public function schema(): array
TextInput::make('title')
->required(),

TiptapEditor::make('description'),
RichEditor::make('description'),

AttachmentInput::make('image')
->allowedFormats(ArchitectFormats::get()),
Expand Down
2 changes: 1 addition & 1 deletion src/Filament/Architect/MediaBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function schema(): array
Radio::make('width')
->visible((bool) ArchitectConfig::getWidthOptionsEnum())
->required()
->options(function (Get $get) {
->options(function (\Filament\Schemas\Components\Utilities\Get $get) {
$enum = ArchitectConfig::getWidthOptionsEnum();

if (! $enum) {
Expand Down
4 changes: 2 additions & 2 deletions src/Filament/Architect/MediaTextBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Codedor\MediaLibrary\Filament\AttachmentInput;
use Codedor\MediaLibrary\Models\Attachment;
use Filament\Forms\Components\Radio;
use FilamentTiptapEditor\TiptapEditor;
use Filament\Forms\Components\RichEditor;
use Illuminate\View\View;

class MediaTextBlock extends BaseBlock
Expand Down Expand Up @@ -36,7 +36,7 @@ public function schema(): array
->allowedFormats(ArchitectFormats::get())
->required(),

TiptapEditor::make('description')
RichEditor::make('description')
->label('Text to display'),
];
}
Expand Down
5 changes: 2 additions & 3 deletions src/Filament/Architect/TableBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Codedor\FilamentArchitect\Filament\Architect;

use FilamentTiptapEditor\TiptapEditor;
use Filament\Forms\Components\RichEditor;
use Illuminate\View\View;

class TableBlock extends BaseBlock
Expand All @@ -17,8 +17,7 @@ public function render(array $data): ?View
public function schema(): array
{
return [
TiptapEditor::make('table')
->disableBubbleMenus(false)
RichEditor::make('table')
->required(),
];
}
Expand Down
8 changes: 3 additions & 5 deletions src/Filament/Architect/TextBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

namespace Codedor\FilamentArchitect\Filament\Architect;

use Filament\Forms\Components\Grid;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Get;
use FilamentTiptapEditor\TiptapEditor;
use Illuminate\Support\HtmlString;
use Illuminate\View\View;

Expand Down Expand Up @@ -34,12 +32,12 @@ public function schema(): array
->maxValue(3)
->extraInputAttributes(['min' => 1, 'max' => 3]),

Grid::make(1)->schema(function (Get $get) {
\Filament\Schemas\Components\Grid::make(1)->schema(function (\Filament\Schemas\Components\Utilities\Get $get) {
return collect()
->pad($get('columns') ?? 1, null)
->keys()
->map(function (string $key) {
return TiptapEditor::make("text.{$key}")
return RichEditor::make("text.{$key}")
->label('Text');
})
->toArray();
Expand Down
4 changes: 2 additions & 2 deletions src/Filament/Architect/VideoTextBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Codedor\FilamentImageOrVideo\Filament\Components\VideoEmbed;
use Filament\Forms\Components\Radio;
use FilamentTiptapEditor\TiptapEditor;
use Filament\Forms\Components\RichEditor;
use Illuminate\View\View;

class VideoTextBlock extends BaseBlock
Expand All @@ -30,7 +30,7 @@ public function schema(): array

VideoEmbed::make('video'),

TiptapEditor::make('description')
RichEditor::make('description')
->label('Text')
->required(),
];
Expand Down
18 changes: 9 additions & 9 deletions src/Filament/Components/ButtonComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@

class ButtonComponent
{
public static function make(string $statePath): Component
public static function make(string $statePath): \Filament\Schemas\Components\Component
{
return ViewField::make($statePath)
->view('filament-architect::components.button-field')
->registerActions([
Action::make('addButton')
->label(function (Get $get) use ($statePath) {
\Filament\Actions\Action::make('addButton')
->label(function (\Filament\Schemas\Components\Utilities\Get $get) use ($statePath) {
$currentText = $get("{$statePath}.text");

return $currentText ? $currentText : __('filament-architect::admin.button');
})
->icon(function (Get $get) use ($statePath) {
->icon(function (\Filament\Schemas\Components\Utilities\Get $get) use ($statePath) {
$currentText = $get("{$statePath}.text");

return $currentText ? 'heroicon-o-pencil' : 'heroicon-o-plus';
})
->fillForm(fn (Get $get) => $get($statePath))
->form([
->fillForm(fn (\Filament\Schemas\Components\Utilities\Get $get) => $get($statePath))
->schema([
TextInput::make('text')
->label(__('filament-architect::admin.text on button'))
->required(),
Expand All @@ -51,14 +51,14 @@ public static function make(string $statePath): Component

TrackingComponent::make(),
])
->action(function ($data, Set $set) use ($statePath) {
->action(function ($data, \Filament\Schemas\Components\Utilities\Set $set) use ($statePath) {
$set($statePath, $data);
}),
Action::make('removeButton')
\Filament\Actions\Action::make('removeButton')
->color('danger')
->label(__('filament-architect::admin.remove button'))
->icon('heroicon-o-trash')
->action(fn ($data, Set $set) => $set($statePath, [])),
->action(fn ($data, \Filament\Schemas\Components\Utilities\Set $set) => $set($statePath, [])),
]);
}
}
4 changes: 2 additions & 2 deletions src/Filament/Components/TrackingComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

class TrackingComponent
{
public static function make(): Component
public static function make(): \Filament\Schemas\Components\Component
{
return Section::make(__('filament-architect::admin.tracking information'))
return \Filament\Schemas\Components\Section::make(__('filament-architect::admin.tracking information'))
->statePath('tracking')
->collapsed()
->columns(2)
Expand Down
Loading
Loading