@sequent-org/moodboard 1.2.118 → 1.3.0
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 +11 -1
- package/src/assets/icons/rotate-icon.svg +1 -1
- package/src/core/HistoryManager.js +16 -16
- package/src/core/KeyboardManager.js +48 -539
- package/src/core/PixiEngine.js +9 -9
- package/src/core/SaveManager.js +56 -31
- package/src/core/bootstrap/CoreInitializer.js +65 -0
- package/src/core/commands/DeleteObjectCommand.js +8 -0
- package/src/core/commands/GroupDeleteCommand.js +75 -0
- package/src/core/commands/GroupRotateCommand.js +6 -0
- package/src/core/commands/UpdateContentCommand.js +52 -0
- package/src/core/commands/UpdateFramePropertiesCommand.js +98 -0
- package/src/core/commands/UpdateFrameTypeCommand.js +85 -0
- package/src/core/commands/UpdateNoteStyleCommand.js +88 -0
- package/src/core/commands/UpdateTextStyleCommand.js +90 -0
- package/src/core/commands/index.js +6 -0
- package/src/core/events/Events.js +7 -0
- package/src/core/flows/ClipboardFlow.js +553 -0
- package/src/core/flows/LayerAndViewportFlow.js +283 -0
- package/src/core/flows/ObjectLifecycleFlow.js +336 -0
- package/src/core/flows/SaveFlow.js +34 -0
- package/src/core/flows/TransformFlow.js +277 -0
- package/src/core/flows/TransformFlowResizeHelpers.js +83 -0
- package/src/core/index.js +41 -1765
- package/src/core/keyboard/KeyboardClipboardImagePaste.js +190 -0
- package/src/core/keyboard/KeyboardContextGuards.js +35 -0
- package/src/core/keyboard/KeyboardEventRouter.js +92 -0
- package/src/core/keyboard/KeyboardSelectionActions.js +103 -0
- package/src/core/keyboard/KeyboardShortcutMap.js +31 -0
- package/src/core/keyboard/KeyboardToolSwitching.js +26 -0
- package/src/core/rendering/ObjectRenderer.js +3 -7
- package/src/grid/BaseGrid.js +26 -0
- package/src/grid/CrossGrid.js +7 -6
- package/src/grid/DotGrid.js +89 -33
- package/src/grid/DotGridZoomPhases.js +42 -0
- package/src/grid/LineGrid.js +22 -21
- package/src/moodboard/MoodBoard.js +31 -532
- package/src/moodboard/bootstrap/MoodBoardInitializer.js +47 -0
- package/src/moodboard/bootstrap/MoodBoardManagersFactory.js +38 -0
- package/src/moodboard/bootstrap/MoodBoardUiFactory.js +109 -0
- package/src/moodboard/integration/MoodBoardEventBindings.js +65 -0
- package/src/moodboard/integration/MoodBoardLoadApi.js +82 -0
- package/src/moodboard/integration/MoodBoardScreenshotApi.js +33 -0
- package/src/moodboard/integration/MoodBoardScreenshotCanvas.js +98 -0
- package/src/moodboard/lifecycle/MoodBoardDestroyer.js +97 -0
- package/src/objects/FileObject.js +17 -6
- package/src/objects/FrameObject.js +50 -10
- package/src/objects/NoteObject.js +5 -4
- package/src/services/BoardService.js +42 -2
- package/src/services/FrameService.js +83 -42
- package/src/services/ResizePolicyService.js +152 -0
- package/src/services/SettingsApplier.js +7 -2
- package/src/services/ZoomPanController.js +35 -9
- package/src/tools/ToolManager.js +30 -537
- package/src/tools/board-tools/PanTool.js +5 -11
- package/src/tools/manager/ToolActivationController.js +49 -0
- package/src/tools/manager/ToolEventRouter.js +396 -0
- package/src/tools/manager/ToolManagerGuards.js +33 -0
- package/src/tools/manager/ToolManagerLifecycle.js +110 -0
- package/src/tools/manager/ToolRegistry.js +33 -0
- package/src/tools/object-tools/DrawingTool.js +48 -14
- package/src/tools/object-tools/PlacementTool.js +50 -1049
- package/src/tools/object-tools/PlacementToolV2.js +88 -0
- package/src/tools/object-tools/SelectTool.js +174 -2681
- package/src/tools/object-tools/placement/GhostController.js +504 -0
- package/src/tools/object-tools/placement/PlacementCoordinateResolver.js +20 -0
- package/src/tools/object-tools/placement/PlacementEventsBridge.js +91 -0
- package/src/tools/object-tools/placement/PlacementInputRouter.js +267 -0
- package/src/tools/object-tools/placement/PlacementPayloadFactory.js +111 -0
- package/src/tools/object-tools/placement/PlacementSessionStore.js +18 -0
- package/src/tools/object-tools/selection/BoxSelectController.js +0 -5
- package/src/tools/object-tools/selection/CloneFlowController.js +71 -0
- package/src/tools/object-tools/selection/CoordinateMapper.js +10 -0
- package/src/tools/object-tools/selection/CursorController.js +78 -0
- package/src/tools/object-tools/selection/FileNameInlineEditorController.js +184 -0
- package/src/tools/object-tools/selection/HitTestService.js +102 -0
- package/src/tools/object-tools/selection/InlineEditorController.js +24 -0
- package/src/tools/object-tools/selection/InlineEditorDomFactory.js +50 -0
- package/src/tools/object-tools/selection/InlineEditorListenersRegistry.js +14 -0
- package/src/tools/object-tools/selection/InlineEditorPositioningService.js +25 -0
- package/src/tools/object-tools/selection/NoteInlineEditorController.js +113 -0
- package/src/tools/object-tools/selection/SelectInputRouter.js +267 -0
- package/src/tools/object-tools/selection/SelectToolLifecycleController.js +128 -0
- package/src/tools/object-tools/selection/SelectToolSetup.js +134 -0
- package/src/tools/object-tools/selection/SelectionOverlayService.js +81 -0
- package/src/tools/object-tools/selection/SelectionStateController.js +91 -0
- package/src/tools/object-tools/selection/TextEditorDomFactory.js +65 -0
- package/src/tools/object-tools/selection/TextEditorInteractionController.js +266 -0
- package/src/tools/object-tools/selection/TextEditorLifecycleRegistry.js +90 -0
- package/src/tools/object-tools/selection/TextEditorPositioningService.js +158 -0
- package/src/tools/object-tools/selection/TextEditorSyncService.js +110 -0
- package/src/tools/object-tools/selection/TextInlineEditorController.js +457 -0
- package/src/tools/object-tools/selection/TransformInteractionController.js +466 -0
- package/src/ui/FilePropertiesPanel.js +61 -32
- package/src/ui/FramePropertiesPanel.js +176 -101
- package/src/ui/HtmlHandlesLayer.js +121 -976
- package/src/ui/MapPanel.js +12 -7
- package/src/ui/NotePropertiesPanel.js +17 -2
- package/src/ui/TextPropertiesPanel.js +124 -738
- package/src/ui/Toolbar.js +71 -1180
- package/src/ui/Topbar.js +23 -25
- package/src/ui/ZoomPanel.js +16 -5
- package/src/ui/handles/GroupSelectionHandlesController.js +29 -0
- package/src/ui/handles/HandlesDomRenderer.js +278 -0
- package/src/ui/handles/HandlesEventBridge.js +102 -0
- package/src/ui/handles/HandlesInteractionController.js +772 -0
- package/src/ui/handles/HandlesPositioningService.js +206 -0
- package/src/ui/handles/SingleSelectionHandlesController.js +22 -0
- package/src/ui/styles/toolbar.css +2 -0
- package/src/ui/styles/workspace.css +13 -6
- package/src/ui/text-properties/TextPropertiesPanelBindings.js +92 -0
- package/src/ui/text-properties/TextPropertiesPanelEventBridge.js +77 -0
- package/src/ui/text-properties/TextPropertiesPanelMapper.js +173 -0
- package/src/ui/text-properties/TextPropertiesPanelRenderer.js +434 -0
- package/src/ui/text-properties/TextPropertiesPanelState.js +39 -0
- package/src/ui/toolbar/ToolbarActionRouter.js +193 -0
- package/src/ui/toolbar/ToolbarDialogsController.js +186 -0
- package/src/ui/toolbar/ToolbarPopupsController.js +662 -0
- package/src/ui/toolbar/ToolbarRenderer.js +97 -0
- package/src/ui/toolbar/ToolbarStateController.js +79 -0
- package/src/ui/toolbar/ToolbarTooltipController.js +52 -0
- package/src/utils/emojiLoaderNoBundler.js +1 -1
package/src/ui/MapPanel.js
CHANGED
|
@@ -35,22 +35,20 @@ export class MapPanel {
|
|
|
35
35
|
this.eventBus.emit(Events.UI.MapToggle);
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
document.addEventListener('mousedown', (e) => {
|
|
38
|
+
this._onDocMouseDown = (e) => {
|
|
40
39
|
if (!this.popupEl) return;
|
|
41
|
-
// ИСПРАВЛЕНИЕ: Защита от null элементов
|
|
42
40
|
if (!this.element || !e.target) return;
|
|
43
41
|
if (this.element.contains(e.target)) return;
|
|
44
42
|
this.hidePopup();
|
|
45
|
-
}
|
|
43
|
+
};
|
|
44
|
+
document.addEventListener('mousedown', this._onDocMouseDown);
|
|
46
45
|
|
|
47
46
|
// Колесо для зума внутри миникарты
|
|
48
47
|
this.element.addEventListener('wheel', (e) => {
|
|
49
48
|
if (!this.popupEl) return;
|
|
50
|
-
// ИСПРАВЛЕНИЕ: Защита от null элементов
|
|
51
49
|
if (!this.popupEl || !e.target || !this.popupEl.contains(e.target)) return;
|
|
50
|
+
if (!this.canvas) return;
|
|
52
51
|
e.preventDefault();
|
|
53
|
-
// Масштабируем вокруг точки под курсором в миникарте
|
|
54
52
|
const rect = this.canvas.getBoundingClientRect();
|
|
55
53
|
const mx = e.clientX - rect.left;
|
|
56
54
|
const my = e.clientY - rect.top;
|
|
@@ -68,6 +66,11 @@ export class MapPanel {
|
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
destroy() {
|
|
69
|
+
if (this._onDocMouseDown) {
|
|
70
|
+
document.removeEventListener('mousedown', this._onDocMouseDown);
|
|
71
|
+
this._onDocMouseDown = null;
|
|
72
|
+
}
|
|
73
|
+
this.hidePopup();
|
|
71
74
|
if (this.element) this.element.remove();
|
|
72
75
|
this.element = null;
|
|
73
76
|
}
|
|
@@ -135,7 +138,7 @@ export class MapPanel {
|
|
|
135
138
|
}
|
|
136
139
|
|
|
137
140
|
layoutCanvas() {
|
|
138
|
-
if (!this.popupEl || !this.canvas) return;
|
|
141
|
+
if (!this.popupEl || !this.canvas || !this.ctx) return;
|
|
139
142
|
const rect = this.popupEl.getBoundingClientRect();
|
|
140
143
|
const dpr = window.devicePixelRatio || 1;
|
|
141
144
|
this.canvas.width = Math.max(10, Math.floor(rect.width * dpr));
|
|
@@ -147,9 +150,11 @@ export class MapPanel {
|
|
|
147
150
|
|
|
148
151
|
// Обратное преобразование: миникарта -> мир (используем bbox объектов)
|
|
149
152
|
miniToWorld(miniX, miniY) {
|
|
153
|
+
if (!this.canvas) return { worldX: 0, worldY: 0 };
|
|
150
154
|
const req = {};
|
|
151
155
|
this.eventBus.emit(Events.UI.MinimapGetData, req);
|
|
152
156
|
const { view, objects } = req;
|
|
157
|
+
if (!view) return { worldX: 0, worldY: 0 };
|
|
153
158
|
// Рассчитываем bbox по объектам
|
|
154
159
|
let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
|
|
155
160
|
if (objects && objects.length > 0) {
|
|
@@ -52,6 +52,15 @@ export class NotePropertiesPanel {
|
|
|
52
52
|
this.hide();
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
+
|
|
56
|
+
// Синхронизируем контролы при изменении объекта (undo/redo, команды)
|
|
57
|
+
this._onStateChanged = (data) => {
|
|
58
|
+
const { objectId } = data;
|
|
59
|
+
if (this.currentId && objectId === this.currentId && this.panel && this.panel.style.display !== 'none') {
|
|
60
|
+
this._updateControlsFromObject();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
this.eventBus.on(Events.Object.StateChanged, this._onStateChanged);
|
|
55
64
|
}
|
|
56
65
|
|
|
57
66
|
updateFromSelection() {
|
|
@@ -207,6 +216,7 @@ export class NotePropertiesPanel {
|
|
|
207
216
|
});
|
|
208
217
|
|
|
209
218
|
const fontSelect = document.createElement('select');
|
|
219
|
+
fontSelect.className = 'font-select';
|
|
210
220
|
Object.assign(fontSelect.style, {
|
|
211
221
|
border: '1px solid #ddd',
|
|
212
222
|
borderRadius: '4px',
|
|
@@ -299,6 +309,7 @@ export class NotePropertiesPanel {
|
|
|
299
309
|
|
|
300
310
|
const fontSizeInput = document.createElement('input');
|
|
301
311
|
fontSizeInput.type = 'number';
|
|
312
|
+
fontSizeInput.className = 'font-size-input';
|
|
302
313
|
fontSizeInput.min = '8';
|
|
303
314
|
fontSizeInput.max = '32';
|
|
304
315
|
fontSizeInput.value = '16';
|
|
@@ -396,6 +407,7 @@ export class NotePropertiesPanel {
|
|
|
396
407
|
|
|
397
408
|
colors.forEach(color => {
|
|
398
409
|
const colorSwatch = document.createElement('div');
|
|
410
|
+
colorSwatch.dataset.colorValue = color.hex;
|
|
399
411
|
Object.assign(colorSwatch.style, {
|
|
400
412
|
width: '22px',
|
|
401
413
|
height: '22px',
|
|
@@ -584,9 +596,12 @@ export class NotePropertiesPanel {
|
|
|
584
596
|
}
|
|
585
597
|
|
|
586
598
|
destroy() {
|
|
587
|
-
|
|
599
|
+
if (this._onStateChanged && this.eventBus?.off) {
|
|
600
|
+
this.eventBus.off(Events.Object.StateChanged, this._onStateChanged);
|
|
601
|
+
this._onStateChanged = null;
|
|
602
|
+
}
|
|
588
603
|
document.removeEventListener('click', this._documentClickHandler.bind(this));
|
|
589
|
-
|
|
604
|
+
|
|
590
605
|
if (this.panel && this.panel.parentNode) {
|
|
591
606
|
this.panel.parentNode.removeChild(this.panel);
|
|
592
607
|
}
|