@payloadcms/next 3.0.0-beta.111 → 3.0.0-beta.112

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 (117) hide show
  1. package/dist/elements/FormHeader/index.d.ts +9 -0
  2. package/dist/elements/FormHeader/index.d.ts.map +1 -0
  3. package/dist/elements/FormHeader/index.js +20 -0
  4. package/dist/elements/FormHeader/index.js.map +1 -0
  5. package/dist/elements/FormHeader/index.scss +6 -0
  6. package/dist/exports/utilities.d.ts +1 -0
  7. package/dist/exports/utilities.d.ts.map +1 -1
  8. package/dist/exports/utilities.js +1 -0
  9. package/dist/exports/utilities.js.map +1 -1
  10. package/dist/prod/styles.css +1 -1
  11. package/dist/routes/rest/auth/login.js +2 -2
  12. package/dist/routes/rest/auth/login.js.map +1 -1
  13. package/dist/routes/rest/auth/logout.d.ts.map +1 -1
  14. package/dist/routes/rest/auth/logout.js +3 -2
  15. package/dist/routes/rest/auth/logout.js.map +1 -1
  16. package/dist/routes/rest/auth/refresh.js +2 -2
  17. package/dist/routes/rest/auth/refresh.js.map +1 -1
  18. package/dist/routes/rest/auth/registerFirstUser.js +2 -2
  19. package/dist/routes/rest/auth/registerFirstUser.js.map +1 -1
  20. package/dist/routes/rest/auth/resetPassword.js +2 -2
  21. package/dist/routes/rest/auth/resetPassword.js.map +1 -1
  22. package/dist/scss/app.scss +166 -162
  23. package/dist/scss/colors.scss +256 -254
  24. package/dist/scss/resets.scss +9 -7
  25. package/dist/scss/toastify.scss +42 -40
  26. package/dist/scss/toasts.scss +105 -103
  27. package/dist/scss/type.scss +80 -79
  28. package/dist/utilities/initPage/handleAdminPage.d.ts +11 -11
  29. package/dist/utilities/initPage/handleAdminPage.d.ts.map +1 -1
  30. package/dist/utilities/initPage/handleAdminPage.js +7 -20
  31. package/dist/utilities/initPage/handleAdminPage.js.map +1 -1
  32. package/dist/utilities/initPage/handleAuthRedirect.d.ts +6 -3
  33. package/dist/utilities/initPage/handleAuthRedirect.d.ts.map +1 -1
  34. package/dist/utilities/initPage/handleAuthRedirect.js +23 -36
  35. package/dist/utilities/initPage/handleAuthRedirect.js.map +1 -1
  36. package/dist/utilities/initPage/index.d.ts +1 -1
  37. package/dist/utilities/initPage/index.d.ts.map +1 -1
  38. package/dist/utilities/initPage/index.js +20 -9
  39. package/dist/utilities/initPage/index.js.map +1 -1
  40. package/dist/utilities/initPage/shared.d.ts +2 -2
  41. package/dist/utilities/initPage/shared.d.ts.map +1 -1
  42. package/dist/utilities/initPage/shared.js +18 -13
  43. package/dist/utilities/initPage/shared.js.map +1 -1
  44. package/dist/views/API/index.scss +98 -96
  45. package/dist/views/Account/Settings/index.scss +37 -35
  46. package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
  47. package/dist/views/CreateFirstUser/index.client.js +1 -1
  48. package/dist/views/CreateFirstUser/index.client.js.map +1 -1
  49. package/dist/views/CreateFirstUser/index.scss +13 -11
  50. package/dist/views/Dashboard/Default/index.scss +51 -49
  51. package/dist/views/Edit/Default/Auth/index.scss +56 -54
  52. package/dist/views/Edit/Default/index.scss +15 -13
  53. package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts.map +1 -1
  54. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +9 -11
  55. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
  56. package/dist/views/ForgotPassword/index.d.ts.map +1 -1
  57. package/dist/views/ForgotPassword/index.js +6 -6
  58. package/dist/views/ForgotPassword/index.js.map +1 -1
  59. package/dist/views/List/Default/index.scss +136 -134
  60. package/dist/views/LivePreview/IFrame/index.scss +8 -6
  61. package/dist/views/LivePreview/Preview/index.scss +32 -30
  62. package/dist/views/LivePreview/Toolbar/Controls/index.scss +49 -47
  63. package/dist/views/LivePreview/Toolbar/SizeInput/index.scss +11 -9
  64. package/dist/views/LivePreview/Toolbar/index.scss +33 -31
  65. package/dist/views/LivePreview/ToolbarArea/index.scss +5 -3
  66. package/dist/views/LivePreview/index.scss +48 -46
  67. package/dist/views/Login/LoginForm/index.js +1 -1
  68. package/dist/views/Login/LoginForm/index.js.map +1 -1
  69. package/dist/views/Login/LoginForm/index.scss +8 -6
  70. package/dist/views/Login/index.scss +8 -6
  71. package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
  72. package/dist/views/Logout/LogoutClient.js +77 -55
  73. package/dist/views/Logout/LogoutClient.js.map +1 -1
  74. package/dist/views/Logout/index.scss +17 -15
  75. package/dist/views/NotFound/index.scss +38 -36
  76. package/dist/views/ResetPassword/ResetPasswordForm/index.d.ts +7 -0
  77. package/dist/views/ResetPassword/ResetPasswordForm/index.d.ts.map +1 -0
  78. package/dist/views/ResetPassword/{index.client.js → ResetPasswordForm/index.js} +16 -19
  79. package/dist/views/ResetPassword/ResetPasswordForm/index.js.map +1 -0
  80. package/dist/views/ResetPassword/index.d.ts.map +1 -1
  81. package/dist/views/ResetPassword/index.js +17 -10
  82. package/dist/views/ResetPassword/index.js.map +1 -1
  83. package/dist/views/ResetPassword/index.scss +6 -26
  84. package/dist/views/Root/getViewFromConfig.d.ts.map +1 -1
  85. package/dist/views/Root/getViewFromConfig.js +0 -6
  86. package/dist/views/Root/getViewFromConfig.js.map +1 -1
  87. package/dist/views/Root/index.d.ts.map +1 -1
  88. package/dist/views/Root/index.js +5 -2
  89. package/dist/views/Root/index.js.map +1 -1
  90. package/dist/views/Unauthorized/index.d.ts.map +1 -1
  91. package/dist/views/Unauthorized/index.js +14 -7
  92. package/dist/views/Unauthorized/index.js.map +1 -1
  93. package/dist/views/Unauthorized/index.scss +4 -31
  94. package/dist/views/Verify/index.client.d.ts +7 -0
  95. package/dist/views/Verify/index.client.d.ts.map +1 -0
  96. package/dist/views/Verify/index.client.js +46 -0
  97. package/dist/views/Verify/index.client.js.map +1 -0
  98. package/dist/views/Verify/index.d.ts.map +1 -1
  99. package/dist/views/Verify/index.js +12 -11
  100. package/dist/views/Verify/index.js.map +1 -1
  101. package/dist/views/Verify/index.scss +13 -11
  102. package/dist/views/Version/Default/index.scss +52 -50
  103. package/dist/views/Version/RenderFieldsToDiff/Label/index.scss +5 -3
  104. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.scss +29 -27
  105. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.scss +11 -9
  106. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.scss +12 -10
  107. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.scss +12 -10
  108. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.scss +12 -10
  109. package/dist/views/Version/RenderFieldsToDiff/index.scss +12 -10
  110. package/dist/views/Version/Restore/index.scss +57 -55
  111. package/dist/views/Version/SelectComparison/index.scss +12 -10
  112. package/dist/views/Version/SelectLocales/index.scss +6 -4
  113. package/dist/views/Versions/index.scss +78 -76
  114. package/package.json +6 -6
  115. package/dist/views/ResetPassword/index.client.d.ts +0 -7
  116. package/dist/views/ResetPassword/index.client.d.ts.map +0 -1
  117. package/dist/views/ResetPassword/index.client.js.map +0 -1
