@sequent-org/moodboard 1.2.119 → 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 +6 -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 -1773
- 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 -999
- 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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Events } from '../core/events/Events.js';
|
|
2
|
+
import { UpdateFrameTypeCommand } from '../core/commands/UpdateFrameTypeCommand.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Панель свойств фрейма
|
|
@@ -17,41 +18,67 @@ export class FramePropertiesPanel {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
_attachEvents() {
|
|
20
|
-
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
|
|
25
|
-
// Скрываем панель при удалении объекта
|
|
26
|
-
this.eventBus.on(Events.Object.Deleted, (objectId) => {
|
|
21
|
+
this._handlers = {};
|
|
22
|
+
this._handlers.onSelectionAdd = () => this.updateFromSelection();
|
|
23
|
+
this._handlers.onSelectionRemove = () => this.updateFromSelection();
|
|
24
|
+
this._handlers.onSelectionClear = () => this.hide();
|
|
25
|
+
this._handlers.onDeleted = (objectId) => {
|
|
27
26
|
if (this.currentId && objectId === this.currentId) this.hide();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (tool !== 'select') {
|
|
52
|
-
this.hide();
|
|
27
|
+
};
|
|
28
|
+
this._handlers.onDragStart = () => this.hide();
|
|
29
|
+
this._handlers.onDragUpdate = () => this._repositionThrottled();
|
|
30
|
+
this._handlers.onDragEnd = () => this.updateFromSelection();
|
|
31
|
+
this._handlers.onGroupDragUpdate = () => this._repositionThrottled();
|
|
32
|
+
this._handlers.onGroupDragStart = () => this.hide();
|
|
33
|
+
this._handlers.onGroupDragEnd = () => this.updateFromSelection();
|
|
34
|
+
this._handlers.onResizeUpdate = () => this._repositionThrottled();
|
|
35
|
+
this._handlers.onRotateUpdate = () => this._repositionThrottled();
|
|
36
|
+
this._handlers.onZoomPercent = () => {
|
|
37
|
+
if (this.currentId) this._repositionThrottled();
|
|
38
|
+
};
|
|
39
|
+
this._handlers.onPanUpdate = () => {
|
|
40
|
+
if (this.currentId) this._repositionThrottled();
|
|
41
|
+
};
|
|
42
|
+
this._handlers.onActivated = ({ tool }) => {
|
|
43
|
+
if (tool !== 'select') this.hide();
|
|
44
|
+
};
|
|
45
|
+
this._handlers.onStateChanged = (data) => {
|
|
46
|
+
const { objectId } = data;
|
|
47
|
+
if (this.currentId && objectId === this.currentId && this.panel && this.panel.style.display !== 'none') {
|
|
48
|
+
this._updateControlsFromObject();
|
|
49
|
+
this._syncTypeFromObject();
|
|
53
50
|
}
|
|
54
|
-
}
|
|
51
|
+
};
|
|
52
|
+
this._handlers.onHistoryChanged = () => {
|
|
53
|
+
if (this.currentId && this.panel && this.panel.style.display !== 'none') {
|
|
54
|
+
this._updateControlsFromObject();
|
|
55
|
+
this._syncTypeFromObject();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
this._handlers.onTransformUpdated = (data) => {
|
|
59
|
+
if (this.currentId && data.objectId === this.currentId && this.panel && this.panel.style.display !== 'none') {
|
|
60
|
+
this._repositionThrottled();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
this.eventBus.on(Events.Tool.SelectionAdd, this._handlers.onSelectionAdd);
|
|
65
|
+
this.eventBus.on(Events.Tool.SelectionRemove, this._handlers.onSelectionRemove);
|
|
66
|
+
this.eventBus.on(Events.Tool.SelectionClear, this._handlers.onSelectionClear);
|
|
67
|
+
this.eventBus.on(Events.Object.Deleted, this._handlers.onDeleted);
|
|
68
|
+
this.eventBus.on(Events.Tool.DragStart, this._handlers.onDragStart);
|
|
69
|
+
this.eventBus.on(Events.Tool.DragUpdate, this._handlers.onDragUpdate);
|
|
70
|
+
this.eventBus.on(Events.Tool.DragEnd, this._handlers.onDragEnd);
|
|
71
|
+
this.eventBus.on(Events.Tool.GroupDragUpdate, this._handlers.onGroupDragUpdate);
|
|
72
|
+
this.eventBus.on(Events.Tool.GroupDragStart, this._handlers.onGroupDragStart);
|
|
73
|
+
this.eventBus.on(Events.Tool.GroupDragEnd, this._handlers.onGroupDragEnd);
|
|
74
|
+
this.eventBus.on(Events.Tool.ResizeUpdate, this._handlers.onResizeUpdate);
|
|
75
|
+
this.eventBus.on(Events.Tool.RotateUpdate, this._handlers.onRotateUpdate);
|
|
76
|
+
this.eventBus.on(Events.UI.ZoomPercent, this._handlers.onZoomPercent);
|
|
77
|
+
this.eventBus.on(Events.Tool.PanUpdate, this._handlers.onPanUpdate);
|
|
78
|
+
this.eventBus.on(Events.Tool.Activated, this._handlers.onActivated);
|
|
79
|
+
this.eventBus.on(Events.Object.StateChanged, this._handlers.onStateChanged);
|
|
80
|
+
this.eventBus.on(Events.History.Changed, this._handlers.onHistoryChanged);
|
|
81
|
+
this.eventBus.on(Events.Object.TransformUpdated, this._handlers.onTransformUpdated);
|
|
55
82
|
}
|
|
56
83
|
|
|
57
84
|
updateFromSelection() {
|
|
@@ -117,6 +144,7 @@ export class FramePropertiesPanel {
|
|
|
117
144
|
|
|
118
145
|
this.panel = panel;
|
|
119
146
|
this.container.appendChild(panel);
|
|
147
|
+
this._boundDocumentClickHandler = this._documentClickHandler.bind(this);
|
|
120
148
|
}
|
|
121
149
|
|
|
122
150
|
_updateControlsFromObject() {
|
|
@@ -124,6 +152,18 @@ export class FramePropertiesPanel {
|
|
|
124
152
|
// Здесь будет логика синхронизации контролов с объектом
|
|
125
153
|
}
|
|
126
154
|
|
|
155
|
+
_repositionThrottled() {
|
|
156
|
+
if (this._repositionScheduled) return;
|
|
157
|
+
this._repositionScheduled = true;
|
|
158
|
+
const rafId = requestAnimationFrame(() => {
|
|
159
|
+
this._repositionScheduled = false;
|
|
160
|
+
this._repositionRafId = null;
|
|
161
|
+
if (!this.panel) return;
|
|
162
|
+
this.reposition();
|
|
163
|
+
});
|
|
164
|
+
this._repositionRafId = rafId;
|
|
165
|
+
}
|
|
166
|
+
|
|
127
167
|
reposition() {
|
|
128
168
|
if (!this.panel || !this.currentId || this.panel.style.display === 'none') {
|
|
129
169
|
return;
|
|
@@ -200,11 +240,16 @@ export class FramePropertiesPanel {
|
|
|
200
240
|
outline: 'none'
|
|
201
241
|
});
|
|
202
242
|
|
|
203
|
-
// Обработчик изменения названия
|
|
243
|
+
// Обработчик изменения названия (debounce 200ms)
|
|
244
|
+
this._titleDebounceTimer = null;
|
|
204
245
|
titleInput.addEventListener('input', () => {
|
|
205
|
-
if (this.currentId)
|
|
206
|
-
|
|
207
|
-
|
|
246
|
+
if (!this.currentId) return;
|
|
247
|
+
if (this._titleDebounceTimer) clearTimeout(this._titleDebounceTimer);
|
|
248
|
+
const value = titleInput.value;
|
|
249
|
+
this._titleDebounceTimer = setTimeout(() => {
|
|
250
|
+
this._titleDebounceTimer = null;
|
|
251
|
+
this._changeFrameTitle(value);
|
|
252
|
+
}, 200);
|
|
208
253
|
});
|
|
209
254
|
|
|
210
255
|
// Блокируем Delete/Backspace от всплытия, чтобы не удалялся весь фрейм при фокусе в поле
|
|
@@ -434,7 +479,7 @@ export class FramePropertiesPanel {
|
|
|
434
479
|
|
|
435
480
|
// Добавляем обработчик клика по документу для закрытия палитры
|
|
436
481
|
setTimeout(() => {
|
|
437
|
-
document.addEventListener('click', this.
|
|
482
|
+
document.addEventListener('click', this._boundDocumentClickHandler);
|
|
438
483
|
}, 0);
|
|
439
484
|
}
|
|
440
485
|
|
|
@@ -442,7 +487,9 @@ export class FramePropertiesPanel {
|
|
|
442
487
|
if (this.colorPalette) {
|
|
443
488
|
this.colorPalette.style.display = 'none';
|
|
444
489
|
}
|
|
445
|
-
|
|
490
|
+
if (this._boundDocumentClickHandler) {
|
|
491
|
+
document.removeEventListener('click', this._boundDocumentClickHandler);
|
|
492
|
+
}
|
|
446
493
|
}
|
|
447
494
|
|
|
448
495
|
_documentClickHandler(e) {
|
|
@@ -527,77 +574,105 @@ export class FramePropertiesPanel {
|
|
|
527
574
|
}
|
|
528
575
|
|
|
529
576
|
_applyFrameType(typeValue) {
|
|
530
|
-
if (!this.currentId) return;
|
|
577
|
+
if (!this.currentId || !this.core?.history) return;
|
|
531
578
|
|
|
532
|
-
|
|
533
|
-
const
|
|
534
|
-
this.eventBus.emit(Events.Object.StateChanged, {
|
|
535
|
-
objectId: this.currentId,
|
|
536
|
-
updates: { properties: { type: typeValue, lockedAspect: false } }
|
|
537
|
-
});
|
|
579
|
+
const objectData = this.core.getObjectData(this.currentId);
|
|
580
|
+
const oldType = (objectData?.properties?.type) || 'custom';
|
|
538
581
|
|
|
539
|
-
|
|
540
|
-
if (!willLockAfter) return; // Произвольный: без изменения размеров
|
|
582
|
+
if (oldType === typeValue) return;
|
|
541
583
|
|
|
542
|
-
|
|
543
|
-
const aspectMap = {
|
|
544
|
-
'a4': 210 / 297,
|
|
545
|
-
'1x1': 1,
|
|
546
|
-
'4x3': 4 / 3,
|
|
547
|
-
'16x9': 16 / 9
|
|
548
|
-
};
|
|
549
|
-
const aspect = aspectMap[typeValue] || 1;
|
|
584
|
+
const willLockAfter = typeValue !== 'custom';
|
|
550
585
|
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
+
if (!willLockAfter) {
|
|
587
|
+
// Произвольный — только тип, без изменения размера
|
|
588
|
+
const command = new UpdateFrameTypeCommand(
|
|
589
|
+
this.core,
|
|
590
|
+
this.currentId,
|
|
591
|
+
oldType,
|
|
592
|
+
typeValue,
|
|
593
|
+
null,
|
|
594
|
+
null,
|
|
595
|
+
null,
|
|
596
|
+
null
|
|
597
|
+
);
|
|
598
|
+
command.setEventBus(this.core.eventBus);
|
|
599
|
+
this.core.history.executeCommand(command);
|
|
600
|
+
} else {
|
|
601
|
+
// Пресет — тип + resize
|
|
602
|
+
const aspectMap = { 'a4': 210 / 297, '1x1': 1, '4x3': 4 / 3, '16x9': 16 / 9 };
|
|
603
|
+
const aspect = aspectMap[typeValue] || 1;
|
|
604
|
+
|
|
605
|
+
const posData = { objectId: this.currentId, position: null };
|
|
606
|
+
const sizeData = { objectId: this.currentId, size: null };
|
|
607
|
+
this.eventBus.emit(Events.Tool.GetObjectPosition, posData);
|
|
608
|
+
this.eventBus.emit(Events.Tool.GetObjectSize, sizeData);
|
|
609
|
+
if (!posData.position || !sizeData.size) return;
|
|
610
|
+
|
|
611
|
+
const oldX = posData.position.x;
|
|
612
|
+
const oldY = posData.position.y;
|
|
613
|
+
const oldW = Math.max(1, sizeData.size.width);
|
|
614
|
+
const oldH = Math.max(1, sizeData.size.height);
|
|
615
|
+
const cx = oldX + oldW / 2;
|
|
616
|
+
const cy = oldY + oldH / 2;
|
|
617
|
+
|
|
618
|
+
const area = oldW * oldH;
|
|
619
|
+
let newW = Math.max(1, Math.round(Math.sqrt(area * aspect)));
|
|
620
|
+
let newH = Math.max(1, Math.round(newW / aspect));
|
|
621
|
+
const newX = Math.round(cx - newW / 2);
|
|
622
|
+
const newY = Math.round(cy - newH / 2);
|
|
623
|
+
|
|
624
|
+
const command = new UpdateFrameTypeCommand(
|
|
625
|
+
this.core,
|
|
626
|
+
this.currentId,
|
|
627
|
+
oldType,
|
|
628
|
+
typeValue,
|
|
629
|
+
{ width: oldW, height: oldH },
|
|
630
|
+
{ width: newW, height: newH },
|
|
631
|
+
{ x: oldX, y: oldY },
|
|
632
|
+
{ x: newX, y: newY }
|
|
633
|
+
);
|
|
634
|
+
command.setEventBus(this.core.eventBus);
|
|
635
|
+
this.core.history.executeCommand(command);
|
|
636
|
+
}
|
|
586
637
|
|
|
587
|
-
// Обновим UI сразу
|
|
588
638
|
this._syncTypeFromObject();
|
|
589
|
-
|
|
590
|
-
// 3) Включаем обратно фиксацию пропорций (для пресетов)
|
|
591
|
-
this.eventBus.emit(Events.Object.StateChanged, {
|
|
592
|
-
objectId: this.currentId,
|
|
593
|
-
updates: { properties: { lockedAspect: true } }
|
|
594
|
-
});
|
|
595
639
|
}
|
|
596
640
|
|
|
597
641
|
destroy() {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
642
|
+
this._hideColorPalette();
|
|
643
|
+
if (this._repositionRafId != null) {
|
|
644
|
+
cancelAnimationFrame(this._repositionRafId);
|
|
645
|
+
this._repositionRafId = null;
|
|
646
|
+
}
|
|
647
|
+
if (this._handlers && this.eventBus?.off) {
|
|
648
|
+
this.eventBus.off(Events.Tool.SelectionAdd, this._handlers.onSelectionAdd);
|
|
649
|
+
this.eventBus.off(Events.Tool.SelectionRemove, this._handlers.onSelectionRemove);
|
|
650
|
+
this.eventBus.off(Events.Tool.SelectionClear, this._handlers.onSelectionClear);
|
|
651
|
+
this.eventBus.off(Events.Object.Deleted, this._handlers.onDeleted);
|
|
652
|
+
this.eventBus.off(Events.Tool.DragStart, this._handlers.onDragStart);
|
|
653
|
+
this.eventBus.off(Events.Tool.DragUpdate, this._handlers.onDragUpdate);
|
|
654
|
+
this.eventBus.off(Events.Tool.DragEnd, this._handlers.onDragEnd);
|
|
655
|
+
this.eventBus.off(Events.Tool.GroupDragUpdate, this._handlers.onGroupDragUpdate);
|
|
656
|
+
this.eventBus.off(Events.Tool.GroupDragStart, this._handlers.onGroupDragStart);
|
|
657
|
+
this.eventBus.off(Events.Tool.GroupDragEnd, this._handlers.onGroupDragEnd);
|
|
658
|
+
this.eventBus.off(Events.Tool.ResizeUpdate, this._handlers.onResizeUpdate);
|
|
659
|
+
this.eventBus.off(Events.Tool.RotateUpdate, this._handlers.onRotateUpdate);
|
|
660
|
+
this.eventBus.off(Events.UI.ZoomPercent, this._handlers.onZoomPercent);
|
|
661
|
+
this.eventBus.off(Events.Tool.PanUpdate, this._handlers.onPanUpdate);
|
|
662
|
+
this.eventBus.off(Events.Tool.Activated, this._handlers.onActivated);
|
|
663
|
+
this.eventBus.off(Events.Object.StateChanged, this._handlers.onStateChanged);
|
|
664
|
+
this.eventBus.off(Events.History.Changed, this._handlers.onHistoryChanged);
|
|
665
|
+
this.eventBus.off(Events.Object.TransformUpdated, this._handlers.onTransformUpdated);
|
|
666
|
+
this._handlers = null;
|
|
667
|
+
}
|
|
668
|
+
if (this._boundDocumentClickHandler) {
|
|
669
|
+
document.removeEventListener('click', this._boundDocumentClickHandler);
|
|
670
|
+
this._boundDocumentClickHandler = null;
|
|
671
|
+
}
|
|
672
|
+
if (this._titleDebounceTimer) {
|
|
673
|
+
clearTimeout(this._titleDebounceTimer);
|
|
674
|
+
this._titleDebounceTimer = null;
|
|
675
|
+
}
|
|
601
676
|
if (this.panel && this.panel.parentNode) {
|
|
602
677
|
this.panel.parentNode.removeChild(this.panel);
|
|
603
678
|
}
|