@trustquery/browser 0.3.2 → 0.3.3

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": "@trustquery/browser",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Turn any textarea into an interactive trigger-based editor with inline styling",
5
5
  "type": "module",
6
6
  "main": "dist/trustquery.js",
@@ -325,13 +325,20 @@ export default class AttachmentManager {
325
325
  const existingIcon = iconPlaceholder?.querySelector('.tq-attachment-icon');
326
326
 
327
327
  if (newMatches.length === 0 && existingIcon) {
328
- // No more matches - remove the icon
328
+ // No more matches - remove the icon and collapse placeholder
329
329
  existingIcon.remove();
330
+
331
+ // Collapse the icon placeholder by setting width to 0
332
+ if (iconPlaceholder) {
333
+ iconPlaceholder.style.width = '0';
334
+ iconPlaceholder.style.minWidth = '0';
335
+ }
336
+
330
337
  if (this.options.debug) {
331
338
  console.log('[AttachmentManager] Removed warning icon - all warnings resolved');
332
339
  }
333
340
  } else if (newMatches.length > 0 && !existingIcon) {
334
- // New matches appeared - add icon (shouldn't happen in normal flow, but handle it)
341
+ // New matches appeared - add icon and expand placeholder
335
342
  const match = newMatches[0];
336
343
  const messageState = match.intent?.handler?.['message-state'] || 'warning';
337
344
  const iconMap = {
@@ -340,6 +347,12 @@ export default class AttachmentManager {
340
347
  'info': 'trustquery-info.svg'
341
348
  };
342
349
 
350
+ // Expand the icon placeholder back to normal width
351
+ if (iconPlaceholder) {
352
+ iconPlaceholder.style.width = '24px';
353
+ iconPlaceholder.style.minWidth = '24px';
354
+ }
355
+
343
356
  const icon = document.createElement('img');
344
357
  icon.className = 'tq-attachment-icon';
345
358
  icon.src = `./assets/${iconMap[messageState] || iconMap.warning}`;
@@ -50,7 +50,8 @@ export default class AttachmentStyleManager {
50
50
  display: 'flex',
51
51
  alignItems: 'center',
52
52
  justifyContent: 'center',
53
- flexShrink: '0'
53
+ flexShrink: '0',
54
+ transition: 'width 0.3s ease, min-width 0.3s ease'
54
55
  });
55
56
  }
56
57