@superinterface/react 2.15.8 → 2.16.0
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 +910 -496
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -75
- package/dist/index.d.ts +117 -75
- package/dist/index.js +843 -433
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +5 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js.map +1 -1
- package/dist/types/index.cjs +5 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/utils.cjs +5 -1
- package/package.json +14 -14
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 Flex12 } 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
|
|
@@ -732,7 +732,7 @@ var UserAvatar = function() {
|
|
|
732
732
|
});
|
|
733
733
|
};
|
|
734
734
|
// src/components/threads/Thread/Messages/Content/MessageGroup/Content/index.tsx
|
|
735
|
-
import { Flex as
|
|
735
|
+
import { Flex as Flex10 } from "@radix-ui/themes";
|
|
736
736
|
// src/components/threads/Thread/Message/index.tsx
|
|
737
737
|
import { useMemo as useMemo5, Fragment } from "react";
|
|
738
738
|
import { isEmpty } from "radash";
|
|
@@ -753,39 +753,35 @@ var StartingContentSkeleton = function() {
|
|
|
753
753
|
});
|
|
754
754
|
};
|
|
755
755
|
// src/components/runSteps/RunSteps/index.tsx
|
|
756
|
-
import { Flex as
|
|
756
|
+
import { Flex as Flex8 } from "@radix-ui/themes";
|
|
757
757
|
import { useContext as useContext6 } from "react";
|
|
758
758
|
// src/contexts/components/ComponentsContext/index.tsx
|
|
759
759
|
import { createContext as createContext7 } from "react";
|
|
760
760
|
// src/components/runSteps/RunStep/ToolCalls/index.tsx
|
|
761
|
-
import { Flex as
|
|
762
|
-
// src/components/runSteps/RunStep/ToolCalls/ToolCall/index.tsx
|
|
763
|
-
import { Flex as Flex8 } from "@radix-ui/themes";
|
|
761
|
+
import { Flex as Flex7 } from "@radix-ui/themes";
|
|
764
762
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/Fn/index.tsx
|
|
765
763
|
import { useContext as useContext5 } from "react";
|
|
766
764
|
// src/contexts/functions/FunctionComponentsContext/index.tsx
|
|
767
765
|
import { createContext as createContext6 } from "react";
|
|
768
766
|
var FunctionComponentsContext = createContext6({});
|
|
769
767
|
// src/components/functions/FunctionBase/index.tsx
|
|
770
|
-
import { Popover
|
|
768
|
+
import { Popover } from "@radix-ui/themes";
|
|
771
769
|
// src/components/toolCalls/ToolCallBase/index.tsx
|
|
772
|
-
import { Flex as Flex6, Button
|
|
770
|
+
import { Flex as Flex6, Button } from "@radix-ui/themes";
|
|
773
771
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
774
772
|
var ToolCallBase = function(param) {
|
|
775
773
|
var children = param.children;
|
|
776
774
|
return /* @__PURE__ */ jsx10(Flex6, {
|
|
777
775
|
py: "1",
|
|
778
776
|
ml: "-2",
|
|
779
|
-
children: /* @__PURE__ */ jsx10(
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
children: children
|
|
788
|
-
})
|
|
777
|
+
children: /* @__PURE__ */ jsx10(Button, {
|
|
778
|
+
size: "1",
|
|
779
|
+
color: "gold",
|
|
780
|
+
variant: "outline",
|
|
781
|
+
style: {
|
|
782
|
+
boxShadow: "none"
|
|
783
|
+
},
|
|
784
|
+
children: children
|
|
789
785
|
})
|
|
790
786
|
});
|
|
791
787
|
};
|
|
@@ -799,10 +795,10 @@ var ToolCallTitle = function(param) {
|
|
|
799
795
|
children: children
|
|
800
796
|
});
|
|
801
797
|
};
|
|
802
|
-
// src/components/
|
|
798
|
+
// src/components/toolCalls/ToolCallBase/ToolCallIcon.tsx
|
|
803
799
|
import { CircleIcon, CircleBackslashIcon, CheckCircledIcon } from "@radix-ui/react-icons";
|
|
804
800
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
805
|
-
var
|
|
801
|
+
var ToolCallIcon = function(param) {
|
|
806
802
|
var runStep = param.runStep;
|
|
807
803
|
if (runStep.completed_at) {
|
|
808
804
|
return /* @__PURE__ */ jsx12(CheckCircledIcon, {});
|
|
@@ -867,19 +863,21 @@ var Content = function(param) {
|
|
|
867
863
|
import { jsx as jsx14, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
868
864
|
var FunctionBase = function(param) {
|
|
869
865
|
var fn = param.fn, runStep = param.runStep, title2 = param.title;
|
|
870
|
-
return /* @__PURE__ */ jsxs3(
|
|
866
|
+
return /* @__PURE__ */ jsxs3(Popover.Root, {
|
|
871
867
|
children: [
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
children:
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
868
|
+
/* @__PURE__ */ jsx14(Popover.Trigger, {
|
|
869
|
+
children: /* @__PURE__ */ jsxs3(ToolCallBase, {
|
|
870
|
+
children: [
|
|
871
|
+
/* @__PURE__ */ jsx14(ToolCallIcon, {
|
|
872
|
+
runStep: runStep
|
|
873
|
+
}),
|
|
874
|
+
/* @__PURE__ */ jsx14(ToolCallTitle, {
|
|
875
|
+
children: title2
|
|
876
|
+
})
|
|
877
|
+
]
|
|
878
|
+
})
|
|
881
879
|
}),
|
|
882
|
-
/* @__PURE__ */ jsx14(
|
|
880
|
+
/* @__PURE__ */ jsx14(Popover.Content, {
|
|
883
881
|
style: {
|
|
884
882
|
maxHeight: "200px"
|
|
885
883
|
},
|
|
@@ -926,55 +924,101 @@ var Fn = function(param) {
|
|
|
926
924
|
runStep: runStep
|
|
927
925
|
}));
|
|
928
926
|
};
|
|
929
|
-
// src/components/runSteps/RunStep/ToolCalls/ToolCall/CodeInterpreter
|
|
930
|
-
import {
|
|
931
|
-
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
927
|
+
// src/components/runSteps/RunStep/ToolCalls/ToolCall/CodeInterpreter.tsx
|
|
928
|
+
import { jsx as jsx17, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
932
929
|
var CodeInterpreter = function(param) {
|
|
933
|
-
var
|
|
934
|
-
return /* @__PURE__ */
|
|
935
|
-
children:
|
|
930
|
+
var runStep = param.runStep, toolCall = param.toolCall;
|
|
931
|
+
return /* @__PURE__ */ jsxs4(ToolCallBase, {
|
|
932
|
+
children: [
|
|
933
|
+
/* @__PURE__ */ jsx17(ToolCallIcon, {
|
|
934
|
+
runStep: runStep
|
|
935
|
+
}),
|
|
936
|
+
/* @__PURE__ */ jsx17(ToolCallTitle, {
|
|
937
|
+
children: "Using code interpreter"
|
|
938
|
+
})
|
|
939
|
+
]
|
|
940
|
+
});
|
|
941
|
+
};
|
|
942
|
+
// src/components/runSteps/RunStep/ToolCalls/ToolCall/FileSearch.tsx
|
|
943
|
+
import { jsx as jsx18, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
944
|
+
var FileSearch = function(param) {
|
|
945
|
+
var runStep = param.runStep, toolCall = param.toolCall;
|
|
946
|
+
return /* @__PURE__ */ jsxs5(ToolCallBase, {
|
|
947
|
+
children: [
|
|
948
|
+
/* @__PURE__ */ jsx18(ToolCallIcon, {
|
|
949
|
+
runStep: runStep
|
|
950
|
+
}),
|
|
951
|
+
/* @__PURE__ */ jsx18(ToolCallTitle, {
|
|
952
|
+
children: "Searching files"
|
|
953
|
+
})
|
|
954
|
+
]
|
|
955
|
+
});
|
|
956
|
+
};
|
|
957
|
+
// src/components/runSteps/RunStep/ToolCalls/ToolCall/Fallback.tsx
|
|
958
|
+
import { jsx as jsx19, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
959
|
+
var Fallback = function(param) {
|
|
960
|
+
var runStep = param.runStep, toolCall = param.toolCall;
|
|
961
|
+
return /* @__PURE__ */ jsxs6(ToolCallBase, {
|
|
962
|
+
children: [
|
|
963
|
+
/* @__PURE__ */ jsx19(ToolCallIcon, {
|
|
964
|
+
runStep: runStep
|
|
965
|
+
}),
|
|
966
|
+
/* @__PURE__ */ jsxs6(ToolCallTitle, {
|
|
967
|
+
children: [
|
|
968
|
+
"Using tool: ",
|
|
969
|
+
toolCall.type
|
|
970
|
+
]
|
|
971
|
+
})
|
|
972
|
+
]
|
|
936
973
|
});
|
|
937
974
|
};
|
|
938
975
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/index.tsx
|
|
939
|
-
import { jsx as
|
|
976
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
940
977
|
var ToolCall = function(param) {
|
|
941
978
|
var toolCall = param.toolCall, runStep = param.runStep;
|
|
942
979
|
if (toolCall.type === "function") {
|
|
943
|
-
return /* @__PURE__ */
|
|
980
|
+
return /* @__PURE__ */ jsx20(Fn, {
|
|
944
981
|
fn: toolCall.function,
|
|
945
982
|
runStep: runStep
|
|
946
983
|
});
|
|
947
984
|
}
|
|
948
985
|
if (toolCall.type === "code_interpreter") {
|
|
949
|
-
return /* @__PURE__ */
|
|
950
|
-
|
|
986
|
+
return /* @__PURE__ */ jsx20(CodeInterpreter, {
|
|
987
|
+
toolCall: toolCall,
|
|
988
|
+
runStep: runStep
|
|
989
|
+
});
|
|
990
|
+
}
|
|
991
|
+
if (toolCall.type === "file_search") {
|
|
992
|
+
return /* @__PURE__ */ jsx20(FileSearch, {
|
|
993
|
+
toolCall: toolCall,
|
|
951
994
|
runStep: runStep
|
|
952
995
|
});
|
|
953
996
|
}
|
|
954
|
-
return /* @__PURE__ */
|
|
955
|
-
|
|
997
|
+
return /* @__PURE__ */ jsx20(Fallback, {
|
|
998
|
+
toolCall: toolCall,
|
|
999
|
+
runStep: runStep
|
|
956
1000
|
});
|
|
957
1001
|
};
|
|
958
1002
|
// src/components/runSteps/RunStep/ToolCalls/Starting/index.tsx
|
|
959
|
-
import { Popover as
|
|
1003
|
+
import { Popover as Popover2, Text as Text3 } from "@radix-ui/themes";
|
|
960
1004
|
import { CircleIcon as CircleIcon2 } from "@radix-ui/react-icons";
|
|
961
|
-
import { jsx as
|
|
1005
|
+
import { jsx as jsx21, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
962
1006
|
var Starting = function() {
|
|
963
|
-
return /* @__PURE__ */
|
|
1007
|
+
return /* @__PURE__ */ jsxs7(Popover2.Root, {
|
|
964
1008
|
children: [
|
|
965
|
-
/* @__PURE__ */
|
|
1009
|
+
/* @__PURE__ */ jsxs7(ToolCallBase, {
|
|
966
1010
|
children: [
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
/* @__PURE__ */
|
|
1011
|
+
/* @__PURE__ */ jsx21(CircleIcon2, {}),
|
|
1012
|
+
/* @__PURE__ */ jsx21(ToolCallTitle, {
|
|
969
1013
|
children: "Starting actions"
|
|
970
1014
|
})
|
|
971
1015
|
]
|
|
972
1016
|
}),
|
|
973
|
-
/* @__PURE__ */
|
|
1017
|
+
/* @__PURE__ */ jsx21(Popover2.Content, {
|
|
974
1018
|
style: {
|
|
975
1019
|
maxHeight: "500px"
|
|
976
1020
|
},
|
|
977
|
-
children: /* @__PURE__ */
|
|
1021
|
+
children: /* @__PURE__ */ jsx21(Text3, {
|
|
978
1022
|
children: "Getting ready to connect to domain API"
|
|
979
1023
|
})
|
|
980
1024
|
})
|
|
@@ -982,21 +1026,21 @@ var Starting = function() {
|
|
|
982
1026
|
});
|
|
983
1027
|
};
|
|
984
1028
|
// src/components/runSteps/RunStep/ToolCalls/index.tsx
|
|
985
|
-
import { jsx as
|
|
1029
|
+
import { jsx as jsx22, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
986
1030
|
var Root = function(param) {
|
|
987
1031
|
var children = param.children;
|
|
988
|
-
return /* @__PURE__ */
|
|
1032
|
+
return /* @__PURE__ */ jsx22(Flex7, {
|
|
989
1033
|
direction: "column",
|
|
990
1034
|
children: children
|
|
991
1035
|
});
|
|
992
1036
|
};
|
|
993
1037
|
var ToolCalls = function(param) {
|
|
994
1038
|
var stepDetails = param.stepDetails, runStep = param.runStep;
|
|
995
|
-
return /* @__PURE__ */
|
|
1039
|
+
return /* @__PURE__ */ jsxs8(Root, {
|
|
996
1040
|
children: [
|
|
997
|
-
!stepDetails.tool_calls.length && /* @__PURE__ */
|
|
1041
|
+
!stepDetails.tool_calls.length && /* @__PURE__ */ jsx22(Starting, {}),
|
|
998
1042
|
stepDetails.tool_calls.map(function(toolCall) {
|
|
999
|
-
return /* @__PURE__ */
|
|
1043
|
+
return /* @__PURE__ */ jsx22(ToolCall, {
|
|
1000
1044
|
toolCall: toolCall,
|
|
1001
1045
|
runStep: runStep
|
|
1002
1046
|
}, toolCall.id);
|
|
@@ -1008,11 +1052,11 @@ ToolCalls.Root = Root;
|
|
|
1008
1052
|
ToolCalls.Starting = Starting;
|
|
1009
1053
|
ToolCalls.ToolCall = ToolCall;
|
|
1010
1054
|
// src/components/runSteps/RunStep/index.tsx
|
|
1011
|
-
import { jsx as
|
|
1055
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1012
1056
|
var RunStep = function(param) {
|
|
1013
1057
|
var runStep = param.runStep;
|
|
1014
1058
|
if (runStep.step_details.type === "tool_calls") {
|
|
1015
|
-
return /* @__PURE__ */
|
|
1059
|
+
return /* @__PURE__ */ jsx23(ToolCalls, {
|
|
1016
1060
|
stepDetails: runStep.step_details,
|
|
1017
1061
|
runStep: runStep
|
|
1018
1062
|
});
|
|
@@ -1027,15 +1071,15 @@ var ComponentsContext = createContext7({
|
|
|
1027
1071
|
}
|
|
1028
1072
|
});
|
|
1029
1073
|
// src/components/runSteps/RunSteps/index.tsx
|
|
1030
|
-
import { jsx as
|
|
1074
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1031
1075
|
var RunSteps = function(param) {
|
|
1032
1076
|
var runSteps = param.runSteps;
|
|
1033
1077
|
var componentsContext = useContext6(ComponentsContext);
|
|
1034
1078
|
var Component = componentsContext.components.RunStep;
|
|
1035
|
-
return /* @__PURE__ */
|
|
1079
|
+
return /* @__PURE__ */ jsx24(Flex8, {
|
|
1036
1080
|
direction: "column-reverse",
|
|
1037
1081
|
children: runSteps.map(function(runStep) {
|
|
1038
|
-
return /* @__PURE__ */
|
|
1082
|
+
return /* @__PURE__ */ jsx24(Component, {
|
|
1039
1083
|
runStep: runStep
|
|
1040
1084
|
}, runStep.id);
|
|
1041
1085
|
})
|
|
@@ -1074,12 +1118,12 @@ import { useContext as useContext7 } from "react";
|
|
|
1074
1118
|
import { createContext as createContext9 } from "react";
|
|
1075
1119
|
// src/contexts/markdown/MarkdownContext/lib/components/Paragraph.tsx
|
|
1076
1120
|
import { Box as Box3, Text as Text4 } from "@radix-ui/themes";
|
|
1077
|
-
import { jsx as
|
|
1121
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1078
1122
|
var Paragraph = function(param) {
|
|
1079
1123
|
var children = param.children;
|
|
1080
|
-
return /* @__PURE__ */
|
|
1124
|
+
return /* @__PURE__ */ jsx25(Box3, {
|
|
1081
1125
|
pb: "3",
|
|
1082
|
-
children: /* @__PURE__ */
|
|
1126
|
+
children: /* @__PURE__ */ jsx25(Text4, {
|
|
1083
1127
|
size: "3",
|
|
1084
1128
|
style: {
|
|
1085
1129
|
whiteSpace: "pre-line",
|
|
@@ -1091,23 +1135,23 @@ var Paragraph = function(param) {
|
|
|
1091
1135
|
};
|
|
1092
1136
|
// src/contexts/markdown/MarkdownContext/lib/components/Link.tsx
|
|
1093
1137
|
import { Link as RadixLink } from "@radix-ui/themes";
|
|
1094
|
-
import { jsx as
|
|
1138
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1095
1139
|
var Link = function(param) {
|
|
1096
1140
|
var children = param.children, href = param.href;
|
|
1097
|
-
return /* @__PURE__ */
|
|
1141
|
+
return /* @__PURE__ */ jsx26(RadixLink, {
|
|
1098
1142
|
href: href,
|
|
1099
1143
|
children: children
|
|
1100
1144
|
});
|
|
1101
1145
|
};
|
|
1102
1146
|
// src/contexts/markdown/MarkdownContext/lib/components/UnorderedList.tsx
|
|
1103
1147
|
import { Box as Box4 } from "@radix-ui/themes";
|
|
1104
|
-
import { jsx as
|
|
1148
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1105
1149
|
var UnorderedList = function(param) {
|
|
1106
1150
|
var children = param.children;
|
|
1107
|
-
return /* @__PURE__ */
|
|
1151
|
+
return /* @__PURE__ */ jsx27(Box4, {
|
|
1108
1152
|
pb: "3",
|
|
1109
1153
|
asChild: true,
|
|
1110
|
-
children: /* @__PURE__ */
|
|
1154
|
+
children: /* @__PURE__ */ jsx27("ul", {
|
|
1111
1155
|
style: {
|
|
1112
1156
|
listStylePosition: "inside"
|
|
1113
1157
|
},
|
|
@@ -1117,13 +1161,13 @@ var UnorderedList = function(param) {
|
|
|
1117
1161
|
};
|
|
1118
1162
|
// src/contexts/markdown/MarkdownContext/lib/components/OrderedList.tsx
|
|
1119
1163
|
import { Box as Box5 } from "@radix-ui/themes";
|
|
1120
|
-
import { jsx as
|
|
1164
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1121
1165
|
var OrderedList = function(param) {
|
|
1122
1166
|
var children = param.children;
|
|
1123
|
-
return /* @__PURE__ */
|
|
1167
|
+
return /* @__PURE__ */ jsx28(Box5, {
|
|
1124
1168
|
pb: "3",
|
|
1125
1169
|
asChild: true,
|
|
1126
|
-
children: /* @__PURE__ */
|
|
1170
|
+
children: /* @__PURE__ */ jsx28("ol", {
|
|
1127
1171
|
style: {
|
|
1128
1172
|
listStylePosition: "inside"
|
|
1129
1173
|
},
|
|
@@ -1133,31 +1177,31 @@ var OrderedList = function(param) {
|
|
|
1133
1177
|
};
|
|
1134
1178
|
// src/contexts/markdown/MarkdownContext/lib/components/ListItem.tsx
|
|
1135
1179
|
import { Box as Box6 } from "@radix-ui/themes";
|
|
1136
|
-
import { jsx as
|
|
1180
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1137
1181
|
var ListItem = function(param) {
|
|
1138
1182
|
var children = param.children;
|
|
1139
|
-
return /* @__PURE__ */
|
|
1183
|
+
return /* @__PURE__ */ jsx29(Box6, {
|
|
1140
1184
|
pb: "1",
|
|
1141
|
-
children: /* @__PURE__ */
|
|
1185
|
+
children: /* @__PURE__ */ jsx29("li", {
|
|
1142
1186
|
children: children
|
|
1143
1187
|
})
|
|
1144
1188
|
});
|
|
1145
1189
|
};
|
|
1146
1190
|
// src/contexts/markdown/MarkdownContext/lib/components/Strong.tsx
|
|
1147
1191
|
import { Strong as RadixStrong } from "@radix-ui/themes";
|
|
1148
|
-
import { jsx as
|
|
1192
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1149
1193
|
var Strong = function(param) {
|
|
1150
1194
|
var children = param.children;
|
|
1151
|
-
return /* @__PURE__ */
|
|
1195
|
+
return /* @__PURE__ */ jsx30(RadixStrong, {
|
|
1152
1196
|
children: children
|
|
1153
1197
|
});
|
|
1154
1198
|
};
|
|
1155
1199
|
// src/contexts/markdown/MarkdownContext/lib/components/Pre.tsx
|
|
1156
1200
|
import { Box as Box7 } from "@radix-ui/themes";
|
|
1157
|
-
import { jsx as
|
|
1201
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1158
1202
|
var Pre = function(param) {
|
|
1159
1203
|
var children = param.children;
|
|
1160
|
-
return /* @__PURE__ */
|
|
1204
|
+
return /* @__PURE__ */ jsx31(Box7, {
|
|
1161
1205
|
style: {
|
|
1162
1206
|
whiteSpace: "pre-wrap",
|
|
1163
1207
|
wordBreak: "break-word"
|
|
@@ -1167,20 +1211,20 @@ var Pre = function(param) {
|
|
|
1167
1211
|
};
|
|
1168
1212
|
// src/contexts/markdown/MarkdownContext/lib/components/Code.tsx
|
|
1169
1213
|
import { Code as RadixCode } from "@radix-ui/themes";
|
|
1170
|
-
import { jsx as
|
|
1214
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1171
1215
|
var Code2 = function(param) {
|
|
1172
1216
|
var children = param.children;
|
|
1173
|
-
return /* @__PURE__ */
|
|
1217
|
+
return /* @__PURE__ */ jsx32(RadixCode, {
|
|
1174
1218
|
children: children
|
|
1175
1219
|
});
|
|
1176
1220
|
};
|
|
1177
1221
|
// src/contexts/markdown/MarkdownContext/lib/components/Img.tsx
|
|
1178
1222
|
import { Box as Box8 } from "@radix-ui/themes";
|
|
1179
|
-
import { jsx as
|
|
1223
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1180
1224
|
var Img = function(props) {
|
|
1181
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ jsx33(Box8, {
|
|
1182
1226
|
pb: "3",
|
|
1183
|
-
children: /* @__PURE__ */
|
|
1227
|
+
children: /* @__PURE__ */ jsx33("img", _object_spread_props(_object_spread({}, props), {
|
|
1184
1228
|
style: {
|
|
1185
1229
|
maxWidth: "100%",
|
|
1186
1230
|
height: "auto"
|
|
@@ -1212,16 +1256,39 @@ var useMarkdownContext = function() {
|
|
|
1212
1256
|
return useContext7(MarkdownContext);
|
|
1213
1257
|
};
|
|
1214
1258
|
// src/components/threads/Thread/Message/TextContent.tsx
|
|
1215
|
-
import { jsx as
|
|
1259
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1216
1260
|
var TextContent = function(param) {
|
|
1217
1261
|
var content = param.content;
|
|
1218
1262
|
var markdownContext = useMarkdownContext();
|
|
1219
|
-
return /* @__PURE__ */
|
|
1263
|
+
return /* @__PURE__ */ jsx34(Markdown, _object_spread_props(_object_spread({}, markdownContext), {
|
|
1220
1264
|
children: content.text.value
|
|
1221
1265
|
}));
|
|
1222
1266
|
};
|
|
1267
|
+
// src/components/threads/Thread/Message/Attachments/index.tsx
|
|
1268
|
+
import { Flex as Flex9, Badge } from "@radix-ui/themes";
|
|
1269
|
+
import { FileIcon } from "@radix-ui/react-icons";
|
|
1270
|
+
import { jsx as jsx35, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1271
|
+
var Attachments = function(param) {
|
|
1272
|
+
var message = param.message;
|
|
1273
|
+
var _message_attachments;
|
|
1274
|
+
if (!((_message_attachments = message.attachments) === null || _message_attachments === void 0 ? void 0 : _message_attachments.length)) return null;
|
|
1275
|
+
return /* @__PURE__ */ jsx35(Flex9, {
|
|
1276
|
+
align: "start",
|
|
1277
|
+
pb: "1",
|
|
1278
|
+
children: /* @__PURE__ */ jsxs9(Badge, {
|
|
1279
|
+
color: "gray",
|
|
1280
|
+
variant: "surface",
|
|
1281
|
+
children: [
|
|
1282
|
+
/* @__PURE__ */ jsx35(FileIcon, {}),
|
|
1283
|
+
message.attachments.length,
|
|
1284
|
+
" file",
|
|
1285
|
+
message.attachments.length > 1 ? "s" : ""
|
|
1286
|
+
]
|
|
1287
|
+
})
|
|
1288
|
+
});
|
|
1289
|
+
};
|
|
1223
1290
|
// src/components/threads/Thread/Message/index.tsx
|
|
1224
|
-
import { jsx as
|
|
1291
|
+
import { jsx as jsx36, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1225
1292
|
var Message = function(param) {
|
|
1226
1293
|
var message = param.message;
|
|
1227
1294
|
var _useMemo5 = _sliced_to_array(useMemo5(function() {
|
|
@@ -1266,65 +1333,68 @@ var Message = function(param) {
|
|
|
1266
1333
|
}, [
|
|
1267
1334
|
message
|
|
1268
1335
|
]);
|
|
1269
|
-
return /* @__PURE__ */
|
|
1336
|
+
return /* @__PURE__ */ jsx36(Provider, {
|
|
1270
1337
|
value: {
|
|
1271
1338
|
message: message
|
|
1272
1339
|
},
|
|
1273
|
-
children: /* @__PURE__ */
|
|
1340
|
+
children: /* @__PURE__ */ jsxs10(Box9, {
|
|
1274
1341
|
children: [
|
|
1275
|
-
/* @__PURE__ */
|
|
1342
|
+
/* @__PURE__ */ jsx36(RunSteps, {
|
|
1276
1343
|
runSteps: olderRunSteps
|
|
1277
1344
|
}),
|
|
1278
|
-
/* @__PURE__ */
|
|
1345
|
+
/* @__PURE__ */ jsxs10(Box9, {
|
|
1279
1346
|
children: [
|
|
1347
|
+
/* @__PURE__ */ jsx36(Attachments, {
|
|
1348
|
+
message: message
|
|
1349
|
+
}),
|
|
1280
1350
|
message.content.map(function(content, index) {
|
|
1281
|
-
return /* @__PURE__ */
|
|
1282
|
-
children: content.type === "text" && /* @__PURE__ */
|
|
1351
|
+
return /* @__PURE__ */ jsx36(Fragment, {
|
|
1352
|
+
children: content.type === "text" && /* @__PURE__ */ jsx36(TextContent, {
|
|
1283
1353
|
content: content
|
|
1284
1354
|
})
|
|
1285
1355
|
}, index);
|
|
1286
1356
|
}),
|
|
1287
|
-
isInProgress && isEmpty(laterRunSteps) && /* @__PURE__ */
|
|
1357
|
+
isInProgress && isEmpty(laterRunSteps) && /* @__PURE__ */ jsx36(StartingContentSkeleton, {})
|
|
1288
1358
|
]
|
|
1289
1359
|
}),
|
|
1290
|
-
/* @__PURE__ */
|
|
1360
|
+
/* @__PURE__ */ jsx36(RunSteps, {
|
|
1291
1361
|
runSteps: laterRunSteps
|
|
1292
1362
|
}),
|
|
1293
|
-
isInProgress && !isEmpty(laterRunSteps) && /* @__PURE__ */
|
|
1294
|
-
children: /* @__PURE__ */
|
|
1363
|
+
isInProgress && !isEmpty(laterRunSteps) && /* @__PURE__ */ jsx36(Box9, {
|
|
1364
|
+
children: /* @__PURE__ */ jsx36(StartingContentSkeleton, {})
|
|
1295
1365
|
})
|
|
1296
1366
|
]
|
|
1297
1367
|
})
|
|
1298
1368
|
});
|
|
1299
1369
|
};
|
|
1300
1370
|
// src/components/threads/Thread/Messages/Content/MessageGroup/Content/index.tsx
|
|
1301
|
-
import { jsx as
|
|
1371
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
1302
1372
|
var Content2 = function(param) {
|
|
1303
1373
|
var messageGroup = param.messageGroup;
|
|
1304
|
-
return /* @__PURE__ */
|
|
1374
|
+
return /* @__PURE__ */ jsx37(Flex10, {
|
|
1305
1375
|
direction: "column-reverse",
|
|
1306
1376
|
children: messageGroup.messages.map(function(message) {
|
|
1307
|
-
return /* @__PURE__ */
|
|
1377
|
+
return /* @__PURE__ */ jsx37(Message, {
|
|
1308
1378
|
message: message
|
|
1309
1379
|
}, message.id);
|
|
1310
1380
|
})
|
|
1311
1381
|
});
|
|
1312
1382
|
};
|
|
1313
1383
|
// src/components/threads/Thread/Messages/Content/MessageGroup/index.tsx
|
|
1314
|
-
import { jsx as
|
|
1384
|
+
import { jsx as jsx38, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1315
1385
|
var MessageGroup = function(param) {
|
|
1316
1386
|
var messageGroup = param.messageGroup;
|
|
1317
1387
|
var assistantNameContext = useContext8(AssistantNameContext);
|
|
1318
|
-
return /* @__PURE__ */
|
|
1388
|
+
return /* @__PURE__ */ jsxs11(MessageGroupBase, {
|
|
1319
1389
|
children: [
|
|
1320
|
-
messageGroup.role === "user" ? /* @__PURE__ */
|
|
1321
|
-
/* @__PURE__ */
|
|
1390
|
+
messageGroup.role === "user" ? /* @__PURE__ */ jsx38(UserAvatar, {}) : /* @__PURE__ */ jsx38(AssistantAvatar, {}),
|
|
1391
|
+
/* @__PURE__ */ jsxs11(Box10, {
|
|
1322
1392
|
flexGrow: "1",
|
|
1323
1393
|
children: [
|
|
1324
|
-
/* @__PURE__ */
|
|
1394
|
+
/* @__PURE__ */ jsx38(Name, {
|
|
1325
1395
|
children: messageGroup.role === "user" ? "You" : assistantNameContext
|
|
1326
1396
|
}),
|
|
1327
|
-
/* @__PURE__ */
|
|
1397
|
+
/* @__PURE__ */ jsx38(Content2, {
|
|
1328
1398
|
messageGroup: messageGroup
|
|
1329
1399
|
})
|
|
1330
1400
|
]
|
|
@@ -1333,7 +1403,7 @@ var MessageGroup = function(param) {
|
|
|
1333
1403
|
});
|
|
1334
1404
|
};
|
|
1335
1405
|
// src/components/threads/Thread/Messages/Content/index.tsx
|
|
1336
|
-
import { Fragment as Fragment2, jsx as
|
|
1406
|
+
import { Fragment as Fragment2, jsx as jsx39 } from "react/jsx-runtime";
|
|
1337
1407
|
var Content3 = function() {
|
|
1338
1408
|
var _useMessages = useMessages(), messages2 = _useMessages.messages, isLoading = _useMessages.isLoading, isLoadingError = _useMessages.isLoadingError;
|
|
1339
1409
|
var addToast = useToasts().addToast;
|
|
@@ -1352,11 +1422,11 @@ var Content3 = function() {
|
|
|
1352
1422
|
addToast
|
|
1353
1423
|
]);
|
|
1354
1424
|
if (isLoading || isLoadingError) {
|
|
1355
|
-
return /* @__PURE__ */
|
|
1425
|
+
return /* @__PURE__ */ jsx39(MessagesSkeleton, {});
|
|
1356
1426
|
}
|
|
1357
|
-
return /* @__PURE__ */
|
|
1427
|
+
return /* @__PURE__ */ jsx39(Fragment2, {
|
|
1358
1428
|
children: messageGroups2.map(function(messageGroup) {
|
|
1359
|
-
return /* @__PURE__ */
|
|
1429
|
+
return /* @__PURE__ */ jsx39(MessageGroup, {
|
|
1360
1430
|
messageGroup: messageGroup
|
|
1361
1431
|
}, messageGroup.id);
|
|
1362
1432
|
})
|
|
@@ -1367,20 +1437,20 @@ import { useMemo as useMemo7 } from "react";
|
|
|
1367
1437
|
// src/components/skeletons/StartingSkeleton/index.tsx
|
|
1368
1438
|
import { useContext as useContext9 } from "react";
|
|
1369
1439
|
import { Box as Box11 } from "@radix-ui/themes";
|
|
1370
|
-
import { jsx as
|
|
1440
|
+
import { jsx as jsx40, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1371
1441
|
var StartingSkeleton = function(param) {
|
|
1372
1442
|
var children = param.children;
|
|
1373
1443
|
var assistantNameContext = useContext9(AssistantNameContext);
|
|
1374
|
-
return /* @__PURE__ */
|
|
1444
|
+
return /* @__PURE__ */ jsxs12(MessageGroupBase, {
|
|
1375
1445
|
children: [
|
|
1376
|
-
/* @__PURE__ */
|
|
1377
|
-
/* @__PURE__ */
|
|
1446
|
+
/* @__PURE__ */ jsx40(AssistantAvatar, {}),
|
|
1447
|
+
/* @__PURE__ */ jsxs12(Box11, {
|
|
1378
1448
|
children: [
|
|
1379
|
-
/* @__PURE__ */
|
|
1449
|
+
/* @__PURE__ */ jsx40(Name, {
|
|
1380
1450
|
children: assistantNameContext
|
|
1381
1451
|
}),
|
|
1382
1452
|
children,
|
|
1383
|
-
/* @__PURE__ */
|
|
1453
|
+
/* @__PURE__ */ jsx40(StartingContentSkeleton, {})
|
|
1384
1454
|
]
|
|
1385
1455
|
})
|
|
1386
1456
|
]
|
|
@@ -1405,7 +1475,7 @@ var isOptimistic = function(param) {
|
|
|
1405
1475
|
return _4.startsWith(id, "-");
|
|
1406
1476
|
};
|
|
1407
1477
|
// src/components/threads/Thread/Messages/Progress/index.tsx
|
|
1408
|
-
import { jsx as
|
|
1478
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
1409
1479
|
var Progress = function() {
|
|
1410
1480
|
var latestMessage = useLatestMessage().latestMessage;
|
|
1411
1481
|
var isMutatingMessage = useIsMutatingMessage();
|
|
@@ -1423,10 +1493,10 @@ var Progress = function() {
|
|
|
1423
1493
|
isMutatingMessage
|
|
1424
1494
|
]);
|
|
1425
1495
|
if (!isVisible) return null;
|
|
1426
|
-
return /* @__PURE__ */
|
|
1496
|
+
return /* @__PURE__ */ jsx41(StartingSkeleton, {});
|
|
1427
1497
|
};
|
|
1428
1498
|
// src/components/threads/Thread/Messages/Root/index.tsx
|
|
1429
|
-
import { Flex as
|
|
1499
|
+
import { Flex as Flex11 } from "@radix-ui/themes";
|
|
1430
1500
|
// src/hooks/misc/useInfiniteScroll/index.tsx
|
|
1431
1501
|
import { useRef as useRef3 } from "react";
|
|
1432
1502
|
import { useInView } from "react-intersection-observer";
|
|
@@ -1482,7 +1552,7 @@ var useInfiniteScroll = function(param) {
|
|
|
1482
1552
|
};
|
|
1483
1553
|
};
|
|
1484
1554
|
// src/components/threads/Thread/Messages/Root/index.tsx
|
|
1485
|
-
import { jsx as
|
|
1555
|
+
import { jsx as jsx42, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1486
1556
|
var Root2 = function(param) {
|
|
1487
1557
|
var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
1488
1558
|
var _useMessages = useMessages(), isFetchingNextPage = _useMessages.isFetchingNextPage, hasNextPage = _useMessages.hasNextPage, fetchNextPage = _useMessages.fetchNextPage;
|
|
@@ -1491,7 +1561,7 @@ var Root2 = function(param) {
|
|
|
1491
1561
|
hasNextPage: hasNextPage,
|
|
1492
1562
|
fetchNextPage: fetchNextPage
|
|
1493
1563
|
}), containerRef = _useInfiniteScroll.containerRef, loaderRef = _useInfiniteScroll.loaderRef;
|
|
1494
|
-
return /* @__PURE__ */
|
|
1564
|
+
return /* @__PURE__ */ jsxs13(Flex11, {
|
|
1495
1565
|
ref: containerRef,
|
|
1496
1566
|
direction: "column-reverse",
|
|
1497
1567
|
flexGrow: "1",
|
|
@@ -1500,10 +1570,10 @@ var Root2 = function(param) {
|
|
|
1500
1570
|
}),
|
|
1501
1571
|
children: [
|
|
1502
1572
|
children,
|
|
1503
|
-
hasNextPage && /* @__PURE__ */
|
|
1573
|
+
hasNextPage && /* @__PURE__ */ jsx42(Flex11, {
|
|
1504
1574
|
ref: loaderRef
|
|
1505
1575
|
}),
|
|
1506
|
-
/* @__PURE__ */
|
|
1576
|
+
/* @__PURE__ */ jsx42(Flex11, {
|
|
1507
1577
|
flexShrink: "0",
|
|
1508
1578
|
flexGrow: "1"
|
|
1509
1579
|
})
|
|
@@ -1511,30 +1581,30 @@ var Root2 = function(param) {
|
|
|
1511
1581
|
});
|
|
1512
1582
|
};
|
|
1513
1583
|
// src/components/threads/Thread/Messages/NextPageSkeleton.tsx
|
|
1514
|
-
import { jsx as
|
|
1584
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
1515
1585
|
var NextPageSkeleton = function() {
|
|
1516
1586
|
var hasNextPage = useMessages().hasNextPage;
|
|
1517
1587
|
if (!hasNextPage) {
|
|
1518
1588
|
return null;
|
|
1519
1589
|
}
|
|
1520
|
-
return /* @__PURE__ */
|
|
1590
|
+
return /* @__PURE__ */ jsx43(MessagesSkeleton, {});
|
|
1521
1591
|
};
|
|
1522
1592
|
// src/components/threads/Thread/Messages/index.tsx
|
|
1523
|
-
import { jsx as
|
|
1593
|
+
import { jsx as jsx44, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1524
1594
|
var Messages = function(param) {
|
|
1525
1595
|
var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
1526
|
-
return /* @__PURE__ */
|
|
1596
|
+
return /* @__PURE__ */ jsxs14(Root2, {
|
|
1527
1597
|
style: style,
|
|
1528
1598
|
children: [
|
|
1529
|
-
/* @__PURE__ */
|
|
1599
|
+
/* @__PURE__ */ jsx44(Flex12, {
|
|
1530
1600
|
flexShrink: "0",
|
|
1531
1601
|
height: "var(--space-3)"
|
|
1532
1602
|
}),
|
|
1533
|
-
/* @__PURE__ */
|
|
1603
|
+
/* @__PURE__ */ jsx44(Progress, {}),
|
|
1534
1604
|
children,
|
|
1535
|
-
/* @__PURE__ */
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
/* @__PURE__ */
|
|
1605
|
+
/* @__PURE__ */ jsx44(Content3, {}),
|
|
1606
|
+
/* @__PURE__ */ jsx44(NextPageSkeleton, {}),
|
|
1607
|
+
/* @__PURE__ */ jsx44(Flex12, {
|
|
1538
1608
|
flexShrink: "0",
|
|
1539
1609
|
flexGrow: "1"
|
|
1540
1610
|
})
|
|
@@ -1544,47 +1614,63 @@ var Messages = function(param) {
|
|
|
1544
1614
|
Messages.Root = Root2;
|
|
1545
1615
|
Messages.Message = Message;
|
|
1546
1616
|
Messages.NextPageSkeleton = NextPageSkeleton;
|
|
1547
|
-
// src/components/threads/Thread/MessageForm/index.tsx
|
|
1548
|
-
import { Flex as Flex15, Text as Text5 } from "@radix-ui/themes";
|
|
1549
1617
|
// src/components/threads/Thread/MessageForm/Submit/index.tsx
|
|
1550
1618
|
import { ArrowUpIcon, StopIcon } from "@radix-ui/react-icons";
|
|
1551
|
-
import { IconButton } from "@radix-ui/themes";
|
|
1619
|
+
import { IconButton, Flex as Flex13 } from "@radix-ui/themes";
|
|
1552
1620
|
// src/hooks/messages/useMessageFormContext/index.ts
|
|
1553
1621
|
import { useContext as useContext10 } from "react";
|
|
1554
1622
|
// src/contexts/messages/MessageFormContext/index.ts
|
|
1555
1623
|
import { createContext as createContext10 } from "react";
|
|
1556
1624
|
var MessageFormContext = createContext10({
|
|
1557
1625
|
isDisabled: false,
|
|
1558
|
-
isLoading: false
|
|
1626
|
+
isLoading: false,
|
|
1627
|
+
files: [],
|
|
1628
|
+
setFiles: function() {},
|
|
1629
|
+
isFileLoading: false
|
|
1559
1630
|
});
|
|
1560
1631
|
// src/hooks/messages/useMessageFormContext/index.ts
|
|
1561
1632
|
var useMessageFormContext = function() {
|
|
1562
1633
|
return useContext10(MessageFormContext);
|
|
1563
1634
|
};
|
|
1564
1635
|
// src/components/threads/Thread/MessageForm/Submit/index.tsx
|
|
1565
|
-
import { jsx as
|
|
1566
|
-
var
|
|
1636
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
1637
|
+
var Root3 = function(param) {
|
|
1638
|
+
var children = param.children;
|
|
1639
|
+
return /* @__PURE__ */ jsx45(Flex13, {
|
|
1640
|
+
flexShrink: "0",
|
|
1641
|
+
align: "end",
|
|
1642
|
+
children: children
|
|
1643
|
+
});
|
|
1644
|
+
};
|
|
1645
|
+
var Button2 = function() {
|
|
1567
1646
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
1568
|
-
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
|
|
1647
|
+
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading, isFileLoading = _useMessageFormContext.isFileLoading;
|
|
1569
1648
|
if (isLoading) {
|
|
1570
|
-
return /* @__PURE__ */
|
|
1649
|
+
return /* @__PURE__ */ jsx45(IconButton, {
|
|
1571
1650
|
type: "button",
|
|
1572
1651
|
onClick: function() {
|
|
1573
1652
|
var _superinterfaceContext_createMessageAbortControllerRef_current;
|
|
1574
1653
|
return (_superinterfaceContext_createMessageAbortControllerRef_current = superinterfaceContext.createMessageAbortControllerRef.current) === null || _superinterfaceContext_createMessageAbortControllerRef_current === void 0 ? void 0 : _superinterfaceContext_createMessageAbortControllerRef_current.abort();
|
|
1575
1654
|
},
|
|
1576
|
-
children: /* @__PURE__ */
|
|
1655
|
+
children: /* @__PURE__ */ jsx45(StopIcon, {})
|
|
1577
1656
|
});
|
|
1578
1657
|
}
|
|
1579
|
-
return /* @__PURE__ */
|
|
1658
|
+
return /* @__PURE__ */ jsx45(IconButton, {
|
|
1580
1659
|
type: "submit",
|
|
1581
|
-
disabled: isDisabled,
|
|
1582
|
-
children: /* @__PURE__ */
|
|
1660
|
+
disabled: isDisabled || isFileLoading,
|
|
1661
|
+
children: /* @__PURE__ */ jsx45(ArrowUpIcon, {})
|
|
1662
|
+
});
|
|
1663
|
+
};
|
|
1664
|
+
var Submit = function() {
|
|
1665
|
+
return /* @__PURE__ */ jsx45(Root3, {
|
|
1666
|
+
children: /* @__PURE__ */ jsx45(Button2, {})
|
|
1583
1667
|
});
|
|
1584
1668
|
};
|
|
1669
|
+
Submit.Root = Root3;
|
|
1670
|
+
Submit.Button = Button2;
|
|
1585
1671
|
// src/components/threads/Thread/MessageForm/Root/index.tsx
|
|
1586
1672
|
import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
|
|
1587
|
-
import { useMemo as useMemo8 } from "react";
|
|
1673
|
+
import { useMemo as useMemo8, useState } from "react";
|
|
1588
1674
|
import { useForm, FormProvider } from "react-hook-form";
|
|
1589
1675
|
import { Box as Box12 } from "@radix-ui/themes";
|
|
1590
1676
|
// src/hooks/messages/useCreateMessage/index.ts
|
|
@@ -1603,6 +1689,7 @@ var optimisticId = function() {
|
|
|
1603
1689
|
var data = function(param) {
|
|
1604
1690
|
var newMessage = param.newMessage;
|
|
1605
1691
|
return function(prevData) {
|
|
1692
|
+
var _newMessage_attachments;
|
|
1606
1693
|
var message = {
|
|
1607
1694
|
id: optimisticId(),
|
|
1608
1695
|
role: "user",
|
|
@@ -1620,7 +1707,7 @@ var data = function(param) {
|
|
|
1620
1707
|
run_id: null,
|
|
1621
1708
|
assistant_id: null,
|
|
1622
1709
|
thread_id: null,
|
|
1623
|
-
attachments: [],
|
|
1710
|
+
attachments: (_newMessage_attachments = newMessage.attachments) !== null && _newMessage_attachments !== void 0 ? _newMessage_attachments : [],
|
|
1624
1711
|
metadata: {},
|
|
1625
1712
|
runSteps: []
|
|
1626
1713
|
};
|
|
@@ -1662,7 +1749,8 @@ var onMutate = function(param) {
|
|
|
1662
1749
|
queryKey = [
|
|
1663
1750
|
"messages",
|
|
1664
1751
|
omit(newMessage, [
|
|
1665
|
-
"content"
|
|
1752
|
+
"content",
|
|
1753
|
+
"attachments"
|
|
1666
1754
|
])
|
|
1667
1755
|
];
|
|
1668
1756
|
return [
|
|
@@ -1699,13 +1787,13 @@ var threadCreated = function(param) {
|
|
|
1699
1787
|
var value = param.value, superinterfaceContext = param.superinterfaceContext;
|
|
1700
1788
|
var _superinterfaceContext_threadIdCookieOptions, _value_data_metadata, _value_data_metadata1;
|
|
1701
1789
|
if (!((_superinterfaceContext_threadIdCookieOptions = superinterfaceContext.threadIdCookieOptions) === null || _superinterfaceContext_threadIdCookieOptions === void 0 ? void 0 : _superinterfaceContext_threadIdCookieOptions.set)) return;
|
|
1702
|
-
if (!((_value_data_metadata = value.data.metadata) === null || _value_data_metadata === void 0 ? void 0 : _value_data_metadata.
|
|
1703
|
-
if (!((_value_data_metadata1 = value.data.metadata) === null || _value_data_metadata1 === void 0 ? void 0 : _value_data_metadata1.
|
|
1790
|
+
if (!((_value_data_metadata = value.data.metadata) === null || _value_data_metadata === void 0 ? void 0 : _value_data_metadata.assistantId)) return;
|
|
1791
|
+
if (!((_value_data_metadata1 = value.data.metadata) === null || _value_data_metadata1 === void 0 ? void 0 : _value_data_metadata1.threadId)) return;
|
|
1704
1792
|
superinterfaceContext.threadIdCookieOptions.set({
|
|
1705
1793
|
// @ts-ignore-next-line
|
|
1706
|
-
assistantId: value.data.metadata.
|
|
1794
|
+
assistantId: value.data.metadata.assistantId,
|
|
1707
1795
|
// @ts-ignore-next-line
|
|
1708
|
-
threadId: value.data.metadata.
|
|
1796
|
+
threadId: value.data.metadata.threadId
|
|
1709
1797
|
});
|
|
1710
1798
|
};
|
|
1711
1799
|
// src/hooks/messages/useCreateMessage/lib/mutationOptions/mutationFn/handleResponse/handlers/extendMessage.ts
|
|
@@ -2207,9 +2295,10 @@ var formOptions = {
|
|
|
2207
2295
|
};
|
|
2208
2296
|
// src/components/threads/Thread/MessageForm/Root/index.tsx
|
|
2209
2297
|
import { partob as partob2 } from "radash";
|
|
2210
|
-
import { jsx as
|
|
2211
|
-
var
|
|
2298
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
2299
|
+
var Root4 = function(param) {
|
|
2212
2300
|
var children = param.children, onSubmitArg = param.onSubmit;
|
|
2301
|
+
var _useState = _sliced_to_array(useState([]), 2), files = _useState[0], setFiles = _useState[1];
|
|
2213
2302
|
var formProps = useForm(formOptions);
|
|
2214
2303
|
var handleSubmit = formProps.handleSubmit, isSubmitting = formProps.formState.isSubmitting, reset = formProps.reset;
|
|
2215
2304
|
var addToast = useToasts().addToast;
|
|
@@ -2239,27 +2328,69 @@ var Root3 = function(param) {
|
|
|
2239
2328
|
}
|
|
2240
2329
|
}).createMessage;
|
|
2241
2330
|
var isMutatingMessage = useIsMutatingMessage();
|
|
2331
|
+
var isFileLoading = useMemo8(function() {
|
|
2332
|
+
return files.some(function(file) {
|
|
2333
|
+
return isOptimistic({
|
|
2334
|
+
id: file.id
|
|
2335
|
+
});
|
|
2336
|
+
});
|
|
2337
|
+
}, [
|
|
2338
|
+
files
|
|
2339
|
+
]);
|
|
2242
2340
|
var isLoading = useMemo8(function() {
|
|
2243
2341
|
return isMutatingMessage || isSubmitting;
|
|
2244
2342
|
}, [
|
|
2245
2343
|
isMutatingMessage,
|
|
2246
2344
|
isSubmitting
|
|
2247
2345
|
]);
|
|
2346
|
+
var latestMessage = useLatestMessage().latestMessage;
|
|
2347
|
+
var isDisabled = useMemo8(function() {
|
|
2348
|
+
var // @ts-ignore-next-line
|
|
2349
|
+
_latestMessage_metadata;
|
|
2350
|
+
return latestMessage === null || latestMessage === void 0 ? void 0 : (_latestMessage_metadata = latestMessage.metadata) === null || _latestMessage_metadata === void 0 ? void 0 : _latestMessage_metadata.isBlocking;
|
|
2351
|
+
}, [
|
|
2352
|
+
latestMessage,
|
|
2353
|
+
isLoading,
|
|
2354
|
+
files
|
|
2355
|
+
]);
|
|
2248
2356
|
var onSubmit = onSubmitArg ? partob2(onSubmitArg, {
|
|
2249
2357
|
reset: reset,
|
|
2250
2358
|
createMessage: createMessage
|
|
2251
2359
|
}) : function() {
|
|
2252
2360
|
var _ref = _async_to_generator(function(data2) {
|
|
2361
|
+
var attachments;
|
|
2253
2362
|
return _ts_generator(this, function(_state) {
|
|
2254
2363
|
switch(_state.label){
|
|
2255
2364
|
case 0:
|
|
2365
|
+
if (isFileLoading) return [
|
|
2366
|
+
2
|
|
2367
|
+
];
|
|
2368
|
+
if (isLoading) return [
|
|
2369
|
+
2
|
|
2370
|
+
];
|
|
2371
|
+
if (isDisabled) return [
|
|
2372
|
+
2
|
|
2373
|
+
];
|
|
2256
2374
|
reset();
|
|
2375
|
+
setFiles([]);
|
|
2376
|
+
attachments = files.map(function(file) {
|
|
2377
|
+
return {
|
|
2378
|
+
file_id: file.id,
|
|
2379
|
+
tools: [
|
|
2380
|
+
{
|
|
2381
|
+
type: "file_search"
|
|
2382
|
+
}
|
|
2383
|
+
]
|
|
2384
|
+
};
|
|
2385
|
+
});
|
|
2257
2386
|
return [
|
|
2258
2387
|
4,
|
|
2259
|
-
createMessage({
|
|
2388
|
+
createMessage(_object_spread({
|
|
2260
2389
|
// @ts-ignore-next-line
|
|
2261
2390
|
content: data2.content
|
|
2262
|
-
}
|
|
2391
|
+
}, attachments.length ? {
|
|
2392
|
+
attachments: attachments
|
|
2393
|
+
} : {}))
|
|
2263
2394
|
];
|
|
2264
2395
|
case 1:
|
|
2265
2396
|
_state.sent();
|
|
@@ -2273,25 +2404,19 @@ var Root3 = function(param) {
|
|
|
2273
2404
|
return _ref.apply(this, arguments);
|
|
2274
2405
|
};
|
|
2275
2406
|
}();
|
|
2276
|
-
|
|
2277
|
-
var isDisabled = useMemo8(function() {
|
|
2278
|
-
var // @ts-ignore-next-line
|
|
2279
|
-
_latestMessage_metadata;
|
|
2280
|
-
return latestMessage === null || latestMessage === void 0 ? void 0 : (_latestMessage_metadata = latestMessage.metadata) === null || _latestMessage_metadata === void 0 ? void 0 : _latestMessage_metadata.isBlocking;
|
|
2281
|
-
}, [
|
|
2282
|
-
latestMessage,
|
|
2283
|
-
isLoading
|
|
2284
|
-
]);
|
|
2285
|
-
return /* @__PURE__ */ jsx43(MessageFormContext.Provider, {
|
|
2407
|
+
return /* @__PURE__ */ jsx46(MessageFormContext.Provider, {
|
|
2286
2408
|
value: {
|
|
2287
2409
|
isDisabled: isDisabled,
|
|
2288
|
-
isLoading: isLoading
|
|
2410
|
+
isLoading: isLoading,
|
|
2411
|
+
files: files,
|
|
2412
|
+
setFiles: setFiles,
|
|
2413
|
+
isFileLoading: isFileLoading
|
|
2289
2414
|
},
|
|
2290
|
-
children: /* @__PURE__ */
|
|
2291
|
-
children: /* @__PURE__ */
|
|
2415
|
+
children: /* @__PURE__ */ jsx46(FormProvider, _object_spread_props(_object_spread({}, formProps), {
|
|
2416
|
+
children: /* @__PURE__ */ jsx46(Box12, {
|
|
2292
2417
|
asChild: true,
|
|
2293
2418
|
flexShrink: "0",
|
|
2294
|
-
children: /* @__PURE__ */
|
|
2419
|
+
children: /* @__PURE__ */ jsx46("form", {
|
|
2295
2420
|
onSubmit: handleSubmit(onSubmit),
|
|
2296
2421
|
children: children
|
|
2297
2422
|
})
|
|
@@ -2300,20 +2425,24 @@ var Root3 = function(param) {
|
|
|
2300
2425
|
});
|
|
2301
2426
|
};
|
|
2302
2427
|
// src/components/threads/Thread/MessageForm/Field/index.tsx
|
|
2428
|
+
import { useFormContext as useFormContext2 } from "react-hook-form";
|
|
2429
|
+
import { Container as RadixContainer, Flex as Flex17 } from "@radix-ui/themes";
|
|
2430
|
+
// src/components/threads/Thread/MessageForm/Field/Control.tsx
|
|
2431
|
+
import { Flex as Flex14 } from "@radix-ui/themes";
|
|
2432
|
+
import { useFormContext } from "react-hook-form";
|
|
2303
2433
|
import { usePrevious } from "react-use";
|
|
2304
2434
|
import { useContext as useContext11, useMemo as useMemo9, useRef as useRef4, useEffect as useEffect3 } from "react";
|
|
2305
2435
|
// src/components/textareas/TextareaBase/index.tsx
|
|
2306
2436
|
import { forwardRef as forwardRef3 } from "react";
|
|
2307
2437
|
import TextareaAutosize from "react-textarea-autosize";
|
|
2308
|
-
import { Fragment as Fragment3, jsx as
|
|
2309
|
-
var UPSCALE_RATIO = 16 / 14;
|
|
2438
|
+
import { Fragment as Fragment3, jsx as jsx47, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2310
2439
|
var TextareaBase = forwardRef3(function TextareaBase2(props, ref) {
|
|
2311
|
-
return /* @__PURE__ */
|
|
2440
|
+
return /* @__PURE__ */ jsxs15(Fragment3, {
|
|
2312
2441
|
children: [
|
|
2313
|
-
/* @__PURE__ */
|
|
2442
|
+
/* @__PURE__ */ jsx47("style", {
|
|
2314
2443
|
children: ".superinterface-textarea { min-height: inherit; height: 30px; }\n.superinterface-textarea::placeholder { color: var(--gray-a10); }"
|
|
2315
2444
|
}),
|
|
2316
|
-
/* @__PURE__ */
|
|
2445
|
+
/* @__PURE__ */ jsx47(TextareaAutosize, _object_spread({
|
|
2317
2446
|
ref: ref,
|
|
2318
2447
|
className: "rt-reset superinterface-textarea",
|
|
2319
2448
|
style: {
|
|
@@ -2322,12 +2451,6 @@ var TextareaBase = forwardRef3(function TextareaBase2(props, ref) {
|
|
|
2322
2451
|
boxSizing: "border-box",
|
|
2323
2452
|
resize: "none",
|
|
2324
2453
|
color: "var(--gray-12)",
|
|
2325
|
-
fontSize: "".concat(14 * UPSCALE_RATIO, "px"),
|
|
2326
|
-
lineHeight: "".concat(24 * UPSCALE_RATIO, "px"),
|
|
2327
|
-
transform: "scale(".concat(1 / UPSCALE_RATIO, ")"),
|
|
2328
|
-
margin: "0 ".concat((-100 * UPSCALE_RATIO + 100) / 2, "%"),
|
|
2329
|
-
width: "".concat(100 * UPSCALE_RATIO, "%"),
|
|
2330
|
-
maxWidth: "".concat(100 * UPSCALE_RATIO, "%"),
|
|
2331
2454
|
flexGrow: 1,
|
|
2332
2455
|
display: "flex"
|
|
2333
2456
|
}
|
|
@@ -2335,40 +2458,17 @@ var TextareaBase = forwardRef3(function TextareaBase2(props, ref) {
|
|
|
2335
2458
|
]
|
|
2336
2459
|
});
|
|
2337
2460
|
});
|
|
2338
|
-
// src/components/threads/Thread/MessageForm/Field/
|
|
2339
|
-
import {
|
|
2340
|
-
|
|
2341
|
-
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2342
|
-
var Root4 = function(param) {
|
|
2461
|
+
// src/components/threads/Thread/MessageForm/Field/Control.tsx
|
|
2462
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
2463
|
+
var Root5 = function(param) {
|
|
2343
2464
|
var children = param.children;
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
children: /* @__PURE__ */ jsx45(Flex14, {
|
|
2349
|
-
direction: "column",
|
|
2350
|
-
flexShrink: "0",
|
|
2351
|
-
children: /* @__PURE__ */ jsx45(Flex14, {
|
|
2352
|
-
direction: "column",
|
|
2353
|
-
flexShrink: "0",
|
|
2354
|
-
children: /* @__PURE__ */ jsx45(Flex14, {
|
|
2355
|
-
style: _object_spread({
|
|
2356
|
-
borderRadius: "var(--radius-2)",
|
|
2357
|
-
borderWidth: "1px",
|
|
2358
|
-
borderStyle: "solid",
|
|
2359
|
-
borderColor: errors.content ? "var(--red-9)" : "var(--gray-5)"
|
|
2360
|
-
}, errors.content ? {
|
|
2361
|
-
backgroundColor: "var(--red-2)"
|
|
2362
|
-
} : {}),
|
|
2363
|
-
p: "2",
|
|
2364
|
-
pl: "4",
|
|
2365
|
-
children: children
|
|
2366
|
-
})
|
|
2367
|
-
})
|
|
2368
|
-
})
|
|
2465
|
+
return /* @__PURE__ */ jsx48(Flex14, {
|
|
2466
|
+
flexGrow: "1",
|
|
2467
|
+
pt: "4px",
|
|
2468
|
+
children: children
|
|
2369
2469
|
});
|
|
2370
2470
|
};
|
|
2371
|
-
var
|
|
2471
|
+
var Input = function() {
|
|
2372
2472
|
var assistantNameContext = useContext11(AssistantNameContext);
|
|
2373
2473
|
var register = useFormContext().register;
|
|
2374
2474
|
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
|
|
@@ -2391,7 +2491,7 @@ var Control = function() {
|
|
|
2391
2491
|
isDisabledPrevious,
|
|
2392
2492
|
textareaProps
|
|
2393
2493
|
]);
|
|
2394
|
-
return /* @__PURE__ */
|
|
2494
|
+
return /* @__PURE__ */ jsx48(TextareaBase, _object_spread_props(_object_spread({
|
|
2395
2495
|
minRows: 1,
|
|
2396
2496
|
placeholder: "Message ".concat(assistantNameContext, "..."),
|
|
2397
2497
|
disabled: isDisabled,
|
|
@@ -2410,51 +2510,348 @@ var Control = function() {
|
|
|
2410
2510
|
}
|
|
2411
2511
|
}));
|
|
2412
2512
|
};
|
|
2513
|
+
var Control = function() {
|
|
2514
|
+
return /* @__PURE__ */ jsx48(Root5, {
|
|
2515
|
+
children: /* @__PURE__ */ jsx48(Input, {})
|
|
2516
|
+
});
|
|
2517
|
+
};
|
|
2518
|
+
Control.Root = Root5;
|
|
2519
|
+
Control.Input = Input;
|
|
2520
|
+
// src/components/threads/Thread/MessageForm/Field/Files/Preview.tsx
|
|
2521
|
+
import { Flex as Flex15, Card as Card2, Spinner, Text as Text6, IconButton as IconButton2 } from "@radix-ui/themes";
|
|
2522
|
+
import { FileIcon as FileIcon2, Cross2Icon } from "@radix-ui/react-icons";
|
|
2523
|
+
import { jsx as jsx49, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2524
|
+
var Preview = function() {
|
|
2525
|
+
var _useMessageFormContext = useMessageFormContext(), files = _useMessageFormContext.files, setFiles = _useMessageFormContext.setFiles;
|
|
2526
|
+
if (!files.length) {
|
|
2527
|
+
return null;
|
|
2528
|
+
}
|
|
2529
|
+
return /* @__PURE__ */ jsx49(Flex15, {
|
|
2530
|
+
flexBasis: "100%",
|
|
2531
|
+
direction: "column",
|
|
2532
|
+
pb: "2",
|
|
2533
|
+
gap: "1",
|
|
2534
|
+
children: files.map(function(file) {
|
|
2535
|
+
return /* @__PURE__ */ jsx49(Card2, {
|
|
2536
|
+
variant: "ghost",
|
|
2537
|
+
children: /* @__PURE__ */ jsxs16(Flex15, {
|
|
2538
|
+
align: "center",
|
|
2539
|
+
justify: "between",
|
|
2540
|
+
gap: "1",
|
|
2541
|
+
children: [
|
|
2542
|
+
/* @__PURE__ */ jsxs16(Flex15, {
|
|
2543
|
+
align: "center",
|
|
2544
|
+
gap: "1",
|
|
2545
|
+
flexShrink: "1",
|
|
2546
|
+
minWidth: "0",
|
|
2547
|
+
maxWidth: "250px",
|
|
2548
|
+
children: [
|
|
2549
|
+
/* @__PURE__ */ jsx49(Flex15, {
|
|
2550
|
+
flexShrink: "0",
|
|
2551
|
+
children: /* @__PURE__ */ jsx49(Spinner, {
|
|
2552
|
+
loading: isOptimistic({
|
|
2553
|
+
id: file.id
|
|
2554
|
+
}),
|
|
2555
|
+
children: /* @__PURE__ */ jsx49(FileIcon2, {})
|
|
2556
|
+
})
|
|
2557
|
+
}),
|
|
2558
|
+
/* @__PURE__ */ jsx49(Text6, {
|
|
2559
|
+
size: "2",
|
|
2560
|
+
truncate: true,
|
|
2561
|
+
wrap: "nowrap",
|
|
2562
|
+
children: file.filename
|
|
2563
|
+
})
|
|
2564
|
+
]
|
|
2565
|
+
}),
|
|
2566
|
+
/* @__PURE__ */ jsx49(Flex15, {
|
|
2567
|
+
flexShrink: "0",
|
|
2568
|
+
children: /* @__PURE__ */ jsx49(IconButton2, {
|
|
2569
|
+
onClick: function() {
|
|
2570
|
+
return setFiles(function(prev) {
|
|
2571
|
+
return prev.filter(function(prevFile) {
|
|
2572
|
+
return prevFile.id !== file.id;
|
|
2573
|
+
});
|
|
2574
|
+
});
|
|
2575
|
+
},
|
|
2576
|
+
color: "gray",
|
|
2577
|
+
variant: "ghost",
|
|
2578
|
+
size: "1",
|
|
2579
|
+
children: /* @__PURE__ */ jsx49(Cross2Icon, {})
|
|
2580
|
+
})
|
|
2581
|
+
})
|
|
2582
|
+
]
|
|
2583
|
+
})
|
|
2584
|
+
}, file.id);
|
|
2585
|
+
})
|
|
2586
|
+
});
|
|
2587
|
+
};
|
|
2588
|
+
// src/components/threads/Thread/MessageForm/Field/Files/Control.tsx
|
|
2589
|
+
import { useCallback as useCallback2 } from "react";
|
|
2590
|
+
import dayjs2 from "dayjs";
|
|
2591
|
+
import { FilePlusIcon } from "@radix-ui/react-icons";
|
|
2592
|
+
import { IconButton as IconButton3, Flex as Flex16 } from "@radix-ui/themes";
|
|
2593
|
+
// src/hooks/files/useCreateFile/index.ts
|
|
2594
|
+
import { useMutation as useMutation2, useQueryClient as useQueryClient5 } from "@tanstack/react-query";
|
|
2595
|
+
// src/hooks/files/useCreateFile/lib/mutationOptions/mutationFn/body/formData.ts
|
|
2596
|
+
var formData = function(variables) {
|
|
2597
|
+
var data2 = new FormData();
|
|
2598
|
+
for(var key2 in variables){
|
|
2599
|
+
data2.append(key2, variables[key2]);
|
|
2600
|
+
}
|
|
2601
|
+
return data2;
|
|
2602
|
+
};
|
|
2603
|
+
// src/hooks/files/useCreateFile/lib/mutationOptions/mutationFn/body/index.ts
|
|
2604
|
+
var body2 = function(param) {
|
|
2605
|
+
var variables = param.variables, superinterfaceContext = param.superinterfaceContext;
|
|
2606
|
+
var _superinterfaceContext_threadIdCookieOptions;
|
|
2607
|
+
if (variables.threadId) return formData(variables);
|
|
2608
|
+
if (!variables.assistantId) return formData(variables);
|
|
2609
|
+
if (!((_superinterfaceContext_threadIdCookieOptions = superinterfaceContext.threadIdCookieOptions) === null || _superinterfaceContext_threadIdCookieOptions === void 0 ? void 0 : _superinterfaceContext_threadIdCookieOptions.get)) return formData(variables);
|
|
2610
|
+
var threadId = superinterfaceContext.threadIdCookieOptions.get({
|
|
2611
|
+
assistantId: variables.assistantId
|
|
2612
|
+
});
|
|
2613
|
+
if (!threadId) return formData(variables);
|
|
2614
|
+
return formData(_object_spread_props(_object_spread({}, variables), {
|
|
2615
|
+
threadId: threadId
|
|
2616
|
+
}));
|
|
2617
|
+
};
|
|
2618
|
+
// src/hooks/files/useCreateFile/lib/mutationOptions/mutationFn/index.ts
|
|
2619
|
+
var mutationFn2 = function(param) {
|
|
2620
|
+
var superinterfaceContext = param.superinterfaceContext, queryClient = param.queryClient, threadContext = param.threadContext;
|
|
2621
|
+
return function() {
|
|
2622
|
+
var _ref = _async_to_generator(function(variables) {
|
|
2623
|
+
var response, result;
|
|
2624
|
+
return _ts_generator(this, function(_state) {
|
|
2625
|
+
switch(_state.label){
|
|
2626
|
+
case 0:
|
|
2627
|
+
return [
|
|
2628
|
+
4,
|
|
2629
|
+
fetch("".concat(superinterfaceContext.baseUrl, "/files"), {
|
|
2630
|
+
method: "POST",
|
|
2631
|
+
body: body2({
|
|
2632
|
+
variables: variables,
|
|
2633
|
+
superinterfaceContext: superinterfaceContext
|
|
2634
|
+
})
|
|
2635
|
+
})
|
|
2636
|
+
];
|
|
2637
|
+
case 1:
|
|
2638
|
+
response = _state.sent();
|
|
2639
|
+
return [
|
|
2640
|
+
4,
|
|
2641
|
+
response.json()
|
|
2642
|
+
];
|
|
2643
|
+
case 2:
|
|
2644
|
+
result = _state.sent();
|
|
2645
|
+
return [
|
|
2646
|
+
2,
|
|
2647
|
+
result
|
|
2648
|
+
];
|
|
2649
|
+
}
|
|
2650
|
+
});
|
|
2651
|
+
});
|
|
2652
|
+
return function(variables) {
|
|
2653
|
+
return _ref.apply(this, arguments);
|
|
2654
|
+
};
|
|
2655
|
+
}();
|
|
2656
|
+
};
|
|
2657
|
+
// src/hooks/files/useCreateFile/lib/mutationOptions/index.ts
|
|
2658
|
+
var mutationOptions2 = function(param) {
|
|
2659
|
+
var queryClient = param.queryClient, threadContext = param.threadContext, superinterfaceContext = param.superinterfaceContext, onError = param.onError;
|
|
2660
|
+
var mutationKey = [
|
|
2661
|
+
"createFile",
|
|
2662
|
+
threadContext.variables
|
|
2663
|
+
];
|
|
2664
|
+
return _object_spread_props(_object_spread({
|
|
2665
|
+
mutationFn: mutationFn2({
|
|
2666
|
+
queryClient: queryClient,
|
|
2667
|
+
superinterfaceContext: superinterfaceContext,
|
|
2668
|
+
threadContext: threadContext
|
|
2669
|
+
}),
|
|
2670
|
+
onError: onError
|
|
2671
|
+
}, threadContext.defaultOptions.mutations, queryClient.getMutationDefaults(mutationKey)), {
|
|
2672
|
+
mutationKey: mutationKey
|
|
2673
|
+
});
|
|
2674
|
+
};
|
|
2675
|
+
// src/hooks/files/useCreateFile/index.ts
|
|
2676
|
+
var useCreateFile = function() {
|
|
2677
|
+
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
2678
|
+
onError: function() {}
|
|
2679
|
+
}, _ref_onError = _ref.onError, onError = _ref_onError === void 0 ? function() {} : _ref_onError;
|
|
2680
|
+
var queryClient = useQueryClient5();
|
|
2681
|
+
var superinterfaceContext = useSuperinterfaceContext();
|
|
2682
|
+
var threadContext = useSuperinterfaceContext();
|
|
2683
|
+
var props = useMutation2(mutationOptions2({
|
|
2684
|
+
queryClient: queryClient,
|
|
2685
|
+
threadContext: threadContext,
|
|
2686
|
+
superinterfaceContext: superinterfaceContext,
|
|
2687
|
+
onError: onError
|
|
2688
|
+
}));
|
|
2689
|
+
return _object_spread_props(_object_spread({}, props), {
|
|
2690
|
+
createFile: function() {
|
|
2691
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
2692
|
+
args[_key] = arguments[_key];
|
|
2693
|
+
}
|
|
2694
|
+
var _props;
|
|
2695
|
+
var _args = _to_array(args), firstArg = _args[0], restArgs = _args.slice(1);
|
|
2696
|
+
return (_props = props).mutateAsync.apply(_props, [
|
|
2697
|
+
_object_spread({}, threadContext.variables, firstArg)
|
|
2698
|
+
].concat(_to_consumable_array(restArgs)));
|
|
2699
|
+
}
|
|
2700
|
+
});
|
|
2701
|
+
};
|
|
2702
|
+
// src/components/threads/Thread/MessageForm/Field/Files/Control.tsx
|
|
2703
|
+
import { jsx as jsx50, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2704
|
+
var accept = ".c,text/x-c,\n.cs,text/x-csharp,\n.cpp,text/x-c++,\n.doc,application/msword,\n.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document,\n.html,text/html,\n.java,text/x-java,\n.json,application/json,\n.md,text/markdown,\n.pdf,application/pdf,\n.php,text/x-php,\n.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation,\n.py,text/x-python,\n.py,text/x-script.python,\n.rb,text/x-ruby,\n.tex,text/x-tex,\n.txt,text/plain,\n.css,text/css,\n.js,text/javascript,\n.sh,application/x-sh,\n.ts,application/typescript";
|
|
2705
|
+
var Control2 = function() {
|
|
2706
|
+
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading, setFiles = _useMessageFormContext.setFiles;
|
|
2707
|
+
var createFile = useCreateFile().createFile;
|
|
2708
|
+
var addToast = useToasts().addToast;
|
|
2709
|
+
var onChange = useCallback2(function(event) {
|
|
2710
|
+
var files = event.target.files;
|
|
2711
|
+
if (!files) return;
|
|
2712
|
+
var newFiles = Array.from(files).map(function(file) {
|
|
2713
|
+
var id = optimisticId();
|
|
2714
|
+
createFile({
|
|
2715
|
+
file: file
|
|
2716
|
+
}, {
|
|
2717
|
+
onSuccess: function(param) {
|
|
2718
|
+
var file2 = param.file;
|
|
2719
|
+
setFiles(function(prev) {
|
|
2720
|
+
return _to_consumable_array(prev.filter(function(prevFile) {
|
|
2721
|
+
return prevFile.id !== id;
|
|
2722
|
+
})).concat([
|
|
2723
|
+
file2
|
|
2724
|
+
]);
|
|
2725
|
+
});
|
|
2726
|
+
},
|
|
2727
|
+
onError: function() {
|
|
2728
|
+
addToast({
|
|
2729
|
+
type: "error",
|
|
2730
|
+
message: "Could not upload file. Please try again."
|
|
2731
|
+
});
|
|
2732
|
+
setFiles(function(prev) {
|
|
2733
|
+
return prev.filter(function(prevFile) {
|
|
2734
|
+
return prevFile.id !== id;
|
|
2735
|
+
});
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2738
|
+
});
|
|
2739
|
+
return {
|
|
2740
|
+
id: id,
|
|
2741
|
+
filename: file.name,
|
|
2742
|
+
object: "file",
|
|
2743
|
+
purpose: "assistants",
|
|
2744
|
+
created_at: dayjs2().unix(),
|
|
2745
|
+
bytes: file.size,
|
|
2746
|
+
status: "processed"
|
|
2747
|
+
};
|
|
2748
|
+
});
|
|
2749
|
+
setFiles(function(prev) {
|
|
2750
|
+
return _to_consumable_array(prev).concat(_to_consumable_array(newFiles));
|
|
2751
|
+
});
|
|
2752
|
+
}, []);
|
|
2753
|
+
return /* @__PURE__ */ jsx50(Flex16, {
|
|
2754
|
+
pt: "2",
|
|
2755
|
+
pr: "2",
|
|
2756
|
+
flexGrow: "0",
|
|
2757
|
+
children: /* @__PURE__ */ jsxs17(IconButton3, {
|
|
2758
|
+
type: "button",
|
|
2759
|
+
variant: "ghost",
|
|
2760
|
+
color: "gray",
|
|
2761
|
+
disabled: isDisabled || isLoading,
|
|
2762
|
+
style: {
|
|
2763
|
+
position: "relative",
|
|
2764
|
+
overflow: "hidden"
|
|
2765
|
+
},
|
|
2766
|
+
children: [
|
|
2767
|
+
/* @__PURE__ */ jsx50(FilePlusIcon, {}),
|
|
2768
|
+
/* @__PURE__ */ jsx50("input", {
|
|
2769
|
+
type: "file",
|
|
2770
|
+
accept: accept,
|
|
2771
|
+
onChange: onChange,
|
|
2772
|
+
style: {
|
|
2773
|
+
cursor: "pointer",
|
|
2774
|
+
position: "absolute",
|
|
2775
|
+
top: 0,
|
|
2776
|
+
left: 0,
|
|
2777
|
+
right: 0,
|
|
2778
|
+
bottom: 0,
|
|
2779
|
+
opacity: 0
|
|
2780
|
+
}
|
|
2781
|
+
})
|
|
2782
|
+
]
|
|
2783
|
+
})
|
|
2784
|
+
});
|
|
2785
|
+
};
|
|
2786
|
+
// src/components/threads/Thread/MessageForm/Field/Files/index.tsx
|
|
2787
|
+
var Files = {
|
|
2788
|
+
Preview: Preview,
|
|
2789
|
+
Control: Control2
|
|
2790
|
+
};
|
|
2791
|
+
// src/components/threads/Thread/MessageForm/Field/index.tsx
|
|
2792
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2793
|
+
var Root6 = function(param) {
|
|
2794
|
+
var children = param.children;
|
|
2795
|
+
var _useFormContext2 = useFormContext2(), errors = _useFormContext2.formState.errors;
|
|
2796
|
+
return /* @__PURE__ */ jsx51(RadixContainer, {
|
|
2797
|
+
size: "2",
|
|
2798
|
+
flexGrow: "0",
|
|
2799
|
+
children: /* @__PURE__ */ jsx51(Flex17, {
|
|
2800
|
+
direction: "column",
|
|
2801
|
+
flexShrink: "0",
|
|
2802
|
+
children: /* @__PURE__ */ jsx51(Flex17, {
|
|
2803
|
+
direction: "column",
|
|
2804
|
+
flexShrink: "0",
|
|
2805
|
+
children: /* @__PURE__ */ jsx51(Flex17, {
|
|
2806
|
+
style: _object_spread({
|
|
2807
|
+
borderRadius: "var(--radius-2)",
|
|
2808
|
+
borderWidth: "1px",
|
|
2809
|
+
borderStyle: "solid",
|
|
2810
|
+
borderColor: errors.content ? "var(--red-9)" : "var(--gray-5)"
|
|
2811
|
+
}, errors.content ? {
|
|
2812
|
+
backgroundColor: "var(--red-2)"
|
|
2813
|
+
} : {}),
|
|
2814
|
+
p: "2",
|
|
2815
|
+
pl: "3",
|
|
2816
|
+
wrap: "wrap",
|
|
2817
|
+
children: children
|
|
2818
|
+
})
|
|
2819
|
+
})
|
|
2820
|
+
})
|
|
2821
|
+
});
|
|
2822
|
+
};
|
|
2413
2823
|
var Field = {
|
|
2414
|
-
Root:
|
|
2415
|
-
Control: Control
|
|
2824
|
+
Root: Root6,
|
|
2825
|
+
Control: Control,
|
|
2826
|
+
Files: Files
|
|
2416
2827
|
};
|
|
2417
2828
|
// src/components/threads/Thread/MessageForm/index.tsx
|
|
2418
|
-
import { jsx as
|
|
2829
|
+
import { jsx as jsx52, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2419
2830
|
var MessageForm = function() {
|
|
2420
|
-
return /* @__PURE__ */
|
|
2421
|
-
children: /* @__PURE__ */
|
|
2831
|
+
return /* @__PURE__ */ jsx52(Root4, {
|
|
2832
|
+
children: /* @__PURE__ */ jsxs18(Field.Root, {
|
|
2422
2833
|
children: [
|
|
2423
|
-
/* @__PURE__ */
|
|
2424
|
-
|
|
2425
|
-
style: {
|
|
2426
|
-
flexGrow: 1
|
|
2427
|
-
},
|
|
2428
|
-
children: /* @__PURE__ */ jsx46(Flex15, {
|
|
2429
|
-
flexGrow: "1",
|
|
2430
|
-
direction: "column",
|
|
2431
|
-
children: /* @__PURE__ */ jsx46(Field.Control, {})
|
|
2432
|
-
})
|
|
2433
|
-
}),
|
|
2434
|
-
/* @__PURE__ */ jsx46(Flex15, {
|
|
2435
|
-
flexShrink: "0",
|
|
2436
|
-
align: "end",
|
|
2437
|
-
children: /* @__PURE__ */ jsx46(Submit, {})
|
|
2438
|
-
})
|
|
2834
|
+
/* @__PURE__ */ jsx52(Field.Control, {}),
|
|
2835
|
+
/* @__PURE__ */ jsx52(Submit, {})
|
|
2439
2836
|
]
|
|
2440
2837
|
})
|
|
2441
2838
|
});
|
|
2442
2839
|
};
|
|
2443
|
-
MessageForm.Root =
|
|
2840
|
+
MessageForm.Root = Root4;
|
|
2444
2841
|
MessageForm.Field = Field;
|
|
2445
2842
|
MessageForm.Submit = Submit;
|
|
2446
2843
|
// src/components/threads/Thread/Root/index.tsx
|
|
2447
|
-
import { Flex as
|
|
2844
|
+
import { Flex as Flex18 } from "@radix-ui/themes";
|
|
2448
2845
|
// src/components/threads/Thread/Provider/index.tsx
|
|
2449
2846
|
var Provider2 = SuperinterfaceProvider;
|
|
2450
2847
|
// src/components/threads/Thread/Root/index.tsx
|
|
2451
|
-
import { jsx as
|
|
2452
|
-
var
|
|
2848
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2849
|
+
var Root7 = function(_param) {
|
|
2453
2850
|
var children = _param.children, rest = _object_without_properties(_param, [
|
|
2454
2851
|
"children"
|
|
2455
2852
|
]);
|
|
2456
|
-
return /* @__PURE__ */
|
|
2457
|
-
children: /* @__PURE__ */
|
|
2853
|
+
return /* @__PURE__ */ jsx53(Provider2, _object_spread_props(_object_spread({}, rest), {
|
|
2854
|
+
children: /* @__PURE__ */ jsx53(Flex18, {
|
|
2458
2855
|
direction: "column",
|
|
2459
2856
|
flexGrow: "1",
|
|
2460
2857
|
children: children
|
|
@@ -2462,16 +2859,16 @@ var Root5 = function(_param) {
|
|
|
2462
2859
|
}));
|
|
2463
2860
|
};
|
|
2464
2861
|
// src/components/threads/Thread/index.tsx
|
|
2465
|
-
import { jsx as
|
|
2862
|
+
import { jsx as jsx54, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2466
2863
|
var Thread = function(props) {
|
|
2467
|
-
return /* @__PURE__ */
|
|
2864
|
+
return /* @__PURE__ */ jsxs19(Root7, _object_spread_props(_object_spread({}, props), {
|
|
2468
2865
|
children: [
|
|
2469
|
-
/* @__PURE__ */
|
|
2470
|
-
/* @__PURE__ */
|
|
2866
|
+
/* @__PURE__ */ jsx54(Messages, {}),
|
|
2867
|
+
/* @__PURE__ */ jsx54(MessageForm, {})
|
|
2471
2868
|
]
|
|
2472
2869
|
}));
|
|
2473
2870
|
};
|
|
2474
|
-
Thread.Root =
|
|
2871
|
+
Thread.Root = Root7;
|
|
2475
2872
|
Thread.Messages = Messages;
|
|
2476
2873
|
Thread.MessageForm = MessageForm;
|
|
2477
2874
|
// src/hooks/messages/useMessageContext/index.ts
|
|
@@ -2480,7 +2877,7 @@ var useMessageContext = function() {
|
|
|
2480
2877
|
return useContext12(MessageContext);
|
|
2481
2878
|
};
|
|
2482
2879
|
// src/components/threads/ThreadDialog/Provider/index.tsx
|
|
2483
|
-
import { useState } from "react";
|
|
2880
|
+
import { useState as useState2 } from "react";
|
|
2484
2881
|
// src/contexts/threads/ThreadDialogContext/index.ts
|
|
2485
2882
|
import { createContext as createContext11 } from "react";
|
|
2486
2883
|
var ThreadDialogContext = createContext11({
|
|
@@ -2493,12 +2890,12 @@ var useThreadDialogContext = function() {
|
|
|
2493
2890
|
return useContext13(ThreadDialogContext);
|
|
2494
2891
|
};
|
|
2495
2892
|
// src/components/threads/ThreadDialog/Provider/index.tsx
|
|
2496
|
-
import { jsx as
|
|
2893
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2497
2894
|
var Provider3 = function(param) {
|
|
2498
2895
|
var children = param.children;
|
|
2499
2896
|
var threadDialogContext = useThreadDialogContext();
|
|
2500
|
-
var
|
|
2501
|
-
return /* @__PURE__ */
|
|
2897
|
+
var _useState2 = _sliced_to_array(useState2(threadDialogContext.isOpen), 2), isOpen = _useState2[0], setIsOpen = _useState2[1];
|
|
2898
|
+
return /* @__PURE__ */ jsx55(ThreadDialogContext.Provider, {
|
|
2502
2899
|
value: {
|
|
2503
2900
|
isOpen: isOpen,
|
|
2504
2901
|
setIsOpen: setIsOpen
|
|
@@ -2507,31 +2904,31 @@ var Provider3 = function(param) {
|
|
|
2507
2904
|
});
|
|
2508
2905
|
};
|
|
2509
2906
|
// src/components/toasts/ToastsProvider/index.tsx
|
|
2510
|
-
import { useState as
|
|
2907
|
+
import { useState as useState3, useCallback as useCallback3 } from "react";
|
|
2511
2908
|
import * as Toast2 from "@radix-ui/react-toast";
|
|
2512
2909
|
// src/components/toasts/ToastsProvider/CustomToast.tsx
|
|
2513
2910
|
import * as Toast from "@radix-ui/react-toast";
|
|
2514
|
-
import { Card, Text as
|
|
2911
|
+
import { Card as Card3, Text as Text7, Flex as Flex19 } from "@radix-ui/themes";
|
|
2515
2912
|
import { CheckCircledIcon as CheckCircledIcon2, CrossCircledIcon } from "@radix-ui/react-icons";
|
|
2516
|
-
import { jsx as
|
|
2913
|
+
import { jsx as jsx56, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2517
2914
|
var CustomToast = function(param) {
|
|
2518
2915
|
var toast = param.toast;
|
|
2519
|
-
return /* @__PURE__ */
|
|
2520
|
-
children: /* @__PURE__ */
|
|
2521
|
-
children: /* @__PURE__ */
|
|
2522
|
-
children: /* @__PURE__ */
|
|
2916
|
+
return /* @__PURE__ */ jsx56(Toast.Root, {
|
|
2917
|
+
children: /* @__PURE__ */ jsx56(Card3, {
|
|
2918
|
+
children: /* @__PURE__ */ jsx56(Toast.Title, {
|
|
2919
|
+
children: /* @__PURE__ */ jsxs20(Flex19, {
|
|
2523
2920
|
children: [
|
|
2524
|
-
/* @__PURE__ */
|
|
2921
|
+
/* @__PURE__ */ jsx56(Flex19, {
|
|
2525
2922
|
pr: "2",
|
|
2526
2923
|
height: "14px",
|
|
2527
2924
|
align: "center",
|
|
2528
|
-
children: toast.type === "success" ? /* @__PURE__ */
|
|
2925
|
+
children: toast.type === "success" ? /* @__PURE__ */ jsx56(CheckCircledIcon2, {
|
|
2529
2926
|
color: "var(--accent-9)"
|
|
2530
|
-
}) : /* @__PURE__ */
|
|
2927
|
+
}) : /* @__PURE__ */ jsx56(CrossCircledIcon, {
|
|
2531
2928
|
color: "var(--red-9)"
|
|
2532
2929
|
})
|
|
2533
2930
|
}),
|
|
2534
|
-
/* @__PURE__ */
|
|
2931
|
+
/* @__PURE__ */ jsx56(Text7, {
|
|
2535
2932
|
weight: "medium",
|
|
2536
2933
|
size: "1",
|
|
2537
2934
|
children: toast.message
|
|
@@ -2543,31 +2940,31 @@ var CustomToast = function(param) {
|
|
|
2543
2940
|
});
|
|
2544
2941
|
};
|
|
2545
2942
|
// src/components/toasts/ToastsProvider/index.tsx
|
|
2546
|
-
import { jsx as
|
|
2943
|
+
import { jsx as jsx57, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2547
2944
|
var ToastsProvider = function(param) {
|
|
2548
2945
|
var children = param.children;
|
|
2549
|
-
var
|
|
2550
|
-
var addToast =
|
|
2946
|
+
var _useState3 = _sliced_to_array(useState3([]), 2), toasts = _useState3[0], setToasts = _useState3[1];
|
|
2947
|
+
var addToast = useCallback3(function(toast) {
|
|
2551
2948
|
return setToasts(function(prevToasts) {
|
|
2552
2949
|
return _to_consumable_array(prevToasts).concat([
|
|
2553
2950
|
toast
|
|
2554
2951
|
]);
|
|
2555
2952
|
});
|
|
2556
2953
|
}, []);
|
|
2557
|
-
return /* @__PURE__ */
|
|
2954
|
+
return /* @__PURE__ */ jsx57(ToastsContext.Provider, {
|
|
2558
2955
|
value: {
|
|
2559
2956
|
toasts: toasts,
|
|
2560
2957
|
addToast: addToast
|
|
2561
2958
|
},
|
|
2562
|
-
children: /* @__PURE__ */
|
|
2959
|
+
children: /* @__PURE__ */ jsxs21(Toast2.Provider, {
|
|
2563
2960
|
children: [
|
|
2564
2961
|
children,
|
|
2565
2962
|
Array.from(toasts).map(function(toast, index) {
|
|
2566
|
-
return /* @__PURE__ */
|
|
2963
|
+
return /* @__PURE__ */ jsx57(CustomToast, {
|
|
2567
2964
|
toast: toast
|
|
2568
2965
|
}, index);
|
|
2569
2966
|
}),
|
|
2570
|
-
/* @__PURE__ */
|
|
2967
|
+
/* @__PURE__ */ jsx57(Toast2.Viewport, {
|
|
2571
2968
|
style: {
|
|
2572
2969
|
position: "absolute",
|
|
2573
2970
|
bottom: 0,
|
|
@@ -2589,22 +2986,34 @@ var ToastsProvider = function(param) {
|
|
|
2589
2986
|
});
|
|
2590
2987
|
};
|
|
2591
2988
|
// src/components/threads/ThreadDialog/Root/index.tsx
|
|
2592
|
-
import { jsx as
|
|
2593
|
-
var
|
|
2989
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
2990
|
+
var Root9 = function(param) {
|
|
2594
2991
|
var children = param.children;
|
|
2595
|
-
return /* @__PURE__ */
|
|
2596
|
-
children: /* @__PURE__ */
|
|
2992
|
+
return /* @__PURE__ */ jsx58(ToastsProvider, {
|
|
2993
|
+
children: /* @__PURE__ */ jsx58(Provider3, {
|
|
2597
2994
|
children: children
|
|
2598
2995
|
})
|
|
2599
2996
|
});
|
|
2600
2997
|
};
|
|
2601
2998
|
// src/components/threads/ThreadDialog/Trigger/index.tsx
|
|
2602
|
-
import { Flex as
|
|
2603
|
-
|
|
2604
|
-
|
|
2999
|
+
import { Flex as Flex20 } from "@radix-ui/themes";
|
|
3000
|
+
// src/components/threads/ThreadDialog/Trigger/Button.tsx
|
|
3001
|
+
import { IconButton as IconButton4 } from "@radix-ui/themes";
|
|
3002
|
+
import { ChatBubbleIcon } from "@radix-ui/react-icons";
|
|
3003
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
3004
|
+
var Button3 = function() {
|
|
3005
|
+
return /* @__PURE__ */ jsx59(IconButton4, {
|
|
3006
|
+
size: "4",
|
|
3007
|
+
radius: "full",
|
|
3008
|
+
children: /* @__PURE__ */ jsx59(ChatBubbleIcon, {})
|
|
3009
|
+
});
|
|
3010
|
+
};
|
|
3011
|
+
// src/components/threads/ThreadDialog/Trigger/index.tsx
|
|
3012
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
3013
|
+
var Root10 = function(param) {
|
|
2605
3014
|
var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
2606
3015
|
var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
|
|
2607
|
-
return /* @__PURE__ */
|
|
3016
|
+
return /* @__PURE__ */ jsx60(Flex20, {
|
|
2608
3017
|
display: {
|
|
2609
3018
|
initial: isOpen ? "none" : "flex",
|
|
2610
3019
|
sm: "flex"
|
|
@@ -2627,26 +3036,22 @@ var Trigger = function(param) {
|
|
|
2627
3036
|
children: children
|
|
2628
3037
|
});
|
|
2629
3038
|
};
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
var Button2 = function() {
|
|
2635
|
-
return /* @__PURE__ */ jsx54(IconButton2, {
|
|
2636
|
-
size: "4",
|
|
2637
|
-
radius: "full",
|
|
2638
|
-
children: /* @__PURE__ */ jsx54(ChatBubbleIcon, {})
|
|
2639
|
-
});
|
|
3039
|
+
var Trigger = function(args) {
|
|
3040
|
+
return /* @__PURE__ */ jsx60(Root10, _object_spread_props(_object_spread({}, args), {
|
|
3041
|
+
children: /* @__PURE__ */ jsx60(Button3, {})
|
|
3042
|
+
}));
|
|
2640
3043
|
};
|
|
3044
|
+
Trigger.Root = Root10;
|
|
3045
|
+
Trigger.Button = Button3;
|
|
2641
3046
|
// src/components/threads/ThreadDialog/Content/index.tsx
|
|
2642
|
-
import { Card as
|
|
3047
|
+
import { Card as Card4, Inset, Flex as Flex22 } from "@radix-ui/themes";
|
|
2643
3048
|
// src/components/threads/ThreadDialog/Close/index.tsx
|
|
2644
3049
|
import { Cross1Icon } from "@radix-ui/react-icons";
|
|
2645
|
-
import { IconButton as
|
|
2646
|
-
import { jsx as
|
|
3050
|
+
import { IconButton as IconButton5, Flex as Flex21 } from "@radix-ui/themes";
|
|
3051
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
2647
3052
|
var Close = function() {
|
|
2648
3053
|
var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
|
|
2649
|
-
return /* @__PURE__ */
|
|
3054
|
+
return /* @__PURE__ */ jsx61(Flex21, {
|
|
2650
3055
|
display: {
|
|
2651
3056
|
initial: isOpen ? "flex" : "none",
|
|
2652
3057
|
sm: "none"
|
|
@@ -2666,20 +3071,20 @@ var Close = function() {
|
|
|
2666
3071
|
style: {
|
|
2667
3072
|
zIndex: 9999999999
|
|
2668
3073
|
},
|
|
2669
|
-
children: /* @__PURE__ */
|
|
3074
|
+
children: /* @__PURE__ */ jsx61(IconButton5, {
|
|
2670
3075
|
size: "2",
|
|
2671
3076
|
variant: "soft",
|
|
2672
|
-
children: /* @__PURE__ */
|
|
3077
|
+
children: /* @__PURE__ */ jsx61(Cross1Icon, {})
|
|
2673
3078
|
})
|
|
2674
3079
|
});
|
|
2675
3080
|
};
|
|
2676
3081
|
// src/components/threads/ThreadDialog/Content/index.tsx
|
|
2677
|
-
import { jsx as
|
|
2678
|
-
var
|
|
3082
|
+
import { jsx as jsx62, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3083
|
+
var Root11 = function(param) {
|
|
2679
3084
|
var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
2680
3085
|
var isOpen = useThreadDialogContext().isOpen;
|
|
2681
3086
|
if (!isOpen) return null;
|
|
2682
|
-
return /* @__PURE__ */
|
|
3087
|
+
return /* @__PURE__ */ jsx62(Flex22, {
|
|
2683
3088
|
direction: "column",
|
|
2684
3089
|
justify: "end",
|
|
2685
3090
|
position: "fixed",
|
|
@@ -2707,7 +3112,7 @@ var Root8 = function(param) {
|
|
|
2707
3112
|
style: _object_spread({
|
|
2708
3113
|
zIndex: 9999999999
|
|
2709
3114
|
}, style),
|
|
2710
|
-
children: /* @__PURE__ */
|
|
3115
|
+
children: /* @__PURE__ */ jsxs22(Card4, {
|
|
2711
3116
|
mb: {
|
|
2712
3117
|
initial: void 0,
|
|
2713
3118
|
sm: "3"
|
|
@@ -2718,7 +3123,7 @@ var Root8 = function(param) {
|
|
|
2718
3123
|
flexGrow: 1
|
|
2719
3124
|
},
|
|
2720
3125
|
children: [
|
|
2721
|
-
/* @__PURE__ */
|
|
3126
|
+
/* @__PURE__ */ jsx62(Inset, {
|
|
2722
3127
|
clip: "padding-box",
|
|
2723
3128
|
side: "all",
|
|
2724
3129
|
pb: "current",
|
|
@@ -2728,56 +3133,64 @@ var Root8 = function(param) {
|
|
|
2728
3133
|
},
|
|
2729
3134
|
children: children
|
|
2730
3135
|
}),
|
|
2731
|
-
/* @__PURE__ */
|
|
3136
|
+
/* @__PURE__ */ jsx62(Close, {})
|
|
2732
3137
|
]
|
|
2733
3138
|
})
|
|
2734
3139
|
});
|
|
2735
3140
|
};
|
|
3141
|
+
var Messages2 = function() {
|
|
3142
|
+
return /* @__PURE__ */ jsx62(Thread.Messages, {
|
|
3143
|
+
style: {
|
|
3144
|
+
paddingTop: "var(--space-5)",
|
|
3145
|
+
paddingRight: "var(--space-5)",
|
|
3146
|
+
paddingLeft: "var(--space-5)"
|
|
3147
|
+
}
|
|
3148
|
+
});
|
|
3149
|
+
};
|
|
3150
|
+
var FormContainer = function(param) {
|
|
3151
|
+
var children = param.children;
|
|
3152
|
+
return /* @__PURE__ */ jsx62(Flex22, {
|
|
3153
|
+
direction: "column",
|
|
3154
|
+
pl: "5",
|
|
3155
|
+
pr: "5",
|
|
3156
|
+
pb: "3",
|
|
3157
|
+
flexShrink: "0",
|
|
3158
|
+
children: children
|
|
3159
|
+
});
|
|
3160
|
+
};
|
|
2736
3161
|
var Content4 = function(param) {
|
|
2737
3162
|
var _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
|
|
2738
|
-
return /* @__PURE__ */
|
|
3163
|
+
return /* @__PURE__ */ jsx62(Root11, {
|
|
2739
3164
|
style: style,
|
|
2740
|
-
children: /* @__PURE__ */
|
|
3165
|
+
children: /* @__PURE__ */ jsxs22(Thread.Root, {
|
|
2741
3166
|
children: [
|
|
2742
|
-
/* @__PURE__ */
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
paddingRight: "var(--space-5)",
|
|
2746
|
-
paddingLeft: "var(--space-5)"
|
|
2747
|
-
}
|
|
2748
|
-
}),
|
|
2749
|
-
/* @__PURE__ */ jsx56(Flex20, {
|
|
2750
|
-
direction: "column",
|
|
2751
|
-
pl: "5",
|
|
2752
|
-
pr: "5",
|
|
2753
|
-
pb: "3",
|
|
2754
|
-
flexShrink: "0",
|
|
2755
|
-
children: /* @__PURE__ */ jsx56(Thread.MessageForm, {})
|
|
3167
|
+
/* @__PURE__ */ jsx62(Messages2, {}),
|
|
3168
|
+
/* @__PURE__ */ jsx62(FormContainer, {
|
|
3169
|
+
children: /* @__PURE__ */ jsx62(Thread.MessageForm, {})
|
|
2756
3170
|
})
|
|
2757
3171
|
]
|
|
2758
3172
|
})
|
|
2759
3173
|
});
|
|
2760
3174
|
};
|
|
2761
|
-
Content4.Root =
|
|
3175
|
+
Content4.Root = Root11;
|
|
3176
|
+
Content4.Messages = Messages2;
|
|
3177
|
+
Content4.FormContainer = FormContainer;
|
|
2762
3178
|
// src/components/threads/ThreadDialog/index.tsx
|
|
2763
|
-
import { jsx as
|
|
3179
|
+
import { jsx as jsx63, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2764
3180
|
var ThreadDialog = function() {
|
|
2765
|
-
return /* @__PURE__ */
|
|
3181
|
+
return /* @__PURE__ */ jsxs23(Root9, {
|
|
2766
3182
|
children: [
|
|
2767
|
-
/* @__PURE__ */
|
|
2768
|
-
/* @__PURE__ */
|
|
2769
|
-
children: /* @__PURE__ */ jsx57(Button2, {})
|
|
2770
|
-
})
|
|
3183
|
+
/* @__PURE__ */ jsx63(Content4, {}),
|
|
3184
|
+
/* @__PURE__ */ jsx63(Trigger, {})
|
|
2771
3185
|
]
|
|
2772
3186
|
});
|
|
2773
3187
|
};
|
|
2774
|
-
ThreadDialog.Root =
|
|
3188
|
+
ThreadDialog.Root = Root9;
|
|
2775
3189
|
ThreadDialog.Trigger = Trigger;
|
|
2776
|
-
ThreadDialog.Button = Button2;
|
|
2777
3190
|
ThreadDialog.Content = Content4;
|
|
2778
3191
|
// src/components/threads/AudioThread/Root/index.tsx
|
|
2779
3192
|
import "regenerator-runtime/runtime";
|
|
2780
|
-
import { Flex as
|
|
3193
|
+
import { Flex as Flex23 } from "@radix-ui/themes";
|
|
2781
3194
|
// src/contexts/threads/AudioThreadContext/index.ts
|
|
2782
3195
|
import { createContext as createContext12 } from "react";
|
|
2783
3196
|
var AudioThreadContext = createContext12({
|
|
@@ -2874,20 +3287,20 @@ var useStatus = function(param) {
|
|
|
2874
3287
|
};
|
|
2875
3288
|
};
|
|
2876
3289
|
// src/hooks/audioThreads/useRecorder/index.ts
|
|
2877
|
-
import
|
|
3290
|
+
import dayjs3 from "dayjs";
|
|
2878
3291
|
import { useAudioCapture } from "use-audio-capture";
|
|
2879
|
-
import { useMemo as useMemo11, useRef as useRef5, useState as
|
|
3292
|
+
import { useMemo as useMemo11, useRef as useRef5, useState as useState4, useCallback as useCallback4, useEffect as useEffect4 } from "react";
|
|
2880
3293
|
import { useAudioPlayer } from "react-use-audio-player";
|
|
2881
3294
|
import { useInterval } from "react-use";
|
|
2882
3295
|
var useRecorder = function(param) {
|
|
2883
3296
|
var isStopOnSilence = param.isStopOnSilence, onStart = param.onStart, onStop = param.onStop;
|
|
2884
|
-
var
|
|
2885
|
-
var
|
|
2886
|
-
var
|
|
2887
|
-
var
|
|
3297
|
+
var _useState4 = _sliced_to_array(useState4(null), 2), silenceStart = _useState4[0], setSilenceStart = _useState4[1];
|
|
3298
|
+
var _useState41 = _sliced_to_array(useState4(null), 2), noiseStart = _useState41[0], setNoiseStart = _useState41[1];
|
|
3299
|
+
var _useState42 = _sliced_to_array(useState4(null), 2), mediaStream = _useState42[0], setMediaStream = _useState42[1];
|
|
3300
|
+
var _useState43 = _sliced_to_array(useState4("idle"), 2), status = _useState43[0], setStatus = _useState43[1];
|
|
2888
3301
|
var startAudioPlayer = useAudioPlayer();
|
|
2889
3302
|
var endAudioPlayer = useAudioPlayer();
|
|
2890
|
-
var
|
|
3303
|
+
var _useState44 = _sliced_to_array(useState4(false), 2), isLoaded = _useState44[0], setIsLoaded = _useState44[1];
|
|
2891
3304
|
useEffect4(function() {
|
|
2892
3305
|
if (isLoaded) return;
|
|
2893
3306
|
setIsLoaded(true);
|
|
@@ -2946,7 +3359,7 @@ var useRecorder = function(param) {
|
|
|
2946
3359
|
setNoiseStart(null);
|
|
2947
3360
|
}
|
|
2948
3361
|
});
|
|
2949
|
-
var
|
|
3362
|
+
var _useState45 = _sliced_to_array(useState4(null), 2), audioEngine = _useState45[0], setAudioEngine = _useState45[1];
|
|
2950
3363
|
var isInited = useRef5(false);
|
|
2951
3364
|
useEffect4(function() {
|
|
2952
3365
|
if (!mediaStream) return;
|
|
@@ -2978,7 +3391,7 @@ var useRecorder = function(param) {
|
|
|
2978
3391
|
}, [
|
|
2979
3392
|
audioEngine
|
|
2980
3393
|
]);
|
|
2981
|
-
var handleSilence =
|
|
3394
|
+
var handleSilence = useCallback4(function() {
|
|
2982
3395
|
if (!silenceAnalyser) return;
|
|
2983
3396
|
var frequencyData = new Uint8Array(silenceAnalyser.frequencyBinCount);
|
|
2984
3397
|
silenceAnalyser.getByteFrequencyData(frequencyData);
|
|
@@ -2986,12 +3399,12 @@ var useRecorder = function(param) {
|
|
|
2986
3399
|
return f === 0;
|
|
2987
3400
|
});
|
|
2988
3401
|
setSilenceStart(function(silenceStart2) {
|
|
2989
|
-
if (isSilent) return silenceStart2 ||
|
|
3402
|
+
if (isSilent) return silenceStart2 || dayjs3();
|
|
2990
3403
|
return null;
|
|
2991
3404
|
});
|
|
2992
3405
|
setNoiseStart(function(noiseStart2) {
|
|
2993
3406
|
if (isSilent) return noiseStart2;
|
|
2994
|
-
return noiseStart2 ||
|
|
3407
|
+
return noiseStart2 || dayjs3();
|
|
2995
3408
|
});
|
|
2996
3409
|
requestAnimationFrame(function() {
|
|
2997
3410
|
return handleSilence();
|
|
@@ -3015,7 +3428,7 @@ var useRecorder = function(param) {
|
|
|
3015
3428
|
if (status !== "recording") return;
|
|
3016
3429
|
if (!silenceStart) return;
|
|
3017
3430
|
if (!noiseStart) return;
|
|
3018
|
-
if (!silenceStart.isBefore(
|
|
3431
|
+
if (!silenceStart.isBefore(dayjs3().subtract(1.5, "second"))) return;
|
|
3019
3432
|
audioCaptureProps.stop();
|
|
3020
3433
|
}, 300);
|
|
3021
3434
|
return _object_spread_props(_object_spread({}, audioCaptureProps), {
|
|
@@ -3024,7 +3437,7 @@ var useRecorder = function(param) {
|
|
|
3024
3437
|
});
|
|
3025
3438
|
};
|
|
3026
3439
|
// src/hooks/audioThreads/useMessageAudio/index.ts
|
|
3027
|
-
import { useMemo as useMemo12, useRef as useRef6, useState as
|
|
3440
|
+
import { useMemo as useMemo12, useRef as useRef6, useState as useState5, useEffect as useEffect5 } from "react";
|
|
3028
3441
|
import nlp from "compromise";
|
|
3029
3442
|
import { Howler } from "howler";
|
|
3030
3443
|
import { useAudioPlayer as useAudioPlayer2 } from "react-use-audio-player";
|
|
@@ -3062,13 +3475,13 @@ var getMessageSentences = function(param) {
|
|
|
3062
3475
|
};
|
|
3063
3476
|
var useMessageAudio = function(param) {
|
|
3064
3477
|
var onEnd = param.onEnd;
|
|
3065
|
-
var
|
|
3066
|
-
var
|
|
3067
|
-
var
|
|
3478
|
+
var _useState5 = _sliced_to_array(useState5(false), 2), isAudioPlayed = _useState5[0], setIsAudioPlayed = _useState5[1];
|
|
3479
|
+
var _useState51 = _sliced_to_array(useState5([]), 2), stoppedMessageIds = _useState51[0], setStoppedMessageIds = _useState51[1];
|
|
3480
|
+
var _useState52 = _sliced_to_array(useState5([]), 2), playedMessageSentences = _useState52[0], setPlayedMessageSentences = _useState52[1];
|
|
3068
3481
|
var audioPlayer = useAudioPlayer2();
|
|
3069
3482
|
var nextAudioPlayer = useAudioPlayer2();
|
|
3070
3483
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
3071
|
-
var
|
|
3484
|
+
var _useState53 = _sliced_to_array(useState5(false), 2), isPlaying = _useState53[0], setIsPlaying = _useState53[1];
|
|
3072
3485
|
var latestMessageProps = useLatestMessage();
|
|
3073
3486
|
var unplayedMessageSentences = useMemo12(function() {
|
|
3074
3487
|
if (!latestMessageProps.latestMessage) return [];
|
|
@@ -3168,7 +3581,7 @@ var useMessageAudio = function(param) {
|
|
|
3168
3581
|
}, [
|
|
3169
3582
|
audioPlayer
|
|
3170
3583
|
]);
|
|
3171
|
-
var
|
|
3584
|
+
var _useState54 = _sliced_to_array(useState5(null), 2), audioEngine = _useState54[0], setAudioEngine = _useState54[1];
|
|
3172
3585
|
var isAudioEngineInited = useRef6(false);
|
|
3173
3586
|
useEffect5(function() {
|
|
3174
3587
|
if (!audioPlayer.playing) return;
|
|
@@ -3214,8 +3627,8 @@ var useMessageAudio = function(param) {
|
|
|
3214
3627
|
});
|
|
3215
3628
|
};
|
|
3216
3629
|
// src/components/threads/AudioThread/Root/index.tsx
|
|
3217
|
-
import { jsx as
|
|
3218
|
-
var
|
|
3630
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
3631
|
+
var Root12 = function(param) {
|
|
3219
3632
|
var children = param.children;
|
|
3220
3633
|
var createMessageProps = useCreateMessage();
|
|
3221
3634
|
var recorderProps = useRecorder({
|
|
@@ -3272,13 +3685,13 @@ var Root9 = function(param) {
|
|
|
3272
3685
|
createMessageProps: createMessageProps,
|
|
3273
3686
|
messageAudioProps: messageAudioProps
|
|
3274
3687
|
}).status;
|
|
3275
|
-
return /* @__PURE__ */
|
|
3688
|
+
return /* @__PURE__ */ jsx64(AudioThreadContext.Provider, {
|
|
3276
3689
|
value: {
|
|
3277
3690
|
status: status,
|
|
3278
3691
|
recorderProps: recorderProps,
|
|
3279
3692
|
messageAudioProps: messageAudioProps
|
|
3280
3693
|
},
|
|
3281
|
-
children: /* @__PURE__ */
|
|
3694
|
+
children: /* @__PURE__ */ jsx64(Flex23, {
|
|
3282
3695
|
direction: "column",
|
|
3283
3696
|
flexGrow: "1",
|
|
3284
3697
|
p: "9",
|
|
@@ -3287,9 +3700,9 @@ var Root9 = function(param) {
|
|
|
3287
3700
|
});
|
|
3288
3701
|
};
|
|
3289
3702
|
// src/components/threads/AudioThread/Visualization/index.tsx
|
|
3290
|
-
import { useContext as useContext15, useState as
|
|
3703
|
+
import { useContext as useContext15, useState as useState7, useCallback as useCallback6, useEffect as useEffect7 } from "react";
|
|
3291
3704
|
import _9 from "lodash";
|
|
3292
|
-
import { Flex as
|
|
3705
|
+
import { Flex as Flex25 } from "@radix-ui/themes";
|
|
3293
3706
|
// src/hooks/threads/useAudioThreadContext/index.ts
|
|
3294
3707
|
import { useContext as useContext14 } from "react";
|
|
3295
3708
|
var useAudioThreadContext = function() {
|
|
@@ -3297,15 +3710,15 @@ var useAudioThreadContext = function() {
|
|
|
3297
3710
|
};
|
|
3298
3711
|
// src/components/threads/AudioThread/BarsVisualizer/index.tsx
|
|
3299
3712
|
import _8 from "lodash";
|
|
3300
|
-
import { Flex as
|
|
3301
|
-
import { useState as
|
|
3713
|
+
import { Flex as Flex24, Grid } from "@radix-ui/themes";
|
|
3714
|
+
import { useState as useState6, useEffect as useEffect6, useCallback as useCallback5 } from "react";
|
|
3302
3715
|
import { cluster } from "radash";
|
|
3303
|
-
import { jsx as
|
|
3716
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
3304
3717
|
var barCount = 4;
|
|
3305
3718
|
var BarsVisualizer = function(param) {
|
|
3306
3719
|
var visualizationAnalyser = param.visualizationAnalyser, backgroundColor = param.backgroundColor, height = param.height, barWidth = param.barWidth;
|
|
3307
|
-
var
|
|
3308
|
-
var draw =
|
|
3720
|
+
var _useState6 = _sliced_to_array(useState6([]), 2), barHeights = _useState6[0], setBarHeights = _useState6[1];
|
|
3721
|
+
var draw = useCallback5(function(param) {
|
|
3309
3722
|
var visualizationAnalyser2 = param.visualizationAnalyser;
|
|
3310
3723
|
if (!visualizationAnalyser2) {
|
|
3311
3724
|
setBarHeights(Array(barCount).fill(0));
|
|
@@ -3331,7 +3744,7 @@ var BarsVisualizer = function(param) {
|
|
|
3331
3744
|
draw,
|
|
3332
3745
|
visualizationAnalyser
|
|
3333
3746
|
]);
|
|
3334
|
-
return /* @__PURE__ */
|
|
3747
|
+
return /* @__PURE__ */ jsx65(Grid, {
|
|
3335
3748
|
columns: "".concat(barCount),
|
|
3336
3749
|
gap: "1",
|
|
3337
3750
|
width: "auto",
|
|
@@ -3340,12 +3753,12 @@ var BarsVisualizer = function(param) {
|
|
|
3340
3753
|
gridTemplateColumns: "repeat(4, minmax(0, 1fr))"
|
|
3341
3754
|
},
|
|
3342
3755
|
children: barHeights.map(function(barHeight, index) {
|
|
3343
|
-
return /* @__PURE__ */
|
|
3756
|
+
return /* @__PURE__ */ jsx65(Flex24, {
|
|
3344
3757
|
direction: "column",
|
|
3345
3758
|
align: "center",
|
|
3346
3759
|
justify: "center",
|
|
3347
3760
|
height: height,
|
|
3348
|
-
children: /* @__PURE__ */
|
|
3761
|
+
children: /* @__PURE__ */ jsx65(Flex24, {
|
|
3349
3762
|
minHeight: "50%",
|
|
3350
3763
|
maxHeight: "100%",
|
|
3351
3764
|
height: "".concat(barHeight + 20, "%"),
|
|
@@ -3360,12 +3773,12 @@ var BarsVisualizer = function(param) {
|
|
|
3360
3773
|
});
|
|
3361
3774
|
};
|
|
3362
3775
|
// src/components/threads/AudioThread/Visualization/index.tsx
|
|
3363
|
-
import { jsx as
|
|
3776
|
+
import { jsx as jsx66, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3364
3777
|
var Visualization = function() {
|
|
3365
3778
|
var audioThreadContext = useAudioThreadContext();
|
|
3366
3779
|
var assistantNameContext = useContext15(AssistantNameContext);
|
|
3367
|
-
var
|
|
3368
|
-
var draw =
|
|
3780
|
+
var _useState7 = _sliced_to_array(useState7(0), 2), scale = _useState7[0], setScale = _useState7[1];
|
|
3781
|
+
var draw = useCallback6(function(param) {
|
|
3369
3782
|
var visualizationAnalyser = param.visualizationAnalyser;
|
|
3370
3783
|
if (!visualizationAnalyser) {
|
|
3371
3784
|
setScale(1);
|
|
@@ -3388,14 +3801,14 @@ var Visualization = function() {
|
|
|
3388
3801
|
draw,
|
|
3389
3802
|
audioThreadContext
|
|
3390
3803
|
]);
|
|
3391
|
-
return /* @__PURE__ */
|
|
3804
|
+
return /* @__PURE__ */ jsxs24(Flex25, {
|
|
3392
3805
|
direction: "column",
|
|
3393
3806
|
align: "center",
|
|
3394
3807
|
justify: "center",
|
|
3395
3808
|
mb: "3",
|
|
3396
3809
|
flexGrow: "1",
|
|
3397
3810
|
children: [
|
|
3398
|
-
/* @__PURE__ */
|
|
3811
|
+
/* @__PURE__ */ jsx66(Flex25, {
|
|
3399
3812
|
align: "center",
|
|
3400
3813
|
justify: "center",
|
|
3401
3814
|
height: "200px",
|
|
@@ -3405,20 +3818,20 @@ var Visualization = function() {
|
|
|
3405
3818
|
borderRadius: "9999px",
|
|
3406
3819
|
scale: scale
|
|
3407
3820
|
},
|
|
3408
|
-
children: /* @__PURE__ */
|
|
3821
|
+
children: /* @__PURE__ */ jsx66(BarsVisualizer, {
|
|
3409
3822
|
visualizationAnalyser: audioThreadContext.messageAudioProps.visualizationAnalyser,
|
|
3410
3823
|
backgroundColor: audioThreadContext.status === "playing" ? "var(--accent-11)" : "var(--gray-11)",
|
|
3411
3824
|
height: "40px",
|
|
3412
3825
|
barWidth: "24px"
|
|
3413
3826
|
})
|
|
3414
3827
|
}),
|
|
3415
|
-
/* @__PURE__ */
|
|
3828
|
+
/* @__PURE__ */ jsxs24(Flex25, {
|
|
3416
3829
|
ml: "-22.5px",
|
|
3417
3830
|
gap: "3",
|
|
3418
3831
|
pt: "5",
|
|
3419
3832
|
children: [
|
|
3420
|
-
/* @__PURE__ */
|
|
3421
|
-
/* @__PURE__ */
|
|
3833
|
+
/* @__PURE__ */ jsx66(AssistantAvatar, {}),
|
|
3834
|
+
/* @__PURE__ */ jsx66(Name, {
|
|
3422
3835
|
children: assistantNameContext
|
|
3423
3836
|
})
|
|
3424
3837
|
]
|
|
@@ -3427,8 +3840,8 @@ var Visualization = function() {
|
|
|
3427
3840
|
});
|
|
3428
3841
|
};
|
|
3429
3842
|
// src/components/threads/AudioThread/Status/StatusMessages.tsx
|
|
3430
|
-
import { Flex as
|
|
3431
|
-
import { jsx as
|
|
3843
|
+
import { Flex as Flex26, Text as Text8 } from "@radix-ui/themes";
|
|
3844
|
+
import { jsx as jsx67, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3432
3845
|
var html = function(param) {
|
|
3433
3846
|
var texts = param.texts;
|
|
3434
3847
|
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) {
|
|
@@ -3437,17 +3850,17 @@ var html = function(param) {
|
|
|
3437
3850
|
};
|
|
3438
3851
|
var StatusMessages = function(param) {
|
|
3439
3852
|
var texts = param.texts;
|
|
3440
|
-
return /* @__PURE__ */
|
|
3853
|
+
return /* @__PURE__ */ jsxs25(Flex26, {
|
|
3441
3854
|
justify: "center",
|
|
3442
3855
|
pb: "5",
|
|
3443
3856
|
children: [
|
|
3444
|
-
/* @__PURE__ */
|
|
3857
|
+
/* @__PURE__ */ jsx67(Text8, {
|
|
3445
3858
|
size: "2",
|
|
3446
3859
|
weight: "regular",
|
|
3447
3860
|
color: "gray",
|
|
3448
3861
|
className: "status-messages-texts"
|
|
3449
3862
|
}),
|
|
3450
|
-
/* @__PURE__ */
|
|
3863
|
+
/* @__PURE__ */ jsx67("style", {
|
|
3451
3864
|
dangerouslySetInnerHTML: {
|
|
3452
3865
|
__html: html({
|
|
3453
3866
|
texts: texts
|
|
@@ -3458,11 +3871,11 @@ var StatusMessages = function(param) {
|
|
|
3458
3871
|
});
|
|
3459
3872
|
};
|
|
3460
3873
|
// src/components/threads/AudioThread/Status/index.tsx
|
|
3461
|
-
import { jsx as
|
|
3874
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
3462
3875
|
var Status = function() {
|
|
3463
3876
|
var audioThreadContext = useAudioThreadContext();
|
|
3464
3877
|
if (audioThreadContext.status === "recording") {
|
|
3465
|
-
return /* @__PURE__ */
|
|
3878
|
+
return /* @__PURE__ */ jsx68(StatusMessages, {
|
|
3466
3879
|
texts: [
|
|
3467
3880
|
"Start speaking",
|
|
3468
3881
|
"Listening",
|
|
@@ -3476,31 +3889,31 @@ var Status = function() {
|
|
|
3476
3889
|
"idle",
|
|
3477
3890
|
"playerPaused"
|
|
3478
3891
|
].includes(audioThreadContext.status)) {
|
|
3479
|
-
return /* @__PURE__ */
|
|
3892
|
+
return /* @__PURE__ */ jsx68(StatusMessages, {
|
|
3480
3893
|
texts: [
|
|
3481
3894
|
"Click the button below to activate"
|
|
3482
3895
|
]
|
|
3483
3896
|
});
|
|
3484
3897
|
}
|
|
3485
3898
|
if (audioThreadContext.status === "playing") {
|
|
3486
|
-
return /* @__PURE__ */
|
|
3899
|
+
return /* @__PURE__ */ jsx68(StatusMessages, {
|
|
3487
3900
|
texts: [
|
|
3488
3901
|
"Click the button below to interrupt"
|
|
3489
3902
|
]
|
|
3490
3903
|
});
|
|
3491
3904
|
}
|
|
3492
|
-
return /* @__PURE__ */
|
|
3905
|
+
return /* @__PURE__ */ jsx68(StatusMessages, {
|
|
3493
3906
|
texts: [
|
|
3494
3907
|
"Thinking"
|
|
3495
3908
|
]
|
|
3496
3909
|
});
|
|
3497
3910
|
};
|
|
3498
3911
|
// src/components/threads/AudioThread/Form/index.tsx
|
|
3499
|
-
import { Flex as
|
|
3912
|
+
import { Flex as Flex28 } from "@radix-ui/themes";
|
|
3500
3913
|
// src/components/threads/AudioThread/Form/MicIcon.tsx
|
|
3501
|
-
import { jsx as
|
|
3914
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
3502
3915
|
var MicIcon = function(props) {
|
|
3503
|
-
return /* @__PURE__ */
|
|
3916
|
+
return /* @__PURE__ */ jsx69("svg", _object_spread_props(_object_spread({
|
|
3504
3917
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3505
3918
|
fill: "currentColor",
|
|
3506
3919
|
stroke: "currentColor",
|
|
@@ -3509,54 +3922,54 @@ var MicIcon = function(props) {
|
|
|
3509
3922
|
height: "15",
|
|
3510
3923
|
width: "15"
|
|
3511
3924
|
}, props), {
|
|
3512
|
-
children: /* @__PURE__ */
|
|
3925
|
+
children: /* @__PURE__ */ jsx69("path", {
|
|
3513
3926
|
stroke: "none",
|
|
3514
3927
|
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"
|
|
3515
3928
|
})
|
|
3516
3929
|
}));
|
|
3517
3930
|
};
|
|
3518
3931
|
// src/components/threads/AudioThread/Form/ActionButton/index.tsx
|
|
3519
|
-
import { Flex as
|
|
3932
|
+
import { Flex as Flex27, IconButton as IconButton6 } from "@radix-ui/themes";
|
|
3520
3933
|
import { StopIcon as StopIcon2, PauseIcon, ArrowUpIcon as ArrowUpIcon2, ResumeIcon } from "@radix-ui/react-icons";
|
|
3521
|
-
import { jsx as
|
|
3934
|
+
import { jsx as jsx70, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3522
3935
|
var ActionButton = function() {
|
|
3523
3936
|
var audioThreadContext = useAudioThreadContext();
|
|
3524
3937
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
3525
3938
|
if (audioThreadContext.status === "recording") {
|
|
3526
|
-
return /* @__PURE__ */
|
|
3939
|
+
return /* @__PURE__ */ jsxs26(Flex27, {
|
|
3527
3940
|
align: "center",
|
|
3528
3941
|
children: [
|
|
3529
|
-
/* @__PURE__ */
|
|
3942
|
+
/* @__PURE__ */ jsx70(Flex27, {
|
|
3530
3943
|
mr: "3",
|
|
3531
3944
|
ml: "-7",
|
|
3532
|
-
children: /* @__PURE__ */
|
|
3945
|
+
children: /* @__PURE__ */ jsx70(IconButton6, {
|
|
3533
3946
|
onClick: audioThreadContext.recorderProps.pause,
|
|
3534
3947
|
color: "gray",
|
|
3535
3948
|
variant: "soft",
|
|
3536
3949
|
size: "1",
|
|
3537
|
-
children: /* @__PURE__ */
|
|
3950
|
+
children: /* @__PURE__ */ jsx70(PauseIcon, {})
|
|
3538
3951
|
})
|
|
3539
3952
|
}),
|
|
3540
|
-
/* @__PURE__ */
|
|
3953
|
+
/* @__PURE__ */ jsx70(IconButton6, {
|
|
3541
3954
|
onClick: audioThreadContext.recorderProps.stop,
|
|
3542
3955
|
highContrast: true,
|
|
3543
3956
|
variant: "soft",
|
|
3544
3957
|
size: "4",
|
|
3545
|
-
children: /* @__PURE__ */
|
|
3958
|
+
children: /* @__PURE__ */ jsx70(ArrowUpIcon2, {})
|
|
3546
3959
|
})
|
|
3547
3960
|
]
|
|
3548
3961
|
});
|
|
3549
3962
|
}
|
|
3550
3963
|
if (audioThreadContext.status === "recorderPaused") {
|
|
3551
|
-
return /* @__PURE__ */
|
|
3964
|
+
return /* @__PURE__ */ jsx70(IconButton6, {
|
|
3552
3965
|
onClick: audioThreadContext.recorderProps.resume,
|
|
3553
3966
|
color: "red",
|
|
3554
3967
|
size: "4",
|
|
3555
|
-
children: /* @__PURE__ */
|
|
3968
|
+
children: /* @__PURE__ */ jsx70(ResumeIcon, {})
|
|
3556
3969
|
});
|
|
3557
3970
|
}
|
|
3558
3971
|
if (audioThreadContext.status === "idle") {
|
|
3559
|
-
return /* @__PURE__ */
|
|
3972
|
+
return /* @__PURE__ */ jsx70(IconButton6, {
|
|
3560
3973
|
onClick: function() {
|
|
3561
3974
|
return audioThreadContext.recorderProps.start();
|
|
3562
3975
|
},
|
|
@@ -3565,7 +3978,7 @@ var ActionButton = function() {
|
|
|
3565
3978
|
});
|
|
3566
3979
|
}
|
|
3567
3980
|
if (audioThreadContext.status === "playing") {
|
|
3568
|
-
return /* @__PURE__ */
|
|
3981
|
+
return /* @__PURE__ */ jsx70(IconButton6, {
|
|
3569
3982
|
onClick: function() {
|
|
3570
3983
|
var _superinterfaceContext_createMessageAbortControllerRef_current;
|
|
3571
3984
|
audioThreadContext.messageAudioProps.stop();
|
|
@@ -3575,54 +3988,54 @@ var ActionButton = function() {
|
|
|
3575
3988
|
size: "4",
|
|
3576
3989
|
color: "gray",
|
|
3577
3990
|
variant: "soft",
|
|
3578
|
-
children: /* @__PURE__ */
|
|
3991
|
+
children: /* @__PURE__ */ jsx70(StopIcon2, {})
|
|
3579
3992
|
});
|
|
3580
3993
|
}
|
|
3581
3994
|
if (audioThreadContext.status === "playerPaused") {
|
|
3582
|
-
return /* @__PURE__ */
|
|
3995
|
+
return /* @__PURE__ */ jsx70(IconButton6, {
|
|
3583
3996
|
onClick: function() {
|
|
3584
3997
|
return audioThreadContext.messageAudioProps.play();
|
|
3585
3998
|
},
|
|
3586
3999
|
size: "4",
|
|
3587
|
-
children: /* @__PURE__ */
|
|
4000
|
+
children: /* @__PURE__ */ jsx70(ResumeIcon, {})
|
|
3588
4001
|
});
|
|
3589
4002
|
}
|
|
3590
|
-
return /* @__PURE__ */
|
|
4003
|
+
return /* @__PURE__ */ jsx70(IconButton6, {
|
|
3591
4004
|
size: "4",
|
|
3592
4005
|
variant: "soft",
|
|
3593
4006
|
disabled: true
|
|
3594
4007
|
});
|
|
3595
4008
|
};
|
|
3596
4009
|
// src/components/threads/AudioThread/Form/index.tsx
|
|
3597
|
-
import { jsx as
|
|
4010
|
+
import { jsx as jsx71, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3598
4011
|
var Form = function() {
|
|
3599
4012
|
var audioThreadContext = useAudioThreadContext();
|
|
3600
|
-
return /* @__PURE__ */
|
|
4013
|
+
return /* @__PURE__ */ jsxs27(Flex28, {
|
|
3601
4014
|
direction: "column",
|
|
3602
4015
|
align: "center",
|
|
3603
4016
|
children: [
|
|
3604
|
-
/* @__PURE__ */
|
|
4017
|
+
/* @__PURE__ */ jsxs27(Flex28, {
|
|
3605
4018
|
pb: "3",
|
|
3606
4019
|
align: "center",
|
|
3607
4020
|
children: [
|
|
3608
|
-
/* @__PURE__ */
|
|
4021
|
+
/* @__PURE__ */ jsx71(Flex28, {
|
|
3609
4022
|
ml: "-22.5px",
|
|
3610
4023
|
mr: "2",
|
|
3611
4024
|
align: "center",
|
|
3612
|
-
children: /* @__PURE__ */
|
|
4025
|
+
children: /* @__PURE__ */ jsx71(MicIcon, {
|
|
3613
4026
|
style: {
|
|
3614
4027
|
color: audioThreadContext.status === "recording" ? "var(--accent-11)" : "var(--gray-11)"
|
|
3615
4028
|
}
|
|
3616
4029
|
})
|
|
3617
4030
|
}),
|
|
3618
|
-
/* @__PURE__ */
|
|
4031
|
+
/* @__PURE__ */ jsx71(Flex28, {
|
|
3619
4032
|
px: "2",
|
|
3620
4033
|
py: "1",
|
|
3621
4034
|
style: {
|
|
3622
4035
|
backgroundColor: audioThreadContext.status === "recording" ? "var(--accent-4)" : "var(--gray-4)",
|
|
3623
4036
|
borderRadius: "var(--radius-6)"
|
|
3624
4037
|
},
|
|
3625
|
-
children: /* @__PURE__ */
|
|
4038
|
+
children: /* @__PURE__ */ jsx71(BarsVisualizer, {
|
|
3626
4039
|
visualizationAnalyser: audioThreadContext.recorderProps.visualizationAnalyser,
|
|
3627
4040
|
backgroundColor: audioThreadContext.status === "recording" ? "var(--accent-11)" : "var(--gray-11)",
|
|
3628
4041
|
height: "20px",
|
|
@@ -3631,41 +4044,38 @@ var Form = function() {
|
|
|
3631
4044
|
})
|
|
3632
4045
|
]
|
|
3633
4046
|
}),
|
|
3634
|
-
/* @__PURE__ */
|
|
4047
|
+
/* @__PURE__ */ jsx71(ActionButton, {})
|
|
3635
4048
|
]
|
|
3636
4049
|
});
|
|
3637
4050
|
};
|
|
3638
4051
|
// src/components/threads/AudioThread/index.tsx
|
|
3639
|
-
import { jsx as
|
|
4052
|
+
import { jsx as jsx72, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3640
4053
|
var AudioThread = function(props) {
|
|
3641
|
-
return /* @__PURE__ */
|
|
4054
|
+
return /* @__PURE__ */ jsxs28(Root12, _object_spread_props(_object_spread({}, props), {
|
|
3642
4055
|
children: [
|
|
3643
|
-
/* @__PURE__ */
|
|
3644
|
-
/* @__PURE__ */
|
|
3645
|
-
/* @__PURE__ */
|
|
4056
|
+
/* @__PURE__ */ jsx72(Visualization, {}),
|
|
4057
|
+
/* @__PURE__ */ jsx72(Status, {}),
|
|
4058
|
+
/* @__PURE__ */ jsx72(Form, {})
|
|
3646
4059
|
]
|
|
3647
4060
|
}));
|
|
3648
4061
|
};
|
|
3649
|
-
AudioThread.Root =
|
|
4062
|
+
AudioThread.Root = Root12;
|
|
3650
4063
|
AudioThread.Visualization = Visualization;
|
|
3651
4064
|
AudioThread.Form = Form;
|
|
3652
4065
|
// src/components/threads/AudioThreadDialog/index.tsx
|
|
3653
|
-
import { jsx as
|
|
4066
|
+
import { jsx as jsx73, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3654
4067
|
var AudioThreadDialog = function() {
|
|
3655
|
-
return /* @__PURE__ */
|
|
4068
|
+
return /* @__PURE__ */ jsxs29(Root9, {
|
|
3656
4069
|
children: [
|
|
3657
|
-
/* @__PURE__ */
|
|
3658
|
-
children: /* @__PURE__ */
|
|
4070
|
+
/* @__PURE__ */ jsx73(Content4.Root, {
|
|
4071
|
+
children: /* @__PURE__ */ jsx73(AudioThread, {})
|
|
3659
4072
|
}),
|
|
3660
|
-
/* @__PURE__ */
|
|
3661
|
-
children: /* @__PURE__ */ jsx67(Button2, {})
|
|
3662
|
-
})
|
|
4073
|
+
/* @__PURE__ */ jsx73(Trigger, {})
|
|
3663
4074
|
]
|
|
3664
4075
|
});
|
|
3665
4076
|
};
|
|
3666
|
-
AudioThreadDialog.Root =
|
|
4077
|
+
AudioThreadDialog.Root = Root9;
|
|
3667
4078
|
AudioThreadDialog.Trigger = Trigger;
|
|
3668
|
-
AudioThreadDialog.Button = Button2;
|
|
3669
4079
|
AudioThreadDialog.Content = Content4;
|
|
3670
4080
|
// src/components/suggestions/Suggestions/index.tsx
|
|
3671
4081
|
import { useMemo as useMemo14 } from "react";
|
|
@@ -3673,15 +4083,15 @@ import { useMemo as useMemo14 } from "react";
|
|
|
3673
4083
|
import { useMemo as useMemo13 } from "react";
|
|
3674
4084
|
import { isEmpty as isEmpty3 } from "radash";
|
|
3675
4085
|
import { onlyText } from "react-children-utilities";
|
|
3676
|
-
import { Flex as
|
|
4086
|
+
import { Flex as Flex29 } from "@radix-ui/themes";
|
|
3677
4087
|
// src/components/suggestions/Suggestions/Item.tsx
|
|
3678
4088
|
import { ArrowUpIcon as ArrowUpIcon3 } from "@radix-ui/react-icons";
|
|
3679
|
-
import { Text as
|
|
3680
|
-
import { jsx as
|
|
4089
|
+
import { Text as Text9, Button as Button4, Spinner as Spinner2 } from "@radix-ui/themes";
|
|
4090
|
+
import { jsx as jsx74, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3681
4091
|
var Item = function(param) {
|
|
3682
4092
|
var suggestion = param.suggestion, isDisabled = param.isDisabled;
|
|
3683
4093
|
var _useCreateMessage = useCreateMessage(), createMessage = _useCreateMessage.createMessage, isPending = _useCreateMessage.isPending;
|
|
3684
|
-
return /* @__PURE__ */
|
|
4094
|
+
return /* @__PURE__ */ jsx74(Content5, {
|
|
3685
4095
|
onClick: function() {
|
|
3686
4096
|
createMessage({
|
|
3687
4097
|
// @ts-ignore-next-line
|
|
@@ -3695,7 +4105,7 @@ var Item = function(param) {
|
|
|
3695
4105
|
};
|
|
3696
4106
|
var Content5 = function(param) {
|
|
3697
4107
|
var onClick = param.onClick, isDisabled = param.isDisabled, isPending = param.isPending, children = param.children;
|
|
3698
|
-
return /* @__PURE__ */
|
|
4108
|
+
return /* @__PURE__ */ jsxs30(Button4, {
|
|
3699
4109
|
variant: "soft",
|
|
3700
4110
|
onClick: onClick,
|
|
3701
4111
|
disabled: isDisabled,
|
|
@@ -3705,14 +4115,14 @@ var Content5 = function(param) {
|
|
|
3705
4115
|
flexShrink: 1
|
|
3706
4116
|
},
|
|
3707
4117
|
children: [
|
|
3708
|
-
/* @__PURE__ */
|
|
4118
|
+
/* @__PURE__ */ jsx74(Text9, {
|
|
3709
4119
|
size: "1",
|
|
3710
4120
|
weight: "regular",
|
|
3711
4121
|
children: children
|
|
3712
4122
|
}),
|
|
3713
|
-
/* @__PURE__ */
|
|
4123
|
+
/* @__PURE__ */ jsx74(Spinner2, {
|
|
3714
4124
|
loading: isPending,
|
|
3715
|
-
children: /* @__PURE__ */
|
|
4125
|
+
children: /* @__PURE__ */ jsx74(ArrowUpIcon3, {
|
|
3716
4126
|
style: {
|
|
3717
4127
|
flexShrink: 0
|
|
3718
4128
|
}
|
|
@@ -3723,7 +4133,7 @@ var Content5 = function(param) {
|
|
|
3723
4133
|
};
|
|
3724
4134
|
Item.Content = Content5;
|
|
3725
4135
|
// src/components/suggestions/Suggestions/Content.tsx
|
|
3726
|
-
import { jsx as
|
|
4136
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
3727
4137
|
var Content6 = function(param) {
|
|
3728
4138
|
var children = param.children;
|
|
3729
4139
|
var isMutatingMessage = useIsMutatingMessage();
|
|
@@ -3737,12 +4147,12 @@ var Content6 = function(param) {
|
|
|
3737
4147
|
children
|
|
3738
4148
|
]);
|
|
3739
4149
|
if (isEmpty3(suggestions)) return null;
|
|
3740
|
-
return /* @__PURE__ */
|
|
4150
|
+
return /* @__PURE__ */ jsx75(Flex29, {
|
|
3741
4151
|
gap: "2",
|
|
3742
4152
|
py: "2",
|
|
3743
4153
|
wrap: "wrap",
|
|
3744
4154
|
children: suggestions.map(function(suggestion) {
|
|
3745
|
-
return /* @__PURE__ */
|
|
4155
|
+
return /* @__PURE__ */ jsx75(Item, {
|
|
3746
4156
|
suggestion: suggestion,
|
|
3747
4157
|
isDisabled: isMutatingMessage
|
|
3748
4158
|
}, suggestion);
|
|
@@ -3750,7 +4160,7 @@ var Content6 = function(param) {
|
|
|
3750
4160
|
});
|
|
3751
4161
|
};
|
|
3752
4162
|
// src/components/suggestions/Suggestions/index.tsx
|
|
3753
|
-
import { jsx as
|
|
4163
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
3754
4164
|
var Suggestions = function(param) {
|
|
3755
4165
|
var children = param.children;
|
|
3756
4166
|
var latestMessageProps = useLatestMessage();
|
|
@@ -3763,14 +4173,14 @@ var Suggestions = function(param) {
|
|
|
3763
4173
|
]);
|
|
3764
4174
|
if (latestMessageProps.isLoading) return null;
|
|
3765
4175
|
if (isDisabled) return null;
|
|
3766
|
-
return /* @__PURE__ */
|
|
4176
|
+
return /* @__PURE__ */ jsx76(Content6, {
|
|
3767
4177
|
children: children
|
|
3768
4178
|
});
|
|
3769
4179
|
};
|
|
3770
4180
|
Suggestions.Item = Item;
|
|
3771
4181
|
// src/components/markdown/MarkdownProvider/index.tsx
|
|
3772
4182
|
import { useMemo as useMemo15 } from "react";
|
|
3773
|
-
import { jsx as
|
|
4183
|
+
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
3774
4184
|
var MarkdownProvider = function(_param) {
|
|
3775
4185
|
var children = _param.children, rest = _object_without_properties(_param, [
|
|
3776
4186
|
"children"
|
|
@@ -3782,7 +4192,7 @@ var MarkdownProvider = function(_param) {
|
|
|
3782
4192
|
rest,
|
|
3783
4193
|
prevMarkdownContext
|
|
3784
4194
|
]);
|
|
3785
|
-
return /* @__PURE__ */
|
|
4195
|
+
return /* @__PURE__ */ jsx77(MarkdownContext.Provider, {
|
|
3786
4196
|
value: value,
|
|
3787
4197
|
children: children
|
|
3788
4198
|
});
|
|
@@ -3795,7 +4205,7 @@ var useComponents = function() {
|
|
|
3795
4205
|
return useContext16(ComponentsContext);
|
|
3796
4206
|
};
|
|
3797
4207
|
// src/components/components/ComponentsProvider.tsx
|
|
3798
|
-
import { jsx as
|
|
4208
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
3799
4209
|
var ComponentsProvider = function(_param) {
|
|
3800
4210
|
var children = _param.children, rest = _object_without_properties(_param, [
|
|
3801
4211
|
"children"
|
|
@@ -3807,7 +4217,7 @@ var ComponentsProvider = function(_param) {
|
|
|
3807
4217
|
rest,
|
|
3808
4218
|
prevComponents
|
|
3809
4219
|
]);
|
|
3810
|
-
return /* @__PURE__ */
|
|
4220
|
+
return /* @__PURE__ */ jsx78(ComponentsContext.Provider, {
|
|
3811
4221
|
value: value,
|
|
3812
4222
|
children: children
|
|
3813
4223
|
});
|