Zeige das Widget Anfrage in der Vorschau des Seiteneditors und gib der Fassungsliste deutsche Texte
CI Feature / test (push) Successful in 5m32s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-27 22:55:40 +01:00
1 parent 2eca612108
commit 374fd95576
7 files changed
+56 -4

No files matched your search

@@ -33,6 +33,9 @@ public function table(Table $table): Table
$template = $this->getOwnerRecord();
return $table
->heading('Fassungen')
->emptyStateHeading('Noch keine Fassung veröffentlicht')
->emptyStateDescription('Mit „Veröffentlichen“ entsteht die erste Fassung.')
->columns([
TextColumn::make('version')->label('Fassung')->prefix('Nr. '),
TextColumn::make('published_at')->label('Veröffentlicht')->dateTime('d.m.Y H:i'),
+2 -3
View File
@@ -80,7 +80,6 @@ private static function structure(): array
->blockNumbers(false)
->reorderableWithButtons()
->collapsible()
->collapsed()
->live(),
])
->reorderableWithButtons()
@@ -98,7 +97,7 @@ private static function blocks(): array
{
return [
Block::make('field')
->label(fn (?array $state): string => 'Feld: '.(($state['label'] ?? '') ?: 'neu').self::fieldBadges($state))
->label(fn (?array $state): string => $state === null ? 'Feld' : 'Feld: '.(($state['label'] ?? '') ?: 'neu').self::fieldBadges($state))
->icon('heroicon-o-pencil-square')
->schema([
Hidden::make('key')->default(fn (): string => FormEditor::temporaryKey()),
@@ -149,7 +148,7 @@ private static function blocks(): array
self::condition('field'),
]),
Block::make('section')
->label(fn (?array $state): string => 'Teilbereich: '.(($state['label'] ?? '') ?: 'neu').(filled($state['cond']['effect'] ?? null) ? ' (Bedingung)' : ''))
->label(fn (?array $state): string => $state === null ? 'Teilbereich' : 'Teilbereich: '.(($state['label'] ?? '') ?: 'neu').(filled($state['cond']['effect'] ?? null) ? ' (Bedingung)' : ''))
->icon('heroicon-o-rectangle-group')
->schema([
Hidden::make('key')->default(fn (): string => FormEditor::temporaryKey()),
+20
View File
@@ -740,3 +740,23 @@ @media (prefers-reduced-motion: reduce) {
transition: none !important;
}
}
/* Vorschau im Seiteneditor: der geöffnete Dialog als gerahmtes Beispiel statt als Dialog über der Seite. */
.iw-sample-note {
margin: var(--space-3) 0 var(--space-2);
font-size: 0.9em;
color: var(--color-text-muted);
}
.iw-dialog--sample {
display: flex;
flex-direction: column;
width: auto;
max-height: none;
border: 2px dashed var(--color-border-strong);
box-shadow: none;
}
.iw-dialog--sample .iw-body {
overflow: visible;
}
+6
View File
@@ -0,0 +1,6 @@
/*
* Einstieg für Vorschauen, die nur Stile laden (Iframes im Seiteneditor): bringt das Anfrageformular und das Widget
* „Anfrage“ zum Laufen. Die öffentliche Seite und die Seitenvorschau laden dasselbe über app.js.
*/
import './inquiry-form.js';
import './inquiry-widget.js';
+20
View File
@@ -50,6 +50,10 @@ class InquiryWidget {
this.active = null;
this.sent = false;
this.modal = this.config.open === 'modal';
// In den Vorschau-Iframes des Seiteneditors (srcdoc, kleine feste Fläche) ist ein echter Dialog nicht darstellbar:
// Dort steht der geöffnete Dialog als gerahmtes Beispiel unter dem Button. Auf der Seite und in der Seitenvorschau
// öffnet der Button den echten Dialog.
this.sample = this.modal && this.config.preview && Boolean(window.frameElement?.hasAttribute?.('srcdoc'));
}
start() {
@@ -64,6 +68,10 @@ class InquiryWidget {
this.choose(preselected.key, false);
}
if (this.sample) {
return;
}
if (this.modal) {
// Ein Button der Seite mit ?grund=… will den Dialog sofort sehen; ohne Vorwahl öffnet der Besucher selbst.
if (preselected) {
@@ -93,6 +101,18 @@ class InquiryWidget {
}
this.root.classList.add('is-modal');
if (this.sample) {
this.opener = h('button', { type: 'button', class: 'button iw-opener', text: this.config.openLabel });
this.root.append(
this.opener,
h('p', { class: 'iw-sample-note', text: 'Vorschau: So sieht der geöffnete Dialog aus.' }),
h('div', { class: 'iw-dialog iw-dialog--sample', role: 'group', 'aria-label': this.config.openLabel }, h('div', { class: 'iw-dialog-head' }, h('span', { class: 'iw-close', 'aria-hidden': 'true' }, '×')), this.body),
);
return;
}
this.opener = h('button', {
type: 'button',
class: 'button iw-opener',
@@ -39,3 +39,7 @@
</p>
@endif
@endif
@if ($context->preview)
{{-- Vorschau-Iframes im Seiteneditor laden nur Stile: Das Skript lässt das Formular dort wie auf der Seite erscheinen. --}}
@vite('resources/js/inquiry-embed.js')
@endif
+1 -1
View File
@@ -6,7 +6,7 @@ import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
input: ['resources/css/app.css', 'resources/js/app.js', 'resources/js/inquiry-embed.js'],
refresh: true,
fonts: [
// Vorläufige Markenschriften (Website-Zielkonzept 7.2, nicht freigegeben); beim Build lokal abgelegt.