@sequent-org/moodboard 1.2.112 → 1.2.113

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.2.112",
3
+ "version": "1.2.113",
4
4
  "type": "module",
5
5
  "description": "Interactive moodboard",
6
6
  "main": "./src/index.js",
@@ -76,7 +76,9 @@ export class ContextMenu {
76
76
  }
77
77
 
78
78
  hide() {
79
- this.element.style.display = 'none';
79
+ if (this.element) {
80
+ this.element.style.display = 'none';
81
+ }
80
82
  this.isVisible = false;
81
83
  }
82
84
 
@@ -946,8 +946,10 @@ export class HtmlHandlesLayer {
946
946
 
947
947
  _onRotateHandleDown(e, box) {
948
948
  e.preventDefault(); e.stopPropagation();
949
-
950
- const id = e.currentTarget.dataset.id;
949
+
950
+ const handleElement = e.currentTarget;
951
+ const id = handleElement?.dataset?.id;
952
+ if (!id) return;
951
953
  const isGroup = id === '__group__';
952
954
 
953
955
  // Получаем центр объекта в CSS координатах
@@ -970,7 +972,9 @@ export class HtmlHandlesLayer {
970
972
  }
971
973
 
972
974
  // Изменяем курсор на grabbing
973
- e.currentTarget.style.cursor = 'grabbing';
975
+ if (handleElement) {
976
+ handleElement.style.cursor = 'grabbing';
977
+ }
974
978
 
975
979
  // Уведомляем о начале поворота
976
980
  if (isGroup) {
@@ -1006,8 +1010,10 @@ export class HtmlHandlesLayer {
1006
1010
  document.removeEventListener('mousemove', onRotateMove);
1007
1011
  document.removeEventListener('mouseup', onRotateUp);
1008
1012
 
1009
- // Возвращаем курсор
1010
- e.currentTarget.style.cursor = 'grab';
1013
+ // Возвращаем курсор ручки, если она всё ещё доступна
1014
+ if (handleElement) {
1015
+ handleElement.style.cursor = 'grab';
1016
+ }
1011
1017
 
1012
1018
  // Вычисляем финальный угол
1013
1019
  const finalAngle = Math.atan2(ev.clientY - centerY, ev.clientX - centerX);