@sequent-org/moodboard 1.4.36 → 1.4.37

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.36",
3
+ "version": "1.4.37",
4
4
  "type": "module",
5
5
  "description": "Interactive moodboard",
6
6
  "main": "./src/index.js",
@@ -1,4 +1,5 @@
1
1
  import { CoreMoodBoard } from '../../core/index.js';
2
+ import { BOARD_PALETTE } from '../../ui/boardPalette.js';
2
3
  import { createMoodBoardManagers, wireMoodBoardServices } from './MoodBoardManagersFactory.js';
3
4
  import { createMoodBoardUi } from './MoodBoardUiFactory.js';
4
5
  import { bindSaveCallbacks } from '../integration/MoodBoardEventBindings.js';
@@ -77,7 +78,7 @@ export async function initCoreMoodBoard(board) {
77
78
  boardId: board.options.boardId || 'workspace-board',
78
79
  width: canvasSize.width,
79
80
  height: canvasSize.height,
80
- backgroundColor: board.options.theme === 'dark' ? 0x2a2a2a : 0xDAEEFB,
81
+ backgroundColor: board.options.theme === 'dark' ? 0x2a2a2a : parseInt(BOARD_PALETTE[0].board.replace('#', ''), 16),
81
82
  saveEndpoint: board.options.saveEndpoint,
82
83
  loadEndpoint: board.options.loadEndpoint,
83
84
  };
package/src/ui/Topbar.js CHANGED
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { Events } from '../core/events/Events.js';
5
5
  import { TopbarIconLoader } from '../utils/topbarIconLoader.js';
6
+ import { BOARD_PALETTE } from './boardPalette.js';
6
7
 
7
8
  export class Topbar {
8
9
  constructor(container, eventBus, theme = 'light') {
@@ -15,13 +16,7 @@ export class Topbar {
15
16
  this.iconLoader = new TopbarIconLoader();
16
17
  this.icons = this.iconLoader.icons;
17
18
  // Палитра кнопки заливки и соответствие цвету фона доски
18
- this._palette = [
19
- { id: 1, name: 'default-light', btnHex: '#d6e8f7', board: '#f0f6fc' },
20
- { id: 2, name: 'mint-light', btnHex: '#E8F5E9', board: '#f8fff7' },
21
- { id: 3, name: 'peach-light', btnHex: '#FFF3E0', board: '#fffcf7' },
22
- { id: 4, name: 'gray-light', btnHex: '#f5f5f5', board: '#f5f5f5' },
23
- { id: 5, name: 'white', btnHex: '#ffffff', board: '#ffffff' }
24
- ];
19
+ this._palette = BOARD_PALETTE;
25
20
  this._pendingPaintHex = null;
26
21
  this.init();
27
22
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Палитра фонов доски.
3
+ * Первый элемент используется как фон по умолчанию при создании/первом открытии доски.
4
+ * btnHex — цвет кнопки в Topbar; board — реальный цвет фона canvas.
5
+ */
6
+ export const BOARD_PALETTE = [
7
+ { id: 1, name: 'default-light', btnHex: '#d6e8f7', board: '#f0f6fc' },
8
+ { id: 2, name: 'mint-light', btnHex: '#E8F5E9', board: '#f8fff7' },
9
+ { id: 3, name: 'peach-light', btnHex: '#FFF3E0', board: '#fffcf7' },
10
+ { id: 4, name: 'gray-light', btnHex: '#f5f5f5', board: '#f5f5f5' },
11
+ { id: 5, name: 'white', btnHex: '#ffffff', board: '#ffffff' },
12
+ ];