@payloadcms/next 3.0.0-beta.13 → 3.0.0-beta.131
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 +89 -19
- package/dist/cjs/withPayload.cjs.map +1 -1
- 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 +113 -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 +80 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.scss +95 -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 +99 -0
- package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/index.scss +54 -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 +29 -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 +13 -0
- package/dist/elements/DocumentHeader/index.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/index.js +28 -0
- package/dist/elements/DocumentHeader/index.js.map +1 -0
- package/dist/elements/DocumentHeader/index.scss +54 -0
- 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 +4 -0
- package/dist/elements/Logo/index.d.ts.map +1 -0
- package/dist/elements/Logo/index.js +41 -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 +27 -0
- package/dist/elements/Nav/getNavPrefs.d.ts +6 -0
- package/dist/elements/Nav/getNavPrefs.d.ts.map +1 -0
- package/dist/elements/Nav/getNavPrefs.js +26 -0
- package/dist/elements/Nav/getNavPrefs.js.map +1 -0
- package/dist/elements/Nav/index.client.d.ts +8 -0
- package/dist/elements/Nav/index.client.d.ts.map +1 -0
- package/dist/elements/Nav/index.client.js +111 -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 +110 -0
- package/dist/elements/Nav/index.js.map +1 -0
- package/dist/elements/Nav/index.scss +162 -0
- 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.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 +3 -1
- package/dist/exports/utilities.d.ts.map +1 -1
- package/dist/exports/utilities.js +4 -2
- package/dist/exports/utilities.js.map +1 -1
- package/dist/exports/views.d.ts +1 -2
- package/dist/exports/views.d.ts.map +1 -1
- package/dist/exports/views.js +1 -3
- package/dist/exports/views.js.map +1 -1
- package/dist/{next-fileupload → fetchAPI-multipart}/fileFactory.d.ts +3 -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 +87 -0
- package/dist/fetchAPI-multipart/handlers.js.map +1 -0
- package/dist/fetchAPI-multipart/index.d.ts +32 -0
- 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 +9 -0
- package/dist/fetchAPI-multipart/processMultipart.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/processMultipart.js +178 -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 +31 -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 +20 -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 +227 -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/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 -5
- package/dist/layouts/Root/index.d.ts.map +1 -1
- package/dist/layouts/Root/index.js +134 -82
- 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 +122 -101
- 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 +20 -9
- 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 +30 -22
- package/dist/routes/rest/auth/forgotPassword.js.map +1 -1
- package/dist/routes/rest/auth/init.js +17 -15
- 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 +45 -36
- 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 -29
- 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 +24 -23
- 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 -35
- 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 +44 -42
- 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 +39 -35
- 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 +28 -20
- package/dist/routes/rest/auth/unlock.js.map +1 -1
- package/dist/routes/rest/auth/verifyEmail.js +23 -18
- 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 +16 -12
- 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 +36 -28
- 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 +50 -37
- 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 +44 -33
- package/dist/routes/rest/collections/deleteByID.js.map +1 -1
- package/dist/routes/rest/collections/docAccess.js +18 -15
- 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 +42 -33
- 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 +40 -22
- 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 +36 -25
- 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 +33 -24
- 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 +35 -21
- 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 +41 -37
- 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 +36 -27
- 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 +55 -39
- 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 +52 -35
- 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 +1 -1
- package/dist/routes/rest/files/getFile.d.ts.map +1 -1
- package/dist/routes/rest/files/getFile.js +59 -48
- 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 +16 -14
- 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 +28 -20
- 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 +28 -19
- 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 +35 -21
- 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 +40 -37
- 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 +31 -22
- 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 +44 -30
- package/dist/routes/rest/globals/update.js.map +1 -1
- package/dist/routes/rest/index.d.ts +18 -13
- package/dist/routes/rest/index.d.ts.map +1 -1
- package/dist/routes/rest/index.js +751 -528
- package/dist/routes/rest/index.js.map +1 -1
- package/dist/routes/rest/og/image.d.ts +12 -0
- package/dist/routes/rest/og/image.d.ts.map +1 -0
- package/dist/routes/rest/og/image.js +85 -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 +73 -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 +4 -9
- package/dist/routes/rest/routeError.d.ts.map +1 -1
- package/dist/routes/rest/routeError.js +81 -99
- 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 +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 +167 -168
- package/dist/scss/colors.scss +256 -254
- package/dist/scss/resets.scss +9 -7
- package/dist/scss/toastify.scss +43 -40
- package/dist/scss/toasts.scss +144 -0
- package/dist/scss/type.scss +79 -86
- 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 +58 -0
- package/dist/templates/Default/index.d.ts +11 -0
- package/dist/templates/Default/index.d.ts.map +1 -0
- package/dist/templates/Default/index.js +136 -0
- package/dist/templates/Default/index.js.map +1 -0
- package/dist/templates/Default/index.scss +79 -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 +30 -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 +65 -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 +95 -83
- 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 +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 -4
- package/dist/utilities/getPayloadHMR.d.ts.map +1 -1
- package/dist/utilities/getPayloadHMR.js +90 -64
- 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.d.ts.map +1 -1
- package/dist/utilities/getRequestLocales.js +30 -23
- 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 +22 -0
- package/dist/utilities/getRequestTheme.js.map +1 -0
- 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 +1 -1
- 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 +18 -0
- package/dist/utilities/initPage/handleAdminPage.d.ts.map +1 -0
- package/dist/utilities/initPage/handleAdminPage.js +48 -0
- package/dist/utilities/initPage/handleAdminPage.js.map +1 -0
- package/dist/utilities/initPage/handleAuthRedirect.d.ts +12 -0
- package/dist/utilities/initPage/handleAuthRedirect.d.ts.map +1 -0
- package/dist/utilities/initPage/handleAuthRedirect.js +41 -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 +170 -0
- package/dist/utilities/initPage/index.js.map +1 -0
- 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 +16 -0
- package/dist/utilities/initPage/shared.d.ts.map +1 -0
- package/dist/utilities/initPage/shared.js +36 -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/initReq.d.ts +11 -0
- package/dist/utilities/initReq.d.ts.map +1 -0
- package/dist/utilities/initReq.js +46 -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 +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.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 +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.d.ts +1 -1
- package/dist/views/API/RenderJSON/index.d.ts.map +1 -1
- package/dist/views/API/RenderJSON/index.js +116 -72
- 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 +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 +98 -97
- 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 +6 -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/Settings/index.scss +37 -35
- package/dist/views/Account/ToggleTheme/index.d.ts.map +1 -1
- package/dist/views/Account/ToggleTheme/index.js +54 -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 +163 -46
- 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 +6 -3
- package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +96 -18
- 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 +76 -75
- package/dist/views/CreateFirstUser/index.js.map +1 -1
- package/dist/views/CreateFirstUser/index.scss +18 -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 +14 -5
- package/dist/views/Dashboard/Default/index.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/index.js +161 -25
- 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 +1 -1
- package/dist/views/Dashboard/index.d.ts.map +1 -1
- package/dist/views/Dashboard/index.js +95 -17
- 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/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 +12 -0
- package/dist/views/Document/getDocumentData.d.ts.map +1 -0
- package/dist/views/Document/getDocumentData.js +39 -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 +97 -0
- package/dist/views/Document/getDocumentPermissions.js.map +1 -0
- package/dist/views/Document/getIsLocked.d.ts +16 -0
- package/dist/views/Document/getIsLocked.d.ts.map +1 -0
- package/dist/views/Document/getIsLocked.js +55 -0
- package/dist/views/Document/getIsLocked.js.map +1 -0
- package/dist/views/Document/getMetaBySegment.d.ts +6 -6
- 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 -9
- package/dist/views/Document/getViewsFromConfig.d.ts.map +1 -1
- package/dist/views/Document/getViewsFromConfig.js +315 -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 +309 -141
- 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 +8 -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 -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.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +163 -48
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
- 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 +66 -24
- 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/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 +221 -99
- 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/List/renderListViewSlots.d.ts +12 -0
- package/dist/views/List/renderListViewSlots.d.ts.map +1 -0
- package/dist/views/List/renderListViewSlots.js +56 -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 +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 +138 -141
- package/dist/views/LivePreview/Context/index.js.map +1 -1
- package/dist/views/LivePreview/Context/sizeReducer.d.ts +1 -1
- package/dist/views/LivePreview/Context/sizeReducer.d.ts.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 +84 -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/IFrame/index.scss +8 -6
- 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/Preview/index.scss +32 -30
- 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 +128 -63
- 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 +90 -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 +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/Toolbar/index.scss +33 -31
- package/dist/views/LivePreview/ToolbarArea/index.js +33 -9
- 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 +4 -5
- package/dist/views/LivePreview/index.client.d.ts.map +1 -1
- package/dist/views/LivePreview/index.client.js +335 -139
- 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/index.scss +48 -46
- 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 +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 +98 -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 +156 -73
- 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 +1 -1
- package/dist/views/Login/index.d.ts.map +1 -1
- package/dist/views/Login/index.js +86 -20
- package/dist/views/Login/index.js.map +1 -1
- package/dist/views/Login/index.scss +8 -6
- 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 +1 -0
- package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
- package/dist/views/Logout/LogoutClient.js +114 -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/index.scss +19 -14
- 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 +84 -34
- 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 +57 -31
- package/dist/views/NotFound/index.js.map +1 -1
- package/dist/views/NotFound/index.scss +41 -21
- 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/ResetPasswordForm/index.d.ts +7 -0
- package/dist/views/ResetPassword/ResetPasswordForm/index.d.ts.map +1 -0
- package/dist/views/ResetPassword/ResetPasswordForm/index.js +111 -0
- package/dist/views/ResetPassword/ResetPasswordForm/index.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 +78 -61
- package/dist/views/ResetPassword/index.js.map +1 -1
- package/dist/views/ResetPassword/index.scss +7 -11
- 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 +14 -7
- package/dist/views/Root/getViewFromConfig.d.ts.map +1 -1
- package/dist/views/Root/getViewFromConfig.js +278 -119
- package/dist/views/Root/getViewFromConfig.js.map +1 -1
- package/dist/views/Root/index.d.ts +11 -9
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Root/index.js +128 -42
- 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 +6 -6
- package/dist/views/Root/meta.d.ts.map +1 -1
- package/dist/views/Root/meta.js +144 -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 +41 -13
- package/dist/views/Unauthorized/index.js.map +1 -1
- package/dist/views/Unauthorized/index.scss +4 -31
- 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.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 +1 -1
- package/dist/views/Verify/index.d.ts.map +1 -1
- package/dist/views/Verify/index.js +65 -26
- package/dist/views/Verify/index.js.map +1 -1
- package/dist/views/Verify/index.scss +13 -11
- 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/index.scss +52 -50
- 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/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 +60 -47
- 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 +30 -15
- 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 +113 -52
- 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 +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 +43 -28
- 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 -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 +40 -20
- 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 -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 +18 -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 +107 -91
- 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 +14 -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 +115 -64
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/Restore/index.scss +68 -17
- 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 +157 -117
- 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 +4 -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/index.scss +6 -4
- 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 +131 -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 +6 -3
- package/dist/views/Versions/buildColumns.d.ts.map +1 -1
- package/dist/views/Versions/buildColumns.js +76 -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 +114 -10
- 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 +9 -6
- 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 +6 -6
- package/dist/views/Versions/index.client.d.ts.map +1 -1
- package/dist/views/Versions/index.client.js +83 -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 +175 -82
- 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 -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 +102 -69
- package/dist/withPayload.js.map +1 -1
- package/license.md +22 -0
- package/package.json +97 -54
- 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 -70
- 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/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 +0 -135
- 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 -156
- 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/routes/rest/buildFormState.d.ts +0 -7
- package/dist/routes/rest/buildFormState.d.ts.map +0 -1
- package/dist/routes/rest/buildFormState.js +0 -175
- package/dist/routes/rest/buildFormState.js.map +0 -1
- 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 -48
- 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 -111
- 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/Auth/APIKey.d.ts +0 -5
- package/dist/views/Edit/Default/Auth/APIKey.d.ts.map +0 -1
- package/dist/views/Edit/Default/Auth/APIKey.js +0 -99
- 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 -129
- 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 -14
- 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 -71
- 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 -38
- 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 -195
- 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 -23
- 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 -149
- 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/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/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,100 +1,116 @@
|
|
|
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
|
-
import Nested from './fields/Nested/index.js';
|
|
4
6
|
import { diffMethods } from './fields/diffMethods.js';
|
|
7
|
+
import Nested from './fields/Nested/index.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') {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const Component = diffComponents[field.type];
|
|
28
|
+
const isRichText = field.type === 'richText';
|
|
29
|
+
const diffMethod = diffMethods[field.type] || 'CHARS';
|
|
30
|
+
if (Component) {
|
|
31
|
+
if (fieldAffectsData(field)) {
|
|
32
|
+
const fieldName = field.name;
|
|
33
|
+
const valueIsObject = field.type === 'code' || field.type === 'json';
|
|
34
|
+
const versionValue = valueIsObject ? JSON.stringify(version?.[fieldName]) : version?.[fieldName];
|
|
35
|
+
const comparisonValue = valueIsObject ? JSON.stringify(comparison?.[fieldName]) : comparison?.[fieldName];
|
|
36
|
+
const hasPermission = fieldPermissions?.[fieldName] === true || fieldPermissions?.[fieldName]?.read;
|
|
37
|
+
const subFieldPermissions = fieldPermissions?.[fieldName] === true || fieldPermissions?.[fieldName]?.fields;
|
|
38
|
+
if (!hasPermission) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const baseCellProps = {
|
|
42
|
+
comparison: comparisonValue,
|
|
43
|
+
diffComponents,
|
|
44
|
+
diffMethod,
|
|
45
|
+
field,
|
|
46
|
+
fieldPermissions: subFieldPermissions,
|
|
47
|
+
fields: 'fields' in field ? field?.fields : fields,
|
|
48
|
+
i18n,
|
|
49
|
+
isRichText,
|
|
50
|
+
locales,
|
|
51
|
+
version: versionValue
|
|
52
|
+
};
|
|
53
|
+
if (field.localized) {
|
|
54
|
+
return /*#__PURE__*/_jsx("div", {
|
|
55
|
+
className: `${baseClass}__field`,
|
|
56
|
+
children: locales.map((locale, index) => {
|
|
57
|
+
const versionLocaleValue = versionValue?.[locale];
|
|
58
|
+
const comparisonLocaleValue = comparisonValue?.[locale];
|
|
59
|
+
const cellProps = {
|
|
60
|
+
...baseCellProps,
|
|
61
|
+
comparison: comparisonLocaleValue,
|
|
62
|
+
version: versionLocaleValue
|
|
34
63
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
className: `${baseClass}__locale-value`
|
|
55
|
-
}, /*#__PURE__*/ React.createElement(Component, {
|
|
56
|
-
...cellProps,
|
|
57
|
-
locale: locale
|
|
58
|
-
})));
|
|
59
|
-
}));
|
|
60
|
-
}
|
|
61
|
-
return /*#__PURE__*/ React.createElement("div", {
|
|
62
|
-
className: `${baseClass}__field`,
|
|
63
|
-
key: i
|
|
64
|
-
}, /*#__PURE__*/ React.createElement(Component, baseCellProps));
|
|
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
|
-
}
|
|
64
|
+
return /*#__PURE__*/_jsx("div", {
|
|
65
|
+
className: `${baseClass}__locale`,
|
|
66
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
67
|
+
className: `${baseClass}__locale-value`,
|
|
68
|
+
children: /*#__PURE__*/_jsx(Component, {
|
|
69
|
+
...cellProps,
|
|
70
|
+
locale: locale
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
}, [locale, index].join('-'));
|
|
74
|
+
})
|
|
75
|
+
}, i);
|
|
76
|
+
}
|
|
77
|
+
return /*#__PURE__*/_jsx("div", {
|
|
78
|
+
className: `${baseClass}__field`,
|
|
79
|
+
children: /*#__PURE__*/_jsx(Component, {
|
|
80
|
+
...baseCellProps
|
|
81
|
+
})
|
|
82
|
+
}, i);
|
|
94
83
|
}
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
if (field.type === 'tabs' && 'tabs' in field) {
|
|
85
|
+
const Tabs = diffComponents.tabs;
|
|
86
|
+
return /*#__PURE__*/_jsx(Tabs, {
|
|
87
|
+
comparison: comparison,
|
|
88
|
+
diffComponents: diffComponents,
|
|
89
|
+
field: field,
|
|
90
|
+
fields: [],
|
|
91
|
+
i18n: i18n,
|
|
92
|
+
locales: locales,
|
|
93
|
+
version: version
|
|
94
|
+
}, i);
|
|
95
|
+
}
|
|
96
|
+
// At this point, we are dealing with a `row`, etc
|
|
97
|
+
if ('fields' in field) {
|
|
98
|
+
return /*#__PURE__*/_jsx(Nested, {
|
|
99
|
+
comparison: comparison,
|
|
100
|
+
diffComponents: diffComponents,
|
|
101
|
+
disableGutter: true,
|
|
102
|
+
field: field,
|
|
103
|
+
fields: field.fields,
|
|
104
|
+
i18n: i18n,
|
|
105
|
+
locales: locales,
|
|
106
|
+
permissions: fieldPermissions,
|
|
107
|
+
version: version
|
|
108
|
+
}, i);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
})
|
|
113
|
+
});
|
|
97
114
|
};
|
|
98
115
|
export default RenderFieldsToDiff;
|
|
99
|
-
|
|
100
116
|
//# 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
|
|
1
|
+
{"version":3,"file":"index.js","names":["fieldAffectsData","React","diffMethods","Nested","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","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 { 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 { diffMethods } from './fields/diffMethods.js'\nimport Nested from './fields/Nested/index.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') {\n return null\n }\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 =\n fieldPermissions?.[fieldName] === true || fieldPermissions?.[fieldName]?.read\n\n const subFieldPermissions =\n fieldPermissions?.[fieldName] === true || fieldPermissions?.[fieldName]?.fields\n\n if (!hasPermission) {\n return null\n }\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' && 'tabs' 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":"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","ignoreList":[]}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
@import '../../../scss/styles.scss';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
gap: var(--base);
|
|
7
|
-
|
|
8
|
-
&__field {
|
|
9
|
-
overflow-wrap: anywhere;
|
|
3
|
+
@layer payload-default {
|
|
4
|
+
.render-field-diffs {
|
|
10
5
|
display: flex;
|
|
11
6
|
flex-direction: column;
|
|
12
7
|
gap: var(--base);
|
|
13
|
-
}
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
&__field {
|
|
10
|
+
overflow-wrap: anywhere;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: var(--base);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@include small-break {
|
|
17
|
+
gap: calc(var(--base) / 2);
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { FieldPermissions } from 'payload/auth';
|
|
1
|
+
import type { I18nClient } from '@payloadcms/translations';
|
|
2
|
+
import type { ClientField, SanitizedFieldPermissions } 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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
readonly comparison: Record<string, any>;
|
|
7
|
+
readonly diffComponents: DiffComponents;
|
|
8
|
+
readonly fieldPermissions: {
|
|
9
|
+
[key: string]: SanitizedFieldPermissions;
|
|
10
|
+
} | true;
|
|
11
|
+
readonly fields: ClientField[];
|
|
12
|
+
readonly i18n: I18nClient;
|
|
13
|
+
readonly locales: string[];
|
|
14
|
+
readonly version: Record<string, any>;
|
|
14
15
|
};
|
|
15
|
-
export type FieldDiffProps =
|
|
16
|
+
export type FieldDiffProps = {
|
|
16
17
|
diffMethod: DiffMethod;
|
|
17
|
-
field:
|
|
18
|
+
field: ClientField;
|
|
18
19
|
isRichText: boolean;
|
|
19
|
-
};
|
|
20
|
+
} & Props;
|
|
20
21
|
//# 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,yBAAyB,EAAE,MAAM,SAAS,CAAA;AACrE,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,EACrB;QACE,CAAC,GAAG,EAAE,MAAM,GAAG,yBAAyB,CAAA;KACzC,GACD,IAAI,CAAA;IACR,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, SanitizedFieldPermissions } 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:\n | {\n [key: string]: SanitizedFieldPermissions\n }\n | true\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":"AAoBA","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;AAEvC,OAAO,cAAc,CAAA;AAKrB,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAiH5B,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1,74 +1,125 @@
|
|
|
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, Modal, 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';
|
|
11
10
|
const baseClass = 'restore-version';
|
|
12
11
|
const modalSlug = 'restore-version';
|
|
13
|
-
const Restore = ({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
const Restore = ({
|
|
13
|
+
className,
|
|
14
|
+
collectionSlug,
|
|
15
|
+
globalSlug,
|
|
16
|
+
label,
|
|
17
|
+
originalDocID,
|
|
18
|
+
status,
|
|
19
|
+
versionDate,
|
|
20
|
+
versionID
|
|
21
|
+
}) => {
|
|
22
|
+
const {
|
|
23
|
+
config: {
|
|
24
|
+
collections,
|
|
25
|
+
routes: {
|
|
26
|
+
admin: adminRoute,
|
|
27
|
+
api: apiRoute
|
|
28
|
+
},
|
|
29
|
+
serverURL
|
|
27
30
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
} = useConfig();
|
|
32
|
+
const collectionConfig = collections.find(collection => collection.slug === collectionSlug);
|
|
33
|
+
const {
|
|
34
|
+
toggleModal
|
|
35
|
+
} = useModal();
|
|
36
|
+
const [processing, setProcessing] = useState(false);
|
|
37
|
+
const router = useRouter();
|
|
38
|
+
const {
|
|
39
|
+
i18n,
|
|
40
|
+
t
|
|
41
|
+
} = useTranslation();
|
|
42
|
+
const [draft, setDraft] = useState(false);
|
|
43
|
+
const restoreMessage = t('version:aboutToRestoreGlobal', {
|
|
44
|
+
label: getTranslation(label, i18n),
|
|
45
|
+
versionDate
|
|
46
|
+
});
|
|
47
|
+
let fetchURL = `${serverURL}${apiRoute}`;
|
|
48
|
+
let redirectURL;
|
|
49
|
+
const canRestoreAsDraft = status !== 'draft' && collectionConfig?.versions?.drafts;
|
|
50
|
+
if (collectionSlug) {
|
|
51
|
+
fetchURL = `${fetchURL}/${collectionSlug}/versions/${versionID}?draft=${draft}`;
|
|
52
|
+
redirectURL = formatAdminURL({
|
|
53
|
+
adminRoute,
|
|
54
|
+
path: `/collections/${collectionSlug}/${originalDocID}`
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (globalSlug) {
|
|
58
|
+
fetchURL = `${fetchURL}/globals/${globalSlug}/versions/${versionID}?draft=${draft}`;
|
|
59
|
+
redirectURL = formatAdminURL({
|
|
60
|
+
adminRoute,
|
|
61
|
+
path: `/globals/${globalSlug}`
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const handleRestore = useCallback(async () => {
|
|
65
|
+
setProcessing(true);
|
|
66
|
+
const res = await requests.post(fetchURL, {
|
|
67
|
+
headers: {
|
|
68
|
+
'Accept-Language': i18n.language
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
if (res.status === 200) {
|
|
72
|
+
const json = await res.json();
|
|
73
|
+
toast.success(json.message);
|
|
74
|
+
router.push(redirectURL);
|
|
75
|
+
} else {
|
|
76
|
+
toast.error(t('version:problemRestoringVersion'));
|
|
31
77
|
}
|
|
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
|
-
|
|
78
|
+
}, [fetchURL, redirectURL, t, i18n, router]);
|
|
79
|
+
return /*#__PURE__*/_jsxs(Fragment, {
|
|
80
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
81
|
+
className: [baseClass, className].filter(Boolean).join(' '),
|
|
82
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
83
|
+
buttonStyle: "pill",
|
|
84
|
+
className: [canRestoreAsDraft && `${baseClass}__button`].filter(Boolean).join(' '),
|
|
85
|
+
onClick: () => toggleModal(modalSlug),
|
|
86
|
+
size: "small",
|
|
87
|
+
SubMenuPopupContent: () => canRestoreAsDraft && /*#__PURE__*/_jsx(PopupList.ButtonGroup, {
|
|
88
|
+
children: /*#__PURE__*/_jsx(PopupList.Button, {
|
|
89
|
+
onClick: () => [setDraft(true), toggleModal(modalSlug)],
|
|
90
|
+
children: t('version:restoreAsDraft')
|
|
91
|
+
})
|
|
92
|
+
}),
|
|
93
|
+
children: t('version:restoreThisVersion')
|
|
94
|
+
})
|
|
95
|
+
}), /*#__PURE__*/_jsx(Modal, {
|
|
96
|
+
className: `${baseClass}__modal`,
|
|
97
|
+
slug: modalSlug,
|
|
98
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
99
|
+
className: `${baseClass}__wrapper`,
|
|
100
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
101
|
+
className: `${baseClass}__content`,
|
|
102
|
+
children: [/*#__PURE__*/_jsx("h1", {
|
|
103
|
+
children: t('version:confirmVersionRestoration')
|
|
104
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
105
|
+
children: restoreMessage
|
|
106
|
+
})]
|
|
107
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
108
|
+
className: `${baseClass}__controls`,
|
|
109
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
110
|
+
buttonStyle: "secondary",
|
|
111
|
+
onClick: processing ? undefined : () => toggleModal(modalSlug),
|
|
112
|
+
size: "large",
|
|
113
|
+
type: "button",
|
|
114
|
+
children: t('general:cancel')
|
|
115
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
116
|
+
onClick: processing ? undefined : () => void handleRestore(),
|
|
117
|
+
children: processing ? t('version:restoring') : t('general:confirm')
|
|
118
|
+
})]
|
|
119
|
+
})]
|
|
120
|
+
})
|
|
121
|
+
})]
|
|
122
|
+
});
|
|
71
123
|
};
|
|
72
124
|
export default Restore;
|
|
73
|
-
|
|
74
125
|
//# 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","Modal","PopupList","useConfig","useModal","useTranslation","formatAdminURL","requests","useRouter","React","Fragment","useCallback","useState","toast","baseClass","modalSlug","Restore","className","collectionSlug","globalSlug","label","originalDocID","status","versionDate","versionID","config","collections","routes","admin","adminRoute","api","apiRoute","serverURL","collectionConfig","find","collection","slug","toggleModal","processing","setProcessing","router","i18n","t","draft","setDraft","restoreMessage","fetchURL","redirectURL","canRestoreAsDraft","versions","drafts","path","handleRestore","res","post","headers","language","json","success","message","push","error","_jsxs","_jsx","filter","Boolean","join","buttonStyle","onClick","size","SubMenuPopupContent","ButtonGroup","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 './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 collections,\n routes: { admin: adminRoute, api: apiRoute },\n serverURL,\n },\n } = useConfig()\n\n const collectionConfig = collections.find((collection) => collection.slug === collectionSlug)\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\n const canRestoreAsDraft = status !== 'draft' && collectionConfig?.versions?.drafts\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 <Button\n buttonStyle=\"pill\"\n className={[canRestoreAsDraft && `${baseClass}__button`].filter(Boolean).join(' ')}\n onClick={() => toggleModal(modalSlug)}\n size=\"small\"\n SubMenuPopupContent={() =>\n canRestoreAsDraft && (\n <PopupList.ButtonGroup>\n <PopupList.Button onClick={() => [setDraft(true), toggleModal(modalSlug)]}>\n {t('version:restoreAsDraft')}\n </PopupList.Button>\n </PopupList.ButtonGroup>\n )\n }\n >\n {t('version:restoreThisVersion')}\n </Button>\n </div>\n <Modal className={`${baseClass}__modal`} slug={modalSlug}>\n <div className={`${baseClass}__wrapper`}>\n <div className={`${baseClass}__content`}>\n <h1>{t('version:confirmVersionRestoration')}</h1>\n <p>{restoreMessage}</p>\n </div>\n <div className={`${baseClass}__controls`}>\n <Button\n buttonStyle=\"secondary\"\n onClick={processing ? undefined : () => toggleModal(modalSlug)}\n size=\"large\"\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 </div>\n </div>\n </Modal>\n </Fragment>\n )\n}\n\nexport default Restore\n"],"mappings":"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","ignoreList":[]}
|