@versini/sassysaint 8.69.0 → 8.70.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.C1qlLGOL.js → AboutChangelog.DVjlL3Qi.js} +2 -2
  2. package/dist/chunks/{AboutEntry.MVgAFIQi.js → AboutEntry.d-oqfbRb.js} +5 -5
  3. package/dist/chunks/{App.DnIeRbwI.js → App.DP_1QDro.js} +16 -16
  4. package/dist/chunks/{Chart.D4LA295Y.js → Chart.BxgzH0Ym.js} +2 -2
  5. package/dist/chunks/{ChatBubbleAssistant.B9uKu0Zq.js → ChatBubbleAssistant.CAVS6c3_.js} +4 -4
  6. package/dist/chunks/{ChatBubbleUser.DBArpWQj.js → ChatBubbleUser.Cyzg2idO.js} +3 -3
  7. package/dist/chunks/{ChatHistoryTable.DpDPvpwx.js → ChatHistoryTable.gB3WSJ7G.js} +3 -3
  8. package/dist/chunks/{HistoryEntry.DyYYZjb-.js → HistoryEntry.CQyBOAhi.js} +3 -3
  9. package/dist/chunks/{ProfileEntry.BkfA5ilN.js → ProfileEntry.CWwyc27k.js} +2 -2
  10. package/dist/chunks/SettingsEntry.DKbi9HA-.js +444 -0
  11. package/dist/chunks/{Table.BSsGkgB1.js → Table.B65cZ6GW.js} +2 -2
  12. package/dist/chunks/{UsageEntry.DA9Z1z3A.js → UsageEntry.BdgexwbQ.js} +3 -3
  13. package/dist/chunks/UserMemoriesPanel.CXJlDOY-.js +347 -0
  14. package/dist/chunks/{index.BtXviUD3.js → index.B-25p6O_.js} +3 -3
  15. package/dist/chunks/index.C0hBKDgD.js +357 -0
  16. package/dist/chunks/{index.CaDLl4vX.js → index.CTgvpxYe.js} +1 -1
  17. package/dist/chunks/{index.Dta1BrG6.js → index.Cfv_6CcW.js} +1 -1
  18. package/dist/chunks/{index.DXaLvF3n.js → index.DjSi9ICW.js} +487 -455
  19. package/dist/chunks/{index.CKRmoShZ.js → index.DtU6Al_9.js} +1 -1
  20. package/dist/chunks/{index.DH2l4xnG.js → index.TU_lKm2K.js} +1 -1
  21. package/dist/chunks/{index.B3XB6cTq.js → index.edqJduuy.js} +2 -2
  22. package/dist/chunks/{useMarkdown.BAKJP0y9.js → useMarkdown.CZcXi3B7.js} +6 -6
  23. package/dist/components/SassySaint/SassySaint.js +1 -1
  24. package/dist/index.js +4 -4
  25. package/package.json +3 -3
  26. package/dist/chunks/SettingsEntry.CfM4w4sE.js +0 -794
  27. package/dist/chunks/UserMemoriesPanel.BI0GoJUN.js +0 -208
