reachat 1.0.3 → 1.0.5
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/SessionsList/SessionListItem.d.ts +4 -0
- package/dist/docs.json +21 -0
- package/dist/index.js +94 -84
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +93 -83
- package/dist/index.umd.cjs.map +1 -1
- package/dist/theme.d.ts +5 -2
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
return Object.freeze(n);
|
|
20
20
|
}
|
|
21
21
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
22
|
-
const SvgSend = (props) => /* @__PURE__ */ React__namespace.createElement("svg", {
|
|
22
|
+
const SvgSend = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { width: 17, height: 17, viewBox: "0 0 17 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React__namespace.createElement("g", { id: "send" }, /* @__PURE__ */ React__namespace.createElement("path", { id: "Vector", d: "M14.6111 2.33327C14.5349 2.3339 14.4598 2.35194 14.3917 2.386L2.39168 8.386C2.31456 8.42456 2.24872 8.4824 2.20055 8.55391C2.15238 8.62543 2.12352 8.70818 2.11677 8.79414C2.11002 8.88009 2.12561 8.96634 2.16203 9.04449C2.19845 9.12264 2.25446 9.19005 2.32462 9.24017L4.52514 10.8124L5.47371 13.6581C5.50257 13.7447 5.55457 13.8217 5.62406 13.8808C5.69355 13.9399 5.7779 13.9789 5.86796 13.9935C5.95802 14.0082 6.05036 13.9979 6.13499 13.9638C6.21962 13.9297 6.2933 13.873 6.34806 13.8001L7.05249 12.8606L10.3207 15.2376C10.3843 15.2839 10.4579 15.3146 10.5355 15.3271C10.6132 15.3396 10.6927 15.3336 10.7676 15.3097C10.8425 15.2857 10.9107 15.2444 10.9667 15.1891C11.0226 15.1338 11.0647 15.0661 11.0896 14.9915L15.0896 2.99147C15.1148 2.91597 15.1216 2.83555 15.1094 2.7569C15.0972 2.67825 15.0665 2.60363 15.0197 2.53926C14.9729 2.47488 14.9114 2.42261 14.8403 2.38678C14.7693 2.35096 14.6907 2.33261 14.6111 2.33327ZM13.2478 5.35345L10.3565 14.0266L7.67293 12.0755L13.2478 5.35345ZM10.684 5.35801L4.934 9.87559L3.58113 8.90879L10.684 5.35801ZM11.2784 6.16205L6.56746 11.843C6.56681 11.8437 6.56616 11.8443 6.56551 11.845L6.56355 11.8476C6.55841 11.8538 6.55342 11.8601 6.54858 11.8665C6.54319 11.8733 6.53798 11.8802 6.53295 11.8873L6.12085 12.4361L5.53426 10.6751L11.2784 6.16205Z", fill: "currentColor" })));
|
|
23
23
|
const SvgStop = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-octagon-x", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { d: "m15 9-6 6" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "m9 9 6 6" }));
|
|
24
24
|
const SvgPaperclip = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-paperclip", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { d: "m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48" }));
|
|
25
25
|
const ChatContext = React.createContext({
|
|
@@ -71,51 +71,54 @@
|
|
|
71
71
|
disabled: isLoading || disabled
|
|
72
72
|
}
|
|
73
73
|
),
|
|
74
|
-
|
|
75
|
-
/* @__PURE__ */ jsxRuntime.
|
|
76
|
-
|
|
74
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: reablocks.cn(theme.input.actions.base), children: [
|
|
75
|
+
(allowedFiles == null ? void 0 : allowedFiles.length) > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
76
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
77
|
+
"input",
|
|
78
|
+
{
|
|
79
|
+
type: "file",
|
|
80
|
+
ref: fileInputRef,
|
|
81
|
+
className: "hidden",
|
|
82
|
+
accept: allowedFiles.join(","),
|
|
83
|
+
onChange: handleFileUpload
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
87
|
+
reablocks.Button,
|
|
88
|
+
{
|
|
89
|
+
title: "Upload",
|
|
90
|
+
variant: "text",
|
|
91
|
+
disabled: isLoading || disabled,
|
|
92
|
+
className: reablocks.cn(theme.input.upload),
|
|
93
|
+
onClick: () => {
|
|
94
|
+
var _a;
|
|
95
|
+
return (_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
96
|
+
},
|
|
97
|
+
children: attachIcon
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] }),
|
|
101
|
+
isLoading && /* @__PURE__ */ jsxRuntime.jsx(
|
|
102
|
+
reablocks.Button,
|
|
77
103
|
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
104
|
+
title: "Stop",
|
|
105
|
+
className: reablocks.cn(theme.input.actions.stop),
|
|
106
|
+
onClick: stopMessage,
|
|
107
|
+
disabled,
|
|
108
|
+
children: stopIcon
|
|
83
109
|
}
|
|
84
110
|
),
|
|
85
111
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
86
112
|
reablocks.Button,
|
|
87
113
|
{
|
|
88
|
-
title: "
|
|
114
|
+
title: "Send",
|
|
115
|
+
className: reablocks.cn(theme.input.actions.send),
|
|
116
|
+
onClick: handleSendMessage,
|
|
89
117
|
disabled: isLoading || disabled,
|
|
90
|
-
|
|
91
|
-
onClick: () => {
|
|
92
|
-
var _a;
|
|
93
|
-
return (_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
94
|
-
},
|
|
95
|
-
children: attachIcon
|
|
118
|
+
children: sendIcon
|
|
96
119
|
}
|
|
97
120
|
)
|
|
98
|
-
] })
|
|
99
|
-
isLoading && /* @__PURE__ */ jsxRuntime.jsx(
|
|
100
|
-
reablocks.Button,
|
|
101
|
-
{
|
|
102
|
-
title: "Stop",
|
|
103
|
-
className: reablocks.cn(theme.input.stop),
|
|
104
|
-
onClick: stopMessage,
|
|
105
|
-
disabled,
|
|
106
|
-
children: stopIcon
|
|
107
|
-
}
|
|
108
|
-
),
|
|
109
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
110
|
-
reablocks.Button,
|
|
111
|
-
{
|
|
112
|
-
title: "Send",
|
|
113
|
-
className: reablocks.cn(theme.input.send),
|
|
114
|
-
onClick: handleSendMessage,
|
|
115
|
-
disabled: isLoading || disabled,
|
|
116
|
-
children: sendIcon
|
|
117
|
-
}
|
|
118
|
-
)
|
|
121
|
+
] })
|
|
119
122
|
] });
|
|
120
123
|
};
|
|
121
124
|
const SessionEmpty = ({
|
|
@@ -183,9 +186,6 @@
|
|
|
183
186
|
);
|
|
184
187
|
};
|
|
185
188
|
const SvgCopy = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-copy", ...props }, /* @__PURE__ */ React__namespace.createElement("rect", { width: 14, height: 14, x: 8, y: 8, rx: 2, ry: 2 }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }));
|
|
186
|
-
const SvgThumbsDown = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-thumbs-down", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { d: "M17 14V2" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z" }));
|
|
187
|
-
const SvgThumbsUp = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-thumbs-up", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { d: "M7 10v12" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z" }));
|
|
188
|
-
const SvgRefresh = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-refresh-ccw", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M3 3v5h5" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M16 16h5v5" }));
|
|
189
189
|
const dark = {
|
|
190
190
|
'code[class*="language-"]': {
|
|
191
191
|
"background": "#11111f",
|
|
@@ -1375,6 +1375,9 @@
|
|
|
1375
1375
|
}
|
|
1376
1376
|
return sources && sources.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: reablocks.cn(theme.messages.message.sources.base), children: sources.map((source, index) => /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...source, children }, index)) });
|
|
1377
1377
|
};
|
|
1378
|
+
const SvgThumbsDown = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-thumbs-down", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { d: "M17 14V2" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z" }));
|
|
1379
|
+
const SvgThumbsUp = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-thumbs-up", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { d: "M7 10v12" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z" }));
|
|
1380
|
+
const SvgRefresh = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-refresh-ccw", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M3 3v5h5" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M16 16h5v5" }));
|
|
1378
1381
|
const MessageActions = ({
|
|
1379
1382
|
children,
|
|
1380
1383
|
...props
|
|
@@ -1467,29 +1470,28 @@ ${response}`),
|
|
|
1467
1470
|
children
|
|
1468
1471
|
}) => {
|
|
1469
1472
|
const { theme, isLoading } = React.useContext(ChatContext);
|
|
1470
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
1471
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
] }) }) }, conversation.id);
|
|
1473
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.div, { variants: messageVariants, children: [
|
|
1474
|
+
/* @__PURE__ */ jsxRuntime.jsx(reablocks.Card, { className: reablocks.cn(theme.messages.message.base), children: children || /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1475
|
+
/* @__PURE__ */ jsxRuntime.jsx(MessageFiles, { files: conversation.files }),
|
|
1476
|
+
/* @__PURE__ */ jsxRuntime.jsx(MessageQuestion, { question: conversation.question }),
|
|
1477
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1478
|
+
MessageResponse,
|
|
1479
|
+
{
|
|
1480
|
+
response: conversation.response,
|
|
1481
|
+
isLoading: isLast && isLoading
|
|
1482
|
+
}
|
|
1483
|
+
),
|
|
1484
|
+
/* @__PURE__ */ jsxRuntime.jsx(MessageSources, { sources: conversation.sources }),
|
|
1485
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1486
|
+
MessageActions,
|
|
1487
|
+
{
|
|
1488
|
+
question: conversation.question,
|
|
1489
|
+
response: conversation.response
|
|
1490
|
+
}
|
|
1491
|
+
)
|
|
1492
|
+
] }) }),
|
|
1493
|
+
!isLast && /* @__PURE__ */ jsxRuntime.jsx(reablocks.Divider, {})
|
|
1494
|
+
] }, conversation.id);
|
|
1493
1495
|
};
|
|
1494
1496
|
const containerVariants = {
|
|
1495
1497
|
hidden: {},
|
|
@@ -1566,13 +1568,13 @@ ${response}`),
|
|
|
1566
1568
|
empty: "text-center flex-1",
|
|
1567
1569
|
sessions: {
|
|
1568
1570
|
base: "overflow-auto",
|
|
1569
|
-
console: "min-w-[150px] w-[30%] max-w-[300px] bg-[#11111F] p-5 rounded",
|
|
1571
|
+
console: "min-w-[150px] w-[30%] max-w-[300px] bg-[#11111F] p-5 rounded-3xl",
|
|
1570
1572
|
companion: "w-full h-full",
|
|
1571
|
-
group: "text-xs text-gray-400 mt-4",
|
|
1572
|
-
create: "mb-4",
|
|
1573
|
+
group: "text-xs text-gray-400 mt-4 hover:bg-transparent mb-1",
|
|
1574
|
+
create: "relative mb-4 rounded-[10px]",
|
|
1573
1575
|
session: {
|
|
1574
|
-
base: "",
|
|
1575
|
-
active: " text-
|
|
1576
|
+
base: "my-1 rounded-[10px] p-2 text-typography hover:bg-gray-800/50 border border-transparent hover:border-gray-700/50",
|
|
1577
|
+
active: "bg-gray-800/70 border border-gray-700/70 hover:bg-gray-800/50 border-gray-700/50 text-white",
|
|
1576
1578
|
delete: "[&>svg]:w-4 [&>svg]:h-4 opacity-50"
|
|
1577
1579
|
}
|
|
1578
1580
|
},
|
|
@@ -1588,8 +1590,8 @@ ${response}`),
|
|
|
1588
1590
|
header: "flex justify-between items-start gap-2",
|
|
1589
1591
|
showMore: "mb-4",
|
|
1590
1592
|
message: {
|
|
1591
|
-
base: "mb-
|
|
1592
|
-
question: "font-semibold text-gray-400 mb-1",
|
|
1593
|
+
base: "mt-4 mb-4 flex flex-col p-0 rounded border-none",
|
|
1594
|
+
question: "font-semibold text-gray-400 mb-4 px-4 py-3 pb-1 rounded-3xl rounded-br-none text-typography bg-gray-900/60 border border-gray-700/50",
|
|
1593
1595
|
response: "",
|
|
1594
1596
|
cursor: "inline-block w-1 h-4 bg-current",
|
|
1595
1597
|
files: {
|
|
@@ -1621,20 +1623,23 @@ ${response}`),
|
|
|
1621
1623
|
ol: "mb-4 list-decimal"
|
|
1622
1624
|
},
|
|
1623
1625
|
footer: {
|
|
1624
|
-
base: "mt-3 flex gap-
|
|
1625
|
-
copy: "[&>svg]:w-4 [&>svg]:h-4 opacity-50",
|
|
1626
|
-
upvote: "[&>svg]:w-4 [&>svg]:h-4 opacity-50",
|
|
1627
|
-
downvote: "[&>svg]:w-4 [&>svg]:h-4 opacity-50",
|
|
1628
|
-
refresh: "[&>svg]:w-4 [&>svg]:h-4 opacity-50"
|
|
1626
|
+
base: "mt-3 flex gap-1.5",
|
|
1627
|
+
copy: "p-3 rounded-[10px] [&>svg]:w-4 [&>svg]:h-4 opacity-50 hover:!opacity-100 hover:bg-gray-700/40 hover:text-white",
|
|
1628
|
+
upvote: "p-3 rounded-[10px] [&>svg]:w-4 [&>svg]:h-4 opacity-50 hover:!opacity-100 hover:bg-gray-700/40 hover:text-white",
|
|
1629
|
+
downvote: "p-3 rounded-[10px] [&>svg]:w-4 [&>svg]:h-4 opacity-50 hover:!opacity-100 hover:bg-gray-700/40 hover:text-white",
|
|
1630
|
+
refresh: "p-3 rounded-[10px] [&>svg]:w-4 [&>svg]:h-4 opacity-50 hover:!opacity-100 hover:bg-gray-700/40 hover:text-white"
|
|
1629
1631
|
}
|
|
1630
1632
|
}
|
|
1631
1633
|
},
|
|
1632
1634
|
input: {
|
|
1633
|
-
base: "flex mt-4",
|
|
1634
|
-
upload: "px-
|
|
1635
|
-
input: "w-full",
|
|
1636
|
-
|
|
1637
|
-
|
|
1635
|
+
base: "flex mt-4 relative",
|
|
1636
|
+
upload: "px-5 py-2 text-white size-10",
|
|
1637
|
+
input: "w-full text-typography border border-gray-700/70 rounded-3xl px-3 py-2 pr-16 after:!mx-10 [&>textarea]:w-full [&>textarea]:flex-none",
|
|
1638
|
+
actions: {
|
|
1639
|
+
base: "absolute flex gap-2 items-center right-5 inset-y-1/2 -translate-y-1/2 z-10",
|
|
1640
|
+
send: "px-3 py-3 text-white bg-gray-800 hover:bg-primary-hover rounded-full ",
|
|
1641
|
+
stop: "px-2 py-2 bg-red-500 text-white rounded-full hover:bg-red-700 "
|
|
1642
|
+
}
|
|
1638
1643
|
}
|
|
1639
1644
|
};
|
|
1640
1645
|
const useDimensions = () => {
|
|
@@ -1788,12 +1793,14 @@ ${response}`),
|
|
|
1788
1793
|
);
|
|
1789
1794
|
};
|
|
1790
1795
|
const SvgTrash = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-trash-2", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { d: "M3 6h18" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }), /* @__PURE__ */ React__namespace.createElement("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }), /* @__PURE__ */ React__namespace.createElement("line", { x1: 10, x2: 10, y1: 11, y2: 17 }), /* @__PURE__ */ React__namespace.createElement("line", { x1: 14, x2: 14, y1: 11, y2: 17 }));
|
|
1796
|
+
const SvgChat = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { width: 16, height: 17, viewBox: "0 0 16 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React__namespace.createElement("path", { d: "M8 3C4.55375 3 1.75 5.23753 1.75 7.98828C1.75 9.70653 2.83659 11.2762 4.62109 12.188C4.11184 13.0465 3.62587 13.7378 3.62012 13.7461C3.50687 13.9071 3.49862 14.1196 3.59912 14.2891C3.69012 14.4418 3.8543 14.5342 4.0293 14.5342C4.0483 14.5342 4.06743 14.533 4.08643 14.5308C4.15168 14.5233 5.66214 14.3364 7.50439 12.9604C7.67239 12.9712 7.8385 12.9766 8 12.9766C11.4462 12.9766 14.25 10.739 14.25 7.98828C14.25 5.23753 11.4462 3 8 3ZM8 4C10.8948 4 13.25 5.78903 13.25 7.98828C13.25 10.1875 10.8948 11.9766 8 11.9766C7.8055 11.9766 7.60225 11.968 7.396 11.9497C7.271 11.9382 7.1454 11.9752 7.0459 12.0527C6.3589 12.5855 5.72033 12.9308 5.20508 13.1528C5.38383 12.8648 5.57691 12.5418 5.76416 12.2061C5.83416 12.0813 5.84705 11.9324 5.7998 11.7974C5.75255 11.6624 5.64983 11.5542 5.51758 11.5C3.81033 10.7993 2.75 9.45328 2.75 7.98828C2.75 5.78903 5.10525 4 8 4ZM5.5 7.25C5.08575 7.25 4.75 7.58575 4.75 8C4.75 8.41425 5.08575 8.75 5.5 8.75C5.91425 8.75 6.25 8.41425 6.25 8C6.25 7.58575 5.91425 7.25 5.5 7.25ZM8 7.25C7.58575 7.25 7.25 7.58575 7.25 8C7.25 8.41425 7.58575 8.75 8 8.75C8.41425 8.75 8.75 8.41425 8.75 8C8.75 7.58575 8.41425 7.25 8 7.25ZM10.5 7.25C10.0857 7.25 9.75 7.58575 9.75 8C9.75 8.41425 10.0857 8.75 10.5 8.75C10.9143 8.75 11.25 8.41425 11.25 8C11.25 7.58575 10.9143 7.25 10.5 7.25Z", fill: "currentColor" }));
|
|
1791
1797
|
const SessionListItem = ({
|
|
1792
1798
|
children,
|
|
1793
1799
|
session,
|
|
1794
1800
|
deletable = true,
|
|
1795
1801
|
limit = 100,
|
|
1796
|
-
deleteIcon = /* @__PURE__ */ jsxRuntime.jsx(SvgTrash, {})
|
|
1802
|
+
deleteIcon = /* @__PURE__ */ jsxRuntime.jsx(SvgTrash, {}),
|
|
1803
|
+
chatIcon = /* @__PURE__ */ jsxRuntime.jsx(SvgChat, { className: "mr-2" })
|
|
1797
1804
|
}) => {
|
|
1798
1805
|
const { activeSessionId, selectSession, deleteSession, theme } = React.useContext(ChatContext);
|
|
1799
1806
|
const Comp = children ? reactSlot.Slot : reablocks.ListItem;
|
|
@@ -1807,6 +1814,7 @@ ${response}`),
|
|
|
1807
1814
|
[theme.sessions.session.active]: session.id === activeSessionId
|
|
1808
1815
|
}),
|
|
1809
1816
|
onClick: () => selectSession == null ? void 0 : selectSession(session.id),
|
|
1817
|
+
start: chatIcon,
|
|
1810
1818
|
end: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: deletable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1811
1819
|
reablocks.IconButton,
|
|
1812
1820
|
{
|
|
@@ -1824,24 +1832,26 @@ ${response}`),
|
|
|
1824
1832
|
}
|
|
1825
1833
|
);
|
|
1826
1834
|
};
|
|
1835
|
+
const SvgPlus = (props) => /* @__PURE__ */ React__namespace.createElement("svg", { width: 17, height: 17, viewBox: "0 0 17 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React__namespace.createElement("g", { id: "add" }, /* @__PURE__ */ React__namespace.createElement("path", { id: "Vector", d: "M13.1667 9.16658H9.16671V13.1666H7.83337V9.16658H3.83337V7.83325H7.83337V3.83325H9.16671V7.83325H13.1667V9.16658Z", fill: "currentColor" })));
|
|
1827
1836
|
const NewSessionButton = ({
|
|
1828
1837
|
children,
|
|
1829
1838
|
newSessionText = "New Session"
|
|
1830
1839
|
}) => {
|
|
1831
1840
|
const { theme, createSession, disabled } = React.useContext(ChatContext);
|
|
1832
1841
|
const Comp = children ? reactSlot.Slot : reablocks.Button;
|
|
1833
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1842
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1834
1843
|
Comp,
|
|
1835
1844
|
{
|
|
1836
1845
|
fullWidth: true,
|
|
1837
1846
|
disableMargins: true,
|
|
1838
1847
|
color: "primary",
|
|
1848
|
+
startAdornment: /* @__PURE__ */ jsxRuntime.jsx(SvgPlus, {}),
|
|
1839
1849
|
className: reablocks.cn(theme.sessions.create),
|
|
1840
1850
|
disabled,
|
|
1841
1851
|
onClick: createSession,
|
|
1842
1852
|
children: children || newSessionText
|
|
1843
1853
|
}
|
|
1844
|
-
);
|
|
1854
|
+
) });
|
|
1845
1855
|
};
|
|
1846
1856
|
const sortOrder = [
|
|
1847
1857
|
"Today",
|