@@ -26,8 +26,8 @@ export const login = async ({
26
26
  req
27
27
  });
28
28
  const cookie = generatePayloadCookie({
29
- collectionConfig: collection.config,
30
- payload: req.payload,
29
+ collectionAuthConfig: collection.config.auth,
30
+ cookiePrefix: req.payload.config.cookiePrefix,
31
31
  token: result.token
32
32
  });
33
33
  if (collection.config.auth.removeTokenFromResponses) {
@@ -1 +1 @@
1
- {"version":3,"file":"login.js","names":["httpStatus","generatePayloadCookie","loginOperation","isNumber","headersWithCors","login","collection","req","searchParams","t","depth","get","authData","config","auth","loginWithUsername","email","data","password","username","result","Number","undefined","cookie","collectionConfig","payload","token","removeTokenFromResponses","Response","json","message","headers","Headers","status","OK"],"sources":["../../../../src/routes/rest/auth/login.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, loginOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const login: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams, t } = req\n const depth = searchParams.get('depth')\n const authData =\n collection.config.auth?.loginWithUsername !== false\n ? {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n username: typeof req.data?.username === 'string' ? req.data.username : '',\n }\n : {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n }\n\n const result = await loginOperation({\n collection,\n data: authData,\n depth: isNumber(depth) ? Number(depth) : undefined,\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n token: result.token,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return Response.json(\n {\n message: t('authentication:passed'),\n ...result,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,qBAAqB,EAAEC,cAAc,QAAQ;AACtD,SAASC,QAAQ,QAAQ;AAIzB,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,KAAA,GAAgC,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EACrE,MAAM;IAAEC,YAAY;IAAEC;EAAC,CAAE,GAAGF,GAAA;EAC5B,MAAMG,KAAA,GAAQF,YAAA,CAAaG,GAAG,CAAC;EAC/B,MAAMC,QAAA,GACJN,UAAA,CAAWO,MAAM,CAACC,IAAI,EAAEC,iBAAA,KAAsB,QAC1C;IACEC,KAAA,EAAO,OAAOT,GAAA,CAAIU,IAAI,EAAED,KAAA,KAAU,WAAWT,GAAA,CAAIU,IAAI,CAACD,KAAK,GAAG;IAC9DE,QAAA,EAAU,OAAOX,GAAA,CAAIU,IAAI,EAAEC,QAAA,KAAa,WAAWX,GAAA,CAAIU,IAAI,CAACC,QAAQ,GAAG;IACvEC,QAAA,EAAU,OAAOZ,GAAA,CAAIU,IAAI,EAAEE,QAAA,KAAa,WAAWZ,GAAA,CAAIU,IAAI,CAACE,QAAQ,GAAG;EACzE,IACA;IACEH,KAAA,EAAO,OAAOT,GAAA,CAAIU,IAAI,EAAED,KAAA,KAAU,WAAWT,GAAA,CAAIU,IAAI,CAACD,KAAK,GAAG;IAC9DE,QAAA,EAAU,OAAOX,GAAA,CAAIU,IAAI,EAAEC,QAAA,KAAa,WAAWX,GAAA,CAAIU,IAAI,CAACC,QAAQ,GAAG;EACzE;EAEN,MAAME,MAAA,GAAS,MAAMlB,cAAA,CAAe;IAClCI,UAAA;IACAW,IAAA,EAAML,QAAA;IACNF,KAAA,EAAOP,QAAA,CAASO,KAAA,IAASW,MAAA,CAAOX,KAAA,IAASY,SAAA;IACzCf;EACF;EAEA,MAAMgB,MAAA,GAAStB,qBAAA,CAAsB;IACnCuB,gBAAA,EAAkBlB,UAAA,CAAWO,MAAM;IACnCY,OAAA,EAASlB,GAAA,CAAIkB,OAAO;IACpBC,KAAA,EAAON,MAAA,CAAOM;EAChB;EAEA,IAAIpB,UAAA,CAAWO,MAAM,CAACC,IAAI,CAACa,wBAAwB,EAAE;IACnD,OAAOP,MAAA,CAAOM,KAAK;EACrB;EAEA,OAAOE,QAAA,CAASC,IAAI,CAClB;IACEC,OAAA,EAASrB,CAAA,CAAE;IACX,GAAGW;EACL,GACA;IACEW,OAAA,EAAS3B,eAAA,CAAgB;MACvB2B,OAAA,EAAS,IAAIC,OAAA,CAAQ;QACnB,cAAcT;MAChB;MACAhB;IACF;IACA0B,MAAA,EAAQjC,UAAA,CAAWkC;EACrB;AAEJ","ignoreList":[]}
1
+ {"version":3,"file":"login.js","names":["httpStatus","generatePayloadCookie","loginOperation","isNumber","headersWithCors","login","collection","req","searchParams","t","depth","get","authData","config","auth","loginWithUsername","email","data","password","username","result","Number","undefined","cookie","collectionAuthConfig","cookiePrefix","payload","token","removeTokenFromResponses","Response","json","message","headers","Headers","status","OK"],"sources":["../../../../src/routes/rest/auth/login.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, loginOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const login: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams, t } = req\n const depth = searchParams.get('depth')\n const authData =\n collection.config.auth?.loginWithUsername !== false\n ? {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n username: typeof req.data?.username === 'string' ? req.data.username : '',\n }\n : {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n }\n\n const result = await loginOperation({\n collection,\n data: authData,\n depth: isNumber(depth) ? Number(depth) : undefined,\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n token: result.token,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return Response.json(\n {\n message: t('authentication:passed'),\n ...result,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,qBAAqB,EAAEC,cAAc,QAAQ;AACtD,SAASC,QAAQ,QAAQ;AAIzB,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,KAAA,GAAgC,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EACrE,MAAM;IAAEC,YAAY;IAAEC;EAAC,CAAE,GAAGF,GAAA;EAC5B,MAAMG,KAAA,GAAQF,YAAA,CAAaG,GAAG,CAAC;EAC/B,MAAMC,QAAA,GACJN,UAAA,CAAWO,MAAM,CAACC,IAAI,EAAEC,iBAAA,KAAsB,Q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ChB;MACAhB;IACF;IACA2B,MAAA,EAAQlC,UAAA,CAAWmC;EACrB;AAEJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/logout.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,MAAM,EAAE,sBAwCpB,CAAA"}
1
+ {"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/logout.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,MAAM,EAAE,sBAyCpB,CAAA"}
@@ -25,8 +25,9 @@ export const logout = async ({
25
25
  });
26
26
  }
27
27
  const expiredCookie = generateExpiredPayloadCookie({
28
- collectionConfig: collection.config,
29
- payload: req.payload
28
+ collectionAuthConfig: collection.config.auth,
29
+ config: req.payload.config,
30
+ cookiePrefix: req.payload.config.cookiePrefix
30
31
  });
31
32
  headers.set('Set-Cookie', expiredCookie);
32
33
  return Response.json({
@@ -1 +1 @@
1
- {"version":3,"file":"logout.js","names":["httpStatus","generateExpiredPayloadCookie","logoutOperation","headersWithCors","logout","collection","req","t","result","headers","Headers","Response","json","message","status","BAD_REQUEST","expiredCookie","collectionConfig","config","payload","set","OK"],"sources":["../../../../src/routes/rest/auth/logout.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generateExpiredPayloadCookie, logoutOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const logout: CollectionRouteHandler = async ({ collection, req }) => {\n const { t } = req\n const result = await logoutOperation({\n collection,\n req,\n })\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n if (!result) {\n return Response.json(\n {\n message: t('error:logoutFailed'),\n },\n {\n headers,\n status: httpStatus.BAD_REQUEST,\n },\n )\n }\n\n const expiredCookie = generateExpiredPayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n })\n\n headers.set('Set-Cookie', expiredCookie)\n\n return Response.json(\n {\n message: t('authentication:logoutSuccessful'),\n },\n {\n headers,\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,4BAA4B,EAAEC,eAAe,QAAQ;AAI9D,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,MAAA,GAAiC,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EACtE,MAAM;IAAEC;EAAC,CAAE,GAAGD,GAAA;EACd,MAAME,MAAA,GAAS,MAAMN,eAAA,CAAgB;IACnCG,UAAA;IACAC;EACF;EAEA,MAAMG,OAAA,GAAUN,eAAA,CAAgB;IAC9BM,OAAA,EAAS,IAAIC,OAAA;IACbJ;EACF;EAEA,IAAI,CAACE,MAAA,EAAQ;IACX,OAAOG,QAAA,CAASC,IAAI,CAClB;MACEC,OAAA,EAASN,CAAA,CAAE;IACb,GACA;MACEE,OAAA;MACAK,MAAA,EAAQd,UAAA,CAAWe;IACrB;EAEJ;EAEA,MAAMC,aAAA,GAAgBf,4BAAA,CAA6B;IACjDgB,gBAAA,EAAkBZ,UAAA,CAAWa,MAAM;IACnCC,OAAA,EAASb,GAAA,CAAIa;EACf;EAEAV,OAAA,CAAQW,GAAG,CAAC,cAAcJ,aAAA;EAE1B,OAAOL,QAAA,CAASC,IAAI,CAClB;IACEC,OAAA,EAASN,CAAA,CAAE;EACb,GACA;IACEE,OAAA;IACAK,MAAA,EAAQd,UAAA,CAAWqB;EACrB;AAEJ","ignoreList":[]}
1
+ {"version":3,"file":"logout.js","names":["httpStatus","generateExpiredPayloadCookie","logoutOperation","headersWithCors","logout","collection","req","t","result","headers","Headers","Response","json","message","status","BAD_REQUEST","expiredCookie","collectionAuthConfig","config","auth","payload","cookiePrefix","set","OK"],"sources":["../../../../src/routes/rest/auth/logout.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generateExpiredPayloadCookie, logoutOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const logout: CollectionRouteHandler = async ({ collection, req }) => {\n const { t } = req\n const result = await logoutOperation({\n collection,\n req,\n })\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n if (!result) {\n return Response.json(\n {\n message: t('error:logoutFailed'),\n },\n {\n headers,\n status: httpStatus.BAD_REQUEST,\n },\n )\n }\n\n const expiredCookie = generateExpiredPayloadCookie({\n collectionAuthConfig: collection.config.auth,\n config: req.payload.config,\n cookiePrefix: req.payload.config.cookiePrefix,\n })\n\n headers.set('Set-Cookie', expiredCookie)\n\n return Response.json(\n {\n message: t('authentication:logoutSuccessful'),\n },\n {\n headers,\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,4BAA4B,EAAEC,eAAe,QAAQ;AAI9D,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,MAAA,GAAiC,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EACtE,MAAM;IAAEC;EAAC,CAAE,GAAGD,GAAA;EACd,MAAME,MAAA,GAAS,MAAMN,eAAA,CAAgB;IACnCG,UAAA;IACAC;EACF;EAEA,MAAMG,OAAA,GAAUN,eAAA,CAAgB;IAC9BM,OAAA,EAAS,IAAIC,OAAA;IACbJ;EACF;EAEA,IAAI,CAACE,MAAA,EAAQ;IACX,OAAOG,QAAA,CAASC,IAAI,CAClB;MACEC,OAAA,EAASN,CAAA,CAAE;IACb,GACA;MACEE,OAAA;MACAK,MAAA,EAAQd,UAAA,CAAWe;IACrB;EAEJ;EAEA,MAAMC,aAAA,GAAgBf,4BAAA,CAA6B;IACjDgB,oBAAA,EAAsBZ,UAAA,CAAWa,MAAM,CAACC,IAAI;IAC5CD,MAAA,EAAQZ,GAAA,CAAIc,OAAO,CAACF,MAAM;IAC1BG,YAAA,EAAcf,GAAA,CAAIc,OAAO,CAACF,MAAM,CAACG;EACnC;EAEAZ,OAAA,CAAQa,GAAG,CAAC,cAAcN,aAAA;EAE1B,OAAOL,QAAA,CAASC,IAAI,CAClB;IACEC,OAAA,EAASN,CAAA,CAAE;EACb,GACA;IACEE,OAAA;IACAK,MAAA,EAAQd,UAAA,CAAWuB;EACrB;AAEJ","ignoreList":[]}
@@ -18,8 +18,8 @@ export const refresh = async ({
18
18
  });
19
19
  if (result.setCookie) {
20
20
  const cookie = generatePayloadCookie({
21
- collectionConfig: collection.config,
22
- payload: req.payload,
21
+ collectionAuthConfig: collection.config.auth,
22
+ cookiePrefix: req.payload.config.cookiePrefix,
23
23
  token: result.refreshedToken
24
24
  });
25
25
  if (collection.config.auth.removeTokenFromResponses) {
@@ -1 +1 @@
1
- {"version":3,"file":"refresh.js","names":["httpStatus","generatePayloadCookie","refreshOperation","headersWithCors","refresh","collection","req","t","headers","Headers","result","setCookie","cookie","collectionConfig","config","payload","token","refreshedToken","auth","removeTokenFromResponses","set","Response","json","message","status","OK"],"sources":["../../../../src/routes/rest/auth/refresh.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, refreshOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const refresh: CollectionRouteHandler = async ({ collection, req }) => {\n const { t } = req\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n const result = await refreshOperation({\n collection,\n req,\n })\n\n if (result.setCookie) {\n const cookie = generatePayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n token: result.refreshedToken,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.refreshedToken\n }\n\n headers.set('Set-Cookie', cookie)\n }\n\n return Response.json(\n {\n message: t('authentication:tokenRefreshSuccessful'),\n ...result,\n },\n {\n headers,\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ;AAIxD,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,OAAA,GAAkC,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EACvE,MAAM;IAAEC;EAAC,CAAE,GAAGD,GAAA;EAEd,MAAME,OAAA,GAAUL,eAAA,CAAgB;IAC9BK,OAAA,EAAS,IAAIC,OAAA;IACbH;EACF;EAEA,MAAMI,MAAA,GAAS,MAAMR,gBAAA,CAAiB;IACpCG,UAAA;IACAC;EACF;EAEA,IAAII,MAAA,CAAOC,SAAS,EAAE;IACpB,MAAMC,MAAA,GAASX,qBAAA,CAAsB;MACnCY,gBAAA,EAAkBR,UAAA,CAAWS,MAAM;MACnCC,OAAA,EAAST,GAAA,CAAIS,OAAO;MACpBC,KAAA,EAAON,MAAA,CAAOO;IAChB;IAEA,IAAIZ,UAAA,CAAWS,MAAM,CAACI,IAAI,CAACC,wBAAwB,EAAE;MACnD,OAAOT,MAAA,CAAOO,cAAc;IAC9B;IAEAT,OAAA,CAAQY,GAAG,CAAC,cAAcR,MAAA;EAC5B;EAEA,OAAOS,QAAA,CAASC,IAAI,CAClB;IACEC,OAAA,EAAShB,CAAA,CAAE;IACX,GAAGG;EACL,GACA;IACEF,OAAA;IACAgB,MAAA,EAAQxB,UAAA,CAAWyB;EACrB;AAEJ","ignoreList":[]}
1
+ {"version":3,"file":"refresh.js","names":["httpStatus","generatePayloadCookie","refreshOperation","headersWithCors","refresh","collection","req","t","headers","Headers","result","setCookie","cookie","collectionAuthConfig","config","auth","cookiePrefix","payload","token","refreshedToken","removeTokenFromResponses","set","Response","json","message","status","OK"],"sources":["../../../../src/routes/rest/auth/refresh.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, refreshOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const refresh: CollectionRouteHandler = async ({ collection, req }) => {\n const { t } = req\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n const result = await refreshOperation({\n collection,\n req,\n })\n\n if (result.setCookie) {\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n token: result.refreshedToken,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.refreshedToken\n }\n\n headers.set('Set-Cookie', cookie)\n }\n\n return Response.json(\n {\n message: t('authentication:tokenRefreshSuccessful'),\n ...result,\n },\n {\n headers,\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ;AAIxD,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,OAAA,GAAkC,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EACvE,MAAM;IAAEC;EAAC,CAAE,GAAGD,GAAA;EAEd,MAAME,OAAA,GAAUL,eAAA,CAAgB;IAC9BK,OAAA,EAAS,IAAIC,OAAA;IACbH;EACF;EAEA,MAAMI,MAAA,GAAS,MAAMR,gBAAA,CAAiB;IACpCG,UAAA;IACAC;EACF;EAEA,IAAII,MAAA,CAAOC,SAAS,EAAE;IACpB,MAAMC,MAAA,GAASX,qBAAA,CAAsB;MACnCY,oBAAA,EAAsBR,UAAA,CAAWS,MAAM,CAACC,IAAI;MAC5CC,YAAA,EAAcV,GAAA,CAAIW,OAAO,CAACH,MAAM,CAACE,YAAY;MAC7CE,KAAA,EAAOR,MAAA,CAAOS;IAChB;IAEA,IAAId,UAAA,CAAWS,MAAM,CAACC,IAAI,CAACK,wBAAwB,EAAE;MACnD,OAAOV,MAAA,CAAOS,cAAc;IAC9B;IAEAX,OAAA,CAAQa,GAAG,CAAC,cAAcT,MAAA;EAC5B;EAEA,OAAOU,QAAA,CAASC,IAAI,CAClB;IACEC,OAAA,EAASjB,CAAA,CAAE;IACX,GAAGG;EACL,GACA;IACEF,OAAA;IACAiB,MAAA,EAAQzB,UAAA,CAAW0B;EACrB;AAEJ","ignoreList":[]}
@@ -26,8 +26,8 @@ export const registerFirstUser = async ({
26
26
  req
27
27
  });
28
28
  const cookie = generatePayloadCookie({
29
- collectionConfig: collection.config,
30
- payload: req.payload,
29
+ collectionAuthConfig: collection.config.auth,
30
+ cookiePrefix: req.payload.config.cookiePrefix,
31
31
  token: result.token
32
32
  });
33
33
  return Response.json({
@@ -1 +1 @@
1
- {"version":3,"file":"registerFirstUser.js","names":["httpStatus","generatePayloadCookie","registerFirstUserOperation","headersWithCors","registerFirstUser","collection","req","data","t","authData","config","auth","loginWithUsername","email","password","username","result","cookie","collectionConfig","payload","token","Response","json","exp","message","user","headers","Headers","status","OK"],"sources":["../../../../src/routes/rest/auth/registerFirstUser.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, registerFirstUserOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const registerFirstUser: CollectionRouteHandler = async ({ collection, req }) => {\n const { data, t } = req\n const authData = collection.config.auth?.loginWithUsername\n ? {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n username: typeof req.data?.username === 'string' ? req.data.username : '',\n }\n : {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n }\n\n const result = await registerFirstUserOperation({\n collection,\n data: {\n ...data,\n ...authData,\n },\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n token: result.token,\n })\n\n return Response.json(\n {\n exp: result.exp,\n message: t('authentication:successfullyRegisteredFirstUser'),\n token: result.token,\n user: result.user,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-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AChB;EAEA,OAAOC,QAAA,CAASC,IAAI,CAClB;IACEC,GAAA,EAAKP,MAAA,CAAOO,GAAG;IACfC,OAAA,EAAShB,CAAA,CAAE;IACXY,KAAA,EAAOJ,MAAA,CAAOI,KAAK;IACnBK,IAAA,EAAMT,MAAA,CAAOS;EACf,GACA;IACEC,OAAA,EAASvB,eAAA,CAAgB;MACvBuB,OAAA,EAAS,IAAIC,OAAA,CAAQ;QACnB,cAAcV;MAChB;MACAX;IACF;IACAsB,MAAA,EAAQ5B,UAAA,CAAW6B;EACrB;AAEJ","ignoreList":[]}
1
+ {"version":3,"file":"registerFirstUser.js","names":["httpStatus","generatePayloadCookie","registerFirstUserOperation","headersWithCors","registerFirstUser","collection","req","data","t","authData","config","auth","loginWithUsername","email","password","username","result","cookie","collectionAuthConfig","cookiePrefix","payload","token","Response","json","exp","message","user","headers","Headers","status","OK"],"sources":["../../../../src/routes/rest/auth/registerFirstUser.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, registerFirstUserOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const registerFirstUser: CollectionRouteHandler = async ({ collection, req }) => {\n const { data, t } = req\n const authData = collection.config.auth?.loginWithUsername\n ? {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n username: typeof req.data?.username === 'string' ? req.data.username : '',\n }\n : {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n }\n\n const result = await registerFirstUserOperation({\n collection,\n data: {\n ...data,\n ...authData,\n },\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n token: result.token,\n })\n\n return Response.json(\n {\n exp: result.exp,\n message: t('authentication:successfullyRegisteredFirstUser'),\n token: result.token,\n user: result.user,\n },\n {\n head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AAIc,OAAO,CAACV,MAAM,CAACS,YAAY;IAC7CE,KAAA,EAAOL,MAAA,CAAOK;EAChB;EAEA,OAAOC,QAAA,CAASC,IAAI,CAClB;IACEC,GAAA,EAAKR,MAAA,CAAOQ,GAAG;IACfC,OAAA,EAASjB,CAAA,CAAE;IACXa,KAAA,EAAOL,MAAA,CAAOK,KAAK;IACnBK,IAAA,EAAMV,MAAA,CAAOU;EACf,GACA;IACEC,OAAA,EAASxB,eAAA,CAAgB;MACvBwB,OAAA,EAAS,IAAIC,OAAA,CAAQ;QACnB,cAAcX;MAChB;MACAX;IACF;IACAuB,MAAA,EAAQ7B,UAAA,CAAW8B;EACrB;AAEJ","ignoreList":[]}
@@ -20,8 +20,8 @@ export const resetPassword = async ({
20
20
  req
21
21
  });
22
22
  const cookie = generatePayloadCookie({
23
- collectionConfig: collection.config,
24
- payload: req.payload,
23
+ collectionAuthConfig: collection.config.auth,
24
+ cookiePrefix: req.payload.config.cookiePrefix,
25
25
  token: result.token
26
26
  });
27
27
  if (collection.config.auth.removeTokenFromResponses) {
@@ -1 +1 @@
1
- {"version":3,"file":"resetPassword.js","names":["httpStatus","generatePayloadCookie","resetPasswordOperation","headersWithCors","resetPassword","collection","req","searchParams","t","depth","get","result","data","password","token","Number","undefined","cookie","collectionConfig","config","payload","auth","removeTokenFromResponses","Response","json","message","headers","Headers","status","OK"],"sources":["../../../../src/routes/rest/auth/resetPassword.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, resetPasswordOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const resetPassword: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams, t } = req\n const depth = searchParams.get('depth')\n\n const result = await resetPasswordOperation({\n collection,\n data: {\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n token: typeof req.data?.token === 'string' ? req.data.token : '',\n },\n depth: depth ? Number(depth) : undefined,\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n token: result.token,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return Response.json(\n {\n message: t('authentication:passwordResetSuccessfully'),\n ...result,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,qBAAqB,EAAEC,sBAAsB,QAAQ;AAI9D,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,aAAA,GAAwC,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EAC7E,MAAM;IAAEC,YAAY;IAAEC;EAAC,CAAE,GAAGF,GAAA;EAC5B,MAAMG,KAAA,GAAQF,YAAA,CAAaG,GAAG,CAAC;EAE/B,MAAMC,MAAA,GAAS,MAAMT,sBAAA,CAAuB;IAC1CG,UAAA;IACAO,IAAA,EAAM;MACJC,QAAA,EAAU,OAAOP,GAAA,CAAIM,IAAI,EAAEC,QAAA,KAAa,WAAWP,GAAA,CAAIM,IAAI,CAACC,QAAQ,GAAG;MACvEC,KAAA,EAAO,OAAOR,GAAA,CAAIM,IAAI,EAAEE,KAAA,KAAU,WAAWR,GAAA,CAAIM,IAAI,CAACE,KAAK,GAAG;IAChE;IACAL,KAAA,EAAOA,KAAA,GAAQM,MAAA,CAAON,KAAA,IAASO,SAAA;IAC/BV;EACF;EAEA,MAAMW,MAAA,GAAShB,qBAAA,CAAsB;IACnCiB,gBAAA,EAAkBb,UAAA,CAAWc,MAAM;IACnCC,OAAA,EAASd,GAAA,CAAIc,OAAO;IACpBN,KAAA,EAAOH,MAAA,CAAOG;EAChB;EAEA,IAAIT,UAAA,CAAWc,MAAM,CAACE,IAAI,CAACC,wBAAwB,EAAE;IACnD,OAAOX,MAAA,CAAOG,KAAK;EACrB;EAEA,OAAOS,QAAA,CAASC,IAAI,CAClB;IACEC,OAAA,EAASjB,CAAA,CAAE;IACX,GAAGG;EACL,GACA;IACEe,OAAA,EAASvB,eAAA,CAAgB;MACvBuB,OAAA,EAAS,IAAIC,OAAA,CAAQ;QACnB,cAAcV;MAChB;MACAX;IACF;IACAsB,MAAA,EAAQ5B,UAAA,CAAW6B;EACrB;AAEJ","ignoreList":[]}
1
+ {"version":3,"file":"resetPassword.js","names":["httpStatus","generatePayloadCookie","resetPasswordOperation","headersWithCors","resetPassword","collection","req","searchParams","t","depth","get","result","data","password","token","Number","undefined","cookie","collectionAuthConfig","config","auth","cookiePrefix","payload","removeTokenFromResponses","Response","json","message","headers","Headers","status","OK"],"sources":["../../../../src/routes/rest/auth/resetPassword.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, resetPasswordOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const resetPassword: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams, t } = req\n const depth = searchParams.get('depth')\n\n const result = await resetPasswordOperation({\n collection,\n data: {\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n token: typeof req.data?.token === 'string' ? req.data.token : '',\n },\n depth: depth ? Number(depth) : undefined,\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n token: result.token,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return Response.json(\n {\n message: t('authentication:passwordResetSuccessfully'),\n ...result,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,qBAAqB,EAAEC,sBAAsB,QAAQ;AAI9D,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,aAAA,GAAwC,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EAC7E,MAAM;IAAEC,YAAY;IAAEC;EAAC,CAAE,GAAGF,GAAA;EAC5B,MAAMG,KAAA,GAAQF,YAAA,CAAaG,GAAG,CAAC;EAE/B,MAAMC,MAAA,GAAS,MAAMT,sBAAA,CAAuB;IAC1CG,UAAA;IACAO,IAAA,EAAM;MACJC,QAAA,EAAU,OAAOP,GAAA,CAAIM,IAAI,EAAEC,QAAA,KAAa,WAAWP,GAAA,CAAIM,IAAI,CAACC,QAAQ,GAAG;MACvEC,KAAA,EAAO,OAAOR,GAAA,CAAIM,IAAI,EAAEE,KAAA,KAAU,WAAWR,GAAA,CAAIM,IAAI,CAACE,KAAK,GAAG;IAChE;IACAL,KAAA,EAAOA,KAAA,GAAQM,MAAA,CAAON,KAAA,IAASO,SAAA;IAC/BV;EACF;EAEA,MAAMW,MAAA,GAAShB,qBAAA,CAAsB;IACnCiB,oBAAA,EAAsBb,UAAA,CAAWc,MAAM,CAACC,IAAI;IAC5CC,YAAA,EAAcf,GAAA,CAAIgB,OAAO,CAACH,MAAM,CAACE,YAAY;IAC7CP,KAAA,EAAOH,MAAA,CAAOG;EAChB;EAEA,IAAIT,UAAA,CAAWc,MAAM,CAACC,IAAI,CAACG,wBAAwB,EAAE;IACnD,OAAOZ,MAAA,CAAOG,KAAK;EACrB;EAEA,OAAOU,QAAA,CAASC,IAAI,CAClB;IACEC,OAAA,EAASlB,CAAA,CAAE;IACX,GAAGG;EACL,GACA;IACEgB,OAAA,EAASxB,eAAA,CAAgB;MACvBwB,OAAA,EAAS,IAAIC,OAAA,CAAQ;QACnB,cAAcX;MAChB;MACAX;IACF;IACAuB,MAAA,EAAQ7B,UAAA,CAAW8B;EACrB;AAEJ","ignoreList":[]}
@@ -1,203 +1,207 @@
1
+ @layer payload-default, payload;
2
+
1
3
  @import 'styles';
2
4
  @import './toasts.scss';
3
5
  @import './colors.scss';
4
6
 
5
- :root {
6
- --base-px: 20;
7
- --base-body-size: 13;
8
- --base: calc((var(--base-px) / var(--base-body-size)) * 1rem);
9
-
10
- --breakpoint-xs-width: #{$breakpoint-xs-width};
11
- --breakpoint-s-width: #{$breakpoint-s-width};
12
- --breakpoint-m-width: #{$breakpoint-m-width};
13
- --breakpoint-l-width: #{$breakpoint-l-width};
14
- --scrollbar-width: 17px;
15
-
16
- --theme-bg: var(--theme-elevation-0);
17
- --theme-input-bg: var(--theme-elevation-0);
18
- --theme-text: var(--theme-elevation-800);
19
- --theme-overlay: rgba(5, 5, 5, 0.5);
20
- --theme-baseline: #{$baseline-px};
21
- --theme-baseline-body-size: #{$baseline-body-size};
22
- --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
23
- sans-serif;
24
- --font-serif: 'Georgia', 'Bitstream Charter', 'Charis SIL', Utopia, 'URW Bookman L', serif;
25
- --font-mono: 'SF Mono', Menlo, Consolas, Monaco, monospace;
26
-
27
- --style-radius-s: #{$style-radius-s};
28
- --style-radius-m: #{$style-radius-m};
29
- --style-radius-l: #{$style-radius-l};
30
-
31
- --z-popup: 10;
32
- --z-nav: 20;
33
- --z-modal: 30;
34
- --z-status: 40;
35
-
36
- --accessibility-outline: 2px solid var(--theme-text);
37
- --accessibility-outline-offset: 2px;
38
-
39
- --gutter-h: #{base(3)};
40
- --spacing-view-bottom: var(--gutter-h);
41
- --doc-controls-height: calc(var(--base) * 2.8);
42
- --app-header-height: calc(var(--base) * 2.8);
43
- --nav-width: 275px;
44
- --nav-trans-time: 150ms;
45
-
46
- @include mid-break {
47
- --gutter-h: #{base(2)};
48
- --app-header-height: calc(var(--base) * 2.4);
49
- --doc-controls-height: calc(var(--base) * 2.4);
50
- }
51
-
52
- @include small-break {
53
- --gutter-h: #{base(0.8)};
54
- --spacing-view-bottom: calc(var(--base) * 2);
55
- --nav-width: 100vw;
56
- }
57
- }
7
+ @layer payload-default {
8
+ :root {
9
+ --base-px: 20;
10
+ --base-body-size: 13;
11
+ --base: calc((var(--base-px) / var(--base-body-size)) * 1rem);
58
12
 
59
- /////////////////////////////
60
- // GLOBAL STYLES
61
- /////////////////////////////
13
+ --breakpoint-xs-width: #{$breakpoint-xs-width};
14
+ --breakpoint-s-width: #{$breakpoint-s-width};
15
+ --breakpoint-m-width: #{$breakpoint-m-width};
16
+ --breakpoint-l-width: #{$breakpoint-l-width};
17
+ --scrollbar-width: 17px;
62
18
 
63
- * {
64
- box-sizing: border-box;
65
- }
19
+ --theme-bg: var(--theme-elevation-0);
20
+ --theme-input-bg: var(--theme-elevation-0);
21
+ --theme-text: var(--theme-elevation-800);
22
+ --theme-overlay: rgba(5, 5, 5, 0.5);
23
+ --theme-baseline: #{$baseline-px};
24
+ --theme-baseline-body-size: #{$baseline-body-size};
25
+ --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
26
+ sans-serif;
27
+ --font-serif: 'Georgia', 'Bitstream Charter', 'Charis SIL', Utopia, 'URW Bookman L', serif;
28
+ --font-mono: 'SF Mono', Menlo, Consolas, Monaco, monospace;
29
+
30
+ --style-radius-s: #{$style-radius-s};
31
+ --style-radius-m: #{$style-radius-m};
32
+ --style-radius-l: #{$style-radius-l};
33
+
34
+ --z-popup: 10;
35
+ --z-nav: 20;
36
+ --z-modal: 30;
37
+ --z-status: 40;
38
+
39
+ --accessibility-outline: 2px solid var(--theme-text);
40
+ --accessibility-outline-offset: 2px;
41
+
42
+ --gutter-h: #{base(3)};
43
+ --spacing-view-bottom: var(--gutter-h);
44
+ --doc-controls-height: calc(var(--base) * 2.8);
45
+ --app-header-height: calc(var(--base) * 2.8);
46
+ --nav-width: 275px;
47
+ --nav-trans-time: 150ms;
48
+
49
+ @include mid-break {
50
+ --gutter-h: #{base(2)};
51
+ --app-header-height: calc(var(--base) * 2.4);
52
+ --doc-controls-height: calc(var(--base) * 2.4);
53
+ }
66
54
 
67
- html {
68
- @extend %body;
69
- background: var(--theme-bg);
70
- -webkit-font-smoothing: antialiased;
55
+ @include small-break {
56
+ --gutter-h: #{base(0.8)};
57
+ --spacing-view-bottom: calc(var(--base) * 2);
58
+ --nav-width: 100vw;
59
+ }
60
+ }
71
61
 
72
- &[data-theme='dark'] {
73
- --theme-bg: var(--theme-elevation-0);
74
- --theme-text: var(--theme-elevation-1000);
75
- --theme-input-bg: var(--theme-elevation-50);
76
- --theme-overlay: rgba(5, 5, 5, 0.75);
77
- color-scheme: dark;
62
+ /////////////////////////////
63
+ // GLOBAL STYLES
64
+ /////////////////////////////
65
+
66
+ * {
67
+ box-sizing: border-box;
68
+ }
78
69
 
79
- ::selection {
80
- color: var(--color-base-1000);
70
+ html {
71
+ @extend %body;
72
+ background: var(--theme-bg);
73
+ -webkit-font-smoothing: antialiased;
74
+
75
+ &[data-theme='dark'] {
76
+ --theme-bg: var(--theme-elevation-0);
77
+ --theme-text: var(--theme-elevation-1000);
78
+ --theme-input-bg: var(--theme-elevation-50);
79
+ --theme-overlay: rgba(5, 5, 5, 0.75);
80
+ color-scheme: dark;
81
+
82
+ ::selection {
83
+ color: var(--color-base-1000);
84
+ }
85
+
86
+ ::-moz-selection {
87
+ color: var(--color-base-1000);
88
+ }
81
89
  }
82
90
 
83
- ::-moz-selection {
84
- color: var(--color-base-1000);
91
+ @include mid-break {
92
+ font-size: 12px;
85
93
  }
86
94
  }
87
95
 
88
- @include mid-break {
89
- font-size: 12px;
96
+ html,
97
+ body,
98
+ #app {
99
+ height: 100%;
90
100
  }
91
- }
92
101
 
93
- html,
94
- body,
95
- #app {
96
- height: 100%;
97
- }
102
+ body {
103
+ font-family: var(--font-body);
104
+ font-weight: 400;
105
+ color: var(--theme-text);
106
+ margin: 0;
107
+ // this is for the nav to be able to push the document over
108
+ overflow-x: hidden;
109
+ }
98
110
 
99
- body {
100
- font-family: var(--font-body);
101
- font-weight: 400;
102
- color: var(--theme-text);
103
- margin: 0;
104
- // this is for the nav to be able to push the document over
105
- overflow-x: hidden;
106
- }
111
+ ::selection {
112
+ background: var(--color-success-250);
113
+ color: var(--theme-base-800);
114
+ }
107
115
 
108
- ::selection {
109
- background: var(--color-success-250);
110
- color: var(--theme-base-800);
111
- }
116
+ ::-moz-selection {
117
+ background: var(--color-success-250);
118
+ color: var(--theme-base-800);
119
+ }
112
120
 
113
- ::-moz-selection {
114
- background: var(--color-success-250);
115
- color: var(--theme-base-800);
116
- }
121
+ img {
122
+ max-width: 100%;
123
+ height: auto;
124
+ display: block;
125
+ }
117
126
 
118
- img {
119
- max-width: 100%;
120
- height: auto;
121
- display: block;
122
- }
127
+ h1 {
128
+ @extend %h1;
129
+ }
123
130
 
124
- h1 {
125
- @extend %h1;
126
- }
131
+ h2 {
132
+ @extend %h2;
133
+ }
127
134
 
128
- h2 {
129
- @extend %h2;
130
- }
135
+ h3 {
136
+ @extend %h3;
137
+ }
131
138
 
132
- h3 {
133
- @extend %h3;
134
- }
139
+ h4 {
140
+ @extend %h4;
141
+ }
135
142
 
136
- h4 {
137
- @extend %h4;
138
- }
143
+ h5 {
144
+ @extend %h5;
145
+ }
139
146
 
140
- h5 {
141
- @extend %h5;
142
- }
147
+ h6 {
148
+ @extend %h6;
149
+ }
143
150
 
144
- h6 {
145
- @extend %h6;
146
- }
151
+ p {
152
+ margin: 0;
153
+ }
147
154
 
148
- p {
149
- margin: 0;
150
- }
155
+ ul,
156
+ ol {
157
+ padding-left: $baseline;
158
+ margin: 0;
159
+ }
151
160
 
152
- ul,
153
- ol {
154
- padding-left: $baseline;
155
- margin: 0;
156
- }
161
+ :focus-visible {
162
+ outline: var(--accessibility-outline);
163
+ }
157
164
 
158
- :focus-visible {
159
- outline: var(--accessibility-outline);
160
- }
165
+ a {
166
+ color: currentColor;
161
167
 
162
- a {
163
- color: currentColor;
168
+ &:focus {
169
+ &:not(:focus-visible) {
170
+ opacity: 0.8;
171
+ }
172
+ outline: none;
173
+ }
164
174
 
165
- &:focus {
166
- &:not(:focus-visible) {
167
- opacity: 0.8;
175
+ &:active {
176
+ opacity: 0.7;
177
+ outline: none;
168
178
  }
169
- outline: none;
170
179
  }
171
180
 
172
- &:active {
173
- opacity: 0.7;
174
- outline: none;
181
+ svg {
182
+ vertical-align: middle;
175
183
  }
176
- }
177
184
 
178
- svg {
179
- vertical-align: middle;
180
- }
185
+ dialog {
186
+ width: 100%;
187
+ border: 0;
188
+ padding: 0;
189
+ color: currentColor;
190
+ }
181
191
 
182
- dialog {
183
- width: 100%;
184
- border: 0;
185
- padding: 0;
186
- color: currentColor;
187
- }
192
+ .payload__modal-item {
193
+ min-height: 100%;
194
+ background: transparent;
195
+ }
188
196
 
189
- .payload__modal-item {
190
- min-height: 100%;
191
- background: transparent;
192
- }
197
+ .payload__modal-container--enterDone {
198
+ overflow: auto;
199
+ }
193
200
 
194
- .payload__modal-container--enterDone {
195
- overflow: auto;
196
- }
201
+ .payload__modal-item--enter,
202
+ .payload__modal-item--enterDone {
203
+ z-index: var(--z-modal);
204
+ }
197
205
 
198
- .payload__modal-item--enter,
199
- .payload__modal-item--enterDone {
200
- z-index: var(--z-modal);
206
+ // @import '~payload-user-css'; TODO: re-enable this
201
207
  }
202
-
203
- // @import '~payload-user-css'; TODO: re-enable this