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