asdas
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user