@better-auth-ui/heroui 1.6.12 → 1.6.13
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/index.js
CHANGED
|
@@ -903,17 +903,19 @@ function it({ path: e, socialLayout: t, socialPosition: n, view: r, ...i }) {
|
|
|
903
903
|
function at() {
|
|
904
904
|
let e = Ge();
|
|
905
905
|
return ze(() => {
|
|
906
|
-
let t = e.getQueryCache()
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
906
|
+
let t = e.getQueryCache(), n = t.config.onError;
|
|
907
|
+
t.config.onError = (e, t) => {
|
|
908
|
+
if (n?.(e, t), !Ue({ queryKey: o.all }, t)) return;
|
|
909
|
+
let r = e;
|
|
910
|
+
r?.error && Y.danger(r.error.message);
|
|
911
|
+
};
|
|
912
|
+
let r = e.getMutationCache(), i = r.config.onError;
|
|
913
|
+
return r.config.onError = (e, t, n, r, o) => {
|
|
914
|
+
if (i?.(e, t, n, r, o), !He({ mutationKey: a.all }, r)) return;
|
|
915
|
+
let s = e;
|
|
916
|
+
Y.danger(s.error?.message || s.message);
|
|
917
|
+
}, () => {
|
|
918
|
+
t.config.onError = n, r.config.onError = i;
|
|
917
919
|
};
|
|
918
920
|
}, [e]), null;
|
|
919
921
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth-ui/heroui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@gravity-ui/icons": "^2.18.0",
|
|
36
36
|
"@heroui/react": "^3.1.0",
|
|
37
37
|
"@heroui/styles": "^3.1.0",
|
|
38
|
-
"@internationalized/date": "^3.12.
|
|
38
|
+
"@internationalized/date": "^3.12.2",
|
|
39
39
|
"@tanstack/react-pacer": "^0.22.1",
|
|
40
40
|
"@tanstack/react-query": "^5.100.14",
|
|
41
41
|
"@testing-library/react": "^16.3.2",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@gravity-ui/icons": ">=2.18.0",
|
|
57
57
|
"@heroui/react": ">=3.1.0",
|
|
58
58
|
"@heroui/styles": ">=3.1.0",
|
|
59
|
-
"@internationalized/date": ">=3.12.
|
|
59
|
+
"@internationalized/date": ">=3.12.2",
|
|
60
60
|
"@tanstack/react-pacer": ">=0.22.1",
|
|
61
61
|
"@tanstack/react-query": ">=5.100.14",
|
|
62
62
|
"better-auth": ">=1.6.11",
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
ComboBox,
|
|
9
9
|
DateField,
|
|
10
10
|
DatePicker,
|
|
11
|
+
type DateValue,
|
|
11
12
|
FieldError,
|
|
12
13
|
Input,
|
|
13
14
|
InputGroup,
|
|
@@ -387,7 +388,7 @@ export function AdditionalField({
|
|
|
387
388
|
<DatePicker
|
|
388
389
|
className="w-full [&[data-required=true]>.label]:after:content-none"
|
|
389
390
|
name={name}
|
|
390
|
-
defaultValue={defaultValue}
|
|
391
|
+
defaultValue={defaultValue as unknown as DateValue}
|
|
391
392
|
granularity={isDateTime ? "minute" : "day"}
|
|
392
393
|
isDisabled={isPending}
|
|
393
394
|
isReadOnly={field.readOnly}
|
|
@@ -12,30 +12,47 @@ export function ErrorToaster() {
|
|
|
12
12
|
const queryClient = useQueryClient()
|
|
13
13
|
|
|
14
14
|
useEffect(() => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
if (!matchQuery({ queryKey: authQueryKeys.all }, event.query)) return
|
|
15
|
+
const queryCache = queryClient.getQueryCache()
|
|
16
|
+
const previousQueryOnError = queryCache.config.onError
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
queryCache.config.onError = (error, query) => {
|
|
19
|
+
previousQueryOnError?.(error, query)
|
|
20
|
+
|
|
21
|
+
if (!matchQuery({ queryKey: authQueryKeys.all }, query)) return
|
|
22
|
+
|
|
23
|
+
const err = error as BetterFetchError
|
|
20
24
|
if (err?.error) toast.danger(err.error.message)
|
|
21
|
-
}
|
|
25
|
+
}
|
|
22
26
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
.subscribe((event) => {
|
|
26
|
-
if (event.type !== "updated" || event.action.type !== "error") return
|
|
27
|
-
if (
|
|
28
|
-
!matchMutation({ mutationKey: authMutationKeys.all }, event.mutation)
|
|
29
|
-
)
|
|
30
|
-
return
|
|
27
|
+
const mutationCache = queryClient.getMutationCache()
|
|
28
|
+
const previousMutationOnError = mutationCache.config.onError
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
mutationCache.config.onError = (
|
|
31
|
+
error,
|
|
32
|
+
variables,
|
|
33
|
+
onMutateResult,
|
|
34
|
+
mutation,
|
|
35
|
+
context
|
|
36
|
+
) => {
|
|
37
|
+
previousMutationOnError?.(
|
|
38
|
+
error,
|
|
39
|
+
variables,
|
|
40
|
+
onMutateResult,
|
|
41
|
+
mutation,
|
|
42
|
+
context
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
if (!matchMutation({ mutationKey: authMutationKeys.all }, mutation)) {
|
|
46
|
+
return
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const err = error as BetterFetchError
|
|
50
|
+
toast.danger(err.error?.message || err.message)
|
|
51
|
+
}
|
|
35
52
|
|
|
36
53
|
return () => {
|
|
37
|
-
|
|
38
|
-
|
|
54
|
+
queryCache.config.onError = previousQueryOnError
|
|
55
|
+
mutationCache.config.onError = previousMutationOnError
|
|
39
56
|
}
|
|
40
57
|
}, [queryClient])
|
|
41
58
|
|