@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.
- package/dist/chunks/{AboutChangelog.C1qlLGOL.js → AboutChangelog.DVjlL3Qi.js} +2 -2
- package/dist/chunks/{AboutEntry.MVgAFIQi.js → AboutEntry.d-oqfbRb.js} +5 -5
- package/dist/chunks/{App.DnIeRbwI.js → App.DP_1QDro.js} +16 -16
- package/dist/chunks/{Chart.D4LA295Y.js → Chart.BxgzH0Ym.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.B9uKu0Zq.js → ChatBubbleAssistant.CAVS6c3_.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.DBArpWQj.js → ChatBubbleUser.Cyzg2idO.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.DpDPvpwx.js → ChatHistoryTable.gB3WSJ7G.js} +3 -3
- package/dist/chunks/{HistoryEntry.DyYYZjb-.js → HistoryEntry.CQyBOAhi.js} +3 -3
- package/dist/chunks/{ProfileEntry.BkfA5ilN.js → ProfileEntry.CWwyc27k.js} +2 -2
- package/dist/chunks/SettingsEntry.DKbi9HA-.js +444 -0
- package/dist/chunks/{Table.BSsGkgB1.js → Table.B65cZ6GW.js} +2 -2
- package/dist/chunks/{UsageEntry.DA9Z1z3A.js → UsageEntry.BdgexwbQ.js} +3 -3
- package/dist/chunks/UserMemoriesPanel.CXJlDOY-.js +347 -0
- package/dist/chunks/{index.BtXviUD3.js → index.B-25p6O_.js} +3 -3
- package/dist/chunks/index.C0hBKDgD.js +357 -0
- package/dist/chunks/{index.CaDLl4vX.js → index.CTgvpxYe.js} +1 -1
- package/dist/chunks/{index.Dta1BrG6.js → index.Cfv_6CcW.js} +1 -1
- package/dist/chunks/{index.DXaLvF3n.js → index.DjSi9ICW.js} +487 -455
- package/dist/chunks/{index.CKRmoShZ.js → index.DtU6Al_9.js} +1 -1
- package/dist/chunks/{index.DH2l4xnG.js → index.TU_lKm2K.js} +1 -1
- package/dist/chunks/{index.B3XB6cTq.js → index.edqJduuy.js} +2 -2
- package/dist/chunks/{useMarkdown.BAKJP0y9.js → useMarkdown.CZcXi3B7.js} +6 -6
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
- package/dist/chunks/SettingsEntry.CfM4w4sE.js +0 -794
- package/dist/chunks/UserMemoriesPanel.BI0GoJUN.js +0 -208
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { jsxs as r, Fragment as B, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { n as V, LOCAL_STORAGE_PREFIX as N, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as Y, LOCAL_STORAGE_SORT_MEMORY_COLUMN as X, useUserMemories as $, useDeleteMemory as J, useDeleteAllMemories as K, L as O, j as u, te as Q, C as M } from "./index.DXaLvF3n.js";
|
|
3
|
-
import { E as T, e as c, ConfirmationPanel as R, oe as W, st as Z } from "./App.DnIeRbwI.js";
|
|
4
|
-
import f from "clsx";
|
|
5
|
-
import { useState as a, useRef as ee } from "react";
|
|
6
|
-
import { j as te, D as re, G as x, M as n, F as oe, H as ne, l as ie, U as le } from "./Table.BSsGkgB1.js";
|
|
7
|
-
const ue = ({
|
|
8
|
-
open: A,
|
|
9
|
-
onOpenChange: C,
|
|
10
|
-
user: s
|
|
11
|
-
}) => {
|
|
12
|
-
const { getAccessToken: h } = V(), [E] = a(void 0), [L, _] = T({
|
|
13
|
-
key: N + Y,
|
|
14
|
-
initialValue: c.DESC
|
|
15
|
-
}), [b, v] = T({
|
|
16
|
-
key: N + X,
|
|
17
|
-
initialValue: "createdAt"
|
|
18
|
-
}), [p, I] = a(L || c.DESC), [G, j] = a(
|
|
19
|
-
b || "createdAt"
|
|
20
|
-
), { data: l, isLoading: D, isError: y } = $({
|
|
21
|
-
user: s,
|
|
22
|
-
query: E,
|
|
23
|
-
getAccessToken: h,
|
|
24
|
-
enabled: A
|
|
25
|
-
}), g = J({ getAccessToken: h }), S = K({ getAccessToken: h }), [F, w] = a(!1), i = ee(null), [P, k] = a(!1), U = (t, o, m, d) => {
|
|
26
|
-
i.current = { id: t, text: o, description: m, createdAt: d }, w(!0);
|
|
27
|
-
}, z = () => {
|
|
28
|
-
i.current && g.mutate({ user: s, memoryId: i.current.id });
|
|
29
|
-
}, H = () => {
|
|
30
|
-
s && k(!0);
|
|
31
|
-
}, q = () => {
|
|
32
|
-
s && S.mutate({ user: s });
|
|
33
|
-
};
|
|
34
|
-
return /* @__PURE__ */ r(B, { children: [
|
|
35
|
-
/* @__PURE__ */ r(
|
|
36
|
-
R,
|
|
37
|
-
{
|
|
38
|
-
showConfirmation: F,
|
|
39
|
-
setShowConfirmation: w,
|
|
40
|
-
action: z,
|
|
41
|
-
customStrings: {
|
|
42
|
-
title: "Delete memory",
|
|
43
|
-
confirmAction: "Delete",
|
|
44
|
-
cancelAction: "Cancel"
|
|
45
|
-
},
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ e("p", { className: "m-0", children: "Are you sure you want to delete this memory?" }),
|
|
48
|
-
/* @__PURE__ */ r("ul", { className: "m-0 mt-2 list-disc list-inside text-xs opacity-80", children: [
|
|
49
|
-
/* @__PURE__ */ r("li", { children: [
|
|
50
|
-
"Excerpt:",
|
|
51
|
-
" ",
|
|
52
|
-
(i.current?.description || i.current?.text || "").slice(0, 80)
|
|
53
|
-
] }),
|
|
54
|
-
/* @__PURE__ */ r("li", { children: [
|
|
55
|
-
"Created:",
|
|
56
|
-
" ",
|
|
57
|
-
i.current?.createdAt ? new Date(i.current.createdAt).toLocaleString() : "-"
|
|
58
|
-
] })
|
|
59
|
-
] })
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
),
|
|
63
|
-
/* @__PURE__ */ e(
|
|
64
|
-
R,
|
|
65
|
-
{
|
|
66
|
-
showConfirmation: P,
|
|
67
|
-
setShowConfirmation: k,
|
|
68
|
-
action: q,
|
|
69
|
-
customStrings: {
|
|
70
|
-
title: "Delete all memories",
|
|
71
|
-
confirmAction: "Delete all",
|
|
72
|
-
cancelAction: "Cancel"
|
|
73
|
-
},
|
|
74
|
-
children: /* @__PURE__ */ e("p", { className: "m-0", children: "This will permanently delete all memories for this user. This action cannot be undone." })
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
/* @__PURE__ */ e(
|
|
78
|
-
W,
|
|
79
|
-
{
|
|
80
|
-
open: A,
|
|
81
|
-
onOpenChange: (t) => C(t),
|
|
82
|
-
title: "User Memories",
|
|
83
|
-
animation: !0,
|
|
84
|
-
animationType: "fade",
|
|
85
|
-
footer: /* @__PURE__ */ r(O, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
|
86
|
-
/* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(
|
|
87
|
-
M,
|
|
88
|
-
{
|
|
89
|
-
mode: "dark",
|
|
90
|
-
variant: "secondary",
|
|
91
|
-
noBorder: !0,
|
|
92
|
-
focusMode: "light",
|
|
93
|
-
onClick: () => C(!1),
|
|
94
|
-
children: "Close"
|
|
95
|
-
}
|
|
96
|
-
) }),
|
|
97
|
-
/* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(
|
|
98
|
-
M,
|
|
99
|
-
{
|
|
100
|
-
mode: "dark",
|
|
101
|
-
focusMode: "light",
|
|
102
|
-
variant: "danger",
|
|
103
|
-
disabled: S.isPending || (l?.total ?? 0) === 0,
|
|
104
|
-
onClick: H,
|
|
105
|
-
children: "Delete All"
|
|
106
|
-
}
|
|
107
|
-
) })
|
|
108
|
-
] }),
|
|
109
|
-
children: /* @__PURE__ */ r("div", { className: "flex flex-col sm:flex-row max-h-[75vh] min-h-[60vh] pt-2", children: [
|
|
110
|
-
D && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading memories..." }),
|
|
111
|
-
y && /* @__PURE__ */ e("p", { className: "m-0 text-red-500", children: "Failed to load memories." }),
|
|
112
|
-
!D && !y && (l && l.items.length > 0 ? /* @__PURE__ */ r(te, { stickyHeader: !0, stickyFooter: !0, compact: !0, mode: "alt-system", children: [
|
|
113
|
-
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ r(x, { children: [
|
|
114
|
-
/* @__PURE__ */ e(n, { className: "sr-only", children: "Row" }),
|
|
115
|
-
/* @__PURE__ */ e(n, { children: "Memory" }),
|
|
116
|
-
/* @__PURE__ */ e(
|
|
117
|
-
oe,
|
|
118
|
-
{
|
|
119
|
-
focusMode: "system",
|
|
120
|
-
buttonClassName: "text-xs sm:text-sm",
|
|
121
|
-
cellId: "createdAt",
|
|
122
|
-
align: "left",
|
|
123
|
-
sortDirection: p,
|
|
124
|
-
sortedCell: G,
|
|
125
|
-
onClick: () => {
|
|
126
|
-
j("createdAt"), v("createdAt"), I((t) => {
|
|
127
|
-
const o = t === c.ASC ? c.DESC : c.ASC;
|
|
128
|
-
return _(o), o;
|
|
129
|
-
});
|
|
130
|
-
},
|
|
131
|
-
children: "Date"
|
|
132
|
-
}
|
|
133
|
-
),
|
|
134
|
-
/* @__PURE__ */ e(n, { align: "right", children: "Actions" })
|
|
135
|
-
] }) }),
|
|
136
|
-
/* @__PURE__ */ e(ne, { children: [...l.items].sort((t, o) => {
|
|
137
|
-
const m = t.createdAt ? new Date(t.createdAt).getTime() : 0, d = o.createdAt ? new Date(o.createdAt).getTime() : 0;
|
|
138
|
-
return p === c.ASC ? m - d : d - m;
|
|
139
|
-
}).map((t, o) => /* @__PURE__ */ r(x, { children: [
|
|
140
|
-
/* @__PURE__ */ e(n, { className: f("dark:text-gray-400"), children: o + 1 }),
|
|
141
|
-
/* @__PURE__ */ e(
|
|
142
|
-
n,
|
|
143
|
-
{
|
|
144
|
-
className: f(
|
|
145
|
-
"dark:text-white",
|
|
146
|
-
"max-w-[100px] sm:max-w-[400px]",
|
|
147
|
-
"text-xs sm:text-sm"
|
|
148
|
-
),
|
|
149
|
-
style: {
|
|
150
|
-
wordBreak: "break-word"
|
|
151
|
-
},
|
|
152
|
-
children: t.description || t.text
|
|
153
|
-
}
|
|
154
|
-
),
|
|
155
|
-
/* @__PURE__ */ e(
|
|
156
|
-
n,
|
|
157
|
-
{
|
|
158
|
-
component: "th",
|
|
159
|
-
scope: "row",
|
|
160
|
-
className: f(
|
|
161
|
-
"dark:text-gray-400",
|
|
162
|
-
"sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
|
|
163
|
-
),
|
|
164
|
-
children: t.createdAt ? new Date(t.createdAt).toLocaleDateString() : "-"
|
|
165
|
-
}
|
|
166
|
-
),
|
|
167
|
-
/* @__PURE__ */ e(n, { className: "align-top", align: "right", children: /* @__PURE__ */ e(O, { columnGap: 1, alignHorizontal: "flex-end", children: /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(
|
|
168
|
-
Z,
|
|
169
|
-
{
|
|
170
|
-
label: "Delete memory",
|
|
171
|
-
mode: "system",
|
|
172
|
-
placement: "top",
|
|
173
|
-
trigger: /* @__PURE__ */ e(
|
|
174
|
-
Q,
|
|
175
|
-
{
|
|
176
|
-
focusMode: "system",
|
|
177
|
-
noBorder: !0,
|
|
178
|
-
label: "Delete memory",
|
|
179
|
-
variant: "primary",
|
|
180
|
-
iconClassName: "text-red-700 dark:text-red-500",
|
|
181
|
-
disabled: g.isPending,
|
|
182
|
-
onClick: () => U(
|
|
183
|
-
t.memoryId,
|
|
184
|
-
t.text,
|
|
185
|
-
t.description,
|
|
186
|
-
t.createdAt
|
|
187
|
-
),
|
|
188
|
-
children: /* @__PURE__ */ e(ie, { size: "size-3", monotone: !0 })
|
|
189
|
-
}
|
|
190
|
-
)
|
|
191
|
-
}
|
|
192
|
-
) }) }) })
|
|
193
|
-
] }, t.memoryId)) }),
|
|
194
|
-
/* @__PURE__ */ e(le, { children: /* @__PURE__ */ e(x, { children: /* @__PURE__ */ r(n, { colSpan: 4, children: [
|
|
195
|
-
l.total,
|
|
196
|
-
" memor",
|
|
197
|
-
l.total === 1 ? "y" : "ies"
|
|
198
|
-
] }) }) })
|
|
199
|
-
] }) : /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: "No memories stored." }))
|
|
200
|
-
] })
|
|
201
|
-
}
|
|
202
|
-
)
|
|
203
|
-
] });
|
|
204
|
-
};
|
|
205
|
-
export {
|
|
206
|
-
ue as UserMemoriesPanel,
|
|
207
|
-
ue as default
|
|
208
|
-
};
|