@versini/sassysaint 8.58.1 → 8.59.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.BM1-zFZM.js → AboutChangelog.VIMWfrJ2.js} +2 -2
  2. package/dist/chunks/{AboutEntry.DfLsDzG1.js → AboutEntry.HhBVaghX.js} +10 -10
  3. package/dist/chunks/{App.Balhn4jc.js → App.DFkumxrG.js} +1798 -1780
  4. package/dist/chunks/{Chart.B4r5Joie.js → Chart.DyiU5Qev.js} +2 -2
  5. package/dist/chunks/{ChatBubbleAssistant.B3aLcyR7.js → ChatBubbleAssistant.a1OalMkY.js} +4 -4
  6. package/dist/chunks/{ChatBubbleUser.L2nrTTCp.js → ChatBubbleUser.DP50erQL.js} +3 -3
  7. package/dist/chunks/{ChatHistoryTable.BY5_43Ex.js → ChatHistoryTable.9NfCFVTm.js} +5 -8
  8. package/dist/chunks/{HistoryEntry.vZ-0q0SU.js → HistoryEntry.Dz-6Alzn.js} +14 -14
  9. package/dist/chunks/{ProfileEntry.CWyib1bA.js → ProfileEntry.DJ4q6KoG.js} +2 -2
  10. package/dist/chunks/SettingsEntry.Cc0vofff.js +430 -0
  11. package/dist/chunks/{Table.BP4ZK6Pk.js → Table.CGJz3l0P.js} +2 -2
  12. package/dist/chunks/{UsageEntry.D7MV-eCu.js → UsageEntry.B6zt1DS_.js} +3 -3
  13. package/dist/chunks/UserMemoriesPanel.C2262GRv.js +693 -0
  14. package/dist/chunks/{index.BeBixuPU.js → index.6QVNoWZY.js} +616 -584
  15. package/dist/chunks/{index.Bc-X18su.js → index.BlzmTlvN.js} +2 -2
  16. package/dist/chunks/{index.CBnN5_87.js → index.CGcokH1z.js} +3 -3
  17. package/dist/chunks/{index.DbpavyRg.js → index.CV96FPnP.js} +1 -1
  18. package/dist/chunks/{index.CLbzehfM.js → index.D69nnw0C.js} +1 -1
  19. package/dist/chunks/{index.B5p62t9I.js → index.DXesyWpt.js} +1 -1
  20. package/dist/chunks/{index.C6J55Ybr.js → index.en8Vui5r.js} +1 -1
  21. package/dist/chunks/{useMarkdown.BaYRZB8J.js → useMarkdown.DRQL-Q_k.js} +6 -6
  22. package/dist/components/SassySaint/SassySaint.js +1 -1
  23. package/dist/index.js +4 -4
  24. package/dist/style.css +1 -1
  25. package/package.json +3 -3
  26. package/dist/chunks/SettingsEntry.cDiKWcA-.js +0 -777
  27. package/dist/chunks/UserMemoriesPanel.CGv5qTeN.js +0 -197
