This commit is contained in:
2025-12-06 01:36:08 +01:00
parent a8aa34baee
commit 9171bec0a5
2 changed files with 18 additions and 11 deletions

View File

@@ -175,7 +175,14 @@
// 1. Daten extrahieren
const htmlContent = editor.getHtml() + '<style>' + editor.getCss() + '</style>';
// 2. KRITISCH: Holt die JSON-Repräsentation des Editors
let jsonProjectDataRaw = '';
try {
const jsonProjectData = editor.getProjectData();
jsonProjectDataRaw = JSON.stringify(jsonProjectData);
} catch (e) {
console.error('[bridge-blocks-api] getProjectData stringify failed', e);
jsonProjectDataRaw = '';
}
const resource = EDITOR_MODE;
const action = `${resource}.update`;
@@ -188,7 +195,7 @@
id: CURRENT_ENTITY_ID,
html: htmlContent,
// 🚨 KRITISCH: Server erwartet das Feld 'json'
json: jsonProjectData,
json: jsonProjectDataRaw,
};
if (B.CURRENT_ENTITY_NAME) {

View File

@@ -10,7 +10,7 @@ $ts = time();
<title>Editor</title>
<link rel="stylesheet" href="../vendor/grapesjs/grapes.min.css" />
<style>
html,body{height:100%}body{margin:0;background:#f8fafc;color:#0f172a}#gjs{height:100vh}
html,body{height:100%}body{margin:0;background:#f8fafc;color:#0f172a;overflow:auto;}#gjs{min-height:100vh}
.gjs-one-bg{background-color:#fff!important}.gjs-two-color{color:#0f172a!important}
.gjs-three-bg{background-color:#f8fafc!important}.gjs-four-color{color:#334155!important}