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>
104 lines
6.0 KiB
PHP
104 lines
6.0 KiB
PHP
<style>
|
||
/* Widget-Auswahl */
|
||
.luf-widget-pick { display: flex; gap: .75rem; align-items: flex-start; text-align: start; white-space: normal; }
|
||
.luf-widget-pick-schematic { flex: none; border: 1px solid rgb(0 0 0 / 12%); border-radius: 3px; }
|
||
.luf-widget-pick-text { display: flex; flex-direction: column; gap: .15rem; }
|
||
.luf-widget-pick-name { font-weight: 600; }
|
||
.luf-widget-pick-desc { font-size: .8rem; line-height: 1.3; opacity: .8; }
|
||
.luf-widget-pick-units { font-size: .75rem; line-height: 1.3; opacity: .7; font-style: italic; }
|
||
|
||
/* 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: 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;
|
||
font-size: .75rem; font-weight: 600; text-align: center; color: #15243a;
|
||
background: linear-gradient(to bottom, rgb(255 255 255 / 0), rgb(255 255 255 / .96) 55%);
|
||
}
|
||
.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%); }
|
||
.luf-sections .fi-fo-repeater-item-header-label { font-weight: 600; white-space: normal; }
|
||
|
||
/* Rasterauswahl als grafische Kacheln */
|
||
.luf-layout-picker .fi-btn-group { flex-wrap: wrap; gap: .5rem; }
|
||
.luf-layout-picker .fi-btn { min-height: 3.25rem; padding: .35rem .6rem; border-radius: .5rem !important; }
|
||
.luf-layout-option { display: inline-flex; align-items: center; gap: .5rem; }
|
||
.luf-layout-schematic { fill: currentColor; opacity: .55; }
|
||
.luf-layout-picker .fi-btn[aria-pressed='true'] .luf-layout-schematic,
|
||
.luf-layout-picker input:checked + label .luf-layout-schematic { opacity: 1; }
|
||
.luf-layout-option-text { font-variant-numeric: tabular-nums; font-weight: 600; }
|
||
|
||
/* Plätze im Verhältnis des Desktop-Rasters; auf schmalen Bildschirmen untereinander. */
|
||
.luf-slots > .fi-fo-repeater-items { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1fr); }
|
||
@media (min-width: 64rem) {
|
||
.luf-slots > .fi-fo-repeater-items { grid-template-columns: var(--luf-slot-cols, minmax(0, 1fr)); }
|
||
}
|
||
.luf-slots .fi-fo-repeater-item { background: rgb(247 246 242 / 60%); border-style: dashed; }
|
||
.luf-slots .fi-fo-repeater-item-header { padding-block: .4rem; }
|
||
.luf-slots .fi-fo-repeater-item-header-label { font-size: .8rem; font-weight: 600; }
|
||
.luf-slots .fi-fo-builder-add-action-ctn,
|
||
.luf-slots .fi-fo-builder .fi-fo-builder-add-btn-ctn { justify-content: center; }
|
||
|
||
/* Aktionen gut sichtbar und mit ausreichender Trefferfläche */
|
||
.luf-sections .fi-fo-repeater-item-header .fi-icon-btn,
|
||
.luf-sections .fi-fo-builder-item-header .fi-icon-btn { min-width: 2.25rem; min-height: 2.25rem; opacity: 1; }
|
||
.luf-sections .fi-fo-builder-item-header { flex-wrap: wrap; }
|
||
</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 = 448;
|
||
const fit = () => {
|
||
const doc = frame.contentDocument;
|
||
if (!doc || !doc.documentElement) return;
|
||
const height = doc.documentElement.scrollHeight;
|
||
frame.style.height = Math.min(height, max) + 'px';
|
||
frame.parentElement?.classList.toggle('is-clipped', height > max + 4);
|
||
};
|
||
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);
|
||
} catch (error) {}
|
||
};
|
||
</script>
|