@payloadcms/next 3.68.0-internal-debug.dafc24d → 3.68.0-internal-debug.591ab42
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/auth/login.js +52 -58
- package/dist/auth/login.js.map +1 -1
- package/dist/auth/logout.js +39 -44
- package/dist/auth/logout.js.map +1 -1
- package/dist/auth/refresh.js +45 -47
- package/dist/auth/refresh.js.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js +9 -15
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js +40 -71
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js +65 -59
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.js +80 -70
- package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js +16 -23
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js +61 -69
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js.map +1 -1
- package/dist/elements/DocumentHeader/index.js +48 -28
- package/dist/elements/DocumentHeader/index.js.map +1 -1
- package/dist/elements/FormHeader/index.js +30 -16
- package/dist/elements/FormHeader/index.js.map +1 -1
- package/dist/elements/Logo/index.js +19 -34
- package/dist/elements/Logo/index.js.map +1 -1
- package/dist/elements/Nav/NavHamburger/index.js +23 -44
- package/dist/elements/Nav/NavHamburger/index.js.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.js +28 -54
- package/dist/elements/Nav/NavWrapper/index.js.map +1 -1
- package/dist/elements/Nav/SettingsMenuButton/index.js +33 -39
- package/dist/elements/Nav/SettingsMenuButton/index.js.map +1 -1
- package/dist/elements/Nav/getNavPrefs.js +27 -22
- package/dist/elements/Nav/getNavPrefs.js.map +1 -1
- package/dist/elements/Nav/index.client.js +97 -118
- package/dist/elements/Nav/index.client.js.map +1 -1
- package/dist/elements/Nav/index.js +148 -127
- package/dist/elements/Nav/index.js.map +1 -1
- package/dist/esbuildEntry.d.ts +5 -0
- package/dist/esbuildEntry.d.ts.map +1 -0
- package/dist/esbuildEntry.js +6 -0
- package/dist/esbuildEntry.js.map +1 -0
- package/dist/exports/auth.js +1 -0
- package/dist/exports/auth.js.map +1 -1
- package/dist/exports/client.js +1 -1
- package/dist/exports/client.js.map +1 -1
- package/dist/exports/layouts.js +1 -0
- package/dist/exports/layouts.js.map +1 -1
- package/dist/exports/routes.js +1 -0
- package/dist/exports/routes.js.map +1 -1
- package/dist/exports/rsc.js +1 -0
- package/dist/exports/rsc.js.map +1 -1
- package/dist/exports/templates.js +1 -0
- package/dist/exports/templates.js.map +1 -1
- package/dist/exports/utilities.js +7 -12
- package/dist/exports/utilities.js.map +1 -1
- package/dist/exports/views.js +1 -0
- package/dist/exports/views.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/layouts/Root/NestProviders.js +21 -20
- package/dist/layouts/Root/NestProviders.js.map +1 -1
- package/dist/layouts/Root/checkDependencies.js +49 -41
- package/dist/layouts/Root/checkDependencies.js.map +1 -1
- package/dist/layouts/Root/index.js +128 -103
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/routes/graphql/handler.js +114 -122
- package/dist/routes/graphql/handler.js.map +1 -1
- package/dist/routes/graphql/index.js +1 -0
- package/dist/routes/graphql/index.js.map +1 -1
- package/dist/routes/graphql/playground.js +24 -23
- package/dist/routes/graphql/playground.js.map +1 -1
- package/dist/routes/index.js +1 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/rest/index.js +20 -19
- package/dist/routes/rest/index.js.map +1 -1
- package/dist/routes/rest/og/image.js +103 -79
- package/dist/routes/rest/og/image.js.map +1 -1
- package/dist/routes/rest/og/index.js +59 -54
- package/dist/routes/rest/og/index.js.map +1 -1
- package/dist/templates/Default/NavHamburger/index.js +12 -20
- package/dist/templates/Default/NavHamburger/index.js.map +1 -1
- package/dist/templates/Default/Wrapper/index.js +20 -44
- package/dist/templates/Default/Wrapper/index.js.map +1 -1
- package/dist/templates/Default/index.js +183 -133
- package/dist/templates/Default/index.js.map +1 -1
- package/dist/templates/Minimal/index.js +26 -17
- package/dist/templates/Minimal/index.js.map +1 -1
- package/dist/utilities/getExistingAuthToken.js +3 -2
- package/dist/utilities/getExistingAuthToken.js.map +1 -1
- package/dist/utilities/getNextRequestI18n.js +12 -13
- package/dist/utilities/getNextRequestI18n.js.map +1 -1
- package/dist/utilities/getPayloadHMR.js +5 -5
- package/dist/utilities/getPayloadHMR.js.map +1 -1
- package/dist/utilities/getPreferences.js +27 -22
- package/dist/utilities/getPreferences.js.map +1 -1
- package/dist/utilities/getRequestLocale.js +13 -14
- package/dist/utilities/getRequestLocale.js.map +1 -1
- package/dist/utilities/getRequestTheme.js +19 -19
- package/dist/utilities/getRequestTheme.js.map +1 -1
- package/dist/utilities/getRouteWithoutAdmin.js +3 -5
- package/dist/utilities/getRouteWithoutAdmin.js.map +1 -1
- package/dist/utilities/getVisibleEntities.js +12 -23
- package/dist/utilities/getVisibleEntities.js.map +1 -1
- package/dist/utilities/handleAuthRedirect.js +22 -36
- package/dist/utilities/handleAuthRedirect.js.map +1 -1
- package/dist/utilities/handleServerFunctions.js +32 -39
- package/dist/utilities/handleServerFunctions.js.map +1 -1
- package/dist/utilities/initReq.js +78 -96
- package/dist/utilities/initReq.js.map +1 -1
- package/dist/utilities/isCustomAdminView.js +22 -26
- package/dist/utilities/isCustomAdminView.js.map +1 -1
- package/dist/utilities/isPublicAdminRoute.js +26 -20
- package/dist/utilities/isPublicAdminRoute.js.map +1 -1
- package/dist/utilities/meta.js +68 -63
- package/dist/utilities/meta.js.map +1 -1
- package/dist/utilities/selectiveCache.js +25 -26
- package/dist/utilities/selectiveCache.js.map +1 -1
- package/dist/utilities/setPayloadAuthCookie.js +19 -22
- package/dist/utilities/setPayloadAuthCookie.js.map +1 -1
- package/dist/utilities/slugify.js +24 -33
- package/dist/utilities/slugify.js.map +1 -1
- package/dist/utilities/timestamp.js +7 -6
- package/dist/utilities/timestamp.js.map +1 -1
- package/dist/views/API/LocaleSelector/index.js +17 -39
- package/dist/views/API/LocaleSelector/index.js.map +1 -1
- package/dist/views/API/RenderJSON/index.js +171 -126
- package/dist/views/API/RenderJSON/index.js.map +1 -1
- package/dist/views/API/index.client.js +287 -197
- package/dist/views/API/index.client.js.map +1 -1
- package/dist/views/API/index.js +7 -2
- package/dist/views/API/index.js.map +1 -1
- package/dist/views/API/metadata.js +18 -23
- package/dist/views/API/metadata.js.map +1 -1
- package/dist/views/Account/ResetPreferences/index.js +74 -91
- package/dist/views/Account/ResetPreferences/index.js.map +1 -1
- package/dist/views/Account/Settings/LanguageSelector.js +18 -47
- package/dist/views/Account/Settings/LanguageSelector.js.map +1 -1
- package/dist/views/Account/Settings/index.js +62 -28
- package/dist/views/Account/Settings/index.js.map +1 -1
- package/dist/views/Account/ToggleTheme/index.js +38 -55
- package/dist/views/Account/ToggleTheme/index.js.map +1 -1
- package/dist/views/Account/index.client.js +16 -32
- package/dist/views/Account/index.client.js.map +1 -1
- package/dist/views/Account/index.js +144 -155
- package/dist/views/Account/index.js.map +1 -1
- package/dist/views/Account/metadata.js +8 -12
- package/dist/views/Account/metadata.js.map +1 -1
- package/dist/views/BrowseByFolder/buildView.js +139 -158
- package/dist/views/BrowseByFolder/buildView.js.map +1 -1
- package/dist/views/BrowseByFolder/index.js +16 -17
- package/dist/views/BrowseByFolder/index.js.map +1 -1
- package/dist/views/BrowseByFolder/metadata.js +13 -15
- package/dist/views/BrowseByFolder/metadata.js.map +1 -1
- package/dist/views/CollectionFolders/buildView.js +123 -143
- package/dist/views/CollectionFolders/buildView.js.map +1 -1
- package/dist/views/CollectionFolders/index.js +16 -17
- package/dist/views/CollectionFolders/index.js.map +1 -1
- package/dist/views/CollectionFolders/metadata.js +18 -21
- package/dist/views/CollectionFolders/metadata.js.map +1 -1
- package/dist/views/CollectionFolders/renderFolderViewSlots.js +58 -61
- package/dist/views/CollectionFolders/renderFolderViewSlots.js.map +1 -1
- package/dist/views/CollectionTrash/index.js +17 -18
- package/dist/views/CollectionTrash/index.js.map +1 -1
- package/dist/views/CollectionTrash/metadata.js +18 -21
- package/dist/views/CollectionTrash/metadata.js.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +114 -101
- package/dist/views/CreateFirstUser/index.client.js.map +1 -1
- package/dist/views/CreateFirstUser/index.js +87 -81
- package/dist/views/CreateFirstUser/index.js.map +1 -1
- package/dist/views/CreateFirstUser/metadata.js +8 -12
- package/dist/views/CreateFirstUser/metadata.js.map +1 -1
- package/dist/views/Dashboard/Default/index.js +176 -152
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- package/dist/views/Dashboard/index.js +97 -90
- package/dist/views/Dashboard/index.js.map +1 -1
- package/dist/views/Dashboard/metadata.js +10 -14
- package/dist/views/Dashboard/metadata.js.map +1 -1
- package/dist/views/Document/getCustomDocumentViewByKey.js +3 -2
- package/dist/views/Document/getCustomDocumentViewByKey.js.map +1 -1
- package/dist/views/Document/getCustomViewByRoute.js +27 -30
- package/dist/views/Document/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Document/getDocPreferences.js +40 -41
- package/dist/views/Document/getDocPreferences.js.map +1 -1
- package/dist/views/Document/getDocumentData.js +44 -55
- package/dist/views/Document/getDocumentData.js.map +1 -1
- package/dist/views/Document/getDocumentPermissions.js +77 -80
- package/dist/views/Document/getDocumentPermissions.js.map +1 -1
- package/dist/views/Document/getDocumentView.js +313 -283
- package/dist/views/Document/getDocumentView.js.map +1 -1
- package/dist/views/Document/getIsLocked.js +66 -66
- package/dist/views/Document/getIsLocked.js.map +1 -1
- package/dist/views/Document/getMetaBySegment.js +130 -136
- package/dist/views/Document/getMetaBySegment.js.map +1 -1
- package/dist/views/Document/getVersions.js +204 -194
- package/dist/views/Document/getVersions.js.map +1 -1
- package/dist/views/Document/handleServerFunction.js +103 -128
- package/dist/views/Document/handleServerFunction.js.map +1 -1
- package/dist/views/Document/index.js +315 -354
- package/dist/views/Document/index.js.map +1 -1
- package/dist/views/Document/metadata.js +2 -1
- package/dist/views/Document/metadata.js.map +1 -1
- package/dist/views/Document/renderDocumentSlots.js +121 -132
- package/dist/views/Document/renderDocumentSlots.js.map +1 -1
- package/dist/views/Edit/index.js +10 -6
- package/dist/views/Edit/index.js.map +1 -1
- package/dist/views/Edit/metadata.js +36 -46
- package/dist/views/Edit/metadata.js.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +130 -164
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
- package/dist/views/ForgotPassword/index.js +79 -62
- package/dist/views/ForgotPassword/index.js.map +1 -1
- package/dist/views/ForgotPassword/metadata.js +8 -12
- package/dist/views/ForgotPassword/metadata.js.map +1 -1
- package/dist/views/List/createSerializableValue.js +12 -11
- package/dist/views/List/createSerializableValue.js.map +1 -1
- package/dist/views/List/enrichDocsWithVersionStatus.js +86 -86
- package/dist/views/List/enrichDocsWithVersionStatus.js.map +1 -1
- package/dist/views/List/extractRelationshipDisplayValue.js +15 -14
- package/dist/views/List/extractRelationshipDisplayValue.js.map +1 -1
- package/dist/views/List/extractValueOrRelationshipID.js +16 -15
- package/dist/views/List/extractValueOrRelationshipID.js.map +1 -1
- package/dist/views/List/handleGroupBy.js +133 -150
- package/dist/views/List/handleGroupBy.js.map +1 -1
- package/dist/views/List/handleServerFunction.js +96 -119
- package/dist/views/List/handleServerFunction.js.map +1 -1
- package/dist/views/List/index.js +305 -324
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/List/metadata.js +17 -20
- package/dist/views/List/metadata.js.map +1 -1
- package/dist/views/List/renderListViewSlots.js +82 -75
- package/dist/views/List/renderListViewSlots.js.map +1 -1
- package/dist/views/List/resolveAllFilterOptions.js +43 -45
- package/dist/views/List/resolveAllFilterOptions.js.map +1 -1
- package/dist/views/List/transformColumnsToSelect.js +9 -8
- package/dist/views/List/transformColumnsToSelect.js.map +1 -1
- package/dist/views/Login/LoginField/index.js +57 -89
- package/dist/views/Login/LoginField/index.js.map +1 -1
- package/dist/views/Login/LoginForm/index.js +104 -157
- package/dist/views/Login/LoginForm/index.js.map +1 -1
- package/dist/views/Login/index.js +82 -85
- package/dist/views/Login/index.js.map +1 -1
- package/dist/views/Login/metadata.js +8 -12
- package/dist/views/Login/metadata.js.map +1 -1
- package/dist/views/Logout/LogoutClient.js +83 -119
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/Logout/index.js +29 -29
- package/dist/views/Logout/index.js.map +1 -1
- package/dist/views/Logout/metadata.js +7 -11
- package/dist/views/Logout/metadata.js.map +1 -1
- package/dist/views/NotFound/index.client.js +71 -82
- package/dist/views/NotFound/index.client.js.map +1 -1
- package/dist/views/NotFound/index.js +71 -72
- package/dist/views/NotFound/index.js.map +1 -1
- package/dist/views/NotFound/metadata.js +7 -9
- package/dist/views/NotFound/metadata.js.map +1 -1
- package/dist/views/ResetPassword/ResetPasswordForm/index.js +94 -107
- package/dist/views/ResetPassword/ResetPasswordForm/index.js.map +1 -1
- package/dist/views/ResetPassword/index.js +93 -73
- package/dist/views/ResetPassword/index.js.map +1 -1
- package/dist/views/ResetPassword/metadata.js +8 -12
- package/dist/views/ResetPassword/metadata.js.map +1 -1
- package/dist/views/Root/attachViewActions.js +18 -23
- package/dist/views/Root/attachViewActions.js.map +1 -1
- package/dist/views/Root/generateCustomViewMetadata.js +19 -21
- package/dist/views/Root/generateCustomViewMetadata.js.map +1 -1
- package/dist/views/Root/getCustomViewByKey.js +12 -14
- package/dist/views/Root/getCustomViewByKey.js.map +1 -1
- package/dist/views/Root/getCustomViewByRoute.js +31 -42
- package/dist/views/Root/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Root/getDocumentViewInfo.js +24 -23
- package/dist/views/Root/getDocumentViewInfo.js.map +1 -1
- package/dist/views/Root/getRouteData.js +333 -325
- package/dist/views/Root/getRouteData.js.map +1 -1
- package/dist/views/Root/index.js +247 -269
- package/dist/views/Root/index.js.map +1 -1
- package/dist/views/Root/isPathMatchingRoute.js +21 -26
- package/dist/views/Root/isPathMatchingRoute.js.map +1 -1
- package/dist/views/Root/metadata.js +176 -181
- package/dist/views/Root/metadata.js.map +1 -1
- package/dist/views/Unauthorized/index.js +54 -46
- package/dist/views/Unauthorized/index.js.map +1 -1
- package/dist/views/Unauthorized/metadata.js +8 -12
- package/dist/views/Unauthorized/metadata.js.map +1 -1
- package/dist/views/Verify/index.client.js +25 -43
- package/dist/views/Verify/index.client.js.map +1 -1
- package/dist/views/Verify/index.js +68 -62
- package/dist/views/Verify/index.js.map +1 -1
- package/dist/views/Verify/metadata.js +8 -12
- package/dist/views/Verify/metadata.js.map +1 -1
- package/dist/views/Version/Default/SelectedLocalesContext.js +4 -4
- package/dist/views/Version/Default/SelectedLocalesContext.js.map +1 -1
- package/dist/views/Version/Default/SetStepNav.js +86 -127
- package/dist/views/Version/Default/SetStepNav.js.map +1 -1
- package/dist/views/Version/Default/index.js +380 -236
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/Default/types.js +2 -1
- package/dist/views/Version/Default/types.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js +102 -119
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js +78 -73
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js +363 -408
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js +40 -51
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Date/index.js +35 -67
- package/dist/views/Version/RenderFieldsToDiff/fields/Date/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js +59 -56
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +139 -117
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.js +36 -41
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +192 -178
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js +17 -11
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +48 -73
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +132 -143
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +56 -81
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.js +251 -210
- package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js +23 -22
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.js +12 -9
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js +213 -228
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js +1005 -826
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.js +2 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js +44 -43
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldPathsModified.js +25 -22
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldPathsModified.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js +32 -36
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js +145 -129
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js.map +1 -1
- package/dist/views/Version/Restore/index.js +116 -91
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/VersionDrawer/CreatedAtCell.js +33 -50
- package/dist/views/Version/SelectComparison/VersionDrawer/CreatedAtCell.js.map +1 -1
- package/dist/views/Version/SelectComparison/VersionDrawer/index.js +170 -226
- package/dist/views/Version/SelectComparison/VersionDrawer/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/index.js +73 -50
- package/dist/views/Version/SelectComparison/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/types.js +2 -1
- package/dist/views/Version/SelectComparison/types.js.map +1 -1
- package/dist/views/Version/SelectLocales/index.js +34 -32
- package/dist/views/Version/SelectLocales/index.js.map +1 -1
- package/dist/views/Version/VersionPillLabel/VersionPillLabel.js +104 -95
- package/dist/views/Version/VersionPillLabel/VersionPillLabel.js.map +1 -1
- package/dist/views/Version/VersionPillLabel/getVersionLabel.js +23 -27
- package/dist/views/Version/VersionPillLabel/getVersionLabel.js.map +1 -1
- package/dist/views/Version/fetchVersions.js +113 -138
- package/dist/views/Version/fetchVersions.js.map +1 -1
- package/dist/views/Version/index.js +325 -323
- package/dist/views/Version/index.js.map +1 -1
- package/dist/views/Version/metadata.js +43 -50
- package/dist/views/Version/metadata.js.map +1 -1
- package/dist/views/Versions/buildColumns.js +95 -79
- package/dist/views/Versions/buildColumns.js.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.js +34 -38
- package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.js +32 -53
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
- package/dist/views/Versions/cells/ID/index.js +10 -8
- package/dist/views/Versions/cells/ID/index.js.map +1 -1
- package/dist/views/Versions/index.client.js +106 -83
- package/dist/views/Versions/index.client.js.map +1 -1
- package/dist/views/Versions/index.js +140 -140
- package/dist/views/Versions/index.js.map +1 -1
- package/dist/views/Versions/metadata.js +37 -44
- package/dist/views/Versions/metadata.js.map +1 -1
- package/dist/views/Versions/types.js +2 -1
- package/dist/views/Versions/types.js.map +1 -1
- package/dist/withPayload.js +216 -169
- package/dist/withPayload.js.map +1 -1
- package/package.json +8 -7
- package/dist/prod/styles.css +0 -1
package/dist/auth/login.js
CHANGED
|
@@ -1,67 +1,61 @@
|
|
|
1
1
|
'use server';
|
|
2
|
-
|
|
3
2
|
import { getPayload } from 'payload';
|
|
4
3
|
import { setPayloadAuthCookie } from '../utilities/setPayloadAuthCookie.js';
|
|
5
|
-
export async function login({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
4
|
+
export async function login({ collection, config, email, password, username }) {
|
|
5
|
+
const payload = await getPayload({
|
|
6
|
+
config,
|
|
7
|
+
cron: true
|
|
8
|
+
});
|
|
9
|
+
const authConfig = payload.collections[collection]?.config.auth;
|
|
10
|
+
if (!authConfig) {
|
|
11
|
+
throw new Error(`No auth config found for collection: ${collection}`);
|
|
12
|
+
}
|
|
13
|
+
const loginWithUsername = authConfig?.loginWithUsername ?? false;
|
|
14
|
+
if (loginWithUsername) {
|
|
15
|
+
if (loginWithUsername.allowEmailLogin) {
|
|
16
|
+
if (!email && !username) {
|
|
17
|
+
throw new Error('Email or username is required.');
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
if (!username) {
|
|
21
|
+
throw new Error('Username is required.');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
26
24
|
} else {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
if (!email) {
|
|
26
|
+
throw new Error('Email is required.');
|
|
27
|
+
}
|
|
30
28
|
}
|
|
31
|
-
|
|
32
|
-
if (
|
|
33
|
-
|
|
29
|
+
let loginData;
|
|
30
|
+
if (loginWithUsername) {
|
|
31
|
+
loginData = username ? {
|
|
32
|
+
password,
|
|
33
|
+
username
|
|
34
|
+
} : {
|
|
35
|
+
email,
|
|
36
|
+
password
|
|
37
|
+
};
|
|
38
|
+
} else {
|
|
39
|
+
loginData = {
|
|
40
|
+
email,
|
|
41
|
+
password
|
|
42
|
+
};
|
|
34
43
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
loginData = username ? {
|
|
39
|
-
password,
|
|
40
|
-
username
|
|
41
|
-
} : {
|
|
42
|
-
email,
|
|
43
|
-
password
|
|
44
|
-
};
|
|
45
|
-
} else {
|
|
46
|
-
loginData = {
|
|
47
|
-
email,
|
|
48
|
-
password
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
const result = await payload.login({
|
|
52
|
-
collection,
|
|
53
|
-
data: loginData
|
|
54
|
-
});
|
|
55
|
-
if (result.token) {
|
|
56
|
-
await setPayloadAuthCookie({
|
|
57
|
-
authConfig,
|
|
58
|
-
cookiePrefix: payload.config.cookiePrefix,
|
|
59
|
-
token: result.token
|
|
44
|
+
const result = await payload.login({
|
|
45
|
+
collection,
|
|
46
|
+
data: loginData
|
|
60
47
|
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
48
|
+
if (result.token) {
|
|
49
|
+
await setPayloadAuthCookie({
|
|
50
|
+
authConfig,
|
|
51
|
+
cookiePrefix: payload.config.cookiePrefix,
|
|
52
|
+
token: result.token
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if ('removeTokenFromResponses' in config && config.removeTokenFromResponses) {
|
|
56
|
+
delete result.token;
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
66
59
|
}
|
|
60
|
+
|
|
67
61
|
//# sourceMappingURL=login.js.map
|
package/dist/auth/login.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/auth/login.ts"],"sourcesContent":["'use server'\n\nimport type { CollectionSlug } from 'payload'\n\nimport { getPayload } from 'payload'\n\nimport { setPayloadAuthCookie } from '../utilities/setPayloadAuthCookie.js'\n\ntype LoginWithEmail = {\n collection: CollectionSlug\n config: any\n email: string\n password: string\n username?: never\n}\n\ntype LoginWithUsername = {\n collection: CollectionSlug\n config: any\n email?: never\n password: string\n username: string\n}\ntype LoginArgs = LoginWithEmail | LoginWithUsername\n\nexport async function login({ collection, config, email, password, username }: LoginArgs): Promise<{\n token?: string\n user: any\n}> {\n const payload = await getPayload({ config, cron: true })\n\n const authConfig = payload.collections[collection]?.config.auth\n\n if (!authConfig) {\n throw new Error(`No auth config found for collection: ${collection}`)\n }\n\n const loginWithUsername = authConfig?.loginWithUsername ?? false\n\n if (loginWithUsername) {\n if (loginWithUsername.allowEmailLogin) {\n if (!email && !username) {\n throw new Error('Email or username is required.')\n }\n } else {\n if (!username) {\n throw new Error('Username is required.')\n }\n }\n } else {\n if (!email) {\n throw new Error('Email is required.')\n }\n }\n\n let loginData\n\n if (loginWithUsername) {\n loginData = username ? { password, username } : { email, password }\n } else {\n loginData = { email, password }\n }\n\n const result = await payload.login({\n collection,\n data: loginData,\n })\n\n if (result.token) {\n await setPayloadAuthCookie({\n authConfig,\n cookiePrefix: payload.config.cookiePrefix,\n token: result.token,\n })\n }\n\n if ('removeTokenFromResponses' in config && config.removeTokenFromResponses) {\n delete result.token\n }\n\n return result\n}\n"],"names":["getPayload","setPayloadAuthCookie","login","collection","config","email","password","username","payload","cron","authConfig","collections","auth","Error","loginWithUsername","allowEmailLogin","loginData","result","data","token","cookiePrefix","removeTokenFromResponses"],"mappings":"AAAA;AAIA,SAASA,UAAU,QAAQ,UAAS;AAEpC,SAASC,oBAAoB,QAAQ,uCAAsC;AAmB3E,OAAO,eAAeC,MAAM,EAAEC,UAAU,EAAEC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,QAAQ,EAAa;IAItF,MAAMC,UAAU,MAAMR,WAAW;QAAEI;QAAQK,MAAM;IAAK;IAEtD,MAAMC,aAAaF,QAAQG,WAAW,CAACR,WAAW,EAAEC,OAAOQ;IAE3D,IAAI,CAACF,YAAY;QACf,MAAM,IAAIG,MAAM,CAAC,qCAAqC,EAAEV,YAAY;IACtE;IAEA,MAAMW,oBAAoBJ,YAAYI,qBAAqB;IAE3D,IAAIA,mBAAmB;QACrB,IAAIA,kBAAkBC,eAAe,EAAE;YACrC,IAAI,CAACV,SAAS,CAACE,UAAU;gBACvB,MAAM,IAAIM,MAAM;YAClB;QACF,OAAO;YACL,IAAI,CAACN,UAAU;gBACb,MAAM,IAAIM,MAAM;YAClB;QACF;IACF,OAAO;QACL,IAAI,CAACR,OAAO;YACV,MAAM,IAAIQ,MAAM;QAClB;IACF;IAEA,IAAIG;IAEJ,IAAIF,mBAAmB;QACrBE,YAAYT,WAAW;YAAED;YAAUC;QAAS,IAAI;YAAEF;YAAOC;QAAS;IACpE,OAAO;QACLU,YAAY;YAAEX;YAAOC;QAAS;IAChC;IAEA,MAAMW,SAAS,MAAMT,QAAQN,KAAK,CAAC;QACjCC;QACAe,MAAMF;IACR;IAEA,IAAIC,OAAOE,KAAK,EAAE;QAChB,MAAMlB,qBAAqB;YACzBS;YACAU,cAAcZ,QAAQJ,MAAM,CAACgB,YAAY;YACzCD,OAAOF,OAAOE,KAAK;QACrB;IACF;IAEA,IAAI,8BAA8Bf,UAAUA,OAAOiB,wBAAwB,EAAE;QAC3E,OAAOJ,OAAOE,KAAK;IACrB;IAEA,OAAOF;AACT"}
|
package/dist/auth/logout.js
CHANGED
|
@@ -1,52 +1,47 @@
|
|
|
1
1
|
'use server';
|
|
2
|
-
|
|
3
2
|
import { cookies as getCookies, headers as nextHeaders } from 'next/headers.js';
|
|
4
3
|
import { createLocalReq, getPayload, logoutOperation } from 'payload';
|
|
5
4
|
import { getExistingAuthToken } from '../utilities/getExistingAuthToken.js';
|
|
6
|
-
export async function logout({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
user
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
5
|
+
export async function logout({ allSessions = false, config }) {
|
|
6
|
+
const payload = await getPayload({
|
|
7
|
+
config,
|
|
8
|
+
cron: true
|
|
9
|
+
});
|
|
10
|
+
const headers = await nextHeaders();
|
|
11
|
+
const authResult = await payload.auth({
|
|
12
|
+
headers
|
|
13
|
+
});
|
|
14
|
+
if (!authResult.user) {
|
|
15
|
+
return {
|
|
16
|
+
message: 'User already logged out',
|
|
17
|
+
success: true
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const { user } = authResult;
|
|
21
|
+
const req = await createLocalReq({
|
|
22
|
+
user
|
|
23
|
+
}, payload);
|
|
24
|
+
const collection = payload.collections[user.collection];
|
|
25
|
+
const logoutResult = await logoutOperation({
|
|
26
|
+
allSessions,
|
|
27
|
+
collection,
|
|
28
|
+
req
|
|
29
|
+
});
|
|
30
|
+
if (!logoutResult) {
|
|
31
|
+
return {
|
|
32
|
+
message: 'Logout failed',
|
|
33
|
+
success: false
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const existingCookie = await getExistingAuthToken(payload.config.cookiePrefix);
|
|
37
|
+
if (existingCookie) {
|
|
38
|
+
const cookies = await getCookies();
|
|
39
|
+
cookies.delete(existingCookie.name);
|
|
40
|
+
}
|
|
37
41
|
return {
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
message: 'User logged out successfully',
|
|
43
|
+
success: true
|
|
40
44
|
};
|
|
41
|
-
}
|
|
42
|
-
const existingCookie = await getExistingAuthToken(payload.config.cookiePrefix);
|
|
43
|
-
if (existingCookie) {
|
|
44
|
-
const cookies = await getCookies();
|
|
45
|
-
cookies.delete(existingCookie.name);
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
message: 'User logged out successfully',
|
|
49
|
-
success: true
|
|
50
|
-
};
|
|
51
45
|
}
|
|
46
|
+
|
|
52
47
|
//# sourceMappingURL=logout.js.map
|
package/dist/auth/logout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/auth/logout.ts"],"sourcesContent":["'use server'\n\nimport type { SanitizedConfig } from 'payload'\n\nimport { cookies as getCookies, headers as nextHeaders } from 'next/headers.js'\nimport { createLocalReq, getPayload, logoutOperation } from 'payload'\n\nimport { getExistingAuthToken } from '../utilities/getExistingAuthToken.js'\n\nexport async function logout({\n allSessions = false,\n config,\n}: {\n allSessions?: boolean\n config: Promise<SanitizedConfig> | SanitizedConfig\n}) {\n const payload = await getPayload({ config, cron: true })\n const headers = await nextHeaders()\n const authResult = await payload.auth({ headers })\n\n if (!authResult.user) {\n return { message: 'User already logged out', success: true }\n }\n\n const { user } = authResult\n const req = await createLocalReq({ user }, payload)\n const collection = payload.collections[user.collection]\n\n const logoutResult = await logoutOperation({\n allSessions,\n collection,\n req,\n })\n\n if (!logoutResult) {\n return { message: 'Logout failed', success: false }\n }\n\n const existingCookie = await getExistingAuthToken(payload.config.cookiePrefix)\n if (existingCookie) {\n const cookies = await getCookies()\n cookies.delete(existingCookie.name)\n }\n\n return { message: 'User logged out successfully', success: true }\n}\n"],"names":["cookies","getCookies","headers","nextHeaders","createLocalReq","getPayload","logoutOperation","getExistingAuthToken","logout","allSessions","config","payload","cron","authResult","auth","user","message","success","req","collection","collections","logoutResult","existingCookie","cookiePrefix","delete","name"],"mappings":"AAAA;AAIA,SAASA,WAAWC,UAAU,EAAEC,WAAWC,WAAW,QAAQ,kBAAiB;AAC/E,SAASC,cAAc,EAAEC,UAAU,EAAEC,eAAe,QAAQ,UAAS;AAErE,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,eAAeC,OAAO,EAC3BC,cAAc,KAAK,EACnBC,MAAM,EAIP;IACC,MAAMC,UAAU,MAAMN,WAAW;QAAEK;QAAQE,MAAM;IAAK;IACtD,MAAMV,UAAU,MAAMC;IACtB,MAAMU,aAAa,MAAMF,QAAQG,IAAI,CAAC;QAAEZ;IAAQ;IAEhD,IAAI,CAACW,WAAWE,IAAI,EAAE;QACpB,OAAO;YAAEC,SAAS;YAA2BC,SAAS;QAAK;IAC7D;IAEA,MAAM,EAAEF,IAAI,EAAE,GAAGF;IACjB,MAAMK,MAAM,MAAMd,eAAe;QAAEW;IAAK,GAAGJ;IAC3C,MAAMQ,aAAaR,QAAQS,WAAW,CAACL,KAAKI,UAAU,CAAC;IAEvD,MAAME,eAAe,MAAMf,gBAAgB;QACzCG;QACAU;QACAD;IACF;IAEA,IAAI,CAACG,cAAc;QACjB,OAAO;YAAEL,SAAS;YAAiBC,SAAS;QAAM;IACpD;IAEA,MAAMK,iBAAiB,MAAMf,qBAAqBI,QAAQD,MAAM,CAACa,YAAY;IAC7E,IAAID,gBAAgB;QAClB,MAAMtB,UAAU,MAAMC;QACtBD,QAAQwB,MAAM,CAACF,eAAeG,IAAI;IACpC;IAEA,OAAO;QAAET,SAAS;QAAgCC,SAAS;IAAK;AAClE"}
|
package/dist/auth/refresh.js
CHANGED
|
@@ -1,56 +1,54 @@
|
|
|
1
1
|
'use server';
|
|
2
|
-
|
|
3
2
|
import { headers as nextHeaders } from 'next/headers.js';
|
|
4
3
|
import { createLocalReq, getPayload, refreshOperation } from 'payload';
|
|
5
4
|
import { getExistingAuthToken } from '../utilities/getExistingAuthToken.js';
|
|
6
5
|
import { setPayloadAuthCookie } from '../utilities/setPayloadAuthCookie.js';
|
|
7
|
-
export async function refresh({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
6
|
+
export async function refresh({ config }) {
|
|
7
|
+
const payload = await getPayload({
|
|
8
|
+
config,
|
|
9
|
+
cron: true
|
|
10
|
+
});
|
|
11
|
+
const headers = await nextHeaders();
|
|
12
|
+
const result = await payload.auth({
|
|
13
|
+
headers
|
|
14
|
+
});
|
|
15
|
+
if (!result.user) {
|
|
16
|
+
throw new Error('Cannot refresh token: user not authenticated');
|
|
17
|
+
}
|
|
18
|
+
const existingCookie = await getExistingAuthToken(payload.config.cookiePrefix);
|
|
19
|
+
if (!existingCookie) {
|
|
20
|
+
return {
|
|
21
|
+
message: 'No valid token found to refresh',
|
|
22
|
+
success: false
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const collection = result.user.collection;
|
|
26
|
+
const collectionConfig = payload.collections[collection];
|
|
27
|
+
if (!collectionConfig?.config.auth) {
|
|
28
|
+
throw new Error(`No auth config found for collection: ${collection}`);
|
|
29
|
+
}
|
|
30
|
+
const req = await createLocalReq({
|
|
31
|
+
user: result.user
|
|
32
|
+
}, payload);
|
|
33
|
+
const refreshResult = await refreshOperation({
|
|
34
|
+
collection: collectionConfig,
|
|
35
|
+
req
|
|
36
|
+
});
|
|
37
|
+
if (!refreshResult) {
|
|
38
|
+
return {
|
|
39
|
+
message: 'Token refresh failed',
|
|
40
|
+
success: false
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
await setPayloadAuthCookie({
|
|
44
|
+
authConfig: collectionConfig.config.auth,
|
|
45
|
+
cookiePrefix: payload.config.cookiePrefix,
|
|
46
|
+
token: refreshResult.refreshedToken
|
|
47
|
+
});
|
|
41
48
|
return {
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
message: 'Token refreshed successfully',
|
|
50
|
+
success: true
|
|
44
51
|
};
|
|
45
|
-
}
|
|
46
|
-
await setPayloadAuthCookie({
|
|
47
|
-
authConfig: collectionConfig.config.auth,
|
|
48
|
-
cookiePrefix: payload.config.cookiePrefix,
|
|
49
|
-
token: refreshResult.refreshedToken
|
|
50
|
-
});
|
|
51
|
-
return {
|
|
52
|
-
message: 'Token refreshed successfully',
|
|
53
|
-
success: true
|
|
54
|
-
};
|
|
55
52
|
}
|
|
53
|
+
|
|
56
54
|
//# sourceMappingURL=refresh.js.map
|
package/dist/auth/refresh.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/auth/refresh.ts"],"sourcesContent":["'use server'\n\nimport type { CollectionSlug } from 'payload'\n\nimport { headers as nextHeaders } from 'next/headers.js'\nimport { createLocalReq, getPayload, refreshOperation } from 'payload'\n\nimport { getExistingAuthToken } from '../utilities/getExistingAuthToken.js'\nimport { setPayloadAuthCookie } from '../utilities/setPayloadAuthCookie.js'\n\nexport async function refresh({ config }: { config: any }) {\n const payload = await getPayload({ config, cron: true })\n const headers = await nextHeaders()\n const result = await payload.auth({ headers })\n\n if (!result.user) {\n throw new Error('Cannot refresh token: user not authenticated')\n }\n\n const existingCookie = await getExistingAuthToken(payload.config.cookiePrefix)\n if (!existingCookie) {\n return { message: 'No valid token found to refresh', success: false }\n }\n\n const collection: CollectionSlug | undefined = result.user.collection\n const collectionConfig = payload.collections[collection]\n\n if (!collectionConfig?.config.auth) {\n throw new Error(`No auth config found for collection: ${collection}`)\n }\n\n const req = await createLocalReq({ user: result.user }, payload)\n\n const refreshResult = await refreshOperation({\n collection: collectionConfig,\n req,\n })\n\n if (!refreshResult) {\n return { message: 'Token refresh failed', success: false }\n }\n\n await setPayloadAuthCookie({\n authConfig: collectionConfig.config.auth,\n cookiePrefix: payload.config.cookiePrefix,\n token: refreshResult.refreshedToken,\n })\n\n return { message: 'Token refreshed successfully', success: true }\n}\n"],"names":["headers","nextHeaders","createLocalReq","getPayload","refreshOperation","getExistingAuthToken","setPayloadAuthCookie","refresh","config","payload","cron","result","auth","user","Error","existingCookie","cookiePrefix","message","success","collection","collectionConfig","collections","req","refreshResult","authConfig","token","refreshedToken"],"mappings":"AAAA;AAIA,SAASA,WAAWC,WAAW,QAAQ,kBAAiB;AACxD,SAASC,cAAc,EAAEC,UAAU,EAAEC,gBAAgB,QAAQ,UAAS;AAEtE,SAASC,oBAAoB,QAAQ,uCAAsC;AAC3E,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,eAAeC,QAAQ,EAAEC,MAAM,EAAmB;IACvD,MAAMC,UAAU,MAAMN,WAAW;QAAEK;QAAQE,MAAM;IAAK;IACtD,MAAMV,UAAU,MAAMC;IACtB,MAAMU,SAAS,MAAMF,QAAQG,IAAI,CAAC;QAAEZ;IAAQ;IAE5C,IAAI,CAACW,OAAOE,IAAI,EAAE;QAChB,MAAM,IAAIC,MAAM;IAClB;IAEA,MAAMC,iBAAiB,MAAMV,qBAAqBI,QAAQD,MAAM,CAACQ,YAAY;IAC7E,IAAI,CAACD,gBAAgB;QACnB,OAAO;YAAEE,SAAS;YAAmCC,SAAS;QAAM;IACtE;IAEA,MAAMC,aAAyCR,OAAOE,IAAI,CAACM,UAAU;IACrE,MAAMC,mBAAmBX,QAAQY,WAAW,CAACF,WAAW;IAExD,IAAI,CAACC,kBAAkBZ,OAAOI,MAAM;QAClC,MAAM,IAAIE,MAAM,CAAC,qCAAqC,EAAEK,YAAY;IACtE;IAEA,MAAMG,MAAM,MAAMpB,eAAe;QAAEW,MAAMF,OAAOE,IAAI;IAAC,GAAGJ;IAExD,MAAMc,gBAAgB,MAAMnB,iBAAiB;QAC3Ce,YAAYC;QACZE;IACF;IAEA,IAAI,CAACC,eAAe;QAClB,OAAO;YAAEN,SAAS;YAAwBC,SAAS;QAAM;IAC3D;IAEA,MAAMZ,qBAAqB;QACzBkB,YAAYJ,iBAAiBZ,MAAM,CAACI,IAAI;QACxCI,cAAcP,QAAQD,MAAM,CAACQ,YAAY;QACzCS,OAAOF,cAAcG,cAAc;IACrC;IAEA,OAAO;QAAET,SAAS;QAAgCC,SAAS;IAAK;AAClE"}
|
package/dist/config.js
CHANGED
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/config.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nexport default {} as Promise<SanitizedConfig>\n"],"names":[],"mappings":"AAEA,eAAe,CAAC,EAA6B"}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
2
|
import { useDocumentInfo } from '@payloadcms/ui';
|
|
4
|
-
export const ShouldRenderTabs =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = useDocumentInfo();
|
|
13
|
-
const id = idFromContext !== "create" ? idFromContext : null;
|
|
14
|
-
if (collectionSlug && id || globalSlug) {
|
|
15
|
-
return children;
|
|
16
|
-
}
|
|
17
|
-
return null;
|
|
3
|
+
export const ShouldRenderTabs = ({ children })=>{
|
|
4
|
+
const { id: idFromContext, collectionSlug, globalSlug } = useDocumentInfo();
|
|
5
|
+
const id = idFromContext !== 'create' ? idFromContext : null;
|
|
6
|
+
// Don't show tabs when creating new documents
|
|
7
|
+
if (collectionSlug && id || globalSlug) {
|
|
8
|
+
return children;
|
|
9
|
+
}
|
|
10
|
+
return null;
|
|
18
11
|
};
|
|
12
|
+
|
|
19
13
|
//# sourceMappingURL=ShouldRenderTabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../../src/elements/DocumentHeader/Tabs/ShouldRenderTabs.tsx"],"sourcesContent":["'use client'\nimport type React from 'react'\n\nimport { useDocumentInfo } from '@payloadcms/ui'\n\nexport const ShouldRenderTabs: React.FC<{\n children: React.ReactNode\n}> = ({ children }) => {\n const { id: idFromContext, collectionSlug, globalSlug } = useDocumentInfo()\n\n const id = idFromContext !== 'create' ? idFromContext : null\n\n // Don't show tabs when creating new documents\n if ((collectionSlug && id) || globalSlug) {\n return children\n }\n\n return null\n}\n"],"names":["useDocumentInfo","ShouldRenderTabs","children","id","idFromContext","collectionSlug","globalSlug"],"mappings":"AAAA;AAGA,SAASA,eAAe,QAAQ,iBAAgB;AAEhD,OAAO,MAAMC,mBAER,CAAC,EAAEC,QAAQ,EAAE;IAChB,MAAM,EAAEC,IAAIC,aAAa,EAAEC,cAAc,EAAEC,UAAU,EAAE,GAAGN;IAE1D,MAAMG,KAAKC,kBAAkB,WAAWA,gBAAgB;IAExD,8CAA8C;IAC9C,IAAI,AAACC,kBAAkBF,MAAOG,YAAY;QACxC,OAAOJ;IACT;IAEA,OAAO;AACT,EAAC"}
|
|
@@ -1,81 +1,50 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
import { c as _c } from "react/compiler-runtime";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
5
3
|
import { Button } from '@payloadcms/ui';
|
|
6
4
|
import { useParams, usePathname, useSearchParams } from 'next/navigation.js';
|
|
7
5
|
import { formatAdminURL } from 'payload/shared';
|
|
8
6
|
import React from 'react';
|
|
9
|
-
export const DocumentTabLink =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} = t0;
|
|
20
|
-
const pathname = usePathname();
|
|
21
|
-
const params = useParams();
|
|
22
|
-
const searchParams = useSearchParams();
|
|
23
|
-
const locale = searchParams.get("locale");
|
|
24
|
-
const [entityType, entitySlug, segmentThree, segmentFour] = params.segments || [];
|
|
25
|
-
const isCollection = entityType === "collections";
|
|
26
|
-
const t1 = `/${isCollection ? "collections" : "globals"}/${entitySlug}`;
|
|
27
|
-
let t2;
|
|
28
|
-
if ($[0] !== adminRoute || $[1] !== t1) {
|
|
29
|
-
t2 = formatAdminURL({
|
|
30
|
-
adminRoute,
|
|
31
|
-
path: t1
|
|
7
|
+
export const DocumentTabLink = ({ adminRoute, ariaLabel, baseClass, children, href: hrefFromProps, isActive: isActiveFromProps, newTab })=>{
|
|
8
|
+
const pathname = usePathname();
|
|
9
|
+
const params = useParams();
|
|
10
|
+
const searchParams = useSearchParams();
|
|
11
|
+
const locale = searchParams.get('locale');
|
|
12
|
+
const [entityType, entitySlug, segmentThree, segmentFour, ...rest] = params.segments || [];
|
|
13
|
+
const isCollection = entityType === 'collections';
|
|
14
|
+
let docPath = formatAdminURL({
|
|
15
|
+
adminRoute,
|
|
16
|
+
path: `/${isCollection ? 'collections' : 'globals'}/${entitySlug}`
|
|
32
17
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
let docPath = t2;
|
|
40
|
-
if (isCollection) {
|
|
41
|
-
if (segmentThree === "trash" && segmentFour) {
|
|
42
|
-
docPath = docPath + `/trash/${segmentFour}`;
|
|
43
|
-
} else {
|
|
44
|
-
if (segmentThree) {
|
|
45
|
-
docPath = docPath + `/${segmentThree}`;
|
|
46
|
-
}
|
|
18
|
+
if (isCollection) {
|
|
19
|
+
if (segmentThree === 'trash' && segmentFour) {
|
|
20
|
+
docPath += `/trash/${segmentFour}`;
|
|
21
|
+
} else if (segmentThree) {
|
|
22
|
+
docPath += `/${segmentThree}`;
|
|
23
|
+
}
|
|
47
24
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
let t3;
|
|
52
|
-
if ($[3] !== ariaLabel || $[4] !== baseClass || $[5] !== children || $[6] !== docPath || $[7] !== href || $[8] !== hrefWithLocale || $[9] !== isActiveFromProps || $[10] !== newTab || $[11] !== pathname) {
|
|
25
|
+
const href = `${docPath}${hrefFromProps}`;
|
|
26
|
+
// separated the two so it doesn't break checks against pathname
|
|
27
|
+
const hrefWithLocale = `${href}${locale ? `?locale=${locale}` : ''}`;
|
|
53
28
|
const isActive = href === docPath && pathname === docPath || href !== docPath && pathname.startsWith(href) || isActiveFromProps;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
$[10] = newTab;
|
|
74
|
-
$[11] = pathname;
|
|
75
|
-
$[12] = t3;
|
|
76
|
-
} else {
|
|
77
|
-
t3 = $[12];
|
|
78
|
-
}
|
|
79
|
-
return t3;
|
|
29
|
+
return /*#__PURE__*/ _jsxDEV(Button, {
|
|
30
|
+
"aria-label": ariaLabel,
|
|
31
|
+
buttonStyle: "tab",
|
|
32
|
+
className: [
|
|
33
|
+
baseClass,
|
|
34
|
+
isActive && `${baseClass}--active`
|
|
35
|
+
].filter(Boolean).join(' '),
|
|
36
|
+
disabled: isActive,
|
|
37
|
+
el: !isActive || href !== pathname ? 'link' : 'div',
|
|
38
|
+
margin: false,
|
|
39
|
+
newTab: newTab,
|
|
40
|
+
size: "medium",
|
|
41
|
+
to: !isActive || href !== pathname ? hrefWithLocale : undefined,
|
|
42
|
+
children: children
|
|
43
|
+
}, void 0, false, {
|
|
44
|
+
fileName: "src/elements/DocumentHeader/Tabs/Tab/TabLink.tsx",
|
|
45
|
+
lineNumber: 59,
|
|
46
|
+
columnNumber: 5
|
|
47
|
+
}, this);
|
|
80
48
|
};
|
|
49
|
+
|
|
81
50
|
//# sourceMappingURL=TabLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/elements/DocumentHeader/Tabs/Tab/TabLink.tsx"],"sourcesContent":["'use client'\nimport type { SanitizedConfig } from 'payload'\n\nimport { Button } from '@payloadcms/ui'\nimport { useParams, usePathname, useSearchParams } from 'next/navigation.js'\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\nexport const DocumentTabLink: React.FC<{\n adminRoute: SanitizedConfig['routes']['admin']\n ariaLabel?: string\n baseClass: string\n children?: React.ReactNode\n href: string\n isActive?: boolean\n newTab?: boolean\n}> = ({\n adminRoute,\n ariaLabel,\n baseClass,\n children,\n href: hrefFromProps,\n isActive: isActiveFromProps,\n newTab,\n}) => {\n const pathname = usePathname()\n const params = useParams()\n\n const searchParams = useSearchParams()\n\n const locale = searchParams.get('locale')\n\n const [entityType, entitySlug, segmentThree, segmentFour, ...rest] = params.segments || []\n const isCollection = entityType === 'collections'\n\n let docPath = formatAdminURL({\n adminRoute,\n path: `/${isCollection ? 'collections' : 'globals'}/${entitySlug}`,\n })\n\n if (isCollection) {\n if (segmentThree === 'trash' && segmentFour) {\n docPath += `/trash/${segmentFour}`\n } else if (segmentThree) {\n docPath += `/${segmentThree}`\n }\n }\n\n const href = `${docPath}${hrefFromProps}`\n // separated the two so it doesn't break checks against pathname\n const hrefWithLocale = `${href}${locale ? `?locale=${locale}` : ''}`\n\n const isActive =\n (href === docPath && pathname === docPath) ||\n (href !== docPath && pathname.startsWith(href)) ||\n isActiveFromProps\n\n return (\n <Button\n aria-label={ariaLabel}\n buttonStyle=\"tab\"\n className={[baseClass, isActive && `${baseClass}--active`].filter(Boolean).join(' ')}\n disabled={isActive}\n el={!isActive || href !== pathname ? 'link' : 'div'}\n margin={false}\n newTab={newTab}\n size=\"medium\"\n to={!isActive || href !== pathname ? hrefWithLocale : undefined}\n >\n {children}\n </Button>\n )\n}\n"],"names":["Button","useParams","usePathname","useSearchParams","formatAdminURL","React","DocumentTabLink","adminRoute","ariaLabel","baseClass","children","href","hrefFromProps","isActive","isActiveFromProps","newTab","pathname","params","searchParams","locale","get","entityType","entitySlug","segmentThree","segmentFour","rest","segments","isCollection","docPath","path","hrefWithLocale","startsWith","aria-label","buttonStyle","className","filter","Boolean","join","disabled","el","margin","size","to","undefined"],"mappings":"AAAA;;AAGA,SAASA,MAAM,QAAQ,iBAAgB;AACvC,SAASC,SAAS,EAAEC,WAAW,EAAEC,eAAe,QAAQ,qBAAoB;AAC5E,SAASC,cAAc,QAAQ,iBAAgB;AAC/C,OAAOC,WAAW,QAAO;AAEzB,OAAO,MAAMC,kBAQR,CAAC,EACJC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,MAAMC,aAAa,EACnBC,UAAUC,iBAAiB,EAC3BC,MAAM,EACP;IACC,MAAMC,WAAWd;IACjB,MAAMe,SAAShB;IAEf,MAAMiB,eAAef;IAErB,MAAMgB,SAASD,aAAaE,GAAG,CAAC;IAEhC,MAAM,CAACC,YAAYC,YAAYC,cAAcC,aAAa,GAAGC,KAAK,GAAGR,OAAOS,QAAQ,IAAI,EAAE;IAC1F,MAAMC,eAAeN,eAAe;IAEpC,IAAIO,UAAUxB,eAAe;QAC3BG;QACAsB,MAAM,CAAC,CAAC,EAAEF,eAAe,gBAAgB,UAAU,CAAC,EAAEL,YAAY;IACpE;IAEA,IAAIK,cAAc;QAChB,IAAIJ,iBAAiB,WAAWC,aAAa;YAC3CI,WAAW,CAAC,OAAO,EAAEJ,aAAa;QACpC,OAAO,IAAID,cAAc;YACvBK,WAAW,CAAC,CAAC,EAAEL,cAAc;QAC/B;IACF;IAEA,MAAMZ,OAAO,GAAGiB,UAAUhB,eAAe;IACzC,gEAAgE;IAChE,MAAMkB,iBAAiB,GAAGnB,OAAOQ,SAAS,CAAC,QAAQ,EAAEA,QAAQ,GAAG,IAAI;IAEpE,MAAMN,WACJ,AAACF,SAASiB,WAAWZ,aAAaY,WACjCjB,SAASiB,WAAWZ,SAASe,UAAU,CAACpB,SACzCG;IAEF,qBACE,QAACd;QACCgC,cAAYxB;QACZyB,aAAY;QACZC,WAAW;YAACzB;YAAWI,YAAY,GAAGJ,UAAU,QAAQ,CAAC;SAAC,CAAC0B,MAAM,CAACC,SAASC,IAAI,CAAC;QAChFC,UAAUzB;QACV0B,IAAI,CAAC1B,YAAYF,SAASK,WAAW,SAAS;QAC9CwB,QAAQ;QACRzB,QAAQA;QACR0B,MAAK;QACLC,IAAI,CAAC7B,YAAYF,SAASK,WAAWc,iBAAiBa;kBAErDjC;;;;;;AAGP,EAAC"}
|