@admin-layout/tailwind-chat-pro 12.2.4-alpha.87 → 12.2.4-alpha.88

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,4 +1,4 @@
1
- import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {Slot}from'@common-stack/components-pro';import {AiAgentMessageRole}from'common';import {format,differenceInMinutes}from'date-fns';import {marked}from'marked';import React,{useMemo,useEffect}from'react';import ReactMarkdown from'react-markdown';import remarkBreaks from'remark-breaks';import remarkGfm from'remark-gfm';import {MessengerSlotFillNameEnum}from'./messenger-slot-fill-name-enum.js';import {FilesList}from'./FilesList.js';import {ErrorFixCard}from'./ErrorFixCard.js';// Configure marked for better markdown rendering
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {Slot}from'@common-stack/components-pro';import {AiAgentMessageRole}from'common';import {format,differenceInMinutes}from'date-fns';import {marked}from'marked';import React,{useMemo,useEffect,useState}from'react';import ReactMarkdown from'react-markdown';import remarkBreaks from'remark-breaks';import remarkGfm from'remark-gfm';import {MessengerSlotFillNameEnum}from'./messenger-slot-fill-name-enum.js';import {FilesList}from'./FilesList.js';import {ErrorFixCard}from'./ErrorFixCard.js';// Configure marked for better markdown rendering
2
2
  marked.setOptions({
3
3
  breaks: true,
4
4
  // Convert line breaks to <br>
@@ -14,6 +14,9 @@ const ASSISTANT_RESPONSE_BUBBLE_CLASS = 'llm-response__bubble';
14
14
  const ASSISTANT_RESPONSE_MARKDOWN_CLASS = 'llm-response__markdown';
15
15
  const USER_MESSAGE_TEXT_SIZE_CLASS = 'text-base';
16
16
  const USER_MESSAGE_PROSE_SIZE_CLASS = 'prose-base';
17
+ /** Pasted queries longer than this collapse behind a "Show more" toggle. */
18
+ const USER_MESSAGE_COLLAPSE_CHAR_THRESHOLD = 600;
19
+ const USER_MESSAGE_COLLAPSED_MAX_HEIGHT = 220;
17
20
  function getAssistantResponseClasses(innerClassName) {
18
21
  return [ASSISTANT_RESPONSE_MARKDOWN_CLASS, innerClassName].filter(Boolean).join(' ');
19
22
  }
@@ -37,15 +40,15 @@ const htmlContentStyles = `
37
40
  .html-content {
38
41
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
39
42
  line-height: 1.6;
40
- color: #374151;
43
+ color: inherit;
41
44
  }
42
-
45
+
43
46
  .html-content h1, .html-content h2, .html-content h3, .html-content h4, .html-content h5, .html-content h6 {
44
47
  margin-top: 1.5rem;
45
48
  margin-bottom: 1rem;
46
49
  font-weight: 600;
47
50
  line-height: 1.25;
48
- color: #111827;
51
+ color: inherit;
49
52
  }
50
53
 
51
54
  .html-content h1 {
@@ -347,6 +350,15 @@ const htmlContentStyles = `
347
350
  box-shadow: none !important;
348
351
  }
349
352
 
353
+ /* Safety net: long unbroken tokens (file paths, CSS selectors, URLs) inside a
354
+ pasted user query must never push the bubble past its own width — wrap
355
+ anywhere rather than overflow the card. */
356
+ .user-message,
357
+ .user-message * {
358
+ max-width: 100%;
359
+ overflow-wrap: anywhere;
360
+ }
361
+
350
362
  .assistant-message-container {
351
363
  background: transparent;
352
364
  padding-top: 0;
@@ -356,338 +368,6 @@ const htmlContentStyles = `
356
368
  box-shadow: none;
357
369
  }
358
370
 
359
- .assistant-html-content {
360
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
361
- line-height: 1.6;
362
- color: #374151;
363
- }
364
-
365
- .assistant-html-content h1,
366
- .assistant-html-content h2,
367
- .assistant-html-content h3,
368
- .assistant-html-content h4,
369
- .assistant-html-content h5,
370
- .assistant-html-content h6 {
371
- font-weight: 600;
372
- line-height: 1.25;
373
- color: #111827;
374
- }
375
-
376
- .assistant-html-content h1 {
377
- font-size: 1.875rem;
378
- margin-top: 2rem;
379
- margin-bottom: 1rem;
380
- }
381
-
382
- .assistant-html-content h2 {
383
- font-size: 1.5rem;
384
- margin-top: 2rem;
385
- margin-bottom: 1rem;
386
- }
387
-
388
- .assistant-html-content h3 {
389
- font-size: 1.25rem;
390
- margin-top: 1.5rem;
391
- margin-bottom: 1rem;
392
- }
393
-
394
- .assistant-html-content h4 {
395
- font-size: 1.125rem;
396
- margin-top: 1rem;
397
- margin-bottom: 0.5rem;
398
- }
399
-
400
- .assistant-html-content p {
401
- margin-top: 0;
402
- margin-bottom: 1rem;
403
- line-height: 1.625;
404
- color: #374151;
405
- }
406
-
407
- .assistant-html-content ul,
408
- .assistant-html-content ol {
409
- margin: 1rem 0;
410
- padding-left: 1.25rem;
411
- }
412
-
413
- .assistant-html-content ul {
414
- list-style-type: disc;
415
- }
416
-
417
- .assistant-html-content ol {
418
- list-style-type: decimal;
419
- }
420
-
421
- .assistant-html-content li {
422
- margin-bottom: 0.375rem;
423
- line-height: 1.625;
424
- color: #374151;
425
- }
426
-
427
- .assistant-html-content li > ul,
428
- .assistant-html-content li > ol {
429
- margin-top: 0.375rem;
430
- margin-bottom: 0.375rem;
431
- }
432
-
433
- .assistant-html-content a {
434
- color: #2563eb;
435
- text-decoration: none;
436
- }
437
-
438
- .assistant-html-content a:hover {
439
- color: #1d4ed8;
440
- text-decoration: underline;
441
- text-underline-offset: 2px;
442
- }
443
-
444
- .assistant-html-content strong,
445
- .assistant-html-content b {
446
- font-weight: 600;
447
- color: #111827;
448
- }
449
-
450
- .assistant-html-content em,
451
- .assistant-html-content i {
452
- font-style: italic;
453
- color: #4b5563;
454
- }
455
-
456
- .assistant-html-content code {
457
- background-color: #f3f4f6;
458
- padding: 0.25rem 0.5rem;
459
- border-radius: 0.375rem;
460
- font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
461
- font-size: 0.875rem;
462
- color: #dc2626;
463
- border: 1px solid #e5e7eb;
464
- }
465
-
466
- .assistant-html-content pre {
467
- background-color: #f9fafb;
468
- padding: 1rem;
469
- border-radius: 0.5rem;
470
- overflow-x: auto;
471
- font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
472
- font-size: 0.875rem;
473
- line-height: 1.5;
474
- border: 1px solid #e5e7eb;
475
- margin: 1.5rem 0;
476
- }
477
-
478
- .assistant-html-content pre code {
479
- background-color: transparent;
480
- padding: 0;
481
- border: none;
482
- color: #374151;
483
- font-size: inherit;
484
- }
485
-
486
- .assistant-html-content blockquote {
487
- margin: 1.5rem 0;
488
- padding: 0 0 0 1rem;
489
- border-left: 4px solid #d1d5db;
490
- font-style: italic;
491
- color: #6b7280;
492
- background-color: transparent;
493
- border-radius: 0;
494
- }
495
-
496
- .assistant-html-content blockquote p {
497
- margin-bottom: 0;
498
- }
499
-
500
- .assistant-html-content table {
501
- border-collapse: collapse;
502
- border: 1px solid #e5e7eb;
503
- width: 100%;
504
- margin: 1rem 0;
505
- }
506
-
507
- .assistant-html-content th,
508
- .assistant-html-content td {
509
- text-align: left;
510
- vertical-align: top;
511
- }
512
-
513
- .assistant-html-content th {
514
- padding: 0.5rem 1rem;
515
- background-color: #f9fafb;
516
- border: 1px solid #e5e7eb;
517
- font-weight: 500;
518
- font-size: 0.75rem;
519
- letter-spacing: 0.04em;
520
- text-transform: uppercase;
521
- color: #4b5563;
522
- }
523
-
524
- .assistant-html-content td {
525
- padding: 0.5rem 1rem;
526
- border-top: 1px solid #e5e7eb;
527
- color: #374151;
528
- }
529
-
530
- .assistant-html-content hr {
531
- border: none;
532
- border-top: 1px solid #e5e7eb;
533
- margin: 2rem 0;
534
- }
535
-
536
- /* Markdown content styling */
537
- .markdown-content {
538
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
539
- line-height: 1.6;
540
- color: #374151;
541
- }
542
-
543
- .markdown-content h1 {
544
- font-size: 1.5rem;
545
- font-weight: 700;
546
- margin-top: 1.5rem;
547
- margin-bottom: 1rem;
548
- color: #111827;
549
- padding-bottom: 0.5rem;
550
- border-bottom: 2px solid #e5e7eb;
551
- }
552
-
553
- .markdown-content h2 {
554
- font-size: 1.25rem;
555
- font-weight: 600;
556
- margin-top: 1.25rem;
557
- margin-bottom: 0.75rem;
558
- color: #1f2937;
559
- padding-bottom: 0.375rem;
560
- border-bottom: 1px solid #e5e7eb;
561
- }
562
-
563
- .markdown-content h3 {
564
- font-size: 1.125rem;
565
- font-weight: 600;
566
- margin-top: 1rem;
567
- margin-bottom: 0.5rem;
568
- color: #374151;
569
- }
570
-
571
- .markdown-content p {
572
- margin-bottom: 0.75rem;
573
- line-height: 1.6;
574
- color: #4b5563;
575
- }
576
-
577
- .markdown-content ul, .markdown-content ol {
578
- margin: 1rem 0;
579
- padding-left: 1.5rem;
580
- }
581
-
582
- .markdown-content li {
583
- margin-bottom: 0.5rem;
584
- line-height: 1.6;
585
- }
586
-
587
- .markdown-content code {
588
- background-color: #f3f4f6;
589
- padding: 0.125rem 0.375rem;
590
- border-radius: 0.25rem;
591
- font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
592
- font-size: 0.875rem;
593
- color: #dc2626;
594
- border: 1px solid #e5e7eb;
595
- }
596
-
597
- .markdown-content pre {
598
- color: #1f2937;
599
- border-radius: 8px;
600
- overflow-x: auto;
601
- font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
602
- font-size: 0.875rem;
603
- line-height: 1.5;
604
- margin: 1rem 0;
605
- }
606
-
607
- .markdown-content pre code {
608
- background-color: transparent;
609
- padding: 0;
610
- border: none;
611
- color: #1f2937;
612
- font-size: inherit;
613
- }
614
-
615
- .markdown-content blockquote {
616
- border-left: 4px solid #3b82f6;
617
- background-color: #f8fafc;
618
- padding: 1rem;
619
- margin: 1rem 0;
620
- border-radius: 6px;
621
- font-style: italic;
622
- color: #475569;
623
- border-top: 1px solid #e5e7eb;
624
- border-right: 1px solid #e5e7eb;
625
- border-bottom: 1px solid #e5e7eb;
626
- }
627
-
628
- .markdown-content table {
629
- border-collapse: collapse;
630
- border: 1px solid #e5e7eb;
631
- width: 100%;
632
- margin: 1rem 0;
633
- border-radius: 8px;
634
- overflow: hidden;
635
- box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
636
- }
637
-
638
- .markdown-content th {
639
- background-color: #f9fafb;
640
- color: #374151;
641
- font-weight: 600;
642
- padding: 0.75rem;
643
- text-align: left;
644
- border-bottom: 1px solid #e5e7eb;
645
- font-size: 0.875rem;
646
- }
647
-
648
- .markdown-content td {
649
- border: 1px solid #e5e7eb;
650
- padding: 0.75rem;
651
- text-align: left;
652
- vertical-align: top;
653
- background-color: white;
654
- font-size: 0.875rem;
655
- }
656
-
657
- .markdown-content tr:nth-child(even) td {
658
- background-color: #f9fafb;
659
- }
660
-
661
- .markdown-content tr:hover td {
662
- background-color: #f3f4f6;
663
- }
664
-
665
- /* Enhanced list styling */
666
- .markdown-content ul li {
667
- position: relative;
668
- padding-left: 0.5rem;
669
- }
670
-
671
- .markdown-content ul li::before {
672
- content: "•";
673
- color: #000;
674
- font-weight: bold;
675
- position: absolute;
676
- left: -1rem;
677
- }
678
-
679
- .markdown-content ol li {
680
- position: relative;
681
- padding-left: 0.5rem;
682
- }
683
-
684
- .markdown-content ol li::before {
685
- content: counter(list-item) ".";
686
- font-weight: 600;
687
- position: absolute;
688
- left: -1.5rem;
689
- }
690
-
691
371
  /* Code block container styling */
692
372
  .code-block-container {
693
373
  background: #ffffff;
@@ -709,38 +389,6 @@ const htmlContentStyles = `
709
389
  letter-spacing: 0.05em;
710
390
  }
711
391
 
712
- .code-block-content {
713
- padding: 1rem;
714
- overflow-x: auto;
715
- }
716
-
717
- /* Enhanced prose styling for markdown content */
718
- .prose pre {
719
- background-color: #f9fafb;
720
- border: 1px solid #e5e7eb;
721
- border-radius: 0.5rem;
722
- padding: 1rem;
723
- overflow-x: auto;
724
- }
725
-
726
- .prose code {
727
- background-color: #f3f4f6;
728
- padding: 0.125rem 0.375rem;
729
- border-radius: 0.25rem;
730
- font-size: 0.875rem;
731
- border: 1px solid #e5e7eb;
732
- }
733
-
734
- .prose pre code {
735
- background-color: transparent;
736
- padding: 0;
737
- border: none;
738
- color:#000;
739
- }
740
-
741
- .hover\:bg-gray-100:hover {
742
- background-color: transparent !important;
743
- }
744
392
  `;
745
393
  // Hook to inject CSS styles
746
394
  const useInjectStyles = () => {
@@ -1185,7 +833,7 @@ const CodeFormatter = ({
1185
833
  }
1186
834
  // Regular text content
1187
835
  return jsx("div", {
1188
- className: `${variant === 'user' ? USER_MESSAGE_TEXT_SIZE_CLASS : 'text-sm'} ${variant === 'user' ? planMode ? 'text-primary-foreground' : 'text-gray-900' : 'text-gray-700'} leading-relaxed whitespace-pre-wrap break-words`,
836
+ className: `${variant === 'user' ? USER_MESSAGE_TEXT_SIZE_CLASS : 'text-sm'} ${variant === 'user' ? 'text-foreground' : 'text-gray-700'} leading-relaxed whitespace-pre-wrap break-words`,
1189
837
  children: section.trim()
1190
838
  }, index);
1191
839
  })
@@ -1262,52 +910,52 @@ const FormattedMessageContent = ({
1262
910
  };
1263
911
  }
1264
912
  }, [content]);
1265
- const userMarkdownClasses = `${USER_MESSAGE_TEXT_SIZE_CLASS} prose ${USER_MESSAGE_PROSE_SIZE_CLASS} max-w-none leading-relaxed break-words
1266
- prose-p:my-2 prose-p:text-gray-700
913
+ const userMarkdownClasses = `${USER_MESSAGE_TEXT_SIZE_CLASS} prose ${USER_MESSAGE_PROSE_SIZE_CLASS} max-w-none leading-relaxed break-words
914
+ prose-p:my-2 prose-p:text-foreground
1267
915
  prose-pre:my-2 prose-pre:bg-transparent prose-pre:border-0 prose-pre:p-0
1268
- prose-ul:my-2 prose-ol:my-2
1269
- prose-code:break-words prose-code:bg-gray-50 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-code:text-sm prose-code:font-mono
1270
- prose-headings:font-semibold prose-headings:text-gray-900 prose-headings:mt-4 prose-headings:mb-2
1271
- prose-h1:text-2xl prose-h1:border-b prose-h1:border-gray-200 prose-h1:pb-2
1272
- prose-h2:text-xl prose-h2:border-b prose-h2:border-gray-200 prose-h2:pb-1
916
+ prose-ul:my-2 prose-ol:my-2
917
+ prose-code:break-words prose-code:bg-muted prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-code:text-sm prose-code:font-mono
918
+ prose-headings:font-semibold prose-headings:text-foreground prose-headings:mt-4 prose-headings:mb-2
919
+ prose-h1:text-2xl prose-h1:border-b prose-h1:border-border prose-h1:pb-2
920
+ prose-h2:text-xl prose-h2:border-b prose-h2:border-border prose-h2:pb-1
1273
921
  prose-h3:text-lg
1274
922
  prose-h4:text-base
1275
- prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline
1276
- prose-strong:font-semibold prose-strong:text-gray-900
1277
- prose-em:text-gray-600
1278
- prose-blockquote:border-l-4 prose-blockquote:border-blue-400 prose-blockquote:pl-4 prose-blockquote:py-2 prose-blockquote:bg-blue-50 prose-blockquote:rounded-r-md prose-blockquote:my-3 prose-blockquote:italic
1279
- prose-table:w-full prose-table:border prose-table:border-gray-200 prose-table:rounded-md prose-table:my-4
1280
- prose-th:px-3 prose-th:py-2 prose-th:text-left prose-th:font-semibold prose-th:bg-gray-50 prose-th:border prose-th:border-gray-200
1281
- prose-td:px-3 prose-td:py-2 prose-td:border prose-td:border-gray-200 prose-td:text-gray-700
1282
- prose-li:my-1 prose-li:text-gray-700
1283
- prose-hr:my-4 prose-hr:border-gray-200
1284
- ${planMode ? '!prose-p:text-primary-foreground !prose-li:text-primary-foreground !prose-strong:text-primary-foreground !prose-em:text-primary-foreground !prose-a:text-primary-foreground' : '!prose-p:text-gray-900 !prose-li:text-gray-900 !prose-strong:text-gray-900 !prose-em:text-gray-700 !prose-a:text-blue-600'}`;
1285
- const userHtmlClasses = `${USER_MESSAGE_TEXT_SIZE_CLASS} prose ${USER_MESSAGE_PROSE_SIZE_CLASS} max-w-none leading-relaxed break-words
1286
- prose-p:my-2 prose-p:text-gray-700
1287
- prose-pre:my-2 prose-pre:bg-gray-50 prose-pre:border prose-pre:border-gray-200 prose-pre:rounded prose-pre:p-3
1288
- prose-ul:my-2 prose-ol:my-2
923
+ prose-a:text-foreground prose-a:underline hover:prose-a:text-foreground
924
+ prose-strong:font-semibold prose-strong:text-foreground
925
+ prose-em:text-muted-foreground
926
+ prose-blockquote:border-l-2 prose-blockquote:border-border prose-blockquote:pl-4 prose-blockquote:py-2 prose-blockquote:bg-transparent prose-blockquote:my-3 prose-blockquote:italic prose-blockquote:text-muted-foreground
927
+ prose-table:w-full prose-table:border prose-table:border-border prose-table:rounded-md prose-table:my-4
928
+ prose-th:px-3 prose-th:py-2 prose-th:text-left prose-th:font-semibold prose-th:bg-muted prose-th:border prose-th:border-border
929
+ prose-td:px-3 prose-td:py-2 prose-td:border prose-td:border-border prose-td:text-foreground
930
+ prose-li:my-1 prose-li:text-foreground
931
+ prose-hr:my-4 prose-hr:border-border
932
+ !prose-p:text-foreground !prose-li:text-foreground !prose-strong:text-foreground !prose-em:text-muted-foreground !prose-a:text-foreground`;
933
+ const userHtmlClasses = `${USER_MESSAGE_TEXT_SIZE_CLASS} prose ${USER_MESSAGE_PROSE_SIZE_CLASS} max-w-none leading-relaxed break-words
934
+ prose-p:my-2 prose-p:text-foreground
935
+ prose-pre:my-2 prose-pre:bg-muted prose-pre:border prose-pre:border-border prose-pre:rounded prose-pre:p-3
936
+ prose-ul:my-2 prose-ol:my-2
1289
937
  prose-pre:whitespace-pre-wrap prose-pre:break-words prose-pre:overflow-x-auto
1290
- prose-code:break-words prose-code:bg-gray-50 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-code:text-sm prose-code:font-mono
1291
- prose-headings:font-semibold prose-headings:text-gray-900 prose-headings:mt-4 prose-headings:mb-2
1292
- prose-h1:text-2xl prose-h1:border-b prose-h1:border-gray-200 prose-h1:pb-2
1293
- prose-h2:text-xl prose-h2:border-b prose-h2:border-gray-200 prose-h2:pb-1
938
+ prose-code:break-words prose-code:bg-muted prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-code:text-sm prose-code:font-mono
939
+ prose-headings:font-semibold prose-headings:text-foreground prose-headings:mt-4 prose-headings:mb-2
940
+ prose-h1:text-2xl prose-h1:border-b prose-h1:border-border prose-h1:pb-2
941
+ prose-h2:text-xl prose-h2:border-b prose-h2:border-border prose-h2:pb-1
1294
942
  prose-h3:text-lg
1295
943
  prose-h4:text-base
1296
- prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline
1297
- prose-strong:font-semibold prose-strong:text-gray-900
1298
- prose-em:text-gray-600
1299
- prose-blockquote:border-l-4 prose-blockquote:border-blue-400 prose-blockquote:pl-4 prose-blockquote:py-2 prose-blockquote:bg-blue-50 prose-blockquote:rounded-r-md prose-blockquote:my-3 prose-blockquote:italic
1300
- prose-table:w-full prose-table:border prose-table:border-gray-200 prose-table:rounded-md prose-table:my-4
1301
- prose-th:px-3 prose-th:py-2 prose-th:text-left prose-th:font-semibold prose-th:bg-gray-50 prose-th:border prose-th:border-gray-200
1302
- prose-td:px-3 prose-td:py-2 prose-td:border prose-td:border-gray-200 prose-td:text-gray-700
1303
- prose-li:my-1 prose-li:text-gray-700
1304
- prose-hr:my-4 prose-hr:border-gray-200
1305
- ${planMode ? '!prose-p:text-primary-foreground !prose-li:text-primary-foreground !prose-strong:text-primary-foreground !prose-em:text-primary-foreground !prose-a:text-primary-foreground' : '!prose-p:text-gray-900 !prose-li:text-gray-900 !prose-strong:text-gray-900 !prose-em:text-gray-700 !prose-a:text-blue-600'}`;
944
+ prose-a:text-foreground prose-a:underline hover:prose-a:text-foreground
945
+ prose-strong:font-semibold prose-strong:text-foreground
946
+ prose-em:text-muted-foreground
947
+ prose-blockquote:border-l-2 prose-blockquote:border-border prose-blockquote:pl-4 prose-blockquote:py-2 prose-blockquote:bg-transparent prose-blockquote:my-3 prose-blockquote:italic prose-blockquote:text-muted-foreground
948
+ prose-table:w-full prose-table:border prose-table:border-border prose-table:rounded-md prose-table:my-4
949
+ prose-th:px-3 prose-th:py-2 prose-th:text-left prose-th:font-semibold prose-th:bg-muted prose-th:border prose-th:border-border
950
+ prose-td:px-3 prose-td:py-2 prose-td:border prose-td:border-border prose-td:text-foreground
951
+ prose-li:my-1 prose-li:text-foreground
952
+ prose-hr:my-4 prose-hr:border-border
953
+ !prose-p:text-foreground !prose-li:text-foreground !prose-strong:text-foreground !prose-em:text-muted-foreground !prose-a:text-foreground`;
1306
954
  const markdownComponents = useMemo(() => {
1307
955
  const isUserVariant = variant === 'user';
1308
- const userTextClass = planMode ? 'text-primary-foreground' : 'text-gray-900';
1309
- const userMutedTextClass = planMode ? 'text-primary-foreground' : 'text-gray-700';
1310
- const userLinkClass = planMode ? 'text-primary-foreground underline underline-offset-2' : 'text-blue-600 hover:underline underline-offset-2';
956
+ const userTextClass = 'text-foreground';
957
+ const userMutedTextClass = 'text-muted-foreground';
958
+ const userLinkClass = 'text-foreground underline underline-offset-2 hover:text-foreground/80';
1311
959
  return {
1312
960
  p: ({
1313
961
  children
@@ -1352,24 +1000,24 @@ const FormattedMessageContent = ({
1352
1000
  blockquote: ({
1353
1001
  children
1354
1002
  }) => isUserVariant ? jsx("blockquote", {
1355
- className: `border-l-4 border-blue-400 pl-4 py-2 bg-blue-50 rounded-r-md my-3 italic ${userMutedTextClass}`,
1003
+ className: `border-l-2 border-border pl-4 py-2 bg-transparent my-3 italic ${userMutedTextClass}`,
1356
1004
  children: children
1357
1005
  }) : jsx("blockquote", {
1358
1006
  children: children
1359
1007
  }),
1360
1008
  hr: () => isUserVariant ? jsx("hr", {
1361
- className: "my-4 border-gray-200"
1009
+ className: "my-4 border-border"
1362
1010
  }) : jsx("hr", {}),
1363
1011
  ul: ({
1364
1012
  children
1365
1013
  }) => jsx("ul", {
1366
- className: isUserVariant ? `list-disc pl-5 mb-4 space-y-1.5 marker:text-gray-500 [&_ul]:mt-1.5 [&_ol]:mt-1.5 ${userTextClass}` : 'list-disc pl-5',
1014
+ className: isUserVariant ? `list-disc pl-5 mb-4 space-y-1.5 marker:text-muted-foreground [&_ul]:mt-1.5 [&_ol]:mt-1.5 ${userTextClass}` : 'list-disc pl-5',
1367
1015
  children: children
1368
1016
  }),
1369
1017
  ol: ({
1370
1018
  children
1371
1019
  }) => jsx("ol", {
1372
- className: isUserVariant ? `list-decimal pl-5 mb-4 space-y-1.5 marker:text-gray-500 [&_ul]:mt-1.5 [&_ol]:mt-1.5 ${userTextClass}` : 'list-decimal pl-5',
1020
+ className: isUserVariant ? `list-decimal pl-5 mb-4 space-y-1.5 marker:text-muted-foreground [&_ul]:mt-1.5 [&_ol]:mt-1.5 ${userTextClass}` : 'list-decimal pl-5',
1373
1021
  children: children
1374
1022
  }),
1375
1023
  li: ({
@@ -1393,7 +1041,7 @@ const FormattedMessageContent = ({
1393
1041
  children,
1394
1042
  ...props
1395
1043
  }) => isUserVariant ? jsx("div", {
1396
- className: "overflow-x-auto my-4 w-full rounded-md border border-gray-200",
1044
+ className: "overflow-x-auto my-4 w-full rounded-md border border-border",
1397
1045
  children: jsx("table", {
1398
1046
  className: "w-full text-sm",
1399
1047
  ...props,
@@ -1409,7 +1057,7 @@ const FormattedMessageContent = ({
1409
1057
  thead: ({
1410
1058
  children
1411
1059
  }) => isUserVariant ? jsx("thead", {
1412
- className: "bg-gray-50 text-left",
1060
+ className: "bg-muted text-left",
1413
1061
  children: children
1414
1062
  }) : jsx("thead", {
1415
1063
  children: children
@@ -1463,7 +1111,7 @@ const FormattedMessageContent = ({
1463
1111
  });
1464
1112
  }
1465
1113
  return jsx("code", {
1466
- className: isUserVariant ? `rounded px-1.5 py-0.5 text-sm font-mono bg-gray-50 break-words ${className || ''}` : `llm-inline-code break-words ${className || ''}`,
1114
+ className: isUserVariant ? `rounded px-1.5 py-0.5 text-sm font-mono bg-muted break-words ${className || ''}` : `llm-inline-code break-words ${className || ''}`,
1467
1115
  ...rest,
1468
1116
  children: children
1469
1117
  });
@@ -1514,7 +1162,7 @@ const FormattedMessageContent = ({
1514
1162
  }
1515
1163
  // For plain text content
1516
1164
  return variant === 'user' ? jsx("p", {
1517
- className: `${USER_MESSAGE_TEXT_SIZE_CLASS} leading-relaxed whitespace-pre-wrap break-words ${planMode ? 'text-primary-foreground' : 'text-gray-900'}`,
1165
+ className: `${USER_MESSAGE_TEXT_SIZE_CLASS} leading-relaxed whitespace-pre-wrap break-words text-foreground`,
1518
1166
  children: content
1519
1167
  }) : jsx(AssistantResponseWrapper, {
1520
1168
  children: jsx("div", {
@@ -1659,9 +1307,12 @@ const ModernMessageBubble = ({
1659
1307
  const handleClick = () => {
1660
1308
  onMessageClick?.(message);
1661
1309
  };
1310
+ const [expanded, setExpanded] = useState(false);
1662
1311
  const isAssistantRole = message?.propsConfiguration?.contents?.role === AiAgentMessageRole.Assistant;
1663
1312
  const messageMode = message?.propsConfiguration?.contents?.mode ?? message?.propsConfiguration?.content?.mode ?? message?.props?.mode;
1664
1313
  const isPlanMode = messageMode === 'plan';
1314
+ const isLongUserMessage = !isAssistantRole && (message?.message?.length ?? 0) > USER_MESSAGE_COLLAPSE_CHAR_THRESHOLD;
1315
+ const isCollapsed = isLongUserMessage && !expanded;
1665
1316
  // For user messages, create a right-aligned layout with avatar and name
1666
1317
  if (isOwnMessage) {
1667
1318
  const authorName = message.author?.givenName && message.author?.familyName ? `${message.author.givenName} ${message.author.familyName}` : message.author?.username || 'You';
@@ -1670,23 +1321,26 @@ const ModernMessageBubble = ({
1670
1321
  children: jsxs("div", {
1671
1322
  className: "flex items-start justify-end gap-2",
1672
1323
  children: [jsxs("div", {
1673
- className: "flex flex-col items-end max-w-[85%]",
1324
+ className: "flex flex-col items-end max-w-[85%] min-w-0",
1674
1325
  children: [showAuthorName && jsx("div", {
1675
1326
  className: "flex items-end space-x-2 mb-0.5",
1676
1327
  children: jsx("span", {
1677
- className: "text-sm font-semibold text-gray-900",
1328
+ className: "text-sm font-semibold text-foreground",
1678
1329
  children: authorName
1679
1330
  })
1680
1331
  }), jsxs("div", {
1681
- className: `${isAssistantRole ? 'text-sm' : USER_MESSAGE_TEXT_SIZE_CLASS} ${isAssistantRole ? 'cursor-pointer rounded-2xl border border-gray-200 bg-gray-50 text-gray-900 px-4 py-2.5' :
1682
- // : 'user-message rounded-[22px] rounded-br-[4px] px-4 py-3 bg-primary text-primary-foreground shadow-sm'
1683
- isPlanMode ? 'user-message rounded-[22px] rounded-br-[4px] px-4 py-3 bg-primary text-primary-foreground shadow-sm' : 'user-message rounded-[22px] rounded-br-[4px] px-4 py-3 '}`,
1332
+ className: `${isAssistantRole ? 'text-sm' : USER_MESSAGE_TEXT_SIZE_CLASS} ${isAssistantRole ? 'cursor-pointer rounded-2xl border border-border bg-muted text-foreground px-4 py-2.5' : 'user-message rounded-[22px] rounded-br-[4px] px-4 py-3 bg-muted text-foreground shadow-sm'}`,
1684
1333
  onClick: isAssistantRole ? handleClick : undefined,
1685
1334
  dir: detectTextDirection(message?.message || ''),
1686
1335
  lang: detectLanguageTag(message?.message || ''),
1687
- children: [message.message && jsx("div", {
1688
- className: "max-w-none",
1689
- children: (() => {
1336
+ children: [message.message && jsxs("div", {
1337
+ className: `max-w-none ${isCollapsed ? 'relative overflow-hidden' : ''}`,
1338
+ style: isCollapsed ? {
1339
+ maxHeight: USER_MESSAGE_COLLAPSED_MAX_HEIGHT
1340
+ } : undefined,
1341
+ children: [isCollapsed && jsx("div", {
1342
+ className: "pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-muted to-transparent"
1343
+ }), (() => {
1690
1344
  const contentType = detectContentType(message.message);
1691
1345
  if (contentType === 'code') {
1692
1346
  return jsx(CodeFormatter, {
@@ -1707,7 +1361,7 @@ const ModernMessageBubble = ({
1707
1361
  });
1708
1362
  }
1709
1363
  return jsx("div", {
1710
- className: isPlanMode ? '!text-primary-foreground html-content' : 'text-gray-900 html-content',
1364
+ className: "text-foreground html-content",
1711
1365
  dangerouslySetInnerHTML: {
1712
1366
  __html: prettifyHtmlContent(sanitizeHtml(message.message))
1713
1367
  }
@@ -1720,7 +1374,27 @@ const ModernMessageBubble = ({
1720
1374
  showCopyDownloadOnCodeBlock: showCopyDownloadOnCodeBlock
1721
1375
  });
1722
1376
  }
1723
- })()
1377
+ })()]
1378
+ }), isLongUserMessage && jsxs("button", {
1379
+ type: "button",
1380
+ onClick: e => {
1381
+ e.stopPropagation();
1382
+ setExpanded(v => !v);
1383
+ },
1384
+ className: "mt-1 flex items-center gap-1 text-sm font-medium text-muted-foreground hover:text-foreground",
1385
+ children: [expanded ? 'Show less' : 'Show more', jsx("svg", {
1386
+ viewBox: "0 0 24 24",
1387
+ fill: "none",
1388
+ stroke: "currentColor",
1389
+ strokeWidth: 2,
1390
+ strokeLinecap: "round",
1391
+ strokeLinejoin: "round",
1392
+ className: `h-3.5 w-3.5 transition-transform ${expanded ? 'rotate-180' : ''}`,
1393
+ "aria-hidden": true,
1394
+ children: jsx("path", {
1395
+ d: "M6 9l6 6 6-6"
1396
+ })
1397
+ })]
1724
1398
  }), tryExtractBuilderBlocks(message?.message)?.length ? jsx("div", {
1725
1399
  className: "mt-2",
1726
1400
  children: jsx(BuilderLikeRenderer, {
@@ -1738,7 +1412,7 @@ const ModernMessageBubble = ({
1738
1412
  files: message.files.data
1739
1413
  })
1740
1414
  }), showTimestamp ? jsx("div", {
1741
- className: `text-[10px] mt-1 text-right ${isAssistantRole ? 'text-gray-500' : isPlanMode ? 'text-primary-foreground/80' : 'text-gray-500'}`,
1415
+ className: "text-[10px] mt-1 text-right text-muted-foreground",
1742
1416
  children: formatTime(message.createdAt)
1743
1417
  }) : null]
1744
1418
  })]