@sequent-org/moodboard 1.2.22 → 1.2.24

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.22",
3
+ "version": "1.2.24",
4
4
  "type": "module",
5
5
  "description": "Interactive moodboard",
6
6
  "main": "./src/index.js",
@@ -69,6 +69,11 @@ export class MoodBoard {
69
69
  */
70
70
  async init() {
71
71
  try {
72
+ // Добавляем корневой класс к контейнеру для изоляции стилей
73
+ if (this.container) {
74
+ this.container.classList.add('moodboard-root');
75
+ }
76
+
72
77
  // Создаем HTML структуру
73
78
  const { workspace, toolbar, canvas, topbar } = this.workspaceManager.createWorkspaceStructure();
74
79
  this.workspaceElement = workspace;
@@ -474,7 +479,10 @@ export class MoodBoard {
474
479
  this.dataManager = null;
475
480
  this.actionHandler = null;
476
481
 
477
- // Очищаем ссылку на контейнер
482
+ // Удаляем корневой класс и очищаем ссылку на контейнер
483
+ if (this.container) {
484
+ this.container.classList.remove('moodboard-root');
485
+ }
478
486
  this.container = null;
479
487
 
480
488
  // Вызываем коллбек onDestroy
@@ -41,16 +41,14 @@ export class BaseTool {
41
41
 
42
42
  /**
43
43
  * Устанавливает курсор для инструмента
44
+ * Базовая реализация не устанавливает глобальный курсор
45
+ * Конкретные инструменты должны переопределить этот метод
46
+ * и устанавливать курсор на canvas или соответствующий элемент
44
47
  */
45
48
  setCursor() {
46
- if (typeof document !== 'undefined' && document.body) {
47
- // Для 'default' не ставим инлайн-стиль, чтобы сработал глобальный CSS-курсор
48
- if (!this.cursor || this.cursor === 'default') {
49
- document.body.style.cursor = '';
50
- } else {
51
- document.body.style.cursor = this.cursor;
52
- }
53
- }
49
+ // Базовая реализация ничего не делает
50
+ // Избегаем установки глобального курсора на document.body
51
+ // Конкретные инструменты устанавливают курсор на canvas
54
52
  }
55
53
 
56
54
  /**
package/src/ui/Toolbar.js CHANGED
@@ -63,10 +63,9 @@ export class Toolbar {
63
63
  ];
64
64
 
65
65
  // Существующие элементы ниже новых
66
+ // убрал { id: 'clear', iconName: 'clear', title: 'Очистить холст', type: 'clear' },
66
67
  const existingTools = [
67
- { id: 'frame', iconName: 'frame', title: 'Добавить фрейм', type: 'frame' },
68
- { id: 'divider', type: 'divider' },
69
- { id: 'clear', iconName: 'clear', title: 'Очистить холст', type: 'clear' },
68
+ { id: 'frame', iconName: 'frame', title: 'Добавить фрейм', type: 'frame' },
70
69
  { id: 'divider', type: 'divider' },
71
70
  { id: 'undo', iconName: 'undo', title: 'Отменить (Ctrl+Z)', type: 'undo', disabled: true },
72
71
  { id: 'redo', iconName: 'redo', title: 'Повторить (Ctrl+Y)', type: 'redo', disabled: true }
@@ -14,8 +14,10 @@
14
14
  font-display: swap;
15
15
  }
16
16
 
17
- /* Global default cursor */
18
- html, body, .moodboard-workspace, .moodboard-container, .moodboard-canvas {
17
+ /* Default cursor inside moodboard root only */
18
+ .moodboard-root .moodboard-workspace,
19
+ .moodboard-root .moodboard-container,
20
+ .moodboard-root .moodboard-canvas {
19
21
  cursor: url('../../assets/icons/cursor-default-custom.svg') 0 0, default;
20
22
  }
21
23