@topconsultnpm/sdkui-react 6.22.0-dev3.27 → 6.22.0-dev3.29

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 (105) hide show
  1. package/lib/components/NewComponents/ContextMenu/styles.d.ts +45 -43
  2. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +67 -60
  3. package/lib/components/base/Styled.d.ts +93 -77
  4. package/lib/components/base/TMCounterBar.d.ts +2 -2
  5. package/lib/components/base/TMCounterContainer.d.ts +2 -1
  6. package/lib/components/base/TMCustomButton.d.ts +1 -1
  7. package/lib/components/base/TMCustomButton.js +1 -0
  8. package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
  9. package/lib/components/base/TMFileManager.d.ts +2 -1
  10. package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
  11. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
  12. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
  13. package/lib/components/base/TMFileManagerUtils.d.ts +4 -6
  14. package/lib/components/base/TMLayout.d.ts +4 -4
  15. package/lib/components/base/TMList.d.ts +2 -1
  16. package/lib/components/base/TMListView.d.ts +1 -1
  17. package/lib/components/base/TMPanel.js +167 -167
  18. package/lib/components/base/TMSpinner.d.ts +2 -1
  19. package/lib/components/base/TMTab.d.ts +4 -3
  20. package/lib/components/base/TMTabControl.js +208 -208
  21. package/lib/components/base/TMTooltip.d.ts +1 -1
  22. package/lib/components/base/TMTreeView.d.ts +14 -8
  23. package/lib/components/base/TMUserAvatar.d.ts +2 -1
  24. package/lib/components/base/TMVilViewer.d.ts +2 -1
  25. package/lib/components/base/TMWaitPanel.d.ts +3 -2
  26. package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +2 -1
  27. package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
  28. package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
  29. package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
  30. package/lib/components/choosers/TMQuickSearchInfo.d.ts +2 -1
  31. package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
  32. package/lib/components/choosers/TMUserChooser.d.ts +2 -2
  33. package/lib/components/editors/TMEditorStyled.d.ts +20 -42
  34. package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
  35. package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
  36. package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
  37. package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
  38. package/lib/components/features/assistant/TMHelpOnLineChat.js +492 -489
  39. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
  40. package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
  41. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
  42. package/lib/components/features/documents/TMDcmtIcon.d.ts +2 -1
  43. package/lib/components/features/documents/TMDcmtPreview.d.ts +8 -6
  44. package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
  45. package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
  46. package/lib/components/features/documents/TMFileUploader.js +21 -21
  47. package/lib/components/features/documents/TMMasterInfoFields.d.ts +2 -1
  48. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -1
  49. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +2 -1
  50. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +4 -4
  51. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
  52. package/lib/components/features/search/TMMetadataOutputForm.d.ts +2 -1
  53. package/lib/components/features/search/TMMetadataSorterForm.d.ts +2 -1
  54. package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
  55. package/lib/components/features/search/TMSearch.d.ts +2 -1
  56. package/lib/components/features/search/TMSearchQueryPanel.d.ts +9 -3
  57. package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
  58. package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
  59. package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
  60. package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
  61. package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
  62. package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
  63. package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
  64. package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
  65. package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
  66. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
  67. package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
  68. package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
  69. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
  70. package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
  71. package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
  72. package/lib/components/forms/Login/Chooser.d.ts +2 -2
  73. package/lib/components/forms/TMChooserForm.d.ts +2 -1
  74. package/lib/components/forms/TMSaveForm.d.ts +4 -4
  75. package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
  76. package/lib/components/grids/TMBlogHeader.d.ts +1 -1
  77. package/lib/components/grids/TMBlogsPost.d.ts +1 -1
  78. package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
  79. package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
  80. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +2 -1
  81. package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
  82. package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +5 -6
  83. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
  84. package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
  85. package/lib/components/pages/TMPage.d.ts +1 -1
  86. package/lib/components/query/TMQueryEditor.d.ts +14 -10
  87. package/lib/components/settings/SettingsAppearance.d.ts +2 -1
  88. package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
  89. package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
  90. package/lib/components/sidebar/TMHeader.d.ts +3 -3
  91. package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
  92. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
  93. package/lib/components/viewers/TMMidViewer.d.ts +2 -2
  94. package/lib/components/viewers/TMTidViewer.d.ts +2 -2
  95. package/lib/helper/TMAppUpdatedModal.d.ts +2 -1
  96. package/lib/helper/TMAppUpdatedModal.js +93 -93
  97. package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
  98. package/lib/helper/TMIcons.d.ts +280 -280
  99. package/lib/helper/TMPdfViewer.d.ts +2 -1
  100. package/lib/helper/TMToppyMessage.d.ts +2 -2
  101. package/lib/helper/TMUtils.d.ts +10 -4
  102. package/lib/helper/helpers.d.ts +1 -1
  103. package/lib/hooks/useInputDialog.d.ts +2 -1
  104. package/lib/services/platform_services.d.ts +3 -2
  105. package/package.json +1 -1
