@sequent-org/moodboard 1.2.29 → 1.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/SaveManager.js +35 -0
- package/src/moodboard/MoodBoard.js +15 -0
package/package.json
CHANGED
package/src/core/SaveManager.js
CHANGED
|
@@ -157,6 +157,41 @@ export class SaveManager {
|
|
|
157
157
|
data: saveData,
|
|
158
158
|
timestamp: new Date().toISOString()
|
|
159
159
|
});
|
|
160
|
+
|
|
161
|
+
// Диагностика: по флагу проверяем, что сервер отдает те же размеры на чтение
|
|
162
|
+
try {
|
|
163
|
+
if (typeof window !== 'undefined' && window.MOODBOARD_DEBUG_VERIFY_LOAD === true) {
|
|
164
|
+
const boardId = saveData?.id;
|
|
165
|
+
if (boardId) {
|
|
166
|
+
const verifyUrl = `${this.options.loadEndpoint}/${boardId}`;
|
|
167
|
+
const resp = await fetch(verifyUrl, {
|
|
168
|
+
method: 'GET',
|
|
169
|
+
headers: {
|
|
170
|
+
'Accept': 'application/json',
|
|
171
|
+
'X-Requested-With': 'XMLHttpRequest'
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
if (resp.ok) {
|
|
175
|
+
const result = await resp.json();
|
|
176
|
+
const data = result?.data || result;
|
|
177
|
+
const imgs = Array.isArray(data?.objects) ? data.objects.filter(o => o && o.type === 'image') : [];
|
|
178
|
+
imgs.forEach((o) => {
|
|
179
|
+
console.log('🧪 VERIFY LOAD after save image size', {
|
|
180
|
+
id: o.id,
|
|
181
|
+
width: o.width,
|
|
182
|
+
height: o.height,
|
|
183
|
+
propWidth: o.properties?.width,
|
|
184
|
+
propHeight: o.properties?.height
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
} else {
|
|
188
|
+
console.warn('⚠️ VERIFY LOAD failed:', resp.status, resp.statusText);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
} catch (e) {
|
|
193
|
+
console.warn('⚠️ VERIFY LOAD exception:', e?.message || e);
|
|
194
|
+
}
|
|
160
195
|
} else {
|
|
161
196
|
throw new Error(response.message || 'Ошибка сохранения');
|
|
162
197
|
}
|
|
@@ -374,6 +374,21 @@ export class MoodBoard {
|
|
|
374
374
|
}
|
|
375
375
|
|
|
376
376
|
const boardData = await response.json();
|
|
377
|
+
|
|
378
|
+
// Диагностика: лог размеров изображений прямо из ответа API до любой обработки
|
|
379
|
+
try {
|
|
380
|
+
const objects = (boardData && boardData.data && Array.isArray(boardData.data.objects)) ? boardData.data.objects : [];
|
|
381
|
+
const images = objects.filter(o => o && o.type === 'image');
|
|
382
|
+
images.forEach((o) => {
|
|
383
|
+
console.log('🧪 API LOAD payload image size', {
|
|
384
|
+
id: o.id,
|
|
385
|
+
width: o.width,
|
|
386
|
+
height: o.height,
|
|
387
|
+
propWidth: o.properties?.width,
|
|
388
|
+
propHeight: o.properties?.height
|
|
389
|
+
});
|
|
390
|
+
});
|
|
391
|
+
} catch (_) {}
|
|
377
392
|
|
|
378
393
|
if (boardData && boardData.data) {
|
|
379
394
|
console.log('✅ MoodBoard: данные загружены с сервера', boardData.data);
|