@payloadcms/ui 4.0.0-canary.14 → 4.0.0-canary.16

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.
Files changed (37) hide show
  1. package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.d.ts.map +1 -1
  2. package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.js +109 -89
  3. package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.js.map +1 -1
  4. package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.d.ts.map +1 -1
  5. package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.js +2 -0
  6. package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.js.map +1 -1
  7. package/dist/elements/Nav/SidebarTabs/index.client.d.ts.map +1 -1
  8. package/dist/elements/Nav/SidebarTabs/index.client.js +12 -5
  9. package/dist/elements/Nav/SidebarTabs/index.client.js.map +1 -1
  10. package/dist/elements/Nav/SidebarTabs/renderTabServerFn.d.ts +1 -0
  11. package/dist/elements/Nav/SidebarTabs/renderTabServerFn.d.ts.map +1 -1
  12. package/dist/elements/Nav/SidebarTabs/renderTabServerFn.js +2 -1
  13. package/dist/elements/Nav/SidebarTabs/renderTabServerFn.js.map +1 -1
  14. package/dist/elements/RelationshipTable/Pagination.d.ts +0 -1
  15. package/dist/elements/RelationshipTable/Pagination.d.ts.map +1 -1
  16. package/dist/elements/RelationshipTable/Pagination.js +27 -77
  17. package/dist/elements/RelationshipTable/Pagination.js.map +1 -1
  18. package/dist/elements/RelationshipTable/index.d.ts +1 -0
  19. package/dist/elements/RelationshipTable/index.d.ts.map +1 -1
  20. package/dist/elements/RelationshipTable/index.js +4 -3
  21. package/dist/elements/RelationshipTable/index.js.map +1 -1
  22. package/dist/elements/TableSection/index.css +0 -1
  23. package/dist/fields/Blocks/index.js +3 -3
  24. package/dist/fields/Blocks/index.js.map +1 -1
  25. package/dist/fields/Join/index.css +9 -0
  26. package/dist/fields/Join/index.d.ts.map +1 -1
  27. package/dist/fields/Join/index.js +13 -9
  28. package/dist/fields/Join/index.js.map +1 -1
  29. package/dist/providers/SidebarTabs/index.d.ts +3 -2
  30. package/dist/providers/SidebarTabs/index.d.ts.map +1 -1
  31. package/dist/providers/SidebarTabs/index.js.map +1 -1
  32. package/dist/styles.css +1 -1
  33. package/dist/views/Logout/index.d.ts.map +1 -1
  34. package/dist/views/Logout/index.js +11 -0
  35. package/dist/views/Logout/index.js.map +1 -1
  36. package/package.json +4 -4
  37. package/dist/elements/RelationshipTable/Pagination.css +0 -39
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Logout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,aAAa,CAAA;AAIpB,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAC/B;IACE,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,GAAG,oBAAoB,CAuBzB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Logout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAGnD,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,aAAa,CAAA;AAIpB,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAC/B;IACE,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,GAAG,oBAAoB,CAiCzB,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getSafeRedirect } from 'payload/shared';
2
3
  import React from 'react';
3
4
  // eslint-disable-next-line payload/no-imports-from-exports-dir -- Server component must reference exports/client bundle for proper client boundary in prod builds
4
5
  import { LogoutClient } from '../../exports/client/index.js';
