Wire admin studio SSR and search infrastructure

This commit is contained in:
2026-05-01 11:46:06 +02:00
parent 257b0dbef6
commit 18cea8b0f0
329 changed files with 197465 additions and 2741 deletions

View File

@@ -238,6 +238,8 @@ export default function RichTextEditor({
const editor = useEditor({
extensions: [
StarterKit.configure({
link: false,
underline: false,
heading: { levels: [2, 3] },
codeBlock: {
HTMLAttributes: { class: 'forum-code-block' },
@@ -262,6 +264,7 @@ export default function RichTextEditor({
suggestion: mentionSuggestion,
}),
],
immediatelyRender: false,
content,
autofocus,
editorProps: {
@@ -291,6 +294,10 @@ export default function RichTextEditor({
useEffect(() => {
if (editor && content && !editor.getHTML().includes(content.slice(0, 30))) {
editor.commands.setContent(content, false)
// Keep the parent form state in sync with what we just rendered.
// setContent with emitUpdate=false silently resets TipTap without
// calling onUpdate, so form.data.content would lag behind the editor.
onChange?.(content)
}
}, [content]) // eslint-disable-line react-hooks/exhaustive-deps