@payloadcms/next 3.0.0-beta.5 → 3.0.0-beta.50
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 +52 -9
- 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.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 +13 -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 +43 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts +6 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js +58 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.scss +91 -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 +38 -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 +14 -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 +81 -0
- package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/index.scss +53 -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 +23 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts +7 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js +57 -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 +30 -0
- package/dist/elements/DocumentHeader/index.js.map +1 -0
- package/dist/elements/DocumentHeader/index.scss +51 -0
- package/dist/elements/LeaveWithoutSaving/index.d.ts.map +1 -1
- package/dist/elements/LeaveWithoutSaving/index.js +36 -20
- package/dist/elements/LeaveWithoutSaving/index.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 +24 -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 +20 -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 +21 -0
- package/dist/elements/Nav/NavWrapper/index.js.map +1 -0
- package/dist/elements/Nav/NavWrapper/index.scss +17 -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 +79 -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 +150 -0
- package/dist/exports/routes.d.ts +1 -1
- package/dist/exports/routes.d.ts.map +1 -1
- package/dist/exports/routes.js +1 -1
- 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 +4 -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 -1
- 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 -1
- package/dist/exports/views.js.map +1 -1
- package/dist/{next-fileupload → fetchAPI-multipart}/fileFactory.d.ts +2 -2
- package/dist/fetchAPI-multipart/fileFactory.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/fileFactory.js.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/handlers.d.ts +2 -2
- package/dist/fetchAPI-multipart/handlers.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/handlers.js.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/index.d.ts +10 -12
- package/dist/fetchAPI-multipart/index.d.ts.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/index.js +3 -5
- package/dist/fetchAPI-multipart/index.js.map +1 -0
- package/dist/fetchAPI-multipart/isEligibleRequest.d.ts.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/isEligibleRequest.js +1 -1
- 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/{next-fileupload → fetchAPI-multipart}/processMultipart.js +44 -15
- package/dist/fetchAPI-multipart/processMultipart.js.map +1 -0
- package/dist/fetchAPI-multipart/processNested.d.ts.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/processNested.js +2 -1
- 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.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/{next-fileupload → fetchAPI-multipart}/utilities.js +4 -4
- package/dist/fetchAPI-multipart/utilities.js.map +1 -0
- package/dist/fetchAPI-stream-file/index.d.ts.map +1 -0
- package/dist/fetchAPI-stream-file/index.js.map +1 -0
- package/dist/layouts/Root/index.d.ts +1 -2
- package/dist/layouts/Root/index.d.ts.map +1 -1
- package/dist/layouts/Root/index.js +52 -22
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/prod/index.js +55 -0
- package/dist/prod/payload/payload-favicon-dark.png +0 -0
- package/dist/prod/payload/payload-favicon-light.png +0 -0
- 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 +22 -10
- package/dist/routes/graphql/handler.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.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 -1
- 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 -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 +8 -3
- 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 +7 -1
- 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 +10 -8
- 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 +13 -9
- 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 +6 -2
- 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 +12 -10
- 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 +9 -7
- 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 +9 -7
- 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 +8 -3
- 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 +8 -3
- package/dist/routes/rest/auth/verifyEmail.js.map +1 -1
- package/dist/routes/rest/buildFormState.d.ts +2 -4
- package/dist/routes/rest/buildFormState.d.ts.map +1 -1
- package/dist/routes/rest/buildFormState.js +30 -145
- package/dist/routes/rest/buildFormState.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 +15 -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 +7 -2
- 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 +9 -2
- 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 +9 -2
- 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 +6 -1
- 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 +7 -2
- 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 +7 -2
- 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 +7 -2
- 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 +7 -2
- 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 +7 -2
- 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 +9 -4
- 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 +7 -2
- 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 +9 -2
- 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 +7 -2
- package/dist/routes/rest/collections/updateByID.js.map +1 -1
- package/dist/routes/rest/files/checkFileAccess.d.ts +3 -3
- package/dist/routes/rest/files/checkFileAccess.d.ts.map +1 -1
- package/dist/routes/rest/files/checkFileAccess.js +2 -2
- package/dist/routes/rest/files/checkFileAccess.js.map +1 -1
- package/dist/routes/rest/files/getFile.d.ts +2 -2
- package/dist/routes/rest/files/getFile.d.ts.map +1 -1
- package/dist/routes/rest/files/getFile.js +20 -11
- 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 +21 -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 +6 -1
- 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 +7 -2
- 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 +7 -2
- 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 +7 -2
- 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 +9 -4
- 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 +7 -2
- 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 +7 -2
- 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 +346 -215
- package/dist/routes/rest/index.js.map +1 -1
- package/dist/routes/rest/og/image.d.ts +9 -0
- package/dist/routes/rest/og/image.d.ts.map +1 -0
- package/dist/routes/rest/og/image.js +79 -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 +6 -5
- package/dist/routes/rest/routeError.d.ts.map +1 -1
- package/dist/routes/rest/routeError.js +26 -12
- package/dist/routes/rest/routeError.js.map +1 -1
- package/dist/routes/rest/types.d.ts +7 -7
- package/dist/routes/rest/types.d.ts.map +1 -1
- package/dist/routes/rest/types.js.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.map +1 -1
- package/dist/scss/app.scss +3 -4
- package/dist/scss/toasts.scss +111 -0
- package/dist/scss/vars.scss +0 -7
- 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 +13 -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 +18 -0
- package/dist/templates/Default/Wrapper/index.js.map +1 -0
- package/dist/templates/Default/Wrapper/index.scss +25 -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 +11 -0
- package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -0
- package/dist/utilities/addDataAndFileToRequest.js +45 -0
- package/dist/utilities/addDataAndFileToRequest.js.map +1 -0
- package/dist/utilities/addLocalesToRequest.d.ts +20 -0
- package/dist/utilities/addLocalesToRequest.d.ts.map +1 -0
- package/dist/utilities/addLocalesToRequest.js +44 -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 +24 -36
- package/dist/utilities/createPayloadRequest.js.map +1 -1
- package/dist/utilities/getNextRequestI18n.d.ts +2 -2
- package/dist/utilities/getNextRequestI18n.d.ts.map +1 -1
- package/dist/utilities/getNextRequestI18n.js +1 -1
- package/dist/utilities/getNextRequestI18n.js.map +1 -1
- package/dist/utilities/getPayloadHMR.d.ts +2 -2
- package/dist/utilities/getPayloadHMR.d.ts.map +1 -1
- package/dist/utilities/getPayloadHMR.js +36 -20
- 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 +4 -5
- package/dist/utilities/getRequestLanguage.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 +17 -0
- package/dist/utilities/headersWithCors.js.map +1 -0
- package/dist/utilities/initPage/handleAdminPage.d.ts +12 -0
- package/dist/utilities/initPage/handleAdminPage.d.ts.map +1 -0
- package/dist/utilities/initPage/handleAdminPage.js +35 -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 +27 -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 +132 -0
- package/dist/utilities/initPage/index.js.map +1 -0
- package/dist/utilities/initPage/shared.d.ts +4 -0
- package/dist/utilities/initPage/shared.d.ts.map +1 -0
- package/dist/utilities/initPage/shared.js +19 -0
- package/dist/utilities/initPage/shared.js.map +1 -0
- package/dist/utilities/initPage/types.d.ts +24 -0
- package/dist/utilities/initPage/types.d.ts.map +1 -0
- package/dist/utilities/initPage/types.js.map +1 -0
- package/dist/utilities/meta.d.ts +4 -8
- package/dist/utilities/meta.d.ts.map +1 -1
- package/dist/utilities/meta.js +63 -25
- package/dist/utilities/meta.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 +15 -0
- package/dist/views/API/LocaleSelector/index.js.map +1 -0
- package/dist/views/API/RenderJSON/index.js +101 -69
- 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 +130 -107
- package/dist/views/API/index.client.js.map +1 -1
- package/dist/views/API/index.d.ts +1 -1
- package/dist/views/API/index.d.ts.map +1 -1
- package/dist/views/API/index.js +2 -1
- package/dist/views/API/index.js.map +1 -1
- package/dist/views/API/meta.d.ts.map +1 -1
- package/dist/views/API/meta.js +13 -6
- 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 +19 -0
- package/dist/views/Account/Settings/LanguageSelector.js.map +1 -0
- package/dist/views/Account/Settings/index.d.ts +4 -0
- package/dist/views/Account/Settings/index.d.ts.map +1 -1
- package/dist/views/Account/Settings/index.js +25 -21
- 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 +3 -4
- package/dist/views/Account/ToggleTheme/index.js.map +1 -1
- 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 +69 -35
- 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 +4 -5
- package/dist/views/Account/meta.js.map +1 -1
- package/dist/views/CreateFirstUser/index.client.d.ts +3 -3
- package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +55 -11
- 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 +21 -31
- package/dist/views/CreateFirstUser/index.js.map +1 -1
- package/dist/views/CreateFirstUser/index.scss +2 -12
- package/dist/views/CreateFirstUser/meta.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/meta.js +4 -5
- 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 +116 -23
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- 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 +52 -13
- 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 +8 -5
- package/dist/views/Dashboard/meta.js.map +1 -1
- package/dist/views/Document/getCustomViewByKey.d.ts +1 -2
- package/dist/views/Document/getCustomViewByKey.d.ts.map +1 -1
- package/dist/views/Document/getCustomViewByKey.js +2 -1
- package/dist/views/Document/getCustomViewByKey.js.map +1 -1
- package/dist/views/Document/getCustomViewByRoute.d.ts +1 -2
- package/dist/views/Document/getCustomViewByRoute.d.ts.map +1 -1
- package/dist/views/Document/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Document/getDocumentData.d.ts +9 -0
- package/dist/views/Document/getDocumentData.d.ts.map +1 -0
- package/dist/views/Document/getDocumentData.js +31 -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 +82 -0
- package/dist/views/Document/getDocumentPermissions.js.map +1 -0
- package/dist/views/Document/getMetaBySegment.d.ts +1 -2
- package/dist/views/Document/getMetaBySegment.d.ts.map +1 -1
- package/dist/views/Document/getMetaBySegment.js +1 -1
- package/dist/views/Document/getMetaBySegment.js.map +1 -1
- package/dist/views/Document/getViewsFromConfig.d.ts +1 -3
- package/dist/views/Document/getViewsFromConfig.d.ts.map +1 -1
- package/dist/views/Document/getViewsFromConfig.js +172 -171
- 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 +90 -56
- package/dist/views/Document/index.js.map +1 -1
- package/dist/views/Edit/Default/Auth/APIKey.d.ts +1 -0
- package/dist/views/Edit/Default/Auth/APIKey.d.ts.map +1 -1
- package/dist/views/Edit/Default/Auth/APIKey.js +57 -40
- 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 +87 -62
- package/dist/views/Edit/Default/Auth/index.js.map +1 -1
- package/dist/views/Edit/Default/Auth/types.d.ts +1 -2
- package/dist/views/Edit/Default/Auth/types.d.ts.map +1 -1
- package/dist/views/Edit/Default/Auth/types.js.map +1 -1
- package/dist/views/Edit/Default/{SetStepNav → SetDocumentStepNav}/index.d.ts +2 -2
- package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts.map +1 -0
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js +69 -0
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js.map +1 -0
- package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts +1 -1
- package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/SetDocumentTitle/index.js +2 -4
- 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 +83 -84
- package/dist/views/Edit/Default/index.js.map +1 -1
- 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.map +1 -1
- package/dist/views/Edit/index.client.d.ts.map +1 -1
- package/dist/views/Edit/index.client.js +12 -10
- package/dist/views/Edit/index.client.js.map +1 -1
- package/dist/views/Edit/index.d.ts +1 -1
- package/dist/views/Edit/index.d.ts.map +1 -1
- package/dist/views/Edit/index.js +2 -1
- 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 +17 -15
- 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.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 +76 -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 +40 -57
- 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 +4 -5
- 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 +163 -112
- package/dist/views/List/Default/index.js.map +1 -1
- 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.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 +62 -45
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/List/meta.d.ts +1 -1
- package/dist/views/List/meta.d.ts.map +1 -1
- package/dist/views/List/meta.js +4 -2
- package/dist/views/List/meta.js.map +1 -1
- package/dist/views/LivePreview/Context/context.d.ts +3 -3
- package/dist/views/LivePreview/Context/context.d.ts.map +1 -1
- package/dist/views/LivePreview/Context/context.js.map +1 -1
- package/dist/views/LivePreview/Context/index.d.ts +1 -2
- package/dist/views/LivePreview/Context/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Context/index.js +10 -7
- package/dist/views/LivePreview/Context/index.js.map +1 -1
- package/dist/views/LivePreview/Device/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Device/index.js +48 -18
- package/dist/views/LivePreview/Device/index.js.map +1 -1
- package/dist/views/LivePreview/DeviceContainer/index.js +5 -3
- package/dist/views/LivePreview/DeviceContainer/index.js.map +1 -1
- package/dist/views/LivePreview/IFrame/index.js +2 -1
- 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 +50 -18
- 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 +111 -65
- package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js +2 -1
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/index.d.ts +1 -1
- package/dist/views/LivePreview/Toolbar/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Toolbar/index.js +30 -15
- package/dist/views/LivePreview/Toolbar/index.js.map +1 -1
- package/dist/views/LivePreview/ToolbarArea/index.js +5 -3
- package/dist/views/LivePreview/ToolbarArea/index.js.map +1 -1
- package/dist/views/LivePreview/index.client.d.ts +1 -2
- package/dist/views/LivePreview/index.client.d.ts.map +1 -1
- package/dist/views/LivePreview/index.client.js +125 -100
- package/dist/views/LivePreview/index.client.js.map +1 -1
- package/dist/views/LivePreview/index.d.ts +1 -1
- package/dist/views/LivePreview/index.d.ts.map +1 -1
- package/dist/views/LivePreview/index.js +2 -1
- 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 +6 -22
- package/dist/views/LivePreview/meta.js.map +1 -1
- package/dist/views/LivePreview/usePopupWindow.js +1 -1
- package/dist/views/LivePreview/usePopupWindow.js.map +1 -1
- package/dist/views/Login/LoginForm/index.d.ts.map +1 -1
- package/dist/views/Login/LoginForm/index.js +62 -28
- 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 +51 -15
- 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 +4 -5
- 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 +22 -11
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/Logout/index.d.ts +1 -1
- package/dist/views/Logout/index.d.ts.map +1 -1
- package/dist/views/Logout/index.js +10 -11
- 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 +2 -4
- 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 +23 -15
- package/dist/views/NotFound/index.client.js.map +1 -1
- package/dist/views/NotFound/index.d.ts +2 -2
- package/dist/views/NotFound/index.d.ts.map +1 -1
- package/dist/views/NotFound/index.js +29 -14
- package/dist/views/NotFound/index.js.map +1 -1
- package/dist/views/NotFound/meta.d.ts +1 -1
- package/dist/views/NotFound/meta.d.ts.map +1 -1
- package/dist/views/NotFound/meta.js +2 -4
- 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 +81 -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 +51 -56
- 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 +4 -5
- package/dist/views/ResetPassword/meta.js.map +1 -1
- package/dist/views/Root/getCustomViewByRoute.d.ts +1 -1
- package/dist/views/Root/getCustomViewByRoute.d.ts.map +1 -1
- package/dist/views/Root/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Root/getViewFromConfig.d.ts +2 -3
- package/dist/views/Root/getViewFromConfig.d.ts.map +1 -1
- package/dist/views/Root/getViewFromConfig.js +29 -12
- package/dist/views/Root/getViewFromConfig.js.map +1 -1
- package/dist/views/Root/index.d.ts +2 -1
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Root/index.js +44 -18
- package/dist/views/Root/index.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 +0 -19
- package/dist/views/Root/meta.js.map +1 -1
- package/dist/views/Unauthorized/index.d.ts +1 -1
- package/dist/views/Unauthorized/index.d.ts.map +1 -1
- package/dist/views/Unauthorized/index.js +21 -11
- 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 +4 -5
- 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 +24 -9
- 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 +4 -5
- package/dist/views/Verify/meta.js.map +1 -1
- package/dist/views/Version/Default/SetStepNav.d.ts +1 -1
- package/dist/views/Version/Default/SetStepNav.d.ts.map +1 -1
- package/dist/views/Version/Default/SetStepNav.js +2 -5
- 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 +85 -65
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/Default/types.d.ts +1 -3
- package/dist/views/Version/Default/types.d.ts.map +1 -1
- package/dist/views/Version/Default/types.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/Label/index.js +5 -3
- package/dist/views/Version/RenderFieldsToDiff/Label/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +66 -51
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +30 -18
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +25 -14
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js +2 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +22 -11
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts +1 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +31 -30
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js +2 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +22 -11
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts +7 -9
- package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts +3 -3
- package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.js +90 -87
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/types.d.ts +3 -3
- package/dist/views/Version/RenderFieldsToDiff/types.d.ts.map +1 -1
- 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 +52 -33
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/Restore/index.scss +4 -2
- package/dist/views/Version/Restore/types.d.ts +1 -1
- package/dist/views/Version/Restore/types.d.ts.map +1 -1
- 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 +34 -30
- package/dist/views/Version/SelectComparison/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/types.d.ts +1 -2
- package/dist/views/Version/SelectComparison/types.d.ts.map +1 -1
- 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 +19 -14
- 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.map +1 -1
- package/dist/views/Version/index.d.ts +1 -1
- package/dist/views/Version/index.d.ts.map +1 -1
- package/dist/views/Version/index.js +2 -1
- 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 +6 -3
- package/dist/views/Version/meta.js.map +1 -1
- package/dist/views/Versions/buildColumns.d.ts +2 -2
- package/dist/views/Versions/buildColumns.d.ts.map +1 -1
- package/dist/views/Versions/buildColumns.js +8 -7
- package/dist/views/Versions/buildColumns.js.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.d.ts.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.js +26 -6
- 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 +11 -11
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
- package/dist/views/Versions/cells/ID/index.js +5 -2
- package/dist/views/Versions/cells/ID/index.js.map +1 -1
- package/dist/views/Versions/index.client.d.ts +2 -2
- package/dist/views/Versions/index.client.d.ts.map +1 -1
- package/dist/views/Versions/index.client.js +62 -38
- package/dist/views/Versions/index.client.js.map +1 -1
- package/dist/views/Versions/index.d.ts +1 -1
- package/dist/views/Versions/index.d.ts.map +1 -1
- package/dist/views/Versions/index.js +34 -26
- 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 +8 -4
- 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.map +1 -1
- package/dist/withPayload.d.ts.map +1 -1
- package/dist/withPayload.js +52 -9
- package/dist/withPayload.js.map +1 -1
- package/package.json +43 -39
- package/dist/next-fileupload/fileFactory.d.ts.map +0 -1
- 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.map +0 -1
- package/dist/next-fileupload/index.d.ts.map +0 -1
- 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.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.map +0 -1
- package/dist/next-fileupload/processNested.d.ts.map +0 -1
- 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.map +0 -1
- package/dist/next-fileupload/utilities.d.ts.map +0 -1
- 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.map +0 -1
- package/dist/prod/payload/SuisseIntl-Bold.woff +0 -0
- package/dist/prod/payload/SuisseIntl-Bold.woff2 +0 -0
- package/dist/prod/payload/SuisseIntl-Medium.woff +0 -0
- package/dist/prod/payload/SuisseIntl-Medium.woff2 +0 -0
- package/dist/prod/payload/SuisseIntl-SemiBold.woff +0 -0
- package/dist/prod/payload/SuisseIntl-SemiBold.woff2 +0 -0
- package/dist/prod/payload/SuisseIntl.woff +0 -0
- package/dist/prod/payload/SuisseIntl.woff2 +0 -0
- package/dist/prod/payload/favicon.svg +0 -15
- package/dist/prod/payload/merriweather-v30-latin-900.woff +0 -0
- package/dist/prod/payload/merriweather-v30-latin-900.woff2 +0 -0
- package/dist/prod/payload/merriweather-v30-latin-900italic.woff +0 -0
- package/dist/prod/payload/merriweather-v30-latin-900italic.woff2 +0 -0
- package/dist/prod/payload/merriweather-v30-latin-italic.woff +0 -0
- package/dist/prod/payload/merriweather-v30-latin-italic.woff2 +0 -0
- package/dist/prod/payload/merriweather-v30-latin-regular.woff +0 -0
- package/dist/prod/payload/merriweather-v30-latin-regular.woff2 +0 -0
- package/dist/scss/fonts.scss +0 -75
- package/dist/scss/toastify.scss +0 -58
- 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.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 -64
- 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/src/index.js +0 -1
- /package/dist/{next-fileupload → fetchAPI-multipart}/fileFactory.js +0 -0
- /package/dist/{next-fileupload → fetchAPI-multipart}/handlers.js +0 -0
- /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
- /package/dist/{next-fileupload → fetchAPI-multipart}/uploadTimer.js +0 -0
- /package/dist/{next-stream-file → fetchAPI-stream-file}/index.d.ts +0 -0
- /package/dist/{next-stream-file → fetchAPI-stream-file}/index.js +0 -0
- /package/dist/prod/payload/{og-image.png → static-og-image.png} +0 -0
- /package/dist/utilities/{buildFieldSchemaMap → initPage}/types.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Metadata } from 'next';
|
|
2
|
-
import type { SanitizedCollectionConfig } from 'payload
|
|
2
|
+
import type { SanitizedCollectionConfig } from 'payload';
|
|
3
3
|
import type { GenerateViewMetadata } from '../Root/index.js';
|
|
4
4
|
export declare const generateListMetadata: (args: Parameters<GenerateViewMetadata>[0] & {
|
|
5
5
|
collectionConfig: SanitizedCollectionConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/views/List/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AACpC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/views/List/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AACpC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAIxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAI5D,eAAO,MAAM,oBAAoB,SACzB,WAAW,oBAAoB,CAAC,CAAC,CAAC,CAAC,GAAG;IAC1C,gBAAgB,EAAE,yBAAyB,CAAA;CAC5C,KACA,QAAQ,QAAQ,CAmBlB,CAAA"}
|
package/dist/views/List/meta.js
CHANGED
|
@@ -9,10 +9,12 @@ export const generateListMetadata = async (args)=>{
|
|
|
9
9
|
title = getTranslation(collectionConfig.labels.plural, i18n);
|
|
10
10
|
}
|
|
11
11
|
return meta({
|
|
12
|
-
config,
|
|
12
|
+
...config.admin.meta || {},
|
|
13
13
|
description,
|
|
14
14
|
keywords,
|
|
15
|
-
|
|
15
|
+
serverURL: config.serverURL,
|
|
16
|
+
title,
|
|
17
|
+
...collectionConfig.admin.meta || {}
|
|
16
18
|
});
|
|
17
19
|
};
|
|
18
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/List/meta.ts"],"sourcesContent":["import type { Metadata } from 'next'\nimport type { SanitizedCollectionConfig } from 'payload
|
|
1
|
+
{"version":3,"sources":["../../../src/views/List/meta.ts"],"sourcesContent":["import type { Metadata } from 'next'\nimport type { SanitizedCollectionConfig } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport type { GenerateViewMetadata } from '../Root/index.js'\n\nimport { meta } from '../../utilities/meta.js'\n\nexport const generateListMetadata = async (\n args: Parameters<GenerateViewMetadata>[0] & {\n collectionConfig: SanitizedCollectionConfig\n },\n): Promise<Metadata> => {\n const { collectionConfig, config, i18n } = args\n\n let title: string = ''\n const description: string = ''\n const keywords: string = ''\n\n if (collectionConfig) {\n title = getTranslation(collectionConfig.labels.plural, i18n)\n }\n\n return meta({\n ...(config.admin.meta || {}),\n description,\n keywords,\n serverURL: config.serverURL,\n title,\n ...(collectionConfig.admin.meta || {}),\n })\n}\n"],"names":["getTranslation","meta","generateListMetadata","args","collectionConfig","config","i18n","title","description","keywords","labels","plural","admin","serverURL"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,cAAc,QAAQ,2BAA0B;AAIzD,SAASC,IAAI,QAAQ,0BAAyB;AAE9C,OAAO,MAAMC,uBAAuB,OAClCC;IAIA,MAAM,EAAEC,gBAAgB,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAGH;IAE3C,IAAII,QAAgB;IACpB,MAAMC,cAAsB;IAC5B,MAAMC,WAAmB;IAEzB,IAAIL,kBAAkB;QACpBG,QAAQP,eAAeI,iBAAiBM,MAAM,CAACC,MAAM,EAAEL;IACzD;IAEA,OAAOL,KAAK;QACV,GAAII,OAAOO,KAAK,CAACX,IAAI,IAAI,CAAC,CAAC;QAC3BO;QACAC;QACAI,WAAWR,OAAOQ,SAAS;QAC3BN;QACA,GAAIH,iBAAiBQ,KAAK,CAACX,IAAI,IAAI,CAAC,CAAC;IACvC;AACF,EAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { LivePreviewConfig } from 'payload
|
|
2
|
-
import type { fieldSchemaToJSON } from 'payload/
|
|
1
|
+
import type { LivePreviewConfig } from 'payload';
|
|
2
|
+
import type { fieldSchemaToJSON } from 'payload/shared';
|
|
3
3
|
import type { Dispatch } from 'react';
|
|
4
4
|
import type { usePopupWindow } from '../usePopupWindow.js';
|
|
5
5
|
import type { SizeReducerAction } from './sizeReducer.js';
|
|
@@ -9,7 +9,7 @@ export interface LivePreviewContextType {
|
|
|
9
9
|
breakpoints: LivePreviewConfig['breakpoints'];
|
|
10
10
|
fieldSchemaJSON?: ReturnType<typeof fieldSchemaToJSON>;
|
|
11
11
|
iframeHasLoaded: boolean;
|
|
12
|
-
iframeRef: React.RefObject<HTMLIFrameElement>;
|
|
12
|
+
iframeRef: React.RefObject<HTMLIFrameElement | null>;
|
|
13
13
|
isPopupOpen: boolean;
|
|
14
14
|
measuredDeviceSize: {
|
|
15
15
|
height: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/Context/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/Context/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAIrC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEzD,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAA;IAC5D,WAAW,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAA;IAC7C,eAAe,CAAC,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAA;IACtD,eAAe,EAAE,OAAO,CAAA;IACxB,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IACpD,WAAW,EAAE,OAAO,CAAA;IACpB,kBAAkB,EAAE;QAClB,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,iBAAiB,CAAC,CAAA;IACrE,QAAQ,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAChD,iBAAiB,EAAE,QAAQ,GAAG,OAAO,CAAA;IACrC,aAAa,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAA;IAC5C,aAAa,EAAE,CAAC,UAAU,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;IACrF,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,kBAAkB,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;IAC7C,qBAAqB,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IACxE,oBAAoB,EAAE,CAAC,iBAAiB,EAAE,QAAQ,GAAG,OAAO,KAAK,IAAI,CAAA;IACrE,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAA;IACpC,kBAAkB,EAAE,CAAC,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IAChE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,eAAe,EAAE;QACf,CAAC,EAAE,MAAM,CAAA;QACT,CAAC,EAAE,MAAM,CAAA;KACV,CAAA;IACD,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,eAAO,MAAM,kBAAkB,iDAmC7B,CAAA;AAEF,eAAO,MAAM,qBAAqB,8BAAuC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/views/LivePreview/Context/context.ts"],"sourcesContent":["import type { LivePreviewConfig } from 'payload
|
|
1
|
+
{"version":3,"sources":["../../../../src/views/LivePreview/Context/context.ts"],"sourcesContent":["import type { LivePreviewConfig } from 'payload'\nimport type { fieldSchemaToJSON } from 'payload/shared'\nimport type { Dispatch } from 'react'\n\nimport { createContext, useContext } from 'react'\n\nimport type { usePopupWindow } from '../usePopupWindow.js'\nimport type { SizeReducerAction } from './sizeReducer.js'\n\nexport interface LivePreviewContextType {\n appIsReady: boolean\n breakpoint: LivePreviewConfig['breakpoints'][number]['name']\n breakpoints: LivePreviewConfig['breakpoints']\n fieldSchemaJSON?: ReturnType<typeof fieldSchemaToJSON>\n iframeHasLoaded: boolean\n iframeRef: React.RefObject<HTMLIFrameElement | null>\n isPopupOpen: boolean\n measuredDeviceSize: {\n height: number\n width: number\n }\n openPopupWindow: ReturnType<typeof usePopupWindow>['openPopupWindow']\n popupRef?: React.MutableRefObject<Window | null>\n previewWindowType: 'iframe' | 'popup'\n setAppIsReady: (appIsReady: boolean) => void\n setBreakpoint: (breakpoint: LivePreviewConfig['breakpoints'][number]['name']) => void\n setHeight: (height: number) => void\n setIframeHasLoaded: (loaded: boolean) => void\n setMeasuredDeviceSize: (size: { height: number; width: number }) => void\n setPreviewWindowType: (previewWindowType: 'iframe' | 'popup') => void\n setSize: Dispatch<SizeReducerAction>\n setToolbarPosition: (position: { x: number; y: number }) => void\n setWidth: (width: number) => void\n setZoom: (zoom: number) => void\n size: {\n height: number\n width: number\n }\n toolbarPosition: {\n x: number\n y: number\n }\n url: string | undefined\n zoom: number\n}\n\nexport const LivePreviewContext = createContext<LivePreviewContextType>({\n appIsReady: false,\n breakpoint: undefined,\n breakpoints: undefined,\n fieldSchemaJSON: undefined,\n iframeHasLoaded: false,\n iframeRef: undefined,\n isPopupOpen: false,\n measuredDeviceSize: {\n height: 0,\n width: 0,\n },\n openPopupWindow: () => {},\n popupRef: undefined,\n previewWindowType: 'iframe',\n setAppIsReady: () => {},\n setBreakpoint: () => {},\n setHeight: () => {},\n setIframeHasLoaded: () => {},\n setMeasuredDeviceSize: () => {},\n setPreviewWindowType: () => {},\n setSize: () => {},\n setToolbarPosition: () => {},\n setWidth: () => {},\n setZoom: () => {},\n size: {\n height: 0,\n width: 0,\n },\n toolbarPosition: {\n x: 0,\n y: 0,\n },\n url: undefined,\n zoom: 1,\n})\n\nexport const useLivePreviewContext = () => useContext(LivePreviewContext)\n"],"names":["createContext","useContext","LivePreviewContext","appIsReady","breakpoint","undefined","breakpoints","fieldSchemaJSON","iframeHasLoaded","iframeRef","isPopupOpen","measuredDeviceSize","height","width","openPopupWindow","popupRef","previewWindowType","setAppIsReady","setBreakpoint","setHeight","setIframeHasLoaded","setMeasuredDeviceSize","setPreviewWindowType","setSize","setToolbarPosition","setWidth","setZoom","size","toolbarPosition","x","y","url","zoom","useLivePreviewContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,aAAa,EAAEC,UAAU,QAAQ,QAAO;AA0CjD,OAAO,MAAMC,qBAAqBF,cAAsC;IACtEG,YAAY;IACZC,YAAYC;IACZC,aAAaD;IACbE,iBAAiBF;IACjBG,iBAAiB;IACjBC,WAAWJ;IACXK,aAAa;IACbC,oBAAoB;QAClBC,QAAQ;QACRC,OAAO;IACT;IACAC,iBAAiB,KAAO;IACxBC,UAAUV;IACVW,mBAAmB;IACnBC,eAAe,KAAO;IACtBC,eAAe,KAAO;IACtBC,WAAW,KAAO;IAClBC,oBAAoB,KAAO;IAC3BC,uBAAuB,KAAO;IAC9BC,sBAAsB,KAAO;IAC7BC,SAAS,KAAO;IAChBC,oBAAoB,KAAO;IAC3BC,UAAU,KAAO;IACjBC,SAAS,KAAO;IAChBC,MAAM;QACJf,QAAQ;QACRC,OAAO;IACT;IACAe,iBAAiB;QACfC,GAAG;QACHC,GAAG;IACL;IACAC,KAAK1B;IACL2B,MAAM;AACR,GAAE;AAEF,OAAO,MAAMC,wBAAwB,IAAMhC,WAAWC,oBAAmB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { LivePreviewConfig } from 'payload
|
|
2
|
-
import type { ClientFieldConfig } from 'payload/types';
|
|
1
|
+
import type { ClientFieldConfig, LivePreviewConfig } from 'payload';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import type { usePopupWindow } from '../usePopupWindow.js';
|
|
5
4
|
export type LivePreviewProviderProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/Context/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/Context/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAInE,OAAO,KAA2C,MAAM,OAAO,CAAA;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAM1D,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,WAAW,CAAC,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAA;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,UAAU,CAAC,EAAE;QACX,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,WAAW,EAAE,iBAAiB,EAAE,CAAA;IAChC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,eAAe,CAAC,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,iBAAiB,CAAC,CAAA;IACtE,QAAQ,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACzC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA0KlE,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { DndContext } from '@dnd-kit/core';
|
|
3
|
-
import { fieldSchemaToJSON } from 'payload/
|
|
4
|
+
import { fieldSchemaToJSON } from 'payload/shared';
|
|
4
5
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
5
6
|
import { customCollisionDetection } from './collisionDetection.js';
|
|
6
7
|
import { LivePreviewContext } from './context.js';
|
|
@@ -116,7 +117,7 @@ export const LivePreviewProvider = ({ breakpoints, children, fieldSchema, isPopu
|
|
|
116
117
|
isPopupOpen,
|
|
117
118
|
handleWindowChange
|
|
118
119
|
]);
|
|
119
|
-
return /*#__PURE__*/
|
|
120
|
+
return /*#__PURE__*/ _jsx(LivePreviewContext.Provider, {
|
|
120
121
|
value: {
|
|
121
122
|
appIsReady,
|
|
122
123
|
breakpoint,
|
|
@@ -143,11 +144,13 @@ export const LivePreviewProvider = ({ breakpoints, children, fieldSchema, isPopu
|
|
|
143
144
|
toolbarPosition: position,
|
|
144
145
|
url,
|
|
145
146
|
zoom
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
},
|
|
148
|
+
children: /*#__PURE__*/ _jsx(DndContext, {
|
|
149
|
+
collisionDetection: customCollisionDetection,
|
|
150
|
+
onDragEnd: handleDragEnd,
|
|
151
|
+
children: listeningForMessages && children
|
|
152
|
+
})
|
|
153
|
+
});
|
|
151
154
|
};
|
|
152
155
|
|
|
153
156
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/views/LivePreview/Context/index.tsx"],"sourcesContent":["'use client'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../../src/views/LivePreview/Context/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientFieldConfig, LivePreviewConfig } from 'payload'\n\nimport { DndContext } from '@dnd-kit/core'\nimport { fieldSchemaToJSON } from 'payload/shared'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport type { usePopupWindow } from '../usePopupWindow.js'\n\nimport { customCollisionDetection } from './collisionDetection.js'\nimport { LivePreviewContext } from './context.js'\nimport { sizeReducer } from './sizeReducer.js'\n\nexport type LivePreviewProviderProps = {\n appIsReady?: boolean\n breakpoints?: LivePreviewConfig['breakpoints']\n children: React.ReactNode\n deviceSize?: {\n height: number\n width: number\n }\n fieldSchema: ClientFieldConfig[]\n isPopupOpen?: boolean\n openPopupWindow?: ReturnType<typeof usePopupWindow>['openPopupWindow']\n popupRef?: React.MutableRefObject<Window>\n url?: string\n}\n\nexport const LivePreviewProvider: React.FC<LivePreviewProviderProps> = ({\n breakpoints,\n children,\n fieldSchema,\n isPopupOpen,\n openPopupWindow,\n popupRef,\n url,\n}) => {\n const [previewWindowType, setPreviewWindowType] = useState<'iframe' | 'popup'>('iframe')\n\n const [appIsReady, setAppIsReady] = useState(false)\n const [listeningForMessages, setListeningForMessages] = useState(false)\n\n const iframeRef = React.useRef<HTMLIFrameElement>(null)\n\n const [iframeHasLoaded, setIframeHasLoaded] = useState(false)\n\n const [zoom, setZoom] = useState(1)\n\n const [position, setPosition] = useState({ x: 0, y: 0 })\n\n const [size, setSize] = React.useReducer(sizeReducer, { height: 0, width: 0 })\n\n const [measuredDeviceSize, setMeasuredDeviceSize] = useState({\n height: 0,\n width: 0,\n })\n\n const [breakpoint, setBreakpoint] =\n React.useState<LivePreviewConfig['breakpoints'][0]['name']>('responsive')\n\n const [fieldSchemaJSON] = useState(() => {\n return fieldSchemaToJSON(fieldSchema)\n })\n\n // The toolbar needs to freely drag and drop around the page\n const handleDragEnd = (ev) => {\n // only update position if the toolbar is completely within the preview area\n // otherwise reset it back to the previous position\n // TODO: reset to the nearest edge of the preview area\n if (ev.over && ev.over.id === 'live-preview-area') {\n const newPos = {\n x: position.x + ev.delta.x,\n y: position.y + ev.delta.y,\n }\n\n setPosition(newPos)\n } else {\n // reset\n }\n }\n\n const setWidth = useCallback(\n (width) => {\n setSize({ type: 'width', value: width })\n },\n [setSize],\n )\n\n const setHeight = useCallback(\n (height) => {\n setSize({ type: 'height', value: height })\n },\n [setSize],\n )\n\n // explicitly set new width and height when as new breakpoints are selected\n // exclude `custom` breakpoint as it is handled by the `setWidth` and `setHeight` directly\n useEffect(() => {\n const foundBreakpoint = breakpoints?.find((bp) => bp.name === breakpoint)\n\n if (\n foundBreakpoint &&\n breakpoint !== 'responsive' &&\n breakpoint !== 'custom' &&\n typeof foundBreakpoint?.width === 'number' &&\n typeof foundBreakpoint?.height === 'number'\n ) {\n setSize({\n type: 'reset',\n value: {\n height: foundBreakpoint.height,\n width: foundBreakpoint.width,\n },\n })\n }\n }, [breakpoint, breakpoints])\n\n // Receive the `ready` message from the popup window\n // This indicates that the app is ready to receive `window.postMessage` events\n // This is also the only cross-origin way of detecting when a popup window has loaded\n // Unlike iframe elements which have an `onLoad` handler, there is no way to access `window.open` on popups\n useEffect(() => {\n const handleMessage = (event: MessageEvent) => {\n if (\n url?.startsWith(event.origin) &&\n event.data &&\n typeof event.data === 'object' &&\n event.data.type === 'payload-live-preview'\n ) {\n if (event.data.ready) {\n setAppIsReady(true)\n }\n }\n }\n\n window.addEventListener('message', handleMessage)\n\n setListeningForMessages(true)\n\n return () => {\n window.removeEventListener('message', handleMessage)\n }\n }, [url, listeningForMessages])\n\n const handleWindowChange = useCallback(\n (type: 'iframe' | 'popup') => {\n setAppIsReady(false)\n setPreviewWindowType(type)\n if (type === 'popup') openPopupWindow()\n },\n [openPopupWindow],\n )\n\n // when the user closes the popup window, switch back to the iframe\n // the `usePopupWindow` reports the `isPopupOpen` state for us to use here\n useEffect(() => {\n const newPreviewWindowType = isPopupOpen ? 'popup' : 'iframe'\n\n if (newPreviewWindowType !== previewWindowType) {\n handleWindowChange('iframe')\n }\n }, [previewWindowType, isPopupOpen, handleWindowChange])\n\n return (\n <LivePreviewContext.Provider\n value={{\n appIsReady,\n breakpoint,\n breakpoints,\n fieldSchemaJSON,\n iframeHasLoaded,\n iframeRef,\n isPopupOpen,\n measuredDeviceSize,\n openPopupWindow,\n popupRef,\n previewWindowType,\n setAppIsReady,\n setBreakpoint,\n setHeight,\n setIframeHasLoaded,\n setMeasuredDeviceSize,\n setPreviewWindowType: handleWindowChange,\n setSize,\n setToolbarPosition: setPosition,\n setWidth,\n setZoom,\n size,\n toolbarPosition: position,\n url,\n zoom,\n }}\n >\n <DndContext collisionDetection={customCollisionDetection} onDragEnd={handleDragEnd}>\n {listeningForMessages && children}\n </DndContext>\n </LivePreviewContext.Provider>\n )\n}\n"],"names":["DndContext","fieldSchemaToJSON","React","useCallback","useEffect","useState","customCollisionDetection","LivePreviewContext","sizeReducer","LivePreviewProvider","breakpoints","children","fieldSchema","isPopupOpen","openPopupWindow","popupRef","url","previewWindowType","setPreviewWindowType","appIsReady","setAppIsReady","listeningForMessages","setListeningForMessages","iframeRef","useRef","iframeHasLoaded","setIframeHasLoaded","zoom","setZoom","position","setPosition","x","y","size","setSize","useReducer","height","width","measuredDeviceSize","setMeasuredDeviceSize","breakpoint","setBreakpoint","fieldSchemaJSON","handleDragEnd","ev","over","id","newPos","delta","setWidth","type","value","setHeight","foundBreakpoint","find","bp","name","handleMessage","event","startsWith","origin","data","ready","window","addEventListener","removeEventListener","handleWindowChange","newPreviewWindowType","Provider","setToolbarPosition","toolbarPosition","collisionDetection","onDragEnd"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAGA,SAASA,UAAU,QAAQ,gBAAe;AAC1C,SAASC,iBAAiB,QAAQ,iBAAgB;AAClD,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAI/D,SAASC,wBAAwB,QAAQ,0BAAyB;AAClE,SAASC,kBAAkB,QAAQ,eAAc;AACjD,SAASC,WAAW,QAAQ,mBAAkB;AAiB9C,OAAO,MAAMC,sBAA0D,CAAC,EACtEC,WAAW,EACXC,QAAQ,EACRC,WAAW,EACXC,WAAW,EACXC,eAAe,EACfC,QAAQ,EACRC,GAAG,EACJ;IACC,MAAM,CAACC,mBAAmBC,qBAAqB,GAAGb,SAA6B;IAE/E,MAAM,CAACc,YAAYC,cAAc,GAAGf,SAAS;IAC7C,MAAM,CAACgB,sBAAsBC,wBAAwB,GAAGjB,SAAS;IAEjE,MAAMkB,YAAYrB,MAAMsB,MAAM,CAAoB;IAElD,MAAM,CAACC,iBAAiBC,mBAAmB,GAAGrB,SAAS;IAEvD,MAAM,CAACsB,MAAMC,QAAQ,GAAGvB,SAAS;IAEjC,MAAM,CAACwB,UAAUC,YAAY,GAAGzB,SAAS;QAAE0B,GAAG;QAAGC,GAAG;IAAE;IAEtD,MAAM,CAACC,MAAMC,QAAQ,GAAGhC,MAAMiC,UAAU,CAAC3B,aAAa;QAAE4B,QAAQ;QAAGC,OAAO;IAAE;IAE5E,MAAM,CAACC,oBAAoBC,sBAAsB,GAAGlC,SAAS;QAC3D+B,QAAQ;QACRC,OAAO;IACT;IAEA,MAAM,CAACG,YAAYC,cAAc,GAC/BvC,MAAMG,QAAQ,CAA8C;IAE9D,MAAM,CAACqC,gBAAgB,GAAGrC,SAAS;QACjC,OAAOJ,kBAAkBW;IAC3B;IAEA,4DAA4D;IAC5D,MAAM+B,gBAAgB,CAACC;QACrB,4EAA4E;QAC5E,mDAAmD;QACnD,sDAAsD;QACtD,IAAIA,GAAGC,IAAI,IAAID,GAAGC,IAAI,CAACC,EAAE,KAAK,qBAAqB;YACjD,MAAMC,SAAS;gBACbhB,GAAGF,SAASE,CAAC,GAAGa,GAAGI,KAAK,CAACjB,CAAC;gBAC1BC,GAAGH,SAASG,CAAC,GAAGY,GAAGI,KAAK,CAAChB,CAAC;YAC5B;YAEAF,YAAYiB;QACd,OAAO;QACL,QAAQ;QACV;IACF;IAEA,MAAME,WAAW9C,YACf,CAACkC;QACCH,QAAQ;YAAEgB,MAAM;YAASC,OAAOd;QAAM;IACxC,GACA;QAACH;KAAQ;IAGX,MAAMkB,YAAYjD,YAChB,CAACiC;QACCF,QAAQ;YAAEgB,MAAM;YAAUC,OAAOf;QAAO;IAC1C,GACA;QAACF;KAAQ;IAGX,2EAA2E;IAC3E,0FAA0F;IAC1F9B,UAAU;QACR,MAAMiD,kBAAkB3C,aAAa4C,KAAK,CAACC,KAAOA,GAAGC,IAAI,KAAKhB;QAE9D,IACEa,mBACAb,eAAe,gBACfA,eAAe,YACf,OAAOa,iBAAiBhB,UAAU,YAClC,OAAOgB,iBAAiBjB,WAAW,UACnC;YACAF,QAAQ;gBACNgB,MAAM;gBACNC,OAAO;oBACLf,QAAQiB,gBAAgBjB,MAAM;oBAC9BC,OAAOgB,gBAAgBhB,KAAK;gBAC9B;YACF;QACF;IACF,GAAG;QAACG;QAAY9B;KAAY;IAE5B,oDAAoD;IACpD,8EAA8E;IAC9E,qFAAqF;IACrF,2GAA2G;IAC3GN,UAAU;QACR,MAAMqD,gBAAgB,CAACC;YACrB,IACE1C,KAAK2C,WAAWD,MAAME,MAAM,KAC5BF,MAAMG,IAAI,IACV,OAAOH,MAAMG,IAAI,KAAK,YACtBH,MAAMG,IAAI,CAACX,IAAI,KAAK,wBACpB;gBACA,IAAIQ,MAAMG,IAAI,CAACC,KAAK,EAAE;oBACpB1C,cAAc;gBAChB;YACF;QACF;QAEA2C,OAAOC,gBAAgB,CAAC,WAAWP;QAEnCnC,wBAAwB;QAExB,OAAO;YACLyC,OAAOE,mBAAmB,CAAC,WAAWR;QACxC;IACF,GAAG;QAACzC;QAAKK;KAAqB;IAE9B,MAAM6C,qBAAqB/D,YACzB,CAAC+C;QACC9B,cAAc;QACdF,qBAAqBgC;QACrB,IAAIA,SAAS,SAASpC;IACxB,GACA;QAACA;KAAgB;IAGnB,mEAAmE;IACnE,0EAA0E;IAC1EV,UAAU;QACR,MAAM+D,uBAAuBtD,cAAc,UAAU;QAErD,IAAIsD,yBAAyBlD,mBAAmB;YAC9CiD,mBAAmB;QACrB;IACF,GAAG;QAACjD;QAAmBJ;QAAaqD;KAAmB;IAEvD,qBACE,KAAC3D,mBAAmB6D,QAAQ;QAC1BjB,OAAO;YACLhC;YACAqB;YACA9B;YACAgC;YACAjB;YACAF;YACAV;YACAyB;YACAxB;YACAC;YACAE;YACAG;YACAqB;YACAW;YACA1B;YACAa;YACArB,sBAAsBgD;YACtBhC;YACAmC,oBAAoBvC;YACpBmB;YACArB;YACAK;YACAqC,iBAAiBzC;YACjBb;YACAW;QACF;kBAEA,cAAA,KAAC3B;YAAWuE,oBAAoBjE;YAA0BkE,WAAW7B;sBAClEtB,wBAAwBV;;;AAIjC,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/Device/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAIxC,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/Device/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAIxC,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CA4FA,CAAA"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useResize } from '@payloadcms/ui/client';
|
|
3
4
|
import React, { useEffect } from 'react';
|
|
4
5
|
import { useLivePreviewContext } from '../Context/context.js';
|
|
5
6
|
export const DeviceContainer = (props)=>{
|
|
6
7
|
const { children } = props;
|
|
7
8
|
const deviceFrameRef = React.useRef(null);
|
|
8
|
-
const
|
|
9
|
+
const outerFrameRef = React.useRef(null);
|
|
10
|
+
const { breakpoint, setMeasuredDeviceSize, size: desiredSize, zoom } = useLivePreviewContext();
|
|
9
11
|
// Keep an accurate measurement of the actual device size as it is truly rendered
|
|
10
12
|
// This is helpful when `sizes` are non-number units like percentages, etc.
|
|
11
|
-
const { size: measuredDeviceSize } = useResize(deviceFrameRef);
|
|
13
|
+
const { size: measuredDeviceSize } = useResize(deviceFrameRef.current);
|
|
14
|
+
const { size: outerFrameSize } = useResize(outerFrameRef.current);
|
|
15
|
+
let deviceIsLargerThanFrame = false;
|
|
12
16
|
// Sync the measured device size with the context so that other components can use it
|
|
13
17
|
// This happens from the bottom up so that as this component mounts and unmounts,
|
|
14
|
-
//
|
|
18
|
+
// its size is freshly populated again upon re-mounting, i.e. going from iframe->popup->iframe
|
|
15
19
|
useEffect(()=>{
|
|
16
20
|
if (measuredDeviceSize) {
|
|
17
21
|
setMeasuredDeviceSize(measuredDeviceSize);
|
|
@@ -24,28 +28,54 @@ export const DeviceContainer = (props)=>{
|
|
|
24
28
|
let margin = '0';
|
|
25
29
|
if (breakpoint && breakpoint !== 'responsive') {
|
|
26
30
|
x = '-50%';
|
|
27
|
-
if (typeof zoom === 'number' && typeof
|
|
28
|
-
const scaledWidth = size.width / zoom;
|
|
29
|
-
const difference = scaledWidth - size.width;
|
|
30
|
-
x = `${difference / 2}px`;
|
|
31
|
+
if (typeof zoom === 'number' && typeof desiredSize.width === 'number' && typeof desiredSize.height === 'number' && typeof measuredDeviceSize.width === 'number' && typeof measuredDeviceSize.height === 'number') {
|
|
31
32
|
margin = '0 auto';
|
|
33
|
+
const scaledDesiredWidth = desiredSize.width / zoom;
|
|
34
|
+
const scaledDeviceWidth = measuredDeviceSize.width * zoom;
|
|
35
|
+
const scaledDeviceDifferencePixels = scaledDesiredWidth - desiredSize.width;
|
|
36
|
+
deviceIsLargerThanFrame = scaledDeviceWidth > outerFrameSize.width;
|
|
37
|
+
if (deviceIsLargerThanFrame) {
|
|
38
|
+
if (zoom > 1) {
|
|
39
|
+
const differenceFromDeviceToFrame = measuredDeviceSize.width - outerFrameSize.width;
|
|
40
|
+
if (differenceFromDeviceToFrame < 0) x = `${differenceFromDeviceToFrame / 2}px`;
|
|
41
|
+
else x = '0';
|
|
42
|
+
} else {
|
|
43
|
+
x = '0';
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
if (zoom >= 1) {
|
|
47
|
+
x = `${scaledDeviceDifferencePixels / 2}px`;
|
|
48
|
+
} else {
|
|
49
|
+
const differenceFromDeviceToFrame = outerFrameSize.width - scaledDeviceWidth;
|
|
50
|
+
x = `${differenceFromDeviceToFrame / 2}px`;
|
|
51
|
+
margin = '0';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
32
54
|
}
|
|
33
55
|
}
|
|
34
56
|
let width = zoom ? `${100 / zoom}%` : '100%';
|
|
35
57
|
let height = zoom ? `${100 / zoom}%` : '100%';
|
|
36
58
|
if (breakpoint !== 'responsive') {
|
|
37
|
-
width = `${
|
|
38
|
-
height = `${
|
|
59
|
+
width = `${desiredSize?.width / (typeof zoom === 'number' ? zoom : 1)}px`;
|
|
60
|
+
height = `${desiredSize?.height / (typeof zoom === 'number' ? zoom : 1)}px`;
|
|
39
61
|
}
|
|
40
|
-
return /*#__PURE__*/
|
|
41
|
-
ref:
|
|
62
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
63
|
+
ref: outerFrameRef,
|
|
42
64
|
style: {
|
|
43
|
-
height,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
65
|
+
height: '100%',
|
|
66
|
+
width: '100%'
|
|
67
|
+
},
|
|
68
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
69
|
+
ref: deviceFrameRef,
|
|
70
|
+
style: {
|
|
71
|
+
height,
|
|
72
|
+
margin,
|
|
73
|
+
transform: `translate3d(${x}, 0, 0)`,
|
|
74
|
+
width
|
|
75
|
+
},
|
|
76
|
+
children: children
|
|
77
|
+
})
|
|
78
|
+
});
|
|
49
79
|
};
|
|
50
80
|
|
|
51
81
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/views/LivePreview/Device/index.tsx"],"sourcesContent":["'use client'\nimport { useResize } from '@payloadcms/ui/
|
|
1
|
+
{"version":3,"sources":["../../../../src/views/LivePreview/Device/index.tsx"],"sourcesContent":["'use client'\nimport { useResize } from '@payloadcms/ui/client'\nimport React, { useEffect } from 'react'\n\nimport { useLivePreviewContext } from '../Context/context.js'\n\nexport const DeviceContainer: React.FC<{\n children: React.ReactNode\n}> = (props) => {\n const { children } = props\n\n const deviceFrameRef = React.useRef<HTMLDivElement>(null)\n const outerFrameRef = React.useRef<HTMLDivElement>(null)\n\n const { breakpoint, setMeasuredDeviceSize, size: desiredSize, zoom } = useLivePreviewContext()\n\n // Keep an accurate measurement of the actual device size as it is truly rendered\n // This is helpful when `sizes` are non-number units like percentages, etc.\n const { size: measuredDeviceSize } = useResize(deviceFrameRef.current)\n const { size: outerFrameSize } = useResize(outerFrameRef.current)\n\n let deviceIsLargerThanFrame: boolean = false\n\n // Sync the measured device size with the context so that other components can use it\n // This happens from the bottom up so that as this component mounts and unmounts,\n // its size is freshly populated again upon re-mounting, i.e. going from iframe->popup->iframe\n useEffect(() => {\n if (measuredDeviceSize) {\n setMeasuredDeviceSize(measuredDeviceSize)\n }\n }, [measuredDeviceSize, setMeasuredDeviceSize])\n\n let x = '0'\n let margin = '0'\n\n if (breakpoint && breakpoint !== 'responsive') {\n x = '-50%'\n\n if (\n typeof zoom === 'number' &&\n typeof desiredSize.width === 'number' &&\n typeof desiredSize.height === 'number' &&\n typeof measuredDeviceSize.width === 'number' &&\n typeof measuredDeviceSize.height === 'number'\n ) {\n margin = '0 auto'\n const scaledDesiredWidth = desiredSize.width / zoom\n const scaledDeviceWidth = measuredDeviceSize.width * zoom\n const scaledDeviceDifferencePixels = scaledDesiredWidth - desiredSize.width\n deviceIsLargerThanFrame = scaledDeviceWidth > outerFrameSize.width\n\n if (deviceIsLargerThanFrame) {\n if (zoom > 1) {\n const differenceFromDeviceToFrame = measuredDeviceSize.width - outerFrameSize.width\n if (differenceFromDeviceToFrame < 0) x = `${differenceFromDeviceToFrame / 2}px`\n else x = '0'\n } else {\n x = '0'\n }\n } else {\n if (zoom >= 1) {\n x = `${scaledDeviceDifferencePixels / 2}px`\n } else {\n const differenceFromDeviceToFrame = outerFrameSize.width - scaledDeviceWidth\n x = `${differenceFromDeviceToFrame / 2}px`\n margin = '0'\n }\n }\n }\n }\n\n let width = zoom ? `${100 / zoom}%` : '100%'\n let height = zoom ? `${100 / zoom}%` : '100%'\n\n if (breakpoint !== 'responsive') {\n width = `${desiredSize?.width / (typeof zoom === 'number' ? zoom : 1)}px`\n height = `${desiredSize?.height / (typeof zoom === 'number' ? zoom : 1)}px`\n }\n\n return (\n <div\n ref={outerFrameRef}\n style={{\n height: '100%',\n width: '100%',\n }}\n >\n <div\n ref={deviceFrameRef}\n style={{\n height,\n margin,\n transform: `translate3d(${x}, 0, 0)`,\n width,\n }}\n >\n {children}\n </div>\n </div>\n )\n}\n"],"names":["useResize","React","useEffect","useLivePreviewContext","DeviceContainer","props","children","deviceFrameRef","useRef","outerFrameRef","breakpoint","setMeasuredDeviceSize","size","desiredSize","zoom","measuredDeviceSize","current","outerFrameSize","deviceIsLargerThanFrame","x","margin","width","height","scaledDesiredWidth","scaledDeviceWidth","scaledDeviceDifferencePixels","differenceFromDeviceToFrame","div","ref","style","transform"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,SAAS,QAAQ,wBAAuB;AACjD,OAAOC,SAASC,SAAS,QAAQ,QAAO;AAExC,SAASC,qBAAqB,QAAQ,wBAAuB;AAE7D,OAAO,MAAMC,kBAER,CAACC;IACJ,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,MAAME,iBAAiBN,MAAMO,MAAM,CAAiB;IACpD,MAAMC,gBAAgBR,MAAMO,MAAM,CAAiB;IAEnD,MAAM,EAAEE,UAAU,EAAEC,qBAAqB,EAAEC,MAAMC,WAAW,EAAEC,IAAI,EAAE,GAAGX;IAEvE,iFAAiF;IACjF,2EAA2E;IAC3E,MAAM,EAAES,MAAMG,kBAAkB,EAAE,GAAGf,UAAUO,eAAeS,OAAO;IACrE,MAAM,EAAEJ,MAAMK,cAAc,EAAE,GAAGjB,UAAUS,cAAcO,OAAO;IAEhE,IAAIE,0BAAmC;IAEvC,qFAAqF;IACrF,iFAAiF;IACjF,8FAA8F;IAC9FhB,UAAU;QACR,IAAIa,oBAAoB;YACtBJ,sBAAsBI;QACxB;IACF,GAAG;QAACA;QAAoBJ;KAAsB;IAE9C,IAAIQ,IAAI;IACR,IAAIC,SAAS;IAEb,IAAIV,cAAcA,eAAe,cAAc;QAC7CS,IAAI;QAEJ,IACE,OAAOL,SAAS,YAChB,OAAOD,YAAYQ,KAAK,KAAK,YAC7B,OAAOR,YAAYS,MAAM,KAAK,YAC9B,OAAOP,mBAAmBM,KAAK,KAAK,YACpC,OAAON,mBAAmBO,MAAM,KAAK,UACrC;YACAF,SAAS;YACT,MAAMG,qBAAqBV,YAAYQ,KAAK,GAAGP;YAC/C,MAAMU,oBAAoBT,mBAAmBM,KAAK,GAAGP;YACrD,MAAMW,+BAA+BF,qBAAqBV,YAAYQ,KAAK;YAC3EH,0BAA0BM,oBAAoBP,eAAeI,KAAK;YAElE,IAAIH,yBAAyB;gBAC3B,IAAIJ,OAAO,GAAG;oBACZ,MAAMY,8BAA8BX,mBAAmBM,KAAK,GAAGJ,eAAeI,KAAK;oBACnF,IAAIK,8BAA8B,GAAGP,IAAI,CAAC,EAAEO,8BAA8B,EAAE,EAAE,CAAC;yBAC1EP,IAAI;gBACX,OAAO;oBACLA,IAAI;gBACN;YACF,OAAO;gBACL,IAAIL,QAAQ,GAAG;oBACbK,IAAI,CAAC,EAAEM,+BAA+B,EAAE,EAAE,CAAC;gBAC7C,OAAO;oBACL,MAAMC,8BAA8BT,eAAeI,KAAK,GAAGG;oBAC3DL,IAAI,CAAC,EAAEO,8BAA8B,EAAE,EAAE,CAAC;oBAC1CN,SAAS;gBACX;YACF;QACF;IACF;IAEA,IAAIC,QAAQP,OAAO,CAAC,EAAE,MAAMA,KAAK,CAAC,CAAC,GAAG;IACtC,IAAIQ,SAASR,OAAO,CAAC,EAAE,MAAMA,KAAK,CAAC,CAAC,GAAG;IAEvC,IAAIJ,eAAe,cAAc;QAC/BW,QAAQ,CAAC,EAAER,aAAaQ,QAAS,CAAA,OAAOP,SAAS,WAAWA,OAAO,CAAA,EAAG,EAAE,CAAC;QACzEQ,SAAS,CAAC,EAAET,aAAaS,SAAU,CAAA,OAAOR,SAAS,WAAWA,OAAO,CAAA,EAAG,EAAE,CAAC;IAC7E;IAEA,qBACE,KAACa;QACCC,KAAKnB;QACLoB,OAAO;YACLP,QAAQ;YACRD,OAAO;QACT;kBAEA,cAAA,KAACM;YACCC,KAAKrB;YACLsB,OAAO;gBACLP;gBACAF;gBACAU,WAAW,CAAC,YAAY,EAAEX,EAAE,OAAO,CAAC;gBACpCE;YACF;sBAECf;;;AAIT,EAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { useLivePreviewContext } from '../Context/context.js';
|
|
4
5
|
export const DeviceContainer = (props)=>{
|
|
@@ -16,14 +17,15 @@ export const DeviceContainer = (props)=>{
|
|
|
16
17
|
margin = '0 auto';
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
20
21
|
style: {
|
|
21
22
|
height: foundBreakpoint && foundBreakpoint?.name !== 'responsive' ? `${size?.height / (typeof zoom === 'number' ? zoom : 1)}px` : typeof zoom === 'number' ? `${100 / zoom}%` : '100%',
|
|
22
23
|
margin,
|
|
23
24
|
transform: `translate3d(${x}, 0, 0)`,
|
|
24
25
|
width: foundBreakpoint && foundBreakpoint?.name !== 'responsive' ? `${size?.width / (typeof zoom === 'number' ? zoom : 1)}px` : typeof zoom === 'number' ? `${100 / zoom}%` : '100%'
|
|
25
|
-
}
|
|
26
|
-
|
|
26
|
+
},
|
|
27
|
+
children: children
|
|
28
|
+
});
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/views/LivePreview/DeviceContainer/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useLivePreviewContext } from '../Context/context.js'\n\nexport const DeviceContainer: React.FC<{\n children: React.ReactNode\n}> = (props) => {\n const { children } = props\n\n const { breakpoint, breakpoints, size, zoom } = useLivePreviewContext()\n\n const foundBreakpoint = breakpoint && breakpoints?.find((bp) => bp.name === breakpoint)\n\n let x = '0'\n let margin = '0'\n\n if (foundBreakpoint && breakpoint !== 'responsive') {\n x = '-50%'\n\n if (\n typeof zoom === 'number' &&\n typeof size.width === 'number' &&\n typeof size.height === 'number'\n ) {\n const scaledWidth = size.width / zoom\n const difference = scaledWidth - size.width\n x = `${difference / 2}px`\n margin = '0 auto'\n }\n }\n\n return (\n <div\n style={{\n height:\n foundBreakpoint && foundBreakpoint?.name !== 'responsive'\n ? `${size?.height / (typeof zoom === 'number' ? zoom : 1)}px`\n : typeof zoom === 'number'\n ? `${100 / zoom}%`\n : '100%',\n margin,\n transform: `translate3d(${x}, 0, 0)`,\n width:\n foundBreakpoint && foundBreakpoint?.name !== 'responsive'\n ? `${size?.width / (typeof zoom === 'number' ? zoom : 1)}px`\n : typeof zoom === 'number'\n ? `${100 / zoom}%`\n : '100%',\n }}\n >\n {children}\n </div>\n )\n}\n"],"names":["React","useLivePreviewContext","DeviceContainer","props","children","breakpoint","breakpoints","size","zoom","foundBreakpoint","find","bp","name","x","margin","width","height","scaledWidth","difference","div","style","transform"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/views/LivePreview/DeviceContainer/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useLivePreviewContext } from '../Context/context.js'\n\nexport const DeviceContainer: React.FC<{\n children: React.ReactNode\n}> = (props) => {\n const { children } = props\n\n const { breakpoint, breakpoints, size, zoom } = useLivePreviewContext()\n\n const foundBreakpoint = breakpoint && breakpoints?.find((bp) => bp.name === breakpoint)\n\n let x = '0'\n let margin = '0'\n\n if (foundBreakpoint && breakpoint !== 'responsive') {\n x = '-50%'\n\n if (\n typeof zoom === 'number' &&\n typeof size.width === 'number' &&\n typeof size.height === 'number'\n ) {\n const scaledWidth = size.width / zoom\n const difference = scaledWidth - size.width\n x = `${difference / 2}px`\n margin = '0 auto'\n }\n }\n\n return (\n <div\n style={{\n height:\n foundBreakpoint && foundBreakpoint?.name !== 'responsive'\n ? `${size?.height / (typeof zoom === 'number' ? zoom : 1)}px`\n : typeof zoom === 'number'\n ? `${100 / zoom}%`\n : '100%',\n margin,\n transform: `translate3d(${x}, 0, 0)`,\n width:\n foundBreakpoint && foundBreakpoint?.name !== 'responsive'\n ? `${size?.width / (typeof zoom === 'number' ? zoom : 1)}px`\n : typeof zoom === 'number'\n ? `${100 / zoom}%`\n : '100%',\n }}\n >\n {children}\n </div>\n )\n}\n"],"names":["React","useLivePreviewContext","DeviceContainer","props","children","breakpoint","breakpoints","size","zoom","foundBreakpoint","find","bp","name","x","margin","width","height","scaledWidth","difference","div","style","transform"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,OAAOA,WAAW,QAAO;AAEzB,SAASC,qBAAqB,QAAQ,wBAAuB;AAE7D,OAAO,MAAMC,kBAER,CAACC;IACJ,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,MAAM,EAAEE,UAAU,EAAEC,WAAW,EAAEC,IAAI,EAAEC,IAAI,EAAE,GAAGP;IAEhD,MAAMQ,kBAAkBJ,cAAcC,aAAaI,KAAK,CAACC,KAAOA,GAAGC,IAAI,KAAKP;IAE5E,IAAIQ,IAAI;IACR,IAAIC,SAAS;IAEb,IAAIL,mBAAmBJ,eAAe,cAAc;QAClDQ,IAAI;QAEJ,IACE,OAAOL,SAAS,YAChB,OAAOD,KAAKQ,KAAK,KAAK,YACtB,OAAOR,KAAKS,MAAM,KAAK,UACvB;YACA,MAAMC,cAAcV,KAAKQ,KAAK,GAAGP;YACjC,MAAMU,aAAaD,cAAcV,KAAKQ,KAAK;YAC3CF,IAAI,CAAC,EAAEK,aAAa,EAAE,EAAE,CAAC;YACzBJ,SAAS;QACX;IACF;IAEA,qBACE,KAACK;QACCC,OAAO;YACLJ,QACEP,mBAAmBA,iBAAiBG,SAAS,eACzC,CAAC,EAAEL,MAAMS,SAAU,CAAA,OAAOR,SAAS,WAAWA,OAAO,CAAA,EAAG,EAAE,CAAC,GAC3D,OAAOA,SAAS,WACd,CAAC,EAAE,MAAMA,KAAK,CAAC,CAAC,GAChB;YACRM;YACAO,WAAW,CAAC,YAAY,EAAER,EAAE,OAAO,CAAC;YACpCE,OACEN,mBAAmBA,iBAAiBG,SAAS,eACzC,CAAC,EAAEL,MAAMQ,QAAS,CAAA,OAAOP,SAAS,WAAWA,OAAO,CAAA,EAAG,EAAE,CAAC,GAC1D,OAAOA,SAAS,WACd,CAAC,EAAE,MAAMA,KAAK,CAAC,CAAC,GAChB;QACV;kBAECJ;;AAGP,EAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import React, { forwardRef } from 'react';
|
|
3
4
|
import { useLivePreviewContext } from '../Context/context.js';
|
|
4
5
|
const baseClass = 'live-preview-iframe';
|
|
5
6
|
export const IFrame = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
6
7
|
const { setIframeHasLoaded, url } = props;
|
|
7
8
|
const { zoom } = useLivePreviewContext();
|
|
8
|
-
return /*#__PURE__*/
|
|
9
|
+
return /*#__PURE__*/ _jsx("iframe", {
|
|
9
10
|
className: baseClass,
|
|
10
11
|
onLoad: ()=>{
|
|
11
12
|
setIframeHasLoaded(true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/views/LivePreview/IFrame/index.tsx"],"sourcesContent":["'use client'\nimport React, { forwardRef } from 'react'\n\nimport { useLivePreviewContext } from '../Context/context.js'\nimport './index.scss'\n\nconst baseClass = 'live-preview-iframe'\n\ntype Props = {\n setIframeHasLoaded: (value: boolean) => void\n url: string\n}\n\nexport const IFrame = forwardRef<HTMLIFrameElement, Props>((props, ref) => {\n const { setIframeHasLoaded, url } = props\n\n const { zoom } = useLivePreviewContext()\n\n return (\n <iframe\n className={baseClass}\n onLoad={() => {\n setIframeHasLoaded(true)\n }}\n ref={ref}\n src={url}\n style={{\n transform: typeof zoom === 'number' ? `scale(${zoom}) ` : undefined,\n }}\n title={url}\n />\n )\n})\n"],"names":["React","forwardRef","useLivePreviewContext","baseClass","IFrame","props","ref","setIframeHasLoaded","url","zoom","iframe","className","onLoad","src","style","transform","undefined","title"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/views/LivePreview/IFrame/index.tsx"],"sourcesContent":["'use client'\nimport React, { forwardRef } from 'react'\n\nimport { useLivePreviewContext } from '../Context/context.js'\nimport './index.scss'\n\nconst baseClass = 'live-preview-iframe'\n\ntype Props = {\n setIframeHasLoaded: (value: boolean) => void\n url: string\n}\n\nexport const IFrame = forwardRef<HTMLIFrameElement, Props>((props, ref) => {\n const { setIframeHasLoaded, url } = props\n\n const { zoom } = useLivePreviewContext()\n\n return (\n <iframe\n className={baseClass}\n onLoad={() => {\n setIframeHasLoaded(true)\n }}\n ref={ref}\n src={url}\n style={{\n transform: typeof zoom === 'number' ? `scale(${zoom}) ` : undefined,\n }}\n title={url}\n />\n )\n})\n"],"names":["React","forwardRef","useLivePreviewContext","baseClass","IFrame","props","ref","setIframeHasLoaded","url","zoom","iframe","className","onLoad","src","style","transform","undefined","title"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,OAAOA,SAASC,UAAU,QAAQ,QAAO;AAEzC,SAASC,qBAAqB,QAAQ,wBAAuB;AAG7D,MAAMC,YAAY;AAOlB,OAAO,MAAMC,uBAASH,WAAqC,CAACI,OAAOC;IACjE,MAAM,EAAEC,kBAAkB,EAAEC,GAAG,EAAE,GAAGH;IAEpC,MAAM,EAAEI,IAAI,EAAE,GAAGP;IAEjB,qBACE,KAACQ;QACCC,WAAWR;QACXS,QAAQ;YACNL,mBAAmB;QACrB;QACAD,KAAKA;QACLO,KAAKL;QACLM,OAAO;YACLC,WAAW,OAAON,SAAS,WAAW,CAAC,MAAM,EAAEA,KAAK,EAAE,CAAC,GAAGO;QAC5D;QACAC,OAAOT;;AAGb,GAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/Preview/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/Preview/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,OAAO,KAAoB,MAAM,OAAO,CAAA;AAMxC,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAgH/C,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { useAllFormFields } from '@payloadcms/ui/
|
|
4
|
-
import {
|
|
5
|
-
import { reduceFieldsToValues } from '@payloadcms/ui/utilities/reduceFieldsToValues';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ShimmerEffect, useAllFormFields, useDocumentEvents } from '@payloadcms/ui/client';
|
|
4
|
+
import { reduceFieldsToValues } from '@payloadcms/ui/shared';
|
|
6
5
|
import React, { useEffect } from 'react';
|
|
7
6
|
import { useLivePreviewContext } from '../Context/context.js';
|
|
8
7
|
import { DeviceContainer } from '../Device/index.js';
|
|
@@ -13,8 +12,9 @@ export const LivePreview = (props)=>{
|
|
|
13
12
|
const { appIsReady, iframeHasLoaded, iframeRef, popupRef, previewWindowType, setIframeHasLoaded, url } = useLivePreviewContext();
|
|
14
13
|
const { mostRecentUpdate } = useDocumentEvents();
|
|
15
14
|
const { breakpoint, fieldSchemaJSON } = useLivePreviewContext();
|
|
16
|
-
const prevWindowType = React.useRef();
|
|
15
|
+
const prevWindowType = React.useRef(undefined);
|
|
17
16
|
const [fields] = useAllFormFields();
|
|
17
|
+
// For client-side apps, send data through `window.postMessage`
|
|
18
18
|
// The preview could either be an iframe embedded on the page
|
|
19
19
|
// Or it could be a separate popup window
|
|
20
20
|
// We need to transmit data to both accordingly
|
|
@@ -55,23 +55,55 @@ export const LivePreview = (props)=>{
|
|
|
55
55
|
fieldSchemaJSON,
|
|
56
56
|
mostRecentUpdate
|
|
57
57
|
]);
|
|
58
|
+
// To support SSR, we transmit a `window.postMessage` event without a payload
|
|
59
|
+
// This is because the event will ultimately trigger a server-side roundtrip
|
|
60
|
+
// i.e., save, save draft, autosave, etc. will fire `router.refresh()`
|
|
61
|
+
useEffect(()=>{
|
|
62
|
+
const message = {
|
|
63
|
+
type: 'payload-document-event'
|
|
64
|
+
};
|
|
65
|
+
// Post message to external popup window
|
|
66
|
+
if (previewWindowType === 'popup' && popupRef.current) {
|
|
67
|
+
popupRef.current.postMessage(message, url);
|
|
68
|
+
}
|
|
69
|
+
// Post message to embedded iframe
|
|
70
|
+
if (previewWindowType === 'iframe' && iframeRef.current) {
|
|
71
|
+
iframeRef.current.contentWindow?.postMessage(message, url);
|
|
72
|
+
}
|
|
73
|
+
}, [
|
|
74
|
+
mostRecentUpdate,
|
|
75
|
+
iframeRef,
|
|
76
|
+
popupRef,
|
|
77
|
+
previewWindowType,
|
|
78
|
+
url
|
|
79
|
+
]);
|
|
58
80
|
if (previewWindowType === 'iframe') {
|
|
59
|
-
return /*#__PURE__*/
|
|
81
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
60
82
|
className: [
|
|
61
83
|
baseClass,
|
|
62
84
|
breakpoint && breakpoint !== 'responsive' && `${baseClass}--has-breakpoint`
|
|
63
|
-
].filter(Boolean).join(' ')
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
85
|
+
].filter(Boolean).join(' '),
|
|
86
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
87
|
+
className: `${baseClass}__wrapper`,
|
|
88
|
+
children: [
|
|
89
|
+
/*#__PURE__*/ _jsx(LivePreviewToolbar, {
|
|
90
|
+
...props
|
|
91
|
+
}),
|
|
92
|
+
/*#__PURE__*/ _jsx("div", {
|
|
93
|
+
className: `${baseClass}__main`,
|
|
94
|
+
children: /*#__PURE__*/ _jsx(DeviceContainer, {
|
|
95
|
+
children: url ? /*#__PURE__*/ _jsx(IFrame, {
|
|
96
|
+
ref: iframeRef,
|
|
97
|
+
setIframeHasLoaded: setIframeHasLoaded,
|
|
98
|
+
url: url
|
|
99
|
+
}) : /*#__PURE__*/ _jsx(ShimmerEffect, {
|
|
100
|
+
height: "100%"
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
})
|
|
106
|
+
});
|
|
75
107
|
}
|
|
76
108
|
};
|
|
77
109
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/views/LivePreview/Preview/index.tsx"],"sourcesContent":["'use client'\n\nimport type { EditViewProps } from 'payload
|
|
1
|
+
{"version":3,"sources":["../../../../src/views/LivePreview/Preview/index.tsx"],"sourcesContent":["'use client'\n\nimport type { EditViewProps } from 'payload'\n\nimport { ShimmerEffect, useAllFormFields, useDocumentEvents } from '@payloadcms/ui/client'\nimport { reduceFieldsToValues } from '@payloadcms/ui/shared'\nimport React, { useEffect } from 'react'\n\nimport { useLivePreviewContext } from '../Context/context.js'\nimport { DeviceContainer } from '../Device/index.js'\nimport { IFrame } from '../IFrame/index.js'\nimport { LivePreviewToolbar } from '../Toolbar/index.js'\nimport './index.scss'\n\nconst baseClass = 'live-preview-window'\n\nexport const LivePreview: React.FC<EditViewProps> = (props) => {\n const {\n appIsReady,\n iframeHasLoaded,\n iframeRef,\n popupRef,\n previewWindowType,\n setIframeHasLoaded,\n url,\n } = useLivePreviewContext()\n\n const { mostRecentUpdate } = useDocumentEvents()\n\n const { breakpoint, fieldSchemaJSON } = useLivePreviewContext()\n\n const prevWindowType =\n React.useRef<ReturnType<typeof useLivePreviewContext>['previewWindowType']>(undefined)\n\n const [fields] = useAllFormFields()\n\n // For client-side apps, send data through `window.postMessage`\n // The preview could either be an iframe embedded on the page\n // Or it could be a separate popup window\n // We need to transmit data to both accordingly\n useEffect(() => {\n // For performance, do no reduce fields to values until after the iframe or popup has loaded\n if (fields && window && 'postMessage' in window && appIsReady) {\n const values = reduceFieldsToValues(fields, true)\n\n // To reduce on large `postMessage` payloads, only send `fieldSchemaToJSON` one time\n // To do this, the underlying JS function maintains a cache of this value\n // So we need to send it through each time the window type changes\n // But only once per window type change, not on every render, because this is a potentially large obj\n const shouldSendSchema =\n !prevWindowType.current || prevWindowType.current !== previewWindowType\n\n prevWindowType.current = previewWindowType\n\n const message = {\n type: 'payload-live-preview',\n data: values,\n externallyUpdatedRelationship: mostRecentUpdate,\n fieldSchemaJSON: shouldSendSchema ? fieldSchemaJSON : undefined,\n }\n\n // Post message to external popup window\n if (previewWindowType === 'popup' && popupRef.current) {\n popupRef.current.postMessage(message, url)\n }\n\n // Post message to embedded iframe\n if (previewWindowType === 'iframe' && iframeRef.current) {\n iframeRef.current.contentWindow?.postMessage(message, url)\n }\n }\n }, [\n fields,\n url,\n iframeHasLoaded,\n previewWindowType,\n popupRef,\n appIsReady,\n iframeRef,\n setIframeHasLoaded,\n fieldSchemaJSON,\n mostRecentUpdate,\n ])\n\n // To support SSR, we transmit a `window.postMessage` event without a payload\n // This is because the event will ultimately trigger a server-side roundtrip\n // i.e., save, save draft, autosave, etc. will fire `router.refresh()`\n useEffect(() => {\n const message = {\n type: 'payload-document-event',\n }\n\n // Post message to external popup window\n if (previewWindowType === 'popup' && popupRef.current) {\n popupRef.current.postMessage(message, url)\n }\n\n // Post message to embedded iframe\n if (previewWindowType === 'iframe' && iframeRef.current) {\n iframeRef.current.contentWindow?.postMessage(message, url)\n }\n }, [mostRecentUpdate, iframeRef, popupRef, previewWindowType, url])\n\n if (previewWindowType === 'iframe') {\n return (\n <div\n className={[\n baseClass,\n breakpoint && breakpoint !== 'responsive' && `${baseClass}--has-breakpoint`,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <div className={`${baseClass}__wrapper`}>\n <LivePreviewToolbar {...props} />\n <div className={`${baseClass}__main`}>\n <DeviceContainer>\n {url ? (\n <IFrame ref={iframeRef} setIframeHasLoaded={setIframeHasLoaded} url={url} />\n ) : (\n <ShimmerEffect height=\"100%\" />\n )}\n </DeviceContainer>\n </div>\n </div>\n </div>\n )\n }\n}\n"],"names":["ShimmerEffect","useAllFormFields","useDocumentEvents","reduceFieldsToValues","React","useEffect","useLivePreviewContext","DeviceContainer","IFrame","LivePreviewToolbar","baseClass","LivePreview","props","appIsReady","iframeHasLoaded","iframeRef","popupRef","previewWindowType","setIframeHasLoaded","url","mostRecentUpdate","breakpoint","fieldSchemaJSON","prevWindowType","useRef","undefined","fields","window","values","shouldSendSchema","current","message","type","data","externallyUpdatedRelationship","postMessage","contentWindow","div","className","filter","Boolean","join","ref","height"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAIA,SAASA,aAAa,EAAEC,gBAAgB,EAAEC,iBAAiB,QAAQ,wBAAuB;AAC1F,SAASC,oBAAoB,QAAQ,wBAAuB;AAC5D,OAAOC,SAASC,SAAS,QAAQ,QAAO;AAExC,SAASC,qBAAqB,QAAQ,wBAAuB;AAC7D,SAASC,eAAe,QAAQ,qBAAoB;AACpD,SAASC,MAAM,QAAQ,qBAAoB;AAC3C,SAASC,kBAAkB,QAAQ,sBAAqB;AAGxD,MAAMC,YAAY;AAElB,OAAO,MAAMC,cAAuC,CAACC;IACnD,MAAM,EACJC,UAAU,EACVC,eAAe,EACfC,SAAS,EACTC,QAAQ,EACRC,iBAAiB,EACjBC,kBAAkB,EAClBC,GAAG,EACJ,GAAGb;IAEJ,MAAM,EAAEc,gBAAgB,EAAE,GAAGlB;IAE7B,MAAM,EAAEmB,UAAU,EAAEC,eAAe,EAAE,GAAGhB;IAExC,MAAMiB,iBACJnB,MAAMoB,MAAM,CAAgEC;IAE9E,MAAM,CAACC,OAAO,GAAGzB;IAEjB,+DAA+D;IAC/D,6DAA6D;IAC7D,yCAAyC;IACzC,+CAA+C;IAC/CI,UAAU;QACR,4FAA4F;QAC5F,IAAIqB,UAAUC,UAAU,iBAAiBA,UAAUd,YAAY;YAC7D,MAAMe,SAASzB,qBAAqBuB,QAAQ;YAE5C,oFAAoF;YACpF,yEAAyE;YACzE,kEAAkE;YAClE,qGAAqG;YACrG,MAAMG,mBACJ,CAACN,eAAeO,OAAO,IAAIP,eAAeO,OAAO,KAAKb;YAExDM,eAAeO,OAAO,GAAGb;YAEzB,MAAMc,UAAU;gBACdC,MAAM;gBACNC,MAAML;gBACNM,+BAA+Bd;gBAC/BE,iBAAiBO,mBAAmBP,kBAAkBG;YACxD;YAEA,wCAAwC;YACxC,IAAIR,sBAAsB,WAAWD,SAASc,OAAO,EAAE;gBACrDd,SAASc,OAAO,CAACK,WAAW,CAACJ,SAASZ;YACxC;YAEA,kCAAkC;YAClC,IAAIF,sBAAsB,YAAYF,UAAUe,OAAO,EAAE;gBACvDf,UAAUe,OAAO,CAACM,aAAa,EAAED,YAAYJ,SAASZ;YACxD;QACF;IACF,GAAG;QACDO;QACAP;QACAL;QACAG;QACAD;QACAH;QACAE;QACAG;QACAI;QACAF;KACD;IAED,6EAA6E;IAC7E,4EAA4E;IAC5E,sEAAsE;IACtEf,UAAU;QACR,MAAM0B,UAAU;YACdC,MAAM;QACR;QAEA,wCAAwC;QACxC,IAAIf,sBAAsB,WAAWD,SAASc,OAAO,EAAE;YACrDd,SAASc,OAAO,CAACK,WAAW,CAACJ,SAASZ;QACxC;QAEA,kCAAkC;QAClC,IAAIF,sBAAsB,YAAYF,UAAUe,OAAO,EAAE;YACvDf,UAAUe,OAAO,CAACM,aAAa,EAAED,YAAYJ,SAASZ;QACxD;IACF,GAAG;QAACC;QAAkBL;QAAWC;QAAUC;QAAmBE;KAAI;IAElE,IAAIF,sBAAsB,UAAU;QAClC,qBACE,KAACoB;YACCC,WAAW;gBACT5B;gBACAW,cAAcA,eAAe,gBAAgB,CAAC,EAAEX,UAAU,gBAAgB,CAAC;aAC5E,CACE6B,MAAM,CAACC,SACPC,IAAI,CAAC;sBAER,cAAA,MAACJ;gBAAIC,WAAW,CAAC,EAAE5B,UAAU,SAAS,CAAC;;kCACrC,KAACD;wBAAoB,GAAGG,KAAK;;kCAC7B,KAACyB;wBAAIC,WAAW,CAAC,EAAE5B,UAAU,MAAM,CAAC;kCAClC,cAAA,KAACH;sCACEY,oBACC,KAACX;gCAAOkC,KAAK3B;gCAAWG,oBAAoBA;gCAAoBC,KAAKA;+CAErE,KAACnB;gCAAc2C,QAAO;;;;;;;IAOpC;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/LivePreview/Toolbar/Controls/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/LivePreview/Toolbar/Controls/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAU5C,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,cAAc,CAAA;AAKrB,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA8GnD,CAAA"}
|