This commit is contained in:
2026-01-29 00:35:04 +01:00
parent f885e1e775
commit 059a6909b3
2 changed files with 20 additions and 14 deletions

View File

@@ -1 +1 @@
1.1.52
1.1.53

View File

@@ -572,6 +572,9 @@
const setupBlurLogger = (editor) => {
if (!editor || !editor.Canvas || !editor.Canvas.getBody) return;
const DEBUG_UI = !!(B && B.DEBUG_UI);
const DEBUG_UI_SUMMARY = B && typeof B.DEBUG_UI_SUMMARY !== 'undefined'
? !!B.DEBUG_UI_SUMMARY
: true;
const getModelHtmlForLog = (model) => {
if (!model) return '';
let html = '';
@@ -601,7 +604,7 @@
};
const logComponentInput = (model, label) => {
try {
if (!DEBUG_UI) return;
if (!DEBUG_UI && !(DEBUG_UI_SUMMARY && label === 'DESELECT')) return;
const modelType = model && model.get ? model.get('type') : undefined;
let selectedEl = model && model.view && model.view.el;
if (!selectedEl && editor && editor.Canvas && editor.Canvas.getBody) {
@@ -611,20 +614,23 @@
selectedEl = body.querySelector(`#${id}`);
}
}
const viewOuter = selectedEl ? String(selectedEl.outerHTML || '') : '';
const modelContent = String(getModelHtmlForLog(model) || '');
const editorHtml = editor && typeof editor.getHtml === 'function' ? String(editor.getHtml() || '') : '';
console.warn(`[UI EDIT ${label}]`, {
modelType,
modelId: model && (model.getId ? model.getId() : model.get && model.get('id')),
modelContentLen: modelContent.length,
modelContent: modelContent.slice(0, 1000),
viewOuterLen: viewOuter.length,
viewOuter: viewOuter.slice(0, 1000),
editorHtmlLen: editorHtml.length,
editorHtml: editorHtml.slice(0, 1000),
});
if (DEBUG_UI) {
const viewOuter = selectedEl ? String(selectedEl.outerHTML || '') : '';
const editorHtml = editor && typeof editor.getHtml === 'function' ? String(editor.getHtml() || '') : '';
console.warn(`[UI EDIT ${label}]`, {
modelType,
modelId: model && (model.getId ? model.getId() : model.get && model.get('id')),
modelContentLen: modelContent.length,
modelContent: modelContent.slice(0, 1000),
viewOuterLen: viewOuter.length,
viewOuter: viewOuter.slice(0, 1000),
editorHtmlLen: editorHtml.length,
editorHtml: editorHtml.slice(0, 1000),
});
}
if (label === 'DESELECT' && model && model.get && model.get('type') === 'text') {
if (!DEBUG_UI && !DEBUG_UI_SUMMARY) return;
let viewHtml = selectedEl ? String(selectedEl.innerHTML || '') : '';
let visibleText = selectedEl ? String(selectedEl.textContent || '') : '';
if (!viewHtml && selectedEl && modelContent) {