Seiten: Bausteine und Vorlagen (0.22.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 5m0s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 5m0s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m50s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m33s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 6m11s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m46s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m24s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m33s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m17s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-27 07:48:02 +00:00
parent 8817727283
commit 2166a7e11a
129 changed files with 1381 additions and 267 deletions

View file

@ -0,0 +1,32 @@
<script setup>
import { computed, inject, provide } from 'vue';
import { Component, PencilLine, TriangleAlert } from '@lucide/vue';
import BlockList from '@/pagebuilder/BlockList.vue';
/**
* Baustein: zeigt den gemeinsamen Inhalt. Im Editor nur als Vorschau mit Rahmen –
* bearbeitet wird der Baustein an einer Stelle (Redaktion → Bausteine & Vorlagen).
*/
const props = defineProps({ block: { type: Object, required: true } });
const editing = inject('pagebuilder:editing', computed(() => false));
// Inhalt des Bausteins ist hier nicht bearbeitbar – auch nicht in verschachtelten Blöcken
provide('pagebuilder:list', BlockList);
provide('pagebuilder:editing', computed(() => false));
const content = computed(() => ({ blocks: props.block.props?.blocks ?? [] }));
</script>
<template>
<div v-if="editing" class="rounded-md border border-dashed border-brand-300 p-3">
<div class="mb-3 flex flex-wrap items-center gap-2 text-xs">
<span class="inline-flex items-center gap-1.5 rounded bg-brand-soft px-2 py-0.5 font-medium text-brand-soft-foreground"><Component class="size-3.5" /> Baustein{{ block.props?.name ? `: ${block.props.name}` : '' }}</span>
<a v-if="block.props?.edit_url" :href="block.props.edit_url" target="_blank" class="inline-flex items-center gap-1 text-brand-text hover:underline" @click.stop><PencilLine class="size-3" /> Baustein bearbeiten</a>
</div>
<p v-if="!block.data.snippet" class="text-sm text-muted-foreground">Bitte rechts einen Baustein auswählen.</p>
<p v-else-if="block.props?.missing" class="flex items-center gap-2 text-sm text-amber-700 dark:text-amber-400"><TriangleAlert class="size-4" /> Dieser Baustein wurde gelöscht und wird nicht angezeigt.</p>
<div v-else class="pointer-events-none"><BlockList :item="content" /></div>
</div>
<BlockList v-else-if="content.blocks.length" :item="content" />
</template>