sonance-brand-mcp 1.3.83 → 1.3.84

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.
@@ -396,7 +396,27 @@ export function ChatInterface({
396
396
  )}
397
397
 
398
398
  {/* Input */}
399
- <div className="flex gap-2">
399
+ <div
400
+ className="flex gap-2"
401
+ onPointerDown={(e) => {
402
+ // Force focus to input when clicking anywhere in this container
403
+ // This bypasses modal focus traps by using requestAnimationFrame
404
+ e.stopPropagation();
405
+ const input = inputRef.current;
406
+ if (input && !isProcessing) {
407
+ // Blur any currently focused element first (escape focus trap)
408
+ if (document.activeElement && document.activeElement !== input) {
409
+ (document.activeElement as HTMLElement).blur?.();
410
+ }
411
+ // Use rAF to ensure focus happens after any focus trap logic runs
412
+ requestAnimationFrame(() => {
413
+ input.focus();
414
+ // Also try native focus method as fallback
415
+ input.click();
416
+ });
417
+ }
418
+ }}
419
+ >
400
420
  <input
401
421
  ref={inputRef}
402
422
  type="text"
@@ -404,15 +424,31 @@ export function ChatInterface({
404
424
  onChange={(e) => setInput(e.target.value)}
405
425
  onClick={(e) => {
406
426
  e.stopPropagation();
407
- inputRef.current?.focus();
427
+ e.preventDefault();
428
+ // Force focus using multiple strategies
429
+ const input = inputRef.current;
430
+ if (input) {
431
+ // Escape any focus trap
432
+ if (document.activeElement && document.activeElement !== input) {
433
+ (document.activeElement as HTMLElement).blur?.();
434
+ }
435
+ input.focus();
436
+ }
408
437
  }}
409
438
  onPointerDown={(e) => {
410
439
  e.stopPropagation();
411
- inputRef.current?.focus();
440
+ // Don't preventDefault here - let native click handling work
441
+ const input = inputRef.current;
442
+ if (input) {
443
+ requestAnimationFrame(() => input.focus());
444
+ }
412
445
  }}
413
446
  onMouseDown={(e) => {
414
447
  e.stopPropagation();
415
- inputRef.current?.focus();
448
+ const input = inputRef.current;
449
+ if (input) {
450
+ requestAnimationFrame(() => input.focus());
451
+ }
416
452
  }}
417
453
  onKeyDown={(e) => {
418
454
  if (e.key === "Enter" && !e.shiftKey) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonance-brand-mcp",
3
- "version": "1.3.83",
3
+ "version": "1.3.84",
4
4
  "description": "MCP Server for Sonance Brand Guidelines and Component Library - gives Claude instant access to brand colors, typography, and UI components.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",