@@ -139,7 +139,10 @@ const ChatPanel = ({ width, onWidthChange, messages, conversationId, isThinking,
139
139
  const TMChatInput = ({ value, onChange, onSend, placeholder = 'Scrivi la tua domanda...', disabled = false, inputRef, tooltip = 'Ricerca AI' }) => {
140
140
  const isDisabled = disabled || value.length < 2;
141
141
  return (_jsxs(ChatInputWrapper, { children: [_jsx(ChatInputTextarea, { ref: inputRef, placeholder: placeholder, value: value, onChange: (e) => onChange(e.target.value), onKeyDown: (e) => {
142
- if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {
142
+ if (e.key !== 'Enter')
143
+ return;
144
+ e.stopPropagation();
145
+ if (!e.shiftKey && !e.nativeEvent.isComposing) {
143
146
  e.preventDefault();
144
147
  if (!isDisabled)
145
148
  onSend();
@@ -394,492 +397,492 @@ function IconNewChat(props) {
394
397
  }
395
398
  //#endregion
396
399
  //#region Styled Components
397
- const fadeIn = keyframes `
398
- from { opacity: 0; }
399
- to { opacity: 1; }
400
- `;
401
- const slideInRight = keyframes `
402
- from { transform: translateX(100%); }
403
- to { transform: translateX(0); }
404
- `;
405
- const phraseIn = keyframes `
406
- from { opacity: 0; transform: translateY(4px); }
407
- to { opacity: 1; transform: translateY(0); }
408
- `;
409
- const dotCycle = keyframes `
410
- 0% { opacity: 0; }
411
- 25%, 75% { opacity: 1; }
412
- 100% { opacity: 0; }
413
- `;
414
- const ToppyHeaderButton = styled.button `
415
- display: flex;
416
- align-items: center;
417
- gap: 8px;
418
- height: 36px;
419
- padding: 0 14px 0 5px;
420
- border-radius: 18px;
421
- border: 1px solid ${TMColors.primary}35;
422
- background: ${TMColors.primary}0d;
423
- color: ${TMColors.primary};
424
- font-size: 13px;
425
- font-weight: 600;
426
- white-space: nowrap;
427
- cursor: pointer;
428
- flex-shrink: 0;
429
- transition: all 0.2s ease;
430
-
431
- &:hover {
432
- background: ${TMColors.primary}1a;
433
- border-color: ${TMColors.primary}66;
434
- transform: translateY(-1px);
435
- box-shadow: 0 4px 12px ${TMColors.primary}25;
436
- }
437
- &:active { transform: translateY(0); }
438
- `;
439
- const ToppyHeaderAvatar = styled.img `
440
- width: 28px;
441
- height: 28px;
442
- border-radius: 50%;
443
- object-fit: contain;
444
- pointer-events: none;
445
- `;
446
- const ToppyHeaderText = styled.span `
447
- line-height: 1;
448
- `;
449
- const Fab = styled.button `
450
- position: fixed;
451
- bottom: 24px;
452
- right: 24px;
453
- width: 60px;
454
- height: 60px;
455
- border-radius: 50%;
456
- border: none;
457
- padding: 0;
458
- cursor: pointer;
459
- display: flex;
460
- align-items: center;
461
- justify-content: center;
462
- background: white;
463
- box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
464
- z-index: 100000;
465
- transition: transform 0.2s ease, box-shadow 0.2s ease;
466
- animation: ${fadeIn} 0.3s ease-out;
467
-
468
- &:hover { transform: scale(1.08); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3); }
469
- &:active { transform: scale(0.96); }
470
- `;
471
- const FabAvatar = styled.img `
472
- width: 52px;
473
- height: 52px;
474
- border-radius: 50%;
475
- object-fit: contain;
476
- pointer-events: none;
477
- `;
478
- const Overlay = styled.div `
479
- position: fixed;
480
- inset: 0;
481
- background: rgba(0, 0, 0, 0.45);
482
- z-index: 100000;
483
- animation: ${fadeIn} 0.2s ease-out;
484
- `;
485
- const PanelContainer = styled.div `
486
- position: fixed;
487
- top: 0;
488
- right: 0;
489
- height: 100vh;
490
- width: ${props => props.$width}px;
491
- max-width: 100vw;
492
- background: white;
493
- display: flex;
494
- flex-direction: column;
495
- box-shadow: -8px 0 32px rgba(0, 0, 0, 0.28);
496
- z-index: 100001;
497
- animation: ${slideInRight} 0.25s ease-out;
498
- `;
499
- const ResizeHandle = styled.div `
500
- position: absolute;
501
- left: 0;
502
- top: 0;
503
- bottom: 0;
504
- width: 6px;
505
- cursor: col-resize;
506
- background: transparent;
507
- z-index: 2;
508
- transition: background 0.2s ease;
509
-
510
- &:hover { background: ${TMColors.primary}55; }
511
- `;
512
- const ChatHeader = styled.div `
513
- display: flex;
514
- align-items: center;
515
- justify-content: space-between;
516
- padding: 16px 20px;
517
- background: linear-gradient(135deg, ${TMColors.primary} 0%, ${TMColors.primary}dd 100%);
518
- color: white;
519
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
520
- `;
521
- const HeaderLeft = styled.div `
522
- display: flex;
523
- align-items: center;
524
- gap: 12px;
525
- flex: 1;
526
- min-width: 0;
527
- `;
528
- const HeaderRight = styled.div `
529
- display: flex;
530
- align-items: center;
531
- gap: 8px;
532
- margin-left: 12px;
533
- flex-shrink: 0;
534
- `;
535
- const ToppyAvatar = styled.img `
536
- width: 44px;
537
- height: 44px;
538
- border-radius: 50%;
539
- background: white;
540
- padding: 4px;
541
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
542
- flex-shrink: 0;
543
- object-fit: contain;
544
- `;
545
- const HeaderText = styled.div `
546
- display: flex;
547
- flex-direction: column;
548
- gap: 2px;
549
- min-width: 0;
550
- `;
551
- const HeaderGreeting = styled.h2 `
552
- margin: 0;
553
- font-size: 17px;
554
- font-weight: 600;
555
- color: white;
556
- white-space: nowrap;
557
- overflow: hidden;
558
- text-overflow: ellipsis;
559
- `;
560
- const HeaderQuestion = styled.p `
561
- margin: 0;
562
- font-size: 13px;
563
- color: rgba(255, 255, 255, 0.9);
564
- `;
565
- const HeaderButton = styled.button `
566
- width: 32px;
567
- height: 32px;
568
- border-radius: 50%;
569
- background: rgba(255, 255, 255, 0.2);
570
- border: 1px solid rgba(255, 255, 255, 0.3);
571
- color: white;
572
- cursor: pointer;
573
- display: flex;
574
- align-items: center;
575
- justify-content: center;
576
- flex-shrink: 0;
577
- transition: all 0.2s ease;
578
-
579
- &:hover:not(:disabled) { background: rgba(255, 255, 255, 0.3); transform: scale(1.05); }
580
- &:active:not(:disabled) { transform: scale(0.95); }
581
- &:disabled { opacity: 0.45; cursor: default; }
582
- `;
583
- const ChatBody = styled.div `
584
- flex: 1;
585
- padding: 20px;
586
- overflow-y: auto;
587
- background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
588
- `;
589
- const WelcomeMessage = styled.div `
590
- display: flex;
591
- gap: 16px;
592
- padding: 18px;
593
- background: white;
594
- border-radius: 12px;
595
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
596
- border-left: 4px solid ${TMColors.primary};
597
- animation: ${fadeIn} 0.5s ease-out;
598
- `;
599
- const WelcomeIcon = styled.div `
600
- font-size: 30px;
601
- flex-shrink: 0;
602
- `;
603
- const WelcomeText = styled.p `
604
- margin: 0;
605
- font-size: 14px;
606
- line-height: 1.6;
607
- color: #242424;
608
-
609
- strong { color: ${TMColors.primary}; font-weight: 600; }
610
- `;
611
- const MessageBubble = styled.div `
612
- display: flex;
613
- gap: 10px;
614
- margin-bottom: 16px;
615
- align-items: flex-start;
616
- justify-content: ${props => (props.$isUser ? 'flex-end' : 'flex-start')};
617
- animation: ${fadeIn} 0.3s ease-out;
618
- `;
619
- const BotAvatar = styled.img `
620
- width: 32px;
621
- height: 32px;
622
- border-radius: 50%;
623
- background: white;
624
- padding: 2px;
625
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
626
- flex-shrink: 0;
627
- object-fit: contain;
628
- `;
629
- const MessageContent = styled.div `
630
- max-width: 80%;
631
- padding: 10px 14px;
632
- border-radius: 12px;
633
- font-size: 14px;
634
- line-height: 1.5;
635
- background: ${props => (props.$isUser ? TMColors.primary : '#f0f2f5')};
636
- color: ${props => (props.$isUser ? 'white' : '#242424')};
637
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
638
- word-wrap: break-word;
639
- overflow-wrap: anywhere;
640
- white-space: ${props => (props.$isUser ? 'pre-wrap' : 'normal')};
641
- border-bottom-${props => (props.$isUser ? 'right' : 'left')}-radius: 4px;
642
- `;
643
- const MarkdownContent = styled.div `
644
- & > *:first-child { margin-top: 0; }
645
- & > *:last-child { margin-bottom: 0; }
646
-
647
- a { color: ${TMColors.primary}; text-decoration: underline; }
648
- strong { font-weight: 600; }
649
- `;
650
- const MdParagraph = styled.p `
651
- margin: 0 0 8px 0;
652
- line-height: 1.55;
653
- `;
654
- const MdHeading = styled.div `
655
- margin: 12px 0 6px 0;
656
- font-weight: 700;
657
- line-height: 1.3;
658
- font-size: ${props => `${Math.max(14, 20 - (props.$level - 1) * 2)}px`};
659
- `;
660
- const MdUl = styled.ul `
661
- margin: 4px 0 8px 0;
662
- padding-left: 20px;
663
- li { margin: 2px 0; line-height: 1.5; }
664
- `;
665
- const MdOl = styled.ol `
666
- margin: 4px 0 8px 0;
667
- padding-left: 22px;
668
- li { margin: 2px 0; line-height: 1.5; }
669
- `;
670
- const MdCode = styled.code `
671
- background: rgba(0, 0, 0, 0.06);
672
- padding: 1px 5px;
673
- border-radius: 4px;
674
- font-family: 'Consolas', 'Monaco', monospace;
675
- font-size: 0.9em;
676
- `;
677
- const MdPre = styled.pre `
678
- background: rgba(0, 0, 0, 0.06);
679
- padding: 10px 12px;
680
- border-radius: 8px;
681
- overflow-x: auto;
682
- margin: 8px 0;
683
- font-family: 'Consolas', 'Monaco', monospace;
684
- font-size: 0.88em;
685
- white-space: pre;
686
- `;
687
- const MdTableWrapper = styled.div `
688
- margin: 8px 0;
689
- max-width: 100%;
690
- overflow-x: auto;
691
- border: 1px solid #dcdfe3;
692
- border-radius: 8px;
693
-
694
- &::-webkit-scrollbar { height: 6px; }
695
- &::-webkit-scrollbar-track { background: transparent; }
696
- &::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
697
- &::-webkit-scrollbar-thumb:hover { background: #999; }
698
- `;
699
- const MdTable = styled.table `
700
- border-collapse: collapse;
701
- width: 100%;
702
- font-size: 0.92em;
703
- background: white;
704
- `;
705
- const MdTh = styled.th `
706
- padding: 7px 10px;
707
- background: ${TMColors.primary}14;
708
- color: #242424;
709
- font-weight: 600;
710
- text-align: ${props => props.$align ?? 'left'};
711
- border-bottom: 1px solid #dcdfe3;
712
- white-space: nowrap;
713
-
714
- &:not(:last-child) { border-right: 1px solid #e6e8eb; }
715
- `;
716
- const MdTd = styled.td `
717
- padding: 7px 10px;
718
- text-align: ${props => props.$align ?? 'left'};
719
- vertical-align: top;
720
- border-top: 1px solid #eceef0;
721
-
722
- &:not(:last-child) { border-right: 1px solid #eceef0; }
723
-
724
- tr:nth-child(even) & { background: #fafbfc; }
725
- `;
726
- const MdBlockquote = styled.blockquote `
727
- margin: 8px 0;
728
- padding: 6px 12px;
729
- border-left: 3px solid ${TMColors.primary}66;
730
- background: ${TMColors.primary}0a;
731
- border-radius: 0 6px 6px 0;
732
- color: #444;
733
-
734
- & > *:first-child { margin-top: 0; }
735
- & > *:last-child { margin-bottom: 0; }
736
- `;
737
- const MdHr = styled.hr `
738
- border: none;
739
- border-top: 1px solid #dcdfe3;
740
- margin: 12px 0;
741
- `;
742
- const ThinkingIndicator = styled.div `
743
- display: flex;
744
- align-items: center;
745
- gap: 10px;
746
- max-width: 80%;
747
- padding: 7px 12px;
748
- background: #f0f2f5;
749
- border-radius: 12px;
750
- border-bottom-left-radius: 4px;
751
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
752
- `;
753
- const ThinkingCaption = styled.div `
754
- display: flex;
755
- flex-direction: column;
756
- align-items: flex-start;
757
- gap: 0;
758
- min-width: 0;
759
- `;
760
- const ThinkingPhrase = styled.span `
761
- display: inline-flex;
762
- align-items: center;
763
- min-width: 0;
764
- font-size: 12px;
765
- font-style: italic;
766
- line-height: 1.15;
767
- color: #6b7280;
768
- animation: ${phraseIn} 0.25s ease-out;
769
- `;
770
- const ThinkingDots = styled.span `
771
- display: inline-flex;
772
- width: 12px;
773
- flex-shrink: 0;
774
- `;
775
- const ThinkingDot = styled.span `
776
- animation: ${dotCycle} 1.2s linear infinite;
777
- animation-delay: ${props => props.$delay}s;
778
- will-change: opacity;
779
-
780
- @media (prefers-reduced-motion: reduce) {
781
- animation: none;
782
- opacity: 1;
783
- }
784
- `;
785
- const ThinkingCounter = styled.span `
786
- margin-top: 2px;
787
- font-size: 10px;
788
- font-weight: 600;
789
- line-height: 1.1;
790
- letter-spacing: 0.02em;
791
- color: ${TMColors.primary}b3;
792
- font-variant-numeric: tabular-nums;
793
- font-feature-settings: 'tnum';
794
- opacity: ${props => (props.$visible ? 1 : 0)};
795
- transition: opacity 0.3s ease;
796
- `;
797
- const ChatFooter = styled.div `
798
- padding: 16px 20px;
799
- background: white;
800
- border-top: 1px solid #e1e5e9;
801
- box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
802
- `;
803
- const FooterHint = styled.p `
804
- margin: 6px 0 0 0;
805
- font-size: 11px;
806
- color: #999;
807
- text-align: center;
808
- `;
809
- const ChatInputWrapper = styled.div `
810
- position: relative;
811
- flex: 1;
812
- display: flex;
813
- `;
814
- const ChatInputTextarea = styled.textarea `
815
- width: 100%;
816
- padding: 14px 60px 14px 16px;
817
- border: 2px solid #e1e5e9;
818
- border-radius: 12px;
819
- font-size: 15px;
820
- font-family: inherit;
821
- line-height: 1.5;
822
- transition: all 0.2s ease;
823
- background: #f8f9fa;
824
- resize: none;
825
- min-height: 100px;
826
- max-height: 120px;
827
- overflow-y: hidden;
828
-
829
- &:focus {
830
- outline: none;
831
- border-color: ${TMColors.primary};
832
- background: white;
833
- box-shadow: 0 0 0 4px ${TMColors.primary}15;
834
- }
835
-
836
- &::placeholder {
837
- color: #999;
838
- }
839
-
840
- &::-webkit-scrollbar {
841
- width: 6px;
842
- }
843
-
844
- &::-webkit-scrollbar-track {
845
- background: transparent;
846
- }
847
-
848
- &::-webkit-scrollbar-thumb {
849
- background: #ccc;
850
- border-radius: 3px;
851
- }
852
-
853
- &::-webkit-scrollbar-thumb:hover {
854
- background: #999;
855
- }
856
- `;
857
- const InlineSendButton = styled.button `
858
- position: absolute;
859
- bottom: 8px;
860
- right: 8px;
861
- width: 40px;
862
- height: 40px;
863
- border-radius: 10px;
864
- background: ${props => props.$disabled ? '#ccc' : '#4caf50'};
865
- border: none;
866
- color: white;
867
- cursor: ${props => props.$disabled ? 'default' : 'pointer'};
868
- display: flex;
869
- align-items: center;
870
- justify-content: center;
871
- transition: all 0.2s ease;
872
-
873
- &:hover:not(:disabled) {
874
- background: #45a049;
875
- transform: scale(1.05);
876
- }
877
-
878
- &:active:not(:disabled) {
879
- transform: scale(0.95);
880
- }
881
-
882
- &:disabled {
883
- opacity: 0.6;
884
- }
400
+ const fadeIn = keyframes `
401
+ from { opacity: 0; }
402
+ to { opacity: 1; }
403
+ `;
404
+ const slideInRight = keyframes `
405
+ from { transform: translateX(100%); }
406
+ to { transform: translateX(0); }
407
+ `;
408
+ const phraseIn = keyframes `
409
+ from { opacity: 0; transform: translateY(4px); }
410
+ to { opacity: 1; transform: translateY(0); }
411
+ `;
412
+ const dotCycle = keyframes `
413
+ 0% { opacity: 0; }
414
+ 25%, 75% { opacity: 1; }
415
+ 100% { opacity: 0; }
416
+ `;
417
+ const ToppyHeaderButton = styled.button `
418
+ display: flex;
419
+ align-items: center;
420
+ gap: 8px;
421
+ height: 36px;
422
+ padding: 0 14px 0 5px;
423
+ border-radius: 18px;
424
+ border: 1px solid ${TMColors.primary}35;
425
+ background: ${TMColors.primary}0d;
426
+ color: ${TMColors.primary};
427
+ font-size: 13px;
428
+ font-weight: 600;
429
+ white-space: nowrap;
430
+ cursor: pointer;
431
+ flex-shrink: 0;
432
+ transition: all 0.2s ease;
433
+
434
+ &:hover {
435
+ background: ${TMColors.primary}1a;
436
+ border-color: ${TMColors.primary}66;
437
+ transform: translateY(-1px);
438
+ box-shadow: 0 4px 12px ${TMColors.primary}25;
439
+ }
440
+ &:active { transform: translateY(0); }
441
+ `;
442
+ const ToppyHeaderAvatar = styled.img `
443
+ width: 28px;
444
+ height: 28px;
445
+ border-radius: 50%;
446
+ object-fit: contain;
447
+ pointer-events: none;
448
+ `;
449
+ const ToppyHeaderText = styled.span `
450
+ line-height: 1;
451
+ `;
452
+ const Fab = styled.button `
453
+ position: fixed;
454
+ bottom: 24px;
455
+ right: 24px;
456
+ width: 60px;
457
+ height: 60px;
458
+ border-radius: 50%;
459
+ border: none;
460
+ padding: 0;
461
+ cursor: pointer;
462
+ display: flex;
463
+ align-items: center;
464
+ justify-content: center;
465
+ background: white;
466
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
467
+ z-index: 100000;
468
+ transition: transform 0.2s ease, box-shadow 0.2s ease;
469
+ animation: ${fadeIn} 0.3s ease-out;
470
+
471
+ &:hover { transform: scale(1.08); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3); }
472
+ &:active { transform: scale(0.96); }
473
+ `;
474
+ const FabAvatar = styled.img `
475
+ width: 52px;
476
+ height: 52px;
477
+ border-radius: 50%;
478
+ object-fit: contain;
479
+ pointer-events: none;
480
+ `;
481
+ const Overlay = styled.div `
482
+ position: fixed;
483
+ inset: 0;
484
+ background: rgba(0, 0, 0, 0.45);
485
+ z-index: 100000;
486
+ animation: ${fadeIn} 0.2s ease-out;
487
+ `;
488
+ const PanelContainer = styled.div `
489
+ position: fixed;
490
+ top: 0;
491
+ right: 0;
492
+ height: 100vh;
493
+ width: ${props => props.$width}px;
494
+ max-width: 100vw;
495
+ background: white;
496
+ display: flex;
497
+ flex-direction: column;
498
+ box-shadow: -8px 0 32px rgba(0, 0, 0, 0.28);
499
+ z-index: 100001;
500
+ animation: ${slideInRight} 0.25s ease-out;
501
+ `;
502
+ const ResizeHandle = styled.div `
503
+ position: absolute;
504
+ left: 0;
505
+ top: 0;
506
+ bottom: 0;
507
+ width: 6px;
508
+ cursor: col-resize;
509
+ background: transparent;
510
+ z-index: 2;
511
+ transition: background 0.2s ease;
512
+
513
+ &:hover { background: ${TMColors.primary}55; }
514
+ `;
515
+ const ChatHeader = styled.div `
516
+ display: flex;
517
+ align-items: center;
518
+ justify-content: space-between;
519
+ padding: 16px 20px;
520
+ background: linear-gradient(135deg, ${TMColors.primary} 0%, ${TMColors.primary}dd 100%);
521
+ color: white;
522
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
523
+ `;
524
+ const HeaderLeft = styled.div `
525
+ display: flex;
526
+ align-items: center;
527
+ gap: 12px;
528
+ flex: 1;
529
+ min-width: 0;
530
+ `;
531
+ const HeaderRight = styled.div `
532
+ display: flex;
533
+ align-items: center;
534
+ gap: 8px;
535
+ margin-left: 12px;
536
+ flex-shrink: 0;
537
+ `;
538
+ const ToppyAvatar = styled.img `
539
+ width: 44px;
540
+ height: 44px;
541
+ border-radius: 50%;
542
+ background: white;
543
+ padding: 4px;
544
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
545
+ flex-shrink: 0;
546
+ object-fit: contain;
547
+ `;
548
+ const HeaderText = styled.div `
549
+ display: flex;
550
+ flex-direction: column;
551
+ gap: 2px;
552
+ min-width: 0;
553
+ `;
554
+ const HeaderGreeting = styled.h2 `
555
+ margin: 0;
556
+ font-size: 17px;
557
+ font-weight: 600;
558
+ color: white;
559
+ white-space: nowrap;
560
+ overflow: hidden;
561
+ text-overflow: ellipsis;
562
+ `;
563
+ const HeaderQuestion = styled.p `
564
+ margin: 0;
565
+ font-size: 13px;
566
+ color: rgba(255, 255, 255, 0.9);
567
+ `;
568
+ const HeaderButton = styled.button `
569
+ width: 32px;
570
+ height: 32px;
571
+ border-radius: 50%;
572
+ background: rgba(255, 255, 255, 0.2);
573
+ border: 1px solid rgba(255, 255, 255, 0.3);
574
+ color: white;
575
+ cursor: pointer;
576
+ display: flex;
577
+ align-items: center;
578
+ justify-content: center;
579
+ flex-shrink: 0;
580
+ transition: all 0.2s ease;
581
+
582
+ &:hover:not(:disabled) { background: rgba(255, 255, 255, 0.3); transform: scale(1.05); }
583
+ &:active:not(:disabled) { transform: scale(0.95); }
584
+ &:disabled { opacity: 0.45; cursor: default; }
585
+ `;
586
+ const ChatBody = styled.div `
587
+ flex: 1;
588
+ padding: 20px;
589
+ overflow-y: auto;
590
+ background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
591
+ `;
592
+ const WelcomeMessage = styled.div `
593
+ display: flex;
594
+ gap: 16px;
595
+ padding: 18px;
596
+ background: white;
597
+ border-radius: 12px;
598
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
599
+ border-left: 4px solid ${TMColors.primary};
600
+ animation: ${fadeIn} 0.5s ease-out;
601
+ `;
602
+ const WelcomeIcon = styled.div `
603
+ font-size: 30px;
604
+ flex-shrink: 0;
605
+ `;
606
+ const WelcomeText = styled.p `
607
+ margin: 0;
608
+ font-size: 14px;
609
+ line-height: 1.6;
610
+ color: #242424;
611
+
612
+ strong { color: ${TMColors.primary}; font-weight: 600; }
613
+ `;
614
+ const MessageBubble = styled.div `
615
+ display: flex;
616
+ gap: 10px;
617
+ margin-bottom: 16px;
618
+ align-items: flex-start;
619
+ justify-content: ${props => (props.$isUser ? 'flex-end' : 'flex-start')};
620
+ animation: ${fadeIn} 0.3s ease-out;
621
+ `;
622
+ const BotAvatar = styled.img `
623
+ width: 32px;
624
+ height: 32px;
625
+ border-radius: 50%;
626
+ background: white;
627
+ padding: 2px;
628
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
629
+ flex-shrink: 0;
630
+ object-fit: contain;
631
+ `;
632
+ const MessageContent = styled.div `
633
+ max-width: 80%;
634
+ padding: 10px 14px;
635
+ border-radius: 12px;
636
+ font-size: 14px;
637
+ line-height: 1.5;
638
+ background: ${props => (props.$isUser ? TMColors.primary : '#f0f2f5')};
639
+ color: ${props => (props.$isUser ? 'white' : '#242424')};
640
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
641
+ word-wrap: break-word;
642
+ overflow-wrap: anywhere;
643
+ white-space: ${props => (props.$isUser ? 'pre-wrap' : 'normal')};
644
+ border-bottom-${props => (props.$isUser ? 'right' : 'left')}-radius: 4px;
645
+ `;
646
+ const MarkdownContent = styled.div `
647
+ & > *:first-child { margin-top: 0; }
648
+ & > *:last-child { margin-bottom: 0; }
649
+
650
+ a { color: ${TMColors.primary}; text-decoration: underline; }
651
+ strong { font-weight: 600; }
652
+ `;
653
+ const MdParagraph = styled.p `
654
+ margin: 0 0 8px 0;
655
+ line-height: 1.55;
656
+ `;
657
+ const MdHeading = styled.div `
658
+ margin: 12px 0 6px 0;
659
+ font-weight: 700;
660
+ line-height: 1.3;
661
+ font-size: ${props => `${Math.max(14, 20 - (props.$level - 1) * 2)}px`};
662
+ `;
663
+ const MdUl = styled.ul `
664
+ margin: 4px 0 8px 0;
665
+ padding-left: 20px;
666
+ li { margin: 2px 0; line-height: 1.5; }
667
+ `;
668
+ const MdOl = styled.ol `
669
+ margin: 4px 0 8px 0;
670
+ padding-left: 22px;
671
+ li { margin: 2px 0; line-height: 1.5; }
672
+ `;
673
+ const MdCode = styled.code `
674
+ background: rgba(0, 0, 0, 0.06);
675
+ padding: 1px 5px;
676
+ border-radius: 4px;
677
+ font-family: 'Consolas', 'Monaco', monospace;
678
+ font-size: 0.9em;
679
+ `;
680
+ const MdPre = styled.pre `
681
+ background: rgba(0, 0, 0, 0.06);
682
+ padding: 10px 12px;
683
+ border-radius: 8px;
684
+ overflow-x: auto;
685
+ margin: 8px 0;
686
+ font-family: 'Consolas', 'Monaco', monospace;
687
+ font-size: 0.88em;
688
+ white-space: pre;
689
+ `;
690
+ const MdTableWrapper = styled.div `
691
+ margin: 8px 0;
692
+ max-width: 100%;
693
+ overflow-x: auto;
694
+ border: 1px solid #dcdfe3;
695
+ border-radius: 8px;
696
+
697
+ &::-webkit-scrollbar { height: 6px; }
698
+ &::-webkit-scrollbar-track { background: transparent; }
699
+ &::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
700
+ &::-webkit-scrollbar-thumb:hover { background: #999; }
701
+ `;
702
+ const MdTable = styled.table `
703
+ border-collapse: collapse;
704
+ width: 100%;
705
+ font-size: 0.92em;
706
+ background: white;
707
+ `;
708
+ const MdTh = styled.th `
709
+ padding: 7px 10px;
710
+ background: ${TMColors.primary}14;
711
+ color: #242424;
712
+ font-weight: 600;
713
+ text-align: ${props => props.$align ?? 'left'};
714
+ border-bottom: 1px solid #dcdfe3;
715
+ white-space: nowrap;
716
+
717
+ &:not(:last-child) { border-right: 1px solid #e6e8eb; }
718
+ `;
719
+ const MdTd = styled.td `
720
+ padding: 7px 10px;
721
+ text-align: ${props => props.$align ?? 'left'};
722
+ vertical-align: top;
723
+ border-top: 1px solid #eceef0;
724
+
725
+ &:not(:last-child) { border-right: 1px solid #eceef0; }
726
+
727
+ tr:nth-child(even) & { background: #fafbfc; }
728
+ `;
729
+ const MdBlockquote = styled.blockquote `
730
+ margin: 8px 0;
731
+ padding: 6px 12px;
732
+ border-left: 3px solid ${TMColors.primary}66;
733
+ background: ${TMColors.primary}0a;
734
+ border-radius: 0 6px 6px 0;
735
+ color: #444;
736
+
737
+ & > *:first-child { margin-top: 0; }
738
+ & > *:last-child { margin-bottom: 0; }
739
+ `;
740
+ const MdHr = styled.hr `
741
+ border: none;
742
+ border-top: 1px solid #dcdfe3;
743
+ margin: 12px 0;
744
+ `;
745
+ const ThinkingIndicator = styled.div `
746
+ display: flex;
747
+ align-items: center;
748
+ gap: 10px;
749
+ max-width: 80%;
750
+ padding: 7px 12px;
751
+ background: #f0f2f5;
752
+ border-radius: 12px;
753
+ border-bottom-left-radius: 4px;
754
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
755
+ `;
756
+ const ThinkingCaption = styled.div `
757
+ display: flex;
758
+ flex-direction: column;
759
+ align-items: flex-start;
760
+ gap: 0;
761
+ min-width: 0;
762
+ `;
763
+ const ThinkingPhrase = styled.span `
764
+ display: inline-flex;
765
+ align-items: center;
766
+ min-width: 0;
767
+ font-size: 12px;
768
+ font-style: italic;
769
+ line-height: 1.15;
770
+ color: #6b7280;
771
+ animation: ${phraseIn} 0.25s ease-out;
772
+ `;
773
+ const ThinkingDots = styled.span `
774
+ display: inline-flex;
775
+ width: 12px;
776
+ flex-shrink: 0;
777
+ `;
778
+ const ThinkingDot = styled.span `
779
+ animation: ${dotCycle} 1.2s linear infinite;
780
+ animation-delay: ${props => props.$delay}s;
781
+ will-change: opacity;
782
+
783
+ @media (prefers-reduced-motion: reduce) {
784
+ animation: none;
785
+ opacity: 1;
786
+ }
787
+ `;
788
+ const ThinkingCounter = styled.span `
789
+ margin-top: 2px;
790
+ font-size: 10px;
791
+ font-weight: 600;
792
+ line-height: 1.1;
793
+ letter-spacing: 0.02em;
794
+ color: ${TMColors.primary}b3;
795
+ font-variant-numeric: tabular-nums;
796
+ font-feature-settings: 'tnum';
797
+ opacity: ${props => (props.$visible ? 1 : 0)};
798
+ transition: opacity 0.3s ease;
799
+ `;
800
+ const ChatFooter = styled.div `
801
+ padding: 16px 20px;
802
+ background: white;
803
+ border-top: 1px solid #e1e5e9;
804
+ box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
805
+ `;
806
+ const FooterHint = styled.p `
807
+ margin: 6px 0 0 0;
808
+ font-size: 11px;
809
+ color: #999;
810
+ text-align: center;
811
+ `;
812
+ const ChatInputWrapper = styled.div `
813
+ position: relative;
814
+ flex: 1;
815
+ display: flex;
816
+ `;
817
+ const ChatInputTextarea = styled.textarea `
818
+ width: 100%;
819
+ padding: 14px 60px 14px 16px;
820
+ border: 2px solid #e1e5e9;
821
+ border-radius: 12px;
822
+ font-size: 15px;
823
+ font-family: inherit;
824
+ line-height: 1.5;
825
+ transition: all 0.2s ease;
826
+ background: #f8f9fa;
827
+ resize: none;
828
+ min-height: 100px;
829
+ max-height: 120px;
830
+ overflow-y: hidden;
831
+
832
+ &:focus {
833
+ outline: none;
834
+ border-color: ${TMColors.primary};
835
+ background: white;
836
+ box-shadow: 0 0 0 4px ${TMColors.primary}15;
837
+ }
838
+
839
+ &::placeholder {
840
+ color: #999;
841
+ }
842
+
843
+ &::-webkit-scrollbar {
844
+ width: 6px;
845
+ }
846
+
847
+ &::-webkit-scrollbar-track {
848
+ background: transparent;
849
+ }
850
+
851
+ &::-webkit-scrollbar-thumb {
852
+ background: #ccc;
853
+ border-radius: 3px;
854
+ }
855
+
856
+ &::-webkit-scrollbar-thumb:hover {
857
+ background: #999;
858
+ }
859
+ `;
860
+ const InlineSendButton = styled.button `
861
+ position: absolute;
862
+ bottom: 8px;
863
+ right: 8px;
864
+ width: 40px;
865
+ height: 40px;
866
+ border-radius: 10px;
867
+ background: ${props => props.$disabled ? '#ccc' : '#4caf50'};
868
+ border: none;
869
+ color: white;
870
+ cursor: ${props => props.$disabled ? 'default' : 'pointer'};
871
+ display: flex;
872
+ align-items: center;
873
+ justify-content: center;
874
+ transition: all 0.2s ease;
875
+
876
+ &:hover:not(:disabled) {
877
+ background: #45a049;
878
+ transform: scale(1.05);
879
+ }
880
+
881
+ &:active:not(:disabled) {
882
+ transform: scale(0.95);
883
+ }
884
+
885
+ &:disabled {
886
+ opacity: 0.6;
887
+ }
885
888
  `;