@payloadcms/next 3.0.0-beta.90 → 3.0.0-beta.91
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.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
|
@@ -2,106 +2,113 @@ import httpStatus from 'http-status';
|
|
|
2
2
|
import { APIError, APIErrorName, ValidationErrorName } from 'payload';
|
|
3
3
|
import { getPayloadHMR } from '../../utilities/getPayloadHMR.js';
|
|
4
4
|
import { headersWithCors } from '../../utilities/headersWithCors.js';
|
|
5
|
-
const formatErrors =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
]
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
// Mongoose 'ValidationError': https://mongoosejs.com/docs/api/error.html#Error.ValidationError
|
|
23
|
-
if (proto.constructor.name === ValidationErrorName && 'errors' in incoming && incoming.errors) {
|
|
24
|
-
return {
|
|
25
|
-
errors: Object.keys(incoming.errors).reduce((acc, key)=>{
|
|
26
|
-
acc.push({
|
|
27
|
-
field: incoming.errors[key].path,
|
|
28
|
-
message: incoming.errors[key].message
|
|
29
|
-
});
|
|
30
|
-
return acc;
|
|
31
|
-
}, [])
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
if (Array.isArray(incoming.message)) {
|
|
35
|
-
return {
|
|
36
|
-
errors: incoming.message
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
if (incoming.name) {
|
|
40
|
-
return {
|
|
41
|
-
errors: [
|
|
42
|
-
{
|
|
43
|
-
message: incoming.message
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
};
|
|
47
|
-
}
|
|
5
|
+
const formatErrors = incoming => {
|
|
6
|
+
if (incoming) {
|
|
7
|
+
// Cannot use `instanceof` to check error type: https://github.com/microsoft/TypeScript/issues/13965
|
|
8
|
+
// Instead, get the prototype of the incoming error and check its constructor name
|
|
9
|
+
const proto = Object.getPrototypeOf(incoming);
|
|
10
|
+
// Payload 'ValidationError' and 'APIError'
|
|
11
|
+
if ((proto.constructor.name === ValidationErrorName || proto.constructor.name === APIErrorName) && incoming.data) {
|
|
12
|
+
return {
|
|
13
|
+
errors: [{
|
|
14
|
+
name: incoming.name,
|
|
15
|
+
data: incoming.data,
|
|
16
|
+
message: incoming.message
|
|
17
|
+
}]
|
|
18
|
+
};
|
|
48
19
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
try {
|
|
61
|
-
payload = await getPayloadHMR({
|
|
62
|
-
config: configArg
|
|
63
|
-
});
|
|
64
|
-
} catch (e) {
|
|
65
|
-
return Response.json({
|
|
66
|
-
message: 'There was an error initializing Payload'
|
|
67
|
-
}, {
|
|
68
|
-
status: httpStatus.INTERNAL_SERVER_ERROR
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
req.payload = payload;
|
|
73
|
-
const headers = headersWithCors({
|
|
74
|
-
headers: new Headers(),
|
|
75
|
-
req
|
|
76
|
-
});
|
|
77
|
-
const { config, logger } = payload;
|
|
78
|
-
let response = formatErrors(err);
|
|
79
|
-
let status = err.status || httpStatus.INTERNAL_SERVER_ERROR;
|
|
80
|
-
logger.error(err.stack);
|
|
81
|
-
// Internal server errors can contain anything, including potentially sensitive data.
|
|
82
|
-
// Therefore, error details will be hidden from the response unless `config.debug` is `true`
|
|
83
|
-
if (!config.debug && status === httpStatus.INTERNAL_SERVER_ERROR) {
|
|
84
|
-
response = formatErrors(new APIError('Something went wrong.'));
|
|
20
|
+
// Mongoose 'ValidationError': https://mongoosejs.com/docs/api/error.html#Error.ValidationError
|
|
21
|
+
if (proto.constructor.name === ValidationErrorName && 'errors' in incoming && incoming.errors) {
|
|
22
|
+
return {
|
|
23
|
+
errors: Object.keys(incoming.errors).reduce((acc, key) => {
|
|
24
|
+
acc.push({
|
|
25
|
+
field: incoming.errors[key].path,
|
|
26
|
+
message: incoming.errors[key].message
|
|
27
|
+
});
|
|
28
|
+
return acc;
|
|
29
|
+
}, [])
|
|
30
|
+
};
|
|
85
31
|
}
|
|
86
|
-
if (
|
|
87
|
-
|
|
32
|
+
if (Array.isArray(incoming.message)) {
|
|
33
|
+
return {
|
|
34
|
+
errors: incoming.message
|
|
35
|
+
};
|
|
88
36
|
}
|
|
89
|
-
if (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
37
|
+
if (incoming.name) {
|
|
38
|
+
return {
|
|
39
|
+
errors: [{
|
|
40
|
+
message: incoming.message
|
|
41
|
+
}]
|
|
42
|
+
};
|
|
94
43
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
errors: [{
|
|
47
|
+
message: 'An unknown error occurred.'
|
|
48
|
+
}]
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export const routeError = async ({
|
|
52
|
+
collection,
|
|
53
|
+
config: configArg,
|
|
54
|
+
err,
|
|
55
|
+
req
|
|
56
|
+
}) => {
|
|
57
|
+
let payload = req?.payload;
|
|
58
|
+
if (!payload) {
|
|
59
|
+
try {
|
|
60
|
+
payload = await getPayloadHMR({
|
|
61
|
+
config: configArg
|
|
62
|
+
});
|
|
63
|
+
} catch (e) {
|
|
64
|
+
return Response.json({
|
|
65
|
+
message: 'There was an error initializing Payload'
|
|
66
|
+
}, {
|
|
67
|
+
status: httpStatus.INTERNAL_SERVER_ERROR
|
|
68
|
+
});
|
|
100
69
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
70
|
+
}
|
|
71
|
+
req.payload = payload;
|
|
72
|
+
const headers = headersWithCors({
|
|
73
|
+
headers: new Headers(),
|
|
74
|
+
req
|
|
75
|
+
});
|
|
76
|
+
const {
|
|
77
|
+
config,
|
|
78
|
+
logger
|
|
79
|
+
} = payload;
|
|
80
|
+
let response = formatErrors(err);
|
|
81
|
+
let status = err.status || httpStatus.INTERNAL_SERVER_ERROR;
|
|
82
|
+
logger.error(err.stack);
|
|
83
|
+
// Internal server errors can contain anything, including potentially sensitive data.
|
|
84
|
+
// Therefore, error details will be hidden from the response unless `config.debug` is `true`
|
|
85
|
+
if (!config.debug && status === httpStatus.INTERNAL_SERVER_ERROR) {
|
|
86
|
+
response = formatErrors(new APIError('Something went wrong.'));
|
|
87
|
+
}
|
|
88
|
+
if (config.debug && config.debug === true) {
|
|
89
|
+
response.stack = err.stack;
|
|
90
|
+
}
|
|
91
|
+
if (collection && typeof collection.config.hooks.afterError === 'function') {
|
|
92
|
+
({
|
|
93
|
+
response,
|
|
94
|
+
status
|
|
95
|
+
} = collection.config.hooks.afterError(err, response, req?.context, collection.config) || {
|
|
96
|
+
response,
|
|
97
|
+
status
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (typeof config.hooks.afterError === 'function') {
|
|
101
|
+
({
|
|
102
|
+
response,
|
|
103
|
+
status
|
|
104
|
+
} = config.hooks.afterError(err, response, req?.context, collection?.config) || {
|
|
105
|
+
response,
|
|
106
|
+
status
|
|
104
107
|
});
|
|
108
|
+
}
|
|
109
|
+
return Response.json(response, {
|
|
110
|
+
headers,
|
|
111
|
+
status
|
|
112
|
+
});
|
|
105
113
|
};
|
|
106
|
-
|
|
107
114
|
//# sourceMappingURL=routeError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/routes/rest/routeError.ts"],"sourcesContent":["import type { Collection, PayloadRequest, SanitizedConfig } from 'payload'\n\nimport httpStatus from 'http-status'\nimport { APIError, APIErrorName, ValidationErrorName } from 'payload'\n\nimport { getPayloadHMR } from '../../utilities/getPayloadHMR.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\n\nexport type ErrorResponse = { data?: any; errors: unknown[]; stack?: string }\n\nconst formatErrors = (incoming: { [key: string]: unknown } | APIError): ErrorResponse => {\n if (incoming) {\n // Cannot use `instanceof` to check error type: https://github.com/microsoft/TypeScript/issues/13965\n // Instead, get the prototype of the incoming error and check its constructor name\n const proto = Object.getPrototypeOf(incoming)\n\n // Payload 'ValidationError' and 'APIError'\n if (\n (proto.constructor.name === ValidationErrorName || proto.constructor.name === APIErrorName) &&\n incoming.data\n ) {\n return {\n errors: [\n {\n name: incoming.name,\n data: incoming.data,\n message: incoming.message,\n },\n ],\n }\n }\n\n // Mongoose 'ValidationError': https://mongoosejs.com/docs/api/error.html#Error.ValidationError\n if (proto.constructor.name === ValidationErrorName && 'errors' in incoming && incoming.errors) {\n return {\n errors: Object.keys(incoming.errors).reduce((acc, key) => {\n acc.push({\n field: incoming.errors[key].path,\n message: incoming.errors[key].message,\n })\n return acc\n }, []),\n }\n }\n\n if (Array.isArray(incoming.message)) {\n return {\n errors: incoming.message,\n }\n }\n\n if (incoming.name) {\n return {\n errors: [\n {\n message: incoming.message,\n },\n ],\n }\n }\n }\n\n return {\n errors: [\n {\n message: 'An unknown error occurred.',\n },\n ],\n }\n}\n\nexport const routeError = async ({\n collection,\n config: configArg,\n err,\n req,\n}: {\n collection?: Collection\n config: Promise<SanitizedConfig> | SanitizedConfig\n err: APIError\n req: Partial<PayloadRequest>\n}) => {\n let payload = req?.payload\n\n if (!payload) {\n try {\n payload = await getPayloadHMR({ config: configArg })\n } catch (e) {\n return Response.json(\n {\n message: 'There was an error initializing Payload',\n },\n { status: httpStatus.INTERNAL_SERVER_ERROR },\n )\n }\n }\n\n req.payload = payload\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n const { config, logger } = payload\n\n let response = formatErrors(err)\n\n let status = err.status || httpStatus.INTERNAL_SERVER_ERROR\n\n logger.error(err.stack)\n\n // Internal server errors can contain anything, including potentially sensitive data.\n // Therefore, error details will be hidden from the response unless `config.debug` is `true`\n if (!config.debug && status === httpStatus.INTERNAL_SERVER_ERROR) {\n response = formatErrors(new APIError('Something went wrong.'))\n }\n\n if (config.debug && config.debug === true) {\n response.stack = err.stack\n }\n\n if (collection && typeof collection.config.hooks.afterError === 'function') {\n ;({ response, status } = collection.config.hooks.afterError(\n err,\n response,\n req?.context,\n collection.config,\n ) || { response, status })\n }\n\n if (typeof config.hooks.afterError === 'function') {\n ;({ response, status } = config.hooks.afterError(\n err,\n response,\n req?.context,\n collection?.config,\n ) || {\n response,\n status,\n })\n }\n\n return Response.json(response, { headers, status })\n}\n"],"
|
|
1
|
+
{"version":3,"file":"routeError.js","names":["httpStatus","APIError","APIErrorName","ValidationErrorName","getPayloadHMR","headersWithCors","formatErrors","incoming","proto","Object","getPrototypeOf","constructor","name","data","errors","message","keys","reduce","acc","key","push","field","path","Array","isArray","routeError","collection","config","configArg","err","req","payload","e","Response","json","status","INTERNAL_SERVER_ERROR","headers","Headers","logger","response","error","stack","debug","hooks","afterError","context"],"sources":["../../../src/routes/rest/routeError.ts"],"sourcesContent":["import type { Collection, PayloadRequest, SanitizedConfig } from 'payload'\n\nimport httpStatus from 'http-status'\nimport { APIError, APIErrorName, ValidationErrorName } from 'payload'\n\nimport { getPayloadHMR } from '../../utilities/getPayloadHMR.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\n\nexport type ErrorResponse = { data?: any; errors: unknown[]; stack?: string }\n\nconst formatErrors = (incoming: { [key: string]: unknown } | APIError): ErrorResponse => {\n if (incoming) {\n // Cannot use `instanceof` to check error type: https://github.com/microsoft/TypeScript/issues/13965\n // Instead, get the prototype of the incoming error and check its constructor name\n const proto = Object.getPrototypeOf(incoming)\n\n // Payload 'ValidationError' and 'APIError'\n if (\n (proto.constructor.name === ValidationErrorName || proto.constructor.name === APIErrorName) &&\n incoming.data\n ) {\n return {\n errors: [\n {\n name: incoming.name,\n data: incoming.data,\n message: incoming.message,\n },\n ],\n }\n }\n\n // Mongoose 'ValidationError': https://mongoosejs.com/docs/api/error.html#Error.ValidationError\n if (proto.constructor.name === ValidationErrorName && 'errors' in incoming && incoming.errors) {\n return {\n errors: Object.keys(incoming.errors).reduce((acc, key) => {\n acc.push({\n field: incoming.errors[key].path,\n message: incoming.errors[key].message,\n })\n return acc\n }, []),\n }\n }\n\n if (Array.isArray(incoming.message)) {\n return {\n errors: incoming.message,\n }\n }\n\n if (incoming.name) {\n return {\n errors: [\n {\n message: incoming.message,\n },\n ],\n }\n }\n }\n\n return {\n errors: [\n {\n message: 'An unknown error occurred.',\n },\n ],\n }\n}\n\nexport const routeError = async ({\n collection,\n config: configArg,\n err,\n req,\n}: {\n collection?: Collection\n config: Promise<SanitizedConfig> | SanitizedConfig\n err: APIError\n req: Partial<PayloadRequest>\n}) => {\n let payload = req?.payload\n\n if (!payload) {\n try {\n payload = await getPayloadHMR({ config: configArg })\n } catch (e) {\n return Response.json(\n {\n message: 'There was an error initializing Payload',\n },\n { status: httpStatus.INTERNAL_SERVER_ERROR },\n )\n }\n }\n\n req.payload = payload\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n const { config, logger } = payload\n\n let response = formatErrors(err)\n\n let status = err.status || httpStatus.INTERNAL_SERVER_ERROR\n\n logger.error(err.stack)\n\n // Internal server errors can contain anything, including potentially sensitive data.\n // Therefore, error details will be hidden from the response unless `config.debug` is `true`\n if (!config.debug && status === httpStatus.INTERNAL_SERVER_ERROR) {\n response = formatErrors(new APIError('Something went wrong.'))\n }\n\n if (config.debug && config.debug === true) {\n response.stack = err.stack\n }\n\n if (collection && typeof collection.config.hooks.afterError === 'function') {\n ;({ response, status } = collection.config.hooks.afterError(\n err,\n response,\n req?.context,\n collection.config,\n ) || { response, status })\n }\n\n if (typeof config.hooks.afterError === 'function') {\n ;({ response, status } = config.hooks.afterError(\n err,\n response,\n req?.context,\n collection?.config,\n ) || {\n response,\n status,\n })\n }\n\n return Response.json(response, { headers, status })\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/routes/rest/types.ts"],"sourcesContent":["import type { Collection, PayloadRequest, SanitizedGlobalConfig } from 'payload'\n\nexport type BaseRouteHandler = ({ req }: { req: PayloadRequest }) => Promise<Response> | Response\n\nexport type CollectionRouteHandler = ({\n collection,\n req,\n}: {\n collection: Collection\n req: PayloadRequest\n}) => Promise<Response> | Response\n\nexport type CollectionRouteHandlerWithID = ({\n id,\n collection,\n req,\n}: {\n collection: Collection\n id: string\n req: PayloadRequest\n}) => Promise<Response> | Response\n\nexport type GlobalRouteHandler = ({\n globalConfig,\n req,\n}: {\n globalConfig: SanitizedGlobalConfig\n req: PayloadRequest\n}) => Promise<Response> | Response\n\nexport type GlobalRouteHandlerWithID = ({\n id,\n globalConfig,\n req,\n}: {\n globalConfig: SanitizedGlobalConfig\n id: string\n req: PayloadRequest\n}) => Promise<Response> | Response\n"],"
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/routes/rest/types.ts"],"sourcesContent":["import type { Collection, PayloadRequest, SanitizedGlobalConfig } from 'payload'\n\nexport type BaseRouteHandler = ({ req }: { req: PayloadRequest }) => Promise<Response> | Response\n\nexport type CollectionRouteHandler = ({\n collection,\n req,\n}: {\n collection: Collection\n req: PayloadRequest\n}) => Promise<Response> | Response\n\nexport type CollectionRouteHandlerWithID = ({\n id,\n collection,\n req,\n}: {\n collection: Collection\n id: string\n req: PayloadRequest\n}) => Promise<Response> | Response\n\nexport type GlobalRouteHandler = ({\n globalConfig,\n req,\n}: {\n globalConfig: SanitizedGlobalConfig\n req: PayloadRequest\n}) => Promise<Response> | Response\n\nexport type GlobalRouteHandlerWithID = ({\n id,\n globalConfig,\n req,\n}: {\n globalConfig: SanitizedGlobalConfig\n id: string\n req: PayloadRequest\n}) => Promise<Response> | Response\n"],"mappings":"AA8BA","ignoreList":[]}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
export const sanitizeCollectionID = ({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
export const sanitizeCollectionID = ({
|
|
2
|
+
id,
|
|
3
|
+
collectionSlug,
|
|
4
|
+
payload
|
|
5
|
+
}) => {
|
|
6
|
+
let sanitizedID = id;
|
|
7
|
+
const collection = payload.collections[collectionSlug];
|
|
8
|
+
// If default db ID type is a number, we should sanitize
|
|
9
|
+
let shouldSanitize = Boolean(payload.db.defaultIDType === 'number');
|
|
10
|
+
// UNLESS the customIDType for this collection is text.... then we leave it
|
|
11
|
+
if (shouldSanitize && collection.customIDType === 'text') shouldSanitize = false;
|
|
12
|
+
// If we still should sanitize, parse float
|
|
13
|
+
if (shouldSanitize) sanitizedID = parseFloat(sanitizedID);
|
|
14
|
+
return sanitizedID;
|
|
11
15
|
};
|
|
12
|
-
|
|
13
16
|
//# sourceMappingURL=sanitizeCollectionID.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/routes/rest/utilities/sanitizeCollectionID.ts"],"sourcesContent":["import type { Payload } from 'payload'\n\ntype Args = {\n collectionSlug: string\n id: string\n payload: Payload\n}\n\nexport const sanitizeCollectionID = ({ id, collectionSlug, payload }: Args): number | string => {\n let sanitizedID: number | string = id\n const collection = payload.collections[collectionSlug]\n\n // If default db ID type is a number, we should sanitize\n let shouldSanitize = Boolean(payload.db.defaultIDType === 'number')\n\n // UNLESS the customIDType for this collection is text.... then we leave it\n if (shouldSanitize && collection.customIDType === 'text') shouldSanitize = false\n\n // If we still should sanitize, parse float\n if (shouldSanitize) sanitizedID = parseFloat(sanitizedID)\n\n return sanitizedID\n}\n"],"
|
|
1
|
+
{"version":3,"file":"sanitizeCollectionID.js","names":["sanitizeCollectionID","id","collectionSlug","payload","sanitizedID","collection","collections","shouldSanitize","Boolean","db","defaultIDType","customIDType","parseFloat"],"sources":["../../../../src/routes/rest/utilities/sanitizeCollectionID.ts"],"sourcesContent":["import type { Payload } from 'payload'\n\ntype Args = {\n collectionSlug: string\n id: string\n payload: Payload\n}\n\nexport const sanitizeCollectionID = ({ id, collectionSlug, payload }: Args): number | string => {\n let sanitizedID: number | string = id\n const collection = payload.collections[collectionSlug]\n\n // If default db ID type is a number, we should sanitize\n let shouldSanitize = Boolean(payload.db.defaultIDType === 'number')\n\n // UNLESS the customIDType for this collection is text.... then we leave it\n if (shouldSanitize && collection.customIDType === 'text') shouldSanitize = false\n\n // If we still should sanitize, parse float\n if (shouldSanitize) sanitizedID = parseFloat(sanitizedID)\n\n return sanitizedID\n}\n"],"mappings":"AAQA,OAAO,MAAMA,oBAAA,GAAuBA,CAAC;EAAEC,EAAE;EAAEC,cAAc;EAAEC;AAAO,CAAQ;EACxE,IAAIC,WAAA,GAA+BH,EAAA;EACnC,MAAMI,UAAA,GAAaF,OAAA,CAAQG,WAAW,CAACJ,cAAA,CAAe;EAEtD;EACA,IAAIK,cAAA,GAAiBC,OAAA,CAAQL,OAAA,CAAQM,EAAE,CAACC,aAAa,KAAK;EAE1D;EACA,IAAIH,cAAA,IAAkBF,UAAA,CAAWM,YAAY,KAAK,QAAQJ,cAAA,GAAiB;EAE3E;EACA,IAAIA,cAAA,EAAgBH,WAAA,GAAcQ,UAAA,CAAWR,WAAA;EAE7C,OAAOA,WAAA;AACT","ignoreList":[]}
|
package/dist/scss/app.scss
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
--theme-baseline-body-size: #{$baseline-body-size};
|
|
22
22
|
--font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
|
23
23
|
sans-serif;
|
|
24
|
-
--font-serif: Georgia, 'Bitstream Charter', 'Charis SIL', Utopia, 'URW Bookman L', serif;
|
|
25
|
-
--font-mono: monospace;
|
|
24
|
+
--font-serif: 'Georgia', 'Bitstream Charter', 'Charis SIL', Utopia, 'URW Bookman L', serif;
|
|
25
|
+
--font-mono: 'SF Mono', Menlo, Consolas, Monaco, monospace;
|
|
26
26
|
|
|
27
27
|
--style-radius-s: #{$style-radius-s};
|
|
28
28
|
--style-radius-m: #{$style-radius-m};
|
|
@@ -146,13 +146,13 @@ h6 {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
p {
|
|
149
|
-
margin: 0
|
|
149
|
+
margin: 0;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
ul,
|
|
153
153
|
ol {
|
|
154
154
|
padding-left: $baseline;
|
|
155
|
-
margin: 0
|
|
155
|
+
margin: 0;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
:focus-visible {
|
package/dist/scss/type.scss
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
%h1 {
|
|
19
|
-
margin: 0
|
|
19
|
+
margin: 0;
|
|
20
20
|
font-size: base(1.6);
|
|
21
21
|
line-height: base(1.8);
|
|
22
22
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
%h2 {
|
|
30
|
-
margin: 0
|
|
30
|
+
margin: 0;
|
|
31
31
|
font-size: base(1.3);
|
|
32
32
|
line-height: base(1.6);
|
|
33
33
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
%h3 {
|
|
40
|
-
margin: 0
|
|
40
|
+
margin: 0;
|
|
41
41
|
font-size: base(1);
|
|
42
42
|
line-height: base(1.2);
|
|
43
43
|
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
%h4 {
|
|
51
|
-
margin: 0
|
|
51
|
+
margin: 0;
|
|
52
52
|
font-size: base(0.8);
|
|
53
53
|
line-height: base(1);
|
|
54
54
|
letter-spacing: -0.375px;
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
5
|
import { Hamburger, useNav } from '@payloadcms/ui';
|
|
4
6
|
import React from 'react';
|
|
5
|
-
export const NavHamburger = ()=>{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
export const NavHamburger = () => {
|
|
8
|
+
const $ = _c(2);
|
|
9
|
+
const {
|
|
10
|
+
navOpen
|
|
11
|
+
} = useNav();
|
|
12
|
+
let t0;
|
|
13
|
+
if ($[0] !== navOpen) {
|
|
14
|
+
t0 = _jsx(Hamburger, {
|
|
15
|
+
closeIcon: "collapse",
|
|
16
|
+
isActive: navOpen
|
|
10
17
|
});
|
|
18
|
+
$[0] = navOpen;
|
|
19
|
+
$[1] = t0;
|
|
20
|
+
} else {
|
|
21
|
+
t0 = $[1];
|
|
22
|
+
}
|
|
23
|
+
return t0;
|
|
11
24
|
};
|
|
12
|
-
|
|
13
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/templates/Default/NavHamburger/index.tsx"],"sourcesContent":["'use client'\nimport { Hamburger, useNav } from '@payloadcms/ui'\nimport React from 'react'\n\nexport const NavHamburger: React.FC = () => {\n const { navOpen } = useNav()\n return <Hamburger closeIcon=\"collapse\" isActive={navOpen} />\n}\n"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","Hamburger","useNav","React","NavHamburger","$","navOpen","t0","_jsx","closeIcon","isActive"],"sources":["../../../../src/templates/Default/NavHamburger/index.tsx"],"sourcesContent":["'use client'\nimport { Hamburger, useNav } from '@payloadcms/ui'\nimport React from 'react'\n\nexport const NavHamburger: React.FC = () => {\n const { navOpen } = useNav()\n return <Hamburger closeIcon=\"collapse\" isActive={navOpen} />\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,SAAS,EAAEC,MAAM,QAAQ;AAClC,OAAOC,KAAA,MAAW;AAElB,OAAO,MAAMC,YAAA,GAAyBA,CAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EACpC;IAAAM;EAAA,IAAoBJ,MAAA;EAAA,IAAAK,EAAA;EAAA,IAAAF,CAAA,QAAAC,OAAA;IACbC,EAAA,GAAAC,IAAA,CAAAP,SAAA;MAAAQ,SAAA,EAAqB;MAAAC,QAAA,EAAqBJ;IAAA,C;;;;;;SAA1CC,E;CACT","ignoreList":[]}
|
|
@@ -1,20 +1,49 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
5
|
import { useNav } from '@payloadcms/ui';
|
|
4
6
|
import React from 'react';
|
|
5
|
-
export const Wrapper =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
export const Wrapper = props => {
|
|
8
|
+
const $ = _c(9);
|
|
9
|
+
const {
|
|
10
|
+
baseClass,
|
|
11
|
+
children,
|
|
12
|
+
className
|
|
13
|
+
} = props;
|
|
14
|
+
const {
|
|
15
|
+
hydrated,
|
|
16
|
+
navOpen,
|
|
17
|
+
shouldAnimate
|
|
18
|
+
} = useNav();
|
|
19
|
+
const t0 = navOpen && `${baseClass}--nav-open`;
|
|
20
|
+
const t1 = shouldAnimate && `${baseClass}--nav-animate`;
|
|
21
|
+
const t2 = hydrated && `${baseClass}--nav-hydrated`;
|
|
22
|
+
let t3;
|
|
23
|
+
if ($[0] !== baseClass || $[1] !== className || $[2] !== t0 || $[3] !== t1 || $[4] !== t2) {
|
|
24
|
+
t3 = [baseClass, className, t0, t1, t2].filter(Boolean);
|
|
25
|
+
$[0] = baseClass;
|
|
26
|
+
$[1] = className;
|
|
27
|
+
$[2] = t0;
|
|
28
|
+
$[3] = t1;
|
|
29
|
+
$[4] = t2;
|
|
30
|
+
$[5] = t3;
|
|
31
|
+
} else {
|
|
32
|
+
t3 = $[5];
|
|
33
|
+
}
|
|
34
|
+
const t4 = t3.join(" ");
|
|
35
|
+
let t5;
|
|
36
|
+
if ($[6] !== t4 || $[7] !== children) {
|
|
37
|
+
t5 = _jsx("div", {
|
|
38
|
+
className: t4,
|
|
39
|
+
children
|
|
17
40
|
});
|
|
41
|
+
$[6] = t4;
|
|
42
|
+
$[7] = children;
|
|
43
|
+
$[8] = t5;
|
|
44
|
+
} else {
|
|
45
|
+
t5 = $[8];
|
|
46
|
+
}
|
|
47
|
+
return t5;
|
|
18
48
|
};
|
|
19
|
-
|
|
20
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/templates/Default/Wrapper/index.tsx"],"sourcesContent":["'use client'\nimport { useNav } from '@payloadcms/ui'\nimport React from 'react'\n\nimport './index.scss'\n\nexport const Wrapper: React.FC<{\n baseClass?: string\n children?: React.ReactNode\n className?: string\n}> = (props) => {\n const { baseClass, children, className } = props\n const { hydrated, navOpen, shouldAnimate } = useNav()\n\n return (\n <div\n className={[\n baseClass,\n className,\n navOpen && `${baseClass}--nav-open`,\n shouldAnimate && `${baseClass}--nav-animate`,\n hydrated && `${baseClass}--nav-hydrated`,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </div>\n )\n}\n"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useNav","React","Wrapper","props","$","baseClass","children","className","hydrated","navOpen","shouldAnimate","t0","t1","t2","t3","filter","Boolean","t4","join","t5","_jsx"],"sources":["../../../../src/templates/Default/Wrapper/index.tsx"],"sourcesContent":["'use client'\nimport { useNav } from '@payloadcms/ui'\nimport React from 'react'\n\nimport './index.scss'\n\nexport const Wrapper: React.FC<{\n baseClass?: string\n children?: React.ReactNode\n className?: string\n}> = (props) => {\n const { baseClass, children, className } = props\n const { hydrated, navOpen, shouldAnimate } = useNav()\n\n return (\n <div\n className={[\n baseClass,\n className,\n navOpen && `${baseClass}--nav-open`,\n shouldAnimate && `${baseClass}--nav-animate`,\n hydrated && `${baseClass}--nav-hydrated`,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,MAAM,QAAQ;AACvB,OAAOC,KAAA,MAAW;AAIlB,OAAO,MAAMC,OAAA,GAIRC,KAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EACH;IAAAM,SAAA;IAAAC,QAAA;IAAAC;EAAA,IAA2CJ,KAAA;EAC3C;IAAAK,QAAA;IAAAC,OAAA;IAAAC;EAAA,IAA6CV,MAAA;EAOvC,MAAAW,EAAA,GAAAF,OAAA,IAAW,GAAGJ,SAAA,YAAqB;EACnC,MAAAO,EAAA,GAAAF,aAAA,IAAiB,GAAGL,SAAA,eAAwB;EAC5C,MAAAQ,EAAA,GAAAL,QAAA,IAAY,GAAGH,SAAA,gBAAyB;EAAA,IAAAS,EAAA;EAAA,IAAAV,CAAA,QAAAC,SAAA,IAAAD,CAAA,QAAAG,SAAA,IAAAH,CAAA,QAAAO,EAAA,IAAAP,CAAA,QAAAQ,EAAA,IAAAR,CAAA,QAAAS,EAAA;IAL/BC,EAAA,IACTT,SAAA,EACAE,SAAA,EACAI,EAAmC,EACnCC,EAA4C,EAC5CC,EAAwC,EAAAE,MAAA,CAAAC,OAEhC;IAAAZ,CAAA,MAAAC,SAAA;IAAAD,CAAA,MAAAG,SAAA;IAAAH,CAAA,MAAAO,EAAA;IAAAP,CAAA,MAAAQ,EAAA;IAAAR,CAAA,MAAAS,EAAA;IAAAT,CAAA,MAAAU,EAAA;EAAA;IAAAA,EAAA,GAAAV,CAAA;EAAA;EAPC,MAAAa,EAAA,GAAAH,EAOD,CAAAI,IAAA,CACF;EAAA,IAAAC,EAAA;EAAA,IAAAf,CAAA,QAAAa,EAAA,IAAAb,CAAA,QAAAE,QAAA;IATVa,EAAA,GAAAC,IAAA,CAAC;MAAAb,SAAA,EACYU,EAQH;MAAAX;IAAA,C;;;;;;;SATVa,E;CAcJ","ignoreList":[]}
|
|
@@ -6,54 +6,61 @@ import { DefaultNav } from '../../elements/Nav/index.js';
|
|
|
6
6
|
import { NavHamburger } from './NavHamburger/index.js';
|
|
7
7
|
import { Wrapper } from './Wrapper/index.js';
|
|
8
8
|
const baseClass = 'template-default';
|
|
9
|
-
export const DefaultTemplate = ({
|
|
10
|
-
|
|
9
|
+
export const DefaultTemplate = ({
|
|
10
|
+
children,
|
|
11
|
+
className,
|
|
12
|
+
i18n,
|
|
13
|
+
locale,
|
|
14
|
+
params,
|
|
15
|
+
payload,
|
|
16
|
+
permissions,
|
|
17
|
+
searchParams,
|
|
18
|
+
user,
|
|
19
|
+
visibleEntities
|
|
20
|
+
}) => {
|
|
21
|
+
const {
|
|
22
|
+
admin: {
|
|
23
|
+
components: {
|
|
24
|
+
Nav: CustomNav
|
|
25
|
+
} = {
|
|
11
26
|
Nav: undefined
|
|
12
|
-
|
|
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
|
-
/*#__PURE__*/ _jsxs(Wrapper, {
|
|
39
|
-
baseClass: baseClass,
|
|
40
|
-
className: className,
|
|
41
|
-
children: [
|
|
42
|
-
/*#__PURE__*/ _jsx(RenderComponent, {
|
|
43
|
-
mappedComponent: MappedDefaultNav
|
|
44
|
-
}),
|
|
45
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
46
|
-
className: `${baseClass}__wrap`,
|
|
47
|
-
children: [
|
|
48
|
-
/*#__PURE__*/ _jsx(AppHeader, {}),
|
|
49
|
-
children
|
|
50
|
-
]
|
|
51
|
-
})
|
|
52
|
-
]
|
|
53
|
-
})
|
|
54
|
-
]
|
|
27
|
+
}
|
|
28
|
+
} = {}
|
|
29
|
+
} = payload.config || {};
|
|
30
|
+
const createMappedComponent = getCreateMappedComponent({
|
|
31
|
+
importMap: payload.importMap,
|
|
32
|
+
serverProps: {
|
|
33
|
+
i18n,
|
|
34
|
+
locale,
|
|
35
|
+
params,
|
|
36
|
+
payload,
|
|
37
|
+
permissions,
|
|
38
|
+
searchParams,
|
|
39
|
+
user
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const MappedDefaultNav = createMappedComponent(CustomNav, undefined, DefaultNav, 'CustomNav');
|
|
43
|
+
return /*#__PURE__*/_jsx(EntityVisibilityProvider, {
|
|
44
|
+
visibleEntities: visibleEntities,
|
|
45
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
46
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
47
|
+
className: `${baseClass}__nav-toggler-wrapper`,
|
|
48
|
+
id: "nav-toggler",
|
|
49
|
+
children: /*#__PURE__*/_jsx(NavToggler, {
|
|
50
|
+
className: `${baseClass}__nav-toggler`,
|
|
51
|
+
children: /*#__PURE__*/_jsx(NavHamburger, {})
|
|
55
52
|
})
|
|
56
|
-
|
|
53
|
+
}), /*#__PURE__*/_jsxs(Wrapper, {
|
|
54
|
+
baseClass: baseClass,
|
|
55
|
+
className: className,
|
|
56
|
+
children: [/*#__PURE__*/_jsx(RenderComponent, {
|
|
57
|
+
mappedComponent: MappedDefaultNav
|
|
58
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
59
|
+
className: `${baseClass}__wrap`,
|
|
60
|
+
children: [/*#__PURE__*/_jsx(AppHeader, {}), children]
|
|
61
|
+
})]
|
|
62
|
+
})]
|
|
63
|
+
})
|
|
64
|
+
});
|
|
57
65
|
};
|
|
58
|
-
|
|
59
66
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/templates/Default/index.tsx"],"sourcesContent":["import type { MappedComponent, ServerProps, VisibleEntities } from 'payload'\n\nimport { AppHeader, EntityVisibilityProvider, NavToggler } from '@payloadcms/ui'\nimport { RenderComponent, getCreateMappedComponent } from '@payloadcms/ui/shared'\nimport React from 'react'\n\nimport { DefaultNav } from '../../elements/Nav/index.js'\nimport { NavHamburger } from './NavHamburger/index.js'\nimport { Wrapper } from './Wrapper/index.js'\nimport './index.scss'\n\nconst baseClass = 'template-default'\n\nexport type DefaultTemplateProps = {\n children?: React.ReactNode\n className?: string\n visibleEntities: VisibleEntities\n} & ServerProps\n\nexport const DefaultTemplate: React.FC<DefaultTemplateProps> = ({\n children,\n className,\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n visibleEntities,\n}) => {\n const {\n admin: {\n components: { Nav: CustomNav } = {\n Nav: undefined,\n },\n } = {},\n } = payload.config || {}\n\n const createMappedComponent = getCreateMappedComponent({\n importMap: payload.importMap,\n serverProps: {\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n },\n })\n\n const MappedDefaultNav: MappedComponent = createMappedComponent(\n CustomNav,\n undefined,\n DefaultNav,\n 'CustomNav',\n )\n\n return (\n <EntityVisibilityProvider visibleEntities={visibleEntities}>\n <div>\n <div className={`${baseClass}__nav-toggler-wrapper`} id=\"nav-toggler\">\n <NavToggler className={`${baseClass}__nav-toggler`}>\n <NavHamburger />\n </NavToggler>\n </div>\n <Wrapper baseClass={baseClass} className={className}>\n <RenderComponent mappedComponent={MappedDefaultNav} />\n\n <div className={`${baseClass}__wrap`}>\n <AppHeader />\n {children}\n </div>\n </Wrapper>\n </div>\n </EntityVisibilityProvider>\n )\n}\n"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":["AppHeader","EntityVisibilityProvider","NavToggler","RenderComponent","getCreateMappedComponent","React","DefaultNav","NavHamburger","Wrapper","baseClass","DefaultTemplate","children","className","i18n","locale","params","payload","permissions","searchParams","user","visibleEntities","admin","components","Nav","CustomNav","undefined","config","createMappedComponent","importMap","serverProps","MappedDefaultNav","_jsx","_jsxs","id","mappedComponent"],"sources":["../../../src/templates/Default/index.tsx"],"sourcesContent":["import type { MappedComponent, ServerProps, VisibleEntities } from 'payload'\n\nimport { AppHeader, EntityVisibilityProvider, NavToggler } from '@payloadcms/ui'\nimport { RenderComponent, getCreateMappedComponent } from '@payloadcms/ui/shared'\nimport React from 'react'\n\nimport { DefaultNav } from '../../elements/Nav/index.js'\nimport { NavHamburger } from './NavHamburger/index.js'\nimport { Wrapper } from './Wrapper/index.js'\nimport './index.scss'\n\nconst baseClass = 'template-default'\n\nexport type DefaultTemplateProps = {\n children?: React.ReactNode\n className?: string\n visibleEntities: VisibleEntities\n} & ServerProps\n\nexport const DefaultTemplate: React.FC<DefaultTemplateProps> = ({\n children,\n className,\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n visibleEntities,\n}) => {\n const {\n admin: {\n components: { Nav: CustomNav } = {\n Nav: undefined,\n },\n } = {},\n } = payload.config || {}\n\n const createMappedComponent = getCreateMappedComponent({\n importMap: payload.importMap,\n serverProps: {\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n },\n })\n\n const MappedDefaultNav: MappedComponent = createMappedComponent(\n CustomNav,\n undefined,\n DefaultNav,\n 'CustomNav',\n )\n\n return (\n <EntityVisibilityProvider visibleEntities={visibleEntities}>\n <div>\n <div className={`${baseClass}__nav-toggler-wrapper`} id=\"nav-toggler\">\n <NavToggler className={`${baseClass}__nav-toggler`}>\n <NavHamburger />\n </NavToggler>\n </div>\n <Wrapper baseClass={baseClass} className={className}>\n <RenderComponent mappedComponent={MappedDefaultNav} />\n\n <div className={`${baseClass}__wrap`}>\n <AppHeader />\n {children}\n </div>\n </Wrapper>\n </div>\n </EntityVisibilityProvider>\n )\n}\n"],"mappings":";AAEA,SAASA,SAAS,EAAEC,wBAAwB,EAAEC,UAAU,QAAQ;AAChE,SAASC,eAAe,EAAEC,wBAAwB,QAAQ;AAC1D,OAAOC,KAAA,MAAW;AAElB,SAASC,UAAU,QAAQ;AAC3B,SAASC,YAAY,QAAQ;AAC7B,SAASC,OAAO,QAAQ;AAGxB,MAAMC,SAAA,GAAY;AAQlB,OAAO,MAAMC,eAAA,GAAkDA,CAAC;EAC9DC,QAAQ;EACRC,SAAS;EACTC,IAAI;EACJC,MAAM;EACNC,MAAM;EACNC,OAAO;EACPC,WAAW;EACXC,YAAY;EACZC,IAAI;EACJC;AAAe,CAChB;EACC,MAAM;IACJC,KAAA,EAAO;MACLC,UAAA,EAAY;QAAEC,GAAA,EAAKC;MAAS,CAAE,GAAG;QAC/BD,GAAA,EAAKE;MACP;IAAC,CACF,GAAG,CAAC;EAAC,CACP,GAAGT,OAAA,CAAQU,MAAM,IAAI,CAAC;EAEvB,MAAMC,qBAAA,GAAwBvB,wBAAA,CAAyB;IACrDwB,SAAA,EAAWZ,OAAA,CAAQY,SAAS;IAC5BC,WAAA,EAAa;MACXhB,IAAA;MACAC,MAAA;MACAC,MAAA;MACAC,OAAA;MACAC,WAAA;MACAC,YAAA;MACAC;IACF;EACF;EAEA,MAAMW,gBAAA,GAAoCH,qBAAA,CACxCH,SAAA,EACAC,SAAA,EACAnB,UAAA,EACA;EAGF,oBACEyB,IAAA,CAAC9B,wBAAA;IAAyBmB,eAAA,EAAiBA,eAAA;cACzC,aAAAY,KAAA,CAAC;8BACCD,IAAA,CAAC;QAAInB,SAAA,EAAW,GAAGH,SAAA,uBAAgC;QAAEwB,EAAA,EAAG;kBACtD,aAAAF,IAAA,CAAC7B,UAAA;UAAWU,SAAA,EAAW,GAAGH,SAAA,eAAwB;oBAChD,aAAAsB,IAAA,CAACxB,YAAA;;uBAGLyB,KAAA,CAACxB,OAAA;QAAQC,SAAA,EAAWA,SAAA;QAAWG,SAAA,EAAWA,SAAA;gCACxCmB,IAAA,CAAC5B,eAAA;UAAgB+B,eAAA,EAAiBJ;yBAElCE,KAAA,CAAC;UAAIpB,SAAA,EAAW,GAAGH,SAAA,QAAiB;kCAClCsB,IAAA,CAAC/B,SAAA,OACAW,QAAA;;;;;AAMb","ignoreList":[]}
|