@payloadcms/next 3.0.0-beta.90 → 3.0.0-beta.92
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/cjs/withPayload.js +111 -0
- package/dist/cjs/withPayload.js.map +1 -0
- package/dist/config.js +0 -1
- package/dist/config.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js +15 -9
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js +100 -35
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js +74 -63
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/getCustomViews.js +31 -35
- package/dist/elements/DocumentHeader/Tabs/getCustomViews.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/getViewConfig.js +15 -12
- package/dist/elements/DocumentHeader/Tabs/getViewConfig.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.js +86 -79
- package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js +32 -13
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js +60 -52
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js.map +1 -1
- package/dist/elements/DocumentHeader/index.js +24 -23
- package/dist/elements/DocumentHeader/index.js.map +1 -1
- package/dist/elements/EmailAndUsername/index.js +107 -75
- package/dist/elements/EmailAndUsername/index.js.map +1 -1
- package/dist/elements/LeaveWithoutSaving/index.js +150 -83
- package/dist/elements/LeaveWithoutSaving/index.js.map +1 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts.map +1 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js +119 -101
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +1 -1
- package/dist/elements/Logo/index.js +36 -21
- package/dist/elements/Logo/index.js.map +1 -1
- package/dist/elements/Nav/NavHamburger/index.js +41 -13
- package/dist/elements/Nav/NavHamburger/index.js.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.js +48 -16
- package/dist/elements/Nav/NavWrapper/index.js.map +1 -1
- package/dist/elements/Nav/index.client.js +149 -76
- package/dist/elements/Nav/index.client.js.map +1 -1
- package/dist/elements/Nav/index.js +56 -50
- package/dist/elements/Nav/index.js.map +1 -1
- package/dist/exports/layouts.js +0 -1
- package/dist/exports/layouts.js.map +1 -1
- package/dist/exports/routes.js +0 -1
- package/dist/exports/routes.js.map +1 -1
- package/dist/exports/templates.js +0 -1
- package/dist/exports/templates.js.map +1 -1
- package/dist/exports/utilities.js +0 -1
- package/dist/exports/utilities.js.map +1 -1
- package/dist/exports/views.js +0 -1
- package/dist/exports/views.js.map +1 -1
- package/dist/fetchAPI-multipart/fileFactory.js +35 -34
- package/dist/fetchAPI-multipart/fileFactory.js.map +1 -1
- package/dist/fetchAPI-multipart/handlers.js +77 -78
- package/dist/fetchAPI-multipart/handlers.js.map +1 -1
- package/dist/fetchAPI-multipart/index.js +33 -31
- package/dist/fetchAPI-multipart/index.js.map +1 -1
- package/dist/fetchAPI-multipart/isEligibleRequest.js +13 -21
- package/dist/fetchAPI-multipart/isEligibleRequest.js.map +1 -1
- package/dist/fetchAPI-multipart/processMultipart.js +158 -141
- package/dist/fetchAPI-multipart/processMultipart.js.map +1 -1
- package/dist/fetchAPI-multipart/processNested.js +23 -21
- package/dist/fetchAPI-multipart/processNested.js.map +1 -1
- package/dist/fetchAPI-multipart/uploadTimer.js +16 -17
- package/dist/fetchAPI-multipart/uploadTimer.js.map +1 -1
- package/dist/fetchAPI-multipart/utilities.js +166 -166
- package/dist/fetchAPI-multipart/utilities.js.map +1 -1
- package/dist/fetchAPI-stream-file/index.js +19 -17
- package/dist/fetchAPI-stream-file/index.js.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/layouts/Root/index.js +118 -115
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/prod/styles.css +1 -1
- package/dist/routes/graphql/handler.js +109 -103
- package/dist/routes/graphql/handler.js.map +1 -1
- package/dist/routes/graphql/index.js +0 -1
- package/dist/routes/graphql/index.js.map +1 -1
- package/dist/routes/graphql/playground.js +23 -24
- package/dist/routes/graphql/playground.js.map +1 -1
- package/dist/routes/index.js +0 -1
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/rest/auth/access.js +22 -21
- package/dist/routes/rest/auth/access.js.map +1 -1
- package/dist/routes/rest/auth/forgotPassword.js +29 -25
- package/dist/routes/rest/auth/forgotPassword.js.map +1 -1
- package/dist/routes/rest/auth/init.js +16 -14
- package/dist/routes/rest/auth/init.js.map +1 -1
- package/dist/routes/rest/auth/login.js +43 -38
- package/dist/routes/rest/auth/login.js.map +1 -1
- package/dist/routes/rest/auth/logout.js +31 -27
- package/dist/routes/rest/auth/logout.js.map +1 -1
- package/dist/routes/rest/auth/me.js +23 -21
- package/dist/routes/rest/auth/me.js.map +1 -1
- package/dist/routes/rest/auth/refresh.js +31 -27
- package/dist/routes/rest/auth/refresh.js.map +1 -1
- package/dist/routes/rest/auth/registerFirstUser.js +43 -38
- package/dist/routes/rest/auth/registerFirstUser.js.map +1 -1
- package/dist/routes/rest/auth/resetPassword.js +38 -33
- package/dist/routes/rest/auth/resetPassword.js.map +1 -1
- package/dist/routes/rest/auth/unlock.js +27 -23
- package/dist/routes/rest/auth/unlock.js.map +1 -1
- package/dist/routes/rest/auth/verifyEmail.js +22 -17
- package/dist/routes/rest/auth/verifyEmail.js.map +1 -1
- package/dist/routes/rest/buildFormState.js +38 -37
- package/dist/routes/rest/buildFormState.js.map +1 -1
- package/dist/routes/rest/checkEndpoints.js +11 -9
- package/dist/routes/rest/checkEndpoints.js.map +1 -1
- package/dist/routes/rest/collections/count.js +15 -11
- package/dist/routes/rest/collections/count.js.map +1 -1
- package/dist/routes/rest/collections/create.js +30 -26
- package/dist/routes/rest/collections/create.js.map +1 -1
- package/dist/routes/rest/collections/delete.js +40 -35
- package/dist/routes/rest/collections/delete.js.map +1 -1
- package/dist/routes/rest/collections/deleteByID.js +36 -31
- package/dist/routes/rest/collections/deleteByID.js.map +1 -1
- package/dist/routes/rest/collections/docAccess.js +17 -14
- package/dist/routes/rest/collections/docAccess.js.map +1 -1
- package/dist/routes/rest/collections/duplicate.js +36 -31
- package/dist/routes/rest/collections/duplicate.js.map +1 -1
- package/dist/routes/rest/collections/find.js +29 -20
- package/dist/routes/rest/collections/find.js.map +1 -1
- package/dist/routes/rest/collections/findByID.js +28 -23
- package/dist/routes/rest/collections/findByID.js.map +1 -1
- package/dist/routes/rest/collections/findVersionByID.js +27 -22
- package/dist/routes/rest/collections/findVersionByID.js.map +1 -1
- package/dist/routes/rest/collections/findVersions.js +27 -19
- package/dist/routes/rest/collections/findVersions.js.map +1 -1
- package/dist/routes/rest/collections/preview.js +39 -34
- package/dist/routes/rest/collections/preview.js.map +1 -1
- package/dist/routes/rest/collections/restoreVersion.js +32 -27
- package/dist/routes/rest/collections/restoreVersion.js.map +1 -1
- package/dist/routes/rest/collections/update.js +43 -37
- package/dist/routes/rest/collections/update.js.map +1 -1
- package/dist/routes/rest/collections/updateByID.js +38 -33
- package/dist/routes/rest/collections/updateByID.js.map +1 -1
- package/dist/routes/rest/files/checkFileAccess.js +46 -44
- package/dist/routes/rest/files/checkFileAccess.js.map +1 -1
- package/dist/routes/rest/files/getFile.js +52 -49
- package/dist/routes/rest/files/getFile.js.map +1 -1
- package/dist/routes/rest/files/getFileTypeFallback.js +16 -17
- package/dist/routes/rest/files/getFileTypeFallback.js.map +1 -1
- package/dist/routes/rest/globals/docAccess.js +15 -13
- package/dist/routes/rest/globals/docAccess.js.map +1 -1
- package/dist/routes/rest/globals/findOne.js +22 -18
- package/dist/routes/rest/globals/findOne.js.map +1 -1
- package/dist/routes/rest/globals/findVersionByID.js +22 -17
- package/dist/routes/rest/globals/findVersionByID.js.map +1 -1
- package/dist/routes/rest/globals/findVersions.js +27 -19
- package/dist/routes/rest/globals/findVersions.js.map +1 -1
- package/dist/routes/rest/globals/preview.js +38 -34
- package/dist/routes/rest/globals/preview.js.map +1 -1
- package/dist/routes/rest/globals/restoreVersion.js +27 -22
- package/dist/routes/rest/globals/restoreVersion.js.map +1 -1
- package/dist/routes/rest/globals/update.js +32 -28
- package/dist/routes/rest/globals/update.js.map +1 -1
- package/dist/routes/rest/index.js +651 -626
- package/dist/routes/rest/index.js.map +1 -1
- package/dist/routes/rest/og/image.js +74 -76
- package/dist/routes/rest/og/image.js.map +1 -1
- package/dist/routes/rest/og/index.js +60 -59
- package/dist/routes/rest/og/index.js.map +1 -1
- package/dist/routes/rest/routeError.js +102 -95
- package/dist/routes/rest/routeError.js.map +1 -1
- package/dist/routes/rest/types.js +1 -2
- package/dist/routes/rest/types.js.map +1 -1
- package/dist/routes/rest/utilities/sanitizeCollectionID.js +14 -11
- package/dist/routes/rest/utilities/sanitizeCollectionID.js.map +1 -1
- package/dist/scss/app.scss +4 -4
- package/dist/scss/type.scss +4 -4
- package/dist/templates/Default/NavHamburger/index.js +18 -6
- package/dist/templates/Default/NavHamburger/index.js.map +1 -1
- package/dist/templates/Default/Wrapper/index.js +42 -13
- package/dist/templates/Default/Wrapper/index.js.map +1 -1
- package/dist/templates/Default/index.js +54 -47
- package/dist/templates/Default/index.js.map +1 -1
- package/dist/templates/Minimal/index.js +16 -16
- package/dist/templates/Minimal/index.js.map +1 -1
- package/dist/utilities/addDataAndFileToRequest.js +40 -35
- package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
- package/dist/utilities/addLocalesToRequest.js +44 -36
- package/dist/utilities/addLocalesToRequest.js.map +1 -1
- package/dist/utilities/createPayloadRequest.js +85 -74
- package/dist/utilities/createPayloadRequest.js.map +1 -1
- package/dist/utilities/getNextRequestI18n.js +13 -11
- package/dist/utilities/getNextRequestI18n.js.map +1 -1
- package/dist/utilities/getPayloadHMR.d.ts +1 -1
- package/dist/utilities/getPayloadHMR.d.ts.map +1 -1
- package/dist/utilities/getPayloadHMR.js +91 -94
- package/dist/utilities/getPayloadHMR.js.map +1 -1
- package/dist/utilities/getRequestLanguage.js +16 -13
- package/dist/utilities/getRequestLanguage.js.map +1 -1
- package/dist/utilities/getRequestLocales.js +27 -24
- package/dist/utilities/getRequestLocales.js.map +1 -1
- package/dist/utilities/getRequestTheme.js +16 -16
- package/dist/utilities/getRequestTheme.js.map +1 -1
- package/dist/utilities/headersWithCors.js +21 -30
- package/dist/utilities/headersWithCors.js.map +1 -1
- package/dist/utilities/initPage/handleAdminPage.js +46 -42
- package/dist/utilities/initPage/handleAdminPage.js.map +1 -1
- package/dist/utilities/initPage/handleAuthRedirect.js +45 -32
- package/dist/utilities/initPage/handleAuthRedirect.js.map +1 -1
- package/dist/utilities/initPage/index.js +146 -120
- package/dist/utilities/initPage/index.js.map +1 -1
- package/dist/utilities/initPage/shared.js +26 -25
- package/dist/utilities/initPage/shared.js.map +1 -1
- package/dist/utilities/initPage/types.js +1 -2
- package/dist/utilities/initPage/types.js.map +1 -1
- package/dist/utilities/mergeHeaders.js +8 -9
- package/dist/utilities/mergeHeaders.js.map +1 -1
- package/dist/utilities/meta.js +66 -68
- package/dist/utilities/meta.js.map +1 -1
- package/dist/utilities/timestamp.js +4 -5
- package/dist/utilities/timestamp.js.map +1 -1
- package/dist/views/API/LocaleSelector/index.d.ts.map +1 -1
- package/dist/views/API/LocaleSelector/index.js +38 -11
- package/dist/views/API/LocaleSelector/index.js.map +1 -1
- package/dist/views/API/RenderJSON/index.js +124 -112
- package/dist/views/API/RenderJSON/index.js.map +1 -1
- package/dist/views/API/index.client.js +190 -202
- package/dist/views/API/index.client.js.map +1 -1
- package/dist/views/API/index.js +2 -3
- package/dist/views/API/index.js.map +1 -1
- package/dist/views/API/meta.js +22 -18
- package/dist/views/API/meta.js.map +1 -1
- package/dist/views/Account/Settings/LanguageSelector.js +45 -12
- package/dist/views/Account/Settings/LanguageSelector.js.map +1 -1
- package/dist/views/Account/Settings/index.js +21 -28
- package/dist/views/Account/Settings/index.js.map +1 -1
- package/dist/views/Account/ToggleTheme/index.js +51 -30
- package/dist/views/Account/ToggleTheme/index.js.map +1 -1
- package/dist/views/Account/index.client.js +32 -16
- package/dist/views/Account/index.client.js.map +1 -1
- package/dist/views/Account/index.js +99 -68
- package/dist/views/Account/index.js.map +1 -1
- package/dist/views/Account/meta.js +12 -8
- package/dist/views/Account/meta.js.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +95 -57
- package/dist/views/CreateFirstUser/index.client.js.map +1 -1
- package/dist/views/CreateFirstUser/index.js +42 -28
- package/dist/views/CreateFirstUser/index.js.map +1 -1
- package/dist/views/CreateFirstUser/meta.js +12 -8
- package/dist/views/CreateFirstUser/meta.js.map +1 -1
- package/dist/views/Dashboard/Default/index.js +132 -115
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- package/dist/views/Dashboard/index.js +61 -52
- package/dist/views/Dashboard/index.js.map +1 -1
- package/dist/views/Dashboard/meta.js +16 -12
- package/dist/views/Dashboard/meta.js.map +1 -1
- package/dist/views/Document/getCustomViewByKey.js +2 -3
- package/dist/views/Document/getCustomViewByKey.js.map +1 -1
- package/dist/views/Document/getCustomViewByRoute.js +30 -27
- package/dist/views/Document/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Document/getDocumentData.js +34 -28
- package/dist/views/Document/getDocumentData.js.map +1 -1
- package/dist/views/Document/getDocumentPermissions.js +83 -74
- package/dist/views/Document/getDocumentPermissions.js.map +1 -1
- package/dist/views/Document/getMetaBySegment.js +113 -107
- package/dist/views/Document/getMetaBySegment.js.map +1 -1
- package/dist/views/Document/getViewsFromConfig.js +309 -331
- package/dist/views/Document/getViewsFromConfig.js.map +1 -1
- package/dist/views/Document/index.d.ts.map +1 -1
- package/dist/views/Document/index.js +193 -159
- package/dist/views/Document/index.js.map +1 -1
- package/dist/views/Document/meta.js +1 -2
- package/dist/views/Document/meta.js.map +1 -1
- package/dist/views/Edit/Default/Auth/APIKey.js +118 -132
- package/dist/views/Edit/Default/Auth/APIKey.js.map +1 -1
- package/dist/views/Edit/Default/Auth/index.js +293 -196
- package/dist/views/Edit/Default/Auth/index.js.map +1 -1
- package/dist/views/Edit/Default/Auth/types.js +1 -2
- package/dist/views/Edit/Default/Auth/types.js.map +1 -1
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js +121 -70
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js.map +1 -1
- package/dist/views/Edit/Default/SetDocumentTitle/index.js +74 -29
- package/dist/views/Edit/Default/SetDocumentTitle/index.js.map +1 -1
- package/dist/views/Edit/Default/index.js +190 -187
- package/dist/views/Edit/Default/index.js.map +1 -1
- package/dist/views/Edit/Default/types.js +1 -2
- package/dist/views/Edit/Default/types.js.map +1 -1
- package/dist/views/Edit/index.client.js +45 -21
- package/dist/views/Edit/index.client.js.map +1 -1
- package/dist/views/Edit/index.js +2 -3
- package/dist/views/Edit/index.js.map +1 -1
- package/dist/views/Edit/meta.js +43 -35
- package/dist/views/Edit/meta.js.map +1 -1
- package/dist/views/Edit/sanitizeEditViewProps.js +8 -9
- package/dist/views/Edit/sanitizeEditViewProps.js.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +151 -94
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
- package/dist/views/ForgotPassword/index.js +59 -46
- package/dist/views/ForgotPassword/index.js.map +1 -1
- package/dist/views/ForgotPassword/meta.js +12 -8
- package/dist/views/ForgotPassword/meta.js.map +1 -1
- package/dist/views/List/Default/index.js +348 -208
- package/dist/views/List/Default/index.js.map +1 -1
- package/dist/views/List/Default/types.js +1 -2
- package/dist/views/List/Default/types.js.map +1 -1
- package/dist/views/List/index.js +153 -137
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/List/meta.js +20 -17
- package/dist/views/List/meta.js.map +1 -1
- package/dist/views/LivePreview/Context/collisionDetection.js +24 -21
- package/dist/views/LivePreview/Context/collisionDetection.js.map +1 -1
- package/dist/views/LivePreview/Context/context.d.ts +2 -1
- package/dist/views/LivePreview/Context/context.d.ts.map +1 -1
- package/dist/views/LivePreview/Context/context.js +39 -36
- package/dist/views/LivePreview/Context/context.js.map +1 -1
- package/dist/views/LivePreview/Context/index.js +134 -142
- package/dist/views/LivePreview/Context/index.js.map +1 -1
- package/dist/views/LivePreview/Context/sizeReducer.js +18 -19
- package/dist/views/LivePreview/Context/sizeReducer.js.map +1 -1
- package/dist/views/LivePreview/Device/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Device/index.js +78 -71
- package/dist/views/LivePreview/Device/index.js.map +1 -1
- package/dist/views/LivePreview/DeviceContainer/index.js +47 -23
- package/dist/views/LivePreview/DeviceContainer/index.js.map +1 -1
- package/dist/views/LivePreview/IFrame/index.js +21 -16
- package/dist/views/LivePreview/IFrame/index.js.map +1 -1
- package/dist/views/LivePreview/Preview/index.js +145 -92
- package/dist/views/LivePreview/Preview/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.js +136 -115
- package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js +89 -51
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/index.js +82 -50
- package/dist/views/LivePreview/Toolbar/index.js.map +1 -1
- package/dist/views/LivePreview/ToolbarArea/index.js +32 -10
- package/dist/views/LivePreview/ToolbarArea/index.js.map +1 -1
- package/dist/views/LivePreview/index.client.js +316 -160
- package/dist/views/LivePreview/index.client.js.map +1 -1
- package/dist/views/LivePreview/index.js +67 -55
- package/dist/views/LivePreview/index.js.map +1 -1
- package/dist/views/LivePreview/meta.js +14 -9
- package/dist/views/LivePreview/meta.js.map +1 -1
- package/dist/views/LivePreview/usePopupWindow.js +91 -94
- package/dist/views/LivePreview/usePopupWindow.js.map +1 -1
- package/dist/views/Login/LoginField/index.js +83 -39
- package/dist/views/Login/LoginField/index.js.map +1 -1
- package/dist/views/Login/LoginForm/index.js +130 -66
- package/dist/views/Login/LoginForm/index.js.map +1 -1
- package/dist/views/Login/index.js +77 -54
- package/dist/views/Login/index.js.map +1 -1
- package/dist/views/Login/meta.js +12 -8
- package/dist/views/Login/meta.js.map +1 -1
- package/dist/views/Logout/LogoutClient.js +84 -39
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/Logout/index.js +29 -16
- package/dist/views/Logout/index.js.map +1 -1
- package/dist/views/Logout/meta.js +11 -7
- package/dist/views/Logout/meta.js.map +1 -1
- package/dist/views/NotFound/index.client.js +78 -40
- package/dist/views/NotFound/index.client.js.map +1 -1
- package/dist/views/NotFound/index.js +47 -37
- package/dist/views/NotFound/index.js.map +1 -1
- package/dist/views/NotFound/meta.js +9 -7
- package/dist/views/NotFound/meta.js.map +1 -1
- package/dist/views/ResetPassword/index.client.js +97 -59
- package/dist/views/ResetPassword/index.client.js.map +1 -1
- package/dist/views/ResetPassword/index.js +68 -53
- package/dist/views/ResetPassword/index.js.map +1 -1
- package/dist/views/ResetPassword/meta.js +12 -8
- package/dist/views/ResetPassword/meta.js.map +1 -1
- package/dist/views/Root/generateCustomViewMetadata.js +21 -19
- package/dist/views/Root/generateCustomViewMetadata.js.map +1 -1
- package/dist/views/Root/getCustomViewByRoute.js +42 -31
- package/dist/views/Root/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Root/getViewFromConfig.js +162 -156
- package/dist/views/Root/getViewFromConfig.js.map +1 -1
- package/dist/views/Root/index.js +99 -82
- package/dist/views/Root/index.js.map +1 -1
- package/dist/views/Root/isPathMatchingRoute.js +18 -13
- package/dist/views/Root/isPathMatchingRoute.js.map +1 -1
- package/dist/views/Root/meta.js +141 -136
- package/dist/views/Root/meta.js.map +1 -1
- package/dist/views/Unauthorized/index.js +32 -22
- package/dist/views/Unauthorized/index.js.map +1 -1
- package/dist/views/Unauthorized/meta.js +12 -8
- package/dist/views/Unauthorized/meta.js.map +1 -1
- package/dist/views/Verify/index.js +58 -43
- package/dist/views/Verify/index.js.map +1 -1
- package/dist/views/Verify/meta.js +12 -8
- package/dist/views/Verify/meta.js.map +1 -1
- package/dist/views/Version/Default/SetStepNav.d.ts.map +1 -1
- package/dist/views/Version/Default/SetStepNav.js +147 -103
- package/dist/views/Version/Default/SetStepNav.js.map +1 -1
- package/dist/views/Version/Default/index.js +198 -114
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/Default/types.js +1 -2
- package/dist/views/Version/Default/types.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/Label/index.js +6 -5
- package/dist/views/Version/RenderFieldsToDiff/Label/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +65 -69
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +34 -31
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +108 -78
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js +17 -11
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +40 -38
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +42 -32
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js +17 -11
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +34 -31
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js +4 -5
- package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js +20 -21
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/styles.js +23 -24
- package/dist/views/Version/RenderFieldsToDiff/fields/styles.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js +1 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.js +102 -97
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/types.js +1 -2
- package/dist/views/Version/RenderFieldsToDiff/types.js.map +1 -1
- package/dist/views/Version/Restore/index.js +107 -110
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/Restore/types.js +1 -2
- package/dist/views/Version/Restore/types.js.map +1 -1
- package/dist/views/Version/SelectComparison/index.js +130 -138
- package/dist/views/Version/SelectComparison/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/types.js +1 -2
- package/dist/views/Version/SelectComparison/types.js.map +1 -1
- package/dist/views/Version/SelectLocales/index.js +58 -30
- package/dist/views/Version/SelectLocales/index.js.map +1 -1
- package/dist/views/Version/SelectLocales/types.js +1 -2
- package/dist/views/Version/SelectLocales/types.js.map +1 -1
- package/dist/views/Version/index.js +126 -105
- package/dist/views/Version/index.js.map +1 -1
- package/dist/views/Version/meta.js +49 -43
- package/dist/views/Version/meta.js.map +1 -1
- package/dist/views/Versions/buildColumns.js +87 -82
- package/dist/views/Versions/buildColumns.js.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.js +69 -42
- package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.js +70 -17
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
- package/dist/views/Versions/cells/ID/index.js +17 -5
- package/dist/views/Versions/cells/ID/index.js.map +1 -1
- package/dist/views/Versions/getLatestVersion.js +33 -29
- package/dist/views/Versions/getLatestVersion.js.map +1 -1
- package/dist/views/Versions/index.client.js +80 -77
- package/dist/views/Versions/index.client.js.map +1 -1
- package/dist/views/Versions/index.js +148 -127
- package/dist/views/Versions/index.js.map +1 -1
- package/dist/views/Versions/meta.js +43 -37
- package/dist/views/Versions/meta.js.map +1 -1
- package/dist/views/Versions/types.js +1 -2
- package/dist/views/Versions/types.js.map +1 -1
- package/dist/withPayload.js +83 -117
- package/dist/withPayload.js.map +1 -1
- package/package.json +20 -10
- package/dist/cjs/withPayload.cjs +0 -145
- package/dist/cjs/withPayload.cjs.map +0 -1
|
@@ -1,68 +1,106 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
5
|
import { ConfirmPasswordField, Form, FormSubmit, PasswordField, RenderFields, useConfig, useTranslation } from '@payloadcms/ui';
|
|
4
6
|
import { getFormState } from '@payloadcms/ui/shared';
|
|
5
7
|
import React from 'react';
|
|
6
8
|
import { RenderEmailAndUsernameFields } from '../../elements/EmailAndUsername/index.js';
|
|
7
|
-
export const CreateFirstUserClient =
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
export const CreateFirstUserClient = t0 => {
|
|
10
|
+
const $ = _c(13);
|
|
11
|
+
const {
|
|
12
|
+
initialState,
|
|
13
|
+
loginWithUsername,
|
|
14
|
+
userSlug
|
|
15
|
+
} = t0;
|
|
16
|
+
const {
|
|
17
|
+
config: t1,
|
|
18
|
+
getEntityConfig
|
|
19
|
+
} = useConfig();
|
|
20
|
+
const {
|
|
21
|
+
routes: t2,
|
|
22
|
+
serverURL
|
|
23
|
+
} = t1;
|
|
24
|
+
const {
|
|
25
|
+
admin,
|
|
26
|
+
api: apiRoute
|
|
27
|
+
} = t2;
|
|
28
|
+
const {
|
|
29
|
+
t
|
|
30
|
+
} = useTranslation();
|
|
31
|
+
let t3;
|
|
32
|
+
if ($[0] !== userSlug || $[1] !== getEntityConfig || $[2] !== apiRoute || $[3] !== serverURL || $[4] !== loginWithUsername || $[5] !== t || $[6] !== initialState || $[7] !== admin) {
|
|
10
33
|
const collectionConfig = getEntityConfig({
|
|
11
|
-
|
|
34
|
+
collectionSlug: userSlug
|
|
12
35
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
36
|
+
let t4;
|
|
37
|
+
if ($[9] !== apiRoute || $[10] !== userSlug || $[11] !== serverURL) {
|
|
38
|
+
t4 = async t5 => {
|
|
39
|
+
const {
|
|
40
|
+
formState: prevFormState
|
|
41
|
+
} = t5;
|
|
42
|
+
return getFormState({
|
|
43
|
+
apiRoute,
|
|
44
|
+
body: {
|
|
45
|
+
collectionSlug: userSlug,
|
|
46
|
+
formState: prevFormState,
|
|
47
|
+
operation: "create",
|
|
48
|
+
schemaPath: `_${userSlug}.auth`
|
|
49
|
+
},
|
|
50
|
+
serverURL
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
$[9] = apiRoute;
|
|
54
|
+
$[10] = userSlug;
|
|
55
|
+
$[11] = serverURL;
|
|
56
|
+
$[12] = t4;
|
|
57
|
+
} else {
|
|
58
|
+
t4 = $[12];
|
|
59
|
+
}
|
|
60
|
+
const onChange = t4;
|
|
61
|
+
t3 = _jsxs(Form, {
|
|
62
|
+
action: `${serverURL}${apiRoute}/${userSlug}/first-register`,
|
|
63
|
+
initialState,
|
|
64
|
+
method: "POST",
|
|
65
|
+
onChange: [onChange],
|
|
66
|
+
redirect: admin,
|
|
67
|
+
validationOperation: "create",
|
|
68
|
+
children: [_jsx(RenderEmailAndUsernameFields, {
|
|
69
|
+
className: "emailAndUsername",
|
|
70
|
+
loginWithUsername,
|
|
71
|
+
operation: "create",
|
|
72
|
+
readOnly: false
|
|
73
|
+
}), _jsx(PasswordField, {
|
|
74
|
+
autoComplete: "off",
|
|
75
|
+
field: {
|
|
76
|
+
name: "password",
|
|
77
|
+
label: t("authentication:newPassword"),
|
|
78
|
+
required: true
|
|
79
|
+
}
|
|
80
|
+
}), _jsx(ConfirmPasswordField, {}), _jsx(RenderFields, {
|
|
81
|
+
fields: collectionConfig.fields,
|
|
82
|
+
forceRender: true,
|
|
83
|
+
operation: "create",
|
|
84
|
+
path: "",
|
|
85
|
+
readOnly: false,
|
|
86
|
+
schemaPath: userSlug
|
|
87
|
+
}), _jsx(FormSubmit, {
|
|
88
|
+
size: "large",
|
|
89
|
+
children: t("general:create")
|
|
90
|
+
})]
|
|
65
91
|
});
|
|
92
|
+
$[0] = userSlug;
|
|
93
|
+
$[1] = getEntityConfig;
|
|
94
|
+
$[2] = apiRoute;
|
|
95
|
+
$[3] = serverURL;
|
|
96
|
+
$[4] = loginWithUsername;
|
|
97
|
+
$[5] = t;
|
|
98
|
+
$[6] = initialState;
|
|
99
|
+
$[7] = admin;
|
|
100
|
+
$[8] = t3;
|
|
101
|
+
} else {
|
|
102
|
+
t3 = $[8];
|
|
103
|
+
}
|
|
104
|
+
return t3;
|
|
66
105
|
};
|
|
67
|
-
|
|
68
106
|
//# sourceMappingURL=index.client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/CreateFirstUser/index.client.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, FormState, LoginWithUsernameOptions } from 'payload'\n\nimport {\n ConfirmPasswordField,\n Form,\n type FormProps,\n FormSubmit,\n PasswordField,\n RenderFields,\n useConfig,\n useTranslation,\n} from '@payloadcms/ui'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport React from 'react'\n\nimport { RenderEmailAndUsernameFields } from '../../elements/EmailAndUsername/index.js'\n\nexport const CreateFirstUserClient: React.FC<{\n initialState: FormState\n loginWithUsername?: LoginWithUsernameOptions | false\n userSlug: string\n}> = ({ initialState, loginWithUsername, userSlug }) => {\n const {\n config: {\n routes: { admin, api: apiRoute },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n\n const { t } = useTranslation()\n\n const collectionConfig = getEntityConfig({ collectionSlug: userSlug }) as ClientCollectionConfig\n\n const onChange: FormProps['onChange'][0] = React.useCallback(\n async ({ formState: prevFormState }) =>\n getFormState({\n apiRoute,\n body: {\n collectionSlug: userSlug,\n formState: prevFormState,\n operation: 'create',\n schemaPath: `_${userSlug}.auth`,\n },\n serverURL,\n }),\n [apiRoute, userSlug, serverURL],\n )\n\n return (\n <Form\n action={`${serverURL}${apiRoute}/${userSlug}/first-register`}\n initialState={initialState}\n method=\"POST\"\n onChange={[onChange]}\n redirect={admin}\n validationOperation=\"create\"\n >\n <RenderEmailAndUsernameFields\n className=\"emailAndUsername\"\n loginWithUsername={loginWithUsername}\n operation=\"create\"\n readOnly={false}\n />\n <PasswordField\n autoComplete={'off'}\n field={{\n name: 'password',\n label: t('authentication:newPassword'),\n required: true,\n }}\n />\n <ConfirmPasswordField />\n <RenderFields\n fields={collectionConfig.fields}\n forceRender\n operation=\"create\"\n path=\"\"\n readOnly={false}\n schemaPath={userSlug}\n />\n <FormSubmit size=\"large\">{t('general:create')}</FormSubmit>\n </Form>\n )\n}\n"],"
|
|
1
|
+
{"version":3,"file":"index.client.js","names":["c","_c","ConfirmPasswordField","Form","FormSubmit","PasswordField","RenderFields","useConfig","useTranslation","getFormState","React","RenderEmailAndUsernameFields","CreateFirstUserClient","t0","$","initialState","loginWithUsername","userSlug","config","t1","getEntityConfig","routes","t2","serverURL","admin","api","apiRoute","t","t3","collectionConfig","collectionSlug","t4","t5","formState","prevFormState","body","operation","schemaPath","onChange","_jsxs","action","method","redirect","validationOperation","children","_jsx","className","readOnly","autoComplete","field","name","label","required","fields","forceRender","path","size"],"sources":["../../../src/views/CreateFirstUser/index.client.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, FormState, LoginWithUsernameOptions } from 'payload'\n\nimport {\n ConfirmPasswordField,\n Form,\n type FormProps,\n FormSubmit,\n PasswordField,\n RenderFields,\n useConfig,\n useTranslation,\n} from '@payloadcms/ui'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport React from 'react'\n\nimport { RenderEmailAndUsernameFields } from '../../elements/EmailAndUsername/index.js'\n\nexport const CreateFirstUserClient: React.FC<{\n initialState: FormState\n loginWithUsername?: LoginWithUsernameOptions | false\n userSlug: string\n}> = ({ initialState, loginWithUsername, userSlug }) => {\n const {\n config: {\n routes: { admin, api: apiRoute },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n\n const { t } = useTranslation()\n\n const collectionConfig = getEntityConfig({ collectionSlug: userSlug }) as ClientCollectionConfig\n\n const onChange: FormProps['onChange'][0] = React.useCallback(\n async ({ formState: prevFormState }) =>\n getFormState({\n apiRoute,\n body: {\n collectionSlug: userSlug,\n formState: prevFormState,\n operation: 'create',\n schemaPath: `_${userSlug}.auth`,\n },\n serverURL,\n }),\n [apiRoute, userSlug, serverURL],\n )\n\n return (\n <Form\n action={`${serverURL}${apiRoute}/${userSlug}/first-register`}\n initialState={initialState}\n method=\"POST\"\n onChange={[onChange]}\n redirect={admin}\n validationOperation=\"create\"\n >\n <RenderEmailAndUsernameFields\n className=\"emailAndUsername\"\n loginWithUsername={loginWithUsername}\n operation=\"create\"\n readOnly={false}\n />\n <PasswordField\n autoComplete={'off'}\n field={{\n name: 'password',\n label: t('authentication:newPassword'),\n required: true,\n }}\n />\n <ConfirmPasswordField />\n <RenderFields\n fields={collectionConfig.fields}\n forceRender\n operation=\"create\"\n path=\"\"\n readOnly={false}\n schemaPath={userSlug}\n />\n <FormSubmit size=\"large\">{t('general:create')}</FormSubmit>\n </Form>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SACEC,oBAAoB,EACpBC,IAAI,EAEJC,UAAU,EACVC,aAAa,EACbC,YAAY,EACZC,SAAS,EACTC,cAAc,QACT;AACP,SAASC,YAAY,QAAQ;AAC7B,OAAOC,KAAA,MAAW;AAElB,SAASC,4BAA4B,QAAQ;AAE7C,OAAO,MAAMC,qBAAA,GAIRC,EAAA;EAAA,MAAAC,CAAA,GAAAb,EAAA;EAAC;IAAAc,YAAA;IAAAC,iBAAA;IAAAC;EAAA,IAAAJ,EAA6C;EACjD;IAAAK,MAAA,EAAAC,EAAA;IAAAC;EAAA,IAMIb,SAAA;EALM;IAAAc,MAAA,EAAAC,EAAA;IAAAC;EAAA,IAAAJ,EAGP;EAFS;IAAAK,KAAA;IAAAC,GAAA,EAAAC;EAAA,IAAAJ,EAAwB;EAMpC;IAAAK;EAAA,IAAcnB,cAAA;EAAA,IAAAoB,EAAA;EAAA,IAAAd,CAAA,QAAAG,QAAA,IAAAH,CAAA,QAAAM,eAAA,IAAAN,CAAA,QAAAY,QAAA,IAAAZ,CAAA,QAAAS,SAAA,IAAAT,CAAA,QAAAE,iBAAA,IAAAF,CAAA,QAAAa,CAAA,IAAAb,CAAA,QAAAC,YAAA,IAAAD,CAAA,QAAAU,KAAA;IAEd,MAAAK,gBAAA,GAAyBT,eAAA;MAAAU,cAAA,EAAkCb;IAAA,CAAS;IAAA,IAAAc,EAAA;IAAA,IAAAjB,CAAA,QAAAY,QAAA,IAAAZ,CAAA,SAAAG,QAAA,IAAAH,CAAA,SAAAS,SAAA;MAGlEQ,EAAA,SAAAC,EAAA;QAAO;UAAAC,SAAA,EAAAC;QAAA,IAAAF,EAA4B;QAAA,OACjCvB,YAAA;UAAAiB,QAAA;UAAAS,IAAA;YAAAL,cAAA,EAGoBb,QAAA;YAAAgB,SAAA,EACLC,aAAA;YAAAE,SAAA,EACA;YAAAC,UAAA,EACC,IAAIpB,QAAA;UAAe;UAAAM;QAAA,CAGnC;MAAA;MAAAT,CAAA,MAAAY,QAAA;MAAAZ,CAAA,OAAAG,QAAA;MAAAH,CAAA,OAAAS,SAAA;MAAAT,CAAA,OAAAiB,EAAA;IAAA;MAAAA,EAAA,GAAAjB,CAAA;IAAA;IAXJ,MAAAwB,QAAA,GAA2CP,EAYV;IAI/BH,EAAA,GAAAW,KAAA,CAAApC,IAAA;MAAAqC,MAAA,EACU,GAAGjB,SAAA,GAAYG,QAAA,IAAYT,QAAA,iBAAyB;MAAAF,YAAA;MAAA0B,MAAA,EAErD;MAAAH,QAAA,GACIA,QAAA;MAAAI,QAAA,EACDlB,KAAA;MAAAmB,mBAAA,EACU;MAAAC,QAAA,GAEpBC,IAAA,CAAAlC,4BAAA;QAAAmC,SAAA,EACY;QAAA9B,iBAAA;QAAAoB,SAAA,EAEA;QAAAW,QAAA;MAAA,C,GAGZF,IAAA,CAAAxC,aAAA;QAAA2C,YAAA,EACgB;QAAAC,KAAA;UAAAC,IAAA,EAEN;UAAAC,KAAA,EACCxB,CAAA,CAAE;UAAAyB,QAAA;QAAA;MAAA,C,GAIbP,IAAA,CAAA3C,oBAAA,IAAC,GACD2C,IAAA,CAAAvC,YAAA;QAAA+C,MAAA,EACUxB,gBAAA,CAAAwB,MAAA;QAAAC,WAAA;QAAAlB,SAAA,EAEE;QAAAmB,IAAA,EACL;QAAAR,QAAA;QAAAV,UAAA,EAEOpB;MAAA,C,GAEd4B,IAAA,CAAAzC,UAAA;QAAAoD,IAAA,EAAiB;QAAAZ,QAAA,EAASjB,CAAA,CAAE;MAAA,C;;;;;;;;;;;;;;SA/B9BC,E;CAkCJ","ignoreList":[]}
|
|
@@ -3,33 +3,47 @@ import React from 'react';
|
|
|
3
3
|
import { getDocumentData } from '../Document/getDocumentData.js';
|
|
4
4
|
import { CreateFirstUserClient } from './index.client.js';
|
|
5
5
|
export { generateCreateFirstUserMetadata } from './meta.js';
|
|
6
|
-
export const CreateFirstUserView = async ({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
6
|
+
export const CreateFirstUserView = async ({
|
|
7
|
+
initPageResult
|
|
8
|
+
}) => {
|
|
9
|
+
const {
|
|
10
|
+
locale,
|
|
11
|
+
req,
|
|
12
|
+
req: {
|
|
13
|
+
payload: {
|
|
14
|
+
config: {
|
|
15
|
+
admin: {
|
|
16
|
+
user: userSlug
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
config
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
} = initPageResult;
|
|
23
|
+
const collectionConfig = config.collections?.find(collection => collection?.slug === userSlug);
|
|
24
|
+
const {
|
|
25
|
+
auth: authOptions
|
|
26
|
+
} = collectionConfig;
|
|
27
|
+
const loginWithUsername = authOptions.loginWithUsername;
|
|
28
|
+
const {
|
|
29
|
+
formState
|
|
30
|
+
} = await getDocumentData({
|
|
31
|
+
collectionConfig,
|
|
32
|
+
locale,
|
|
33
|
+
req,
|
|
34
|
+
schemaPath: `_${collectionConfig.slug}.auth`
|
|
35
|
+
});
|
|
36
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
37
|
+
className: "create-first-user",
|
|
38
|
+
children: [/*#__PURE__*/_jsx("h1", {
|
|
39
|
+
children: req.t('general:welcome')
|
|
40
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
41
|
+
children: req.t('authentication:beginCreateFirstUser')
|
|
42
|
+
}), /*#__PURE__*/_jsx(CreateFirstUserClient, {
|
|
43
|
+
initialState: formState,
|
|
44
|
+
loginWithUsername: loginWithUsername,
|
|
45
|
+
userSlug: userSlug
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
33
48
|
};
|
|
34
|
-
|
|
35
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/CreateFirstUser/index.tsx"],"sourcesContent":["import type { AdminViewProps } from 'payload'\n\nimport React from 'react'\n\nimport type { LoginFieldProps } from '../Login/LoginField/index.js'\n\nimport { getDocumentData } from '../Document/getDocumentData.js'\nimport { CreateFirstUserClient } from './index.client.js'\nimport './index.scss'\n\nexport { generateCreateFirstUserMetadata } from './meta.js'\n\nexport const CreateFirstUserView: React.FC<AdminViewProps> = async ({ initPageResult }) => {\n const {\n locale,\n req,\n req: {\n payload: {\n config: {\n admin: { user: userSlug },\n },\n config,\n },\n },\n } = initPageResult\n\n const collectionConfig = config.collections?.find((collection) => collection?.slug === userSlug)\n const { auth: authOptions } = collectionConfig\n const loginWithUsername = authOptions.loginWithUsername\n\n const { formState } = await getDocumentData({\n collectionConfig,\n locale,\n req,\n schemaPath: `_${collectionConfig.slug}.auth`,\n })\n\n return (\n <div className=\"create-first-user\">\n <h1>{req.t('general:welcome')}</h1>\n <p>{req.t('authentication:beginCreateFirstUser')}</p>\n <CreateFirstUserClient\n initialState={formState}\n loginWithUsername={loginWithUsername}\n userSlug={userSlug}\n />\n </div>\n )\n}\n"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","getDocumentData","CreateFirstUserClient","generateCreateFirstUserMetadata","CreateFirstUserView","initPageResult","locale","req","payload","config","admin","user","userSlug","collectionConfig","collections","find","collection","slug","auth","authOptions","loginWithUsername","formState","schemaPath","_jsxs","className","_jsx","t","initialState"],"sources":["../../../src/views/CreateFirstUser/index.tsx"],"sourcesContent":["import type { AdminViewProps } from 'payload'\n\nimport React from 'react'\n\nimport type { LoginFieldProps } from '../Login/LoginField/index.js'\n\nimport { getDocumentData } from '../Document/getDocumentData.js'\nimport { CreateFirstUserClient } from './index.client.js'\nimport './index.scss'\n\nexport { generateCreateFirstUserMetadata } from './meta.js'\n\nexport const CreateFirstUserView: React.FC<AdminViewProps> = async ({ initPageResult }) => {\n const {\n locale,\n req,\n req: {\n payload: {\n config: {\n admin: { user: userSlug },\n },\n config,\n },\n },\n } = initPageResult\n\n const collectionConfig = config.collections?.find((collection) => collection?.slug === userSlug)\n const { auth: authOptions } = collectionConfig\n const loginWithUsername = authOptions.loginWithUsername\n\n const { formState } = await getDocumentData({\n collectionConfig,\n locale,\n req,\n schemaPath: `_${collectionConfig.slug}.auth`,\n })\n\n return (\n <div className=\"create-first-user\">\n <h1>{req.t('general:welcome')}</h1>\n <p>{req.t('authentication:beginCreateFirstUser')}</p>\n <CreateFirstUserClient\n initialState={formState}\n loginWithUsername={loginWithUsername}\n userSlug={userSlug}\n />\n </div>\n )\n}\n"],"mappings":";AAEA,OAAOA,KAAA,MAAW;AAIlB,SAASC,eAAe,QAAQ;AAChC,SAASC,qBAAqB,QAAQ;AAGtC,SAASC,+BAA+B,QAAQ;AAEhD,OAAO,MAAMC,mBAAA,GAAgD,MAAAA,CAAO;EAAEC;AAAc,CAAE;EACpF,MAAM;IACJC,MAAM;IACNC,GAAG;IACHA,GAAA,EAAK;MACHC,OAAA,EAAS;QACPC,MAAA,EAAQ;UACNC,KAAA,EAAO;YAAEC,IAAA,EAAMC;UAAQ;QAAE,CAC1B;QACDH;MAAM;IACP;EACF,CACF,GAAGJ,cAAA;EAEJ,MAAMQ,gBAAA,GAAmBJ,MAAA,CAAOK,WAAW,EAAEC,IAAA,CAAMC,UAAA,IAAeA,UAAA,EAAYC,IAAA,KAASL,QAAA;EACvF,MAAM;IAAEM,IAAA,EAAMC;EAAW,CAAE,GAAGN,gBAAA;EAC9B,MAAMO,iBAAA,GAAoBD,WAAA,CAAYC,iBAAiB;EAEvD,MAAM;IAAEC;EAAS,CAAE,GAAG,MAAMpB,eAAA,CAAgB;IAC1CY,gBAAA;IACAP,MAAA;IACAC,GAAA;IACAe,UAAA,EAAY,IAAIT,gBAAA,CAAiBI,IAAI;EACvC;EAEA,oBACEM,KAAA,CAAC;IAAIC,SAAA,EAAU;4BACbC,IAAA,CAAC;gBAAIlB,GAAA,CAAImB,CAAC,CAAC;qBACXD,IAAA,CAAC;gBAAGlB,GAAA,CAAImB,CAAC,CAAC;qBACVD,IAAA,CAACvB,qBAAA;MACCyB,YAAA,EAAcN,SAAA;MACdD,iBAAA,EAAmBA,iBAAA;MACnBR,QAAA,EAAUA;;;AAIlB","ignoreList":[]}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { meta } from '../../utilities/meta.js';
|
|
2
|
-
export const generateCreateFirstUserMetadata = async ({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
export const generateCreateFirstUserMetadata = async ({
|
|
3
|
+
config,
|
|
4
|
+
i18n: {
|
|
5
|
+
t
|
|
6
|
+
}
|
|
7
|
+
}) => meta({
|
|
8
|
+
description: t('authentication:createFirstUser'),
|
|
9
|
+
keywords: t('general:create'),
|
|
10
|
+
serverURL: config.serverURL,
|
|
11
|
+
title: t('authentication:createFirstUser'),
|
|
12
|
+
...(config.admin.meta || {})
|
|
13
|
+
});
|
|
10
14
|
//# sourceMappingURL=meta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/CreateFirstUser/meta.ts"],"sourcesContent":["import type { GenerateViewMetadata } from '../Root/index.js'\n\nimport { meta } from '../../utilities/meta.js'\n\nexport const generateCreateFirstUserMetadata: GenerateViewMetadata = async ({\n config,\n i18n: { t },\n}) =>\n meta({\n description: t('authentication:createFirstUser'),\n keywords: t('general:create'),\n serverURL: config.serverURL,\n title: t('authentication:createFirstUser'),\n ...(config.admin.meta || {}),\n })\n"],"
|
|
1
|
+
{"version":3,"file":"meta.js","names":["meta","generateCreateFirstUserMetadata","config","i18n","t","description","keywords","serverURL","title","admin"],"sources":["../../../src/views/CreateFirstUser/meta.ts"],"sourcesContent":["import type { GenerateViewMetadata } from '../Root/index.js'\n\nimport { meta } from '../../utilities/meta.js'\n\nexport const generateCreateFirstUserMetadata: GenerateViewMetadata = async ({\n config,\n i18n: { t },\n}) =>\n meta({\n description: t('authentication:createFirstUser'),\n keywords: t('general:create'),\n serverURL: config.serverURL,\n title: t('authentication:createFirstUser'),\n ...(config.admin.meta || {}),\n })\n"],"mappings":"AAEA,SAASA,IAAI,QAAQ;AAErB,OAAO,MAAMC,+BAAA,GAAwD,MAAAA,CAAO;EAC1EC,MAAM;EACNC,IAAA,EAAM;IAAEC;EAAC;AAAE,CACZ,KACCJ,IAAA,CAAK;EACHK,WAAA,EAAaD,CAAA,CAAE;EACfE,QAAA,EAAUF,CAAA,CAAE;EACZG,SAAA,EAAWL,MAAA,CAAOK,SAAS;EAC3BC,KAAA,EAAOJ,CAAA,CAAE;EACT,IAAIF,MAAA,CAAOO,KAAK,CAACT,IAAI,IAAI,CAAC,CAAC;AAC7B","ignoreList":[]}
|
|
@@ -4,121 +4,138 @@ import { Button, Card, Gutter, SetStepNav, SetViewActions } from '@payloadcms/ui
|
|
|
4
4
|
import { EntityType, RenderComponent, formatAdminURL, getCreateMappedComponent } from '@payloadcms/ui/shared';
|
|
5
5
|
import React, { Fragment } from 'react';
|
|
6
6
|
const baseClass = 'dashboard';
|
|
7
|
-
export const DefaultDashboard =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
export const DefaultDashboard = props => {
|
|
8
|
+
const {
|
|
9
|
+
Link,
|
|
10
|
+
i18n,
|
|
11
|
+
i18n: {
|
|
12
|
+
t
|
|
13
|
+
},
|
|
14
|
+
locale,
|
|
15
|
+
navGroups,
|
|
16
|
+
params,
|
|
17
|
+
payload: {
|
|
18
|
+
config: {
|
|
19
|
+
admin: {
|
|
20
|
+
components: {
|
|
21
|
+
afterDashboard,
|
|
22
|
+
beforeDashboard
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
routes: {
|
|
26
|
+
admin: adminRoute
|
|
19
27
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
payload,
|
|
31
|
+
permissions,
|
|
32
|
+
searchParams,
|
|
33
|
+
user
|
|
34
|
+
} = props;
|
|
35
|
+
const createMappedComponent = getCreateMappedComponent({
|
|
36
|
+
importMap: payload.importMap,
|
|
37
|
+
serverProps: {
|
|
38
|
+
i18n,
|
|
39
|
+
locale,
|
|
40
|
+
params,
|
|
41
|
+
payload,
|
|
42
|
+
permissions,
|
|
43
|
+
searchParams,
|
|
44
|
+
user
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const mappedBeforeDashboards = createMappedComponent(beforeDashboard, undefined, undefined, 'beforeDashboard');
|
|
48
|
+
const mappedAfterDashboards = createMappedComponent(afterDashboard, undefined, undefined, 'afterDashboard');
|
|
49
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
50
|
+
className: baseClass,
|
|
51
|
+
children: [/*#__PURE__*/_jsx(SetStepNav, {
|
|
52
|
+
nav: []
|
|
53
|
+
}), /*#__PURE__*/_jsx(SetViewActions, {
|
|
54
|
+
actions: []
|
|
55
|
+
}), /*#__PURE__*/_jsxs(Gutter, {
|
|
56
|
+
className: `${baseClass}__wrap`,
|
|
57
|
+
children: [/*#__PURE__*/_jsx(RenderComponent, {
|
|
58
|
+
mappedComponent: mappedBeforeDashboards
|
|
59
|
+
}), /*#__PURE__*/_jsxs(Fragment, {
|
|
60
|
+
children: [/*#__PURE__*/_jsx(SetViewActions, {
|
|
61
|
+
actions: []
|
|
62
|
+
}), !navGroups || navGroups?.length === 0 ? /*#__PURE__*/_jsx("p", {
|
|
63
|
+
children: "no nav groups...."
|
|
64
|
+
}) : navGroups.map(({
|
|
65
|
+
entities,
|
|
66
|
+
label
|
|
67
|
+
}, groupIndex) => {
|
|
68
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
69
|
+
className: `${baseClass}__group`,
|
|
70
|
+
children: [/*#__PURE__*/_jsx("h2", {
|
|
71
|
+
className: `${baseClass}__label`,
|
|
72
|
+
children: label
|
|
73
|
+
}), /*#__PURE__*/_jsx("ul", {
|
|
74
|
+
className: `${baseClass}__card-list`,
|
|
75
|
+
children: entities.map(({
|
|
76
|
+
type,
|
|
77
|
+
entity
|
|
78
|
+
}, entityIndex) => {
|
|
79
|
+
let title;
|
|
80
|
+
let buttonAriaLabel;
|
|
81
|
+
let createHREF;
|
|
82
|
+
let href;
|
|
83
|
+
let hasCreatePermission;
|
|
84
|
+
if (type === EntityType.collection) {
|
|
85
|
+
title = getTranslation(entity.labels.plural, i18n);
|
|
86
|
+
buttonAriaLabel = t('general:showAllLabel', {
|
|
87
|
+
label: title
|
|
88
|
+
});
|
|
89
|
+
href = formatAdminURL({
|
|
90
|
+
adminRoute,
|
|
91
|
+
path: `/collections/${entity.slug}`
|
|
92
|
+
});
|
|
93
|
+
createHREF = formatAdminURL({
|
|
94
|
+
adminRoute,
|
|
95
|
+
path: `/collections/${entity.slug}/create`
|
|
96
|
+
});
|
|
97
|
+
hasCreatePermission = permissions?.collections?.[entity.slug]?.create?.permission;
|
|
98
|
+
}
|
|
99
|
+
if (type === EntityType.global) {
|
|
100
|
+
title = getTranslation(entity.label, i18n);
|
|
101
|
+
buttonAriaLabel = t('general:editLabel', {
|
|
102
|
+
label: getTranslation(entity.label, i18n)
|
|
103
|
+
});
|
|
104
|
+
href = formatAdminURL({
|
|
105
|
+
adminRoute,
|
|
106
|
+
path: `/globals/${entity.slug}`
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return /*#__PURE__*/_jsx("li", {
|
|
110
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
111
|
+
Link: Link,
|
|
112
|
+
actions: hasCreatePermission && type === EntityType.collection ? /*#__PURE__*/_jsx(Button, {
|
|
113
|
+
Link: Link,
|
|
114
|
+
"aria-label": t('general:createNewLabel', {
|
|
115
|
+
label: getTranslation(entity.labels.singular, i18n)
|
|
116
|
+
}),
|
|
117
|
+
buttonStyle: "icon-label",
|
|
118
|
+
el: "link",
|
|
119
|
+
icon: "plus",
|
|
120
|
+
iconStyle: "with-border",
|
|
121
|
+
round: true,
|
|
122
|
+
to: createHREF
|
|
123
|
+
}) : undefined,
|
|
124
|
+
buttonAriaLabel: buttonAriaLabel,
|
|
125
|
+
href: href,
|
|
126
|
+
id: `card-${entity.slug}`,
|
|
127
|
+
title: title,
|
|
128
|
+
titleAs: "h3"
|
|
129
|
+
})
|
|
130
|
+
}, entityIndex);
|
|
131
|
+
})
|
|
132
|
+
})]
|
|
133
|
+
}, groupIndex);
|
|
134
|
+
})]
|
|
135
|
+
}), /*#__PURE__*/_jsx(RenderComponent, {
|
|
136
|
+
mappedComponent: mappedAfterDashboards
|
|
137
|
+
})]
|
|
138
|
+
})]
|
|
139
|
+
});
|
|
122
140
|
};
|
|
123
|
-
|
|
124
141
|
//# sourceMappingURL=index.js.map
|