asd
This commit is contained in:
@@ -1 +1 @@
|
||||
1.1.13
|
||||
1.1.14
|
||||
@@ -425,6 +425,30 @@
|
||||
|
||||
const setupBlurLogger = (editor) => {
|
||||
if (!editor || !editor.Canvas || !editor.Canvas.getBody) return;
|
||||
const logComponentInput = (model, label) => {
|
||||
try {
|
||||
const selectedEl = model && model.view && model.view.el;
|
||||
const viewOuter = selectedEl ? String(selectedEl.outerHTML || '') : '';
|
||||
const modelContent = model && model.get ? String(model.get('content') || '') : '';
|
||||
const editorHtml = editor && typeof editor.getHtml === 'function' ? String(editor.getHtml() || '') : '';
|
||||
console.warn(`[UI EDIT ${label}]`, {
|
||||
modelType: model && model.get ? model.get('type') : undefined,
|
||||
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),
|
||||
});
|
||||
} catch {}
|
||||
};
|
||||
if (!editor.__bridgeUiEditDebugBound) {
|
||||
editor.__bridgeUiEditDebugBound = true;
|
||||
editor.on('component:input', (model) => logComponentInput(model, 'INPUT'));
|
||||
editor.on('component:update', (model) => logComponentInput(model, 'UPDATE'));
|
||||
editor.on('component:deselected', (model) => logComponentInput(model, 'DESELECT'));
|
||||
}
|
||||
editor.on('canvas:frame:load', () => {
|
||||
const body = editor.Canvas && editor.Canvas.getBody && editor.Canvas.getBody();
|
||||
if (!body || body.__bridgeBlurLoggerBound) return;
|
||||
|
||||
Reference in New Issue
Block a user