@payloadcms/next 3.0.0-canary.9de3ffd → 3.0.0-canary.a14e066
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 +4 -4
- package/dist/cjs/withPayload.cjs.map +1 -1
- package/dist/config.js +0 -1
- package/dist/config.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js +15 -9
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js +100 -35
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js +75 -64
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/getCustomViews.js +31 -35
- package/dist/elements/DocumentHeader/Tabs/getCustomViews.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/getViewConfig.js +15 -12
- package/dist/elements/DocumentHeader/Tabs/getViewConfig.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.js +95 -82
- package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js +37 -14
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js +60 -52
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js.map +1 -1
- package/dist/elements/DocumentHeader/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/index.js +24 -23
- package/dist/elements/DocumentHeader/index.js.map +1 -1
- package/dist/elements/DocumentLocked/index.d.ts +12 -0
- package/dist/elements/DocumentLocked/index.d.ts.map +1 -0
- package/dist/elements/DocumentLocked/index.js +142 -0
- package/dist/elements/DocumentLocked/index.js.map +1 -0
- package/dist/elements/DocumentLocked/index.scss +37 -0
- package/dist/elements/DocumentTakeOver/index.d.ts +8 -0
- package/dist/elements/DocumentTakeOver/index.d.ts.map +1 -0
- package/dist/elements/DocumentTakeOver/index.js +98 -0
- package/dist/elements/DocumentTakeOver/index.js.map +1 -0
- package/dist/elements/DocumentTakeOver/index.scss +37 -0
- package/dist/elements/EmailAndUsername/index.d.ts +1 -1
- package/dist/elements/EmailAndUsername/index.d.ts.map +1 -1
- package/dist/elements/EmailAndUsername/index.js +107 -75
- package/dist/elements/EmailAndUsername/index.js.map +1 -1
- package/dist/elements/FormHeader/index.d.ts +9 -0
- package/dist/elements/FormHeader/index.d.ts.map +1 -0
- package/dist/elements/FormHeader/index.js +20 -0
- package/dist/elements/FormHeader/index.js.map +1 -0
- package/dist/elements/FormHeader/index.scss +6 -0
- package/dist/elements/LeaveWithoutSaving/index.d.ts.map +1 -1
- package/dist/elements/LeaveWithoutSaving/index.js +150 -83
- package/dist/elements/LeaveWithoutSaving/index.js.map +1 -1
- package/dist/elements/LeaveWithoutSaving/index.scss +3 -3
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts.map +1 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js +121 -101
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +1 -1
- package/dist/elements/Logo/index.js +37 -22
- package/dist/elements/Logo/index.js.map +1 -1
- package/dist/elements/Nav/NavHamburger/index.js +41 -13
- package/dist/elements/Nav/NavHamburger/index.js.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.js +48 -16
- package/dist/elements/Nav/NavWrapper/index.js.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.scss +5 -0
- package/dist/elements/Nav/index.client.d.ts.map +1 -1
- package/dist/elements/Nav/index.client.js +149 -76
- package/dist/elements/Nav/index.client.js.map +1 -1
- package/dist/elements/Nav/index.d.ts.map +1 -1
- package/dist/elements/Nav/index.js +57 -51
- package/dist/elements/Nav/index.js.map +1 -1
- package/dist/elements/Nav/index.scss +5 -1
- package/dist/exports/layouts.d.ts +1 -1
- package/dist/exports/layouts.d.ts.map +1 -1
- package/dist/exports/layouts.js +1 -2
- package/dist/exports/layouts.js.map +1 -1
- package/dist/exports/routes.js +0 -1
- package/dist/exports/routes.js.map +1 -1
- package/dist/exports/templates.js +0 -1
- package/dist/exports/templates.js.map +1 -1
- package/dist/exports/utilities.d.ts +1 -0
- package/dist/exports/utilities.d.ts.map +1 -1
- package/dist/exports/utilities.js +1 -1
- package/dist/exports/utilities.js.map +1 -1
- package/dist/exports/views.d.ts +1 -1
- package/dist/exports/views.d.ts.map +1 -1
- package/dist/exports/views.js +1 -2
- package/dist/exports/views.js.map +1 -1
- package/dist/fetchAPI-multipart/fileFactory.d.ts +2 -1
- package/dist/fetchAPI-multipart/fileFactory.d.ts.map +1 -1
- package/dist/fetchAPI-multipart/fileFactory.js +35 -34
- package/dist/fetchAPI-multipart/fileFactory.js.map +1 -1
- package/dist/fetchAPI-multipart/handlers.d.ts +1 -1
- package/dist/fetchAPI-multipart/handlers.d.ts.map +1 -1
- package/dist/fetchAPI-multipart/handlers.js +79 -78
- package/dist/fetchAPI-multipart/handlers.js.map +1 -1
- package/dist/fetchAPI-multipart/index.d.ts +1 -101
- package/dist/fetchAPI-multipart/index.d.ts.map +1 -1
- package/dist/fetchAPI-multipart/index.js +33 -31
- package/dist/fetchAPI-multipart/index.js.map +1 -1
- package/dist/fetchAPI-multipart/isEligibleRequest.js +13 -21
- package/dist/fetchAPI-multipart/isEligibleRequest.js.map +1 -1
- package/dist/fetchAPI-multipart/processMultipart.d.ts +2 -1
- package/dist/fetchAPI-multipart/processMultipart.d.ts.map +1 -1
- package/dist/fetchAPI-multipart/processMultipart.js +159 -141
- package/dist/fetchAPI-multipart/processMultipart.js.map +1 -1
- package/dist/fetchAPI-multipart/processNested.d.ts.map +1 -1
- package/dist/fetchAPI-multipart/processNested.js +26 -20
- package/dist/fetchAPI-multipart/processNested.js.map +1 -1
- package/dist/fetchAPI-multipart/uploadTimer.d.ts.map +1 -1
- package/dist/fetchAPI-multipart/uploadTimer.js +18 -17
- package/dist/fetchAPI-multipart/uploadTimer.js.map +1 -1
- package/dist/fetchAPI-multipart/utilities.d.ts +1 -1
- package/dist/fetchAPI-multipart/utilities.d.ts.map +1 -1
- package/dist/fetchAPI-multipart/utilities.js +185 -165
- package/dist/fetchAPI-multipart/utilities.js.map +1 -1
- package/dist/fetchAPI-stream-file/index.js +19 -17
- package/dist/fetchAPI-stream-file/index.js.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/layouts/Root/index.d.ts.map +1 -1
- package/dist/layouts/Root/index.js +151 -116
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/prod/styles.css +1 -1
- package/dist/routes/graphql/handler.d.ts.map +1 -1
- package/dist/routes/graphql/handler.js +119 -101
- package/dist/routes/graphql/handler.js.map +1 -1
- package/dist/routes/graphql/index.js +0 -1
- package/dist/routes/graphql/index.js.map +1 -1
- package/dist/routes/graphql/playground.js +23 -24
- package/dist/routes/graphql/playground.js.map +1 -1
- package/dist/routes/index.js +0 -1
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/rest/auth/access.js +22 -21
- package/dist/routes/rest/auth/access.js.map +1 -1
- package/dist/routes/rest/auth/forgotPassword.js +29 -25
- package/dist/routes/rest/auth/forgotPassword.js.map +1 -1
- package/dist/routes/rest/auth/init.js +16 -14
- package/dist/routes/rest/auth/init.js.map +1 -1
- package/dist/routes/rest/auth/login.js +43 -38
- package/dist/routes/rest/auth/login.js.map +1 -1
- package/dist/routes/rest/auth/logout.d.ts.map +1 -1
- package/dist/routes/rest/auth/logout.js +32 -27
- package/dist/routes/rest/auth/logout.js.map +1 -1
- package/dist/routes/rest/auth/me.js +23 -21
- package/dist/routes/rest/auth/me.js.map +1 -1
- package/dist/routes/rest/auth/refresh.js +31 -27
- package/dist/routes/rest/auth/refresh.js.map +1 -1
- package/dist/routes/rest/auth/registerFirstUser.js +43 -38
- package/dist/routes/rest/auth/registerFirstUser.js.map +1 -1
- package/dist/routes/rest/auth/resetPassword.js +38 -33
- package/dist/routes/rest/auth/resetPassword.js.map +1 -1
- package/dist/routes/rest/auth/unlock.js +27 -23
- package/dist/routes/rest/auth/unlock.js.map +1 -1
- package/dist/routes/rest/auth/verifyEmail.js +22 -17
- package/dist/routes/rest/auth/verifyEmail.js.map +1 -1
- package/dist/routes/rest/buildFormState.js +38 -37
- package/dist/routes/rest/buildFormState.js.map +1 -1
- package/dist/routes/rest/checkEndpoints.js +11 -9
- package/dist/routes/rest/checkEndpoints.js.map +1 -1
- package/dist/routes/rest/collections/count.js +15 -11
- package/dist/routes/rest/collections/count.js.map +1 -1
- package/dist/routes/rest/collections/create.js +30 -26
- package/dist/routes/rest/collections/create.js.map +1 -1
- package/dist/routes/rest/collections/delete.js +40 -35
- package/dist/routes/rest/collections/delete.js.map +1 -1
- package/dist/routes/rest/collections/deleteByID.js +36 -31
- package/dist/routes/rest/collections/deleteByID.js.map +1 -1
- package/dist/routes/rest/collections/docAccess.js +17 -14
- package/dist/routes/rest/collections/docAccess.js.map +1 -1
- package/dist/routes/rest/collections/duplicate.js +36 -31
- package/dist/routes/rest/collections/duplicate.js.map +1 -1
- package/dist/routes/rest/collections/find.d.ts.map +1 -1
- package/dist/routes/rest/collections/find.js +32 -20
- package/dist/routes/rest/collections/find.js.map +1 -1
- package/dist/routes/rest/collections/findByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/findByID.js +30 -23
- package/dist/routes/rest/collections/findByID.js.map +1 -1
- package/dist/routes/rest/collections/findVersionByID.js +27 -22
- package/dist/routes/rest/collections/findVersionByID.js.map +1 -1
- package/dist/routes/rest/collections/findVersions.js +27 -19
- package/dist/routes/rest/collections/findVersions.js.map +1 -1
- package/dist/routes/rest/collections/preview.js +39 -34
- package/dist/routes/rest/collections/preview.js.map +1 -1
- package/dist/routes/rest/collections/restoreVersion.js +32 -27
- package/dist/routes/rest/collections/restoreVersion.js.map +1 -1
- package/dist/routes/rest/collections/update.d.ts.map +1 -1
- package/dist/routes/rest/collections/update.js +45 -37
- package/dist/routes/rest/collections/update.js.map +1 -1
- package/dist/routes/rest/collections/updateByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/updateByID.js +44 -33
- package/dist/routes/rest/collections/updateByID.js.map +1 -1
- package/dist/routes/rest/files/checkFileAccess.d.ts.map +1 -1
- package/dist/routes/rest/files/checkFileAccess.js +52 -45
- package/dist/routes/rest/files/checkFileAccess.js.map +1 -1
- package/dist/routes/rest/files/getFile.d.ts.map +1 -1
- package/dist/routes/rest/files/getFile.js +56 -49
- package/dist/routes/rest/files/getFile.js.map +1 -1
- package/dist/routes/rest/files/getFileTypeFallback.js +16 -17
- package/dist/routes/rest/files/getFileTypeFallback.js.map +1 -1
- package/dist/routes/rest/globals/docAccess.js +15 -13
- package/dist/routes/rest/globals/docAccess.js.map +1 -1
- package/dist/routes/rest/globals/findOne.js +22 -18
- package/dist/routes/rest/globals/findOne.js.map +1 -1
- package/dist/routes/rest/globals/findVersionByID.js +22 -17
- package/dist/routes/rest/globals/findVersionByID.js.map +1 -1
- package/dist/routes/rest/globals/findVersions.js +27 -19
- package/dist/routes/rest/globals/findVersions.js.map +1 -1
- package/dist/routes/rest/globals/preview.js +38 -34
- package/dist/routes/rest/globals/preview.js.map +1 -1
- package/dist/routes/rest/globals/restoreVersion.js +27 -22
- package/dist/routes/rest/globals/restoreVersion.js.map +1 -1
- package/dist/routes/rest/globals/update.d.ts.map +1 -1
- package/dist/routes/rest/globals/update.js +38 -28
- package/dist/routes/rest/globals/update.js.map +1 -1
- package/dist/routes/rest/index.d.ts +12 -12
- package/dist/routes/rest/index.d.ts.map +1 -1
- package/dist/routes/rest/index.js +681 -626
- package/dist/routes/rest/index.js.map +1 -1
- package/dist/routes/rest/og/image.d.ts +1 -1
- package/dist/routes/rest/og/image.d.ts.map +1 -1
- package/dist/routes/rest/og/image.js +74 -76
- package/dist/routes/rest/og/image.js.map +1 -1
- package/dist/routes/rest/og/index.js +61 -60
- package/dist/routes/rest/og/index.js.map +1 -1
- package/dist/routes/rest/routeError.d.ts +2 -7
- package/dist/routes/rest/routeError.d.ts.map +1 -1
- package/dist/routes/rest/routeError.js +116 -95
- package/dist/routes/rest/routeError.js.map +1 -1
- package/dist/routes/rest/types.js +1 -2
- package/dist/routes/rest/types.js.map +1 -1
- package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts.map +1 -1
- package/dist/routes/rest/utilities/sanitizeCollectionID.js +18 -11
- package/dist/routes/rest/utilities/sanitizeCollectionID.js.map +1 -1
- package/dist/routes/rest/utilities/sanitizeJoinParams.d.ts +13 -0
- package/dist/routes/rest/utilities/sanitizeJoinParams.d.ts.map +1 -0
- package/dist/routes/rest/utilities/sanitizeJoinParams.js +17 -0
- package/dist/routes/rest/utilities/sanitizeJoinParams.js.map +1 -0
- package/dist/scss/app.scss +166 -162
- package/dist/scss/colors.scss +256 -254
- package/dist/scss/resets.scss +9 -7
- package/dist/scss/toastify.scss +42 -40
- package/dist/scss/toasts.scss +105 -103
- package/dist/scss/type.scss +80 -79
- package/dist/templates/Default/NavHamburger/index.js +18 -6
- package/dist/templates/Default/NavHamburger/index.js.map +1 -1
- package/dist/templates/Default/Wrapper/index.js +42 -13
- package/dist/templates/Default/Wrapper/index.js.map +1 -1
- package/dist/templates/Default/Wrapper/index.scss +0 -1
- package/dist/templates/Default/index.d.ts.map +1 -1
- package/dist/templates/Default/index.js +71 -50
- package/dist/templates/Default/index.js.map +1 -1
- package/dist/templates/Default/index.scss +14 -4
- package/dist/templates/Minimal/index.js +16 -16
- package/dist/templates/Minimal/index.js.map +1 -1
- package/dist/templates/Minimal/index.scss +2 -2
- package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -1
- package/dist/utilities/addDataAndFileToRequest.js +40 -35
- package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
- package/dist/utilities/addLocalesToRequest.d.ts.map +1 -1
- package/dist/utilities/addLocalesToRequest.js +48 -36
- package/dist/utilities/addLocalesToRequest.js.map +1 -1
- package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
- package/dist/utilities/createPayloadRequest.js +90 -73
- package/dist/utilities/createPayloadRequest.js.map +1 -1
- package/dist/utilities/getNextRequestI18n.d.ts.map +1 -1
- package/dist/utilities/getNextRequestI18n.js +13 -11
- package/dist/utilities/getNextRequestI18n.js.map +1 -1
- package/dist/utilities/getPayloadHMR.d.ts +1 -1
- package/dist/utilities/getPayloadHMR.d.ts.map +1 -1
- package/dist/utilities/getPayloadHMR.js +91 -94
- package/dist/utilities/getPayloadHMR.js.map +1 -1
- package/dist/utilities/getRequestLanguage.js +16 -13
- package/dist/utilities/getRequestLanguage.js.map +1 -1
- package/dist/utilities/getRequestLocales.js +27 -24
- package/dist/utilities/getRequestLocales.js.map +1 -1
- package/dist/utilities/getRequestTheme.d.ts.map +1 -1
- package/dist/utilities/getRequestTheme.js +19 -16
- package/dist/utilities/getRequestTheme.js.map +1 -1
- package/dist/utilities/headersWithCors.d.ts.map +1 -1
- package/dist/utilities/headersWithCors.js +21 -30
- package/dist/utilities/headersWithCors.js.map +1 -1
- package/dist/utilities/initPage/handleAdminPage.d.ts +11 -11
- package/dist/utilities/initPage/handleAdminPage.d.ts.map +1 -1
- package/dist/utilities/initPage/handleAdminPage.js +37 -46
- package/dist/utilities/initPage/handleAdminPage.js.map +1 -1
- package/dist/utilities/initPage/handleAuthRedirect.d.ts +6 -3
- package/dist/utilities/initPage/handleAuthRedirect.d.ts.map +1 -1
- package/dist/utilities/initPage/handleAuthRedirect.js +36 -34
- package/dist/utilities/initPage/handleAuthRedirect.js.map +1 -1
- package/dist/utilities/initPage/index.d.ts +1 -1
- package/dist/utilities/initPage/index.d.ts.map +1 -1
- package/dist/utilities/initPage/index.js +152 -123
- package/dist/utilities/initPage/index.js.map +1 -1
- package/dist/utilities/initPage/shared.d.ts +2 -2
- package/dist/utilities/initPage/shared.d.ts.map +1 -1
- package/dist/utilities/initPage/shared.js +31 -25
- package/dist/utilities/initPage/shared.js.map +1 -1
- package/dist/utilities/initPage/types.js +1 -2
- package/dist/utilities/initPage/types.js.map +1 -1
- package/dist/utilities/initReq.d.ts +11 -0
- package/dist/utilities/initReq.d.ts.map +1 -0
- package/dist/utilities/initReq.js +46 -0
- package/dist/utilities/initReq.js.map +1 -0
- package/dist/utilities/mergeHeaders.js +8 -9
- package/dist/utilities/mergeHeaders.js.map +1 -1
- package/dist/utilities/meta.js +66 -68
- package/dist/utilities/meta.js.map +1 -1
- package/dist/utilities/timestamp.d.ts.map +1 -1
- package/dist/utilities/timestamp.js +6 -5
- package/dist/utilities/timestamp.js.map +1 -1
- package/dist/views/API/LocaleSelector/index.d.ts.map +1 -1
- package/dist/views/API/LocaleSelector/index.js +38 -11
- package/dist/views/API/LocaleSelector/index.js.map +1 -1
- package/dist/views/API/RenderJSON/index.d.ts +1 -1
- package/dist/views/API/RenderJSON/index.d.ts.map +1 -1
- package/dist/views/API/RenderJSON/index.js +124 -112
- package/dist/views/API/RenderJSON/index.js.map +1 -1
- package/dist/views/API/index.client.d.ts.map +1 -1
- package/dist/views/API/index.client.js +190 -202
- package/dist/views/API/index.client.js.map +1 -1
- package/dist/views/API/index.js +2 -3
- package/dist/views/API/index.js.map +1 -1
- package/dist/views/API/index.scss +98 -96
- package/dist/views/API/meta.js +22 -18
- package/dist/views/API/meta.js.map +1 -1
- package/dist/views/Account/Settings/LanguageSelector.js +45 -12
- package/dist/views/Account/Settings/LanguageSelector.js.map +1 -1
- package/dist/views/Account/Settings/index.d.ts +2 -1
- package/dist/views/Account/Settings/index.d.ts.map +1 -1
- package/dist/views/Account/Settings/index.js +22 -28
- package/dist/views/Account/Settings/index.js.map +1 -1
- package/dist/views/Account/Settings/index.scss +37 -35
- package/dist/views/Account/ToggleTheme/index.js +51 -30
- package/dist/views/Account/ToggleTheme/index.js.map +1 -1
- package/dist/views/Account/index.client.js +32 -16
- package/dist/views/Account/index.client.js.map +1 -1
- package/dist/views/Account/index.d.ts.map +1 -1
- package/dist/views/Account/index.js +102 -69
- package/dist/views/Account/index.js.map +1 -1
- package/dist/views/Account/meta.js +12 -8
- package/dist/views/Account/meta.js.map +1 -1
- package/dist/views/CreateFirstUser/index.client.d.ts +1 -1
- package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +115 -58
- package/dist/views/CreateFirstUser/index.client.js.map +1 -1
- package/dist/views/CreateFirstUser/index.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.js +42 -28
- package/dist/views/CreateFirstUser/index.js.map +1 -1
- package/dist/views/CreateFirstUser/index.scss +18 -6
- package/dist/views/CreateFirstUser/meta.js +12 -8
- package/dist/views/CreateFirstUser/meta.js.map +1 -1
- package/dist/views/Dashboard/Default/index.d.ts +8 -1
- package/dist/views/Dashboard/Default/index.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/index.js +146 -117
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- package/dist/views/Dashboard/Default/index.scss +53 -46
- package/dist/views/Dashboard/index.d.ts.map +1 -1
- package/dist/views/Dashboard/index.js +76 -52
- package/dist/views/Dashboard/index.js.map +1 -1
- package/dist/views/Dashboard/meta.js +16 -12
- package/dist/views/Dashboard/meta.js.map +1 -1
- package/dist/views/Document/getCustomViewByKey.js +2 -3
- package/dist/views/Document/getCustomViewByKey.js.map +1 -1
- package/dist/views/Document/getCustomViewByRoute.js +30 -27
- package/dist/views/Document/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Document/getDocumentData.d.ts +5 -2
- package/dist/views/Document/getDocumentData.d.ts.map +1 -1
- package/dist/views/Document/getDocumentData.js +45 -28
- package/dist/views/Document/getDocumentData.js.map +1 -1
- package/dist/views/Document/getDocumentPermissions.d.ts.map +1 -1
- package/dist/views/Document/getDocumentPermissions.js +86 -74
- package/dist/views/Document/getDocumentPermissions.js.map +1 -1
- package/dist/views/Document/getMetaBySegment.d.ts +2 -2
- package/dist/views/Document/getMetaBySegment.d.ts.map +1 -1
- package/dist/views/Document/getMetaBySegment.js +113 -107
- package/dist/views/Document/getMetaBySegment.js.map +1 -1
- package/dist/views/Document/getViewsFromConfig.js +309 -331
- package/dist/views/Document/getViewsFromConfig.js.map +1 -1
- package/dist/views/Document/index.d.ts.map +1 -1
- package/dist/views/Document/index.js +194 -160
- package/dist/views/Document/index.js.map +1 -1
- package/dist/views/Document/meta.js +1 -2
- package/dist/views/Document/meta.js.map +1 -1
- package/dist/views/Edit/Default/Auth/APIKey.js +118 -132
- package/dist/views/Edit/Default/Auth/APIKey.js.map +1 -1
- package/dist/views/Edit/Default/Auth/index.js +293 -196
- package/dist/views/Edit/Default/Auth/index.js.map +1 -1
- package/dist/views/Edit/Default/Auth/index.scss +56 -54
- package/dist/views/Edit/Default/Auth/types.d.ts +1 -1
- package/dist/views/Edit/Default/Auth/types.d.ts.map +1 -1
- package/dist/views/Edit/Default/Auth/types.js +1 -2
- package/dist/views/Edit/Default/Auth/types.js.map +1 -1
- package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js +121 -70
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js.map +1 -1
- package/dist/views/Edit/Default/SetDocumentTitle/index.js +74 -29
- package/dist/views/Edit/Default/SetDocumentTitle/index.js.map +1 -1
- package/dist/views/Edit/Default/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/index.js +322 -189
- package/dist/views/Edit/Default/index.js.map +1 -1
- package/dist/views/Edit/Default/index.scss +15 -13
- package/dist/views/Edit/Default/types.js +1 -2
- package/dist/views/Edit/Default/types.js.map +1 -1
- package/dist/views/Edit/index.client.js +45 -21
- package/dist/views/Edit/index.client.js.map +1 -1
- package/dist/views/Edit/index.js +2 -3
- package/dist/views/Edit/index.js.map +1 -1
- package/dist/views/Edit/meta.js +43 -35
- package/dist/views/Edit/meta.js.map +1 -1
- package/dist/views/Edit/sanitizeEditViewProps.js +8 -9
- package/dist/views/Edit/sanitizeEditViewProps.js.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +153 -95
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
- package/dist/views/ForgotPassword/index.d.ts.map +1 -1
- package/dist/views/ForgotPassword/index.js +61 -48
- package/dist/views/ForgotPassword/index.js.map +1 -1
- package/dist/views/ForgotPassword/meta.js +12 -8
- package/dist/views/ForgotPassword/meta.js.map +1 -1
- package/dist/views/List/Default/index.d.ts.map +1 -1
- package/dist/views/List/Default/index.js +374 -210
- package/dist/views/List/Default/index.js.map +1 -1
- package/dist/views/List/Default/index.scss +136 -134
- package/dist/views/List/Default/types.js +1 -2
- package/dist/views/List/Default/types.js.map +1 -1
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js +155 -138
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/List/meta.js +20 -17
- package/dist/views/List/meta.js.map +1 -1
- package/dist/views/LivePreview/Context/collisionDetection.js +24 -21
- package/dist/views/LivePreview/Context/collisionDetection.js.map +1 -1
- package/dist/views/LivePreview/Context/context.d.ts +3 -2
- package/dist/views/LivePreview/Context/context.d.ts.map +1 -1
- package/dist/views/LivePreview/Context/context.js +39 -36
- package/dist/views/LivePreview/Context/context.js.map +1 -1
- package/dist/views/LivePreview/Context/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Context/index.js +136 -142
- package/dist/views/LivePreview/Context/index.js.map +1 -1
- package/dist/views/LivePreview/Context/sizeReducer.js +18 -19
- package/dist/views/LivePreview/Context/sizeReducer.js.map +1 -1
- package/dist/views/LivePreview/Device/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Device/index.js +82 -71
- package/dist/views/LivePreview/Device/index.js.map +1 -1
- package/dist/views/LivePreview/DeviceContainer/index.js +47 -23
- package/dist/views/LivePreview/DeviceContainer/index.js.map +1 -1
- package/dist/views/LivePreview/IFrame/index.js +21 -16
- package/dist/views/LivePreview/IFrame/index.js.map +1 -1
- package/dist/views/LivePreview/IFrame/index.scss +8 -6
- package/dist/views/LivePreview/Preview/index.js +145 -92
- package/dist/views/LivePreview/Preview/index.js.map +1 -1
- package/dist/views/LivePreview/Preview/index.scss +32 -30
- package/dist/views/LivePreview/Toolbar/Controls/index.js +137 -116
- package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.scss +49 -47
- package/dist/views/LivePreview/Toolbar/SizeInput/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js +89 -51
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/SizeInput/index.scss +11 -9
- package/dist/views/LivePreview/Toolbar/index.js +82 -50
- package/dist/views/LivePreview/Toolbar/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/index.scss +33 -31
- package/dist/views/LivePreview/ToolbarArea/index.js +32 -10
- package/dist/views/LivePreview/ToolbarArea/index.js.map +1 -1
- package/dist/views/LivePreview/ToolbarArea/index.scss +5 -3
- package/dist/views/LivePreview/index.client.d.ts.map +1 -1
- package/dist/views/LivePreview/index.client.js +332 -162
- package/dist/views/LivePreview/index.client.js.map +1 -1
- package/dist/views/LivePreview/index.js +67 -55
- package/dist/views/LivePreview/index.js.map +1 -1
- package/dist/views/LivePreview/index.scss +48 -46
- package/dist/views/LivePreview/meta.js +14 -9
- package/dist/views/LivePreview/meta.js.map +1 -1
- package/dist/views/LivePreview/usePopupWindow.d.ts +1 -1
- package/dist/views/LivePreview/usePopupWindow.d.ts.map +1 -1
- package/dist/views/LivePreview/usePopupWindow.js +133 -91
- package/dist/views/LivePreview/usePopupWindow.js.map +1 -1
- package/dist/views/Login/LoginField/index.js +83 -39
- package/dist/views/Login/LoginField/index.js.map +1 -1
- package/dist/views/Login/LoginForm/index.d.ts.map +1 -1
- package/dist/views/Login/LoginForm/index.js +147 -67
- package/dist/views/Login/LoginForm/index.js.map +1 -1
- package/dist/views/Login/LoginForm/index.scss +8 -6
- package/dist/views/Login/index.d.ts.map +1 -1
- package/dist/views/Login/index.js +78 -55
- package/dist/views/Login/index.js.map +1 -1
- package/dist/views/Login/index.scss +8 -6
- package/dist/views/Login/meta.js +12 -8
- package/dist/views/Login/meta.js.map +1 -1
- package/dist/views/Logout/LogoutClient.d.ts +1 -0
- package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
- package/dist/views/Logout/LogoutClient.js +110 -41
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/Logout/index.d.ts.map +1 -1
- package/dist/views/Logout/index.js +29 -16
- package/dist/views/Logout/index.js.map +1 -1
- package/dist/views/Logout/index.scss +19 -14
- package/dist/views/Logout/meta.js +11 -7
- package/dist/views/Logout/meta.js.map +1 -1
- package/dist/views/NotFound/index.client.d.ts.map +1 -1
- package/dist/views/NotFound/index.client.js +81 -40
- package/dist/views/NotFound/index.client.js.map +1 -1
- package/dist/views/NotFound/index.d.ts +5 -5
- package/dist/views/NotFound/index.d.ts.map +1 -1
- package/dist/views/NotFound/index.js +49 -37
- package/dist/views/NotFound/index.js.map +1 -1
- package/dist/views/NotFound/index.scss +41 -21
- package/dist/views/NotFound/meta.js +9 -7
- package/dist/views/NotFound/meta.js.map +1 -1
- package/dist/views/ResetPassword/ResetPasswordForm/index.d.ts +7 -0
- package/dist/views/ResetPassword/ResetPasswordForm/index.d.ts.map +1 -0
- package/dist/views/ResetPassword/ResetPasswordForm/index.js +110 -0
- package/dist/views/ResetPassword/ResetPasswordForm/index.js.map +1 -0
- package/dist/views/ResetPassword/index.d.ts.map +1 -1
- package/dist/views/ResetPassword/index.js +74 -58
- package/dist/views/ResetPassword/index.js.map +1 -1
- package/dist/views/ResetPassword/index.scss +9 -3
- package/dist/views/ResetPassword/meta.js +12 -8
- package/dist/views/ResetPassword/meta.js.map +1 -1
- package/dist/views/Root/generateCustomViewMetadata.js +21 -19
- package/dist/views/Root/generateCustomViewMetadata.js.map +1 -1
- package/dist/views/Root/getCustomViewByRoute.js +42 -31
- package/dist/views/Root/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Root/getViewFromConfig.d.ts.map +1 -1
- package/dist/views/Root/getViewFromConfig.js +158 -158
- package/dist/views/Root/getViewFromConfig.js.map +1 -1
- package/dist/views/Root/index.d.ts +5 -5
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Root/index.js +105 -83
- package/dist/views/Root/index.js.map +1 -1
- package/dist/views/Root/isPathMatchingRoute.d.ts.map +1 -1
- package/dist/views/Root/isPathMatchingRoute.js +22 -13
- package/dist/views/Root/isPathMatchingRoute.js.map +1 -1
- package/dist/views/Root/meta.d.ts +5 -5
- package/dist/views/Root/meta.d.ts.map +1 -1
- package/dist/views/Root/meta.js +142 -136
- package/dist/views/Root/meta.js.map +1 -1
- package/dist/views/Unauthorized/index.d.ts.map +1 -1
- package/dist/views/Unauthorized/index.js +40 -23
- package/dist/views/Unauthorized/index.js.map +1 -1
- package/dist/views/Unauthorized/index.scss +4 -31
- package/dist/views/Unauthorized/meta.js +12 -8
- package/dist/views/Unauthorized/meta.js.map +1 -1
- package/dist/views/Verify/index.client.d.ts +7 -0
- package/dist/views/Verify/index.client.d.ts.map +1 -0
- package/dist/views/Verify/index.client.js +46 -0
- package/dist/views/Verify/index.client.js.map +1 -0
- package/dist/views/Verify/index.d.ts.map +1 -1
- package/dist/views/Verify/index.js +61 -44
- package/dist/views/Verify/index.js.map +1 -1
- package/dist/views/Verify/index.scss +13 -11
- package/dist/views/Verify/meta.js +12 -8
- package/dist/views/Verify/meta.js.map +1 -1
- package/dist/views/Version/Default/SetStepNav.d.ts.map +1 -1
- package/dist/views/Version/Default/SetStepNav.js +147 -103
- package/dist/views/Version/Default/SetStepNav.js.map +1 -1
- package/dist/views/Version/Default/index.d.ts.map +1 -1
- package/dist/views/Version/Default/index.js +200 -114
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/Default/index.scss +52 -50
- package/dist/views/Version/Default/types.js +1 -2
- package/dist/views/Version/Default/types.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/Label/index.js +6 -5
- package/dist/views/Version/RenderFieldsToDiff/Label/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/Label/index.scss +5 -3
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +68 -70
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.scss +29 -27
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +35 -32
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.scss +11 -9
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +108 -78
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.scss +12 -10
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js +17 -11
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +42 -38
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.scss +12 -10
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +42 -32
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js +17 -11
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +39 -30
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.scss +12 -10
- package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js +4 -5
- package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js +20 -21
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/styles.js +23 -24
- package/dist/views/Version/RenderFieldsToDiff/fields/styles.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js +1 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.js +106 -97
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.scss +12 -10
- package/dist/views/Version/RenderFieldsToDiff/types.js +1 -2
- package/dist/views/Version/RenderFieldsToDiff/types.js.map +1 -1
- package/dist/views/Version/Restore/index.d.ts.map +1 -1
- package/dist/views/Version/Restore/index.js +111 -112
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/Restore/index.scss +60 -42
- package/dist/views/Version/Restore/types.js +1 -2
- package/dist/views/Version/Restore/types.js.map +1 -1
- package/dist/views/Version/SelectComparison/index.d.ts.map +1 -1
- package/dist/views/Version/SelectComparison/index.js +153 -138
- package/dist/views/Version/SelectComparison/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/index.scss +12 -10
- package/dist/views/Version/SelectComparison/types.d.ts +1 -0
- package/dist/views/Version/SelectComparison/types.d.ts.map +1 -1
- package/dist/views/Version/SelectComparison/types.js +1 -2
- package/dist/views/Version/SelectComparison/types.js.map +1 -1
- package/dist/views/Version/SelectLocales/index.d.ts.map +1 -1
- package/dist/views/Version/SelectLocales/index.js +58 -30
- package/dist/views/Version/SelectLocales/index.js.map +1 -1
- package/dist/views/Version/SelectLocales/index.scss +6 -4
- package/dist/views/Version/SelectLocales/types.js +1 -2
- package/dist/views/Version/SelectLocales/types.js.map +1 -1
- package/dist/views/Version/index.d.ts.map +1 -1
- package/dist/views/Version/index.js +128 -105
- package/dist/views/Version/index.js.map +1 -1
- package/dist/views/Version/meta.js +49 -43
- package/dist/views/Version/meta.js.map +1 -1
- package/dist/views/Versions/buildColumns.d.ts.map +1 -1
- package/dist/views/Versions/buildColumns.js +95 -75
- 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 +98 -43
- 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 +70 -17
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
- package/dist/views/Versions/cells/ID/index.js +17 -5
- package/dist/views/Versions/cells/ID/index.js.map +1 -1
- package/dist/views/Versions/getLatestVersion.d.ts +1 -0
- package/dist/views/Versions/getLatestVersion.d.ts.map +1 -1
- package/dist/views/Versions/getLatestVersion.js +45 -30
- package/dist/views/Versions/getLatestVersion.js.map +1 -1
- package/dist/views/Versions/index.client.js +80 -77
- package/dist/views/Versions/index.client.js.map +1 -1
- package/dist/views/Versions/index.d.ts.map +1 -1
- package/dist/views/Versions/index.js +170 -126
- package/dist/views/Versions/index.js.map +1 -1
- package/dist/views/Versions/index.scss +78 -76
- package/dist/views/Versions/meta.js +43 -37
- package/dist/views/Versions/meta.js.map +1 -1
- package/dist/views/Versions/types.js +1 -2
- package/dist/views/Versions/types.js.map +1 -1
- package/dist/withPayload.d.ts.map +1 -1
- package/dist/withPayload.js +83 -117
- package/dist/withPayload.js.map +1 -1
- package/package.json +38 -20
- package/dist/views/ResetPassword/index.client.d.ts +0 -7
- package/dist/views/ResetPassword/index.client.d.ts.map +0 -1
- package/dist/views/ResetPassword/index.client.js +0 -72
- package/dist/views/ResetPassword/index.client.js.map +0 -1
|
@@ -1,61 +1,67 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Logout } from '@payloadcms/ui';
|
|
3
|
-
import {
|
|
3
|
+
import { getCreateMappedComponent, RenderComponent } from '@payloadcms/ui/shared';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { NavHamburger } from './NavHamburger/index.js';
|
|
6
6
|
import { NavWrapper } from './NavWrapper/index.js';
|
|
7
7
|
const baseClass = 'nav';
|
|
8
8
|
import { DefaultNavClient } from './index.client.js';
|
|
9
|
-
export const DefaultNav =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
export const DefaultNav = props => {
|
|
10
|
+
const {
|
|
11
|
+
i18n,
|
|
12
|
+
locale,
|
|
13
|
+
params,
|
|
14
|
+
payload,
|
|
15
|
+
permissions,
|
|
16
|
+
searchParams,
|
|
17
|
+
user
|
|
18
|
+
} = props;
|
|
19
|
+
if (!payload?.config) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const {
|
|
23
|
+
admin: {
|
|
24
|
+
components: {
|
|
25
|
+
afterNavLinks,
|
|
26
|
+
beforeNavLinks
|
|
27
|
+
}
|
|
13
28
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
className: `${baseClass}__header-content`,
|
|
52
|
-
children: /*#__PURE__*/ _jsx(NavHamburger, {
|
|
53
|
-
baseClass: baseClass
|
|
54
|
-
})
|
|
55
|
-
})
|
|
56
|
-
})
|
|
57
|
-
]
|
|
58
|
-
});
|
|
29
|
+
} = payload.config;
|
|
30
|
+
const createMappedComponent = getCreateMappedComponent({
|
|
31
|
+
importMap: payload.importMap,
|
|
32
|
+
serverProps: {
|
|
33
|
+
i18n,
|
|
34
|
+
locale,
|
|
35
|
+
params,
|
|
36
|
+
payload,
|
|
37
|
+
permissions,
|
|
38
|
+
searchParams,
|
|
39
|
+
user
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const mappedBeforeNavLinks = createMappedComponent(beforeNavLinks, undefined, undefined, 'beforeNavLinks');
|
|
43
|
+
const mappedAfterNavLinks = createMappedComponent(afterNavLinks, undefined, undefined, 'afterNavLinks');
|
|
44
|
+
return /*#__PURE__*/_jsxs(NavWrapper, {
|
|
45
|
+
baseClass: baseClass,
|
|
46
|
+
children: [/*#__PURE__*/_jsxs("nav", {
|
|
47
|
+
className: `${baseClass}__wrap`,
|
|
48
|
+
children: [/*#__PURE__*/_jsx(RenderComponent, {
|
|
49
|
+
mappedComponent: mappedBeforeNavLinks
|
|
50
|
+
}), /*#__PURE__*/_jsx(DefaultNavClient, {}), /*#__PURE__*/_jsx(RenderComponent, {
|
|
51
|
+
mappedComponent: mappedAfterNavLinks
|
|
52
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
53
|
+
className: `${baseClass}__controls`,
|
|
54
|
+
children: /*#__PURE__*/_jsx(Logout, {})
|
|
55
|
+
})]
|
|
56
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
57
|
+
className: `${baseClass}__header`,
|
|
58
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
59
|
+
className: `${baseClass}__header-content`,
|
|
60
|
+
children: /*#__PURE__*/_jsx(NavHamburger, {
|
|
61
|
+
baseClass: baseClass
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
59
66
|
};
|
|
60
|
-
|
|
61
67
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/elements/Nav/index.tsx"],"sourcesContent":["import type { ServerProps } from 'payload'\n\nimport { Logout } from '@payloadcms/ui'\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","names":["Logout","getCreateMappedComponent","RenderComponent","React","NavHamburger","NavWrapper","baseClass","DefaultNavClient","DefaultNav","props","i18n","locale","params","payload","permissions","searchParams","user","config","admin","components","afterNavLinks","beforeNavLinks","createMappedComponent","importMap","serverProps","mappedBeforeNavLinks","undefined","mappedAfterNavLinks","_jsxs","className","_jsx","mappedComponent"],"sources":["../../../src/elements/Nav/index.tsx"],"sourcesContent":["import type { ServerProps } from 'payload'\n\nimport { Logout } from '@payloadcms/ui'\nimport { getCreateMappedComponent, RenderComponent } from '@payloadcms/ui/shared'\nimport React from 'react'\n\nimport './index.scss'\nimport { NavHamburger } from './NavHamburger/index.js'\nimport { NavWrapper } from './NavWrapper/index.js'\n\nconst baseClass = 'nav'\n\nimport { DefaultNavClient } from './index.client.js'\n\nexport type NavProps = ServerProps\n\nexport const DefaultNav: React.FC<NavProps> = (props) => {\n const { i18n, locale, params, payload, permissions, searchParams, user } = props\n\n if (!payload?.config) {\n return null\n }\n\n const {\n admin: {\n components: { afterNavLinks, beforeNavLinks },\n },\n } = payload.config\n\n const createMappedComponent = getCreateMappedComponent({\n importMap: payload.importMap,\n serverProps: {\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n },\n })\n\n const mappedBeforeNavLinks = createMappedComponent(\n beforeNavLinks,\n undefined,\n undefined,\n 'beforeNavLinks',\n )\n const mappedAfterNavLinks = createMappedComponent(\n afterNavLinks,\n undefined,\n undefined,\n 'afterNavLinks',\n )\n\n return (\n <NavWrapper baseClass={baseClass}>\n <nav className={`${baseClass}__wrap`}>\n <RenderComponent mappedComponent={mappedBeforeNavLinks} />\n <DefaultNavClient />\n <RenderComponent mappedComponent={mappedAfterNavLinks} />\n <div className={`${baseClass}__controls`}>\n <Logout />\n </div>\n </nav>\n <div className={`${baseClass}__header`}>\n <div className={`${baseClass}__header-content`}>\n <NavHamburger baseClass={baseClass} />\n </div>\n </div>\n </NavWrapper>\n )\n}\n"],"mappings":";AAEA,SAASA,MAAM,QAAQ;AACvB,SAASC,wBAAwB,EAAEC,eAAe,QAAQ;AAC1D,OAAOC,KAAA,MAAW;AAGlB,SAASC,YAAY,QAAQ;AAC7B,SAASC,UAAU,QAAQ;AAE3B,MAAMC,SAAA,GAAY;AAElB,SAASC,gBAAgB,QAAQ;AAIjC,OAAO,MAAMC,UAAA,GAAkCC,KAAA;EAC7C,MAAM;IAAEC,IAAI;IAAEC,MAAM;IAAEC,MAAM;IAAEC,OAAO;IAAEC,WAAW;IAAEC,YAAY;IAAEC;EAAI,CAAE,GAAGP,KAAA;EAE3E,IAAI,CAACI,OAAA,EAASI,MAAA,EAAQ;IACpB,OAAO;EACT;EAEA,MAAM;IACJC,KAAA,EAAO;MACLC,UAAA,EAAY;QAAEC,aAAa;QAAEC;MAAc;IAAE;EAC9C,CACF,GAAGR,OAAA,CAAQI,MAAM;EAElB,MAAMK,qBAAA,GAAwBrB,wBAAA,CAAyB;IACrDsB,SAAA,EAAWV,OAAA,CAAQU,SAAS;IAC5BC,WAAA,EAAa;MACXd,IAAA;MACAC,MAAA;MACAC,MAAA;MACAC,OAAA;MACAC,WAAA;MACAC,YAAA;MACAC;IACF;EACF;EAEA,MAAMS,oBAAA,GAAuBH,qBAAA,CAC3BD,cAAA,EACAK,SAAA,EACAA,SAAA,EACA;EAEF,MAAMC,mBAAA,GAAsBL,qBAAA,CAC1BF,aAAA,EACAM,SAAA,EACAA,SAAA,EACA;EAGF,oBACEE,KAAA,CAACvB,UAAA;IAAWC,SAAA,EAAWA,SAAA;4BACrBsB,KAAA,CAAC;MAAIC,SAAA,EAAW,GAAGvB,SAAA,QAAiB;8BAClCwB,IAAA,CAAC5B,eAAA;QAAgB6B,eAAA,EAAiBN;uBAClCK,IAAA,CAACvB,gBAAA,O,aACDuB,IAAA,CAAC5B,eAAA;QAAgB6B,eAAA,EAAiBJ;uBAClCG,IAAA,CAAC;QAAID,SAAA,EAAW,GAAGvB,SAAA,YAAqB;kBACtC,aAAAwB,IAAA,CAAC9B,MAAA;;qBAGL8B,IAAA,CAAC;MAAID,SAAA,EAAW,GAAGvB,SAAA,UAAmB;gBACpC,aAAAwB,IAAA,CAAC;QAAID,SAAA,EAAW,GAAGvB,SAAA,kBAA2B;kBAC5C,aAAAwB,IAAA,CAAC1B,YAAA;UAAaE,SAAA,EAAWA;;;;;AAKnC","ignoreList":[]}
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
opacity: 0;
|
|
12
12
|
overflow: hidden;
|
|
13
13
|
|
|
14
|
+
[dir='rtl'] & {
|
|
15
|
+
border-right: none;
|
|
16
|
+
border-left: 1px solid var(--theme-elevation-100);
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
&--nav-animate {
|
|
15
20
|
transition: opacity var(--nav-trans-time) ease-in-out;
|
|
16
21
|
}
|
|
@@ -149,7 +154,6 @@
|
|
|
149
154
|
|
|
150
155
|
&__mobile-close {
|
|
151
156
|
display: flex;
|
|
152
|
-
height: 100%;
|
|
153
157
|
align-items: center;
|
|
154
158
|
}
|
|
155
159
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { metadata, RootLayout } from '../layouts/Root/index.js';
|
|
2
2
|
//# sourceMappingURL=layouts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layouts.d.ts","sourceRoot":"","sources":["../../src/exports/layouts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"layouts.d.ts","sourceRoot":"","sources":["../../src/exports/layouts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA"}
|
package/dist/exports/layouts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/layouts.ts"],"sourcesContent":["export {
|
|
1
|
+
{"version":3,"file":"layouts.js","names":["metadata","RootLayout"],"sources":["../../src/exports/layouts.ts"],"sourcesContent":["export { metadata, RootLayout } from '../layouts/Root/index.js'\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,UAAU,QAAQ","ignoreList":[]}
|
package/dist/exports/routes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/routes.ts"],"sourcesContent":["export { GRAPHQL_PLAYGROUND_GET, GRAPHQL_POST } from '../routes/graphql/index.js'\n\nexport {\n DELETE as REST_DELETE,\n GET as REST_GET,\n OPTIONS as REST_OPTIONS,\n PATCH as REST_PATCH,\n POST as REST_POST,\n} from '../routes/rest/index.js'\n"],"
|
|
1
|
+
{"version":3,"file":"routes.js","names":["GRAPHQL_PLAYGROUND_GET","GRAPHQL_POST","DELETE","REST_DELETE","GET","REST_GET","OPTIONS","REST_OPTIONS","PATCH","REST_PATCH","POST","REST_POST"],"sources":["../../src/exports/routes.ts"],"sourcesContent":["export { GRAPHQL_PLAYGROUND_GET, GRAPHQL_POST } from '../routes/graphql/index.js'\n\nexport {\n DELETE as REST_DELETE,\n GET as REST_GET,\n OPTIONS as REST_OPTIONS,\n PATCH as REST_PATCH,\n POST as REST_POST,\n} from '../routes/rest/index.js'\n"],"mappings":"AAAA,SAASA,sBAAsB,EAAEC,YAAY,QAAQ;AAErD,SACEC,MAAA,IAAUC,WAAW,EACrBC,GAAA,IAAOC,QAAQ,EACfC,OAAA,IAAWC,YAAY,EACvBC,KAAA,IAASC,UAAU,EACnBC,IAAA,IAAQC,SAAS,QACZ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/templates.ts"],"sourcesContent":["export { DefaultTemplate, type DefaultTemplateProps } from '../templates/Default/index.js'\nexport { MinimalTemplate, type MinimalTemplateProps } from '../templates/Minimal/index.js'\n"],"
|
|
1
|
+
{"version":3,"file":"templates.js","names":["DefaultTemplate","MinimalTemplate"],"sources":["../../src/exports/templates.ts"],"sourcesContent":["export { DefaultTemplate, type DefaultTemplateProps } from '../templates/Default/index.js'\nexport { MinimalTemplate, type MinimalTemplateProps } from '../templates/Minimal/index.js'\n"],"mappings":"AAAA,SAASA,eAAe,QAAmC;AAC3D,SAASC,eAAe,QAAmC","ignoreList":[]}
|
|
@@ -4,4 +4,5 @@ export { createPayloadRequest } from '../utilities/createPayloadRequest.js';
|
|
|
4
4
|
export { getNextRequestI18n } from '../utilities/getNextRequestI18n.js';
|
|
5
5
|
export { getPayloadHMR, reload } from '../utilities/getPayloadHMR.js';
|
|
6
6
|
export { headersWithCors } from '../utilities/headersWithCors.js';
|
|
7
|
+
export { mergeHeaders } from '../utilities/mergeHeaders.js';
|
|
7
8
|
//# sourceMappingURL=utilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/exports/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAA;AACjF,OAAO,EAAE,2BAA2B,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAClG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA"}
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/exports/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAA;AACjF,OAAO,EAAE,2BAA2B,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAClG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA"}
|
|
@@ -4,5 +4,5 @@ export { createPayloadRequest } from '../utilities/createPayloadRequest.js';
|
|
|
4
4
|
export { getNextRequestI18n } from '../utilities/getNextRequestI18n.js';
|
|
5
5
|
export { getPayloadHMR, reload } from '../utilities/getPayloadHMR.js';
|
|
6
6
|
export { headersWithCors } from '../utilities/headersWithCors.js';
|
|
7
|
-
|
|
7
|
+
export { mergeHeaders } from '../utilities/mergeHeaders.js';
|
|
8
8
|
//# sourceMappingURL=utilities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/utilities.ts"],"sourcesContent":["export { addDataAndFileToRequest } from '../utilities/addDataAndFileToRequest.js'\nexport { addLocalesToRequestFromData, sanitizeLocales } from '../utilities/addLocalesToRequest.js'\nexport { createPayloadRequest } from '../utilities/createPayloadRequest.js'\nexport { getNextRequestI18n } from '../utilities/getNextRequestI18n.js'\nexport { getPayloadHMR, reload } from '../utilities/getPayloadHMR.js'\nexport { headersWithCors } from '../utilities/headersWithCors.js'\n"],"
|
|
1
|
+
{"version":3,"file":"utilities.js","names":["addDataAndFileToRequest","addLocalesToRequestFromData","sanitizeLocales","createPayloadRequest","getNextRequestI18n","getPayloadHMR","reload","headersWithCors","mergeHeaders"],"sources":["../../src/exports/utilities.ts"],"sourcesContent":["export { addDataAndFileToRequest } from '../utilities/addDataAndFileToRequest.js'\nexport { addLocalesToRequestFromData, sanitizeLocales } from '../utilities/addLocalesToRequest.js'\nexport { createPayloadRequest } from '../utilities/createPayloadRequest.js'\nexport { getNextRequestI18n } from '../utilities/getNextRequestI18n.js'\nexport { getPayloadHMR, reload } from '../utilities/getPayloadHMR.js'\nexport { headersWithCors } from '../utilities/headersWithCors.js'\nexport { mergeHeaders } from '../utilities/mergeHeaders.js'\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ;AACxC,SAASC,2BAA2B,EAAEC,eAAe,QAAQ;AAC7D,SAASC,oBAAoB,QAAQ;AACrC,SAASC,kBAAkB,QAAQ;AACnC,SAASC,aAAa,EAAEC,MAAM,QAAQ;AACtC,SAASC,eAAe,QAAQ;AAChC,SAASC,YAAY,QAAQ","ignoreList":[]}
|
package/dist/exports/views.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { DefaultEditView as EditView } from '../views/Edit/Default/index.js';
|
|
2
2
|
export { DefaultListView as ListView } from '../views/List/Default/index.js';
|
|
3
3
|
export { NotFoundPage } from '../views/NotFound/index.js';
|
|
4
|
-
export { type GenerateViewMetadata, RootPage
|
|
4
|
+
export { generatePageMetadata, type GenerateViewMetadata, RootPage } from '../views/Root/index.js';
|
|
5
5
|
//# sourceMappingURL=views.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../../src/exports/views.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AAC5E,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,KAAK,oBAAoB,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../../src/exports/views.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AAC5E,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA"}
|
package/dist/exports/views.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { DefaultEditView as EditView } from '../views/Edit/Default/index.js';
|
|
2
2
|
export { DefaultListView as ListView } from '../views/List/Default/index.js';
|
|
3
3
|
export { NotFoundPage } from '../views/NotFound/index.js';
|
|
4
|
-
export {
|
|
5
|
-
|
|
4
|
+
export { generatePageMetadata, RootPage } from '../views/Root/index.js';
|
|
6
5
|
//# sourceMappingURL=views.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/views.ts"],"sourcesContent":["export { DefaultEditView as EditView } from '../views/Edit/Default/index.js'\nexport { DefaultListView as ListView } from '../views/List/Default/index.js'\nexport { NotFoundPage } from '../views/NotFound/index.js'\nexport { type GenerateViewMetadata, RootPage
|
|
1
|
+
{"version":3,"file":"views.js","names":["DefaultEditView","EditView","DefaultListView","ListView","NotFoundPage","generatePageMetadata","RootPage"],"sources":["../../src/exports/views.ts"],"sourcesContent":["export { DefaultEditView as EditView } from '../views/Edit/Default/index.js'\nexport { DefaultListView as ListView } from '../views/List/Default/index.js'\nexport { NotFoundPage } from '../views/NotFound/index.js'\nexport { generatePageMetadata, type GenerateViewMetadata, RootPage } from '../views/Root/index.js'\n"],"mappings":"AAAA,SAASA,eAAA,IAAmBC,QAAQ,QAAQ;AAC5C,SAASC,eAAA,IAAmBC,QAAQ,QAAQ;AAC5C,SAASC,YAAY,QAAQ;AAC7B,SAASC,oBAAoB,EAA6BC,QAAQ,QAAQ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileFactory.d.ts","sourceRoot":"","sources":["../../src/fetchAPI-multipart/fileFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"fileFactory.d.ts","sourceRoot":"","sources":["../../src/fetchAPI-multipart/fileFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAmC3C,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AACD,KAAK,WAAW,GAAG,CACjB,OAAO,EAAE,kBAAkB,EAC3B,iBAAiB,EAAE,yBAAyB,KACzC,SAAS,CAAA;AACd,eAAO,MAAM,WAAW,EAAE,WA4BzB,CAAA"}
|
|
@@ -2,42 +2,43 @@ import { checkAndMakeDir, debugLog, isFunc, moveFile, promiseCallback, saveBuffe
|
|
|
2
2
|
/**
|
|
3
3
|
* Returns Local function that moves the file to a different location on the filesystem
|
|
4
4
|
* which takes two function arguments to make it compatible w/ Promise or Callback APIs
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
*/
|
|
6
|
+
const moveFromTemp = (filePath, options, fileUploadOptions) => (resolve, reject) => {
|
|
7
|
+
debugLog(fileUploadOptions, `Moving temporary file ${options.tempFilePath} to ${filePath}`);
|
|
8
|
+
moveFile(options.tempFilePath, filePath, promiseCallback(resolve, reject));
|
|
9
|
+
};
|
|
9
10
|
/**
|
|
10
11
|
* Returns Local function that moves the file from buffer to a different location on the filesystem
|
|
11
12
|
* which takes two function arguments to make it compatible w/ Promise or Callback APIs
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
13
|
+
*/
|
|
14
|
+
const moveFromBuffer = (filePath, options, fileUploadOptions) => (resolve, reject) => {
|
|
15
|
+
debugLog(fileUploadOptions, `Moving uploaded buffer to ${filePath}`);
|
|
16
|
+
saveBufferToFile(options.buffer, filePath, promiseCallback(resolve, reject));
|
|
17
|
+
};
|
|
18
|
+
export const fileFactory = (options, fileUploadOptions) => {
|
|
19
|
+
// see: https://github.com/richardgirges/express-fileupload/issues/14
|
|
20
|
+
// firefox uploads empty file in case of cache miss when f5ing page.
|
|
21
|
+
// resulting in unexpected behavior. if there is no file data, the file is invalid.
|
|
22
|
+
// if (!fileUploadOptions.useTempFiles && !options.buffer.length) return;
|
|
23
|
+
// Create and return file object.
|
|
24
|
+
return {
|
|
25
|
+
name: options.name,
|
|
26
|
+
data: options.buffer,
|
|
27
|
+
encoding: options.encoding,
|
|
28
|
+
md5: options.hash,
|
|
29
|
+
mimetype: options.mimetype,
|
|
30
|
+
mv: (filePath, callback) => {
|
|
31
|
+
// Define a proper move function.
|
|
32
|
+
const moveFunc = fileUploadOptions.useTempFiles ? moveFromTemp(filePath, options, fileUploadOptions) : moveFromBuffer(filePath, options, fileUploadOptions);
|
|
33
|
+
// Create a folder for a file.
|
|
34
|
+
checkAndMakeDir(fileUploadOptions, filePath);
|
|
35
|
+
// If callback is passed in, use the callback API, otherwise return a promise.
|
|
36
|
+
const defaultReject = () => undefined;
|
|
37
|
+
return isFunc(callback) ? moveFunc(callback, defaultReject) : new Promise(moveFunc);
|
|
38
|
+
},
|
|
39
|
+
size: options.size,
|
|
40
|
+
tempFilePath: options.tempFilePath,
|
|
41
|
+
truncated: options.truncated
|
|
42
|
+
};
|
|
41
43
|
};
|
|
42
|
-
|
|
43
44
|
//# sourceMappingURL=fileFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fetchAPI-multipart/fileFactory.ts"],"sourcesContent":["import type { FetchAPIFileUploadOptions
|
|
1
|
+
{"version":3,"file":"fileFactory.js","names":["checkAndMakeDir","debugLog","isFunc","moveFile","promiseCallback","saveBufferToFile","moveFromTemp","filePath","options","fileUploadOptions","resolve","reject","tempFilePath","moveFromBuffer","buffer","fileFactory","name","data","encoding","md5","hash","mimetype","mv","callback","moveFunc","useTempFiles","defaultReject","undefined","Promise","size","truncated"],"sources":["../../src/fetchAPI-multipart/fileFactory.ts"],"sourcesContent":["import type { FetchAPIFileUploadOptions } from 'payload'\n\nimport type { FileShape } from './index.js'\n\nimport {\n checkAndMakeDir,\n debugLog,\n isFunc,\n moveFile,\n promiseCallback,\n saveBufferToFile,\n} from './utilities.js'\n\ntype MoveFile = (\n filePath: string,\n options: FileFactoryOptions,\n fileUploadOptions: FetchAPIFileUploadOptions,\n) => (resolve: () => void, reject: () => void) => void\n\n/**\n * Returns Local function that moves the file to a different location on the filesystem\n * which takes two function arguments to make it compatible w/ Promise or Callback APIs\n */\nconst moveFromTemp: MoveFile = (filePath, options, fileUploadOptions) => (resolve, reject) => {\n debugLog(fileUploadOptions, `Moving temporary file ${options.tempFilePath} to ${filePath}`)\n moveFile(options.tempFilePath, filePath, promiseCallback(resolve, reject))\n}\n\n/**\n * Returns Local function that moves the file from buffer to a different location on the filesystem\n * which takes two function arguments to make it compatible w/ Promise or Callback APIs\n */\nconst moveFromBuffer: MoveFile = (filePath, options, fileUploadOptions) => (resolve, reject) => {\n debugLog(fileUploadOptions, `Moving uploaded buffer to ${filePath}`)\n saveBufferToFile(options.buffer, filePath, promiseCallback(resolve, reject))\n}\n\ntype FileFactoryOptions = {\n buffer: Buffer\n encoding: string\n hash: Buffer | string\n mimetype: string\n name: string\n size: number\n tempFilePath: string\n truncated: boolean\n}\ntype FileFactory = (\n options: FileFactoryOptions,\n fileUploadOptions: FetchAPIFileUploadOptions,\n) => FileShape\nexport const fileFactory: FileFactory = (options, fileUploadOptions) => {\n // see: https://github.com/richardgirges/express-fileupload/issues/14\n // firefox uploads empty file in case of cache miss when f5ing page.\n // resulting in unexpected behavior. if there is no file data, the file is invalid.\n // if (!fileUploadOptions.useTempFiles && !options.buffer.length) return;\n\n // Create and return file object.\n return {\n name: options.name,\n data: options.buffer,\n encoding: options.encoding,\n md5: options.hash,\n mimetype: options.mimetype,\n mv: (filePath: string, callback) => {\n // Define a proper move function.\n const moveFunc = fileUploadOptions.useTempFiles\n ? moveFromTemp(filePath, options, fileUploadOptions)\n : moveFromBuffer(filePath, options, fileUploadOptions)\n // Create a folder for a file.\n checkAndMakeDir(fileUploadOptions, filePath)\n // If callback is passed in, use the callback API, otherwise return a promise.\n const defaultReject = () => undefined\n return isFunc(callback) ? moveFunc(callback, defaultReject) : new Promise(moveFunc)\n },\n size: options.size,\n tempFilePath: options.tempFilePath,\n truncated: options.truncated,\n }\n}\n"],"mappings":"AAIA,SACEA,eAAe,EACfC,QAAQ,EACRC,MAAM,EACNC,QAAQ,EACRC,eAAe,EACfC,gBAAgB,QACX;AAQP;;;;AAIA,MAAMC,YAAA,GAAyBA,CAACC,QAAA,EAAUC,OAAA,EAASC,iBAAA,KAAsB,CAACC,OAAA,EAASC,MAAA;EACjFV,QAAA,CAASQ,iBAAA,EAAmB,yBAAyBD,OAAA,CAAQI,YAAY,OAAOL,QAAA,EAAU;EAC1FJ,QAAA,CAASK,OAAA,CAAQI,YAAY,EAAEL,QAAA,EAAUH,eAAA,CAAgBM,OAAA,EAASC,MAAA;AACpE;AAEA;;;;AAIA,MAAME,cAAA,GAA2BA,CAACN,QAAA,EAAUC,OAAA,EAASC,iBAAA,KAAsB,CAACC,OAAA,EAASC,MAAA;EACnFV,QAAA,CAASQ,iBAAA,EAAmB,6BAA6BF,QAAA,EAAU;EACnEF,gBAAA,CAAiBG,OAAA,CAAQM,MAAM,EAAEP,QAAA,EAAUH,eAAA,CAAgBM,OAAA,EAASC,MAAA;AACtE;AAgBA,OAAO,MAAMI,WAAA,GAA2BA,CAACP,OAAA,EAASC,iBAAA;EAChD;EACA;EACA;EACA;EAEA;EACA,OAAO;IACLO,IAAA,EAAMR,OAAA,CAAQQ,IAAI;IAClBC,IAAA,EAAMT,OAAA,CAAQM,MAAM;IACpBI,QAAA,EAAUV,OAAA,CAAQU,QAAQ;IAC1BC,GAAA,EAAKX,OAAA,CAAQY,IAAI;IACjBC,QAAA,EAAUb,OAAA,CAAQa,QAAQ;IAC1BC,EAAA,EAAIA,CAACf,QAAA,EAAkBgB,QAAA;MACrB;MACA,MAAMC,QAAA,GAAWf,iBAAA,CAAkBgB,YAAY,GAC3CnB,YAAA,CAAaC,QAAA,EAAUC,OAAA,EAASC,iBAAA,IAChCI,cAAA,CAAeN,QAAA,EAAUC,OAAA,EAASC,iBAAA;MACtC;MACAT,eAAA,CAAgBS,iBAAA,EAAmBF,QAAA;MACnC;MACA,MAAMmB,aAAA,GAAgBA,CAAA,KAAMC,SAAA;MAC5B,OAAOzB,MAAA,CAAOqB,QAAA,IAAYC,QAAA,CAASD,QAAA,EAAUG,aAAA,IAAiB,IAAIE,OAAA,CAAQJ,QAAA;IAC5E;IACAK,IAAA,EAAMrB,OAAA,CAAQqB,IAAI;IAClBjB,YAAA,EAAcJ,OAAA,CAAQI,YAAY;IAClCkB,SAAA,EAAWtB,OAAA,CAAQsB;EACrB;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/fetchAPI-multipart/handlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/fetchAPI-multipart/handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAQxD,KAAK,OAAO,GAAG,CACb,OAAO,EAAE,yBAAyB,EAClC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,KACb;IACH,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,EAAE,MAAM,MAAM,CAAA;IACtB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,WAAW,EAAE,MAAM,MAAM,CAAA;IACzB,WAAW,EAAE,MAAM,MAAM,CAAA;IACzB,OAAO,EAAE,MAAM,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CACxC,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,OAwD7B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,OAgCxB,CAAA"}
|
|
@@ -2,85 +2,86 @@ import crypto from 'crypto';
|
|
|
2
2
|
import fs, { WriteStream } from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { checkAndMakeDir, debugLog, deleteFile, getTempFilename } from './utilities.js';
|
|
5
|
-
export const tempFileHandler = (options, fieldname, filename)=>{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
5
|
+
export const tempFileHandler = (options, fieldname, filename) => {
|
|
6
|
+
const dir = path.normalize(options.tempFileDir);
|
|
7
|
+
const tempFilePath = path.join(process.cwd(), dir, getTempFilename());
|
|
8
|
+
checkAndMakeDir({
|
|
9
|
+
createParentPath: true
|
|
10
|
+
}, tempFilePath);
|
|
11
|
+
debugLog(options, `Temporary file path is ${tempFilePath}`);
|
|
12
|
+
const hash = crypto.createHash('md5');
|
|
13
|
+
let fileSize = 0;
|
|
14
|
+
let completed = false;
|
|
15
|
+
debugLog(options, `Opening write stream for ${fieldname}->${filename}...`);
|
|
16
|
+
const writeStream = fs.createWriteStream(tempFilePath);
|
|
17
|
+
const writePromise = new Promise((resolve, reject) => {
|
|
18
|
+
writeStream.on('finish', () => resolve(true));
|
|
19
|
+
writeStream.on('error', err => {
|
|
20
|
+
debugLog(options, `Error write temp file: ${err}`);
|
|
21
|
+
reject(err);
|
|
23
22
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
cleanup: () => {
|
|
26
|
+
completed = true;
|
|
27
|
+
debugLog(options, `Cleaning up temporary file ${tempFilePath}...`);
|
|
28
|
+
writeStream.end();
|
|
29
|
+
deleteFile(tempFilePath, err => err ? debugLog(options, `Cleaning up temporary file ${tempFilePath} failed: ${err}`) : debugLog(options, `Cleaning up temporary file ${tempFilePath} done.`));
|
|
30
|
+
},
|
|
31
|
+
complete: () => {
|
|
32
|
+
completed = true;
|
|
33
|
+
debugLog(options, `Upload ${fieldname}->${filename} completed, bytes:${fileSize}.`);
|
|
34
|
+
if (writeStream instanceof WriteStream) {
|
|
35
|
+
writeStream.end();
|
|
36
|
+
}
|
|
37
|
+
// Return empty buff since data was uploaded into a temp file.
|
|
38
|
+
return Buffer.concat([]);
|
|
39
|
+
},
|
|
40
|
+
dataHandler: data => {
|
|
41
|
+
if (completed === true) {
|
|
42
|
+
debugLog(options, `Error: got ${fieldname}->${filename} data chunk for completed upload!`);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
writeStream.write(data);
|
|
46
|
+
hash.update(data);
|
|
47
|
+
fileSize += data.length;
|
|
48
|
+
debugLog(options, `Uploading ${fieldname}->${filename}, bytes:${fileSize}...`);
|
|
49
|
+
},
|
|
50
|
+
getFilePath: () => tempFilePath,
|
|
51
|
+
getFileSize: () => fileSize,
|
|
52
|
+
getHash: () => hash.digest('hex'),
|
|
53
|
+
getWritePromise: () => writePromise
|
|
54
|
+
};
|
|
53
55
|
};
|
|
54
|
-
export const memHandler = (options, fieldname, filename)=>{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
56
|
+
export const memHandler = (options, fieldname, filename) => {
|
|
57
|
+
const buffers = [];
|
|
58
|
+
const hash = crypto.createHash('md5');
|
|
59
|
+
let fileSize = 0;
|
|
60
|
+
let completed = false;
|
|
61
|
+
const getBuffer = () => Buffer.concat(buffers, fileSize);
|
|
62
|
+
return {
|
|
63
|
+
cleanup: () => {
|
|
64
|
+
completed = true;
|
|
65
|
+
},
|
|
66
|
+
complete: () => {
|
|
67
|
+
debugLog(options, `Upload ${fieldname}->${filename} completed, bytes:${fileSize}.`);
|
|
68
|
+
completed = true;
|
|
69
|
+
return getBuffer();
|
|
70
|
+
},
|
|
71
|
+
dataHandler: data => {
|
|
72
|
+
if (completed === true) {
|
|
73
|
+
debugLog(options, `Error: got ${fieldname}->${filename} data chunk for completed upload!`);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
buffers.push(data);
|
|
77
|
+
hash.update(data);
|
|
78
|
+
fileSize += data.length;
|
|
79
|
+
debugLog(options, `Uploading ${fieldname}->${filename}, bytes:${fileSize}...`);
|
|
80
|
+
},
|
|
81
|
+
getFilePath: () => '',
|
|
82
|
+
getFileSize: () => fileSize,
|
|
83
|
+
getHash: () => hash.digest('hex'),
|
|
84
|
+
getWritePromise: () => Promise.resolve(true)
|
|
85
|
+
};
|
|
84
86
|
};
|
|
85
|
-
|
|
86
87
|
//# sourceMappingURL=handlers.js.map
|