@@ -10,6 +11,7 @@ export const LogoutView = ({
10
11
  searchParams
11
12
  }) => {
12
13
  const {
14
+ req,
13
15
  req: {
14
16
  payload: {
15
17
  config: {
@@ -21,6 +23,15 @@ export const LogoutView = ({
21
23
  user
22
24
  }
23
25
  } = initPageResult;
26
+ // Reaching the inactivity route while still authenticated (e.g. auto-login has
27
+ // re-authenticated the user) means the inactivity screen doesn't apply. Redirect back
28
+ // to where they were headed instead of rendering the logout overlay indefinitely.
29
+ if (inactivity && user) {
30
+ req.server.redirect(getSafeRedirect({
31
+ fallbackTo: adminRoute,
32
+ redirectTo: searchParams.redirect
33
+ }));
34
+ }
24
35
  return /*#__PURE__*/_jsx("div", {
25
36
  className: `${baseClass}`,
26
37
  children: /*#__PURE__*/_jsx(LogoutClient, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","LogoutClient","baseClass","LogoutView","inactivity","initPageResult","searchParams","req","payload","config","routes","admin","adminRoute","user","_jsx","className","redirect","id","collection"],"sources":["../../../src/views/Logout/index.tsx"],"sourcesContent":["import type { AdminViewServerProps } from 'payload'\n\nimport React from 'react'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir -- Server component must reference exports/client bundle for proper client boundary in prod builds\nimport { LogoutClient } from '../../exports/client/index.js'\nimport './index.css'\n\nconst baseClass = 'logout'\n\nexport const LogoutView: React.FC<\n {\n inactivity?: boolean\n } & AdminViewServerProps\n> = ({ inactivity, initPageResult, searchParams }) => {\n const {\n req: {\n payload: {\n config: {\n routes: { admin: adminRoute },\n },\n },\n user,\n },\n } = initPageResult\n\n return (\n <div className={`${baseClass}`}>\n <LogoutClient\n adminRoute={adminRoute}\n inactivity={inactivity}\n redirect={searchParams.redirect as string}\n user={user ? { id: user.id, collection: user.collection } : null}\n />\n </div>\n )\n}\n"],"mappings":";AAEA,OAAOA,KAAA,MAAW;AAElB;AACA,SAASC,YAAY,QAAQ;AAC7B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,UAAA,GAITA,CAAC;EAAEC,UAAU;EAAEC,cAAc;EAAEC;AAAY,CAAE;EAC/C,MAAM;IACJC,GAAA,EAAK;MACHC,OAAA,EAAS;QACPC,MAAA,EAAQ;UACNC,MAAA,EAAQ;YAAEC,KAAA,EAAOC;UAAU;QAAE;MAC9B,CACF;MACDC;IAAI;EACL,CACF,GAAGR,cAAA;EAEJ,oBACES,IAAA,CAAC;IAAIC,SAAA,EAAW,GAAGb,SAAA,EAAW;cAC5B,aAAAY,IAAA,CAACb,YAAA;MACCW,UAAA,EAAYA,UAAA;MACZR,UAAA,EAAYA,UAAA;MACZY,QAAA,EAAUV,YAAA,CAAaU,QAAQ;MAC/BH,IAAA,EAAMA,IAAA,GAAO;QAAEI,EAAA,EAAIJ,IAAA,CAAKI,EAAE;QAAEC,UAAA,EAAYL,IAAA,CAAKK;MAAW,IAAI;;;AAIpE","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["getSafeRedirect","React","LogoutClient","baseClass","LogoutView","inactivity","initPageResult","searchParams","req","payload","config","routes","admin","adminRoute","user","server","redirect","fallbackTo","redirectTo","_jsx","className","id","collection"],"sources":["../../../src/views/Logout/index.tsx"],"sourcesContent":["import type { AdminViewServerProps } from 'payload'\n\nimport { getSafeRedirect } from 'payload/shared'\nimport React from 'react'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir -- Server component must reference exports/client bundle for proper client boundary in prod builds\nimport { LogoutClient } from '../../exports/client/index.js'\nimport './index.css'\n\nconst baseClass = 'logout'\n\nexport const LogoutView: React.FC<\n {\n inactivity?: boolean\n } & AdminViewServerProps\n> = ({ inactivity, initPageResult, searchParams }) => {\n const {\n req,\n req: {\n payload: {\n config: {\n routes: { admin: adminRoute },\n },\n },\n user,\n },\n } = initPageResult\n\n // Reaching the inactivity route while still authenticated (e.g. auto-login has\n // re-authenticated the user) means the inactivity screen doesn't apply. Redirect back\n // to where they were headed instead of rendering the logout overlay indefinitely.\n if (inactivity && user) {\n req.server.redirect(\n getSafeRedirect({ fallbackTo: adminRoute, redirectTo: searchParams.redirect as string }),\n )\n }\n\n return (\n <div className={`${baseClass}`}>\n <LogoutClient\n adminRoute={adminRoute}\n inactivity={inactivity}\n redirect={searchParams.redirect as string}\n user={user ? { id: user.id, collection: user.collection } : null}\n />\n </div>\n )\n}\n"],"mappings":";AAEA,SAASA,eAAe,QAAQ;AAChC,OAAOC,KAAA,MAAW;AAElB;AACA,SAASC,YAAY,QAAQ;AAC7B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,UAAA,GAITA,CAAC;EAAEC,UAAU;EAAEC,cAAc;EAAEC;AAAY,CAAE;EAC/C,MAAM;IACJC,GAAG;IACHA,GAAA,EAAK;MACHC,OAAA,EAAS;QACPC,MAAA,EAAQ;UACNC,MAAA,EAAQ;YAAEC,KAAA,EAAOC;UAAU;QAAE;MAC9B,CACF;MACDC;IAAI;EACL,CACF,GAAGR,cAAA;EAEJ;EACA;EACA;EACA,IAAID,UAAA,IAAcS,IAAA,EAAM;IACtBN,GAAA,CAAIO,MAAM,CAACC,QAAQ,CACjBhB,eAAA,CAAgB;MAAEiB,UAAA,EAAYJ,UAAA;MAAYK,UAAA,EAAYX,YAAA,CAAaS;IAAmB;EAE1F;EAEA,oBACEG,IAAA,CAAC;IAAIC,SAAA,EAAW,GAAGjB,SAAA,EAAW;cAC5B,aAAAgB,IAAA,CAACjB,YAAA;MACCW,UAAA,EAAYA,UAAA;MACZR,UAAA,EAAYA,UAAA;MACZW,QAAA,EAAUT,YAAA,CAAaS,QAAQ;MAC/BF,IAAA,EAAMA,IAAA,GAAO;QAAEO,EAAA,EAAIP,IAAA,CAAKO,EAAE;QAAEC,UAAA,EAAYR,IAAA,CAAKQ;MAAW,IAAI;;;AAIpE","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/ui",
3
- "version": "4.0.0-canary.14",
3
+ "version": "4.0.0-canary.16",
4
4
  "homepage": "https://payloadcms.com",
5
5
  "repository": {
6
6
  "type": "git",
@@ -294,7 +294,7 @@
294
294
  "ts-essentials": "10.0.3",
295
295
  "use-context-selector": "2.0.0",
296
296
  "uuid": "14.0.0",
297
- "@payloadcms/translations": "4.0.0-canary.14"
297
+ "@payloadcms/translations": "4.0.0-canary.16"
298
298
  },
299
299
  "devDependencies": {
300
300
  "@babel/cli": "7.27.2",
@@ -309,12 +309,12 @@
309
309
  "esbuild": "0.27.1",
310
310
  "esbuild-sass-plugin": "3.3.1",
311
311
  "@payloadcms/eslint-config": "3.28.0",
312
- "payload": "4.0.0-canary.14"
312
+ "payload": "4.0.0-canary.16"
313
313
  },
314
314
  "peerDependencies": {
315
315
  "react": "^19.0.1 || ^19.1.2 || ^19.2.1",
316
316
  "react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
317
- "payload": "4.0.0-canary.14"
317
+ "payload": "4.0.0-canary.16"
318
318
  },
319
319
  "engines": {
320
320
  "node": ">=24.15.0"
@@ -1,39 +0,0 @@
1
- @layer payload-default {
2
- .relationship-table-pagination {
3
- display: flex;
4
- justify-content: space-between;
5
- align-items: center;
6
- font-family: var(--text-body-medium-font-family);
7
- font-size: var(--text-body-medium-font-size);
8
- font-weight: var(--text-body-medium-font-weight);
9
- line-height: var(--text-body-medium-line-height);
10
- color: var(--color-text-secondary);
11
- }
12
-
13
- .relationship-table-pagination__nav {
14
- display: flex;
15
- gap: var(--spacer-3);
16
- align-items: center;
17
- }
18
-
19
- .relationship-table-pagination__button {
20
- background: none;
21
- border: none;
22
- padding: 0;
23
- font: inherit;
24
- color: var(--color-text-secondary);
25
- cursor: pointer;
26
-
27
- &:hover:not(:disabled) {
28
- color: var(--color-text);
29
- }
30
-
31
- &:disabled {
32
- cursor: not-allowed;
33
- }
34
- }
35
-
36
- .relationship-table-pagination__count {
37
- white-space: nowrap;
38
- }
39
- }