@payloadcms/next 3.0.0-alpha.7 → 3.0.0-alpha.70

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 (1221) hide show
  1. package/dist/cjs/withPayload.cjs +96 -0
  2. package/dist/cjs/withPayload.cjs.map +1 -0
  3. package/dist/config.js +2 -12
  4. package/dist/config.js.map +1 -0
  5. package/dist/elements/LeaveWithoutSaving/index.js +25 -76
  6. package/dist/elements/LeaveWithoutSaving/index.js.map +1 -0
  7. package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts.map +1 -1
  8. package/dist/elements/LeaveWithoutSaving/usePreventLeave.js +11 -29
  9. package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +1 -0
  10. package/dist/exports/layouts.d.ts +2 -0
  11. package/dist/exports/layouts.d.ts.map +1 -0
  12. package/dist/exports/layouts.js +3 -0
  13. package/dist/exports/layouts.js.map +1 -0
  14. package/dist/exports/routes.d.ts +3 -0
  15. package/dist/exports/routes.d.ts.map +1 -0
  16. package/dist/exports/routes.js +4 -0
  17. package/dist/exports/routes.js.map +1 -0
  18. package/dist/exports/utilities.d.ts +9 -0
  19. package/dist/exports/utilities.d.ts.map +1 -0
  20. package/dist/exports/utilities.js +10 -0
  21. package/dist/exports/utilities.js.map +1 -0
  22. package/dist/exports/views.d.ts +4 -0
  23. package/dist/exports/views.d.ts.map +1 -0
  24. package/dist/exports/views.js +5 -0
  25. package/dist/exports/views.js.map +1 -0
  26. package/dist/fetchAPI-multipart/fileFactory.d.ts +16 -0
  27. package/dist/fetchAPI-multipart/fileFactory.d.ts.map +1 -0
  28. package/dist/fetchAPI-multipart/fileFactory.js +43 -0
  29. package/dist/fetchAPI-multipart/fileFactory.js.map +1 -0
  30. package/dist/fetchAPI-multipart/handlers.d.ts +15 -0
  31. package/dist/fetchAPI-multipart/handlers.d.ts.map +1 -0
  32. package/dist/fetchAPI-multipart/handlers.js +86 -0
  33. package/dist/fetchAPI-multipart/handlers.js.map +1 -0
  34. package/dist/fetchAPI-multipart/index.d.ts +135 -0
  35. package/dist/fetchAPI-multipart/index.d.ts.map +1 -0
  36. package/dist/fetchAPI-multipart/index.js +43 -0
  37. package/dist/fetchAPI-multipart/index.js.map +1 -0
  38. package/dist/fetchAPI-multipart/isEligibleRequest.d.ts.map +1 -0
  39. package/dist/fetchAPI-multipart/isEligibleRequest.js +26 -0
  40. package/dist/fetchAPI-multipart/isEligibleRequest.js.map +1 -0
  41. package/dist/fetchAPI-multipart/processMultipart.d.ts +8 -0
  42. package/dist/fetchAPI-multipart/processMultipart.d.ts.map +1 -0
  43. package/dist/fetchAPI-multipart/processMultipart.js +156 -0
  44. package/dist/fetchAPI-multipart/processMultipart.js.map +1 -0
  45. package/dist/fetchAPI-multipart/processNested.d.ts.map +1 -0
  46. package/dist/fetchAPI-multipart/processNested.js +25 -0
  47. package/dist/fetchAPI-multipart/processNested.js.map +1 -0
  48. package/dist/fetchAPI-multipart/uploadTimer.d.ts.map +1 -0
  49. package/dist/fetchAPI-multipart/uploadTimer.js +19 -0
  50. package/dist/fetchAPI-multipart/uploadTimer.js.map +1 -0
  51. package/dist/fetchAPI-multipart/utilities.d.ts +65 -0
  52. package/dist/fetchAPI-multipart/utilities.d.ts.map +1 -0
  53. package/dist/fetchAPI-multipart/utilities.js +207 -0
  54. package/dist/fetchAPI-multipart/utilities.js.map +1 -0
  55. package/dist/fetchAPI-stream-file/index.d.ts +6 -0
  56. package/dist/fetchAPI-stream-file/index.d.ts.map +1 -0
  57. package/dist/fetchAPI-stream-file/index.js +25 -0
  58. package/dist/fetchAPI-stream-file/index.js.map +1 -0
  59. package/dist/index.js +3 -35
  60. package/dist/index.js.map +1 -0
  61. package/dist/layouts/Root/index.d.ts.map +1 -1
  62. package/dist/layouts/Root/index.js +83 -76
  63. package/dist/layouts/Root/index.js.map +1 -0
  64. package/dist/prod/payload/favicon.svg +15 -0
  65. package/dist/prod/payload/og-image.png +0 -0
  66. package/dist/prod/styles.css +1 -0
  67. package/dist/routes/graphql/handler.d.ts.map +1 -1
  68. package/dist/routes/graphql/handler.js +37 -41
  69. package/dist/routes/graphql/handler.js.map +1 -0
  70. package/dist/routes/graphql/index.d.ts +2 -2
  71. package/dist/routes/graphql/index.d.ts.map +1 -1
  72. package/dist/routes/graphql/index.js +3 -21
  73. package/dist/routes/graphql/index.js.map +1 -0
  74. package/dist/routes/graphql/playground.js +6 -16
  75. package/dist/routes/graphql/playground.js.map +1 -0
  76. package/dist/routes/index.d.ts +2 -3
  77. package/dist/routes/index.d.ts.map +1 -1
  78. package/dist/routes/index.js +3 -37
  79. package/dist/routes/index.js.map +1 -0
  80. package/dist/routes/rest/auth/access.d.ts +1 -1
  81. package/dist/routes/rest/auth/access.d.ts.map +1 -1
  82. package/dist/routes/rest/auth/access.js +11 -21
  83. package/dist/routes/rest/auth/access.js.map +1 -0
  84. package/dist/routes/rest/auth/forgotPassword.d.ts +1 -1
  85. package/dist/routes/rest/auth/forgotPassword.d.ts.map +1 -1
  86. package/dist/routes/rest/auth/forgotPassword.js +13 -23
  87. package/dist/routes/rest/auth/forgotPassword.js.map +1 -0
  88. package/dist/routes/rest/auth/init.d.ts +1 -1
  89. package/dist/routes/rest/auth/init.d.ts.map +1 -1
  90. package/dist/routes/rest/auth/init.js +10 -14
  91. package/dist/routes/rest/auth/init.js.map +1 -0
  92. package/dist/routes/rest/auth/login.d.ts +1 -1
  93. package/dist/routes/rest/auth/login.d.ts.map +1 -1
  94. package/dist/routes/rest/auth/login.js +18 -30
  95. package/dist/routes/rest/auth/login.js.map +1 -0
  96. package/dist/routes/rest/auth/logout.d.ts +1 -1
  97. package/dist/routes/rest/auth/logout.d.ts.map +1 -1
  98. package/dist/routes/rest/auth/logout.js +20 -30
  99. package/dist/routes/rest/auth/logout.js.map +1 -0
  100. package/dist/routes/rest/auth/me.d.ts +1 -1
  101. package/dist/routes/rest/auth/me.d.ts.map +1 -1
  102. package/dist/routes/rest/auth/me.js +13 -23
  103. package/dist/routes/rest/auth/me.js.map +1 -0
  104. package/dist/routes/rest/auth/refresh.d.ts +1 -1
  105. package/dist/routes/rest/auth/refresh.d.ts.map +1 -1
  106. package/dist/routes/rest/auth/refresh.js +22 -32
  107. package/dist/routes/rest/auth/refresh.js.map +1 -0
  108. package/dist/routes/rest/auth/registerFirstUser.d.ts +1 -1
  109. package/dist/routes/rest/auth/registerFirstUser.d.ts.map +1 -1
  110. package/dist/routes/rest/auth/registerFirstUser.js +19 -29
  111. package/dist/routes/rest/auth/registerFirstUser.js.map +1 -0
  112. package/dist/routes/rest/auth/resetPassword.d.ts +1 -1
  113. package/dist/routes/rest/auth/resetPassword.d.ts.map +1 -1
  114. package/dist/routes/rest/auth/resetPassword.js +16 -28
  115. package/dist/routes/rest/auth/resetPassword.js.map +1 -0
  116. package/dist/routes/rest/auth/unlock.d.ts +1 -1
  117. package/dist/routes/rest/auth/unlock.d.ts.map +1 -1
  118. package/dist/routes/rest/auth/unlock.js +13 -23
  119. package/dist/routes/rest/auth/unlock.js.map +1 -0
  120. package/dist/routes/rest/auth/verifyEmail.d.ts +1 -1
  121. package/dist/routes/rest/auth/verifyEmail.d.ts.map +1 -1
  122. package/dist/routes/rest/auth/verifyEmail.js +13 -23
  123. package/dist/routes/rest/auth/verifyEmail.js.map +1 -0
  124. package/dist/routes/rest/buildFormState.d.ts +4 -4
  125. package/dist/routes/rest/buildFormState.d.ts.map +1 -1
  126. package/dist/routes/rest/buildFormState.js +179 -80
  127. package/dist/routes/rest/buildFormState.js.map +1 -0
  128. package/dist/routes/rest/checkEndpoints.d.ts.map +1 -1
  129. package/dist/routes/rest/checkEndpoints.js +4 -19
  130. package/dist/routes/rest/checkEndpoints.js.map +1 -0
  131. package/dist/routes/rest/collections/count.d.ts +3 -0
  132. package/dist/routes/rest/collections/count.d.ts.map +1 -0
  133. package/dist/routes/rest/collections/count.js +15 -0
  134. package/dist/routes/rest/collections/count.js.map +1 -0
  135. package/dist/routes/rest/collections/create.d.ts +1 -1
  136. package/dist/routes/rest/collections/create.d.ts.map +1 -1
  137. package/dist/routes/rest/collections/create.js +15 -24
  138. package/dist/routes/rest/collections/create.js.map +1 -0
  139. package/dist/routes/rest/collections/delete.d.ts +1 -1
  140. package/dist/routes/rest/collections/delete.d.ts.map +1 -1
  141. package/dist/routes/rest/collections/delete.js +20 -31
  142. package/dist/routes/rest/collections/delete.js.map +1 -0
  143. package/dist/routes/rest/collections/deleteByID.d.ts +1 -1
  144. package/dist/routes/rest/collections/deleteByID.d.ts.map +1 -1
  145. package/dist/routes/rest/collections/deleteByID.js +22 -24
  146. package/dist/routes/rest/collections/deleteByID.js.map +1 -0
  147. package/dist/routes/rest/collections/docAccess.d.ts +1 -1
  148. package/dist/routes/rest/collections/docAccess.d.ts.map +1 -1
  149. package/dist/routes/rest/collections/docAccess.js +11 -21
  150. package/dist/routes/rest/collections/docAccess.js.map +1 -0
  151. package/dist/routes/rest/collections/duplicate.d.ts +3 -0
  152. package/dist/routes/rest/collections/duplicate.d.ts.map +1 -0
  153. package/dist/routes/rest/collections/duplicate.js +39 -0
  154. package/dist/routes/rest/collections/duplicate.js.map +1 -0
  155. package/dist/routes/rest/collections/find.d.ts +1 -1
  156. package/dist/routes/rest/collections/find.d.ts.map +1 -1
  157. package/dist/routes/rest/collections/find.js +16 -29
  158. package/dist/routes/rest/collections/find.js.map +1 -0
  159. package/dist/routes/rest/collections/findByID.d.ts +1 -1
  160. package/dist/routes/rest/collections/findByID.d.ts.map +1 -1
  161. package/dist/routes/rest/collections/findByID.js +19 -23
  162. package/dist/routes/rest/collections/findByID.js.map +1 -0
  163. package/dist/routes/rest/collections/findVersionByID.d.ts +1 -1
  164. package/dist/routes/rest/collections/findVersionByID.d.ts.map +1 -1
  165. package/dist/routes/rest/collections/findVersionByID.js +19 -23
  166. package/dist/routes/rest/collections/findVersionByID.js.map +1 -0
  167. package/dist/routes/rest/collections/findVersions.d.ts +1 -1
  168. package/dist/routes/rest/collections/findVersions.d.ts.map +1 -1
  169. package/dist/routes/rest/collections/findVersions.js +16 -29
  170. package/dist/routes/rest/collections/findVersions.js.map +1 -0
  171. package/dist/routes/rest/collections/preview.d.ts +3 -0
  172. package/dist/routes/rest/collections/preview.d.ts.map +1 -0
  173. package/dist/routes/rest/collections/preview.js +45 -0
  174. package/dist/routes/rest/collections/preview.js.map +1 -0
  175. package/dist/routes/rest/collections/restoreVersion.d.ts +1 -1
  176. package/dist/routes/rest/collections/restoreVersion.d.ts.map +1 -1
  177. package/dist/routes/rest/collections/restoreVersion.js +19 -23
  178. package/dist/routes/rest/collections/restoreVersion.js.map +1 -0
  179. package/dist/routes/rest/collections/update.d.ts +1 -1
  180. package/dist/routes/rest/collections/update.d.ts.map +1 -1
  181. package/dist/routes/rest/collections/update.js +20 -31
  182. package/dist/routes/rest/collections/update.js.map +1 -0
  183. package/dist/routes/rest/collections/updateByID.d.ts +1 -1
  184. package/dist/routes/rest/collections/updateByID.d.ts.map +1 -1
  185. package/dist/routes/rest/collections/updateByID.js +19 -23
  186. package/dist/routes/rest/collections/updateByID.js.map +1 -0
  187. package/dist/routes/rest/files/checkFileAccess.d.ts +7 -0
  188. package/dist/routes/rest/files/checkFileAccess.d.ts.map +1 -0
  189. package/dist/routes/rest/files/checkFileAccess.js +50 -0
  190. package/dist/routes/rest/files/checkFileAccess.js.map +1 -0
  191. package/dist/routes/rest/files/getFile.d.ts +9 -0
  192. package/dist/routes/rest/files/getFile.d.ts.map +1 -0
  193. package/dist/routes/rest/files/getFile.js +59 -0
  194. package/dist/routes/rest/files/getFile.js.map +1 -0
  195. package/dist/routes/rest/files/getFileTypeFallback.d.ts +7 -0
  196. package/dist/routes/rest/files/getFileTypeFallback.d.ts.map +1 -0
  197. package/dist/routes/rest/files/getFileTypeFallback.js +21 -0
  198. package/dist/routes/rest/files/getFileTypeFallback.js.map +1 -0
  199. package/dist/routes/rest/globals/docAccess.d.ts +1 -1
  200. package/dist/routes/rest/globals/docAccess.d.ts.map +1 -1
  201. package/dist/routes/rest/globals/docAccess.js +11 -21
  202. package/dist/routes/rest/globals/docAccess.js.map +1 -0
  203. package/dist/routes/rest/globals/findOne.d.ts +1 -1
  204. package/dist/routes/rest/globals/findOne.d.ts.map +1 -1
  205. package/dist/routes/rest/globals/findOne.js +15 -25
  206. package/dist/routes/rest/globals/findOne.js.map +1 -0
  207. package/dist/routes/rest/globals/findVersionByID.d.ts +1 -1
  208. package/dist/routes/rest/globals/findVersionByID.d.ts.map +1 -1
  209. package/dist/routes/rest/globals/findVersionByID.js +13 -23
  210. package/dist/routes/rest/globals/findVersionByID.js.map +1 -0
  211. package/dist/routes/rest/globals/findVersions.d.ts +1 -1
  212. package/dist/routes/rest/globals/findVersions.d.ts.map +1 -1
  213. package/dist/routes/rest/globals/findVersions.js +16 -29
  214. package/dist/routes/rest/globals/findVersions.js.map +1 -0
  215. package/dist/routes/rest/globals/preview.d.ts +3 -0
  216. package/dist/routes/rest/globals/preview.d.ts.map +1 -0
  217. package/dist/routes/rest/globals/preview.js +44 -0
  218. package/dist/routes/rest/globals/preview.js.map +1 -0
  219. package/dist/routes/rest/globals/restoreVersion.d.ts +1 -1
  220. package/dist/routes/rest/globals/restoreVersion.d.ts.map +1 -1
  221. package/dist/routes/rest/globals/restoreVersion.js +13 -23
  222. package/dist/routes/rest/globals/restoreVersion.js.map +1 -0
  223. package/dist/routes/rest/globals/update.d.ts +1 -1
  224. package/dist/routes/rest/globals/update.d.ts.map +1 -1
  225. package/dist/routes/rest/globals/update.js +15 -25
  226. package/dist/routes/rest/globals/update.js.map +1 -0
  227. package/dist/routes/rest/index.d.ts +1 -0
  228. package/dist/routes/rest/index.d.ts.map +1 -1
  229. package/dist/routes/rest/index.js +423 -305
  230. package/dist/routes/rest/index.js.map +1 -0
  231. package/dist/routes/rest/routeError.d.ts +14 -0
  232. package/dist/routes/rest/routeError.d.ts.map +1 -0
  233. package/dist/routes/rest/routeError.js +107 -0
  234. package/dist/routes/rest/routeError.js.map +1 -0
  235. package/dist/routes/rest/types.d.ts +7 -7
  236. package/dist/routes/rest/types.d.ts.map +1 -1
  237. package/dist/routes/rest/types.js +2 -5
  238. package/dist/routes/rest/types.js.map +1 -0
  239. package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts +9 -0
  240. package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts.map +1 -0
  241. package/dist/routes/rest/utilities/sanitizeCollectionID.js +13 -0
  242. package/dist/routes/rest/utilities/sanitizeCollectionID.js.map +1 -0
  243. package/dist/scss/app.scss +3 -4
  244. package/dist/scss/vars.scss +0 -7
  245. package/dist/utilities/addDataAndFileToRequest.d.ts +11 -0
  246. package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -0
  247. package/dist/utilities/addDataAndFileToRequest.js +74 -0
  248. package/dist/utilities/addDataAndFileToRequest.js.map +1 -0
  249. package/dist/utilities/addLocalesToRequest.d.ts +20 -0
  250. package/dist/utilities/addLocalesToRequest.d.ts.map +1 -0
  251. package/dist/utilities/addLocalesToRequest.js +41 -0
  252. package/dist/utilities/addLocalesToRequest.js.map +1 -0
  253. package/dist/utilities/buildFieldSchemaMap/index.d.ts +4 -0
  254. package/dist/utilities/buildFieldSchemaMap/index.d.ts.map +1 -0
  255. package/dist/utilities/buildFieldSchemaMap/index.js +28 -0
  256. package/dist/utilities/buildFieldSchemaMap/index.js.map +1 -0
  257. package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts +14 -0
  258. package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts.map +1 -0
  259. package/dist/utilities/buildFieldSchemaMap/traverseFields.js +75 -0
  260. package/dist/utilities/buildFieldSchemaMap/traverseFields.js.map +1 -0
  261. package/dist/utilities/buildFieldSchemaMap/types.d.ts +3 -0
  262. package/dist/utilities/buildFieldSchemaMap/types.d.ts.map +1 -0
  263. package/dist/utilities/buildFieldSchemaMap/types.js +3 -0
  264. package/dist/utilities/buildFieldSchemaMap/types.js.map +1 -0
  265. package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
  266. package/dist/utilities/createPayloadRequest.js +38 -54
  267. package/dist/utilities/createPayloadRequest.js.map +1 -0
  268. package/dist/utilities/getDataAndFile.d.ts +2 -2
  269. package/dist/utilities/getDataAndFile.d.ts.map +1 -1
  270. package/dist/utilities/getDataAndFile.js +29 -55
  271. package/dist/utilities/getDataAndFile.js.map +1 -0
  272. package/dist/utilities/getNextRequestI18n.d.ts +11 -0
  273. package/dist/utilities/getNextRequestI18n.d.ts.map +1 -0
  274. package/dist/utilities/getNextRequestI18n.js +18 -0
  275. package/dist/utilities/getNextRequestI18n.js.map +1 -0
  276. package/dist/utilities/getPayloadHMR.d.ts +5 -0
  277. package/dist/utilities/getPayloadHMR.d.ts.map +1 -0
  278. package/dist/utilities/getPayloadHMR.js +79 -0
  279. package/dist/utilities/getPayloadHMR.js.map +1 -0
  280. package/dist/utilities/getRequestLanguage.d.ts +6 -3
  281. package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
  282. package/dist/utilities/getRequestLanguage.js +13 -16
  283. package/dist/utilities/getRequestLanguage.js.map +1 -0
  284. package/dist/utilities/getRequestLocales.js +2 -12
  285. package/dist/utilities/getRequestLocales.js.map +1 -0
  286. package/dist/utilities/headersWithCors.d.ts +8 -0
  287. package/dist/utilities/headersWithCors.d.ts.map +1 -0
  288. package/dist/utilities/headersWithCors.js +17 -0
  289. package/dist/utilities/headersWithCors.js.map +1 -0
  290. package/dist/utilities/initPage/handleAdminPage.d.ts +13 -0
  291. package/dist/utilities/initPage/handleAdminPage.d.ts.map +1 -0
  292. package/dist/utilities/initPage/handleAdminPage.js +35 -0
  293. package/dist/utilities/initPage/handleAdminPage.js.map +1 -0
  294. package/dist/utilities/initPage/handleAuthRedirect.d.ts +9 -0
  295. package/dist/utilities/initPage/handleAuthRedirect.d.ts.map +1 -0
  296. package/dist/utilities/initPage/handleAuthRedirect.js +26 -0
  297. package/dist/utilities/initPage/handleAuthRedirect.js.map +1 -0
  298. package/dist/utilities/initPage/index.d.ts +4 -0
  299. package/dist/utilities/initPage/index.d.ts.map +1 -0
  300. package/dist/utilities/initPage/index.js +89 -0
  301. package/dist/utilities/initPage/index.js.map +1 -0
  302. package/dist/utilities/initPage/shared.d.ts +4 -0
  303. package/dist/utilities/initPage/shared.d.ts.map +1 -0
  304. package/dist/utilities/initPage/shared.js +17 -0
  305. package/dist/utilities/initPage/shared.js.map +1 -0
  306. package/dist/utilities/initPage/types.d.ts +24 -0
  307. package/dist/utilities/initPage/types.d.ts.map +1 -0
  308. package/dist/utilities/initPage/types.js +3 -0
  309. package/dist/utilities/initPage/types.js.map +1 -0
  310. package/dist/utilities/meta.js +5 -15
  311. package/dist/utilities/meta.js.map +1 -0
  312. package/dist/utilities/timestamp.d.ts +2 -0
  313. package/dist/utilities/timestamp.d.ts.map +1 -0
  314. package/dist/utilities/timestamp.js +7 -0
  315. package/dist/utilities/timestamp.js.map +1 -0
  316. package/dist/views/API/RenderJSON/index.d.ts.map +1 -0
  317. package/dist/views/API/RenderJSON/index.js +90 -0
  318. package/dist/views/API/RenderJSON/index.js.map +1 -0
  319. package/dist/views/API/index.client.d.ts +4 -0
  320. package/dist/views/API/index.client.d.ts.map +1 -0
  321. package/dist/views/API/index.client.js +187 -0
  322. package/dist/views/API/index.client.js.map +1 -0
  323. package/dist/views/API/index.d.ts +3 -0
  324. package/dist/views/API/index.d.ts.map +1 -0
  325. package/dist/views/API/index.js +7 -0
  326. package/dist/views/API/index.js.map +1 -0
  327. package/dist/views/API/meta.d.ts +3 -0
  328. package/dist/views/API/meta.d.ts.map +1 -0
  329. package/dist/views/API/meta.js +11 -0
  330. package/dist/views/API/meta.js.map +1 -0
  331. package/dist/views/Account/Settings/index.d.ts.map +1 -0
  332. package/dist/views/Account/Settings/index.js +31 -0
  333. package/dist/views/Account/Settings/index.js.map +1 -0
  334. package/dist/views/Account/ToggleTheme/index.d.ts.map +1 -0
  335. package/dist/views/Account/ToggleTheme/index.js +36 -0
  336. package/dist/views/Account/ToggleTheme/index.js.map +1 -0
  337. package/dist/views/Account/index.d.ts +5 -0
  338. package/dist/views/Account/index.d.ts.map +1 -0
  339. package/dist/views/Account/index.js +57 -0
  340. package/dist/views/Account/index.js.map +1 -0
  341. package/dist/views/Account/meta.d.ts +3 -0
  342. package/dist/views/Account/meta.d.ts.map +1 -0
  343. package/dist/views/Account/meta.js +11 -0
  344. package/dist/views/Account/meta.js.map +1 -0
  345. package/dist/views/CreateFirstUser/index.client.d.ts +7 -0
  346. package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -0
  347. package/dist/views/CreateFirstUser/index.client.js +64 -0
  348. package/dist/views/CreateFirstUser/index.client.js.map +1 -0
  349. package/dist/views/CreateFirstUser/index.d.ts +6 -0
  350. package/dist/views/CreateFirstUser/index.d.ts.map +1 -0
  351. package/dist/views/CreateFirstUser/index.js +43 -0
  352. package/dist/views/CreateFirstUser/index.js.map +1 -0
  353. package/dist/views/CreateFirstUser/index.scss +5 -0
  354. package/dist/views/CreateFirstUser/meta.d.ts +3 -0
  355. package/dist/views/CreateFirstUser/meta.d.ts.map +1 -0
  356. package/dist/views/CreateFirstUser/meta.js +11 -0
  357. package/dist/views/CreateFirstUser/meta.js.map +1 -0
  358. package/dist/views/Dashboard/Default/index.client.d.ts +10 -0
  359. package/dist/views/Dashboard/Default/index.client.d.ts.map +1 -0
  360. package/dist/views/Dashboard/Default/index.client.js +103 -0
  361. package/dist/views/Dashboard/Default/index.client.js.map +1 -0
  362. package/dist/views/Dashboard/Default/index.d.ts +12 -0
  363. package/dist/views/Dashboard/Default/index.d.ts.map +1 -0
  364. package/dist/views/Dashboard/Default/index.js +28 -0
  365. package/dist/views/Dashboard/Default/index.js.map +1 -0
  366. package/dist/views/Dashboard/index.d.ts +5 -0
  367. package/dist/views/Dashboard/index.d.ts.map +1 -0
  368. package/dist/views/Dashboard/index.js +27 -0
  369. package/dist/views/Dashboard/index.js.map +1 -0
  370. package/dist/views/Dashboard/meta.d.ts +3 -0
  371. package/dist/views/Dashboard/meta.d.ts.map +1 -0
  372. package/dist/views/Dashboard/meta.js +11 -0
  373. package/dist/views/Dashboard/meta.js.map +1 -0
  374. package/dist/views/Document/getCustomViewByKey.d.ts +4 -0
  375. package/dist/views/Document/getCustomViewByKey.d.ts.map +1 -0
  376. package/dist/views/Document/getCustomViewByKey.js +5 -0
  377. package/dist/views/Document/getCustomViewByKey.js.map +1 -0
  378. package/dist/views/Document/getCustomViewByRoute.d.ts +8 -0
  379. package/dist/views/Document/getCustomViewByRoute.d.ts.map +1 -0
  380. package/dist/views/Document/getCustomViewByRoute.js +22 -0
  381. package/dist/views/Document/getCustomViewByRoute.js.map +1 -0
  382. package/dist/views/Document/getMetaBySegment.d.ts +10 -0
  383. package/dist/views/Document/getMetaBySegment.d.ts.map +1 -0
  384. package/dist/views/Document/getMetaBySegment.js +77 -0
  385. package/dist/views/Document/getMetaBySegment.js.map +1 -0
  386. package/dist/views/Document/getViewsFromConfig.d.ts +18 -0
  387. package/dist/views/Document/getViewsFromConfig.d.ts.map +1 -0
  388. package/dist/views/Document/getViewsFromConfig.js +241 -0
  389. package/dist/views/Document/getViewsFromConfig.js.map +1 -0
  390. package/dist/views/Document/index.d.ts +6 -0
  391. package/dist/views/Document/index.d.ts.map +1 -0
  392. package/dist/views/Document/index.js +155 -0
  393. package/dist/views/Document/index.js.map +1 -0
  394. package/dist/views/Document/meta.d.ts +3 -0
  395. package/dist/views/Document/meta.d.ts.map +1 -0
  396. package/dist/views/Document/meta.js +4 -0
  397. package/dist/views/Document/meta.js.map +1 -0
  398. package/dist/views/Edit/Default/Auth/APIKey.d.ts +6 -0
  399. package/dist/views/Edit/Default/Auth/APIKey.d.ts.map +1 -0
  400. package/dist/views/Edit/Default/Auth/APIKey.js +106 -0
  401. package/dist/views/Edit/Default/Auth/APIKey.js.map +1 -0
  402. package/dist/views/Edit/Default/Auth/index.d.ts +5 -0
  403. package/dist/views/Edit/Default/Auth/index.d.ts.map +1 -0
  404. package/dist/views/Edit/Default/Auth/index.js +130 -0
  405. package/dist/views/Edit/Default/Auth/index.js.map +1 -0
  406. package/dist/views/Edit/Default/Auth/types.d.ts.map +1 -0
  407. package/dist/views/Edit/Default/Auth/types.js +3 -0
  408. package/dist/views/Edit/Default/Auth/types.js.map +1 -0
  409. package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts +12 -0
  410. package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts.map +1 -0
  411. package/dist/views/Edit/Default/SetDocumentStepNav/index.js +71 -0
  412. package/dist/views/Edit/Default/SetDocumentStepNav/index.js.map +1 -0
  413. package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts +9 -0
  414. package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts.map +1 -0
  415. package/dist/views/Edit/Default/SetDocumentTitle/index.js +38 -0
  416. package/dist/views/Edit/Default/SetDocumentTitle/index.js.map +1 -0
  417. package/dist/views/Edit/Default/index.d.ts.map +1 -0
  418. package/dist/views/Edit/Default/index.js +195 -0
  419. package/dist/views/Edit/Default/index.js.map +1 -0
  420. package/dist/views/Edit/Default/types.d.ts.map +1 -0
  421. package/dist/views/Edit/Default/types.js +3 -0
  422. package/dist/views/Edit/Default/types.js.map +1 -0
  423. package/dist/views/Edit/index.client.d.ts +3 -0
  424. package/dist/views/Edit/index.client.d.ts.map +1 -0
  425. package/dist/views/Edit/index.client.js +23 -0
  426. package/dist/views/Edit/index.client.js.map +1 -0
  427. package/dist/views/Edit/index.d.ts +3 -0
  428. package/dist/views/Edit/index.d.ts.map +1 -0
  429. package/dist/views/Edit/index.js +7 -0
  430. package/dist/views/Edit/index.js.map +1 -0
  431. package/dist/views/Edit/meta.d.ts +3 -0
  432. package/dist/views/Edit/meta.d.ts.map +1 -0
  433. package/dist/views/Edit/meta.js +26 -0
  434. package/dist/views/Edit/meta.js.map +1 -0
  435. package/dist/views/Edit/sanitizeEditViewProps.d.ts +3 -0
  436. package/dist/views/Edit/sanitizeEditViewProps.d.ts.map +1 -0
  437. package/dist/views/Edit/sanitizeEditViewProps.js +11 -0
  438. package/dist/views/Edit/sanitizeEditViewProps.js.map +1 -0
  439. package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts +3 -0
  440. package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts.map +1 -0
  441. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +58 -0
  442. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -0
  443. package/dist/views/ForgotPassword/index.d.ts +6 -0
  444. package/dist/views/ForgotPassword/index.d.ts.map +1 -0
  445. package/dist/views/ForgotPassword/index.js +33 -0
  446. package/dist/views/ForgotPassword/index.js.map +1 -0
  447. package/dist/views/ForgotPassword/meta.d.ts +3 -0
  448. package/dist/views/ForgotPassword/meta.d.ts.map +1 -0
  449. package/dist/views/ForgotPassword/meta.js +11 -0
  450. package/dist/views/ForgotPassword/meta.js.map +1 -0
  451. package/dist/views/List/Default/index.d.ts.map +1 -0
  452. package/dist/views/List/Default/index.js +149 -0
  453. package/dist/views/List/Default/index.js.map +1 -0
  454. package/dist/views/List/Default/types.d.ts +15 -0
  455. package/dist/views/List/Default/types.d.ts.map +1 -0
  456. package/dist/views/List/Default/types.js +3 -0
  457. package/dist/views/List/Default/types.js.map +1 -0
  458. package/dist/views/List/index.d.ts +5 -0
  459. package/dist/views/List/index.d.ts.map +1 -0
  460. package/dist/views/List/index.js +107 -0
  461. package/dist/views/List/index.js.map +1 -0
  462. package/dist/views/List/meta.d.ts +7 -0
  463. package/dist/views/List/meta.d.ts.map +1 -0
  464. package/dist/views/List/meta.js +19 -0
  465. package/dist/views/List/meta.js.map +1 -0
  466. package/dist/views/LivePreview/Context/collisionDetection.d.ts.map +1 -0
  467. package/dist/views/LivePreview/Context/collisionDetection.js +26 -0
  468. package/dist/views/LivePreview/Context/collisionDetection.js.map +1 -0
  469. package/dist/views/LivePreview/Context/context.d.ts +50 -0
  470. package/dist/views/LivePreview/Context/context.d.ts.map +1 -0
  471. package/dist/views/LivePreview/Context/context.js +40 -0
  472. package/dist/views/LivePreview/Context/context.js.map +1 -0
  473. package/dist/views/LivePreview/Context/index.d.ts +20 -0
  474. package/dist/views/LivePreview/Context/index.d.ts.map +1 -0
  475. package/dist/views/LivePreview/Context/index.js +153 -0
  476. package/dist/views/LivePreview/Context/index.js.map +1 -0
  477. package/dist/views/LivePreview/Context/sizeReducer.d.ts.map +1 -0
  478. package/dist/views/LivePreview/Context/sizeReducer.js +31 -0
  479. package/dist/views/LivePreview/Context/sizeReducer.js.map +1 -0
  480. package/dist/views/LivePreview/Device/index.d.ts.map +1 -0
  481. package/dist/views/LivePreview/Device/index.js +51 -0
  482. package/dist/views/LivePreview/Device/index.js.map +1 -0
  483. package/dist/views/LivePreview/DeviceContainer/index.d.ts.map +1 -0
  484. package/dist/views/LivePreview/DeviceContainer/index.js +29 -0
  485. package/dist/views/LivePreview/DeviceContainer/index.js.map +1 -0
  486. package/dist/views/LivePreview/IFrame/index.d.ts +9 -0
  487. package/dist/views/LivePreview/IFrame/index.d.ts.map +1 -0
  488. package/dist/views/LivePreview/IFrame/index.js +22 -0
  489. package/dist/views/LivePreview/IFrame/index.js.map +1 -0
  490. package/dist/views/LivePreview/Preview/index.d.ts +5 -0
  491. package/dist/views/LivePreview/Preview/index.d.ts.map +1 -0
  492. package/dist/views/LivePreview/Preview/index.js +101 -0
  493. package/dist/views/LivePreview/Preview/index.js.map +1 -0
  494. package/dist/views/LivePreview/Toolbar/Controls/index.d.ts +5 -0
  495. package/dist/views/LivePreview/Toolbar/Controls/index.d.ts.map +1 -0
  496. package/dist/views/LivePreview/Toolbar/Controls/index.js +85 -0
  497. package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -0
  498. package/dist/views/LivePreview/Toolbar/SizeInput/index.d.ts.map +1 -0
  499. package/dist/views/LivePreview/Toolbar/SizeInput/index.js +60 -0
  500. package/dist/views/LivePreview/Toolbar/SizeInput/index.js.map +1 -0
  501. package/dist/views/LivePreview/Toolbar/index.d.ts +7 -0
  502. package/dist/views/LivePreview/Toolbar/index.d.ts.map +1 -0
  503. package/dist/views/LivePreview/Toolbar/index.js +49 -0
  504. package/dist/views/LivePreview/Toolbar/index.js.map +1 -0
  505. package/dist/views/LivePreview/ToolbarArea/index.d.ts.map +1 -0
  506. package/dist/views/LivePreview/ToolbarArea/index.js +16 -0
  507. package/dist/views/LivePreview/ToolbarArea/index.js.map +1 -0
  508. package/dist/views/LivePreview/index.client.d.ts +10 -0
  509. package/dist/views/LivePreview/index.client.d.ts.map +1 -0
  510. package/dist/views/LivePreview/index.client.js +170 -0
  511. package/dist/views/LivePreview/index.client.js.map +1 -0
  512. package/dist/views/LivePreview/index.d.ts +4 -0
  513. package/dist/views/LivePreview/index.d.ts.map +1 -0
  514. package/dist/views/LivePreview/index.js +65 -0
  515. package/dist/views/LivePreview/index.js.map +1 -0
  516. package/dist/views/LivePreview/meta.d.ts +3 -0
  517. package/dist/views/LivePreview/meta.d.ts.map +1 -0
  518. package/dist/views/LivePreview/meta.js +26 -0
  519. package/dist/views/LivePreview/meta.js.map +1 -0
  520. package/dist/views/LivePreview/usePopupWindow.d.ts.map +1 -0
  521. package/dist/views/LivePreview/usePopupWindow.js +102 -0
  522. package/dist/views/LivePreview/usePopupWindow.js.map +1 -0
  523. package/dist/views/Login/LoginForm/index.d.ts.map +1 -0
  524. package/dist/views/Login/LoginForm/index.js +88 -0
  525. package/dist/views/Login/LoginForm/index.js.map +1 -0
  526. package/dist/views/Login/index.d.ts +7 -0
  527. package/dist/views/Login/index.d.ts.map +1 -0
  528. package/dist/views/Login/index.js +28 -0
  529. package/dist/views/Login/index.js.map +1 -0
  530. package/dist/views/Login/index.scss +8 -0
  531. package/dist/views/Login/meta.d.ts +3 -0
  532. package/dist/views/Login/meta.d.ts.map +1 -0
  533. package/dist/views/Login/meta.js +11 -0
  534. package/dist/views/Login/meta.js.map +1 -0
  535. package/dist/views/Logout/LogoutClient.d.ts.map +1 -0
  536. package/dist/views/Logout/LogoutClient.js +33 -0
  537. package/dist/views/Logout/LogoutClient.js.map +1 -0
  538. package/dist/views/Logout/index.d.ts +9 -0
  539. package/dist/views/Logout/index.d.ts.map +1 -0
  540. package/dist/views/Logout/index.js +25 -0
  541. package/dist/views/Logout/index.js.map +1 -0
  542. package/dist/views/Logout/meta.d.ts +3 -0
  543. package/dist/views/Logout/meta.d.ts.map +1 -0
  544. package/dist/views/Logout/meta.js +11 -0
  545. package/dist/views/Logout/meta.js.map +1 -0
  546. package/dist/views/NotFound/index.client.d.ts +6 -0
  547. package/dist/views/NotFound/index.client.d.ts.map +1 -0
  548. package/dist/views/NotFound/index.client.js +41 -0
  549. package/dist/views/NotFound/index.client.js.map +1 -0
  550. package/dist/views/NotFound/index.d.ts +28 -0
  551. package/dist/views/NotFound/index.d.ts.map +1 -0
  552. package/dist/views/NotFound/index.js +39 -0
  553. package/dist/views/NotFound/index.js.map +1 -0
  554. package/dist/views/NotFound/index.scss +37 -0
  555. package/dist/views/NotFound/meta.d.ts +8 -0
  556. package/dist/views/NotFound/meta.d.ts.map +1 -0
  557. package/dist/views/NotFound/meta.js +11 -0
  558. package/dist/views/NotFound/meta.js.map +1 -0
  559. package/dist/views/ResetPassword/index.client.d.ts +7 -0
  560. package/dist/views/ResetPassword/index.client.d.ts.map +1 -0
  561. package/dist/views/ResetPassword/index.client.js +83 -0
  562. package/dist/views/ResetPassword/index.client.js.map +1 -0
  563. package/dist/views/ResetPassword/index.d.ts +7 -0
  564. package/dist/views/ResetPassword/index.d.ts.map +1 -0
  565. package/dist/views/ResetPassword/index.js +44 -0
  566. package/dist/views/ResetPassword/index.js.map +1 -0
  567. package/dist/views/ResetPassword/index.scss +5 -0
  568. package/dist/views/ResetPassword/meta.d.ts +3 -0
  569. package/dist/views/ResetPassword/meta.d.ts.map +1 -0
  570. package/dist/views/ResetPassword/meta.js +11 -0
  571. package/dist/views/ResetPassword/meta.js.map +1 -0
  572. package/dist/views/Root/getCustomViewByRoute.d.ts +6 -0
  573. package/dist/views/Root/getCustomViewByRoute.d.ts.map +1 -0
  574. package/dist/views/Root/getCustomViewByRoute.js +19 -0
  575. package/dist/views/Root/getCustomViewByRoute.js.map +1 -0
  576. package/dist/views/Root/getViewFromConfig.d.ts +18 -0
  577. package/dist/views/Root/getViewFromConfig.d.ts.map +1 -0
  578. package/dist/views/Root/getViewFromConfig.js +138 -0
  579. package/dist/views/Root/getViewFromConfig.js.map +1 -0
  580. package/dist/views/Root/index.d.ts +22 -0
  581. package/dist/views/Root/index.d.ts.map +1 -0
  582. package/dist/views/Root/index.js +51 -0
  583. package/dist/views/Root/index.js.map +1 -0
  584. package/dist/views/Root/isPathMatchingRoute.d.ts +8 -0
  585. package/dist/views/Root/isPathMatchingRoute.d.ts.map +1 -0
  586. package/dist/views/Root/isPathMatchingRoute.js +16 -0
  587. package/dist/views/Root/isPathMatchingRoute.js.map +1 -0
  588. package/dist/views/Root/meta.d.ts +14 -0
  589. package/dist/views/Root/meta.d.ts.map +1 -0
  590. package/dist/views/Root/meta.js +159 -0
  591. package/dist/views/Root/meta.js.map +1 -0
  592. package/dist/views/Unauthorized/index.d.ts +5 -0
  593. package/dist/views/Unauthorized/index.d.ts.map +1 -0
  594. package/dist/views/Unauthorized/index.js +20 -0
  595. package/dist/views/Unauthorized/index.js.map +1 -0
  596. package/dist/views/Unauthorized/index.scss +36 -0
  597. package/dist/views/Unauthorized/meta.d.ts +3 -0
  598. package/dist/views/Unauthorized/meta.d.ts.map +1 -0
  599. package/dist/views/Unauthorized/meta.js +11 -0
  600. package/dist/views/Unauthorized/meta.js.map +1 -0
  601. package/dist/views/Verify/index.d.ts +7 -0
  602. package/dist/views/Verify/index.d.ts.map +1 -0
  603. package/dist/views/Verify/index.js +32 -0
  604. package/dist/views/Verify/index.js.map +1 -0
  605. package/dist/views/Verify/meta.d.ts +3 -0
  606. package/dist/views/Verify/meta.d.ts.map +1 -0
  607. package/dist/views/Verify/meta.js +11 -0
  608. package/dist/views/Verify/meta.js.map +1 -0
  609. package/dist/views/Version/Default/SetStepNav.d.ts +14 -0
  610. package/dist/views/Version/Default/SetStepNav.d.ts.map +1 -0
  611. package/dist/views/Version/Default/SetStepNav.js +100 -0
  612. package/dist/views/Version/Default/SetStepNav.js.map +1 -0
  613. package/dist/views/Version/Default/index.d.ts +5 -0
  614. package/dist/views/Version/Default/index.d.ts.map +1 -0
  615. package/dist/views/Version/Default/index.js +115 -0
  616. package/dist/views/Version/Default/index.js.map +1 -0
  617. package/dist/views/Version/Default/types.d.ts +19 -0
  618. package/dist/views/Version/Default/types.d.ts.map +1 -0
  619. package/dist/views/Version/Default/types.js +3 -0
  620. package/dist/views/Version/Default/types.js.map +1 -0
  621. package/dist/views/Version/RenderFieldsToDiff/Label/index.d.ts.map +1 -0
  622. package/dist/views/Version/RenderFieldsToDiff/Label/index.js +8 -0
  623. package/dist/views/Version/RenderFieldsToDiff/Label/index.js.map +1 -0
  624. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts +6 -0
  625. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +1 -0
  626. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +64 -0
  627. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -0
  628. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts +6 -0
  629. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts.map +1 -0
  630. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +28 -0
  631. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +1 -0
  632. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts +6 -0
  633. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts.map +1 -0
  634. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +74 -0
  635. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -0
  636. package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.d.ts.map +1 -0
  637. package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js +17 -0
  638. package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js.map +1 -0
  639. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts +10 -0
  640. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts.map +1 -0
  641. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +39 -0
  642. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -0
  643. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts +9 -0
  644. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts.map +1 -0
  645. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +39 -0
  646. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -0
  647. package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.d.ts.map +1 -0
  648. package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js +17 -0
  649. package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js.map +1 -0
  650. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts +6 -0
  651. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts.map +1 -0
  652. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +30 -0
  653. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -0
  654. package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.d.ts.map +1 -0
  655. package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js +8 -0
  656. package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js.map +1 -0
  657. package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts +60 -0
  658. package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts.map +1 -0
  659. package/dist/views/Version/RenderFieldsToDiff/fields/index.js +29 -0
  660. package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -0
  661. package/dist/views/Version/RenderFieldsToDiff/fields/styles.d.ts.map +1 -0
  662. package/dist/views/Version/RenderFieldsToDiff/fields/styles.js +28 -0
  663. package/dist/views/Version/RenderFieldsToDiff/fields/styles.js.map +1 -0
  664. package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts +21 -0
  665. package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts.map +1 -0
  666. package/dist/views/Version/RenderFieldsToDiff/fields/types.js +3 -0
  667. package/dist/views/Version/RenderFieldsToDiff/fields/types.js.map +1 -0
  668. package/dist/views/Version/RenderFieldsToDiff/index.d.ts +6 -0
  669. package/dist/views/Version/RenderFieldsToDiff/index.d.ts.map +1 -0
  670. package/dist/views/Version/RenderFieldsToDiff/index.js +100 -0
  671. package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -0
  672. package/dist/views/Version/RenderFieldsToDiff/types.d.ts +20 -0
  673. package/dist/views/Version/RenderFieldsToDiff/types.d.ts.map +1 -0
  674. package/dist/views/Version/RenderFieldsToDiff/types.js +3 -0
  675. package/dist/views/Version/RenderFieldsToDiff/types.js.map +1 -0
  676. package/dist/views/Version/Restore/index.d.ts +6 -0
  677. package/dist/views/Version/Restore/index.d.ts.map +1 -0
  678. package/dist/views/Version/Restore/index.js +77 -0
  679. package/dist/views/Version/Restore/index.js.map +1 -0
  680. package/dist/views/Version/Restore/index.scss +30 -0
  681. package/dist/views/Version/Restore/types.d.ts +11 -0
  682. package/dist/views/Version/Restore/types.d.ts.map +1 -0
  683. package/dist/views/Version/Restore/types.js +3 -0
  684. package/dist/views/Version/Restore/types.js.map +1 -0
  685. package/dist/views/Version/SelectComparison/index.d.ts +5 -0
  686. package/dist/views/Version/SelectComparison/index.d.ts.map +1 -0
  687. package/dist/views/Version/SelectComparison/index.js +130 -0
  688. package/dist/views/Version/SelectComparison/index.js.map +1 -0
  689. package/dist/views/Version/SelectComparison/types.d.ts +27 -0
  690. package/dist/views/Version/SelectComparison/types.d.ts.map +1 -0
  691. package/dist/views/Version/SelectComparison/types.js +3 -0
  692. package/dist/views/Version/SelectComparison/types.js.map +1 -0
  693. package/dist/views/Version/SelectLocales/index.d.ts +5 -0
  694. package/dist/views/Version/SelectLocales/index.d.ts.map +1 -0
  695. package/dist/views/Version/SelectLocales/index.js +33 -0
  696. package/dist/views/Version/SelectLocales/index.js.map +1 -0
  697. package/dist/views/Version/SelectLocales/types.d.ts +7 -0
  698. package/dist/views/Version/SelectLocales/types.d.ts.map +1 -0
  699. package/dist/views/Version/SelectLocales/types.js +3 -0
  700. package/dist/views/Version/SelectLocales/types.js.map +1 -0
  701. package/dist/views/Version/index.d.ts +3 -0
  702. package/dist/views/Version/index.d.ts.map +1 -0
  703. package/dist/views/Version/index.js +102 -0
  704. package/dist/views/Version/index.js.map +1 -0
  705. package/dist/views/Version/meta.d.ts +3 -0
  706. package/dist/views/Version/meta.d.ts.map +1 -0
  707. package/dist/views/Version/meta.js +41 -0
  708. package/dist/views/Version/meta.js.map +1 -0
  709. package/dist/views/Version/shared.d.ts.map +1 -0
  710. package/dist/views/Version/shared.js +10 -0
  711. package/dist/views/Version/shared.js.map +1 -0
  712. package/dist/views/Versions/buildColumns.d.ts +11 -0
  713. package/dist/views/Versions/buildColumns.d.ts.map +1 -0
  714. package/dist/views/Versions/buildColumns.js +63 -0
  715. package/dist/views/Versions/buildColumns.js.map +1 -0
  716. package/dist/views/Versions/cells/AutosaveCell/index.d.ts.map +1 -0
  717. package/dist/views/Versions/cells/AutosaveCell/index.js +14 -0
  718. package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -0
  719. package/dist/views/Versions/cells/CreatedAt/index.d.ts.map +1 -0
  720. package/dist/views/Versions/cells/CreatedAt/index.js +26 -0
  721. package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -0
  722. package/dist/views/Versions/cells/ID/index.d.ts.map +1 -0
  723. package/dist/views/Versions/cells/ID/index.js +9 -0
  724. package/dist/views/Versions/cells/ID/index.js.map +1 -0
  725. package/dist/views/Versions/index.client.d.ts +10 -0
  726. package/dist/views/Versions/index.client.d.ts.map +1 -0
  727. package/dist/views/Versions/index.client.js +57 -0
  728. package/dist/views/Versions/index.client.js.map +1 -0
  729. package/dist/views/Versions/index.d.ts +5 -0
  730. package/dist/views/Versions/index.d.ts.map +1 -0
  731. package/dist/views/Versions/index.js +93 -0
  732. package/dist/views/Versions/index.js.map +1 -0
  733. package/dist/views/Versions/meta.d.ts +3 -0
  734. package/dist/views/Versions/meta.d.ts.map +1 -0
  735. package/dist/views/Versions/meta.js +33 -0
  736. package/dist/views/Versions/meta.js.map +1 -0
  737. package/dist/views/Versions/types.d.ts.map +1 -0
  738. package/dist/views/Versions/types.js +3 -0
  739. package/dist/views/Versions/types.js.map +1 -0
  740. package/dist/webpackEntry.d.ts +5 -0
  741. package/dist/webpackEntry.d.ts.map +1 -0
  742. package/dist/webpackEntry.js +6 -0
  743. package/dist/webpackEntry.js.map +1 -0
  744. package/dist/withPayload.d.ts +2 -2
  745. package/dist/withPayload.d.ts.map +1 -1
  746. package/dist/withPayload.js +9 -9
  747. package/dist/withPayload.js.map +1 -0
  748. package/package.json +58 -72
  749. package/dist/295bdb5117ce718dc7ce.woff2 +0 -1
  750. package/dist/3dec23c585a4abb5db73.woff +0 -1
  751. package/dist/542802f243f0fcaf55b3.woff2 +0 -1
  752. package/dist/5e5b3593b8911609ead8.woff +0 -1
  753. package/dist/64ee2a3127da82b7ea68.woff2 +0 -1
  754. package/dist/67a3a8f8301a0429df2d.woff +0 -1
  755. package/dist/8d0dc94a123c04b123f0.woff +0 -1
  756. package/dist/94db87589768ca1eec3c.woff2 +0 -1
  757. package/dist/997a8ea7da8ec3068210.woff2 +0 -1
  758. package/dist/9ab00e972f6f94ca3ff4.woff +0 -1
  759. package/dist/ab1f8b95d9d1911a4a3e.woff +0 -1
  760. package/dist/ba5a15d71add74a81bb9.woff +0 -1
  761. package/dist/bd2c036744af4b004ea6.woff2 +0 -1
  762. package/dist/bin/index.d.ts +0 -2
  763. package/dist/bin/index.d.ts.map +0 -1
  764. package/dist/bin/index.js +0 -37
  765. package/dist/bin/install.d.ts +0 -4
  766. package/dist/bin/install.d.ts.map +0 -1
  767. package/dist/bin/install.js +0 -77
  768. package/dist/cc56c782af93204aba75.woff +0 -1
  769. package/dist/d377d6e20b542fe3b375.woff2 +0 -1
  770. package/dist/e415ace668b22ac52c65.woff2 +0 -1
  771. package/dist/exports/index.d.ts +0 -2
  772. package/dist/exports/index.d.ts.map +0 -1
  773. package/dist/exports/index.js +0 -13
  774. package/dist/graphql/registerSchema.d.ts +0 -2
  775. package/dist/graphql/registerSchema.d.ts.map +0 -1
  776. package/dist/graphql/registerSchema.js +0 -3
  777. package/dist/index.d.ts +0 -7
  778. package/dist/index.d.ts.map +0 -1
  779. package/dist/layouts/Admin/index.d.ts +0 -12
  780. package/dist/layouts/Admin/index.d.ts.map +0 -1
  781. package/dist/layouts/Admin/index.js +0 -44
  782. package/dist/layouts/Document/index.d.ts +0 -14
  783. package/dist/layouts/Document/index.d.ts.map +0 -1
  784. package/dist/layouts/Document/index.js +0 -82
  785. package/dist/next-fileupload/fileFactory.d.ts +0 -16
  786. package/dist/next-fileupload/fileFactory.d.ts.map +0 -1
  787. package/dist/next-fileupload/fileFactory.js +0 -53
  788. package/dist/next-fileupload/handlers.d.ts +0 -15
  789. package/dist/next-fileupload/handlers.d.ts.map +0 -1
  790. package/dist/next-fileupload/handlers.js +0 -150
  791. package/dist/next-fileupload/index.d.ts +0 -135
  792. package/dist/next-fileupload/index.d.ts.map +0 -1
  793. package/dist/next-fileupload/index.js +0 -58
  794. package/dist/next-fileupload/isEligibleRequest.d.ts.map +0 -1
  795. package/dist/next-fileupload/isEligibleRequest.js +0 -36
  796. package/dist/next-fileupload/processMultipart.d.ts +0 -8
  797. package/dist/next-fileupload/processMultipart.d.ts.map +0 -1
  798. package/dist/next-fileupload/processMultipart.js +0 -146
  799. package/dist/next-fileupload/processNested.d.ts.map +0 -1
  800. package/dist/next-fileupload/processNested.js +0 -34
  801. package/dist/next-fileupload/uploadTimer.d.ts.map +0 -1
  802. package/dist/next-fileupload/uploadTimer.js +0 -29
  803. package/dist/next-fileupload/utilities.d.ts +0 -65
  804. package/dist/next-fileupload/utilities.d.ts.map +0 -1
  805. package/dist/next-fileupload/utilities.js +0 -252
  806. package/dist/next-stream-file/index.d.ts +0 -2
  807. package/dist/next-stream-file/index.d.ts.map +0 -1
  808. package/dist/next-stream-file/index.js +0 -40
  809. package/dist/pages/API/RenderJSON/index.d.ts.map +0 -1
  810. package/dist/pages/API/RenderJSON/index.js +0 -142
  811. package/dist/pages/API/index.client.d.ts +0 -5
  812. package/dist/pages/API/index.client.d.ts.map +0 -1
  813. package/dist/pages/API/index.client.js +0 -241
  814. package/dist/pages/API/index.d.ts +0 -4
  815. package/dist/pages/API/index.d.ts.map +0 -1
  816. package/dist/pages/API/index.js +0 -27
  817. package/dist/pages/API/meta.d.ts +0 -3
  818. package/dist/pages/API/meta.d.ts.map +0 -1
  819. package/dist/pages/API/meta.js +0 -21
  820. package/dist/pages/Account/Settings/index.d.ts.map +0 -1
  821. package/dist/pages/Account/Settings/index.js +0 -45
  822. package/dist/pages/Account/ToggleTheme/index.d.ts.map +0 -1
  823. package/dist/pages/Account/ToggleTheme/index.js +0 -85
  824. package/dist/pages/Account/index.d.ts +0 -13
  825. package/dist/pages/Account/index.d.ts.map +0 -1
  826. package/dist/pages/Account/index.js +0 -171
  827. package/dist/pages/CreateFirstUser/index.client.d.ts +0 -5
  828. package/dist/pages/CreateFirstUser/index.client.d.ts.map +0 -1
  829. package/dist/pages/CreateFirstUser/index.client.js +0 -29
  830. package/dist/pages/CreateFirstUser/index.d.ts +0 -11
  831. package/dist/pages/CreateFirstUser/index.d.ts.map +0 -1
  832. package/dist/pages/CreateFirstUser/index.js +0 -91
  833. package/dist/pages/CreateFirstUser/index.scss +0 -15
  834. package/dist/pages/Dashboard/Default/index.client.d.ts +0 -8
  835. package/dist/pages/Dashboard/Default/index.client.d.ts.map +0 -1
  836. package/dist/pages/Dashboard/Default/index.client.js +0 -154
  837. package/dist/pages/Dashboard/Default/index.d.ts +0 -11
  838. package/dist/pages/Dashboard/Default/index.d.ts.map +0 -1
  839. package/dist/pages/Dashboard/Default/index.js +0 -44
  840. package/dist/pages/Dashboard/index.d.ts +0 -13
  841. package/dist/pages/Dashboard/index.d.ts.map +0 -1
  842. package/dist/pages/Dashboard/index.js +0 -128
  843. package/dist/pages/Document/getCustomViewByKey.d.ts +0 -4
  844. package/dist/pages/Document/getCustomViewByKey.d.ts.map +0 -1
  845. package/dist/pages/Document/getCustomViewByKey.js +0 -15
  846. package/dist/pages/Document/getCustomViewByPath.d.ts +0 -4
  847. package/dist/pages/Document/getCustomViewByPath.d.ts.map +0 -1
  848. package/dist/pages/Document/getCustomViewByPath.js +0 -26
  849. package/dist/pages/Document/getMetaBySegment.d.ts +0 -20
  850. package/dist/pages/Document/getMetaBySegment.d.ts.map +0 -1
  851. package/dist/pages/Document/getMetaBySegment.js +0 -124
  852. package/dist/pages/Document/getViewsFromConfig.d.ts +0 -15
  853. package/dist/pages/Document/getViewsFromConfig.d.ts.map +0 -1
  854. package/dist/pages/Document/getViewsFromConfig.js +0 -163
  855. package/dist/pages/Document/index.d.ts +0 -23
  856. package/dist/pages/Document/index.d.ts.map +0 -1
  857. package/dist/pages/Document/index.js +0 -237
  858. package/dist/pages/Edit/Default/Auth/APIKey.d.ts +0 -6
  859. package/dist/pages/Edit/Default/Auth/APIKey.d.ts.map +0 -1
  860. package/dist/pages/Edit/Default/Auth/APIKey.js +0 -140
  861. package/dist/pages/Edit/Default/Auth/index.d.ts +0 -6
  862. package/dist/pages/Edit/Default/Auth/index.d.ts.map +0 -1
  863. package/dist/pages/Edit/Default/Auth/index.js +0 -180
  864. package/dist/pages/Edit/Default/Auth/types.d.ts.map +0 -1
  865. package/dist/pages/Edit/Default/Auth/types.js +0 -6
  866. package/dist/pages/Edit/Default/RenderCustomView.d.ts +0 -2
  867. package/dist/pages/Edit/Default/RenderCustomView.d.ts.map +0 -1
  868. package/dist/pages/Edit/Default/RenderCustomView.js +0 -3
  869. package/dist/pages/Edit/Default/SetDocumentTitle/index.d.ts +0 -8
  870. package/dist/pages/Edit/Default/SetDocumentTitle/index.d.ts.map +0 -1
  871. package/dist/pages/Edit/Default/SetDocumentTitle/index.js +0 -50
  872. package/dist/pages/Edit/Default/SetStepNav/index.d.ts +0 -13
  873. package/dist/pages/Edit/Default/SetStepNav/index.d.ts.map +0 -1
  874. package/dist/pages/Edit/Default/SetStepNav/index.js +0 -70
  875. package/dist/pages/Edit/Default/index.d.ts.map +0 -1
  876. package/dist/pages/Edit/Default/index.js +0 -202
  877. package/dist/pages/Edit/Default/types.d.ts.map +0 -1
  878. package/dist/pages/Edit/Default/types.js +0 -6
  879. package/dist/pages/Edit/index.client.d.ts +0 -4
  880. package/dist/pages/Edit/index.client.d.ts.map +0 -1
  881. package/dist/pages/Edit/index.client.js +0 -99
  882. package/dist/pages/Edit/index.d.ts +0 -4
  883. package/dist/pages/Edit/index.d.ts.map +0 -1
  884. package/dist/pages/Edit/index.js +0 -27
  885. package/dist/pages/Edit/meta.d.ts +0 -3
  886. package/dist/pages/Edit/meta.d.ts.map +0 -1
  887. package/dist/pages/Edit/meta.js +0 -36
  888. package/dist/pages/Edit/sanitizeEditViewProps.d.ts +0 -4
  889. package/dist/pages/Edit/sanitizeEditViewProps.d.ts.map +0 -1
  890. package/dist/pages/Edit/sanitizeEditViewProps.js +0 -24
  891. package/dist/pages/Edit/types.d.js +0 -7
  892. package/dist/pages/Edit/types.d.ts +0 -37
  893. package/dist/pages/Edit/types.d.ts.map +0 -1
  894. package/dist/pages/Edit/types.js +0 -6
  895. package/dist/pages/ForgotPassword/index.d.ts +0 -10
  896. package/dist/pages/ForgotPassword/index.d.ts.map +0 -1
  897. package/dist/pages/ForgotPassword/index.js +0 -101
  898. package/dist/pages/List/Default/Cell/cellTypes.spec.js +0 -234
  899. package/dist/pages/List/Default/Cell/fields/Array/index.d.ts +0 -7
  900. package/dist/pages/List/Default/Cell/fields/Array/index.d.ts.map +0 -1
  901. package/dist/pages/List/Default/Cell/fields/Array/index.js +0 -27
  902. package/dist/pages/List/Default/Cell/fields/Blocks/index.d.ts +0 -8
  903. package/dist/pages/List/Default/Cell/fields/Blocks/index.d.ts.map +0 -1
  904. package/dist/pages/List/Default/Cell/fields/Blocks/index.js +0 -45
  905. package/dist/pages/List/Default/Cell/fields/Checkbox/index.d.ts +0 -5
  906. package/dist/pages/List/Default/Cell/fields/Checkbox/index.d.ts.map +0 -1
  907. package/dist/pages/List/Default/Cell/fields/Checkbox/index.js +0 -23
  908. package/dist/pages/List/Default/Cell/fields/Checkbox/index.scss +0 -22
  909. package/dist/pages/List/Default/Cell/fields/Code/index.d.ts +0 -8
  910. package/dist/pages/List/Default/Cell/fields/Code/index.d.ts.map +0 -1
  911. package/dist/pages/List/Default/Cell/fields/Code/index.js +0 -29
  912. package/dist/pages/List/Default/Cell/fields/Code/index.scss +0 -27
  913. package/dist/pages/List/Default/Cell/fields/Date/index.d.ts +0 -7
  914. package/dist/pages/List/Default/Cell/fields/Date/index.d.ts.map +0 -1
  915. package/dist/pages/List/Default/Cell/fields/Date/index.js +0 -26
  916. package/dist/pages/List/Default/Cell/fields/File/index.d.ts +0 -7
  917. package/dist/pages/List/Default/Cell/fields/File/index.d.ts.map +0 -1
  918. package/dist/pages/List/Default/Cell/fields/File/index.js +0 -39
  919. package/dist/pages/List/Default/Cell/fields/File/index.scss +0 -23
  920. package/dist/pages/List/Default/Cell/fields/JSON/index.d.ts +0 -5
  921. package/dist/pages/List/Default/Cell/fields/JSON/index.d.ts.map +0 -1
  922. package/dist/pages/List/Default/Cell/fields/JSON/index.js +0 -26
  923. package/dist/pages/List/Default/Cell/fields/JSON/index.scss +0 -22
  924. package/dist/pages/List/Default/Cell/fields/Relationship/index.d.ts +0 -9
  925. package/dist/pages/List/Default/Cell/fields/Relationship/index.d.ts.map +0 -1
  926. package/dist/pages/List/Default/Cell/fields/Relationship/index.js +0 -121
  927. package/dist/pages/List/Default/Cell/fields/Relationship/index.scss +0 -3
  928. package/dist/pages/List/Default/Cell/fields/Richtext/index.d.ts +0 -2
  929. package/dist/pages/List/Default/Cell/fields/Richtext/index.d.ts.map +0 -1
  930. package/dist/pages/List/Default/Cell/fields/Richtext/index.js +0 -3
  931. package/dist/pages/List/Default/Cell/fields/Select/index.d.ts +0 -7
  932. package/dist/pages/List/Default/Cell/fields/Select/index.d.ts.map +0 -1
  933. package/dist/pages/List/Default/Cell/fields/Select/index.js +0 -40
  934. package/dist/pages/List/Default/Cell/fields/Textarea/index.d.ts +0 -4
  935. package/dist/pages/List/Default/Cell/fields/Textarea/index.d.ts.map +0 -1
  936. package/dist/pages/List/Default/Cell/fields/Textarea/index.js +0 -23
  937. package/dist/pages/List/Default/Cell/fields/index.d.ts +0 -17
  938. package/dist/pages/List/Default/Cell/fields/index.d.ts.map +0 -1
  939. package/dist/pages/List/Default/Cell/fields/index.js +0 -36
  940. package/dist/pages/List/Default/Cell/index.d.ts +0 -4
  941. package/dist/pages/List/Default/Cell/index.d.ts.map +0 -1
  942. package/dist/pages/List/Default/Cell/index.js +0 -89
  943. package/dist/pages/List/Default/RelationshipProvider/index.d.ts +0 -20
  944. package/dist/pages/List/Default/RelationshipProvider/index.d.ts.map +0 -1
  945. package/dist/pages/List/Default/RelationshipProvider/index.js +0 -153
  946. package/dist/pages/List/Default/RelationshipProvider/reducer.d.ts +0 -19
  947. package/dist/pages/List/Default/RelationshipProvider/reducer.d.ts.map +0 -1
  948. package/dist/pages/List/Default/RelationshipProvider/reducer.js +0 -55
  949. package/dist/pages/List/Default/index.d.ts.map +0 -1
  950. package/dist/pages/List/Default/index.js +0 -174
  951. package/dist/pages/List/Default/types.d.ts +0 -14
  952. package/dist/pages/List/Default/types.d.ts.map +0 -1
  953. package/dist/pages/List/Default/types.js +0 -6
  954. package/dist/pages/List/index.d.ts +0 -18
  955. package/dist/pages/List/index.d.ts.map +0 -1
  956. package/dist/pages/List/index.js +0 -158
  957. package/dist/pages/LivePreview/Context/collisionDetection.d.ts.map +0 -1
  958. package/dist/pages/LivePreview/Context/collisionDetection.js +0 -34
  959. package/dist/pages/LivePreview/Context/context.d.ts +0 -50
  960. package/dist/pages/LivePreview/Context/context.d.ts.map +0 -1
  961. package/dist/pages/LivePreview/Context/context.js +0 -58
  962. package/dist/pages/LivePreview/Context/index.d.ts +0 -18
  963. package/dist/pages/LivePreview/Context/index.d.ts.map +0 -1
  964. package/dist/pages/LivePreview/Context/index.js +0 -208
  965. package/dist/pages/LivePreview/Context/sizeReducer.d.ts.map +0 -1
  966. package/dist/pages/LivePreview/Context/sizeReducer.js +0 -41
  967. package/dist/pages/LivePreview/Device/index.d.ts.map +0 -1
  968. package/dist/pages/LivePreview/Device/index.js +0 -102
  969. package/dist/pages/LivePreview/DeviceContainer/index.d.ts.map +0 -1
  970. package/dist/pages/LivePreview/DeviceContainer/index.js +0 -44
  971. package/dist/pages/LivePreview/IFrame/index.d.ts +0 -8
  972. package/dist/pages/LivePreview/IFrame/index.d.ts.map +0 -1
  973. package/dist/pages/LivePreview/IFrame/index.js +0 -74
  974. package/dist/pages/LivePreview/Preview/index.d.ts +0 -5
  975. package/dist/pages/LivePreview/Preview/index.d.ts.map +0 -1
  976. package/dist/pages/LivePreview/Preview/index.js +0 -127
  977. package/dist/pages/LivePreview/Toolbar/Controls/index.d.ts +0 -5
  978. package/dist/pages/LivePreview/Toolbar/Controls/index.d.ts.map +0 -1
  979. package/dist/pages/LivePreview/Toolbar/Controls/index.js +0 -96
  980. package/dist/pages/LivePreview/Toolbar/SizeInput/index.d.ts.map +0 -1
  981. package/dist/pages/LivePreview/Toolbar/SizeInput/index.js +0 -112
  982. package/dist/pages/LivePreview/Toolbar/index.d.ts +0 -7
  983. package/dist/pages/LivePreview/Toolbar/index.d.ts.map +0 -1
  984. package/dist/pages/LivePreview/Toolbar/index.js +0 -65
  985. package/dist/pages/LivePreview/ToolbarArea/index.d.ts.map +0 -1
  986. package/dist/pages/LivePreview/ToolbarArea/index.js +0 -32
  987. package/dist/pages/LivePreview/index.client.d.ts +0 -11
  988. package/dist/pages/LivePreview/index.client.d.ts.map +0 -1
  989. package/dist/pages/LivePreview/index.client.js +0 -195
  990. package/dist/pages/LivePreview/index.d.ts +0 -5
  991. package/dist/pages/LivePreview/index.d.ts.map +0 -1
  992. package/dist/pages/LivePreview/index.js +0 -59
  993. package/dist/pages/LivePreview/meta.d.ts +0 -3
  994. package/dist/pages/LivePreview/meta.d.ts.map +0 -1
  995. package/dist/pages/LivePreview/meta.js +0 -36
  996. package/dist/pages/LivePreview/usePopupWindow.d.ts.map +0 -1
  997. package/dist/pages/LivePreview/usePopupWindow.js +0 -112
  998. package/dist/pages/Login/LoginForm/index.d.ts.map +0 -1
  999. package/dist/pages/Login/LoginForm/index.js +0 -67
  1000. package/dist/pages/Login/index.d.ts +0 -14
  1001. package/dist/pages/Login/index.d.ts.map +0 -1
  1002. package/dist/pages/Login/index.js +0 -108
  1003. package/dist/pages/Login/index.scss +0 -38
  1004. package/dist/pages/Logout/LogoutClient.d.ts.map +0 -1
  1005. package/dist/pages/Logout/LogoutClient.js +0 -88
  1006. package/dist/pages/Logout/index.d.ts +0 -16
  1007. package/dist/pages/Logout/index.d.ts.map +0 -1
  1008. package/dist/pages/Logout/index.js +0 -61
  1009. package/dist/pages/NotFound/index.d.ts +0 -7
  1010. package/dist/pages/NotFound/index.d.ts.map +0 -1
  1011. package/dist/pages/NotFound/index.js +0 -48
  1012. package/dist/pages/NotFound/index.scss +0 -36
  1013. package/dist/pages/ResetPassword/index.d.ts +0 -12
  1014. package/dist/pages/ResetPassword/index.d.ts.map +0 -1
  1015. package/dist/pages/ResetPassword/index.js +0 -99
  1016. package/dist/pages/ResetPassword/index.scss +0 -15
  1017. package/dist/pages/Root/index.d.ts +0 -5
  1018. package/dist/pages/Root/index.d.ts.map +0 -1
  1019. package/dist/pages/Root/index.js +0 -17
  1020. package/dist/pages/Unauthorized/UnauthorizedClient.d.ts +0 -5
  1021. package/dist/pages/Unauthorized/UnauthorizedClient.d.ts.map +0 -1
  1022. package/dist/pages/Unauthorized/UnauthorizedClient.js +0 -27
  1023. package/dist/pages/Unauthorized/index.d.ts +0 -10
  1024. package/dist/pages/Unauthorized/index.d.ts.map +0 -1
  1025. package/dist/pages/Unauthorized/index.js +0 -51
  1026. package/dist/pages/Verify/index.d.ts +0 -13
  1027. package/dist/pages/Verify/index.d.ts.map +0 -1
  1028. package/dist/pages/Verify/index.js +0 -90
  1029. package/dist/pages/Version/Default/SetStepNav.d.ts +0 -13
  1030. package/dist/pages/Version/Default/SetStepNav.d.ts.map +0 -1
  1031. package/dist/pages/Version/Default/SetStepNav.js +0 -92
  1032. package/dist/pages/Version/Default/index.d.ts +0 -5
  1033. package/dist/pages/Version/Default/index.d.ts.map +0 -1
  1034. package/dist/pages/Version/Default/index.js +0 -157
  1035. package/dist/pages/Version/Default/types.d.ts +0 -24
  1036. package/dist/pages/Version/Default/types.d.ts.map +0 -1
  1037. package/dist/pages/Version/Default/types.js +0 -6
  1038. package/dist/pages/Version/RenderFieldsToDiff/Label/index.d.ts.map +0 -1
  1039. package/dist/pages/Version/RenderFieldsToDiff/Label/index.js +0 -24
  1040. package/dist/pages/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts +0 -6
  1041. package/dist/pages/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +0 -1
  1042. package/dist/pages/Version/RenderFieldsToDiff/fields/Iterable/index.js +0 -80
  1043. package/dist/pages/Version/RenderFieldsToDiff/fields/Nested/index.d.ts +0 -6
  1044. package/dist/pages/Version/RenderFieldsToDiff/fields/Nested/index.d.ts.map +0 -1
  1045. package/dist/pages/Version/RenderFieldsToDiff/fields/Nested/index.js +0 -44
  1046. package/dist/pages/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts +0 -6
  1047. package/dist/pages/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts.map +0 -1
  1048. package/dist/pages/Version/RenderFieldsToDiff/fields/Relationship/index.js +0 -89
  1049. package/dist/pages/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.d.ts.map +0 -1
  1050. package/dist/pages/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js +0 -72
  1051. package/dist/pages/Version/RenderFieldsToDiff/fields/Select/index.d.ts +0 -6
  1052. package/dist/pages/Version/RenderFieldsToDiff/fields/Select/index.d.ts.map +0 -1
  1053. package/dist/pages/Version/RenderFieldsToDiff/fields/Select/index.js +0 -54
  1054. package/dist/pages/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts +0 -5
  1055. package/dist/pages/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts.map +0 -1
  1056. package/dist/pages/Version/RenderFieldsToDiff/fields/Tabs/index.js +0 -54
  1057. package/dist/pages/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.d.ts.map +0 -1
  1058. package/dist/pages/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js +0 -72
  1059. package/dist/pages/Version/RenderFieldsToDiff/fields/Text/index.d.ts +0 -6
  1060. package/dist/pages/Version/RenderFieldsToDiff/fields/Text/index.d.ts.map +0 -1
  1061. package/dist/pages/Version/RenderFieldsToDiff/fields/Text/index.js +0 -46
  1062. package/dist/pages/Version/RenderFieldsToDiff/fields/diffMethods.d.ts.map +0 -1
  1063. package/dist/pages/Version/RenderFieldsToDiff/fields/diffMethods.js +0 -18
  1064. package/dist/pages/Version/RenderFieldsToDiff/fields/index.d.ts +0 -25
  1065. package/dist/pages/Version/RenderFieldsToDiff/fields/index.d.ts.map +0 -1
  1066. package/dist/pages/Version/RenderFieldsToDiff/fields/index.js +0 -44
  1067. package/dist/pages/Version/RenderFieldsToDiff/fields/styles.d.ts.map +0 -1
  1068. package/dist/pages/Version/RenderFieldsToDiff/fields/styles.js +0 -38
  1069. package/dist/pages/Version/RenderFieldsToDiff/fields/types.d.ts +0 -21
  1070. package/dist/pages/Version/RenderFieldsToDiff/fields/types.d.ts.map +0 -1
  1071. package/dist/pages/Version/RenderFieldsToDiff/fields/types.js +0 -6
  1072. package/dist/pages/Version/RenderFieldsToDiff/index.d.ts +0 -6
  1073. package/dist/pages/Version/RenderFieldsToDiff/index.d.ts.map +0 -1
  1074. package/dist/pages/Version/RenderFieldsToDiff/index.js +0 -115
  1075. package/dist/pages/Version/RenderFieldsToDiff/types.d.ts +0 -20
  1076. package/dist/pages/Version/RenderFieldsToDiff/types.d.ts.map +0 -1
  1077. package/dist/pages/Version/RenderFieldsToDiff/types.js +0 -6
  1078. package/dist/pages/Version/Restore/index.d.ts +0 -6
  1079. package/dist/pages/Version/Restore/index.d.ts.map +0 -1
  1080. package/dist/pages/Version/Restore/index.js +0 -121
  1081. package/dist/pages/Version/Restore/index.scss +0 -28
  1082. package/dist/pages/Version/Restore/types.d.ts +0 -11
  1083. package/dist/pages/Version/Restore/types.d.ts.map +0 -1
  1084. package/dist/pages/Version/Restore/types.js +0 -6
  1085. package/dist/pages/Version/SelectComparison/index.d.ts +0 -5
  1086. package/dist/pages/Version/SelectComparison/index.d.ts.map +0 -1
  1087. package/dist/pages/Version/SelectComparison/index.js +0 -167
  1088. package/dist/pages/Version/SelectComparison/types.d.ts +0 -27
  1089. package/dist/pages/Version/SelectComparison/types.d.ts.map +0 -1
  1090. package/dist/pages/Version/SelectComparison/types.js +0 -6
  1091. package/dist/pages/Version/SelectLocales/index.d.ts +0 -5
  1092. package/dist/pages/Version/SelectLocales/index.d.ts.map +0 -1
  1093. package/dist/pages/Version/SelectLocales/index.js +0 -47
  1094. package/dist/pages/Version/SelectLocales/types.d.ts +0 -7
  1095. package/dist/pages/Version/SelectLocales/types.d.ts.map +0 -1
  1096. package/dist/pages/Version/SelectLocales/types.js +0 -6
  1097. package/dist/pages/Version/index.d.ts +0 -4
  1098. package/dist/pages/Version/index.d.ts.map +0 -1
  1099. package/dist/pages/Version/index.js +0 -111
  1100. package/dist/pages/Version/meta.d.ts +0 -3
  1101. package/dist/pages/Version/meta.d.ts.map +0 -1
  1102. package/dist/pages/Version/meta.js +0 -47
  1103. package/dist/pages/Version/shared.d.ts.map +0 -1
  1104. package/dist/pages/Version/shared.js +0 -28
  1105. package/dist/pages/Versions/buildColumns.d.ts +0 -11
  1106. package/dist/pages/Versions/buildColumns.d.ts.map +0 -1
  1107. package/dist/pages/Versions/buildColumns.js +0 -69
  1108. package/dist/pages/Versions/cells/AutosaveCell/index.d.ts.map +0 -1
  1109. package/dist/pages/Versions/cells/AutosaveCell/index.js +0 -63
  1110. package/dist/pages/Versions/cells/CreatedAt/index.d.ts.map +0 -1
  1111. package/dist/pages/Versions/cells/CreatedAt/index.js +0 -33
  1112. package/dist/pages/Versions/cells/ID/index.d.ts.map +0 -1
  1113. package/dist/pages/Versions/cells/ID/index.js +0 -60
  1114. package/dist/pages/Versions/index.client.d.ts +0 -15
  1115. package/dist/pages/Versions/index.client.d.ts.map +0 -1
  1116. package/dist/pages/Versions/index.client.js +0 -142
  1117. package/dist/pages/Versions/index.d.ts +0 -6
  1118. package/dist/pages/Versions/index.d.ts.map +0 -1
  1119. package/dist/pages/Versions/index.js +0 -125
  1120. package/dist/pages/Versions/meta.d.ts +0 -3
  1121. package/dist/pages/Versions/meta.d.ts.map +0 -1
  1122. package/dist/pages/Versions/meta.js +0 -43
  1123. package/dist/pages/Versions/types.d.ts.map +0 -1
  1124. package/dist/pages/Versions/types.js +0 -6
  1125. package/dist/routes/rest/RouteError.d.ts +0 -13
  1126. package/dist/routes/rest/RouteError.d.ts.map +0 -1
  1127. package/dist/routes/rest/RouteError.js +0 -104
  1128. package/dist/routes/rest/[collection]/file/[filename]/route.d.ts +0 -8
  1129. package/dist/routes/rest/[collection]/file/[filename]/route.d.ts.map +0 -1
  1130. package/dist/routes/rest/[collection]/file/[filename]/route.js +0 -116
  1131. package/dist/scss/fonts.scss +0 -75
  1132. package/dist/static/SuisseIntl-Bold.2211c494.woff +0 -0
  1133. package/dist/static/SuisseIntl-Bold.9c7dfd00.woff2 +0 -0
  1134. package/dist/static/SuisseIntl-Medium.5b718d97.woff2 +0 -0
  1135. package/dist/static/SuisseIntl-Medium.d7aeda9e.woff +0 -0
  1136. package/dist/static/SuisseIntl-SemiBold.40ad7515.woff2 +0 -0
  1137. package/dist/static/SuisseIntl-SemiBold.e7caa9e1.woff +0 -0
  1138. package/dist/static/SuisseIntl.51922ceb.woff2 +0 -0
  1139. package/dist/static/SuisseIntl.8b4ddd0d.woff +0 -0
  1140. package/dist/static/merriweather-v30-latin-900.52244336.woff2 +0 -0
  1141. package/dist/static/merriweather-v30-latin-900.efe8f6a3.woff +0 -0
  1142. package/dist/static/merriweather-v30-latin-900italic.78b8935f.woff +0 -0
  1143. package/dist/static/merriweather-v30-latin-900italic.f53bb8d4.woff2 +0 -0
  1144. package/dist/static/merriweather-v30-latin-italic.8f612153.woff +0 -0
  1145. package/dist/static/merriweather-v30-latin-italic.a1cfdc5b.woff2 +0 -0
  1146. package/dist/static/merriweather-v30-latin-regular.787999a6.woff +0 -0
  1147. package/dist/static/merriweather-v30-latin-regular.e009f214.woff2 +0 -0
  1148. package/dist/styles.css +0 -1
  1149. package/dist/utilities/auth.d.ts +0 -10
  1150. package/dist/utilities/auth.d.ts.map +0 -1
  1151. package/dist/utilities/auth.js +0 -42
  1152. package/dist/utilities/createClientConfig.d.ts +0 -5
  1153. package/dist/utilities/createClientConfig.d.ts.map +0 -1
  1154. package/dist/utilities/createClientConfig.js +0 -120
  1155. package/dist/utilities/getNextI18n.d.ts +0 -7
  1156. package/dist/utilities/getNextI18n.d.ts.map +0 -1
  1157. package/dist/utilities/getNextI18n.js +0 -28
  1158. package/dist/utilities/getNextT.d.ts +0 -7
  1159. package/dist/utilities/getNextT.d.ts.map +0 -1
  1160. package/dist/utilities/getNextT.js +0 -28
  1161. package/dist/utilities/initPage.d.ts +0 -21
  1162. package/dist/utilities/initPage.d.ts.map +0 -1
  1163. package/dist/utilities/initPage.js +0 -79
  1164. package/src/index.ts +0 -6
  1165. /package/dist/{next-fileupload → fetchAPI-multipart}/isEligibleRequest.d.ts +0 -0
  1166. /package/dist/{next-fileupload → fetchAPI-multipart}/processNested.d.ts +0 -0
  1167. /package/dist/{next-fileupload → fetchAPI-multipart}/uploadTimer.d.ts +0 -0
  1168. /package/dist/{pages → views}/API/RenderJSON/index.d.ts +0 -0
  1169. /package/dist/{pages → views}/API/RenderJSON/index.scss +0 -0
  1170. /package/dist/{pages → views}/API/index.scss +0 -0
  1171. /package/dist/{pages → views}/Account/Settings/index.d.ts +0 -0
  1172. /package/dist/{pages → views}/Account/Settings/index.scss +0 -0
  1173. /package/dist/{pages → views}/Account/ToggleTheme/index.d.ts +0 -0
  1174. /package/dist/{pages → views}/Dashboard/Default/index.scss +0 -0
  1175. /package/dist/{pages → views}/Edit/Default/Auth/index.scss +0 -0
  1176. /package/dist/{pages → views}/Edit/Default/Auth/types.d.ts +0 -0
  1177. /package/dist/{pages → views}/Edit/Default/index.d.ts +0 -0
  1178. /package/dist/{pages → views}/Edit/Default/index.scss +0 -0
  1179. /package/dist/{pages → views}/Edit/Default/types.d.ts +0 -0
  1180. /package/dist/{pages → views}/List/Default/index.d.ts +0 -0
  1181. /package/dist/{pages → views}/List/Default/index.scss +0 -0
  1182. /package/dist/{pages → views}/LivePreview/Context/collisionDetection.d.ts +0 -0
  1183. /package/dist/{pages → views}/LivePreview/Context/sizeReducer.d.ts +0 -0
  1184. /package/dist/{pages → views}/LivePreview/Device/index.d.ts +0 -0
  1185. /package/dist/{pages → views}/LivePreview/DeviceContainer/index.d.ts +0 -0
  1186. /package/dist/{pages → views}/LivePreview/IFrame/index.scss +0 -0
  1187. /package/dist/{pages → views}/LivePreview/Preview/index.scss +0 -0
  1188. /package/dist/{pages → views}/LivePreview/Toolbar/Controls/index.scss +0 -0
  1189. /package/dist/{pages → views}/LivePreview/Toolbar/SizeInput/index.d.ts +0 -0
  1190. /package/dist/{pages → views}/LivePreview/Toolbar/SizeInput/index.scss +0 -0
  1191. /package/dist/{pages → views}/LivePreview/Toolbar/index.scss +0 -0
  1192. /package/dist/{pages → views}/LivePreview/ToolbarArea/index.d.ts +0 -0
  1193. /package/dist/{pages → views}/LivePreview/ToolbarArea/index.scss +0 -0
  1194. /package/dist/{pages → views}/LivePreview/index.scss +0 -0
  1195. /package/dist/{pages → views}/LivePreview/usePopupWindow.d.ts +0 -0
  1196. /package/dist/{pages → views}/Login/LoginForm/index.d.ts +0 -0
  1197. /package/dist/{pages → views}/Login/LoginForm/index.scss +0 -0
  1198. /package/dist/{pages → views}/Logout/LogoutClient.d.ts +0 -0
  1199. /package/dist/{pages → views}/Logout/index.scss +0 -0
  1200. /package/dist/{pages → views}/Verify/index.scss +0 -0
  1201. /package/dist/{pages → views}/Version/Default/index.scss +0 -0
  1202. /package/dist/{pages → views}/Version/RenderFieldsToDiff/Label/index.d.ts +0 -0
  1203. /package/dist/{pages → views}/Version/RenderFieldsToDiff/Label/index.scss +0 -0
  1204. /package/dist/{pages → views}/Version/RenderFieldsToDiff/fields/Iterable/index.scss +0 -0
  1205. /package/dist/{pages → views}/Version/RenderFieldsToDiff/fields/Nested/index.scss +0 -0
  1206. /package/dist/{pages → views}/Version/RenderFieldsToDiff/fields/Relationship/index.scss +0 -0
  1207. /package/dist/{pages → views}/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.d.ts +0 -0
  1208. /package/dist/{pages → views}/Version/RenderFieldsToDiff/fields/Select/index.scss +0 -0
  1209. /package/dist/{pages → views}/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.d.ts +0 -0
  1210. /package/dist/{pages → views}/Version/RenderFieldsToDiff/fields/Text/index.scss +0 -0
  1211. /package/dist/{pages → views}/Version/RenderFieldsToDiff/fields/diffMethods.d.ts +0 -0
  1212. /package/dist/{pages → views}/Version/RenderFieldsToDiff/fields/styles.d.ts +0 -0
  1213. /package/dist/{pages → views}/Version/RenderFieldsToDiff/index.scss +0 -0
  1214. /package/dist/{pages → views}/Version/SelectComparison/index.scss +0 -0
  1215. /package/dist/{pages → views}/Version/SelectLocales/index.scss +0 -0
  1216. /package/dist/{pages → views}/Version/shared.d.ts +0 -0
  1217. /package/dist/{pages → views}/Versions/cells/AutosaveCell/index.d.ts +0 -0
  1218. /package/dist/{pages → views}/Versions/cells/CreatedAt/index.d.ts +0 -0
  1219. /package/dist/{pages → views}/Versions/cells/ID/index.d.ts +0 -0
  1220. /package/dist/{pages → views}/Versions/index.scss +0 -0
  1221. /package/dist/{pages → views}/Versions/types.d.ts +0 -0
