@payloadcms/next 3.65.0-canary.0 → 3.65.0-canary.1

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.
@@ -1,21 +1,4 @@
1
- import type { CollectionPreferences, ListQuery, ServerFunction } from 'payload';
2
- type RenderListResult = {
3
- List: React.ReactNode;
4
- preferences: CollectionPreferences;
5
- };
6
- export declare const renderListHandler: ServerFunction<{
7
- collectionSlug: string;
8
- disableActions?: boolean;
9
- disableBulkDelete?: boolean;
10
- disableBulkEdit?: boolean;
11
- disableQueryPresets?: boolean;
12
- documentDrawerSlug: string;
13
- drawerSlug?: string;
14
- enableRowSelections: boolean;
15
- overrideEntityVisibility?: boolean;
16
- query: ListQuery;
17
- redirectAfterDelete: boolean;
18
- redirectAfterDuplicate: boolean;
19
- }, Promise<RenderListResult>>;
20
- export {};
1
+ import type { RenderListServerFnArgs, RenderListServerFnReturnType } from '@payloadcms/ui';
2
+ import type { ServerFunction } from 'payload';
3
+ export declare const renderListHandler: ServerFunction<RenderListServerFnArgs, Promise<RenderListServerFnReturnType>>;
21
4
  //# sourceMappingURL=handleServerFunction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleServerFunction.d.ts","sourceRoot":"","sources":["../../../src/views/List/handleServerFunction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,cAAc,EAAmB,MAAM,SAAS,CAAA;AAShG,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,WAAW,EAAE,qBAAqB,CAAA;CACnC,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAC5C;IACE,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,KAAK,EAAE,SAAS,CAAA;IAChB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,sBAAsB,EAAE,OAAO,CAAA;CAChC,EACD,OAAO,CAAC,gBAAgB,CAAC,CAmH1B,CAAA"}
