@payloadcms/next 3.0.0-beta.110 → 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/layouts/Root/index.js +6 -6
- package/dist/layouts/Root/index.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/routes/rest/index.d.ts +12 -12
- package/dist/routes/rest/index.d.ts.map +1 -1
- package/dist/routes/rest/index.js +17 -15
- package/dist/routes/rest/index.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/getNextRequestI18n.js +2 -2
- package/dist/utilities/getNextRequestI18n.js.map +1 -1
- 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 +21 -10
- 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/utilities/initReq.js +1 -1
- package/dist/utilities/initReq.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.js +2 -2
- package/dist/views/Edit/Default/index.js.map +1 -1
- 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.client.js +2 -2
- package/dist/views/LivePreview/index.client.js.map +1 -1
- 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.d.ts +5 -5
- package/dist/views/NotFound/index.d.ts.map +1 -1
- package/dist/views/NotFound/index.js +4 -2
- package/dist/views/NotFound/index.js.map +1 -1
- 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 +5 -5
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Root/index.js +9 -4
- package/dist/views/Root/index.js.map +1 -1
- package/dist/views/Root/meta.d.ts +5 -5
- package/dist/views/Root/meta.d.ts.map +1 -1
- package/dist/views/Root/meta.js +2 -1
- package/dist/views/Root/meta.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/Version/index.d.ts.map +1 -1
- package/dist/views/Version/index.js +2 -0
- package/dist/views/Version/index.js.map +1 -1
- package/dist/views/Versions/getLatestVersion.d.ts +1 -0
- package/dist/views/Versions/getLatestVersion.d.ts.map +1 -1
- package/dist/views/Versions/getLatestVersion.js +14 -3
- package/dist/views/Versions/getLatestVersion.js.map +1 -1
- package/dist/views/Versions/index.d.ts.map +1 -1
- package/dist/views/Versions/index.js +2 -0
- package/dist/views/Versions/index.js.map +1 -1
- package/dist/views/Versions/index.scss +78 -76
- package/package.json +9 -9
- 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
package/dist/scss/toasts.scss
CHANGED
|
@@ -1,140 +1,142 @@
|
|
|
1
1
|
@import './styles.scss';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
@layer payload-default {
|
|
4
|
+
.payload-toast-container {
|
|
5
|
+
padding: 0;
|
|
6
|
+
margin: 0;
|
|
7
|
+
|
|
8
|
+
.payload-toast-close-button {
|
|
9
|
+
position: absolute;
|
|
10
|
+
order: 3;
|
|
11
|
+
left: unset;
|
|
12
|
+
inset-inline-end: base(0.8);
|
|
13
|
+
top: 50%;
|
|
14
|
+
transform: translateY(-50%);
|
|
15
|
+
color: var(--theme-elevation-600);
|
|
16
|
+
background: unset;
|
|
17
|
+
border: none;
|
|
18
|
+
|
|
19
|
+
svg {
|
|
20
|
+
width: base(0.8);
|
|
21
|
+
height: base(0.8);
|
|
22
|
+
}
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
&:hover {
|
|
25
|
+
color: var(--theme-elevation-250);
|
|
26
|
+
background: none;
|
|
27
|
+
}
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
[dir='RTL'] & {
|
|
30
|
+
right: unset;
|
|
31
|
+
left: 0.5rem;
|
|
32
|
+
}
|
|
31
33
|
}
|
|
32
|
-
}
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
.toast-title {
|
|
36
|
+
line-height: base(1);
|
|
37
|
+
margin-right: base(1);
|
|
38
|
+
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
width: 100%;
|
|
48
|
-
border-radius: 4px;
|
|
49
|
-
border: 1px solid var(--theme-border-color);
|
|
50
|
-
background: var(--theme-input-bg);
|
|
51
|
-
box-shadow:
|
|
52
|
-
0px 10px 4px -8px rgba(0, 2, 4, 0.02),
|
|
53
|
-
0px 2px 3px 0px rgba(0, 2, 4, 0.05);
|
|
54
|
-
|
|
55
|
-
.toast-content {
|
|
56
|
-
transition: opacity 100ms cubic-bezier(0.55, 0.055, 0.675, 0.19);
|
|
40
|
+
.payload-toast-item {
|
|
41
|
+
padding: base(0.8);
|
|
42
|
+
color: var(--theme-elevation-800);
|
|
43
|
+
font-style: normal;
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
display: flex;
|
|
46
|
+
gap: 1rem;
|
|
47
|
+
align-items: center;
|
|
57
48
|
width: 100%;
|
|
58
|
-
|
|
49
|
+
border-radius: 4px;
|
|
50
|
+
border: 1px solid var(--theme-border-color);
|
|
51
|
+
background: var(--theme-input-bg);
|
|
52
|
+
box-shadow:
|
|
53
|
+
0px 10px 4px -8px rgba(0, 2, 4, 0.02),
|
|
54
|
+
0px 2px 3px 0px rgba(0, 2, 4, 0.05);
|
|
59
55
|
|
|
60
|
-
&[data-front='false'] {
|
|
61
56
|
.toast-content {
|
|
62
|
-
|
|
57
|
+
transition: opacity 100ms cubic-bezier(0.55, 0.055, 0.675, 0.19);
|
|
58
|
+
width: 100%;
|
|
63
59
|
}
|
|
64
|
-
}
|
|
65
60
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
&[data-front='false'] {
|
|
62
|
+
.toast-content {
|
|
63
|
+
opacity: 0;
|
|
64
|
+
}
|
|
69
65
|
}
|
|
70
|
-
}
|
|
71
66
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
align-items: center;
|
|
78
|
-
justify-content: center;
|
|
67
|
+
&[data-expanded='true'] {
|
|
68
|
+
.toast-content {
|
|
69
|
+
opacity: 1;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
79
72
|
|
|
80
|
-
|
|
81
|
-
width: base(
|
|
82
|
-
height: base(
|
|
73
|
+
.toast-icon {
|
|
74
|
+
width: base(0.8);
|
|
75
|
+
height: base(0.8);
|
|
76
|
+
margin: 0;
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
|
|
81
|
+
& > * {
|
|
82
|
+
width: base(1.2);
|
|
83
|
+
height: base(1.2);
|
|
84
|
+
}
|
|
83
85
|
}
|
|
84
|
-
}
|
|
85
86
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
&.toast-warning {
|
|
88
|
+
color: var(--theme-warning-800);
|
|
89
|
+
border-color: var(--theme-warning-250);
|
|
90
|
+
background-color: var(--theme-warning-100);
|
|
90
91
|
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
.payload-toast-close-button {
|
|
93
|
+
color: var(--theme-warning-600);
|
|
93
94
|
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
&:hover {
|
|
96
|
+
color: var(--theme-warning-250);
|
|
97
|
+
}
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
|
-
}
|
|
99
100
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
&.toast-error {
|
|
102
|
+
color: var(--theme-error-800);
|
|
103
|
+
border-color: var(--theme-error-250);
|
|
104
|
+
background-color: var(--theme-error-100);
|
|
104
105
|
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
.payload-toast-close-button {
|
|
107
|
+
color: var(--theme-error-600);
|
|
107
108
|
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
&:hover {
|
|
110
|
+
color: var(--theme-error-250);
|
|
111
|
+
}
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
|
-
}
|
|
113
114
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
&.toast-success {
|
|
116
|
+
color: var(--theme-success-800);
|
|
117
|
+
border-color: var(--theme-success-250);
|
|
118
|
+
background-color: var(--theme-success-100);
|
|
118
119
|
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
.payload-toast-close-button {
|
|
121
|
+
color: var(--theme-success-600);
|
|
121
122
|
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
&:hover {
|
|
124
|
+
color: var(--theme-success-250);
|
|
125
|
+
}
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
|
-
}
|
|
127
128
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
&.toast-info {
|
|
130
|
+
color: var(--theme-elevation-800);
|
|
131
|
+
border-color: var(--theme-elevation-250);
|
|
132
|
+
background-color: var(--theme-elevation-100);
|
|
132
133
|
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
.payload-toast-close-button {
|
|
135
|
+
color: var(--theme-elevation-600);
|
|
135
136
|
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
&:hover {
|
|
138
|
+
color: var(--theme-elevation-250);
|
|
139
|
+
}
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
}
|
package/dist/scss/type.scss
CHANGED
|
@@ -4,106 +4,107 @@
|
|
|
4
4
|
/////////////////////////////
|
|
5
5
|
// HEADINGS
|
|
6
6
|
/////////////////////////////
|
|
7
|
+
@layer payload-default {
|
|
8
|
+
%h1,
|
|
9
|
+
%h2,
|
|
10
|
+
%h3,
|
|
11
|
+
%h4,
|
|
12
|
+
%h5,
|
|
13
|
+
%h6 {
|
|
14
|
+
font-family: var(--font-body);
|
|
15
|
+
font-weight: 500;
|
|
16
|
+
}
|
|
7
17
|
|
|
8
|
-
%h1
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
18
|
+
%h1 {
|
|
19
|
+
margin: 0;
|
|
20
|
+
font-size: base(1.6);
|
|
21
|
+
line-height: base(1.8);
|
|
22
|
+
|
|
23
|
+
@include small-break {
|
|
24
|
+
letter-spacing: -0.5px;
|
|
25
|
+
font-size: base(1.25);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
17
28
|
|
|
18
|
-
%
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
%h2 {
|
|
30
|
+
margin: 0;
|
|
31
|
+
font-size: base(1.3);
|
|
32
|
+
line-height: base(1.6);
|
|
22
33
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
@include small-break {
|
|
35
|
+
font-size: base(0.85);
|
|
36
|
+
}
|
|
26
37
|
}
|
|
27
|
-
}
|
|
28
38
|
|
|
29
|
-
%
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
39
|
+
%h3 {
|
|
40
|
+
margin: 0;
|
|
41
|
+
font-size: base(1);
|
|
42
|
+
line-height: base(1.2);
|
|
33
43
|
|
|
34
|
-
|
|
35
|
-
|
|
44
|
+
@include small-break {
|
|
45
|
+
font-size: base(0.65);
|
|
46
|
+
line-height: 1.25;
|
|
47
|
+
}
|
|
36
48
|
}
|
|
37
|
-
}
|
|
38
49
|
|
|
39
|
-
%
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
50
|
+
%h4 {
|
|
51
|
+
margin: 0;
|
|
52
|
+
font-size: base(0.8);
|
|
53
|
+
line-height: base(1);
|
|
54
|
+
letter-spacing: -0.375px;
|
|
55
|
+
}
|
|
43
56
|
|
|
44
|
-
|
|
57
|
+
%h5 {
|
|
58
|
+
margin: 0;
|
|
45
59
|
font-size: base(0.65);
|
|
46
|
-
line-height:
|
|
60
|
+
line-height: base(0.8);
|
|
47
61
|
}
|
|
48
|
-
}
|
|
49
62
|
|
|
50
|
-
%
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
%h5 {
|
|
58
|
-
margin: 0;
|
|
59
|
-
font-size: base(0.65);
|
|
60
|
-
line-height: base(0.8);
|
|
61
|
-
}
|
|
63
|
+
%h6 {
|
|
64
|
+
margin: 0;
|
|
65
|
+
font-size: base(0.6);
|
|
66
|
+
line-height: base(0.8);
|
|
67
|
+
}
|
|
62
68
|
|
|
63
|
-
%
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
69
|
+
%small {
|
|
70
|
+
margin: 0;
|
|
71
|
+
font-size: 12px;
|
|
72
|
+
line-height: 20px;
|
|
73
|
+
}
|
|
68
74
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
line-height: 20px;
|
|
73
|
-
}
|
|
75
|
+
/////////////////////////////
|
|
76
|
+
// TYPE STYLES
|
|
77
|
+
/////////////////////////////
|
|
74
78
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
%large-body {
|
|
80
|
+
font-size: base(0.6);
|
|
81
|
+
line-height: base(1);
|
|
82
|
+
letter-spacing: base(0.02);
|
|
78
83
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
@include mid-break {
|
|
85
|
+
font-size: base(0.7);
|
|
86
|
+
line-height: base(1);
|
|
87
|
+
}
|
|
83
88
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
@include small-break {
|
|
90
|
+
font-size: base(0.55);
|
|
91
|
+
line-height: base(0.75);
|
|
92
|
+
}
|
|
87
93
|
}
|
|
88
94
|
|
|
89
|
-
|
|
90
|
-
font-size:
|
|
91
|
-
line-height:
|
|
95
|
+
%body {
|
|
96
|
+
font-size: $baseline-body-size;
|
|
97
|
+
line-height: $baseline-px;
|
|
98
|
+
font-weight: normal;
|
|
99
|
+
font-family: var(--font-body);
|
|
92
100
|
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
%body {
|
|
96
|
-
font-size: $baseline-body-size;
|
|
97
|
-
line-height: $baseline-px;
|
|
98
|
-
font-weight: normal;
|
|
99
|
-
font-family: var(--font-body);
|
|
100
|
-
}
|
|
101
101
|
|
|
102
|
-
%code {
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
%code {
|
|
103
|
+
font-size: base(0.4);
|
|
104
|
+
color: var(--theme-elevation-400);
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
span {
|
|
107
|
+
color: var(--theme-elevation-800);
|
|
108
|
+
}
|
|
108
109
|
}
|
|
109
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNextRequestI18n.js","names":["initI18n","cookies","headers","getRequestLanguage","getNextRequestI18n","config","i18n","context","language"],"sources":["../../src/utilities/getNextRequestI18n.ts"],"sourcesContent":["import type { ClientTranslationsObject, I18nClient } from '@payloadcms/translations'\nimport type { SanitizedConfig } from 'payload'\n\nimport { initI18n } from '@payloadcms/translations'\nimport { cookies, headers } from 'next/headers.js'\n\nimport { getRequestLanguage } from './getRequestLanguage.js'\n\n/**\n * In the context of Next.js, this function initializes the i18n object for the current request.\n *\n * It must be called on the server side, and within the lifecycle of a request since it relies on the request headers and cookies.\n */\nexport const getNextRequestI18n = async <\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n TAdditionalTranslations = {},\n TAdditionalClientTranslationKeys extends string = never,\n>({\n config,\n}: {\n config: SanitizedConfig\n}): Promise<\n [TAdditionalClientTranslationKeys] extends [never]\n ? I18nClient\n : TAdditionalTranslations extends object\n ? I18nClient<TAdditionalTranslations, TAdditionalClientTranslationKeys>\n : I18nClient<ClientTranslationsObject, TAdditionalClientTranslationKeys>\n> => {\n return (await initI18n({\n config: config.i18n,\n context: 'client',\n language: getRequestLanguage({ config, cookies: cookies(), headers: headers() }),\n })) as any\n}\n"],"mappings":"AAGA,SAASA,QAAQ,QAAQ;AACzB,SAASC,OAAO,EAAEC,OAAO,QAAQ;AAEjC,SAASC,kBAAkB,QAAQ;AAEnC;;;;;AAKA,OAAO,MAAMC,kBAAA,GAAqB,MAAAA,CAIhC;EACAC;AAAM,CAGP;EAOC,OAAQ,MAAML,QAAA,CAAS;IACrBK,MAAA,EAAQA,MAAA,CAAOC,IAAI;IACnBC,OAAA,EAAS;IACTC,QAAA,EAAUL,kBAAA,CAAmB;MAAEE,MAAA;MAAQJ,OAAA,
|
|
1
|
+
{"version":3,"file":"getNextRequestI18n.js","names":["initI18n","cookies","headers","getRequestLanguage","getNextRequestI18n","config","i18n","context","language"],"sources":["../../src/utilities/getNextRequestI18n.ts"],"sourcesContent":["import type { ClientTranslationsObject, I18nClient } from '@payloadcms/translations'\nimport type { SanitizedConfig } from 'payload'\n\nimport { initI18n } from '@payloadcms/translations'\nimport { cookies, headers } from 'next/headers.js'\n\nimport { getRequestLanguage } from './getRequestLanguage.js'\n\n/**\n * In the context of Next.js, this function initializes the i18n object for the current request.\n *\n * It must be called on the server side, and within the lifecycle of a request since it relies on the request headers and cookies.\n */\nexport const getNextRequestI18n = async <\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n TAdditionalTranslations = {},\n TAdditionalClientTranslationKeys extends string = never,\n>({\n config,\n}: {\n config: SanitizedConfig\n}): Promise<\n [TAdditionalClientTranslationKeys] extends [never]\n ? I18nClient\n : TAdditionalTranslations extends object\n ? I18nClient<TAdditionalTranslations, TAdditionalClientTranslationKeys>\n : I18nClient<ClientTranslationsObject, TAdditionalClientTranslationKeys>\n> => {\n return (await initI18n({\n config: config.i18n,\n context: 'client',\n language: getRequestLanguage({ config, cookies: await cookies(), headers: await headers() }),\n })) as any\n}\n"],"mappings":"AAGA,SAASA,QAAQ,QAAQ;AACzB,SAASC,OAAO,EAAEC,OAAO,QAAQ;AAEjC,SAASC,kBAAkB,QAAQ;AAEnC;;;;;AAKA,OAAO,MAAMC,kBAAA,GAAqB,MAAAA,CAIhC;EACAC;AAAM,CAGP;EAOC,OAAQ,MAAML,QAAA,CAAS;IACrBK,MAAA,EAAQA,MAAA,CAAOC,IAAI;IACnBC,OAAA,EAAS;IACTC,QAAA,EAAUL,kBAAA,CAAmB;MAAEE,MAAA;MAAQJ,OAAA,EAAS,MAAMA,OAAA;MAAWC,OAAA,EAAS,MAAMA,OAAA;IAAU;EAC5F;AACF","ignoreList":[]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { SanitizedCollectionConfig, SanitizedConfig, SanitizedGlobalConfig } from 'payload';
|
|
2
|
+
type Args = {
|
|
3
3
|
adminRoute: string;
|
|
4
4
|
config: SanitizedConfig;
|
|
5
|
-
permissions: Permissions;
|
|
6
5
|
route: string;
|
|
7
|
-
}) => {
|
|
8
|
-
collectionConfig: SanitizedCollectionConfig;
|
|
9
|
-
docID: string;
|
|
10
|
-
globalConfig: SanitizedGlobalConfig;
|
|
11
|
-
} | {
|
|
12
|
-
collectionConfig?: undefined;
|
|
13
|
-
docID?: undefined;
|
|
14
|
-
globalConfig?: undefined;
|
|
15
6
|
};
|
|
7
|
+
type RouteInfo = {
|
|
8
|
+
collectionConfig?: SanitizedCollectionConfig;
|
|
9
|
+
collectionSlug?: string;
|
|
10
|
+
docID?: string;
|
|
11
|
+
globalConfig?: SanitizedGlobalConfig;
|
|
12
|
+
globalSlug?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function getRouteInfo({ adminRoute, config, route }: Args): RouteInfo;
|
|
15
|
+
export {};
|
|
16
16
|
//# sourceMappingURL=handleAdminPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleAdminPage.d.ts","sourceRoot":"","sources":["../../../src/utilities/initPage/handleAdminPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"handleAdminPage.d.ts","sourceRoot":"","sources":["../../../src/utilities/initPage/handleAdminPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAIhG,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AACD,KAAK,SAAS,GAAG;IACf,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,GAAG,SAAS,CA8B3E"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export const handleAdminPage = ({
|
|
1
|
+
import { getRouteWithoutAdmin, isAdminRoute } from './shared.js';
|
|
2
|
+
export function getRouteInfo({
|
|
4
3
|
adminRoute,
|
|
5
4
|
config,
|
|
6
|
-
permissions,
|
|
7
5
|
route
|
|
8
|
-
})
|
|
6
|
+
}) {
|
|
9
7
|
if (isAdminRoute({
|
|
10
8
|
adminRoute,
|
|
11
9
|
config,
|
|
@@ -24,29 +22,18 @@ export const handleAdminPage = ({
|
|
|
24
22
|
let globalConfig;
|
|
25
23
|
if (collectionSlug) {
|
|
26
24
|
collectionConfig = config.collections.find(collection => collection.slug === collectionSlug);
|
|
27
|
-
if (!collectionConfig) {
|
|
28
|
-
notFound();
|
|
29
|
-
}
|
|
30
25
|
}
|
|
31
26
|
if (globalSlug) {
|
|
32
27
|
globalConfig = config.globals.find(global => global.slug === globalSlug);
|
|
33
|
-
if (!globalConfig) {
|
|
34
|
-
notFound();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (!permissions.canAccessAdmin && !isAdminAuthRoute({
|
|
38
|
-
adminRoute,
|
|
39
|
-
config,
|
|
40
|
-
route
|
|
41
|
-
})) {
|
|
42
|
-
notFound();
|
|
43
28
|
}
|
|
44
29
|
return {
|
|
45
30
|
collectionConfig,
|
|
31
|
+
collectionSlug,
|
|
46
32
|
docID,
|
|
47
|
-
globalConfig
|
|
33
|
+
globalConfig,
|
|
34
|
+
globalSlug
|
|
48
35
|
};
|
|
49
36
|
}
|
|
50
37
|
return {};
|
|
51
|
-
}
|
|
38
|
+
}
|
|
52
39
|
//# sourceMappingURL=handleAdminPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleAdminPage.js","names":["
|
|
1
|
+
{"version":3,"file":"handleAdminPage.js","names":["getRouteWithoutAdmin","isAdminRoute","getRouteInfo","adminRoute","config","route","routeWithoutAdmin","routeSegments","split","filter","Boolean","entityType","entitySlug","createOrID","collectionSlug","undefined","globalSlug","docID","collectionConfig","globalConfig","collections","find","collection","slug","globals","global"],"sources":["../../../src/utilities/initPage/handleAdminPage.ts"],"sourcesContent":["import type { SanitizedCollectionConfig, SanitizedConfig, SanitizedGlobalConfig } from 'payload'\n\nimport { getRouteWithoutAdmin, isAdminRoute } from './shared.js'\n\ntype Args = {\n adminRoute: string\n config: SanitizedConfig\n route: string\n}\ntype RouteInfo = {\n collectionConfig?: SanitizedCollectionConfig\n collectionSlug?: string\n docID?: string\n globalConfig?: SanitizedGlobalConfig\n globalSlug?: string\n}\n\nexport function getRouteInfo({ adminRoute, config, route }: Args): RouteInfo {\n if (isAdminRoute({ adminRoute, config, route })) {\n const routeWithoutAdmin = getRouteWithoutAdmin({ adminRoute, route })\n const routeSegments = routeWithoutAdmin.split('/').filter(Boolean)\n const [entityType, entitySlug, createOrID] = routeSegments\n const collectionSlug = entityType === 'collections' ? entitySlug : undefined\n const globalSlug = entityType === 'globals' ? entitySlug : undefined\n const docID = collectionSlug && createOrID !== 'create' ? createOrID : undefined\n\n let collectionConfig: SanitizedCollectionConfig | undefined\n let globalConfig: SanitizedGlobalConfig | undefined\n\n if (collectionSlug) {\n collectionConfig = config.collections.find((collection) => collection.slug === collectionSlug)\n }\n\n if (globalSlug) {\n globalConfig = config.globals.find((global) => global.slug === globalSlug)\n }\n\n return {\n collectionConfig,\n collectionSlug,\n docID,\n globalConfig,\n globalSlug,\n }\n }\n\n return {}\n}\n"],"mappings":"AAEA,SAASA,oBAAoB,EAAEC,YAAY,QAAQ;AAenD,OAAO,SAASC,aAAa;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAK,CAAQ;EAC9D,IAAIJ,YAAA,CAAa;IAAEE,UAAA;IAAYC,MAAA;IAAQC;EAAM,IAAI;IAC/C,MAAMC,iBAAA,GAAoBN,oBAAA,CAAqB;MAAEG,UAAA;MAAYE;IAAM;IACnE,MAAME,aAAA,GAAgBD,iBAAA,CAAkBE,KAAK,CAAC,KAAKC,MAAM,CAACC,OAAA;IAC1D,MAAM,CAACC,UAAA,EAAYC,UAAA,EAAYC,UAAA,CAAW,GAAGN,aAAA;IAC7C,MAAMO,cAAA,GAAiBH,UAAA,KAAe,gBAAgBC,UAAA,GAAaG,SAAA;IACnE,MAAMC,UAAA,GAAaL,UAAA,KAAe,YAAYC,UAAA,GAAaG,SAAA;IAC3D,MAAME,KAAA,GAAQH,cAAA,IAAkBD,UAAA,KAAe,WAAWA,UAAA,GAAaE,SAAA;IAEvE,IAAIG,gBAAA;IACJ,IAAIC,YAAA;IAEJ,IAAIL,cAAA,EAAgB;MAClBI,gBAAA,GAAmBd,MAAA,CAAOgB,WAAW,CAACC,IAAI,CAAEC,UAAA,IAAeA,UAAA,CAAWC,IAAI,KAAKT,cAAA;IACjF;IAEA,IAAIE,UAAA,EAAY;MACdG,YAAA,GAAef,MAAA,CAAOoB,OAAO,CAACH,IAAI,CAAEI,MAAA,IAAWA,MAAA,CAAOF,IAAI,KAAKP,UAAA;IACjE;IAEA,OAAO;MACLE,gBAAA;MACAJ,cAAA;MACAG,KAAA;MACAE,YAAA;MACAH;IACF;EACF;EAEA,OAAO,CAAC;AACV","ignoreList":[]}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import type { User } from 'payload';
|
|
2
|
+
type Args = {
|
|
2
3
|
config: any;
|
|
3
|
-
redirectUnauthenticatedUser: boolean | string;
|
|
4
4
|
route: string;
|
|
5
5
|
searchParams: {
|
|
6
6
|
[key: string]: string | string[];
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
user?: User;
|
|
9
|
+
};
|
|
10
|
+
export declare const handleAuthRedirect: ({ config, route, searchParams, user }: Args) => string;
|
|
11
|
+
export {};
|
|
9
12
|
//# sourceMappingURL=handleAuthRedirect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleAuthRedirect.d.ts","sourceRoot":"","sources":["../../../src/utilities/initPage/handleAuthRedirect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handleAuthRedirect.d.ts","sourceRoot":"","sources":["../../../src/utilities/initPage/handleAuthRedirect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAKnC,KAAK,IAAI,GAAG;IACV,MAAM,MAAA;IACN,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAA;IAClD,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,CAAA;AACD,eAAO,MAAM,kBAAkB,0CAA2C,IAAI,KAAG,MAkChF,CAAA"}
|
|
@@ -1,54 +1,41 @@
|
|
|
1
1
|
import { formatAdminURL } from '@payloadcms/ui/shared';
|
|
2
|
-
import { redirect } from 'next/navigation.js';
|
|
3
2
|
import * as qs from 'qs-esm';
|
|
4
|
-
import { isAdminAuthRoute, isAdminRoute } from './shared.js';
|
|
5
3
|
export const handleAuthRedirect = ({
|
|
6
4
|
config,
|
|
7
|
-
redirectUnauthenticatedUser,
|
|
8
5
|
route,
|
|
9
|
-
searchParams
|
|
6
|
+
searchParams,
|
|
7
|
+
user
|
|
10
8
|
}) => {
|
|
11
9
|
const {
|
|
12
10
|
admin: {
|
|
13
11
|
routes: {
|
|
14
|
-
login: loginRouteFromConfig
|
|
12
|
+
login: loginRouteFromConfig,
|
|
13
|
+
unauthorized: unauthorizedRoute
|
|
15
14
|
}
|
|
16
15
|
},
|
|
17
16
|
routes: {
|
|
18
17
|
admin: adminRoute
|
|
19
18
|
}
|
|
20
19
|
} = config;
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
config,
|
|
24
|
-
route
|
|
25
|
-
})) {
|
|
26
|
-
if (searchParams && 'redirect' in searchParams) {
|
|
27
|
-
delete searchParams.redirect;
|
|
28
|
-
}
|
|
29
|
-
const redirectRoute = encodeURIComponent(route + Object.keys(searchParams ?? {}).length ? `${qs.stringify(searchParams, {
|
|
30
|
-
addQueryPrefix: true
|
|
31
|
-
})}` : undefined);
|
|
32
|
-
const adminLoginRoute = formatAdminURL({
|
|
33
|
-
adminRoute,
|
|
34
|
-
path: loginRouteFromConfig
|
|
35
|
-
});
|
|
36
|
-
const customLoginRoute = typeof redirectUnauthenticatedUser === 'string' ? redirectUnauthenticatedUser : undefined;
|
|
37
|
-
const loginRoute = isAdminRoute({
|
|
38
|
-
adminRoute,
|
|
39
|
-
config,
|
|
40
|
-
route
|
|
41
|
-
}) ? adminLoginRoute : customLoginRoute || loginRouteFromConfig;
|
|
42
|
-
const parsedLoginRouteSearchParams = qs.parse(loginRoute.split('?')[1] ?? '');
|
|
43
|
-
const searchParamsWithRedirect = `${qs.stringify({
|
|
44
|
-
...parsedLoginRouteSearchParams,
|
|
45
|
-
...(redirectRoute ? {
|
|
46
|
-
redirect: redirectRoute
|
|
47
|
-
} : {})
|
|
48
|
-
}, {
|
|
49
|
-
addQueryPrefix: true
|
|
50
|
-
})}`;
|
|
51
|
-
redirect(`${loginRoute.split('?')[0]}${searchParamsWithRedirect}`);
|
|
20
|
+
if (searchParams && 'redirect' in searchParams) {
|
|
21
|
+
delete searchParams.redirect;
|
|
52
22
|
}
|
|
23
|
+
const redirectRoute = encodeURIComponent(route + Object.keys(searchParams ?? {}).length ? `${qs.stringify(searchParams, {
|
|
24
|
+
addQueryPrefix: true
|
|
25
|
+
})}` : undefined);
|
|
26
|
+
const redirectTo = formatAdminURL({
|
|
27
|
+
adminRoute,
|
|
28
|
+
path: user ? unauthorizedRoute : loginRouteFromConfig
|
|
29
|
+
});
|
|
30
|
+
const parsedLoginRouteSearchParams = qs.parse(redirectTo.split('?')[1] ?? '');
|
|
31
|
+
const searchParamsWithRedirect = `${qs.stringify({
|
|
32
|
+
...parsedLoginRouteSearchParams,
|
|
33
|
+
...(redirectRoute ? {
|
|
34
|
+
redirect: redirectRoute
|
|
35
|
+
} : {})
|
|
36
|
+
}, {
|
|
37
|
+
addQueryPrefix: true
|
|
38
|
+
})}`;
|
|
39
|
+
return `${redirectTo.split('?')[0]}${searchParamsWithRedirect}`;
|
|
53
40
|
};
|
|
54
41
|
//# sourceMappingURL=handleAuthRedirect.js.map
|