@sequent-org/moodboard 1.0.9 → 1.0.11

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.0.9",
3
+ "version": "1.0.11",
4
4
  "type": "module",
5
5
  "description": "Interactive moodboard",
6
6
  "main": "./src/index.js",
@@ -17,8 +17,7 @@ export class PixiEngine {
17
17
  backgroundColor: this.options.backgroundColor,
18
18
  antialias: true,
19
19
  resolution: (typeof window !== 'undefined' && window.devicePixelRatio) ? window.devicePixelRatio : 1,
20
- autoDensity: true,
21
- resizeTo: this.container // Автоматически изменять размер при изменении контейнера
20
+ autoDensity: true
22
21
  });
23
22
 
24
23
  this.container.appendChild(this.app.view);
@@ -434,17 +433,6 @@ export class PixiEngine {
434
433
  return null;
435
434
  }
436
435
 
437
- /**
438
- * Изменяет размер PIXI приложения
439
- * @param {number} width - новая ширина
440
- * @param {number} height - новая высота
441
- */
442
- resize(width, height) {
443
- if (this.app && this.app.renderer) {
444
- this.app.renderer.resize(width, height);
445
- }
446
- }
447
-
448
436
  destroy() {
449
437
  this.app.destroy(true);
450
438
  }
package/src/core/index.js CHANGED
@@ -36,37 +36,6 @@ export class CoreMoodBoard {
36
36
  backgroundColor: 0xF5F5F5,
37
37
  ...options
38
38
  };
39
-
40
- // Устанавливаем размеры контейнера, если они не заданы
41
- if (!this.options.width || this.options.width === 800) {
42
- this.options.width = this.container.clientWidth || 800;
43
- }
44
- if (!this.options.height || this.options.height === 600) {
45
- this.options.height = this.container.clientHeight || 600;
46
- }
47
-
48
- // Создаем ResizeObserver для отслеживания изменений размера контейнера
49
- this.resizeObserver = null;
50
- if (typeof ResizeObserver !== 'undefined') {
51
- this.resizeObserver = new ResizeObserver((entries) => {
52
- for (const entry of entries) {
53
- const { width, height } = entry.contentRect;
54
- if (this.pixi && this.pixi.app) {
55
- // Обновляем размеры PIXI приложения
56
- this.pixi.resize(width, height);
57
- // Обновляем размеры в опциях
58
- this.options.width = width;
59
- this.options.height = height;
60
- // Обновляем размеры рабочего пространства
61
- if (this.workspaceManager) {
62
- this.workspaceManager.updateSize();
63
- }
64
- // Уведомляем о изменении размера
65
- this.eventBus.emit('resize', { width, height });
66
- }
67
- }
68
- });
69
- }
70
39
 
71
40
  this.eventBus = new EventBus();
72
41
  this.state = new StateManager(this.eventBus);
