speichern ohne blur

This commit is contained in:
2026-02-05 03:22:27 +01:00
parent 0918e03780
commit ae6b49c499
2 changed files with 14 additions and 2 deletions

View File

@@ -1 +1 @@
1.2.59
1.2.60

View File

@@ -543,7 +543,8 @@
}
return rawHtml;
};
const htmlContent = serializeHtml() + '<style>' + cssPayload + '</style>';
const htmlBody = serializeHtml();
const htmlContent = htmlBody + '<style>' + cssPayload + '</style>';
// 2. KRITISCH: Holt die JSON-Repräsentation des Editors
let jsonProjectDataRaw = '';
try {
@@ -553,6 +554,17 @@
console.error('[bridge-blocks-api] getProjectData stringify failed', e);
jsonProjectDataRaw = '';
}
// Wenn gerade aktiv editiert wird, JSON durch HTML ersetzen,
// damit der Live-Text ohne Blur gespeichert wird.
try {
const doc = editor.Canvas && editor.Canvas.getDocument ? editor.Canvas.getDocument() : null;
const selectionNode = doc && doc.getSelection ? (doc.getSelection().focusNode || doc.getSelection().anchorNode) : null;
const selectionEl = selectionNode ? (selectionNode.nodeType === 1 ? selectionNode : selectionNode.parentElement) : null;
const isEditable = !!(selectionEl && (selectionEl.isContentEditable || (selectionEl.getAttribute && selectionEl.getAttribute('contenteditable') === 'true')));
if (isEditable && htmlBody) {
jsonProjectDataRaw = htmlBody;
}
} catch {}
const resource = 'content';
const action = `${resource}.update`;