@versini/sassysaint 8.82.0 → 8.83.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.
Files changed (27) hide show
  1. package/dist/chunks/{AboutChangelog.BSx_46oO.js → AboutChangelog.Dnae3ZET.js} +3 -3
  2. package/dist/chunks/{AboutEntry.BpkbOp-E.js → AboutEntry.DaKcxQlb.js} +7 -7
  3. package/dist/chunks/{App.CpK3vbuC.js → App.CfJzwyx5.js} +16 -16
  4. package/dist/chunks/{Chart.BQTk2pK3.js → Chart.CmXf5ahL.js} +2 -2
  5. package/dist/chunks/{ChatBubbleAssistant.BFj2pLII.js → ChatBubbleAssistant.rQ0E9CSF.js} +4 -4
  6. package/dist/chunks/{ChatBubbleUser.Cpvxvebn.js → ChatBubbleUser.iSkDnxmM.js} +3 -3
  7. package/dist/chunks/ChatHistoryTable.3HSGoZd4.js +215 -0
  8. package/dist/chunks/{HistoryEntry.Bair25TG.js → HistoryEntry.4IXWZ8qq.js} +3 -3
  9. package/dist/chunks/{ProfileEntry.DpxtnxMi.js → ProfileEntry.Chfyj-dQ.js} +2 -2
  10. package/dist/chunks/{SettingsEntry.CAf7JHHN.js → SettingsEntry.SAurNjp0.js} +3 -3
  11. package/dist/chunks/{UsageEntry.WJO19NIA.js → UsageEntry.DPp3sbic.js} +3 -3
  12. package/dist/chunks/{UserMemoriesPanel.Cc8bs-bq.js → UserMemoriesPanel.DiSRjoNR.js} +4 -4
  13. package/dist/chunks/{index.CHqfXZtZ.js → index.9ZW-D7id.js} +1 -1
  14. package/dist/chunks/{index.qXgqxbjy.js → index.B6gxiXab.js} +1 -1
  15. package/dist/chunks/{index.BHptKcss.js → index.BQXkk0E7.js} +984 -988
  16. package/dist/chunks/{index.BW2JmieU.js → index.CoVeibJJ.js} +1 -1
  17. package/dist/chunks/{index.DYgM3w1D.js → index.D4xbtPpm.js} +3 -3
  18. package/dist/chunks/{index.DmgNCKlb.js → index.DNDgXAMw.js} +2 -2
  19. package/dist/chunks/{index.CPHEqdrL.js → index.HO-K8Z3S.js} +1 -1
  20. package/dist/chunks/{index.B8DHTZep.js → index.ZpurL-_2.js} +1 -1
  21. package/dist/chunks/{index.CtTF1DFp.js → index.iKl0E1mP.js} +1 -1
  22. package/dist/chunks/{useMarkdown.ovqec__Y.js → useMarkdown.D1WsA7gy.js} +6 -6
  23. package/dist/components/SassySaint/SassySaint.js +1 -1
  24. package/dist/index.js +4 -4
  25. package/dist/style.css +1 -1
  26. package/package.json +3 -3
  27. package/dist/chunks/ChatHistoryTable.B8sWhUDq.js +0 -237
