@payloadcms/next 3.0.0-canary.6659da8 → 3.0.0-canary.67aae47
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.cjs +33 -15
- package/dist/cjs/withPayload.cjs.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +0 -1
- package/dist/config.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js +16 -10
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js +104 -34
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts +4 -2
- package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js +75 -53
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/index.scss +70 -66
- 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.d.ts +2 -2
- package/dist/elements/DocumentHeader/Tabs/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.js +90 -72
- package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.scss +41 -40
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js +23 -17
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts +4 -2
- package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts.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.d.ts +2 -3
- package/dist/elements/DocumentHeader/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/index.js +23 -25
- package/dist/elements/DocumentHeader/index.js.map +1 -1
- package/dist/elements/DocumentHeader/index.scss +44 -41
- package/dist/elements/FormHeader/index.d.ts +9 -0
- package/dist/elements/FormHeader/index.d.ts.map +1 -0
- package/dist/elements/FormHeader/index.js +20 -0
- package/dist/elements/FormHeader/index.js.map +1 -0
- package/dist/elements/FormHeader/index.scss +8 -0
- package/dist/elements/Logo/index.d.ts.map +1 -1
- package/dist/elements/Logo/index.js +36 -19
- package/dist/elements/Logo/index.js.map +1 -1
- package/dist/elements/Nav/NavHamburger/index.js +42 -14
- package/dist/elements/Nav/NavHamburger/index.js.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.d.ts.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.js +49 -15
- package/dist/elements/Nav/NavWrapper/index.js.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.scss +22 -12
- package/dist/elements/Nav/index.client.d.ts +4 -1
- package/dist/elements/Nav/index.client.d.ts.map +1 -1
- package/dist/elements/Nav/index.client.js +98 -70
- package/dist/elements/Nav/index.client.js.map +1 -1
- package/dist/elements/Nav/index.d.ts.map +1 -1
- package/dist/elements/Nav/index.js +96 -59
- package/dist/elements/Nav/index.js.map +1 -1
- package/dist/elements/Nav/index.scss +125 -113
- package/dist/exports/layouts.d.ts +2 -1
- package/dist/exports/layouts.d.ts.map +1 -1
- package/dist/exports/layouts.js +2 -2
- package/dist/exports/layouts.js.map +1 -1
- package/dist/exports/routes.d.ts +1 -1
- package/dist/exports/routes.d.ts.map +1 -1
- package/dist/exports/routes.js +1 -2
- 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.d.ts +1 -0
- package/dist/exports/utilities.d.ts.map +1 -1
- package/dist/exports/utilities.js +2 -1
- package/dist/exports/utilities.js.map +1 -1
- package/dist/exports/views.d.ts +1 -3
- package/dist/exports/views.d.ts.map +1 -1
- package/dist/exports/views.js +1 -4
- package/dist/exports/views.js.map +1 -1
- package/dist/fetchAPI-multipart/fileFactory.d.ts +2 -2
- package/dist/fetchAPI-multipart/fileFactory.d.ts.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.d.ts +1 -2
- package/dist/fetchAPI-multipart/handlers.d.ts.map +1 -1
- package/dist/fetchAPI-multipart/handlers.js +79 -78
- package/dist/fetchAPI-multipart/handlers.js.map +1 -1
- package/dist/fetchAPI-multipart/index.d.ts +1 -102
- package/dist/fetchAPI-multipart/index.d.ts.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.d.ts +2 -1
- package/dist/fetchAPI-multipart/processMultipart.d.ts.map +1 -1
- package/dist/fetchAPI-multipart/processMultipart.js +157 -141
- package/dist/fetchAPI-multipart/processMultipart.js.map +1 -1
- package/dist/fetchAPI-multipart/processNested.d.ts.map +1 -1
- package/dist/fetchAPI-multipart/processNested.js +26 -20
- package/dist/fetchAPI-multipart/processNested.js.map +1 -1
- package/dist/fetchAPI-multipart/uploadTimer.d.ts.map +1 -1
- package/dist/fetchAPI-multipart/uploadTimer.js +18 -17
- package/dist/fetchAPI-multipart/uploadTimer.js.map +1 -1
- package/dist/fetchAPI-multipart/utilities.d.ts +1 -1
- package/dist/fetchAPI-multipart/utilities.d.ts.map +1 -1
- package/dist/fetchAPI-multipart/utilities.js +185 -165
- package/dist/fetchAPI-multipart/utilities.js.map +1 -1
- package/dist/fetchAPI-stream-file/index.d.ts +0 -1
- package/dist/fetchAPI-stream-file/index.d.ts.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/NestProviders.d.ts +11 -0
- package/dist/layouts/Root/NestProviders.d.ts.map +1 -0
- package/dist/layouts/Root/NestProviders.js +21 -0
- package/dist/layouts/Root/NestProviders.js.map +1 -0
- package/dist/layouts/Root/index.d.ts +6 -4
- package/dist/layouts/Root/index.d.ts.map +1 -1
- package/dist/layouts/Root/index.js +152 -99
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/prod/styles.css +1 -1
- package/dist/routes/graphql/handler.d.ts.map +1 -1
- package/dist/routes/graphql/handler.js +121 -107
- 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.d.ts.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.d.ts.map +1 -1
- package/dist/routes/rest/auth/forgotPassword.js +29 -21
- 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.d.ts.map +1 -1
- package/dist/routes/rest/auth/login.js +43 -33
- package/dist/routes/rest/auth/login.js.map +1 -1
- package/dist/routes/rest/auth/logout.d.ts.map +1 -1
- package/dist/routes/rest/auth/logout.js +32 -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.d.ts.map +1 -1
- package/dist/routes/rest/auth/refresh.js +29 -33
- package/dist/routes/rest/auth/refresh.js.map +1 -1
- package/dist/routes/rest/auth/registerFirstUser.d.ts.map +1 -1
- package/dist/routes/rest/auth/registerFirstUser.js +43 -31
- 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.d.ts.map +1 -1
- package/dist/routes/rest/auth/unlock.js +27 -19
- 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/checkEndpoints.d.ts.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.d.ts.map +1 -1
- package/dist/routes/rest/collections/create.js +34 -26
- package/dist/routes/rest/collections/create.js.map +1 -1
- package/dist/routes/rest/collections/delete.d.ts.map +1 -1
- package/dist/routes/rest/collections/delete.js +48 -35
- package/dist/routes/rest/collections/delete.js.map +1 -1
- package/dist/routes/rest/collections/deleteByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/deleteByID.js +42 -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.d.ts.map +1 -1
- package/dist/routes/rest/collections/duplicate.js +40 -31
- package/dist/routes/rest/collections/duplicate.js.map +1 -1
- package/dist/routes/rest/collections/find.d.ts.map +1 -1
- package/dist/routes/rest/collections/find.js +38 -20
- package/dist/routes/rest/collections/find.js.map +1 -1
- package/dist/routes/rest/collections/findByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/findByID.js +34 -23
- package/dist/routes/rest/collections/findByID.js.map +1 -1
- package/dist/routes/rest/collections/findVersionByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/findVersionByID.js +31 -22
- package/dist/routes/rest/collections/findVersionByID.js.map +1 -1
- package/dist/routes/rest/collections/findVersions.d.ts.map +1 -1
- package/dist/routes/rest/collections/findVersions.js +33 -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.d.ts.map +1 -1
- package/dist/routes/rest/collections/restoreVersion.js +34 -25
- package/dist/routes/rest/collections/restoreVersion.js.map +1 -1
- package/dist/routes/rest/collections/update.d.ts.map +1 -1
- package/dist/routes/rest/collections/update.js +53 -37
- package/dist/routes/rest/collections/update.js.map +1 -1
- package/dist/routes/rest/collections/updateByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/updateByID.js +50 -33
- package/dist/routes/rest/collections/updateByID.js.map +1 -1
- package/dist/routes/rest/files/checkFileAccess.d.ts +2 -2
- package/dist/routes/rest/files/checkFileAccess.d.ts.map +1 -1
- package/dist/routes/rest/files/checkFileAccess.js +52 -45
- package/dist/routes/rest/files/checkFileAccess.js.map +1 -1
- package/dist/routes/rest/files/getFile.d.ts +2 -2
- package/dist/routes/rest/files/getFile.d.ts.map +1 -1
- package/dist/routes/rest/files/getFile.js +56 -47
- 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.d.ts.map +1 -1
- package/dist/routes/rest/globals/findOne.js +26 -18
- package/dist/routes/rest/globals/findOne.js.map +1 -1
- package/dist/routes/rest/globals/findVersionByID.d.ts.map +1 -1
- package/dist/routes/rest/globals/findVersionByID.js +26 -17
- package/dist/routes/rest/globals/findVersionByID.js.map +1 -1
- package/dist/routes/rest/globals/findVersions.d.ts.map +1 -1
- package/dist/routes/rest/globals/findVersions.js +33 -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.d.ts.map +1 -1
- package/dist/routes/rest/globals/restoreVersion.js +29 -20
- package/dist/routes/rest/globals/restoreVersion.js.map +1 -1
- package/dist/routes/rest/globals/update.d.ts.map +1 -1
- package/dist/routes/rest/globals/update.js +42 -28
- package/dist/routes/rest/globals/update.js.map +1 -1
- package/dist/routes/rest/index.d.ts +17 -12
- package/dist/routes/rest/index.d.ts.map +1 -1
- package/dist/routes/rest/index.js +747 -609
- package/dist/routes/rest/index.js.map +1 -1
- package/dist/routes/rest/og/image.d.ts +4 -1
- package/dist/routes/rest/og/image.d.ts.map +1 -1
- package/dist/routes/rest/og/image.js +79 -73
- package/dist/routes/rest/og/image.js.map +1 -1
- package/dist/routes/rest/og/index.d.ts +2 -2
- package/dist/routes/rest/og/index.d.ts.map +1 -1
- package/dist/routes/rest/og/index.js +55 -55
- package/dist/routes/rest/og/index.js.map +1 -1
- package/dist/routes/rest/routeError.d.ts +3 -8
- package/dist/routes/rest/routeError.d.ts.map +1 -1
- package/dist/routes/rest/routeError.js +74 -99
- package/dist/routes/rest/routeError.js.map +1 -1
- package/dist/routes/rest/types.d.ts +7 -7
- package/dist/routes/rest/types.d.ts.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.d.ts.map +1 -1
- package/dist/routes/rest/utilities/sanitizeCollectionID.js +18 -11
- package/dist/routes/rest/utilities/sanitizeCollectionID.js.map +1 -1
- package/dist/routes/rest/utilities/sanitizeJoinParams.d.ts +13 -0
- package/dist/routes/rest/utilities/sanitizeJoinParams.d.ts.map +1 -0
- package/dist/routes/rest/utilities/sanitizeJoinParams.js +21 -0
- package/dist/routes/rest/utilities/sanitizeJoinParams.js.map +1 -0
- package/dist/routes/rest/utilities/sanitizePopulate.d.ts +3 -0
- package/dist/routes/rest/utilities/sanitizePopulate.d.ts.map +1 -0
- package/dist/routes/rest/utilities/sanitizePopulate.js +11 -0
- package/dist/routes/rest/utilities/sanitizePopulate.js.map +1 -0
- package/dist/routes/rest/utilities/sanitizeSelect.d.ts +6 -0
- package/dist/routes/rest/utilities/sanitizeSelect.d.ts.map +1 -0
- package/dist/routes/rest/utilities/sanitizeSelect.js +17 -0
- package/dist/routes/rest/utilities/sanitizeSelect.js.map +1 -0
- package/dist/scss/app.scss +166 -167
- package/dist/scss/colors.scss +256 -254
- package/dist/scss/resets.scss +9 -7
- package/dist/scss/toastify.scss +61 -0
- package/dist/scss/toasts.scss +115 -82
- package/dist/scss/type.scss +79 -86
- package/dist/scss/vars.scss +26 -47
- package/dist/templates/Default/NavHamburger/index.js +19 -7
- package/dist/templates/Default/NavHamburger/index.js.map +1 -1
- package/dist/templates/Default/Wrapper/index.d.ts.map +1 -1
- package/dist/templates/Default/Wrapper/index.js +43 -12
- package/dist/templates/Default/Wrapper/index.js.map +1 -1
- package/dist/templates/Default/Wrapper/index.scss +48 -15
- package/dist/templates/Default/index.d.ts +4 -3
- package/dist/templates/Default/index.d.ts.map +1 -1
- package/dist/templates/Default/index.js +126 -56
- package/dist/templates/Default/index.js.map +1 -1
- package/dist/templates/Default/index.scss +62 -50
- package/dist/templates/Minimal/index.js +16 -16
- package/dist/templates/Minimal/index.js.map +1 -1
- package/dist/templates/Minimal/index.scss +22 -20
- package/dist/utilities/addDataAndFileToRequest.d.ts +3 -6
- package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -1
- package/dist/utilities/addDataAndFileToRequest.js +41 -39
- package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
- package/dist/utilities/addLocalesToRequest.d.ts +2 -5
- package/dist/utilities/addLocalesToRequest.d.ts.map +1 -1
- package/dist/utilities/addLocalesToRequest.js +50 -39
- package/dist/utilities/addLocalesToRequest.js.map +1 -1
- package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
- package/dist/utilities/createPayloadRequest.js +91 -70
- package/dist/utilities/createPayloadRequest.js.map +1 -1
- package/dist/utilities/getClientConfig.d.ts +7 -0
- package/dist/utilities/getClientConfig.d.ts.map +1 -0
- package/dist/utilities/getClientConfig.js +14 -0
- package/dist/utilities/getClientConfig.js.map +1 -0
- package/dist/utilities/getNextRequestI18n.d.ts +3 -3
- package/dist/utilities/getNextRequestI18n.d.ts.map +1 -1
- package/dist/utilities/getNextRequestI18n.js +14 -10
- package/dist/utilities/getNextRequestI18n.js.map +1 -1
- package/dist/utilities/getPayloadHMR.d.ts +2 -2
- package/dist/utilities/getPayloadHMR.d.ts.map +1 -1
- package/dist/utilities/getPayloadHMR.js +92 -79
- 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.d.ts +1 -1
- package/dist/utilities/getRequestTheme.d.ts.map +1 -1
- package/dist/utilities/getRequestTheme.js +20 -17
- package/dist/utilities/getRequestTheme.js.map +1 -1
- package/dist/utilities/handleServerFunctions.d.ts +3 -0
- package/dist/utilities/handleServerFunctions.d.ts.map +1 -0
- package/dist/utilities/handleServerFunctions.js +35 -0
- package/dist/utilities/handleServerFunctions.js.map +1 -0
- package/dist/utilities/headersWithCors.d.ts +2 -2
- package/dist/utilities/headersWithCors.d.ts.map +1 -1
- package/dist/utilities/headersWithCors.js +21 -14
- package/dist/utilities/headersWithCors.js.map +1 -1
- package/dist/utilities/initPage/handleAdminPage.d.ts +13 -7
- package/dist/utilities/initPage/handleAdminPage.d.ts.map +1 -1
- package/dist/utilities/initPage/handleAdminPage.js +46 -33
- package/dist/utilities/initPage/handleAdminPage.js.map +1 -1
- package/dist/utilities/initPage/handleAuthRedirect.d.ts +7 -4
- package/dist/utilities/initPage/handleAuthRedirect.d.ts.map +1 -1
- package/dist/utilities/initPage/handleAuthRedirect.js +38 -24
- package/dist/utilities/initPage/handleAuthRedirect.js.map +1 -1
- package/dist/utilities/initPage/index.d.ts +1 -1
- package/dist/utilities/initPage/index.d.ts.map +1 -1
- package/dist/utilities/initPage/index.js +160 -122
- package/dist/utilities/initPage/index.js.map +1 -1
- package/dist/utilities/initPage/isCustomAdminView.d.ts +10 -0
- package/dist/utilities/initPage/isCustomAdminView.d.ts.map +1 -0
- package/dist/utilities/initPage/isCustomAdminView.js +31 -0
- package/dist/utilities/initPage/isCustomAdminView.js.map +1 -0
- package/dist/utilities/initPage/shared.d.ts +14 -2
- package/dist/utilities/initPage/shared.d.ts.map +1 -1
- package/dist/utilities/initPage/shared.js +33 -16
- package/dist/utilities/initPage/shared.js.map +1 -1
- package/dist/utilities/initPage/types.d.ts +2 -1
- package/dist/utilities/initPage/types.d.ts.map +1 -1
- package/dist/utilities/initPage/types.js +1 -2
- package/dist/utilities/initPage/types.js.map +1 -1
- package/dist/utilities/initReq.d.ts +11 -0
- package/dist/utilities/initReq.d.ts.map +1 -0
- package/dist/utilities/initReq.js +47 -0
- package/dist/utilities/initReq.js.map +1 -0
- package/dist/utilities/mergeHeaders.d.ts +2 -0
- package/dist/utilities/mergeHeaders.d.ts.map +1 -0
- package/dist/utilities/mergeHeaders.js +10 -0
- package/dist/utilities/mergeHeaders.js.map +1 -0
- package/dist/utilities/meta.d.ts +2 -2
- package/dist/utilities/meta.d.ts.map +1 -1
- package/dist/utilities/meta.js +67 -68
- package/dist/utilities/meta.js.map +1 -1
- package/dist/utilities/timestamp.d.ts.map +1 -1
- package/dist/utilities/timestamp.js +6 -5
- package/dist/utilities/timestamp.js.map +1 -1
- package/dist/views/API/LocaleSelector/index.d.ts +2 -2
- package/dist/views/API/LocaleSelector/index.d.ts.map +1 -1
- package/dist/views/API/LocaleSelector/index.js +37 -9
- package/dist/views/API/LocaleSelector/index.js.map +1 -1
- package/dist/views/API/RenderJSON/index.d.ts +1 -1
- package/dist/views/API/RenderJSON/index.d.ts.map +1 -1
- package/dist/views/API/RenderJSON/index.js +125 -113
- package/dist/views/API/RenderJSON/index.js.map +1 -1
- package/dist/views/API/RenderJSON/index.scss +68 -66
- package/dist/views/API/index.client.d.ts.map +1 -1
- package/dist/views/API/index.client.js +189 -200
- package/dist/views/API/index.client.js.map +1 -1
- package/dist/views/API/index.d.ts +2 -2
- package/dist/views/API/index.d.ts.map +1 -1
- package/dist/views/API/index.js +2 -3
- package/dist/views/API/index.js.map +1 -1
- package/dist/views/API/index.scss +98 -97
- package/dist/views/API/meta.d.ts.map +1 -1
- package/dist/views/API/meta.js +22 -14
- package/dist/views/API/meta.js.map +1 -1
- package/dist/views/Account/Settings/LanguageSelector.js +46 -13
- package/dist/views/Account/Settings/LanguageSelector.js.map +1 -1
- package/dist/views/Account/Settings/index.d.ts +5 -4
- package/dist/views/Account/Settings/index.d.ts.map +1 -1
- package/dist/views/Account/Settings/index.js +22 -28
- package/dist/views/Account/Settings/index.js.map +1 -1
- package/dist/views/Account/Settings/index.scss +37 -35
- package/dist/views/Account/ToggleTheme/index.d.ts.map +1 -1
- package/dist/views/Account/ToggleTheme/index.js +52 -28
- package/dist/views/Account/ToggleTheme/index.js.map +1 -1
- package/dist/views/Account/index.client.d.ts +3 -0
- package/dist/views/Account/index.client.d.ts.map +1 -0
- package/dist/views/Account/index.client.js +37 -0
- package/dist/views/Account/index.client.js.map +1 -0
- package/dist/views/Account/index.d.ts.map +1 -1
- package/dist/views/Account/index.js +160 -76
- 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.d.ts +4 -1
- package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +124 -58
- package/dist/views/CreateFirstUser/index.client.js.map +1 -1
- package/dist/views/CreateFirstUser/index.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.js +74 -46
- package/dist/views/CreateFirstUser/index.js.map +1 -1
- package/dist/views/CreateFirstUser/index.scss +18 -2
- package/dist/views/CreateFirstUser/meta.js +12 -8
- package/dist/views/CreateFirstUser/meta.js.map +1 -1
- package/dist/views/Dashboard/Default/index.d.ts +12 -3
- package/dist/views/Dashboard/Default/index.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/index.js +158 -115
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- package/dist/views/Dashboard/Default/index.scss +53 -42
- package/dist/views/Dashboard/index.d.ts.map +1 -1
- package/dist/views/Dashboard/index.js +87 -48
- 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.d.ts +1 -1
- package/dist/views/Document/getCustomViewByKey.d.ts.map +1 -1
- package/dist/views/Document/getCustomViewByKey.js +2 -4
- package/dist/views/Document/getCustomViewByKey.js.map +1 -1
- package/dist/views/Document/getCustomViewByRoute.d.ts +5 -2
- package/dist/views/Document/getCustomViewByRoute.d.ts.map +1 -1
- package/dist/views/Document/getCustomViewByRoute.js +30 -17
- package/dist/views/Document/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Document/getDocPreferences.d.ts +11 -0
- package/dist/views/Document/getDocPreferences.d.ts.map +1 -0
- package/dist/views/Document/getDocPreferences.js +44 -0
- package/dist/views/Document/getDocPreferences.js.map +1 -0
- package/dist/views/Document/getDocumentData.d.ts +10 -7
- package/dist/views/Document/getDocumentData.d.ts.map +1 -1
- package/dist/views/Document/getDocumentData.js +36 -28
- package/dist/views/Document/getDocumentData.js.map +1 -1
- package/dist/views/Document/getDocumentPermissions.d.ts.map +1 -1
- package/dist/views/Document/getDocumentPermissions.js +84 -74
- package/dist/views/Document/getDocumentPermissions.js.map +1 -1
- package/dist/views/Document/getIsLocked.d.ts +17 -0
- package/dist/views/Document/getIsLocked.d.ts.map +1 -0
- package/dist/views/Document/getIsLocked.js +54 -0
- package/dist/views/Document/getIsLocked.js.map +1 -0
- package/dist/views/Document/getMetaBySegment.d.ts +6 -5
- package/dist/views/Document/getMetaBySegment.d.ts.map +1 -1
- package/dist/views/Document/getMetaBySegment.js +114 -63
- package/dist/views/Document/getMetaBySegment.js.map +1 -1
- package/dist/views/Document/getVersions.d.ts +19 -0
- package/dist/views/Document/getVersions.d.ts.map +1 -0
- package/dist/views/Document/getVersions.js +181 -0
- package/dist/views/Document/getVersions.js.map +1 -0
- package/dist/views/Document/getViewsFromConfig.d.ts +18 -7
- package/dist/views/Document/getViewsFromConfig.d.ts.map +1 -1
- package/dist/views/Document/getViewsFromConfig.js +314 -226
- package/dist/views/Document/getViewsFromConfig.js.map +1 -1
- package/dist/views/Document/handleServerFunction.d.ts +24 -0
- package/dist/views/Document/handleServerFunction.d.ts.map +1 -0
- package/dist/views/Document/handleServerFunction.js +156 -0
- package/dist/views/Document/handleServerFunction.js.map +1 -0
- package/dist/views/Document/index.d.ts +5 -1
- package/dist/views/Document/index.d.ts.map +1 -1
- package/dist/views/Document/index.js +304 -170
- 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/Document/renderDocumentSlots.d.ts +12 -0
- package/dist/views/Document/renderDocumentSlots.d.ts.map +1 -0
- package/dist/views/Document/renderDocumentSlots.js +92 -0
- package/dist/views/Document/renderDocumentSlots.js.map +1 -0
- package/dist/views/Edit/index.d.ts +3 -2
- package/dist/views/Edit/index.d.ts.map +1 -1
- package/dist/views/Edit/index.js +7 -4
- package/dist/views/Edit/index.js.map +1 -1
- package/dist/views/Edit/meta.d.ts.map +1 -1
- package/dist/views/Edit/meta.js +43 -24
- 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.d.ts.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +159 -67
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
- package/dist/views/ForgotPassword/index.d.ts.map +1 -1
- package/dist/views/ForgotPassword/index.js +63 -40
- 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/handleServerFunction.d.ts +26 -0
- package/dist/views/List/handleServerFunction.d.ts.map +1 -0
- package/dist/views/List/handleServerFunction.js +155 -0
- package/dist/views/List/handleServerFunction.js.map +1 -0
- package/dist/views/List/index.d.ts +12 -2
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js +200 -115
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/List/meta.d.ts +2 -2
- package/dist/views/List/meta.d.ts.map +1 -1
- package/dist/views/List/meta.js +20 -17
- package/dist/views/List/meta.js.map +1 -1
- package/dist/views/List/renderListViewSlots.d.ts +8 -0
- package/dist/views/List/renderListViewSlots.d.ts.map +1 -0
- package/dist/views/List/renderListViewSlots.js +44 -0
- package/dist/views/List/renderListViewSlots.js.map +1 -0
- 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 +3 -2
- 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.d.ts +3 -3
- package/dist/views/LivePreview/Context/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Context/index.js +136 -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 +83 -72
- 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/IFrame/index.scss +8 -6
- package/dist/views/LivePreview/Preview/index.js +147 -94
- package/dist/views/LivePreview/Preview/index.js.map +1 -1
- package/dist/views/LivePreview/Preview/index.scss +32 -30
- package/dist/views/LivePreview/Toolbar/Controls/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.js +137 -116
- package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.scss +49 -47
- package/dist/views/LivePreview/Toolbar/SizeInput/index.d.ts.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/SizeInput/index.scss +11 -9
- package/dist/views/LivePreview/Toolbar/index.d.ts +2 -2
- package/dist/views/LivePreview/Toolbar/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Toolbar/index.js +83 -51
- package/dist/views/LivePreview/Toolbar/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/index.scss +33 -31
- package/dist/views/LivePreview/ToolbarArea/index.js +32 -10
- package/dist/views/LivePreview/ToolbarArea/index.js.map +1 -1
- package/dist/views/LivePreview/ToolbarArea/index.scss +5 -3
- package/dist/views/LivePreview/index.client.d.ts +3 -3
- package/dist/views/LivePreview/index.client.d.ts.map +1 -1
- package/dist/views/LivePreview/index.client.js +359 -180
- package/dist/views/LivePreview/index.client.js.map +1 -1
- package/dist/views/LivePreview/index.d.ts +2 -2
- package/dist/views/LivePreview/index.d.ts.map +1 -1
- package/dist/views/LivePreview/index.js +67 -55
- package/dist/views/LivePreview/index.js.map +1 -1
- package/dist/views/LivePreview/index.scss +48 -46
- package/dist/views/LivePreview/meta.d.ts.map +1 -1
- package/dist/views/LivePreview/meta.js +14 -8
- package/dist/views/LivePreview/meta.js.map +1 -1
- package/dist/views/LivePreview/usePopupWindow.d.ts +3 -2
- package/dist/views/LivePreview/usePopupWindow.d.ts.map +1 -1
- package/dist/views/LivePreview/usePopupWindow.js +134 -92
- package/dist/views/LivePreview/usePopupWindow.js.map +1 -1
- package/dist/views/Login/LoginField/index.d.ts +9 -0
- package/dist/views/Login/LoginField/index.d.ts.map +1 -0
- package/dist/views/Login/LoginField/index.js +95 -0
- package/dist/views/Login/LoginField/index.js.map +1 -0
- package/dist/views/Login/LoginForm/index.d.ts +3 -0
- package/dist/views/Login/LoginForm/index.d.ts.map +1 -1
- package/dist/views/Login/LoginForm/index.js +153 -81
- package/dist/views/Login/LoginForm/index.js.map +1 -1
- package/dist/views/Login/LoginForm/index.scss +8 -6
- package/dist/views/Login/index.d.ts.map +1 -1
- package/dist/views/Login/index.js +84 -54
- package/dist/views/Login/index.js.map +1 -1
- package/dist/views/Login/index.scss +8 -6
- package/dist/views/Login/meta.js +12 -8
- package/dist/views/Login/meta.js.map +1 -1
- package/dist/views/Logout/LogoutClient.d.ts +1 -0
- package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
- package/dist/views/Logout/LogoutClient.js +112 -37
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/Logout/index.d.ts +2 -2
- package/dist/views/Logout/index.d.ts.map +1 -1
- package/dist/views/Logout/index.js +29 -16
- package/dist/views/Logout/index.js.map +1 -1
- package/dist/views/Logout/index.scss +19 -14
- package/dist/views/Logout/meta.js +11 -7
- package/dist/views/Logout/meta.js.map +1 -1
- package/dist/views/NotFound/index.client.d.ts.map +1 -1
- package/dist/views/NotFound/index.client.js +82 -40
- package/dist/views/NotFound/index.client.js.map +1 -1
- package/dist/views/NotFound/index.d.ts +8 -7
- package/dist/views/NotFound/index.d.ts.map +1 -1
- package/dist/views/NotFound/index.js +55 -44
- package/dist/views/NotFound/index.js.map +1 -1
- package/dist/views/NotFound/index.scss +41 -21
- package/dist/views/NotFound/meta.d.ts +2 -2
- package/dist/views/NotFound/meta.d.ts.map +1 -1
- package/dist/views/NotFound/meta.js +9 -7
- package/dist/views/NotFound/meta.js.map +1 -1
- package/dist/views/ResetPassword/ResetPasswordForm/index.d.ts +7 -0
- package/dist/views/ResetPassword/ResetPasswordForm/index.d.ts.map +1 -0
- package/dist/views/ResetPassword/ResetPasswordForm/index.js +124 -0
- package/dist/views/ResetPassword/ResetPasswordForm/index.js.map +1 -0
- package/dist/views/ResetPassword/index.d.ts.map +1 -1
- package/dist/views/ResetPassword/index.js +76 -54
- package/dist/views/ResetPassword/index.js.map +1 -1
- package/dist/views/ResetPassword/index.scss +9 -3
- package/dist/views/ResetPassword/meta.js +12 -8
- package/dist/views/ResetPassword/meta.js.map +1 -1
- package/dist/views/Root/generateCustomViewMetadata.d.ts +11 -0
- package/dist/views/Root/generateCustomViewMetadata.d.ts.map +1 -0
- package/dist/views/Root/generateCustomViewMetadata.js +25 -0
- package/dist/views/Root/generateCustomViewMetadata.js.map +1 -0
- package/dist/views/Root/getCustomViewByRoute.d.ts +7 -2
- package/dist/views/Root/getCustomViewByRoute.d.ts.map +1 -1
- package/dist/views/Root/getCustomViewByRoute.js +45 -16
- package/dist/views/Root/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Root/getViewFromConfig.d.ts +13 -5
- package/dist/views/Root/getViewFromConfig.d.ts.map +1 -1
- package/dist/views/Root/getViewFromConfig.js +277 -135
- package/dist/views/Root/getViewFromConfig.js.map +1 -1
- package/dist/views/Root/index.d.ts +10 -9
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Root/index.js +124 -64
- package/dist/views/Root/index.js.map +1 -1
- package/dist/views/Root/isPathMatchingRoute.d.ts.map +1 -1
- package/dist/views/Root/isPathMatchingRoute.js +22 -13
- package/dist/views/Root/isPathMatchingRoute.js.map +1 -1
- package/dist/views/Root/meta.d.ts +5 -5
- package/dist/views/Root/meta.d.ts.map +1 -1
- package/dist/views/Root/meta.js +144 -121
- package/dist/views/Root/meta.js.map +1 -1
- package/dist/views/Unauthorized/index.d.ts +2 -2
- package/dist/views/Unauthorized/index.d.ts.map +1 -1
- package/dist/views/Unauthorized/index.js +40 -22
- package/dist/views/Unauthorized/index.js.map +1 -1
- package/dist/views/Unauthorized/index.scss +4 -31
- package/dist/views/Unauthorized/meta.js +12 -8
- package/dist/views/Unauthorized/meta.js.map +1 -1
- package/dist/views/Verify/index.client.d.ts +7 -0
- package/dist/views/Verify/index.client.d.ts.map +1 -0
- package/dist/views/Verify/index.client.js +46 -0
- package/dist/views/Verify/index.client.js.map +1 -0
- package/dist/views/Verify/index.d.ts.map +1 -1
- package/dist/views/Verify/index.js +62 -38
- package/dist/views/Verify/index.js.map +1 -1
- package/dist/views/Verify/index.scss +13 -11
- 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 +8 -10
- package/dist/views/Version/Default/SetStepNav.d.ts.map +1 -1
- package/dist/views/Version/Default/SetStepNav.js +150 -91
- package/dist/views/Version/Default/SetStepNav.js.map +1 -1
- package/dist/views/Version/Default/index.d.ts.map +1 -1
- package/dist/views/Version/Default/index.js +199 -120
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/Default/index.scss +52 -50
- package/dist/views/Version/Default/types.d.ts +8 -8
- package/dist/views/Version/Default/types.d.ts.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/Label/index.scss +5 -3
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts +2 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +68 -70
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.scss +29 -27
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts +2 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +35 -32
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.scss +11 -9
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts +3 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +114 -64
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.scss +12 -10
- 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 +3 -6
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +42 -38
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.scss +12 -10
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts +3 -5
- 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 +3 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +39 -30
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.scss +12 -10
- 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.d.ts +21 -55
- package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js +22 -22
- 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.d.ts +15 -16
- package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts.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.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.js +107 -94
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.scss +12 -10
- package/dist/views/Version/RenderFieldsToDiff/types.d.ts +11 -12
- package/dist/views/Version/RenderFieldsToDiff/types.d.ts.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.d.ts.map +1 -1
- package/dist/views/Version/Restore/index.js +112 -80
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/Restore/index.scss +67 -18
- package/dist/views/Version/Restore/types.d.ts +1 -0
- package/dist/views/Version/Restore/types.d.ts.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.d.ts.map +1 -1
- package/dist/views/Version/SelectComparison/index.js +155 -119
- package/dist/views/Version/SelectComparison/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/index.scss +12 -10
- package/dist/views/Version/SelectComparison/types.d.ts +3 -1
- package/dist/views/Version/SelectComparison/types.d.ts.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.d.ts.map +1 -1
- package/dist/views/Version/SelectLocales/index.js +59 -31
- package/dist/views/Version/SelectLocales/index.js.map +1 -1
- package/dist/views/Version/SelectLocales/index.scss +6 -4
- package/dist/views/Version/SelectLocales/types.js +1 -2
- package/dist/views/Version/SelectLocales/types.js.map +1 -1
- package/dist/views/Version/index.d.ts +2 -2
- package/dist/views/Version/index.d.ts.map +1 -1
- package/dist/views/Version/index.js +130 -95
- package/dist/views/Version/index.js.map +1 -1
- package/dist/views/Version/meta.d.ts.map +1 -1
- package/dist/views/Version/meta.js +50 -39
- package/dist/views/Version/meta.js.map +1 -1
- package/dist/views/Versions/buildColumns.d.ts +6 -3
- package/dist/views/Versions/buildColumns.d.ts.map +1 -1
- package/dist/views/Versions/buildColumns.js +75 -56
- package/dist/views/Versions/buildColumns.js.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.d.ts +14 -1
- package/dist/views/Versions/cells/AutosaveCell/index.d.ts.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.js +112 -28
- package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.d.ts +4 -0
- package/dist/views/Versions/cells/CreatedAt/index.d.ts.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.js +75 -17
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
- package/dist/views/Versions/cells/ID/index.d.ts +3 -1
- package/dist/views/Versions/cells/ID/index.d.ts.map +1 -1
- package/dist/views/Versions/cells/ID/index.js +8 -8
- package/dist/views/Versions/cells/ID/index.js.map +1 -1
- package/dist/views/Versions/getLatestVersion.d.ts +15 -0
- package/dist/views/Versions/getLatestVersion.d.ts.map +1 -0
- package/dist/views/Versions/getLatestVersion.js +49 -0
- package/dist/views/Versions/getLatestVersion.js.map +1 -0
- package/dist/views/Versions/index.client.d.ts +5 -5
- package/dist/views/Versions/index.client.d.ts.map +1 -1
- package/dist/views/Versions/index.client.js +82 -74
- package/dist/views/Versions/index.client.js.map +1 -1
- package/dist/views/Versions/index.d.ts +2 -2
- package/dist/views/Versions/index.d.ts.map +1 -1
- package/dist/views/Versions/index.js +173 -88
- package/dist/views/Versions/index.js.map +1 -1
- package/dist/views/Versions/index.scss +78 -76
- package/dist/views/Versions/meta.d.ts.map +1 -1
- package/dist/views/Versions/meta.js +44 -33
- 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.d.ts +1 -1
- package/dist/withPayload.d.ts.map +1 -1
- package/dist/withPayload.js +91 -110
- package/dist/withPayload.js.map +1 -1
- package/package.json +71 -39
- package/dist/elements/LeaveWithoutSaving/index.d.ts +0 -4
- package/dist/elements/LeaveWithoutSaving/index.d.ts.map +0 -1
- package/dist/elements/LeaveWithoutSaving/index.js +0 -86
- package/dist/elements/LeaveWithoutSaving/index.js.map +0 -1
- package/dist/elements/LeaveWithoutSaving/index.scss +0 -36
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts +0 -8
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts.map +0 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js +0 -114
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +0 -1
- package/dist/prod/index.js +0 -55
- package/dist/prod/payload/payload-favicon-dark.png +0 -0
- package/dist/prod/payload/payload-favicon-light.png +0 -0
- package/dist/prod/payload/static-og-image.png +0 -0
- package/dist/routes/rest/buildFormState.d.ts +0 -5
- package/dist/routes/rest/buildFormState.d.ts.map +0 -1
- package/dist/routes/rest/buildFormState.js +0 -45
- package/dist/routes/rest/buildFormState.js.map +0 -1
- package/dist/views/Edit/Default/Auth/APIKey.d.ts +0 -6
- package/dist/views/Edit/Default/Auth/APIKey.d.ts.map +0 -1
- package/dist/views/Edit/Default/Auth/APIKey.js +0 -116
- package/dist/views/Edit/Default/Auth/APIKey.js.map +0 -1
- package/dist/views/Edit/Default/Auth/index.d.ts +0 -5
- package/dist/views/Edit/Default/Auth/index.d.ts.map +0 -1
- package/dist/views/Edit/Default/Auth/index.js +0 -154
- package/dist/views/Edit/Default/Auth/index.js.map +0 -1
- package/dist/views/Edit/Default/Auth/index.scss +0 -61
- package/dist/views/Edit/Default/Auth/types.d.ts +0 -13
- package/dist/views/Edit/Default/Auth/types.d.ts.map +0 -1
- package/dist/views/Edit/Default/Auth/types.js +0 -3
- package/dist/views/Edit/Default/Auth/types.js.map +0 -1
- package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts +0 -12
- package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts.map +0 -1
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js +0 -69
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js.map +0 -1
- package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts +0 -9
- package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts.map +0 -1
- package/dist/views/Edit/Default/SetDocumentTitle/index.js +0 -36
- package/dist/views/Edit/Default/SetDocumentTitle/index.js.map +0 -1
- package/dist/views/Edit/Default/index.d.ts +0 -4
- package/dist/views/Edit/Default/index.d.ts.map +0 -1
- package/dist/views/Edit/Default/index.js +0 -193
- package/dist/views/Edit/Default/index.js.map +0 -1
- package/dist/views/Edit/Default/index.scss +0 -21
- package/dist/views/Edit/Default/types.d.ts +0 -6
- package/dist/views/Edit/Default/types.d.ts.map +0 -1
- package/dist/views/Edit/Default/types.js +0 -3
- package/dist/views/Edit/Default/types.js.map +0 -1
- package/dist/views/Edit/index.client.d.ts +0 -3
- package/dist/views/Edit/index.client.d.ts.map +0 -1
- package/dist/views/Edit/index.client.js +0 -25
- package/dist/views/Edit/index.client.js.map +0 -1
- package/dist/views/List/Default/index.d.ts +0 -4
- package/dist/views/List/Default/index.d.ts.map +0 -1
- package/dist/views/List/Default/index.js +0 -200
- package/dist/views/List/Default/index.js.map +0 -1
- package/dist/views/List/Default/index.scss +0 -195
- package/dist/views/List/Default/types.d.ts +0 -15
- package/dist/views/List/Default/types.d.ts.map +0 -1
- package/dist/views/List/Default/types.js +0 -3
- package/dist/views/List/Default/types.js.map +0 -1
- package/dist/views/ResetPassword/index.client.d.ts +0 -7
- package/dist/views/ResetPassword/index.client.d.ts.map +0 -1
- package/dist/views/ResetPassword/index.client.js +0 -81
- package/dist/views/ResetPassword/index.client.js.map +0 -1
- package/dist/views/Version/shared.d.ts +0 -9
- package/dist/views/Version/shared.d.ts.map +0 -1
- package/dist/views/Version/shared.js +0 -10
- package/dist/views/Version/shared.js.map +0 -1
- package/dist/webpackEntry.d.ts +0 -5
- package/dist/webpackEntry.d.ts.map +0 -1
- package/dist/webpackEntry.js +0 -6
- package/dist/webpackEntry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/views/Dashboard/Default/index.tsx"],"sourcesContent":["import type { groupNavItems } from '@payloadcms/ui/shared'\nimport type { Permissions, ServerProps, VisibleEntities } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { Button, Card, Gutter, SetStepNav, SetViewActions } from '@payloadcms/ui/client'\nimport { EntityType, WithServerSideProps } from '@payloadcms/ui/shared'\nimport React, { Fragment } from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'dashboard'\n\nexport type DashboardProps = ServerProps & {\n Link: React.ComponentType<any>\n navGroups?: ReturnType<typeof groupNavItems>\n permissions: Permissions\n visibleEntities: VisibleEntities\n}\n\nexport const DefaultDashboard: React.FC<DashboardProps> = (props) => {\n const {\n Link,\n i18n,\n i18n: { t },\n locale,\n navGroups,\n params,\n payload: {\n config: {\n admin: {\n components: { afterDashboard, beforeDashboard },\n },\n routes: { admin: adminRoute },\n },\n },\n payload,\n permissions,\n searchParams,\n user,\n } = props\n\n const BeforeDashboards = Array.isArray(beforeDashboard)\n ? beforeDashboard.map((Component, i) => (\n <WithServerSideProps\n Component={Component}\n key={i}\n serverOnlyProps={{\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n }}\n />\n ))\n : null\n\n const AfterDashboards = Array.isArray(afterDashboard)\n ? afterDashboard.map((Component, i) => (\n <WithServerSideProps\n Component={Component}\n key={i}\n serverOnlyProps={{\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n }}\n />\n ))\n : null\n\n return (\n <div className={baseClass}>\n <SetStepNav nav={[]} />\n <SetViewActions actions={[]} />\n <Gutter className={`${baseClass}__wrap`}>\n {Array.isArray(BeforeDashboards) && BeforeDashboards.map((Component) => Component)}\n <Fragment>\n <SetViewActions actions={[]} />\n {!navGroups || navGroups?.length === 0 ? (\n <p>no nav groups....</p>\n ) : (\n navGroups.map(({ entities, label }, groupIndex) => {\n return (\n <div className={`${baseClass}__group`} key={groupIndex}>\n <h2 className={`${baseClass}__label`}>{label}</h2>\n <ul className={`${baseClass}__card-list`}>\n {entities.map(({ type, entity }, entityIndex) => {\n let title: string\n let buttonAriaLabel: string\n let createHREF: string\n let href: string\n let hasCreatePermission: boolean\n\n if (type === EntityType.collection) {\n title = getTranslation(entity.labels.plural, i18n)\n buttonAriaLabel = t('general:showAllLabel', { label: title })\n href = `${adminRoute}/collections/${entity.slug}`\n createHREF = `${adminRoute}/collections/${entity.slug}/create`\n hasCreatePermission =\n permissions?.collections?.[entity.slug]?.create?.permission\n }\n\n if (type === EntityType.global) {\n title = getTranslation(entity.label, i18n)\n buttonAriaLabel = t('general:editLabel', {\n label: getTranslation(entity.label, i18n),\n })\n href = `${adminRoute}/globals/${entity.slug}`\n }\n\n return (\n <li key={entityIndex}>\n <Card\n Link={Link}\n actions={\n hasCreatePermission && type === EntityType.collection ? (\n <Button\n Link={Link}\n aria-label={t('general:createNewLabel', {\n label: getTranslation(entity.labels.singular, i18n),\n })}\n buttonStyle=\"icon-label\"\n el=\"link\"\n icon=\"plus\"\n iconStyle=\"with-border\"\n round\n to={createHREF}\n />\n ) : undefined\n }\n buttonAriaLabel={buttonAriaLabel}\n href={href}\n id={`card-${entity.slug}`}\n title={title}\n titleAs=\"h3\"\n />\n </li>\n )\n })}\n </ul>\n </div>\n )\n })\n )}\n </Fragment>\n {Array.isArray(AfterDashboards) && AfterDashboards.map((Component) => Component)}\n </Gutter>\n </div>\n )\n}\n"],"names":["getTranslation","Button","Card","Gutter","SetStepNav","SetViewActions","EntityType","WithServerSideProps","React","Fragment","baseClass","DefaultDashboard","props","Link","i18n","t","locale","navGroups","params","payload","config","admin","components","afterDashboard","beforeDashboard","routes","adminRoute","permissions","searchParams","user","BeforeDashboards","Array","isArray","map","Component","i","serverOnlyProps","AfterDashboards","div","className","nav","actions","length","p","entities","label","groupIndex","h2","ul","type","entity","entityIndex","title","buttonAriaLabel","createHREF","href","hasCreatePermission","collection","labels","plural","slug","collections","create","permission","global","li","aria-label","singular","buttonStyle","el","icon","iconStyle","round","to","undefined","id","titleAs"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,SAASC,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAEC,UAAU,EAAEC,cAAc,QAAQ,wBAAuB;AACxF,SAASC,UAAU,EAAEC,mBAAmB,QAAQ,wBAAuB;AACvE,OAAOC,SAASC,QAAQ,QAAQ,QAAO;AAIvC,MAAMC,YAAY;AASlB,OAAO,MAAMC,mBAA6C,CAACC;IACzD,MAAM,EACJC,IAAI,EACJC,IAAI,EACJA,MAAM,EAAEC,CAAC,EAAE,EACXC,MAAM,EACNC,SAAS,EACTC,MAAM,EACNC,SAAS,EACPC,QAAQ,EACNC,OAAO,EACLC,YAAY,EAAEC,cAAc,EAAEC,eAAe,EAAE,EAChD,EACDC,QAAQ,EAAEJ,OAAOK,UAAU,EAAE,EAC9B,EACF,EACDP,OAAO,EACPQ,WAAW,EACXC,YAAY,EACZC,IAAI,EACL,GAAGjB;IAEJ,MAAMkB,mBAAmBC,MAAMC,OAAO,CAACR,mBACnCA,gBAAgBS,GAAG,CAAC,CAACC,WAAWC,kBAC9B,KAAC5B;YACC2B,WAAWA;YAEXE,iBAAiB;gBACftB;gBACAE;gBACAE;gBACAC;gBACAQ;gBACAC;gBACAC;YACF;WATKM,MAYT;IAEJ,MAAME,kBAAkBN,MAAMC,OAAO,CAACT,kBAClCA,eAAeU,GAAG,CAAC,CAACC,WAAWC,kBAC7B,KAAC5B;YACC2B,WAAWA;YAEXE,iBAAiB;gBACftB;gBACAE;gBACAE;gBACAC;gBACAQ;gBACAC;gBACAC;YACF;WATKM,MAYT;IAEJ,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D,eAAekD,OAAOL,KAAK,EAAE/B;oDACrCuC,kBAAkBtC,EAAE,qBAAqB;wDACvC8B,OAAO7C,eAAekD,OAAOL,KAAK,EAAE/B;oDACtC;oDACAyC,OAAO,CAAC,EAAE7B,WAAW,SAAS,EAAEwB,OAAOU,IAAI,CAAC,CAAC;gDAC/C;gDAEA,qBACE,KAACK;8DACC,cAAA,KAAC/D;wDACCW,MAAMA;wDACN4B,SACEe,uBAAuBP,SAAS3C,WAAWmD,UAAU,iBACnD,KAACxD;4DACCY,MAAMA;4DACNqD,cAAYnD,EAAE,0BAA0B;gEACtC8B,OAAO7C,eAAekD,OAAOQ,MAAM,CAACS,QAAQ,EAAErD;4DAChD;4DACAsD,aAAY;4DACZC,IAAG;4DACHC,MAAK;4DACLC,WAAU;4DACVC,KAAK;4DACLC,IAAInB;6DAEJoB;wDAENrB,iBAAiBA;wDACjBE,MAAMA;wDACNoB,IAAI,CAAC,KAAK,EAAEzB,OAAOU,IAAI,CAAC,CAAC;wDACzBR,OAAOA;wDACPwB,SAAQ;;mDAvBHzB;4CA2Bb;;;mCAvDwCL;4BA2DhD;;;oBAGHf,MAAMC,OAAO,CAACK,oBAAoBA,gBAAgBJ,GAAG,CAAC,CAACC,YAAcA;;;;;AAI9E,EAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["getTranslation","Button","Card","Gutter","Locked","RenderServerComponent","EntityType","formatAdminURL","React","Fragment","baseClass","DefaultDashboard","props","globalData","i18n","t","Link","locale","navGroups","params","payload","config","admin","components","afterDashboard","beforeDashboard","routes","adminRoute","permissions","searchParams","user","_jsx","className","_jsxs","Component","importMap","serverProps","length","map","entities","label","groupIndex","slug","type","entityIndex","title","buttonAriaLabel","createHREF","href","hasCreatePermission","isLocked","userEditing","collection","path","collections","create","permission","global","globalLockData","find","data","_isLocked","_userEditing","lockDuration","lastEditedAt","Date","_lastEditedAt","getTime","lockDurationInMilliseconds","lockExpirationTime","actions","id","buttonStyle","el","icon","iconStyle","round","to","undefined","titleAs"],"sources":["../../../../src/views/Dashboard/Default/index.tsx"],"sourcesContent":["import type { groupNavItems } from '@payloadcms/ui/shared'\nimport type { ClientUser, Permissions, ServerProps, VisibleEntities } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { Button, Card, Gutter, Locked } from '@payloadcms/ui'\nimport { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent'\nimport { EntityType, formatAdminURL } from '@payloadcms/ui/shared'\nimport React, { Fragment } from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'dashboard'\n\nexport type DashboardProps = {\n globalData: Array<{\n data: { _isLocked: boolean; _lastEditedAt: string; _userEditing: ClientUser | number | string }\n lockDuration?: number\n slug: string\n }>\n Link: React.ComponentType<any>\n navGroups?: ReturnType<typeof groupNavItems>\n permissions: Permissions\n visibleEntities: VisibleEntities\n} & ServerProps\n\nexport const DefaultDashboard: React.FC<DashboardProps> = (props) => {\n const {\n globalData,\n i18n,\n i18n: { t },\n Link,\n locale,\n navGroups,\n params,\n payload: {\n config: {\n admin: {\n components: { afterDashboard, beforeDashboard },\n },\n routes: { admin: adminRoute },\n },\n },\n payload,\n permissions,\n searchParams,\n user,\n } = props\n\n return (\n <div className={baseClass}>\n <Gutter className={`${baseClass}__wrap`}>\n {beforeDashboard && (\n <RenderServerComponent\n Component={beforeDashboard}\n importMap={payload.importMap}\n serverProps={{\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n }}\n />\n )}\n <Fragment>\n {!navGroups || navGroups?.length === 0 ? (\n <p>no nav groups....</p>\n ) : (\n navGroups.map(({ entities, label }, groupIndex) => {\n return (\n <div className={`${baseClass}__group`} key={groupIndex}>\n <h2 className={`${baseClass}__label`}>{label}</h2>\n <ul className={`${baseClass}__card-list`}>\n {entities.map(({ slug, type, label }, entityIndex) => {\n let title: string\n let buttonAriaLabel: string\n let createHREF: string\n let href: string\n let hasCreatePermission: boolean\n let isLocked = null\n let userEditing = null\n\n if (type === EntityType.collection) {\n title = getTranslation(label, i18n)\n\n buttonAriaLabel = t('general:showAllLabel', { label: title })\n\n href = formatAdminURL({ adminRoute, path: `/collections/${slug}` })\n\n createHREF = formatAdminURL({\n adminRoute,\n path: `/collections/${slug}/create`,\n })\n\n hasCreatePermission = permissions?.collections?.[slug]?.create?.permission\n }\n\n if (type === EntityType.global) {\n title = getTranslation(label, i18n)\n\n buttonAriaLabel = t('general:editLabel', {\n label: getTranslation(label, i18n),\n })\n\n href = formatAdminURL({\n adminRoute,\n path: `/globals/${slug}`,\n })\n\n // Find the lock status for the global\n const globalLockData = globalData.find((global) => global.slug === slug)\n if (globalLockData) {\n isLocked = globalLockData.data._isLocked\n userEditing = globalLockData.data._userEditing\n\n // Check if the lock is expired\n const lockDuration = globalLockData?.lockDuration\n const lastEditedAt = new Date(\n globalLockData.data?._lastEditedAt,\n ).getTime()\n\n const lockDurationInMilliseconds = lockDuration * 1000\n const lockExpirationTime = lastEditedAt + lockDurationInMilliseconds\n\n if (new Date().getTime() > lockExpirationTime) {\n isLocked = false\n userEditing = null\n }\n }\n }\n\n return (\n <li key={entityIndex}>\n <Card\n actions={\n isLocked && user?.id !== userEditing?.id ? (\n <Locked className={`${baseClass}__locked`} user={userEditing} />\n ) : hasCreatePermission && type === EntityType.collection ? (\n <Button\n aria-label={t('general:createNewLabel', {\n label,\n })}\n buttonStyle=\"icon-label\"\n el=\"link\"\n icon=\"plus\"\n iconStyle=\"with-border\"\n Link={Link}\n round\n to={createHREF}\n />\n ) : undefined\n }\n buttonAriaLabel={buttonAriaLabel}\n href={href}\n id={`card-${slug}`}\n Link={Link}\n title={getTranslation(label, i18n)}\n titleAs=\"h3\"\n />\n </li>\n )\n })}\n </ul>\n </div>\n )\n })\n )}\n </Fragment>\n {afterDashboard && (\n <RenderServerComponent\n Component={afterDashboard}\n importMap={payload.importMap}\n serverProps={{\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n }}\n />\n )}\n </Gutter>\n </div>\n )\n}\n"],"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AAA,EAAMA,IAAA;oBACN6B,KAAA,EAAO7C,cAAA,CAAewC,KAAA,EAAO1B,IAAA;oBAC7BiE,OAAA,EAAQ;;mBAzBHnC,WAAA;cA6Bb;;aA3FwCH,UAAA;QA+FhD;UAGHjB,cAAA,iBACCO,IAAA,CAAC1B,qBAAA;QACC6B,SAAA,EAAWV,cAAA;QACXW,SAAA,EAAWf,OAAA,CAAQe,SAAS;QAC5BC,WAAA,EAAa;UACXtB,IAAA;UACAG,MAAA;UACAE,MAAA;UACAC,OAAA;UACAQ,WAAA;UACAC,YAAA;UACAC;QACF;;;;AAMZ","ignoreList":[]}
|
|
@@ -1,58 +1,69 @@
|
|
|
1
1
|
@import '../../../scss/styles.scss';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
&__wrap {
|
|
9
|
-
padding-bottom: var(--spacing-view-bottom);
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
gap: var(--base);
|
|
13
|
-
}
|
|
3
|
+
@layer payload-default {
|
|
4
|
+
.dashboard {
|
|
5
|
+
width: 100%;
|
|
6
|
+
--gap: var(--base);
|
|
7
|
+
--cols: 5;
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
&__wrap {
|
|
10
|
+
padding-bottom: var(--spacing-view-bottom);
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: var(--base);
|
|
14
|
+
}
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
&__group {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
gap: var(--gap);
|
|
20
|
+
}
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
list-style: none;
|
|
29
|
-
display: flex;
|
|
30
|
-
gap: var(--gap);
|
|
31
|
-
flex-wrap: wrap;
|
|
22
|
+
&__label {
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
32
25
|
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
&__card-list {
|
|
27
|
+
padding: 0;
|
|
28
|
+
margin: 0;
|
|
29
|
+
list-style: none;
|
|
30
|
+
gap: var(--gap);
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: repeat(var(--cols), 1fr);
|
|
33
|
+
|
|
34
|
+
.card {
|
|
35
|
+
height: 100%;
|
|
36
|
+
}
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
.
|
|
38
|
-
|
|
39
|
+
&__locked.locked {
|
|
40
|
+
align-items: unset;
|
|
41
|
+
justify-content: unset;
|
|
39
42
|
}
|
|
40
|
-
}
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
@include large-break {
|
|
45
|
+
--cols: 4;
|
|
46
|
+
}
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
@include mid-break {
|
|
49
|
+
--gap: var(--base);
|
|
50
|
+
--cols: 2;
|
|
51
|
+
}
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
@include small-break {
|
|
54
|
+
--cols: 2;
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
&__wrap {
|
|
57
|
+
gap: var(--base);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&__card-list {
|
|
61
|
+
gap: base(0.4);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@include extra-small-break {
|
|
66
|
+
--cols: 1;
|
|
56
67
|
}
|
|
57
68
|
}
|
|
58
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Dashboard/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Dashboard/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAM7C,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAA;AAIrD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA0H9C,CAAA"}
|
|
@@ -1,35 +1,95 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { HydrateAuthProvider, SetStepNav } from '@payloadcms/ui';
|
|
3
|
+
import { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent';
|
|
4
|
+
import { EntityType, groupNavItems } from '@payloadcms/ui/shared';
|
|
4
5
|
import LinkImport from 'next/link.js';
|
|
5
6
|
import React, { Fragment } from 'react';
|
|
6
7
|
import { DefaultDashboard } from './Default/index.js';
|
|
7
8
|
export { generateDashboardMetadata } from './meta.js';
|
|
8
9
|
const Link = LinkImport.default || LinkImport;
|
|
9
|
-
export const Dashboard = ({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
export const Dashboard = async ({
|
|
11
|
+
initPageResult,
|
|
12
|
+
params,
|
|
13
|
+
searchParams
|
|
14
|
+
}) => {
|
|
15
|
+
const {
|
|
16
|
+
locale,
|
|
17
|
+
permissions,
|
|
18
|
+
req: {
|
|
19
|
+
i18n,
|
|
20
|
+
payload: {
|
|
21
|
+
config
|
|
22
|
+
},
|
|
23
|
+
payload,
|
|
24
|
+
user
|
|
25
|
+
},
|
|
26
|
+
req,
|
|
27
|
+
visibleEntities
|
|
28
|
+
} = initPageResult;
|
|
29
|
+
const CustomDashboardComponent = config.admin.components?.views?.Dashboard;
|
|
30
|
+
const collections = config.collections.filter(collection => permissions?.collections?.[collection.slug]?.read?.permission && visibleEntities.collections.includes(collection.slug));
|
|
31
|
+
const globals = config.globals.filter(global => permissions?.globals?.[global.slug]?.read?.permission && visibleEntities.globals.includes(global.slug));
|
|
32
|
+
// Query locked global documents only if there are globals in the config
|
|
33
|
+
let globalData = [];
|
|
34
|
+
if (config.globals.length > 0) {
|
|
35
|
+
const lockedDocuments = await payload.find({
|
|
36
|
+
collection: 'payload-locked-documents',
|
|
37
|
+
depth: 1,
|
|
38
|
+
overrideAccess: false,
|
|
39
|
+
pagination: false,
|
|
40
|
+
req,
|
|
41
|
+
where: {
|
|
42
|
+
globalSlug: {
|
|
43
|
+
exists: true
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
// Map over globals to include `lockDuration` and lock data for each global slug
|
|
48
|
+
globalData = config.globals.map(global => {
|
|
49
|
+
const lockDurationDefault = 300;
|
|
50
|
+
const lockDuration = typeof global.lockDocuments === 'object' ? global.lockDocuments.duration : lockDurationDefault;
|
|
51
|
+
const lockedDoc = lockedDocuments.docs.find(doc => doc.globalSlug === global.slug);
|
|
52
|
+
return {
|
|
53
|
+
slug: global.slug,
|
|
54
|
+
data: {
|
|
55
|
+
_isLocked: !!lockedDoc,
|
|
56
|
+
_lastEditedAt: lockedDoc?.updatedAt ?? null,
|
|
57
|
+
_userEditing: lockedDoc?.user?.value ?? null
|
|
58
|
+
},
|
|
59
|
+
lockDuration
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
const navGroups = groupNavItems([...(collections.map(collection => {
|
|
64
|
+
const entityToGroup = {
|
|
65
|
+
type: EntityType.collection,
|
|
66
|
+
entity: collection
|
|
67
|
+
};
|
|
68
|
+
return entityToGroup;
|
|
69
|
+
}) ?? []), ...(globals.map(global => {
|
|
70
|
+
const entityToGroup = {
|
|
71
|
+
type: EntityType.global,
|
|
72
|
+
entity: global
|
|
73
|
+
};
|
|
74
|
+
return entityToGroup;
|
|
75
|
+
}) ?? [])], permissions, i18n);
|
|
76
|
+
return /*#__PURE__*/_jsxs(Fragment, {
|
|
77
|
+
children: [/*#__PURE__*/_jsx(HydrateAuthProvider, {
|
|
78
|
+
permissions: permissions
|
|
79
|
+
}), /*#__PURE__*/_jsx(SetStepNav, {
|
|
80
|
+
nav: []
|
|
81
|
+
}), /*#__PURE__*/_jsx(RenderServerComponent, {
|
|
82
|
+
clientProps: {
|
|
31
83
|
Link,
|
|
84
|
+
locale
|
|
85
|
+
},
|
|
86
|
+
Component: CustomDashboardComponent,
|
|
87
|
+
Fallback: DefaultDashboard,
|
|
88
|
+
importMap: payload.importMap,
|
|
89
|
+
serverProps: {
|
|
90
|
+
globalData,
|
|
32
91
|
i18n,
|
|
92
|
+
Link,
|
|
33
93
|
locale,
|
|
34
94
|
navGroups,
|
|
35
95
|
params,
|
|
@@ -38,29 +98,8 @@ export const Dashboard = ({ initPageResult, params, searchParams })=>{
|
|
|
38
98
|
searchParams,
|
|
39
99
|
user,
|
|
40
100
|
visibleEntities
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/*#__PURE__*/ _jsx(HydrateClientUser, {
|
|
45
|
-
permissions: permissions,
|
|
46
|
-
user: user
|
|
47
|
-
}),
|
|
48
|
-
/*#__PURE__*/ _jsx(RenderCustomComponent, {
|
|
49
|
-
CustomComponent: typeof CustomDashboardComponent === 'function' ? CustomDashboardComponent : undefined,
|
|
50
|
-
DefaultComponent: DefaultDashboard,
|
|
51
|
-
componentProps: viewComponentProps,
|
|
52
|
-
serverOnlyProps: {
|
|
53
|
-
i18n,
|
|
54
|
-
locale,
|
|
55
|
-
params,
|
|
56
|
-
payload,
|
|
57
|
-
permissions,
|
|
58
|
-
searchParams,
|
|
59
|
-
user
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
|
-
]
|
|
63
|
-
});
|
|
101
|
+
}
|
|
102
|
+
})]
|
|
103
|
+
});
|
|
64
104
|
};
|
|
65
|
-
|
|
66
105
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/Dashboard/index.tsx"],"sourcesContent":["import type { EntityToGroup } from '@payloadcms/ui/
|
|
1
|
+
{"version":3,"file":"index.js","names":["HydrateAuthProvider","SetStepNav","RenderServerComponent","EntityType","groupNavItems","LinkImport","React","Fragment","DefaultDashboard","generateDashboardMetadata","Link","default","Dashboard","initPageResult","params","searchParams","locale","permissions","req","i18n","payload","config","user","visibleEntities","CustomDashboardComponent","admin","components","views","collections","filter","collection","slug","read","permission","includes","globals","global","globalData","length","lockedDocuments","find","depth","overrideAccess","pagination","where","globalSlug","exists","map","lockDurationDefault","lockDuration","lockDocuments","duration","lockedDoc","docs","doc","data","_isLocked","_lastEditedAt","updatedAt","_userEditing","value","navGroups","entityToGroup","type","entity","_jsxs","_jsx","nav","clientProps","Component","Fallback","importMap","serverProps"],"sources":["../../../src/views/Dashboard/index.tsx"],"sourcesContent":["import type { EntityToGroup } from '@payloadcms/ui/shared'\nimport type { AdminViewProps } from 'payload'\n\nimport { HydrateAuthProvider, SetStepNav } from '@payloadcms/ui'\nimport { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent'\nimport { EntityType, groupNavItems } from '@payloadcms/ui/shared'\nimport LinkImport from 'next/link.js'\nimport React, { Fragment } from 'react'\n\nimport { DefaultDashboard } from './Default/index.js'\n\nexport { generateDashboardMetadata } from './meta.js'\n\nconst Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default\n\nexport const Dashboard: React.FC<AdminViewProps> = async ({\n initPageResult,\n params,\n searchParams,\n}) => {\n const {\n locale,\n permissions,\n req: {\n i18n,\n payload: { config },\n payload,\n user,\n },\n req,\n visibleEntities,\n } = initPageResult\n\n const CustomDashboardComponent = config.admin.components?.views?.Dashboard\n\n const collections = config.collections.filter(\n (collection) =>\n permissions?.collections?.[collection.slug]?.read?.permission &&\n visibleEntities.collections.includes(collection.slug),\n )\n\n const globals = config.globals.filter(\n (global) =>\n permissions?.globals?.[global.slug]?.read?.permission &&\n visibleEntities.globals.includes(global.slug),\n )\n\n // Query locked global documents only if there are globals in the config\n let globalData = []\n\n if (config.globals.length > 0) {\n const lockedDocuments = await payload.find({\n collection: 'payload-locked-documents',\n depth: 1,\n overrideAccess: false,\n pagination: false,\n req,\n where: {\n globalSlug: {\n exists: true,\n },\n },\n })\n\n // Map over globals to include `lockDuration` and lock data for each global slug\n globalData = config.globals.map((global) => {\n const lockDurationDefault = 300\n const lockDuration =\n typeof global.lockDocuments === 'object'\n ? global.lockDocuments.duration\n : lockDurationDefault\n\n const lockedDoc = lockedDocuments.docs.find((doc) => doc.globalSlug === global.slug)\n\n return {\n slug: global.slug,\n data: {\n _isLocked: !!lockedDoc,\n _lastEditedAt: lockedDoc?.updatedAt ?? null,\n _userEditing: lockedDoc?.user?.value ?? null,\n },\n lockDuration,\n }\n })\n }\n\n const navGroups = groupNavItems(\n [\n ...(collections.map((collection) => {\n const entityToGroup: EntityToGroup = {\n type: EntityType.collection,\n entity: collection,\n }\n\n return entityToGroup\n }) ?? []),\n ...(globals.map((global) => {\n const entityToGroup: EntityToGroup = {\n type: EntityType.global,\n entity: global,\n }\n\n return entityToGroup\n }) ?? []),\n ],\n permissions,\n i18n,\n )\n\n return (\n <Fragment>\n <HydrateAuthProvider permissions={permissions} />\n <SetStepNav nav={[]} />\n <RenderServerComponent\n clientProps={{\n Link,\n locale,\n }}\n Component={CustomDashboardComponent}\n Fallback={DefaultDashboard}\n importMap={payload.importMap}\n serverProps={{\n globalData,\n i18n,\n Link,\n locale,\n navGroups,\n params,\n payload,\n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EACT,EACD7C,WAAA,EACAE,IAAA;EAGF,oBACE8C,KAAA,CAAC1D,QAAA;4BACC2D,IAAA,CAAClE,mBAAA;MAAoBiB,WAAA,EAAaA;qBAClCiD,IAAA,CAACjE,UAAA;MAAWkE,GAAA,EAAK;qBACjBD,IAAA,CAAChE,qBAAA;MACCkE,WAAA,EAAa;QACX1D,IAAA;QACAM;MACF;MACAqD,SAAA,EAAW7C,wBAAA;MACX8C,QAAA,EAAU9D,gBAAA;MACV+D,SAAA,EAAWnD,OAAA,CAAQmD,SAAS;MAC5BC,WAAA,EAAa;QACXnC,UAAA;QACAlB,IAAA;QACAT,IAAA;QACAM,MAAA;QACA6C,SAAA;QACA/C,MAAA;QACAM,OAAA;QACAH,WAAA;QACAF,YAAA;QACAO,IAAA;QACAC;MACF;;;AAIR","ignoreList":[]}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { meta } from '../../utilities/meta.js';
|
|
2
|
-
export const generateDashboardMetadata = async ({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
export const generateDashboardMetadata = async ({
|
|
3
|
+
config,
|
|
4
|
+
i18n: {
|
|
5
|
+
t
|
|
6
|
+
}
|
|
7
|
+
}) => meta({
|
|
8
|
+
description: `${t('general:dashboard')} Payload`,
|
|
9
|
+
keywords: `${t('general:dashboard')}, Payload`,
|
|
10
|
+
serverURL: config.serverURL,
|
|
11
|
+
title: t('general:dashboard'),
|
|
12
|
+
...(config.admin.meta || {}),
|
|
13
|
+
openGraph: {
|
|
14
|
+
title: t('general:dashboard'),
|
|
15
|
+
...(config.admin.meta?.openGraph || {})
|
|
16
|
+
}
|
|
17
|
+
});
|
|
14
18
|
//# sourceMappingURL=meta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/Dashboard/meta.ts"],"sourcesContent":["import type { GenerateViewMetadata } from '../Root/index.js'\n\nimport { meta } from '../../utilities/meta.js'\n\nexport const generateDashboardMetadata: GenerateViewMetadata = async ({ config, i18n: { t } }) =>\n meta({\n description: `${t('general:dashboard')} Payload`,\n keywords: `${t('general:dashboard')}, Payload`,\n serverURL: config.serverURL,\n title: t('general:dashboard'),\n ...(config.admin.meta || {}),\n openGraph: {\n title: t('general:dashboard'),\n ...(config.admin.meta?.openGraph || {}),\n },\n })\n"],"
|
|
1
|
+
{"version":3,"file":"meta.js","names":["meta","generateDashboardMetadata","config","i18n","t","description","keywords","serverURL","title","admin","openGraph"],"sources":["../../../src/views/Dashboard/meta.ts"],"sourcesContent":["import type { GenerateViewMetadata } from '../Root/index.js'\n\nimport { meta } from '../../utilities/meta.js'\n\nexport const generateDashboardMetadata: GenerateViewMetadata = async ({ config, i18n: { t } }) =>\n meta({\n description: `${t('general:dashboard')} Payload`,\n keywords: `${t('general:dashboard')}, Payload`,\n serverURL: config.serverURL,\n title: t('general:dashboard'),\n ...(config.admin.meta || {}),\n openGraph: {\n title: t('general:dashboard'),\n ...(config.admin.meta?.openGraph || {}),\n },\n })\n"],"mappings":"AAEA,SAASA,IAAI,QAAQ;AAErB,OAAO,MAAMC,yBAAA,GAAkD,MAAAA,CAAO;EAAEC,MAAM;EAAEC,IAAA,EAAM;IAAEC;EAAC;AAAE,CAAE,KAC3FJ,IAAA,CAAK;EACHK,WAAA,EAAa,GAAGD,CAAA,CAAE,8BAA8B;EAChDE,QAAA,EAAU,GAAGF,CAAA,CAAE,+BAA+B;EAC9CG,SAAA,EAAWL,MAAA,CAAOK,SAAS;EAC3BC,KAAA,EAAOJ,CAAA,CAAE;EACT,IAAIF,MAAA,CAAOO,KAAK,CAACT,IAAI,IAAI,CAAC,CAAC;EAC3BU,SAAA,EAAW;IACTF,KAAA,EAAOJ,CAAA,CAAE;IACT,IAAIF,MAAA,CAAOO,KAAK,CAACT,IAAI,EAAEU,SAAA,IAAa,CAAC,CAAC;EACxC;AACF","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EditViewComponent, SanitizedCollectionConfig, SanitizedGlobalConfig } from 'payload';
|
|
2
|
-
export declare const getCustomViewByKey: (views: SanitizedCollectionConfig[
|
|
2
|
+
export declare const getCustomViewByKey: (views: SanitizedCollectionConfig["admin"]["components"]["views"] | SanitizedGlobalConfig["admin"]["components"]["views"], customViewKey: string) => EditViewComponent;
|
|
3
3
|
//# sourceMappingURL=getCustomViewByKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCustomViewByKey.d.ts","sourceRoot":"","sources":["../../../src/views/Document/getCustomViewByKey.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"getCustomViewByKey.d.ts","sourceRoot":"","sources":["../../../src/views/Document/getCustomViewByKey.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAElG,eAAO,MAAM,kBAAkB,UAEzB,yBAAyB,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,GACzD,qBAAqB,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,iBAC1C,MAAM,KACpB,iBAKF,CAAA"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return typeof views?.Edit === 'function' ? views?.Edit : typeof views?.Edit === 'object' && views?.Edit?.[customViewKey] && typeof views?.Edit?.[customViewKey] === 'function' ? views?.Edit?.[customViewKey] : views?.Edit?.[customViewKey] ? typeof views?.Edit?.[customViewKey] === 'object' && 'Component' in views.Edit[customViewKey] && isReactComponentOrFunction(views?.Edit?.[customViewKey].Component) && views?.Edit?.[customViewKey].Component : null;
|
|
1
|
+
export const getCustomViewByKey = (views, customViewKey) => {
|
|
2
|
+
return typeof views?.edit?.[customViewKey] === 'object' && 'Component' in views.edit[customViewKey] ? views?.edit?.[customViewKey].Component : null;
|
|
4
3
|
};
|
|
5
|
-
|
|
6
4
|
//# sourceMappingURL=getCustomViewByKey.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/Document/getCustomViewByKey.tsx"],"sourcesContent":["import type { EditViewComponent, SanitizedCollectionConfig, SanitizedGlobalConfig } from 'payload'\n\
|
|
1
|
+
{"version":3,"file":"getCustomViewByKey.js","names":["getCustomViewByKey","views","customViewKey","edit","Component"],"sources":["../../../src/views/Document/getCustomViewByKey.tsx"],"sourcesContent":["import type { EditViewComponent, SanitizedCollectionConfig, SanitizedGlobalConfig } from 'payload'\n\nexport const getCustomViewByKey = (\n views:\n | SanitizedCollectionConfig['admin']['components']['views']\n | SanitizedGlobalConfig['admin']['components']['views'],\n customViewKey: string,\n): EditViewComponent => {\n return typeof views?.edit?.[customViewKey] === 'object' &&\n 'Component' in views.edit[customViewKey]\n ? views?.edit?.[customViewKey].Component\n : null\n}\n"],"mappings":"AAEA,OAAO,MAAMA,kBAAA,GAAqBA,CAChCC,KAAA,EAGAC,aAAA;EAEA,OAAO,OAAOD,KAAA,EAAOE,IAAA,GAAOD,aAAA,CAAc,KAAK,YAC7C,eAAeD,KAAA,CAAME,IAAI,CAACD,aAAA,CAAc,GACtCD,KAAA,EAAOE,IAAA,GAAOD,aAAA,CAAc,CAACE,SAAA,GAC7B;AACN","ignoreList":[]}
|
|
@@ -2,6 +2,9 @@ import type { EditViewComponent, SanitizedCollectionConfig, SanitizedGlobalConfi
|
|
|
2
2
|
export declare const getCustomViewByRoute: ({ baseRoute, currentRoute, views, }: {
|
|
3
3
|
baseRoute: string;
|
|
4
4
|
currentRoute: string;
|
|
5
|
-
views: SanitizedCollectionConfig[
|
|
6
|
-
}) =>
|
|
5
|
+
views: SanitizedCollectionConfig["admin"]["components"]["views"] | SanitizedGlobalConfig["admin"]["components"]["views"];
|
|
6
|
+
}) => {
|
|
7
|
+
Component: EditViewComponent;
|
|
8
|
+
viewKey?: string;
|
|
9
|
+
};
|
|
7
10
|
//# sourceMappingURL=getCustomViewByRoute.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCustomViewByRoute.d.ts","sourceRoot":"","sources":["../../../src/views/Document/getCustomViewByRoute.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAIlG,eAAO,MAAM,oBAAoB,wCAI9B;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EACD,yBAAyB,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,GACzD,qBAAqB,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAA;CAC1D,KAAG,
|
|
1
|
+
{"version":3,"file":"getCustomViewByRoute.d.ts","sourceRoot":"","sources":["../../../src/views/Document/getCustomViewByRoute.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAIlG,eAAO,MAAM,oBAAoB,wCAI9B;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EACD,yBAAyB,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,GACzD,qBAAqB,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAA;CAC1D,KAAG;IACF,SAAS,EAAE,iBAAiB,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAA;CAoCjB,CAAA"}
|
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
import { isPathMatchingRoute } from '../Root/isPathMatchingRoute.js';
|
|
2
|
-
export const getCustomViewByRoute = ({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
export const getCustomViewByRoute = ({
|
|
3
|
+
baseRoute,
|
|
4
|
+
currentRoute,
|
|
5
|
+
views
|
|
6
|
+
}) => {
|
|
7
|
+
if (typeof views?.edit === 'object') {
|
|
8
|
+
let viewKey;
|
|
9
|
+
const foundViewConfig = Object.entries(views.edit).find(([key, view]) => {
|
|
10
|
+
if (typeof view === 'object' && 'path' in view) {
|
|
11
|
+
const viewPath = `${baseRoute}${view.path}`;
|
|
12
|
+
const isMatching = isPathMatchingRoute({
|
|
13
|
+
currentRoute,
|
|
14
|
+
exact: true,
|
|
15
|
+
path: viewPath
|
|
16
|
+
});
|
|
17
|
+
if (isMatching) {
|
|
18
|
+
viewKey = key;
|
|
17
19
|
}
|
|
20
|
+
return isMatching;
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
})?.[1];
|
|
24
|
+
if (foundViewConfig && 'Component' in foundViewConfig) {
|
|
25
|
+
return {
|
|
26
|
+
Component: foundViewConfig.Component,
|
|
27
|
+
viewKey
|
|
28
|
+
};
|
|
18
29
|
}
|
|
19
|
-
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
Component: null
|
|
33
|
+
};
|
|
20
34
|
};
|
|
21
|
-
|
|
22
35
|
//# sourceMappingURL=getCustomViewByRoute.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/Document/getCustomViewByRoute.tsx"],"sourcesContent":["import type { EditViewComponent, SanitizedCollectionConfig, SanitizedGlobalConfig } from 'payload'\n\nimport { isPathMatchingRoute } from '../Root/isPathMatchingRoute.js'\n\nexport const getCustomViewByRoute = ({\n baseRoute,\n currentRoute,\n views,\n}: {\n baseRoute: string\n currentRoute: string\n views:\n | SanitizedCollectionConfig['admin']['components']['views']\n | SanitizedGlobalConfig['admin']['components']['views']\n}): EditViewComponent => {\n if (typeof views?.
|
|
1
|
+
{"version":3,"file":"getCustomViewByRoute.js","names":["isPathMatchingRoute","getCustomViewByRoute","baseRoute","currentRoute","views","edit","viewKey","foundViewConfig","Object","entries","find","key","view","viewPath","path","isMatching","exact","Component"],"sources":["../../../src/views/Document/getCustomViewByRoute.tsx"],"sourcesContent":["import type { EditViewComponent, SanitizedCollectionConfig, SanitizedGlobalConfig } from 'payload'\n\nimport { isPathMatchingRoute } from '../Root/isPathMatchingRoute.js'\n\nexport const getCustomViewByRoute = ({\n baseRoute,\n currentRoute,\n views,\n}: {\n baseRoute: string\n currentRoute: string\n views:\n | SanitizedCollectionConfig['admin']['components']['views']\n | SanitizedGlobalConfig['admin']['components']['views']\n}): {\n Component: EditViewComponent\n viewKey?: string\n} => {\n if (typeof views?.edit === 'object') {\n let viewKey: string\n\n const foundViewConfig = Object.entries(views.edit).find(([key, view]) => {\n if (typeof view === 'object' && 'path' in view) {\n const viewPath = `${baseRoute}${view.path}`\n\n const isMatching = isPathMatchingRoute({\n currentRoute,\n exact: true,\n path: viewPath,\n })\n\n if (isMatching) {\n viewKey = key\n }\n\n return isMatching\n }\n\n return false\n })?.[1]\n\n if (foundViewConfig && 'Component' in foundViewConfig) {\n return {\n Component: foundViewConfig.Component,\n viewKey,\n }\n }\n }\n\n return {\n Component: null,\n }\n}\n"],"mappings":"AAEA,SAASA,mBAAmB,QAAQ;AAEpC,OAAO,MAAMC,oBAAA,GAAuBA,CAAC;EACnCC,SAAS;EACTC,YAAY;EACZC;AAAK,CAON;EAIC,IAAI,OAAOA,KAAA,EAAOC,IAAA,KAAS,UAAU;IACnC,IAAIC,OAAA;IAEJ,MAAMC,eAAA,GAAkBC,MAAA,CAAOC,OAAO,CAACL,KAAA,CAAMC,IAAI,EAAEK,IAAI,CAAC,CAAC,CAACC,GAAA,EAAKC,IAAA,CAAK;MAClE,IAAI,OAAOA,IAAA,KAAS,YAAY,UAAUA,IAAA,EAAM;QAC9C,MAAMC,QAAA,GAAW,GAAGX,SAAA,GAAYU,IAAA,CAAKE,IAAI,EAAE;QAE3C,MAAMC,UAAA,GAAaf,mBAAA,CAAoB;UACrCG,YAAA;UACAa,KAAA,EAAO;UACPF,IAAA,EAAMD;QACR;QAEA,IAAIE,UAAA,EAAY;UACdT,OAAA,GAAUK,GAAA;QACZ;QAEA,OAAOI,UAAA;MACT;MAEA,OAAO;IACT,KAAK,EAAE;IAEP,IAAIR,eAAA,IAAmB,eAAeA,eAAA,EAAiB;MACrD,OAAO;QACLU,SAAA,EAAWV,eAAA,CAAgBU,SAAS;QACpCX;MACF;IACF;EACF;EAEA,OAAO;IACLW,SAAA,EAAW;EACb;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DocumentPreferences, Payload, TypedUser } from 'payload';
|
|
2
|
+
type Args = {
|
|
3
|
+
collectionSlug?: string;
|
|
4
|
+
globalSlug?: string;
|
|
5
|
+
id?: number | string;
|
|
6
|
+
payload: Payload;
|
|
7
|
+
user: TypedUser;
|
|
8
|
+
};
|
|
9
|
+
export declare const getDocPreferences: ({ id, collectionSlug, globalSlug, payload, user, }: Args) => Promise<DocumentPreferences>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=getDocPreferences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDocPreferences.d.ts","sourceRoot":"","sources":["../../../src/views/Document/getDocPreferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEtE,KAAK,IAAI,GAAG;IACV,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,SAAS,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,iBAAiB,uDAM3B,IAAI,KAAG,OAAO,CAAC,mBAAmB,CA2CpC,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export const getDocPreferences = async ({
|
|
2
|
+
id,
|
|
3
|
+
collectionSlug,
|
|
4
|
+
globalSlug,
|
|
5
|
+
payload,
|
|
6
|
+
user
|
|
7
|
+
}) => {
|
|
8
|
+
let preferencesKey;
|
|
9
|
+
if (collectionSlug && id) {
|
|
10
|
+
preferencesKey = `collection-${collectionSlug}-${id}`;
|
|
11
|
+
}
|
|
12
|
+
if (globalSlug) {
|
|
13
|
+
preferencesKey = `global-${globalSlug}`;
|
|
14
|
+
}
|
|
15
|
+
if (preferencesKey) {
|
|
16
|
+
const preferencesResult = await payload.find({
|
|
17
|
+
collection: 'payload-preferences',
|
|
18
|
+
depth: 0,
|
|
19
|
+
limit: 1,
|
|
20
|
+
where: {
|
|
21
|
+
and: [{
|
|
22
|
+
key: {
|
|
23
|
+
equals: preferencesKey
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
'user.relationTo': {
|
|
27
|
+
equals: user.collection
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
'user.value': {
|
|
31
|
+
equals: user.id
|
|
32
|
+
}
|
|
33
|
+
}]
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
if (preferencesResult?.docs?.[0]?.value) {
|
|
37
|
+
return preferencesResult.docs[0].value;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
fields: {}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=getDocPreferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDocPreferences.js","names":["getDocPreferences","id","collectionSlug","globalSlug","payload","user","preferencesKey","preferencesResult","find","collection","depth","limit","where","and","key","equals","docs","value","fields"],"sources":["../../../src/views/Document/getDocPreferences.ts"],"sourcesContent":["import type { DocumentPreferences, Payload, TypedUser } from 'payload'\n\ntype Args = {\n collectionSlug?: string\n globalSlug?: string\n id?: number | string\n payload: Payload\n user: TypedUser\n}\n\nexport const getDocPreferences = async ({\n id,\n collectionSlug,\n globalSlug,\n payload,\n user,\n}: Args): Promise<DocumentPreferences> => {\n let preferencesKey\n\n if (collectionSlug && id) {\n preferencesKey = `collection-${collectionSlug}-${id}`\n }\n\n if (globalSlug) {\n preferencesKey = `global-${globalSlug}`\n }\n\n if (preferencesKey) {\n const preferencesResult = (await payload.find({\n collection: 'payload-preferences',\n depth: 0,\n limit: 1,\n where: {\n and: [\n {\n key: {\n equals: preferencesKey,\n },\n },\n {\n 'user.relationTo': {\n equals: user.collection,\n },\n },\n {\n 'user.value': {\n equals: user.id,\n },\n },\n ],\n },\n })) as unknown as { docs: { value: DocumentPreferences }[] }\n\n if (preferencesResult?.docs?.[0]?.value) {\n return preferencesResult.docs[0].value\n }\n }\n\n return { fields: {} }\n}\n"],"mappings":"AAUA,OAAO,MAAMA,iBAAA,GAAoB,MAAAA,CAAO;EACtCC,EAAE;EACFC,cAAc;EACdC,UAAU;EACVC,OAAO;EACPC;AAAI,CACC;EACL,IAAIC,cAAA;EAEJ,IAAIJ,cAAA,IAAkBD,EAAA,EAAI;IACxBK,cAAA,GAAiB,cAAcJ,cAAA,IAAkBD,EAAA,EAAI;EACvD;EAEA,IAAIE,UAAA,EAAY;IACdG,cAAA,GAAiB,UAAUH,UAAA,EAAY;EACzC;EAEA,IAAIG,cAAA,EAAgB;IAClB,MAAMC,iBAAA,GAAqB,MAAMH,OAAA,CAAQI,IAAI,CAAC;MAC5CC,UAAA,EAAY;MACZC,KAAA,EAAO;MACPC,KAAA,EAAO;MACPC,KAAA,EAAO;QACLC,GAAA,EAAK,CACH;UACEC,GAAA,EAAK;YACHC,MAAA,EAAQT;UACV;QACF,GACA;UACE,mBAAmB;YACjBS,MAAA,EAAQV,IAAA,CAAKI;UACf;QACF,GACA;UACE,cAAc;YACZM,MAAA,EAAQV,IAAA,CAAKJ;UACf;QACF;MAEJ;IACF;IAEA,IAAIM,iBAAA,EAAmBS,IAAA,GAAO,EAAE,EAAEC,KAAA,EAAO;MACvC,OAAOV,iBAAA,CAAkBS,IAAI,CAAC,EAAE,CAACC,KAAK;IACxC;EACF;EAEA,OAAO;IAAEC,MAAA,EAAQ,CAAC;EAAE;AACtB","ignoreList":[]}
|