@@ -103,11 +72,6 @@ export class CoreMoodBoard {
103
72
  try {
104
73
  await this.pixi.init();
105
74
  this.keyboard.startListening(); // Запускаем прослушивание клавиатуры
106
-
107
- // Запускаем отслеживание изменения размера контейнера
108
- if (this.resizeObserver) {
109
- this.resizeObserver.observe(this.container);
110
- }
111
75
 
112
76
  // Инициализируем систему инструментов
113
77
  await this.initTools();
@@ -1659,12 +1623,6 @@ export class CoreMoodBoard {
1659
1623
  }
1660
1624
 
1661
1625
  destroy() {
1662
- // Останавливаем отслеживание изменения размера
1663
- if (this.resizeObserver) {
1664
- this.resizeObserver.disconnect();
1665
- this.resizeObserver = null;
1666
- }
1667
-
1668
1626
  this.saveManager.destroy();
1669
1627
  this.keyboard.destroy();
1670
1628
  this.history.destroy();
@@ -196,9 +196,9 @@ export class MoodBoard {
196
196
  }
197
197
 
198
198
  initZoombar() {
199
- // Рисуем панель зума поверх холста (в том же контейнере, что и topbar)
199
+ // Рисуем панель зума в правом нижнем углу (внутри workspace контейнера)
200
200
  this.zoombar = new ZoomPanel(
201
- this.topbarContainer,
201
+ this.workspaceElement,
202
202
  this.coreMoodboard.eventBus
203
203
  );
204
204
  }
@@ -322,26 +322,6 @@ export class MoodBoard {
322
322
  }
323
323
  }
324
324
 
325
- /**
326
- * Обновляет размеры холста
327
- */
328
- updateSize() {
329
- if (this.workspaceManager) {
330
- return this.workspaceManager.updateSize();
331
- }
332
- return null;
333
- }
334
-
335
- /**
336
- * Получает текущие размеры холста
337
- */
338
- getSize() {
339
- if (this.workspaceManager) {
340
- return this.workspaceManager.getCanvasSize();
341
- }
342
- return { width: 800, height: 600 };
343
- }
344
-
345
325
  /**
346
326
  * Очистка ресурсов
347
327
  */
@@ -83,29 +83,12 @@ export class WorkspaceManager {
83
83
  return { width: 800, height: 600 };
84
84
  }
85
85
 
86
- // Получаем размеры родительского контейнера
87
- const parentWidth = this.container.clientWidth;
88
- const parentHeight = this.container.clientHeight;
89
-
90
86
  return {
91
- width: parentWidth || 800,
92
- height: parentHeight || 600
87
+ width: this.canvasContainer.clientWidth,
88
+ height: this.canvasContainer.clientHeight
93
89
  };
94
90
  }
95
91
 
96
- /**
97
- * Обновляет размеры рабочего пространства
98
- */
99
- updateSize() {
100
- if (this.canvasContainer && this.container) {
101
- const size = this.getCanvasSize();
102
- this.canvasContainer.style.width = size.width + 'px';
103
- this.canvasContainer.style.height = size.height + 'px';
104
- return size;
105
- }
106
- return null;
107
- }
108
-
109
92
  /**
110
93
  * Очистка ресурсов
111
94
  */
@@ -15,9 +15,10 @@
15
15
  }
16
16
 
17
17
  .moodboard-workspace {
18
- position: relative;
19
- width: 100%;
20
- height: 100%;
18
+ position: fixed;
19
+ inset: 0;
20
+ width: 100vw;
21
+ height: 100vh;
21
22
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
22
23
  overflow: hidden;
23
24
  }
@@ -49,11 +50,11 @@
49
50
  pointer-events: none;
50
51
  }
51
52
 
52
- /* Right top zoom panel container (reuses topbar container area) */
53
+ /* Bottom-right zoom panel container (positioned left of map panel) */
53
54
  .moodboard-zoombar {
54
55
  position: absolute;
55
- top: 16px;
56
- right: 16px;
56
+ bottom: 16px;
57
+ right: 80px; /* Слева от кнопки карты (36px + 8px gap + 36px button = 80px) */
57
58
  display: inline-flex;
58
59
  align-items: center;
59
60
  gap: 8px;
@@ -102,7 +103,7 @@
102
103
  .moodboard-zoombar__menu {
103
104
  position: absolute;
104
105
  right: 0;
105
- top: 49px;
106
+ bottom: 49px; /* Открывается вверх от панели зума */
106
107
  background: #fff;
107
108
  border: 1px solid #e0e0e0;
108
109
  border-radius: 8px;
@@ -174,10 +175,7 @@
174
175
  /* Canvas Container */
175
176
  .moodboard-workspace__canvas {
176
177
  position: absolute;
177
- top: 0;
178
- left: 0;
179
- right: 0;
180
- bottom: 0;
178
+ inset: 0;
181
179
  overflow: hidden;
182
180
  }
183
181