@@ -0,0 +1,75 @@
1
+ import { tabHasName } from 'payload/types';
2
+ export const traverseFields = ({ config, fields, i18n, schemaMap, schemaPath, validRelationships })=>{
3
+ fields.map((field)=>{
4
+ switch(field.type){
5
+ case 'group':
6
+ case 'array':
7
+ schemaMap.set(`${schemaPath}.${field.name}`, field.fields);
8
+ traverseFields({
9
+ config,
10
+ fields: field.fields,
11
+ i18n,
12
+ schemaMap,
13
+ schemaPath: `${schemaPath}.${field.name}`,
14
+ validRelationships
15
+ });
16
+ break;
17
+ case 'collapsible':
18
+ case 'row':
19
+ traverseFields({
20
+ config,
21
+ fields: field.fields,
22
+ i18n,
23
+ schemaMap,
24
+ schemaPath,
25
+ validRelationships
26
+ });
27
+ break;
28
+ case 'blocks':
29
+ field.blocks.map((block)=>{
30
+ const blockSchemaPath = `${schemaPath}.${field.name}.${block.slug}`;
31
+ schemaMap.set(blockSchemaPath, block.fields);
32
+ traverseFields({
33
+ config,
34
+ fields: block.fields,
35
+ i18n,
36
+ schemaMap,
37
+ schemaPath: blockSchemaPath,
38
+ validRelationships
39
+ });
40
+ });
41
+ break;
42
+ case 'richText':
43
+ if (typeof field.editor === 'function') {
44
+ throw new Error('Attempted to access unsanitized rich text editor.');
45
+ }
46
+ if (typeof field.editor.generateSchemaMap === 'function') {
47
+ field.editor.generateSchemaMap({
48
+ config,
49
+ i18n,
50
+ schemaMap,
51
+ schemaPath: `${schemaPath}.${field.name}`
52
+ });
53
+ }
54
+ break;
55
+ case 'tabs':
56
+ field.tabs.map((tab)=>{
57
+ const tabSchemaPath = tabHasName(tab) ? `${schemaPath}.${tab.name}` : schemaPath;
58
+ if (tabHasName(tab)) {
59
+ schemaMap.set(tabSchemaPath, tab.fields);
60
+ }
61
+ traverseFields({
62
+ config,
63
+ fields: tab.fields,
64
+ i18n,
65
+ schemaMap,
66
+ schemaPath: tabSchemaPath,
67
+ validRelationships
68
+ });
69
+ });
70
+ break;
71
+ }
72
+ });
73
+ };
74
+
75
+ //# sourceMappingURL=traverseFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utilities/buildFieldSchemaMap/traverseFields.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { Field, SanitizedConfig } from 'payload/types'\n\nimport { tabHasName } from 'payload/types'\n\nimport type { FieldSchemaMap } from './types.js'\n\ntype Args = {\n config: SanitizedConfig\n fields: Field[]\n i18n: I18n\n schemaMap: FieldSchemaMap\n schemaPath: string\n validRelationships: string[]\n}\n\nexport const traverseFields = ({\n config,\n fields,\n i18n,\n schemaMap,\n schemaPath,\n validRelationships,\n}: Args) => {\n fields.map((field) => {\n switch (field.type) {\n case 'group':\n case 'array':\n schemaMap.set(`${schemaPath}.${field.name}`, field.fields)\n\n traverseFields({\n config,\n fields: field.fields,\n i18n,\n schemaMap,\n schemaPath: `${schemaPath}.${field.name}`,\n validRelationships,\n })\n break\n\n case 'collapsible':\n case 'row':\n traverseFields({\n config,\n fields: field.fields,\n i18n,\n schemaMap,\n schemaPath,\n validRelationships,\n })\n break\n\n case 'blocks':\n field.blocks.map((block) => {\n const blockSchemaPath = `${schemaPath}.${field.name}.${block.slug}`\n\n schemaMap.set(blockSchemaPath, block.fields)\n\n traverseFields({\n config,\n fields: block.fields,\n i18n,\n schemaMap,\n schemaPath: blockSchemaPath,\n validRelationships,\n })\n })\n break\n\n case 'richText':\n if (typeof field.editor === 'function') {\n throw new Error('Attempted to access unsanitized rich text editor.')\n }\n\n if (typeof field.editor.generateSchemaMap === 'function') {\n field.editor.generateSchemaMap({\n config,\n i18n,\n schemaMap,\n schemaPath: `${schemaPath}.${field.name}`,\n })\n }\n\n break\n\n case 'tabs':\n field.tabs.map((tab) => {\n const tabSchemaPath = tabHasName(tab) ? `${schemaPath}.${tab.name}` : schemaPath\n\n if (tabHasName(tab)) {\n schemaMap.set(tabSchemaPath, tab.fields)\n }\n\n traverseFields({\n config,\n fields: tab.fields,\n i18n,\n schemaMap,\n schemaPath: tabSchemaPath,\n validRelationships,\n })\n })\n break\n }\n })\n}\n"],"names":["tabHasName","traverseFields","config","fields","i18n","schemaMap","schemaPath","validRelationships","map","field","type","set","name","blocks","block","blockSchemaPath","slug","editor","Error","generateSchemaMap","tabs","tab","tabSchemaPath"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,UAAU,QAAQ,gBAAe;AAa1C,OAAO,MAAMC,iBAAiB,CAAC,EAC7BC,MAAM,EACNC,MAAM,EACNC,IAAI,EACJC,SAAS,EACTC,UAAU,EACVC,kBAAkB,EACb;IACLJ,OAAOK,GAAG,CAAC,CAACC;QACV,OAAQA,MAAMC,IAAI;YAChB,KAAK;YACL,KAAK;gBACHL,UAAUM,GAAG,CAAC,CAAC,EAAEL,WAAW,CAAC,EAAEG,MAAMG,IAAI,CAAC,CAAC,EAAEH,MAAMN,MAAM;gBAEzDF,eAAe;oBACbC;oBACAC,QAAQM,MAAMN,MAAM;oBACpBC;oBACAC;oBACAC,YAAY,CAAC,EAAEA,WAAW,CAAC,EAAEG,MAAMG,IAAI,CAAC,CAAC;oBACzCL;gBACF;gBACA;YAEF,KAAK;YACL,KAAK;gBACHN,eAAe;oBACbC;oBACAC,QAAQM,MAAMN,MAAM;oBACpBC;oBACAC;oBACAC;oBACAC;gBACF;gBACA;YAEF,KAAK;gBACHE,MAAMI,MAAM,CAACL,GAAG,CAAC,CAACM;oBAChB,MAAMC,kBAAkB,CAAC,EAAET,WAAW,CAAC,EAAEG,MAAMG,IAAI,CAAC,CAAC,EAAEE,MAAME,IAAI,CAAC,CAAC;oBAEnEX,UAAUM,GAAG,CAACI,iBAAiBD,MAAMX,MAAM;oBAE3CF,eAAe;wBACbC;wBACAC,QAAQW,MAAMX,MAAM;wBACpBC;wBACAC;wBACAC,YAAYS;wBACZR;oBACF;gBACF;gBACA;YAEF,KAAK;gBACH,IAAI,OAAOE,MAAMQ,MAAM,KAAK,YAAY;oBACtC,MAAM,IAAIC,MAAM;gBAClB;gBAEA,IAAI,OAAOT,MAAMQ,MAAM,CAACE,iBAAiB,KAAK,YAAY;oBACxDV,MAAMQ,MAAM,CAACE,iBAAiB,CAAC;wBAC7BjB;wBACAE;wBACAC;wBACAC,YAAY,CAAC,EAAEA,WAAW,CAAC,EAAEG,MAAMG,IAAI,CAAC,CAAC;oBAC3C;gBACF;gBAEA;YAEF,KAAK;gBACHH,MAAMW,IAAI,CAACZ,GAAG,CAAC,CAACa;oBACd,MAAMC,gBAAgBtB,WAAWqB,OAAO,CAAC,EAAEf,WAAW,CAAC,EAAEe,IAAIT,IAAI,CAAC,CAAC,GAAGN;oBAEtE,IAAIN,WAAWqB,MAAM;wBACnBhB,UAAUM,GAAG,CAACW,eAAeD,IAAIlB,MAAM;oBACzC;oBAEAF,eAAe;wBACbC;wBACAC,QAAQkB,IAAIlB,MAAM;wBAClBC;wBACAC;wBACAC,YAAYgB;wBACZf;oBACF;gBACF;gBACA;QACJ;IACF;AACF,EAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Field } from 'payload/types';
2
+ export type FieldSchemaMap = Map<string, Field[]>;
3
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utilities/buildFieldSchemaMap/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE1C,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utilities/buildFieldSchemaMap/types.ts"],"sourcesContent":["import type { Field } from 'payload/types'\n\nexport type FieldSchemaMap = Map<string, Field[]>\n"],"names":[],"rangeMappings":"","mappings":"AAEA,WAAiD"}
@@ -1 +1 @@
1
- {"version":3,"file":"createPayloadRequest.d.ts","sourceRoot":"","sources":["../../src/utilities/createPayloadRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,cAAc,EACd,eAAe,EAChB,MAAM,eAAe,CAAA;AActB,KAAK,IAAI,GAAG;IACV,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAAA;IAClD,MAAM,CAAC,EAAE;QACP,UAAU,EAAE,MAAM,CAAA;KACnB,CAAA;IACD,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,oBAAoB,gDAI9B,IAAI,KAAG,QAAQ,cAAc,CAoF/B,CAAA"}
1
+ {"version":3,"file":"createPayloadRequest.d.ts","sourceRoot":"","sources":["../../src/utilities/createPayloadRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkC,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAapG,KAAK,IAAI,GAAG;IACV,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAAA;IAClD,MAAM,CAAC,EAAE;QACP,UAAU,EAAE,MAAM,CAAA;KACnB,CAAA;IACD,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,oBAAoB,gDAI9B,IAAI,KAAG,QAAQ,cAAc,CA+E/B,CAAA"}
@@ -1,71 +1,50 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "createPayloadRequest", {
6
- enumerable: true,
7
- get: function() {
8
- return createPayloadRequest;
9
- }
10
- });
11
- const _translations = require("@payloadcms/translations");
12
- const _api = require("@payloadcms/translations/api");
13
- const _payload = require("payload");
14
- const _auth = require("payload/auth");
15
- const _utilities = require("payload/utilities");
16
- const _url = require("url");
17
- const _getDataAndFile = require("./getDataAndFile");
18
- const _getRequestLanguage = require("./getRequestLanguage");
19
- const _getRequestLocales = require("./getRequestLocales");
20
- const createPayloadRequest = async ({ config: configPromise, params, request })=>{
21
- const cookies = (0, _auth.parseCookies)(request.headers);
22
- const payload = await (0, _payload.getPayload)({
1
+ import { initI18n } from '@payloadcms/translations';
2
+ import { executeAuthStrategies } from 'payload/auth';
3
+ import { parseCookies } from 'payload/auth';
4
+ import { getDataLoader } from 'payload/utilities';
5
+ import qs from 'qs';
6
+ import { URL } from 'url';
7
+ import { sanitizeLocales } from './addLocalesToRequest.js';
8
+ import { getPayloadHMR } from './getPayloadHMR.js';
9
+ import { getRequestLanguage } from './getRequestLanguage.js';
10
+ export const createPayloadRequest = async ({ config: configPromise, params, request })=>{
11
+ const cookies = parseCookies(request.headers);
12
+ const payload = await getPayloadHMR({
23
13
  config: configPromise
24
14
  });
25
- const { collections, config } = payload;
26
- let collection = undefined;
27
- if (params?.collection && collections?.[params.collection]) {
28
- collection = collections[params.collection];
29
- }
30
- const urlProperties = new _url.URL(request.url);
15
+ const { config } = payload;
16
+ const urlProperties = new URL(request.url);
31
17
  const { pathname, searchParams } = urlProperties;
32
18
  const isGraphQL = !config.graphQL.disable && pathname === `${config.routes.api}${config.routes.graphQL}`;
33
- const { data, file } = await (0, _getDataAndFile.getDataAndFile)({
34
- collection,
19
+ const language = getRequestLanguage({
35
20
  config,
36
- request
37
- });
38
- let requestFallbackLocale;
39
- let requestLocale;
40
- if (config.localization) {
41
- const locales = (0, _getRequestLocales.getRequestLocales)({
42
- data,
43
- localization: config.localization,
44
- searchParams
45
- });
46
- requestLocale = locales.locale;
47
- requestFallbackLocale = locales.fallbackLocale;
48
- }
49
- const language = (0, _getRequestLanguage.getRequestLanguage)({
50
21
  cookies,
51
22
  headers: request.headers
52
23
  });
53
- const i18n = (0, _translations.initI18n)({
24
+ const i18n = await initI18n({
54
25
  config: config.i18n,
55
26
  context: 'api',
56
- language,
57
- translations: _api.translations
27
+ language
58
28
  });
29
+ let locale;
30
+ let fallbackLocale;
31
+ if (config.localization) {
32
+ const locales = sanitizeLocales({
33
+ fallbackLocale: searchParams.get('fallback-locale'),
34
+ locale: searchParams.get('locale'),
35
+ localization: payload.config.localization
36
+ });
37
+ locale = locales.locale;
38
+ fallbackLocale = locales.fallbackLocale;
39
+ }
59
40
  const customRequest = {
60
41
  context: {},
61
- data,
62
- fallbackLocale: requestFallbackLocale,
63
- file,
42
+ fallbackLocale,
64
43
  hash: urlProperties.hash,
65
44
  host: urlProperties.host,
66
45
  href: urlProperties.href,
67
46
  i18n,
68
- locale: requestLocale,
47
+ locale,
69
48
  origin: urlProperties.origin,
70
49
  pathname: urlProperties.pathname,
71
50
  payload,
@@ -74,6 +53,11 @@ const createPayloadRequest = async ({ config: configPromise, params, request })=
74
53
  payloadUploadSizes: {},
75
54
  port: urlProperties.port,
76
55
  protocol: urlProperties.protocol,
56
+ query: urlProperties.search ? qs.parse(urlProperties.search, {
57
+ arrayLimit: 1000,
58
+ depth: 10,
59
+ ignoreQueryPrefix: true
60
+ }) : {},
77
61
  routeParams: params || {},
78
62
  search: urlProperties.search,
79
63
  searchParams: urlProperties.searchParams,
@@ -82,8 +66,8 @@ const createPayloadRequest = async ({ config: configPromise, params, request })=
82
66
  user: null
83
67
  };
84
68
  const req = Object.assign(request, customRequest);
85
- req.payloadDataLoader = (0, _utilities.getDataLoader)(req);
86
- req.user = await (0, _auth.getAuthenticatedUser)({
69
+ req.payloadDataLoader = getDataLoader(req);
70
+ req.user = await executeAuthStrategies({
87
71
  cookies,
88
72
  headers: req.headers,
89
73
  isGraphQL,
@@ -92,4 +76,4 @@ const createPayloadRequest = async ({ config: configPromise, params, request })=
92
76
  return req;
93
77
  };
94
78
 
95
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvY3JlYXRlUGF5bG9hZFJlcXVlc3QudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUge1xuICBDb2xsZWN0aW9uLFxuICBDdXN0b21QYXlsb2FkUmVxdWVzdCxcbiAgUGF5bG9hZFJlcXVlc3QsXG4gIFNhbml0aXplZENvbmZpZyxcbn0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHsgaW5pdEkxOG4gfSBmcm9tICdAcGF5bG9hZGNtcy90cmFuc2xhdGlvbnMnXG5pbXBvcnQgeyB0cmFuc2xhdGlvbnMgfSBmcm9tICdAcGF5bG9hZGNtcy90cmFuc2xhdGlvbnMvYXBpJ1xuaW1wb3J0IHsgZ2V0UGF5bG9hZCB9IGZyb20gJ3BheWxvYWQnXG5pbXBvcnQgeyBnZXRBdXRoZW50aWNhdGVkVXNlciB9IGZyb20gJ3BheWxvYWQvYXV0aCdcbmltcG9ydCB7IHBhcnNlQ29va2llcyB9IGZyb20gJ3BheWxvYWQvYXV0aCdcbmltcG9ydCB7IGdldERhdGFMb2FkZXIgfSBmcm9tICdwYXlsb2FkL3V0aWxpdGllcydcbmltcG9ydCB7IFVSTCB9IGZyb20gJ3VybCdcblxuaW1wb3J0IHsgZ2V0RGF0YUFuZEZpbGUgfSBmcm9tICcuL2dldERhdGFBbmRGaWxlJ1xuaW1wb3J0IHsgZ2V0UmVxdWVzdExhbmd1YWdlIH0gZnJvbSAnLi9nZXRSZXF1ZXN0TGFuZ3VhZ2UnXG5pbXBvcnQgeyBnZXRSZXF1ZXN0TG9jYWxlcyB9IGZyb20gJy4vZ2V0UmVxdWVzdExvY2FsZXMnXG5cbnR5cGUgQXJncyA9IHtcbiAgY29uZmlnOiBQcm9taXNlPFNhb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FBQ3BDckQ7UUFDQUUsU0FBUytDLElBQUkvQyxPQUFPO1FBQ3BCVztRQUNBVjtJQUNGO0lBRUEsT0FBTzhDO0FBQ1QifQ==
79
+ //# sourceMappingURL=createPayloadRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utilities/createPayloadRequest.ts"],"sourcesContent":["import type { CustomPayloadRequestProperties, PayloadRequest, SanitizedConfig } from 'payload/types'\n\nimport { initI18n } from '@payloadcms/translations'\nimport { executeAuthStrategies } from 'payload/auth'\nimport { parseCookies } from 'payload/auth'\nimport { getDataLoader } from 'payload/utilities'\nimport qs from 'qs'\nimport { URL } from 'url'\n\nimport { sanitizeLocales } from './addLocalesToRequest.js'\nimport { getPayloadHMR } from './getPayloadHMR.js'\nimport { getRequestLanguage } from './getRequestLanguage.js'\n\ntype Args = {\n config: Promise<SanitizedConfig> | SanitizedConfig\n params?: {\n collection: string\n }\n request: Request\n}\n\nexport const createPayloadRequest = async ({\n config: configPromise,\n params,\n request,\n}: Args): Promise<PayloadRequest> => {\n const cookies = parseCookies(request.headers)\n const payload = await getPayloadHMR({ config: configPromise })\n\n const { config } = payload\n\n const urlProperties = new URL(request.url)\n const { pathname, searchParams } = urlProperties\n\n const isGraphQL =\n !config.graphQL.disable && pathname === `${config.routes.api}${config.routes.graphQL}`\n\n const language = getRequestLanguage({\n config,\n cookies,\n headers: request.headers,\n })\n\n const i18n = await initI18n({\n config: config.i18n,\n context: 'api',\n language,\n })\n\n let locale\n let fallbackLocale\n if (config.localization) {\n const locales = sanitizeLocales({\n fallbackLocale: searchParams.get('fallback-locale'),\n locale: searchParams.get('locale'),\n localization: payload.config.localization,\n })\n locale = locales.locale\n fallbackLocale = locales.fallbackLocale\n }\n\n const customRequest: CustomPayloadRequestProperties = {\n context: {},\n fallbackLocale,\n hash: urlProperties.hash,\n host: urlProperties.host,\n href: urlProperties.href,\n i18n,\n locale,\n origin: urlProperties.origin,\n pathname: urlProperties.pathname,\n payload,\n payloadAPI: isGraphQL ? 'GraphQL' : 'REST',\n payloadDataLoader: undefined,\n payloadUploadSizes: {},\n port: urlProperties.port,\n protocol: urlProperties.protocol,\n query: urlProperties.search\n ? qs.parse(urlProperties.search, {\n arrayLimit: 1000,\n depth: 10,\n ignoreQueryPrefix: true,\n })\n : {},\n routeParams: params || {},\n search: urlProperties.search,\n searchParams: urlProperties.searchParams,\n t: i18n.t,\n transactionID: undefined,\n user: null,\n }\n\n const req: PayloadRequest = Object.assign(request, customRequest)\n\n req.payloadDataLoader = getDataLoader(req)\n\n req.user = await executeAuthStrategies({\n cookies,\n headers: req.headers,\n isGraphQL,\n payload,\n })\n\n return req\n}\n"],"names":["initI18n","executeAuthStrategies","parseCookies","getDataLoader","qs","URL","sanitizeLocales","getPayloadHMR","getRequestLanguage","createPayloadRequest","config","configPromise","params","request","cookies","headers","payload","urlProperties","url","pathname","searchParams","isGraphQL","graphQL","disable","routes","api","language","i18n","context","locale","fallbackLocale","localization","locales","get","customRequest","hash","host","href","origin","payloadAPI","payloadDataLoader","undefined","payloadUploadSizes","port","protocol","query","search","parse","arrayLimit","depth","ignoreQueryPrefix","routeParams","t","transactionID","user","req","Object","assign"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,qBAAqB,QAAQ,eAAc;AACpD,SAASC,YAAY,QAAQ,eAAc;AAC3C,SAASC,aAAa,QAAQ,oBAAmB;AACjD,OAAOC,QAAQ,KAAI;AACnB,SAASC,GAAG,QAAQ,MAAK;AAEzB,SAASC,eAAe,QAAQ,2BAA0B;AAC1D,SAASC,aAAa,QAAQ,qBAAoB;AAClD,SAASC,kBAAkB,QAAQ,0BAAyB;AAU5D,OAAO,MAAMC,uBAAuB,OAAO,EACzCC,QAAQC,aAAa,EACrBC,MAAM,EACNC,OAAO,EACF;IACL,MAAMC,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,MAAM,EAAE;YAC7BE,YAAY;YACZC,OAAO;YACPC,mBAAmB;QACrB,KACA,CAAC;QACLC,aAAavC,UAAU,CAAC;QACxBkC,QAAQ7B,cAAc6B,MAAM;QAC5B1B,cAAcH,cAAcG,YAAY;QACxCgC,GAAGzB,KAAKyB,CAAC;QACTC,eAAeZ;QACfa,MAAM;IACR;IAEA,MAAMC,MAAsBC,OAAOC,MAAM,CAAC5C,SAASqB;IAEnDqB,IAAIf,iBAAiB,GAAGrC,cAAcoD;IAEtCA,IAAID,IAAI,GAAG,MAAMrD,sBAAsB;QACrCa;QACAC,SAASwC,IAAIxC,OAAO;QACpBM;QACAL;IACF;IAEA,OAAOuC;AACT,EAAC"}
@@ -1,11 +1,11 @@
1
- import type { Collection, CustomPayloadRequest, SanitizedConfig } from 'payload/types';
1
+ import type { Collection, PayloadRequestWithData, SanitizedConfig } from 'payload/types';
2
2
  type GetDataAndFile = (args: {
3
3
  collection: Collection;
4
4
  config: SanitizedConfig;
5
5
  request: Request;
6
6
  }) => Promise<{
7
7
  data: Record<string, any>;
8
- file: CustomPayloadRequest['file'];
8
+ file: PayloadRequestWithData['file'];
9
9
  }>;
10
10
  export declare const getDataAndFile: GetDataAndFile;
11
11
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"getDataAndFile.d.ts","sourceRoot":"","sources":["../../src/utilities/getDataAndFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAItF,KAAK,cAAc,GAAG,CAAC,IAAI,EAAE;IAC3B,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,eAAe,CAAA;IACvB,OAAO,EAAE,OAAO,CAAA;CACjB,KAAK,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAA;CACnC,CAAC,CAAA;AACF,eAAO,MAAM,cAAc,EAAE,cAmE5B,CAAA"}
1
+ {"version":3,"file":"getDataAndFile.d.ts","sourceRoot":"","sources":["../../src/utilities/getDataAndFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAMxF,KAAK,cAAc,GAAG,CAAC,IAAI,EAAE;IAC3B,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,eAAe,CAAA;IACvB,OAAO,EAAE,OAAO,CAAA;CACjB,KAAK,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAA;CACrC,CAAC,CAAA;AACF,eAAO,MAAM,cAAc,EAAE,cAwD5B,CAAA"}
@@ -1,66 +1,40 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "getDataAndFile", {
6
- enumerable: true,
7
- get: function() {
8
- return getDataAndFile;
9
- }
10
- });
11
- const _nextfileupload = require("../next-fileupload");
12
- const getDataAndFile = async ({ collection, config, request })=>{
1
+ import { fetchAPIFileUpload } from '../fetchAPI-multipart/index.js';
2
+ export const getDataAndFile = async ({ collection, config, request: incomingRequest })=>{
13
3
  let data = undefined;
14
4
  let file = undefined;
15
5
  if ([
16
6
  'PATCH',
17
7
  'POST',
18
8
  'PUT'
19
- ].includes(request.method.toUpperCase()) && request.body) {
20
- const [contentType] = request.headers.get('Content-Type').split(';');
9
+ ].includes(incomingRequest.method.toUpperCase()) && incomingRequest.body) {
10
+ const request = new Request(incomingRequest);
11
+ const [contentType] = (request.headers.get('Content-Type') || '').split(';');
21
12
  if (contentType === 'application/json') {
22
- data = await request.json();
23
- } else if (contentType === 'multipart/form-data') {
24
- // possible upload request
25
- if (collection.config.upload) {
26
- // load file in memory
27
- if (!config.upload?.useTempFiles) {
28
- const formData = await request.formData();
29
- const formFile = formData.get('file');
30
- if (formFile instanceof Blob) {
31
- const bytes = await formFile.arrayBuffer();
32
- const buffer = Buffer.from(bytes);
33
- file = {
34
- name: formFile.name,
35
- data: buffer,
36
- mimetype: formFile.type,
37
- size: formFile.size
38
- };
39
- }
40
- const payloadData = formData.get('_payload');
41
- if (typeof payloadData === 'string') {
42
- data = JSON.parse(payloadData);
43
- }
44
- } else {
45
- // store temp file on disk
46
- const { error, fields, files } = await (0, _nextfileupload.nextFileUpload)({
47
- options: config.upload,
48
- request
49
- });
50
- if (error) {
51
- throw new Error(error.message);
52
- }
53
- if (files?.file) file = files.file;
54
- if (fields?._payload && typeof fields._payload === 'string') {
55
- data = JSON.parse(fields._payload);
56
- }
13
+ const bodyByteSize = parseInt(request.headers.get('Content-Length') || '0', 10);
14
+ const upperByteLimit = typeof config.upload?.limits?.fieldSize === 'number' ? config.upload.limits.fields : undefined;
15
+ if (bodyByteSize <= upperByteLimit || upperByteLimit === undefined) {
16
+ try {
17
+ data = await request.json();
18
+ } catch (error) {
19
+ data = {};
57
20
  }
58
21
  } else {
59
- // non upload request
60
- const formData = await request.formData();
61
- const payloadData = formData.get('_payload');
62
- if (typeof payloadData === 'string') {
63
- data = JSON.parse(payloadData);
22
+ throw new Error('Request body size exceeds the limit');
23
+ }
24
+ } else {
25
+ if (request.headers.has('Content-Length') && request.headers.get('Content-Length') !== '0') {
26
+ const { error, fields, files } = await fetchAPIFileUpload({
27
+ options: config.upload,
28
+ request
29
+ });
30
+ if (error) {
31
+ throw new Error(error.message);
32
+ }
33
+ if (collection?.config?.upload && files?.file) {
34
+ file = files.file;
35
+ }
36
+ if (fields?._payload && typeof fields._payload === 'string') {
37
+ data = JSON.parse(fields._payload);
64
38
  }
65
39
  }
66
40
  }
@@ -71,4 +45,4 @@ const getDataAndFile = async ({ collection, config, request })=>{
71
45
  };
72
46
  };
73
47
 
74
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozL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9qc29uJykge1xuICAgICAgZGF0YSA9IGF3YWl0IHJlcXVlc3QuanNvbigpXG4gICAgfSBlbHNlIGlmIChjb250ZW50VHlwZSA9PT0gJ211bHRpcGFydC9mb3JtLWRhdGEnKSB7XG4gICAgICAvLyBwb3NzaWJsZSB1cGxvYWQgcmVxdWVzdFxuICAgICAgaWYgKGNvbGxlY3Rpb24uY29uZmlnLnVwbG9hZCkge1xuICAgICAgICAvLyBsb2FkIGZpbGUgaW4gbWVtb3J5XG4gICAgICAgIGlmICghY29uZmlnLnVwbG9hZD8udXNlVGVtcEZpbGVzKSB7XG4gICAgICAgICAgY29uc3QgZm9ybURhdGEgPSBhd2FpdCByZXF1ZXN0LmZvcm1EYXRhKClcbiAgICAgICAgICBjb25zdCBmb3JtRmlsZSA9IGZvcm1EYXRhLmdldCgnZmlsZScpXG5cbiAgICAgICAgICBpZiAoZm9ybUZpbGUgaW5zdGFuY2VvZiBCbG9iKSB7XG4gICAgICAgICAgICBjb25zdCBieXRlcyA9IGF3YWl0IGZvcm1GaWxlLmFycmF5QnVmZmVyKClcbiAgICAgICAgICAgIGNvbnN0IGJ1ZmZlciA9IEJ1ZmZlci5mcm9tKGJ5dGVzKVxuXG4gICAgICAgICAgICBmaWxlID0ge1xuICAgICAgICAgICAgICBuYW1lOiBmb3JtRmlsZS5uYW1lLFxuICAgICAgICAgICAgICBkYXRhOiBidWZmZXIsXG4gICAgICAgICAgICAgIG1pbWV0eXBlOiBmb3JtRmlsZS50eXBlLFxuICAgICAgICAgICAgICBzaXplOiBmb3JtRmlsZS5zaXplLFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbnN0IHBheWxvYWREYXRhID0gZm9ybURhdGEuZ2V0KCdfcGF5bG9hZCcpXG5cbiAgICAgICAgICBpZiAodHlwZW9mIHBheWxvYWREYXRhID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgZGF0YSA9IEpTT04ucGFyc2UocGF5bG9hZERhdGEpXG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIHN0b3JlIHRlbXAgZmlsZSBvbiBkaXNrXG4gICAgICAgICAgY29uc3QgeyBlcnJvciwgZmllbGRzLCBmaWxlcyB9ID0gYXdhaXQgbmV4dEZpbGVVcGxvYWQoe1xuICAgICAgICAgICAgb3B0aW9uczogY29uZmlnLnVwbG9hZCBhcyBhbnksXG4gICAgICAgICAgICByZXF1ZXN0LFxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBpZiAoZXJyb3IpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihlcnJvci5tZXNzYWdlKVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChmaWxlcz8uZmlsZSkgZmlsZSA9IGZpbGVzLmZpbGVcblxuICAgICAgICAgIGlmIChmaWVsZHM/Ll9wYXlsb2FkICYmIHR5cGVvZiBmaWVsZHMuX3BheWxvYWQgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBkYXRhID0gSlNPTi5wYXJzZShmaWVsZHMuX3BheWxvYWQpXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvLyBub24gdXBsb2FkIHJlcXVlc3RcbiAgICAgICAgY29uc3QgZm9ybURhdGEgPSBhd2FpdCByZXF1ZXN0LmZvcm1EYXRhKClcbiAgICAgICAgY29uc3QgcGF5bG9hZERhdGEgPSBmb3JtRGF0YS5nZXQoJ19wYXlsb2FkJylcblxuICAgICAgICBpZiAodHlwZW9mIHBheWxvYWREYXRhID09PSAnc3RyaW5nJykge1xuICAgICAgICAgIGRhdGEgPSBKU09OLnBhcnNlKHBheWxvYWREYXRhKVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIHtcbiAgICBkYXRhLFxuICAgIGZpbGUsXG4gIH1cbn1cbiJdLCJuYW1lcyI6WyJnZXREYXRhQW5kRmlsZSIsImNvbGxlY3Rp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QUtDLEtBQUssQ0FBQ0UsT0FBT00sUUFBUTtvQkFDbkM7Z0JBQ0Y7WUFDRixPQUFPO2dCQUNMLHFCQUFxQjtnQkFDckIsTUFBTXRCLFdBQVcsTUFBTWYsUUFBUWUsUUFBUTtnQkFDdkMsTUFBTVksY0FBY1osU0FBU0wsR0FBRyxDQUFDO2dCQUVqQyxJQUFJLE9BQU9pQixnQkFBZ0IsVUFBVTtvQkFDbkMxQixPQUFPMkIsS0FBS0MsS0FBSyxDQUFDRjtnQkFDcEI7WUFDRjtRQUNGO0lBQ0Y7SUFFQSxPQUFPO1FBQ0wxQjtRQUNBRTtJQUNGO0FBQ0YifQ==
48
+ //# sourceMappingURL=getDataAndFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utilities/getDataAndFile.ts"],"sourcesContent":["import type { Collection, PayloadRequestWithData, SanitizedConfig } from 'payload/types'\n\nimport type { FetchAPIFileUploadOptions } from '../fetchAPI-multipart/index.js'\n\nimport { fetchAPIFileUpload } from '../fetchAPI-multipart/index.js'\n\ntype GetDataAndFile = (args: {\n collection: Collection\n config: SanitizedConfig\n request: Request\n}) => Promise<{\n data: Record<string, any>\n file: PayloadRequestWithData['file']\n}>\nexport const getDataAndFile: GetDataAndFile = async ({\n collection,\n config,\n request: incomingRequest,\n}) => {\n let data: Record<string, any> = undefined\n let file: PayloadRequestWithData['file'] = undefined\n\n if (\n ['PATCH', 'POST', 'PUT'].includes(incomingRequest.method.toUpperCase()) &&\n incomingRequest.body\n ) {\n const request = new Request(incomingRequest)\n const [contentType] = (request.headers.get('Content-Type') || '').split(';')\n\n if (contentType === 'application/json') {\n const bodyByteSize = parseInt(request.headers.get('Content-Length') || '0', 10)\n const upperByteLimit =\n typeof config.upload?.limits?.fieldSize === 'number'\n ? config.upload.limits.fields\n : undefined\n if (bodyByteSize <= upperByteLimit || upperByteLimit === undefined) {\n try {\n data = await request.json()\n } catch (error) {\n data = {}\n }\n } else {\n throw new Error('Request body size exceeds the limit')\n }\n } else {\n if (request.headers.has('Content-Length') && request.headers.get('Content-Length') !== '0') {\n const { error, fields, files } = await fetchAPIFileUpload({\n options: config.upload as FetchAPIFileUploadOptions,\n request,\n })\n\n if (error) {\n throw new Error(error.message)\n }\n\n if (collection?.config?.upload && files?.file) {\n file = files.file\n }\n\n if (fields?._payload && typeof fields._payload === 'string') {\n data = JSON.parse(fields._payload)\n }\n }\n }\n }\n\n return {\n data,\n file,\n }\n}\n"],"names":["fetchAPIFileUpload","getDataAndFile","collection","config","request","incomingRequest","data","undefined","file","includes","method","toUpperCase","body","Request","contentType","headers","get","split","bodyByteSize","parseInt","upperByteLimit","upload","limits","fieldSize","fields","json","error","Error","has","files","options","message","_payload","JSON","parse"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,kBAAkB,QAAQ,iCAAgC;AAUnE,OAAO,MAAMC,iBAAiC,OAAO,EACnDC,UAAU,EACVC,MAAM,EACNC,SAASC,eAAe,EACzB;IACC,IAAIC,OAA4BC;IAChC,IAAIC,OAAuCD;IAE3C,IACE;QAAC;QAAS;QAAQ;KAAM,CAACE,QAAQ,CAACJ,gBAAgBK,MAAM,CAACC,WAAW,OACpEN,gBAAgBO,IAAI,EACpB;QACA,MAAMR,UAAU,IAAIS,QAAQR;QAC5B,MAAM,CAACS,YAAY,GAAG,AAACV,CAAAA,QAAQW,OAAO,CAACC,GAAG,CAAC,mBAAmB,EAAC,EAAGC,KAAK,CAAC;QAExE,IAAIH,gBAAgB,oBAAoB;YACtC,MAAMI,eAAeC,SAASf,QAAQW,OAAO,CAACC,GAAG,CAAC,qBAAqB,KAAK;YAC5E,MAAMI,iBACJ,OAAOjB,OAAOkB,MAAM,EAAEC,QAAQC,cAAc,WACxCpB,OAAOkB,MAAM,CAACC,MAAM,CAACE,MAAM,GAC3BjB;YACN,IAAIW,gBAAgBE,kBAAkBA,mBAAmBb,WAAW;gBAClE,IAAI;oBACFD,OAAO,MAAMF,QAAQqB,IAAI;gBAC3B,EAAE,OAAOC,OAAO;oBACdpB,OAAO,CAAC;gBACV;YACF,OAAO;gBACL,MAAM,IAAIqB,MAAM;YAClB;QACF,OAAO;YACL,IAAIvB,QAAQW,OAAO,CAACa,GAAG,CAAC,qBAAqBxB,QAAQW,OAAO,CAACC,GAAG,CAAC,sBAAsB,KAAK;gBAC1F,MAAM,EAAEU,KAAK,EAAEF,MAAM,EAAEK,KAAK,EAAE,GAAG,MAAM7B,mBAAmB;oBACxD8B,SAAS3B,OAAOkB,MAAM;oBACtBjB;gBACF;gBAEA,IAAIsB,OAAO;oBACT,MAAM,IAAIC,MAAMD,MAAMK,OAAO;gBAC/B;gBAEA,IAAI7B,YAAYC,QAAQkB,UAAUQ,OAAOrB,MAAM;oBAC7CA,OAAOqB,MAAMrB,IAAI;gBACnB;gBAEA,IAAIgB,QAAQQ,YAAY,OAAOR,OAAOQ,QAAQ,KAAK,UAAU;oBAC3D1B,OAAO2B,KAAKC,KAAK,CAACV,OAAOQ,QAAQ;gBACnC;YACF;QACF;IACF;IAEA,OAAO;QACL1B;QACAE;IACF;AACF,EAAC"}
@@ -0,0 +1,11 @@
1
+ import type { I18n } from '@payloadcms/translations';
2
+ import type { SanitizedConfig } from 'payload/types';
3
+ /**
4
+ * In the context of NextJS, this function initializes the i18n object for the current request.
5
+ *
6
+ * It must be called on the server side, and within the lifecycle of a request since it relies on the request headers and cookies.
7
+ */
8
+ export declare const getNextRequestI18n: ({ config }: {
9
+ config: SanitizedConfig;
10
+ }) => Promise<I18n>;
11
+ //# sourceMappingURL=getNextRequestI18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNextRequestI18n.d.ts","sourceRoot":"","sources":["../../src/utilities/getNextRequestI18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAOpD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,eAAsB;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,KAAG,QAAQ,IAAI,CAK3F,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { initI18n } from '@payloadcms/translations';
2
+ import { cookies, headers } from 'next/headers.js';
3
+ import { getRequestLanguage } from './getRequestLanguage.js';
4
+ /**
5
+ * In the context of NextJS, this function initializes the i18n object for the current request.
6
+ *
7
+ * It must be called on the server side, and within the lifecycle of a request since it relies on the request headers and cookies.
8
+ */ export const getNextRequestI18n = async ({ config })=>initI18n({
9
+ config: config.i18n,
10
+ context: 'client',
11
+ language: getRequestLanguage({
12
+ config,
13
+ cookies: cookies(),
14
+ headers: headers()
15
+ })
16
+ });
17
+
18
+ //# sourceMappingURL=getNextRequestI18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utilities/getNextRequestI18n.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { SanitizedConfig } from 'payload/types'\n\nimport { initI18n } from '@payloadcms/translations'\nimport { cookies, headers } from 'next/headers.js'\n\nimport { getRequestLanguage } from './getRequestLanguage.js'\n\n/**\n * In the context of NextJS, this function initializes the i18n object for the current request.\n *\n * It must be called on the server side, and within the lifecycle of a request since it relies on the request headers and cookies.\n */\nexport const getNextRequestI18n = async ({ config }: { config: SanitizedConfig }): Promise<I18n> =>\n initI18n({\n config: config.i18n,\n context: 'client',\n language: getRequestLanguage({ config, cookies: cookies(), headers: headers() }),\n })\n"],"names":["initI18n","cookies","headers","getRequestLanguage","getNextRequestI18n","config","i18n","context","language"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,OAAO,EAAEC,OAAO,QAAQ,kBAAiB;AAElD,SAASC,kBAAkB,QAAQ,0BAAyB;AAE5D;;;;CAIC,GACD,OAAO,MAAMC,qBAAqB,OAAO,EAAEC,MAAM,EAA+B,GAC9EL,SAAS;QACPK,QAAQA,OAAOC,IAAI;QACnBC,SAAS;QACTC,UAAUL,mBAAmB;YAAEE;YAAQJ,SAASA;YAAWC,SAASA;QAAU;IAChF,GAAE"}
@@ -0,0 +1,5 @@
1
+ import type { Payload } from 'payload';
2
+ import type { InitOptions, SanitizedConfig } from 'payload/config';
3
+ export declare const reload: (config: SanitizedConfig, payload: Payload) => Promise<void>;
4
+ export declare const getPayloadHMR: (options: InitOptions) => Promise<Payload>;
5
+ //# sourceMappingURL=getPayloadHMR.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPayloadHMR.d.ts","sourceRoot":"","sources":["../../src/utilities/getPayloadHMR.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,OAAO,EAAE,MAAM,SAAS,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAgBlE,eAAO,MAAM,MAAM,WAAkB,eAAe,uBAAqB,QAAQ,IAAI,CAuBpF,CAAA;AAED,eAAO,MAAM,aAAa,YAAmB,WAAW,KAAG,QAAQ,OAAO,CA4DzE,CAAA"}
@@ -0,0 +1,79 @@
1
+ import { BasePayload } from 'payload';
2
+ import WebSocket from 'ws';
3
+ let cached = global._payload;
4
+ if (!cached) {
5
+ // eslint-disable-next-line no-multi-assign
6
+ cached = global._payload = {
7
+ payload: null,
8
+ promise: null,
9
+ reload: false
10
+ };
11
+ }
12
+ export const reload = async (config, payload)=>{
13
+ if (typeof payload.db.destroy === 'function') {
14
+ await payload.db.destroy();
15
+ }
16
+ payload.config = config;
17
+ payload.collections = config.collections.reduce((collections, collection)=>{
18
+ collections[collection.slug] = {
19
+ config: collection,
20
+ customIDType: payload.collections[collection.slug]?.customIDType
21
+ };
22
+ return collections;
23
+ }, {});
24
+ payload.globals = {
25
+ config: config.globals
26
+ };
27
+ // TODO: support HMR for other props in the future (see payload/src/index init()) hat may change on Payload singleton
28
+ await payload.db.init();
29
+ await payload.db.connect({
30
+ hotReload: true
31
+ });
32
+ };
33
+ export const getPayloadHMR = async (options)=>{
34
+ if (!options?.config) {
35
+ throw new Error('Error: the payload config is required for getPayload to work.');
36
+ }
37
+ if (cached.payload) {
38
+ const config = await options.config // TODO: check if we can move this inside the cached.reload === true condition
39
+ ;
40
+ if (cached.reload === true) {
41
+ let resolve;
42
+ cached.reload = new Promise((res)=>resolve = res);
43
+ await reload(config, cached.payload);
44
+ resolve();
45
+ }
46
+ if (cached.reload instanceof Promise) {
47
+ await cached.reload;
48
+ }
49
+ return cached.payload;
50
+ }
51
+ if (!cached.promise) {
52
+ cached.promise = new BasePayload().init(options);
53
+ }
54
+ try {
55
+ cached.payload = await cached.promise;
56
+ if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test' && process.env.DISABLE_PAYLOAD_HMR !== 'true') {
57
+ try {
58
+ const port = process.env.PORT || '3000';
59
+ const ws = new WebSocket(`ws://localhost:${port}/_next/webpack-hmr`);
60
+ ws.onmessage = (event)=>{
61
+ if (typeof event.data === 'string') {
62
+ const data = JSON.parse(event.data);
63
+ if ('action' in data && data.action === 'serverComponentChanges') {
64
+ cached.reload = true;
65
+ }
66
+ }
67
+ };
68
+ } catch (_) {
69
+ // swallow e
70
+ }
71
+ }
72
+ } catch (e) {
73
+ cached.promise = null;
74
+ throw e;
75
+ }
76
+ return cached.payload;
77
+ };
78
+
79
+ //# sourceMappingURL=getPayloadHMR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utilities/getPayloadHMR.ts"],"sourcesContent":["import type { GeneratedTypes, Payload } from 'payload'\nimport type { InitOptions, SanitizedConfig } from 'payload/config'\n\nimport { BasePayload } from 'payload'\nimport WebSocket from 'ws'\n\nlet cached: {\n payload: Payload | null\n promise: Promise<Payload> | null\n reload: Promise<boolean> | boolean\n} = global._payload\n\nif (!cached) {\n // eslint-disable-next-line no-multi-assign\n cached = global._payload = { payload: null, promise: null, reload: false }\n}\n\nexport const reload = async (config: SanitizedConfig, payload: Payload): Promise<void> => {\n if (typeof payload.db.destroy === 'function') {\n await payload.db.destroy()\n }\n\n payload.config = config\n\n payload.collections = config.collections.reduce((collections, collection) => {\n collections[collection.slug] = {\n config: collection,\n customIDType: payload.collections[collection.slug]?.customIDType,\n }\n return collections\n }, {})\n\n payload.globals = {\n config: config.globals,\n }\n\n // TODO: support HMR for other props in the future (see payload/src/index init()) hat may change on Payload singleton\n\n await payload.db.init()\n await payload.db.connect({ hotReload: true })\n}\n\nexport const getPayloadHMR = async (options: InitOptions): Promise<Payload> => {\n if (!options?.config) {\n throw new Error('Error: the payload config is required for getPayload to work.')\n }\n\n if (cached.payload) {\n const config = await options.config // TODO: check if we can move this inside the cached.reload === true condition\n\n if (cached.reload === true) {\n let resolve\n\n cached.reload = new Promise((res) => (resolve = res))\n\n await reload(config, cached.payload)\n\n resolve()\n }\n\n if (cached.reload instanceof Promise) {\n await cached.reload\n }\n\n return cached.payload\n }\n\n if (!cached.promise) {\n cached.promise = new BasePayload<GeneratedTypes>().init(options)\n }\n\n try {\n cached.payload = await cached.promise\n\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.NODE_ENV !== 'test' &&\n process.env.DISABLE_PAYLOAD_HMR !== 'true'\n ) {\n try {\n const port = process.env.PORT || '3000'\n const ws = new WebSocket(`ws://localhost:${port}/_next/webpack-hmr`)\n\n ws.onmessage = (event) => {\n if (typeof event.data === 'string') {\n const data = JSON.parse(event.data)\n\n if ('action' in data && data.action === 'serverComponentChanges') {\n cached.reload = true\n }\n }\n }\n } catch (_) {\n // swallow e\n }\n }\n } catch (e) {\n cached.promise = null\n throw e\n }\n\n return cached.payload\n}\n"],"names":["BasePayload","WebSocket","cached","global","_payload","payload","promise","reload","config","db","destroy","collections","reduce","collection","slug","customIDType","globals","init","connect","hotReload","getPayloadHMR","options","Error","resolve","Promise","res","process","env","NODE_ENV","DISABLE_PAYLOAD_HMR","port","PORT","ws","onmessage","event","data","JSON","parse","action","_","e"],"rangeMappings":";;;;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C,QAAQN,OAAOG,OAAO;YAEnCkB;QACF;QAEA,IAAIrB,OAAOK,MAAM,YAAYiB,SAAS;YACpC,MAAMtB,OAAOK,MAAM;QACrB;QAEA,OAAOL,OAAOG,OAAO;IACvB;IAEA,IAAI,CAACH,OAAOI,OAAO,EAAE;QACnBJ,OAAOI,OAAO,GAAG,IAAIN,cAA8BiB,IAAI,CAACI;IAC1D;IAEA,IAAI;QACFnB,OAAOG,OAAO,GAAG,MAAMH,OAAOI,OAAO;QAErC,IACEoB,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBACzBF,QAAQC,GAAG,CAACC,QAAQ,KAAK,UACzBF,QAAQC,GAAG,CAACE,mBAAmB,KAAK,QACpC;YACA,IAAI;gBACF,MAAMC,OAAOJ,QAAQC,GAAG,CAACI,IAAI,IAAI;gBACjC,MAAMC,KAAK,IAAI/B,UAAU,CAAC,eAAe,EAAE6B,KAAK,kBAAkB,CAAC;gBAEnEE,GAAGC,SAAS,GAAG,CAACC;oBACd,IAAI,OAAOA,MAAMC,IAAI,KAAK,UAAU;wBAClC,MAAMA,OAAOC,KAAKC,KAAK,CAACH,MAAMC,IAAI;wBAElC,IAAI,YAAYA,QAAQA,KAAKG,MAAM,KAAK,0BAA0B;4BAChEpC,OAAOK,MAAM,GAAG;wBAClB;oBACF;gBACF;YACF,EAAE,OAAOgC,GAAG;YACV,YAAY;YACd;QACF;IACF,EAAE,OAAOC,GAAG;QACVtC,OAAOI,OAAO,GAAG;QACjB,MAAMkC;IACR;IAEA,OAAOtC,OAAOG,OAAO;AACvB,EAAC"}
@@ -1,9 +1,12 @@
1
- import type { ReadonlyRequestCookies } from 'next/dist/server/web/spec-extension/adapters/request-cookies';
1
+ import type { AcceptedLanguages } from '@payloadcms/translations';
2
+ import type { ReadonlyRequestCookies } from 'next/dist/server/web/spec-extension/adapters/request-cookies.js';
3
+ import type { SanitizedConfig } from 'payload/config';
2
4
  type GetRequestLanguageArgs = {
5
+ config: SanitizedConfig;
3
6
  cookies: Map<string, string> | ReadonlyRequestCookies;
4
- defaultLanguage?: string;
7
+ defaultLanguage?: AcceptedLanguages;
5
8
  headers: Request['headers'];
6
9
  };
7
- export declare const getRequestLanguage: ({ cookies, defaultLanguage, headers, }: GetRequestLanguageArgs) => string;
10
+ export declare const getRequestLanguage: ({ config, cookies, headers, }: GetRequestLanguageArgs) => AcceptedLanguages;
8
11
  export {};
9
12
  //# sourceMappingURL=getRequestLanguage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getRequestLanguage.d.ts","sourceRoot":"","sources":["../../src/utilities/getRequestLanguage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAA;AAI1G,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,sBAAsB,CAAA;IACrD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,kBAAkB,2CAI5B,sBAAsB,KAAG,MAU3B,CAAA"}
1
+ {"version":3,"file":"getRequestLanguage.d.ts","sourceRoot":"","sources":["../../src/utilities/getRequestLanguage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iEAAiE,CAAA;AAC7G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAIrD,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,eAAe,CAAA;IACvB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,sBAAsB,CAAA;IACrD,eAAe,CAAC,EAAE,iBAAiB,CAAA;IACnC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,kBAAkB,kCAI5B,sBAAsB,KAAG,iBAmB3B,CAAA"}
@@ -1,19 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "getRequestLanguage", {
6
- enumerable: true,
7
- get: function() {
8
- return getRequestLanguage;
1
+ import { extractHeaderLanguage } from '@payloadcms/translations';
2
+ export const getRequestLanguage = ({ config, cookies, headers })=>{
3
+ const supportedLanguageKeys = Object.keys(config.i18n.supportedLanguages);
4
+ const langCookie = cookies.get(`${config.cookiePrefix || 'payload'}-lng`);
5
+ const languageFromCookie = typeof langCookie === 'string' ? langCookie : langCookie?.value;
6
+ const languageFromHeader = headers.get('Accept-Language') ? extractHeaderLanguage(headers.get('Accept-Language')) : undefined;
7
+ if (languageFromCookie && supportedLanguageKeys.includes(languageFromCookie)) {
8
+ return languageFromCookie;
9
9
  }
10
- });
11
- const _translations = require("@payloadcms/translations");
12
- const getRequestLanguage = ({ cookies, defaultLanguage = 'en', headers })=>{
13
- const acceptLanguage = headers.get('Accept-Language');
14
- const cookieLanguage = cookies.get('lng');
15
- const reqLanguage = acceptLanguage || (typeof cookieLanguage === 'string' ? cookieLanguage : cookieLanguage?.value) || defaultLanguage;
16
- return (0, _translations.matchLanguage)(reqLanguage);
10
+ if (languageFromHeader && supportedLanguageKeys.includes(languageFromHeader)) {
11
+ return languageFromHeader;
12
+ }
13
+ return config.i18n.fallbackLanguage;
17
14
  };
18
15
 
19
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvZ2V0UmVxdWVzdExhbmd1YWdlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgUmVhZG9ubHlSZXF1ZXN0Q29va2llcyB9IGZyb20gJ25leHQvZGlzdC9zZXJ2ZXIvd2ViL3NwZWMtZXh0ZW5zaW9uL2FkYXB0ZXJzL3JlcXVlc3QtY29va2llcydcblx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