@sequent-org/moodboard 1.2.65 → 1.2.67
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
|
@@ -232,11 +232,22 @@ export class MoodBoard {
|
|
|
232
232
|
// Смена фона доски по выбору цвета в топбаре
|
|
233
233
|
this.coreMoodboard.eventBus.on(Events.UI.PaintPick, ({ color }) => {
|
|
234
234
|
if (!color) return;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
235
|
+
try {
|
|
236
|
+
console.log('[MB] PaintPick handler: received color', color, 'settingsApplier?', !!this.settingsApplier);
|
|
237
|
+
} catch (_) {}
|
|
238
|
+
// Централизованное применение через SettingsApplier,
|
|
239
|
+
// чтобы гарантировать эмит события для автосохранения
|
|
240
|
+
if (this.settingsApplier && typeof this.settingsApplier.set === 'function') {
|
|
241
|
+
this.settingsApplier.set({ backgroundColor: color });
|
|
242
|
+
} else {
|
|
243
|
+
// Fallback на случай отсутствия аплаера (не должен случаться)
|
|
244
|
+
const hex = (typeof color === 'string' && color.startsWith('#'))
|
|
245
|
+
? parseInt(color.slice(1), 16)
|
|
246
|
+
: color;
|
|
247
|
+
if (this.coreMoodboard?.pixi?.app?.renderer) {
|
|
248
|
+
this.coreMoodboard.pixi.app.renderer.backgroundColor = hex;
|
|
249
|
+
}
|
|
250
|
+
this.coreMoodboard.eventBus.emit(Events.Grid.BoardDataChanged, { settings: { backgroundColor: color } });
|
|
240
251
|
}
|
|
241
252
|
});
|
|
242
253
|
}
|
|
@@ -14,8 +14,13 @@ export class SettingsApplier {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
set(partial) {
|
|
17
|
+
try { console.log('[SA] set()', partial); } catch (_) {}
|
|
17
18
|
this.settings = { ...this.settings, ...(partial || {}) };
|
|
18
19
|
this.apply(this.settings);
|
|
20
|
+
// Сообщаем системе об изменении настроек для автосохранения
|
|
21
|
+
try {
|
|
22
|
+
this.eventBus && this.eventBus.emit(Events.Grid.BoardDataChanged, { settings: this.get() });
|
|
23
|
+
} catch (_) {}
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
get() {
|