1
+ {"version":3,"file":"handleServerFunction.d.ts","sourceRoot":"","sources":["../../../src/views/List/handleServerFunction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAC1F,OAAO,KAAK,EAAyB,cAAc,EAAmB,MAAM,SAAS,CAAA;AASrF,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAC5C,sBAAsB,EACtB,OAAO,CAAC,4BAA4B,CAAC,CAmHtC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"handleServerFunction.js","names":["getClientConfig","headers","getHeaders","canAccessAdmin","getAccessResults","isEntityHidden","parseCookies","applyLocaleFiltering","renderListView","renderListHandler","args","collectionSlug","disableActions","disableBulkDelete","disableBulkEdit","disableQueryPresets","drawerSlug","enableRowSelections","overrideEntityVisibility","query","redirectAfterDelete","redirectAfterDuplicate","req","i18n","payload","config","user","cookies","clientConfig","importMap","preferencesKey","preferences","find","collection","depth","limit","where","and","key","equals","id","then","res","docs","value","visibleEntities","collections","map","slug","admin","hidden","filter","Boolean","globals","permissions","List","initPageResult","collectionConfig","globalConfig","global","languageOptions","undefined","translations","params","segments","searchParams","viewType"],"sources":["../../../src/views/List/handleServerFunction.tsx"],"sourcesContent":["import type { CollectionPreferences, ListQuery, ServerFunction, VisibleEntities } from 'payload'\n\nimport { getClientConfig } from '@payloadcms/ui/utilities/getClientConfig'\nimport { headers as getHeaders } from 'next/headers.js'\nimport { canAccessAdmin, getAccessResults, isEntityHidden, parseCookies } from 'payload'\nimport { applyLocaleFiltering } from 'payload/shared'\n\nimport { renderListView } from './index.js'\n\ntype RenderListResult = {\n List: React.ReactNode\n preferences: CollectionPreferences\n}\n\nexport const renderListHandler: ServerFunction<\n {\n collectionSlug: string\n disableActions?: boolean\n disableBulkDelete?: boolean\n disableBulkEdit?: boolean\n disableQueryPresets?: boolean\n documentDrawerSlug: string\n drawerSlug?: string\n enableRowSelections: boolean\n overrideEntityVisibility?: boolean\n query: ListQuery\n redirectAfterDelete: boolean\n redirectAfterDuplicate: boolean\n },\n Promise<RenderListResult>\n> = async (args) => {\n const {\n collectionSlug,\n disableActions,\n disableBulkDelete,\n disableBulkEdit,\n disableQueryPresets,\n drawerSlug,\n enableRowSelections,\n overrideEntityVisibility,\n query,\n redirectAfterDelete,\n redirectAfterDuplicate,\n req,\n req: {\n i18n,\n payload,\n payload: { config },\n user,\n },\n } = args\n\n const headers = await getHeaders()\n\n const cookies = parseCookies(headers)\n\n await canAccessAdmin({ req })\n\n const clientConfig = getClientConfig({\n config,\n i18n,\n importMap: payload.importMap,\n user,\n })\n await applyLocaleFiltering({ clientConfig, config, req })\n\n const preferencesKey = `collection-${collectionSlug}`\n\n const preferences = await payload\n .find({\n collection: 'payload-preferences',\n depth: 0,\n limit: 1,\n where: {\n and: [\n {\n key: {\n equals: preferencesKey,\n },\n },\n {\n 'user.relationTo': {\n equals: user.collection,\n },\n },\n {\n 'user.value': {\n equals: user.id,\n },\n },\n ],\n },\n })\n .then((res) => res.docs[0]?.value as CollectionPreferences)\n\n const visibleEntities: VisibleEntities = {\n collections: payload.config.collections\n .map(({ slug, admin: { hidden } }) => (!isEntityHidden({ hidden, user }) ? slug : null))\n .filter(Boolean),\n globals: payload.config.globals\n .map(({ slug, admin: { hidden } }) => (!isEntityHidden({ hidden, user }) ? slug : null))\n .filter(Boolean),\n }\n\n const permissions = await getAccessResults({\n req,\n })\n\n const { List } = await renderListView({\n clientConfig,\n disableActions,\n disableBulkDelete,\n disableBulkEdit,\n disableQueryPresets,\n drawerSlug,\n enableRowSelections,\n i18n,\n importMap: payload.importMap,\n initPageResult: {\n collectionConfig: payload?.collections?.[collectionSlug]?.config,\n cookies,\n globalConfig: payload.config.globals.find((global) => global.slug === collectionSlug),\n languageOptions: undefined, // TODO\n permissions,\n req,\n translations: undefined, // TODO\n visibleEntities,\n },\n overrideEntityVisibility,\n params: {\n segments: ['collections', collectionSlug],\n },\n payload,\n query,\n redirectAfterDelete,\n redirectAfterDuplicate,\n searchParams: {},\n viewType: 'list',\n })\n\n return {\n List,\n preferences,\n }\n}\n"],"mappings":"AAEA,SAASA,eAAe,QAAQ;AAChC,SAASC,OAAA,IAAWC,UAAU,QAAQ;AACtC,SAASC,cAAc,EAAEC,gBAAgB,EAAEC,cAAc,EAAEC,YAAY,QAAQ;AAC/E,SAASC,oBAAoB,QAAQ;AAErC,SAASC,cAAc,QAAQ;AAO/B,OAAO,MAAMC,iBAAA,GAgBT,MAAOC,IAAA;EACT,MAAM;IACJC,cAAc;IACdC,cAAc;IACdC,iBAAiB;IACjBC,eAAe;IACfC,mBAAmB;IACnBC,UAAU;IACVC,mBAAmB;IACnBC,wBAAwB;IACxBC,KAAK;IACLC,mBAAmB;IACnBC,sBAAsB;IACtBC,GAAG;IACHA,GAAA,EAAK;MACHC,IAAI;MACJC,OAAO;MACPA,OAAA,EAAS;QAAEC;MAAM,CAAE;MACnBC;IAAI;EACL,CACF,GAAGhB,IAAA;EAEJ,MAAMT,OAAA,GAAU,MAAMC,UAAA;EAEtB,MAAMyB,OAAA,GAAUrB,YAAA,CAAaL,OAAA;EAE7B,MAAME,cAAA,CAAe;IAAEmB;EAAI;EAE3B,MAAMM,YAAA,GAAe5B,eAAA,CAAgB;IACnCyB,MAAA;IACAF,IAAA;IACAM,SAAA,EAAWL,OAAA,CAAQK,SAAS;IAC5BH;EACF;EACA,MAAMnB,oBAAA,CAAqB;IAAEqB,YAAA;IAAcH,MAAA;IAAQH;EAAI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;IAC5B2B,cAAA,EAAgB;MACdC,gBAAA,EAAkBjC,OAAA,EAASsB,WAAA,GAAcnC,cAAA,CAAe,EAAEc,MAAA;MAC1DE,OAAA;MACA+B,YAAA,EAAclC,OAAA,CAAQC,MAAM,CAAC4B,OAAO,CAACrB,IAAI,CAAE2B,MAAA,IAAWA,MAAA,CAAOX,IAAI,KAAKrC,cAAA;MACtEiD,eAAA,EAAiBC,SAAA;MACjBP,WAAA;MACAhC,GAAA;MACAwC,YAAA,EAAcD,SAAA;MACdhB;IACF;IACA3B,wBAAA;IACA6C,MAAA,EAAQ;MACNC,QAAA,EAAU,CAAC,eAAerD,cAAA;IAC5B;IACAa,OAAA;IACAL,KAAA;IACAC,mBAAA;IACAC,sBAAA;IACA4C,YAAA,EAAc,CAAC;IACfC,QAAA,EAAU;EACZ;EAEA,OAAO;IACLX,IAAA;IACAxB;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"handleServerFunction.js","names":["getClientConfig","headers","getHeaders","canAccessAdmin","getAccessResults","isEntityHidden","parseCookies","applyLocaleFiltering","renderListView","renderListHandler","args","collectionSlug","disableActions","disableBulkDelete","disableBulkEdit","disableQueryPresets","drawerSlug","enableRowSelections","overrideEntityVisibility","query","redirectAfterDelete","redirectAfterDuplicate","req","i18n","payload","config","user","cookies","clientConfig","importMap","preferencesKey","preferences","find","collection","depth","limit","where","and","key","equals","id","then","res","docs","value","visibleEntities","collections","map","slug","admin","hidden","filter","Boolean","globals","permissions","List","initPageResult","collectionConfig","globalConfig","global","languageOptions","undefined","translations","params","segments","searchParams","viewType"],"sources":["../../../src/views/List/handleServerFunction.tsx"],"sourcesContent":["import type { RenderListServerFnArgs, RenderListServerFnReturnType } from '@payloadcms/ui'\nimport type { CollectionPreferences, ServerFunction, VisibleEntities } from 'payload'\n\nimport { getClientConfig } from '@payloadcms/ui/utilities/getClientConfig'\nimport { headers as getHeaders } from 'next/headers.js'\nimport { canAccessAdmin, getAccessResults, isEntityHidden, parseCookies } from 'payload'\nimport { applyLocaleFiltering } from 'payload/shared'\n\nimport { renderListView } from './index.js'\n\nexport const renderListHandler: ServerFunction<\n RenderListServerFnArgs,\n Promise<RenderListServerFnReturnType>\n> = async (args) => {\n const {\n collectionSlug,\n disableActions,\n disableBulkDelete,\n disableBulkEdit,\n disableQueryPresets,\n drawerSlug,\n enableRowSelections,\n overrideEntityVisibility,\n query,\n redirectAfterDelete,\n redirectAfterDuplicate,\n req,\n req: {\n i18n,\n payload,\n payload: { config },\n user,\n },\n } = args\n\n const headers = await getHeaders()\n\n const cookies = parseCookies(headers)\n\n await canAccessAdmin({ req })\n\n const clientConfig = getClientConfig({\n config,\n i18n,\n importMap: payload.importMap,\n user,\n })\n await applyLocaleFiltering({ clientConfig, config, req })\n\n const preferencesKey = `collection-${collectionSlug}`\n\n const preferences = await payload\n .find({\n collection: 'payload-preferences',\n depth: 0,\n limit: 1,\n where: {\n and: [\n {\n key: {\n equals: preferencesKey,\n },\n },\n {\n 'user.relationTo': {\n equals: user.collection,\n },\n },\n {\n 'user.value': {\n equals: user.id,\n },\n },\n ],\n },\n })\n .then((res) => res.docs[0]?.value as CollectionPreferences)\n\n const visibleEntities: VisibleEntities = {\n collections: payload.config.collections\n .map(({ slug, admin: { hidden } }) => (!isEntityHidden({ hidden, user }) ? slug : null))\n .filter(Boolean),\n globals: payload.config.globals\n .map(({ slug, admin: { hidden } }) => (!isEntityHidden({ hidden, user }) ? slug : null))\n .filter(Boolean),\n }\n\n const permissions = await getAccessResults({\n req,\n })\n\n const { List } = await renderListView({\n clientConfig,\n disableActions,\n disableBulkDelete,\n disableBulkEdit,\n disableQueryPresets,\n drawerSlug,\n enableRowSelections,\n i18n,\n importMap: payload.importMap,\n initPageResult: {\n collectionConfig: payload?.collections?.[collectionSlug]?.config,\n cookies,\n globalConfig: payload.config.globals.find((global) => global.slug === collectionSlug),\n languageOptions: undefined, // TODO\n permissions,\n req,\n translations: undefined, // TODO\n visibleEntities,\n },\n overrideEntityVisibility,\n params: {\n segments: ['collections', collectionSlug],\n },\n payload,\n query,\n redirectAfterDelete,\n redirectAfterDuplicate,\n searchParams: {},\n viewType: 'list',\n })\n\n return {\n List,\n preferences,\n }\n}\n"],"mappings":"AAGA,SAASA,eAAe,QAAQ;AAChC,SAASC,OAAA,IAAWC,UAAU,QAAQ;AACtC,SAASC,cAAc,EAAEC,gBAAgB,EAAEC,cAAc,EAAEC,YAAY,QAAQ;AAC/E,SAASC,oBAAoB,QAAQ;AAErC,SAASC,cAAc,QAAQ;AAE/B,OAAO,MAAMC,iBAAA,GAGT,MAAOC,IAAA;EACT,MAAM;IACJC,cAAc;IACdC,cAAc;IACdC,iBAAiB;IACjBC,eAAe;IACfC,mBAAmB;IACnBC,UAAU;IACVC,mBAAmB;IACnBC,wBAAwB;IACxBC,KAAK;IACLC,mBAAmB;IACnBC,sBAAsB;IACtBC,GAAG;IACHA,GAAA,EAAK;MACHC,IAAI;MACJC,OAAO;MACPA,OAAA,EAAS;QAAEC;MAAM,CAAE;MACnBC;IAAI;EACL,CACF,GAAGhB,IAAA;EAEJ,MAAMT,OAAA,GAAU,MAAMC,UAAA;EAEtB,MAAMyB,OAAA,GAAUrB,YAAA,CAAaL,OAAA;EAE7B,MAAME,cAAA,CAAe;IAAEmB;EAAI;EAE3B,MAAMM,YAAA,GAAe5B,eAAA,CAAgB;IACnCyB,MAAA;IACAF,IAAA;IACAM,SAAA,EAAWL,OAAA,CAAQK,SAAS;IAC5BH;EACF;EACA,MAAMnB,oBAAA,CAAqB;IAAEqB,YAAA;IAAcH,MAAA;IAAQH;EAAI;EAEvD,MAAMQ,cAAA,GAAiB,cAAcnB,cAAA,EAAgB;EAErD,MAAMoB,WAAA,GAAc,MAAMP,OAAA,CACvBQ,IAAI,CAAC;IACJC,UAAA,EAAY;IACZC,KAAA,EAAO;IACPC,KAAA,EAAO;IACPC,KAAA,EAAO;MACLC,GAAA,EAAK,CACH;QACEC,GAAA,EAAK;UACHC,MAAA,EAAQT;QACV;MACF,GACA;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,SAAA;MACjBP,WAAA;MACAhC,GAAA;MACAwC,YAAA,EAAcD,SAAA;MACdhB;IACF;IACA3B,wBAAA;IACA6C,MAAA,EAAQ;MACNC,QAAA,EAAU,CAAC,eAAerD,cAAA;IAC5B;IACAa,OAAA;IACAL,KAAA;IACAC,mBAAA;IACAC,sBAAA;IACA4C,YAAA,EAAc,CAAC;IACfC,QAAA,EAAU;EACZ;EAEA,OAAO;IACLX,IAAA;IACAxB;EACF;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"LogoutClient.d.ts","sourceRoot":"","sources":["../../../src/views/Logout/LogoutClient.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAExC,OAAO,cAAc,CAAA;AAIrB;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB,CA0DA,CAAA"}
1
+ {"version":3,"file":"LogoutClient.d.ts","sourceRoot":"","sources":["../../../src/views/Logout/LogoutClient.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAExC,OAAO,cAAc,CAAA;AAIrB;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAyDA,CAAA"}
@@ -53,9 +53,9 @@ export const LogoutClient = props => {
53
53
  } = useTranslation();
54
54
  const router = useRouter();
55
55
  let t1;
56
- if ($[4] !== inactivity || $[5] !== logOut || $[6] !== loginRoute || $[7] !== router || $[8] !== startRouteTransition || $[9] !== t) {
56
+ if ($[4] !== logOut || $[5] !== loginRoute || $[6] !== router || $[7] !== startRouteTransition || $[8] !== t) {
57
57
  t1 = async () => {
58
- if (!inactivity && !navigatingToLoginRef.current) {
58
+ if (!navigatingToLoginRef.current) {
59
59
  navigatingToLoginRef.current = true;
60
60
  await logOut();
61
61
  toast.success(t("authentication:loggedOutSuccessfully"));
@@ -63,22 +63,21 @@ export const LogoutClient = props => {
63
63
  return;
64
64
  }
65
65
  };
66
- $[4] = inactivity;
67
- $[5] = logOut;
68
- $[6] = loginRoute;
69
- $[7] = router;
70
- $[8] = startRouteTransition;
71
- $[9] = t;
72
- $[10] = t1;
66
+ $[4] = logOut;
67
+ $[5] = loginRoute;
68
+ $[6] = router;
69
+ $[7] = startRouteTransition;
70
+ $[8] = t;
71
+ $[9] = t1;
73
72
  } else {
74
- t1 = $[10];
73
+ t1 = $[9];
75
74
  }
76
75
  const handleLogOut = t1;
77
76
  let t2;
78
77
  let t3;
79
- if ($[11] !== handleLogOut || $[12] !== isLoggedIn || $[13] !== loginRoute || $[14] !== router || $[15] !== startRouteTransition) {
78
+ if ($[10] !== handleLogOut || $[11] !== inactivity || $[12] !== isLoggedIn || $[13] !== loginRoute || $[14] !== router || $[15] !== startRouteTransition) {
80
79
  t2 = () => {
81
- if (isLoggedIn) {
80
+ if (isLoggedIn && !inactivity) {
82
81
  handleLogOut();
83
82
  } else {
84
83
  if (!navigatingToLoginRef.current) {
@@ -87,8 +86,9 @@ export const LogoutClient = props => {
87
86
  }
88
87
  }
89
88
  };
90
- t3 = [handleLogOut, isLoggedIn, loginRoute, router, startRouteTransition];
91
- $[11] = handleLogOut;
89
+ t3 = [handleLogOut, isLoggedIn, loginRoute, router, startRouteTransition, inactivity];
90
+ $[10] = handleLogOut;
91
+ $[11] = inactivity;
92
92
  $[12] = isLoggedIn;
93
93
  $[13] = loginRoute;
94
94
  $[14] = router;
@@ -1 +1 @@
1
- {"version":3,"file":"LogoutClient.js","names":["c","_c","Button","LoadingOverlay","toast","useAuth","useRouteTransition","useTranslation","useRouter","formatAdminURL","React","useEffect","baseClass","LogoutClient","props","$","adminRoute","inactivity","redirect","logOut","user","startRouteTransition","id","isLoggedIn","Boolean","navigatingToLoginRef","useRef","t0","path","length","encodeURIComponent","loginRoute","useState","t","router","t1","current","success","push","handleLogOut","t2","t3","t4","_jsxs","className","children","_jsx","buttonStyle","el","size","url","animationDuration","loadingText"],"sources":["../../../src/views/Logout/LogoutClient.tsx"],"sourcesContent":["'use client'\nimport {\n Button,\n LoadingOverlay,\n toast,\n useAuth,\n useRouteTransition,\n useTranslation,\n} from '@payloadcms/ui'\nimport { useRouter } from 'next/navigation.js'\nimport { formatAdminURL } from 'payload/shared'\nimport React, { useEffect } from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'logout'\n\n/**\n * This component should **just** be the inactivity route and do nothing with logging the user out.\n *\n * It currently handles too much, the auth provider should just log the user out and then\n * we could remove the useEffect in this file. So instead of the logout button\n * being an anchor link, it should be a button that calls `logOut` in the provider.\n *\n * This view is still useful if cookies attempt to refresh and fail, i.e. the user\n * is logged out due to inactivity.\n */\nexport const LogoutClient: React.FC<{\n adminRoute: string\n inactivity?: boolean\n redirect: string\n}> = (props) => {\n const { adminRoute, inactivity, redirect } = props\n\n const { logOut, user } = useAuth()\n\n const { startRouteTransition } = useRouteTransition()\n\n const isLoggedIn = React.useMemo(() => {\n return Boolean(user?.id)\n }, [user?.id])\n\n const navigatingToLoginRef = React.useRef(false)\n\n const [loginRoute] = React.useState(() =>\n formatAdminURL({\n adminRoute,\n path: `/login${\n inactivity && redirect && redirect.length > 0\n ? `?redirect=${encodeURIComponent(redirect)}`\n : ''\n }`,\n }),\n )\n\n const { t } = useTranslation()\n const router = useRouter()\n\n const handleLogOut = React.useCallback(async () => {\n if (!inactivity && !navigatingToLoginRef.current) {\n navigatingToLoginRef.current = true\n await logOut()\n toast.success(t('authentication:loggedOutSuccessfully'))\n startRouteTransition(() => router.push(loginRoute))\n return\n }\n }, [inactivity, logOut, loginRoute, router, startRouteTransition, t])\n\n useEffect(() => {\n if (isLoggedIn) {\n void handleLogOut()\n } else if (!navigatingToLoginRef.current) {\n navigatingToLoginRef.current = true\n startRouteTransition(() => router.push(loginRoute))\n }\n }, [handleLogOut, isLoggedIn, loginRoute, router, startRouteTransition])\n\n if (!isLoggedIn && inactivity) {\n return (\n <div className={`${baseClass}__wrap`}>\n <h2>{t('authentication:loggedOutInactivity')}</h2>\n <Button buttonStyle=\"secondary\" el=\"link\" size=\"large\" url={loginRoute}>\n {t('authentication:logBackIn')}\n </Button>\n </div>\n )\n }\n\n return <LoadingOverlay animationDuration={'0ms'} loadingText={t('authentication:loggingOut')} />\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SACEC,MAAM,EACNC,cAAc,EACdC,KAAK,EACLC,OAAO,EACPC,kBAAkB,EAClBC,cAAc,QACT;AACP,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,IAASC,SAAS,QAAQ;AAIjC,MAAMC,SAAA,GAAY;AAElB;;;;;;;;;;AAUA,OAAO,MAAMC,YAAA,GAIRC,KAAA;EAAA,MAAAC,CAAA,GAAAd,EAAA;EACH;IAAAe,UAAA;IAAAC,UAAA;IAAAC;EAAA,IAA6CJ,KAAA;EAE7C;IAAAK,MAAA;IAAAC;EAAA,IAAyBf,OAAA;EAEzB;IAAAgB;EAAA,IAAiCf,kBAAA;EAI7Bc,IAAA,EAAAE,EAAA;EAFJ,MAAAC,UAAA,GACSC,OAAA,CAAQJ,IAAA,EAAAE,EAAM;EAGvB,MAAAG,oBAAA,GAA6Bf,KAAA,CAAAgB,MAAA,MAAa;EAAA,IAAAC,EAAA;EAAA,IAAAZ,CAAA,QAAAC,UAAA,IAAAD,CAAA,QAAAE,UAAA,IAAAF,CAAA,QAAAG,QAAA;IAENS,EAAA,GAAAA,CAAA,KAClClB,cAAA;MAAAO,UAAA;MAAAY,IAAA,EAEQ,SACJX,UAAA,IAAcC,QAAA,IAAYA,QAAA,CAAAW,MAAA,IAAkB,GAC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","Button","LoadingOverlay","toast","useAuth","useRouteTransition","useTranslation","useRouter","formatAdminURL","React","useEffect","baseClass","LogoutClient","props","$","adminRoute","inactivity","redirect","logOut","user","startRouteTransition","id","isLoggedIn","Boolean","navigatingToLoginRef","useRef","t0","path","length","encodeURIComponent","loginRoute","useState","t","router","t1","current","success","push","handleLogOut","t2","t3","t4","_jsxs","className","children","_jsx","buttonStyle","el","size","url","animationDuration","loadingText"],"sources":["../../../src/views/Logout/LogoutClient.tsx"],"sourcesContent":["'use client'\nimport {\n Button,\n LoadingOverlay,\n toast,\n useAuth,\n useRouteTransition,\n useTranslation,\n} from '@payloadcms/ui'\nimport { useRouter } from 'next/navigation.js'\nimport { formatAdminURL } from 'payload/shared'\nimport React, { useEffect } from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'logout'\n\n/**\n * This component should **just** be the inactivity route and do nothing with logging the user out.\n *\n * It currently handles too much, the auth provider should just log the user out and then\n * we could remove the useEffect in this file. So instead of the logout button\n * being an anchor link, it should be a button that calls `logOut` in the provider.\n *\n * This view is still useful if cookies attempt to refresh and fail, i.e. the user\n * is logged out due to inactivity.\n */\nexport const LogoutClient: React.FC<{\n adminRoute: string\n inactivity?: boolean\n redirect: string\n}> = (props) => {\n const { adminRoute, inactivity, redirect } = props\n\n const { logOut, user } = useAuth()\n\n const { startRouteTransition } = useRouteTransition()\n\n const isLoggedIn = React.useMemo(() => {\n return Boolean(user?.id)\n }, [user?.id])\n\n const navigatingToLoginRef = React.useRef(false)\n\n const [loginRoute] = React.useState(() =>\n formatAdminURL({\n adminRoute,\n path: `/login${inactivity && redirect && redirect.length > 0\n ? `?redirect=${encodeURIComponent(redirect)}`\n : ''\n }`,\n }),\n )\n\n const { t } = useTranslation()\n const router = useRouter()\n\n const handleLogOut = React.useCallback(async () => {\n if (!navigatingToLoginRef.current) {\n navigatingToLoginRef.current = true\n await logOut()\n toast.success(t('authentication:loggedOutSuccessfully'))\n startRouteTransition(() => router.push(loginRoute))\n return\n }\n }, [logOut, loginRoute, router, startRouteTransition, t])\n\n useEffect(() => {\n if (isLoggedIn && !inactivity) {\n void handleLogOut()\n } else if (!navigatingToLoginRef.current) {\n navigatingToLoginRef.current = true\n startRouteTransition(() => router.push(loginRoute))\n }\n }, [handleLogOut, isLoggedIn, loginRoute, router, startRouteTransition, inactivity])\n\n if (!isLoggedIn && inactivity) {\n return (\n <div className={`${baseClass}__wrap`}>\n <h2>{t('authentication:loggedOutInactivity')}</h2>\n <Button buttonStyle=\"secondary\" el=\"link\" size=\"large\" url={loginRoute}>\n {t('authentication:logBackIn')}\n </Button>\n </div>\n )\n }\n\n return <LoadingOverlay animationDuration={'0ms'} loadingText={t('authentication:loggingOut')} />\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SACEC,MAAM,EACNC,cAAc,EACdC,KAAK,EACLC,OAAO,EACPC,kBAAkB,EAClBC,cAAc,QACT;AACP,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,IAASC,SAAS,QAAQ;AAIjC,MAAMC,SAAA,GAAY;AAElB;;;;;;;;;;AAUA,OAAO,MAAMC,YAAA,GAIRC,KAAA;EAAA,MAAAC,CAAA,GAAAd,EAAA;EACH;IAAAe,UAAA;IAAAC,UAAA;IAAAC;EAAA,IAA6CJ,KAAA;EAE7C;IAAAK,MAAA;IAAAC;EAAA,IAAyBf,OAAA;EAEzB;IAAAgB;EAAA,IAAiCf,kBAAA;EAI7Bc,IAAA,EAAAE,EAAA;EAFJ,MAAAC,UAAA,GACSC,OAAA,CAAQJ,IAAA,EAAAE,EAAM;EAGvB,MAAAG,oBAAA,GAA6Bf,KAAA,CAAAgB,MAAA,MAAa;EAAA,IAAAC,EAAA;EAAA,IAAAZ,CAAA,QAAAC,UAAA,IAAAD,CAAA,QAAAE,UAAA,IAAAF,CAAA,QAAAG,QAAA;IAENS,EAAA,GAAAA,CAAA,KAClClB,cAAA;MAAAO,UAAA;MA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E;IAAA,C;;;;;;SAAzDS,E;CACT","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/next",
3
- "version": "3.65.0-canary.0",
3
+ "version": "3.65.0-canary.1",
4
4
  "homepage": "https://payloadcms.com",
5
5
  "repository": {
6
6
  "type": "git",
@@ -97,9 +97,9 @@
97
97
  "qs-esm": "7.0.2",
98
98
  "sass": "1.77.4",
99
99
  "uuid": "10.0.0",
100
- "@payloadcms/graphql": "3.65.0-canary.0",
101
- "@payloadcms/translations": "3.65.0-canary.0",
102
- "@payloadcms/ui": "3.65.0-canary.0"
100
+ "@payloadcms/graphql": "3.65.0-canary.1",
101
+ "@payloadcms/translations": "3.65.0-canary.1",
102
+ "@payloadcms/ui": "3.65.0-canary.1"
103
103
  },
104
104
  "devDependencies": {
105
105
  "@babel/cli": "7.27.2",
@@ -117,12 +117,12 @@
117
117
  "esbuild-sass-plugin": "3.3.1",
118
118
  "swc-plugin-transform-remove-imports": "4.0.4",
119
119
  "@payloadcms/eslint-config": "3.28.0",
120
- "payload": "3.65.0-canary.0"
120
+ "payload": "3.65.0-canary.1"
121
121
  },
122
122
  "peerDependencies": {
123
123
  "graphql": "^16.8.1",
124
124
  "next": "^15.2.3",
125
- "payload": "3.65.0-canary.0"
125
+ "payload": "3.65.0-canary.1"
126
126
  },
127
127
  "engines": {
128
128
  "node": "^18.20.2 || >=20.9.0"