@superinterface/react 2.15.5 → 2.15.6
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/index.cjs +465 -438
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +339 -316
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -359,7 +359,7 @@ var SuperinterfaceProvider = function(param) {
|
|
|
359
359
|
});
|
|
360
360
|
};
|
|
361
361
|
// src/components/threads/Thread/Messages/index.tsx
|
|
362
|
-
import { Flex as
|
|
362
|
+
import { Flex as Flex13 } from "@radix-ui/themes";
|
|
363
363
|
// src/components/threads/Thread/Messages/Content/index.tsx
|
|
364
364
|
import { useEffect } from "react";
|
|
365
365
|
// src/hooks/messages/useMessages/index.tsx
|
|
@@ -672,9 +672,8 @@ var useToasts = function() {
|
|
|
672
672
|
return useContext2(ToastsContext);
|
|
673
673
|
};
|
|
674
674
|
// src/components/threads/Thread/Messages/Content/MessageGroup/index.tsx
|
|
675
|
-
import { useContext as
|
|
676
|
-
import { Box as Box10
|
|
677
|
-
import { PersonIcon } from "@radix-ui/react-icons";
|
|
675
|
+
import { useContext as useContext8 } from "react";
|
|
676
|
+
import { Box as Box10 } from "@radix-ui/themes";
|
|
678
677
|
// src/components/messageGroups/MessageGroupBase/AssistantAvatar.tsx
|
|
679
678
|
import { useContext as useContext3 } from "react";
|
|
680
679
|
import { Flex as Flex4 } from "@radix-ui/themes";
|
|
@@ -705,17 +704,44 @@ var AssistantAvatar = function() {
|
|
|
705
704
|
// src/contexts/assistants/AssistantNameContext/index.tsx
|
|
706
705
|
import { createContext as createContext4 } from "react";
|
|
707
706
|
var AssistantNameContext = createContext4("Assistant");
|
|
707
|
+
// src/components/messageGroups/MessageGroupBase/UserAvatar.tsx
|
|
708
|
+
import { useContext as useContext4 } from "react";
|
|
709
|
+
import { Flex as Flex5 } from "@radix-ui/themes";
|
|
710
|
+
// src/contexts/users/UserAvatarContext/index.tsx
|
|
711
|
+
import { createContext as createContext5 } from "react";
|
|
712
|
+
import { Avatar as Avatar3 } from "@radix-ui/themes";
|
|
713
|
+
import { PersonIcon } from "@radix-ui/react-icons";
|
|
714
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
715
|
+
var UserAvatarContext = createContext5(/* @__PURE__ */ jsx7(Avatar3, {
|
|
716
|
+
fallback: /* @__PURE__ */ jsx7(PersonIcon, {}),
|
|
717
|
+
size: "1"
|
|
718
|
+
}));
|
|
719
|
+
// src/components/messageGroups/MessageGroupBase/UserAvatar.tsx
|
|
720
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
721
|
+
var UserAvatar = function() {
|
|
722
|
+
var UserAvatarContextValue = useContext4(UserAvatarContext);
|
|
723
|
+
return /* @__PURE__ */ jsx8(Flex5, {
|
|
724
|
+
flexShrink: "0",
|
|
725
|
+
height: "24px",
|
|
726
|
+
width: "24px",
|
|
727
|
+
style: {
|
|
728
|
+
borderRadius: "var(--radius-3)",
|
|
729
|
+
overflow: "hidden"
|
|
730
|
+
},
|
|
731
|
+
children: UserAvatarContextValue
|
|
732
|
+
});
|
|
733
|
+
};
|
|
708
734
|
// src/components/threads/Thread/Messages/Content/MessageGroup/Content/index.tsx
|
|
709
|
-
import { Flex as
|
|
735
|
+
import { Flex as Flex11 } from "@radix-ui/themes";
|
|
710
736
|
// src/components/threads/Thread/Message/index.tsx
|
|
711
737
|
import { useMemo as useMemo5, Fragment } from "react";
|
|
712
738
|
import { isEmpty } from "radash";
|
|
713
739
|
import { Box as Box9 } from "@radix-ui/themes";
|
|
714
740
|
// src/components/skeletons/StartingContentSkeleton/index.tsx
|
|
715
741
|
import { Skeleton as Skeleton2 } from "@radix-ui/themes";
|
|
716
|
-
import { jsx as
|
|
742
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
717
743
|
var StartingContentSkeleton = function() {
|
|
718
|
-
return /* @__PURE__ */
|
|
744
|
+
return /* @__PURE__ */ jsx9(Skeleton2, {
|
|
719
745
|
loading: true,
|
|
720
746
|
mt: "1",
|
|
721
747
|
height: "var(--space-4)",
|
|
@@ -727,31 +753,31 @@ var StartingContentSkeleton = function() {
|
|
|
727
753
|
});
|
|
728
754
|
};
|
|
729
755
|
// src/components/runSteps/RunSteps/index.tsx
|
|
730
|
-
import { Flex as
|
|
731
|
-
import { useContext as
|
|
756
|
+
import { Flex as Flex10 } from "@radix-ui/themes";
|
|
757
|
+
import { useContext as useContext6 } from "react";
|
|
732
758
|
// src/contexts/components/ComponentsContext/index.tsx
|
|
733
|
-
import { createContext as
|
|
759
|
+
import { createContext as createContext7 } from "react";
|
|
734
760
|
// src/components/runSteps/RunStep/ToolCalls/index.tsx
|
|
735
|
-
import { Flex as
|
|
761
|
+
import { Flex as Flex9 } from "@radix-ui/themes";
|
|
736
762
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/index.tsx
|
|
737
|
-
import { Flex as
|
|
763
|
+
import { Flex as Flex8 } from "@radix-ui/themes";
|
|
738
764
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/Fn/index.tsx
|
|
739
|
-
import { useContext as
|
|
765
|
+
import { useContext as useContext5 } from "react";
|
|
740
766
|
// src/contexts/functions/FunctionComponentsContext/index.tsx
|
|
741
|
-
import { createContext as
|
|
742
|
-
var FunctionComponentsContext =
|
|
767
|
+
import { createContext as createContext6 } from "react";
|
|
768
|
+
var FunctionComponentsContext = createContext6({});
|
|
743
769
|
// src/components/functions/FunctionBase/index.tsx
|
|
744
770
|
import { Popover as Popover2 } from "@radix-ui/themes";
|
|
745
771
|
// src/components/toolCalls/ToolCallBase/index.tsx
|
|
746
|
-
import { Flex as
|
|
747
|
-
import { jsx as
|
|
772
|
+
import { Flex as Flex6, Button, Popover } from "@radix-ui/themes";
|
|
773
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
748
774
|
var ToolCallBase = function(param) {
|
|
749
775
|
var children = param.children;
|
|
750
|
-
return /* @__PURE__ */
|
|
776
|
+
return /* @__PURE__ */ jsx10(Flex6, {
|
|
751
777
|
py: "1",
|
|
752
778
|
ml: "-2",
|
|
753
|
-
children: /* @__PURE__ */
|
|
754
|
-
children: /* @__PURE__ */
|
|
779
|
+
children: /* @__PURE__ */ jsx10(Popover.Trigger, {
|
|
780
|
+
children: /* @__PURE__ */ jsx10(Button, {
|
|
755
781
|
size: "1",
|
|
756
782
|
color: "gold",
|
|
757
783
|
variant: "outline",
|
|
@@ -765,31 +791,31 @@ var ToolCallBase = function(param) {
|
|
|
765
791
|
};
|
|
766
792
|
// src/components/toolCalls/ToolCallBase/ToolCallTitle.tsx
|
|
767
793
|
import { Text as Text2 } from "@radix-ui/themes";
|
|
768
|
-
import { jsx as
|
|
794
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
769
795
|
var ToolCallTitle = function(param) {
|
|
770
796
|
var children = param.children;
|
|
771
|
-
return /* @__PURE__ */
|
|
797
|
+
return /* @__PURE__ */ jsx11(Text2, {
|
|
772
798
|
weight: "regular",
|
|
773
799
|
children: children
|
|
774
800
|
});
|
|
775
801
|
};
|
|
776
802
|
// src/components/functions/FunctionBase/Icon.tsx
|
|
777
803
|
import { CircleIcon, CircleBackslashIcon, CheckCircledIcon } from "@radix-ui/react-icons";
|
|
778
|
-
import { jsx as
|
|
804
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
779
805
|
var Icon = function(param) {
|
|
780
806
|
var runStep = param.runStep;
|
|
781
807
|
if (runStep.completed_at) {
|
|
782
|
-
return /* @__PURE__ */
|
|
808
|
+
return /* @__PURE__ */ jsx12(CheckCircledIcon, {});
|
|
783
809
|
} else if (runStep.cancelled_at || runStep.failed_at || runStep.status === "expired") {
|
|
784
|
-
return /* @__PURE__ */
|
|
810
|
+
return /* @__PURE__ */ jsx12(CircleBackslashIcon, {});
|
|
785
811
|
} else {
|
|
786
|
-
return /* @__PURE__ */
|
|
812
|
+
return /* @__PURE__ */ jsx12(CircleIcon, {});
|
|
787
813
|
}
|
|
788
814
|
};
|
|
789
815
|
// src/components/functions/FunctionBase/Content.tsx
|
|
790
816
|
import { useMemo as useMemo3 } from "react";
|
|
791
817
|
import { Code, Box as Box2 } from "@radix-ui/themes";
|
|
792
|
-
import { jsx as
|
|
818
|
+
import { jsx as jsx13, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
793
819
|
var Content = function(param) {
|
|
794
820
|
var fn = param.fn;
|
|
795
821
|
var args = useMemo3(function() {
|
|
@@ -828,36 +854,36 @@ var Content = function(param) {
|
|
|
828
854
|
wordBreak: "break-word"
|
|
829
855
|
},
|
|
830
856
|
children: [
|
|
831
|
-
/* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ jsx13(Box2, {
|
|
832
858
|
children: args && JSON.stringify(args, null, 2)
|
|
833
859
|
}),
|
|
834
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ jsx13(Box2, {
|
|
835
861
|
children: output && JSON.stringify(output, null, 2)
|
|
836
862
|
})
|
|
837
863
|
]
|
|
838
864
|
});
|
|
839
865
|
};
|
|
840
866
|
// src/components/functions/FunctionBase/index.tsx
|
|
841
|
-
import { jsx as
|
|
867
|
+
import { jsx as jsx14, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
842
868
|
var FunctionBase = function(param) {
|
|
843
869
|
var fn = param.fn, runStep = param.runStep, title2 = param.title;
|
|
844
870
|
return /* @__PURE__ */ jsxs3(Popover2.Root, {
|
|
845
871
|
children: [
|
|
846
872
|
/* @__PURE__ */ jsxs3(ToolCallBase, {
|
|
847
873
|
children: [
|
|
848
|
-
/* @__PURE__ */
|
|
874
|
+
/* @__PURE__ */ jsx14(Icon, {
|
|
849
875
|
runStep: runStep
|
|
850
876
|
}),
|
|
851
|
-
/* @__PURE__ */
|
|
877
|
+
/* @__PURE__ */ jsx14(ToolCallTitle, {
|
|
852
878
|
children: title2
|
|
853
879
|
})
|
|
854
880
|
]
|
|
855
881
|
}),
|
|
856
|
-
/* @__PURE__ */
|
|
882
|
+
/* @__PURE__ */ jsx14(Popover2.Content, {
|
|
857
883
|
style: {
|
|
858
884
|
maxHeight: "200px"
|
|
859
885
|
},
|
|
860
|
-
children: /* @__PURE__ */
|
|
886
|
+
children: /* @__PURE__ */ jsx14(Content, {
|
|
861
887
|
fn: fn
|
|
862
888
|
})
|
|
863
889
|
})
|
|
@@ -876,10 +902,10 @@ var title = function(param) {
|
|
|
876
902
|
}
|
|
877
903
|
};
|
|
878
904
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/Fn/DefaultFunction/index.tsx
|
|
879
|
-
import { jsx as
|
|
905
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
880
906
|
var DefaultFunction = function(param) {
|
|
881
907
|
var fn = param.fn, runStep = param.runStep;
|
|
882
|
-
return /* @__PURE__ */
|
|
908
|
+
return /* @__PURE__ */ jsx15(FunctionBase, {
|
|
883
909
|
fn: fn,
|
|
884
910
|
runStep: runStep,
|
|
885
911
|
title: title({
|
|
@@ -889,66 +915,66 @@ var DefaultFunction = function(param) {
|
|
|
889
915
|
});
|
|
890
916
|
};
|
|
891
917
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/Fn/index.tsx
|
|
892
|
-
import { jsx as
|
|
918
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
893
919
|
var Fn = function(param) {
|
|
894
920
|
var fn = param.fn, runStep = param.runStep;
|
|
895
|
-
var functionComponentsContext =
|
|
921
|
+
var functionComponentsContext = useContext5(FunctionComponentsContext);
|
|
896
922
|
var Component = functionComponentsContext[fn.name] || DefaultFunction;
|
|
897
923
|
return(// @ts-ignore-next-line
|
|
898
|
-
/* @__PURE__ */
|
|
924
|
+
/* @__PURE__ */ jsx16(Component, {
|
|
899
925
|
fn: fn,
|
|
900
926
|
runStep: runStep
|
|
901
927
|
}));
|
|
902
928
|
};
|
|
903
929
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/CodeInterpreter/index.tsx
|
|
904
|
-
import { Flex as
|
|
905
|
-
import { jsx as
|
|
930
|
+
import { Flex as Flex7 } from "@radix-ui/themes";
|
|
931
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
906
932
|
var CodeInterpreter = function(param) {
|
|
907
933
|
var codeInterpreter = param.codeInterpreter;
|
|
908
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ jsx17(Flex7, {
|
|
909
935
|
children: codeInterpreter.input
|
|
910
936
|
});
|
|
911
937
|
};
|
|
912
938
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/index.tsx
|
|
913
|
-
import { jsx as
|
|
939
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
914
940
|
var ToolCall = function(param) {
|
|
915
941
|
var toolCall = param.toolCall, runStep = param.runStep;
|
|
916
942
|
if (toolCall.type === "function") {
|
|
917
|
-
return /* @__PURE__ */
|
|
943
|
+
return /* @__PURE__ */ jsx18(Fn, {
|
|
918
944
|
fn: toolCall.function,
|
|
919
945
|
runStep: runStep
|
|
920
946
|
});
|
|
921
947
|
}
|
|
922
948
|
if (toolCall.type === "code_interpreter") {
|
|
923
|
-
return /* @__PURE__ */
|
|
949
|
+
return /* @__PURE__ */ jsx18(CodeInterpreter, {
|
|
924
950
|
codeInterpreter: toolCall.code_interpreter,
|
|
925
951
|
runStep: runStep
|
|
926
952
|
});
|
|
927
953
|
}
|
|
928
|
-
return /* @__PURE__ */
|
|
954
|
+
return /* @__PURE__ */ jsx18(Flex8, {
|
|
929
955
|
children: toolCall.type
|
|
930
956
|
});
|
|
931
957
|
};
|
|
932
958
|
// src/components/runSteps/RunStep/ToolCalls/Starting/index.tsx
|
|
933
959
|
import { Popover as Popover3, Text as Text3 } from "@radix-ui/themes";
|
|
934
960
|
import { CircleIcon as CircleIcon2 } from "@radix-ui/react-icons";
|
|
935
|
-
import { jsx as
|
|
961
|
+
import { jsx as jsx19, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
936
962
|
var Starting = function() {
|
|
937
963
|
return /* @__PURE__ */ jsxs4(Popover3.Root, {
|
|
938
964
|
children: [
|
|
939
965
|
/* @__PURE__ */ jsxs4(ToolCallBase, {
|
|
940
966
|
children: [
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
/* @__PURE__ */
|
|
967
|
+
/* @__PURE__ */ jsx19(CircleIcon2, {}),
|
|
968
|
+
/* @__PURE__ */ jsx19(ToolCallTitle, {
|
|
943
969
|
children: "Starting actions"
|
|
944
970
|
})
|
|
945
971
|
]
|
|
946
972
|
}),
|
|
947
|
-
/* @__PURE__ */
|
|
973
|
+
/* @__PURE__ */ jsx19(Popover3.Content, {
|
|
948
974
|
style: {
|
|
949
975
|
maxHeight: "500px"
|
|
950
976
|
},
|
|
951
|
-
children: /* @__PURE__ */
|
|
977
|
+
children: /* @__PURE__ */ jsx19(Text3, {
|
|
952
978
|
children: "Getting ready to connect to domain API"
|
|
953
979
|
})
|
|
954
980
|
})
|
|
@@ -956,10 +982,10 @@ var Starting = function() {
|
|
|
956
982
|
});
|
|
957
983
|
};
|
|
958
984
|
// src/components/runSteps/RunStep/ToolCalls/index.tsx
|
|
959
|
-
import { jsx as
|
|
985
|
+
import { jsx as jsx20, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
960
986
|
var Root = function(param) {
|
|
961
987
|
var children = param.children;
|
|
962
|
-
return /* @__PURE__ */
|
|
988
|
+
return /* @__PURE__ */ jsx20(Flex9, {
|
|
963
989
|
direction: "column",
|
|
964
990
|
children: children
|
|
965
991
|
});
|
|
@@ -968,9 +994,9 @@ var ToolCalls = function(param) {
|
|
|
968
994
|
var stepDetails = param.stepDetails, runStep = param.runStep;
|
|
969
995
|
return /* @__PURE__ */ jsxs5(Root, {
|
|
970
996
|
children: [
|
|
971
|
-
!stepDetails.tool_calls.length && /* @__PURE__ */
|
|
997
|
+
!stepDetails.tool_calls.length && /* @__PURE__ */ jsx20(Starting, {}),
|
|
972
998
|
stepDetails.tool_calls.map(function(toolCall) {
|
|
973
|
-
return /* @__PURE__ */
|
|
999
|
+
return /* @__PURE__ */ jsx20(ToolCall, {
|
|
974
1000
|
toolCall: toolCall,
|
|
975
1001
|
runStep: runStep
|
|
976
1002
|
}, toolCall.id);
|
|
@@ -982,11 +1008,11 @@ ToolCalls.Root = Root;
|
|
|
982
1008
|
ToolCalls.Starting = Starting;
|
|
983
1009
|
ToolCalls.ToolCall = ToolCall;
|
|
984
1010
|
// src/components/runSteps/RunStep/index.tsx
|
|
985
|
-
import { jsx as
|
|
1011
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
986
1012
|
var RunStep = function(param) {
|
|
987
1013
|
var runStep = param.runStep;
|
|
988
1014
|
if (runStep.step_details.type === "tool_calls") {
|
|
989
|
-
return /* @__PURE__ */
|
|
1015
|
+
return /* @__PURE__ */ jsx21(ToolCalls, {
|
|
990
1016
|
stepDetails: runStep.step_details,
|
|
991
1017
|
runStep: runStep
|
|
992
1018
|
});
|
|
@@ -995,21 +1021,21 @@ var RunStep = function(param) {
|
|
|
995
1021
|
};
|
|
996
1022
|
RunStep.ToolCalls = ToolCalls;
|
|
997
1023
|
// src/contexts/components/ComponentsContext/index.tsx
|
|
998
|
-
var ComponentsContext =
|
|
1024
|
+
var ComponentsContext = createContext7({
|
|
999
1025
|
components: {
|
|
1000
1026
|
RunStep: RunStep
|
|
1001
1027
|
}
|
|
1002
1028
|
});
|
|
1003
1029
|
// src/components/runSteps/RunSteps/index.tsx
|
|
1004
|
-
import { jsx as
|
|
1030
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1005
1031
|
var RunSteps = function(param) {
|
|
1006
1032
|
var runSteps = param.runSteps;
|
|
1007
|
-
var componentsContext =
|
|
1033
|
+
var componentsContext = useContext6(ComponentsContext);
|
|
1008
1034
|
var Component = componentsContext.components.RunStep;
|
|
1009
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */ jsx22(Flex10, {
|
|
1010
1036
|
direction: "column-reverse",
|
|
1011
1037
|
children: runSteps.map(function(runStep) {
|
|
1012
|
-
return /* @__PURE__ */
|
|
1038
|
+
return /* @__PURE__ */ jsx22(Component, {
|
|
1013
1039
|
runStep: runStep
|
|
1014
1040
|
}, runStep.id);
|
|
1015
1041
|
})
|
|
@@ -1034,8 +1060,8 @@ var useIsMutatingMessage = function() {
|
|
|
1034
1060
|
return isMutatingMessage;
|
|
1035
1061
|
};
|
|
1036
1062
|
// src/contexts/messages/MessageContext/index.ts
|
|
1037
|
-
import { createContext as
|
|
1038
|
-
var MessageContext =
|
|
1063
|
+
import { createContext as createContext8 } from "react";
|
|
1064
|
+
var MessageContext = createContext8({
|
|
1039
1065
|
message: null
|
|
1040
1066
|
});
|
|
1041
1067
|
// src/components/threads/Thread/Message/Provider.tsx
|
|
@@ -1043,17 +1069,17 @@ var Provider = MessageContext.Provider;
|
|
|
1043
1069
|
// src/components/threads/Thread/Message/TextContent.tsx
|
|
1044
1070
|
import Markdown from "react-markdown";
|
|
1045
1071
|
// src/hooks/markdown/useMarkdownContext/index.ts
|
|
1046
|
-
import { useContext as
|
|
1072
|
+
import { useContext as useContext7 } from "react";
|
|
1047
1073
|
// src/contexts/markdown/MarkdownContext/index.ts
|
|
1048
|
-
import { createContext as
|
|
1074
|
+
import { createContext as createContext9 } from "react";
|
|
1049
1075
|
// src/contexts/markdown/MarkdownContext/lib/components/Paragraph.tsx
|
|
1050
1076
|
import { Box as Box3, Text as Text4 } from "@radix-ui/themes";
|
|
1051
|
-
import { jsx as
|
|
1077
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1052
1078
|
var Paragraph = function(param) {
|
|
1053
1079
|
var children = param.children;
|
|
1054
|
-
return /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */ jsx23(Box3, {
|
|
1055
1081
|
pb: "3",
|
|
1056
|
-
children: /* @__PURE__ */
|
|
1082
|
+
children: /* @__PURE__ */ jsx23(Text4, {
|
|
1057
1083
|
size: "3",
|
|
1058
1084
|
style: {
|
|
1059
1085
|
whiteSpace: "pre-line",
|
|
@@ -1065,23 +1091,23 @@ var Paragraph = function(param) {
|
|
|
1065
1091
|
};
|
|
1066
1092
|
// src/contexts/markdown/MarkdownContext/lib/components/Link.tsx
|
|
1067
1093
|
import { Link as RadixLink } from "@radix-ui/themes";
|
|
1068
|
-
import { jsx as
|
|
1094
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1069
1095
|
var Link = function(param) {
|
|
1070
1096
|
var children = param.children, href = param.href;
|
|
1071
|
-
return /* @__PURE__ */
|
|
1097
|
+
return /* @__PURE__ */ jsx24(RadixLink, {
|
|
1072
1098
|
href: href,
|
|
1073
1099
|
children: children
|
|
1074
1100
|
});
|
|
1075
1101
|
};
|
|
1076
1102
|
// src/contexts/markdown/MarkdownContext/lib/components/UnorderedList.tsx
|
|
1077
1103
|
import { Box as Box4 } from "@radix-ui/themes";
|
|
1078
|
-
import { jsx as
|
|
1104
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1079
1105
|
var UnorderedList = function(param) {
|
|
1080
1106
|
var children = param.children;
|
|
1081
|
-
return /* @__PURE__ */
|
|
1107
|
+
return /* @__PURE__ */ jsx25(Box4, {
|
|
1082
1108
|
pb: "3",
|
|
1083
1109
|
asChild: true,
|
|
1084
|
-
children: /* @__PURE__ */
|
|
1110
|
+
children: /* @__PURE__ */ jsx25("ul", {
|
|
1085
1111
|
style: {
|
|
1086
1112
|
listStylePosition: "inside"
|
|
1087
1113
|
},
|
|
@@ -1091,13 +1117,13 @@ var UnorderedList = function(param) {
|
|
|
1091
1117
|
};
|
|
1092
1118
|
// src/contexts/markdown/MarkdownContext/lib/components/OrderedList.tsx
|
|
1093
1119
|
import { Box as Box5 } from "@radix-ui/themes";
|
|
1094
|
-
import { jsx as
|
|
1120
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1095
1121
|
var OrderedList = function(param) {
|
|
1096
1122
|
var children = param.children;
|
|
1097
|
-
return /* @__PURE__ */
|
|
1123
|
+
return /* @__PURE__ */ jsx26(Box5, {
|
|
1098
1124
|
pb: "3",
|
|
1099
1125
|
asChild: true,
|
|
1100
|
-
children: /* @__PURE__ */
|
|
1126
|
+
children: /* @__PURE__ */ jsx26("ol", {
|
|
1101
1127
|
style: {
|
|
1102
1128
|
listStylePosition: "inside"
|
|
1103
1129
|
},
|
|
@@ -1107,31 +1133,31 @@ var OrderedList = function(param) {
|
|
|
1107
1133
|
};
|
|
1108
1134
|
// src/contexts/markdown/MarkdownContext/lib/components/ListItem.tsx
|
|
1109
1135
|
import { Box as Box6 } from "@radix-ui/themes";
|
|
1110
|
-
import { jsx as
|
|
1136
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1111
1137
|
var ListItem = function(param) {
|
|
1112
1138
|
var children = param.children;
|
|
1113
|
-
return /* @__PURE__ */
|
|
1139
|
+
return /* @__PURE__ */ jsx27(Box6, {
|
|
1114
1140
|
pb: "1",
|
|
1115
|
-
children: /* @__PURE__ */
|
|
1141
|
+
children: /* @__PURE__ */ jsx27("li", {
|
|
1116
1142
|
children: children
|
|
1117
1143
|
})
|
|
1118
1144
|
});
|
|
1119
1145
|
};
|
|
1120
1146
|
// src/contexts/markdown/MarkdownContext/lib/components/Strong.tsx
|
|
1121
1147
|
import { Strong as RadixStrong } from "@radix-ui/themes";
|
|
1122
|
-
import { jsx as
|
|
1148
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1123
1149
|
var Strong = function(param) {
|
|
1124
1150
|
var children = param.children;
|
|
1125
|
-
return /* @__PURE__ */
|
|
1151
|
+
return /* @__PURE__ */ jsx28(RadixStrong, {
|
|
1126
1152
|
children: children
|
|
1127
1153
|
});
|
|
1128
1154
|
};
|
|
1129
1155
|
// src/contexts/markdown/MarkdownContext/lib/components/Pre.tsx
|
|
1130
1156
|
import { Box as Box7 } from "@radix-ui/themes";
|
|
1131
|
-
import { jsx as
|
|
1157
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1132
1158
|
var Pre = function(param) {
|
|
1133
1159
|
var children = param.children;
|
|
1134
|
-
return /* @__PURE__ */
|
|
1160
|
+
return /* @__PURE__ */ jsx29(Box7, {
|
|
1135
1161
|
style: {
|
|
1136
1162
|
whiteSpace: "pre-wrap",
|
|
1137
1163
|
wordBreak: "break-word"
|
|
@@ -1141,20 +1167,20 @@ var Pre = function(param) {
|
|
|
1141
1167
|
};
|
|
1142
1168
|
// src/contexts/markdown/MarkdownContext/lib/components/Code.tsx
|
|
1143
1169
|
import { Code as RadixCode } from "@radix-ui/themes";
|
|
1144
|
-
import { jsx as
|
|
1170
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1145
1171
|
var Code2 = function(param) {
|
|
1146
1172
|
var children = param.children;
|
|
1147
|
-
return /* @__PURE__ */
|
|
1173
|
+
return /* @__PURE__ */ jsx30(RadixCode, {
|
|
1148
1174
|
children: children
|
|
1149
1175
|
});
|
|
1150
1176
|
};
|
|
1151
1177
|
// src/contexts/markdown/MarkdownContext/lib/components/Img.tsx
|
|
1152
1178
|
import { Box as Box8 } from "@radix-ui/themes";
|
|
1153
|
-
import { jsx as
|
|
1179
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1154
1180
|
var Img = function(props) {
|
|
1155
|
-
return /* @__PURE__ */
|
|
1181
|
+
return /* @__PURE__ */ jsx31(Box8, {
|
|
1156
1182
|
pb: "3",
|
|
1157
|
-
children: /* @__PURE__ */
|
|
1183
|
+
children: /* @__PURE__ */ jsx31("img", _object_spread_props(_object_spread({}, props), {
|
|
1158
1184
|
style: {
|
|
1159
1185
|
maxWidth: "100%",
|
|
1160
1186
|
height: "auto"
|
|
@@ -1175,7 +1201,7 @@ var components = {
|
|
|
1175
1201
|
img: Img
|
|
1176
1202
|
};
|
|
1177
1203
|
// src/contexts/markdown/MarkdownContext/index.ts
|
|
1178
|
-
var MarkdownContext =
|
|
1204
|
+
var MarkdownContext = createContext9({
|
|
1179
1205
|
remarkPlugins: [],
|
|
1180
1206
|
rehypeReactOptions: {
|
|
1181
1207
|
components: components
|
|
@@ -1183,19 +1209,19 @@ var MarkdownContext = createContext8({
|
|
|
1183
1209
|
});
|
|
1184
1210
|
// src/hooks/markdown/useMarkdownContext/index.ts
|
|
1185
1211
|
var useMarkdownContext = function() {
|
|
1186
|
-
return
|
|
1212
|
+
return useContext7(MarkdownContext);
|
|
1187
1213
|
};
|
|
1188
1214
|
// src/components/threads/Thread/Message/TextContent.tsx
|
|
1189
|
-
import { jsx as
|
|
1215
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1190
1216
|
var TextContent = function(param) {
|
|
1191
1217
|
var content = param.content;
|
|
1192
1218
|
var markdownContext = useMarkdownContext();
|
|
1193
|
-
return /* @__PURE__ */
|
|
1219
|
+
return /* @__PURE__ */ jsx32(Markdown, _object_spread_props(_object_spread({}, markdownContext), {
|
|
1194
1220
|
children: content.text.value
|
|
1195
1221
|
}));
|
|
1196
1222
|
};
|
|
1197
1223
|
// src/components/threads/Thread/Message/index.tsx
|
|
1198
|
-
import { jsx as
|
|
1224
|
+
import { jsx as jsx33, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1199
1225
|
var Message = function(param) {
|
|
1200
1226
|
var message = param.message;
|
|
1201
1227
|
var _useMemo5 = _sliced_to_array(useMemo5(function() {
|
|
@@ -1240,68 +1266,65 @@ var Message = function(param) {
|
|
|
1240
1266
|
}, [
|
|
1241
1267
|
message
|
|
1242
1268
|
]);
|
|
1243
|
-
return /* @__PURE__ */
|
|
1269
|
+
return /* @__PURE__ */ jsx33(Provider, {
|
|
1244
1270
|
value: {
|
|
1245
1271
|
message: message
|
|
1246
1272
|
},
|
|
1247
1273
|
children: /* @__PURE__ */ jsxs6(Box9, {
|
|
1248
1274
|
children: [
|
|
1249
|
-
/* @__PURE__ */
|
|
1275
|
+
/* @__PURE__ */ jsx33(RunSteps, {
|
|
1250
1276
|
runSteps: olderRunSteps
|
|
1251
1277
|
}),
|
|
1252
1278
|
/* @__PURE__ */ jsxs6(Box9, {
|
|
1253
1279
|
children: [
|
|
1254
1280
|
message.content.map(function(content, index) {
|
|
1255
|
-
return /* @__PURE__ */
|
|
1256
|
-
children: content.type === "text" && /* @__PURE__ */
|
|
1281
|
+
return /* @__PURE__ */ jsx33(Fragment, {
|
|
1282
|
+
children: content.type === "text" && /* @__PURE__ */ jsx33(TextContent, {
|
|
1257
1283
|
content: content
|
|
1258
1284
|
})
|
|
1259
1285
|
}, index);
|
|
1260
1286
|
}),
|
|
1261
|
-
isInProgress && isEmpty(laterRunSteps) && /* @__PURE__ */
|
|
1287
|
+
isInProgress && isEmpty(laterRunSteps) && /* @__PURE__ */ jsx33(StartingContentSkeleton, {})
|
|
1262
1288
|
]
|
|
1263
1289
|
}),
|
|
1264
|
-
/* @__PURE__ */
|
|
1290
|
+
/* @__PURE__ */ jsx33(RunSteps, {
|
|
1265
1291
|
runSteps: laterRunSteps
|
|
1266
1292
|
}),
|
|
1267
|
-
isInProgress && !isEmpty(laterRunSteps) && /* @__PURE__ */
|
|
1268
|
-
children: /* @__PURE__ */
|
|
1293
|
+
isInProgress && !isEmpty(laterRunSteps) && /* @__PURE__ */ jsx33(Box9, {
|
|
1294
|
+
children: /* @__PURE__ */ jsx33(StartingContentSkeleton, {})
|
|
1269
1295
|
})
|
|
1270
1296
|
]
|
|
1271
1297
|
})
|
|
1272
1298
|
});
|
|
1273
1299
|
};
|
|
1274
1300
|
// src/components/threads/Thread/Messages/Content/MessageGroup/Content/index.tsx
|
|
1275
|
-
import { jsx as
|
|
1301
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1276
1302
|
var Content2 = function(param) {
|
|
1277
1303
|
var messageGroup = param.messageGroup;
|
|
1278
|
-
return /* @__PURE__ */
|
|
1304
|
+
return /* @__PURE__ */ jsx34(Flex11, {
|
|
1279
1305
|
direction: "column-reverse",
|
|
1280
1306
|
children: messageGroup.messages.map(function(message) {
|
|
1281
|
-
return /* @__PURE__ */
|
|
1307
|
+
return /* @__PURE__ */ jsx34(Message, {
|
|
1282
1308
|
message: message
|
|
1283
1309
|
}, message.id);
|
|
1284
1310
|
})
|
|
1285
1311
|
});
|
|
1286
1312
|
};
|
|
1287
1313
|
// src/components/threads/Thread/Messages/Content/MessageGroup/index.tsx
|
|
1288
|
-
import { jsx as
|
|
1314
|
+
import { jsx as jsx35, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1289
1315
|
var MessageGroup = function(param) {
|
|
1290
1316
|
var messageGroup = param.messageGroup;
|
|
1291
|
-
var assistantNameContext =
|
|
1317
|
+
var assistantNameContext = useContext8(AssistantNameContext);
|
|
1292
1318
|
return /* @__PURE__ */ jsxs7(MessageGroupBase, {
|
|
1293
1319
|
children: [
|
|
1294
|
-
messageGroup.role === "user" ? /* @__PURE__ */
|
|
1295
|
-
fallback: /* @__PURE__ */ jsx33(PersonIcon, {}),
|
|
1296
|
-
size: "1"
|
|
1297
|
-
}) : /* @__PURE__ */ jsx33(AssistantAvatar, {}),
|
|
1320
|
+
messageGroup.role === "user" ? /* @__PURE__ */ jsx35(UserAvatar, {}) : /* @__PURE__ */ jsx35(AssistantAvatar, {}),
|
|
1298
1321
|
/* @__PURE__ */ jsxs7(Box10, {
|
|
1299
1322
|
flexGrow: "1",
|
|
1300
1323
|
children: [
|
|
1301
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ jsx35(Name, {
|
|
1302
1325
|
children: messageGroup.role === "user" ? "You" : assistantNameContext
|
|
1303
1326
|
}),
|
|
1304
|
-
/* @__PURE__ */
|
|
1327
|
+
/* @__PURE__ */ jsx35(Content2, {
|
|
1305
1328
|
messageGroup: messageGroup
|
|
1306
1329
|
})
|
|
1307
1330
|
]
|
|
@@ -1310,7 +1333,7 @@ var MessageGroup = function(param) {
|
|
|
1310
1333
|
});
|
|
1311
1334
|
};
|
|
1312
1335
|
// src/components/threads/Thread/Messages/Content/index.tsx
|
|
1313
|
-
import { Fragment as Fragment2, jsx as
|
|
1336
|
+
import { Fragment as Fragment2, jsx as jsx36 } from "react/jsx-runtime";
|
|
1314
1337
|
var Content3 = function() {
|
|
1315
1338
|
var _useMessages = useMessages(), messages2 = _useMessages.messages, isLoading = _useMessages.isLoading, isLoadingError = _useMessages.isLoadingError;
|
|
1316
1339
|
var addToast = useToasts().addToast;
|
|
@@ -1329,11 +1352,11 @@ var Content3 = function() {
|
|
|
1329
1352
|
addToast
|
|
1330
1353
|
]);
|
|
1331
1354
|
if (isLoading || isLoadingError) {
|
|
1332
|
-
return /* @__PURE__ */
|
|
1355
|
+
return /* @__PURE__ */ jsx36(MessagesSkeleton, {});
|
|
1333
1356
|
}
|
|
1334
|
-
return /* @__PURE__ */
|
|
1357
|
+
return /* @__PURE__ */ jsx36(Fragment2, {
|
|
1335
1358
|
children: messageGroups2.map(function(messageGroup) {
|
|
1336
|
-
return /* @__PURE__ */
|
|
1359
|
+
return /* @__PURE__ */ jsx36(MessageGroup, {
|
|
1337
1360
|
messageGroup: messageGroup
|
|
1338
1361
|
}, messageGroup.id);
|
|
1339
1362
|
})
|
|
@@ -1342,22 +1365,22 @@ var Content3 = function() {
|
|
|
1342
1365
|
// src/components/threads/Thread/Messages/Progress/index.tsx
|
|
1343
1366
|
import { useMemo as useMemo7 } from "react";
|
|
1344
1367
|
// src/components/skeletons/StartingSkeleton/index.tsx
|
|
1345
|
-
import { useContext as
|
|
1368
|
+
import { useContext as useContext9 } from "react";
|
|
1346
1369
|
import { Box as Box11 } from "@radix-ui/themes";
|
|
1347
|
-
import { jsx as
|
|
1370
|
+
import { jsx as jsx37, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1348
1371
|
var StartingSkeleton = function(param) {
|
|
1349
1372
|
var children = param.children;
|
|
1350
|
-
var assistantNameContext =
|
|
1373
|
+
var assistantNameContext = useContext9(AssistantNameContext);
|
|
1351
1374
|
return /* @__PURE__ */ jsxs8(MessageGroupBase, {
|
|
1352
1375
|
children: [
|
|
1353
|
-
/* @__PURE__ */
|
|
1376
|
+
/* @__PURE__ */ jsx37(AssistantAvatar, {}),
|
|
1354
1377
|
/* @__PURE__ */ jsxs8(Box11, {
|
|
1355
1378
|
children: [
|
|
1356
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ jsx37(Name, {
|
|
1357
1380
|
children: assistantNameContext
|
|
1358
1381
|
}),
|
|
1359
1382
|
children,
|
|
1360
|
-
/* @__PURE__ */
|
|
1383
|
+
/* @__PURE__ */ jsx37(StartingContentSkeleton, {})
|
|
1361
1384
|
]
|
|
1362
1385
|
})
|
|
1363
1386
|
]
|
|
@@ -1382,7 +1405,7 @@ var isOptimistic = function(param) {
|
|
|
1382
1405
|
return _4.startsWith(id, "-");
|
|
1383
1406
|
};
|
|
1384
1407
|
// src/components/threads/Thread/Messages/Progress/index.tsx
|
|
1385
|
-
import { jsx as
|
|
1408
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
1386
1409
|
var Progress = function() {
|
|
1387
1410
|
var latestMessage = useLatestMessage().latestMessage;
|
|
1388
1411
|
var isMutatingMessage = useIsMutatingMessage();
|
|
@@ -1400,10 +1423,10 @@ var Progress = function() {
|
|
|
1400
1423
|
isMutatingMessage
|
|
1401
1424
|
]);
|
|
1402
1425
|
if (!isVisible) return null;
|
|
1403
|
-
return /* @__PURE__ */
|
|
1426
|
+
return /* @__PURE__ */ jsx38(StartingSkeleton, {});
|
|
1404
1427
|
};
|
|
1405
1428
|
// src/components/threads/Thread/Messages/Root/index.tsx
|
|
1406
|
-
import { Flex as
|
|
1429
|
+
import { Flex as Flex12 } from "@radix-ui/themes";
|
|
1407
1430
|
// src/hooks/misc/useInfiniteScroll/index.tsx
|
|
1408
1431
|
import { useRef as useRef3 } from "react";
|
|
1409
1432
|
import { useInView } from "react-intersection-observer";
|
|
@@ -1459,7 +1482,7 @@ var useInfiniteScroll = function(param) {
|
|
|
1459
1482
|
};
|
|
1460
1483
|
};
|
|
1461
1484
|
// src/components/threads/Thread/Messages/Root/index.tsx
|
|
1462
|
-
import { jsx as
|
|
1485
|
+
import { jsx as jsx39, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1463
1486
|
var Root2 = function(param) {
|
|
1464
1487
|
var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
1465
1488
|
var _useMessages = useMessages(), isFetchingNextPage = _useMessages.isFetchingNextPage, hasNextPage = _useMessages.hasNextPage, fetchNextPage = _useMessages.fetchNextPage;
|
|
@@ -1468,7 +1491,7 @@ var Root2 = function(param) {
|
|
|
1468
1491
|
hasNextPage: hasNextPage,
|
|
1469
1492
|
fetchNextPage: fetchNextPage
|
|
1470
1493
|
}), containerRef = _useInfiniteScroll.containerRef, loaderRef = _useInfiniteScroll.loaderRef;
|
|
1471
|
-
return /* @__PURE__ */ jsxs9(
|
|
1494
|
+
return /* @__PURE__ */ jsxs9(Flex12, {
|
|
1472
1495
|
ref: containerRef,
|
|
1473
1496
|
direction: "column-reverse",
|
|
1474
1497
|
flexGrow: "1",
|
|
@@ -1477,10 +1500,10 @@ var Root2 = function(param) {
|
|
|
1477
1500
|
}),
|
|
1478
1501
|
children: [
|
|
1479
1502
|
children,
|
|
1480
|
-
hasNextPage && /* @__PURE__ */
|
|
1503
|
+
hasNextPage && /* @__PURE__ */ jsx39(Flex12, {
|
|
1481
1504
|
ref: loaderRef
|
|
1482
1505
|
}),
|
|
1483
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ jsx39(Flex12, {
|
|
1484
1507
|
flexShrink: "0",
|
|
1485
1508
|
flexGrow: "1"
|
|
1486
1509
|
})
|
|
@@ -1488,30 +1511,30 @@ var Root2 = function(param) {
|
|
|
1488
1511
|
});
|
|
1489
1512
|
};
|
|
1490
1513
|
// src/components/threads/Thread/Messages/NextPageSkeleton.tsx
|
|
1491
|
-
import { jsx as
|
|
1514
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1492
1515
|
var NextPageSkeleton = function() {
|
|
1493
1516
|
var hasNextPage = useMessages().hasNextPage;
|
|
1494
1517
|
if (!hasNextPage) {
|
|
1495
1518
|
return null;
|
|
1496
1519
|
}
|
|
1497
|
-
return /* @__PURE__ */
|
|
1520
|
+
return /* @__PURE__ */ jsx40(MessagesSkeleton, {});
|
|
1498
1521
|
};
|
|
1499
1522
|
// src/components/threads/Thread/Messages/index.tsx
|
|
1500
|
-
import { jsx as
|
|
1523
|
+
import { jsx as jsx41, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1501
1524
|
var Messages = function(param) {
|
|
1502
1525
|
var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
1503
1526
|
return /* @__PURE__ */ jsxs10(Root2, {
|
|
1504
1527
|
style: style,
|
|
1505
1528
|
children: [
|
|
1506
|
-
/* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ jsx41(Flex13, {
|
|
1507
1530
|
flexShrink: "0",
|
|
1508
1531
|
height: "var(--space-3)"
|
|
1509
1532
|
}),
|
|
1510
|
-
/* @__PURE__ */
|
|
1533
|
+
/* @__PURE__ */ jsx41(Progress, {}),
|
|
1511
1534
|
children,
|
|
1512
|
-
/* @__PURE__ */
|
|
1513
|
-
/* @__PURE__ */
|
|
1514
|
-
/* @__PURE__ */
|
|
1535
|
+
/* @__PURE__ */ jsx41(Content3, {}),
|
|
1536
|
+
/* @__PURE__ */ jsx41(NextPageSkeleton, {}),
|
|
1537
|
+
/* @__PURE__ */ jsx41(Flex13, {
|
|
1515
1538
|
flexShrink: "0",
|
|
1516
1539
|
flexGrow: "1"
|
|
1517
1540
|
})
|
|
@@ -1522,41 +1545,41 @@ Messages.Root = Root2;
|
|
|
1522
1545
|
Messages.Message = Message;
|
|
1523
1546
|
Messages.NextPageSkeleton = NextPageSkeleton;
|
|
1524
1547
|
// src/components/threads/Thread/MessageForm/index.tsx
|
|
1525
|
-
import { Flex as
|
|
1548
|
+
import { Flex as Flex15, Text as Text5 } from "@radix-ui/themes";
|
|
1526
1549
|
// src/components/threads/Thread/MessageForm/Submit/index.tsx
|
|
1527
1550
|
import { ArrowUpIcon, StopIcon } from "@radix-ui/react-icons";
|
|
1528
1551
|
import { IconButton } from "@radix-ui/themes";
|
|
1529
1552
|
// src/hooks/messages/useMessageFormContext/index.ts
|
|
1530
|
-
import { useContext as
|
|
1553
|
+
import { useContext as useContext10 } from "react";
|
|
1531
1554
|
// src/contexts/messages/MessageFormContext/index.ts
|
|
1532
|
-
import { createContext as
|
|
1533
|
-
var MessageFormContext =
|
|
1555
|
+
import { createContext as createContext10 } from "react";
|
|
1556
|
+
var MessageFormContext = createContext10({
|
|
1534
1557
|
isDisabled: false,
|
|
1535
1558
|
isLoading: false
|
|
1536
1559
|
});
|
|
1537
1560
|
// src/hooks/messages/useMessageFormContext/index.ts
|
|
1538
1561
|
var useMessageFormContext = function() {
|
|
1539
|
-
return
|
|
1562
|
+
return useContext10(MessageFormContext);
|
|
1540
1563
|
};
|
|
1541
1564
|
// src/components/threads/Thread/MessageForm/Submit/index.tsx
|
|
1542
|
-
import { jsx as
|
|
1565
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1543
1566
|
var Submit = function() {
|
|
1544
1567
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
1545
1568
|
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
|
|
1546
1569
|
if (isLoading) {
|
|
1547
|
-
return /* @__PURE__ */
|
|
1570
|
+
return /* @__PURE__ */ jsx42(IconButton, {
|
|
1548
1571
|
type: "button",
|
|
1549
1572
|
onClick: function() {
|
|
1550
1573
|
var _superinterfaceContext_createMessageAbortControllerRef_current;
|
|
1551
1574
|
return (_superinterfaceContext_createMessageAbortControllerRef_current = superinterfaceContext.createMessageAbortControllerRef.current) === null || _superinterfaceContext_createMessageAbortControllerRef_current === void 0 ? void 0 : _superinterfaceContext_createMessageAbortControllerRef_current.abort();
|
|
1552
1575
|
},
|
|
1553
|
-
children: /* @__PURE__ */
|
|
1576
|
+
children: /* @__PURE__ */ jsx42(StopIcon, {})
|
|
1554
1577
|
});
|
|
1555
1578
|
}
|
|
1556
|
-
return /* @__PURE__ */
|
|
1579
|
+
return /* @__PURE__ */ jsx42(IconButton, {
|
|
1557
1580
|
type: "submit",
|
|
1558
1581
|
disabled: isDisabled,
|
|
1559
|
-
children: /* @__PURE__ */
|
|
1582
|
+
children: /* @__PURE__ */ jsx42(ArrowUpIcon, {})
|
|
1560
1583
|
});
|
|
1561
1584
|
};
|
|
1562
1585
|
// src/components/threads/Thread/MessageForm/Root/index.tsx
|
|
@@ -2184,7 +2207,7 @@ var formOptions = {
|
|
|
2184
2207
|
};
|
|
2185
2208
|
// src/components/threads/Thread/MessageForm/Root/index.tsx
|
|
2186
2209
|
import { partob as partob2 } from "radash";
|
|
2187
|
-
import { jsx as
|
|
2210
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
2188
2211
|
var Root3 = function(param) {
|
|
2189
2212
|
var children = param.children, onSubmitArg = param.onSubmit;
|
|
2190
2213
|
var formProps = useForm(formOptions);
|
|
@@ -2259,16 +2282,16 @@ var Root3 = function(param) {
|
|
|
2259
2282
|
latestMessage,
|
|
2260
2283
|
isLoading
|
|
2261
2284
|
]);
|
|
2262
|
-
return /* @__PURE__ */
|
|
2285
|
+
return /* @__PURE__ */ jsx43(MessageFormContext.Provider, {
|
|
2263
2286
|
value: {
|
|
2264
2287
|
isDisabled: isDisabled,
|
|
2265
2288
|
isLoading: isLoading
|
|
2266
2289
|
},
|
|
2267
|
-
children: /* @__PURE__ */
|
|
2268
|
-
children: /* @__PURE__ */
|
|
2290
|
+
children: /* @__PURE__ */ jsx43(FormProvider, _object_spread_props(_object_spread({}, formProps), {
|
|
2291
|
+
children: /* @__PURE__ */ jsx43(Box12, {
|
|
2269
2292
|
asChild: true,
|
|
2270
2293
|
flexShrink: "0",
|
|
2271
|
-
children: /* @__PURE__ */
|
|
2294
|
+
children: /* @__PURE__ */ jsx43("form", {
|
|
2272
2295
|
onSubmit: handleSubmit(onSubmit),
|
|
2273
2296
|
children: children
|
|
2274
2297
|
})
|
|
@@ -2278,19 +2301,19 @@ var Root3 = function(param) {
|
|
|
2278
2301
|
};
|
|
2279
2302
|
// src/components/threads/Thread/MessageForm/Field/index.tsx
|
|
2280
2303
|
import { usePrevious } from "react-use";
|
|
2281
|
-
import { useContext as
|
|
2304
|
+
import { useContext as useContext11, useMemo as useMemo9, useRef as useRef4, useEffect as useEffect3 } from "react";
|
|
2282
2305
|
// src/components/textareas/TextareaBase/index.tsx
|
|
2283
2306
|
import { forwardRef as forwardRef3 } from "react";
|
|
2284
2307
|
import TextareaAutosize from "react-textarea-autosize";
|
|
2285
|
-
import { Fragment as Fragment3, jsx as
|
|
2308
|
+
import { Fragment as Fragment3, jsx as jsx44, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2286
2309
|
var UPSCALE_RATIO = 16 / 14;
|
|
2287
2310
|
var TextareaBase = forwardRef3(function TextareaBase2(props, ref) {
|
|
2288
2311
|
return /* @__PURE__ */ jsxs11(Fragment3, {
|
|
2289
2312
|
children: [
|
|
2290
|
-
/* @__PURE__ */
|
|
2313
|
+
/* @__PURE__ */ jsx44("style", {
|
|
2291
2314
|
children: ".superinterface-textarea { min-height: inherit; height: 30px; }\n.superinterface-textarea::placeholder { color: var(--gray-a10); }"
|
|
2292
2315
|
}),
|
|
2293
|
-
/* @__PURE__ */
|
|
2316
|
+
/* @__PURE__ */ jsx44(TextareaAutosize, _object_spread({
|
|
2294
2317
|
ref: ref,
|
|
2295
2318
|
className: "rt-reset superinterface-textarea",
|
|
2296
2319
|
style: {
|
|
@@ -2314,21 +2337,21 @@ var TextareaBase = forwardRef3(function TextareaBase2(props, ref) {
|
|
|
2314
2337
|
});
|
|
2315
2338
|
// src/components/threads/Thread/MessageForm/Field/index.tsx
|
|
2316
2339
|
import { useFormContext } from "react-hook-form";
|
|
2317
|
-
import { Container as Container2, Flex as
|
|
2318
|
-
import { jsx as
|
|
2340
|
+
import { Container as Container2, Flex as Flex14 } from "@radix-ui/themes";
|
|
2341
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2319
2342
|
var Root4 = function(param) {
|
|
2320
2343
|
var children = param.children;
|
|
2321
2344
|
var _useFormContext = useFormContext(), errors = _useFormContext.formState.errors;
|
|
2322
|
-
return /* @__PURE__ */
|
|
2345
|
+
return /* @__PURE__ */ jsx45(Container2, {
|
|
2323
2346
|
size: "2",
|
|
2324
2347
|
flexGrow: "0",
|
|
2325
|
-
children: /* @__PURE__ */
|
|
2348
|
+
children: /* @__PURE__ */ jsx45(Flex14, {
|
|
2326
2349
|
direction: "column",
|
|
2327
2350
|
flexShrink: "0",
|
|
2328
|
-
children: /* @__PURE__ */
|
|
2351
|
+
children: /* @__PURE__ */ jsx45(Flex14, {
|
|
2329
2352
|
direction: "column",
|
|
2330
2353
|
flexShrink: "0",
|
|
2331
|
-
children: /* @__PURE__ */
|
|
2354
|
+
children: /* @__PURE__ */ jsx45(Flex14, {
|
|
2332
2355
|
style: _object_spread({
|
|
2333
2356
|
borderRadius: "var(--radius-2)",
|
|
2334
2357
|
borderWidth: "1px",
|
|
@@ -2346,7 +2369,7 @@ var Root4 = function(param) {
|
|
|
2346
2369
|
});
|
|
2347
2370
|
};
|
|
2348
2371
|
var Control = function() {
|
|
2349
|
-
var assistantNameContext =
|
|
2372
|
+
var assistantNameContext = useContext11(AssistantNameContext);
|
|
2350
2373
|
var register = useFormContext().register;
|
|
2351
2374
|
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
|
|
2352
2375
|
var isSubmitDisabled = useMemo9(function() {
|
|
@@ -2368,7 +2391,7 @@ var Control = function() {
|
|
|
2368
2391
|
isDisabledPrevious,
|
|
2369
2392
|
textareaProps
|
|
2370
2393
|
]);
|
|
2371
|
-
return /* @__PURE__ */
|
|
2394
|
+
return /* @__PURE__ */ jsx45(TextareaBase, _object_spread_props(_object_spread({
|
|
2372
2395
|
minRows: 1,
|
|
2373
2396
|
placeholder: "Message ".concat(assistantNameContext, "..."),
|
|
2374
2397
|
disabled: isDisabled,
|
|
@@ -2392,26 +2415,26 @@ var Field = {
|
|
|
2392
2415
|
Control: Control
|
|
2393
2416
|
};
|
|
2394
2417
|
// src/components/threads/Thread/MessageForm/index.tsx
|
|
2395
|
-
import { jsx as
|
|
2418
|
+
import { jsx as jsx46, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2396
2419
|
var MessageForm = function() {
|
|
2397
|
-
return /* @__PURE__ */
|
|
2420
|
+
return /* @__PURE__ */ jsx46(Root3, {
|
|
2398
2421
|
children: /* @__PURE__ */ jsxs12(Field.Root, {
|
|
2399
2422
|
children: [
|
|
2400
|
-
/* @__PURE__ */
|
|
2423
|
+
/* @__PURE__ */ jsx46(Text5, {
|
|
2401
2424
|
size: "2",
|
|
2402
2425
|
style: {
|
|
2403
2426
|
flexGrow: 1
|
|
2404
2427
|
},
|
|
2405
|
-
children: /* @__PURE__ */
|
|
2428
|
+
children: /* @__PURE__ */ jsx46(Flex15, {
|
|
2406
2429
|
flexGrow: "1",
|
|
2407
2430
|
direction: "column",
|
|
2408
|
-
children: /* @__PURE__ */
|
|
2431
|
+
children: /* @__PURE__ */ jsx46(Field.Control, {})
|
|
2409
2432
|
})
|
|
2410
2433
|
}),
|
|
2411
|
-
/* @__PURE__ */
|
|
2434
|
+
/* @__PURE__ */ jsx46(Flex15, {
|
|
2412
2435
|
flexShrink: "0",
|
|
2413
2436
|
align: "end",
|
|
2414
|
-
children: /* @__PURE__ */
|
|
2437
|
+
children: /* @__PURE__ */ jsx46(Submit, {})
|
|
2415
2438
|
})
|
|
2416
2439
|
]
|
|
2417
2440
|
})
|
|
@@ -2421,17 +2444,17 @@ MessageForm.Root = Root3;
|
|
|
2421
2444
|
MessageForm.Field = Field;
|
|
2422
2445
|
MessageForm.Submit = Submit;
|
|
2423
2446
|
// src/components/threads/Thread/Root/index.tsx
|
|
2424
|
-
import { Flex as
|
|
2447
|
+
import { Flex as Flex16 } from "@radix-ui/themes";
|
|
2425
2448
|
// src/components/threads/Thread/Provider/index.tsx
|
|
2426
2449
|
var Provider2 = SuperinterfaceProvider;
|
|
2427
2450
|
// src/components/threads/Thread/Root/index.tsx
|
|
2428
|
-
import { jsx as
|
|
2451
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
2429
2452
|
var Root5 = function(_param) {
|
|
2430
2453
|
var children = _param.children, rest = _object_without_properties(_param, [
|
|
2431
2454
|
"children"
|
|
2432
2455
|
]);
|
|
2433
|
-
return /* @__PURE__ */
|
|
2434
|
-
children: /* @__PURE__ */
|
|
2456
|
+
return /* @__PURE__ */ jsx47(Provider2, _object_spread_props(_object_spread({}, rest), {
|
|
2457
|
+
children: /* @__PURE__ */ jsx47(Flex16, {
|
|
2435
2458
|
direction: "column",
|
|
2436
2459
|
flexGrow: "1",
|
|
2437
2460
|
children: children
|
|
@@ -2439,12 +2462,12 @@ var Root5 = function(_param) {
|
|
|
2439
2462
|
}));
|
|
2440
2463
|
};
|
|
2441
2464
|
// src/components/threads/Thread/index.tsx
|
|
2442
|
-
import { jsx as
|
|
2465
|
+
import { jsx as jsx48, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2443
2466
|
var Thread = function(props) {
|
|
2444
2467
|
return /* @__PURE__ */ jsxs13(Root5, _object_spread_props(_object_spread({}, props), {
|
|
2445
2468
|
children: [
|
|
2446
|
-
/* @__PURE__ */
|
|
2447
|
-
/* @__PURE__ */
|
|
2469
|
+
/* @__PURE__ */ jsx48(Messages, {}),
|
|
2470
|
+
/* @__PURE__ */ jsx48(MessageForm, {})
|
|
2448
2471
|
]
|
|
2449
2472
|
}));
|
|
2450
2473
|
};
|
|
@@ -2452,30 +2475,30 @@ Thread.Root = Root5;
|
|
|
2452
2475
|
Thread.Messages = Messages;
|
|
2453
2476
|
Thread.MessageForm = MessageForm;
|
|
2454
2477
|
// src/hooks/messages/useMessageContext/index.ts
|
|
2455
|
-
import { useContext as
|
|
2478
|
+
import { useContext as useContext12 } from "react";
|
|
2456
2479
|
var useMessageContext = function() {
|
|
2457
|
-
return
|
|
2480
|
+
return useContext12(MessageContext);
|
|
2458
2481
|
};
|
|
2459
2482
|
// src/components/threads/ThreadDialog/Provider/index.tsx
|
|
2460
2483
|
import { useState } from "react";
|
|
2461
2484
|
// src/contexts/threads/ThreadDialogContext/index.ts
|
|
2462
|
-
import { createContext as
|
|
2463
|
-
var ThreadDialogContext =
|
|
2485
|
+
import { createContext as createContext11 } from "react";
|
|
2486
|
+
var ThreadDialogContext = createContext11({
|
|
2464
2487
|
isOpen: false,
|
|
2465
2488
|
setIsOpen: function() {}
|
|
2466
2489
|
});
|
|
2467
2490
|
// src/hooks/threads/useThreadDialogContext/index.ts
|
|
2468
|
-
import { useContext as
|
|
2491
|
+
import { useContext as useContext13 } from "react";
|
|
2469
2492
|
var useThreadDialogContext = function() {
|
|
2470
|
-
return
|
|
2493
|
+
return useContext13(ThreadDialogContext);
|
|
2471
2494
|
};
|
|
2472
2495
|
// src/components/threads/ThreadDialog/Provider/index.tsx
|
|
2473
|
-
import { jsx as
|
|
2496
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
2474
2497
|
var Provider3 = function(param) {
|
|
2475
2498
|
var children = param.children;
|
|
2476
2499
|
var threadDialogContext = useThreadDialogContext();
|
|
2477
2500
|
var _useState = _sliced_to_array(useState(threadDialogContext.isOpen), 2), isOpen = _useState[0], setIsOpen = _useState[1];
|
|
2478
|
-
return /* @__PURE__ */
|
|
2501
|
+
return /* @__PURE__ */ jsx49(ThreadDialogContext.Provider, {
|
|
2479
2502
|
value: {
|
|
2480
2503
|
isOpen: isOpen,
|
|
2481
2504
|
setIsOpen: setIsOpen
|
|
@@ -2488,27 +2511,27 @@ import { useState as useState2, useCallback as useCallback2 } from "react";
|
|
|
2488
2511
|
import * as Toast2 from "@radix-ui/react-toast";
|
|
2489
2512
|
// src/components/toasts/ToastsProvider/CustomToast.tsx
|
|
2490
2513
|
import * as Toast from "@radix-ui/react-toast";
|
|
2491
|
-
import { Card, Text as Text6, Flex as
|
|
2514
|
+
import { Card, Text as Text6, Flex as Flex17 } from "@radix-ui/themes";
|
|
2492
2515
|
import { CheckCircledIcon as CheckCircledIcon2, CrossCircledIcon } from "@radix-ui/react-icons";
|
|
2493
|
-
import { jsx as
|
|
2516
|
+
import { jsx as jsx50, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2494
2517
|
var CustomToast = function(param) {
|
|
2495
2518
|
var toast = param.toast;
|
|
2496
|
-
return /* @__PURE__ */
|
|
2497
|
-
children: /* @__PURE__ */
|
|
2498
|
-
children: /* @__PURE__ */
|
|
2499
|
-
children: /* @__PURE__ */ jsxs14(
|
|
2519
|
+
return /* @__PURE__ */ jsx50(Toast.Root, {
|
|
2520
|
+
children: /* @__PURE__ */ jsx50(Card, {
|
|
2521
|
+
children: /* @__PURE__ */ jsx50(Toast.Title, {
|
|
2522
|
+
children: /* @__PURE__ */ jsxs14(Flex17, {
|
|
2500
2523
|
children: [
|
|
2501
|
-
/* @__PURE__ */
|
|
2524
|
+
/* @__PURE__ */ jsx50(Flex17, {
|
|
2502
2525
|
pr: "2",
|
|
2503
2526
|
height: "14px",
|
|
2504
2527
|
align: "center",
|
|
2505
|
-
children: toast.type === "success" ? /* @__PURE__ */
|
|
2528
|
+
children: toast.type === "success" ? /* @__PURE__ */ jsx50(CheckCircledIcon2, {
|
|
2506
2529
|
color: "var(--accent-9)"
|
|
2507
|
-
}) : /* @__PURE__ */
|
|
2530
|
+
}) : /* @__PURE__ */ jsx50(CrossCircledIcon, {
|
|
2508
2531
|
color: "var(--red-9)"
|
|
2509
2532
|
})
|
|
2510
2533
|
}),
|
|
2511
|
-
/* @__PURE__ */
|
|
2534
|
+
/* @__PURE__ */ jsx50(Text6, {
|
|
2512
2535
|
weight: "medium",
|
|
2513
2536
|
size: "1",
|
|
2514
2537
|
children: toast.message
|
|
@@ -2520,7 +2543,7 @@ var CustomToast = function(param) {
|
|
|
2520
2543
|
});
|
|
2521
2544
|
};
|
|
2522
2545
|
// src/components/toasts/ToastsProvider/index.tsx
|
|
2523
|
-
import { jsx as
|
|
2546
|
+
import { jsx as jsx51, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2524
2547
|
var ToastsProvider = function(param) {
|
|
2525
2548
|
var children = param.children;
|
|
2526
2549
|
var _useState2 = _sliced_to_array(useState2([]), 2), toasts = _useState2[0], setToasts = _useState2[1];
|
|
@@ -2531,7 +2554,7 @@ var ToastsProvider = function(param) {
|
|
|
2531
2554
|
]);
|
|
2532
2555
|
});
|
|
2533
2556
|
}, []);
|
|
2534
|
-
return /* @__PURE__ */
|
|
2557
|
+
return /* @__PURE__ */ jsx51(ToastsContext.Provider, {
|
|
2535
2558
|
value: {
|
|
2536
2559
|
toasts: toasts,
|
|
2537
2560
|
addToast: addToast
|
|
@@ -2540,11 +2563,11 @@ var ToastsProvider = function(param) {
|
|
|
2540
2563
|
children: [
|
|
2541
2564
|
children,
|
|
2542
2565
|
Array.from(toasts).map(function(toast, index) {
|
|
2543
|
-
return /* @__PURE__ */
|
|
2566
|
+
return /* @__PURE__ */ jsx51(CustomToast, {
|
|
2544
2567
|
toast: toast
|
|
2545
2568
|
}, index);
|
|
2546
2569
|
}),
|
|
2547
|
-
/* @__PURE__ */
|
|
2570
|
+
/* @__PURE__ */ jsx51(Toast2.Viewport, {
|
|
2548
2571
|
style: {
|
|
2549
2572
|
position: "absolute",
|
|
2550
2573
|
bottom: 0,
|
|
@@ -2566,22 +2589,22 @@ var ToastsProvider = function(param) {
|
|
|
2566
2589
|
});
|
|
2567
2590
|
};
|
|
2568
2591
|
// src/components/threads/ThreadDialog/Root/index.tsx
|
|
2569
|
-
import { jsx as
|
|
2592
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
2570
2593
|
var Root7 = function(param) {
|
|
2571
2594
|
var children = param.children;
|
|
2572
|
-
return /* @__PURE__ */
|
|
2573
|
-
children: /* @__PURE__ */
|
|
2595
|
+
return /* @__PURE__ */ jsx52(ToastsProvider, {
|
|
2596
|
+
children: /* @__PURE__ */ jsx52(Provider3, {
|
|
2574
2597
|
children: children
|
|
2575
2598
|
})
|
|
2576
2599
|
});
|
|
2577
2600
|
};
|
|
2578
2601
|
// src/components/threads/ThreadDialog/Trigger/index.tsx
|
|
2579
|
-
import { Flex as
|
|
2580
|
-
import { jsx as
|
|
2602
|
+
import { Flex as Flex18 } from "@radix-ui/themes";
|
|
2603
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2581
2604
|
var Trigger = function(param) {
|
|
2582
2605
|
var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
2583
2606
|
var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
|
|
2584
|
-
return /* @__PURE__ */
|
|
2607
|
+
return /* @__PURE__ */ jsx53(Flex18, {
|
|
2585
2608
|
display: {
|
|
2586
2609
|
initial: isOpen ? "none" : "flex",
|
|
2587
2610
|
sm: "flex"
|
|
@@ -2607,23 +2630,23 @@ var Trigger = function(param) {
|
|
|
2607
2630
|
// src/components/threads/ThreadDialog/Button/index.tsx
|
|
2608
2631
|
import { IconButton as IconButton2 } from "@radix-ui/themes";
|
|
2609
2632
|
import { ChatBubbleIcon } from "@radix-ui/react-icons";
|
|
2610
|
-
import { jsx as
|
|
2633
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
2611
2634
|
var Button2 = function() {
|
|
2612
|
-
return /* @__PURE__ */
|
|
2635
|
+
return /* @__PURE__ */ jsx54(IconButton2, {
|
|
2613
2636
|
size: "4",
|
|
2614
2637
|
radius: "full",
|
|
2615
|
-
children: /* @__PURE__ */
|
|
2638
|
+
children: /* @__PURE__ */ jsx54(ChatBubbleIcon, {})
|
|
2616
2639
|
});
|
|
2617
2640
|
};
|
|
2618
2641
|
// src/components/threads/ThreadDialog/Content/index.tsx
|
|
2619
|
-
import { Card as Card2, Inset, Flex as
|
|
2642
|
+
import { Card as Card2, Inset, Flex as Flex20 } from "@radix-ui/themes";
|
|
2620
2643
|
// src/components/threads/ThreadDialog/Close/index.tsx
|
|
2621
2644
|
import { Cross1Icon } from "@radix-ui/react-icons";
|
|
2622
|
-
import { IconButton as IconButton3, Flex as
|
|
2623
|
-
import { jsx as
|
|
2645
|
+
import { IconButton as IconButton3, Flex as Flex19 } from "@radix-ui/themes";
|
|
2646
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2624
2647
|
var Close = function() {
|
|
2625
2648
|
var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
|
|
2626
|
-
return /* @__PURE__ */
|
|
2649
|
+
return /* @__PURE__ */ jsx55(Flex19, {
|
|
2627
2650
|
display: {
|
|
2628
2651
|
initial: isOpen ? "flex" : "none",
|
|
2629
2652
|
sm: "none"
|
|
@@ -2643,20 +2666,20 @@ var Close = function() {
|
|
|
2643
2666
|
style: {
|
|
2644
2667
|
zIndex: 9999999999
|
|
2645
2668
|
},
|
|
2646
|
-
children: /* @__PURE__ */
|
|
2669
|
+
children: /* @__PURE__ */ jsx55(IconButton3, {
|
|
2647
2670
|
size: "2",
|
|
2648
2671
|
variant: "soft",
|
|
2649
|
-
children: /* @__PURE__ */
|
|
2672
|
+
children: /* @__PURE__ */ jsx55(Cross1Icon, {})
|
|
2650
2673
|
})
|
|
2651
2674
|
});
|
|
2652
2675
|
};
|
|
2653
2676
|
// src/components/threads/ThreadDialog/Content/index.tsx
|
|
2654
|
-
import { jsx as
|
|
2677
|
+
import { jsx as jsx56, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2655
2678
|
var Root8 = function(param) {
|
|
2656
2679
|
var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
2657
2680
|
var isOpen = useThreadDialogContext().isOpen;
|
|
2658
2681
|
if (!isOpen) return null;
|
|
2659
|
-
return /* @__PURE__ */
|
|
2682
|
+
return /* @__PURE__ */ jsx56(Flex20, {
|
|
2660
2683
|
direction: "column",
|
|
2661
2684
|
justify: "end",
|
|
2662
2685
|
position: "fixed",
|
|
@@ -2695,7 +2718,7 @@ var Root8 = function(param) {
|
|
|
2695
2718
|
flexGrow: 1
|
|
2696
2719
|
},
|
|
2697
2720
|
children: [
|
|
2698
|
-
/* @__PURE__ */
|
|
2721
|
+
/* @__PURE__ */ jsx56(Inset, {
|
|
2699
2722
|
clip: "padding-box",
|
|
2700
2723
|
side: "all",
|
|
2701
2724
|
pb: "current",
|
|
@@ -2705,31 +2728,31 @@ var Root8 = function(param) {
|
|
|
2705
2728
|
},
|
|
2706
2729
|
children: children
|
|
2707
2730
|
}),
|
|
2708
|
-
/* @__PURE__ */
|
|
2731
|
+
/* @__PURE__ */ jsx56(Close, {})
|
|
2709
2732
|
]
|
|
2710
2733
|
})
|
|
2711
2734
|
});
|
|
2712
2735
|
};
|
|
2713
2736
|
var Content4 = function(param) {
|
|
2714
2737
|
var _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
2715
|
-
return /* @__PURE__ */
|
|
2738
|
+
return /* @__PURE__ */ jsx56(Root8, {
|
|
2716
2739
|
style: style,
|
|
2717
2740
|
children: /* @__PURE__ */ jsxs16(Thread.Root, {
|
|
2718
2741
|
children: [
|
|
2719
|
-
/* @__PURE__ */
|
|
2742
|
+
/* @__PURE__ */ jsx56(Thread.Messages, {
|
|
2720
2743
|
style: {
|
|
2721
2744
|
paddingTop: "var(--space-5)",
|
|
2722
2745
|
paddingRight: "var(--space-5)",
|
|
2723
2746
|
paddingLeft: "var(--space-5)"
|
|
2724
2747
|
}
|
|
2725
2748
|
}),
|
|
2726
|
-
/* @__PURE__ */
|
|
2749
|
+
/* @__PURE__ */ jsx56(Flex20, {
|
|
2727
2750
|
direction: "column",
|
|
2728
2751
|
pl: "5",
|
|
2729
2752
|
pr: "5",
|
|
2730
2753
|
pb: "3",
|
|
2731
2754
|
flexShrink: "0",
|
|
2732
|
-
children: /* @__PURE__ */
|
|
2755
|
+
children: /* @__PURE__ */ jsx56(Thread.MessageForm, {})
|
|
2733
2756
|
})
|
|
2734
2757
|
]
|
|
2735
2758
|
})
|
|
@@ -2737,13 +2760,13 @@ var Content4 = function(param) {
|
|
|
2737
2760
|
};
|
|
2738
2761
|
Content4.Root = Root8;
|
|
2739
2762
|
// src/components/threads/ThreadDialog/index.tsx
|
|
2740
|
-
import { jsx as
|
|
2763
|
+
import { jsx as jsx57, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2741
2764
|
var ThreadDialog = function() {
|
|
2742
2765
|
return /* @__PURE__ */ jsxs17(Root7, {
|
|
2743
2766
|
children: [
|
|
2744
|
-
/* @__PURE__ */
|
|
2745
|
-
/* @__PURE__ */
|
|
2746
|
-
children: /* @__PURE__ */
|
|
2767
|
+
/* @__PURE__ */ jsx57(Content4, {}),
|
|
2768
|
+
/* @__PURE__ */ jsx57(Trigger, {
|
|
2769
|
+
children: /* @__PURE__ */ jsx57(Button2, {})
|
|
2747
2770
|
})
|
|
2748
2771
|
]
|
|
2749
2772
|
});
|
|
@@ -2754,10 +2777,10 @@ ThreadDialog.Button = Button2;
|
|
|
2754
2777
|
ThreadDialog.Content = Content4;
|
|
2755
2778
|
// src/components/threads/AudioThread/Root/index.tsx
|
|
2756
2779
|
import "regenerator-runtime/runtime";
|
|
2757
|
-
import { Flex as
|
|
2780
|
+
import { Flex as Flex21 } from "@radix-ui/themes";
|
|
2758
2781
|
// src/contexts/threads/AudioThreadContext/index.ts
|
|
2759
|
-
import { createContext as
|
|
2760
|
-
var AudioThreadContext =
|
|
2782
|
+
import { createContext as createContext12 } from "react";
|
|
2783
|
+
var AudioThreadContext = createContext12({
|
|
2761
2784
|
status: "idle",
|
|
2762
2785
|
recorderProps: {
|
|
2763
2786
|
status: "idle",
|
|
@@ -3191,7 +3214,7 @@ var useMessageAudio = function(param) {
|
|
|
3191
3214
|
});
|
|
3192
3215
|
};
|
|
3193
3216
|
// src/components/threads/AudioThread/Root/index.tsx
|
|
3194
|
-
import { jsx as
|
|
3217
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
3195
3218
|
var Root9 = function(param) {
|
|
3196
3219
|
var children = param.children;
|
|
3197
3220
|
var createMessageProps = useCreateMessage();
|
|
@@ -3249,13 +3272,13 @@ var Root9 = function(param) {
|
|
|
3249
3272
|
createMessageProps: createMessageProps,
|
|
3250
3273
|
messageAudioProps: messageAudioProps
|
|
3251
3274
|
}).status;
|
|
3252
|
-
return /* @__PURE__ */
|
|
3275
|
+
return /* @__PURE__ */ jsx58(AudioThreadContext.Provider, {
|
|
3253
3276
|
value: {
|
|
3254
3277
|
status: status,
|
|
3255
3278
|
recorderProps: recorderProps,
|
|
3256
3279
|
messageAudioProps: messageAudioProps
|
|
3257
3280
|
},
|
|
3258
|
-
children: /* @__PURE__ */
|
|
3281
|
+
children: /* @__PURE__ */ jsx58(Flex21, {
|
|
3259
3282
|
direction: "column",
|
|
3260
3283
|
flexGrow: "1",
|
|
3261
3284
|
p: "9",
|
|
@@ -3264,20 +3287,20 @@ var Root9 = function(param) {
|
|
|
3264
3287
|
});
|
|
3265
3288
|
};
|
|
3266
3289
|
// src/components/threads/AudioThread/Visualization/index.tsx
|
|
3267
|
-
import { useContext as
|
|
3290
|
+
import { useContext as useContext15, useState as useState6, useCallback as useCallback5, useEffect as useEffect7 } from "react";
|
|
3268
3291
|
import _9 from "lodash";
|
|
3269
|
-
import { Flex as
|
|
3292
|
+
import { Flex as Flex23 } from "@radix-ui/themes";
|
|
3270
3293
|
// src/hooks/threads/useAudioThreadContext/index.ts
|
|
3271
|
-
import { useContext as
|
|
3294
|
+
import { useContext as useContext14 } from "react";
|
|
3272
3295
|
var useAudioThreadContext = function() {
|
|
3273
|
-
return
|
|
3296
|
+
return useContext14(AudioThreadContext);
|
|
3274
3297
|
};
|
|
3275
3298
|
// src/components/threads/AudioThread/BarsVisualizer/index.tsx
|
|
3276
3299
|
import _8 from "lodash";
|
|
3277
|
-
import { Flex as
|
|
3300
|
+
import { Flex as Flex22, Grid } from "@radix-ui/themes";
|
|
3278
3301
|
import { useState as useState5, useEffect as useEffect6, useCallback as useCallback4 } from "react";
|
|
3279
3302
|
import { cluster } from "radash";
|
|
3280
|
-
import { jsx as
|
|
3303
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
3281
3304
|
var barCount = 4;
|
|
3282
3305
|
var BarsVisualizer = function(param) {
|
|
3283
3306
|
var visualizationAnalyser = param.visualizationAnalyser, backgroundColor = param.backgroundColor, height = param.height, barWidth = param.barWidth;
|
|
@@ -3308,7 +3331,7 @@ var BarsVisualizer = function(param) {
|
|
|
3308
3331
|
draw,
|
|
3309
3332
|
visualizationAnalyser
|
|
3310
3333
|
]);
|
|
3311
|
-
return /* @__PURE__ */
|
|
3334
|
+
return /* @__PURE__ */ jsx59(Grid, {
|
|
3312
3335
|
columns: "".concat(barCount),
|
|
3313
3336
|
gap: "1",
|
|
3314
3337
|
width: "auto",
|
|
@@ -3317,12 +3340,12 @@ var BarsVisualizer = function(param) {
|
|
|
3317
3340
|
gridTemplateColumns: "repeat(4, minmax(0, 1fr))"
|
|
3318
3341
|
},
|
|
3319
3342
|
children: barHeights.map(function(barHeight, index) {
|
|
3320
|
-
return /* @__PURE__ */
|
|
3343
|
+
return /* @__PURE__ */ jsx59(Flex22, {
|
|
3321
3344
|
direction: "column",
|
|
3322
3345
|
align: "center",
|
|
3323
3346
|
justify: "center",
|
|
3324
3347
|
height: height,
|
|
3325
|
-
children: /* @__PURE__ */
|
|
3348
|
+
children: /* @__PURE__ */ jsx59(Flex22, {
|
|
3326
3349
|
minHeight: "50%",
|
|
3327
3350
|
maxHeight: "100%",
|
|
3328
3351
|
height: "".concat(barHeight + 20, "%"),
|
|
@@ -3337,10 +3360,10 @@ var BarsVisualizer = function(param) {
|
|
|
3337
3360
|
});
|
|
3338
3361
|
};
|
|
3339
3362
|
// src/components/threads/AudioThread/Visualization/index.tsx
|
|
3340
|
-
import { jsx as
|
|
3363
|
+
import { jsx as jsx60, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3341
3364
|
var Visualization = function() {
|
|
3342
3365
|
var audioThreadContext = useAudioThreadContext();
|
|
3343
|
-
var assistantNameContext =
|
|
3366
|
+
var assistantNameContext = useContext15(AssistantNameContext);
|
|
3344
3367
|
var _useState6 = _sliced_to_array(useState6(0), 2), scale = _useState6[0], setScale = _useState6[1];
|
|
3345
3368
|
var draw = useCallback5(function(param) {
|
|
3346
3369
|
var visualizationAnalyser = param.visualizationAnalyser;
|
|
@@ -3365,14 +3388,14 @@ var Visualization = function() {
|
|
|
3365
3388
|
draw,
|
|
3366
3389
|
audioThreadContext
|
|
3367
3390
|
]);
|
|
3368
|
-
return /* @__PURE__ */ jsxs18(
|
|
3391
|
+
return /* @__PURE__ */ jsxs18(Flex23, {
|
|
3369
3392
|
direction: "column",
|
|
3370
3393
|
align: "center",
|
|
3371
3394
|
justify: "center",
|
|
3372
3395
|
mb: "3",
|
|
3373
3396
|
flexGrow: "1",
|
|
3374
3397
|
children: [
|
|
3375
|
-
/* @__PURE__ */
|
|
3398
|
+
/* @__PURE__ */ jsx60(Flex23, {
|
|
3376
3399
|
align: "center",
|
|
3377
3400
|
justify: "center",
|
|
3378
3401
|
height: "200px",
|
|
@@ -3382,20 +3405,20 @@ var Visualization = function() {
|
|
|
3382
3405
|
borderRadius: "9999px",
|
|
3383
3406
|
scale: scale
|
|
3384
3407
|
},
|
|
3385
|
-
children: /* @__PURE__ */
|
|
3408
|
+
children: /* @__PURE__ */ jsx60(BarsVisualizer, {
|
|
3386
3409
|
visualizationAnalyser: audioThreadContext.messageAudioProps.visualizationAnalyser,
|
|
3387
3410
|
backgroundColor: audioThreadContext.status === "playing" ? "var(--accent-11)" : "var(--gray-11)",
|
|
3388
3411
|
height: "40px",
|
|
3389
3412
|
barWidth: "24px"
|
|
3390
3413
|
})
|
|
3391
3414
|
}),
|
|
3392
|
-
/* @__PURE__ */ jsxs18(
|
|
3415
|
+
/* @__PURE__ */ jsxs18(Flex23, {
|
|
3393
3416
|
ml: "-22.5px",
|
|
3394
3417
|
gap: "3",
|
|
3395
3418
|
pt: "5",
|
|
3396
3419
|
children: [
|
|
3397
|
-
/* @__PURE__ */
|
|
3398
|
-
/* @__PURE__ */
|
|
3420
|
+
/* @__PURE__ */ jsx60(AssistantAvatar, {}),
|
|
3421
|
+
/* @__PURE__ */ jsx60(Name, {
|
|
3399
3422
|
children: assistantNameContext
|
|
3400
3423
|
})
|
|
3401
3424
|
]
|
|
@@ -3404,8 +3427,8 @@ var Visualization = function() {
|
|
|
3404
3427
|
});
|
|
3405
3428
|
};
|
|
3406
3429
|
// src/components/threads/AudioThread/Status/StatusMessages.tsx
|
|
3407
|
-
import { Flex as
|
|
3408
|
-
import { jsx as
|
|
3430
|
+
import { Flex as Flex24, Text as Text7 } from "@radix-ui/themes";
|
|
3431
|
+
import { jsx as jsx61, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3409
3432
|
var html = function(param) {
|
|
3410
3433
|
var texts = param.texts;
|
|
3411
3434
|
return "\n .status-messages-texts:after {\n content: '".concat(texts[0], "';\n animation: texts ").concat(texts.length * 5, "s linear infinite;\n }\n\n @keyframes texts {\n ").concat(texts.map(function(_10, i) {
|
|
@@ -3414,17 +3437,17 @@ var html = function(param) {
|
|
|
3414
3437
|
};
|
|
3415
3438
|
var StatusMessages = function(param) {
|
|
3416
3439
|
var texts = param.texts;
|
|
3417
|
-
return /* @__PURE__ */ jsxs19(
|
|
3440
|
+
return /* @__PURE__ */ jsxs19(Flex24, {
|
|
3418
3441
|
justify: "center",
|
|
3419
3442
|
pb: "5",
|
|
3420
3443
|
children: [
|
|
3421
|
-
/* @__PURE__ */
|
|
3444
|
+
/* @__PURE__ */ jsx61(Text7, {
|
|
3422
3445
|
size: "2",
|
|
3423
3446
|
weight: "regular",
|
|
3424
3447
|
color: "gray",
|
|
3425
3448
|
className: "status-messages-texts"
|
|
3426
3449
|
}),
|
|
3427
|
-
/* @__PURE__ */
|
|
3450
|
+
/* @__PURE__ */ jsx61("style", {
|
|
3428
3451
|
dangerouslySetInnerHTML: {
|
|
3429
3452
|
__html: html({
|
|
3430
3453
|
texts: texts
|
|
@@ -3435,11 +3458,11 @@ var StatusMessages = function(param) {
|
|
|
3435
3458
|
});
|
|
3436
3459
|
};
|
|
3437
3460
|
// src/components/threads/AudioThread/Status/index.tsx
|
|
3438
|
-
import { jsx as
|
|
3461
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
3439
3462
|
var Status = function() {
|
|
3440
3463
|
var audioThreadContext = useAudioThreadContext();
|
|
3441
3464
|
if (audioThreadContext.status === "recording") {
|
|
3442
|
-
return /* @__PURE__ */
|
|
3465
|
+
return /* @__PURE__ */ jsx62(StatusMessages, {
|
|
3443
3466
|
texts: [
|
|
3444
3467
|
"Start speaking",
|
|
3445
3468
|
"Listening",
|
|
@@ -3453,31 +3476,31 @@ var Status = function() {
|
|
|
3453
3476
|
"idle",
|
|
3454
3477
|
"playerPaused"
|
|
3455
3478
|
].includes(audioThreadContext.status)) {
|
|
3456
|
-
return /* @__PURE__ */
|
|
3479
|
+
return /* @__PURE__ */ jsx62(StatusMessages, {
|
|
3457
3480
|
texts: [
|
|
3458
3481
|
"Click the button below to activate"
|
|
3459
3482
|
]
|
|
3460
3483
|
});
|
|
3461
3484
|
}
|
|
3462
3485
|
if (audioThreadContext.status === "playing") {
|
|
3463
|
-
return /* @__PURE__ */
|
|
3486
|
+
return /* @__PURE__ */ jsx62(StatusMessages, {
|
|
3464
3487
|
texts: [
|
|
3465
3488
|
"Click the button below to interrupt"
|
|
3466
3489
|
]
|
|
3467
3490
|
});
|
|
3468
3491
|
}
|
|
3469
|
-
return /* @__PURE__ */
|
|
3492
|
+
return /* @__PURE__ */ jsx62(StatusMessages, {
|
|
3470
3493
|
texts: [
|
|
3471
3494
|
"Thinking"
|
|
3472
3495
|
]
|
|
3473
3496
|
});
|
|
3474
3497
|
};
|
|
3475
3498
|
// src/components/threads/AudioThread/Form/index.tsx
|
|
3476
|
-
import { Flex as
|
|
3499
|
+
import { Flex as Flex26 } from "@radix-ui/themes";
|
|
3477
3500
|
// src/components/threads/AudioThread/Form/MicIcon.tsx
|
|
3478
|
-
import { jsx as
|
|
3501
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
3479
3502
|
var MicIcon = function(props) {
|
|
3480
|
-
return /* @__PURE__ */
|
|
3503
|
+
return /* @__PURE__ */ jsx63("svg", _object_spread_props(_object_spread({
|
|
3481
3504
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3482
3505
|
fill: "currentColor",
|
|
3483
3506
|
stroke: "currentColor",
|
|
@@ -3486,54 +3509,54 @@ var MicIcon = function(props) {
|
|
|
3486
3509
|
height: "15",
|
|
3487
3510
|
width: "15"
|
|
3488
3511
|
}, props), {
|
|
3489
|
-
children: /* @__PURE__ */
|
|
3512
|
+
children: /* @__PURE__ */ jsx63("path", {
|
|
3490
3513
|
stroke: "none",
|
|
3491
3514
|
d: "M192 0c-53 0-96 43-96 96v160c0 53 43 96 96 96s96-43 96-96V96c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 89.1 66.2 162.7 152 174.4V464h-48c-13.3 0-24 10.7-24 24s10.7 24 24 24h144c13.3 0 24-10.7 24-24s-10.7-24-24-24h-48v-33.6c85.8-11.7 152-85.3 152-174.4v-40c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 70.7-57.3 128-128 128S64 326.7 64 256v-40z"
|
|
3492
3515
|
})
|
|
3493
3516
|
}));
|
|
3494
3517
|
};
|
|
3495
3518
|
// src/components/threads/AudioThread/Form/ActionButton/index.tsx
|
|
3496
|
-
import { Flex as
|
|
3519
|
+
import { Flex as Flex25, IconButton as IconButton4 } from "@radix-ui/themes";
|
|
3497
3520
|
import { StopIcon as StopIcon2, PauseIcon, ArrowUpIcon as ArrowUpIcon2, ResumeIcon } from "@radix-ui/react-icons";
|
|
3498
|
-
import { jsx as
|
|
3521
|
+
import { jsx as jsx64, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3499
3522
|
var ActionButton = function() {
|
|
3500
3523
|
var audioThreadContext = useAudioThreadContext();
|
|
3501
3524
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
3502
3525
|
if (audioThreadContext.status === "recording") {
|
|
3503
|
-
return /* @__PURE__ */ jsxs20(
|
|
3526
|
+
return /* @__PURE__ */ jsxs20(Flex25, {
|
|
3504
3527
|
align: "center",
|
|
3505
3528
|
children: [
|
|
3506
|
-
/* @__PURE__ */
|
|
3529
|
+
/* @__PURE__ */ jsx64(Flex25, {
|
|
3507
3530
|
mr: "3",
|
|
3508
3531
|
ml: "-7",
|
|
3509
|
-
children: /* @__PURE__ */
|
|
3532
|
+
children: /* @__PURE__ */ jsx64(IconButton4, {
|
|
3510
3533
|
onClick: audioThreadContext.recorderProps.pause,
|
|
3511
3534
|
color: "gray",
|
|
3512
3535
|
variant: "soft",
|
|
3513
3536
|
size: "1",
|
|
3514
|
-
children: /* @__PURE__ */
|
|
3537
|
+
children: /* @__PURE__ */ jsx64(PauseIcon, {})
|
|
3515
3538
|
})
|
|
3516
3539
|
}),
|
|
3517
|
-
/* @__PURE__ */
|
|
3540
|
+
/* @__PURE__ */ jsx64(IconButton4, {
|
|
3518
3541
|
onClick: audioThreadContext.recorderProps.stop,
|
|
3519
3542
|
highContrast: true,
|
|
3520
3543
|
variant: "soft",
|
|
3521
3544
|
size: "4",
|
|
3522
|
-
children: /* @__PURE__ */
|
|
3545
|
+
children: /* @__PURE__ */ jsx64(ArrowUpIcon2, {})
|
|
3523
3546
|
})
|
|
3524
3547
|
]
|
|
3525
3548
|
});
|
|
3526
3549
|
}
|
|
3527
3550
|
if (audioThreadContext.status === "recorderPaused") {
|
|
3528
|
-
return /* @__PURE__ */
|
|
3551
|
+
return /* @__PURE__ */ jsx64(IconButton4, {
|
|
3529
3552
|
onClick: audioThreadContext.recorderProps.resume,
|
|
3530
3553
|
color: "red",
|
|
3531
3554
|
size: "4",
|
|
3532
|
-
children: /* @__PURE__ */
|
|
3555
|
+
children: /* @__PURE__ */ jsx64(ResumeIcon, {})
|
|
3533
3556
|
});
|
|
3534
3557
|
}
|
|
3535
3558
|
if (audioThreadContext.status === "idle") {
|
|
3536
|
-
return /* @__PURE__ */
|
|
3559
|
+
return /* @__PURE__ */ jsx64(IconButton4, {
|
|
3537
3560
|
onClick: function() {
|
|
3538
3561
|
return audioThreadContext.recorderProps.start();
|
|
3539
3562
|
},
|
|
@@ -3542,7 +3565,7 @@ var ActionButton = function() {
|
|
|
3542
3565
|
});
|
|
3543
3566
|
}
|
|
3544
3567
|
if (audioThreadContext.status === "playing") {
|
|
3545
|
-
return /* @__PURE__ */
|
|
3568
|
+
return /* @__PURE__ */ jsx64(IconButton4, {
|
|
3546
3569
|
onClick: function() {
|
|
3547
3570
|
var _superinterfaceContext_createMessageAbortControllerRef_current;
|
|
3548
3571
|
audioThreadContext.messageAudioProps.stop();
|
|
@@ -3552,54 +3575,54 @@ var ActionButton = function() {
|
|
|
3552
3575
|
size: "4",
|
|
3553
3576
|
color: "gray",
|
|
3554
3577
|
variant: "soft",
|
|
3555
|
-
children: /* @__PURE__ */
|
|
3578
|
+
children: /* @__PURE__ */ jsx64(StopIcon2, {})
|
|
3556
3579
|
});
|
|
3557
3580
|
}
|
|
3558
3581
|
if (audioThreadContext.status === "playerPaused") {
|
|
3559
|
-
return /* @__PURE__ */
|
|
3582
|
+
return /* @__PURE__ */ jsx64(IconButton4, {
|
|
3560
3583
|
onClick: function() {
|
|
3561
3584
|
return audioThreadContext.messageAudioProps.play();
|
|
3562
3585
|
},
|
|
3563
3586
|
size: "4",
|
|
3564
|
-
children: /* @__PURE__ */
|
|
3587
|
+
children: /* @__PURE__ */ jsx64(ResumeIcon, {})
|
|
3565
3588
|
});
|
|
3566
3589
|
}
|
|
3567
|
-
return /* @__PURE__ */
|
|
3590
|
+
return /* @__PURE__ */ jsx64(IconButton4, {
|
|
3568
3591
|
size: "4",
|
|
3569
3592
|
variant: "soft",
|
|
3570
3593
|
disabled: true
|
|
3571
3594
|
});
|
|
3572
3595
|
};
|
|
3573
3596
|
// src/components/threads/AudioThread/Form/index.tsx
|
|
3574
|
-
import { jsx as
|
|
3597
|
+
import { jsx as jsx65, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3575
3598
|
var Form = function() {
|
|
3576
3599
|
var audioThreadContext = useAudioThreadContext();
|
|
3577
|
-
return /* @__PURE__ */ jsxs21(
|
|
3600
|
+
return /* @__PURE__ */ jsxs21(Flex26, {
|
|
3578
3601
|
direction: "column",
|
|
3579
3602
|
align: "center",
|
|
3580
3603
|
children: [
|
|
3581
|
-
/* @__PURE__ */ jsxs21(
|
|
3604
|
+
/* @__PURE__ */ jsxs21(Flex26, {
|
|
3582
3605
|
pb: "3",
|
|
3583
3606
|
align: "center",
|
|
3584
3607
|
children: [
|
|
3585
|
-
/* @__PURE__ */
|
|
3608
|
+
/* @__PURE__ */ jsx65(Flex26, {
|
|
3586
3609
|
ml: "-22.5px",
|
|
3587
3610
|
mr: "2",
|
|
3588
3611
|
align: "center",
|
|
3589
|
-
children: /* @__PURE__ */
|
|
3612
|
+
children: /* @__PURE__ */ jsx65(MicIcon, {
|
|
3590
3613
|
style: {
|
|
3591
3614
|
color: audioThreadContext.status === "recording" ? "var(--accent-11)" : "var(--gray-11)"
|
|
3592
3615
|
}
|
|
3593
3616
|
})
|
|
3594
3617
|
}),
|
|
3595
|
-
/* @__PURE__ */
|
|
3618
|
+
/* @__PURE__ */ jsx65(Flex26, {
|
|
3596
3619
|
px: "2",
|
|
3597
3620
|
py: "1",
|
|
3598
3621
|
style: {
|
|
3599
3622
|
backgroundColor: audioThreadContext.status === "recording" ? "var(--accent-4)" : "var(--gray-4)",
|
|
3600
3623
|
borderRadius: "var(--radius-6)"
|
|
3601
3624
|
},
|
|
3602
|
-
children: /* @__PURE__ */
|
|
3625
|
+
children: /* @__PURE__ */ jsx65(BarsVisualizer, {
|
|
3603
3626
|
visualizationAnalyser: audioThreadContext.recorderProps.visualizationAnalyser,
|
|
3604
3627
|
backgroundColor: audioThreadContext.status === "recording" ? "var(--accent-11)" : "var(--gray-11)",
|
|
3605
3628
|
height: "20px",
|
|
@@ -3608,18 +3631,18 @@ var Form = function() {
|
|
|
3608
3631
|
})
|
|
3609
3632
|
]
|
|
3610
3633
|
}),
|
|
3611
|
-
/* @__PURE__ */
|
|
3634
|
+
/* @__PURE__ */ jsx65(ActionButton, {})
|
|
3612
3635
|
]
|
|
3613
3636
|
});
|
|
3614
3637
|
};
|
|
3615
3638
|
// src/components/threads/AudioThread/index.tsx
|
|
3616
|
-
import { jsx as
|
|
3639
|
+
import { jsx as jsx66, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3617
3640
|
var AudioThread = function(props) {
|
|
3618
3641
|
return /* @__PURE__ */ jsxs22(Root9, _object_spread_props(_object_spread({}, props), {
|
|
3619
3642
|
children: [
|
|
3620
|
-
/* @__PURE__ */
|
|
3621
|
-
/* @__PURE__ */
|
|
3622
|
-
/* @__PURE__ */
|
|
3643
|
+
/* @__PURE__ */ jsx66(Visualization, {}),
|
|
3644
|
+
/* @__PURE__ */ jsx66(Status, {}),
|
|
3645
|
+
/* @__PURE__ */ jsx66(Form, {})
|
|
3623
3646
|
]
|
|
3624
3647
|
}));
|
|
3625
3648
|
};
|
|
@@ -3627,15 +3650,15 @@ AudioThread.Root = Root9;
|
|
|
3627
3650
|
AudioThread.Visualization = Visualization;
|
|
3628
3651
|
AudioThread.Form = Form;
|
|
3629
3652
|
// src/components/threads/AudioThreadDialog/index.tsx
|
|
3630
|
-
import { jsx as
|
|
3653
|
+
import { jsx as jsx67, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3631
3654
|
var AudioThreadDialog = function() {
|
|
3632
3655
|
return /* @__PURE__ */ jsxs23(Root7, {
|
|
3633
3656
|
children: [
|
|
3634
|
-
/* @__PURE__ */
|
|
3635
|
-
children: /* @__PURE__ */
|
|
3657
|
+
/* @__PURE__ */ jsx67(Content4.Root, {
|
|
3658
|
+
children: /* @__PURE__ */ jsx67(AudioThread, {})
|
|
3636
3659
|
}),
|
|
3637
|
-
/* @__PURE__ */
|
|
3638
|
-
children: /* @__PURE__ */
|
|
3660
|
+
/* @__PURE__ */ jsx67(Trigger, {
|
|
3661
|
+
children: /* @__PURE__ */ jsx67(Button2, {})
|
|
3639
3662
|
})
|
|
3640
3663
|
]
|
|
3641
3664
|
});
|
|
@@ -3650,15 +3673,15 @@ import { useMemo as useMemo14 } from "react";
|
|
|
3650
3673
|
import { useMemo as useMemo13 } from "react";
|
|
3651
3674
|
import { isEmpty as isEmpty3 } from "radash";
|
|
3652
3675
|
import { onlyText } from "react-children-utilities";
|
|
3653
|
-
import { Flex as
|
|
3676
|
+
import { Flex as Flex27 } from "@radix-ui/themes";
|
|
3654
3677
|
// src/components/suggestions/Suggestions/Item.tsx
|
|
3655
3678
|
import { ArrowUpIcon as ArrowUpIcon3 } from "@radix-ui/react-icons";
|
|
3656
3679
|
import { Text as Text8, Button as Button3, Spinner } from "@radix-ui/themes";
|
|
3657
|
-
import { jsx as
|
|
3680
|
+
import { jsx as jsx68, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3658
3681
|
var Item = function(param) {
|
|
3659
3682
|
var suggestion = param.suggestion, isDisabled = param.isDisabled;
|
|
3660
3683
|
var _useCreateMessage = useCreateMessage(), createMessage = _useCreateMessage.createMessage, isPending = _useCreateMessage.isPending;
|
|
3661
|
-
return /* @__PURE__ */
|
|
3684
|
+
return /* @__PURE__ */ jsx68(Content5, {
|
|
3662
3685
|
onClick: function() {
|
|
3663
3686
|
createMessage({
|
|
3664
3687
|
// @ts-ignore-next-line
|
|
@@ -3682,14 +3705,14 @@ var Content5 = function(param) {
|
|
|
3682
3705
|
flexShrink: 1
|
|
3683
3706
|
},
|
|
3684
3707
|
children: [
|
|
3685
|
-
/* @__PURE__ */
|
|
3708
|
+
/* @__PURE__ */ jsx68(Text8, {
|
|
3686
3709
|
size: "1",
|
|
3687
3710
|
weight: "regular",
|
|
3688
3711
|
children: children
|
|
3689
3712
|
}),
|
|
3690
|
-
/* @__PURE__ */
|
|
3713
|
+
/* @__PURE__ */ jsx68(Spinner, {
|
|
3691
3714
|
loading: isPending,
|
|
3692
|
-
children: /* @__PURE__ */
|
|
3715
|
+
children: /* @__PURE__ */ jsx68(ArrowUpIcon3, {
|
|
3693
3716
|
style: {
|
|
3694
3717
|
flexShrink: 0
|
|
3695
3718
|
}
|
|
@@ -3700,7 +3723,7 @@ var Content5 = function(param) {
|
|
|
3700
3723
|
};
|
|
3701
3724
|
Item.Content = Content5;
|
|
3702
3725
|
// src/components/suggestions/Suggestions/Content.tsx
|
|
3703
|
-
import { jsx as
|
|
3726
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
3704
3727
|
var Content6 = function(param) {
|
|
3705
3728
|
var children = param.children;
|
|
3706
3729
|
var isMutatingMessage = useIsMutatingMessage();
|
|
@@ -3714,12 +3737,12 @@ var Content6 = function(param) {
|
|
|
3714
3737
|
children
|
|
3715
3738
|
]);
|
|
3716
3739
|
if (isEmpty3(suggestions)) return null;
|
|
3717
|
-
return /* @__PURE__ */
|
|
3740
|
+
return /* @__PURE__ */ jsx69(Flex27, {
|
|
3718
3741
|
gap: "2",
|
|
3719
3742
|
py: "2",
|
|
3720
3743
|
wrap: "wrap",
|
|
3721
3744
|
children: suggestions.map(function(suggestion) {
|
|
3722
|
-
return /* @__PURE__ */
|
|
3745
|
+
return /* @__PURE__ */ jsx69(Item, {
|
|
3723
3746
|
suggestion: suggestion,
|
|
3724
3747
|
isDisabled: isMutatingMessage
|
|
3725
3748
|
}, suggestion);
|
|
@@ -3727,7 +3750,7 @@ var Content6 = function(param) {
|
|
|
3727
3750
|
});
|
|
3728
3751
|
};
|
|
3729
3752
|
// src/components/suggestions/Suggestions/index.tsx
|
|
3730
|
-
import { jsx as
|
|
3753
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
3731
3754
|
var Suggestions = function(param) {
|
|
3732
3755
|
var children = param.children;
|
|
3733
3756
|
var latestMessageProps = useLatestMessage();
|
|
@@ -3740,14 +3763,14 @@ var Suggestions = function(param) {
|
|
|
3740
3763
|
]);
|
|
3741
3764
|
if (latestMessageProps.isLoading) return null;
|
|
3742
3765
|
if (isDisabled) return null;
|
|
3743
|
-
return /* @__PURE__ */
|
|
3766
|
+
return /* @__PURE__ */ jsx70(Content6, {
|
|
3744
3767
|
children: children
|
|
3745
3768
|
});
|
|
3746
3769
|
};
|
|
3747
3770
|
Suggestions.Item = Item;
|
|
3748
3771
|
// src/components/markdown/MarkdownProvider/index.tsx
|
|
3749
3772
|
import { useMemo as useMemo15 } from "react";
|
|
3750
|
-
import { jsx as
|
|
3773
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
3751
3774
|
var MarkdownProvider = function(_param) {
|
|
3752
3775
|
var children = _param.children, rest = _object_without_properties(_param, [
|
|
3753
3776
|
"children"
|
|
@@ -3759,7 +3782,7 @@ var MarkdownProvider = function(_param) {
|
|
|
3759
3782
|
rest,
|
|
3760
3783
|
prevMarkdownContext
|
|
3761
3784
|
]);
|
|
3762
|
-
return /* @__PURE__ */
|
|
3785
|
+
return /* @__PURE__ */ jsx71(MarkdownContext.Provider, {
|
|
3763
3786
|
value: value,
|
|
3764
3787
|
children: children
|
|
3765
3788
|
});
|
|
@@ -3767,12 +3790,12 @@ var MarkdownProvider = function(_param) {
|
|
|
3767
3790
|
// src/components/components/ComponentsProvider.tsx
|
|
3768
3791
|
import { useMemo as useMemo16 } from "react";
|
|
3769
3792
|
// src/hooks/components/useComponents.ts
|
|
3770
|
-
import { useContext as
|
|
3793
|
+
import { useContext as useContext16 } from "react";
|
|
3771
3794
|
var useComponents = function() {
|
|
3772
|
-
return
|
|
3795
|
+
return useContext16(ComponentsContext);
|
|
3773
3796
|
};
|
|
3774
3797
|
// src/components/components/ComponentsProvider.tsx
|
|
3775
|
-
import { jsx as
|
|
3798
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
3776
3799
|
var ComponentsProvider = function(_param) {
|
|
3777
3800
|
var children = _param.children, rest = _object_without_properties(_param, [
|
|
3778
3801
|
"children"
|
|
@@ -3784,10 +3807,10 @@ var ComponentsProvider = function(_param) {
|
|
|
3784
3807
|
rest,
|
|
3785
3808
|
prevComponents
|
|
3786
3809
|
]);
|
|
3787
|
-
return /* @__PURE__ */
|
|
3810
|
+
return /* @__PURE__ */ jsx72(ComponentsContext.Provider, {
|
|
3788
3811
|
value: value,
|
|
3789
3812
|
children: children
|
|
3790
3813
|
});
|
|
3791
3814
|
};
|
|
3792
|
-
export { AssistantAvatarContext, AssistantNameContext, AudioThread, AudioThreadDialog, ComponentsProvider, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, RunStep, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, useComponents, useCreateMessage, useLatestMessage, useMarkdownContext, useMessageContext, useMessageFormContext, useMessages, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext, useThreadDialogContext };
|
|
3815
|
+
export { AssistantAvatarContext, AssistantNameContext, AudioThread, AudioThreadDialog, ComponentsProvider, FunctionBase, FunctionComponentsContext, MarkdownContext, MarkdownProvider, RunStep, Suggestions, SuperinterfaceProvider, Thread, ThreadDialog, ThreadDialogContext, UserAvatarContext, useComponents, useCreateMessage, useLatestMessage, useMarkdownContext, useMessageContext, useMessageFormContext, useMessages, useSuperinterfaceContext, useSuperinterfaceContext as useThreadContext, useThreadDialogContext };
|
|
3793
3816
|
//# sourceMappingURL=index.js.map
|