@agentiffai/design 1.3.6 → 1.3.7
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/dist/copilotkit/index.cjs +267 -195
- package/dist/copilotkit/index.cjs.map +1 -1
- package/dist/copilotkit/index.d.cts +32 -4
- package/dist/copilotkit/index.d.ts +32 -4
- package/dist/copilotkit/index.js +239 -167
- package/dist/copilotkit/index.js.map +1 -1
- package/dist/index.cjs +1411 -424
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +137 -1
- package/dist/index.d.ts +137 -1
- package/dist/index.js +1471 -486
- package/dist/index.js.map +1 -1
- package/dist/layout/index.cjs +10 -4
- package/dist/layout/index.cjs.map +1 -1
- package/dist/layout/index.js +10 -4
- package/dist/layout/index.js.map +1 -1
- package/package.json +1 -1
package/dist/copilotkit/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useButton } from '@react-aria/button';
|
|
2
|
-
import { memo,
|
|
3
|
-
import
|
|
2
|
+
import { memo, useRef, useEffect, useState, useMemo, useCallback } from 'react';
|
|
3
|
+
import styled8, { css, keyframes, createGlobalStyle } from 'styled-components';
|
|
4
4
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { CopilotSidebar, useChatContext } from '@copilotkit/react-ui';
|
|
6
6
|
import { useTextField } from '@react-aria/textfield';
|
|
@@ -245,7 +245,7 @@ var sizeStyles = {
|
|
|
245
245
|
height: 44px;
|
|
246
246
|
`
|
|
247
247
|
};
|
|
248
|
-
var StyledButton =
|
|
248
|
+
var StyledButton = styled8.button`
|
|
249
249
|
/* Base styles */
|
|
250
250
|
display: inline-flex;
|
|
251
251
|
align-items: center;
|
|
@@ -328,7 +328,7 @@ function Button({
|
|
|
328
328
|
);
|
|
329
329
|
}
|
|
330
330
|
Button.displayName = "Button";
|
|
331
|
-
var ActionsContainer =
|
|
331
|
+
var ActionsContainer = styled8.div`
|
|
332
332
|
display: flex;
|
|
333
333
|
gap: ${tokens.spacing.sm};
|
|
334
334
|
align-items: center;
|
|
@@ -388,7 +388,7 @@ var blink = keyframes`
|
|
|
388
388
|
opacity: 0;
|
|
389
389
|
}
|
|
390
390
|
`;
|
|
391
|
-
var ResponseContainer =
|
|
391
|
+
var ResponseContainer = styled8.div`
|
|
392
392
|
display: inline-flex;
|
|
393
393
|
align-items: center;
|
|
394
394
|
gap: ${tokens.spacing.sm};
|
|
@@ -400,13 +400,13 @@ var ResponseContainer = styled4.div`
|
|
|
400
400
|
max-width: fit-content;
|
|
401
401
|
margin: 0 auto;
|
|
402
402
|
`;
|
|
403
|
-
var LoadingDots =
|
|
403
|
+
var LoadingDots = styled8.div`
|
|
404
404
|
display: flex;
|
|
405
405
|
align-items: center;
|
|
406
406
|
gap: ${tokens.spacing.xs};
|
|
407
407
|
padding: 0 ${tokens.spacing.xs};
|
|
408
408
|
`;
|
|
409
|
-
var Dot =
|
|
409
|
+
var Dot = styled8.span`
|
|
410
410
|
width: ${tokens.spacing.xs};
|
|
411
411
|
height: ${tokens.spacing.xs};
|
|
412
412
|
border-radius: ${tokens.borderRadius.full};
|
|
@@ -414,7 +414,7 @@ var Dot = styled4.span`
|
|
|
414
414
|
animation: ${dotPulse} 1.4s ease-in-out infinite;
|
|
415
415
|
animation-delay: ${(props) => props.delay}s;
|
|
416
416
|
`;
|
|
417
|
-
var TypingIndicator =
|
|
417
|
+
var TypingIndicator = styled8.div`
|
|
418
418
|
display: flex;
|
|
419
419
|
align-items: center;
|
|
420
420
|
gap: ${tokens.spacing.xs};
|
|
@@ -427,14 +427,14 @@ var TypingIndicator = styled4.div`
|
|
|
427
427
|
animation: ${dotPulse} 1.4s ease-in-out infinite;
|
|
428
428
|
}
|
|
429
429
|
`;
|
|
430
|
-
var Message =
|
|
430
|
+
var Message = styled8.span`
|
|
431
431
|
font-size: ${tokens.typography.fontSize.sm};
|
|
432
432
|
color: ${tokens.colors.text.primary};
|
|
433
433
|
font-weight: ${tokens.typography.fontWeight.regular};
|
|
434
434
|
line-height: ${tokens.typography.lineHeight.normal};
|
|
435
435
|
white-space: nowrap;
|
|
436
436
|
`;
|
|
437
|
-
var StreamingText =
|
|
437
|
+
var StreamingText = styled8.div`
|
|
438
438
|
font-size: ${tokens.typography.fontSize.sm};
|
|
439
439
|
line-height: ${tokens.typography.lineHeight.normal};
|
|
440
440
|
color: ${tokens.colors.text.primary};
|
|
@@ -506,7 +506,7 @@ var shake = keyframes`
|
|
|
506
506
|
transform: translateX(5px);
|
|
507
507
|
}
|
|
508
508
|
`;
|
|
509
|
-
var AgentStateContainer =
|
|
509
|
+
var AgentStateContainer = styled8.div`
|
|
510
510
|
display: inline-flex;
|
|
511
511
|
flex-direction: column;
|
|
512
512
|
align-items: center;
|
|
@@ -520,35 +520,35 @@ var AgentStateContainer = styled4.div`
|
|
|
520
520
|
max-width: fit-content;
|
|
521
521
|
margin: 0 auto;
|
|
522
522
|
`;
|
|
523
|
-
var StateContent =
|
|
523
|
+
var StateContent = styled8.div`
|
|
524
524
|
display: flex;
|
|
525
525
|
flex-direction: column;
|
|
526
526
|
gap: ${tokens.spacing.sm};
|
|
527
527
|
align-items: center;
|
|
528
528
|
width: 100%;
|
|
529
529
|
`;
|
|
530
|
-
var IdleIndicator =
|
|
530
|
+
var IdleIndicator = styled8.div`
|
|
531
531
|
width: ${tokens.spacing.xs};
|
|
532
532
|
height: ${tokens.spacing.xs};
|
|
533
533
|
background-color: ${tokens.colors.status.idle};
|
|
534
534
|
border-radius: ${tokens.borderRadius.full};
|
|
535
535
|
animation: ${dotPulse2} 2s infinite ease-in-out;
|
|
536
536
|
`;
|
|
537
|
-
var ErrorIndicator =
|
|
537
|
+
var ErrorIndicator = styled8.div`
|
|
538
538
|
width: ${tokens.spacing.xs};
|
|
539
539
|
height: ${tokens.spacing.xs};
|
|
540
540
|
background-color: ${tokens.colors.error};
|
|
541
541
|
border-radius: ${tokens.borderRadius.full};
|
|
542
542
|
animation: ${shake} 0.5s ease-in-out;
|
|
543
543
|
`;
|
|
544
|
-
var StateLabel =
|
|
544
|
+
var StateLabel = styled8.span`
|
|
545
545
|
font-size: ${tokens.typography.fontSize.sm};
|
|
546
546
|
font-weight: ${tokens.typography.fontWeight.regular};
|
|
547
547
|
color: ${tokens.colors.text.primary};
|
|
548
548
|
line-height: ${tokens.typography.lineHeight.normal};
|
|
549
549
|
white-space: nowrap;
|
|
550
550
|
`;
|
|
551
|
-
|
|
551
|
+
styled8.p`
|
|
552
552
|
font-size: ${tokens.typography.fontSize.sm};
|
|
553
553
|
color: ${tokens.colors.text.tertiary};
|
|
554
554
|
line-height: ${tokens.typography.lineHeight.normal};
|
|
@@ -556,7 +556,7 @@ styled4.p`
|
|
|
556
556
|
text-align: center;
|
|
557
557
|
white-space: nowrap;
|
|
558
558
|
`;
|
|
559
|
-
var ProgressBar =
|
|
559
|
+
var ProgressBar = styled8.div`
|
|
560
560
|
width: 100%;
|
|
561
561
|
height: ${tokens.spacing.xs};
|
|
562
562
|
background-color: ${tokens.colors.surface.elevated};
|
|
@@ -564,7 +564,7 @@ var ProgressBar = styled4.div`
|
|
|
564
564
|
overflow: hidden;
|
|
565
565
|
margin-top: ${tokens.spacing.xs};
|
|
566
566
|
`;
|
|
567
|
-
var ProgressBarFill =
|
|
567
|
+
var ProgressBarFill = styled8.div`
|
|
568
568
|
height: 100%;
|
|
569
569
|
width: ${(props) => Math.min(Math.max(props.progress, 0), 100)}%;
|
|
570
570
|
background: linear-gradient(135deg, ${tokens.colors.accent} 0%, ${tokens.colors.primary} 100%);
|
|
@@ -593,11 +593,11 @@ var AgentState = ({ state, message, progress, className }) => {
|
|
|
593
593
|
}
|
|
594
594
|
return null;
|
|
595
595
|
};
|
|
596
|
-
var Container =
|
|
596
|
+
var Container = styled8.div`
|
|
597
597
|
margin: ${tokens.spacing.sm} 0;
|
|
598
598
|
padding: 0 ${tokens.spacing.sm};
|
|
599
599
|
`;
|
|
600
|
-
var ToolName =
|
|
600
|
+
var ToolName = styled8.div`
|
|
601
601
|
font-size: ${tokens.typography.fontSize.xs};
|
|
602
602
|
color: ${tokens.colors.text.tertiary};
|
|
603
603
|
margin-bottom: ${tokens.spacing.xs};
|
|
@@ -704,7 +704,7 @@ var getSizeValue = (size = "md") => {
|
|
|
704
704
|
};
|
|
705
705
|
}
|
|
706
706
|
};
|
|
707
|
-
var Container2 =
|
|
707
|
+
var Container2 = styled8.div`
|
|
708
708
|
display: inline-flex;
|
|
709
709
|
align-items: center;
|
|
710
710
|
gap: ${tokens.spacing.md};
|
|
@@ -716,7 +716,7 @@ var Container2 = styled4.div`
|
|
|
716
716
|
max-width: fit-content;
|
|
717
717
|
margin: 0 auto;
|
|
718
718
|
`;
|
|
719
|
-
var Avatar =
|
|
719
|
+
var Avatar = styled8.div`
|
|
720
720
|
width: ${(props) => getSizeValue(props.size).avatar};
|
|
721
721
|
height: ${(props) => getSizeValue(props.size).avatar};
|
|
722
722
|
border-radius: ${tokens.borderRadius.full};
|
|
@@ -727,23 +727,23 @@ var Avatar = styled4.div`
|
|
|
727
727
|
flex-shrink: 0;
|
|
728
728
|
box-shadow: ${tokens.shadows.glow.primary};
|
|
729
729
|
`;
|
|
730
|
-
var HeadphonesIcon =
|
|
730
|
+
var HeadphonesIcon = styled8.svg`
|
|
731
731
|
width: ${(props) => getSizeValue(props.size).icon};
|
|
732
732
|
height: ${(props) => getSizeValue(props.size).icon};
|
|
733
733
|
color: ${tokens.colors.text.primary};
|
|
734
734
|
`;
|
|
735
|
-
var Content =
|
|
735
|
+
var Content = styled8.div`
|
|
736
736
|
display: flex;
|
|
737
737
|
align-items: center;
|
|
738
738
|
gap: ${tokens.spacing.sm};
|
|
739
739
|
`;
|
|
740
|
-
var LoadingDots2 =
|
|
740
|
+
var LoadingDots2 = styled8.div`
|
|
741
741
|
display: flex;
|
|
742
742
|
align-items: center;
|
|
743
743
|
gap: ${(props) => props.variant === "wave" ? "2px" : `${tokens.spacing.xs}`};
|
|
744
744
|
padding: 0 ${tokens.spacing.xs};
|
|
745
745
|
`;
|
|
746
|
-
var Dot2 =
|
|
746
|
+
var Dot2 = styled8.span`
|
|
747
747
|
width: ${(props) => getSizeValue(props.size).dotSize};
|
|
748
748
|
height: ${(props) => getSizeValue(props.size).dotSize};
|
|
749
749
|
border-radius: ${tokens.borderRadius.full};
|
|
@@ -761,7 +761,7 @@ var Dot2 = styled4.span`
|
|
|
761
761
|
}}
|
|
762
762
|
1.4s ease-in-out infinite;
|
|
763
763
|
`;
|
|
764
|
-
var Message2 =
|
|
764
|
+
var Message2 = styled8.span`
|
|
765
765
|
font-size: ${(props) => getSizeValue(props.size).fontSize};
|
|
766
766
|
color: ${tokens.colors.text.secondary};
|
|
767
767
|
font-weight: ${tokens.typography.fontWeight.regular};
|
|
@@ -821,7 +821,7 @@ function AssistantThinking({
|
|
|
821
821
|
);
|
|
822
822
|
}
|
|
823
823
|
AssistantThinking.displayName = "AssistantThinking";
|
|
824
|
-
var Container3 =
|
|
824
|
+
var Container3 = styled8.div`
|
|
825
825
|
font-family: ${(props) => props.$variant === "code" ? tokens.typography.fontFamily.monospace : tokens.typography.fontFamily.primary};
|
|
826
826
|
white-space: pre-wrap;
|
|
827
827
|
word-break: break-word;
|
|
@@ -830,7 +830,7 @@ var Container3 = styled4.div`
|
|
|
830
830
|
text-rendering: optimizeSpeed;
|
|
831
831
|
contain: content;
|
|
832
832
|
`;
|
|
833
|
-
var Cursor =
|
|
833
|
+
var Cursor = styled8.span`
|
|
834
834
|
display: inline-block;
|
|
835
835
|
width: 2px;
|
|
836
836
|
height: 1em;
|
|
@@ -854,17 +854,15 @@ var StreamingTextBase = ({
|
|
|
854
854
|
content,
|
|
855
855
|
isStreaming = false,
|
|
856
856
|
typingSpeed: _typingSpeed = 50,
|
|
857
|
-
//
|
|
857
|
+
// Reserved for future use
|
|
858
858
|
cursor = true,
|
|
859
859
|
variant = "default",
|
|
860
860
|
onStreamComplete,
|
|
861
861
|
className
|
|
862
862
|
}) => {
|
|
863
|
-
const [displayedText, setDisplayedText] = useState(content);
|
|
864
863
|
const wasStreamingRef = useRef(isStreaming);
|
|
865
864
|
const completionCalledRef = useRef(false);
|
|
866
865
|
useEffect(() => {
|
|
867
|
-
setDisplayedText(content);
|
|
868
866
|
if (wasStreamingRef.current && !isStreaming && !completionCalledRef.current) {
|
|
869
867
|
completionCalledRef.current = true;
|
|
870
868
|
onStreamComplete?.();
|
|
@@ -873,45 +871,48 @@ var StreamingTextBase = ({
|
|
|
873
871
|
completionCalledRef.current = false;
|
|
874
872
|
}
|
|
875
873
|
wasStreamingRef.current = isStreaming;
|
|
876
|
-
}, [
|
|
874
|
+
}, [isStreaming, onStreamComplete]);
|
|
877
875
|
const showCursor = isStreaming && cursor;
|
|
878
876
|
return /* @__PURE__ */ jsxs(Container3, { $variant: variant, className, children: [
|
|
879
|
-
|
|
877
|
+
content,
|
|
880
878
|
showCursor && /* @__PURE__ */ jsx(Cursor, {})
|
|
881
879
|
] });
|
|
882
880
|
};
|
|
883
881
|
var StreamingText2 = memo(StreamingTextBase);
|
|
884
882
|
StreamingText2.displayName = "StreamingText";
|
|
885
|
-
var MessageContainer =
|
|
883
|
+
var MessageContainer = styled8.div`
|
|
886
884
|
display: flex;
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
padding: ${tokens.spacing.
|
|
885
|
+
flex-direction: column;
|
|
886
|
+
gap: ${tokens.spacing.xs};
|
|
887
|
+
padding: ${tokens.spacing.xs} 0;
|
|
890
888
|
max-width: 100%;
|
|
891
889
|
/* GPU acceleration hint for smooth rendering during streaming */
|
|
892
890
|
will-change: contents;
|
|
893
891
|
contain: content;
|
|
894
892
|
`;
|
|
895
|
-
var AvatarContainer =
|
|
893
|
+
var AvatarContainer = styled8.div`
|
|
894
|
+
display: flex;
|
|
895
|
+
align-items: center;
|
|
896
|
+
gap: ${tokens.spacing.xs};
|
|
896
897
|
flex-shrink: 0;
|
|
897
898
|
`;
|
|
898
|
-
var Avatar2 =
|
|
899
|
-
width:
|
|
900
|
-
height:
|
|
899
|
+
var Avatar2 = styled8.img`
|
|
900
|
+
width: 20px;
|
|
901
|
+
height: 20px;
|
|
901
902
|
border-radius: ${tokens.borderRadius.full};
|
|
902
903
|
object-fit: cover;
|
|
903
904
|
background-color: transparent;
|
|
904
905
|
`;
|
|
905
|
-
var AvatarInitials =
|
|
906
|
-
width:
|
|
907
|
-
height:
|
|
906
|
+
var AvatarInitials = styled8.div`
|
|
907
|
+
width: 20px;
|
|
908
|
+
height: 20px;
|
|
908
909
|
border-radius: ${tokens.borderRadius.full};
|
|
909
910
|
overflow: hidden;
|
|
910
911
|
display: flex;
|
|
911
912
|
align-items: center;
|
|
912
913
|
justify-content: center;
|
|
913
914
|
background-color: ${tokens.colors.secondary};
|
|
914
|
-
padding:
|
|
915
|
+
padding: 2px;
|
|
915
916
|
box-sizing: border-box;
|
|
916
917
|
|
|
917
918
|
img {
|
|
@@ -920,16 +921,20 @@ var AvatarInitials = styled4.div`
|
|
|
920
921
|
object-fit: contain;
|
|
921
922
|
}
|
|
922
923
|
`;
|
|
923
|
-
var
|
|
924
|
-
|
|
924
|
+
var AvatarLabel = styled8.span`
|
|
925
|
+
font-size: ${tokens.typography.fontSize.xs};
|
|
926
|
+
font-weight: ${tokens.typography.fontWeight.medium};
|
|
927
|
+
color: ${tokens.colors.text.secondary};
|
|
928
|
+
`;
|
|
929
|
+
var ContentContainer = styled8.div`
|
|
930
|
+
width: 100%;
|
|
925
931
|
min-width: 0;
|
|
926
932
|
`;
|
|
927
|
-
var MessageContent =
|
|
933
|
+
var MessageContent = styled8.div`
|
|
928
934
|
/* Use solid color instead of backdrop-filter for performance during streaming */
|
|
929
935
|
background-color: ${tokens.colors.surface.elevated};
|
|
930
|
-
padding: ${tokens.spacing.sm}
|
|
936
|
+
padding: ${tokens.spacing.sm};
|
|
931
937
|
border-radius: ${tokens.borderRadius.lg};
|
|
932
|
-
border-top-left-radius: ${tokens.borderRadius.sm};
|
|
933
938
|
color: ${tokens.colors.text.primary};
|
|
934
939
|
font-size: ${tokens.typography.fontSize.sm};
|
|
935
940
|
line-height: ${tokens.typography.lineHeight.normal};
|
|
@@ -939,14 +944,13 @@ var MessageContent = styled4.div`
|
|
|
939
944
|
/* Optimize text rendering */
|
|
940
945
|
text-rendering: optimizeSpeed;
|
|
941
946
|
`;
|
|
942
|
-
var LoadingDots3 =
|
|
947
|
+
var LoadingDots3 = styled8.div`
|
|
943
948
|
display: flex;
|
|
944
949
|
gap: ${tokens.spacing.xs};
|
|
945
|
-
padding: ${tokens.spacing.sm}
|
|
950
|
+
padding: ${tokens.spacing.sm};
|
|
946
951
|
/* Use solid color instead of backdrop-filter for performance */
|
|
947
952
|
background-color: ${tokens.colors.surface.elevated};
|
|
948
953
|
border-radius: ${tokens.borderRadius.lg};
|
|
949
|
-
border-top-left-radius: ${tokens.borderRadius.sm};
|
|
950
954
|
width: fit-content;
|
|
951
955
|
`;
|
|
952
956
|
var pulse2 = keyframes`
|
|
@@ -957,7 +961,7 @@ var pulse2 = keyframes`
|
|
|
957
961
|
opacity: 1;
|
|
958
962
|
}
|
|
959
963
|
`;
|
|
960
|
-
var LoadingDot =
|
|
964
|
+
var LoadingDot = styled8.div`
|
|
961
965
|
width: ${tokens.spacing.sm};
|
|
962
966
|
height: ${tokens.spacing.sm};
|
|
963
967
|
border-radius: ${tokens.borderRadius.full};
|
|
@@ -966,7 +970,7 @@ var LoadingDot = styled4.div`
|
|
|
966
970
|
animation: ${pulse2} 1.4s ease-in-out infinite;
|
|
967
971
|
animation-delay: ${(props) => props.delay}s;
|
|
968
972
|
`;
|
|
969
|
-
var FileAttachmentContainer =
|
|
973
|
+
var FileAttachmentContainer = styled8.div`
|
|
970
974
|
display: flex;
|
|
971
975
|
align-items: center;
|
|
972
976
|
gap: ${tokens.spacing.sm};
|
|
@@ -1002,7 +1006,7 @@ var FileAttachmentContainer = styled4.div`
|
|
|
1002
1006
|
}
|
|
1003
1007
|
`}
|
|
1004
1008
|
`;
|
|
1005
|
-
var FileIconContainer =
|
|
1009
|
+
var FileIconContainer = styled8.div`
|
|
1006
1010
|
flex-shrink: 0;
|
|
1007
1011
|
width: ${tokens.spacing.xl};
|
|
1008
1012
|
height: ${tokens.spacing.xl};
|
|
@@ -1012,14 +1016,14 @@ var FileIconContainer = styled4.div`
|
|
|
1012
1016
|
font-size: ${tokens.typography.fontSize["2xl"]};
|
|
1013
1017
|
line-height: 1;
|
|
1014
1018
|
`;
|
|
1015
|
-
var FileInfo =
|
|
1019
|
+
var FileInfo = styled8.div`
|
|
1016
1020
|
flex: 1;
|
|
1017
1021
|
min-width: 0;
|
|
1018
1022
|
display: flex;
|
|
1019
1023
|
flex-direction: column;
|
|
1020
1024
|
gap: 2px;
|
|
1021
1025
|
`;
|
|
1022
|
-
var FileTitle =
|
|
1026
|
+
var FileTitle = styled8.div`
|
|
1023
1027
|
font-size: ${tokens.typography.fontSize.sm};
|
|
1024
1028
|
font-weight: ${tokens.typography.fontWeight.medium};
|
|
1025
1029
|
color: ${tokens.colors.text.primary};
|
|
@@ -1029,7 +1033,7 @@ var FileTitle = styled4.div`
|
|
|
1029
1033
|
text-overflow: ellipsis;
|
|
1030
1034
|
white-space: nowrap;
|
|
1031
1035
|
`;
|
|
1032
|
-
var FileMetadata =
|
|
1036
|
+
var FileMetadata = styled8.div`
|
|
1033
1037
|
display: flex;
|
|
1034
1038
|
align-items: center;
|
|
1035
1039
|
gap: ${tokens.spacing.xs};
|
|
@@ -1039,7 +1043,7 @@ var FileMetadata = styled4.div`
|
|
|
1039
1043
|
line-height: ${tokens.typography.lineHeight.tight};
|
|
1040
1044
|
overflow: hidden;
|
|
1041
1045
|
`;
|
|
1042
|
-
var FileSubtitle =
|
|
1046
|
+
var FileSubtitle = styled8.span`
|
|
1043
1047
|
color: ${tokens.colors.text.tertiary};
|
|
1044
1048
|
white-space: nowrap;
|
|
1045
1049
|
overflow: hidden;
|
|
@@ -1095,13 +1099,13 @@ var FileAttachment = ({
|
|
|
1095
1099
|
}
|
|
1096
1100
|
);
|
|
1097
1101
|
};
|
|
1098
|
-
var AttachmentsContainer =
|
|
1102
|
+
var AttachmentsContainer = styled8.div`
|
|
1099
1103
|
display: flex;
|
|
1100
1104
|
flex-direction: column;
|
|
1101
1105
|
gap: ${tokens.spacing.sm};
|
|
1102
1106
|
margin-top: ${tokens.spacing.sm};
|
|
1103
1107
|
`;
|
|
1104
|
-
var ActionButton =
|
|
1108
|
+
var ActionButton = styled8.button`
|
|
1105
1109
|
display: inline-flex;
|
|
1106
1110
|
align-items: center;
|
|
1107
1111
|
gap: ${tokens.spacing.xs};
|
|
@@ -1125,19 +1129,19 @@ var ActionButton = styled4.button`
|
|
|
1125
1129
|
transform: scale(0.98);
|
|
1126
1130
|
}
|
|
1127
1131
|
`;
|
|
1128
|
-
var ActionsContainer2 =
|
|
1132
|
+
var ActionsContainer2 = styled8.div`
|
|
1129
1133
|
display: flex;
|
|
1130
1134
|
gap: ${tokens.spacing.xs};
|
|
1131
1135
|
flex-wrap: wrap;
|
|
1132
1136
|
margin-top: ${tokens.spacing.sm};
|
|
1133
1137
|
`;
|
|
1134
|
-
var MessageTime =
|
|
1138
|
+
var MessageTime = styled8.time`
|
|
1135
1139
|
font-size: ${tokens.typography.fontSize.xs};
|
|
1136
1140
|
color: ${tokens.colors.text.tertiary};
|
|
1137
1141
|
margin-top: ${tokens.spacing.xs};
|
|
1138
1142
|
display: block;
|
|
1139
1143
|
`;
|
|
1140
|
-
var StreamingIndicator =
|
|
1144
|
+
var StreamingIndicator = styled8.span`
|
|
1141
1145
|
display: inline-block;
|
|
1142
1146
|
width: ${tokens.spacing.xs};
|
|
1143
1147
|
height: ${tokens.spacing.xs};
|
|
@@ -1201,7 +1205,10 @@ var AssistantMessageBase = ({
|
|
|
1201
1205
|
] });
|
|
1202
1206
|
};
|
|
1203
1207
|
return /* @__PURE__ */ jsxs(MessageContainer, { className, children: [
|
|
1204
|
-
/* @__PURE__ */
|
|
1208
|
+
/* @__PURE__ */ jsxs(AvatarContainer, { children: [
|
|
1209
|
+
avatarUrl ? /* @__PURE__ */ jsx(Avatar2, { src: avatarUrl, alt: "Assistant avatar" }) : /* @__PURE__ */ jsx(AvatarInitials, { children: /* @__PURE__ */ jsx(Avatar2, { src: "/assets/avatar-transparent-bg.png", alt: "AI Assistant" }) }),
|
|
1210
|
+
/* @__PURE__ */ jsx(AvatarLabel, { children: "Assistant" })
|
|
1211
|
+
] }),
|
|
1205
1212
|
/* @__PURE__ */ jsx(ContentContainer, { children: renderContent() })
|
|
1206
1213
|
] });
|
|
1207
1214
|
};
|
|
@@ -1211,7 +1218,7 @@ var TOOL_CALL_MARKER_REGEX = /<!--TOOL_CALL:([^:]+):(.+?)-->/g;
|
|
|
1211
1218
|
function stripToolCallMarkers(content) {
|
|
1212
1219
|
return content.replace(TOOL_CALL_MARKER_REGEX, "").trim();
|
|
1213
1220
|
}
|
|
1214
|
-
var GenerativeUIContainer =
|
|
1221
|
+
var GenerativeUIContainer = styled8.div`
|
|
1215
1222
|
margin-top: ${tokens.spacing.sm};
|
|
1216
1223
|
margin-bottom: ${tokens.spacing.sm};
|
|
1217
1224
|
`;
|
|
@@ -1260,7 +1267,53 @@ var AssistantMessageAdapterBase = ({
|
|
|
1260
1267
|
};
|
|
1261
1268
|
var AssistantMessageAdapter = memo(AssistantMessageAdapterBase);
|
|
1262
1269
|
AssistantMessageAdapter.displayName = "AssistantMessageAdapter";
|
|
1263
|
-
|
|
1270
|
+
function createAssistantMessageAdapter(ThinkingIndicator, ToolCallsComponent) {
|
|
1271
|
+
const CustomAssistantMessageAdapter = ({
|
|
1272
|
+
message,
|
|
1273
|
+
isLoading,
|
|
1274
|
+
isGenerating,
|
|
1275
|
+
isCurrentMessage
|
|
1276
|
+
}) => {
|
|
1277
|
+
const showThinking = isLoading || isGenerating && !message?.content;
|
|
1278
|
+
const shouldShowToolCalls = isCurrentMessage && ToolCallsComponent;
|
|
1279
|
+
const rawContent = message?.content || "";
|
|
1280
|
+
const content = stripToolCallMarkers(rawContent);
|
|
1281
|
+
let generativeUIOutput = null;
|
|
1282
|
+
const msgWithUI = message;
|
|
1283
|
+
if (msgWithUI && typeof msgWithUI.generativeUI === "function") {
|
|
1284
|
+
try {
|
|
1285
|
+
generativeUIOutput = msgWithUI.generativeUI();
|
|
1286
|
+
} catch (e) {
|
|
1287
|
+
console.warn("[AssistantMessageAdapter] Error rendering generativeUI:", e);
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
const attachments = [];
|
|
1291
|
+
if (showThinking) {
|
|
1292
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1293
|
+
ThinkingIndicator ? /* @__PURE__ */ jsx(ThinkingIndicator, { isLoading, isGenerating }) : /* @__PURE__ */ jsx(AssistantThinking, { message: "Thinking..." }),
|
|
1294
|
+
shouldShowToolCalls && /* @__PURE__ */ jsx(ToolCallsComponent, {})
|
|
1295
|
+
] });
|
|
1296
|
+
}
|
|
1297
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1298
|
+
shouldShowToolCalls && /* @__PURE__ */ jsx(ToolCallsComponent, {}),
|
|
1299
|
+
generativeUIOutput && /* @__PURE__ */ jsx(GenerativeUIContainer, { children: generativeUIOutput }),
|
|
1300
|
+
content && /* @__PURE__ */ jsx(
|
|
1301
|
+
AssistantMessage,
|
|
1302
|
+
{
|
|
1303
|
+
content,
|
|
1304
|
+
avatarInitials: "AI",
|
|
1305
|
+
isLoading: false,
|
|
1306
|
+
isStreaming: isGenerating,
|
|
1307
|
+
attachments,
|
|
1308
|
+
enableMarkdown: true
|
|
1309
|
+
}
|
|
1310
|
+
)
|
|
1311
|
+
] });
|
|
1312
|
+
};
|
|
1313
|
+
CustomAssistantMessageAdapter.displayName = "CustomAssistantMessageAdapter";
|
|
1314
|
+
return memo(CustomAssistantMessageAdapter);
|
|
1315
|
+
}
|
|
1316
|
+
var ChatInputContainer = styled8.div`
|
|
1264
1317
|
display: flex;
|
|
1265
1318
|
flex-direction: column;
|
|
1266
1319
|
width: 100%;
|
|
@@ -1276,7 +1329,7 @@ var ChatInputContainer = styled4.div`
|
|
|
1276
1329
|
padding: ${tokens.spacing.md};
|
|
1277
1330
|
}
|
|
1278
1331
|
`;
|
|
1279
|
-
var SuggestionsWrapper =
|
|
1332
|
+
var SuggestionsWrapper = styled8.div`
|
|
1280
1333
|
display: flex;
|
|
1281
1334
|
flex-direction: row;
|
|
1282
1335
|
flex-wrap: wrap;
|
|
@@ -1285,7 +1338,7 @@ var SuggestionsWrapper = styled4.div`
|
|
|
1285
1338
|
width: 100%;
|
|
1286
1339
|
box-sizing: border-box;
|
|
1287
1340
|
`;
|
|
1288
|
-
var SuggestionButton =
|
|
1341
|
+
var SuggestionButton = styled8.button`
|
|
1289
1342
|
padding: ${tokens.spacing.sm} ${tokens.spacing.md};
|
|
1290
1343
|
font-family: ${tokens.typography.fontFamily.primary};
|
|
1291
1344
|
font-size: 13px;
|
|
@@ -1324,7 +1377,7 @@ var SuggestionButton = styled4.button`
|
|
|
1324
1377
|
opacity: 0.4;
|
|
1325
1378
|
}
|
|
1326
1379
|
`;
|
|
1327
|
-
var InputWrapper =
|
|
1380
|
+
var InputWrapper = styled8.div`
|
|
1328
1381
|
display: flex;
|
|
1329
1382
|
align-items: flex-end; /* Align button to bottom when textarea expands */
|
|
1330
1383
|
gap: ${tokens.spacing.sm};
|
|
@@ -1342,7 +1395,7 @@ var InputWrapper = styled4.div`
|
|
|
1342
1395
|
background-color: rgba(50, 50, 52, 0.6);
|
|
1343
1396
|
}
|
|
1344
1397
|
`;
|
|
1345
|
-
var InputField =
|
|
1398
|
+
var InputField = styled8.textarea`
|
|
1346
1399
|
flex: 1;
|
|
1347
1400
|
border: none;
|
|
1348
1401
|
outline: none;
|
|
@@ -1367,7 +1420,7 @@ var InputField = styled4.textarea`
|
|
|
1367
1420
|
cursor: not-allowed;
|
|
1368
1421
|
}
|
|
1369
1422
|
`;
|
|
1370
|
-
var SubmitButton =
|
|
1423
|
+
var SubmitButton = styled8.button`
|
|
1371
1424
|
display: flex;
|
|
1372
1425
|
align-items: center;
|
|
1373
1426
|
justify-content: center;
|
|
@@ -1603,7 +1656,7 @@ var InputAdapter = ({
|
|
|
1603
1656
|
);
|
|
1604
1657
|
};
|
|
1605
1658
|
InputAdapter.displayName = "InputAdapter";
|
|
1606
|
-
var StyledUserMessage =
|
|
1659
|
+
var StyledUserMessage = styled8.button`
|
|
1607
1660
|
/* Base styles */
|
|
1608
1661
|
display: inline-flex;
|
|
1609
1662
|
align-items: center;
|
|
@@ -1739,7 +1792,7 @@ function UserMessageBase({
|
|
|
1739
1792
|
}
|
|
1740
1793
|
var UserMessage = memo(UserMessageBase);
|
|
1741
1794
|
UserMessage.displayName = "UserMessage";
|
|
1742
|
-
var UserMessageWrapper =
|
|
1795
|
+
var UserMessageWrapper = styled8.div`
|
|
1743
1796
|
display: flex;
|
|
1744
1797
|
justify-content: flex-end;
|
|
1745
1798
|
width: 100%;
|
|
@@ -1769,7 +1822,7 @@ var pulse3 = keyframes`
|
|
|
1769
1822
|
transform: scale(1.1);
|
|
1770
1823
|
}
|
|
1771
1824
|
`;
|
|
1772
|
-
var Container4 =
|
|
1825
|
+
var Container4 = styled8.div`
|
|
1773
1826
|
display: inline-flex;
|
|
1774
1827
|
align-items: center;
|
|
1775
1828
|
gap: ${(props) => {
|
|
@@ -1785,7 +1838,7 @@ var Container4 = styled4.div`
|
|
|
1785
1838
|
}};
|
|
1786
1839
|
font-family: ${tokens.typography.fontFamily.primary};
|
|
1787
1840
|
`;
|
|
1788
|
-
var StatusDot =
|
|
1841
|
+
var StatusDot = styled8.div`
|
|
1789
1842
|
width: ${(props) => {
|
|
1790
1843
|
if (props.variant === "badge") {
|
|
1791
1844
|
switch (props.size) {
|
|
@@ -1846,7 +1899,7 @@ var StatusDot = styled4.div`
|
|
|
1846
1899
|
animation: ${(props) => props.status === "streaming" ? pulse3 : "none"} 2s ease-in-out infinite;
|
|
1847
1900
|
flex-shrink: 0;
|
|
1848
1901
|
`;
|
|
1849
|
-
var Label =
|
|
1902
|
+
var Label = styled8.span`
|
|
1850
1903
|
font-size: ${(props) => {
|
|
1851
1904
|
if (props.variant === "badge") {
|
|
1852
1905
|
switch (props.size) {
|
|
@@ -1873,7 +1926,7 @@ var Label = styled4.span`
|
|
|
1873
1926
|
color: ${tokens.colors.text.secondary};
|
|
1874
1927
|
line-height: ${tokens.typography.lineHeight.tight};
|
|
1875
1928
|
`;
|
|
1876
|
-
var BadgeContainer =
|
|
1929
|
+
var BadgeContainer = styled8.div`
|
|
1877
1930
|
display: inline-flex;
|
|
1878
1931
|
align-items: center;
|
|
1879
1932
|
gap: ${(props) => {
|
|
@@ -1950,7 +2003,7 @@ var StreamStatusIndicator = ({
|
|
|
1950
2003
|
return /* @__PURE__ */ jsx(Container4, { size, className, role: "status", "aria-label": getStatusLabel(status), children: content });
|
|
1951
2004
|
};
|
|
1952
2005
|
StreamStatusIndicator.displayName = "StreamStatusIndicator";
|
|
1953
|
-
var HeaderContainer =
|
|
2006
|
+
var HeaderContainer = styled8.header`
|
|
1954
2007
|
display: flex;
|
|
1955
2008
|
align-items: center;
|
|
1956
2009
|
justify-content: space-between;
|
|
@@ -1966,14 +2019,14 @@ var HeaderContainer = styled4.header`
|
|
|
1966
2019
|
padding: ${tokens.spacing.sm} ${tokens.spacing.md};
|
|
1967
2020
|
}
|
|
1968
2021
|
`;
|
|
1969
|
-
var HeaderContent =
|
|
2022
|
+
var HeaderContent = styled8.div`
|
|
1970
2023
|
display: flex;
|
|
1971
2024
|
flex-direction: column;
|
|
1972
2025
|
gap: ${tokens.spacing.xs};
|
|
1973
2026
|
flex: 1;
|
|
1974
2027
|
min-width: 0;
|
|
1975
2028
|
`;
|
|
1976
|
-
var HeaderTitle =
|
|
2029
|
+
var HeaderTitle = styled8.h1`
|
|
1977
2030
|
margin: 0;
|
|
1978
2031
|
font-size: ${tokens.typography.fontSize.base};
|
|
1979
2032
|
font-weight: ${tokens.typography.fontWeight.semibold};
|
|
@@ -1984,7 +2037,7 @@ var HeaderTitle = styled4.h1`
|
|
|
1984
2037
|
text-overflow: ellipsis;
|
|
1985
2038
|
white-space: nowrap;
|
|
1986
2039
|
`;
|
|
1987
|
-
var HeaderSubtitle =
|
|
2040
|
+
var HeaderSubtitle = styled8.p`
|
|
1988
2041
|
margin: 0;
|
|
1989
2042
|
font-size: ${tokens.typography.fontSize.sm};
|
|
1990
2043
|
color: ${tokens.colors.text.secondary};
|
|
@@ -1994,13 +2047,13 @@ var HeaderSubtitle = styled4.p`
|
|
|
1994
2047
|
text-overflow: ellipsis;
|
|
1995
2048
|
white-space: nowrap;
|
|
1996
2049
|
`;
|
|
1997
|
-
var HeaderActions =
|
|
2050
|
+
var HeaderActions = styled8.div`
|
|
1998
2051
|
display: flex;
|
|
1999
2052
|
align-items: center;
|
|
2000
2053
|
gap: ${tokens.spacing.xs};
|
|
2001
2054
|
margin-left: ${tokens.spacing.md};
|
|
2002
2055
|
`;
|
|
2003
|
-
var ActionButton2 =
|
|
2056
|
+
var ActionButton2 = styled8.button`
|
|
2004
2057
|
display: inline-flex;
|
|
2005
2058
|
align-items: center;
|
|
2006
2059
|
justify-content: center;
|
|
@@ -2117,7 +2170,7 @@ var Header = ({
|
|
|
2117
2170
|
] });
|
|
2118
2171
|
};
|
|
2119
2172
|
Header.displayName = "Header";
|
|
2120
|
-
var MessagesContainer =
|
|
2173
|
+
var MessagesContainer = styled8.div`
|
|
2121
2174
|
display: flex;
|
|
2122
2175
|
flex-direction: column;
|
|
2123
2176
|
flex: 1;
|
|
@@ -2129,18 +2182,14 @@ var MessagesContainer = styled4.div`
|
|
|
2129
2182
|
${tokens.colors.background.darker},
|
|
2130
2183
|
${tokens.colors.background.darkest}
|
|
2131
2184
|
);
|
|
2132
|
-
padding
|
|
2133
|
-
|
|
2185
|
+
/* Minimal horizontal padding to maximize message width */
|
|
2186
|
+
padding: ${tokens.spacing.sm} ${tokens.spacing.xs};
|
|
2187
|
+
gap: ${tokens.spacing.sm};
|
|
2134
2188
|
box-sizing: border-box;
|
|
2135
2189
|
|
|
2136
2190
|
/* Ensure proper scrolling behavior for child components */
|
|
2137
2191
|
position: relative;
|
|
2138
2192
|
min-height: 0;
|
|
2139
|
-
|
|
2140
|
-
/* Desktop padding */
|
|
2141
|
-
@media (min-width: ${tokens.breakpoints.mobile}px) {
|
|
2142
|
-
padding: ${tokens.spacing.md};
|
|
2143
|
-
}
|
|
2144
2193
|
`;
|
|
2145
2194
|
var Messages = ({
|
|
2146
2195
|
children,
|
|
@@ -2150,7 +2199,7 @@ var Messages = ({
|
|
|
2150
2199
|
return /* @__PURE__ */ jsx(MessagesContainer, { className, role: "region", "aria-label": ariaLabel, children });
|
|
2151
2200
|
};
|
|
2152
2201
|
Messages.displayName = "Messages";
|
|
2153
|
-
var WindowContainer =
|
|
2202
|
+
var WindowContainer = styled8.div`
|
|
2154
2203
|
display: flex;
|
|
2155
2204
|
flex-direction: column;
|
|
2156
2205
|
/* Glassmorphism effect */
|
|
@@ -2351,7 +2400,7 @@ var GlobalSidebarStyles = createGlobalStyle`
|
|
|
2351
2400
|
}
|
|
2352
2401
|
}
|
|
2353
2402
|
`;
|
|
2354
|
-
var StyledChatButton =
|
|
2403
|
+
var StyledChatButton = styled8.button`
|
|
2355
2404
|
position: fixed;
|
|
2356
2405
|
bottom: 8px;
|
|
2357
2406
|
right: 8px;
|
|
@@ -2403,7 +2452,7 @@ var CustomCopilotSidebar = ({
|
|
|
2403
2452
|
};
|
|
2404
2453
|
return /* @__PURE__ */ jsx(Header, { title: "AI Assistant", subtitle: "How can I help you today?", onClose: handleClose });
|
|
2405
2454
|
};
|
|
2406
|
-
const
|
|
2455
|
+
const WindowAdapter2 = (props) => {
|
|
2407
2456
|
return /* @__PURE__ */ jsx(Window, { children: props.children });
|
|
2408
2457
|
};
|
|
2409
2458
|
const MessagesAdapter = (props) => {
|
|
@@ -2459,7 +2508,7 @@ var CustomCopilotSidebar = ({
|
|
|
2459
2508
|
UserMessage: UserMessageAdapter,
|
|
2460
2509
|
Input: InputAdapter,
|
|
2461
2510
|
Header: HeaderAdapter,
|
|
2462
|
-
Window:
|
|
2511
|
+
Window: WindowAdapter2,
|
|
2463
2512
|
Messages: MessagesAdapter,
|
|
2464
2513
|
Button: CustomButton,
|
|
2465
2514
|
instructions,
|
|
@@ -2485,8 +2534,8 @@ var GlobalSidebarStyles2 = createGlobalStyle`
|
|
|
2485
2534
|
/* Override CopilotKit's content wrapper to respect safe areas in landscape */
|
|
2486
2535
|
@media (orientation: landscape) {
|
|
2487
2536
|
.copilotKitSidebarContentWrapper {
|
|
2488
|
-
right:
|
|
2489
|
-
left:
|
|
2537
|
+
right: var(--safe-area-right, 0px) !important;
|
|
2538
|
+
left: var(--safe-area-left, 0px) !important;
|
|
2490
2539
|
}
|
|
2491
2540
|
}
|
|
2492
2541
|
|
|
@@ -2515,18 +2564,18 @@ var GlobalSidebarStyles2 = createGlobalStyle`
|
|
|
2515
2564
|
/* Override CopilotKit defaults for mobile */
|
|
2516
2565
|
position: fixed !important;
|
|
2517
2566
|
/* TOP: Account for status bar safe area (Android notch/status bar) */
|
|
2518
|
-
top: calc(${tokens.spacing.sm} +
|
|
2567
|
+
top: calc(${tokens.spacing.sm} + var(--safe-area-top, 0px)) !important;
|
|
2519
2568
|
/* RIGHT: Account for landscape notch on right side */
|
|
2520
|
-
right: calc(${tokens.spacing.sm} +
|
|
2569
|
+
right: calc(${tokens.spacing.sm} + var(--safe-area-right, 0px)) !important;
|
|
2521
2570
|
/* BOTTOM: Account for horizontal navbar (52px) + safe area for Android nav buttons */
|
|
2522
|
-
bottom: calc(52px + ${tokens.spacing.sm} +
|
|
2571
|
+
bottom: calc(52px + ${tokens.spacing.sm} + var(--safe-area-bottom, 0px)) !important;
|
|
2523
2572
|
/* LEFT: Account for landscape notch on left side */
|
|
2524
|
-
left: calc(${tokens.spacing.sm} +
|
|
2525
|
-
width: calc(100vw - ${tokens.spacing.lg} -
|
|
2573
|
+
left: calc(${tokens.spacing.sm} + var(--safe-area-left, 0px)) !important;
|
|
2574
|
+
width: calc(100vw - ${tokens.spacing.lg} - var(--safe-area-left, 0px) - var(--safe-area-right, 0px)) !important;
|
|
2526
2575
|
/* Adjust height to account for top, bottom safe areas, and navbar */
|
|
2527
|
-
height: calc(100vh - ${tokens.spacing.lg} -
|
|
2528
|
-
max-width: calc(100vw - ${tokens.spacing.lg} -
|
|
2529
|
-
max-height: calc(100vh - ${tokens.spacing.lg} -
|
|
2576
|
+
height: calc(100vh - ${tokens.spacing.lg} - var(--safe-area-top, 0px) - 52px - var(--safe-area-bottom, 0px)) !important;
|
|
2577
|
+
max-width: calc(100vw - ${tokens.spacing.lg} - var(--safe-area-left, 0px) - var(--safe-area-right, 0px)) !important;
|
|
2578
|
+
max-height: calc(100vh - ${tokens.spacing.lg} - var(--safe-area-top, 0px) - 52px - var(--safe-area-bottom, 0px)) !important;
|
|
2530
2579
|
margin: 0 !important;
|
|
2531
2580
|
border-radius: ${tokens.borderRadius.xl} !important;
|
|
2532
2581
|
|
|
@@ -2563,17 +2612,17 @@ var GlobalSidebarStyles2 = createGlobalStyle`
|
|
|
2563
2612
|
.copilotKitSidebar [role="dialog"] {
|
|
2564
2613
|
inset: auto !important;
|
|
2565
2614
|
/* TOP: Account for status bar safe area */
|
|
2566
|
-
top: calc(${tokens.spacing.sm} +
|
|
2615
|
+
top: calc(${tokens.spacing.sm} + var(--safe-area-top, 0px)) !important;
|
|
2567
2616
|
/* RIGHT: Account for landscape notch on right side */
|
|
2568
|
-
right: calc(${tokens.spacing.sm} +
|
|
2617
|
+
right: calc(${tokens.spacing.sm} + var(--safe-area-right, 0px)) !important;
|
|
2569
2618
|
/* BOTTOM: Account for horizontal navbar (52px) + safe area */
|
|
2570
|
-
bottom: calc(52px + ${tokens.spacing.sm} +
|
|
2619
|
+
bottom: calc(52px + ${tokens.spacing.sm} + var(--safe-area-bottom, 0px)) !important;
|
|
2571
2620
|
left: auto !important;
|
|
2572
2621
|
width: 28rem !important;
|
|
2573
2622
|
/* Adjust height to account for top, bottom safe areas, and navbar */
|
|
2574
|
-
height: calc(100vh - ${tokens.spacing.lg} -
|
|
2623
|
+
height: calc(100vh - ${tokens.spacing.lg} - var(--safe-area-top, 0px) - 52px - var(--safe-area-bottom, 0px)) !important;
|
|
2575
2624
|
max-width: 28rem !important;
|
|
2576
|
-
max-height: calc(100vh - ${tokens.spacing.lg} -
|
|
2625
|
+
max-height: calc(100vh - ${tokens.spacing.lg} - var(--safe-area-top, 0px) - 52px - var(--safe-area-bottom, 0px)) !important;
|
|
2577
2626
|
}
|
|
2578
2627
|
}
|
|
2579
2628
|
|
|
@@ -2606,8 +2655,8 @@ var GlobalSidebarStyles2 = createGlobalStyle`
|
|
|
2606
2655
|
left: auto !important;
|
|
2607
2656
|
right: 1.5rem !important;
|
|
2608
2657
|
/* Use top/bottom ONLY - let browser calculate height (more reliable than explicit height) */
|
|
2609
|
-
top:
|
|
2610
|
-
bottom: calc(52px +
|
|
2658
|
+
top: var(--safe-area-top, 0px) !important;
|
|
2659
|
+
bottom: calc(52px + var(--safe-area-bottom, 0px)) !important;
|
|
2611
2660
|
/* Remove explicit height - let top/bottom define it */
|
|
2612
2661
|
height: auto !important;
|
|
2613
2662
|
max-height: none !important;
|
|
@@ -2761,10 +2810,10 @@ var GlobalSidebarStyles2 = createGlobalStyle`
|
|
|
2761
2810
|
box-shadow: none !important;
|
|
2762
2811
|
}
|
|
2763
2812
|
`;
|
|
2764
|
-
var StyledChatButton2 =
|
|
2813
|
+
var StyledChatButton2 = styled8.button`
|
|
2765
2814
|
position: fixed;
|
|
2766
|
-
bottom: calc(${tokens.spacing.sm} +
|
|
2767
|
-
right: calc(${tokens.spacing.sm} +
|
|
2815
|
+
bottom: calc(${tokens.spacing.sm} + var(--safe-area-bottom, 0px));
|
|
2816
|
+
right: calc(${tokens.spacing.sm} + var(--safe-area-right, 0px));
|
|
2768
2817
|
width: 36px;
|
|
2769
2818
|
height: 36px;
|
|
2770
2819
|
border-radius: ${tokens.borderRadius.full};
|
|
@@ -2795,17 +2844,11 @@ var StyledChatButton2 = styled4.button`
|
|
|
2795
2844
|
fill: ${tokens.colors.text.primary};
|
|
2796
2845
|
}
|
|
2797
2846
|
`;
|
|
2798
|
-
|
|
2799
|
-
children
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
className,
|
|
2804
|
-
disabled = false,
|
|
2805
|
-
disabledReason = "Start a free trial to enable AI chat",
|
|
2806
|
-
onError,
|
|
2807
|
-
renderError
|
|
2808
|
-
}) {
|
|
2847
|
+
var WindowAdapter = (props) => {
|
|
2848
|
+
return /* @__PURE__ */ jsx(Window, { children: props.children });
|
|
2849
|
+
};
|
|
2850
|
+
WindowAdapter.displayName = "WindowAdapter";
|
|
2851
|
+
function createHeaderAdapter(onSetOpen) {
|
|
2809
2852
|
const HeaderAdapterWithClose = (_props) => {
|
|
2810
2853
|
const { setOpen } = useChatContext();
|
|
2811
2854
|
const handleClose = () => {
|
|
@@ -2814,9 +2857,10 @@ function CustomCopilotSidebar2({
|
|
|
2814
2857
|
};
|
|
2815
2858
|
return /* @__PURE__ */ jsx(Header, { title: "AI Assistant", onClose: handleClose });
|
|
2816
2859
|
};
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2860
|
+
HeaderAdapterWithClose.displayName = "HeaderAdapterWithClose";
|
|
2861
|
+
return HeaderAdapterWithClose;
|
|
2862
|
+
}
|
|
2863
|
+
function createButtonAdapter(disabled, disabledReason, onSetOpen) {
|
|
2820
2864
|
const CustomButton = (_props) => {
|
|
2821
2865
|
const { open, setOpen } = useChatContext();
|
|
2822
2866
|
const handleClick = () => {
|
|
@@ -2853,16 +2897,44 @@ function CustomCopilotSidebar2({
|
|
|
2853
2897
|
}
|
|
2854
2898
|
);
|
|
2855
2899
|
};
|
|
2900
|
+
CustomButton.displayName = "CustomButton";
|
|
2901
|
+
return CustomButton;
|
|
2902
|
+
}
|
|
2903
|
+
function CustomCopilotSidebar2({
|
|
2904
|
+
children,
|
|
2905
|
+
defaultOpen = false,
|
|
2906
|
+
onSetOpen,
|
|
2907
|
+
instructions,
|
|
2908
|
+
className,
|
|
2909
|
+
disabled = false,
|
|
2910
|
+
disabledReason = "Start a free trial to enable AI chat",
|
|
2911
|
+
onError,
|
|
2912
|
+
renderError,
|
|
2913
|
+
ThinkingIndicator,
|
|
2914
|
+
ToolCallsComponent
|
|
2915
|
+
}) {
|
|
2916
|
+
const HeaderAdapterWithClose = useMemo(
|
|
2917
|
+
() => createHeaderAdapter(onSetOpen),
|
|
2918
|
+
[onSetOpen]
|
|
2919
|
+
);
|
|
2920
|
+
const CustomButton = useMemo(
|
|
2921
|
+
() => createButtonAdapter(disabled, disabledReason, onSetOpen),
|
|
2922
|
+
[disabled, disabledReason, onSetOpen]
|
|
2923
|
+
);
|
|
2924
|
+
const AssistantMessageAdapterMemo = useMemo(
|
|
2925
|
+
() => ThinkingIndicator || ToolCallsComponent ? createAssistantMessageAdapter(ThinkingIndicator, ToolCallsComponent) : AssistantMessageAdapter,
|
|
2926
|
+
[ThinkingIndicator, ToolCallsComponent]
|
|
2927
|
+
);
|
|
2856
2928
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2857
2929
|
/* @__PURE__ */ jsx(GlobalSidebarStyles2, {}),
|
|
2858
2930
|
/* @__PURE__ */ jsx(
|
|
2859
2931
|
CopilotSidebar,
|
|
2860
2932
|
{
|
|
2861
|
-
AssistantMessage:
|
|
2933
|
+
AssistantMessage: AssistantMessageAdapterMemo,
|
|
2862
2934
|
UserMessage: UserMessageAdapter,
|
|
2863
2935
|
Input: InputAdapter,
|
|
2864
2936
|
Header: HeaderAdapterWithClose,
|
|
2865
|
-
Window:
|
|
2937
|
+
Window: WindowAdapter,
|
|
2866
2938
|
Button: CustomButton,
|
|
2867
2939
|
RenderActionExecutionMessage: ActionExecutionAdapter,
|
|
2868
2940
|
instructions,
|
|
@@ -2883,7 +2955,7 @@ function CustomCopilotSidebar2({
|
|
|
2883
2955
|
] });
|
|
2884
2956
|
}
|
|
2885
2957
|
CustomCopilotSidebar2.displayName = "CustomCopilotSidebar";
|
|
2886
|
-
var FooterContainer =
|
|
2958
|
+
var FooterContainer = styled8.footer`
|
|
2887
2959
|
display: flex;
|
|
2888
2960
|
align-items: center;
|
|
2889
2961
|
justify-content: center;
|
|
@@ -2892,7 +2964,7 @@ var FooterContainer = styled4.footer`
|
|
|
2892
2964
|
border-top: 1px solid ${tokens.colors.border.default};
|
|
2893
2965
|
min-height: 44px;
|
|
2894
2966
|
`;
|
|
2895
|
-
var FooterContent =
|
|
2967
|
+
var FooterContent = styled8.div`
|
|
2896
2968
|
display: flex;
|
|
2897
2969
|
align-items: center;
|
|
2898
2970
|
justify-content: space-between;
|
|
@@ -2905,13 +2977,13 @@ var FooterContent = styled4.div`
|
|
|
2905
2977
|
font-family: ${tokens.typography.fontFamily.primary};
|
|
2906
2978
|
line-height: ${tokens.typography.lineHeight.tight};
|
|
2907
2979
|
`;
|
|
2908
|
-
var FooterBranding =
|
|
2980
|
+
var FooterBranding = styled8.div`
|
|
2909
2981
|
display: flex;
|
|
2910
2982
|
align-items: center;
|
|
2911
2983
|
gap: ${tokens.spacing.xs};
|
|
2912
2984
|
flex-shrink: 0;
|
|
2913
2985
|
`;
|
|
2914
|
-
var FooterStatus =
|
|
2986
|
+
var FooterStatus = styled8.div`
|
|
2915
2987
|
display: flex;
|
|
2916
2988
|
align-items: center;
|
|
2917
2989
|
gap: ${tokens.spacing.xs};
|
|
@@ -2921,7 +2993,7 @@ var FooterStatus = styled4.div`
|
|
|
2921
2993
|
font-size: ${tokens.typography.fontSize.xs};
|
|
2922
2994
|
opacity: 0.8;
|
|
2923
2995
|
`;
|
|
2924
|
-
var FooterLink =
|
|
2996
|
+
var FooterLink = styled8.a`
|
|
2925
2997
|
color: ${tokens.colors.primary};
|
|
2926
2998
|
text-decoration: none;
|
|
2927
2999
|
transition: opacity ${tokens.transitions.fast};
|
|
@@ -2969,13 +3041,13 @@ var Footer = ({
|
|
|
2969
3041
|
] }) });
|
|
2970
3042
|
};
|
|
2971
3043
|
Footer.displayName = "Footer";
|
|
2972
|
-
var InputContainer =
|
|
3044
|
+
var InputContainer = styled8.div`
|
|
2973
3045
|
display: flex;
|
|
2974
3046
|
flex-direction: column;
|
|
2975
3047
|
width: 100%;
|
|
2976
3048
|
position: relative;
|
|
2977
3049
|
`;
|
|
2978
|
-
var InputWrapper2 =
|
|
3050
|
+
var InputWrapper2 = styled8.div`
|
|
2979
3051
|
display: flex;
|
|
2980
3052
|
align-items: flex-end;
|
|
2981
3053
|
gap: ${tokens.spacing.sm};
|
|
@@ -2995,7 +3067,7 @@ var InputWrapper2 = styled4.div`
|
|
|
2995
3067
|
border-color: ${tokens.colors.border.subtle};
|
|
2996
3068
|
}
|
|
2997
3069
|
`;
|
|
2998
|
-
var TextArea =
|
|
3070
|
+
var TextArea = styled8.textarea`
|
|
2999
3071
|
flex: 1;
|
|
3000
3072
|
min-height: ${tokens.spacing.lg};
|
|
3001
3073
|
max-height: ${(props) => `${(props.$maxRows || 5) * 24}px`};
|
|
@@ -3041,7 +3113,7 @@ var TextArea = styled4.textarea`
|
|
|
3041
3113
|
background: ${tokens.colors.scrollbar.thumbHover};
|
|
3042
3114
|
}
|
|
3043
3115
|
`;
|
|
3044
|
-
var SendButton =
|
|
3116
|
+
var SendButton = styled8.button`
|
|
3045
3117
|
display: flex;
|
|
3046
3118
|
align-items: center;
|
|
3047
3119
|
justify-content: center;
|
|
@@ -3171,7 +3243,7 @@ var Input = ({
|
|
|
3171
3243
|
)
|
|
3172
3244
|
] }) });
|
|
3173
3245
|
};
|
|
3174
|
-
var MessagesListContainer =
|
|
3246
|
+
var MessagesListContainer = styled8.div`
|
|
3175
3247
|
display: flex;
|
|
3176
3248
|
flex-direction: column;
|
|
3177
3249
|
width: 100%;
|
|
@@ -3211,7 +3283,7 @@ var MessagesListContainer = styled4.div`
|
|
|
3211
3283
|
/* Ensure proper rendering on mobile */
|
|
3212
3284
|
-webkit-overflow-scrolling: touch;
|
|
3213
3285
|
`;
|
|
3214
|
-
var MessagesListContent =
|
|
3286
|
+
var MessagesListContent = styled8.div`
|
|
3215
3287
|
display: flex;
|
|
3216
3288
|
flex-direction: column;
|
|
3217
3289
|
gap: ${tokens.spacing.sm};
|
|
@@ -3327,19 +3399,19 @@ var MessagesList = ({
|
|
|
3327
3399
|
}
|
|
3328
3400
|
);
|
|
3329
3401
|
};
|
|
3330
|
-
var StyledUserMessage2 =
|
|
3402
|
+
var StyledUserMessage2 = styled8.div`
|
|
3331
3403
|
display: flex;
|
|
3332
3404
|
justify-content: flex-end;
|
|
3333
3405
|
align-items: flex-start;
|
|
3334
|
-
margin: ${tokens.spacing.
|
|
3335
|
-
padding: 0
|
|
3406
|
+
margin: ${tokens.spacing.xs} 0;
|
|
3407
|
+
padding: 0;
|
|
3336
3408
|
width: 100%;
|
|
3337
3409
|
`;
|
|
3338
|
-
var MessageBubble =
|
|
3410
|
+
var MessageBubble = styled8.div`
|
|
3339
3411
|
display: flex;
|
|
3340
3412
|
flex-direction: column;
|
|
3341
|
-
max-width:
|
|
3342
|
-
padding: ${tokens.spacing.sm}
|
|
3413
|
+
max-width: 85%;
|
|
3414
|
+
padding: ${tokens.spacing.sm};
|
|
3343
3415
|
border-radius: ${tokens.borderRadius.lg};
|
|
3344
3416
|
|
|
3345
3417
|
/* User message colors - dark blue from brand */
|
|
@@ -3362,7 +3434,7 @@ var MessageBubble = styled4.div`
|
|
|
3362
3434
|
opacity: 0.9;
|
|
3363
3435
|
}
|
|
3364
3436
|
`;
|
|
3365
|
-
var MessageContent2 =
|
|
3437
|
+
var MessageContent2 = styled8.p`
|
|
3366
3438
|
margin: 0;
|
|
3367
3439
|
font-size: ${tokens.typography.fontSize.sm};
|
|
3368
3440
|
line-height: ${tokens.typography.lineHeight.normal};
|
|
@@ -3371,13 +3443,13 @@ var MessageContent2 = styled4.p`
|
|
|
3371
3443
|
word-break: break-word;
|
|
3372
3444
|
white-space: pre-wrap;
|
|
3373
3445
|
`;
|
|
3374
|
-
var MessageTime2 =
|
|
3446
|
+
var MessageTime2 = styled8.time`
|
|
3375
3447
|
font-size: ${tokens.typography.fontSize.xs};
|
|
3376
3448
|
opacity: 0.7;
|
|
3377
3449
|
margin-top: ${tokens.spacing.xs};
|
|
3378
3450
|
text-align: right;
|
|
3379
3451
|
`;
|
|
3380
|
-
var ActionButton3 =
|
|
3452
|
+
var ActionButton3 = styled8.button`
|
|
3381
3453
|
display: inline-flex;
|
|
3382
3454
|
align-items: center;
|
|
3383
3455
|
gap: ${tokens.spacing.xs};
|
|
@@ -3401,12 +3473,12 @@ var ActionButton3 = styled4.button`
|
|
|
3401
3473
|
transform: scale(0.98);
|
|
3402
3474
|
}
|
|
3403
3475
|
`;
|
|
3404
|
-
var ActionsContainer3 =
|
|
3476
|
+
var ActionsContainer3 = styled8.div`
|
|
3405
3477
|
display: flex;
|
|
3406
3478
|
gap: ${tokens.spacing.xs};
|
|
3407
3479
|
flex-wrap: wrap;
|
|
3408
3480
|
`;
|
|
3409
|
-
var StreamingIndicator2 =
|
|
3481
|
+
var StreamingIndicator2 = styled8.span`
|
|
3410
3482
|
display: inline-block;
|
|
3411
3483
|
width: ${tokens.spacing.xs};
|
|
3412
3484
|
height: ${tokens.spacing.xs};
|
|
@@ -3427,7 +3499,7 @@ var StreamingIndicator2 = styled4.span`
|
|
|
3427
3499
|
}
|
|
3428
3500
|
}
|
|
3429
3501
|
`;
|
|
3430
|
-
var Avatar3 =
|
|
3502
|
+
var Avatar3 = styled8.img`
|
|
3431
3503
|
width: ${tokens.spacing.xl};
|
|
3432
3504
|
height: ${tokens.spacing.xl};
|
|
3433
3505
|
border-radius: ${tokens.borderRadius.full};
|
|
@@ -3460,7 +3532,7 @@ var UserMessage2 = ({
|
|
|
3460
3532
|
avatarUrl && /* @__PURE__ */ jsx(Avatar3, { src: avatarUrl, alt: username || "User" })
|
|
3461
3533
|
] });
|
|
3462
3534
|
};
|
|
3463
|
-
var ErrorContainer =
|
|
3535
|
+
var ErrorContainer = styled8.div`
|
|
3464
3536
|
display: flex;
|
|
3465
3537
|
align-items: flex-start;
|
|
3466
3538
|
gap: ${tokens.spacing.sm};
|
|
@@ -3474,7 +3546,7 @@ var ErrorContainer = styled4.div`
|
|
|
3474
3546
|
width: ${(props) => props.variant === "banner" ? "100%" : "auto"};
|
|
3475
3547
|
max-width: ${(props) => props.variant === "banner" ? "100%" : "600px"};
|
|
3476
3548
|
`;
|
|
3477
|
-
var IconContainer =
|
|
3549
|
+
var IconContainer = styled8.div`
|
|
3478
3550
|
flex-shrink: 0;
|
|
3479
3551
|
width: 20px;
|
|
3480
3552
|
height: 20px;
|
|
@@ -3491,29 +3563,29 @@ var ErrorIcon = () => /* @__PURE__ */ jsx(
|
|
|
3491
3563
|
children: /* @__PURE__ */ jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" })
|
|
3492
3564
|
}
|
|
3493
3565
|
);
|
|
3494
|
-
var Content2 =
|
|
3566
|
+
var Content2 = styled8.div`
|
|
3495
3567
|
flex: 1;
|
|
3496
3568
|
display: flex;
|
|
3497
3569
|
flex-direction: column;
|
|
3498
3570
|
gap: ${tokens.spacing.sm};
|
|
3499
3571
|
`;
|
|
3500
|
-
var ErrorMessage =
|
|
3572
|
+
var ErrorMessage = styled8.div`
|
|
3501
3573
|
font-size: ${tokens.typography.fontSize.sm};
|
|
3502
3574
|
line-height: ${tokens.typography.lineHeight.normal};
|
|
3503
3575
|
color: ${tokens.colors.text.primary};
|
|
3504
3576
|
`;
|
|
3505
|
-
var ErrorDetails =
|
|
3577
|
+
var ErrorDetails = styled8.div`
|
|
3506
3578
|
font-size: ${tokens.typography.fontSize.xs};
|
|
3507
3579
|
line-height: 1.4;
|
|
3508
3580
|
color: ${tokens.colors.text.secondary};
|
|
3509
3581
|
margin-top: ${tokens.spacing.xs};
|
|
3510
3582
|
`;
|
|
3511
|
-
var Actions2 =
|
|
3583
|
+
var Actions2 = styled8.div`
|
|
3512
3584
|
display: flex;
|
|
3513
3585
|
gap: ${tokens.spacing.sm};
|
|
3514
3586
|
margin-top: ${tokens.spacing.sm};
|
|
3515
3587
|
`;
|
|
3516
|
-
var Button2 =
|
|
3588
|
+
var Button2 = styled8.button`
|
|
3517
3589
|
display: inline-flex;
|
|
3518
3590
|
align-items: center;
|
|
3519
3591
|
gap: ${tokens.spacing.xs};
|
|
@@ -3542,7 +3614,7 @@ var Button2 = styled4.button`
|
|
|
3542
3614
|
cursor: not-allowed;
|
|
3543
3615
|
}
|
|
3544
3616
|
`;
|
|
3545
|
-
var CloseButton =
|
|
3617
|
+
var CloseButton = styled8.button`
|
|
3546
3618
|
flex-shrink: 0;
|
|
3547
3619
|
width: 24px;
|
|
3548
3620
|
height: 24px;
|
|
@@ -3601,7 +3673,7 @@ var StreamErrorMessage = ({
|
|
|
3601
3673
|
] });
|
|
3602
3674
|
};
|
|
3603
3675
|
StreamErrorMessage.displayName = "StreamErrorMessage";
|
|
3604
|
-
var SuggestionsContainer =
|
|
3676
|
+
var SuggestionsContainer = styled8.div`
|
|
3605
3677
|
display: flex;
|
|
3606
3678
|
flex-wrap: nowrap; /* Single row */
|
|
3607
3679
|
gap: ${tokens.spacing.sm};
|
|
@@ -3634,7 +3706,7 @@ var SuggestionsContainer = styled4.div`
|
|
|
3634
3706
|
display: none; /* Chrome/Safari/Opera */
|
|
3635
3707
|
}
|
|
3636
3708
|
`;
|
|
3637
|
-
var StyledSuggestion =
|
|
3709
|
+
var StyledSuggestion = styled8.button`
|
|
3638
3710
|
/* Base styles */
|
|
3639
3711
|
display: inline-flex;
|
|
3640
3712
|
align-items: center;
|