@payloadcms/next 3.0.0-beta.111 → 3.0.0-beta.112
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/elements/FormHeader/index.d.ts +9 -0
- package/dist/elements/FormHeader/index.d.ts.map +1 -0
- package/dist/elements/FormHeader/index.js +20 -0
- package/dist/elements/FormHeader/index.js.map +1 -0
- package/dist/elements/FormHeader/index.scss +6 -0
- package/dist/exports/utilities.d.ts +1 -0
- package/dist/exports/utilities.d.ts.map +1 -1
- package/dist/exports/utilities.js +1 -0
- package/dist/exports/utilities.js.map +1 -1
- package/dist/prod/styles.css +1 -1
- package/dist/routes/rest/auth/login.js +2 -2
- package/dist/routes/rest/auth/login.js.map +1 -1
- package/dist/routes/rest/auth/logout.d.ts.map +1 -1
- package/dist/routes/rest/auth/logout.js +3 -2
- package/dist/routes/rest/auth/logout.js.map +1 -1
- package/dist/routes/rest/auth/refresh.js +2 -2
- package/dist/routes/rest/auth/refresh.js.map +1 -1
- package/dist/routes/rest/auth/registerFirstUser.js +2 -2
- package/dist/routes/rest/auth/registerFirstUser.js.map +1 -1
- package/dist/routes/rest/auth/resetPassword.js +2 -2
- package/dist/routes/rest/auth/resetPassword.js.map +1 -1
- package/dist/scss/app.scss +166 -162
- package/dist/scss/colors.scss +256 -254
- package/dist/scss/resets.scss +9 -7
- package/dist/scss/toastify.scss +42 -40
- package/dist/scss/toasts.scss +105 -103
- package/dist/scss/type.scss +80 -79
- package/dist/utilities/initPage/handleAdminPage.d.ts +11 -11
- package/dist/utilities/initPage/handleAdminPage.d.ts.map +1 -1
- package/dist/utilities/initPage/handleAdminPage.js +7 -20
- package/dist/utilities/initPage/handleAdminPage.js.map +1 -1
- package/dist/utilities/initPage/handleAuthRedirect.d.ts +6 -3
- package/dist/utilities/initPage/handleAuthRedirect.d.ts.map +1 -1
- package/dist/utilities/initPage/handleAuthRedirect.js +23 -36
- package/dist/utilities/initPage/handleAuthRedirect.js.map +1 -1
- package/dist/utilities/initPage/index.d.ts +1 -1
- package/dist/utilities/initPage/index.d.ts.map +1 -1
- package/dist/utilities/initPage/index.js +20 -9
- package/dist/utilities/initPage/index.js.map +1 -1
- package/dist/utilities/initPage/shared.d.ts +2 -2
- package/dist/utilities/initPage/shared.d.ts.map +1 -1
- package/dist/utilities/initPage/shared.js +18 -13
- package/dist/utilities/initPage/shared.js.map +1 -1
- package/dist/views/API/index.scss +98 -96
- package/dist/views/Account/Settings/index.scss +37 -35
- package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +1 -1
- package/dist/views/CreateFirstUser/index.client.js.map +1 -1
- package/dist/views/CreateFirstUser/index.scss +13 -11
- package/dist/views/Dashboard/Default/index.scss +51 -49
- package/dist/views/Edit/Default/Auth/index.scss +56 -54
- package/dist/views/Edit/Default/index.scss +15 -13
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +9 -11
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
- package/dist/views/ForgotPassword/index.d.ts.map +1 -1
- package/dist/views/ForgotPassword/index.js +6 -6
- package/dist/views/ForgotPassword/index.js.map +1 -1
- package/dist/views/List/Default/index.scss +136 -134
- package/dist/views/LivePreview/IFrame/index.scss +8 -6
- package/dist/views/LivePreview/Preview/index.scss +32 -30
- package/dist/views/LivePreview/Toolbar/Controls/index.scss +49 -47
- package/dist/views/LivePreview/Toolbar/SizeInput/index.scss +11 -9
- package/dist/views/LivePreview/Toolbar/index.scss +33 -31
- package/dist/views/LivePreview/ToolbarArea/index.scss +5 -3
- package/dist/views/LivePreview/index.scss +48 -46
- package/dist/views/Login/LoginForm/index.js +1 -1
- package/dist/views/Login/LoginForm/index.js.map +1 -1
- package/dist/views/Login/LoginForm/index.scss +8 -6
- package/dist/views/Login/index.scss +8 -6
- package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
- package/dist/views/Logout/LogoutClient.js +77 -55
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/Logout/index.scss +17 -15
- package/dist/views/NotFound/index.scss +38 -36
- package/dist/views/ResetPassword/ResetPasswordForm/index.d.ts +7 -0
- package/dist/views/ResetPassword/ResetPasswordForm/index.d.ts.map +1 -0
- package/dist/views/ResetPassword/{index.client.js → ResetPasswordForm/index.js} +16 -19
- package/dist/views/ResetPassword/ResetPasswordForm/index.js.map +1 -0
- package/dist/views/ResetPassword/index.d.ts.map +1 -1
- package/dist/views/ResetPassword/index.js +17 -10
- package/dist/views/ResetPassword/index.js.map +1 -1
- package/dist/views/ResetPassword/index.scss +6 -26
- package/dist/views/Root/getViewFromConfig.d.ts.map +1 -1
- package/dist/views/Root/getViewFromConfig.js +0 -6
- package/dist/views/Root/getViewFromConfig.js.map +1 -1
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Root/index.js +5 -2
- package/dist/views/Root/index.js.map +1 -1
- package/dist/views/Unauthorized/index.d.ts.map +1 -1
- package/dist/views/Unauthorized/index.js +14 -7
- package/dist/views/Unauthorized/index.js.map +1 -1
- package/dist/views/Unauthorized/index.scss +4 -31
- package/dist/views/Verify/index.client.d.ts +7 -0
- package/dist/views/Verify/index.client.d.ts.map +1 -0
- package/dist/views/Verify/index.client.js +46 -0
- package/dist/views/Verify/index.client.js.map +1 -0
- package/dist/views/Verify/index.d.ts.map +1 -1
- package/dist/views/Verify/index.js +12 -11
- package/dist/views/Verify/index.js.map +1 -1
- package/dist/views/Verify/index.scss +13 -11
- package/dist/views/Version/Default/index.scss +52 -50
- package/dist/views/Version/RenderFieldsToDiff/Label/index.scss +5 -3
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.scss +29 -27
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.scss +11 -9
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.scss +12 -10
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.scss +12 -10
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.scss +12 -10
- package/dist/views/Version/RenderFieldsToDiff/index.scss +12 -10
- package/dist/views/Version/Restore/index.scss +57 -55
- package/dist/views/Version/SelectComparison/index.scss +12 -10
- package/dist/views/Version/SelectLocales/index.scss +6 -4
- package/dist/views/Versions/index.scss +78 -76
- package/package.json +6 -6
- package/dist/views/ResetPassword/index.client.d.ts +0 -7
- package/dist/views/ResetPassword/index.client.d.ts.map +0 -1
- package/dist/views/ResetPassword/index.client.js.map +0 -1
|
@@ -1,67 +1,69 @@
|
|
|
1
1
|
@import '../../../scss/styles.scss';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
@layer payload-default {
|
|
4
|
+
.dashboard {
|
|
5
|
+
width: 100%;
|
|
6
|
+
--gap: var(--base);
|
|
7
|
+
--cols: 5;
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
&__wrap {
|
|
10
|
+
padding-bottom: var(--spacing-view-bottom);
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: var(--base);
|
|
14
|
+
}
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
&__group {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
gap: var(--gap);
|
|
20
|
+
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
&__label {
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
&__card-list {
|
|
27
|
+
padding: 0;
|
|
28
|
+
margin: 0;
|
|
29
|
+
list-style: none;
|
|
30
|
+
gap: var(--gap);
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: repeat(var(--cols), 1fr);
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
.card {
|
|
35
|
+
height: 100%;
|
|
36
|
+
}
|
|
35
37
|
}
|
|
36
|
-
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
&__locked.locked {
|
|
40
|
+
align-items: unset;
|
|
41
|
+
justify-content: unset;
|
|
42
|
+
}
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
@include large-break {
|
|
45
|
+
--cols: 4;
|
|
46
|
+
}
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
@include mid-break {
|
|
49
|
+
--gap: var(--base);
|
|
50
|
+
--cols: 2;
|
|
51
|
+
}
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
@include small-break {
|
|
54
|
+
--cols: 2;
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
&__wrap {
|
|
57
|
+
gap: var(--base);
|
|
58
|
+
}
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
&__card-list {
|
|
61
|
+
gap: base(0.4);
|
|
62
|
+
}
|
|
61
63
|
}
|
|
62
|
-
}
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
@include extra-small-break {
|
|
66
|
+
--cols: 1;
|
|
67
|
+
}
|
|
66
68
|
}
|
|
67
69
|
}
|
|
@@ -1,76 +1,78 @@
|
|
|
1
1
|
@import '../../../../scss/styles.scss';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
gap: var(--base);
|
|
9
|
-
|
|
10
|
-
&__controls {
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
gap: calc(var(--base) / 2);
|
|
14
|
-
flex-wrap: wrap;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&__changing-password {
|
|
3
|
+
@layer payload-default {
|
|
4
|
+
.auth-fields {
|
|
5
|
+
padding: calc(var(--base) * 2);
|
|
6
|
+
background: var(--theme-elevation-50);
|
|
18
7
|
display: flex;
|
|
19
8
|
flex-direction: column;
|
|
20
9
|
gap: var(--base);
|
|
21
|
-
}
|
|
22
10
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
&__controls {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
gap: calc(var(--base) / 2);
|
|
15
|
+
flex-wrap: wrap;
|
|
16
|
+
}
|
|
26
17
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
&__changing-password {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: var(--base);
|
|
22
|
+
}
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
.btn {
|
|
25
|
+
margin: 0;
|
|
26
|
+
}
|
|
34
27
|
|
|
35
|
-
&
|
|
28
|
+
&__api-key-label {
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@include mid-break {
|
|
33
|
+
padding: var(--base);
|
|
36
34
|
gap: calc(var(--base) / 2);
|
|
35
|
+
|
|
36
|
+
&__changing-password {
|
|
37
|
+
gap: calc(var(--base) / 2);
|
|
38
|
+
}
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
|
-
}
|
|
40
41
|
|
|
41
|
-
.field-type.api-key {
|
|
42
|
-
|
|
42
|
+
.field-type.api-key {
|
|
43
|
+
margin-bottom: var(--base);
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
input {
|
|
46
|
+
@include formInput;
|
|
47
|
+
}
|
|
46
48
|
}
|
|
47
|
-
}
|
|
48
49
|
|
|
49
|
-
@keyframes highlight {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
@keyframes highlight {
|
|
51
|
+
0% {
|
|
52
|
+
background: var(--theme-success-250);
|
|
53
|
+
border: 1px solid var(--theme-success-500);
|
|
54
|
+
}
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
20% {
|
|
57
|
+
background: var(--theme-input-bg);
|
|
58
|
+
border: 1px solid var(--theme-elevation-250);
|
|
59
|
+
color: var(--theme-text);
|
|
60
|
+
}
|
|
60
61
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
80% {
|
|
63
|
+
background: var(--theme-input-bg);
|
|
64
|
+
border: 1px solid var(--theme-elevation-250);
|
|
65
|
+
color: var(--theme-text);
|
|
66
|
+
}
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
100% {
|
|
69
|
+
background: var(--theme-elevation-200);
|
|
70
|
+
border: 1px solid transparent;
|
|
71
|
+
color: var(--theme-elevation-400);
|
|
72
|
+
}
|
|
71
73
|
}
|
|
72
|
-
}
|
|
73
74
|
|
|
74
|
-
.highlight {
|
|
75
|
-
|
|
75
|
+
.highlight {
|
|
76
|
+
animation: highlight 10s;
|
|
77
|
+
}
|
|
76
78
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
@import '../../../scss/styles.scss';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
@layer payload-default {
|
|
4
|
+
.collection-edit {
|
|
5
|
+
width: 100%;
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
&__auth {
|
|
11
|
-
margin-bottom: base(1.6);
|
|
12
|
-
border-radius: var(--style-radius-s);
|
|
13
|
-
}
|
|
7
|
+
&__form {
|
|
8
|
+
height: 100%;
|
|
9
|
+
}
|
|
14
10
|
|
|
15
|
-
@include small-break {
|
|
16
11
|
&__auth {
|
|
17
|
-
margin-
|
|
18
|
-
|
|
12
|
+
margin-bottom: base(1.6);
|
|
13
|
+
border-radius: var(--style-radius-s);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@include small-break {
|
|
17
|
+
&__auth {
|
|
18
|
+
margin-top: 0;
|
|
19
|
+
margin-bottom: var(--base);
|
|
20
|
+
}
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/ForgotPassword/ForgotPasswordForm/index.tsx"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/ForgotPassword/ForgotPasswordForm/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAsHtC,CAAA"}
|
|
@@ -4,7 +4,8 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { EmailField, Form, FormSubmit, TextField, useConfig, useTranslation } from '@payloadcms/ui';
|
|
6
6
|
import { email, text } from 'payload/shared';
|
|
7
|
-
import React, {
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import { FormHeader } from '../../../elements/FormHeader/index.js';
|
|
8
9
|
export const ForgotPasswordForm = () => {
|
|
9
10
|
const $ = _c(17);
|
|
10
11
|
const {
|
|
@@ -73,12 +74,9 @@ export const ForgotPasswordForm = () => {
|
|
|
73
74
|
if (hasSubmitted) {
|
|
74
75
|
let t6;
|
|
75
76
|
if ($[15] !== t) {
|
|
76
|
-
t6 =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}), _jsx("p", {
|
|
80
|
-
children: t("authentication:checkYourEmailForPasswordReset")
|
|
81
|
-
})]
|
|
77
|
+
t6 = _jsx(FormHeader, {
|
|
78
|
+
description: t("authentication:checkYourEmailForPasswordReset"),
|
|
79
|
+
heading: t("authentication:emailSent")
|
|
82
80
|
});
|
|
83
81
|
$[15] = t;
|
|
84
82
|
$[16] = t6;
|
|
@@ -93,10 +91,9 @@ export const ForgotPasswordForm = () => {
|
|
|
93
91
|
handleResponse,
|
|
94
92
|
initialState,
|
|
95
93
|
method: "POST",
|
|
96
|
-
children: [_jsx(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
children: loginWithUsername ? t("authentication:forgotPasswordUsernameInstructions") : t("authentication:forgotPasswordEmailInstructions")
|
|
94
|
+
children: [_jsx(FormHeader, {
|
|
95
|
+
description: loginWithUsername ? t("authentication:forgotPasswordUsernameInstructions") : t("authentication:forgotPasswordEmailInstructions"),
|
|
96
|
+
heading: t("authentication:forgotPassword")
|
|
100
97
|
}), loginWithUsername ? _jsx(TextField, {
|
|
101
98
|
field: {
|
|
102
99
|
name: "username",
|
|
@@ -143,6 +140,7 @@ export const ForgotPasswordForm = () => {
|
|
|
143
140
|
siblingData: {}
|
|
144
141
|
})
|
|
145
142
|
}), _jsx(FormSubmit, {
|
|
143
|
+
size: "large",
|
|
146
144
|
children: t("general:submit")
|
|
147
145
|
})]
|
|
148
146
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","EmailField","Form","FormSubmit","TextField","useConfig","useTranslation","email","text","React","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","EmailField","Form","FormSubmit","TextField","useConfig","useTranslation","email","text","React","useState","FormHeader","ForgotPasswordForm","$","config","admin","t0","routes","t1","user","userSlug","api","t","hasSubmitted","setHasSubmitted","t2","collections","find","collection","slug","collectionConfig","loginWithUsername","auth","t3","res","successToast","errorToast","json","then","catch","handleResponse","t4","t5","Symbol","for","initialState","username","initialValue","valid","value","undefined","t6","_jsx","description","heading","_jsxs","action","method","children","field","name","label","required","validate","type","data","preferences","fields","req","payload","siblingData","autoComplete","value_0","size"],"sources":["../../../../src/views/ForgotPassword/ForgotPasswordForm/index.tsx"],"sourcesContent":["'use client'\n\nimport type { FormProps } from '@payloadcms/ui'\nimport type { FormState, PayloadRequest } from 'payload'\n\nimport { EmailField, Form, FormSubmit, TextField, useConfig, useTranslation } from '@payloadcms/ui'\nimport { email, text } from 'payload/shared'\nimport React, { useState } from 'react'\n\nimport { FormHeader } from '../../../elements/FormHeader/index.js'\n\nexport const ForgotPasswordForm: React.FC = () => {\n const { config } = useConfig()\n\n const {\n admin: { user: userSlug },\n routes: { api },\n } = config\n\n const { t } = useTranslation()\n const [hasSubmitted, setHasSubmitted] = useState(false)\n const collectionConfig = config.collections?.find((collection) => collection?.slug === userSlug)\n const loginWithUsername = collectionConfig?.auth?.loginWithUsername\n\n const handleResponse: FormProps['handleResponse'] = (res, successToast, errorToast) => {\n res\n .json()\n .then(() => {\n setHasSubmitted(true)\n successToast(t('general:submissionSuccessful'))\n })\n .catch(() => {\n errorToast(\n loginWithUsername\n ? t('authentication:usernameNotValid')\n : t('authentication:emailNotValid'),\n )\n })\n }\n\n const initialState: FormState = loginWithUsername\n ? {\n username: {\n initialValue: '',\n valid: true,\n value: undefined,\n },\n }\n : {\n email: {\n initialValue: '',\n valid: true,\n value: undefined,\n },\n }\n\n if (hasSubmitted) {\n return (\n <FormHeader\n description={t('authentication:checkYourEmailForPasswordReset')}\n heading={t('authentication:emailSent')}\n />\n )\n }\n\n return (\n <Form\n action={`${api}/${userSlug}/forgot-password`}\n handleResponse={handleResponse}\n initialState={initialState}\n method=\"POST\"\n >\n <FormHeader\n description={\n loginWithUsername\n ? t('authentication:forgotPasswordUsernameInstructions')\n : t('authentication:forgotPasswordEmailInstructions')\n }\n heading={t('authentication:forgotPassword')}\n />\n\n {loginWithUsername ? (\n <TextField\n field={{\n name: 'username',\n label: t('authentication:username'),\n required: true,\n }}\n validate={(value) =>\n text(value, {\n name: 'username',\n type: 'text',\n data: {},\n preferences: { fields: {} },\n req: {\n payload: {\n config,\n },\n t,\n } as unknown as PayloadRequest,\n required: true,\n siblingData: {},\n })\n }\n />\n ) : (\n <EmailField\n autoComplete=\"email\"\n field={{\n name: 'email',\n label: t('general:email'),\n required: true,\n }}\n validate={(value) =>\n email(value, {\n name: 'email',\n type: 'email',\n data: {},\n preferences: { fields: {} },\n req: { payload: { config }, t } as unknown as PayloadRequest,\n required: true,\n siblingData: {},\n })\n }\n />\n )}\n <FormSubmit size=\"large\">{t('general:submit')}</FormSubmit>\n </Form>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAKA,SAASC,UAAU,EAAEC,IAAI,EAAEC,UAAU,EAAEC,SAAS,EAAEC,SAAS,EAAEC,cAAc,QAAQ;AACnF,SAASC,KAAK,EAAEC,IAAI,QAAQ;AAC5B,OAAOC,KAAA,IAASC,QAAQ,QAAQ;AAEhC,SAASC,UAAU,QAAQ;AAE3B,OAAO,MAAMC,kBAAA,GAA+BA,CAAA;EAAA,MAAAC,CAAA,GAAAb,EAAA;EAC1C;IAAAc;EAAA,IAAmBT,SAAA;EAEnB;IAAAU,KAAA,EAAAC,EAAA;IAAAC,MAAA,EAAAC;EAAA,IAGIJ,MAAA;EAFK;IAAAK,IAAA,EAAAC;EAAA,IAAAJ,EAAkB;EACjB;IAAAK;EAAA,IAAAH,EAAO;EAGjB;IAAAI;EAAA,IAAchB,cAAA;EACd,OAAAiB,YAAA,EAAAC,eAAA,IAAwCd,QAAA,MAAS;EAAA,IAAAe,EAAA;EAAA,IAAAZ,CAAA,QAAAC,MAAA,CAAAY,WAAA,IAAAb,CAAA,QAAAO,QAAA;IACxBK,EAAA,GAAAX,MAAA,CAAAY,WAAA,EAAAC,IAAA,CAAAC,UAAA,IAAyCA,UAAA,EAAAC,IAAA,KAAqBT,QA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,WAAA;UAAA,CAMR;QAAA,C,GAINlB,IAAA,CAAAjD,UAAA;UAAAsE,IAAA,EAAiB;UAAAf,QAAA,EAASpC,CAAA,CAAE;QAAA,C;;;;;;;;;;;;;;;;;;;SA5D9BmB,E;CA+DJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/ForgotPassword/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAK7C,OAAO,KAAmB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/ForgotPassword/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAK7C,OAAO,KAAmB,MAAM,OAAO,CAAA;AAKvC,OAAO,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAA;AAG1D,eAAO,MAAM,uBAAuB,oBAAoB,CAAA;AAExD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA4DvD,CAAA"}
|
|
@@ -3,6 +3,7 @@ import { Button } from '@payloadcms/ui';
|
|
|
3
3
|
import { formatAdminURL, Translation } from '@payloadcms/ui/shared';
|
|
4
4
|
import LinkImport from 'next/link.js';
|
|
5
5
|
import React, { Fragment } from 'react';
|
|
6
|
+
import { FormHeader } from '../../elements/FormHeader/index.js';
|
|
6
7
|
import { ForgotPasswordForm } from './ForgotPasswordForm/index.js';
|
|
7
8
|
export { generateForgotPasswordMetadata } from './meta.js';
|
|
8
9
|
const Link = LinkImport.default || LinkImport;
|
|
@@ -32,10 +33,8 @@ export const ForgotPasswordView = ({
|
|
|
32
33
|
} = config;
|
|
33
34
|
if (user) {
|
|
34
35
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
35
|
-
children: [/*#__PURE__*/_jsx(
|
|
36
|
-
|
|
37
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
38
|
-
children: /*#__PURE__*/_jsx(Translation, {
|
|
36
|
+
children: [/*#__PURE__*/_jsx(FormHeader, {
|
|
37
|
+
description: /*#__PURE__*/_jsx(Translation, {
|
|
39
38
|
elements: {
|
|
40
39
|
'0': ({
|
|
41
40
|
children
|
|
@@ -49,8 +48,9 @@ export const ForgotPasswordView = ({
|
|
|
49
48
|
},
|
|
50
49
|
i18nKey: "authentication:loggedInChangePassword",
|
|
51
50
|
t: i18n.t
|
|
52
|
-
})
|
|
53
|
-
|
|
51
|
+
}),
|
|
52
|
+
heading: i18n.t('authentication:alreadyLoggedIn')
|
|
53
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
54
54
|
buttonStyle: "secondary",
|
|
55
55
|
el: "link",
|
|
56
56
|
Link: Link,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Button","formatAdminURL","Translation","LinkImport","React","Fragment","ForgotPasswordForm","generateForgotPasswordMetadata","Link","default","forgotPasswordBaseClass","ForgotPasswordView","initPageResult","req","i18n","payload","config","user","admin","routes","account","accountRoute","login","loginRoute","adminRoute","_jsxs","_jsx","
|
|
1
|
+
{"version":3,"file":"index.js","names":["Button","formatAdminURL","Translation","LinkImport","React","Fragment","FormHeader","ForgotPasswordForm","generateForgotPasswordMetadata","Link","default","forgotPasswordBaseClass","ForgotPasswordView","initPageResult","req","i18n","payload","config","user","admin","routes","account","accountRoute","login","loginRoute","adminRoute","_jsxs","_jsx","description","elements","0","children","href","path","i18nKey","t","heading","buttonStyle","el","size","to"],"sources":["../../../src/views/ForgotPassword/index.tsx"],"sourcesContent":["import type { AdminViewProps } from 'payload'\n\nimport { Button } from '@payloadcms/ui'\nimport { formatAdminURL, Translation } from '@payloadcms/ui/shared'\nimport LinkImport from 'next/link.js'\nimport React, { Fragment } from 'react'\n\nimport { FormHeader } from '../../elements/FormHeader/index.js'\nimport { ForgotPasswordForm } from './ForgotPasswordForm/index.js'\n\nexport { generateForgotPasswordMetadata } from './meta.js'\n\nconst Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default\nexport const forgotPasswordBaseClass = 'forgot-password'\n\nexport const ForgotPasswordView: React.FC<AdminViewProps> = ({ initPageResult }) => {\n const {\n req: {\n i18n,\n payload: { config },\n user,\n },\n } = initPageResult\n\n const {\n admin: {\n routes: { account: accountRoute, login: loginRoute },\n },\n routes: { admin: adminRoute },\n } = config\n\n if (user) {\n return (\n <Fragment>\n <FormHeader\n description={\n <Translation\n elements={{\n '0': ({ children }) => (\n <Link\n href={formatAdminURL({\n adminRoute,\n path: accountRoute,\n })}\n >\n {children}\n </Link>\n ),\n }}\n i18nKey=\"authentication:loggedInChangePassword\"\n t={i18n.t}\n />\n }\n heading={i18n.t('authentication:alreadyLoggedIn')}\n />\n <Button buttonStyle=\"secondary\" el=\"link\" Link={Link} size=\"large\" to={adminRoute}>\n {i18n.t('general:backToDashboard')}\n </Button>\n </Fragment>\n )\n }\n\n return (\n <Fragment>\n <ForgotPasswordForm />\n <Link\n href={formatAdminURL({\n adminRoute,\n path: loginRoute,\n })}\n >\n {i18n.t('authentication:backToLogin')}\n </Link>\n </Fragment>\n )\n}\n"],"mappings":";AAEA,SAASA,MAAM,QAAQ;AACvB,SAASC,cAAc,EAAEC,WAAW,QAAQ;AAC5C,OAAOC,UAAA,MAAgB;AACvB,OAAOC,KAAA,IAASC,QAAQ,QAAQ;AAEhC,SAASC,UAAU,QAAQ;AAC3B,SAASC,kBAAkB,QAAQ;AAEnC,SAASC,8BAA8B,QAAQ;AAE/C,MAAMC,IAAA,GAAQN,UAAA,CAAWO,OAAO,IAAIP,UAAA;AACpC,OAAO,MAAMQ,uBAAA,GAA0B;AAEvC,OAAO,MAAMC,kBAAA,GAA+CA,CAAC;EAAEC;AAAc,CAAE;EAC7E,MAAM;IACJC,GAAA,EAAK;MACHC,IAAI;MACJC,OAAA,EAAS;QAAEC;MAAM,CAAE;MACnBC;IAAI;EACL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