@@ -1,237 +0,0 @@
1
- import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
- import { f as p, h as u, INFINITE_SCROLL_THRESHOLD as k, CARDS as D, pluralize as T, ButtonIcon as d, IconRestore as y, IconStarInCircle as U, IconStarInCircleLight as z, IconDelete as P, numberFormatter as L, C as _, IconGoogleGemini as G, IconOpenAI as $, IconAnthropic as B, isProbablyMobile as K, K as W, q as Y, E as H } from "./index.BHptKcss.js";
3
- import { W as F, j as V, G as h, H as j, M as n, F as N } from "./index.B8DHTZep.js";
4
- import { Tooltip as x } from "./App.CpK3vbuC.js";
5
- import l from "clsx";
6
- import { Fragment as q } from "react";
7
- const J = {
8
- [H]: B,
9
- [Y]: $,
10
- [W]: G
11
- }, s = {
12
- ROW: "row",
13
- TIMESTAMP: p,
14
- SUMMARY: "summary",
15
- PROVIDER: "provider",
16
- TOKEN_USAGE: u,
17
- ACTIONS: "actions"
18
- }, Q = [
19
- s.ROW,
20
- s.TIMESTAMP,
21
- s.SUMMARY,
22
- s.ACTIONS
23
- ], X = [
24
- s.ROW,
25
- s.SUMMARY,
26
- s.TIMESTAMP,
27
- s.TOKEN_USAGE,
28
- s.PROVIDER,
29
- s.ACTIONS
30
- ], le = ({
31
- filteredHistory: c,
32
- historyState: o,
33
- lastEntryToLoad: g,
34
- onClickSort: C,
35
- onClickRestore: R,
36
- onClickDelete: S,
37
- onClickFavorite: O,
38
- infinityScrollMarkerRef: A,
39
- isLoading: I = !1,
40
- totalHistoryCount: E,
41
- isFiltered: v = !1
42
- }) => {
43
- const M = K() ? Q : X, w = (t) => {
44
- switch (t) {
45
- case s.ROW:
46
- return /* @__PURE__ */ e(n, { className: "sr-only", children: "Row" }, t);
47
- case s.TIMESTAMP:
48
- return /* @__PURE__ */ e(
49
- N,
50
- {
51
- focusMode: "system",
52
- buttonClassName: "text-xs sm:text-sm",
53
- cellId: p,
54
- align: "left",
55
- sortDirection: o.sortDirection,
56
- sortedCell: o.sortedCell,
57
- onClick: () => {
58
- C(p);
59
- },
60
- children: "Date"
61
- },
62
- t
63
- );
64
- case s.SUMMARY:
65
- return /* @__PURE__ */ e(n, { className: "text-xs sm:text-sm", children: "Summary" }, t);
66
- case s.PROVIDER:
67
- return /* @__PURE__ */ e(n, { className: "text-xs sm:text-sm", children: "Provider" }, t);
68
- case s.TOKEN_USAGE:
69
- return /* @__PURE__ */ e(
70
- N,
71
- {
72
- focusMode: "system",
73
- buttonClassName: "text-xs sm:text-sm",
74
- cellId: u,
75
- align: "right",
76
- sortDirection: o.sortDirection,
77
- sortedCell: o.sortedCell,
78
- onClick: () => {
79
- C(u);
80
- },
81
- children: "Tokens"
82
- },
83
- t
84
- );
85
- case s.ACTIONS:
86
- return /* @__PURE__ */ e(n, { className: "text-xs sm:text-sm text-right", children: "Actions" }, t);
87
- default:
88
- return null;
89
- }
90
- }, b = (t, r, i) => {
91
- switch (t) {
92
- case s.ROW:
93
- return /* @__PURE__ */ e(n, { children: i + 1 }, t);
94
- case s.TIMESTAMP:
95
- return /* @__PURE__ */ e(
96
- n,
97
- {
98
- component: "th",
99
- scope: "row",
100
- className: l(
101
- "dark:text-gray-400",
102
- "sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
103
- ),
104
- children: r.timestamp.split(",")[0]
105
- },
106
- t
107
- );
108
- case s.SUMMARY: {
109
- const a = r.summary || (r.messages.length > 0 ? r.messages[0]?.content : "");
110
- return /* @__PURE__ */ e(
111
- n,
112
- {
113
- className: l(
114
- "dark:text-white",
115
- "max-w-[100px] sm:max-w-full text-xs sm:text-sm"
116
- ),
117
- style: {
118
- wordBreak: "break-word"
119
- },
120
- children: a
121
- },
122
- t
123
- );
124
- }
125
- case s.PROVIDER: {
126
- const a = r.model ? _(r.model) : null, f = a ? J[a] : null;
127
- return /* @__PURE__ */ e(
128
- n,
129
- {
130
- component: "th",
131
- scope: "row",
132
- className: l("dark:text-gray-400"),
133
- align: "center",
134
- children: f ? /* @__PURE__ */ e(
135
- f,
136
- {
137
- size: "size-4 sm:size-5",
138
- semantic: !0,
139
- title: r.model || a
140
- }
141
- ) : null
142
- },
143
- t
144
- );
145
- }
146
- case s.TOKEN_USAGE:
147
- return /* @__PURE__ */ e(
148
- n,
149
- {
150
- className: l("dark:text-gray-400", "text-xs sm:text-sm"),
151
- align: "right",
152
- children: r.tokenUsage ? L.format(r.tokenUsage) : "0"
153
- },
154
- t
155
- );
156
- case s.ACTIONS:
157
- return /* @__PURE__ */ e(n, { children: /* @__PURE__ */ m("div", { className: "flex flex-col items-end sm:flex-row gap-2", children: [
158
- /* @__PURE__ */ e(
159
- x,
160
- {
161
- label: "Restore chat",
162
- placement: "top",
163
- trigger: /* @__PURE__ */ e(
164
- d,
165
- {
166
- noBorder: !0,
167
- label: "Restore chat",
168
- variant: "primary",
169
- iconClassName: "text-green-800 dark:text-green-500",
170
- onClick: async () => {
171
- await R(r);
172
- },
173
- children: /* @__PURE__ */ e(y, { size: "size-3", monotone: !0 })
174
- }
175
- )
176
- }
177
- ),
178
- /* @__PURE__ */ e(
179
- x,
180
- {
181
- label: r.favoriteChat ? "Remove from favorites" : "Add to favorites",
182
- placement: "top",
183
- trigger: /* @__PURE__ */ e(
184
- d,
185
- {
186
- noBorder: !0,
187
- label: r.favoriteChat ? "Remove from favorites" : "Add to favorites",
188
- variant: "primary",
189
- onClick: async () => {
190
- await O(r);
191
- },
192
- children: r.favoriteChat ? /* @__PURE__ */ e(U, { size: "size-4", monotone: !0 }) : /* @__PURE__ */ e(z, { size: "size-4", monotone: !0 })
193
- }
194
- )
195
- }
196
- ),
197
- /* @__PURE__ */ e(
198
- x,
199
- {
200
- label: "Delete chat",
201
- placement: "top",
202
- trigger: /* @__PURE__ */ e(
203
- d,
204
- {
205
- noBorder: !0,
206
- label: "Delete chat",
207
- variant: "primary",
208
- iconClassName: "text-red-700 dark:text-red-500",
209
- onClick: () => {
210
- S(r);
211
- },
212
- children: /* @__PURE__ */ e(P, { size: "size-3", monotone: !0 })
213
- }
214
- )
215
- }
216
- )
217
- ] }) }, t);
218
- default:
219
- return null;
220
- }
221
- };
222
- return /* @__PURE__ */ m(F, { stickyHeader: !0, compact: !0, mode: "alt-system", caption: (() => {
223
- const t = c.length, r = E ?? t;
224
- return v && r > t ? `Showing ${T(`${t} chat`, t)} out of ${r}` : T(`${t} chat`, t);
225
- })(), children: [
226
- /* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(h, { children: M.map((t) => w(t)) }) }),
227
- /* @__PURE__ */ e(j, { children: I && c.length === 0 ? /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(n, { colSpan: 1e3, children: /* @__PURE__ */ e("div", { children: "Loading..." }) }) }) : c.slice(0, g).map((t, r) => t?.messages?.length > 0 ? /* @__PURE__ */ m(q, { children: [
228
- r === g - k && /* @__PURE__ */ e("tr", { ref: A }),
229
- /* @__PURE__ */ e(h, { children: M.map(
230
- (i) => b(i, t, r)
231
- ) })
232
- ] }, `${D.HISTORY.TITLE}-${t.id}-${r}`) : null) })
233
- ] });
234
- };
235
- export {
236
- le as ChatHistoryTable
237
- };