@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
|
@@ -19,8 +19,8 @@ export const generatePageMetadata = async ({
|
|
|
19
19
|
export const NotFoundPage = async ({
|
|
20
20
|
config: configPromise,
|
|
21
21
|
importMap,
|
|
22
|
-
params,
|
|
23
|
-
searchParams
|
|
22
|
+
params: paramsPromise,
|
|
23
|
+
searchParams: searchParamsPromise
|
|
24
24
|
}) => {
|
|
25
25
|
const config = await configPromise;
|
|
26
26
|
const {
|
|
@@ -28,6 +28,7 @@ export const NotFoundPage = async ({
|
|
|
28
28
|
admin: adminRoute
|
|
29
29
|
} = {}
|
|
30
30
|
} = config;
|
|
31
|
+
const searchParams = await searchParamsPromise;
|
|
31
32
|
const initPageResult = await initPage({
|
|
32
33
|
config,
|
|
33
34
|
importMap,
|
|
@@ -38,6 +39,7 @@ export const NotFoundPage = async ({
|
|
|
38
39
|
}),
|
|
39
40
|
searchParams
|
|
40
41
|
});
|
|
42
|
+
const params = await paramsPromise;
|
|
41
43
|
return /*#__PURE__*/_jsx(DefaultTemplate, {
|
|
42
44
|
i18n: initPageResult.req.i18n,
|
|
43
45
|
locale: initPageResult.locale,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["formatAdminURL","React","DefaultTemplate","getNextRequestI18n","initPage","NotFoundClient","generatePageMetadata","config","configPromise","i18n","title","t","NotFoundPage","importMap","params","searchParams","routes","admin","adminRoute","initPageResult","redirectUnauthenticatedUser","route","path","_jsx","req","locale","payload","permissions","user","visibleEntities","NotFoundView","marginTop"],"sources":["../../../src/views/NotFound/index.tsx"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { Metadata } from 'next'\nimport type {\n AdminViewComponent,\n ImportMap,\n PayloadServerReactComponent,\n SanitizedConfig,\n} from 'payload'\n\nimport { formatAdminURL } from '@payloadcms/ui/shared'\nimport React from 'react'\n\nimport { DefaultTemplate } from '../../templates/Default/index.js'\nimport { getNextRequestI18n } from '../../utilities/getNextRequestI18n.js'\nimport { initPage } from '../../utilities/initPage/index.js'\nimport { NotFoundClient } from './index.client.js'\n\nexport const generatePageMetadata = async ({\n config: configPromise,\n}: {\n config: Promise<SanitizedConfig> | SanitizedConfig\n params?: { [key: string]: string | string[] }\n}): Promise<Metadata> => {\n const config = await configPromise\n\n const i18n = await getNextRequestI18n({\n config,\n })\n\n return {\n title: i18n.t('general:notFound'),\n }\n}\n\nexport type GenerateViewMetadata = (args: {\n config: SanitizedConfig\n i18n: I18n\n params?: { [key: string]: string | string[] }\n}) => Promise<Metadata>\n\nexport const NotFoundPage = async ({\n config: configPromise,\n importMap,\n params,\n searchParams,\n}: {\n config: Promise<SanitizedConfig>\n importMap: ImportMap\n params: {\n segments: string[]\n }
|
|
1
|
+
{"version":3,"file":"index.js","names":["formatAdminURL","React","DefaultTemplate","getNextRequestI18n","initPage","NotFoundClient","generatePageMetadata","config","configPromise","i18n","title","t","NotFoundPage","importMap","params","paramsPromise","searchParams","searchParamsPromise","routes","admin","adminRoute","initPageResult","redirectUnauthenticatedUser","route","path","_jsx","req","locale","payload","permissions","user","visibleEntities","NotFoundView","marginTop"],"sources":["../../../src/views/NotFound/index.tsx"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { Metadata } from 'next'\nimport type {\n AdminViewComponent,\n ImportMap,\n PayloadServerReactComponent,\n SanitizedConfig,\n} from 'payload'\n\nimport { formatAdminURL } from '@payloadcms/ui/shared'\nimport React from 'react'\n\nimport { DefaultTemplate } from '../../templates/Default/index.js'\nimport { getNextRequestI18n } from '../../utilities/getNextRequestI18n.js'\nimport { initPage } from '../../utilities/initPage/index.js'\nimport { NotFoundClient } from './index.client.js'\n\nexport const generatePageMetadata = async ({\n config: configPromise,\n}: {\n config: Promise<SanitizedConfig> | SanitizedConfig\n params?: { [key: string]: string | string[] }\n}): Promise<Metadata> => {\n const config = await configPromise\n\n const i18n = await getNextRequestI18n({\n config,\n })\n\n return {\n title: i18n.t('general:notFound'),\n }\n}\n\nexport type GenerateViewMetadata = (args: {\n config: SanitizedConfig\n i18n: I18n\n params?: { [key: string]: string | string[] }\n}) => Promise<Metadata>\n\nexport const NotFoundPage = async ({\n config: configPromise,\n importMap,\n params: paramsPromise,\n searchParams: searchParamsPromise,\n}: {\n config: Promise<SanitizedConfig>\n importMap: ImportMap\n params: Promise<{\n segments: string[]\n }>\n searchParams: Promise<{\n [key: string]: string | string[]\n }>\n}) => {\n const config = await configPromise\n const { routes: { admin: adminRoute } = {} } = config\n\n const searchParams = await searchParamsPromise\n const initPageResult = await initPage({\n config,\n importMap,\n redirectUnauthenticatedUser: true,\n route: formatAdminURL({ adminRoute, path: '/not-found' }),\n searchParams,\n })\n\n const params = await paramsPromise\n\n return (\n <DefaultTemplate\n i18n={initPageResult.req.i18n}\n locale={initPageResult.locale}\n params={params}\n payload={initPageResult.req.payload}\n permissions={initPageResult.permissions}\n searchParams={searchParams}\n user={initPageResult.req.user}\n visibleEntities={initPageResult.visibleEntities}\n >\n <NotFoundClient />\n </DefaultTemplate>\n )\n}\n\nexport const NotFoundView: PayloadServerReactComponent<AdminViewComponent> = () => {\n return <NotFoundClient marginTop=\"large\" />\n}\n"],"mappings":";AASA,SAASA,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAElB,SAASC,eAAe,QAAQ;AAChC,SAASC,kBAAkB,QAAQ;AACnC,SAASC,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAE/B,OAAO,MAAMC,oBAAA,GAAuB,MAAAA,CAAO;EACzCC,MAAA,EAAQC;AAAa,CAItB;EACC,MAAMD,MAAA,GAAS,MAAMC,aAAA;EAErB,MAAMC,IAAA,GAAO,MAAMN,kBAAA,CAAmB;IACpCI;EACF;EAEA,OAAO;IACLG,KAAA,EAAOD,IAAA,CAAKE,CAAC,CAAC;EAChB;AACF;AAQA,OAAO,MAAMC,YAAA,GAAe,MAAAA,CAAO;EACjCL,MAAA,EAAQC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
9
|
-
|
|
8
|
+
& > * {
|
|
9
|
+
&:first-child {
|
|
10
|
+
margin-top: 0;
|
|
11
|
+
}
|
|
12
|
+
&:last-child {
|
|
13
|
+
margin-bottom: 0;
|
|
14
|
+
}
|
|
10
15
|
}
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
|
|
17
|
+
&__wrap {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: flex-start;
|
|
21
|
+
gap: base(0.8);
|
|
22
|
+
max-width: base(36);
|
|
13
23
|
}
|
|
14
|
-
}
|
|
15
24
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
gap: base(0.8);
|
|
21
|
-
max-width: base(36);
|
|
22
|
-
}
|
|
25
|
+
&__content {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
gap: base(0.4);
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
> * {
|
|
31
|
+
margin: 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
28
34
|
|
|
29
|
-
|
|
35
|
+
&__button {
|
|
30
36
|
margin: 0;
|
|
31
37
|
}
|
|
32
|
-
}
|
|
33
38
|
|
|
34
|
-
&__button {
|
|
35
|
-
margin: 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&--margin-top-large {
|
|
39
|
-
margin-top: calc(var(--base) * 2);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@include large-break {
|
|
43
39
|
&--margin-top-large {
|
|
44
|
-
margin-top: var(--base);
|
|
40
|
+
margin-top: calc(var(--base) * 2);
|
|
45
41
|
}
|
|
46
|
-
}
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
@include large-break {
|
|
44
|
+
&--margin-top-large {
|
|
45
|
+
margin-top: var(--base);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
50
48
|
|
|
51
|
-
|
|
49
|
+
@include small-break {
|
|
52
50
|
margin-top: calc(var(--base) / 2);
|
|
51
|
+
|
|
52
|
+
&--margin-top-large {
|
|
53
|
+
margin-top: calc(var(--base) / 2);
|
|
54
|
+
}
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/ResetPassword/ResetPasswordForm/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,KAAK,IAAI,GAAG;IACV,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB,CAAA;AAeD,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAyD5C,CAAA"}
|
|
@@ -6,7 +6,6 @@ import { ConfirmPasswordField, Form, FormSubmit, HiddenField, PasswordField, use
|
|
|
6
6
|
import { formatAdminURL } from '@payloadcms/ui/shared';
|
|
7
7
|
import { useRouter } from 'next/navigation.js';
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import { toast } from 'sonner';
|
|
10
9
|
const initialState = {
|
|
11
10
|
'confirm-password': {
|
|
12
11
|
initialValue: '',
|
|
@@ -19,8 +18,8 @@ const initialState = {
|
|
|
19
18
|
value: ''
|
|
20
19
|
}
|
|
21
20
|
};
|
|
22
|
-
export const
|
|
23
|
-
const $ = _c(
|
|
21
|
+
export const ResetPasswordForm = t0 => {
|
|
22
|
+
const $ = _c(10);
|
|
24
23
|
const {
|
|
25
24
|
token
|
|
26
25
|
} = t0;
|
|
@@ -49,32 +48,30 @@ export const ResetPasswordClient = t0 => {
|
|
|
49
48
|
fetchFullUser
|
|
50
49
|
} = useAuth();
|
|
51
50
|
let t5;
|
|
52
|
-
if ($[0] !== fetchFullUser || $[1] !== history || $[2] !== adminRoute || $[3] !== loginRoute
|
|
53
|
-
t5 = async
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
if ($[0] !== fetchFullUser || $[1] !== history || $[2] !== adminRoute || $[3] !== loginRoute) {
|
|
52
|
+
t5 = async () => {
|
|
53
|
+
const user = await fetchFullUser();
|
|
54
|
+
if (user) {
|
|
56
55
|
history.push(adminRoute);
|
|
57
56
|
} else {
|
|
58
57
|
history.push(formatAdminURL({
|
|
59
58
|
adminRoute,
|
|
60
59
|
path: loginRoute
|
|
61
60
|
}));
|
|
62
|
-
toast.success(i18n.t("general:updatedSuccessfully"));
|
|
63
61
|
}
|
|
64
62
|
};
|
|
65
63
|
$[0] = fetchFullUser;
|
|
66
64
|
$[1] = history;
|
|
67
65
|
$[2] = adminRoute;
|
|
68
66
|
$[3] = loginRoute;
|
|
69
|
-
$[4] =
|
|
70
|
-
$[5] = t5;
|
|
67
|
+
$[4] = t5;
|
|
71
68
|
} else {
|
|
72
|
-
t5 = $[
|
|
69
|
+
t5 = $[4];
|
|
73
70
|
}
|
|
74
71
|
const onSuccess = t5;
|
|
75
72
|
const t6 = `${serverURL}${apiRoute}/${userSlug}/reset-password`;
|
|
76
73
|
let t7;
|
|
77
|
-
if ($[
|
|
74
|
+
if ($[5] !== i18n || $[6] !== token || $[7] !== t6 || $[8] !== onSuccess) {
|
|
78
75
|
t7 = _jsxs(Form, {
|
|
79
76
|
action: t6,
|
|
80
77
|
initialState,
|
|
@@ -100,14 +97,14 @@ export const ResetPasswordClient = t0 => {
|
|
|
100
97
|
children: i18n.t("authentication:resetPassword")
|
|
101
98
|
})]
|
|
102
99
|
});
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
100
|
+
$[5] = i18n;
|
|
101
|
+
$[6] = token;
|
|
102
|
+
$[7] = t6;
|
|
103
|
+
$[8] = onSuccess;
|
|
104
|
+
$[9] = t7;
|
|
108
105
|
} else {
|
|
109
|
-
t7 = $[
|
|
106
|
+
t7 = $[9];
|
|
110
107
|
}
|
|
111
108
|
return t7;
|
|
112
109
|
};
|
|
113
|
-
//# sourceMappingURL=index.
|
|
110
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ConfirmPasswordField","Form","FormSubmit","HiddenField","PasswordField","useAuth","useConfig","useTranslation","formatAdminURL","useRouter","React","initialState","initialValue","valid","value","password","ResetPasswordForm","t0","$","token","i18n","config","t1","admin","t2","routes","t3","serverURL","t4","user","userSlug","login","loginRoute","adminRoute","api","apiRoute","history","fetchFullUser","t5","push","path","onSuccess","t6","t7","_jsxs","action","method","children","className","_jsx","field","name","label","t","required","forceUsePathFromProps","size"],"sources":["../../../../src/views/ResetPassword/ResetPasswordForm/index.tsx"],"sourcesContent":["'use client'\nimport {\n ConfirmPasswordField,\n Form,\n FormSubmit,\n HiddenField,\n PasswordField,\n useAuth,\n useConfig,\n useTranslation,\n} from '@payloadcms/ui'\nimport { formatAdminURL } from '@payloadcms/ui/shared'\nimport { useRouter } from 'next/navigation.js'\nimport { type FormState } from 'payload'\nimport React from 'react'\n\ntype Args = {\n readonly token: string\n}\n\nconst initialState: FormState = {\n 'confirm-password': {\n initialValue: '',\n valid: false,\n value: '',\n },\n password: {\n initialValue: '',\n valid: false,\n value: '',\n },\n}\n\nexport const ResetPasswordForm: React.FC<Args> = ({ token }) => {\n const i18n = useTranslation()\n const {\n config: {\n admin: {\n routes: { login: loginRoute },\n user: userSlug,\n },\n routes: { admin: adminRoute, api: apiRoute },\n serverURL,\n },\n } = useConfig()\n\n const history = useRouter()\n const { fetchFullUser } = useAuth()\n\n const onSuccess = React.useCallback(async () => {\n const user = await fetchFullUser()\n if (user) {\n history.push(adminRoute)\n } else {\n history.push(\n formatAdminURL({\n adminRoute,\n path: loginRoute,\n }),\n )\n }\n }, [adminRoute, fetchFullUser, history, loginRoute])\n\n return (\n <Form\n action={`${serverURL}${apiRoute}/${userSlug}/reset-password`}\n initialState={initialState}\n method=\"POST\"\n onSuccess={onSuccess}\n >\n <div className=\"inputWrap\">\n <PasswordField\n field={{\n name: 'password',\n label: i18n.t('authentication:newPassword'),\n required: true,\n }}\n />\n <ConfirmPasswordField />\n <HiddenField\n field={{\n name: 'token',\n }}\n forceUsePathFromProps\n value={token}\n />\n </div>\n <FormSubmit size=\"large\">{i18n.t('authentication:resetPassword')}</FormSubmit>\n </Form>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SACEC,oBAAoB,EACpBC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,aAAa,EACbC,OAAO,EACPC,SAAS,EACTC,cAAc,QACT;AACP,SAASC,cAAc,QAAQ;AAC/B,SAASC,SAAS,QAAQ;AAE1B,OAAOC,KAAA,MAAW;AAMlB,MAAMC,YAAA,GAA0B;EAC9B,oBAAoB;IAClBC,YAAA,EAAc;IACdC,KAAA,EAAO;IACPC,KAAA,EAAO;EACT;EACAC,QAAA,EAAU;IACRH,YAAA,EAAc;IACdC,KAAA,EAAO;IACPC,KAAA,EAAO;EACT;AACF;AAEA,OAAO,MAAME,iBAAA,GAAoCC,EAAA;EAAA,MAAAC,CAAA,GAAAnB,EAAA;EAAC;IAAAoB;EAAA,IAAAF,EAAS;EACzD,MAAAG,IAAA,GAAab,cAAA;EACb;IAAAc,MAAA,EAAAC;EAAA,IASIhB,SAAA;EARM;IAAAiB,KAAA,EAAAC,EAAA;IAAAC,MAAA,EAAAC,EAAA;IAAAC;EAAA,IAAAL,EAOP;EANQ;IAAAG,MAAA,EAAAG,EAAA;IAAAC,IAAA,EAAAC;EAAA,IAAAN,EAGN;EAFS;IAAAO,KAAA,EAAAC;EAAA,IAAAJ,EAAqB;EAGvB;IAAAL,KAAA,EAAAU,UAAA;IAAAC,GAAA,EAAAC;EAAA,IAAAT,EAAoC;EAKhD,MAAAU,OAAA,GAAgB3B,SAAA;EAChB;IAAA4B;EAAA,IAA0BhC,OAAA;EAAA,IAAAiC,EAAA;EAAA,IAAApB,CAAA,QAAAmB,aAAA,IAAA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;QAAAT,QAAA,EAAS3B,IAAA,CAAAiC,CAAA,CAAO;MAAA,C;;;;;;;;;;SAvBnCV,E;CA0BJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/ResetPassword/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAK7C,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/ResetPassword/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAK7C,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,cAAc,CAAA;AAGrB,eAAO,MAAM,sBAAsB,mBAAmB,CAAA;AAItD,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAA;AAEzD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAiElD,CAAA"}
|
|
@@ -3,7 +3,8 @@ 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 from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import { FormHeader } from '../../elements/FormHeader/index.js';
|
|
7
|
+
import { ResetPasswordForm } from './ResetPasswordForm/index.js';
|
|
7
8
|
export const resetPasswordBaseClass = 'reset-password';
|
|
8
9
|
const Link = LinkImport.default || LinkImport;
|
|
9
10
|
export { generateResetPasswordMetadata } from './meta.js';
|
|
@@ -27,7 +28,8 @@ export const ResetPassword = ({
|
|
|
27
28
|
const {
|
|
28
29
|
admin: {
|
|
29
30
|
routes: {
|
|
30
|
-
account: accountRoute
|
|
31
|
+
account: accountRoute,
|
|
32
|
+
login: loginRoute
|
|
31
33
|
}
|
|
32
34
|
},
|
|
33
35
|
routes: {
|
|
@@ -37,10 +39,8 @@ export const ResetPassword = ({
|
|
|
37
39
|
if (user) {
|
|
38
40
|
return /*#__PURE__*/_jsxs("div", {
|
|
39
41
|
className: `${resetPasswordBaseClass}__wrap`,
|
|
40
|
-
children: [/*#__PURE__*/_jsx(
|
|
41
|
-
|
|
42
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
43
|
-
children: /*#__PURE__*/_jsx(Translation, {
|
|
42
|
+
children: [/*#__PURE__*/_jsx(FormHeader, {
|
|
43
|
+
description: /*#__PURE__*/_jsx(Translation, {
|
|
44
44
|
elements: {
|
|
45
45
|
'0': ({
|
|
46
46
|
children
|
|
@@ -54,7 +54,8 @@ export const ResetPassword = ({
|
|
|
54
54
|
},
|
|
55
55
|
i18nKey: "authentication:loggedInChangePassword",
|
|
56
56
|
t: i18n.t
|
|
57
|
-
})
|
|
57
|
+
}),
|
|
58
|
+
heading: i18n.t('authentication:alreadyLoggedIn')
|
|
58
59
|
}), /*#__PURE__*/_jsx(Button, {
|
|
59
60
|
buttonStyle: "secondary",
|
|
60
61
|
el: "link",
|
|
@@ -67,10 +68,16 @@ export const ResetPassword = ({
|
|
|
67
68
|
}
|
|
68
69
|
return /*#__PURE__*/_jsxs("div", {
|
|
69
70
|
className: `${resetPasswordBaseClass}__wrap`,
|
|
70
|
-
children: [/*#__PURE__*/_jsx(
|
|
71
|
-
|
|
72
|
-
}), /*#__PURE__*/_jsx(
|
|
71
|
+
children: [/*#__PURE__*/_jsx(FormHeader, {
|
|
72
|
+
heading: i18n.t('authentication:resetPassword')
|
|
73
|
+
}), /*#__PURE__*/_jsx(ResetPasswordForm, {
|
|
73
74
|
token: token
|
|
75
|
+
}), /*#__PURE__*/_jsx(Link, {
|
|
76
|
+
href: formatAdminURL({
|
|
77
|
+
adminRoute,
|
|
78
|
+
path: loginRoute
|
|
79
|
+
}),
|
|
80
|
+
children: i18n.t('authentication:backToLogin')
|
|
74
81
|
})]
|
|
75
82
|
});
|
|
76
83
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Button","formatAdminURL","Translation","LinkImport","React","
|
|
1
|
+
{"version":3,"file":"index.js","names":["Button","formatAdminURL","Translation","LinkImport","React","FormHeader","ResetPasswordForm","resetPasswordBaseClass","Link","default","generateResetPasswordMetadata","ResetPassword","initPageResult","params","req","segments","_","token","i18n","payload","config","user","admin","routes","account","accountRoute","login","loginRoute","adminRoute","_jsxs","className","_jsx","description","elements","0","children","href","path","i18nKey","t","heading","buttonStyle","el","size","to"],"sources":["../../../src/views/ResetPassword/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 from 'react'\n\nimport { FormHeader } from '../../elements/FormHeader/index.js'\nimport './index.scss'\nimport { ResetPasswordForm } from './ResetPasswordForm/index.js'\n\nexport const resetPasswordBaseClass = 'reset-password'\n\nconst Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default\n\nexport { generateResetPasswordMetadata } from './meta.js'\n\nexport const ResetPassword: React.FC<AdminViewProps> = ({ initPageResult, params }) => {\n const { req } = initPageResult\n\n const {\n segments: [_, token],\n } = params\n\n const {\n i18n,\n payload: { config },\n user,\n } = req\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 <div className={`${resetPasswordBaseClass}__wrap`}>\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 </div>\n )\n }\n\n return (\n <div className={`${resetPasswordBaseClass}__wrap`}>\n <FormHeader heading={i18n.t('authentication:resetPassword')} />\n <ResetPasswordForm token={token} />\n <Link\n href={formatAdminURL({\n adminRoute,\n path: loginRoute,\n })}\n >\n {i18n.t('authentication:backToLogin')}\n </Link>\n </div>\n )\n}\n"],"mappings":";AAEA,SAASA,MAAM,QAAQ;AACvB,SAASC,cAAc,EAAEC,WAAW,QAAQ;AAC5C,OAAOC,UAAA,MAAgB;AACvB,OAAOC,KAAA,MAAW;AAElB,SAASC,UAAU,QAAQ;AAE3B,SAASC,iBAAiB,QAAQ;AAElC,OAAO,MAAMC,sBAAA,GAAyB;AAEtC,MAAMC,IAAA,GAAQL,UAAA,CAAWM,OAAO,IAAIN,UAAA;AAEpC,SAASO,6BAA6B,QAAQ;AAE9C,OAAO,MAAMC,aAAA,GAA0CA,CAAC;EAAEC,cAAc;EAAEC;AAAM,CAAE;EAChF,MAAM;IAAEC;EAAG,CAAE,GAAGF,cAAA;EAEhB,MAAM;IACJG,QAAA,EAAU,CAACC,CAAA,EAAGC,KAAA;EAAM,CACrB,GAAGJ,MAAA;EAEJ,MAAM;IACJK,IAAI;IACJC,OAAA,EAAS;MAAEC;IAAM,CAAE;IACnBC;EAAI,CACL,GAAGP,GAAA;EAEJ,MAAM;IACJQ,KAAA,EAAO;MACLC,MAAA,EAAQ;QAAEC,OAAA,EAASC,YAAY;QAAEC,KAAA,EAAOC;MAAU;IAAE,CACrD;IACDJ,MAAA,EAAQ;MAAED,KAAA,EAAOM;IAAU;EAAE,CAC9B,GAAGR,MAAA;EAEJ,IAAIC,IAAA,EAAM;IACR,oBACEQ,KAAA,CAAC;MAAIC,SAAA,EAAW,GAAGvB,sBAAA,QAA8B;8BAC/CwB,IAAA,CAAC1B,UAAA;QACC2B,WAAA,eACED,IAAA,CAAC7B,WAAA;UACC+B,QAAA,EAAU;YACR,KAAKC,CAAC;cAAEC;YAAQ,CAAE,kBAChBJ,IAAA,CAACvB,IAAA;cACC4B,IAAA,EAAMnC,cAAA,CAAe;gBACnB2B,UAAA;gBACAS,IAAA,EAAMZ;cACR;wBAECU;;UAGP;UACAG,OAAA,EAAQ;UACRC,CAAA,EAAGrB,IAAA,CAAKqB;;QAGZC,OAAA,EAAStB,IAAA,CAAKqB,CAAC,CAAC;uBAElBR,IAAA,CAAC/B,MAAA;QAAOyC,WAAA,EAAY;QAAYC,EAAA,EAAG;QAAOlC,IAAA,EAAMA,IAAA;QAAMmC,IAAA,EAAK;QAAQC,EAAA,EAAIhB,UAAA;kBACpEV,IAAA,CAAKqB,CAAC,CAAC;;;EAIhB;EAEA,oBACEV,KAAA,CAAC;IAAIC,SAAA,EAAW,GAAGvB,sBAAA,QAA8B;4BAC/CwB,IAAA,CAAC1B,UAAA;MAAWmC,OAAA,EAAStB,IAAA,CAAKqB,CAAC,CAAC;qBAC5BR,IAAA,CAACzB,iBAAA;MAAkBW,KAAA,EAAOA;qBAC1Bc,IAAA,CAACvB,IAAA;MACC4B,IAAA,EAAMnC,cAAA,CAAe;QACnB2B,UAAA;QACAS,IAAA,EAAMV;MACR;gBAECT,IAAA,CAAKqB,CAAC,CAAC;;;AAIhB","ignoreList":[]}
|
|
@@ -1,31 +1,11 @@
|
|
|
1
1
|
@import '../../scss/styles.scss';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
align-items: flex-start;
|
|
10
|
-
gap: base(0.8);
|
|
11
|
-
max-width: base(36);
|
|
12
|
-
|
|
13
|
-
& > form {
|
|
14
|
-
width: 100%;
|
|
15
|
-
|
|
16
|
-
& > .inputWrap {
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
gap: base(0.8);
|
|
20
|
-
|
|
21
|
-
> * {
|
|
22
|
-
margin: 0;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
& > .btn {
|
|
28
|
-
margin: 0;
|
|
3
|
+
@layer payload-default {
|
|
4
|
+
.reset-password__wrap {
|
|
5
|
+
.inputWrap {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: base(0.8);
|
|
29
9
|
}
|
|
30
10
|
}
|
|
31
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getViewFromConfig.d.ts","sourceRoot":"","sources":["../../../src/views/Root/getViewFromConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC7F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AA4BjE,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,CAAA;IACpC,gBAAgB,CAAC,EAAE,kBAAkB,CAAA;CACtC,CAAA;AAYD,eAAO,MAAM,iBAAiB,6EAO3B;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,eAAe,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,SAAS,CAAA;IACpB,YAAY,EAAE;QACZ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;KACjC,CAAA;IACD,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB,KAAG;IACF,WAAW,EAAE,cAAc,CAAA;IAC3B,eAAe,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,iBAAiB,EAAE,MAAM,CAAA;IACzB,YAAY,EAAE,SAAS,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"getViewFromConfig.d.ts","sourceRoot":"","sources":["../../../src/views/Root/getViewFromConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC7F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AA4BjE,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,CAAA;IACpC,gBAAgB,CAAC,EAAE,kBAAkB,CAAA;CACtC,CAAA;AAYD,eAAO,MAAM,iBAAiB,6EAO3B;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,eAAe,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,SAAS,CAAA;IACpB,YAAY,EAAE;QACZ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;KACjC,CAAA;IACD,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB,KAAG;IACF,WAAW,EAAE,cAAc,CAAA;IAC3B,eAAe,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,iBAAiB,EAAE,MAAM,CAAA;IACzB,YAAY,EAAE,SAAS,GAAG,SAAS,CAAA;CAuJpC,CAAA"}
|
|
@@ -57,7 +57,6 @@ export const getViewFromConfig = ({
|
|
|
57
57
|
};
|
|
58
58
|
templateClassName = 'dashboard';
|
|
59
59
|
templateType = 'default';
|
|
60
|
-
initPageOptions.redirectUnauthenticatedUser = true;
|
|
61
60
|
}
|
|
62
61
|
break;
|
|
63
62
|
}
|
|
@@ -95,7 +94,6 @@ export const getViewFromConfig = ({
|
|
|
95
94
|
templateClassName = baseClasses[viewKey];
|
|
96
95
|
templateType = 'minimal';
|
|
97
96
|
if (viewKey === 'account') {
|
|
98
|
-
initPageOptions.redirectUnauthenticatedUser = true;
|
|
99
97
|
templateType = 'default';
|
|
100
98
|
}
|
|
101
99
|
}
|
|
@@ -113,7 +111,6 @@ export const getViewFromConfig = ({
|
|
|
113
111
|
}
|
|
114
112
|
if (isCollection) {
|
|
115
113
|
// --> /collections/:collectionSlug
|
|
116
|
-
initPageOptions.redirectUnauthenticatedUser = true;
|
|
117
114
|
ViewToRender = {
|
|
118
115
|
Component: ListView
|
|
119
116
|
};
|
|
@@ -121,7 +118,6 @@ export const getViewFromConfig = ({
|
|
|
121
118
|
templateType = 'default';
|
|
122
119
|
} else if (isGlobal) {
|
|
123
120
|
// --> /globals/:globalSlug
|
|
124
|
-
initPageOptions.redirectUnauthenticatedUser = true;
|
|
125
121
|
ViewToRender = {
|
|
126
122
|
Component: DocumentView
|
|
127
123
|
};
|
|
@@ -145,7 +141,6 @@ export const getViewFromConfig = ({
|
|
|
145
141
|
// --> /collections/:collectionSlug/:id/versions
|
|
146
142
|
// --> /collections/:collectionSlug/:id/versions/:versionId
|
|
147
143
|
// --> /collections/:collectionSlug/:id/api
|
|
148
|
-
initPageOptions.redirectUnauthenticatedUser = true;
|
|
149
144
|
ViewToRender = {
|
|
150
145
|
Component: DocumentView
|
|
151
146
|
};
|
|
@@ -157,7 +152,6 @@ export const getViewFromConfig = ({
|
|
|
157
152
|
// --> /globals/:globalSlug/preview
|
|
158
153
|
// --> /globals/:globalSlug/versions/:versionId
|
|
159
154
|
// --> /globals/:globalSlug/api
|
|
160
|
-
initPageOptions.redirectUnauthenticatedUser = true;
|
|
161
155
|
ViewToRender = {
|
|
162
156
|
Component: DocumentView
|
|
163
157
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getViewFromConfig.js","names":["formatAdminURL","Account","CreateFirstUserView","Dashboard","Document","DocumentView","forgotPasswordBaseClass","ForgotPasswordView","ListView","loginBaseClass","LoginView","LogoutInactivity","LogoutView","ResetPassword","resetPasswordBaseClass","UnauthorizedView","Verify","verifyBaseClass","getCustomViewByRoute","isPathMatchingRoute","baseClasses","account","forgot","login","reset","verify","oneSegmentViews","createFirstUser","inactivity","logout","unauthorized","getViewFromConfig","adminRoute","config","currentRoute","importMap","searchParams","segments","ViewToRender","templateClassName","templateType","initPageOptions","route","segmentOne","segmentTwo","isGlobal","isCollection","length","Component","redirectUnauthenticatedUser","viewKey","admin","routes","matchedRoute","Object","entries","find","exact","path","view","DefaultView"],"sources":["../../../src/views/Root/getViewFromConfig.ts"],"sourcesContent":["import type { AdminViewComponent, AdminViewProps, ImportMap, SanitizedConfig } from 'payload'\nimport type React from 'react'\n\nimport { formatAdminURL } from '@payloadcms/ui/shared'\n\nimport type { initPage } from '../../utilities/initPage/index.js'\n\nimport { Account } from '../Account/index.js'\nimport { CreateFirstUserView } from '../CreateFirstUser/index.js'\nimport { Dashboard } from '../Dashboard/index.js'\nimport { Document as DocumentView } from '../Document/index.js'\nimport { forgotPasswordBaseClass, ForgotPasswordView } from '../ForgotPassword/index.js'\nimport { ListView } from '../List/index.js'\nimport { loginBaseClass, LoginView } from '../Login/index.js'\nimport { LogoutInactivity, LogoutView } from '../Logout/index.js'\nimport { ResetPassword, resetPasswordBaseClass } from '../ResetPassword/index.js'\nimport { UnauthorizedView } from '../Unauthorized/index.js'\nimport { Verify, verifyBaseClass } from '../Verify/index.js'\nimport { getCustomViewByRoute } from './getCustomViewByRoute.js'\nimport { isPathMatchingRoute } from './isPathMatchingRoute.js'\n\nconst baseClasses = {\n account: 'account',\n forgot: forgotPasswordBaseClass,\n login: loginBaseClass,\n reset: resetPasswordBaseClass,\n verify: verifyBaseClass,\n}\n\ntype OneSegmentViews = {\n [K in Exclude<keyof SanitizedConfig['admin']['routes'], 'reset'>]: React.FC<AdminViewProps>\n}\n\nexport type ViewFromConfig = {\n Component?: React.FC<AdminViewProps>\n payloadComponent?: AdminViewComponent\n}\n\nconst oneSegmentViews: OneSegmentViews = {\n account: Account,\n createFirstUser: CreateFirstUserView,\n forgot: ForgotPasswordView,\n inactivity: LogoutInactivity,\n login: LoginView,\n logout: LogoutView,\n unauthorized: UnauthorizedView,\n}\n\nexport const getViewFromConfig = ({\n adminRoute,\n config,\n currentRoute,\n importMap,\n searchParams,\n segments,\n}: {\n adminRoute: string\n config: SanitizedConfig\n currentRoute: string\n importMap: ImportMap\n searchParams: {\n [key: string]: string | string[]\n }\n segments: string[]\n}): {\n DefaultView: ViewFromConfig\n initPageOptions: Parameters<typeof initPage>[0]\n templateClassName: string\n templateType: 'default' | 'minimal'\n} => {\n let ViewToRender: ViewFromConfig = null\n let templateClassName: string\n let templateType: 'default' | 'minimal' | undefined\n\n const initPageOptions: Parameters<typeof initPage>[0] = {\n config,\n importMap,\n route: currentRoute,\n searchParams,\n }\n\n const [segmentOne, segmentTwo] = segments\n\n const isGlobal = segmentOne === 'globals'\n const isCollection = segmentOne === 'collections'\n\n switch (segments.length) {\n case 0: {\n if (currentRoute === adminRoute) {\n ViewToRender = {\n Component: Dashboard,\n }\n templateClassName = 'dashboard'\n templateType = 'default'\n initPageOptions.redirectUnauthenticatedUser = true\n }\n break\n }\n case 1: {\n // users can override the default routes via `admin.routes` config\n // i.e.{ admin: { routes: { logout: '/sign-out', inactivity: '/idle' }}}\n let viewKey: keyof typeof oneSegmentViews\n\n if (config.admin.routes) {\n const matchedRoute = Object.entries(config.admin.routes).find(([, route]) => {\n return isPathMatchingRoute({\n currentRoute,\n exact: true,\n path: formatAdminURL({ adminRoute, path: route }),\n })\n })\n\n if (matchedRoute) {\n viewKey = matchedRoute[0] as keyof typeof oneSegmentViews\n }\n }\n\n if (oneSegmentViews[viewKey]) {\n // --> /account\n // --> /create-first-user\n // --> /forgot\n // --> /login\n // --> /logout\n // --> /logout-inactivity\n // --> /unauthorized\n\n ViewToRender = {\n Component: oneSegmentViews[viewKey],\n }\n\n templateClassName = baseClasses[viewKey]\n templateType = 'minimal'\n\n if (viewKey === 'account') {\n initPageOptions.redirectUnauthenticatedUser = true\n templateType = 'default'\n }\n }\n break\n }\n case 2: {\n if (`/${segmentOne}` === config.admin.routes.reset) {\n // --> /reset/:token\n ViewToRender = {\n Component: ResetPassword,\n }\n templateClassName = baseClasses[segmentTwo]\n templateType = 'minimal'\n }\n\n if (isCollection) {\n // --> /collections/:collectionSlug\n initPageOptions.redirectUnauthenticatedUser = true\n\n ViewToRender = {\n Component: ListView,\n }\n\n templateClassName = `${segmentTwo}-list`\n templateType = 'default'\n } else if (isGlobal) {\n // --> /globals/:globalSlug\n initPageOptions.redirectUnauthenticatedUser = true\n\n ViewToRender = {\n Component: DocumentView,\n }\n\n templateClassName = 'global-edit'\n templateType = 'default'\n }\n break\n }\n default:\n if (segmentTwo === 'verify') {\n // --> /:collectionSlug/verify/:token\n ViewToRender = {\n Component: Verify,\n }\n\n templateClassName = 'verify'\n templateType = 'minimal'\n } else if (isCollection) {\n // Custom Views\n // --> /collections/:collectionSlug/:id\n // --> /collections/:collectionSlug/:id/preview\n // --> /collections/:collectionSlug/:id/versions\n // --> /collections/:collectionSlug/:id/versions/:versionId\n // --> /collections/:collectionSlug/:id/api\n initPageOptions.redirectUnauthenticatedUser = true\n\n ViewToRender = {\n Component: DocumentView,\n }\n\n templateClassName = `collection-default-edit`\n templateType = 'default'\n } else if (isGlobal) {\n // Custom Views\n // --> /globals/:globalSlug/versions\n // --> /globals/:globalSlug/preview\n // --> /globals/:globalSlug/versions/:versionId\n // --> /globals/:globalSlug/api\n initPageOptions.redirectUnauthenticatedUser = true\n\n ViewToRender = {\n Component: DocumentView,\n }\n\n templateClassName = `global-edit`\n templateType = 'default'\n }\n break\n }\n\n if (!ViewToRender) {\n ViewToRender = getCustomViewByRoute({ config, currentRoute })?.view\n }\n\n return {\n DefaultView: ViewToRender,\n initPageOptions,\n templateClassName,\n templateType,\n }\n}\n"],"mappings":"AAGA,SAASA,cAAc,QAAQ;AAI/B,SAASC,OAAO,QAAQ;AACxB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,SAAS,QAAQ;AAC1B,SAASC,QAAA,IAAYC,Y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C;UACb;UAEA+B,iBAAA,GAAoB,GAAGK,UAAA,OAAiB;UACxCJ,YAAA,GAAe;QACjB,OAAO,IAAIK,QAAA,EAAU;UACnB;UACAJ,eAAA,CAAgBQ,2BAA2B,GAAG;UAE9CX,YAAA,GAAe;YACbU,SAAA,EAAW3C;UACb;UAEAkC,iBAAA,GAAoB;UACpBC,YAAA,GAAe;QACjB;QACA;MACF;IACA;MACE,IAAII,UAAA,KAAe,UAAU;QAC3B;QACAN,YAAA,GAAe;UACbU,SAAA,EAAWhC;QACb;QAEAuB,iBAAA,GAAoB;QACpBC,YAAA,GAAe;MACjB,OAAO,IAAIM,YAAA,EAAc;QACvB;QACA;QACA;QACA;QACA;QACA;QACAL,eAAA,CAAgBQ,2BAA2B,GAAG;QAE9CX,YAAA,GAAe;UACbU,SAAA,EAAW3C;QACb;QAEAkC,iBAAA,GAAoB,yBAAyB;QAC7CC,YAAA,GAAe;MACjB,OAAO,IAAIK,QAAA,EAAU;QACnB;QACA;QACA;QACA;QACA;QACAJ,eAAA,CAAgBQ,2BAA2B,GAAG;QAE9CX,YAAA,GAAe;UACbU,SAAA,EAAW3C;QACb;QAEAkC,iBAAA,GAAoB,aAAa;QACjCC,YAAA,GAAe;MACjB;MACA;EACJ;EAEA,IAAI,CAACF,YAAA,EAAc;IACjBA,YAAA,GAAepB,oBAAA,CAAqB;MAAEe,MAAA;MAAQC;IAAa,IAAIyB,IAAA;EACjE;EAEA,OAAO;IACLC,WAAA,EAAatB,YAAA;IACbG,eAAA;IACAF,iBAAA;IACAC;EACF;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"getViewFromConfig.js","names":["formatAdminURL","Account","CreateFirstUserView","Dashboard","Document","DocumentView","forgotPasswordBaseClass","ForgotPasswordView","ListView","loginBaseClass","LoginView","LogoutInactivity","LogoutView","ResetPassword","resetPasswordBaseClass","UnauthorizedView","Verify","verifyBaseClass","getCustomViewByRoute","isPathMatchingRoute","baseClasses","account","forgot","login","reset","verify","oneSegmentViews","createFirstUser","inactivity","logout","unauthorized","getViewFromConfig","adminRoute","config","currentRoute","importMap","searchParams","segments","ViewToRender","templateClassName","templateType","initPageOptions","route","segmentOne","segmentTwo","isGlobal","isCollection","length","Component","viewKey","admin","routes","matchedRoute","Object","entries","find","exact","path","view","DefaultView"],"sources":["../../../src/views/Root/getViewFromConfig.ts"],"sourcesContent":["import type { AdminViewComponent, AdminViewProps, ImportMap, SanitizedConfig } from 'payload'\nimport type React from 'react'\n\nimport { formatAdminURL } from '@payloadcms/ui/shared'\n\nimport type { initPage } from '../../utilities/initPage/index.js'\n\nimport { Account } from '../Account/index.js'\nimport { CreateFirstUserView } from '../CreateFirstUser/index.js'\nimport { Dashboard } from '../Dashboard/index.js'\nimport { Document as DocumentView } from '../Document/index.js'\nimport { forgotPasswordBaseClass, ForgotPasswordView } from '../ForgotPassword/index.js'\nimport { ListView } from '../List/index.js'\nimport { loginBaseClass, LoginView } from '../Login/index.js'\nimport { LogoutInactivity, LogoutView } from '../Logout/index.js'\nimport { ResetPassword, resetPasswordBaseClass } from '../ResetPassword/index.js'\nimport { UnauthorizedView } from '../Unauthorized/index.js'\nimport { Verify, verifyBaseClass } from '../Verify/index.js'\nimport { getCustomViewByRoute } from './getCustomViewByRoute.js'\nimport { isPathMatchingRoute } from './isPathMatchingRoute.js'\n\nconst baseClasses = {\n account: 'account',\n forgot: forgotPasswordBaseClass,\n login: loginBaseClass,\n reset: resetPasswordBaseClass,\n verify: verifyBaseClass,\n}\n\ntype OneSegmentViews = {\n [K in Exclude<keyof SanitizedConfig['admin']['routes'], 'reset'>]: React.FC<AdminViewProps>\n}\n\nexport type ViewFromConfig = {\n Component?: React.FC<AdminViewProps>\n payloadComponent?: AdminViewComponent\n}\n\nconst oneSegmentViews: OneSegmentViews = {\n account: Account,\n createFirstUser: CreateFirstUserView,\n forgot: ForgotPasswordView,\n inactivity: LogoutInactivity,\n login: LoginView,\n logout: LogoutView,\n unauthorized: UnauthorizedView,\n}\n\nexport const getViewFromConfig = ({\n adminRoute,\n config,\n currentRoute,\n importMap,\n searchParams,\n segments,\n}: {\n adminRoute: string\n config: SanitizedConfig\n currentRoute: string\n importMap: ImportMap\n searchParams: {\n [key: string]: string | string[]\n }\n segments: string[]\n}): {\n DefaultView: ViewFromConfig\n initPageOptions: Parameters<typeof initPage>[0]\n templateClassName: string\n templateType: 'default' | 'minimal'\n} => {\n let ViewToRender: ViewFromConfig = null\n let templateClassName: string\n let templateType: 'default' | 'minimal' | undefined\n\n const initPageOptions: Parameters<typeof initPage>[0] = {\n config,\n importMap,\n route: currentRoute,\n searchParams,\n }\n\n const [segmentOne, segmentTwo] = segments\n\n const isGlobal = segmentOne === 'globals'\n const isCollection = segmentOne === 'collections'\n\n switch (segments.length) {\n case 0: {\n if (currentRoute === adminRoute) {\n ViewToRender = {\n Component: Dashboard,\n }\n templateClassName = 'dashboard'\n templateType = 'default'\n }\n break\n }\n case 1: {\n // users can override the default routes via `admin.routes` config\n // i.e.{ admin: { routes: { logout: '/sign-out', inactivity: '/idle' }}}\n let viewKey: keyof typeof oneSegmentViews\n\n if (config.admin.routes) {\n const matchedRoute = Object.entries(config.admin.routes).find(([, route]) => {\n return isPathMatchingRoute({\n currentRoute,\n exact: true,\n path: formatAdminURL({ adminRoute, path: route }),\n })\n })\n\n if (matchedRoute) {\n viewKey = matchedRoute[0] as keyof typeof oneSegmentViews\n }\n }\n\n if (oneSegmentViews[viewKey]) {\n // --> /account\n // --> /create-first-user\n // --> /forgot\n // --> /login\n // --> /logout\n // --> /logout-inactivity\n // --> /unauthorized\n\n ViewToRender = {\n Component: oneSegmentViews[viewKey],\n }\n\n templateClassName = baseClasses[viewKey]\n templateType = 'minimal'\n\n if (viewKey === 'account') {\n templateType = 'default'\n }\n }\n break\n }\n case 2: {\n if (`/${segmentOne}` === config.admin.routes.reset) {\n // --> /reset/:token\n ViewToRender = {\n Component: ResetPassword,\n }\n templateClassName = baseClasses[segmentTwo]\n templateType = 'minimal'\n }\n\n if (isCollection) {\n // --> /collections/:collectionSlug\n\n ViewToRender = {\n Component: ListView,\n }\n\n templateClassName = `${segmentTwo}-list`\n templateType = 'default'\n } else if (isGlobal) {\n // --> /globals/:globalSlug\n\n ViewToRender = {\n Component: DocumentView,\n }\n\n templateClassName = 'global-edit'\n templateType = 'default'\n }\n break\n }\n default:\n if (segmentTwo === 'verify') {\n // --> /:collectionSlug/verify/:token\n ViewToRender = {\n Component: Verify,\n }\n\n templateClassName = 'verify'\n templateType = 'minimal'\n } else if (isCollection) {\n // Custom Views\n // --> /collections/:collectionSlug/:id\n // --> /collections/:collectionSlug/:id/preview\n // --> /collections/:collectionSlug/:id/versions\n // --> /collections/:collectionSlug/:id/versions/:versionId\n // --> /collections/:collectionSlug/:id/api\n\n ViewToRender = {\n Component: DocumentView,\n }\n\n templateClassName = `collection-default-edit`\n templateType = 'default'\n } else if (isGlobal) {\n // Custom Views\n // --> /globals/:globalSlug/versions\n // --> /globals/:globalSlug/preview\n // --> /globals/:globalSlug/versions/:versionId\n // --> /globals/:globalSlug/api\n\n ViewToRender = {\n Component: DocumentView,\n }\n\n templateClassName = `global-edit`\n templateType = 'default'\n }\n break\n }\n\n if (!ViewToRender) {\n ViewToRender = getCustomViewByRoute({ config, currentRoute })?.view\n }\n\n return {\n DefaultView: ViewToRender,\n initPageOptions,\n templateClassName,\n templateType,\n }\n}\n"],"mappings":"AAGA,SAASA,cAAc,QAAQ;AAI/B,SAASC,OAAO,QAAQ;AACxB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,SAAS,QAAQ;AAC1B,SAASC,QAAA,IAAYC,YAAY,QAAQ;AACzC,SAASC,uBAAuB,EAAEC,kBAAkB,QAAQ;AAC5D,SAASC,QAAQ,QAAQ;AACzB,SAASC,cAAc,EAAEC,SAAS,QAAQ;AAC1C,SAASC,gBAAgB,EAAEC,UAAU,QAAQ;AAC7C,SAASC,aAAa,EAAEC,sBAAsB,QAAQ;AACtD,SAASC,gBAAgB,QAAQ;AACjC,SAASC,MA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EAAc;QACvB;QACA;QACA;QACA;QACA;QACA;QAEAR,YAAA,GAAe;UACbU,SAAA,EAAW3C;QACb;QAEAkC,iBAAA,GAAoB,yBAAyB;QAC7CC,YAAA,GAAe;MACjB,OAAO,IAAIK,QAAA,EAAU;QACnB;QACA;QACA;QACA;QACA;QAEAP,YAAA,GAAe;UACbU,SAAA,EAAW3C;QACb;QAEAkC,iBAAA,GAAoB,aAAa;QACjCC,YAAA,GAAe;MACjB;MACA;EACJ;EAEA,IAAI,CAACF,YAAA,EAAc;IACjBA,YAAA,GAAepB,oBAAA,CAAqB;MAAEe,MAAA;MAAQC;IAAa,IAAIwB,IAAA;EACjE;EAEA,OAAO;IACLC,WAAA,EAAarB,YAAA;IACbG,eAAA;IACAF,iBAAA;IACAC;EACF;AACF","ignoreList":[]}
|
|
@@ -11,14 +11,14 @@ export type GenerateViewMetadata = (args: {
|
|
|
11
11
|
[key: string]: string | string[];
|
|
12
12
|
};
|
|
13
13
|
}) => Promise<Metadata>;
|
|
14
|
-
export declare const RootPage: ({ config: configPromise, importMap, params, searchParams, }: {
|
|
14
|
+
export declare const RootPage: ({ config: configPromise, importMap, params: paramsPromise, searchParams: searchParamsPromise, }: {
|
|
15
15
|
readonly config: Promise<SanitizedConfig>;
|
|
16
16
|
readonly importMap: ImportMap;
|
|
17
|
-
readonly params: {
|
|
17
|
+
readonly params: Promise<{
|
|
18
18
|
segments: string[];
|
|
19
|
-
}
|
|
20
|
-
readonly searchParams: {
|
|
19
|
+
}>;
|
|
20
|
+
readonly searchParams: Promise<{
|
|
21
21
|
[key: string]: string | string[];
|
|
22
|
-
}
|
|
22
|
+
}>;
|
|
23
23
|
}) => Promise<React.JSX.Element>;
|
|
24
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Root/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,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;IACD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IACzC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QACvB,QAAQ,EAAE,MAAM,EAAE,CAAA;KACnB,CAAC,CAAA;IACF,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;QAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;KACjC,CAAC,CAAA;CACH,+BAoHA,CAAA"}
|
package/dist/views/Root/index.js
CHANGED
|
@@ -10,8 +10,8 @@ export { generatePageMetadata } from './meta.js';
|
|
|
10
10
|
export const RootPage = async ({
|
|
11
11
|
config: configPromise,
|
|
12
12
|
importMap,
|
|
13
|
-
params,
|
|
14
|
-
searchParams
|
|
13
|
+
params: paramsPromise,
|
|
14
|
+
searchParams: searchParamsPromise
|
|
15
15
|
}) => {
|
|
16
16
|
const config = await configPromise;
|
|
17
17
|
const {
|
|
@@ -25,11 +25,13 @@ export const RootPage = async ({
|
|
|
25
25
|
admin: adminRoute
|
|
26
26
|
}
|
|
27
27
|
} = config;
|
|
28
|
+
const params = await paramsPromise;
|
|
28
29
|
const currentRoute = formatAdminURL({
|
|
29
30
|
adminRoute,
|
|
30
31
|
path: `${Array.isArray(params.segments) ? `/${params.segments.join('/')}` : ''}`
|
|
31
32
|
});
|
|
32
33
|
const segments = Array.isArray(params.segments) ? params.segments : [];
|
|
34
|
+
const searchParams = await searchParamsPromise;
|
|
33
35
|
const {
|
|
34
36
|
DefaultView,
|
|
35
37
|
initPageOptions,
|
|
@@ -48,6 +50,9 @@ export const RootPage = async ({
|
|
|
48
50
|
notFound();
|
|
49
51
|
}
|
|
50
52
|
const initPageResult = await initPage(initPageOptions);
|
|
53
|
+
if (typeof initPageResult?.redirectTo === 'string') {
|
|
54
|
+
redirect(initPageResult.redirectTo);
|
|
55
|
+
}
|
|
51
56
|
if (initPageResult) {
|
|
52
57
|
dbHasUser = await initPageResult?.req.payload.db.findOne({
|
|
53
58
|
collection: userSlug,
|
|
@@ -103,8 +108,8 @@ export const RootPage = async ({
|
|
|
103
108
|
visibleEntities: {
|
|
104
109
|
// The reason we are not passing in initPageResult.visibleEntities directly is due to a "Cannot assign to read only property of object '#<Object>" error introduced in React 19
|
|
105
110
|
// which this caused as soon as initPageResult.visibleEntities is passed in
|
|
106
|
-
collections: initPageResult
|
|
107
|
-
globals: initPageResult
|
|
111
|
+
collections: initPageResult?.visibleEntities?.collections,
|
|
112
|
+
globals: initPageResult?.visibleEntities?.globals
|
|
108
113
|
},
|
|
109
114
|
children: RenderedView
|
|
110
115
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["formatAdminURL","getCreateMappedComponent","RenderComponent","notFound","redirect","React","Fragment","DefaultTemplate","MinimalTemplate","initPage","getViewFromConfig","generatePageMetadata","RootPage","config","configPromise","importMap","params","searchParams","admin","routes","createFirstUser","_createFirstUserRoute","user","userSlug","adminRoute","currentRoute","path","Array","isArray","segments","join","DefaultView","initPageOptions","templateClassName","templateType","dbHasUser","Component","payloadComponent","initPageResult","req","payload","db","findOne","collection","then","doc","createFirstUserRoute","collectionConfig","collections","find","slug","disableLocalStrategy","auth","createMappedView","serverProps","i18n","MappedView","undefined","RenderedView","_jsx","mappedComponent","_jsxs","className","locale","permissions","visibleEntities","globals"],"sources":["../../../src/views/Root/index.tsx"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { Metadata } from 'next'\nimport type { ImportMap, MappedComponent, SanitizedConfig } from 'payload'\n\nimport { formatAdminURL, getCreateMappedComponent, RenderComponent } from '@payloadcms/ui/shared'\nimport { notFound, redirect } from 'next/navigation.js'\nimport React, { Fragment } from 'react'\n\nimport { DefaultTemplate } from '../../templates/Default/index.js'\nimport { MinimalTemplate } from '../../templates/Minimal/index.js'\nimport { initPage } from '../../utilities/initPage/index.js'\nimport { getViewFromConfig } from './getViewFromConfig.js'\n\nexport { generatePageMetadata } from './meta.js'\n\nexport type GenerateViewMetadata = (args: {\n config: SanitizedConfig\n i18n: I18nClient\n isEditing?: boolean\n params?: { [key: string]: string | string[] }\n}) => Promise<Metadata>\n\nexport const RootPage = async ({\n config: configPromise,\n importMap,\n params,\n searchParams,\n}: {\n readonly config: Promise<SanitizedConfig>\n readonly importMap: ImportMap\n readonly params: {\n segments: string[]\n }
|
|
1
|
+
{"version":3,"file":"index.js","names":["formatAdminURL","getCreateMappedComponent","RenderComponent","notFound","redirect","React","Fragment","DefaultTemplate","MinimalTemplate","initPage","getViewFromConfig","generatePageMetadata","RootPage","config","configPromise","importMap","params","paramsPromise","searchParams","searchParamsPromise","admin","routes","createFirstUser","_createFirstUserRoute","user","userSlug","adminRoute","currentRoute","path","Array","isArray","segments","join","DefaultView","initPageOptions","templateClassName","templateType","dbHasUser","Component","payloadComponent","initPageResult","redirectTo","req","payload","db","findOne","collection","then","doc","createFirstUserRoute","collectionConfig","collections","find","slug","disableLocalStrategy","auth","createMappedView","serverProps","i18n","MappedView","undefined","RenderedView","_jsx","mappedComponent","_jsxs","className","locale","permissions","visibleEntities","globals"],"sources":["../../../src/views/Root/index.tsx"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { Metadata } from 'next'\nimport type { ImportMap, MappedComponent, SanitizedConfig } from 'payload'\n\nimport { formatAdminURL, getCreateMappedComponent, RenderComponent } from '@payloadcms/ui/shared'\nimport { notFound, redirect } from 'next/navigation.js'\nimport React, { Fragment } from 'react'\n\nimport { DefaultTemplate } from '../../templates/Default/index.js'\nimport { MinimalTemplate } from '../../templates/Minimal/index.js'\nimport { initPage } from '../../utilities/initPage/index.js'\nimport { getViewFromConfig } from './getViewFromConfig.js'\n\nexport { generatePageMetadata } from './meta.js'\n\nexport type GenerateViewMetadata = (args: {\n config: SanitizedConfig\n i18n: I18nClient\n isEditing?: boolean\n params?: { [key: string]: string | string[] }\n}) => Promise<Metadata>\n\nexport const RootPage = async ({\n config: configPromise,\n importMap,\n params: paramsPromise,\n searchParams: searchParamsPromise,\n}: {\n readonly config: Promise<SanitizedConfig>\n readonly importMap: ImportMap\n readonly params: Promise<{\n segments: string[]\n }>\n readonly searchParams: Promise<{\n [key: string]: string | string[]\n }>\n}) => {\n const config = await configPromise\n\n const {\n admin: {\n routes: { createFirstUser: _createFirstUserRoute },\n user: userSlug,\n },\n routes: { admin: adminRoute },\n } = config\n\n const params = await paramsPromise\n const currentRoute = formatAdminURL({\n adminRoute,\n path: `${Array.isArray(params.segments) ? `/${params.segments.join('/')}` : ''}`,\n })\n\n const segments = Array.isArray(params.segments) ? params.segments : []\n\n const searchParams = await searchParamsPromise\n\n const { DefaultView, initPageOptions, templateClassName, templateType } = getViewFromConfig({\n adminRoute,\n config,\n currentRoute,\n importMap,\n searchParams,\n segments,\n })\n\n let dbHasUser = false\n\n if (!DefaultView?.Component && !DefaultView?.payloadComponent) {\n notFound()\n }\n\n const initPageResult = await initPage(initPageOptions)\n\n if (typeof initPageResult?.redirectTo === 'string') {\n redirect(initPageResult.redirectTo)\n }\n\n if (initPageResult) {\n dbHasUser = await initPageResult?.req.payload.db\n .findOne({\n collection: userSlug,\n req: initPageResult?.req,\n })\n ?.then((doc) => !!doc)\n\n const createFirstUserRoute = formatAdminURL({ adminRoute, path: _createFirstUserRoute })\n\n const collectionConfig = config.collections.find(({ slug }) => slug === userSlug)\n const disableLocalStrategy = collectionConfig?.auth?.disableLocalStrategy\n\n if (disableLocalStrategy && currentRoute === createFirstUserRoute) {\n redirect(adminRoute)\n }\n\n if (!dbHasUser && currentRoute !== createFirstUserRoute && !disableLocalStrategy) {\n redirect(createFirstUserRoute)\n }\n\n if (dbHasUser && currentRoute === createFirstUserRoute) {\n redirect(adminRoute)\n }\n }\n\n const createMappedView = getCreateMappedComponent({\n importMap,\n serverProps: {\n i18n: initPageResult?.req.i18n,\n importMap,\n initPageResult,\n params,\n payload: initPageResult?.req.payload,\n searchParams,\n },\n })\n\n const MappedView: MappedComponent = createMappedView(\n DefaultView.payloadComponent,\n undefined,\n DefaultView.Component,\n 'createMappedView',\n )\n\n const RenderedView = <RenderComponent mappedComponent={MappedView} />\n\n return (\n <Fragment>\n {!templateType && <Fragment>{RenderedView}</Fragment>}\n {templateType === 'minimal' && (\n <MinimalTemplate className={templateClassName}>{RenderedView}</MinimalTemplate>\n )}\n {templateType === 'default' && (\n <DefaultTemplate\n i18n={initPageResult?.req.i18n}\n locale={initPageResult?.locale}\n params={params}\n payload={initPageResult?.req.payload}\n permissions={initPageResult?.permissions}\n searchParams={searchParams}\n user={initPageResult?.req.user}\n visibleEntities={{\n // The reason we are not passing in initPageResult.visibleEntities directly is due to a \"Cannot assign to read only property of object '#<Object>\" error introduced in React 19\n // which this caused as soon as initPageResult.visibleEntities is passed in\n collections: initPageResult?.visibleEntities?.collections,\n globals: initPageResult?.visibleEntities?.globals,\n }}\n >\n {RenderedView}\n </DefaultTemplate>\n )}\n </Fragment>\n )\n}\n"],"mappings":";AAIA,SAASA,cAAc,EAAEC,wBAAwB,EAAEC,eAAe,QAAQ;AAC1E,SAASC,QAAQ,EAAEC,QAAQ,QAAQ;AACnC,OAAOC,KAAA,IAASC,QAAQ,QAAQ;AAEhC,SAASC,eAAe,QAAQ;AAChC,SAASC,eAAe,QAAQ;AAChC,SAASC,QAAQ,QAAQ;AACzB,SAASC,iBAAiB,QAAQ;AAElC,SAASC,oBAAoB,QAAQ;AASrC,OAAO,MAAMC,QAAA,GAAW,MAAAA,CAAO;EAC7BC,MAAA,EAAQC,aAAa;EACrBC,SAAS;EACTC,MAAA,EAAQC,aAAa;EACrBC,YAAA,EAAcC;AAAmB,CAUlC;EACC,MAAMN,MAAA,GAAS,MAAMC,aAAA;EAErB,MAAM;IACJM,KAAA,EAAO;MACLC,MAAA,EAAQ;QAAEC,eAAA,EAAiBC;MAAqB,CAAE;MAClDC,IAAA,EAAMC;IAAQ,CACf;IACDJ,MAAA,EAAQ;MAAED,KAAA,EAA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