Führe einen gemeinsamen Layoutvertrag ein und integriere die Premium-Widgets.
Layoutvertrag (ADR-38) in der bestehenden Registry: Jede Widget-Art erklärt zulässige Rasterbreiten (supportedUnits), Höhen aus einem gemeinsamen Vokabular (heights, gespeichert als settings.height), Darstellungsmodi und Verhalten bei wenig Platz. Unzulässige Breiten werden beim Speichern verständlich abgewiesen; Höhe „fill“ streckt den Handlungsaufruf auf die Abschnittszeile. Premium-Widgets nach Brand-UI-Kit v1.6: - hero Version 2: photo_split/editorial_solid, Höhen compact/normal/ large, Label, Überschriftenebene, Akzent, Bildfokus in Prozent, zwei Schaltflächen; nur 3 oder 4 Einheiten. Upgrade aus Version 1. - image_text Version 3: Fläche cream/clear/navy, Höhen compact/normal/ spacious, Label, zwei Schaltflächen, Bildfokus; 1 bis 4 Einheiten. Upgrade aus Version 2 (format entfällt, Fokus in Prozent). - Kit-CSS ersetzt das bisherige Hero- und Bild-und-Text-CSS; der Randlos-Mechanismus der Designiteration 1 entfällt. Editor: Reiter Inhalt/Medien/Darstellung aus der Registry, Auswahl- knöpfe mit Symbolen, Schieberegler für den Bildfokus und eine Live- Vorschau im Dialog mit demselben Renderer in wählbarer Platzbreite. Tests bewusst angepasst: Einstieg braucht jetzt 3 oder 4 Einheiten (vorher Mindestbreite 2), image_text ist Version 3, Klassen der neuen Ansichten; die Hero-/Bild-Tests der Designiteration 1 sind durch CmsPremiumWidgetsTest ersetzt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3cdb36e7a3
commit
0bfb53463a
38 files changed
+1755
-856
No files matched your search
@@ -9,7 +9,7 @@
|
||||
|
||||
/* Widget-Vorschau: kompakt, ohne eigene Bildlaufleiste; lange Inhalte werden gekürzt angezeigt. */
|
||||
.luf-widget-preview { position: relative; }
|
||||
.luf-widget-preview-frame { display: block; width: 100%; min-height: 3rem; max-height: 22rem; border: 0; overflow: hidden; pointer-events: none; background: #fff; }
|
||||
.luf-widget-preview-frame { display: block; width: 100%; min-height: 3rem; max-height: 28rem; border: 0; overflow: hidden; pointer-events: none; background: #fff; }
|
||||
.luf-widget-preview.is-clipped::after {
|
||||
content: 'Vorschau gekürzt – vollständig in der Seitenvorschau';
|
||||
position: absolute; inset: auto 0 0 0; padding: 2.5rem .75rem .5rem;
|
||||
@@ -18,6 +18,13 @@
|
||||
}
|
||||
.luf-widget-preview-empty { margin: 0; padding: 1rem; font-size: .875rem; opacity: .75; }
|
||||
|
||||
/* Live-Vorschau im Bearbeitungsdialog: feste logische Breite, auf die Dialogbreite verkleinert. */
|
||||
.luf-live-preview { border: 1px solid rgb(0 0 0 / 10%); border-radius: .75rem; padding: .75rem; background: rgb(247 246 242 / 60%); }
|
||||
.luf-live-preview-caption { margin: 0 0 .5rem; font-size: .75rem; opacity: .75; }
|
||||
.luf-live-preview-stage { position: relative; overflow: hidden; background: #fff; border-radius: .5rem; }
|
||||
.luf-live-preview-frame { display: block; border: 0; pointer-events: none; background: #fff; transform-origin: 0 0; }
|
||||
.luf-preview-width .fi-btn-group { flex-wrap: wrap; }
|
||||
|
||||
/* Abschnitte: breite Arbeitsfläche, deutlich abgesetzte Abschnitte */
|
||||
.luf-sections > .fi-fo-repeater-items { gap: 1.25rem; }
|
||||
.luf-sections > .fi-fo-repeater-items > .fi-fo-repeater-item { border-left: 4px solid rgb(3 37 81 / 70%); }
|
||||
@@ -50,8 +57,34 @@
|
||||
</style>
|
||||
<script>
|
||||
// Vorschau-Iframes an ihren Inhalt anpassen (nach Bildern und Schriften erneut), Höhe begrenzen.
|
||||
// Live-Vorschau im Dialog: Inhalt in logischer Breite rendern, dann auf die verfügbare Breite skalieren.
|
||||
window.lufLivePreview = window.lufLivePreview || function (frame) {
|
||||
const stage = frame.parentElement;
|
||||
const width = Number(frame.dataset.width) || 1200;
|
||||
const fit = () => {
|
||||
const doc = frame.contentDocument;
|
||||
if (!doc || !doc.documentElement || !stage) return;
|
||||
const scale = Math.min(1, stage.clientWidth / width);
|
||||
frame.style.width = width + 'px';
|
||||
const height = doc.documentElement.scrollHeight;
|
||||
frame.style.height = height + 'px';
|
||||
frame.style.transform = 'scale(' + scale + ')';
|
||||
stage.style.height = Math.ceil(height * scale) + 'px';
|
||||
};
|
||||
fit();
|
||||
try {
|
||||
const doc = frame.contentDocument;
|
||||
doc.fonts?.ready.then(fit);
|
||||
doc.querySelectorAll('img').forEach((img) => img.complete || img.addEventListener('load', fit, { once: true }));
|
||||
if (window.ResizeObserver) {
|
||||
new ResizeObserver(fit).observe(doc.body);
|
||||
new ResizeObserver(fit).observe(stage);
|
||||
}
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
window.lufFitPreview = window.lufFitPreview || function (frame) {
|
||||
const max = 352;
|
||||
const max = 448;
|
||||
const fit = () => {
|
||||
const doc = frame.contentDocument;
|
||||
if (!doc || !doc.documentElement) return;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
{{--
|
||||
Live-Vorschau im Bearbeitungsdialog eines Widgets. Gerendert wird mit derselben Widget-Ansicht wie auf der
|
||||
öffentlichen Seite (WidgetEditor::renderPreview), in einer festen logischen Breite und auf die Dialogbreite
|
||||
verkleinert. So greifen die Container-Abfragen der Widgets wie auf der Website.
|
||||
--}}
|
||||
@php
|
||||
$document = '<!DOCTYPE html><html lang="de"><head><meta charset="utf-8"><base target="_blank">'
|
||||
.$stylesheets
|
||||
.'<style>html,body{background:#fff;overflow:hidden}html{scrollbar-gutter:auto}body{margin:0;padding:0;min-height:0}main{display:block}</style>'
|
||||
.'</head><body><main class="sheet-preview"><div class="section-slot">'.$html.'</div></main></body></html>';
|
||||
@endphp
|
||||
<div class="luf-live-preview">
|
||||
<p class="luf-live-preview-caption">Vorschau bei {{ $width }} px Platzbreite, verkleinert. Gleiche Darstellung wie auf der Website.</p>
|
||||
@if (trim($html) === '')
|
||||
<p class="luf-widget-preview-empty">Dieses Widget zeigt mit den aktuellen Angaben öffentlich nichts an.</p>
|
||||
@else
|
||||
<div class="luf-live-preview-stage" wire:key="live-preview-{{ md5($document) }}-{{ $width }}">
|
||||
<iframe
|
||||
class="luf-live-preview-frame"
|
||||
title="Live-Vorschau des Widgets"
|
||||
tabindex="-1"
|
||||
scrolling="no"
|
||||
data-width="{{ $width }}"
|
||||
srcdoc="{{ $document }}"
|
||||
onload="window.lufLivePreview && window.lufLivePreview(this)"
|
||||
></iframe>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@@ -1,52 +1,45 @@
|
||||
{{--
|
||||
Einstieg (Hero). Varianten:
|
||||
- standard: Text neben dem Bild (ältere Instanzen unverändert gültig)
|
||||
- highlight: dunkle Markenfläche
|
||||
- stage: Markenbühne, Bild über die volle Breite, Text auf heller Tafel (randlos, wenn allein im Abschnitt)
|
||||
- editorial: textbetonter Einstieg, Bild optional als breites Band darunter
|
||||
Das Bild des ersten Widgets wird sofort geladen (größtes Element), alle anderen verzögert.
|
||||
Premium-Einstieg (Brand-UI-Kit v1.6, Komponente lf-hero), angepasst an die Widget-Hülle der Registry.
|
||||
Varianten: photo_split (Foto mit heller Textfläche), editorial_solid (Navy-Markenfläche ohne Foto).
|
||||
Höhen compact/normal/large sind Mindesthöhen ab 860 px Containerbreite; darunter Sicherheitsumbruch.
|
||||
Das Bild des ersten Widgets der Seite wird sofort geladen, alle anderen verzögert.
|
||||
--}}
|
||||
@php
|
||||
$variant = in_array($variant, ['standard', 'highlight', 'stage', 'editorial'], true) ? $variant : 'standard';
|
||||
$headingTag = ! empty($first) ? 'h1' : 'h2';
|
||||
$layout = $variant === 'editorial_solid' ? 'editorial-solid' : 'photo-split';
|
||||
$heightClass = in_array($height, ['compact', 'normal', 'large'], true) ? $height : 'normal';
|
||||
$tag = \App\Domain\Cms\Widgets\Support\PremiumFields::headingTag($settings, ! empty($first));
|
||||
$loading = ! empty($first) ? 'loading="eager" fetchpriority="high"' : 'loading="lazy"';
|
||||
@endphp
|
||||
<div @class([
|
||||
'hero',
|
||||
'hero-'.$variant,
|
||||
'hero-with-image' => $imageUrl,
|
||||
'hero-text-left' => $variant === 'stage' && $textSide === 'left',
|
||||
]) style="--hero-focus: {{ $focus }}">
|
||||
@if ($imageUrl && $variant === 'stage')
|
||||
<div class="hero-media">
|
||||
<img class="hero-image" src="{{ $imageUrl }}" alt="{{ $data['alt'] ?? '' }}" {!! $loading !!} decoding="async">
|
||||
</div>
|
||||
@endif
|
||||
<div class="hero-frame">
|
||||
<div class="hero-copy">
|
||||
@if ($variant === 'stage' || $variant === 'highlight')
|
||||
<x-brand.rays class="hero-rays" />
|
||||
@endif
|
||||
<{{ $headingTag }}>{{ $data['heading'] ?? '' }}</{{ $headingTag }}>
|
||||
<x-brand.underline class="hero-mark" />
|
||||
@if (filled($data['text'] ?? null))
|
||||
<p class="lede">{{ $data['text'] }}</p>
|
||||
@endif
|
||||
@if ($actions !== [])
|
||||
<div class="hero-actions">
|
||||
@foreach ($actions as $index => $item)
|
||||
<a @class(['button', 'button-brand' => $index === 0, 'button-secondary' => $index > 0]) href="{{ $item['url'] }}">{{ $item['label'] }}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
<div class="lf-hero-host">
|
||||
<div class="lf-hero lf-hero--{{ $layout }} lf-hero--height-{{ $heightClass }} lf-hero--accent-{{ $accent }}"
|
||||
style="--lf-hero-focus-x: {{ $focus['x'] }}%; --lf-hero-focus-y: {{ $focus['y'] }}%">
|
||||
@if ($layout === 'photo-split' && $imageUrl)
|
||||
<img class="lf-hero__photo" src="{{ $imageUrl }}" alt="{{ $data['alt'] ?? '' }}" {!! $loading !!} decoding="async">
|
||||
@endif
|
||||
<div class="lf-hero__inner">
|
||||
<div class="lf-hero__copy">
|
||||
@if ($accent === 'rays')
|
||||
<x-brand.rays class="lf-hero__rays" />
|
||||
@endif
|
||||
@if (filled($data['eyebrow'] ?? null))
|
||||
<p class="lf-hero__eyebrow">{{ $data['eyebrow'] }}</p>
|
||||
@endif
|
||||
<{{ $tag }} class="lf-hero__title">{{ $data['heading'] ?? '' }}</{{ $tag }}>
|
||||
@if ($accent !== 'none')
|
||||
<span class="lf-hero__title-accent" aria-hidden="true"></span>
|
||||
@endif
|
||||
@if (filled($data['text'] ?? null))
|
||||
<p class="lf-hero__description">{{ $data['text'] }}</p>
|
||||
@endif
|
||||
@if ($actions !== [])
|
||||
<div class="lf-hero__actions">
|
||||
@foreach ($actions as $index => $item)
|
||||
<a @class(['lf-hero__button', 'lf-hero__button--primary' => $index === 0, 'lf-hero__button--secondary' => $index > 0]) href="{{ $item['url'] }}">{{ $item['label'] }}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<span class="lf-hero__bottom" aria-hidden="true"></span>
|
||||
</div>
|
||||
@if ($imageUrl && $variant !== 'stage')
|
||||
<figure class="hero-figure">
|
||||
<img class="hero-image" src="{{ $imageUrl }}" alt="{{ $data['alt'] ?? '' }}" {!! $loading !!} decoding="async">
|
||||
@if ($variant === 'standard')
|
||||
<x-brand.rays class="hero-rays" />
|
||||
@endif
|
||||
</figure>
|
||||
@endif
|
||||
</div>
|
||||
@@ -1,19 +1,47 @@
|
||||
{{-- Bild und Text. Varianten: image_left, image_right. Einstellungen: Bildformat und Bildausschnitt. --}}
|
||||
<div class="image-text image-text-{{ $variant === 'image_right' ? 'right' : 'left' }} @unless ($imageUrl) image-text-no-image @endunless image-format-{{ $format }}" style="--image-focus: {{ $focus }}">
|
||||
@if ($imageUrl)
|
||||
<figure class="image-text-figure">
|
||||
<img src="{{ $imageUrl }}" alt="{{ $data['alt'] ?? '' }}" @if (! empty($first)) loading="eager" fetchpriority="high" @else loading="lazy" @endif decoding="async">
|
||||
</figure>
|
||||
@endif
|
||||
<div class="image-text-copy">
|
||||
@if (filled($data['title'] ?? null))
|
||||
@if (! empty($first))
|
||||
<h1>{{ $data['title'] }}</h1>
|
||||
@else
|
||||
<h2>{{ $data['title'] }}</h2>
|
||||
{{--
|
||||
Premium-Bild-und-Text (Brand-UI-Kit v1.6, Komponente lf-bild-text), angepasst an die Widget-Hülle der Registry.
|
||||
Darstellung nach tatsächlicher Containerbreite: unter 540 px gestapelt, 540–899 px flacher Bildstreifen,
|
||||
ab 900 px zweispaltig mit Bild links oder rechts (Variante). Die Höhe ändert Bildproportion und Abstände,
|
||||
nie die zulässige Textmenge. Der Text ist bereits bereinigter formatierter Text (RichText::sanitize).
|
||||
--}}
|
||||
@php
|
||||
$side = $variant === 'image_left' ? 'left' : 'right';
|
||||
$heightClass = in_array($height, ['compact', 'normal', 'spacious'], true) ? $height : 'normal';
|
||||
$tag = \App\Domain\Cms\Widgets\Support\PremiumFields::headingTag($settings, ! empty($first));
|
||||
@endphp
|
||||
<div class="lf-bt-host">
|
||||
<div @class([
|
||||
'lf-bt',
|
||||
'lf-bt--'.$surface,
|
||||
'lf-bt--image-'.$side,
|
||||
'lf-bt--height-'.$heightClass,
|
||||
'lf-bt--without-image' => ! $imageUrl,
|
||||
]) style="--bt-focus-x: {{ $focus['x'] }}%; --bt-focus-y: {{ $focus['y'] }}%">
|
||||
<div class="lf-bt__copy">
|
||||
@if (filled($data['eyebrow'] ?? null))
|
||||
<p class="lf-bt__eyebrow">{{ $data['eyebrow'] }}</p>
|
||||
@endif
|
||||
<x-brand.underline class="image-text-mark" />
|
||||
@if (filled($data['title'] ?? null))
|
||||
<{{ $tag }} class="lf-bt__headline">{{ $data['title'] }}</{{ $tag }}>
|
||||
<span class="lf-bt__accent" aria-hidden="true"></span>
|
||||
@endif
|
||||
<div class="lf-bt__body">{!! $body !!}</div>
|
||||
@if ($actions !== [])
|
||||
<div class="lf-bt__actions">
|
||||
@foreach ($actions as $index => $item)
|
||||
@if ($index === 0)
|
||||
<a class="lf-bt__button" href="{{ $item['url'] }}">{{ $item['label'] }} <span aria-hidden="true">→</span></a>
|
||||
@else
|
||||
<a class="lf-bt__button lf-bt__button--secondary" href="{{ $item['url'] }}">{{ $item['label'] }}</a>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if ($imageUrl)
|
||||
<div class="lf-bt__media">
|
||||
<img class="lf-bt__image" src="{{ $imageUrl }}" alt="{{ $data['alt'] ?? '' }}" @if (! empty($first)) loading="eager" fetchpriority="high" @else loading="lazy" @endif decoding="async">
|
||||
</div>
|
||||
@endif
|
||||
<div class="prose">{!! $body !!}</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user