@@ -1,197 +0,0 @@
1
- import { jsxs as r, Fragment as z, jsx as e } from "react/jsx-runtime";
2
- import { n as B, LOCAL_STORAGE_PREFIX as w, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as H, LOCAL_STORAGE_SORT_MEMORY_COLUMN as V, useUserMemories as Y, useDeleteMemory as X, useDeleteAllMemories as $, te as J, L as K, j as N, C as O } from "./index.BeBixuPU.js";
3
- import { E as M, e as c, ConfirmationPanel as T, se as Q, st as W } from "./App.Balhn4jc.js";
4
- import { useState as s, useRef as Z } from "react";
5
- import { j as ee, D as te, G as h, M as o, F as re, H as ne, l as oe, U as le } from "./Table.BP4ZK6Pk.js";
6
- const de = ({
7
- open: u,
8
- onOpenChange: f,
9
- user: a
10
- }) => {
11
- const { getAccessToken: d } = B(), [k] = s(void 0), [R, E] = M({
12
- key: w + H,
13
- initialValue: c.DESC
14
- }), [L, _] = M({
15
- key: w + V,
16
- initialValue: "createdAt"
17
- }), [A, b] = s(R || c.DESC), [v, I] = s(
18
- L || "createdAt"
19
- ), { data: l, isLoading: C, isError: x } = Y({
20
- user: a,
21
- query: k,
22
- getAccessToken: d,
23
- enabled: u
24
- }), D = X({ getAccessToken: d }), y = $({ getAccessToken: d }), [j, p] = s(!1), i = Z(null), [F, g] = s(!1), G = (t, n, m) => {
25
- i.current = { id: t, text: n, createdAt: m }, p(!0);
26
- }, P = () => {
27
- i.current && D.mutate({ user: a, memoryId: i.current.id });
28
- }, U = () => {
29
- a && g(!0);
30
- }, q = () => {
31
- a && y.mutate({ user: a });
32
- };
33
- return /* @__PURE__ */ r(z, { children: [
34
- /* @__PURE__ */ r(
35
- T,
36
- {
37
- showConfirmation: j,
38
- setShowConfirmation: p,
39
- action: P,
40
- customStrings: {
41
- title: "Delete memory",
42
- confirmAction: "Delete",
43
- cancelAction: "Cancel"
44
- },
45
- children: [
46
- /* @__PURE__ */ e("p", { className: "m-0", children: "Are you sure you want to delete this memory?" }),
47
- /* @__PURE__ */ r("ul", { className: "m-0 mt-2 list-disc list-inside text-xs opacity-80", children: [
48
- /* @__PURE__ */ r("li", { children: [
49
- "Excerpt: ",
50
- i.current?.text?.slice(0, 80) || ""
51
- ] }),
52
- /* @__PURE__ */ r("li", { children: [
53
- "Created:",
54
- " ",
55
- i.current?.createdAt ? new Date(i.current.createdAt).toLocaleString() : "-"
56
- ] })
57
- ] })
58
- ]
59
- }
60
- ),
61
- /* @__PURE__ */ e(
62
- T,
63
- {
64
- showConfirmation: F,
65
- setShowConfirmation: g,
66
- action: q,
67
- customStrings: {
68
- title: "Delete all memories",
69
- confirmAction: "Delete all",
70
- cancelAction: "Cancel"
71
- },
72
- children: /* @__PURE__ */ e("p", { className: "m-0", children: "This will permanently delete all memories for this user. This action cannot be undone." })
73
- }
74
- ),
75
- /* @__PURE__ */ e(
76
- Q,
77
- {
78
- open: u,
79
- onOpenChange: (t) => f(t),
80
- title: "User Memories",
81
- animation: !0,
82
- animationType: "fade",
83
- footer: /* @__PURE__ */ r(K, { columnGap: 2, alignHorizontal: "flex-end", children: [
84
- /* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(
85
- O,
86
- {
87
- mode: "dark",
88
- variant: "secondary",
89
- noBorder: !0,
90
- focusMode: "light",
91
- onClick: () => f(!1),
92
- children: "Close"
93
- }
94
- ) }),
95
- /* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(
96
- O,
97
- {
98
- mode: "dark",
99
- focusMode: "light",
100
- variant: "danger",
101
- disabled: y.isPending || (l?.total ?? 0) === 0,
102
- onClick: U,
103
- children: "Delete All"
104
- }
105
- ) })
106
- ] }),
107
- children: /* @__PURE__ */ r("div", { className: "flex flex-col sm:flex-row max-h-[75vh] min-h-[60vh] pt-2", children: [
108
- C && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading memories..." }),
109
- x && /* @__PURE__ */ e("p", { className: "m-0 text-red-500", children: "Failed to load memories." }),
110
- !C && !x && (l && l.items.length > 0 ? /* @__PURE__ */ r(ee, { compact: !0, stickyHeader: !0, stickyFooter: !0, children: [
111
- /* @__PURE__ */ e(te, { children: /* @__PURE__ */ r(h, { children: [
112
- /* @__PURE__ */ e(o, { className: "sr-only", children: "Row" }),
113
- /* @__PURE__ */ e(o, { children: "Memory" }),
114
- /* @__PURE__ */ e(
115
- re,
116
- {
117
- buttonClassName: "text-xs sm:text-sm",
118
- cellId: "createdAt",
119
- align: "left",
120
- sortDirection: A,
121
- sortedCell: v,
122
- onClick: () => {
123
- I("createdAt"), _("createdAt"), b((t) => {
124
- const n = t === c.ASC ? c.DESC : c.ASC;
125
- return E(n), n;
126
- });
127
- },
128
- children: "Date"
129
- }
130
- ),
131
- /* @__PURE__ */ e(o, { align: "right", children: "Actions" })
132
- ] }) }),
133
- /* @__PURE__ */ e(ne, { children: [...l.items].sort((t, n) => {
134
- const m = t.createdAt ? new Date(t.createdAt).getTime() : 0, S = n.createdAt ? new Date(n.createdAt).getTime() : 0;
135
- return A === c.ASC ? m - S : S - m;
136
- }).map((t, n) => /* @__PURE__ */ r(h, { children: [
137
- /* @__PURE__ */ e(o, { className: "text-gray-400", children: n + 1 }),
138
- /* @__PURE__ */ e(
139
- o,
140
- {
141
- className: "max-w-[100px] text-white sm:max-w-full text-xs sm:text-sm",
142
- style: {
143
- wordBreak: "break-word"
144
- },
145
- children: t.text
146
- }
147
- ),
148
- /* @__PURE__ */ e(
149
- o,
150
- {
151
- component: "th",
152
- scope: "row",
153
- className: "text-gray-400 sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none",
154
- children: t.createdAt ? new Date(t.createdAt).toLocaleDateString() : "-"
155
- }
156
- ),
157
- /* @__PURE__ */ e(o, { className: "align-top", align: "right", children: /* @__PURE__ */ e(
158
- W,
159
- {
160
- label: "Delete memory",
161
- mode: "alt-system",
162
- placement: "top",
163
- trigger: /* @__PURE__ */ e(
164
- J,
165
- {
166
- focusMode: "alt-system",
167
- noBorder: !0,
168
- label: "Delete memory",
169
- variant: "primary",
170
- iconClassName: "text-red-700 dark:text-red-500",
171
- disabled: D.isPending,
172
- onClick: () => G(
173
- t.memoryId,
174
- t.text,
175
- t.createdAt
176
- ),
177
- children: /* @__PURE__ */ e(oe, { size: "size-3", monotone: !0 })
178
- }
179
- )
180
- }
181
- ) })
182
- ] }, t.memoryId)) }),
183
- /* @__PURE__ */ e(le, { children: /* @__PURE__ */ e(h, { children: /* @__PURE__ */ r(o, { colSpan: 4, children: [
184
- l.total,
185
- " memor",
186
- l.total === 1 ? "y" : "ies"
187
- ] }) }) })
188
- ] }) : /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: "No memories stored." }))
189
- ] })
190
- }
191
- )
192
- ] });
193
- };
194
- export {
195
- de as UserMemoriesPanel,
196
- de as default
197
- };