This commit is contained in:
2026-01-27 01:53:16 +01:00
parent 527eb81971
commit 02057ad698
3 changed files with 30 additions and 1 deletions

View File

@@ -436,6 +436,17 @@
if (!editor || !editor.Canvas || !editor.Canvas.getBody) return;
const logComponentInput = (model, label) => {
try {
// Force-sync direct edits from view -> model before logging.
const viewEl = model && model.view && model.view.el ? model.view.el : null;
if (model && model.get && viewEl && !model.__bridgeUiSyncing) {
const viewHtml = String(viewEl.innerHTML || '').trim();
const modelHtml = String(model.get('content') || '').trim();
if (viewHtml && viewHtml !== modelHtml) {
model.__bridgeUiSyncing = true;
try { model.set('content', viewHtml); } catch {}
model.__bridgeUiSyncing = false;
}
}
const selectedEl = model && model.view && model.view.el;
const viewOuter = selectedEl ? String(selectedEl.outerHTML || '') : '';
const modelContent = model && model.get ? String(model.get('content') || '') : '';
@@ -450,6 +461,16 @@
editorHtmlLen: editorHtml.length,
editorHtml: editorHtml.slice(0, 1000),
});
if (label === 'DESELECT' && model && model.get && model.get('type') === 'text') {
const viewHtml = selectedEl ? String(selectedEl.innerHTML || '') : '';
console.warn('[EDIT SUMMARY]', {
source: 'ui',
modelId: model && (model.getId ? model.getId() : model.get && model.get('id')),
modelContentLen: modelContent.length,
viewHtmlLen: viewHtml.length,
editorHtmlLen: editorHtml.length,
});
}
} catch {}
};
if (!editor.__bridgeUiEditDebugBound) {