@sequent-org/moodboard 1.4.25 → 1.4.26

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequent-org/moodboard",
3
- "version": "1.4.25",
3
+ "version": "1.4.26",
4
4
  "type": "module",
5
5
  "description": "Interactive moodboard",
6
6
  "main": "./src/index.js",
@@ -267,6 +267,16 @@ export function closeTextEditorFromState(controller, commit) {
267
267
  textarea.remove();
268
268
  }
269
269
  controller.textEditor = { active: false, objectId: null, textarea: null, world: null, objectType: 'text' };
270
+
271
+ // Синхронно с createTextEditorFinalize: UI (в т.ч. панель свойств текста) ждёт окончание редактирования.
272
+ if (objectType === 'note') {
273
+ controller.eventBus.emit(Events.UI.NoteEditEnd, { objectId: objectId || null });
274
+ showNotePixiText(controller, objectId);
275
+ } else {
276
+ controller.eventBus.emit(Events.UI.TextEditEnd, { objectId: objectId || null });
277
+ }
278
+ updateGlobalTextEditorHandlesLayer();
279
+
270
280
  if (!commitValue) {
271
281
  if (shouldDeleteEmptyNewCreation) {
272
282
  controller.eventBus.emit(Events.Tool.ObjectsDelete, { objects: [objectId] });
@@ -99,7 +99,10 @@ export class TextPropertiesPanel {
99
99
  this.panel = createTextPropertiesPanelRenderer(this);
100
100
  this.layer.appendChild(this.panel);
101
101
  bindTextPropertiesPanelControls(this);
102
+ }
103
+ if (!this._docMouseDownAttached) {
102
104
  document.addEventListener('mousedown', this._onDocMouseDown, true);
105
+ this._docMouseDownAttached = true;
103
106
  }
104
107
 
105
108
  this.panel.style.display = 'flex';
@@ -116,7 +119,10 @@ export class TextPropertiesPanel {
116
119
 
117
120
  this._hideColorDropdown();
118
121
  this._hideBgColorDropdown();
119
- document.removeEventListener('mousedown', this._onDocMouseDown, true);
122
+ if (this._docMouseDownAttached) {
123
+ document.removeEventListener('mousedown', this._onDocMouseDown, true);
124
+ this._docMouseDownAttached = false;
125
+ }
120
126
  }
121
127
 
122
128
  _toggleColorDropdown() {
@@ -21,6 +21,7 @@ export function createTextPropertiesPanelState() {
21
21
  _bgPresetButtons: [],
22
22
  _onColorDocumentClick: null,
23
23
  _onBgDocumentClick: null,
24
+ _docMouseDownAttached: false,
24
25
  };
25
26
  }
26
27
 
@@ -36,4 +37,5 @@ export function clearTextPropertiesPanelState(panel) {
36
37
  panel._eventBridgeHandlers = null;
37
38
  panel._onColorDocumentClick = null;
38
39
  panel._onBgDocumentClick = null;
40
+ panel._docMouseDownAttached = false;
39
41
  }