@@ -0,0 +1,347 @@
1
+ import { jsxs as o, jsx as e, Fragment as ee } from "react/jsx-runtime";
2
+ import { I as te, L as T, j as p, C as D, isProbablyiPhone as re, n as oe, LOCAL_STORAGE_PREFIX as I, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as ne, LOCAL_STORAGE_SORT_MEMORY_COLUMN as ie, useUserMemories as le, useDeleteMemory as ce, useDeleteAllMemories as ae, useUpdateMemory as se, te as _ } from "./index.DjSi9ICW.js";
3
+ import { oe as U, E as B, e as f, ConfirmationPanel as G, st as H } from "./App.DP_1QDro.js";
4
+ import v from "clsx";
5
+ import { useState as h, useEffect as de, useRef as F } from "react";
6
+ import { Re as me } from "./index.C0hBKDgD.js";
7
+ import { j as he, D as ue, G as N, M as a, F as fe, H as pe, l as xe, U as ye } from "./Table.B65cZ6GW.js";
8
+ const ge = ({
9
+ className: l,
10
+ viewBox: s,
11
+ title: r,
12
+ monotone: c,
13
+ ...d
14
+ }) => /* @__PURE__ */ o(
15
+ te,
16
+ {
17
+ defaultViewBox: "0 0 512 512",
18
+ size: "size-5",
19
+ viewBox: s,
20
+ className: l,
21
+ title: r || "Edit",
22
+ ...d,
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: c ? "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
+ ), Ce = ({
35
+ open: l,
36
+ onOpenChange: s,
37
+ initialText: r,
38
+ onSave: c,
39
+ isSaving: d = !1
40
+ }) => {
41
+ const [i, x] = h(r);
42
+ de(() => {
43
+ l && x(r);
44
+ }, [l, r]);
45
+ const S = () => {
46
+ i.trim().length >= 3 && c(i.trim());
47
+ }, w = i.trim().length >= 3, y = i.trim() !== r.trim();
48
+ return /* @__PURE__ */ e(
49
+ U,
50
+ {
51
+ kind: re() ? "panel" : "messagebox",
52
+ open: l,
53
+ onOpenChange: s,
54
+ title: "Edit Memory",
55
+ animation: !0,
56
+ animationType: "fade",
57
+ footer: /* @__PURE__ */ o(T, { columnGap: 2, alignHorizontal: "flex-end", children: [
58
+ /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(
59
+ D,
60
+ {
61
+ mode: "dark",
62
+ variant: "secondary",
63
+ noBorder: !0,
64
+ focusMode: "light",
65
+ onClick: () => s(!1),
66
+ disabled: d,
67
+ children: "Cancel"
68
+ }
69
+ ) }),
70
+ /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(
71
+ D,
72
+ {
73
+ mode: "dark",
74
+ focusMode: "light",
75
+ disabled: d || !w || !y,
76
+ onClick: S,
77
+ children: d ? "Saving..." : "Save"
78
+ }
79
+ ) })
80
+ ] }),
81
+ children: /* @__PURE__ */ e("div", { className: "flex flex-col pt-2", children: /* @__PURE__ */ e(
82
+ me,
83
+ {
84
+ mode: "dark",
85
+ focusMode: "light",
86
+ label: "Memory text",
87
+ name: "memoryText",
88
+ value: i,
89
+ onChange: (M) => x(M.target.value),
90
+ autoFocus: !0,
91
+ helperText: i.trim().length < 3 ? "Memory text must be at least 3 characters" : `${i.length} characters`
92
+ }
93
+ ) })
94
+ }
95
+ );
96
+ }, ve = ({
97
+ open: l,
98
+ onOpenChange: s,
99
+ user: r
100
+ }) => {
101
+ const { getAccessToken: c } = oe(), [d] = h(void 0), [i, x] = B({
102
+ key: I + ne,
103
+ initialValue: f.DESC
104
+ }), [S, w] = B({
105
+ key: I + ie,
106
+ initialValue: "createdAt"
107
+ }), [y, M] = h(i || f.DESC), [j, q] = h(
108
+ S || "createdAt"
109
+ ), { data: u, isLoading: b, isError: O } = le({
110
+ user: r,
111
+ query: d,
112
+ getAccessToken: c,
113
+ enabled: l
114
+ }), R = ce({ getAccessToken: c }), L = ae({ getAccessToken: c }), k = se({ getAccessToken: c }), [V, P] = h(!1), m = F(null), [Y, z] = h(!1), [X, E] = h(!1), g = F(null), J = (t, n, C, A) => {
115
+ m.current = { id: t, text: n, description: C, createdAt: A }, P(!0);
116
+ }, K = () => {
117
+ m.current && R.mutate({ user: r, memoryId: m.current.id });
118
+ }, Q = (t, n) => {
119
+ g.current = { id: t, description: n }, E(!0);
120
+ }, W = (t) => {
121
+ g.current && r && k.mutate(
122
+ {
123
+ user: r,
124
+ memoryId: g.current.id,
125
+ description: t
126
+ },
127
+ {
128
+ onSuccess: () => {
129
+ E(!1);
130
+ }
131
+ }
132
+ );
133
+ }, Z = () => {
134
+ r && z(!0);
135
+ }, $ = () => {
136
+ r && L.mutate({ user: r });
137
+ };
138
+ return /* @__PURE__ */ o(ee, { children: [
139
+ /* @__PURE__ */ e(
140
+ Ce,
141
+ {
142
+ open: X,
143
+ onOpenChange: E,
144
+ initialText: g.current?.description || "",
145
+ onSave: W,
146
+ isSaving: k.isPending
147
+ }
148
+ ),
149
+ /* @__PURE__ */ o(
150
+ G,
151
+ {
152
+ showConfirmation: V,
153
+ setShowConfirmation: P,
154
+ action: K,
155
+ customStrings: {
156
+ title: "Delete memory",
157
+ confirmAction: "Delete",
158
+ cancelAction: "Cancel"
159
+ },
160
+ children: [
161
+ /* @__PURE__ */ e("p", { className: "m-0", children: "Are you sure you want to delete this memory?" }),
162
+ /* @__PURE__ */ o("ul", { className: "m-0 mt-2 list-disc list-inside text-xs opacity-80", children: [
163
+ /* @__PURE__ */ o("li", { children: [
164
+ "Excerpt:",
165
+ " ",
166
+ (m.current?.description || m.current?.text || "").slice(0, 80)
167
+ ] }),
168
+ /* @__PURE__ */ o("li", { children: [
169
+ "Created:",
170
+ " ",
171
+ m.current?.createdAt ? new Date(m.current.createdAt).toLocaleString() : "-"
172
+ ] })
173
+ ] })
174
+ ]
175
+ }
176
+ ),
177
+ /* @__PURE__ */ e(
178
+ G,
179
+ {
180
+ showConfirmation: Y,
181
+ setShowConfirmation: z,
182
+ action: $,
183
+ customStrings: {
184
+ title: "Delete all memories",
185
+ confirmAction: "Delete all",
186
+ cancelAction: "Cancel"
187
+ },
188
+ children: /* @__PURE__ */ e("p", { className: "m-0", children: "This will permanently delete all memories for this user. This action cannot be undone." })
189
+ }
190
+ ),
191
+ /* @__PURE__ */ e(
192
+ U,
193
+ {
194
+ open: l,
195
+ onOpenChange: (t) => s(t),
196
+ title: "User Memories",
197
+ animation: !0,
198
+ animationType: "fade",
199
+ footer: /* @__PURE__ */ o(T, { columnGap: 2, alignHorizontal: "flex-end", children: [
200
+ /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(
201
+ D,
202
+ {
203
+ mode: "dark",
204
+ variant: "secondary",
205
+ noBorder: !0,
206
+ focusMode: "light",
207
+ onClick: () => s(!1),
208
+ children: "Close"
209
+ }
210
+ ) }),
211
+ /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(
212
+ D,
213
+ {
214
+ mode: "dark",
215
+ focusMode: "light",
216
+ variant: "danger",
217
+ disabled: L.isPending || (u?.total ?? 0) === 0,
218
+ onClick: Z,
219
+ children: "Delete All"
220
+ }
221
+ ) })
222
+ ] }),
223
+ children: /* @__PURE__ */ o("div", { className: "flex flex-col sm:flex-row max-h-[75vh] min-h-[60vh] pt-2", children: [
224
+ b && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading memories..." }),
225
+ O && /* @__PURE__ */ e("p", { className: "m-0 text-red-500", children: "Failed to load memories." }),
226
+ !b && !O && (u && u.items.length > 0 ? /* @__PURE__ */ o(he, { stickyHeader: !0, stickyFooter: !0, compact: !0, mode: "alt-system", children: [
227
+ /* @__PURE__ */ e(ue, { children: /* @__PURE__ */ o(N, { children: [
228
+ /* @__PURE__ */ e(a, { className: "sr-only", children: "Row" }),
229
+ /* @__PURE__ */ e(a, { children: "Memory" }),
230
+ /* @__PURE__ */ e(
231
+ fe,
232
+ {
233
+ focusMode: "system",
234
+ buttonClassName: "text-xs sm:text-sm",
235
+ cellId: "createdAt",
236
+ align: "left",
237
+ sortDirection: y,
238
+ sortedCell: j,
239
+ onClick: () => {
240
+ q("createdAt"), w("createdAt"), M((t) => {
241
+ const n = t === f.ASC ? f.DESC : f.ASC;
242
+ return x(n), n;
243
+ });
244
+ },
245
+ children: "Date"
246
+ }
247
+ ),
248
+ /* @__PURE__ */ e(a, { align: "right", children: "Actions" })
249
+ ] }) }),
250
+ /* @__PURE__ */ e(pe, { children: [...u.items].sort((t, n) => {
251
+ const C = t.createdAt ? new Date(t.createdAt).getTime() : 0, A = n.createdAt ? new Date(n.createdAt).getTime() : 0;
252
+ return y === f.ASC ? C - A : A - C;
253
+ }).map((t, n) => /* @__PURE__ */ o(N, { children: [
254
+ /* @__PURE__ */ e(a, { className: v("dark:text-gray-400"), children: n + 1 }),
255
+ /* @__PURE__ */ e(
256
+ a,
257
+ {
258
+ className: v(
259
+ "dark:text-white",
260
+ "max-w-[100px] sm:max-w-[400px]",
261
+ "text-xs sm:text-sm"
262
+ ),
263
+ style: {
264
+ wordBreak: "break-word"
265
+ },
266
+ children: t.description || t.text
267
+ }
268
+ ),
269
+ /* @__PURE__ */ e(
270
+ a,
271
+ {
272
+ component: "th",
273
+ scope: "row",
274
+ className: v(
275
+ "dark:text-gray-400",
276
+ "sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
277
+ ),
278
+ children: t.createdAt ? new Date(t.createdAt).toLocaleDateString() : "-"
279
+ }
280
+ ),
281
+ /* @__PURE__ */ e(a, { className: "align-top", align: "right", children: /* @__PURE__ */ o(T, { columnGap: 2, alignHorizontal: "flex-end", children: [
282
+ /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(
283
+ H,
284
+ {
285
+ label: "Edit memory",
286
+ mode: "system",
287
+ placement: "top",
288
+ trigger: /* @__PURE__ */ e(
289
+ _,
290
+ {
291
+ focusMode: "system",
292
+ noBorder: !0,
293
+ label: "Edit memory",
294
+ variant: "primary",
295
+ disabled: k.isPending,
296
+ onClick: () => Q(
297
+ t.memoryId,
298
+ t.description || t.text
299
+ ),
300
+ children: /* @__PURE__ */ e(ge, { size: "size-3", monotone: !0 })
301
+ }
302
+ )
303
+ }
304
+ ) }),
305
+ /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(
306
+ H,
307
+ {
308
+ label: "Delete memory",
309
+ mode: "system",
310
+ placement: "top",
311
+ trigger: /* @__PURE__ */ e(
312
+ _,
313
+ {
314
+ focusMode: "system",
315
+ noBorder: !0,
316
+ label: "Delete memory",
317
+ variant: "primary",
318
+ iconClassName: "text-red-700 dark:text-red-500",
319
+ disabled: R.isPending,
320
+ onClick: () => J(
321
+ t.memoryId,
322
+ t.text,
323
+ t.description,
324
+ t.createdAt
325
+ ),
326
+ children: /* @__PURE__ */ e(xe, { size: "size-3", monotone: !0 })
327
+ }
328
+ )
329
+ }
330
+ ) })
331
+ ] }) })
332
+ ] }, t.memoryId)) }),
333
+ /* @__PURE__ */ e(ye, { children: /* @__PURE__ */ e(N, { children: /* @__PURE__ */ o(a, { colSpan: 4, children: [
334
+ u.total,
335
+ " memor",
336
+ u.total === 1 ? "y" : "ies"
337
+ ] }) }) })
338
+ ] }) : /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: "No memories stored." }))
339
+ ] })
340
+ }
341
+ )
342
+ ] });
343
+ };
344
+ export {
345
+ ve as UserMemoriesPanel,
346
+ ve as default
347
+ };
@@ -1,6 +1,6 @@
1
- import { getDefaultExportFromCjs as kn } from "./App.DnIeRbwI.js";
2
- import { visit as In } from "./useMarkdown.BAKJP0y9.js";
3
- import { toText as Cn } from "./index.CaDLl4vX.js";
1
+ import { getDefaultExportFromCjs as kn } from "./App.DP_1QDro.js";
2
+ import { visit as In } from "./useMarkdown.CZcXi3B7.js";
3
+ import { toText as Cn } from "./index.CTgvpxYe.js";
4
4
  function xn(e) {
5
5
  const t = e.regex, i = e.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), a = "decltype\\(auto\\)", r = "[a-zA-Z_]\\w*::", d = "(?!struct)(" + a + "|" + t.optional(r) + "[a-zA-Z_]\\w*" + t.optional("<[^<>]+>") + ")", c = {
6
6
  className: "type",