@sequent-org/moodboard 1.2.8 → 1.2.10
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 +1 -1
- package/src/index.js +149 -0
- package/src/initNoBundler.js +2 -4
- package/src/ui/styles/toolbar.css +1 -1
- package/src/ui/styles/topbar.css +1 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,6 +1,155 @@
|
|
|
1
1
|
// Основной экспорт пакета - готовый MoodBoard с UI
|
|
2
2
|
export { MoodBoard } from './moodboard/MoodBoard.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Диагностика конфликтов CSS для панелей
|
|
6
|
+
* Находит что именно переопределяет ширину панелей
|
|
7
|
+
*/
|
|
8
|
+
export function diagnosePanelConflicts() {
|
|
9
|
+
console.log('🔍 ДИАГНОСТИКА: поиск конфликтов стилей панелей...');
|
|
10
|
+
|
|
11
|
+
const panel = document.querySelector('.text-properties-panel, .frame-properties-panel');
|
|
12
|
+
if (!panel) {
|
|
13
|
+
console.log('❌ Панели не найдены. Создайте объект и выберите его.');
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
console.log('📋 Найдена панель:', panel.className);
|
|
18
|
+
|
|
19
|
+
// Получаем все применяемые стили
|
|
20
|
+
const computedStyle = getComputedStyle(panel);
|
|
21
|
+
console.log('📏 Текущие размеры панели:');
|
|
22
|
+
console.log(' - width:', computedStyle.width);
|
|
23
|
+
console.log(' - min-width:', computedStyle.minWidth);
|
|
24
|
+
console.log(' - max-width:', computedStyle.maxWidth);
|
|
25
|
+
console.log(' - height:', computedStyle.height);
|
|
26
|
+
console.log(' - padding:', computedStyle.padding);
|
|
27
|
+
console.log(' - display:', computedStyle.display);
|
|
28
|
+
console.log(' - position:', computedStyle.position);
|
|
29
|
+
|
|
30
|
+
// Проверяем inline стили
|
|
31
|
+
if (panel.style.cssText) {
|
|
32
|
+
console.log('⚠️ НАЙДЕНЫ inline стили на панели:', panel.style.cssText);
|
|
33
|
+
} else {
|
|
34
|
+
console.log('✅ Inline стилей нет');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Ищем все CSS правила, которые могут влиять на панель
|
|
38
|
+
console.log('🔍 Поиск CSS правил, влияющих на панель...');
|
|
39
|
+
|
|
40
|
+
// Проверяем основные подозрительные свойства
|
|
41
|
+
const suspiciousProperties = ['width', 'min-width', 'max-width', 'height', 'padding', 'display'];
|
|
42
|
+
|
|
43
|
+
suspiciousProperties.forEach(prop => {
|
|
44
|
+
const value = computedStyle.getPropertyValue(prop);
|
|
45
|
+
console.log(`📌 ${prop}: ${value}`);
|
|
46
|
+
|
|
47
|
+
// Проверяем приоритет
|
|
48
|
+
const priority = computedStyle.getPropertyPriority(prop);
|
|
49
|
+
if (priority) {
|
|
50
|
+
console.log(` ⚡ Приоритет: ${priority}`);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Проверяем классы родительских элементов
|
|
55
|
+
let parent = panel.parentElement;
|
|
56
|
+
let level = 1;
|
|
57
|
+
console.log('🔗 Родительские элементы:');
|
|
58
|
+
while (parent && level <= 5) {
|
|
59
|
+
const parentStyles = getComputedStyle(parent);
|
|
60
|
+
console.log(` ${level}. ${parent.tagName}${parent.className ? '.' + parent.className : ''}`);
|
|
61
|
+
console.log(` width: ${parentStyles.width}, display: ${parentStyles.display}`);
|
|
62
|
+
parent = parent.parentElement;
|
|
63
|
+
level++;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Ищем потенциальные конфликтующие CSS классы
|
|
67
|
+
console.log('⚠️ Поиск потенциальных конфликтов:');
|
|
68
|
+
|
|
69
|
+
const possibleConflicts = [
|
|
70
|
+
'bootstrap', 'tailwind', 'flex', 'grid', 'container', 'row', 'col',
|
|
71
|
+
'w-', 'width', 'min-w', 'max-w', 'panel', 'modal', 'popup'
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
const allClasses = panel.className.split(' ');
|
|
75
|
+
const parentClasses = panel.parentElement?.className?.split(' ') || [];
|
|
76
|
+
|
|
77
|
+
[...allClasses, ...parentClasses].forEach(cls => {
|
|
78
|
+
possibleConflicts.forEach(conflict => {
|
|
79
|
+
if (cls.includes(conflict)) {
|
|
80
|
+
console.log(`🚨 Подозрительный класс: "${cls}" (содержит "${conflict}")`);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
element: panel,
|
|
87
|
+
computedStyle: computedStyle,
|
|
88
|
+
currentWidth: computedStyle.width,
|
|
89
|
+
currentMinWidth: computedStyle.minWidth,
|
|
90
|
+
hasInlineStyles: !!panel.style.cssText
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Хирургическое исправление конкретных свойств панелей
|
|
96
|
+
* Исправляет только width и min-width, не трогая остальное
|
|
97
|
+
*/
|
|
98
|
+
export function surgicalPanelFix() {
|
|
99
|
+
console.log('🔧 ХИРУРГИЧЕСКОЕ исправление размеров панелей...');
|
|
100
|
+
|
|
101
|
+
const targetPanels = document.querySelectorAll(`
|
|
102
|
+
.text-properties-panel,
|
|
103
|
+
.frame-properties-panel,
|
|
104
|
+
.note-properties-panel,
|
|
105
|
+
.file-properties-panel,
|
|
106
|
+
.moodboard-file-properties-panel
|
|
107
|
+
`);
|
|
108
|
+
|
|
109
|
+
if (targetPanels.length === 0) {
|
|
110
|
+
console.log('❌ Панели не найдены');
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
targetPanels.forEach((panel, index) => {
|
|
115
|
+
console.log(`🔧 Исправляем панель ${index + 1}: ${panel.className}`);
|
|
116
|
+
|
|
117
|
+
// Запоминаем текущие значения для диагностики
|
|
118
|
+
const beforeWidth = getComputedStyle(panel).width;
|
|
119
|
+
const beforeMinWidth = getComputedStyle(panel).minWidth;
|
|
120
|
+
|
|
121
|
+
// Применяем ТОЛЬКО минимально необходимые исправления
|
|
122
|
+
if (panel.classList.contains('text-properties-panel') ||
|
|
123
|
+
panel.classList.contains('frame-properties-panel')) {
|
|
124
|
+
panel.style.setProperty('min-width', '320px', 'important');
|
|
125
|
+
panel.style.setProperty('width', 'auto', 'important');
|
|
126
|
+
} else if (panel.classList.contains('note-properties-panel')) {
|
|
127
|
+
panel.style.setProperty('min-width', '280px', 'important');
|
|
128
|
+
panel.style.setProperty('width', 'auto', 'important');
|
|
129
|
+
} else if (panel.classList.contains('file-properties-panel') ||
|
|
130
|
+
panel.classList.contains('moodboard-file-properties-panel')) {
|
|
131
|
+
panel.style.setProperty('min-width', '250px', 'important');
|
|
132
|
+
panel.style.setProperty('width', 'auto', 'important');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Проверяем результат
|
|
136
|
+
setTimeout(() => {
|
|
137
|
+
const afterWidth = getComputedStyle(panel).width;
|
|
138
|
+
const afterMinWidth = getComputedStyle(panel).minWidth;
|
|
139
|
+
|
|
140
|
+
console.log(`📏 Панель ${index + 1} результат:`);
|
|
141
|
+
console.log(` До: width: ${beforeWidth}, min-width: ${beforeMinWidth}`);
|
|
142
|
+
console.log(` После: width: ${afterWidth}, min-width: ${afterMinWidth}`);
|
|
143
|
+
|
|
144
|
+
if (parseInt(afterMinWidth) >= 250) {
|
|
145
|
+
console.log(`✅ Панель ${index + 1} исправлена успешно!`);
|
|
146
|
+
} else {
|
|
147
|
+
console.log(`❌ Панель ${index + 1} все еще имеет проблемы`);
|
|
148
|
+
}
|
|
149
|
+
}, 50);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
4
153
|
// Дополнительные экспорты для работы без bundler
|
|
5
154
|
export { initMoodBoardNoBundler, quickInitMoodBoard, injectCriticalStyles, forceInjectPanelStyles } from './initNoBundler.js';
|
|
6
155
|
export { StyleLoader } from './utils/styleLoader.js';
|
package/src/initNoBundler.js
CHANGED
|
@@ -81,8 +81,7 @@ export function injectCriticalStyles() {
|
|
|
81
81
|
flex-direction: column;
|
|
82
82
|
align-items: center;
|
|
83
83
|
gap: 8px;
|
|
84
|
-
pointer-events: auto;
|
|
85
|
-
width: 30px;
|
|
84
|
+
pointer-events: auto;
|
|
86
85
|
overflow: hidden;
|
|
87
86
|
cursor: default;
|
|
88
87
|
}
|
|
@@ -90,8 +89,7 @@ export function injectCriticalStyles() {
|
|
|
90
89
|
.moodboard-topbar {
|
|
91
90
|
position: absolute;
|
|
92
91
|
top: 12px;
|
|
93
|
-
left: 16px;
|
|
94
|
-
height: 30px;
|
|
92
|
+
left: 16px;
|
|
95
93
|
display: inline-flex;
|
|
96
94
|
align-items: center;
|
|
97
95
|
gap: 6px;
|