@sequent-org/moodboard 1.2.7 → 1.2.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +238 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequent-org/moodboard",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "type": "module",
5
5
  "description": "Interactive moodboard",
6
6
  "main": "./src/index.js",
package/src/index.js CHANGED
@@ -5,3 +5,241 @@ export { MoodBoard } from './moodboard/MoodBoard.js';
5
5
  export { initMoodBoardNoBundler, quickInitMoodBoard, injectCriticalStyles, forceInjectPanelStyles } from './initNoBundler.js';
6
6
  export { StyleLoader } from './utils/styleLoader.js';
7
7
  export { EmojiLoaderNoBundler } from './utils/emojiLoaderNoBundler.js';
8
+
9
+ /**
10
+ * СУПЕР-АГРЕССИВНАЯ функция для исправления панелей в проектах с конфликтами CSS
11
+ */
12
+ export function forceFixPanelStyles() {
13
+ console.log('💪 СУПЕР-АГРЕССИВНОЕ исправление панелей (для проектов с конфликтами)...');
14
+
15
+ const superForcedCSS = `
16
+ /* МАКСИМАЛЬНО АГРЕССИВНЫЕ стили панелей */
17
+ .text-properties-panel,
18
+ div.text-properties-panel,
19
+ [class*="text-properties-panel"] {
20
+ min-width: 320px !important;
21
+ max-width: none !important;
22
+ width: auto !important;
23
+ height: 36px !important;
24
+ padding: 12px 22px !important;
25
+ margin: 0 !important;
26
+ background: #ffffff !important;
27
+ background-color: #ffffff !important;
28
+ border: 1px solid #e0e0e0 !important;
29
+ border-radius: 9999px !important;
30
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
31
+ display: flex !important;
32
+ flex-direction: row !important;
33
+ align-items: center !important;
34
+ gap: 8px !important;
35
+ font-size: 13px !important;
36
+ font-family: 'Roboto', Arial, sans-serif !important;
37
+ position: absolute !important;
38
+ pointer-events: auto !important;
39
+ z-index: 10001 !important;
40
+ box-sizing: border-box !important;
41
+ transform: none !important;
42
+ opacity: 1 !important;
43
+ visibility: visible !important;
44
+ }
45
+
46
+ .frame-properties-panel,
47
+ div.frame-properties-panel,
48
+ [class*="frame-properties-panel"] {
49
+ min-width: 320px !important;
50
+ max-width: none !important;
51
+ width: auto !important;
52
+ height: 36px !important;
53
+ padding: 12px 32px !important;
54
+ margin: 0 !important;
55
+ background: #ffffff !important;
56
+ background-color: #ffffff !important;
57
+ border: 1px solid #e0e0e0 !important;
58
+ border-radius: 9999px !important;
59
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
60
+ display: inline-flex !important;
61
+ align-items: center !important;
62
+ gap: 8px !important;
63
+ font-size: 13px !important;
64
+ font-family: 'Roboto', Arial, sans-serif !important;
65
+ position: absolute !important;
66
+ pointer-events: auto !important;
67
+ z-index: 10001 !important;
68
+ box-sizing: border-box !important;
69
+ transform: none !important;
70
+ opacity: 1 !important;
71
+ visibility: visible !important;
72
+ }
73
+
74
+ .note-properties-panel,
75
+ div.note-properties-panel,
76
+ [class*="note-properties-panel"] {
77
+ min-width: 280px !important;
78
+ max-width: none !important;
79
+ width: auto !important;
80
+ height: 40px !important;
81
+ padding: 8px 40px !important;
82
+ margin: 0 !important;
83
+ background: white !important;
84
+ background-color: white !important;
85
+ border: 1px solid #e0e0e0 !important;
86
+ border-radius: 9999px !important;
87
+ box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16) !important;
88
+ display: inline-flex !important;
89
+ flex-direction: row !important;
90
+ align-items: center !important;
91
+ gap: 8px !important;
92
+ font-size: 12px !important;
93
+ font-family: Arial, sans-serif !important;
94
+ position: absolute !important;
95
+ pointer-events: auto !important;
96
+ z-index: 10000 !important;
97
+ box-sizing: border-box !important;
98
+ backdrop-filter: blur(4px) !important;
99
+ transform: none !important;
100
+ opacity: 1 !important;
101
+ visibility: visible !important;
102
+ }
103
+ `;
104
+
105
+ // Удаляем предыдущие версии
106
+ const existingStyles = document.querySelectorAll('#moodboard-universal-panel-fix, #moodboard-super-force-panel-fix');
107
+ existingStyles.forEach(style => style.remove());
108
+
109
+ const style = document.createElement('style');
110
+ style.id = 'moodboard-super-force-panel-fix';
111
+ style.textContent = superForcedCSS;
112
+
113
+ // Вставляем в самый конец head для максимального приоритета
114
+ document.head.appendChild(style);
115
+
116
+ console.log('💪 Супер-агрессивные стили применены');
117
+
118
+ // Проверяем все панели
119
+ setTimeout(() => {
120
+ const panels = document.querySelectorAll('.text-properties-panel, .frame-properties-panel, .note-properties-panel');
121
+ panels.forEach((panel, index) => {
122
+ const computedStyle = getComputedStyle(panel);
123
+ const width = parseInt(computedStyle.minWidth);
124
+ console.log(`📏 Панель ${index + 1}: minWidth = ${width}px`);
125
+ });
126
+ }, 200);
127
+ }
128
+
129
+ /**
130
+ * Универсальная функция для исправления стилей панелей
131
+ * Работает с любой версией MoodBoard (bundled и no-bundler)
132
+ */
133
+ export function fixPanelStyles() {
134
+ console.log('🔧 Исправляем стили панелей MoodBoard (универсальная версия)...');
135
+
136
+ const forcedPanelCSS = `
137
+ /* УНИВЕРСАЛЬНЫЕ принудительные стили панелей */
138
+ .text-properties-panel {
139
+ min-width: 320px !important;
140
+ width: auto !important;
141
+ height: 36px !important;
142
+ padding: 12px 22px !important;
143
+ background-color: #ffffff !important;
144
+ border: 1px solid #e0e0e0 !important;
145
+ border-radius: 9999px !important;
146
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
147
+ display: flex !important;
148
+ flex-direction: row !important;
149
+ align-items: center !important;
150
+ gap: 8px !important;
151
+ font-size: 13px !important;
152
+ font-family: 'Roboto', Arial, sans-serif !important;
153
+ position: absolute !important;
154
+ pointer-events: auto !important;
155
+ z-index: 1001 !important;
156
+ }
157
+
158
+ .frame-properties-panel {
159
+ min-width: 320px !important;
160
+ width: auto !important;
161
+ height: 36px !important;
162
+ padding: 12px 32px !important;
163
+ background-color: #ffffff !important;
164
+ border: 1px solid #e0e0e0 !important;
165
+ border-radius: 9999px !important;
166
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
167
+ display: inline-flex !important;
168
+ align-items: center !important;
169
+ gap: 8px !important;
170
+ font-size: 13px !important;
171
+ font-family: 'Roboto', Arial, sans-serif !important;
172
+ position: absolute !important;
173
+ pointer-events: auto !important;
174
+ z-index: 1001 !important;
175
+ }
176
+
177
+ .note-properties-panel {
178
+ min-width: 280px !important;
179
+ width: auto !important;
180
+ height: 36px !important;
181
+ padding: 12px 22px !important;
182
+ background-color: #ffffff !important;
183
+ border: 1px solid #e0e0e0 !important;
184
+ border-radius: 9999px !important;
185
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
186
+ display: inline-flex !important;
187
+ align-items: center !important;
188
+ gap: 8px !important;
189
+ font-size: 13px !important;
190
+ font-family: 'Roboto', Arial, sans-serif !important;
191
+ position: absolute !important;
192
+ pointer-events: auto !important;
193
+ z-index: 1001 !important;
194
+ }
195
+
196
+ .file-properties-panel, .moodboard-file-properties-panel {
197
+ min-width: 250px !important;
198
+ width: auto !important;
199
+ height: 36px !important;
200
+ padding: 8px 12px !important;
201
+ background-color: #ffffff !important;
202
+ border: 1px solid #e5e7eb !important;
203
+ border-radius: 8px !important;
204
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
205
+ display: flex !important;
206
+ flex-direction: row !important;
207
+ align-items: center !important;
208
+ gap: 8px !important;
209
+ font-size: 14px !important;
210
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
211
+ position: absolute !important;
212
+ pointer-events: auto !important;
213
+ z-index: 1000 !important;
214
+ }
215
+ `;
216
+
217
+ // Проверяем, не добавлены ли уже стили
218
+ if (document.getElementById('moodboard-universal-panel-fix')) {
219
+ console.log('⚠️ Универсальные стили панелей уже добавлены');
220
+ return;
221
+ }
222
+
223
+ const style = document.createElement('style');
224
+ style.id = 'moodboard-universal-panel-fix';
225
+ style.textContent = forcedPanelCSS;
226
+ document.head.appendChild(style);
227
+
228
+ console.log('✅ Универсальные стили панелей добавлены');
229
+
230
+ // Проверяем результат через 100ms
231
+ setTimeout(() => {
232
+ const panel = document.querySelector('.text-properties-panel, .frame-properties-panel, .note-properties-panel');
233
+ if (panel) {
234
+ const computedStyle = getComputedStyle(panel);
235
+ const width = parseInt(computedStyle.minWidth);
236
+ console.log(`📏 Проверка панели: minWidth = ${width}px`);
237
+
238
+ if (width >= 250) {
239
+ console.log('✅ Стили панелей исправлены успешно!');
240
+ } else {
241
+ console.log('⚠️ Панель все еще узкая, возможны конфликты CSS');
242
+ }
243
+ }
244
+ }, 100);
245
+ }