@payloadcms/next 3.0.0-beta.9 → 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.d.ts +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.d.ts +5 -0
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js +19 -0
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.d.ts +13 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js +112 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts +8 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js +82 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.scss +93 -0
- package/dist/elements/DocumentHeader/Tabs/getCustomViews.d.ts +6 -0
- package/dist/elements/DocumentHeader/Tabs/getCustomViews.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/getCustomViews.js +34 -0
- package/dist/elements/DocumentHeader/Tabs/getCustomViews.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/getViewConfig.d.ts +7 -0
- package/dist/elements/DocumentHeader/Tabs/getViewConfig.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/getViewConfig.js +17 -0
- package/dist/elements/DocumentHeader/Tabs/getViewConfig.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/index.d.ts +12 -0
- package/dist/elements/DocumentHeader/Tabs/index.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/index.js +98 -0
- package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/index.scss +52 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.d.ts +3 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js +40 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts +9 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js +65 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js.map +1 -0
- package/dist/elements/DocumentHeader/index.d.ts +14 -0
- package/dist/elements/DocumentHeader/index.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/index.js +31 -0
- package/dist/elements/DocumentHeader/index.js.map +1 -0
- package/dist/elements/DocumentHeader/index.scss +52 -0
- package/dist/elements/EmailAndUsername/index.d.ts +14 -0
- package/dist/elements/EmailAndUsername/index.d.ts.map +1 -0
- package/dist/elements/EmailAndUsername/index.js +121 -0
- package/dist/elements/EmailAndUsername/index.js.map +1 -0
- package/dist/elements/LeaveWithoutSaving/index.d.ts.map +1 -1
- package/dist/elements/LeaveWithoutSaving/index.js +153 -61
- package/dist/elements/LeaveWithoutSaving/index.js.map +1 -1
- package/dist/elements/LeaveWithoutSaving/index.scss +1 -0
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts +2 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts.map +1 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js +119 -99
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +1 -1
- package/dist/elements/Logo/index.d.ts +4 -0
- package/dist/elements/Logo/index.d.ts.map +1 -0
- package/dist/elements/Logo/index.js +42 -0
- package/dist/elements/Logo/index.js.map +1 -0
- package/dist/elements/Nav/NavHamburger/index.d.ts +5 -0
- package/dist/elements/Nav/NavHamburger/index.d.ts.map +1 -0
- package/dist/elements/Nav/NavHamburger/index.js +48 -0
- package/dist/elements/Nav/NavHamburger/index.js.map +1 -0
- package/dist/elements/Nav/NavWrapper/index.d.ts +7 -0
- package/dist/elements/Nav/NavWrapper/index.d.ts.map +1 -0
- package/dist/elements/Nav/NavWrapper/index.js +55 -0
- package/dist/elements/Nav/NavWrapper/index.js.map +1 -0
- package/dist/elements/Nav/NavWrapper/index.scss +20 -0
- package/dist/elements/Nav/index.client.d.ts +3 -0
- package/dist/elements/Nav/index.client.d.ts.map +1 -0
- package/dist/elements/Nav/index.client.js +161 -0
- package/dist/elements/Nav/index.client.js.map +1 -0
- package/dist/elements/Nav/index.d.ts +6 -0
- package/dist/elements/Nav/index.d.ts.map +1 -0
- package/dist/elements/Nav/index.js +67 -0
- package/dist/elements/Nav/index.js.map +1 -0
- package/dist/elements/Nav/index.scss +156 -0
- package/dist/exports/layouts.js +0 -1
- 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.d.ts +3 -0
- package/dist/exports/templates.d.ts.map +1 -0
- package/dist/exports/templates.js +3 -0
- package/dist/exports/templates.js.map +1 -0
- package/dist/exports/utilities.d.ts +5 -1
- package/dist/exports/utilities.d.ts.map +1 -1
- package/dist/exports/utilities.js +5 -2
- package/dist/exports/utilities.js.map +1 -1
- package/dist/exports/views.d.ts +2 -1
- package/dist/exports/views.d.ts.map +1 -1
- package/dist/exports/views.js +2 -2
- package/dist/exports/views.js.map +1 -1
- package/dist/{next-fileupload → fetchAPI-multipart}/fileFactory.d.ts +2 -3
- package/dist/fetchAPI-multipart/fileFactory.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/fileFactory.js +44 -0
- package/dist/fetchAPI-multipart/fileFactory.js.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/handlers.d.ts +2 -3
- package/dist/fetchAPI-multipart/handlers.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/handlers.js +85 -0
- package/dist/fetchAPI-multipart/handlers.js.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/index.d.ts +10 -13
- package/dist/fetchAPI-multipart/index.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/index.js +43 -0
- package/dist/fetchAPI-multipart/index.js.map +1 -0
- package/dist/fetchAPI-multipart/isEligibleRequest.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/isEligibleRequest.js +18 -0
- package/dist/fetchAPI-multipart/isEligibleRequest.js.map +1 -0
- package/dist/fetchAPI-multipart/processMultipart.d.ts +8 -0
- package/dist/fetchAPI-multipart/processMultipart.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/processMultipart.js +179 -0
- package/dist/fetchAPI-multipart/processMultipart.js.map +1 -0
- package/dist/fetchAPI-multipart/processNested.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/processNested.js +27 -0
- package/dist/fetchAPI-multipart/processNested.js.map +1 -0
- package/dist/fetchAPI-multipart/uploadTimer.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/uploadTimer.js +18 -0
- package/dist/fetchAPI-multipart/uploadTimer.js.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/utilities.d.ts +4 -4
- package/dist/fetchAPI-multipart/utilities.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/utilities.js +207 -0
- package/dist/fetchAPI-multipart/utilities.js.map +1 -0
- package/dist/{next-stream-file → fetchAPI-stream-file}/index.d.ts +0 -1
- package/dist/fetchAPI-stream-file/index.d.ts.map +1 -0
- package/dist/fetchAPI-stream-file/index.js +27 -0
- package/dist/fetchAPI-stream-file/index.js.map +1 -0
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/layouts/Root/index.d.ts +5 -5
- package/dist/layouts/Root/index.d.ts.map +1 -1
- package/dist/layouts/Root/index.js +118 -80
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/prod/styles.css +1 -1
- package/dist/routes/graphql/handler.d.ts +1 -1
- package/dist/routes/graphql/handler.d.ts.map +1 -1
- package/dist/routes/graphql/handler.js +113 -99
- 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 +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.d.ts +1 -1
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +1 -2
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/rest/auth/access.d.ts.map +1 -1
- package/dist/routes/rest/auth/access.js +21 -5
- 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 +31 -18
- package/dist/routes/rest/auth/forgotPassword.js.map +1 -1
- package/dist/routes/rest/auth/init.d.ts.map +1 -1
- package/dist/routes/rest/auth/init.js +18 -10
- 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 +46 -34
- 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 +33 -25
- package/dist/routes/rest/auth/logout.js.map +1 -1
- package/dist/routes/rest/auth/me.d.ts.map +1 -1
- package/dist/routes/rest/auth/me.js +25 -19
- 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 +31 -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 +45 -31
- package/dist/routes/rest/auth/registerFirstUser.js.map +1 -1
- package/dist/routes/rest/auth/resetPassword.d.ts.map +1 -1
- package/dist/routes/rest/auth/resetPassword.js +40 -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 +29 -16
- package/dist/routes/rest/auth/unlock.js.map +1 -1
- package/dist/routes/rest/auth/verifyEmail.d.ts.map +1 -1
- package/dist/routes/rest/auth/verifyEmail.js +24 -14
- package/dist/routes/rest/auth/verifyEmail.js.map +1 -1
- package/dist/routes/rest/buildFormState.d.ts +1 -3
- package/dist/routes/rest/buildFormState.d.ts.map +1 -1
- package/dist/routes/rest/buildFormState.js +41 -155
- package/dist/routes/rest/buildFormState.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.d.ts +3 -0
- package/dist/routes/rest/collections/count.d.ts.map +1 -0
- package/dist/routes/rest/collections/count.js +19 -0
- package/dist/routes/rest/collections/count.js.map +1 -0
- package/dist/routes/rest/collections/create.d.ts.map +1 -1
- package/dist/routes/rest/collections/create.js +33 -24
- 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 +43 -31
- 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 +39 -27
- package/dist/routes/rest/collections/deleteByID.js.map +1 -1
- package/dist/routes/rest/collections/docAccess.d.ts.map +1 -1
- package/dist/routes/rest/collections/docAccess.js +19 -11
- 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 +39 -29
- 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 +32 -18
- 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 +31 -21
- 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 +30 -20
- 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 +30 -17
- package/dist/routes/rest/collections/findVersions.js.map +1 -1
- package/dist/routes/rest/collections/preview.d.ts.map +1 -1
- package/dist/routes/rest/collections/preview.js +42 -32
- 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 +35 -23
- 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 +46 -33
- 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 +41 -31
- 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 +47 -45
- package/dist/routes/rest/files/checkFileAccess.js.map +1 -1
- package/dist/routes/rest/files/getFile.d.ts +1 -1
- package/dist/routes/rest/files/getFile.d.ts.map +1 -1
- package/dist/routes/rest/files/getFile.js +57 -43
- package/dist/routes/rest/files/getFile.js.map +1 -1
- package/dist/routes/rest/files/getFileTypeFallback.d.ts +7 -0
- package/dist/routes/rest/files/getFileTypeFallback.d.ts.map +1 -0
- package/dist/routes/rest/files/getFileTypeFallback.js +20 -0
- package/dist/routes/rest/files/getFileTypeFallback.js.map +1 -0
- package/dist/routes/rest/globals/docAccess.d.ts.map +1 -1
- package/dist/routes/rest/globals/docAccess.js +17 -10
- 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 +25 -16
- 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 +25 -15
- 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 +30 -17
- package/dist/routes/rest/globals/findVersions.js.map +1 -1
- package/dist/routes/rest/globals/preview.d.ts.map +1 -1
- package/dist/routes/rest/globals/preview.js +41 -32
- 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 +30 -18
- 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 +35 -26
- package/dist/routes/rest/globals/update.js.map +1 -1
- package/dist/routes/rest/index.d.ts +2 -1
- package/dist/routes/rest/index.d.ts.map +1 -1
- package/dist/routes/rest/index.js +659 -483
- package/dist/routes/rest/index.js.map +1 -1
- package/dist/routes/rest/og/image.d.ts +10 -0
- package/dist/routes/rest/og/image.d.ts.map +1 -0
- package/dist/routes/rest/og/image.js +81 -0
- package/dist/routes/rest/og/image.js.map +1 -0
- package/dist/routes/rest/og/index.d.ts +11 -0
- package/dist/routes/rest/og/index.d.ts.map +1 -0
- package/dist/routes/rest/og/index.js +78 -0
- package/dist/routes/rest/og/index.js.map +1 -0
- package/dist/routes/rest/og/roboto-regular.woff +0 -0
- package/dist/routes/rest/routeError.d.ts +6 -5
- package/dist/routes/rest/routeError.d.ts.map +1 -1
- package/dist/routes/rest/routeError.js +105 -84
- package/dist/routes/rest/routeError.js.map +1 -1
- package/dist/routes/rest/types.d.ts +1 -1
- 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 +1 -1
- package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts.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 +14 -19
- package/dist/scss/colors.scss +76 -76
- package/dist/scss/toastify.scss +1 -0
- package/dist/scss/toasts.scss +142 -0
- package/dist/scss/type.scss +19 -27
- package/dist/scss/vars.scss +26 -47
- package/dist/templates/Default/NavHamburger/index.d.ts +3 -0
- package/dist/templates/Default/NavHamburger/index.d.ts.map +1 -0
- package/dist/templates/Default/NavHamburger/index.js +25 -0
- package/dist/templates/Default/NavHamburger/index.js.map +1 -0
- package/dist/templates/Default/Wrapper/index.d.ts +8 -0
- package/dist/templates/Default/Wrapper/index.d.ts.map +1 -0
- package/dist/templates/Default/Wrapper/index.js +49 -0
- package/dist/templates/Default/Wrapper/index.js.map +1 -0
- package/dist/templates/Default/Wrapper/index.scss +57 -0
- package/dist/templates/Default/index.d.ts +10 -0
- package/dist/templates/Default/index.d.ts.map +1 -0
- package/dist/templates/Default/index.js +66 -0
- package/dist/templates/Default/index.js.map +1 -0
- package/dist/templates/Default/index.scss +67 -0
- package/dist/templates/Minimal/index.d.ts +10 -0
- package/dist/templates/Minimal/index.d.ts.map +1 -0
- package/dist/templates/Minimal/index.js +21 -0
- package/dist/templates/Minimal/index.js.map +1 -0
- package/dist/templates/Minimal/index.scss +28 -0
- package/dist/utilities/addDataAndFileToRequest.d.ts +8 -0
- package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -0
- package/dist/utilities/addDataAndFileToRequest.js +47 -0
- package/dist/utilities/addDataAndFileToRequest.js.map +1 -0
- package/dist/utilities/addLocalesToRequest.d.ts +17 -0
- package/dist/utilities/addLocalesToRequest.d.ts.map +1 -0
- package/dist/utilities/addLocalesToRequest.js +51 -0
- package/dist/utilities/addLocalesToRequest.js.map +1 -0
- package/dist/utilities/createPayloadRequest.d.ts +1 -1
- package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
- package/dist/utilities/createPayloadRequest.js +88 -85
- package/dist/utilities/createPayloadRequest.js.map +1 -1
- package/dist/utilities/getNextRequestI18n.d.ts +5 -5
- package/dist/utilities/getNextRequestI18n.d.ts.map +1 -1
- package/dist/utilities/getNextRequestI18n.js +15 -11
- package/dist/utilities/getNextRequestI18n.js.map +1 -1
- package/dist/utilities/getPayloadHMR.d.ts +3 -3
- package/dist/utilities/getPayloadHMR.d.ts.map +1 -1
- package/dist/utilities/getPayloadHMR.js +94 -65
- package/dist/utilities/getPayloadHMR.js.map +1 -1
- package/dist/utilities/getRequestLanguage.d.ts +2 -2
- package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
- package/dist/utilities/getRequestLanguage.js +16 -14
- 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 +11 -0
- package/dist/utilities/getRequestTheme.d.ts.map +1 -0
- package/dist/utilities/getRequestTheme.js +19 -0
- package/dist/utilities/getRequestTheme.js.map +1 -0
- package/dist/utilities/headersWithCors.d.ts +8 -0
- package/dist/utilities/headersWithCors.d.ts.map +1 -0
- package/dist/utilities/headersWithCors.js +24 -0
- package/dist/utilities/headersWithCors.js.map +1 -0
- package/dist/utilities/initPage/handleAdminPage.d.ts +16 -0
- package/dist/utilities/initPage/handleAdminPage.d.ts.map +1 -0
- package/dist/utilities/initPage/handleAdminPage.js +52 -0
- package/dist/utilities/initPage/handleAdminPage.js.map +1 -0
- package/dist/utilities/initPage/handleAuthRedirect.d.ts +9 -0
- package/dist/utilities/initPage/handleAuthRedirect.d.ts.map +1 -0
- package/dist/utilities/initPage/handleAuthRedirect.js +52 -0
- package/dist/utilities/initPage/handleAuthRedirect.js.map +1 -0
- package/dist/utilities/initPage/index.d.ts +4 -0
- package/dist/utilities/initPage/index.d.ts.map +1 -0
- package/dist/utilities/initPage/index.js +160 -0
- package/dist/utilities/initPage/index.js.map +1 -0
- package/dist/utilities/initPage/shared.d.ts +16 -0
- package/dist/utilities/initPage/shared.d.ts.map +1 -0
- package/dist/utilities/initPage/shared.js +30 -0
- package/dist/utilities/initPage/shared.js.map +1 -0
- package/dist/utilities/initPage/types.d.ts +25 -0
- package/dist/utilities/initPage/types.d.ts.map +1 -0
- package/dist/utilities/initPage/types.js +2 -0
- package/dist/utilities/initPage/types.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 +3 -7
- package/dist/utilities/meta.d.ts.map +1 -1
- package/dist/utilities/meta.js +70 -33
- 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 +9 -0
- package/dist/views/API/LocaleSelector/index.d.ts.map +1 -0
- package/dist/views/API/LocaleSelector/index.js +44 -0
- package/dist/views/API/LocaleSelector/index.js.map +1 -0
- package/dist/views/API/RenderJSON/index.js +116 -72
- package/dist/views/API/RenderJSON/index.js.map +1 -1
- package/dist/views/API/index.client.d.ts.map +1 -1
- package/dist/views/API/index.client.js +193 -178
- 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 +3 -3
- package/dist/views/API/index.js.map +1 -1
- package/dist/views/API/index.scss +1 -2
- package/dist/views/API/meta.d.ts.map +1 -1
- package/dist/views/API/meta.js +23 -8
- package/dist/views/API/meta.js.map +1 -1
- package/dist/views/Account/Settings/LanguageSelector.d.ts +6 -0
- package/dist/views/Account/Settings/LanguageSelector.d.ts.map +1 -0
- package/dist/views/Account/Settings/LanguageSelector.js +52 -0
- package/dist/views/Account/Settings/LanguageSelector.js.map +1 -0
- package/dist/views/Account/Settings/index.d.ts +5 -1
- package/dist/views/Account/Settings/index.d.ts.map +1 -1
- package/dist/views/Account/Settings/index.js +23 -25
- package/dist/views/Account/Settings/index.js.map +1 -1
- package/dist/views/Account/ToggleTheme/index.d.ts.map +1 -1
- package/dist/views/Account/ToggleTheme/index.js +52 -30
- 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 +1 -1
- package/dist/views/Account/index.d.ts.map +1 -1
- package/dist/views/Account/index.js +106 -48
- package/dist/views/Account/index.js.map +1 -1
- package/dist/views/Account/meta.d.ts.map +1 -1
- package/dist/views/Account/meta.js +12 -9
- package/dist/views/Account/meta.js.map +1 -1
- package/dist/views/CreateFirstUser/index.client.d.ts +4 -3
- package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +96 -12
- package/dist/views/CreateFirstUser/index.client.js.map +1 -1
- package/dist/views/CreateFirstUser/index.d.ts +1 -1
- package/dist/views/CreateFirstUser/index.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.js +44 -58
- package/dist/views/CreateFirstUser/index.js.map +1 -1
- package/dist/views/CreateFirstUser/index.scss +6 -12
- package/dist/views/CreateFirstUser/meta.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/meta.js +12 -9
- package/dist/views/CreateFirstUser/meta.js.map +1 -1
- package/dist/views/Dashboard/Default/index.d.ts +4 -4
- package/dist/views/Dashboard/Default/index.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/index.js +138 -25
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- package/dist/views/Dashboard/Default/index.scss +11 -7
- package/dist/views/Dashboard/index.d.ts +1 -1
- package/dist/views/Dashboard/index.d.ts.map +1 -1
- package/dist/views/Dashboard/index.js +63 -19
- package/dist/views/Dashboard/index.js.map +1 -1
- package/dist/views/Dashboard/meta.d.ts.map +1 -1
- package/dist/views/Dashboard/meta.js +16 -9
- package/dist/views/Dashboard/meta.js.map +1 -1
- package/dist/views/Document/getCustomViewByKey.d.ts +2 -3
- package/dist/views/Document/getCustomViewByKey.d.ts.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.d.ts +6 -4
- 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/getDocumentData.d.ts +10 -0
- package/dist/views/Document/getDocumentData.d.ts.map +1 -0
- package/dist/views/Document/getDocumentData.js +38 -0
- package/dist/views/Document/getDocumentData.js.map +1 -0
- package/dist/views/Document/getDocumentPermissions.d.ts +13 -0
- package/dist/views/Document/getDocumentPermissions.d.ts.map +1 -0
- package/dist/views/Document/getDocumentPermissions.js +91 -0
- package/dist/views/Document/getDocumentPermissions.js.map +1 -0
- package/dist/views/Document/getMetaBySegment.d.ts +4 -4
- 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/getViewsFromConfig.d.ts +18 -9
- package/dist/views/Document/getViewsFromConfig.d.ts.map +1 -1
- package/dist/views/Document/getViewsFromConfig.js +310 -226
- package/dist/views/Document/getViewsFromConfig.js.map +1 -1
- package/dist/views/Document/index.d.ts +1 -1
- package/dist/views/Document/index.d.ts.map +1 -1
- package/dist/views/Document/index.js +201 -143
- 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.d.ts +2 -1
- package/dist/views/Edit/Default/Auth/APIKey.d.ts.map +1 -1
- package/dist/views/Edit/Default/Auth/APIKey.js +116 -84
- package/dist/views/Edit/Default/Auth/APIKey.js.map +1 -1
- package/dist/views/Edit/Default/Auth/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/Auth/index.js +299 -121
- package/dist/views/Edit/Default/Auth/index.js.map +1 -1
- package/dist/views/Edit/Default/Auth/index.scss +17 -2
- package/dist/views/Edit/Default/Auth/types.d.ts +5 -2
- package/dist/views/Edit/Default/Auth/types.d.ts.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/{SetStepNav → SetDocumentStepNav}/index.d.ts +2 -3
- package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts.map +1 -0
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js +130 -0
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js.map +1 -0
- package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts +1 -2
- package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/SetDocumentTitle/index.js +76 -33
- package/dist/views/Edit/Default/SetDocumentTitle/index.js.map +1 -1
- package/dist/views/Edit/Default/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/index.js +194 -176
- package/dist/views/Edit/Default/index.js.map +1 -1
- package/dist/views/Edit/Default/index.scss +2 -2
- package/dist/views/Edit/Default/types.d.ts +1 -1
- package/dist/views/Edit/Default/types.d.ts.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.d.ts.map +1 -1
- package/dist/views/Edit/index.client.js +48 -17
- package/dist/views/Edit/index.client.js.map +1 -1
- package/dist/views/Edit/index.d.ts +2 -2
- package/dist/views/Edit/index.d.ts.map +1 -1
- package/dist/views/Edit/index.js +3 -3
- 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 -22
- package/dist/views/Edit/meta.js.map +1 -1
- package/dist/views/Edit/sanitizeEditViewProps.d.ts +1 -1
- package/dist/views/Edit/sanitizeEditViewProps.d.ts.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 +3 -0
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts.map +1 -0
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +165 -0
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -0
- package/dist/views/ForgotPassword/index.d.ts +1 -1
- package/dist/views/ForgotPassword/index.d.ts.map +1 -1
- package/dist/views/ForgotPassword/index.js +65 -61
- package/dist/views/ForgotPassword/index.js.map +1 -1
- package/dist/views/ForgotPassword/meta.d.ts.map +1 -1
- package/dist/views/ForgotPassword/meta.js +12 -9
- package/dist/views/ForgotPassword/meta.js.map +1 -1
- package/dist/views/List/Default/index.d.ts.map +1 -1
- package/dist/views/List/Default/index.js +350 -136
- package/dist/views/List/Default/index.js.map +1 -1
- package/dist/views/List/Default/index.scss +9 -27
- package/dist/views/List/Default/types.d.ts +2 -2
- package/dist/views/List/Default/types.d.ts.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.d.ts +1 -1
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js +158 -97
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/List/meta.d.ts +3 -3
- package/dist/views/List/meta.d.ts.map +1 -1
- package/dist/views/List/meta.js +20 -15
- 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 +6 -5
- 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 -4
- package/dist/views/LivePreview/Context/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Context/index.js +136 -141
- 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 +80 -43
- package/dist/views/LivePreview/Device/index.js.map +1 -1
- package/dist/views/LivePreview/DeviceContainer/index.js +49 -23
- package/dist/views/LivePreview/DeviceContainer/index.js.map +1 -1
- package/dist/views/LivePreview/IFrame/index.js +22 -16
- package/dist/views/LivePreview/IFrame/index.js.map +1 -1
- package/dist/views/LivePreview/Preview/index.d.ts +1 -1
- package/dist/views/LivePreview/Preview/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Preview/index.js +152 -67
- package/dist/views/LivePreview/Preview/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.d.ts +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.js +130 -63
- package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js +90 -51
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/index.d.ts +3 -3
- package/dist/views/LivePreview/Toolbar/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Toolbar/index.js +82 -35
- package/dist/views/LivePreview/Toolbar/index.js.map +1 -1
- package/dist/views/LivePreview/ToolbarArea/index.js +33 -9
- package/dist/views/LivePreview/ToolbarArea/index.js.map +1 -1
- package/dist/views/LivePreview/index.client.d.ts +4 -5
- package/dist/views/LivePreview/index.client.d.ts.map +1 -1
- package/dist/views/LivePreview/index.client.js +322 -150
- 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 +68 -55
- package/dist/views/LivePreview/index.js.map +1 -1
- package/dist/views/LivePreview/meta.d.ts.map +1 -1
- package/dist/views/LivePreview/meta.js +15 -25
- 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 +92 -95
- 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 +93 -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 +138 -49
- package/dist/views/Login/LoginForm/index.js.map +1 -1
- package/dist/views/Login/index.d.ts +1 -1
- package/dist/views/Login/index.d.ts.map +1 -1
- package/dist/views/Login/index.js +80 -20
- package/dist/views/Login/index.js.map +1 -1
- package/dist/views/Login/meta.d.ts.map +1 -1
- package/dist/views/Login/meta.js +12 -9
- package/dist/views/Login/meta.js.map +1 -1
- package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
- package/dist/views/Logout/LogoutClient.js +88 -27
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/Logout/index.d.ts +3 -3
- package/dist/views/Logout/index.d.ts.map +1 -1
- package/dist/views/Logout/index.js +30 -18
- package/dist/views/Logout/index.js.map +1 -1
- package/dist/views/Logout/meta.d.ts.map +1 -1
- package/dist/views/Logout/meta.js +11 -9
- 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 +81 -34
- package/dist/views/NotFound/index.client.js.map +1 -1
- package/dist/views/NotFound/index.d.ts +4 -3
- package/dist/views/NotFound/index.d.ts.map +1 -1
- package/dist/views/NotFound/index.js +52 -31
- package/dist/views/NotFound/index.js.map +1 -1
- package/dist/views/NotFound/meta.d.ts +3 -3
- package/dist/views/NotFound/meta.d.ts.map +1 -1
- package/dist/views/NotFound/meta.js +9 -9
- package/dist/views/NotFound/meta.js.map +1 -1
- package/dist/views/ResetPassword/index.client.d.ts +7 -0
- package/dist/views/ResetPassword/index.client.d.ts.map +1 -0
- package/dist/views/ResetPassword/index.client.js +110 -0
- package/dist/views/ResetPassword/index.client.js.map +1 -0
- package/dist/views/ResetPassword/index.d.ts +1 -1
- package/dist/views/ResetPassword/index.d.ts.map +1 -1
- package/dist/views/ResetPassword/index.js +72 -58
- package/dist/views/ResetPassword/index.js.map +1 -1
- package/dist/views/ResetPassword/index.scss +2 -12
- package/dist/views/ResetPassword/meta.d.ts.map +1 -1
- package/dist/views/ResetPassword/meta.js +12 -9
- 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 +12 -7
- package/dist/views/Root/getViewFromConfig.d.ts.map +1 -1
- package/dist/views/Root/getViewFromConfig.js +164 -120
- package/dist/views/Root/getViewFromConfig.js.map +1 -1
- package/dist/views/Root/index.d.ts +9 -7
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Root/index.js +104 -42
- 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.d.ts +1 -1
- package/dist/views/Root/meta.d.ts.map +1 -1
- package/dist/views/Root/meta.js +143 -140
- 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 +34 -13
- package/dist/views/Unauthorized/index.js.map +1 -1
- package/dist/views/Unauthorized/meta.d.ts.map +1 -1
- package/dist/views/Unauthorized/meta.js +12 -9
- package/dist/views/Unauthorized/meta.js.map +1 -1
- package/dist/views/Verify/index.d.ts +1 -1
- package/dist/views/Verify/index.d.ts.map +1 -1
- package/dist/views/Verify/index.js +62 -25
- package/dist/views/Verify/index.js.map +1 -1
- package/dist/views/Verify/meta.d.ts.map +1 -1
- package/dist/views/Verify/meta.js +12 -9
- 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 -94
- 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 +202 -103
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/Default/types.d.ts +9 -11
- 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 +7 -4
- package/dist/views/Version/RenderFieldsToDiff/Label/index.js.map +1 -1
- 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 +57 -46
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- 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 +29 -14
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +1 -1
- 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 +113 -52
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js +18 -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 +41 -28
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts +3 -6
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +39 -28
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js +18 -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 +35 -21
- 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.d.ts +21 -58
- 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 +16 -17
- 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 +102 -90
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/types.d.ts +12 -13
- 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 +113 -64
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/Restore/index.scss +35 -2
- package/dist/views/Version/Restore/types.d.ts +2 -1
- 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 +136 -119
- package/dist/views/Version/SelectComparison/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/index.scss +1 -1
- package/dist/views/Version/SelectComparison/types.d.ts +3 -3
- 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 -26
- package/dist/views/Version/SelectLocales/index.js.map +1 -1
- package/dist/views/Version/SelectLocales/types.d.ts +1 -1
- package/dist/views/Version/SelectLocales/types.d.ts.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.d.ts +2 -2
- package/dist/views/Version/index.d.ts.map +1 -1
- package/dist/views/Version/index.js +129 -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 +51 -37
- package/dist/views/Version/meta.js.map +1 -1
- package/dist/views/Versions/buildColumns.d.ts +5 -3
- package/dist/views/Versions/buildColumns.d.ts.map +1 -1
- package/dist/views/Versions/buildColumns.js +89 -56
- package/dist/views/Versions/buildColumns.js.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.d.ts +7 -1
- package/dist/views/Versions/cells/AutosaveCell/index.d.ts.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.js +75 -10
- package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.d.ts.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.js +75 -16
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
- package/dist/views/Versions/cells/ID/index.js +20 -5
- package/dist/views/Versions/cells/ID/index.js.map +1 -1
- package/dist/views/Versions/getLatestVersion.d.ts +14 -0
- package/dist/views/Versions/getLatestVersion.d.ts.map +1 -0
- package/dist/views/Versions/getLatestVersion.js +38 -0
- package/dist/views/Versions/getLatestVersion.js.map +1 -0
- package/dist/views/Versions/index.client.d.ts +6 -6
- package/dist/views/Versions/index.client.d.ts.map +1 -1
- package/dist/views/Versions/index.client.js +81 -51
- 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 +154 -83
- package/dist/views/Versions/index.js.map +1 -1
- package/dist/views/Versions/meta.d.ts.map +1 -1
- package/dist/views/Versions/meta.js +44 -29
- package/dist/views/Versions/meta.js.map +1 -1
- package/dist/views/Versions/types.d.ts +1 -3
- package/dist/views/Versions/types.d.ts.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 +84 -68
- package/dist/withPayload.js.map +1 -1
- package/package.json +79 -51
- package/dist/cjs/withPayload.cjs +0 -95
- package/dist/cjs/withPayload.cjs.map +0 -1
- package/dist/next-fileupload/fileFactory.d.ts.map +0 -1
- package/dist/next-fileupload/fileFactory.js +0 -43
- package/dist/next-fileupload/fileFactory.js.map +0 -1
- package/dist/next-fileupload/handlers.d.ts.map +0 -1
- package/dist/next-fileupload/handlers.js +0 -86
- package/dist/next-fileupload/handlers.js.map +0 -1
- package/dist/next-fileupload/index.d.ts.map +0 -1
- package/dist/next-fileupload/index.js +0 -43
- package/dist/next-fileupload/index.js.map +0 -1
- package/dist/next-fileupload/isEligibleRequest.d.ts.map +0 -1
- package/dist/next-fileupload/isEligibleRequest.js +0 -26
- package/dist/next-fileupload/isEligibleRequest.js.map +0 -1
- package/dist/next-fileupload/processMultipart.d.ts +0 -8
- package/dist/next-fileupload/processMultipart.d.ts.map +0 -1
- package/dist/next-fileupload/processMultipart.js +0 -133
- package/dist/next-fileupload/processMultipart.js.map +0 -1
- package/dist/next-fileupload/processNested.d.ts.map +0 -1
- package/dist/next-fileupload/processNested.js +0 -24
- package/dist/next-fileupload/processNested.js.map +0 -1
- package/dist/next-fileupload/uploadTimer.d.ts.map +0 -1
- package/dist/next-fileupload/uploadTimer.js +0 -19
- package/dist/next-fileupload/uploadTimer.js.map +0 -1
- package/dist/next-fileupload/utilities.d.ts.map +0 -1
- package/dist/next-fileupload/utilities.js +0 -207
- package/dist/next-fileupload/utilities.js.map +0 -1
- package/dist/next-stream-file/index.d.ts.map +0 -1
- package/dist/next-stream-file/index.js +0 -25
- package/dist/next-stream-file/index.js.map +0 -1
- package/dist/prod/payload/favicon.svg +0 -15
- package/dist/prod/payload/og-image.png +0 -0
- package/dist/utilities/buildFieldSchemaMap/index.d.ts +0 -4
- package/dist/utilities/buildFieldSchemaMap/index.d.ts.map +0 -1
- package/dist/utilities/buildFieldSchemaMap/index.js +0 -28
- package/dist/utilities/buildFieldSchemaMap/index.js.map +0 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts +0 -14
- package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts.map +0 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js +0 -72
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js.map +0 -1
- package/dist/utilities/buildFieldSchemaMap/types.d.ts +0 -3
- package/dist/utilities/buildFieldSchemaMap/types.d.ts.map +0 -1
- package/dist/utilities/buildFieldSchemaMap/types.js +0 -3
- package/dist/utilities/buildFieldSchemaMap/types.js.map +0 -1
- package/dist/utilities/getDataAndFile.d.ts +0 -12
- package/dist/utilities/getDataAndFile.d.ts.map +0 -1
- package/dist/utilities/getDataAndFile.js +0 -68
- package/dist/utilities/getDataAndFile.js.map +0 -1
- package/dist/utilities/initPage.d.ts +0 -12
- package/dist/utilities/initPage.d.ts.map +0 -1
- package/dist/utilities/initPage.js +0 -98
- package/dist/utilities/initPage.js.map +0 -1
- package/dist/views/Dashboard/Default/index.client.d.ts +0 -10
- package/dist/views/Dashboard/Default/index.client.d.ts.map +0 -1
- package/dist/views/Dashboard/Default/index.client.js +0 -103
- package/dist/views/Dashboard/Default/index.client.js.map +0 -1
- package/dist/views/Edit/Default/SetStepNav/index.d.ts.map +0 -1
- package/dist/views/Edit/Default/SetStepNav/index.js +0 -64
- package/dist/views/Edit/Default/SetStepNav/index.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
- package/src/index.js +0 -1
- /package/dist/{next-fileupload → fetchAPI-multipart}/isEligibleRequest.d.ts +0 -0
- /package/dist/{next-fileupload → fetchAPI-multipart}/processNested.d.ts +0 -0
- /package/dist/{next-fileupload → fetchAPI-multipart}/uploadTimer.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/views/Version/RenderFieldsToDiff/fields/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/views/Version/RenderFieldsToDiff/fields/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAA;AAEzE,MAAM,MAAM,kBAAkB,CAAC,MAAM,SAAS,WAAW,GAAG,WAAW,IAAI;IACzE,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAA;IACxB,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;IACvC,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAA;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,CAAA;IAC9B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IACvD,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAA;CACtB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/views/Version/RenderFieldsToDiff/fields/types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/views/Version/RenderFieldsToDiff/fields/types.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { ClientField, FieldPermissions } from 'payload'\nimport type React from 'react'\nimport type { DiffMethod } from 'react-diff-viewer-continued'\n\nexport type DiffComponents = Record<string, React.FC<DiffComponentProps>>\n\nexport type DiffComponentProps<TField extends ClientField = ClientField> = {\n readonly comparison: any\n readonly diffComponents: DiffComponents\n readonly diffMethod?: DiffMethod\n readonly disableGutter?: boolean\n readonly field: TField\n readonly fields: ClientField[]\n readonly i18n: I18nClient\n readonly isRichText?: boolean\n readonly locale?: string\n readonly locales?: string[]\n readonly permissions?: Record<string, FieldPermissions>\n readonly version: any\n}\n"],"mappings":"AAOA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/Version/RenderFieldsToDiff/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/Version/RenderFieldsToDiff/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAkB,KAAK,EAAE,MAAM,YAAY,CAAA;AAIvD,OAAO,cAAc,CAAA;AAIrB,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA8HvC,CAAA;AAED,eAAe,kBAAkB,CAAA"}
|
|
@@ -1,100 +1,112 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { fieldAffectsData } from 'payload/shared';
|
|
2
5
|
import React from 'react';
|
|
3
6
|
import Nested from './fields/Nested/index.js';
|
|
4
7
|
import { diffMethods } from './fields/diffMethods.js';
|
|
5
8
|
const baseClass = 'render-field-diffs';
|
|
6
|
-
const RenderFieldsToDiff = ({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
9
|
+
const RenderFieldsToDiff = ({
|
|
10
|
+
comparison,
|
|
11
|
+
diffComponents: __diffComponents,
|
|
12
|
+
fieldPermissions,
|
|
13
|
+
fields,
|
|
14
|
+
i18n,
|
|
15
|
+
locales,
|
|
16
|
+
version
|
|
17
|
+
}) => {
|
|
18
|
+
// typing it as `as typeof _diffComponents` here ensures the TField generics of DiffComponentProps are respected.
|
|
19
|
+
// Without it, you could pass a UI field to the Tabs component, without it erroring
|
|
20
|
+
const diffComponents = __diffComponents;
|
|
21
|
+
return /*#__PURE__*/_jsx("div", {
|
|
22
|
+
className: baseClass,
|
|
23
|
+
children: fields?.map((field, i) => {
|
|
24
|
+
if ('name' in field && field.name === 'id') return null;
|
|
25
|
+
const Component = diffComponents[field.type];
|
|
26
|
+
const isRichText = field.type === 'richText';
|
|
27
|
+
const diffMethod = diffMethods[field.type] || 'CHARS';
|
|
28
|
+
if (Component) {
|
|
29
|
+
if (fieldAffectsData(field)) {
|
|
30
|
+
const fieldName = field.name;
|
|
31
|
+
const valueIsObject = field.type === 'code' || field.type === 'json';
|
|
32
|
+
const versionValue = valueIsObject ? JSON.stringify(version?.[fieldName]) : version?.[fieldName];
|
|
33
|
+
const comparisonValue = valueIsObject ? JSON.stringify(comparison?.[fieldName]) : comparison?.[fieldName];
|
|
34
|
+
const hasPermission = fieldPermissions?.[fieldName]?.read?.permission;
|
|
35
|
+
const subFieldPermissions = fieldPermissions?.[fieldName]?.fields;
|
|
36
|
+
if (hasPermission === false) return null;
|
|
37
|
+
const baseCellProps = {
|
|
38
|
+
comparison: comparisonValue,
|
|
39
|
+
diffComponents,
|
|
40
|
+
diffMethod,
|
|
41
|
+
field,
|
|
42
|
+
fieldPermissions: subFieldPermissions,
|
|
43
|
+
fields: 'fields' in field ? field?.fields : fields,
|
|
44
|
+
i18n,
|
|
45
|
+
isRichText,
|
|
46
|
+
locales,
|
|
47
|
+
version: versionValue
|
|
48
|
+
};
|
|
49
|
+
if (field.localized) {
|
|
50
|
+
return /*#__PURE__*/_jsx("div", {
|
|
51
|
+
className: `${baseClass}__field`,
|
|
52
|
+
children: locales.map((locale, index) => {
|
|
53
|
+
const versionLocaleValue = versionValue?.[locale];
|
|
54
|
+
const comparisonLocaleValue = comparisonValue?.[locale];
|
|
55
|
+
const cellProps = {
|
|
56
|
+
...baseCellProps,
|
|
57
|
+
comparison: comparisonLocaleValue,
|
|
58
|
+
version: versionLocaleValue
|
|
34
59
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (field.type === 'tabs' && 'fieldMap' in field.fieldComponentProps) {
|
|
67
|
-
const Tabs = diffComponents.tabs;
|
|
68
|
-
return /*#__PURE__*/ React.createElement(Tabs, {
|
|
69
|
-
comparison: comparison,
|
|
70
|
-
diffComponents: diffComponents,
|
|
71
|
-
field: field,
|
|
72
|
-
fieldMap: field.fieldComponentProps.fieldMap,
|
|
73
|
-
i18n: i18n,
|
|
74
|
-
key: i,
|
|
75
|
-
locales: locales,
|
|
76
|
-
version: version
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
// At this point, we are dealing with a `row`, etc
|
|
80
|
-
if ('fieldMap' in field.fieldComponentProps) {
|
|
81
|
-
return /*#__PURE__*/ React.createElement(Nested, {
|
|
82
|
-
comparison: comparison,
|
|
83
|
-
diffComponents: diffComponents,
|
|
84
|
-
disableGutter: true,
|
|
85
|
-
field: field,
|
|
86
|
-
fieldMap: field.fieldComponentProps.fieldMap,
|
|
87
|
-
i18n: i18n,
|
|
88
|
-
key: i,
|
|
89
|
-
locales: locales,
|
|
90
|
-
permissions: fieldPermissions,
|
|
91
|
-
version: version
|
|
92
|
-
});
|
|
93
|
-
}
|
|
60
|
+
return /*#__PURE__*/_jsx("div", {
|
|
61
|
+
className: `${baseClass}__locale`,
|
|
62
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
63
|
+
className: `${baseClass}__locale-value`,
|
|
64
|
+
children: /*#__PURE__*/_jsx(Component, {
|
|
65
|
+
...cellProps,
|
|
66
|
+
locale: locale
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
}, [locale, index].join('-'));
|
|
70
|
+
})
|
|
71
|
+
}, i);
|
|
72
|
+
}
|
|
73
|
+
return /*#__PURE__*/_jsx("div", {
|
|
74
|
+
className: `${baseClass}__field`,
|
|
75
|
+
children: /*#__PURE__*/_jsx(Component, {
|
|
76
|
+
...baseCellProps
|
|
77
|
+
})
|
|
78
|
+
}, i);
|
|
79
|
+
}
|
|
80
|
+
if (field.type === 'tabs' && 'fields' in field) {
|
|
81
|
+
const Tabs = diffComponents.tabs;
|
|
82
|
+
return /*#__PURE__*/_jsx(Tabs, {
|
|
83
|
+
comparison: comparison,
|
|
84
|
+
diffComponents: diffComponents,
|
|
85
|
+
field: field,
|
|
86
|
+
fields: [],
|
|
87
|
+
i18n: i18n,
|
|
88
|
+
locales: locales,
|
|
89
|
+
version: version
|
|
90
|
+
}, i);
|
|
94
91
|
}
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
// At this point, we are dealing with a `row`, etc
|
|
93
|
+
if ('fields' in field) {
|
|
94
|
+
return /*#__PURE__*/_jsx(Nested, {
|
|
95
|
+
comparison: comparison,
|
|
96
|
+
diffComponents: diffComponents,
|
|
97
|
+
disableGutter: true,
|
|
98
|
+
field: field,
|
|
99
|
+
fields: field.fields,
|
|
100
|
+
i18n: i18n,
|
|
101
|
+
locales: locales,
|
|
102
|
+
permissions: fieldPermissions,
|
|
103
|
+
version: version
|
|
104
|
+
}, i);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
})
|
|
109
|
+
});
|
|
97
110
|
};
|
|
98
111
|
export default RenderFieldsToDiff;
|
|
99
|
-
|
|
100
112
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/views/Version/RenderFieldsToDiff/index.tsx"],"sourcesContent":["'use client'\nimport type { DiffMethod } from 'react-diff-viewer-continued'\n\nimport React from 'react'\n\nimport type { FieldDiffProps, Props } from './types.js'\n\nimport Nested from './fields/Nested/index.js'\nimport { diffMethods } from './fields/diffMethods.js'\nimport './index.scss'\n\nconst baseClass = 'render-field-diffs'\n\nconst RenderFieldsToDiff: React.FC<Props> = ({\n comparison,\n diffComponents,\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["fieldAffectsData","React","Nested","diffMethods","baseClass","RenderFieldsToDiff","comparison","diffComponents","__diffComponents","fieldPermissions","fields","i18n","locales","version","_jsx","className","map","field","i","name","Component","type","isRichText","diffMethod","fieldName","valueIsObject","versionValue","JSON","stringify","comparisonValue","hasPermission","read","permission","subFieldPermissions","baseCellProps","localized","locale","index","versionLocaleValue","comparisonLocaleValue","cellProps","join","Tabs","tabs","disableGutter","permissions"],"sources":["../../../../src/views/Version/RenderFieldsToDiff/index.tsx"],"sourcesContent":["'use client'\nimport type { DiffMethod } from 'react-diff-viewer-continued'\n\nimport { UIFieldClient } from 'payload'\nimport { fieldAffectsData } from 'payload/shared'\nimport React from 'react'\n\nimport type { diffComponents as _diffComponents } from './fields/index.js'\nimport type { FieldDiffProps, Props } from './types.js'\n\nimport Nested from './fields/Nested/index.js'\nimport { diffMethods } from './fields/diffMethods.js'\nimport './index.scss'\n\nconst baseClass = 'render-field-diffs'\n\nconst RenderFieldsToDiff: React.FC<Props> = ({\n comparison,\n diffComponents: __diffComponents,\n fieldPermissions,\n fields,\n i18n,\n locales,\n version,\n}) => {\n // typing it as `as typeof _diffComponents` here ensures the TField generics of DiffComponentProps are respected.\n // Without it, you could pass a UI field to the Tabs component, without it erroring\n const diffComponents: typeof _diffComponents = __diffComponents as typeof _diffComponents\n return (\n <div className={baseClass}>\n {fields?.map((field, i) => {\n if ('name' in field && field.name === 'id') return null\n\n const Component = diffComponents[field.type]\n\n const isRichText = field.type === 'richText'\n const diffMethod: DiffMethod = diffMethods[field.type] || 'CHARS'\n\n if (Component) {\n if (fieldAffectsData(field)) {\n const fieldName = field.name\n const valueIsObject = field.type === 'code' || field.type === 'json'\n\n const versionValue = valueIsObject\n ? JSON.stringify(version?.[fieldName])\n : version?.[fieldName]\n\n const comparisonValue = valueIsObject\n ? JSON.stringify(comparison?.[fieldName])\n : comparison?.[fieldName]\n\n const hasPermission = fieldPermissions?.[fieldName]?.read?.permission\n\n const subFieldPermissions = fieldPermissions?.[fieldName]?.fields\n\n if (hasPermission === false) return null\n\n const baseCellProps: FieldDiffProps = {\n comparison: comparisonValue,\n diffComponents,\n diffMethod,\n field,\n fieldPermissions: subFieldPermissions,\n fields: 'fields' in field ? field?.fields : fields,\n i18n,\n isRichText,\n locales,\n version: versionValue,\n }\n\n if (field.localized) {\n return (\n <div className={`${baseClass}__field`} key={i}>\n {locales.map((locale, index) => {\n const versionLocaleValue = versionValue?.[locale]\n const comparisonLocaleValue = comparisonValue?.[locale]\n\n const cellProps = {\n ...baseCellProps,\n comparison: comparisonLocaleValue,\n version: versionLocaleValue,\n }\n\n return (\n <div className={`${baseClass}__locale`} key={[locale, index].join('-')}>\n <div className={`${baseClass}__locale-value`}>\n <Component {...cellProps} locale={locale} />\n </div>\n </div>\n )\n })}\n </div>\n )\n }\n\n return (\n <div className={`${baseClass}__field`} key={i}>\n <Component {...baseCellProps} />\n </div>\n )\n }\n\n if (field.type === 'tabs' && 'fields' in field) {\n const Tabs = diffComponents.tabs\n\n return (\n <Tabs\n comparison={comparison}\n diffComponents={diffComponents}\n field={field}\n fields={[]}\n i18n={i18n}\n key={i}\n locales={locales}\n version={version}\n />\n )\n }\n\n // At this point, we are dealing with a `row`, etc\n if ('fields' in field) {\n return (\n <Nested\n comparison={comparison}\n diffComponents={diffComponents}\n disableGutter\n field={field}\n fields={field.fields}\n i18n={i18n}\n key={i}\n locales={locales}\n permissions={fieldPermissions}\n version={version}\n />\n )\n }\n }\n\n return null\n })}\n </div>\n )\n}\n\nexport default RenderFieldsToDiff\n"],"mappings":"AAAA;;;AAIA,SAASA,gBAAgB,QAAQ;AACjC,OAAOC,KAAA,MAAW;AAKlB,OAAOC,MAAA,MAAY;AACnB,SAASC,WAAW,QAAQ;AAG5B,MAAMC,SAAA,GAAY;AAElB,MAAMC,kBAAA,GAAsCA,CAAC;EAC3CC,UAAU;EACVC,cAAA,EAAgBC,gBAAgB;EAChCC,gBAAgB;EAChBC,MAAM;EACNC,IAAI;EACJC,OAAO;EACPC;AAAO,CACR;EACC;EACA;EACA,MAAMN,cAAA,GAAyCC,gBAAA;EAC/C,oBACEM,IAAA,CAAC;IAAIC,SAAA,EAAWX,SAAA;cACbM,MAAA,EAAQM,GAAA,CAAI,CAACC,KAAA,EAAOC,CAAA;MACnB,IAAI,UAAUD,KAAA,IAASA,KAAA,CAAME,IAAI,KAAK,MAAM,OAAO;MAEnD,MAAMC,SAAA,GAAYb,cAAc,CAACU,KAAA,CAAMI,IAAI,CAAC;MAE5C,MAAMC,UAAA,GAAaL,KAAA,CAAMI,IAAI,KAAK;MAClC,MAAME,UAAA,GAAyBpB,WAAW,CAACc,KAAA,CAAMI,IAAI,CAAC,IAAI;MAE1D,IAAID,SAAA,EAAW;QACb,IAAIpB,gBAAA,CAAiBiB,KAAA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|
-
import type { FieldPermissions } from 'payload/auth';
|
|
1
|
+
import type { I18nClient } from '@payloadcms/translations';
|
|
2
|
+
import type { ClientField, FieldPermissions } from 'payload';
|
|
4
3
|
import type { DiffMethod } from 'react-diff-viewer-continued';
|
|
5
4
|
import type { DiffComponents } from './fields/types.js';
|
|
6
5
|
export type Props = {
|
|
7
|
-
comparison: Record<string, any>;
|
|
8
|
-
diffComponents: DiffComponents;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
i18n:
|
|
12
|
-
locales: string[];
|
|
13
|
-
version: Record<string, any>;
|
|
6
|
+
readonly comparison: Record<string, any>;
|
|
7
|
+
readonly diffComponents: DiffComponents;
|
|
8
|
+
readonly fieldPermissions: Record<string, FieldPermissions>;
|
|
9
|
+
readonly fields: ClientField[];
|
|
10
|
+
readonly i18n: I18nClient;
|
|
11
|
+
readonly locales: string[];
|
|
12
|
+
readonly version: Record<string, any>;
|
|
14
13
|
};
|
|
15
|
-
export type FieldDiffProps =
|
|
14
|
+
export type FieldDiffProps = {
|
|
16
15
|
diffMethod: DiffMethod;
|
|
17
|
-
field:
|
|
16
|
+
field: ClientField;
|
|
18
17
|
isRichText: boolean;
|
|
19
|
-
};
|
|
18
|
+
} & Props;
|
|
20
19
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/views/Version/RenderFieldsToDiff/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/views/Version/RenderFieldsToDiff/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;IACvC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IAC3D,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,CAAA;IAC9B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACtC,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,WAAW,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;CACpB,GAAG,KAAK,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/views/Version/RenderFieldsToDiff/types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/views/Version/RenderFieldsToDiff/types.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { ClientField, FieldPermissions } from 'payload'\nimport type { DiffMethod } from 'react-diff-viewer-continued'\n\nimport type { DiffComponents } from './fields/types.js'\n\nexport type Props = {\n readonly comparison: Record<string, any>\n readonly diffComponents: DiffComponents\n readonly fieldPermissions: Record<string, FieldPermissions>\n readonly fields: ClientField[]\n readonly i18n: I18nClient\n readonly locales: string[]\n readonly version: Record<string, any>\n}\n\nexport type FieldDiffProps = {\n diffMethod: DiffMethod\n field: ClientField\n isRichText: boolean\n} & Props\n"],"mappings":"AAgBA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/Version/Restore/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/Version/Restore/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAA0C,MAAM,OAAO,CAAA;AAG9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGvC,OAAO,cAAc,CAAA;AAKrB,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAgH5B,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1,74 +1,123 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
4
|
import { getTranslation } from '@payloadcms/translations';
|
|
3
|
-
import { Button } from '@payloadcms/ui
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useConfig } from '@payloadcms/ui/providers/Config';
|
|
7
|
-
import { useTranslation } from '@payloadcms/ui/providers/Translation';
|
|
8
|
-
import { MinimalTemplate } from '@payloadcms/ui/templates/Minimal';
|
|
5
|
+
import { Button, ChevronIcon, Modal, Pill, Popup, PopupList, useConfig, useModal, useTranslation } from '@payloadcms/ui';
|
|
6
|
+
import { formatAdminURL, requests } from '@payloadcms/ui/shared';
|
|
7
|
+
import { useRouter } from 'next/navigation.js';
|
|
9
8
|
import React, { Fragment, useCallback, useState } from 'react';
|
|
10
|
-
import { toast } from '
|
|
9
|
+
import { toast } from 'sonner';
|
|
10
|
+
import { MinimalTemplate } from '../../../templates/Minimal/index.js';
|
|
11
11
|
const baseClass = 'restore-version';
|
|
12
12
|
const modalSlug = 'restore-version';
|
|
13
|
-
const Restore = ({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
const Restore = ({
|
|
14
|
+
className,
|
|
15
|
+
collectionSlug,
|
|
16
|
+
globalSlug,
|
|
17
|
+
label,
|
|
18
|
+
originalDocID,
|
|
19
|
+
status,
|
|
20
|
+
versionDate,
|
|
21
|
+
versionID
|
|
22
|
+
}) => {
|
|
23
|
+
const {
|
|
24
|
+
config: {
|
|
25
|
+
routes: {
|
|
26
|
+
admin: adminRoute,
|
|
27
|
+
api: apiRoute
|
|
28
|
+
},
|
|
29
|
+
serverURL
|
|
27
30
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
} = useConfig();
|
|
32
|
+
const {
|
|
33
|
+
toggleModal
|
|
34
|
+
} = useModal();
|
|
35
|
+
const [processing, setProcessing] = useState(false);
|
|
36
|
+
const router = useRouter();
|
|
37
|
+
const {
|
|
38
|
+
i18n,
|
|
39
|
+
t
|
|
40
|
+
} = useTranslation();
|
|
41
|
+
const [draft, setDraft] = useState(false);
|
|
42
|
+
const restoreMessage = t('version:aboutToRestoreGlobal', {
|
|
43
|
+
label: getTranslation(label, i18n),
|
|
44
|
+
versionDate
|
|
45
|
+
});
|
|
46
|
+
let fetchURL = `${serverURL}${apiRoute}`;
|
|
47
|
+
let redirectURL;
|
|
48
|
+
const canRestoreAsDraft = status !== 'draft';
|
|
49
|
+
if (collectionSlug) {
|
|
50
|
+
fetchURL = `${fetchURL}/${collectionSlug}/versions/${versionID}?draft=${draft}`;
|
|
51
|
+
redirectURL = formatAdminURL({
|
|
52
|
+
adminRoute,
|
|
53
|
+
path: `/collections/${collectionSlug}/${originalDocID}`
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (globalSlug) {
|
|
57
|
+
fetchURL = `${fetchURL}/globals/${globalSlug}/versions/${versionID}?draft=${draft}`;
|
|
58
|
+
redirectURL = formatAdminURL({
|
|
59
|
+
adminRoute,
|
|
60
|
+
path: `/globals/${globalSlug}`
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
const handleRestore = useCallback(async () => {
|
|
64
|
+
setProcessing(true);
|
|
65
|
+
const res = await requests.post(fetchURL, {
|
|
66
|
+
headers: {
|
|
67
|
+
'Accept-Language': i18n.language
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
if (res.status === 200) {
|
|
71
|
+
const json = await res.json();
|
|
72
|
+
toast.success(json.message);
|
|
73
|
+
router.push(redirectURL);
|
|
74
|
+
} else {
|
|
75
|
+
toast.error(t('version:problemRestoringVersion'));
|
|
31
76
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
}, [fetchURL, redirectURL, t, i18n, router]);
|
|
78
|
+
return /*#__PURE__*/_jsxs(Fragment, {
|
|
79
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
80
|
+
className: [baseClass, className].filter(Boolean).join(' '),
|
|
81
|
+
children: [/*#__PURE__*/_jsx(Pill, {
|
|
82
|
+
className: [canRestoreAsDraft && `${baseClass}__button`].filter(Boolean).join(' '),
|
|
83
|
+
onClick: () => toggleModal(modalSlug),
|
|
84
|
+
children: t('version:restoreThisVersion')
|
|
85
|
+
}), canRestoreAsDraft && /*#__PURE__*/_jsx(Popup, {
|
|
86
|
+
button: /*#__PURE__*/_jsx(Pill, {
|
|
87
|
+
className: `${baseClass}__chevron`,
|
|
88
|
+
children: /*#__PURE__*/_jsx(ChevronIcon, {})
|
|
89
|
+
}),
|
|
90
|
+
caret: false,
|
|
91
|
+
render: () => /*#__PURE__*/_jsx(PopupList.ButtonGroup, {
|
|
92
|
+
children: /*#__PURE__*/_jsx(PopupList.Button, {
|
|
93
|
+
onClick: () => [setDraft(true), toggleModal(modalSlug)],
|
|
94
|
+
children: t('version:restoreAsDraft')
|
|
95
|
+
})
|
|
96
|
+
}),
|
|
97
|
+
size: "large",
|
|
98
|
+
verticalAlign: "bottom"
|
|
99
|
+
})]
|
|
100
|
+
}), /*#__PURE__*/_jsx(Modal, {
|
|
101
|
+
className: `${baseClass}__modal`,
|
|
102
|
+
slug: modalSlug,
|
|
103
|
+
children: /*#__PURE__*/_jsxs(MinimalTemplate, {
|
|
104
|
+
className: `${baseClass}__modal-template`,
|
|
105
|
+
children: [/*#__PURE__*/_jsx("h1", {
|
|
106
|
+
children: t('version:confirmVersionRestoration')
|
|
107
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
108
|
+
children: restoreMessage
|
|
109
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
110
|
+
buttonStyle: "secondary",
|
|
111
|
+
onClick: processing ? undefined : () => toggleModal(modalSlug),
|
|
112
|
+
type: "button",
|
|
113
|
+
children: t('general:cancel')
|
|
114
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
115
|
+
onClick: processing ? undefined : () => void handleRestore(),
|
|
116
|
+
children: processing ? t('version:restoring') : t('general:confirm')
|
|
117
|
+
})]
|
|
118
|
+
})
|
|
119
|
+
})]
|
|
120
|
+
});
|
|
71
121
|
};
|
|
72
122
|
export default Restore;
|
|
73
|
-
|
|
74
123
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/views/Version/Restore/index.tsx"],"sourcesContent":["'use client'\nimport { getTranslation } from '@payloadcms/translations'\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","names":["getTranslation","Button","ChevronIcon","Modal","Pill","Popup","PopupList","useConfig","useModal","useTranslation","formatAdminURL","requests","useRouter","React","Fragment","useCallback","useState","toast","MinimalTemplate","baseClass","modalSlug","Restore","className","collectionSlug","globalSlug","label","originalDocID","status","versionDate","versionID","config","routes","admin","adminRoute","api","apiRoute","serverURL","toggleModal","processing","setProcessing","router","i18n","t","draft","setDraft","restoreMessage","fetchURL","redirectURL","canRestoreAsDraft","path","handleRestore","res","post","headers","language","json","success","message","push","error","_jsxs","filter","Boolean","join","_jsx","onClick","button","caret","render","ButtonGroup","size","verticalAlign","slug","buttonStyle","undefined","type"],"sources":["../../../../src/views/Version/Restore/index.tsx"],"sourcesContent":["'use client'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n ChevronIcon,\n Modal,\n Pill,\n Popup,\n PopupList,\n useConfig,\n useModal,\n useTranslation,\n} from '@payloadcms/ui'\nimport { formatAdminURL, requests } from '@payloadcms/ui/shared'\nimport { useRouter } from 'next/navigation.js'\nimport React, { Fragment, useCallback, useState } from 'react'\nimport { toast } from 'sonner'\n\nimport type { Props } from './types.js'\n\nimport { MinimalTemplate } from '../../../templates/Minimal/index.js'\nimport './index.scss'\n\nconst baseClass = 'restore-version'\nconst modalSlug = 'restore-version'\n\nconst Restore: React.FC<Props> = ({\n className,\n collectionSlug,\n globalSlug,\n label,\n originalDocID,\n status,\n versionDate,\n versionID,\n}) => {\n const {\n config: {\n routes: { admin: adminRoute, api: apiRoute },\n serverURL,\n },\n } = useConfig()\n\n const { toggleModal } = useModal()\n const [processing, setProcessing] = useState(false)\n const router = useRouter()\n const { i18n, t } = useTranslation()\n const [draft, setDraft] = useState(false)\n\n const restoreMessage = t('version:aboutToRestoreGlobal', {\n label: getTranslation(label, i18n),\n versionDate,\n })\n\n let fetchURL = `${serverURL}${apiRoute}`\n let redirectURL: string\n const canRestoreAsDraft = status !== 'draft'\n\n if (collectionSlug) {\n fetchURL = `${fetchURL}/${collectionSlug}/versions/${versionID}?draft=${draft}`\n redirectURL = formatAdminURL({\n adminRoute,\n path: `/collections/${collectionSlug}/${originalDocID}`,\n })\n }\n\n if (globalSlug) {\n fetchURL = `${fetchURL}/globals/${globalSlug}/versions/${versionID}?draft=${draft}`\n redirectURL = formatAdminURL({\n adminRoute,\n path: `/globals/${globalSlug}`,\n })\n }\n\n const handleRestore = useCallback(async () => {\n setProcessing(true)\n\n const res = await requests.post(fetchURL, {\n headers: {\n 'Accept-Language': i18n.language,\n },\n })\n\n if (res.status === 200) {\n const json = await res.json()\n toast.success(json.message)\n router.push(redirectURL)\n } else {\n toast.error(t('version:problemRestoringVersion'))\n }\n }, [fetchURL, redirectURL, t, i18n, router])\n return (\n <Fragment>\n <div className={[baseClass, className].filter(Boolean).join(' ')}>\n <Pill\n className={[canRestoreAsDraft && `${baseClass}__button`].filter(Boolean).join(' ')}\n onClick={() => toggleModal(modalSlug)}\n >\n {t('version:restoreThisVersion')}\n </Pill>\n {canRestoreAsDraft && (\n <Popup\n button={\n <Pill className={`${baseClass}__chevron`}>\n <ChevronIcon />\n </Pill>\n }\n caret={false}\n render={() => (\n <PopupList.ButtonGroup>\n <PopupList.Button onClick={() => [setDraft(true), toggleModal(modalSlug)]}>\n {t('version:restoreAsDraft')}\n </PopupList.Button>\n </PopupList.ButtonGroup>\n )}\n size=\"large\"\n verticalAlign=\"bottom\"\n />\n )}\n </div>\n <Modal className={`${baseClass}__modal`} slug={modalSlug}>\n <MinimalTemplate className={`${baseClass}__modal-template`}>\n <h1>{t('version:confirmVersionRestoration')}</h1>\n <p>{restoreMessage}</p>\n <Button\n buttonStyle=\"secondary\"\n onClick={processing ? undefined : () => toggleModal(modalSlug)}\n type=\"button\"\n >\n {t('general:cancel')}\n </Button>\n <Button onClick={processing ? undefined : () => void handleRestore()}>\n {processing ? t('version:restoring') : t('general:confirm')}\n </Button>\n </MinimalTemplate>\n </Modal>\n </Fragment>\n )\n}\n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