Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 4m6s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m23s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m9s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m59s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m16s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m27s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m35s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m9s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m15s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
24 lines
1 KiB
Vue
24 lines
1 KiB
Vue
<script setup>
|
||
import { defineAsyncComponent, inject, ref } from 'vue';
|
||
|
||
defineProps({ block: { type: Object, required: true } });
|
||
|
||
const editing = inject('pagebuilder:editing', false);
|
||
|
||
// Der Editor (TipTap) wird nur im Pagebuilder geladen, nicht beim Lesen.
|
||
const RichTextEditor = defineAsyncComponent(() => import('@/components/RichTextEditor.vue'));
|
||
const editorRef = ref(null);
|
||
|
||
// Auch ein leerer Block braucht eine Fläche zum Hineinklicken – die Werkzeugleiste
|
||
// des Blocks liegt sonst über der einzigen Zeile.
|
||
function focusEditor(event) {
|
||
if (!event.target.closest('.ProseMirror, [role="toolbar"]')) editorRef.value?.focus();
|
||
}
|
||
</script>
|
||
|
||
<template>
|
||
<div v-if="editing" class="min-h-16 cursor-text pt-3 [&_.tiptap]:min-h-10" @click="focusEditor">
|
||
<RichTextEditor ref="editorRef" v-model="block.data.html" placeholder="Text eingeben …" />
|
||
</div>
|
||
<div v-else class="prose prose-neutral max-w-none prose-headings:tracking-tight prose-img:rounded-lg" v-html="block.data.html" />
|
||
</template>
|