Loheide-eu-mitarbeiterplatt.../resources/js/pagebuilder/blocks/Text.vue
Friederich Loheide 1a54e0c215
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
Leere Textblöcke anklickbar, Startseiten-Slider nach Durchklicken repariert
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 19:17:07 +00:00

24 lines
1 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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>