@sequent-org/moodboard 1.4.4 → 1.4.6

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.
Files changed (34) hide show
  1. package/package.json +1 -1
  2. package/src/core/ApiClient.js +30 -86
  3. package/src/core/HistoryManager.js +0 -102
  4. package/src/core/SaveManager.js +27 -0
  5. package/src/core/commands/CreateObjectCommand.js +1 -9
  6. package/src/core/commands/DeleteObjectCommand.js +19 -88
  7. package/src/core/commands/EditFileNameCommand.js +1 -2
  8. package/src/core/commands/GroupDeleteCommand.js +11 -44
  9. package/src/core/commands/GroupMoveCommand.js +1 -26
  10. package/src/core/commands/GroupReorderZCommand.js +1 -2
  11. package/src/core/commands/GroupResizeCommand.js +1 -4
  12. package/src/core/commands/GroupRotateCommand.js +1 -9
  13. package/src/core/commands/MindmapStatePatchCommand.js +1 -1
  14. package/src/core/commands/MoveObjectCommand.js +1 -3
  15. package/src/core/commands/PasteObjectCommand.js +1 -10
  16. package/src/core/commands/ReorderZCommand.js +1 -1
  17. package/src/core/commands/ResizeObjectCommand.js +1 -3
  18. package/src/core/commands/RotateObjectCommand.js +1 -9
  19. package/src/core/commands/UpdateContentCommand.js +1 -1
  20. package/src/core/commands/UpdateFramePropertiesCommand.js +1 -1
  21. package/src/core/commands/UpdateFrameTypeCommand.js +1 -1
  22. package/src/core/commands/UpdateNoteStyleCommand.js +1 -1
  23. package/src/core/commands/UpdateTextStyleCommand.js +1 -1
  24. package/src/core/events/Events.js +0 -2
  25. package/src/core/flows/ClipboardFlow.js +50 -14
  26. package/src/core/flows/SaveFlow.js +5 -0
  27. package/src/core/index.js +32 -0
  28. package/src/core/keyboard/KeyboardClipboardImagePaste.js +6 -30
  29. package/src/services/FileUploadService.js +2 -2
  30. package/src/services/ImageUploadService.js +2 -2
  31. package/src/tools/manager/ToolEventRouter.js +34 -74
  32. package/src/tools/object-tools/PlacementTool.js +5 -29
  33. package/src/tools/object-tools/placement/PlacementInputRouter.js +1 -6
  34. package/src/tools/object-tools/placement/PlacementPayloadFactory.js +0 -29
@@ -225,18 +225,8 @@ export class PlacementTool extends BaseTool {
225
225
 
226
226
  } catch (uploadError) {
227
227
  console.error('Ошибка загрузки файла на сервер:', uploadError);
228
- // Fallback: создаем объект файла с локальными данными
229
- this.payloadFactory.emitFileFallback(
230
- position,
231
- this.selectedFile.fileName,
232
- this.selectedFile.fileSize,
233
- this.selectedFile.mimeType,
234
- props.width || 120,
235
- props.height || 140
236
- );
237
-
238
- // Показываем предупреждение пользователю
239
- alert('Ошибка загрузки файла на сервер. Файл добавлен локально.');
228
+ // Строгий режим: локальное сохранение файлов запрещено.
229
+ alert('Ошибка загрузки файла на сервер. Файл не добавлен.');
240
230
  }
241
231
 
242
232
  // Убираем призрак и возвращаемся к инструменту выделения
@@ -341,23 +331,9 @@ export class PlacementTool extends BaseTool {
341
331
 
342
332
  } catch (uploadError) {
343
333
  console.error('Ошибка загрузки изображения на сервер:', uploadError);
344
-
345
- // Fallback: создаем объект изображения с локальными данными
346
- const imageUrl = URL.createObjectURL(this.selectedImage.file);
347
- const targetW = this.selectedImage.properties.width || 300;
348
- const targetH = this.selectedImage.properties.height || 200;
349
-
350
- const halfW = targetW / 2;
351
- const halfH = targetH / 2;
352
- const position = {
353
- x: Math.round(worldPoint.x - halfW),
354
- y: Math.round(worldPoint.y - halfH)
355
- };
356
-
357
- this.payloadFactory.emitImageFallback(position, imageUrl, this.selectedImage.fileName, targetW, targetH, objectType, extraProperties);
358
-
359
- // Показываем предупреждение пользователю
360
- alert('Ошибка загрузки изображения на сервер. Изображение добавлено локально.');
334
+
335
+ // Строгий режим: локальное сохранение изображений запрещено.
336
+ alert('Ошибка загрузки изображения на сервер. Изображение не добавлено.');
361
337
  }
362
338
 
363
339
  // Убираем призрак и возвращаемся к инструменту выделения
@@ -227,13 +227,8 @@ export class PlacementInputRouter {
227
227
  host.eventBus.emit(Events.Keyboard.ToolSelect, { tool: 'select' });
228
228
  } catch (uploadError) {
229
229
  console.error('Ошибка загрузки файла на сервер:', uploadError);
230
- const fileName = file.name;
231
- const fileSize = file.size;
232
- const mimeType = file.type;
233
-
234
- host.payloadFactory.emitFileFallback(position, fileName, fileSize, mimeType, props.width || 120, props.height || 140);
235
230
  host.eventBus.emit(Events.Keyboard.ToolSelect, { tool: 'select' });
236
- alert('Ошибка загрузки файла на сервер. Файл добавлен локально.');
231
+ alert('Ошибка загрузки файла на сервер. Файл не добавлен.');
237
232
  }
238
233
  } catch (error) {
239
234
  console.error('Ошибка при выборе файла:', error);
@@ -63,21 +63,6 @@ export class PlacementPayloadFactory {
63
63
  });
64
64
  }
65
65
 
66
- emitImageFallback(position, imageUrl, fileName, width, height, objectType = 'image', extraProperties = {}) {
67
- this.host.eventBus.emit(Events.UI.ToolbarAction, {
68
- type: objectType,
69
- id: objectType,
70
- position,
71
- properties: {
72
- src: imageUrl,
73
- name: fileName,
74
- width,
75
- height,
76
- ...extraProperties
77
- }
78
- });
79
- }
80
-
81
66
  emitFileUploaded(position, uploadResult, width, height) {
82
67
  this.host.eventBus.emit(Events.UI.ToolbarAction, {
83
68
  type: 'file',
@@ -96,18 +81,4 @@ export class PlacementPayloadFactory {
96
81
  });
97
82
  }
98
83
 
99
- emitFileFallback(position, fileName, fileSize, mimeType, width, height) {
100
- this.host.eventBus.emit(Events.UI.ToolbarAction, {
101
- type: 'file',
102
- id: 'file',
103
- position,
104
- properties: {
105
- fileName,
106
- fileSize,
107
- mimeType,
108
- width,
109
- height
110
- }
111
- });
112
- }
113
84
  }