@versini/sassysaint 8.74.2 → 8.75.1

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.CKksZqHG.js → AboutChangelog.DcM6n0DU.js} +2 -2
  2. package/dist/chunks/{AboutEntry.glCt_1V2.js → AboutEntry.Cw1HwXLd.js} +5 -5
  3. package/dist/chunks/{App.fPigJREV.js → App.uyXRdmU-.js} +16 -16
  4. package/dist/chunks/{Chart.B9hB35Ov.js → Chart.DRajQTb7.js} +2 -2
  5. package/dist/chunks/{ChatBubbleAssistant.cQmeFm3l.js → ChatBubbleAssistant.VAH8SC2k.js} +4 -4
  6. package/dist/chunks/{ChatBubbleUser.QckqWgJe.js → ChatBubbleUser.wNyLePBu.js} +3 -3
  7. package/dist/chunks/{ChatHistoryTable.DTewVIoT.js → ChatHistoryTable.BY7dwrJj.js} +37 -63
  8. package/dist/chunks/{HistoryEntry.CTG2HMFf.js → HistoryEntry.BgfbZLTU.js} +3 -3
  9. package/dist/chunks/{ProfileEntry.DYYzBE5s.js → ProfileEntry.BnRj4H6W.js} +2 -2
  10. package/dist/chunks/{SettingsEntry.D29H8z_6.js → SettingsEntry.Tt7iC8lW.js} +3 -3
  11. package/dist/chunks/{Table.4AY7ytZo.js → Table.C-82Inko.js} +83 -56
  12. package/dist/chunks/{UsageEntry.BUPgYfi_.js → UsageEntry.CIIbHmah.js} +3 -3
  13. package/dist/chunks/UserMemoriesPanel.DRGRbfMe.js +769 -0
  14. package/dist/chunks/{index.i2-wyoMZ.js → index.00VWaqRF.js} +1 -1
  15. package/dist/chunks/{index.DWl4Hcyk.js → index.B2ewgHV7.js} +899 -794
  16. package/dist/chunks/{index.B87G0G-b.js → index.BqHD1i5Y.js} +1 -1
  17. package/dist/chunks/{index.C58UQ9Se.js → index.C6dF5Qd0.js} +1 -1
  18. package/dist/chunks/{index.ChttSd_v.js → index.DJG4vhyT.js} +2 -2
  19. package/dist/chunks/{index.x0F3_X3L.js → index.Dfu0cyIO.js} +1 -1
  20. package/dist/chunks/{index.CpOVLW1-.js → index.Do5VInFn.js} +1 -1
  21. package/dist/chunks/{index.BqIB-hbB.js → index.syVj4kfz.js} +3 -3
  22. package/dist/chunks/{useMarkdown.CDrOqrBw.js → useMarkdown.C4rtvGDg.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/UserMemoriesPanel.Dpnz-uAb.js +0 -429
@@ -1,429 +0,0 @@
1
- import { jsxs as l, jsx as e, Fragment as _ } from "react/jsx-runtime";
2
- import { I as se, L as O, j as y, C as v, n as ce, LOCAL_STORAGE_PREFIX as q, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as oe, LOCAL_STORAGE_SORT_MEMORY_COLUMN as ie, useUserMemories as ae, useDeleteMemory as de, useDeleteAllMemories as me, useUpdateMemory as he, te as B } from "./index.DWl4Hcyk.js";
3
- import { oe as V, E as F, e as g, ConfirmationPanel as G, st as H } from "./App.fPigJREV.js";
4
- import E from "clsx";
5
- import { useState as x, useEffect as xe, useRef as j } from "react";
6
- import { Re as ue } from "./index.x0F3_X3L.js";
7
- import { j as pe, D as fe, G as b, M as d, F as ge, H as ye, l as Ce, U as Ne } from "./Table.4AY7ytZo.js";
8
- const Ae = ({
9
- className: a,
10
- viewBox: m,
11
- title: n,
12
- monotone: r,
13
- ...C
14
- }) => /* @__PURE__ */ l(
15
- se,
16
- {
17
- defaultViewBox: "0 0 512 512",
18
- size: "size-5",
19
- viewBox: m,
20
- className: a,
21
- title: n || "Edit",
22
- ...C,
23
- children: [
24
- /* @__PURE__ */ e(
25
- "path",
26
- {
27
- d: "M0 160c0-53 43-96 96-96h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H96c-17.7 0-32 14.3-32 32v256c0 17.7 14.3 32 32 32h256c17.7 0 32-14.3 32-32v-96c0-17.7 14.3-32 32-32s32 14.3 32 32v96c0 53-43 96-96 96H96c-53 0-96-43-96-96z",
28
- opacity: r ? "1" : "0.4"
29
- }
30
- ),
31
- /* @__PURE__ */ e("path", { d: "m392.4 21.7-30.1 30 97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2l-18.7-18.6c-21.9-21.9-57.3-21.9-79.2 0m-52.7 52.6L172.4 241.7c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5l167.3-167.4z" })
32
- ]
33
- }
34
- ), Se = ({
35
- open: a,
36
- onOpenChange: m,
37
- initialText: n,
38
- metadata: r,
39
- onSave: C,
40
- isSaving: N = !1
41
- }) => {
42
- const [i, A] = x(n);
43
- xe(() => {
44
- a && A(n);
45
- }, [a, n]);
46
- const T = () => {
47
- i.trim().length >= 3 && C(i.trim());
48
- }, S = i.trim().length >= 3, D = i.trim() !== n.trim();
49
- return /* @__PURE__ */ e(
50
- V,
51
- {
52
- open: a,
53
- onOpenChange: m,
54
- title: "Edit Memory",
55
- animation: !0,
56
- animationType: "fade",
57
- footer: /* @__PURE__ */ l(O, { columnGap: 2, alignHorizontal: "flex-end", children: [
58
- /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
59
- v,
60
- {
61
- mode: "dark",
62
- variant: "secondary",
63
- noBorder: !0,
64
- focusMode: "light",
65
- onClick: () => m(!1),
66
- disabled: N,
67
- children: "Cancel"
68
- }
69
- ) }),
70
- /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
71
- v,
72
- {
73
- mode: "dark",
74
- focusMode: "light",
75
- disabled: N || !S || !D,
76
- onClick: T,
77
- children: N ? "Saving..." : "Save"
78
- }
79
- ) })
80
- ] }),
81
- children: /* @__PURE__ */ l("div", { className: "flex flex-col pt-2 gap-4", children: [
82
- /* @__PURE__ */ e(
83
- ue,
84
- {
85
- mode: "dark",
86
- focusMode: "light",
87
- label: "Memory text",
88
- name: "memoryText",
89
- value: i,
90
- onChange: (u) => A(u.target.value),
91
- autoFocus: !0,
92
- helperText: i.trim().length < 3 ? "Memory text must be at least 3 characters" : `${i.length} characters`
93
- }
94
- ),
95
- r && /* @__PURE__ */ l("div", { className: "flex flex-col gap-3 p-4 bg-slate-800/50 rounded-md border border-slate-700/50", children: [
96
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-slate-300 m-0", children: "Memory Details" }),
97
- r.categories && r.categories.length > 0 && /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: [
98
- /* @__PURE__ */ e("span", { className: "text-xs text-slate-400 uppercase", children: "Category" }),
99
- /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: r.categories.map((u, w) => /* @__PURE__ */ e(
100
- "span",
101
- {
102
- className: "text-xs px-2 py-1 bg-slate-700/50 text-slate-200 rounded",
103
- children: u
104
- },
105
- `${u}-${w}`
106
- )) })
107
- ] }),
108
- /* @__PURE__ */ l("div", { className: "flex flex-col sm:flex-row gap-4", children: [
109
- /* @__PURE__ */ l("div", { className: "flex flex-col gap-3 sm:flex-1", children: [
110
- r.confidence !== void 0 && r.confidence !== null && /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: [
111
- /* @__PURE__ */ e("span", { className: "text-xs text-slate-400 uppercase", children: "Confidence" }),
112
- /* @__PURE__ */ l("span", { className: "text-sm text-slate-200", children: [
113
- (r.confidence * 100).toFixed(0),
114
- "%"
115
- ] })
116
- ] }),
117
- r.status && /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: [
118
- /* @__PURE__ */ e("span", { className: "text-xs text-slate-400 uppercase", children: "Status" }),
119
- /* @__PURE__ */ e("span", { className: "text-sm text-slate-200 capitalize", children: r.status })
120
- ] }),
121
- r.sourceType && /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: [
122
- /* @__PURE__ */ e("span", { className: "text-xs text-slate-400 uppercase", children: "Source Type" }),
123
- /* @__PURE__ */ e("span", { className: "text-sm text-slate-200 capitalize", children: r.sourceType })
124
- ] })
125
- ] }),
126
- /* @__PURE__ */ l("div", { className: "flex flex-col gap-3 sm:flex-1", children: [
127
- r.quote && /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: [
128
- /* @__PURE__ */ e("span", { className: "text-xs text-slate-400 uppercase", children: "Original Prompt" }),
129
- /* @__PURE__ */ l("p", { className: "text-sm text-slate-200 m-0 italic", children: [
130
- '"',
131
- r.quote,
132
- '"'
133
- ] })
134
- ] }),
135
- r.canonicalText && /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: [
136
- /* @__PURE__ */ e("span", { className: "text-xs text-slate-400 uppercase", children: "Canonical Text" }),
137
- /* @__PURE__ */ e("p", { className: "text-sm text-slate-200 m-0 font-mono", children: r.canonicalText })
138
- ] })
139
- ] })
140
- ] })
141
- ] })
142
- ] })
143
- }
144
- );
145
- }, be = ({
146
- open: a,
147
- onOpenChange: m,
148
- user: n
149
- }) => {
150
- const { getAccessToken: r } = ce(), [C] = x(void 0), [N, i] = F({
151
- key: q + oe,
152
- initialValue: g.DESC
153
- }), [A, T] = F({
154
- key: q + ie,
155
- initialValue: "createdAt"
156
- }), [S, D] = x(N || g.DESC), [u, w] = x(
157
- A || "createdAt"
158
- ), { data: o, isLoading: R, isError: L } = ae({
159
- user: n,
160
- query: C,
161
- getAccessToken: r,
162
- enabled: a
163
- }), z = de({ getAccessToken: r }), P = me({ getAccessToken: r }), M = he({ getAccessToken: r }), [Y, I] = x(!1), h = j(null), [X, U] = x(!1), [J, k] = x(!1), s = j(null), K = (t, c, p, f) => {
164
- h.current = { id: t, text: c, description: p, createdAt: f }, I(!0);
165
- }, Q = () => {
166
- h.current && z.mutate({ user: n, memoryId: h.current.id });
167
- }, W = (t, c, p, f, te, le, re, ne) => {
168
- s.current = {
169
- id: t,
170
- description: c,
171
- categories: p,
172
- quote: f,
173
- canonicalText: te,
174
- confidence: le,
175
- status: re,
176
- sourceType: ne
177
- }, k(!0);
178
- }, Z = (t) => {
179
- s.current && n && M.mutate(
180
- {
181
- user: n,
182
- memoryId: s.current.id,
183
- description: t
184
- },
185
- {
186
- onSuccess: () => {
187
- k(!1);
188
- }
189
- }
190
- );
191
- }, $ = () => {
192
- n && U(!0);
193
- }, ee = () => {
194
- n && P.mutate({ user: n });
195
- };
196
- return /* @__PURE__ */ l(_, { children: [
197
- /* @__PURE__ */ e(
198
- Se,
199
- {
200
- open: J,
201
- onOpenChange: k,
202
- initialText: s.current?.description || "",
203
- metadata: s.current ? {
204
- categories: s.current.categories,
205
- quote: s.current.quote,
206
- canonicalText: s.current.canonicalText,
207
- confidence: s.current.confidence,
208
- status: s.current.status,
209
- sourceType: s.current.sourceType
210
- } : void 0,
211
- onSave: Z,
212
- isSaving: M.isPending
213
- }
214
- ),
215
- /* @__PURE__ */ l(
216
- G,
217
- {
218
- showConfirmation: Y,
219
- setShowConfirmation: I,
220
- action: Q,
221
- customStrings: {
222
- title: "Delete memory",
223
- confirmAction: "Delete",
224
- cancelAction: "Cancel"
225
- },
226
- children: [
227
- /* @__PURE__ */ e("p", { className: "m-0", children: "Are you sure you want to delete this memory?" }),
228
- /* @__PURE__ */ l("ul", { className: "m-0 mt-2 list-disc list-inside text-xs opacity-80", children: [
229
- /* @__PURE__ */ l("li", { children: [
230
- "Excerpt:",
231
- " ",
232
- (h.current?.description || h.current?.text || "").slice(0, 80)
233
- ] }),
234
- /* @__PURE__ */ l("li", { children: [
235
- "Created:",
236
- " ",
237
- h.current?.createdAt ? new Date(h.current.createdAt).toLocaleString() : "-"
238
- ] })
239
- ] })
240
- ]
241
- }
242
- ),
243
- /* @__PURE__ */ e(
244
- G,
245
- {
246
- showConfirmation: X,
247
- setShowConfirmation: U,
248
- action: ee,
249
- customStrings: {
250
- title: "Delete all memories",
251
- confirmAction: "Delete all",
252
- cancelAction: "Cancel"
253
- },
254
- children: /* @__PURE__ */ e("p", { className: "m-0", children: "This will permanently delete all memories for this user. This action cannot be undone." })
255
- }
256
- ),
257
- /* @__PURE__ */ e(
258
- V,
259
- {
260
- open: a,
261
- onOpenChange: (t) => m(t),
262
- title: "User Memories",
263
- animation: !0,
264
- animationType: "fade",
265
- footer: /* @__PURE__ */ l(O, { columnGap: 2, alignHorizontal: "flex-end", children: [
266
- /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
267
- v,
268
- {
269
- mode: "dark",
270
- variant: "secondary",
271
- noBorder: !0,
272
- focusMode: "light",
273
- onClick: () => m(!1),
274
- children: "Close"
275
- }
276
- ) }),
277
- /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
278
- v,
279
- {
280
- mode: "dark",
281
- focusMode: "light",
282
- variant: "danger",
283
- disabled: P.isPending || (o?.total ?? 0) === 0,
284
- onClick: $,
285
- children: "Delete All"
286
- }
287
- ) })
288
- ] }),
289
- children: /* @__PURE__ */ l("div", { className: "flex flex-col sm:flex-row max-h-[75vh] min-h-[60vh] pt-2", children: [
290
- R && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading memories..." }),
291
- L && /* @__PURE__ */ e("p", { className: "m-0 text-red-500", children: "Failed to load memories." }),
292
- !R && !L && (o && o.items.length > 0 ? /* @__PURE__ */ l(pe, { stickyHeader: !0, stickyFooter: !0, compact: !0, mode: "alt-system", children: [
293
- /* @__PURE__ */ e(fe, { children: /* @__PURE__ */ l(b, { children: [
294
- /* @__PURE__ */ e(d, { className: "sr-only", children: "Row" }),
295
- /* @__PURE__ */ e(d, { children: "Memory" }),
296
- /* @__PURE__ */ e(
297
- ge,
298
- {
299
- focusMode: "system",
300
- buttonClassName: "text-xs sm:text-sm",
301
- cellId: "createdAt",
302
- align: "left",
303
- sortDirection: S,
304
- sortedCell: u,
305
- onClick: () => {
306
- w("createdAt"), T("createdAt"), D((t) => {
307
- const c = t === g.ASC ? g.DESC : g.ASC;
308
- return i(c), c;
309
- });
310
- },
311
- children: "Date"
312
- }
313
- ),
314
- /* @__PURE__ */ e(d, { align: "right", children: "Actions" })
315
- ] }) }),
316
- /* @__PURE__ */ e(ye, { children: [...o.items].sort((t, c) => {
317
- const p = t.createdAt ? new Date(t.createdAt).getTime() : 0, f = c.createdAt ? new Date(c.createdAt).getTime() : 0;
318
- return S === g.ASC ? p - f : f - p;
319
- }).map((t, c) => /* @__PURE__ */ l(b, { children: [
320
- /* @__PURE__ */ e(d, { className: E("dark:text-gray-400"), children: c + 1 }),
321
- /* @__PURE__ */ e(
322
- d,
323
- {
324
- className: E(
325
- "dark:text-white",
326
- "max-w-[100px] sm:max-w-[400px]",
327
- "text-xs sm:text-sm"
328
- ),
329
- style: {
330
- wordBreak: "break-word"
331
- },
332
- children: t.description || t.text
333
- }
334
- ),
335
- /* @__PURE__ */ e(
336
- d,
337
- {
338
- component: "th",
339
- scope: "row",
340
- className: E(
341
- "dark:text-gray-400",
342
- "sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
343
- ),
344
- children: t.createdAt ? new Date(t.createdAt).toLocaleDateString() : "-"
345
- }
346
- ),
347
- /* @__PURE__ */ e(d, { className: "align-top", align: "right", children: /* @__PURE__ */ l(O, { columnGap: 2, alignHorizontal: "flex-end", children: [
348
- /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
349
- H,
350
- {
351
- label: "Edit memory",
352
- mode: "system",
353
- placement: "top",
354
- trigger: /* @__PURE__ */ e(
355
- B,
356
- {
357
- focusMode: "system",
358
- noBorder: !0,
359
- label: "Edit memory",
360
- variant: "primary",
361
- disabled: M.isPending,
362
- onClick: () => W(
363
- t.memoryId,
364
- t.description || t.text,
365
- t.categories,
366
- t.quote,
367
- t.canonicalText,
368
- t.confidence,
369
- t.status,
370
- t.sourceType
371
- ),
372
- children: /* @__PURE__ */ e(Ae, { size: "size-3", monotone: !0 })
373
- }
374
- )
375
- }
376
- ) }),
377
- /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
378
- H,
379
- {
380
- label: "Delete memory",
381
- mode: "system",
382
- placement: "top",
383
- trigger: /* @__PURE__ */ e(
384
- B,
385
- {
386
- focusMode: "system",
387
- noBorder: !0,
388
- label: "Delete memory",
389
- variant: "primary",
390
- iconClassName: "text-red-700 dark:text-red-500",
391
- disabled: z.isPending,
392
- onClick: () => K(
393
- t.memoryId,
394
- t.text,
395
- t.description,
396
- t.createdAt
397
- ),
398
- children: /* @__PURE__ */ e(Ce, { size: "size-3", monotone: !0 })
399
- }
400
- )
401
- }
402
- ) })
403
- ] }) })
404
- ] }, t.memoryId)) }),
405
- /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(b, { children: /* @__PURE__ */ l(d, { colSpan: 4, children: [
406
- o.total,
407
- " memor",
408
- o.total === 1 ? "y" : "ies",
409
- o.totalTokenUsage !== void 0 && o.totalTokenUsage > 0 && /* @__PURE__ */ l(_, { children: [
410
- " ",
411
- "(approximately",
412
- " ",
413
- Math.round(o.totalTokenUsage).toLocaleString(),
414
- " ",
415
- "token",
416
- Math.round(o.totalTokenUsage) === 1 ? "" : "s",
417
- ")"
418
- ] })
419
- ] }) }) })
420
- ] }) : /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: "No memories stored." }))
421
- ] })
422
- }
423
- )
424
- ] });
425
- };
426
- export {
427
- be as UserMemoriesPanel,
428
- be as default
429
- };