- 83 Komponenten: Livewire\Volt\Component → Livewire\Component
- 73 Routen (admin, auth, customer): Volt::route() → Route::livewire()
- 88 Testdateien: Volt::test/actingAs → Livewire::test/actingAs
- VoltServiceProvider gelöscht; composer remove livewire/volt
- config/livewire.php auf v4-Schlüssel (component_layout, component_placeholder,
component_locations, make_command: SFC ohne ⚡). Der alte Schlüssel layout war
wirkungslos; alle gerouteten Komponenten setzen ihr Layout selbst.
- CLAUDE.md, AGENTS.md, boost.json, .cursorrules, Skill volt-development
- Roadmap: erledigt; Larastan erfasst SFCs weiterhin nicht (Blade-Dateien)
Suite 2.325 grün, einer übersprungen; Larastan und Pint ohne Meldung;
route:cache und view:cache laufen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
82 lines
3.1 KiB
PHP
82 lines
3.1 KiB
PHP
<?php
|
|
|
|
use App\Enums\PressReleasePlaceholder;
|
|
use Flux\Flux;
|
|
use Livewire\Component;
|
|
|
|
/**
|
|
* Auswahl-Modal für die SVG-Titelbild-Platzhalter.
|
|
*
|
|
* Wird in den PM-Forms eingebunden. Beim Bestätigen wird das Event
|
|
* `placeholder-selected` mit der gewählten Variante dispatched; das
|
|
* Eltern-Formular übernimmt den Wert in sein `placeholder_variant`-Feld.
|
|
*/
|
|
new class extends Component
|
|
{
|
|
public string $selected = '';
|
|
|
|
public function mount(?string $current = null): void
|
|
{
|
|
$this->selected = PressReleasePlaceholder::fromValueOrDefault($current)->value;
|
|
}
|
|
|
|
public function choose(string $variant): void
|
|
{
|
|
$this->selected = PressReleasePlaceholder::fromValueOrDefault($variant)->value;
|
|
}
|
|
|
|
public function confirm(): void
|
|
{
|
|
$this->dispatch('placeholder-selected', variant: $this->selected);
|
|
|
|
Flux::modal('placeholder-picker')->close();
|
|
}
|
|
|
|
public function with(): array
|
|
{
|
|
return [
|
|
'variants' => PressReleasePlaceholder::cases(),
|
|
];
|
|
}
|
|
}; ?>
|
|
|
|
<flux:modal name="placeholder-picker" class="w-full max-w-4xl">
|
|
<div class="space-y-5">
|
|
<div>
|
|
<flux:heading size="lg">{{ __('Titelbild-Platzhalter wählen') }}</flux:heading>
|
|
<flux:subheading>
|
|
{{ __('Wird verwendet, solange kein eigenes Titelbild hochgeladen ist.') }}
|
|
</flux:subheading>
|
|
</div>
|
|
|
|
<div class="grid max-h-[62vh] grid-cols-2 gap-3 overflow-y-auto pr-1 sm:grid-cols-3 lg:grid-cols-4">
|
|
@foreach ($variants as $variant)
|
|
<button type="button" wire:click="choose('{{ $variant->value }}')"
|
|
@class([
|
|
'group relative aspect-[16/9] overflow-hidden rounded-[6px] border-2 transition',
|
|
'border-[color:var(--color-hub)] ring-2 ring-[color:var(--color-hub)]/30' => $selected === $variant->value,
|
|
'border-transparent hover:border-[color:var(--color-bg-rule)]' => $selected !== $variant->value,
|
|
])
|
|
aria-pressed="{{ $selected === $variant->value ? 'true' : 'false' }}"
|
|
title="{{ $variant->label() }}">
|
|
<img src="{{ asset($variant->path()) }}" alt="{{ $variant->label() }}"
|
|
class="absolute inset-0 h-full w-full object-cover" loading="lazy" />
|
|
@if ($selected === $variant->value)
|
|
<span class="absolute right-1.5 top-1.5 flex size-5 items-center justify-center rounded-full bg-[color:var(--color-hub)] text-white">
|
|
<flux:icon.check variant="micro" class="size-3.5" />
|
|
</span>
|
|
@endif
|
|
</button>
|
|
@endforeach
|
|
</div>
|
|
|
|
<div class="flex justify-end gap-2">
|
|
<flux:modal.close>
|
|
<flux:button variant="filled">{{ __('Abbrechen') }}</flux:button>
|
|
</flux:modal.close>
|
|
<flux:button variant="primary" wire:click="confirm">
|
|
{{ __('Übernehmen') }}
|
|
</flux:button>
|
|
</div>
|
|
</div>
|
|
</flux:modal>
|