react-mention-input 1.1.10 → 1.1.12

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.
@@ -1,125 +1,340 @@
1
1
  .mention-container {
2
- position: relative;
2
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
3
+ line-height: 1.5;
4
+ color: #333;
5
+ width: 100%;
3
6
  display: flex;
4
- align-items: center;
7
+ flex-direction: column;
8
+ gap: 12px;
5
9
  }
6
10
 
7
- .mention-input-container{
8
- border: 1px solid #ccc;
9
- border-radius: 8px;
10
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
11
- transition: border 0.2s, box-shadow 0.2s;
11
+ .mention-input-container {
12
+ display: flex;
13
+ align-items: center;
14
+ padding: 8px 12px;
15
+ border: 1px solid #e0e0e0;
16
+ border-radius: 24px;
17
+ background: #fff;
18
+ transition: all 0.2s;
19
+ position: relative;
12
20
  width: 100%;
13
- padding: 12px 16px;
21
+ box-sizing: border-box;
22
+ }
23
+
24
+ .mention-input-container:focus-within {
25
+ border-color: #ddd;
26
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
27
+ }
28
+
29
+ .mention-input-container.dragging-over {
30
+ border-color: #2684FF;
31
+ background-color: rgba(38, 132, 255, 0.05);
32
+ }
33
+
34
+ .mention-input-container.no-image {
35
+ min-height: 42px; /* Smaller height when no image is attached */
36
+ }
37
+
38
+ .mention-input-wrapper {
39
+ flex: 1;
14
40
  position: relative;
41
+ min-width: 0;
42
+ margin: 0 10px;
43
+ }
44
+
45
+ .input-header {
15
46
  display: flex;
16
- align-items: center;
17
-
47
+ justify-content: flex-end;
48
+ margin-bottom: 4px;
49
+ }
50
+
51
+ .input-content {
52
+ position: relative;
53
+ flex-grow: 1;
54
+ }
55
+
56
+ .placeholder {
57
+ position: absolute;
58
+ color: #999;
59
+ font-size: 14px;
60
+ pointer-events: none;
61
+ left: 0;
62
+ top: 50%;
63
+ transform: translateY(-50%);
64
+ white-space: nowrap;
65
+ overflow: hidden;
66
+ text-overflow: ellipsis;
67
+ max-width: 100%;
18
68
  }
69
+
19
70
  .mention-input {
20
- border: none;
21
71
  outline: none;
22
- font-size: 16px;
23
- flex: 1;
24
-
72
+ padding: 6px 0;
73
+ font-size: 14px;
74
+ min-height: 24px;
75
+ max-height: 120px;
76
+ overflow-y: auto;
77
+ word-break: break-word;
78
+ width: 100%;
25
79
  }
26
- .mention-input:focus {
80
+
81
+ .action-buttons {
82
+ display: flex;
83
+ align-items: center;
84
+ margin-left: 8px;
85
+ }
86
+
87
+ .image-button, .send-button {
88
+ background: none;
27
89
  border: none;
28
- outline: none;
90
+ cursor: pointer;
91
+ border-radius: 4px;
92
+ display: flex;
93
+ align-items: center;
94
+ justify-content: center;
95
+ transition: background-color 0.2s;
96
+ padding: 5px;
97
+ }
98
+
99
+ .image-button {
100
+ color: #666;
101
+ font-size: 14px;
102
+ }
103
+
104
+ .image-button:hover {
105
+ background-color: rgba(0, 0, 0, 0.05);
29
106
  }
30
107
 
31
108
  .send-button {
32
- padding: 4px 10x;
33
- border: 1px solid #ccc;
34
- border-radius: 8px;
35
- background-color: #007BFF;
36
- color: #fff;
37
-
38
- cursor: pointer;
39
- font-size: 18px;
40
109
  display: flex;
41
110
  align-items: center;
42
111
  justify-content: center;
112
+ width: 36px;
113
+ height: 36px;
114
+ border-radius: 50%;
115
+ background-color: #1a1a1a;
116
+ color: white;
117
+ border: none;
118
+ cursor: pointer;
119
+ font-size: 14px;
120
+ transition: background-color 0.2s;
43
121
  }
44
122
 
45
- /* .suggestion-list {
46
- position: absolute;
47
- top: 100%;
48
- left: 0;
49
- right: 0;
50
- background-color: #fff;
51
- border: 1px solid #ddd;
52
- border-radius: 4px;
123
+ .send-button:hover {
124
+ background-color: #333;
125
+ }
126
+
127
+ /* Suggestion list with proper columnar layout */
128
+ .suggestion-container {
129
+ background: white;
130
+ border-radius: 8px;
131
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
132
+ border: 1px solid #eaeaea;
133
+ overflow: hidden;
134
+ width: 250px;
135
+ max-height: 300px;
136
+ }
137
+
138
+ .suggestion-list {
53
139
  list-style: none;
54
- margin: 4px 0;
55
140
  padding: 0;
56
- max-height: 150px;
141
+ margin: 0;
142
+ width: 100%;
143
+ max-height: 300px;
57
144
  overflow-y: auto;
58
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
59
- z-index: 1;
60
- } */
145
+ }
61
146
 
62
- .suggestion-list {
63
- max-height: 150px;
64
- overflow-y: auto;
65
- background: #fff;
66
- border: 1px solid #ddd;
67
- border-radius: 4px;
68
- z-index: 1000;
69
- width: auto;
70
- white-space: nowrap;
71
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
147
+ .suggestion-item {
148
+ padding: 8px 12px;
149
+ cursor: pointer;
150
+ display: flex;
151
+ align-items: center;
152
+ width: 100%;
153
+ box-sizing: border-box;
154
+ border-bottom: 1px solid #f0f0f0;
72
155
  }
73
156
 
157
+ .suggestion-item:last-child {
158
+ border-bottom: none;
159
+ }
160
+
161
+ .suggestion-item:hover {
162
+ background-color: #f5f8ff;
163
+ }
74
164
 
75
165
  .user-icon {
76
- width: 25px;
77
- height: 25px;
166
+ width: 28px;
167
+ height: 28px;
168
+ min-width: 28px; /* Ensure fixed width */
169
+ background-color: #e1e8ff;
170
+ color: #2684FF;
78
171
  border-radius: 50%;
79
172
  display: flex;
80
173
  align-items: center;
81
174
  justify-content: center;
175
+ font-weight: 500;
82
176
  font-size: 12px;
83
- font-weight: bold;
84
- color: #fff;
85
- background-color: #007bff;
86
- text-transform: uppercase;
87
- margin-right: 4px;
177
+ margin-right: 10px;
178
+ }
179
+
180
+ .user-name {
181
+ font-size: 14px;
182
+ white-space: nowrap;
183
+ overflow: hidden;
184
+ text-overflow: ellipsis;
185
+ flex: 1;
88
186
  }
89
187
 
188
+ .mention-highlight {
189
+ background-color: rgba(38, 132, 255, 0.1);
190
+ color: #2684FF;
191
+ border-radius: 4px;
192
+ padding: 1px 4px;
193
+ font-weight: 500;
194
+ }
90
195
 
91
- .suggestion-item {
196
+ .link-highlight {
197
+ color: #2684FF;
198
+ text-decoration: none;
199
+ }
200
+
201
+ .link-highlight:hover {
202
+ text-decoration: underline;
203
+ }
204
+
205
+ .selected-images {
206
+ width: 100%;
207
+ margin-top: 4px;
208
+ }
209
+
210
+ .image-preview-card {
211
+ position: relative;
212
+ border-radius: 12px;
213
+ overflow: hidden;
214
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
215
+ margin-bottom: 4px;
216
+ max-width: 250px;
217
+ background: #fff;
218
+ border: 1px solid #eaeaea;
219
+ }
220
+
221
+ .image-preview-card img {
222
+ display: block;
223
+ max-width: 100%;
224
+ max-height: 200px;
225
+ object-fit: contain;
226
+ }
227
+
228
+ .remove-image-btn {
229
+ position: absolute;
230
+ top: 8px;
231
+ right: 8px;
232
+ width: 24px;
233
+ height: 24px;
234
+ border-radius: 50%;
235
+ background: rgba(255, 255, 255, 0.9);
236
+ color: #ff5252;
237
+ border: none;
92
238
  display: flex;
93
239
  align-items: center;
94
- padding: 8px 12px;
240
+ justify-content: center;
241
+ font-size: 18px;
95
242
  cursor: pointer;
96
- border-bottom: 1px solid #ddd;
97
- transition: background-color 0.2s;
243
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
244
+ transition: all 0.2s;
98
245
  }
99
246
 
100
- .suggestion-item:hover {
101
- background-color: #f5f5f5;
247
+ .remove-image-btn:hover {
248
+ background: #fff;
249
+ transform: scale(1.05);
102
250
  }
103
251
 
104
-
105
- .mention-highlight {
106
- background-color: #e0f7fa;
107
- color: #007bff;
108
- padding: 2px 4px;
252
+ .image-uploading {
253
+ padding: 8px;
254
+ background: #f5f5f5;
109
255
  border-radius: 4px;
256
+ font-size: 14px;
257
+ color: #666;
258
+ margin-top: 8px;
110
259
  }
111
260
 
112
- .mention-input .placeholder {
113
- color: #aaa;
114
- pointer-events: none;
261
+ .image-button {
262
+ background: none;
263
+ border: none;
264
+ cursor: pointer;
265
+ font-size: 20px;
266
+ padding: 4px 8px;
267
+ margin-right: 8px;
268
+ }
269
+
270
+ .image-button:hover {
271
+ opacity: 0.7;
272
+ }
273
+
274
+ .mention-input-container .controls {
275
+ display: flex;
276
+ align-items: center;
277
+ width: 100%;
278
+ margin-top: 8px;
279
+ }
280
+
281
+ .drag-overlay {
115
282
  position: absolute;
283
+ top: 0;
284
+ left: 0;
285
+ right: 0;
286
+ bottom: 0;
287
+ background-color: rgba(255, 255, 255, 0.95);
288
+ display: flex;
289
+ justify-content: center;
290
+ align-items: center;
291
+ z-index: 5;
292
+ border-radius: 24px;
293
+ border: 2px dashed #2684FF;
116
294
  }
117
295
 
118
- .link-highlight {
119
- color: #007bff;
120
- text-decoration: underline;
296
+ .drag-message {
297
+ color: #2684FF;
298
+ font-weight: 500;
299
+ }
300
+
301
+ .drag-icon {
302
+ font-size: 24px;
303
+ margin-bottom: 8px;
304
+ }
305
+
306
+ .action-buttons button {
307
+ background: none;
308
+ border: none;
121
309
  cursor: pointer;
310
+ display: flex;
311
+ align-items: center;
312
+ justify-content: center;
313
+ padding: 6px;
314
+ margin-left: 2px;
315
+ border-radius: 4px;
316
+ transition: background-color 0.2s;
122
317
  }
123
- .link-highlight:hover {
124
- color: #0056b3;
125
- }
318
+
319
+ .action-buttons button:hover {
320
+ background-color: rgba(0, 0, 0, 0.05);
321
+ }
322
+
323
+ /* .suggestion-list {
324
+ position: absolute;
325
+ top: 100%;
326
+ left: 0;
327
+ right: 0;
328
+ background-color: #fff;
329
+ border: 1px solid #ddd;
330
+ border-radius: 4px;
331
+ list-style: none;
332
+ margin: 4px 0;
333
+ padding: 0;
334
+ max-height: 150px;
335
+ overflow-y: auto;
336
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
337
+ z-index: 1;
338
+ } */
339
+
340
+
@@ -22,8 +22,11 @@ interface MentionInputProps {
22
22
  name: string;
23
23
  }[];
24
24
  userSelectListName: string[];
25
+ images?: File[];
26
+ imageUrl?: string | null;
25
27
  }) => void;
26
28
  suggestionPosition?: 'top' | 'bottom' | 'left' | 'right';
29
+ onImageUpload?: (file: File) => Promise<string>;
27
30
  }
28
31
  declare const MentionInput: React.FC<MentionInputProps>;
29
32
  export default MentionInput;