@payloadcms/next 3.0.0-canary.013af1b → 3.0.0-canary.0374de4
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/elements/DocumentHeader/Tabs/Tab/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js +4 -4
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.js +10 -4
- 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 +27 -24
- 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 +2 -2
- 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.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.map +1 -1
- package/dist/elements/LeaveWithoutSaving/index.d.ts.map +1 -1
- 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 +3 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +1 -1
- package/dist/elements/Logo/index.js +1 -1
- package/dist/elements/Logo/index.js.map +1 -1
- package/dist/elements/Nav/index.client.d.ts.map +1 -1
- package/dist/elements/Nav/index.client.js +1 -1
- 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 +1 -1
- package/dist/elements/Nav/index.js.map +1 -1
- package/dist/exports/layouts.d.ts +1 -1
- package/dist/exports/layouts.d.ts.map +1 -1
- package/dist/exports/layouts.js +1 -1
- package/dist/exports/layouts.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 -1
- 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.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 +3 -1
- 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 +1 -1
- package/dist/fetchAPI-multipart/index.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 +1 -0
- 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 +8 -4
- 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 +3 -1
- 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 +32 -12
- package/dist/fetchAPI-multipart/utilities.js.map +1 -1
- package/dist/layouts/Root/index.js +2 -2
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/prod/styles.css +1 -1
- package/dist/routes/rest/collections/find.d.ts.map +1 -1
- package/dist/routes/rest/collections/find.js +3 -0
- 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 +2 -0
- package/dist/routes/rest/collections/findByID.js.map +1 -1
- package/dist/routes/rest/collections/updateByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/updateByID.js +8 -2
- 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 +7 -2
- 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 +6 -2
- package/dist/routes/rest/files/getFile.js.map +1 -1
- package/dist/routes/rest/globals/update.d.ts.map +1 -1
- package/dist/routes/rest/globals/update.js +8 -2
- package/dist/routes/rest/globals/update.js.map +1 -1
- package/dist/routes/rest/index.d.ts.map +1 -1
- package/dist/routes/rest/index.js +42 -14
- 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 +7 -7
- package/dist/routes/rest/og/image.js.map +1 -1
- package/dist/routes/rest/og/index.js +2 -2
- package/dist/routes/rest/og/index.js.map +1 -1
- package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts.map +1 -1
- package/dist/routes/rest/utilities/sanitizeCollectionID.js +6 -2
- 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/templates/Default/Wrapper/index.scss +0 -1
- package/dist/templates/Default/index.d.ts.map +1 -1
- package/dist/templates/Default/index.js +21 -19
- package/dist/templates/Default/index.js.map +1 -1
- package/dist/templates/Default/index.scss +1 -1
- package/dist/templates/Minimal/index.scss +2 -2
- package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -1
- package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
- package/dist/utilities/addLocalesToRequest.d.ts.map +1 -1
- package/dist/utilities/addLocalesToRequest.js +6 -2
- package/dist/utilities/addLocalesToRequest.js.map +1 -1
- package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
- package/dist/utilities/createPayloadRequest.js +9 -3
- package/dist/utilities/createPayloadRequest.js.map +1 -1
- package/dist/utilities/getNextRequestI18n.d.ts.map +1 -1
- package/dist/utilities/getNextRequestI18n.js.map +1 -1
- package/dist/utilities/getPayloadHMR.js.map +1 -1
- package/dist/utilities/getRequestTheme.d.ts.map +1 -1
- package/dist/utilities/getRequestTheme.js.map +1 -1
- package/dist/utilities/headersWithCors.d.ts.map +1 -1
- package/dist/utilities/headersWithCors.js.map +1 -1
- package/dist/utilities/initPage/handleAuthRedirect.d.ts.map +1 -1
- package/dist/utilities/initPage/handleAuthRedirect.js +3 -1
- package/dist/utilities/initPage/handleAuthRedirect.js.map +1 -1
- package/dist/utilities/initPage/index.d.ts.map +1 -1
- package/dist/utilities/initPage/index.js +3 -1
- package/dist/utilities/initPage/index.js.map +1 -1
- package/dist/utilities/timestamp.d.ts.map +1 -1
- package/dist/utilities/timestamp.js +3 -1
- package/dist/utilities/timestamp.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.map +1 -1
- package/dist/views/API/index.client.d.ts.map +1 -1
- package/dist/views/API/index.client.js.map +1 -1
- package/dist/views/Account/Settings/index.d.ts.map +1 -1
- package/dist/views/Account/Settings/index.js.map +1 -1
- package/dist/views/Account/index.d.ts.map +1 -1
- package/dist/views/Account/index.js +1 -1
- package/dist/views/Account/index.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 +4 -1
- 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.map +1 -1
- package/dist/views/CreateFirstUser/index.scss +10 -0
- 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 +18 -6
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- package/dist/views/Dashboard/Default/index.scss +5 -0
- package/dist/views/Dashboard/index.d.ts.map +1 -1
- package/dist/views/Dashboard/index.js +18 -3
- package/dist/views/Dashboard/index.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 +13 -2
- package/dist/views/Document/getDocumentData.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.map +1 -1
- package/dist/views/Document/index.d.ts.map +1 -1
- package/dist/views/Document/index.js +2 -2
- package/dist/views/Document/index.js.map +1 -1
- package/dist/views/Edit/Default/Auth/APIKey.js +3 -3
- package/dist/views/Edit/Default/Auth/APIKey.js.map +1 -1
- 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.map +1 -1
- package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js.map +1 -1
- package/dist/views/Edit/Default/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/index.js +183 -18
- package/dist/views/Edit/Default/index.js.map +1 -1
- package/dist/views/ForgotPassword/index.js +1 -1
- package/dist/views/ForgotPassword/index.js.map +1 -1
- package/dist/views/List/Default/index.d.ts.map +1 -1
- package/dist/views/List/Default/index.js +166 -146
- package/dist/views/List/Default/index.js.map +1 -1
- package/dist/views/List/Default/index.scss +1 -0
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js +4 -3
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/LivePreview/Context/context.d.ts +1 -1
- 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.map +1 -1
- package/dist/views/LivePreview/Context/index.js +3 -1
- 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 +6 -2
- package/dist/views/LivePreview/Device/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.js +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/SizeInput/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js.map +1 -1
- package/dist/views/LivePreview/index.client.d.ts.map +1 -1
- package/dist/views/LivePreview/index.client.js +6 -3
- package/dist/views/LivePreview/index.client.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.map +1 -1
- package/dist/views/Login/LoginForm/index.d.ts.map +1 -1
- package/dist/views/Login/LoginForm/index.js +28 -12
- package/dist/views/Login/LoginForm/index.js.map +1 -1
- package/dist/views/Login/index.d.ts.map +1 -1
- package/dist/views/Login/index.js +1 -1
- package/dist/views/Login/index.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 +4 -2
- 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 +1 -1
- package/dist/views/Logout/index.js.map +1 -1
- package/dist/views/Logout/index.scss +12 -9
- package/dist/views/NotFound/index.client.d.ts.map +1 -1
- package/dist/views/NotFound/index.client.js +8 -5
- package/dist/views/NotFound/index.client.js.map +1 -1
- package/dist/views/NotFound/index.d.ts.map +1 -1
- package/dist/views/NotFound/index.js.map +1 -1
- package/dist/views/NotFound/index.scss +18 -0
- package/dist/views/ResetPassword/index.client.d.ts.map +1 -1
- package/dist/views/ResetPassword/index.client.js +15 -12
- package/dist/views/ResetPassword/index.client.js.map +1 -1
- package/dist/views/ResetPassword/index.d.ts.map +1 -1
- package/dist/views/ResetPassword/index.js +36 -42
- package/dist/views/ResetPassword/index.js.map +1 -1
- package/dist/views/ResetPassword/index.scss +28 -2
- package/dist/views/Root/getViewFromConfig.js +2 -2
- package/dist/views/Root/getViewFromConfig.js.map +1 -1
- package/dist/views/Root/index.js +1 -1
- 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 +6 -2
- package/dist/views/Root/isPathMatchingRoute.js.map +1 -1
- package/dist/views/Unauthorized/index.js +1 -1
- package/dist/views/Unauthorized/index.js.map +1 -1
- package/dist/views/Verify/index.d.ts.map +1 -1
- package/dist/views/Verify/index.js +6 -5
- package/dist/views/Verify/index.js.map +1 -1
- package/dist/views/Version/Default/index.d.ts.map +1 -1
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +4 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/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 +3 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/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 +9 -3
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.js +8 -4
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
- package/dist/views/Version/Restore/index.d.ts.map +1 -1
- package/dist/views/Version/Restore/index.js +24 -16
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/Restore/index.scss +26 -10
- package/dist/views/Version/SelectComparison/index.d.ts.map +1 -1
- package/dist/views/Version/SelectComparison/index.js +26 -3
- package/dist/views/Version/SelectComparison/index.js.map +1 -1
- package/dist/views/Version/SelectLocales/index.d.ts.map +1 -1
- package/dist/views/Version/SelectLocales/index.js.map +1 -1
- package/dist/views/Versions/buildColumns.d.ts.map +1 -1
- package/dist/views/Versions/buildColumns.js +63 -48
- 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 +48 -20
- 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.map +1 -1
- package/dist/views/Versions/index.client.js +2 -2
- 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 +15 -4
- package/dist/views/Versions/index.js.map +1 -1
- package/package.json +10 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","Button","Modal","useModal","useTranslation","React","useEffect","modalSlug","baseClass","DocumentTakeOver","t0","$","handleBackToDashboard","isActive","onReadOnly","closeModal","openModal","t","t1","t2","t3","t4","_jsx","className","slug","children","_jsxs","buttonStyle","id","onClick","size"],"sources":["../../../src/elements/DocumentTakeOver/index.tsx"],"sourcesContent":["'use client'\nimport { Button, Modal, useModal, useTranslation } from '@payloadcms/ui'\nimport React, { useEffect } from 'react'\n\nimport './index.scss'\n\nconst modalSlug = 'document-take-over'\n\nconst baseClass = 'document-take-over'\n\nexport const DocumentTakeOver: React.FC<{\n handleBackToDashboard: () => void\n isActive: boolean\n onReadOnly: () => void\n}> = ({ handleBackToDashboard, isActive, onReadOnly }) => {\n const { closeModal, openModal } = useModal()\n const { t } = useTranslation()\n\n useEffect(() => {\n if (isActive) {\n openModal(modalSlug)\n } else {\n closeModal(modalSlug)\n }\n }, [isActive, openModal, closeModal])\n\n return (\n <Modal className={baseClass} slug={modalSlug}>\n <div className={`${baseClass}__wrapper`}>\n <div className={`${baseClass}__content`}>\n <h1>{t('general:editingTakenOver')}</h1>\n <p>{t('general:anotherUserTakenOver')}</p>\n </div>\n <div className={`${baseClass}__controls`}>\n <Button\n buttonStyle=\"primary\"\n id={`${modalSlug}-back-to-dashboard`}\n onClick={handleBackToDashboard}\n size=\"large\"\n >\n {t('general:backToDashboard')}\n </Button>\n <Button\n buttonStyle=\"secondary\"\n id={`${modalSlug}-view-read-only`}\n onClick={() => {\n onReadOnly()\n closeModal(modalSlug)\n }}\n size=\"large\"\n >\n {t('general:viewReadOnly')}\n </Button>\n </div>\n </div>\n </Modal>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,cAAc,QAAQ;AACxD,OAAOC,KAAA,IAASC,SAAS,QAAQ;AAIjC,MAAMC,SAAA,GAAY;AAElB,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,gBAAA,GAIRC,EAAA;EAAA,MAAAC,CAAA,GAAAX,EAAA;EAAC;IAAAY,qBAAA;IAAAC,QAAA;IAAAC;EAAA,IAAAJ,EAA+C;EACnD;IAAAK,UAAA;IAAAC;EAAA,IAAkCb,QAAA;EAClC;IAAAc;EAAA,IAAcb,cAAA;EAAA,IAAAc,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAR,CAAA,QAAAE,QAAA,IAAAF,CAAA,QAAAK,SAAA,IAAAL,CAAA,QAAAI,UAAA;IAEJG,EAAA,GAAAA,CAAA;MAAA,IACJL,QAAA;QACFG,SAAA,CAAAT,SAAU;MAAA;QAEVQ,UAAA,CAAAR,SAAW;MAAA;IAAA;IAEZY,EAAA,IAACN,QAAA,EAAUG,SAAA,EAAWD,UAAA;IAAWJ,CAAA,MAAAE,QAAA;IAAAF,CAAA,MAAAK,SAAA;IAAAL,CAAA,MAAAI,UAAA;IAAAJ,CAAA,MAAAO,EAAA;IAAAP,CAAA,MAAAQ,EAAA;EAAA;IAAAD,EAAA,GAAAP,CAAA;IAAAQ,EAAA,GAAAR,CAAA;EA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;UAAA,C;;;;;;;;;;;;SAxBXG,E;CA8BJ","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@import '../../scss/styles.scss';
|
|
2
|
+
|
|
3
|
+
.document-take-over {
|
|
4
|
+
@include blur-bg;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
height: 100%;
|
|
9
|
+
|
|
10
|
+
&__wrapper {
|
|
11
|
+
z-index: 1;
|
|
12
|
+
position: relative;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: var(--base);
|
|
16
|
+
padding: base(2);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&__content {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: var(--base);
|
|
23
|
+
|
|
24
|
+
> * {
|
|
25
|
+
margin: 0;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&__controls {
|
|
30
|
+
display: flex;
|
|
31
|
+
gap: var(--base);
|
|
32
|
+
|
|
33
|
+
.btn {
|
|
34
|
+
margin: 0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { FieldPermissions, LoginWithUsernameOptions } from 'payload';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
type RenderEmailAndUsernameFieldsProps = {
|
|
4
4
|
className?: string;
|
|
5
|
-
loginWithUsername?:
|
|
5
|
+
loginWithUsername?: false | LoginWithUsernameOptions;
|
|
6
6
|
operation?: 'create' | 'update';
|
|
7
7
|
permissions?: {
|
|
8
8
|
[fieldName: string]: FieldPermissions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/EmailAndUsername/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAIzE,OAAO,KAAK,MAAM,OAAO,CAAA;AAqDzB,KAAK,iCAAiC,GAAG;IACvC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iBAAiB,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/EmailAndUsername/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAIzE,OAAO,KAAK,MAAM,OAAO,CAAA;AAqDzB,KAAK,iCAAiC,GAAG;IACvC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iBAAiB,CAAC,EAAE,KAAK,GAAG,wBAAwB,CAAA;IACpD,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC/B,WAAW,CAAC,EAAE;QACZ,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;KACtC,CAAA;IACD,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AACD,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,iCAAiC,qBA6CpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","EmailField","RenderFields","TextField","useTranslation","email","username","React","EmailFieldComponent","props","$","loginWithUsername","t","requireEmail","showEmailField","allowEmailLogin","t0","_jsx","autoComplete","field","name","label","required","validate","UsernameFieldComponent","requireUsername","showUsernameField","Boolean","RenderEmailAndUsernameFields","className","operation","permissions","readOnly","fields","type","admin","components","Field","Component","RenderedComponent","localized","forceRender","path","schemaPath"],"sources":["../../../src/elements/EmailAndUsername/index.tsx"],"sourcesContent":["'use client'\n\nimport type { FieldPermissions, LoginWithUsernameOptions } from 'payload'\n\nimport { EmailField, RenderFields, TextField, useTranslation } from '@payloadcms/ui'\nimport { email, username } from 'payload/shared'\nimport React from 'react'\n\ntype Props = {\n readonly loginWithUsername?:
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","EmailField","RenderFields","TextField","useTranslation","email","username","React","EmailFieldComponent","props","$","loginWithUsername","t","requireEmail","showEmailField","allowEmailLogin","t0","_jsx","autoComplete","field","name","label","required","validate","UsernameFieldComponent","requireUsername","showUsernameField","Boolean","RenderEmailAndUsernameFields","className","operation","permissions","readOnly","fields","type","admin","components","Field","Component","RenderedComponent","localized","forceRender","path","schemaPath"],"sources":["../../../src/elements/EmailAndUsername/index.tsx"],"sourcesContent":["'use client'\n\nimport type { FieldPermissions, LoginWithUsernameOptions } from 'payload'\n\nimport { EmailField, RenderFields, TextField, useTranslation } from '@payloadcms/ui'\nimport { email, username } from 'payload/shared'\nimport React from 'react'\n\ntype Props = {\n readonly loginWithUsername?: false | LoginWithUsernameOptions\n}\nfunction EmailFieldComponent(props: Props) {\n const { loginWithUsername } = props\n const { t } = useTranslation()\n\n const requireEmail = !loginWithUsername || (loginWithUsername && loginWithUsername.requireEmail)\n const showEmailField =\n !loginWithUsername || loginWithUsername?.requireEmail || loginWithUsername?.allowEmailLogin\n\n if (showEmailField) {\n return (\n <EmailField\n autoComplete=\"off\"\n field={{\n name: 'email',\n label: t('general:email'),\n required: requireEmail,\n }}\n validate={email}\n />\n )\n }\n\n return null\n}\n\nfunction UsernameFieldComponent(props: Props) {\n const { loginWithUsername } = props\n const { t } = useTranslation()\n\n const requireUsername = loginWithUsername && loginWithUsername.requireUsername\n const showUsernameField = Boolean(loginWithUsername)\n\n if (showUsernameField) {\n return (\n <TextField\n field={{\n name: 'username',\n label: t('authentication:username'),\n required: requireUsername,\n }}\n validate={username}\n />\n )\n }\n\n return null\n}\n\ntype RenderEmailAndUsernameFieldsProps = {\n className?: string\n loginWithUsername?: false | LoginWithUsernameOptions\n operation?: 'create' | 'update'\n permissions?: {\n [fieldName: string]: FieldPermissions\n }\n readOnly: boolean\n}\nexport function RenderEmailAndUsernameFields(props: RenderEmailAndUsernameFieldsProps) {\n const { className, loginWithUsername, operation, permissions, readOnly } = props\n\n return (\n <RenderFields\n className={className}\n fields={[\n {\n name: 'email',\n type: 'text',\n admin: {\n autoComplete: 'off',\n components: {\n Field: {\n type: 'client',\n Component: null,\n RenderedComponent: <EmailFieldComponent loginWithUsername={loginWithUsername} />,\n },\n },\n },\n localized: false,\n },\n {\n name: 'username',\n type: 'text',\n admin: {\n components: {\n Field: {\n type: 'client',\n Component: null,\n RenderedComponent: <UsernameFieldComponent loginWithUsername={loginWithUsername} />,\n },\n },\n },\n localized: false,\n },\n ]}\n forceRender\n operation={operation}\n path=\"\"\n permissions={permissions}\n readOnly={readOnly}\n schemaPath=\"\"\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAIA,SAASC,UAAU,EAAEC,YAAY,EAAEC,SAAS,EAAEC,cAAc,QAAQ;AACpE,SAASC,KAAK,EAAEC,QAAQ,QAAQ;AAChC,OAAOC,KAAA,MAAW;AAKlB,SAAAC,oBAAAC,KAAA;EAAA,MAAAC,CAAA,GAAAV,EAAA;EACE;IAAAW;EAAA,IAA8BF,KAAA;EAC9B;IAAAG;EAAA,IAAcR,cAAA;EAEd,MAAAS,YAAA,GAAqB,CAACF,iBAAA,IAAsBA,iBAAA,IAAqBA,iBAAA,CAAAE,YAA8B;EAC/F,MAAAC,cAAA,GACE,CAACH,iBAAA,IAAqBA,iBAAA,EAAAE,YAAmB,IAAgBF,iBAAA,EAAAI,eAAmB;EAAA,IAE1ED,cAAA;IAAA,IAAAE,EAAA;IAAA,IAAAN,CAAA,QAAAE,CAAA,IAAAF,CAAA,QAAAG,YAAA;MAEAG,EAAA,GAAAC,IAAA,CAAAhB,UAAA;QAAAiB,YAAA,EACe;QAAAC,KAAA;UAAAC,IAAA,EAEL;UAAAC,KAAA,EACCT,CAAA,CAAE;UAAAU,QAAA,EACCT;QAAA;QAAAU,QAAA,EAAAlB;MAAA,C;;;;;;;WALdW,E;;;;AAeN,SAAAQ,uBAAAf,KAAA;EAAA,MAAAC,CAAA,GAAAV,EAAA;EACE;IAAA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AK;IACLX,WAAA,EAAaA,WAAA;IACbC,QAAA,EAAUA,QAAA;IACVW,UAAA,EAAW;;AAGjB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/LeaveWithoutSaving/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiC,MAAM,OAAO,CAAA;AAErD,OAAO,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/LeaveWithoutSaving/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiC,MAAM,OAAO,CAAA;AAErD,OAAO,cAAc,CAAA;AAkDrB,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EA8BtC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","Button","Modal","useAuth","useFormModified","useModal","useTranslation","React","useCallback","useEffect","usePreventLeave","modalSlug","baseClass","Component","t0","$","isActive","onCancel","onConfirm","closeModal","openModal","t","t1","t2","t3","_jsx","className","onClose","slug","children","_jsxs","buttonStyle","onClick","size","LeaveWithoutSaving","modified","user","show","setShow","useState","hasAccepted","setHasAccepted","prevent","Boolean","Symbol","for","onPrevent","handleAccept","onAccept","t4","t5"],"sources":["../../../src/elements/LeaveWithoutSaving/index.tsx"],"sourcesContent":["'use client'\nimport { Button, Modal, useAuth, useFormModified, useModal, useTranslation } from '@payloadcms/ui'\nimport React, { useCallback, useEffect } from 'react'\n\nimport './index.scss'\nimport { usePreventLeave } from './usePreventLeave.js'\n\nconst modalSlug = 'leave-without-saving'\n\nconst baseClass = 'leave-without-saving'\n\nconst Component: React.FC<{\n isActive: boolean\n onCancel: () => void\n onConfirm: () => void\n}> = ({ isActive, onCancel, onConfirm }) => {\n const { closeModal, modalState, openModal } = useModal()\n const { t } = useTranslation()\n\n // Manually check for modal state as 'esc' key will not trigger the nav inactivity\n // useEffect(() => {\n // if (!modalState?.[modalSlug]?.isOpen && isActive) {\n // onCancel()\n // }\n // }, [modalState, isActive, onCancel])\n\n useEffect(() => {\n if (isActive) openModal(modalSlug)\n else closeModal(modalSlug)\n }, [isActive, openModal, closeModal])\n\n return (\n <Modal className={baseClass} onClose={onCancel} slug={modalSlug}>\n <div className={`${baseClass}__wrapper`}>\n <div className={`${baseClass}__content`}>\n <h1>{t('general:leaveWithoutSaving')}</h1>\n <p>{t('general:changesNotSaved')}</p>\n </div>\n <div className={`${baseClass}__controls`}>\n <Button buttonStyle=\"secondary\" onClick={onCancel} size=\"large\">\n {t('general:stayOnThisPage')}\n </Button>\n <Button onClick={onConfirm} size=\"large\">\n {t('general:leaveAnyway')}\n </Button>\n </div>\n </div>\n </Modal>\n )\n}\n\nexport const LeaveWithoutSaving: React.FC = () => {\n const { closeModal } = useModal()\n const modified = useFormModified()\n const { user } = useAuth()\n const [show, setShow] = React.useState(false)\n const [hasAccepted, setHasAccepted] = React.useState(false)\n\n const prevent = Boolean(modified && user)\n\n const onPrevent = useCallback(() => {\n setShow(true)\n }, [])\n\n const handleAccept = useCallback(() => {\n closeModal(modalSlug)\n }, [closeModal])\n\n usePreventLeave({ hasAccepted, onAccept: handleAccept, onPrevent, prevent })\n\n return (\n <Component\n isActive={show}\n onCancel={() => {\n setShow(false)\n }}\n onConfirm={() => {\n setHasAccepted(true)\n }}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEC,eAAe,EAAEC,QAAQ,EAAEC,cAAc,QAAQ;AAClF,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,QAAQ;AAG9C,SAASC,eAAe,QAAQ;AAEhC,MAAMC,SAAA,GAAY;AAElB,MAAMC,SAAA,GAAY;AAElB,MAAMC,SAAA,GAIDC,EAAA;EAAA,MAAAC,CAAA,GAAAf,EAAA;EAAC;IAAAgB,QAAA;IAAAC,QAAA;IAAAC;EAAA,IAAAJ,EAAiC;EACrC;IAAAK,UAAA;IAAAC;EAAA,IAA8Cf,QAAA;EAC9C;IAAAgB;EAAA,IAAcf,cAAA;EAAA,IAAAgB,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAR,CAAA,QAAAC,QAAA,IAAAD,CAAA,QAAAK,SAAA,IAAAL,CAAA,QAAAI,UAAA;IASJG,EAAA,GAAAA,CAAA;MAAA,IACJN,QAAA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","Button","Modal","useAuth","useFormModified","useModal","useTranslation","React","useCallback","useEffect","usePreventLeave","modalSlug","baseClass","Component","t0","$","isActive","onCancel","onConfirm","closeModal","openModal","t","t1","t2","t3","_jsx","className","onClose","slug","children","_jsxs","buttonStyle","onClick","size","LeaveWithoutSaving","modified","user","show","setShow","useState","hasAccepted","setHasAccepted","prevent","Boolean","Symbol","for","onPrevent","handleAccept","onAccept","t4","t5"],"sources":["../../../src/elements/LeaveWithoutSaving/index.tsx"],"sourcesContent":["'use client'\nimport { Button, Modal, useAuth, useFormModified, useModal, useTranslation } from '@payloadcms/ui'\nimport React, { useCallback, useEffect } from 'react'\n\nimport './index.scss'\nimport { usePreventLeave } from './usePreventLeave.js'\n\nconst modalSlug = 'leave-without-saving'\n\nconst baseClass = 'leave-without-saving'\n\nconst Component: React.FC<{\n isActive: boolean\n onCancel: () => void\n onConfirm: () => void\n}> = ({ isActive, onCancel, onConfirm }) => {\n const { closeModal, modalState, openModal } = useModal()\n const { t } = useTranslation()\n\n // Manually check for modal state as 'esc' key will not trigger the nav inactivity\n // useEffect(() => {\n // if (!modalState?.[modalSlug]?.isOpen && isActive) {\n // onCancel()\n // }\n // }, [modalState, isActive, onCancel])\n\n useEffect(() => {\n if (isActive) {\n openModal(modalSlug)\n } else {\n closeModal(modalSlug)\n }\n }, [isActive, openModal, closeModal])\n\n return (\n <Modal className={baseClass} onClose={onCancel} slug={modalSlug}>\n <div className={`${baseClass}__wrapper`}>\n <div className={`${baseClass}__content`}>\n <h1>{t('general:leaveWithoutSaving')}</h1>\n <p>{t('general:changesNotSaved')}</p>\n </div>\n <div className={`${baseClass}__controls`}>\n <Button buttonStyle=\"secondary\" onClick={onCancel} size=\"large\">\n {t('general:stayOnThisPage')}\n </Button>\n <Button onClick={onConfirm} size=\"large\">\n {t('general:leaveAnyway')}\n </Button>\n </div>\n </div>\n </Modal>\n )\n}\n\nexport const LeaveWithoutSaving: React.FC = () => {\n const { closeModal } = useModal()\n const modified = useFormModified()\n const { user } = useAuth()\n const [show, setShow] = React.useState(false)\n const [hasAccepted, setHasAccepted] = React.useState(false)\n\n const prevent = Boolean(modified && user)\n\n const onPrevent = useCallback(() => {\n setShow(true)\n }, [])\n\n const handleAccept = useCallback(() => {\n closeModal(modalSlug)\n }, [closeModal])\n\n usePreventLeave({ hasAccepted, onAccept: handleAccept, onPrevent, prevent })\n\n return (\n <Component\n isActive={show}\n onCancel={() => {\n setShow(false)\n }}\n onConfirm={() => {\n setHasAccepted(true)\n }}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEC,eAAe,EAAEC,QAAQ,EAAEC,cAAc,QAAQ;AAClF,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,QAAQ;AAG9C,SAASC,eAAe,QAAQ;AAEhC,MAAMC,SAAA,GAAY;AAElB,MAAMC,SAAA,GAAY;AAElB,MAAMC,SAAA,GAIDC,EAAA;EAAA,MAAAC,CAAA,GAAAf,EAAA;EAAC;IAAAgB,QAAA;IAAAC,QAAA;IAAAC;EAAA,IAAAJ,EAAiC;EACrC;IAAAK,UAAA;IAAAC;EAAA,IAA8Cf,QAAA;EAC9C;IAAAgB;EAAA,IAAcf,cAAA;EAAA,IAAAgB,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAR,CAAA,QAAAC,QAAA,IAAAD,CAAA,QAAAK,SAAA,IAAAL,CAAA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;IAAAA,EAAA,GAAAR,CAAA;EAAA;EAA1EL,eAAA,CAAgBa,EAA0D;EAAA,IAAAC,EAAA;EAAA,IAAAyB,EAAA;EAAA,IAAAlC,CAAA,QAAA6B,MAAA,CAAAC,GAAA;IAK5DrB,EAAA,GAAAA,CAAA;MACRc,OAAA,MAAQ;IAAA;IAECW,EAAA,GAAAA,CAAA;MACTR,cAAA,KAAe;IAAA;IACjB1B,CAAA,MAAAS,EAAA;IAAAT,CAAA,MAAAkC,EAAA;EAAA;IAAAzB,EAAA,GAAAT,CAAA;IAAAkC,EAAA,GAAAlC,CAAA;EAAA;EAAA,IAAAmC,EAAA;EAAA,IAAAnC,CAAA,QAAAsB,IAAA;IAPFa,EAAA,GAAAzB,IAAA,CAAAZ,SAAA;MAAAG,QAAA,EACYqB,IAAA;MAAApB,QAAA,EACAO,EAEV;MAAAN,SAAA,EACW+B;IAEX,C;;;;;;SAPFC,E;CAUJ","ignoreList":[]}
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
position: relative;
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
15
|
-
gap:
|
|
15
|
+
gap: base(0.8);
|
|
16
16
|
padding: base(2);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
&__content {
|
|
20
20
|
display: flex;
|
|
21
21
|
flex-direction: column;
|
|
22
|
-
gap:
|
|
22
|
+
gap: base(0.4);
|
|
23
23
|
|
|
24
24
|
> * {
|
|
25
25
|
margin: 0;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
&__controls {
|
|
30
30
|
display: flex;
|
|
31
|
-
gap:
|
|
31
|
+
gap: base(0.4);
|
|
32
32
|
|
|
33
33
|
.btn {
|
|
34
34
|
margin: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreventLeave.d.ts","sourceRoot":"","sources":["../../../src/elements/LeaveWithoutSaving/usePreventLeave.tsx"],"names":[],"mappings":"AA0BA,eAAO,MAAM,eAAe,aAAa,CAAC,MAAM,OAAO,CAAC,GAAG,OAAO,YAAmB,MAAM,SA6B1F,CAAA;AAED,eAAO,MAAM,eAAe,4DAMzB;IACD,WAAW,EAAE,OAAO,CAAA;IAEpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IAErB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;CACjB,
|
|
1
|
+
{"version":3,"file":"usePreventLeave.d.ts","sourceRoot":"","sources":["../../../src/elements/LeaveWithoutSaving/usePreventLeave.tsx"],"names":[],"mappings":"AA0BA,eAAO,MAAM,eAAe,aAAa,CAAC,MAAM,OAAO,CAAC,GAAG,OAAO,YAAmB,MAAM,SA6B1F,CAAA;AAED,eAAO,MAAM,eAAe,4DAMzB;IACD,WAAW,EAAE,OAAO,CAAA;IAEpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IAErB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;CACjB,SAkFA,CAAA"}
|
|
@@ -126,7 +126,9 @@ export const usePreventLeave = ({
|
|
|
126
126
|
}, [onPrevent, prevent, message]);
|
|
127
127
|
useEffect(() => {
|
|
128
128
|
if (hasAccepted && cancelledURL.current) {
|
|
129
|
-
if (onAccept)
|
|
129
|
+
if (onAccept) {
|
|
130
|
+
onAccept();
|
|
131
|
+
}
|
|
130
132
|
router.push(cancelledURL.current);
|
|
131
133
|
}
|
|
132
134
|
}, [hasAccepted, onAccept, router]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreventLeave.js","names":["c","_c","useRouter","useCallback","useEffect","useRef","on","obj","args","addEventListener","off","removeEventListener","useBeforeUnload","t0","message","$","enabled","undefined","t1","event","finalEnabled","preventDefault","returnValue","handler","t2","t3","window","usePreventLeave","hasAccepted","onAccept","onPrevent","prevent","router","cancelledURL","isAnchorOfCurrentUrl","currentUrl","newUrl","currentUrlObj","URL","newUrlObj","hostname","pathname","search","currentHash","hash","newHash","href","replace","findClosestAnchor","element","tagName","toLowerCase","parentElement","handleClick","target","anchor","location","isAnchor","isDownloadLink","download","isPageLeaving","confirm","current","stopPropagation","err","alert","document","push"],"sources":["../../../src/elements/LeaveWithoutSaving/usePreventLeave.tsx"],"sourcesContent":["'use client'\n// Credit: @Taiki92777\n// - Source: https://github.com/vercel/next.js/discussions/32231#discussioncomment-7284386\n// Credit: `react-use` maintainers\n// - Source: https://github.com/streamich/react-use/blob/ade8d3905f544305515d010737b4ae604cc51024/src/useBeforeUnload.ts#L2\nimport { useRouter } from 'next/navigation.js'\nimport { useCallback, useEffect, useRef } from 'react'\n\nfunction on<T extends Document | EventTarget | HTMLElement | Window>(\n obj:
|
|
1
|
+
{"version":3,"file":"usePreventLeave.js","names":["c","_c","useRouter","useCallback","useEffect","useRef","on","obj","args","addEventListener","off","removeEventListener","useBeforeUnload","t0","message","$","enabled","undefined","t1","event","finalEnabled","preventDefault","returnValue","handler","t2","t3","window","usePreventLeave","hasAccepted","onAccept","onPrevent","prevent","router","cancelledURL","isAnchorOfCurrentUrl","currentUrl","newUrl","currentUrlObj","URL","newUrlObj","hostname","pathname","search","currentHash","hash","newHash","href","replace","findClosestAnchor","element","tagName","toLowerCase","parentElement","handleClick","target","anchor","location","isAnchor","isDownloadLink","download","isPageLeaving","confirm","current","stopPropagation","err","alert","document","push"],"sources":["../../../src/elements/LeaveWithoutSaving/usePreventLeave.tsx"],"sourcesContent":["'use client'\n// Credit: @Taiki92777\n// - Source: https://github.com/vercel/next.js/discussions/32231#discussioncomment-7284386\n// Credit: `react-use` maintainers\n// - Source: https://github.com/streamich/react-use/blob/ade8d3905f544305515d010737b4ae604cc51024/src/useBeforeUnload.ts#L2\nimport { useRouter } from 'next/navigation.js'\nimport { useCallback, useEffect, useRef } from 'react'\n\nfunction on<T extends Document | EventTarget | HTMLElement | Window>(\n obj: null | T,\n ...args: [string, Function | null, ...any] | Parameters<T['addEventListener']>\n): void {\n if (obj && obj.addEventListener) {\n obj.addEventListener(...(args as Parameters<HTMLElement['addEventListener']>))\n }\n}\n\nfunction off<T extends Document | EventTarget | HTMLElement | Window>(\n obj: null | T,\n ...args: [string, Function | null, ...any] | Parameters<T['removeEventListener']>\n): void {\n if (obj && obj.removeEventListener) {\n obj.removeEventListener(...(args as Parameters<HTMLElement['removeEventListener']>))\n }\n}\n\nexport const useBeforeUnload = (enabled: (() => boolean) | boolean = true, message?: string) => {\n const handler = useCallback(\n (event: BeforeUnloadEvent) => {\n const finalEnabled = typeof enabled === 'function' ? enabled() : true\n\n if (!finalEnabled) {\n return\n }\n\n event.preventDefault()\n\n if (message) {\n event.returnValue = message\n }\n\n return message\n },\n [enabled, message],\n )\n\n useEffect(() => {\n if (!enabled) {\n return\n }\n\n on(window, 'beforeunload', handler)\n\n return () => off(window, 'beforeunload', handler)\n }, [enabled, handler])\n}\n\nexport const usePreventLeave = ({\n hasAccepted = false,\n message = 'Are you sure want to leave this page?',\n onAccept,\n onPrevent,\n prevent = true,\n}: {\n hasAccepted: boolean\n // if no `onPrevent` is provided, the message will be displayed in a confirm dialog\n message?: string\n onAccept?: () => void\n // to use a custom confirmation dialog, provide a function that returns a boolean\n onPrevent?: () => void\n prevent: boolean\n}) => {\n // check when page is about to be reloaded\n useBeforeUnload(prevent, message)\n\n const router = useRouter()\n const cancelledURL = useRef<string>('')\n\n // check when page is about to be changed\n useEffect(() => {\n function isAnchorOfCurrentUrl(currentUrl: string, newUrl: string) {\n const currentUrlObj = new URL(currentUrl)\n const newUrlObj = new URL(newUrl)\n // Compare hostname, pathname, and search parameters\n if (\n currentUrlObj.hostname === newUrlObj.hostname &&\n currentUrlObj.pathname === newUrlObj.pathname &&\n currentUrlObj.search === newUrlObj.search\n ) {\n // Check if the new URL is just an anchor of the current URL page\n const currentHash = currentUrlObj.hash\n const newHash = newUrlObj.hash\n return (\n currentHash !== newHash &&\n currentUrlObj.href.replace(currentHash, '') === newUrlObj.href.replace(newHash, '')\n )\n }\n return false\n }\n\n function findClosestAnchor(element: HTMLElement | null): HTMLAnchorElement | null {\n while (element && element.tagName.toLowerCase() !== 'a') {\n element = element.parentElement\n }\n return element as HTMLAnchorElement\n }\n function handleClick(event: MouseEvent) {\n try {\n const target = event.target as HTMLElement\n const anchor = findClosestAnchor(target)\n if (anchor) {\n const currentUrl = window.location.href\n const newUrl = anchor.href\n const isAnchor = isAnchorOfCurrentUrl(currentUrl, newUrl)\n const isDownloadLink = anchor.download !== ''\n\n const isPageLeaving = !(newUrl === currentUrl || isAnchor || isDownloadLink)\n\n if (isPageLeaving && prevent && (!onPrevent ? !window.confirm(message) : true)) {\n // Keep a reference of the href\n cancelledURL.current = newUrl\n\n // Cancel the route change\n event.preventDefault()\n event.stopPropagation()\n\n if (typeof onPrevent === 'function') {\n onPrevent()\n }\n }\n }\n } catch (err) {\n alert(err)\n }\n }\n\n // Add the global click event listener\n document.addEventListener('click', handleClick, true)\n\n // Clean up the global click event listener when the component is unmounted\n return () => {\n document.removeEventListener('click', handleClick, true)\n }\n }, [onPrevent, prevent, message])\n\n useEffect(() => {\n if (hasAccepted && cancelledURL.current) {\n if (onAccept) {\n onAccept()\n }\n router.push(cancelledURL.current)\n }\n }, [hasAccepted, onAccept, router])\n}\n"],"mappings":"AAAA;;AACA;AACA;AACA;AACA;AAAA,SAAAA,CAAA,IAAAC,EAAA;AACA,SAASC,SAAS,QAAQ;AAC1B,SAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ;AAE/C,SAASC,GACPC,GAAa,EACb,GAAGC,IAA2E;EAE9E,IAAID,GAAA,IAAOA,GAAA,CAAIE,gBAAgB,EAAE;IAC/BF,GAAA,CAAIE,gBAAgB,IAAKD,IAAA;EAC3B;AACF;AAEA,SAASE,IACPH,GAAa,EACb,GAAGC,IAA8E;EAEjF,IAAID,GAAA,IAAOA,GAAA,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MappedComponent, PayloadLogo, RenderComponent } from '@payloadcms/ui/shared';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
export const Logo = props => {
|
|
5
5
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["getCreateMappedComponent","PayloadLogo","RenderComponent","React","Logo","props","i18n","locale","params","payload","permissions","searchParams","user","admin","components","graphics","CustomLogo","undefined","config","createMappedComponent","importMap","serverProps","mappedCustomLogo","_jsx","mappedComponent"],"sources":["../../../src/elements/Logo/index.tsx"],"sourcesContent":["import type { ServerProps } from 'payload'\n\nimport { getCreateMappedComponent, PayloadLogo, RenderComponent } from '@payloadcms/ui/shared'\nimport React from 'react'\n\nexport const Logo: React.FC<ServerProps> = (props) => {\n const { i18n, locale, params, payload, permissions, searchParams, user } = props\n\n const {\n admin: {\n components: {\n graphics: { Logo: CustomLogo } = {\n Logo: undefined,\n },\n } = {},\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 mappedCustomLogo = createMappedComponent(CustomLogo, undefined, PayloadLogo, 'CustomLogo')\n\n return <RenderComponent mappedComponent={mappedCustomLogo} />\n}\n"],"mappings":";AAEA,SAASA,wBAAwB,EAAEC,WAAW,EAAEC,eAAe,QAAQ;AACvE,OAAOC,KAAA,MAAW;AAElB,OAAO,MAAMC,IAAA,GAA+BC,KAAA;EAC1C,MAAM;IAAEC,IAAI;IAAEC,MAAM;IAAEC,MAAM;IAAEC,OAAO;IAAEC,WAAW;IAAEC,YAAY;IAAEC;EAAI,CAAE,GAAGP,KAAA;EAE3E,MAAM;IACJQ,KAAA,EAAO;MACLC,UAAA,EAAY;QACVC,QAAA,EAAU;UAAEX,IAAA,EAAMY;QAAU,CAAE,GAAG;UAC/BZ,IAAA,EAAMa;QACR;MAAC,CACF,GAAG,CAAC;IAAC,CACP,GAAG,CAAC;EAAC,CACP,GAAGR,OAAA,CAAQS,MAAM;EAElB,MAAMC,qBAAA,GAAwBnB,wBAAA,CAAyB;IACrDoB,SAAA,EAAWX,OAAA,CAAQW,SAAS;IAC5BC,WAAA,EAAa;MACXf,IAAA;MACAC,MAAA;MACAC,MAAA;MACAC,OAAA;MACAC,WAAA;MACAC,YAAA;MACAC;IACF;EACF;EAEA,MAAMU,gBAAA,GAAmBH,qBAAA,CAAsBH,UAAA,EAAYC,SAAA,EAAWhB,WAAA,EAAa;EAEnF,oBAAOsB,IAAA,CAACrB,eAAA;IAAgBsB,eAAA,EAAiBF;;AAC3C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../src/elements/Nav/index.client.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../src/elements/Nav/index.client.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EA4FpC,CAAA"}
|
|
@@ -103,7 +103,7 @@ export const DefaultNavClient = () => {
|
|
|
103
103
|
}
|
|
104
104
|
const Link = LinkWithDefault.default || LinkWithDefault;
|
|
105
105
|
const LinkElement = Link || "a";
|
|
106
|
-
const activeCollection = pathname.
|
|
106
|
+
const activeCollection = pathname.startsWith(href) && ["/", undefined].includes(pathname[href.length]);
|
|
107
107
|
return _jsxs(LinkElement, {
|
|
108
108
|
className: [`${baseClass}__link`, activeCollection && `active`].filter(Boolean).join(" "),
|
|
109
109
|
href,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.js","names":["c","_c","getTranslation","NavGroup","useAuth","useConfig","useEntityVisibility","useNav","useTranslation","EntityType","formatAdminURL","groupNavItems","LinkWithDefault","usePathname","React","Fragment","baseClass","DefaultNavClient","$","permissions","isEntityVisible","pathname","config","t0","collections","globals","routes","t1","admin","adminRoute","i18n","navOpen","t2","t3","t4","slug","collectionSlug","t5","slug_0","globalSlug","groups","filter","map","_temp","_temp2","t6","key","entities","label","_jsx","children","t7","i","type","entity","entityLabel","href","id","collection","labels","plural","global","Link","default","LinkElement","activeCollection","
|
|
1
|
+
{"version":3,"file":"index.client.js","names":["c","_c","getTranslation","NavGroup","useAuth","useConfig","useEntityVisibility","useNav","useTranslation","EntityType","formatAdminURL","groupNavItems","LinkWithDefault","usePathname","React","Fragment","baseClass","DefaultNavClient","$","permissions","isEntityVisible","pathname","config","t0","collections","globals","routes","t1","admin","adminRoute","i18n","navOpen","t2","t3","t4","slug","collectionSlug","t5","slug_0","globalSlug","groups","filter","map","_temp","_temp2","t6","key","entities","label","_jsx","children","t7","i","type","entity","entityLabel","href","id","collection","labels","plural","global","Link","default","LinkElement","activeCollection","startsWith","undefined","includes","length","_jsxs","className","Boolean","join","tabIndex","entityToGroup","entityToGroup_0"],"sources":["../../../src/elements/Nav/index.client.tsx"],"sourcesContent":["'use client'\n\nimport type { EntityToGroup } from '@payloadcms/ui/shared'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n NavGroup,\n useAuth,\n useConfig,\n useEntityVisibility,\n useNav,\n useTranslation,\n} from '@payloadcms/ui'\nimport { EntityType, formatAdminURL, groupNavItems } from '@payloadcms/ui/shared'\nimport LinkWithDefault from 'next/link.js'\nimport { usePathname } from 'next/navigation.js'\nimport React, { Fragment } from 'react'\n\nconst baseClass = 'nav'\n\nexport const DefaultNavClient: React.FC = () => {\n const { permissions } = useAuth()\n const { isEntityVisible } = useEntityVisibility()\n const pathname = usePathname()\n\n const {\n config: {\n collections,\n globals,\n routes: { admin: adminRoute },\n },\n } = useConfig()\n\n const { i18n } = useTranslation()\n const { navOpen } = useNav()\n\n const groups = groupNavItems(\n [\n ...collections\n .filter(({ slug }) => isEntityVisible({ collectionSlug: slug }))\n .map((collection) => {\n const entityToGroup: EntityToGroup = {\n type: EntityType.collection,\n entity: collection,\n }\n\n return entityToGroup\n }),\n ...globals\n .filter(({ slug }) => isEntityVisible({ globalSlug: slug }))\n .map((global) => {\n const entityToGroup: EntityToGroup = {\n type: EntityType.global,\n entity: global,\n }\n\n return entityToGroup\n }),\n ],\n permissions,\n i18n,\n )\n\n return (\n <Fragment>\n {groups.map(({ entities, label }, key) => {\n return (\n <NavGroup key={key} label={label}>\n {entities.map(({ type, entity }, i) => {\n let entityLabel: string\n let href: string\n let id: string\n\n if (type === EntityType.collection) {\n href = formatAdminURL({ adminRoute, path: `/collections/${entity.slug}` })\n entityLabel = getTranslation(entity.labels.plural, i18n)\n id = `nav-${entity.slug}`\n }\n\n if (type === EntityType.global) {\n href = formatAdminURL({ adminRoute, path: `/globals/${entity.slug}` })\n entityLabel = getTranslation(entity.label, i18n)\n id = `nav-global-${entity.slug}`\n }\n\n const Link = (LinkWithDefault.default ||\n LinkWithDefault) as typeof LinkWithDefault.default\n\n const LinkElement = Link || 'a'\n const activeCollection =\n pathname.startsWith(href) && ['/', undefined].includes(pathname[href.length])\n\n return (\n <LinkElement\n className={[`${baseClass}__link`, activeCollection && `active`]\n .filter(Boolean)\n .join(' ')}\n href={href}\n id={id}\n key={i}\n tabIndex={!navOpen ? -1 : undefined}\n >\n {activeCollection && <div className={`${baseClass}__link-indicator`} />}\n <span className={`${baseClass}__link-label`}>{entityLabel}</span>\n </LinkElement>\n )\n })}\n </NavGroup>\n )\n })}\n </Fragment>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAIA,SAASC,cAAc,QAAQ;AAC/B,SACEC,QAAQ,EACRC,OAAO,EACPC,SAAS,EACTC,mBAAmB,EACnBC,MAAM,EACNC,cAAc,QACT;AACP,SAASC,UAAU,EAAEC,cAAc,EAAEC,aAAa,QAAQ;AAC1D,OAAOC,eAAA,MAAqB;AAC5B,SAASC,WAAW,QAAQ;AAC5B,OAAOC,KAAA,IAASC,QAAQ,Q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J,MAAA,EAEUI;EAAA;EACV,OAEOiB,aAAA;AAAA;AA1ByB,SAAA/B,OAAAiB,MAAA;EA+BhC,MAAAe,eAAA;IAAAvB,IAAA,EAAA5C,UAAA,CAAAoD,MAAA;IAAAP,MAAA,EAEUO;EAAA;EACV,OAEOc,eAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/Nav/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAI1C,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/Nav/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAI1C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,cAAc,CAAA;AAQrB,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAA;AAElC,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAwDzC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
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';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Logout","
|
|
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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B;kBAC5C,aAAAwB,IAAA,CAAC1B,YAAA;UAAaE,SAAA,EAAWA;;;;;AAKnC","ignoreList":[]}
|
|
@@ -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,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { metadata, RootLayout } from '../layouts/Root/index.js';
|
|
2
2
|
//# sourceMappingURL=layouts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layouts.js","names":["
|
|
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/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,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 {
|
|
4
|
+
export { generatePageMetadata, RootPage } from '../views/Root/index.js';
|
|
5
5
|
//# sourceMappingURL=views.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"views.js","names":["DefaultEditView","EditView","DefaultListView","ListView","NotFoundPage","
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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"}
|
|
@@ -31,7 +31,9 @@ export const tempFileHandler = (options, fieldname, filename) => {
|
|
|
31
31
|
complete: () => {
|
|
32
32
|
completed = true;
|
|
33
33
|
debugLog(options, `Upload ${fieldname}->${filename} completed, bytes:${fileSize}.`);
|
|
34
|
-
if (writeStream instanceof WriteStream)
|
|
34
|
+
if (writeStream instanceof WriteStream) {
|
|
35
|
+
writeStream.end();
|
|
36
|
+
}
|
|
35
37
|
// Return empty buff since data was uploaded into a temp file.
|
|
36
38
|
return Buffer.concat([]);
|
|
37
39
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.js","names":["crypto","fs","WriteStream","path","checkAndMakeDir","debugLog","deleteFile","getTempFilename","tempFileHandler","options","fieldname","filename","dir","normalize","tempFileDir","tempFilePath","join","process","cwd","createParentPath","hash","createHash","fileSize","completed","writeStream","createWriteStream","writePromise","Promise","resolve","reject","on","err","cleanup","end","complete","Buffer","concat","dataHandler","data","write","update","length","getFilePath","getFileSize","getHash","digest","getWritePromise","memHandler","buffers","getBuffer","push"],"sources":["../../src/fetchAPI-multipart/handlers.ts"],"sourcesContent":["import crypto from 'crypto'\nimport fs, { WriteStream } from 'fs'\nimport path from 'path'\n\nimport
|
|
1
|
+
{"version":3,"file":"handlers.js","names":["crypto","fs","WriteStream","path","checkAndMakeDir","debugLog","deleteFile","getTempFilename","tempFileHandler","options","fieldname","filename","dir","normalize","tempFileDir","tempFilePath","join","process","cwd","createParentPath","hash","createHash","fileSize","completed","writeStream","createWriteStream","writePromise","Promise","resolve","reject","on","err","cleanup","end","complete","Buffer","concat","dataHandler","data","write","update","length","getFilePath","getFileSize","getHash","digest","getWritePromise","memHandler","buffers","getBuffer","push"],"sources":["../../src/fetchAPI-multipart/handlers.ts"],"sourcesContent":["import type { FetchAPIFileUploadOptions } from 'payload'\n\nimport crypto from 'crypto'\nimport fs, { WriteStream } from 'fs'\nimport path from 'path'\n\nimport { checkAndMakeDir, debugLog, deleteFile, getTempFilename } from './utilities.js'\n\ntype Handler = (\n options: FetchAPIFileUploadOptions,\n fieldname: string,\n filename: string,\n) => {\n cleanup: () => void\n complete: () => Buffer\n dataHandler: (data: Buffer) => void\n getFilePath: () => string\n getFileSize: () => number\n getHash: () => string\n getWritePromise: () => Promise<boolean>\n}\n\nexport const tempFileHandler: Handler = (options, fieldname, filename) => {\n const dir = path.normalize(options.tempFileDir)\n const tempFilePath = path.join(process.cwd(), dir, getTempFilename())\n checkAndMakeDir({ createParentPath: true }, tempFilePath)\n\n debugLog(options, `Temporary file path is ${tempFilePath}`)\n\n const hash = crypto.createHash('md5')\n let fileSize = 0\n let completed = false\n\n debugLog(options, `Opening write stream for ${fieldname}->${filename}...`)\n const writeStream = fs.createWriteStream(tempFilePath)\n const writePromise = new Promise<boolean>((resolve, reject) => {\n writeStream.on('finish', () => resolve(true))\n writeStream.on('error', (err) => {\n debugLog(options, `Error write temp file: ${err}`)\n reject(err)\n })\n })\n\n return {\n cleanup: () => {\n completed = true\n debugLog(options, `Cleaning up temporary file ${tempFilePath}...`)\n writeStream.end()\n deleteFile(tempFilePath, (err) =>\n err\n ? debugLog(options, `Cleaning up temporary file ${tempFilePath} failed: ${err}`)\n : debugLog(options, `Cleaning up temporary file ${tempFilePath} done.`),\n )\n },\n complete: () => {\n completed = true\n debugLog(options, `Upload ${fieldname}->${filename} completed, bytes:${fileSize}.`)\n if (writeStream instanceof WriteStream) {\n writeStream.end()\n }\n // Return empty buff since data was uploaded into a temp file.\n return Buffer.concat([])\n },\n dataHandler: (data) => {\n if (completed === true) {\n debugLog(options, `Error: got ${fieldname}->${filename} data chunk for completed upload!`)\n return\n }\n writeStream.write(data)\n hash.update(data)\n fileSize += data.length\n debugLog(options, `Uploading ${fieldname}->${filename}, bytes:${fileSize}...`)\n },\n getFilePath: () => tempFilePath,\n getFileSize: () => fileSize,\n getHash: () => hash.digest('hex'),\n getWritePromise: () => writePromise,\n }\n}\n\nexport const memHandler: Handler = (options, fieldname, filename) => {\n const buffers: Buffer[] = []\n const hash = crypto.createHash('md5')\n let fileSize = 0\n let completed = false\n\n const getBuffer = () => Buffer.concat(buffers, fileSize)\n\n return {\n cleanup: () => {\n completed = true\n },\n complete: () => {\n debugLog(options, `Upload ${fieldname}->${filename} completed, bytes:${fileSize}.`)\n completed = true\n return getBuffer()\n },\n dataHandler: (data) => {\n if (completed === true) {\n debugLog(options, `Error: got ${fieldname}->${filename} data chunk for completed upload!`)\n return\n }\n buffers.push(data)\n hash.update(data)\n fileSize += data.length\n debugLog(options, `Uploading ${fieldname}->${filename}, bytes:${fileSize}...`)\n },\n getFilePath: () => '',\n getFileSize: () => fileSize,\n getHash: () => hash.digest('hex'),\n getWritePromise: () => Promise.resolve(true),\n }\n}\n"],"mappings":"AAEA,OAAOA,MAAA,MAAY;AACnB,OAAOC,EAAA,IAAMC,WAAW,QAAQ;AAChC,OAAOC,IAAA,MAAU;AAEjB,SAASC,eAAe,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,eAAe,QAAQ;AAgBvE,OAAO,MAAMC,eAAA,GAA2BA,CAACC,OAAA,EAASC,SAAA,EAAWC,QAAA;EAC3D,MAAMC,GAAA,GAAMT,IAAA,CAAKU,SAAS,CAACJ,OAAA,CAAQK,WAAW;EAC9C,MAAMC,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